AutoBE
    Preparing search index...

    Interface AutoBeAnalyzeScenarioEvent

    Event interface for analyze scenario composition operations in the AutoBE system.

    This interface represents an event that orchestrates the creation of multiple analysis documents as part of a comprehensive requirements analysis phase. It enables the Analyze Agent to generate a series of interconnected planning documents that collectively form a complete specification for backend development.

    The scenario event follows the waterfall model approach, where each document builds upon previous ones to create a logical flow of information from high-level service overview to detailed technical specifications. This systematic approach ensures that all aspects of the backend system are thoroughly documented before any code generation begins.

    Key characteristics:

    • Supports multi-document analysis scenarios (minimum 1 document required)
    • Maintains context between documents through the step tracking
    • Defines user roles that will be used for authentication/authorization
    • Uses prefix for consistent naming and organization of generated documents

    Typical usage flow:

    1. Initial event creates overview and requirements documents (step 1-3)
    2. Subsequent events add user flows and technical specs (step 4-6)
    3. Final events complete with API specifications and data models (step 7+)

    Kakasoo

    interface AutoBeAnalyzeScenarioEvent {
        created_at: string & Format<"date-time">;
        files: Scenario[] & MinItems<1>;
        id: string;
        language?: string;
        prefix: string;
        roles: AutoBeAnalyzeRole[];
        step: number;
        tokenUsage: IAutoBeTokenUsageJson.IComponent;
        type: "analyzeScenario";
    }

    Hierarchy (View Summary)

    Index

    Properties

    created_at: string & Format<"date-time">

    Timestamp when the event was created.

    ISO 8601 formatted date-time string indicating when this event was emitted by the system. This timestamp is crucial for event ordering, performance analysis, and debugging the agent workflow execution timeline.

    Format: "YYYY-MM-DDTHH:mm:ss.sssZ" (e.g., "2024-01-15T14:30:45.123Z")

    files: Scenario[] & MinItems<1>

    Array of document specifications to be generated in this scenario.

    This array defines the planning documents that the Analyze Agent will create during this event. Each document serves a specific purpose in the requirements analysis phase and contributes to the overall system specification.

    Requirements:

    • Minimum of 1 document per event (enforced by tags.MinItems<1>)
    • Documents should follow a logical progression
    • Each document should build upon information from previous ones
    • Later documents can reference earlier ones via relatedDocuments field

    Typical document progression:

    1. Service Overview - High-level vision and goals
    2. Requirements - Functional and non-functional requirements
    3. User Stories - Detailed user personas and scenarios
    4. User Flows - Step-by-step interaction sequences
    5. Business Model - Revenue, costs, and value propositions
    6. API Specification - Detailed endpoint documentation
    7. Data Models - Database schema and relationships

    The array structure allows flexible composition of documents based on project complexity and specific needs.

    id: string

    A unique identifier for the event.

    language?: string

    Language for document content. When specified by the user, this takes precedence over the locale setting for determining document language.

    prefix: string

    Prefix identifier for the analysis scenario.

    This prefix serves as a namespace for all documents generated within this scenario, ensuring consistent organization and preventing naming conflicts. It typically represents the project or service name and is used to:

    • Group related analysis documents together
    • Create a consistent naming convention for generated files
    • Identify the context for subsequent agent operations
    • Enable parallel analysis of multiple services without conflicts

    Examples: "e-commerce", "social-media", "banking-system", "logistics-platform"

    The prefix should be:

    • Lowercase with hyphens for multi-word names
    • Descriptive enough to identify the service uniquely
    • Consistent across all related events in the scenario

    Array of user roles that will interact with the backend system.

    These roles define the different types of authenticated users who will access the system, each with their own permissions and capabilities. The roles specified here directly influence:

    • Prisma schema generation (user models and role relationships)
    • API endpoint authorization decorators
    • Test scenario generation for different permission levels
    • Business logic for role-based access control

    Common patterns:

    • Public systems: ["customer", "admin"]
    • Marketplace: ["buyer", "seller", "admin", "support"]
    • Enterprise: ["employee", "manager", "hr", "admin", "auditor"]
    • Educational: ["student", "teacher", "parent", "admin"]

    Each role should have a clear, distinct purpose and non-overlapping responsibilities to ensure clean authorization logic in the generated code.

    step: number

    Current step number in the multi-event analysis scenario.

    This field tracks the progression through a series of related analyze events, allowing the system to maintain context and ensure proper document sequencing. The step number is crucial for:

    • Maintaining document creation order
    • Referencing previous documents in the scenario
    • Determining when the analysis phase is complete
    • Coordinating with other agents that depend on analysis results

    Step progression patterns:

    • Step 1-3: Foundation documents (overview, requirements, user stories)
    • Step 4-6: Detailed specifications (user flows, business model, architecture)
    • Step 7+: Technical documents (API specs, data models, integration guides)

    The step number should increment with each new event in the same scenario, and agents use this to understand the current phase of analysis.

    Detailed token usage metrics for the current operation.

    Contains comprehensive token consumption data including total usage, input token breakdown with cache statistics, and output token categorization by generation type. This component-level tracking enables precise analysis of resource utilization for specific agent operations such as schema generation, test writing, or code implementation.

    The token usage data helps identify optimization opportunities, monitor operational costs, and ensure efficient use of AI resources throughout the automated backend development process.

    type: "analyzeScenario"

    Unique identifier for the event type.

    A literal string that discriminates between different event types in the AutoBE system. This field enables TypeScript's discriminated union feature, allowing type-safe event handling through switch statements or conditional checks.

    Examples: "analyzeWrite", "prismaSchemas", "interfaceOperations", "testScenarios"