sweagent 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -750,385 +750,6 @@ interface HelloWorldAgentConfig {
750
750
  }
751
751
  declare function runHelloWorldAgent(config: HelloWorldAgentConfig): Promise<AgentResult>;
752
752
 
753
- /**
754
- * Field-level schema for MongoDB collection fields
755
- */
756
-
757
- declare const fieldSchema: z.ZodObject<{
758
- fieldName: z.ZodString;
759
- fieldType: z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<"string" | "number" | "boolean" | "object" | "enum" | "Date" | "Types.ObjectId" | "email" | "password", string>>, z.ZodEnum<{
760
- string: "string";
761
- number: "number";
762
- boolean: "boolean";
763
- object: "object";
764
- enum: "enum";
765
- Date: "Date";
766
- "Types.ObjectId": "Types.ObjectId";
767
- email: "email";
768
- password: "password";
769
- }>>;
770
- isArray: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
771
- isRequired: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
772
- isUnique: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
773
- values: z.ZodDefault<z.ZodArray<z.ZodString>>;
774
- defaultVal: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodNull]>>;
775
- relationTo: z.ZodOptional<z.ZodString>;
776
- relationType: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"" | "one-to-one" | "many-to-one", string>>, z.ZodEnum<{
777
- "": "";
778
- "one-to-one": "one-to-one";
779
- "many-to-one": "many-to-one";
780
- }>>>;
781
- isPrivate: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
782
- }, z.core.$strip>;
783
- type TFieldSchema = z.infer<typeof fieldSchema>;
784
-
785
- /**
786
- * Module (collection) level schema for MongoDB
787
- */
788
-
789
- declare const moduleSchema: z.ZodObject<{
790
- moduleName: z.ZodString;
791
- isUserModule: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
792
- authMethod: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"" | "EMAIL_AND_PASSWORD" | "PHONE_AND_OTP", string>>, z.ZodEnum<{
793
- "": "";
794
- EMAIL_AND_PASSWORD: "EMAIL_AND_PASSWORD";
795
- PHONE_AND_OTP: "PHONE_AND_OTP";
796
- }>>>;
797
- emailField: z.ZodOptional<z.ZodString>;
798
- passwordField: z.ZodOptional<z.ZodString>;
799
- phoneField: z.ZodOptional<z.ZodString>;
800
- roleField: z.ZodOptional<z.ZodString>;
801
- permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodEnum<{
802
- CREATE: "CREATE";
803
- READ: "READ";
804
- UPDATE: "UPDATE";
805
- DELETE: "DELETE";
806
- }>>>>;
807
- fields: z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
808
- fieldName: z.ZodString;
809
- fieldType: z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<"string" | "number" | "boolean" | "object" | "enum" | "Date" | "Types.ObjectId" | "email" | "password", string>>, z.ZodEnum<{
810
- string: "string";
811
- number: "number";
812
- boolean: "boolean";
813
- object: "object";
814
- enum: "enum";
815
- Date: "Date";
816
- "Types.ObjectId": "Types.ObjectId";
817
- email: "email";
818
- password: "password";
819
- }>>;
820
- isArray: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
821
- isRequired: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
822
- isUnique: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
823
- values: z.ZodDefault<z.ZodArray<z.ZodString>>;
824
- defaultVal: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodNull]>>;
825
- relationTo: z.ZodOptional<z.ZodString>;
826
- relationType: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"" | "one-to-one" | "many-to-one", string>>, z.ZodEnum<{
827
- "": "";
828
- "one-to-one": "one-to-one";
829
- "many-to-one": "many-to-one";
830
- }>>>;
831
- isPrivate: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
832
- }, z.core.$strip>>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, z.ZodTransform<{
833
- fieldName: string;
834
- fieldType: "string" | "number" | "boolean" | "object" | "enum" | "Date" | "Types.ObjectId" | "email" | "password";
835
- isArray: boolean;
836
- isRequired: boolean;
837
- isUnique: boolean;
838
- values: string[];
839
- isPrivate: boolean;
840
- defaultVal?: string | number | boolean | null | undefined;
841
- relationTo?: string | undefined;
842
- relationType?: "" | "one-to-one" | "many-to-one" | undefined;
843
- }[], Record<string, unknown> | {
844
- fieldName: string;
845
- fieldType: "string" | "number" | "boolean" | "object" | "enum" | "Date" | "Types.ObjectId" | "email" | "password";
846
- isArray: boolean;
847
- isRequired: boolean;
848
- isUnique: boolean;
849
- values: string[];
850
- isPrivate: boolean;
851
- defaultVal?: string | number | boolean | null | undefined;
852
- relationTo?: string | undefined;
853
- relationType?: "" | "one-to-one" | "many-to-one" | undefined;
854
- }[]>>;
855
- }, z.core.$strip>;
856
- type TModuleSchema$1 = z.infer<typeof moduleSchema>;
857
-
858
- /**
859
- * Root project schema for MongoDB database design
860
- */
861
-
862
- declare const projectSchema: z.ZodObject<{
863
- projectName: z.ZodDefault<z.ZodString>;
864
- projectDescription: z.ZodDefault<z.ZodString>;
865
- modules: z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
866
- moduleName: z.ZodString;
867
- isUserModule: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
868
- authMethod: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"" | "EMAIL_AND_PASSWORD" | "PHONE_AND_OTP", string>>, z.ZodEnum<{
869
- "": "";
870
- EMAIL_AND_PASSWORD: "EMAIL_AND_PASSWORD";
871
- PHONE_AND_OTP: "PHONE_AND_OTP";
872
- }>>>;
873
- emailField: z.ZodOptional<z.ZodString>;
874
- passwordField: z.ZodOptional<z.ZodString>;
875
- phoneField: z.ZodOptional<z.ZodString>;
876
- roleField: z.ZodOptional<z.ZodString>;
877
- permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodEnum<{
878
- CREATE: "CREATE";
879
- READ: "READ";
880
- UPDATE: "UPDATE";
881
- DELETE: "DELETE";
882
- }>>>>;
883
- fields: z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
884
- fieldName: z.ZodString;
885
- fieldType: z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<"string" | "number" | "boolean" | "object" | "enum" | "Date" | "Types.ObjectId" | "email" | "password", string>>, z.ZodEnum<{
886
- string: "string";
887
- number: "number";
888
- boolean: "boolean";
889
- object: "object";
890
- enum: "enum";
891
- Date: "Date";
892
- "Types.ObjectId": "Types.ObjectId";
893
- email: "email";
894
- password: "password";
895
- }>>;
896
- isArray: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
897
- isRequired: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
898
- isUnique: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
899
- values: z.ZodDefault<z.ZodArray<z.ZodString>>;
900
- defaultVal: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodNull]>>;
901
- relationTo: z.ZodOptional<z.ZodString>;
902
- relationType: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"" | "one-to-one" | "many-to-one", string>>, z.ZodEnum<{
903
- "": "";
904
- "one-to-one": "one-to-one";
905
- "many-to-one": "many-to-one";
906
- }>>>;
907
- isPrivate: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
908
- }, z.core.$strip>>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, z.ZodTransform<{
909
- fieldName: string;
910
- fieldType: "string" | "number" | "boolean" | "object" | "enum" | "Date" | "Types.ObjectId" | "email" | "password";
911
- isArray: boolean;
912
- isRequired: boolean;
913
- isUnique: boolean;
914
- values: string[];
915
- isPrivate: boolean;
916
- defaultVal?: string | number | boolean | null | undefined;
917
- relationTo?: string | undefined;
918
- relationType?: "" | "one-to-one" | "many-to-one" | undefined;
919
- }[], Record<string, unknown> | {
920
- fieldName: string;
921
- fieldType: "string" | "number" | "boolean" | "object" | "enum" | "Date" | "Types.ObjectId" | "email" | "password";
922
- isArray: boolean;
923
- isRequired: boolean;
924
- isUnique: boolean;
925
- values: string[];
926
- isPrivate: boolean;
927
- defaultVal?: string | number | boolean | null | undefined;
928
- relationTo?: string | undefined;
929
- relationType?: "" | "one-to-one" | "many-to-one" | undefined;
930
- }[]>>;
931
- }, z.core.$strip>>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, z.ZodTransform<{
932
- moduleName: string;
933
- isUserModule: boolean;
934
- fields: {
935
- fieldName: string;
936
- fieldType: "string" | "number" | "boolean" | "object" | "enum" | "Date" | "Types.ObjectId" | "email" | "password";
937
- isArray: boolean;
938
- isRequired: boolean;
939
- isUnique: boolean;
940
- values: string[];
941
- isPrivate: boolean;
942
- defaultVal?: string | number | boolean | null | undefined;
943
- relationTo?: string | undefined;
944
- relationType?: "" | "one-to-one" | "many-to-one" | undefined;
945
- }[];
946
- authMethod?: "" | "EMAIL_AND_PASSWORD" | "PHONE_AND_OTP" | undefined;
947
- emailField?: string | undefined;
948
- passwordField?: string | undefined;
949
- phoneField?: string | undefined;
950
- roleField?: string | undefined;
951
- permissions?: Record<string, ("CREATE" | "READ" | "UPDATE" | "DELETE")[]> | undefined;
952
- }[], Record<string, unknown> | {
953
- moduleName: string;
954
- isUserModule: boolean;
955
- fields: {
956
- fieldName: string;
957
- fieldType: "string" | "number" | "boolean" | "object" | "enum" | "Date" | "Types.ObjectId" | "email" | "password";
958
- isArray: boolean;
959
- isRequired: boolean;
960
- isUnique: boolean;
961
- values: string[];
962
- isPrivate: boolean;
963
- defaultVal?: string | number | boolean | null | undefined;
964
- relationTo?: string | undefined;
965
- relationType?: "" | "one-to-one" | "many-to-one" | undefined;
966
- }[];
967
- authMethod?: "" | "EMAIL_AND_PASSWORD" | "PHONE_AND_OTP" | undefined;
968
- emailField?: string | undefined;
969
- passwordField?: string | undefined;
970
- phoneField?: string | undefined;
971
- roleField?: string | undefined;
972
- permissions?: Record<string, ("CREATE" | "READ" | "UPDATE" | "DELETE")[]> | undefined;
973
- }[]>>;
974
- author: z.ZodDefault<z.ZodString>;
975
- }, z.core.$strip>;
976
- type TBackendProjectSchema = z.infer<typeof projectSchema>;
977
-
978
- /**
979
- * db-designer module types - structured requirements and agent config
980
- */
981
-
982
- interface Actor$1 {
983
- id: string;
984
- name: string;
985
- description: string;
986
- goals: string[];
987
- }
988
- interface ExtractedFlow {
989
- id: string;
990
- actorId: string;
991
- name: string;
992
- description: string;
993
- trigger: string;
994
- outcome: string;
995
- }
996
- interface ExtractedStory {
997
- id: string;
998
- flowId: string;
999
- actor: string;
1000
- action: string;
1001
- benefit: string;
1002
- preconditions: string[];
1003
- postconditions: string[];
1004
- dataInvolved: string[];
1005
- }
1006
- interface TechnicalRequirements {
1007
- authentication: 'none' | 'email' | 'oauth' | 'phone' | 'email_and_phone';
1008
- authorization: boolean;
1009
- roles?: string[];
1010
- integrations?: string[];
1011
- realtime?: boolean;
1012
- fileUpload?: boolean;
1013
- search?: boolean;
1014
- }
1015
- interface StructuredRequirementsInput {
1016
- projectName: string;
1017
- projectGoal: string;
1018
- projectDescription?: string;
1019
- actors: Actor$1[];
1020
- flows: ExtractedFlow[];
1021
- stories: ExtractedStory[];
1022
- technicalRequirements?: TechnicalRequirements;
1023
- }
1024
- interface DbDesignerAgentConfig {
1025
- /** User input: natural language requirement or instruction */
1026
- input: string;
1027
- /** Model config; optional, caller can pass via runAgent */
1028
- model?: ModelConfig;
1029
- /** Max iterations; default 15 */
1030
- maxIterations?: number;
1031
- /** Callback for each step */
1032
- onStep?: (step: AgentStep) => void;
1033
- /** Optional logger for execution logs */
1034
- logger?: Logger;
1035
- }
1036
-
1037
- /**
1038
- * System prompt for database design - 5-phase analysis framework
1039
- */
1040
- declare const DB_DESIGN_SYSTEM_PROMPT = "You are an expert MongoDB database architect with deep expertise in schema design, performance optimization, scalability, and domain-driven design. You analyze requirements systematically using a multi-phase approach to create production-ready database schemas.\n\n## ANALYSIS FRAMEWORK\n\nYou MUST follow this 5-phase analysis process before generating the schema:\n\n### PHASE 1: Entity Discovery\nSystematically extract all entities from the provided requirements:\n\n1. **From dataInvolved fields**: Every item in user stories' dataInvolved[] array indicates a potential entity or field\n - Pattern: \"User Profile\" \u2192 user collection with profile fields\n - Pattern: \"Order Items\" \u2192 order collection + item collection with relationship\n - Pattern: \"Product Inventory\" \u2192 product collection with inventory fields\n\n2. **From User Types (Actors)**: Each actor type may indicate a User variant or role\n - Pattern: \"Admin\", \"Customer\", \"Vendor\" \u2192 User collection with role enum\n - Pattern: \"Guest\" \u2192 May not need persistence, or limited session data\n\n3. **From User Flow Actions**: Action verbs reveal implicit entities\n - \"creates order\" \u2192 Order collection\n - \"submits payment\" \u2192 Payment collection\n - \"uploads document\" \u2192 Document collection\n - \"sends message\" \u2192 Message collection\n\n4. **From Flow States**: Transitions reveal status enums\n - Flow: pending \u2192 approved \u2192 completed \u2192 Order.status enum\n - Flow: draft \u2192 published \u2192 archived \u2192 Content.status enum\n\n### PHASE 2: Relationship Mapping\nFor each entity pair, determine relationships based on:\n\n1. **Ownership Patterns** (from actor actions):\n - \"Customer places Order\" \u2192 Order.customer (many-to-one to User)\n - \"Admin approves Request\" \u2192 Request.approvedBy (many-to-one to User)\n - \"User creates Post\" \u2192 Post.author (many-to-one to User)\n\n2. **Cardinality from Flow Context**:\n - \"User has one profile\" \u2192 one-to-one\n - \"User places multiple orders\" \u2192 many-to-one (Order \u2192 User)\n - \"Order contains items\" \u2192 many-to-one (OrderItem \u2192 Order)\n\n3. **Shared Entities** (referenced across flows):\n - Entity referenced by multiple actors \u2192 likely needs relationships to User\n - Entity in multiple flows \u2192 likely a core/central entity\n\n4. **Bidirectional References** (for one-to-one):\n - Include reference field in BOTH collections for one-to-one relationships\n\n### PHASE 3: Permission Derivation\nMap actors to RBAC permissions:\n\n1. **Role Extraction**: Each actor type becomes a role value\n - actors: [Admin, Customer, Vendor] \u2192 role enum: ['admin', 'customer', 'vendor']\n\n2. **Permission Mining from User Stories**:\n - \"As Admin, I can delete users\" \u2192 admin: ['CREATE', 'READ', 'UPDATE', 'DELETE'] on user\n - \"As Customer, I can view my orders\" \u2192 customer: ['READ'] on order (own records)\n - \"As Vendor, I can update products\" \u2192 vendor: ['CREATE', 'READ', 'UPDATE'] on product\n\n3. **Data Visibility Rules**:\n - \"view own\" \u2192 READ permission with ownership filter\n - \"view all\" \u2192 READ permission without filter\n - \"manage\" \u2192 full CRUD permissions\n\n### PHASE 4: Query Pattern Inference\nAnalyze flows to predict database access patterns:\n\n1. **Read Patterns** (suggest indexes):\n - \"list orders by date\" \u2192 index on order.createdAt\n - \"search products by category\" \u2192 index on product.category\n - \"find user by email\" \u2192 unique index on user.email\n - \"filter by status\" \u2192 index on status field\n\n2. **Write Patterns** (affect schema design):\n - High-frequency writes \u2192 consider denormalization\n - Audit requirements \u2192 add createdBy, updatedBy fields\n\n3. **Aggregation Needs** (from reporting flows):\n - \"view sales dashboard\" \u2192 may need summary collections\n - \"generate reports\" \u2192 ensure proper indexing for date ranges\n\n### PHASE 5: Schema Construction\nSynthesize all analyses into the final schema:\n\n1. **Module Definition**:\n - One module per core entity\n - camelCase module names (never 'auth' or 'authentication')\n - Mark user modules with isUserModule: true\n\n2. **Field Completeness**:\n - All fields from dataInvolved\n - Relationship fields (Types.ObjectId with relationTo)\n - Status/lifecycle fields (enum type with values from flow states)\n - Audit fields: createdAt, updatedAt (Date, required)\n - createdBy, updatedBy when flows mention \"who did what\"\n\n3. **Validation Constraints**:\n - isRequired: true for fields mentioned in preconditions\n - isUnique: true for identifier fields (email, slug, code)\n - enum values from flow states and categorical data\n\n4. **Security Fields**:\n - password fields: fieldType: 'password', isPrivate: true\n - email fields: fieldType: 'email', isUnique: true\n\n## CORE CONSTRAINTS (MUST FOLLOW)\n\n1. **Primary Key**: _id with Types.ObjectId (auto-generated, do not include in fields)\n\n2. **Relationships**:\n - One-to-One: Reference field in BOTH collections\n - Many-to-One: Reference in the \"many\" side only\n - Many-to-Many: ONLY when necessary, use intermediate collection\n - One-to-Many: FORBIDDEN - invert to many-to-one from child\n\n3. **Data Types**:\n - NO arrays of ObjectIds for relationships\n - Timestamps: createdAt, updatedAt (Date) in EVERY collection\n - Enums: Use fieldType: 'enum' with values array\n\n4. **Security**:\n - NO separate \"Auth\" or \"Authentication\" collection\n - NO token storage in database\n - Password fields: isPrivate: true\n\n5. **Authorization (RBAC)**:\n - Define permissions per role on user modules\n - Format: {{ \"roleName\": [\"CREATE\", \"READ\", \"UPDATE\", \"DELETE\"] }}";
1041
-
1042
- /**
1043
- * Design prompts - legacy and pro-level, plus structured requirement formatters
1044
- */
1045
-
1046
- /**
1047
- * Legacy: build design prompt from plain requirement string
1048
- */
1049
- declare function createDbDesignPrompt(requirement: string): string;
1050
- /**
1051
- * Format actors/user types into prompt-friendly string
1052
- */
1053
- declare function formatUserTypes(actors: Actor$1[]): string;
1054
- /**
1055
- * Format user flows into prompt-friendly string
1056
- */
1057
- declare function formatUserFlows(flows: ExtractedFlow[], actors: Actor$1[]): string;
1058
- /**
1059
- * Format user stories with dataInvolved into prompt-friendly string
1060
- */
1061
- declare function formatUserStories(stories: ExtractedStory[], flows: ExtractedFlow[]): string;
1062
- /**
1063
- * Format technical requirements into prompt-friendly string
1064
- */
1065
- declare function formatTechnicalRequirements(tech?: TechnicalRequirements): string;
1066
- /**
1067
- * Extract all unique dataInvolved items from stories for entity hints
1068
- */
1069
- declare function extractDataEntities(stories: ExtractedStory[]): string[];
1070
- /**
1071
- * Extract roles from actors for RBAC configuration
1072
- */
1073
- declare function extractRoles(actors: Actor$1[]): string[];
1074
- /**
1075
- * Build complete prompt variables from structured requirements
1076
- */
1077
- declare function buildPromptVariables(input: StructuredRequirementsInput): Record<string, string>;
1078
- /**
1079
- * Pro-level DB design prompt from structured requirements
1080
- */
1081
- declare function createProDbDesignPrompt(input: StructuredRequirementsInput): string;
1082
-
1083
- /**
1084
- * Redesign prompt - update existing schema based on user feedback
1085
- */
1086
- declare function createRedesignPrompt(existingSchema: string, userFeedback: string): string;
1087
-
1088
- /**
1089
- * validate_schema tool - validates JSON against projectSchema (no AI)
1090
- */
1091
- declare const validateSchemaTool$1: ai.Tool;
1092
-
1093
- /**
1094
- * Creates the design_database tool. Requires a model to invoke for schema generation.
1095
- */
1096
- declare function createDesignDatabaseTool(model: Model): ai.Tool;
1097
-
1098
- /**
1099
- * Creates the design_database_pro tool. Requires a model for schema generation.
1100
- */
1101
- declare function createDesignDatabaseProTool(model: Model): ai.Tool;
1102
-
1103
- /**
1104
- * Creates the redesign_database tool. Requires a model for schema update.
1105
- */
1106
- declare function createRedesignDatabaseTool(model: Model): ai.Tool;
1107
-
1108
- /**
1109
- * Create all db-designer tools for the agent. Pass the model for AI-backed tools.
1110
- */
1111
- declare function createDbDesignerTools(model: Model): ToolSet;
1112
-
1113
- /**
1114
- * entity-analyzer subagent - extracts entities, relationships, and roles from requirements (no tools)
1115
- */
1116
- declare const entityAnalyzerSubagent$1: SubagentDefinition;
1117
-
1118
- /**
1119
- * schema-refiner subagent - validates schema and suggests refinements (has validate_schema tool)
1120
- */
1121
- declare function createSchemaRefinerSubagent$1(): SubagentDefinition;
1122
-
1123
- /**
1124
- * runDbDesignerAgent - orchestrator for the full DB design workflow
1125
- */
1126
-
1127
- /**
1128
- * Run the db-designer orchestrator agent with all tools and subagents.
1129
- */
1130
- declare function runDbDesignerAgent(config: DbDesignerAgentConfig): Promise<AgentResult>;
1131
-
1132
753
  /**
1133
754
  * Branding schema for frontend app config
1134
755
  */
