@codexhost/cli-win32-arm64 0.12.2 → 0.13.1
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/THIRD_PARTY_NOTICES.txt +9 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +319 -64
- package/app/console-web.js +5089 -1367
- package/app/desktop-controller.mjs +259 -41
- package/app/host-runtime.mjs +5735 -1564
- package/app/plugins/antigravity/manifest.json +18 -1
- package/app/plugins/antigravity/plugin.mjs +282 -41
- package/app/plugins/claude-code/manifest.json +28 -0
- package/app/plugins/claude-code/plugin.mjs +35300 -23918
- package/app/plugins/codebuddy/manifest.json +17 -0
- package/app/plugins/codebuddy/plugin.mjs +5971 -5355
- package/app/plugins/codex-usage/manifest.json +9 -0
- package/app/plugins/codex-usage/plugin.mjs +17324 -0
- package/app/plugins/cursor-cli/manifest.json +17 -0
- package/app/plugins/cursor-cli/plugin.mjs +357 -76
- package/app/plugins/deepseek-harness/assets/icon.svg +1 -0
- package/app/plugins/deepseek-harness/manifest.json +35 -2
- package/app/plugins/deepseek-harness/plugin.mjs +822 -241
- package/app/plugins/enabled.json +2 -1
- package/app/plugins/grok/manifest.json +21 -1
- package/app/plugins/grok/plugin.mjs +918 -258
- package/app/plugins/hermes/assets/icon.png +0 -0
- package/app/plugins/hermes/manifest.json +30 -2
- package/app/plugins/hermes/plugin.mjs +284 -32
- package/app/plugins/kimi-code/assets/icon.svg +5 -0
- package/app/plugins/kimi-code/manifest.json +25 -2
- package/app/plugins/kimi-code/plugin.mjs +561 -35
- package/app/plugins/kiro-cli/assets/kiro-agent.svg +11 -0
- package/app/plugins/kiro-cli/manifest.json +18 -1
- package/app/plugins/kiro-cli/plugin.mjs +290 -21
- package/app/plugins/omp/manifest.json +21 -1
- package/app/plugins/omp/plugin.mjs +2765 -1960
- package/app/plugins/opencode/manifest.json +18 -1
- package/app/plugins/opencode/plugin.mjs +723 -146
- package/app/plugins/pi/manifest.json +32 -0
- package/app/plugins/pi/plugin.mjs +2908 -2312
- package/app/plugins/qoder/manifest.json +18 -1
- package/app/plugins/qoder/plugin.mjs +634 -80
- package/app/plugins/qoder-cn/manifest.json +18 -1
- package/app/plugins/qoder-cn/plugin.mjs +634 -80
- package/app/plugins/workbuddy/manifest.json +18 -0
- package/app/plugins/workbuddy/plugin.mjs +6361 -5747
- package/app/plugins/zcode/manifest.json +19 -1
- package/app/plugins/zcode/plugin.mjs +1098 -259
- package/app/renderer-extension.js +13080 -8884
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/licenses/Cordis-LICENSE.txt +21 -0
- package/licenses/Cosmokit-LICENSE.txt +21 -0
- package/package.json +1 -1
- package/app/plugins/kiro-cli/assets/icon.svg +0 -5
|
@@ -2220,20 +2220,20 @@ var require_resolve = __commonJS({
|
|
|
2220
2220
|
return false;
|
|
2221
2221
|
}
|
|
2222
2222
|
function countKeys(schema) {
|
|
2223
|
-
let
|
|
2223
|
+
let count3 = 0;
|
|
2224
2224
|
for (const key in schema) {
|
|
2225
2225
|
if (key === "$ref")
|
|
2226
2226
|
return Infinity;
|
|
2227
|
-
|
|
2227
|
+
count3++;
|
|
2228
2228
|
if (SIMPLE_INLINED.has(key))
|
|
2229
2229
|
continue;
|
|
2230
2230
|
if (typeof schema[key] == "object") {
|
|
2231
|
-
(0, util_1.eachItem)(schema[key], (sch) =>
|
|
2231
|
+
(0, util_1.eachItem)(schema[key], (sch) => count3 += countKeys(sch));
|
|
2232
2232
|
}
|
|
2233
|
-
if (
|
|
2233
|
+
if (count3 === Infinity)
|
|
2234
2234
|
return Infinity;
|
|
2235
2235
|
}
|
|
2236
|
-
return
|
|
2236
|
+
return count3;
|
|
2237
2237
|
}
|
|
2238
2238
|
function getFullPath(resolver, id = "", normalize) {
|
|
2239
2239
|
if (normalize !== false)
|
|
@@ -3155,7 +3155,7 @@ var require_utils = __commonJS({
|
|
|
3155
3155
|
return true;
|
|
3156
3156
|
}
|
|
3157
3157
|
function getIPV6(input) {
|
|
3158
|
-
let
|
|
3158
|
+
let tokenCount2 = 0;
|
|
3159
3159
|
const output = { error: false, address: "", zone: "" };
|
|
3160
3160
|
const address = [];
|
|
3161
3161
|
const buffer = [];
|
|
@@ -3174,7 +3174,7 @@ var require_utils = __commonJS({
|
|
|
3174
3174
|
if (!consume(buffer, address, output)) {
|
|
3175
3175
|
break;
|
|
3176
3176
|
}
|
|
3177
|
-
if (++
|
|
3177
|
+
if (++tokenCount2 > 7) {
|
|
3178
3178
|
output.error = true;
|
|
3179
3179
|
break;
|
|
3180
3180
|
}
|
|
@@ -3229,8 +3229,8 @@ var require_utils = __commonJS({
|
|
|
3229
3229
|
}
|
|
3230
3230
|
return ind;
|
|
3231
3231
|
}
|
|
3232
|
-
function removeDotSegments(
|
|
3233
|
-
let input =
|
|
3232
|
+
function removeDotSegments(path10) {
|
|
3233
|
+
let input = path10;
|
|
3234
3234
|
const output = [];
|
|
3235
3235
|
let nextSlash = -1;
|
|
3236
3236
|
let len = 0;
|
|
@@ -3482,8 +3482,8 @@ var require_schemes = __commonJS({
|
|
|
3482
3482
|
wsComponent.secure = void 0;
|
|
3483
3483
|
}
|
|
3484
3484
|
if (wsComponent.resourceName) {
|
|
3485
|
-
const [
|
|
3486
|
-
wsComponent.path =
|
|
3485
|
+
const [path10, query] = wsComponent.resourceName.split("?");
|
|
3486
|
+
wsComponent.path = path10 && path10 !== "/" ? path10 : void 0;
|
|
3487
3487
|
wsComponent.query = query;
|
|
3488
3488
|
wsComponent.resourceName = void 0;
|
|
3489
3489
|
}
|
|
@@ -5411,8 +5411,8 @@ var require_contains = __commonJS({
|
|
|
5411
5411
|
cxt.result(valid, () => cxt.reset());
|
|
5412
5412
|
function validateItemsWithCount() {
|
|
5413
5413
|
const schValid = gen.name("_valid");
|
|
5414
|
-
const
|
|
5415
|
-
validateItems(schValid, () => gen.if(schValid, () => checkLimits(
|
|
5414
|
+
const count3 = gen.let("count", 0);
|
|
5415
|
+
validateItems(schValid, () => gen.if(schValid, () => checkLimits(count3)));
|
|
5416
5416
|
}
|
|
5417
5417
|
function validateItems(_valid, block) {
|
|
5418
5418
|
gen.forRange("i", 0, len, (i) => {
|
|
@@ -5425,16 +5425,16 @@ var require_contains = __commonJS({
|
|
|
5425
5425
|
block();
|
|
5426
5426
|
});
|
|
5427
5427
|
}
|
|
5428
|
-
function checkLimits(
|
|
5429
|
-
gen.code((0, codegen_1._)`${
|
|
5428
|
+
function checkLimits(count3) {
|
|
5429
|
+
gen.code((0, codegen_1._)`${count3}++`);
|
|
5430
5430
|
if (max === void 0) {
|
|
5431
|
-
gen.if((0, codegen_1._)`${
|
|
5431
|
+
gen.if((0, codegen_1._)`${count3} >= ${min}`, () => gen.assign(valid, true).break());
|
|
5432
5432
|
} else {
|
|
5433
|
-
gen.if((0, codegen_1._)`${
|
|
5433
|
+
gen.if((0, codegen_1._)`${count3} > ${max}`, () => gen.assign(valid, false).break());
|
|
5434
5434
|
if (min === 1)
|
|
5435
5435
|
gen.assign(valid, true);
|
|
5436
5436
|
else
|
|
5437
|
-
gen.if((0, codegen_1._)`${
|
|
5437
|
+
gen.if((0, codegen_1._)`${count3} >= ${min}`, () => gen.assign(valid, true));
|
|
5438
5438
|
}
|
|
5439
5439
|
}
|
|
5440
5440
|
}
|
|
@@ -8933,20 +8933,20 @@ var require_resolve2 = __commonJS({
|
|
|
8933
8933
|
return false;
|
|
8934
8934
|
}
|
|
8935
8935
|
function countKeys(schema) {
|
|
8936
|
-
let
|
|
8936
|
+
let count3 = 0;
|
|
8937
8937
|
for (const key in schema) {
|
|
8938
8938
|
if (key === "$ref")
|
|
8939
8939
|
return Infinity;
|
|
8940
|
-
|
|
8940
|
+
count3++;
|
|
8941
8941
|
if (SIMPLE_INLINED.has(key))
|
|
8942
8942
|
continue;
|
|
8943
8943
|
if (typeof schema[key] == "object") {
|
|
8944
|
-
(0, util_1.eachItem)(schema[key], (sch) =>
|
|
8944
|
+
(0, util_1.eachItem)(schema[key], (sch) => count3 += countKeys(sch));
|
|
8945
8945
|
}
|
|
8946
|
-
if (
|
|
8946
|
+
if (count3 === Infinity)
|
|
8947
8947
|
return Infinity;
|
|
8948
8948
|
}
|
|
8949
|
-
return
|
|
8949
|
+
return count3;
|
|
8950
8950
|
}
|
|
8951
8951
|
function getFullPath(resolver, id = "", normalize) {
|
|
8952
8952
|
if (normalize !== false)
|
|
@@ -11309,8 +11309,8 @@ var require_contains2 = __commonJS({
|
|
|
11309
11309
|
cxt.result(valid, () => cxt.reset());
|
|
11310
11310
|
function validateItemsWithCount() {
|
|
11311
11311
|
const schValid = gen.name("_valid");
|
|
11312
|
-
const
|
|
11313
|
-
validateItems(schValid, () => gen.if(schValid, () => checkLimits(
|
|
11312
|
+
const count3 = gen.let("count", 0);
|
|
11313
|
+
validateItems(schValid, () => gen.if(schValid, () => checkLimits(count3)));
|
|
11314
11314
|
}
|
|
11315
11315
|
function validateItems(_valid, block) {
|
|
11316
11316
|
gen.forRange("i", 0, len, (i) => {
|
|
@@ -11323,16 +11323,16 @@ var require_contains2 = __commonJS({
|
|
|
11323
11323
|
block();
|
|
11324
11324
|
});
|
|
11325
11325
|
}
|
|
11326
|
-
function checkLimits(
|
|
11327
|
-
gen.code((0, codegen_1._)`${
|
|
11326
|
+
function checkLimits(count3) {
|
|
11327
|
+
gen.code((0, codegen_1._)`${count3}++`);
|
|
11328
11328
|
if (max === void 0) {
|
|
11329
|
-
gen.if((0, codegen_1._)`${
|
|
11329
|
+
gen.if((0, codegen_1._)`${count3} >= ${min}`, () => gen.assign(valid, true).break());
|
|
11330
11330
|
} else {
|
|
11331
|
-
gen.if((0, codegen_1._)`${
|
|
11331
|
+
gen.if((0, codegen_1._)`${count3} > ${max}`, () => gen.assign(valid, false).break());
|
|
11332
11332
|
if (min === 1)
|
|
11333
11333
|
gen.assign(valid, true);
|
|
11334
11334
|
else
|
|
11335
|
-
gen.if((0, codegen_1._)`${
|
|
11335
|
+
gen.if((0, codegen_1._)`${count3} >= ${min}`, () => gen.assign(valid, true));
|
|
11336
11336
|
}
|
|
11337
11337
|
}
|
|
11338
11338
|
}
|
|
@@ -12995,7 +12995,7 @@ function createHarnessInstaller(environment, source) {
|
|
|
12995
12995
|
|
|
12996
12996
|
// dist/qoder-adapter.js
|
|
12997
12997
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
12998
|
-
import
|
|
12998
|
+
import path9 from "node:path";
|
|
12999
12999
|
|
|
13000
13000
|
// ../../../node_modules/zod/v4/classic/external.js
|
|
13001
13001
|
var external_exports = {};
|
|
@@ -13763,10 +13763,10 @@ function mergeDefs(...defs) {
|
|
|
13763
13763
|
function cloneDef(schema) {
|
|
13764
13764
|
return mergeDefs(schema._zod.def);
|
|
13765
13765
|
}
|
|
13766
|
-
function getElementAtPath(obj,
|
|
13767
|
-
if (!
|
|
13766
|
+
function getElementAtPath(obj, path10) {
|
|
13767
|
+
if (!path10)
|
|
13768
13768
|
return obj;
|
|
13769
|
-
return
|
|
13769
|
+
return path10.reduce((acc, key) => acc?.[key], obj);
|
|
13770
13770
|
}
|
|
13771
13771
|
function promiseAllObject(promisesObj) {
|
|
13772
13772
|
const keys = Object.keys(promisesObj);
|
|
@@ -14175,11 +14175,11 @@ function explicitlyAborted(x3, startIndex = 0) {
|
|
|
14175
14175
|
}
|
|
14176
14176
|
return false;
|
|
14177
14177
|
}
|
|
14178
|
-
function prefixIssues(
|
|
14178
|
+
function prefixIssues(path10, issues) {
|
|
14179
14179
|
return issues.map((iss) => {
|
|
14180
14180
|
var _a5;
|
|
14181
14181
|
(_a5 = iss).path ?? (_a5.path = []);
|
|
14182
|
-
iss.path.unshift(
|
|
14182
|
+
iss.path.unshift(path10);
|
|
14183
14183
|
return iss;
|
|
14184
14184
|
});
|
|
14185
14185
|
}
|
|
@@ -14326,16 +14326,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
14326
14326
|
}
|
|
14327
14327
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
14328
14328
|
const fieldErrors = { _errors: [] };
|
|
14329
|
-
const processError = (error52,
|
|
14329
|
+
const processError = (error52, path10 = []) => {
|
|
14330
14330
|
for (const issue2 of error52.issues) {
|
|
14331
14331
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
14332
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
14332
|
+
issue2.errors.map((issues) => processError({ issues }, [...path10, ...issue2.path]));
|
|
14333
14333
|
} else if (issue2.code === "invalid_key") {
|
|
14334
|
-
processError({ issues: issue2.issues }, [...
|
|
14334
|
+
processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
|
|
14335
14335
|
} else if (issue2.code === "invalid_element") {
|
|
14336
|
-
processError({ issues: issue2.issues }, [...
|
|
14336
|
+
processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
|
|
14337
14337
|
} else {
|
|
14338
|
-
const fullpath = [...
|
|
14338
|
+
const fullpath = [...path10, ...issue2.path];
|
|
14339
14339
|
if (fullpath.length === 0) {
|
|
14340
14340
|
fieldErrors._errors.push(mapper(issue2));
|
|
14341
14341
|
} else {
|
|
@@ -14362,17 +14362,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
14362
14362
|
}
|
|
14363
14363
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
14364
14364
|
const result = { errors: [] };
|
|
14365
|
-
const processError = (error52,
|
|
14365
|
+
const processError = (error52, path10 = []) => {
|
|
14366
14366
|
var _a5, _b;
|
|
14367
14367
|
for (const issue2 of error52.issues) {
|
|
14368
14368
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
14369
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
14369
|
+
issue2.errors.map((issues) => processError({ issues }, [...path10, ...issue2.path]));
|
|
14370
14370
|
} else if (issue2.code === "invalid_key") {
|
|
14371
|
-
processError({ issues: issue2.issues }, [...
|
|
14371
|
+
processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
|
|
14372
14372
|
} else if (issue2.code === "invalid_element") {
|
|
14373
|
-
processError({ issues: issue2.issues }, [...
|
|
14373
|
+
processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
|
|
14374
14374
|
} else {
|
|
14375
|
-
const fullpath = [...
|
|
14375
|
+
const fullpath = [...path10, ...issue2.path];
|
|
14376
14376
|
if (fullpath.length === 0) {
|
|
14377
14377
|
result.errors.push(mapper(issue2));
|
|
14378
14378
|
continue;
|
|
@@ -14404,8 +14404,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
14404
14404
|
}
|
|
14405
14405
|
function toDotPath(_path) {
|
|
14406
14406
|
const segs = [];
|
|
14407
|
-
const
|
|
14408
|
-
for (const seg of
|
|
14407
|
+
const path10 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
14408
|
+
for (const seg of path10) {
|
|
14409
14409
|
if (typeof seg === "number")
|
|
14410
14410
|
segs.push(`[${seg}]`);
|
|
14411
14411
|
else if (typeof seg === "symbol")
|
|
@@ -17633,8 +17633,8 @@ function az_default() {
|
|
|
17633
17633
|
}
|
|
17634
17634
|
|
|
17635
17635
|
// ../../../node_modules/zod/v4/locales/be.js
|
|
17636
|
-
function getBelarusianPlural(
|
|
17637
|
-
const absCount = Math.abs(
|
|
17636
|
+
function getBelarusianPlural(count3, one, few, many) {
|
|
17637
|
+
const absCount = Math.abs(count3);
|
|
17638
17638
|
const lastDigit = absCount % 10;
|
|
17639
17639
|
const lastTwoDigits = absCount % 100;
|
|
17640
17640
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -19712,8 +19712,8 @@ function hu_default() {
|
|
|
19712
19712
|
}
|
|
19713
19713
|
|
|
19714
19714
|
// ../../../node_modules/zod/v4/locales/hy.js
|
|
19715
|
-
function getArmenianPlural(
|
|
19716
|
-
return Math.abs(
|
|
19715
|
+
function getArmenianPlural(count3, one, many) {
|
|
19716
|
+
return Math.abs(count3) === 1 ? one : many;
|
|
19717
19717
|
}
|
|
19718
19718
|
function withDefiniteArticle(word) {
|
|
19719
19719
|
if (!word)
|
|
@@ -21841,8 +21841,8 @@ function ro_default() {
|
|
|
21841
21841
|
}
|
|
21842
21842
|
|
|
21843
21843
|
// ../../../node_modules/zod/v4/locales/ru.js
|
|
21844
|
-
function getRussianPlural(
|
|
21845
|
-
const absCount = Math.abs(
|
|
21844
|
+
function getRussianPlural(count3, one, few, many) {
|
|
21845
|
+
const absCount = Math.abs(count3);
|
|
21846
21846
|
const lastDigit = absCount % 10;
|
|
21847
21847
|
const lastTwoDigits = absCount % 100;
|
|
21848
21848
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -27097,13 +27097,13 @@ function resolveRef(ref, ctx) {
|
|
|
27097
27097
|
if (!ref.startsWith("#")) {
|
|
27098
27098
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
27099
27099
|
}
|
|
27100
|
-
const
|
|
27101
|
-
if (
|
|
27100
|
+
const path10 = ref.slice(1).split("/").filter(Boolean);
|
|
27101
|
+
if (path10.length === 0) {
|
|
27102
27102
|
return ctx.rootSchema;
|
|
27103
27103
|
}
|
|
27104
27104
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
27105
|
-
if (
|
|
27106
|
-
const key =
|
|
27105
|
+
if (path10[0] === defsKey) {
|
|
27106
|
+
const key = path10[1];
|
|
27107
27107
|
if (!key || !ctx.defs[key]) {
|
|
27108
27108
|
throw new Error(`Reference not found: ${ref}`);
|
|
27109
27109
|
}
|
|
@@ -27511,6 +27511,15 @@ function date4(params) {
|
|
|
27511
27511
|
// ../../../node_modules/zod/v4/classic/external.js
|
|
27512
27512
|
config(en_default());
|
|
27513
27513
|
|
|
27514
|
+
// ../../shared-contracts/dist/delegation-read.js
|
|
27515
|
+
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
27516
|
+
var delegationReadParamsSchema = external_exports.strictObject({
|
|
27517
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
27518
|
+
view: external_exports.enum(["result", "messages"]),
|
|
27519
|
+
cursor: external_exports.string().min(1).max(8192).optional(),
|
|
27520
|
+
limit: external_exports.number().int().min(1).max(100).optional()
|
|
27521
|
+
});
|
|
27522
|
+
|
|
27514
27523
|
// ../../shared-contracts/dist/credential-imports.js
|
|
27515
27524
|
var credentialSourceSchema = external_exports.object({
|
|
27516
27525
|
id: external_exports.string().min(1).max(256),
|
|
@@ -27581,6 +27590,160 @@ var harnessDisplaySetSchema = external_exports.strictObject({
|
|
|
27581
27590
|
initializeOnly: external_exports.boolean().optional()
|
|
27582
27591
|
});
|
|
27583
27592
|
|
|
27593
|
+
// ../../shared-contracts/dist/model-price-overrides.js
|
|
27594
|
+
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
27595
|
+
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
27596
|
+
input: usdPerMillionTokens,
|
|
27597
|
+
output: usdPerMillionTokens,
|
|
27598
|
+
cacheRead: usdPerMillionTokens.optional(),
|
|
27599
|
+
cacheWrite: usdPerMillionTokens.optional(),
|
|
27600
|
+
cacheWrite1h: usdPerMillionTokens.optional()
|
|
27601
|
+
});
|
|
27602
|
+
var modelPriceKeySchema = external_exports.string().max(512).refine((key) => key.trim() === key && key.length > 0, "Model ID is required");
|
|
27603
|
+
var modelPriceOverridesSchema = external_exports.strictObject({
|
|
27604
|
+
/** Absolute path of the Host's `pricing.json`. */
|
|
27605
|
+
path: external_exports.string(),
|
|
27606
|
+
entries: external_exports.array(external_exports.strictObject({ key: external_exports.string(), price: modelPriceOverrideSchema })),
|
|
27607
|
+
/** Why the existing file is unusable; the Host then ignores it and refuses to overwrite it. */
|
|
27608
|
+
error: external_exports.string().nullable()
|
|
27609
|
+
});
|
|
27610
|
+
var modelPriceOverridesGetSchema = external_exports.strictObject({});
|
|
27611
|
+
var modelPriceOverridesSetSchema = external_exports.strictObject({
|
|
27612
|
+
key: modelPriceKeySchema,
|
|
27613
|
+
price: modelPriceOverrideSchema.nullable(),
|
|
27614
|
+
previousKey: modelPriceKeySchema.optional()
|
|
27615
|
+
});
|
|
27616
|
+
var modelPriceDefaultParamsSchema = external_exports.strictObject({
|
|
27617
|
+
model: modelPriceKeySchema
|
|
27618
|
+
});
|
|
27619
|
+
var modelPriceSuggestionSchema = external_exports.strictObject({
|
|
27620
|
+
/** Verified from catalog canonical links, not inferred from names or equal prices. */
|
|
27621
|
+
official: external_exports.boolean().optional(),
|
|
27622
|
+
canonicalModelId: external_exports.string().min(1).optional(),
|
|
27623
|
+
provider: external_exports.string().min(1).max(512),
|
|
27624
|
+
model: external_exports.string().min(1).max(512),
|
|
27625
|
+
price: modelPriceOverrideSchema
|
|
27626
|
+
});
|
|
27627
|
+
var modelPriceDefaultResultSchema = external_exports.strictObject({
|
|
27628
|
+
price: modelPriceOverrideSchema.nullable(),
|
|
27629
|
+
/** Local catalog suggestions only; never used automatically for pricing. */
|
|
27630
|
+
suggestions: external_exports.array(modelPriceSuggestionSchema).max(6).optional()
|
|
27631
|
+
});
|
|
27632
|
+
|
|
27633
|
+
// ../../shared-contracts/dist/usage-statistics.js
|
|
27634
|
+
var USAGE_STATISTICS_RANGES = ["today", "7d", "30d", "90d", "all"];
|
|
27635
|
+
var count = external_exports.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
27636
|
+
var localDate = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/u);
|
|
27637
|
+
var harness = external_exports.string().min(1).max(128);
|
|
27638
|
+
var model = external_exports.string().min(1).max(512);
|
|
27639
|
+
var project = external_exports.string().min(1).max(4096);
|
|
27640
|
+
var usageStatisticsParamsSchema = external_exports.strictObject({
|
|
27641
|
+
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
27642
|
+
harness: harness.optional(),
|
|
27643
|
+
model: model.nullable().optional(),
|
|
27644
|
+
project: project.nullable().optional(),
|
|
27645
|
+
/** One local date inside the range. */
|
|
27646
|
+
date: localDate.optional()
|
|
27647
|
+
});
|
|
27648
|
+
var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
27649
|
+
requests: count,
|
|
27650
|
+
inputTokens: count,
|
|
27651
|
+
cachedInputTokens: count,
|
|
27652
|
+
cacheWriteInputTokens: count,
|
|
27653
|
+
cacheKnownInputTokens: count,
|
|
27654
|
+
outputTokens: count,
|
|
27655
|
+
reasoningOutputTokens: count,
|
|
27656
|
+
/** USD at the public price, summed over the priced requests only. */
|
|
27657
|
+
costUsd: external_exports.number().finite().min(0),
|
|
27658
|
+
/** Requests without a price (or the cache data the price needs); not in `costUsd`. */
|
|
27659
|
+
unpricedRequests: count,
|
|
27660
|
+
/**
|
|
27661
|
+
* Requests whose storage gave no token counts: counted as requests, with neither tokens nor
|
|
27662
|
+
* cost, and not as unpriced.
|
|
27663
|
+
*/
|
|
27664
|
+
unmeteredRequests: count
|
|
27665
|
+
});
|
|
27666
|
+
var totals = usageStatisticsTotalsSchema.shape;
|
|
27667
|
+
var usageStatisticsSessionSchema = external_exports.strictObject({
|
|
27668
|
+
harness,
|
|
27669
|
+
sessionId: external_exports.string().min(1).max(512),
|
|
27670
|
+
project: project.nullable(),
|
|
27671
|
+
/** Persisted Desktop title for a mapped Session, otherwise its native name; may be absent. */
|
|
27672
|
+
title: external_exports.string().min(1).max(200).optional(),
|
|
27673
|
+
/** Models the session used, most requests first. */
|
|
27674
|
+
models: external_exports.array(model).max(16),
|
|
27675
|
+
firstAtMs: count,
|
|
27676
|
+
lastAtMs: count,
|
|
27677
|
+
...totals
|
|
27678
|
+
});
|
|
27679
|
+
var usageStatisticsResultSchema = external_exports.strictObject({
|
|
27680
|
+
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
27681
|
+
/** First local date of the range; null for all time. */
|
|
27682
|
+
from: localDate.nullable(),
|
|
27683
|
+
to: localDate,
|
|
27684
|
+
/** The filters these figures apply, echoed so a late answer to older filters is recognised. */
|
|
27685
|
+
filters: external_exports.strictObject({
|
|
27686
|
+
harness: harness.nullable(),
|
|
27687
|
+
model: model.nullable(),
|
|
27688
|
+
unknownModel: external_exports.boolean(),
|
|
27689
|
+
project: project.nullable(),
|
|
27690
|
+
unknownProject: external_exports.boolean(),
|
|
27691
|
+
date: localDate.nullable()
|
|
27692
|
+
}),
|
|
27693
|
+
/** Reading of native storage: incomplete while the first read, or a refresh, is under way. */
|
|
27694
|
+
reading: external_exports.strictObject({ complete: external_exports.boolean(), sources: count, read: count }),
|
|
27695
|
+
/** Harnesses whose storage could not be read; their part is missing, the rest is complete. */
|
|
27696
|
+
failures: external_exports.array(external_exports.strictObject({ harness, message: external_exports.string().max(2048) })).max(256),
|
|
27697
|
+
/** Every value seen in the range, ignoring the filters, to choose filters from. */
|
|
27698
|
+
options: external_exports.strictObject({
|
|
27699
|
+
harnesses: external_exports.array(harness).max(256),
|
|
27700
|
+
models: external_exports.array(model.nullable()).max(4096),
|
|
27701
|
+
projects: external_exports.array(project.nullable()).max(4096)
|
|
27702
|
+
}),
|
|
27703
|
+
/** Current display metadata, scoped by Harness. Never a pricing or filter identity.
|
|
27704
|
+
* Optional for older Hosts; missing/conflicting labels fall back to the native model ID.
|
|
27705
|
+
*/
|
|
27706
|
+
modelLabels: external_exports.array(external_exports.strictObject({ harness, model, label: model })).max(4096).optional(),
|
|
27707
|
+
/** Native credits, all filters applied, never combined across Harnesses or treated as USD.
|
|
27708
|
+
* Only groups with at least one reported value appear; reportedRequests exposes partial data.
|
|
27709
|
+
*/
|
|
27710
|
+
credits: external_exports.array(external_exports.strictObject({
|
|
27711
|
+
harness,
|
|
27712
|
+
model: model.nullable(),
|
|
27713
|
+
credits: external_exports.number().finite().min(0),
|
|
27714
|
+
reportedRequests: count,
|
|
27715
|
+
requests: count
|
|
27716
|
+
})).max(4096).optional(),
|
|
27717
|
+
/** All filters applied. */
|
|
27718
|
+
totals: usageStatisticsTotalsSchema,
|
|
27719
|
+
/** Each date and Harness of the range: every filter except the day. */
|
|
27720
|
+
daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
|
|
27721
|
+
/** Local weekday (0 = Sunday) and hour, all filters applied. */
|
|
27722
|
+
hourly: external_exports.array(external_exports.strictObject({
|
|
27723
|
+
weekday: external_exports.number().int().min(0).max(6),
|
|
27724
|
+
hour: external_exports.number().int().min(0).max(23),
|
|
27725
|
+
...totals
|
|
27726
|
+
})).max(168),
|
|
27727
|
+
byHarness: external_exports.array(external_exports.strictObject({ harness, ...totals })).max(256),
|
|
27728
|
+
byModel: external_exports.array(external_exports.strictObject({
|
|
27729
|
+
model: model.nullable(),
|
|
27730
|
+
...totals,
|
|
27731
|
+
/** Requests priced by what the Harness recorded they cost, not by a price list. */
|
|
27732
|
+
harnessPricedRequests: count
|
|
27733
|
+
})).max(4096),
|
|
27734
|
+
byProject: external_exports.array(external_exports.strictObject({ project: project.nullable(), ...totals })).max(4096),
|
|
27735
|
+
/**
|
|
27736
|
+
* The sessions that spent the most, by cost and by tokens without cache, all filters applied;
|
|
27737
|
+
* requests without a native session are not listed here but count everywhere else.
|
|
27738
|
+
*/
|
|
27739
|
+
sessions: external_exports.array(usageStatisticsSessionSchema).max(100),
|
|
27740
|
+
/**
|
|
27741
|
+
* The sessions last active in the range, newest first, all filters applied. Optional for older
|
|
27742
|
+
* Hosts; missing is treated as no list rather than no sessions.
|
|
27743
|
+
*/
|
|
27744
|
+
recentSessions: external_exports.array(usageStatisticsSessionSchema).max(100).optional()
|
|
27745
|
+
});
|
|
27746
|
+
|
|
27584
27747
|
// ../../shared-contracts/dist/ids.js
|
|
27585
27748
|
var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
27586
27749
|
message: "Identifier must not be empty or whitespace"
|
|
@@ -27628,6 +27791,10 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
27628
27791
|
"codexhost/account/list",
|
|
27629
27792
|
"codexhost/account/refresh",
|
|
27630
27793
|
"codexhost/account/usage/inspect",
|
|
27794
|
+
"codexhost/usage/model-prices/get",
|
|
27795
|
+
"codexhost/usage/model-prices/set",
|
|
27796
|
+
"codexhost/usage/model-prices/default",
|
|
27797
|
+
"codexhost/usage/statistics/get",
|
|
27631
27798
|
"codexhost/update/check",
|
|
27632
27799
|
"codexhost/update/start",
|
|
27633
27800
|
"codexhost/update/status"
|
|
@@ -27692,6 +27859,7 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
27692
27859
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
27693
27860
|
outputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
27694
27861
|
outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
27862
|
+
apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
27695
27863
|
reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
27696
27864
|
totalTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
27697
27865
|
totalCostUsd: finiteNonNegativeNumberSchema.optional(),
|
|
@@ -27703,7 +27871,11 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
27703
27871
|
planFiveHourUsedPercent: cacheHitRatePercentSchema.optional(),
|
|
27704
27872
|
planFiveHourResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
|
|
27705
27873
|
planSevenDayUsedPercent: cacheHitRatePercentSchema.optional(),
|
|
27706
|
-
planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional()
|
|
27874
|
+
planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
|
|
27875
|
+
sessionCacheHitRatePercent: cacheHitRatePercentSchema.optional(),
|
|
27876
|
+
timeToFirstOutputMs: nonNegativeSafeIntegerSchema.optional(),
|
|
27877
|
+
costSource: external_exports.enum(["publicPrice", "native"]).optional(),
|
|
27878
|
+
unpricedModels: external_exports.array(external_exports.string().min(1)).min(1).optional()
|
|
27707
27879
|
}).strict().superRefine((usage, context) => {
|
|
27708
27880
|
if (Object.keys(usage).length === 0) {
|
|
27709
27881
|
context.addIssue({ code: "custom", message: "Thread Usage must contain a reliable field" });
|
|
@@ -27724,6 +27896,20 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
27724
27896
|
path: ["contextWindowTokens"]
|
|
27725
27897
|
});
|
|
27726
27898
|
}
|
|
27899
|
+
if (usage.costSource !== void 0 && usage.totalCostUsd === void 0) {
|
|
27900
|
+
context.addIssue({
|
|
27901
|
+
code: "custom",
|
|
27902
|
+
message: "Thread Usage costSource must be provided with totalCostUsd",
|
|
27903
|
+
path: ["costSource"]
|
|
27904
|
+
});
|
|
27905
|
+
}
|
|
27906
|
+
if (usage.unpricedModels !== void 0 && usage.costSource !== "publicPrice") {
|
|
27907
|
+
context.addIssue({
|
|
27908
|
+
code: "custom",
|
|
27909
|
+
message: "Thread Usage unpricedModels must be provided with a publicPrice cost",
|
|
27910
|
+
path: ["unpricedModels"]
|
|
27911
|
+
});
|
|
27912
|
+
}
|
|
27727
27913
|
if (usage.planFiveHourResetsAtUnix !== void 0 && usage.planFiveHourUsedPercent === void 0) {
|
|
27728
27914
|
context.addIssue({
|
|
27729
27915
|
code: "custom",
|
|
@@ -27978,27 +28164,27 @@ var harnessModelCatalogSchema = external_exports.object({
|
|
|
27978
28164
|
}).strict().superRefine((catalog, context) => {
|
|
27979
28165
|
const refs = /* @__PURE__ */ new Set();
|
|
27980
28166
|
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id }) => id));
|
|
27981
|
-
for (const [index,
|
|
27982
|
-
if (refs.has(
|
|
28167
|
+
for (const [index, model2] of catalog.models.entries()) {
|
|
28168
|
+
if (refs.has(model2.ref.id)) {
|
|
27983
28169
|
context.addIssue({
|
|
27984
28170
|
code: "custom",
|
|
27985
28171
|
message: "Model Catalog refs must be unique",
|
|
27986
28172
|
path: ["models", index, "ref", "id"]
|
|
27987
28173
|
});
|
|
27988
28174
|
}
|
|
27989
|
-
refs.add(
|
|
27990
|
-
if (
|
|
27991
|
-
if (refs.has(
|
|
28175
|
+
refs.add(model2.ref.id);
|
|
28176
|
+
if (model2.fastModel) {
|
|
28177
|
+
if (refs.has(model2.fastModel.id) || catalog.models.some((entry) => entry.ref.id === model2.fastModel?.id)) {
|
|
27992
28178
|
context.addIssue({
|
|
27993
28179
|
code: "custom",
|
|
27994
28180
|
message: "Fast Model refs must be distinct and unique",
|
|
27995
28181
|
path: ["models", index, "fastModel"]
|
|
27996
28182
|
});
|
|
27997
28183
|
}
|
|
27998
|
-
refs.add(
|
|
28184
|
+
refs.add(model2.fastModel.id);
|
|
27999
28185
|
}
|
|
28000
28186
|
const supportedThinkingIds = /* @__PURE__ */ new Set();
|
|
28001
|
-
for (const [optionIndex, optionId] of (
|
|
28187
|
+
for (const [optionIndex, optionId] of (model2.supportedThinkingOptionIds ?? []).entries()) {
|
|
28002
28188
|
if (supportedThinkingIds.has(optionId)) {
|
|
28003
28189
|
context.addIssue({
|
|
28004
28190
|
code: "custom",
|
|
@@ -28192,13 +28378,40 @@ var HARNESS_PLUGIN_LIMIT = 128;
|
|
|
28192
28378
|
var harnessPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u).refine((id) => id !== "codex", "The official Codex identity is reserved").pipe(harnessIdSchema);
|
|
28193
28379
|
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");
|
|
28194
28380
|
var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
|
|
28381
|
+
var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
|
|
28382
|
+
var harnessInstallationGuideSchema = external_exports.object({
|
|
28383
|
+
commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
|
|
28384
|
+
before: localizedTextSchema.optional(),
|
|
28385
|
+
after: localizedTextSchema.optional(),
|
|
28386
|
+
downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
|
|
28387
|
+
}).strict();
|
|
28195
28388
|
var pluginPresentationShape = {
|
|
28196
28389
|
id: harnessPluginIdSchema,
|
|
28197
28390
|
name: external_exports.string().trim().min(1).max(128),
|
|
28198
28391
|
version: external_exports.string().min(1).max(128),
|
|
28392
|
+
/** Capability-only plugin; omitted for existing session-capable plugins. */
|
|
28393
|
+
kind: external_exports.literal("usage").optional(),
|
|
28394
|
+
/** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
|
|
28395
|
+
iconStyle: external_exports.object({
|
|
28396
|
+
vector: external_exports.object({
|
|
28397
|
+
viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
|
|
28398
|
+
color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
|
|
28399
|
+
paths: external_exports.array(external_exports.object({
|
|
28400
|
+
d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
|
|
28401
|
+
fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
|
|
28402
|
+
fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
|
|
28403
|
+
}).strict()).min(1).max(32)
|
|
28404
|
+
}).strict().optional(),
|
|
28405
|
+
background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
|
|
28406
|
+
borderRadius: external_exports.number().min(0).max(50).optional(),
|
|
28407
|
+
paddingRatio: external_exports.number().min(0).max(0.25).optional()
|
|
28408
|
+
}).strict().optional(),
|
|
28409
|
+
installation: harnessInstallationGuideSchema.optional(),
|
|
28410
|
+
notice: localizedTextSchema.optional(),
|
|
28199
28411
|
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
28200
28412
|
launchCommand: external_exports.literal(true).optional(),
|
|
28201
28413
|
links: external_exports.object({
|
|
28414
|
+
website: documentationUrlSchema.optional(),
|
|
28202
28415
|
documentation: documentationUrlSchema.optional(),
|
|
28203
28416
|
installation: documentationUrlSchema.optional()
|
|
28204
28417
|
}).strict().optional()
|
|
@@ -28617,6 +28830,11 @@ var codexSshDraftSchema = external_exports.strictObject({
|
|
|
28617
28830
|
});
|
|
28618
28831
|
var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
28619
28832
|
external_exports.strictObject({ action: external_exports.literal("list") }),
|
|
28833
|
+
external_exports.strictObject({
|
|
28834
|
+
action: external_exports.literal("read-thread"),
|
|
28835
|
+
hostId: hostId.refine((id) => id !== "local"),
|
|
28836
|
+
input: delegationReadParamsSchema
|
|
28837
|
+
}),
|
|
28620
28838
|
external_exports.strictObject({
|
|
28621
28839
|
action: external_exports.literal("save"),
|
|
28622
28840
|
draft: codexSshDraftSchema,
|
|
@@ -29023,10 +29241,12 @@ var tokenFields = [
|
|
|
29023
29241
|
];
|
|
29024
29242
|
var safeIntegerFields = [
|
|
29025
29243
|
"planFiveHourResetsAtUnix",
|
|
29026
|
-
"planSevenDayResetsAtUnix"
|
|
29244
|
+
"planSevenDayResetsAtUnix",
|
|
29245
|
+
"timeToFirstOutputMs"
|
|
29027
29246
|
];
|
|
29028
29247
|
var percentFields = [
|
|
29029
29248
|
"cacheHitRatePercent",
|
|
29249
|
+
"sessionCacheHitRatePercent",
|
|
29030
29250
|
"planFiveHourUsedPercent",
|
|
29031
29251
|
"planSevenDayUsedPercent"
|
|
29032
29252
|
];
|
|
@@ -29034,10 +29254,14 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
29034
29254
|
...tokenFields,
|
|
29035
29255
|
...safeIntegerFields,
|
|
29036
29256
|
...percentFields,
|
|
29257
|
+
"sessionCacheUsage",
|
|
29037
29258
|
"totalCostUsd",
|
|
29038
29259
|
"totalCredits",
|
|
29039
29260
|
"contextUsagePercent",
|
|
29040
|
-
"outputTokensPerSecond"
|
|
29261
|
+
"outputTokensPerSecond",
|
|
29262
|
+
"apiOutputTokensPerSecond",
|
|
29263
|
+
"costSource",
|
|
29264
|
+
"unpricedModels"
|
|
29041
29265
|
]);
|
|
29042
29266
|
function isRecord(value) {
|
|
29043
29267
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -29053,7 +29277,11 @@ function parseHostUsage(value) {
|
|
|
29053
29277
|
throw new Error(`Harness Usage contains unknown field '${key}'`);
|
|
29054
29278
|
}
|
|
29055
29279
|
}
|
|
29056
|
-
for (const field of [
|
|
29280
|
+
for (const field of [
|
|
29281
|
+
"totalCredits",
|
|
29282
|
+
"contextUsagePercent",
|
|
29283
|
+
"apiOutputTokensPerSecond"
|
|
29284
|
+
]) {
|
|
29057
29285
|
const candidate = value[field];
|
|
29058
29286
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
29059
29287
|
throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
|
|
@@ -29083,6 +29311,12 @@ function parseHostUsage(value) {
|
|
|
29083
29311
|
throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
|
|
29084
29312
|
}
|
|
29085
29313
|
}
|
|
29314
|
+
if (value.sessionCacheUsage !== void 0) {
|
|
29315
|
+
const totals2 = value.sessionCacheUsage;
|
|
29316
|
+
if (!isRecord(totals2) || Object.keys(totals2).some((key) => key !== "inputTokens" && key !== "cachedInputTokens") || typeof totals2.inputTokens !== "number" || !Number.isSafeInteger(totals2.inputTokens) || totals2.inputTokens < 0 || typeof totals2.cachedInputTokens !== "number" || !Number.isSafeInteger(totals2.cachedInputTokens) || totals2.cachedInputTokens < 0 || totals2.cachedInputTokens > totals2.inputTokens) {
|
|
29317
|
+
throw new Error("Harness Usage 'sessionCacheUsage' must contain complete bounded token totals");
|
|
29318
|
+
}
|
|
29319
|
+
}
|
|
29086
29320
|
const hasContextUsed = value.contextUsedTokens !== void 0;
|
|
29087
29321
|
const hasContextWindow = value.contextWindowTokens !== void 0;
|
|
29088
29322
|
if (hasContextUsed !== hasContextWindow) {
|
|
@@ -29097,8 +29331,43 @@ function parseHostUsage(value) {
|
|
|
29097
29331
|
if (value.planSevenDayResetsAtUnix !== void 0 && value.planSevenDayUsedPercent === void 0) {
|
|
29098
29332
|
throw new Error("Harness Usage 'planSevenDayResetsAtUnix' must be provided with 'planSevenDayUsedPercent'");
|
|
29099
29333
|
}
|
|
29334
|
+
if (value.costSource !== void 0) {
|
|
29335
|
+
if (value.costSource !== "publicPrice" && value.costSource !== "native") {
|
|
29336
|
+
throw new Error("Harness Usage 'costSource' must be 'publicPrice' or 'native'");
|
|
29337
|
+
}
|
|
29338
|
+
if (value.totalCostUsd === void 0) {
|
|
29339
|
+
throw new Error("Harness Usage 'costSource' must be provided with 'totalCostUsd'");
|
|
29340
|
+
}
|
|
29341
|
+
}
|
|
29342
|
+
if (value.unpricedModels !== void 0) {
|
|
29343
|
+
const models = value.unpricedModels;
|
|
29344
|
+
if (!Array.isArray(models) || models.length === 0 || !models.every((model2) => typeof model2 === "string" && model2.length > 0)) {
|
|
29345
|
+
throw new Error("Harness Usage 'unpricedModels' must be a non-empty list of Model IDs");
|
|
29346
|
+
}
|
|
29347
|
+
if (value.costSource !== "publicPrice") {
|
|
29348
|
+
throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
|
|
29349
|
+
}
|
|
29350
|
+
return { ...value, unpricedModels: [...models] };
|
|
29351
|
+
}
|
|
29100
29352
|
return { ...value };
|
|
29101
29353
|
}
|
|
29354
|
+
var requestTokenFields = [
|
|
29355
|
+
"inputTokens",
|
|
29356
|
+
"cachedInputTokens",
|
|
29357
|
+
"cacheWriteInputTokens",
|
|
29358
|
+
"cacheWrite1hInputTokens",
|
|
29359
|
+
"outputTokens",
|
|
29360
|
+
"reasoningOutputTokens",
|
|
29361
|
+
"startedAtMs",
|
|
29362
|
+
"completedAtMs"
|
|
29363
|
+
];
|
|
29364
|
+
var requestFields = /* @__PURE__ */ new Set([
|
|
29365
|
+
...requestTokenFields,
|
|
29366
|
+
"requestId",
|
|
29367
|
+
"historical",
|
|
29368
|
+
"model",
|
|
29369
|
+
"provider"
|
|
29370
|
+
]);
|
|
29102
29371
|
|
|
29103
29372
|
// ../../harness-adapter/dist/live-command-catalog.js
|
|
29104
29373
|
var COMMON_EXCLUDED_LIVE_COMMANDS = /* @__PURE__ */ new Set([
|
|
@@ -29753,10 +30022,10 @@ function parseQoderModelCatalog(rawModels) {
|
|
|
29753
30022
|
...defaultThinkingOptionId ? { defaultThinkingOptionId } : {}
|
|
29754
30023
|
});
|
|
29755
30024
|
}
|
|
29756
|
-
function qoderAvailableThinkingOptions(catalog,
|
|
29757
|
-
if (!catalog || !
|
|
30025
|
+
function qoderAvailableThinkingOptions(catalog, model2) {
|
|
30026
|
+
if (!catalog || !model2)
|
|
29758
30027
|
return void 0;
|
|
29759
|
-
const supported = catalog.models.find(({ ref }) => ref.id ===
|
|
30028
|
+
const supported = catalog.models.find(({ ref }) => ref.id === model2.id)?.supportedThinkingOptionIds;
|
|
29760
30029
|
if (!supported || supported.length === 0)
|
|
29761
30030
|
return void 0;
|
|
29762
30031
|
const options = supported.flatMap((id) => {
|
|
@@ -30268,8 +30537,8 @@ function getErrorMap2() {
|
|
|
30268
30537
|
|
|
30269
30538
|
// ../../../node_modules/zod/v3/helpers/parseUtil.js
|
|
30270
30539
|
var makeIssue = (params) => {
|
|
30271
|
-
const { data, path:
|
|
30272
|
-
const fullPath = [...
|
|
30540
|
+
const { data, path: path10, errorMaps, issueData } = params;
|
|
30541
|
+
const fullPath = [...path10, ...issueData.path || []];
|
|
30273
30542
|
const fullIssue = {
|
|
30274
30543
|
...issueData,
|
|
30275
30544
|
path: fullPath
|
|
@@ -30384,11 +30653,11 @@ var errorUtil;
|
|
|
30384
30653
|
|
|
30385
30654
|
// ../../../node_modules/zod/v3/types.js
|
|
30386
30655
|
var ParseInputLazyPath = class {
|
|
30387
|
-
constructor(parent, value,
|
|
30656
|
+
constructor(parent, value, path10, key) {
|
|
30388
30657
|
this._cachedPath = [];
|
|
30389
30658
|
this.parent = parent;
|
|
30390
30659
|
this.data = value;
|
|
30391
|
-
this._path =
|
|
30660
|
+
this._path = path10;
|
|
30392
30661
|
this._key = key;
|
|
30393
30662
|
}
|
|
30394
30663
|
get path() {
|
|
@@ -33915,11 +34184,11 @@ function normalizeObjectSchema(schema) {
|
|
|
33915
34184
|
}
|
|
33916
34185
|
return void 0;
|
|
33917
34186
|
}
|
|
33918
|
-
function getDotPath(
|
|
33919
|
-
if (
|
|
34187
|
+
function getDotPath(path10) {
|
|
34188
|
+
if (path10.length === 0) {
|
|
33920
34189
|
return "object root";
|
|
33921
34190
|
}
|
|
33922
|
-
return
|
|
34191
|
+
return path10.reduce((acc, seg, index) => {
|
|
33923
34192
|
if (index === 0) {
|
|
33924
34193
|
return String(seg);
|
|
33925
34194
|
}
|
|
@@ -52648,6 +52917,289 @@ var QoderSessionImport = class {
|
|
|
52648
52917
|
}
|
|
52649
52918
|
};
|
|
52650
52919
|
|
|
52920
|
+
// dist/qoder-usage-statistics.js
|
|
52921
|
+
import os4 from "node:os";
|
|
52922
|
+
import path8 from "node:path";
|
|
52923
|
+
|
|
52924
|
+
// ../../harness-adapter/dist/usage-statistics.js
|
|
52925
|
+
import { createReadStream } from "node:fs";
|
|
52926
|
+
import { lstat, opendir } from "node:fs/promises";
|
|
52927
|
+
import path6 from "node:path";
|
|
52928
|
+
import { createInterface } from "node:readline";
|
|
52929
|
+
var MAX_SESSION_ID_LENGTH = 512;
|
|
52930
|
+
var MAX_CWD_LENGTH = 4096;
|
|
52931
|
+
var MAX_SESSION_TITLE_LENGTH = 200;
|
|
52932
|
+
function usageSessionTitle(value) {
|
|
52933
|
+
if (typeof value !== "string")
|
|
52934
|
+
return void 0;
|
|
52935
|
+
const normalized = value.replaceAll("\0", "").replaceAll(/\s+/gu, " ").trim();
|
|
52936
|
+
if (!normalized)
|
|
52937
|
+
return void 0;
|
|
52938
|
+
if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
|
|
52939
|
+
return normalized;
|
|
52940
|
+
const characters = [...normalized];
|
|
52941
|
+
if (characters.length <= MAX_SESSION_TITLE_LENGTH)
|
|
52942
|
+
return normalized;
|
|
52943
|
+
return `${characters.slice(0, MAX_SESSION_TITLE_LENGTH - 1).join("").trimEnd()}…`;
|
|
52944
|
+
}
|
|
52945
|
+
function sessionIdOk(value) {
|
|
52946
|
+
return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
|
|
52947
|
+
}
|
|
52948
|
+
function cwdOk(value) {
|
|
52949
|
+
return typeof value === "string" && value.length > 0 && value.length <= MAX_CWD_LENGTH && !value.includes("\0") && (value.startsWith("/") || /^[A-Za-z]:[\\/]/u.test(value) || value.startsWith("\\\\"));
|
|
52950
|
+
}
|
|
52951
|
+
function withUsageSession(entry, session) {
|
|
52952
|
+
const sessionId = sessionIdOk(session.sessionId) ? session.sessionId : void 0;
|
|
52953
|
+
const cwd = cwdOk(session.cwd) ? session.cwd : void 0;
|
|
52954
|
+
const sessionTitle = sessionId !== void 0 ? usageSessionTitle(session.title) : void 0;
|
|
52955
|
+
if (sessionId === void 0 && cwd === void 0)
|
|
52956
|
+
return entry;
|
|
52957
|
+
return {
|
|
52958
|
+
...entry,
|
|
52959
|
+
...sessionId !== void 0 ? { sessionId } : {},
|
|
52960
|
+
...cwd !== void 0 ? { cwd } : {},
|
|
52961
|
+
...sessionTitle !== void 0 ? { sessionTitle } : {}
|
|
52962
|
+
};
|
|
52963
|
+
}
|
|
52964
|
+
function tokenCount(value) {
|
|
52965
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
52966
|
+
}
|
|
52967
|
+
function parseHarnessUsageEntry(value) {
|
|
52968
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
52969
|
+
return null;
|
|
52970
|
+
const entry = value;
|
|
52971
|
+
if (typeof entry.id !== "string" || entry.id.length === 0 || entry.id.length > 512)
|
|
52972
|
+
return null;
|
|
52973
|
+
if (!tokenCount(entry.occurredAtMs) || entry.occurredAtMs === 0)
|
|
52974
|
+
return null;
|
|
52975
|
+
if (entry.model !== void 0 && (typeof entry.model !== "string" || entry.model.length === 0)) {
|
|
52976
|
+
return null;
|
|
52977
|
+
}
|
|
52978
|
+
if (!tokenCount(entry.inputTokens) || !tokenCount(entry.outputTokens))
|
|
52979
|
+
return null;
|
|
52980
|
+
for (const field of [
|
|
52981
|
+
"cachedInputTokens",
|
|
52982
|
+
"cacheWriteInputTokens",
|
|
52983
|
+
"cacheWrite1hInputTokens",
|
|
52984
|
+
"reasoningOutputTokens"
|
|
52985
|
+
]) {
|
|
52986
|
+
if (entry[field] !== void 0 && !tokenCount(entry[field]))
|
|
52987
|
+
return null;
|
|
52988
|
+
}
|
|
52989
|
+
const cached2 = entry.cachedInputTokens ?? 0;
|
|
52990
|
+
const written = entry.cacheWriteInputTokens ?? 0;
|
|
52991
|
+
if (cached2 + written > entry.inputTokens)
|
|
52992
|
+
return null;
|
|
52993
|
+
if ((entry.cacheWrite1hInputTokens ?? 0) > written)
|
|
52994
|
+
return null;
|
|
52995
|
+
if ((entry.reasoningOutputTokens ?? 0) > entry.outputTokens)
|
|
52996
|
+
return null;
|
|
52997
|
+
if (entry.sessionId !== void 0 && !sessionIdOk(entry.sessionId))
|
|
52998
|
+
return null;
|
|
52999
|
+
if (entry.cwd !== void 0 && !cwdOk(entry.cwd))
|
|
53000
|
+
return null;
|
|
53001
|
+
if (entry.sessionTitle !== void 0) {
|
|
53002
|
+
const sessionTitle = usageSessionTitle(entry.sessionTitle);
|
|
53003
|
+
if (sessionTitle === void 0)
|
|
53004
|
+
return null;
|
|
53005
|
+
entry.sessionTitle = sessionTitle;
|
|
53006
|
+
}
|
|
53007
|
+
if (entry.tokensUnknown !== void 0 && entry.tokensUnknown !== true)
|
|
53008
|
+
return null;
|
|
53009
|
+
if (entry.costUsd !== void 0 && (typeof entry.costUsd !== "number" || !Number.isFinite(entry.costUsd) || entry.costUsd < 0)) {
|
|
53010
|
+
return null;
|
|
53011
|
+
}
|
|
53012
|
+
if (entry.credits !== void 0 && (typeof entry.credits !== "number" || !Number.isFinite(entry.credits) || entry.credits < 0)) {
|
|
53013
|
+
return null;
|
|
53014
|
+
}
|
|
53015
|
+
return entry;
|
|
53016
|
+
}
|
|
53017
|
+
async function jsonlUsageSources(root, maxDepth, signal) {
|
|
53018
|
+
const sources = [];
|
|
53019
|
+
const visit = async (directory, depth) => {
|
|
53020
|
+
signal.throwIfAborted();
|
|
53021
|
+
const entries = await opendir(directory).catch((error51) => {
|
|
53022
|
+
if (error51.code === "ENOENT")
|
|
53023
|
+
return null;
|
|
53024
|
+
throw error51;
|
|
53025
|
+
});
|
|
53026
|
+
if (!entries)
|
|
53027
|
+
return;
|
|
53028
|
+
for await (const entry of entries) {
|
|
53029
|
+
signal.throwIfAborted();
|
|
53030
|
+
const file2 = path6.join(directory, entry.name);
|
|
53031
|
+
if (entry.isDirectory()) {
|
|
53032
|
+
if (depth < maxDepth)
|
|
53033
|
+
await visit(file2, depth + 1);
|
|
53034
|
+
} else if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
|
53035
|
+
const info = await lstat(file2).catch(() => null);
|
|
53036
|
+
if (info?.isFile() && info.size > 0) {
|
|
53037
|
+
sources.push({ id: file2, fingerprint: `${info.ino}:${info.size}:${info.mtimeMs}` });
|
|
53038
|
+
}
|
|
53039
|
+
}
|
|
53040
|
+
}
|
|
53041
|
+
};
|
|
53042
|
+
await visit(root, 0);
|
|
53043
|
+
return sources;
|
|
53044
|
+
}
|
|
53045
|
+
async function* jsonlRecords(file2, marker, signal) {
|
|
53046
|
+
const lines = createInterface({
|
|
53047
|
+
input: createReadStream(file2, { encoding: "utf8", signal }),
|
|
53048
|
+
crlfDelay: Infinity
|
|
53049
|
+
});
|
|
53050
|
+
for await (const line of lines) {
|
|
53051
|
+
if (!line.includes(marker))
|
|
53052
|
+
continue;
|
|
53053
|
+
let value;
|
|
53054
|
+
try {
|
|
53055
|
+
value = JSON.parse(line);
|
|
53056
|
+
} catch {
|
|
53057
|
+
continue;
|
|
53058
|
+
}
|
|
53059
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
53060
|
+
yield value;
|
|
53061
|
+
}
|
|
53062
|
+
}
|
|
53063
|
+
}
|
|
53064
|
+
function nativeTimeMs(value) {
|
|
53065
|
+
const time3 = typeof value === "number" ? value : typeof value === "string" ? Date.parse(value) : Number.NaN;
|
|
53066
|
+
return Number.isFinite(time3) && time3 > 0 ? Math.floor(time3) : null;
|
|
53067
|
+
}
|
|
53068
|
+
|
|
53069
|
+
// dist/qoder-model-labels.js
|
|
53070
|
+
import { readFile, stat as stat2 } from "node:fs/promises";
|
|
53071
|
+
import path7 from "node:path";
|
|
53072
|
+
function record3(value) {
|
|
53073
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
53074
|
+
}
|
|
53075
|
+
async function readQoderModelLabels(configDirectory, signal) {
|
|
53076
|
+
signal.throwIfAborted();
|
|
53077
|
+
try {
|
|
53078
|
+
const file2 = path7.join(configDirectory, ".auth", "dynamic-texts.json");
|
|
53079
|
+
if ((await stat2(file2)).size > 1024 * 1024)
|
|
53080
|
+
return {};
|
|
53081
|
+
const data = JSON.parse(await readFile(file2, { encoding: "utf8", signal }));
|
|
53082
|
+
if (!record3(data) || !record3(data.locales))
|
|
53083
|
+
return {};
|
|
53084
|
+
const labels = /* @__PURE__ */ new Map();
|
|
53085
|
+
for (const locale of ["zh-CN", "en"]) {
|
|
53086
|
+
const texts = data.locales[locale];
|
|
53087
|
+
if (!record3(texts))
|
|
53088
|
+
continue;
|
|
53089
|
+
for (const [key, value] of Object.entries(texts)) {
|
|
53090
|
+
const prefix = "modelSelector.item.";
|
|
53091
|
+
if (!key.startsWith(prefix))
|
|
53092
|
+
continue;
|
|
53093
|
+
const id = key.slice(prefix.length);
|
|
53094
|
+
if (!id || id.length > 512 || /\.(description|markdownDescription)(\.|$)/u.test(id))
|
|
53095
|
+
continue;
|
|
53096
|
+
if (typeof value !== "string" || !value.trim() || value.trim().length > 512)
|
|
53097
|
+
continue;
|
|
53098
|
+
labels.set(id, value.trim());
|
|
53099
|
+
}
|
|
53100
|
+
}
|
|
53101
|
+
return Object.fromEntries(labels);
|
|
53102
|
+
} catch {
|
|
53103
|
+
signal.throwIfAborted();
|
|
53104
|
+
return {};
|
|
53105
|
+
}
|
|
53106
|
+
}
|
|
53107
|
+
|
|
53108
|
+
// dist/qoder-usage-statistics.js
|
|
53109
|
+
function qoderProjectsDirectory(environment, variant) {
|
|
53110
|
+
const cn3 = variant === "cn";
|
|
53111
|
+
const config2 = environment[cn3 ? "QODERCN_CONFIG_DIR" : "QODER_CONFIG_DIR"];
|
|
53112
|
+
const home = environment[cn3 ? "QODERCN_CLI_HOME" : "QODER_CLI_HOME"] || environment.HOME || environment.USERPROFILE || os4.homedir();
|
|
53113
|
+
return path8.resolve(config2 || path8.join(home, cn3 ? ".qoder-cn" : ".qoder"), "projects");
|
|
53114
|
+
}
|
|
53115
|
+
function isRecord2(value) {
|
|
53116
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
53117
|
+
}
|
|
53118
|
+
function qoderUserText(message) {
|
|
53119
|
+
if (!isRecord2(message))
|
|
53120
|
+
return void 0;
|
|
53121
|
+
const { content } = message;
|
|
53122
|
+
if (typeof content === "string")
|
|
53123
|
+
return content;
|
|
53124
|
+
if (!Array.isArray(content))
|
|
53125
|
+
return void 0;
|
|
53126
|
+
return content.filter((block) => isRecord2(block) && block.type === "text" && typeof block.text === "string").map((block) => String(block.text)).join(" ");
|
|
53127
|
+
}
|
|
53128
|
+
function count2(value) {
|
|
53129
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
53130
|
+
}
|
|
53131
|
+
async function readQoderUsage(file2, signal) {
|
|
53132
|
+
const messages = /* @__PURE__ */ new Map();
|
|
53133
|
+
let sessionId;
|
|
53134
|
+
let cwd;
|
|
53135
|
+
let customTitle;
|
|
53136
|
+
let summary;
|
|
53137
|
+
let firstPrompt;
|
|
53138
|
+
for await (const line of jsonlRecords(file2, '"type"', signal)) {
|
|
53139
|
+
signal.throwIfAborted();
|
|
53140
|
+
if (line.type === "custom-title")
|
|
53141
|
+
customTitle = usageSessionTitle(line.customTitle);
|
|
53142
|
+
else if (!summary && line.type === "summary")
|
|
53143
|
+
summary = usageSessionTitle(line.summary);
|
|
53144
|
+
else if (!firstPrompt && line.type === "user") {
|
|
53145
|
+
firstPrompt = usageSessionTitle(qoderUserText(line.message));
|
|
53146
|
+
}
|
|
53147
|
+
if (line.type !== "assistant" || !isRecord2(line.message))
|
|
53148
|
+
continue;
|
|
53149
|
+
sessionId ??= line.sessionId;
|
|
53150
|
+
cwd ??= line.cwd;
|
|
53151
|
+
if (isRecord2(line.forkedFrom) || line.isApiErrorMessage === true)
|
|
53152
|
+
continue;
|
|
53153
|
+
const { id, model: model2, usage } = line.message;
|
|
53154
|
+
if (typeof id !== "string" || !id || model2 === "<synthetic>")
|
|
53155
|
+
continue;
|
|
53156
|
+
const message = messages.get(id) ?? { at: null };
|
|
53157
|
+
message.at ??= nativeTimeMs(line.timestamp);
|
|
53158
|
+
messages.set(id, message);
|
|
53159
|
+
if (!isRecord2(usage) || message.at === null)
|
|
53160
|
+
continue;
|
|
53161
|
+
const input = usage.input_tokens;
|
|
53162
|
+
const output = usage.output_tokens;
|
|
53163
|
+
const cached2 = usage.cache_read_input_tokens;
|
|
53164
|
+
const written = usage.cache_creation_input_tokens;
|
|
53165
|
+
if (!count2(input) || !count2(output) || !count2(cached2) || !count2(written))
|
|
53166
|
+
continue;
|
|
53167
|
+
const split = isRecord2(usage.cache_creation) ? usage.cache_creation : null;
|
|
53168
|
+
const oneHour = split?.ephemeral_1h_input_tokens;
|
|
53169
|
+
const details = isRecord2(usage.output_tokens_details) ? usage.output_tokens_details : null;
|
|
53170
|
+
const thinking = details?.thinking_tokens;
|
|
53171
|
+
const unreported = input === 0 && output === 0 && cached2 === 0 && written === 0;
|
|
53172
|
+
const entry = parseHarnessUsageEntry({
|
|
53173
|
+
id,
|
|
53174
|
+
occurredAtMs: message.at,
|
|
53175
|
+
...typeof model2 === "string" && model2 ? { model: model2 } : {},
|
|
53176
|
+
inputTokens: input + cached2 + written,
|
|
53177
|
+
cachedInputTokens: cached2,
|
|
53178
|
+
cacheWriteInputTokens: written,
|
|
53179
|
+
...count2(oneHour) ? { cacheWrite1hInputTokens: oneHour } : {},
|
|
53180
|
+
outputTokens: output,
|
|
53181
|
+
...typeof usage.credits === "number" && Number.isFinite(usage.credits) && usage.credits >= 0 ? { credits: usage.credits } : {},
|
|
53182
|
+
...count2(thinking) ? { reasoningOutputTokens: thinking } : {},
|
|
53183
|
+
...unreported ? { tokensUnknown: true } : {}
|
|
53184
|
+
});
|
|
53185
|
+
if (entry)
|
|
53186
|
+
message.entry = entry;
|
|
53187
|
+
}
|
|
53188
|
+
const session = {
|
|
53189
|
+
sessionId: typeof sessionId === "string" ? sessionId : void 0,
|
|
53190
|
+
cwd: typeof cwd === "string" ? cwd : void 0,
|
|
53191
|
+
title: customTitle ?? summary ?? firstPrompt
|
|
53192
|
+
};
|
|
53193
|
+
return [...messages.values()].flatMap(({ entry }) => entry ? [withUsageSession(entry, session)] : []);
|
|
53194
|
+
}
|
|
53195
|
+
function createQoderUsageStatistics(environment, variant) {
|
|
53196
|
+
return Object.freeze({
|
|
53197
|
+
readModelLabels: (signal) => readQoderModelLabels(path8.dirname(qoderProjectsDirectory(environment, variant)), signal),
|
|
53198
|
+
listSources: (signal) => jsonlUsageSources(qoderProjectsDirectory(environment, variant), 4, signal),
|
|
53199
|
+
readSource: readQoderUsage
|
|
53200
|
+
});
|
|
53201
|
+
}
|
|
53202
|
+
|
|
52651
53203
|
// dist/qoder-adapter.js
|
|
52652
53204
|
var QoderAdapter = class {
|
|
52653
53205
|
harnessId;
|
|
@@ -52655,6 +53207,7 @@ var QoderAdapter = class {
|
|
|
52655
53207
|
commandCatalog = QODER_FALLBACK_COMMAND_CATALOG;
|
|
52656
53208
|
liveCommandCatalog = true;
|
|
52657
53209
|
sessionImport;
|
|
53210
|
+
usageStatistics;
|
|
52658
53211
|
#commandOverride;
|
|
52659
53212
|
#environment;
|
|
52660
53213
|
#platform;
|
|
@@ -52673,6 +53226,7 @@ var QoderAdapter = class {
|
|
|
52673
53226
|
this.harnessId = harnessIdSchema.parse(runtime.harnessId);
|
|
52674
53227
|
this.#commandOverride = options.commandOverride ?? options.environment?.[runtime.commandEnvironmentVariable];
|
|
52675
53228
|
this.#environment = qoderEnvironment(options.environment);
|
|
53229
|
+
this.usageStatistics = createQoderUsageStatistics({ ...process.env, ...options.environment }, this.#variant);
|
|
52676
53230
|
this.#platform = options.platform ?? process.platform;
|
|
52677
53231
|
this.#queryFactory = options.queryFactory ?? ((input) => runtime.sdk.query(input));
|
|
52678
53232
|
this.#forkSession = options.forkSession ?? runtime.sdk.forkSession;
|
|
@@ -52902,7 +53456,7 @@ var QoderAdapter = class {
|
|
|
52902
53456
|
sourceInfo = await this.#getSessionInfo(sourceRef.data.nativeSessionId, { dir: input.cwd });
|
|
52903
53457
|
} catch {
|
|
52904
53458
|
}
|
|
52905
|
-
if (sourceInfo?.cwd &&
|
|
53459
|
+
if (sourceInfo?.cwd && path9.resolve(sourceInfo.cwd) !== path9.resolve(input.cwd)) {
|
|
52906
53460
|
return {
|
|
52907
53461
|
ok: false,
|
|
52908
53462
|
error: {
|