@karlorz/codexhost-cli-win32-x64 0.14.0-2 → 0.14.0-4
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 +62 -6
- package/app/console-web.js +90 -34
- package/app/cpa-live-voice-hook.js +123 -30
- package/app/desktop-controller.mjs +60 -3
- package/app/host-runtime.mjs +621 -405
- package/app/plugins/antigravity/plugin.mjs +62 -3
- package/app/plugins/claude-code/plugin.mjs +83 -24
- package/app/plugins/codebuddy/plugin.mjs +80 -21
- package/app/plugins/codex-usage/plugin.mjs +84 -28
- package/app/plugins/copilot/plugin.mjs +112 -53
- package/app/plugins/cursor-cli/plugin.mjs +80 -21
- package/app/plugins/deepseek-harness/plugin.mjs +91 -32
- package/app/plugins/grok/plugin.mjs +411 -87
- package/app/plugins/hermes/plugin.mjs +62 -3
- package/app/plugins/kimi-code/plugin.mjs +74 -15
- package/app/plugins/kiro-cli/plugin.mjs +74 -15
- package/app/plugins/omp/plugin.mjs +94 -35
- package/app/plugins/opencode/plugin.mjs +116 -57
- package/app/plugins/pi/plugin.mjs +96 -37
- package/app/plugins/qoder/plugin.mjs +84 -25
- package/app/plugins/qoder-cn/plugin.mjs +84 -25
- package/app/plugins/workbuddy/plugin.mjs +80 -21
- package/app/plugins/zcode/plugin.mjs +85 -26
- package/app/renderer-extension.js +884 -158
- 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/package.json +1 -1
|
@@ -3446,10 +3446,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3446
3446
|
const shape = def.shape;
|
|
3447
3447
|
const propValues = {};
|
|
3448
3448
|
for (const key in shape) {
|
|
3449
|
-
const
|
|
3450
|
-
if (
|
|
3449
|
+
const field2 = shape[key]._zod;
|
|
3450
|
+
if (field2.values) {
|
|
3451
3451
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3452
|
-
for (const v of
|
|
3452
|
+
for (const v of field2.values)
|
|
3453
3453
|
propValues[key].add(v);
|
|
3454
3454
|
}
|
|
3455
3455
|
}
|
|
@@ -15276,6 +15276,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
15276
15276
|
// ../../shared-contracts/dist/version.js
|
|
15277
15277
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
15278
15278
|
|
|
15279
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
15280
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
15281
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
15282
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
15283
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
15284
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
15285
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
15286
|
+
});
|
|
15287
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
15288
|
+
interactionId: hostInteractionIdSchema,
|
|
15289
|
+
turnId: hostTurnIdSchema,
|
|
15290
|
+
title: external_exports.string().optional(),
|
|
15291
|
+
expiresAt: external_exports.string().optional(),
|
|
15292
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
15293
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
15294
|
+
external_exports.strictObject({
|
|
15295
|
+
...field,
|
|
15296
|
+
type: external_exports.literal("choice"),
|
|
15297
|
+
multiple: external_exports.boolean(),
|
|
15298
|
+
allowOther: external_exports.boolean(),
|
|
15299
|
+
options: external_exports.array(external_exports.strictObject({
|
|
15300
|
+
value: external_exports.string().min(1),
|
|
15301
|
+
label: external_exports.string(),
|
|
15302
|
+
description: external_exports.string().optional()
|
|
15303
|
+
})).min(1)
|
|
15304
|
+
}),
|
|
15305
|
+
external_exports.strictObject({
|
|
15306
|
+
...field,
|
|
15307
|
+
type: external_exports.literal("text"),
|
|
15308
|
+
multiline: external_exports.boolean(),
|
|
15309
|
+
secret: external_exports.literal(false),
|
|
15310
|
+
placeholder: external_exports.string().optional(),
|
|
15311
|
+
prefill: external_exports.string().optional()
|
|
15312
|
+
})
|
|
15313
|
+
])).min(1)
|
|
15314
|
+
});
|
|
15315
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
15316
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
15317
|
+
});
|
|
15318
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
15319
|
+
threadId: hostThreadIdSchema,
|
|
15320
|
+
interactionId: hostInteractionIdSchema,
|
|
15321
|
+
turnId: hostTurnIdSchema,
|
|
15322
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
15323
|
+
cancelled: external_exports.boolean().optional()
|
|
15324
|
+
});
|
|
15325
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
15326
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
15327
|
+
threadId: hostThreadIdSchema,
|
|
15328
|
+
interactionId: hostInteractionIdSchema,
|
|
15329
|
+
turnId: hostTurnIdSchema
|
|
15330
|
+
});
|
|
15331
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
15332
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
15333
|
+
});
|
|
15334
|
+
|
|
15279
15335
|
// ../../shared-contracts/dist/idle-release.js
|
|
15280
15336
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
15281
15337
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
@@ -16479,6 +16535,9 @@ function validateHostQuestionResponse(interaction, response) {
|
|
|
16479
16535
|
}
|
|
16480
16536
|
for (const question of interaction.questions) {
|
|
16481
16537
|
const answers = response.answers[question.id] ?? [];
|
|
16538
|
+
if (new Set(answers).size !== answers.length) {
|
|
16539
|
+
return invalidRequest("Question Response contains duplicate answers");
|
|
16540
|
+
}
|
|
16482
16541
|
if (!question.optional && answers.length === 0) {
|
|
16483
16542
|
return invalidRequest("Question Response omits a required answer");
|
|
16484
16543
|
}
|
|
@@ -3040,10 +3040,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3040
3040
|
const shape = def.shape;
|
|
3041
3041
|
const propValues = {};
|
|
3042
3042
|
for (const key in shape) {
|
|
3043
|
-
const
|
|
3044
|
-
if (
|
|
3043
|
+
const field2 = shape[key]._zod;
|
|
3044
|
+
if (field2.values) {
|
|
3045
3045
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3046
|
-
for (const v of
|
|
3046
|
+
for (const v of field2.values)
|
|
3047
3047
|
propValues[key].add(v);
|
|
3048
3048
|
}
|
|
3049
3049
|
}
|
|
@@ -14870,6 +14870,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
14870
14870
|
// ../../shared-contracts/dist/version.js
|
|
14871
14871
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
14872
14872
|
|
|
14873
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
14874
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
14875
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
14876
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
14877
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
14878
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
14879
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
14880
|
+
});
|
|
14881
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
14882
|
+
interactionId: hostInteractionIdSchema,
|
|
14883
|
+
turnId: hostTurnIdSchema,
|
|
14884
|
+
title: external_exports.string().optional(),
|
|
14885
|
+
expiresAt: external_exports.string().optional(),
|
|
14886
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
14887
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
14888
|
+
external_exports.strictObject({
|
|
14889
|
+
...field,
|
|
14890
|
+
type: external_exports.literal("choice"),
|
|
14891
|
+
multiple: external_exports.boolean(),
|
|
14892
|
+
allowOther: external_exports.boolean(),
|
|
14893
|
+
options: external_exports.array(external_exports.strictObject({
|
|
14894
|
+
value: external_exports.string().min(1),
|
|
14895
|
+
label: external_exports.string(),
|
|
14896
|
+
description: external_exports.string().optional()
|
|
14897
|
+
})).min(1)
|
|
14898
|
+
}),
|
|
14899
|
+
external_exports.strictObject({
|
|
14900
|
+
...field,
|
|
14901
|
+
type: external_exports.literal("text"),
|
|
14902
|
+
multiline: external_exports.boolean(),
|
|
14903
|
+
secret: external_exports.literal(false),
|
|
14904
|
+
placeholder: external_exports.string().optional(),
|
|
14905
|
+
prefill: external_exports.string().optional()
|
|
14906
|
+
})
|
|
14907
|
+
])).min(1)
|
|
14908
|
+
});
|
|
14909
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
14910
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
14911
|
+
});
|
|
14912
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
14913
|
+
threadId: hostThreadIdSchema,
|
|
14914
|
+
interactionId: hostInteractionIdSchema,
|
|
14915
|
+
turnId: hostTurnIdSchema,
|
|
14916
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
14917
|
+
cancelled: external_exports.boolean().optional()
|
|
14918
|
+
});
|
|
14919
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
14920
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
14921
|
+
threadId: hostThreadIdSchema,
|
|
14922
|
+
interactionId: hostInteractionIdSchema,
|
|
14923
|
+
turnId: hostTurnIdSchema
|
|
14924
|
+
});
|
|
14925
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
14926
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
14927
|
+
});
|
|
14928
|
+
|
|
14873
14929
|
// ../../shared-contracts/dist/idle-release.js
|
|
14874
14930
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
14875
14931
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
@@ -16081,6 +16137,9 @@ function validateHostQuestionResponse(interaction, response) {
|
|
|
16081
16137
|
}
|
|
16082
16138
|
for (const question of interaction.questions) {
|
|
16083
16139
|
const answers = response.answers[question.id] ?? [];
|
|
16140
|
+
if (new Set(answers).size !== answers.length) {
|
|
16141
|
+
return invalidRequest2("Question Response contains duplicate answers");
|
|
16142
|
+
}
|
|
16084
16143
|
if (!question.optional && answers.length === 0) {
|
|
16085
16144
|
return invalidRequest2("Question Response omits a required answer");
|
|
16086
16145
|
}
|
|
@@ -16210,26 +16269,26 @@ function parseHostUsage(value) {
|
|
|
16210
16269
|
}
|
|
16211
16270
|
}
|
|
16212
16271
|
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
16213
|
-
for (const
|
|
16272
|
+
for (const field2 of [
|
|
16214
16273
|
"totalCredits",
|
|
16215
16274
|
"contextUsagePercent",
|
|
16216
16275
|
"apiOutputTokensPerSecond"
|
|
16217
16276
|
]) {
|
|
16218
|
-
const candidate = value[
|
|
16277
|
+
const candidate = value[field2];
|
|
16219
16278
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
16220
|
-
throw new Error(`Harness Usage '${
|
|
16279
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
16221
16280
|
}
|
|
16222
16281
|
}
|
|
16223
|
-
for (const
|
|
16224
|
-
const candidate = value[
|
|
16282
|
+
for (const field2 of tokenFields) {
|
|
16283
|
+
const candidate = value[field2];
|
|
16225
16284
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16226
|
-
throw new Error(`Harness Usage '${
|
|
16285
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
16227
16286
|
}
|
|
16228
16287
|
}
|
|
16229
|
-
for (const
|
|
16230
|
-
const candidate = value[
|
|
16288
|
+
for (const field2 of safeIntegerFields) {
|
|
16289
|
+
const candidate = value[field2];
|
|
16231
16290
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16232
|
-
throw new Error(`Harness Usage '${
|
|
16291
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
16233
16292
|
}
|
|
16234
16293
|
}
|
|
16235
16294
|
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
@@ -16238,10 +16297,10 @@ function parseHostUsage(value) {
|
|
|
16238
16297
|
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
16239
16298
|
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
16240
16299
|
}
|
|
16241
|
-
for (const
|
|
16242
|
-
const candidate = value[
|
|
16300
|
+
for (const field2 of percentFields) {
|
|
16301
|
+
const candidate = value[field2];
|
|
16243
16302
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
|
|
16244
|
-
throw new Error(`Harness Usage '${
|
|
16303
|
+
throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
|
|
16245
16304
|
}
|
|
16246
16305
|
}
|
|
16247
16306
|
if (value.sessionCacheUsage !== void 0) {
|
|
@@ -16312,19 +16371,19 @@ function parseHostUsageRequest(value) {
|
|
|
16312
16371
|
if (typeof value.requestId !== "string" || value.requestId.length === 0) {
|
|
16313
16372
|
throw new Error("Harness Usage request 'requestId' must be a non-empty string");
|
|
16314
16373
|
}
|
|
16315
|
-
for (const
|
|
16316
|
-
const candidate = value[
|
|
16374
|
+
for (const field2 of ["model", "provider"]) {
|
|
16375
|
+
const candidate = value[field2];
|
|
16317
16376
|
if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
|
|
16318
|
-
throw new Error(`Harness Usage request '${
|
|
16377
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
|
|
16319
16378
|
}
|
|
16320
16379
|
}
|
|
16321
16380
|
if (value.historical !== void 0 && typeof value.historical !== "boolean") {
|
|
16322
16381
|
throw new Error("Harness Usage request 'historical' must be a boolean");
|
|
16323
16382
|
}
|
|
16324
|
-
for (const
|
|
16325
|
-
const candidate = value[
|
|
16383
|
+
for (const field2 of requestTokenFields) {
|
|
16384
|
+
const candidate = value[field2];
|
|
16326
16385
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16327
|
-
throw new Error(`Harness Usage request '${
|
|
16386
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
|
|
16328
16387
|
}
|
|
16329
16388
|
}
|
|
16330
16389
|
if (value.inputTokens === void 0 || value.outputTokens === void 0) {
|
|
@@ -58344,9 +58403,9 @@ function stringField(value, keys) {
|
|
|
58344
58403
|
if (!isRecord12(value))
|
|
58345
58404
|
return void 0;
|
|
58346
58405
|
for (const key of keys) {
|
|
58347
|
-
const
|
|
58348
|
-
if (typeof
|
|
58349
|
-
return
|
|
58406
|
+
const field2 = value[key];
|
|
58407
|
+
if (typeof field2 === "string" && field2.length > 0)
|
|
58408
|
+
return field2;
|
|
58350
58409
|
}
|
|
58351
58410
|
return void 0;
|
|
58352
58411
|
}
|
|
@@ -3516,10 +3516,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3516
3516
|
const shape = def.shape;
|
|
3517
3517
|
const propValues = {};
|
|
3518
3518
|
for (const key in shape) {
|
|
3519
|
-
const
|
|
3520
|
-
if (
|
|
3519
|
+
const field2 = shape[key]._zod;
|
|
3520
|
+
if (field2.values) {
|
|
3521
3521
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3522
|
-
for (const v of
|
|
3522
|
+
for (const v of field2.values)
|
|
3523
3523
|
propValues[key].add(v);
|
|
3524
3524
|
}
|
|
3525
3525
|
}
|
|
@@ -15346,6 +15346,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
15346
15346
|
// ../../shared-contracts/dist/version.js
|
|
15347
15347
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
15348
15348
|
|
|
15349
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
15350
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
15351
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
15352
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
15353
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
15354
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
15355
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
15356
|
+
});
|
|
15357
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
15358
|
+
interactionId: hostInteractionIdSchema,
|
|
15359
|
+
turnId: hostTurnIdSchema,
|
|
15360
|
+
title: external_exports.string().optional(),
|
|
15361
|
+
expiresAt: external_exports.string().optional(),
|
|
15362
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
15363
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
15364
|
+
external_exports.strictObject({
|
|
15365
|
+
...field,
|
|
15366
|
+
type: external_exports.literal("choice"),
|
|
15367
|
+
multiple: external_exports.boolean(),
|
|
15368
|
+
allowOther: external_exports.boolean(),
|
|
15369
|
+
options: external_exports.array(external_exports.strictObject({
|
|
15370
|
+
value: external_exports.string().min(1),
|
|
15371
|
+
label: external_exports.string(),
|
|
15372
|
+
description: external_exports.string().optional()
|
|
15373
|
+
})).min(1)
|
|
15374
|
+
}),
|
|
15375
|
+
external_exports.strictObject({
|
|
15376
|
+
...field,
|
|
15377
|
+
type: external_exports.literal("text"),
|
|
15378
|
+
multiline: external_exports.boolean(),
|
|
15379
|
+
secret: external_exports.literal(false),
|
|
15380
|
+
placeholder: external_exports.string().optional(),
|
|
15381
|
+
prefill: external_exports.string().optional()
|
|
15382
|
+
})
|
|
15383
|
+
])).min(1)
|
|
15384
|
+
});
|
|
15385
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
15386
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
15387
|
+
});
|
|
15388
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
15389
|
+
threadId: hostThreadIdSchema,
|
|
15390
|
+
interactionId: hostInteractionIdSchema,
|
|
15391
|
+
turnId: hostTurnIdSchema,
|
|
15392
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
15393
|
+
cancelled: external_exports.boolean().optional()
|
|
15394
|
+
});
|
|
15395
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
15396
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
15397
|
+
threadId: hostThreadIdSchema,
|
|
15398
|
+
interactionId: hostInteractionIdSchema,
|
|
15399
|
+
turnId: hostTurnIdSchema
|
|
15400
|
+
});
|
|
15401
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
15402
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
15403
|
+
});
|
|
15404
|
+
|
|
15349
15405
|
// ../../shared-contracts/dist/idle-release.js
|
|
15350
15406
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
15351
15407
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
@@ -16557,6 +16613,9 @@ function validateHostQuestionResponse(interaction, response) {
|
|
|
16557
16613
|
}
|
|
16558
16614
|
for (const question of interaction.questions) {
|
|
16559
16615
|
const answers = response.answers[question.id] ?? [];
|
|
16616
|
+
if (new Set(answers).size !== answers.length) {
|
|
16617
|
+
return invalidRequest2("Question Response contains duplicate answers");
|
|
16618
|
+
}
|
|
16560
16619
|
if (!question.optional && answers.length === 0) {
|
|
16561
16620
|
return invalidRequest2("Question Response omits a required answer");
|
|
16562
16621
|
}
|
|
@@ -16715,26 +16774,26 @@ function parseHostUsage(value) {
|
|
|
16715
16774
|
}
|
|
16716
16775
|
}
|
|
16717
16776
|
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
16718
|
-
for (const
|
|
16777
|
+
for (const field2 of [
|
|
16719
16778
|
"totalCredits",
|
|
16720
16779
|
"contextUsagePercent",
|
|
16721
16780
|
"apiOutputTokensPerSecond"
|
|
16722
16781
|
]) {
|
|
16723
|
-
const candidate = value[
|
|
16782
|
+
const candidate = value[field2];
|
|
16724
16783
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
16725
|
-
throw new Error(`Harness Usage '${
|
|
16784
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
16726
16785
|
}
|
|
16727
16786
|
}
|
|
16728
|
-
for (const
|
|
16729
|
-
const candidate = value[
|
|
16787
|
+
for (const field2 of tokenFields) {
|
|
16788
|
+
const candidate = value[field2];
|
|
16730
16789
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16731
|
-
throw new Error(`Harness Usage '${
|
|
16790
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
16732
16791
|
}
|
|
16733
16792
|
}
|
|
16734
|
-
for (const
|
|
16735
|
-
const candidate = value[
|
|
16793
|
+
for (const field2 of safeIntegerFields) {
|
|
16794
|
+
const candidate = value[field2];
|
|
16736
16795
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16737
|
-
throw new Error(`Harness Usage '${
|
|
16796
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
16738
16797
|
}
|
|
16739
16798
|
}
|
|
16740
16799
|
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
@@ -16743,10 +16802,10 @@ function parseHostUsage(value) {
|
|
|
16743
16802
|
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
16744
16803
|
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
16745
16804
|
}
|
|
16746
|
-
for (const
|
|
16747
|
-
const candidate = value[
|
|
16805
|
+
for (const field2 of percentFields) {
|
|
16806
|
+
const candidate = value[field2];
|
|
16748
16807
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
|
|
16749
|
-
throw new Error(`Harness Usage '${
|
|
16808
|
+
throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
|
|
16750
16809
|
}
|
|
16751
16810
|
}
|
|
16752
16811
|
if (value.sessionCacheUsage !== void 0) {
|
|
@@ -16817,19 +16876,19 @@ function parseHostUsageRequest(value) {
|
|
|
16817
16876
|
if (typeof value.requestId !== "string" || value.requestId.length === 0) {
|
|
16818
16877
|
throw new Error("Harness Usage request 'requestId' must be a non-empty string");
|
|
16819
16878
|
}
|
|
16820
|
-
for (const
|
|
16821
|
-
const candidate = value[
|
|
16879
|
+
for (const field2 of ["model", "provider"]) {
|
|
16880
|
+
const candidate = value[field2];
|
|
16822
16881
|
if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
|
|
16823
|
-
throw new Error(`Harness Usage request '${
|
|
16882
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
|
|
16824
16883
|
}
|
|
16825
16884
|
}
|
|
16826
16885
|
if (value.historical !== void 0 && typeof value.historical !== "boolean") {
|
|
16827
16886
|
throw new Error("Harness Usage request 'historical' must be a boolean");
|
|
16828
16887
|
}
|
|
16829
|
-
for (const
|
|
16830
|
-
const candidate = value[
|
|
16888
|
+
for (const field2 of requestTokenFields) {
|
|
16889
|
+
const candidate = value[field2];
|
|
16831
16890
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16832
|
-
throw new Error(`Harness Usage request '${
|
|
16891
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
|
|
16833
16892
|
}
|
|
16834
16893
|
}
|
|
16835
16894
|
if (value.inputTokens === void 0 || value.outputTokens === void 0) {
|
|
@@ -3034,10 +3034,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3034
3034
|
const shape = def.shape;
|
|
3035
3035
|
const propValues = {};
|
|
3036
3036
|
for (const key2 in shape) {
|
|
3037
|
-
const
|
|
3038
|
-
if (
|
|
3037
|
+
const field2 = shape[key2]._zod;
|
|
3038
|
+
if (field2.values) {
|
|
3039
3039
|
propValues[key2] ?? (propValues[key2] = /* @__PURE__ */ new Set());
|
|
3040
|
-
for (const v of
|
|
3040
|
+
for (const v of field2.values)
|
|
3041
3041
|
propValues[key2].add(v);
|
|
3042
3042
|
}
|
|
3043
3043
|
}
|
|
@@ -14864,6 +14864,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
14864
14864
|
// ../../shared-contracts/dist/version.js
|
|
14865
14865
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
14866
14866
|
|
|
14867
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
14868
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
14869
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
14870
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
14871
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
14872
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
14873
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
14874
|
+
});
|
|
14875
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
14876
|
+
interactionId: hostInteractionIdSchema,
|
|
14877
|
+
turnId: hostTurnIdSchema,
|
|
14878
|
+
title: external_exports.string().optional(),
|
|
14879
|
+
expiresAt: external_exports.string().optional(),
|
|
14880
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
14881
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
14882
|
+
external_exports.strictObject({
|
|
14883
|
+
...field,
|
|
14884
|
+
type: external_exports.literal("choice"),
|
|
14885
|
+
multiple: external_exports.boolean(),
|
|
14886
|
+
allowOther: external_exports.boolean(),
|
|
14887
|
+
options: external_exports.array(external_exports.strictObject({
|
|
14888
|
+
value: external_exports.string().min(1),
|
|
14889
|
+
label: external_exports.string(),
|
|
14890
|
+
description: external_exports.string().optional()
|
|
14891
|
+
})).min(1)
|
|
14892
|
+
}),
|
|
14893
|
+
external_exports.strictObject({
|
|
14894
|
+
...field,
|
|
14895
|
+
type: external_exports.literal("text"),
|
|
14896
|
+
multiline: external_exports.boolean(),
|
|
14897
|
+
secret: external_exports.literal(false),
|
|
14898
|
+
placeholder: external_exports.string().optional(),
|
|
14899
|
+
prefill: external_exports.string().optional()
|
|
14900
|
+
})
|
|
14901
|
+
])).min(1)
|
|
14902
|
+
});
|
|
14903
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
14904
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
14905
|
+
});
|
|
14906
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
14907
|
+
threadId: hostThreadIdSchema,
|
|
14908
|
+
interactionId: hostInteractionIdSchema,
|
|
14909
|
+
turnId: hostTurnIdSchema,
|
|
14910
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
14911
|
+
cancelled: external_exports.boolean().optional()
|
|
14912
|
+
});
|
|
14913
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
14914
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
14915
|
+
threadId: hostThreadIdSchema,
|
|
14916
|
+
interactionId: hostInteractionIdSchema,
|
|
14917
|
+
turnId: hostTurnIdSchema
|
|
14918
|
+
});
|
|
14919
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
14920
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
14921
|
+
});
|
|
14922
|
+
|
|
14867
14923
|
// ../../shared-contracts/dist/idle-release.js
|
|
14868
14924
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
14869
14925
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
@@ -16117,13 +16173,13 @@ function parseHarnessUsageEntry(value) {
|
|
|
16117
16173
|
}
|
|
16118
16174
|
if (!tokenCount(entry.inputTokens) || !tokenCount(entry.outputTokens))
|
|
16119
16175
|
return null;
|
|
16120
|
-
for (const
|
|
16176
|
+
for (const field2 of [
|
|
16121
16177
|
"cachedInputTokens",
|
|
16122
16178
|
"cacheWriteInputTokens",
|
|
16123
16179
|
"cacheWrite1hInputTokens",
|
|
16124
16180
|
"reasoningOutputTokens"
|
|
16125
16181
|
]) {
|
|
16126
|
-
if (entry[
|
|
16182
|
+
if (entry[field2] !== void 0 && !tokenCount(entry[field2]))
|
|
16127
16183
|
return null;
|
|
16128
16184
|
}
|
|
16129
16185
|
const cached2 = entry.cachedInputTokens ?? 0;
|
|
@@ -16217,8 +16273,8 @@ function usage(value) {
|
|
|
16217
16273
|
if (!row)
|
|
16218
16274
|
return null;
|
|
16219
16275
|
const result = { values: [], known: 0 };
|
|
16220
|
-
for (const [i,
|
|
16221
|
-
const n = row[
|
|
16276
|
+
for (const [i, field2] of fields.entries()) {
|
|
16277
|
+
const n = row[field2];
|
|
16222
16278
|
if (n !== void 0 && n !== null) {
|
|
16223
16279
|
if (typeof n !== "number" || !Number.isSafeInteger(n) || n < 0)
|
|
16224
16280
|
return null;
|
|
@@ -17103,26 +17159,26 @@ function parseHostUsage(value) {
|
|
|
17103
17159
|
}
|
|
17104
17160
|
}
|
|
17105
17161
|
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
17106
|
-
for (const
|
|
17162
|
+
for (const field2 of [
|
|
17107
17163
|
"totalCredits",
|
|
17108
17164
|
"contextUsagePercent",
|
|
17109
17165
|
"apiOutputTokensPerSecond"
|
|
17110
17166
|
]) {
|
|
17111
|
-
const candidate = value[
|
|
17167
|
+
const candidate = value[field2];
|
|
17112
17168
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
17113
|
-
throw new Error(`Harness Usage '${
|
|
17169
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
17114
17170
|
}
|
|
17115
17171
|
}
|
|
17116
|
-
for (const
|
|
17117
|
-
const candidate = value[
|
|
17172
|
+
for (const field2 of tokenFields) {
|
|
17173
|
+
const candidate = value[field2];
|
|
17118
17174
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
17119
|
-
throw new Error(`Harness Usage '${
|
|
17175
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
17120
17176
|
}
|
|
17121
17177
|
}
|
|
17122
|
-
for (const
|
|
17123
|
-
const candidate = value[
|
|
17178
|
+
for (const field2 of safeIntegerFields) {
|
|
17179
|
+
const candidate = value[field2];
|
|
17124
17180
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
17125
|
-
throw new Error(`Harness Usage '${
|
|
17181
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
17126
17182
|
}
|
|
17127
17183
|
}
|
|
17128
17184
|
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
@@ -17131,10 +17187,10 @@ function parseHostUsage(value) {
|
|
|
17131
17187
|
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
17132
17188
|
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
17133
17189
|
}
|
|
17134
|
-
for (const
|
|
17135
|
-
const candidate = value[
|
|
17190
|
+
for (const field2 of percentFields) {
|
|
17191
|
+
const candidate = value[field2];
|
|
17136
17192
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
|
|
17137
|
-
throw new Error(`Harness Usage '${
|
|
17193
|
+
throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
|
|
17138
17194
|
}
|
|
17139
17195
|
}
|
|
17140
17196
|
if (value.sessionCacheUsage !== void 0) {
|
|
@@ -17205,19 +17261,19 @@ function parseHostUsageRequest(value) {
|
|
|
17205
17261
|
if (typeof value.requestId !== "string" || value.requestId.length === 0) {
|
|
17206
17262
|
throw new Error("Harness Usage request 'requestId' must be a non-empty string");
|
|
17207
17263
|
}
|
|
17208
|
-
for (const
|
|
17209
|
-
const candidate = value[
|
|
17264
|
+
for (const field2 of ["model", "provider"]) {
|
|
17265
|
+
const candidate = value[field2];
|
|
17210
17266
|
if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
|
|
17211
|
-
throw new Error(`Harness Usage request '${
|
|
17267
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
|
|
17212
17268
|
}
|
|
17213
17269
|
}
|
|
17214
17270
|
if (value.historical !== void 0 && typeof value.historical !== "boolean") {
|
|
17215
17271
|
throw new Error("Harness Usage request 'historical' must be a boolean");
|
|
17216
17272
|
}
|
|
17217
|
-
for (const
|
|
17218
|
-
const candidate = value[
|
|
17273
|
+
for (const field2 of requestTokenFields) {
|
|
17274
|
+
const candidate = value[field2];
|
|
17219
17275
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
17220
|
-
throw new Error(`Harness Usage request '${
|
|
17276
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
|
|
17221
17277
|
}
|
|
17222
17278
|
}
|
|
17223
17279
|
if (value.inputTokens === void 0 || value.outputTokens === void 0) {
|
|
@@ -17251,7 +17307,7 @@ function tokenSnapshot(value) {
|
|
|
17251
17307
|
const total = object2(token.total);
|
|
17252
17308
|
const last = object2(token.last);
|
|
17253
17309
|
const result = {};
|
|
17254
|
-
for (const
|
|
17310
|
+
for (const field2 of [
|
|
17255
17311
|
"totalTokens",
|
|
17256
17312
|
"inputTokens",
|
|
17257
17313
|
"cachedInputTokens",
|
|
@@ -17259,9 +17315,9 @@ function tokenSnapshot(value) {
|
|
|
17259
17315
|
"outputTokens",
|
|
17260
17316
|
"reasoningOutputTokens"
|
|
17261
17317
|
]) {
|
|
17262
|
-
const n = integer2(total?.[
|
|
17318
|
+
const n = integer2(total?.[field2]);
|
|
17263
17319
|
if (n !== void 0)
|
|
17264
|
-
result[
|
|
17320
|
+
result[field2] = n;
|
|
17265
17321
|
}
|
|
17266
17322
|
const used = integer2(last?.totalTokens);
|
|
17267
17323
|
const window = integer2(token.modelContextWindow);
|