@@ -1178,15 +799,15 @@ declare const FormFieldSchema: z.ZodObject<{
1178
799
  name: z.ZodString;
1179
800
  type: z.ZodEnum<{
1180
801
  number: "number";
802
+ date: "date";
1181
803
  text: "text";
1182
804
  image: "image";
1183
- date: "date";
1184
805
  email: "email";
1185
806
  password: "password";
1186
- select: "select";
1187
807
  multiSelect: "multiSelect";
1188
808
  textarea: "textarea";
1189
809
  hidden: "hidden";
810
+ select: "select";
1190
811
  }>;
1191
812
  required: z.ZodOptional<z.ZodBoolean>;
1192
813
  validation: z.ZodOptional<z.ZodObject<{
@@ -1260,15 +881,15 @@ declare const DrawerSchema: z.ZodObject<{
1260
881
  name: z.ZodString;
1261
882
  type: z.ZodEnum<{
1262
883
  number: "number";
884
+ date: "date";
1263
885
  text: "text";
1264
886
  image: "image";
1265
- date: "date";
1266
887
  email: "email";
1267
888
  password: "password";
1268
- select: "select";
1269
889
  multiSelect: "multiSelect";
1270
890
  textarea: "textarea";
1271
891
  hidden: "hidden";
892
+ select: "select";
1272
893
  }>;
1273
894
  required: z.ZodOptional<z.ZodBoolean>;
1274
895
  validation: z.ZodOptional<z.ZodObject<{
@@ -1318,15 +939,15 @@ declare const AuthPageSchema: z.ZodObject<{
1318
939
  name: z.ZodString;
1319
940
  type: z.ZodEnum<{
1320
941
  number: "number";
942
+ date: "date";
1321
943
  text: "text";
1322
944
  image: "image";
1323
- date: "date";
1324
945
  email: "email";
1325
946
  password: "password";
1326
- select: "select";
1327
947
  multiSelect: "multiSelect";
1328
948
  textarea: "textarea";
1329
949
  hidden: "hidden";
950
+ select: "select";
1330
951
  }>;
1331
952
  required: z.ZodOptional<z.ZodBoolean>;
1332
953
  validation: z.ZodOptional<z.ZodObject<{
@@ -1377,15 +998,15 @@ declare const ListingPageSchema: z.ZodObject<{
1377
998
  name: z.ZodString;
1378
999
  type: z.ZodEnum<{
1379
1000
  number: "number";
1001
+ date: "date";
1380
1002
  text: "text";
1381
1003
  image: "image";
1382
- date: "date";
1383
1004
  email: "email";
1384
1005
  password: "password";
1385
- select: "select";
1386
1006
  multiSelect: "multiSelect";
1387
1007
  textarea: "textarea";
1388
1008
  hidden: "hidden";
1009
+ select: "select";
1389
1010
  }>;
1390
1011
  required: z.ZodOptional<z.ZodBoolean>;
1391
1012
  validation: z.ZodOptional<z.ZodObject<{
@@ -1409,15 +1030,15 @@ declare const ListingPageSchema: z.ZodObject<{
1409
1030
  name: z.ZodString;
1410
1031
  type: z.ZodEnum<{
1411
1032
  number: "number";
1033
+ date: "date";
1412
1034
  text: "text";
1413
1035
  image: "image";
1414
- date: "date";
1415
1036
  email: "email";
1416
1037
  password: "password";
1417
- select: "select";
1418
1038
  multiSelect: "multiSelect";
1419
1039
  textarea: "textarea";
1420
1040
  hidden: "hidden";
1041
+ select: "select";
1421
1042
  }>;
1422
1043
  required: z.ZodOptional<z.ZodBoolean>;
1423
1044
  validation: z.ZodOptional<z.ZodObject<{
@@ -1468,15 +1089,15 @@ declare const PageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1468
1089
  name: z.ZodString;
1469
1090
  type: z.ZodEnum<{
1470
1091
  number: "number";
1092
+ date: "date";
1471
1093
  text: "text";
1472
1094
  image: "image";
1473
- date: "date";
1474
1095
  email: "email";
1475
1096
  password: "password";
1476
- select: "select";
1477
1097
  multiSelect: "multiSelect";
1478
1098
  textarea: "textarea";
1479
1099
  hidden: "hidden";
1100
+ select: "select";
1480
1101
  }>;
1481
1102
  required: z.ZodOptional<z.ZodBoolean>;
1482
1103
  validation: z.ZodOptional<z.ZodObject<{
@@ -1526,15 +1147,15 @@ declare const PageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1526
1147
  name: z.ZodString;
1527
1148
  type: z.ZodEnum<{
1528
1149
  number: "number";
1150
+ date: "date";
1529
1151
  text: "text";
1530
1152
  image: "image";
1531
- date: "date";
1532
1153
  email: "email";
1533
1154
  password: "password";
1534
- select: "select";
1535
1155
  multiSelect: "multiSelect";
1536
1156
  textarea: "textarea";
1537
1157
  hidden: "hidden";
1158
+ select: "select";
1538
1159
  }>;
1539
1160
  required: z.ZodOptional<z.ZodBoolean>;
1540
1161
  validation: z.ZodOptional<z.ZodObject<{
@@ -1558,15 +1179,15 @@ declare const PageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1558
1179
  name: z.ZodString;
1559
1180
  type: z.ZodEnum<{
1560
1181
  number: "number";
1182
+ date: "date";
1561
1183
  text: "text";
1562
1184
  image: "image";
1563
- date: "date";
1564
1185
  email: "email";
1565
1186
  password: "password";
1566
- select: "select";
1567
1187
  multiSelect: "multiSelect";
1568
1188
  textarea: "textarea";
1569
1189
  hidden: "hidden";
1190
+ select: "select";
1570
1191
  }>;
1571
1192
  required: z.ZodOptional<z.ZodBoolean>;
1572
1193
  validation: z.ZodOptional<z.ZodObject<{
@@ -1625,15 +1246,15 @@ declare const ModuleSchema: z.ZodObject<{
1625
1246
  name: z.ZodString;
1626
1247
  type: z.ZodEnum<{
1627
1248
  number: "number";
1249
+ date: "date";
1628
1250
  text: "text";
1629
1251
  image: "image";
1630
- date: "date";
1631
1252
  email: "email";
1632
1253
  password: "password";
1633
- select: "select";
1634
1254
  multiSelect: "multiSelect";
1635
1255
  textarea: "textarea";
1636
1256
  hidden: "hidden";
1257
+ select: "select";
1637
1258
  }>;
1638
1259
  required: z.ZodOptional<z.ZodBoolean>;
1639
1260
  validation: z.ZodOptional<z.ZodObject<{
@@ -1683,15 +1304,15 @@ declare const ModuleSchema: z.ZodObject<{
1683
1304
  name: z.ZodString;
1684
1305
  type: z.ZodEnum<{
1685
1306
  number: "number";
1307
+ date: "date";
1686
1308
  text: "text";
1687
1309
  image: "image";
1688
- date: "date";
1689
1310
  email: "email";
1690
1311
  password: "password";
1691
- select: "select";
1692
1312
  multiSelect: "multiSelect";
1693
1313
  textarea: "textarea";
1694
1314
  hidden: "hidden";
1315
+ select: "select";
1695
1316
  }>;
1696
1317
  required: z.ZodOptional<z.ZodBoolean>;
1697
1318
  validation: z.ZodOptional<z.ZodObject<{
@@ -1715,15 +1336,15 @@ declare const ModuleSchema: z.ZodObject<{
1715
1336
  name: z.ZodString;
1716
1337
  type: z.ZodEnum<{
1717
1338
  number: "number";
1339
+ date: "date";
1718
1340
  text: "text";
1719
1341
  image: "image";
1720
- date: "date";
1721
1342
  email: "email";
1722
1343
  password: "password";
1723
- select: "select";
1724
1344
  multiSelect: "multiSelect";
1725
1345
  textarea: "textarea";
1726
1346
  hidden: "hidden";
1347
+ select: "select";
1727
1348
  }>;
1728
1349
  required: z.ZodOptional<z.ZodBoolean>;
1729
1350
  validation: z.ZodOptional<z.ZodObject<{
@@ -1790,15 +1411,15 @@ declare const ApplicationSchema: z.ZodObject<{
1790
1411
  name: z.ZodString;
1791
1412
  type: z.ZodEnum<{
1792
1413
  number: "number";
1414
+ date: "date";
1793
1415
  text: "text";
1794
1416
  image: "image";
1795
- date: "date";
1796
1417
  email: "email";
1797
1418
  password: "password";
1798
- select: "select";
1799
1419
  multiSelect: "multiSelect";
1800
1420
  textarea: "textarea";
1801
1421
  hidden: "hidden";
1422
+ select: "select";
1802
1423
  }>;
1803
1424
  required: z.ZodOptional<z.ZodBoolean>;
1804
1425
  validation: z.ZodOptional<z.ZodObject<{
@@ -1848,15 +1469,15 @@ declare const ApplicationSchema: z.ZodObject<{
1848
1469
  name: z.ZodString;
1849
1470
  type: z.ZodEnum<{
1850
1471
  number: "number";
1472
+ date: "date";
1851
1473
  text: "text";
1852
1474
  image: "image";
1853
- date: "date";
1854
1475
  email: "email";
1855
1476
  password: "password";
1856
- select: "select";
1857
1477
  multiSelect: "multiSelect";
1858
1478
  textarea: "textarea";
1859
1479
  hidden: "hidden";
1480
+ select: "select";
1860
1481
  }>;
1861
1482
  required: z.ZodOptional<z.ZodBoolean>;
1862
1483
  validation: z.ZodOptional<z.ZodObject<{
@@ -1880,15 +1501,15 @@ declare const ApplicationSchema: z.ZodObject<{
1880
1501
  name: z.ZodString;
1881
1502
  type: z.ZodEnum<{
1882
1503
  number: "number";
1504
+ date: "date";
1883
1505
  text: "text";
1884
1506
  image: "image";
1885
- date: "date";
1886
1507
  email: "email";
1887
1508
  password: "password";
1888
- select: "select";
1889
1509
  multiSelect: "multiSelect";
1890
1510
  textarea: "textarea";
1891
1511
  hidden: "hidden";
1512
+ select: "select";
1892
1513
  }>;
1893
1514
  required: z.ZodOptional<z.ZodBoolean>;
1894
1515
  validation: z.ZodOptional<z.ZodObject<{
@@ -2079,6 +1700,7 @@ declare function runReactBuilderAgent(config: ReactBuilderAgentConfig): Promise<
2079
1700
 
2080
1701
  /**
2081
1702
  * Zod schemas for RequirementContext, ProjectBrief, Question, ChatEntry
1703
+ * Note: apiDesign removed -- API design is delegated to the api-designer module.
2082
1704
  */
2083
1705
 
2084
1706
  declare const projectBriefSchema: z.ZodObject<{
@@ -2206,93 +1828,6 @@ declare const requirementContextSchema: z.ZodObject<{
2206
1828
  }, z.core.$strip>>;
2207
1829
  }, z.core.$strip>>;
2208
1830
  }, z.core.$strip>>;
2209
- apiDesign: z.ZodNullable<z.ZodObject<{
2210
- style: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2211
- rest: "rest";
2212
- graphql: "graphql";
2213
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2214
- rest: "rest";
2215
- graphql: "graphql";
2216
- }>>;
2217
- rest: z.ZodOptional<z.ZodObject<{
2218
- baseUrl: z.ZodDefault<z.ZodString>;
2219
- endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
2220
- id: z.ZodString;
2221
- moduleId: z.ZodString;
2222
- method: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2223
- DELETE: "DELETE";
2224
- GET: "GET";
2225
- POST: "POST";
2226
- PUT: "PUT";
2227
- PATCH: "PATCH";
2228
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2229
- DELETE: "DELETE";
2230
- GET: "GET";
2231
- POST: "POST";
2232
- PUT: "PUT";
2233
- PATCH: "PATCH";
2234
- }>>;
2235
- path: z.ZodString;
2236
- description: z.ZodString;
2237
- auth: z.ZodCoercedBoolean<unknown>;
2238
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2239
- requestBody: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2240
- [k: string]: string;
2241
- }, Record<string, unknown>>>;
2242
- responseBody: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2243
- [k: string]: string;
2244
- }, Record<string, unknown>>>;
2245
- queryParams: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2246
- [k: string]: string;
2247
- }, Record<string, unknown>>>;
2248
- }, z.core.$strip>>>;
2249
- }, z.core.$strip>>;
2250
- graphql: z.ZodOptional<z.ZodObject<{
2251
- types: z.ZodDefault<z.ZodArray<z.ZodObject<{
2252
- name: z.ZodString;
2253
- kind: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2254
- input: "input";
2255
- type: "type";
2256
- enum: "enum";
2257
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2258
- input: "input";
2259
- type: "type";
2260
- enum: "enum";
2261
- }>>;
2262
- fields: z.ZodArray<z.ZodObject<{
2263
- name: z.ZodString;
2264
- type: z.ZodString;
2265
- description: z.ZodString;
2266
- }, z.core.$strip>>;
2267
- }, z.core.$strip>>>;
2268
- queries: z.ZodDefault<z.ZodArray<z.ZodObject<{
2269
- name: z.ZodString;
2270
- moduleId: z.ZodString;
2271
- description: z.ZodString;
2272
- auth: z.ZodCoercedBoolean<unknown>;
2273
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2274
- args: z.ZodArray<z.ZodObject<{
2275
- name: z.ZodString;
2276
- type: z.ZodString;
2277
- required: z.ZodCoercedBoolean<unknown>;
2278
- }, z.core.$strip>>;
2279
- returnType: z.ZodString;
2280
- }, z.core.$strip>>>;
2281
- mutations: z.ZodDefault<z.ZodArray<z.ZodObject<{
2282
- name: z.ZodString;
2283
- moduleId: z.ZodString;
2284
- description: z.ZodString;
2285
- auth: z.ZodCoercedBoolean<unknown>;
2286
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2287
- args: z.ZodArray<z.ZodObject<{
2288
- name: z.ZodString;
2289
- type: z.ZodString;
2290
- required: z.ZodCoercedBoolean<unknown>;
2291
- }, z.core.$strip>>;
2292
- returnType: z.ZodString;
2293
- }, z.core.$strip>>>;
2294
- }, z.core.$strip>>;
2295
- }, z.core.$strip>>;
2296
1831
  history: z.ZodArray<z.ZodObject<{
2297
1832
  role: z.ZodEnum<{
2298
1833
  user: "user";
@@ -2349,287 +1884,51 @@ declare const databaseEntitySchema: z.ZodObject<{
2349
1884
  name: z.ZodString;
2350
1885
  fields: z.ZodArray<z.ZodString>;
2351
1886
  unique: z.ZodBoolean;
2352
- }, z.core.$strip>>;
2353
- relations: z.ZodArray<z.ZodObject<{
2354
- field: z.ZodString;
2355
- references: z.ZodString;
2356
- description: z.ZodString;
2357
- }, z.core.$strip>>;
2358
- }, z.core.$strip>;
2359
- declare const databaseDesignSchema: z.ZodObject<{
2360
- type: z.ZodEnum<{
2361
- mongodb: "mongodb";
2362
- postgresql: "postgresql";
2363
- }>;
2364
- reasoning: z.ZodString;
2365
- entities: z.ZodArray<z.ZodObject<{
2366
- name: z.ZodString;
2367
- description: z.ZodString;
2368
- fields: z.ZodArray<z.ZodObject<{
2369
- name: z.ZodString;
2370
- type: z.ZodString;
2371
- required: z.ZodBoolean;
2372
- unique: z.ZodBoolean;
2373
- description: z.ZodString;
2374
- default: z.ZodOptional<z.ZodString>;
2375
- }, z.core.$strip>>;
2376
- indexes: z.ZodArray<z.ZodObject<{
2377
- name: z.ZodString;
2378
- fields: z.ZodArray<z.ZodString>;
2379
- unique: z.ZodBoolean;
2380
- }, z.core.$strip>>;
2381
- relations: z.ZodArray<z.ZodObject<{
2382
- field: z.ZodString;
2383
- references: z.ZodString;
2384
- description: z.ZodString;
2385
- }, z.core.$strip>>;
2386
- }, z.core.$strip>>;
2387
- }, z.core.$strip>;
2388
- type EntityField$2 = z.infer<typeof entityFieldSchema>;
2389
- type EntityIndex$2 = z.infer<typeof entityIndexSchema>;
2390
- type EntityRelation$2 = z.infer<typeof entityRelationSchema>;
2391
- type DatabaseEntity$1 = z.infer<typeof databaseEntitySchema>;
2392
- type DatabaseDesign$1 = z.infer<typeof databaseDesignSchema>;
2393
-
2394
- /**
2395
- * Zod schemas for ApiDesign, RestEndpoint, GraphqlTypeDefinition, GraphqlOperation
2396
- * Uses coercion so LLM output (e.g. "GET" vs "get", "true" vs true) still validates.
2397
- */
2398
-
2399
- declare const restEndpointSchema$1: z.ZodObject<{
2400
- id: z.ZodString;
2401
- moduleId: z.ZodString;
2402
- method: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2403
- DELETE: "DELETE";
2404
- GET: "GET";
2405
- POST: "POST";
2406
- PUT: "PUT";
2407
- PATCH: "PATCH";
2408
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2409
- DELETE: "DELETE";
2410
- GET: "GET";
2411
- POST: "POST";
2412
- PUT: "PUT";
2413
- PATCH: "PATCH";
2414
- }>>;
2415
- path: z.ZodString;
2416
- description: z.ZodString;
2417
- auth: z.ZodCoercedBoolean<unknown>;
2418
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2419
- requestBody: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2420
- [k: string]: string;
2421
- }, Record<string, unknown>>>;
2422
- responseBody: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2423
- [k: string]: string;
2424
- }, Record<string, unknown>>>;
2425
- queryParams: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2426
- [k: string]: string;
2427
- }, Record<string, unknown>>>;
2428
- }, z.core.$strip>;
2429
- declare const restApiDesignSchema: z.ZodObject<{
2430
- baseUrl: z.ZodDefault<z.ZodString>;
2431
- endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
2432
- id: z.ZodString;
2433
- moduleId: z.ZodString;
2434
- method: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2435
- DELETE: "DELETE";
2436
- GET: "GET";
2437
- POST: "POST";
2438
- PUT: "PUT";
2439
- PATCH: "PATCH";
2440
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2441
- DELETE: "DELETE";
2442
- GET: "GET";
2443
- POST: "POST";
2444
- PUT: "PUT";
2445
- PATCH: "PATCH";
2446
- }>>;
2447
- path: z.ZodString;
2448
- description: z.ZodString;
2449
- auth: z.ZodCoercedBoolean<unknown>;
2450
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2451
- requestBody: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2452
- [k: string]: string;
2453
- }, Record<string, unknown>>>;
2454
- responseBody: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2455
- [k: string]: string;
2456
- }, Record<string, unknown>>>;
2457
- queryParams: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2458
- [k: string]: string;
2459
- }, Record<string, unknown>>>;
2460
- }, z.core.$strip>>>;
2461
- }, z.core.$strip>;
2462
- declare const graphqlTypeDefinitionSchema: z.ZodObject<{
2463
- name: z.ZodString;
2464
- kind: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2465
- input: "input";
2466
- type: "type";
2467
- enum: "enum";
2468
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2469
- input: "input";
2470
- type: "type";
2471
- enum: "enum";
2472
- }>>;
2473
- fields: z.ZodArray<z.ZodObject<{
2474
- name: z.ZodString;
2475
- type: z.ZodString;
2476
- description: z.ZodString;
2477
- }, z.core.$strip>>;
2478
- }, z.core.$strip>;
2479
- declare const graphqlOperationSchema$1: z.ZodObject<{
2480
- name: z.ZodString;
2481
- moduleId: z.ZodString;
2482
- description: z.ZodString;
2483
- auth: z.ZodCoercedBoolean<unknown>;
2484
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2485
- args: z.ZodArray<z.ZodObject<{
2486
- name: z.ZodString;
2487
- type: z.ZodString;
2488
- required: z.ZodCoercedBoolean<unknown>;
2489
- }, z.core.$strip>>;
2490
- returnType: z.ZodString;
2491
- }, z.core.$strip>;
2492
- declare const graphqlApiDesignSchema: z.ZodObject<{
2493
- types: z.ZodDefault<z.ZodArray<z.ZodObject<{
2494
- name: z.ZodString;
2495
- kind: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2496
- input: "input";
2497
- type: "type";
2498
- enum: "enum";
2499
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2500
- input: "input";
2501
- type: "type";
2502
- enum: "enum";
2503
- }>>;
2504
- fields: z.ZodArray<z.ZodObject<{
2505
- name: z.ZodString;
2506
- type: z.ZodString;
2507
- description: z.ZodString;
2508
- }, z.core.$strip>>;
2509
- }, z.core.$strip>>>;
2510
- queries: z.ZodDefault<z.ZodArray<z.ZodObject<{
2511
- name: z.ZodString;
2512
- moduleId: z.ZodString;
2513
- description: z.ZodString;
2514
- auth: z.ZodCoercedBoolean<unknown>;
2515
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2516
- args: z.ZodArray<z.ZodObject<{
2517
- name: z.ZodString;
2518
- type: z.ZodString;
2519
- required: z.ZodCoercedBoolean<unknown>;
2520
- }, z.core.$strip>>;
2521
- returnType: z.ZodString;
2522
- }, z.core.$strip>>>;
2523
- mutations: z.ZodDefault<z.ZodArray<z.ZodObject<{
2524
- name: z.ZodString;
2525
- moduleId: z.ZodString;
2526
- description: z.ZodString;
2527
- auth: z.ZodCoercedBoolean<unknown>;
2528
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2529
- args: z.ZodArray<z.ZodObject<{
2530
- name: z.ZodString;
2531
- type: z.ZodString;
2532
- required: z.ZodCoercedBoolean<unknown>;
2533
- }, z.core.$strip>>;
2534
- returnType: z.ZodString;
2535
- }, z.core.$strip>>>;
2536
- }, z.core.$strip>;
2537
- declare const apiDesignSchema$1: z.ZodObject<{
2538
- style: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2539
- rest: "rest";
2540
- graphql: "graphql";
2541
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2542
- rest: "rest";
2543
- graphql: "graphql";
2544
- }>>;
2545
- rest: z.ZodOptional<z.ZodObject<{
2546
- baseUrl: z.ZodDefault<z.ZodString>;
2547
- endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
2548
- id: z.ZodString;
2549
- moduleId: z.ZodString;
2550
- method: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2551
- DELETE: "DELETE";
2552
- GET: "GET";
2553
- POST: "POST";
2554
- PUT: "PUT";
2555
- PATCH: "PATCH";
2556
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2557
- DELETE: "DELETE";
2558
- GET: "GET";
2559
- POST: "POST";
2560
- PUT: "PUT";
2561
- PATCH: "PATCH";
2562
- }>>;
2563
- path: z.ZodString;
2564
- description: z.ZodString;
2565
- auth: z.ZodCoercedBoolean<unknown>;
2566
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2567
- requestBody: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2568
- [k: string]: string;
2569
- }, Record<string, unknown>>>;
2570
- responseBody: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2571
- [k: string]: string;
2572
- }, Record<string, unknown>>>;
2573
- queryParams: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2574
- [k: string]: string;
2575
- }, Record<string, unknown>>>;
2576
- }, z.core.$strip>>>;
2577
- }, z.core.$strip>>;
2578
- graphql: z.ZodOptional<z.ZodObject<{
2579
- types: z.ZodDefault<z.ZodArray<z.ZodObject<{
2580
- name: z.ZodString;
2581
- kind: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2582
- input: "input";
2583
- type: "type";
2584
- enum: "enum";
2585
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2586
- input: "input";
2587
- type: "type";
2588
- enum: "enum";
2589
- }>>;
2590
- fields: z.ZodArray<z.ZodObject<{
2591
- name: z.ZodString;
2592
- type: z.ZodString;
2593
- description: z.ZodString;
2594
- }, z.core.$strip>>;
2595
- }, z.core.$strip>>>;
2596
- queries: z.ZodDefault<z.ZodArray<z.ZodObject<{
1887
+ }, z.core.$strip>>;
1888
+ relations: z.ZodArray<z.ZodObject<{
1889
+ field: z.ZodString;
1890
+ references: z.ZodString;
1891
+ description: z.ZodString;
1892
+ }, z.core.$strip>>;
1893
+ }, z.core.$strip>;
1894
+ declare const databaseDesignSchema: z.ZodObject<{
1895
+ type: z.ZodEnum<{
1896
+ mongodb: "mongodb";
1897
+ postgresql: "postgresql";
1898
+ }>;
1899
+ reasoning: z.ZodString;
1900
+ entities: z.ZodArray<z.ZodObject<{
1901
+ name: z.ZodString;
1902
+ description: z.ZodString;
1903
+ fields: z.ZodArray<z.ZodObject<{
2597
1904
  name: z.ZodString;
2598
- moduleId: z.ZodString;
1905
+ type: z.ZodString;
1906
+ required: z.ZodBoolean;
1907
+ unique: z.ZodBoolean;
2599
1908
  description: z.ZodString;
2600
- auth: z.ZodCoercedBoolean<unknown>;
2601
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2602
- args: z.ZodArray<z.ZodObject<{
2603
- name: z.ZodString;
2604
- type: z.ZodString;
2605
- required: z.ZodCoercedBoolean<unknown>;
2606
- }, z.core.$strip>>;
2607
- returnType: z.ZodString;
2608
- }, z.core.$strip>>>;
2609
- mutations: z.ZodDefault<z.ZodArray<z.ZodObject<{
1909
+ default: z.ZodOptional<z.ZodString>;
1910
+ }, z.core.$strip>>;
1911
+ indexes: z.ZodArray<z.ZodObject<{
2610
1912
  name: z.ZodString;
2611
- moduleId: z.ZodString;
1913
+ fields: z.ZodArray<z.ZodString>;
1914
+ unique: z.ZodBoolean;
1915
+ }, z.core.$strip>>;
1916
+ relations: z.ZodArray<z.ZodObject<{
1917
+ field: z.ZodString;
1918
+ references: z.ZodString;
2612
1919
  description: z.ZodString;
2613
- auth: z.ZodCoercedBoolean<unknown>;
2614
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2615
- args: z.ZodArray<z.ZodObject<{
2616
- name: z.ZodString;
2617
- type: z.ZodString;
2618
- required: z.ZodCoercedBoolean<unknown>;
2619
- }, z.core.$strip>>;
2620
- returnType: z.ZodString;
2621
- }, z.core.$strip>>>;
1920
+ }, z.core.$strip>>;
2622
1921
  }, z.core.$strip>>;
2623
1922
  }, z.core.$strip>;
