@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
|
@@ -16026,10 +16026,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
16026
16026
|
const shape = def.shape;
|
|
16027
16027
|
const propValues = {};
|
|
16028
16028
|
for (const key in shape) {
|
|
16029
|
-
const
|
|
16030
|
-
if (
|
|
16029
|
+
const field2 = shape[key]._zod;
|
|
16030
|
+
if (field2.values) {
|
|
16031
16031
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
16032
|
-
for (const v3 of
|
|
16032
|
+
for (const v3 of field2.values)
|
|
16033
16033
|
propValues[key].add(v3);
|
|
16034
16034
|
}
|
|
16035
16035
|
}
|
|
@@ -27856,6 +27856,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
27856
27856
|
// ../../shared-contracts/dist/version.js
|
|
27857
27857
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
27858
27858
|
|
|
27859
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
27860
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
27861
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
27862
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
27863
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
27864
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
27865
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
27866
|
+
});
|
|
27867
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
27868
|
+
interactionId: hostInteractionIdSchema,
|
|
27869
|
+
turnId: hostTurnIdSchema,
|
|
27870
|
+
title: external_exports.string().optional(),
|
|
27871
|
+
expiresAt: external_exports.string().optional(),
|
|
27872
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
27873
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
27874
|
+
external_exports.strictObject({
|
|
27875
|
+
...field,
|
|
27876
|
+
type: external_exports.literal("choice"),
|
|
27877
|
+
multiple: external_exports.boolean(),
|
|
27878
|
+
allowOther: external_exports.boolean(),
|
|
27879
|
+
options: external_exports.array(external_exports.strictObject({
|
|
27880
|
+
value: external_exports.string().min(1),
|
|
27881
|
+
label: external_exports.string(),
|
|
27882
|
+
description: external_exports.string().optional()
|
|
27883
|
+
})).min(1)
|
|
27884
|
+
}),
|
|
27885
|
+
external_exports.strictObject({
|
|
27886
|
+
...field,
|
|
27887
|
+
type: external_exports.literal("text"),
|
|
27888
|
+
multiline: external_exports.boolean(),
|
|
27889
|
+
secret: external_exports.literal(false),
|
|
27890
|
+
placeholder: external_exports.string().optional(),
|
|
27891
|
+
prefill: external_exports.string().optional()
|
|
27892
|
+
})
|
|
27893
|
+
])).min(1)
|
|
27894
|
+
});
|
|
27895
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
27896
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
27897
|
+
});
|
|
27898
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
27899
|
+
threadId: hostThreadIdSchema,
|
|
27900
|
+
interactionId: hostInteractionIdSchema,
|
|
27901
|
+
turnId: hostTurnIdSchema,
|
|
27902
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
27903
|
+
cancelled: external_exports.boolean().optional()
|
|
27904
|
+
});
|
|
27905
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
27906
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
27907
|
+
threadId: hostThreadIdSchema,
|
|
27908
|
+
interactionId: hostInteractionIdSchema,
|
|
27909
|
+
turnId: hostTurnIdSchema
|
|
27910
|
+
});
|
|
27911
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
27912
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
27913
|
+
});
|
|
27914
|
+
|
|
27859
27915
|
// ../../shared-contracts/dist/idle-release.js
|
|
27860
27916
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
27861
27917
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
@@ -29344,6 +29400,9 @@ function validateHostQuestionResponse(interaction, response) {
|
|
|
29344
29400
|
}
|
|
29345
29401
|
for (const question of interaction.questions) {
|
|
29346
29402
|
const answers = response.answers[question.id] ?? [];
|
|
29403
|
+
if (new Set(answers).size !== answers.length) {
|
|
29404
|
+
return invalidRequest2("Question Response contains duplicate answers");
|
|
29405
|
+
}
|
|
29347
29406
|
if (!question.optional && answers.length === 0) {
|
|
29348
29407
|
return invalidRequest2("Question Response omits a required answer");
|
|
29349
29408
|
}
|
|
@@ -29476,26 +29535,26 @@ function parseHostUsage(value) {
|
|
|
29476
29535
|
}
|
|
29477
29536
|
}
|
|
29478
29537
|
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
29479
|
-
for (const
|
|
29538
|
+
for (const field2 of [
|
|
29480
29539
|
"totalCredits",
|
|
29481
29540
|
"contextUsagePercent",
|
|
29482
29541
|
"apiOutputTokensPerSecond"
|
|
29483
29542
|
]) {
|
|
29484
|
-
const candidate = value[
|
|
29543
|
+
const candidate = value[field2];
|
|
29485
29544
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
29486
|
-
throw new Error(`Harness Usage '${
|
|
29545
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
29487
29546
|
}
|
|
29488
29547
|
}
|
|
29489
|
-
for (const
|
|
29490
|
-
const candidate = value[
|
|
29548
|
+
for (const field2 of tokenFields) {
|
|
29549
|
+
const candidate = value[field2];
|
|
29491
29550
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
29492
|
-
throw new Error(`Harness Usage '${
|
|
29551
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
29493
29552
|
}
|
|
29494
29553
|
}
|
|
29495
|
-
for (const
|
|
29496
|
-
const candidate = value[
|
|
29554
|
+
for (const field2 of safeIntegerFields) {
|
|
29555
|
+
const candidate = value[field2];
|
|
29497
29556
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
29498
|
-
throw new Error(`Harness Usage '${
|
|
29557
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
29499
29558
|
}
|
|
29500
29559
|
}
|
|
29501
29560
|
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
@@ -29504,10 +29563,10 @@ function parseHostUsage(value) {
|
|
|
29504
29563
|
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
29505
29564
|
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
29506
29565
|
}
|
|
29507
|
-
for (const
|
|
29508
|
-
const candidate = value[
|
|
29566
|
+
for (const field2 of percentFields) {
|
|
29567
|
+
const candidate = value[field2];
|
|
29509
29568
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
|
|
29510
|
-
throw new Error(`Harness Usage '${
|
|
29569
|
+
throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
|
|
29511
29570
|
}
|
|
29512
29571
|
}
|
|
29513
29572
|
if (value.sessionCacheUsage !== void 0) {
|
|
@@ -39326,11 +39385,11 @@ var McpServer = class {
|
|
|
39326
39385
|
return EMPTY_COMPLETION_RESULT;
|
|
39327
39386
|
}
|
|
39328
39387
|
const promptShape = getObjectShape(prompt.argsSchema);
|
|
39329
|
-
const
|
|
39330
|
-
if (!isCompletable(
|
|
39388
|
+
const field2 = promptShape?.[request.params.argument.name];
|
|
39389
|
+
if (!isCompletable(field2)) {
|
|
39331
39390
|
return EMPTY_COMPLETION_RESULT;
|
|
39332
39391
|
}
|
|
39333
|
-
const completer = getCompleter(
|
|
39392
|
+
const completer = getCompleter(field2);
|
|
39334
39393
|
if (!completer) {
|
|
39335
39394
|
return EMPTY_COMPLETION_RESULT;
|
|
39336
39395
|
}
|
|
@@ -39603,8 +39662,8 @@ var McpServer = class {
|
|
|
39603
39662
|
};
|
|
39604
39663
|
this._registeredPrompts[name] = registeredPrompt;
|
|
39605
39664
|
if (argsSchema) {
|
|
39606
|
-
const hasCompletable = Object.values(argsSchema).some((
|
|
39607
|
-
const inner =
|
|
39665
|
+
const hasCompletable = Object.values(argsSchema).some((field2) => {
|
|
39666
|
+
const inner = field2 instanceof ZodOptional ? field2._def?.innerType : field2;
|
|
39608
39667
|
return isCompletable(inner);
|
|
39609
39668
|
});
|
|
39610
39669
|
if (hasCompletable) {
|
|
@@ -39813,9 +39872,9 @@ function promptArgumentsFromSchema(schema) {
|
|
|
39813
39872
|
const shape = getObjectShape(schema);
|
|
39814
39873
|
if (!shape)
|
|
39815
39874
|
return [];
|
|
39816
|
-
return Object.entries(shape).map(([name,
|
|
39817
|
-
const description = getSchemaDescription(
|
|
39818
|
-
const isOptional = isSchemaOptional(
|
|
39875
|
+
return Object.entries(shape).map(([name, field2]) => {
|
|
39876
|
+
const description = getSchemaDescription(field2);
|
|
39877
|
+
const isOptional = isSchemaOptional(field2);
|
|
39819
39878
|
return {
|
|
39820
39879
|
name,
|
|
39821
39880
|
description,
|
|
@@ -53191,13 +53250,13 @@ function parseHarnessUsageEntry(value) {
|
|
|
53191
53250
|
}
|
|
53192
53251
|
if (!tokenCount(entry.inputTokens) || !tokenCount(entry.outputTokens))
|
|
53193
53252
|
return null;
|
|
53194
|
-
for (const
|
|
53253
|
+
for (const field2 of [
|
|
53195
53254
|
"cachedInputTokens",
|
|
53196
53255
|
"cacheWriteInputTokens",
|
|
53197
53256
|
"cacheWrite1hInputTokens",
|
|
53198
53257
|
"reasoningOutputTokens"
|
|
53199
53258
|
]) {
|
|
53200
|
-
if (entry[
|
|
53259
|
+
if (entry[field2] !== void 0 && !tokenCount(entry[field2]))
|
|
53201
53260
|
return null;
|
|
53202
53261
|
}
|
|
53203
53262
|
const cached2 = entry.cachedInputTokens ?? 0;
|
|
@@ -15623,10 +15623,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
15623
15623
|
const shape = def.shape;
|
|
15624
15624
|
const propValues = {};
|
|
15625
15625
|
for (const key in shape) {
|
|
15626
|
-
const
|
|
15627
|
-
if (
|
|
15626
|
+
const field2 = shape[key]._zod;
|
|
15627
|
+
if (field2.values) {
|
|
15628
15628
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
15629
|
-
for (const v3 of
|
|
15629
|
+
for (const v3 of field2.values)
|
|
15630
15630
|
propValues[key].add(v3);
|
|
15631
15631
|
}
|
|
15632
15632
|
}
|
|
@@ -27453,6 +27453,62 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
27453
27453
|
// ../../shared-contracts/dist/version.js
|
|
27454
27454
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
27455
27455
|
|
|
27456
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
27457
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
27458
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
27459
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
27460
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
27461
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
27462
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
27463
|
+
});
|
|
27464
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
27465
|
+
interactionId: hostInteractionIdSchema,
|
|
27466
|
+
turnId: hostTurnIdSchema,
|
|
27467
|
+
title: external_exports.string().optional(),
|
|
27468
|
+
expiresAt: external_exports.string().optional(),
|
|
27469
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
27470
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
27471
|
+
external_exports.strictObject({
|
|
27472
|
+
...field,
|
|
27473
|
+
type: external_exports.literal("choice"),
|
|
27474
|
+
multiple: external_exports.boolean(),
|
|
27475
|
+
allowOther: external_exports.boolean(),
|
|
27476
|
+
options: external_exports.array(external_exports.strictObject({
|
|
27477
|
+
value: external_exports.string().min(1),
|
|
27478
|
+
label: external_exports.string(),
|
|
27479
|
+
description: external_exports.string().optional()
|
|
27480
|
+
})).min(1)
|
|
27481
|
+
}),
|
|
27482
|
+
external_exports.strictObject({
|
|
27483
|
+
...field,
|
|
27484
|
+
type: external_exports.literal("text"),
|
|
27485
|
+
multiline: external_exports.boolean(),
|
|
27486
|
+
secret: external_exports.literal(false),
|
|
27487
|
+
placeholder: external_exports.string().optional(),
|
|
27488
|
+
prefill: external_exports.string().optional()
|
|
27489
|
+
})
|
|
27490
|
+
])).min(1)
|
|
27491
|
+
});
|
|
27492
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
27493
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
27494
|
+
});
|
|
27495
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
27496
|
+
threadId: hostThreadIdSchema,
|
|
27497
|
+
interactionId: hostInteractionIdSchema,
|
|
27498
|
+
turnId: hostTurnIdSchema,
|
|
27499
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
27500
|
+
cancelled: external_exports.boolean().optional()
|
|
27501
|
+
});
|
|
27502
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
27503
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
27504
|
+
threadId: hostThreadIdSchema,
|
|
27505
|
+
interactionId: hostInteractionIdSchema,
|
|
27506
|
+
turnId: hostTurnIdSchema
|
|
27507
|
+
});
|
|
27508
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
27509
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
27510
|
+
});
|
|
27511
|
+
|
|
27456
27512
|
// ../../shared-contracts/dist/idle-release.js
|
|
27457
27513
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
27458
27514
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
@@ -29346,6 +29402,9 @@ function validateHostQuestionResponse(interaction, response) {
|
|
|
29346
29402
|
}
|
|
29347
29403
|
for (const question of interaction.questions) {
|
|
29348
29404
|
const answers = response.answers[question.id] ?? [];
|
|
29405
|
+
if (new Set(answers).size !== answers.length) {
|
|
29406
|
+
return invalidRequest2("Question Response contains duplicate answers");
|
|
29407
|
+
}
|
|
29349
29408
|
if (!question.optional && answers.length === 0) {
|
|
29350
29409
|
return invalidRequest2("Question Response omits a required answer");
|
|
29351
29410
|
}
|
|
@@ -29478,26 +29537,26 @@ function parseHostUsage(value) {
|
|
|
29478
29537
|
}
|
|
29479
29538
|
}
|
|
29480
29539
|
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
29481
|
-
for (const
|
|
29540
|
+
for (const field2 of [
|
|
29482
29541
|
"totalCredits",
|
|
29483
29542
|
"contextUsagePercent",
|
|
29484
29543
|
"apiOutputTokensPerSecond"
|
|
29485
29544
|
]) {
|
|
29486
|
-
const candidate = value[
|
|
29545
|
+
const candidate = value[field2];
|
|
29487
29546
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
29488
|
-
throw new Error(`Harness Usage '${
|
|
29547
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
29489
29548
|
}
|
|
29490
29549
|
}
|
|
29491
|
-
for (const
|
|
29492
|
-
const candidate = value[
|
|
29550
|
+
for (const field2 of tokenFields) {
|
|
29551
|
+
const candidate = value[field2];
|
|
29493
29552
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
29494
|
-
throw new Error(`Harness Usage '${
|
|
29553
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
29495
29554
|
}
|
|
29496
29555
|
}
|
|
29497
|
-
for (const
|
|
29498
|
-
const candidate = value[
|
|
29556
|
+
for (const field2 of safeIntegerFields) {
|
|
29557
|
+
const candidate = value[field2];
|
|
29499
29558
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
29500
|
-
throw new Error(`Harness Usage '${
|
|
29559
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
29501
29560
|
}
|
|
29502
29561
|
}
|
|
29503
29562
|
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
@@ -29506,10 +29565,10 @@ function parseHostUsage(value) {
|
|
|
29506
29565
|
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
29507
29566
|
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
29508
29567
|
}
|
|
29509
|
-
for (const
|
|
29510
|
-
const candidate = value[
|
|
29568
|
+
for (const field2 of percentFields) {
|
|
29569
|
+
const candidate = value[field2];
|
|
29511
29570
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
|
|
29512
|
-
throw new Error(`Harness Usage '${
|
|
29571
|
+
throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
|
|
29513
29572
|
}
|
|
29514
29573
|
}
|
|
29515
29574
|
if (value.sessionCacheUsage !== void 0) {
|
|
@@ -39328,11 +39387,11 @@ var McpServer = class {
|
|
|
39328
39387
|
return EMPTY_COMPLETION_RESULT;
|
|
39329
39388
|
}
|
|
39330
39389
|
const promptShape = getObjectShape(prompt.argsSchema);
|
|
39331
|
-
const
|
|
39332
|
-
if (!isCompletable(
|
|
39390
|
+
const field2 = promptShape?.[request.params.argument.name];
|
|
39391
|
+
if (!isCompletable(field2)) {
|
|
39333
39392
|
return EMPTY_COMPLETION_RESULT;
|
|
39334
39393
|
}
|
|
39335
|
-
const completer = getCompleter(
|
|
39394
|
+
const completer = getCompleter(field2);
|
|
39336
39395
|
if (!completer) {
|
|
39337
39396
|
return EMPTY_COMPLETION_RESULT;
|
|
39338
39397
|
}
|
|
@@ -39605,8 +39664,8 @@ var McpServer = class {
|
|
|
39605
39664
|
};
|
|
39606
39665
|
this._registeredPrompts[name] = registeredPrompt;
|
|
39607
39666
|
if (argsSchema) {
|
|
39608
|
-
const hasCompletable = Object.values(argsSchema).some((
|
|
39609
|
-
const inner =
|
|
39667
|
+
const hasCompletable = Object.values(argsSchema).some((field2) => {
|
|
39668
|
+
const inner = field2 instanceof ZodOptional ? field2._def?.innerType : field2;
|
|
39610
39669
|
return isCompletable(inner);
|
|
39611
39670
|
});
|
|
39612
39671
|
if (hasCompletable) {
|
|
@@ -39815,9 +39874,9 @@ function promptArgumentsFromSchema(schema) {
|
|
|
39815
39874
|
const shape = getObjectShape(schema);
|
|
39816
39875
|
if (!shape)
|
|
39817
39876
|
return [];
|
|
39818
|
-
return Object.entries(shape).map(([name,
|
|
39819
|
-
const description = getSchemaDescription(
|
|
39820
|
-
const isOptional = isSchemaOptional(
|
|
39877
|
+
return Object.entries(shape).map(([name, field2]) => {
|
|
39878
|
+
const description = getSchemaDescription(field2);
|
|
39879
|
+
const isOptional = isSchemaOptional(field2);
|
|
39821
39880
|
return {
|
|
39822
39881
|
name,
|
|
39823
39882
|
description,
|
|
@@ -53193,13 +53252,13 @@ function parseHarnessUsageEntry(value) {
|
|
|
53193
53252
|
}
|
|
53194
53253
|
if (!tokenCount(entry.inputTokens) || !tokenCount(entry.outputTokens))
|
|
53195
53254
|
return null;
|
|
53196
|
-
for (const
|
|
53255
|
+
for (const field2 of [
|
|
53197
53256
|
"cachedInputTokens",
|
|
53198
53257
|
"cacheWriteInputTokens",
|
|
53199
53258
|
"cacheWrite1hInputTokens",
|
|
53200
53259
|
"reasoningOutputTokens"
|
|
53201
53260
|
]) {
|
|
53202
|
-
if (entry[
|
|
53261
|
+
if (entry[field2] !== void 0 && !tokenCount(entry[field2]))
|
|
53203
53262
|
return null;
|
|
53204
53263
|
}
|
|
53205
53264
|
const cached2 = entry.cachedInputTokens ?? 0;
|
|
@@ -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
|
}
|
|
@@ -16239,26 +16298,26 @@ function parseHostUsage(value) {
|
|
|
16239
16298
|
}
|
|
16240
16299
|
}
|
|
16241
16300
|
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
16242
|
-
for (const
|
|
16301
|
+
for (const field2 of [
|
|
16243
16302
|
"totalCredits",
|
|
16244
16303
|
"contextUsagePercent",
|
|
16245
16304
|
"apiOutputTokensPerSecond"
|
|
16246
16305
|
]) {
|
|
16247
|
-
const candidate = value[
|
|
16306
|
+
const candidate = value[field2];
|
|
16248
16307
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
16249
|
-
throw new Error(`Harness Usage '${
|
|
16308
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
16250
16309
|
}
|
|
16251
16310
|
}
|
|
16252
|
-
for (const
|
|
16253
|
-
const candidate = value[
|
|
16311
|
+
for (const field2 of tokenFields) {
|
|
16312
|
+
const candidate = value[field2];
|
|
16254
16313
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16255
|
-
throw new Error(`Harness Usage '${
|
|
16314
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
16256
16315
|
}
|
|
16257
16316
|
}
|
|
16258
|
-
for (const
|
|
16259
|
-
const candidate = value[
|
|
16317
|
+
for (const field2 of safeIntegerFields) {
|
|
16318
|
+
const candidate = value[field2];
|
|
16260
16319
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16261
|
-
throw new Error(`Harness Usage '${
|
|
16320
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
16262
16321
|
}
|
|
16263
16322
|
}
|
|
16264
16323
|
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
@@ -16267,10 +16326,10 @@ function parseHostUsage(value) {
|
|
|
16267
16326
|
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
16268
16327
|
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
16269
16328
|
}
|
|
16270
|
-
for (const
|
|
16271
|
-
const candidate = value[
|
|
16329
|
+
for (const field2 of percentFields) {
|
|
16330
|
+
const candidate = value[field2];
|
|
16272
16331
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
|
|
16273
|
-
throw new Error(`Harness Usage '${
|
|
16332
|
+
throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
|
|
16274
16333
|
}
|
|
16275
16334
|
}
|
|
16276
16335
|
if (value.sessionCacheUsage !== void 0) {
|
|
@@ -16341,19 +16400,19 @@ function parseHostUsageRequest(value) {
|
|
|
16341
16400
|
if (typeof value.requestId !== "string" || value.requestId.length === 0) {
|
|
16342
16401
|
throw new Error("Harness Usage request 'requestId' must be a non-empty string");
|
|
16343
16402
|
}
|
|
16344
|
-
for (const
|
|
16345
|
-
const candidate = value[
|
|
16403
|
+
for (const field2 of ["model", "provider"]) {
|
|
16404
|
+
const candidate = value[field2];
|
|
16346
16405
|
if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
|
|
16347
|
-
throw new Error(`Harness Usage request '${
|
|
16406
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
|
|
16348
16407
|
}
|
|
16349
16408
|
}
|
|
16350
16409
|
if (value.historical !== void 0 && typeof value.historical !== "boolean") {
|
|
16351
16410
|
throw new Error("Harness Usage request 'historical' must be a boolean");
|
|
16352
16411
|
}
|
|
16353
|
-
for (const
|
|
16354
|
-
const candidate = value[
|
|
16412
|
+
for (const field2 of requestTokenFields) {
|
|
16413
|
+
const candidate = value[field2];
|
|
16355
16414
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16356
|
-
throw new Error(`Harness Usage request '${
|
|
16415
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
|
|
16357
16416
|
}
|
|
16358
16417
|
}
|
|
16359
16418
|
if (value.inputTokens === void 0 || value.outputTokens === void 0) {
|