@get-bb/plugin-sdk 0.4.88 → 0.4.97

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.
@@ -34,6 +34,517 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
  mod
35
35
  ));
36
36
 
37
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js
38
+ var require_debug = __commonJS({
39
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js"(exports, module) {
40
+ "use strict";
41
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
42
+ };
43
+ module.exports = debug;
44
+ }
45
+ });
46
+
47
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
48
+ var require_constants = __commonJS({
49
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js"(exports, module) {
50
+ "use strict";
51
+ var SEMVER_SPEC_VERSION = "2.0.0";
52
+ var MAX_LENGTH = 256;
53
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
54
+ 9007199254740991;
55
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
56
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
57
+ var RELEASE_TYPES = [
58
+ "major",
59
+ "premajor",
60
+ "minor",
61
+ "preminor",
62
+ "patch",
63
+ "prepatch",
64
+ "prerelease"
65
+ ];
66
+ module.exports = {
67
+ MAX_LENGTH,
68
+ MAX_SAFE_COMPONENT_LENGTH,
69
+ MAX_SAFE_BUILD_LENGTH,
70
+ MAX_SAFE_INTEGER,
71
+ RELEASE_TYPES,
72
+ SEMVER_SPEC_VERSION,
73
+ FLAG_INCLUDE_PRERELEASE: 1,
74
+ FLAG_LOOSE: 2
75
+ };
76
+ }
77
+ });
78
+
79
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js
80
+ var require_re = __commonJS({
81
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js"(exports, module) {
82
+ "use strict";
83
+ var {
84
+ MAX_SAFE_COMPONENT_LENGTH,
85
+ MAX_SAFE_BUILD_LENGTH,
86
+ MAX_LENGTH
87
+ } = require_constants();
88
+ var debug = require_debug();
89
+ exports = module.exports = {};
90
+ var re = exports.re = [];
91
+ var safeRe = exports.safeRe = [];
92
+ var src = exports.src = [];
93
+ var safeSrc = exports.safeSrc = [];
94
+ var t = exports.t = {};
95
+ var R = 0;
96
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
97
+ var safeRegexReplacements = [
98
+ ["\\s", 1],
99
+ ["\\d", MAX_LENGTH],
100
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
101
+ ];
102
+ var makeSafeRegex = (value) => {
103
+ for (const [token, max] of safeRegexReplacements) {
104
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
105
+ }
106
+ return value;
107
+ };
108
+ var createToken = (name, value, isGlobal) => {
109
+ const safe = makeSafeRegex(value);
110
+ const index = R++;
111
+ debug(name, index, value);
112
+ t[name] = index;
113
+ src[index] = value;
114
+ safeSrc[index] = safe;
115
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
116
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
117
+ };
118
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
119
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
120
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
121
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
122
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
123
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
124
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
125
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
126
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
127
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
128
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
129
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
130
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
131
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
132
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
133
+ createToken("GTLT", "((?:<|>)?=?)");
134
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
135
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
136
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
137
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
138
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
139
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
140
+ createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
141
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
142
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
143
+ createToken("COERCERTL", src[t.COERCE], true);
144
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
145
+ createToken("LONETILDE", "(?:~>?)");
146
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
147
+ exports.tildeTrimReplace = "$1~";
148
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
149
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
150
+ createToken("LONECARET", "(?:\\^)");
151
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
152
+ exports.caretTrimReplace = "$1^";
153
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
154
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
155
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
156
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
157
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
158
+ exports.comparatorTrimReplace = "$1$2$3";
159
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
160
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
161
+ createToken("STAR", "(<|>)?=?\\s*\\*");
162
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
163
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
164
+ }
165
+ });
166
+
167
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js
168
+ var require_parse_options = __commonJS({
169
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js"(exports, module) {
170
+ "use strict";
171
+ var looseOption = Object.freeze({ loose: true });
172
+ var emptyOpts = Object.freeze({});
173
+ var parseOptions = (options) => {
174
+ if (!options) {
175
+ return emptyOpts;
176
+ }
177
+ if (typeof options !== "object") {
178
+ return looseOption;
179
+ }
180
+ return options;
181
+ };
182
+ module.exports = parseOptions;
183
+ }
184
+ });
185
+
186
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js
187
+ var require_identifiers = __commonJS({
188
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js"(exports, module) {
189
+ "use strict";
190
+ var numeric = /^[0-9]+$/;
191
+ var compareIdentifiers = (a, b) => {
192
+ if (typeof a === "number" && typeof b === "number") {
193
+ return a === b ? 0 : a < b ? -1 : 1;
194
+ }
195
+ const anum = numeric.test(a);
196
+ const bnum = numeric.test(b);
197
+ if (anum && bnum) {
198
+ a = +a;
199
+ b = +b;
200
+ }
201
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
202
+ };
203
+ var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
204
+ module.exports = {
205
+ compareIdentifiers,
206
+ rcompareIdentifiers
207
+ };
208
+ }
209
+ });
210
+
211
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js
212
+ var require_semver = __commonJS({
213
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js"(exports, module) {
214
+ "use strict";
215
+ var debug = require_debug();
216
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
217
+ var { safeRe: re, t } = require_re();
218
+ var parseOptions = require_parse_options();
219
+ var { compareIdentifiers } = require_identifiers();
220
+ var isPrereleaseIdentifier = (prerelease, identifier) => {
221
+ const identifiers = identifier.split(".");
222
+ if (identifiers.length > prerelease.length) {
223
+ return false;
224
+ }
225
+ for (let i = 0; i < identifiers.length; i++) {
226
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
227
+ return false;
228
+ }
229
+ }
230
+ return true;
231
+ };
232
+ var SemVer = class _SemVer {
233
+ constructor(version, options) {
234
+ options = parseOptions(options);
235
+ if (version instanceof _SemVer) {
236
+ if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
237
+ return version;
238
+ } else {
239
+ version = version.version;
240
+ }
241
+ } else if (typeof version !== "string") {
242
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
243
+ }
244
+ if (version.length > MAX_LENGTH) {
245
+ throw new TypeError(
246
+ `version is longer than ${MAX_LENGTH} characters`
247
+ );
248
+ }
249
+ debug("SemVer", version, options);
250
+ this.options = options;
251
+ this.loose = !!options.loose;
252
+ this.includePrerelease = !!options.includePrerelease;
253
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
254
+ if (!m) {
255
+ throw new TypeError(`Invalid Version: ${version}`);
256
+ }
257
+ this.raw = version;
258
+ this.major = +m[1];
259
+ this.minor = +m[2];
260
+ this.patch = +m[3];
261
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
262
+ throw new TypeError("Invalid major version");
263
+ }
264
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
265
+ throw new TypeError("Invalid minor version");
266
+ }
267
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
268
+ throw new TypeError("Invalid patch version");
269
+ }
270
+ if (!m[4]) {
271
+ this.prerelease = [];
272
+ } else {
273
+ this.prerelease = m[4].split(".").map((id) => {
274
+ if (/^[0-9]+$/.test(id)) {
275
+ const num = +id;
276
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
277
+ return num;
278
+ }
279
+ }
280
+ return id;
281
+ });
282
+ }
283
+ this.build = m[5] ? m[5].split(".") : [];
284
+ this.format();
285
+ }
286
+ format() {
287
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
288
+ if (this.prerelease.length) {
289
+ this.version += `-${this.prerelease.join(".")}`;
290
+ }
291
+ return this.version;
292
+ }
293
+ toString() {
294
+ return this.version;
295
+ }
296
+ compare(other) {
297
+ debug("SemVer.compare", this.version, this.options, other);
298
+ if (!(other instanceof _SemVer)) {
299
+ if (typeof other === "string" && other === this.version) {
300
+ return 0;
301
+ }
302
+ other = new _SemVer(other, this.options);
303
+ }
304
+ if (other.version === this.version) {
305
+ return 0;
306
+ }
307
+ return this.compareMain(other) || this.comparePre(other);
308
+ }
309
+ compareMain(other) {
310
+ if (!(other instanceof _SemVer)) {
311
+ other = new _SemVer(other, this.options);
312
+ }
313
+ if (this.major < other.major) {
314
+ return -1;
315
+ }
316
+ if (this.major > other.major) {
317
+ return 1;
318
+ }
319
+ if (this.minor < other.minor) {
320
+ return -1;
321
+ }
322
+ if (this.minor > other.minor) {
323
+ return 1;
324
+ }
325
+ if (this.patch < other.patch) {
326
+ return -1;
327
+ }
328
+ if (this.patch > other.patch) {
329
+ return 1;
330
+ }
331
+ return 0;
332
+ }
333
+ comparePre(other) {
334
+ if (!(other instanceof _SemVer)) {
335
+ other = new _SemVer(other, this.options);
336
+ }
337
+ if (this.prerelease.length && !other.prerelease.length) {
338
+ return -1;
339
+ } else if (!this.prerelease.length && other.prerelease.length) {
340
+ return 1;
341
+ } else if (!this.prerelease.length && !other.prerelease.length) {
342
+ return 0;
343
+ }
344
+ let i = 0;
345
+ do {
346
+ const a = this.prerelease[i];
347
+ const b = other.prerelease[i];
348
+ debug("prerelease compare", i, a, b);
349
+ if (a === void 0 && b === void 0) {
350
+ return 0;
351
+ } else if (b === void 0) {
352
+ return 1;
353
+ } else if (a === void 0) {
354
+ return -1;
355
+ } else if (a === b) {
356
+ continue;
357
+ } else {
358
+ return compareIdentifiers(a, b);
359
+ }
360
+ } while (++i);
361
+ }
362
+ compareBuild(other) {
363
+ if (!(other instanceof _SemVer)) {
364
+ other = new _SemVer(other, this.options);
365
+ }
366
+ let i = 0;
367
+ do {
368
+ const a = this.build[i];
369
+ const b = other.build[i];
370
+ debug("build compare", i, a, b);
371
+ if (a === void 0 && b === void 0) {
372
+ return 0;
373
+ } else if (b === void 0) {
374
+ return 1;
375
+ } else if (a === void 0) {
376
+ return -1;
377
+ } else if (a === b) {
378
+ continue;
379
+ } else {
380
+ return compareIdentifiers(a, b);
381
+ }
382
+ } while (++i);
383
+ }
384
+ // preminor will bump the version up to the next minor release, and immediately
385
+ // down to pre-release. premajor and prepatch work the same way.
386
+ inc(release, identifier, identifierBase) {
387
+ if (release.startsWith("pre")) {
388
+ if (!identifier && identifierBase === false) {
389
+ throw new Error("invalid increment argument: identifier is empty");
390
+ }
391
+ if (identifier) {
392
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
393
+ if (!match || match[1] !== identifier) {
394
+ throw new Error(`invalid identifier: ${identifier}`);
395
+ }
396
+ }
397
+ }
398
+ switch (release) {
399
+ case "premajor":
400
+ this.prerelease.length = 0;
401
+ this.patch = 0;
402
+ this.minor = 0;
403
+ this.major++;
404
+ this.inc("pre", identifier, identifierBase);
405
+ break;
406
+ case "preminor":
407
+ this.prerelease.length = 0;
408
+ this.patch = 0;
409
+ this.minor++;
410
+ this.inc("pre", identifier, identifierBase);
411
+ break;
412
+ case "prepatch":
413
+ this.prerelease.length = 0;
414
+ this.inc("patch", identifier, identifierBase);
415
+ this.inc("pre", identifier, identifierBase);
416
+ break;
417
+ // If the input is a non-prerelease version, this acts the same as
418
+ // prepatch.
419
+ case "prerelease":
420
+ if (this.prerelease.length === 0) {
421
+ this.inc("patch", identifier, identifierBase);
422
+ }
423
+ this.inc("pre", identifier, identifierBase);
424
+ break;
425
+ case "release":
426
+ if (this.prerelease.length === 0) {
427
+ throw new Error(`version ${this.raw} is not a prerelease`);
428
+ }
429
+ this.prerelease.length = 0;
430
+ break;
431
+ case "major":
432
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
433
+ this.major++;
434
+ }
435
+ this.minor = 0;
436
+ this.patch = 0;
437
+ this.prerelease = [];
438
+ break;
439
+ case "minor":
440
+ if (this.patch !== 0 || this.prerelease.length === 0) {
441
+ this.minor++;
442
+ }
443
+ this.patch = 0;
444
+ this.prerelease = [];
445
+ break;
446
+ case "patch":
447
+ if (this.prerelease.length === 0) {
448
+ this.patch++;
449
+ }
450
+ this.prerelease = [];
451
+ break;
452
+ // This probably shouldn't be used publicly.
453
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
454
+ case "pre": {
455
+ const base = Number(identifierBase) ? 1 : 0;
456
+ if (this.prerelease.length === 0) {
457
+ this.prerelease = [base];
458
+ } else {
459
+ let i = this.prerelease.length;
460
+ while (--i >= 0) {
461
+ if (typeof this.prerelease[i] === "number") {
462
+ this.prerelease[i]++;
463
+ i = -2;
464
+ }
465
+ }
466
+ if (i === -1) {
467
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
468
+ throw new Error("invalid increment argument: identifier already exists");
469
+ }
470
+ this.prerelease.push(base);
471
+ }
472
+ }
473
+ if (identifier) {
474
+ let prerelease = [identifier, base];
475
+ if (identifierBase === false) {
476
+ prerelease = [identifier];
477
+ }
478
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
479
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
480
+ if (isNaN(prereleaseBase)) {
481
+ this.prerelease = prerelease;
482
+ }
483
+ } else {
484
+ this.prerelease = prerelease;
485
+ }
486
+ }
487
+ break;
488
+ }
489
+ default:
490
+ throw new Error(`invalid increment argument: ${release}`);
491
+ }
492
+ this.raw = this.format();
493
+ if (this.build.length) {
494
+ this.raw += `+${this.build.join(".")}`;
495
+ }
496
+ return this;
497
+ }
498
+ };
499
+ module.exports = SemVer;
500
+ }
501
+ });
502
+
503
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js
504
+ var require_compare = __commonJS({
505
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js"(exports, module) {
506
+ "use strict";
507
+ var SemVer = require_semver();
508
+ var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
509
+ module.exports = compare;
510
+ }
511
+ });
512
+
513
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js
514
+ var require_parse = __commonJS({
515
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports, module) {
516
+ "use strict";
517
+ var SemVer = require_semver();
518
+ var parse = (version, options, throwErrors = false) => {
519
+ if (version instanceof SemVer) {
520
+ return version;
521
+ }
522
+ try {
523
+ return new SemVer(version, options);
524
+ } catch (er) {
525
+ if (!throwErrors) {
526
+ return null;
527
+ }
528
+ throw er;
529
+ }
530
+ };
531
+ module.exports = parse;
532
+ }
533
+ });
534
+
535
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js
536
+ var require_valid = __commonJS({
537
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports, module) {
538
+ "use strict";
539
+ var parse = require_parse();
540
+ var valid = (version, options) => {
541
+ const v = parse(version, options);
542
+ return v ? v.version : null;
543
+ };
544
+ module.exports = valid;
545
+ }
546
+ });
547
+
37
548
  // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