2624
- type RestEndpoint$2 = z.infer<typeof restEndpointSchema$1>;
2625
- type RestApiDesign$1 = z.infer<typeof restApiDesignSchema>;
2626
- type GraphqlTypeDefinition$1 = z.infer<typeof graphqlTypeDefinitionSchema>;
2627
- type GraphqlOperation$2 = z.infer<typeof graphqlOperationSchema$1>;
2628
- type GraphqlApiDesign$1 = z.infer<typeof graphqlApiDesignSchema>;
2629
- type ApiDesign$2 = z.infer<typeof apiDesignSchema$1>;
1923
+ type EntityField$2 = z.infer<typeof entityFieldSchema>;
1924
+ type EntityIndex$2 = z.infer<typeof entityIndexSchema>;
1925
+ type EntityRelation$2 = z.infer<typeof entityRelationSchema>;
1926
+ type DatabaseEntity$1 = z.infer<typeof databaseEntitySchema>;
1927
+ type DatabaseDesign$1 = z.infer<typeof databaseDesignSchema>;
2630
1928
 
2631
1929
  /**
2632
1930
  * Zod schemas for FinalRequirement, RequirementSummary
1931
+ * Note: apiDesign removed -- API design is delegated to the api-designer module.
2633
1932
  */
2634
1933
 
