@autobe/agent 0.10.0 → 0.10.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.
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +1 -0
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/factory/createAutoBeApplication.js +0 -10
- package/lib/factory/createAutoBeApplication.js.map +1 -1
- package/lib/index.mjs +490 -792
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +0 -4
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +0 -2
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +0 -2
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +0 -8
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +0 -6
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +0 -68
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +0 -6
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +0 -50
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js +0 -58
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.d.ts +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +25 -56
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +4 -15
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +6 -0
- package/lib/orchestrate/test/orchestrateTestCorrect.js +0 -8
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +0 -16
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +0 -15
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/transformTestWriteHistories.js +0 -7
- package/lib/orchestrate/test/transformTestWriteHistories.js.map +1 -1
- package/package.json +8 -12
- package/src/constants/AutoBeSystemPromptConstant.ts +1 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +48 -88
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +5 -13
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +10 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.d.ts +0 -52
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.js +0 -57
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.js.map +0 -1
- package/lib/orchestrate/realize/orchestrateRealizeValidator.d.ts +0 -46
- package/lib/orchestrate/realize/orchestrateRealizeValidator.js +0 -37
- package/lib/orchestrate/realize/orchestrateRealizeValidator.js.map +0 -1
- package/src/orchestrate/realize/orchestrateRealizeIntegrator.ts +0 -75
- package/src/orchestrate/realize/orchestrateRealizeValidator.ts +0 -64
|
@@ -148,7 +148,6 @@ const claude = {
|
|
|
148
148
|
type: "object",
|
|
149
149
|
properties: {
|
|
150
150
|
file: {
|
|
151
|
-
title: "Complete definition of a single Prisma schema file",
|
|
152
151
|
description: "Complete definition of a single Prisma schema file.\n\nRepresents one business domain containing related models, organized for\nmodular schema management and following domain-driven design principles.",
|
|
153
152
|
$ref: "#/$defs/AutoBePrisma.IFile"
|
|
154
153
|
}
|
|
@@ -163,18 +162,15 @@ const claude = {
|
|
|
163
162
|
type: "object",
|
|
164
163
|
properties: {
|
|
165
164
|
filename: {
|
|
166
|
-
title: "Name of the schema file to be generated",
|
|
167
165
|
description: "Name of the schema file to be generated.\n\nShould follow the naming convention: \"schema-{number}-{domain}.prisma\"\nExamples: \"schema-02-systematic.prisma\", \"schema-03-actors.prisma\" The\nnumber indicates the dependency order for schema generation.",
|
|
168
166
|
type: "string",
|
|
169
167
|
pattern: "^[a-zA-Z0-9._-]+\\.prisma$"
|
|
170
168
|
},
|
|
171
169
|
namespace: {
|
|
172
|
-
title: "Business domain namespace that groups related models",
|
|
173
170
|
description: "Business domain namespace that groups related models.\n\nUsed in Prisma documentation comments as \"@\\namespace directive\".\nExamples from uploaded schemas: \"Systematic\", \"Actors\", \"Sales\", \"Carts\",\n\"Orders\", \"Coupons\", \"Coins\", \"Inquiries\", \"Favorites\", \"Articles\"",
|
|
174
171
|
type: "string"
|
|
175
172
|
},
|
|
176
173
|
models: {
|
|
177
|
-
title: "Array of Prisma models (database tables) within this domain",
|
|
178
174
|
description: "Array of Prisma models (database tables) within this domain.\n\nEach model represents a business entity or concept within the namespace.\nModels can reference each other through foreign key relationships.",
|
|
179
175
|
type: "array",
|
|
180
176
|
items: {
|
|
@@ -193,7 +189,6 @@ const claude = {
|
|
|
193
189
|
type: "object",
|
|
194
190
|
properties: {
|
|
195
191
|
name: {
|
|
196
|
-
title: "Name of the Prisma model (database table name)",
|
|
197
192
|
description: "Name of the Prisma model (database table name).\n\nShould follow snake_case convention with domain prefix. Examples:\n\"shopping_customers\", \"shopping_sale_snapshots\", \"bbs_articles\"\nMaterialized views use \"mv_\" prefix: \"mv_shopping_sale_last_snapshots\"",
|
|
198
193
|
type: "string",
|
|
199
194
|
pattern: "^[a-z][a-z0-9_]*$"
|
|
@@ -207,12 +202,10 @@ const claude = {
|
|
|
207
202
|
type: "boolean"
|
|
208
203
|
},
|
|
209
204
|
primaryField: {
|
|
210
|
-
title: "The primary key field of the model",
|
|
211
205
|
description: "The primary key field of the model.\n\nIn all uploaded schemas, primary keys are always UUID type with \"@\\id\"\ndirective. Usually named \"id\" and marked with \"@\\db.Uuid\" for PostgreSQL\nmapping.",
|
|
212
206
|
$ref: "#/$defs/AutoBePrisma.IPrimaryField"
|
|
213
207
|
},
|
|
214
208
|
foreignFields: {
|
|
215
|
-
title: "Array of foreign key fields that reference other models",
|
|
216
209
|
description: "Array of foreign key fields that reference other models.\n\nThese establish relationships between models and include Prisma relation\ndirectives. Can be nullable (optional relationships) or required\n(mandatory relationships). May have unique constraints for 1:1\nrelationships.",
|
|
217
210
|
type: "array",
|
|
218
211
|
items: {
|
|
@@ -220,7 +213,6 @@ const claude = {
|
|
|
220
213
|
}
|
|
221
214
|
},
|
|
222
215
|
plainFields: {
|
|
223
|
-
title: "Array of regular data fields that don't reference other models",
|
|
224
216
|
description: "Array of regular data fields that don't reference other models.\n\nInclude business data like names, descriptions, timestamps, flags,\namounts, etc. Common patterns: created_at, updated_at, deleted_at for\nsoft deletion and auditing.",
|
|
225
217
|
type: "array",
|
|
226
218
|
items: {
|
|
@@ -228,7 +220,6 @@ const claude = {
|
|
|
228
220
|
}
|
|
229
221
|
},
|
|
230
222
|
uniqueIndexes: {
|
|
231
|
-
title: "Array of unique indexes for enforcing data integrity constraints",
|
|
232
223
|
description: "Array of unique indexes for enforcing data integrity constraints.\n\nEnsure uniqueness across single or multiple columns. Examples: unique\nemail addresses, unique codes within a channel, unique combinations like\n(channel_id, nickname).",
|
|
233
224
|
type: "array",
|
|
234
225
|
items: {
|
|
@@ -236,7 +227,6 @@ const claude = {
|
|
|
236
227
|
}
|
|
237
228
|
},
|
|
238
229
|
plainIndexes: {
|
|
239
|
-
title: "Array of regular indexes for query performance optimization",
|
|
240
230
|
description: "Array of regular indexes for query performance optimization.\n\nSpeed up common query patterns like filtering by foreign keys, date\nranges, or frequently searched fields. Examples: indexes on created_at,\nforeign key fields, search fields.",
|
|
241
231
|
type: "array",
|
|
242
232
|
items: {
|
|
@@ -244,7 +234,6 @@ const claude = {
|
|
|
244
234
|
}
|
|
245
235
|
},
|
|
246
236
|
ginIndexes: {
|
|
247
|
-
title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
|
|
248
237
|
description: "Array of GIN (Generalized Inverted Index) indexes for full-text search.\n\nUsed specifically for PostgreSQL text search capabilities using trigram\noperations. Applied to text fields that need fuzzy matching or partial\ntext search. Examples: searching names, nicknames, titles, content\nbodies.",
|
|
249
238
|
type: "array",
|
|
250
239
|
items: {
|
|
@@ -269,18 +258,15 @@ const claude = {
|
|
|
269
258
|
type: "object",
|
|
270
259
|
properties: {
|
|
271
260
|
name: {
|
|
272
|
-
title: "Name of the primary key field",
|
|
273
261
|
description: "Name of the primary key field.\n\nConsistently named \"id\" across all models in the uploaded schemas.\nRepresents the unique identifier for each record in the table.",
|
|
274
262
|
type: "string",
|
|
275
263
|
pattern: "^[a-z][a-z0-9_]*$"
|
|
276
264
|
},
|
|
277
265
|
type: {
|
|
278
|
-
title: "Data type of the primary key field",
|
|
279
266
|
description: "Data type of the primary key field.\n\nAlways \"uuid\" in the uploaded schemas for better distributed system\nsupport and to avoid exposing sequential IDs that could reveal business\ninformation.",
|
|
280
267
|
"const": "uuid"
|
|
281
268
|
},
|
|
282
269
|
description: {
|
|
283
|
-
title: "Description of the primary key field's purpose",
|
|
284
270
|
description: "Description of the primary key field's purpose.\n\nStandard description is \"Primary Key.\" across all models. Serves as the\nunique identifier for the model instance.",
|
|
285
271
|
type: "string"
|
|
286
272
|
}
|
|
@@ -296,13 +282,11 @@ const claude = {
|
|
|
296
282
|
type: "object",
|
|
297
283
|
properties: {
|
|
298
284
|
name: {
|
|
299
|
-
title: "Name of the foreign key field",
|
|
300
285
|
description: "Name of the foreign key field.\n\nFollows convention: \"{target_model_name_without_prefix}_id\" Examples:\n\"shopping_customer_id\", \"bbs_article_id\", \"attachment_file_id\" For\nself-references: \"parent_id\" (e.g., in hierarchical structures)",
|
|
301
286
|
type: "string",
|
|
302
287
|
pattern: "^[a-z][a-z0-9_]*$"
|
|
303
288
|
},
|
|
304
289
|
type: {
|
|
305
|
-
title: "Data type of the foreign key field",
|
|
306
290
|
description: "Data type of the foreign key field.\n\nAlways \"uuid\" to match the primary key type of referenced models. Ensures\nreferential integrity and consistency across the schema.",
|
|
307
291
|
"const": "uuid"
|
|
308
292
|
},
|
|
@@ -311,18 +295,15 @@ const claude = {
|
|
|
311
295
|
type: "string"
|
|
312
296
|
},
|
|
313
297
|
relation: {
|
|
314
|
-
title: "Prisma relation configuration defining the association details",
|
|
315
298
|
description: "Prisma relation configuration defining the association details.\n\nSpecifies how this foreign key connects to the target model, including\nrelation name, target model, and target field.",
|
|
316
299
|
type: "object",
|
|
317
300
|
properties: {
|
|
318
301
|
name: {
|
|
319
|
-
title: "Name of the relation property in the Prisma model",
|
|
320
302
|
description: "Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: \"customer\", \"channel\", \"parent\",\n\"snapshot\"",
|
|
321
303
|
type: "string",
|
|
322
304
|
pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$"
|
|
323
305
|
},
|
|
324
306
|
targetModel: {
|
|
325
|
-
title: "Name of the target model being referenced",
|
|
326
307
|
description: "Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n\"shopping_customers\", \"shopping_channels\", \"bbs_articles\"",
|
|
327
308
|
type: "string"
|
|
328
309
|
}
|
|
@@ -333,12 +314,10 @@ const claude = {
|
|
|
333
314
|
]
|
|
334
315
|
},
|
|
335
316
|
unique: {
|
|
336
|
-
title: "Whether this foreign key has a unique constraint",
|
|
337
317
|
description: "Whether this foreign key has a unique constraint.\n\nTrue: Creates a 1:1 relationship (e.g., user profile, order publish\ndetails) false: Allows 1:N relationship (e.g., customer to multiple\norders) Used for enforcing business rules about relationship\ncardinality.",
|
|
338
318
|
type: "boolean"
|
|
339
319
|
},
|
|
340
320
|
nullable: {
|
|
341
|
-
title: "Whether this foreign key can be null (optional relationship)",
|
|
342
321
|
description: "Whether this foreign key can be null (optional relationship).\n\nTrue: Relationship is optional, foreign key can be null false:\nRelationship is required, foreign key cannot be null Reflects business\nrules about mandatory vs optional associations.",
|
|
343
322
|
type: "boolean"
|
|
344
323
|
}
|
|
@@ -357,13 +336,11 @@ const claude = {
|
|
|
357
336
|
type: "object",
|
|
358
337
|
properties: {
|
|
359
338
|
name: {
|
|
360
|
-
title: "Name of the field in the database table",
|
|
361
339
|
description: "Name of the field in the database table.\n\nShould use snake_case convention. Common patterns from uploaded schemas:\n\n- Timestamps: created_at, updated_at, deleted_at, opened_at, closed_at\n- Identifiers: code, name, nickname, title\n- Business data: value, quantity, price, volume, balance\n- Flags: primary, required, exclusive, secret, multiplicative",
|
|
362
340
|
type: "string",
|
|
363
341
|
pattern: "^[a-z][a-z0-9_]*$"
|
|
364
342
|
},
|
|
365
343
|
type: {
|
|
366
|
-
title: "Data type of the field for Prisma schema generation",
|
|
367
344
|
description: "Data type of the field for Prisma schema generation.\n\nMaps to appropriate Prisma/PostgreSQL types:\n\n- Boolean: Boolean flags and yes/no values\n- Int: Integer numbers, quantities, sequences\n- Double: Decimal numbers, prices, monetary values, percentages\n- String: Text data, names, descriptions, codes\n- Uri: URL/URI fields for links and references\n- Uuid: UUID fields (for non-foreign-key UUIDs)\n- Date: Date-only values (rare, mostly for business dates)\n- Datetime: Timestamp fields with date and time",
|
|
368
345
|
oneOf: [
|
|
369
346
|
{
|
|
@@ -390,12 +367,10 @@ const claude = {
|
|
|
390
367
|
]
|
|
391
368
|
},
|
|
392
369
|
description: {
|
|
393
|
-
title: "Description explaining the business purpose and usage of this field",
|
|
394
370
|
description: "Description explaining the business purpose and usage of this field.\n\nShould clearly explain:\n\n- What business concept this field represents\n- Valid values or constraints if applicable\n- How it relates to business processes\n- Any special behavioral notes Example: \"Amount of cash payment.\" or\n \"Whether the unit is required or not.\"",
|
|
395
371
|
type: "string"
|
|
396
372
|
},
|
|
397
373
|
nullable: {
|
|
398
|
-
title: "Whether this field can contain null values",
|
|
399
374
|
description: "Whether this field can contain null values.\n\nTrue: Field is optional and can be null (e.g., middle name, description)\nfalse: Field is required and cannot be null (e.g., creation timestamp,\nname) Reflects business rules about mandatory vs optional data.",
|
|
400
375
|
type: "boolean"
|
|
401
376
|
}
|
|
@@ -412,7 +387,6 @@ const claude = {
|
|
|
412
387
|
type: "object",
|
|
413
388
|
properties: {
|
|
414
389
|
fieldNames: {
|
|
415
|
-
title: "Array of field names that together form the unique constraint",
|
|
416
390
|
description: "Array of field names that together form the unique constraint.\n\nCan be single field (e.g., [\"email\"]) or composite (e.g., [\"channel_id\",\n\"code\"]). All field names must exist in the model. Order matters for\ncomposite indexes. Examples: [\"code\"], [\"shopping_channel_id\",\n\"nickname\"], [\"email\"]",
|
|
417
391
|
type: "array",
|
|
418
392
|
items: {
|
|
@@ -422,7 +396,6 @@ const claude = {
|
|
|
422
396
|
uniqueItems: true
|
|
423
397
|
},
|
|
424
398
|
unique: {
|
|
425
|
-
title: "Explicit marker indicating this is a unique index",
|
|
426
399
|
description: "Explicit marker indicating this is a unique index.\n\nAlways true to distinguish from regular indexes. Used by code generator\nto emit \"@@unique\" directive in Prisma schema instead of \"@@index\".",
|
|
427
400
|
"const": true
|
|
428
401
|
}
|
|
@@ -437,7 +410,6 @@ const claude = {
|
|
|
437
410
|
type: "object",
|
|
438
411
|
properties: {
|
|
439
412
|
fieldNames: {
|
|
440
|
-
title: "Array of field names to include in the performance index",
|
|
441
413
|
description: "Array of field names to include in the performance index.\n\nCan be single field (e.g., [\"created_at\"]) or composite (e.g.,\n[\"customer_id\", \"created_at\"]). All field names must exist in the model.\nOrder matters for composite indexes and should match common query\npatterns. Examples: [\"created_at\"], [\"shopping_customer_id\",\n\"created_at\"], [\"ip\"]",
|
|
442
414
|
type: "array",
|
|
443
415
|
items: {
|
|
@@ -456,7 +428,6 @@ const claude = {
|
|
|
456
428
|
type: "object",
|
|
457
429
|
properties: {
|
|
458
430
|
fieldName: {
|
|
459
|
-
title: "Name of the text field to index for full-text search capabilities",
|
|
460
431
|
description: "Name of the text field to index for full-text search capabilities.\n\nMust be a string field in the model that contains searchable text.\nExamples from uploaded schemas: \"nickname\", \"title\", \"body\", \"name\" Used\nwith PostgreSQL gin_trgm_ops for trigram-based fuzzy text search.",
|
|
461
432
|
type: "string"
|
|
462
433
|
}
|
|
@@ -783,7 +754,6 @@ const collection = {
|
|
|
783
754
|
type: "object",
|
|
784
755
|
properties: {
|
|
785
756
|
file: {
|
|
786
|
-
title: "Complete definition of a single Prisma schema file",
|
|
787
757
|
$ref: "#/$defs/AutoBePrisma.IFile"
|
|
788
758
|
}
|
|
789
759
|
},
|
|
@@ -797,17 +767,14 @@ const collection = {
|
|
|
797
767
|
type: "object",
|
|
798
768
|
properties: {
|
|
799
769
|
filename: {
|
|
800
|
-
title: "Name of the schema file to be generated",
|
|
801
770
|
description: "Name of the schema file to be generated.\n\nShould follow the naming convention: \"schema-{number}-{domain}.prisma\"\nExamples: \"schema-02-systematic.prisma\", \"schema-03-actors.prisma\" The\nnumber indicates the dependency order for schema generation.\n\n\n@pattern ^[a-zA-Z0-9._-]+\\.prisma$",
|
|
802
771
|
type: "string"
|
|
803
772
|
},
|
|
804
773
|
namespace: {
|
|
805
|
-
title: "Business domain namespace that groups related models",
|
|
806
774
|
description: "Business domain namespace that groups related models.\n\nUsed in Prisma documentation comments as \"@\\namespace directive\".\nExamples from uploaded schemas: \"Systematic\", \"Actors\", \"Sales\", \"Carts\",\n\"Orders\", \"Coupons\", \"Coins\", \"Inquiries\", \"Favorites\", \"Articles\"",
|
|
807
775
|
type: "string"
|
|
808
776
|
},
|
|
809
777
|
models: {
|
|
810
|
-
title: "Array of Prisma models (database tables) within this domain",
|
|
811
778
|
description: "Array of Prisma models (database tables) within this domain.\n\nEach model represents a business entity or concept within the namespace.\nModels can reference each other through foreign key relationships.",
|
|
812
779
|
type: "array",
|
|
813
780
|
items: {
|
|
@@ -826,7 +793,6 @@ const collection = {
|
|
|
826
793
|
type: "object",
|
|
827
794
|
properties: {
|
|
828
795
|
name: {
|
|
829
|
-
title: "Name of the Prisma model (database table name)",
|
|
830
796
|
description: "Name of the Prisma model (database table name).\n\nShould follow snake_case convention with domain prefix. Examples:\n\"shopping_customers\", \"shopping_sale_snapshots\", \"bbs_articles\"\nMaterialized views use \"mv_\" prefix: \"mv_shopping_sale_last_snapshots\"\n\n\n@pattern ^[a-z][a-z0-9_]*$",
|
|
831
797
|
type: "string"
|
|
832
798
|
},
|
|
@@ -839,11 +805,9 @@ const collection = {
|
|
|
839
805
|
type: "boolean"
|
|
840
806
|
},
|
|
841
807
|
primaryField: {
|
|
842
|
-
title: "The primary key field of the model",
|
|
843
808
|
$ref: "#/$defs/AutoBePrisma.IPrimaryField"
|
|
844
809
|
},
|
|
845
810
|
foreignFields: {
|
|
846
|
-
title: "Array of foreign key fields that reference other models",
|
|
847
811
|
description: "Array of foreign key fields that reference other models.\n\nThese establish relationships between models and include Prisma relation\ndirectives. Can be nullable (optional relationships) or required\n(mandatory relationships). May have unique constraints for 1:1\nrelationships.",
|
|
848
812
|
type: "array",
|
|
849
813
|
items: {
|
|
@@ -851,7 +815,6 @@ const collection = {
|
|
|
851
815
|
}
|
|
852
816
|
},
|
|
853
817
|
plainFields: {
|
|
854
|
-
title: "Array of regular data fields that don't reference other models",
|
|
855
818
|
description: "Array of regular data fields that don't reference other models.\n\nInclude business data like names, descriptions, timestamps, flags,\namounts, etc. Common patterns: created_at, updated_at, deleted_at for\nsoft deletion and auditing.",
|
|
856
819
|
type: "array",
|
|
857
820
|
items: {
|
|
@@ -859,7 +822,6 @@ const collection = {
|
|
|
859
822
|
}
|
|
860
823
|
},
|
|
861
824
|
uniqueIndexes: {
|
|
862
|
-
title: "Array of unique indexes for enforcing data integrity constraints",
|
|
863
825
|
description: "Array of unique indexes for enforcing data integrity constraints.\n\nEnsure uniqueness across single or multiple columns. Examples: unique\nemail addresses, unique codes within a channel, unique combinations like\n(channel_id, nickname).",
|
|
864
826
|
type: "array",
|
|
865
827
|
items: {
|
|
@@ -867,7 +829,6 @@ const collection = {
|
|
|
867
829
|
}
|
|
868
830
|
},
|
|
869
831
|
plainIndexes: {
|
|
870
|
-
title: "Array of regular indexes for query performance optimization",
|
|
871
832
|
description: "Array of regular indexes for query performance optimization.\n\nSpeed up common query patterns like filtering by foreign keys, date\nranges, or frequently searched fields. Examples: indexes on created_at,\nforeign key fields, search fields.",
|
|
872
833
|
type: "array",
|
|
873
834
|
items: {
|
|
@@ -875,7 +836,6 @@ const collection = {
|
|
|
875
836
|
}
|
|
876
837
|
},
|
|
877
838
|
ginIndexes: {
|
|
878
|
-
title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
|
|
879
839
|
description: "Array of GIN (Generalized Inverted Index) indexes for full-text search.\n\nUsed specifically for PostgreSQL text search capabilities using trigram\noperations. Applied to text fields that need fuzzy matching or partial\ntext search. Examples: searching names, nicknames, titles, content\nbodies.",
|
|
880
840
|
type: "array",
|
|
881
841
|
items: {
|
|
@@ -900,12 +860,10 @@ const collection = {
|
|
|
900
860
|
type: "object",
|
|
901
861
|
properties: {
|
|
902
862
|
name: {
|
|
903
|
-
title: "Name of the primary key field",
|
|
904
863
|
description: "Name of the primary key field.\n\nConsistently named \"id\" across all models in the uploaded schemas.\nRepresents the unique identifier for each record in the table.\n\n\n@pattern ^[a-z][a-z0-9_]*$",
|
|
905
864
|
type: "string"
|
|
906
865
|
},
|
|
907
866
|
type: {
|
|
908
|
-
title: "Data type of the primary key field",
|
|
909
867
|
description: "Data type of the primary key field.\n\nAlways \"uuid\" in the uploaded schemas for better distributed system\nsupport and to avoid exposing sequential IDs that could reveal business\ninformation.",
|
|
910
868
|
type: "string",
|
|
911
869
|
"enum": [
|
|
@@ -913,7 +871,6 @@ const collection = {
|
|
|
913
871
|
]
|
|
914
872
|
},
|
|
915
873
|
description: {
|
|
916
|
-
title: "Description of the primary key field's purpose",
|
|
917
874
|
description: "Description of the primary key field's purpose.\n\nStandard description is \"Primary Key.\" across all models. Serves as the\nunique identifier for the model instance.",
|
|
918
875
|
type: "string"
|
|
919
876
|
}
|
|
@@ -929,12 +886,10 @@ const collection = {
|
|
|
929
886
|
type: "object",
|
|
930
887
|
properties: {
|
|
931
888
|
name: {
|
|
932
|
-
title: "Name of the foreign key field",
|
|
933
889
|
description: "Name of the foreign key field.\n\nFollows convention: \"{target_model_name_without_prefix}_id\" Examples:\n\"shopping_customer_id\", \"bbs_article_id\", \"attachment_file_id\" For\nself-references: \"parent_id\" (e.g., in hierarchical structures)\n\n\n@pattern ^[a-z][a-z0-9_]*$",
|
|
934
890
|
type: "string"
|
|
935
891
|
},
|
|
936
892
|
type: {
|
|
937
|
-
title: "Data type of the foreign key field",
|
|
938
893
|
description: "Data type of the foreign key field.\n\nAlways \"uuid\" to match the primary key type of referenced models. Ensures\nreferential integrity and consistency across the schema.",
|
|
939
894
|
type: "string",
|
|
940
895
|
"enum": [
|
|
@@ -946,17 +901,14 @@ const collection = {
|
|
|
946
901
|
type: "string"
|
|
947
902
|
},
|
|
948
903
|
relation: {
|
|
949
|
-
title: "Prisma relation configuration defining the association details",
|
|
950
904
|
description: "Prisma relation configuration defining the association details.\n\nSpecifies how this foreign key connects to the target model, including\nrelation name, target model, and target field.",
|
|
951
905
|
type: "object",
|
|
952
906
|
properties: {
|
|
953
907
|
name: {
|
|
954
|
-
title: "Name of the relation property in the Prisma model",
|
|
955
908
|
description: "Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: \"customer\", \"channel\", \"parent\",\n\"snapshot\"\n\n\n@pattern ^[a-zA-Z_][a-zA-Z0-9_]*$",
|
|
956
909
|
type: "string"
|
|
957
910
|
},
|
|
958
911
|
targetModel: {
|
|
959
|
-
title: "Name of the target model being referenced",
|
|
960
912
|
description: "Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n\"shopping_customers\", \"shopping_channels\", \"bbs_articles\"",
|
|
961
913
|
type: "string"
|
|
962
914
|
}
|
|
@@ -967,12 +919,10 @@ const collection = {
|
|
|
967
919
|
]
|
|
968
920
|
},
|
|
969
921
|
unique: {
|
|
970
|
-
title: "Whether this foreign key has a unique constraint",
|
|
971
922
|
description: "Whether this foreign key has a unique constraint.\n\nTrue: Creates a 1:1 relationship (e.g., user profile, order publish\ndetails) false: Allows 1:N relationship (e.g., customer to multiple\norders) Used for enforcing business rules about relationship\ncardinality.",
|
|
972
923
|
type: "boolean"
|
|
973
924
|
},
|
|
974
925
|
nullable: {
|
|
975
|
-
title: "Whether this foreign key can be null (optional relationship)",
|
|
976
926
|
description: "Whether this foreign key can be null (optional relationship).\n\nTrue: Relationship is optional, foreign key can be null false:\nRelationship is required, foreign key cannot be null Reflects business\nrules about mandatory vs optional associations.",
|
|
977
927
|
type: "boolean"
|
|
978
928
|
}
|
|
@@ -991,12 +941,10 @@ const collection = {
|
|
|
991
941
|
type: "object",
|
|
992
942
|
properties: {
|
|
993
943
|
name: {
|
|
994
|
-
title: "Name of the field in the database table",
|
|
995
944
|
description: "Name of the field in the database table.\n\nShould use snake_case convention. Common patterns from uploaded schemas:\n\n- Timestamps: created_at, updated_at, deleted_at, opened_at, closed_at\n- Identifiers: code, name, nickname, title\n- Business data: value, quantity, price, volume, balance\n- Flags: primary, required, exclusive, secret, multiplicative\n\n\n@pattern ^[a-z][a-z0-9_]*$",
|
|
996
945
|
type: "string"
|
|
997
946
|
},
|
|
998
947
|
type: {
|
|
999
|
-
title: "Data type of the field for Prisma schema generation",
|
|
1000
948
|
description: "Data type of the field for Prisma schema generation.\n\nMaps to appropriate Prisma/PostgreSQL types:\n\n- Boolean: Boolean flags and yes/no values\n- Int: Integer numbers, quantities, sequences\n- Double: Decimal numbers, prices, monetary values, percentages\n- String: Text data, names, descriptions, codes\n- Uri: URL/URI fields for links and references\n- Uuid: UUID fields (for non-foreign-key UUIDs)\n- Date: Date-only values (rare, mostly for business dates)\n- Datetime: Timestamp fields with date and time",
|
|
1001
949
|
type: "string",
|
|
1002
950
|
"enum": [
|
|
@@ -1010,12 +958,10 @@ const collection = {
|
|
|
1010
958
|
]
|
|
1011
959
|
},
|
|
1012
960
|
description: {
|
|
1013
|
-
title: "Description explaining the business purpose and usage of this field",
|
|
1014
961
|
description: "Description explaining the business purpose and usage of this field.\n\nShould clearly explain:\n\n- What business concept this field represents\n- Valid values or constraints if applicable\n- How it relates to business processes\n- Any special behavioral notes Example: \"Amount of cash payment.\" or\n \"Whether the unit is required or not.\"",
|
|
1015
962
|
type: "string"
|
|
1016
963
|
},
|
|
1017
964
|
nullable: {
|
|
1018
|
-
title: "Whether this field can contain null values",
|
|
1019
965
|
description: "Whether this field can contain null values.\n\nTrue: Field is optional and can be null (e.g., middle name, description)\nfalse: Field is required and cannot be null (e.g., creation timestamp,\nname) Reflects business rules about mandatory vs optional data.",
|
|
1020
966
|
type: "boolean"
|
|
1021
967
|
}
|
|
@@ -1032,7 +978,6 @@ const collection = {
|
|
|
1032
978
|
type: "object",
|
|
1033
979
|
properties: {
|
|
1034
980
|
fieldNames: {
|
|
1035
|
-
title: "Array of field names that together form the unique constraint",
|
|
1036
981
|
description: "Array of field names that together form the unique constraint.\n\nCan be single field (e.g., [\"email\"]) or composite (e.g., [\"channel_id\",\n\"code\"]). All field names must exist in the model. Order matters for\ncomposite indexes. Examples: [\"code\"], [\"shopping_channel_id\",\n\"nickname\"], [\"email\"]\n\n\n@minItems 1\n@uniqueItems",
|
|
1037
982
|
type: "array",
|
|
1038
983
|
items: {
|
|
@@ -1040,7 +985,6 @@ const collection = {
|
|
|
1040
985
|
}
|
|
1041
986
|
},
|
|
1042
987
|
unique: {
|
|
1043
|
-
title: "Explicit marker indicating this is a unique index",
|
|
1044
988
|
description: "Explicit marker indicating this is a unique index.\n\nAlways true to distinguish from regular indexes. Used by code generator\nto emit \"@@unique\" directive in Prisma schema instead of \"@@index\".",
|
|
1045
989
|
type: "boolean",
|
|
1046
990
|
"enum": [
|
|
@@ -1058,7 +1002,6 @@ const collection = {
|
|
|
1058
1002
|
type: "object",
|
|
1059
1003
|
properties: {
|
|
1060
1004
|
fieldNames: {
|
|
1061
|
-
title: "Array of field names to include in the performance index",
|
|
1062
1005
|
description: "Array of field names to include in the performance index.\n\nCan be single field (e.g., [\"created_at\"]) or composite (e.g.,\n[\"customer_id\", \"created_at\"]). All field names must exist in the model.\nOrder matters for composite indexes and should match common query\npatterns. Examples: [\"created_at\"], [\"shopping_customer_id\",\n\"created_at\"], [\"ip\"]\n\n\n@minItems 1\n@uniqueItems",
|
|
1063
1006
|
type: "array",
|
|
1064
1007
|
items: {
|
|
@@ -1075,7 +1018,6 @@ const collection = {
|
|
|
1075
1018
|
type: "object",
|
|
1076
1019
|
properties: {
|
|
1077
1020
|
fieldName: {
|
|
1078
|
-
title: "Name of the text field to index for full-text search capabilities",
|
|
1079
1021
|
description: "Name of the text field to index for full-text search capabilities.\n\nMust be a string field in the model that contains searchable text.\nExamples from uploaded schemas: \"nickname\", \"title\", \"body\", \"name\" Used\nwith PostgreSQL gin_trgm_ops for trigram-based fuzzy text search.",
|
|
1080
1022
|
type: "string"
|
|
1081
1023
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestratePrismaSchema.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,4DAgCC;;;AA7CD,yCAAoE;AAKpE,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,uDAAoD;AACpD,qFAAkF;AAElF,SAAsB,wBAAwB,CAC5C,GAAyB,EACzB,UAAoD;;QAEpD,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,YAAY,GAAa,KAAK,CAAC,IAAI,CACvC,IAAI,GAAG,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
|
|
@@ -8,4 +8,4 @@ export type FAILED = typeof FAILED;
|
|
|
8
8
|
export declare function pipe<A, B>(a: A, ab: (a: A) => Promise<B | FAILED>): Promise<B | FAILED>;
|
|
9
9
|
export declare function pipe<A, B, C>(a: A, ab: (a: A) => Promise<B | FAILED>, bc: (b: B) => Promise<C | FAILED>): Promise<C | FAILED>;
|
|
10
10
|
export declare function pipe<A, B, C, D>(a: A, ab: (a: A) => Promise<B | FAILED>, bc: (b: B) => Promise<C | FAILED>, cd: (c: C) => Promise<D | FAILED>): Promise<D | FAILED>;
|
|
11
|
-
export declare function pipe<A, B, C, D
|
|
11
|
+
export declare function pipe<A, B, C, D>(a: A, ab: (a: A) => Promise<B | FAILED>, bc: (b: B) => Promise<C | FAILED>, cd: (c: C) => Promise<D | FAILED>): Promise<D | FAILED>;
|
|
@@ -13,72 +13,38 @@ exports.FAILED = exports.orchestrateRealize = void 0;
|
|
|
13
13
|
exports.pipe = pipe;
|
|
14
14
|
const uuid_1 = require("uuid");
|
|
15
15
|
const orchestrateRealizeCoder_1 = require("./orchestrateRealizeCoder");
|
|
16
|
-
const orchestrateRealizeIntegrator_1 = require("./orchestrateRealizeIntegrator");
|
|
17
16
|
const orchestrateRealizePlanner_1 = require("./orchestrateRealizePlanner");
|
|
18
|
-
const orchestrateRealizeValidator_1 = require("./orchestrateRealizeValidator");
|
|
19
17
|
const orchestrateRealize = (ctx) => (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
var _a, _b, _c, _d, _e
|
|
18
|
+
var _a, _b, _c, _d, _e;
|
|
21
19
|
props;
|
|
22
20
|
const ops = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.document.operations;
|
|
23
21
|
if (!ops) {
|
|
24
22
|
throw new Error();
|
|
25
23
|
}
|
|
24
|
+
const files = Object.assign(Object.assign({}, (_b = ctx.state().interface) === null || _b === void 0 ? void 0 : _b.files), (_c = ctx.state().test) === null || _c === void 0 ? void 0 : _c.files.reduce((acc, file) => {
|
|
25
|
+
acc[file.location] = file.content;
|
|
26
|
+
return acc;
|
|
27
|
+
}, {}));
|
|
26
28
|
const codes = yield Promise.all(ops.map((op) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.map((c) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
-
return pipe(c, (c) => (0, orchestrateRealizeIntegrator_1.orchestrateRealizeIntegrator)(ctx, c), (i) => (0, orchestrateRealizeValidator_1.orchestrateRealizeValidator)(ctx, i));
|
|
29
|
+
return ({
|
|
30
|
+
operation: op,
|
|
31
|
+
result: yield pipe(op, (op) => (0, orchestrateRealizePlanner_1.orchestrateRealizePlanner)(ctx, op), (p) => (0, orchestrateRealizeCoder_1.orchestrateRealizeCoder)(ctx, op, p, files)),
|
|
32
|
+
});
|
|
33
33
|
})));
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
ctx.dispatch({
|
|
42
|
-
type: "realizeComplete",
|
|
43
|
-
compiled: compiled,
|
|
44
|
-
created_at: now,
|
|
45
|
-
files: files,
|
|
46
|
-
step: (_d = (_c = ctx.state().analyze) === null || _c === void 0 ? void 0 : _c.step) !== null && _d !== void 0 ? _d : 0,
|
|
34
|
+
const successes = [];
|
|
35
|
+
const failures = [];
|
|
36
|
+
for (const code of codes) {
|
|
37
|
+
if (code.result === exports.FAILED) {
|
|
38
|
+
failures.push({
|
|
39
|
+
operation: code.operation,
|
|
40
|
+
result: code.result,
|
|
47
41
|
});
|
|
48
|
-
return {
|
|
49
|
-
id: (0, uuid_1.v4)(),
|
|
50
|
-
type: "realize",
|
|
51
|
-
completed_at: now,
|
|
52
|
-
created_at: now,
|
|
53
|
-
compiled,
|
|
54
|
-
files,
|
|
55
|
-
reason: props.reason,
|
|
56
|
-
step: (_f = (_e = ctx.state().analyze) === null || _e === void 0 ? void 0 : _e.step) !== null && _f !== void 0 ? _f : 0,
|
|
57
|
-
};
|
|
58
42
|
}
|
|
59
43
|
else {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const now = new Date().toISOString();
|
|
64
|
-
ctx.dispatch({
|
|
65
|
-
type: "assistantMessage",
|
|
66
|
-
text: [
|
|
67
|
-
`Out of ${total} code blocks, ${successCount} succeeded, but ${failedCount} failed.`,
|
|
68
|
-
`The process has been stopped due to the failure. Please review the failed steps and try again.`,
|
|
69
|
-
].join("\n"),
|
|
70
|
-
created_at: now,
|
|
44
|
+
successes.push({
|
|
45
|
+
operation: code.operation,
|
|
46
|
+
result: code.result,
|
|
71
47
|
});
|
|
72
|
-
return {
|
|
73
|
-
id: (0, uuid_1.v4)(),
|
|
74
|
-
type: "assistantMessage",
|
|
75
|
-
completed_at: now,
|
|
76
|
-
created_at: now,
|
|
77
|
-
text: [
|
|
78
|
-
`Out of ${total} code blocks, ${successCount} succeeded, but ${failedCount} failed.`,
|
|
79
|
-
`The process has been stopped due to the failure. Please review the failed steps and try again.`,
|
|
80
|
-
].join("\n"),
|
|
81
|
-
};
|
|
82
48
|
}
|
|
83
49
|
}
|
|
84
50
|
const now = new Date().toISOString();
|
|
@@ -88,11 +54,14 @@ const orchestrateRealize = (ctx) => (props) => __awaiter(void 0, void 0, void 0,
|
|
|
88
54
|
created_at: now,
|
|
89
55
|
});
|
|
90
56
|
return {
|
|
91
|
-
|
|
92
|
-
|
|
57
|
+
type: "realize",
|
|
58
|
+
compiled: 1,
|
|
59
|
+
files: {},
|
|
93
60
|
completed_at: now,
|
|
94
61
|
created_at: now,
|
|
95
|
-
|
|
62
|
+
id: (0, uuid_1.v4)(),
|
|
63
|
+
reason: props.reason,
|
|
64
|
+
step: (_e = (_d = ctx.state().test) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
|
|
96
65
|
};
|
|
97
66
|
});
|
|
98
67
|
exports.orchestrateRealize = orchestrateRealize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateRealize.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealize.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateRealize.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealize.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsHA,oBAUC;AA1HD,+BAA0B;AAI1B,uEAAoE;AACpE,2EAAwE;AAGjE,MAAM,kBAAkB,GAC7B,CAAiC,GAAyB,EAAE,EAAE,CAC9D,CACE,KAA8B,EACiC,EAAE;;IACjE,KAAK,CAAC;IACN,MAAM,GAAG,GAAG,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,SAAS,0CAAE,QAAQ,CAAC,UAAU,CAAC;IACvD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,EAAE,CAAC;IACpB,CAAC;IAED,MAAM,KAAK,mCACN,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,SAAS,0CAAE,KAAK,GAC5B,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,0CAAE,KAAK,CAAC,MAAM,CAC/B,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACZ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QAClC,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAA4B,CAC7B,CACF,CAAC;IAEF,MAAM,KAAK,GACT,MAAM,OAAO,CAAC,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pB,IAAI,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,0CAAE,IAAI,mCAAI,CAAC;KAClC,CAAC;AACJ,CAAC,CAAA,CAAC;AA1ES,QAAA,kBAAkB,sBA0E3B;AAES,QAAA,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AA4BvC,SAAgB,IAAI,CAClB,CAAM,EACN,GAAG,GAAsC;IAEzC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YAC1B,IAAI,MAAM,KAAK,cAAM;gBAAE,OAAO,cAAM,CAAC;YACrC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -22,4 +22,4 @@ import { IAutoBeRealizeCoderApplication } from "./structures/IAutoBeRealizeCoder
|
|
|
22
22
|
* @param props - Planning result describing what function to generate
|
|
23
23
|
* @returns The generated function name and TypeScript code
|
|
24
24
|
*/
|
|
25
|
-
export declare const orchestrateRealizeCoder: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, operation: AutoBeOpenApi.IOperation, props: RealizePlannerOutput) => Promise<IAutoBeRealizeCoderApplication.RealizeCoderOutput | FAILED>;
|
|
25
|
+
export declare const orchestrateRealizeCoder: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, operation: AutoBeOpenApi.IOperation, props: RealizePlannerOutput, files: Record<string, string>) => Promise<IAutoBeRealizeCoderApplication.RealizeCoderOutput | FAILED>;
|