38
549
  var require_windows = __commonJS({
39
550
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
@@ -393,7 +904,7 @@ var require_readShebang = __commonJS({
393
904
  });
394
905
 
395
906
  // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
396
- var require_parse = __commonJS({
907
+ var require_parse2 = __commonJS({
397
908
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
398
909
  "use strict";
399
910
  var path2 = __require("path");
@@ -509,7 +1020,7 @@ var require_cross_spawn = __commonJS({
509
1020
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module) {
510
1021
  "use strict";
511
1022
  var cp = __require("child_process");
512
- var parse = require_parse();
1023
+ var parse = require_parse2();
513
1024
  var enoent = require_enoent();
514
1025
  function spawn(command, args, options) {
515
1026
  const parsed = parse(command, args, options);
@@ -679,6 +1190,12 @@ function addTokenUsage(total, last) {
679
1190
  totalTokens: total.totalTokens + last.totalTokens,
680
1191
  inputTokens: total.inputTokens + last.inputTokens,
681
1192
  cachedInputTokens: total.cachedInputTokens + last.cachedInputTokens,
1193
+ ...total.cacheReadInputTokens === void 0 && last.cacheReadInputTokens === void 0 ? {} : {
1194
+ cacheReadInputTokens: (total.cacheReadInputTokens ?? 0) + (last.cacheReadInputTokens ?? 0)
1195
+ },
1196
+ ...total.cacheWriteInputTokens === void 0 && last.cacheWriteInputTokens === void 0 ? {} : {
1197
+ cacheWriteInputTokens: (total.cacheWriteInputTokens ?? 0) + (last.cacheWriteInputTokens ?? 0)
1198
+ },
682
1199
  outputTokens: total.outputTokens + last.outputTokens,
683
1200
  reasoningOutputTokens: total.reasoningOutputTokens + last.reasoningOutputTokens
684
1201
  };
@@ -1016,7 +1533,7 @@ function withoutBridgeRuntimeEnv(env) {
1016
1533
  }
1017
1534
 
1018
1535
  // ../provider-bridge-protocol/src/bridge-kit/bridge-tool-calls.ts
1019
- import { z as z21 } from "zod";
1536
+ import { z as z22 } from "zod";
1020
1537
 
1021
1538
  // ../domain/src/context-snapshot.ts
1022
1539
  import { z as z3 } from "zod";
@@ -1645,8 +2162,13 @@ var providerNativeRootSetSchema = z7.object({
1645
2162
  resolved: providerResolvedNativeRootsSchema
1646
2163
  }).strict();
1647
2164
 
1648
- // ../domain/src/background-task.ts
2165
+ // ../domain/src/completed-turn-display.ts
1649
2166
  import { z as z8 } from "zod";
2167
+ var COMPLETED_TURN_DISPLAY_VALUES = ["collapse", "flat"];
2168
+ var completedTurnDisplaySchema = z8.enum(COMPLETED_TURN_DISPLAY_VALUES);
2169
+
2170
+ // ../domain/src/background-task.ts
2171
+ import { z as z9 } from "zod";
1650
2172
  var LOCAL_WORKFLOW_TASK_TYPE = "local_workflow";
1651
2173
  var LOCAL_BASH_TASK_TYPE = "local_bash";
1652
2174
  var LOCAL_AGENT_TASK_TYPE = "local_agent";
@@ -1663,7 +2185,7 @@ var backgroundTaskStatusValues = [
1663
2185
  "killed",
1664
2186
  "stopped"
1665
2187
  ];
1666
- var backgroundTaskStatusSchema = z8.enum(backgroundTaskStatusValues);
2188
+ var backgroundTaskStatusSchema = z9.enum(backgroundTaskStatusValues);
1667
2189
  var workflowAgentStateValues = [
1668
2190
  "queued",
1669
2191
  "running",
@@ -1671,43 +2193,43 @@ var workflowAgentStateValues = [
1671
2193
  "failed",
1672
2194
  "skipped"
1673
2195
  ];
1674
- var workflowAgentStateSchema = z8.enum(workflowAgentStateValues);
1675
- var workflowAgentSnapshotSchema = z8.object({
1676
- index: z8.number().int().positive(),
1677
- label: z8.string(),
2196
+ var workflowAgentStateSchema = z9.enum(workflowAgentStateValues);
2197
+ var workflowAgentSnapshotSchema = z9.object({
2198
+ index: z9.number().int().positive(),
2199
+ label: z9.string(),
1678
2200
  state: workflowAgentStateSchema,
1679
- model: z8.string(),
1680
- attempt: z8.number().int().positive(),
1681
- cached: z8.boolean(),
1682
- lastProgressAt: z8.number(),
1683
- phaseIndex: z8.number().int().positive().optional(),
1684
- phaseTitle: z8.string().optional(),
1685
- agentType: z8.string().optional(),
1686
- isolation: z8.string().optional(),
1687
- queuedAt: z8.number().optional(),
1688
- startedAt: z8.number().optional(),
1689
- lastToolName: z8.string().optional(),
1690
- lastToolSummary: z8.string().optional(),
1691
- promptPreview: z8.string().optional(),
1692
- resultPreview: z8.string().optional(),
1693
- error: z8.string().optional(),
1694
- tokens: z8.number().optional(),
1695
- toolCalls: z8.number().optional(),
1696
- durationMs: z8.number().optional()
1697
- });
1698
- var workflowPhaseSnapshotSchema = z8.object({
1699
- index: z8.number().int().positive(),
1700
- title: z8.string(),
1701
- kind: z8.string().optional()
1702
- });
1703
- var workflowProgressSnapshotSchema = z8.object({
1704
- phases: z8.array(workflowPhaseSnapshotSchema),
1705
- agents: z8.array(workflowAgentSnapshotSchema)
1706
- });
1707
- var backgroundTaskUsageSchema = z8.object({
1708
- totalTokens: z8.number(),
1709
- toolUses: z8.number(),
1710
- durationMs: z8.number()
2201
+ model: z9.string(),
2202
+ attempt: z9.number().int().positive(),
2203
+ cached: z9.boolean(),
2204
+ lastProgressAt: z9.number(),
2205
+ phaseIndex: z9.number().int().positive().optional(),
2206
+ phaseTitle: z9.string().optional(),
2207
+ agentType: z9.string().optional(),
2208
+ isolation: z9.string().optional(),
2209
+ queuedAt: z9.number().optional(),
2210
+ startedAt: z9.number().optional(),
2211
+ lastToolName: z9.string().optional(),
2212
+ lastToolSummary: z9.string().optional(),
2213
+ promptPreview: z9.string().optional(),
2214
+ resultPreview: z9.string().optional(),
2215
+ error: z9.string().optional(),
2216
+ tokens: z9.number().optional(),
2217
+ toolCalls: z9.number().optional(),
2218
+ durationMs: z9.number().optional()
2219
+ });
2220
+ var workflowPhaseSnapshotSchema = z9.object({
2221
+ index: z9.number().int().positive(),
2222
+ title: z9.string(),
2223
+ kind: z9.string().optional()
2224
+ });
2225
+ var workflowProgressSnapshotSchema = z9.object({
2226
+ phases: z9.array(workflowPhaseSnapshotSchema),
2227
+ agents: z9.array(workflowAgentSnapshotSchema)
2228
+ });
2229
+ var backgroundTaskUsageSchema = z9.object({
2230
+ totalTokens: z9.number(),
2231
+ toolUses: z9.number(),
2232
+ durationMs: z9.number()
1711
2233
  });
1712
2234
  function backgroundTaskItemStatus(taskStatus) {
1713
2235
  switch (taskStatus) {
@@ -1729,13 +2251,13 @@ function isSettledBackgroundTaskStatus(taskStatus) {
1729
2251
  }
1730
2252
 
1731
2253
  // ../domain/src/provider-event.ts
1732
- import { z as z17 } from "zod";
2254
+ import { z as z18 } from "zod";
1733
2255
 
1734
2256
  // ../domain/src/thread-events.ts
1735
- import { z as z14 } from "zod";
2257
+ import { z as z15 } from "zod";
1736
2258
 
1737
2259
  // ../domain/src/pending-interactions.ts
1738
- import { z as z11 } from "zod";
2260
+ import { z as z12 } from "zod";
1739
2261
 
1740
2262
  // ../domain/src/plugin-interaction-limits.ts
1741
2263
  var PLUGIN_INTERACTION_MAX_TITLE_LENGTH = 160;
@@ -1745,223 +2267,223 @@ function jsonByteLength(value) {
1745
2267
  }
1746
2268
 
1747
2269
  // ../domain/src/item-presentation.ts
1748
- import { z as z9 } from "zod";
2270
+ import { z as z10 } from "zod";
1749
2271
  var THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH = 280;
1750
- var threadEventItemPresentationLabelSchema = z9.object({
1751
- pending: z9.string().min(1),
1752
- completed: z9.string().min(1)
2272
+ var threadEventItemPresentationLabelSchema = z10.object({
2273
+ pending: z10.string().min(1),
2274
+ completed: z10.string().min(1)
1753
2275
  });
1754
- var threadEventItemPresentationIconSchema = z9.object({
1755
- glyph: z9.string().min(1)
2276
+ var threadEventItemPresentationIconSchema = z10.object({
2277
+ glyph: z10.string().min(1)
1756
2278
  });
1757
- var threadEventItemPresentationTintSchema = z9.object({
1758
- light: z9.string().min(1),
1759
- dark: z9.string().min(1)
2279
+ var threadEventItemPresentationTintSchema = z10.object({
2280
+ light: z10.string().min(1),
2281
+ dark: z10.string().min(1)
1760
2282
  });
1761
2283
  var THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH = 80;
1762
- var threadEventItemPresentationBadgeSchema = z9.object({
1763
- glyph: z9.string().min(1),
1764
- label: z9.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
1765
- hint: z9.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
1766
- tone: z9.enum(["neutral", "destructive"])
2284
+ var threadEventItemPresentationBadgeSchema = z10.object({
2285
+ glyph: z10.string().min(1),
2286
+ label: z10.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
2287
+ hint: z10.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
2288
+ tone: z10.enum(["neutral", "destructive"])
1767
2289
  });
1768
- var threadEventItemPresentationSchema = z9.object({
2290
+ var threadEventItemPresentationSchema = z10.object({
1769
2291
  label: threadEventItemPresentationLabelSchema,
1770
2292
  icon: threadEventItemPresentationIconSchema,
1771
- title: z9.string().optional(),
1772
- detail: z9.string().max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
1773
- suppress: z9.boolean().optional(),
2293
+ title: z10.string().optional(),
2294
+ detail: z10.string().max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
2295
+ suppress: z10.boolean().optional(),
1774
2296
  tint: threadEventItemPresentationTintSchema.optional(),
1775
2297
  badge: threadEventItemPresentationBadgeSchema.optional()
1776
2298
  });
1777
2299
 
1778
2300
  // ../domain/src/provider-extension-kind.ts
1779
- import { z as z10 } from "zod";
2301
+ import { z as z11 } from "zod";
1780
2302
  var EXTENSION_KIND_PATTERN = /^[a-z0-9-]+\/[a-z0-9-]+$/u;
1781
2303
  function isExtensionKind(value) {
1782
2304
  return EXTENSION_KIND_PATTERN.test(value);
1783
2305
  }
1784
- var extensionKindSchema = z10.string().refine(isExtensionKind, {
2306
+ var extensionKindSchema = z11.string().refine(isExtensionKind, {
1785
2307
  message: 'extension kinds are "<pluginId>/<name>" (lowercase letters, digits, and "-")'
1786
2308
  });
1787
2309
 
1788
2310
  // ../domain/src/pending-interactions.ts
1789
- var pendingInteractionStatusSchema = z11.enum([
2311
+ var pendingInteractionStatusSchema = z12.enum([
1790
2312
  "pending",
1791
2313
  "resolving",
1792
2314
  "resolved",
1793
2315
  "interrupted"
1794
2316
  ]);
1795
- var pendingInteractionCommandActionSchema = z11.discriminatedUnion(
2317
+ var pendingInteractionCommandActionSchema = z12.discriminatedUnion(
1796
2318
  "type",
1797
2319
  [
1798
- z11.object({
1799
- type: z11.literal("read"),
1800
- command: z11.string(),
1801
- name: z11.string(),
1802
- path: z11.string()
2320
+ z12.object({
2321
+ type: z12.literal("read"),
2322
+ command: z12.string(),
2323
+ name: z12.string(),
2324
+ path: z12.string()
1803
2325
  }),
1804
- z11.object({
1805
- type: z11.literal("listFiles"),
1806
- command: z11.string(),
1807
- path: z11.string().nullable()
2326
+ z12.object({
2327
+ type: z12.literal("listFiles"),
2328
+ command: z12.string(),
2329
+ path: z12.string().nullable()
1808
2330
  }),
1809
- z11.object({
1810
- type: z11.literal("search"),
1811
- command: z11.string(),
1812
- query: z11.string().nullable(),
1813
- path: z11.string().nullable()
2331
+ z12.object({
2332
+ type: z12.literal("search"),
2333
+ command: z12.string(),
2334
+ query: z12.string().nullable(),
2335
+ path: z12.string().nullable()
1814
2336
  }),
1815
- z11.object({
1816
- type: z11.literal("unknown"),
1817
- command: z11.string()
2337
+ z12.object({
2338
+ type: z12.literal("unknown"),
2339
+ command: z12.string()
1818
2340
  })
1819
2341
  ]
1820
2342
  );
1821
- var pendingInteractionNetworkPermissionsSchema = z11.object({
1822
- enabled: z11.boolean().nullable()
2343
+ var pendingInteractionNetworkPermissionsSchema = z12.object({
2344
+ enabled: z12.boolean().nullable()
1823
2345
  });
1824
- var pendingInteractionFileSystemPermissionsSchema = z11.object({
1825
- read: z11.array(z11.string()),
1826
- write: z11.array(z11.string())
2346
+ var pendingInteractionFileSystemPermissionsSchema = z12.object({
2347
+ read: z12.array(z12.string()),
2348
+ write: z12.array(z12.string())
1827
2349
  });
1828
- var pendingInteractionMacOsPreferencesPermissionSchema = z11.enum([
2350
+ var pendingInteractionMacOsPreferencesPermissionSchema = z12.enum([
1829
2351
  "none",
1830
2352
  "read_only",
1831
2353
  "read_write"
1832
2354
  ]);
1833
- var pendingInteractionMacOsContactsPermissionSchema = z11.enum([
2355
+ var pendingInteractionMacOsContactsPermissionSchema = z12.enum([
1834
2356
  "none",
1835
2357
  "read_only",
1836
2358
  "read_write"
1837
2359
  ]);
1838
- var pendingInteractionMacOsAutomationPermissionSchema = z11.union([
1839
- z11.literal("none"),
1840
- z11.literal("all"),
1841
- z11.object({
1842
- kind: z11.literal("bundle_ids"),
1843
- bundleIds: z11.array(z11.string())
2360
+ var pendingInteractionMacOsAutomationPermissionSchema = z12.union([
2361
+ z12.literal("none"),
2362
+ z12.literal("all"),
2363
+ z12.object({
2364
+ kind: z12.literal("bundle_ids"),
2365
+ bundleIds: z12.array(z12.string())
1844
2366
  })
1845
2367
  ]);
1846
- var pendingInteractionMacOsPermissionsSchema = z11.object({
2368
+ var pendingInteractionMacOsPermissionsSchema = z12.object({
1847
2369
  preferences: pendingInteractionMacOsPreferencesPermissionSchema,
1848
2370
  automations: pendingInteractionMacOsAutomationPermissionSchema,
1849
- launchServices: z11.boolean(),
1850
- accessibility: z11.boolean(),
1851
- calendar: z11.boolean(),
1852
- reminders: z11.boolean(),
2371
+ launchServices: z12.boolean(),
2372
+ accessibility: z12.boolean(),
2373
+ calendar: z12.boolean(),
2374
+ reminders: z12.boolean(),
1853
2375
  contacts: pendingInteractionMacOsContactsPermissionSchema
1854
2376
  });
1855
- var pendingInteractionRequestedPermissionProfileSchema = z11.object({
2377
+ var pendingInteractionRequestedPermissionProfileSchema = z12.object({
1856
2378
  network: pendingInteractionNetworkPermissionsSchema.nullable(),
1857
2379
  fileSystem: pendingInteractionFileSystemPermissionsSchema.nullable(),
1858
2380
  macos: pendingInteractionMacOsPermissionsSchema.nullable()
1859
2381
  });
1860
- var pendingInteractionGrantablePermissionProfileSchema = z11.object({
2382
+ var pendingInteractionGrantablePermissionProfileSchema = z12.object({
1861
2383
  network: pendingInteractionNetworkPermissionsSchema.nullable(),
1862
2384
  fileSystem: pendingInteractionFileSystemPermissionsSchema.nullable()
1863
2385
  }).strict();
1864
2386
  var pendingInteractionGrantedPermissionProfileSchema = pendingInteractionGrantablePermissionProfileSchema;
1865
- var pendingInteractionApprovalDecisionSchema = z11.enum([
2387
+ var pendingInteractionApprovalDecisionSchema = z12.enum([
1866
2388
  "allow_once",
1867
2389
  "allow_for_session",
1868
2390
  "deny"
1869
2391
  ]);
1870
- var pendingInteractionFileChangeWriteScopeSchema = z11.string().min(1);
1871
- var pendingInteractionCommandApprovalSubjectSchema = z11.object({
1872
- kind: z11.literal("command"),
1873
- itemId: z11.string().min(1),
1874
- command: z11.string().min(1),
1875
- cwd: z11.string().nullable(),
1876
- actions: z11.array(pendingInteractionCommandActionSchema),
2392
+ var pendingInteractionFileChangeWriteScopeSchema = z12.string().min(1);
2393
+ var pendingInteractionCommandApprovalSubjectSchema = z12.object({
2394
+ kind: z12.literal("command"),
2395
+ itemId: z12.string().min(1),
2396
+ command: z12.string().min(1),
2397
+ cwd: z12.string().nullable(),
2398
+ actions: z12.array(pendingInteractionCommandActionSchema),
1877
2399
  sessionGrant: pendingInteractionGrantablePermissionProfileSchema.nullable()
1878
2400
  });
1879
- var pendingInteractionFileChangeApprovalSubjectSchema = z11.object({
1880
- kind: z11.literal("file_change"),
1881
- itemId: z11.string().min(1),
2401
+ var pendingInteractionFileChangeApprovalSubjectSchema = z12.object({
2402
+ kind: z12.literal("file_change"),
2403
+ itemId: z12.string().min(1),
1882
2404
  writeScope: pendingInteractionFileChangeWriteScopeSchema.nullable(),
1883
2405
  sessionGrant: pendingInteractionGrantablePermissionProfileSchema.nullable()
1884
2406
  });
1885
- var pendingInteractionPermissionGrantApprovalSubjectSchema = z11.object({
1886
- kind: z11.literal("permission_grant"),
1887
- itemId: z11.string().min(1),
1888
- toolName: z11.string().nullable(),
2407
+ var pendingInteractionPermissionGrantApprovalSubjectSchema = z12.object({
2408
+ kind: z12.literal("permission_grant"),
2409
+ itemId: z12.string().min(1),
2410
+ toolName: z12.string().nullable(),
1889
2411
  permissions: pendingInteractionGrantablePermissionProfileSchema
1890
2412
  });
1891
- var pendingInteractionPlanApprovalSubjectSchema = z11.object({
1892
- kind: z11.literal("plan"),
1893
- itemId: z11.string().min(1),
1894
- plan: z11.string().min(1),
1895
- planFilePath: z11.string().min(1).nullable()
2413
+ var pendingInteractionPlanApprovalSubjectSchema = z12.object({
2414
+ kind: z12.literal("plan"),
2415
+ itemId: z12.string().min(1),
2416
+ plan: z12.string().min(1),
2417
+ planFilePath: z12.string().min(1).nullable()
1896
2418
  });
1897
- var pendingInteractionToolUseApprovalSubjectSchema = z11.object({
1898
- kind: z11.literal("tool_use"),
1899
- itemId: z11.string().min(1),
1900
- tool: z11.string().min(1),
2419
+ var pendingInteractionToolUseApprovalSubjectSchema = z12.object({
2420
+ kind: z12.literal("tool_use"),
2421
+ itemId: z12.string().min(1),
2422
+ tool: z12.string().min(1),
1901
2423
  presentation: threadEventItemPresentationSchema
1902
2424
  });
1903
- var pendingInteractionApprovalSubjectSchema = z11.discriminatedUnion("kind", [
2425
+ var pendingInteractionApprovalSubjectSchema = z12.discriminatedUnion("kind", [
1904
2426
  pendingInteractionCommandApprovalSubjectSchema,
1905
2427
  pendingInteractionFileChangeApprovalSubjectSchema,
1906
2428
  pendingInteractionPermissionGrantApprovalSubjectSchema,
1907
2429
  pendingInteractionPlanApprovalSubjectSchema,
1908
2430
  pendingInteractionToolUseApprovalSubjectSchema
1909
2431
  ]);
1910
- var approvalPendingInteractionPayloadSchema = z11.object({
1911
- kind: z11.literal("approval"),
2432
+ var approvalPendingInteractionPayloadSchema = z12.object({
2433
+ kind: z12.literal("approval"),
1912
2434
  subject: pendingInteractionApprovalSubjectSchema,
1913
- reason: z11.string().nullable(),
1914
- availableDecisions: z11.array(pendingInteractionApprovalDecisionSchema).min(1)
2435
+ reason: z12.string().nullable(),
2436
+ availableDecisions: z12.array(pendingInteractionApprovalDecisionSchema).min(1)
1915
2437
  });
1916
2438
  var USER_QUESTION_MAX_QUESTIONS = 4;
1917
2439
  var USER_QUESTION_MAX_OPTIONS = 4;
1918
2440
  var USER_QUESTION_MAX_SELECTED = 4;
1919
2441
  var USER_QUESTION_MAX_FREE_TEXT_LENGTH = 4096;
1920
- var pendingInteractionUserQuestionIdSchema = z11.string().min(1).refine((value) => value.trim().length > 0, {
2442
+ var pendingInteractionUserQuestionIdSchema = z12.string().min(1).refine((value) => value.trim().length > 0, {
1921
2443
  message: "User question ids cannot be blank"
1922
2444
  });
1923
- var pendingInteractionUserQuestionPromptSchema = z11.string().min(1).refine((value) => value.trim().length > 0, {
2445
+ var pendingInteractionUserQuestionPromptSchema = z12.string().min(1).refine((value) => value.trim().length > 0, {
1924
2446
  message: "User question prompts cannot be blank"
1925
2447
  });
1926
- var pendingInteractionUserQuestionShortLabelSchema = z11.string().min(1).refine((value) => value.trim().length > 0, {
2448
+ var pendingInteractionUserQuestionShortLabelSchema = z12.string().min(1).refine((value) => value.trim().length > 0, {
1927
2449
  message: "User question short labels cannot be blank"
1928
2450
  });
1929
- var pendingInteractionUserQuestionOptionValueSchema = z11.string().min(1).refine((value) => value.trim().length > 0, {
2451
+ var pendingInteractionUserQuestionOptionValueSchema = z12.string().min(1).refine((value) => value.trim().length > 0, {
1930
2452
  message: "User question option values cannot be blank"
1931
2453
  });
1932
- var pendingInteractionUserQuestionOptionLabelSchema = z11.string().min(1).refine((value) => value.trim().length > 0, {
2454
+ var pendingInteractionUserQuestionOptionLabelSchema = z12.string().min(1).refine((value) => value.trim().length > 0, {
1933
2455
  message: "User question option labels cannot be blank"
1934
2456
  });
1935
- var pendingInteractionUserQuestionOptionDescriptionSchema = z11.string().min(1).refine((value) => value.trim().length > 0, {
2457
+ var pendingInteractionUserQuestionOptionDescriptionSchema = z12.string().min(1).refine((value) => value.trim().length > 0, {
1936
2458
  message: "User question option descriptions cannot be blank"
1937
2459
  });
1938
- var pendingInteractionUserQuestionFreeTextSchema = z11.string().min(1).max(
2460
+ var pendingInteractionUserQuestionFreeTextSchema = z12.string().min(1).max(
1939
2461
  USER_QUESTION_MAX_FREE_TEXT_LENGTH,
1940
2462
  `User question free text cannot exceed ${USER_QUESTION_MAX_FREE_TEXT_LENGTH} characters`
1941
2463
  ).refine((value) => value.trim().length > 0, {
1942
2464
  message: "User question free text cannot be blank"
1943
2465
  });
1944
- var pendingInteractionUserQuestionOptionSchema = z11.object({
2466
+ var pendingInteractionUserQuestionOptionSchema = z12.object({
1945
2467
  value: pendingInteractionUserQuestionOptionValueSchema,
1946
2468
  label: pendingInteractionUserQuestionOptionLabelSchema,
1947
2469
  description: pendingInteractionUserQuestionOptionDescriptionSchema.optional()
1948
2470
  });
1949
- var pendingInteractionUserQuestionQuestionSchema = z11.object({
2471
+ var pendingInteractionUserQuestionQuestionSchema = z12.object({
1950
2472
  id: pendingInteractionUserQuestionIdSchema,
1951
2473
  prompt: pendingInteractionUserQuestionPromptSchema,
1952
2474
  shortLabel: pendingInteractionUserQuestionShortLabelSchema.optional(),
1953
- multiSelect: z11.boolean(),
1954
- options: z11.array(pendingInteractionUserQuestionOptionSchema).max(
2475
+ multiSelect: z12.boolean(),
2476
+ options: z12.array(pendingInteractionUserQuestionOptionSchema).max(
1955
2477
  USER_QUESTION_MAX_OPTIONS,
1956
2478
  `User questions cannot include more than ${USER_QUESTION_MAX_OPTIONS} options`
1957
2479
  ).optional(),
1958
- allowFreeText: z11.boolean()
2480
+ allowFreeText: z12.boolean()
1959
2481
  }).superRefine((question, context) => {
1960
2482
  const optionValues = /* @__PURE__ */ new Set();
1961
2483
  question.options?.forEach((option, index) => {
1962
2484
  if (optionValues.has(option.value)) {
1963
2485
  context.addIssue({
1964
- code: z11.ZodIssueCode.custom,
2486
+ code: z12.ZodIssueCode.custom,
1965
2487
  message: "User question option values must be unique",
1966
2488
  path: ["options", index, "value"]
1967
2489
  });
@@ -1976,9 +2498,9 @@ var pendingInteractionUserQuestionQuestionSchema = z11.object({
1976
2498
  path: ["options"]
1977
2499
  }
1978
2500
  );
1979
- var userQuestionPendingInteractionPayloadSchema = z11.object({
1980
- kind: z11.literal("user_question"),
1981
- questions: z11.array(pendingInteractionUserQuestionQuestionSchema).min(1).max(
2501
+ var userQuestionPendingInteractionPayloadSchema = z12.object({
2502
+ kind: z12.literal("user_question"),
2503
+ questions: z12.array(pendingInteractionUserQuestionQuestionSchema).min(1).max(
1982
2504
  USER_QUESTION_MAX_QUESTIONS,
1983
2505
  `User questions cannot include more than ${USER_QUESTION_MAX_QUESTIONS} questions`
1984
2506
  )
@@ -1987,7 +2509,7 @@ var userQuestionPendingInteractionPayloadSchema = z11.object({
1987
2509
  payload.questions.forEach((question, index) => {
1988
2510
  if (questionIds.has(question.id)) {
1989
2511
  context.addIssue({
1990
- code: z11.ZodIssueCode.custom,
2512
+ code: z12.ZodIssueCode.custom,
1991
2513
  message: "User question ids must be unique",
1992
2514
  path: ["questions", index, "id"]
1993
2515
  });
@@ -1996,24 +2518,24 @@ var userQuestionPendingInteractionPayloadSchema = z11.object({
1996
2518
  questionIds.add(question.id);
1997
2519
  });
1998
2520
  });
1999
- var pluginPendingInteractionPayloadSchema = z11.object({
2000
- kind: z11.literal("plugin"),
2001
- title: z11.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
2521
+ var pluginPendingInteractionPayloadSchema = z12.object({
2522
+ kind: z12.literal("plugin"),
2523
+ title: z12.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
2002
2524
  data: jsonValueSchema
2003
2525
  });
2004
- var pluginExtensionInteractionRequestPayloadSchema = z11.object({
2526
+ var pluginExtensionInteractionRequestPayloadSchema = z12.object({
2005
2527
  kind: extensionKindSchema,
2006
- title: z11.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
2528
+ title: z12.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
2007
2529
  data: jsonValueSchema.refine(
2008
2530
  (value) => jsonByteLength(value) <= PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES,
2009
2531
  { message: "Plugin request data exceeds 64 KiB" }
2010
2532
  )
2011
2533
  });
2012
- var interactionRequestPayloadSchema = z11.union([
2534
+ var interactionRequestPayloadSchema = z12.union([
2013
2535
  userQuestionPendingInteractionPayloadSchema,
2014
2536
  pluginExtensionInteractionRequestPayloadSchema
2015
2537
  ]);
2016
- var pendingInteractionPayloadSchema = z11.union([
2538
+ var pendingInteractionPayloadSchema = z12.union([
2017
2539
  approvalPendingInteractionPayloadSchema,
2018
2540
  userQuestionPendingInteractionPayloadSchema,
2019
2541
  pluginExtensionInteractionRequestPayloadSchema
@@ -2025,42 +2547,42 @@ function isUserQuestionPendingInteractionPayload(payload) {
2025
2547
  return payload.kind === "user_question";
2026
2548
  }
2027
2549
  var approvalDecisionDiscriminatorError = "Invalid discriminator value. Expected 'allow_once' | 'allow_for_session' | 'deny'";
2028
- var approvalPendingInteractionResolutionSchema = z11.discriminatedUnion(
2550
+ var approvalPendingInteractionResolutionSchema = z12.discriminatedUnion(
2029
2551
  "decision",
2030
2552
  [
2031
- z11.object({
2032
- decision: z11.literal("allow_once"),
2553
+ z12.object({
2554
+ decision: z12.literal("allow_once"),
2033
2555
  grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
2034
2556
  }),
2035
- z11.object({
2036
- decision: z11.literal("allow_for_session"),
2557
+ z12.object({
2558
+ decision: z12.literal("allow_for_session"),
2037
2559
  grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
2038
2560
  }),
2039
- z11.object({
2040
- decision: z11.literal("deny")
2561
+ z12.object({
2562
+ decision: z12.literal("deny")
2041
2563
  })
2042
2564
  ],
2043
2565
  approvalDecisionDiscriminatorError
2044
2566
  );
2045
- var pendingInteractionUserAnswerSchema = z11.object({
2046
- selected: z11.array(z11.string().min(1)).max(
2567
+ var pendingInteractionUserAnswerSchema = z12.object({
2568
+ selected: z12.array(z12.string().min(1)).max(
2047
2569
  USER_QUESTION_MAX_SELECTED,
2048
2570
  `User question selected choices cannot exceed ${USER_QUESTION_MAX_SELECTED}`
2049
2571
  ),
2050
2572
  freeText: pendingInteractionUserQuestionFreeTextSchema.optional()
2051
2573
  });
2052
- var userQuestionPendingInteractionResolutionSchema = z11.object({
2053
- kind: z11.literal("user_answer"),
2054
- answers: z11.record(z11.string().min(1), pendingInteractionUserAnswerSchema)
2574
+ var userQuestionPendingInteractionResolutionSchema = z12.object({
2575
+ kind: z12.literal("user_answer"),
2576
+ answers: z12.record(z12.string().min(1), pendingInteractionUserAnswerSchema)
2055
2577
  });
2056
- var pluginPendingInteractionResolutionSchema = z11.object({
2057
- kind: z11.literal("plugin_submitted")
2578
+ var pluginPendingInteractionResolutionSchema = z12.object({
2579
+ kind: z12.literal("plugin_submitted")
2058
2580
  });
2059
- var pluginExtensionInteractionResolutionSchema = z11.object({
2060
- kind: z11.literal("request_answer"),
2581
+ var pluginExtensionInteractionResolutionSchema = z12.object({
2582
+ kind: z12.literal("request_answer"),
2061
2583
  value: jsonValueSchema
2062
2584
  });
2063
- var pendingInteractionResolutionSchema = z11.union(
2585
+ var pendingInteractionResolutionSchema = z12.union(
2064
2586
  [
2065
2587
  approvalPendingInteractionResolutionSchema,
2066
2588
  userQuestionPendingInteractionResolutionSchema,
@@ -2075,19 +2597,19 @@ function isApprovalPendingInteractionResolution(resolution) {
2075
2597
  function isUserQuestionPendingInteractionResolution(resolution) {
2076
2598
  return "kind" in resolution && resolution.kind === "user_answer";
2077
2599
  }
2078
- var approvalInteractionOutcomeSchema = z11.object({
2600
+ var approvalInteractionOutcomeSchema = z12.object({
2079
2601
  payload: approvalPendingInteractionPayloadSchema,
2080
2602
  resolution: approvalPendingInteractionResolutionSchema
2081
2603
  });
2082
- var userQuestionInteractionOutcomeSchema = z11.object({
2604
+ var userQuestionInteractionOutcomeSchema = z12.object({
2083
2605
  payload: userQuestionPendingInteractionPayloadSchema,
2084
2606
  resolution: userQuestionPendingInteractionResolutionSchema
2085
2607
  });
2086
- var pluginExtensionInteractionOutcomeSchema = z11.object({
2608
+ var pluginExtensionInteractionOutcomeSchema = z12.object({
2087
2609
  payload: pluginExtensionInteractionRequestPayloadSchema,
2088
2610
  resolution: pluginExtensionInteractionResolutionSchema
2089
2611
  });
2090
- var providerInteractionOutcomeSchema = z11.union([
2612
+ var providerInteractionOutcomeSchema = z12.union([
2091
2613
  approvalInteractionOutcomeSchema,
2092
2614
  userQuestionInteractionOutcomeSchema,
2093
2615
  pluginExtensionInteractionOutcomeSchema
@@ -2095,39 +2617,39 @@ var providerInteractionOutcomeSchema = z11.union([
2095
2617
  function isApprovalInteractionOutcome(outcome) {
2096
2618
  return outcome.payload.kind === "approval";
2097
2619
  }
2098
- var pendingInteractionProviderOriginSchema = z11.object({
2099
- kind: z11.literal("provider"),
2100
- providerId: z11.string().min(1),
2101
- providerThreadId: z11.string().min(1),
2102
- providerRequestId: z11.string().min(1)
2103
- });
2104
- var pendingInteractionPluginOriginSchema = z11.object({
2105
- kind: z11.literal("plugin"),
2106
- pluginId: z11.string().min(1),
2107
- rendererId: z11.string().min(1)
2108
- });
2109
- var pendingInteractionCreateSchema = z11.object({
2110
- threadId: z11.string().min(1),
2111
- turnId: z11.string().min(1),
2112
- providerId: z11.string().min(1),
2113
- providerThreadId: z11.string().min(1),
2114
- providerRequestId: z11.string().min(1),
2620
+ var pendingInteractionProviderOriginSchema = z12.object({
2621
+ kind: z12.literal("provider"),
2622
+ providerId: z12.string().min(1),
2623
+ providerThreadId: z12.string().min(1),
2624
+ providerRequestId: z12.string().min(1)
2625
+ });
2626
+ var pendingInteractionPluginOriginSchema = z12.object({
2627
+ kind: z12.literal("plugin"),
2628
+ pluginId: z12.string().min(1),
2629
+ rendererId: z12.string().min(1)
2630
+ });
2631
+ var pendingInteractionCreateSchema = z12.object({
2632
+ threadId: z12.string().min(1),
2633
+ turnId: z12.string().min(1),
2634
+ providerId: z12.string().min(1),
2635
+ providerThreadId: z12.string().min(1),
2636
+ providerRequestId: z12.string().min(1),
2115
2637
  payload: pendingInteractionPayloadSchema
2116
2638
  });
2117
- var pendingInteractionBaseSchema = z11.object({
2118
- id: z11.string().min(1),
2119
- threadId: z11.string().min(1),
2639
+ var pendingInteractionBaseSchema = z12.object({
2640
+ id: z12.string().min(1),
2641
+ threadId: z12.string().min(1),
2120
2642
  status: pendingInteractionStatusSchema,
2121
- statusReason: z11.string().nullable(),
2122
- createdAt: z11.number().int().nonnegative(),
2123
- expiresAt: z11.number().int().nonnegative().nullable().optional(),
2124
- resolvedAt: z11.number().int().nonnegative().nullable()
2643
+ statusReason: z12.string().nullable(),
2644
+ createdAt: z12.number().int().nonnegative(),
2645
+ expiresAt: z12.number().int().nonnegative().nullable().optional(),
2646
+ resolvedAt: z12.number().int().nonnegative().nullable()
2125
2647
  });
2126
2648
  var providerPendingInteractionBaseSchema = pendingInteractionBaseSchema.extend({
2127
- turnId: z11.string().min(1),
2128
- providerId: z11.string().min(1),
2129
- providerThreadId: z11.string().min(1),
2130
- providerRequestId: z11.string().min(1),
2649
+ turnId: z12.string().min(1),
2650
+ providerId: z12.string().min(1),
2651
+ providerThreadId: z12.string().min(1),
2652
+ providerRequestId: z12.string().min(1),
2131
2653
  origin: pendingInteractionProviderOriginSchema.optional()
2132
2654
  });
2133
2655
  var approvalPendingInteractionSchema = providerPendingInteractionBaseSchema.extend({
@@ -2142,30 +2664,30 @@ var pluginExtensionPendingInteractionSchema = providerPendingInteractionBaseSche
2142
2664
  payload: pluginExtensionInteractionRequestPayloadSchema,
2143
2665
  resolution: pluginExtensionInteractionResolutionSchema.nullable()
2144
2666
  });
2145
- var providerPendingInteractionSchema = z11.union([
2667
+ var providerPendingInteractionSchema = z12.union([
2146
2668
  approvalPendingInteractionSchema,
2147
2669
  userQuestionPendingInteractionSchema,
2148
2670
  pluginExtensionPendingInteractionSchema
2149
2671
  ]);
2150
2672
  var pluginPendingInteractionSchema = pendingInteractionBaseSchema.extend({
2151
- turnId: z11.string().min(1).nullable(),
2673
+ turnId: z12.string().min(1).nullable(),
2152
2674
  origin: pendingInteractionPluginOriginSchema,
2153
2675
  payload: pluginPendingInteractionPayloadSchema,
2154
2676
  resolution: pluginPendingInteractionResolutionSchema.nullable()
2155
2677
  });
2156
- var pendingInteractionSchema = z11.union([
2678
+ var pendingInteractionSchema = z12.union([
2157
2679
  providerPendingInteractionSchema,
2158
2680
  pluginPendingInteractionSchema
2159
2681
  ]);
2160
- var interactionLifecycleRecordBaseSchema = z11.object({
2161
- id: z11.string().min(1),
2682
+ var interactionLifecycleRecordBaseSchema = z12.object({
2683
+ id: z12.string().min(1),
2162
2684
  status: pendingInteractionStatusSchema,
2163
- statusReason: z11.string().nullable()
2685
+ statusReason: z12.string().nullable()
2164
2686
  });
2165
- var interactionLifecycleProviderOriginSchema = z11.object({
2166
- kind: z11.literal("provider"),
2167
- providerId: z11.string().min(1),
2168
- providerRequestId: z11.string().min(1)
2687
+ var interactionLifecycleProviderOriginSchema = z12.object({
2688
+ kind: z12.literal("provider"),
2689
+ providerId: z12.string().min(1),
2690
+ providerRequestId: z12.string().min(1)
2169
2691
  });
2170
2692
  var approvalInteractionLifecycleRecordPayloadSchema = approvalPendingInteractionPayloadSchema.omit({ availableDecisions: true });
2171
2693
  var approvalInteractionLifecycleSchema = interactionLifecycleRecordBaseSchema.extend({
@@ -2190,7 +2712,7 @@ var pluginExtensionInteractionLifecycleSchema = interactionLifecycleRecordBaseSc
2190
2712
  }),
2191
2713
  resolution: pluginExtensionInteractionResolutionSchema.omit({ value: true }).nullable()
2192
2714
  });
2193
- var interactionLifecycleSchema = z11.union([
2715
+ var interactionLifecycleSchema = z12.union([
2194
2716
  approvalInteractionLifecycleSchema,
2195
2717
  userQuestionInteractionLifecycleSchema,
2196
2718
  pluginInteractionLifecycleSchema,
@@ -2198,11 +2720,11 @@ var interactionLifecycleSchema = z11.union([
2198
2720
  ]);
2199
2721
 
2200
2722
  // ../domain/src/protocol-ids.ts
2201
- import { z as z12 } from "zod";
2202
- var clientTurnRequestIdSchema = z12.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
2723
+ import { z as z13 } from "zod";
2724
+ var clientTurnRequestIdSchema = z13.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
2203
2725
 
2204
2726
  // ../domain/src/system-message.ts
2205
- import { z as z13 } from "zod";
2727
+ import { z as z14 } from "zod";
2206
2728
  var systemMessageKindValues = [
2207
2729
  "ownership-assigned",
2208
2730
  "ownership-removed",
@@ -2213,16 +2735,16 @@ var systemMessageKindValues = [
2213
2735
  "child-outcome-batch",
2214
2736
  "unlabeled"
2215
2737
  ];
2216
- var systemMessageKindSchema = z13.enum(systemMessageKindValues);
2217
- var systemMessageSubjectSchema = z13.discriminatedUnion("kind", [
2218
- z13.object({
2219
- kind: z13.literal("thread"),
2220
- threadId: z13.string(),
2221
- threadName: z13.string()
2738
+ var systemMessageKindSchema = z14.enum(systemMessageKindValues);
2739
+ var systemMessageSubjectSchema = z14.discriminatedUnion("kind", [
2740
+ z14.object({
2741
+ kind: z14.literal("thread"),
2742
+ threadId: z14.string(),
2743
+ threadName: z14.string()
2222
2744
  }),
2223
- z13.object({
2224
- kind: z13.literal("thread-batch"),
2225
- count: z13.number()
2745
+ z14.object({
2746
+ kind: z14.literal("thread-batch"),
2747
+ count: z14.number()
2226
2748
  })
2227
2749
  ]);
2228
2750
 
@@ -2245,31 +2767,31 @@ var systemEventTypeValues = [
2245
2767
  "system/provider-turn-watchdog"
2246
2768
  ];
2247
2769
  var threadTurnInitiatorValues = ["user", "agent", "system"];
2248
- var threadTurnInitiatorSchema = z14.enum(threadTurnInitiatorValues);
2770
+ var threadTurnInitiatorSchema = z15.enum(threadTurnInitiatorValues);
2249
2771
  var turnRequestOptionsSchema = recordedThreadExecutionOptionsSchema;
2250
- var turnRequestTargetSchema = z14.discriminatedUnion("kind", [
2251
- z14.object({ kind: z14.literal("thread-start") }),
2252
- z14.object({ kind: z14.literal("new-turn") }),
2253
- z14.object({
2254
- kind: z14.literal("auto"),
2255
- expectedTurnId: z14.string().nullable()
2772
+ var turnRequestTargetSchema = z15.discriminatedUnion("kind", [
2773
+ z15.object({ kind: z15.literal("thread-start") }),
2774
+ z15.object({ kind: z15.literal("new-turn") }),
2775
+ z15.object({
2776
+ kind: z15.literal("auto"),
2777
+ expectedTurnId: z15.string().nullable()
2256
2778
  }),
2257
- z14.object({
2258
- kind: z14.literal("steer"),
2259
- expectedTurnId: z14.string().nullable()
2779
+ z15.object({
2780
+ kind: z15.literal("steer"),
2781
+ expectedTurnId: z15.string().nullable()
2260
2782
  })
2261
2783
  ]);
2262
- var clientTurnLifecycleEventDataSchema = z14.object({
2263
- direction: z14.literal("outbound"),
2264
- source: z14.enum(["spawn", "tell"]),
2784
+ var clientTurnLifecycleEventDataSchema = z15.object({
2785
+ direction: z15.literal("outbound"),
2786
+ source: z15.enum(["spawn", "tell"]),
2265
2787
  initiator: threadTurnInitiatorSchema,
2266
- request: z14.object({
2267
- method: z14.enum(["thread/start", "turn/start"]),
2268
- params: z14.record(z14.string(), z14.unknown())
2788
+ request: z15.object({
2789
+ method: z15.enum(["thread/start", "turn/start"]),
2790
+ params: z15.record(z15.string(), z15.unknown())
2269
2791
  })
2270
2792
  });
2271
- var turnRequestEventDataSchema = z14.object({
2272
- direction: z14.literal("outbound"),
2793
+ var turnRequestEventDataSchema = z15.object({
2794
+ direction: z15.literal("outbound"),
2273
2795
  requestId: clientTurnRequestIdSchema,
2274
2796
  // Retry provenance, written only when a `turn.failed` gate's retry row
2275
2797
  // dispatches. Both fields are present together or not at all: absence means
@@ -2279,45 +2801,45 @@ var turnRequestEventDataSchema = z14.object({
2279
2801
  /** The original request this attempt re-submits, unchanged across attempts. */
2280
2802
  retryOfRequestId: clientTurnRequestIdSchema.optional(),
2281
2803
  /** Which attempt this is: 2 is the first retry of the original request. */
2282
- retryAttempt: z14.number().int().min(2).optional(),
2283
- source: z14.enum(["spawn", "tell"]),
2804
+ retryAttempt: z15.number().int().min(2).optional(),
2805
+ source: z15.enum(["spawn", "tell"]),
2284
2806
  initiator: threadTurnInitiatorSchema,
2285
- senderThreadId: z14.string().nullable(),
2807
+ senderThreadId: z15.string().nullable(),
2286
2808
  systemMessageKind: systemMessageKindSchema.optional(),
2287
2809
  systemMessageSubject: systemMessageSubjectSchema.nullable().optional(),
2288
- input: z14.array(promptInputSchema),
2289
- inputGroups: z14.array(z14.array(promptInputSchema).min(1)).min(1).optional(),
2810
+ input: z15.array(promptInputSchema),
2811
+ inputGroups: z15.array(z15.array(promptInputSchema).min(1)).min(1).optional(),
2290
2812
  target: turnRequestTargetSchema,
2291
- request: z14.object({
2292
- method: z14.enum(["thread/start", "turn/start"]),
2293
- params: z14.record(z14.string(), z14.unknown())
2813
+ request: z15.object({
2814
+ method: z15.enum(["thread/start", "turn/start"]),
2815
+ params: z15.record(z15.string(), z15.unknown())
2294
2816
  }),
2295
2817
  execution: turnRequestOptionsSchema
2296
2818
  });
2297
- var turnRequestRejectedEventDataSchema = z14.object({
2819
+ var turnRequestRejectedEventDataSchema = z15.object({
2298
2820
  requestId: clientTurnRequestIdSchema,
2299
- reason: z14.string().min(1),
2300
- message: z14.string().min(1)
2301
- });
2302
- var systemErrorEventDataSchema = z14.object({
2303
- code: z14.string().optional(),
2304
- message: z14.string(),
2305
- detail: z14.string().optional(),
2306
- reconnectAttempt: z14.number().int().positive().optional(),
2307
- reconnectTotal: z14.number().int().positive().optional()
2821
+ reason: z15.string().min(1),
2822
+ message: z15.string().min(1)
2823
+ });
2824
+ var systemErrorEventDataSchema = z15.object({
2825
+ code: z15.string().optional(),
2826
+ message: z15.string(),
2827
+ detail: z15.string().optional(),
2828
+ reconnectAttempt: z15.number().int().positive().optional(),
2829
+ reconnectTotal: z15.number().int().positive().optional()
2308
2830
  }).superRefine((value, ctx) => {
2309
2831
  const hasReconnectAttempt = value.reconnectAttempt !== void 0;
2310
2832
  const hasReconnectTotal = value.reconnectTotal !== void 0;
2311
2833
  if (hasReconnectAttempt !== hasReconnectTotal) {
2312
2834
  ctx.addIssue({
2313
- code: z14.ZodIssueCode.custom,
2835
+ code: z15.ZodIssueCode.custom,
2314
2836
  message: "system/error reconnectAttempt and reconnectTotal must be provided together"
2315
2837
  });
2316
2838
  return;
2317
2839
  }
2318
2840
  if (value.reconnectAttempt !== void 0 && value.reconnectTotal !== void 0 && value.reconnectAttempt > value.reconnectTotal) {
2319
2841
  ctx.addIssue({
2320
- code: z14.ZodIssueCode.custom,
2842
+ code: z15.ZodIssueCode.custom,
2321
2843
  message: "system/error reconnectAttempt cannot be greater than reconnectTotal"
2322
2844
  });
2323
2845
  }
@@ -2327,42 +2849,42 @@ var ownershipChangeOperationActionValues = [
2327
2849
  "release",
2328
2850
  "transfer"
2329
2851
  ];
2330
- var ownershipChangeOperationActionSchema = z14.enum(
2852
+ var ownershipChangeOperationActionSchema = z15.enum(
2331
2853
  ownershipChangeOperationActionValues
2332
2854
  );
2333
- var ownershipChangeOperationMetadataSchema = z14.object({
2855
+ var ownershipChangeOperationMetadataSchema = z15.object({
2334
2856
  action: ownershipChangeOperationActionSchema,
2335
- nextParentThreadId: z14.string().nullable(),
2336
- nextParentThreadTitle: z14.string().nullable(),
2337
- previousParentThreadId: z14.string().nullable(),
2338
- previousParentThreadTitle: z14.string().nullable()
2339
- });
2340
- var systemOperationEventDataSchema = z14.object({
2341
- operation: z14.string(),
2342
- status: z14.string(),
2343
- message: z14.string(),
2344
- operationId: z14.string(),
2345
- metadata: z14.record(z14.string(), jsonValueSchema).optional()
2346
- });
2347
- var systemInteractionLifecycleEventDataSchema = z14.object({
2857
+ nextParentThreadId: z15.string().nullable(),
2858
+ nextParentThreadTitle: z15.string().nullable(),
2859
+ previousParentThreadId: z15.string().nullable(),
2860
+ previousParentThreadTitle: z15.string().nullable()
2861
+ });
2862
+ var systemOperationEventDataSchema = z15.object({
2863
+ operation: z15.string(),
2864
+ status: z15.string(),
2865
+ message: z15.string(),
2866
+ operationId: z15.string(),
2867
+ metadata: z15.record(z15.string(), jsonValueSchema).optional()
2868
+ });
2869
+ var systemInteractionLifecycleEventDataSchema = z15.object({
2348
2870
  interaction: interactionLifecycleSchema
2349
2871
  });
2350
- var systemPermissionGrantLifecycleEventDataSchema = z14.object({
2351
- interactionId: z14.string(),
2352
- providerId: z14.string(),
2353
- providerRequestId: z14.string(),
2872
+ var systemPermissionGrantLifecycleEventDataSchema = z15.object({
2873
+ interactionId: z15.string(),
2874
+ providerId: z15.string(),
2875
+ providerRequestId: z15.string(),
2354
2876
  status: pendingInteractionStatusSchema,
2355
2877
  resolution: approvalPendingInteractionResolutionSchema.nullable().default(null),
2356
- statusReason: z14.string().nullable().default(null),
2878
+ statusReason: z15.string().nullable().default(null),
2357
2879
  subject: pendingInteractionPermissionGrantApprovalSubjectSchema
2358
2880
  });
2359
- var systemUserQuestionLifecycleEventDataSchema = z14.object({
2360
- interactionId: z14.string(),
2361
- providerId: z14.string(),
2362
- providerRequestId: z14.string(),
2881
+ var systemUserQuestionLifecycleEventDataSchema = z15.object({
2882
+ interactionId: z15.string(),
2883
+ providerId: z15.string(),
2884
+ providerRequestId: z15.string(),
2363
2885
  status: pendingInteractionStatusSchema,
2364
2886
  resolution: userQuestionPendingInteractionResolutionSchema.nullable().default(null),
2365
- statusReason: z14.string().nullable().default(null),
2887
+ statusReason: z15.string().nullable().default(null),
2366
2888
  payload: userQuestionPendingInteractionPayloadSchema
2367
2889
  });
2368
2890
  var systemThreadInterruptedReasonValues = [
@@ -2370,20 +2892,20 @@ var systemThreadInterruptedReasonValues = [
2370
2892
  "host-daemon-restarted",
2371
2893
  "provider-turn-idle"
2372
2894
  ];
2373
- var systemThreadInterruptedReasonSchema = z14.enum(
2895
+ var systemThreadInterruptedReasonSchema = z15.enum(
2374
2896
  systemThreadInterruptedReasonValues
2375
2897
  );
2376
- var systemThreadInterruptedEventDataSchema = z14.object({
2898
+ var systemThreadInterruptedEventDataSchema = z15.object({
2377
2899
  reason: systemThreadInterruptedReasonSchema,
2378
- cause: z14.literal("host-connection-lost").optional()
2900
+ cause: z15.literal("host-connection-lost").optional()
2379
2901
  });
2380
- var provisioningTranscriptEntrySchema = z14.object({
2381
- type: z14.enum(["step", "output"]),
2382
- key: z14.string(),
2383
- text: z14.string(),
2384
- startedAt: z14.number().optional(),
2385
- status: z14.enum(["started", "completed", "failed"]).optional(),
2386
- metadata: z14.record(z14.string(), z14.unknown()).optional()
2902
+ var provisioningTranscriptEntrySchema = z15.object({
2903
+ type: z15.enum(["step", "output"]),
2904
+ key: z15.string(),
2905
+ text: z15.string(),
2906
+ startedAt: z15.number().optional(),
2907
+ status: z15.enum(["started", "completed", "failed"]).optional(),
2908
+ metadata: z15.record(z15.string(), z15.unknown()).optional()
2387
2909
  });
2388
2910
  var systemThreadProvisioningStatusValues = [
2389
2911
  "active",
@@ -2391,48 +2913,48 @@ var systemThreadProvisioningStatusValues = [
2391
2913
  "failed",
2392
2914
  "cancelled"
2393
2915
  ];
2394
- var systemThreadProvisioningStatusSchema = z14.enum(
2916
+ var systemThreadProvisioningStatusSchema = z15.enum(
2395
2917
  systemThreadProvisioningStatusValues
2396
2918
  );
2397
- var systemThreadProvisioningEventDataSchema = z14.object({
2398
- provisioningId: z14.string(),
2919
+ var systemThreadProvisioningEventDataSchema = z15.object({
2920
+ provisioningId: z15.string(),
2399
2921
  status: systemThreadProvisioningStatusSchema,
2400
- environmentId: z14.string().nullable(),
2401
- entries: z14.array(provisioningTranscriptEntrySchema)
2402
- });
2403
- var systemLegacyUserMessageEventDataSchema = z14.object({
2404
- text: z14.string(),
2405
- toolCallId: z14.string().optional(),
2406
- turnId: z14.string().optional()
2407
- });
2408
- var systemProviderTurnWatchdogEventDataSchema = z14.object({
2409
- reason: z14.literal("provider-turn-idle"),
2410
- thresholdMs: z14.number().int().positive(),
2411
- elapsedMs: z14.number().int().nonnegative(),
2412
- activeTurnId: z14.string().min(1),
2413
- activeTurnStartedAt: z14.number().int().nonnegative(),
2414
- lastActivityEventSequence: z14.number().int().positive(),
2415
- lastActivityEventType: z14.string().min(1),
2416
- lastActivityEventAt: z14.number().int().nonnegative(),
2417
- providerId: z14.string().min(1),
2418
- providerThreadId: z14.string().min(1).nullable(),
2419
- firedAt: z14.number().int().nonnegative()
2922
+ environmentId: z15.string().nullable(),
2923
+ entries: z15.array(provisioningTranscriptEntrySchema)
2924
+ });
2925
+ var systemLegacyUserMessageEventDataSchema = z15.object({
2926
+ text: z15.string(),
2927
+ toolCallId: z15.string().optional(),
2928
+ turnId: z15.string().optional()
2929
+ });
2930
+ var systemProviderTurnWatchdogEventDataSchema = z15.object({
2931
+ reason: z15.literal("provider-turn-idle"),
2932
+ thresholdMs: z15.number().int().positive(),
2933
+ elapsedMs: z15.number().int().nonnegative(),
2934
+ activeTurnId: z15.string().min(1),
2935
+ activeTurnStartedAt: z15.number().int().nonnegative(),
2936
+ lastActivityEventSequence: z15.number().int().positive(),
2937
+ lastActivityEventType: z15.string().min(1),
2938
+ lastActivityEventAt: z15.number().int().nonnegative(),
2939
+ providerId: z15.string().min(1),
2940
+ providerThreadId: z15.string().min(1).nullable(),
2941
+ firedAt: z15.number().int().nonnegative()
2420
2942
  });
2421
2943
 
2422
2944
  // ../domain/src/thread-event-scope.ts
2423
- import { z as z15 } from "zod";
2945
+ import { z as z16 } from "zod";
2424
2946
  var threadEventScopeKindValues = ["thread", "turn"];
2425
- var threadEventScopeKindSchema = z15.enum(threadEventScopeKindValues);
2426
- var threadEventScopeSchema = z15.discriminatedUnion("kind", [
2427
- z15.object({ kind: z15.literal("thread") }),
2428
- z15.object({ kind: z15.literal("turn"), turnId: z15.string().min(1) })
2947
+ var threadEventScopeKindSchema = z16.enum(threadEventScopeKindValues);
2948
+ var threadEventScopeSchema = z16.discriminatedUnion("kind", [
2949
+ z16.object({ kind: z16.literal("thread") }),
2950
+ z16.object({ kind: z16.literal("turn"), turnId: z16.string().min(1) })
2429
2951
  ]);
2430
2952
  var threadEventScopePolicyValues = [
2431
2953
  "thread",
2432
2954
  "turn",
2433
2955
  "thread-or-turn"
2434
2956
  ];
2435
- var threadEventScopePolicySchema = z15.enum(threadEventScopePolicyValues);
2957
+ var threadEventScopePolicySchema = z16.enum(threadEventScopePolicyValues);
2436
2958
  var threadEventScopeDefinitionByType = {
2437
2959
  "thread/started": {
2438
2960
  policy: "thread",
@@ -2598,32 +3120,32 @@ function validateThreadEventScope(args) {
2598
3120
  }
2599
3121
 
2600
3122
  // ../domain/src/thread-timeline-goal.ts
2601
- import { z as z16 } from "zod";
2602
- var threadTimelineGoalStatusSchema = z16.enum([
3123
+ import { z as z17 } from "zod";
3124
+ var threadTimelineGoalStatusSchema = z17.enum([
2603
3125
  "active",
2604
3126
  "paused",
2605
3127
  "budgetLimited",
2606
3128
  "complete"
2607
3129
  ]);
2608
- var threadTimelineGoalSchema = z16.object({
2609
- sourceSeq: z16.number().int().nonnegative(),
2610
- updatedAt: z16.number(),
2611
- objective: z16.string(),
3130
+ var threadTimelineGoalSchema = z17.object({
3131
+ sourceSeq: z17.number().int().nonnegative(),
3132
+ updatedAt: z17.number(),
3133
+ objective: z17.string(),
2612
3134
  status: threadTimelineGoalStatusSchema,
2613
- tokenBudget: z16.number().nullable(),
2614
- tokensUsed: z16.number(),
2615
- timeUsedSeconds: z16.number()
3135
+ tokenBudget: z17.number().nullable(),
3136
+ tokensUsed: z17.number(),
3137
+ timeUsedSeconds: z17.number()
2616
3138
  });
2617
3139
 
2618
3140
  // ../domain/src/provider-event.ts
2619
- var threadEventItemStatusSchema = z17.enum([
3141
+ var threadEventItemStatusSchema = z18.enum([
2620
3142
  "pending",
2621
3143
  "completed",
2622
3144
  "failed",
2623
3145
  "interrupted"
2624
3146
  ]);
2625
- var threadEventItemApprovalStatusSchema = z17.enum(["waiting_for_approval", "denied"]).nullable();
2626
- var threadEventTurnStatusSchema = z17.enum([
3147
+ var threadEventItemApprovalStatusSchema = z18.enum(["waiting_for_approval", "denied"]).nullable();
3148
+ var threadEventTurnStatusSchema = z18.enum([
2627
3149
  "completed",
2628
3150
  "failed",
2629
3151
  "interrupted"
@@ -2649,260 +3171,262 @@ var providerErrorCategoryValues = [
2649
3171
  "unauthorized",
2650
3172
  "unknown"
2651
3173
  ];
2652
- var providerErrorCategorySchema = z17.enum(providerErrorCategoryValues);
2653
- var providerErrorInfoSchema = z17.object({
3174
+ var providerErrorCategorySchema = z18.enum(providerErrorCategoryValues);
3175
+ var providerErrorInfoSchema = z18.object({
2654
3176
  category: providerErrorCategorySchema,
2655
- providerCode: z17.string().nullable(),
2656
- httpStatusCode: z17.number().nullable()
3177
+ providerCode: z18.string().nullable(),
3178
+ httpStatusCode: z18.number().nullable()
2657
3179
  });
2658
- var providerRateLimitStatusSchema = z17.enum([
3180
+ var providerRateLimitStatusSchema = z18.enum([
2659
3181
  "allowed",
2660
3182
  "warning",
2661
3183
  "blocked",
2662
3184
  "unknown"
2663
3185
  ]);
2664
- var providerRateLimitWindowSchema = z17.object({
2665
- providerKey: z17.string().min(1).nullable(),
2666
- label: z17.string().min(1).nullable(),
3186
+ var providerRateLimitWindowSchema = z18.object({
3187
+ providerKey: z18.string().min(1).nullable(),
3188
+ label: z18.string().min(1).nullable(),
2667
3189
  status: providerRateLimitStatusSchema,
2668
- resetsAtMs: z17.number().int().nonnegative().nullable()
3190
+ resetsAtMs: z18.number().int().nonnegative().nullable()
2669
3191
  });
2670
- var providerRateLimitStateSchema = z17.object({
2671
- providerId: z17.string().min(1),
3192
+ var providerRateLimitStateSchema = z18.object({
3193
+ providerId: z18.string().min(1),
2672
3194
  status: providerRateLimitStatusSchema,
2673
- kind: z17.enum(["subscription-window", "credits", "spend-control", "unknown"]),
2674
- windows: z17.array(providerRateLimitWindowSchema),
2675
- reachedReason: z17.string().min(1).nullable(),
2676
- overageStatus: z17.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
2677
- overageReason: z17.string().min(1).nullable()
2678
- });
2679
- var threadEventFileChangeKindSchema = z17.enum(["add", "delete", "update"]);
2680
- var threadEventFileChangeSchema = z17.object({
2681
- path: z17.string(),
3195
+ kind: z18.enum(["subscription-window", "credits", "spend-control", "unknown"]),
3196
+ windows: z18.array(providerRateLimitWindowSchema),
3197
+ reachedReason: z18.string().min(1).nullable(),
3198
+ overageStatus: z18.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
3199
+ overageReason: z18.string().min(1).nullable()
3200
+ });
3201
+ var threadEventFileChangeKindSchema = z18.enum(["add", "delete", "update"]);
3202
+ var threadEventFileChangeSchema = z18.object({
3203
+ path: z18.string(),
2682
3204
  kind: threadEventFileChangeKindSchema,
2683
- movePath: z17.string().optional(),
2684
- diff: z17.string().optional()
3205
+ movePath: z18.string().optional(),
3206
+ diff: z18.string().optional()
2685
3207
  });
2686
- var threadEventPlanStepStatusSchema = z17.enum([
3208
+ var threadEventPlanStepStatusSchema = z18.enum([
2687
3209
  "pending",
2688
3210
  "active",
2689
3211
  "completed",
2690
3212
  "failed"
2691
3213
  ]);
2692
- var threadEventPlanStepSchema = z17.object({
2693
- step: z17.string(),
3214
+ var threadEventPlanStepSchema = z18.object({
3215
+ step: z18.string(),
2694
3216
  status: threadEventPlanStepStatusSchema.optional()
2695
3217
  });
2696
3218
  var itemPresentationField = {
2697
3219
  presentation: threadEventItemPresentationSchema.optional()
2698
3220
  };
2699
- var threadEventWebSearchItemSchema = z17.object({
2700
- type: z17.literal("webSearch"),
2701
- id: z17.string(),
2702
- queries: z17.array(z17.string()).min(1),
2703
- resultText: z17.string().nullable(),
3221
+ var threadEventWebSearchItemSchema = z18.object({
3222
+ type: z18.literal("webSearch"),
3223
+ id: z18.string(),
3224
+ queries: z18.array(z18.string()).min(1),
3225
+ resultText: z18.string().nullable(),
2704
3226
  ...itemPresentationField,
2705
- parentToolCallId: z17.string().optional()
2706
- });
2707
- var threadEventWebFetchItemSchema = z17.object({
2708
- type: z17.literal("webFetch"),
2709
- id: z17.string(),
2710
- url: z17.string(),
2711
- prompt: z17.string().nullable(),
2712
- pattern: z17.string().nullable(),
2713
- resultText: z17.string().nullable(),
3227
+ parentToolCallId: z18.string().optional()
3228
+ });
3229
+ var threadEventWebFetchItemSchema = z18.object({
3230
+ type: z18.literal("webFetch"),
3231
+ id: z18.string(),
3232
+ url: z18.string(),
3233
+ prompt: z18.string().nullable(),
3234
+ pattern: z18.string().nullable(),
3235
+ resultText: z18.string().nullable(),
2714
3236
  ...itemPresentationField,
2715
- parentToolCallId: z17.string().optional()
3237
+ parentToolCallId: z18.string().optional()
2716
3238
  });
2717
- var threadEventImageViewItemSchema = z17.object({
2718
- type: z17.literal("imageView"),
2719
- id: z17.string(),
2720
- path: z17.string(),
3239
+ var threadEventImageViewItemSchema = z18.object({
3240
+ type: z18.literal("imageView"),
3241
+ id: z18.string(),
3242
+ path: z18.string(),
2721
3243
  ...itemPresentationField,
2722
- parentToolCallId: z17.string().optional()
3244
+ parentToolCallId: z18.string().optional()
2723
3245
  });
2724
- var threadEventFileReadItemSchema = z17.object({
2725
- type: z17.literal("fileRead"),
2726
- id: z17.string(),
2727
- path: z17.string(),
2728
- cmd: z17.string().optional(),
3246
+ var threadEventFileReadItemSchema = z18.object({
3247
+ type: z18.literal("fileRead"),
3248
+ id: z18.string(),
3249
+ path: z18.string(),
3250
+ cmd: z18.string().optional(),
2729
3251
  status: threadEventItemStatusSchema,
2730
3252
  ...itemPresentationField,
2731
- parentToolCallId: z17.string().optional()
3253
+ parentToolCallId: z18.string().optional()
2732
3254
  });
2733
- var threadEventSearchModeSchema = z17.enum(["content", "path", "list"]);
2734
- var threadEventSearchItemSchema = z17.object({
2735
- type: z17.literal("search"),
2736
- id: z17.string(),
3255
+ var threadEventSearchModeSchema = z18.enum(["content", "path", "list"]);
3256
+ var threadEventSearchItemSchema = z18.object({
3257
+ type: z18.literal("search"),
3258
+ id: z18.string(),
2737
3259
  mode: threadEventSearchModeSchema,
2738
- query: z17.string(),
2739
- path: z17.string().optional(),
2740
- cmd: z17.string().optional(),
3260
+ query: z18.string(),
3261
+ path: z18.string().optional(),
3262
+ cmd: z18.string().optional(),
2741
3263
  status: threadEventItemStatusSchema,
2742
3264
  ...itemPresentationField,
2743
- parentToolCallId: z17.string().optional()
3265
+ parentToolCallId: z18.string().optional()
2744
3266
  });
2745
- var threadEventDelegationItemSchema = z17.object({
2746
- type: z17.literal("delegation"),
2747
- id: z17.string(),
2748
- childRef: z17.string().min(1),
2749
- label: z17.string(),
3267
+ var threadEventDelegationItemSchema = z18.object({
3268
+ type: z18.literal("delegation"),
3269
+ id: z18.string(),
3270
+ childRef: z18.string().min(1),
3271
+ label: z18.string(),
2750
3272
  status: threadEventItemStatusSchema,
2751
- background: z17.boolean(),
2752
- summary: z17.string().optional(),
3273
+ background: z18.boolean(),
3274
+ summary: z18.string().optional(),
2753
3275
  ...itemPresentationField,
2754
- parentToolCallId: z17.string().optional()
3276
+ parentToolCallId: z18.string().optional()
2755
3277
  });
2756
- var threadEventPlanStepsItemSchema = z17.object({
2757
- type: z17.literal("planSteps"),
2758
- id: z17.string(),
2759
- steps: z17.array(threadEventPlanStepSchema),
2760
- explanation: z17.string().optional(),
3278
+ var threadEventPlanStepsItemSchema = z18.object({
3279
+ type: z18.literal("planSteps"),
3280
+ id: z18.string(),
3281
+ steps: z18.array(threadEventPlanStepSchema),
3282
+ explanation: z18.string().optional(),
2761
3283
  status: threadEventItemStatusSchema,
2762
3284
  ...itemPresentationField,
2763
- parentToolCallId: z17.string().optional()
3285
+ parentToolCallId: z18.string().optional()
2764
3286
  });
2765
- var threadEventExtensionItemSchema = z17.object({
2766
- type: z17.literal("extension"),
2767
- id: z17.string(),
3287
+ var threadEventExtensionItemSchema = z18.object({
3288
+ type: z18.literal("extension"),
3289
+ id: z18.string(),
2768
3290
  kind: extensionKindSchema,
2769
3291
  payload: jsonValueSchema,
2770
3292
  status: threadEventItemStatusSchema,
2771
3293
  presentation: threadEventItemPresentationSchema,
2772
- parentToolCallId: z17.string().optional()
3294
+ parentToolCallId: z18.string().optional()
2773
3295
  });
2774
- var threadEventTextTruncationSchema = z17.object({
2775
- originalLength: z17.number(),
2776
- retainedHeadLength: z17.number(),
2777
- retainedTailLength: z17.number(),
2778
- truncatedAt: z17.number()
3296
+ var threadEventTextTruncationSchema = z18.object({
3297
+ originalLength: z18.number(),
3298
+ retainedHeadLength: z18.number(),
3299
+ retainedTailLength: z18.number(),
3300
+ truncatedAt: z18.number()
2779
3301
  });
2780
- var threadEventItemTruncationSchema = z17.object({
3302
+ var threadEventItemTruncationSchema = z18.object({
2781
3303
  aggregatedOutput: threadEventTextTruncationSchema.optional(),
2782
3304
  result: threadEventTextTruncationSchema.optional(),
2783
3305
  resultText: threadEventTextTruncationSchema.optional()
2784
3306
  });
2785
- var threadEventImageGenerationItemSchema = z17.object({
2786
- type: z17.literal("imageGeneration"),
2787
- id: z17.string(),
3307
+ var threadEventImageGenerationItemSchema = z18.object({
3308
+ type: z18.literal("imageGeneration"),
3309
+ id: z18.string(),
2788
3310
  status: threadEventItemStatusSchema,
2789
- prompt: z17.string().nullable(),
2790
- path: z17.string().nullable(),
2791
- result: z17.string().optional(),
2792
- error: z17.string().nullable(),
2793
- transparentBackground: z17.boolean(),
3311
+ prompt: z18.string().nullable(),
3312
+ path: z18.string().nullable(),
3313
+ result: z18.string().optional(),
3314
+ error: z18.string().nullable(),
3315
+ transparentBackground: z18.boolean(),
2794
3316
  truncation: threadEventItemTruncationSchema.optional(),
2795
3317
  ...itemPresentationField,
2796
- parentToolCallId: z17.string().optional()
3318
+ parentToolCallId: z18.string().optional()
2797
3319
  });
2798
- var threadEventUserContentSchema = z17.discriminatedUnion("type", [
2799
- z17.object({ type: z17.literal("text"), text: z17.string() }),
2800
- z17.object({ type: z17.literal("image"), url: z17.string() }),
2801
- z17.object({ type: z17.literal("localImage"), path: z17.string() }),
2802
- z17.object({ type: z17.literal("localFile"), path: z17.string() })
3320
+ var threadEventUserContentSchema = z18.discriminatedUnion("type", [
3321
+ z18.object({ type: z18.literal("text"), text: z18.string() }),
3322
+ z18.object({ type: z18.literal("image"), url: z18.string() }),
3323
+ z18.object({ type: z18.literal("localImage"), path: z18.string() }),
3324
+ z18.object({ type: z18.literal("localFile"), path: z18.string() })
2803
3325
  ]);
2804
- var threadEventTokenUsageBreakdownSchema = z17.object({
2805
- totalTokens: z17.number(),
2806
- inputTokens: z17.number(),
2807
- cachedInputTokens: z17.number(),
2808
- outputTokens: z17.number(),
2809
- reasoningOutputTokens: z17.number()
2810
- });
2811
- var threadEventContextWindowUsageSchema = z17.object({
3326
+ var threadEventTokenUsageBreakdownSchema = z18.object({
3327
+ totalTokens: z18.number(),
3328
+ inputTokens: z18.number(),
3329
+ cachedInputTokens: z18.number(),
3330
+ cacheReadInputTokens: z18.number().nonnegative().optional(),
3331
+ cacheWriteInputTokens: z18.number().nonnegative().optional(),
3332
+ outputTokens: z18.number(),
3333
+ reasoningOutputTokens: z18.number()
3334
+ });
3335
+ var threadEventContextWindowUsageSchema = z18.object({
2812
3336
  snapshot: contextSnapshotSchema.optional(),
2813
- usedTokens: z17.number().nullable(),
2814
- modelContextWindow: z17.number().nullable(),
2815
- estimated: z17.boolean()
3337
+ usedTokens: z18.number().nullable(),
3338
+ modelContextWindow: z18.number().nullable(),
3339
+ estimated: z18.boolean()
2816
3340
  });
2817
- var threadEventTokenUsageSchema = z17.object({
3341
+ var threadEventTokenUsageSchema = z18.object({
2818
3342
  total: threadEventTokenUsageBreakdownSchema,
2819
3343
  last: threadEventTokenUsageBreakdownSchema,
2820
- modelContextWindow: z17.number().nullable()
3344
+ modelContextWindow: z18.number().nullable()
2821
3345
  });
2822
- var threadEventWarningCategorySchema = z17.enum([
3346
+ var threadEventWarningCategorySchema = z18.enum([
2823
3347
  "deprecation",
2824
3348
  "config",
2825
3349
  "general",
2826
3350
  "compaction-skipped"
2827
3351
  ]);
2828
- var providerRawEventSchema = z17.object({
2829
- jsonrpc: z17.literal("2.0"),
2830
- id: z17.union([z17.string(), z17.number()]).optional(),
2831
- method: z17.string(),
3352
+ var providerRawEventSchema = z18.object({
3353
+ jsonrpc: z18.literal("2.0"),
3354
+ id: z18.union([z18.string(), z18.number()]).optional(),
3355
+ method: z18.string(),
2832
3356
  params: jsonValueSchema.optional()
2833
3357
  });
2834
- var providerUnhandledEventSchema = z17.object({
2835
- type: z17.literal("provider/unhandled"),
2836
- threadId: z17.string(),
2837
- providerThreadId: z17.string(),
2838
- providerId: z17.string(),
2839
- rawType: z17.string(),
3358
+ var providerUnhandledEventSchema = z18.object({
3359
+ type: z18.literal("provider/unhandled"),
3360
+ threadId: z18.string(),
3361
+ providerThreadId: z18.string(),
3362
+ providerId: z18.string(),
3363
+ rawType: z18.string(),
2840
3364
  rawEvent: providerRawEventSchema,
2841
- parentToolCallId: z17.string().optional()
2842
- });
2843
- var toolCallProgressEventSchema = z17.object({
2844
- type: z17.literal("item/toolCall/progress"),
2845
- threadId: z17.string(),
2846
- providerThreadId: z17.string(),
2847
- itemId: z17.string(),
2848
- message: z17.string().optional(),
2849
- parentToolCallId: z17.string().optional()
2850
- });
2851
- var threadEventBackgroundTaskItemSchema = z17.object({
2852
- type: z17.literal("backgroundTask"),
2853
- id: z17.string(),
2854
- familyId: z17.string().optional(),
2855
- taskType: z17.string(),
2856
- description: z17.string(),
3365
+ parentToolCallId: z18.string().optional()
3366
+ });
3367
+ var toolCallProgressEventSchema = z18.object({
3368
+ type: z18.literal("item/toolCall/progress"),
3369
+ threadId: z18.string(),
3370
+ providerThreadId: z18.string(),
3371
+ itemId: z18.string(),
3372
+ message: z18.string().optional(),
3373
+ parentToolCallId: z18.string().optional()
3374
+ });
3375
+ var threadEventBackgroundTaskItemSchema = z18.object({
3376
+ type: z18.literal("backgroundTask"),
3377
+ id: z18.string(),
3378
+ familyId: z18.string().optional(),
3379
+ taskType: z18.string(),
3380
+ description: z18.string(),
2857
3381
  status: threadEventItemStatusSchema,
2858
3382
  taskStatus: backgroundTaskStatusSchema,
2859
- skipTranscript: z17.boolean(),
2860
- workflowName: z17.string().optional(),
3383
+ skipTranscript: z18.boolean(),
3384
+ workflowName: z18.string().optional(),
2861
3385
  workflow: workflowProgressSnapshotSchema.optional(),
2862
3386
  usage: backgroundTaskUsageSchema.optional(),
2863
- summary: z17.string().optional(),
2864
- error: z17.string().optional(),
2865
- outputFile: z17.string().optional(),
3387
+ summary: z18.string().optional(),
3388
+ error: z18.string().optional(),
3389
+ outputFile: z18.string().optional(),
2866
3390
  ...itemPresentationField,
2867
- parentToolCallId: z17.string().optional()
3391
+ parentToolCallId: z18.string().optional()
2868
3392
  });
2869
- var threadEventItemSchema = z17.discriminatedUnion("type", [
2870
- z17.object({
2871
- type: z17.literal("userMessage"),
2872
- id: z17.string(),
2873
- content: z17.array(threadEventUserContentSchema),
3393
+ var threadEventItemSchema = z18.discriminatedUnion("type", [
3394
+ z18.object({
3395
+ type: z18.literal("userMessage"),
3396
+ id: z18.string(),
3397
+ content: z18.array(threadEventUserContentSchema),
2874
3398
  clientRequestId: clientTurnRequestIdSchema.optional(),
2875
- parentToolCallId: z17.string().optional()
3399
+ parentToolCallId: z18.string().optional()
2876
3400
  }).strict(),
2877
- z17.object({
2878
- type: z17.literal("agentMessage"),
2879
- id: z17.string(),
2880
- text: z17.string(),
3401
+ z18.object({
3402
+ type: z18.literal("agentMessage"),
3403
+ id: z18.string(),
3404
+ text: z18.string(),
2881
3405
  ...itemPresentationField,
2882
- parentToolCallId: z17.string().optional()
3406
+ parentToolCallId: z18.string().optional()
2883
3407
  }),
2884
- z17.object({
2885
- type: z17.literal("commandExecution"),
2886
- id: z17.string(),
2887
- command: z17.string(),
2888
- cwd: z17.string(),
3408
+ z18.object({
3409
+ type: z18.literal("commandExecution"),
3410
+ id: z18.string(),
3411
+ command: z18.string(),
3412
+ cwd: z18.string(),
2889
3413
  status: threadEventItemStatusSchema,
2890
3414
  approvalStatus: threadEventItemApprovalStatusSchema,
2891
- aggregatedOutput: z17.string().optional(),
2892
- exitCode: z17.number().optional(),
2893
- durationMs: z17.number().optional(),
3415
+ aggregatedOutput: z18.string().optional(),
3416
+ exitCode: z18.number().optional(),
3417
+ durationMs: z18.number().optional(),
2894
3418
  truncation: threadEventItemTruncationSchema.optional(),
2895
3419
  ...itemPresentationField,
2896
- parentToolCallId: z17.string().optional()
3420
+ parentToolCallId: z18.string().optional()
2897
3421
  }),
2898
- z17.object({
2899
- type: z17.literal("fileChange"),
2900
- id: z17.string(),
2901
- changes: z17.array(threadEventFileChangeSchema),
3422
+ z18.object({
3423
+ type: z18.literal("fileChange"),
3424
+ id: z18.string(),
3425
+ changes: z18.array(threadEventFileChangeSchema),
2902
3426
  status: threadEventItemStatusSchema,
2903
3427
  approvalStatus: threadEventItemApprovalStatusSchema,
2904
3428
  ...itemPresentationField,
2905
- parentToolCallId: z17.string().optional()
3429
+ parentToolCallId: z18.string().optional()
2906
3430
  }),
2907
3431
  threadEventWebSearchItemSchema,
2908
3432
  threadEventWebFetchItemSchema,
@@ -2910,264 +3434,264 @@ var threadEventItemSchema = z17.discriminatedUnion("type", [
2910
3434
  threadEventImageGenerationItemSchema,
2911
3435
  threadEventFileReadItemSchema,
2912
3436
  threadEventSearchItemSchema,
2913
- z17.object({
2914
- type: z17.literal("toolCall"),
2915
- id: z17.string(),
2916
- server: z17.string().optional(),
2917
- tool: z17.string(),
2918
- arguments: z17.record(z17.string(), z17.unknown()).optional(),
3437
+ z18.object({
3438
+ type: z18.literal("toolCall"),
3439
+ id: z18.string(),
3440
+ server: z18.string().optional(),
3441
+ tool: z18.string(),
3442
+ arguments: z18.record(z18.string(), z18.unknown()).optional(),
2919
3443
  status: threadEventItemStatusSchema,
2920
- result: z17.unknown().optional(),
2921
- error: z17.string().optional(),
2922
- durationMs: z17.number().optional(),
3444
+ result: z18.unknown().optional(),
3445
+ error: z18.string().optional(),
3446
+ durationMs: z18.number().optional(),
2923
3447
  truncation: threadEventItemTruncationSchema.optional(),
2924
3448
  ...itemPresentationField,
2925
- parentToolCallId: z17.string().optional()
3449
+ parentToolCallId: z18.string().optional()
2926
3450
  }),
2927
- z17.object({
2928
- type: z17.literal("reasoning"),
2929
- id: z17.string(),
2930
- summary: z17.array(z17.string()),
2931
- content: z17.array(z17.string()),
3451
+ z18.object({
3452
+ type: z18.literal("reasoning"),
3453
+ id: z18.string(),
3454
+ summary: z18.array(z18.string()),
3455
+ content: z18.array(z18.string()),
2932
3456
  ...itemPresentationField,
2933
- parentToolCallId: z17.string().optional()
3457
+ parentToolCallId: z18.string().optional()
2934
3458
  }),
2935
- z17.object({
2936
- type: z17.literal("plan"),
2937
- id: z17.string(),
2938
- text: z17.string(),
3459
+ z18.object({
3460
+ type: z18.literal("plan"),
3461
+ id: z18.string(),
3462
+ text: z18.string(),
2939
3463
  ...itemPresentationField,
2940
- parentToolCallId: z17.string().optional()
3464
+ parentToolCallId: z18.string().optional()
2941
3465
  }),
2942
3466
  threadEventPlanStepsItemSchema,
2943
- z17.object({
2944
- type: z17.literal("contextCompaction"),
2945
- id: z17.string(),
3467
+ z18.object({
3468
+ type: z18.literal("contextCompaction"),
3469
+ id: z18.string(),
2946
3470
  ...itemPresentationField,
2947
- parentToolCallId: z17.string().optional()
3471
+ parentToolCallId: z18.string().optional()
2948
3472
  }),
2949
3473
  threadEventBackgroundTaskItemSchema,
2950
3474
  threadEventDelegationItemSchema,
2951
3475
  threadEventExtensionItemSchema
2952
3476
  ]);
2953
3477
  function itemTextDeltaEventSchema(type) {
2954
- return z17.object({
2955
- type: z17.literal(type),
2956
- threadId: z17.string(),
2957
- providerThreadId: z17.string(),
2958
- itemId: z17.string(),
2959
- delta: z17.string(),
2960
- parentToolCallId: z17.string().optional()
3478
+ return z18.object({
3479
+ type: z18.literal(type),
3480
+ threadId: z18.string(),
3481
+ providerThreadId: z18.string(),
3482
+ itemId: z18.string(),
3483
+ delta: z18.string(),
3484
+ parentToolCallId: z18.string().optional()
2961
3485
  });
2962
3486
  }
2963
- var unscopedProviderEventSchema = z17.discriminatedUnion("type", [
2964
- z17.object({
2965
- type: z17.literal("thread/started"),
2966
- threadId: z17.string()
3487
+ var unscopedProviderEventSchema = z18.discriminatedUnion("type", [
3488
+ z18.object({
3489
+ type: z18.literal("thread/started"),
3490
+ threadId: z18.string()
2967
3491
  }),
2968
- z17.object({
2969
- type: z17.literal("thread/identity"),
2970
- threadId: z17.string(),
2971
- providerThreadId: z17.string()
3492
+ z18.object({
3493
+ type: z18.literal("thread/identity"),
3494
+ threadId: z18.string(),
3495
+ providerThreadId: z18.string()
2972
3496
  }),
2973
- z17.object({
2974
- type: z17.literal("turn/started"),
2975
- threadId: z17.string(),
2976
- providerThreadId: z17.string(),
2977
- parentToolCallId: z17.string().optional()
3497
+ z18.object({
3498
+ type: z18.literal("turn/started"),
3499
+ threadId: z18.string(),
3500
+ providerThreadId: z18.string(),
3501
+ parentToolCallId: z18.string().optional()
2978
3502
  }),
2979
- z17.object({
2980
- type: z17.literal("turn/completed"),
2981
- threadId: z17.string(),
2982
- providerThreadId: z17.string().nullable(),
3503
+ z18.object({
3504
+ type: z18.literal("turn/completed"),
3505
+ threadId: z18.string(),
3506
+ providerThreadId: z18.string().nullable(),
2983
3507
  status: threadEventTurnStatusSchema,
2984
- error: z17.object({ message: z17.string() }).optional(),
2985
- providerCheckpointId: z17.string().min(1).optional()
3508
+ error: z18.object({ message: z18.string() }).optional(),
3509
+ providerCheckpointId: z18.string().min(1).optional()
2986
3510
  }),
2987
- z17.object({
2988
- type: z17.literal("turn/input/accepted"),
2989
- threadId: z17.string(),
2990
- providerThreadId: z17.string(),
3511
+ z18.object({
3512
+ type: z18.literal("turn/input/accepted"),
3513
+ threadId: z18.string(),
3514
+ providerThreadId: z18.string(),
2991
3515
  clientRequestId: clientTurnRequestIdSchema,
2992
3516
  scope: threadEventScopeSchema
2993
3517
  }).strict(),
2994
- z17.object({
2995
- type: z17.literal("thread/name/updated"),
2996
- threadId: z17.string(),
2997
- providerThreadId: z17.string(),
2998
- threadName: z17.string()
3518
+ z18.object({
3519
+ type: z18.literal("thread/name/updated"),
3520
+ threadId: z18.string(),
3521
+ providerThreadId: z18.string(),
3522
+ threadName: z18.string()
2999
3523
  }),
3000
- z17.object({
3001
- type: z17.literal("thread/compacted"),
3002
- threadId: z17.string(),
3003
- providerThreadId: z17.string()
3524
+ z18.object({
3525
+ type: z18.literal("thread/compacted"),
3526
+ threadId: z18.string(),
3527
+ providerThreadId: z18.string()
3004
3528
  }),
3005
- z17.object({
3006
- type: z17.literal("thread/context/cleared"),
3007
- threadId: z17.string(),
3008
- providerThreadId: z17.string()
3529
+ z18.object({
3530
+ type: z18.literal("thread/context/cleared"),
3531
+ threadId: z18.string(),
3532
+ providerThreadId: z18.string()
3009
3533
  }),
3010
- z17.object({
3011
- type: z17.literal("thread/goal/updated"),
3012
- threadId: z17.string(),
3013
- providerThreadId: z17.string(),
3014
- objective: z17.string(),
3534
+ z18.object({
3535
+ type: z18.literal("thread/goal/updated"),
3536
+ threadId: z18.string(),
3537
+ providerThreadId: z18.string(),
3538
+ objective: z18.string(),
3015
3539
  status: threadTimelineGoalStatusSchema,
3016
- tokenBudget: z17.number().nullable(),
3017
- tokensUsed: z17.number(),
3018
- timeUsedSeconds: z17.number()
3540
+ tokenBudget: z18.number().nullable(),
3541
+ tokensUsed: z18.number(),
3542
+ timeUsedSeconds: z18.number()
3019
3543
  }),
3020
- z17.object({
3021
- type: z17.literal("thread/goal/cleared"),
3022
- threadId: z17.string(),
3023
- providerThreadId: z17.string()
3544
+ z18.object({
3545
+ type: z18.literal("thread/goal/cleared"),
3546
+ threadId: z18.string(),
3547
+ providerThreadId: z18.string()
3024
3548
  }),
3025
- z17.object({
3026
- type: z17.literal("item/started"),
3027
- threadId: z17.string(),
3028
- providerThreadId: z17.string(),
3549
+ z18.object({
3550
+ type: z18.literal("item/started"),
3551
+ threadId: z18.string(),
3552
+ providerThreadId: z18.string(),
3029
3553
  item: threadEventItemSchema
3030
3554
  }),
3031
- z17.object({
3032
- type: z17.literal("item/completed"),
3033
- threadId: z17.string(),
3034
- providerThreadId: z17.string(),
3555
+ z18.object({
3556
+ type: z18.literal("item/completed"),
3557
+ threadId: z18.string(),
3558
+ providerThreadId: z18.string(),
3035
3559
  item: threadEventItemSchema
3036
3560
  }),
3037
3561
  itemTextDeltaEventSchema("item/agentMessage/delta"),
3038
- z17.object({
3039
- type: z17.literal("item/commandExecution/outputDelta"),
3040
- threadId: z17.string(),
3041
- providerThreadId: z17.string(),
3042
- itemId: z17.string(),
3043
- delta: z17.string(),
3044
- reset: z17.boolean().optional(),
3045
- parentToolCallId: z17.string().optional()
3562
+ z18.object({
3563
+ type: z18.literal("item/commandExecution/outputDelta"),
3564
+ threadId: z18.string(),
3565
+ providerThreadId: z18.string(),
3566
+ itemId: z18.string(),
3567
+ delta: z18.string(),
3568
+ reset: z18.boolean().optional(),
3569
+ parentToolCallId: z18.string().optional()
3046
3570
  }),
3047
3571
  itemTextDeltaEventSchema("item/fileChange/outputDelta"),
3048
3572
  itemTextDeltaEventSchema("item/reasoning/summaryTextDelta"),
3049
3573
  itemTextDeltaEventSchema("item/reasoning/textDelta"),
3050
3574
  itemTextDeltaEventSchema("item/plan/delta"),
3051
- z17.object({
3052
- type: z17.literal("item/mcpToolCall/progress"),
3053
- threadId: z17.string(),
3054
- providerThreadId: z17.string(),
3055
- itemId: z17.string(),
3056
- message: z17.string().optional(),
3057
- parentToolCallId: z17.string().optional()
3575
+ z18.object({
3576
+ type: z18.literal("item/mcpToolCall/progress"),
3577
+ threadId: z18.string(),
3578
+ providerThreadId: z18.string(),
3579
+ itemId: z18.string(),
3580
+ message: z18.string().optional(),
3581
+ parentToolCallId: z18.string().optional()
3058
3582
  }),
3059
3583
  toolCallProgressEventSchema,
3060
- z17.object({
3061
- type: z17.literal("item/backgroundTask/progress"),
3062
- threadId: z17.string(),
3063
- providerThreadId: z17.string(),
3584
+ z18.object({
3585
+ type: z18.literal("item/backgroundTask/progress"),
3586
+ threadId: z18.string(),
3587
+ providerThreadId: z18.string(),
3064
3588
  item: threadEventBackgroundTaskItemSchema
3065
3589
  }),
3066
- z17.object({
3067
- type: z17.literal("item/backgroundTask/completed"),
3068
- threadId: z17.string(),
3069
- providerThreadId: z17.string(),
3590
+ z18.object({
3591
+ type: z18.literal("item/backgroundTask/completed"),
3592
+ threadId: z18.string(),
3593
+ providerThreadId: z18.string(),
3070
3594
  item: threadEventBackgroundTaskItemSchema
3071
3595
  }),
3072
- z17.object({
3073
- type: z17.literal("item/delegation/progress"),
3074
- threadId: z17.string(),
3075
- providerThreadId: z17.string(),
3596
+ z18.object({
3597
+ type: z18.literal("item/delegation/progress"),
3598
+ threadId: z18.string(),
3599
+ providerThreadId: z18.string(),
3076
3600
  item: threadEventDelegationItemSchema
3077
3601
  }),
3078
- z17.object({
3079
- type: z17.literal("item/delegation/completed"),
3080
- threadId: z17.string(),
3081
- providerThreadId: z17.string(),
3602
+ z18.object({
3603
+ type: z18.literal("item/delegation/completed"),
3604
+ threadId: z18.string(),
3605
+ providerThreadId: z18.string(),
3082
3606
  item: threadEventDelegationItemSchema
3083
3607
  }),
3084
- z17.object({
3085
- type: z17.literal("thread/tokenUsage/updated"),
3086
- threadId: z17.string(),
3087
- providerThreadId: z17.string(),
3608
+ z18.object({
3609
+ type: z18.literal("thread/tokenUsage/updated"),
3610
+ threadId: z18.string(),
3611
+ providerThreadId: z18.string(),
3088
3612
  tokenUsage: threadEventTokenUsageSchema
3089
3613
  }),
3090
- z17.object({
3091
- type: z17.literal("thread/contextWindowUsage/updated"),
3092
- threadId: z17.string(),
3093
- providerThreadId: z17.string(),
3614
+ z18.object({
3615
+ type: z18.literal("thread/contextWindowUsage/updated"),
3616
+ threadId: z18.string(),
3617
+ providerThreadId: z18.string(),
3094
3618
  contextWindowUsage: threadEventContextWindowUsageSchema
3095
3619
  }),
3096
- z17.object({
3097
- type: z17.literal("turn/plan/updated"),
3098
- threadId: z17.string(),
3099
- providerThreadId: z17.string(),
3100
- plan: z17.array(threadEventPlanStepSchema),
3101
- explanation: z17.string().optional()
3620
+ z18.object({
3621
+ type: z18.literal("turn/plan/updated"),
3622
+ threadId: z18.string(),
3623
+ providerThreadId: z18.string(),
3624
+ plan: z18.array(threadEventPlanStepSchema),
3625
+ explanation: z18.string().optional()
3102
3626
  }),
3103
- z17.object({
3104
- type: z17.literal("turn/diff/updated"),
3105
- threadId: z17.string(),
3106
- providerThreadId: z17.string(),
3107
- diff: z17.string().optional()
3627
+ z18.object({
3628
+ type: z18.literal("turn/diff/updated"),
3629
+ threadId: z18.string(),
3630
+ providerThreadId: z18.string(),
3631
+ diff: z18.string().optional()
3108
3632
  }),
3109
- z17.object({
3110
- type: z17.literal("provider/error"),
3111
- threadId: z17.string(),
3112
- providerThreadId: z17.string(),
3113
- message: z17.string(),
3114
- detail: z17.string().optional(),
3115
- willRetry: z17.boolean().optional(),
3633
+ z18.object({
3634
+ type: z18.literal("provider/error"),
3635
+ threadId: z18.string(),
3636
+ providerThreadId: z18.string(),
3637
+ message: z18.string(),
3638
+ detail: z18.string().optional(),
3639
+ willRetry: z18.boolean().optional(),
3116
3640
  errorInfo: providerErrorInfoSchema.optional()
3117
3641
  }),
3118
- z17.object({
3119
- type: z17.literal("provider/rateLimits/updated"),
3120
- threadId: z17.string(),
3121
- providerThreadId: z17.string(),
3642
+ z18.object({
3643
+ type: z18.literal("provider/rateLimits/updated"),
3644
+ threadId: z18.string(),
3645
+ providerThreadId: z18.string(),
3122
3646
  rateLimits: providerRateLimitStateSchema
3123
3647
  }),
3124
- z17.object({
3125
- type: z17.literal("provider.env-resolved"),
3126
- threadId: z17.string(),
3127
- providerThreadId: z17.string(),
3128
- entries: z17.array(
3129
- z17.object({
3130
- name: z17.string(),
3131
- source: z17.union([
3132
- z17.literal("shell"),
3133
- z17.object({ plugin: z17.string() }).strict(),
3134
- z17.object({ core: z17.enum(["machine-git", "machine-environment"]) }).strict()
3648
+ z18.object({
3649
+ type: z18.literal("provider.env-resolved"),
3650
+ threadId: z18.string(),
3651
+ providerThreadId: z18.string(),
3652
+ entries: z18.array(
3653
+ z18.object({
3654
+ name: z18.string(),
3655
+ source: z18.union([
3656
+ z18.literal("shell"),
3657
+ z18.object({ plugin: z18.string() }).strict(),
3658
+ z18.object({ core: z18.enum(["machine-git", "machine-environment"]) }).strict()
3135
3659
  ]),
3136
- value: z17.union([
3137
- z17.string(),
3138
- z17.object({ masked: z17.literal(true) }).strict()
3660
+ value: z18.union([
3661
+ z18.string(),
3662
+ z18.object({ masked: z18.literal(true) }).strict()
3139
3663
  ]),
3140
- reason: z17.string().optional()
3664
+ reason: z18.string().optional()
3141
3665
  }).strict()
3142
3666
  )
3143
3667
  }),
3144
- z17.object({
3145
- type: z17.literal("thread/extensionState/updated"),
3146
- threadId: z17.string(),
3147
- providerThreadId: z17.string(),
3668
+ z18.object({
3669
+ type: z18.literal("thread/extensionState/updated"),
3670
+ threadId: z18.string(),
3671
+ providerThreadId: z18.string(),
3148
3672
  kind: extensionKindSchema,
3149
3673
  payload: jsonValueSchema
3150
3674
  }),
3151
- z17.object({
3152
- type: z17.literal("provider/warning"),
3153
- threadId: z17.string(),
3154
- providerThreadId: z17.string(),
3675
+ z18.object({
3676
+ type: z18.literal("provider/warning"),
3677
+ threadId: z18.string(),
3678
+ providerThreadId: z18.string(),
3155
3679
  category: threadEventWarningCategorySchema,
3156
- summary: z17.string().optional(),
3157
- details: z17.string().optional()
3680
+ summary: z18.string().optional(),
3681
+ details: z18.string().optional()
3158
3682
  }),
3159
- z17.object({
3160
- type: z17.literal("provider/modelFallback"),
3161
- threadId: z17.string(),
3162
- providerThreadId: z17.string(),
3163
- originalModel: z17.string().min(1),
3164
- fallbackModel: z17.string().min(1),
3165
- reason: z17.enum(["refusal", "provider"]),
3166
- message: z17.string()
3683
+ z18.object({
3684
+ type: z18.literal("provider/modelFallback"),
3685
+ threadId: z18.string(),
3686
+ providerThreadId: z18.string(),
3687
+ originalModel: z18.string().min(1),
3688
+ fallbackModel: z18.string().min(1),
3689
+ reason: z18.enum(["refusal", "provider"]),
3690
+ message: z18.string()
3167
3691
  }),
3168
3692
  providerUnhandledEventSchema
3169
3693
  ]);
3170
- var scopedEventDataSchema = z17.object({
3694
+ var scopedEventDataSchema = z18.object({
3171
3695
  scope: threadEventScopeSchema
3172
3696
  });
3173
3697
  var providerEventSchema = unscopedProviderEventSchema.and(
@@ -3176,58 +3700,58 @@ var providerEventSchema = unscopedProviderEventSchema.and(
3176
3700
  var providerEventTypeValues = unscopedProviderEventSchema.options.map(
3177
3701
  (option) => option.shape.type.value
3178
3702
  );
3179
- var unscopedSystemEventSchema = z17.discriminatedUnion("type", [
3180
- z17.object({
3181
- type: z17.literal("client/thread/start"),
3182
- threadId: z17.string()
3703
+ var unscopedSystemEventSchema = z18.discriminatedUnion("type", [
3704
+ z18.object({
3705
+ type: z18.literal("client/thread/start"),
3706
+ threadId: z18.string()
3183
3707
  }).merge(clientTurnLifecycleEventDataSchema),
3184
- z17.object({
3185
- type: z17.literal("client/turn/requested"),
3186
- threadId: z17.string()
3708
+ z18.object({
3709
+ type: z18.literal("client/turn/requested"),
3710
+ threadId: z18.string()
3187
3711
  }).merge(turnRequestEventDataSchema),
3188
- z17.object({
3189
- type: z17.literal("client/turn/rejected"),
3190
- threadId: z17.string()
3712
+ z18.object({
3713
+ type: z18.literal("client/turn/rejected"),
3714
+ threadId: z18.string()
3191
3715
  }).merge(turnRequestRejectedEventDataSchema),
3192
- z17.object({
3193
- type: z17.literal("client/turn/start"),
3194
- threadId: z17.string()
3716
+ z18.object({
3717
+ type: z18.literal("client/turn/start"),
3718
+ threadId: z18.string()
3195
3719
  }).merge(clientTurnLifecycleEventDataSchema),
3196
- z17.object({
3197
- type: z17.literal("system/error"),
3198
- threadId: z17.string()
3720
+ z18.object({
3721
+ type: z18.literal("system/error"),
3722
+ threadId: z18.string()
3199
3723
  }).merge(systemErrorEventDataSchema),
3200
- z17.object({
3201
- type: z17.literal("system/manager/user_message"),
3202
- threadId: z17.string()
3724
+ z18.object({
3725
+ type: z18.literal("system/manager/user_message"),
3726
+ threadId: z18.string()
3203
3727
  }).merge(systemLegacyUserMessageEventDataSchema),
3204
- z17.object({
3205
- type: z17.literal("system/thread/interrupted"),
3206
- threadId: z17.string()
3728
+ z18.object({
3729
+ type: z18.literal("system/thread/interrupted"),
3730
+ threadId: z18.string()
3207
3731
  }).merge(systemThreadInterruptedEventDataSchema),
3208
- z17.object({
3209
- type: z17.literal("system/operation"),
3210
- threadId: z17.string()
3732
+ z18.object({
3733
+ type: z18.literal("system/operation"),
3734
+ threadId: z18.string()
3211
3735
  }).merge(systemOperationEventDataSchema),
3212
- z17.object({
3213
- type: z17.literal("system/interaction/lifecycle"),
3214
- threadId: z17.string()
3736
+ z18.object({
3737
+ type: z18.literal("system/interaction/lifecycle"),
3738
+ threadId: z18.string()
3215
3739
  }).merge(systemInteractionLifecycleEventDataSchema),
3216
- z17.object({
3217
- type: z17.literal("system/permissionGrant/lifecycle"),
3218
- threadId: z17.string()
3740
+ z18.object({
3741
+ type: z18.literal("system/permissionGrant/lifecycle"),
3742
+ threadId: z18.string()
3219
3743
  }).merge(systemPermissionGrantLifecycleEventDataSchema),
3220
- z17.object({
3221
- type: z17.literal("system/userQuestion/lifecycle"),
3222
- threadId: z17.string()
3744
+ z18.object({
3745
+ type: z18.literal("system/userQuestion/lifecycle"),
3746
+ threadId: z18.string()
3223
3747
  }).merge(systemUserQuestionLifecycleEventDataSchema),
3224
- z17.object({
3225
- type: z17.literal("system/thread-provisioning"),
3226
- threadId: z17.string()
3748
+ z18.object({
3749
+ type: z18.literal("system/thread-provisioning"),
3750
+ threadId: z18.string()
3227
3751
  }).merge(systemThreadProvisioningEventDataSchema),
3228
- z17.object({
3229
- type: z17.literal("system/provider-turn-watchdog"),
3230
- threadId: z17.string()
3752
+ z18.object({
3753
+ type: z18.literal("system/provider-turn-watchdog"),
3754
+ threadId: z18.string()
3231
3755
  }).merge(systemProviderTurnWatchdogEventDataSchema)
3232
3756
  ]);
3233
3757
  var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
@@ -3235,13 +3759,13 @@ var legacyClientRequestKey = ["clientRequest", "Sequence"].join("");
3235
3759
  function isEventPropertyBag(value) {
3236
3760
  return typeof value === "object" && value !== null && !Array.isArray(value);
3237
3761
  }
3238
- var rejectLegacyClientRequestSequenceSchema = z17.unknown().superRefine((value, ctx) => {
3762
+ var rejectLegacyClientRequestSequenceSchema = z18.unknown().superRefine((value, ctx) => {
3239
3763
  if (!isEventPropertyBag(value)) {
3240
3764
  return;
3241
3765
  }
3242
3766
  if (Object.hasOwn(value, legacyClientRequestKey)) {
3243
3767
  ctx.addIssue({
3244
- code: z17.ZodIssueCode.custom,
3768
+ code: z18.ZodIssueCode.custom,
3245
3769
  message: "legacy request sequence field is no longer accepted",
3246
3770
  path: [legacyClientRequestKey]
3247
3771
  });
@@ -3249,21 +3773,21 @@ var rejectLegacyClientRequestSequenceSchema = z17.unknown().superRefine((value,
3249
3773
  const item = value.item;
3250
3774
  if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
3251
3775
  ctx.addIssue({
3252
- code: z17.ZodIssueCode.custom,
3776
+ code: z18.ZodIssueCode.custom,
3253
3777
  message: "legacy user-message request sequence field is no longer accepted",
3254
3778
  path: ["item", legacyClientRequestKey]
3255
3779
  });
3256
3780
  }
3257
3781
  });
3258
3782
  var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
3259
- z17.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
3783
+ z18.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
3260
3784
  const result = validateThreadEventScope({
3261
3785
  type: event.type,
3262
3786
  scope: event.scope
3263
3787
  });
3264
3788
  if (!result.valid) {
3265
3789
  ctx.addIssue({
3266
- code: z17.ZodIssueCode.custom,
3790
+ code: z18.ZodIssueCode.custom,
3267
3791
  message: result.message ?? "Invalid thread event scope",
3268
3792
  path: ["scope"]
3269
3793
  });
@@ -3276,7 +3800,7 @@ var threadEventTypeValues = [
3276
3800
  ...systemEventTypeValues
3277
3801
  ];
3278
3802
  var threadEventTypeSet = new Set(threadEventTypeValues);
3279
- var threadEventTypeSchema = z17.string().refine(
3803
+ var threadEventTypeSchema = z18.string().refine(
3280
3804
  (value) => threadEventTypeSet.has(value),
3281
3805
  "Invalid thread event type"
3282
3806
  );
@@ -3287,95 +3811,96 @@ function toPositiveNumber(value) {
3287
3811
  }
3288
3812
 
3289
3813
  // ../domain/src/provider-fork.ts
3290
- import { z as z18 } from "zod";
3814
+ import { z as z19 } from "zod";
3291
3815
  var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
3292
- var providerForkSchema = z18.enum(PROVIDER_FORK_VALUES);
3816
+ var providerForkSchema = z19.enum(PROVIDER_FORK_VALUES);
3293
3817
 
3294
3818
  // ../domain/src/provider-types.ts
3295
- import { z as z19 } from "zod";
3296
- var modelReasoningEffortSchema = z19.object({
3819
+ import { z as z20 } from "zod";
3820
+ var modelReasoningEffortSchema = z20.object({
3297
3821
  reasoningEffort: reasoningLevelSchema,
3298
- description: z19.string()
3299
- });
3300
- var availableModelSchema = z19.object({
3301
- id: z19.string(),
3302
- model: z19.string(),
3303
- displayName: z19.string(),
3304
- routeProviderId: z19.string().min(1).optional(),
3305
- description: z19.string(),
3306
- supportedReasoningEfforts: z19.array(modelReasoningEffortSchema),
3822
+ description: z20.string()
3823
+ });
3824
+ var availableModelSchema = z20.object({
3825
+ id: z20.string(),
3826
+ model: z20.string(),
3827
+ displayName: z20.string(),
3828
+ routeProviderId: z20.string().min(1).optional(),
3829
+ description: z20.string(),
3830
+ supportedReasoningEfforts: z20.array(modelReasoningEffortSchema),
3307
3831
  defaultReasoningEffort: reasoningLevelSchema,
3308
- isDefault: z19.boolean()
3309
- });
3310
- var providerModelCatalogScopeSchema = z19.enum(["host", "workspace"]);
3311
- var providerCapabilitiesSchema = z19.object({
3312
- supportsThreadArchive: z19.boolean(),
3313
- supportsThreadRename: z19.boolean(),
3314
- supportsServiceTier: z19.boolean(),
3315
- supportsNativeUserQuestion: z19.boolean(),
3316
- supportsFork: z19.boolean(),
3317
- supportsSessionRewind: z19.boolean(),
3318
- permissionModes: z19.array(permissionModeSchema).min(1),
3832
+ isDefault: z20.boolean()
3833
+ });
3834
+ var providerModelCatalogScopeSchema = z20.enum(["host", "workspace"]);
3835
+ var providerCapabilitiesSchema = z20.object({
3836
+ supportsThreadArchive: z20.boolean(),
3837
+ supportsThreadRename: z20.boolean(),
3838
+ supportsServiceTier: z20.boolean(),
3839
+ supportsNativeUserQuestion: z20.boolean(),
3840
+ supportsFork: z20.boolean(),
3841
+ supportsSessionRewind: z20.boolean(),
3842
+ permissionModes: z20.array(permissionModeSchema).min(1),
3319
3843
  modelCatalogScope: providerModelCatalogScopeSchema
3320
3844
  });
3321
- var providerComposerCommandSchema = z19.object({
3845
+ var providerComposerCommandSchema = z20.object({
3322
3846
  trigger: promptMentionCommandTriggerSchema,
3323
- name: z19.string().min(1).regex(/^[^\s/$]+$/u),
3324
- trailingText: z19.string().regex(/^\s*$/u)
3847
+ name: z20.string().min(1).regex(/^[^\s/$]+$/u),
3848
+ trailingText: z20.string().regex(/^\s*$/u)
3325
3849
  });
3326
- var providerComposerActionSchema = z19.discriminatedUnion("kind", [
3327
- z19.object({
3328
- kind: z19.literal("skills"),
3850
+ var providerComposerActionSchema = z20.discriminatedUnion("kind", [
3851
+ z20.object({
3852
+ kind: z20.literal("skills"),
3329
3853
  trigger: promptMentionCommandTriggerSchema
3330
3854
  }),
3331
- z19.object({
3332
- kind: z19.literal("plan"),
3855
+ z20.object({
3856
+ kind: z20.literal("plan"),
3333
3857
  command: providerComposerCommandSchema
3334
3858
  }),
3335
- z19.object({
3336
- kind: z19.literal("goal"),
3859
+ z20.object({
3860
+ kind: z20.literal("goal"),
3337
3861
  command: providerComposerCommandSchema
3338
3862
  })
3339
3863
  ]);
3340
- var providerStringsSchema = z19.object({
3341
- signInHint: z19.string().min(1),
3342
- expiredHint: z19.string().min(1),
3343
- installUrl: z19.string().min(1),
3344
- brandPrefix: z19.string().min(1).optional(),
3345
- planModeCopy: z19.string().min(1).optional(),
3346
- iconTint: z19.object({ light: z19.string().min(1), dark: z19.string().min(1) }).optional()
3347
- });
3348
- var providerOptionDescriptorSchema = z19.object({
3349
- id: z19.string().min(1),
3350
- label: z19.string().min(1),
3351
- description: z19.string().min(1).optional()
3352
- });
3353
- var providerExtensionKindInfoSchema = z19.object({
3354
- item: z19.boolean(),
3355
- state: z19.boolean()
3356
- });
3357
- var providerExtensionKindsSchema = z19.record(
3864
+ var providerStringsSchema = z20.object({
3865
+ signInHint: z20.string().min(1),
3866
+ expiredHint: z20.string().min(1),
3867
+ installUrl: z20.string().min(1),
3868
+ brandPrefix: z20.string().min(1).optional(),
3869
+ planModeCopy: z20.string().min(1).optional(),
3870
+ iconTint: z20.object({ light: z20.string().min(1), dark: z20.string().min(1) }).optional()
3871
+ });
3872
+ var providerOptionDescriptorSchema = z20.object({
3873
+ id: z20.string().min(1),
3874
+ label: z20.string().min(1),
3875
+ description: z20.string().min(1).optional()
3876
+ });
3877
+ var providerExtensionKindInfoSchema = z20.object({
3878
+ item: z20.boolean(),
3879
+ state: z20.boolean()
3880
+ });
3881
+ var providerExtensionKindsSchema = z20.record(
3358
3882
  extensionKindSchema,
3359
3883
  providerExtensionKindInfoSchema
3360
3884
  );
3361
- var providerInfoSchema = z19.object({
3362
- id: z19.string(),
3363
- pluginId: z19.string().min(1),
3364
- displayName: z19.string(),
3365
- family: z19.string().min(1).optional(),
3366
- icon: z19.object({ glyph: z19.string().min(1) }).optional(),
3367
- logoUrl: z19.string().min(1).nullable(),
3368
- maintenance: z19.object({
3369
- health: z19.boolean(),
3370
- usage: z19.boolean(),
3371
- installation: z19.boolean()
3885
+ var providerInfoSchema = z20.object({
3886
+ id: z20.string(),
3887
+ pluginId: z20.string().min(1),
3888
+ displayName: z20.string(),
3889
+ family: z20.string().min(1).optional(),
3890
+ icon: z20.object({ glyph: z20.string().min(1) }).optional(),
3891
+ logoUrl: z20.string().min(1).nullable(),
3892
+ maintenance: z20.object({
3893
+ health: z20.boolean(),
3894
+ usage: z20.boolean(),
3895
+ installation: z20.boolean()
3372
3896
  }),
3373
3897
  capabilities: providerCapabilitiesSchema,
3374
- composerActions: z19.array(providerComposerActionSchema),
3375
- available: z19.boolean(),
3898
+ composerActions: z20.array(providerComposerActionSchema),
3899
+ completedTurnDisplay: completedTurnDisplaySchema,
3900
+ available: z20.boolean(),
3376
3901
  strings: providerStringsSchema.optional(),
3377
- serviceTiers: z19.array(providerOptionDescriptorSchema).optional(),
3378
- reasoningLevels: z19.array(providerOptionDescriptorSchema).optional(),
3902
+ serviceTiers: z20.array(providerOptionDescriptorSchema).optional(),
3903
+ reasoningLevels: z20.array(providerOptionDescriptorSchema).optional(),
3379
3904
  extensionKinds: providerExtensionKindsSchema.optional()
3380
3905
  });
3381
3906
  var providerRecoveryKindValues = [
@@ -3385,34 +3910,34 @@ var providerRecoveryKindValues = [
3385
3910
  "staleTurn",
3386
3911
  "rateLimited"
3387
3912
  ];
3388
- var providerRecoveryKindSchema = z19.enum(providerRecoveryKindValues);
3389
- var toolCallOutputItemSchema = z19.discriminatedUnion("type", [
3390
- z19.object({
3391
- type: z19.literal("inputText"),
3392
- text: z19.string()
3913
+ var providerRecoveryKindSchema = z20.enum(providerRecoveryKindValues);
3914
+ var toolCallOutputItemSchema = z20.discriminatedUnion("type", [
3915
+ z20.object({
3916
+ type: z20.literal("inputText"),
3917
+ text: z20.string()
3393
3918
  }),
3394
- z19.object({
3395
- type: z19.literal("inputImage"),
3396
- imageUrl: z19.string()
3919
+ z20.object({
3920
+ type: z20.literal("inputImage"),
3921
+ imageUrl: z20.string()
3397
3922
  })
3398
3923
  ]);
3399
- var toolCallRequestSchema = z19.object({
3400
- requestId: z19.union([z19.string().min(1), z19.number()]),
3401
- threadId: z19.string().min(1),
3402
- providerThreadId: z19.string().min(1),
3403
- turnId: z19.string().min(1),
3404
- callId: z19.string().min(1),
3405
- tool: z19.string().min(1),
3406
- arguments: z19.unknown().optional()
3407
- });
3408
- var toolCallResponseSchema = z19.object({
3409
- contentItems: z19.array(toolCallOutputItemSchema),
3410
- success: z19.boolean()
3411
- });
3412
- var dynamicToolSchema = z19.object({
3413
- name: z19.string(),
3414
- description: z19.string(),
3415
- inputSchema: z19.unknown(),
3924
+ var toolCallRequestSchema = z20.object({
3925
+ requestId: z20.union([z20.string().min(1), z20.number()]),
3926
+ threadId: z20.string().min(1),
3927
+ providerThreadId: z20.string().min(1),
3928
+ turnId: z20.string().min(1),
3929
+ callId: z20.string().min(1),
3930
+ tool: z20.string().min(1),
3931
+ arguments: z20.unknown().optional()
3932
+ });
3933
+ var toolCallResponseSchema = z20.object({
3934
+ contentItems: z20.array(toolCallOutputItemSchema),
3935
+ success: z20.boolean()
3936
+ });
3937
+ var dynamicToolSchema = z20.object({
3938
+ name: z20.string(),
3939
+ description: z20.string(),
3940
+ inputSchema: z20.unknown(),
3416
3941
  presentation: threadEventItemPresentationSchema.optional()
3417
3942
  });
3418
3943
 
@@ -3464,60 +3989,60 @@ function reasoningEffortsForLevels(levels) {
3464
3989
  }
3465
3990
 
3466
3991
  // ../provider-bridge-protocol/src/bridge-requests.ts
3467
- import { z as z20 } from "zod";
3992
+ import { z as z21 } from "zod";
3468
3993
  var BRIDGE_INBOUND_REQUEST_METHODS = {
3469
3994
  toolCall: "item/tool/call",
3470
3995
  interactionRequest: "interaction/request"
3471
3996
  };
3472
- var toolCallRequestParamsSchema = z20.object({
3473
- providerThreadId: z20.string().min(1),
3474
- threadId: z20.string().min(1).optional(),
3475
- turnId: z20.union([z20.string().min(1), z20.null()]),
3476
- callId: z20.string().min(1),
3477
- tool: z20.string().min(1),
3478
- arguments: z20.unknown(),
3479
- providerNativeIds: z20.boolean().optional()
3997
+ var toolCallRequestParamsSchema = z21.object({
3998
+ providerThreadId: z21.string().min(1),
3999
+ threadId: z21.string().min(1).optional(),
4000
+ turnId: z21.union([z21.string().min(1), z21.null()]),
4001
+ callId: z21.string().min(1),
4002
+ tool: z21.string().min(1),
4003
+ arguments: z21.unknown(),
4004
+ providerNativeIds: z21.boolean().optional()
3480
4005
  }).passthrough();
3481
- var toolCallResultSchema = z20.object({
3482
- success: z20.boolean(),
3483
- contentItems: z20.array(
3484
- z20.discriminatedUnion("type", [
3485
- z20.object({ type: z20.literal("inputText"), text: z20.string() }),
3486
- z20.object({
3487
- type: z20.literal("inputImage"),
3488
- imageUrl: z20.string().min(1)
4006
+ var toolCallResultSchema = z21.object({
4007
+ success: z21.boolean(),
4008
+ contentItems: z21.array(
4009
+ z21.discriminatedUnion("type", [
4010
+ z21.object({ type: z21.literal("inputText"), text: z21.string() }),
4011
+ z21.object({
4012
+ type: z21.literal("inputImage"),
4013
+ imageUrl: z21.string().min(1)
3489
4014
  })
3490
4015
  ])
3491
4016
  )
3492
4017
  }).passthrough();
3493
- var interactionRequestParamsSchema = z20.object({
3494
- providerThreadId: z20.string().min(1),
3495
- threadId: z20.string().min(1).optional(),
3496
- turnId: z20.union([z20.string().min(1), z20.null()]),
4018
+ var interactionRequestParamsSchema = z21.object({
4019
+ providerThreadId: z21.string().min(1),
4020
+ threadId: z21.string().min(1).optional(),
4021
+ turnId: z21.union([z21.string().min(1), z21.null()]),
3497
4022
  payload: pendingInteractionPayloadSchema,
3498
- providerNativeIds: z20.boolean().optional()
4023
+ providerNativeIds: z21.boolean().optional()
3499
4024
  }).passthrough();
3500
4025
 
3501
4026
  // ../provider-bridge-protocol/src/bridge-kit/bridge-tool-calls.ts
3502
- var bridgeRequestEnvelopeSchema = z21.object({
3503
- jsonrpc: z21.literal("2.0"),
3504
- id: z21.union([z21.string(), z21.number()]),
3505
- method: z21.string(),
3506
- params: z21.record(z21.string(), z21.unknown()).optional()
3507
- });
3508
- var jsonRpcErrorSchema = z21.object({
3509
- code: z21.number(),
3510
- message: z21.string().optional(),
3511
- data: z21.unknown().optional()
3512
- });
3513
- var jsonRpcSuccessResponseSchema = z21.object({
3514
- jsonrpc: z21.literal("2.0"),
3515
- id: z21.union([z21.string(), z21.number()]),
3516
- result: z21.unknown()
3517
- });
3518
- var jsonRpcErrorResponseSchema = z21.object({
3519
- jsonrpc: z21.literal("2.0"),
3520
- id: z21.union([z21.string(), z21.number()]),
4027
+ var bridgeRequestEnvelopeSchema = z22.object({
4028
+ jsonrpc: z22.literal("2.0"),
4029
+ id: z22.union([z22.string(), z22.number()]),
4030
+ method: z22.string(),
4031
+ params: z22.record(z22.string(), z22.unknown()).optional()
4032
+ });
4033
+ var jsonRpcErrorSchema = z22.object({
4034
+ code: z22.number(),
4035
+ message: z22.string().optional(),
4036
+ data: z22.unknown().optional()
4037
+ });
4038
+ var jsonRpcSuccessResponseSchema = z22.object({
4039
+ jsonrpc: z22.literal("2.0"),
4040
+ id: z22.union([z22.string(), z22.number()]),
4041
+ result: z22.unknown()
4042
+ });
4043
+ var jsonRpcErrorResponseSchema = z22.object({
4044
+ jsonrpc: z22.literal("2.0"),
4045
+ id: z22.union([z22.string(), z22.number()]),
3521
4046
  error: jsonRpcErrorSchema
3522
4047
  });
3523
4048
  function isJsonRpcRequest(input) {
@@ -3605,47 +4130,47 @@ function buildBridgeToolCallContent(result) {
3605
4130
  }
3606
4131
 
3607
4132
  // ../provider-bridge-protocol/src/bridge-kit/json-rpc-envelope.ts
3608
- import { z as z22 } from "zod";
3609
- var recordSchema = z22.record(z22.string(), z22.unknown());
3610
- var jsonRpcEnvelopeSchema = z22.object({
3611
- jsonrpc: z22.literal("2.0"),
3612
- method: z22.string(),
4133
+ import { z as z23 } from "zod";
4134
+ var recordSchema = z23.record(z23.string(), z23.unknown());
4135
+ var jsonRpcEnvelopeSchema = z23.object({
4136
+ jsonrpc: z23.literal("2.0"),
4137
+ method: z23.string(),
3613
4138
  params: recordSchema.optional()
3614
4139
  }).passthrough();
3615
- var sdkMessageEnvelopeSchema = z22.object({
3616
- jsonrpc: z22.literal("2.0"),
3617
- method: z22.literal("sdk/message"),
3618
- params: z22.object({
3619
- message: z22.unknown(),
3620
- threadId: z22.string().optional(),
3621
- parent_tool_use_id: z22.string().optional()
4140
+ var sdkMessageEnvelopeSchema = z23.object({
4141
+ jsonrpc: z23.literal("2.0"),
4142
+ method: z23.literal("sdk/message"),
4143
+ params: z23.object({
4144
+ message: z23.unknown(),
4145
+ threadId: z23.string().optional(),
4146
+ parent_tool_use_id: z23.string().optional()
3622
4147
  }).passthrough()
3623
4148
  }).passthrough();
3624
- var threadIdentityEnvelopeSchema = z22.object({
3625
- jsonrpc: z22.literal("2.0"),
3626
- method: z22.literal("thread/identity"),
3627
- params: z22.object({
3628
- threadId: z22.string().optional(),
3629
- providerThreadId: z22.string().optional()
4149
+ var threadIdentityEnvelopeSchema = z23.object({
4150
+ jsonrpc: z23.literal("2.0"),
4151
+ method: z23.literal("thread/identity"),
4152
+ params: z23.object({
4153
+ threadId: z23.string().optional(),
4154
+ providerThreadId: z23.string().optional()
3630
4155
  }).passthrough()
3631
4156
  }).passthrough();
3632
- var threadContextWindowUsageEnvelopeSchema = z22.object({
3633
- jsonrpc: z22.literal("2.0"),
3634
- method: z22.literal("thread/contextWindowUsage/updated"),
3635
- params: z22.object({
3636
- threadId: z22.string().optional(),
3637
- contextWindowUsage: z22.object({
3638
- usedTokens: z22.number().nullable(),
3639
- modelContextWindow: z22.number().nullable(),
3640
- estimated: z22.boolean()
4157
+ var threadContextWindowUsageEnvelopeSchema = z23.object({
4158
+ jsonrpc: z23.literal("2.0"),
4159
+ method: z23.literal("thread/contextWindowUsage/updated"),
4160
+ params: z23.object({
4161
+ threadId: z23.string().optional(),
4162
+ contextWindowUsage: z23.object({
4163
+ usedTokens: z23.number().nullable(),
4164
+ modelContextWindow: z23.number().nullable(),
4165
+ estimated: z23.boolean()
3641
4166
  })
3642
4167
  }).passthrough()
3643
4168
  }).passthrough();
3644
- var errorEnvelopeSchema = z22.object({
3645
- jsonrpc: z22.literal("2.0"),
3646
- method: z22.literal("error"),
3647
- params: z22.object({
3648
- message: z22.string().optional()
4169
+ var errorEnvelopeSchema = z23.object({
4170
+ jsonrpc: z23.literal("2.0"),
4171
+ method: z23.literal("error"),
4172
+ params: z23.object({
4173
+ message: z23.string().optional()
3649
4174
  }).passthrough().optional()
3650
4175
  }).passthrough();
3651
4176
 
@@ -3826,12 +4351,14 @@ function experimental_defineProviderBridge(definition) {
3826
4351
  }
3827
4352
 
3828
4353
  // ../provider-bridge-protocol/src/bridge-kit/provider-maintenance-kit.ts
4354
+ var import_compare = __toESM(require_compare(), 1);
4355
+ var import_valid = __toESM(require_valid(), 1);
3829
4356
  import { execFile } from "node:child_process";
3830
4357
  import { constants as fsConstants } from "node:fs";
3831
4358
  import { access } from "node:fs/promises";
3832
4359
  import path from "node:path";
3833
4360
  import { promisify } from "node:util";
3834
- import { z as z23 } from "zod";
4361
+ import { z as z24 } from "zod";
3835
4362
  var execFileAsync = promisify(execFile);
3836
4363
  var CLI_PROBE_TIMEOUT_MS = 5e3;
3837
4364
  var INSTALLATION_CHECK_TIMEOUT_MS = 15e3;
@@ -3866,7 +4393,8 @@ ${stderr}`.trim();
3866
4393
  }
3867
4394
  }
3868
4395
  function versionFrom(value) {
3869
- return value?.match(/\bv?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)\b/u)?.[1] ?? null;
4396
+ const candidate = value?.match(/\bv?(\d+\.\d+\.\d+[0-9A-Za-z.+-]*)/u)?.[1];
4397
+ return candidate !== void 0 && (0, import_valid.default)(candidate) !== null ? candidate : null;
3870
4398
  }
3871
4399
  async function readCliVersion(command) {
3872
4400
  try {
@@ -3875,32 +4403,14 @@ async function readCliVersion(command) {
3875
4403
  });
3876
4404
  probe.child.stdin?.end();
3877
4405
  const { stdout, stderr } = await probe;
3878
- return `${stdout}
3879
- ${stderr}`.match(/\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?/u)?.[0] ?? null;
4406
+ return versionFrom(`${stdout}
4407
+ ${stderr}`);
3880
4408
  } catch {
3881
4409
  return null;
3882
4410
  }
3883
4411
  }
3884
4412
  function compareVersions(left, right) {
3885
- const parse = (value) => {
3886
- const match = value.match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/u);
3887
- return match === null ? { core: [0, 0, 0], prerelease: null } : {
3888
- core: [Number(match[1]), Number(match[2]), Number(match[3])],
3889
- prerelease: match[4] ?? null
3890
- };
3891
- };
3892
- const a = parse(left);
3893
- const b = parse(right);
3894
- for (let index = 0; index < 3; index += 1) {
3895
- const delta = (a.core[index] ?? 0) - (b.core[index] ?? 0);
3896
- if (delta !== 0) return delta;
3897
- }
3898
- if (a.prerelease === null && b.prerelease !== null) return 1;
3899
- if (a.prerelease !== null && b.prerelease === null) return -1;
3900
- if (a.prerelease !== null && b.prerelease !== null) {
3901
- return a.prerelease.localeCompare(b.prerelease);
3902
- }
3903
- return 0;
4413
+ return (0, import_compare.default)(left, right);
3904
4414
  }
3905
4415
  function npmCommand() {
3906
4416
  return process.platform === "win32" ? "npm.cmd" : "npm";
@@ -3938,8 +4448,8 @@ function firstLine(value) {
3938
4448
  function npmGlobalPackageVersion(value, npmPackage) {
3939
4449
  if (value === null) return null;
3940
4450
  try {
3941
- const parsed = z23.object({
3942
- dependencies: z23.record(z23.string(), z23.object({ version: z23.string().min(1) })).default({})
4451
+ const parsed = z24.object({
4452
+ dependencies: z24.record(z24.string(), z24.object({ version: z24.string().min(1) })).default({})
3943
4453
  }).safeParse(JSON.parse(value));
3944
4454
  return parsed.success ? parsed.data.dependencies[npmPackage]?.version ?? null : null;
3945
4455
  } catch {
@@ -3975,6 +4485,12 @@ function clampPercent(value) {
3975
4485
  );
3976
4486
  }
3977
4487
 
4488
+ // ../provider-bridge-protocol/src/bridge-kit/provider-tool-call-contract.ts
4489
+ import { z as z25 } from "zod";
4490
+ var providerToolCallCancellationSchema = z25.object({
4491
+ requestId: z25.union([z25.string(), z25.number().int()])
4492
+ });
4493
+
3978
4494
  // ../provider-bridge-protocol/src/bridge-kit/provider-visibility.ts
3979
4495
  function createProviderVisibilityMetadata(args) {
3980
4496
  return {
@@ -3987,10 +4503,10 @@ function createProviderVisibilityMetadata(args) {
3987
4503
  }
3988
4504
 
3989
4505
  // ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
3990
- import { z as z25 } from "zod";
4506
+ import { z as z27 } from "zod";
3991
4507
 
3992
4508
  // ../provider-bridge-protocol/src/errors.ts
3993
- import { z as z24 } from "zod";
4509
+ import { z as z26 } from "zod";
3994
4510
  var BRIDGE_JSON_RPC_ERRORS = {
3995
4511
  INVALID_PARAMS: -32602,
3996
4512
  METHOD_NOT_FOUND: -32601,
@@ -3999,12 +4515,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
3999
4515
  SESSION_NOT_RESTORABLE: -32002,
4000
4516
  FORK_CHECKPOINT_UNSUPPORTED: -32003
4001
4517
  };
4002
- var providerRecoveryHintSchema = z24.object({
4518
+ var providerRecoveryHintSchema = z26.object({
4003
4519
  kind: providerRecoveryKindSchema,
4004
- message: z24.string().min(1),
4005
- retryable: z24.boolean()
4520
+ message: z26.string().min(1),
4521
+ retryable: z26.boolean()
4006
4522
  });
4007
- var bridgeErrorDataSchema = z24.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
4523
+ var bridgeErrorDataSchema = z26.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
4008
4524
 
4009
4525
  // ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
4010
4526
  var JSON_RPC_INVALID_PARAMS_CODE = -32602;
@@ -4022,7 +4538,7 @@ var ProviderResponseEncodeError = class extends Error {
4022
4538
  this.name = "ProviderResponseEncodeError";
4023
4539
  }
4024
4540
  };
4025
- var ignoredJsonRpcResultSchema = z25.unknown();
4541
+ var ignoredJsonRpcResultSchema = z27.unknown();
4026
4542
 
4027
4543
  // ../provider-bridge-protocol/src/version.ts
4028
4544
  var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
@@ -4030,66 +4546,66 @@ var THREAD_DELTA_GRAMMAR_V2 = PROVIDER_BRIDGE_PROTOCOL_VERSION;
4030
4546
  var THREAD_DELTA_GRAMMAR_V3 = 3;
4031
4547
 
4032
4548
  // ../provider-bridge-protocol/src/handshake.ts
4033
- import { z as z26 } from "zod";
4034
- var bridgeGrammarVersionsSchema = z26.tuple([z26.number().int().positive(), z26.number().int().positive()]).refine(([min, max]) => min <= max, {
4549
+ import { z as z28 } from "zod";
4550
+ var bridgeGrammarVersionsSchema = z28.tuple([z28.number().int().positive(), z28.number().int().positive()]).refine(([min, max]) => min <= max, {
4035
4551
  message: "grammarVersions must be an ascending [min, max] range"
4036
4552
  });
4037
- var bridgeSteerModeSchema = z26.enum(["inject", "queue"]);
4038
- var bridgeCapabilitiesSchema = z26.object({
4039
- sessionRestore: z26.boolean().default(false),
4040
- threadArchive: z26.boolean().default(false),
4041
- threadRename: z26.boolean().default(false),
4042
- threadGoalClear: z26.boolean().default(false),
4553
+ var bridgeSteerModeSchema = z28.enum(["inject", "queue"]);
4554
+ var bridgeCapabilitiesSchema = z28.object({
4555
+ sessionRestore: z28.boolean().default(false),
4556
+ threadArchive: z28.boolean().default(false),
4557
+ threadRename: z28.boolean().default(false),
4558
+ threadGoalClear: z28.boolean().default(false),
4043
4559
  fork: providerForkSchema.default("none"),
4044
- approvalEnforcedBy: z26.enum(["runtime", "provider"]).default("runtime"),
4560
+ approvalEnforcedBy: z28.enum(["runtime", "provider"]).default("runtime"),
4045
4561
  grammarVersions: bridgeGrammarVersionsSchema.default([
4046
4562
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
4047
4563
  PROVIDER_BRIDGE_PROTOCOL_VERSION
4048
4564
  ]),
4049
4565
  steerMode: bridgeSteerModeSchema.default("queue"),
4050
- skills: z26.object({ configure: z26.boolean().default(false) }).default({ configure: false })
4566
+ skills: z28.object({ configure: z28.boolean().default(false) }).default({ configure: false })
4051
4567
  }).passthrough();
4052
- var initializeParamsSchema = z26.object({
4053
- protocolVersion: z26.number().int().positive(),
4054
- client: z26.object({ name: z26.string().min(1), version: z26.string().min(1) }),
4568
+ var initializeParamsSchema = z28.object({
4569
+ protocolVersion: z28.number().int().positive(),
4570
+ client: z28.object({ name: z28.string().min(1), version: z28.string().min(1) }),
4055
4571
  grammarVersions: bridgeGrammarVersionsSchema.default([
4056
4572
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
4057
4573
  PROVIDER_BRIDGE_PROTOCOL_VERSION
4058
4574
  ])
4059
4575
  }).passthrough();
4060
- var initializeResultSchema = z26.object({
4061
- protocolVersion: z26.number().int().positive(),
4062
- capabilities: z26.preprocess(
4576
+ var initializeResultSchema = z28.object({
4577
+ protocolVersion: z28.number().int().positive(),
4578
+ capabilities: z28.preprocess(
4063
4579
  (value) => value ?? {},
4064
4580
  bridgeCapabilitiesSchema
4065
4581
  )
4066
4582
  }).passthrough();
4067
4583
 
4068
4584
  // ../provider-bridge-protocol/src/execution-options.ts
4069
- import { z as z27 } from "zod";
4070
- var bridgeExecutionOptionsSchema = z27.object({
4071
- model: z27.string().min(1).optional(),
4585
+ import { z as z29 } from "zod";
4586
+ var bridgeExecutionOptionsSchema = z29.object({
4587
+ model: z29.string().min(1).optional(),
4072
4588
  serviceTier: serviceTierSchema.optional(),
4073
4589
  reasoningLevel: reasoningLevelSchema.optional(),
4074
4590
  promptMode: promptModeSchema.optional(),
4075
- instructions: z27.string().optional(),
4076
- envVars: z27.record(z27.string(), z27.string()).optional(),
4077
- providerOptions: z27.record(z27.string(), z27.unknown()).optional()
4591
+ instructions: z29.string().optional(),
4592
+ envVars: z29.record(z29.string(), z29.string()).optional(),
4593
+ providerOptions: z29.record(z29.string(), z29.unknown()).optional()
4078
4594
  }).and(runtimePermissionPolicySchema);
4079
4595
 
4080
4596
  // ../provider-bridge-protocol/src/provider-maintenance.ts
4081
- import { z as z28 } from "zod";
4082
- var providerMaintenanceParamsSchema = z28.object({
4083
- providerId: z28.string().min(1),
4084
- cwd: z28.string().min(1).optional(),
4085
- providerOptions: z28.record(z28.string(), z28.unknown()).optional()
4597
+ import { z as z30 } from "zod";
4598
+ var providerMaintenanceParamsSchema = z30.object({
4599
+ providerId: z30.string().min(1),
4600
+ cwd: z30.string().min(1).optional(),
4601
+ providerOptions: z30.record(z30.string(), z30.unknown()).optional()
4086
4602
  }).passthrough();
4087
- var providerInstallationRequirementSchema = z28.enum(["thread_rewind"]);
4603
+ var providerInstallationRequirementSchema = z30.enum(["thread_rewind"]);
4088
4604
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
4089
4605
  requirement: providerInstallationRequirementSchema.optional()
4090
4606
  });
4091
- var providerHealthSchema = z28.object({
4092
- status: z28.enum([
4607
+ var providerHealthSchema = z30.object({
4608
+ status: z30.enum([
4093
4609
  "ready",
4094
4610
  "not_installed",
4095
4611
  "unauthenticated",
@@ -4097,114 +4613,114 @@ var providerHealthSchema = z28.object({
4097
4613
  "unsupported_version",
4098
4614
  "unknown"
4099
4615
  ]),
4100
- statusMessage: z28.string().min(1).nullable(),
4101
- accountEmail: z28.string().nullable(),
4102
- planLabel: z28.string().min(1).nullable(),
4103
- installedVersion: z28.string().min(1).nullable(),
4104
- minimumSupportedVersion: z28.string().min(1).nullable(),
4105
- canInstall: z28.boolean(),
4106
- canUpdate: z28.boolean(),
4107
- loginCommand: z28.string().min(1).nullable()
4616
+ statusMessage: z30.string().min(1).nullable(),
4617
+ accountEmail: z30.string().nullable(),
4618
+ planLabel: z30.string().min(1).nullable(),
4619
+ installedVersion: z30.string().min(1).nullable(),
4620
+ minimumSupportedVersion: z30.string().min(1).nullable(),
4621
+ canInstall: z30.boolean(),
4622
+ canUpdate: z30.boolean(),
4623
+ loginCommand: z30.string().min(1).nullable()
4108
4624
  }).passthrough();
4109
- var providerUsageWindowSchema = z28.object({
4110
- label: z28.string().min(1),
4111
- usedPercent: z28.number().min(0).max(100),
4112
- resetsAt: z28.string().min(1).nullable(),
4113
- cost: z28.object({
4114
- usedUsdCents: z28.number().int().nonnegative(),
4115
- limitUsdCents: z28.number().int().positive()
4625
+ var providerUsageWindowSchema = z30.object({
4626
+ label: z30.string().min(1),
4627
+ usedPercent: z30.number().min(0).max(100),
4628
+ resetsAt: z30.string().min(1).nullable(),
4629
+ cost: z30.object({
4630
+ usedUsdCents: z30.number().int().nonnegative(),
4631
+ limitUsdCents: z30.number().int().positive()
4116
4632
  }).optional()
4117
4633
  }).passthrough();
4118
- var providerUsageSchema = z28.discriminatedUnion("status", [
4119
- z28.object({
4120
- status: z28.literal("ok"),
4121
- accountEmail: z28.string().email().nullable(),
4122
- planLabel: z28.string().min(1).nullable(),
4123
- windows: z28.array(providerUsageWindowSchema)
4634
+ var providerUsageSchema = z30.discriminatedUnion("status", [
4635
+ z30.object({
4636
+ status: z30.literal("ok"),
4637
+ accountEmail: z30.string().email().nullable(),
4638
+ planLabel: z30.string().min(1).nullable(),
4639
+ windows: z30.array(providerUsageWindowSchema)
4124
4640
  }).passthrough(),
4125
- z28.object({ status: z28.literal("not_installed") }).passthrough(),
4126
- z28.object({ status: z28.literal("unauthenticated") }).passthrough(),
4127
- z28.object({ status: z28.literal("expired") }).passthrough(),
4128
- z28.object({
4129
- status: z28.literal("error"),
4130
- message: z28.string().min(1),
4131
- planLabel: z28.string().min(1).nullable().default(null),
4132
- accountEmail: z28.string().nullable().default(null)
4641
+ z30.object({ status: z30.literal("not_installed") }).passthrough(),
4642
+ z30.object({ status: z30.literal("unauthenticated") }).passthrough(),
4643
+ z30.object({ status: z30.literal("expired") }).passthrough(),
4644
+ z30.object({
4645
+ status: z30.literal("error"),
4646
+ message: z30.string().min(1),
4647
+ planLabel: z30.string().min(1).nullable().default(null),
4648
+ accountEmail: z30.string().nullable().default(null)
4133
4649
  }).passthrough()
4134
4650
  ]);
4135
- var providerHealthResultSchema = z28.discriminatedUnion("supported", [
4136
- z28.object({ supported: z28.literal(false) }).passthrough(),
4137
- z28.object({
4138
- supported: z28.literal(true),
4651
+ var providerHealthResultSchema = z30.discriminatedUnion("supported", [
4652
+ z30.object({ supported: z30.literal(false) }).passthrough(),
4653
+ z30.object({
4654
+ supported: z30.literal(true),
4139
4655
  health: providerHealthSchema
4140
4656
  }).passthrough()
4141
4657
  ]);
4142
- var providerUsageResultSchema = z28.discriminatedUnion("supported", [
4143
- z28.object({ supported: z28.literal(false) }).passthrough(),
4144
- z28.object({
4145
- supported: z28.literal(true),
4658
+ var providerUsageResultSchema = z30.discriminatedUnion("supported", [
4659
+ z30.object({ supported: z30.literal(false) }).passthrough(),
4660
+ z30.object({
4661
+ supported: z30.literal(true),
4146
4662
  usage: providerUsageSchema
4147
4663
  }).passthrough()
4148
4664
  ]);
4149
- var providerInstallationActionKindSchema = z28.enum([
4665
+ var providerInstallationActionKindSchema = z30.enum([
4150
4666
  "install",
4151
4667
  "update"
4152
4668
  ]);
4153
- var providerInstallationActionSchema = z28.object({
4669
+ var providerInstallationActionSchema = z30.object({
4154
4670
  kind: providerInstallationActionKindSchema,
4155
- label: z28.enum(["Install", "Update"]),
4156
- command: z28.string().min(1)
4671
+ label: z30.enum(["Install", "Update"]),
4672
+ command: z30.string().min(1)
4157
4673
  }).passthrough();
4158
- var providerInstallationSourceSchema = z28.enum([
4674
+ var providerInstallationSourceSchema = z30.enum([
4159
4675
  "notInstalled",
4160
4676
  "npmGlobal",
4161
4677
  "external"
4162
4678
  ]);
4163
- var providerInstallationStatusSchema = z28.object({
4164
- executableName: z28.string().min(1),
4165
- executablePath: z28.string().min(1).nullable(),
4166
- installed: z28.boolean(),
4679
+ var providerInstallationStatusSchema = z30.object({
4680
+ executableName: z30.string().min(1),
4681
+ executablePath: z30.string().min(1).nullable(),
4682
+ installed: z30.boolean(),
4167
4683
  installSource: providerInstallationSourceSchema,
4168
- currentVersion: z28.string().min(1).nullable(),
4169
- latestVersion: z28.string().min(1).nullable(),
4170
- minimumSupportedVersion: z28.string().min(1).nullable(),
4171
- npmPackageName: z28.string().min(1).nullable(),
4172
- npmGlobalPackageVersion: z28.string().min(1).nullable(),
4684
+ currentVersion: z30.string().min(1).nullable(),
4685
+ latestVersion: z30.string().min(1).nullable(),
4686
+ minimumSupportedVersion: z30.string().min(1).nullable(),
4687
+ npmPackageName: z30.string().min(1).nullable(),
4688
+ npmGlobalPackageVersion: z30.string().min(1).nullable(),
4173
4689
  installAction: providerInstallationActionSchema.nullable(),
4174
- needsUpdate: z28.boolean(),
4175
- versionUnsupported: z28.boolean()
4690
+ needsUpdate: z30.boolean(),
4691
+ versionUnsupported: z30.boolean()
4176
4692
  }).passthrough();
4177
4693
  var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
4178
4694
  action: providerInstallationActionKindSchema
4179
4695
  });
4180
- var providerInstallationCommandSchema = z28.object({
4181
- command: z28.string().min(1),
4182
- args: z28.array(z28.string()).max(64),
4183
- displayCommand: z28.string().min(1)
4696
+ var providerInstallationCommandSchema = z30.object({
4697
+ command: z30.string().min(1),
4698
+ args: z30.array(z30.string()).max(64),
4699
+ displayCommand: z30.string().min(1)
4184
4700
  }).passthrough();
4185
- var providerInstallationVerificationSchema = z28.discriminatedUnion(
4701
+ var providerInstallationVerificationSchema = z30.discriminatedUnion(
4186
4702
  "kind",
4187
4703
  [
4188
- z28.object({ kind: z28.literal("installed") }).passthrough(),
4189
- z28.object({
4190
- kind: z28.literal("version_changed"),
4191
- previousVersion: z28.string().min(1)
4704
+ z30.object({ kind: z30.literal("installed") }).passthrough(),
4705
+ z30.object({
4706
+ kind: z30.literal("version_changed"),
4707
+ previousVersion: z30.string().min(1)
4192
4708
  }).passthrough(),
4193
- z28.object({
4194
- kind: z28.literal("version_at_least"),
4195
- version: z28.string().min(1)
4709
+ z30.object({
4710
+ kind: z30.literal("version_at_least"),
4711
+ version: z30.string().min(1)
4196
4712
  }).passthrough()
4197
4713
  ]
4198
4714
  );
4199
- var providerInstallationRunResultSchema = z28.discriminatedUnion(
4715
+ var providerInstallationRunResultSchema = z30.discriminatedUnion(
4200
4716
  "available",
4201
4717
  [
4202
- z28.object({
4203
- available: z28.literal(false),
4204
- message: z28.string().min(1)
4718
+ z30.object({
4719
+ available: z30.literal(false),
4720
+ message: z30.string().min(1)
4205
4721
  }).passthrough(),
4206
- z28.object({
4207
- available: z28.literal(true),
4722
+ z30.object({
4723
+ available: z30.literal(true),
4208
4724
  command: providerInstallationCommandSchema,
4209
4725
  verification: providerInstallationVerificationSchema
4210
4726
  }).passthrough()
@@ -4212,7 +4728,7 @@ var providerInstallationRunResultSchema = z28.discriminatedUnion(
4212
4728
  );
4213
4729
 
4214
4730
  // ../provider-bridge-protocol/src/requests.ts
4215
- import { z as z29 } from "zod";
4731
+ import { z as z31 } from "zod";
4216
4732
  var BRIDGE_REQUEST_METHODS = {
4217
4733
  initialize: "initialize",
4218
4734
  modelList: "model/list",
@@ -4234,78 +4750,78 @@ var BRIDGE_REQUEST_METHODS = {
4234
4750
  skillsConfigure: "skills/configure"
4235
4751
  };
4236
4752
  var sessionConstructionFields = {
4237
- threadId: z29.string().min(1),
4238
- cwd: z29.string().min(1),
4753
+ threadId: z31.string().min(1),
4754
+ cwd: z31.string().min(1),
4239
4755
  options: bridgeExecutionOptionsSchema,
4240
- dynamicTools: z29.array(dynamicToolSchema).optional(),
4241
- disallowedTools: z29.array(z29.string().min(1)).optional(),
4756
+ dynamicTools: z31.array(dynamicToolSchema).optional(),
4757
+ disallowedTools: z31.array(z31.string().min(1)).optional(),
4242
4758
  instructionMode: instructionModeSchema
4243
4759
  };
4244
- var modelListParamsSchema = z29.object({ cwd: z29.string().min(1).optional() }).passthrough();
4245
- var threadStartParamsSchema = z29.object({
4760
+ var modelListParamsSchema = z31.object({ cwd: z31.string().min(1).optional() }).passthrough();
4761
+ var threadStartParamsSchema = z31.object({
4246
4762
  ...sessionConstructionFields,
4247
- input: z29.array(promptInputSchema).optional()
4763
+ input: z31.array(promptInputSchema).optional()
4248
4764
  }).passthrough();
4249
- var threadResumeParamsSchema = z29.object({
4765
+ var threadResumeParamsSchema = z31.object({
4250
4766
  ...sessionConstructionFields,
4251
- providerThreadId: z29.string().min(1)
4767
+ providerThreadId: z31.string().min(1)
4252
4768
  }).passthrough();
4253
- var threadForkParamsSchema = z29.object({
4769
+ var threadForkParamsSchema = z31.object({
4254
4770
  ...sessionConstructionFields,
4255
- sourceProviderThreadId: z29.string().min(1),
4256
- sourceProviderCheckpointId: z29.string().min(1).optional()
4771
+ sourceProviderThreadId: z31.string().min(1),
4772
+ sourceProviderCheckpointId: z31.string().min(1).optional()
4257
4773
  }).passthrough();
4258
- var threadStopParamsSchema = z29.object({
4259
- threadId: z29.string().min(1),
4260
- providerThreadId: z29.string().min(1),
4261
- intent: z29.enum(["interrupt", "release"]),
4262
- activeTurnId: z29.string().min(1).nullable()
4774
+ var threadStopParamsSchema = z31.object({
4775
+ threadId: z31.string().min(1),
4776
+ providerThreadId: z31.string().min(1),
4777
+ intent: z31.enum(["interrupt", "release"]),
4778
+ activeTurnId: z31.string().min(1).nullable()
4263
4779
  }).passthrough();
4264
- var threadRefParams = z29.object({
4265
- threadId: z29.string().min(1),
4266
- providerThreadId: z29.string().min(1)
4780
+ var threadRefParams = z31.object({
4781
+ threadId: z31.string().min(1),
4782
+ providerThreadId: z31.string().min(1)
4267
4783
  }).passthrough();
4268
4784
  var threadDiscardParamsSchema = threadRefParams;
4269
4785
  var threadArchiveParamsSchema = threadRefParams;
4270
4786
  var threadUnarchiveParamsSchema = threadRefParams;
4271
4787
  var threadGoalClearParamsSchema = threadRefParams;
4272
- var threadNameSetParamsSchema = z29.object({
4273
- threadId: z29.string().min(1),
4274
- providerThreadId: z29.string().min(1),
4275
- title: z29.string().min(1)
4788
+ var threadNameSetParamsSchema = z31.object({
4789
+ threadId: z31.string().min(1),
4790
+ providerThreadId: z31.string().min(1),
4791
+ title: z31.string().min(1)
4276
4792
  }).passthrough();
4277
4793
  var turnInputFields = {
4278
- threadId: z29.string().min(1),
4279
- providerThreadId: z29.string().min(1),
4280
- input: z29.array(promptInputSchema),
4794
+ threadId: z31.string().min(1),
4795
+ providerThreadId: z31.string().min(1),
4796
+ input: z31.array(promptInputSchema),
4281
4797
  clientRequestId: clientTurnRequestIdSchema,
4282
4798
  options: bridgeExecutionOptionsSchema
4283
4799
  };
4284
- var turnStartParamsSchema = z29.object(turnInputFields).passthrough();
4285
- var turnSteerParamsSchema = z29.object({
4800
+ var turnStartParamsSchema = z31.object(turnInputFields).passthrough();
4801
+ var turnSteerParamsSchema = z31.object({
4286
4802
  ...turnInputFields,
4287
- expectedTurnId: z29.string().min(1)
4803
+ expectedTurnId: z31.string().min(1)
4288
4804
  }).passthrough();
4289
- var skillsConfigureRootSchema = z29.object({
4290
- id: z29.string().min(1),
4291
- path: z29.string().min(1),
4292
- skills: z29.array(
4293
- z29.object({
4294
- name: z29.string().min(1),
4295
- description: z29.string()
4805
+ var skillsConfigureRootSchema = z31.object({
4806
+ id: z31.string().min(1),
4807
+ path: z31.string().min(1),
4808
+ skills: z31.array(
4809
+ z31.object({
4810
+ name: z31.string().min(1),
4811
+ description: z31.string()
4296
4812
  }).passthrough()
4297
4813
  )
4298
4814
  }).passthrough();
4299
- var skillsConfigureParamsSchema = z29.object({
4300
- roots: z29.array(skillsConfigureRootSchema)
4815
+ var skillsConfigureParamsSchema = z31.object({
4816
+ roots: z31.array(skillsConfigureRootSchema)
4301
4817
  }).passthrough();
4302
- var threadIdentityResultSchema = z29.object({
4303
- providerThreadId: z29.string().min(1),
4304
- sessionRestorable: z29.boolean().optional()
4818
+ var threadIdentityResultSchema = z31.object({
4819
+ providerThreadId: z31.string().min(1),
4820
+ sessionRestorable: z31.boolean().optional()
4305
4821
  }).passthrough();
4306
4822
 
4307
4823
  // ../provider-bridge-protocol/src/notifications.ts
4308
- import { z as z30 } from "zod";
4824
+ import { z as z32 } from "zod";
4309
4825
  var BRIDGE_NOTIFICATION_METHODS = {
4310
4826
  threadIdentity: "thread/identity",
4311
4827
  sessionReplaced: "session/replaced",
@@ -4313,142 +4829,142 @@ var BRIDGE_NOTIFICATION_METHODS = {
4313
4829
  providerRecovery: "provider/recovery",
4314
4830
  error: "error"
4315
4831
  };
4316
- var threadIdentityNotificationSchema = z30.object({
4317
- threadId: z30.string().min(1),
4318
- providerThreadId: z30.string().min(1),
4319
- sessionRestorable: z30.boolean().optional()
4832
+ var threadIdentityNotificationSchema = z32.object({
4833
+ threadId: z32.string().min(1),
4834
+ providerThreadId: z32.string().min(1),
4835
+ sessionRestorable: z32.boolean().optional()
4320
4836
  }).passthrough();
4321
- var sessionReplacedNotificationSchema = z30.object({
4322
- threadId: z30.string().min(1),
4323
- providerThreadId: z30.string().min(1).nullable(),
4324
- reason: z30.string().min(1),
4325
- contextLost: z30.boolean().default(false),
4326
- showRuntimeNote: z30.boolean().default(false)
4837
+ var sessionReplacedNotificationSchema = z32.object({
4838
+ threadId: z32.string().min(1),
4839
+ providerThreadId: z32.string().min(1).nullable(),
4840
+ reason: z32.string().min(1),
4841
+ contextLost: z32.boolean().default(false),
4842
+ showRuntimeNote: z32.boolean().default(false)
4327
4843
  }).passthrough();
4328
- var providerRecoveryNotificationSchema = z30.object({
4329
- threadId: z30.string().min(1).optional(),
4844
+ var providerRecoveryNotificationSchema = z32.object({
4845
+ threadId: z32.string().min(1).optional(),
4330
4846
  ...providerRecoveryHintSchema.shape
4331
4847
  }).passthrough();
4332
- var errorNotificationSchema = z30.object({
4333
- threadId: z30.string().min(1).optional(),
4334
- providerThreadId: z30.string().min(1).optional(),
4335
- message: z30.string().min(1)
4848
+ var errorNotificationSchema = z32.object({
4849
+ threadId: z32.string().min(1).optional(),
4850
+ providerThreadId: z32.string().min(1).optional(),
4851
+ message: z32.string().min(1)
4336
4852
  }).passthrough();
4337
4853
 
4338
4854
  // ../provider-bridge-protocol/src/thread-delta.ts
4339
- import { z as z31 } from "zod";
4855
+ import { z as z33 } from "zod";
4340
4856
  var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
4341
4857
  var deltaPresentationSchema = threadEventItemPresentationSchema;
4342
4858
  var THREAD_DELTA_KEY_SEPARATOR = "";
4343
- var deltaKeyPartSchema = z31.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
4859
+ var deltaKeyPartSchema = z33.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
4344
4860
  message: "provider keys must not contain the internal key separator (\\u001f)"
4345
4861
  });
4346
- var deltaItemKeySchema = z31.object({
4862
+ var deltaItemKeySchema = z33.object({
4347
4863
  providerItemId: deltaKeyPartSchema.optional(),
4348
4864
  channel: deltaKeyPartSchema.optional(),
4349
4865
  parentRef: deltaKeyPartSchema.optional()
4350
4866
  });
4351
4867
  var providerTurnIdSchema = deltaKeyPartSchema;
4352
- var deltaFileChangeSchema = z31.object({
4353
- path: z31.string(),
4354
- kind: z31.enum(["add", "update", "delete"]),
4355
- movePath: z31.string().optional(),
4356
- diff: z31.string().optional(),
4357
- oldText: z31.string().optional(),
4358
- newText: z31.string().optional()
4359
- });
4360
- var deltaBackgroundTaskShapeSchema = z31.object({
4361
- type: z31.literal("backgroundTask"),
4362
- familyId: z31.string().min(1),
4363
- taskType: z31.string(),
4364
- description: z31.string(),
4868
+ var deltaFileChangeSchema = z33.object({
4869
+ path: z33.string(),
4870
+ kind: z33.enum(["add", "update", "delete"]),
4871
+ movePath: z33.string().optional(),
4872
+ diff: z33.string().optional(),
4873
+ oldText: z33.string().optional(),
4874
+ newText: z33.string().optional()
4875
+ });
4876
+ var deltaBackgroundTaskShapeSchema = z33.object({
4877
+ type: z33.literal("backgroundTask"),
4878
+ familyId: z33.string().min(1),
4879
+ taskType: z33.string(),
4880
+ description: z33.string(),
4365
4881
  status: threadEventItemStatusSchema,
4366
4882
  taskStatus: backgroundTaskStatusSchema,
4367
- skipTranscript: z31.boolean(),
4368
- workflowName: z31.string().optional(),
4883
+ skipTranscript: z33.boolean(),
4884
+ workflowName: z33.string().optional(),
4369
4885
  workflow: workflowProgressSnapshotSchema.optional(),
4370
4886
  usage: backgroundTaskUsageSchema.optional(),
4371
- summary: z31.string().optional(),
4372
- error: z31.string().optional(),
4373
- outputFile: z31.string().optional()
4887
+ summary: z33.string().optional(),
4888
+ error: z33.string().optional(),
4889
+ outputFile: z33.string().optional()
4374
4890
  });
4375
- var deltaFileReadShapeSchema = z31.object({
4376
- type: z31.literal("fileRead"),
4377
- path: z31.string(),
4378
- cmd: z31.string().optional()
4891
+ var deltaFileReadShapeSchema = z33.object({
4892
+ type: z33.literal("fileRead"),
4893
+ path: z33.string(),
4894
+ cmd: z33.string().optional()
4379
4895
  });
4380
- var deltaSearchShapeSchema = z31.object({
4381
- type: z31.literal("search"),
4896
+ var deltaSearchShapeSchema = z33.object({
4897
+ type: z33.literal("search"),
4382
4898
  mode: threadEventSearchModeSchema,
4383
- query: z31.string(),
4384
- path: z31.string().optional(),
4385
- cmd: z31.string().optional()
4899
+ query: z33.string(),
4900
+ path: z33.string().optional(),
4901
+ cmd: z33.string().optional()
4386
4902
  });
4387
- var deltaDelegationShapeSchema = z31.object({
4388
- type: z31.literal("delegation"),
4903
+ var deltaDelegationShapeSchema = z33.object({
4904
+ type: z33.literal("delegation"),
4389
4905
  childRef: deltaKeyPartSchema,
4390
- label: z31.string(),
4391
- background: z31.boolean(),
4392
- summary: z31.string().optional()
4906
+ label: z33.string(),
4907
+ background: z33.boolean(),
4908
+ summary: z33.string().optional()
4393
4909
  });
4394
- var deltaPlanStepsShapeSchema = z31.object({
4395
- type: z31.literal("planSteps"),
4396
- steps: z31.array(threadEventPlanStepSchema),
4397
- explanation: z31.string().optional()
4910
+ var deltaPlanStepsShapeSchema = z33.object({
4911
+ type: z33.literal("planSteps"),
4912
+ steps: z33.array(threadEventPlanStepSchema),
4913
+ explanation: z33.string().optional()
4398
4914
  });
4399
- var deltaExtensionShapeSchema = z31.object({
4400
- type: z31.literal("extension"),
4915
+ var deltaExtensionShapeSchema = z33.object({
4916
+ type: z33.literal("extension"),
4401
4917
  kind: extensionKindSchema,
4402
4918
  payload: jsonValueSchema
4403
4919
  });
4404
- var deltaItemShapeSchema = z31.discriminatedUnion("type", [
4405
- z31.object({
4406
- type: z31.literal("command"),
4407
- command: z31.string(),
4408
- cwd: z31.string(),
4409
- aggregatedOutput: z31.string().optional(),
4410
- exitCode: z31.number().optional(),
4411
- durationMs: z31.number().optional()
4920
+ var deltaItemShapeSchema = z33.discriminatedUnion("type", [
4921
+ z33.object({
4922
+ type: z33.literal("command"),
4923
+ command: z33.string(),
4924
+ cwd: z33.string(),
4925
+ aggregatedOutput: z33.string().optional(),
4926
+ exitCode: z33.number().optional(),
4927
+ durationMs: z33.number().optional()
4412
4928
  }),
4413
- z31.object({
4414
- type: z31.literal("fileChange"),
4415
- changes: z31.array(deltaFileChangeSchema)
4929
+ z33.object({
4930
+ type: z33.literal("fileChange"),
4931
+ changes: z33.array(deltaFileChangeSchema)
4416
4932
  }),
4417
- z31.object({
4418
- type: z31.literal("tool"),
4419
- tool: z31.string(),
4420
- server: z31.string().optional(),
4421
- args: z31.unknown().optional(),
4422
- result: z31.unknown().optional(),
4423
- error: z31.string().optional(),
4424
- durationMs: z31.number().optional()
4933
+ z33.object({
4934
+ type: z33.literal("tool"),
4935
+ tool: z33.string(),
4936
+ server: z33.string().optional(),
4937
+ args: z33.unknown().optional(),
4938
+ result: z33.unknown().optional(),
4939
+ error: z33.string().optional(),
4940
+ durationMs: z33.number().optional()
4425
4941
  }),
4426
- z31.object({ type: z31.literal("compaction") }),
4427
- z31.object({ type: z31.literal("agentMessage"), text: z31.string() }),
4428
- z31.object({
4429
- type: z31.literal("reasoning"),
4430
- summary: z31.array(z31.string()),
4431
- content: z31.array(z31.string())
4942
+ z33.object({ type: z33.literal("compaction") }),
4943
+ z33.object({ type: z33.literal("agentMessage"), text: z33.string() }),
4944
+ z33.object({
4945
+ type: z33.literal("reasoning"),
4946
+ summary: z33.array(z33.string()),
4947
+ content: z33.array(z33.string())
4432
4948
  }),
4433
- z31.object({ type: z31.literal("plan"), text: z31.string() }),
4434
- z31.object({
4435
- type: z31.literal("webSearch"),
4436
- queries: z31.array(z31.string()).min(1)
4949
+ z33.object({ type: z33.literal("plan"), text: z33.string() }),
4950
+ z33.object({
4951
+ type: z33.literal("webSearch"),
4952
+ queries: z33.array(z33.string()).min(1)
4437
4953
  }),
4438
- z31.object({
4439
- type: z31.literal("webFetch"),
4440
- url: z31.string(),
4441
- prompt: z31.string().nullable().optional(),
4442
- pattern: z31.string().nullable()
4954
+ z33.object({
4955
+ type: z33.literal("webFetch"),
4956
+ url: z33.string(),
4957
+ prompt: z33.string().nullable().optional(),
4958
+ pattern: z33.string().nullable()
4443
4959
  }),
4444
- z31.object({ type: z31.literal("imageView"), path: z31.string() }),
4445
- z31.object({
4446
- type: z31.literal("imageGeneration"),
4447
- prompt: z31.string().nullable(),
4448
- path: z31.string().nullable(),
4449
- result: z31.string().optional(),
4450
- error: z31.string().nullable(),
4451
- transparentBackground: z31.boolean()
4960
+ z33.object({ type: z33.literal("imageView"), path: z33.string() }),
4961
+ z33.object({
4962
+ type: z33.literal("imageGeneration"),
4963
+ prompt: z33.string().nullable(),
4964
+ path: z33.string().nullable(),
4965
+ result: z33.string().optional(),
4966
+ error: z33.string().nullable(),
4967
+ transparentBackground: z33.boolean()
4452
4968
  }),
4453
4969
  deltaBackgroundTaskShapeSchema,
4454
4970
  deltaFileReadShapeSchema,
@@ -4457,22 +4973,22 @@ var deltaItemShapeSchema = z31.discriminatedUnion("type", [
4457
4973
  deltaPlanStepsShapeSchema,
4458
4974
  deltaExtensionShapeSchema
4459
4975
  ]);
4460
- var deltaProgressSnapshotSchema = z31.discriminatedUnion("type", [
4976
+ var deltaProgressSnapshotSchema = z33.discriminatedUnion("type", [
4461
4977
  deltaBackgroundTaskShapeSchema,
4462
4978
  deltaDelegationShapeSchema
4463
4979
  ]);
4464
- var deltaTextChannelSchema = z31.enum([
4980
+ var deltaTextChannelSchema = z33.enum([
4465
4981
  "agentMessage",
4466
4982
  "reasoningSummary",
4467
4983
  "reasoningText",
4468
4984
  "plan"
4469
4985
  ]);
4470
- var deltaOutputChannelSchema = z31.enum(["command", "fileChange"]);
4471
- var deltaErrorSchema = z31.object({ message: z31.string() });
4472
- var deltaAttachSchema = z31.enum(["open", "currentOrLast"]);
4473
- var deltaNoTurnFallbackSchema = z31.object({
4986
+ var deltaOutputChannelSchema = z33.enum(["command", "fileChange"]);
4987
+ var deltaErrorSchema = z33.object({ message: z33.string() });
4988
+ var deltaAttachSchema = z33.enum(["open", "currentOrLast"]);
4989
+ var deltaNoTurnFallbackSchema = z33.object({
4474
4990
  raw: providerRawEventSchema,
4475
- rawType: z31.string()
4991
+ rawType: z33.string()
4476
4992
  });
4477
4993
  function requireExtensionPresentation(delta, ctx) {
4478
4994
  if (delta.item.type === "extension" && delta.presentation === void 0) {
@@ -4483,32 +4999,32 @@ function requireExtensionPresentation(delta, ctx) {
4483
4999
  });
4484
5000
  }
4485
5001
  }
4486
- var threadDeltaSchema = z31.discriminatedUnion("kind", [
4487
- z31.object({
4488
- kind: z31.literal("input.accepted"),
5002
+ var threadDeltaSchema = z33.discriminatedUnion("kind", [
5003
+ z33.object({
5004
+ kind: z33.literal("input.accepted"),
4489
5005
  clientRequestId: clientTurnRequestIdSchema,
4490
5006
  providerTurnId: providerTurnIdSchema.optional()
4491
5007
  }),
4492
- z31.object({
4493
- kind: z31.literal("input.provider"),
4494
- text: z31.string().min(1),
5008
+ z33.object({
5009
+ kind: z33.literal("input.provider"),
5010
+ text: z33.string().min(1),
4495
5011
  parentRef: deltaKeyPartSchema.optional()
4496
5012
  }),
4497
- z31.object({
4498
- kind: z31.literal("turn.open"),
5013
+ z33.object({
5014
+ kind: z33.literal("turn.open"),
4499
5015
  providerTurnId: providerTurnIdSchema.optional(),
4500
5016
  parentRef: deltaKeyPartSchema.optional()
4501
5017
  }),
4502
- z31.object({
4503
- kind: z31.literal("turn.boundary"),
5018
+ z33.object({
5019
+ kind: z33.literal("turn.boundary"),
4504
5020
  status: threadEventTurnStatusSchema,
4505
5021
  error: deltaErrorSchema.optional(),
4506
- providerCheckpointId: z31.string().min(1).optional(),
4507
- claimIfIdle: z31.boolean().optional(),
5022
+ providerCheckpointId: z33.string().min(1).optional(),
5023
+ claimIfIdle: z33.boolean().optional(),
4508
5024
  providerTurnId: providerTurnIdSchema.optional()
4509
5025
  }),
4510
- z31.object({
4511
- kind: z31.literal("item.open"),
5026
+ z33.object({
5027
+ kind: z33.literal("item.open"),
4512
5028
  key: deltaItemKeySchema,
4513
5029
  item: deltaItemShapeSchema,
4514
5030
  presentation: deltaPresentationSchema.optional(),
@@ -4516,140 +5032,140 @@ var threadDeltaSchema = z31.discriminatedUnion("kind", [
4516
5032
  providerTurnId: providerTurnIdSchema.optional(),
4517
5033
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4518
5034
  }).superRefine(requireExtensionPresentation),
4519
- z31.object({
4520
- kind: z31.literal("item.close"),
5035
+ z33.object({
5036
+ kind: z33.literal("item.close"),
4521
5037
  key: deltaItemKeySchema,
4522
5038
  status: threadEventItemStatusSchema,
4523
- resultText: z31.string().optional(),
4524
- exitCode: z31.number().optional(),
4525
- aggregatedOutput: z31.string().optional(),
4526
- approvalStatus: z31.literal("denied").optional(),
5039
+ resultText: z33.string().optional(),
5040
+ exitCode: z33.number().optional(),
5041
+ aggregatedOutput: z33.string().optional(),
5042
+ approvalStatus: z33.literal("denied").optional(),
4527
5043
  item: deltaItemShapeSchema,
4528
5044
  presentation: deltaPresentationSchema.optional(),
4529
5045
  providerTurnId: providerTurnIdSchema.optional(),
4530
5046
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4531
5047
  }).superRefine(requireExtensionPresentation),
4532
- z31.object({
4533
- kind: z31.literal("item.progress"),
5048
+ z33.object({
5049
+ kind: z33.literal("item.progress"),
4534
5050
  key: deltaItemKeySchema,
4535
- message: z31.string().optional(),
5051
+ message: z33.string().optional(),
4536
5052
  snapshot: deltaProgressSnapshotSchema.optional(),
4537
- flush: z31.boolean().optional(),
5053
+ flush: z33.boolean().optional(),
4538
5054
  providerTurnId: providerTurnIdSchema.optional(),
4539
5055
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4540
5056
  }),
4541
- z31.object({
4542
- kind: z31.literal("item.textDelta"),
5057
+ z33.object({
5058
+ kind: z33.literal("item.textDelta"),
4543
5059
  key: deltaItemKeySchema,
4544
5060
  channel: deltaTextChannelSchema,
4545
- text: z31.string(),
5061
+ text: z33.string(),
4546
5062
  providerTurnId: providerTurnIdSchema.optional(),
4547
5063
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4548
5064
  }),
4549
- z31.object({
4550
- kind: z31.literal("item.textClose"),
5065
+ z33.object({
5066
+ kind: z33.literal("item.textClose"),
4551
5067
  key: deltaItemKeySchema,
4552
5068
  channel: deltaTextChannelSchema,
4553
- text: z31.string().optional(),
5069
+ text: z33.string().optional(),
4554
5070
  providerTurnId: providerTurnIdSchema.optional(),
4555
5071
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4556
5072
  }),
4557
- z31.object({
4558
- kind: z31.literal("item.outputDelta"),
5073
+ z33.object({
5074
+ kind: z33.literal("item.outputDelta"),
4559
5075
  key: deltaItemKeySchema,
4560
5076
  channel: deltaOutputChannelSchema,
4561
- text: z31.string(),
5077
+ text: z33.string(),
4562
5078
  providerTurnId: providerTurnIdSchema.optional(),
4563
5079
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4564
5080
  }),
4565
- z31.object({
4566
- kind: z31.literal("command.outputSnapshot"),
5081
+ z33.object({
5082
+ kind: z33.literal("command.outputSnapshot"),
4567
5083
  key: deltaItemKeySchema,
4568
- text: z31.string(),
5084
+ text: z33.string(),
4569
5085
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4570
5086
  }),
4571
- z31.object({
4572
- kind: z31.literal("usage"),
5087
+ z33.object({
5088
+ kind: z33.literal("usage"),
4573
5089
  total: threadEventTokenUsageBreakdownSchema,
4574
5090
  last: threadEventTokenUsageBreakdownSchema,
4575
- modelContextWindow: z31.number().nullable(),
5091
+ modelContextWindow: z33.number().nullable(),
4576
5092
  providerTurnId: providerTurnIdSchema.optional()
4577
5093
  }),
4578
- z31.object({
4579
- kind: z31.literal("contextWindow"),
5094
+ z33.object({
5095
+ kind: z33.literal("contextWindow"),
4580
5096
  snapshot: contextSnapshotSchema.optional(),
4581
- used: z31.number().nullable(),
4582
- size: z31.number().nullable().optional(),
4583
- estimated: z31.boolean(),
5097
+ used: z33.number().nullable(),
5098
+ size: z33.number().nullable().optional(),
5099
+ estimated: z33.boolean(),
4584
5100
  attach: deltaAttachSchema,
4585
5101
  providerTurnId: providerTurnIdSchema.optional()
4586
5102
  }),
4587
- z31.object({
4588
- kind: z31.literal("context.compacted"),
5103
+ z33.object({
5104
+ kind: z33.literal("context.compacted"),
4589
5105
  providerTurnId: providerTurnIdSchema.optional(),
4590
5106
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4591
5107
  }),
4592
- z31.object({ kind: z31.literal("context.cleared") }),
4593
- z31.object({
4594
- kind: z31.literal("turn.diff"),
4595
- diff: z31.string(),
5108
+ z33.object({ kind: z33.literal("context.cleared") }),
5109
+ z33.object({
5110
+ kind: z33.literal("turn.diff"),
5111
+ diff: z33.string(),
4596
5112
  providerTurnId: providerTurnIdSchema.optional()
4597
5113
  }),
4598
- z31.object({ kind: z31.literal("thread.started") }),
4599
- z31.object({
4600
- kind: z31.literal("thread.identity"),
4601
- providerThreadId: z31.string().min(1)
5114
+ z33.object({ kind: z33.literal("thread.started") }),
5115
+ z33.object({
5116
+ kind: z33.literal("thread.identity"),
5117
+ providerThreadId: z33.string().min(1)
4602
5118
  }),
4603
- z31.object({ kind: z31.literal("thread.name"), name: z31.string().min(1) }),
4604
- z31.object({
4605
- kind: z31.literal("extension.state"),
5119
+ z33.object({ kind: z33.literal("thread.name"), name: z33.string().min(1) }),
5120
+ z33.object({
5121
+ kind: z33.literal("extension.state"),
4606
5122
  extensionKind: extensionKindSchema,
4607
5123
  payload: jsonValueSchema
4608
5124
  }),
4609
- z31.object({
4610
- kind: z31.literal("provider.rateLimits"),
5125
+ z33.object({
5126
+ kind: z33.literal("provider.rateLimits"),
4611
5127
  rateLimits: providerRateLimitStateSchema
4612
5128
  }),
4613
- z31.object({
4614
- kind: z31.literal("provider.error"),
4615
- message: z31.string(),
4616
- detail: z31.string().optional(),
4617
- willRetry: z31.boolean().optional(),
5129
+ z33.object({
5130
+ kind: z33.literal("provider.error"),
5131
+ message: z33.string(),
5132
+ detail: z33.string().optional(),
5133
+ willRetry: z33.boolean().optional(),
4618
5134
  category: providerErrorCategorySchema.optional(),
4619
5135
  errorInfo: providerErrorInfoSchema.optional(),
4620
- settlesTurn: z31.boolean().optional(),
5136
+ settlesTurn: z33.boolean().optional(),
4621
5137
  providerTurnId: providerTurnIdSchema.optional(),
4622
- threadScoped: z31.boolean().optional()
5138
+ threadScoped: z33.boolean().optional()
4623
5139
  }),
4624
- z31.object({
4625
- kind: z31.literal("provider.modelFallback"),
4626
- originalModel: z31.string().min(1),
4627
- fallbackModel: z31.string().min(1),
4628
- reason: z31.enum(["refusal", "provider"]),
4629
- message: z31.string()
5140
+ z33.object({
5141
+ kind: z33.literal("provider.modelFallback"),
5142
+ originalModel: z33.string().min(1),
5143
+ fallbackModel: z33.string().min(1),
5144
+ reason: z33.enum(["refusal", "provider"]),
5145
+ message: z33.string()
4630
5146
  }),
4631
- z31.object({
4632
- kind: z31.literal("provider.warning"),
4633
- summary: z31.string().optional(),
4634
- details: z31.string().optional(),
5147
+ z33.object({
5148
+ kind: z33.literal("provider.warning"),
5149
+ summary: z33.string().optional(),
5150
+ details: z33.string().optional(),
4635
5151
  category: threadEventWarningCategorySchema.optional(),
4636
- vouchedTurn: z31.boolean().optional()
5152
+ vouchedTurn: z33.boolean().optional()
4637
5153
  }),
4638
- z31.object({
4639
- kind: z31.literal("unhandled"),
5154
+ z33.object({
5155
+ kind: z33.literal("unhandled"),
4640
5156
  raw: providerRawEventSchema,
4641
- rawType: z31.string(),
4642
- vouchedTurn: z31.boolean(),
4643
- onlyIfNoTurn: z31.boolean().optional(),
5157
+ rawType: z33.string(),
5158
+ vouchedTurn: z33.boolean(),
5159
+ onlyIfNoTurn: z33.boolean().optional(),
4644
5160
  parentRef: deltaKeyPartSchema.optional(),
4645
5161
  providerTurnId: providerTurnIdSchema.optional()
4646
5162
  }),
4647
- z31.object({ kind: z31.literal("session.ended") }),
4648
- z31.object({ kind: z31.literal("session.reset") })
5163
+ z33.object({ kind: z33.literal("session.ended") }),
5164
+ z33.object({ kind: z33.literal("session.reset") })
4649
5165
  ]);
4650
- var threadDeltaNotificationParamsSchema = z31.object({
4651
- threadId: z31.string().min(1),
4652
- deltas: z31.array(threadDeltaSchema)
5166
+ var threadDeltaNotificationParamsSchema = z33.object({
5167
+ threadId: z33.string().min(1),
5168
+ deltas: z33.array(threadDeltaSchema)
4653
5169
  }).passthrough();
4654
5170
 
4655
5171
  // ../process-utils/src/index.ts
@@ -4672,10 +5188,10 @@ function sanitizeInheritedChildProcessEnv(args) {
4672
5188
  }
4673
5189
 
4674
5190
  // ../provider-bridge-acp/src/launch-spec.ts
4675
- import { z as z32 } from "zod";
4676
- var acpNativeSkillRootsSchema = z32.object({
4677
- user: z32.array(providerNativeRootInputSchema).default([]),
4678
- project: z32.array(providerNativeRootInputSchema).default([])
5191
+ import { z as z34 } from "zod";
5192
+ var acpNativeSkillRootsSchema = z34.object({
5193
+ user: z34.array(providerNativeRootInputSchema).default([]),
5194
+ project: z34.array(providerNativeRootInputSchema).default([])
4679
5195
  }).strict().superRefine((roots, context) => {
4680
5196
  const normalized = providerNativeRootsSchema.safeParse(
4681
5197
  normalizeProviderNativeRoots(roots)
@@ -4691,16 +5207,16 @@ var acpNativeSkillRootsSchema = z32.object({
4691
5207
  });
4692
5208
  }
4693
5209
  });
4694
- var acpLaunchSpecSchema = z32.object({
4695
- displayName: z32.string().min(1),
4696
- command: z32.string().min(1),
4697
- args: z32.array(z32.string()),
4698
- env: z32.record(z32.string().min(1), z32.string()),
4699
- cwd: z32.string().min(1).optional(),
4700
- modelCli: z32.object({
4701
- listArgs: z32.array(z32.string()),
4702
- selectFlag: z32.string().min(1).optional(),
4703
- primaryModels: z32.array(z32.string())
5210
+ var acpLaunchSpecSchema = z34.object({
5211
+ displayName: z34.string().min(1),
5212
+ command: z34.string().min(1),
5213
+ args: z34.array(z34.string()),
5214
+ env: z34.record(z34.string().min(1), z34.string()),
5215
+ cwd: z34.string().min(1).optional(),
5216
+ modelCli: z34.object({
5217
+ listArgs: z34.array(z34.string()),
5218
+ selectFlag: z34.string().min(1).optional(),
5219
+ primaryModels: z34.array(z34.string())
4704
5220
  }).strict().transform(
4705
5221
  (modelCli) => modelCli.listArgs.length > 0 ? modelCli : void 0
4706
5222
  ).optional(),
@@ -4738,35 +5254,35 @@ function normalizeAcpLaunchSpec(spec) {
4738
5254
  }
4739
5255
 
4740
5256
  // src/claude-task-tools.ts
4741
- import { z as z33 } from "zod";
4742
- var claudeTaskToolNameSchema = z33.enum([
5257
+ import { z as z35 } from "zod";
5258
+ var claudeTaskToolNameSchema = z35.enum([
4743
5259
  "TaskCreate",
4744
5260
  "TaskGet",
4745
5261
  "TaskList",
4746
5262
  "TaskUpdate"
4747
5263
  ]);
4748
- var claudeTaskStatusSchema = z33.enum(["pending", "in_progress", "completed"]);
4749
- var claudeTaskCreateOutputSchema = z33.object({
4750
- task: z33.object({
4751
- id: z33.string(),
4752
- subject: z33.string()
5264
+ var claudeTaskStatusSchema = z35.enum(["pending", "in_progress", "completed"]);
5265
+ var claudeTaskCreateOutputSchema = z35.object({
5266
+ task: z35.object({
5267
+ id: z35.string(),
5268
+ subject: z35.string()
4753
5269
  }).passthrough()
4754
5270
  }).passthrough();
4755
- var claudeTaskGetOutputSchema = z33.object({
4756
- task: z33.object({
4757
- id: z33.string(),
5271
+ var claudeTaskGetOutputSchema = z35.object({
5272
+ task: z35.object({
5273
+ id: z35.string(),
4758
5274
  status: claudeTaskStatusSchema,
4759
- subject: z33.string()
5275
+ subject: z35.string()
4760
5276
  }).passthrough().nullable()
4761
5277
  }).passthrough();
4762
- var claudeTaskUpdateOutputSchema = z33.object({
4763
- success: z33.boolean(),
4764
- taskId: z33.string()
5278
+ var claudeTaskUpdateOutputSchema = z35.object({
5279
+ success: z35.boolean(),
5280
+ taskId: z35.string()
4765
5281
  }).passthrough();
4766
- var claudeTaskListOutputSchema = z33.object({
4767
- tasks: z33.array(z33.unknown())
5282
+ var claudeTaskListOutputSchema = z35.object({
5283
+ tasks: z35.array(z35.unknown())
4768
5284
  }).passthrough();
4769
- var claudeTaskToolOutputSchema = z33.union([
5285
+ var claudeTaskToolOutputSchema = z35.union([
4770
5286
  claudeTaskCreateOutputSchema,
4771
5287
  claudeTaskGetOutputSchema,
4772
5288
  claudeTaskListOutputSchema,