2635
1934
  declare const requirementSummarySchema: z.ZodObject<{
@@ -2638,7 +1937,6 @@ declare const requirementSummarySchema: z.ZodObject<{
2638
1937
  totalStories: z.ZodNumber;
2639
1938
  totalModules: z.ZodNumber;
2640
1939
  totalEntities: z.ZodNumber;
2641
- totalEndpoints: z.ZodNumber;
2642
1940
  overview: z.ZodString;
2643
1941
  }, z.core.$strip>;
2644
1942
  declare const finalRequirementSchema: z.ZodObject<{
@@ -2730,100 +2028,12 @@ declare const finalRequirementSchema: z.ZodObject<{
2730
2028
  }, z.core.$strip>>;
2731
2029
  }, z.core.$strip>>;
2732
2030
  }, z.core.$strip>;
2733
- apiDesign: z.ZodObject<{
2734
- style: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2735
- rest: "rest";
2736
- graphql: "graphql";
2737
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2738
- rest: "rest";
2739
- graphql: "graphql";
2740
- }>>;
2741
- rest: z.ZodOptional<z.ZodObject<{
2742
- baseUrl: z.ZodDefault<z.ZodString>;
2743
- endpoints: z.ZodDefault<z.ZodArray<z.ZodObject<{
2744
- id: z.ZodString;
2745
- moduleId: z.ZodString;
2746
- method: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2747
- DELETE: "DELETE";
2748
- GET: "GET";
2749
- POST: "POST";
2750
- PUT: "PUT";
2751
- PATCH: "PATCH";
2752
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2753
- DELETE: "DELETE";
2754
- GET: "GET";
2755
- POST: "POST";
2756
- PUT: "PUT";
2757
- PATCH: "PATCH";
2758
- }>>;
2759
- path: z.ZodString;
2760
- description: z.ZodString;
2761
- auth: z.ZodCoercedBoolean<unknown>;
2762
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2763
- requestBody: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2764
- [k: string]: string;
2765
- }, Record<string, unknown>>>;
2766
- responseBody: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2767
- [k: string]: string;
2768
- }, Record<string, unknown>>>;
2769
- queryParams: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<{
2770
- [k: string]: string;
2771
- }, Record<string, unknown>>>;
2772
- }, z.core.$strip>>>;
2773
- }, z.core.$strip>>;
2774
- graphql: z.ZodOptional<z.ZodObject<{
2775
- types: z.ZodDefault<z.ZodArray<z.ZodObject<{
2776
- name: z.ZodString;
2777
- kind: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
2778
- input: "input";
2779
- type: "type";
2780
- enum: "enum";
2781
- }>, z.ZodString]>, z.ZodTransform<string, string>>, z.ZodEnum<{
2782
- input: "input";
2783
- type: "type";
2784
- enum: "enum";
2785
- }>>;
2786
- fields: z.ZodArray<z.ZodObject<{
2787
- name: z.ZodString;
2788
- type: z.ZodString;
2789
- description: z.ZodString;
2790
- }, z.core.$strip>>;
2791
- }, z.core.$strip>>>;
2792
- queries: z.ZodDefault<z.ZodArray<z.ZodObject<{
2793
- name: z.ZodString;
2794
- moduleId: z.ZodString;
2795
- description: z.ZodString;
2796
- auth: z.ZodCoercedBoolean<unknown>;
2797
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2798
- args: z.ZodArray<z.ZodObject<{
2799
- name: z.ZodString;
2800
- type: z.ZodString;
2801
- required: z.ZodCoercedBoolean<unknown>;
2802
- }, z.core.$strip>>;
2803
- returnType: z.ZodString;
2804
- }, z.core.$strip>>>;
2805
- mutations: z.ZodDefault<z.ZodArray<z.ZodObject<{
2806
- name: z.ZodString;
2807
- moduleId: z.ZodString;
2808
- description: z.ZodString;
2809
- auth: z.ZodCoercedBoolean<unknown>;
2810
- roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
2811
- args: z.ZodArray<z.ZodObject<{
2812
- name: z.ZodString;
2813
- type: z.ZodString;
2814
- required: z.ZodCoercedBoolean<unknown>;
2815
- }, z.core.$strip>>;
2816
- returnType: z.ZodString;
2817
- }, z.core.$strip>>>;
2818
- }, z.core.$strip>>;
2819
- }, z.core.$strip>;
2820
2031
  summary: z.ZodObject<{
2821
2032
  totalActors: z.ZodNumber;
2822
2033
  totalFlows: z.ZodNumber;
2823
2034
  totalStories: z.ZodNumber;
2824
2035
  totalModules: z.ZodNumber;
2825
2036
  totalEntities: z.ZodNumber;
2826
- totalEndpoints: z.ZodNumber;
2827
2037
  overview: z.ZodString;
2828
2038
  }, z.core.$strip>;
2829
2039
  }, z.core.$strip>;
@@ -3076,57 +2286,6 @@ interface DatabaseDesign {
3076
2286
  reasoning: string;
3077
2287
  entities: DatabaseEntity[];
3078
2288
  }
3079
- /** REST API design */
3080
- interface RestEndpoint$1 {
3081
- id: string;
3082
- moduleId: string;
3083
- method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
3084
- path: string;
3085
- description: string;
3086
- auth: boolean;
3087
- roles: string[];
3088
- requestBody?: Record<string, string>;
3089
- responseBody?: Record<string, string>;
3090
- queryParams?: Record<string, string>;
3091
- }
3092
- interface RestApiDesign {
3093
- baseUrl: string;
3094
- endpoints: RestEndpoint$1[];
3095
- }
3096
- /** GraphQL API design */
3097
- interface GraphqlTypeDefinition {
3098
- name: string;
3099
- kind: 'type' | 'input' | 'enum';
3100
- fields: {
3101
- name: string;
3102
- type: string;
3103
- description: string;
3104
- }[];
3105
- }
3106
- interface GraphqlOperation$1 {
3107
- name: string;
3108
- moduleId: string;
3109
- description: string;
3110
- auth: boolean;
3111
- roles: string[];
3112
- args: {
3113
- name: string;
3114
- type: string;
3115
- required: boolean;
3116
- }[];
3117
- returnType: string;
3118
- }
3119
- interface GraphqlApiDesign {
3120
- types: GraphqlTypeDefinition[];
3121
- queries: GraphqlOperation$1[];
3122
- mutations: GraphqlOperation$1[];
3123
- }
3124
- /** Combined API design: REST and/or GraphQL */
3125
- interface ApiDesign$1 {
3126
- style: 'rest' | 'graphql';
3127
- rest?: RestApiDesign;
3128
- graphql?: GraphqlApiDesign;
3129
- }
3130
2289
  /** Summary for final requirement document */
