@liberseek/boft-cli-win32-arm64 0.8.3 → 0.8.5
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 +117 -13
- package/app/console-web.js +713 -129
- package/app/desktop-controller.mjs +713 -42
- package/app/host-runtime.mjs +2535 -855
- package/app/plugins/antigravity/plugin.mjs +437 -67
- package/app/plugins/claude-code/plugin.mjs +758 -248
- package/app/plugins/codebuddy/plugin.mjs +348 -156
- package/app/plugins/codex-usage/plugin.mjs +258 -106
- package/app/plugins/copilot/assets/icon.png +0 -0
- package/app/plugins/copilot/manifest.json +26 -0
- package/app/plugins/copilot/plugin.mjs +34651 -0
- package/app/plugins/cursor-cli/plugin.mjs +20905 -44961
- package/app/plugins/deepseek-harness/plugin.mjs +195 -53
- package/app/plugins/enabled.json +1 -0
- package/app/plugins/grok/plugin.mjs +584 -138
- package/app/plugins/hermes/plugin.mjs +134 -13
- package/app/plugins/kimi-code/plugin.mjs +145 -26
- package/app/plugins/kiro-cli/plugin.mjs +145 -26
- package/app/plugins/muse/plugin.mjs +132 -14
- package/app/plugins/omp/plugin.mjs +2245 -2040
- package/app/plugins/opencode/plugin.mjs +196 -72
- package/app/plugins/pi/plugin.mjs +2643 -2309
- package/app/plugins/qoder/plugin.mjs +162 -40
- package/app/plugins/qoder-cn/plugin.mjs +162 -40
- package/app/plugins/workbuddy/plugin.mjs +609 -180
- package/app/plugins/zcode/plugin.mjs +192 -44
- package/app/renderer-extension.js +3405 -429
- package/bin/boft.exe +0 -0
- package/libexec/boft-node-repl.exe +0 -0
- package/libexec/boft-shim.exe +0 -0
- package/libexec/boft-updater.exe +0 -0
- package/package.json +1 -1
|
@@ -504,10 +504,13 @@ function usageSessionTitle(value) {
|
|
|
504
504
|
return void 0;
|
|
505
505
|
if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
|
|
506
506
|
return normalized;
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
507
|
+
let title = "";
|
|
508
|
+
for (const character of normalized) {
|
|
509
|
+
if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
|
|
510
|
+
break;
|
|
511
|
+
title += character;
|
|
512
|
+
}
|
|
513
|
+
return `${title.trimEnd()}…`;
|
|
511
514
|
}
|
|
512
515
|
function sessionIdOk(value) {
|
|
513
516
|
return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
|
|
@@ -3577,10 +3580,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3577
3580
|
const shape = def.shape;
|
|
3578
3581
|
const propValues = {};
|
|
3579
3582
|
for (const key in shape) {
|
|
3580
|
-
const
|
|
3581
|
-
if (
|
|
3583
|
+
const field2 = shape[key]._zod;
|
|
3584
|
+
if (field2.values) {
|
|
3582
3585
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3583
|
-
for (const v of
|
|
3586
|
+
for (const v of field2.values)
|
|
3584
3587
|
propValues[key].add(v);
|
|
3585
3588
|
}
|
|
3586
3589
|
}
|
|
@@ -15199,10 +15202,19 @@ var model = external_exports.string().min(1).max(512);
|
|
|
15199
15202
|
var project = external_exports.string().min(1).max(4096);
|
|
15200
15203
|
var usageStatisticsParamsSchema = external_exports.strictObject({
|
|
15201
15204
|
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
15205
|
+
/** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
|
|
15206
|
+
timeZone: external_exports.string().min(1).max(128).refine((value) => {
|
|
15207
|
+
try {
|
|
15208
|
+
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
15209
|
+
return true;
|
|
15210
|
+
} catch {
|
|
15211
|
+
return false;
|
|
15212
|
+
}
|
|
15213
|
+
}, "Unsupported usage statistics timezone").optional(),
|
|
15202
15214
|
harness: harness.optional(),
|
|
15203
15215
|
model: model.nullable().optional(),
|
|
15204
15216
|
project: project.nullable().optional(),
|
|
15205
|
-
/** One
|
|
15217
|
+
/** One date in the query timezone inside the range. */
|
|
15206
15218
|
date: localDate.optional()
|
|
15207
15219
|
});
|
|
15208
15220
|
var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
@@ -15211,6 +15223,8 @@ var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
|
15211
15223
|
cachedInputTokens: count,
|
|
15212
15224
|
cacheWriteInputTokens: count,
|
|
15213
15225
|
cacheKnownInputTokens: count,
|
|
15226
|
+
cacheHitCachedInputTokens: count,
|
|
15227
|
+
cacheHitInputTokens: count,
|
|
15214
15228
|
outputTokens: count,
|
|
15215
15229
|
reasoningOutputTokens: count,
|
|
15216
15230
|
/** USD at the public price, summed over the priced requests only. */
|
|
@@ -15238,7 +15252,7 @@ var usageStatisticsSessionSchema = external_exports.strictObject({
|
|
|
15238
15252
|
});
|
|
15239
15253
|
var usageStatisticsResultSchema = external_exports.strictObject({
|
|
15240
15254
|
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
15241
|
-
/** First
|
|
15255
|
+
/** First date in the query timezone (Host local when omitted); null for all time. */
|
|
15242
15256
|
from: localDate.nullable(),
|
|
15243
15257
|
to: localDate,
|
|
15244
15258
|
/** The filters these figures apply, echoed so a late answer to older filters is recognised. */
|
|
@@ -15278,7 +15292,7 @@ var usageStatisticsResultSchema = external_exports.strictObject({
|
|
|
15278
15292
|
totals: usageStatisticsTotalsSchema,
|
|
15279
15293
|
/** Each date and Harness of the range: every filter except the day. */
|
|
15280
15294
|
daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
|
|
15281
|
-
/**
|
|
15295
|
+
/** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
|
|
15282
15296
|
hourly: external_exports.array(external_exports.strictObject({
|
|
15283
15297
|
weekday: external_exports.number().int().min(0).max(6),
|
|
15284
15298
|
hour: external_exports.number().int().min(0).max(23),
|
|
@@ -15318,6 +15332,51 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
15318
15332
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
15319
15333
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
15320
15334
|
|
|
15335
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
15336
|
+
var field = external_exports.discriminatedUnion("type", [
|
|
15337
|
+
external_exports.object({
|
|
15338
|
+
id: external_exports.string().min(1),
|
|
15339
|
+
type: external_exports.literal("choice"),
|
|
15340
|
+
prompt: external_exports.string(),
|
|
15341
|
+
options: external_exports.array(external_exports.object({
|
|
15342
|
+
value: external_exports.string().min(1),
|
|
15343
|
+
label: external_exports.string(),
|
|
15344
|
+
description: external_exports.string().optional()
|
|
15345
|
+
})).min(1),
|
|
15346
|
+
multiple: external_exports.boolean(),
|
|
15347
|
+
allowOther: external_exports.boolean(),
|
|
15348
|
+
optional: external_exports.boolean()
|
|
15349
|
+
}),
|
|
15350
|
+
external_exports.object({
|
|
15351
|
+
id: external_exports.string().min(1),
|
|
15352
|
+
type: external_exports.literal("text"),
|
|
15353
|
+
prompt: external_exports.string(),
|
|
15354
|
+
multiline: external_exports.boolean(),
|
|
15355
|
+
secret: external_exports.literal(false),
|
|
15356
|
+
optional: external_exports.boolean(),
|
|
15357
|
+
placeholder: external_exports.string().optional(),
|
|
15358
|
+
prefill: external_exports.string().optional()
|
|
15359
|
+
})
|
|
15360
|
+
]);
|
|
15361
|
+
var threadQuestionSchema = external_exports.object({
|
|
15362
|
+
interactionId: external_exports.string().min(1),
|
|
15363
|
+
turnId: external_exports.string().min(1),
|
|
15364
|
+
title: external_exports.string().optional(),
|
|
15365
|
+
questions: external_exports.array(field).min(1)
|
|
15366
|
+
}).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
|
|
15367
|
+
message: "Shared cards require at least one multi-select question"
|
|
15368
|
+
});
|
|
15369
|
+
var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
|
|
15370
|
+
var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
|
|
15371
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
15372
|
+
threadId: external_exports.string().min(1),
|
|
15373
|
+
turnId: external_exports.string().min(1),
|
|
15374
|
+
interactionId: external_exports.string().min(1),
|
|
15375
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
15376
|
+
cancelled: external_exports.boolean().default(false)
|
|
15377
|
+
});
|
|
15378
|
+
var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
|
|
15379
|
+
|
|
15321
15380
|
// ../../shared-contracts/dist/harness-plugins.js
|
|
15322
15381
|
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
15323
15382
|
var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
|
|
@@ -15420,6 +15479,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
15420
15479
|
"codexhost/harness/display-settings/set",
|
|
15421
15480
|
"codexhost/harness/inspect",
|
|
15422
15481
|
"codexhost/harness/installation",
|
|
15482
|
+
"codexhost/harness/installation/start",
|
|
15483
|
+
"codexhost/harness/installation/status",
|
|
15423
15484
|
"codexhost/harness/launch-settings/get",
|
|
15424
15485
|
"codexhost/harness/launch-settings/set",
|
|
15425
15486
|
HARNESS_LONG_CONTEXT_GET_METHOD,
|
|
@@ -15497,7 +15558,18 @@ var threadManualCompactionStartedSchema = external_exports.strictObject({
|
|
|
15497
15558
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
15498
15559
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15499
15560
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15561
|
+
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
15562
|
+
var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
15563
|
+
kind: external_exports.literal("countdown"),
|
|
15564
|
+
id: external_exports.string().min(1).max(64),
|
|
15565
|
+
expiresAtUnix: nonNegativeSafeIntegerSchema,
|
|
15566
|
+
label: indicatorTextSchema(256).optional(),
|
|
15567
|
+
tooltip: indicatorTextSchema(1024).optional()
|
|
15568
|
+
}).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, {
|
|
15569
|
+
message: "Composer indicator IDs must be unique"
|
|
15570
|
+
});
|
|
15500
15571
|
var threadUsageSnapshotSchema = external_exports.object({
|
|
15572
|
+
composerIndicators: composerIndicatorsSchema.optional(),
|
|
15501
15573
|
inputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15502
15574
|
cachedInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15503
15575
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
@@ -15923,7 +15995,9 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
|
|
|
15923
15995
|
}).strict().optional(),
|
|
15924
15996
|
input: external_exports.object({
|
|
15925
15997
|
image: external_exports.boolean()
|
|
15926
|
-
}).strict().optional()
|
|
15998
|
+
}).strict().optional(),
|
|
15999
|
+
/** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
|
|
16000
|
+
steer: external_exports.boolean().optional()
|
|
15927
16001
|
}).strict();
|
|
15928
16002
|
var harnessConfigurationStateSchema = external_exports.object({
|
|
15929
16003
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
@@ -15970,7 +16044,9 @@ var harnessInspectionSchema = external_exports.union([
|
|
|
15970
16044
|
var harnessInspectParamsSchema = external_exports.object({
|
|
15971
16045
|
harnessId: harnessIdSchema,
|
|
15972
16046
|
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
15973
|
-
refresh: external_exports.boolean().optional()
|
|
16047
|
+
refresh: external_exports.boolean().optional(),
|
|
16048
|
+
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
16049
|
+
purpose: external_exports.literal("availability").optional()
|
|
15974
16050
|
}).strict();
|
|
15975
16051
|
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15976
16052
|
harnessId: harnessIdSchema
|
|
@@ -16055,13 +16131,25 @@ var threadOwnershipListResultSchema = external_exports.object({
|
|
|
16055
16131
|
seen.add(thread.threadId);
|
|
16056
16132
|
}
|
|
16057
16133
|
});
|
|
16134
|
+
var threadSteeringInspectParamsSchema = external_exports.object({
|
|
16135
|
+
threadId: hostThreadIdSchema,
|
|
16136
|
+
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
16137
|
+
text: external_exports.string().optional()
|
|
16138
|
+
}).strict();
|
|
16139
|
+
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
16140
|
+
var threadSteeringInspectResultSchema = external_exports.object({
|
|
16141
|
+
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
16142
|
+
}).strict();
|
|
16058
16143
|
|
|
16059
16144
|
// ../../shared-contracts/dist/harness-route.js
|
|
16060
16145
|
var harnessPluginRouteSchema = external_exports.object({
|
|
16061
16146
|
harnessId: harnessPluginIdSchema,
|
|
16062
16147
|
model: harnessModelRefSchema.optional(),
|
|
16063
16148
|
thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
16064
|
-
permissionModeId: harnessPermissionModeIdSchema.optional()
|
|
16149
|
+
permissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
16150
|
+
/** A draft prewarm create: stays unsubmitted until the user's first Turn.
|
|
16151
|
+
* Desktop forwards only the Model of a main-process prewarm to thread/start. */
|
|
16152
|
+
prewarm: external_exports.literal(true).optional()
|
|
16065
16153
|
}).strict();
|
|
16066
16154
|
|
|
16067
16155
|
// ../../shared-contracts/dist/harness-launch-settings.js
|
|
@@ -16087,6 +16175,10 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
16087
16175
|
latestVersion: external_exports.string().min(1).max(128),
|
|
16088
16176
|
updateAvailable: external_exports.boolean(),
|
|
16089
16177
|
canUpdate: external_exports.boolean(),
|
|
16178
|
+
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
16179
|
+
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
16180
|
+
/** Official download opened by the user; does not imply an automatic installation. */
|
|
16181
|
+
manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
|
|
16090
16182
|
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
16091
16183
|
message: external_exports.string().max(2048).optional(),
|
|
16092
16184
|
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
@@ -16094,6 +16186,20 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
16094
16186
|
notice: harnessLocalizedTextSchema.optional(),
|
|
16095
16187
|
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
16096
16188
|
}).strict();
|
|
16189
|
+
var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
|
|
16190
|
+
var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
|
|
16191
|
+
external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
|
|
16192
|
+
external_exports.object({
|
|
16193
|
+
taskId: external_exports.string().uuid(),
|
|
16194
|
+
status: external_exports.literal("succeeded"),
|
|
16195
|
+
result: harnessInstallationStateSchema
|
|
16196
|
+
}).strict(),
|
|
16197
|
+
external_exports.object({
|
|
16198
|
+
taskId: external_exports.string().uuid(),
|
|
16199
|
+
status: external_exports.literal("failed"),
|
|
16200
|
+
error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
|
|
16201
|
+
}).strict()
|
|
16202
|
+
]);
|
|
16097
16203
|
|
|
16098
16204
|
// ../../shared-contracts/dist/codex-accounts.js
|
|
16099
16205
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
@@ -16591,6 +16697,18 @@ function sanitizeDiagnosticTail(value) {
|
|
|
16591
16697
|
return redacted.length <= DIAGNOSTIC_TAIL_MAX_LENGTH ? redacted : redacted.slice(-DIAGNOSTIC_TAIL_MAX_LENGTH);
|
|
16592
16698
|
}
|
|
16593
16699
|
|
|
16700
|
+
// ../../harness-adapter/dist/steer.js
|
|
16701
|
+
function unsupportedSteer(harnessLabel) {
|
|
16702
|
+
return {
|
|
16703
|
+
ok: false,
|
|
16704
|
+
error: {
|
|
16705
|
+
code: "unsupported",
|
|
16706
|
+
message: `${harnessLabel} cannot steer an active Turn natively`,
|
|
16707
|
+
retryable: false
|
|
16708
|
+
}
|
|
16709
|
+
};
|
|
16710
|
+
}
|
|
16711
|
+
|
|
16594
16712
|
// ../../harness-adapter/dist/usage.js
|
|
16595
16713
|
var tokenFields = [
|
|
16596
16714
|
"inputTokens",
|
|
@@ -16618,6 +16736,7 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
16618
16736
|
...safeIntegerFields,
|
|
16619
16737
|
...percentFields,
|
|
16620
16738
|
"sessionCacheUsage",
|
|
16739
|
+
"composerIndicators",
|
|
16621
16740
|
"totalCostUsd",
|
|
16622
16741
|
"totalCredits",
|
|
16623
16742
|
"contextUsagePercent",
|
|
@@ -16640,26 +16759,27 @@ function parseHostUsage(value) {
|
|
|
16640
16759
|
throw new Error(`Harness Usage contains unknown field '${key}'`);
|
|
16641
16760
|
}
|
|
16642
16761
|
}
|
|
16643
|
-
|
|
16762
|
+
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
16763
|
+
for (const field2 of [
|
|
16644
16764
|
"totalCredits",
|
|
16645
16765
|
"contextUsagePercent",
|
|
16646
16766
|
"apiOutputTokensPerSecond"
|
|
16647
16767
|
]) {
|
|
16648
|
-
const candidate2 = value[
|
|
16768
|
+
const candidate2 = value[field2];
|
|
16649
16769
|
if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isFinite(candidate2) || candidate2 < 0)) {
|
|
16650
|
-
throw new Error(`Harness Usage '${
|
|
16770
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
16651
16771
|
}
|
|
16652
16772
|
}
|
|
16653
|
-
for (const
|
|
16654
|
-
const candidate2 = value[
|
|
16773
|
+
for (const field2 of tokenFields) {
|
|
16774
|
+
const candidate2 = value[field2];
|
|
16655
16775
|
if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isSafeInteger(candidate2) || candidate2 < 0)) {
|
|
16656
|
-
throw new Error(`Harness Usage '${
|
|
16776
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
16657
16777
|
}
|
|
16658
16778
|
}
|
|
16659
|
-
for (const
|
|
16660
|
-
const candidate2 = value[
|
|
16779
|
+
for (const field2 of safeIntegerFields) {
|
|
16780
|
+
const candidate2 = value[field2];
|
|
16661
16781
|
if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isSafeInteger(candidate2) || candidate2 < 0)) {
|
|
16662
|
-
throw new Error(`Harness Usage '${
|
|
16782
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
16663
16783
|
}
|
|
16664
16784
|
}
|
|
16665
16785
|
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
@@ -16668,16 +16788,16 @@ function parseHostUsage(value) {
|
|
|
16668
16788
|
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
16669
16789
|
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
16670
16790
|
}
|
|
16671
|
-
for (const
|
|
16672
|
-
const candidate2 = value[
|
|
16791
|
+
for (const field2 of ["totalCredits", "contextUsagePercent"]) {
|
|
16792
|
+
const candidate2 = value[field2];
|
|
16673
16793
|
if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isFinite(candidate2) || candidate2 < 0)) {
|
|
16674
|
-
throw new Error(`Harness Usage '${
|
|
16794
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
16675
16795
|
}
|
|
16676
16796
|
}
|
|
16677
|
-
for (const
|
|
16678
|
-
const candidate2 = value[
|
|
16797
|
+
for (const field2 of percentFields) {
|
|
16798
|
+
const candidate2 = value[field2];
|
|
16679
16799
|
if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isFinite(candidate2) || candidate2 < 0 || candidate2 > 100)) {
|
|
16680
|
-
throw new Error(`Harness Usage '${
|
|
16800
|
+
throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
|
|
16681
16801
|
}
|
|
16682
16802
|
}
|
|
16683
16803
|
if (value.sessionCacheUsage !== void 0) {
|
|
@@ -16716,9 +16836,9 @@ function parseHostUsage(value) {
|
|
|
16716
16836
|
if (value.costSource !== "publicPrice") {
|
|
16717
16837
|
throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
|
|
16718
16838
|
}
|
|
16719
|
-
return { ...value, unpricedModels: [...models] };
|
|
16839
|
+
return { ...value, ...indicators, unpricedModels: [...models] };
|
|
16720
16840
|
}
|
|
16721
|
-
return { ...value };
|
|
16841
|
+
return { ...value, ...indicators };
|
|
16722
16842
|
}
|
|
16723
16843
|
var requestTokenFields = [
|
|
16724
16844
|
"inputTokens",
|
|
@@ -16748,19 +16868,19 @@ function parseHostUsageRequest(value) {
|
|
|
16748
16868
|
if (typeof value.requestId !== "string" || value.requestId.length === 0) {
|
|
16749
16869
|
throw new Error("Harness Usage request 'requestId' must be a non-empty string");
|
|
16750
16870
|
}
|
|
16751
|
-
for (const
|
|
16752
|
-
const candidate2 = value[
|
|
16871
|
+
for (const field2 of ["model", "provider"]) {
|
|
16872
|
+
const candidate2 = value[field2];
|
|
16753
16873
|
if (candidate2 !== void 0 && (typeof candidate2 !== "string" || candidate2.length === 0)) {
|
|
16754
|
-
throw new Error(`Harness Usage request '${
|
|
16874
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
|
|
16755
16875
|
}
|
|
16756
16876
|
}
|
|
16757
16877
|
if (value.historical !== void 0 && typeof value.historical !== "boolean") {
|
|
16758
16878
|
throw new Error("Harness Usage request 'historical' must be a boolean");
|
|
16759
16879
|
}
|
|
16760
|
-
for (const
|
|
16761
|
-
const candidate2 = value[
|
|
16880
|
+
for (const field2 of requestTokenFields) {
|
|
16881
|
+
const candidate2 = value[field2];
|
|
16762
16882
|
if (candidate2 !== void 0 && (typeof candidate2 !== "number" || !Number.isSafeInteger(candidate2) || candidate2 < 0)) {
|
|
16763
|
-
throw new Error(`Harness Usage request '${
|
|
16883
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
|
|
16764
16884
|
}
|
|
16765
16885
|
}
|
|
16766
16886
|
if (value.inputTokens === void 0 || value.outputTokens === void 0) {
|
|
@@ -18154,24 +18274,24 @@ var buildClientParams = (args, fields) => {
|
|
|
18154
18274
|
}
|
|
18155
18275
|
if ("in" in config2) {
|
|
18156
18276
|
if (config2.key) {
|
|
18157
|
-
const
|
|
18158
|
-
const name =
|
|
18159
|
-
if (
|
|
18277
|
+
const field2 = map2.get(config2.key);
|
|
18278
|
+
const name = field2.map || config2.key;
|
|
18279
|
+
if (field2.in) {
|
|
18160
18280
|
;
|
|
18161
|
-
params[
|
|
18281
|
+
params[field2.in][name] = arg;
|
|
18162
18282
|
}
|
|
18163
18283
|
} else {
|
|
18164
18284
|
params.body = arg;
|
|
18165
18285
|
}
|
|
18166
18286
|
} else {
|
|
18167
18287
|
for (const [key, value] of Object.entries(arg ?? {})) {
|
|
18168
|
-
const
|
|
18169
|
-
if (
|
|
18170
|
-
if (
|
|
18171
|
-
const name =
|
|
18172
|
-
params[
|
|
18288
|
+
const field2 = map2.get(key);
|
|
18289
|
+
if (field2) {
|
|
18290
|
+
if (field2.in) {
|
|
18291
|
+
const name = field2.map || key;
|
|
18292
|
+
params[field2.in][name] = value;
|
|
18173
18293
|
} else {
|
|
18174
|
-
params[
|
|
18294
|
+
params[field2.map] = value;
|
|
18175
18295
|
}
|
|
18176
18296
|
} else {
|
|
18177
18297
|
const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix));
|
|
@@ -23838,6 +23958,8 @@ var OpenCodeHarnessSession = class {
|
|
|
23838
23958
|
if (this.#phase !== "open") {
|
|
23839
23959
|
return { ok: false, error: invalidState("OpenCode Session is not open") };
|
|
23840
23960
|
}
|
|
23961
|
+
if (command.type === "turn.steer")
|
|
23962
|
+
return unsupportedSteer("OpenCode");
|
|
23841
23963
|
if (command.type === "turn.cancel")
|
|
23842
23964
|
return this.#cancel(command);
|
|
23843
23965
|
if (command.type === "interaction.respond")
|
|
@@ -24306,8 +24428,8 @@ var OpenCodeHarnessSession = class {
|
|
|
24306
24428
|
this.#event({ type: "item.started", turnId: active.turnId, item });
|
|
24307
24429
|
}
|
|
24308
24430
|
}
|
|
24309
|
-
#appendPartDelta(active, partID,
|
|
24310
|
-
if (
|
|
24431
|
+
#appendPartDelta(active, partID, field2, delta) {
|
|
24432
|
+
if (field2 !== "text" || !delta)
|
|
24311
24433
|
return;
|
|
24312
24434
|
const existing = active.items.get(partID);
|
|
24313
24435
|
if (!existing)
|
|
@@ -27302,16 +27424,16 @@ function permissionInteraction(request, turnId) {
|
|
|
27302
27424
|
};
|
|
27303
27425
|
}
|
|
27304
27426
|
function formInteraction(form, turnId) {
|
|
27305
|
-
const questions = form.fields.map((
|
|
27306
|
-
if (
|
|
27427
|
+
const questions = form.fields.map((field2) => {
|
|
27428
|
+
if (field2.type === "external" || field2.hidden || field2.when?.length) {
|
|
27307
27429
|
throw new Error("OpenCode v2 external, hidden or conditional form fields require its native UI");
|
|
27308
27430
|
}
|
|
27309
27431
|
const base = {
|
|
27310
|
-
id:
|
|
27311
|
-
prompt: [
|
|
27312
|
-
optional: !
|
|
27432
|
+
id: field2.key,
|
|
27433
|
+
prompt: [field2.title, field2.description].filter(Boolean).join("\n") || field2.key,
|
|
27434
|
+
optional: !field2.required
|
|
27313
27435
|
};
|
|
27314
|
-
if (
|
|
27436
|
+
if (field2.type === "boolean")
|
|
27315
27437
|
return {
|
|
27316
27438
|
...base,
|
|
27317
27439
|
type: "choice",
|
|
@@ -27322,22 +27444,22 @@ function formInteraction(form, turnId) {
|
|
|
27322
27444
|
{ value: "false", label: "No" }
|
|
27323
27445
|
]
|
|
27324
27446
|
};
|
|
27325
|
-
if (
|
|
27447
|
+
if (field2.type === "multiselect" || field2.type === "string" && field2.options?.length) {
|
|
27326
27448
|
return {
|
|
27327
27449
|
...base,
|
|
27328
27450
|
type: "choice",
|
|
27329
|
-
multiple:
|
|
27330
|
-
allowOther:
|
|
27331
|
-
options:
|
|
27451
|
+
multiple: field2.type === "multiselect",
|
|
27452
|
+
allowOther: field2.custom ?? false,
|
|
27453
|
+
options: field2.options ?? []
|
|
27332
27454
|
};
|
|
27333
27455
|
}
|
|
27334
27456
|
return {
|
|
27335
27457
|
...base,
|
|
27336
27458
|
type: "text",
|
|
27337
|
-
multiline:
|
|
27459
|
+
multiline: field2.type === "string",
|
|
27338
27460
|
secret: false,
|
|
27339
|
-
...
|
|
27340
|
-
...
|
|
27461
|
+
...field2.type === "string" && field2.placeholder ? { placeholder: field2.placeholder } : {},
|
|
27462
|
+
...field2.default !== void 0 ? { prefill: String(field2.default) } : {}
|
|
27341
27463
|
};
|
|
27342
27464
|
});
|
|
27343
27465
|
return {
|
|
@@ -27380,24 +27502,24 @@ async function replyInteraction(client2, pending, command) {
|
|
|
27380
27502
|
return;
|
|
27381
27503
|
}
|
|
27382
27504
|
const answer = {};
|
|
27383
|
-
for (const
|
|
27384
|
-
const values = command.response.answers[
|
|
27505
|
+
for (const field2 of form.fields) {
|
|
27506
|
+
const values = command.response.answers[field2.key] ?? [];
|
|
27385
27507
|
if (!values.length)
|
|
27386
27508
|
continue;
|
|
27387
27509
|
const value = values[0];
|
|
27388
27510
|
if (value === void 0)
|
|
27389
27511
|
continue;
|
|
27390
|
-
if (
|
|
27391
|
-
answer[
|
|
27392
|
-
else if (
|
|
27393
|
-
answer[
|
|
27394
|
-
else if (
|
|
27512
|
+
if (field2.type === "multiselect")
|
|
27513
|
+
answer[field2.key] = values;
|
|
27514
|
+
else if (field2.type === "boolean")
|
|
27515
|
+
answer[field2.key] = value === "true";
|
|
27516
|
+
else if (field2.type === "number" || field2.type === "integer") {
|
|
27395
27517
|
const number4 = Number(value);
|
|
27396
|
-
if (!value.trim() || !Number.isFinite(number4) ||
|
|
27397
|
-
throw new Error(`Invalid number for ${
|
|
27398
|
-
answer[
|
|
27518
|
+
if (!value.trim() || !Number.isFinite(number4) || field2.type === "integer" && !Number.isInteger(number4))
|
|
27519
|
+
throw new Error(`Invalid number for ${field2.key}`);
|
|
27520
|
+
answer[field2.key] = number4;
|
|
27399
27521
|
} else
|
|
27400
|
-
answer[
|
|
27522
|
+
answer[field2.key] = value;
|
|
27401
27523
|
}
|
|
27402
27524
|
await client2.session.form.reply({ sessionID: form.sessionID, formID: form.id, answer });
|
|
27403
27525
|
}
|
|
@@ -27518,6 +27640,8 @@ var V2Session = class {
|
|
|
27518
27640
|
async execute(command) {
|
|
27519
27641
|
if (this.#closed)
|
|
27520
27642
|
return { ok: false, error: failure("OpenCode Session is closed", "invalidState") };
|
|
27643
|
+
if (command.type === "turn.steer")
|
|
27644
|
+
return unsupportedSteer("OpenCode");
|
|
27521
27645
|
if (command.type === "turn.start")
|
|
27522
27646
|
return this.#start(command, false);
|
|
27523
27647
|
if (command.type === "turn.cancel") {
|