@get-bb/plugin-sdk 0.4.94 → 0.4.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,6 +34,517 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
  mod
35
35
  ));
36
36
 
37
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js
38
+ var require_debug = __commonJS({
39
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js"(exports, module) {
40
+ "use strict";
41
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
42
+ };
43
+ module.exports = debug;
44
+ }
45
+ });
46
+
47
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
48
+ var require_constants = __commonJS({
49
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js"(exports, module) {
50
+ "use strict";
51
+ var SEMVER_SPEC_VERSION = "2.0.0";
52
+ var MAX_LENGTH = 256;
53
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
54
+ 9007199254740991;
55
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
56
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
57
+ var RELEASE_TYPES = [
58
+ "major",
59
+ "premajor",
60
+ "minor",
61
+ "preminor",
62
+ "patch",
63
+ "prepatch",
64
+ "prerelease"
65
+ ];
66
+ module.exports = {
67
+ MAX_LENGTH,
68
+ MAX_SAFE_COMPONENT_LENGTH,
69
+ MAX_SAFE_BUILD_LENGTH,
70
+ MAX_SAFE_INTEGER,
71
+ RELEASE_TYPES,
72
+ SEMVER_SPEC_VERSION,
73
+ FLAG_INCLUDE_PRERELEASE: 1,
74
+ FLAG_LOOSE: 2
75
+ };
76
+ }
77
+ });
78
+
79
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js
80
+ var require_re = __commonJS({
81
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js"(exports, module) {
82
+ "use strict";
83
+ var {
84
+ MAX_SAFE_COMPONENT_LENGTH,
85
+ MAX_SAFE_BUILD_LENGTH,
86
+ MAX_LENGTH
87
+ } = require_constants();
88
+ var debug = require_debug();
89
+ exports = module.exports = {};
90
+ var re = exports.re = [];
91
+ var safeRe = exports.safeRe = [];
92
+ var src = exports.src = [];
93
+ var safeSrc = exports.safeSrc = [];
94
+ var t = exports.t = {};
95
+ var R = 0;
96
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
97
+ var safeRegexReplacements = [
98
+ ["\\s", 1],
99
+ ["\\d", MAX_LENGTH],
100
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
101
+ ];
102
+ var makeSafeRegex = (value) => {
103
+ for (const [token, max] of safeRegexReplacements) {
104
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
105
+ }
106
+ return value;
107
+ };
108
+ var createToken = (name, value, isGlobal) => {
109
+ const safe = makeSafeRegex(value);
110
+ const index = R++;
111
+ debug(name, index, value);
112
+ t[name] = index;
113
+ src[index] = value;
114
+ safeSrc[index] = safe;
115
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
116
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
117
+ };
118
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
119
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
120
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
121
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
122
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
123
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
124
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
125
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
126
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
127
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
128
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
129
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
130
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
131
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
132
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
133
+ createToken("GTLT", "((?:<|>)?=?)");
134
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
135
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
136
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
137
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
138
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
139
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
140
+ createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
141
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
142
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
143
+ createToken("COERCERTL", src[t.COERCE], true);
144
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
145
+ createToken("LONETILDE", "(?:~>?)");
146
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
147
+ exports.tildeTrimReplace = "$1~";
148
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
149
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
150
+ createToken("LONECARET", "(?:\\^)");
151
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
152
+ exports.caretTrimReplace = "$1^";
153
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
154
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
155
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
156
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
157
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
158
+ exports.comparatorTrimReplace = "$1$2$3";
159
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
160
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
161
+ createToken("STAR", "(<|>)?=?\\s*\\*");
162
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
163
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
164
+ }
165
+ });
166
+
167
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js
168
+ var require_parse_options = __commonJS({
169
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js"(exports, module) {
170
+ "use strict";
171
+ var looseOption = Object.freeze({ loose: true });
172
+ var emptyOpts = Object.freeze({});
173
+ var parseOptions = (options) => {
174
+ if (!options) {
175
+ return emptyOpts;
176
+ }
177
+ if (typeof options !== "object") {
178
+ return looseOption;
179
+ }
180
+ return options;
181
+ };
182
+ module.exports = parseOptions;
183
+ }
184
+ });
185
+
186
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js
187
+ var require_identifiers = __commonJS({
188
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js"(exports, module) {
189
+ "use strict";
190
+ var numeric = /^[0-9]+$/;
191
+ var compareIdentifiers = (a, b) => {
192
+ if (typeof a === "number" && typeof b === "number") {
193
+ return a === b ? 0 : a < b ? -1 : 1;
194
+ }
195
+ const anum = numeric.test(a);
196
+ const bnum = numeric.test(b);
197
+ if (anum && bnum) {
198
+ a = +a;
199
+ b = +b;
200
+ }
201
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
202
+ };
203
+ var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
204
+ module.exports = {
205
+ compareIdentifiers,
206
+ rcompareIdentifiers
207
+ };
208
+ }
209
+ });
210
+
211
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js
212
+ var require_semver = __commonJS({
213
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js"(exports, module) {
214
+ "use strict";
215
+ var debug = require_debug();
216
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
217
+ var { safeRe: re, t } = require_re();
218
+ var parseOptions = require_parse_options();
219
+ var { compareIdentifiers } = require_identifiers();
220
+ var isPrereleaseIdentifier = (prerelease, identifier) => {
221
+ const identifiers = identifier.split(".");
222
+ if (identifiers.length > prerelease.length) {
223
+ return false;
224
+ }
225
+ for (let i = 0; i < identifiers.length; i++) {
226
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
227
+ return false;
228
+ }
229
+ }
230
+ return true;
231
+ };
232
+ var SemVer = class _SemVer {
233
+ constructor(version, options) {
234
+ options = parseOptions(options);
235
+ if (version instanceof _SemVer) {
236
+ if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
237
+ return version;
238
+ } else {
239
+ version = version.version;
240
+ }
241
+ } else if (typeof version !== "string") {
242
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
243
+ }
244
+ if (version.length > MAX_LENGTH) {
245
+ throw new TypeError(
246
+ `version is longer than ${MAX_LENGTH} characters`
247
+ );
248
+ }
249
+ debug("SemVer", version, options);
250
+ this.options = options;
251
+ this.loose = !!options.loose;
252
+ this.includePrerelease = !!options.includePrerelease;
253
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
254
+ if (!m) {
255
+ throw new TypeError(`Invalid Version: ${version}`);
256
+ }
257
+ this.raw = version;
258
+ this.major = +m[1];
259
+ this.minor = +m[2];
260
+ this.patch = +m[3];
261
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
262
+ throw new TypeError("Invalid major version");
263
+ }
264
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
265
+ throw new TypeError("Invalid minor version");
266
+ }
267
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
268
+ throw new TypeError("Invalid patch version");
269
+ }
270
+ if (!m[4]) {
271
+ this.prerelease = [];
272
+ } else {
273
+ this.prerelease = m[4].split(".").map((id) => {
274
+ if (/^[0-9]+$/.test(id)) {
275
+ const num = +id;
276
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
277
+ return num;
278
+ }
279
+ }
280
+ return id;
281
+ });
282
+ }
283
+ this.build = m[5] ? m[5].split(".") : [];
284
+ this.format();
285
+ }
286
+ format() {
287
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
288
+ if (this.prerelease.length) {
289
+ this.version += `-${this.prerelease.join(".")}`;
290
+ }
291
+ return this.version;
292
+ }
293
+ toString() {
294
+ return this.version;
295
+ }
296
+ compare(other) {
297
+ debug("SemVer.compare", this.version, this.options, other);
298
+ if (!(other instanceof _SemVer)) {
299
+ if (typeof other === "string" && other === this.version) {
300
+ return 0;
301
+ }
302
+ other = new _SemVer(other, this.options);
303
+ }
304
+ if (other.version === this.version) {
305
+ return 0;
306
+ }
307
+ return this.compareMain(other) || this.comparePre(other);
308
+ }
309
+ compareMain(other) {
310
+ if (!(other instanceof _SemVer)) {
311
+ other = new _SemVer(other, this.options);
312
+ }
313
+ if (this.major < other.major) {
314
+ return -1;
315
+ }
316
+ if (this.major > other.major) {
317
+ return 1;
318
+ }
319
+ if (this.minor < other.minor) {
320
+ return -1;
321
+ }
322
+ if (this.minor > other.minor) {
323
+ return 1;
324
+ }
325
+ if (this.patch < other.patch) {
326
+ return -1;
327
+ }
328
+ if (this.patch > other.patch) {
329
+ return 1;
330
+ }
331
+ return 0;
332
+ }
333
+ comparePre(other) {
334
+ if (!(other instanceof _SemVer)) {
335
+ other = new _SemVer(other, this.options);
336
+ }
337
+ if (this.prerelease.length && !other.prerelease.length) {
338
+ return -1;
339
+ } else if (!this.prerelease.length && other.prerelease.length) {
340
+ return 1;
341
+ } else if (!this.prerelease.length && !other.prerelease.length) {
342
+ return 0;
343
+ }
344
+ let i = 0;
345
+ do {
346
+ const a = this.prerelease[i];
347
+ const b = other.prerelease[i];
348
+ debug("prerelease compare", i, a, b);
349
+ if (a === void 0 && b === void 0) {
350
+ return 0;
351
+ } else if (b === void 0) {
352
+ return 1;
353
+ } else if (a === void 0) {
354
+ return -1;
355
+ } else if (a === b) {
356
+ continue;
357
+ } else {
358
+ return compareIdentifiers(a, b);
359
+ }
360
+ } while (++i);
361
+ }
362
+ compareBuild(other) {
363
+ if (!(other instanceof _SemVer)) {
364
+ other = new _SemVer(other, this.options);
365
+ }
366
+ let i = 0;
367
+ do {
368
+ const a = this.build[i];
369
+ const b = other.build[i];
370
+ debug("build compare", i, a, b);
371
+ if (a === void 0 && b === void 0) {
372
+ return 0;
373
+ } else if (b === void 0) {
374
+ return 1;
375
+ } else if (a === void 0) {
376
+ return -1;
377
+ } else if (a === b) {
378
+ continue;
379
+ } else {
380
+ return compareIdentifiers(a, b);
381
+ }
382
+ } while (++i);
383
+ }
384
+ // preminor will bump the version up to the next minor release, and immediately
385
+ // down to pre-release. premajor and prepatch work the same way.
386
+ inc(release, identifier, identifierBase) {
387
+ if (release.startsWith("pre")) {
388
+ if (!identifier && identifierBase === false) {
389
+ throw new Error("invalid increment argument: identifier is empty");
390
+ }
391
+ if (identifier) {
392
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
393
+ if (!match || match[1] !== identifier) {
394
+ throw new Error(`invalid identifier: ${identifier}`);
395
+ }
396
+ }
397
+ }
398
+ switch (release) {
399
+ case "premajor":
400
+ this.prerelease.length = 0;
401
+ this.patch = 0;
402
+ this.minor = 0;
403
+ this.major++;
404
+ this.inc("pre", identifier, identifierBase);
405
+ break;
406
+ case "preminor":
407
+ this.prerelease.length = 0;
408
+ this.patch = 0;
409
+ this.minor++;
410
+ this.inc("pre", identifier, identifierBase);
411
+ break;
412
+ case "prepatch":
413
+ this.prerelease.length = 0;
414
+ this.inc("patch", identifier, identifierBase);
415
+ this.inc("pre", identifier, identifierBase);
416
+ break;
417
+ // If the input is a non-prerelease version, this acts the same as
418
+ // prepatch.
419
+ case "prerelease":
420
+ if (this.prerelease.length === 0) {
421
+ this.inc("patch", identifier, identifierBase);
422
+ }
423
+ this.inc("pre", identifier, identifierBase);
424
+ break;
425
+ case "release":
426
+ if (this.prerelease.length === 0) {
427
+ throw new Error(`version ${this.raw} is not a prerelease`);
428
+ }
429
+ this.prerelease.length = 0;
430
+ break;
431
+ case "major":
432
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
433
+ this.major++;
434
+ }
435
+ this.minor = 0;
436
+ this.patch = 0;
437
+ this.prerelease = [];
438
+ break;
439
+ case "minor":
440
+ if (this.patch !== 0 || this.prerelease.length === 0) {
441
+ this.minor++;
442
+ }
443
+ this.patch = 0;
444
+ this.prerelease = [];
445
+ break;
446
+ case "patch":
447
+ if (this.prerelease.length === 0) {
448
+ this.patch++;
449
+ }
450
+ this.prerelease = [];
451
+ break;
452
+ // This probably shouldn't be used publicly.
453
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
454
+ case "pre": {
455
+ const base = Number(identifierBase) ? 1 : 0;
456
+ if (this.prerelease.length === 0) {
457
+ this.prerelease = [base];
458
+ } else {
459
+ let i = this.prerelease.length;
460
+ while (--i >= 0) {
461
+ if (typeof this.prerelease[i] === "number") {
462
+ this.prerelease[i]++;
463
+ i = -2;
464
+ }
465
+ }
466
+ if (i === -1) {
467
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
468
+ throw new Error("invalid increment argument: identifier already exists");
469
+ }
470
+ this.prerelease.push(base);
471
+ }
472
+ }
473
+ if (identifier) {
474
+ let prerelease = [identifier, base];
475
+ if (identifierBase === false) {
476
+ prerelease = [identifier];
477
+ }
478
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
479
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
480
+ if (isNaN(prereleaseBase)) {
481
+ this.prerelease = prerelease;
482
+ }
483
+ } else {
484
+ this.prerelease = prerelease;
485
+ }
486
+ }
487
+ break;
488
+ }
489
+ default:
490
+ throw new Error(`invalid increment argument: ${release}`);
491
+ }
492
+ this.raw = this.format();
493
+ if (this.build.length) {
494
+ this.raw += `+${this.build.join(".")}`;
495
+ }
496
+ return this;
497
+ }
498
+ };
499
+ module.exports = SemVer;
500
+ }
501
+ });
502
+
503
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js
504
+ var require_compare = __commonJS({
505
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js"(exports, module) {
506
+ "use strict";
507
+ var SemVer = require_semver();
508
+ var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
509
+ module.exports = compare;
510
+ }
511
+ });
512
+
513
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js
514
+ var require_parse = __commonJS({
515
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports, module) {
516
+ "use strict";
517
+ var SemVer = require_semver();
518
+ var parse = (version, options, throwErrors = false) => {
519
+ if (version instanceof SemVer) {
520
+ return version;
521
+ }
522
+ try {
523
+ return new SemVer(version, options);
524
+ } catch (er) {
525
+ if (!throwErrors) {
526
+ return null;
527
+ }
528
+ throw er;
529
+ }
530
+ };
531
+ module.exports = parse;
532
+ }
533
+ });
534
+
535
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js
536
+ var require_valid = __commonJS({
537
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports, module) {
538
+ "use strict";
539
+ var parse = require_parse();
540
+ var valid = (version, options) => {
541
+ const v = parse(version, options);
542
+ return v ? v.version : null;
543
+ };
544
+ module.exports = valid;
545
+ }
546
+ });
547
+
37
548
  // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