3131
2290
  interface RequirementSummary {
3132
2291
  totalActors: number;
@@ -3134,7 +2293,6 @@ interface RequirementSummary {
3134
2293
  totalStories: number;
3135
2294
  totalModules: number;
3136
2295
  totalEntities: number;
3137
- totalEndpoints: number;
3138
2296
  overview: string;
3139
2297
  }
3140
2298
  /** Final requirement document output */
@@ -3145,7 +2303,6 @@ interface FinalRequirement {
3145
2303
  stories: Story[];
3146
2304
  modules: Module[];
3147
2305
  database: DatabaseDesign;
3148
- apiDesign: ApiDesign$1;
3149
2306
  summary: RequirementSummary;
3150
2307
  }
3151
2308
  /** Accumulated context across chat turns */
@@ -3157,7 +2314,6 @@ interface RequirementContext {
3157
2314
  stories: Story[];
3158
2315
  modules: Module[];
3159
2316
  database: DatabaseDesign | null;
3160
- apiDesign: ApiDesign$1 | null;
3161
2317
  history: ChatEntry$1[];
3162
2318
  pendingQuestions: Question[];
3163
2319
  }
@@ -3229,16 +2385,15 @@ declare function buildExtractModulesPrompt(projectName: string, projectGoal: str
3229
2385
  * Design stage prompts - direct LLM invocation for database and API design
3230
2386
  */
3231
2387
  declare const DESIGN_DATABASE_SYSTEM_PROMPT = "You output only valid JSON. No markdown, no explanation.";
3232
- declare const DESIGN_APIS_SYSTEM_PROMPT = "You output only valid JSON. No markdown, no explanation.";
3233
2388
  declare function buildDesignDatabasePrompt(projectBrief: string, modules: string, stories: string): string;
3234
- declare function buildDesignApisPrompt(projectBrief: string, modules: string, actors: string, stories: string, database: string): string;
3235
2389
 
3236
2390
  /**
3237
2391
  * Synthesis stage prompt - compile FinalRequirement document
2392
+ * Note: apiDesign removed; API design is delegated to the api-designer module.
3238
2393
  */
3239
- declare const SYNTHESIS_SYSTEM_FRAGMENT = "You are in the complete stage. You have the full context: project brief, actors, flows, stories, modules, database design, and API design. Your job is to produce a single final requirement document (JSON) that matches the FinalRequirement schema, with a summary that includes totalActors, totalFlows, totalStories, totalModules, totalEntities, totalEndpoints, and a short overview paragraph.";
3240
- declare const SYNTHESIS_USER_PROMPT = "## Project brief (JSON):\n{projectBrief}\n\n## Actors (JSON):\n{actors}\n\n## Flows (JSON):\n{flows}\n\n## Stories (JSON):\n{stories}\n\n## Modules (JSON):\n{modules}\n\n## Database design (JSON):\n{database}\n\n## API design (JSON):\n{apiDesign}\n\nCompile the above into one FinalRequirement JSON. Include a \"summary\" object with: totalActors, totalFlows, totalStories, totalModules, totalEntities (from database.entities.length), totalEndpoints (count of REST endpoints or GraphQL queries+mutations as appropriate), and \"overview\" (2-4 sentence paragraph summarizing the project and tech choices).\n\nReturn ONLY valid JSON in this shape (no markdown, no extra text):\n{\n \"project\": { ... },\n \"actors\": [ ... ],\n \"flows\": [ ... ],\n \"stories\": [ ... ],\n \"modules\": [ ... ],\n \"database\": { ... },\n \"apiDesign\": { ... },\n \"summary\": {\n \"totalActors\": 0,\n \"totalFlows\": 0,\n \"totalStories\": 0,\n \"totalModules\": 0,\n \"totalEntities\": 0,\n \"totalEndpoints\": 0,\n \"overview\": \"string\"\n }\n}";
3241
- declare function buildSynthesisPrompt(projectBrief: string, actors: string, flows: string, stories: string, modules: string, database: string, apiDesign: string): string;
2394
+ declare const SYNTHESIS_SYSTEM_FRAGMENT = "You are in the complete stage. You have the full context: project brief, actors, flows, stories, modules, and database design. Your job is to produce a single final requirement document (JSON) that matches the FinalRequirement schema, with a summary that includes totalActors, totalFlows, totalStories, totalModules, totalEntities, and a short overview paragraph.";
2395
+ declare const SYNTHESIS_USER_PROMPT = "## Project brief (JSON):\n{projectBrief}\n\n## Actors (JSON):\n{actors}\n\n## Flows (JSON):\n{flows}\n\n## Stories (JSON):\n{stories}\n\n## Modules (JSON):\n{modules}\n\n## Database design (JSON):\n{database}\n\nCompile the above into one FinalRequirement JSON. Include a \"summary\" object with: totalActors, totalFlows, totalStories, totalModules, totalEntities (from database.entities.length), and \"overview\" (2-4 sentence paragraph summarizing the project and tech choices).\n\nReturn ONLY valid JSON in this shape (no markdown, no extra text):\n{\n \"project\": { ... },\n \"actors\": [ ... ],\n \"flows\": [ ... ],\n \"stories\": [ ... ],\n \"modules\": [ ... ],\n \"database\": { ... },\n \"summary\": {\n \"totalActors\": 0,\n \"totalFlows\": 0,\n \"totalStories\": 0,\n \"totalModules\": 0,\n \"totalEntities\": 0,\n \"overview\": \"string\"\n }\n}";
2396
+ declare function buildSynthesisPrompt(projectBrief: string, actors: string, flows: string, stories: string, modules: string, database: string): string;
3242
2397
 
3243
2398
  /**
3244
2399
  * runRequirementGathererAgent - one-shot wrapper around processRequirementChat
@@ -3270,7 +2425,6 @@ declare class RequirementContextBuilder {
3270
2425
  withStories(stories: Story[]): this;
3271
2426
  withModules(modules: Module[]): this;
3272
2427
  withDatabase(database: DatabaseDesign | null): this;
3273
- withApiDesign(apiDesign: ApiDesign$1 | null): this;
3274
2428
  withHistory(history: ChatEntry$1[]): this;
3275
2429
  withPendingQuestions(pendingQuestions: Question[]): this;
3276
2430
  reset(): this;
@@ -3370,6 +2524,22 @@ interface EditPlanConfig {
3370
2524
  logger?: Logger;
3371
2525
  }
3372
2526
 
2527
+ /**
2528
+ * Config for runPlanningFromRequirements - accepts a FinalRequirement
2529
+ * from the requirement-gatherer and produces a plan, skipping redundant stages.
2530
+ */
2531
+
2532
+ interface PlanFromRequirementsConfig {
2533
+ /** Structured requirement document from the requirement-gatherer module */
2534
+ requirement: FinalRequirement;
2535
+ /** Model config; defaults to gpt-4o-mini */
2536
+ model?: ModelConfig;
2537
+ /** Callback for each step */
2538
+ onStep?: (step: AgentStep) => void;
2539
+ /** Optional logger */
2540
+ logger?: Logger;
2541
+ }
2542
+
3373
2543
  /**
3374
2544
  * runPlanningAgent - one-shot wrapper around processPlanningChat
3375
2545
  * Auto-advances with "continue"; returns plan markdown. Does not write to file.
@@ -3399,6 +2569,23 @@ declare function editPlan(config: EditPlanConfig): Promise<string>;
3399
2569
 
3400
2570
  declare function processPlanningChat(userMessage: string, context: PlanningContext | null, config: PlanningChatConfig): Promise<PlanChatTurnResult>;
3401
2571
 
2572
+ /**
2573
+ * Wire requirement-gatherer output into the planning module.
2574
+ * Converts a FinalRequirement into a pre-filled PlanningContext at the design stage,
2575
+ * skipping the redundant discovery + requirements stages.
2576
+ */
2577
+
2578
+ /**
2579
+ * Convert a FinalRequirement (from requirement-gatherer) into a PlanningContext
2580
+ * pre-filled at the design stage, skipping discovery + requirements.
2581
+ */
2582
+ declare function convertRequirementToContext(req: FinalRequirement): PlanningContext;
2583
+ /**
2584
+ * Run the planning pipeline starting from a FinalRequirement.
2585
+ * Skips discovery + requirements stages; begins at design.
2586
+ */
2587
+ declare function runPlanningFromRequirements(config: PlanFromRequirementsConfig): Promise<AgentResult>;
2588
+
3402
2589
  /**
3403
2590
  * Builder for PlanningContext - fluent API
3404
2591
  */
@@ -3472,58 +2659,283 @@ declare const dataEntitySchema: z.ZodObject<{
3472
2659
  description: z.ZodDefault<z.ZodString>;
3473
2660
  }, z.core.$strip>>>;
3474
2661
  }, z.core.$strip>;
3475
- declare const dataModelDesignSchema: z.ZodObject<{
3476
- type: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEnum<{
3477
- mongodb: "mongodb";
3478
- postgresql: "postgresql";
3479
- }>>;
3480
- reasoning: z.ZodDefault<z.ZodString>;
3481
- entities: z.ZodDefault<z.ZodArray<z.ZodObject<{
3482
- name: z.ZodString;
3483
- description: z.ZodDefault<z.ZodString>;
2662
+ declare const dataModelDesignSchema: z.ZodObject<{
2663
+ type: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEnum<{
2664
+ mongodb: "mongodb";
2665
+ postgresql: "postgresql";
2666
+ }>>;
2667
+ reasoning: z.ZodDefault<z.ZodString>;
2668
+ entities: z.ZodDefault<z.ZodArray<z.ZodObject<{
2669
+ name: z.ZodString;
2670
+ description: z.ZodDefault<z.ZodString>;
2671
+ fields: z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
2672
+ name: z.ZodString;
2673
+ type: z.ZodString;
2674
+ required: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2675
+ unique: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2676
+ description: z.ZodDefault<z.ZodString>;
2677
+ default: z.ZodOptional<z.ZodString>;
2678
+ }, z.core.$strip>>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, z.ZodTransform<{
2679
+ name: string;
2680
+ type: string;
2681
+ required: boolean;
2682
+ unique: boolean;
2683
+ description: string;
2684
+ default?: string | undefined;
2685
+ }[], Record<string, unknown> | {
2686
+ name: string;
2687
+ type: string;
2688
+ required: boolean;
2689
+ unique: boolean;
2690
+ description: string;
2691
+ default?: string | undefined;
2692
+ }[]>>;
2693
+ indexes: z.ZodDefault<z.ZodArray<z.ZodObject<{
2694
+ name: z.ZodDefault<z.ZodString>;
2695
+ fields: z.ZodDefault<z.ZodArray<z.ZodString>>;
2696
+ unique: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2697
+ }, z.core.$strip>>>;
2698
+ relations: z.ZodDefault<z.ZodArray<z.ZodObject<{
2699
+ field: z.ZodString;
2700
+ references: z.ZodString;
2701
+ type: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEnum<{
2702
+ "1:1": "1:1";
2703
+ "1:N": "1:N";
2704
+ "M:N": "M:N";
2705
+ }>>;
2706
+ description: z.ZodDefault<z.ZodString>;
2707
+ }, z.core.$strip>>>;
2708
+ }, z.core.$strip>>>;
2709
+ }, z.core.$strip>;
2710
+ type TDataModelDesign = z.infer<typeof dataModelDesignSchema>;
2711
+
2712
+ /**
2713
+ * MongoDB field-level schema (merged from db-designer)
2714
+ */
2715
+
2716
+ declare const mongoFieldSchema: z.ZodObject<{
2717
+ fieldName: z.ZodString;
2718
+ fieldType: z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<"string" | "number" | "boolean" | "object" | "enum" | "Date" | "email" | "password" | "Types.ObjectId", string>>, z.ZodEnum<{
2719
+ string: "string";
2720
+ number: "number";
2721
+ boolean: "boolean";
2722
+ object: "object";
2723
+ enum: "enum";
2724
+ Date: "Date";
2725
+ email: "email";
2726
+ password: "password";
2727
+ "Types.ObjectId": "Types.ObjectId";
2728
+ }>>;
2729
+ isArray: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2730
+ isRequired: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2731
+ isUnique: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2732
+ values: z.ZodDefault<z.ZodArray<z.ZodString>>;
2733
+ defaultVal: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodNull]>>;
2734
+ relationTo: z.ZodOptional<z.ZodString>;
2735
+ relationType: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"" | "one-to-one" | "many-to-one", string>>, z.ZodEnum<{
2736
+ "": "";
2737
+ "one-to-one": "one-to-one";
2738
+ "many-to-one": "many-to-one";
2739
+ }>>>;
2740
+ isPrivate: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2741
+ }, z.core.$strip>;
2742
+ type TMongoFieldSchema = z.infer<typeof mongoFieldSchema>;
2743
+
2744
+ /**
2745
+ * MongoDB module (collection) schema with RBAC (merged from db-designer)
2746
+ */
2747
+
2748
+ declare const mongoModuleSchema: z.ZodObject<{
2749
+ moduleName: z.ZodString;
2750
+ isUserModule: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2751
+ authMethod: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"" | "EMAIL_AND_PASSWORD" | "PHONE_AND_OTP", string>>, z.ZodEnum<{
2752
+ "": "";
2753
+ EMAIL_AND_PASSWORD: "EMAIL_AND_PASSWORD";
2754
+ PHONE_AND_OTP: "PHONE_AND_OTP";
2755
+ }>>>;
2756
+ emailField: z.ZodOptional<z.ZodString>;
2757
+ passwordField: z.ZodOptional<z.ZodString>;
2758
+ phoneField: z.ZodOptional<z.ZodString>;
2759
+ roleField: z.ZodOptional<z.ZodString>;
2760
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodEnum<{
2761
+ CREATE: "CREATE";
2762
+ READ: "READ";
2763
+ UPDATE: "UPDATE";
2764
+ DELETE: "DELETE";
2765
+ }>>>>;
2766
+ fields: z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
2767
+ fieldName: z.ZodString;
2768
+ fieldType: z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<"string" | "number" | "boolean" | "object" | "enum" | "Date" | "email" | "password" | "Types.ObjectId", string>>, z.ZodEnum<{
2769
+ string: "string";
2770
+ number: "number";
2771
+ boolean: "boolean";
2772
+ object: "object";
2773
+ enum: "enum";
2774
+ Date: "Date";
2775
+ email: "email";
2776
+ password: "password";
2777
+ "Types.ObjectId": "Types.ObjectId";
2778
+ }>>;
2779
+ isArray: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2780
+ isRequired: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2781
+ isUnique: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2782
+ values: z.ZodDefault<z.ZodArray<z.ZodString>>;
2783
+ defaultVal: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodNull]>>;
2784
+ relationTo: z.ZodOptional<z.ZodString>;
2785
+ relationType: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"" | "one-to-one" | "many-to-one", string>>, z.ZodEnum<{
2786
+ "": "";
2787
+ "one-to-one": "one-to-one";
2788
+ "many-to-one": "many-to-one";
2789
+ }>>>;
2790
+ isPrivate: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2791
+ }, z.core.$strip>>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, z.ZodTransform<{
2792
+ fieldName: string;
2793
+ fieldType: "string" | "number" | "boolean" | "object" | "enum" | "Date" | "email" | "password" | "Types.ObjectId";
2794
+ isArray: boolean;
2795
+ isRequired: boolean;
2796
+ isUnique: boolean;
2797
+ values: string[];
2798
+ isPrivate: boolean;
2799
+ defaultVal?: string | number | boolean | null | undefined;
2800
+ relationTo?: string | undefined;
2801
+ relationType?: "" | "one-to-one" | "many-to-one" | undefined;
2802
+ }[], Record<string, unknown> | {
2803
+ fieldName: string;
2804
+ fieldType: "string" | "number" | "boolean" | "object" | "enum" | "Date" | "email" | "password" | "Types.ObjectId";
2805
+ isArray: boolean;
2806
+ isRequired: boolean;
2807
+ isUnique: boolean;
2808
+ values: string[];
2809
+ isPrivate: boolean;
2810
+ defaultVal?: string | number | boolean | null | undefined;
2811
+ relationTo?: string | undefined;
2812
+ relationType?: "" | "one-to-one" | "many-to-one" | undefined;
2813
+ }[]>>;
2814
+ }, z.core.$strip>;
2815
+ type TMongoModuleSchema = z.infer<typeof mongoModuleSchema>;
2816
+
2817
+ /**
2818
+ * MongoDB root project schema with RBAC (merged from db-designer)
2819
+ */
2820
+
2821
+ declare const mongoProjectSchema: z.ZodObject<{
2822
+ projectName: z.ZodDefault<z.ZodString>;
2823
+ projectDescription: z.ZodDefault<z.ZodString>;
2824
+ modules: z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
2825
+ moduleName: z.ZodString;
2826
+ isUserModule: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2827
+ authMethod: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"" | "EMAIL_AND_PASSWORD" | "PHONE_AND_OTP", string>>, z.ZodEnum<{
2828
+ "": "";
2829
+ EMAIL_AND_PASSWORD: "EMAIL_AND_PASSWORD";
2830
+ PHONE_AND_OTP: "PHONE_AND_OTP";
2831
+ }>>>;
2832
+ emailField: z.ZodOptional<z.ZodString>;
2833
+ passwordField: z.ZodOptional<z.ZodString>;
2834
+ phoneField: z.ZodOptional<z.ZodString>;
2835
+ roleField: z.ZodOptional<z.ZodString>;
2836
+ permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodEnum<{
2837
+ CREATE: "CREATE";
2838
+ READ: "READ";
2839
+ UPDATE: "UPDATE";
2840
+ DELETE: "DELETE";
2841
+ }>>>>;
3484
2842
  fields: z.ZodPipe<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
3485
- name: z.ZodString;
3486
- type: z.ZodString;
3487
- required: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
3488
- unique: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
3489
- description: z.ZodDefault<z.ZodString>;
3490
- default: z.ZodOptional<z.ZodString>;
2843
+ fieldName: z.ZodString;
2844
+ fieldType: z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<"string" | "number" | "boolean" | "object" | "enum" | "Date" | "email" | "password" | "Types.ObjectId", string>>, z.ZodEnum<{
2845
+ string: "string";
2846
+ number: "number";
2847
+ boolean: "boolean";
2848
+ object: "object";
2849
+ enum: "enum";
2850
+ Date: "Date";
2851
+ email: "email";
2852
+ password: "password";
2853
+ "Types.ObjectId": "Types.ObjectId";
2854
+ }>>;
2855
+ isArray: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2856
+ isRequired: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2857
+ isUnique: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
2858
+ values: z.ZodDefault<z.ZodArray<z.ZodString>>;
2859
+ defaultVal: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodNull]>>;
2860
+ relationTo: z.ZodOptional<z.ZodString>;
2861
+ relationType: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<"" | "one-to-one" | "many-to-one", string>>, z.ZodEnum<{
2862
+ "": "";
2863
+ "one-to-one": "one-to-one";
2864
+ "many-to-one": "many-to-one";
2865
+ }>>>;
2866
+ isPrivate: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
3491
2867
  }, z.core.$strip>>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, z.ZodTransform<{
3492
- name: string;
3493
- type: string;
3494
- required: boolean;
3495
- unique: boolean;
3496
- description: string;
3497
- default?: string | undefined;
2868
+ fieldName: string;
2869
+ fieldType: "string" | "number" | "boolean" | "object" | "enum" | "Date" | "email" | "password" | "Types.ObjectId";
2870
+ isArray: boolean;
2871
+ isRequired: boolean;
2872
+ isUnique: boolean;
2873
+ values: string[];
2874
+ isPrivate: boolean;
2875
+ defaultVal?: string | number | boolean | null | undefined;
2876
+ relationTo?: string | undefined;
2877
+ relationType?: "" | "one-to-one" | "many-to-one" | undefined;
3498
2878
  }[], Record<string, unknown> | {
3499
- name: string;
3500
- type: string;
3501
- required: boolean;
3502
- unique: boolean;
3503
- description: string;
3504
- default?: string | undefined;
2879
+ fieldName: string;
2880
+ fieldType: "string" | "number" | "boolean" | "object" | "enum" | "Date" | "email" | "password" | "Types.ObjectId";
2881
+ isArray: boolean;
2882
+ isRequired: boolean;
2883
+ isUnique: boolean;
2884
+ values: string[];
2885
+ isPrivate: boolean;
2886
+ defaultVal?: string | number | boolean | null | undefined;
2887
+ relationTo?: string | undefined;
2888
+ relationType?: "" | "one-to-one" | "many-to-one" | undefined;
3505
2889
  }[]>>;
