@wix/ditto-codegen-public 1.0.130 → 1.0.132
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 +43 -6
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -117836,6 +117836,25 @@ var require_PlannerAgentSchema = __commonJS({
|
|
|
117836
117836
|
}
|
|
117837
117837
|
});
|
|
117838
117838
|
|
|
117839
|
+
// dist/agents/planner/forceDataPermissionsToAnyone.js
|
|
117840
|
+
var require_forceDataPermissionsToAnyone = __commonJS({
|
|
117841
|
+
"dist/agents/planner/forceDataPermissionsToAnyone.js"(exports2) {
|
|
117842
|
+
"use strict";
|
|
117843
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
117844
|
+
exports2.forceDataPermissionsToAnyone = forceDataPermissionsToAnyone;
|
|
117845
|
+
var ditto_codegen_types_12 = require_dist();
|
|
117846
|
+
function forceDataPermissionsToAnyone(plan) {
|
|
117847
|
+
const dataPermissionsList = plan.collections.flatMap((x) => x.operation === ditto_codegen_types_12.ExtensionGenerationOperation.INSERT || x.operation === ditto_codegen_types_12.ExtensionGenerationOperation.UPDATE ? [x.data.dataPermissions] : []);
|
|
117848
|
+
dataPermissionsList.forEach((x) => {
|
|
117849
|
+
x.itemRead = "ANYONE";
|
|
117850
|
+
x.itemInsert = "ANYONE";
|
|
117851
|
+
x.itemUpdate = "ANYONE";
|
|
117852
|
+
x.itemRemove = "ANYONE";
|
|
117853
|
+
});
|
|
117854
|
+
}
|
|
117855
|
+
}
|
|
117856
|
+
});
|
|
117857
|
+
|
|
117839
117858
|
// dist/agents/planner/PlannerAgent.js
|
|
117840
117859
|
var require_PlannerAgent = __commonJS({
|
|
117841
117860
|
"dist/agents/planner/PlannerAgent.js"(exports2) {
|
|
@@ -117849,6 +117868,7 @@ var require_PlannerAgent = __commonJS({
|
|
|
117849
117868
|
var utils_1 = require_utils11();
|
|
117850
117869
|
var ditto_codegen_types_12 = require_dist();
|
|
117851
117870
|
var PlannerAgentSchema_1 = require_PlannerAgentSchema();
|
|
117871
|
+
var forceDataPermissionsToAnyone_1 = require_forceDataPermissionsToAnyone();
|
|
117852
117872
|
var PlannerAgent = class {
|
|
117853
117873
|
constructor(apiKey) {
|
|
117854
117874
|
this.apiKey = apiKey;
|
|
@@ -117861,7 +117881,7 @@ var require_PlannerAgent = __commonJS({
|
|
|
117861
117881
|
isIteration
|
|
117862
117882
|
});
|
|
117863
117883
|
}
|
|
117864
|
-
async generatePlan({ systemPrompt, blueprint, error, previousResources, schema }) {
|
|
117884
|
+
async generatePlan({ systemPrompt, blueprint, error, previousResources, schema, isIteration }) {
|
|
117865
117885
|
const model = (0, anthropic_1.createAnthropic)({ apiKey: this.apiKey })("claude-3-5-haiku-latest");
|
|
117866
117886
|
const userContent = `
|
|
117867
117887
|
${JSON.stringify(blueprint, null, 2)}
|
|
@@ -117895,7 +117915,12 @@ ${error}` : ""}
|
|
|
117895
117915
|
functionId: this.name
|
|
117896
117916
|
}
|
|
117897
117917
|
});
|
|
117898
|
-
|
|
117918
|
+
const plan = result.object;
|
|
117919
|
+
if (!isIteration) {
|
|
117920
|
+
console.log("\u{1F513} Force data permissions to ANYONE");
|
|
117921
|
+
(0, forceDataPermissionsToAnyone_1.forceDataPermissionsToAnyone)(plan);
|
|
117922
|
+
}
|
|
117923
|
+
return plan;
|
|
117899
117924
|
}
|
|
117900
117925
|
async generate(blueprint, options) {
|
|
117901
117926
|
const { isIteration = false, previousResources } = options || {};
|
|
@@ -117920,7 +117945,8 @@ ${error}` : ""}
|
|
|
117920
117945
|
blueprint,
|
|
117921
117946
|
error: lastError,
|
|
117922
117947
|
previousResources,
|
|
117923
|
-
schema
|
|
117948
|
+
schema,
|
|
117949
|
+
isIteration
|
|
117924
117950
|
});
|
|
117925
117951
|
return result;
|
|
117926
117952
|
} catch (error) {
|
|
@@ -119963,6 +119989,17 @@ var require_extensions = __commonJS({
|
|
|
119963
119989
|
"../codegen-common-logic/dist/extensions.js"(exports2) {
|
|
119964
119990
|
"use strict";
|
|
119965
119991
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
119992
|
+
exports2.codeGenerationExtensionTypes = void 0;
|
|
119993
|
+
var types_1 = require_types_impl();
|
|
119994
|
+
exports2.codeGenerationExtensionTypes = [
|
|
119995
|
+
types_1.ExtensionType.SERVICE_PLUGIN,
|
|
119996
|
+
types_1.ExtensionType.DASHBOARD_PAGE,
|
|
119997
|
+
types_1.ExtensionType.SITE_COMPONENT,
|
|
119998
|
+
types_1.ExtensionType.SITE_WIDGET,
|
|
119999
|
+
types_1.ExtensionType.BACKEND_EVENT,
|
|
120000
|
+
types_1.ExtensionType.BACKEND_API,
|
|
120001
|
+
types_1.ExtensionType.EMBEDDED_SCRIPT
|
|
120002
|
+
];
|
|
119966
120003
|
}
|
|
119967
120004
|
});
|
|
119968
120005
|
|
|
@@ -121902,21 +121939,21 @@ var require_IterationAgent = __commonJS({
|
|
|
121902
121939
|
var ai_1 = require_dist10();
|
|
121903
121940
|
var zod_1 = require_zod();
|
|
121904
121941
|
var utils_1 = require_utils11();
|
|
121905
|
-
var types_1 = require_types_impl();
|
|
121906
121942
|
var iterationAgentPrompt_1 = require_iterationAgentPrompt();
|
|
121907
121943
|
var AgentsRegistry_1 = require_AgentsRegistry();
|
|
121944
|
+
var codegen_common_logic_1 = require_dist12();
|
|
121908
121945
|
var ditto_codegen_types_12 = require_dist();
|
|
121909
121946
|
var formatExtensions_1 = require_formatExtensions();
|
|
121910
121947
|
var supportedExtensionTypes = (0, AgentsRegistry_1.getSupportedExtensionTypes)();
|
|
121911
121948
|
var CurrentExtensionSchema = zod_1.z.object({
|
|
121912
|
-
extensionType: zod_1.z.enum(
|
|
121949
|
+
extensionType: zod_1.z.enum(codegen_common_logic_1.codeGenerationExtensionTypes).describe("The extension kind to trigger"),
|
|
121913
121950
|
name: zod_1.z.string().describe("A descriptive name for this extension"),
|
|
121914
121951
|
relatedSpis: zod_1.z.array(zod_1.z.string()).optional().describe("Optional value, only for SPI extensions - specify the SPI types"),
|
|
121915
121952
|
paths: zod_1.z.array(zod_1.z.string()).describe("Paths relevant for this extension"),
|
|
121916
121953
|
relevantUserRequest: zod_1.z.string().describe("What part of the user request this extension should do, do not reference other extensions.")
|
|
121917
121954
|
});
|
|
121918
121955
|
var AdditionalExtensionSchema = zod_1.z.object({
|
|
121919
|
-
extensionType: zod_1.z.enum(
|
|
121956
|
+
extensionType: zod_1.z.enum(codegen_common_logic_1.codeGenerationExtensionTypes).describe("The extension kind to add"),
|
|
121920
121957
|
name: zod_1.z.string().describe("A descriptive name for this extension"),
|
|
121921
121958
|
relatedSpis: zod_1.z.array(zod_1.z.string()).optional().describe("Optional value, only for SPI extensions - specify the SPI types"),
|
|
121922
121959
|
relevantUserRequest: zod_1.z.string().describe("What part of the user request this extension should do, do not reference other extensions.")
|
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.132",
|
|
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": "1bc006685dbca30953ee68ff676a0a93e320daa3e8b3c97b21dbe579"
|
|
28
28
|
}
|