38
549
  var require_windows = __commonJS({
39
550
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
@@ -393,7 +904,7 @@ var require_readShebang = __commonJS({
393
904
  });
394
905
 
395
906
  // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
396
- var require_parse = __commonJS({
907
+ var require_parse2 = __commonJS({
397
908
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
398
909
  "use strict";
399
910
  var path2 = __require("path");
@@ -509,7 +1020,7 @@ var require_cross_spawn = __commonJS({
509
1020
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module) {
510
1021
  "use strict";
511
1022
  var cp = __require("child_process");
512
- var parse = require_parse();
1023
+ var parse = require_parse2();
513
1024
  var enoent = require_enoent();
514
1025
  function spawn(command, args, options) {
515
1026
  const parsed = parse(command, args, options);
@@ -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";
@@ -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,264 @@ 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({ core: z18.enum(["machine-git", "machine-environment"]) }).strict()
3143
3659
  ]),
3144
- value: z17.union([
3145
- z17.string(),
3146
- z17.object({ masked: z17.literal(true) }).strict()
3660
+ value: z18.union([
3661
+ z18.string(),
3662
+ z18.object({ masked: z18.literal(true) }).strict()
3147
3663
  ]),
3148
- reason: z17.string().optional()
3664
+ reason: z18.string().optional()
3149
3665
  }).strict()
3150
3666
  )
3151
3667
  }),
3152
- z17.object({
3153
- type: z17.literal("thread/extensionState/updated"),
3154
- threadId: z17.string(),
3155
- providerThreadId: z17.string(),
3668
+ z18.object({
3669
+ type: z18.literal("thread/extensionState/updated"),
3670
+ threadId: z18.string(),
3671
+ providerThreadId: z18.string(),
3156
3672
  kind: extensionKindSchema,
3157
3673
  payload: jsonValueSchema
3158
3674
  }),
3159
- z17.object({
3160
- type: z17.literal("provider/warning"),
3161
- threadId: z17.string(),
3162
- providerThreadId: z17.string(),
3675
+ z18.object({
3676
+ type: z18.literal("provider/warning"),
3677
+ threadId: z18.string(),
3678
+ providerThreadId: z18.string(),
3163
3679
  category: threadEventWarningCategorySchema,
3164
- summary: z17.string().optional(),
3165
- details: z17.string().optional()
3680
+ summary: z18.string().optional(),
3681
+ details: z18.string().optional()
3166
3682
  }),
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()
3683
+ z18.object({
3684
+ type: z18.literal("provider/modelFallback"),
3685
+ threadId: z18.string(),
3686
+ providerThreadId: z18.string(),
3687
+ originalModel: z18.string().min(1),
3688
+ fallbackModel: z18.string().min(1),
3689
+ reason: z18.enum(["refusal", "provider"]),
3690
+ message: z18.string()
3175
3691
  }),
3176
3692
  providerUnhandledEventSchema
3177
3693
  ]);
3178
- var scopedEventDataSchema = z17.object({
3694
+ var scopedEventDataSchema = z18.object({
3179
3695
  scope: threadEventScopeSchema
3180
3696
  });
3181
3697
  var providerEventSchema = unscopedProviderEventSchema.and(
@@ -3184,58 +3700,58 @@ var providerEventSchema = unscopedProviderEventSchema.and(
3184
3700
  var providerEventTypeValues = unscopedProviderEventSchema.options.map(
3185
3701
  (option) => option.shape.type.value
3186
3702
  );
3187
- var unscopedSystemEventSchema = z17.discriminatedUnion("type", [
3188
- z17.object({
3189
- type: z17.literal("client/thread/start"),
3190
- threadId: z17.string()
3703
+ var unscopedSystemEventSchema = z18.discriminatedUnion("type", [
3704
+ z18.object({
3705
+ type: z18.literal("client/thread/start"),
3706
+ threadId: z18.string()
3191
3707
  }).merge(clientTurnLifecycleEventDataSchema),
3192
- z17.object({
3193
- type: z17.literal("client/turn/requested"),
3194
- threadId: z17.string()
3708
+ z18.object({
3709
+ type: z18.literal("client/turn/requested"),
3710
+ threadId: z18.string()
3195
3711
  }).merge(turnRequestEventDataSchema),
3196
- z17.object({
3197
- type: z17.literal("client/turn/rejected"),
3198
- threadId: z17.string()
3712
+ z18.object({
3713
+ type: z18.literal("client/turn/rejected"),
3714
+ threadId: z18.string()
3199
3715
  }).merge(turnRequestRejectedEventDataSchema),
3200
- z17.object({
3201
- type: z17.literal("client/turn/start"),
3202
- threadId: z17.string()
3716
+ z18.object({
3717
+ type: z18.literal("client/turn/start"),
3718
+ threadId: z18.string()
3203
3719
  }).merge(clientTurnLifecycleEventDataSchema),
3204
- z17.object({
3205
- type: z17.literal("system/error"),
3206
- threadId: z17.string()
3720
+ z18.object({
3721
+ type: z18.literal("system/error"),
3722
+ threadId: z18.string()
3207
3723
  }).merge(systemErrorEventDataSchema),
3208
- z17.object({
3209
- type: z17.literal("system/manager/user_message"),
3210
- threadId: z17.string()
3724
+ z18.object({
3725
+ type: z18.literal("system/manager/user_message"),
3726
+ threadId: z18.string()
3211
3727
  }).merge(systemLegacyUserMessageEventDataSchema),
3212
- z17.object({
3213
- type: z17.literal("system/thread/interrupted"),
3214
- threadId: z17.string()
3728
+ z18.object({
3729
+ type: z18.literal("system/thread/interrupted"),
3730
+ threadId: z18.string()
3215
3731
  }).merge(systemThreadInterruptedEventDataSchema),
3216
- z17.object({
3217
- type: z17.literal("system/operation"),
3218
- threadId: z17.string()
3732
+ z18.object({
3733
+ type: z18.literal("system/operation"),
3734
+ threadId: z18.string()
3219
3735
  }).merge(systemOperationEventDataSchema),
3220
- z17.object({
3221
- type: z17.literal("system/interaction/lifecycle"),
3222
- threadId: z17.string()
3736
+ z18.object({
3737
+ type: z18.literal("system/interaction/lifecycle"),
3738
+ threadId: z18.string()
3223
3739
  }).merge(systemInteractionLifecycleEventDataSchema),
3224
- z17.object({
3225
- type: z17.literal("system/permissionGrant/lifecycle"),
3226
- threadId: z17.string()
3740
+ z18.object({
3741
+ type: z18.literal("system/permissionGrant/lifecycle"),
3742
+ threadId: z18.string()
3227
3743
  }).merge(systemPermissionGrantLifecycleEventDataSchema),
3228
- z17.object({
3229
- type: z17.literal("system/userQuestion/lifecycle"),
3230
- threadId: z17.string()
3744
+ z18.object({
3745
+ type: z18.literal("system/userQuestion/lifecycle"),
3746
+ threadId: z18.string()
3231
3747
  }).merge(systemUserQuestionLifecycleEventDataSchema),
3232
- z17.object({
3233
- type: z17.literal("system/thread-provisioning"),
3234
- threadId: z17.string()
3748
+ z18.object({
3749
+ type: z18.literal("system/thread-provisioning"),
3750
+ threadId: z18.string()
3235
3751
  }).merge(systemThreadProvisioningEventDataSchema),
3236
- z17.object({
3237
- type: z17.literal("system/provider-turn-watchdog"),
3238
- threadId: z17.string()
3752
+ z18.object({
3753
+ type: z18.literal("system/provider-turn-watchdog"),
3754
+ threadId: z18.string()
3239
3755
  }).merge(systemProviderTurnWatchdogEventDataSchema)
3240
3756
  ]);
3241
3757
  var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
@@ -3243,13 +3759,13 @@ var legacyClientRequestKey = ["clientRequest", "Sequence"].join("");
3243
3759
  function isEventPropertyBag(value) {
3244
3760
  return typeof value === "object" && value !== null && !Array.isArray(value);
3245
3761
  }
3246
- var rejectLegacyClientRequestSequenceSchema = z17.unknown().superRefine((value, ctx) => {
3762
+ var rejectLegacyClientRequestSequenceSchema = z18.unknown().superRefine((value, ctx) => {
3247
3763
  if (!isEventPropertyBag(value)) {
3248
3764
  return;
3249
3765
  }
3250
3766
  if (Object.hasOwn(value, legacyClientRequestKey)) {
3251
3767
  ctx.addIssue({
3252
- code: z17.ZodIssueCode.custom,
3768
+ code: z18.ZodIssueCode.custom,
3253
3769
  message: "legacy request sequence field is no longer accepted",
3254
3770
  path: [legacyClientRequestKey]
3255
3771
  });
@@ -3257,21 +3773,21 @@ var rejectLegacyClientRequestSequenceSchema = z17.unknown().superRefine((value,
3257
3773
  const item = value.item;
3258
3774
  if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
3259
3775
  ctx.addIssue({
3260
- code: z17.ZodIssueCode.custom,
3776
+ code: z18.ZodIssueCode.custom,
3261
3777
  message: "legacy user-message request sequence field is no longer accepted",
3262
3778
  path: ["item", legacyClientRequestKey]
3263
3779
  });
3264
3780
  }
3265
3781
  });
3266
3782
  var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
3267
- z17.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
3783
+ z18.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
3268
3784
  const result = validateThreadEventScope({
3269
3785
  type: event.type,
3270
3786
  scope: event.scope
3271
3787
  });
3272
3788
  if (!result.valid) {
3273
3789
  ctx.addIssue({
3274
- code: z17.ZodIssueCode.custom,
3790
+ code: z18.ZodIssueCode.custom,
3275
3791
  message: result.message ?? "Invalid thread event scope",
3276
3792
  path: ["scope"]
3277
3793
  });
@@ -3284,7 +3800,7 @@ var threadEventTypeValues = [
3284
3800
  ...systemEventTypeValues
3285
3801
  ];
3286
3802
  var threadEventTypeSet = new Set(threadEventTypeValues);
3287
- var threadEventTypeSchema = z17.string().refine(
3803
+ var threadEventTypeSchema = z18.string().refine(
3288
3804
  (value) => threadEventTypeSet.has(value),
3289
3805
  "Invalid thread event type"
3290
3806
  );
@@ -3295,95 +3811,96 @@ function toPositiveNumber(value) {
3295
3811
  }
3296
3812
 
3297
3813
  // ../domain/src/provider-fork.ts
3298
- import { z as z18 } from "zod";
3814
+ import { z as z19 } from "zod";
3299
3815
  var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
3300
- var providerForkSchema = z18.enum(PROVIDER_FORK_VALUES);
3816
+ var providerForkSchema = z19.enum(PROVIDER_FORK_VALUES);
3301
3817
 
3302
3818
  // ../domain/src/provider-types.ts
3303
- import { z as z19 } from "zod";
3304
- var modelReasoningEffortSchema = z19.object({
3819
+ import { z as z20 } from "zod";
3820
+ var modelReasoningEffortSchema = z20.object({
3305
3821
  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),
3822
+ description: z20.string()
3823
+ });
3824
+ var availableModelSchema = z20.object({
3825
+ id: z20.string(),
3826
+ model: z20.string(),
3827
+ displayName: z20.string(),
3828
+ routeProviderId: z20.string().min(1).optional(),
3829
+ description: z20.string(),
3830
+ supportedReasoningEfforts: z20.array(modelReasoningEffortSchema),
3315
3831
  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),
3832
+ isDefault: z20.boolean()
3833
+ });
3834
+ var providerModelCatalogScopeSchema = z20.enum(["host", "workspace"]);
3835
+ var providerCapabilitiesSchema = z20.object({
3836
+ supportsThreadArchive: z20.boolean(),
3837
+ supportsThreadRename: z20.boolean(),
3838
+ supportsServiceTier: z20.boolean(),
3839
+ supportsNativeUserQuestion: z20.boolean(),
3840
+ supportsFork: z20.boolean(),
3841
+ supportsSessionRewind: z20.boolean(),
3842
+ permissionModes: z20.array(permissionModeSchema).min(1),
3327
3843
  modelCatalogScope: providerModelCatalogScopeSchema
3328
3844
  });
3329
- var providerComposerCommandSchema = z19.object({
3845
+ var providerComposerCommandSchema = z20.object({
3330
3846
  trigger: promptMentionCommandTriggerSchema,
3331
- name: z19.string().min(1).regex(/^[^\s/$]+$/u),
3332
- trailingText: z19.string().regex(/^\s*$/u)
3847
+ name: z20.string().min(1).regex(/^[^\s/$]+$/u),
3848
+ trailingText: z20.string().regex(/^\s*$/u)
3333
3849
  });
3334
- var providerComposerActionSchema = z19.discriminatedUnion("kind", [
3335
- z19.object({
3336
- kind: z19.literal("skills"),
3850
+ var providerComposerActionSchema = z20.discriminatedUnion("kind", [
3851
+ z20.object({
3852
+ kind: z20.literal("skills"),
3337
3853
  trigger: promptMentionCommandTriggerSchema
3338
3854
  }),
3339
- z19.object({
3340
- kind: z19.literal("plan"),
3855
+ z20.object({
3856
+ kind: z20.literal("plan"),
3341
3857
  command: providerComposerCommandSchema
3342
3858
  }),
3343
- z19.object({
3344
- kind: z19.literal("goal"),
3859
+ z20.object({
3860
+ kind: z20.literal("goal"),
3345
3861
  command: providerComposerCommandSchema
3346
3862
  })
3347
3863
  ]);
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(
3864
+ var providerStringsSchema = z20.object({
3865
+ signInHint: z20.string().min(1),
3866
+ expiredHint: z20.string().min(1),
3867
+ installUrl: z20.string().min(1),
3868
+ brandPrefix: z20.string().min(1).optional(),
3869
+ planModeCopy: z20.string().min(1).optional(),
3870
+ iconTint: z20.object({ light: z20.string().min(1), dark: z20.string().min(1) }).optional()
3871
+ });
3872
+ var providerOptionDescriptorSchema = z20.object({
3873
+ id: z20.string().min(1),
3874
+ label: z20.string().min(1),
3875
+ description: z20.string().min(1).optional()
3876
+ });
3877
+ var providerExtensionKindInfoSchema = z20.object({
3878
+ item: z20.boolean(),
3879
+ state: z20.boolean()
3880
+ });
3881
+ var providerExtensionKindsSchema = z20.record(
3366
3882
  extensionKindSchema,
3367
3883
  providerExtensionKindInfoSchema
3368
3884
  );
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()
3885
+ var providerInfoSchema = z20.object({
3886
+ id: z20.string(),
3887
+ pluginId: z20.string().min(1),
3888
+ displayName: z20.string(),
3889
+ family: z20.string().min(1).optional(),
3890
+ icon: z20.object({ glyph: z20.string().min(1) }).optional(),
3891
+ logoUrl: z20.string().min(1).nullable(),
3892
+ maintenance: z20.object({
3893
+ health: z20.boolean(),
3894
+ usage: z20.boolean(),
3895
+ installation: z20.boolean()
3380
3896
  }),
3381
3897
  capabilities: providerCapabilitiesSchema,
3382
- composerActions: z19.array(providerComposerActionSchema),
3383
- available: z19.boolean(),
3898
+ composerActions: z20.array(providerComposerActionSchema),
3899
+ completedTurnDisplay: completedTurnDisplaySchema,
3900
+ available: z20.boolean(),
3384
3901
  strings: providerStringsSchema.optional(),
3385
- serviceTiers: z19.array(providerOptionDescriptorSchema).optional(),
3386
- reasoningLevels: z19.array(providerOptionDescriptorSchema).optional(),
3902
+ serviceTiers: z20.array(providerOptionDescriptorSchema).optional(),
3903
+ reasoningLevels: z20.array(providerOptionDescriptorSchema).optional(),
3387
3904
  extensionKinds: providerExtensionKindsSchema.optional()
3388
3905
  });
3389
3906
  var providerRecoveryKindValues = [
@@ -3393,34 +3910,34 @@ var providerRecoveryKindValues = [
3393
3910
  "staleTurn",
3394
3911
  "rateLimited"
3395
3912
  ];
3396
- var providerRecoveryKindSchema = z19.enum(providerRecoveryKindValues);
3397
- var toolCallOutputItemSchema = z19.discriminatedUnion("type", [
3398
- z19.object({
3399
- type: z19.literal("inputText"),
3400
- text: z19.string()
3913
+ var providerRecoveryKindSchema = z20.enum(providerRecoveryKindValues);
3914
+ var toolCallOutputItemSchema = z20.discriminatedUnion("type", [
3915
+ z20.object({
3916
+ type: z20.literal("inputText"),
3917
+ text: z20.string()
3401
3918
  }),
3402
- z19.object({
3403
- type: z19.literal("inputImage"),
3404
- imageUrl: z19.string()
3919
+ z20.object({
3920
+ type: z20.literal("inputImage"),
3921
+ imageUrl: z20.string()
3405
3922
  })
3406
3923
  ]);
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(),
3924
+ var toolCallRequestSchema = z20.object({
3925
+ requestId: z20.union([z20.string().min(1), z20.number()]),
3926
+ threadId: z20.string().min(1),
3927
+ providerThreadId: z20.string().min(1),
3928
+ turnId: z20.string().min(1),
3929
+ callId: z20.string().min(1),
3930
+ tool: z20.string().min(1),
3931
+ arguments: z20.unknown().optional()
3932
+ });
3933
+ var toolCallResponseSchema = z20.object({
3934
+ contentItems: z20.array(toolCallOutputItemSchema),
3935
+ success: z20.boolean()
3936
+ });
3937
+ var dynamicToolSchema = z20.object({
3938
+ name: z20.string(),
3939
+ description: z20.string(),
3940
+ inputSchema: z20.unknown(),
3424
3941
  presentation: threadEventItemPresentationSchema.optional()
3425
3942
  });
3426
3943
 
@@ -3472,60 +3989,60 @@ function reasoningEffortsForLevels(levels) {
3472
3989
  }
3473
3990
 
3474
3991
  // ../provider-bridge-protocol/src/bridge-requests.ts
3475
- import { z as z20 } from "zod";
3992
+ import { z as z21 } from "zod";
3476
3993
  var BRIDGE_INBOUND_REQUEST_METHODS = {
3477
3994
  toolCall: "item/tool/call",
3478
3995
  interactionRequest: "interaction/request"
3479
3996
  };
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()
3997
+ var toolCallRequestParamsSchema = z21.object({
3998
+ providerThreadId: z21.string().min(1),
3999
+ threadId: z21.string().min(1).optional(),
4000
+ turnId: z21.union([z21.string().min(1), z21.null()]),
4001
+ callId: z21.string().min(1),
4002
+ tool: z21.string().min(1),
4003
+ arguments: z21.unknown(),
4004
+ providerNativeIds: z21.boolean().optional()
3488
4005
  }).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)
4006
+ var toolCallResultSchema = z21.object({
4007
+ success: z21.boolean(),
4008
+ contentItems: z21.array(
4009
+ z21.discriminatedUnion("type", [
4010
+ z21.object({ type: z21.literal("inputText"), text: z21.string() }),
4011
+ z21.object({
4012
+ type: z21.literal("inputImage"),
4013
+ imageUrl: z21.string().min(1)
3497
4014
  })
3498
4015
  ])
3499
4016
  )
3500
4017
  }).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()]),
4018
+ var interactionRequestParamsSchema = z21.object({
4019
+ providerThreadId: z21.string().min(1),
4020
+ threadId: z21.string().min(1).optional(),
4021
+ turnId: z21.union([z21.string().min(1), z21.null()]),
3505
4022
  payload: pendingInteractionPayloadSchema,
3506
- providerNativeIds: z20.boolean().optional()
4023
+ providerNativeIds: z21.boolean().optional()
3507
4024
  }).passthrough();
3508
4025
 
3509
4026
  // ../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()]),
4027
+ var bridgeRequestEnvelopeSchema = z22.object({
4028
+ jsonrpc: z22.literal("2.0"),
4029
+ id: z22.union([z22.string(), z22.number()]),
4030
+ method: z22.string(),
4031
+ params: z22.record(z22.string(), z22.unknown()).optional()
4032
+ });
4033
+ var jsonRpcErrorSchema = z22.object({
4034
+ code: z22.number(),
4035
+ message: z22.string().optional(),
4036
+ data: z22.unknown().optional()
4037
+ });
4038
+ var jsonRpcSuccessResponseSchema = z22.object({
4039
+ jsonrpc: z22.literal("2.0"),
4040
+ id: z22.union([z22.string(), z22.number()]),
4041
+ result: z22.unknown()
4042
+ });
4043
+ var jsonRpcErrorResponseSchema = z22.object({
4044
+ jsonrpc: z22.literal("2.0"),
4045
+ id: z22.union([z22.string(), z22.number()]),
3529
4046
  error: jsonRpcErrorSchema
3530
4047
  });
3531
4048
  function isJsonRpcRequest(input) {
@@ -3613,47 +4130,47 @@ function buildBridgeToolCallContent(result) {
3613
4130
  }
3614
4131
 
3615
4132
  // ../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(),
4133
+ import { z as z23 } from "zod";
4134
+ var recordSchema = z23.record(z23.string(), z23.unknown());
4135
+ var jsonRpcEnvelopeSchema = z23.object({
4136
+ jsonrpc: z23.literal("2.0"),
4137
+ method: z23.string(),
3621
4138
  params: recordSchema.optional()
3622
4139
  }).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()
4140
+ var sdkMessageEnvelopeSchema = z23.object({
4141
+ jsonrpc: z23.literal("2.0"),
4142
+ method: z23.literal("sdk/message"),
4143
+ params: z23.object({
4144
+ message: z23.unknown(),
4145
+ threadId: z23.string().optional(),
4146
+ parent_tool_use_id: z23.string().optional()
3630
4147
  }).passthrough()
3631
4148
  }).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()
4149
+ var threadIdentityEnvelopeSchema = z23.object({
4150
+ jsonrpc: z23.literal("2.0"),
4151
+ method: z23.literal("thread/identity"),
4152
+ params: z23.object({
4153
+ threadId: z23.string().optional(),
4154
+ providerThreadId: z23.string().optional()
3638
4155
  }).passthrough()
3639
4156
  }).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()
4157
+ var threadContextWindowUsageEnvelopeSchema = z23.object({
4158
+ jsonrpc: z23.literal("2.0"),
4159
+ method: z23.literal("thread/contextWindowUsage/updated"),
4160
+ params: z23.object({
4161
+ threadId: z23.string().optional(),
4162
+ contextWindowUsage: z23.object({
4163
+ usedTokens: z23.number().nullable(),
4164
+ modelContextWindow: z23.number().nullable(),
4165
+ estimated: z23.boolean()
3649
4166
  })
3650
4167
  }).passthrough()
3651
4168
  }).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()
4169
+ var errorEnvelopeSchema = z23.object({
4170
+ jsonrpc: z23.literal("2.0"),
4171
+ method: z23.literal("error"),
4172
+ params: z23.object({
4173
+ message: z23.string().optional()
3657
4174
  }).passthrough().optional()
3658
4175
  }).passthrough();
3659
4176
 
@@ -3834,12 +4351,14 @@ function experimental_defineProviderBridge(definition) {
3834
4351
  }
3835
4352
 
3836
4353
  // ../provider-bridge-protocol/src/bridge-kit/provider-maintenance-kit.ts
4354
+ var import_compare = __toESM(require_compare(), 1);
4355
+ var import_valid = __toESM(require_valid(), 1);
3837
4356
  import { execFile } from "node:child_process";
3838
4357
  import { constants as fsConstants } from "node:fs";
3839
4358
  import { access } from "node:fs/promises";
3840
4359
  import path from "node:path";
3841
4360
  import { promisify } from "node:util";
3842
- import { z as z23 } from "zod";
4361
+ import { z as z24 } from "zod";
3843
4362
  var execFileAsync = promisify(execFile);
3844
4363
  var CLI_PROBE_TIMEOUT_MS = 5e3;
3845
4364
  var INSTALLATION_CHECK_TIMEOUT_MS = 15e3;
@@ -3874,7 +4393,8 @@ ${stderr}`.trim();
3874
4393
  }
3875
4394
  }
3876
4395
  function versionFrom(value) {
3877
- return value?.match(/\bv?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)\b/u)?.[1] ?? null;
4396
+ const candidate = value?.match(/\bv?(\d+\.\d+\.\d+[0-9A-Za-z.+-]*)/u)?.[1];
4397
+ return candidate !== void 0 && (0, import_valid.default)(candidate) !== null ? candidate : null;
3878
4398
  }
3879
4399
  async function readCliVersion(command) {
3880
4400
  try {
@@ -3883,32 +4403,14 @@ async function readCliVersion(command) {
3883
4403
  });
3884
4404
  probe.child.stdin?.end();
3885
4405
  const { stdout, stderr } = await probe;
3886
- return `${stdout}
3887
- ${stderr}`.match(/\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?/u)?.[0] ?? null;
4406
+ return versionFrom(`${stdout}
4407
+ ${stderr}`);
3888
4408
  } catch {
3889
4409
  return null;
3890
4410
  }
3891
4411
  }
3892
4412
  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;
4413
+ return (0, import_compare.default)(left, right);
3912
4414
  }
3913
4415
  function npmCommand() {
3914
4416
  return process.platform === "win32" ? "npm.cmd" : "npm";
@@ -3946,8 +4448,8 @@ function firstLine(value) {
3946
4448
  function npmGlobalPackageVersion(value, npmPackage) {
3947
4449
  if (value === null) return null;
3948
4450
  try {
3949
- const parsed = z23.object({
3950
- dependencies: z23.record(z23.string(), z23.object({ version: z23.string().min(1) })).default({})
4451
+ const parsed = z24.object({
4452
+ dependencies: z24.record(z24.string(), z24.object({ version: z24.string().min(1) })).default({})
3951
4453
  }).safeParse(JSON.parse(value));
3952
4454
  return parsed.success ? parsed.data.dependencies[npmPackage]?.version ?? null : null;
3953
4455
  } catch {
@@ -3984,9 +4486,9 @@ function clampPercent(value) {
3984
4486
  }
3985
4487
 
3986
4488
  // ../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()])
4489
+ import { z as z25 } from "zod";
4490
+ var providerToolCallCancellationSchema = z25.object({
4491
+ requestId: z25.union([z25.string(), z25.number().int()])
3990
4492
  });
3991
4493
 
3992
4494
  // ../provider-bridge-protocol/src/bridge-kit/provider-visibility.ts
@@ -4001,10 +4503,10 @@ function createProviderVisibilityMetadata(args) {
4001
4503
  }
4002
4504
 
4003
4505
  // ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
4004
- import { z as z26 } from "zod";
4506
+ import { z as z27 } from "zod";
4005
4507
 
4006
4508
  // ../provider-bridge-protocol/src/errors.ts
4007
- import { z as z25 } from "zod";
4509
+ import { z as z26 } from "zod";
4008
4510
  var BRIDGE_JSON_RPC_ERRORS = {
4009
4511
  INVALID_PARAMS: -32602,
4010
4512
  METHOD_NOT_FOUND: -32601,
@@ -4013,12 +4515,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
4013
4515
  SESSION_NOT_RESTORABLE: -32002,
4014
4516
  FORK_CHECKPOINT_UNSUPPORTED: -32003
4015
4517
  };
4016
- var providerRecoveryHintSchema = z25.object({
4518
+ var providerRecoveryHintSchema = z26.object({
4017
4519
  kind: providerRecoveryKindSchema,
4018
- message: z25.string().min(1),
4019
- retryable: z25.boolean()
4520
+ message: z26.string().min(1),
4521
+ retryable: z26.boolean()
4020
4522
  });
4021
- var bridgeErrorDataSchema = z25.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
4523
+ var bridgeErrorDataSchema = z26.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
4022
4524
 
4023
4525
  // ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
4024
4526
  var JSON_RPC_INVALID_PARAMS_CODE = -32602;
@@ -4036,7 +4538,7 @@ var ProviderResponseEncodeError = class extends Error {
4036
4538
  this.name = "ProviderResponseEncodeError";
4037
4539
  }
4038
4540
  };
4039
- var ignoredJsonRpcResultSchema = z26.unknown();
4541
+ var ignoredJsonRpcResultSchema = z27.unknown();
4040
4542
 
4041
4543
  // ../provider-bridge-protocol/src/version.ts
4042
4544
  var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
@@ -4044,66 +4546,66 @@ var THREAD_DELTA_GRAMMAR_V2 = PROVIDER_BRIDGE_PROTOCOL_VERSION;
4044
4546
  var THREAD_DELTA_GRAMMAR_V3 = 3;
4045
4547
 
4046
4548
  // ../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, {
4549
+ import { z as z28 } from "zod";
4550
+ var bridgeGrammarVersionsSchema = z28.tuple([z28.number().int().positive(), z28.number().int().positive()]).refine(([min, max]) => min <= max, {
4049
4551
  message: "grammarVersions must be an ascending [min, max] range"
4050
4552
  });
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),
4553
+ var bridgeSteerModeSchema = z28.enum(["inject", "queue"]);
4554
+ var bridgeCapabilitiesSchema = z28.object({
4555
+ sessionRestore: z28.boolean().default(false),
4556
+ threadArchive: z28.boolean().default(false),
4557
+ threadRename: z28.boolean().default(false),
4558
+ threadGoalClear: z28.boolean().default(false),
4057
4559
  fork: providerForkSchema.default("none"),
4058
- approvalEnforcedBy: z27.enum(["runtime", "provider"]).default("runtime"),
4560
+ approvalEnforcedBy: z28.enum(["runtime", "provider"]).default("runtime"),
4059
4561
  grammarVersions: bridgeGrammarVersionsSchema.default([
4060
4562
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
4061
4563
  PROVIDER_BRIDGE_PROTOCOL_VERSION
4062
4564
  ]),
4063
4565
  steerMode: bridgeSteerModeSchema.default("queue"),
4064
- skills: z27.object({ configure: z27.boolean().default(false) }).default({ configure: false })
4566
+ skills: z28.object({ configure: z28.boolean().default(false) }).default({ configure: false })
4065
4567
  }).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) }),
4568
+ var initializeParamsSchema = z28.object({
4569
+ protocolVersion: z28.number().int().positive(),
4570
+ client: z28.object({ name: z28.string().min(1), version: z28.string().min(1) }),
4069
4571
  grammarVersions: bridgeGrammarVersionsSchema.default([
4070
4572
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
4071
4573
  PROVIDER_BRIDGE_PROTOCOL_VERSION
4072
4574
  ])
4073
4575
  }).passthrough();
4074
- var initializeResultSchema = z27.object({
4075
- protocolVersion: z27.number().int().positive(),
4076
- capabilities: z27.preprocess(
4576
+ var initializeResultSchema = z28.object({
4577
+ protocolVersion: z28.number().int().positive(),
4578
+ capabilities: z28.preprocess(
4077
4579
  (value) => value ?? {},
4078
4580
  bridgeCapabilitiesSchema
4079
4581
  )
4080
4582
  }).passthrough();
4081
4583
 
4082
4584
  // ../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(),
4585
+ import { z as z29 } from "zod";
4586
+ var bridgeExecutionOptionsSchema = z29.object({
4587
+ model: z29.string().min(1).optional(),
4086
4588
  serviceTier: serviceTierSchema.optional(),
4087
4589
  reasoningLevel: reasoningLevelSchema.optional(),
4088
4590
  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()
4591
+ instructions: z29.string().optional(),
4592
+ envVars: z29.record(z29.string(), z29.string()).optional(),
4593
+ providerOptions: z29.record(z29.string(), z29.unknown()).optional()
4092
4594
  }).and(runtimePermissionPolicySchema);
4093
4595
 
4094
4596
  // ../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()
4597
+ import { z as z30 } from "zod";
4598
+ var providerMaintenanceParamsSchema = z30.object({
4599
+ providerId: z30.string().min(1),
4600
+ cwd: z30.string().min(1).optional(),
4601
+ providerOptions: z30.record(z30.string(), z30.unknown()).optional()
4100
4602
  }).passthrough();
4101
- var providerInstallationRequirementSchema = z29.enum(["thread_rewind"]);
4603
+ var providerInstallationRequirementSchema = z30.enum(["thread_rewind"]);
4102
4604
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
4103
4605
  requirement: providerInstallationRequirementSchema.optional()
4104
4606
  });
4105
- var providerHealthSchema = z29.object({
4106
- status: z29.enum([
4607
+ var providerHealthSchema = z30.object({
4608
+ status: z30.enum([
4107
4609
  "ready",
4108
4610
  "not_installed",
4109
4611
  "unauthenticated",
@@ -4111,114 +4613,114 @@ var providerHealthSchema = z29.object({
4111
4613
  "unsupported_version",
4112
4614
  "unknown"
4113
4615
  ]),
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()
4616
+ statusMessage: z30.string().min(1).nullable(),
4617
+ accountEmail: z30.string().nullable(),
4618
+ planLabel: z30.string().min(1).nullable(),
4619
+ installedVersion: z30.string().min(1).nullable(),
4620
+ minimumSupportedVersion: z30.string().min(1).nullable(),
4621
+ canInstall: z30.boolean(),
4622
+ canUpdate: z30.boolean(),
4623
+ loginCommand: z30.string().min(1).nullable()
4122
4624
  }).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()
4625
+ var providerUsageWindowSchema = z30.object({
4626
+ label: z30.string().min(1),
4627
+ usedPercent: z30.number().min(0).max(100),
4628
+ resetsAt: z30.string().min(1).nullable(),
4629
+ cost: z30.object({
4630
+ usedUsdCents: z30.number().int().nonnegative(),
4631
+ limitUsdCents: z30.number().int().positive()
4130
4632
  }).optional()
4131
4633
  }).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)
4634
+ var providerUsageSchema = z30.discriminatedUnion("status", [
4635
+ z30.object({
4636
+ status: z30.literal("ok"),
4637
+ accountEmail: z30.string().email().nullable(),
4638
+ planLabel: z30.string().min(1).nullable(),
4639
+ windows: z30.array(providerUsageWindowSchema)
4138
4640
  }).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)
4641
+ z30.object({ status: z30.literal("not_installed") }).passthrough(),
4642
+ z30.object({ status: z30.literal("unauthenticated") }).passthrough(),
4643
+ z30.object({ status: z30.literal("expired") }).passthrough(),
4644
+ z30.object({
4645
+ status: z30.literal("error"),
4646
+ message: z30.string().min(1),
4647
+ planLabel: z30.string().min(1).nullable().default(null),
4648
+ accountEmail: z30.string().nullable().default(null)
4147
4649
  }).passthrough()
4148
4650
  ]);
4149
- var providerHealthResultSchema = z29.discriminatedUnion("supported", [
4150
- z29.object({ supported: z29.literal(false) }).passthrough(),
4151
- z29.object({
4152
- supported: z29.literal(true),
4651
+ var providerHealthResultSchema = z30.discriminatedUnion("supported", [
4652
+ z30.object({ supported: z30.literal(false) }).passthrough(),
4653
+ z30.object({
4654
+ supported: z30.literal(true),
4153
4655
  health: providerHealthSchema
4154
4656
  }).passthrough()
4155
4657
  ]);
4156
- var providerUsageResultSchema = z29.discriminatedUnion("supported", [
4157
- z29.object({ supported: z29.literal(false) }).passthrough(),
4158
- z29.object({
4159
- supported: z29.literal(true),
4658
+ var providerUsageResultSchema = z30.discriminatedUnion("supported", [
4659
+ z30.object({ supported: z30.literal(false) }).passthrough(),
4660
+ z30.object({
4661
+ supported: z30.literal(true),
4160
4662
  usage: providerUsageSchema
4161
4663
  }).passthrough()
4162
4664
  ]);
4163
- var providerInstallationActionKindSchema = z29.enum([
4665
+ var providerInstallationActionKindSchema = z30.enum([
4164
4666
  "install",
4165
4667
  "update"
4166
4668
  ]);
4167
- var providerInstallationActionSchema = z29.object({
4669
+ var providerInstallationActionSchema = z30.object({
4168
4670
  kind: providerInstallationActionKindSchema,
4169
- label: z29.enum(["Install", "Update"]),
4170
- command: z29.string().min(1)
4671
+ label: z30.enum(["Install", "Update"]),
4672
+ command: z30.string().min(1)
4171
4673
  }).passthrough();
4172
- var providerInstallationSourceSchema = z29.enum([
4674
+ var providerInstallationSourceSchema = z30.enum([
4173
4675
  "notInstalled",
4174
4676
  "npmGlobal",
4175
4677
  "external"
4176
4678
  ]);
4177
- var providerInstallationStatusSchema = z29.object({
4178
- executableName: z29.string().min(1),
4179
- executablePath: z29.string().min(1).nullable(),
4180
- installed: z29.boolean(),
4679
+ var providerInstallationStatusSchema = z30.object({
4680
+ executableName: z30.string().min(1),
4681
+ executablePath: z30.string().min(1).nullable(),
4682
+ installed: z30.boolean(),
4181
4683
  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(),
4684
+ currentVersion: z30.string().min(1).nullable(),
4685
+ latestVersion: z30.string().min(1).nullable(),
4686
+ minimumSupportedVersion: z30.string().min(1).nullable(),
4687
+ npmPackageName: z30.string().min(1).nullable(),
4688
+ npmGlobalPackageVersion: z30.string().min(1).nullable(),
4187
4689
  installAction: providerInstallationActionSchema.nullable(),
4188
- needsUpdate: z29.boolean(),
4189
- versionUnsupported: z29.boolean()
4690
+ needsUpdate: z30.boolean(),
4691
+ versionUnsupported: z30.boolean()
4190
4692
  }).passthrough();
4191
4693
  var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
4192
4694
  action: providerInstallationActionKindSchema
4193
4695
  });
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)
4696
+ var providerInstallationCommandSchema = z30.object({
4697
+ command: z30.string().min(1),
4698
+ args: z30.array(z30.string()).max(64),
4699
+ displayCommand: z30.string().min(1)
4198
4700
  }).passthrough();
4199
- var providerInstallationVerificationSchema = z29.discriminatedUnion(
4701
+ var providerInstallationVerificationSchema = z30.discriminatedUnion(
4200
4702
  "kind",
4201
4703
  [
4202
- z29.object({ kind: z29.literal("installed") }).passthrough(),
4203
- z29.object({
4204
- kind: z29.literal("version_changed"),
4205
- previousVersion: z29.string().min(1)
4704
+ z30.object({ kind: z30.literal("installed") }).passthrough(),
4705
+ z30.object({
4706
+ kind: z30.literal("version_changed"),
4707
+ previousVersion: z30.string().min(1)
4206
4708
  }).passthrough(),
4207
- z29.object({
4208
- kind: z29.literal("version_at_least"),
4209
- version: z29.string().min(1)
4709
+ z30.object({
4710
+ kind: z30.literal("version_at_least"),
4711
+ version: z30.string().min(1)
4210
4712
  }).passthrough()
4211
4713
  ]
4212
4714
  );
4213
- var providerInstallationRunResultSchema = z29.discriminatedUnion(
4715
+ var providerInstallationRunResultSchema = z30.discriminatedUnion(
4214
4716
  "available",
4215
4717
  [
4216
- z29.object({
4217
- available: z29.literal(false),
4218
- message: z29.string().min(1)
4718
+ z30.object({
4719
+ available: z30.literal(false),
4720
+ message: z30.string().min(1)
4219
4721
  }).passthrough(),
4220
- z29.object({
4221
- available: z29.literal(true),
4722
+ z30.object({
4723
+ available: z30.literal(true),
4222
4724
  command: providerInstallationCommandSchema,
4223
4725
  verification: providerInstallationVerificationSchema
4224
4726
  }).passthrough()
@@ -4226,7 +4728,7 @@ var providerInstallationRunResultSchema = z29.discriminatedUnion(
4226
4728
  );
4227
4729
 
4228
4730
  // ../provider-bridge-protocol/src/requests.ts
4229
- import { z as z30 } from "zod";
4731
+ import { z as z31 } from "zod";
4230
4732
  var BRIDGE_REQUEST_METHODS = {
4231
4733
  initialize: "initialize",
4232
4734
  modelList: "model/list",
@@ -4248,78 +4750,78 @@ var BRIDGE_REQUEST_METHODS = {
4248
4750
  skillsConfigure: "skills/configure"
4249
4751
  };
4250
4752
  var sessionConstructionFields = {
4251
- threadId: z30.string().min(1),
4252
- cwd: z30.string().min(1),
4753
+ threadId: z31.string().min(1),
4754
+ cwd: z31.string().min(1),
4253
4755
  options: bridgeExecutionOptionsSchema,
4254
- dynamicTools: z30.array(dynamicToolSchema).optional(),
4255
- disallowedTools: z30.array(z30.string().min(1)).optional(),
4756
+ dynamicTools: z31.array(dynamicToolSchema).optional(),
4757
+ disallowedTools: z31.array(z31.string().min(1)).optional(),
4256
4758
  instructionMode: instructionModeSchema
4257
4759
  };
4258
- var modelListParamsSchema = z30.object({ cwd: z30.string().min(1).optional() }).passthrough();
4259
- var threadStartParamsSchema = z30.object({
4760
+ var modelListParamsSchema = z31.object({ cwd: z31.string().min(1).optional() }).passthrough();
4761
+ var threadStartParamsSchema = z31.object({
4260
4762
  ...sessionConstructionFields,
4261
- input: z30.array(promptInputSchema).optional()
4763
+ input: z31.array(promptInputSchema).optional()
4262
4764
  }).passthrough();
4263
- var threadResumeParamsSchema = z30.object({
4765
+ var threadResumeParamsSchema = z31.object({
4264
4766
  ...sessionConstructionFields,
4265
- providerThreadId: z30.string().min(1)
4767
+ providerThreadId: z31.string().min(1)
4266
4768
  }).passthrough();
4267
- var threadForkParamsSchema = z30.object({
4769
+ var threadForkParamsSchema = z31.object({
4268
4770
  ...sessionConstructionFields,
4269
- sourceProviderThreadId: z30.string().min(1),
4270
- sourceProviderCheckpointId: z30.string().min(1).optional()
4771
+ sourceProviderThreadId: z31.string().min(1),
4772
+ sourceProviderCheckpointId: z31.string().min(1).optional()
4271
4773
  }).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()
4774
+ var threadStopParamsSchema = z31.object({
4775
+ threadId: z31.string().min(1),
4776
+ providerThreadId: z31.string().min(1),
4777
+ intent: z31.enum(["interrupt", "release"]),
4778
+ activeTurnId: z31.string().min(1).nullable()
4277
4779
  }).passthrough();
4278
- var threadRefParams = z30.object({
4279
- threadId: z30.string().min(1),
4280
- providerThreadId: z30.string().min(1)
4780
+ var threadRefParams = z31.object({
4781
+ threadId: z31.string().min(1),
4782
+ providerThreadId: z31.string().min(1)
4281
4783
  }).passthrough();
4282
4784
  var threadDiscardParamsSchema = threadRefParams;
4283
4785
  var threadArchiveParamsSchema = threadRefParams;
4284
4786
  var threadUnarchiveParamsSchema = threadRefParams;
4285
4787
  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)
4788
+ var threadNameSetParamsSchema = z31.object({
4789
+ threadId: z31.string().min(1),
4790
+ providerThreadId: z31.string().min(1),
4791
+ title: z31.string().min(1)
4290
4792
  }).passthrough();
4291
4793
  var turnInputFields = {
4292
- threadId: z30.string().min(1),
4293
- providerThreadId: z30.string().min(1),
4294
- input: z30.array(promptInputSchema),
4794
+ threadId: z31.string().min(1),
4795
+ providerThreadId: z31.string().min(1),
4796
+ input: z31.array(promptInputSchema),
4295
4797
  clientRequestId: clientTurnRequestIdSchema,
4296
4798
  options: bridgeExecutionOptionsSchema
4297
4799
  };
4298
- var turnStartParamsSchema = z30.object(turnInputFields).passthrough();
4299
- var turnSteerParamsSchema = z30.object({
4800
+ var turnStartParamsSchema = z31.object(turnInputFields).passthrough();
4801
+ var turnSteerParamsSchema = z31.object({
4300
4802
  ...turnInputFields,
4301
- expectedTurnId: z30.string().min(1)
4803
+ expectedTurnId: z31.string().min(1)
4302
4804
  }).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()
4805
+ var skillsConfigureRootSchema = z31.object({
4806
+ id: z31.string().min(1),
4807
+ path: z31.string().min(1),
4808
+ skills: z31.array(
4809
+ z31.object({
4810
+ name: z31.string().min(1),
4811
+ description: z31.string()
4310
4812
  }).passthrough()
4311
4813
  )
4312
4814
  }).passthrough();
4313
- var skillsConfigureParamsSchema = z30.object({
4314
- roots: z30.array(skillsConfigureRootSchema)
4815
+ var skillsConfigureParamsSchema = z31.object({
4816
+ roots: z31.array(skillsConfigureRootSchema)
4315
4817
  }).passthrough();
4316
- var threadIdentityResultSchema = z30.object({
4317
- providerThreadId: z30.string().min(1),
4318
- sessionRestorable: z30.boolean().optional()
4818
+ var threadIdentityResultSchema = z31.object({
4819
+ providerThreadId: z31.string().min(1),
4820
+ sessionRestorable: z31.boolean().optional()
4319
4821
  }).passthrough();
4320
4822
 
4321
4823
  // ../provider-bridge-protocol/src/notifications.ts
4322
- import { z as z31 } from "zod";
4824
+ import { z as z32 } from "zod";
4323
4825
  var BRIDGE_NOTIFICATION_METHODS = {
4324
4826
  threadIdentity: "thread/identity",
4325
4827
  sessionReplaced: "session/replaced",
@@ -4327,142 +4829,142 @@ var BRIDGE_NOTIFICATION_METHODS = {
4327
4829
  providerRecovery: "provider/recovery",
4328
4830
  error: "error"
4329
4831
  };
4330
- var threadIdentityNotificationSchema = z31.object({
4331
- threadId: z31.string().min(1),
4332
- providerThreadId: z31.string().min(1),
4333
- sessionRestorable: z31.boolean().optional()
4832
+ var threadIdentityNotificationSchema = z32.object({
4833
+ threadId: z32.string().min(1),
4834
+ providerThreadId: z32.string().min(1),
4835
+ sessionRestorable: z32.boolean().optional()
4334
4836
  }).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)
4837
+ var sessionReplacedNotificationSchema = z32.object({
4838
+ threadId: z32.string().min(1),
4839
+ providerThreadId: z32.string().min(1).nullable(),
4840
+ reason: z32.string().min(1),
4841
+ contextLost: z32.boolean().default(false),
4842
+ showRuntimeNote: z32.boolean().default(false)
4341
4843
  }).passthrough();
4342
- var providerRecoveryNotificationSchema = z31.object({
4343
- threadId: z31.string().min(1).optional(),
4844
+ var providerRecoveryNotificationSchema = z32.object({
4845
+ threadId: z32.string().min(1).optional(),
4344
4846
  ...providerRecoveryHintSchema.shape
4345
4847
  }).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)
4848
+ var errorNotificationSchema = z32.object({
4849
+ threadId: z32.string().min(1).optional(),
4850
+ providerThreadId: z32.string().min(1).optional(),
4851
+ message: z32.string().min(1)
4350
4852
  }).passthrough();
4351
4853
 
4352
4854
  // ../provider-bridge-protocol/src/thread-delta.ts
4353
- import { z as z32 } from "zod";
4855
+ import { z as z33 } from "zod";
4354
4856
  var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
4355
4857
  var deltaPresentationSchema = threadEventItemPresentationSchema;
4356
4858
  var THREAD_DELTA_KEY_SEPARATOR = "";
4357
- var deltaKeyPartSchema = z32.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
4859
+ var deltaKeyPartSchema = z33.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
4358
4860
  message: "provider keys must not contain the internal key separator (\\u001f)"
4359
4861
  });
4360
- var deltaItemKeySchema = z32.object({
4862
+ var deltaItemKeySchema = z33.object({
4361
4863
  providerItemId: deltaKeyPartSchema.optional(),
4362
4864
  channel: deltaKeyPartSchema.optional(),
4363
4865
  parentRef: deltaKeyPartSchema.optional()
4364
4866
  });
4365
4867
  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(),
4868
+ var deltaFileChangeSchema = z33.object({
4869
+ path: z33.string(),
4870
+ kind: z33.enum(["add", "update", "delete"]),
4871
+ movePath: z33.string().optional(),
4872
+ diff: z33.string().optional(),
4873
+ oldText: z33.string().optional(),
4874
+ newText: z33.string().optional()
4875
+ });
4876
+ var deltaBackgroundTaskShapeSchema = z33.object({
4877
+ type: z33.literal("backgroundTask"),
4878
+ familyId: z33.string().min(1),
4879
+ taskType: z33.string(),
4880
+ description: z33.string(),
4379
4881
  status: threadEventItemStatusSchema,
4380
4882
  taskStatus: backgroundTaskStatusSchema,
4381
- skipTranscript: z32.boolean(),
4382
- workflowName: z32.string().optional(),
4883
+ skipTranscript: z33.boolean(),
4884
+ workflowName: z33.string().optional(),
4383
4885
  workflow: workflowProgressSnapshotSchema.optional(),
4384
4886
  usage: backgroundTaskUsageSchema.optional(),
4385
- summary: z32.string().optional(),
4386
- error: z32.string().optional(),
4387
- outputFile: z32.string().optional()
4887
+ summary: z33.string().optional(),
4888
+ error: z33.string().optional(),
4889
+ outputFile: z33.string().optional()
4388
4890
  });
4389
- var deltaFileReadShapeSchema = z32.object({
4390
- type: z32.literal("fileRead"),
4391
- path: z32.string(),
4392
- cmd: z32.string().optional()
4891
+ var deltaFileReadShapeSchema = z33.object({
4892
+ type: z33.literal("fileRead"),
4893
+ path: z33.string(),
4894
+ cmd: z33.string().optional()
4393
4895
  });
4394
- var deltaSearchShapeSchema = z32.object({
4395
- type: z32.literal("search"),
4896
+ var deltaSearchShapeSchema = z33.object({
4897
+ type: z33.literal("search"),
4396
4898
  mode: threadEventSearchModeSchema,
4397
- query: z32.string(),
4398
- path: z32.string().optional(),
4399
- cmd: z32.string().optional()
4899
+ query: z33.string(),
4900
+ path: z33.string().optional(),
4901
+ cmd: z33.string().optional()
4400
4902
  });
4401
- var deltaDelegationShapeSchema = z32.object({
4402
- type: z32.literal("delegation"),
4903
+ var deltaDelegationShapeSchema = z33.object({
4904
+ type: z33.literal("delegation"),
4403
4905
  childRef: deltaKeyPartSchema,
4404
- label: z32.string(),
4405
- background: z32.boolean(),
4406
- summary: z32.string().optional()
4906
+ label: z33.string(),
4907
+ background: z33.boolean(),
4908
+ summary: z33.string().optional()
4407
4909
  });
4408
- var deltaPlanStepsShapeSchema = z32.object({
4409
- type: z32.literal("planSteps"),
4410
- steps: z32.array(threadEventPlanStepSchema),
4411
- explanation: z32.string().optional()
4910
+ var deltaPlanStepsShapeSchema = z33.object({
4911
+ type: z33.literal("planSteps"),
4912
+ steps: z33.array(threadEventPlanStepSchema),
4913
+ explanation: z33.string().optional()
4412
4914
  });
4413
- var deltaExtensionShapeSchema = z32.object({
4414
- type: z32.literal("extension"),
4915
+ var deltaExtensionShapeSchema = z33.object({
4916
+ type: z33.literal("extension"),
4415
4917
  kind: extensionKindSchema,
4416
4918
  payload: jsonValueSchema
4417
4919
  });
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()
4920
+ var deltaItemShapeSchema = z33.discriminatedUnion("type", [
4921
+ z33.object({
4922
+ type: z33.literal("command"),
4923
+ command: z33.string(),
4924
+ cwd: z33.string(),
4925
+ aggregatedOutput: z33.string().optional(),
4926
+ exitCode: z33.number().optional(),
4927
+ durationMs: z33.number().optional()
4426
4928
  }),
4427
- z32.object({
4428
- type: z32.literal("fileChange"),
4429
- changes: z32.array(deltaFileChangeSchema)
4929
+ z33.object({
4930
+ type: z33.literal("fileChange"),
4931
+ changes: z33.array(deltaFileChangeSchema)
4430
4932
  }),
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()
4933
+ z33.object({
4934
+ type: z33.literal("tool"),
4935
+ tool: z33.string(),
4936
+ server: z33.string().optional(),
4937
+ args: z33.unknown().optional(),
4938
+ result: z33.unknown().optional(),
4939
+ error: z33.string().optional(),
4940
+ durationMs: z33.number().optional()
4439
4941
  }),
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())
4942
+ z33.object({ type: z33.literal("compaction") }),
4943
+ z33.object({ type: z33.literal("agentMessage"), text: z33.string() }),
4944
+ z33.object({
4945
+ type: z33.literal("reasoning"),
4946
+ summary: z33.array(z33.string()),
4947
+ content: z33.array(z33.string())
4446
4948
  }),
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)
4949
+ z33.object({ type: z33.literal("plan"), text: z33.string() }),
4950
+ z33.object({
4951
+ type: z33.literal("webSearch"),
4952
+ queries: z33.array(z33.string()).min(1)
4451
4953
  }),
4452
- z32.object({
4453
- type: z32.literal("webFetch"),
4454
- url: z32.string(),
4455
- prompt: z32.string().nullable().optional(),
4456
- pattern: z32.string().nullable()
4954
+ z33.object({
4955
+ type: z33.literal("webFetch"),
4956
+ url: z33.string(),
4957
+ prompt: z33.string().nullable().optional(),
4958
+ pattern: z33.string().nullable()
4457
4959
  }),
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()
4960
+ z33.object({ type: z33.literal("imageView"), path: z33.string() }),
4961
+ z33.object({
4962
+ type: z33.literal("imageGeneration"),
4963
+ prompt: z33.string().nullable(),
4964
+ path: z33.string().nullable(),
4965
+ result: z33.string().optional(),
4966
+ error: z33.string().nullable(),
4967
+ transparentBackground: z33.boolean()
4466
4968
  }),
4467
4969
  deltaBackgroundTaskShapeSchema,
4468
4970
  deltaFileReadShapeSchema,
@@ -4471,22 +4973,22 @@ var deltaItemShapeSchema = z32.discriminatedUnion("type", [
4471
4973
  deltaPlanStepsShapeSchema,
4472
4974
  deltaExtensionShapeSchema
4473
4975
  ]);
4474
- var deltaProgressSnapshotSchema = z32.discriminatedUnion("type", [
4976
+ var deltaProgressSnapshotSchema = z33.discriminatedUnion("type", [
4475
4977
  deltaBackgroundTaskShapeSchema,
4476
4978
  deltaDelegationShapeSchema
4477
4979
  ]);
4478
- var deltaTextChannelSchema = z32.enum([
4980
+ var deltaTextChannelSchema = z33.enum([
4479
4981
  "agentMessage",
4480
4982
  "reasoningSummary",
4481
4983
  "reasoningText",
4482
4984
  "plan"
4483
4985
  ]);
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({
4986
+ var deltaOutputChannelSchema = z33.enum(["command", "fileChange"]);
4987
+ var deltaErrorSchema = z33.object({ message: z33.string() });
4988
+ var deltaAttachSchema = z33.enum(["open", "currentOrLast"]);
4989
+ var deltaNoTurnFallbackSchema = z33.object({
4488
4990
  raw: providerRawEventSchema,
4489
- rawType: z32.string()
4991
+ rawType: z33.string()
4490
4992
  });
4491
4993
  function requireExtensionPresentation(delta, ctx) {
4492
4994
  if (delta.item.type === "extension" && delta.presentation === void 0) {
@@ -4497,32 +4999,32 @@ function requireExtensionPresentation(delta, ctx) {
4497
4999
  });
4498
5000
  }
4499
5001
  }
4500
- var threadDeltaSchema = z32.discriminatedUnion("kind", [
4501
- z32.object({
4502
- kind: z32.literal("input.accepted"),
5002
+ var threadDeltaSchema = z33.discriminatedUnion("kind", [
5003
+ z33.object({
5004
+ kind: z33.literal("input.accepted"),
4503
5005
  clientRequestId: clientTurnRequestIdSchema,
4504
5006
  providerTurnId: providerTurnIdSchema.optional()
4505
5007
  }),
4506
- z32.object({
4507
- kind: z32.literal("input.provider"),
4508
- text: z32.string().min(1),
5008
+ z33.object({
5009
+ kind: z33.literal("input.provider"),
5010
+ text: z33.string().min(1),
4509
5011
  parentRef: deltaKeyPartSchema.optional()
4510
5012
  }),
4511
- z32.object({
4512
- kind: z32.literal("turn.open"),
5013
+ z33.object({
5014
+ kind: z33.literal("turn.open"),
4513
5015
  providerTurnId: providerTurnIdSchema.optional(),
4514
5016
  parentRef: deltaKeyPartSchema.optional()
4515
5017
  }),
4516
- z32.object({
4517
- kind: z32.literal("turn.boundary"),
5018
+ z33.object({
5019
+ kind: z33.literal("turn.boundary"),
4518
5020
  status: threadEventTurnStatusSchema,
4519
5021
  error: deltaErrorSchema.optional(),
4520
- providerCheckpointId: z32.string().min(1).optional(),
4521
- claimIfIdle: z32.boolean().optional(),
5022
+ providerCheckpointId: z33.string().min(1).optional(),
5023
+ claimIfIdle: z33.boolean().optional(),
4522
5024
  providerTurnId: providerTurnIdSchema.optional()
4523
5025
  }),
4524
- z32.object({
4525
- kind: z32.literal("item.open"),
5026
+ z33.object({
5027
+ kind: z33.literal("item.open"),
4526
5028
  key: deltaItemKeySchema,
4527
5029
  item: deltaItemShapeSchema,
4528
5030
  presentation: deltaPresentationSchema.optional(),
@@ -4530,140 +5032,140 @@ var threadDeltaSchema = z32.discriminatedUnion("kind", [
4530
5032
  providerTurnId: providerTurnIdSchema.optional(),
4531
5033
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4532
5034
  }).superRefine(requireExtensionPresentation),
4533
- z32.object({
4534
- kind: z32.literal("item.close"),
5035
+ z33.object({
5036
+ kind: z33.literal("item.close"),
4535
5037
  key: deltaItemKeySchema,
4536
5038
  status: threadEventItemStatusSchema,
4537
- resultText: z32.string().optional(),
4538
- exitCode: z32.number().optional(),
4539
- aggregatedOutput: z32.string().optional(),
4540
- approvalStatus: z32.literal("denied").optional(),
5039
+ resultText: z33.string().optional(),
5040
+ exitCode: z33.number().optional(),
5041
+ aggregatedOutput: z33.string().optional(),
5042
+ approvalStatus: z33.literal("denied").optional(),
4541
5043
  item: deltaItemShapeSchema,
4542
5044
  presentation: deltaPresentationSchema.optional(),
4543
5045
  providerTurnId: providerTurnIdSchema.optional(),
4544
5046
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4545
5047
  }).superRefine(requireExtensionPresentation),
4546
- z32.object({
4547
- kind: z32.literal("item.progress"),
5048
+ z33.object({
5049
+ kind: z33.literal("item.progress"),
4548
5050
  key: deltaItemKeySchema,
4549
- message: z32.string().optional(),
5051
+ message: z33.string().optional(),
4550
5052
  snapshot: deltaProgressSnapshotSchema.optional(),
4551
- flush: z32.boolean().optional(),
5053
+ flush: z33.boolean().optional(),
4552
5054
  providerTurnId: providerTurnIdSchema.optional(),
4553
5055
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4554
5056
  }),
4555
- z32.object({
4556
- kind: z32.literal("item.textDelta"),
5057
+ z33.object({
5058
+ kind: z33.literal("item.textDelta"),
4557
5059
  key: deltaItemKeySchema,
4558
5060
  channel: deltaTextChannelSchema,
4559
- text: z32.string(),
5061
+ text: z33.string(),
4560
5062
  providerTurnId: providerTurnIdSchema.optional(),
4561
5063
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4562
5064
  }),
4563
- z32.object({
4564
- kind: z32.literal("item.textClose"),
5065
+ z33.object({
5066
+ kind: z33.literal("item.textClose"),
4565
5067
  key: deltaItemKeySchema,
4566
5068
  channel: deltaTextChannelSchema,
4567
- text: z32.string().optional(),
5069
+ text: z33.string().optional(),
4568
5070
  providerTurnId: providerTurnIdSchema.optional(),
4569
5071
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4570
5072
  }),
4571
- z32.object({
4572
- kind: z32.literal("item.outputDelta"),
5073
+ z33.object({
5074
+ kind: z33.literal("item.outputDelta"),
4573
5075
  key: deltaItemKeySchema,
4574
5076
  channel: deltaOutputChannelSchema,
4575
- text: z32.string(),
5077
+ text: z33.string(),
4576
5078
  providerTurnId: providerTurnIdSchema.optional(),
4577
5079
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4578
5080
  }),
4579
- z32.object({
4580
- kind: z32.literal("command.outputSnapshot"),
5081
+ z33.object({
5082
+ kind: z33.literal("command.outputSnapshot"),
4581
5083
  key: deltaItemKeySchema,
4582
- text: z32.string(),
5084
+ text: z33.string(),
4583
5085
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4584
5086
  }),
4585
- z32.object({
4586
- kind: z32.literal("usage"),
5087
+ z33.object({
5088
+ kind: z33.literal("usage"),
4587
5089
  total: threadEventTokenUsageBreakdownSchema,
4588
5090
  last: threadEventTokenUsageBreakdownSchema,
4589
- modelContextWindow: z32.number().nullable(),
5091
+ modelContextWindow: z33.number().nullable(),
4590
5092
  providerTurnId: providerTurnIdSchema.optional()
4591
5093
  }),
4592
- z32.object({
4593
- kind: z32.literal("contextWindow"),
5094
+ z33.object({
5095
+ kind: z33.literal("contextWindow"),
4594
5096
  snapshot: contextSnapshotSchema.optional(),
4595
- used: z32.number().nullable(),
4596
- size: z32.number().nullable().optional(),
4597
- estimated: z32.boolean(),
5097
+ used: z33.number().nullable(),
5098
+ size: z33.number().nullable().optional(),
5099
+ estimated: z33.boolean(),
4598
5100
  attach: deltaAttachSchema,
4599
5101
  providerTurnId: providerTurnIdSchema.optional()
4600
5102
  }),
4601
- z32.object({
4602
- kind: z32.literal("context.compacted"),
5103
+ z33.object({
5104
+ kind: z33.literal("context.compacted"),
4603
5105
  providerTurnId: providerTurnIdSchema.optional(),
4604
5106
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
4605
5107
  }),
4606
- z32.object({ kind: z32.literal("context.cleared") }),
4607
- z32.object({
4608
- kind: z32.literal("turn.diff"),
4609
- diff: z32.string(),
5108
+ z33.object({ kind: z33.literal("context.cleared") }),
5109
+ z33.object({
5110
+ kind: z33.literal("turn.diff"),
5111
+ diff: z33.string(),
4610
5112
  providerTurnId: providerTurnIdSchema.optional()
4611
5113
  }),
4612
- z32.object({ kind: z32.literal("thread.started") }),
4613
- z32.object({
4614
- kind: z32.literal("thread.identity"),
4615
- providerThreadId: z32.string().min(1)
5114
+ z33.object({ kind: z33.literal("thread.started") }),
5115
+ z33.object({
5116
+ kind: z33.literal("thread.identity"),
5117
+ providerThreadId: z33.string().min(1)
4616
5118
  }),
4617
- z32.object({ kind: z32.literal("thread.name"), name: z32.string().min(1) }),
4618
- z32.object({
4619
- kind: z32.literal("extension.state"),
5119
+ z33.object({ kind: z33.literal("thread.name"), name: z33.string().min(1) }),
5120
+ z33.object({
5121
+ kind: z33.literal("extension.state"),
4620
5122
  extensionKind: extensionKindSchema,
4621
5123
  payload: jsonValueSchema
4622
5124
  }),
4623
- z32.object({
4624
- kind: z32.literal("provider.rateLimits"),
5125
+ z33.object({
5126
+ kind: z33.literal("provider.rateLimits"),
4625
5127
  rateLimits: providerRateLimitStateSchema
4626
5128
  }),
4627
- z32.object({
4628
- kind: z32.literal("provider.error"),
4629
- message: z32.string(),
4630
- detail: z32.string().optional(),
4631
- willRetry: z32.boolean().optional(),
5129
+ z33.object({
5130
+ kind: z33.literal("provider.error"),
5131
+ message: z33.string(),
5132
+ detail: z33.string().optional(),
5133
+ willRetry: z33.boolean().optional(),
4632
5134
  category: providerErrorCategorySchema.optional(),
4633
5135
  errorInfo: providerErrorInfoSchema.optional(),
4634
- settlesTurn: z32.boolean().optional(),
5136
+ settlesTurn: z33.boolean().optional(),
4635
5137
  providerTurnId: providerTurnIdSchema.optional(),
4636
- threadScoped: z32.boolean().optional()
5138
+ threadScoped: z33.boolean().optional()
4637
5139
  }),
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()
5140
+ z33.object({
5141
+ kind: z33.literal("provider.modelFallback"),
5142
+ originalModel: z33.string().min(1),
5143
+ fallbackModel: z33.string().min(1),
5144
+ reason: z33.enum(["refusal", "provider"]),
5145
+ message: z33.string()
4644
5146
  }),
4645
- z32.object({
4646
- kind: z32.literal("provider.warning"),
4647
- summary: z32.string().optional(),
4648
- details: z32.string().optional(),
5147
+ z33.object({
5148
+ kind: z33.literal("provider.warning"),
5149
+ summary: z33.string().optional(),
5150
+ details: z33.string().optional(),
4649
5151
  category: threadEventWarningCategorySchema.optional(),
4650
- vouchedTurn: z32.boolean().optional()
5152
+ vouchedTurn: z33.boolean().optional()
4651
5153
  }),
4652
- z32.object({
4653
- kind: z32.literal("unhandled"),
5154
+ z33.object({
5155
+ kind: z33.literal("unhandled"),
4654
5156
  raw: providerRawEventSchema,
4655
- rawType: z32.string(),
4656
- vouchedTurn: z32.boolean(),
4657
- onlyIfNoTurn: z32.boolean().optional(),
5157
+ rawType: z33.string(),
5158
+ vouchedTurn: z33.boolean(),
5159
+ onlyIfNoTurn: z33.boolean().optional(),
4658
5160
  parentRef: deltaKeyPartSchema.optional(),
4659
5161
  providerTurnId: providerTurnIdSchema.optional()
4660
5162
  }),
4661
- z32.object({ kind: z32.literal("session.ended") }),
4662
- z32.object({ kind: z32.literal("session.reset") })
5163
+ z33.object({ kind: z33.literal("session.ended") }),
5164
+ z33.object({ kind: z33.literal("session.reset") })
4663
5165
  ]);
4664
- var threadDeltaNotificationParamsSchema = z32.object({
4665
- threadId: z32.string().min(1),
4666
- deltas: z32.array(threadDeltaSchema)
5166
+ var threadDeltaNotificationParamsSchema = z33.object({
5167
+ threadId: z33.string().min(1),
5168
+ deltas: z33.array(threadDeltaSchema)
4667
5169
  }).passthrough();
4668
5170
 
4669
5171
  // ../process-utils/src/index.ts
@@ -4686,10 +5188,10 @@ function sanitizeInheritedChildProcessEnv(args) {
4686
5188
  }
4687
5189
 
4688
5190
  // ../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([])
5191
+ import { z as z34 } from "zod";
5192
+ var acpNativeSkillRootsSchema = z34.object({
5193
+ user: z34.array(providerNativeRootInputSchema).default([]),
5194
+ project: z34.array(providerNativeRootInputSchema).default([])
4693
5195
  }).strict().superRefine((roots, context) => {
4694
5196
  const normalized = providerNativeRootsSchema.safeParse(
4695
5197
  normalizeProviderNativeRoots(roots)
@@ -4705,16 +5207,16 @@ var acpNativeSkillRootsSchema = z33.object({
4705
5207
  });
4706
5208
  }
4707
5209
  });
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())
5210
+ var acpLaunchSpecSchema = z34.object({
5211
+ displayName: z34.string().min(1),
5212
+ command: z34.string().min(1),
5213
+ args: z34.array(z34.string()),
5214
+ env: z34.record(z34.string().min(1), z34.string()),
5215
+ cwd: z34.string().min(1).optional(),
5216
+ modelCli: z34.object({
5217
+ listArgs: z34.array(z34.string()),
5218
+ selectFlag: z34.string().min(1).optional(),
5219
+ primaryModels: z34.array(z34.string())
4718
5220
  }).strict().transform(
4719
5221
  (modelCli) => modelCli.listArgs.length > 0 ? modelCli : void 0
4720
5222
  ).optional(),
@@ -4752,35 +5254,35 @@ function normalizeAcpLaunchSpec(spec) {
4752
5254
  }
4753
5255
 
4754
5256
  // src/claude-task-tools.ts
4755
- import { z as z34 } from "zod";
4756
- var claudeTaskToolNameSchema = z34.enum([
5257
+ import { z as z35 } from "zod";
5258
+ var claudeTaskToolNameSchema = z35.enum([
4757
5259
  "TaskCreate",
4758
5260
  "TaskGet",
4759
5261
  "TaskList",
4760
5262
  "TaskUpdate"
4761
5263
  ]);
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()
5264
+ var claudeTaskStatusSchema = z35.enum(["pending", "in_progress", "completed"]);
5265
+ var claudeTaskCreateOutputSchema = z35.object({
5266
+ task: z35.object({
5267
+ id: z35.string(),
5268
+ subject: z35.string()
4767
5269
  }).passthrough()
4768
5270
  }).passthrough();
4769
- var claudeTaskGetOutputSchema = z34.object({
4770
- task: z34.object({
4771
- id: z34.string(),
5271
+ var claudeTaskGetOutputSchema = z35.object({
5272
+ task: z35.object({
5273
+ id: z35.string(),
4772
5274
  status: claudeTaskStatusSchema,
4773
- subject: z34.string()
5275
+ subject: z35.string()
4774
5276
  }).passthrough().nullable()
4775
5277
  }).passthrough();
4776
- var claudeTaskUpdateOutputSchema = z34.object({
4777
- success: z34.boolean(),
4778
- taskId: z34.string()
5278
+ var claudeTaskUpdateOutputSchema = z35.object({
5279
+ success: z35.boolean(),
5280
+ taskId: z35.string()
4779
5281
  }).passthrough();
4780
- var claudeTaskListOutputSchema = z34.object({
4781
- tasks: z34.array(z34.unknown())
5282
+ var claudeTaskListOutputSchema = z35.object({
5283
+ tasks: z35.array(z35.unknown())
4782
5284
  }).passthrough();
4783
- var claudeTaskToolOutputSchema = z34.union([
5285
+ var claudeTaskToolOutputSchema = z35.union([
4784
5286
  claudeTaskCreateOutputSchema,
4785
5287
  claudeTaskGetOutputSchema,
4786
5288
  claudeTaskListOutputSchema,