@wix/ditto-codegen-public 1.0.130 → 1.0.131

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 (2) hide show
  1. package/dist/out.js +29 -3
  2. 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
- return result.object;
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.130",
3
+ "version": "1.0.131",
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": "78942b69a46cc63f99bb94dc7ed14bdc1baa5a580f9184768d55c969"
27
+ "falconPackageHash": "a077e8a8144f4e64fc6ddeb47287c87732f0b70c2d99c29dbab13874"
28
28
  }