@wix/ditto-codegen-public 1.0.99 → 1.0.101
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/out.js +136 -42
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -116677,8 +116677,9 @@ var require_data = __commonJS({
|
|
|
116677
116677
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116678
116678
|
exports2.cmsPlannerPrompt = void 0;
|
|
116679
116679
|
var types_impl_1 = require_types_impl2();
|
|
116680
|
-
var handlingFeesExample =
|
|
116681
|
-
|
|
116680
|
+
var handlingFeesExample = {
|
|
116681
|
+
operation: "insert",
|
|
116682
|
+
data: {
|
|
116682
116683
|
idSuffix: "handling-fees-rules",
|
|
116683
116684
|
displayName: "Handling Fees Rules",
|
|
116684
116685
|
displayField: "productId",
|
|
@@ -116701,7 +116702,7 @@ var require_data = __commonJS({
|
|
|
116701
116702
|
itemRemove: types_impl_1.AccessLevel.ANYONE
|
|
116702
116703
|
}
|
|
116703
116704
|
}
|
|
116704
|
-
|
|
116705
|
+
};
|
|
116705
116706
|
var cmsPlannerPrompt = () => `
|
|
116706
116707
|
<CMS_PLANNER_SYSTEM_PROMPT>
|
|
116707
116708
|
|
|
@@ -116740,7 +116741,7 @@ Blueprint indicates a handling fees system for products.
|
|
|
116740
116741
|
|
|
116741
116742
|
For the collections field, return:
|
|
116742
116743
|
\`\`\`
|
|
116743
|
-
${JSON.stringify(handlingFeesExample, null, 2)}
|
|
116744
|
+
[${JSON.stringify(handlingFeesExample, null, 2)}]
|
|
116744
116745
|
\`\`\`
|
|
116745
116746
|
</example>
|
|
116746
116747
|
|
|
@@ -116986,6 +116987,99 @@ var require_iteration = __commonJS({
|
|
|
116986
116987
|
"use strict";
|
|
116987
116988
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116988
116989
|
exports2.iterationModePrompt = void 0;
|
|
116990
|
+
var types_1 = require_types_impl2();
|
|
116991
|
+
var insertExample = {
|
|
116992
|
+
collections: [
|
|
116993
|
+
{
|
|
116994
|
+
operation: "insert",
|
|
116995
|
+
data: {
|
|
116996
|
+
idSuffix: "handling-fees-rules",
|
|
116997
|
+
displayName: "Handling Fees Rules",
|
|
116998
|
+
displayField: "productId",
|
|
116999
|
+
fields: [
|
|
117000
|
+
{
|
|
117001
|
+
key: "productId",
|
|
117002
|
+
displayName: "Product",
|
|
117003
|
+
type: "REFERENCE",
|
|
117004
|
+
referenceOptions: {
|
|
117005
|
+
referencedCollectionId: "Stores/Products"
|
|
117006
|
+
}
|
|
117007
|
+
},
|
|
117008
|
+
{ key: "oversizedFee", displayName: "Oversized Fee", type: "NUMBER" },
|
|
117009
|
+
{ key: "fragileFee", displayName: "Fragile Fee", type: "NUMBER" }
|
|
117010
|
+
],
|
|
117011
|
+
dataPermissions: {
|
|
117012
|
+
itemRead: types_1.AccessLevel.ANYONE,
|
|
117013
|
+
itemInsert: types_1.AccessLevel.ANYONE,
|
|
117014
|
+
itemUpdate: types_1.AccessLevel.ANYONE,
|
|
117015
|
+
itemRemove: types_1.AccessLevel.ANYONE
|
|
117016
|
+
}
|
|
117017
|
+
}
|
|
117018
|
+
}
|
|
117019
|
+
],
|
|
117020
|
+
embeddedScriptParameters: [],
|
|
117021
|
+
// No changes needed - existing ones stay as is
|
|
117022
|
+
apiSpec: void 0
|
|
117023
|
+
// No changes needed - existing spec stays as is
|
|
117024
|
+
};
|
|
117025
|
+
var updateExample = {
|
|
117026
|
+
collections: [
|
|
117027
|
+
{
|
|
117028
|
+
operation: "update",
|
|
117029
|
+
data: {
|
|
117030
|
+
idSuffix: "handling-fees-rules",
|
|
117031
|
+
// make sure to use the same idSuffix as the existing collection
|
|
117032
|
+
displayName: "Handling Fees Rules",
|
|
117033
|
+
displayField: "productId",
|
|
117034
|
+
fields: [
|
|
117035
|
+
{
|
|
117036
|
+
key: "productId",
|
|
117037
|
+
displayName: "Product Id",
|
|
117038
|
+
type: "REFERENCE",
|
|
117039
|
+
referenceOptions: {
|
|
117040
|
+
referencedCollectionId: "Stores/Products"
|
|
117041
|
+
}
|
|
117042
|
+
},
|
|
117043
|
+
{ key: "oversizedFee", displayName: "Oversized Fee", type: "NUMBER" },
|
|
117044
|
+
{ key: "fragileFee", displayName: "Fragile Fee", type: "NUMBER" }
|
|
117045
|
+
],
|
|
117046
|
+
dataPermissions: {
|
|
117047
|
+
itemRead: types_1.AccessLevel.ANYONE,
|
|
117048
|
+
itemInsert: types_1.AccessLevel.ANYONE,
|
|
117049
|
+
itemUpdate: types_1.AccessLevel.ANYONE,
|
|
117050
|
+
itemRemove: types_1.AccessLevel.ANYONE
|
|
117051
|
+
}
|
|
117052
|
+
}
|
|
117053
|
+
}
|
|
117054
|
+
],
|
|
117055
|
+
embeddedScriptParameters: [],
|
|
117056
|
+
// No changes needed - existing ones stay as is
|
|
117057
|
+
apiSpec: void 0
|
|
117058
|
+
// No changes needed - existing spec stays as is
|
|
117059
|
+
};
|
|
117060
|
+
var deleteExample = {
|
|
117061
|
+
collections: [],
|
|
117062
|
+
// No changes needed - no collections to change
|
|
117063
|
+
embeddedScriptParameters: [
|
|
117064
|
+
{
|
|
117065
|
+
operation: "delete",
|
|
117066
|
+
data: {
|
|
117067
|
+
extensionId: "site-popup",
|
|
117068
|
+
parameters: [
|
|
117069
|
+
{
|
|
117070
|
+
key: "productId",
|
|
117071
|
+
displayName: "Product Id",
|
|
117072
|
+
type: "NUMBER",
|
|
117073
|
+
required: true,
|
|
117074
|
+
defaultValue: "123"
|
|
117075
|
+
}
|
|
117076
|
+
]
|
|
117077
|
+
}
|
|
117078
|
+
}
|
|
117079
|
+
],
|
|
117080
|
+
apiSpec: void 0
|
|
117081
|
+
// No changes needed - existing spec stays as is
|
|
117082
|
+
};
|
|
116989
117083
|
var iterationModePrompt = () => `
|
|
116990
117084
|
<ITERATION_MODE>
|
|
116991
117085
|
This is an ITERATION mode planning session. You will receive:
|
|
@@ -117029,36 +117123,15 @@ IMPORTANT PRINCIPLES:
|
|
|
117029
117123
|
- If a resource exists and works fine, simply don't include it in your output
|
|
117030
117124
|
|
|
117031
117125
|
Example 1 - Adding a new collection (existing resources remain unchanged):
|
|
117032
|
-
|
|
117033
|
-
|
|
117034
|
-
{
|
|
117035
|
-
"operation": "insert",
|
|
117036
|
-
"collection": { "id": "new-collection", ... }
|
|
117037
|
-
}
|
|
117038
|
-
],
|
|
117039
|
-
"embeddedScriptParameters": [], // No changes needed - existing ones stay as is
|
|
117040
|
-
"apiSpec": undefined // No changes needed - existing spec stays as is
|
|
117041
|
-
}
|
|
117126
|
+
|
|
117127
|
+
${JSON.stringify(insertExample, null, 2)}
|
|
117042
117128
|
|
|
117043
117129
|
Example 2 - Updating an existing collection:
|
|
117044
|
-
{
|
|
117045
|
-
"collections": [
|
|
117046
|
-
{
|
|
117047
|
-
"operation": "update",
|
|
117048
|
-
"collection": { "id": "existing-collection", ... } // Include full updated collection
|
|
117049
|
-
}
|
|
117050
|
-
]
|
|
117051
|
-
}
|
|
117130
|
+
${JSON.stringify(updateExample, null, 2)}
|
|
117052
117131
|
|
|
117053
117132
|
Example 3 - Deleting a collection (BE VERY CAREFUL):
|
|
117054
|
-
{
|
|
117055
|
-
|
|
117056
|
-
{
|
|
117057
|
-
"operation": "delete",
|
|
117058
|
-
"collection": { "id": "unused-collection", ... } // Collection to remove
|
|
117059
|
-
}
|
|
117060
|
-
]
|
|
117061
|
-
}
|
|
117133
|
+
${JSON.stringify(deleteExample, null, 2)}
|
|
117134
|
+
|
|
117062
117135
|
</ITERATION_MODE>
|
|
117063
117136
|
`;
|
|
117064
117137
|
exports2.iterationModePrompt = iterationModePrompt;
|
|
@@ -117390,7 +117463,7 @@ var require_FieldSchema = __commonJS({
|
|
|
117390
117463
|
key: zod_1.z.string().min(1).max(1e3).meta({ description: "Field ID." }),
|
|
117391
117464
|
displayName: zod_1.z.string().min(1).max(1e3).optional().meta({ description: "Display name for the field." }),
|
|
117392
117465
|
type: exports2.FieldTypeSchema.meta({
|
|
117393
|
-
description: "Field type.
|
|
117466
|
+
description: "Field type."
|
|
117394
117467
|
}),
|
|
117395
117468
|
// type_options (object/array only)
|
|
117396
117469
|
objectOptions: zod_1.z.lazy(() => exports2.FieldObjectOptionsSchema).optional().meta({ description: "Metadata for an object field." }),
|
|
@@ -117444,9 +117517,30 @@ var require_FieldSchema = __commonJS({
|
|
|
117444
117517
|
"MEDIA_GALLERY",
|
|
117445
117518
|
"ADDRESS"
|
|
117446
117519
|
];
|
|
117520
|
+
var primitiveTypeDescriptions = {
|
|
117521
|
+
TEXT: "Plain-text string.",
|
|
117522
|
+
NUMBER: "Number.",
|
|
117523
|
+
DATE: "A date string in ISO 8601 date format: `YYYY-MM-DD`.",
|
|
117524
|
+
DATETIME: 'An object in the following format: `"someFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ" }`. Milliseconds can be omitted.',
|
|
117525
|
+
IMAGE: "A web URL or a Media Manager URL.",
|
|
117526
|
+
BOOLEAN: "Boolean true or false value.",
|
|
117527
|
+
DOCUMENT: "A web URL or a Media Manager URL.",
|
|
117528
|
+
URL: "A valid URL.",
|
|
117529
|
+
RICH_TEXT: "A string that may contain a subset of HTML tags.",
|
|
117530
|
+
VIDEO: "A web URL or a Media Manager URL.",
|
|
117531
|
+
ANY: "Any field type.",
|
|
117532
|
+
ARRAY_STRING: "Array of strings.",
|
|
117533
|
+
ARRAY_DOCUMENT: "Array of documents: web URLs or Media Manager URLs.",
|
|
117534
|
+
AUDIO: "A web URL or a Media Manager URL.",
|
|
117535
|
+
TIME: "A string in `hh:mm:ss.SSS` format.",
|
|
117536
|
+
LANGUAGE: "Language codes in ISO 639-1 format. May include country codes in ISO 3166-1 alpha-2 format.",
|
|
117537
|
+
RICH_CONTENT: "A rich content object.",
|
|
117538
|
+
MEDIA_GALLERY: "Array of image and video URLs. Items are web URLs or Media Manager URLs.",
|
|
117539
|
+
ADDRESS: "Address object with fields: formatted, location { latitude, longitude }, streetAddress { name, number }, city, subdivision, country, postalCode."
|
|
117540
|
+
};
|
|
117447
117541
|
var PrimitiveLiteralSchemas = primitiveTypes.map((t) => FieldBaseSchema.extend({
|
|
117448
117542
|
type: zod_1.z.literal(t).meta({
|
|
117449
|
-
description:
|
|
117543
|
+
description: primitiveTypeDescriptions[t]
|
|
117450
117544
|
}),
|
|
117451
117545
|
referenceOptions: zod_1.z.never().optional(),
|
|
117452
117546
|
multiReferenceOptions: zod_1.z.never().optional(),
|
|
@@ -117455,7 +117549,7 @@ var require_FieldSchema = __commonJS({
|
|
|
117455
117549
|
}));
|
|
117456
117550
|
var ReferenceFieldSchema = FieldBaseSchema.extend({
|
|
117457
117551
|
type: zod_1.z.literal("REFERENCE").meta({
|
|
117458
|
-
description: "
|
|
117552
|
+
description: "Reference to another item in another collection. Requires `referencedCollectionId`."
|
|
117459
117553
|
}),
|
|
117460
117554
|
referenceOptions: zod_1.z.lazy(() => exports2.FieldReferenceOptionsSchema).meta({ description: "Metadata for a reference field." }),
|
|
117461
117555
|
multiReferenceOptions: zod_1.z.never().optional(),
|
|
@@ -117464,7 +117558,7 @@ var require_FieldSchema = __commonJS({
|
|
|
117464
117558
|
});
|
|
117465
117559
|
var MultiReferenceFieldSchema = FieldBaseSchema.extend({
|
|
117466
117560
|
type: zod_1.z.literal("MULTI_REFERENCE").meta({
|
|
117467
|
-
description: "
|
|
117561
|
+
description: "References to multiple items in another collection. Requires `referencedCollectionId`."
|
|
117468
117562
|
}),
|
|
117469
117563
|
multiReferenceOptions: zod_1.z.lazy(() => exports2.FieldMultiReferenceOptionsSchema).meta({ description: "Metadata for a multi-reference field." }),
|
|
117470
117564
|
referenceOptions: zod_1.z.never().optional(),
|
|
@@ -117473,7 +117567,7 @@ var require_FieldSchema = __commonJS({
|
|
|
117473
117567
|
});
|
|
117474
117568
|
var ObjectFieldSchema = FieldBaseSchema.extend({
|
|
117475
117569
|
type: zod_1.z.literal("OBJECT").meta({
|
|
117476
|
-
description: "
|
|
117570
|
+
description: "JSON object."
|
|
117477
117571
|
}),
|
|
117478
117572
|
objectOptions: zod_1.z.lazy(() => exports2.FieldObjectOptionsSchema).meta({ description: "Metadata for an object field." }),
|
|
117479
117573
|
referenceOptions: zod_1.z.never().optional(),
|
|
@@ -117482,7 +117576,7 @@ var require_FieldSchema = __commonJS({
|
|
|
117482
117576
|
});
|
|
117483
117577
|
var ArrayFieldSchema = FieldBaseSchema.extend({
|
|
117484
117578
|
type: zod_1.z.literal("ARRAY").meta({
|
|
117485
|
-
description: "
|
|
117579
|
+
description: "Array."
|
|
117486
117580
|
}),
|
|
117487
117581
|
arrayOptions: zod_1.z.lazy(() => exports2.FieldArrayOptionsSchema).meta({ description: "Metadata for an array field." }),
|
|
117488
117582
|
referenceOptions: zod_1.z.never().optional(),
|
|
@@ -117531,7 +117625,7 @@ var require_DataPermissionsSchema = __commonJS({
|
|
|
117531
117625
|
description: "Access level required to remove data items."
|
|
117532
117626
|
})
|
|
117533
117627
|
}).meta({
|
|
117534
|
-
description: "
|
|
117628
|
+
description: "Data permissions defined by access level for each action."
|
|
117535
117629
|
});
|
|
117536
117630
|
}
|
|
117537
117631
|
});
|
|
@@ -117551,7 +117645,7 @@ var require_IndexSchema = __commonJS({
|
|
|
117551
117645
|
description: "Path of the field to index. For example: `title` or `options.price`."
|
|
117552
117646
|
}),
|
|
117553
117647
|
order: exports2.OrderEnum.meta({
|
|
117554
|
-
description: "Sort order for the index.
|
|
117648
|
+
description: "Sort order for the index. Based on how the data is regularly queried.\n\nDefault: `ASC`"
|
|
117555
117649
|
})
|
|
117556
117650
|
});
|
|
117557
117651
|
exports2.IndexSchema = zod_1.z.object({
|
|
@@ -117614,7 +117708,7 @@ var require_DataCollectionsExtensionSchema = __commonJS({
|
|
|
117614
117708
|
description: "Data collections automatically added to a site when the app is installed."
|
|
117615
117709
|
})
|
|
117616
117710
|
}).meta({
|
|
117617
|
-
description: "An extension for adding data collections to a site when
|
|
117711
|
+
description: "An extension for adding data collections to a site when the app is installed."
|
|
117618
117712
|
});
|
|
117619
117713
|
}
|
|
117620
117714
|
});
|
|
@@ -117653,7 +117747,7 @@ var require_PlannerAgent = __commonJS({
|
|
|
117653
117747
|
"dist/agents/PlannerAgent.js"(exports2) {
|
|
117654
117748
|
"use strict";
|
|
117655
117749
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
117656
|
-
exports2.PlannerAgent = exports2.ApiSpecOperationSchema = exports2.EmbeddedScriptParametersOperationSchema = exports2.CollectionOperationSchema = void 0;
|
|
117750
|
+
exports2.PlannerAgent = exports2.PlannerOutputSchema = exports2.ApiSpecOperationSchema = exports2.EmbeddedScriptParametersOperationSchema = exports2.CollectionOperationSchema = void 0;
|
|
117657
117751
|
var types_1 = require_types_impl();
|
|
117658
117752
|
var anthropic_1 = require_dist6();
|
|
117659
117753
|
var ai_1 = require_dist10();
|
|
@@ -117677,7 +117771,7 @@ var require_PlannerAgent = __commonJS({
|
|
|
117677
117771
|
operation: OperationEnum,
|
|
117678
117772
|
data: ApiSpecSchema_1.ApiSpecSchema.describe("The API specification")
|
|
117679
117773
|
});
|
|
117680
|
-
|
|
117774
|
+
exports2.PlannerOutputSchema = zod_1.z.object({
|
|
117681
117775
|
collections: zod_1.z.array(exports2.CollectionOperationSchema).default([]).describe("CMS collection operations - only include collections that need to be created, updated, or deleted"),
|
|
117682
117776
|
embeddedScriptParameters: zod_1.z.array(exports2.EmbeddedScriptParametersOperationSchema).default([]).describe("Embedded script parameters operations - only include parameters that need to be created, updated, or deleted"),
|
|
117683
117777
|
apiSpec: exports2.ApiSpecOperationSchema.optional().describe("API specification operation - only include if API spec needs to be created, updated, or deleted")
|
|
@@ -117705,7 +117799,7 @@ ${error}` : ""}
|
|
|
117705
117799
|
`;
|
|
117706
117800
|
const result = await (0, ai_1.generateObject)({
|
|
117707
117801
|
model,
|
|
117708
|
-
schema: PlannerOutputSchema,
|
|
117802
|
+
schema: exports2.PlannerOutputSchema,
|
|
117709
117803
|
messages: [
|
|
117710
117804
|
{
|
|
117711
117805
|
role: "system",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/ditto-codegen-public",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.101",
|
|
4
4
|
"description": "AI-powered Wix CLI app generator - standalone executable",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node build.mjs",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@wix/ditto-codegen": "1.0.0",
|
|
25
25
|
"esbuild": "^0.25.9"
|
|
26
26
|
},
|
|
27
|
-
"falconPackageHash": "
|
|
27
|
+
"falconPackageHash": "508d435510f0b0c5e1a4ce488987efcc1f65ca703410ffc6351bb665"
|
|
28
28
|
}
|