3506
- indexes: z.ZodDefault<z.ZodArray<z.ZodObject<{
3507
- name: z.ZodDefault<z.ZodString>;
3508
- fields: z.ZodDefault<z.ZodArray<z.ZodString>>;
3509
- unique: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
3510
- }, z.core.$strip>>>;
3511
- relations: z.ZodDefault<z.ZodArray<z.ZodObject<{
3512
- field: z.ZodString;
3513
- references: z.ZodString;
3514
- type: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEnum<{
3515
- "1:1": "1:1";
3516
- "1:N": "1:N";
3517
- "M:N": "M:N";
3518
- }>>;
3519
- description: z.ZodDefault<z.ZodString>;
3520
- }, z.core.$strip>>>;
3521
- }, z.core.$strip>>>;
2890
+ }, z.core.$strip>>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, z.ZodTransform<{
2891
+ moduleName: string;
2892
+ isUserModule: boolean;
2893
+ fields: {
2894
+ fieldName: string;
2895
+ fieldType: "string" | "number" | "boolean" | "object" | "enum" | "Date" | "email" | "password" | "Types.ObjectId";
2896
+ isArray: boolean;
2897
+ isRequired: boolean;
2898
+ isUnique: boolean;
2899
+ values: string[];
2900
+ isPrivate: boolean;
2901
+ defaultVal?: string | number | boolean | null | undefined;
2902
+ relationTo?: string | undefined;
2903
+ relationType?: "" | "one-to-one" | "many-to-one" | undefined;
2904
+ }[];
2905
+ authMethod?: "" | "EMAIL_AND_PASSWORD" | "PHONE_AND_OTP" | undefined;
2906
+ emailField?: string | undefined;
2907
+ passwordField?: string | undefined;
2908
+ phoneField?: string | undefined;
2909
+ roleField?: string | undefined;
2910
+ permissions?: Record<string, ("CREATE" | "READ" | "UPDATE" | "DELETE")[]> | undefined;
2911
+ }[], Record<string, unknown> | {
2912
+ moduleName: string;
2913
+ isUserModule: boolean;
2914
+ fields: {
2915
+ fieldName: string;
2916
+ fieldType: "string" | "number" | "boolean" | "object" | "enum" | "Date" | "email" | "password" | "Types.ObjectId";
2917
+ isArray: boolean;
2918
+ isRequired: boolean;
2919
+ isUnique: boolean;
2920
+ values: string[];
2921
+ isPrivate: boolean;
2922
+ defaultVal?: string | number | boolean | null | undefined;
2923
+ relationTo?: string | undefined;
2924
+ relationType?: "" | "one-to-one" | "many-to-one" | undefined;
2925
+ }[];
2926
+ authMethod?: "" | "EMAIL_AND_PASSWORD" | "PHONE_AND_OTP" | undefined;
2927
+ emailField?: string | undefined;
2928
+ passwordField?: string | undefined;
2929
+ phoneField?: string | undefined;
2930
+ roleField?: string | undefined;
2931
+ permissions?: Record<string, ("CREATE" | "READ" | "UPDATE" | "DELETE")[]> | undefined;
2932
+ }[]>>;
2933
+ author: z.ZodDefault<z.ZodString>;
3522
2934
  }, z.core.$strip>;
3523
- type TDataModelDesign = z.infer<typeof dataModelDesignSchema>;
2935
+ type TMongoProjectSchema = z.infer<typeof mongoProjectSchema>;
3524
2936
 
3525
2937
  /**
3526
- * data-modeler module types
2938
+ * data-modeler module types (generic + MongoDB-specific, merged from db-designer)
3527
2939
  */
3528
2940
 
3529
2941
  type DatabaseType = 'mongodb' | 'postgresql';
@@ -3570,12 +2982,105 @@ interface DataModelerAgentConfig {
3570
2982
  /** Optional logger */
3571
2983
  logger?: Logger;
3572
2984
  }
2985
+ interface MongoActor {
2986
+ id: string;
2987
+ name: string;
2988
+ description: string;
2989
+ goals: string[];
2990
+ }
2991
+ interface MongoExtractedFlow {
2992
+ id: string;
2993
+ actorId: string;
2994
+ name: string;
2995
+ description: string;
2996
+ trigger: string;
2997
+ outcome: string;
2998
+ }
2999
+ interface MongoExtractedStory {
3000
+ id: string;
3001
+ flowId: string;
3002
+ actor: string;
3003
+ action: string;
3004
+ benefit: string;
3005
+ preconditions: string[];
3006
+ postconditions: string[];
3007
+ dataInvolved: string[];
3008
+ }
3009
+ interface MongoTechnicalRequirements {
3010
+ authentication: 'none' | 'email' | 'oauth' | 'phone' | 'email_and_phone';
3011
+ authorization: boolean;
3012
+ roles?: string[];
3013
+ integrations?: string[];
3014
+ realtime?: boolean;
3015
+ fileUpload?: boolean;
3016
+ search?: boolean;
3017
+ }
3018
+ interface MongoStructuredInput {
3019
+ projectName: string;
3020
+ projectGoal: string;
3021
+ projectDescription?: string;
3022
+ actors: MongoActor[];
3023
+ flows: MongoExtractedFlow[];
3024
+ stories: MongoExtractedStory[];
3025
+ technicalRequirements?: MongoTechnicalRequirements;
3026
+ }
3027
+ /** @deprecated Use MongoDbDesignerAgentConfig */
3028
+ type DbDesignerAgentConfig = MongoDbDesignerAgentConfig;
3029
+ interface MongoDbDesignerAgentConfig {
3030
+ /** User input: natural language requirement or instruction */
3031
+ input: string;
3032
+ /** Model config; optional */
3033
+ model?: ModelConfig;
3034
+ /** Max iterations; default 15 */
3035
+ maxIterations?: number;
3036
+ /** Callback for each step */
3037
+ onStep?: (step: AgentStep) => void;
3038
+ /** Optional logger */
3039
+ logger?: Logger;
3040
+ }
3573
3041
 
3574
3042
  /**
3575
3043
  * System prompt for data-modeler orchestrator
3576
3044
  */
3577
3045
  declare const DATA_MODELER_SYSTEM_PROMPT = "You are a senior database architect specializing in both MongoDB and PostgreSQL schema design.\n\nYou analyze requirements and produce enterprise-quality data models with:\n- Properly typed fields (MongoDB: ObjectId, string, number, date, array; PostgreSQL: uuid, varchar, text, integer, timestamp, jsonb)\n- Indexes optimized for query patterns\n- Relationships with correct cardinality (1:1, 1:N, M:N)\n- Validation constraints and default values\n- Security considerations (hashed passwords, encrypted fields)\n\nOutput only valid JSON unless instructed otherwise.";
3578
3046
 
3047
+ /**
3048
+ * MongoDB 5-phase system prompt (merged from db-designer)
3049
+ */
3050
+ declare const MONGODB_SYSTEM_PROMPT = "You are an expert MongoDB database architect with deep expertise in schema design, performance optimization, scalability, and domain-driven design. You analyze requirements systematically using a multi-phase approach to create production-ready database schemas.\n\n## ANALYSIS FRAMEWORK\n\nYou MUST follow this 5-phase analysis process before generating the schema:\n\n### PHASE 1: Entity Discovery\nSystematically extract all entities from the provided requirements:\n\n1. **From dataInvolved fields**: Every item in user stories' dataInvolved[] array indicates a potential entity or field\n2. **From User Types (Actors)**: Each actor type may indicate a User variant or role\n3. **From User Flow Actions**: Action verbs reveal implicit entities\n4. **From Flow States**: Transitions reveal status enums\n\n### PHASE 2: Relationship Mapping\nFor each entity pair, determine relationships based on:\n\n1. **Ownership Patterns** (from actor actions)\n2. **Cardinality from Flow Context** (one-to-one, many-to-one)\n3. **Shared Entities** (referenced across flows)\n4. **Bidirectional References** (for one-to-one)\n\n### PHASE 3: Permission Derivation\nMap actors to RBAC permissions:\n\n1. **Role Extraction**: Each actor type becomes a role value\n2. **Permission Mining from User Stories**: Map actions to CRUD per role\n3. **Data Visibility Rules**: \"view own\" vs \"view all\" vs \"manage\"\n\n### PHASE 4: Query Pattern Inference\nAnalyze flows to predict database access patterns:\n\n1. **Read Patterns** (suggest indexes)\n2. **Write Patterns** (affect schema design)\n3. **Aggregation Needs** (from reporting flows)\n\n### PHASE 5: Schema Construction\nSynthesize all analyses into the final schema:\n\n1. **Module Definition**: One module per core entity, camelCase names\n2. **Field Completeness**: All fields from dataInvolved, relationships, status enums, timestamps\n3. **Validation Constraints**: isRequired, isUnique, enum values\n4. **Security Fields**: password fields with isPrivate: true\n\n## CORE CONSTRAINTS (MUST FOLLOW)\n\n1. **Primary Key**: _id with Types.ObjectId (auto-generated, do not include in fields)\n2. **Relationships**: One-to-One: reference in BOTH collections; Many-to-One: reference in \"many\" side; One-to-Many: FORBIDDEN - invert to many-to-one\n3. **Data Types**: NO arrays of ObjectIds; Timestamps: createdAt, updatedAt in EVERY collection; Enums: fieldType: 'enum' with values array\n4. **Security**: NO separate \"Auth\" collection; NO token storage; Password fields: isPrivate: true\n5. **Authorization (RBAC)**: Define permissions per role on user modules";
3051
+
3052
+ /**
3053
+ * MongoDB design prompt builders (merged from db-designer)
3054
+ */
3055
+
3056
+ /**
3057
+ * Legacy: build design prompt from plain requirement string
3058
+ */
3059
+ declare function createMongoDesignPrompt(requirement: string): string;
3060
+ /**
3061
+ * Pro-level MongoDB design prompt from structured requirements
3062
+ */
3063
+ declare function createMongoProDesignPrompt(input: MongoStructuredInput): string;
3064
+
3065
+ /**
3066
+ * MongoDB redesign prompt - update existing schema based on feedback
3067
+ * (merged from db-designer)
3068
+ */
3069
+ declare function createMongoRedesignPrompt(existingSchema: string, feedback: string): string;
3070
+
3071
+ /**
3072
+ * MongoDB prompt formatters - format structured requirements for prompts
3073
+ * (merged from db-designer)
3074
+ */
3075
+
3076
+ declare function formatUserTypes(actors: MongoActor[]): string;
3077
+ declare function formatUserFlows(flows: MongoExtractedFlow[], actors: MongoActor[]): string;
3078
+ declare function formatUserStories(stories: MongoExtractedStory[], flows: MongoExtractedFlow[]): string;
3079
+ declare function formatTechnicalRequirements(tech?: MongoTechnicalRequirements): string;
3080
+ declare function extractDataEntities(stories: MongoExtractedStory[]): string[];
3081
+ declare function extractRoles(actors: MongoActor[]): string[];
3082
+ declare function buildPromptVariables(input: MongoStructuredInput): Record<string, string>;
3083
+
3579
3084
  /**
3580
3085
  * validate_schema tool - validates JSON against dataModelDesignSchema (no AI)
3581
3086
  */
