@codexhost/cli-linux-arm64 0.22.0 → 0.24.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 +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +3117 -274
- package/app/console-web.js +15645 -4413
- package/app/desktop-controller.mjs +14057 -969
- package/app/host-runtime.mjs +11518 -8277
- package/app/plugins/antigravity/plugin.mjs +2030 -678
- package/app/plugins/claude-code/plugin.mjs +2116 -929
- package/app/plugins/codebuddy/plugin.mjs +1247 -353
- package/app/plugins/codex-usage/plugin.mjs +786 -163
- package/app/plugins/copilot/plugin.mjs +938 -296
- package/app/plugins/cursor-cli/plugin.mjs +1021 -232
- package/app/plugins/deepseek-harness/plugin.mjs +1552 -664
- package/app/plugins/devin/plugin.mjs +826 -185
- package/app/plugins/grok/plugin.mjs +1083 -424
- package/app/plugins/hermes/plugin.mjs +961 -338
- package/app/plugins/kimi-code/plugin.mjs +854 -237
- package/app/plugins/kiro-cli/plugin.mjs +821 -184
- package/app/plugins/omp/plugin.mjs +1316 -633
- package/app/plugins/opencode/plugin.mjs +1293 -606
- package/app/plugins/pi/plugin.mjs +1540 -867
- package/app/plugins/qoder/plugin.mjs +961 -332
- package/app/plugins/qoder-cn/plugin.mjs +961 -332
- package/app/plugins/qwen-code/plugin.mjs +937 -321
- package/app/plugins/workbuddy/plugin.mjs +1311 -370
- package/app/plugins/zcode/plugin.mjs +1516 -423
- package/app/renderer-extension.js +21297 -9060
- package/app/web/assets/index-CTCFIQbU.css +1 -0
- package/app/web/assets/index-IvFk9KT-.js +203 -0
- package/app/web/codexhost-settings.js +6753 -31616
- package/app/web/index.html +2 -2
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +69 -69
- package/app/web/plugins/deepseek-ai__dsh-client-ui-approval/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +14 -14
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +75 -64
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +94 -91
- package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-browser/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.js +9 -9
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-right/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-theme/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +79 -79
- package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +7 -7
- package/app/web/sw.js +8 -1
- package/app/web-modules/licenses/werift-NOTICES.txt +123 -0
- package/app/web-modules/licenses/werift-libwebrtc-NOTICES.txt +58 -0
- package/app/web-modules/server.mjs +40416 -11283
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-CN4a4sj0.js +0 -201
- package/app/web/assets/index-DJW4bmyx.css +0 -1
|
@@ -2235,10 +2235,10 @@ var require_resolve = __commonJS({
|
|
|
2235
2235
|
}
|
|
2236
2236
|
return count3;
|
|
2237
2237
|
}
|
|
2238
|
-
function getFullPath(resolver,
|
|
2238
|
+
function getFullPath(resolver, id4 = "", normalize) {
|
|
2239
2239
|
if (normalize !== false)
|
|
2240
|
-
|
|
2241
|
-
const p = resolver.parse(
|
|
2240
|
+
id4 = normalizeId(id4);
|
|
2241
|
+
const p = resolver.parse(id4);
|
|
2242
2242
|
return _getFullPath(resolver, p);
|
|
2243
2243
|
}
|
|
2244
2244
|
exports.getFullPath = getFullPath;
|
|
@@ -2248,13 +2248,13 @@ var require_resolve = __commonJS({
|
|
|
2248
2248
|
}
|
|
2249
2249
|
exports._getFullPath = _getFullPath;
|
|
2250
2250
|
var TRAILING_SLASH_HASH = /#\/?$/;
|
|
2251
|
-
function normalizeId(
|
|
2252
|
-
return
|
|
2251
|
+
function normalizeId(id4) {
|
|
2252
|
+
return id4 ? id4.replace(TRAILING_SLASH_HASH, "") : "";
|
|
2253
2253
|
}
|
|
2254
2254
|
exports.normalizeId = normalizeId;
|
|
2255
|
-
function resolveUrl(resolver, baseId,
|
|
2256
|
-
|
|
2257
|
-
return resolver.resolve(baseId,
|
|
2255
|
+
function resolveUrl(resolver, baseId, id4) {
|
|
2256
|
+
id4 = normalizeId(id4);
|
|
2257
|
+
return resolver.resolve(baseId, id4);
|
|
2258
2258
|
}
|
|
2259
2259
|
exports.resolveUrl = resolveUrl;
|
|
2260
2260
|
var ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
|
|
@@ -3024,8 +3024,8 @@ var require_compile = __commonJS({
|
|
|
3024
3024
|
if (Object.keys(root.schema).length > 0 && refPath === baseId) {
|
|
3025
3025
|
return getJsonPointer.call(this, p, root);
|
|
3026
3026
|
}
|
|
3027
|
-
const
|
|
3028
|
-
const schOrRef = this.refs[
|
|
3027
|
+
const id4 = (0, resolve_1.normalizeId)(refPath);
|
|
3028
|
+
const schOrRef = this.refs[id4] || this.schemas[id4];
|
|
3029
3029
|
if (typeof schOrRef == "string") {
|
|
3030
3030
|
const sch = resolveSchema.call(this, root, schOrRef);
|
|
3031
3031
|
if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
|
|
@@ -3036,7 +3036,7 @@ var require_compile = __commonJS({
|
|
|
3036
3036
|
return;
|
|
3037
3037
|
if (!schOrRef.validate)
|
|
3038
3038
|
compileSchema.call(this, schOrRef);
|
|
3039
|
-
if (
|
|
3039
|
+
if (id4 === (0, resolve_1.normalizeId)(ref)) {
|
|
3040
3040
|
const { schema } = schOrRef;
|
|
3041
3041
|
const { schemaId } = this.opts;
|
|
3042
3042
|
const schId = schema[schemaId];
|
|
@@ -4159,15 +4159,15 @@ var require_core = __commonJS({
|
|
|
4159
4159
|
this.addSchema(sch, void 0, _meta, _validateSchema);
|
|
4160
4160
|
return this;
|
|
4161
4161
|
}
|
|
4162
|
-
let
|
|
4162
|
+
let id4;
|
|
4163
4163
|
if (typeof schema === "object") {
|
|
4164
4164
|
const { schemaId } = this.opts;
|
|
4165
|
-
|
|
4166
|
-
if (
|
|
4165
|
+
id4 = schema[schemaId];
|
|
4166
|
+
if (id4 !== void 0 && typeof id4 != "string") {
|
|
4167
4167
|
throw new Error(`schema ${schemaId} must be string`);
|
|
4168
4168
|
}
|
|
4169
4169
|
}
|
|
4170
|
-
key = (0, resolve_1.normalizeId)(key ||
|
|
4170
|
+
key = (0, resolve_1.normalizeId)(key || id4);
|
|
4171
4171
|
this._checkUnique(key);
|
|
4172
4172
|
this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);
|
|
4173
4173
|
return this;
|
|
@@ -4246,11 +4246,11 @@ var require_core = __commonJS({
|
|
|
4246
4246
|
case "object": {
|
|
4247
4247
|
const cacheKey = schemaKeyRef;
|
|
4248
4248
|
this._cache.delete(cacheKey);
|
|
4249
|
-
let
|
|
4250
|
-
if (
|
|
4251
|
-
|
|
4252
|
-
delete this.schemas[
|
|
4253
|
-
delete this.refs[
|
|
4249
|
+
let id4 = schemaKeyRef[this.opts.schemaId];
|
|
4250
|
+
if (id4) {
|
|
4251
|
+
id4 = (0, resolve_1.normalizeId)(id4);
|
|
4252
|
+
delete this.schemas[id4];
|
|
4253
|
+
delete this.refs[id4];
|
|
4254
4254
|
}
|
|
4255
4255
|
return this;
|
|
4256
4256
|
}
|
|
@@ -4357,10 +4357,10 @@ var require_core = __commonJS({
|
|
|
4357
4357
|
}
|
|
4358
4358
|
}
|
|
4359
4359
|
_addSchema(schema, meta3, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
|
|
4360
|
-
let
|
|
4360
|
+
let id4;
|
|
4361
4361
|
const { schemaId } = this.opts;
|
|
4362
4362
|
if (typeof schema == "object") {
|
|
4363
|
-
|
|
4363
|
+
id4 = schema[schemaId];
|
|
4364
4364
|
} else {
|
|
4365
4365
|
if (this.opts.jtd)
|
|
4366
4366
|
throw new Error("schema must be object");
|
|
@@ -4370,7 +4370,7 @@ var require_core = __commonJS({
|
|
|
4370
4370
|
let sch = this._cache.get(schema);
|
|
4371
4371
|
if (sch !== void 0)
|
|
4372
4372
|
return sch;
|
|
4373
|
-
baseId = (0, resolve_1.normalizeId)(
|
|
4373
|
+
baseId = (0, resolve_1.normalizeId)(id4 || baseId);
|
|
4374
4374
|
const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
|
|
4375
4375
|
sch = new compile_1.SchemaEnv({ schema, schemaId, meta: meta3, baseId, localRefs });
|
|
4376
4376
|
this._cache.set(sch.schema, sch);
|
|
@@ -4383,9 +4383,9 @@ var require_core = __commonJS({
|
|
|
4383
4383
|
this.validateSchema(schema, true);
|
|
4384
4384
|
return sch;
|
|
4385
4385
|
}
|
|
4386
|
-
_checkUnique(
|
|
4387
|
-
if (this.schemas[
|
|
4388
|
-
throw new Error(`schema with key or id "${
|
|
4386
|
+
_checkUnique(id4) {
|
|
4387
|
+
if (this.schemas[id4] || this.refs[id4]) {
|
|
4388
|
+
throw new Error(`schema with key or id "${id4}" already exists`);
|
|
4389
4389
|
}
|
|
4390
4390
|
}
|
|
4391
4391
|
_compileSchemaEnv(sch) {
|
|
@@ -8948,10 +8948,10 @@ var require_resolve2 = __commonJS({
|
|
|
8948
8948
|
}
|
|
8949
8949
|
return count3;
|
|
8950
8950
|
}
|
|
8951
|
-
function getFullPath(resolver,
|
|
8951
|
+
function getFullPath(resolver, id4 = "", normalize) {
|
|
8952
8952
|
if (normalize !== false)
|
|
8953
|
-
|
|
8954
|
-
const p = resolver.parse(
|
|
8953
|
+
id4 = normalizeId(id4);
|
|
8954
|
+
const p = resolver.parse(id4);
|
|
8955
8955
|
return _getFullPath(resolver, p);
|
|
8956
8956
|
}
|
|
8957
8957
|
exports.getFullPath = getFullPath;
|
|
@@ -8961,13 +8961,13 @@ var require_resolve2 = __commonJS({
|
|
|
8961
8961
|
}
|
|
8962
8962
|
exports._getFullPath = _getFullPath;
|
|
8963
8963
|
var TRAILING_SLASH_HASH = /#\/?$/;
|
|
8964
|
-
function normalizeId(
|
|
8965
|
-
return
|
|
8964
|
+
function normalizeId(id4) {
|
|
8965
|
+
return id4 ? id4.replace(TRAILING_SLASH_HASH, "") : "";
|
|
8966
8966
|
}
|
|
8967
8967
|
exports.normalizeId = normalizeId;
|
|
8968
|
-
function resolveUrl(resolver, baseId,
|
|
8969
|
-
|
|
8970
|
-
return resolver.resolve(baseId,
|
|
8968
|
+
function resolveUrl(resolver, baseId, id4) {
|
|
8969
|
+
id4 = normalizeId(id4);
|
|
8970
|
+
return resolver.resolve(baseId, id4);
|
|
8971
8971
|
}
|
|
8972
8972
|
exports.resolveUrl = resolveUrl;
|
|
8973
8973
|
var ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
|
|
@@ -9737,8 +9737,8 @@ var require_compile2 = __commonJS({
|
|
|
9737
9737
|
if (Object.keys(root.schema).length > 0 && refPath === baseId) {
|
|
9738
9738
|
return getJsonPointer.call(this, p, root);
|
|
9739
9739
|
}
|
|
9740
|
-
const
|
|
9741
|
-
const schOrRef = this.refs[
|
|
9740
|
+
const id4 = (0, resolve_1.normalizeId)(refPath);
|
|
9741
|
+
const schOrRef = this.refs[id4] || this.schemas[id4];
|
|
9742
9742
|
if (typeof schOrRef == "string") {
|
|
9743
9743
|
const sch = resolveSchema.call(this, root, schOrRef);
|
|
9744
9744
|
if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
|
|
@@ -9749,7 +9749,7 @@ var require_compile2 = __commonJS({
|
|
|
9749
9749
|
return;
|
|
9750
9750
|
if (!schOrRef.validate)
|
|
9751
9751
|
compileSchema.call(this, schOrRef);
|
|
9752
|
-
if (
|
|
9752
|
+
if (id4 === (0, resolve_1.normalizeId)(ref)) {
|
|
9753
9753
|
const { schema } = schOrRef;
|
|
9754
9754
|
const { schemaId } = this.opts;
|
|
9755
9755
|
const schId = schema[schemaId];
|
|
@@ -10057,15 +10057,15 @@ var require_core3 = __commonJS({
|
|
|
10057
10057
|
this.addSchema(sch, void 0, _meta, _validateSchema);
|
|
10058
10058
|
return this;
|
|
10059
10059
|
}
|
|
10060
|
-
let
|
|
10060
|
+
let id4;
|
|
10061
10061
|
if (typeof schema === "object") {
|
|
10062
10062
|
const { schemaId } = this.opts;
|
|
10063
|
-
|
|
10064
|
-
if (
|
|
10063
|
+
id4 = schema[schemaId];
|
|
10064
|
+
if (id4 !== void 0 && typeof id4 != "string") {
|
|
10065
10065
|
throw new Error(`schema ${schemaId} must be string`);
|
|
10066
10066
|
}
|
|
10067
10067
|
}
|
|
10068
|
-
key = (0, resolve_1.normalizeId)(key ||
|
|
10068
|
+
key = (0, resolve_1.normalizeId)(key || id4);
|
|
10069
10069
|
this._checkUnique(key);
|
|
10070
10070
|
this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);
|
|
10071
10071
|
return this;
|
|
@@ -10144,11 +10144,11 @@ var require_core3 = __commonJS({
|
|
|
10144
10144
|
case "object": {
|
|
10145
10145
|
const cacheKey = schemaKeyRef;
|
|
10146
10146
|
this._cache.delete(cacheKey);
|
|
10147
|
-
let
|
|
10148
|
-
if (
|
|
10149
|
-
|
|
10150
|
-
delete this.schemas[
|
|
10151
|
-
delete this.refs[
|
|
10147
|
+
let id4 = schemaKeyRef[this.opts.schemaId];
|
|
10148
|
+
if (id4) {
|
|
10149
|
+
id4 = (0, resolve_1.normalizeId)(id4);
|
|
10150
|
+
delete this.schemas[id4];
|
|
10151
|
+
delete this.refs[id4];
|
|
10152
10152
|
}
|
|
10153
10153
|
return this;
|
|
10154
10154
|
}
|
|
@@ -10255,10 +10255,10 @@ var require_core3 = __commonJS({
|
|
|
10255
10255
|
}
|
|
10256
10256
|
}
|
|
10257
10257
|
_addSchema(schema, meta3, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
|
|
10258
|
-
let
|
|
10258
|
+
let id4;
|
|
10259
10259
|
const { schemaId } = this.opts;
|
|
10260
10260
|
if (typeof schema == "object") {
|
|
10261
|
-
|
|
10261
|
+
id4 = schema[schemaId];
|
|
10262
10262
|
} else {
|
|
10263
10263
|
if (this.opts.jtd)
|
|
10264
10264
|
throw new Error("schema must be object");
|
|
@@ -10268,7 +10268,7 @@ var require_core3 = __commonJS({
|
|
|
10268
10268
|
let sch = this._cache.get(schema);
|
|
10269
10269
|
if (sch !== void 0)
|
|
10270
10270
|
return sch;
|
|
10271
|
-
baseId = (0, resolve_1.normalizeId)(
|
|
10271
|
+
baseId = (0, resolve_1.normalizeId)(id4 || baseId);
|
|
10272
10272
|
const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
|
|
10273
10273
|
sch = new compile_1.SchemaEnv({ schema, schemaId, meta: meta3, baseId, localRefs });
|
|
10274
10274
|
this._cache.set(sch.schema, sch);
|
|
@@ -10281,9 +10281,9 @@ var require_core3 = __commonJS({
|
|
|
10281
10281
|
this.validateSchema(schema, true);
|
|
10282
10282
|
return sch;
|
|
10283
10283
|
}
|
|
10284
|
-
_checkUnique(
|
|
10285
|
-
if (this.schemas[
|
|
10286
|
-
throw new Error(`schema with key or id "${
|
|
10284
|
+
_checkUnique(id4) {
|
|
10285
|
+
if (this.schemas[id4] || this.refs[id4]) {
|
|
10286
|
+
throw new Error(`schema with key or id "${id4}" already exists`);
|
|
10287
10287
|
}
|
|
10288
10288
|
}
|
|
10289
10289
|
_compileSchemaEnv(sch) {
|
|
@@ -12617,10 +12617,10 @@ function executableExtensions(command, platform, environment) {
|
|
|
12617
12617
|
return [""];
|
|
12618
12618
|
return (environmentValue(environment, "PATHEXT") ?? ".COM;.EXE;.BAT;.CMD").split(";").map((extension) => extension.trim()).filter(Boolean);
|
|
12619
12619
|
}
|
|
12620
|
-
function isExecutableFile(
|
|
12620
|
+
function isExecutableFile(filePath2, platform) {
|
|
12621
12621
|
try {
|
|
12622
|
-
fs.accessSync(
|
|
12623
|
-
return fs.statSync(
|
|
12622
|
+
fs.accessSync(filePath2, platform === "win32" ? fs.constants.F_OK : fs.constants.X_OK);
|
|
12623
|
+
return fs.statSync(filePath2).isFile();
|
|
12624
12624
|
} catch {
|
|
12625
12625
|
return false;
|
|
12626
12626
|
}
|
|
@@ -14250,8 +14250,8 @@ function cleanEnum(obj) {
|
|
|
14250
14250
|
return Number.isNaN(Number.parseInt(k3, 10));
|
|
14251
14251
|
}).map((el3) => el3[1]);
|
|
14252
14252
|
}
|
|
14253
|
-
function base64ToUint8Array(
|
|
14254
|
-
const binaryString = atob(
|
|
14253
|
+
function base64ToUint8Array(base644) {
|
|
14254
|
+
const binaryString = atob(base644);
|
|
14255
14255
|
const bytes = new Uint8Array(binaryString.length);
|
|
14256
14256
|
for (let i = 0; i < binaryString.length; i++) {
|
|
14257
14257
|
bytes[i] = binaryString.charCodeAt(i);
|
|
@@ -14266,9 +14266,9 @@ function uint8ArrayToBase64(bytes) {
|
|
|
14266
14266
|
return btoa(binaryString);
|
|
14267
14267
|
}
|
|
14268
14268
|
function base64urlToUint8Array(base64url3) {
|
|
14269
|
-
const
|
|
14270
|
-
const padding = "=".repeat((4 -
|
|
14271
|
-
return base64ToUint8Array(
|
|
14269
|
+
const base644 = base64url3.replace(/-/g, "+").replace(/_/g, "/");
|
|
14270
|
+
const padding = "=".repeat((4 - base644.length % 4) % 4);
|
|
14271
|
+
return base64ToUint8Array(base644 + padding);
|
|
14272
14272
|
}
|
|
14273
14273
|
function uint8ArrayToBase64url(bytes) {
|
|
14274
14274
|
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
@@ -15634,8 +15634,8 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
15634
15634
|
function isValidBase64URL(data) {
|
|
15635
15635
|
if (!base64url.test(data))
|
|
15636
15636
|
return false;
|
|
15637
|
-
const
|
|
15638
|
-
const padded =
|
|
15637
|
+
const base644 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
15638
|
+
const padded = base644.padEnd(Math.ceil(base644.length / 4) * 4, "=");
|
|
15639
15639
|
return isValidBase64(padded);
|
|
15640
15640
|
}
|
|
15641
15641
|
var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
@@ -16089,42 +16089,42 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
16089
16089
|
}
|
|
16090
16090
|
doc.write(`const newResult = {};`);
|
|
16091
16091
|
for (const key of normalized.keys) {
|
|
16092
|
-
const
|
|
16092
|
+
const id4 = ids[key];
|
|
16093
16093
|
const k3 = esc(key);
|
|
16094
16094
|
const schema = shape[key];
|
|
16095
16095
|
const isOptionalIn = schema?._zod?.optin === "optional";
|
|
16096
16096
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
16097
|
-
doc.write(`const ${
|
|
16097
|
+
doc.write(`const ${id4} = ${parseStr(key)};`);
|
|
16098
16098
|
if (isOptionalIn && isOptionalOut) {
|
|
16099
16099
|
doc.write(`
|
|
16100
|
-
if (${
|
|
16100
|
+
if (${id4}.issues.length) {
|
|
16101
16101
|
if (${k3} in input) {
|
|
16102
|
-
payload.issues = payload.issues.concat(${
|
|
16102
|
+
payload.issues = payload.issues.concat(${id4}.issues.map(iss => ({
|
|
16103
16103
|
...iss,
|
|
16104
16104
|
path: iss.path ? [${k3}, ...iss.path] : [${k3}]
|
|
16105
16105
|
})));
|
|
16106
16106
|
}
|
|
16107
16107
|
}
|
|
16108
16108
|
|
|
16109
|
-
if (${
|
|
16109
|
+
if (${id4}.value === undefined) {
|
|
16110
16110
|
if (${k3} in input) {
|
|
16111
16111
|
newResult[${k3}] = undefined;
|
|
16112
16112
|
}
|
|
16113
16113
|
} else {
|
|
16114
|
-
newResult[${k3}] = ${
|
|
16114
|
+
newResult[${k3}] = ${id4}.value;
|
|
16115
16115
|
}
|
|
16116
16116
|
|
|
16117
16117
|
`);
|
|
16118
16118
|
} else if (!isOptionalIn) {
|
|
16119
16119
|
doc.write(`
|
|
16120
|
-
const ${
|
|
16121
|
-
if (${
|
|
16122
|
-
payload.issues = payload.issues.concat(${
|
|
16120
|
+
const ${id4}_present = ${k3} in input;
|
|
16121
|
+
if (${id4}.issues.length) {
|
|
16122
|
+
payload.issues = payload.issues.concat(${id4}.issues.map(iss => ({
|
|
16123
16123
|
...iss,
|
|
16124
16124
|
path: iss.path ? [${k3}, ...iss.path] : [${k3}]
|
|
16125
16125
|
})));
|
|
16126
16126
|
}
|
|
16127
|
-
if (!${
|
|
16127
|
+
if (!${id4}_present && !${id4}.issues.length) {
|
|
16128
16128
|
payload.issues.push({
|
|
16129
16129
|
code: "invalid_type",
|
|
16130
16130
|
expected: "nonoptional",
|
|
@@ -16133,30 +16133,30 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
16133
16133
|
});
|
|
16134
16134
|
}
|
|
16135
16135
|
|
|
16136
|
-
if (${
|
|
16137
|
-
if (${
|
|
16136
|
+
if (${id4}_present) {
|
|
16137
|
+
if (${id4}.value === undefined) {
|
|
16138
16138
|
newResult[${k3}] = undefined;
|
|
16139
16139
|
} else {
|
|
16140
|
-
newResult[${k3}] = ${
|
|
16140
|
+
newResult[${k3}] = ${id4}.value;
|
|
16141
16141
|
}
|
|
16142
16142
|
}
|
|
16143
16143
|
|
|
16144
16144
|
`);
|
|
16145
16145
|
} else {
|
|
16146
16146
|
doc.write(`
|
|
16147
|
-
if (${
|
|
16148
|
-
payload.issues = payload.issues.concat(${
|
|
16147
|
+
if (${id4}.issues.length) {
|
|
16148
|
+
payload.issues = payload.issues.concat(${id4}.issues.map(iss => ({
|
|
16149
16149
|
...iss,
|
|
16150
16150
|
path: iss.path ? [${k3}, ...iss.path] : [${k3}]
|
|
16151
16151
|
})));
|
|
16152
16152
|
}
|
|
16153
16153
|
|
|
16154
|
-
if (${
|
|
16154
|
+
if (${id4}.value === undefined) {
|
|
16155
16155
|
if (${k3} in input) {
|
|
16156
16156
|
newResult[${k3}] = undefined;
|
|
16157
16157
|
}
|
|
16158
16158
|
} else {
|
|
16159
|
-
newResult[${k3}] = ${
|
|
16159
|
+
newResult[${k3}] = ${id4}.value;
|
|
16160
16160
|
}
|
|
16161
16161
|
|
|
16162
16162
|
`);
|
|
@@ -24488,26 +24488,26 @@ function extractDefs(ctx, schema) {
|
|
|
24488
24488
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
24489
24489
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
24490
24490
|
for (const entry of ctx.seen.entries()) {
|
|
24491
|
-
const
|
|
24492
|
-
if (
|
|
24493
|
-
const existing = idToSchema.get(
|
|
24491
|
+
const id4 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
24492
|
+
if (id4) {
|
|
24493
|
+
const existing = idToSchema.get(id4);
|
|
24494
24494
|
if (existing && existing !== entry[0]) {
|
|
24495
|
-
throw new Error(`Duplicate schema id "${
|
|
24495
|
+
throw new Error(`Duplicate schema id "${id4}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
24496
24496
|
}
|
|
24497
|
-
idToSchema.set(
|
|
24497
|
+
idToSchema.set(id4, entry[0]);
|
|
24498
24498
|
}
|
|
24499
24499
|
}
|
|
24500
24500
|
const makeURI = (entry) => {
|
|
24501
24501
|
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
24502
24502
|
if (ctx.external) {
|
|
24503
24503
|
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
24504
|
-
const uriGenerator = ctx.external.uri ?? ((
|
|
24504
|
+
const uriGenerator = ctx.external.uri ?? ((id5) => id5);
|
|
24505
24505
|
if (externalId) {
|
|
24506
24506
|
return { ref: uriGenerator(externalId) };
|
|
24507
24507
|
}
|
|
24508
|
-
const
|
|
24509
|
-
entry[1].defId =
|
|
24510
|
-
return { defId:
|
|
24508
|
+
const id4 = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
24509
|
+
entry[1].defId = id4;
|
|
24510
|
+
return { defId: id4, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id4}` };
|
|
24511
24511
|
}
|
|
24512
24512
|
if (entry[1] === root) {
|
|
24513
24513
|
return { ref: "#" };
|
|
@@ -24555,8 +24555,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
24555
24555
|
continue;
|
|
24556
24556
|
}
|
|
24557
24557
|
}
|
|
24558
|
-
const
|
|
24559
|
-
if (
|
|
24558
|
+
const id4 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
24559
|
+
if (id4) {
|
|
24560
24560
|
extractToDef(entry);
|
|
24561
24561
|
continue;
|
|
24562
24562
|
}
|
|
@@ -24652,10 +24652,10 @@ function finalize(ctx, schema) {
|
|
|
24652
24652
|
} else {
|
|
24653
24653
|
}
|
|
24654
24654
|
if (ctx.external?.uri) {
|
|
24655
|
-
const
|
|
24656
|
-
if (!
|
|
24655
|
+
const id4 = ctx.external.registry.get(schema)?.id;
|
|
24656
|
+
if (!id4)
|
|
24657
24657
|
throw new Error("Schema is missing an `id` property");
|
|
24658
|
-
result.$id = ctx.external.uri(
|
|
24658
|
+
result.$id = ctx.external.uri(id4);
|
|
24659
24659
|
}
|
|
24660
24660
|
Object.assign(result, root.def ?? root.schema);
|
|
24661
24661
|
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
@@ -24815,9 +24815,9 @@ var numberProcessor = (schema, ctx, _json, _params) => {
|
|
|
24815
24815
|
json2.type = "number";
|
|
24816
24816
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
24817
24817
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
24818
|
-
const
|
|
24818
|
+
const legacy2 = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
24819
24819
|
if (exMin) {
|
|
24820
|
-
if (
|
|
24820
|
+
if (legacy2) {
|
|
24821
24821
|
json2.minimum = exclusiveMinimum;
|
|
24822
24822
|
json2.exclusiveMinimum = true;
|
|
24823
24823
|
} else {
|
|
@@ -24827,7 +24827,7 @@ var numberProcessor = (schema, ctx, _json, _params) => {
|
|
|
24827
24827
|
json2.minimum = minimum;
|
|
24828
24828
|
}
|
|
24829
24829
|
if (exMax) {
|
|
24830
|
-
if (
|
|
24830
|
+
if (legacy2) {
|
|
24831
24831
|
json2.maximum = exclusiveMaximum;
|
|
24832
24832
|
json2.exclusiveMaximum = true;
|
|
24833
24833
|
} else {
|
|
@@ -25689,7 +25689,7 @@ var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
|
25689
25689
|
|
|
25690
25690
|
// ../../../node_modules/zod/v4/classic/schemas.js
|
|
25691
25691
|
var _installedGroups = /* @__PURE__ */ new WeakMap();
|
|
25692
|
-
function _installLazyMethods(inst, group,
|
|
25692
|
+
function _installLazyMethods(inst, group, methods2) {
|
|
25693
25693
|
const proto = Object.getPrototypeOf(inst);
|
|
25694
25694
|
let installed = _installedGroups.get(proto);
|
|
25695
25695
|
if (!installed) {
|
|
@@ -25699,8 +25699,8 @@ function _installLazyMethods(inst, group, methods) {
|
|
|
25699
25699
|
if (installed.has(group))
|
|
25700
25700
|
return;
|
|
25701
25701
|
installed.add(group);
|
|
25702
|
-
for (const key in
|
|
25703
|
-
const fn3 =
|
|
25702
|
+
for (const key in methods2) {
|
|
25703
|
+
const fn3 = methods2[key];
|
|
25704
25704
|
Object.defineProperty(proto, key, {
|
|
25705
25705
|
configurable: true,
|
|
25706
25706
|
enumerable: false,
|
|
@@ -27644,6 +27644,9 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
|
27644
27644
|
permissionModeId: harnessPermissionModeIdSchema
|
|
27645
27645
|
}).strict();
|
|
27646
27646
|
|
|
27647
|
+
// ../../shared-contracts/dist/harness-route-limit.js
|
|
27648
|
+
var HARNESS_TRANSPORT_MODEL_ID_MAX_LENGTH = 8192;
|
|
27649
|
+
|
|
27647
27650
|
// ../../shared-contracts/dist/thread-usage.js
|
|
27648
27651
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
27649
27652
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
@@ -27676,7 +27679,7 @@ var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
|
27676
27679
|
expiresAtUnix: nonNegativeSafeIntegerSchema,
|
|
27677
27680
|
label: indicatorTextSchema(256).optional(),
|
|
27678
27681
|
tooltip: indicatorTextSchema(1024).optional()
|
|
27679
|
-
}).strict()).max(2).refine((entries) => new Set(entries.map(({ id:
|
|
27682
|
+
}).strict()).max(2).refine((entries) => new Set(entries.map(({ id: id4 }) => id4)).size === entries.length, {
|
|
27680
27683
|
message: "Composer indicator IDs must be unique"
|
|
27681
27684
|
});
|
|
27682
27685
|
var threadUsageSnapshotSchema = external_exports.object({
|
|
@@ -27702,6 +27705,7 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
27702
27705
|
planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
|
|
27703
27706
|
sessionCacheHitRatePercent: cacheHitRatePercentSchema.optional(),
|
|
27704
27707
|
timeToFirstOutputMs: nonNegativeSafeIntegerSchema.optional(),
|
|
27708
|
+
latestRequestTimeToFirstOutputMs: nonNegativeSafeIntegerSchema.optional(),
|
|
27705
27709
|
costSource: external_exports.enum(["publicPrice", "native"]).optional(),
|
|
27706
27710
|
unpricedModels: external_exports.array(external_exports.string().min(1)).min(1).optional()
|
|
27707
27711
|
}).strict().superRefine((usage, context) => {
|
|
@@ -27799,6 +27803,13 @@ var accountCreditsSnapshotSchema = external_exports.object({
|
|
|
27799
27803
|
productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
|
|
27800
27804
|
resetCredits: accountResetCreditsSchema.optional()
|
|
27801
27805
|
}).strict();
|
|
27806
|
+
var accountBalanceSnapshotSchema = external_exports.object({
|
|
27807
|
+
amount: external_exports.number().finite().nonnegative(),
|
|
27808
|
+
/** ISO 4217 code as reported by the Provider, for example `CNY`. */
|
|
27809
|
+
currency: external_exports.string().trim().min(1).max(8),
|
|
27810
|
+
/** Native label when the Harness exposes several Billing Sources. */
|
|
27811
|
+
label: external_exports.string().trim().min(1).max(128).optional()
|
|
27812
|
+
}).strict();
|
|
27802
27813
|
var threadUsageInspectionParamsSchema = external_exports.object({
|
|
27803
27814
|
threadId: hostThreadIdSchema,
|
|
27804
27815
|
refresh: external_exports.literal("exact").optional()
|
|
@@ -27807,7 +27818,10 @@ var threadUsageInspectionSchema = external_exports.object({
|
|
|
27807
27818
|
threadId: hostThreadIdSchema,
|
|
27808
27819
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
27809
27820
|
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
27810
|
-
/**
|
|
27821
|
+
/** Prepaid funds for the Thread's Billing Source; shown only when no percentage quota exists. */
|
|
27822
|
+
accountBalance: accountBalanceSnapshotSchema.optional(),
|
|
27823
|
+
/** Whether this source can provide cached account quota (credits or a prepaid balance)
|
|
27824
|
+
* independently of usage. */
|
|
27811
27825
|
accountCreditsSupported: external_exports.boolean().optional()
|
|
27812
27826
|
}).strict();
|
|
27813
27827
|
|
|
@@ -27819,10 +27833,15 @@ var THREAD_OWNERSHIP_LIST_MAX_LENGTH = 100;
|
|
|
27819
27833
|
var nonBlankTextSchema2 = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
27820
27834
|
message: "Value must not be empty or whitespace"
|
|
27821
27835
|
});
|
|
27822
|
-
var harnessModelRefIdSchema =
|
|
27836
|
+
var harnessModelRefIdSchema = external_exports.string().min(1).max(HARNESS_MODEL_REF_MAX_LENGTH).refine((id4) => !new RegExp("\\p{Cc}", "u").test(id4), "Model Ref must not contain control characters").brand();
|
|
27837
|
+
var harnessModelServiceTierSchema = external_exports.enum(["priority", "ultrafast"]);
|
|
27823
27838
|
var harnessModelRefSchema = external_exports.object({
|
|
27824
|
-
id: harnessModelRefIdSchema
|
|
27839
|
+
id: harnessModelRefIdSchema,
|
|
27840
|
+
serviceTier: harnessModelServiceTierSchema.optional()
|
|
27825
27841
|
}).strict();
|
|
27842
|
+
function sameHarnessModelRef(left, right) {
|
|
27843
|
+
return left?.id === right?.id && left?.serviceTier === right?.serviceTier;
|
|
27844
|
+
}
|
|
27826
27845
|
var harnessThinkingOptionIdSchema = nonBlankTextSchema2.max(HARNESS_THINKING_OPTION_ID_MAX_LENGTH).regex(/^[A-Za-z0-9._~-]+$/u, "Thinking option ID must use transport-safe characters").brand();
|
|
27827
27846
|
var harnessResolvedModelLabelSchema = nonBlankTextSchema2.max(HARNESS_MODEL_LABEL_MAX_LENGTH);
|
|
27828
27847
|
var harnessThinkingOptionSchema = external_exports.object({
|
|
@@ -27836,7 +27855,15 @@ var harnessModelSchema = external_exports.object({
|
|
|
27836
27855
|
/** Optional opaque selection for this same Model with priority processing enabled. */
|
|
27837
27856
|
fastModel: harnessModelRefSchema.optional(),
|
|
27838
27857
|
supportedThinkingOptionIds: external_exports.array(harnessThinkingOptionIdSchema).optional()
|
|
27839
|
-
}).strict()
|
|
27858
|
+
}).strict().refine((model2) => model2.fastModel?.serviceTier === void 0 || model2.fastModel.id === model2.ref.id, {
|
|
27859
|
+
path: ["fastModel", "id"],
|
|
27860
|
+
message: "A tiered Fast Model must share the base Model ID"
|
|
27861
|
+
});
|
|
27862
|
+
function catalogModelForRef(catalog, ref) {
|
|
27863
|
+
if (!ref)
|
|
27864
|
+
return void 0;
|
|
27865
|
+
return catalog?.models.find((model2) => sameHarnessModelRef(model2.ref, ref) || sameHarnessModelRef(model2.fastModel, ref));
|
|
27866
|
+
}
|
|
27840
27867
|
var harnessThinkingOptionsSchema = external_exports.array(harnessThinkingOptionSchema).superRefine((options, context) => {
|
|
27841
27868
|
const ids = /* @__PURE__ */ new Set();
|
|
27842
27869
|
for (const [index, option] of options.entries()) {
|
|
@@ -27856,26 +27883,26 @@ var harnessModelCatalogSchema = external_exports.object({
|
|
|
27856
27883
|
thinkingOptions: harnessThinkingOptionsSchema,
|
|
27857
27884
|
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
27858
27885
|
}).strict().superRefine((catalog, context) => {
|
|
27859
|
-
const refs =
|
|
27860
|
-
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id:
|
|
27886
|
+
const refs = [];
|
|
27887
|
+
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id: id4 }) => id4));
|
|
27861
27888
|
for (const [index, model2] of catalog.models.entries()) {
|
|
27862
|
-
if (refs.
|
|
27889
|
+
if (refs.some((ref) => sameHarnessModelRef(ref, model2.ref))) {
|
|
27863
27890
|
context.addIssue({
|
|
27864
27891
|
code: "custom",
|
|
27865
27892
|
message: "Model Catalog refs must be unique",
|
|
27866
27893
|
path: ["models", index, "ref", "id"]
|
|
27867
27894
|
});
|
|
27868
27895
|
}
|
|
27869
|
-
refs.
|
|
27896
|
+
refs.push(model2.ref);
|
|
27870
27897
|
if (model2.fastModel) {
|
|
27871
|
-
if (refs.
|
|
27898
|
+
if (refs.some((ref) => sameHarnessModelRef(ref, model2.fastModel))) {
|
|
27872
27899
|
context.addIssue({
|
|
27873
27900
|
code: "custom",
|
|
27874
27901
|
message: "Fast Model refs must be distinct and unique",
|
|
27875
27902
|
path: ["models", index, "fastModel"]
|
|
27876
27903
|
});
|
|
27877
27904
|
}
|
|
27878
|
-
refs.
|
|
27905
|
+
refs.push(model2.fastModel);
|
|
27879
27906
|
}
|
|
27880
27907
|
const supportedThinkingIds = /* @__PURE__ */ new Set();
|
|
27881
27908
|
for (const [optionIndex, optionId] of (model2.supportedThinkingOptionIds ?? []).entries()) {
|
|
@@ -27896,7 +27923,7 @@ var harnessModelCatalogSchema = external_exports.object({
|
|
|
27896
27923
|
}
|
|
27897
27924
|
}
|
|
27898
27925
|
}
|
|
27899
|
-
if (catalog.defaultModel && !
|
|
27926
|
+
if (catalog.defaultModel && !catalogModelForRef(catalog, catalog.defaultModel)) {
|
|
27900
27927
|
context.addIssue({
|
|
27901
27928
|
code: "custom",
|
|
27902
27929
|
message: "Default Model must exist in the Model Catalog",
|
|
@@ -27936,7 +27963,12 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
|
|
|
27936
27963
|
observe: external_exports.boolean()
|
|
27937
27964
|
}).strict().optional(),
|
|
27938
27965
|
/** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
|
|
27939
|
-
steer: external_exports.boolean().optional()
|
|
27966
|
+
steer: external_exports.boolean().optional(),
|
|
27967
|
+
/**
|
|
27968
|
+
* True when the native plan (task list) outlives the Turn that changed it, so a reopened
|
|
27969
|
+
* Thread gets its latest plan again. Otherwise a plan stays with the Turn that made it.
|
|
27970
|
+
*/
|
|
27971
|
+
persistentPlan: external_exports.boolean().optional()
|
|
27940
27972
|
}).strict();
|
|
27941
27973
|
var harnessConfigurationStateSchema = external_exports.object({
|
|
27942
27974
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
@@ -27945,7 +27977,7 @@ var harnessConfigurationStateSchema = external_exports.object({
|
|
|
27945
27977
|
availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
|
|
27946
27978
|
effectivePermissionModeId: harnessPermissionModeIdSchema.optional()
|
|
27947
27979
|
}).strict().superRefine((state, context) => {
|
|
27948
|
-
if (state.effectiveThinkingOptionId && state.availableThinkingOptions && !state.availableThinkingOptions.some(({ id:
|
|
27980
|
+
if (state.effectiveThinkingOptionId && state.availableThinkingOptions && !state.availableThinkingOptions.some(({ id: id4 }) => id4 === state.effectiveThinkingOptionId)) {
|
|
27949
27981
|
context.addIssue({
|
|
27950
27982
|
code: "custom",
|
|
27951
27983
|
message: "Effective Thinking option must be currently available",
|
|
@@ -27985,7 +28017,8 @@ var harnessInspectParamsSchema = external_exports.object({
|
|
|
27985
28017
|
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
27986
28018
|
refresh: external_exports.boolean().optional(),
|
|
27987
28019
|
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
27988
|
-
purpose: external_exports.literal("availability").optional()
|
|
28020
|
+
purpose: external_exports.literal("availability").optional(),
|
|
28021
|
+
credentialAccess: external_exports.enum(["allow", "retry"]).optional()
|
|
27989
28022
|
}).strict();
|
|
27990
28023
|
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
27991
28024
|
harnessId: harnessIdSchema
|
|
@@ -28016,7 +28049,7 @@ var codexThreadInspectionSchema = external_exports.object({
|
|
|
28016
28049
|
var externalThreadInspectionSchema = external_exports.object({
|
|
28017
28050
|
owner: external_exports.literal("external"),
|
|
28018
28051
|
harnessId: nonBlankTextSchema2.max(256),
|
|
28019
|
-
transportModelId: nonBlankTextSchema2.max(
|
|
28052
|
+
transportModelId: nonBlankTextSchema2.max(HARNESS_TRANSPORT_MODEL_ID_MAX_LENGTH),
|
|
28020
28053
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
28021
28054
|
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
28022
28055
|
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
@@ -28098,13 +28131,635 @@ var threadSteeringInspectResultSchema = external_exports.object({
|
|
|
28098
28131
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
28099
28132
|
}).strict();
|
|
28100
28133
|
|
|
28134
|
+
// ../../shared-contracts/dist/harness-plugins.js
|
|
28135
|
+
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
28136
|
+
var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
|
|
28137
|
+
var HARNESS_PLUGIN_LIMIT = 128;
|
|
28138
|
+
var installedPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u);
|
|
28139
|
+
var installedHarnessPluginIdSchema = installedPluginIdSchema.pipe(harnessIdSchema);
|
|
28140
|
+
var harnessPluginIdSchema = installedHarnessPluginIdSchema.refine((id4) => id4 !== "codex", "The official Codex identity is reserved");
|
|
28141
|
+
var pluginRelativeResourceSchema = external_exports.string().min(1).max(512).refine((value) => !/[\\\u0000:#?]/u.test(value) && !value.startsWith("/") && !value.split("/").some((part) => part === ".." || part === ""), "Plugin resources must be relative paths inside the plugin");
|
|
28142
|
+
var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
|
|
28143
|
+
var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
|
|
28144
|
+
var harnessInstallationGuideSchema = external_exports.object({
|
|
28145
|
+
commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
|
|
28146
|
+
before: localizedTextSchema.optional(),
|
|
28147
|
+
after: localizedTextSchema.optional(),
|
|
28148
|
+
downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
|
|
28149
|
+
}).strict();
|
|
28150
|
+
var pluginPresentationShape = {
|
|
28151
|
+
id: installedHarnessPluginIdSchema,
|
|
28152
|
+
name: external_exports.string().trim().min(1).max(128),
|
|
28153
|
+
version: external_exports.string().min(1).max(128),
|
|
28154
|
+
/** Capability-only plugin; omitted for existing session-capable plugins. */
|
|
28155
|
+
kind: external_exports.literal("usage").optional(),
|
|
28156
|
+
/** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
|
|
28157
|
+
iconStyle: external_exports.object({
|
|
28158
|
+
vector: external_exports.object({
|
|
28159
|
+
viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
|
|
28160
|
+
color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
|
|
28161
|
+
paths: external_exports.array(external_exports.object({
|
|
28162
|
+
d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
|
|
28163
|
+
fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
|
|
28164
|
+
fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
|
|
28165
|
+
}).strict()).min(1).max(32)
|
|
28166
|
+
}).strict().optional(),
|
|
28167
|
+
background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
|
|
28168
|
+
borderRadius: external_exports.number().min(0).max(50).optional(),
|
|
28169
|
+
paddingRatio: external_exports.number().min(0).max(0.25).optional()
|
|
28170
|
+
}).strict().optional(),
|
|
28171
|
+
installation: harnessInstallationGuideSchema.optional(),
|
|
28172
|
+
notice: localizedTextSchema.optional(),
|
|
28173
|
+
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
28174
|
+
launchCommand: external_exports.literal(true).optional(),
|
|
28175
|
+
links: external_exports.object({
|
|
28176
|
+
website: documentationUrlSchema.optional(),
|
|
28177
|
+
documentation: documentationUrlSchema.optional(),
|
|
28178
|
+
installation: documentationUrlSchema.optional()
|
|
28179
|
+
}).strict().optional()
|
|
28180
|
+
};
|
|
28181
|
+
var harnessPluginManifestSchema = external_exports.object({
|
|
28182
|
+
manifestVersion: external_exports.literal(1),
|
|
28183
|
+
...pluginPresentationShape,
|
|
28184
|
+
adapterApiVersion: external_exports.number().int().positive(),
|
|
28185
|
+
entry: pluginRelativeResourceSchema,
|
|
28186
|
+
icon: pluginRelativeResourceSchema.optional()
|
|
28187
|
+
}).strict();
|
|
28188
|
+
var harnessPluginIconSchema = external_exports.string().max(Math.ceil(HARNESS_PLUGIN_ICON_MAX_BYTES / 3) * 4 + 64).regex(/^data:image\/(?:png|jpeg|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/u);
|
|
28189
|
+
var harnessPluginDescriptorSchema = external_exports.object({
|
|
28190
|
+
...pluginPresentationShape,
|
|
28191
|
+
icon: harnessPluginIconSchema.optional()
|
|
28192
|
+
}).strict();
|
|
28193
|
+
var harnessPluginListParamsSchema = external_exports.object({}).strict();
|
|
28194
|
+
var harnessPluginListResultSchema = external_exports.object({
|
|
28195
|
+
plugins: external_exports.array(harnessPluginDescriptorSchema.extend({ id: harnessPluginIdSchema })).max(HARNESS_PLUGIN_LIMIT)
|
|
28196
|
+
}).strict();
|
|
28197
|
+
var harnessPluginConfigurationSchema = external_exports.object({
|
|
28198
|
+
version: external_exports.literal(1),
|
|
28199
|
+
enabled: external_exports.array(installedHarnessPluginIdSchema).max(HARNESS_PLUGIN_LIMIT)
|
|
28200
|
+
}).strict().refine((value) => new Set(value.enabled).size === value.enabled.length, {
|
|
28201
|
+
message: "Enabled plugin IDs must be unique",
|
|
28202
|
+
path: ["enabled"]
|
|
28203
|
+
});
|
|
28204
|
+
|
|
28205
|
+
// ../../shared-contracts/dist/desktop-extensions.js
|
|
28206
|
+
var DESKTOP_EXTENSION_API_VERSION = 1;
|
|
28207
|
+
var DESKTOP_EXTENSION_LIMIT = 64;
|
|
28208
|
+
var DESKTOP_EXTENSION_ZIP_MAX_BYTES = 64 * 1024 * 1024;
|
|
28209
|
+
var DESKTOP_EXTENSION_MANIFEST_MAX_BYTES = 128 * 1024;
|
|
28210
|
+
var DESKTOP_EXTENSION_SCRIPT_MAX_BYTES = 2 * 1024 * 1024;
|
|
28211
|
+
var DESKTOP_EXTENSION_STYLE_MAX_BYTES = 256 * 1024;
|
|
28212
|
+
var DESKTOP_EXTENSION_ICON_MAX_BYTES = 128 * 1024;
|
|
28213
|
+
var DESKTOP_EXTENSION_SCREENSHOT_LIMIT = 4;
|
|
28214
|
+
var DESKTOP_EXTENSION_SCREENSHOT_MAX_BYTES = 512 * 1024;
|
|
28215
|
+
var DESKTOP_EXTENSION_LIST_SCREENSHOTS_MAX_BYTES = 8 * 1024 * 1024;
|
|
28216
|
+
var DESKTOP_EXTENSION_SNAPSHOT_MAX_BYTES = 8 * 1024 * 1024;
|
|
28217
|
+
var DESKTOP_EXTENSION_ASSET_MAX_BYTES = 16 * 1024 * 1024;
|
|
28218
|
+
var DESKTOP_EXTENSION_SETTINGS_MAX_BYTES = 1024 * 1024;
|
|
28219
|
+
var desktopExtensionIdSchema = installedPluginIdSchema;
|
|
28220
|
+
var desktopExtensionSlotSchema = external_exports.enum([
|
|
28221
|
+
"sidebar.thread-layout",
|
|
28222
|
+
"sidebar.thread-badge",
|
|
28223
|
+
"appearance.theme"
|
|
28224
|
+
]);
|
|
28225
|
+
var desktopExtensionCategorySchema = external_exports.enum([
|
|
28226
|
+
"appearance",
|
|
28227
|
+
"interface",
|
|
28228
|
+
"workflow",
|
|
28229
|
+
"analytics",
|
|
28230
|
+
"integrations",
|
|
28231
|
+
"tools"
|
|
28232
|
+
]);
|
|
28233
|
+
var extensionName = external_exports.string().trim().min(1).max(128);
|
|
28234
|
+
function desktopExtensionScreenshotMimeType(resource) {
|
|
28235
|
+
switch (resource.match(/\.([^./]+)$/u)?.[1]?.toLowerCase()) {
|
|
28236
|
+
case "png":
|
|
28237
|
+
return "image/png";
|
|
28238
|
+
case "jpg":
|
|
28239
|
+
case "jpeg":
|
|
28240
|
+
return "image/jpeg";
|
|
28241
|
+
case "webp":
|
|
28242
|
+
return "image/webp";
|
|
28243
|
+
default:
|
|
28244
|
+
return void 0;
|
|
28245
|
+
}
|
|
28246
|
+
}
|
|
28247
|
+
var hasPortableSegments = (resource) => resource.split("/").every((segment) => !/[. ]$/u.test(segment));
|
|
28248
|
+
var imagePathSchema = pluginRelativeResourceSchema.refine((resource) => desktopExtensionScreenshotMimeType(resource) !== void 0 && hasPortableSegments(resource), "Images must be relative .png, .jpg, .jpeg, or .webp paths with no segments ending in a dot or space");
|
|
28249
|
+
var desktopExtensionHttpUrlSchema = external_exports.string().trim().max(2048).regex(/^https?:\/\/[^/?#\\\s]+/iu, "Expected an HTTP(S) URL").pipe(external_exports.url({ protocol: /^https?$/u })).refine((value) => {
|
|
28250
|
+
const { username, password } = new URL(value);
|
|
28251
|
+
return !username && !password && !/[\\\s]/u.test(value);
|
|
28252
|
+
}, "URL must not contain credentials, backslashes, or whitespace");
|
|
28253
|
+
function localizedText(text) {
|
|
28254
|
+
return external_exports.strictObject({ en: text, "zh-CN": text });
|
|
28255
|
+
}
|
|
28256
|
+
var desktopExtensionLocalizedTextSchema = localizedText(external_exports.string().trim().min(1));
|
|
28257
|
+
var categoriesSchema = external_exports.array(desktopExtensionCategorySchema).max(desktopExtensionCategorySchema.options.length).refine((categories) => new Set(categories).size === categories.length, "Duplicate categories");
|
|
28258
|
+
var slotsSchema = external_exports.array(desktopExtensionSlotSchema).max(desktopExtensionSlotSchema.options.length).refine((slots) => new Set(slots).size === slots.length, "Duplicate slots");
|
|
28259
|
+
var settingField = {
|
|
28260
|
+
key: external_exports.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/u),
|
|
28261
|
+
label: desktopExtensionLocalizedTextSchema,
|
|
28262
|
+
description: desktopExtensionLocalizedTextSchema.optional()
|
|
28263
|
+
};
|
|
28264
|
+
var numericSetting = {
|
|
28265
|
+
...settingField,
|
|
28266
|
+
step: external_exports.number().positive().optional(),
|
|
28267
|
+
default: external_exports.number().optional()
|
|
28268
|
+
};
|
|
28269
|
+
var settingOption = external_exports.strictObject({
|
|
28270
|
+
value: external_exports.string(),
|
|
28271
|
+
label: desktopExtensionLocalizedTextSchema
|
|
28272
|
+
});
|
|
28273
|
+
var desktopExtensionSettingFieldSchema = external_exports.discriminatedUnion("type", [
|
|
28274
|
+
external_exports.strictObject({
|
|
28275
|
+
...settingField,
|
|
28276
|
+
type: external_exports.literal("boolean"),
|
|
28277
|
+
default: external_exports.boolean().optional()
|
|
28278
|
+
}),
|
|
28279
|
+
external_exports.strictObject({
|
|
28280
|
+
...settingField,
|
|
28281
|
+
type: external_exports.literal("string"),
|
|
28282
|
+
placeholder: desktopExtensionLocalizedTextSchema.optional(),
|
|
28283
|
+
default: external_exports.string().optional()
|
|
28284
|
+
}),
|
|
28285
|
+
external_exports.strictObject({
|
|
28286
|
+
...numericSetting,
|
|
28287
|
+
type: external_exports.literal("number"),
|
|
28288
|
+
min: external_exports.number().optional(),
|
|
28289
|
+
max: external_exports.number().optional()
|
|
28290
|
+
}),
|
|
28291
|
+
external_exports.strictObject({
|
|
28292
|
+
...numericSetting,
|
|
28293
|
+
type: external_exports.literal("range"),
|
|
28294
|
+
min: external_exports.number(),
|
|
28295
|
+
max: external_exports.number()
|
|
28296
|
+
}),
|
|
28297
|
+
external_exports.strictObject({
|
|
28298
|
+
...settingField,
|
|
28299
|
+
type: external_exports.literal("select"),
|
|
28300
|
+
options: external_exports.array(settingOption).min(1),
|
|
28301
|
+
default: external_exports.string().optional()
|
|
28302
|
+
})
|
|
28303
|
+
]).superRefine((field2, ctx) => {
|
|
28304
|
+
const issue2 = (path10, message) => ctx.addIssue({ code: "custom", path: [path10], message });
|
|
28305
|
+
if (field2.type === "number" || field2.type === "range") {
|
|
28306
|
+
const { min = -Infinity, max = Infinity, default: value } = field2;
|
|
28307
|
+
if (min > max)
|
|
28308
|
+
issue2("max", "Must be at least min");
|
|
28309
|
+
if (value !== void 0 && (value < min || value > max))
|
|
28310
|
+
issue2("default", "Must be within min and max");
|
|
28311
|
+
} else if (field2.type === "select") {
|
|
28312
|
+
const values = new Set(field2.options.map(({ value }) => value));
|
|
28313
|
+
if (values.size !== field2.options.length)
|
|
28314
|
+
issue2("options", "Duplicate option values");
|
|
28315
|
+
if (field2.default !== void 0 && !values.has(field2.default))
|
|
28316
|
+
issue2("default", "Must match an option value");
|
|
28317
|
+
}
|
|
28318
|
+
});
|
|
28319
|
+
var manifestHeader = external_exports.object({
|
|
28320
|
+
manifestVersion: external_exports.int().positive(),
|
|
28321
|
+
id: desktopExtensionIdSchema,
|
|
28322
|
+
name: external_exports.union([extensionName, localizedText(extensionName)]),
|
|
28323
|
+
version: external_exports.string().min(1).max(128),
|
|
28324
|
+
desktopApi: external_exports.int().positive()
|
|
28325
|
+
}).passthrough();
|
|
28326
|
+
var desktopExtensionManifestSchema = manifestHeader.extend({
|
|
28327
|
+
manifestVersion: external_exports.literal(1),
|
|
28328
|
+
desktopApi: external_exports.literal(DESKTOP_EXTENSION_API_VERSION),
|
|
28329
|
+
description: external_exports.strictObject({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).optional(),
|
|
28330
|
+
author: external_exports.string().trim().min(1).max(128).optional(),
|
|
28331
|
+
repository: desktopExtensionHttpUrlSchema.optional(),
|
|
28332
|
+
details: external_exports.strictObject({ en: external_exports.string().max(16384), "zh-CN": external_exports.string().max(16384).optional() }).optional(),
|
|
28333
|
+
icon: imagePathSchema.optional(),
|
|
28334
|
+
screenshots: external_exports.array(imagePathSchema).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).refine((screenshots) => new Set(screenshots).size === screenshots.length, "Duplicate screenshots").optional(),
|
|
28335
|
+
desktop: external_exports.strictObject({
|
|
28336
|
+
script: pluginRelativeResourceSchema,
|
|
28337
|
+
style: pluginRelativeResourceSchema.optional()
|
|
28338
|
+
}).optional(),
|
|
28339
|
+
backend: external_exports.strictObject({ script: pluginRelativeResourceSchema.refine(hasPortableSegments) }).optional(),
|
|
28340
|
+
slots: slotsSchema.default(() => []),
|
|
28341
|
+
settingsSchema: external_exports.array(desktopExtensionSettingFieldSchema).max(32).refine((fields) => new Set(fields.map(({ key }) => key)).size === fields.length, "Duplicate setting keys").optional(),
|
|
28342
|
+
categories: categoriesSchema.optional()
|
|
28343
|
+
}).strict().refine((manifest) => manifest.desktop !== void 0 || manifest.backend !== void 0, "Expected at least one desktop or backend entry");
|
|
28344
|
+
var desktopExtensionHashSchema = external_exports.string().regex(/^[a-f0-9]{64}$/u);
|
|
28345
|
+
var desktopExtensionStatusSchema = external_exports.strictObject({
|
|
28346
|
+
state: external_exports.enum([
|
|
28347
|
+
"running",
|
|
28348
|
+
"disabled",
|
|
28349
|
+
"invalid",
|
|
28350
|
+
"incompatible",
|
|
28351
|
+
"conflict",
|
|
28352
|
+
"failed",
|
|
28353
|
+
"waiting"
|
|
28354
|
+
]),
|
|
28355
|
+
hash: desktopExtensionHashSchema.optional(),
|
|
28356
|
+
error: external_exports.string().optional(),
|
|
28357
|
+
conflictWith: desktopExtensionIdSchema.optional()
|
|
28358
|
+
});
|
|
28359
|
+
var desktopExtensionsDiagnosticSchema = external_exports.strictObject({
|
|
28360
|
+
controllerPid: external_exports.int().positive(),
|
|
28361
|
+
targetId: external_exports.string().nullable(),
|
|
28362
|
+
updatedAt: external_exports.iso.datetime(),
|
|
28363
|
+
handledReloadToken: external_exports.uuid().optional(),
|
|
28364
|
+
extensions: external_exports.record(external_exports.string(), desktopExtensionStatusSchema),
|
|
28365
|
+
surfaces: external_exports.record(external_exports.string(), desktopExtensionStatusSchema).optional()
|
|
28366
|
+
});
|
|
28367
|
+
var desktopExtensionTrustTierSchema = external_exports.enum(["official", "community"]);
|
|
28368
|
+
function isGitHubDesktopExtensionZipballUrl(url2) {
|
|
28369
|
+
return url2.origin === "https://api.github.com" && /^\/repos\/[\w-]+\/[\w.-]+\/zipball(?:\/[^/]+)?\/?$/u.test(url2.pathname);
|
|
28370
|
+
}
|
|
28371
|
+
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input) => {
|
|
28372
|
+
const url2 = new URL(input);
|
|
28373
|
+
return /\.zip$/iu.test(url2.pathname) || isGitHubDesktopExtensionZipballUrl(url2) || url2.origin === "https://github.com" && /^\/[\w-]+\/[\w.-]+\/zipball(?:\/.+)?\/?$/u.test(url2.pathname) || url2.origin === "https://codeload.github.com" && /^\/[\w-]+\/[\w.-]+\/(?:zip|zipball|legacy\.zip)\/.+$/u.test(url2.pathname);
|
|
28374
|
+
}, "Expected a .zip download URL or a GitHub zipball URL");
|
|
28375
|
+
var desktopExtensionCatalogEntrySchema = external_exports.strictObject({
|
|
28376
|
+
id: desktopExtensionIdSchema,
|
|
28377
|
+
version: external_exports.string().trim().min(1).max(128),
|
|
28378
|
+
name: desktopExtensionLocalizedTextSchema.extend({ en: extensionName, "zh-CN": extensionName }),
|
|
28379
|
+
description: localizedText(external_exports.string().trim().min(1).max(4096)),
|
|
28380
|
+
details: localizedText(external_exports.string().trim().min(1).max(16384)).optional(),
|
|
28381
|
+
author: external_exports.string().trim().min(1).max(128),
|
|
28382
|
+
repository: desktopExtensionHttpUrlSchema,
|
|
28383
|
+
stars: external_exports.number().int().min(0).optional(),
|
|
28384
|
+
downloads: external_exports.number().int().min(0).optional(),
|
|
28385
|
+
categories: categoriesSchema.optional(),
|
|
28386
|
+
trustTier: desktopExtensionTrustTierSchema.default("community"),
|
|
28387
|
+
icon: desktopExtensionHttpUrlSchema.optional(),
|
|
28388
|
+
screenshots: external_exports.array(desktopExtensionHttpUrlSchema).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).optional(),
|
|
28389
|
+
downloadUrl: desktopExtensionZipUrlSchema,
|
|
28390
|
+
sha256: desktopExtensionHashSchema,
|
|
28391
|
+
slots: slotsSchema.optional(),
|
|
28392
|
+
publishedAt: external_exports.string().optional(),
|
|
28393
|
+
updatedAt: external_exports.string().optional(),
|
|
28394
|
+
minCodexHostVersion: external_exports.string().optional()
|
|
28395
|
+
});
|
|
28396
|
+
var desktopExtensionCatalogSchema = external_exports.strictObject({
|
|
28397
|
+
schemaVersion: external_exports.literal(1),
|
|
28398
|
+
generatedAt: external_exports.string(),
|
|
28399
|
+
extensions: external_exports.array(desktopExtensionCatalogEntrySchema).refine((entries) => new Set(entries.map(({ id: id4 }) => id4)).size === entries.length, "Duplicate extension IDs")
|
|
28400
|
+
});
|
|
28401
|
+
var desktopExtensionBackendMethodSchema = external_exports.string().trim().min(1).max(128);
|
|
28402
|
+
|
|
28403
|
+
// ../../shared-contracts/dist/host-extensions.js
|
|
28404
|
+
var reservedName = /^(?:con|prn|aux|nul|com[1-9¹²³]|lpt[1-9¹²³]) *(?:\.|$)/iu;
|
|
28405
|
+
var HOST_EXTENSION_PAGE_API_VERSION = 1;
|
|
28406
|
+
var hostExtensionIdSchema = desktopExtensionIdSchema.refine((id4) => !reservedName.test(id4), "Reserved extension ID");
|
|
28407
|
+
var hostExtensionTargetSchema = external_exports.enum(["desktop", "web"]);
|
|
28408
|
+
var hostExtensionDigestSchema = desktopExtensionHashSchema;
|
|
28409
|
+
var hostExtensionActivationIdSchema = external_exports.uuid();
|
|
28410
|
+
var hostExtensionResourcePathSchema = pluginRelativeResourceSchema.refine((resource) => !/[\x00-\x1f\x7f<>"|*]/u.test(resource) && resource.split("/").every((part) => !/[. ]$/u.test(part) && !reservedName.test(part)), "Expected a portable relative resource path").refine((path10) => path10.split("/").length <= 32, "Extension resources may be at most 32 segments deep");
|
|
28411
|
+
var legacy = desktopExtensionManifestSchema.shape;
|
|
28412
|
+
var localized = (max, min = 0) => external_exports.strictObject({
|
|
28413
|
+
en: external_exports.string().trim().min(min).max(max),
|
|
28414
|
+
"zh-CN": external_exports.string().trim().min(min).max(max)
|
|
28415
|
+
});
|
|
28416
|
+
var resourceWithSuffix = (suffix) => hostExtensionResourcePathSchema.refine((path10) => path10.endsWith(suffix), `Expected a ${suffix} file`);
|
|
28417
|
+
var moduleEntry = resourceWithSuffix(".mjs");
|
|
28418
|
+
var style = resourceWithSuffix(".css").optional();
|
|
28419
|
+
var hostExtensionCanonicalPath = (path10) => path10.normalize("NFC").toLowerCase();
|
|
28420
|
+
var hostExtensionManifestV2Schema = external_exports.strictObject({
|
|
28421
|
+
manifestVersion: external_exports.literal(2),
|
|
28422
|
+
id: hostExtensionIdSchema,
|
|
28423
|
+
name: localized(128, 1),
|
|
28424
|
+
version: external_exports.string().trim().min(1).max(128),
|
|
28425
|
+
description: localized(4096),
|
|
28426
|
+
details: localized(16384).optional(),
|
|
28427
|
+
author: legacy.author,
|
|
28428
|
+
repository: legacy.repository,
|
|
28429
|
+
icon: legacy.icon.refine((path10) => path10 === void 0 || hostExtensionResourcePathSchema.safeParse(path10).success),
|
|
28430
|
+
screenshots: legacy.screenshots.refine((paths) => paths === void 0 || paths.every((path10) => hostExtensionResourcePathSchema.safeParse(path10).success)),
|
|
28431
|
+
categories: legacy.categories,
|
|
28432
|
+
settingsSchema: legacy.settingsSchema,
|
|
28433
|
+
slots: legacy.slots.removeDefault().optional(),
|
|
28434
|
+
page: external_exports.strictObject({
|
|
28435
|
+
apiVersion: external_exports.literal(HOST_EXTENSION_PAGE_API_VERSION),
|
|
28436
|
+
entry: moduleEntry,
|
|
28437
|
+
style,
|
|
28438
|
+
title: localized(128, 1).optional()
|
|
28439
|
+
}).optional(),
|
|
28440
|
+
widget: external_exports.strictObject({
|
|
28441
|
+
apiVersion: external_exports.literal(HOST_EXTENSION_PAGE_API_VERSION),
|
|
28442
|
+
entry: moduleEntry,
|
|
28443
|
+
style
|
|
28444
|
+
}).optional(),
|
|
28445
|
+
desktop: external_exports.strictObject({ apiVersion: external_exports.literal(1), script: resourceWithSuffix(".js"), style }).optional(),
|
|
28446
|
+
web: external_exports.strictObject({ apiVersion: external_exports.literal(1), entry: moduleEntry.optional(), style }).refine(({ entry, style: style2 }) => entry !== void 0 || style2 !== void 0, "Expected a Web entry or style").optional(),
|
|
28447
|
+
backend: external_exports.strictObject({ apiVersion: external_exports.literal(1), entry: moduleEntry }).optional()
|
|
28448
|
+
}).refine(({ page, widget, desktop, web, backend }) => Boolean(page || widget || desktop || web || backend), "Expected at least one page, widget, desktop, web, or backend entry").refine(({ page, widget, web, backend }) => !backend || [page?.entry, widget?.entry, web?.entry].every((entry) => entry === void 0 || hostExtensionCanonicalPath(entry) !== hostExtensionCanonicalPath(backend.entry)), { path: ["backend", "entry"], message: "A backend entry cannot also be a frontend entry" });
|
|
28449
|
+
function targetsForCapabilities({ hasPage, hasWidget, hasDesktop, hasWeb, hasBackend }) {
|
|
28450
|
+
if (hasPage || hasWidget || hasBackend && !hasDesktop && !hasWeb)
|
|
28451
|
+
return ["desktop", "web"];
|
|
28452
|
+
const targets = [];
|
|
28453
|
+
if (hasDesktop)
|
|
28454
|
+
targets.push("desktop");
|
|
28455
|
+
if (hasWeb)
|
|
28456
|
+
targets.push("web");
|
|
28457
|
+
return targets;
|
|
28458
|
+
}
|
|
28459
|
+
var hostExtensionBackendMethodSchema = desktopExtensionBackendMethodSchema;
|
|
28460
|
+
|
|
28461
|
+
// ../../shared-contracts/dist/host-extension-management.js
|
|
28462
|
+
var HOST_EXTENSION_ZIP_MAX_BYTES = DESKTOP_EXTENSION_ZIP_MAX_BYTES;
|
|
28463
|
+
var hostExtensionRevisionSchema = external_exports.int().nonnegative();
|
|
28464
|
+
var hostExtensionConfigurationSchema = external_exports.strictObject({
|
|
28465
|
+
revision: hostExtensionRevisionSchema,
|
|
28466
|
+
enabled: external_exports.array(hostExtensionIdSchema).max(DESKTOP_EXTENSION_LIMIT).refine((ids) => new Set(ids).size === ids.length, "Duplicate extension IDs")
|
|
28467
|
+
});
|
|
28468
|
+
var { downloadUrl, ...catalogMetadata } = desktopExtensionCatalogEntrySchema.shape;
|
|
28469
|
+
var hostExtensionCatalogEntrySchema = external_exports.object({
|
|
28470
|
+
...catalogMetadata,
|
|
28471
|
+
id: hostExtensionIdSchema,
|
|
28472
|
+
format: external_exports.literal("codexhost"),
|
|
28473
|
+
targets: external_exports.array(hostExtensionTargetSchema).min(1).max(2).refine((targets) => new Set(targets).size === targets.length, "Duplicate targets"),
|
|
28474
|
+
apis: external_exports.strictObject({
|
|
28475
|
+
page: external_exports.int().positive().optional(),
|
|
28476
|
+
widget: external_exports.int().positive().optional(),
|
|
28477
|
+
desktop: external_exports.int().positive().optional(),
|
|
28478
|
+
web: external_exports.int().positive().optional(),
|
|
28479
|
+
backend: external_exports.int().positive().optional()
|
|
28480
|
+
}),
|
|
28481
|
+
downloadUrl: downloadUrl.refine((url2) => url2.startsWith("https://"), "Expected HTTPS")
|
|
28482
|
+
}).refine(({ targets, apis }) => {
|
|
28483
|
+
const derived = targetsForCapabilities({
|
|
28484
|
+
hasPage: Boolean(apis.page),
|
|
28485
|
+
hasWidget: Boolean(apis.widget),
|
|
28486
|
+
hasDesktop: Boolean(apis.desktop),
|
|
28487
|
+
hasWeb: Boolean(apis.web),
|
|
28488
|
+
hasBackend: Boolean(apis.backend)
|
|
28489
|
+
});
|
|
28490
|
+
return targets.length === derived.length && derived.every((target2) => targets.includes(target2));
|
|
28491
|
+
}, "Catalog targets must match the declared APIs");
|
|
28492
|
+
var hostExtensionCatalogSchema = external_exports.object({
|
|
28493
|
+
schemaVersion: external_exports.literal(2),
|
|
28494
|
+
generatedAt: external_exports.string().min(1),
|
|
28495
|
+
extensions: external_exports.array(hostExtensionCatalogEntrySchema).max(1e4).refine((entries) => new Set(entries.map(({ id: id4 }) => id4)).size === entries.length, "Duplicate extension IDs")
|
|
28496
|
+
});
|
|
28497
|
+
var hostExtensionsCatalogResultSchema = hostExtensionCatalogSchema.extend({
|
|
28498
|
+
catalogUrl: desktopExtensionHttpUrlSchema,
|
|
28499
|
+
fetchedAt: external_exports.iso.datetime(),
|
|
28500
|
+
cached: external_exports.boolean()
|
|
28501
|
+
});
|
|
28502
|
+
var id = { id: hostExtensionIdSchema };
|
|
28503
|
+
var active = {
|
|
28504
|
+
...id,
|
|
28505
|
+
activationId: hostExtensionActivationIdSchema,
|
|
28506
|
+
digest: hostExtensionDigestSchema
|
|
28507
|
+
};
|
|
28508
|
+
var optionalActivation = { ...id, activationId: active.activationId.optional() };
|
|
28509
|
+
var filePath = external_exports.string().min(1).max(4096).refine((path10) => /^(?:\/|[a-z]:[/\\])/iu.test(path10) && !path10.includes("\0") && !path10.split(/[/\\]/u).some((part) => part === "." || part === ".."), "Expected an absolute local path without dot segments");
|
|
28510
|
+
var gitRef = external_exports.string().min(1).max(256).refine((ref) => ref.split("/").every((part) => part && /^[a-z0-9_.-]+$/iu.test(part) && part !== "." && part !== ".."), "Invalid GitHub ref");
|
|
28511
|
+
function base643(maxBytes) {
|
|
28512
|
+
return external_exports.string().max(4 * Math.ceil(maxBytes / 3)).refine((value) => {
|
|
28513
|
+
const padding = value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0;
|
|
28514
|
+
return value.length % 4 === 0 && value.length * 3 / 4 - padding <= maxBytes && /^[A-Za-z0-9+/]*={0,2}$/u.test(value);
|
|
28515
|
+
}, "Expected bounded standard padded base64");
|
|
28516
|
+
}
|
|
28517
|
+
var hostExtensionGitHubSourceSchema = external_exports.strictObject({
|
|
28518
|
+
type: external_exports.literal("github"),
|
|
28519
|
+
repository: external_exports.string().max(150).regex(/^[a-z0-9-]+\/[a-z0-9_-][a-z0-9_.-]*$/iu),
|
|
28520
|
+
ref: gitRef.optional(),
|
|
28521
|
+
tag: gitRef.optional(),
|
|
28522
|
+
asset: external_exports.string().max(255).regex(/^[a-z0-9_.-]+\.zip$/iu).optional(),
|
|
28523
|
+
subpath: hostExtensionResourcePathSchema.optional()
|
|
28524
|
+
}).refine(({ ref, tag, asset }) => !ref || !tag && !asset, "Use either a zipball ref or a release tag/asset");
|
|
28525
|
+
var hostExtensionInstallSourceSchema = external_exports.union([
|
|
28526
|
+
external_exports.strictObject({ type: external_exports.literal("catalog"), ...id }),
|
|
28527
|
+
hostExtensionGitHubSourceSchema,
|
|
28528
|
+
external_exports.strictObject({ type: external_exports.literal("zip"), base64: base643(HOST_EXTENSION_ZIP_MAX_BYTES).min(4) }),
|
|
28529
|
+
external_exports.strictObject({ type: external_exports.literal("zip"), localZipPath: filePath }),
|
|
28530
|
+
external_exports.strictObject({ type: external_exports.literal("localDir"), localDir: filePath })
|
|
28531
|
+
]);
|
|
28532
|
+
var hostExtensionProvenanceSchema = external_exports.discriminatedUnion("type", [
|
|
28533
|
+
external_exports.strictObject({ type: external_exports.literal("catalog"), ...id }),
|
|
28534
|
+
hostExtensionGitHubSourceSchema,
|
|
28535
|
+
external_exports.strictObject({ type: external_exports.literal("zip") }),
|
|
28536
|
+
external_exports.strictObject({ type: external_exports.literal("localDir") })
|
|
28537
|
+
]);
|
|
28538
|
+
var hostExtensionInstallationSchema = external_exports.strictObject({
|
|
28539
|
+
...active,
|
|
28540
|
+
manifest: hostExtensionManifestV2Schema,
|
|
28541
|
+
installedAt: external_exports.iso.datetime(),
|
|
28542
|
+
source: hostExtensionProvenanceSchema.optional()
|
|
28543
|
+
});
|
|
28544
|
+
var rasterDataUrlSchema = (maxBytes) => external_exports.string().max("data:image/jpeg;base64,".length + 4 * Math.ceil(maxBytes / 3)).regex(/^data:image\/(?:png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/u);
|
|
28545
|
+
var desktopConflict = { desktopConflictWith: hostExtensionIdSchema.optional() };
|
|
28546
|
+
var backendState = external_exports.enum(["none", "inactive", "starting", "running", "failed"]);
|
|
28547
|
+
var hostExtensionListItemSchema = external_exports.discriminatedUnion("state", [
|
|
28548
|
+
hostExtensionInstallationSchema.extend({
|
|
28549
|
+
state: external_exports.literal("valid"),
|
|
28550
|
+
enabled: external_exports.boolean(),
|
|
28551
|
+
...desktopConflict,
|
|
28552
|
+
iconDataUrl: rasterDataUrlSchema(DESKTOP_EXTENSION_ICON_MAX_BYTES).optional(),
|
|
28553
|
+
screenshotDataUrls: external_exports.array(rasterDataUrlSchema(DESKTOP_EXTENSION_SCREENSHOT_MAX_BYTES)).max(DESKTOP_EXTENSION_SCREENSHOT_LIMIT).optional(),
|
|
28554
|
+
backendState: backendState.optional(),
|
|
28555
|
+
backendError: external_exports.string().optional()
|
|
28556
|
+
}),
|
|
28557
|
+
external_exports.strictObject({
|
|
28558
|
+
state: external_exports.enum(["invalid", "incompatible"]),
|
|
28559
|
+
id: external_exports.string().min(1),
|
|
28560
|
+
enabled: external_exports.boolean(),
|
|
28561
|
+
error: external_exports.string()
|
|
28562
|
+
})
|
|
28563
|
+
]);
|
|
28564
|
+
var hostExtensionsListResultSchema = external_exports.strictObject({
|
|
28565
|
+
revision: hostExtensionRevisionSchema,
|
|
28566
|
+
configuration: hostExtensionConfigurationSchema,
|
|
28567
|
+
diagnostics: external_exports.array(external_exports.string()),
|
|
28568
|
+
extensions: external_exports.array(hostExtensionListItemSchema)
|
|
28569
|
+
});
|
|
28570
|
+
var hostExtensionRuntimeEntrySchema = hostExtensionInstallationSchema.extend({
|
|
28571
|
+
...desktopConflict,
|
|
28572
|
+
settingsRevision: hostExtensionRevisionSchema
|
|
28573
|
+
});
|
|
28574
|
+
var hostExtensionsSnapshotResultSchema = external_exports.strictObject({
|
|
28575
|
+
/** The Host publishes this revision in extensions-changed, independent of enabled.json's revision. */
|
|
28576
|
+
revision: hostExtensionRevisionSchema,
|
|
28577
|
+
// Enabled, valid activations only. A Desktop conflict does not hide other capabilities.
|
|
28578
|
+
extensions: external_exports.array(hostExtensionRuntimeEntrySchema).max(DESKTOP_EXTENSION_LIMIT)
|
|
28579
|
+
});
|
|
28580
|
+
var HOST_EXTENSIONS_RPC = {
|
|
28581
|
+
list: "codexhost/extensions/list",
|
|
28582
|
+
snapshot: "codexhost/extensions/snapshot",
|
|
28583
|
+
catalog: "codexhost/extensions/catalog",
|
|
28584
|
+
install: "codexhost/extensions/install",
|
|
28585
|
+
update: "codexhost/extensions/update",
|
|
28586
|
+
enable: "codexhost/extensions/enable",
|
|
28587
|
+
disable: "codexhost/extensions/disable",
|
|
28588
|
+
uninstall: "codexhost/extensions/uninstall",
|
|
28589
|
+
recover: "codexhost/extensions/recover",
|
|
28590
|
+
asset: "codexhost/extensions/asset",
|
|
28591
|
+
settingsGet: "codexhost/extensions/settings/get",
|
|
28592
|
+
settingsSet: "codexhost/extensions/settings/set",
|
|
28593
|
+
backendInvoke: "codexhost/extensions/backend/invoke"
|
|
28594
|
+
};
|
|
28595
|
+
var HOST_EXTENSION_MANAGEMENT_METHODS = Object.freeze(Object.values(HOST_EXTENSIONS_RPC));
|
|
28596
|
+
var methods = new Set(HOST_EXTENSION_MANAGEMENT_METHODS);
|
|
28597
|
+
var noParams = external_exports.strictObject({});
|
|
28598
|
+
var expectedRevision = { expectedRevision: hostExtensionRevisionSchema };
|
|
28599
|
+
var selection = external_exports.strictObject({ ...id, ...expectedRevision });
|
|
28600
|
+
var installationResult = hostExtensionInstallationSchema.extend({ replaced: external_exports.boolean() });
|
|
28601
|
+
var mutationResult = external_exports.discriminatedUnion("state", [
|
|
28602
|
+
external_exports.strictObject({ state: external_exports.literal("saved"), configuration: hostExtensionConfigurationSchema }),
|
|
28603
|
+
external_exports.strictObject({ state: external_exports.literal("revision-conflict"), revision: hostExtensionRevisionSchema })
|
|
28604
|
+
]);
|
|
28605
|
+
var hostExtensionsAssetParamsSchema = external_exports.strictObject({
|
|
28606
|
+
...optionalActivation,
|
|
28607
|
+
digest: active.digest.optional(),
|
|
28608
|
+
path: hostExtensionResourcePathSchema
|
|
28609
|
+
});
|
|
28610
|
+
var hostExtensionsAssetResultSchema = external_exports.strictObject({
|
|
28611
|
+
mimeType: external_exports.string().min(1),
|
|
28612
|
+
base64: base643(DESKTOP_EXTENSION_ASSET_MAX_BYTES),
|
|
28613
|
+
digest: active.digest
|
|
28614
|
+
});
|
|
28615
|
+
var hostExtensionSettingsSchema = external_exports.strictObject({
|
|
28616
|
+
settingsRevision: hostExtensionRevisionSchema,
|
|
28617
|
+
values: jsonObjectSchema
|
|
28618
|
+
});
|
|
28619
|
+
var hostExtensionsRpcSchemas = {
|
|
28620
|
+
[HOST_EXTENSIONS_RPC.list]: { params: noParams, result: hostExtensionsListResultSchema },
|
|
28621
|
+
[HOST_EXTENSIONS_RPC.snapshot]: { params: noParams, result: hostExtensionsSnapshotResultSchema },
|
|
28622
|
+
[HOST_EXTENSIONS_RPC.catalog]: {
|
|
28623
|
+
params: external_exports.strictObject({ forceRefresh: external_exports.boolean().optional() }),
|
|
28624
|
+
result: hostExtensionsCatalogResultSchema
|
|
28625
|
+
},
|
|
28626
|
+
[HOST_EXTENSIONS_RPC.install]: {
|
|
28627
|
+
params: external_exports.strictObject({ source: hostExtensionInstallSourceSchema }),
|
|
28628
|
+
result: installationResult
|
|
28629
|
+
},
|
|
28630
|
+
[HOST_EXTENSIONS_RPC.update]: {
|
|
28631
|
+
params: external_exports.strictObject({
|
|
28632
|
+
...id,
|
|
28633
|
+
expectedDigest: active.digest,
|
|
28634
|
+
expectedActivationId: active.activationId.optional(),
|
|
28635
|
+
source: hostExtensionInstallSourceSchema.optional()
|
|
28636
|
+
}),
|
|
28637
|
+
result: installationResult
|
|
28638
|
+
},
|
|
28639
|
+
[HOST_EXTENSIONS_RPC.enable]: { params: selection, result: mutationResult },
|
|
28640
|
+
[HOST_EXTENSIONS_RPC.disable]: { params: selection, result: mutationResult },
|
|
28641
|
+
[HOST_EXTENSIONS_RPC.uninstall]: {
|
|
28642
|
+
params: external_exports.strictObject({
|
|
28643
|
+
...id,
|
|
28644
|
+
removeData: external_exports.boolean().optional(),
|
|
28645
|
+
expectedDigest: active.digest.optional()
|
|
28646
|
+
}),
|
|
28647
|
+
result: external_exports.strictObject({ ...id, removed: external_exports.boolean() })
|
|
28648
|
+
},
|
|
28649
|
+
[HOST_EXTENSIONS_RPC.recover]: {
|
|
28650
|
+
params: external_exports.strictObject({ expectedRevision: expectedRevision.expectedRevision.optional() }),
|
|
28651
|
+
result: mutationResult
|
|
28652
|
+
},
|
|
28653
|
+
[HOST_EXTENSIONS_RPC.asset]: {
|
|
28654
|
+
params: hostExtensionsAssetParamsSchema,
|
|
28655
|
+
result: hostExtensionsAssetResultSchema
|
|
28656
|
+
},
|
|
28657
|
+
[HOST_EXTENSIONS_RPC.settingsGet]: {
|
|
28658
|
+
params: external_exports.strictObject(optionalActivation),
|
|
28659
|
+
result: hostExtensionSettingsSchema
|
|
28660
|
+
},
|
|
28661
|
+
[HOST_EXTENSIONS_RPC.settingsSet]: {
|
|
28662
|
+
params: external_exports.strictObject({
|
|
28663
|
+
...optionalActivation,
|
|
28664
|
+
expectedSettingsRevision: hostExtensionRevisionSchema,
|
|
28665
|
+
values: jsonObjectSchema
|
|
28666
|
+
}),
|
|
28667
|
+
result: hostExtensionSettingsSchema
|
|
28668
|
+
},
|
|
28669
|
+
[HOST_EXTENSIONS_RPC.backendInvoke]: {
|
|
28670
|
+
params: external_exports.strictObject({
|
|
28671
|
+
...optionalActivation,
|
|
28672
|
+
method: hostExtensionBackendMethodSchema,
|
|
28673
|
+
params: jsonValueSchema.optional()
|
|
28674
|
+
}),
|
|
28675
|
+
result: external_exports.strictObject({ result: jsonValueSchema })
|
|
28676
|
+
}
|
|
28677
|
+
};
|
|
28678
|
+
|
|
28101
28679
|
// ../../shared-contracts/dist/thread-archive-confirm.js
|
|
28680
|
+
var THREAD_ARCHIVE_CONFIRM_METHOD = "codexhost/thread/archive/confirm";
|
|
28102
28681
|
var threadArchiveConfirmParamsSchema = external_exports.object({ threadId: hostThreadIdSchema }).strict();
|
|
28103
28682
|
var threadArchiveConfirmResultSchema = external_exports.object({ confirmed: external_exports.boolean() }).strict();
|
|
28104
28683
|
|
|
28105
28684
|
// ../../shared-contracts/dist/client-channel.js
|
|
28106
28685
|
var CLIENT_CHANNEL_VERSION = 1;
|
|
28107
28686
|
var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
28687
|
+
var CLIENT_CHANNEL_METHODS = [
|
|
28688
|
+
"codexhost/skills/list",
|
|
28689
|
+
"codexhost/voice/status",
|
|
28690
|
+
"codexhost/voice/transcribe",
|
|
28691
|
+
"codexhost/harness/display-settings/get",
|
|
28692
|
+
"codexhost/harness/display-settings/set",
|
|
28693
|
+
"codexhost/harness/display-settings/capabilities",
|
|
28694
|
+
"codexhost/harness/preferences/get",
|
|
28695
|
+
"codexhost/harness/preferences/patch",
|
|
28696
|
+
"thread/list",
|
|
28697
|
+
"codexhost/thread/catalog/read",
|
|
28698
|
+
"thread/read",
|
|
28699
|
+
"thread/resume",
|
|
28700
|
+
"thread/fork",
|
|
28701
|
+
"thread/turns/list",
|
|
28702
|
+
"thread/revert",
|
|
28703
|
+
"thread/items/list",
|
|
28704
|
+
"thread/start",
|
|
28705
|
+
"thread/name/set",
|
|
28706
|
+
"codexhost/thread/title/generate",
|
|
28707
|
+
"thread/archive",
|
|
28708
|
+
THREAD_ARCHIVE_CONFIRM_METHOD,
|
|
28709
|
+
"thread/unarchive",
|
|
28710
|
+
"turn/start",
|
|
28711
|
+
"turn/interrupt",
|
|
28712
|
+
"turn/steer",
|
|
28713
|
+
"thread/queue/list",
|
|
28714
|
+
"thread/queue/add",
|
|
28715
|
+
"thread/queue/update",
|
|
28716
|
+
"thread/queue/delete",
|
|
28717
|
+
"thread/queue/reorder",
|
|
28718
|
+
"thread/queue/start",
|
|
28719
|
+
"codexhost/thread/queue/send-now",
|
|
28720
|
+
"codexhost/workspace/read",
|
|
28721
|
+
"codexhost/thread/tree/read",
|
|
28722
|
+
"codexhost/thread/pins/list",
|
|
28723
|
+
"codexhost/thread/pins/set",
|
|
28724
|
+
"codexhost/harness/plugins/list",
|
|
28725
|
+
"codexhost/harness/inspect",
|
|
28726
|
+
"codexhost/thread/inspect",
|
|
28727
|
+
"codexhost/thread/usage/inspect",
|
|
28728
|
+
"codexhost/thread/ownership/list",
|
|
28729
|
+
"codexhost/thread/model/select",
|
|
28730
|
+
"codexhost/thread/thinking/select",
|
|
28731
|
+
"codexhost/thread/permission-mode/select",
|
|
28732
|
+
"codexhost/thread/commands/inspect",
|
|
28733
|
+
"codexhost/harness/commands/inspect",
|
|
28734
|
+
"codexhost/thread/command/execute",
|
|
28735
|
+
"codexhost/thread/fork",
|
|
28736
|
+
"codexhost/harness/session-import/sources",
|
|
28737
|
+
"codexhost/harness/session-import/list",
|
|
28738
|
+
"codexhost/harness/session-import/import",
|
|
28739
|
+
// Host settings shared across Desktop and Web.
|
|
28740
|
+
...HOST_EXTENSION_MANAGEMENT_METHODS,
|
|
28741
|
+
"codexhost/harness/installation",
|
|
28742
|
+
"codexhost/harness/installation/start",
|
|
28743
|
+
"codexhost/harness/installation/status",
|
|
28744
|
+
"codexhost/harness/launch-settings/get",
|
|
28745
|
+
"codexhost/harness/launch-settings/set",
|
|
28746
|
+
"codexhost/harness/web-ui/open",
|
|
28747
|
+
"codexhost/harness/accounts/sources",
|
|
28748
|
+
"codexhost/harness/accounts/list",
|
|
28749
|
+
"codexhost/harness/accounts/inspect",
|
|
28750
|
+
"codexhost/harness/credential-imports",
|
|
28751
|
+
"codexhost/account/list",
|
|
28752
|
+
"codexhost/account/refresh",
|
|
28753
|
+
"codexhost/account/usage/inspect",
|
|
28754
|
+
"codexhost/usage/model-prices/get",
|
|
28755
|
+
"codexhost/usage/model-prices/set",
|
|
28756
|
+
"codexhost/usage/model-prices/default",
|
|
28757
|
+
"codexhost/usage/statistics/get",
|
|
28758
|
+
"codexhost/update/check",
|
|
28759
|
+
"codexhost/update/start",
|
|
28760
|
+
"codexhost/update/status",
|
|
28761
|
+
"codexhost/sessions/loaded/list"
|
|
28762
|
+
];
|
|
28108
28763
|
var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
|
|
28109
28764
|
var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
|
|
28110
28765
|
var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
|
|
@@ -28143,6 +28798,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
28143
28798
|
cursor: clientChannelCursorSchema,
|
|
28144
28799
|
revision: external_exports.number().int().nonnegative()
|
|
28145
28800
|
}),
|
|
28801
|
+
external_exports.object({
|
|
28802
|
+
type: external_exports.literal("extensions-changed"),
|
|
28803
|
+
cursor: clientChannelCursorSchema,
|
|
28804
|
+
revision: hostExtensionRevisionSchema
|
|
28805
|
+
}),
|
|
28146
28806
|
external_exports.object({
|
|
28147
28807
|
type: external_exports.literal("hello"),
|
|
28148
28808
|
version: external_exports.literal(1),
|
|
@@ -28318,6 +28978,29 @@ var threadCatalogReadResultSchema = external_exports.object({
|
|
|
28318
28978
|
officialCursor: external_exports.object({ live: external_exports.string().nullable(), archived: external_exports.string().nullable().optional() }).strict().optional()
|
|
28319
28979
|
}).strict();
|
|
28320
28980
|
|
|
28981
|
+
// ../../shared-contracts/dist/thread-tree-watch.js
|
|
28982
|
+
var THREAD_TREE_MAX_NODES = 5e3;
|
|
28983
|
+
var threadTreeStatusSchema = external_exports.enum(["running", "waiting", "idle", "unknown"]);
|
|
28984
|
+
var threadTreeNodeSchema = external_exports.strictObject({
|
|
28985
|
+
harnessId: harnessIdSchema,
|
|
28986
|
+
title: external_exports.string().optional(),
|
|
28987
|
+
status: threadTreeStatusSchema,
|
|
28988
|
+
archived: external_exports.boolean()
|
|
28989
|
+
});
|
|
28990
|
+
var threadTreeSnapshotSchema = external_exports.strictObject({
|
|
28991
|
+
revision: external_exports.int().nonnegative(),
|
|
28992
|
+
parents: external_exports.record(hostThreadIdSchema, hostThreadIdSchema),
|
|
28993
|
+
nodes: external_exports.record(hostThreadIdSchema, threadTreeNodeSchema),
|
|
28994
|
+
truncated: external_exports.boolean()
|
|
28995
|
+
}).refine((snapshot) => Object.keys(snapshot.nodes).length <= THREAD_TREE_MAX_NODES, "Too many Thread tree nodes").refine(({ parents, nodes }) => Object.entries(parents).every(([child, parent]) => Object.hasOwn(nodes, child) && Object.hasOwn(nodes, parent)), "Missing Thread tree node");
|
|
28996
|
+
var subscriptionId = external_exports.string().min(1).max(128);
|
|
28997
|
+
var threadTreeWatchParamsSchema = external_exports.strictObject({});
|
|
28998
|
+
var threadTreeUnwatchParamsSchema = external_exports.strictObject({ subscriptionId });
|
|
28999
|
+
var threadTreeUnwatchResultSchema = external_exports.strictObject({});
|
|
29000
|
+
var threadTreeWatchResultSchema = threadTreeUnwatchParamsSchema.extend({
|
|
29001
|
+
snapshot: threadTreeSnapshotSchema
|
|
29002
|
+
});
|
|
29003
|
+
|
|
28321
29004
|
// ../../shared-contracts/dist/voice.js
|
|
28322
29005
|
var VOICE_AUDIO_MAX_BYTES = 10 * 1024 * 1024;
|
|
28323
29006
|
var voiceAudioMimeTypeSchema = external_exports.string().regex(/^audio\/[a-z0-9.+-]+(?:\s*;[^\r\n]*)?$/i);
|
|
@@ -28556,7 +29239,7 @@ var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
|
|
|
28556
29239
|
|
|
28557
29240
|
// ../../shared-contracts/dist/harness-preferences.js
|
|
28558
29241
|
var harnessPreferenceScopeSchema = external_exports.string().regex(/^external$/u);
|
|
28559
|
-
var preferenceHarnessKey = harnessIdSchema.transform((
|
|
29242
|
+
var preferenceHarnessKey = harnessIdSchema.transform((id4) => String(id4));
|
|
28560
29243
|
var harnessDefaultConfigurationSchema = external_exports.strictObject({
|
|
28561
29244
|
model: harnessModelRefSchema.optional(),
|
|
28562
29245
|
thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
@@ -28566,11 +29249,19 @@ var newThreadDefaultsSchema = external_exports.strictObject({
|
|
|
28566
29249
|
lastHarness: harnessIdSchema.optional(),
|
|
28567
29250
|
byHarness: external_exports.record(preferenceHarnessKey, harnessDefaultConfigurationSchema)
|
|
28568
29251
|
});
|
|
29252
|
+
var harnessDelegationDefaultSchema = external_exports.strictObject({
|
|
29253
|
+
model: harnessModelRefSchema.optional(),
|
|
29254
|
+
thinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
29255
|
+
}).refine((value) => Boolean(value.model || value.thinkingOptionId), "A delegation default must contain a Model or Thinking option");
|
|
29256
|
+
var delegationDefaultsSchema = external_exports.strictObject({
|
|
29257
|
+
byHarness: external_exports.record(preferenceHarnessKey, harnessDelegationDefaultSchema)
|
|
29258
|
+
});
|
|
28569
29259
|
var modelId = external_exports.string().min(1).max(1024);
|
|
28570
29260
|
var harnessPreferenceValuesSchema = external_exports.strictObject({
|
|
28571
29261
|
idleRelease: idleReleaseSettingsSchema.optional(),
|
|
28572
29262
|
favorites: external_exports.record(preferenceHarnessKey, external_exports.array(modelId).max(2048)).default({}),
|
|
28573
|
-
newThread: newThreadDefaultsSchema.optional()
|
|
29263
|
+
newThread: newThreadDefaultsSchema.optional(),
|
|
29264
|
+
delegation: delegationDefaultsSchema.optional()
|
|
28574
29265
|
});
|
|
28575
29266
|
var harnessPreferenceSnapshotSchema = external_exports.strictObject({
|
|
28576
29267
|
scope: harnessPreferenceScopeSchema,
|
|
@@ -28598,6 +29289,11 @@ var harnessPreferenceOperationSchema = external_exports.discriminatedUnion("kind
|
|
|
28598
29289
|
lastHarness: harnessIdSchema.optional(),
|
|
28599
29290
|
harnessId: harnessIdSchema.optional(),
|
|
28600
29291
|
configuration: harnessDefaultConfigurationSchema.optional()
|
|
29292
|
+
}),
|
|
29293
|
+
external_exports.strictObject({
|
|
29294
|
+
kind: external_exports.literal("delegation"),
|
|
29295
|
+
harnessId: harnessIdSchema,
|
|
29296
|
+
configuration: harnessDelegationDefaultSchema.nullable()
|
|
28601
29297
|
})
|
|
28602
29298
|
]);
|
|
28603
29299
|
var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
@@ -28948,13 +29644,6 @@ var threadManualCompactionStartedSchema = external_exports.strictObject({
|
|
|
28948
29644
|
});
|
|
28949
29645
|
|
|
28950
29646
|
// ../../shared-contracts/dist/harness-accounts.js
|
|
28951
|
-
var accountBalanceSnapshotSchema = external_exports.object({
|
|
28952
|
-
amount: external_exports.number().finite().nonnegative(),
|
|
28953
|
-
/** ISO 4217 code as reported by the Provider, for example `CNY`. */
|
|
28954
|
-
currency: external_exports.string().trim().min(1).max(8),
|
|
28955
|
-
/** Native label when the Harness exposes several Billing Sources. */
|
|
28956
|
-
label: external_exports.string().trim().min(1).max(128).optional()
|
|
28957
|
-
}).strict();
|
|
28958
29647
|
var harnessAccountSnapshotObject = external_exports.object({
|
|
28959
29648
|
email: external_exports.string().trim().min(1).max(320).optional(),
|
|
28960
29649
|
label: external_exports.string().trim().min(1).max(256).optional(),
|
|
@@ -28988,76 +29677,6 @@ var harnessAccountListResultSchema = external_exports.object({
|
|
|
28988
29677
|
accounts: external_exports.array(requireReportedQuota(harnessAccountSnapshotObject.extend(harnessAccountIdentityShape))).max(128)
|
|
28989
29678
|
}).strict();
|
|
28990
29679
|
|
|
28991
|
-
// ../../shared-contracts/dist/harness-plugins.js
|
|
28992
|
-
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
28993
|
-
var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
|
|
28994
|
-
var HARNESS_PLUGIN_LIMIT = 128;
|
|
28995
|
-
var installedHarnessPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u).pipe(harnessIdSchema);
|
|
28996
|
-
var harnessPluginIdSchema = installedHarnessPluginIdSchema.refine((id3) => id3 !== "codex", "The official Codex identity is reserved");
|
|
28997
|
-
var relativeResourceSchema = external_exports.string().min(1).max(512).refine((value) => !/[\\\u0000:#?]/u.test(value) && !value.startsWith("/") && !value.split("/").some((part) => part === ".." || part === ""), "Plugin resources must be relative paths inside the plugin");
|
|
28998
|
-
var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
|
|
28999
|
-
var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
|
|
29000
|
-
var harnessInstallationGuideSchema = external_exports.object({
|
|
29001
|
-
commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
|
|
29002
|
-
before: localizedTextSchema.optional(),
|
|
29003
|
-
after: localizedTextSchema.optional(),
|
|
29004
|
-
downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
|
|
29005
|
-
}).strict();
|
|
29006
|
-
var pluginPresentationShape = {
|
|
29007
|
-
id: installedHarnessPluginIdSchema,
|
|
29008
|
-
name: external_exports.string().trim().min(1).max(128),
|
|
29009
|
-
version: external_exports.string().min(1).max(128),
|
|
29010
|
-
/** Capability-only plugin; omitted for existing session-capable plugins. */
|
|
29011
|
-
kind: external_exports.literal("usage").optional(),
|
|
29012
|
-
/** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
|
|
29013
|
-
iconStyle: external_exports.object({
|
|
29014
|
-
vector: external_exports.object({
|
|
29015
|
-
viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
|
|
29016
|
-
color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
|
|
29017
|
-
paths: external_exports.array(external_exports.object({
|
|
29018
|
-
d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
|
|
29019
|
-
fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
|
|
29020
|
-
fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
|
|
29021
|
-
}).strict()).min(1).max(32)
|
|
29022
|
-
}).strict().optional(),
|
|
29023
|
-
background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
|
|
29024
|
-
borderRadius: external_exports.number().min(0).max(50).optional(),
|
|
29025
|
-
paddingRatio: external_exports.number().min(0).max(0.25).optional()
|
|
29026
|
-
}).strict().optional(),
|
|
29027
|
-
installation: harnessInstallationGuideSchema.optional(),
|
|
29028
|
-
notice: localizedTextSchema.optional(),
|
|
29029
|
-
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
29030
|
-
launchCommand: external_exports.literal(true).optional(),
|
|
29031
|
-
links: external_exports.object({
|
|
29032
|
-
website: documentationUrlSchema.optional(),
|
|
29033
|
-
documentation: documentationUrlSchema.optional(),
|
|
29034
|
-
installation: documentationUrlSchema.optional()
|
|
29035
|
-
}).strict().optional()
|
|
29036
|
-
};
|
|
29037
|
-
var harnessPluginManifestSchema = external_exports.object({
|
|
29038
|
-
manifestVersion: external_exports.literal(1),
|
|
29039
|
-
...pluginPresentationShape,
|
|
29040
|
-
adapterApiVersion: external_exports.number().int().positive(),
|
|
29041
|
-
entry: relativeResourceSchema,
|
|
29042
|
-
icon: relativeResourceSchema.optional()
|
|
29043
|
-
}).strict();
|
|
29044
|
-
var harnessPluginIconSchema = external_exports.string().max(Math.ceil(HARNESS_PLUGIN_ICON_MAX_BYTES / 3) * 4 + 64).regex(/^data:image\/(?:png|jpeg|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/u);
|
|
29045
|
-
var harnessPluginDescriptorSchema = external_exports.object({
|
|
29046
|
-
...pluginPresentationShape,
|
|
29047
|
-
icon: harnessPluginIconSchema.optional()
|
|
29048
|
-
}).strict();
|
|
29049
|
-
var harnessPluginListParamsSchema = external_exports.object({}).strict();
|
|
29050
|
-
var harnessPluginListResultSchema = external_exports.object({
|
|
29051
|
-
plugins: external_exports.array(harnessPluginDescriptorSchema.extend({ id: harnessPluginIdSchema })).max(HARNESS_PLUGIN_LIMIT)
|
|
29052
|
-
}).strict();
|
|
29053
|
-
var harnessPluginConfigurationSchema = external_exports.object({
|
|
29054
|
-
version: external_exports.literal(1),
|
|
29055
|
-
enabled: external_exports.array(installedHarnessPluginIdSchema).max(HARNESS_PLUGIN_LIMIT)
|
|
29056
|
-
}).strict().refine((value) => new Set(value.enabled).size === value.enabled.length, {
|
|
29057
|
-
message: "Enabled plugin IDs must be unique",
|
|
29058
|
-
path: ["enabled"]
|
|
29059
|
-
});
|
|
29060
|
-
|
|
29061
29680
|
// ../../shared-contracts/dist/harness-route.js
|
|
29062
29681
|
var harnessPluginRouteSchema = external_exports.object({
|
|
29063
29682
|
harnessId: harnessPluginIdSchema,
|
|
@@ -29498,9 +30117,12 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
|
29498
30117
|
...thread,
|
|
29499
30118
|
epoch: identity,
|
|
29500
30119
|
modelId: identity.optional(),
|
|
30120
|
+
serviceTier: harnessModelServiceTierSchema.optional(),
|
|
29501
30121
|
thinkingOptionId: identity.optional(),
|
|
29502
30122
|
permissionModeId: identity.optional()
|
|
29503
|
-
}).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting"),
|
|
30123
|
+
}).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting").refine((value) => value.serviceTier === void 0 || value.modelId !== void 0, {
|
|
30124
|
+
message: "A service tier requires a Model ID"
|
|
30125
|
+
}),
|
|
29504
30126
|
external_exports.strictObject({
|
|
29505
30127
|
kind: external_exports.literal("prompt"),
|
|
29506
30128
|
...thread,
|
|
@@ -29550,7 +30172,7 @@ var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action
|
|
|
29550
30172
|
external_exports.strictObject({ action: external_exports.literal("catalog") }),
|
|
29551
30173
|
external_exports.strictObject({
|
|
29552
30174
|
action: external_exports.literal("read-thread"),
|
|
29553
|
-
hostId: hostId.refine((
|
|
30175
|
+
hostId: hostId.refine((id4) => id4 !== "local"),
|
|
29554
30176
|
input: delegationReadParamsSchema
|
|
29555
30177
|
}),
|
|
29556
30178
|
external_exports.strictObject({
|
|
@@ -29564,7 +30186,7 @@ var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action
|
|
|
29564
30186
|
external_exports.strictObject({ action: external_exports.literal("runtime"), hostId }),
|
|
29565
30187
|
external_exports.strictObject({
|
|
29566
30188
|
action: external_exports.literal("update"),
|
|
29567
|
-
hostId: hostId.refine((
|
|
30189
|
+
hostId: hostId.refine((id4) => id4 !== "local"),
|
|
29568
30190
|
version: remoteUpdateParamsSchema.shape.version
|
|
29569
30191
|
})
|
|
29570
30192
|
]);
|
|
@@ -29907,7 +30529,7 @@ function invalidRequest(message) {
|
|
|
29907
30529
|
return { code: "invalidRequest", message, retryable: false };
|
|
29908
30530
|
}
|
|
29909
30531
|
function validateHostApprovalResponse(interaction, response) {
|
|
29910
|
-
return interaction.actions.some(({ id:
|
|
30532
|
+
return interaction.actions.some(({ id: id4 }) => id4 === response.actionId) ? null : invalidRequest("Approval Response contains an undeclared action ID");
|
|
29911
30533
|
}
|
|
29912
30534
|
|
|
29913
30535
|
// ../../harness-adapter/dist/question.js
|
|
@@ -29915,7 +30537,7 @@ function invalidRequest2(message) {
|
|
|
29915
30537
|
return { code: "invalidRequest", message, retryable: false };
|
|
29916
30538
|
}
|
|
29917
30539
|
function validateHostQuestionResponse(interaction, response) {
|
|
29918
|
-
const questionIds = new Set(interaction.questions.map(({ id:
|
|
30540
|
+
const questionIds = new Set(interaction.questions.map(({ id: id4 }) => id4));
|
|
29919
30541
|
if (response.cancelled) {
|
|
29920
30542
|
return Object.keys(response.answers).length === 0 ? null : invalidRequest2("Cancelled Question Response must not contain answers");
|
|
29921
30543
|
}
|
|
@@ -29946,6 +30568,18 @@ function validateHostQuestionResponse(interaction, response) {
|
|
|
29946
30568
|
return null;
|
|
29947
30569
|
}
|
|
29948
30570
|
|
|
30571
|
+
// ../../harness-adapter/dist/legacy-model-ref.js
|
|
30572
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
30573
|
+
function normalizeLegacyBase64ModelRef(ref, catalog, prefix) {
|
|
30574
|
+
if (ref.serviceTier || !ref.id.startsWith(prefix))
|
|
30575
|
+
return void 0;
|
|
30576
|
+
const encoded = ref.id.slice(prefix.length);
|
|
30577
|
+
const id4 = Buffer2.from(encoded, "base64url").toString("utf8");
|
|
30578
|
+
if (Buffer2.from(id4).toString("base64url") !== encoded)
|
|
30579
|
+
return void 0;
|
|
30580
|
+
return catalog.models.find(({ ref: ref2 }) => ref2.id === id4 && !ref2.serviceTier)?.ref;
|
|
30581
|
+
}
|
|
30582
|
+
|
|
29949
30583
|
// ../../harness-adapter/dist/output-channel.js
|
|
29950
30584
|
var HarnessOutputChannel = class {
|
|
29951
30585
|
outputs;
|
|
@@ -30021,7 +30655,8 @@ var tokenFields = [
|
|
|
30021
30655
|
var safeIntegerFields = [
|
|
30022
30656
|
"planFiveHourResetsAtUnix",
|
|
30023
30657
|
"planSevenDayResetsAtUnix",
|
|
30024
|
-
"timeToFirstOutputMs"
|
|
30658
|
+
"timeToFirstOutputMs",
|
|
30659
|
+
"latestRequestTimeToFirstOutputMs"
|
|
30025
30660
|
];
|
|
30026
30661
|
var percentFields = [
|
|
30027
30662
|
"cacheHitRatePercent",
|
|
@@ -30268,19 +30903,19 @@ function mapQoderSlashCommands(commands) {
|
|
|
30268
30903
|
const cleanName = rawName.replace(/^\//, "").trim().toLowerCase();
|
|
30269
30904
|
if (!cleanName || isExcludedLiveCommand(cleanName))
|
|
30270
30905
|
continue;
|
|
30271
|
-
const
|
|
30272
|
-
if (seenIds.has(
|
|
30906
|
+
const id4 = `qoder.${cleanName}`;
|
|
30907
|
+
if (seenIds.has(id4))
|
|
30273
30908
|
continue;
|
|
30274
|
-
seenIds.add(
|
|
30909
|
+
seenIds.add(id4);
|
|
30275
30910
|
const desc = typeof native === "object" && typeof native.description === "string" ? native.description.trim() : void 0;
|
|
30276
30911
|
const argumentHint = typeof native === "object" && typeof native.argumentHint === "string" ? native.argumentHint : void 0;
|
|
30277
30912
|
const hasArg = typeof argumentHint === "string" && argumentHint.trim().length > 0;
|
|
30278
30913
|
rawDescriptors.push({
|
|
30279
|
-
id:
|
|
30914
|
+
id: id4,
|
|
30280
30915
|
invocation: `/${cleanName}`,
|
|
30281
30916
|
label: humanize(cleanName).trim() || cleanName,
|
|
30282
30917
|
...desc && desc.length > 0 ? { description: desc.slice(0, 512) } : {},
|
|
30283
|
-
argumentMode: hasArg || isQoderCompactionCommand(
|
|
30918
|
+
argumentMode: hasArg || isQoderCompactionCommand(id4) ? "text" : "none"
|
|
30284
30919
|
});
|
|
30285
30920
|
}
|
|
30286
30921
|
return harnessCommandCatalogSchema.parse({
|
|
@@ -30618,10 +31253,10 @@ function mapQoderSnapshot(messages, sessionId, harnessId = qoderHarnessId) {
|
|
|
30618
31253
|
}
|
|
30619
31254
|
|
|
30620
31255
|
// dist/qoder-models.js
|
|
30621
|
-
|
|
30622
|
-
|
|
30623
|
-
|
|
30624
|
-
var QODER_DEFAULT_MODEL_REF =
|
|
31256
|
+
function qoderModelRef(id4) {
|
|
31257
|
+
return harnessModelRefSchema.parse({ id: id4 });
|
|
31258
|
+
}
|
|
31259
|
+
var QODER_DEFAULT_MODEL_REF = qoderModelRef("auto");
|
|
30625
31260
|
var QODER_EFFORT_LABELS = /* @__PURE__ */ new Map([
|
|
30626
31261
|
["off", "Off"],
|
|
30627
31262
|
["none", "Off"],
|
|
@@ -30632,11 +31267,11 @@ var QODER_EFFORT_LABELS = /* @__PURE__ */ new Map([
|
|
|
30632
31267
|
["max", "Max"]
|
|
30633
31268
|
]);
|
|
30634
31269
|
var PREFERRED_EFFORT_ORDER = ["off", "none", "low", "medium", "high", "xhigh", "max"];
|
|
30635
|
-
function effortLabel(
|
|
30636
|
-
const standard = QODER_EFFORT_LABELS.get(
|
|
31270
|
+
function effortLabel(id4) {
|
|
31271
|
+
const standard = QODER_EFFORT_LABELS.get(id4.toLowerCase());
|
|
30637
31272
|
if (standard)
|
|
30638
31273
|
return standard;
|
|
30639
|
-
return
|
|
31274
|
+
return id4.charAt(0).toUpperCase() + id4.slice(1);
|
|
30640
31275
|
}
|
|
30641
31276
|
function extractModelEfforts(raw) {
|
|
30642
31277
|
const effortIds = /* @__PURE__ */ new Set();
|
|
@@ -30710,7 +31345,7 @@ function extractModelEfforts(raw) {
|
|
|
30710
31345
|
if (sorted.includes("medium")) {
|
|
30711
31346
|
defaultEffortId = "medium";
|
|
30712
31347
|
} else {
|
|
30713
|
-
defaultEffortId = sorted.find((
|
|
31348
|
+
defaultEffortId = sorted.find((id4) => id4 !== "off" && id4 !== "none") ?? sorted[0];
|
|
30714
31349
|
}
|
|
30715
31350
|
}
|
|
30716
31351
|
return {
|
|
@@ -30718,25 +31353,11 @@ function extractModelEfforts(raw) {
|
|
|
30718
31353
|
...defaultEffortId ? { defaultEffortId } : {}
|
|
30719
31354
|
};
|
|
30720
31355
|
}
|
|
30721
|
-
function
|
|
30722
|
-
|
|
30723
|
-
const id3 = `${QODER_MODEL_REF_PREFIX}${Buffer2.from(parsed, "utf8").toString("base64url")}`;
|
|
30724
|
-
if (id3.length > HARNESS_MODEL_REF_MAX_LENGTH) {
|
|
30725
|
-
throw new Error("Qoder Model value is too long for a Model Ref");
|
|
30726
|
-
}
|
|
30727
|
-
return harnessModelRefSchema.parse({ id: id3 });
|
|
31356
|
+
function qoderModelValue(ref) {
|
|
31357
|
+
return harnessModelRefSchema.safeParse(ref).data?.id;
|
|
30728
31358
|
}
|
|
30729
|
-
function
|
|
30730
|
-
|
|
30731
|
-
if (!parsed.success || !parsed.data.id.startsWith(QODER_MODEL_REF_PREFIX))
|
|
30732
|
-
return void 0;
|
|
30733
|
-
const encoded = parsed.data.id.slice(QODER_MODEL_REF_PREFIX.length);
|
|
30734
|
-
try {
|
|
30735
|
-
const value = Buffer2.from(encoded, "base64url").toString("utf8");
|
|
30736
|
-
return encodeQoderModelRef(value).id === parsed.data.id ? value : void 0;
|
|
30737
|
-
} catch {
|
|
30738
|
-
return void 0;
|
|
30739
|
-
}
|
|
31359
|
+
function normalizeStoredQoderModelRef(ref, catalog) {
|
|
31360
|
+
return normalizeLegacyBase64ModelRef(ref, catalog, "qoder-model-v1.");
|
|
30740
31361
|
}
|
|
30741
31362
|
function parseQoderModelCatalog(rawModels) {
|
|
30742
31363
|
const models = [];
|
|
@@ -30749,7 +31370,7 @@ function parseQoderModelCatalog(rawModels) {
|
|
|
30749
31370
|
for (const item of rawModels) {
|
|
30750
31371
|
if (typeof item === "object" && item !== null) {
|
|
30751
31372
|
const raw = item;
|
|
30752
|
-
const value = typeof raw.value === "string" && raw.value.
|
|
31373
|
+
const value = typeof raw.value === "string" && raw.value.length > 0 ? raw.value : typeof raw.modelId === "string" && raw.modelId.length > 0 ? raw.modelId : typeof raw.id === "string" ? raw.id : void 0;
|
|
30753
31374
|
if (!value)
|
|
30754
31375
|
continue;
|
|
30755
31376
|
const labelCandidate = typeof raw.displayName === "string" && raw.displayName.trim().length > 0 ? raw.displayName.trim() : typeof raw.name === "string" && raw.name.trim().length > 0 ? raw.name.trim() : value;
|
|
@@ -30758,7 +31379,7 @@ function parseQoderModelCatalog(rawModels) {
|
|
|
30758
31379
|
for (const effortId of supportedEffortIds) {
|
|
30759
31380
|
allThinkingOptions.set(effortId, { id: effortId, label: effortLabel(effortId) });
|
|
30760
31381
|
}
|
|
30761
|
-
const ref =
|
|
31382
|
+
const ref = qoderModelRef(value);
|
|
30762
31383
|
if (!seenRefs.has(ref.id)) {
|
|
30763
31384
|
seenRefs.add(ref.id);
|
|
30764
31385
|
models.push({
|
|
@@ -30806,13 +31427,13 @@ function parseQoderModelCatalog(rawModels) {
|
|
|
30806
31427
|
});
|
|
30807
31428
|
}
|
|
30808
31429
|
function qoderAvailableThinkingOptions(catalog, model2) {
|
|
30809
|
-
if (!catalog
|
|
31430
|
+
if (!catalog)
|
|
30810
31431
|
return void 0;
|
|
30811
|
-
const supported = catalog
|
|
31432
|
+
const supported = catalogModelForRef(catalog, model2)?.supportedThinkingOptionIds;
|
|
30812
31433
|
if (!supported || supported.length === 0)
|
|
30813
31434
|
return void 0;
|
|
30814
|
-
const options = supported.flatMap((
|
|
30815
|
-
const option = catalog.thinkingOptions.find((candidate) => candidate.id ===
|
|
31435
|
+
const options = supported.flatMap((id4) => {
|
|
31436
|
+
const option = catalog.thinkingOptions.find((candidate) => candidate.id === id4);
|
|
30816
31437
|
return option ? [option] : [];
|
|
30817
31438
|
});
|
|
30818
31439
|
return options.length > 0 ? options : void 0;
|
|
@@ -30860,22 +31481,22 @@ var QODER_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.parse({
|
|
|
30860
31481
|
],
|
|
30861
31482
|
defaultModeId: QODER_DEFAULT_PERMISSION_MODE_ID
|
|
30862
31483
|
});
|
|
30863
|
-
function mapToQoderPermissionMode(
|
|
30864
|
-
if (!
|
|
31484
|
+
function mapToQoderPermissionMode(id4) {
|
|
31485
|
+
if (!id4)
|
|
30865
31486
|
return void 0;
|
|
30866
|
-
const str = String(
|
|
31487
|
+
const str = String(id4);
|
|
30867
31488
|
if (str === "default" || str === "acceptEdits" || str === "bypassPermissions" || str === "yolo" || str === "plan" || str === "dontAsk" || str === "auto") {
|
|
30868
31489
|
return str;
|
|
30869
31490
|
}
|
|
30870
31491
|
return void 0;
|
|
30871
31492
|
}
|
|
30872
|
-
function isQoderPlanModeId(
|
|
30873
|
-
return String(
|
|
31493
|
+
function isQoderPlanModeId(id4) {
|
|
31494
|
+
return String(id4 ?? "") === "plan";
|
|
30874
31495
|
}
|
|
30875
|
-
function mapToQoderPermissionModeExcludingPlan(
|
|
30876
|
-
if (isQoderPlanModeId(
|
|
31496
|
+
function mapToQoderPermissionModeExcludingPlan(id4) {
|
|
31497
|
+
if (isQoderPlanModeId(id4))
|
|
30877
31498
|
return void 0;
|
|
30878
|
-
return mapToQoderPermissionMode(
|
|
31499
|
+
return mapToQoderPermissionMode(id4);
|
|
30879
31500
|
}
|
|
30880
31501
|
|
|
30881
31502
|
// dist/qoder-daemon-pool.js
|
|
@@ -31953,8 +32574,8 @@ function isValidJWT2(jwt2, alg) {
|
|
|
31953
32574
|
const [header] = jwt2.split(".");
|
|
31954
32575
|
if (!header)
|
|
31955
32576
|
return false;
|
|
31956
|
-
const
|
|
31957
|
-
const decoded = JSON.parse(atob(
|
|
32577
|
+
const base644 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
32578
|
+
const decoded = JSON.parse(atob(base644));
|
|
31958
32579
|
if (typeof decoded !== "object" || decoded === null)
|
|
31959
32580
|
return false;
|
|
31960
32581
|
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
@@ -39133,7 +39754,7 @@ var ExperimentalServerTasks = class {
|
|
|
39133
39754
|
if (hasPreviousToolUse) {
|
|
39134
39755
|
const toolUseIds = new Set(previousContent.filter((c) => c.type === "tool_use").map((c) => c.id));
|
|
39135
39756
|
const toolResultIds = new Set(lastContent.filter((c) => c.type === "tool_result").map((c) => c.toolUseId));
|
|
39136
|
-
if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((
|
|
39757
|
+
if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id4) => toolResultIds.has(id4))) {
|
|
39137
39758
|
throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match");
|
|
39138
39759
|
}
|
|
39139
39760
|
}
|
|
@@ -39558,7 +40179,7 @@ var Server = class extends Protocol {
|
|
|
39558
40179
|
if (hasPreviousToolUse) {
|
|
39559
40180
|
const toolUseIds = new Set(previousContent.filter((c) => c.type === "tool_use").map((c) => c.id));
|
|
39560
40181
|
const toolResultIds = new Set(lastContent.filter((c) => c.type === "tool_result").map((c) => c.toolUseId));
|
|
39561
|
-
if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((
|
|
40182
|
+
if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every((id4) => toolResultIds.has(id4))) {
|
|
39562
40183
|
throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match");
|
|
39563
40184
|
}
|
|
39564
40185
|
}
|
|
@@ -46223,7 +46844,7 @@ var Xn = class {
|
|
|
46223
46844
|
};
|
|
46224
46845
|
var od = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
46225
46846
|
var rd = 500;
|
|
46226
|
-
var
|
|
46847
|
+
var id2 = 1024 * 1024;
|
|
46227
46848
|
async function ad(t9) {
|
|
46228
46849
|
let e = td(t9);
|
|
46229
46850
|
try {
|
|
@@ -46289,7 +46910,7 @@ async function Kr(t9, e, n, s) {
|
|
|
46289
46910
|
console.warn(`importSessionToStore: skipping non-object line in ${t9}`);
|
|
46290
46911
|
continue;
|
|
46291
46912
|
}
|
|
46292
|
-
r.push(u), i += Buffer.byteLength(a), (r.length >= s || i >=
|
|
46913
|
+
r.push(u), i += Buffer.byteLength(a), (r.length >= s || i >= id2) && (await n.append(e, r), r = [], i = 0);
|
|
46293
46914
|
}
|
|
46294
46915
|
r.length > 0 && await n.append(e, r);
|
|
46295
46916
|
}
|
|
@@ -52309,7 +52930,7 @@ var Xn2 = class {
|
|
|
52309
52930
|
};
|
|
52310
52931
|
var od2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
52311
52932
|
var rd2 = 500;
|
|
52312
|
-
var
|
|
52933
|
+
var id3 = 1024 * 1024;
|
|
52313
52934
|
async function ad2(t9) {
|
|
52314
52935
|
let e = td2(t9);
|
|
52315
52936
|
try {
|
|
@@ -52375,7 +52996,7 @@ async function Kr2(t9, e, n, s) {
|
|
|
52375
52996
|
console.warn(`importSessionToStore: skipping non-object line in ${t9}`);
|
|
52376
52997
|
continue;
|
|
52377
52998
|
}
|
|
52378
|
-
r.push(u), i += Buffer.byteLength(a), (r.length >= s || i >=
|
|
52999
|
+
r.push(u), i += Buffer.byteLength(a), (r.length >= s || i >= id3) && (await n.append(e, r), r = [], i = 0);
|
|
52379
53000
|
}
|
|
52380
53001
|
r.length > 0 && await n.append(e, r);
|
|
52381
53002
|
}
|
|
@@ -52636,15 +53257,16 @@ function isNonNegativeSafeInteger(value) {
|
|
|
52636
53257
|
function isNonNegativeFinite(value) {
|
|
52637
53258
|
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
52638
53259
|
}
|
|
52639
|
-
|
|
52640
|
-
|
|
52641
|
-
|
|
52642
|
-
|
|
52643
|
-
|
|
52644
|
-
|
|
52645
|
-
|
|
52646
|
-
|
|
52647
|
-
|
|
53260
|
+
function isContextWindow(value) {
|
|
53261
|
+
return isNonNegativeSafeInteger(value) && value > 0;
|
|
53262
|
+
}
|
|
53263
|
+
function modelAlias(modelId2) {
|
|
53264
|
+
const prefix = "qoder/";
|
|
53265
|
+
const namespaced = modelId2.startsWith(prefix);
|
|
53266
|
+
const id4 = namespaced ? modelId2.slice(prefix.length) : modelId2;
|
|
53267
|
+
if (!id4 || id4.includes("/") || /\s/u.test(id4))
|
|
53268
|
+
return void 0;
|
|
53269
|
+
return namespaced ? id4 : `${prefix}${id4}`;
|
|
52648
53270
|
}
|
|
52649
53271
|
function parseQoderConfiguredContextWindows(settings) {
|
|
52650
53272
|
if (!settings || typeof settings !== "object")
|
|
@@ -52656,19 +53278,17 @@ function parseQoderConfiguredContextWindows(settings) {
|
|
|
52656
53278
|
if (!model2 || typeof model2 !== "object")
|
|
52657
53279
|
return void 0;
|
|
52658
53280
|
const { name, preferences } = model2;
|
|
52659
|
-
const windows =
|
|
53281
|
+
const windows = /* @__PURE__ */ Object.create(null);
|
|
52660
53282
|
if (preferences && typeof preferences === "object") {
|
|
52661
53283
|
for (const [modelId2, preference] of Object.entries(preferences)) {
|
|
52662
53284
|
if (!preference || typeof preference !== "object")
|
|
52663
53285
|
continue;
|
|
52664
53286
|
const contextWindow = preference.contextWindow;
|
|
52665
|
-
if (
|
|
53287
|
+
if (isContextWindow(contextWindow)) {
|
|
52666
53288
|
windows[modelId2] = contextWindow;
|
|
52667
53289
|
}
|
|
52668
53290
|
}
|
|
52669
53291
|
}
|
|
52670
|
-
if (Object.keys(windows).length === 0)
|
|
52671
|
-
return void 0;
|
|
52672
53292
|
return {
|
|
52673
53293
|
...typeof name === "string" && name.length > 0 ? { defaultModelId: name } : {},
|
|
52674
53294
|
windows
|
|
@@ -52682,7 +53302,7 @@ var QoderUsageTracker = class {
|
|
|
52682
53302
|
#totalCredits;
|
|
52683
53303
|
#totalCostUsd;
|
|
52684
53304
|
#contextUsagePercent;
|
|
52685
|
-
#
|
|
53305
|
+
#reportedWindow;
|
|
52686
53306
|
#contextUsedTokens;
|
|
52687
53307
|
#latestInputTokens;
|
|
52688
53308
|
#cacheHitRatePercent;
|
|
@@ -52692,28 +53312,33 @@ var QoderUsageTracker = class {
|
|
|
52692
53312
|
#modelId;
|
|
52693
53313
|
#configuredWindows = /* @__PURE__ */ new Map();
|
|
52694
53314
|
constructor(options) {
|
|
52695
|
-
this
|
|
52696
|
-
this.#modelId = options?.modelId;
|
|
53315
|
+
this.setModel(options?.modelId);
|
|
52697
53316
|
}
|
|
52698
|
-
setModel(modelId2
|
|
52699
|
-
if (modelId2)
|
|
52700
|
-
|
|
52701
|
-
if (
|
|
52702
|
-
this.#
|
|
52703
|
-
|
|
52704
|
-
this.#
|
|
53317
|
+
setModel(modelId2) {
|
|
53318
|
+
if (!modelId2 || modelId2 === this.#modelId)
|
|
53319
|
+
return;
|
|
53320
|
+
if (this.#modelId === void 0 || modelAlias(modelId2) !== this.#modelId) {
|
|
53321
|
+
this.#reportedWindow = void 0;
|
|
53322
|
+
this.#contextUsedTokens = void 0;
|
|
53323
|
+
this.#contextUsagePercent = void 0;
|
|
53324
|
+
this.#latestInputTokens = void 0;
|
|
52705
53325
|
}
|
|
53326
|
+
this.#modelId = modelId2;
|
|
52706
53327
|
}
|
|
52707
|
-
/**
|
|
53328
|
+
/** A complete settings response replaces the previous settings, not the native reading. */
|
|
52708
53329
|
setConfiguredContextWindows(configured) {
|
|
52709
|
-
|
|
52710
|
-
|
|
52711
|
-
|
|
53330
|
+
this.#configuredWindows.clear();
|
|
53331
|
+
for (const [modelId2, window] of Object.entries(configured.windows)) {
|
|
53332
|
+
if (isContextWindow(window))
|
|
53333
|
+
this.#configuredWindows.set(modelId2, window);
|
|
52712
53334
|
}
|
|
52713
53335
|
this.#modelId ??= configured.defaultModelId;
|
|
52714
|
-
|
|
52715
|
-
|
|
52716
|
-
|
|
53336
|
+
}
|
|
53337
|
+
#configuredWindow() {
|
|
53338
|
+
if (!this.#modelId)
|
|
53339
|
+
return void 0;
|
|
53340
|
+
const alias = modelAlias(this.#modelId);
|
|
53341
|
+
return this.#configuredWindows.get(this.#modelId) ?? (alias === void 0 ? void 0 : this.#configuredWindows.get(alias));
|
|
52717
53342
|
}
|
|
52718
53343
|
observeAssistant(message) {
|
|
52719
53344
|
const rawUsage = message.message?.usage;
|
|
@@ -52802,8 +53427,11 @@ var QoderUsageTracker = class {
|
|
|
52802
53427
|
if (!context || typeof context !== "object")
|
|
52803
53428
|
return;
|
|
52804
53429
|
const raw = context;
|
|
52805
|
-
if (typeof raw.model === "string" && raw.model
|
|
52806
|
-
this
|
|
53430
|
+
if (typeof raw.model === "string" && raw.model) {
|
|
53431
|
+
if (this.#modelId === void 0)
|
|
53432
|
+
this.#modelId = raw.model;
|
|
53433
|
+
else
|
|
53434
|
+
this.setModel(raw.model);
|
|
52807
53435
|
}
|
|
52808
53436
|
const contextWindow = raw.contextWindow ?? {};
|
|
52809
53437
|
const percent = typeof contextWindow.usedPercentage === "number" ? contextWindow.usedPercentage : typeof raw.usedPercentage === "number" ? raw.usedPercentage : void 0;
|
|
@@ -52811,9 +53439,8 @@ var QoderUsageTracker = class {
|
|
|
52811
53439
|
this.#contextUsagePercent = percent;
|
|
52812
53440
|
}
|
|
52813
53441
|
const maxTokens = typeof contextWindow.maxTokens === "number" ? contextWindow.maxTokens : typeof raw.maxTokens === "number" ? raw.maxTokens : void 0;
|
|
52814
|
-
if (
|
|
52815
|
-
this.#
|
|
52816
|
-
}
|
|
53442
|
+
if (isContextWindow(maxTokens))
|
|
53443
|
+
this.#reportedWindow = maxTokens;
|
|
52817
53444
|
const totalTokens = typeof contextWindow.totalTokens === "number" ? contextWindow.totalTokens : typeof raw.totalTokens === "number" ? raw.totalTokens : void 0;
|
|
52818
53445
|
if (isNonNegativeSafeInteger(totalTokens) && totalTokens >= 0) {
|
|
52819
53446
|
this.#contextUsedTokens = totalTokens;
|
|
@@ -52867,25 +53494,17 @@ var QoderUsageTracker = class {
|
|
|
52867
53494
|
candidate.planFiveHourResetsAtUnix = this.#planFiveHourResetsAtUnix;
|
|
52868
53495
|
}
|
|
52869
53496
|
}
|
|
52870
|
-
const
|
|
52871
|
-
|
|
52872
|
-
|
|
52873
|
-
|
|
52874
|
-
|
|
52875
|
-
usedTokens = this.#latestInputTokens;
|
|
52876
|
-
|
|
52877
|
-
|
|
52878
|
-
|
|
52879
|
-
|
|
52880
|
-
if (this.#contextUsagePercent === void 0) {
|
|
52881
|
-
candidate.contextUsagePercent = Math.min(100, Math.max(0, usedTokens / windowTokens * 100));
|
|
52882
|
-
} else {
|
|
52883
|
-
candidate.contextUsagePercent = this.#contextUsagePercent;
|
|
53497
|
+
const percent = this.#contextUsagePercent;
|
|
53498
|
+
if (percent !== void 0)
|
|
53499
|
+
candidate.contextUsagePercent = percent;
|
|
53500
|
+
const windowTokens = this.#reportedWindow ?? this.#configuredWindow();
|
|
53501
|
+
if (windowTokens !== void 0) {
|
|
53502
|
+
const usedTokens = this.#contextUsedTokens ?? (percent === void 0 ? this.#latestInputTokens : Math.round(windowTokens * (percent / 100)));
|
|
53503
|
+
if (usedTokens !== void 0) {
|
|
53504
|
+
candidate.contextUsedTokens = usedTokens;
|
|
53505
|
+
candidate.contextWindowTokens = windowTokens;
|
|
53506
|
+
candidate.contextUsagePercent = percent ?? Math.min(100, usedTokens / windowTokens * 100);
|
|
52884
53507
|
}
|
|
52885
|
-
} else if (this.#contextUsagePercent !== void 0 && windowTokens > 0) {
|
|
52886
|
-
candidate.contextUsedTokens = Math.round(windowTokens * this.#contextUsagePercent / 100);
|
|
52887
|
-
candidate.contextWindowTokens = windowTokens;
|
|
52888
|
-
candidate.contextUsagePercent = this.#contextUsagePercent;
|
|
52889
53508
|
}
|
|
52890
53509
|
if (Object.keys(candidate).length === 0)
|
|
52891
53510
|
return null;
|
|
@@ -52958,8 +53577,9 @@ var QoderSession = class {
|
|
|
52958
53577
|
#closed = false;
|
|
52959
53578
|
#consumerLoopDone;
|
|
52960
53579
|
#configuredContextWindows;
|
|
52961
|
-
/** Set when a usage refresh stopped waiting for `get_settings
|
|
53580
|
+
/** Set when a usage refresh stopped waiting for `get_settings`. */
|
|
52962
53581
|
#usageRefreshedWithoutSettings = false;
|
|
53582
|
+
#usageModelRevision = 0;
|
|
52963
53583
|
constructor(options) {
|
|
52964
53584
|
const variant = options.variant ?? "global";
|
|
52965
53585
|
const runtime = QODER_RUNTIMES[variant];
|
|
@@ -53014,7 +53634,7 @@ var QoderSession = class {
|
|
|
53014
53634
|
...availableThinkingOptions && availableThinkingOptions.length > 0 ? { availableThinkingOptions } : {}
|
|
53015
53635
|
};
|
|
53016
53636
|
this.initialState = { ...this.#state };
|
|
53017
|
-
const nativeModel = options.model ?
|
|
53637
|
+
const nativeModel = options.model ? qoderModelValue(options.model) : void 0;
|
|
53018
53638
|
this.#usageTracker = new QoderUsageTracker(nativeModel ? { modelId: nativeModel } : void 0);
|
|
53019
53639
|
const planMode = isQoderPlanModeId(options.permissionModeId);
|
|
53020
53640
|
const permissionMode = mapToQoderPermissionModeExcludingPlan(options.permissionModeId);
|
|
@@ -53786,8 +54406,7 @@ var QoderSession = class {
|
|
|
53786
54406
|
}
|
|
53787
54407
|
/**
|
|
53788
54408
|
* `get_context_usage` may report only a percentage, so read the effective per-model
|
|
53789
|
-
* `contextWindow` from `get_settings`.
|
|
53790
|
-
* built-in fallback window.
|
|
54409
|
+
* `contextWindow` from `get_settings`. If no window is known, report only the measured usage.
|
|
53791
54410
|
*/
|
|
53792
54411
|
#loadConfiguredContextWindows() {
|
|
53793
54412
|
if (typeof this.#query.request !== "function")
|
|
@@ -53828,11 +54447,16 @@ var QoderSession = class {
|
|
|
53828
54447
|
}
|
|
53829
54448
|
}
|
|
53830
54449
|
async refreshUsage(forTurnId) {
|
|
54450
|
+
const revision = this.#usageModelRevision;
|
|
53831
54451
|
await this.#awaitConfiguredContextWindows();
|
|
54452
|
+
if (revision !== this.#usageModelRevision || this.#closed)
|
|
54453
|
+
return;
|
|
53832
54454
|
let changed = false;
|
|
53833
54455
|
if (this.#query.getContextUsage) {
|
|
53834
54456
|
try {
|
|
53835
54457
|
const usage = await this.#query.getContextUsage();
|
|
54458
|
+
if (revision !== this.#usageModelRevision || this.#closed)
|
|
54459
|
+
return;
|
|
53836
54460
|
if (usage) {
|
|
53837
54461
|
this.#usageTracker.observeContextUsage(usage);
|
|
53838
54462
|
changed = true;
|
|
@@ -53843,6 +54467,8 @@ var QoderSession = class {
|
|
|
53843
54467
|
if (this.#query.getUsageInfo) {
|
|
53844
54468
|
try {
|
|
53845
54469
|
const info = await this.#query.getUsageInfo();
|
|
54470
|
+
if (revision !== this.#usageModelRevision || this.#closed)
|
|
54471
|
+
return;
|
|
53846
54472
|
if (info) {
|
|
53847
54473
|
this.#usageTracker.observeUsageInfo(info);
|
|
53848
54474
|
changed = true;
|
|
@@ -53850,7 +54476,7 @@ var QoderSession = class {
|
|
|
53850
54476
|
} catch {
|
|
53851
54477
|
}
|
|
53852
54478
|
}
|
|
53853
|
-
if (changed && !this.#closed) {
|
|
54479
|
+
if (changed && !this.#closed && revision === this.#usageModelRevision) {
|
|
53854
54480
|
const snapshot = this.#usageTracker.snapshot();
|
|
53855
54481
|
if (snapshot) {
|
|
53856
54482
|
const targetTurnId = forTurnId ?? this.#activeTurn?.turnId;
|
|
@@ -54042,7 +54668,7 @@ var QoderSession = class {
|
|
|
54042
54668
|
}
|
|
54043
54669
|
};
|
|
54044
54670
|
}
|
|
54045
|
-
const nativeModel =
|
|
54671
|
+
const nativeModel = qoderModelValue(command.model);
|
|
54046
54672
|
if (!nativeModel) {
|
|
54047
54673
|
return {
|
|
54048
54674
|
ok: false,
|
|
@@ -54100,7 +54726,9 @@ var QoderSession = class {
|
|
|
54100
54726
|
delete nextState.availableThinkingOptions;
|
|
54101
54727
|
}
|
|
54102
54728
|
this.#state = nextState;
|
|
54729
|
+
this.#usageModelRevision += 1;
|
|
54103
54730
|
this.#usageTracker.setModel(nativeModel);
|
|
54731
|
+
this.#emitEvent({ type: "session.usage.changed", usage: this.#usageTracker.snapshot() });
|
|
54104
54732
|
void this.#loadConfiguredContextWindows();
|
|
54105
54733
|
void this.refreshUsage();
|
|
54106
54734
|
this.#emitEvent({
|
|
@@ -54134,7 +54762,7 @@ var QoderSession = class {
|
|
|
54134
54762
|
};
|
|
54135
54763
|
}
|
|
54136
54764
|
}
|
|
54137
|
-
const nativeModel = this.#state.effectiveModel ?
|
|
54765
|
+
const nativeModel = this.#state.effectiveModel ? qoderModelValue(this.#state.effectiveModel) : void 0;
|
|
54138
54766
|
if (this.#state.effectiveModel && !nativeModel) {
|
|
54139
54767
|
return {
|
|
54140
54768
|
ok: false,
|
|
@@ -54313,7 +54941,7 @@ var QoderSession = class {
|
|
|
54313
54941
|
return { ok: true, value: { turnId: command.turnId } };
|
|
54314
54942
|
}
|
|
54315
54943
|
#cancelPendingInteractions(turnId, reason) {
|
|
54316
|
-
for (const [
|
|
54944
|
+
for (const [id4, pending] of this.#pendingInteractions) {
|
|
54317
54945
|
this.#emitEvent({
|
|
54318
54946
|
type: "interaction.closed",
|
|
54319
54947
|
interactionId: pending.id,
|
|
@@ -54321,7 +54949,7 @@ var QoderSession = class {
|
|
|
54321
54949
|
reason: "cancelled"
|
|
54322
54950
|
});
|
|
54323
54951
|
pending.resolve({ behavior: "deny", message: reason });
|
|
54324
|
-
this.#pendingInteractions.delete(
|
|
54952
|
+
this.#pendingInteractions.delete(id4);
|
|
54325
54953
|
}
|
|
54326
54954
|
}
|
|
54327
54955
|
async close() {
|
|
@@ -54414,7 +55042,7 @@ var QoderSession = class {
|
|
|
54414
55042
|
outcome
|
|
54415
55043
|
});
|
|
54416
55044
|
} else {
|
|
54417
|
-
for (const [
|
|
55045
|
+
for (const [id4, pending] of this.#pendingInteractions) {
|
|
54418
55046
|
this.#emitEvent({
|
|
54419
55047
|
type: "interaction.closed",
|
|
54420
55048
|
interactionId: pending.id,
|
|
@@ -54422,7 +55050,7 @@ var QoderSession = class {
|
|
|
54422
55050
|
reason: "cancelled"
|
|
54423
55051
|
});
|
|
54424
55052
|
pending.resolve({ behavior: "deny", message: "Session closed" });
|
|
54425
|
-
this.#pendingInteractions.delete(
|
|
55053
|
+
this.#pendingInteractions.delete(id4);
|
|
54426
55054
|
}
|
|
54427
55055
|
}
|
|
54428
55056
|
if (error51)
|
|
@@ -54804,12 +55432,12 @@ async function readQoderModelLabels(configDirectory, signal) {
|
|
|
54804
55432
|
const prefix = "modelSelector.item.";
|
|
54805
55433
|
if (!key.startsWith(prefix))
|
|
54806
55434
|
continue;
|
|
54807
|
-
const
|
|
54808
|
-
if (!
|
|
55435
|
+
const id4 = key.slice(prefix.length);
|
|
55436
|
+
if (!id4 || id4.length > 512 || /\.(description|markdownDescription)(\.|$)/u.test(id4))
|
|
54809
55437
|
continue;
|
|
54810
55438
|
if (typeof value !== "string" || !value.trim() || value.trim().length > 512)
|
|
54811
55439
|
continue;
|
|
54812
|
-
labels.set(
|
|
55440
|
+
labels.set(id4, value.trim());
|
|
54813
55441
|
}
|
|
54814
55442
|
}
|
|
54815
55443
|
return Object.fromEntries(labels);
|
|
@@ -54864,12 +55492,12 @@ async function readQoderUsage(file2, signal) {
|
|
|
54864
55492
|
cwd ??= line.cwd;
|
|
54865
55493
|
if (isRecord2(line.forkedFrom) || line.isApiErrorMessage === true)
|
|
54866
55494
|
continue;
|
|
54867
|
-
const { id:
|
|
54868
|
-
if (typeof
|
|
55495
|
+
const { id: id4, model: model2, usage } = line.message;
|
|
55496
|
+
if (typeof id4 !== "string" || !id4 || model2 === "<synthetic>")
|
|
54869
55497
|
continue;
|
|
54870
|
-
const message = messages.get(
|
|
55498
|
+
const message = messages.get(id4) ?? { at: null };
|
|
54871
55499
|
message.at ??= nativeTimeMs(line.timestamp);
|
|
54872
|
-
messages.set(
|
|
55500
|
+
messages.set(id4, message);
|
|
54873
55501
|
if (!isRecord2(usage) || message.at === null)
|
|
54874
55502
|
continue;
|
|
54875
55503
|
const input = usage.input_tokens;
|
|
@@ -54884,7 +55512,7 @@ async function readQoderUsage(file2, signal) {
|
|
|
54884
55512
|
const thinking = details?.thinking_tokens;
|
|
54885
55513
|
const unreported = input === 0 && output === 0 && cached2 === 0 && written === 0;
|
|
54886
55514
|
const entry = parseHarnessUsageEntry({
|
|
54887
|
-
id:
|
|
55515
|
+
id: id4,
|
|
54888
55516
|
occurredAtMs: message.at,
|
|
54889
55517
|
...typeof model2 === "string" && model2 ? { model: model2 } : {},
|
|
54890
55518
|
inputTokens: input + cached2 + written,
|
|
@@ -54916,6 +55544,7 @@ function createQoderUsageStatistics(environment, variant) {
|
|
|
54916
55544
|
|
|
54917
55545
|
// dist/qoder-adapter.js
|
|
54918
55546
|
var QoderAdapter = class {
|
|
55547
|
+
normalizeStoredModelRef = normalizeStoredQoderModelRef;
|
|
54919
55548
|
harnessId;
|
|
54920
55549
|
#variant;
|
|
54921
55550
|
commandCatalog = QODER_FALLBACK_COMMAND_CATALOG;
|
|
@@ -55028,8 +55657,8 @@ var QoderAdapter = class {
|
|
|
55028
55657
|
};
|
|
55029
55658
|
}
|
|
55030
55659
|
if (input?.refresh) {
|
|
55031
|
-
this.#inspections.
|
|
55032
|
-
this.#inFlightInspections.
|
|
55660
|
+
this.#inspections.clear();
|
|
55661
|
+
this.#inFlightInspections.clear();
|
|
55033
55662
|
} else {
|
|
55034
55663
|
const cached2 = this.#inspections.get(cacheKey);
|
|
55035
55664
|
if (cached2)
|
|
@@ -55144,7 +55773,7 @@ var QoderAdapter = class {
|
|
|
55144
55773
|
return task;
|
|
55145
55774
|
}
|
|
55146
55775
|
async open(input) {
|
|
55147
|
-
if ("model" in input && input.model && !
|
|
55776
|
+
if ("model" in input && input.model && !qoderModelValue(input.model)) {
|
|
55148
55777
|
return {
|
|
55149
55778
|
ok: false,
|
|
55150
55779
|
error: { code: "invalidRequest", message: "Invalid Qoder Model Ref", retryable: false }
|
|
@@ -55189,8 +55818,8 @@ var QoderAdapter = class {
|
|
|
55189
55818
|
if (input.kind === "create") {
|
|
55190
55819
|
sessionId = randomUUID2();
|
|
55191
55820
|
} else if (input.kind === "resume") {
|
|
55192
|
-
const
|
|
55193
|
-
if (!
|
|
55821
|
+
const id4 = input.nativeRef?.nativeSessionId;
|
|
55822
|
+
if (!id4 || typeof id4 !== "string" || input.nativeRef.harnessId !== this.harnessId) {
|
|
55194
55823
|
return {
|
|
55195
55824
|
ok: false,
|
|
55196
55825
|
error: {
|
|
@@ -55200,8 +55829,8 @@ var QoderAdapter = class {
|
|
|
55200
55829
|
}
|
|
55201
55830
|
};
|
|
55202
55831
|
}
|
|
55203
|
-
sessionId =
|
|
55204
|
-
openResumeId =
|
|
55832
|
+
sessionId = id4;
|
|
55833
|
+
openResumeId = id4;
|
|
55205
55834
|
} else if (input.kind === "fork") {
|
|
55206
55835
|
const sourceRef = nativeSessionRefSchema.safeParse(input.sourceRef);
|
|
55207
55836
|
const checkpoint = nativeCheckpointRefSchema.safeParse(input.checkpoint);
|