@autobe/agent 0.16.1 → 0.17.1

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.
Files changed (134) hide show
  1. package/lib/AutoBeAgent.js +9 -9
  2. package/lib/AutoBeAgent.js.map +1 -1
  3. package/lib/constants/AutoBeSystemPromptConstant.d.ts +2 -2
  4. package/lib/context/AutoBeContext.d.ts +16 -4
  5. package/lib/context/AutoBeTokenUsage.d.ts +168 -11
  6. package/lib/context/AutoBeTokenUsage.js +152 -32
  7. package/lib/context/AutoBeTokenUsage.js.map +1 -1
  8. package/lib/context/AutoBeTokenUsageComponent.d.ts +116 -0
  9. package/lib/context/AutoBeTokenUsageComponent.js +120 -0
  10. package/lib/context/AutoBeTokenUsageComponent.js.map +1 -0
  11. package/lib/factory/createAutoBeApplication.js +1 -1
  12. package/lib/factory/createAutoBeApplication.js.map +1 -1
  13. package/lib/factory/createAutoBeContext.d.ts +19 -0
  14. package/lib/factory/createAutoBeContext.js +141 -0
  15. package/lib/factory/createAutoBeContext.js.map +1 -0
  16. package/lib/factory/getAutoBeGenerated.d.ts +1 -1
  17. package/lib/factory/getAutoBeGenerated.js +14 -11
  18. package/lib/factory/getAutoBeGenerated.js.map +1 -1
  19. package/lib/factory/getAutoBeRealizeGenerated.d.ts +7 -0
  20. package/lib/factory/getAutoBeRealizeGenerated.js +27 -0
  21. package/lib/factory/getAutoBeRealizeGenerated.js.map +1 -0
  22. package/lib/index.d.ts +1 -0
  23. package/lib/index.js +1 -0
  24. package/lib/index.js.map +1 -1
  25. package/lib/index.mjs +1090 -927
  26. package/lib/index.mjs.map +1 -1
  27. package/lib/orchestrate/analyze/orchestrateAnalyze.js +9 -36
  28. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  29. package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js +9 -9
  30. package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js.map +1 -1
  31. package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js +1 -1
  32. package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js.map +1 -1
  33. package/lib/orchestrate/interface/orchestrateInterface.js +6 -23
  34. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  35. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +1 -1
  36. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  37. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +1 -1
  38. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  39. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +1 -1
  40. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
  41. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +1 -1
  42. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  43. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +1 -1
  44. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  45. package/lib/orchestrate/prisma/{transformPrismaComponentsHistories.d.ts → histories/transformPrismaComponentsHistories.d.ts} +1 -1
  46. package/lib/orchestrate/prisma/{transformPrismaComponentsHistories.js → histories/transformPrismaComponentsHistories.js} +1 -1
  47. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -0
  48. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -0
  49. package/lib/orchestrate/prisma/{transformPrismaHistories.d.ts → histories/transformPrismaHistories.d.ts} +1 -1
  50. package/lib/orchestrate/prisma/histories/transformPrismaHistories.js.map +1 -0
  51. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +48 -0
  52. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -0
  53. package/lib/orchestrate/prisma/orchestratePrisma.d.ts +1 -1
  54. package/lib/orchestrate/prisma/orchestratePrisma.js +9 -29
  55. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  56. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +126 -19
  57. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  58. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +10 -10
  59. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  60. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +128 -150
  61. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
  62. package/lib/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.d.ts +120 -0
  63. package/lib/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.js +3 -0
  64. package/lib/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.js.map +1 -0
  65. package/lib/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.d.ts +142 -0
  66. package/lib/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.js +3 -0
  67. package/lib/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.js.map +1 -0
  68. package/lib/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.d.ts +209 -0
  69. package/lib/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.js +3 -0
  70. package/lib/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.js.map +1 -0
  71. package/lib/orchestrate/realize/orchestrateRealize.js +13 -24
  72. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  73. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +1 -1
  74. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  75. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +1 -1
  76. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  77. package/lib/orchestrate/realize/orchestrateRealizeCoder.js +23 -23
  78. package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -1
  79. package/lib/orchestrate/test/orchestrateTest.js +8 -26
  80. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  81. package/lib/orchestrate/test/orchestrateTestCorrect.js +1 -1
  82. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  83. package/lib/orchestrate/test/orchestrateTestScenario.js +1 -1
  84. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  85. package/lib/orchestrate/test/orchestrateTestWrite.js +1 -1
  86. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  87. package/package.json +7 -7
  88. package/src/AutoBeAgent.ts +10 -9
  89. package/src/constants/AutoBeSystemPromptConstant.ts +2 -2
  90. package/src/context/AutoBeContext.ts +30 -3
  91. package/src/context/AutoBeTokenUsage.ts +252 -54
  92. package/src/context/AutoBeTokenUsageComponent.ts +180 -0
  93. package/src/factory/createAutoBeApplication.ts +1 -1
  94. package/src/factory/createAutoBeContext.ts +193 -0
  95. package/src/factory/getAutoBeGenerated.ts +14 -21
  96. package/src/factory/getAutoBeRealizeGenerated.ts +30 -0
  97. package/src/index.ts +1 -0
  98. package/src/orchestrate/analyze/orchestrateAnalyze.ts +9 -38
  99. package/src/orchestrate/analyze/orchestrateAnalyzeReviewer.ts +1 -1
  100. package/src/orchestrate/analyze/writeDocumentUntilReviewPassed.ts +1 -1
  101. package/src/orchestrate/interface/orchestrateInterface.ts +4 -21
  102. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +1 -1
  103. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +1 -1
  104. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +1 -1
  105. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +1 -1
  106. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +1 -1
  107. package/src/orchestrate/prisma/{transformPrismaComponentsHistories.ts → histories/transformPrismaComponentsHistories.ts} +2 -2
  108. package/src/orchestrate/prisma/{transformPrismaCorrectHistories.ts → histories/transformPrismaCorrectHistories.ts} +1 -1
  109. package/src/orchestrate/prisma/{transformPrismaHistories.ts → histories/transformPrismaHistories.ts} +2 -2
  110. package/src/orchestrate/prisma/{transformPrismaSchemaHistories.ts → histories/transformPrismaSchemaHistories.ts} +1 -1
  111. package/src/orchestrate/prisma/orchestratePrisma.ts +45 -68
  112. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +13 -81
  113. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +8 -148
  114. package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +15 -82
  115. package/src/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.ts +124 -0
  116. package/src/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.ts +144 -0
  117. package/src/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.ts +214 -0
  118. package/src/orchestrate/realize/orchestrateRealize.ts +19 -32
  119. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +1 -1
  120. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +1 -1
  121. package/src/orchestrate/realize/orchestrateRealizeCoder.ts +1 -1
  122. package/src/orchestrate/test/orchestrateTest.ts +6 -26
  123. package/src/orchestrate/test/orchestrateTestCorrect.ts +1 -1
  124. package/src/orchestrate/test/orchestrateTestScenario.ts +1 -1
  125. package/src/orchestrate/test/orchestrateTestWrite.ts +1 -1
  126. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +0 -1
  127. package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js.map +0 -1
  128. package/lib/orchestrate/prisma/transformPrismaHistories.js.map +0 -1
  129. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +0 -48
  130. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +0 -1
  131. /package/lib/orchestrate/prisma/{transformPrismaCorrectHistories.d.ts → histories/transformPrismaCorrectHistories.d.ts} +0 -0
  132. /package/lib/orchestrate/prisma/{transformPrismaCorrectHistories.js → histories/transformPrismaCorrectHistories.js} +0 -0
  133. /package/lib/orchestrate/prisma/{transformPrismaHistories.js → histories/transformPrismaHistories.js} +0 -0
  134. /package/lib/orchestrate/prisma/{transformPrismaSchemaHistories.d.ts → histories/transformPrismaSchemaHistories.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"orchestratePrismaSchemas.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaSchemas.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,4DAkCC;;;AAhDD,yCAAoE;AAKpE,kDAA0B;AAI1B,uEAAoE;AACpE,iEAA8D;AAC9D,uDAAoD;AACpD,qFAAkF;AAElF,SAAsB,wBAAwB,CAC5C,GAAyB,EACzB,UAAqC;;QAErC,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAW,UAAU;aAC7B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;aAC3B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9B,IAAI,SAAS,GAAW,CAAC,CAAC;QAC1B,OAAO,MAAM,OAAO,CAAC,GAAG,CACtB,UAAU,CAAC,GAAG,CAAC,CAAO,IAAI,EAAE,EAAE;;YAC5B,MAAM,eAAe,GAA4B,IAAI,CAAC;YACtD,MAAM,eAAe,GAA8B,UAAU,CAAC,MAAM,CAClE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAClB,CAAC;YACF,MAAM,MAAM,GAA+B,MAAM,IAAA,uBAAU,EAAC,GAAG,EAAE,CAC/D,OAAO,CAAC,GAAG,EAAE,eAAe,EAAE,eAAe,CAAC,CAC/C,CAAC;YACF,MAAM,KAAK,GAA6B;gBACtC,IAAI,EAAE,eAAe;gBACrB,UAAU,EAAE,KAAK,CAAC,WAAW,EAAE;gBAC/B,IAAI,EAAE;oBACJ,QAAQ,EAAE,IAAI,CAAC,QAAQ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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
@@ -0,0 +1,120 @@
1
+ import { AutoBePrisma } from "@autobe/interface";
2
+ export interface IAutoBePrismaComponentApplication {
3
+ /**
4
+ * Organizes database tables into domain-based components for Prisma schema
5
+ * generation.
6
+ *
7
+ * Takes business requirements and groups related tables into logical domains,
8
+ * with each component becoming a separate .prisma file.
9
+ */
10
+ extractComponents(props: IAutoBePrismaComponentApplication.IProps): void;
11
+ }
12
+ export declare namespace IAutoBePrismaComponentApplication {
13
+ interface IProps {
14
+ /**
15
+ * Initial thoughts on namespace classification criteria.
16
+ *
17
+ * Contains the AI agent's initial analysis and reasoning about how to
18
+ * organize tables into different business domains/namespaces.
19
+ *
20
+ * **Example:**
21
+ *
22
+ * "Based on the business requirements, I identify several key domains:
23
+ * - User-related entities should be grouped under 'Actors' namespace
24
+ * - Product and sales information under 'Sales' namespace
25
+ * - System configuration under 'Systematic' namespace"
26
+ */
27
+ thinking: string;
28
+ /**
29
+ * Review and refinement of the namespace classification.
30
+ *
31
+ * Contains the AI agent's review process, considering relationships between
32
+ * tables and potential improvements to the initial classification.
33
+ *
34
+ * **Example:**
35
+ *
36
+ * "Upon review, I noticed that 'shopping_channel_categories' has strong
37
+ * relationships with both channels and sales. However, since it primarily
38
+ * defines the channel structure, it should remain in 'Systematic' namespace."
39
+ */
40
+ review: string;
41
+ /**
42
+ * Final decision on namespace classification.
43
+ *
44
+ * Contains the AI agent's final reasoning and rationale for the chosen
45
+ * namespace organization, explaining why this structure best serves the
46
+ * business requirements.
47
+ *
48
+ * **Example:**
49
+ *
50
+ * "Final decision: Organize tables into 3 main namespaces:
51
+ * 1. Systematic - for channel and system configuration
52
+ * 2. Actors - for all user types (customers, citizens, administrators)
53
+ * 3. Sales - for product sales and related transactional data
54
+ * This structure provides clear separation of concerns and follows DDD principles."
55
+ */
56
+ decision: string;
57
+ /**
58
+ * Array of domain components that group related database tables.
59
+ *
60
+ * Each component represents a business domain and becomes one Prisma schema
61
+ * file. Common domains include: Actors (users), Sales (products), Orders,
62
+ * Carts, etc.
63
+ *
64
+ * **Example:**
65
+ *
66
+ * ```typescript
67
+ * {
68
+ * "components": [
69
+ * {
70
+ * "filename": "schema-02-systematic.prisma",
71
+ * "namespace": "Systematic",
72
+ * "thinking": "These tables all relate to system configuration and channel management. They form the foundation of the platform.",
73
+ * "review": "Considering the relationships, shopping_channel_categories connects channels and sales, but it fundamentally defines channel structure.",
74
+ * "rationale": "Grouping all system configuration tables together provides a clear foundation layer that other domains can reference.",
75
+ * "tables": [
76
+ * "shopping_channels",
77
+ * "shopping_sections",
78
+ * "shopping_channel_categories"
79
+ * ]
80
+ * },
81
+ * {
82
+ * "filename": "schema-03-actors.prisma",
83
+ * "namespace": "Actors",
84
+ * "thinking": "All user-related entities should be grouped together as they share authentication and identity patterns.",
85
+ * "review": "While customers interact with sales, the customer entity itself is about identity, not transactions.",
86
+ * "rationale": "This component groups all actor-related tables to maintain separation between identity management and business transactions.",
87
+ * "tables": [
88
+ * "shopping_customers",
89
+ * "shopping_citizens",
90
+ * "shopping_administrators"
91
+ * ]
92
+ * },
93
+ * {
94
+ * "filename": "schema-04-sales.prisma",
95
+ * "namespace": "Sales",
96
+ * "thinking": "Product catalog and sales-related tables belong together as they form the core commerce functionality.",
97
+ * "review": "Sales snapshots are integral to the sales domain for tracking product history and price changes.",
98
+ * "rationale": "Consolidating all sales-related tables enables coherent management of the entire product lifecycle.",
99
+ * "tables": [
100
+ * "shopping_sales",
101
+ * "shopping_sale_snapshots",
102
+ * "shopping_sale_units",
103
+ * "shopping_sale_unit_options"
104
+ * ]
105
+ * }
106
+ * ]
107
+ * }
108
+ * ```
109
+ *
110
+ * **Notes:**
111
+ *
112
+ * - Table names must follow snake_case convention with domain prefix (e.g.,
113
+ * `shopping_customers`)
114
+ * - Each component becomes one `.prisma` file containing related models
115
+ * - Filename numbering indicates dependency order for schema generation
116
+ * - Namespace is used for documentation organization and domain grouping
117
+ */
118
+ components: AutoBePrisma.IComponent[];
119
+ }
120
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAutoBePrismaComponentApplication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutoBePrismaComponentApplication.js","sourceRoot":"","sources":["../../../../src/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.ts"],"names":[],"mappings":""}
@@ -0,0 +1,142 @@
1
+ import { AutoBePrisma } from "@autobe/interface";
2
+ export interface IAutoBePrismaCorrectApplication {
3
+ /**
4
+ * Fixes validation errors in specific AutoBePrisma models while preserving
5
+ * ALL existing business logic and model descriptions.
6
+ *
7
+ * ## Core Rules
8
+ *
9
+ * 1. Fix ONLY validation errors in provided models - never remove business
10
+ * descriptions
11
+ * 2. Apply minimal changes to error models only - preserve original design
12
+ * intent
13
+ * 3. Return ONLY corrected models - unchanged models remain in original schema
14
+ * 4. Maintain referential integrity with unchanged models
15
+ *
16
+ * ## Targeted Scope
17
+ *
18
+ * - Process ONLY models with validation errors from IError[] array
19
+ * - Exclude models without errors from processing and output
20
+ * - Minimize context usage by returning corrected models only
21
+ * - Preserve unchanged models in their original state
22
+ *
23
+ * ## Fix Strategy
24
+ *
25
+ * - Resolve validation errors within specific models only
26
+ * - Fix field duplications, invalid references, and type mismatches
27
+ * - Update cross-model references without modifying target models
28
+ * - Ensure naming conventions and index rules compliance in corrected models
29
+ */
30
+ correctPrismaSchemaFiles(props: IAutoBePrismaCorrectApplication.IProps): void;
31
+ }
32
+ export declare namespace IAutoBePrismaCorrectApplication {
33
+ interface IProps {
34
+ /**
35
+ * Detailed execution plan for fixing `AutoBePrisma` validation errors in
36
+ * specific models.
37
+ *
38
+ * 🎯 Purpose: Enable systematic reasoning and step-by-step error resolution
39
+ * approach for targeted model validation issues
40
+ *
41
+ * 📋 Required Planning Content:
42
+ *
43
+ * 1. **Error Scope Analysis**
44
+ *
45
+ * - List all validation errors from IAutoBePrismaValidation.IError[] array
46
+ * - Extract unique table names from errors to identify affected models
47
+ * - Categorize errors by type (field duplications, references, types,
48
+ * indexes)
49
+ * - Identify which models need correction vs. which remain unchanged
50
+ * 2. **Targeted Fix Strategy**
51
+ *
52
+ * - Focus ONLY on models mentioned in validation errors
53
+ * - Outline minimal changes needed for each affected model
54
+ * - Plan cross-model reference updates (if any) without modifying non-error
55
+ * models
56
+ * - Ensure unchanged models maintain valid references to corrected models
57
+ * 3. **Model-Specific Fix Plan**
58
+ *
59
+ * - Model-by-model modification plan for ONLY affected models
60
+ * - Exact field additions, renames, or type corrections required
61
+ * - Reference updates within corrected models only
62
+ * - Index corrections limited to affected models
63
+ * 4. **Minimal Scope Validation**
64
+ *
65
+ * - Confirm which models will be included in output (error models only)
66
+ * - List models that will remain unchanged in original schema
67
+ * - Identify cross-model dependencies without including unchanged models
68
+ * - Preserve all business logic within corrected models
69
+ * 5. **Targeted Impact Assessment**
70
+ *
71
+ * - Potential effects of fixes on unchanged models (reference validation)
72
+ * - Verification points for corrected models only
73
+ * - Ensure no new validation errors in targeted models
74
+ * - Confirm minimal output scope compliance
75
+ *
76
+ * 💡 Example Planning Structure:
77
+ *
78
+ * ## Error Scope
79
+ * - Target Models: shopping_customers, shopping_orders (2 models only)
80
+ * - Unchanged Models: All others remain in original schema
81
+ *
82
+ * ## Targeted Fixes
83
+ * - shopping_customers: Remove duplicate 'email' field
84
+ * - shopping_orders: Update targetModel reference to 'shopping_customers'
85
+ *
86
+ * ## Output Scope
87
+ * - Return: Only shopping_customers and shopping_orders models
88
+ * - Preserve: All other models unchanged in original schema
89
+ *
90
+ * ## Cross-Model Impact
91
+ * - Verify: shopping_orders still references shopping_customers correctly
92
+ * - No changes needed in other models referencing these
93
+ */
94
+ planning: string;
95
+ /**
96
+ * ONLY the specific models that contain validation errors and need
97
+ * correction.
98
+ *
99
+ * 📥 Input Structure:
100
+ *
101
+ * - Contains ONLY models mentioned in IAutoBePrismaValidation.IError[] array
102
+ * - Each model has specific validation errors that need targeted correction
103
+ * - Models not mentioned in errors are excluded from this input
104
+ * - Represents minimal scope for error correction
105
+ *
106
+ * 🔍 Expected Validation Issues (Model-Specific):
107
+ *
108
+ * - Duplicate field/relation names within these specific models
109
+ * - Invalid foreign key references from these models to other models
110
+ * - Single foreign key fields in index arrays within these models
111
+ * - Invalid naming conventions within these specific models
112
+ * - Type validation errors in fields of these models
113
+ *
114
+ * 📝 Model Content Analysis (Targeted Scope):
115
+ *
116
+ * - Complete field definitions for each error model only
117
+ * - Relationships from these models (may reference unchanged models)
118
+ * - Indexes within these models that need correction
119
+ * - Business descriptions specific to these models
120
+ * - Cross-model references that need validation (read-only for targets)
121
+ *
122
+ * ⚠️ Processing Notes (Focused Approach):
123
+ *
124
+ * - Input contains ONLY models with validation errors
125
+ * - May reference other models not included in this input
126
+ * - Cross-model references must be validated but target models won't be
127
+ * modified
128
+ * - Output should return corrected versions of ONLY these input models
129
+ * - All business logic and descriptions within these models must be preserved
130
+ * - Corrections must not break references from unchanged models
131
+ *
132
+ * 🎯 Correction Scope:
133
+ *
134
+ * - Fix validation errors within these specific models
135
+ * - Update internal model structure (fields, relations, indexes)
136
+ * - Correct references to external models (without modifying targets)
137
+ * - Maintain compatibility with unchanged models in the full schema
138
+ * - Return corrected versions of ONLY these models
139
+ */
140
+ models: AutoBePrisma.IModel[];
141
+ }
142
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAutoBePrismaCorrectApplication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutoBePrismaCorrectApplication.js","sourceRoot":"","sources":["../../../../src/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.ts"],"names":[],"mappings":""}
@@ -0,0 +1,209 @@
1
+ import { AutoBePrisma } from "@autobe/interface";
2
+ export interface IAutoBePrismaSchemaApplication {
3
+ /**
4
+ * Generates comprehensive Prisma schema files based on detailed requirements
5
+ * analysis.
6
+ *
7
+ * Creates multiple organized schema files following enterprise patterns
8
+ * including proper domain separation, relationship modeling, snapshot
9
+ * patterns, inheritance, materialized views, and comprehensive documentation.
10
+ * The generated schemas implement best practices for scalability,
11
+ * maintainability, and data integrity.
12
+ *
13
+ * @param props Properties containing the file
14
+ */
15
+ makePrismaSchemaFile(props: IAutoBePrismaSchemaApplication.IProps): void;
16
+ }
17
+ export declare namespace IAutoBePrismaSchemaApplication {
18
+ interface IProps {
19
+ /**
20
+ * Step 1: Strategic database design analysis and planning.
21
+ *
22
+ * AI analyzes the target component and business requirements to formulate a
23
+ * comprehensive database design strategy. This planning phase is crucial
24
+ * for creating well-structured, normalized schemas that align with business
25
+ * objectives. The AI must define table structures, relationships, indexing
26
+ * strategies, and data integrity constraints before proceeding to schema
27
+ * implementation.
28
+ *
29
+ * **Key Considerations:**
30
+ *
31
+ * - **Assignment Validation**: Extract targetComponent.tables as the complete
32
+ * specification
33
+ * - **Table Count**: Must create exactly targetComponent.tables.length models
34
+ * - **Other Components**: Identify already-created tables for foreign key
35
+ * references only
36
+ * - **Normalization**: Strict adherence to 1NF, 2NF, 3NF principles
37
+ * - **Snapshot Architecture**: Design for historical data preservation and
38
+ * audit trails
39
+ * - **Junction Tables**: Plan M:N relationships with proper naming
40
+ * ({table1}_{table2})
41
+ * - **Materialized Views**: Identify needs for mv_ prefixed denormalized
42
+ * tables
43
+ *
44
+ * Workflow: Component analysis → Strategic planning → Design rationale
45
+ */
46
+ thinking: string;
47
+ /**
48
+ * Step 2: Initial Prisma schema code implementation.
49
+ *
50
+ * AI generates the first working version of the Prisma schema based on the
51
+ * strategic plan. This draft must be syntactically correct Prisma Schema
52
+ * Language (PSL) code that implements all planned tables, relationships,
53
+ * and constraints. The schema should follow Prisma conventions while
54
+ * incorporating enterprise patterns like snapshot tables and materialized
55
+ * views.
56
+ *
57
+ * **Implementation Requirements:**
58
+ *
59
+ * - **Exact Table Names**: Use EXACT names from targetComponent.tables (NO
60
+ * CHANGES)
61
+ * - **Valid PSL Syntax**: Proper model blocks, field definitions, and
62
+ * directives
63
+ * - **Primary Keys**: Always UUID type with `@id` directive
64
+ * - **Foreign Keys**: UUID type following {target_model}_id naming pattern
65
+ * - **Data Types**: uuid, string, int, double, datetime, boolean, uri (no
66
+ * pre-calculated fields)
67
+ * - **Relationships**: Proper `@relation` directives for 1:1, 1:N, M:N
68
+ * patterns
69
+ * - **Descriptions**: Follow format with requirements mapping and business
70
+ * purpose
71
+ * - **NO Prohibited Fields**: No totals, cached values, aggregates in regular
72
+ * tables
73
+ *
74
+ * Workflow: Strategic plan → PSL implementation → Functional schema code
75
+ */
76
+ draft: string;
77
+ /**
78
+ * Step 3: Schema code review and quality assessment.
79
+ *
80
+ * AI performs a thorough review of the draft schema implementation,
81
+ * examining multiple quality dimensions to ensure production readiness.
82
+ * This review process identifies issues, suggests improvements, and
83
+ * validates compliance with best practices.
84
+ *
85
+ * **Review Dimensions:**
86
+ *
87
+ * **Syntax & Compilation:**
88
+ *
89
+ * - Prisma schema syntax errors and invalid directives
90
+ * - Model naming matches targetComponent.tables EXACTLY
91
+ * - Field type appropriateness (uuid for keys, no calculated fields)
92
+ * - Relationship definition correctness (`@relation` syntax)
93
+ *
94
+ * **Database Design Quality:**
95
+ *
96
+ * - **Normalization Compliance**:
97
+ *
98
+ * - 1NF: Atomic values, no repeating groups
99
+ * - 2NF: No partial dependencies on composite keys
100
+ * - 3NF: No transitive dependencies
101
+ * - **Prohibited Fields Check**: No pre-calculated totals, cached values, or
102
+ * aggregates in regular tables
103
+ * - **Snapshot Pattern**: Proper implementation for audit trails
104
+ * - **Junction Tables**: Correct naming ({table1}_{table2}) and structure
105
+ *
106
+ * **Index Strategy Validation:**
107
+ *
108
+ * - NO single foreign key indexes (Prisma auto-creates these)
109
+ * - Composite indexes for query patterns
110
+ * - Unique indexes for business constraints
111
+ * - GIN indexes for full-text search fields
112
+ *
113
+ * **Description Quality:**
114
+ *
115
+ * - Models include: requirement mapping, business purpose, relationships,
116
+ * behaviors
117
+ * - Fields include: requirement aspect, business meaning, normalization
118
+ * rationale
119
+ *
120
+ * Workflow: Draft schema → Systematic analysis → Specific improvements
121
+ */
122
+ review: string;
123
+ /**
124
+ * Step 4: Final production-ready Prisma schema code.
125
+ *
126
+ * AI produces the final, polished version of the Prisma schema
127
+ * incorporating all review feedback. This code represents the completed
128
+ * schema implementation, ready for database migration and production
129
+ * deployment. All identified issues must be resolved, and the schema must
130
+ * meet enterprise-grade quality standards.
131
+ *
132
+ * **Final Schema Characteristics:**
133
+ *
134
+ * - **Complete Coverage**: All targetComponent.tables implemented with exact
135
+ * names
136
+ * - **Zero Errors**: Valid PSL syntax, no compilation warnings
137
+ * - **Proper Relationships**: All foreign keys reference existing tables
138
+ * correctly
139
+ * - **Optimized Indexes**: Strategic indexes without redundant foreign key
140
+ * indexes
141
+ * - **Full Normalization**: Strict 3NF compliance, denormalization only in
142
+ * mv_ tables
143
+ * - **Enterprise Documentation**: Complete descriptions with business context
144
+ * - **Audit Support**: Proper snapshot patterns and temporal fields
145
+ * (created_at, updated_at, deleted_at)
146
+ * - **Type Safety**: Consistent use of UUID for all keys, appropriate field
147
+ * types
148
+ *
149
+ * Workflow: Review feedback → Schema refinement → Production-ready PSL code
150
+ */
151
+ final: string;
152
+ /**
153
+ * Step 5: Structured AST representation of the Prisma schema models.
154
+ *
155
+ * AI transforms the final Prisma schema code into a structured Abstract
156
+ * Syntax Tree (AST) representation using the AutoBePrisma.IModel interface.
157
+ * This involves critical reinterpretation and reclassification of the final
158
+ * code to conform to AST constraints.
159
+ *
160
+ * **CRITICAL: Reinterpretation & Post-Processing Required**
161
+ *
162
+ * The AI-generated final code may not directly map to valid AST structures
163
+ * due to:
164
+ *
165
+ * - Complex Prisma directives that need decomposition
166
+ * - Field attributes that require reclassification
167
+ * - Implicit relationships that need explicit AST representation
168
+ * - Schema-level constructs that must be distributed to models
169
+ *
170
+ * **Required Post-Processing Steps:**
171
+ *
172
+ * 1. **Field Reclassification**: Separate fields into primary, foreign, and
173
+ * plain categories
174
+ * 2. **Relationship Extraction**: Convert `@relation` directives to IRelation
175
+ * structures
176
+ * 3. **Index Decomposition**: Parse `@@index`, `@@unique` into appropriate
177
+ * index arrays
178
+ * 4. **Type Normalization**: Map Prisma types to AST type enum values
179
+ * 5. **Constraint Resolution**: Convert schema constraints to AST properties
180
+ *
181
+ * **AST Structure Requirements:**
182
+ *
183
+ * - **Model Array**: Each table from targetComponent.tables as IModel
184
+ * - **Primary Field**: Always UUID type with name "id"
185
+ * - **Foreign Fields**: Proper IRelation configurations for all relationships
186
+ * - **Plain Fields**: Business fields with correct types (no calculated
187
+ * fields)
188
+ * - **Indexes**:
189
+ *
190
+ * - UniqueIndexes: Business constraints and composite unique keys
191
+ * - PlainIndexes: Query optimization (no single foreign key indexes)
192
+ * - GinIndexes: Full-text search on string fields
193
+ * - **Material Flag**: true only for mv_ prefixed tables
194
+ *
195
+ * **Relationship Patterns in AST:**
196
+ *
197
+ * - 1:1: Foreign field with unique: true
198
+ * - 1:N: Foreign field with unique: false
199
+ * - M:N: Separate junction table model with composite indexes
200
+ *
201
+ * Workflow: Final PSL code → Reinterpretation → AST transformation →
202
+ * Structured models
203
+ *
204
+ * This structured representation serves as the ultimate deliverable for
205
+ * programmatic schema generation and manipulation.
206
+ */
207
+ models: AutoBePrisma.IModel[];
208
+ }
209
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAutoBePrismaSchemaApplication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutoBePrismaSchemaApplication.js","sourceRoot":"","sources":["../../../../src/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.ts"],"names":[],"mappings":""}
@@ -10,17 +10,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.orchestrateRealize = void 0;
13
- const uuid_1 = require("uuid");
14
13
  const getAutoBeGenerated_1 = require("../../factory/getAutoBeGenerated");
14
+ const getAutoBeRealizeGenerated_1 = require("../../factory/getAutoBeRealizeGenerated");
15
15
  const orchestrateRealizeAuthorization_1 = require("./orchestrateRealizeAuthorization");
16
16
  const writeCodeUntilCompilePassed_1 = require("./writeCodeUntilCompilePassed");
17
17
  const orchestrateRealize = (ctx) => (props) => __awaiter(void 0, void 0, void 0, function* () {
18
- var _a, _b, _c, _d, _e, _f, _g;
18
+ var _a, _b, _c, _d, _e;
19
19
  const operations = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.document.operations;
20
20
  if (!operations) {
21
21
  throw new Error("Can't do realize agent because operations are nothing.");
22
22
  }
23
- const start = new Date();
24
23
  ctx.dispatch({
25
24
  type: "realizeStart",
26
25
  created_at: new Date().toISOString(),
@@ -42,33 +41,23 @@ const orchestrateRealize = (ctx) => (props) => __awaiter(void 0, void 0, void 0,
42
41
  functions,
43
42
  authorizations,
44
43
  });
45
- const history = {
46
- type: "realize",
47
- compiled: result.compiled,
48
- authorizations,
49
- functions,
50
- controllers,
51
- completed_at: new Date().toISOString(),
52
- created_at: start.toISOString(),
53
- id: (0, uuid_1.v4)(),
54
- reason: props.reason,
55
- step: (_e = (_d = ctx.state().analyze) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
56
- };
57
44
  // report
58
- ctx.dispatch({
45
+ return ctx.dispatch({
59
46
  type: "realizeComplete",
60
47
  created_at: new Date().toISOString(),
61
- functions: history.functions,
62
- authorizations: history.authorizations,
63
- controllers: history.controllers,
48
+ functions,
49
+ authorizations,
50
+ controllers,
64
51
  compiled: yield compiler.typescript.compile({
65
- files: yield (0, getAutoBeGenerated_1.getAutoBeGenerated)(compiler, Object.assign(Object.assign({}, ctx.state()), { realize: history }), [...ctx.histories(), history], ctx.usage()),
52
+ files: Object.assign(Object.assign({}, (yield (0, getAutoBeGenerated_1.getAutoBeGenerated)(compiler, ctx.state(), ctx.histories(), ctx.usage()))), (yield (0, getAutoBeRealizeGenerated_1.getAutoBeRealizeGenerated)({
53
+ document: ctx.state().interface.document,
54
+ authorizations,
55
+ functions,
56
+ compiler,
57
+ }))),
66
58
  }),
67
- step: (_g = (_f = ctx.state().analyze) === null || _f === void 0 ? void 0 : _f.step) !== null && _g !== void 0 ? _g : 0,
59
+ step: (_e = (_d = ctx.state().analyze) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
68
60
  });
69
- ctx.state().realize = history;
70
- ctx.histories().push(history);
71
- return history;
72
61
  });
73
62
  exports.orchestrateRealize = orchestrateRealize;
74
63
  //# sourceMappingURL=orchestrateRealize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrateRealize.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealize.ts"],"names":[],"mappings":";;;;;;;;;;;;AASA,+BAA0B;AAI1B,yEAAsE;AACtE,uFAAoF;AACpF,+EAA4E;AAErE,MAAM,kBAAkB,GAC7B,CAAiC,GAAyB,EAAE,EAAE,CAC9D,CACE,KAA8B,EACiC,EAAE;;IACjE,MAAM,UAAU,GACd,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,SAAS,0CAAE,QAAQ,CAAC,UAAU,CAAC;IAC7C,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;IAC/B,GAAG,CAAC,QAAQ,CAAC;QACX,IAAI,EAAE,cAAc;QACpB,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACpC,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,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C;AA/DS,QAAA,kBAAkB,sBA+D3B"}
@@ -121,7 +121,7 @@ function process(ctx, role, templateFiles) {
121
121
  yield agentica
122
122
  .conversate("Create Authorization Provider and Decorator.")
123
123
  .finally(() => {
124
- const tokenUsage = agentica.getTokenUsage();
124
+ const tokenUsage = agentica.getTokenUsage().aggregate;
125
125
  ctx.usage().record(tokenUsage, ["realize"]);
126
126
  });
127
127
  if (pointer.value === null)
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrateRealizeAuthorization.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeAuthorization.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,0EAyCC;;AA9DD,yCAAoE;AAIpE,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,qGAAkG;AAElG,mFAAyF;AACzF,6EAA0E;AAC1E,mEAAgE;AAEhE;;;;;GAKG;AACH,SAAsB,+BAA+B,CAEnD,GAAyB;;;QACzB,MAAM,KAAK,GAAG,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC;QAExE,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAEzE,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,0CAAE,IAAI,mCAAI,CAAC;YACjC,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrC,CAAC,CAAC;QAEH,MAAM,cAAc,GAAiC,MAAM,OAAO,CAAC,GAAG,CACpE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
1
+ {"version":3,"file":"orchestrateRealizeAuthorization.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeAuthorization.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,0EAyCC;;AA9DD,yCAAoE;AAIpE,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,qGAAkG;AAElG,mFAAyF;AACzF,6EAA0E;AAC1E,mEAAgE;AAEhE;;;;;GAKG;AACH,SAAsB,+BAA+B,CAEnD,GAAyB;;;QACzB,MAAM,KAAK,GAAG,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC;QAExE,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAEzE,GAAG,C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KAAK,CAAC,KAAK,CACyB,CAAC;IAEvC,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,kBAAkB;QACxB,WAAW;QACX,OAAO,EAAE;YACP,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE;gBACxB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;SAC+C;KACnD,CAAC;AACJ,CAAC;AAED,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
@@ -101,7 +101,7 @@ function orchestrateRealizeAuthorizationCorrect(ctx_1, authorization_1, prismaCl
101
101
  yield agentica
102
102
  .conversate("Please correct the decorator and the provider.")
103
103
  .finally(() => {
104
- const tokenUsage = agentica.getTokenUsage();
104
+ const tokenUsage = agentica.getTokenUsage().aggregate;
105
105
  ctx.usage().record(tokenUsage, ["realize"]);
106
106
  });
107
107
  if (pointer.value === null)