@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.
- package/bundled-types/bb-plugin-sdk-app.d.ts +13 -2
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +15 -0
- package/bundled-types/bb-plugin-sdk-machine-provider.d.ts +2 -0
- package/bundled-types/bb-plugin-sdk-testing.d.ts +15 -0
- package/bundled-types/bb-plugin-sdk.d.ts +53 -3
- package/dist/internal/host-policy.js +116 -93
- package/dist/provider-bridge-acp.js +2114 -1561
- package/dist/provider-bridge-testing.js +1232 -1226
- package/dist/provider-bridge.js +1812 -1310
- package/dist/testing/index.js +116 -93
- package/package.json +1 -1
|
@@ -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/
|
|
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 =
|
|
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 =
|
|
648
|
-
var workflowAgentSnapshotSchema =
|
|
649
|
-
index:
|
|
650
|
-
label:
|
|
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:
|
|
653
|
-
attempt:
|
|
654
|
-
cached:
|
|
655
|
-
lastProgressAt:
|
|
656
|
-
phaseIndex:
|
|
657
|
-
phaseTitle:
|
|
658
|
-
agentType:
|
|
659
|
-
isolation:
|
|
660
|
-
queuedAt:
|
|
661
|
-
startedAt:
|
|
662
|
-
lastToolName:
|
|
663
|
-
lastToolSummary:
|
|
664
|
-
promptPreview:
|
|
665
|
-
resultPreview:
|
|
666
|
-
error:
|
|
667
|
-
tokens:
|
|
668
|
-
toolCalls:
|
|
669
|
-
durationMs:
|
|
670
|
-
});
|
|
671
|
-
var workflowPhaseSnapshotSchema =
|
|
672
|
-
index:
|
|
673
|
-
title:
|
|
674
|
-
kind:
|
|
675
|
-
});
|
|
676
|
-
var workflowProgressSnapshotSchema =
|
|
677
|
-
phases:
|
|
678
|
-
agents:
|
|
679
|
-
});
|
|
680
|
-
var backgroundTaskUsageSchema =
|
|
681
|
-
totalTokens:
|
|
682
|
-
toolUses:
|
|
683
|
-
durationMs:
|
|
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
|
|
1233
|
+
import { z as z16 } from "zod";
|
|
688
1234
|
|
|
689
1235
|
// ../domain/src/thread-events.ts
|
|
690
|
-
import { z as
|
|
1236
|
+
import { z as z13 } from "zod";
|
|
691
1237
|
|
|
692
1238
|
// ../domain/src/pending-interactions.ts
|
|
693
|
-
import { z as
|
|
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
|
|
1249
|
+
import { z as z8 } from "zod";
|
|
704
1250
|
var THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH = 280;
|
|
705
|
-
var threadEventItemPresentationLabelSchema =
|
|
706
|
-
pending:
|
|
707
|
-
completed:
|
|
1251
|
+
var threadEventItemPresentationLabelSchema = z8.object({
|
|
1252
|
+
pending: z8.string().min(1),
|
|
1253
|
+
completed: z8.string().min(1)
|
|
708
1254
|
});
|
|
709
|
-
var threadEventItemPresentationIconSchema =
|
|
710
|
-
glyph:
|
|
1255
|
+
var threadEventItemPresentationIconSchema = z8.object({
|
|
1256
|
+
glyph: z8.string().min(1)
|
|
711
1257
|
});
|
|
712
|
-
var threadEventItemPresentationTintSchema =
|
|
713
|
-
light:
|
|
714
|
-
dark:
|
|
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 =
|
|
718
|
-
glyph:
|
|
719
|
-
label:
|
|
720
|
-
hint:
|
|
721
|
-
tone:
|
|
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 =
|
|
1269
|
+
var threadEventItemPresentationSchema = z8.object({
|
|
724
1270
|
label: threadEventItemPresentationLabelSchema,
|
|
725
1271
|
icon: threadEventItemPresentationIconSchema,
|
|
726
|
-
title:
|
|
727
|
-
detail:
|
|
728
|
-
suppress:
|
|
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
|
|
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 =
|
|
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 =
|
|
1290
|
+
var pendingInteractionStatusSchema = z10.enum([
|
|
745
1291
|
"pending",
|
|
746
1292
|
"resolving",
|
|
747
1293
|
"resolved",
|
|
748
1294
|
"interrupted"
|
|
749
1295
|
]);
|
|
750
|
-
var pendingInteractionCommandActionSchema =
|
|
1296
|
+
var pendingInteractionCommandActionSchema = z10.discriminatedUnion(
|
|
751
1297
|
"type",
|
|
752
1298
|
[
|
|
753
|
-
|
|
754
|
-
type:
|
|
755
|
-
command:
|
|
756
|
-
name:
|
|
757
|
-
path:
|
|
1299
|
+
z10.object({
|
|
1300
|
+
type: z10.literal("read"),
|
|
1301
|
+
command: z10.string(),
|
|
1302
|
+
name: z10.string(),
|
|
1303
|
+
path: z10.string()
|
|
758
1304
|
}),
|
|
759
|
-
|
|
760
|
-
type:
|
|
761
|
-
command:
|
|
762
|
-
path:
|
|
1305
|
+
z10.object({
|
|
1306
|
+
type: z10.literal("listFiles"),
|
|
1307
|
+
command: z10.string(),
|
|
1308
|
+
path: z10.string().nullable()
|
|
763
1309
|
}),
|
|
764
|
-
|
|
765
|
-
type:
|
|
766
|
-
command:
|
|
767
|
-
query:
|
|
768
|
-
path:
|
|
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
|
-
|
|
771
|
-
type:
|
|
772
|
-
command:
|
|
1316
|
+
z10.object({
|
|
1317
|
+
type: z10.literal("unknown"),
|
|
1318
|
+
command: z10.string()
|
|
773
1319
|
})
|
|
774
1320
|
]
|
|
775
1321
|
);
|
|
776
|
-
var pendingInteractionNetworkPermissionsSchema =
|
|
777
|
-
enabled:
|
|
1322
|
+
var pendingInteractionNetworkPermissionsSchema = z10.object({
|
|
1323
|
+
enabled: z10.boolean().nullable()
|
|
778
1324
|
});
|
|
779
|
-
var pendingInteractionFileSystemPermissionsSchema =
|
|
780
|
-
read:
|
|
781
|
-
write:
|
|
1325
|
+
var pendingInteractionFileSystemPermissionsSchema = z10.object({
|
|
1326
|
+
read: z10.array(z10.string()),
|
|
1327
|
+
write: z10.array(z10.string())
|
|
782
1328
|
});
|
|
783
|
-
var pendingInteractionMacOsPreferencesPermissionSchema =
|
|
1329
|
+
var pendingInteractionMacOsPreferencesPermissionSchema = z10.enum([
|
|
784
1330
|
"none",
|
|
785
1331
|
"read_only",
|
|
786
1332
|
"read_write"
|
|
787
1333
|
]);
|
|
788
|
-
var pendingInteractionMacOsContactsPermissionSchema =
|
|
1334
|
+
var pendingInteractionMacOsContactsPermissionSchema = z10.enum([
|
|
789
1335
|
"none",
|
|
790
1336
|
"read_only",
|
|
791
1337
|
"read_write"
|
|
792
1338
|
]);
|
|
793
|
-
var pendingInteractionMacOsAutomationPermissionSchema =
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
kind:
|
|
798
|
-
bundleIds:
|
|
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 =
|
|
1347
|
+
var pendingInteractionMacOsPermissionsSchema = z10.object({
|
|
802
1348
|
preferences: pendingInteractionMacOsPreferencesPermissionSchema,
|
|
803
1349
|
automations: pendingInteractionMacOsAutomationPermissionSchema,
|
|
804
|
-
launchServices:
|
|
805
|
-
accessibility:
|
|
806
|
-
calendar:
|
|
807
|
-
reminders:
|
|
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 =
|
|
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 =
|
|
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 =
|
|
1366
|
+
var pendingInteractionApprovalDecisionSchema = z10.enum([
|
|
821
1367
|
"allow_once",
|
|
822
1368
|
"allow_for_session",
|
|
823
1369
|
"deny"
|
|
824
1370
|
]);
|
|
825
|
-
var pendingInteractionFileChangeWriteScopeSchema =
|
|
826
|
-
var pendingInteractionCommandApprovalSubjectSchema =
|
|
827
|
-
kind:
|
|
828
|
-
itemId:
|
|
829
|
-
command:
|
|
830
|
-
cwd:
|
|
831
|
-
actions:
|
|
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 =
|
|
835
|
-
kind:
|
|
836
|
-
itemId:
|
|
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 =
|
|
841
|
-
kind:
|
|
842
|
-
itemId:
|
|
843
|
-
toolName:
|
|
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 =
|
|
847
|
-
kind:
|
|
848
|
-
itemId:
|
|
849
|
-
plan:
|
|
850
|
-
planFilePath:
|
|
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 =
|
|
853
|
-
kind:
|
|
854
|
-
itemId:
|
|
855
|
-
tool:
|
|
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 =
|
|
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 =
|
|
866
|
-
kind:
|
|
1411
|
+
var approvalPendingInteractionPayloadSchema = z10.object({
|
|
1412
|
+
kind: z10.literal("approval"),
|
|
867
1413
|
subject: pendingInteractionApprovalSubjectSchema,
|
|
868
|
-
reason:
|
|
869
|
-
availableDecisions:
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
1445
|
+
var pendingInteractionUserQuestionOptionSchema = z10.object({
|
|
900
1446
|
value: pendingInteractionUserQuestionOptionValueSchema,
|
|
901
1447
|
label: pendingInteractionUserQuestionOptionLabelSchema,
|
|
902
1448
|
description: pendingInteractionUserQuestionOptionDescriptionSchema.optional()
|
|
903
1449
|
});
|
|
904
|
-
var pendingInteractionUserQuestionQuestionSchema =
|
|
1450
|
+
var pendingInteractionUserQuestionQuestionSchema = z10.object({
|
|
905
1451
|
id: pendingInteractionUserQuestionIdSchema,
|
|
906
1452
|
prompt: pendingInteractionUserQuestionPromptSchema,
|
|
907
1453
|
shortLabel: pendingInteractionUserQuestionShortLabelSchema.optional(),
|
|
908
|
-
multiSelect:
|
|
909
|
-
options:
|
|
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:
|
|
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:
|
|
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 =
|
|
935
|
-
kind:
|
|
936
|
-
questions:
|
|
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:
|
|
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 =
|
|
955
|
-
kind:
|
|
956
|
-
title:
|
|
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 =
|
|
1505
|
+
var pluginExtensionInteractionRequestPayloadSchema = z10.object({
|
|
960
1506
|
kind: extensionKindSchema,
|
|
961
|
-
title:
|
|
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 =
|
|
1513
|
+
var interactionRequestPayloadSchema = z10.union([
|
|
968
1514
|
userQuestionPendingInteractionPayloadSchema,
|
|
969
1515
|
pluginExtensionInteractionRequestPayloadSchema
|
|
970
1516
|
]);
|
|
971
|
-
var pendingInteractionPayloadSchema =
|
|
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 =
|
|
1526
|
+
var approvalPendingInteractionResolutionSchema = z10.discriminatedUnion(
|
|
981
1527
|
"decision",
|
|
982
1528
|
[
|
|
983
|
-
|
|
984
|
-
decision:
|
|
1529
|
+
z10.object({
|
|
1530
|
+
decision: z10.literal("allow_once"),
|
|
985
1531
|
grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
|
|
986
1532
|
}),
|
|
987
|
-
|
|
988
|
-
decision:
|
|
1533
|
+
z10.object({
|
|
1534
|
+
decision: z10.literal("allow_for_session"),
|
|
989
1535
|
grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
|
|
990
1536
|
}),
|
|
991
|
-
|
|
992
|
-
decision:
|
|
1537
|
+
z10.object({
|
|
1538
|
+
decision: z10.literal("deny")
|
|
993
1539
|
})
|
|
994
1540
|
],
|
|
995
1541
|
approvalDecisionDiscriminatorError
|
|
996
1542
|
);
|
|
997
|
-
var pendingInteractionUserAnswerSchema =
|
|
998
|
-
selected:
|
|
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 =
|
|
1005
|
-
kind:
|
|
1006
|
-
answers:
|
|
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 =
|
|
1009
|
-
kind:
|
|
1554
|
+
var pluginPendingInteractionResolutionSchema = z10.object({
|
|
1555
|
+
kind: z10.literal("plugin_submitted")
|
|
1010
1556
|
});
|
|
1011
|
-
var pluginExtensionInteractionResolutionSchema =
|
|
1012
|
-
kind:
|
|
1557
|
+
var pluginExtensionInteractionResolutionSchema = z10.object({
|
|
1558
|
+
kind: z10.literal("request_answer"),
|
|
1013
1559
|
value: jsonValueSchema
|
|
1014
1560
|
});
|
|
1015
|
-
var pendingInteractionResolutionSchema =
|
|
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 =
|
|
1573
|
+
var approvalInteractionOutcomeSchema = z10.object({
|
|
1028
1574
|
payload: approvalPendingInteractionPayloadSchema,
|
|
1029
1575
|
resolution: approvalPendingInteractionResolutionSchema
|
|
1030
1576
|
});
|
|
1031
|
-
var userQuestionInteractionOutcomeSchema =
|
|
1577
|
+
var userQuestionInteractionOutcomeSchema = z10.object({
|
|
1032
1578
|
payload: userQuestionPendingInteractionPayloadSchema,
|
|
1033
1579
|
resolution: userQuestionPendingInteractionResolutionSchema
|
|
1034
1580
|
});
|
|
1035
|
-
var pluginExtensionInteractionOutcomeSchema =
|
|
1581
|
+
var pluginExtensionInteractionOutcomeSchema = z10.object({
|
|
1036
1582
|
payload: pluginExtensionInteractionRequestPayloadSchema,
|
|
1037
1583
|
resolution: pluginExtensionInteractionResolutionSchema
|
|
1038
1584
|
});
|
|
1039
|
-
var providerInteractionOutcomeSchema =
|
|
1585
|
+
var providerInteractionOutcomeSchema = z10.union([
|
|
1040
1586
|
approvalInteractionOutcomeSchema,
|
|
1041
1587
|
userQuestionInteractionOutcomeSchema,
|
|
1042
1588
|
pluginExtensionInteractionOutcomeSchema
|
|
1043
1589
|
]);
|
|
1044
|
-
var pendingInteractionProviderOriginSchema =
|
|
1045
|
-
kind:
|
|
1046
|
-
providerId:
|
|
1047
|
-
providerThreadId:
|
|
1048
|
-
providerRequestId:
|
|
1049
|
-
});
|
|
1050
|
-
var pendingInteractionPluginOriginSchema =
|
|
1051
|
-
kind:
|
|
1052
|
-
pluginId:
|
|
1053
|
-
rendererId:
|
|
1054
|
-
});
|
|
1055
|
-
var pendingInteractionCreateSchema =
|
|
1056
|
-
threadId:
|
|
1057
|
-
turnId:
|
|
1058
|
-
providerId:
|
|
1059
|
-
providerThreadId:
|
|
1060
|
-
providerRequestId:
|
|
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 =
|
|
1064
|
-
id:
|
|
1065
|
-
threadId:
|
|
1609
|
+
var pendingInteractionBaseSchema = z10.object({
|
|
1610
|
+
id: z10.string().min(1),
|
|
1611
|
+
threadId: z10.string().min(1),
|
|
1066
1612
|
status: pendingInteractionStatusSchema,
|
|
1067
|
-
statusReason:
|
|
1068
|
-
createdAt:
|
|
1069
|
-
expiresAt:
|
|
1070
|
-
resolvedAt:
|
|
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:
|
|
1074
|
-
providerId:
|
|
1075
|
-
providerThreadId:
|
|
1076
|
-
providerRequestId:
|
|
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 =
|
|
1637
|
+
var providerPendingInteractionSchema = z10.union([
|
|
1092
1638
|
approvalPendingInteractionSchema,
|
|
1093
1639
|
userQuestionPendingInteractionSchema,
|
|
1094
1640
|
pluginExtensionPendingInteractionSchema
|
|
1095
1641
|
]);
|
|
1096
1642
|
var pluginPendingInteractionSchema = pendingInteractionBaseSchema.extend({
|
|
1097
|
-
turnId:
|
|
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 =
|
|
1648
|
+
var pendingInteractionSchema = z10.union([
|
|
1103
1649
|
providerPendingInteractionSchema,
|
|
1104
1650
|
pluginPendingInteractionSchema
|
|
1105
1651
|
]);
|
|
1106
|
-
var interactionLifecycleRecordBaseSchema =
|
|
1107
|
-
id:
|
|
1652
|
+
var interactionLifecycleRecordBaseSchema = z10.object({
|
|
1653
|
+
id: z10.string().min(1),
|
|
1108
1654
|
status: pendingInteractionStatusSchema,
|
|
1109
|
-
statusReason:
|
|
1655
|
+
statusReason: z10.string().nullable()
|
|
1110
1656
|
});
|
|
1111
|
-
var interactionLifecycleProviderOriginSchema =
|
|
1112
|
-
kind:
|
|
1113
|
-
providerId:
|
|
1114
|
-
providerRequestId:
|
|
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 =
|
|
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
|
|
1148
|
-
var clientTurnRequestIdSchema =
|
|
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
|
|
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 =
|
|
1163
|
-
var systemMessageSubjectSchema =
|
|
1164
|
-
|
|
1165
|
-
kind:
|
|
1166
|
-
threadId:
|
|
1167
|
-
threadName:
|
|
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
|
-
|
|
1170
|
-
kind:
|
|
1171
|
-
count:
|
|
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 =
|
|
1740
|
+
var threadTurnInitiatorSchema = z13.enum(threadTurnInitiatorValues);
|
|
1195
1741
|
var turnRequestOptionsSchema = recordedThreadExecutionOptionsSchema;
|
|
1196
|
-
var turnRequestTargetSchema =
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
kind:
|
|
1201
|
-
expectedTurnId:
|
|
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
|
-
|
|
1204
|
-
kind:
|
|
1205
|
-
expectedTurnId:
|
|
1749
|
+
z13.object({
|
|
1750
|
+
kind: z13.literal("steer"),
|
|
1751
|
+
expectedTurnId: z13.string().nullable()
|
|
1206
1752
|
})
|
|
1207
1753
|
]);
|
|
1208
|
-
var clientTurnLifecycleEventDataSchema =
|
|
1209
|
-
direction:
|
|
1210
|
-
source:
|
|
1754
|
+
var clientTurnLifecycleEventDataSchema = z13.object({
|
|
1755
|
+
direction: z13.literal("outbound"),
|
|
1756
|
+
source: z13.enum(["spawn", "tell"]),
|
|
1211
1757
|
initiator: threadTurnInitiatorSchema,
|
|
1212
|
-
request:
|
|
1213
|
-
method:
|
|
1214
|
-
params:
|
|
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 =
|
|
1218
|
-
direction:
|
|
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:
|
|
1229
|
-
source:
|
|
1774
|
+
retryAttempt: z13.number().int().min(2).optional(),
|
|
1775
|
+
source: z13.enum(["spawn", "tell"]),
|
|
1230
1776
|
initiator: threadTurnInitiatorSchema,
|
|
1231
|
-
senderThreadId:
|
|
1777
|
+
senderThreadId: z13.string().nullable(),
|
|
1232
1778
|
systemMessageKind: systemMessageKindSchema.optional(),
|
|
1233
1779
|
systemMessageSubject: systemMessageSubjectSchema.nullable().optional(),
|
|
1234
|
-
input:
|
|
1235
|
-
inputGroups:
|
|
1780
|
+
input: z13.array(promptInputSchema),
|
|
1781
|
+
inputGroups: z13.array(z13.array(promptInputSchema).min(1)).min(1).optional(),
|
|
1236
1782
|
target: turnRequestTargetSchema,
|
|
1237
|
-
request:
|
|
1238
|
-
method:
|
|
1239
|
-
params:
|
|
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 =
|
|
1789
|
+
var turnRequestRejectedEventDataSchema = z13.object({
|
|
1244
1790
|
requestId: clientTurnRequestIdSchema,
|
|
1245
|
-
reason:
|
|
1246
|
-
message:
|
|
1247
|
-
});
|
|
1248
|
-
var systemErrorEventDataSchema =
|
|
1249
|
-
code:
|
|
1250
|
-
message:
|
|
1251
|
-
detail:
|
|
1252
|
-
reconnectAttempt:
|
|
1253
|
-
reconnectTotal:
|
|
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:
|
|
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:
|
|
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 =
|
|
1822
|
+
var ownershipChangeOperationActionSchema = z13.enum(
|
|
1277
1823
|
ownershipChangeOperationActionValues
|
|
1278
1824
|
);
|
|
1279
|
-
var ownershipChangeOperationMetadataSchema =
|
|
1825
|
+
var ownershipChangeOperationMetadataSchema = z13.object({
|
|
1280
1826
|
action: ownershipChangeOperationActionSchema,
|
|
1281
|
-
nextParentThreadId:
|
|
1282
|
-
nextParentThreadTitle:
|
|
1283
|
-
previousParentThreadId:
|
|
1284
|
-
previousParentThreadTitle:
|
|
1285
|
-
});
|
|
1286
|
-
var systemOperationEventDataSchema =
|
|
1287
|
-
operation:
|
|
1288
|
-
status:
|
|
1289
|
-
message:
|
|
1290
|
-
operationId:
|
|
1291
|
-
metadata:
|
|
1292
|
-
});
|
|
1293
|
-
var systemInteractionLifecycleEventDataSchema =
|
|
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 =
|
|
1297
|
-
interactionId:
|
|
1298
|
-
providerId:
|
|
1299
|
-
providerRequestId:
|
|
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:
|
|
1848
|
+
statusReason: z13.string().nullable().default(null),
|
|
1303
1849
|
subject: pendingInteractionPermissionGrantApprovalSubjectSchema
|
|
1304
1850
|
});
|
|
1305
|
-
var systemUserQuestionLifecycleEventDataSchema =
|
|
1306
|
-
interactionId:
|
|
1307
|
-
providerId:
|
|
1308
|
-
providerRequestId:
|
|
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:
|
|
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 =
|
|
1865
|
+
var systemThreadInterruptedReasonSchema = z13.enum(
|
|
1320
1866
|
systemThreadInterruptedReasonValues
|
|
1321
1867
|
);
|
|
1322
|
-
var systemThreadInterruptedEventDataSchema =
|
|
1868
|
+
var systemThreadInterruptedEventDataSchema = z13.object({
|
|
1323
1869
|
reason: systemThreadInterruptedReasonSchema,
|
|
1324
|
-
cause:
|
|
1870
|
+
cause: z13.literal("host-connection-lost").optional()
|
|
1325
1871
|
});
|
|
1326
|
-
var provisioningTranscriptEntrySchema =
|
|
1327
|
-
type:
|
|
1328
|
-
key:
|
|
1329
|
-
text:
|
|
1330
|
-
startedAt:
|
|
1331
|
-
status:
|
|
1332
|
-
metadata:
|
|
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 =
|
|
1886
|
+
var systemThreadProvisioningStatusSchema = z13.enum(
|
|
1341
1887
|
systemThreadProvisioningStatusValues
|
|
1342
1888
|
);
|
|
1343
|
-
var systemThreadProvisioningEventDataSchema =
|
|
1344
|
-
provisioningId:
|
|
1889
|
+
var systemThreadProvisioningEventDataSchema = z13.object({
|
|
1890
|
+
provisioningId: z13.string(),
|
|
1345
1891
|
status: systemThreadProvisioningStatusSchema,
|
|
1346
|
-
environmentId:
|
|
1347
|
-
entries:
|
|
1348
|
-
});
|
|
1349
|
-
var systemLegacyUserMessageEventDataSchema =
|
|
1350
|
-
text:
|
|
1351
|
-
toolCallId:
|
|
1352
|
-
turnId:
|
|
1353
|
-
});
|
|
1354
|
-
var systemProviderTurnWatchdogEventDataSchema =
|
|
1355
|
-
reason:
|
|
1356
|
-
thresholdMs:
|
|
1357
|
-
elapsedMs:
|
|
1358
|
-
activeTurnId:
|
|
1359
|
-
activeTurnStartedAt:
|
|
1360
|
-
lastActivityEventSequence:
|
|
1361
|
-
lastActivityEventType:
|
|
1362
|
-
lastActivityEventAt:
|
|
1363
|
-
providerId:
|
|
1364
|
-
providerThreadId:
|
|
1365
|
-
firedAt:
|
|
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
|
|
1915
|
+
import { z as z14 } from "zod";
|
|
1370
1916
|
var threadEventScopeKindValues = ["thread", "turn"];
|
|
1371
|
-
var threadEventScopeKindSchema =
|
|
1372
|
-
var threadEventScopeSchema =
|
|
1373
|
-
|
|
1374
|
-
|
|
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 =
|
|
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
|
|
1548
|
-
var threadTimelineGoalStatusSchema =
|
|
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 =
|
|
1555
|
-
sourceSeq:
|
|
1556
|
-
updatedAt:
|
|
1557
|
-
objective:
|
|
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:
|
|
1560
|
-
tokensUsed:
|
|
1561
|
-
timeUsedSeconds:
|
|
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 =
|
|
2111
|
+
var threadEventItemStatusSchema = z16.enum([
|
|
1566
2112
|
"pending",
|
|
1567
2113
|
"completed",
|
|
1568
2114
|
"failed",
|
|
1569
2115
|
"interrupted"
|
|
1570
2116
|
]);
|
|
1571
|
-
var threadEventItemApprovalStatusSchema =
|
|
1572
|
-
var threadEventTurnStatusSchema =
|
|
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 =
|
|
1599
|
-
var providerErrorInfoSchema =
|
|
2144
|
+
var providerErrorCategorySchema = z16.enum(providerErrorCategoryValues);
|
|
2145
|
+
var providerErrorInfoSchema = z16.object({
|
|
1600
2146
|
category: providerErrorCategorySchema,
|
|
1601
|
-
providerCode:
|
|
1602
|
-
httpStatusCode:
|
|
2147
|
+
providerCode: z16.string().nullable(),
|
|
2148
|
+
httpStatusCode: z16.number().nullable()
|
|
1603
2149
|
});
|
|
1604
|
-
var providerRateLimitStatusSchema =
|
|
2150
|
+
var providerRateLimitStatusSchema = z16.enum([
|
|
1605
2151
|
"allowed",
|
|
1606
2152
|
"warning",
|
|
1607
2153
|
"blocked",
|
|
1608
2154
|
"unknown"
|
|
1609
2155
|
]);
|
|
1610
|
-
var providerRateLimitWindowSchema =
|
|
1611
|
-
providerKey:
|
|
1612
|
-
label:
|
|
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:
|
|
2160
|
+
resetsAtMs: z16.number().int().nonnegative().nullable()
|
|
1615
2161
|
});
|
|
1616
|
-
var providerRateLimitStateSchema =
|
|
1617
|
-
providerId:
|
|
2162
|
+
var providerRateLimitStateSchema = z16.object({
|
|
2163
|
+
providerId: z16.string().min(1),
|
|
1618
2164
|
status: providerRateLimitStatusSchema,
|
|
1619
|
-
kind:
|
|
1620
|
-
windows:
|
|
1621
|
-
reachedReason:
|
|
1622
|
-
overageStatus:
|
|
1623
|
-
overageReason:
|
|
1624
|
-
});
|
|
1625
|
-
var threadEventFileChangeKindSchema =
|
|
1626
|
-
var threadEventFileChangeSchema =
|
|
1627
|
-
path:
|
|
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:
|
|
1630
|
-
diff:
|
|
2175
|
+
movePath: z16.string().optional(),
|
|
2176
|
+
diff: z16.string().optional()
|
|
1631
2177
|
});
|
|
1632
|
-
var threadEventPlanStepStatusSchema =
|
|
2178
|
+
var threadEventPlanStepStatusSchema = z16.enum([
|
|
1633
2179
|
"pending",
|
|
1634
2180
|
"active",
|
|
1635
2181
|
"completed",
|
|
1636
2182
|
"failed"
|
|
1637
2183
|
]);
|
|
1638
|
-
var threadEventPlanStepSchema =
|
|
1639
|
-
step:
|
|
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 =
|
|
1646
|
-
type:
|
|
1647
|
-
id:
|
|
1648
|
-
queries:
|
|
1649
|
-
resultText:
|
|
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:
|
|
1652
|
-
});
|
|
1653
|
-
var threadEventWebFetchItemSchema =
|
|
1654
|
-
type:
|
|
1655
|
-
id:
|
|
1656
|
-
url:
|
|
1657
|
-
prompt:
|
|
1658
|
-
pattern:
|
|
1659
|
-
resultText:
|
|
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:
|
|
2207
|
+
parentToolCallId: z16.string().optional()
|
|
1662
2208
|
});
|
|
1663
|
-
var threadEventImageViewItemSchema =
|
|
1664
|
-
type:
|
|
1665
|
-
id:
|
|
1666
|
-
path:
|
|
2209
|
+
var threadEventImageViewItemSchema = z16.object({
|
|
2210
|
+
type: z16.literal("imageView"),
|
|
2211
|
+
id: z16.string(),
|
|
2212
|
+
path: z16.string(),
|
|
1667
2213
|
...itemPresentationField,
|
|
1668
|
-
parentToolCallId:
|
|
2214
|
+
parentToolCallId: z16.string().optional()
|
|
1669
2215
|
});
|
|
1670
|
-
var threadEventFileReadItemSchema =
|
|
1671
|
-
type:
|
|
1672
|
-
id:
|
|
1673
|
-
path:
|
|
1674
|
-
cmd:
|
|
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:
|
|
2223
|
+
parentToolCallId: z16.string().optional()
|
|
1678
2224
|
});
|
|
1679
|
-
var threadEventSearchModeSchema =
|
|
1680
|
-
var threadEventSearchItemSchema =
|
|
1681
|
-
type:
|
|
1682
|
-
id:
|
|
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:
|
|
1685
|
-
path:
|
|
1686
|
-
cmd:
|
|
2230
|
+
query: z16.string(),
|
|
2231
|
+
path: z16.string().optional(),
|
|
2232
|
+
cmd: z16.string().optional(),
|
|
1687
2233
|
status: threadEventItemStatusSchema,
|
|
1688
2234
|
...itemPresentationField,
|
|
1689
|
-
parentToolCallId:
|
|
2235
|
+
parentToolCallId: z16.string().optional()
|
|
1690
2236
|
});
|
|
1691
|
-
var threadEventDelegationItemSchema =
|
|
1692
|
-
type:
|
|
1693
|
-
id:
|
|
1694
|
-
childRef:
|
|
1695
|
-
label:
|
|
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:
|
|
1698
|
-
summary:
|
|
2243
|
+
background: z16.boolean(),
|
|
2244
|
+
summary: z16.string().optional(),
|
|
1699
2245
|
...itemPresentationField,
|
|
1700
|
-
parentToolCallId:
|
|
2246
|
+
parentToolCallId: z16.string().optional()
|
|
1701
2247
|
});
|
|
1702
|
-
var threadEventPlanStepsItemSchema =
|
|
1703
|
-
type:
|
|
1704
|
-
id:
|
|
1705
|
-
steps:
|
|
1706
|
-
explanation:
|
|
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:
|
|
2255
|
+
parentToolCallId: z16.string().optional()
|
|
1710
2256
|
});
|
|
1711
|
-
var threadEventExtensionItemSchema =
|
|
1712
|
-
type:
|
|
1713
|
-
id:
|
|
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:
|
|
2264
|
+
parentToolCallId: z16.string().optional()
|
|
1719
2265
|
});
|
|
1720
|
-
var threadEventTextTruncationSchema =
|
|
1721
|
-
originalLength:
|
|
1722
|
-
retainedHeadLength:
|
|
1723
|
-
retainedTailLength:
|
|
1724
|
-
truncatedAt:
|
|
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 =
|
|
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 =
|
|
1732
|
-
type:
|
|
1733
|
-
id:
|
|
2277
|
+
var threadEventImageGenerationItemSchema = z16.object({
|
|
2278
|
+
type: z16.literal("imageGeneration"),
|
|
2279
|
+
id: z16.string(),
|
|
1734
2280
|
status: threadEventItemStatusSchema,
|
|
1735
|
-
prompt:
|
|
1736
|
-
path:
|
|
1737
|
-
result:
|
|
1738
|
-
error:
|
|
1739
|
-
transparentBackground:
|
|
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:
|
|
2288
|
+
parentToolCallId: z16.string().optional()
|
|
1743
2289
|
});
|
|
1744
|
-
var threadEventUserContentSchema =
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
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 =
|
|
1751
|
-
totalTokens:
|
|
1752
|
-
inputTokens:
|
|
1753
|
-
cachedInputTokens:
|
|
1754
|
-
cacheReadInputTokens:
|
|
1755
|
-
cacheWriteInputTokens:
|
|
1756
|
-
outputTokens:
|
|
1757
|
-
reasoningOutputTokens:
|
|
1758
|
-
});
|
|
1759
|
-
var threadEventContextWindowUsageSchema =
|
|
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:
|
|
1762
|
-
modelContextWindow:
|
|
1763
|
-
estimated:
|
|
2307
|
+
usedTokens: z16.number().nullable(),
|
|
2308
|
+
modelContextWindow: z16.number().nullable(),
|
|
2309
|
+
estimated: z16.boolean()
|
|
1764
2310
|
});
|
|
1765
|
-
var threadEventTokenUsageSchema =
|
|
2311
|
+
var threadEventTokenUsageSchema = z16.object({
|
|
1766
2312
|
total: threadEventTokenUsageBreakdownSchema,
|
|
1767
2313
|
last: threadEventTokenUsageBreakdownSchema,
|
|
1768
|
-
modelContextWindow:
|
|
2314
|
+
modelContextWindow: z16.number().nullable()
|
|
1769
2315
|
});
|
|
1770
|
-
var threadEventWarningCategorySchema =
|
|
2316
|
+
var threadEventWarningCategorySchema = z16.enum([
|
|
1771
2317
|
"deprecation",
|
|
1772
2318
|
"config",
|
|
1773
2319
|
"general",
|
|
1774
2320
|
"compaction-skipped"
|
|
1775
2321
|
]);
|
|
1776
|
-
var providerRawEventSchema =
|
|
1777
|
-
jsonrpc:
|
|
1778
|
-
id:
|
|
1779
|
-
method:
|
|
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 =
|
|
1783
|
-
type:
|
|
1784
|
-
threadId:
|
|
1785
|
-
providerThreadId:
|
|
1786
|
-
providerId:
|
|
1787
|
-
rawType:
|
|
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:
|
|
1790
|
-
});
|
|
1791
|
-
var toolCallProgressEventSchema =
|
|
1792
|
-
type:
|
|
1793
|
-
threadId:
|
|
1794
|
-
providerThreadId:
|
|
1795
|
-
itemId:
|
|
1796
|
-
message:
|
|
1797
|
-
parentToolCallId:
|
|
1798
|
-
});
|
|
1799
|
-
var threadEventBackgroundTaskItemSchema =
|
|
1800
|
-
type:
|
|
1801
|
-
id:
|
|
1802
|
-
familyId:
|
|
1803
|
-
taskType:
|
|
1804
|
-
description:
|
|
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:
|
|
1808
|
-
workflowName:
|
|
2353
|
+
skipTranscript: z16.boolean(),
|
|
2354
|
+
workflowName: z16.string().optional(),
|
|
1809
2355
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
1810
2356
|
usage: backgroundTaskUsageSchema.optional(),
|
|
1811
|
-
summary:
|
|
1812
|
-
error:
|
|
1813
|
-
outputFile:
|
|
2357
|
+
summary: z16.string().optional(),
|
|
2358
|
+
error: z16.string().optional(),
|
|
2359
|
+
outputFile: z16.string().optional(),
|
|
1814
2360
|
...itemPresentationField,
|
|
1815
|
-
parentToolCallId:
|
|
2361
|
+
parentToolCallId: z16.string().optional()
|
|
1816
2362
|
});
|
|
1817
|
-
var threadEventItemSchema =
|
|
1818
|
-
|
|
1819
|
-
type:
|
|
1820
|
-
id:
|
|
1821
|
-
content:
|
|
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:
|
|
2369
|
+
parentToolCallId: z16.string().optional()
|
|
1824
2370
|
}).strict(),
|
|
1825
|
-
|
|
1826
|
-
type:
|
|
1827
|
-
id:
|
|
1828
|
-
text:
|
|
2371
|
+
z16.object({
|
|
2372
|
+
type: z16.literal("agentMessage"),
|
|
2373
|
+
id: z16.string(),
|
|
2374
|
+
text: z16.string(),
|
|
1829
2375
|
...itemPresentationField,
|
|
1830
|
-
parentToolCallId:
|
|
2376
|
+
parentToolCallId: z16.string().optional()
|
|
1831
2377
|
}),
|
|
1832
|
-
|
|
1833
|
-
type:
|
|
1834
|
-
id:
|
|
1835
|
-
command:
|
|
1836
|
-
cwd:
|
|
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:
|
|
1840
|
-
exitCode:
|
|
1841
|
-
durationMs:
|
|
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:
|
|
2390
|
+
parentToolCallId: z16.string().optional()
|
|
1845
2391
|
}),
|
|
1846
|
-
|
|
1847
|
-
type:
|
|
1848
|
-
id:
|
|
1849
|
-
changes:
|
|
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:
|
|
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
|
-
|
|
1862
|
-
type:
|
|
1863
|
-
id:
|
|
1864
|
-
server:
|
|
1865
|
-
tool:
|
|
1866
|
-
arguments:
|
|
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:
|
|
1869
|
-
error:
|
|
1870
|
-
durationMs:
|
|
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:
|
|
2419
|
+
parentToolCallId: z16.string().optional()
|
|
1874
2420
|
}),
|
|
1875
|
-
|
|
1876
|
-
type:
|
|
1877
|
-
id:
|
|
1878
|
-
summary:
|
|
1879
|
-
content:
|
|
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:
|
|
2427
|
+
parentToolCallId: z16.string().optional()
|
|
1882
2428
|
}),
|
|
1883
|
-
|
|
1884
|
-
type:
|
|
1885
|
-
id:
|
|
1886
|
-
text:
|
|
2429
|
+
z16.object({
|
|
2430
|
+
type: z16.literal("plan"),
|
|
2431
|
+
id: z16.string(),
|
|
2432
|
+
text: z16.string(),
|
|
1887
2433
|
...itemPresentationField,
|
|
1888
|
-
parentToolCallId:
|
|
2434
|
+
parentToolCallId: z16.string().optional()
|
|
1889
2435
|
}),
|
|
1890
2436
|
threadEventPlanStepsItemSchema,
|
|
1891
|
-
|
|
1892
|
-
type:
|
|
1893
|
-
id:
|
|
2437
|
+
z16.object({
|
|
2438
|
+
type: z16.literal("contextCompaction"),
|
|
2439
|
+
id: z16.string(),
|
|
1894
2440
|
...itemPresentationField,
|
|
1895
|
-
parentToolCallId:
|
|
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
|
|
1903
|
-
type:
|
|
1904
|
-
threadId:
|
|
1905
|
-
providerThreadId:
|
|
1906
|
-
itemId:
|
|
1907
|
-
delta:
|
|
1908
|
-
parentToolCallId:
|
|
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 =
|
|
1912
|
-
|
|
1913
|
-
type:
|
|
1914
|
-
threadId:
|
|
2457
|
+
var unscopedProviderEventSchema = z16.discriminatedUnion("type", [
|
|
2458
|
+
z16.object({
|
|
2459
|
+
type: z16.literal("thread/started"),
|
|
2460
|
+
threadId: z16.string()
|
|
1915
2461
|
}),
|
|
1916
|
-
|
|
1917
|
-
type:
|
|
1918
|
-
threadId:
|
|
1919
|
-
providerThreadId:
|
|
2462
|
+
z16.object({
|
|
2463
|
+
type: z16.literal("thread/identity"),
|
|
2464
|
+
threadId: z16.string(),
|
|
2465
|
+
providerThreadId: z16.string()
|
|
1920
2466
|
}),
|
|
1921
|
-
|
|
1922
|
-
type:
|
|
1923
|
-
threadId:
|
|
1924
|
-
providerThreadId:
|
|
1925
|
-
parentToolCallId:
|
|
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
|
-
|
|
1928
|
-
type:
|
|
1929
|
-
threadId:
|
|
1930
|
-
providerThreadId:
|
|
2473
|
+
z16.object({
|
|
2474
|
+
type: z16.literal("turn/completed"),
|
|
2475
|
+
threadId: z16.string(),
|
|
2476
|
+
providerThreadId: z16.string().nullable(),
|
|
1931
2477
|
status: threadEventTurnStatusSchema,
|
|
1932
|
-
error:
|
|
1933
|
-
providerCheckpointId:
|
|
2478
|
+
error: z16.object({ message: z16.string() }).optional(),
|
|
2479
|
+
providerCheckpointId: z16.string().min(1).optional()
|
|
1934
2480
|
}),
|
|
1935
|
-
|
|
1936
|
-
type:
|
|
1937
|
-
threadId:
|
|
1938
|
-
providerThreadId:
|
|
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
|
-
|
|
1943
|
-
type:
|
|
1944
|
-
threadId:
|
|
1945
|
-
providerThreadId:
|
|
1946
|
-
threadName:
|
|
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
|
-
|
|
1949
|
-
type:
|
|
1950
|
-
threadId:
|
|
1951
|
-
providerThreadId:
|
|
2494
|
+
z16.object({
|
|
2495
|
+
type: z16.literal("thread/compacted"),
|
|
2496
|
+
threadId: z16.string(),
|
|
2497
|
+
providerThreadId: z16.string()
|
|
1952
2498
|
}),
|
|
1953
|
-
|
|
1954
|
-
type:
|
|
1955
|
-
threadId:
|
|
1956
|
-
providerThreadId:
|
|
2499
|
+
z16.object({
|
|
2500
|
+
type: z16.literal("thread/context/cleared"),
|
|
2501
|
+
threadId: z16.string(),
|
|
2502
|
+
providerThreadId: z16.string()
|
|
1957
2503
|
}),
|
|
1958
|
-
|
|
1959
|
-
type:
|
|
1960
|
-
threadId:
|
|
1961
|
-
providerThreadId:
|
|
1962
|
-
objective:
|
|
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:
|
|
1965
|
-
tokensUsed:
|
|
1966
|
-
timeUsedSeconds:
|
|
2510
|
+
tokenBudget: z16.number().nullable(),
|
|
2511
|
+
tokensUsed: z16.number(),
|
|
2512
|
+
timeUsedSeconds: z16.number()
|
|
1967
2513
|
}),
|
|
1968
|
-
|
|
1969
|
-
type:
|
|
1970
|
-
threadId:
|
|
1971
|
-
providerThreadId:
|
|
2514
|
+
z16.object({
|
|
2515
|
+
type: z16.literal("thread/goal/cleared"),
|
|
2516
|
+
threadId: z16.string(),
|
|
2517
|
+
providerThreadId: z16.string()
|
|
1972
2518
|
}),
|
|
1973
|
-
|
|
1974
|
-
type:
|
|
1975
|
-
threadId:
|
|
1976
|
-
providerThreadId:
|
|
2519
|
+
z16.object({
|
|
2520
|
+
type: z16.literal("item/started"),
|
|
2521
|
+
threadId: z16.string(),
|
|
2522
|
+
providerThreadId: z16.string(),
|
|
1977
2523
|
item: threadEventItemSchema
|
|
1978
2524
|
}),
|
|
1979
|
-
|
|
1980
|
-
type:
|
|
1981
|
-
threadId:
|
|
1982
|
-
providerThreadId:
|
|
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
|
-
|
|
1987
|
-
type:
|
|
1988
|
-
threadId:
|
|
1989
|
-
providerThreadId:
|
|
1990
|
-
itemId:
|
|
1991
|
-
delta:
|
|
1992
|
-
reset:
|
|
1993
|
-
parentToolCallId:
|
|
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
|
-
|
|
2000
|
-
type:
|
|
2001
|
-
threadId:
|
|
2002
|
-
providerThreadId:
|
|
2003
|
-
itemId:
|
|
2004
|
-
message:
|
|
2005
|
-
parentToolCallId:
|
|
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
|
-
|
|
2009
|
-
type:
|
|
2010
|
-
threadId:
|
|
2011
|
-
providerThreadId:
|
|
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
|
-
|
|
2015
|
-
type:
|
|
2016
|
-
threadId:
|
|
2017
|
-
providerThreadId:
|
|
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
|
-
|
|
2021
|
-
type:
|
|
2022
|
-
threadId:
|
|
2023
|
-
providerThreadId:
|
|
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
|
-
|
|
2027
|
-
type:
|
|
2028
|
-
threadId:
|
|
2029
|
-
providerThreadId:
|
|
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
|
-
|
|
2033
|
-
type:
|
|
2034
|
-
threadId:
|
|
2035
|
-
providerThreadId:
|
|
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
|
-
|
|
2039
|
-
type:
|
|
2040
|
-
threadId:
|
|
2041
|
-
providerThreadId:
|
|
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
|
-
|
|
2045
|
-
type:
|
|
2046
|
-
threadId:
|
|
2047
|
-
providerThreadId:
|
|
2048
|
-
plan:
|
|
2049
|
-
explanation:
|
|
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
|
-
|
|
2052
|
-
type:
|
|
2053
|
-
threadId:
|
|
2054
|
-
providerThreadId:
|
|
2055
|
-
diff:
|
|
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
|
-
|
|
2058
|
-
type:
|
|
2059
|
-
threadId:
|
|
2060
|
-
providerThreadId:
|
|
2061
|
-
message:
|
|
2062
|
-
detail:
|
|
2063
|
-
willRetry:
|
|
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
|
-
|
|
2067
|
-
type:
|
|
2068
|
-
threadId:
|
|
2069
|
-
providerThreadId:
|
|
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
|
-
|
|
2073
|
-
type:
|
|
2074
|
-
threadId:
|
|
2075
|
-
providerThreadId:
|
|
2076
|
-
entries:
|
|
2077
|
-
|
|
2078
|
-
name:
|
|
2079
|
-
source:
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
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:
|
|
2085
|
-
|
|
2086
|
-
|
|
2630
|
+
value: z16.union([
|
|
2631
|
+
z16.string(),
|
|
2632
|
+
z16.object({ masked: z16.literal(true) }).strict()
|
|
2087
2633
|
]),
|
|
2088
|
-
reason:
|
|
2634
|
+
reason: z16.string().optional()
|
|
2089
2635
|
}).strict()
|
|
2090
2636
|
)
|
|
2091
2637
|
}),
|
|
2092
|
-
|
|
2093
|
-
type:
|
|
2094
|
-
threadId:
|
|
2095
|
-
providerThreadId:
|
|
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
|
-
|
|
2100
|
-
type:
|
|
2101
|
-
threadId:
|
|
2102
|
-
providerThreadId:
|
|
2645
|
+
z16.object({
|
|
2646
|
+
type: z16.literal("provider/warning"),
|
|
2647
|
+
threadId: z16.string(),
|
|
2648
|
+
providerThreadId: z16.string(),
|
|
2103
2649
|
category: threadEventWarningCategorySchema,
|
|
2104
|
-
summary:
|
|
2105
|
-
details:
|
|
2650
|
+
summary: z16.string().optional(),
|
|
2651
|
+
details: z16.string().optional()
|
|
2106
2652
|
}),
|
|
2107
|
-
|
|
2108
|
-
type:
|
|
2109
|
-
threadId:
|
|
2110
|
-
providerThreadId:
|
|
2111
|
-
originalModel:
|
|
2112
|
-
fallbackModel:
|
|
2113
|
-
reason:
|
|
2114
|
-
message:
|
|
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 =
|
|
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 =
|
|
2128
|
-
|
|
2129
|
-
type:
|
|
2130
|
-
threadId:
|
|
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
|
-
|
|
2133
|
-
type:
|
|
2134
|
-
threadId:
|
|
2678
|
+
z16.object({
|
|
2679
|
+
type: z16.literal("client/turn/requested"),
|
|
2680
|
+
threadId: z16.string()
|
|
2135
2681
|
}).merge(turnRequestEventDataSchema),
|
|
2136
|
-
|
|
2137
|
-
type:
|
|
2138
|
-
threadId:
|
|
2682
|
+
z16.object({
|
|
2683
|
+
type: z16.literal("client/turn/rejected"),
|
|
2684
|
+
threadId: z16.string()
|
|
2139
2685
|
}).merge(turnRequestRejectedEventDataSchema),
|
|
2140
|
-
|
|
2141
|
-
type:
|
|
2142
|
-
threadId:
|
|
2686
|
+
z16.object({
|
|
2687
|
+
type: z16.literal("client/turn/start"),
|
|
2688
|
+
threadId: z16.string()
|
|
2143
2689
|
}).merge(clientTurnLifecycleEventDataSchema),
|
|
2144
|
-
|
|
2145
|
-
type:
|
|
2146
|
-
threadId:
|
|
2690
|
+
z16.object({
|
|
2691
|
+
type: z16.literal("system/error"),
|
|
2692
|
+
threadId: z16.string()
|
|
2147
2693
|
}).merge(systemErrorEventDataSchema),
|
|
2148
|
-
|
|
2149
|
-
type:
|
|
2150
|
-
threadId:
|
|
2694
|
+
z16.object({
|
|
2695
|
+
type: z16.literal("system/manager/user_message"),
|
|
2696
|
+
threadId: z16.string()
|
|
2151
2697
|
}).merge(systemLegacyUserMessageEventDataSchema),
|
|
2152
|
-
|
|
2153
|
-
type:
|
|
2154
|
-
threadId:
|
|
2698
|
+
z16.object({
|
|
2699
|
+
type: z16.literal("system/thread/interrupted"),
|
|
2700
|
+
threadId: z16.string()
|
|
2155
2701
|
}).merge(systemThreadInterruptedEventDataSchema),
|
|
2156
|
-
|
|
2157
|
-
type:
|
|
2158
|
-
threadId:
|
|
2702
|
+
z16.object({
|
|
2703
|
+
type: z16.literal("system/operation"),
|
|
2704
|
+
threadId: z16.string()
|
|
2159
2705
|
}).merge(systemOperationEventDataSchema),
|
|
2160
|
-
|
|
2161
|
-
type:
|
|
2162
|
-
threadId:
|
|
2706
|
+
z16.object({
|
|
2707
|
+
type: z16.literal("system/interaction/lifecycle"),
|
|
2708
|
+
threadId: z16.string()
|
|
2163
2709
|
}).merge(systemInteractionLifecycleEventDataSchema),
|
|
2164
|
-
|
|
2165
|
-
type:
|
|
2166
|
-
threadId:
|
|
2710
|
+
z16.object({
|
|
2711
|
+
type: z16.literal("system/permissionGrant/lifecycle"),
|
|
2712
|
+
threadId: z16.string()
|
|
2167
2713
|
}).merge(systemPermissionGrantLifecycleEventDataSchema),
|
|
2168
|
-
|
|
2169
|
-
type:
|
|
2170
|
-
threadId:
|
|
2714
|
+
z16.object({
|
|
2715
|
+
type: z16.literal("system/userQuestion/lifecycle"),
|
|
2716
|
+
threadId: z16.string()
|
|
2171
2717
|
}).merge(systemUserQuestionLifecycleEventDataSchema),
|
|
2172
|
-
|
|
2173
|
-
type:
|
|
2174
|
-
threadId:
|
|
2718
|
+
z16.object({
|
|
2719
|
+
type: z16.literal("system/thread-provisioning"),
|
|
2720
|
+
threadId: z16.string()
|
|
2175
2721
|
}).merge(systemThreadProvisioningEventDataSchema),
|
|
2176
|
-
|
|
2177
|
-
type:
|
|
2178
|
-
threadId:
|
|
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 =
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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 =
|
|
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
|
|
2779
|
+
import { z as z17 } from "zod";
|
|
2234
2780
|
var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
|
|
2235
|
-
var providerForkSchema =
|
|
2781
|
+
var providerForkSchema = z17.enum(PROVIDER_FORK_VALUES);
|
|
2236
2782
|
|
|
2237
2783
|
// ../domain/src/provider-types.ts
|
|
2238
|
-
import { z as
|
|
2239
|
-
var modelReasoningEffortSchema =
|
|
2784
|
+
import { z as z18 } from "zod";
|
|
2785
|
+
var modelReasoningEffortSchema = z18.object({
|
|
2240
2786
|
reasoningEffort: reasoningLevelSchema,
|
|
2241
|
-
description:
|
|
2242
|
-
});
|
|
2243
|
-
var availableModelSchema =
|
|
2244
|
-
id:
|
|
2245
|
-
model:
|
|
2246
|
-
displayName:
|
|
2247
|
-
routeProviderId:
|
|
2248
|
-
description:
|
|
2249
|
-
supportedReasoningEfforts:
|
|
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:
|
|
2252
|
-
});
|
|
2253
|
-
var providerModelCatalogScopeSchema =
|
|
2254
|
-
var providerCapabilitiesSchema =
|
|
2255
|
-
supportsThreadArchive:
|
|
2256
|
-
supportsThreadRename:
|
|
2257
|
-
supportsServiceTier:
|
|
2258
|
-
supportsNativeUserQuestion:
|
|
2259
|
-
supportsFork:
|
|
2260
|
-
supportsSessionRewind:
|
|
2261
|
-
permissionModes:
|
|
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 =
|
|
2810
|
+
var providerComposerCommandSchema = z18.object({
|
|
2265
2811
|
trigger: promptMentionCommandTriggerSchema,
|
|
2266
|
-
name:
|
|
2267
|
-
trailingText:
|
|
2812
|
+
name: z18.string().min(1).regex(/^[^\s/$]+$/u),
|
|
2813
|
+
trailingText: z18.string().regex(/^\s*$/u)
|
|
2268
2814
|
});
|
|
2269
|
-
var providerComposerActionSchema =
|
|
2270
|
-
|
|
2271
|
-
kind:
|
|
2815
|
+
var providerComposerActionSchema = z18.discriminatedUnion("kind", [
|
|
2816
|
+
z18.object({
|
|
2817
|
+
kind: z18.literal("skills"),
|
|
2272
2818
|
trigger: promptMentionCommandTriggerSchema
|
|
2273
2819
|
}),
|
|
2274
|
-
|
|
2275
|
-
kind:
|
|
2820
|
+
z18.object({
|
|
2821
|
+
kind: z18.literal("plan"),
|
|
2276
2822
|
command: providerComposerCommandSchema
|
|
2277
2823
|
}),
|
|
2278
|
-
|
|
2279
|
-
kind:
|
|
2824
|
+
z18.object({
|
|
2825
|
+
kind: z18.literal("goal"),
|
|
2280
2826
|
command: providerComposerCommandSchema
|
|
2281
2827
|
})
|
|
2282
2828
|
]);
|
|
2283
|
-
var providerStringsSchema =
|
|
2284
|
-
signInHint:
|
|
2285
|
-
expiredHint:
|
|
2286
|
-
installUrl:
|
|
2287
|
-
brandPrefix:
|
|
2288
|
-
planModeCopy:
|
|
2289
|
-
iconTint:
|
|
2290
|
-
});
|
|
2291
|
-
var providerOptionDescriptorSchema =
|
|
2292
|
-
id:
|
|
2293
|
-
label:
|
|
2294
|
-
description:
|
|
2295
|
-
});
|
|
2296
|
-
var providerExtensionKindInfoSchema =
|
|
2297
|
-
item:
|
|
2298
|
-
state:
|
|
2299
|
-
});
|
|
2300
|
-
var providerExtensionKindsSchema =
|
|
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 =
|
|
2305
|
-
id:
|
|
2306
|
-
pluginId:
|
|
2307
|
-
displayName:
|
|
2308
|
-
family:
|
|
2309
|
-
icon:
|
|
2310
|
-
logoUrl:
|
|
2311
|
-
maintenance:
|
|
2312
|
-
health:
|
|
2313
|
-
usage:
|
|
2314
|
-
installation:
|
|
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:
|
|
2318
|
-
|
|
2863
|
+
composerActions: z18.array(providerComposerActionSchema),
|
|
2864
|
+
completedTurnDisplay: completedTurnDisplaySchema,
|
|
2865
|
+
available: z18.boolean(),
|
|
2319
2866
|
strings: providerStringsSchema.optional(),
|
|
2320
|
-
serviceTiers:
|
|
2321
|
-
reasoningLevels:
|
|
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 =
|
|
2332
|
-
var toolCallOutputItemSchema =
|
|
2333
|
-
|
|
2334
|
-
type:
|
|
2335
|
-
text:
|
|
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
|
-
|
|
2338
|
-
type:
|
|
2339
|
-
imageUrl:
|
|
2884
|
+
z18.object({
|
|
2885
|
+
type: z18.literal("inputImage"),
|
|
2886
|
+
imageUrl: z18.string()
|
|
2340
2887
|
})
|
|
2341
2888
|
]);
|
|
2342
|
-
var toolCallRequestSchema =
|
|
2343
|
-
requestId:
|
|
2344
|
-
threadId:
|
|
2345
|
-
providerThreadId:
|
|
2346
|
-
turnId:
|
|
2347
|
-
callId:
|
|
2348
|
-
tool:
|
|
2349
|
-
arguments:
|
|
2350
|
-
});
|
|
2351
|
-
var toolCallResponseSchema =
|
|
2352
|
-
contentItems:
|
|
2353
|
-
success:
|
|
2354
|
-
});
|
|
2355
|
-
var dynamicToolSchema =
|
|
2356
|
-
name:
|
|
2357
|
-
description:
|
|
2358
|
-
inputSchema:
|
|
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
|
|
2411
|
-
var acpNativeSkillRootsSchema =
|
|
2412
|
-
user:
|
|
2413
|
-
project:
|
|
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 =
|
|
2430
|
-
displayName:
|
|
2431
|
-
command:
|
|
2432
|
-
args:
|
|
2433
|
-
env:
|
|
2434
|
-
cwd:
|
|
2435
|
-
modelCli:
|
|
2436
|
-
listArgs:
|
|
2437
|
-
selectFlag:
|
|
2438
|
-
primaryModels:
|
|
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
|
|
2454
|
-
var bridgeGrammarVersionsSchema =
|
|
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 =
|
|
2458
|
-
var bridgeCapabilitiesSchema =
|
|
2459
|
-
sessionRestore:
|
|
2460
|
-
threadArchive:
|
|
2461
|
-
threadRename:
|
|
2462
|
-
threadGoalClear:
|
|
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:
|
|
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:
|
|
3017
|
+
skills: z20.object({ configure: z20.boolean().default(false) }).default({ configure: false })
|
|
2471
3018
|
}).passthrough();
|
|
2472
|
-
var initializeParamsSchema =
|
|
2473
|
-
protocolVersion:
|
|
2474
|
-
client:
|
|
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 =
|
|
2481
|
-
protocolVersion:
|
|
2482
|
-
capabilities:
|
|
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
|
|
2490
|
-
var bridgeExecutionOptionsSchema =
|
|
2491
|
-
model:
|
|
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:
|
|
2496
|
-
envVars:
|
|
2497
|
-
providerOptions:
|
|
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
|
|
2502
|
-
var providerMaintenanceParamsSchema =
|
|
2503
|
-
providerId:
|
|
2504
|
-
cwd:
|
|
2505
|
-
providerOptions:
|
|
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 =
|
|
3054
|
+
var providerInstallationRequirementSchema = z22.enum(["thread_rewind"]);
|
|
2508
3055
|
var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
2509
3056
|
requirement: providerInstallationRequirementSchema.optional()
|
|
2510
3057
|
});
|
|
2511
|
-
var providerHealthSchema =
|
|
2512
|
-
status:
|
|
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:
|
|
2521
|
-
accountEmail:
|
|
2522
|
-
planLabel:
|
|
2523
|
-
installedVersion:
|
|
2524
|
-
minimumSupportedVersion:
|
|
2525
|
-
canInstall:
|
|
2526
|
-
canUpdate:
|
|
2527
|
-
loginCommand:
|
|
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 =
|
|
2530
|
-
label:
|
|
2531
|
-
usedPercent:
|
|
2532
|
-
resetsAt:
|
|
2533
|
-
cost:
|
|
2534
|
-
usedUsdCents:
|
|
2535
|
-
limitUsdCents:
|
|
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 =
|
|
2539
|
-
|
|
2540
|
-
status:
|
|
2541
|
-
accountEmail:
|
|
2542
|
-
planLabel:
|
|
2543
|
-
windows:
|
|
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
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
status:
|
|
2550
|
-
message:
|
|
2551
|
-
planLabel:
|
|
2552
|
-
accountEmail:
|
|
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 =
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
supported:
|
|
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 =
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
supported:
|
|
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 =
|
|
3116
|
+
var providerInstallationActionKindSchema = z22.enum([
|
|
2570
3117
|
"install",
|
|
2571
3118
|
"update"
|
|
2572
3119
|
]);
|
|
2573
|
-
var providerInstallationActionSchema =
|
|
3120
|
+
var providerInstallationActionSchema = z22.object({
|
|
2574
3121
|
kind: providerInstallationActionKindSchema,
|
|
2575
|
-
label:
|
|
2576
|
-
command:
|
|
3122
|
+
label: z22.enum(["Install", "Update"]),
|
|
3123
|
+
command: z22.string().min(1)
|
|
2577
3124
|
}).passthrough();
|
|
2578
|
-
var providerInstallationSourceSchema =
|
|
3125
|
+
var providerInstallationSourceSchema = z22.enum([
|
|
2579
3126
|
"notInstalled",
|
|
2580
3127
|
"npmGlobal",
|
|
2581
3128
|
"external"
|
|
2582
3129
|
]);
|
|
2583
|
-
var providerInstallationStatusSchema =
|
|
2584
|
-
executableName:
|
|
2585
|
-
executablePath:
|
|
2586
|
-
installed:
|
|
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:
|
|
2589
|
-
latestVersion:
|
|
2590
|
-
minimumSupportedVersion:
|
|
2591
|
-
npmPackageName:
|
|
2592
|
-
npmGlobalPackageVersion:
|
|
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:
|
|
2595
|
-
versionUnsupported:
|
|
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 =
|
|
2601
|
-
command:
|
|
2602
|
-
args:
|
|
2603
|
-
displayCommand:
|
|
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 =
|
|
3152
|
+
var providerInstallationVerificationSchema = z22.discriminatedUnion(
|
|
2606
3153
|
"kind",
|
|
2607
3154
|
[
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
kind:
|
|
2611
|
-
previousVersion:
|
|
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
|
-
|
|
2614
|
-
kind:
|
|
2615
|
-
version:
|
|
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 =
|
|
3166
|
+
var providerInstallationRunResultSchema = z22.discriminatedUnion(
|
|
2620
3167
|
"available",
|
|
2621
3168
|
[
|
|
2622
|
-
|
|
2623
|
-
available:
|
|
2624
|
-
message:
|
|
3169
|
+
z22.object({
|
|
3170
|
+
available: z22.literal(false),
|
|
3171
|
+
message: z22.string().min(1)
|
|
2625
3172
|
}).passthrough(),
|
|
2626
|
-
|
|
2627
|
-
available:
|
|
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
|
|
3182
|
+
import { z as z23 } from "zod";
|
|
2636
3183
|
var sessionConstructionFields = {
|
|
2637
|
-
threadId:
|
|
2638
|
-
cwd:
|
|
3184
|
+
threadId: z23.string().min(1),
|
|
3185
|
+
cwd: z23.string().min(1),
|
|
2639
3186
|
options: bridgeExecutionOptionsSchema,
|
|
2640
|
-
dynamicTools:
|
|
2641
|
-
disallowedTools:
|
|
3187
|
+
dynamicTools: z23.array(dynamicToolSchema).optional(),
|
|
3188
|
+
disallowedTools: z23.array(z23.string().min(1)).optional(),
|
|
2642
3189
|
instructionMode: instructionModeSchema
|
|
2643
3190
|
};
|
|
2644
|
-
var modelListParamsSchema =
|
|
2645
|
-
var threadStartParamsSchema =
|
|
3191
|
+
var modelListParamsSchema = z23.object({ cwd: z23.string().min(1).optional() }).passthrough();
|
|
3192
|
+
var threadStartParamsSchema = z23.object({
|
|
2646
3193
|
...sessionConstructionFields,
|
|
2647
|
-
input:
|
|
3194
|
+
input: z23.array(promptInputSchema).optional()
|
|
2648
3195
|
}).passthrough();
|
|
2649
|
-
var threadResumeParamsSchema =
|
|
3196
|
+
var threadResumeParamsSchema = z23.object({
|
|
2650
3197
|
...sessionConstructionFields,
|
|
2651
|
-
providerThreadId:
|
|
3198
|
+
providerThreadId: z23.string().min(1)
|
|
2652
3199
|
}).passthrough();
|
|
2653
|
-
var threadForkParamsSchema =
|
|
3200
|
+
var threadForkParamsSchema = z23.object({
|
|
2654
3201
|
...sessionConstructionFields,
|
|
2655
|
-
sourceProviderThreadId:
|
|
2656
|
-
sourceProviderCheckpointId:
|
|
3202
|
+
sourceProviderThreadId: z23.string().min(1),
|
|
3203
|
+
sourceProviderCheckpointId: z23.string().min(1).optional()
|
|
2657
3204
|
}).passthrough();
|
|
2658
|
-
var threadStopParamsSchema =
|
|
2659
|
-
threadId:
|
|
2660
|
-
providerThreadId:
|
|
2661
|
-
intent:
|
|
2662
|
-
activeTurnId:
|
|
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 =
|
|
2665
|
-
threadId:
|
|
2666
|
-
providerThreadId:
|
|
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 =
|
|
2670
|
-
threadId:
|
|
2671
|
-
providerThreadId:
|
|
2672
|
-
title:
|
|
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:
|
|
2676
|
-
providerThreadId:
|
|
2677
|
-
input:
|
|
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 =
|
|
2682
|
-
var turnSteerParamsSchema =
|
|
3228
|
+
var turnStartParamsSchema = z23.object(turnInputFields).passthrough();
|
|
3229
|
+
var turnSteerParamsSchema = z23.object({
|
|
2683
3230
|
...turnInputFields,
|
|
2684
|
-
expectedTurnId:
|
|
3231
|
+
expectedTurnId: z23.string().min(1)
|
|
2685
3232
|
}).passthrough();
|
|
2686
|
-
var skillsConfigureRootSchema =
|
|
2687
|
-
id:
|
|
2688
|
-
path:
|
|
2689
|
-
skills:
|
|
2690
|
-
|
|
2691
|
-
name:
|
|
2692
|
-
description:
|
|
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 =
|
|
2697
|
-
roots:
|
|
3243
|
+
var skillsConfigureParamsSchema = z23.object({
|
|
3244
|
+
roots: z23.array(skillsConfigureRootSchema)
|
|
2698
3245
|
}).passthrough();
|
|
2699
|
-
var threadIdentityResultSchema =
|
|
2700
|
-
providerThreadId:
|
|
2701
|
-
sessionRestorable:
|
|
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
|
|
3252
|
+
import { z as z25 } from "zod";
|
|
2706
3253
|
|
|
2707
3254
|
// ../provider-bridge-protocol/src/errors.ts
|
|
2708
|
-
import { z as
|
|
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 =
|
|
3264
|
+
var providerRecoveryHintSchema = z24.object({
|
|
2718
3265
|
kind: providerRecoveryKindSchema,
|
|
2719
|
-
message:
|
|
2720
|
-
retryable:
|
|
3266
|
+
message: z24.string().min(1),
|
|
3267
|
+
retryable: z24.boolean()
|
|
2721
3268
|
});
|
|
2722
|
-
var bridgeErrorDataSchema =
|
|
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 =
|
|
2733
|
-
threadId:
|
|
2734
|
-
providerThreadId:
|
|
2735
|
-
sessionRestorable:
|
|
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 =
|
|
2738
|
-
threadId:
|
|
2739
|
-
providerThreadId:
|
|
2740
|
-
reason:
|
|
2741
|
-
contextLost:
|
|
2742
|
-
showRuntimeNote:
|
|
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 =
|
|
2745
|
-
threadId:
|
|
3291
|
+
var providerRecoveryNotificationSchema = z25.object({
|
|
3292
|
+
threadId: z25.string().min(1).optional(),
|
|
2746
3293
|
...providerRecoveryHintSchema.shape
|
|
2747
3294
|
}).passthrough();
|
|
2748
|
-
var errorNotificationSchema =
|
|
2749
|
-
threadId:
|
|
2750
|
-
providerThreadId:
|
|
2751
|
-
message:
|
|
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
|
|
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 =
|
|
2761
|
-
providerThreadId:
|
|
2762
|
-
threadId:
|
|
2763
|
-
turnId:
|
|
2764
|
-
callId:
|
|
2765
|
-
tool:
|
|
2766
|
-
arguments:
|
|
2767
|
-
providerNativeIds:
|
|
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 =
|
|
2770
|
-
success:
|
|
2771
|
-
contentItems:
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
type:
|
|
2776
|
-
imageUrl:
|
|
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 =
|
|
2782
|
-
providerThreadId:
|
|
2783
|
-
threadId:
|
|
2784
|
-
turnId:
|
|
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:
|
|
3333
|
+
providerNativeIds: z26.boolean().optional()
|
|
2787
3334
|
}).passthrough();
|
|
2788
3335
|
|
|
2789
3336
|
// ../provider-bridge-protocol/src/thread-delta.ts
|
|
2790
|
-
import { z as
|
|
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 =
|
|
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 =
|
|
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 =
|
|
2804
|
-
path:
|
|
2805
|
-
kind:
|
|
2806
|
-
movePath:
|
|
2807
|
-
diff:
|
|
2808
|
-
oldText:
|
|
2809
|
-
newText:
|
|
2810
|
-
});
|
|
2811
|
-
var deltaBackgroundTaskShapeSchema =
|
|
2812
|
-
type:
|
|
2813
|
-
familyId:
|
|
2814
|
-
taskType:
|
|
2815
|
-
description:
|
|
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:
|
|
2819
|
-
workflowName:
|
|
3365
|
+
skipTranscript: z27.boolean(),
|
|
3366
|
+
workflowName: z27.string().optional(),
|
|
2820
3367
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
2821
3368
|
usage: backgroundTaskUsageSchema.optional(),
|
|
2822
|
-
summary:
|
|
2823
|
-
error:
|
|
2824
|
-
outputFile:
|
|
3369
|
+
summary: z27.string().optional(),
|
|
3370
|
+
error: z27.string().optional(),
|
|
3371
|
+
outputFile: z27.string().optional()
|
|
2825
3372
|
});
|
|
2826
|
-
var deltaFileReadShapeSchema =
|
|
2827
|
-
type:
|
|
2828
|
-
path:
|
|
2829
|
-
cmd:
|
|
3373
|
+
var deltaFileReadShapeSchema = z27.object({
|
|
3374
|
+
type: z27.literal("fileRead"),
|
|
3375
|
+
path: z27.string(),
|
|
3376
|
+
cmd: z27.string().optional()
|
|
2830
3377
|
});
|
|
2831
|
-
var deltaSearchShapeSchema =
|
|
2832
|
-
type:
|
|
3378
|
+
var deltaSearchShapeSchema = z27.object({
|
|
3379
|
+
type: z27.literal("search"),
|
|
2833
3380
|
mode: threadEventSearchModeSchema,
|
|
2834
|
-
query:
|
|
2835
|
-
path:
|
|
2836
|
-
cmd:
|
|
3381
|
+
query: z27.string(),
|
|
3382
|
+
path: z27.string().optional(),
|
|
3383
|
+
cmd: z27.string().optional()
|
|
2837
3384
|
});
|
|
2838
|
-
var deltaDelegationShapeSchema =
|
|
2839
|
-
type:
|
|
3385
|
+
var deltaDelegationShapeSchema = z27.object({
|
|
3386
|
+
type: z27.literal("delegation"),
|
|
2840
3387
|
childRef: deltaKeyPartSchema,
|
|
2841
|
-
label:
|
|
2842
|
-
background:
|
|
2843
|
-
summary:
|
|
3388
|
+
label: z27.string(),
|
|
3389
|
+
background: z27.boolean(),
|
|
3390
|
+
summary: z27.string().optional()
|
|
2844
3391
|
});
|
|
2845
|
-
var deltaPlanStepsShapeSchema =
|
|
2846
|
-
type:
|
|
2847
|
-
steps:
|
|
2848
|
-
explanation:
|
|
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 =
|
|
2851
|
-
type:
|
|
3397
|
+
var deltaExtensionShapeSchema = z27.object({
|
|
3398
|
+
type: z27.literal("extension"),
|
|
2852
3399
|
kind: extensionKindSchema,
|
|
2853
3400
|
payload: jsonValueSchema
|
|
2854
3401
|
});
|
|
2855
|
-
var deltaItemShapeSchema =
|
|
2856
|
-
|
|
2857
|
-
type:
|
|
2858
|
-
command:
|
|
2859
|
-
cwd:
|
|
2860
|
-
aggregatedOutput:
|
|
2861
|
-
exitCode:
|
|
2862
|
-
durationMs:
|
|
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
|
-
|
|
2865
|
-
type:
|
|
2866
|
-
changes:
|
|
3411
|
+
z27.object({
|
|
3412
|
+
type: z27.literal("fileChange"),
|
|
3413
|
+
changes: z27.array(deltaFileChangeSchema)
|
|
2867
3414
|
}),
|
|
2868
|
-
|
|
2869
|
-
type:
|
|
2870
|
-
tool:
|
|
2871
|
-
server:
|
|
2872
|
-
args:
|
|
2873
|
-
result:
|
|
2874
|
-
error:
|
|
2875
|
-
durationMs:
|
|
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
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
type:
|
|
2881
|
-
summary:
|
|
2882
|
-
content:
|
|
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
|
-
|
|
2885
|
-
|
|
2886
|
-
type:
|
|
2887
|
-
queries:
|
|
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
|
-
|
|
2890
|
-
type:
|
|
2891
|
-
url:
|
|
2892
|
-
prompt:
|
|
2893
|
-
pattern:
|
|
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
|
-
|
|
2896
|
-
|
|
2897
|
-
type:
|
|
2898
|
-
prompt:
|
|
2899
|
-
path:
|
|
2900
|
-
result:
|
|
2901
|
-
error:
|
|
2902
|
-
transparentBackground:
|
|
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 =
|
|
3458
|
+
var deltaProgressSnapshotSchema = z27.discriminatedUnion("type", [
|
|
2912
3459
|
deltaBackgroundTaskShapeSchema,
|
|
2913
3460
|
deltaDelegationShapeSchema
|
|
2914
3461
|
]);
|
|
2915
|
-
var deltaTextChannelSchema =
|
|
3462
|
+
var deltaTextChannelSchema = z27.enum([
|
|
2916
3463
|
"agentMessage",
|
|
2917
3464
|
"reasoningSummary",
|
|
2918
3465
|
"reasoningText",
|
|
2919
3466
|
"plan"
|
|
2920
3467
|
]);
|
|
2921
|
-
var deltaOutputChannelSchema =
|
|
2922
|
-
var deltaErrorSchema =
|
|
2923
|
-
var deltaAttachSchema =
|
|
2924
|
-
var deltaNoTurnFallbackSchema =
|
|
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:
|
|
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 =
|
|
2938
|
-
|
|
2939
|
-
kind:
|
|
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
|
-
|
|
2944
|
-
kind:
|
|
2945
|
-
text:
|
|
3490
|
+
z27.object({
|
|
3491
|
+
kind: z27.literal("input.provider"),
|
|
3492
|
+
text: z27.string().min(1),
|
|
2946
3493
|
parentRef: deltaKeyPartSchema.optional()
|
|
2947
3494
|
}),
|
|
2948
|
-
|
|
2949
|
-
kind:
|
|
3495
|
+
z27.object({
|
|
3496
|
+
kind: z27.literal("turn.open"),
|
|
2950
3497
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2951
3498
|
parentRef: deltaKeyPartSchema.optional()
|
|
2952
3499
|
}),
|
|
2953
|
-
|
|
2954
|
-
kind:
|
|
3500
|
+
z27.object({
|
|
3501
|
+
kind: z27.literal("turn.boundary"),
|
|
2955
3502
|
status: threadEventTurnStatusSchema,
|
|
2956
3503
|
error: deltaErrorSchema.optional(),
|
|
2957
|
-
providerCheckpointId:
|
|
2958
|
-
claimIfIdle:
|
|
3504
|
+
providerCheckpointId: z27.string().min(1).optional(),
|
|
3505
|
+
claimIfIdle: z27.boolean().optional(),
|
|
2959
3506
|
providerTurnId: providerTurnIdSchema.optional()
|
|
2960
3507
|
}),
|
|
2961
|
-
|
|
2962
|
-
kind:
|
|
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
|
-
|
|
2971
|
-
kind:
|
|
3517
|
+
z27.object({
|
|
3518
|
+
kind: z27.literal("item.close"),
|
|
2972
3519
|
key: deltaItemKeySchema,
|
|
2973
3520
|
status: threadEventItemStatusSchema,
|
|
2974
|
-
resultText:
|
|
2975
|
-
exitCode:
|
|
2976
|
-
aggregatedOutput:
|
|
2977
|
-
approvalStatus:
|
|
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
|
-
|
|
2984
|
-
kind:
|
|
3530
|
+
z27.object({
|
|
3531
|
+
kind: z27.literal("item.progress"),
|
|
2985
3532
|
key: deltaItemKeySchema,
|
|
2986
|
-
message:
|
|
3533
|
+
message: z27.string().optional(),
|
|
2987
3534
|
snapshot: deltaProgressSnapshotSchema.optional(),
|
|
2988
|
-
flush:
|
|
3535
|
+
flush: z27.boolean().optional(),
|
|
2989
3536
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2990
3537
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2991
3538
|
}),
|
|
2992
|
-
|
|
2993
|
-
kind:
|
|
3539
|
+
z27.object({
|
|
3540
|
+
kind: z27.literal("item.textDelta"),
|
|
2994
3541
|
key: deltaItemKeySchema,
|
|
2995
3542
|
channel: deltaTextChannelSchema,
|
|
2996
|
-
text:
|
|
3543
|
+
text: z27.string(),
|
|
2997
3544
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2998
3545
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2999
3546
|
}),
|
|
3000
|
-
|
|
3001
|
-
kind:
|
|
3547
|
+
z27.object({
|
|
3548
|
+
kind: z27.literal("item.textClose"),
|
|
3002
3549
|
key: deltaItemKeySchema,
|
|
3003
3550
|
channel: deltaTextChannelSchema,
|
|
3004
|
-
text:
|
|
3551
|
+
text: z27.string().optional(),
|
|
3005
3552
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3006
3553
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
3007
3554
|
}),
|
|
3008
|
-
|
|
3009
|
-
kind:
|
|
3555
|
+
z27.object({
|
|
3556
|
+
kind: z27.literal("item.outputDelta"),
|
|
3010
3557
|
key: deltaItemKeySchema,
|
|
3011
3558
|
channel: deltaOutputChannelSchema,
|
|
3012
|
-
text:
|
|
3559
|
+
text: z27.string(),
|
|
3013
3560
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3014
3561
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
3015
3562
|
}),
|
|
3016
|
-
|
|
3017
|
-
kind:
|
|
3563
|
+
z27.object({
|
|
3564
|
+
kind: z27.literal("command.outputSnapshot"),
|
|
3018
3565
|
key: deltaItemKeySchema,
|
|
3019
|
-
text:
|
|
3566
|
+
text: z27.string(),
|
|
3020
3567
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
3021
3568
|
}),
|
|
3022
|
-
|
|
3023
|
-
kind:
|
|
3569
|
+
z27.object({
|
|
3570
|
+
kind: z27.literal("usage"),
|
|
3024
3571
|
total: threadEventTokenUsageBreakdownSchema,
|
|
3025
3572
|
last: threadEventTokenUsageBreakdownSchema,
|
|
3026
|
-
modelContextWindow:
|
|
3573
|
+
modelContextWindow: z27.number().nullable(),
|
|
3027
3574
|
providerTurnId: providerTurnIdSchema.optional()
|
|
3028
3575
|
}),
|
|
3029
|
-
|
|
3030
|
-
kind:
|
|
3576
|
+
z27.object({
|
|
3577
|
+
kind: z27.literal("contextWindow"),
|
|
3031
3578
|
snapshot: contextSnapshotSchema.optional(),
|
|
3032
|
-
used:
|
|
3033
|
-
size:
|
|
3034
|
-
estimated:
|
|
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
|
-
|
|
3039
|
-
kind:
|
|
3585
|
+
z27.object({
|
|
3586
|
+
kind: z27.literal("context.compacted"),
|
|
3040
3587
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3041
3588
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
3042
3589
|
}),
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
kind:
|
|
3046
|
-
diff:
|
|
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
|
-
|
|
3050
|
-
|
|
3051
|
-
kind:
|
|
3052
|
-
providerThreadId:
|
|
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
|
-
|
|
3055
|
-
|
|
3056
|
-
kind:
|
|
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
|
-
|
|
3061
|
-
kind:
|
|
3607
|
+
z27.object({
|
|
3608
|
+
kind: z27.literal("provider.rateLimits"),
|
|
3062
3609
|
rateLimits: providerRateLimitStateSchema
|
|
3063
3610
|
}),
|
|
3064
|
-
|
|
3065
|
-
kind:
|
|
3066
|
-
message:
|
|
3067
|
-
detail:
|
|
3068
|
-
willRetry:
|
|
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:
|
|
3618
|
+
settlesTurn: z27.boolean().optional(),
|
|
3072
3619
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
3073
|
-
threadScoped:
|
|
3620
|
+
threadScoped: z27.boolean().optional()
|
|
3074
3621
|
}),
|
|
3075
|
-
|
|
3076
|
-
kind:
|
|
3077
|
-
originalModel:
|
|
3078
|
-
fallbackModel:
|
|
3079
|
-
reason:
|
|
3080
|
-
message:
|
|
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
|
-
|
|
3083
|
-
kind:
|
|
3084
|
-
summary:
|
|
3085
|
-
details:
|
|
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:
|
|
3634
|
+
vouchedTurn: z27.boolean().optional()
|
|
3088
3635
|
}),
|
|
3089
|
-
|
|
3090
|
-
kind:
|
|
3636
|
+
z27.object({
|
|
3637
|
+
kind: z27.literal("unhandled"),
|
|
3091
3638
|
raw: providerRawEventSchema,
|
|
3092
|
-
rawType:
|
|
3093
|
-
vouchedTurn:
|
|
3094
|
-
onlyIfNoTurn:
|
|
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
|
-
|
|
3099
|
-
|
|
3645
|
+
z27.object({ kind: z27.literal("session.ended") }),
|
|
3646
|
+
z27.object({ kind: z27.literal("session.reset") })
|
|
3100
3647
|
]);
|
|
3101
|
-
var threadDeltaNotificationParamsSchema =
|
|
3102
|
-
threadId:
|
|
3103
|
-
deltas:
|
|
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
|
|
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
|
|
3111
|
-
var bashArgsSchema =
|
|
3112
|
-
command:
|
|
3113
|
-
cwd:
|
|
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 =
|
|
3116
|
-
type:
|
|
3117
|
-
text:
|
|
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 =
|
|
3131
|
-
content:
|
|
3677
|
+
var contentWrapperSchema = z29.object({
|
|
3678
|
+
content: z29.array(z29.unknown())
|
|
3132
3679
|
}).passthrough();
|
|
3133
|
-
var shellEnvironmentVariableKeySchema =
|
|
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
|
|
3488
|
-
var bridgeRequestEnvelopeSchema =
|
|
3489
|
-
jsonrpc:
|
|
3490
|
-
id:
|
|
3491
|
-
method:
|
|
3492
|
-
params:
|
|
3493
|
-
});
|
|
3494
|
-
var jsonRpcErrorSchema =
|
|
3495
|
-
code:
|
|
3496
|
-
message:
|
|
3497
|
-
data:
|
|
3498
|
-
});
|
|
3499
|
-
var jsonRpcSuccessResponseSchema =
|
|
3500
|
-
jsonrpc:
|
|
3501
|
-
id:
|
|
3502
|
-
result:
|
|
3503
|
-
});
|
|
3504
|
-
var jsonRpcErrorResponseSchema =
|
|
3505
|
-
jsonrpc:
|
|
3506
|
-
id:
|
|
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
|
|
3595
|
-
var recordSchema =
|
|
3596
|
-
var jsonRpcEnvelopeSchema =
|
|
3597
|
-
jsonrpc:
|
|
3598
|
-
method:
|
|
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 =
|
|
3602
|
-
jsonrpc:
|
|
3603
|
-
method:
|
|
3604
|
-
params:
|
|
3605
|
-
message:
|
|
3606
|
-
threadId:
|
|
3607
|
-
parent_tool_use_id:
|
|
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 =
|
|
3611
|
-
jsonrpc:
|
|
3612
|
-
method:
|
|
3613
|
-
params:
|
|
3614
|
-
threadId:
|
|
3615
|
-
providerThreadId:
|
|
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 =
|
|
3619
|
-
jsonrpc:
|
|
3620
|
-
method:
|
|
3621
|
-
params:
|
|
3622
|
-
threadId:
|
|
3623
|
-
contextWindowUsage:
|
|
3624
|
-
usedTokens:
|
|
3625
|
-
modelContextWindow:
|
|
3626
|
-
estimated:
|
|
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 =
|
|
3631
|
-
jsonrpc:
|
|
3632
|
-
method:
|
|
3633
|
-
params:
|
|
3634
|
-
message:
|
|
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
|
|
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}
|
|
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
|
|
3794
|
-
var providerToolCallCancellationSchema =
|
|
3795
|
-
requestId:
|
|
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
|
|
3812
|
-
var ignoredJsonRpcResultSchema =
|
|
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
|
|
4375
|
+
import { z as z42 } from "zod";
|
|
3823
4376
|
|
|
3824
4377
|
// ../provider-bridge-acp/src/bridge-protocol.ts
|
|
3825
|
-
import { z as
|
|
4378
|
+
import { z as z36 } from "zod";
|
|
3826
4379
|
|
|
3827
4380
|
// ../provider-bridge-acp/src/wire.ts
|
|
3828
|
-
import { z as
|
|
3829
|
-
var acpTextContentBlockSchema =
|
|
3830
|
-
type:
|
|
3831
|
-
text:
|
|
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 =
|
|
3834
|
-
type:
|
|
4386
|
+
var acpOtherContentBlockSchema = z35.object({
|
|
4387
|
+
type: z35.string()
|
|
3835
4388
|
}).passthrough();
|
|
3836
|
-
var acpContentBlockSchema =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
3873
|
-
|
|
3874
|
-
type:
|
|
4425
|
+
var acpToolCallContentSchema = z35.union([
|
|
4426
|
+
z35.object({
|
|
4427
|
+
type: z35.literal("content"),
|
|
3875
4428
|
content: acpContentBlockSchema
|
|
3876
4429
|
}).passthrough(),
|
|
3877
|
-
|
|
3878
|
-
type:
|
|
3879
|
-
path:
|
|
3880
|
-
oldText:
|
|
3881
|
-
newText:
|
|
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
|
-
|
|
3884
|
-
type:
|
|
3885
|
-
terminalId:
|
|
4436
|
+
z35.object({
|
|
4437
|
+
type: z35.literal("terminal"),
|
|
4438
|
+
terminalId: z35.string()
|
|
3886
4439
|
}).passthrough()
|
|
3887
4440
|
]);
|
|
3888
|
-
var acpToolCallContentListSchema =
|
|
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 =
|
|
3895
|
-
path:
|
|
3896
|
-
line:
|
|
4447
|
+
var acpToolCallLocationSchema = z35.object({
|
|
4448
|
+
path: z35.string(),
|
|
4449
|
+
line: z35.number().optional().nullable()
|
|
3897
4450
|
}).passthrough();
|
|
3898
|
-
var acpToolCallNameSchema =
|
|
3899
|
-
var acpToolCallFieldsSchema =
|
|
3900
|
-
toolCallId:
|
|
3901
|
-
title:
|
|
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:
|
|
4457
|
+
rawKind: z35.string().optional(),
|
|
3905
4458
|
status: acpToolCallStatusSchema.optional(),
|
|
3906
4459
|
content: acpToolCallContentListSchema.optional(),
|
|
3907
|
-
locations:
|
|
3908
|
-
rawInput:
|
|
3909
|
-
rawOutput:
|
|
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 =
|
|
3936
|
-
sessionUpdate:
|
|
4488
|
+
var acpAgentMessageChunkUpdateSchema = z35.object({
|
|
4489
|
+
sessionUpdate: z35.literal("agent_message_chunk"),
|
|
3937
4490
|
content: acpContentBlockSchema
|
|
3938
4491
|
}).passthrough();
|
|
3939
|
-
var acpAgentThoughtChunkUpdateSchema =
|
|
3940
|
-
sessionUpdate:
|
|
4492
|
+
var acpAgentThoughtChunkUpdateSchema = z35.object({
|
|
4493
|
+
sessionUpdate: z35.literal("agent_thought_chunk"),
|
|
3941
4494
|
content: acpContentBlockSchema
|
|
3942
4495
|
}).passthrough();
|
|
3943
|
-
var acpToolCallUpdateEventSchema =
|
|
4496
|
+
var acpToolCallUpdateEventSchema = z35.preprocess(
|
|
3944
4497
|
openAcpToolCallEnums,
|
|
3945
4498
|
acpToolCallFieldsSchema.extend({
|
|
3946
|
-
sessionUpdate:
|
|
4499
|
+
sessionUpdate: z35.enum(["tool_call", "tool_call_update"])
|
|
3947
4500
|
}).passthrough()
|
|
3948
4501
|
);
|
|
3949
|
-
var acpPlanEntryStatusSchema =
|
|
4502
|
+
var acpPlanEntryStatusSchema = z35.enum([
|
|
3950
4503
|
"pending",
|
|
3951
4504
|
"in_progress",
|
|
3952
4505
|
"completed"
|
|
3953
4506
|
]);
|
|
3954
|
-
var acpPlanUpdateSchema =
|
|
3955
|
-
sessionUpdate:
|
|
3956
|
-
entries:
|
|
3957
|
-
|
|
3958
|
-
content:
|
|
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 =
|
|
3964
|
-
sessionUpdate:
|
|
3965
|
-
used:
|
|
3966
|
-
size:
|
|
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 =
|
|
3969
|
-
sessionUpdate:
|
|
4521
|
+
var acpOtherSessionUpdateSchema = z35.object({
|
|
4522
|
+
sessionUpdate: z35.string()
|
|
3970
4523
|
}).passthrough();
|
|
3971
|
-
var acpSessionUpdateSchema =
|
|
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 =
|
|
3980
|
-
sessionId:
|
|
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 =
|
|
3985
|
-
protocolVersion:
|
|
3986
|
-
agentCapabilities:
|
|
3987
|
-
loadSession:
|
|
3988
|
-
sessionCapabilities:
|
|
3989
|
-
fork:
|
|
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:
|
|
3992
|
-
image:
|
|
3993
|
-
audio:
|
|
3994
|
-
embeddedContext:
|
|
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:
|
|
4550
|
+
authMethods: z35.array(z35.object({ id: z35.string() }).passthrough()).optional()
|
|
3998
4551
|
}).passthrough();
|
|
3999
|
-
var acpOptionalString =
|
|
4000
|
-
var acpConfigOptionSelectOptionSchema =
|
|
4001
|
-
value:
|
|
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 =
|
|
4005
|
-
id:
|
|
4557
|
+
var acpConfigOptionSchema = z35.object({
|
|
4558
|
+
id: z35.string(),
|
|
4006
4559
|
name: acpOptionalString,
|
|
4007
4560
|
category: acpOptionalString,
|
|
4008
|
-
type:
|
|
4561
|
+
type: z35.string(),
|
|
4009
4562
|
currentValue: acpOptionalString,
|
|
4010
|
-
options:
|
|
4563
|
+
options: z35.array(acpConfigOptionSelectOptionSchema).optional()
|
|
4011
4564
|
}).passthrough();
|
|
4012
|
-
var acpSessionModelSchema =
|
|
4013
|
-
modelId:
|
|
4565
|
+
var acpSessionModelSchema = z35.object({
|
|
4566
|
+
modelId: z35.string(),
|
|
4014
4567
|
name: acpOptionalString,
|
|
4015
4568
|
description: acpOptionalString
|
|
4016
4569
|
}).passthrough();
|
|
4017
|
-
var acpSessionModelsSchema =
|
|
4570
|
+
var acpSessionModelsSchema = z35.object({
|
|
4018
4571
|
currentModelId: acpOptionalString,
|
|
4019
|
-
availableModels:
|
|
4572
|
+
availableModels: z35.array(acpSessionModelSchema).optional()
|
|
4020
4573
|
}).passthrough();
|
|
4021
|
-
var acpLooseConfigOptionSchema =
|
|
4022
|
-
id:
|
|
4023
|
-
name:
|
|
4574
|
+
var acpLooseConfigOptionSchema = z35.object({
|
|
4575
|
+
id: z35.string().optional(),
|
|
4576
|
+
name: z35.unknown().optional(),
|
|
4024
4577
|
category: acpOptionalString,
|
|
4025
|
-
type:
|
|
4026
|
-
currentValue:
|
|
4027
|
-
options:
|
|
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 =
|
|
4072
|
-
sessionId:
|
|
4624
|
+
var acpSessionNewResultSchema = z35.object({
|
|
4625
|
+
sessionId: z35.string(),
|
|
4073
4626
|
models: acpSessionModelsSchema.optional(),
|
|
4074
|
-
configOptions:
|
|
4627
|
+
configOptions: z35.array(z35.unknown()).nullable().optional().transform((options, ctx) => parseAcpConfigOptions(options, ctx))
|
|
4075
4628
|
}).passthrough();
|
|
4076
|
-
var acpConfigStateResultSchema =
|
|
4629
|
+
var acpConfigStateResultSchema = z35.object({
|
|
4077
4630
|
models: acpSessionModelsSchema.optional(),
|
|
4078
|
-
configOptions:
|
|
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:
|
|
4634
|
+
sessionId: z35.string()
|
|
4082
4635
|
});
|
|
4083
|
-
var acpStopReasonSchema =
|
|
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 =
|
|
4643
|
+
var acpPromptResultSchema = z35.object({
|
|
4091
4644
|
stopReason: acpStopReasonSchema
|
|
4092
4645
|
}).passthrough();
|
|
4093
|
-
var acpPermissionOptionKindSchema =
|
|
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 =
|
|
4100
|
-
optionId:
|
|
4101
|
-
name:
|
|
4652
|
+
var acpPermissionOptionSchema = z35.object({
|
|
4653
|
+
optionId: z35.string(),
|
|
4654
|
+
name: z35.string(),
|
|
4102
4655
|
kind: acpPermissionOptionKindSchema
|
|
4103
4656
|
}).passthrough();
|
|
4104
|
-
var acpRequestPermissionParamsSchema =
|
|
4105
|
-
sessionId:
|
|
4106
|
-
toolCall:
|
|
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:
|
|
4663
|
+
options: z35.array(acpPermissionOptionSchema).min(1)
|
|
4111
4664
|
}).passthrough();
|
|
4112
|
-
var acpReadTextFileParamsSchema =
|
|
4113
|
-
sessionId:
|
|
4114
|
-
path:
|
|
4115
|
-
line:
|
|
4116
|
-
limit:
|
|
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 =
|
|
4119
|
-
sessionId:
|
|
4120
|
-
path:
|
|
4121
|
-
content:
|
|
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:
|
|
4680
|
+
providerOptions: z36.record(z36.string(), z36.unknown()).optional()
|
|
4128
4681
|
});
|
|
4129
|
-
var acpBridgeCommandSchema =
|
|
4130
|
-
|
|
4131
|
-
method:
|
|
4682
|
+
var acpBridgeCommandSchema = z36.discriminatedUnion("method", [
|
|
4683
|
+
z36.object({
|
|
4684
|
+
method: z36.literal("initialize"),
|
|
4132
4685
|
params: initializeParamsSchema
|
|
4133
4686
|
}),
|
|
4134
|
-
|
|
4135
|
-
method:
|
|
4687
|
+
z36.object({
|
|
4688
|
+
method: z36.literal("model/list"),
|
|
4136
4689
|
params: acpModelListParamsSchema
|
|
4137
4690
|
}),
|
|
4138
|
-
|
|
4139
|
-
method:
|
|
4691
|
+
z36.object({
|
|
4692
|
+
method: z36.literal("provider/health"),
|
|
4140
4693
|
params: providerMaintenanceParamsSchema
|
|
4141
4694
|
}),
|
|
4142
|
-
|
|
4143
|
-
method:
|
|
4695
|
+
z36.object({
|
|
4696
|
+
method: z36.literal("provider/usage"),
|
|
4144
4697
|
params: providerMaintenanceParamsSchema
|
|
4145
4698
|
}),
|
|
4146
|
-
|
|
4147
|
-
method:
|
|
4699
|
+
z36.object({
|
|
4700
|
+
method: z36.literal("provider/installation/status"),
|
|
4148
4701
|
params: providerInstallationStatusParamsSchema
|
|
4149
4702
|
}),
|
|
4150
|
-
|
|
4151
|
-
method:
|
|
4703
|
+
z36.object({
|
|
4704
|
+
method: z36.literal("provider/installation/run"),
|
|
4152
4705
|
params: providerInstallationRunParamsSchema
|
|
4153
4706
|
}),
|
|
4154
|
-
|
|
4155
|
-
method:
|
|
4707
|
+
z36.object({
|
|
4708
|
+
method: z36.literal("thread/start"),
|
|
4156
4709
|
params: threadStartParamsSchema
|
|
4157
4710
|
}),
|
|
4158
|
-
|
|
4159
|
-
method:
|
|
4711
|
+
z36.object({
|
|
4712
|
+
method: z36.literal("thread/resume"),
|
|
4160
4713
|
params: threadResumeParamsSchema
|
|
4161
4714
|
}),
|
|
4162
|
-
|
|
4163
|
-
method:
|
|
4715
|
+
z36.object({
|
|
4716
|
+
method: z36.literal("thread/fork"),
|
|
4164
4717
|
params: threadForkParamsSchema
|
|
4165
4718
|
}),
|
|
4166
|
-
|
|
4167
|
-
method:
|
|
4719
|
+
z36.object({
|
|
4720
|
+
method: z36.literal("turn/start"),
|
|
4168
4721
|
params: turnStartParamsSchema
|
|
4169
4722
|
}),
|
|
4170
|
-
|
|
4171
|
-
method:
|
|
4723
|
+
z36.object({
|
|
4724
|
+
method: z36.literal("turn/steer"),
|
|
4172
4725
|
params: turnSteerParamsSchema
|
|
4173
4726
|
}),
|
|
4174
|
-
|
|
4175
|
-
method:
|
|
4727
|
+
z36.object({
|
|
4728
|
+
method: z36.literal("thread/stop"),
|
|
4176
4729
|
params: threadStopParamsSchema
|
|
4177
4730
|
}),
|
|
4178
|
-
|
|
4179
|
-
method:
|
|
4731
|
+
z36.object({
|
|
4732
|
+
method: z36.literal("thread/discard"),
|
|
4180
4733
|
params: threadDiscardParamsSchema
|
|
4181
4734
|
}),
|
|
4182
|
-
|
|
4183
|
-
method:
|
|
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 =
|
|
4199
|
-
threadId:
|
|
4751
|
+
var acpTurnStartedNotificationParamsSchema = z36.object({
|
|
4752
|
+
threadId: z36.string().min(1)
|
|
4200
4753
|
}).passthrough();
|
|
4201
|
-
var acpTurnCompletedNotificationParamsSchema =
|
|
4202
|
-
threadId:
|
|
4754
|
+
var acpTurnCompletedNotificationParamsSchema = z36.object({
|
|
4755
|
+
threadId: z36.string().min(1),
|
|
4203
4756
|
stopReason: acpStopReasonSchema
|
|
4204
4757
|
}).passthrough();
|
|
4205
|
-
var acpCompactionCompletedNotificationParamsSchema =
|
|
4206
|
-
|
|
4207
|
-
threadId:
|
|
4208
|
-
status:
|
|
4758
|
+
var acpCompactionCompletedNotificationParamsSchema = z36.discriminatedUnion("status", [
|
|
4759
|
+
z36.object({
|
|
4760
|
+
threadId: z36.string().min(1),
|
|
4761
|
+
status: z36.literal("completed")
|
|
4209
4762
|
}).passthrough(),
|
|
4210
|
-
|
|
4211
|
-
threadId:
|
|
4212
|
-
status:
|
|
4763
|
+
z36.object({
|
|
4764
|
+
threadId: z36.string().min(1),
|
|
4765
|
+
status: z36.literal("interrupted")
|
|
4213
4766
|
}).passthrough(),
|
|
4214
|
-
|
|
4215
|
-
threadId:
|
|
4216
|
-
status:
|
|
4217
|
-
detail:
|
|
4767
|
+
z36.object({
|
|
4768
|
+
threadId: z36.string().min(1),
|
|
4769
|
+
status: z36.literal("skipped"),
|
|
4770
|
+
detail: z36.string().min(1)
|
|
4218
4771
|
}).passthrough(),
|
|
4219
|
-
|
|
4220
|
-
threadId:
|
|
4221
|
-
status:
|
|
4222
|
-
error:
|
|
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 =
|
|
4226
|
-
threadId:
|
|
4778
|
+
var acpUpdateNotificationParamsSchema = z36.object({
|
|
4779
|
+
threadId: z36.string().min(1),
|
|
4227
4780
|
update: acpSessionUpdateSchema
|
|
4228
4781
|
}).passthrough();
|
|
4229
|
-
var acpFsWriteNotificationParamsSchema =
|
|
4230
|
-
threadId:
|
|
4231
|
-
path:
|
|
4232
|
-
kind:
|
|
4233
|
-
oldText:
|
|
4234
|
-
content:
|
|
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 =
|
|
4237
|
-
threadId:
|
|
4238
|
-
summary:
|
|
4239
|
-
details:
|
|
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
|
|
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
|
|
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 =
|
|
4293
|
-
accessToken:
|
|
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 =
|
|
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 =
|
|
4445
|
-
|
|
4446
|
-
|
|
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 =
|
|
5001
|
+
var cursorUsageResponseSchema = z37.object({
|
|
4449
5002
|
billingCycleEnd: cursorNonNegativeIntegerSchema.nullish(),
|
|
4450
|
-
planUsage:
|
|
4451
|
-
spendLimitUsage:
|
|
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 =
|
|
4461
|
-
planInfo:
|
|
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
|
|
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
|
|
4678
|
-
var acpRawInputCommandSchema =
|
|
4679
|
-
var acpRawInputPathSchema =
|
|
4680
|
-
path:
|
|
4681
|
-
filePath:
|
|
4682
|
-
file_path:
|
|
4683
|
-
target_file:
|
|
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 =
|
|
4861
|
-
exitCode:
|
|
4862
|
-
exit_code:
|
|
4863
|
-
stdout:
|
|
4864
|
-
stderr:
|
|
4865
|
-
output_for_prompt:
|
|
4866
|
-
signal:
|
|
4867
|
-
timed_out:
|
|
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 =
|
|
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 =
|
|
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 =
|
|
4949
|
-
var thinkRawInputSchema =
|
|
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 =
|
|
5143
|
-
"x.ai/tool":
|
|
5144
|
-
name:
|
|
5145
|
-
kind:
|
|
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 =
|
|
5162
|
-
description:
|
|
5163
|
-
prompt:
|
|
5164
|
-
subagent_type:
|
|
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 =
|
|
5746
|
+
var cursorTaskRawInputSchema = z40.object({ _toolName: z40.string().optional() }).passthrough();
|
|
5194
5747
|
var CURSOR_TASK_METHOD = "cursor/task";
|
|
5195
|
-
var cursorTaskParamsSchema =
|
|
5196
|
-
toolCallId:
|
|
5197
|
-
description:
|
|
5198
|
-
prompt:
|
|
5199
|
-
agentId:
|
|
5200
|
-
model:
|
|
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 =
|
|
5249
|
-
command:
|
|
5250
|
-
async:
|
|
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:
|
|
5254
|
-
|
|
5255
|
-
type:
|
|
5256
|
-
text:
|
|
5806
|
+
content: z40.array(
|
|
5807
|
+
z40.object({
|
|
5808
|
+
type: z40.literal("text"),
|
|
5809
|
+
text: z40.string()
|
|
5257
5810
|
}).passthrough()
|
|
5258
5811
|
),
|
|
5259
|
-
details:
|
|
5260
|
-
exitCode:
|
|
5261
|
-
wallTimeMs:
|
|
5262
|
-
timedOut:
|
|
5263
|
-
signal:
|
|
5264
|
-
async:
|
|
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 =
|
|
5328
|
-
output:
|
|
5329
|
-
metadata:
|
|
5330
|
-
exit:
|
|
5331
|
-
output:
|
|
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
|
|
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 =
|
|
7258
|
-
|
|
7259
|
-
kind:
|
|
7260
|
-
threadId:
|
|
7261
|
-
token:
|
|
7262
|
-
toolCount:
|
|
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
|
-
|
|
7265
|
-
kind:
|
|
7266
|
-
arguments:
|
|
7267
|
-
callId:
|
|
7268
|
-
threadId:
|
|
7269
|
-
token:
|
|
7270
|
-
tool:
|
|
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 =
|
|
7274
|
-
|
|
7275
|
-
ok:
|
|
7276
|
-
content:
|
|
7277
|
-
contentBlocks:
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
type:
|
|
7282
|
-
data:
|
|
7283
|
-
mimeType:
|
|
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:
|
|
7288
|
-
isError:
|
|
7840
|
+
images: z41.array(z41.object({ data: z41.string(), mimeType: z41.string() })).default([]),
|
|
7841
|
+
isError: z41.boolean().optional()
|
|
7289
7842
|
}),
|
|
7290
|
-
|
|
7843
|
+
z41.object({ ok: z41.literal(false), error: z41.string() })
|
|
7291
7844
|
]);
|
|
7292
|
-
var jsonRpcMessageSchema =
|
|
7293
|
-
id:
|
|
7294
|
-
method:
|
|
7295
|
-
params:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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 =
|
|
9354
|
-
additionalWorkspaceWriteRoots:
|
|
9355
|
-
acpDialect:
|
|
9356
|
-
parameterizedModelPicker:
|
|
9357
|
-
primaryModels:
|
|
9358
|
-
reasoningProbePriorityModelIds:
|
|
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
|
|
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 =
|
|
9734
|
-
|
|
9735
|
-
|
|
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,
|