@get-bb/plugin-sdk 0.4.94 → 0.4.99

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