@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.
@@ -1,3 +1,544 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ try {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ } catch (e) {
11
+ throw mod = 0, e;
12
+ }
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+
31
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js
32
+ var require_debug = __commonJS({
33
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js"(exports, module) {
34
+ "use strict";
35
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
36
+ };
37
+ module.exports = debug;
38
+ }
39
+ });
40
+
41
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
42
+ var require_constants = __commonJS({
43
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js"(exports, module) {
44
+ "use strict";
45
+ var SEMVER_SPEC_VERSION = "2.0.0";
46
+ var MAX_LENGTH = 256;
47
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
48
+ 9007199254740991;
49
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
50
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
51
+ var RELEASE_TYPES = [
52
+ "major",
53
+ "premajor",
54
+ "minor",
55
+ "preminor",
56
+ "patch",
57
+ "prepatch",
58
+ "prerelease"
59
+ ];
60
+ module.exports = {
61
+ MAX_LENGTH,
62
+ MAX_SAFE_COMPONENT_LENGTH,
63
+ MAX_SAFE_BUILD_LENGTH,
64
+ MAX_SAFE_INTEGER,
65
+ RELEASE_TYPES,
66
+ SEMVER_SPEC_VERSION,
67
+ FLAG_INCLUDE_PRERELEASE: 1,
68
+ FLAG_LOOSE: 2
69
+ };
70
+ }
71
+ });
72
+
73
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js
74
+ var require_re = __commonJS({
75
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js"(exports, module) {
76
+ "use strict";
77
+ var {
78
+ MAX_SAFE_COMPONENT_LENGTH,
79
+ MAX_SAFE_BUILD_LENGTH,
80
+ MAX_LENGTH
81
+ } = require_constants();
82
+ var debug = require_debug();
83
+ exports = module.exports = {};
84
+ var re = exports.re = [];
85
+ var safeRe = exports.safeRe = [];
86
+ var src = exports.src = [];
87
+ var safeSrc = exports.safeSrc = [];
88
+ var t = exports.t = {};
89
+ var R = 0;
90
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
91
+ var safeRegexReplacements = [
92
+ ["\\s", 1],
93
+ ["\\d", MAX_LENGTH],
94
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
95
+ ];
96
+ var makeSafeRegex = (value) => {
97
+ for (const [token, max] of safeRegexReplacements) {
98
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
99
+ }
100
+ return value;
101
+ };
102
+ var createToken = (name, value, isGlobal) => {
103
+ const safe = makeSafeRegex(value);
104
+ const index = R++;
105
+ debug(name, index, value);
106
+ t[name] = index;
107
+ src[index] = value;
108
+ safeSrc[index] = safe;
109
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
110
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
111
+ };
112
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
113
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
114
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
115
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
116
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
117
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
118
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
119
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
120
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
121
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
122
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
123
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
124
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
125
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
126
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
127
+ createToken("GTLT", "((?:<|>)?=?)");
128
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
129
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
130
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
131
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
132
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
133
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
134
+ createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
135
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
136
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
137
+ createToken("COERCERTL", src[t.COERCE], true);
138
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
139
+ createToken("LONETILDE", "(?:~>?)");
140
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
141
+ exports.tildeTrimReplace = "$1~";
142
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
143
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
144
+ createToken("LONECARET", "(?:\\^)");
145
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
146
+ exports.caretTrimReplace = "$1^";
147
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
148
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
149
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
150
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
151
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
152
+ exports.comparatorTrimReplace = "$1$2$3";
153
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
154
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
155
+ createToken("STAR", "(<|>)?=?\\s*\\*");
156
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
157
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
158
+ }
159
+ });
160
+
161
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js
162
+ var require_parse_options = __commonJS({
163
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js"(exports, module) {
164
+ "use strict";
165
+ var looseOption = Object.freeze({ loose: true });
166
+ var emptyOpts = Object.freeze({});
167
+ var parseOptions = (options) => {
168
+ if (!options) {
169
+ return emptyOpts;
170
+ }
171
+ if (typeof options !== "object") {
172
+ return looseOption;
173
+ }
174
+ return options;
175
+ };
176
+ module.exports = parseOptions;
177
+ }
178
+ });
179
+
180
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js
181
+ var require_identifiers = __commonJS({
182
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js"(exports, module) {
183
+ "use strict";
184
+ var numeric = /^[0-9]+$/;
185
+ var compareIdentifiers = (a, b) => {
186
+ if (typeof a === "number" && typeof b === "number") {
187
+ return a === b ? 0 : a < b ? -1 : 1;
188
+ }
189
+ const anum = numeric.test(a);
190
+ const bnum = numeric.test(b);
191
+ if (anum && bnum) {
192
+ a = +a;
193
+ b = +b;
194
+ }
195
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
196
+ };
197
+ var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
198
+ module.exports = {
199
+ compareIdentifiers,
200
+ rcompareIdentifiers
201
+ };
202
+ }
203
+ });
204
+
205
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js
206
+ var require_semver = __commonJS({
207
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js"(exports, module) {
208
+ "use strict";
209
+ var debug = require_debug();
210
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
211
+ var { safeRe: re, t } = require_re();
212
+ var parseOptions = require_parse_options();
213
+ var { compareIdentifiers } = require_identifiers();
214
+ var isPrereleaseIdentifier = (prerelease, identifier) => {
215
+ const identifiers = identifier.split(".");
216
+ if (identifiers.length > prerelease.length) {
217
+ return false;
218
+ }
219
+ for (let i = 0; i < identifiers.length; i++) {
220
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
221
+ return false;
222
+ }
223
+ }
224
+ return true;
225
+ };
226
+ var SemVer = class _SemVer {
227
+ constructor(version, options) {
228
+ options = parseOptions(options);
229
+ if (version instanceof _SemVer) {
230
+ if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
231
+ return version;
232
+ } else {
233
+ version = version.version;
234
+ }
235
+ } else if (typeof version !== "string") {
236
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
237
+ }
238
+ if (version.length > MAX_LENGTH) {
239
+ throw new TypeError(
240
+ `version is longer than ${MAX_LENGTH} characters`
241
+ );
242
+ }
243
+ debug("SemVer", version, options);
244
+ this.options = options;
245
+ this.loose = !!options.loose;
246
+ this.includePrerelease = !!options.includePrerelease;
247
+ const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
248
+ if (!m) {
249
+ throw new TypeError(`Invalid Version: ${version}`);
250
+ }
251
+ this.raw = version;
252
+ this.major = +m[1];
253
+ this.minor = +m[2];
254
+ this.patch = +m[3];
255
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
256
+ throw new TypeError("Invalid major version");
257
+ }
258
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
259
+ throw new TypeError("Invalid minor version");
260
+ }
261
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
262
+ throw new TypeError("Invalid patch version");
263
+ }
264
+ if (!m[4]) {
265
+ this.prerelease = [];
266
+ } else {
267
+ this.prerelease = m[4].split(".").map((id) => {
268
+ if (/^[0-9]+$/.test(id)) {
269
+ const num = +id;
270
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
271
+ return num;
272
+ }
273
+ }
274
+ return id;
275
+ });
276
+ }
277
+ this.build = m[5] ? m[5].split(".") : [];
278
+ this.format();
279
+ }
280
+ format() {
281
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
282
+ if (this.prerelease.length) {
283
+ this.version += `-${this.prerelease.join(".")}`;
284
+ }
285
+ return this.version;
286
+ }
287
+ toString() {
288
+ return this.version;
289
+ }
290
+ compare(other) {
291
+ debug("SemVer.compare", this.version, this.options, other);
292
+ if (!(other instanceof _SemVer)) {
293
+ if (typeof other === "string" && other === this.version) {
294
+ return 0;
295
+ }
296
+ other = new _SemVer(other, this.options);
297
+ }
298
+ if (other.version === this.version) {
299
+ return 0;
300
+ }
301
+ return this.compareMain(other) || this.comparePre(other);
302
+ }
303
+ compareMain(other) {
304
+ if (!(other instanceof _SemVer)) {
305
+ other = new _SemVer(other, this.options);
306
+ }
307
+ if (this.major < other.major) {
308
+ return -1;
309
+ }
310
+ if (this.major > other.major) {
311
+ return 1;
312
+ }
313
+ if (this.minor < other.minor) {
314
+ return -1;
315
+ }
316
+ if (this.minor > other.minor) {
317
+ return 1;
318
+ }
319
+ if (this.patch < other.patch) {
320
+ return -1;
321
+ }
322
+ if (this.patch > other.patch) {
323
+ return 1;
324
+ }
325
+ return 0;
326
+ }
327
+ comparePre(other) {
328
+ if (!(other instanceof _SemVer)) {
329
+ other = new _SemVer(other, this.options);
330
+ }
331
+ if (this.prerelease.length && !other.prerelease.length) {
332
+ return -1;
333
+ } else if (!this.prerelease.length && other.prerelease.length) {
334
+ return 1;
335
+ } else if (!this.prerelease.length && !other.prerelease.length) {
336
+ return 0;
337
+ }
338
+ let i = 0;
339
+ do {
340
+ const a = this.prerelease[i];
341
+ const b = other.prerelease[i];
342
+ debug("prerelease compare", i, a, b);
343
+ if (a === void 0 && b === void 0) {
344
+ return 0;
345
+ } else if (b === void 0) {
346
+ return 1;
347
+ } else if (a === void 0) {
348
+ return -1;
349
+ } else if (a === b) {
350
+ continue;
351
+ } else {
352
+ return compareIdentifiers(a, b);
353
+ }
354
+ } while (++i);
355
+ }
356
+ compareBuild(other) {
357
+ if (!(other instanceof _SemVer)) {
358
+ other = new _SemVer(other, this.options);
359
+ }
360
+ let i = 0;
361
+ do {
362
+ const a = this.build[i];
363
+ const b = other.build[i];
364
+ debug("build compare", i, a, b);
365
+ if (a === void 0 && b === void 0) {
366
+ return 0;
367
+ } else if (b === void 0) {
368
+ return 1;
369
+ } else if (a === void 0) {
370
+ return -1;
371
+ } else if (a === b) {
372
+ continue;
373
+ } else {
374
+ return compareIdentifiers(a, b);
375
+ }
376
+ } while (++i);
377
+ }
378
+ // preminor will bump the version up to the next minor release, and immediately
379
+ // down to pre-release. premajor and prepatch work the same way.
380
+ inc(release, identifier, identifierBase) {
381
+ if (release.startsWith("pre")) {
382
+ if (!identifier && identifierBase === false) {
383
+ throw new Error("invalid increment argument: identifier is empty");
384
+ }
385
+ if (identifier) {
386
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
387
+ if (!match || match[1] !== identifier) {
388
+ throw new Error(`invalid identifier: ${identifier}`);
389
+ }
390
+ }
391
+ }
392
+ switch (release) {
393
+ case "premajor":
394
+ this.prerelease.length = 0;
395
+ this.patch = 0;
396
+ this.minor = 0;
397
+ this.major++;
398
+ this.inc("pre", identifier, identifierBase);
399
+ break;
400
+ case "preminor":
401
+ this.prerelease.length = 0;
402
+ this.patch = 0;
403
+ this.minor++;
404
+ this.inc("pre", identifier, identifierBase);
405
+ break;
406
+ case "prepatch":
407
+ this.prerelease.length = 0;
408
+ this.inc("patch", identifier, identifierBase);
409
+ this.inc("pre", identifier, identifierBase);
410
+ break;
411
+ // If the input is a non-prerelease version, this acts the same as
412
+ // prepatch.
413
+ case "prerelease":
414
+ if (this.prerelease.length === 0) {
415
+ this.inc("patch", identifier, identifierBase);
416
+ }
417
+ this.inc("pre", identifier, identifierBase);
418
+ break;
419
+ case "release":
420
+ if (this.prerelease.length === 0) {
421
+ throw new Error(`version ${this.raw} is not a prerelease`);
422
+ }
423
+ this.prerelease.length = 0;
424
+ break;
425
+ case "major":
426
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
427
+ this.major++;
428
+ }
429
+ this.minor = 0;
430
+ this.patch = 0;
431
+ this.prerelease = [];
432
+ break;
433
+ case "minor":
434
+ if (this.patch !== 0 || this.prerelease.length === 0) {
435
+ this.minor++;
436
+ }
437
+ this.patch = 0;
438
+ this.prerelease = [];
439
+ break;
440
+ case "patch":
441
+ if (this.prerelease.length === 0) {
442
+ this.patch++;
443
+ }
444
+ this.prerelease = [];
445
+ break;
446
+ // This probably shouldn't be used publicly.
447
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
448
+ case "pre": {
449
+ const base = Number(identifierBase) ? 1 : 0;
450
+ if (this.prerelease.length === 0) {
451
+ this.prerelease = [base];
452
+ } else {
453
+ let i = this.prerelease.length;
454
+ while (--i >= 0) {
455
+ if (typeof this.prerelease[i] === "number") {
456
+ this.prerelease[i]++;
457
+ i = -2;
458
+ }
459
+ }
460
+ if (i === -1) {
461
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
462
+ throw new Error("invalid increment argument: identifier already exists");
463
+ }
464
+ this.prerelease.push(base);
465
+ }
466
+ }
467
+ if (identifier) {
468
+ let prerelease = [identifier, base];
469
+ if (identifierBase === false) {
470
+ prerelease = [identifier];
471
+ }
472
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
473
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
474
+ if (isNaN(prereleaseBase)) {
475
+ this.prerelease = prerelease;
476
+ }
477
+ } else {
478
+ this.prerelease = prerelease;
479
+ }
480
+ }
481
+ break;
482
+ }
483
+ default:
484
+ throw new Error(`invalid increment argument: ${release}`);
485
+ }
486
+ this.raw = this.format();
487
+ if (this.build.length) {
488
+ this.raw += `+${this.build.join(".")}`;
489
+ }
490
+ return this;
491
+ }
492
+ };
493
+ module.exports = SemVer;
494
+ }
495
+ });
496
+
497
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js
498
+ var require_compare = __commonJS({
499
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js"(exports, module) {
500
+ "use strict";
501
+ var SemVer = require_semver();
502
+ var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
503
+ module.exports = compare;
504
+ }
505
+ });
506
+
507
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js
508
+ var require_parse = __commonJS({
509
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports, module) {
510
+ "use strict";
511
+ var SemVer = require_semver();
512
+ var parse = (version, options, throwErrors = false) => {
513
+ if (version instanceof SemVer) {
514
+ return version;
515
+ }
516
+ try {
517
+ return new SemVer(version, options);
518
+ } catch (er) {
519
+ if (!throwErrors) {
520
+ return null;
521
+ }
522
+ throw er;
523
+ }
524
+ };
525
+ module.exports = parse;
526
+ }
527
+ });
528
+
529
+ // ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js
530
+ var require_valid = __commonJS({
531
+ "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports, module) {
532
+ "use strict";
533
+ var parse = require_parse();
534
+ var valid = (version, options) => {
535
+ const v = parse(version, options);
536
+ return v ? v.version : null;
537
+ };
538
+ module.exports = valid;
539
+ }
540
+ });
541
+
1
542
  // ../domain/src/context-snapshot.ts
2
543
  import { z } from "zod";
3
544
  var tokenCountSchema = z.number().int().nonnegative();
@@ -625,8 +1166,13 @@ var providerNativeRootSetSchema = z5.object({
625
1166
  resolved: providerResolvedNativeRootsSchema
626
1167
  }).strict();
627
1168
 
628
- // ../domain/src/background-task.ts
1169
+ // ../domain/src/completed-turn-display.ts
629
1170
  import { z as z6 } from "zod";
