@karlorz/codexhost-cli-win32-x64 0.14.0-3 → 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 +59 -3
- package/app/desktop-controller.mjs +59 -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 +791 -126
- 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
|
@@ -3401,10 +3401,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3401
3401
|
const shape = def.shape;
|
|
3402
3402
|
const propValues = {};
|
|
3403
3403
|
for (const key in shape) {
|
|
3404
|
-
const
|
|
3405
|
-
if (
|
|
3404
|
+
const field2 = shape[key]._zod;
|
|
3405
|
+
if (field2.values) {
|
|
3406
3406
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3407
|
-
for (const v of
|
|
3407
|
+
for (const v of field2.values)
|
|
3408
3408
|
propValues[key].add(v);
|
|
3409
3409
|
}
|
|
3410
3410
|
}
|
|
@@ -15231,6 +15231,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
15231
15231
|
// ../../shared-contracts/dist/version.js
|
|
15232
15232
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
15233
15233
|
|
|
15234
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
15235
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
15236
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
15237
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
15238
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
15239
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
15240
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
15241
|
+
});
|
|
15242
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
15243
|
+
interactionId: hostInteractionIdSchema,
|
|
15244
|
+
turnId: hostTurnIdSchema,
|
|
15245
|
+
title: external_exports.string().optional(),
|
|
15246
|
+
expiresAt: external_exports.string().optional(),
|
|
15247
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
15248
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
15249
|
+
external_exports.strictObject({
|
|
15250
|
+
...field,
|
|
15251
|
+
type: external_exports.literal("choice"),
|
|
15252
|
+
multiple: external_exports.boolean(),
|
|
15253
|
+
allowOther: external_exports.boolean(),
|
|
15254
|
+
options: external_exports.array(external_exports.strictObject({
|
|
15255
|
+
value: external_exports.string().min(1),
|
|
15256
|
+
label: external_exports.string(),
|
|
15257
|
+
description: external_exports.string().optional()
|
|
15258
|
+
})).min(1)
|
|
15259
|
+
}),
|
|
15260
|
+
external_exports.strictObject({
|
|
15261
|
+
...field,
|
|
15262
|
+
type: external_exports.literal("text"),
|
|
15263
|
+
multiline: external_exports.boolean(),
|
|
15264
|
+
secret: external_exports.literal(false),
|
|
15265
|
+
placeholder: external_exports.string().optional(),
|
|
15266
|
+
prefill: external_exports.string().optional()
|
|
15267
|
+
})
|
|
15268
|
+
])).min(1)
|
|
15269
|
+
});
|
|
15270
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
15271
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
15272
|
+
});
|
|
15273
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
15274
|
+
threadId: hostThreadIdSchema,
|
|
15275
|
+
interactionId: hostInteractionIdSchema,
|
|
15276
|
+
turnId: hostTurnIdSchema,
|
|
15277
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
15278
|
+
cancelled: external_exports.boolean().optional()
|
|
15279
|
+
});
|
|
15280
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
15281
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
15282
|
+
threadId: hostThreadIdSchema,
|
|
15283
|
+
interactionId: hostInteractionIdSchema,
|
|
15284
|
+
turnId: hostTurnIdSchema
|
|
15285
|
+
});
|
|
15286
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
15287
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
15288
|
+
});
|
|
15289
|
+
|
|
15234
15290
|
// ../../shared-contracts/dist/idle-release.js
|
|
15235
15291
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
15236
15292
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
@@ -16442,6 +16498,9 @@ function validateHostQuestionResponse(interaction, response) {
|
|
|
16442
16498
|
}
|
|
16443
16499
|
for (const question2 of interaction.questions) {
|
|
16444
16500
|
const answers = response.answers[question2.id] ?? [];
|
|
16501
|
+
if (new Set(answers).size !== answers.length) {
|
|
16502
|
+
return invalidRequest2("Question Response contains duplicate answers");
|
|
16503
|
+
}
|
|
16445
16504
|
if (!question2.optional && answers.length === 0) {
|
|
16446
16505
|
return invalidRequest2("Question Response omits a required answer");
|
|
16447
16506
|
}
|
|
@@ -3521,10 +3521,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3521
3521
|
const shape = def.shape;
|
|
3522
3522
|
const propValues = {};
|
|
3523
3523
|
for (const key in shape) {
|
|
3524
|
-
const
|
|
3525
|
-
if (
|
|
3524
|
+
const field2 = shape[key]._zod;
|
|
3525
|
+
if (field2.values) {
|
|
3526
3526
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3527
|
-
for (const v of
|
|
3527
|
+
for (const v of field2.values)
|
|
3528
3528
|
propValues[key].add(v);
|
|
3529
3529
|
}
|
|
3530
3530
|
}
|
|
@@ -15351,6 +15351,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
15351
15351
|
// ../../shared-contracts/dist/version.js
|
|
15352
15352
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
15353
15353
|
|
|
15354
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
15355
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
15356
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
15357
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
15358
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
15359
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
15360
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
15361
|
+
});
|
|
15362
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
15363
|
+
interactionId: hostInteractionIdSchema,
|
|
15364
|
+
turnId: hostTurnIdSchema,
|
|
15365
|
+
title: external_exports.string().optional(),
|
|
15366
|
+
expiresAt: external_exports.string().optional(),
|
|
15367
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
15368
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
15369
|
+
external_exports.strictObject({
|
|
15370
|
+
...field,
|
|
15371
|
+
type: external_exports.literal("choice"),
|
|
15372
|
+
multiple: external_exports.boolean(),
|
|
15373
|
+
allowOther: external_exports.boolean(),
|
|
15374
|
+
options: external_exports.array(external_exports.strictObject({
|
|
15375
|
+
value: external_exports.string().min(1),
|
|
15376
|
+
label: external_exports.string(),
|
|
15377
|
+
description: external_exports.string().optional()
|
|
15378
|
+
})).min(1)
|
|
15379
|
+
}),
|
|
15380
|
+
external_exports.strictObject({
|
|
15381
|
+
...field,
|
|
15382
|
+
type: external_exports.literal("text"),
|
|
15383
|
+
multiline: external_exports.boolean(),
|
|
15384
|
+
secret: external_exports.literal(false),
|
|
15385
|
+
placeholder: external_exports.string().optional(),
|
|
15386
|
+
prefill: external_exports.string().optional()
|
|
15387
|
+
})
|
|
15388
|
+
])).min(1)
|
|
15389
|
+
});
|
|
15390
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
15391
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
15392
|
+
});
|
|
15393
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
15394
|
+
threadId: hostThreadIdSchema,
|
|
15395
|
+
interactionId: hostInteractionIdSchema,
|
|
15396
|
+
turnId: hostTurnIdSchema,
|
|
15397
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
15398
|
+
cancelled: external_exports.boolean().optional()
|
|
15399
|
+
});
|
|
15400
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
15401
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
15402
|
+
threadId: hostThreadIdSchema,
|
|
15403
|
+
interactionId: hostInteractionIdSchema,
|
|
15404
|
+
turnId: hostTurnIdSchema
|
|
15405
|
+
});
|
|
15406
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
15407
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
15408
|
+
});
|
|
15409
|
+
|
|
15354
15410
|
// ../../shared-contracts/dist/idle-release.js
|
|
15355
15411
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
15356
15412
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
@@ -16566,6 +16622,9 @@ function validateHostQuestionResponse(interaction, response) {
|
|
|
16566
16622
|
}
|
|
16567
16623
|
for (const question of interaction.questions) {
|
|
16568
16624
|
const answers = response.answers[question.id] ?? [];
|
|
16625
|
+
if (new Set(answers).size !== answers.length) {
|
|
16626
|
+
return invalidRequest2("Question Response contains duplicate answers");
|
|
16627
|
+
}
|
|
16569
16628
|
if (!question.optional && answers.length === 0) {
|
|
16570
16629
|
return invalidRequest2("Question Response omits a required answer");
|
|
16571
16630
|
}
|
|
@@ -16707,26 +16766,26 @@ function parseHostUsage(value) {
|
|
|
16707
16766
|
}
|
|
16708
16767
|
}
|
|
16709
16768
|
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
16710
|
-
for (const
|
|
16769
|
+
for (const field2 of [
|
|
16711
16770
|
"totalCredits",
|
|
16712
16771
|
"contextUsagePercent",
|
|
16713
16772
|
"apiOutputTokensPerSecond"
|
|
16714
16773
|
]) {
|
|
16715
|
-
const candidate = value[
|
|
16774
|
+
const candidate = value[field2];
|
|
16716
16775
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
16717
|
-
throw new Error(`Harness Usage '${
|
|
16776
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
16718
16777
|
}
|
|
16719
16778
|
}
|
|
16720
|
-
for (const
|
|
16721
|
-
const candidate = value[
|
|
16779
|
+
for (const field2 of tokenFields) {
|
|
16780
|
+
const candidate = value[field2];
|
|
16722
16781
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16723
|
-
throw new Error(`Harness Usage '${
|
|
16782
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
16724
16783
|
}
|
|
16725
16784
|
}
|
|
16726
|
-
for (const
|
|
16727
|
-
const candidate = value[
|
|
16785
|
+
for (const field2 of safeIntegerFields) {
|
|
16786
|
+
const candidate = value[field2];
|
|
16728
16787
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16729
|
-
throw new Error(`Harness Usage '${
|
|
16788
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
16730
16789
|
}
|
|
16731
16790
|
}
|
|
16732
16791
|
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
@@ -16735,10 +16794,10 @@ function parseHostUsage(value) {
|
|
|
16735
16794
|
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
16736
16795
|
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
16737
16796
|
}
|
|
16738
|
-
for (const
|
|
16739
|
-
const candidate = value[
|
|
16797
|
+
for (const field2 of percentFields) {
|
|
16798
|
+
const candidate = value[field2];
|
|
16740
16799
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
|
|
16741
|
-
throw new Error(`Harness Usage '${
|
|
16800
|
+
throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
|
|
16742
16801
|
}
|
|
16743
16802
|
}
|
|
16744
16803
|
if (value.sessionCacheUsage !== void 0) {
|
|
@@ -3380,10 +3380,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3380
3380
|
const shape = def.shape;
|
|
3381
3381
|
const propValues = {};
|
|
3382
3382
|
for (const key in shape) {
|
|
3383
|
-
const
|
|
3384
|
-
if (
|
|
3383
|
+
const field2 = shape[key]._zod;
|
|
3384
|
+
if (field2.values) {
|
|
3385
3385
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3386
|
-
for (const v of
|
|
3386
|
+
for (const v of field2.values)
|
|
3387
3387
|
propValues[key].add(v);
|
|
3388
3388
|
}
|
|
3389
3389
|
}
|
|
@@ -15210,6 +15210,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
15210
15210
|
// ../../shared-contracts/dist/version.js
|
|
15211
15211
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
15212
15212
|
|
|
15213
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
15214
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
15215
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
15216
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
15217
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
15218
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
15219
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
15220
|
+
});
|
|
15221
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
15222
|
+
interactionId: hostInteractionIdSchema,
|
|
15223
|
+
turnId: hostTurnIdSchema,
|
|
15224
|
+
title: external_exports.string().optional(),
|
|
15225
|
+
expiresAt: external_exports.string().optional(),
|
|
15226
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
15227
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
15228
|
+
external_exports.strictObject({
|
|
15229
|
+
...field,
|
|
15230
|
+
type: external_exports.literal("choice"),
|
|
15231
|
+
multiple: external_exports.boolean(),
|
|
15232
|
+
allowOther: external_exports.boolean(),
|
|
15233
|
+
options: external_exports.array(external_exports.strictObject({
|
|
15234
|
+
value: external_exports.string().min(1),
|
|
15235
|
+
label: external_exports.string(),
|
|
15236
|
+
description: external_exports.string().optional()
|
|
15237
|
+
})).min(1)
|
|
15238
|
+
}),
|
|
15239
|
+
external_exports.strictObject({
|
|
15240
|
+
...field,
|
|
15241
|
+
type: external_exports.literal("text"),
|
|
15242
|
+
multiline: external_exports.boolean(),
|
|
15243
|
+
secret: external_exports.literal(false),
|
|
15244
|
+
placeholder: external_exports.string().optional(),
|
|
15245
|
+
prefill: external_exports.string().optional()
|
|
15246
|
+
})
|
|
15247
|
+
])).min(1)
|
|
15248
|
+
});
|
|
15249
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
15250
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
15251
|
+
});
|
|
15252
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
15253
|
+
threadId: hostThreadIdSchema,
|
|
15254
|
+
interactionId: hostInteractionIdSchema,
|
|
15255
|
+
turnId: hostTurnIdSchema,
|
|
15256
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
15257
|
+
cancelled: external_exports.boolean().optional()
|
|
15258
|
+
});
|
|
15259
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
15260
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
15261
|
+
threadId: hostThreadIdSchema,
|
|
15262
|
+
interactionId: hostInteractionIdSchema,
|
|
15263
|
+
turnId: hostTurnIdSchema
|
|
15264
|
+
});
|
|
15265
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
15266
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
15267
|
+
});
|
|
15268
|
+
|
|
15213
15269
|
// ../../shared-contracts/dist/idle-release.js
|
|
15214
15270
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
15215
15271
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
@@ -16421,6 +16477,9 @@ function validateHostQuestionResponse(interaction, response) {
|
|
|
16421
16477
|
}
|
|
16422
16478
|
for (const question of interaction.questions) {
|
|
16423
16479
|
const answers = response.answers[question.id] ?? [];
|
|
16480
|
+
if (new Set(answers).size !== answers.length) {
|
|
16481
|
+
return invalidRequest2("Question Response contains duplicate answers");
|
|
16482
|
+
}
|
|
16424
16483
|
if (!question.optional && answers.length === 0) {
|
|
16425
16484
|
return invalidRequest2("Question Response omits a required answer");
|
|
16426
16485
|
}
|
|
@@ -16562,26 +16621,26 @@ function parseHostUsage(value) {
|
|
|
16562
16621
|
}
|
|
16563
16622
|
}
|
|
16564
16623
|
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
16565
|
-
for (const
|
|
16624
|
+
for (const field2 of [
|
|
16566
16625
|
"totalCredits",
|
|
16567
16626
|
"contextUsagePercent",
|
|
16568
16627
|
"apiOutputTokensPerSecond"
|
|
16569
16628
|
]) {
|
|
16570
|
-
const candidate = value[
|
|
16629
|
+
const candidate = value[field2];
|
|
16571
16630
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
16572
|
-
throw new Error(`Harness Usage '${
|
|
16631
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
16573
16632
|
}
|
|
16574
16633
|
}
|
|
16575
|
-
for (const
|
|
16576
|
-
const candidate = value[
|
|
16634
|
+
for (const field2 of tokenFields) {
|
|
16635
|
+
const candidate = value[field2];
|
|
16577
16636
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16578
|
-
throw new Error(`Harness Usage '${
|
|
16637
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
16579
16638
|
}
|
|
16580
16639
|
}
|
|
16581
|
-
for (const
|
|
16582
|
-
const candidate = value[
|
|
16640
|
+
for (const field2 of safeIntegerFields) {
|
|
16641
|
+
const candidate = value[field2];
|
|
16583
16642
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16584
|
-
throw new Error(`Harness Usage '${
|
|
16643
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
16585
16644
|
}
|
|
16586
16645
|
}
|
|
16587
16646
|
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
@@ -16590,10 +16649,10 @@ function parseHostUsage(value) {
|
|
|
16590
16649
|
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
16591
16650
|
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
16592
16651
|
}
|
|
16593
|
-
for (const
|
|
16594
|
-
const candidate = value[
|
|
16652
|
+
for (const field2 of percentFields) {
|
|
16653
|
+
const candidate = value[field2];
|
|
16595
16654
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
|
|
16596
|
-
throw new Error(`Harness Usage '${
|
|
16655
|
+
throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
|
|
16597
16656
|
}
|
|
16598
16657
|
}
|
|
16599
16658
|
if (value.sessionCacheUsage !== void 0) {
|
|
@@ -3583,10 +3583,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3583
3583
|
const shape = def.shape;
|
|
3584
3584
|
const propValues = {};
|
|
3585
3585
|
for (const key in shape) {
|
|
3586
|
-
const
|
|
3587
|
-
if (
|
|
3586
|
+
const field2 = shape[key]._zod;
|
|
3587
|
+
if (field2.values) {
|
|
3588
3588
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3589
|
-
for (const v of
|
|
3589
|
+
for (const v of field2.values)
|
|
3590
3590
|
propValues[key].add(v);
|
|
3591
3591
|
}
|
|
3592
3592
|
}
|
|
@@ -15413,6 +15413,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
15413
15413
|
// ../../shared-contracts/dist/version.js
|
|
15414
15414
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
15415
15415
|
|
|
15416
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
15417
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
15418
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
15419
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
15420
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
15421
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
15422
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
15423
|
+
});
|
|
15424
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
15425
|
+
interactionId: hostInteractionIdSchema,
|
|
15426
|
+
turnId: hostTurnIdSchema,
|
|
15427
|
+
title: external_exports.string().optional(),
|
|
15428
|
+
expiresAt: external_exports.string().optional(),
|
|
15429
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
15430
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
15431
|
+
external_exports.strictObject({
|
|
15432
|
+
...field,
|
|
15433
|
+
type: external_exports.literal("choice"),
|
|
15434
|
+
multiple: external_exports.boolean(),
|
|
15435
|
+
allowOther: external_exports.boolean(),
|
|
15436
|
+
options: external_exports.array(external_exports.strictObject({
|
|
15437
|
+
value: external_exports.string().min(1),
|
|
15438
|
+
label: external_exports.string(),
|
|
15439
|
+
description: external_exports.string().optional()
|
|
15440
|
+
})).min(1)
|
|
15441
|
+
}),
|
|
15442
|
+
external_exports.strictObject({
|
|
15443
|
+
...field,
|
|
15444
|
+
type: external_exports.literal("text"),
|
|
15445
|
+
multiline: external_exports.boolean(),
|
|
15446
|
+
secret: external_exports.literal(false),
|
|
15447
|
+
placeholder: external_exports.string().optional(),
|
|
15448
|
+
prefill: external_exports.string().optional()
|
|
15449
|
+
})
|
|
15450
|
+
])).min(1)
|
|
15451
|
+
});
|
|
15452
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
15453
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
15454
|
+
});
|
|
15455
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
15456
|
+
threadId: hostThreadIdSchema,
|
|
15457
|
+
interactionId: hostInteractionIdSchema,
|
|
15458
|
+
turnId: hostTurnIdSchema,
|
|
15459
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
15460
|
+
cancelled: external_exports.boolean().optional()
|
|
15461
|
+
});
|
|
15462
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
15463
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
15464
|
+
threadId: hostThreadIdSchema,
|
|
15465
|
+
interactionId: hostInteractionIdSchema,
|
|
15466
|
+
turnId: hostTurnIdSchema
|
|
15467
|
+
});
|
|
15468
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
15469
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
15470
|
+
});
|
|
15471
|
+
|
|
15416
15472
|
// ../../shared-contracts/dist/idle-release.js
|
|
15417
15473
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
15418
15474
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
@@ -16940,6 +16996,9 @@ function validateHostQuestionResponse(interaction, response) {
|
|
|
16940
16996
|
}
|
|
16941
16997
|
for (const question of interaction.questions) {
|
|
16942
16998
|
const answers = response.answers[question.id] ?? [];
|
|
16999
|
+
if (new Set(answers).size !== answers.length) {
|
|
17000
|
+
return invalidRequest2("Question Response contains duplicate answers");
|
|
17001
|
+
}
|
|
16943
17002
|
if (!question.optional && answers.length === 0) {
|
|
16944
17003
|
return invalidRequest2("Question Response omits a required answer");
|
|
16945
17004
|
}
|
|
@@ -17081,26 +17140,26 @@ function parseHostUsage(value) {
|
|
|
17081
17140
|
}
|
|
17082
17141
|
}
|
|
17083
17142
|
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
17084
|
-
for (const
|
|
17143
|
+
for (const field2 of [
|
|
17085
17144
|
"totalCredits",
|
|
17086
17145
|
"contextUsagePercent",
|
|
17087
17146
|
"apiOutputTokensPerSecond"
|
|
17088
17147
|
]) {
|
|
17089
|
-
const candidate = value[
|
|
17148
|
+
const candidate = value[field2];
|
|
17090
17149
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
17091
|
-
throw new Error(`Harness Usage '${
|
|
17150
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
17092
17151
|
}
|
|
17093
17152
|
}
|
|
17094
|
-
for (const
|
|
17095
|
-
const candidate = value[
|
|
17153
|
+
for (const field2 of tokenFields) {
|
|
17154
|
+
const candidate = value[field2];
|
|
17096
17155
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
17097
|
-
throw new Error(`Harness Usage '${
|
|
17156
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
17098
17157
|
}
|
|
17099
17158
|
}
|
|
17100
|
-
for (const
|
|
17101
|
-
const candidate = value[
|
|
17159
|
+
for (const field2 of safeIntegerFields) {
|
|
17160
|
+
const candidate = value[field2];
|
|
17102
17161
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
17103
|
-
throw new Error(`Harness Usage '${
|
|
17162
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
17104
17163
|
}
|
|
17105
17164
|
}
|
|
17106
17165
|
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
@@ -17109,10 +17168,10 @@ function parseHostUsage(value) {
|
|
|
17109
17168
|
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
17110
17169
|
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
17111
17170
|
}
|
|
17112
|
-
for (const
|
|
17113
|
-
const candidate = value[
|
|
17171
|
+
for (const field2 of percentFields) {
|
|
17172
|
+
const candidate = value[field2];
|
|
17114
17173
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
|
|
17115
|
-
throw new Error(`Harness Usage '${
|
|
17174
|
+
throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
|
|
17116
17175
|
}
|
|
17117
17176
|
}
|
|
17118
17177
|
if (value.sessionCacheUsage !== void 0) {
|
|
@@ -17183,19 +17242,19 @@ function parseHostUsageRequest(value) {
|
|
|
17183
17242
|
if (typeof value.requestId !== "string" || value.requestId.length === 0) {
|
|
17184
17243
|
throw new Error("Harness Usage request 'requestId' must be a non-empty string");
|
|
17185
17244
|
}
|
|
17186
|
-
for (const
|
|
17187
|
-
const candidate = value[
|
|
17245
|
+
for (const field2 of ["model", "provider"]) {
|
|
17246
|
+
const candidate = value[field2];
|
|
17188
17247
|
if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
|
|
17189
|
-
throw new Error(`Harness Usage request '${
|
|
17248
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
|
|
17190
17249
|
}
|
|
17191
17250
|
}
|
|
17192
17251
|
if (value.historical !== void 0 && typeof value.historical !== "boolean") {
|
|
17193
17252
|
throw new Error("Harness Usage request 'historical' must be a boolean");
|
|
17194
17253
|
}
|
|
17195
|
-
for (const
|
|
17196
|
-
const candidate = value[
|
|
17254
|
+
for (const field2 of requestTokenFields) {
|
|
17255
|
+
const candidate = value[field2];
|
|
17197
17256
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
17198
|
-
throw new Error(`Harness Usage request '${
|
|
17257
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
|
|
17199
17258
|
}
|
|
17200
17259
|
}
|
|
17201
17260
|
if (value.inputTokens === void 0 || value.outputTokens === void 0) {
|
|
@@ -20573,9 +20632,9 @@ function outputText(output) {
|
|
|
20573
20632
|
function stringField2(value, key) {
|
|
20574
20633
|
if (!isRecord10(value))
|
|
20575
20634
|
return void 0;
|
|
20576
|
-
const
|
|
20577
|
-
if (typeof
|
|
20578
|
-
return
|
|
20635
|
+
const field2 = value[key];
|
|
20636
|
+
if (typeof field2 === "string" && field2.length > 0)
|
|
20637
|
+
return field2;
|
|
20579
20638
|
if (isRecord10(value.input)) {
|
|
20580
20639
|
const nested = value.input[key];
|
|
20581
20640
|
if (typeof nested === "string" && nested.length > 0)
|
|
@@ -20591,8 +20650,8 @@ function stringField2(value, key) {
|
|
|
20591
20650
|
function numberField(value, key) {
|
|
20592
20651
|
if (!isRecord10(value))
|
|
20593
20652
|
return void 0;
|
|
20594
|
-
const
|
|
20595
|
-
return typeof
|
|
20653
|
+
const field2 = value[key];
|
|
20654
|
+
return typeof field2 === "number" || field2 === null ? field2 : void 0;
|
|
20596
20655
|
}
|
|
20597
20656
|
function stripDiffPrefix(pathString) {
|
|
20598
20657
|
if (typeof pathString !== "string" || pathString.length === 0)
|
|
@@ -20631,9 +20690,9 @@ function nestedToolString(value, keys) {
|
|
|
20631
20690
|
if (!isRecord10(value))
|
|
20632
20691
|
return void 0;
|
|
20633
20692
|
for (const key of keys) {
|
|
20634
|
-
const
|
|
20635
|
-
if (typeof
|
|
20636
|
-
return
|
|
20693
|
+
const field2 = value[key];
|
|
20694
|
+
if (typeof field2 === "string" && field2.length > 0)
|
|
20695
|
+
return field2;
|
|
20637
20696
|
}
|
|
20638
20697
|
for (const wrapper of ["input", "arguments", "params", "details"]) {
|
|
20639
20698
|
const nested = nestedToolString(value[wrapper], keys);
|
|
@@ -20646,15 +20705,15 @@ function patchFromResult(result) {
|
|
|
20646
20705
|
if (!isRecord10(result))
|
|
20647
20706
|
return void 0;
|
|
20648
20707
|
for (const key of ["patch", "diff", "unifiedDiff"]) {
|
|
20649
|
-
const
|
|
20650
|
-
if (typeof
|
|
20651
|
-
return
|
|
20708
|
+
const field2 = result[key];
|
|
20709
|
+
if (typeof field2 === "string" && field2.length > 0)
|
|
20710
|
+
return field2;
|
|
20652
20711
|
}
|
|
20653
20712
|
if (isRecord10(result.details)) {
|
|
20654
20713
|
for (const key of ["patch", "diff", "unifiedDiff"]) {
|
|
20655
|
-
const
|
|
20656
|
-
if (typeof
|
|
20657
|
-
return
|
|
20714
|
+
const field2 = result.details[key];
|
|
20715
|
+
if (typeof field2 === "string" && field2.length > 0)
|
|
20716
|
+
return field2;
|
|
20658
20717
|
}
|
|
20659
20718
|
}
|
|
20660
20719
|
return void 0;
|