subagent-extension-for-codex 0.2.0 → 0.3.0
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/README.md +5 -5
- package/assets/icons/arrow-up-circle.svg +14 -0
- package/assets/icons/check-circle.svg +14 -0
- package/assets/icons/file-code.svg +17 -0
- package/assets/icons/file-diff.svg +17 -0
- package/assets/icons/file-text.svg +17 -0
- package/assets/icons/note.svg +16 -0
- package/dist/THIRD_PARTY_LICENSES.txt +21 -1
- package/dist/app.html +644 -132
- package/dist/bundle/chunks/{chunk-MOWBM7MZ.js → chunk-36LESPFG.js} +1752 -196
- package/dist/bundle/chunks/chunk-36LESPFG.js.map +6 -0
- package/dist/bundle/chunks/{chunk-5TX3SEV2.js → chunk-FT2Y2DFZ.js} +137 -1
- package/dist/bundle/chunks/chunk-FT2Y2DFZ.js.map +6 -0
- package/dist/bundle/chunks/{chunk-DGCGXY3T.js → chunk-L5ILPS3O.js} +1722 -687
- package/dist/bundle/chunks/chunk-L5ILPS3O.js.map +6 -0
- package/dist/bundle/chunks/chunk-TPCNCQM7.js +970 -0
- package/dist/bundle/chunks/chunk-TPCNCQM7.js.map +6 -0
- package/dist/bundle/chunks/{v4-LDJUK5DU.js → v4-NCRHZ3K4.js} +2 -2
- package/dist/bundle/main.js +14481 -11021
- package/dist/bundle/main.js.map +3 -3
- package/dist/bundle/projects-cli.js +6 -3
- package/dist/bundle/projects-cli.js.map +1 -1
- package/dist/bundle/stdio.js +106 -8
- package/dist/bundle/stdio.js.map +2 -2
- package/migrations/20261107064009_claude-sdk-settings/migration.sql +39 -0
- package/migrations/20261107064009_claude-sdk-settings/snapshot.json +615 -0
- package/migrations/20261107203218_task-read-indexes/migration.sql +9 -0
- package/migrations/20261107203218_task-read-indexes/snapshot.json +762 -0
- package/migrations/20261107210532_chat-events-backfill/migration.sql +23 -0
- package/migrations/20261107210532_chat-events-backfill/snapshot.json +762 -0
- package/migrations/20261108005345_task-messages/migration.sql +9 -0
- package/migrations/20261108005345_task-messages/snapshot.json +841 -0
- package/migrations/20261108005348_task-messages-backfill/migration.sql +14 -0
- package/migrations/20261108005348_task-messages-backfill/snapshot.json +841 -0
- package/migrations/20261110025216_task-attachments/migration.sql +21 -0
- package/migrations/20261110025216_task-attachments/snapshot.json +1040 -0
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skills/delegation/SKILL.md +14 -7
- package/dist/bundle/chunks/chunk-5TX3SEV2.js.map +0 -6
- package/dist/bundle/chunks/chunk-DGCGXY3T.js.map +0 -6
- package/dist/bundle/chunks/chunk-MOWBM7MZ.js.map +0 -6
- package/dist/bundle/chunks/chunk-ZSLXLKU2.js +0 -1702
- package/dist/bundle/chunks/chunk-ZSLXLKU2.js.map +0 -6
- /package/dist/bundle/chunks/{v4-LDJUK5DU.js.map → v4-NCRHZ3K4.js.map} +0 -0
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
import { createRequire as __bundleCreateRequire } from "node:module"; const require = __bundleCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
+
AttachmentError,
|
|
3
4
|
JsonlWriter,
|
|
5
|
+
MESSAGE_EVENTS,
|
|
6
|
+
PolicyRejectedError,
|
|
7
|
+
WORKTREE_NEEDS_GIT,
|
|
4
8
|
approvalDeciderSchema,
|
|
5
9
|
approvalModeSchema,
|
|
10
|
+
archivedFilters,
|
|
6
11
|
assertPlainFolderAllowed,
|
|
7
12
|
budgetRaiseSchema,
|
|
13
|
+
chatItems,
|
|
14
|
+
conversation,
|
|
8
15
|
dataDirectory,
|
|
9
16
|
deliveries,
|
|
10
17
|
errorCategory,
|
|
18
|
+
eventPayload,
|
|
19
|
+
failureMessage,
|
|
11
20
|
gitRepositoryRoot,
|
|
12
21
|
gitState,
|
|
13
22
|
gitWorkTreeRoot,
|
|
14
23
|
installRoot,
|
|
24
|
+
isBudgetFailure,
|
|
15
25
|
logCorrelation,
|
|
16
26
|
logError,
|
|
17
27
|
logEvent,
|
|
18
28
|
modelNameSchema,
|
|
29
|
+
packagePath,
|
|
19
30
|
packageVersion,
|
|
20
31
|
readPackageFile,
|
|
21
32
|
reasoningLevels,
|
|
@@ -24,14 +35,16 @@ import {
|
|
|
24
35
|
startSchema,
|
|
25
36
|
withLogContext,
|
|
26
37
|
within
|
|
27
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-36LESPFG.js";
|
|
28
39
|
import {
|
|
29
40
|
$ZodObject,
|
|
30
41
|
$ZodType,
|
|
31
42
|
$constructor,
|
|
32
43
|
NEVER,
|
|
33
44
|
ZodIssueCode,
|
|
45
|
+
__commonJS,
|
|
34
46
|
__require,
|
|
47
|
+
__toESM,
|
|
35
48
|
_enum,
|
|
36
49
|
_null,
|
|
37
50
|
any,
|
|
@@ -40,8 +53,10 @@ import {
|
|
|
40
53
|
clone,
|
|
41
54
|
coerce_exports,
|
|
42
55
|
custom,
|
|
56
|
+
define_EXTENSION_BUILD_INFO_default,
|
|
43
57
|
discriminatedUnion,
|
|
44
58
|
external_exports,
|
|
59
|
+
init_define_EXTENSION_BUILD_INFO,
|
|
45
60
|
installLazyProp,
|
|
46
61
|
intersection,
|
|
47
62
|
iso_exports,
|
|
@@ -64,9 +79,521 @@ import {
|
|
|
64
79
|
union,
|
|
65
80
|
unknown,
|
|
66
81
|
url
|
|
67
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-FT2Y2DFZ.js";
|
|
83
|
+
|
|
84
|
+
// node_modules/semver/internal/debug.js
|
|
85
|
+
var require_debug = __commonJS({
|
|
86
|
+
"node_modules/semver/internal/debug.js"(exports, module) {
|
|
87
|
+
"use strict";
|
|
88
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
89
|
+
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
90
|
+
};
|
|
91
|
+
module.exports = debug;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// node_modules/semver/internal/constants.js
|
|
96
|
+
var require_constants = __commonJS({
|
|
97
|
+
"node_modules/semver/internal/constants.js"(exports, module) {
|
|
98
|
+
"use strict";
|
|
99
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
100
|
+
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
101
|
+
var MAX_LENGTH = 256;
|
|
102
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
103
|
+
9007199254740991;
|
|
104
|
+
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
105
|
+
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
106
|
+
var WHITESPACE_CHARACTERS = [
|
|
107
|
+
" ",
|
|
108
|
+
"\n",
|
|
109
|
+
"\v",
|
|
110
|
+
"\f",
|
|
111
|
+
"\r",
|
|
112
|
+
" ",
|
|
113
|
+
"\xA0",
|
|
114
|
+
"\u1680",
|
|
115
|
+
"\u2000",
|
|
116
|
+
"\u2001",
|
|
117
|
+
"\u2002",
|
|
118
|
+
"\u2003",
|
|
119
|
+
"\u2004",
|
|
120
|
+
"\u2005",
|
|
121
|
+
"\u2006",
|
|
122
|
+
"\u2007",
|
|
123
|
+
"\u2008",
|
|
124
|
+
"\u2009",
|
|
125
|
+
"\u200A",
|
|
126
|
+
"\u2028",
|
|
127
|
+
"\u2029",
|
|
128
|
+
"\u202F",
|
|
129
|
+
"\u205F",
|
|
130
|
+
"\u3000",
|
|
131
|
+
"\uFEFF"
|
|
132
|
+
];
|
|
133
|
+
var RELEASE_TYPES = [
|
|
134
|
+
"major",
|
|
135
|
+
"premajor",
|
|
136
|
+
"minor",
|
|
137
|
+
"preminor",
|
|
138
|
+
"patch",
|
|
139
|
+
"prepatch",
|
|
140
|
+
"prerelease"
|
|
141
|
+
];
|
|
142
|
+
module.exports = {
|
|
143
|
+
MAX_LENGTH,
|
|
144
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
145
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
146
|
+
MAX_SAFE_INTEGER,
|
|
147
|
+
WHITESPACE_CHARACTERS,
|
|
148
|
+
RELEASE_TYPES,
|
|
149
|
+
SEMVER_SPEC_VERSION,
|
|
150
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
151
|
+
FLAG_LOOSE: 2
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// node_modules/semver/internal/re.js
|
|
157
|
+
var require_re = __commonJS({
|
|
158
|
+
"node_modules/semver/internal/re.js"(exports, module) {
|
|
159
|
+
"use strict";
|
|
160
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
161
|
+
var {
|
|
162
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
163
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
164
|
+
MAX_LENGTH
|
|
165
|
+
} = require_constants();
|
|
166
|
+
var debug = require_debug();
|
|
167
|
+
exports = module.exports = {};
|
|
168
|
+
var re = exports.re = [];
|
|
169
|
+
var safeRe = exports.safeRe = [];
|
|
170
|
+
var src = exports.src = [];
|
|
171
|
+
var safeSrc = exports.safeSrc = [];
|
|
172
|
+
var t = exports.t = {};
|
|
173
|
+
var R2 = 0;
|
|
174
|
+
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
175
|
+
var safeRegexReplacements = [
|
|
176
|
+
["\\s", 1],
|
|
177
|
+
["\\d", MAX_LENGTH],
|
|
178
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
179
|
+
];
|
|
180
|
+
var makeSafeRegex = (value) => {
|
|
181
|
+
for (const [token, max] of safeRegexReplacements) {
|
|
182
|
+
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
183
|
+
}
|
|
184
|
+
return value;
|
|
185
|
+
};
|
|
186
|
+
var createToken = (name, value, isGlobal) => {
|
|
187
|
+
const safe = makeSafeRegex(value);
|
|
188
|
+
const index = R2++;
|
|
189
|
+
debug(name, index, value);
|
|
190
|
+
t[name] = index;
|
|
191
|
+
src[index] = value;
|
|
192
|
+
safeSrc[index] = safe;
|
|
193
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
194
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
195
|
+
};
|
|
196
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
197
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
198
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
199
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
200
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
201
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
202
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
203
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
204
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
205
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
206
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
207
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
208
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
209
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
210
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
211
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
212
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
213
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
214
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
215
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
216
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
217
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
218
|
+
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
219
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
220
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
221
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
222
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
223
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
224
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
225
|
+
exports.tildeTrimReplace = "$1~";
|
|
226
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
227
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
228
|
+
createToken("LONECARET", "(?:\\^)");
|
|
229
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
230
|
+
exports.caretTrimReplace = "$1^";
|
|
231
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
232
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
233
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
234
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
235
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
236
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
237
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
238
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
239
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
240
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
241
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
// node_modules/semver/internal/parse-options.js
|
|
246
|
+
var require_parse_options = __commonJS({
|
|
247
|
+
"node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
248
|
+
"use strict";
|
|
249
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
250
|
+
var looseOption = Object.freeze({ loose: true });
|
|
251
|
+
var emptyOpts = Object.freeze({});
|
|
252
|
+
var parseOptions = (options2) => {
|
|
253
|
+
if (!options2) {
|
|
254
|
+
return emptyOpts;
|
|
255
|
+
}
|
|
256
|
+
if (typeof options2 !== "object") {
|
|
257
|
+
return looseOption;
|
|
258
|
+
}
|
|
259
|
+
return options2;
|
|
260
|
+
};
|
|
261
|
+
module.exports = parseOptions;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
// node_modules/semver/internal/identifiers.js
|
|
266
|
+
var require_identifiers = __commonJS({
|
|
267
|
+
"node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
268
|
+
"use strict";
|
|
269
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
270
|
+
var numeric = /^[0-9]+$/;
|
|
271
|
+
var compareIdentifiers = (a, b) => {
|
|
272
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
273
|
+
return a === b ? 0 : a < b ? -1 : 1;
|
|
274
|
+
}
|
|
275
|
+
const anum = numeric.test(a);
|
|
276
|
+
const bnum = numeric.test(b);
|
|
277
|
+
if (anum && bnum) {
|
|
278
|
+
a = +a;
|
|
279
|
+
b = +b;
|
|
280
|
+
}
|
|
281
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
282
|
+
};
|
|
283
|
+
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
284
|
+
module.exports = {
|
|
285
|
+
compareIdentifiers,
|
|
286
|
+
rcompareIdentifiers
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
// node_modules/semver/classes/semver.js
|
|
292
|
+
var require_semver = __commonJS({
|
|
293
|
+
"node_modules/semver/classes/semver.js"(exports, module) {
|
|
294
|
+
"use strict";
|
|
295
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
296
|
+
var debug = require_debug();
|
|
297
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
298
|
+
var { safeRe: re, t } = require_re();
|
|
299
|
+
var parseOptions = require_parse_options();
|
|
300
|
+
var { compareIdentifiers } = require_identifiers();
|
|
301
|
+
var isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
302
|
+
const identifiers = identifier.split(".");
|
|
303
|
+
if (identifiers.length > prerelease.length) {
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
for (let i = 0; i < identifiers.length; i++) {
|
|
307
|
+
if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return true;
|
|
312
|
+
};
|
|
313
|
+
var SemVer = class _SemVer {
|
|
314
|
+
constructor(version, options2) {
|
|
315
|
+
options2 = parseOptions(options2);
|
|
316
|
+
if (version instanceof _SemVer) {
|
|
317
|
+
if (version.loose === !!options2.loose && version.includePrerelease === !!options2.includePrerelease) {
|
|
318
|
+
return version;
|
|
319
|
+
} else {
|
|
320
|
+
version = version.version;
|
|
321
|
+
}
|
|
322
|
+
} else if (typeof version !== "string") {
|
|
323
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
324
|
+
}
|
|
325
|
+
if (version.length > MAX_LENGTH) {
|
|
326
|
+
throw new TypeError(
|
|
327
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
debug("SemVer", version, options2);
|
|
331
|
+
this.options = options2;
|
|
332
|
+
this.loose = !!options2.loose;
|
|
333
|
+
this.includePrerelease = !!options2.includePrerelease;
|
|
334
|
+
const m2 = version.trim().match(options2.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
335
|
+
if (!m2) {
|
|
336
|
+
throw new TypeError(`Invalid Version: ${version}`);
|
|
337
|
+
}
|
|
338
|
+
this.raw = version;
|
|
339
|
+
this.major = +m2[1];
|
|
340
|
+
this.minor = +m2[2];
|
|
341
|
+
this.patch = +m2[3];
|
|
342
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
343
|
+
throw new TypeError("Invalid major version");
|
|
344
|
+
}
|
|
345
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
346
|
+
throw new TypeError("Invalid minor version");
|
|
347
|
+
}
|
|
348
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
349
|
+
throw new TypeError("Invalid patch version");
|
|
350
|
+
}
|
|
351
|
+
if (!m2[4]) {
|
|
352
|
+
this.prerelease = [];
|
|
353
|
+
} else {
|
|
354
|
+
this.prerelease = m2[4].split(".").map((id) => {
|
|
355
|
+
if (/^[0-9]+$/.test(id)) {
|
|
356
|
+
const num = +id;
|
|
357
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
358
|
+
return num;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return id;
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
this.build = m2[5] ? m2[5].split(".") : [];
|
|
365
|
+
this.format();
|
|
366
|
+
}
|
|
367
|
+
format() {
|
|
368
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
369
|
+
if (this.prerelease.length) {
|
|
370
|
+
this.version += `-${this.prerelease.join(".")}`;
|
|
371
|
+
}
|
|
372
|
+
return this.version;
|
|
373
|
+
}
|
|
374
|
+
toString() {
|
|
375
|
+
return this.version;
|
|
376
|
+
}
|
|
377
|
+
compare(other) {
|
|
378
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
379
|
+
if (!(other instanceof _SemVer)) {
|
|
380
|
+
if (typeof other === "string" && other === this.version) {
|
|
381
|
+
return 0;
|
|
382
|
+
}
|
|
383
|
+
other = new _SemVer(other, this.options);
|
|
384
|
+
}
|
|
385
|
+
if (other.version === this.version) {
|
|
386
|
+
return 0;
|
|
387
|
+
}
|
|
388
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
389
|
+
}
|
|
390
|
+
compareMain(other) {
|
|
391
|
+
if (!(other instanceof _SemVer)) {
|
|
392
|
+
other = new _SemVer(other, this.options);
|
|
393
|
+
}
|
|
394
|
+
if (this.major < other.major) {
|
|
395
|
+
return -1;
|
|
396
|
+
}
|
|
397
|
+
if (this.major > other.major) {
|
|
398
|
+
return 1;
|
|
399
|
+
}
|
|
400
|
+
if (this.minor < other.minor) {
|
|
401
|
+
return -1;
|
|
402
|
+
}
|
|
403
|
+
if (this.minor > other.minor) {
|
|
404
|
+
return 1;
|
|
405
|
+
}
|
|
406
|
+
if (this.patch < other.patch) {
|
|
407
|
+
return -1;
|
|
408
|
+
}
|
|
409
|
+
if (this.patch > other.patch) {
|
|
410
|
+
return 1;
|
|
411
|
+
}
|
|
412
|
+
return 0;
|
|
413
|
+
}
|
|
414
|
+
comparePre(other) {
|
|
415
|
+
if (!(other instanceof _SemVer)) {
|
|
416
|
+
other = new _SemVer(other, this.options);
|
|
417
|
+
}
|
|
418
|
+
if (this.prerelease.length && !other.prerelease.length) {
|
|
419
|
+
return -1;
|
|
420
|
+
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
421
|
+
return 1;
|
|
422
|
+
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
423
|
+
return 0;
|
|
424
|
+
}
|
|
425
|
+
let i = 0;
|
|
426
|
+
do {
|
|
427
|
+
const a = this.prerelease[i];
|
|
428
|
+
const b = other.prerelease[i];
|
|
429
|
+
debug("prerelease compare", i, a, b);
|
|
430
|
+
if (a === void 0 && b === void 0) {
|
|
431
|
+
return 0;
|
|
432
|
+
} else if (b === void 0) {
|
|
433
|
+
return 1;
|
|
434
|
+
} else if (a === void 0) {
|
|
435
|
+
return -1;
|
|
436
|
+
} else if (a === b) {
|
|
437
|
+
continue;
|
|
438
|
+
} else {
|
|
439
|
+
return compareIdentifiers(a, b);
|
|
440
|
+
}
|
|
441
|
+
} while (++i);
|
|
442
|
+
}
|
|
443
|
+
compareBuild(other) {
|
|
444
|
+
if (!(other instanceof _SemVer)) {
|
|
445
|
+
other = new _SemVer(other, this.options);
|
|
446
|
+
}
|
|
447
|
+
let i = 0;
|
|
448
|
+
do {
|
|
449
|
+
const a = this.build[i];
|
|
450
|
+
const b = other.build[i];
|
|
451
|
+
debug("build compare", i, a, b);
|
|
452
|
+
if (a === void 0 && b === void 0) {
|
|
453
|
+
return 0;
|
|
454
|
+
} else if (b === void 0) {
|
|
455
|
+
return 1;
|
|
456
|
+
} else if (a === void 0) {
|
|
457
|
+
return -1;
|
|
458
|
+
} else if (a === b) {
|
|
459
|
+
continue;
|
|
460
|
+
} else {
|
|
461
|
+
return compareIdentifiers(a, b);
|
|
462
|
+
}
|
|
463
|
+
} while (++i);
|
|
464
|
+
}
|
|
465
|
+
// preminor will bump the version up to the next minor release, and immediately
|
|
466
|
+
// down to pre-release. premajor and prepatch work the same way.
|
|
467
|
+
inc(release, identifier, identifierBase) {
|
|
468
|
+
if (release.startsWith("pre")) {
|
|
469
|
+
if (!identifier && identifierBase === false) {
|
|
470
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
471
|
+
}
|
|
472
|
+
if (identifier) {
|
|
473
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
474
|
+
if (!match || match[1] !== identifier) {
|
|
475
|
+
throw new Error(`invalid identifier: ${identifier}`);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
switch (release) {
|
|
480
|
+
case "premajor":
|
|
481
|
+
this.prerelease.length = 0;
|
|
482
|
+
this.patch = 0;
|
|
483
|
+
this.minor = 0;
|
|
484
|
+
this.major++;
|
|
485
|
+
this.inc("pre", identifier, identifierBase);
|
|
486
|
+
break;
|
|
487
|
+
case "preminor":
|
|
488
|
+
this.prerelease.length = 0;
|
|
489
|
+
this.patch = 0;
|
|
490
|
+
this.minor++;
|
|
491
|
+
this.inc("pre", identifier, identifierBase);
|
|
492
|
+
break;
|
|
493
|
+
case "prepatch":
|
|
494
|
+
this.prerelease.length = 0;
|
|
495
|
+
this.inc("patch", identifier, identifierBase);
|
|
496
|
+
this.inc("pre", identifier, identifierBase);
|
|
497
|
+
break;
|
|
498
|
+
// If the input is a non-prerelease version, this acts the same as
|
|
499
|
+
// prepatch.
|
|
500
|
+
case "prerelease":
|
|
501
|
+
if (this.prerelease.length === 0) {
|
|
502
|
+
this.inc("patch", identifier, identifierBase);
|
|
503
|
+
}
|
|
504
|
+
this.inc("pre", identifier, identifierBase);
|
|
505
|
+
break;
|
|
506
|
+
case "release":
|
|
507
|
+
if (this.prerelease.length === 0) {
|
|
508
|
+
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
509
|
+
}
|
|
510
|
+
this.prerelease.length = 0;
|
|
511
|
+
break;
|
|
512
|
+
case "major":
|
|
513
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
514
|
+
this.major++;
|
|
515
|
+
}
|
|
516
|
+
this.minor = 0;
|
|
517
|
+
this.patch = 0;
|
|
518
|
+
this.prerelease = [];
|
|
519
|
+
break;
|
|
520
|
+
case "minor":
|
|
521
|
+
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
522
|
+
this.minor++;
|
|
523
|
+
}
|
|
524
|
+
this.patch = 0;
|
|
525
|
+
this.prerelease = [];
|
|
526
|
+
break;
|
|
527
|
+
case "patch":
|
|
528
|
+
if (this.prerelease.length === 0) {
|
|
529
|
+
this.patch++;
|
|
530
|
+
}
|
|
531
|
+
this.prerelease = [];
|
|
532
|
+
break;
|
|
533
|
+
// This probably shouldn't be used publicly.
|
|
534
|
+
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
535
|
+
case "pre": {
|
|
536
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
537
|
+
if (this.prerelease.length === 0) {
|
|
538
|
+
this.prerelease = [base];
|
|
539
|
+
} else {
|
|
540
|
+
let i = this.prerelease.length;
|
|
541
|
+
while (--i >= 0) {
|
|
542
|
+
if (typeof this.prerelease[i] === "number") {
|
|
543
|
+
this.prerelease[i]++;
|
|
544
|
+
i = -2;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
if (i === -1) {
|
|
548
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
549
|
+
throw new Error("invalid increment argument: identifier already exists");
|
|
550
|
+
}
|
|
551
|
+
this.prerelease.push(base);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
if (identifier) {
|
|
555
|
+
let prerelease = [identifier, base];
|
|
556
|
+
if (identifierBase === false) {
|
|
557
|
+
prerelease = [identifier];
|
|
558
|
+
}
|
|
559
|
+
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
560
|
+
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
561
|
+
if (isNaN(prereleaseBase)) {
|
|
562
|
+
this.prerelease = prerelease;
|
|
563
|
+
}
|
|
564
|
+
} else {
|
|
565
|
+
this.prerelease = prerelease;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
default:
|
|
571
|
+
throw new Error(`invalid increment argument: ${release}`);
|
|
572
|
+
}
|
|
573
|
+
this.raw = this.format();
|
|
574
|
+
if (this.build.length) {
|
|
575
|
+
this.raw += `+${this.build.join(".")}`;
|
|
576
|
+
}
|
|
577
|
+
return this;
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
module.exports = SemVer;
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
// node_modules/semver/functions/compare.js
|
|
585
|
+
var require_compare = __commonJS({
|
|
586
|
+
"node_modules/semver/functions/compare.js"(exports, module) {
|
|
587
|
+
"use strict";
|
|
588
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
589
|
+
var SemVer = require_semver();
|
|
590
|
+
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
591
|
+
module.exports = compare;
|
|
592
|
+
}
|
|
593
|
+
});
|
|
68
594
|
|
|
69
595
|
// src/service/platform/panel/host-context.ts
|
|
596
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
70
597
|
import { realpath } from "node:fs/promises";
|
|
71
598
|
import { isAbsolute } from "node:path";
|
|
72
599
|
import { fileURLToPath } from "node:url";
|
|
@@ -124,6 +651,7 @@ async function hostProjectCandidate(c, directory) {
|
|
|
124
651
|
}
|
|
125
652
|
|
|
126
653
|
// src/service/platform/server/product-glyph.ts
|
|
654
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
127
655
|
var glyphs = [
|
|
128
656
|
{ theme: "light", file: "brand-glyph-black.svg" },
|
|
129
657
|
{ theme: "dark", file: "brand-glyph-white.svg" }
|
|
@@ -135,7 +663,29 @@ var productGlyphIcons = glyphs.map(({ theme, file }) => ({
|
|
|
135
663
|
theme
|
|
136
664
|
}));
|
|
137
665
|
|
|
666
|
+
// src/service/platform/panel/panel.ts
|
|
667
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
668
|
+
|
|
669
|
+
// node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.js
|
|
670
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
671
|
+
|
|
672
|
+
// node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
673
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
674
|
+
|
|
675
|
+
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
676
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
677
|
+
|
|
678
|
+
// node_modules/zod/v3/errors.js
|
|
679
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
680
|
+
|
|
681
|
+
// node_modules/zod/v3/locales/en.js
|
|
682
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
683
|
+
|
|
684
|
+
// node_modules/zod/v3/ZodError.js
|
|
685
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
686
|
+
|
|
138
687
|
// node_modules/zod/v3/helpers/util.js
|
|
688
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
139
689
|
var util;
|
|
140
690
|
(function(util2) {
|
|
141
691
|
util2.assertEqual = (_2) => {
|
|
@@ -508,6 +1058,7 @@ function getErrorMap() {
|
|
|
508
1058
|
}
|
|
509
1059
|
|
|
510
1060
|
// node_modules/zod/v3/helpers/parseUtil.js
|
|
1061
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
511
1062
|
var makeIssue = (params) => {
|
|
512
1063
|
const { data, path, errorMaps, issueData } = params;
|
|
513
1064
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -616,7 +1167,11 @@ var isDirty = (x) => x.status === "dirty";
|
|
|
616
1167
|
var isValid = (x) => x.status === "valid";
|
|
617
1168
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
618
1169
|
|
|
1170
|
+
// node_modules/zod/v3/types.js
|
|
1171
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
1172
|
+
|
|
619
1173
|
// node_modules/zod/v3/helpers/errorUtil.js
|
|
1174
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
620
1175
|
var errorUtil;
|
|
621
1176
|
(function(errorUtil2) {
|
|
622
1177
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
@@ -1396,48 +1951,48 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1396
1951
|
...errorUtil.errToObj(message)
|
|
1397
1952
|
});
|
|
1398
1953
|
}
|
|
1399
|
-
jwt(
|
|
1400
|
-
return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(
|
|
1954
|
+
jwt(options2) {
|
|
1955
|
+
return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options2) });
|
|
1401
1956
|
}
|
|
1402
|
-
ip(
|
|
1403
|
-
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(
|
|
1957
|
+
ip(options2) {
|
|
1958
|
+
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options2) });
|
|
1404
1959
|
}
|
|
1405
|
-
cidr(
|
|
1406
|
-
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(
|
|
1960
|
+
cidr(options2) {
|
|
1961
|
+
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options2) });
|
|
1407
1962
|
}
|
|
1408
|
-
datetime(
|
|
1409
|
-
if (typeof
|
|
1963
|
+
datetime(options2) {
|
|
1964
|
+
if (typeof options2 === "string") {
|
|
1410
1965
|
return this._addCheck({
|
|
1411
1966
|
kind: "datetime",
|
|
1412
1967
|
precision: null,
|
|
1413
1968
|
offset: false,
|
|
1414
1969
|
local: false,
|
|
1415
|
-
message:
|
|
1970
|
+
message: options2
|
|
1416
1971
|
});
|
|
1417
1972
|
}
|
|
1418
1973
|
return this._addCheck({
|
|
1419
1974
|
kind: "datetime",
|
|
1420
|
-
precision: typeof
|
|
1421
|
-
offset:
|
|
1422
|
-
local:
|
|
1423
|
-
...errorUtil.errToObj(
|
|
1975
|
+
precision: typeof options2?.precision === "undefined" ? null : options2?.precision,
|
|
1976
|
+
offset: options2?.offset ?? false,
|
|
1977
|
+
local: options2?.local ?? false,
|
|
1978
|
+
...errorUtil.errToObj(options2?.message)
|
|
1424
1979
|
});
|
|
1425
1980
|
}
|
|
1426
1981
|
date(message) {
|
|
1427
1982
|
return this._addCheck({ kind: "date", message });
|
|
1428
1983
|
}
|
|
1429
|
-
time(
|
|
1430
|
-
if (typeof
|
|
1984
|
+
time(options2) {
|
|
1985
|
+
if (typeof options2 === "string") {
|
|
1431
1986
|
return this._addCheck({
|
|
1432
1987
|
kind: "time",
|
|
1433
1988
|
precision: null,
|
|
1434
|
-
message:
|
|
1989
|
+
message: options2
|
|
1435
1990
|
});
|
|
1436
1991
|
}
|
|
1437
1992
|
return this._addCheck({
|
|
1438
1993
|
kind: "time",
|
|
1439
|
-
precision: typeof
|
|
1440
|
-
...errorUtil.errToObj(
|
|
1994
|
+
precision: typeof options2?.precision === "undefined" ? null : options2?.precision,
|
|
1995
|
+
...errorUtil.errToObj(options2?.message)
|
|
1441
1996
|
});
|
|
1442
1997
|
}
|
|
1443
1998
|
duration(message) {
|
|
@@ -1450,12 +2005,12 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1450
2005
|
...errorUtil.errToObj(message)
|
|
1451
2006
|
});
|
|
1452
2007
|
}
|
|
1453
|
-
includes(value,
|
|
2008
|
+
includes(value, options2) {
|
|
1454
2009
|
return this._addCheck({
|
|
1455
2010
|
kind: "includes",
|
|
1456
2011
|
value,
|
|
1457
|
-
position:
|
|
1458
|
-
...errorUtil.errToObj(
|
|
2012
|
+
position: options2?.position,
|
|
2013
|
+
...errorUtil.errToObj(options2?.message)
|
|
1459
2014
|
});
|
|
1460
2015
|
}
|
|
1461
2016
|
startsWith(value, message) {
|
|
@@ -2739,7 +3294,7 @@ ZodObject.lazycreate = (shape, params) => {
|
|
|
2739
3294
|
var ZodUnion = class extends ZodType {
|
|
2740
3295
|
_parse(input) {
|
|
2741
3296
|
const { ctx } = this._processInputParams(input);
|
|
2742
|
-
const
|
|
3297
|
+
const options2 = this._def.options;
|
|
2743
3298
|
function handleResults(results) {
|
|
2744
3299
|
for (const result of results) {
|
|
2745
3300
|
if (result.result.status === "valid") {
|
|
@@ -2760,7 +3315,7 @@ var ZodUnion = class extends ZodType {
|
|
|
2760
3315
|
return INVALID;
|
|
2761
3316
|
}
|
|
2762
3317
|
if (ctx.common.async) {
|
|
2763
|
-
return Promise.all(
|
|
3318
|
+
return Promise.all(options2.map(async (option) => {
|
|
2764
3319
|
const childCtx = {
|
|
2765
3320
|
...ctx,
|
|
2766
3321
|
common: {
|
|
@@ -2781,7 +3336,7 @@ var ZodUnion = class extends ZodType {
|
|
|
2781
3336
|
} else {
|
|
2782
3337
|
let dirty = void 0;
|
|
2783
3338
|
const issues = [];
|
|
2784
|
-
for (const option of
|
|
3339
|
+
for (const option of options2) {
|
|
2785
3340
|
const childCtx = {
|
|
2786
3341
|
...ctx,
|
|
2787
3342
|
common: {
|
|
@@ -2911,9 +3466,9 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
|
|
2911
3466
|
* @param types an array of object schemas
|
|
2912
3467
|
* @param params
|
|
2913
3468
|
*/
|
|
2914
|
-
static create(discriminator,
|
|
3469
|
+
static create(discriminator, options2, params) {
|
|
2915
3470
|
const optionsMap = /* @__PURE__ */ new Map();
|
|
2916
|
-
for (const type of
|
|
3471
|
+
for (const type of options2) {
|
|
2917
3472
|
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
2918
3473
|
if (!discriminatorValues.length) {
|
|
2919
3474
|
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
@@ -2928,7 +3483,7 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
|
|
2928
3483
|
return new _ZodDiscriminatedUnion({
|
|
2929
3484
|
typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
|
|
2930
3485
|
discriminator,
|
|
2931
|
-
options:
|
|
3486
|
+
options: options2,
|
|
2932
3487
|
optionsMap,
|
|
2933
3488
|
...processCreateParams(params)
|
|
2934
3489
|
});
|
|
@@ -4030,7 +4585,14 @@ var nullableType = ZodNullable.create;
|
|
|
4030
4585
|
var preprocessType = ZodEffects.createWithPreprocess;
|
|
4031
4586
|
var pipelineType = ZodPipeline.create;
|
|
4032
4587
|
|
|
4588
|
+
// node_modules/zod/v4/mini/external.js
|
|
4589
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
4590
|
+
|
|
4591
|
+
// node_modules/zod/v4/mini/parse.js
|
|
4592
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
4593
|
+
|
|
4033
4594
|
// node_modules/zod/v4/mini/schemas.js
|
|
4595
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
4034
4596
|
var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
4035
4597
|
if (!inst._zod)
|
|
4036
4598
|
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
@@ -4257,6 +4819,7 @@ function getLiteralValue(schema) {
|
|
|
4257
4819
|
}
|
|
4258
4820
|
|
|
4259
4821
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
4822
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
4260
4823
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
4261
4824
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
4262
4825
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
@@ -5788,11 +6351,19 @@ var UrlElicitationRequiredError = class extends McpError {
|
|
|
5788
6351
|
};
|
|
5789
6352
|
|
|
5790
6353
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
6354
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
5791
6355
|
function isTerminal(status) {
|
|
5792
6356
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
5793
6357
|
}
|
|
5794
6358
|
|
|
6359
|
+
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
6360
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6361
|
+
|
|
6362
|
+
// node_modules/zod-to-json-schema/dist/esm/index.js
|
|
6363
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6364
|
+
|
|
5795
6365
|
// node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
6366
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
5796
6367
|
var ignoreOverride = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
5797
6368
|
var defaultOptions = {
|
|
5798
6369
|
name: void 0,
|
|
@@ -5818,17 +6389,18 @@ var defaultOptions = {
|
|
|
5818
6389
|
nameStrategy: "ref",
|
|
5819
6390
|
openAiAnyTypeName: "OpenAiAnyType"
|
|
5820
6391
|
};
|
|
5821
|
-
var getDefaultOptions = (
|
|
6392
|
+
var getDefaultOptions = (options2) => typeof options2 === "string" ? {
|
|
5822
6393
|
...defaultOptions,
|
|
5823
|
-
name:
|
|
6394
|
+
name: options2
|
|
5824
6395
|
} : {
|
|
5825
6396
|
...defaultOptions,
|
|
5826
|
-
...
|
|
6397
|
+
...options2
|
|
5827
6398
|
};
|
|
5828
6399
|
|
|
5829
6400
|
// node_modules/zod-to-json-schema/dist/esm/Refs.js
|
|
5830
|
-
|
|
5831
|
-
|
|
6401
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6402
|
+
var getRefs = (options2) => {
|
|
6403
|
+
const _options = getDefaultOptions(options2);
|
|
5832
6404
|
const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
|
|
5833
6405
|
return {
|
|
5834
6406
|
..._options,
|
|
@@ -5848,6 +6420,7 @@ var getRefs = (options3) => {
|
|
|
5848
6420
|
};
|
|
5849
6421
|
|
|
5850
6422
|
// node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
6423
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
5851
6424
|
function addErrorMessage(res, key, errorMessage, refs) {
|
|
5852
6425
|
if (!refs?.errorMessages)
|
|
5853
6426
|
return;
|
|
@@ -5864,6 +6437,7 @@ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
|
|
|
5864
6437
|
}
|
|
5865
6438
|
|
|
5866
6439
|
// node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
|
|
6440
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
5867
6441
|
var getRelativePath = (pathA, pathB) => {
|
|
5868
6442
|
let i = 0;
|
|
5869
6443
|
for (; i < pathA.length && i < pathB.length; i++) {
|
|
@@ -5873,7 +6447,14 @@ var getRelativePath = (pathA, pathB) => {
|
|
|
5873
6447
|
return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
|
|
5874
6448
|
};
|
|
5875
6449
|
|
|
6450
|
+
// node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
6451
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6452
|
+
|
|
6453
|
+
// node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
6454
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6455
|
+
|
|
5876
6456
|
// node_modules/zod-to-json-schema/dist/esm/parsers/any.js
|
|
6457
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
5877
6458
|
function parseAnyDef(refs) {
|
|
5878
6459
|
if (refs.target !== "openAi") {
|
|
5879
6460
|
return {};
|
|
@@ -5890,6 +6471,7 @@ function parseAnyDef(refs) {
|
|
|
5890
6471
|
}
|
|
5891
6472
|
|
|
5892
6473
|
// node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
6474
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
5893
6475
|
function parseArrayDef(def, refs) {
|
|
5894
6476
|
const res = {
|
|
5895
6477
|
type: "array"
|
|
@@ -5914,6 +6496,7 @@ function parseArrayDef(def, refs) {
|
|
|
5914
6496
|
}
|
|
5915
6497
|
|
|
5916
6498
|
// node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
|
|
6499
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
5917
6500
|
function parseBigintDef(def, refs) {
|
|
5918
6501
|
const res = {
|
|
5919
6502
|
type: "integer",
|
|
@@ -5960,6 +6543,7 @@ function parseBigintDef(def, refs) {
|
|
|
5960
6543
|
}
|
|
5961
6544
|
|
|
5962
6545
|
// node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
|
|
6546
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
5963
6547
|
function parseBooleanDef() {
|
|
5964
6548
|
return {
|
|
5965
6549
|
type: "boolean"
|
|
@@ -5967,16 +6551,19 @@ function parseBooleanDef() {
|
|
|
5967
6551
|
}
|
|
5968
6552
|
|
|
5969
6553
|
// node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
|
|
6554
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
5970
6555
|
function parseBrandedDef(_def, refs) {
|
|
5971
6556
|
return parseDef(_def.type._def, refs);
|
|
5972
6557
|
}
|
|
5973
6558
|
|
|
5974
6559
|
// node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
|
|
6560
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
5975
6561
|
var parseCatchDef = (def, refs) => {
|
|
5976
6562
|
return parseDef(def.innerType._def, refs);
|
|
5977
6563
|
};
|
|
5978
6564
|
|
|
5979
6565
|
// node_modules/zod-to-json-schema/dist/esm/parsers/date.js
|
|
6566
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
5980
6567
|
function parseDateDef(def, refs, overrideDateStrategy) {
|
|
5981
6568
|
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
|
5982
6569
|
if (Array.isArray(strategy)) {
|
|
@@ -6036,6 +6623,7 @@ var integerDateParser = (def, refs) => {
|
|
|
6036
6623
|
};
|
|
6037
6624
|
|
|
6038
6625
|
// node_modules/zod-to-json-schema/dist/esm/parsers/default.js
|
|
6626
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6039
6627
|
function parseDefaultDef(_def, refs) {
|
|
6040
6628
|
return {
|
|
6041
6629
|
...parseDef(_def.innerType._def, refs),
|
|
@@ -6044,11 +6632,13 @@ function parseDefaultDef(_def, refs) {
|
|
|
6044
6632
|
}
|
|
6045
6633
|
|
|
6046
6634
|
// node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
|
|
6635
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6047
6636
|
function parseEffectsDef(_def, refs) {
|
|
6048
6637
|
return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs);
|
|
6049
6638
|
}
|
|
6050
6639
|
|
|
6051
6640
|
// node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
|
|
6641
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6052
6642
|
function parseEnumDef(def) {
|
|
6053
6643
|
return {
|
|
6054
6644
|
type: "string",
|
|
@@ -6057,6 +6647,7 @@ function parseEnumDef(def) {
|
|
|
6057
6647
|
}
|
|
6058
6648
|
|
|
6059
6649
|
// node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
6650
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6060
6651
|
var isJsonSchema7AllOfType = (type) => {
|
|
6061
6652
|
if ("type" in type && type.type === "string")
|
|
6062
6653
|
return false;
|
|
@@ -6099,6 +6690,7 @@ function parseIntersectionDef(def, refs) {
|
|
|
6099
6690
|
}
|
|
6100
6691
|
|
|
6101
6692
|
// node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
|
|
6693
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6102
6694
|
function parseLiteralDef(def, refs) {
|
|
6103
6695
|
const parsedType = typeof def.value;
|
|
6104
6696
|
if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") {
|
|
@@ -6118,7 +6710,14 @@ function parseLiteralDef(def, refs) {
|
|
|
6118
6710
|
};
|
|
6119
6711
|
}
|
|
6120
6712
|
|
|
6713
|
+
// node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
6714
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6715
|
+
|
|
6716
|
+
// node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
6717
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6718
|
+
|
|
6121
6719
|
// node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
6720
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6122
6721
|
var emojiRegex2 = void 0;
|
|
6123
6722
|
var zodPatterns = {
|
|
6124
6723
|
/**
|
|
@@ -6521,6 +7120,7 @@ function parseMapDef(def, refs) {
|
|
|
6521
7120
|
}
|
|
6522
7121
|
|
|
6523
7122
|
// node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
7123
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6524
7124
|
function parseNativeEnumDef(def) {
|
|
6525
7125
|
const object3 = def.values;
|
|
6526
7126
|
const actualKeys = Object.keys(def.values).filter((key) => {
|
|
@@ -6535,6 +7135,7 @@ function parseNativeEnumDef(def) {
|
|
|
6535
7135
|
}
|
|
6536
7136
|
|
|
6537
7137
|
// node_modules/zod-to-json-schema/dist/esm/parsers/never.js
|
|
7138
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6538
7139
|
function parseNeverDef(refs) {
|
|
6539
7140
|
return refs.target === "openAi" ? void 0 : {
|
|
6540
7141
|
not: parseAnyDef({
|
|
@@ -6545,6 +7146,7 @@ function parseNeverDef(refs) {
|
|
|
6545
7146
|
}
|
|
6546
7147
|
|
|
6547
7148
|
// node_modules/zod-to-json-schema/dist/esm/parsers/null.js
|
|
7149
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6548
7150
|
function parseNullDef(refs) {
|
|
6549
7151
|
return refs.target === "openApi3" ? {
|
|
6550
7152
|
enum: ["null"],
|
|
@@ -6554,7 +7156,11 @@ function parseNullDef(refs) {
|
|
|
6554
7156
|
};
|
|
6555
7157
|
}
|
|
6556
7158
|
|
|
7159
|
+
// node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
7160
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
7161
|
+
|
|
6557
7162
|
// node_modules/zod-to-json-schema/dist/esm/parsers/union.js
|
|
7163
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6558
7164
|
var primitiveMappings = {
|
|
6559
7165
|
ZodString: "string",
|
|
6560
7166
|
ZodNumber: "number",
|
|
@@ -6565,17 +7171,17 @@ var primitiveMappings = {
|
|
|
6565
7171
|
function parseUnionDef(def, refs) {
|
|
6566
7172
|
if (refs.target === "openApi3")
|
|
6567
7173
|
return asAnyOf(def, refs);
|
|
6568
|
-
const
|
|
6569
|
-
if (
|
|
6570
|
-
const types =
|
|
7174
|
+
const options2 = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
7175
|
+
if (options2.every((x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length))) {
|
|
7176
|
+
const types = options2.reduce((types2, x) => {
|
|
6571
7177
|
const type = primitiveMappings[x._def.typeName];
|
|
6572
7178
|
return type && !types2.includes(type) ? [...types2, type] : types2;
|
|
6573
7179
|
}, []);
|
|
6574
7180
|
return {
|
|
6575
7181
|
type: types.length > 1 ? types : types[0]
|
|
6576
7182
|
};
|
|
6577
|
-
} else if (
|
|
6578
|
-
const types =
|
|
7183
|
+
} else if (options2.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
|
|
7184
|
+
const types = options2.reduce((acc, x) => {
|
|
6579
7185
|
const type = typeof x._def.value;
|
|
6580
7186
|
switch (type) {
|
|
6581
7187
|
case "string":
|
|
@@ -6594,19 +7200,19 @@ function parseUnionDef(def, refs) {
|
|
|
6594
7200
|
return acc;
|
|
6595
7201
|
}
|
|
6596
7202
|
}, []);
|
|
6597
|
-
if (types.length ===
|
|
7203
|
+
if (types.length === options2.length) {
|
|
6598
7204
|
const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);
|
|
6599
7205
|
return {
|
|
6600
7206
|
type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
|
|
6601
|
-
enum:
|
|
7207
|
+
enum: options2.reduce((acc, x) => {
|
|
6602
7208
|
return acc.includes(x._def.value) ? acc : [...acc, x._def.value];
|
|
6603
7209
|
}, [])
|
|
6604
7210
|
};
|
|
6605
7211
|
}
|
|
6606
|
-
} else if (
|
|
7212
|
+
} else if (options2.every((x) => x._def.typeName === "ZodEnum")) {
|
|
6607
7213
|
return {
|
|
6608
7214
|
type: "string",
|
|
6609
|
-
enum:
|
|
7215
|
+
enum: options2.reduce((acc, x) => [
|
|
6610
7216
|
...acc,
|
|
6611
7217
|
...x._def.values.filter((x2) => !acc.includes(x2))
|
|
6612
7218
|
], [])
|
|
@@ -6655,6 +7261,7 @@ function parseNullableDef(def, refs) {
|
|
|
6655
7261
|
}
|
|
6656
7262
|
|
|
6657
7263
|
// node_modules/zod-to-json-schema/dist/esm/parsers/number.js
|
|
7264
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6658
7265
|
function parseNumberDef(def, refs) {
|
|
6659
7266
|
const res = {
|
|
6660
7267
|
type: "number"
|
|
@@ -6704,6 +7311,7 @@ function parseNumberDef(def, refs) {
|
|
|
6704
7311
|
}
|
|
6705
7312
|
|
|
6706
7313
|
// node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
7314
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6707
7315
|
function parseObjectDef(def, refs) {
|
|
6708
7316
|
const forceOptionalIntoNullable = refs.target === "openAi";
|
|
6709
7317
|
const result = {
|
|
@@ -6774,6 +7382,7 @@ function safeIsOptional(schema) {
|
|
|
6774
7382
|
}
|
|
6775
7383
|
|
|
6776
7384
|
// node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
7385
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6777
7386
|
var parseOptionalDef = (def, refs) => {
|
|
6778
7387
|
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
|
|
6779
7388
|
return parseDef(def.innerType._def, refs);
|
|
@@ -6793,6 +7402,7 @@ var parseOptionalDef = (def, refs) => {
|
|
|
6793
7402
|
};
|
|
6794
7403
|
|
|
6795
7404
|
// node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
|
|
7405
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6796
7406
|
var parsePipelineDef = (def, refs) => {
|
|
6797
7407
|
if (refs.pipeStrategy === "input") {
|
|
6798
7408
|
return parseDef(def.in._def, refs);
|
|
@@ -6813,11 +7423,13 @@ var parsePipelineDef = (def, refs) => {
|
|
|
6813
7423
|
};
|
|
6814
7424
|
|
|
6815
7425
|
// node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
|
|
7426
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6816
7427
|
function parsePromiseDef(def, refs) {
|
|
6817
7428
|
return parseDef(def.type._def, refs);
|
|
6818
7429
|
}
|
|
6819
7430
|
|
|
6820
7431
|
// node_modules/zod-to-json-schema/dist/esm/parsers/set.js
|
|
7432
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6821
7433
|
function parseSetDef(def, refs) {
|
|
6822
7434
|
const items = parseDef(def.valueType._def, {
|
|
6823
7435
|
...refs,
|
|
@@ -6838,6 +7450,7 @@ function parseSetDef(def, refs) {
|
|
|
6838
7450
|
}
|
|
6839
7451
|
|
|
6840
7452
|
// node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
|
|
7453
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6841
7454
|
function parseTupleDef(def, refs) {
|
|
6842
7455
|
if (def.rest) {
|
|
6843
7456
|
return {
|
|
@@ -6866,6 +7479,7 @@ function parseTupleDef(def, refs) {
|
|
|
6866
7479
|
}
|
|
6867
7480
|
|
|
6868
7481
|
// node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
|
|
7482
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6869
7483
|
function parseUndefinedDef(refs) {
|
|
6870
7484
|
return {
|
|
6871
7485
|
not: parseAnyDef(refs)
|
|
@@ -6873,11 +7487,13 @@ function parseUndefinedDef(refs) {
|
|
|
6873
7487
|
}
|
|
6874
7488
|
|
|
6875
7489
|
// node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
|
|
7490
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6876
7491
|
function parseUnknownDef(refs) {
|
|
6877
7492
|
return parseAnyDef(refs);
|
|
6878
7493
|
}
|
|
6879
7494
|
|
|
6880
7495
|
// node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
|
|
7496
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
6881
7497
|
var parseReadonlyDef = (def, refs) => {
|
|
6882
7498
|
return parseDef(def.innerType._def, refs);
|
|
6883
7499
|
};
|
|
@@ -7014,22 +7630,26 @@ var addMeta = (def, refs, jsonSchema) => {
|
|
|
7014
7630
|
return jsonSchema;
|
|
7015
7631
|
};
|
|
7016
7632
|
|
|
7633
|
+
// node_modules/zod-to-json-schema/dist/esm/parseTypes.js
|
|
7634
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
7635
|
+
|
|
7017
7636
|
// node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7637
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
7638
|
+
var zodToJsonSchema = (schema, options2) => {
|
|
7639
|
+
const refs = getRefs(options2);
|
|
7640
|
+
let definitions2 = typeof options2 === "object" && options2.definitions ? Object.entries(options2.definitions).reduce((acc, [name2, schema2]) => ({
|
|
7021
7641
|
...acc,
|
|
7022
7642
|
[name2]: parseDef(schema2._def, {
|
|
7023
7643
|
...refs,
|
|
7024
7644
|
currentPath: [...refs.basePath, refs.definitionPath, name2]
|
|
7025
7645
|
}, true) ?? parseAnyDef(refs)
|
|
7026
7646
|
}), {}) : void 0;
|
|
7027
|
-
const name = typeof
|
|
7647
|
+
const name = typeof options2 === "string" ? options2 : options2?.nameStrategy === "title" ? void 0 : options2?.name;
|
|
7028
7648
|
const main = parseDef(schema._def, name === void 0 ? refs : {
|
|
7029
7649
|
...refs,
|
|
7030
7650
|
currentPath: [...refs.basePath, refs.definitionPath, name]
|
|
7031
7651
|
}, false) ?? parseAnyDef(refs);
|
|
7032
|
-
const title = typeof
|
|
7652
|
+
const title = typeof options2 === "object" && options2.name !== void 0 && options2.nameStrategy === "title" ? options2.name : void 0;
|
|
7033
7653
|
if (title !== void 0) {
|
|
7034
7654
|
main.title = title;
|
|
7035
7655
|
}
|
|
@@ -7415,11 +8035,11 @@ var Protocol = class {
|
|
|
7415
8035
|
}
|
|
7416
8036
|
await this.notification(notification, notificationOptions);
|
|
7417
8037
|
},
|
|
7418
|
-
sendRequest: async (r2, resultSchema,
|
|
8038
|
+
sendRequest: async (r2, resultSchema, options2) => {
|
|
7419
8039
|
if (abortController.signal.aborted) {
|
|
7420
8040
|
throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
|
|
7421
8041
|
}
|
|
7422
|
-
const requestOptions = { ...
|
|
8042
|
+
const requestOptions = { ...options2, relatedRequestId: request.id };
|
|
7423
8043
|
if (relatedTaskId && !requestOptions.relatedTask) {
|
|
7424
8044
|
requestOptions.relatedTask = { taskId: relatedTaskId };
|
|
7425
8045
|
}
|
|
@@ -7591,11 +8211,11 @@ var Protocol = class {
|
|
|
7591
8211
|
*
|
|
7592
8212
|
* @experimental Use `client.experimental.tasks.requestStream()` to access this method.
|
|
7593
8213
|
*/
|
|
7594
|
-
async *requestStream(request, resultSchema,
|
|
7595
|
-
const { task } =
|
|
8214
|
+
async *requestStream(request, resultSchema, options2) {
|
|
8215
|
+
const { task } = options2 ?? {};
|
|
7596
8216
|
if (!task) {
|
|
7597
8217
|
try {
|
|
7598
|
-
const result = await this.request(request, resultSchema,
|
|
8218
|
+
const result = await this.request(request, resultSchema, options2);
|
|
7599
8219
|
yield { type: "result", result };
|
|
7600
8220
|
} catch (error) {
|
|
7601
8221
|
yield {
|
|
@@ -7607,7 +8227,7 @@ var Protocol = class {
|
|
|
7607
8227
|
}
|
|
7608
8228
|
let taskId2;
|
|
7609
8229
|
try {
|
|
7610
|
-
const createResult = await this.request(request, CreateTaskResultSchema,
|
|
8230
|
+
const createResult = await this.request(request, CreateTaskResultSchema, options2);
|
|
7611
8231
|
if (createResult.task) {
|
|
7612
8232
|
taskId2 = createResult.task.taskId;
|
|
7613
8233
|
yield { type: "taskCreated", task: createResult.task };
|
|
@@ -7615,11 +8235,11 @@ var Protocol = class {
|
|
|
7615
8235
|
throw new McpError(ErrorCode.InternalError, "Task creation did not return a task");
|
|
7616
8236
|
}
|
|
7617
8237
|
while (true) {
|
|
7618
|
-
const task2 = await this.getTask({ taskId: taskId2 },
|
|
8238
|
+
const task2 = await this.getTask({ taskId: taskId2 }, options2);
|
|
7619
8239
|
yield { type: "taskStatus", task: task2 };
|
|
7620
8240
|
if (isTerminal(task2.status)) {
|
|
7621
8241
|
if (task2.status === "completed") {
|
|
7622
|
-
const result = await this.getTaskResult({ taskId: taskId2 }, resultSchema,
|
|
8242
|
+
const result = await this.getTaskResult({ taskId: taskId2 }, resultSchema, options2);
|
|
7623
8243
|
yield { type: "result", result };
|
|
7624
8244
|
} else if (task2.status === "failed") {
|
|
7625
8245
|
yield {
|
|
@@ -7635,13 +8255,13 @@ var Protocol = class {
|
|
|
7635
8255
|
return;
|
|
7636
8256
|
}
|
|
7637
8257
|
if (task2.status === "input_required") {
|
|
7638
|
-
const result = await this.getTaskResult({ taskId: taskId2 }, resultSchema,
|
|
8258
|
+
const result = await this.getTaskResult({ taskId: taskId2 }, resultSchema, options2);
|
|
7639
8259
|
yield { type: "result", result };
|
|
7640
8260
|
return;
|
|
7641
8261
|
}
|
|
7642
8262
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
|
|
7643
|
-
await new Promise((
|
|
7644
|
-
|
|
8263
|
+
await new Promise((resolve3) => setTimeout(resolve3, pollInterval));
|
|
8264
|
+
options2?.signal?.throwIfAborted();
|
|
7645
8265
|
}
|
|
7646
8266
|
} catch (error) {
|
|
7647
8267
|
yield {
|
|
@@ -7655,9 +8275,9 @@ var Protocol = class {
|
|
|
7655
8275
|
*
|
|
7656
8276
|
* Do not use this method to emit notifications! Use notification() instead.
|
|
7657
8277
|
*/
|
|
7658
|
-
request(request, resultSchema,
|
|
7659
|
-
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } =
|
|
7660
|
-
return new Promise((
|
|
8278
|
+
request(request, resultSchema, options2) {
|
|
8279
|
+
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options2 ?? {};
|
|
8280
|
+
return new Promise((resolve3, reject) => {
|
|
7661
8281
|
const earlyReject = (error) => {
|
|
7662
8282
|
reject(error);
|
|
7663
8283
|
};
|
|
@@ -7676,15 +8296,15 @@ var Protocol = class {
|
|
|
7676
8296
|
return;
|
|
7677
8297
|
}
|
|
7678
8298
|
}
|
|
7679
|
-
|
|
8299
|
+
options2?.signal?.throwIfAborted();
|
|
7680
8300
|
const messageId = this._requestMessageId++;
|
|
7681
8301
|
const jsonrpcRequest = {
|
|
7682
8302
|
...request,
|
|
7683
8303
|
jsonrpc: "2.0",
|
|
7684
8304
|
id: messageId
|
|
7685
8305
|
};
|
|
7686
|
-
if (
|
|
7687
|
-
this._progressHandlers.set(messageId,
|
|
8306
|
+
if (options2?.onprogress) {
|
|
8307
|
+
this._progressHandlers.set(messageId, options2.onprogress);
|
|
7688
8308
|
jsonrpcRequest.params = {
|
|
7689
8309
|
...request.params,
|
|
7690
8310
|
_meta: {
|
|
@@ -7724,7 +8344,7 @@ var Protocol = class {
|
|
|
7724
8344
|
reject(error);
|
|
7725
8345
|
};
|
|
7726
8346
|
this._responseHandlers.set(messageId, (response) => {
|
|
7727
|
-
if (
|
|
8347
|
+
if (options2?.signal?.aborted) {
|
|
7728
8348
|
return;
|
|
7729
8349
|
}
|
|
7730
8350
|
if (response instanceof Error) {
|
|
@@ -7735,18 +8355,18 @@ var Protocol = class {
|
|
|
7735
8355
|
if (!parseResult.success) {
|
|
7736
8356
|
reject(parseResult.error);
|
|
7737
8357
|
} else {
|
|
7738
|
-
|
|
8358
|
+
resolve3(parseResult.data);
|
|
7739
8359
|
}
|
|
7740
8360
|
} catch (error) {
|
|
7741
8361
|
reject(error);
|
|
7742
8362
|
}
|
|
7743
8363
|
});
|
|
7744
|
-
|
|
7745
|
-
cancel(
|
|
8364
|
+
options2?.signal?.addEventListener("abort", () => {
|
|
8365
|
+
cancel(options2?.signal?.reason);
|
|
7746
8366
|
});
|
|
7747
|
-
const timeout =
|
|
8367
|
+
const timeout = options2?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC;
|
|
7748
8368
|
const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, "Request timed out", { timeout }));
|
|
7749
|
-
this._setupTimeout(messageId, timeout,
|
|
8369
|
+
this._setupTimeout(messageId, timeout, options2?.maxTotalTimeout, timeoutHandler, options2?.resetTimeoutOnProgress ?? false);
|
|
7750
8370
|
const relatedTaskId = relatedTask?.taskId;
|
|
7751
8371
|
if (relatedTaskId) {
|
|
7752
8372
|
const responseResolver = (response) => {
|
|
@@ -7779,42 +8399,42 @@ var Protocol = class {
|
|
|
7779
8399
|
*
|
|
7780
8400
|
* @experimental Use `client.experimental.tasks.getTask()` to access this method.
|
|
7781
8401
|
*/
|
|
7782
|
-
async getTask(params,
|
|
7783
|
-
return this.request({ method: "tasks/get", params }, GetTaskResultSchema,
|
|
8402
|
+
async getTask(params, options2) {
|
|
8403
|
+
return this.request({ method: "tasks/get", params }, GetTaskResultSchema, options2);
|
|
7784
8404
|
}
|
|
7785
8405
|
/**
|
|
7786
8406
|
* Retrieves the result of a completed task.
|
|
7787
8407
|
*
|
|
7788
8408
|
* @experimental Use `client.experimental.tasks.getTaskResult()` to access this method.
|
|
7789
8409
|
*/
|
|
7790
|
-
async getTaskResult(params, resultSchema,
|
|
7791
|
-
return this.request({ method: "tasks/result", params }, resultSchema,
|
|
8410
|
+
async getTaskResult(params, resultSchema, options2) {
|
|
8411
|
+
return this.request({ method: "tasks/result", params }, resultSchema, options2);
|
|
7792
8412
|
}
|
|
7793
8413
|
/**
|
|
7794
8414
|
* Lists tasks, optionally starting from a pagination cursor.
|
|
7795
8415
|
*
|
|
7796
8416
|
* @experimental Use `client.experimental.tasks.listTasks()` to access this method.
|
|
7797
8417
|
*/
|
|
7798
|
-
async listTasks(params,
|
|
7799
|
-
return this.request({ method: "tasks/list", params }, ListTasksResultSchema,
|
|
8418
|
+
async listTasks(params, options2) {
|
|
8419
|
+
return this.request({ method: "tasks/list", params }, ListTasksResultSchema, options2);
|
|
7800
8420
|
}
|
|
7801
8421
|
/**
|
|
7802
8422
|
* Cancels a specific task.
|
|
7803
8423
|
*
|
|
7804
8424
|
* @experimental Use `client.experimental.tasks.cancelTask()` to access this method.
|
|
7805
8425
|
*/
|
|
7806
|
-
async cancelTask(params,
|
|
7807
|
-
return this.request({ method: "tasks/cancel", params }, CancelTaskResultSchema,
|
|
8426
|
+
async cancelTask(params, options2) {
|
|
8427
|
+
return this.request({ method: "tasks/cancel", params }, CancelTaskResultSchema, options2);
|
|
7808
8428
|
}
|
|
7809
8429
|
/**
|
|
7810
8430
|
* Emits a notification, which is a one-way message that does not expect a response.
|
|
7811
8431
|
*/
|
|
7812
|
-
async notification(notification,
|
|
8432
|
+
async notification(notification, options2) {
|
|
7813
8433
|
if (!this._transport) {
|
|
7814
8434
|
throw new Error("Not connected");
|
|
7815
8435
|
}
|
|
7816
8436
|
this.assertNotificationCapability(notification.method);
|
|
7817
|
-
const relatedTaskId =
|
|
8437
|
+
const relatedTaskId = options2?.relatedTask?.taskId;
|
|
7818
8438
|
if (relatedTaskId) {
|
|
7819
8439
|
const jsonrpcNotification2 = {
|
|
7820
8440
|
...notification,
|
|
@@ -7823,7 +8443,7 @@ var Protocol = class {
|
|
|
7823
8443
|
...notification.params,
|
|
7824
8444
|
_meta: {
|
|
7825
8445
|
...notification.params?._meta || {},
|
|
7826
|
-
[RELATED_TASK_META_KEY]:
|
|
8446
|
+
[RELATED_TASK_META_KEY]: options2.relatedTask
|
|
7827
8447
|
}
|
|
7828
8448
|
}
|
|
7829
8449
|
};
|
|
@@ -7835,7 +8455,7 @@ var Protocol = class {
|
|
|
7835
8455
|
return;
|
|
7836
8456
|
}
|
|
7837
8457
|
const debouncedMethods = this._options?.debouncedNotificationMethods ?? [];
|
|
7838
|
-
const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !
|
|
8458
|
+
const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !options2?.relatedRequestId && !options2?.relatedTask;
|
|
7839
8459
|
if (canDebounce) {
|
|
7840
8460
|
if (this._pendingDebouncedNotifications.has(notification.method)) {
|
|
7841
8461
|
return;
|
|
@@ -7850,19 +8470,19 @@ var Protocol = class {
|
|
|
7850
8470
|
...notification,
|
|
7851
8471
|
jsonrpc: "2.0"
|
|
7852
8472
|
};
|
|
7853
|
-
if (
|
|
8473
|
+
if (options2?.relatedTask) {
|
|
7854
8474
|
jsonrpcNotification2 = {
|
|
7855
8475
|
...jsonrpcNotification2,
|
|
7856
8476
|
params: {
|
|
7857
8477
|
...jsonrpcNotification2.params,
|
|
7858
8478
|
_meta: {
|
|
7859
8479
|
...jsonrpcNotification2.params?._meta || {},
|
|
7860
|
-
[RELATED_TASK_META_KEY]:
|
|
8480
|
+
[RELATED_TASK_META_KEY]: options2.relatedTask
|
|
7861
8481
|
}
|
|
7862
8482
|
}
|
|
7863
8483
|
};
|
|
7864
8484
|
}
|
|
7865
|
-
this._transport?.send(jsonrpcNotification2,
|
|
8485
|
+
this._transport?.send(jsonrpcNotification2, options2).catch((error) => this._onerror(error));
|
|
7866
8486
|
});
|
|
7867
8487
|
return;
|
|
7868
8488
|
}
|
|
@@ -7870,19 +8490,19 @@ var Protocol = class {
|
|
|
7870
8490
|
...notification,
|
|
7871
8491
|
jsonrpc: "2.0"
|
|
7872
8492
|
};
|
|
7873
|
-
if (
|
|
8493
|
+
if (options2?.relatedTask) {
|
|
7874
8494
|
jsonrpcNotification = {
|
|
7875
8495
|
...jsonrpcNotification,
|
|
7876
8496
|
params: {
|
|
7877
8497
|
...jsonrpcNotification.params,
|
|
7878
8498
|
_meta: {
|
|
7879
8499
|
...jsonrpcNotification.params?._meta || {},
|
|
7880
|
-
[RELATED_TASK_META_KEY]:
|
|
8500
|
+
[RELATED_TASK_META_KEY]: options2.relatedTask
|
|
7881
8501
|
}
|
|
7882
8502
|
}
|
|
7883
8503
|
};
|
|
7884
8504
|
}
|
|
7885
|
-
await this._transport.send(jsonrpcNotification,
|
|
8505
|
+
await this._transport.send(jsonrpcNotification, options2);
|
|
7886
8506
|
}
|
|
7887
8507
|
/**
|
|
7888
8508
|
* Registers a handler to invoke when this protocol object receives a request with the given method.
|
|
@@ -7997,12 +8617,12 @@ var Protocol = class {
|
|
|
7997
8617
|
}
|
|
7998
8618
|
} catch {
|
|
7999
8619
|
}
|
|
8000
|
-
return new Promise((
|
|
8620
|
+
return new Promise((resolve3, reject) => {
|
|
8001
8621
|
if (signal.aborted) {
|
|
8002
8622
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
8003
8623
|
return;
|
|
8004
8624
|
}
|
|
8005
|
-
const timeoutId = setTimeout(
|
|
8625
|
+
const timeoutId = setTimeout(resolve3, interval);
|
|
8006
8626
|
signal.addEventListener("abort", () => {
|
|
8007
8627
|
clearTimeout(timeoutId);
|
|
8008
8628
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -8180,6 +8800,7 @@ var M = external_exports.object({ protocolVersion: external_exports.string().des
|
|
|
8180
8800
|
var p = "text/html;profile=mcp-app";
|
|
8181
8801
|
|
|
8182
8802
|
// src/shared/panel/panel-contract.generated.ts
|
|
8803
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8183
8804
|
var panelOutputSchema = external_exports.object({
|
|
8184
8805
|
conversation_id: external_exports.string().optional().nullable(),
|
|
8185
8806
|
panel_scope: external_exports.object({
|
|
@@ -8196,22 +8817,30 @@ var panelOutputSchema = external_exports.object({
|
|
|
8196
8817
|
task_id: external_exports.string(),
|
|
8197
8818
|
tab: external_exports.literal("chat")
|
|
8198
8819
|
}).optional(),
|
|
8199
|
-
tasks: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown())).optional()
|
|
8820
|
+
tasks: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown())).optional(),
|
|
8821
|
+
read_completed: external_exports.record(external_exports.string(), external_exports.number()).optional()
|
|
8200
8822
|
});
|
|
8201
8823
|
|
|
8202
|
-
// src/
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8824
|
+
// src/service/platform/panel/panel-context.ts
|
|
8825
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8826
|
+
|
|
8827
|
+
// src/shared/tasks/task-list.ts
|
|
8828
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8829
|
+
|
|
8830
|
+
// src/shared/tasks/activity/activity-status.ts
|
|
8831
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8208
8832
|
|
|
8209
8833
|
// src/shared/providers/activity/presentation.ts
|
|
8834
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8210
8835
|
function activityPresentation(event) {
|
|
8211
8836
|
return event.presentation ?? {};
|
|
8212
8837
|
}
|
|
8213
8838
|
|
|
8839
|
+
// src/shared/tasks/activity/activity-events.ts
|
|
8840
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8841
|
+
|
|
8214
8842
|
// src/shared/providers/activity/content-text.ts
|
|
8843
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8215
8844
|
function contentText(content) {
|
|
8216
8845
|
if (typeof content === "string") return content;
|
|
8217
8846
|
if (!Array.isArray(content)) return void 0;
|
|
@@ -8221,6 +8850,7 @@ function contentText(content) {
|
|
|
8221
8850
|
}
|
|
8222
8851
|
|
|
8223
8852
|
// src/shared/text.ts
|
|
8853
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8224
8854
|
function scalarText(value, fallback = "") {
|
|
8225
8855
|
return typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : fallback;
|
|
8226
8856
|
}
|
|
@@ -8264,6 +8894,8 @@ function serviceSummary(e) {
|
|
|
8264
8894
|
if (turnEnded) {
|
|
8265
8895
|
return `Turn ${turnEnded.turn} ${turnEnded.outcome}`;
|
|
8266
8896
|
}
|
|
8897
|
+
const limited = eventPayload(e, "agent.limited");
|
|
8898
|
+
if (limited) return limited.reason;
|
|
8267
8899
|
const queueChanged = eventPayload(e, "task.queue_changed");
|
|
8268
8900
|
if (queueChanged) {
|
|
8269
8901
|
const count = queueChanged.queue.length;
|
|
@@ -8273,6 +8905,7 @@ function serviceSummary(e) {
|
|
|
8273
8905
|
}
|
|
8274
8906
|
var eventTitles = {
|
|
8275
8907
|
"agent.completed": "Turn completed",
|
|
8908
|
+
"agent.limited": "Session limited",
|
|
8276
8909
|
"agent.reply": "Reply",
|
|
8277
8910
|
"task.completed": "Task completed",
|
|
8278
8911
|
"task.instruction": "Message",
|
|
@@ -8329,7 +8962,7 @@ function failureSummary(event) {
|
|
|
8329
8962
|
const agent = eventPayload(event, "agent.completed");
|
|
8330
8963
|
const textOutput = contentText(tool2?.content ?? opaqueData.content);
|
|
8331
8964
|
return [
|
|
8332
|
-
taskFailure
|
|
8965
|
+
taskFailure ? failureMessage(taskFailure) : void 0,
|
|
8333
8966
|
interrupted?.error,
|
|
8334
8967
|
taskCompleted?.error,
|
|
8335
8968
|
agent?.result,
|
|
@@ -8353,6 +8986,7 @@ function eventRowTitle(e, key, presentationTitle) {
|
|
|
8353
8986
|
}
|
|
8354
8987
|
|
|
8355
8988
|
// src/shared/tasks/activity/activity-timeline.ts
|
|
8989
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8356
8990
|
function onlyThinkingSignals(group) {
|
|
8357
8991
|
return group.events.length > 0 && group.events.every(thinkingSignal);
|
|
8358
8992
|
}
|
|
@@ -8517,7 +9151,7 @@ function groupActivity(events) {
|
|
|
8517
9151
|
eventRowTitle(e, key, presentation.title),
|
|
8518
9152
|
activityFailed(e) ? "failed" : "info"
|
|
8519
9153
|
);
|
|
8520
|
-
group.summary = presentation.summary ?? (activityFailed(e) ? failureSummary(e) : void 0) ?? serviceSummary(e) ?? eventPayload(e, "agent.completed")?.result ?? eventPayload(e, "task.instruction")?.message ??
|
|
9154
|
+
group.summary = presentation.summary ?? (activityFailed(e) ? failureSummary(e) : void 0) ?? serviceSummary(e) ?? eventPayload(e, "agent.completed")?.result ?? eventPayload(e, "task.instruction")?.message ?? (toolCompleted ? contentText(toolCompleted.content) : void 0) ?? string2(
|
|
8521
9155
|
d2.text ?? d2.summary ?? d2.description ?? d2.message ?? d2.error ?? d2.result
|
|
8522
9156
|
) ?? (Array.isArray(d2.errors) ? d2.errors.map(String).join("; ") : void 0);
|
|
8523
9157
|
if (replyText(e) !== void 0 || thinkingSignal(e)) {
|
|
@@ -8639,6 +9273,7 @@ function currentActivityStatus(events, task) {
|
|
|
8639
9273
|
}
|
|
8640
9274
|
|
|
8641
9275
|
// src/shared/tasks/conversation/reply.ts
|
|
9276
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8642
9277
|
var REPLY_EXCERPT_CHARS = 1500;
|
|
8643
9278
|
function replyExcerpt(text, max = REPLY_EXCERPT_CHARS) {
|
|
8644
9279
|
return text.length > max ? `${text.slice(0, max)}\u2026 (truncated)` : text;
|
|
@@ -8657,10 +9292,30 @@ function replyFrom(event) {
|
|
|
8657
9292
|
function readFields(read2) {
|
|
8658
9293
|
return read2?.unread ? { unread: true, read_through: read2.through } : {};
|
|
8659
9294
|
}
|
|
8660
|
-
function
|
|
9295
|
+
function taskSummary(task, reply, archivedAt) {
|
|
9296
|
+
const excerpt = replyFrom(reply);
|
|
9297
|
+
return {
|
|
9298
|
+
id: task.id,
|
|
9299
|
+
title: task.title,
|
|
9300
|
+
status: task.status,
|
|
9301
|
+
repository: task.repository,
|
|
9302
|
+
...task.conversation_id ? { conversation_id: task.conversation_id } : {},
|
|
9303
|
+
worker_profile: task.worker_profile,
|
|
9304
|
+
turn: task.turn,
|
|
9305
|
+
...task.error ? { error: task.error } : {},
|
|
9306
|
+
...task.error_code ? { error_code: task.error_code } : {},
|
|
9307
|
+
...task.pending_input ? { pending_input: task.pending_input.kind } : {},
|
|
9308
|
+
...excerpt ? { reply: excerpt } : {},
|
|
9309
|
+
queued_messages: task.queue.length,
|
|
9310
|
+
...archivedAt ? { archived_at: archivedAt } : {}
|
|
9311
|
+
};
|
|
9312
|
+
}
|
|
9313
|
+
var unsent = { context: void 0 };
|
|
9314
|
+
function panelTask(task, events, reply, draft, read2, archivedAt) {
|
|
8661
9315
|
const excerpt = replyFrom(reply);
|
|
8662
9316
|
return {
|
|
8663
9317
|
...task,
|
|
9318
|
+
...unsent,
|
|
8664
9319
|
...task.status === "running" ? { live_activity: currentActivityStatus(events, task) } : {},
|
|
8665
9320
|
...excerpt ? { reply: excerpt } : {},
|
|
8666
9321
|
...draft ? { draft } : {},
|
|
@@ -8697,7 +9352,7 @@ async function resolvePanelContext(c, owner, args) {
|
|
|
8697
9352
|
throw new Error("Task belongs to a different conversation");
|
|
8698
9353
|
}
|
|
8699
9354
|
const conversationId = args.conversation_id === null ? null : args.conversation_id ?? target?.conversation_id ?? null;
|
|
8700
|
-
const latest = conversationId ? c.store.
|
|
9355
|
+
const latest = conversationId ? c.store.latestInConversation(owner, conversationId) : void 0;
|
|
8701
9356
|
const source = target ?? latest;
|
|
8702
9357
|
let repository = args.repository ?? source?.repository;
|
|
8703
9358
|
if (repository) {
|
|
@@ -8738,19 +9393,45 @@ async function resolvePanelContext(c, owner, args) {
|
|
|
8738
9393
|
} : {}
|
|
8739
9394
|
};
|
|
8740
9395
|
}
|
|
8741
|
-
function
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
...t,
|
|
8747
|
-
...readFields(c.store.readState(t.id)),
|
|
8748
|
-
...archivedAt ? { archived_at: archivedAt } : {}
|
|
8749
|
-
};
|
|
9396
|
+
function panelTaskList(c, owner, filters, includeReadCompleted) {
|
|
9397
|
+
if (includeReadCompleted) return { tasks: panelTasks(c, owner, filters) };
|
|
9398
|
+
const rows = c.store.readCompletedFlags(owner, {
|
|
9399
|
+
...filters,
|
|
9400
|
+
include: void 0
|
|
8750
9401
|
});
|
|
9402
|
+
const listed = new Set(filters.include);
|
|
9403
|
+
if (rows[0]) listed.add(rows[0].id);
|
|
9404
|
+
const counts = {};
|
|
9405
|
+
for (const row2 of rows) {
|
|
9406
|
+
if (!row2.readCompleted) {
|
|
9407
|
+
listed.add(row2.id);
|
|
9408
|
+
} else if (!listed.has(row2.id)) {
|
|
9409
|
+
counts[row2.repository] = (counts[row2.repository] ?? 0) + 1;
|
|
9410
|
+
}
|
|
9411
|
+
}
|
|
9412
|
+
return {
|
|
9413
|
+
tasks: panelTasks(c, owner, { ids: [...listed] }),
|
|
9414
|
+
read_completed: counts
|
|
9415
|
+
};
|
|
9416
|
+
}
|
|
9417
|
+
function panelTasks(c, owner, filters) {
|
|
9418
|
+
const archived = c.archive.times(owner, filters);
|
|
9419
|
+
const replies = c.store.latestEvents(owner, "agent.reply", filters);
|
|
9420
|
+
const reads = c.store.readStates(owner, filters);
|
|
9421
|
+
return c.store.list(owner, filters).map(
|
|
9422
|
+
(t) => panelTask(
|
|
9423
|
+
t,
|
|
9424
|
+
t.status === "running" ? c.store.recentEvents(t.id, owner) : [],
|
|
9425
|
+
replies.get(t.id),
|
|
9426
|
+
c.drafts.get(t.id),
|
|
9427
|
+
reads.get(t.id),
|
|
9428
|
+
archived.get(t.id)
|
|
9429
|
+
)
|
|
9430
|
+
);
|
|
8751
9431
|
}
|
|
8752
9432
|
|
|
8753
9433
|
// src/service/platform/panel/panel-html.ts
|
|
9434
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8754
9435
|
import { readFileSync } from "node:fs";
|
|
8755
9436
|
import { readFile } from "node:fs/promises";
|
|
8756
9437
|
var copies = /* @__PURE__ */ new Map();
|
|
@@ -8811,6 +9492,7 @@ function delegationPanel(htmlPath, initialTasks, context) {
|
|
|
8811
9492
|
},
|
|
8812
9493
|
open: async (args) => {
|
|
8813
9494
|
const resolved = context ? await context(args) : { panel_scope: { conversation_id: args.conversation_id ?? null } };
|
|
9495
|
+
const selected = resolved.panel_selection?.task_id;
|
|
8814
9496
|
return {
|
|
8815
9497
|
content: [
|
|
8816
9498
|
{
|
|
@@ -8821,13 +9503,12 @@ function delegationPanel(htmlPath, initialTasks, context) {
|
|
|
8821
9503
|
structuredContent: {
|
|
8822
9504
|
conversation_id: resolved.panel_scope.conversation_id,
|
|
8823
9505
|
...resolved,
|
|
8824
|
-
...initialTasks ? {
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
} : {}
|
|
9506
|
+
...initialTasks ? initialTasks({
|
|
9507
|
+
conversation: resolved.panel_scope.conversation_id ?? void 0,
|
|
9508
|
+
repository: resolved.panel_scope.repository,
|
|
9509
|
+
archived: "exclude",
|
|
9510
|
+
include: selected ? [selected] : []
|
|
9511
|
+
}) : {}
|
|
8831
9512
|
},
|
|
8832
9513
|
_meta: { conversation_id: resolved.panel_scope.conversation_id }
|
|
8833
9514
|
};
|
|
@@ -8874,6 +9555,7 @@ function delegationPanel(htmlPath, initialTasks, context) {
|
|
|
8874
9555
|
}
|
|
8875
9556
|
|
|
8876
9557
|
// src/service/platform/server/instructions.ts
|
|
9558
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8877
9559
|
var SERVER_INSTRUCTIONS = `Delegate work to background workers.
|
|
8878
9560
|
1. Resolve the repository with get_current_project or list_projects and pass it to start_task as an explicit absolute path. Never guess a path. Tool arguments never grant access. For an unregistered project, follow next_step.
|
|
8879
9561
|
2. Call list_workers. If a provider is not ready, report readiness.message to the user instead of retrying. Use the reviewer profile for review requests.
|
|
@@ -8882,10 +9564,18 @@ var SERVER_INSTRUCTIONS = `Delegate work to background workers.
|
|
|
8882
9564
|
5. A finished task stays open. Continue it with send_message. Reopen its panel with open_subagent_extension_for_codex(task_id), never another start_task.`;
|
|
8883
9565
|
|
|
8884
9566
|
// src/service/platform/server/mentions.ts
|
|
9567
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8885
9568
|
import { mkdir, open } from "node:fs/promises";
|
|
8886
9569
|
import { join, resolve } from "node:path";
|
|
8887
9570
|
|
|
9571
|
+
// node_modules/@openai/mcp-extensions/dist/index.js
|
|
9572
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
9573
|
+
|
|
9574
|
+
// node_modules/@modelcontextprotocol/core/dist/index.mjs
|
|
9575
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
9576
|
+
|
|
8888
9577
|
// node_modules/@modelcontextprotocol/core/dist/schemas-DscsoNZN.mjs
|
|
9578
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
8889
9579
|
var LATEST_PROTOCOL_VERSION2 = "2025-11-25";
|
|
8890
9580
|
var DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26";
|
|
8891
9581
|
var SUPPORTED_PROTOCOL_VERSIONS2 = [
|
|
@@ -9676,6 +10366,7 @@ var ServerResultSchema2 = union([
|
|
|
9676
10366
|
]);
|
|
9677
10367
|
|
|
9678
10368
|
// node_modules/@modelcontextprotocol/core/dist/auth-UMQCo-ad.mjs
|
|
10369
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
9679
10370
|
var SafeUrlSchema = url().superRefine((val, ctx) => {
|
|
9680
10371
|
if (!URL.canParse(val)) {
|
|
9681
10372
|
ctx.addIssue({
|
|
@@ -9830,9 +10521,11 @@ var OAuthTokenRevocationRequestSchema = object({
|
|
|
9830
10521
|
}).strip();
|
|
9831
10522
|
|
|
9832
10523
|
// node_modules/@openai/mcp-extensions/dist/shared/strings.js
|
|
10524
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
9833
10525
|
var NonBlankStringSchema = external_exports.string().regex(/\S/);
|
|
9834
10526
|
|
|
9835
10527
|
// node_modules/@openai/mcp-extensions/dist/shared/mentions.js
|
|
10528
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
9836
10529
|
var OpenAIMentionsCapabilitySchema = external_exports.object({
|
|
9837
10530
|
searchTool: NonBlankStringSchema
|
|
9838
10531
|
});
|
|
@@ -9971,6 +10664,7 @@ async function logMentionSearch(query, workers, resultNames, env) {
|
|
|
9971
10664
|
}
|
|
9972
10665
|
|
|
9973
10666
|
// src/service/features/projects/chat-project.ts
|
|
10667
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
9974
10668
|
import { isAbsolute as isAbsolute2 } from "node:path";
|
|
9975
10669
|
function hostDirectoryFromMeta(meta2) {
|
|
9976
10670
|
const state = meta2?.["codex/sandbox-state-meta"];
|
|
@@ -10034,7 +10728,14 @@ async function currentChatProject(c, owner, meta2) {
|
|
|
10034
10728
|
};
|
|
10035
10729
|
}
|
|
10036
10730
|
|
|
10731
|
+
// src/service/platform/server/tools.ts
|
|
10732
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10733
|
+
|
|
10734
|
+
// src/service/platform/server/tool-logging.ts
|
|
10735
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10736
|
+
|
|
10037
10737
|
// src/shared/tasks/conversation/send-errors.ts
|
|
10738
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10038
10739
|
var SendRejectedError = class extends Error {
|
|
10039
10740
|
name = "SendRejectedError";
|
|
10040
10741
|
};
|
|
@@ -10047,10 +10748,11 @@ var rejectionMessages = /* @__PURE__ */ new Set([
|
|
|
10047
10748
|
"Task not found",
|
|
10048
10749
|
"Repository outside allowed roots (register this repository or approve its parent)",
|
|
10049
10750
|
"Task belongs to a different conversation",
|
|
10050
|
-
"Task belongs to a different repository"
|
|
10751
|
+
"Task belongs to a different repository",
|
|
10752
|
+
WORKTREE_NEEDS_GIT
|
|
10051
10753
|
]);
|
|
10052
10754
|
function rejected(error) {
|
|
10053
|
-
return error instanceof SendRejectedError || error instanceof Error && (error.name === "ZodError" || rejectionMessages.has(error.message));
|
|
10755
|
+
return error instanceof SendRejectedError || error instanceof PolicyRejectedError || error instanceof AttachmentError || error instanceof Error && (error.name === "ZodError" || rejectionMessages.has(error.message));
|
|
10054
10756
|
}
|
|
10055
10757
|
async function observeTool(name, run2, readOnly = false) {
|
|
10056
10758
|
return withLogContext({ tool: name }, async () => {
|
|
@@ -10082,115 +10784,33 @@ async function observeTool(name, run2, readOnly = false) {
|
|
|
10082
10784
|
});
|
|
10083
10785
|
}
|
|
10084
10786
|
|
|
10085
|
-
// src/
|
|
10086
|
-
|
|
10087
|
-
"task.started",
|
|
10088
|
-
"task.instruction",
|
|
10089
|
-
"agent.message",
|
|
10090
|
-
"agent.reply"
|
|
10091
|
-
];
|
|
10092
|
-
function workerMessageId(e) {
|
|
10093
|
-
return eventPayload(e, "agent.message")?.message_id ?? `evt_${e.id}`;
|
|
10094
|
-
}
|
|
10095
|
-
function workerText(e) {
|
|
10096
|
-
const message = eventPayload(e, "agent.message");
|
|
10097
|
-
if (!message || message.parent_tool_use_id) return void 0;
|
|
10098
|
-
return message.text.trim() ? message.text : void 0;
|
|
10099
|
-
}
|
|
10100
|
-
var same = (message, reply) => {
|
|
10101
|
-
const a = message.trim(), b = reply.trim();
|
|
10102
|
-
return a === b || a.endsWith(b);
|
|
10103
|
-
};
|
|
10104
|
-
function queueState(id, pending2, queued) {
|
|
10105
|
-
if (pending2.has(id)) return { state: "pending_steer" };
|
|
10106
|
-
if (queued.has(id)) return { state: "queued" };
|
|
10107
|
-
return {};
|
|
10108
|
-
}
|
|
10109
|
-
function conversation(task, events) {
|
|
10110
|
-
const pending2 = new Set(task.pending_steers.map((m2) => m2.id));
|
|
10111
|
-
const queued = new Set(task.queue.map((m2) => m2.id));
|
|
10112
|
-
let turn = 1;
|
|
10113
|
-
const messages = [
|
|
10114
|
-
{
|
|
10115
|
-
id: "request",
|
|
10116
|
-
event_id: 0,
|
|
10117
|
-
timestamp: task.created_at,
|
|
10118
|
-
turn,
|
|
10119
|
-
from: task.created_by,
|
|
10120
|
-
kind: "request",
|
|
10121
|
-
text: task.description
|
|
10122
|
-
}
|
|
10123
|
-
];
|
|
10124
|
-
for (const e of [...events].sort((a, b) => a.id - b.id)) {
|
|
10125
|
-
const started = eventPayload(e, "task.started");
|
|
10126
|
-
if (started) turn = started.turn;
|
|
10127
|
-
const instruction = eventPayload(e, "task.instruction");
|
|
10128
|
-
if (instruction) {
|
|
10129
|
-
const id = instruction.message_id;
|
|
10130
|
-
messages.push({
|
|
10131
|
-
id,
|
|
10132
|
-
event_id: e.id,
|
|
10133
|
-
timestamp: e.timestamp,
|
|
10134
|
-
turn,
|
|
10135
|
-
from: instruction.from,
|
|
10136
|
-
kind: "message",
|
|
10137
|
-
text: instruction.message,
|
|
10138
|
-
delivery: instruction.delivery,
|
|
10139
|
-
...queueState(id, pending2, queued)
|
|
10140
|
-
});
|
|
10141
|
-
}
|
|
10142
|
-
if (eventPayload(e, "agent.message")) {
|
|
10143
|
-
const text = workerText(e);
|
|
10144
|
-
if (text === void 0) continue;
|
|
10145
|
-
const id = workerMessageId(e);
|
|
10146
|
-
const previous = messages.at(-1);
|
|
10147
|
-
if (previous?.id === id && previous.from === "worker") {
|
|
10148
|
-
previous.text = `${previous.text}
|
|
10149
|
-
|
|
10150
|
-
${text}`;
|
|
10151
|
-
previous.event_id = e.id;
|
|
10152
|
-
continue;
|
|
10153
|
-
}
|
|
10154
|
-
messages.push({
|
|
10155
|
-
id,
|
|
10156
|
-
event_id: e.id,
|
|
10157
|
-
timestamp: e.timestamp,
|
|
10158
|
-
turn,
|
|
10159
|
-
from: "worker",
|
|
10160
|
-
kind: "message",
|
|
10161
|
-
text
|
|
10162
|
-
});
|
|
10163
|
-
}
|
|
10164
|
-
const reply = eventPayload(e, "agent.reply");
|
|
10165
|
-
if (reply) {
|
|
10166
|
-
const text = reply.text;
|
|
10167
|
-
const replyTurn = reply.turn;
|
|
10168
|
-
const last = messages.findLast(
|
|
10169
|
-
(m2) => m2.from === "worker" && m2.turn === replyTurn
|
|
10170
|
-
);
|
|
10171
|
-
if (last && last.kind === "message" && same(last.text, text)) {
|
|
10172
|
-
last.kind = "reply";
|
|
10173
|
-
last.event_id = e.id;
|
|
10174
|
-
continue;
|
|
10175
|
-
}
|
|
10176
|
-
messages.push({
|
|
10177
|
-
id: `reply_${e.id}`,
|
|
10178
|
-
event_id: e.id,
|
|
10179
|
-
timestamp: e.timestamp,
|
|
10180
|
-
turn: replyTurn,
|
|
10181
|
-
from: "worker",
|
|
10182
|
-
kind: "reply",
|
|
10183
|
-
text
|
|
10184
|
-
});
|
|
10185
|
-
}
|
|
10186
|
-
}
|
|
10187
|
-
return messages.sort((a, b) => a.event_id - b.event_id);
|
|
10188
|
-
}
|
|
10787
|
+
// src/service/platform/server/tools/agent-tools.ts
|
|
10788
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10189
10789
|
|
|
10190
10790
|
// src/shared/tasks/conversation/parent-protocol.ts
|
|
10791
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10191
10792
|
var PARENT_SUPERVISION_PROTOCOL = "While delegated work runs, continue your own work and keep polling. A timeout or empty result does not mean the task finished. Handle pending_input, failures and interruptions explicitly. Report success only after reading the final reply. A queued follow-up is still pending work. If you lose the cursor, read again from after: 0.";
|
|
10192
10793
|
|
|
10794
|
+
// src/service/features/settings/settings-tool-schemas.ts
|
|
10795
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10796
|
+
|
|
10797
|
+
// src/shared/settings/settings-document.ts
|
|
10798
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10799
|
+
|
|
10800
|
+
// src/shared/providers/claude/settings-policy.ts
|
|
10801
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10802
|
+
|
|
10803
|
+
// src/shared/settings/settings-schema.ts
|
|
10804
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10805
|
+
|
|
10806
|
+
// src/shared/providers/settings.ts
|
|
10807
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10808
|
+
|
|
10809
|
+
// src/shared/providers/claude/settings.ts
|
|
10810
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10811
|
+
|
|
10193
10812
|
// src/shared/settings/setting-text.ts
|
|
10813
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10194
10814
|
function unwrapped(schema) {
|
|
10195
10815
|
let current = schema;
|
|
10196
10816
|
while (current instanceof external_exports.ZodDefault || current instanceof external_exports.ZodPrefault || current instanceof external_exports.ZodOptional) {
|
|
@@ -10213,6 +10833,7 @@ function settingText(schema) {
|
|
|
10213
10833
|
}
|
|
10214
10834
|
|
|
10215
10835
|
// src/shared/providers/claude/permissions.ts
|
|
10836
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10216
10837
|
var claudePermissionModes = [
|
|
10217
10838
|
"default",
|
|
10218
10839
|
"acceptEdits",
|
|
@@ -10226,38 +10847,12 @@ var permissionModeSchema = external_exports.enum([
|
|
|
10226
10847
|
"inherit",
|
|
10227
10848
|
...claudePermissionModes
|
|
10228
10849
|
]);
|
|
10229
|
-
var claudeSandboxSchema = external_exports.enum([
|
|
10230
|
-
"user_config",
|
|
10231
|
-
"extension",
|
|
10232
|
-
"extension_locked"
|
|
10233
|
-
]);
|
|
10234
|
-
var claudeToolsSchema = external_exports.enum(["profile", "all", "restricted"]);
|
|
10235
|
-
var claudePathGuardSchema = external_exports.enum(["profile", "on", "off"]);
|
|
10236
10850
|
var claudeOverrideDefaults = {
|
|
10237
|
-
sandbox:
|
|
10238
|
-
tools: "profile",
|
|
10239
|
-
path_guard: "profile",
|
|
10851
|
+
sandbox: false,
|
|
10240
10852
|
subagents: true,
|
|
10241
10853
|
settings_files: true,
|
|
10242
10854
|
user_mcp: true
|
|
10243
10855
|
};
|
|
10244
|
-
var claudeOverrideLabels = {
|
|
10245
|
-
sandbox: {
|
|
10246
|
-
user_config: "Your Claude Code settings",
|
|
10247
|
-
extension: "Extension sandbox",
|
|
10248
|
-
extension_locked: "Extension sandbox with locked network"
|
|
10249
|
-
},
|
|
10250
|
-
tools: {
|
|
10251
|
-
profile: "By worker profile",
|
|
10252
|
-
all: "All tools",
|
|
10253
|
-
restricted: "Restricted set"
|
|
10254
|
-
},
|
|
10255
|
-
path_guard: {
|
|
10256
|
-
profile: "By worker profile",
|
|
10257
|
-
on: "On",
|
|
10258
|
-
off: "Off"
|
|
10259
|
-
}
|
|
10260
|
-
};
|
|
10261
10856
|
var permissionLabels = {
|
|
10262
10857
|
inherit: "Use extension setting",
|
|
10263
10858
|
default: "Default \u2014 ask for approval",
|
|
@@ -10267,9 +10862,16 @@ var permissionLabels = {
|
|
|
10267
10862
|
auto: "Auto \u2014 Claude Code decides",
|
|
10268
10863
|
bypassPermissions: "Bypass permission prompts"
|
|
10269
10864
|
};
|
|
10865
|
+
var MODE_TURNED_OFF_BY_ORG = "Turned off by your organization";
|
|
10270
10866
|
function permissionLabel(mode) {
|
|
10271
10867
|
return permissionLabels[mode] ?? mode;
|
|
10272
10868
|
}
|
|
10869
|
+
var permissionModeName = (mode) => shortPermissionLabel(permissionLabel(mode));
|
|
10870
|
+
function shortPermissionLabel(label) {
|
|
10871
|
+
if (label === "Use extension setting") return "Extension setting";
|
|
10872
|
+
const [name = label, detail] = label.split(" \u2014 ");
|
|
10873
|
+
return name === "Default" && detail ? titleCase(detail) : name;
|
|
10874
|
+
}
|
|
10273
10875
|
var permissionRank = {
|
|
10274
10876
|
plan: 0,
|
|
10275
10877
|
dontAsk: 1,
|
|
@@ -10279,10 +10881,13 @@ var permissionRank = {
|
|
|
10279
10881
|
bypassPermissions: 5
|
|
10280
10882
|
};
|
|
10281
10883
|
var readOnlyProfile = (role) => ["researcher", "reviewer", "security_reviewer"].includes(role);
|
|
10282
|
-
function resolveClaudePermission(input, configured) {
|
|
10884
|
+
function resolveClaudePermission(input, configured, workerProfile) {
|
|
10283
10885
|
if (input.permission_mode && input.permission_mode !== "inherit") {
|
|
10284
10886
|
return { mode: input.permission_mode, source: "task" };
|
|
10285
10887
|
}
|
|
10888
|
+
if (readOnlyProfile(workerProfile)) {
|
|
10889
|
+
return { mode: "plan", source: "profile" };
|
|
10890
|
+
}
|
|
10286
10891
|
return { mode: configured, source: "setting" };
|
|
10287
10892
|
}
|
|
10288
10893
|
function exceedsPermission(requested, baseline) {
|
|
@@ -10292,52 +10897,36 @@ function exceedsPermission(requested, baseline) {
|
|
|
10292
10897
|
return requestedRank > baselineRank;
|
|
10293
10898
|
}
|
|
10294
10899
|
var claudePolicySchema = external_exports.object({
|
|
10295
|
-
sandbox:
|
|
10296
|
-
tools: external_exports.enum(["all", "restricted"]),
|
|
10297
|
-
path_guard: external_exports.boolean(),
|
|
10900
|
+
sandbox: external_exports.boolean(),
|
|
10298
10901
|
subagents: external_exports.boolean(),
|
|
10299
10902
|
/** Load the user's, project's and local Claude Code settings. */
|
|
10300
10903
|
settings_files: external_exports.boolean(),
|
|
10301
10904
|
/** Offer MCP servers from the user's Claude Code configuration alongside the extension's own. */
|
|
10302
10905
|
user_mcp: external_exports.boolean()
|
|
10303
10906
|
});
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
return {
|
|
10311
|
-
sandbox: overrides.sandbox,
|
|
10312
|
-
tools: resolveTools(overrides.tools, readOnly),
|
|
10313
|
-
path_guard: overrides.path_guard === "profile" ? readOnly : overrides.path_guard === "on",
|
|
10314
|
-
subagents: overrides.subagents,
|
|
10315
|
-
settings_files: overrides.settings_files,
|
|
10316
|
-
user_mcp: overrides.user_mcp
|
|
10317
|
-
};
|
|
10318
|
-
}
|
|
10907
|
+
var resolveClaudePolicy = (overrides, sandbox = overrides.sandbox) => ({
|
|
10908
|
+
sandbox,
|
|
10909
|
+
subagents: overrides.subagents,
|
|
10910
|
+
settings_files: overrides.settings_files,
|
|
10911
|
+
user_mcp: overrides.user_mcp
|
|
10912
|
+
});
|
|
10319
10913
|
|
|
10320
10914
|
// src/shared/providers/claude/settings.ts
|
|
10321
10915
|
var help = {
|
|
10322
10916
|
permission_mode: "Tasks use this mode unless you choose another. Your other Claude Code settings still apply while Load Claude Code settings is on.",
|
|
10323
|
-
sandbox: "
|
|
10324
|
-
tools: "All tools offers every Claude Code tool. The restricted set offers file, search, Bash, question, skill and MCP tools, and only read, question and skill tools to read-only work. By worker profile restricts only read-only profiles.",
|
|
10325
|
-
path_guard: "Keeps file tools inside the task workspace and out of Git metadata. By worker profile applies it only to read-only profiles.",
|
|
10917
|
+
sandbox: "Runs Bash commands in Claude Code's sandbox, and stops a task when the sandbox can't run. Your Claude Code settings and your organization's policy decide the rest. Off leaves the sandbox to your Claude Code settings. Codex can turn it on for a task, and only you can turn it off.",
|
|
10326
10918
|
subagents: "Delegated sessions may start subagents with the Agent tool.",
|
|
10327
10919
|
settings_files: "Sessions load your user, project and local Claude Code settings, including instructions, skills, hooks, permission rules, sandbox settings and MCP servers. Off ignores all of them, including your deny rules and sandbox.",
|
|
10328
10920
|
user_mcp: "Sessions may use MCP servers from your Claude Code configuration, such as project, user and plugin servers. This also requires Load Claude Code settings. Off leaves only the extension's own server."
|
|
10329
10921
|
};
|
|
10330
10922
|
var userOnly = "Only you can change these settings.";
|
|
10331
|
-
var options = (labels) => Object.entries(labels).map(([value, label]) => ({ value, label }));
|
|
10332
10923
|
var claudeSettingsSchema = external_exports.strictObject({
|
|
10333
10924
|
permission_mode: claudePermissionModeSchema.meta({
|
|
10334
10925
|
title: "Claude permission mode",
|
|
10335
10926
|
description: help.permission_mode
|
|
10336
10927
|
}).default("default"),
|
|
10337
10928
|
// Restriction titles drop "Claude": their settings group already names it.
|
|
10338
|
-
sandbox:
|
|
10339
|
-
tools: claudeToolsSchema.meta({ title: "Tools", description: help.tools }).default(claudeOverrideDefaults.tools),
|
|
10340
|
-
path_guard: claudePathGuardSchema.meta({ title: "Workspace path guard", description: help.path_guard }).default(claudeOverrideDefaults.path_guard),
|
|
10929
|
+
sandbox: external_exports.boolean().meta({ title: "Bash sandbox", description: help.sandbox }).default(claudeOverrideDefaults.sandbox),
|
|
10341
10930
|
subagents: external_exports.boolean().meta({ title: "Allow subagents", description: help.subagents }).default(claudeOverrideDefaults.subagents),
|
|
10342
10931
|
settings_files: external_exports.boolean().meta({
|
|
10343
10932
|
title: "Load Claude Code settings",
|
|
@@ -10367,21 +10956,7 @@ var claudeRestrictionsSection = {
|
|
|
10367
10956
|
`Limits on delegated Claude sessions, in every permission mode. ${userOnly}`
|
|
10368
10957
|
],
|
|
10369
10958
|
rows: [
|
|
10370
|
-
{
|
|
10371
|
-
kind: "select",
|
|
10372
|
-
...row("sandbox"),
|
|
10373
|
-
options: options(claudeOverrideLabels.sandbox)
|
|
10374
|
-
},
|
|
10375
|
-
{
|
|
10376
|
-
kind: "select",
|
|
10377
|
-
...row("tools"),
|
|
10378
|
-
options: options(claudeOverrideLabels.tools)
|
|
10379
|
-
},
|
|
10380
|
-
{
|
|
10381
|
-
kind: "select",
|
|
10382
|
-
...row("path_guard"),
|
|
10383
|
-
options: options(claudeOverrideLabels.path_guard)
|
|
10384
|
-
},
|
|
10959
|
+
{ kind: "switch", ...row("sandbox") },
|
|
10385
10960
|
{ kind: "switch", ...row("subagents") },
|
|
10386
10961
|
{ kind: "switch", ...row("settings_files") },
|
|
10387
10962
|
{ kind: "switch", ...row("user_mcp") }
|
|
@@ -10395,80 +10970,6 @@ var providerRestrictionSections = [claudeRestrictionsSection];
|
|
|
10395
10970
|
var preferredSettingsProvider = (providers) => providers.includes("claude") ? "claude" : providers[0];
|
|
10396
10971
|
var providerModelSettingScopes = ["claude", "fixture"];
|
|
10397
10972
|
|
|
10398
|
-
// src/shared/settings/document-contract.generated.ts
|
|
10399
|
-
var helpPartSchema = external_exports.union([
|
|
10400
|
-
external_exports.string(),
|
|
10401
|
-
external_exports.object({
|
|
10402
|
-
text: external_exports.string(),
|
|
10403
|
-
setting: external_exports.string()
|
|
10404
|
-
})
|
|
10405
|
-
]);
|
|
10406
|
-
var settingOptionSchema = external_exports.object({
|
|
10407
|
-
value: external_exports.string(),
|
|
10408
|
-
label: external_exports.string(),
|
|
10409
|
-
description: external_exports.string().optional()
|
|
10410
|
-
});
|
|
10411
|
-
var settingRowBaseSchema = external_exports.object({
|
|
10412
|
-
path: external_exports.string(),
|
|
10413
|
-
label: external_exports.string(),
|
|
10414
|
-
help: external_exports.array(helpPartSchema).optional(),
|
|
10415
|
-
keywords: external_exports.array(external_exports.string()).optional()
|
|
10416
|
-
});
|
|
10417
|
-
var selectSettingRowSchema = settingRowBaseSchema.extend({
|
|
10418
|
-
kind: external_exports.literal("select"),
|
|
10419
|
-
options: external_exports.array(settingOptionSchema)
|
|
10420
|
-
});
|
|
10421
|
-
var switchSettingRowSchema = settingRowBaseSchema.extend({
|
|
10422
|
-
kind: external_exports.literal("switch")
|
|
10423
|
-
});
|
|
10424
|
-
var textSettingRowSchema = settingRowBaseSchema.extend({
|
|
10425
|
-
kind: external_exports.literal("text"),
|
|
10426
|
-
maxLength: external_exports.number(),
|
|
10427
|
-
pattern: external_exports.string()
|
|
10428
|
-
});
|
|
10429
|
-
var budgetSettingRowSchema = settingRowBaseSchema.extend({
|
|
10430
|
-
kind: external_exports.literal("budget"),
|
|
10431
|
-
unit: external_exports.string(),
|
|
10432
|
-
min: external_exports.number(),
|
|
10433
|
-
max: external_exports.number().optional()
|
|
10434
|
-
});
|
|
10435
|
-
var proseSettingSchema = settingRowBaseSchema.extend({
|
|
10436
|
-
maxLength: external_exports.number()
|
|
10437
|
-
});
|
|
10438
|
-
var modelScopeSchema = external_exports.object({
|
|
10439
|
-
id: external_exports.string(),
|
|
10440
|
-
label: external_exports.string(),
|
|
10441
|
-
model: external_exports.object({
|
|
10442
|
-
path: external_exports.string(),
|
|
10443
|
-
label: external_exports.string(),
|
|
10444
|
-
options: external_exports.array(settingOptionSchema).optional()
|
|
10445
|
-
}),
|
|
10446
|
-
effort: external_exports.object({
|
|
10447
|
-
path: external_exports.string(),
|
|
10448
|
-
label: external_exports.string(),
|
|
10449
|
-
options: external_exports.array(settingOptionSchema),
|
|
10450
|
-
unsupported: external_exports.boolean()
|
|
10451
|
-
}),
|
|
10452
|
-
instructions: proseSettingSchema.optional()
|
|
10453
|
-
});
|
|
10454
|
-
var modelsSettingRowSchema = external_exports.object({
|
|
10455
|
-
kind: external_exports.literal("models"),
|
|
10456
|
-
scopes: external_exports.array(modelScopeSchema)
|
|
10457
|
-
});
|
|
10458
|
-
var settingRowSchema = external_exports.discriminatedUnion("kind", [
|
|
10459
|
-
selectSettingRowSchema,
|
|
10460
|
-
switchSettingRowSchema,
|
|
10461
|
-
textSettingRowSchema,
|
|
10462
|
-
budgetSettingRowSchema,
|
|
10463
|
-
modelsSettingRowSchema
|
|
10464
|
-
]);
|
|
10465
|
-
var settingSectionSchema = external_exports.object({
|
|
10466
|
-
id: external_exports.string(),
|
|
10467
|
-
title: external_exports.string(),
|
|
10468
|
-
help: external_exports.array(helpPartSchema).optional(),
|
|
10469
|
-
rows: external_exports.array(settingRowSchema)
|
|
10470
|
-
});
|
|
10471
|
-
|
|
10472
10973
|
// src/shared/settings/settings-schema.ts
|
|
10473
10974
|
var branchPrefixPattern = "[\\w./-]*";
|
|
10474
10975
|
var settingHelp = {
|
|
@@ -10484,7 +10985,7 @@ var budget = (title, unit, amount, keywords) => external_exports.strictObject({
|
|
|
10484
10985
|
}).meta({ title, keywords }).prefault({});
|
|
10485
10986
|
var modelScope = (label) => external_exports.strictObject({
|
|
10486
10987
|
model: modelNameSchema.meta({ title: `${label} model` }).default(""),
|
|
10487
|
-
reasoning_effort: reasoningSchema.meta({ title: `${label} reasoning
|
|
10988
|
+
reasoning_effort: reasoningSchema.meta({ title: `${label} reasoning` }).default("default")
|
|
10488
10989
|
}).prefault({});
|
|
10489
10990
|
var scopes = (ids) => external_exports.strictObject(
|
|
10490
10991
|
Object.fromEntries(
|
|
@@ -10547,7 +11048,7 @@ var settingsSchema = external_exports.strictObject({
|
|
|
10547
11048
|
}).default("user"),
|
|
10548
11049
|
execution_mode: approvalModeSchema.meta({
|
|
10549
11050
|
title: "Execution approval mode",
|
|
10550
|
-
description: "Default for execution providers: ask user, delegate to the parent agent, auto-approve within the sandbox, or deny execution requests. Native permission settings are independent.
|
|
11051
|
+
description: "Default for execution providers: ask user, delegate to the parent agent, auto-approve within the sandbox, or deny execution requests. Native permission settings are independent."
|
|
10551
11052
|
}).default("ask_user")
|
|
10552
11053
|
}).meta({ userOnly: true }).prefault({}),
|
|
10553
11054
|
projects: external_exports.strictObject({
|
|
@@ -10626,7 +11127,178 @@ function deepPartial(schema) {
|
|
|
10626
11127
|
}
|
|
10627
11128
|
var settingsPatchSchema = deepPartial(settingsSchema);
|
|
10628
11129
|
|
|
11130
|
+
// src/shared/providers/policy.ts
|
|
11131
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11132
|
+
var FAMILY_ALIASES = ["opus", "sonnet", "haiku", "fable"];
|
|
11133
|
+
var isModelVariant = (model, base) => model.startsWith(base) && /^(-\d{8}|-fast)+$/.test(model.slice(base.length));
|
|
11134
|
+
function entryAllows(entry, model, exact) {
|
|
11135
|
+
if (model === entry) return true;
|
|
11136
|
+
if (FAMILY_ALIASES.includes(entry)) return model.includes(`-${entry}-`);
|
|
11137
|
+
if (!model.startsWith(entry)) return false;
|
|
11138
|
+
return !exact || isModelVariant(model, entry);
|
|
11139
|
+
}
|
|
11140
|
+
function modelAllowed(policy, models, value) {
|
|
11141
|
+
const entries = policy?.available_models;
|
|
11142
|
+
const exact = policy?.available_models_match === "exact";
|
|
11143
|
+
const model = value.replace(/\[.*\]$/, "");
|
|
11144
|
+
if (!entries || !model || model === "default") return true;
|
|
11145
|
+
return models.some(
|
|
11146
|
+
(choice) => choice.value === value || choice.value === model || choice.resolvedModel === model
|
|
11147
|
+
) || entries.some((entry) => entryAllows(entry, model, exact));
|
|
11148
|
+
}
|
|
11149
|
+
var blockedReason = (policy, mode) => policy?.blocked.find((item) => item.value === mode)?.reason;
|
|
11150
|
+
function withBlockedOptions(options2, policy) {
|
|
11151
|
+
return options2.map((option) => {
|
|
11152
|
+
const reason = blockedReason(policy, option.value);
|
|
11153
|
+
return reason ? { ...option, disabled: true, description: reason } : option;
|
|
11154
|
+
});
|
|
11155
|
+
}
|
|
11156
|
+
|
|
11157
|
+
// src/shared/providers/claude/settings-policy.ts
|
|
11158
|
+
function withPolicy(row2, policy, values) {
|
|
11159
|
+
if (row2.kind !== "select" || row2.path !== "providers.claude.permission_mode") {
|
|
11160
|
+
return row2;
|
|
11161
|
+
}
|
|
11162
|
+
const saved = String(settingAt(values, row2.path));
|
|
11163
|
+
const reason = blockedReason(policy, saved);
|
|
11164
|
+
return {
|
|
11165
|
+
...row2,
|
|
11166
|
+
options: withBlockedOptions(row2.options, policy),
|
|
11167
|
+
...reason ? {
|
|
11168
|
+
warning: reason === MODE_TURNED_OFF_BY_ORG ? `Your saved mode, ${permissionModeName(saved)}, is turned off by your organization. New tasks ask for approval.` : `Your saved mode, ${permissionModeName(saved)}, isn't available. New tasks ask for approval.`
|
|
11169
|
+
} : {}
|
|
11170
|
+
};
|
|
11171
|
+
}
|
|
11172
|
+
var SOURCE_HELP = {
|
|
11173
|
+
console: "Your organization's admin console sets these limits.",
|
|
11174
|
+
device: "A policy on this computer sets these limits."
|
|
11175
|
+
};
|
|
11176
|
+
function policyFacts(policy) {
|
|
11177
|
+
const modes = policy.blocked.filter(({ reason }) => reason === MODE_TURNED_OFF_BY_ORG).map(({ value }) => permissionModeName(value));
|
|
11178
|
+
return [
|
|
11179
|
+
...modes.length ? [
|
|
11180
|
+
{
|
|
11181
|
+
label: "Permission modes",
|
|
11182
|
+
detail: `Turned off: ${modes.join(", ")}.`
|
|
11183
|
+
}
|
|
11184
|
+
] : [],
|
|
11185
|
+
...policy.available_models ? [
|
|
11186
|
+
{
|
|
11187
|
+
label: "Models",
|
|
11188
|
+
detail: policy.available_models.length ? `Limited to ${policy.available_models.join(", ")}.` : "Limited to the default model."
|
|
11189
|
+
}
|
|
11190
|
+
] : [],
|
|
11191
|
+
...policy.notes
|
|
11192
|
+
];
|
|
11193
|
+
}
|
|
11194
|
+
function withClaudePolicy(sections, policy, values) {
|
|
11195
|
+
if (!policy) return sections;
|
|
11196
|
+
const applied = sections.map((section) => ({
|
|
11197
|
+
...section,
|
|
11198
|
+
rows: section.rows.map((row2) => withPolicy(row2, policy, values))
|
|
11199
|
+
}));
|
|
11200
|
+
if (!policy.managed) return applied;
|
|
11201
|
+
const after = applied.findIndex(
|
|
11202
|
+
({ id }) => id === claudeRestrictionsSection.id
|
|
11203
|
+
);
|
|
11204
|
+
applied.splice(after + 1, 0, {
|
|
11205
|
+
id: "organization-policy",
|
|
11206
|
+
title: "Organization policy",
|
|
11207
|
+
help: [
|
|
11208
|
+
`${policy.source ? SOURCE_HELP[policy.source] : "Your organization sets these limits."} Claude Code enforces them, along with any others your organization sets.`
|
|
11209
|
+
],
|
|
11210
|
+
facts: policyFacts(policy),
|
|
11211
|
+
rows: []
|
|
11212
|
+
});
|
|
11213
|
+
return applied;
|
|
11214
|
+
}
|
|
11215
|
+
|
|
11216
|
+
// src/shared/settings/document-contract.generated.ts
|
|
11217
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11218
|
+
var helpPartSchema = external_exports.union([
|
|
11219
|
+
external_exports.string(),
|
|
11220
|
+
external_exports.object({
|
|
11221
|
+
text: external_exports.string(),
|
|
11222
|
+
setting: external_exports.string()
|
|
11223
|
+
})
|
|
11224
|
+
]);
|
|
11225
|
+
var settingOptionSchema = external_exports.object({
|
|
11226
|
+
value: external_exports.string(),
|
|
11227
|
+
label: external_exports.string(),
|
|
11228
|
+
description: external_exports.string().optional(),
|
|
11229
|
+
disabled: external_exports.boolean().optional()
|
|
11230
|
+
});
|
|
11231
|
+
var settingRowBaseSchema = external_exports.object({
|
|
11232
|
+
path: external_exports.string(),
|
|
11233
|
+
label: external_exports.string(),
|
|
11234
|
+
help: external_exports.array(helpPartSchema).optional(),
|
|
11235
|
+
keywords: external_exports.array(external_exports.string()).optional()
|
|
11236
|
+
});
|
|
11237
|
+
var selectSettingRowSchema = settingRowBaseSchema.extend({
|
|
11238
|
+
kind: external_exports.literal("select"),
|
|
11239
|
+
options: external_exports.array(settingOptionSchema),
|
|
11240
|
+
warning: external_exports.string().optional()
|
|
11241
|
+
});
|
|
11242
|
+
var switchSettingRowSchema = settingRowBaseSchema.extend({
|
|
11243
|
+
kind: external_exports.literal("switch")
|
|
11244
|
+
});
|
|
11245
|
+
var textSettingRowSchema = settingRowBaseSchema.extend({
|
|
11246
|
+
kind: external_exports.literal("text"),
|
|
11247
|
+
maxLength: external_exports.number(),
|
|
11248
|
+
pattern: external_exports.string()
|
|
11249
|
+
});
|
|
11250
|
+
var budgetSettingRowSchema = settingRowBaseSchema.extend({
|
|
11251
|
+
kind: external_exports.literal("budget"),
|
|
11252
|
+
unit: external_exports.string(),
|
|
11253
|
+
min: external_exports.number(),
|
|
11254
|
+
max: external_exports.number().optional()
|
|
11255
|
+
});
|
|
11256
|
+
var proseSettingSchema = settingRowBaseSchema.extend({
|
|
11257
|
+
maxLength: external_exports.number()
|
|
11258
|
+
});
|
|
11259
|
+
var modelScopeSchema = external_exports.object({
|
|
11260
|
+
id: external_exports.string(),
|
|
11261
|
+
label: external_exports.string(),
|
|
11262
|
+
model: external_exports.object({
|
|
11263
|
+
path: external_exports.string(),
|
|
11264
|
+
label: external_exports.string(),
|
|
11265
|
+
options: external_exports.array(settingOptionSchema).optional(),
|
|
11266
|
+
warning: external_exports.string().optional()
|
|
11267
|
+
}),
|
|
11268
|
+
effort: external_exports.object({
|
|
11269
|
+
path: external_exports.string(),
|
|
11270
|
+
label: external_exports.string(),
|
|
11271
|
+
options: external_exports.array(settingOptionSchema),
|
|
11272
|
+
unsupported: external_exports.boolean()
|
|
11273
|
+
}),
|
|
11274
|
+
instructions: proseSettingSchema.optional()
|
|
11275
|
+
});
|
|
11276
|
+
var modelsSettingRowSchema = external_exports.object({
|
|
11277
|
+
kind: external_exports.literal("models"),
|
|
11278
|
+
scopes: external_exports.array(modelScopeSchema)
|
|
11279
|
+
});
|
|
11280
|
+
var settingRowSchema = external_exports.discriminatedUnion("kind", [
|
|
11281
|
+
selectSettingRowSchema,
|
|
11282
|
+
switchSettingRowSchema,
|
|
11283
|
+
textSettingRowSchema,
|
|
11284
|
+
budgetSettingRowSchema,
|
|
11285
|
+
modelsSettingRowSchema
|
|
11286
|
+
]);
|
|
11287
|
+
var settingSectionSchema = external_exports.object({
|
|
11288
|
+
id: external_exports.string(),
|
|
11289
|
+
title: external_exports.string(),
|
|
11290
|
+
help: external_exports.array(helpPartSchema).optional(),
|
|
11291
|
+
facts: external_exports.array(
|
|
11292
|
+
external_exports.object({
|
|
11293
|
+
label: external_exports.string(),
|
|
11294
|
+
detail: external_exports.string()
|
|
11295
|
+
})
|
|
11296
|
+
).optional(),
|
|
11297
|
+
rows: external_exports.array(settingRowSchema)
|
|
11298
|
+
});
|
|
11299
|
+
|
|
10629
11300
|
// src/shared/settings/model-defaults.ts
|
|
11301
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10630
11302
|
function modelScopePath(scope) {
|
|
10631
11303
|
if (scope === "global") return "models.global";
|
|
10632
11304
|
return roles.includes(scope) ? `models.profiles.${scope}` : `models.providers.${scope}`;
|
|
@@ -10645,7 +11317,7 @@ function resolveModelDefaults(values, { provider, profile }) {
|
|
|
10645
11317
|
|
|
10646
11318
|
// src/shared/settings/settings-document.ts
|
|
10647
11319
|
var sectionSchema = settingSectionSchema;
|
|
10648
|
-
var unsupportedEffortWarning = "The saved
|
|
11320
|
+
var unsupportedEffortWarning = "The saved reasoning is not supported by this model.";
|
|
10649
11321
|
var withHelp = (parts, shown) => parts.map(
|
|
10650
11322
|
(part) => typeof part === "string" || settingAt(shown, part.setting) !== void 0 ? part : part.text
|
|
10651
11323
|
);
|
|
@@ -10654,14 +11326,17 @@ function described(path) {
|
|
|
10654
11326
|
if (!schema) throw new Error(`Unknown setting ${path}`);
|
|
10655
11327
|
return { path, ...settingText(schema) };
|
|
10656
11328
|
}
|
|
10657
|
-
var
|
|
11329
|
+
var options = (labels) => Object.entries(labels).map(([value, label]) => ({ value, label }));
|
|
10658
11330
|
function modelScope2(scope, { values, providers, catalogs }) {
|
|
10659
11331
|
const scopePath = modelScopePath(scope), modelPath = `${scopePath}.model`, effortPath = `${scopePath}.reasoning_effort`, providerScope = providers.includes(scope), provider = providerScope ? scope : scalarText(settingAt(values, "task.provider"));
|
|
10660
|
-
const choices = catalogs.filter((
|
|
11332
|
+
const choices = catalogs.filter((catalog2) => !providerScope || catalog2.provider === scope).flatMap((catalog2) => catalog2.models ?? []);
|
|
10661
11333
|
const saved = scalarText(settingAt(values, modelPath)), savedEffort = scalarText(settingAt(values, effortPath), "default");
|
|
10662
11334
|
const chain = scope === "global" ? {} : { provider, profile: providerScope ? void 0 : scope };
|
|
10663
11335
|
const effectiveModel = resolveModelDefaults(values, chain).model ?? "default";
|
|
10664
|
-
const
|
|
11336
|
+
const catalog = catalogs.find((item) => item.provider === provider);
|
|
11337
|
+
const metadata = catalog?.models?.find(
|
|
11338
|
+
(model) => model.value === effectiveModel
|
|
11339
|
+
);
|
|
10665
11340
|
const levels = metadata?.supportsEffort === false ? [] : metadata?.supportedEffortLevels;
|
|
10666
11341
|
const modelChoices = choices.length ? [
|
|
10667
11342
|
{ value: "", label: "Inherit" },
|
|
@@ -10691,6 +11366,7 @@ function modelScope2(scope, { values, providers, catalogs }) {
|
|
|
10691
11366
|
effectiveModel,
|
|
10692
11367
|
levels,
|
|
10693
11368
|
modelChoices,
|
|
11369
|
+
modelExcluded: !modelAllowed(catalog?.policy, choices, saved),
|
|
10694
11370
|
effortChoices: [
|
|
10695
11371
|
{ value: "default", label: "Inherit" },
|
|
10696
11372
|
...effortLevels.map((level) => ({ value: level, label: level }))
|
|
@@ -10708,11 +11384,14 @@ function settingsSections(input) {
|
|
|
10708
11384
|
model: {
|
|
10709
11385
|
path: info.modelPath,
|
|
10710
11386
|
label: `${label} model`,
|
|
10711
|
-
options: info.modelChoices
|
|
11387
|
+
options: info.modelChoices,
|
|
11388
|
+
...info.modelExcluded ? {
|
|
11389
|
+
warning: "Your organization doesn't allow this model. New tasks use the default."
|
|
11390
|
+
} : {}
|
|
10712
11391
|
},
|
|
10713
11392
|
effort: {
|
|
10714
11393
|
path: info.effortPath,
|
|
10715
|
-
label: `${label} reasoning
|
|
11394
|
+
label: `${label} reasoning`,
|
|
10716
11395
|
options: info.effortChoices,
|
|
10717
11396
|
unsupported: info.unsupported
|
|
10718
11397
|
}
|
|
@@ -10725,7 +11404,7 @@ function settingsSections(input) {
|
|
|
10725
11404
|
{ text: "worker profile", setting: profileModel },
|
|
10726
11405
|
" defaults override these. Inherit uses ",
|
|
10727
11406
|
{ text: "Global", setting: "models.global.model" },
|
|
10728
|
-
", then the worker's own default. This applies to model and reasoning
|
|
11407
|
+
", then the worker's own default. This applies to model and reasoning. Task choices override all defaults."
|
|
10729
11408
|
],
|
|
10730
11409
|
values
|
|
10731
11410
|
);
|
|
@@ -10735,12 +11414,12 @@ function settingsSections(input) {
|
|
|
10735
11414
|
{ text: "provider", setting: providerModel },
|
|
10736
11415
|
" default, then ",
|
|
10737
11416
|
{ text: "Global", setting: "models.global.model" },
|
|
10738
|
-
", then the worker's own default. This applies to model and reasoning
|
|
11417
|
+
", then the worker's own default. This applies to model and reasoning. Task choices override profile defaults."
|
|
10739
11418
|
],
|
|
10740
11419
|
values
|
|
10741
11420
|
);
|
|
10742
11421
|
const userOnly2 = "Only you can change these settings.";
|
|
10743
|
-
|
|
11422
|
+
const sections = [
|
|
10744
11423
|
{
|
|
10745
11424
|
id: "task",
|
|
10746
11425
|
title: "Task defaults",
|
|
@@ -10761,7 +11440,7 @@ function settingsSections(input) {
|
|
|
10761
11440
|
{
|
|
10762
11441
|
kind: "select",
|
|
10763
11442
|
...described("task.workspace_strategy"),
|
|
10764
|
-
options:
|
|
11443
|
+
options: options({
|
|
10765
11444
|
current_repo: "Project folder",
|
|
10766
11445
|
worktree: "Isolated worktree"
|
|
10767
11446
|
})
|
|
@@ -10795,7 +11474,7 @@ function settingsSections(input) {
|
|
|
10795
11474
|
{
|
|
10796
11475
|
kind: "select",
|
|
10797
11476
|
...described("approvals.decider"),
|
|
10798
|
-
options:
|
|
11477
|
+
options: options({ user: "User", parent_agent: "Parent agent" })
|
|
10799
11478
|
},
|
|
10800
11479
|
{ kind: "switch", ...described("projects.auto_register_chat") }
|
|
10801
11480
|
]
|
|
@@ -10836,6 +11515,11 @@ function settingsSections(input) {
|
|
|
10836
11515
|
]
|
|
10837
11516
|
}
|
|
10838
11517
|
];
|
|
11518
|
+
return withClaudePolicy(
|
|
11519
|
+
sections,
|
|
11520
|
+
input.catalogs.find(({ provider }) => provider === "claude")?.policy,
|
|
11521
|
+
values
|
|
11522
|
+
);
|
|
10839
11523
|
}
|
|
10840
11524
|
|
|
10841
11525
|
// src/service/features/settings/settings-tool-schemas.ts
|
|
@@ -10865,6 +11549,7 @@ var settingsUpdateSchema = external_exports.strictObject({
|
|
|
10865
11549
|
});
|
|
10866
11550
|
|
|
10867
11551
|
// src/service/features/tasks/conversation/message-poll.ts
|
|
11552
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10868
11553
|
var MAX_MESSAGE_WAIT_SECONDS = 50;
|
|
10869
11554
|
var WAKE = /* @__PURE__ */ new Set([
|
|
10870
11555
|
"task.instruction",
|
|
@@ -10876,7 +11561,7 @@ var WAKE = /* @__PURE__ */ new Set([
|
|
|
10876
11561
|
async function pollMessages(store, drafts, owner, id, after, waitSeconds) {
|
|
10877
11562
|
store.get(id, owner);
|
|
10878
11563
|
let wake;
|
|
10879
|
-
const woken = new Promise((
|
|
11564
|
+
const woken = new Promise((resolve3) => wake = resolve3);
|
|
10880
11565
|
const onEvent = (e, eventOwner) => {
|
|
10881
11566
|
if (eventOwner === owner && e.task_id === id && WAKE.has(e.type)) wake();
|
|
10882
11567
|
};
|
|
@@ -10909,7 +11594,7 @@ async function pollMessages(store, drafts, owner, id, after, waitSeconds) {
|
|
|
10909
11594
|
}
|
|
10910
11595
|
function read(store, owner, id, after) {
|
|
10911
11596
|
const task = store.get(id, owner);
|
|
10912
|
-
const events = store.
|
|
11597
|
+
const events = store.conversationEvents(id, [
|
|
10913
11598
|
...MESSAGE_EVENTS,
|
|
10914
11599
|
"task.turn_ended",
|
|
10915
11600
|
"agent.input_required"
|
|
@@ -10927,7 +11612,11 @@ function read(store, owner, id, after) {
|
|
|
10927
11612
|
}
|
|
10928
11613
|
|
|
10929
11614
|
// src/service/platform/server/tools/definition.ts
|
|
11615
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
10930
11616
|
var taskId = external_exports.object({ task_id: external_exports.string() });
|
|
11617
|
+
var archivedFilter = external_exports.enum(archivedFilters).default("exclude").describe(
|
|
11618
|
+
"exclude (default) leaves archived tasks out, include lists them too and only lists just them. Archived tasks carry archived_at."
|
|
11619
|
+
);
|
|
10931
11620
|
var queuedMessage = taskId.extend({ message_id: external_exports.string().max(200) });
|
|
10932
11621
|
var messageInput = taskId.extend({
|
|
10933
11622
|
request_id: external_exports.string().min(1).max(200).optional().describe(
|
|
@@ -10982,7 +11671,7 @@ function agentTools({ c, owner, authority, hostMeta }) {
|
|
|
10982
11671
|
openWorld: true,
|
|
10983
11672
|
panel: true,
|
|
10984
11673
|
conversation: "chat",
|
|
10985
|
-
description: "Start
|
|
11674
|
+
description: "Start a background task from the user's full request in description. Use attachments for material the worker wouldn't find on its own. If the result has workspace_fallback, tell the user the task runs directly in the project folder without an isolated worktree. To show an existing task, call open_subagent_extension_for_codex(task_id) instead of starting another.",
|
|
10986
11675
|
schema: startSchema.extend({
|
|
10987
11676
|
conversation_id: startSchema.shape.conversation_id.nullable(),
|
|
10988
11677
|
provider: startSchema.shape.provider.unwrap().optional(),
|
|
@@ -10992,7 +11681,7 @@ function agentTools({ c, owner, authority, hostMeta }) {
|
|
|
10992
11681
|
max_runtime_minutes: startSchema.shape.budget.unwrap().shape.max_runtime_minutes.unwrap().optional(),
|
|
10993
11682
|
max_cost_usd: startSchema.shape.budget.unwrap().shape.max_cost_usd.unwrap().optional()
|
|
10994
11683
|
}).optional()
|
|
10995
|
-
}),
|
|
11684
|
+
}).loose(),
|
|
10996
11685
|
// Null opts out of host correlation; persisted tasks keep the optional string contract.
|
|
10997
11686
|
run: async (a) => {
|
|
10998
11687
|
await autoRegisterChatProject(c, owner, hostMeta, a.repository);
|
|
@@ -11005,7 +11694,7 @@ function agentTools({ c, owner, authority, hostMeta }) {
|
|
|
11005
11694
|
}),
|
|
11006
11695
|
get_task: tool({
|
|
11007
11696
|
readOnly: true,
|
|
11008
|
-
description: "Read a task's full state: status, turn (the number of turns started), pending input, draft (the message being written), pending steers not yet taken, queue (messages waiting for their own turn, and whether an interrupt paused it), branch for worktree tasks and an excerpt of the latest reply.",
|
|
11697
|
+
description: "Read a task's full state: status, turn (the number of turns started), pending input, draft (the message being written), pending steers not yet taken, queue (messages waiting for their own turn, and whether an interrupt paused it), branch for worktree tasks and an excerpt of the latest reply. Read the conversation with list_messages.",
|
|
11009
11698
|
schema: taskId,
|
|
11010
11699
|
run: (a) => {
|
|
11011
11700
|
const t = c.store.get(a.task_id, owner);
|
|
@@ -11020,30 +11709,26 @@ function agentTools({ c, owner, authority, hostMeta }) {
|
|
|
11020
11709
|
list_tasks: tool({
|
|
11021
11710
|
readOnly: true,
|
|
11022
11711
|
conversation: "chat",
|
|
11023
|
-
description: "List your tasks, optionally filtered by conversation and repository. null conversation_id means all conversations. Each task
|
|
11712
|
+
description: "List your tasks as summaries, newest first, optionally filtered by conversation and repository. null conversation_id means all conversations. Each summary has the task's status, turn, the kind of any pending_input, error, queued message count and an excerpt of its latest reply. Read a task's full state with get_task and its conversation with list_messages.",
|
|
11024
11713
|
schema: external_exports.object({
|
|
11025
11714
|
conversation_id: external_exports.string().nullable().optional(),
|
|
11026
|
-
repository: external_exports.string().optional()
|
|
11715
|
+
repository: external_exports.string().optional(),
|
|
11716
|
+
archived: archivedFilter
|
|
11027
11717
|
}),
|
|
11028
11718
|
run: (a) => {
|
|
11029
|
-
const
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
|
|
11037
|
-
c.drafts.get(t.id),
|
|
11038
|
-
c.store.readState(t.id),
|
|
11039
|
-
archived.get(t.id)
|
|
11040
|
-
)
|
|
11041
|
-
);
|
|
11719
|
+
const filters = {
|
|
11720
|
+
conversation: a.conversation_id || void 0,
|
|
11721
|
+
repository: a.repository || void 0,
|
|
11722
|
+
archived: a.archived
|
|
11723
|
+
};
|
|
11724
|
+
const archived = c.archive.times(owner, filters);
|
|
11725
|
+
const replies = c.store.latestEvents(owner, "agent.reply", filters);
|
|
11726
|
+
return c.store.list(owner, filters).map((t) => taskSummary(t, replies.get(t.id), archived.get(t.id)));
|
|
11042
11727
|
}
|
|
11043
11728
|
}),
|
|
11044
11729
|
list_workers: tool({
|
|
11045
11730
|
readOnly: true,
|
|
11046
|
-
description: "List installed providers with their profiles, capabilities and
|
|
11731
|
+
description: "List installed providers with their profiles, capabilities, readiness and any org policy limits. When readiness.ready is false, report readiness.message to the user instead of retrying. When policy is present, its blocked choices fail at start_task; absent policy doesn't mean everything is allowed.",
|
|
11047
11732
|
schema: external_exports.object({}),
|
|
11048
11733
|
run: () => c.availableWorkers(owner)
|
|
11049
11734
|
}),
|
|
@@ -11119,7 +11804,7 @@ function agentTools({ c, owner, authority, hostMeta }) {
|
|
|
11119
11804
|
const task = c.store.get(a.task_id, owner);
|
|
11120
11805
|
const message = conversation(
|
|
11121
11806
|
task,
|
|
11122
|
-
c.store.
|
|
11807
|
+
c.store.conversationEvents(task.id, MESSAGE_EVENTS)
|
|
11123
11808
|
).find((m2) => m2.id === a.message_id);
|
|
11124
11809
|
if (!message) throw new Error("Message not found");
|
|
11125
11810
|
if (message.kind === "reply") {
|
|
@@ -11157,157 +11842,385 @@ function agentTools({ c, owner, authority, hostMeta }) {
|
|
|
11157
11842
|
};
|
|
11158
11843
|
}
|
|
11159
11844
|
|
|
11160
|
-
// src/
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11845
|
+
// src/service/platform/server/tools/user-tools.ts
|
|
11846
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11847
|
+
|
|
11848
|
+
// src/service/platform/service/about.ts
|
|
11849
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11850
|
+
var import_compare3 = __toESM(require_compare(), 1);
|
|
11851
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
11852
|
+
|
|
11853
|
+
// src/service/features/providers/claude/configuration/executable.ts
|
|
11854
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11855
|
+
var import_compare = __toESM(require_compare(), 1);
|
|
11856
|
+
import { execFile } from "node:child_process";
|
|
11857
|
+
import { constants } from "node:fs";
|
|
11858
|
+
import { access, realpath as realpath2, stat } from "node:fs/promises";
|
|
11859
|
+
import { isAbsolute as isAbsolute3, join as join2, win32 } from "node:path";
|
|
11860
|
+
import { promisify } from "node:util";
|
|
11861
|
+
var claudeCliSupport = {
|
|
11862
|
+
sdk: "0.3.319",
|
|
11863
|
+
minimum: "2.1.300",
|
|
11864
|
+
paired: "2.1.319"
|
|
11865
|
+
};
|
|
11866
|
+
var claudePathVariable = "SUBAGENT_EXTENSION_FOR_CODEX_CLAUDE_PATH";
|
|
11867
|
+
var supportedRange = `${claudeCliSupport.minimum}+`;
|
|
11868
|
+
var setupDocs = "https://code.claude.com/docs/en/setup";
|
|
11869
|
+
var FRESH_MS = 5 * 60 * 1e3;
|
|
11870
|
+
var FAILED_FRESH_MS = 30 * 1e3;
|
|
11871
|
+
var VERSION_TIMEOUT_MS = 1e4;
|
|
11872
|
+
var VERSION_OUTPUT_BYTES = 4096;
|
|
11873
|
+
var execFileAsync = promisify(execFile);
|
|
11874
|
+
var failure = (problem, message, facts = {}) => ({
|
|
11875
|
+
ready: false,
|
|
11876
|
+
problem,
|
|
11877
|
+
message,
|
|
11878
|
+
...facts,
|
|
11879
|
+
supported: supportedRange
|
|
11880
|
+
});
|
|
11881
|
+
async function isFile(path, mode = constants.F_OK) {
|
|
11882
|
+
try {
|
|
11883
|
+
await access(path, mode);
|
|
11884
|
+
return (await stat(path)).isFile();
|
|
11885
|
+
} catch {
|
|
11886
|
+
return false;
|
|
11887
|
+
}
|
|
11888
|
+
}
|
|
11889
|
+
function pathVariable({ env, platform }) {
|
|
11890
|
+
if (platform !== "win32") return env.PATH ?? "";
|
|
11891
|
+
const name = Object.keys(env).find((key) => key.toUpperCase() === "PATH");
|
|
11892
|
+
return name ? env[name] ?? "" : "";
|
|
11893
|
+
}
|
|
11894
|
+
async function inDirectory(directory, platform) {
|
|
11895
|
+
if (platform !== "win32") {
|
|
11896
|
+
const candidate = join2(directory, "claude");
|
|
11897
|
+
return await isFile(candidate, constants.X_OK) ? candidate : void 0;
|
|
11898
|
+
}
|
|
11899
|
+
const native = join2(directory, "claude.exe");
|
|
11900
|
+
if (await isFile(native)) return native;
|
|
11901
|
+
for (const launcher of ["claude.cmd", "claude.ps1", "claude"]) {
|
|
11902
|
+
if (!await isFile(join2(directory, launcher))) continue;
|
|
11903
|
+
const target = join2(
|
|
11904
|
+
directory,
|
|
11905
|
+
"node_modules",
|
|
11906
|
+
"@anthropic-ai",
|
|
11907
|
+
"claude-code",
|
|
11908
|
+
"bin",
|
|
11909
|
+
"claude.exe"
|
|
11910
|
+
);
|
|
11911
|
+
if (await isFile(target)) return target;
|
|
11912
|
+
}
|
|
11913
|
+
return void 0;
|
|
11914
|
+
}
|
|
11915
|
+
async function locateClaudeCli(environment) {
|
|
11916
|
+
const override = environment.env[claudePathVariable];
|
|
11917
|
+
const absolute = (path) => environment.platform === "win32" ? win32.isAbsolute(path) : isAbsolute3(path);
|
|
11918
|
+
if (override) {
|
|
11919
|
+
if (!absolute(override)) {
|
|
11920
|
+
return {
|
|
11921
|
+
problem: "invalid_override",
|
|
11922
|
+
message: `${claudePathVariable} must be an absolute path to the Claude Code executable; it is "${override}".`
|
|
11923
|
+
};
|
|
11924
|
+
}
|
|
11925
|
+
try {
|
|
11926
|
+
return { path: await realpath2(override), launcher: override };
|
|
11927
|
+
} catch {
|
|
11928
|
+
return {
|
|
11929
|
+
problem: "invalid_override",
|
|
11930
|
+
message: `${claudePathVariable} points to ${override}, which does not exist. Fix or unset it; the service does not fall back to PATH while it is set.`
|
|
11931
|
+
};
|
|
11932
|
+
}
|
|
11933
|
+
}
|
|
11934
|
+
const separator = environment.platform === "win32" ? ";" : ":";
|
|
11935
|
+
for (const directory of pathVariable(environment).split(separator)) {
|
|
11936
|
+
if (!directory || !absolute(directory)) continue;
|
|
11937
|
+
const found = await inDirectory(directory, environment.platform);
|
|
11938
|
+
if (!found) continue;
|
|
11939
|
+
try {
|
|
11940
|
+
return { path: await realpath2(found), launcher: found };
|
|
11941
|
+
} catch {
|
|
11942
|
+
}
|
|
11943
|
+
}
|
|
11944
|
+
return {
|
|
11945
|
+
problem: "missing",
|
|
11946
|
+
message: `Claude Code was not found on the service's PATH. Install a supported version (${supportedRange}) from ${setupDocs}: the stable channel is the Homebrew claude-code cask or npm's @anthropic-ai/claude-code@stable. Or set ${claudePathVariable} to its absolute path.`
|
|
11947
|
+
};
|
|
11948
|
+
}
|
|
11949
|
+
function parseClaudeVersion(output) {
|
|
11950
|
+
return /^(\d+\.\d+\.\d+) \(Claude Code\)$/.exec(output.trim())?.[1];
|
|
11951
|
+
}
|
|
11952
|
+
async function versionOutput(path, timeout) {
|
|
11953
|
+
const { stdout } = await execFileAsync(path, ["--version"], {
|
|
11954
|
+
timeout,
|
|
11955
|
+
maxBuffer: VERSION_OUTPUT_BYTES,
|
|
11956
|
+
windowsHide: true
|
|
11957
|
+
});
|
|
11958
|
+
return stdout;
|
|
11959
|
+
}
|
|
11960
|
+
function unlaunchableReason(error, timeout) {
|
|
11961
|
+
if (error.killed) {
|
|
11962
|
+
return `\`--version\` did not finish within ${timeout / 1e3} seconds`;
|
|
11963
|
+
}
|
|
11964
|
+
return error instanceof Error ? error.message : String(error);
|
|
11965
|
+
}
|
|
11966
|
+
async function validateClaudeCli(path, timeout = VERSION_TIMEOUT_MS) {
|
|
11967
|
+
let output;
|
|
11968
|
+
try {
|
|
11969
|
+
output = await versionOutput(path, timeout);
|
|
11970
|
+
} catch (error) {
|
|
11971
|
+
const reason = unlaunchableReason(error, timeout);
|
|
11972
|
+
return failure(
|
|
11973
|
+
"unlaunchable",
|
|
11974
|
+
`Claude Code at ${path} could not be run: ${reason}. Reinstall it from ${setupDocs}, or set ${claudePathVariable} to a working copy.`,
|
|
11975
|
+
{ path }
|
|
11976
|
+
);
|
|
11977
|
+
}
|
|
11978
|
+
const version = parseClaudeVersion(output);
|
|
11979
|
+
if (!version) {
|
|
11980
|
+
return failure(
|
|
11981
|
+
"unrecognized",
|
|
11982
|
+
`${path} --version printed "${output.trim().slice(0, 200)}", not a Claude Code release version. Install a supported release (${supportedRange}); prereleases aren't supported.`,
|
|
11983
|
+
{ path }
|
|
11984
|
+
);
|
|
11985
|
+
}
|
|
11986
|
+
if ((0, import_compare.default)(version, claudeCliSupport.minimum) < 0) {
|
|
11987
|
+
return failure(
|
|
11988
|
+
"too_old",
|
|
11989
|
+
`Claude Code ${version} at ${path} is older than the supported ${supportedRange}. Update it using its original installer (see ${setupDocs}), or set ${claudePathVariable} to a supported copy.`,
|
|
11990
|
+
{ path, version }
|
|
11991
|
+
);
|
|
11992
|
+
}
|
|
11993
|
+
return { ready: true, path, version, supported: supportedRange };
|
|
11994
|
+
}
|
|
11995
|
+
var ClaudeCli = class {
|
|
11996
|
+
constructor(environment = () => ({
|
|
11997
|
+
env: process.env,
|
|
11998
|
+
platform: process.platform
|
|
11999
|
+
}), validate2 = validateClaudeCli) {
|
|
12000
|
+
this.environment = environment;
|
|
12001
|
+
this.validate = validate2;
|
|
12002
|
+
}
|
|
12003
|
+
environment;
|
|
12004
|
+
validate;
|
|
12005
|
+
cache;
|
|
12006
|
+
async status({ refresh = false } = {}) {
|
|
12007
|
+
const located = await locateClaudeCli(this.environment());
|
|
12008
|
+
if (!("path" in located)) {
|
|
12009
|
+
return failure(located.problem, located.message);
|
|
12010
|
+
}
|
|
12011
|
+
let identity;
|
|
12012
|
+
try {
|
|
12013
|
+
const file = await stat(located.path);
|
|
12014
|
+
identity = [located.path, file.dev, file.ino, file.mtimeMs].join("\0");
|
|
12015
|
+
} catch (error) {
|
|
12016
|
+
return failure(
|
|
12017
|
+
"unlaunchable",
|
|
12018
|
+
`Claude Code at ${located.path} could not be read: ${error instanceof Error ? error.message : String(error)}.`,
|
|
12019
|
+
{ path: located.path }
|
|
12020
|
+
);
|
|
12021
|
+
}
|
|
12022
|
+
const now = Date.now();
|
|
12023
|
+
if (!refresh && this.cache?.identity === identity && this.cache.expires > now) {
|
|
12024
|
+
return this.cache.status;
|
|
12025
|
+
}
|
|
12026
|
+
const status = this.validate(located.path);
|
|
12027
|
+
const entry = { identity, expires: now + FRESH_MS, status };
|
|
12028
|
+
this.cache = entry;
|
|
12029
|
+
const shorten = () => {
|
|
12030
|
+
entry.expires = now + FAILED_FRESH_MS;
|
|
12031
|
+
};
|
|
12032
|
+
status.then((result) => !result.ready && shorten(), shorten);
|
|
12033
|
+
return status;
|
|
12034
|
+
}
|
|
12035
|
+
/** The validated executable's path; throws the readiness message when unsupported. */
|
|
12036
|
+
async executable() {
|
|
12037
|
+
const status = await this.status();
|
|
12038
|
+
if (!status.ready) throw new Error(status.message);
|
|
12039
|
+
return status.path;
|
|
12040
|
+
}
|
|
11174
12041
|
};
|
|
11175
|
-
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
|
|
12042
|
+
|
|
12043
|
+
// src/service/features/providers/claude/configuration/upgrade.ts
|
|
12044
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12045
|
+
import { constants as constants2 } from "node:fs";
|
|
12046
|
+
import { access as access2, stat as stat2 } from "node:fs/promises";
|
|
12047
|
+
import { homedir } from "node:os";
|
|
12048
|
+
import { dirname, join as join3, resolve as resolve2 } from "node:path";
|
|
12049
|
+
var quote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
|
|
12050
|
+
async function executable(path) {
|
|
12051
|
+
try {
|
|
12052
|
+
await access2(path, constants2.X_OK);
|
|
12053
|
+
return (await stat2(path)).isFile();
|
|
12054
|
+
} catch {
|
|
12055
|
+
return false;
|
|
12056
|
+
}
|
|
12057
|
+
}
|
|
12058
|
+
async function claudeUpgradeInfo(selected, environment = {
|
|
12059
|
+
env: process.env,
|
|
12060
|
+
platform: process.platform
|
|
12061
|
+
}, home = homedir()) {
|
|
12062
|
+
const unknown2 = {
|
|
12063
|
+
installation: "Unidentified",
|
|
12064
|
+
note: "Use the installer or package manager that provided this executable. The service cannot determine a command that targets this installation."
|
|
11181
12065
|
};
|
|
11182
|
-
|
|
11183
|
-
if (session) {
|
|
12066
|
+
if (!selected) {
|
|
11184
12067
|
return {
|
|
11185
|
-
...
|
|
11186
|
-
note: "
|
|
11187
|
-
text: session.reason === "no_session" ? "New session: the task had none to continue" : "New session: the earlier one couldn't continue"
|
|
12068
|
+
...unknown2,
|
|
12069
|
+
note: "Fix the CLI readiness issue, then recheck to identify its installation."
|
|
11188
12070
|
};
|
|
11189
12071
|
}
|
|
11190
|
-
|
|
11191
|
-
|
|
12072
|
+
if (environment.platform === "win32") return unknown2;
|
|
12073
|
+
const located = await locateClaudeCli(environment);
|
|
12074
|
+
if (!("path" in located) || located.path !== selected) {
|
|
11192
12075
|
return {
|
|
11193
|
-
...
|
|
11194
|
-
note: "
|
|
11195
|
-
text: worktree.from === "base" ? "Worktree recreated from the base commit, since its branch was deleted" : "Worktree recreated from its branch"
|
|
12076
|
+
...unknown2,
|
|
12077
|
+
note: "The selected executable changed while checking. Recheck its version before choosing an upgrade command."
|
|
11196
12078
|
};
|
|
11197
12079
|
}
|
|
11198
|
-
const
|
|
11199
|
-
|
|
12080
|
+
const pinned = "This uses a custom launcher or a version-specific path. Updating may leave that path on the old version. Use the installer's launcher, update the configured path if needed, then restart the service.";
|
|
12081
|
+
const brew = /^(.*)\/Caskroom\/(claude-code(?:@latest)?)\/[^/]+\/claude$/.exec(selected);
|
|
12082
|
+
if (brew) {
|
|
12083
|
+
const prefix = brew[1], cask = brew[2], manager = join3(prefix, "bin", "brew");
|
|
12084
|
+
const installation = cask === "claude-code@latest" ? "Homebrew (latest)" : "Homebrew (stable)";
|
|
12085
|
+
if (resolve2(located.launcher) !== join3(prefix, "bin", "claude")) {
|
|
12086
|
+
return { installation, note: pinned };
|
|
12087
|
+
}
|
|
12088
|
+
if (!await executable(manager)) {
|
|
12089
|
+
return {
|
|
12090
|
+
installation,
|
|
12091
|
+
note: "The matching Homebrew executable is unavailable. Restore Homebrew for this prefix, or use its installation guidance."
|
|
12092
|
+
};
|
|
12093
|
+
}
|
|
11200
12094
|
return {
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
12095
|
+
installation,
|
|
12096
|
+
command: `${quote(manager)} upgrade --cask ${cask}`,
|
|
12097
|
+
note: "Run in a terminal after delegated turns finish. This keeps the installed cask and release channel."
|
|
11204
12098
|
};
|
|
11205
12099
|
}
|
|
11206
|
-
|
|
11207
|
-
|
|
12100
|
+
const versions = join3(home, ".local", "share", "claude", "versions"), launcher = join3(home, ".local", "bin", "claude");
|
|
12101
|
+
if (dirname(selected) === versions && /^\d+\.\d+\.\d+$/.test(selected.slice(versions.length + 1))) {
|
|
12102
|
+
if (resolve2(located.launcher) !== launcher) {
|
|
12103
|
+
return { installation: "Native installer", note: pinned };
|
|
12104
|
+
}
|
|
12105
|
+
return {
|
|
12106
|
+
installation: "Native installer",
|
|
12107
|
+
command: `${quote(launcher)} update`,
|
|
12108
|
+
note: "Run in a terminal after delegated turns finish. Claude's updater follows its configured release channel and policy."
|
|
12109
|
+
};
|
|
11208
12110
|
}
|
|
11209
|
-
if (
|
|
11210
|
-
return {
|
|
12111
|
+
if (/\/node_modules\/@anthropic-ai\/claude-code(?:-[^/]+)?\//.test(selected)) {
|
|
12112
|
+
return {
|
|
12113
|
+
installation: "Node package",
|
|
12114
|
+
note: "Use the original package manager, installation prefix and release channel. The executable path alone cannot establish whether this is a global npm install or a project dependency."
|
|
12115
|
+
};
|
|
11211
12116
|
}
|
|
11212
|
-
return
|
|
12117
|
+
return unknown2;
|
|
11213
12118
|
}
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
12119
|
+
|
|
12120
|
+
// src/service/platform/service/build-info.ts
|
|
12121
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12122
|
+
import { execFileSync } from "node:child_process";
|
|
12123
|
+
import { existsSync, readFileSync as readFileSync2 } from "node:fs";
|
|
12124
|
+
import { join as join4 } from "node:path";
|
|
12125
|
+
function collectBuildInfo(root) {
|
|
12126
|
+
const version = (path) => JSON.parse(readFileSync2(path, "utf8")).version;
|
|
12127
|
+
const info = {
|
|
12128
|
+
version: version(join4(root, "package.json")),
|
|
12129
|
+
sdks: [
|
|
12130
|
+
"@anthropic-ai/claude-agent-sdk",
|
|
12131
|
+
"@modelcontextprotocol/sdk",
|
|
12132
|
+
"@modelcontextprotocol/ext-apps"
|
|
12133
|
+
].map((name) => ({
|
|
12134
|
+
name,
|
|
12135
|
+
version: version(join4(root, "node_modules", name, "package.json"))
|
|
12136
|
+
}))
|
|
11229
12137
|
};
|
|
11230
|
-
|
|
11231
|
-
const
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
};
|
|
11244
|
-
items.push(outcome);
|
|
11245
|
-
failedOutcome = outcome.outcome === "failed" ? outcome : void 0;
|
|
11246
|
-
} else if (eventPayload(e, "task.failed")) {
|
|
11247
|
-
if (failedOutcome) {
|
|
11248
|
-
failedOutcome.error = scalarText(eventPayload(e, "task.failed")?.error);
|
|
11249
|
-
failedOutcome.event_id = e.id;
|
|
11250
|
-
} else {
|
|
11251
|
-
flush(e.id);
|
|
11252
|
-
items.push(note(e));
|
|
11253
|
-
}
|
|
11254
|
-
failedOutcome = void 0;
|
|
11255
|
-
} else {
|
|
11256
|
-
if (eventPayload(e, "task.instruction") !== void 0 || eventPayload(e, "task.queued") !== void 0 || eventPayload(e, "task.started") !== void 0) {
|
|
11257
|
-
failedOutcome = void 0;
|
|
11258
|
-
}
|
|
11259
|
-
const marker = note(e);
|
|
11260
|
-
if (marker) {
|
|
11261
|
-
flush(e.id);
|
|
11262
|
-
items.push(marker);
|
|
11263
|
-
}
|
|
12138
|
+
if (existsSync(join4(root, ".git"))) {
|
|
12139
|
+
const git = (...args) => execFileSync("git", ["-C", root, ...args], {
|
|
12140
|
+
encoding: "utf8",
|
|
12141
|
+
timeout: 2e3,
|
|
12142
|
+
maxBuffer: 1024 * 1024,
|
|
12143
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
12144
|
+
}).trim();
|
|
12145
|
+
try {
|
|
12146
|
+
info.commit = git("rev-parse", "HEAD");
|
|
12147
|
+
info.dirty = Boolean(
|
|
12148
|
+
git("status", "--porcelain", "--untracked-files=normal")
|
|
12149
|
+
);
|
|
12150
|
+
} catch {
|
|
11264
12151
|
}
|
|
11265
12152
|
}
|
|
11266
|
-
|
|
11267
|
-
return items;
|
|
12153
|
+
return info;
|
|
11268
12154
|
}
|
|
11269
12155
|
|
|
11270
|
-
// src/
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
12156
|
+
// src/service/platform/service/identity.ts
|
|
12157
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12158
|
+
var import_compare2 = __toESM(require_compare(), 1);
|
|
12159
|
+
var serviceApiVersion = 2;
|
|
12160
|
+
var launcherEnv = "SUBAGENT_EXTENSION_FOR_CODEX_LAUNCHER";
|
|
12161
|
+
function serviceIdentity(env = process.env) {
|
|
12162
|
+
return {
|
|
12163
|
+
version: packageVersion,
|
|
12164
|
+
apiVersion: serviceApiVersion,
|
|
12165
|
+
launcher: env[launcherEnv] === "stdio" ? "stdio" : "foreground",
|
|
12166
|
+
installRoot
|
|
11280
12167
|
};
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
|
|
11287
|
-
|
|
11288
|
-
|
|
11289
|
-
);
|
|
11290
|
-
return { revision: store.revision(owner) };
|
|
11291
|
-
}
|
|
11292
|
-
const draft = store.find(target.task_id, owner) && await drafts.wait(
|
|
11293
|
-
target.task_id,
|
|
11294
|
-
{ message_id: target.message_id, length: target.after_length },
|
|
11295
|
-
waitMs,
|
|
11296
|
-
// A turn's end commits events, which change the revision and end this.
|
|
11297
|
-
changed.signal
|
|
11298
|
-
);
|
|
11299
|
-
const task = store.find(target.task_id, owner);
|
|
11300
|
-
return {
|
|
11301
|
-
revision: store.revision(owner),
|
|
11302
|
-
draft: task && draft || null,
|
|
11303
|
-
running: task ? RUNNING.includes(task.status) : false
|
|
12168
|
+
}
|
|
12169
|
+
function handoff(running, own2, origin) {
|
|
12170
|
+
const compatible = running.apiVersion === own2.apiVersion;
|
|
12171
|
+
const described2 = `version ${running.version ?? "unknown"}`;
|
|
12172
|
+
if (running.launcher !== "stdio") {
|
|
12173
|
+
return compatible ? { action: "use" } : {
|
|
12174
|
+
action: "refuse",
|
|
12175
|
+
message: `A different extension service (${described2}, not started by the plugin) is running at ${origin}. Stop it, or give development its own SUBAGENT_EXTENSION_FOR_CODEX_DATA and PORT.`
|
|
11304
12176
|
};
|
|
11305
|
-
} finally {
|
|
11306
|
-
store.bus.off("change", onChange);
|
|
11307
12177
|
}
|
|
12178
|
+
const order = running.version ? (0, import_compare2.default)(running.version, own2.version) : -1;
|
|
12179
|
+
if (order > 0) {
|
|
12180
|
+
return compatible ? { action: "use" } : {
|
|
12181
|
+
action: "refuse",
|
|
12182
|
+
message: `A newer extension service (${described2}) is running at ${origin}; update the plugin to ${running.version} or later.`
|
|
12183
|
+
};
|
|
12184
|
+
}
|
|
12185
|
+
if (order < 0 || !running.installed || !compatible) {
|
|
12186
|
+
return { action: "replace", forward: compatible };
|
|
12187
|
+
}
|
|
12188
|
+
return { action: "use" };
|
|
12189
|
+
}
|
|
12190
|
+
|
|
12191
|
+
// src/service/platform/service/about.ts
|
|
12192
|
+
var build = typeof define_EXTENSION_BUILD_INFO_default === "undefined" ? collectBuildInfo(installRoot) : define_EXTENSION_BUILD_INFO_default;
|
|
12193
|
+
async function aboutInfo(c, refresh = false) {
|
|
12194
|
+
const claude = await c.providers.get("claude")?.readiness?.({ refresh }), version = claude?.details.version, upgrade = claude ? await claudeUpgradeInfo(version ? claude.details.executable : void 0) : void 0;
|
|
12195
|
+
if (refresh) {
|
|
12196
|
+
logEvent("info", "about.claude_rechecked", {
|
|
12197
|
+
ready: claude?.ready,
|
|
12198
|
+
problem: claude?.details.problem,
|
|
12199
|
+
version,
|
|
12200
|
+
executable: claude?.details.executable,
|
|
12201
|
+
installation: upgrade?.installation
|
|
12202
|
+
});
|
|
12203
|
+
}
|
|
12204
|
+
return {
|
|
12205
|
+
build,
|
|
12206
|
+
installation: existsSync2(packagePath("src", "service", "main.ts")) ? "checkout" : "package",
|
|
12207
|
+
runtime: {
|
|
12208
|
+
node: process.versions.node,
|
|
12209
|
+
platform: process.platform,
|
|
12210
|
+
arch: process.arch,
|
|
12211
|
+
launcher: serviceIdentity().launcher
|
|
12212
|
+
},
|
|
12213
|
+
claude,
|
|
12214
|
+
claude_recommended: version ? {
|
|
12215
|
+
version: claudeCliSupport.paired,
|
|
12216
|
+
behind: (0, import_compare3.default)(version, claudeCliSupport.paired) < 0
|
|
12217
|
+
} : void 0,
|
|
12218
|
+
claude_upgrade: upgrade
|
|
12219
|
+
};
|
|
11308
12220
|
}
|
|
11309
12221
|
|
|
11310
12222
|
// src/service/platform/server/tools/activity-tools.ts
|
|
12223
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11311
12224
|
function activityTools(c, owner) {
|
|
11312
12225
|
return {
|
|
11313
12226
|
app_get_change_counts: tool({
|
|
@@ -11329,20 +12242,9 @@ function activityTools(c, owner) {
|
|
|
11329
12242
|
return original === void 0 ? { available: false } : { available: true, original };
|
|
11330
12243
|
}
|
|
11331
12244
|
}),
|
|
11332
|
-
app_get_activity: tool({
|
|
11333
|
-
readOnly: true,
|
|
11334
|
-
description: "User interface only: a task's activity for the panel's Activity tab: its newest events after a cursor, and a tally of the older events outside the window (the summary's count, timestamps, tool calls, messages, failures and retries).",
|
|
11335
|
-
schema: taskId.extend({
|
|
11336
|
-
after: external_exports.number().int().nonnegative().default(0)
|
|
11337
|
-
}),
|
|
11338
|
-
run: (a) => {
|
|
11339
|
-
c.store.get(a.task_id, owner);
|
|
11340
|
-
return c.activity.page(a.task_id, a.after);
|
|
11341
|
-
}
|
|
11342
|
-
}),
|
|
11343
12245
|
app_get_turn_activity: tool({
|
|
11344
12246
|
readOnly: true,
|
|
11345
|
-
description: "User interface only: one turn's activity for the panel's Activity tab: the events after the previous turn's closing status event through this turn's, or to the newest event while the turn runs. Its newest events come with a tally of the older ones, as
|
|
12247
|
+
description: "User interface only: one turn's activity for the panel's Activity tab: the events after the previous turn's closing status event through this turn's, or to the newest event while the turn runs. Its newest events come with a tally of the older ones, as a view's Activity gives them.",
|
|
11346
12248
|
schema: taskId.extend({ turn: external_exports.number().int().positive() }),
|
|
11347
12249
|
run: (a) => {
|
|
11348
12250
|
c.store.get(a.task_id, owner);
|
|
@@ -11352,7 +12254,11 @@ function activityTools(c, owner) {
|
|
|
11352
12254
|
};
|
|
11353
12255
|
}
|
|
11354
12256
|
|
|
12257
|
+
// src/service/platform/server/tools/panel-timing-tool.ts
|
|
12258
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12259
|
+
|
|
11355
12260
|
// src/shared/tasks/panel-timing.ts
|
|
12261
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11356
12262
|
var timedOperations = ["app_send_message", "interrupt_task"];
|
|
11357
12263
|
var taskIdPattern = /^task_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
11358
12264
|
var panelRequestIdPattern = /^[0-9a-f]{32}$/;
|
|
@@ -11371,8 +12277,8 @@ var PANEL_TIMING_MAX_DURATION_MS = 1e12;
|
|
|
11371
12277
|
var workCount = external_exports.number().int().nonnegative().max(PANEL_TIMING_MAX_COUNT);
|
|
11372
12278
|
var elapsed = external_exports.number().nonnegative().max(PANEL_TIMING_MAX_DURATION_MS);
|
|
11373
12279
|
var panelLoadTimingRecordSchema = external_exports.strictObject({
|
|
11374
|
-
operation: external_exports.enum(["
|
|
11375
|
-
phase: external_exports.enum(["fetch", "decode", "merge", "group"]),
|
|
12280
|
+
operation: external_exports.enum(["view", "task_list", "activity_latest", "activity_turn"]),
|
|
12281
|
+
phase: external_exports.enum(["fetch", "deliver", "decode", "merge", "group"]),
|
|
11376
12282
|
count: workCount.positive(),
|
|
11377
12283
|
total_ms: elapsed,
|
|
11378
12284
|
max_ms: elapsed,
|
|
@@ -11391,6 +12297,7 @@ var panelTimingBatchSchema = external_exports.strictObject({
|
|
|
11391
12297
|
});
|
|
11392
12298
|
|
|
11393
12299
|
// src/service/features/tasks/runtime/timing.ts
|
|
12300
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11394
12301
|
import { createHash } from "node:crypto";
|
|
11395
12302
|
var writer;
|
|
11396
12303
|
var previousWrites = Promise.resolve();
|
|
@@ -11494,7 +12401,33 @@ function panelTimingTool() {
|
|
|
11494
12401
|
});
|
|
11495
12402
|
}
|
|
11496
12403
|
|
|
12404
|
+
// src/service/platform/server/tools/panel-view-tools.ts
|
|
12405
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12406
|
+
|
|
12407
|
+
// src/shared/tasks/conversation/drafts.ts
|
|
12408
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12409
|
+
var MAX_UPDATE_WAIT_MS = 25e3;
|
|
12410
|
+
|
|
12411
|
+
// src/service/features/tasks/conversation/chat-read.ts
|
|
12412
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12413
|
+
function chatRead(store, attachments, task, after) {
|
|
12414
|
+
const events = store.chatEvents(task.id, after);
|
|
12415
|
+
const items = chatItems(task, events).filter(
|
|
12416
|
+
(item) => item.event_id > after || after === 0 && item.event_id === 0
|
|
12417
|
+
);
|
|
12418
|
+
const request = items[0];
|
|
12419
|
+
if (after === 0 && request?.kind === "message") {
|
|
12420
|
+
const attached = attachments.list(task.id).map(({ file: _2, ...a }) => a);
|
|
12421
|
+
if (attached.length) request.message.attachments = attached;
|
|
12422
|
+
}
|
|
12423
|
+
return { items, next_cursor: Math.max(after, events.at(-1)?.id ?? 0) };
|
|
12424
|
+
}
|
|
12425
|
+
|
|
12426
|
+
// src/service/features/tasks/conversation/parent-updates.ts
|
|
12427
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12428
|
+
|
|
11497
12429
|
// src/shared/tasks/conversation/parent-updates.ts
|
|
12430
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11498
12431
|
var PARENT_UPDATE_EVENTS = [
|
|
11499
12432
|
"agent.reply",
|
|
11500
12433
|
"task.failed",
|
|
@@ -11521,11 +12454,13 @@ function parentUpdate(task, e, parentDecides) {
|
|
|
11521
12454
|
}
|
|
11522
12455
|
const failed = eventPayload(e, "task.failed");
|
|
11523
12456
|
if (failed) {
|
|
11524
|
-
const error = failed.error ?? "The task failed.";
|
|
11525
12457
|
return {
|
|
11526
12458
|
...base,
|
|
11527
|
-
kind:
|
|
11528
|
-
text: replyExcerpt(
|
|
12459
|
+
kind: isBudgetFailure(failed.error_code) ? "budget" : "failed",
|
|
12460
|
+
text: replyExcerpt(
|
|
12461
|
+
failureMessage(failed) ?? "The task failed.",
|
|
12462
|
+
SNIPPET_CHARS
|
|
12463
|
+
)
|
|
11529
12464
|
};
|
|
11530
12465
|
}
|
|
11531
12466
|
const request = eventPayload(e, "agent.input_required")?.request;
|
|
@@ -11565,23 +12500,154 @@ function pendingUpdates(store, seen, parentDecides, owner, conversation2) {
|
|
|
11565
12500
|
return [...byTask.values()];
|
|
11566
12501
|
}
|
|
11567
12502
|
|
|
11568
|
-
// src/service/
|
|
11569
|
-
|
|
12503
|
+
// src/service/features/tasks/conversation/updates.ts
|
|
12504
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12505
|
+
import { setTimeout as sleep } from "node:timers/promises";
|
|
12506
|
+
var RUNNING = ["queued", "starting", "running", "waiting"];
|
|
12507
|
+
async function waitForUpdates(store, drafts, owner, { after, draft: target, wait_ms }, view) {
|
|
12508
|
+
const changed = new AbortController();
|
|
12509
|
+
const known = target && {
|
|
12510
|
+
task_id: target.task_id,
|
|
12511
|
+
message_id: target.message_id,
|
|
12512
|
+
length: target.after_length
|
|
12513
|
+
};
|
|
12514
|
+
const onChange = (changedOwner) => {
|
|
12515
|
+
if (changedOwner === void 0 || changedOwner === owner) changed.abort();
|
|
12516
|
+
};
|
|
12517
|
+
store.bus.on("change", onChange);
|
|
12518
|
+
try {
|
|
12519
|
+
const waitMs = after === store.revision(owner) ? wait_ms : 0;
|
|
12520
|
+
if (!known) {
|
|
12521
|
+
await sleep(waitMs, void 0, { signal: changed.signal }).catch(
|
|
12522
|
+
() => {
|
|
12523
|
+
}
|
|
12524
|
+
// A change ended the wait.
|
|
12525
|
+
);
|
|
12526
|
+
} else if (store.find(known.task_id, owner)) {
|
|
12527
|
+
await drafts.wait(known.task_id, known, waitMs, changed.signal);
|
|
12528
|
+
}
|
|
12529
|
+
} finally {
|
|
12530
|
+
store.bus.off("change", onChange);
|
|
12531
|
+
}
|
|
12532
|
+
const readView = await view?.();
|
|
12533
|
+
const revision = store.revision(owner);
|
|
12534
|
+
if (!known) return { revision, ...readView && { view: readView() } };
|
|
12535
|
+
const task = store.find(known.task_id, owner);
|
|
12536
|
+
const draftOnly = revision === after && !!task && drafts.differs(task.id, known);
|
|
12537
|
+
return {
|
|
12538
|
+
revision,
|
|
12539
|
+
draft: (task && drafts.get(task.id)) ?? null,
|
|
12540
|
+
running: task ? RUNNING.includes(task.status) : false,
|
|
12541
|
+
...readView && !draftOnly && { view: readView() }
|
|
12542
|
+
};
|
|
12543
|
+
}
|
|
12544
|
+
|
|
12545
|
+
// src/service/platform/server/tools/panel-view-tools.ts
|
|
12546
|
+
function panelViewTools(c, owner) {
|
|
12547
|
+
const list = tool({
|
|
12548
|
+
readOnly: true,
|
|
12549
|
+
description: "User interface only: { tasks, read_completed }, the tasks the panel lists, newest first. Each has its full state except the conversation, with its latest reply excerpt, live activity, draft, read state and archive time. include names tasks to list whatever the filters say. Unless include_read_completed is true, completed tasks the user has read are left out, except included ones and the newest, and read_completed counts them by repository.",
|
|
12550
|
+
schema: external_exports.object({
|
|
12551
|
+
conversation_id: external_exports.string().nullable().optional(),
|
|
12552
|
+
repository: external_exports.string().optional(),
|
|
12553
|
+
archived: archivedFilter,
|
|
12554
|
+
include: external_exports.array(external_exports.string()).max(10).optional(),
|
|
12555
|
+
include_read_completed: external_exports.boolean().default(false)
|
|
12556
|
+
}),
|
|
12557
|
+
run: (a) => panelTaskList(
|
|
12558
|
+
c,
|
|
12559
|
+
owner,
|
|
12560
|
+
{
|
|
12561
|
+
conversation: a.conversation_id || void 0,
|
|
12562
|
+
repository: a.repository || void 0,
|
|
12563
|
+
archived: a.archived,
|
|
12564
|
+
include: a.include
|
|
12565
|
+
},
|
|
12566
|
+
a.include_read_completed
|
|
12567
|
+
)
|
|
12568
|
+
});
|
|
12569
|
+
const cursor = taskId.extend({
|
|
12570
|
+
after: external_exports.number().int().nonnegative().default(0)
|
|
12571
|
+
});
|
|
12572
|
+
const view = external_exports.strictObject({
|
|
12573
|
+
list: list.schema,
|
|
12574
|
+
chat: cursor.optional(),
|
|
12575
|
+
activity: cursor.optional(),
|
|
12576
|
+
pending: external_exports.strictObject({ conversation_id: external_exports.string().min(1) }).optional()
|
|
12577
|
+
});
|
|
12578
|
+
const readView = async (parts) => {
|
|
12579
|
+
const known = await c.projects?.listWithGit() ?? [];
|
|
12580
|
+
const { chat, activity, pending: pending2 } = parts;
|
|
12581
|
+
return () => c.store.reads.measure("view", (work) => {
|
|
12582
|
+
const chatTask = chat && c.store.find(chat.task_id, owner);
|
|
12583
|
+
const activityTask = activity && c.store.find(activity.task_id, owner);
|
|
12584
|
+
const read2 = {
|
|
12585
|
+
projects: c.projects?.withKnownGit(known) ?? [],
|
|
12586
|
+
list: list.run(parts.list),
|
|
12587
|
+
...chat && chatTask && {
|
|
12588
|
+
chat: chatRead(c.store, c.attachments, chatTask, chat.after)
|
|
12589
|
+
},
|
|
12590
|
+
...activity && activityTask && {
|
|
12591
|
+
activity: c.activity.page(activityTask.id, activity.after)
|
|
12592
|
+
},
|
|
12593
|
+
...pending2 && {
|
|
12594
|
+
pending: {
|
|
12595
|
+
tasks: pendingUpdates(
|
|
12596
|
+
c.store,
|
|
12597
|
+
c.parentSeen,
|
|
12598
|
+
(t) => c.providers.get(t.provider)?.taskPolicy.parentMayApprove(t) ?? false,
|
|
12599
|
+
owner,
|
|
12600
|
+
pending2.conversation_id
|
|
12601
|
+
)
|
|
12602
|
+
}
|
|
12603
|
+
}
|
|
12604
|
+
};
|
|
12605
|
+
work.rows = read2.list.tasks.length;
|
|
12606
|
+
return { ...read2, built_at: Date.now() };
|
|
12607
|
+
});
|
|
12608
|
+
};
|
|
11570
12609
|
return {
|
|
11571
|
-
|
|
12610
|
+
app_list_tasks: list,
|
|
12611
|
+
app_get_attachment: tool({
|
|
11572
12612
|
readOnly: true,
|
|
11573
|
-
description: "User interface only:
|
|
11574
|
-
schema:
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
|
|
11578
|
-
|
|
11579
|
-
|
|
11580
|
-
|
|
11581
|
-
|
|
11582
|
-
|
|
11583
|
-
})
|
|
12613
|
+
description: "User interface only: a page of a task's attachment, by its position in the request, with the attachment's metadata. state is unavailable when its stored file is missing, too large or not UTF-8 text. Pass next_cursor for more content.",
|
|
12614
|
+
schema: taskId.extend({
|
|
12615
|
+
position: external_exports.number().int().positive(),
|
|
12616
|
+
cursor: external_exports.string().max(100).optional()
|
|
12617
|
+
}),
|
|
12618
|
+
run: (a) => c.attachments.page(
|
|
12619
|
+
c.store.get(a.task_id, owner).id,
|
|
12620
|
+
a.position,
|
|
12621
|
+
a.cursor
|
|
12622
|
+
)
|
|
11584
12623
|
}),
|
|
12624
|
+
app_wait_for_updates: tool({
|
|
12625
|
+
readOnly: true,
|
|
12626
|
+
description: `User interface only: waits for something the panel should show. It returns the owner's current revision as soon as it differs from after, and with a draft target, as soon as that task's draft grows past after_length, becomes another message or clears; otherwise after wait_ms (at most ${MAX_UPDATE_WAIT_MS}). Without after, or with wait_ms 0, it returns at once, so it also reads a draft. A revision is boot:count, and the count only grows within a boot. With view, it also returns view as of the returned revision, with built_at in epoch milliseconds. Its projects are as list_projects returns them, and its list takes app_list_tasks arguments and returns that shape. chat { items, next_cursor } is a task's Chat after a cursor: its messages, an outcome row for each turn's end, and notes for a new session, a recreated worktree and compaction. Cursor 0 also returns the request with its attachments. An item read again replaces the earlier one with its id. activity { events, dropped } holds a task's newest Activity events after a cursor, with a tally of the older events outside the window. pending { tasks } lists the worker updates Codex hasn't seen in a conversation, grouped by task and newest first: turn replies, failures, budget stops and requests Codex may answer, leaving out archived tasks. The wait leaves view out when only the draft changed, and leaves out chat and activity for a task the owner doesn't have.`,
|
|
12627
|
+
schema: external_exports.strictObject({
|
|
12628
|
+
after: external_exports.string().max(200).optional(),
|
|
12629
|
+
draft: taskId.extend({
|
|
12630
|
+
message_id: external_exports.string().max(200).optional(),
|
|
12631
|
+
after_length: external_exports.number().int().nonnegative().default(0)
|
|
12632
|
+
}).strict().optional(),
|
|
12633
|
+
wait_ms: external_exports.number().int().min(0).max(MAX_UPDATE_WAIT_MS).default(0),
|
|
12634
|
+
view: view.optional()
|
|
12635
|
+
}),
|
|
12636
|
+
run: ({ view: parts, ...a }) => waitForUpdates(
|
|
12637
|
+
c.store,
|
|
12638
|
+
c.drafts,
|
|
12639
|
+
owner,
|
|
12640
|
+
a,
|
|
12641
|
+
parts && (() => readView(parts))
|
|
12642
|
+
)
|
|
12643
|
+
})
|
|
12644
|
+
};
|
|
12645
|
+
}
|
|
12646
|
+
|
|
12647
|
+
// src/service/platform/server/tools/pending-update-tools.ts
|
|
12648
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12649
|
+
function pendingUpdateTools(c, owner) {
|
|
12650
|
+
return {
|
|
11585
12651
|
app_mark_updates_seen: tool({
|
|
11586
12652
|
description: "User interface only: record worker updates as seen by Codex, by event, so they no longer count as pending.",
|
|
11587
12653
|
schema: external_exports.strictObject({
|
|
@@ -11595,10 +12661,14 @@ function pendingUpdateTools(c, owner) {
|
|
|
11595
12661
|
};
|
|
11596
12662
|
}
|
|
11597
12663
|
|
|
12664
|
+
// src/service/platform/server/tools/project-tools.ts
|
|
12665
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12666
|
+
|
|
11598
12667
|
// src/service/features/projects/project-picker.ts
|
|
11599
|
-
|
|
11600
|
-
import {
|
|
11601
|
-
|
|
12668
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12669
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
12670
|
+
import { promisify as promisify2 } from "node:util";
|
|
12671
|
+
var execute = promisify2(execFile2);
|
|
11602
12672
|
var script = `try
|
|
11603
12673
|
set selectedFolder to choose folder with prompt "Choose a folder to add to Delegated Work"
|
|
11604
12674
|
return POSIX path of selectedFolder
|
|
@@ -11606,8 +12676,8 @@ on error number -128
|
|
|
11606
12676
|
return ""
|
|
11607
12677
|
end try`;
|
|
11608
12678
|
var pending = false;
|
|
11609
|
-
async function browseProject(
|
|
11610
|
-
if (
|
|
12679
|
+
async function browseProject(options2 = { platform: process.platform, execute }) {
|
|
12680
|
+
if (options2.platform !== "darwin") {
|
|
11611
12681
|
throw new Error(
|
|
11612
12682
|
"Folder browsing is available on macOS. Enter an absolute folder path instead."
|
|
11613
12683
|
);
|
|
@@ -11617,7 +12687,7 @@ async function browseProject(options3 = { platform: process.platform, execute })
|
|
|
11617
12687
|
}
|
|
11618
12688
|
pending = true;
|
|
11619
12689
|
try {
|
|
11620
|
-
const { stdout } = await
|
|
12690
|
+
const { stdout } = await options2.execute(
|
|
11621
12691
|
"/usr/bin/osascript",
|
|
11622
12692
|
["-e", script],
|
|
11623
12693
|
{
|
|
@@ -11666,22 +12736,37 @@ function projectTools(c, owner) {
|
|
|
11666
12736
|
}
|
|
11667
12737
|
}),
|
|
11668
12738
|
app_remove_project: tool({
|
|
11669
|
-
description: "User interface only: remove a saved project approval. Optionally stop and delete this user's project tasks, history and task worktrees
|
|
12739
|
+
description: "User interface only: remove a saved project approval. Optionally stop and delete this user's project tasks, history and task worktrees and local branches, and with delete_agent_task their provider sessions. Checkout files stay intact.",
|
|
11670
12740
|
schema: external_exports.strictObject({
|
|
11671
12741
|
repository: external_exports.string().min(1).max(4096),
|
|
11672
|
-
delete_tasks: external_exports.boolean().default(false)
|
|
11673
|
-
|
|
12742
|
+
delete_tasks: external_exports.boolean().default(false),
|
|
12743
|
+
delete_agent_task: external_exports.boolean().default(false),
|
|
12744
|
+
confirmation: external_exports.string().regex(/^[0-9a-f]{64}$/).optional()
|
|
12745
|
+
}).refine(
|
|
12746
|
+
(a) => !a.delete_tasks || !!a.confirmation,
|
|
12747
|
+
"Review the task removal list before deleting project task data."
|
|
12748
|
+
).refine(
|
|
12749
|
+
(a) => a.delete_tasks || !a.delete_agent_task,
|
|
12750
|
+
"Provider sessions are removed only with project task data."
|
|
12751
|
+
),
|
|
11674
12752
|
run: (a) => {
|
|
11675
12753
|
if (!c.projects) {
|
|
11676
12754
|
throw new Error("Project management is unavailable in this service.");
|
|
11677
12755
|
}
|
|
11678
|
-
return c.removeProject(
|
|
12756
|
+
return c.removeProject(
|
|
12757
|
+
owner,
|
|
12758
|
+
a.repository,
|
|
12759
|
+
a.delete_tasks,
|
|
12760
|
+
a.confirmation,
|
|
12761
|
+
a.delete_agent_task
|
|
12762
|
+
);
|
|
11679
12763
|
}
|
|
11680
12764
|
})
|
|
11681
12765
|
};
|
|
11682
12766
|
}
|
|
11683
12767
|
|
|
11684
12768
|
// src/service/platform/server/tools/queue-tools.ts
|
|
12769
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11685
12770
|
function queueTools(c, owner) {
|
|
11686
12771
|
return {
|
|
11687
12772
|
app_steer_queued_message: tool({
|
|
@@ -11733,12 +12818,17 @@ function queueTools(c, owner) {
|
|
|
11733
12818
|
};
|
|
11734
12819
|
}
|
|
11735
12820
|
|
|
12821
|
+
// src/service/platform/server/tools/settings-transfer-tools.ts
|
|
12822
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12823
|
+
|
|
11736
12824
|
// src/service/features/settings/settings-file.ts
|
|
12825
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11737
12826
|
import { writeFile } from "node:fs/promises";
|
|
11738
|
-
import { homedir } from "node:os";
|
|
11739
|
-
import { join as
|
|
12827
|
+
import { homedir as homedir2 } from "node:os";
|
|
12828
|
+
import { join as join5 } from "node:path";
|
|
11740
12829
|
|
|
11741
12830
|
// src/service/features/settings/settings-transfer.ts
|
|
12831
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11742
12832
|
var SETTINGS_FORMAT = 2;
|
|
11743
12833
|
var settingsTransferInputSchema = external_exports.strictObject({
|
|
11744
12834
|
document: external_exports.string().min(1).meta({
|
|
@@ -11807,7 +12897,7 @@ var settingsFileOutputSchema = external_exports.object({ path: external_exports.
|
|
|
11807
12897
|
async function saveSettingsFile(settings, owner) {
|
|
11808
12898
|
const { document: document2 } = exportSettings(settings, owner);
|
|
11809
12899
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/:/g, "-");
|
|
11810
|
-
const path =
|
|
12900
|
+
const path = join5(homedir2(), `delegated-work-settings-${timestamp}Z.json`);
|
|
11811
12901
|
await writeFile(path, `${document2}
|
|
11812
12902
|
`, {
|
|
11813
12903
|
encoding: "utf8",
|
|
@@ -11843,6 +12933,7 @@ function settingsTransferTools(settings, owner) {
|
|
|
11843
12933
|
}
|
|
11844
12934
|
|
|
11845
12935
|
// src/service/platform/server/tools/task-lifecycle-tools.ts
|
|
12936
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
11846
12937
|
function taskLifecycleTools(c, owner) {
|
|
11847
12938
|
return {
|
|
11848
12939
|
app_remove_worktree: tool({
|
|
@@ -11899,18 +12990,38 @@ function taskLifecycleTools(c, owner) {
|
|
|
11899
12990
|
}),
|
|
11900
12991
|
run: (a) => c.archive.setArchived(owner, a.task_ids, a.archived)
|
|
11901
12992
|
}),
|
|
12993
|
+
app_preview_task_deletion: tool({
|
|
12994
|
+
readOnly: true,
|
|
12995
|
+
description: "User interface only: list the exact task records, worktrees, branches and optional provider session files selected for deletion. Returns a confirmation tied to those resources. Show the resources to the user before app_delete_tasks.",
|
|
12996
|
+
// Keep an object root so the MCP SDK preserves the tool's input metadata.
|
|
12997
|
+
schema: external_exports.strictObject({
|
|
12998
|
+
task_ids: external_exports.array(external_exports.string()).min(1).max(1e3).optional(),
|
|
12999
|
+
repository: external_exports.string().min(1).max(4096).optional(),
|
|
13000
|
+
delete_agent_task: external_exports.boolean().default(false)
|
|
13001
|
+
}).refine(
|
|
13002
|
+
(a) => !!a.task_ids !== !!a.repository,
|
|
13003
|
+
"Choose task IDs or a project, not both."
|
|
13004
|
+
),
|
|
13005
|
+
run: (a) => c.taskDeletionPreview(
|
|
13006
|
+
owner,
|
|
13007
|
+
a.task_ids ?? [],
|
|
13008
|
+
a.delete_agent_task,
|
|
13009
|
+
a.repository
|
|
13010
|
+
)
|
|
13011
|
+
}),
|
|
11902
13012
|
app_delete_tasks: tool({
|
|
11903
13013
|
destructive: true,
|
|
11904
|
-
description: "User interface only: delete
|
|
13014
|
+
description: "User interface only: delete the tasks and resources reviewed with app_preview_task_deletion. Requires its confirmation and the same task IDs and delete_agent_task choice. Changed resources require a new preview. Running work stops first. This can't be undone.",
|
|
11905
13015
|
schema: external_exports.strictObject({
|
|
11906
13016
|
task_ids: external_exports.array(external_exports.string()).min(1).max(1e3),
|
|
11907
|
-
delete_agent_task: external_exports.boolean().default(false)
|
|
13017
|
+
delete_agent_task: external_exports.boolean().default(false),
|
|
13018
|
+
confirmation: external_exports.string().regex(/^[0-9a-f]{64}$/)
|
|
11908
13019
|
}),
|
|
11909
|
-
run: (a) => c.delete(owner, a.task_ids, a.delete_agent_task)
|
|
13020
|
+
run: (a) => c.delete(owner, a.task_ids, a.delete_agent_task, a.confirmation)
|
|
11910
13021
|
}),
|
|
11911
13022
|
app_delete_branch: tool({
|
|
11912
13023
|
destructive: true,
|
|
11913
|
-
description: "User interface only: delete a stopped worktree task's branch once its worktree is removed.",
|
|
13024
|
+
description: "User interface only: delete a stopped worktree task's local branch once its worktree is removed. Remote branches are not changed.",
|
|
11914
13025
|
schema: taskId,
|
|
11915
13026
|
run: (a) => c.deleteBranch(owner, a.task_id)
|
|
11916
13027
|
})
|
|
@@ -11920,6 +13031,12 @@ function taskLifecycleTools(c, owner) {
|
|
|
11920
13031
|
// src/service/platform/server/tools/user-tools.ts
|
|
11921
13032
|
function userTools({ c, owner, hostMeta }, tools) {
|
|
11922
13033
|
return {
|
|
13034
|
+
app_get_about: tool({
|
|
13035
|
+
readOnly: true,
|
|
13036
|
+
description: "User interface only: extension build, SDK versions and local runtime diagnostics.",
|
|
13037
|
+
schema: external_exports.object({ refresh: external_exports.boolean().default(false) }),
|
|
13038
|
+
run: ({ refresh }) => aboutInfo(c, refresh)
|
|
13039
|
+
}),
|
|
11923
13040
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Temporary feature gate.
|
|
11924
13041
|
...composerMentionsEnabled ? {
|
|
11925
13042
|
// The host's composer calls this. The HTTP and stdio servers register it
|
|
@@ -11970,36 +13087,7 @@ function userTools({ c, owner, hostMeta }, tools) {
|
|
|
11970
13087
|
return { budget: task.budget, status: task.status };
|
|
11971
13088
|
}
|
|
11972
13089
|
}),
|
|
11973
|
-
|
|
11974
|
-
readOnly: true,
|
|
11975
|
-
description: "User interface only: a task's Chat after a cursor: its messages, an outcome row for each turn's end, and notes for a new session, a recreated worktree and compaction. An item read again replaces the earlier one with its id.",
|
|
11976
|
-
schema: taskId.extend({
|
|
11977
|
-
after: external_exports.number().int().nonnegative().default(0)
|
|
11978
|
-
}),
|
|
11979
|
-
run: (a) => {
|
|
11980
|
-
const t = c.store.get(a.task_id, owner);
|
|
11981
|
-
const events = c.store.chatEvents(t.id, CHAT_EVENTS);
|
|
11982
|
-
return {
|
|
11983
|
-
items: chatItems(t, events).filter(
|
|
11984
|
-
(item) => item.event_id > a.after || a.after === 0 && item.event_id === 0
|
|
11985
|
-
),
|
|
11986
|
-
next_cursor: Math.max(a.after, events.at(-1)?.id ?? 0)
|
|
11987
|
-
};
|
|
11988
|
-
}
|
|
11989
|
-
}),
|
|
11990
|
-
app_wait_for_updates: tool({
|
|
11991
|
-
readOnly: true,
|
|
11992
|
-
description: `User interface only: waits for something the panel should show. It returns the owner's current revision as soon as it differs from after, and with a draft target, as soon as that task's draft grows past after_length, becomes another message or clears; otherwise after wait_ms (at most ${MAX_UPDATE_WAIT_MS}). Without after, or with wait_ms 0, it returns at once, so it also reads a draft. The revision is opaque: compare it only for equality.`,
|
|
11993
|
-
schema: external_exports.strictObject({
|
|
11994
|
-
after: external_exports.string().max(200).optional(),
|
|
11995
|
-
draft: taskId.extend({
|
|
11996
|
-
message_id: external_exports.string().max(200).optional(),
|
|
11997
|
-
after_length: external_exports.number().int().nonnegative().default(0)
|
|
11998
|
-
}).strict().optional(),
|
|
11999
|
-
wait_ms: external_exports.number().int().min(0).max(MAX_UPDATE_WAIT_MS).default(0)
|
|
12000
|
-
}),
|
|
12001
|
-
run: (a) => waitForUpdates(c.store, c.drafts, owner, a)
|
|
12002
|
-
}),
|
|
13090
|
+
...panelViewTools(c, owner),
|
|
12003
13091
|
...queueTools(c, owner),
|
|
12004
13092
|
app_submit_input: tool({
|
|
12005
13093
|
...tools.submit_input,
|
|
@@ -12103,9 +13191,10 @@ async function callTool(c, owner, name, args, authority = "parent", hostMeta) {
|
|
|
12103
13191
|
}
|
|
12104
13192
|
|
|
12105
13193
|
// src/service/platform/service/process-info.ts
|
|
12106
|
-
|
|
12107
|
-
import {
|
|
12108
|
-
import {
|
|
13194
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
13195
|
+
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
13196
|
+
import { readFileSync as readFileSync3, readlinkSync } from "node:fs";
|
|
13197
|
+
import { basename, dirname as dirname2, join as join6 } from "node:path";
|
|
12109
13198
|
function inspectProcess(pid) {
|
|
12110
13199
|
try {
|
|
12111
13200
|
if (process.platform === "linux") return inspectLinuxProcess(pid);
|
|
@@ -12166,7 +13255,7 @@ function isExtensionService(owner, lockFile) {
|
|
|
12166
13255
|
let metadata;
|
|
12167
13256
|
try {
|
|
12168
13257
|
metadata = JSON.parse(
|
|
12169
|
-
|
|
13258
|
+
readFileSync3(join6(dirname2(lockFile), "service.json"), "utf8")
|
|
12170
13259
|
);
|
|
12171
13260
|
} catch {
|
|
12172
13261
|
return false;
|
|
@@ -12197,17 +13286,17 @@ function inspectLinuxProcess(pid) {
|
|
|
12197
13286
|
};
|
|
12198
13287
|
}
|
|
12199
13288
|
function readLinuxCommandLine(pid) {
|
|
12200
|
-
return
|
|
13289
|
+
return readFileSync3(`/proc/${pid}/cmdline`, "utf8").split("\0").filter(Boolean).join(" ");
|
|
12201
13290
|
}
|
|
12202
13291
|
function readLinuxFields(pid) {
|
|
12203
|
-
const
|
|
12204
|
-
return
|
|
13292
|
+
const stat3 = readFileSync3(`/proc/${pid}/stat`, "utf8");
|
|
13293
|
+
return stat3.slice(stat3.lastIndexOf(")") + 2).trim().split(/\s+/);
|
|
12205
13294
|
}
|
|
12206
13295
|
function linuxStartedAt(fields) {
|
|
12207
13296
|
const ticks = fields[19];
|
|
12208
13297
|
if (!ticks) return;
|
|
12209
13298
|
try {
|
|
12210
|
-
const bootId =
|
|
13299
|
+
const bootId = readFileSync3(
|
|
12211
13300
|
"/proc/sys/kernel/random/boot_id",
|
|
12212
13301
|
"utf8"
|
|
12213
13302
|
).trim();
|
|
@@ -12263,7 +13352,7 @@ function inspectWindowsProcess(pid) {
|
|
|
12263
13352
|
};
|
|
12264
13353
|
}
|
|
12265
13354
|
function run(command, args) {
|
|
12266
|
-
return
|
|
13355
|
+
return execFileSync2(command, args, {
|
|
12267
13356
|
encoding: "utf8",
|
|
12268
13357
|
stdio: ["ignore", "pipe", "ignore"],
|
|
12269
13358
|
timeout: 2e3
|
|
@@ -12271,12 +13360,13 @@ function run(command, args) {
|
|
|
12271
13360
|
}
|
|
12272
13361
|
|
|
12273
13362
|
// src/service/platform/service/port.ts
|
|
13363
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12274
13364
|
import { createServer } from "node:net";
|
|
12275
13365
|
var PortInUseError = class extends Error {
|
|
12276
|
-
constructor(port,
|
|
13366
|
+
constructor(port, options2) {
|
|
12277
13367
|
super(
|
|
12278
13368
|
`Port ${port} is already in use by another program. Stop that program, or set PORT to a free port.`,
|
|
12279
|
-
|
|
13369
|
+
options2
|
|
12280
13370
|
);
|
|
12281
13371
|
this.port = port;
|
|
12282
13372
|
this.name = "PortInUseError";
|
|
@@ -12285,27 +13375,28 @@ var PortInUseError = class extends Error {
|
|
|
12285
13375
|
};
|
|
12286
13376
|
var nearbyPorts = 10;
|
|
12287
13377
|
function available(port) {
|
|
12288
|
-
return new Promise((
|
|
13378
|
+
return new Promise((resolve3) => {
|
|
12289
13379
|
const server = createServer();
|
|
12290
|
-
server.once("error", () =>
|
|
12291
|
-
server.listen(port, "127.0.0.1", () => server.close(() =>
|
|
13380
|
+
server.once("error", () => resolve3(false));
|
|
13381
|
+
server.listen(port, "127.0.0.1", () => server.close(() => resolve3(true)));
|
|
12292
13382
|
});
|
|
12293
13383
|
}
|
|
12294
13384
|
async function freeLoopbackPort(start, skip) {
|
|
12295
13385
|
for (let port = start; port < start + nearbyPorts; port++) {
|
|
12296
13386
|
if (port !== skip && await available(port)) return port;
|
|
12297
13387
|
}
|
|
12298
|
-
return new Promise((
|
|
13388
|
+
return new Promise((resolve3, reject) => {
|
|
12299
13389
|
const server = createServer();
|
|
12300
13390
|
server.once("error", reject);
|
|
12301
13391
|
server.listen(0, "127.0.0.1", () => {
|
|
12302
13392
|
const { port } = server.address();
|
|
12303
|
-
server.close(() =>
|
|
13393
|
+
server.close(() => resolve3(port));
|
|
12304
13394
|
});
|
|
12305
13395
|
});
|
|
12306
13396
|
}
|
|
12307
13397
|
|
|
12308
13398
|
// src/service/platform/service/health-proof.ts
|
|
13399
|
+
init_define_EXTENSION_BUILD_INFO();
|
|
12309
13400
|
import { createHmac, randomBytes, timingSafeEqual } from "node:crypto";
|
|
12310
13401
|
var challengeHeader = "x-subagent-extension-for-codex-challenge";
|
|
12311
13402
|
var challengePattern = /^[A-Za-z0-9_-]{32,128}$/;
|
|
@@ -12323,68 +13414,6 @@ function provesToken(token, challenge, proof) {
|
|
|
12323
13414
|
return actual.length === expected.length && timingSafeEqual(actual, expected);
|
|
12324
13415
|
}
|
|
12325
13416
|
|
|
12326
|
-
// src/service/platform/service/identity.ts
|
|
12327
|
-
var serviceApiVersion = 1;
|
|
12328
|
-
var launcherEnv = "SUBAGENT_EXTENSION_FOR_CODEX_LAUNCHER";
|
|
12329
|
-
function serviceIdentity(env = process.env) {
|
|
12330
|
-
return {
|
|
12331
|
-
version: packageVersion,
|
|
12332
|
-
apiVersion: serviceApiVersion,
|
|
12333
|
-
launcher: env[launcherEnv] === "stdio" ? "stdio" : "foreground",
|
|
12334
|
-
installRoot
|
|
12335
|
-
};
|
|
12336
|
-
}
|
|
12337
|
-
function compareVersions(a, b) {
|
|
12338
|
-
const parse2 = (version) => {
|
|
12339
|
-
const [core = "", ...pre] = version.replace(/\+.*/, "").split("-");
|
|
12340
|
-
const prerelease = pre.join("-");
|
|
12341
|
-
return {
|
|
12342
|
-
core: core.split(".").map((part) => Number(part) || 0),
|
|
12343
|
-
prerelease: prerelease ? prerelease.split(".") : []
|
|
12344
|
-
};
|
|
12345
|
-
};
|
|
12346
|
-
const [left, right] = [parse2(a), parse2(b)];
|
|
12347
|
-
for (let i = 0; i < Math.max(left.core.length, right.core.length); i++) {
|
|
12348
|
-
const difference = (left.core[i] ?? 0) - (right.core[i] ?? 0);
|
|
12349
|
-
if (difference) return Math.sign(difference);
|
|
12350
|
-
}
|
|
12351
|
-
if (!left.prerelease.length || !right.prerelease.length) {
|
|
12352
|
-
return Math.sign(right.prerelease.length - left.prerelease.length);
|
|
12353
|
-
}
|
|
12354
|
-
for (let i = 0; i < Math.max(left.prerelease.length, right.prerelease.length); i++) {
|
|
12355
|
-
const [x, y] = [left.prerelease[i], right.prerelease[i]];
|
|
12356
|
-
if (x === y) continue;
|
|
12357
|
-
if (x === void 0) return -1;
|
|
12358
|
-
if (y === void 0) return 1;
|
|
12359
|
-
const [xNumeric, yNumeric] = [/^\d+$/.test(x), /^\d+$/.test(y)];
|
|
12360
|
-
if (xNumeric && yNumeric) return Math.sign(Number(x) - Number(y));
|
|
12361
|
-
if (xNumeric !== yNumeric) return xNumeric ? -1 : 1;
|
|
12362
|
-
return x < y ? -1 : 1;
|
|
12363
|
-
}
|
|
12364
|
-
return 0;
|
|
12365
|
-
}
|
|
12366
|
-
function handoff(running, own2, origin) {
|
|
12367
|
-
const compatible = running.apiVersion === own2.apiVersion;
|
|
12368
|
-
const described2 = `version ${running.version ?? "unknown"}`;
|
|
12369
|
-
if (running.launcher !== "stdio") {
|
|
12370
|
-
return compatible ? { action: "use" } : {
|
|
12371
|
-
action: "refuse",
|
|
12372
|
-
message: `A different extension service (${described2}, not started by the plugin) is running at ${origin}. Stop it, or give development its own SUBAGENT_EXTENSION_FOR_CODEX_DATA and PORT.`
|
|
12373
|
-
};
|
|
12374
|
-
}
|
|
12375
|
-
const order = running.version ? compareVersions(running.version, own2.version) : -1;
|
|
12376
|
-
if (order > 0) {
|
|
12377
|
-
return compatible ? { action: "use" } : {
|
|
12378
|
-
action: "refuse",
|
|
12379
|
-
message: `A newer extension service (${described2}) is running at ${origin}; update the plugin to ${running.version} or later.`
|
|
12380
|
-
};
|
|
12381
|
-
}
|
|
12382
|
-
if (order < 0 || !running.installed || !compatible) {
|
|
12383
|
-
return { action: "replace", forward: compatible };
|
|
12384
|
-
}
|
|
12385
|
-
return { action: "use" };
|
|
12386
|
-
}
|
|
12387
|
-
|
|
12388
13417
|
export {
|
|
12389
13418
|
inspectProcess,
|
|
12390
13419
|
inspectProcessIdentity,
|
|
@@ -12393,19 +13422,25 @@ export {
|
|
|
12393
13422
|
isExtensionService,
|
|
12394
13423
|
PortInUseError,
|
|
12395
13424
|
freeLoopbackPort,
|
|
13425
|
+
scalarText,
|
|
12396
13426
|
claudePermissionModes,
|
|
12397
13427
|
claudePermissionModeSchema,
|
|
12398
13428
|
permissionModeSchema,
|
|
12399
13429
|
claudeOverrideDefaults,
|
|
13430
|
+
MODE_TURNED_OFF_BY_ORG,
|
|
12400
13431
|
permissionLabel,
|
|
13432
|
+
permissionModeName,
|
|
12401
13433
|
readOnlyProfile,
|
|
12402
13434
|
resolveClaudePermission,
|
|
12403
13435
|
exceedsPermission,
|
|
12404
13436
|
claudePolicySchema,
|
|
12405
13437
|
resolveClaudePolicy,
|
|
13438
|
+
ClaudeCli,
|
|
12406
13439
|
contentText,
|
|
12407
|
-
|
|
12408
|
-
|
|
13440
|
+
FAMILY_ALIASES,
|
|
13441
|
+
isModelVariant,
|
|
13442
|
+
modelAllowed,
|
|
13443
|
+
blockedReason,
|
|
12409
13444
|
settingText,
|
|
12410
13445
|
preferredSettingsProvider,
|
|
12411
13446
|
providerModelSettingScopes,
|
|
@@ -12672,7 +13707,7 @@ export {
|
|
|
12672
13707
|
mergeCapabilities,
|
|
12673
13708
|
productGlyphIcons,
|
|
12674
13709
|
resolvePanelContext,
|
|
12675
|
-
|
|
13710
|
+
panelTaskList,
|
|
12676
13711
|
delegationPanel,
|
|
12677
13712
|
SERVER_INSTRUCTIONS,
|
|
12678
13713
|
composerMentionsEnabled,
|
|
@@ -12693,4 +13728,4 @@ export {
|
|
|
12693
13728
|
toolStructuredContent,
|
|
12694
13729
|
callTool
|
|
12695
13730
|
};
|
|
12696
|
-
//# sourceMappingURL=chunk-
|
|
13731
|
+
//# sourceMappingURL=chunk-L5ILPS3O.js.map
|