@wix/ditto-codegen-public 1.0.183 → 1.0.184

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 +69 -56
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -21011,6 +21011,7 @@ var require_dist5 = __commonJS({
21011
21011
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
21012
21012
  var src_exports = {};
21013
21013
  __export2(src_exports, {
21014
+ DelayedPromise: () => DelayedPromise,
21014
21015
  EventSourceParserStream: () => import_stream2.EventSourceParserStream,
21015
21016
  VERSION: () => VERSION2,
21016
21017
  asSchema: () => asSchema2,
@@ -21142,6 +21143,51 @@ var require_dist5 = __commonJS({
21142
21143
  function createAbortError() {
21143
21144
  return new DOMException("Delay was aborted", "AbortError");
21144
21145
  }
21146
+ var DelayedPromise = class {
21147
+ constructor() {
21148
+ this.status = { type: "pending" };
21149
+ this._resolve = void 0;
21150
+ this._reject = void 0;
21151
+ }
21152
+ get promise() {
21153
+ if (this._promise) {
21154
+ return this._promise;
21155
+ }
21156
+ this._promise = new Promise((resolve2, reject) => {
21157
+ if (this.status.type === "resolved") {
21158
+ resolve2(this.status.value);
21159
+ } else if (this.status.type === "rejected") {
21160
+ reject(this.status.error);
21161
+ }
21162
+ this._resolve = resolve2;
21163
+ this._reject = reject;
21164
+ });
21165
+ return this._promise;
21166
+ }
21167
+ resolve(value) {
21168
+ var _a;
21169
+ this.status = { type: "resolved", value };
21170
+ if (this._promise) {
21171
+ (_a = this._resolve) == null ? void 0 : _a.call(this, value);
21172
+ }
21173
+ }
21174
+ reject(error) {
21175
+ var _a;
21176
+ this.status = { type: "rejected", error };
21177
+ if (this._promise) {
21178
+ (_a = this._reject) == null ? void 0 : _a.call(this, error);
21179
+ }
21180
+ }
21181
+ isResolved() {
21182
+ return this.status.type === "resolved";
21183
+ }
21184
+ isRejected() {
21185
+ return this.status.type === "rejected";
21186
+ }
21187
+ isPending() {
21188
+ return this.status.type === "pending";
21189
+ }
21190
+ };
21145
21191
  function extractResponseHeaders(response) {
21146
21192
  return Object.fromEntries([...response.headers]);
21147
21193
  }
@@ -21260,7 +21306,7 @@ var require_dist5 = __commonJS({
21260
21306
  );
21261
21307
  return Object.fromEntries(normalizedHeaders.entries());
21262
21308
  }
21263
- var VERSION2 = true ? "3.0.17" : "0.0.0-test";
21309
+ var VERSION2 = true ? "3.0.18" : "0.0.0-test";
21264
21310
  var getOriginalFetch = () => globalThis.fetch;
21265
21311
  var getFromApi = async ({
21266
21312
  url,
@@ -24400,7 +24446,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
24400
24446
  this.modelId = modelId;
24401
24447
  this.config = config;
24402
24448
  this.specificationVersion = "v2";
24403
- this.maxImagesPerCall = 4;
24449
+ this.maxImagesPerCall = Number.MAX_SAFE_INTEGER;
24404
24450
  }
24405
24451
  get provider() {
24406
24452
  return this.config.provider;
@@ -24436,7 +24482,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
24436
24482
  ...size && { size },
24437
24483
  ...aspectRatio && { aspectRatio },
24438
24484
  ...seed && { seed },
24439
- ...providerOptions != null ? providerOptions : {}
24485
+ ...providerOptions && { providerOptions }
24440
24486
  },
24441
24487
  successfulResponseHandler: (0, import_provider_utils7.createJsonResponseHandler)(
24442
24488
  gatewayImageResponseSchema
@@ -24494,7 +24540,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
24494
24540
  return (_a8 = (0, import_oidc.getContext)().headers) == null ? void 0 : _a8["x-vercel-id"];
24495
24541
  }
24496
24542
  var import_provider_utils9 = require_dist5();
24497
- var VERSION2 = true ? "2.0.12" : "0.0.0-test";
24543
+ var VERSION2 = true ? "2.0.17" : "0.0.0-test";
24498
24544
  var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
24499
24545
  function createGatewayProvider(options = {}) {
24500
24546
  var _a8, _b8;
@@ -26999,7 +27045,7 @@ var require_dist8 = __commonJS({
26999
27045
  return void 0;
27000
27046
  }
27001
27047
  var import_provider_utils2 = require_dist5();
27002
- var VERSION2 = true ? "5.0.97" : "0.0.0-test";
27048
+ var VERSION2 = true ? "5.0.105" : "0.0.0-test";
27003
27049
  var download = async ({ url }) => {
27004
27050
  var _a16;
27005
27051
  const urlText = url.toString();
@@ -28123,7 +28169,8 @@ var require_dist8 = __commonJS({
28123
28169
  input,
28124
28170
  dynamic: true,
28125
28171
  invalid: true,
28126
- error
28172
+ error,
28173
+ providerMetadata: toolCall.providerMetadata
28127
28174
  };
28128
28175
  }
28129
28176
  }
@@ -30332,42 +30379,6 @@ var require_dist8 = __commonJS({
30332
30379
  terminate
30333
30380
  };
30334
30381
  }
30335
- var DelayedPromise = class {
30336
- constructor() {
30337
- this.status = { type: "pending" };
30338
- this._resolve = void 0;
30339
- this._reject = void 0;
30340
- }
30341
- get promise() {
30342
- if (this._promise) {
30343
- return this._promise;
30344
- }
30345
- this._promise = new Promise((resolve2, reject) => {
30346
- if (this.status.type === "resolved") {
30347
- resolve2(this.status.value);
30348
- } else if (this.status.type === "rejected") {
30349
- reject(this.status.error);
30350
- }
30351
- this._resolve = resolve2;
30352
- this._reject = reject;
30353
- });
30354
- return this._promise;
30355
- }
30356
- resolve(value) {
30357
- var _a16;
30358
- this.status = { type: "resolved", value };
30359
- if (this._promise) {
30360
- (_a16 = this._resolve) == null ? void 0 : _a16.call(this, value);
30361
- }
30362
- }
30363
- reject(error) {
30364
- var _a16;
30365
- this.status = { type: "rejected", error };
30366
- if (this._promise) {
30367
- (_a16 = this._reject) == null ? void 0 : _a16.call(this, error);
30368
- }
30369
- }
30370
- };
30371
30382
  function now() {
30372
30383
  var _a16, _b;
30373
30384
  return (_b = (_a16 = globalThis == null ? void 0 : globalThis.performance) == null ? void 0 : _a16.now()) != null ? _b : Date.now();
@@ -30783,9 +30794,9 @@ var require_dist8 = __commonJS({
30783
30794
  experimental_context,
30784
30795
  download: download2
30785
30796
  }) {
30786
- this._totalUsage = new DelayedPromise();
30787
- this._finishReason = new DelayedPromise();
30788
- this._steps = new DelayedPromise();
30797
+ this._totalUsage = new import_provider_utils15.DelayedPromise();
30798
+ this._finishReason = new import_provider_utils15.DelayedPromise();
30799
+ this._steps = new import_provider_utils15.DelayedPromise();
30789
30800
  this.output = output;
30790
30801
  this.includeRawChunks = includeRawChunks;
30791
30802
  this.tools = tools;
@@ -31095,7 +31106,7 @@ var require_dist8 = __commonJS({
31095
31106
  }) {
31096
31107
  var _a16, _b, _c, _d, _e;
31097
31108
  const includeRawChunks2 = self2.includeRawChunks;
31098
- stepFinish = new DelayedPromise();
31109
+ stepFinish = new import_provider_utils15.DelayedPromise();
31099
31110
  const initialPrompt = await standardizePrompt({
31100
31111
  system,
31101
31112
  prompt,
@@ -32061,7 +32072,8 @@ var require_dist8 = __commonJS({
32061
32072
  output: part.state === "output-error" ? part.errorText : part.output,
32062
32073
  tool: (_b = options == null ? void 0 : options.tools) == null ? void 0 : _b[toolName],
32063
32074
  errorMode: part.state === "output-error" ? "json" : "none"
32064
- })
32075
+ }),
32076
+ ...part.callProviderMetadata != null ? { providerOptions: part.callProviderMetadata } : {}
32065
32077
  });
32066
32078
  }
32067
32079
  }
@@ -32102,7 +32114,8 @@ var require_dist8 = __commonJS({
32102
32114
  output: toolPart.state === "output-error" ? toolPart.errorText : toolPart.output,
32103
32115
  tool: (_a17 = options == null ? void 0 : options.tools) == null ? void 0 : _a17[toolName],
32104
32116
  errorMode: toolPart.state === "output-error" ? "text" : "none"
32105
- })
32117
+ }),
32118
+ ...toolPart.callProviderMetadata != null ? { providerOptions: toolPart.callProviderMetadata } : {}
32106
32119
  };
32107
32120
  }
32108
32121
  default: {
@@ -33557,13 +33570,13 @@ var require_dist8 = __commonJS({
33557
33570
  currentDate,
33558
33571
  now: now2
33559
33572
  }) {
33560
- this._object = new DelayedPromise();
33561
- this._usage = new DelayedPromise();
33562
- this._providerMetadata = new DelayedPromise();
33563
- this._warnings = new DelayedPromise();
33564
- this._request = new DelayedPromise();
33565
- this._response = new DelayedPromise();
33566
- this._finishReason = new DelayedPromise();
33573
+ this._object = new import_provider_utils23.DelayedPromise();
33574
+ this._usage = new import_provider_utils23.DelayedPromise();
33575
+ this._providerMetadata = new import_provider_utils23.DelayedPromise();
33576
+ this._warnings = new import_provider_utils23.DelayedPromise();
33577
+ this._request = new import_provider_utils23.DelayedPromise();
33578
+ this._response = new import_provider_utils23.DelayedPromise();
33579
+ this._finishReason = new import_provider_utils23.DelayedPromise();
33567
33580
  const model = resolveLanguageModel(modelArg);
33568
33581
  const { maxRetries, retry } = prepareRetries({
33569
33582
  maxRetries: maxRetriesArg,
@@ -34185,7 +34198,7 @@ var require_dist8 = __commonJS({
34185
34198
  const keptToolCallIds = /* @__PURE__ */ new Set();
34186
34199
  const keptApprovalIds = /* @__PURE__ */ new Set();
34187
34200
  if (keepLastMessagesCount != null) {
34188
- for (const message of messages.slice(0, -keepLastMessagesCount)) {
34201
+ for (const message of messages.slice(-keepLastMessagesCount)) {
34189
34202
  if ((message.role === "assistant" || message.role === "tool") && typeof message.content !== "string") {
34190
34203
  for (const part of message.content) {
34191
34204
  if (part.type === "tool-call" || part.type === "tool-result") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.183",
3
+ "version": "1.0.184",
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": "4dda91599e3e7aacc90417a2c99a0c0c293c409b3a4ac6293f97cae0"
27
+ "falconPackageHash": "874c111fc543270c584e73fd2f7d89fc6888036010d6653e667fad6a"
28
28
  }