@@ -3597,9 +3102,33 @@ declare function createDesignSchemaProTool(model: Model): ai.Tool;
3597
3102
  declare function createRefineSchemaTools(model: Model): ai.Tool;
3598
3103
 
3599
3104
  /**
3600
- * Create all data-modeler tools. Pass the model for AI-backed tools.
3105
+ * validate_schema tool - validates JSON against mongoProjectSchema (merged from db-designer)
3106
+ */
3107
+ declare const validateMongoSchemaTool: ai.Tool;
3108
+
3109
+ /**
3110
+ * Creates the design_database tool for MongoDB schema generation.
3111
+ */
3112
+ declare function createDesignDatabaseTool(model: Model): ai.Tool;
3113
+
3114
+ /**
3115
+ * Creates the design_database_pro tool for structured 5-phase MongoDB analysis.
3116
+ */
3117
+ declare function createDesignDatabaseProTool(model: Model): ai.Tool;
3118
+
3119
+ /**
3120
+ * Creates the redesign_database tool for iterating on MongoDB schemas.
3121
+ */
3122
+ declare function createRedesignDatabaseTool(model: Model): ai.Tool;
3123
+
3124
+ /**
3125
+ * Create all generic data-modeler tools. Pass the model for AI-backed tools.
3601
3126
  */
3602
3127
  declare function createDataModelerTools(model: Model): ToolSet;
3128
+ /**
3129
+ * Create all MongoDB-specific tools (merged from db-designer).
3130
+ */
3131
+ declare function createDbDesignerTools(model: Model): ToolSet;
3603
3132
 
3604
3133
  /**
3605
3134
  * entity-analyzer subagent - extracts entities, fields, and relationships from requirements
@@ -3625,6 +3154,15 @@ declare function createSchemaRefinerSubagent(): SubagentDefinition;
3625
3154
  */
3626
3155
  declare function runDataModelerAgent(config: DataModelerAgentConfig): Promise<AgentResult>;
3627
3156
 
3157
+ /**
3158
+ * runDbDesignerAgent - MongoDB-specific orchestrator (merged from db-designer)
3159
+ */
3160
+
3161
+ /**
3162
+ * Run the MongoDB db-designer orchestrator agent with all tools and subagents.
3163
+ */
3164
+ declare function runDbDesignerAgent(config: MongoDbDesignerAgentConfig): Promise<AgentResult>;
3165
+
3628
3166
  /**
3629
3167
  * Zod schemas for ApiDesign
3630
3168
  */