1171
+ var COMPLETED_TURN_DISPLAY_VALUES = ["collapse", "flat"];
1172
+ var completedTurnDisplaySchema = z6.enum(COMPLETED_TURN_DISPLAY_VALUES);
1173
+
1174
+ // ../domain/src/background-task.ts
1175
+ import { z as z7 } from "zod";
630
1176
  var backgroundTaskStatusValues = [
631
1177
  "pending",
632
1178
  "running",
@@ -636,7 +1182,7 @@ var backgroundTaskStatusValues = [
636
1182
  "killed",
637
1183
  "stopped"
638
1184
  ];
639
- var backgroundTaskStatusSchema = z6.enum(backgroundTaskStatusValues);
1185
+ var backgroundTaskStatusSchema = z7.enum(backgroundTaskStatusValues);
640
1186
  var workflowAgentStateValues = [
641
1187
  "queued",
642
1188
  "running",
@@ -644,53 +1190,53 @@ var workflowAgentStateValues = [
644
1190
  "failed",
645
1191
  "skipped"
646
1192
  ];
647
- var workflowAgentStateSchema = z6.enum(workflowAgentStateValues);
648
- var workflowAgentSnapshotSchema = z6.object({
649
- index: z6.number().int().positive(),
650
- label: z6.string(),
1193
+ var workflowAgentStateSchema = z7.enum(workflowAgentStateValues);
1194
+ var workflowAgentSnapshotSchema = z7.object({
1195
+ index: z7.number().int().positive(),
1196
+ label: z7.string(),
651
1197
  state: workflowAgentStateSchema,
652
- model: z6.string(),
653
- attempt: z6.number().int().positive(),
654
- cached: z6.boolean(),
655
- lastProgressAt: z6.number(),
656
- phaseIndex: z6.number().int().positive().optional(),
657
- phaseTitle: z6.string().optional(),
658
- agentType: z6.string().optional(),
659
- isolation: z6.string().optional(),
660
- queuedAt: z6.number().optional(),
661
- startedAt: z6.number().optional(),
662
- lastToolName: z6.string().optional(),
663
- lastToolSummary: z6.string().optional(),
664
- promptPreview: z6.string().optional(),
665
- resultPreview: z6.string().optional(),
666
- error: z6.string().optional(),
667
- tokens: z6.number().optional(),
668
- toolCalls: z6.number().optional(),
669
- durationMs: z6.number().optional()
670
- });
671
- var workflowPhaseSnapshotSchema = z6.object({
672
- index: z6.number().int().positive(),
673
- title: z6.string(),
674
- kind: z6.string().optional()
675
- });
676
- var workflowProgressSnapshotSchema = z6.object({
677
- phases: z6.array(workflowPhaseSnapshotSchema),
678
- agents: z6.array(workflowAgentSnapshotSchema)
679
- });
680
- var backgroundTaskUsageSchema = z6.object({
681
- totalTokens: z6.number(),
682
- toolUses: z6.number(),
683
- durationMs: z6.number()
1198
+ model: z7.string(),
1199
+ attempt: z7.number().int().positive(),
1200
+ cached: z7.boolean(),
1201
+ lastProgressAt: z7.number(),
1202
+ phaseIndex: z7.number().int().positive().optional(),
1203
+ phaseTitle: z7.string().optional(),
1204
+ agentType: z7.string().optional(),
1205
+ isolation: z7.string().optional(),
1206
+ queuedAt: z7.number().optional(),
1207
+ startedAt: z7.number().optional(),
1208
+ lastToolName: z7.string().optional(),
1209
+ lastToolSummary: z7.string().optional(),
1210
+ promptPreview: z7.string().optional(),
1211
+ resultPreview: z7.string().optional(),
1212
+ error: z7.string().optional(),
1213
+ tokens: z7.number().optional(),
1214
+ toolCalls: z7.number().optional(),
1215
+ durationMs: z7.number().optional()
1216
+ });
1217
+ var workflowPhaseSnapshotSchema = z7.object({
1218
+ index: z7.number().int().positive(),
1219
+ title: z7.string(),
1220
+ kind: z7.string().optional()
1221
+ });
1222
+ var workflowProgressSnapshotSchema = z7.object({
1223
+ phases: z7.array(workflowPhaseSnapshotSchema),
1224
+ agents: z7.array(workflowAgentSnapshotSchema)
1225
+ });
1226
+ var backgroundTaskUsageSchema = z7.object({
1227
+ totalTokens: z7.number(),
1228
+ toolUses: z7.number(),
1229
+ durationMs: z7.number()
684
1230
  });
685
1231
 
686
1232
  // ../domain/src/provider-event.ts
687
- import { z as z15 } from "zod";
1233
+ import { z as z16 } from "zod";
688
1234
 
689
1235
  // ../domain/src/thread-events.ts
690
- import { z as z12 } from "zod";
1236
+ import { z as z13 } from "zod";
691
1237
 
692
1238
  // ../domain/src/pending-interactions.ts
693
- import { z as z9 } from "zod";
1239
+ import { z as z10 } from "zod";
694
1240
 
695
1241
  // ../domain/src/plugin-interaction-limits.ts
696
1242
  var PLUGIN_INTERACTION_MAX_TITLE_LENGTH = 160;
@@ -700,223 +1246,223 @@ function jsonByteLength(value) {
700
1246
  }
701
1247
 
702
1248
  // ../domain/src/item-presentation.ts
703
- import { z as z7 } from "zod";
1249
+ import { z as z8 } from "zod";
704
1250
  var THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH = 280;
705
- var threadEventItemPresentationLabelSchema = z7.object({
706
- pending: z7.string().min(1),
707
- completed: z7.string().min(1)
1251
+ var threadEventItemPresentationLabelSchema = z8.object({
1252
+ pending: z8.string().min(1),
1253
+ completed: z8.string().min(1)
708
1254
  });
709
- var threadEventItemPresentationIconSchema = z7.object({
710
- glyph: z7.string().min(1)
1255
+ var threadEventItemPresentationIconSchema = z8.object({
1256
+ glyph: z8.string().min(1)
711
1257
  });
712
- var threadEventItemPresentationTintSchema = z7.object({
713
- light: z7.string().min(1),
714
- dark: z7.string().min(1)
1258
+ var threadEventItemPresentationTintSchema = z8.object({
1259
+ light: z8.string().min(1),
1260
+ dark: z8.string().min(1)
715
1261
  });
716
1262
  var THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH = 80;
717
- var threadEventItemPresentationBadgeSchema = z7.object({
718
- glyph: z7.string().min(1),
719
- label: z7.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
720
- hint: z7.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
721
- tone: z7.enum(["neutral", "destructive"])
1263
+ var threadEventItemPresentationBadgeSchema = z8.object({
1264
+ glyph: z8.string().min(1),
1265
+ label: z8.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
1266
+ hint: z8.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
1267
+ tone: z8.enum(["neutral", "destructive"])
722
1268
  });
723
- var threadEventItemPresentationSchema = z7.object({
1269
+ var threadEventItemPresentationSchema = z8.object({
724
1270
  label: threadEventItemPresentationLabelSchema,
725
1271
  icon: threadEventItemPresentationIconSchema,
726
- title: z7.string().optional(),
727
- detail: z7.string().max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
728
- suppress: z7.boolean().optional(),
1272
+ title: z8.string().optional(),
1273
+ detail: z8.string().max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
1274
+ suppress: z8.boolean().optional(),
729
1275
  tint: threadEventItemPresentationTintSchema.optional(),
730
1276
  badge: threadEventItemPresentationBadgeSchema.optional()
731
1277
  });
732
1278
 
733
1279
  // ../domain/src/provider-extension-kind.ts
734
- import { z as z8 } from "zod";
1280
+ import { z as z9 } from "zod";
735
1281
  var EXTENSION_KIND_PATTERN = /^[a-z0-9-]+\/[a-z0-9-]+$/u;
736
1282
  function isExtensionKind(value) {
737
1283
  return EXTENSION_KIND_PATTERN.test(value);
738
1284
  }
739
- var extensionKindSchema = z8.string().refine(isExtensionKind, {
1285
+ var extensionKindSchema = z9.string().refine(isExtensionKind, {
740
1286
  message: 'extension kinds are "<pluginId>/<name>" (lowercase letters, digits, and "-")'
741
1287
  });
742
1288
 
743
1289
  // ../domain/src/pending-interactions.ts
744
- var pendingInteractionStatusSchema = z9.enum([
1290
+ var pendingInteractionStatusSchema = z10.enum([
745
1291
  "pending",
746
1292
  "resolving",
747
1293
  "resolved",
748
1294
  "interrupted"
749
1295
  ]);
750
- var pendingInteractionCommandActionSchema = z9.discriminatedUnion(
1296
+ var pendingInteractionCommandActionSchema = z10.discriminatedUnion(
751
1297
  "type",
752
1298
  [
753
- z9.object({
754
- type: z9.literal("read"),
755
- command: z9.string(),
756
- name: z9.string(),
757
- path: z9.string()
1299
+ z10.object({
1300
+ type: z10.literal("read"),
1301
+ command: z10.string(),
1302
+ name: z10.string(),
1303
+ path: z10.string()
758
1304
  }),
759
- z9.object({
760
- type: z9.literal("listFiles"),
761
- command: z9.string(),
762
- path: z9.string().nullable()
1305
+ z10.object({
1306
+ type: z10.literal("listFiles"),
1307
+ command: z10.string(),
1308
+ path: z10.string().nullable()
763
1309
  }),
764
- z9.object({
765
- type: z9.literal("search"),
766
- command: z9.string(),
767
- query: z9.string().nullable(),
768
- path: z9.string().nullable()
1310
+ z10.object({
1311
+ type: z10.literal("search"),
1312
+ command: z10.string(),
1313
+ query: z10.string().nullable(),
1314
+ path: z10.string().nullable()
769
1315
  }),
770
- z9.object({
771
- type: z9.literal("unknown"),
772
- command: z9.string()
1316
+ z10.object({
1317
+ type: z10.literal("unknown"),
1318
+ command: z10.string()
773
1319
  })
774
1320
  ]
775
1321
  );
776
- var pendingInteractionNetworkPermissionsSchema = z9.object({
777
- enabled: z9.boolean().nullable()
1322
+ var pendingInteractionNetworkPermissionsSchema = z10.object({
1323
+ enabled: z10.boolean().nullable()
778
1324
  });
779
- var pendingInteractionFileSystemPermissionsSchema = z9.object({
780
- read: z9.array(z9.string()),
781
- write: z9.array(z9.string())
1325
+ var pendingInteractionFileSystemPermissionsSchema = z10.object({
1326
+ read: z10.array(z10.string()),
1327
+ write: z10.array(z10.string())
782
1328
  });
783
- var pendingInteractionMacOsPreferencesPermissionSchema = z9.enum([
1329
+ var pendingInteractionMacOsPreferencesPermissionSchema = z10.enum([
784
1330
  "none",
785
1331
  "read_only",
786
1332
  "read_write"
787
1333
  ]);
788
- var pendingInteractionMacOsContactsPermissionSchema = z9.enum([
1334
+ var pendingInteractionMacOsContactsPermissionSchema = z10.enum([
789
1335
  "none",
790
1336
  "read_only",
791
1337
  "read_write"
792
1338
  ]);
793
- var pendingInteractionMacOsAutomationPermissionSchema = z9.union([
794
- z9.literal("none"),
795
- z9.literal("all"),
796
- z9.object({
797
- kind: z9.literal("bundle_ids"),
798
- bundleIds: z9.array(z9.string())
1339
+ var pendingInteractionMacOsAutomationPermissionSchema = z10.union([
1340
+ z10.literal("none"),
1341
+ z10.literal("all"),
1342
+ z10.object({
1343
+ kind: z10.literal("bundle_ids"),
1344
+ bundleIds: z10.array(z10.string())
799
1345
  })
800
1346
  ]);
801
- var pendingInteractionMacOsPermissionsSchema = z9.object({
1347
+ var pendingInteractionMacOsPermissionsSchema = z10.object({
802
1348
  preferences: pendingInteractionMacOsPreferencesPermissionSchema,
803
1349
  automations: pendingInteractionMacOsAutomationPermissionSchema,
804
- launchServices: z9.boolean(),
805
- accessibility: z9.boolean(),
806
- calendar: z9.boolean(),
807
- reminders: z9.boolean(),
1350
+ launchServices: z10.boolean(),
1351
+ accessibility: z10.boolean(),
1352
+ calendar: z10.boolean(),
1353
+ reminders: z10.boolean(),
808
1354
  contacts: pendingInteractionMacOsContactsPermissionSchema
809
1355
  });
810
- var pendingInteractionRequestedPermissionProfileSchema = z9.object({
1356
+ var pendingInteractionRequestedPermissionProfileSchema = z10.object({
811
1357
  network: pendingInteractionNetworkPermissionsSchema.nullable(),
812
1358
  fileSystem: pendingInteractionFileSystemPermissionsSchema.nullable(),
813
1359
  macos: pendingInteractionMacOsPermissionsSchema.nullable()
814
1360
  });
815
- var pendingInteractionGrantablePermissionProfileSchema = z9.object({
1361
+ var pendingInteractionGrantablePermissionProfileSchema = z10.object({
816
1362
  network: pendingInteractionNetworkPermissionsSchema.nullable(),
817
1363
  fileSystem: pendingInteractionFileSystemPermissionsSchema.nullable()
818
1364
  }).strict();
819
1365
  var pendingInteractionGrantedPermissionProfileSchema = pendingInteractionGrantablePermissionProfileSchema;
820
- var pendingInteractionApprovalDecisionSchema = z9.enum([
1366
+ var pendingInteractionApprovalDecisionSchema = z10.enum([
821
1367
  "allow_once",
822
1368
  "allow_for_session",
823
1369
  "deny"
824
1370
  ]);
825
- var pendingInteractionFileChangeWriteScopeSchema = z9.string().min(1);
826
- var pendingInteractionCommandApprovalSubjectSchema = z9.object({
827
- kind: z9.literal("command"),
828
- itemId: z9.string().min(1),
829
- command: z9.string().min(1),
830
- cwd: z9.string().nullable(),
831
- actions: z9.array(pendingInteractionCommandActionSchema),
1371
+ var pendingInteractionFileChangeWriteScopeSchema = z10.string().min(1);
1372
+ var pendingInteractionCommandApprovalSubjectSchema = z10.object({
1373
+ kind: z10.literal("command"),
1374
+ itemId: z10.string().min(1),
1375
+ command: z10.string().min(1),
1376
+ cwd: z10.string().nullable(),
1377
+ actions: z10.array(pendingInteractionCommandActionSchema),
832
1378
  sessionGrant: pendingInteractionGrantablePermissionProfileSchema.nullable()
833
1379
  });
834
- var pendingInteractionFileChangeApprovalSubjectSchema = z9.object({
835
- kind: z9.literal("file_change"),
836
- itemId: z9.string().min(1),
1380
+ var pendingInteractionFileChangeApprovalSubjectSchema = z10.object({
1381
+ kind: z10.literal("file_change"),
1382
+ itemId: z10.string().min(1),
837
1383
  writeScope: pendingInteractionFileChangeWriteScopeSchema.nullable(),
838
1384
  sessionGrant: pendingInteractionGrantablePermissionProfileSchema.nullable()
839
1385
  });
840
- var pendingInteractionPermissionGrantApprovalSubjectSchema = z9.object({
841
- kind: z9.literal("permission_grant"),
842
- itemId: z9.string().min(1),
843
- toolName: z9.string().nullable(),
1386
+ var pendingInteractionPermissionGrantApprovalSubjectSchema = z10.object({
1387
+ kind: z10.literal("permission_grant"),
1388
+ itemId: z10.string().min(1),
1389
+ toolName: z10.string().nullable(),
844
1390
  permissions: pendingInteractionGrantablePermissionProfileSchema
845
1391
  });
846
- var pendingInteractionPlanApprovalSubjectSchema = z9.object({
847
- kind: z9.literal("plan"),
848
- itemId: z9.string().min(1),
849
- plan: z9.string().min(1),
850
- planFilePath: z9.string().min(1).nullable()
1392
+ var pendingInteractionPlanApprovalSubjectSchema = z10.object({
1393
+ kind: z10.literal("plan"),
1394
+ itemId: z10.string().min(1),
1395
+ plan: z10.string().min(1),
1396
+ planFilePath: z10.string().min(1).nullable()
851
1397
  });
852
- var pendingInteractionToolUseApprovalSubjectSchema = z9.object({
853
- kind: z9.literal("tool_use"),
854
- itemId: z9.string().min(1),
855
- tool: z9.string().min(1),
1398
+ var pendingInteractionToolUseApprovalSubjectSchema = z10.object({
1399
+ kind: z10.literal("tool_use"),
1400
+ itemId: z10.string().min(1),
1401
+ tool: z10.string().min(1),
856
1402
  presentation: threadEventItemPresentationSchema
857
1403
  });
858
- var pendingInteractionApprovalSubjectSchema = z9.discriminatedUnion("kind", [
1404
+ var pendingInteractionApprovalSubjectSchema = z10.discriminatedUnion("kind", [
859
1405
  pendingInteractionCommandApprovalSubjectSchema,
860
1406
  pendingInteractionFileChangeApprovalSubjectSchema,
861
1407
  pendingInteractionPermissionGrantApprovalSubjectSchema,
862
1408
  pendingInteractionPlanApprovalSubjectSchema,
863
1409
  pendingInteractionToolUseApprovalSubjectSchema
864
1410
  ]);
865
- var approvalPendingInteractionPayloadSchema = z9.object({
866
- kind: z9.literal("approval"),
1411
+ var approvalPendingInteractionPayloadSchema = z10.object({
1412
+ kind: z10.literal("approval"),
867
1413
  subject: pendingInteractionApprovalSubjectSchema,
868
- reason: z9.string().nullable(),
869
- availableDecisions: z9.array(pendingInteractionApprovalDecisionSchema).min(1)
1414
+ reason: z10.string().nullable(),
1415
+ availableDecisions: z10.array(pendingInteractionApprovalDecisionSchema).min(1)
870
1416
  });
871
1417
  var USER_QUESTION_MAX_QUESTIONS = 4;
872
1418
  var USER_QUESTION_MAX_OPTIONS = 4;
873
1419
  var USER_QUESTION_MAX_SELECTED = 4;
874
1420
  var USER_QUESTION_MAX_FREE_TEXT_LENGTH = 4096;
875
- var pendingInteractionUserQuestionIdSchema = z9.string().min(1).refine((value) => value.trim().length > 0, {
1421
+ var pendingInteractionUserQuestionIdSchema = z10.string().min(1).refine((value) => value.trim().length > 0, {
876
1422
  message: "User question ids cannot be blank"
877
1423
  });
878
- var pendingInteractionUserQuestionPromptSchema = z9.string().min(1).refine((value) => value.trim().length > 0, {
1424
+ var pendingInteractionUserQuestionPromptSchema = z10.string().min(1).refine((value) => value.trim().length > 0, {
879
1425
  message: "User question prompts cannot be blank"
880
1426
  });
881
- var pendingInteractionUserQuestionShortLabelSchema = z9.string().min(1).refine((value) => value.trim().length > 0, {
1427
+ var pendingInteractionUserQuestionShortLabelSchema = z10.string().min(1).refine((value) => value.trim().length > 0, {
882
1428
  message: "User question short labels cannot be blank"
883
1429
  });
884
- var pendingInteractionUserQuestionOptionValueSchema = z9.string().min(1).refine((value) => value.trim().length > 0, {
1430
+ var pendingInteractionUserQuestionOptionValueSchema = z10.string().min(1).refine((value) => value.trim().length > 0, {
885
1431
  message: "User question option values cannot be blank"
886
1432
  });
887
- var pendingInteractionUserQuestionOptionLabelSchema = z9.string().min(1).refine((value) => value.trim().length > 0, {
1433
+ var pendingInteractionUserQuestionOptionLabelSchema = z10.string().min(1).refine((value) => value.trim().length > 0, {
888
1434
  message: "User question option labels cannot be blank"
889
1435
  });
890
- var pendingInteractionUserQuestionOptionDescriptionSchema = z9.string().min(1).refine((value) => value.trim().length > 0, {
1436
+ var pendingInteractionUserQuestionOptionDescriptionSchema = z10.string().min(1).refine((value) => value.trim().length > 0, {
891
1437
  message: "User question option descriptions cannot be blank"
892
1438
  });
893
- var pendingInteractionUserQuestionFreeTextSchema = z9.string().min(1).max(
1439
+ var pendingInteractionUserQuestionFreeTextSchema = z10.string().min(1).max(
894
1440
  USER_QUESTION_MAX_FREE_TEXT_LENGTH,
895
1441
  `User question free text cannot exceed ${USER_QUESTION_MAX_FREE_TEXT_LENGTH} characters`
896
1442
  ).refine((value) => value.trim().length > 0, {
897
1443
  message: "User question free text cannot be blank"
898
1444
  });
899
- var pendingInteractionUserQuestionOptionSchema = z9.object({
1445
+ var pendingInteractionUserQuestionOptionSchema = z10.object({
900
1446
  value: pendingInteractionUserQuestionOptionValueSchema,
901
1447
  label: pendingInteractionUserQuestionOptionLabelSchema,
902
1448
  description: pendingInteractionUserQuestionOptionDescriptionSchema.optional()
903
1449
  });
904
- var pendingInteractionUserQuestionQuestionSchema = z9.object({
1450
+ var pendingInteractionUserQuestionQuestionSchema = z10.object({
905
1451
  id: pendingInteractionUserQuestionIdSchema,
906
1452
  prompt: pendingInteractionUserQuestionPromptSchema,
907
1453
  shortLabel: pendingInteractionUserQuestionShortLabelSchema.optional(),
908
- multiSelect: z9.boolean(),
909
- options: z9.array(pendingInteractionUserQuestionOptionSchema).max(
1454
+ multiSelect: z10.boolean(),
1455
+ options: z10.array(pendingInteractionUserQuestionOptionSchema).max(
910
1456
  USER_QUESTION_MAX_OPTIONS,
911
1457
  `User questions cannot include more than ${USER_QUESTION_MAX_OPTIONS} options`
912
1458
  ).optional(),
913
- allowFreeText: z9.boolean()
1459
+ allowFreeText: z10.boolean()
914
1460
  }).superRefine((question, context) => {
915
1461
  const optionValues = /* @__PURE__ */ new Set();
916
1462
  question.options?.forEach((option, index) => {
917
1463
  if (optionValues.has(option.value)) {
918
1464
  context.addIssue({
919
- code: z9.ZodIssueCode.custom,
1465
+ code: z10.ZodIssueCode.custom,
920
1466
  message: "User question option values must be unique",
921
1467
  path: ["options", index, "value"]
922
1468
  });
@@ -931,9 +1477,9 @@ var pendingInteractionUserQuestionQuestionSchema = z9.object({
931
1477
  path: ["options"]
932
1478
  }
933
1479
  );
934
- var userQuestionPendingInteractionPayloadSchema = z9.object({
935
- kind: z9.literal("user_question"),
936
- questions: z9.array(pendingInteractionUserQuestionQuestionSchema).min(1).max(
1480
+ var userQuestionPendingInteractionPayloadSchema = z10.object({
1481
+ kind: z10.literal("user_question"),
1482
+ questions: z10.array(pendingInteractionUserQuestionQuestionSchema).min(1).max(
937
1483
  USER_QUESTION_MAX_QUESTIONS,
938
1484
  `User questions cannot include more than ${USER_QUESTION_MAX_QUESTIONS} questions`
939
1485
  )
@@ -942,7 +1488,7 @@ var userQuestionPendingInteractionPayloadSchema = z9.object({
942
1488
  payload.questions.forEach((question, index) => {
943
1489
  if (questionIds.has(question.id)) {
944
1490
  context.addIssue({
945
- code: z9.ZodIssueCode.custom,
1491
+ code: z10.ZodIssueCode.custom,
946
1492
  message: "User question ids must be unique",
947
1493
  path: ["questions", index, "id"]
948
1494
  });
@@ -951,24 +1497,24 @@ var userQuestionPendingInteractionPayloadSchema = z9.object({
951
1497
  questionIds.add(question.id);
952
1498
  });
953
1499
  });
954
- var pluginPendingInteractionPayloadSchema = z9.object({
955
- kind: z9.literal("plugin"),
956
- title: z9.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
1500
+ var pluginPendingInteractionPayloadSchema = z10.object({
1501
+ kind: z10.literal("plugin"),
1502
+ title: z10.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
957
1503
  data: jsonValueSchema
958
1504
  });
959
- var pluginExtensionInteractionRequestPayloadSchema = z9.object({
1505
+ var pluginExtensionInteractionRequestPayloadSchema = z10.object({
960
1506
  kind: extensionKindSchema,
961
- title: z9.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
1507
+ title: z10.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
962
1508
  data: jsonValueSchema.refine(
963
1509
  (value) => jsonByteLength(value) <= PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES,
964
1510
  { message: "Plugin request data exceeds 64 KiB" }
965
1511
  )
966
1512
  });
967
- var interactionRequestPayloadSchema = z9.union([
1513
+ var interactionRequestPayloadSchema = z10.union([
968
1514
  userQuestionPendingInteractionPayloadSchema,
969
1515
  pluginExtensionInteractionRequestPayloadSchema
970
1516
  ]);
971
- var pendingInteractionPayloadSchema = z9.union([
1517
+ var pendingInteractionPayloadSchema = z10.union([
972
1518
  approvalPendingInteractionPayloadSchema,
973
1519
  userQuestionPendingInteractionPayloadSchema,
974
1520
  pluginExtensionInteractionRequestPayloadSchema
@@ -977,42 +1523,42 @@ function isApprovalPendingInteractionPayload(payload) {
977
1523
  return payload.kind === "approval";
978
1524
  }
979
1525
  var approvalDecisionDiscriminatorError = "Invalid discriminator value. Expected 'allow_once' | 'allow_for_session' | 'deny'";
980
- var approvalPendingInteractionResolutionSchema = z9.discriminatedUnion(
1526
+ var approvalPendingInteractionResolutionSchema = z10.discriminatedUnion(
981
1527
  "decision",
982
1528
  [
983
- z9.object({
984
- decision: z9.literal("allow_once"),
1529
+ z10.object({
1530
+ decision: z10.literal("allow_once"),
985
1531
  grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
986
1532
  }),
987
- z9.object({
988
- decision: z9.literal("allow_for_session"),
1533
+ z10.object({
1534
+ decision: z10.literal("allow_for_session"),
989
1535
  grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
990
1536
  }),
991
- z9.object({
992
- decision: z9.literal("deny")
1537
+ z10.object({
1538
+ decision: z10.literal("deny")
993
1539
  })
994
1540
  ],
995
1541
  approvalDecisionDiscriminatorError
996
1542
  );
997
- var pendingInteractionUserAnswerSchema = z9.object({
998
- selected: z9.array(z9.string().min(1)).max(
1543
+ var pendingInteractionUserAnswerSchema = z10.object({
1544
+ selected: z10.array(z10.string().min(1)).max(
999
1545
  USER_QUESTION_MAX_SELECTED,
1000
1546
  `User question selected choices cannot exceed ${USER_QUESTION_MAX_SELECTED}`
1001
1547
  ),
1002
1548
  freeText: pendingInteractionUserQuestionFreeTextSchema.optional()
1003
1549
  });
1004
- var userQuestionPendingInteractionResolutionSchema = z9.object({
1005
- kind: z9.literal("user_answer"),
1006
- answers: z9.record(z9.string().min(1), pendingInteractionUserAnswerSchema)
1550
+ var userQuestionPendingInteractionResolutionSchema = z10.object({
1551
+ kind: z10.literal("user_answer"),
1552
+ answers: z10.record(z10.string().min(1), pendingInteractionUserAnswerSchema)
1007
1553
  });
1008
- var pluginPendingInteractionResolutionSchema = z9.object({
1009
- kind: z9.literal("plugin_submitted")
1554
+ var pluginPendingInteractionResolutionSchema = z10.object({
1555
+ kind: z10.literal("plugin_submitted")
1010
1556
  });
1011
- var pluginExtensionInteractionResolutionSchema = z9.object({
1012
- kind: z9.literal("request_answer"),
1557
+ var pluginExtensionInteractionResolutionSchema = z10.object({
1558
+ kind: z10.literal("request_answer"),
1013
1559
  value: jsonValueSchema
1014
1560
  });
1015
- var pendingInteractionResolutionSchema = z9.union(
1561
+ var pendingInteractionResolutionSchema = z10.union(
1016
1562
  [
1017
1563
  approvalPendingInteractionResolutionSchema,
1018
1564
  userQuestionPendingInteractionResolutionSchema,
@@ -1024,56 +1570,56 @@ var pendingInteractionResolutionSchema = z9.union(
1024
1570
  function isApprovalPendingInteractionResolution(resolution) {
1025
1571
  return "decision" in resolution;
1026
1572
  }
1027
- var approvalInteractionOutcomeSchema = z9.object({
1573
+ var approvalInteractionOutcomeSchema = z10.object({
1028
1574
  payload: approvalPendingInteractionPayloadSchema,
1029
1575
  resolution: approvalPendingInteractionResolutionSchema
1030
1576
  });
1031
- var userQuestionInteractionOutcomeSchema = z9.object({
1577
+ var userQuestionInteractionOutcomeSchema = z10.object({
1032
1578
  payload: userQuestionPendingInteractionPayloadSchema,
1033
1579
  resolution: userQuestionPendingInteractionResolutionSchema
1034
1580
  });
1035
- var pluginExtensionInteractionOutcomeSchema = z9.object({
1581
+ var pluginExtensionInteractionOutcomeSchema = z10.object({
1036
1582
  payload: pluginExtensionInteractionRequestPayloadSchema,
1037
1583
  resolution: pluginExtensionInteractionResolutionSchema
1038
1584
  });
1039
- var providerInteractionOutcomeSchema = z9.union([
1585
+ var providerInteractionOutcomeSchema = z10.union([
1040
1586
  approvalInteractionOutcomeSchema,
1041
1587
  userQuestionInteractionOutcomeSchema,
1042
1588
  pluginExtensionInteractionOutcomeSchema
1043
1589
  ]);
1044
- var pendingInteractionProviderOriginSchema = z9.object({
1045
- kind: z9.literal("provider"),
1046
- providerId: z9.string().min(1),
1047
- providerThreadId: z9.string().min(1),
1048
- providerRequestId: z9.string().min(1)
1049
- });
1050
- var pendingInteractionPluginOriginSchema = z9.object({
1051
- kind: z9.literal("plugin"),
1052
- pluginId: z9.string().min(1),
1053
- rendererId: z9.string().min(1)
1054
- });
1055
- var pendingInteractionCreateSchema = z9.object({
1056
- threadId: z9.string().min(1),
1057
- turnId: z9.string().min(1),
1058
- providerId: z9.string().min(1),
1059
- providerThreadId: z9.string().min(1),
1060
- providerRequestId: z9.string().min(1),
1590
+ var pendingInteractionProviderOriginSchema = z10.object({
1591
+ kind: z10.literal("provider"),
1592
+ providerId: z10.string().min(1),
1593
+ providerThreadId: z10.string().min(1),
1594
+ providerRequestId: z10.string().min(1)
1595
+ });
1596
+ var pendingInteractionPluginOriginSchema = z10.object({
1597
+ kind: z10.literal("plugin"),
1598
+ pluginId: z10.string().min(1),
1599
+ rendererId: z10.string().min(1)
1600
+ });
1601
+ var pendingInteractionCreateSchema = z10.object({
1602
+ threadId: z10.string().min(1),
1603
+ turnId: z10.string().min(1),
1604
+ providerId: z10.string().min(1),
1605
+ providerThreadId: z10.string().min(1),
1606
+ providerRequestId: z10.string().min(1),
1061
1607
  payload: pendingInteractionPayloadSchema
1062
1608
  });
1063
- var pendingInteractionBaseSchema = z9.object({
1064
- id: z9.string().min(1),
1065
- threadId: z9.string().min(1),
1609
+ var pendingInteractionBaseSchema = z10.object({
1610
+ id: z10.string().min(1),
1611
+ threadId: z10.string().min(1),
1066
1612
  status: pendingInteractionStatusSchema,
1067
- statusReason: z9.string().nullable(),
1068
- createdAt: z9.number().int().nonnegative(),
1069
- expiresAt: z9.number().int().nonnegative().nullable().optional(),
1070
- resolvedAt: z9.number().int().nonnegative().nullable()
1613
+ statusReason: z10.string().nullable(),
1614
+ createdAt: z10.number().int().nonnegative(),
1615
+ expiresAt: z10.number().int().nonnegative().nullable().optional(),
1616
+ resolvedAt: z10.number().int().nonnegative().nullable()
1071
1617
  });
1072
1618
  var providerPendingInteractionBaseSchema = pendingInteractionBaseSchema.extend({
1073
- turnId: z9.string().min(1),
1074
- providerId: z9.string().min(1),
1075
- providerThreadId: z9.string().min(1),
1076
- providerRequestId: z9.string().min(1),
1619
+ turnId: z10.string().min(1),
1620
+ providerId: z10.string().min(1),
1621
+ providerThreadId: z10.string().min(1),
1622
+ providerRequestId: z10.string().min(1),
1077
1623
  origin: pendingInteractionProviderOriginSchema.optional()
1078
1624
  });
1079
1625
  var approvalPendingInteractionSchema = providerPendingInteractionBaseSchema.extend({
@@ -1088,30 +1634,30 @@ var pluginExtensionPendingInteractionSchema = providerPendingInteractionBaseSche
1088
1634
  payload: pluginExtensionInteractionRequestPayloadSchema,
1089
1635
  resolution: pluginExtensionInteractionResolutionSchema.nullable()
1090
1636
  });
1091
- var providerPendingInteractionSchema = z9.union([
1637
+ var providerPendingInteractionSchema = z10.union([
1092
1638
  approvalPendingInteractionSchema,
1093
1639
  userQuestionPendingInteractionSchema,
1094
1640
  pluginExtensionPendingInteractionSchema
1095
1641
  ]);
1096
1642
  var pluginPendingInteractionSchema = pendingInteractionBaseSchema.extend({
1097
- turnId: z9.string().min(1).nullable(),
1643
+ turnId: z10.string().min(1).nullable(),
1098
1644
  origin: pendingInteractionPluginOriginSchema,
1099
1645
  payload: pluginPendingInteractionPayloadSchema,
1100
1646
  resolution: pluginPendingInteractionResolutionSchema.nullable()
1101
1647
  });
1102
- var pendingInteractionSchema = z9.union([
1648
+ var pendingInteractionSchema = z10.union([
1103
1649
  providerPendingInteractionSchema,
1104
1650
  pluginPendingInteractionSchema
1105
1651
  ]);
1106
- var interactionLifecycleRecordBaseSchema = z9.object({
1107
- id: z9.string().min(1),
1652
+ var interactionLifecycleRecordBaseSchema = z10.object({
1653
+ id: z10.string().min(1),
1108
1654
  status: pendingInteractionStatusSchema,
1109
- statusReason: z9.string().nullable()
1655
+ statusReason: z10.string().nullable()
1110
1656
  });
1111
- var interactionLifecycleProviderOriginSchema = z9.object({
1112
- kind: z9.literal("provider"),
1113
- providerId: z9.string().min(1),
1114
- providerRequestId: z9.string().min(1)
1657
+ var interactionLifecycleProviderOriginSchema = z10.object({
1658
+ kind: z10.literal("provider"),
1659
+ providerId: z10.string().min(1),
1660
+ providerRequestId: z10.string().min(1)
1115
1661
  });
1116
1662
  var approvalInteractionLifecycleRecordPayloadSchema = approvalPendingInteractionPayloadSchema.omit({ availableDecisions: true });
1117
1663
  var approvalInteractionLifecycleSchema = interactionLifecycleRecordBaseSchema.extend({
@@ -1136,7 +1682,7 @@ var pluginExtensionInteractionLifecycleSchema = interactionLifecycleRecordBaseSc
1136
1682
  }),
1137
1683
  resolution: pluginExtensionInteractionResolutionSchema.omit({ value: true }).nullable()
1138
1684
  });
1139
- var interactionLifecycleSchema = z9.union([
1685
+ var interactionLifecycleSchema = z10.union([
1140
1686
  approvalInteractionLifecycleSchema,
1141
1687
  userQuestionInteractionLifecycleSchema,
1142
1688
  pluginInteractionLifecycleSchema,
@@ -1144,11 +1690,11 @@ var interactionLifecycleSchema = z9.union([
1144
1690
  ]);
1145
1691
 
1146
1692
  // ../domain/src/protocol-ids.ts
1147
- import { z as z10 } from "zod";
1148
- var clientTurnRequestIdSchema = z10.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
1693
+ import { z as z11 } from "zod";
1694
+ var clientTurnRequestIdSchema = z11.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
1149
1695
 
1150
1696
  // ../domain/src/system-message.ts
1151
- import { z as z11 } from "zod";
1697
+ import { z as z12 } from "zod";
1152
1698
  var systemMessageKindValues = [
1153
1699
  "ownership-assigned",
1154
1700
  "ownership-removed",
@@ -1159,16 +1705,16 @@ var systemMessageKindValues = [
1159
1705
  "child-outcome-batch",
1160
1706
  "unlabeled"
1161
1707
  ];
1162
- var systemMessageKindSchema = z11.enum(systemMessageKindValues);
1163
- var systemMessageSubjectSchema = z11.discriminatedUnion("kind", [
1164
- z11.object({
1165
- kind: z11.literal("thread"),
1166
- threadId: z11.string(),
1167
- threadName: z11.string()
1708
+ var systemMessageKindSchema = z12.enum(systemMessageKindValues);
1709
+ var systemMessageSubjectSchema = z12.discriminatedUnion("kind", [
1710
+ z12.object({
1711
+ kind: z12.literal("thread"),
1712
+ threadId: z12.string(),
1713
+ threadName: z12.string()
1168
1714
  }),
1169
- z11.object({
1170
- kind: z11.literal("thread-batch"),
1171
- count: z11.number()
1715
+ z12.object({
1716
+ kind: z12.literal("thread-batch"),
1717
+ count: z12.number()
1172
1718
  })
1173
1719
  ]);
1174
1720
 
@@ -1191,31 +1737,31 @@ var systemEventTypeValues = [
1191
1737
  "system/provider-turn-watchdog"
1192
1738
  ];
1193
1739
  var threadTurnInitiatorValues = ["user", "agent", "system"];
1194
- var threadTurnInitiatorSchema = z12.enum(threadTurnInitiatorValues);
1740
+ var threadTurnInitiatorSchema = z13.enum(threadTurnInitiatorValues);
1195
1741
  var turnRequestOptionsSchema = recordedThreadExecutionOptionsSchema;
1196
- var turnRequestTargetSchema = z12.discriminatedUnion("kind", [
1197
- z12.object({ kind: z12.literal("thread-start") }),
1198
- z12.object({ kind: z12.literal("new-turn") }),
1199
- z12.object({
1200
- kind: z12.literal("auto"),
1201
- expectedTurnId: z12.string().nullable()
1742
+ var turnRequestTargetSchema = z13.discriminatedUnion("kind", [
1743
+ z13.object({ kind: z13.literal("thread-start") }),
1744
+ z13.object({ kind: z13.literal("new-turn") }),
1745
+ z13.object({
1746
+ kind: z13.literal("auto"),
1747
+ expectedTurnId: z13.string().nullable()
1202
1748
  }),
1203
- z12.object({
1204
- kind: z12.literal("steer"),
1205
- expectedTurnId: z12.string().nullable()
1749
+ z13.object({
1750
+ kind: z13.literal("steer"),
1751
+ expectedTurnId: z13.string().nullable()
1206
1752
  })
1207
1753
  ]);
1208
- var clientTurnLifecycleEventDataSchema = z12.object({
1209
- direction: z12.literal("outbound"),
1210
- source: z12.enum(["spawn", "tell"]),
1754
+ var clientTurnLifecycleEventDataSchema = z13.object({
1755
+ direction: z13.literal("outbound"),
1756
+ source: z13.enum(["spawn", "tell"]),
1211
1757
  initiator: threadTurnInitiatorSchema,
1212
- request: z12.object({
1213
- method: z12.enum(["thread/start", "turn/start"]),
1214
- params: z12.record(z12.string(), z12.unknown())
1758
+ request: z13.object({
1759
+ method: z13.enum(["thread/start", "turn/start"]),
1760
+ params: z13.record(z13.string(), z13.unknown())
1215
1761
  })
1216
1762
  });
1217
- var turnRequestEventDataSchema = z12.object({
1218
- direction: z12.literal("outbound"),
1763
+ var turnRequestEventDataSchema = z13.object({
1764
+ direction: z13.literal("outbound"),
1219
1765
  requestId: clientTurnRequestIdSchema,
1220
1766
  // Retry provenance, written only when a `turn.failed` gate's retry row
1221
1767
  // dispatches. Both fields are present together or not at all: absence means
@@ -1225,45 +1771,45 @@ var turnRequestEventDataSchema = z12.object({
1225
1771
  /** The original request this attempt re-submits, unchanged across attempts. */
1226
1772
  retryOfRequestId: clientTurnRequestIdSchema.optional(),
1227
1773
  /** Which attempt this is: 2 is the first retry of the original request. */
1228
- retryAttempt: z12.number().int().min(2).optional(),
1229
- source: z12.enum(["spawn", "tell"]),
1774
+ retryAttempt: z13.number().int().min(2).optional(),
1775
+ source: z13.enum(["spawn", "tell"]),
1230
1776
  initiator: threadTurnInitiatorSchema,
1231
- senderThreadId: z12.string().nullable(),
1777
+ senderThreadId: z13.string().nullable(),
1232
1778
  systemMessageKind: systemMessageKindSchema.optional(),
1233
1779
  systemMessageSubject: systemMessageSubjectSchema.nullable().optional(),
1234
- input: z12.array(promptInputSchema),
1235
- inputGroups: z12.array(z12.array(promptInputSchema).min(1)).min(1).optional(),
1780
+ input: z13.array(promptInputSchema),
1781
+ inputGroups: z13.array(z13.array(promptInputSchema).min(1)).min(1).optional(),
1236
1782
  target: turnRequestTargetSchema,
1237
- request: z12.object({
1238
- method: z12.enum(["thread/start", "turn/start"]),
1239
- params: z12.record(z12.string(), z12.unknown())
1783
+ request: z13.object({
1784
+ method: z13.enum(["thread/start", "turn/start"]),
1785
+ params: z13.record(z13.string(), z13.unknown())
1240
1786
  }),
1241
1787
  execution: turnRequestOptionsSchema
1242
1788
  });
1243
- var turnRequestRejectedEventDataSchema = z12.object({
1789
+ var turnRequestRejectedEventDataSchema = z13.object({
1244
1790
  requestId: clientTurnRequestIdSchema,
1245
- reason: z12.string().min(1),
1246
- message: z12.string().min(1)
1247
- });
1248
- var systemErrorEventDataSchema = z12.object({
1249
- code: z12.string().optional(),
1250
- message: z12.string(),
1251
- detail: z12.string().optional(),
1252
- reconnectAttempt: z12.number().int().positive().optional(),
1253
- reconnectTotal: z12.number().int().positive().optional()
1791
+ reason: z13.string().min(1),
1792
+ message: z13.string().min(1)
1793
+ });
1794
+ var systemErrorEventDataSchema = z13.object({
1795
+ code: z13.string().optional(),
1796
+ message: z13.string(),
1797
+ detail: z13.string().optional(),
1798
+ reconnectAttempt: z13.number().int().positive().optional(),
1799
+ reconnectTotal: z13.number().int().positive().optional()
1254
1800
  }).superRefine((value, ctx) => {
1255
1801
  const hasReconnectAttempt = value.reconnectAttempt !== void 0;
1256
1802
  const hasReconnectTotal = value.reconnectTotal !== void 0;
1257
1803
  if (hasReconnectAttempt !== hasReconnectTotal) {
1258
1804
  ctx.addIssue({
1259
- code: z12.ZodIssueCode.custom,
1805
+ code: z13.ZodIssueCode.custom,
1260
1806
  message: "system/error reconnectAttempt and reconnectTotal must be provided together"
1261
1807
  });
1262
1808
  return;
1263
1809
  }
1264
1810
  if (value.reconnectAttempt !== void 0 && value.reconnectTotal !== void 0 && value.reconnectAttempt > value.reconnectTotal) {
1265
1811
  ctx.addIssue({
1266
- code: z12.ZodIssueCode.custom,
1812
+ code: z13.ZodIssueCode.custom,
1267
1813
  message: "system/error reconnectAttempt cannot be greater than reconnectTotal"
1268
1814
  });
1269
1815
  }
@@ -1273,42 +1819,42 @@ var ownershipChangeOperationActionValues = [
1273
1819
  "release",
1274
1820
  "transfer"
1275
1821
  ];
1276
- var ownershipChangeOperationActionSchema = z12.enum(
1822
+ var ownershipChangeOperationActionSchema = z13.enum(
1277
1823
  ownershipChangeOperationActionValues
1278
1824
  );
1279
- var ownershipChangeOperationMetadataSchema = z12.object({
1825
+ var ownershipChangeOperationMetadataSchema = z13.object({
1280
1826
  action: ownershipChangeOperationActionSchema,
1281
- nextParentThreadId: z12.string().nullable(),
1282
- nextParentThreadTitle: z12.string().nullable(),
1283
- previousParentThreadId: z12.string().nullable(),
1284
- previousParentThreadTitle: z12.string().nullable()
1285
- });
1286
- var systemOperationEventDataSchema = z12.object({
1287
- operation: z12.string(),
1288
- status: z12.string(),
1289
- message: z12.string(),
1290
- operationId: z12.string(),
1291
- metadata: z12.record(z12.string(), jsonValueSchema).optional()
1292
- });
1293
- var systemInteractionLifecycleEventDataSchema = z12.object({
1827
+ nextParentThreadId: z13.string().nullable(),
1828
+ nextParentThreadTitle: z13.string().nullable(),
1829
+ previousParentThreadId: z13.string().nullable(),
1830
+ previousParentThreadTitle: z13.string().nullable()
1831
+ });
1832
+ var systemOperationEventDataSchema = z13.object({
1833
+ operation: z13.string(),
1834
+ status: z13.string(),
1835
+ message: z13.string(),
1836
+ operationId: z13.string(),
1837
+ metadata: z13.record(z13.string(), jsonValueSchema).optional()
1838
+ });
1839
+ var systemInteractionLifecycleEventDataSchema = z13.object({
1294
1840
  interaction: interactionLifecycleSchema
1295
1841
  });
1296
- var systemPermissionGrantLifecycleEventDataSchema = z12.object({
1297
- interactionId: z12.string(),
1298
- providerId: z12.string(),
1299
- providerRequestId: z12.string(),
1842
+ var systemPermissionGrantLifecycleEventDataSchema = z13.object({
1843
+ interactionId: z13.string(),
1844
+ providerId: z13.string(),
1845
+ providerRequestId: z13.string(),
1300
1846
  status: pendingInteractionStatusSchema,
1301
1847
  resolution: approvalPendingInteractionResolutionSchema.nullable().default(null),
1302
- statusReason: z12.string().nullable().default(null),
1848
+ statusReason: z13.string().nullable().default(null),
1303
1849
  subject: pendingInteractionPermissionGrantApprovalSubjectSchema
1304
1850
  });
1305
- var systemUserQuestionLifecycleEventDataSchema = z12.object({
1306
- interactionId: z12.string(),
1307
- providerId: z12.string(),
1308
- providerRequestId: z12.string(),
1851
+ var systemUserQuestionLifecycleEventDataSchema = z13.object({
1852
+ interactionId: z13.string(),
1853
+ providerId: z13.string(),
1854
+ providerRequestId: z13.string(),
1309
1855
  status: pendingInteractionStatusSchema,
1310
1856
  resolution: userQuestionPendingInteractionResolutionSchema.nullable().default(null),
1311
- statusReason: z12.string().nullable().default(null),
1857
+ statusReason: z13.string().nullable().default(null),
1312
1858
  payload: userQuestionPendingInteractionPayloadSchema
1313
1859
  });
1314
1860
  var systemThreadInterruptedReasonValues = [
@@ -1316,20 +1862,20 @@ var systemThreadInterruptedReasonValues = [
1316
1862
  "host-daemon-restarted",
1317
1863
  "provider-turn-idle"
1318
1864
  ];
1319
- var systemThreadInterruptedReasonSchema = z12.enum(
1865
+ var systemThreadInterruptedReasonSchema = z13.enum(
1320
1866
  systemThreadInterruptedReasonValues
1321
1867
  );
1322
- var systemThreadInterruptedEventDataSchema = z12.object({
1868
+ var systemThreadInterruptedEventDataSchema = z13.object({
1323
1869
  reason: systemThreadInterruptedReasonSchema,
1324
- cause: z12.literal("host-connection-lost").optional()
1870
+ cause: z13.literal("host-connection-lost").optional()
1325
1871
  });
1326
- var provisioningTranscriptEntrySchema = z12.object({
1327
- type: z12.enum(["step", "output"]),
1328
- key: z12.string(),
1329
- text: z12.string(),
1330
- startedAt: z12.number().optional(),
1331
- status: z12.enum(["started", "completed", "failed"]).optional(),
1332
- metadata: z12.record(z12.string(), z12.unknown()).optional()
1872
+ var provisioningTranscriptEntrySchema = z13.object({
1873
+ type: z13.enum(["step", "output"]),
1874
+ key: z13.string(),
1875
+ text: z13.string(),
1876
+ startedAt: z13.number().optional(),
1877
+ status: z13.enum(["started", "completed", "failed"]).optional(),
1878
+ metadata: z13.record(z13.string(), z13.unknown()).optional()
1333
1879
  });
1334
1880
  var systemThreadProvisioningStatusValues = [
1335
1881
  "active",
@@ -1337,48 +1883,48 @@ var systemThreadProvisioningStatusValues = [
1337
1883
  "failed",
1338
1884
  "cancelled"
1339
1885
  ];
1340
- var systemThreadProvisioningStatusSchema = z12.enum(
1886
+ var systemThreadProvisioningStatusSchema = z13.enum(
1341
1887
  systemThreadProvisioningStatusValues
1342
1888
  );
1343
- var systemThreadProvisioningEventDataSchema = z12.object({
1344
- provisioningId: z12.string(),
1889
+ var systemThreadProvisioningEventDataSchema = z13.object({
1890
+ provisioningId: z13.string(),
1345
1891
  status: systemThreadProvisioningStatusSchema,
1346
- environmentId: z12.string().nullable(),
1347
- entries: z12.array(provisioningTranscriptEntrySchema)
1348
- });
1349
- var systemLegacyUserMessageEventDataSchema = z12.object({
1350
- text: z12.string(),
1351
- toolCallId: z12.string().optional(),
1352
- turnId: z12.string().optional()
1353
- });
1354
- var systemProviderTurnWatchdogEventDataSchema = z12.object({
1355
- reason: z12.literal("provider-turn-idle"),
1356
- thresholdMs: z12.number().int().positive(),
1357
- elapsedMs: z12.number().int().nonnegative(),
1358
- activeTurnId: z12.string().min(1),
1359
- activeTurnStartedAt: z12.number().int().nonnegative(),
1360
- lastActivityEventSequence: z12.number().int().positive(),
1361
- lastActivityEventType: z12.string().min(1),
1362
- lastActivityEventAt: z12.number().int().nonnegative(),
1363
- providerId: z12.string().min(1),
1364
- providerThreadId: z12.string().min(1).nullable(),
1365
- firedAt: z12.number().int().nonnegative()
1892
+ environmentId: z13.string().nullable(),
1893
+ entries: z13.array(provisioningTranscriptEntrySchema)
1894
+ });
1895
+ var systemLegacyUserMessageEventDataSchema = z13.object({
1896
+ text: z13.string(),
1897
+ toolCallId: z13.string().optional(),
1898
+ turnId: z13.string().optional()
1899
+ });
1900
+ var systemProviderTurnWatchdogEventDataSchema = z13.object({
1901
+ reason: z13.literal("provider-turn-idle"),
1902
+ thresholdMs: z13.number().int().positive(),
1903
+ elapsedMs: z13.number().int().nonnegative(),
1904
+ activeTurnId: z13.string().min(1),
1905
+ activeTurnStartedAt: z13.number().int().nonnegative(),
1906
+ lastActivityEventSequence: z13.number().int().positive(),
1907
+ lastActivityEventType: z13.string().min(1),
1908
+ lastActivityEventAt: z13.number().int().nonnegative(),
1909
+ providerId: z13.string().min(1),
1910
+ providerThreadId: z13.string().min(1).nullable(),
1911
+ firedAt: z13.number().int().nonnegative()
1366
1912
  });
1367
1913
 
1368
1914
  // ../domain/src/thread-event-scope.ts
1369
- import { z as z13 } from "zod";
1915
+ import { z as z14 } from "zod";
1370
1916
  var threadEventScopeKindValues = ["thread", "turn"];
1371
- var threadEventScopeKindSchema = z13.enum(threadEventScopeKindValues);
1372
- var threadEventScopeSchema = z13.discriminatedUnion("kind", [
1373
- z13.object({ kind: z13.literal("thread") }),
1374
- z13.object({ kind: z13.literal("turn"), turnId: z13.string().min(1) })
1917
+ var threadEventScopeKindSchema = z14.enum(threadEventScopeKindValues);
1918
+ var threadEventScopeSchema = z14.discriminatedUnion("kind", [
1919
+ z14.object({ kind: z14.literal("thread") }),
1920
+ z14.object({ kind: z14.literal("turn"), turnId: z14.string().min(1) })
1375
1921
  ]);
1376
1922
  var threadEventScopePolicyValues = [
1377
1923
  "thread",
1378
1924
  "turn",
1379
1925
  "thread-or-turn"
1380
1926
  ];
1381
- var threadEventScopePolicySchema = z13.enum(threadEventScopePolicyValues);
1927
+ var threadEventScopePolicySchema = z14.enum(threadEventScopePolicyValues);
1382
1928
  var threadEventScopeDefinitionByType = {
1383
1929
  "thread/started": {
1384
1930
  policy: "thread",
@@ -1544,32 +2090,32 @@ function validateThreadEventScope(args) {
1544
2090
  }
1545
2091
 
1546
2092
  // ../domain/src/thread-timeline-goal.ts
1547
- import { z as z14 } from "zod";
1548
- var threadTimelineGoalStatusSchema = z14.enum([
2093
+ import { z as z15 } from "zod";
2094
+ var threadTimelineGoalStatusSchema = z15.enum([
1549
2095
  "active",
1550
2096
  "paused",
1551
2097
  "budgetLimited",
1552
2098
  "complete"
1553
2099
  ]);
1554
- var threadTimelineGoalSchema = z14.object({
1555
- sourceSeq: z14.number().int().nonnegative(),
1556
- updatedAt: z14.number(),
1557
- objective: z14.string(),
2100
+ var threadTimelineGoalSchema = z15.object({
2101
+ sourceSeq: z15.number().int().nonnegative(),
2102
+ updatedAt: z15.number(),
2103
+ objective: z15.string(),
1558
2104
  status: threadTimelineGoalStatusSchema,
1559
- tokenBudget: z14.number().nullable(),
1560
- tokensUsed: z14.number(),
1561
- timeUsedSeconds: z14.number()
2105
+ tokenBudget: z15.number().nullable(),
2106
+ tokensUsed: z15.number(),
2107
+ timeUsedSeconds: z15.number()
1562
2108
  });
1563
2109
 
1564
2110
  // ../domain/src/provider-event.ts
1565
- var threadEventItemStatusSchema = z15.enum([
2111
+ var threadEventItemStatusSchema = z16.enum([
1566
2112
  "pending",
1567
2113
  "completed",
1568
2114
  "failed",
1569
2115
  "interrupted"
1570
2116
  ]);
1571
- var threadEventItemApprovalStatusSchema = z15.enum(["waiting_for_approval", "denied"]).nullable();
1572
- var threadEventTurnStatusSchema = z15.enum([
2117
+ var threadEventItemApprovalStatusSchema = z16.enum(["waiting_for_approval", "denied"]).nullable();
2118
+ var threadEventTurnStatusSchema = z16.enum([
1573
2119
  "completed",
1574
2120
  "failed",
1575
2121
  "interrupted"
@@ -1595,262 +2141,262 @@ var providerErrorCategoryValues = [
1595
2141
  "unauthorized",
1596
2142
  "unknown"
1597
2143
  ];
1598
- var providerErrorCategorySchema = z15.enum(providerErrorCategoryValues);
1599
- var providerErrorInfoSchema = z15.object({
2144
+ var providerErrorCategorySchema = z16.enum(providerErrorCategoryValues);
2145
+ var providerErrorInfoSchema = z16.object({
1600
2146
  category: providerErrorCategorySchema,
1601
- providerCode: z15.string().nullable(),
1602
- httpStatusCode: z15.number().nullable()
2147
+ providerCode: z16.string().nullable(),
2148
+ httpStatusCode: z16.number().nullable()
1603
2149
  });
1604
- var providerRateLimitStatusSchema = z15.enum([
2150
+ var providerRateLimitStatusSchema = z16.enum([
1605
2151
  "allowed",
1606
2152
  "warning",
1607
2153
  "blocked",
1608
2154
  "unknown"
1609
2155
  ]);
1610
- var providerRateLimitWindowSchema = z15.object({
1611
- providerKey: z15.string().min(1).nullable(),
1612
- label: z15.string().min(1).nullable(),
2156
+ var providerRateLimitWindowSchema = z16.object({
2157
+ providerKey: z16.string().min(1).nullable(),
2158
+ label: z16.string().min(1).nullable(),
1613
2159
  status: providerRateLimitStatusSchema,
1614
- resetsAtMs: z15.number().int().nonnegative().nullable()
2160
+ resetsAtMs: z16.number().int().nonnegative().nullable()
1615
2161
  });
1616
- var providerRateLimitStateSchema = z15.object({
1617
- providerId: z15.string().min(1),
2162
+ var providerRateLimitStateSchema = z16.object({
2163
+ providerId: z16.string().min(1),
1618
2164
  status: providerRateLimitStatusSchema,
1619
- kind: z15.enum(["subscription-window", "credits", "spend-control", "unknown"]),
1620
- windows: z15.array(providerRateLimitWindowSchema),
1621
- reachedReason: z15.string().min(1).nullable(),
1622
- overageStatus: z15.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
1623
- overageReason: z15.string().min(1).nullable()
1624
- });
1625
- var threadEventFileChangeKindSchema = z15.enum(["add", "delete", "update"]);
1626
- var threadEventFileChangeSchema = z15.object({
1627
- path: z15.string(),
2165
+ kind: z16.enum(["subscription-window", "credits", "spend-control", "unknown"]),
2166
+ windows: z16.array(providerRateLimitWindowSchema),
2167
+ reachedReason: z16.string().min(1).nullable(),
2168
+ overageStatus: z16.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
2169
+ overageReason: z16.string().min(1).nullable()
2170
+ });
2171
+ var threadEventFileChangeKindSchema = z16.enum(["add", "delete", "update"]);
2172
+ var threadEventFileChangeSchema = z16.object({
2173
+ path: z16.string(),
1628
2174
  kind: threadEventFileChangeKindSchema,
1629
- movePath: z15.string().optional(),
1630
- diff: z15.string().optional()
2175
+ movePath: z16.string().optional(),
2176
+ diff: z16.string().optional()
1631
2177
  });
1632
- var threadEventPlanStepStatusSchema = z15.enum([
2178
+ var threadEventPlanStepStatusSchema = z16.enum([
1633
2179
  "pending",
1634
2180
  "active",
1635
2181
  "completed",
1636
2182
  "failed"
1637
2183
  ]);
1638
- var threadEventPlanStepSchema = z15.object({
1639
- step: z15.string(),
2184
+ var threadEventPlanStepSchema = z16.object({
2185
+ step: z16.string(),
1640
2186
  status: threadEventPlanStepStatusSchema.optional()
1641
2187
  });
1642
2188
  var itemPresentationField = {
1643
2189
  presentation: threadEventItemPresentationSchema.optional()
1644
2190
  };
1645
- var threadEventWebSearchItemSchema = z15.object({
1646
- type: z15.literal("webSearch"),
1647
- id: z15.string(),
1648
- queries: z15.array(z15.string()).min(1),
1649
- resultText: z15.string().nullable(),
2191
+ var threadEventWebSearchItemSchema = z16.object({
2192
+ type: z16.literal("webSearch"),
2193
+ id: z16.string(),
2194
+ queries: z16.array(z16.string()).min(1),
2195
+ resultText: z16.string().nullable(),
1650
2196
  ...itemPresentationField,
1651
- parentToolCallId: z15.string().optional()
1652
- });
1653
- var threadEventWebFetchItemSchema = z15.object({
1654
- type: z15.literal("webFetch"),
1655
- id: z15.string(),
1656
- url: z15.string(),
1657
- prompt: z15.string().nullable(),
1658
- pattern: z15.string().nullable(),
1659
- resultText: z15.string().nullable(),
2197
+ parentToolCallId: z16.string().optional()
2198
+ });
2199
+ var threadEventWebFetchItemSchema = z16.object({
2200
+ type: z16.literal("webFetch"),
2201
+ id: z16.string(),
2202
+ url: z16.string(),
2203
+ prompt: z16.string().nullable(),
2204
+ pattern: z16.string().nullable(),
2205
+ resultText: z16.string().nullable(),
1660
2206
  ...itemPresentationField,
1661
- parentToolCallId: z15.string().optional()
2207
+ parentToolCallId: z16.string().optional()
1662
2208
  });
1663
- var threadEventImageViewItemSchema = z15.object({
1664
- type: z15.literal("imageView"),
1665
- id: z15.string(),
1666
- path: z15.string(),
2209
+ var threadEventImageViewItemSchema = z16.object({
2210
+ type: z16.literal("imageView"),
2211
+ id: z16.string(),
2212
+ path: z16.string(),
1667
2213
  ...itemPresentationField,
1668
- parentToolCallId: z15.string().optional()
2214
+ parentToolCallId: z16.string().optional()
1669
2215
  });
1670
- var threadEventFileReadItemSchema = z15.object({
1671
- type: z15.literal("fileRead"),
1672
- id: z15.string(),
1673
- path: z15.string(),
1674
- cmd: z15.string().optional(),
2216
+ var threadEventFileReadItemSchema = z16.object({
2217
+ type: z16.literal("fileRead"),
2218
+ id: z16.string(),
2219
+ path: z16.string(),
2220
+ cmd: z16.string().optional(),
1675
2221
  status: threadEventItemStatusSchema,
1676
2222
  ...itemPresentationField,
1677
- parentToolCallId: z15.string().optional()
2223
+ parentToolCallId: z16.string().optional()
1678
2224
  });
1679
- var threadEventSearchModeSchema = z15.enum(["content", "path", "list"]);
1680
- var threadEventSearchItemSchema = z15.object({
1681
- type: z15.literal("search"),
1682
- id: z15.string(),
2225
+ var threadEventSearchModeSchema = z16.enum(["content", "path", "list"]);
2226
+ var threadEventSearchItemSchema = z16.object({
2227
+ type: z16.literal("search"),
2228
+ id: z16.string(),
1683
2229
  mode: threadEventSearchModeSchema,
1684
- query: z15.string(),
1685
- path: z15.string().optional(),
1686
- cmd: z15.string().optional(),
2230
+ query: z16.string(),
2231
+ path: z16.string().optional(),
2232
+ cmd: z16.string().optional(),
1687
2233
  status: threadEventItemStatusSchema,
1688
2234
  ...itemPresentationField,
1689
- parentToolCallId: z15.string().optional()
2235
+ parentToolCallId: z16.string().optional()
1690
2236
  });
1691
- var threadEventDelegationItemSchema = z15.object({
1692
- type: z15.literal("delegation"),
1693
- id: z15.string(),
1694
- childRef: z15.string().min(1),
1695
- label: z15.string(),
2237
+ var threadEventDelegationItemSchema = z16.object({
2238
+ type: z16.literal("delegation"),
2239
+ id: z16.string(),
2240
+ childRef: z16.string().min(1),
2241
+ label: z16.string(),
1696
2242
  status: threadEventItemStatusSchema,
1697
- background: z15.boolean(),
1698
- summary: z15.string().optional(),
2243
+ background: z16.boolean(),
2244
+ summary: z16.string().optional(),
1699
2245
  ...itemPresentationField,
1700
- parentToolCallId: z15.string().optional()
2246
+ parentToolCallId: z16.string().optional()
1701
2247
  });
1702
- var threadEventPlanStepsItemSchema = z15.object({
1703
- type: z15.literal("planSteps"),
1704
- id: z15.string(),
1705
- steps: z15.array(threadEventPlanStepSchema),
1706
- explanation: z15.string().optional(),
2248
+ var threadEventPlanStepsItemSchema = z16.object({
2249
+ type: z16.literal("planSteps"),
2250
+ id: z16.string(),
2251
+ steps: z16.array(threadEventPlanStepSchema),
2252
+ explanation: z16.string().optional(),
1707
2253
  status: threadEventItemStatusSchema,
1708
2254
  ...itemPresentationField,
1709
- parentToolCallId: z15.string().optional()
2255
+ parentToolCallId: z16.string().optional()
1710
2256
  });
1711
- var threadEventExtensionItemSchema = z15.object({
1712
- type: z15.literal("extension"),
1713
- id: z15.string(),
2257
+ var threadEventExtensionItemSchema = z16.object({
2258
+ type: z16.literal("extension"),
2259
+ id: z16.string(),
1714
2260
  kind: extensionKindSchema,
1715
2261
  payload: jsonValueSchema,
1716
2262
  status: threadEventItemStatusSchema,
1717
2263
  presentation: threadEventItemPresentationSchema,
1718
- parentToolCallId: z15.string().optional()
2264
+ parentToolCallId: z16.string().optional()
1719
2265
  });
1720
- var threadEventTextTruncationSchema = z15.object({
1721
- originalLength: z15.number(),
1722
- retainedHeadLength: z15.number(),
1723
- retainedTailLength: z15.number(),
1724
- truncatedAt: z15.number()
2266
+ var threadEventTextTruncationSchema = z16.object({
2267
+ originalLength: z16.number(),
2268
+ retainedHeadLength: z16.number(),
2269
+ retainedTailLength: z16.number(),
2270
+ truncatedAt: z16.number()
1725
2271
  });
1726
- var threadEventItemTruncationSchema = z15.object({
2272
+ var threadEventItemTruncationSchema = z16.object({
1727
2273
  aggregatedOutput: threadEventTextTruncationSchema.optional(),
1728
2274
  result: threadEventTextTruncationSchema.optional(),
1729
2275
  resultText: threadEventTextTruncationSchema.optional()
1730
2276
  });
1731
- var threadEventImageGenerationItemSchema = z15.object({
1732
- type: z15.literal("imageGeneration"),
1733
- id: z15.string(),
2277
+ var threadEventImageGenerationItemSchema = z16.object({
2278
+ type: z16.literal("imageGeneration"),
2279
+ id: z16.string(),
1734
2280
  status: threadEventItemStatusSchema,
1735
- prompt: z15.string().nullable(),
1736
- path: z15.string().nullable(),
1737
- result: z15.string().optional(),
1738
- error: z15.string().nullable(),
1739
- transparentBackground: z15.boolean(),
2281
+ prompt: z16.string().nullable(),
2282
+ path: z16.string().nullable(),
2283
+ result: z16.string().optional(),
2284
+ error: z16.string().nullable(),
2285
+ transparentBackground: z16.boolean(),
1740
2286
  truncation: threadEventItemTruncationSchema.optional(),
1741
2287
  ...itemPresentationField,
1742
- parentToolCallId: z15.string().optional()
2288
+ parentToolCallId: z16.string().optional()
1743
2289
  });
1744
- var threadEventUserContentSchema = z15.discriminatedUnion("type", [
1745
- z15.object({ type: z15.literal("text"), text: z15.string() }),
1746
- z15.object({ type: z15.literal("image"), url: z15.string() }),
1747
- z15.object({ type: z15.literal("localImage"), path: z15.string() }),
1748
- z15.object({ type: z15.literal("localFile"), path: z15.string() })
2290
+ var threadEventUserContentSchema = z16.discriminatedUnion("type", [
2291
+ z16.object({ type: z16.literal("text"), text: z16.string() }),
2292
+ z16.object({ type: z16.literal("image"), url: z16.string() }),
2293
+ z16.object({ type: z16.literal("localImage"), path: z16.string() }),
2294
+ z16.object({ type: z16.literal("localFile"), path: z16.string() })
1749
2295
  ]);
1750
- var threadEventTokenUsageBreakdownSchema = z15.object({
1751
- totalTokens: z15.number(),
1752
- inputTokens: z15.number(),
1753
- cachedInputTokens: z15.number(),
1754
- cacheReadInputTokens: z15.number().nonnegative().optional(),
1755
- cacheWriteInputTokens: z15.number().nonnegative().optional(),
1756
- outputTokens: z15.number(),
1757
- reasoningOutputTokens: z15.number()
1758
- });
1759
- var threadEventContextWindowUsageSchema = z15.object({
2296
+ var threadEventTokenUsageBreakdownSchema = z16.object({
2297
+ totalTokens: z16.number(),
2298
+ inputTokens: z16.number(),
2299
+ cachedInputTokens: z16.number(),
2300
+ cacheReadInputTokens: z16.number().nonnegative().optional(),
2301
+ cacheWriteInputTokens: z16.number().nonnegative().optional(),
2302
+ outputTokens: z16.number(),
2303
+ reasoningOutputTokens: z16.number()
2304
+ });
2305
+ var threadEventContextWindowUsageSchema = z16.object({
1760
2306
  snapshot: contextSnapshotSchema.optional(),
1761
- usedTokens: z15.number().nullable(),
1762
- modelContextWindow: z15.number().nullable(),
1763
- estimated: z15.boolean()
2307
+ usedTokens: z16.number().nullable(),
2308
+ modelContextWindow: z16.number().nullable(),
2309
+ estimated: z16.boolean()
1764
2310
  });
1765
- var threadEventTokenUsageSchema = z15.object({
2311
+ var threadEventTokenUsageSchema = z16.object({
1766
2312
  total: threadEventTokenUsageBreakdownSchema,
1767
2313
  last: threadEventTokenUsageBreakdownSchema,
1768
- modelContextWindow: z15.number().nullable()
2314
+ modelContextWindow: z16.number().nullable()
1769
2315
  });
1770
- var threadEventWarningCategorySchema = z15.enum([
2316
+ var threadEventWarningCategorySchema = z16.enum([
1771
2317
  "deprecation",
1772
2318
  "config",
1773
2319
  "general",
1774
2320
  "compaction-skipped"
1775
2321
  ]);
1776
- var providerRawEventSchema = z15.object({
1777
- jsonrpc: z15.literal("2.0"),
1778
- id: z15.union([z15.string(), z15.number()]).optional(),
1779
- method: z15.string(),
2322
+ var providerRawEventSchema = z16.object({
2323
+ jsonrpc: z16.literal("2.0"),
2324
+ id: z16.union([z16.string(), z16.number()]).optional(),
2325
+ method: z16.string(),
1780
2326
  params: jsonValueSchema.optional()
1781
2327
  });
1782
- var providerUnhandledEventSchema = z15.object({
1783
- type: z15.literal("provider/unhandled"),
1784
- threadId: z15.string(),
1785
- providerThreadId: z15.string(),
1786
- providerId: z15.string(),
1787
- rawType: z15.string(),
2328
+ var providerUnhandledEventSchema = z16.object({
2329
+ type: z16.literal("provider/unhandled"),
2330
+ threadId: z16.string(),
2331
+ providerThreadId: z16.string(),
2332
+ providerId: z16.string(),
2333
+ rawType: z16.string(),
1788
2334
  rawEvent: providerRawEventSchema,
1789
- parentToolCallId: z15.string().optional()
1790
- });
1791
- var toolCallProgressEventSchema = z15.object({
1792
- type: z15.literal("item/toolCall/progress"),
1793
- threadId: z15.string(),
1794
- providerThreadId: z15.string(),
1795
- itemId: z15.string(),
1796
- message: z15.string().optional(),
1797
- parentToolCallId: z15.string().optional()
1798
- });
1799
- var threadEventBackgroundTaskItemSchema = z15.object({
1800
- type: z15.literal("backgroundTask"),
1801
- id: z15.string(),
1802
- familyId: z15.string().optional(),
1803
- taskType: z15.string(),
1804
- description: z15.string(),
2335
+ parentToolCallId: z16.string().optional()
2336
+ });
2337
+ var toolCallProgressEventSchema = z16.object({
2338
+ type: z16.literal("item/toolCall/progress"),
2339
+ threadId: z16.string(),
2340
+ providerThreadId: z16.string(),
2341
+ itemId: z16.string(),
2342
+ message: z16.string().optional(),
2343
+ parentToolCallId: z16.string().optional()
2344
+ });
2345
+ var threadEventBackgroundTaskItemSchema = z16.object({
2346
+ type: z16.literal("backgroundTask"),
2347
+ id: z16.string(),
2348
+ familyId: z16.string().optional(),
2349
+ taskType: z16.string(),
2350
+ description: z16.string(),
1805
2351
  status: threadEventItemStatusSchema,
1806
2352
  taskStatus: backgroundTaskStatusSchema,
1807
- skipTranscript: z15.boolean(),
1808
- workflowName: z15.string().optional(),
2353
+ skipTranscript: z16.boolean(),
2354
+ workflowName: z16.string().optional(),
1809
2355
  workflow: workflowProgressSnapshotSchema.optional(),
1810
2356
  usage: backgroundTaskUsageSchema.optional(),
1811
- summary: z15.string().optional(),
1812
- error: z15.string().optional(),
1813
- outputFile: z15.string().optional(),
2357
+ summary: z16.string().optional(),
2358
+ error: z16.string().optional(),
2359
+ outputFile: z16.string().optional(),
1814
2360
  ...itemPresentationField,
1815
- parentToolCallId: z15.string().optional()
2361
+ parentToolCallId: z16.string().optional()
1816
2362
  });
1817
- var threadEventItemSchema = z15.discriminatedUnion("type", [
1818
- z15.object({
1819
- type: z15.literal("userMessage"),
1820
- id: z15.string(),
1821
- content: z15.array(threadEventUserContentSchema),
2363
+ var threadEventItemSchema = z16.discriminatedUnion("type", [
2364
+ z16.object({
2365
+ type: z16.literal("userMessage"),
2366
+ id: z16.string(),
2367
+ content: z16.array(threadEventUserContentSchema),
1822
2368
  clientRequestId: clientTurnRequestIdSchema.optional(),
1823
- parentToolCallId: z15.string().optional()
2369
+ parentToolCallId: z16.string().optional()
1824
2370
  }).strict(),
1825
- z15.object({
1826
- type: z15.literal("agentMessage"),
1827
- id: z15.string(),
1828
- text: z15.string(),
2371
+ z16.object({
2372
+ type: z16.literal("agentMessage"),
2373
+ id: z16.string(),
2374
+ text: z16.string(),
1829
2375
  ...itemPresentationField,
1830
- parentToolCallId: z15.string().optional()
2376
+ parentToolCallId: z16.string().optional()
1831
2377
  }),
1832
- z15.object({
1833
- type: z15.literal("commandExecution"),
1834
- id: z15.string(),
1835
- command: z15.string(),
1836
- cwd: z15.string(),
2378
+ z16.object({
2379
+ type: z16.literal("commandExecution"),
2380
+ id: z16.string(),
2381
+ command: z16.string(),
2382
+ cwd: z16.string(),
1837
2383
  status: threadEventItemStatusSchema,
1838
2384
  approvalStatus: threadEventItemApprovalStatusSchema,
1839
- aggregatedOutput: z15.string().optional(),
1840
- exitCode: z15.number().optional(),
1841
- durationMs: z15.number().optional(),
2385
+ aggregatedOutput: z16.string().optional(),
2386
+ exitCode: z16.number().optional(),
2387
+ durationMs: z16.number().optional(),
1842
2388
  truncation: threadEventItemTruncationSchema.optional(),
1843
2389
  ...itemPresentationField,
1844
- parentToolCallId: z15.string().optional()
2390
+ parentToolCallId: z16.string().optional()
1845
2391
  }),
1846
- z15.object({
1847
- type: z15.literal("fileChange"),
1848
- id: z15.string(),
1849
- changes: z15.array(threadEventFileChangeSchema),
2392
+ z16.object({
2393
+ type: z16.literal("fileChange"),
2394
+ id: z16.string(),
2395
+ changes: z16.array(threadEventFileChangeSchema),
1850
2396
  status: threadEventItemStatusSchema,
1851
2397
  approvalStatus: threadEventItemApprovalStatusSchema,
1852
2398
  ...itemPresentationField,
1853
- parentToolCallId: z15.string().optional()
2399
+ parentToolCallId: z16.string().optional()
1854
2400
  }),
1855
2401
  threadEventWebSearchItemSchema,
1856
2402
  threadEventWebFetchItemSchema,
@@ -1858,264 +2404,264 @@ var threadEventItemSchema = z15.discriminatedUnion("type", [
1858
2404
  threadEventImageGenerationItemSchema,
1859
2405
  threadEventFileReadItemSchema,
1860
2406
  threadEventSearchItemSchema,
1861
- z15.object({
1862
- type: z15.literal("toolCall"),
1863
- id: z15.string(),
1864
- server: z15.string().optional(),
1865
- tool: z15.string(),
1866
- arguments: z15.record(z15.string(), z15.unknown()).optional(),
2407
+ z16.object({
2408
+ type: z16.literal("toolCall"),
2409
+ id: z16.string(),
2410
+ server: z16.string().optional(),
2411
+ tool: z16.string(),
2412
+ arguments: z16.record(z16.string(), z16.unknown()).optional(),
1867
2413
  status: threadEventItemStatusSchema,
1868
- result: z15.unknown().optional(),
1869
- error: z15.string().optional(),
1870
- durationMs: z15.number().optional(),
2414
+ result: z16.unknown().optional(),
2415
+ error: z16.string().optional(),
2416
+ durationMs: z16.number().optional(),
1871
2417
  truncation: threadEventItemTruncationSchema.optional(),
1872
2418
  ...itemPresentationField,
1873
- parentToolCallId: z15.string().optional()
2419
+ parentToolCallId: z16.string().optional()
1874
2420
  }),
1875
- z15.object({
1876
- type: z15.literal("reasoning"),
1877
- id: z15.string(),
1878
- summary: z15.array(z15.string()),
1879
- content: z15.array(z15.string()),
2421
+ z16.object({
2422
+ type: z16.literal("reasoning"),
2423
+ id: z16.string(),
2424
+ summary: z16.array(z16.string()),
2425
+ content: z16.array(z16.string()),
1880
2426
  ...itemPresentationField,
1881
- parentToolCallId: z15.string().optional()
2427
+ parentToolCallId: z16.string().optional()
1882
2428
  }),
1883
- z15.object({
1884
- type: z15.literal("plan"),
1885
- id: z15.string(),
1886
- text: z15.string(),
2429
+ z16.object({
2430
+ type: z16.literal("plan"),
2431
+ id: z16.string(),
2432
+ text: z16.string(),
1887
2433
  ...itemPresentationField,
1888
- parentToolCallId: z15.string().optional()
2434
+ parentToolCallId: z16.string().optional()
1889
2435
  }),
1890
2436
  threadEventPlanStepsItemSchema,
1891
- z15.object({
1892
- type: z15.literal("contextCompaction"),
1893
- id: z15.string(),
2437
+ z16.object({
2438
+ type: z16.literal("contextCompaction"),
2439
+ id: z16.string(),
1894
2440
  ...itemPresentationField,
1895
- parentToolCallId: z15.string().optional()
2441
+ parentToolCallId: z16.string().optional()
1896
2442
  }),
1897
2443
  threadEventBackgroundTaskItemSchema,
1898
2444
  threadEventDelegationItemSchema,
1899
2445
  threadEventExtensionItemSchema
1900
2446
  ]);
1901
2447
  function itemTextDeltaEventSchema(type) {
1902
- return z15.object({
1903
- type: z15.literal(type),
1904
- threadId: z15.string(),
1905
- providerThreadId: z15.string(),
1906
- itemId: z15.string(),
1907
- delta: z15.string(),
1908
- parentToolCallId: z15.string().optional()
2448
+ return z16.object({
2449
+ type: z16.literal(type),
2450
+ threadId: z16.string(),
2451
+ providerThreadId: z16.string(),
2452
+ itemId: z16.string(),
2453
+ delta: z16.string(),
2454
+ parentToolCallId: z16.string().optional()
1909
2455
  });
1910
2456
  }
1911
- var unscopedProviderEventSchema = z15.discriminatedUnion("type", [
1912
- z15.object({
1913
- type: z15.literal("thread/started"),
1914
- threadId: z15.string()
2457
+ var unscopedProviderEventSchema = z16.discriminatedUnion("type", [
2458
+ z16.object({
2459
+ type: z16.literal("thread/started"),
2460
+ threadId: z16.string()
1915
2461
  }),
1916
- z15.object({
1917
- type: z15.literal("thread/identity"),
1918
- threadId: z15.string(),
1919
- providerThreadId: z15.string()
2462
+ z16.object({
2463
+ type: z16.literal("thread/identity"),
2464
+ threadId: z16.string(),
2465
+ providerThreadId: z16.string()
1920
2466
  }),
1921
- z15.object({
1922
- type: z15.literal("turn/started"),
1923
- threadId: z15.string(),
1924
- providerThreadId: z15.string(),
1925
- parentToolCallId: z15.string().optional()
2467
+ z16.object({
2468
+ type: z16.literal("turn/started"),
2469
+ threadId: z16.string(),
2470
+ providerThreadId: z16.string(),
2471
+ parentToolCallId: z16.string().optional()
1926
2472
  }),
1927
- z15.object({
1928
- type: z15.literal("turn/completed"),
1929
- threadId: z15.string(),
1930
- providerThreadId: z15.string().nullable(),
2473
+ z16.object({
2474
+ type: z16.literal("turn/completed"),
2475
+ threadId: z16.string(),
2476
+ providerThreadId: z16.string().nullable(),
1931
2477
  status: threadEventTurnStatusSchema,
1932
- error: z15.object({ message: z15.string() }).optional(),
1933
- providerCheckpointId: z15.string().min(1).optional()
2478
+ error: z16.object({ message: z16.string() }).optional(),
2479
+ providerCheckpointId: z16.string().min(1).optional()
1934
2480
  }),
1935
- z15.object({
1936
- type: z15.literal("turn/input/accepted"),
1937
- threadId: z15.string(),
1938
- providerThreadId: z15.string(),
2481
+ z16.object({
2482
+ type: z16.literal("turn/input/accepted"),
2483
+ threadId: z16.string(),
2484
+ providerThreadId: z16.string(),
1939
2485
  clientRequestId: clientTurnRequestIdSchema,
1940
2486
  scope: threadEventScopeSchema
1941
2487
  }).strict(),
1942
- z15.object({
1943
- type: z15.literal("thread/name/updated"),
1944
- threadId: z15.string(),
1945
- providerThreadId: z15.string(),
1946
- threadName: z15.string()
2488
+ z16.object({
2489
+ type: z16.literal("thread/name/updated"),
2490
+ threadId: z16.string(),
2491
+ providerThreadId: z16.string(),
2492
+ threadName: z16.string()
1947
2493
  }),
1948
- z15.object({
1949
- type: z15.literal("thread/compacted"),
1950
- threadId: z15.string(),
1951
- providerThreadId: z15.string()
2494
+ z16.object({
2495
+ type: z16.literal("thread/compacted"),
2496
+ threadId: z16.string(),
2497
+ providerThreadId: z16.string()
1952
2498
  }),
1953
- z15.object({
1954
- type: z15.literal("thread/context/cleared"),
1955
- threadId: z15.string(),
1956
- providerThreadId: z15.string()
2499
+ z16.object({
2500
+ type: z16.literal("thread/context/cleared"),
2501
+ threadId: z16.string(),
2502
+ providerThreadId: z16.string()
1957
2503
  }),
1958
- z15.object({
1959
- type: z15.literal("thread/goal/updated"),
1960
- threadId: z15.string(),
1961
- providerThreadId: z15.string(),
1962
- objective: z15.string(),
2504
+ z16.object({
2505
+ type: z16.literal("thread/goal/updated"),
2506
+ threadId: z16.string(),
2507
+ providerThreadId: z16.string(),
2508
+ objective: z16.string(),
1963
2509
  status: threadTimelineGoalStatusSchema,
1964
- tokenBudget: z15.number().nullable(),
1965
- tokensUsed: z15.number(),
1966
- timeUsedSeconds: z15.number()
2510
+ tokenBudget: z16.number().nullable(),
2511
+ tokensUsed: z16.number(),
2512
+ timeUsedSeconds: z16.number()
1967
2513
  }),
1968
- z15.object({
1969
- type: z15.literal("thread/goal/cleared"),
1970
- threadId: z15.string(),
1971
- providerThreadId: z15.string()
2514
+ z16.object({
2515
+ type: z16.literal("thread/goal/cleared"),
2516
+ threadId: z16.string(),
2517
+ providerThreadId: z16.string()
1972
2518
  }),
1973
- z15.object({
1974
- type: z15.literal("item/started"),
1975
- threadId: z15.string(),
1976
- providerThreadId: z15.string(),
2519
+ z16.object({
2520
+ type: z16.literal("item/started"),
2521
+ threadId: z16.string(),
2522
+ providerThreadId: z16.string(),
1977
2523
  item: threadEventItemSchema
1978
2524
  }),
1979
- z15.object({
1980
- type: z15.literal("item/completed"),
1981
- threadId: z15.string(),
1982
- providerThreadId: z15.string(),
2525
+ z16.object({
2526
+ type: z16.literal("item/completed"),
2527
+ threadId: z16.string(),
2528
+ providerThreadId: z16.string(),
1983
2529
  item: threadEventItemSchema
1984
2530
  }),
1985
2531
  itemTextDeltaEventSchema("item/agentMessage/delta"),
1986
- z15.object({
1987
- type: z15.literal("item/commandExecution/outputDelta"),
1988
- threadId: z15.string(),
1989
- providerThreadId: z15.string(),
1990
- itemId: z15.string(),
1991
- delta: z15.string(),
1992
- reset: z15.boolean().optional(),
1993
- parentToolCallId: z15.string().optional()
2532
+ z16.object({
2533
+ type: z16.literal("item/commandExecution/outputDelta"),
2534
+ threadId: z16.string(),
2535
+ providerThreadId: z16.string(),
2536
+ itemId: z16.string(),
2537
+ delta: z16.string(),
2538
+ reset: z16.boolean().optional(),
2539
+ parentToolCallId: z16.string().optional()
1994
2540
  }),
1995
2541
  itemTextDeltaEventSchema("item/fileChange/outputDelta"),
1996
2542
  itemTextDeltaEventSchema("item/reasoning/summaryTextDelta"),
1997
2543
  itemTextDeltaEventSchema("item/reasoning/textDelta"),
1998
2544
  itemTextDeltaEventSchema("item/plan/delta"),
1999
- z15.object({
2000
- type: z15.literal("item/mcpToolCall/progress"),
2001
- threadId: z15.string(),
2002
- providerThreadId: z15.string(),
2003
- itemId: z15.string(),
2004
- message: z15.string().optional(),
2005
- parentToolCallId: z15.string().optional()
2545
+ z16.object({
2546
+ type: z16.literal("item/mcpToolCall/progress"),
2547
+ threadId: z16.string(),
2548
+ providerThreadId: z16.string(),
2549
+ itemId: z16.string(),
2550
+ message: z16.string().optional(),
2551
+ parentToolCallId: z16.string().optional()
2006
2552
  }),
2007
2553
  toolCallProgressEventSchema,
2008
- z15.object({
2009
- type: z15.literal("item/backgroundTask/progress"),
2010
- threadId: z15.string(),
2011
- providerThreadId: z15.string(),
2554
+ z16.object({
2555
+ type: z16.literal("item/backgroundTask/progress"),
2556
+ threadId: z16.string(),
2557
+ providerThreadId: z16.string(),
2012
2558
  item: threadEventBackgroundTaskItemSchema
2013
2559
  }),
2014
- z15.object({
2015
- type: z15.literal("item/backgroundTask/completed"),
2016
- threadId: z15.string(),
2017
- providerThreadId: z15.string(),
2560
+ z16.object({
2561
+ type: z16.literal("item/backgroundTask/completed"),
2562
+ threadId: z16.string(),
2563
+ providerThreadId: z16.string(),
2018
2564
  item: threadEventBackgroundTaskItemSchema
2019
2565
  }),
2020
- z15.object({
2021
- type: z15.literal("item/delegation/progress"),
2022
- threadId: z15.string(),
2023
- providerThreadId: z15.string(),
2566
+ z16.object({
2567
+ type: z16.literal("item/delegation/progress"),
2568
+ threadId: z16.string(),
2569
+ providerThreadId: z16.string(),
2024
2570
  item: threadEventDelegationItemSchema
2025
2571
  }),
2026
- z15.object({
2027
- type: z15.literal("item/delegation/completed"),
2028
- threadId: z15.string(),
2029
- providerThreadId: z15.string(),
2572
+ z16.object({
2573
+ type: z16.literal("item/delegation/completed"),
2574
+ threadId: z16.string(),
2575
+ providerThreadId: z16.string(),
2030
2576
  item: threadEventDelegationItemSchema
2031
2577
  }),
2032
- z15.object({
2033
- type: z15.literal("thread/tokenUsage/updated"),
2034
- threadId: z15.string(),
2035
- providerThreadId: z15.string(),
2578
+ z16.object({
2579
+ type: z16.literal("thread/tokenUsage/updated"),
2580
+ threadId: z16.string(),
2581
+ providerThreadId: z16.string(),
2036
2582
  tokenUsage: threadEventTokenUsageSchema
2037
2583
  }),
2038
- z15.object({
2039
- type: z15.literal("thread/contextWindowUsage/updated"),
2040
- threadId: z15.string(),
2041
- providerThreadId: z15.string(),
2584
+ z16.object({
2585
+ type: z16.literal("thread/contextWindowUsage/updated"),
2586
+ threadId: z16.string(),
2587
+ providerThreadId: z16.string(),
2042
2588
  contextWindowUsage: threadEventContextWindowUsageSchema
2043
2589
  }),
2044
- z15.object({
2045
- type: z15.literal("turn/plan/updated"),
2046
- threadId: z15.string(),
2047
- providerThreadId: z15.string(),
2048
- plan: z15.array(threadEventPlanStepSchema),
2049
- explanation: z15.string().optional()
2590
+ z16.object({
2591
+ type: z16.literal("turn/plan/updated"),
2592
+ threadId: z16.string(),
2593
+ providerThreadId: z16.string(),
2594
+ plan: z16.array(threadEventPlanStepSchema),
2595
+ explanation: z16.string().optional()
2050
2596
  }),
2051
- z15.object({
2052
- type: z15.literal("turn/diff/updated"),
2053
- threadId: z15.string(),
2054
- providerThreadId: z15.string(),
2055
- diff: z15.string().optional()
2597
+ z16.object({
2598
+ type: z16.literal("turn/diff/updated"),
2599
+ threadId: z16.string(),
2600
+ providerThreadId: z16.string(),
2601
+ diff: z16.string().optional()
2056
2602
  }),
2057
- z15.object({
2058
- type: z15.literal("provider/error"),
2059
- threadId: z15.string(),
2060
- providerThreadId: z15.string(),
2061
- message: z15.string(),
2062
- detail: z15.string().optional(),
2063
- willRetry: z15.boolean().optional(),
2603
+ z16.object({
2604
+ type: z16.literal("provider/error"),
2605
+ threadId: z16.string(),
2606
+ providerThreadId: z16.string(),
2607
+ message: z16.string(),
2608
+ detail: z16.string().optional(),
2609
+ willRetry: z16.boolean().optional(),
2064
2610
  errorInfo: providerErrorInfoSchema.optional()
2065
2611
  }),
2066
- z15.object({
2067
- type: z15.literal("provider/rateLimits/updated"),
2068
- threadId: z15.string(),
2069
- providerThreadId: z15.string(),
2612
+ z16.object({
2613
+ type: z16.literal("provider/rateLimits/updated"),
2614
+ threadId: z16.string(),
2615
+ providerThreadId: z16.string(),
2070
2616
  rateLimits: providerRateLimitStateSchema
2071
2617
  }),
2072
- z15.object({
2073
- type: z15.literal("provider.env-resolved"),
2074
- threadId: z15.string(),
2075
- providerThreadId: z15.string(),
2076
- entries: z15.array(
2077
- z15.object({
2078
- name: z15.string(),
2079
- source: z15.union([
2080
- z15.literal("shell"),
2081
- z15.object({ plugin: z15.string() }).strict(),
2082
- z15.object({ core: z15.enum(["machine-git", "machine-environment"]) }).strict()
2618
+ z16.object({
2619
+ type: z16.literal("provider.env-resolved"),
2620
+ threadId: z16.string(),
2621
+ providerThreadId: z16.string(),
2622
+ entries: z16.array(
2623
+ z16.object({
2624
+ name: z16.string(),
2625
+ source: z16.union([
2626
+ z16.literal("shell"),
2627
+ z16.object({ plugin: z16.string() }).strict(),
2628
+ z16.object({ core: z16.enum(["machine-git", "machine-environment"]) }).strict()
2083
2629
  ]),
2084
- value: z15.union([
2085
- z15.string(),
2086
- z15.object({ masked: z15.literal(true) }).strict()
2630
+ value: z16.union([
2631
+ z16.string(),
2632
+ z16.object({ masked: z16.literal(true) }).strict()
2087
2633
  ]),
2088
- reason: z15.string().optional()
2634
+ reason: z16.string().optional()
2089
2635
  }).strict()
2090
2636
  )
2091
2637
  }),
2092
- z15.object({
2093
- type: z15.literal("thread/extensionState/updated"),
2094
- threadId: z15.string(),
2095
- providerThreadId: z15.string(),
2638
+ z16.object({
2639
+ type: z16.literal("thread/extensionState/updated"),
2640
+ threadId: z16.string(),
2641
+ providerThreadId: z16.string(),
2096
2642
  kind: extensionKindSchema,
2097
2643
  payload: jsonValueSchema
2098
2644
  }),
2099
- z15.object({
2100
- type: z15.literal("provider/warning"),
2101
- threadId: z15.string(),
2102
- providerThreadId: z15.string(),
2645
+ z16.object({
2646
+ type: z16.literal("provider/warning"),
2647
+ threadId: z16.string(),
2648
+ providerThreadId: z16.string(),
2103
2649
  category: threadEventWarningCategorySchema,
2104
- summary: z15.string().optional(),
2105
- details: z15.string().optional()
2650
+ summary: z16.string().optional(),
2651
+ details: z16.string().optional()
2106
2652
  }),
2107
- z15.object({
2108
- type: z15.literal("provider/modelFallback"),
2109
- threadId: z15.string(),
2110
- providerThreadId: z15.string(),
2111
- originalModel: z15.string().min(1),
2112
- fallbackModel: z15.string().min(1),
2113
- reason: z15.enum(["refusal", "provider"]),
2114
- message: z15.string()
2653
+ z16.object({
2654
+ type: z16.literal("provider/modelFallback"),
2655
+ threadId: z16.string(),
2656
+ providerThreadId: z16.string(),
2657
+ originalModel: z16.string().min(1),
2658
+ fallbackModel: z16.string().min(1),
2659
+ reason: z16.enum(["refusal", "provider"]),
2660
+ message: z16.string()
2115
2661
  }),
2116
2662
  providerUnhandledEventSchema
2117
2663
  ]);
2118
- var scopedEventDataSchema = z15.object({
2664
+ var scopedEventDataSchema = z16.object({
2119
2665
  scope: threadEventScopeSchema
2120
2666
  });
2121
2667
  var providerEventSchema = unscopedProviderEventSchema.and(
@@ -2124,58 +2670,58 @@ var providerEventSchema = unscopedProviderEventSchema.and(
2124
2670
  var providerEventTypeValues = unscopedProviderEventSchema.options.map(
2125
2671
  (option) => option.shape.type.value
2126
2672
  );
2127
- var unscopedSystemEventSchema = z15.discriminatedUnion("type", [
2128
- z15.object({
2129
- type: z15.literal("client/thread/start"),
2130
- threadId: z15.string()
2673
+ var unscopedSystemEventSchema = z16.discriminatedUnion("type", [
2674
+ z16.object({
2675
+ type: z16.literal("client/thread/start"),
2676
+ threadId: z16.string()
2131
2677
  }).merge(clientTurnLifecycleEventDataSchema),
2132
- z15.object({
2133
- type: z15.literal("client/turn/requested"),
2134
- threadId: z15.string()
2678
+ z16.object({
2679
+ type: z16.literal("client/turn/requested"),
2680
+ threadId: z16.string()
2135
2681
  }).merge(turnRequestEventDataSchema),
2136
- z15.object({
2137
- type: z15.literal("client/turn/rejected"),
2138
- threadId: z15.string()
2682
+ z16.object({
2683
+ type: z16.literal("client/turn/rejected"),
2684
+ threadId: z16.string()
2139
2685
  }).merge(turnRequestRejectedEventDataSchema),
2140
- z15.object({
2141
- type: z15.literal("client/turn/start"),
2142
- threadId: z15.string()
2686
+ z16.object({
2687
+ type: z16.literal("client/turn/start"),
2688
+ threadId: z16.string()
2143
2689
  }).merge(clientTurnLifecycleEventDataSchema),
2144
- z15.object({
2145
- type: z15.literal("system/error"),
2146
- threadId: z15.string()
2690
+ z16.object({
2691
+ type: z16.literal("system/error"),
2692
+ threadId: z16.string()
2147
2693
  }).merge(systemErrorEventDataSchema),
2148
- z15.object({
2149
- type: z15.literal("system/manager/user_message"),
2150
- threadId: z15.string()
2694
+ z16.object({
2695
+ type: z16.literal("system/manager/user_message"),
2696
+ threadId: z16.string()
2151
2697
  }).merge(systemLegacyUserMessageEventDataSchema),
2152
- z15.object({
2153
- type: z15.literal("system/thread/interrupted"),
2154
- threadId: z15.string()
2698
+ z16.object({
2699
+ type: z16.literal("system/thread/interrupted"),
2700
+ threadId: z16.string()
2155
2701
  }).merge(systemThreadInterruptedEventDataSchema),
2156
- z15.object({
2157
- type: z15.literal("system/operation"),
2158
- threadId: z15.string()
2702
+ z16.object({
2703
+ type: z16.literal("system/operation"),
2704
+ threadId: z16.string()
2159
2705
  }).merge(systemOperationEventDataSchema),
2160
- z15.object({
2161
- type: z15.literal("system/interaction/lifecycle"),
2162
- threadId: z15.string()
2706
+ z16.object({
2707
+ type: z16.literal("system/interaction/lifecycle"),
2708
+ threadId: z16.string()
2163
2709
  }).merge(systemInteractionLifecycleEventDataSchema),
2164
- z15.object({
2165
- type: z15.literal("system/permissionGrant/lifecycle"),
2166
- threadId: z15.string()
2710
+ z16.object({
2711
+ type: z16.literal("system/permissionGrant/lifecycle"),
2712
+ threadId: z16.string()
2167
2713
  }).merge(systemPermissionGrantLifecycleEventDataSchema),
2168
- z15.object({
2169
- type: z15.literal("system/userQuestion/lifecycle"),
2170
- threadId: z15.string()
2714
+ z16.object({
2715
+ type: z16.literal("system/userQuestion/lifecycle"),
2716
+ threadId: z16.string()
2171
2717
  }).merge(systemUserQuestionLifecycleEventDataSchema),
2172
- z15.object({
2173
- type: z15.literal("system/thread-provisioning"),
2174
- threadId: z15.string()
2718
+ z16.object({
2719
+ type: z16.literal("system/thread-provisioning"),
2720
+ threadId: z16.string()
2175
2721
  }).merge(systemThreadProvisioningEventDataSchema),
2176
- z15.object({
2177
- type: z15.literal("system/provider-turn-watchdog"),
2178
- threadId: z15.string()
2722
+ z16.object({
2723
+ type: z16.literal("system/provider-turn-watchdog"),
2724
+ threadId: z16.string()
2179
2725
  }).merge(systemProviderTurnWatchdogEventDataSchema)
2180
2726
  ]);
2181
2727
  var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
@@ -2183,13 +2729,13 @@ var legacyClientRequestKey = ["clientRequest", "Sequence"].join("");
2183
2729
  function isEventPropertyBag(value) {
2184
2730
  return typeof value === "object" && value !== null && !Array.isArray(value);
2185
2731
  }
2186
- var rejectLegacyClientRequestSequenceSchema = z15.unknown().superRefine((value, ctx) => {
2732
+ var rejectLegacyClientRequestSequenceSchema = z16.unknown().superRefine((value, ctx) => {
2187
2733
  if (!isEventPropertyBag(value)) {
2188
2734
  return;
2189
2735
  }
2190
2736
  if (Object.hasOwn(value, legacyClientRequestKey)) {
2191
2737
  ctx.addIssue({
2192
- code: z15.ZodIssueCode.custom,
2738
+ code: z16.ZodIssueCode.custom,
2193
2739
  message: "legacy request sequence field is no longer accepted",
2194
2740
  path: [legacyClientRequestKey]
2195
2741
  });
@@ -2197,21 +2743,21 @@ var rejectLegacyClientRequestSequenceSchema = z15.unknown().superRefine((value,
2197
2743
  const item = value.item;
2198
2744
  if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
2199
2745
  ctx.addIssue({
2200
- code: z15.ZodIssueCode.custom,
2746
+ code: z16.ZodIssueCode.custom,
2201
2747
  message: "legacy user-message request sequence field is no longer accepted",
2202
2748
  path: ["item", legacyClientRequestKey]
2203
2749
  });
2204
2750
  }
2205
2751
  });
2206
2752
  var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
2207
- z15.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
2753
+ z16.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
2208
2754
  const result = validateThreadEventScope({
2209
2755
  type: event.type,
2210
2756
  scope: event.scope
2211
2757
  });
2212
2758
  if (!result.valid) {
2213
2759
  ctx.addIssue({
2214
- code: z15.ZodIssueCode.custom,
2760
+ code: z16.ZodIssueCode.custom,
2215
2761
  message: result.message ?? "Invalid thread event scope",
2216
2762
  path: ["scope"]
2217
2763
  });
@@ -2224,101 +2770,102 @@ var threadEventTypeValues = [
2224
2770
  ...systemEventTypeValues
2225
2771
  ];
2226
2772
  var threadEventTypeSet = new Set(threadEventTypeValues);
2227
- var threadEventTypeSchema = z15.string().refine(
2773
+ var threadEventTypeSchema = z16.string().refine(
2228
2774
  (value) => threadEventTypeSet.has(value),
2229
2775
  "Invalid thread event type"
2230
2776
  );
2231
2777
 
2232
2778
  // ../domain/src/provider-fork.ts
2233
- import { z as z16 } from "zod";
2779
+ import { z as z17 } from "zod";
2234
2780
  var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
2235
- var providerForkSchema = z16.enum(PROVIDER_FORK_VALUES);
2781
+ var providerForkSchema = z17.enum(PROVIDER_FORK_VALUES);
2236
2782
 
2237
2783
  // ../domain/src/provider-types.ts
2238
- import { z as z17 } from "zod";
2239
- var modelReasoningEffortSchema = z17.object({
2784
+ import { z as z18 } from "zod";
2785
+ var modelReasoningEffortSchema = z18.object({
2240
2786
  reasoningEffort: reasoningLevelSchema,
2241
- description: z17.string()
2242
- });
2243
- var availableModelSchema = z17.object({
2244
- id: z17.string(),
2245
- model: z17.string(),
2246
- displayName: z17.string(),
2247
- routeProviderId: z17.string().min(1).optional(),
2248
- description: z17.string(),
2249
- supportedReasoningEfforts: z17.array(modelReasoningEffortSchema),
2787
+ description: z18.string()
2788
+ });
2789
+ var availableModelSchema = z18.object({
2790
+ id: z18.string(),
2791
+ model: z18.string(),
2792
+ displayName: z18.string(),
2793
+ routeProviderId: z18.string().min(1).optional(),
2794
+ description: z18.string(),
2795
+ supportedReasoningEfforts: z18.array(modelReasoningEffortSchema),
2250
2796
  defaultReasoningEffort: reasoningLevelSchema,
2251
- isDefault: z17.boolean()
2252
- });
2253
- var providerModelCatalogScopeSchema = z17.enum(["host", "workspace"]);
2254
- var providerCapabilitiesSchema = z17.object({
2255
- supportsThreadArchive: z17.boolean(),
2256
- supportsThreadRename: z17.boolean(),
2257
- supportsServiceTier: z17.boolean(),
2258
- supportsNativeUserQuestion: z17.boolean(),
2259
- supportsFork: z17.boolean(),
2260
- supportsSessionRewind: z17.boolean(),
2261
- permissionModes: z17.array(permissionModeSchema).min(1),
2797
+ isDefault: z18.boolean()
2798
+ });
2799
+ var providerModelCatalogScopeSchema = z18.enum(["host", "workspace"]);
2800
+ var providerCapabilitiesSchema = z18.object({
2801
+ supportsThreadArchive: z18.boolean(),
2802
+ supportsThreadRename: z18.boolean(),
2803
+ supportsServiceTier: z18.boolean(),
2804
+ supportsNativeUserQuestion: z18.boolean(),
2805
+ supportsFork: z18.boolean(),
2806
+ supportsSessionRewind: z18.boolean(),
2807
+ permissionModes: z18.array(permissionModeSchema).min(1),
2262
2808
  modelCatalogScope: providerModelCatalogScopeSchema
2263
2809
  });
2264
- var providerComposerCommandSchema = z17.object({
2810
+ var providerComposerCommandSchema = z18.object({
2265
2811
  trigger: promptMentionCommandTriggerSchema,
2266
- name: z17.string().min(1).regex(/^[^\s/$]+$/u),
2267
- trailingText: z17.string().regex(/^\s*$/u)
2812
+ name: z18.string().min(1).regex(/^[^\s/$]+$/u),
2813
+ trailingText: z18.string().regex(/^\s*$/u)
2268
2814
  });
2269
- var providerComposerActionSchema = z17.discriminatedUnion("kind", [
2270
- z17.object({
2271
- kind: z17.literal("skills"),
2815
+ var providerComposerActionSchema = z18.discriminatedUnion("kind", [
2816
+ z18.object({
2817
+ kind: z18.literal("skills"),
2272
2818
  trigger: promptMentionCommandTriggerSchema
2273
2819
  }),
2274
- z17.object({
2275
- kind: z17.literal("plan"),
2820
+ z18.object({
2821
+ kind: z18.literal("plan"),
2276
2822
  command: providerComposerCommandSchema
2277
2823
  }),
2278
- z17.object({
2279
- kind: z17.literal("goal"),
2824
+ z18.object({
2825
+ kind: z18.literal("goal"),
2280
2826
  command: providerComposerCommandSchema
2281
2827
  })
2282
2828
  ]);
2283
- var providerStringsSchema = z17.object({
2284
- signInHint: z17.string().min(1),
2285
- expiredHint: z17.string().min(1),
2286
- installUrl: z17.string().min(1),
2287
- brandPrefix: z17.string().min(1).optional(),
2288
- planModeCopy: z17.string().min(1).optional(),
2289
- iconTint: z17.object({ light: z17.string().min(1), dark: z17.string().min(1) }).optional()
2290
- });
2291
- var providerOptionDescriptorSchema = z17.object({
2292
- id: z17.string().min(1),
2293
- label: z17.string().min(1),
2294
- description: z17.string().min(1).optional()
2295
- });
2296
- var providerExtensionKindInfoSchema = z17.object({
2297
- item: z17.boolean(),
2298
- state: z17.boolean()
2299
- });
2300
- var providerExtensionKindsSchema = z17.record(
2829
+ var providerStringsSchema = z18.object({
2830
+ signInHint: z18.string().min(1),
2831
+ expiredHint: z18.string().min(1),
2832
+ installUrl: z18.string().min(1),
2833
+ brandPrefix: z18.string().min(1).optional(),
2834
+ planModeCopy: z18.string().min(1).optional(),
2835
+ iconTint: z18.object({ light: z18.string().min(1), dark: z18.string().min(1) }).optional()
2836
+ });
2837
+ var providerOptionDescriptorSchema = z18.object({
2838
+ id: z18.string().min(1),
2839
+ label: z18.string().min(1),
2840
+ description: z18.string().min(1).optional()
2841
+ });
2842
+ var providerExtensionKindInfoSchema = z18.object({
2843
+ item: z18.boolean(),
2844
+ state: z18.boolean()
2845
+ });
2846
+ var providerExtensionKindsSchema = z18.record(
2301
2847
  extensionKindSchema,
2302
2848
  providerExtensionKindInfoSchema
2303
2849
  );
2304
- var providerInfoSchema = z17.object({
2305
- id: z17.string(),
2306
- pluginId: z17.string().min(1),
2307
- displayName: z17.string(),
2308
- family: z17.string().min(1).optional(),
2309
- icon: z17.object({ glyph: z17.string().min(1) }).optional(),
2310
- logoUrl: z17.string().min(1).nullable(),
2311
- maintenance: z17.object({
2312
- health: z17.boolean(),
2313
- usage: z17.boolean(),
2314
- installation: z17.boolean()
2850
+ var providerInfoSchema = z18.object({
2851
+ id: z18.string(),
2852
+ pluginId: z18.string().min(1),
2853
+ displayName: z18.string(),
2854
+ family: z18.string().min(1).optional(),
2855
+ icon: z18.object({ glyph: z18.string().min(1) }).optional(),
2856
+ logoUrl: z18.string().min(1).nullable(),
2857
+ maintenance: z18.object({
2858
+ health: z18.boolean(),
2859
+ usage: z18.boolean(),
2860
+ installation: z18.boolean()
2315
2861
  }),
2316
2862
  capabilities: providerCapabilitiesSchema,
2317
- composerActions: z17.array(providerComposerActionSchema),
2318
- available: z17.boolean(),
2863
+ composerActions: z18.array(providerComposerActionSchema),
2864
+ completedTurnDisplay: completedTurnDisplaySchema,
2865
+ available: z18.boolean(),
2319
2866
  strings: providerStringsSchema.optional(),
2320
- serviceTiers: z17.array(providerOptionDescriptorSchema).optional(),
2321
- reasoningLevels: z17.array(providerOptionDescriptorSchema).optional(),
2867
+ serviceTiers: z18.array(providerOptionDescriptorSchema).optional(),
2868
+ reasoningLevels: z18.array(providerOptionDescriptorSchema).optional(),
2322
2869
  extensionKinds: providerExtensionKindsSchema.optional()
2323
2870
  });
2324
2871
  var providerRecoveryKindValues = [
@@ -2328,34 +2875,34 @@ var providerRecoveryKindValues = [
2328
2875
  "staleTurn",
2329
2876
  "rateLimited"
2330
2877
  ];
2331
- var providerRecoveryKindSchema = z17.enum(providerRecoveryKindValues);
2332
- var toolCallOutputItemSchema = z17.discriminatedUnion("type", [
2333
- z17.object({
2334
- type: z17.literal("inputText"),
2335
- text: z17.string()
2878
+ var providerRecoveryKindSchema = z18.enum(providerRecoveryKindValues);
2879
+ var toolCallOutputItemSchema = z18.discriminatedUnion("type", [
2880
+ z18.object({
2881
+ type: z18.literal("inputText"),
2882
+ text: z18.string()
2336
2883
  }),
2337
- z17.object({
2338
- type: z17.literal("inputImage"),
2339
- imageUrl: z17.string()
2884
+ z18.object({
2885
+ type: z18.literal("inputImage"),
2886
+ imageUrl: z18.string()
2340
2887
  })
2341
2888
  ]);
2342
- var toolCallRequestSchema = z17.object({
2343
- requestId: z17.union([z17.string().min(1), z17.number()]),
2344
- threadId: z17.string().min(1),
2345
- providerThreadId: z17.string().min(1),
2346
- turnId: z17.string().min(1),
2347
- callId: z17.string().min(1),
2348
- tool: z17.string().min(1),
2349
- arguments: z17.unknown().optional()
2350
- });
2351
- var toolCallResponseSchema = z17.object({
2352
- contentItems: z17.array(toolCallOutputItemSchema),
2353
- success: z17.boolean()
2354
- });
2355
- var dynamicToolSchema = z17.object({
2356
- name: z17.string(),
2357
- description: z17.string(),
2358
- inputSchema: z17.unknown(),
2889
+ var toolCallRequestSchema = z18.object({
2890
+ requestId: z18.union([z18.string().min(1), z18.number()]),
2891
+ threadId: z18.string().min(1),
2892
+ providerThreadId: z18.string().min(1),
2893
+ turnId: z18.string().min(1),
2894
+ callId: z18.string().min(1),
2895
+ tool: z18.string().min(1),
2896
+ arguments: z18.unknown().optional()
2897
+ });
2898
+ var toolCallResponseSchema = z18.object({
2899
+ contentItems: z18.array(toolCallOutputItemSchema),
2900
+ success: z18.boolean()
2901
+ });
2902
+ var dynamicToolSchema = z18.object({
2903
+ name: z18.string(),
2904
+ description: z18.string(),
2905
+ inputSchema: z18.unknown(),
2359
2906
  presentation: threadEventItemPresentationSchema.optional()
2360
2907
  });
2361
2908
 
@@ -2407,10 +2954,10 @@ function reasoningEffortsForLevels(levels) {
2407
2954
  }
2408
2955
 
2409
2956
  // ../provider-bridge-acp/src/launch-spec.ts
2410
- import { z as z18 } from "zod";
2411
- var acpNativeSkillRootsSchema = z18.object({
2412
- user: z18.array(providerNativeRootInputSchema).default([]),
2413
- project: z18.array(providerNativeRootInputSchema).default([])
2957
+ import { z as z19 } from "zod";
2958
+ var acpNativeSkillRootsSchema = z19.object({
2959
+ user: z19.array(providerNativeRootInputSchema).default([]),
2960
+ project: z19.array(providerNativeRootInputSchema).default([])
2414
2961
  }).strict().superRefine((roots, context) => {
2415
2962
  const normalized = providerNativeRootsSchema.safeParse(
2416
2963
  normalizeProviderNativeRoots(roots)
@@ -2426,16 +2973,16 @@ var acpNativeSkillRootsSchema = z18.object({
2426
2973
  });
2427
2974
  }
2428
2975
  });
2429
- var acpLaunchSpecSchema = z18.object({
2430
- displayName: z18.string().min(1),
2431
- command: z18.string().min(1),
2432
- args: z18.array(z18.string()),
2433
- env: z18.record(z18.string().min(1), z18.string()),
2434
- cwd: z18.string().min(1).optional(),
2435
- modelCli: z18.object({
2436
- listArgs: z18.array(z18.string()),
2437
- selectFlag: z18.string().min(1).optional(),
2438
- primaryModels: z18.array(z18.string())
2976
+ var acpLaunchSpecSchema = z19.object({
2977
+ displayName: z19.string().min(1),
2978
+ command: z19.string().min(1),
2979
+ args: z19.array(z19.string()),
2980
+ env: z19.record(z19.string().min(1), z19.string()),
2981
+ cwd: z19.string().min(1).optional(),
2982
+ modelCli: z19.object({
2983
+ listArgs: z19.array(z19.string()),
2984
+ selectFlag: z19.string().min(1).optional(),
2985
+ primaryModels: z19.array(z19.string())
2439
2986
  }).strict().transform(
2440
2987
  (modelCli) => modelCli.listArgs.length > 0 ? modelCli : void 0
2441
2988
  ).optional(),
@@ -2450,66 +2997,66 @@ var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
2450
2997
  var THREAD_DELTA_GRAMMAR_V3 = 3;
2451
2998
 
2452
2999
  // ../provider-bridge-protocol/src/handshake.ts
2453
- import { z as z19 } from "zod";
2454
- var bridgeGrammarVersionsSchema = z19.tuple([z19.number().int().positive(), z19.number().int().positive()]).refine(([min, max]) => min <= max, {
3000
+ import { z as z20 } from "zod";
3001
+ var bridgeGrammarVersionsSchema = z20.tuple([z20.number().int().positive(), z20.number().int().positive()]).refine(([min, max]) => min <= max, {
2455
3002
  message: "grammarVersions must be an ascending [min, max] range"
2456
3003
  });
2457
- var bridgeSteerModeSchema = z19.enum(["inject", "queue"]);
2458
- var bridgeCapabilitiesSchema = z19.object({
2459
- sessionRestore: z19.boolean().default(false),
2460
- threadArchive: z19.boolean().default(false),
2461
- threadRename: z19.boolean().default(false),
2462
- threadGoalClear: z19.boolean().default(false),
3004
+ var bridgeSteerModeSchema = z20.enum(["inject", "queue"]);
3005
+ var bridgeCapabilitiesSchema = z20.object({
3006
+ sessionRestore: z20.boolean().default(false),
3007
+ threadArchive: z20.boolean().default(false),
3008
+ threadRename: z20.boolean().default(false),
3009
+ threadGoalClear: z20.boolean().default(false),
2463
3010
  fork: providerForkSchema.default("none"),
2464
- approvalEnforcedBy: z19.enum(["runtime", "provider"]).default("runtime"),
3011
+ approvalEnforcedBy: z20.enum(["runtime", "provider"]).default("runtime"),
2465
3012
  grammarVersions: bridgeGrammarVersionsSchema.default([
2466
3013
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
2467
3014
  PROVIDER_BRIDGE_PROTOCOL_VERSION
2468
3015
  ]),
2469
3016
  steerMode: bridgeSteerModeSchema.default("queue"),
2470
- skills: z19.object({ configure: z19.boolean().default(false) }).default({ configure: false })
3017
+ skills: z20.object({ configure: z20.boolean().default(false) }).default({ configure: false })
2471
3018
  }).passthrough();
2472
- var initializeParamsSchema = z19.object({
2473
- protocolVersion: z19.number().int().positive(),
2474
- client: z19.object({ name: z19.string().min(1), version: z19.string().min(1) }),
3019
+ var initializeParamsSchema = z20.object({
3020
+ protocolVersion: z20.number().int().positive(),
3021
+ client: z20.object({ name: z20.string().min(1), version: z20.string().min(1) }),
2475
3022
  grammarVersions: bridgeGrammarVersionsSchema.default([
2476
3023
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
2477
3024
  PROVIDER_BRIDGE_PROTOCOL_VERSION
2478
3025
  ])
2479
3026
  }).passthrough();
2480
- var initializeResultSchema = z19.object({
2481
- protocolVersion: z19.number().int().positive(),
2482
- capabilities: z19.preprocess(
3027
+ var initializeResultSchema = z20.object({
3028
+ protocolVersion: z20.number().int().positive(),
3029
+ capabilities: z20.preprocess(
2483
3030
  (value) => value ?? {},
2484
3031
  bridgeCapabilitiesSchema
2485
3032
  )
2486
3033
  }).passthrough();
2487
3034
 
2488
3035
  // ../provider-bridge-protocol/src/execution-options.ts
2489
- import { z as z20 } from "zod";
2490
- var bridgeExecutionOptionsSchema = z20.object({
2491
- model: z20.string().min(1).optional(),
3036
+ import { z as z21 } from "zod";
3037
+ var bridgeExecutionOptionsSchema = z21.object({
3038
+ model: z21.string().min(1).optional(),
2492
3039
  serviceTier: serviceTierSchema.optional(),
2493
3040
  reasoningLevel: reasoningLevelSchema.optional(),
2494
3041
  promptMode: promptModeSchema.optional(),
2495
- instructions: z20.string().optional(),
2496
- envVars: z20.record(z20.string(), z20.string()).optional(),
2497
- providerOptions: z20.record(z20.string(), z20.unknown()).optional()
3042
+ instructions: z21.string().optional(),
3043
+ envVars: z21.record(z21.string(), z21.string()).optional(),
3044
+ providerOptions: z21.record(z21.string(), z21.unknown()).optional()
2498
3045
  }).and(runtimePermissionPolicySchema);
2499
3046
 
2500
3047
  // ../provider-bridge-protocol/src/provider-maintenance.ts
2501
- import { z as z21 } from "zod";
2502
- var providerMaintenanceParamsSchema = z21.object({
2503
- providerId: z21.string().min(1),
2504
- cwd: z21.string().min(1).optional(),
2505
- providerOptions: z21.record(z21.string(), z21.unknown()).optional()
3048
+ import { z as z22 } from "zod";
3049
+ var providerMaintenanceParamsSchema = z22.object({
3050
+ providerId: z22.string().min(1),
3051
+ cwd: z22.string().min(1).optional(),
3052
+ providerOptions: z22.record(z22.string(), z22.unknown()).optional()
2506
3053
  }).passthrough();
2507
- var providerInstallationRequirementSchema = z21.enum(["thread_rewind"]);
3054
+ var providerInstallationRequirementSchema = z22.enum(["thread_rewind"]);
2508
3055
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
2509
3056
  requirement: providerInstallationRequirementSchema.optional()
2510
3057
  });
2511
- var providerHealthSchema = z21.object({
2512
- status: z21.enum([
3058
+ var providerHealthSchema = z22.object({
3059
+ status: z22.enum([
2513
3060
  "ready",
2514
3061
  "not_installed",
2515
3062
  "unauthenticated",
@@ -2517,114 +3064,114 @@ var providerHealthSchema = z21.object({
2517
3064
  "unsupported_version",
2518
3065
  "unknown"
2519
3066
  ]),
2520
- statusMessage: z21.string().min(1).nullable(),
2521
- accountEmail: z21.string().nullable(),
2522
- planLabel: z21.string().min(1).nullable(),
2523
- installedVersion: z21.string().min(1).nullable(),
2524
- minimumSupportedVersion: z21.string().min(1).nullable(),
2525
- canInstall: z21.boolean(),
2526
- canUpdate: z21.boolean(),
2527
- loginCommand: z21.string().min(1).nullable()
3067
+ statusMessage: z22.string().min(1).nullable(),
3068
+ accountEmail: z22.string().nullable(),
3069
+ planLabel: z22.string().min(1).nullable(),
3070
+ installedVersion: z22.string().min(1).nullable(),
3071
+ minimumSupportedVersion: z22.string().min(1).nullable(),
3072
+ canInstall: z22.boolean(),
3073
+ canUpdate: z22.boolean(),
3074
+ loginCommand: z22.string().min(1).nullable()
2528
3075
  }).passthrough();
2529
- var providerUsageWindowSchema = z21.object({
2530
- label: z21.string().min(1),
2531
- usedPercent: z21.number().min(0).max(100),
2532
- resetsAt: z21.string().min(1).nullable(),
2533
- cost: z21.object({
2534
- usedUsdCents: z21.number().int().nonnegative(),
2535
- limitUsdCents: z21.number().int().positive()
3076
+ var providerUsageWindowSchema = z22.object({
3077
+ label: z22.string().min(1),
3078
+ usedPercent: z22.number().min(0).max(100),
3079
+ resetsAt: z22.string().min(1).nullable(),
3080
+ cost: z22.object({
3081
+ usedUsdCents: z22.number().int().nonnegative(),
3082
+ limitUsdCents: z22.number().int().positive()
2536
3083
  }).optional()
2537
3084
  }).passthrough();
2538
- var providerUsageSchema = z21.discriminatedUnion("status", [
2539
- z21.object({
2540
- status: z21.literal("ok"),
2541
- accountEmail: z21.string().email().nullable(),
2542
- planLabel: z21.string().min(1).nullable(),
2543
- windows: z21.array(providerUsageWindowSchema)
3085
+ var providerUsageSchema = z22.discriminatedUnion("status", [
3086
+ z22.object({
3087
+ status: z22.literal("ok"),
3088
+ accountEmail: z22.string().email().nullable(),
3089
+ planLabel: z22.string().min(1).nullable(),
3090
+ windows: z22.array(providerUsageWindowSchema)
2544
3091
  }).passthrough(),
2545
- z21.object({ status: z21.literal("not_installed") }).passthrough(),
2546
- z21.object({ status: z21.literal("unauthenticated") }).passthrough(),
2547
- z21.object({ status: z21.literal("expired") }).passthrough(),
2548
- z21.object({
2549
- status: z21.literal("error"),
2550
- message: z21.string().min(1),
2551
- planLabel: z21.string().min(1).nullable().default(null),
2552
- accountEmail: z21.string().nullable().default(null)
3092
+ z22.object({ status: z22.literal("not_installed") }).passthrough(),
3093
+ z22.object({ status: z22.literal("unauthenticated") }).passthrough(),
3094
+ z22.object({ status: z22.literal("expired") }).passthrough(),
3095
+ z22.object({
3096
+ status: z22.literal("error"),
3097
+ message: z22.string().min(1),
3098
+ planLabel: z22.string().min(1).nullable().default(null),
3099
+ accountEmail: z22.string().nullable().default(null)
2553
3100
  }).passthrough()
2554
3101
  ]);
2555
- var providerHealthResultSchema = z21.discriminatedUnion("supported", [
2556
- z21.object({ supported: z21.literal(false) }).passthrough(),
2557
- z21.object({
2558
- supported: z21.literal(true),
3102
+ var providerHealthResultSchema = z22.discriminatedUnion("supported", [
3103
+ z22.object({ supported: z22.literal(false) }).passthrough(),
3104
+ z22.object({
3105
+ supported: z22.literal(true),
2559
3106
  health: providerHealthSchema
2560
3107
  }).passthrough()
2561
3108
  ]);
2562
- var providerUsageResultSchema = z21.discriminatedUnion("supported", [
2563
- z21.object({ supported: z21.literal(false) }).passthrough(),
2564
- z21.object({
2565
- supported: z21.literal(true),
3109
+ var providerUsageResultSchema = z22.discriminatedUnion("supported", [
3110
+ z22.object({ supported: z22.literal(false) }).passthrough(),
3111
+ z22.object({
3112
+ supported: z22.literal(true),
2566
3113
  usage: providerUsageSchema
2567
3114
  }).passthrough()
2568
3115
  ]);
2569
- var providerInstallationActionKindSchema = z21.enum([
3116
+ var providerInstallationActionKindSchema = z22.enum([
2570
3117
  "install",
2571
3118
  "update"
2572
3119
  ]);
2573
- var providerInstallationActionSchema = z21.object({
3120
+ var providerInstallationActionSchema = z22.object({
2574
3121
  kind: providerInstallationActionKindSchema,
2575
- label: z21.enum(["Install", "Update"]),
2576
- command: z21.string().min(1)
3122
+ label: z22.enum(["Install", "Update"]),
3123
+ command: z22.string().min(1)
2577
3124
  }).passthrough();
2578
- var providerInstallationSourceSchema = z21.enum([
3125
+ var providerInstallationSourceSchema = z22.enum([
2579
3126
  "notInstalled",
2580
3127
  "npmGlobal",
2581
3128
  "external"
2582
3129
  ]);
2583
- var providerInstallationStatusSchema = z21.object({
2584
- executableName: z21.string().min(1),
2585
- executablePath: z21.string().min(1).nullable(),
2586
- installed: z21.boolean(),
3130
+ var providerInstallationStatusSchema = z22.object({
3131
+ executableName: z22.string().min(1),
3132
+ executablePath: z22.string().min(1).nullable(),
3133
+ installed: z22.boolean(),
2587
3134
  installSource: providerInstallationSourceSchema,
2588
- currentVersion: z21.string().min(1).nullable(),
2589
- latestVersion: z21.string().min(1).nullable(),
2590
- minimumSupportedVersion: z21.string().min(1).nullable(),
2591
- npmPackageName: z21.string().min(1).nullable(),
2592
- npmGlobalPackageVersion: z21.string().min(1).nullable(),
3135
+ currentVersion: z22.string().min(1).nullable(),
3136
+ latestVersion: z22.string().min(1).nullable(),
3137
+ minimumSupportedVersion: z22.string().min(1).nullable(),
3138
+ npmPackageName: z22.string().min(1).nullable(),
3139
+ npmGlobalPackageVersion: z22.string().min(1).nullable(),
2593
3140
  installAction: providerInstallationActionSchema.nullable(),
2594
- needsUpdate: z21.boolean(),
2595
- versionUnsupported: z21.boolean()
3141
+ needsUpdate: z22.boolean(),
3142
+ versionUnsupported: z22.boolean()
2596
3143
  }).passthrough();
2597
3144
  var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
2598
3145
  action: providerInstallationActionKindSchema
2599
3146
  });
2600
- var providerInstallationCommandSchema = z21.object({
2601
- command: z21.string().min(1),
2602
- args: z21.array(z21.string()).max(64),
2603
- displayCommand: z21.string().min(1)
3147
+ var providerInstallationCommandSchema = z22.object({
3148
+ command: z22.string().min(1),
3149
+ args: z22.array(z22.string()).max(64),
3150
+ displayCommand: z22.string().min(1)
2604
3151
  }).passthrough();
2605
- var providerInstallationVerificationSchema = z21.discriminatedUnion(
3152
+ var providerInstallationVerificationSchema = z22.discriminatedUnion(
2606
3153
  "kind",
2607
3154
  [
2608
- z21.object({ kind: z21.literal("installed") }).passthrough(),
2609
- z21.object({
2610
- kind: z21.literal("version_changed"),
2611
- previousVersion: z21.string().min(1)
3155
+ z22.object({ kind: z22.literal("installed") }).passthrough(),
3156
+ z22.object({
3157
+ kind: z22.literal("version_changed"),
3158
+ previousVersion: z22.string().min(1)
2612
3159
  }).passthrough(),
2613
- z21.object({
2614
- kind: z21.literal("version_at_least"),
2615
- version: z21.string().min(1)
3160
+ z22.object({
3161
+ kind: z22.literal("version_at_least"),
3162
+ version: z22.string().min(1)
2616
3163
  }).passthrough()
2617
3164
  ]
2618
3165
  );
2619
- var providerInstallationRunResultSchema = z21.discriminatedUnion(
3166
+ var providerInstallationRunResultSchema = z22.discriminatedUnion(
2620
3167
  "available",
2621
3168
  [
2622
- z21.object({
2623
- available: z21.literal(false),
2624
- message: z21.string().min(1)
3169
+ z22.object({
3170
+ available: z22.literal(false),
3171
+ message: z22.string().min(1)
2625
3172
  }).passthrough(),
2626
- z21.object({
2627
- available: z21.literal(true),
3173
+ z22.object({
3174
+ available: z22.literal(true),
2628
3175
  command: providerInstallationCommandSchema,
2629
3176
  verification: providerInstallationVerificationSchema
2630
3177
  }).passthrough()
@@ -2632,80 +3179,80 @@ var providerInstallationRunResultSchema = z21.discriminatedUnion(
2632
3179
  );
2633
3180
 
2634
3181
  // ../provider-bridge-protocol/src/requests.ts
2635
- import { z as z22 } from "zod";
3182
+ import { z as z23 } from "zod";
2636
3183
  var sessionConstructionFields = {
2637
- threadId: z22.string().min(1),
2638
- cwd: z22.string().min(1),
3184
+ threadId: z23.string().min(1),
3185
+ cwd: z23.string().min(1),
2639
3186
  options: bridgeExecutionOptionsSchema,
2640
- dynamicTools: z22.array(dynamicToolSchema).optional(),
2641
- disallowedTools: z22.array(z22.string().min(1)).optional(),
3187
+ dynamicTools: z23.array(dynamicToolSchema).optional(),
3188
+ disallowedTools: z23.array(z23.string().min(1)).optional(),
2642
3189
  instructionMode: instructionModeSchema
2643
3190
  };
2644
- var modelListParamsSchema = z22.object({ cwd: z22.string().min(1).optional() }).passthrough();
2645
- var threadStartParamsSchema = z22.object({
3191
+ var modelListParamsSchema = z23.object({ cwd: z23.string().min(1).optional() }).passthrough();
3192
+ var threadStartParamsSchema = z23.object({
2646
3193
  ...sessionConstructionFields,
2647
- input: z22.array(promptInputSchema).optional()
3194
+ input: z23.array(promptInputSchema).optional()
2648
3195
  }).passthrough();
2649
- var threadResumeParamsSchema = z22.object({
3196
+ var threadResumeParamsSchema = z23.object({
2650
3197
  ...sessionConstructionFields,
2651
- providerThreadId: z22.string().min(1)
3198
+ providerThreadId: z23.string().min(1)
2652
3199
  }).passthrough();
2653
- var threadForkParamsSchema = z22.object({
3200
+ var threadForkParamsSchema = z23.object({
2654
3201
  ...sessionConstructionFields,
2655
- sourceProviderThreadId: z22.string().min(1),
2656
- sourceProviderCheckpointId: z22.string().min(1).optional()
3202
+ sourceProviderThreadId: z23.string().min(1),
3203
+ sourceProviderCheckpointId: z23.string().min(1).optional()
2657
3204
  }).passthrough();
2658
- var threadStopParamsSchema = z22.object({
2659
- threadId: z22.string().min(1),
2660
- providerThreadId: z22.string().min(1),
2661
- intent: z22.enum(["interrupt", "release"]),
2662
- activeTurnId: z22.string().min(1).nullable()
3205
+ var threadStopParamsSchema = z23.object({
3206
+ threadId: z23.string().min(1),
3207
+ providerThreadId: z23.string().min(1),
3208
+ intent: z23.enum(["interrupt", "release"]),
3209
+ activeTurnId: z23.string().min(1).nullable()
2663
3210
  }).passthrough();
2664
- var threadRefParams = z22.object({
2665
- threadId: z22.string().min(1),
2666
- providerThreadId: z22.string().min(1)
3211
+ var threadRefParams = z23.object({
3212
+ threadId: z23.string().min(1),
3213
+ providerThreadId: z23.string().min(1)
2667
3214
  }).passthrough();
2668
3215
  var threadDiscardParamsSchema = threadRefParams;
2669
- var threadNameSetParamsSchema = z22.object({
2670
- threadId: z22.string().min(1),
2671
- providerThreadId: z22.string().min(1),
2672
- title: z22.string().min(1)
3216
+ var threadNameSetParamsSchema = z23.object({
3217
+ threadId: z23.string().min(1),
3218
+ providerThreadId: z23.string().min(1),
3219
+ title: z23.string().min(1)
2673
3220
  }).passthrough();
2674
3221
  var turnInputFields = {
2675
- threadId: z22.string().min(1),
2676
- providerThreadId: z22.string().min(1),
2677
- input: z22.array(promptInputSchema),
3222
+ threadId: z23.string().min(1),
3223
+ providerThreadId: z23.string().min(1),
3224
+ input: z23.array(promptInputSchema),
2678
3225
  clientRequestId: clientTurnRequestIdSchema,
2679
3226
  options: bridgeExecutionOptionsSchema
2680
3227
  };
2681
- var turnStartParamsSchema = z22.object(turnInputFields).passthrough();
2682
- var turnSteerParamsSchema = z22.object({
3228
+ var turnStartParamsSchema = z23.object(turnInputFields).passthrough();
3229
+ var turnSteerParamsSchema = z23.object({
2683
3230
  ...turnInputFields,
2684
- expectedTurnId: z22.string().min(1)
3231
+ expectedTurnId: z23.string().min(1)
2685
3232
  }).passthrough();
2686
- var skillsConfigureRootSchema = z22.object({
2687
- id: z22.string().min(1),
2688
- path: z22.string().min(1),
2689
- skills: z22.array(
2690
- z22.object({
2691
- name: z22.string().min(1),
2692
- description: z22.string()
3233
+ var skillsConfigureRootSchema = z23.object({
3234
+ id: z23.string().min(1),
3235
+ path: z23.string().min(1),
3236
+ skills: z23.array(
3237
+ z23.object({
3238
+ name: z23.string().min(1),
3239
+ description: z23.string()
2693
3240
  }).passthrough()
2694
3241
  )
2695
3242
  }).passthrough();
2696
- var skillsConfigureParamsSchema = z22.object({
2697
- roots: z22.array(skillsConfigureRootSchema)
3243
+ var skillsConfigureParamsSchema = z23.object({
3244
+ roots: z23.array(skillsConfigureRootSchema)
2698
3245
  }).passthrough();
2699
- var threadIdentityResultSchema = z22.object({
2700
- providerThreadId: z22.string().min(1),
2701
- sessionRestorable: z22.boolean().optional()
3246
+ var threadIdentityResultSchema = z23.object({
3247
+ providerThreadId: z23.string().min(1),
3248
+ sessionRestorable: z23.boolean().optional()
2702
3249
  }).passthrough();
2703
3250
 
2704
3251
  // ../provider-bridge-protocol/src/notifications.ts
2705
- import { z as z24 } from "zod";
3252
+ import { z as z25 } from "zod";
2706
3253
 
2707
3254
  // ../provider-bridge-protocol/src/errors.ts
2708
- import { z as z23 } from "zod";
3255
+ import { z as z24 } from "zod";
2709
3256
  var BRIDGE_JSON_RPC_ERRORS = {
2710
3257
  INVALID_PARAMS: -32602,
2711
3258
  METHOD_NOT_FOUND: -32601,
@@ -2714,12 +3261,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
2714
3261
  SESSION_NOT_RESTORABLE: -32002,
2715
3262
  FORK_CHECKPOINT_UNSUPPORTED: -32003
2716
3263
  };
2717
- var providerRecoveryHintSchema = z23.object({
3264
+ var providerRecoveryHintSchema = z24.object({
2718
3265
  kind: providerRecoveryKindSchema,
2719
- message: z23.string().min(1),
2720
- retryable: z23.boolean()
3266
+ message: z24.string().min(1),
3267
+ retryable: z24.boolean()
2721
3268
  });
2722
- var bridgeErrorDataSchema = z23.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
3269
+ var bridgeErrorDataSchema = z24.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
2723
3270
 
2724
3271
  // ../provider-bridge-protocol/src/notifications.ts
2725
3272
  var BRIDGE_NOTIFICATION_METHODS = {
@@ -2729,177 +3276,177 @@ var BRIDGE_NOTIFICATION_METHODS = {
2729
3276
  providerRecovery: "provider/recovery",
2730
3277
  error: "error"
2731
3278
  };
2732
- var threadIdentityNotificationSchema = z24.object({
2733
- threadId: z24.string().min(1),
2734
- providerThreadId: z24.string().min(1),
2735
- sessionRestorable: z24.boolean().optional()
3279
+ var threadIdentityNotificationSchema = z25.object({
3280
+ threadId: z25.string().min(1),
3281
+ providerThreadId: z25.string().min(1),
3282
+ sessionRestorable: z25.boolean().optional()
2736
3283
  }).passthrough();
2737
- var sessionReplacedNotificationSchema = z24.object({
2738
- threadId: z24.string().min(1),
2739
- providerThreadId: z24.string().min(1).nullable(),
2740
- reason: z24.string().min(1),
2741
- contextLost: z24.boolean().default(false),
2742
- showRuntimeNote: z24.boolean().default(false)
3284
+ var sessionReplacedNotificationSchema = z25.object({
3285
+ threadId: z25.string().min(1),
3286
+ providerThreadId: z25.string().min(1).nullable(),
3287
+ reason: z25.string().min(1),
3288
+ contextLost: z25.boolean().default(false),
3289
+ showRuntimeNote: z25.boolean().default(false)
2743
3290
  }).passthrough();
2744
- var providerRecoveryNotificationSchema = z24.object({
2745
- threadId: z24.string().min(1).optional(),
3291
+ var providerRecoveryNotificationSchema = z25.object({
3292
+ threadId: z25.string().min(1).optional(),
2746
3293
  ...providerRecoveryHintSchema.shape
2747
3294
  }).passthrough();
2748
- var errorNotificationSchema = z24.object({
2749
- threadId: z24.string().min(1).optional(),
2750
- providerThreadId: z24.string().min(1).optional(),
2751
- message: z24.string().min(1)
3295
+ var errorNotificationSchema = z25.object({
3296
+ threadId: z25.string().min(1).optional(),
3297
+ providerThreadId: z25.string().min(1).optional(),
3298
+ message: z25.string().min(1)
2752
3299
  }).passthrough();
2753
3300
 
2754
3301
  // ../provider-bridge-protocol/src/bridge-requests.ts
2755
- import { z as z25 } from "zod";
3302
+ import { z as z26 } from "zod";
2756
3303
  var BRIDGE_INBOUND_REQUEST_METHODS = {
2757
3304
  toolCall: "item/tool/call",
2758
3305
  interactionRequest: "interaction/request"
2759
3306
  };
2760
- var toolCallRequestParamsSchema = z25.object({
2761
- providerThreadId: z25.string().min(1),
2762
- threadId: z25.string().min(1).optional(),
2763
- turnId: z25.union([z25.string().min(1), z25.null()]),
2764
- callId: z25.string().min(1),
2765
- tool: z25.string().min(1),
2766
- arguments: z25.unknown(),
2767
- providerNativeIds: z25.boolean().optional()
3307
+ var toolCallRequestParamsSchema = z26.object({
3308
+ providerThreadId: z26.string().min(1),
3309
+ threadId: z26.string().min(1).optional(),
3310
+ turnId: z26.union([z26.string().min(1), z26.null()]),
3311
+ callId: z26.string().min(1),
3312
+ tool: z26.string().min(1),
3313
+ arguments: z26.unknown(),
3314
+ providerNativeIds: z26.boolean().optional()
2768
3315
  }).passthrough();
2769
- var toolCallResultSchema = z25.object({
2770
- success: z25.boolean(),
2771
- contentItems: z25.array(
2772
- z25.discriminatedUnion("type", [
2773
- z25.object({ type: z25.literal("inputText"), text: z25.string() }),
2774
- z25.object({
2775
- type: z25.literal("inputImage"),
2776
- imageUrl: z25.string().min(1)
3316
+ var toolCallResultSchema = z26.object({
3317
+ success: z26.boolean(),
3318
+ contentItems: z26.array(
3319
+ z26.discriminatedUnion("type", [
3320
+ z26.object({ type: z26.literal("inputText"), text: z26.string() }),
3321
+ z26.object({
3322
+ type: z26.literal("inputImage"),
3323
+ imageUrl: z26.string().min(1)
2777
3324
  })
2778
3325
  ])
2779
3326
  )
2780
3327
  }).passthrough();
2781
- var interactionRequestParamsSchema = z25.object({
2782
- providerThreadId: z25.string().min(1),
2783
- threadId: z25.string().min(1).optional(),
2784
- turnId: z25.union([z25.string().min(1), z25.null()]),
3328
+ var interactionRequestParamsSchema = z26.object({
3329
+ providerThreadId: z26.string().min(1),
3330
+ threadId: z26.string().min(1).optional(),
3331
+ turnId: z26.union([z26.string().min(1), z26.null()]),
2785
3332
  payload: pendingInteractionPayloadSchema,
2786
- providerNativeIds: z25.boolean().optional()
3333
+ providerNativeIds: z26.boolean().optional()
2787
3334
  }).passthrough();
2788
3335
 
2789
3336
  // ../provider-bridge-protocol/src/thread-delta.ts
2790
- import { z as z26 } from "zod";
3337
+ import { z as z27 } from "zod";
2791
3338
  var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
2792
3339
  var deltaPresentationSchema = threadEventItemPresentationSchema;
2793
3340
  var THREAD_DELTA_KEY_SEPARATOR = "";
2794
- var deltaKeyPartSchema = z26.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
3341
+ var deltaKeyPartSchema = z27.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
2795
3342
  message: "provider keys must not contain the internal key separator (\\u001f)"
2796
3343
  });
2797
- var deltaItemKeySchema = z26.object({
3344
+ var deltaItemKeySchema = z27.object({
2798
3345
  providerItemId: deltaKeyPartSchema.optional(),
2799
3346
  channel: deltaKeyPartSchema.optional(),
2800
3347
  parentRef: deltaKeyPartSchema.optional()
2801
3348
  });
2802
3349
  var providerTurnIdSchema = deltaKeyPartSchema;
2803
- var deltaFileChangeSchema = z26.object({
2804
- path: z26.string(),
2805
- kind: z26.enum(["add", "update", "delete"]),
2806
- movePath: z26.string().optional(),
2807
- diff: z26.string().optional(),
2808
- oldText: z26.string().optional(),
2809
- newText: z26.string().optional()
2810
- });
2811
- var deltaBackgroundTaskShapeSchema = z26.object({
2812
- type: z26.literal("backgroundTask"),
2813
- familyId: z26.string().min(1),
2814
- taskType: z26.string(),
2815
- description: z26.string(),
3350
+ var deltaFileChangeSchema = z27.object({
3351
+ path: z27.string(),
3352
+ kind: z27.enum(["add", "update", "delete"]),
3353
+ movePath: z27.string().optional(),
3354
+ diff: z27.string().optional(),
3355
+ oldText: z27.string().optional(),
3356
+ newText: z27.string().optional()
3357
+ });
3358
+ var deltaBackgroundTaskShapeSchema = z27.object({
3359
+ type: z27.literal("backgroundTask"),
3360
+ familyId: z27.string().min(1),
3361
+ taskType: z27.string(),
3362
+ description: z27.string(),
2816
3363
  status: threadEventItemStatusSchema,
2817
3364
  taskStatus: backgroundTaskStatusSchema,
2818
- skipTranscript: z26.boolean(),
2819
- workflowName: z26.string().optional(),
3365
+ skipTranscript: z27.boolean(),
3366
+ workflowName: z27.string().optional(),
2820
3367
  workflow: workflowProgressSnapshotSchema.optional(),
2821
3368
  usage: backgroundTaskUsageSchema.optional(),
2822
- summary: z26.string().optional(),
2823
- error: z26.string().optional(),
2824
- outputFile: z26.string().optional()
3369
+ summary: z27.string().optional(),
3370
+ error: z27.string().optional(),
3371
+ outputFile: z27.string().optional()
2825
3372
  });
2826
- var deltaFileReadShapeSchema = z26.object({
2827
- type: z26.literal("fileRead"),
2828
- path: z26.string(),
2829
- cmd: z26.string().optional()
3373
+ var deltaFileReadShapeSchema = z27.object({
3374
+ type: z27.literal("fileRead"),
3375
+ path: z27.string(),
3376
+ cmd: z27.string().optional()
2830
3377
  });
2831
- var deltaSearchShapeSchema = z26.object({
2832
- type: z26.literal("search"),
3378
+ var deltaSearchShapeSchema = z27.object({
3379
+ type: z27.literal("search"),
2833
3380
  mode: threadEventSearchModeSchema,
2834
- query: z26.string(),
2835
- path: z26.string().optional(),
2836
- cmd: z26.string().optional()
3381
+ query: z27.string(),
3382
+ path: z27.string().optional(),
3383
+ cmd: z27.string().optional()
2837
3384
  });
2838
- var deltaDelegationShapeSchema = z26.object({
2839
- type: z26.literal("delegation"),
3385
+ var deltaDelegationShapeSchema = z27.object({
3386
+ type: z27.literal("delegation"),
2840
3387
  childRef: deltaKeyPartSchema,
2841
- label: z26.string(),
2842
- background: z26.boolean(),
2843
- summary: z26.string().optional()
3388
+ label: z27.string(),
3389
+ background: z27.boolean(),
3390
+ summary: z27.string().optional()
2844
3391
  });
2845
- var deltaPlanStepsShapeSchema = z26.object({
2846
- type: z26.literal("planSteps"),
2847
- steps: z26.array(threadEventPlanStepSchema),
2848
- explanation: z26.string().optional()
3392
+ var deltaPlanStepsShapeSchema = z27.object({
3393
+ type: z27.literal("planSteps"),
3394
+ steps: z27.array(threadEventPlanStepSchema),
3395
+ explanation: z27.string().optional()
2849
3396
  });
2850
- var deltaExtensionShapeSchema = z26.object({
2851
- type: z26.literal("extension"),
3397
+ var deltaExtensionShapeSchema = z27.object({
3398
+ type: z27.literal("extension"),
2852
3399
  kind: extensionKindSchema,
2853
3400
  payload: jsonValueSchema
2854
3401
  });
2855
- var deltaItemShapeSchema = z26.discriminatedUnion("type", [
2856
- z26.object({
2857
- type: z26.literal("command"),
2858
- command: z26.string(),
2859
- cwd: z26.string(),
2860
- aggregatedOutput: z26.string().optional(),
2861
- exitCode: z26.number().optional(),
2862
- durationMs: z26.number().optional()
3402
+ var deltaItemShapeSchema = z27.discriminatedUnion("type", [
3403
+ z27.object({
3404
+ type: z27.literal("command"),
3405
+ command: z27.string(),
3406
+ cwd: z27.string(),
3407
+ aggregatedOutput: z27.string().optional(),
3408
+ exitCode: z27.number().optional(),
3409
+ durationMs: z27.number().optional()
2863
3410
  }),
2864
- z26.object({
2865
- type: z26.literal("fileChange"),
2866
- changes: z26.array(deltaFileChangeSchema)
3411
+ z27.object({
3412
+ type: z27.literal("fileChange"),
3413
+ changes: z27.array(deltaFileChangeSchema)
2867
3414
  }),
2868
- z26.object({
2869
- type: z26.literal("tool"),
2870
- tool: z26.string(),
2871
- server: z26.string().optional(),
2872
- args: z26.unknown().optional(),
2873
- result: z26.unknown().optional(),
2874
- error: z26.string().optional(),
2875
- durationMs: z26.number().optional()
3415
+ z27.object({
3416
+ type: z27.literal("tool"),
3417
+ tool: z27.string(),
3418
+ server: z27.string().optional(),
3419
+ args: z27.unknown().optional(),
3420
+ result: z27.unknown().optional(),
3421
+ error: z27.string().optional(),
3422
+ durationMs: z27.number().optional()
2876
3423
  }),
2877
- z26.object({ type: z26.literal("compaction") }),
2878
- z26.object({ type: z26.literal("agentMessage"), text: z26.string() }),
2879
- z26.object({
2880
- type: z26.literal("reasoning"),
2881
- summary: z26.array(z26.string()),
2882
- content: z26.array(z26.string())
3424
+ z27.object({ type: z27.literal("compaction") }),
3425
+ z27.object({ type: z27.literal("agentMessage"), text: z27.string() }),
3426
+ z27.object({
3427
+ type: z27.literal("reasoning"),
3428
+ summary: z27.array(z27.string()),
3429
+ content: z27.array(z27.string())
2883
3430
  }),
2884
- z26.object({ type: z26.literal("plan"), text: z26.string() }),
2885
- z26.object({
2886
- type: z26.literal("webSearch"),
2887
- queries: z26.array(z26.string()).min(1)
3431
+ z27.object({ type: z27.literal("plan"), text: z27.string() }),
3432
+ z27.object({
3433
+ type: z27.literal("webSearch"),
3434
+ queries: z27.array(z27.string()).min(1)
2888
3435
  }),
2889
- z26.object({
2890
- type: z26.literal("webFetch"),
2891
- url: z26.string(),
2892
- prompt: z26.string().nullable().optional(),
2893
- pattern: z26.string().nullable()
3436
+ z27.object({
3437
+ type: z27.literal("webFetch"),
3438
+ url: z27.string(),
3439
+ prompt: z27.string().nullable().optional(),
3440
+ pattern: z27.string().nullable()
2894
3441
  }),
2895
- z26.object({ type: z26.literal("imageView"), path: z26.string() }),
2896
- z26.object({
2897
- type: z26.literal("imageGeneration"),
2898
- prompt: z26.string().nullable(),
2899
- path: z26.string().nullable(),
2900
- result: z26.string().optional(),
2901
- error: z26.string().nullable(),
2902
- transparentBackground: z26.boolean()
3442
+ z27.object({ type: z27.literal("imageView"), path: z27.string() }),
3443
+ z27.object({
3444
+ type: z27.literal("imageGeneration"),
3445
+ prompt: z27.string().nullable(),
3446
+ path: z27.string().nullable(),
3447
+ result: z27.string().optional(),
3448
+ error: z27.string().nullable(),
3449
+ transparentBackground: z27.boolean()
2903
3450
  }),
2904
3451
  deltaBackgroundTaskShapeSchema,
2905
3452
  deltaFileReadShapeSchema,
@@ -2908,22 +3455,22 @@ var deltaItemShapeSchema = z26.discriminatedUnion("type", [
2908
3455
  deltaPlanStepsShapeSchema,
2909
3456
  deltaExtensionShapeSchema
2910
3457
  ]);
2911
- var deltaProgressSnapshotSchema = z26.discriminatedUnion("type", [
3458
+ var deltaProgressSnapshotSchema = z27.discriminatedUnion("type", [
2912
3459
  deltaBackgroundTaskShapeSchema,
2913
3460
  deltaDelegationShapeSchema
2914
3461
  ]);
2915
- var deltaTextChannelSchema = z26.enum([
3462
+ var deltaTextChannelSchema = z27.enum([
2916
3463
  "agentMessage",
2917
3464
  "reasoningSummary",
2918
3465
  "reasoningText",
2919
3466
  "plan"
2920
3467
  ]);
2921
- var deltaOutputChannelSchema = z26.enum(["command", "fileChange"]);
2922
- var deltaErrorSchema = z26.object({ message: z26.string() });
2923
- var deltaAttachSchema = z26.enum(["open", "currentOrLast"]);
2924
- var deltaNoTurnFallbackSchema = z26.object({
3468
+ var deltaOutputChannelSchema = z27.enum(["command", "fileChange"]);
3469
+ var deltaErrorSchema = z27.object({ message: z27.string() });
3470
+ var deltaAttachSchema = z27.enum(["open", "currentOrLast"]);
3471
+ var deltaNoTurnFallbackSchema = z27.object({
2925
3472
  raw: providerRawEventSchema,
2926
- rawType: z26.string()
3473
+ rawType: z27.string()
2927
3474
  });
2928
3475
  function requireExtensionPresentation(delta, ctx) {
2929
3476
  if (delta.item.type === "extension" && delta.presentation === void 0) {
@@ -2934,32 +3481,32 @@ function requireExtensionPresentation(delta, ctx) {
2934
3481
  });
2935
3482
  }
2936
3483
  }
2937
- var threadDeltaSchema = z26.discriminatedUnion("kind", [
2938
- z26.object({
2939
- kind: z26.literal("input.accepted"),
3484
+ var threadDeltaSchema = z27.discriminatedUnion("kind", [
3485
+ z27.object({
3486
+ kind: z27.literal("input.accepted"),
2940
3487
  clientRequestId: clientTurnRequestIdSchema,
2941
3488
  providerTurnId: providerTurnIdSchema.optional()
2942
3489
  }),
2943
- z26.object({
2944
- kind: z26.literal("input.provider"),
2945
- text: z26.string().min(1),
3490
+ z27.object({
3491
+ kind: z27.literal("input.provider"),
3492
+ text: z27.string().min(1),
2946
3493
  parentRef: deltaKeyPartSchema.optional()
2947
3494
  }),
2948
- z26.object({
2949
- kind: z26.literal("turn.open"),
3495
+ z27.object({
3496
+ kind: z27.literal("turn.open"),
2950
3497
  providerTurnId: providerTurnIdSchema.optional(),
2951
3498
  parentRef: deltaKeyPartSchema.optional()
2952
3499
  }),
2953
- z26.object({
2954
- kind: z26.literal("turn.boundary"),
3500
+ z27.object({
3501
+ kind: z27.literal("turn.boundary"),
2955
3502
  status: threadEventTurnStatusSchema,
2956
3503
  error: deltaErrorSchema.optional(),
2957
- providerCheckpointId: z26.string().min(1).optional(),
2958
- claimIfIdle: z26.boolean().optional(),
3504
+ providerCheckpointId: z27.string().min(1).optional(),
3505
+ claimIfIdle: z27.boolean().optional(),
2959
3506
  providerTurnId: providerTurnIdSchema.optional()
2960
3507
  }),
2961
- z26.object({
2962
- kind: z26.literal("item.open"),
3508
+ z27.object({
3509
+ kind: z27.literal("item.open"),
2963
3510
  key: deltaItemKeySchema,
2964
3511
  item: deltaItemShapeSchema,
2965
3512
  presentation: deltaPresentationSchema.optional(),
@@ -2967,154 +3514,154 @@ var threadDeltaSchema = z26.discriminatedUnion("kind", [
2967
3514
  providerTurnId: providerTurnIdSchema.optional(),
2968
3515
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2969
3516
  }).superRefine(requireExtensionPresentation),
2970
- z26.object({
2971
- kind: z26.literal("item.close"),
3517
+ z27.object({
3518
+ kind: z27.literal("item.close"),
2972
3519
  key: deltaItemKeySchema,
2973
3520
  status: threadEventItemStatusSchema,
2974
- resultText: z26.string().optional(),
2975
- exitCode: z26.number().optional(),
2976
- aggregatedOutput: z26.string().optional(),
2977
- approvalStatus: z26.literal("denied").optional(),
3521
+ resultText: z27.string().optional(),
3522
+ exitCode: z27.number().optional(),
3523
+ aggregatedOutput: z27.string().optional(),
3524
+ approvalStatus: z27.literal("denied").optional(),
2978
3525
  item: deltaItemShapeSchema,
2979
3526
  presentation: deltaPresentationSchema.optional(),
2980
3527
  providerTurnId: providerTurnIdSchema.optional(),
2981
3528
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2982
3529
  }).superRefine(requireExtensionPresentation),
2983
- z26.object({
2984
- kind: z26.literal("item.progress"),
3530
+ z27.object({
3531
+ kind: z27.literal("item.progress"),
2985
3532
  key: deltaItemKeySchema,
2986
- message: z26.string().optional(),
3533
+ message: z27.string().optional(),
2987
3534
  snapshot: deltaProgressSnapshotSchema.optional(),
2988
- flush: z26.boolean().optional(),
3535
+ flush: z27.boolean().optional(),
2989
3536
  providerTurnId: providerTurnIdSchema.optional(),
2990
3537
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2991
3538
  }),
2992
- z26.object({
2993
- kind: z26.literal("item.textDelta"),
3539
+ z27.object({
3540
+ kind: z27.literal("item.textDelta"),
2994
3541
  key: deltaItemKeySchema,
2995
3542
  channel: deltaTextChannelSchema,
2996
- text: z26.string(),
3543
+ text: z27.string(),
2997
3544
  providerTurnId: providerTurnIdSchema.optional(),
2998
3545
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2999
3546
  }),
3000
- z26.object({
3001
- kind: z26.literal("item.textClose"),
3547
+ z27.object({
3548
+ kind: z27.literal("item.textClose"),
3002
3549
  key: deltaItemKeySchema,
3003
3550
  channel: deltaTextChannelSchema,
3004
- text: z26.string().optional(),
3551
+ text: z27.string().optional(),
3005
3552
  providerTurnId: providerTurnIdSchema.optional(),
3006
3553
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
3007
3554
  }),
3008
- z26.object({
3009
- kind: z26.literal("item.outputDelta"),
3555
+ z27.object({
3556
+ kind: z27.literal("item.outputDelta"),
3010
3557
  key: deltaItemKeySchema,
3011
3558
  channel: deltaOutputChannelSchema,
3012
- text: z26.string(),
3559
+ text: z27.string(),
3013
3560
  providerTurnId: providerTurnIdSchema.optional(),
3014
3561
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
3015
3562
  }),
3016
- z26.object({
3017
- kind: z26.literal("command.outputSnapshot"),
3563
+ z27.object({
3564
+ kind: z27.literal("command.outputSnapshot"),
3018
3565
  key: deltaItemKeySchema,
3019
- text: z26.string(),
3566
+ text: z27.string(),
3020
3567
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
3021
3568
  }),
3022
- z26.object({
3023
- kind: z26.literal("usage"),
3569
+ z27.object({
3570
+ kind: z27.literal("usage"),
3024
3571
  total: threadEventTokenUsageBreakdownSchema,
3025
3572
  last: threadEventTokenUsageBreakdownSchema,
3026
- modelContextWindow: z26.number().nullable(),
3573
+ modelContextWindow: z27.number().nullable(),
3027
3574
  providerTurnId: providerTurnIdSchema.optional()
3028
3575
  }),
3029
- z26.object({
3030
- kind: z26.literal("contextWindow"),
3576
+ z27.object({
3577
+ kind: z27.literal("contextWindow"),
3031
3578
  snapshot: contextSnapshotSchema.optional(),
3032
- used: z26.number().nullable(),
3033
- size: z26.number().nullable().optional(),
3034
- estimated: z26.boolean(),
3579
+ used: z27.number().nullable(),
3580
+ size: z27.number().nullable().optional(),
3581
+ estimated: z27.boolean(),
3035
3582
  attach: deltaAttachSchema,
3036
3583
  providerTurnId: providerTurnIdSchema.optional()
3037
3584
  }),
3038
- z26.object({
3039
- kind: z26.literal("context.compacted"),
3585
+ z27.object({
3586
+ kind: z27.literal("context.compacted"),
3040
3587
  providerTurnId: providerTurnIdSchema.optional(),
3041
3588
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
3042
3589
  }),
3043
- z26.object({ kind: z26.literal("context.cleared") }),
3044
- z26.object({
3045
- kind: z26.literal("turn.diff"),
3046
- diff: z26.string(),
3590
+ z27.object({ kind: z27.literal("context.cleared") }),
3591
+ z27.object({
3592
+ kind: z27.literal("turn.diff"),
3593
+ diff: z27.string(),
3047
3594
  providerTurnId: providerTurnIdSchema.optional()
3048
3595
  }),
3049
- z26.object({ kind: z26.literal("thread.started") }),
3050
- z26.object({
3051
- kind: z26.literal("thread.identity"),
3052
- providerThreadId: z26.string().min(1)
3596
+ z27.object({ kind: z27.literal("thread.started") }),
3597
+ z27.object({
3598
+ kind: z27.literal("thread.identity"),
3599
+ providerThreadId: z27.string().min(1)
3053
3600
  }),
3054
- z26.object({ kind: z26.literal("thread.name"), name: z26.string().min(1) }),
3055
- z26.object({
3056
- kind: z26.literal("extension.state"),
3601
+ z27.object({ kind: z27.literal("thread.name"), name: z27.string().min(1) }),
3602
+ z27.object({
3603
+ kind: z27.literal("extension.state"),
3057
3604
  extensionKind: extensionKindSchema,
3058
3605
  payload: jsonValueSchema
3059
3606
  }),
3060
- z26.object({
3061
- kind: z26.literal("provider.rateLimits"),
3607
+ z27.object({
3608
+ kind: z27.literal("provider.rateLimits"),
3062
3609
  rateLimits: providerRateLimitStateSchema
3063
3610
  }),
3064
- z26.object({
3065
- kind: z26.literal("provider.error"),
3066
- message: z26.string(),
3067
- detail: z26.string().optional(),
3068
- willRetry: z26.boolean().optional(),
3611
+ z27.object({
3612
+ kind: z27.literal("provider.error"),
3613
+ message: z27.string(),
3614
+ detail: z27.string().optional(),
3615
+ willRetry: z27.boolean().optional(),
3069
3616
  category: providerErrorCategorySchema.optional(),
3070
3617
  errorInfo: providerErrorInfoSchema.optional(),
3071
- settlesTurn: z26.boolean().optional(),
3618
+ settlesTurn: z27.boolean().optional(),
3072
3619
  providerTurnId: providerTurnIdSchema.optional(),
3073
- threadScoped: z26.boolean().optional()
3620
+ threadScoped: z27.boolean().optional()
3074
3621
  }),
3075
- z26.object({
3076
- kind: z26.literal("provider.modelFallback"),
3077
- originalModel: z26.string().min(1),
3078
- fallbackModel: z26.string().min(1),
3079
- reason: z26.enum(["refusal", "provider"]),
3080
- message: z26.string()
3622
+ z27.object({
3623
+ kind: z27.literal("provider.modelFallback"),
3624
+ originalModel: z27.string().min(1),
3625
+ fallbackModel: z27.string().min(1),
3626
+ reason: z27.enum(["refusal", "provider"]),
3627
+ message: z27.string()
3081
3628
  }),
3082
- z26.object({
3083
- kind: z26.literal("provider.warning"),
3084
- summary: z26.string().optional(),
3085
- details: z26.string().optional(),
3629
+ z27.object({
3630
+ kind: z27.literal("provider.warning"),
3631
+ summary: z27.string().optional(),
3632
+ details: z27.string().optional(),
3086
3633
  category: threadEventWarningCategorySchema.optional(),
3087
- vouchedTurn: z26.boolean().optional()
3634
+ vouchedTurn: z27.boolean().optional()
3088
3635
  }),
3089
- z26.object({
3090
- kind: z26.literal("unhandled"),
3636
+ z27.object({
3637
+ kind: z27.literal("unhandled"),
3091
3638
  raw: providerRawEventSchema,
3092
- rawType: z26.string(),
3093
- vouchedTurn: z26.boolean(),
3094
- onlyIfNoTurn: z26.boolean().optional(),
3639
+ rawType: z27.string(),
3640
+ vouchedTurn: z27.boolean(),
3641
+ onlyIfNoTurn: z27.boolean().optional(),
3095
3642
  parentRef: deltaKeyPartSchema.optional(),
3096
3643
  providerTurnId: providerTurnIdSchema.optional()
3097
3644
  }),
3098
- z26.object({ kind: z26.literal("session.ended") }),
3099
- z26.object({ kind: z26.literal("session.reset") })
3645
+ z27.object({ kind: z27.literal("session.ended") }),
3646
+ z27.object({ kind: z27.literal("session.reset") })
3100
3647
  ]);
3101
- var threadDeltaNotificationParamsSchema = z26.object({
3102
- threadId: z26.string().min(1),
3103
- deltas: z26.array(threadDeltaSchema)
3648
+ var threadDeltaNotificationParamsSchema = z27.object({
3649
+ threadId: z27.string().min(1),
3650
+ deltas: z27.array(threadDeltaSchema)
3104
3651
  }).passthrough();
3105
3652
 
3106
3653
  // ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
3107
- import { z as z28 } from "zod";
3654
+ import { z as z29 } from "zod";
3108
3655
 
3109
3656
  // ../provider-bridge-protocol/src/bridge-kit/tool-arg-schemas.ts
3110
- import { z as z27 } from "zod";
3111
- var bashArgsSchema = z27.object({
3112
- command: z27.string().optional(),
3113
- cwd: z27.string().optional()
3657
+ import { z as z28 } from "zod";
3658
+ var bashArgsSchema = z28.object({
3659
+ command: z28.string().optional(),
3660
+ cwd: z28.string().optional()
3114
3661
  }).passthrough();
3115
- var textBlockSchema = z27.object({
3116
- type: z27.literal("text"),
3117
- text: z27.string()
3662
+ var textBlockSchema = z28.object({
3663
+ type: z28.literal("text"),
3664
+ text: z28.string()
3118
3665
  });
3119
3666
 
3120
3667
  // ../provider-bridge-protocol/src/bridge-kit/provider-visibility-helpers.ts
@@ -3127,10 +3674,10 @@ function getStringProperty(value, key) {
3127
3674
  }
3128
3675
 
3129
3676
  // ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
3130
- var contentWrapperSchema = z28.object({
3131
- content: z28.array(z28.unknown())
3677
+ var contentWrapperSchema = z29.object({
3678
+ content: z29.array(z29.unknown())
3132
3679
  }).passthrough();
3133
- var shellEnvironmentVariableKeySchema = z28.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
3680
+ var shellEnvironmentVariableKeySchema = z29.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
3134
3681
  function toOptionalString(value) {
3135
3682
  return typeof value === "string" ? value : void 0;
3136
3683
  }
@@ -3484,26 +4031,26 @@ function withoutBridgeRuntimeEnv(env) {
3484
4031
  }
3485
4032
 
3486
4033
  // ../provider-bridge-protocol/src/bridge-kit/bridge-tool-calls.ts
3487
- import { z as z29 } from "zod";
3488
- var bridgeRequestEnvelopeSchema = z29.object({
3489
- jsonrpc: z29.literal("2.0"),
3490
- id: z29.union([z29.string(), z29.number()]),
3491
- method: z29.string(),
3492
- params: z29.record(z29.string(), z29.unknown()).optional()
3493
- });
3494
- var jsonRpcErrorSchema = z29.object({
3495
- code: z29.number(),
3496
- message: z29.string().optional(),
3497
- data: z29.unknown().optional()
3498
- });
3499
- var jsonRpcSuccessResponseSchema = z29.object({
3500
- jsonrpc: z29.literal("2.0"),
3501
- id: z29.union([z29.string(), z29.number()]),
3502
- result: z29.unknown()
3503
- });
3504
- var jsonRpcErrorResponseSchema = z29.object({
3505
- jsonrpc: z29.literal("2.0"),
3506
- id: z29.union([z29.string(), z29.number()]),
4034
+ import { z as z30 } from "zod";
4035
+ var bridgeRequestEnvelopeSchema = z30.object({
4036
+ jsonrpc: z30.literal("2.0"),
4037
+ id: z30.union([z30.string(), z30.number()]),
4038
+ method: z30.string(),
4039
+ params: z30.record(z30.string(), z30.unknown()).optional()
4040
+ });
4041
+ var jsonRpcErrorSchema = z30.object({
4042
+ code: z30.number(),
4043
+ message: z30.string().optional(),
4044
+ data: z30.unknown().optional()
4045
+ });
4046
+ var jsonRpcSuccessResponseSchema = z30.object({
4047
+ jsonrpc: z30.literal("2.0"),
4048
+ id: z30.union([z30.string(), z30.number()]),
4049
+ result: z30.unknown()
4050
+ });
4051
+ var jsonRpcErrorResponseSchema = z30.object({
4052
+ jsonrpc: z30.literal("2.0"),
4053
+ id: z30.union([z30.string(), z30.number()]),
3507
4054
  error: jsonRpcErrorSchema
3508
4055
  });
3509
4056
  function isJsonRpcRequest(input) {
@@ -3591,47 +4138,47 @@ function buildBridgeToolCallContent(result) {
3591
4138
  }
3592
4139
 
3593
4140
  // ../provider-bridge-protocol/src/bridge-kit/json-rpc-envelope.ts
3594
- import { z as z30 } from "zod";
3595
- var recordSchema = z30.record(z30.string(), z30.unknown());
3596
- var jsonRpcEnvelopeSchema = z30.object({
3597
- jsonrpc: z30.literal("2.0"),
3598
- method: z30.string(),
4141
+ import { z as z31 } from "zod";
4142
+ var recordSchema = z31.record(z31.string(), z31.unknown());
4143
+ var jsonRpcEnvelopeSchema = z31.object({
4144
+ jsonrpc: z31.literal("2.0"),
4145
+ method: z31.string(),
3599
4146
  params: recordSchema.optional()
3600
4147
  }).passthrough();
3601
- var sdkMessageEnvelopeSchema = z30.object({
3602
- jsonrpc: z30.literal("2.0"),
3603
- method: z30.literal("sdk/message"),
3604
- params: z30.object({
3605
- message: z30.unknown(),
3606
- threadId: z30.string().optional(),
3607
- parent_tool_use_id: z30.string().optional()
4148
+ var sdkMessageEnvelopeSchema = z31.object({
4149
+ jsonrpc: z31.literal("2.0"),
4150
+ method: z31.literal("sdk/message"),
4151
+ params: z31.object({
4152
+ message: z31.unknown(),
4153
+ threadId: z31.string().optional(),
4154
+ parent_tool_use_id: z31.string().optional()
3608
4155
  }).passthrough()
3609
4156
  }).passthrough();
3610
- var threadIdentityEnvelopeSchema = z30.object({
3611
- jsonrpc: z30.literal("2.0"),
3612
- method: z30.literal("thread/identity"),
3613
- params: z30.object({
3614
- threadId: z30.string().optional(),
3615
- providerThreadId: z30.string().optional()
4157
+ var threadIdentityEnvelopeSchema = z31.object({
4158
+ jsonrpc: z31.literal("2.0"),
4159
+ method: z31.literal("thread/identity"),
4160
+ params: z31.object({
4161
+ threadId: z31.string().optional(),
4162
+ providerThreadId: z31.string().optional()
3616
4163
  }).passthrough()
3617
4164
  }).passthrough();
3618
- var threadContextWindowUsageEnvelopeSchema = z30.object({
3619
- jsonrpc: z30.literal("2.0"),
3620
- method: z30.literal("thread/contextWindowUsage/updated"),
3621
- params: z30.object({
3622
- threadId: z30.string().optional(),
3623
- contextWindowUsage: z30.object({
3624
- usedTokens: z30.number().nullable(),
3625
- modelContextWindow: z30.number().nullable(),
3626
- estimated: z30.boolean()
4165
+ var threadContextWindowUsageEnvelopeSchema = z31.object({
4166
+ jsonrpc: z31.literal("2.0"),
4167
+ method: z31.literal("thread/contextWindowUsage/updated"),
4168
+ params: z31.object({
4169
+ threadId: z31.string().optional(),
4170
+ contextWindowUsage: z31.object({
4171
+ usedTokens: z31.number().nullable(),
4172
+ modelContextWindow: z31.number().nullable(),
4173
+ estimated: z31.boolean()
3627
4174
  })
3628
4175
  }).passthrough()
3629
4176
  }).passthrough();
3630
- var errorEnvelopeSchema = z30.object({
3631
- jsonrpc: z30.literal("2.0"),
3632
- method: z30.literal("error"),
3633
- params: z30.object({
3634
- message: z30.string().optional()
4177
+ var errorEnvelopeSchema = z31.object({
4178
+ jsonrpc: z31.literal("2.0"),
4179
+ method: z31.literal("error"),
4180
+ params: z31.object({
4181
+ message: z31.string().optional()
3635
4182
  }).passthrough().optional()
3636
4183
  }).passthrough();
3637
4184
 
@@ -3733,12 +4280,14 @@ function experimental_defineProviderBridge(definition) {
3733
4280
  }
3734
4281
 
3735
4282
  // ../provider-bridge-protocol/src/bridge-kit/provider-maintenance-kit.ts
4283
+ var import_compare = __toESM(require_compare(), 1);
4284
+ var import_valid = __toESM(require_valid(), 1);
3736
4285
  import { execFile } from "node:child_process";
3737
4286
  import { constants as fsConstants } from "node:fs";
3738
4287
  import { access } from "node:fs/promises";
3739
4288
  import path from "node:path";
3740
4289
  import { promisify } from "node:util";
3741
- import { z as z31 } from "zod";
4290
+ import { z as z32 } from "zod";
3742
4291
  var execFileAsync = promisify(execFile);
3743
4292
  var CLI_PROBE_TIMEOUT_MS = 5e3;
3744
4293
  async function resolveExecutablePath(command) {
@@ -3760,6 +4309,10 @@ async function resolveExecutablePath(command) {
3760
4309
  return null;
3761
4310
  }
3762
4311
  }
4312
+ function versionFrom(value) {
4313
+ const candidate = value?.match(/\bv?(\d+\.\d+\.\d+[0-9A-Za-z.+-]*)/u)?.[1];
4314
+ return candidate !== void 0 && (0, import_valid.default)(candidate) !== null ? candidate : null;
4315
+ }
3763
4316
  async function readCliVersion(command) {
3764
4317
  try {
3765
4318
  const probe = execFileAsync(command, ["--version"], {
@@ -3767,8 +4320,8 @@ async function readCliVersion(command) {
3767
4320
  });
3768
4321
  probe.child.stdin?.end();
3769
4322
  const { stdout, stderr } = await probe;
3770
- return `${stdout}
3771
- ${stderr}`.match(/\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?/u)?.[0] ?? null;
4323
+ return versionFrom(`${stdout}
4324
+ ${stderr}`);
3772
4325
  } catch {
3773
4326
  return null;
3774
4327
  }
@@ -3790,9 +4343,9 @@ function clampPercent(value) {
3790
4343
  }
3791
4344
 
3792
4345
  // ../provider-bridge-protocol/src/bridge-kit/provider-tool-call-contract.ts
3793
- import { z as z32 } from "zod";
3794
- var providerToolCallCancellationSchema = z32.object({
3795
- requestId: z32.union([z32.string(), z32.number().int()])
4346
+ import { z as z33 } from "zod";
4347
+ var providerToolCallCancellationSchema = z33.object({
4348
+ requestId: z33.union([z33.string(), z33.number().int()])
3796
4349
  });
3797
4350
  var PROVIDER_TOOL_CALL_CANCELLED_METHOD = "notifications/cancelled";
3798
4351
 
@@ -3808,8 +4361,8 @@ function createProviderVisibilityMetadata(args) {
3808
4361
  }
3809
4362
 
3810
4363
  // ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
3811
- import { z as z33 } from "zod";
3812
- var ignoredJsonRpcResultSchema = z33.unknown();
4364
+ import { z as z34 } from "zod";
4365
+ var ignoredJsonRpcResultSchema = z34.unknown();
3813
4366
 
3814
4367
  // ../provider-bridge-acp/src/bridge/bridge.ts
3815
4368
  import { execFile as execFile4 } from "node:child_process";
@@ -3819,21 +4372,21 @@ import { createServer } from "node:net";
3819
4372
  import { dirname as dirname2, isAbsolute, basename as basename3, relative, resolve as resolve3 } from "node:path";
3820
4373
  import { fileURLToPath } from "node:url";
3821
4374
  import { isDeepStrictEqual } from "node:util";
3822
- import { z as z41 } from "zod";
4375
+ import { z as z42 } from "zod";
3823
4376
 
3824
4377
  // ../provider-bridge-acp/src/bridge-protocol.ts
3825
- import { z as z35 } from "zod";
4378
+ import { z as z36 } from "zod";
3826
4379
 
3827
4380
  // ../provider-bridge-acp/src/wire.ts
3828
- import { z as z34 } from "zod";
3829
- var acpTextContentBlockSchema = z34.object({
3830
- type: z34.literal("text"),
3831
- text: z34.string()
4381
+ import { z as z35 } from "zod";
4382
+ var acpTextContentBlockSchema = z35.object({
4383
+ type: z35.literal("text"),
4384
+ text: z35.string()
3832
4385
  }).passthrough();
3833
- var acpOtherContentBlockSchema = z34.object({
3834
- type: z34.string()
4386
+ var acpOtherContentBlockSchema = z35.object({
4387
+ type: z35.string()
3835
4388
  }).passthrough();
3836
- var acpContentBlockSchema = z34.union([
4389
+ var acpContentBlockSchema = z35.union([
3837
4390
  acpTextContentBlockSchema,
3838
4391
  acpOtherContentBlockSchema
3839
4392
  ]);
@@ -3856,7 +4409,7 @@ var ACP_TOOL_KINDS = [
3856
4409
  "switch_mode",
3857
4410
  "other"
3858
4411
  ];
3859
- var acpToolKindSchema = z34.enum(ACP_TOOL_KINDS);
4412
+ var acpToolKindSchema = z35.enum(ACP_TOOL_KINDS);
3860
4413
  var ACP_TOOL_KIND_SET = new Set(ACP_TOOL_KINDS);
3861
4414
  var ACP_TOOL_CALL_STATUSES = [
3862
4415
  "pending",
@@ -3865,48 +4418,48 @@ var ACP_TOOL_CALL_STATUSES = [
3865
4418
  "failed",
3866
4419
  "cancelled"
3867
4420
  ];
3868
- var acpToolCallStatusSchema = z34.enum(ACP_TOOL_CALL_STATUSES);
4421
+ var acpToolCallStatusSchema = z35.enum(ACP_TOOL_CALL_STATUSES);
3869
4422
  var ACP_TOOL_CALL_STATUS_SET = new Set(
3870
4423
  ACP_TOOL_CALL_STATUSES
3871
4424
  );
3872
- var acpToolCallContentSchema = z34.union([
3873
- z34.object({
3874
- type: z34.literal("content"),
4425
+ var acpToolCallContentSchema = z35.union([
4426
+ z35.object({
4427
+ type: z35.literal("content"),
3875
4428
  content: acpContentBlockSchema
3876
4429
  }).passthrough(),
3877
- z34.object({
3878
- type: z34.literal("diff"),
3879
- path: z34.string(),
3880
- oldText: z34.string().nullable().optional(),
3881
- newText: z34.string()
4430
+ z35.object({
4431
+ type: z35.literal("diff"),
4432
+ path: z35.string(),
4433
+ oldText: z35.string().nullable().optional(),
4434
+ newText: z35.string()
3882
4435
  }).passthrough(),
3883
- z34.object({
3884
- type: z34.literal("terminal"),
3885
- terminalId: z34.string()
4436
+ z35.object({
4437
+ type: z35.literal("terminal"),
4438
+ terminalId: z35.string()
3886
4439
  }).passthrough()
3887
4440
  ]);
3888
- var acpToolCallContentListSchema = z34.array(z34.unknown()).transform(
4441
+ var acpToolCallContentListSchema = z35.array(z35.unknown()).transform(
3889
4442
  (entries) => entries.flatMap((entry) => {
3890
4443
  const parsed = acpToolCallContentSchema.safeParse(entry);
3891
4444
  return parsed.success ? [parsed.data] : [];
3892
4445
  })
3893
4446
  );
3894
- var acpToolCallLocationSchema = z34.object({
3895
- path: z34.string(),
3896
- line: z34.number().optional().nullable()
4447
+ var acpToolCallLocationSchema = z35.object({
4448
+ path: z35.string(),
4449
+ line: z35.number().optional().nullable()
3897
4450
  }).passthrough();
3898
- var acpToolCallNameSchema = z34.union([z34.string(), z34.null()]).transform((value) => value ?? void 0).optional();
3899
- var acpToolCallFieldsSchema = z34.object({
3900
- toolCallId: z34.string(),
3901
- title: z34.string().optional(),
4451
+ var acpToolCallNameSchema = z35.union([z35.string(), z35.null()]).transform((value) => value ?? void 0).optional();
4452
+ var acpToolCallFieldsSchema = z35.object({
4453
+ toolCallId: z35.string(),
4454
+ title: z35.string().optional(),
3902
4455
  name: acpToolCallNameSchema,
3903
4456
  kind: acpToolKindSchema.optional(),
3904
- rawKind: z34.string().optional(),
4457
+ rawKind: z35.string().optional(),
3905
4458
  status: acpToolCallStatusSchema.optional(),
3906
4459
  content: acpToolCallContentListSchema.optional(),
3907
- locations: z34.array(acpToolCallLocationSchema).optional(),
3908
- rawInput: z34.unknown().optional(),
3909
- rawOutput: z34.unknown().optional()
4460
+ locations: z35.array(acpToolCallLocationSchema).optional(),
4461
+ rawInput: z35.unknown().optional(),
4462
+ rawOutput: z35.unknown().optional()
3910
4463
  });
3911
4464
  function openAcpToolCallEnums(value) {
3912
4465
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
@@ -3932,43 +4485,43 @@ function openAcpToolCallEnums(value) {
3932
4485
  }
3933
4486
  return next;
3934
4487
  }
3935
- var acpAgentMessageChunkUpdateSchema = z34.object({
3936
- sessionUpdate: z34.literal("agent_message_chunk"),
4488
+ var acpAgentMessageChunkUpdateSchema = z35.object({
4489
+ sessionUpdate: z35.literal("agent_message_chunk"),
3937
4490
  content: acpContentBlockSchema
3938
4491
  }).passthrough();
3939
- var acpAgentThoughtChunkUpdateSchema = z34.object({
3940
- sessionUpdate: z34.literal("agent_thought_chunk"),
4492
+ var acpAgentThoughtChunkUpdateSchema = z35.object({
4493
+ sessionUpdate: z35.literal("agent_thought_chunk"),
3941
4494
  content: acpContentBlockSchema
3942
4495
  }).passthrough();
3943
- var acpToolCallUpdateEventSchema = z34.preprocess(
4496
+ var acpToolCallUpdateEventSchema = z35.preprocess(
3944
4497
  openAcpToolCallEnums,
3945
4498
  acpToolCallFieldsSchema.extend({
3946
- sessionUpdate: z34.enum(["tool_call", "tool_call_update"])
4499
+ sessionUpdate: z35.enum(["tool_call", "tool_call_update"])
3947
4500
  }).passthrough()
3948
4501
  );
3949
- var acpPlanEntryStatusSchema = z34.enum([
4502
+ var acpPlanEntryStatusSchema = z35.enum([
3950
4503
  "pending",
3951
4504
  "in_progress",
3952
4505
  "completed"
3953
4506
  ]);
3954
- var acpPlanUpdateSchema = z34.object({
3955
- sessionUpdate: z34.literal("plan"),
3956
- entries: z34.array(
3957
- z34.object({
3958
- content: z34.string(),
4507
+ var acpPlanUpdateSchema = z35.object({
4508
+ sessionUpdate: z35.literal("plan"),
4509
+ entries: z35.array(
4510
+ z35.object({
4511
+ content: z35.string(),
3959
4512
  status: acpPlanEntryStatusSchema.optional()
3960
4513
  }).passthrough()
3961
4514
  )
3962
4515
  }).passthrough();
3963
- var acpUsageUpdateSchema = z34.object({
3964
- sessionUpdate: z34.literal("usage_update"),
3965
- used: z34.number().int().nonnegative(),
3966
- size: z34.number().int().nonnegative()
4516
+ var acpUsageUpdateSchema = z35.object({
4517
+ sessionUpdate: z35.literal("usage_update"),
4518
+ used: z35.number().int().nonnegative(),
4519
+ size: z35.number().int().nonnegative()
3967
4520
  }).passthrough();
3968
- var acpOtherSessionUpdateSchema = z34.object({
3969
- sessionUpdate: z34.string()
4521
+ var acpOtherSessionUpdateSchema = z35.object({
4522
+ sessionUpdate: z35.string()
3970
4523
  }).passthrough();
3971
- var acpSessionUpdateSchema = z34.union([
4524
+ var acpSessionUpdateSchema = z35.union([
3972
4525
  acpAgentMessageChunkUpdateSchema,
3973
4526
  acpAgentThoughtChunkUpdateSchema,
3974
4527
  acpToolCallUpdateEventSchema,
@@ -3976,55 +4529,55 @@ var acpSessionUpdateSchema = z34.union([
3976
4529
  acpUsageUpdateSchema,
3977
4530
  acpOtherSessionUpdateSchema
3978
4531
  ]);
3979
- var acpSessionNotificationParamsSchema = z34.object({
3980
- sessionId: z34.string(),
4532
+ var acpSessionNotificationParamsSchema = z35.object({
4533
+ sessionId: z35.string(),
3981
4534
  update: acpSessionUpdateSchema
3982
4535
  }).passthrough();
3983
4536
  var ACP_PROTOCOL_VERSION = 1;
3984
- var acpInitializeResultSchema = z34.object({
3985
- protocolVersion: z34.number(),
3986
- agentCapabilities: z34.object({
3987
- loadSession: z34.boolean().optional(),
3988
- sessionCapabilities: z34.object({
3989
- fork: z34.object({}).passthrough().nullable().optional()
4537
+ var acpInitializeResultSchema = z35.object({
4538
+ protocolVersion: z35.number(),
4539
+ agentCapabilities: z35.object({
4540
+ loadSession: z35.boolean().optional(),
4541
+ sessionCapabilities: z35.object({
4542
+ fork: z35.object({}).passthrough().nullable().optional()
3990
4543
  }).passthrough().optional(),
3991
- promptCapabilities: z34.object({
3992
- image: z34.boolean().optional(),
3993
- audio: z34.boolean().optional(),
3994
- embeddedContext: z34.boolean().optional()
4544
+ promptCapabilities: z35.object({
4545
+ image: z35.boolean().optional(),
4546
+ audio: z35.boolean().optional(),
4547
+ embeddedContext: z35.boolean().optional()
3995
4548
  }).passthrough().optional()
3996
4549
  }).passthrough().optional(),
3997
- authMethods: z34.array(z34.object({ id: z34.string() }).passthrough()).optional()
4550
+ authMethods: z35.array(z35.object({ id: z35.string() }).passthrough()).optional()
3998
4551
  }).passthrough();
3999
- var acpOptionalString = z34.union([z34.string(), z34.null()]).transform((value) => value ?? void 0).optional();
4000
- var acpConfigOptionSelectOptionSchema = z34.object({
4001
- value: z34.string(),
4552
+ var acpOptionalString = z35.union([z35.string(), z35.null()]).transform((value) => value ?? void 0).optional();
4553
+ var acpConfigOptionSelectOptionSchema = z35.object({
4554
+ value: z35.string(),
4002
4555
  name: acpOptionalString
4003
4556
  }).passthrough();
4004
- var acpConfigOptionSchema = z34.object({
4005
- id: z34.string(),
4557
+ var acpConfigOptionSchema = z35.object({
4558
+ id: z35.string(),
4006
4559
  name: acpOptionalString,
4007
4560
  category: acpOptionalString,
4008
- type: z34.string(),
4561
+ type: z35.string(),
4009
4562
  currentValue: acpOptionalString,
4010
- options: z34.array(acpConfigOptionSelectOptionSchema).optional()
4563
+ options: z35.array(acpConfigOptionSelectOptionSchema).optional()
4011
4564
  }).passthrough();
4012
- var acpSessionModelSchema = z34.object({
4013
- modelId: z34.string(),
4565
+ var acpSessionModelSchema = z35.object({
4566
+ modelId: z35.string(),
4014
4567
  name: acpOptionalString,
4015
4568
  description: acpOptionalString
4016
4569
  }).passthrough();
4017
- var acpSessionModelsSchema = z34.object({
4570
+ var acpSessionModelsSchema = z35.object({
4018
4571
  currentModelId: acpOptionalString,
4019
- availableModels: z34.array(acpSessionModelSchema).optional()
4572
+ availableModels: z35.array(acpSessionModelSchema).optional()
4020
4573
  }).passthrough();
4021
- var acpLooseConfigOptionSchema = z34.object({
4022
- id: z34.string().optional(),
4023
- name: z34.unknown().optional(),
4574
+ var acpLooseConfigOptionSchema = z35.object({
4575
+ id: z35.string().optional(),
4576
+ name: z35.unknown().optional(),
4024
4577
  category: acpOptionalString,
4025
- type: z34.unknown().optional(),
4026
- currentValue: z34.unknown().optional(),
4027
- options: z34.unknown().optional()
4578
+ type: z35.unknown().optional(),
4579
+ currentValue: z35.unknown().optional(),
4580
+ options: z35.unknown().optional()
4028
4581
  }).passthrough();
4029
4582
  function parseAcpConfigOptions(options, ctx) {
4030
4583
  if (options == null) {
@@ -4068,119 +4621,119 @@ function parseAcpConfigOptions(options, ctx) {
4068
4621
  }
4069
4622
  return parsedOptions;
4070
4623
  }
4071
- var acpSessionNewResultSchema = z34.object({
4072
- sessionId: z34.string(),
4624
+ var acpSessionNewResultSchema = z35.object({
4625
+ sessionId: z35.string(),
4073
4626
  models: acpSessionModelsSchema.optional(),
4074
- configOptions: z34.array(z34.unknown()).nullable().optional().transform((options, ctx) => parseAcpConfigOptions(options, ctx))
4627
+ configOptions: z35.array(z35.unknown()).nullable().optional().transform((options, ctx) => parseAcpConfigOptions(options, ctx))
4075
4628
  }).passthrough();
4076
- var acpConfigStateResultSchema = z34.object({
4629
+ var acpConfigStateResultSchema = z35.object({
4077
4630
  models: acpSessionModelsSchema.optional(),
4078
- configOptions: z34.array(z34.unknown()).nullable().optional().transform((options, ctx) => parseAcpConfigOptions(options, ctx))
4631
+ configOptions: z35.array(z35.unknown()).nullable().optional().transform((options, ctx) => parseAcpConfigOptions(options, ctx))
4079
4632
  }).passthrough();
4080
4633
  var acpSessionForkResultSchema = acpConfigStateResultSchema.extend({
4081
- sessionId: z34.string()
4634
+ sessionId: z35.string()
4082
4635
  });
4083
- var acpStopReasonSchema = z34.enum([
4636
+ var acpStopReasonSchema = z35.enum([
4084
4637
  "end_turn",
4085
4638
  "max_tokens",
4086
4639
  "max_turn_requests",
4087
4640
  "refusal",
4088
4641
  "cancelled"
4089
4642
  ]);
4090
- var acpPromptResultSchema = z34.object({
4643
+ var acpPromptResultSchema = z35.object({
4091
4644
  stopReason: acpStopReasonSchema
4092
4645
  }).passthrough();
4093
- var acpPermissionOptionKindSchema = z34.enum([
4646
+ var acpPermissionOptionKindSchema = z35.enum([
4094
4647
  "allow_once",
4095
4648
  "allow_always",
4096
4649
  "reject_once",
4097
4650
  "reject_always"
4098
4651
  ]);
4099
- var acpPermissionOptionSchema = z34.object({
4100
- optionId: z34.string(),
4101
- name: z34.string(),
4652
+ var acpPermissionOptionSchema = z35.object({
4653
+ optionId: z35.string(),
4654
+ name: z35.string(),
4102
4655
  kind: acpPermissionOptionKindSchema
4103
4656
  }).passthrough();
4104
- var acpRequestPermissionParamsSchema = z34.object({
4105
- sessionId: z34.string(),
4106
- toolCall: z34.preprocess(
4657
+ var acpRequestPermissionParamsSchema = z35.object({
4658
+ sessionId: z35.string(),
4659
+ toolCall: z35.preprocess(
4107
4660
  openAcpToolCallEnums,
4108
4661
  acpToolCallFieldsSchema.partial().passthrough()
4109
4662
  ).optional(),
4110
- options: z34.array(acpPermissionOptionSchema).min(1)
4663
+ options: z35.array(acpPermissionOptionSchema).min(1)
4111
4664
  }).passthrough();
4112
- var acpReadTextFileParamsSchema = z34.object({
4113
- sessionId: z34.string(),
4114
- path: z34.string(),
4115
- line: z34.number().nullable().optional(),
4116
- limit: z34.number().nullable().optional()
4665
+ var acpReadTextFileParamsSchema = z35.object({
4666
+ sessionId: z35.string(),
4667
+ path: z35.string(),
4668
+ line: z35.number().nullable().optional(),
4669
+ limit: z35.number().nullable().optional()
4117
4670
  }).passthrough();
4118
- var acpWriteTextFileParamsSchema = z34.object({
4119
- sessionId: z34.string(),
4120
- path: z34.string(),
4121
- content: z34.string()
4671
+ var acpWriteTextFileParamsSchema = z35.object({
4672
+ sessionId: z35.string(),
4673
+ path: z35.string(),
4674
+ content: z35.string()
4122
4675
  }).passthrough();
4123
4676
 
4124
4677
  // ../provider-bridge-acp/src/bridge-protocol.ts
4125
4678
  var ACP_DEFAULT_MODEL_ID = "acp-default";
4126
4679
  var acpModelListParamsSchema = modelListParamsSchema.extend({
4127
- providerOptions: z35.record(z35.string(), z35.unknown()).optional()
4680
+ providerOptions: z36.record(z36.string(), z36.unknown()).optional()
4128
4681
  });
4129
- var acpBridgeCommandSchema = z35.discriminatedUnion("method", [
4130
- z35.object({
4131
- method: z35.literal("initialize"),
4682
+ var acpBridgeCommandSchema = z36.discriminatedUnion("method", [
4683
+ z36.object({
4684
+ method: z36.literal("initialize"),
4132
4685
  params: initializeParamsSchema
4133
4686
  }),
4134
- z35.object({
4135
- method: z35.literal("model/list"),
4687
+ z36.object({
4688
+ method: z36.literal("model/list"),
4136
4689
  params: acpModelListParamsSchema
4137
4690
  }),
4138
- z35.object({
4139
- method: z35.literal("provider/health"),
4691
+ z36.object({
4692
+ method: z36.literal("provider/health"),
4140
4693
  params: providerMaintenanceParamsSchema
4141
4694
  }),
4142
- z35.object({
4143
- method: z35.literal("provider/usage"),
4695
+ z36.object({
4696
+ method: z36.literal("provider/usage"),
4144
4697
  params: providerMaintenanceParamsSchema
4145
4698
  }),
4146
- z35.object({
4147
- method: z35.literal("provider/installation/status"),
4699
+ z36.object({
4700
+ method: z36.literal("provider/installation/status"),
4148
4701
  params: providerInstallationStatusParamsSchema
4149
4702
  }),
4150
- z35.object({
4151
- method: z35.literal("provider/installation/run"),
4703
+ z36.object({
4704
+ method: z36.literal("provider/installation/run"),
4152
4705
  params: providerInstallationRunParamsSchema
4153
4706
  }),
4154
- z35.object({
4155
- method: z35.literal("thread/start"),
4707
+ z36.object({
4708
+ method: z36.literal("thread/start"),
4156
4709
  params: threadStartParamsSchema
4157
4710
  }),
4158
- z35.object({
4159
- method: z35.literal("thread/resume"),
4711
+ z36.object({
4712
+ method: z36.literal("thread/resume"),
4160
4713
  params: threadResumeParamsSchema
4161
4714
  }),
4162
- z35.object({
4163
- method: z35.literal("thread/fork"),
4715
+ z36.object({
4716
+ method: z36.literal("thread/fork"),
4164
4717
  params: threadForkParamsSchema
4165
4718
  }),
4166
- z35.object({
4167
- method: z35.literal("turn/start"),
4719
+ z36.object({
4720
+ method: z36.literal("turn/start"),
4168
4721
  params: turnStartParamsSchema
4169
4722
  }),
4170
- z35.object({
4171
- method: z35.literal("turn/steer"),
4723
+ z36.object({
4724
+ method: z36.literal("turn/steer"),
4172
4725
  params: turnSteerParamsSchema
4173
4726
  }),
4174
- z35.object({
4175
- method: z35.literal("thread/stop"),
4727
+ z36.object({
4728
+ method: z36.literal("thread/stop"),
4176
4729
  params: threadStopParamsSchema
4177
4730
  }),
4178
- z35.object({
4179
- method: z35.literal("thread/discard"),
4731
+ z36.object({
4732
+ method: z36.literal("thread/discard"),
4180
4733
  params: threadDiscardParamsSchema
4181
4734
  }),
4182
- z35.object({
4183
- method: z35.literal("skills/configure"),
4735
+ z36.object({
4736
+ method: z36.literal("skills/configure"),
4184
4737
  params: skillsConfigureParamsSchema
4185
4738
  })
4186
4739
  ]);
@@ -4195,53 +4748,53 @@ var ACP_UPDATE_METHOD = "acp/update";
4195
4748
  var ACP_FS_WRITE_METHOD = "acp/fs/write";
4196
4749
  var ACP_WARNING_METHOD = "acp/warning";
4197
4750
  var ACP_BRIDGE_NO_ACTIVE_TURN_ERROR_CODE = -32001;
4198
- var acpTurnStartedNotificationParamsSchema = z35.object({
4199
- threadId: z35.string().min(1)
4751
+ var acpTurnStartedNotificationParamsSchema = z36.object({
4752
+ threadId: z36.string().min(1)
4200
4753
  }).passthrough();
4201
- var acpTurnCompletedNotificationParamsSchema = z35.object({
4202
- threadId: z35.string().min(1),
4754
+ var acpTurnCompletedNotificationParamsSchema = z36.object({
4755
+ threadId: z36.string().min(1),
4203
4756
  stopReason: acpStopReasonSchema
4204
4757
  }).passthrough();
4205
- var acpCompactionCompletedNotificationParamsSchema = z35.discriminatedUnion("status", [
4206
- z35.object({
4207
- threadId: z35.string().min(1),
4208
- status: z35.literal("completed")
4758
+ var acpCompactionCompletedNotificationParamsSchema = z36.discriminatedUnion("status", [
4759
+ z36.object({
4760
+ threadId: z36.string().min(1),
4761
+ status: z36.literal("completed")
4209
4762
  }).passthrough(),
4210
- z35.object({
4211
- threadId: z35.string().min(1),
4212
- status: z35.literal("interrupted")
4763
+ z36.object({
4764
+ threadId: z36.string().min(1),
4765
+ status: z36.literal("interrupted")
4213
4766
  }).passthrough(),
4214
- z35.object({
4215
- threadId: z35.string().min(1),
4216
- status: z35.literal("skipped"),
4217
- detail: z35.string().min(1)
4767
+ z36.object({
4768
+ threadId: z36.string().min(1),
4769
+ status: z36.literal("skipped"),
4770
+ detail: z36.string().min(1)
4218
4771
  }).passthrough(),
4219
- z35.object({
4220
- threadId: z35.string().min(1),
4221
- status: z35.literal("failed"),
4222
- error: z35.string().min(1)
4772
+ z36.object({
4773
+ threadId: z36.string().min(1),
4774
+ status: z36.literal("failed"),
4775
+ error: z36.string().min(1)
4223
4776
  }).passthrough()
4224
4777
  ]);
4225
- var acpUpdateNotificationParamsSchema = z35.object({
4226
- threadId: z35.string().min(1),
4778
+ var acpUpdateNotificationParamsSchema = z36.object({
4779
+ threadId: z36.string().min(1),
4227
4780
  update: acpSessionUpdateSchema
4228
4781
  }).passthrough();
4229
- var acpFsWriteNotificationParamsSchema = z35.object({
4230
- threadId: z35.string().min(1),
4231
- path: z35.string().min(1),
4232
- kind: z35.enum(["add", "update"]),
4233
- oldText: z35.string().optional(),
4234
- content: z35.string()
4782
+ var acpFsWriteNotificationParamsSchema = z36.object({
4783
+ threadId: z36.string().min(1),
4784
+ path: z36.string().min(1),
4785
+ kind: z36.enum(["add", "update"]),
4786
+ oldText: z36.string().optional(),
4787
+ content: z36.string()
4235
4788
  }).passthrough();
4236
- var acpWarningNotificationParamsSchema = z35.object({
4237
- threadId: z35.string().min(1),
4238
- summary: z35.string().min(1),
4239
- details: z35.string().optional()
4789
+ var acpWarningNotificationParamsSchema = z36.object({
4790
+ threadId: z36.string().min(1),
4791
+ summary: z36.string().min(1),
4792
+ details: z36.string().optional()
4240
4793
  }).passthrough();
4241
4794
 
4242
4795
  // ../provider-bridge-acp/src/dialect.ts
4243
4796
  import { basename } from "node:path";
4244
- import { z as z39 } from "zod";
4797
+ import { z as z40 } from "zod";
4245
4798
 
4246
4799
  // ../provider-bridge-acp/src/bridge/provider-maintenance.ts
4247
4800
  import { execFile as execFile2 } from "node:child_process";
@@ -4251,7 +4804,7 @@ import os from "node:os";
4251
4804
  import path2 from "node:path";
4252
4805
  import { DatabaseSync } from "node:sqlite";
4253
4806
  import { promisify as promisify2 } from "node:util";
4254
- import { z as z36 } from "zod";
4807
+ import { z as z37 } from "zod";
4255
4808
  var execFileAsync2 = promisify2(execFile2);
4256
4809
  var USAGE_FETCH_TIMEOUT_MS = 15e3;
4257
4810
  var CURSOR_DASHBOARD_URL = "https://api2.cursor.sh/aiserver.v1.DashboardService";
@@ -4289,8 +4842,8 @@ async function readKeychainAccessToken() {
4289
4842
  return null;
4290
4843
  }
4291
4844
  }
4292
- var cursorFileCredentialsSchema = z36.object({
4293
- accessToken: z36.string().min(1).nullish()
4845
+ var cursorFileCredentialsSchema = z37.object({
4846
+ accessToken: z37.string().min(1).nullish()
4294
4847
  });
4295
4848
  async function readAccessToken() {
4296
4849
  const keychain = await readKeychainAccessToken();
@@ -4337,7 +4890,7 @@ function readAccountEmail() {
4337
4890
  database = new DatabaseSync(databasePath);
4338
4891
  database.exec("PRAGMA query_only = true");
4339
4892
  const row = database.prepare("SELECT value FROM ItemTable WHERE key = ?").get("cursorAuth/cachedEmail");
4340
- const parsed = z36.object({ value: z36.string().email() }).safeParse(row);
4893
+ const parsed = z37.object({ value: z37.string().email() }).safeParse(row);
4341
4894
  return parsed.success ? parsed.data.value : null;
4342
4895
  } catch {
4343
4896
  return null;
@@ -4441,14 +4994,14 @@ function buildAcpProviderInstallationRun(status, args) {
4441
4994
  verification: { kind: "installed" }
4442
4995
  };
4443
4996
  }
4444
- var cursorNonNegativeIntegerSchema = z36.union([
4445
- z36.number().int().nonnegative(),
4446
- z36.string().regex(/^\d+$/u).transform(Number)
4997
+ var cursorNonNegativeIntegerSchema = z37.union([
4998
+ z37.number().int().nonnegative(),
4999
+ z37.string().regex(/^\d+$/u).transform(Number)
4447
5000
  ]).refine(Number.isSafeInteger);
4448
- var cursorUsageResponseSchema = z36.object({
5001
+ var cursorUsageResponseSchema = z37.object({
4449
5002
  billingCycleEnd: cursorNonNegativeIntegerSchema.nullish(),
4450
- planUsage: z36.object({ totalPercentUsed: z36.number().nonnegative().default(0) }).nullish(),
4451
- spendLimitUsage: z36.object({
5003
+ planUsage: z37.object({ totalPercentUsed: z37.number().nonnegative().default(0) }).nullish(),
5004
+ spendLimitUsage: z37.object({
4452
5005
  overallLimit: cursorNonNegativeIntegerSchema.nullish(),
4453
5006
  overallUsed: cursorNonNegativeIntegerSchema.nullish(),
4454
5007
  individualLimit: cursorNonNegativeIntegerSchema.nullish(),
@@ -4457,8 +5010,8 @@ var cursorUsageResponseSchema = z36.object({
4457
5010
  pooledUsed: cursorNonNegativeIntegerSchema.nullish()
4458
5011
  }).nullish()
4459
5012
  }).passthrough();
4460
- var cursorPlanResponseSchema = z36.object({
4461
- planInfo: z36.object({ planName: z36.string().min(1) }).nullish()
5013
+ var cursorPlanResponseSchema = z37.object({
5014
+ planInfo: z37.object({ planName: z37.string().min(1) }).nullish()
4462
5015
  }).passthrough();
4463
5016
  function normalizeUsage(rawUsage, rawPlan, accountEmail = null) {
4464
5017
  const usage = cursorUsageResponseSchema.safeParse(rawUsage);
@@ -4670,17 +5223,17 @@ function toolKindPresentation(args) {
4670
5223
  }
4671
5224
 
4672
5225
  // ../provider-bridge-acp/src/tool-classification.ts
4673
- import { z as z38 } from "zod";
5226
+ import { z as z39 } from "zod";
4674
5227
 
4675
5228
  // ../provider-bridge-acp/src/tool-call-operation.ts
4676
5229
  import path3 from "node:path";
4677
- import { z as z37 } from "zod";
4678
- var acpRawInputCommandSchema = z37.object({ command: z37.string() }).passthrough();
4679
- var acpRawInputPathSchema = z37.object({
4680
- path: z37.string().optional(),
4681
- filePath: z37.string().optional(),
4682
- file_path: z37.string().optional(),
4683
- target_file: z37.string().optional()
5230
+ import { z as z38 } from "zod";
5231
+ var acpRawInputCommandSchema = z38.object({ command: z38.string() }).passthrough();
5232
+ var acpRawInputPathSchema = z38.object({
5233
+ path: z38.string().optional(),
5234
+ filePath: z38.string().optional(),
5235
+ file_path: z38.string().optional(),
5236
+ target_file: z38.string().optional()
4684
5237
  }).passthrough();
4685
5238
  function resolveAcpToolCallPath(value, options) {
4686
5239
  const cwd = options?.cwd;
@@ -4857,14 +5410,14 @@ function extractAcpToolCallOutputText(event) {
4857
5410
  ).trim();
4858
5411
  return rawOutputText.length > 0 ? rawOutputText : void 0;
4859
5412
  }
4860
- var commandRawOutputSchema = z38.object({
4861
- exitCode: z38.number().int().nullable().optional(),
4862
- exit_code: z38.number().int().nullable().optional(),
4863
- stdout: z38.string().optional(),
4864
- stderr: z38.string().optional(),
4865
- output_for_prompt: z38.string().optional(),
4866
- signal: z38.string().nullable().optional(),
4867
- timed_out: z38.boolean().optional()
5413
+ var commandRawOutputSchema = z39.object({
5414
+ exitCode: z39.number().int().nullable().optional(),
5415
+ exit_code: z39.number().int().nullable().optional(),
5416
+ stdout: z39.string().optional(),
5417
+ stderr: z39.string().optional(),
5418
+ output_for_prompt: z39.string().optional(),
5419
+ signal: z39.string().nullable().optional(),
5420
+ timed_out: z39.boolean().optional()
4868
5421
  }).passthrough();
4869
5422
  function emptyToUndefined(value) {
4870
5423
  return value === void 0 || value.length === 0 ? void 0 : value;
@@ -4933,10 +5486,10 @@ function extractAcpCommandResult(event) {
4933
5486
  ...output === void 0 ? {} : { output: scrubInlineImageDataUrls(output) }
4934
5487
  };
4935
5488
  }
4936
- var optionalNonBlank = z38.string().optional().transform(
5489
+ var optionalNonBlank = z39.string().optional().transform(
4937
5490
  (value) => value !== void 0 && value.trim().length > 0 ? value : void 0
4938
5491
  );
4939
- var searchRawInputSchema = z38.object({
5492
+ var searchRawInputSchema = z39.object({
4940
5493
  pattern: optionalNonBlank,
4941
5494
  query: optionalNonBlank,
4942
5495
  regex: optionalNonBlank,
@@ -4945,8 +5498,8 @@ var searchRawInputSchema = z38.object({
4945
5498
  path: optionalNonBlank,
4946
5499
  directory: optionalNonBlank
4947
5500
  }).passthrough();
4948
- var fetchRawInputSchema = z38.object({ url: optionalNonBlank, uri: optionalNonBlank }).passthrough();
4949
- var thinkRawInputSchema = z38.object({ thought: optionalNonBlank, thinking: optionalNonBlank }).passthrough();
5501
+ var fetchRawInputSchema = z39.object({ url: optionalNonBlank, uri: optionalNonBlank }).passthrough();
5502
+ var thinkRawInputSchema = z39.object({ thought: optionalNonBlank, thinking: optionalNonBlank }).passthrough();
4950
5503
  var SINGLE_TICKED_TOKEN_PATTERN = /^[^`]*`([^`\n]+)`[^`]*$/;
4951
5504
  var URL_PATTERN = /https?:\/\/[^\s`'"<>]+/g;
4952
5505
  function tickedTokenFromTitle(title) {
@@ -5139,10 +5692,10 @@ function classifyAcpToolCall2(event, injected, options) {
5139
5692
 
5140
5693
  // ../provider-bridge-acp/src/dialect.ts
5141
5694
  var GENERIC_ACP_DIALECT = { id: "acp" };
5142
- var grokToolMetaSchema = z39.object({
5143
- "x.ai/tool": z39.object({
5144
- name: z39.string().optional(),
5145
- kind: z39.string().optional()
5695
+ var grokToolMetaSchema = z40.object({
5696
+ "x.ai/tool": z40.object({
5697
+ name: z40.string().optional(),
5698
+ kind: z40.string().optional()
5146
5699
  }).passthrough()
5147
5700
  }).passthrough();
5148
5701
  function grokToolIdentity(event) {
@@ -5158,10 +5711,10 @@ function grokToolIdentity(event) {
5158
5711
  };
5159
5712
  }
5160
5713
  var GROK_SPAWN_SUBAGENT_TOOL = "spawn_subagent";
5161
- var grokSpawnSubagentInputSchema = z39.object({
5162
- description: z39.string().optional(),
5163
- prompt: z39.string().optional(),
5164
- subagent_type: z39.string().optional()
5714
+ var grokSpawnSubagentInputSchema = z40.object({
5715
+ description: z40.string().optional(),
5716
+ prompt: z40.string().optional(),
5717
+ subagent_type: z40.string().optional()
5165
5718
  }).passthrough();
5166
5719
  function grokClassifyToolCall(event) {
5167
5720
  if (grokToolIdentity(event)?.name !== GROK_SPAWN_SUBAGENT_TOOL) {
@@ -5190,14 +5743,14 @@ var GROK_ACP_DIALECT = {
5190
5743
  classifyToolCall: grokClassifyToolCall
5191
5744
  };
5192
5745
  var CURSOR_TASK_TOOL = "task";
5193
- var cursorTaskRawInputSchema = z39.object({ _toolName: z39.string().optional() }).passthrough();
5746
+ var cursorTaskRawInputSchema = z40.object({ _toolName: z40.string().optional() }).passthrough();
5194
5747
  var CURSOR_TASK_METHOD = "cursor/task";
5195
- var cursorTaskParamsSchema = z39.object({
5196
- toolCallId: z39.string(),
5197
- description: z39.string().optional(),
5198
- prompt: z39.string().optional(),
5199
- agentId: z39.string().optional(),
5200
- model: z39.string().optional()
5748
+ var cursorTaskParamsSchema = z40.object({
5749
+ toolCallId: z40.string(),
5750
+ description: z40.string().optional(),
5751
+ prompt: z40.string().optional(),
5752
+ agentId: z40.string().optional(),
5753
+ model: z40.string().optional()
5201
5754
  }).passthrough();
5202
5755
  function cursorClassifyToolCall(event) {
5203
5756
  const parsed = cursorTaskRawInputSchema.safeParse(event.rawInput);
@@ -5245,23 +5798,23 @@ var CURSOR_ACP_DIALECT = {
5245
5798
  handleClientRequest: cursorHandleClientRequest,
5246
5799
  maintenance: CURSOR_ACP_MAINTENANCE
5247
5800
  };
5248
- var ompBashRawInputSchema = z39.object({
5249
- command: z39.string(),
5250
- async: z39.boolean().optional()
5801
+ var ompBashRawInputSchema = z40.object({
5802
+ command: z40.string(),
5803
+ async: z40.boolean().optional()
5251
5804
  }).passthrough();
5252
5805
  var ompBashRawOutputSchema = commandRawOutputSchema.extend({
5253
- content: z39.array(
5254
- z39.object({
5255
- type: z39.literal("text"),
5256
- text: z39.string()
5806
+ content: z40.array(
5807
+ z40.object({
5808
+ type: z40.literal("text"),
5809
+ text: z40.string()
5257
5810
  }).passthrough()
5258
5811
  ),
5259
- details: z39.object({
5260
- exitCode: z39.number().int().optional(),
5261
- wallTimeMs: z39.number().nonnegative().optional(),
5262
- timedOut: z39.boolean().optional(),
5263
- signal: z39.unknown().optional(),
5264
- async: z39.unknown().optional()
5812
+ details: z40.object({
5813
+ exitCode: z40.number().int().optional(),
5814
+ wallTimeMs: z40.number().nonnegative().optional(),
5815
+ timedOut: z40.boolean().optional(),
5816
+ signal: z40.unknown().optional(),
5817
+ async: z40.unknown().optional()
5265
5818
  }).passthrough()
5266
5819
  });
5267
5820
  function stripOmpTrailingNotice(text, notice) {
@@ -5324,11 +5877,11 @@ var OMP_ACP_DIALECT = {
5324
5877
  id: "omp",
5325
5878
  commandResult: ompCommandResult
5326
5879
  };
5327
- var openCodeCommandRawOutputSchema = z39.object({
5328
- output: z39.unknown().optional(),
5329
- metadata: z39.object({
5330
- exit: z39.number().int().nullable().optional(),
5331
- output: z39.string().optional()
5880
+ var openCodeCommandRawOutputSchema = z40.object({
5881
+ output: z40.unknown().optional(),
5882
+ metadata: z40.object({
5883
+ exit: z40.number().int().nullable().optional(),
5884
+ output: z40.string().optional()
5332
5885
  }).passthrough().optional()
5333
5886
  }).passthrough();
5334
5887
  function normalizeOpenCodeCommandEvent(event) {
@@ -7246,7 +7799,7 @@ import { basename as basename2, dirname, join as join2, resolve as resolve2 } fr
7246
7799
  // ../provider-bridge-acp/src/bridge/tool-proxy-mcp.ts
7247
7800
  import { createConnection } from "node:net";
7248
7801
  import { createInterface as createInterface2 } from "node:readline";
7249
- import { z as z40 } from "zod";
7802
+ import { z as z41 } from "zod";
7250
7803
  var ACP_BRIDGE_MCP_SERVER_NAME = "bb-bridge";
7251
7804
  var ENV_HOST = "BB_ACP_DYNAMIC_TOOL_HOST";
7252
7805
  var ENV_PORT = "BB_ACP_DYNAMIC_TOOL_PORT";
@@ -7254,45 +7807,45 @@ var ENV_TOKEN = "BB_ACP_DYNAMIC_TOOL_TOKEN";
7254
7807
  var ENV_THREAD_ID = "BB_ACP_DYNAMIC_TOOL_THREAD_ID";
7255
7808
  var ENV_TOOLS = "BB_ACP_DYNAMIC_TOOLS";
7256
7809
  var ENV_PROGRESS_INTERVAL_MS = "BB_ACP_DYNAMIC_TOOL_PROGRESS_INTERVAL_MS";
7257
- var dynamicToolBridgeRequestSchema = z40.discriminatedUnion("kind", [
7258
- z40.object({
7259
- kind: z40.literal("initialized"),
7260
- threadId: z40.string().min(1),
7261
- token: z40.string().min(1),
7262
- toolCount: z40.number().int().nonnegative()
7810
+ var dynamicToolBridgeRequestSchema = z41.discriminatedUnion("kind", [
7811
+ z41.object({
7812
+ kind: z41.literal("initialized"),
7813
+ threadId: z41.string().min(1),
7814
+ token: z41.string().min(1),
7815
+ toolCount: z41.number().int().nonnegative()
7263
7816
  }),
7264
- z40.object({
7265
- kind: z40.literal("toolCall"),
7266
- arguments: z40.record(z40.string(), z40.unknown()).default({}),
7267
- callId: z40.string().min(1),
7268
- threadId: z40.string().min(1),
7269
- token: z40.string().min(1),
7270
- tool: z40.string().min(1)
7817
+ z41.object({
7818
+ kind: z41.literal("toolCall"),
7819
+ arguments: z41.record(z41.string(), z41.unknown()).default({}),
7820
+ callId: z41.string().min(1),
7821
+ threadId: z41.string().min(1),
7822
+ token: z41.string().min(1),
7823
+ tool: z41.string().min(1)
7271
7824
  })
7272
7825
  ]);
7273
- var bridgeToolCallResponseSchema = z40.union([
7274
- z40.object({
7275
- ok: z40.literal(true),
7276
- content: z40.string(),
7277
- contentBlocks: z40.array(
7278
- z40.discriminatedUnion("type", [
7279
- z40.object({ type: z40.literal("text"), text: z40.string() }),
7280
- z40.object({
7281
- type: z40.literal("image"),
7282
- data: z40.string(),
7283
- mimeType: z40.string()
7826
+ var bridgeToolCallResponseSchema = z41.union([
7827
+ z41.object({
7828
+ ok: z41.literal(true),
7829
+ content: z41.string(),
7830
+ contentBlocks: z41.array(
7831
+ z41.discriminatedUnion("type", [
7832
+ z41.object({ type: z41.literal("text"), text: z41.string() }),
7833
+ z41.object({
7834
+ type: z41.literal("image"),
7835
+ data: z41.string(),
7836
+ mimeType: z41.string()
7284
7837
  })
7285
7838
  ])
7286
7839
  ).optional(),
7287
- images: z40.array(z40.object({ data: z40.string(), mimeType: z40.string() })).default([]),
7288
- isError: z40.boolean().optional()
7840
+ images: z41.array(z41.object({ data: z41.string(), mimeType: z41.string() })).default([]),
7841
+ isError: z41.boolean().optional()
7289
7842
  }),
7290
- z40.object({ ok: z40.literal(false), error: z40.string() })
7843
+ z41.object({ ok: z41.literal(false), error: z41.string() })
7291
7844
  ]);
7292
- var jsonRpcMessageSchema = z40.object({
7293
- id: z40.union([z40.string(), z40.number().int()]).optional(),
7294
- method: z40.string().optional(),
7295
- params: z40.unknown().optional()
7845
+ var jsonRpcMessageSchema = z41.object({
7846
+ id: z41.union([z41.string(), z41.number().int()]).optional(),
7847
+ method: z41.string().optional(),
7848
+ params: z41.unknown().optional()
7296
7849
  });
7297
7850
  var nextMcpToolCallId = 0;
7298
7851
  var TOOL_CALL_PROGRESS_INTERVAL_MS = 15e3;
@@ -8066,7 +8619,7 @@ async function authenticateAcpAgent(args) {
8066
8619
  await args.connection.request({
8067
8620
  method: "authenticate",
8068
8621
  params: { methodId, _meta: { headless: true } },
8069
- resultSchema: z41.unknown()
8622
+ resultSchema: z42.unknown()
8070
8623
  });
8071
8624
  } catch (error) {
8072
8625
  throw new AcpAuthRequiredError(
@@ -8396,7 +8949,7 @@ async function selectAcpNativeModel(args) {
8396
8949
  configId: modelOption.id,
8397
8950
  value: selection.modelId
8398
8951
  },
8399
- resultSchema: z41.union([acpConfigStateResultSchema, z41.null()])
8952
+ resultSchema: z42.union([acpConfigStateResultSchema, z42.null()])
8400
8953
  });
8401
8954
  setModel = false;
8402
8955
  } catch {
@@ -8407,7 +8960,7 @@ async function selectAcpNativeModel(args) {
8407
8960
  configState = await args.connection.request({
8408
8961
  method: "session/set_model",
8409
8962
  params: { sessionId: args.sessionId, modelId: selection.modelId },
8410
- resultSchema: z41.union([acpConfigStateResultSchema, z41.null()])
8963
+ resultSchema: z42.union([acpConfigStateResultSchema, z42.null()])
8411
8964
  });
8412
8965
  }
8413
8966
  configOptions = configState?.configOptions ?? configOptions;
@@ -8904,7 +9457,7 @@ async function startAgentSession(request) {
8904
9457
  cwd: params.cwd,
8905
9458
  mcpServers
8906
9459
  },
8907
- resultSchema: z41.union([acpConfigStateResultSchema, z41.null()])
9460
+ resultSchema: z42.union([acpConfigStateResultSchema, z42.null()])
8908
9461
  });
8909
9462
  loadedConfigOptions = configState?.configOptions;
8910
9463
  loadedModels = configState?.models;
@@ -9350,12 +9903,12 @@ function decodeLaunchSpec(providerOptions) {
9350
9903
  );
9351
9904
  return launchSpec.success ? launchSpec.data : null;
9352
9905
  }
9353
- var acpProviderOptionsSchema = z41.object({
9354
- additionalWorkspaceWriteRoots: z41.array(z41.string()).optional(),
9355
- acpDialect: z41.string().min(1).optional(),
9356
- parameterizedModelPicker: z41.boolean().optional(),
9357
- primaryModels: z41.array(z41.string().min(1)).optional(),
9358
- reasoningProbePriorityModelIds: z41.array(z41.string().min(1)).optional()
9906
+ var acpProviderOptionsSchema = z42.object({
9907
+ additionalWorkspaceWriteRoots: z42.array(z42.string()).optional(),
9908
+ acpDialect: z42.string().min(1).optional(),
9909
+ parameterizedModelPicker: z42.boolean().optional(),
9910
+ primaryModels: z42.array(z42.string().min(1)).optional(),
9911
+ reasoningProbePriorityModelIds: z42.array(z42.string().min(1)).optional()
9359
9912
  }).passthrough();
9360
9913
  function decodeAcpModelPickerOptions(providerOptions) {
9361
9914
  const parsed = acpProviderOptionsSchema.parse(providerOptions ?? {});
@@ -9672,7 +10225,7 @@ var experimental_providerBridge = experimental_defineProviderBridge({
9672
10225
  });
9673
10226
 
9674
10227
  // ../provider-bridge-acp/src/probe.ts
9675
- import { z as z42 } from "zod";
10228
+ import { z as z43 } from "zod";
9676
10229
  var PROBE_TIMEOUT_MS = 1e4;
9677
10230
  function describe(error) {
9678
10231
  if (error instanceof AcpAgentExitedError) {
@@ -9730,9 +10283,9 @@ async function probeAcpAgent(request) {
9730
10283
  connected.kill();
9731
10284
  }
9732
10285
  }
9733
- var acpAgentProbeSchema = z42.union([
9734
- z42.object({ reachable: z42.literal(true), fork: z42.boolean() }),
9735
- z42.object({ reachable: z42.literal(false), reason: z42.string() })
10286
+ var acpAgentProbeSchema = z43.union([
10287
+ z43.object({ reachable: z43.literal(true), fork: z43.boolean() }),
10288
+ z43.object({ reachable: z43.literal(false), reason: z43.string() })
9736
10289
  ]);
9737
10290
  export {
9738
10291
  acpAgentProbeSchema as experimental_acpAgentProbeSchema,