@@ -4500,8 +4038,8 @@ declare const graphqlTypeSchema: z.ZodObject<{
4500
4038
  kind: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEnum<{
4501
4039
  input: "input";
4502
4040
  type: "type";
4503
- enum: "enum";
4504
4041
  union: "union";
4042
+ enum: "enum";
4505
4043
  interface: "interface";
4506
4044
  }>>;
4507
4045
  fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -4543,8 +4081,8 @@ declare const subgraphModuleSchema: z.ZodObject<{
4543
4081
  kind: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEnum<{
4544
4082
  input: "input";
4545
4083
  type: "type";
4546
- enum: "enum";
4547
4084
  union: "union";
4085
+ enum: "enum";
4548
4086
  interface: "interface";
4549
4087
  }>>;
4550
4088
  fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -4593,8 +4131,8 @@ declare const subgraphConfigSchema: z.ZodObject<{
4593
4131
  kind: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEnum<{
4594
4132
  input: "input";
4595
4133
  type: "type";
4596
- enum: "enum";
4597
4134
  union: "union";
4135
+ enum: "enum";
4598
4136
  interface: "interface";
4599
4137
  }>>;
4600
4138
  fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -4636,8 +4174,8 @@ declare const subgraphConfigSchema: z.ZodObject<{
4636
4174
  kind: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodEnum<{
4637
4175
  input: "input";
4638
4176
  type: "type";
4639
- enum: "enum";
4640
4177
  union: "union";
4178
+ enum: "enum";
4641
4179
  interface: "interface";
4642
4180
  }>>;
4643
4181
  fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -5081,4 +4619,4 @@ declare const apiRouteGeneratorSubagent: SubagentDefinition;
5081
4619
  */
5082
4620
  declare function runNextjsBuilderAgent(config: NextjsBuilderAgentConfig): Promise<AgentResult>;
5083
4621
 
5084
- export { API_DESIGNER_SYSTEM_PROMPT, APOLLO_BUILDER_SYSTEM_PROMPT, AUTH_DESIGNER_SYSTEM_PROMPT, type Actor$1 as Actor, type ActorResult, type ApiDesign as AdApiDesign, type GraphqlOperation as AdGraphqlOperation, type RestEndpoint as AdRestEndpoint, type AgentConfig, AgentError, type AgentObserver, type AgentResult, type AgentStep, type AgentTool, type AgentToolResult, type ApiDesign$2 as ApiDesign, type ApiDesignerAgentConfig, ApiResponseTypeSchema, type ApiStyle, type ApolloBuilderAgentConfig, AppConfigSchema, type AppInfo, ApplicationSchema, type AuthDesign, type AuthDesignerAgentConfig, type AuthFlow, type AuthFlowStep, type AuthMiddleware, AuthPageApiSchema, AuthPageSchema, type AuthStrategy, BACKEND_ARCHITECT_SYSTEM_PROMPT, type BackendArchitectAgentConfig, BaseMcpClient, type BasicProjectInfo, BrandingSchema, CREATE_EXECUTION_PLAN_PROMPT, type ChatEntry$2 as ChatEntry, type ChatTurnResult, ColumnSchema, type ComponentDesign, type CreateSubagentToolOptions, CreateUserInputSchema, type CrudApi, DATA_MODELER_SYSTEM_PROMPT, DB_DESIGN_SYSTEM_PROMPT, DESIGN_APIS_SYSTEM_PROMPT, DESIGN_AUTH_PROMPT, DESIGN_BACKEND_PROMPT, DESIGN_DATABASE_SYSTEM_PROMPT, DESIGN_EXPRESS_PROMPT, DESIGN_FRONTEND_PROMPT, DESIGN_NEXTJS_PROMPT, DESIGN_SUBGRAPH_PROMPT, DISCOVERY_SYSTEM_FRAGMENT, DISCOVERY_USER_PROMPT, type DataEntity, type DataModelDesign, type DataModelerAgentConfig, type DatabaseDesign$1 as DatabaseDesign, type DatabaseEntity$1 as DatabaseEntity, type DatabaseType, type DbDesignerAgentConfig, type EntityField as DmEntityField, type EntityIndex as DmEntityIndex, type EntityRelation as DmEntityRelation, DrawerSchema, EXAMPLE_GRAPHQL_SCHEMA, EXAMPLE_JSON_OUTPUT, EXECUTION_PLANNER_SYSTEM_PROMPT, EXPRESS_BUILDER_SYSTEM_PROMPT, EXTRACT_ACTORS_PROMPT, EXTRACT_MODULES_PROMPT, type EdgeCase, type EditPlanConfig, type EntityField$2 as EntityField, type EntityIndex$2 as EntityIndex, type EntityRelation$2 as EntityRelation, type ExecutionPlan, type ExecutionPlannerAgentConfig, type ExpressBuilderAgentConfig, type ExtractedFlow, type ExtractedModule, type ExtractedStory, FRONTEND_ARCHITECT_SYSTEM_PROMPT, type FeatureBreakdownResult, FieldOptionsSchema, type FinalRequirement, type FlowsResult, ForgotPasswordSchema, type FormField, FormFieldSchema, type FrontendArchitectAgentConfig, type FrontendDesign, GENERATE_FLOWS_PROMPT, GENERATE_STORIES_PROMPT, type GraphqlApiDesign$1 as GraphqlApiDesign, type GraphqlOperation$2 as GraphqlOperation, type GraphqlTypeDefinition$1 as GraphqlTypeDefinition, type HelloWorldAgentConfig, type HttpMethod, type ImageInput, type ImplementationPhase, type InvokeObjectOptions, type InvokeObjectResult, type InvokeOptions, LibraryError, ListingPageApiSchema, ListingPageSchema, type LogLevel, type Logger, type LoggerConfig, LoginInputSchema, type McpClientConfig, type McpClientInfo, type McpResolveOptions, type McpToolContent, type McpTransport, type Model, type ModelConfig, ModelError, type ModelProvider, type ModelResponse, type ModelTool, type ModelToolCall, type Module, ModuleSchema, type ModulesResult, NEXTJS_BUILDER_SYSTEM_PROMPT, type NextjsBuilderAgentConfig, PLANNING_SYSTEM_PROMPT, type PageAccess, type PageDesign, PageSchema, type PhaseStep, type PlanChatTurnResult, type PlanSections, type PlanStageResult, type PlanningAgentConfig, type PlanningChatConfig, type ChatEntry as PlanningChatEntry, type PlanningContext, PlanningContextBuilder, type Stage as PlanningStage, type ProjectBrief, type Question$1 as Question, REACT_BUILDER_INSTRUCTION, REACT_BUILDER_SYSTEM_PROMPT, REQUIREMENT_GATHERER_SYSTEM_PROMPT, type ReactBuilderAgentConfig, type RequirementChatConfig, type RequirementContext, RequirementContextBuilder, type RequirementGathererAgentConfig, type RequirementSummary$1 as RequirementSummary, ResetPasswordSchema, type RestApiDesign$1 as RestApiDesign, type RestEndpoint$2 as RestEndpoint, type RoleDefinition, type RunSubagentOptions, SYNTHESIS_SYSTEM_FRAGMENT, SYNTHESIS_USER_PROMPT, type ScaffoldConfig, type ScaffoldError, type ScaffoldResult, type SecurityPolicy, SpecializationSchema, type Stage$1 as Stage, type StageInput, type StoriesResult, type StructuredRequirementsInput, type SubagentConfig, type SubagentDefinition, SubagentError, type SubagentResult, type TApiDesign, type TApiResponseTypeSchema, type TAppConfigSchema, type TApplicationSchema, type TAuthDesign, type TBackendDesign, type TBackendProjectSchema, type TBrandingSchema, type TColumnSchema, type TCreateUserInputSchema, type TDataModelDesign, type TExecutionPlan, type TExpressConfig, type TFieldSchema, type TForgotPasswordSchema, type TFormFieldSchema, type TFrontendDesign, type TLoginInputSchema, type TModuleSchema$1 as TModuleSchema, type TNextjsConfig, type TPageSchema, type TModuleSchema as TReactModuleSchema, type TResetPasswordSchema, type TSpecializationSchema, type TSubgraphConfig, type TUpdateUserInputSchema, type TUserSchema, type TechnicalRequirements, type TemplateAuth, type TemplateBranding, type TemplateContext, type TemplateField, type TemplateModule, type TemplateOperation, type TestChecklistItem, type ToolConfig, type ToolContext, ToolError, type ToolExecutionResult, type ToolLogger, type ToolSet, UpdateUserInputSchema, UserSchema, ValidationError, ValidationSchema, type VisionOptions, actorSchema, actorsResultSchema, apiDesignSchema as adApiDesignSchema, graphqlOperationSchema as adGraphqlOperationSchema, restEndpointSchema as adRestEndpointSchema, addChatEntry, advanceStage, apiDesignSchema$1 as apiDesignSchema, apiRouteGeneratorSubagent, assemblePlan, authDesignSchema, authFlowSchema, authFlowStepSchema, authMiddlewareSchema, backendDesignSchema, buildCreateExecutionPlanPrompt, buildDesignApisPrompt, buildDesignAuthPrompt, buildDesignBackendPrompt, buildDesignDatabasePrompt, buildDesignExpressPrompt, buildDesignFrontendPrompt, buildDesignNextjsPrompt, buildDesignSubgraphPrompt, buildDiscoveryPrompt, buildExampleShotPrompt, buildExtractActorsPrompt, buildExtractModulesPrompt, buildFeedbackPrompt, buildGenerateFlowsPrompt, buildGenerateStoriesPrompt, buildInstructionPrompt, buildPromptVariables, buildSynthesisPrompt, chatEntrySchema, compileTemplate, componentAnalyzerSubagent, componentDesignSchema, contractDesignerSubagent, createAnthropicModel, createApiDesignerTools, createApolloBuilderTools, createAuthDesignerTools, createBackendArchitectTools, createConfigValidatorSubagent, createDataModelerTools, createDbDesignPrompt, createDbDesignerTools, createDesignApiProTool, createDesignApiTool, createDesignAuthTool, createDesignBackendTool, createDesignDatabaseProTool, createDesignDatabaseTool, createDesignFrontendTool, createDesignSchemaProTool, createDesignSchemaTool, createExecutionPlanTool, createExecutionPlannerTools, createExpressBuilderTools, createFrontendArchitectTools, createGenerateExpressTool, createGenerateFeatureBreakdownTool, createGenerateFrontendTool, createGenerateNextjsTool, createGenerateSubgraphTool, createGoogleModel, createInitialContext, createLogger, createModel, createNextjsBuilderTools, createOpenAIModel, createPlanningContextBuilder, createProDbDesignPrompt, createReactBuilderTools, createRedesignDatabaseTool, createRedesignPrompt, createRefineSchemaTools, createRequirementContextBuilder, createSchemaRefinerSubagent$1 as createSchemaRefinerSubagent, createSubagentTool, createSubagentToolSet, createToolSet, crudApiSchema, databaseDesignSchema, databaseEntitySchema, defineSubagent, defineTool, createSchemaRefinerSubagent as dmCreateSchemaRefinerSubagent, dataEntitySchema as dmDataEntitySchema, dataModelDesignSchema as dmDataModelDesignSchema, entityAnalyzerSubagent as dmEntityAnalyzerSubagent, validateSchemaTool as dmValidateSchemaTool, edgeCaseAnalyzerSubagent, edgeCaseSchema, editPlan, endpointAnalyzerSubagent, entityAnalyzerSubagent$1 as entityAnalyzerSubagent, entityFieldSchema, entityIndexSchema, entityRelationSchema, executeTool, executeToolByName, executionPlanSchema, expressConfigSchema, extractDataEntities, extractJson, extractRoles, extractedModuleSchema, fieldSchema, finalRequirementSchema, flowDesignerSubagent, flowSchema, flowsResultSchema, formFieldSchema, formatTechnicalRequirements, formatUserFlows, formatUserStories, formatUserTypes, frameworkSelectorSubagent, frontendDesignSchema, getTool, getTools, graphqlAnalyzerSubagent, graphqlApiDesignSchema, graphqlFieldSchema, graphqlOperationSchema$1 as graphqlOperationSchema, graphqlTypeDefinitionSchema, graphqlTypeSchema, helloWorldTool, implementationPhaseSchema, loggerConfigFromEnv, mergeStageResult, middlewareConfigSchema, middlewareConfiguratorSubagent, middlewareSchema, modelFieldSchema, modelSchema, moduleSchema, modulesResultSchema, nextjsApiRouteSchema, nextjsConfigSchema, nextjsLayoutSchema, nextjsPageSchema, pageDesignSchema, pagePlannerSubagent, parseModelJsonResponse, phaseStepSchema, processPlanningChat, processRequirementChat, projectBriefSchema, projectSchema, questionSchema, registerHelpers, relationshipMapperSubagent, requirementContextSchema, requirementSummarySchema, resolverOperationSchema, resolverPlannerSubagent, restApiDesignSchema, restEndpointSchema$1 as restEndpointSchema, roleDefinitionSchema, routeGeneratorSubagent, routeGroupSchema, routePlannerSubagent, routerMethodSchema, routerSchema, runAgent, runApiDesignerAgent, runApolloBuilderAgent, runAuthDesignerAgent, runBackendArchitectAgent, runDataModelerAgent, runDbDesignerAgent, runExecutionPlannerAgent, runExpressBuilderAgent, runFrontendArchitectAgent, runHelloWorldAgent, runNextjsBuilderAgent, runPlanningAgent, runReactBuilderAgent, runRequirementGathererAgent, runSubagent, safeJsonParse, scaffoldExpressTool, scaffoldProject, scaffoldSubgraphTool, schemaGeneratorSubagent, securityAnalyzerSubagent, securityPolicySchema, serverActionSchema, servicePlannerSubagent, serviceSchema, storiesResultSchema, storySchema, subgraphConfigSchema, subgraphModuleSchema, sumTokenUsage, testChecklistItemSchema, testingStrategistSubagent, validateApiTool, validateAuthTool, validateBackendTool, validateExecutionPlanTool, validateExpressTool, validateFrontendConfigTool, validateFrontendTool, validateNextjsTool, validateSchemaTool$1 as validateSchemaTool, validateSubgraphTool, writePlanToFile };
4622
+ export { API_DESIGNER_SYSTEM_PROMPT, APOLLO_BUILDER_SYSTEM_PROMPT, AUTH_DESIGNER_SYSTEM_PROMPT, type ActorResult, type ApiDesign as AdApiDesign, type GraphqlOperation as AdGraphqlOperation, type RestEndpoint as AdRestEndpoint, type AgentConfig, AgentError, type AgentObserver, type AgentResult, type AgentStep, type AgentTool, type AgentToolResult, type ApiDesignerAgentConfig, ApiResponseTypeSchema, type ApiStyle, type ApolloBuilderAgentConfig, AppConfigSchema, type AppInfo, ApplicationSchema, type AuthDesign, type AuthDesignerAgentConfig, type AuthFlow, type AuthFlowStep, type AuthMiddleware, AuthPageApiSchema, AuthPageSchema, type AuthStrategy, BACKEND_ARCHITECT_SYSTEM_PROMPT, type BackendArchitectAgentConfig, BaseMcpClient, type BasicProjectInfo, BrandingSchema, CREATE_EXECUTION_PLAN_PROMPT, type ChatEntry$2 as ChatEntry, type ChatTurnResult, ColumnSchema, type ComponentDesign, type CreateSubagentToolOptions, CreateUserInputSchema, type CrudApi, DATA_MODELER_SYSTEM_PROMPT, MONGODB_SYSTEM_PROMPT as DB_DESIGN_SYSTEM_PROMPT, DESIGN_AUTH_PROMPT, DESIGN_BACKEND_PROMPT, DESIGN_DATABASE_SYSTEM_PROMPT, DESIGN_EXPRESS_PROMPT, DESIGN_FRONTEND_PROMPT, DESIGN_NEXTJS_PROMPT, DESIGN_SUBGRAPH_PROMPT, DISCOVERY_SYSTEM_FRAGMENT, DISCOVERY_USER_PROMPT, type DataEntity, type DataModelDesign, type DataModelerAgentConfig, type DatabaseDesign$1 as DatabaseDesign, type DatabaseEntity$1 as DatabaseEntity, type DatabaseType, type DbDesignerAgentConfig, type EntityField as DmEntityField, type EntityIndex as DmEntityIndex, type EntityRelation as DmEntityRelation, DrawerSchema, EXAMPLE_GRAPHQL_SCHEMA, EXAMPLE_JSON_OUTPUT, EXECUTION_PLANNER_SYSTEM_PROMPT, EXPRESS_BUILDER_SYSTEM_PROMPT, EXTRACT_ACTORS_PROMPT, EXTRACT_MODULES_PROMPT, type EdgeCase, type EditPlanConfig, type EntityField$2 as EntityField, type EntityIndex$2 as EntityIndex, type EntityRelation$2 as EntityRelation, type ExecutionPlan, type ExecutionPlannerAgentConfig, type ExpressBuilderAgentConfig, type ExtractedModule, FRONTEND_ARCHITECT_SYSTEM_PROMPT, type FeatureBreakdownResult, FieldOptionsSchema, type FinalRequirement, type FlowsResult, ForgotPasswordSchema, type FormField, FormFieldSchema, type FrontendArchitectAgentConfig, type FrontendDesign, GENERATE_FLOWS_PROMPT, GENERATE_STORIES_PROMPT, type HelloWorldAgentConfig, type HttpMethod, type ImageInput, type ImplementationPhase, type InvokeObjectOptions, type InvokeObjectResult, type InvokeOptions, LibraryError, ListingPageApiSchema, ListingPageSchema, type LogLevel, type Logger, type LoggerConfig, LoginInputSchema, MONGODB_SYSTEM_PROMPT, type McpClientConfig, type McpClientInfo, type McpResolveOptions, type McpToolContent, type McpTransport, type Model, type ModelConfig, ModelError, type ModelProvider, type ModelResponse, type ModelTool, type ModelToolCall, type Module, ModuleSchema, type ModulesResult, type MongoActor, type MongoDbDesignerAgentConfig, type MongoExtractedFlow, type MongoExtractedStory, type MongoStructuredInput, type MongoTechnicalRequirements, NEXTJS_BUILDER_SYSTEM_PROMPT, type NextjsBuilderAgentConfig, PLANNING_SYSTEM_PROMPT, type PageAccess, type PageDesign, PageSchema, type PhaseStep, type PlanChatTurnResult, type PlanFromRequirementsConfig, type PlanSections, type PlanStageResult, type PlanningAgentConfig, type PlanningChatConfig, type ChatEntry as PlanningChatEntry, type PlanningContext, PlanningContextBuilder, type Stage as PlanningStage, type ProjectBrief, type Question$1 as Question, REACT_BUILDER_INSTRUCTION, REACT_BUILDER_SYSTEM_PROMPT, REQUIREMENT_GATHERER_SYSTEM_PROMPT, type ReactBuilderAgentConfig, type RequirementChatConfig, type RequirementContext, RequirementContextBuilder, type RequirementGathererAgentConfig, type RequirementSummary$1 as RequirementSummary, ResetPasswordSchema, type RoleDefinition, type RunSubagentOptions, SYNTHESIS_SYSTEM_FRAGMENT, SYNTHESIS_USER_PROMPT, type ScaffoldConfig, type ScaffoldError, type ScaffoldResult, type SecurityPolicy, SpecializationSchema, type Stage$1 as Stage, type StageInput, type StoriesResult, type SubagentConfig, type SubagentDefinition, SubagentError, type SubagentResult, type TApiDesign, type TApiResponseTypeSchema, type TAppConfigSchema, type TApplicationSchema, type TAuthDesign, type TBackendDesign, type TMongoProjectSchema as TBackendProjectSchema, type TBrandingSchema, type TColumnSchema, type TCreateUserInputSchema, type TDataModelDesign, type TExecutionPlan, type TExpressConfig, type TForgotPasswordSchema, type TFormFieldSchema, type TFrontendDesign, type TLoginInputSchema, type TMongoFieldSchema, type TMongoModuleSchema, type TMongoProjectSchema, type TNextjsConfig, type TPageSchema, type TModuleSchema as TReactModuleSchema, type TResetPasswordSchema, type TSpecializationSchema, type TSubgraphConfig, type TUpdateUserInputSchema, type TUserSchema, type TemplateAuth, type TemplateBranding, type TemplateContext, type TemplateField, type TemplateModule, type TemplateOperation, type TestChecklistItem, type ToolConfig, type ToolContext, ToolError, type ToolExecutionResult, type ToolLogger, type ToolSet, UpdateUserInputSchema, UserSchema, ValidationError, ValidationSchema, type VisionOptions, actorSchema, actorsResultSchema, apiDesignSchema as adApiDesignSchema, graphqlOperationSchema as adGraphqlOperationSchema, restEndpointSchema as adRestEndpointSchema, addChatEntry, advanceStage, apiRouteGeneratorSubagent, assemblePlan, authDesignSchema, authFlowSchema, authFlowStepSchema, authMiddlewareSchema, backendDesignSchema, buildCreateExecutionPlanPrompt, buildDesignAuthPrompt, buildDesignBackendPrompt, buildDesignDatabasePrompt, buildDesignExpressPrompt, buildDesignFrontendPrompt, buildDesignNextjsPrompt, buildDesignSubgraphPrompt, buildDiscoveryPrompt, buildExampleShotPrompt, buildExtractActorsPrompt, buildExtractModulesPrompt, buildFeedbackPrompt, buildGenerateFlowsPrompt, buildGenerateStoriesPrompt, buildInstructionPrompt, buildPromptVariables, buildSynthesisPrompt, chatEntrySchema, compileTemplate, componentAnalyzerSubagent, componentDesignSchema, contractDesignerSubagent, convertRequirementToContext, createAnthropicModel, createApiDesignerTools, createApolloBuilderTools, createAuthDesignerTools, createBackendArchitectTools, createConfigValidatorSubagent, createDataModelerTools, createMongoDesignPrompt as createDbDesignPrompt, createDbDesignerTools, createDesignApiProTool, createDesignApiTool, createDesignAuthTool, createDesignBackendTool, createDesignDatabaseProTool, createDesignDatabaseTool, createDesignFrontendTool, createDesignSchemaProTool, createDesignSchemaTool, createExecutionPlanTool, createExecutionPlannerTools, createExpressBuilderTools, createFrontendArchitectTools, createGenerateExpressTool, createGenerateFeatureBreakdownTool, createGenerateFrontendTool, createGenerateNextjsTool, createGenerateSubgraphTool, createGoogleModel, createInitialContext, createLogger, createModel, createMongoDesignPrompt, createMongoProDesignPrompt, createMongoRedesignPrompt, createNextjsBuilderTools, createOpenAIModel, createPlanningContextBuilder, createMongoProDesignPrompt as createProDbDesignPrompt, createReactBuilderTools, createRedesignDatabaseTool, createMongoRedesignPrompt as createRedesignPrompt, createRefineSchemaTools, createRequirementContextBuilder, createSchemaRefinerSubagent, createSubagentTool, createSubagentToolSet, createToolSet, crudApiSchema, databaseDesignSchema, databaseEntitySchema, defineSubagent, defineTool, createSchemaRefinerSubagent as dmCreateSchemaRefinerSubagent, dataEntitySchema as dmDataEntitySchema, dataModelDesignSchema as dmDataModelDesignSchema, entityAnalyzerSubagent as dmEntityAnalyzerSubagent, validateSchemaTool as dmValidateSchemaTool, edgeCaseAnalyzerSubagent, edgeCaseSchema, editPlan, endpointAnalyzerSubagent, entityAnalyzerSubagent, entityFieldSchema, entityIndexSchema, entityRelationSchema, executeTool, executeToolByName, executionPlanSchema, expressConfigSchema, extractDataEntities, extractJson, extractRoles, extractedModuleSchema, mongoFieldSchema as fieldSchema, finalRequirementSchema, flowDesignerSubagent, flowSchema, flowsResultSchema, formFieldSchema, formatTechnicalRequirements, formatUserFlows, formatUserStories, formatUserTypes, frameworkSelectorSubagent, frontendDesignSchema, getTool, getTools, graphqlAnalyzerSubagent, graphqlFieldSchema, graphqlTypeSchema, helloWorldTool, implementationPhaseSchema, loggerConfigFromEnv, mergeStageResult, middlewareConfigSchema, middlewareConfiguratorSubagent, middlewareSchema, modelFieldSchema, modelSchema, mongoModuleSchema as moduleSchema, modulesResultSchema, mongoFieldSchema, mongoModuleSchema, mongoProjectSchema, nextjsApiRouteSchema, nextjsConfigSchema, nextjsLayoutSchema, nextjsPageSchema, pageDesignSchema, pagePlannerSubagent, parseModelJsonResponse, phaseStepSchema, processPlanningChat, processRequirementChat, projectBriefSchema, mongoProjectSchema as projectSchema, questionSchema, registerHelpers, relationshipMapperSubagent, requirementContextSchema, requirementSummarySchema, resolverOperationSchema, resolverPlannerSubagent, roleDefinitionSchema, routeGeneratorSubagent, routeGroupSchema, routePlannerSubagent, routerMethodSchema, routerSchema, runAgent, runApiDesignerAgent, runApolloBuilderAgent, runAuthDesignerAgent, runBackendArchitectAgent, runDataModelerAgent, runDbDesignerAgent, runExecutionPlannerAgent, runExpressBuilderAgent, runFrontendArchitectAgent, runHelloWorldAgent, runNextjsBuilderAgent, runPlanningAgent, runPlanningFromRequirements, runReactBuilderAgent, runRequirementGathererAgent, runSubagent, safeJsonParse, scaffoldExpressTool, scaffoldProject, scaffoldSubgraphTool, schemaGeneratorSubagent, securityAnalyzerSubagent, securityPolicySchema, serverActionSchema, servicePlannerSubagent, serviceSchema, storiesResultSchema, storySchema, subgraphConfigSchema, subgraphModuleSchema, sumTokenUsage, testChecklistItemSchema, testingStrategistSubagent, validateApiTool, validateAuthTool, validateBackendTool, validateExecutionPlanTool, validateExpressTool, validateFrontendConfigTool, validateFrontendTool, validateNextjsTool, validateMongoSchemaTool as validateSchemaTool, validateSubgraphTool, writePlanToFile };