@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
|
@@ -4209,10 +4209,13 @@ function usageSessionTitle(value) {
|
|
|
4209
4209
|
return void 0;
|
|
4210
4210
|
if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
|
|
4211
4211
|
return normalized;
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4212
|
+
let title = "";
|
|
4213
|
+
for (const character of normalized) {
|
|
4214
|
+
if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
|
|
4215
|
+
break;
|
|
4216
|
+
title += character;
|
|
4217
|
+
}
|
|
4218
|
+
return `${title.trimEnd()}…`;
|
|
4216
4219
|
}
|
|
4217
4220
|
function sessionIdOk(value) {
|
|
4218
4221
|
return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
|
|
@@ -7278,10 +7281,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
7278
7281
|
const shape = def.shape;
|
|
7279
7282
|
const propValues = {};
|
|
7280
7283
|
for (const key in shape) {
|
|
7281
|
-
const
|
|
7282
|
-
if (
|
|
7284
|
+
const field2 = shape[key]._zod;
|
|
7285
|
+
if (field2.values) {
|
|
7283
7286
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
7284
|
-
for (const v of
|
|
7287
|
+
for (const v of field2.values)
|
|
7285
7288
|
propValues[key].add(v);
|
|
7286
7289
|
}
|
|
7287
7290
|
}
|
|
@@ -18900,10 +18903,19 @@ var model = external_exports.string().min(1).max(512);
|
|
|
18900
18903
|
var project = external_exports.string().min(1).max(4096);
|
|
18901
18904
|
var usageStatisticsParamsSchema = external_exports.strictObject({
|
|
18902
18905
|
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
18906
|
+
/** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
|
|
18907
|
+
timeZone: external_exports.string().min(1).max(128).refine((value) => {
|
|
18908
|
+
try {
|
|
18909
|
+
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
18910
|
+
return true;
|
|
18911
|
+
} catch {
|
|
18912
|
+
return false;
|
|
18913
|
+
}
|
|
18914
|
+
}, "Unsupported usage statistics timezone").optional(),
|
|
18903
18915
|
harness: harness.optional(),
|
|
18904
18916
|
model: model.nullable().optional(),
|
|
18905
18917
|
project: project.nullable().optional(),
|
|
18906
|
-
/** One
|
|
18918
|
+
/** One date in the query timezone inside the range. */
|
|
18907
18919
|
date: localDate.optional()
|
|
18908
18920
|
});
|
|
18909
18921
|
var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
@@ -18912,6 +18924,8 @@ var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
|
18912
18924
|
cachedInputTokens: count,
|
|
18913
18925
|
cacheWriteInputTokens: count,
|
|
18914
18926
|
cacheKnownInputTokens: count,
|
|
18927
|
+
cacheHitCachedInputTokens: count,
|
|
18928
|
+
cacheHitInputTokens: count,
|
|
18915
18929
|
outputTokens: count,
|
|
18916
18930
|
reasoningOutputTokens: count,
|
|
18917
18931
|
/** USD at the public price, summed over the priced requests only. */
|
|
@@ -18939,7 +18953,7 @@ var usageStatisticsSessionSchema = external_exports.strictObject({
|
|
|
18939
18953
|
});
|
|
18940
18954
|
var usageStatisticsResultSchema = external_exports.strictObject({
|
|
18941
18955
|
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
18942
|
-
/** First
|
|
18956
|
+
/** First date in the query timezone (Host local when omitted); null for all time. */
|
|
18943
18957
|
from: localDate.nullable(),
|
|
18944
18958
|
to: localDate,
|
|
18945
18959
|
/** The filters these figures apply, echoed so a late answer to older filters is recognised. */
|
|
@@ -18979,7 +18993,7 @@ var usageStatisticsResultSchema = external_exports.strictObject({
|
|
|
18979
18993
|
totals: usageStatisticsTotalsSchema,
|
|
18980
18994
|
/** Each date and Harness of the range: every filter except the day. */
|
|
18981
18995
|
daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
|
|
18982
|
-
/**
|
|
18996
|
+
/** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
|
|
18983
18997
|
hourly: external_exports.array(external_exports.strictObject({
|
|
18984
18998
|
weekday: external_exports.number().int().min(0).max(6),
|
|
18985
18999
|
hour: external_exports.number().int().min(0).max(23),
|
|
@@ -19019,6 +19033,51 @@ var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
|
19019
19033
|
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
19020
19034
|
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
19021
19035
|
|
|
19036
|
+
// ../../shared-contracts/dist/thread-questions.js
|
|
19037
|
+
var field = external_exports.discriminatedUnion("type", [
|
|
19038
|
+
external_exports.object({
|
|
19039
|
+
id: external_exports.string().min(1),
|
|
19040
|
+
type: external_exports.literal("choice"),
|
|
19041
|
+
prompt: external_exports.string(),
|
|
19042
|
+
options: external_exports.array(external_exports.object({
|
|
19043
|
+
value: external_exports.string().min(1),
|
|
19044
|
+
label: external_exports.string(),
|
|
19045
|
+
description: external_exports.string().optional()
|
|
19046
|
+
})).min(1),
|
|
19047
|
+
multiple: external_exports.boolean(),
|
|
19048
|
+
allowOther: external_exports.boolean(),
|
|
19049
|
+
optional: external_exports.boolean()
|
|
19050
|
+
}),
|
|
19051
|
+
external_exports.object({
|
|
19052
|
+
id: external_exports.string().min(1),
|
|
19053
|
+
type: external_exports.literal("text"),
|
|
19054
|
+
prompt: external_exports.string(),
|
|
19055
|
+
multiline: external_exports.boolean(),
|
|
19056
|
+
secret: external_exports.literal(false),
|
|
19057
|
+
optional: external_exports.boolean(),
|
|
19058
|
+
placeholder: external_exports.string().optional(),
|
|
19059
|
+
prefill: external_exports.string().optional()
|
|
19060
|
+
})
|
|
19061
|
+
]);
|
|
19062
|
+
var threadQuestionSchema = external_exports.object({
|
|
19063
|
+
interactionId: external_exports.string().min(1),
|
|
19064
|
+
turnId: external_exports.string().min(1),
|
|
19065
|
+
title: external_exports.string().optional(),
|
|
19066
|
+
questions: external_exports.array(field).min(1)
|
|
19067
|
+
}).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
|
|
19068
|
+
message: "Shared cards require at least one multi-select question"
|
|
19069
|
+
});
|
|
19070
|
+
var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
|
|
19071
|
+
var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
|
|
19072
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
19073
|
+
threadId: external_exports.string().min(1),
|
|
19074
|
+
turnId: external_exports.string().min(1),
|
|
19075
|
+
interactionId: external_exports.string().min(1),
|
|
19076
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
19077
|
+
cancelled: external_exports.boolean().default(false)
|
|
19078
|
+
});
|
|
19079
|
+
var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
|
|
19080
|
+
|
|
19022
19081
|
// ../../shared-contracts/dist/harness-plugins.js
|
|
19023
19082
|
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
19024
19083
|
var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
|
|
@@ -19121,6 +19180,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
19121
19180
|
"codexhost/harness/display-settings/set",
|
|
19122
19181
|
"codexhost/harness/inspect",
|
|
19123
19182
|
"codexhost/harness/installation",
|
|
19183
|
+
"codexhost/harness/installation/start",
|
|
19184
|
+
"codexhost/harness/installation/status",
|
|
19124
19185
|
"codexhost/harness/launch-settings/get",
|
|
19125
19186
|
"codexhost/harness/launch-settings/set",
|
|
19126
19187
|
HARNESS_LONG_CONTEXT_GET_METHOD,
|
|
@@ -19198,7 +19259,18 @@ var threadManualCompactionStartedSchema = external_exports.strictObject({
|
|
|
19198
19259
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
19199
19260
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
19200
19261
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
19262
|
+
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
19263
|
+
var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
19264
|
+
kind: external_exports.literal("countdown"),
|
|
19265
|
+
id: external_exports.string().min(1).max(64),
|
|
19266
|
+
expiresAtUnix: nonNegativeSafeIntegerSchema,
|
|
19267
|
+
label: indicatorTextSchema(256).optional(),
|
|
19268
|
+
tooltip: indicatorTextSchema(1024).optional()
|
|
19269
|
+
}).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, {
|
|
19270
|
+
message: "Composer indicator IDs must be unique"
|
|
19271
|
+
});
|
|
19201
19272
|
var threadUsageSnapshotSchema = external_exports.object({
|
|
19273
|
+
composerIndicators: composerIndicatorsSchema.optional(),
|
|
19202
19274
|
inputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
19203
19275
|
cachedInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
19204
19276
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
@@ -19624,7 +19696,9 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
|
|
|
19624
19696
|
}).strict().optional(),
|
|
19625
19697
|
input: external_exports.object({
|
|
19626
19698
|
image: external_exports.boolean()
|
|
19627
|
-
}).strict().optional()
|
|
19699
|
+
}).strict().optional(),
|
|
19700
|
+
/** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
|
|
19701
|
+
steer: external_exports.boolean().optional()
|
|
19628
19702
|
}).strict();
|
|
19629
19703
|
var harnessConfigurationStateSchema = external_exports.object({
|
|
19630
19704
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
@@ -19671,7 +19745,9 @@ var harnessInspectionSchema = external_exports.union([
|
|
|
19671
19745
|
var harnessInspectParamsSchema = external_exports.object({
|
|
19672
19746
|
harnessId: harnessIdSchema,
|
|
19673
19747
|
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
19674
|
-
refresh: external_exports.boolean().optional()
|
|
19748
|
+
refresh: external_exports.boolean().optional(),
|
|
19749
|
+
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
19750
|
+
purpose: external_exports.literal("availability").optional()
|
|
19675
19751
|
}).strict();
|
|
19676
19752
|
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
19677
19753
|
harnessId: harnessIdSchema
|
|
@@ -19756,13 +19832,25 @@ var threadOwnershipListResultSchema = external_exports.object({
|
|
|
19756
19832
|
seen.add(thread.threadId);
|
|
19757
19833
|
}
|
|
19758
19834
|
});
|
|
19835
|
+
var threadSteeringInspectParamsSchema = external_exports.object({
|
|
19836
|
+
threadId: hostThreadIdSchema,
|
|
19837
|
+
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
19838
|
+
text: external_exports.string().optional()
|
|
19839
|
+
}).strict();
|
|
19840
|
+
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
19841
|
+
var threadSteeringInspectResultSchema = external_exports.object({
|
|
19842
|
+
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
19843
|
+
}).strict();
|
|
19759
19844
|
|
|
19760
19845
|
// ../../shared-contracts/dist/harness-route.js
|
|
19761
19846
|
var harnessPluginRouteSchema = external_exports.object({
|
|
19762
19847
|
harnessId: harnessPluginIdSchema,
|
|
19763
19848
|
model: harnessModelRefSchema.optional(),
|
|
19764
19849
|
thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
19765
|
-
permissionModeId: harnessPermissionModeIdSchema.optional()
|
|
19850
|
+
permissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
19851
|
+
/** A draft prewarm create: stays unsubmitted until the user's first Turn.
|
|
19852
|
+
* Desktop forwards only the Model of a main-process prewarm to thread/start. */
|
|
19853
|
+
prewarm: external_exports.literal(true).optional()
|
|
19766
19854
|
}).strict();
|
|
19767
19855
|
|
|
19768
19856
|
// ../../shared-contracts/dist/harness-launch-settings.js
|
|
@@ -19788,6 +19876,10 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
19788
19876
|
latestVersion: external_exports.string().min(1).max(128),
|
|
19789
19877
|
updateAvailable: external_exports.boolean(),
|
|
19790
19878
|
canUpdate: external_exports.boolean(),
|
|
19879
|
+
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
19880
|
+
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
19881
|
+
/** Official download opened by the user; does not imply an automatic installation. */
|
|
19882
|
+
manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
|
|
19791
19883
|
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
19792
19884
|
message: external_exports.string().max(2048).optional(),
|
|
19793
19885
|
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
@@ -19795,6 +19887,20 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
19795
19887
|
notice: harnessLocalizedTextSchema.optional(),
|
|
19796
19888
|
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
19797
19889
|
}).strict();
|
|
19890
|
+
var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
|
|
19891
|
+
var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
|
|
19892
|
+
external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
|
|
19893
|
+
external_exports.object({
|
|
19894
|
+
taskId: external_exports.string().uuid(),
|
|
19895
|
+
status: external_exports.literal("succeeded"),
|
|
19896
|
+
result: harnessInstallationStateSchema
|
|
19897
|
+
}).strict(),
|
|
19898
|
+
external_exports.object({
|
|
19899
|
+
taskId: external_exports.string().uuid(),
|
|
19900
|
+
status: external_exports.literal("failed"),
|
|
19901
|
+
error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
|
|
19902
|
+
}).strict()
|
|
19903
|
+
]);
|
|
19798
19904
|
|
|
19799
19905
|
// ../../shared-contracts/dist/codex-accounts.js
|
|
19800
19906
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
@@ -20318,6 +20424,18 @@ function sanitizeDiagnosticTail(value) {
|
|
|
20318
20424
|
return redacted.length <= DIAGNOSTIC_TAIL_MAX_LENGTH ? redacted : redacted.slice(-DIAGNOSTIC_TAIL_MAX_LENGTH);
|
|
20319
20425
|
}
|
|
20320
20426
|
|
|
20427
|
+
// ../../harness-adapter/dist/steer.js
|
|
20428
|
+
function unsupportedSteer(harnessLabel) {
|
|
20429
|
+
return {
|
|
20430
|
+
ok: false,
|
|
20431
|
+
error: {
|
|
20432
|
+
code: "unsupported",
|
|
20433
|
+
message: `${harnessLabel} cannot steer an active Turn natively`,
|
|
20434
|
+
retryable: false
|
|
20435
|
+
}
|
|
20436
|
+
};
|
|
20437
|
+
}
|
|
20438
|
+
|
|
20321
20439
|
// ../../harness-adapter/dist/usage.js
|
|
20322
20440
|
var tokenFields = [
|
|
20323
20441
|
"inputTokens",
|
|
@@ -20345,6 +20463,7 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
20345
20463
|
...safeIntegerFields,
|
|
20346
20464
|
...percentFields,
|
|
20347
20465
|
"sessionCacheUsage",
|
|
20466
|
+
"composerIndicators",
|
|
20348
20467
|
"totalCostUsd",
|
|
20349
20468
|
"totalCredits",
|
|
20350
20469
|
"contextUsagePercent",
|
|
@@ -20367,26 +20486,27 @@ function parseHostUsage(value) {
|
|
|
20367
20486
|
throw new Error(`Harness Usage contains unknown field '${key}'`);
|
|
20368
20487
|
}
|
|
20369
20488
|
}
|
|
20370
|
-
|
|
20489
|
+
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
20490
|
+
for (const field2 of [
|
|
20371
20491
|
"totalCredits",
|
|
20372
20492
|
"contextUsagePercent",
|
|
20373
20493
|
"apiOutputTokensPerSecond"
|
|
20374
20494
|
]) {
|
|
20375
|
-
const candidate = value[
|
|
20495
|
+
const candidate = value[field2];
|
|
20376
20496
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
20377
|
-
throw new Error(`Harness Usage '${
|
|
20497
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
20378
20498
|
}
|
|
20379
20499
|
}
|
|
20380
|
-
for (const
|
|
20381
|
-
const candidate = value[
|
|
20500
|
+
for (const field2 of tokenFields) {
|
|
20501
|
+
const candidate = value[field2];
|
|
20382
20502
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
20383
|
-
throw new Error(`Harness Usage '${
|
|
20503
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
20384
20504
|
}
|
|
20385
20505
|
}
|
|
20386
|
-
for (const
|
|
20387
|
-
const candidate = value[
|
|
20506
|
+
for (const field2 of safeIntegerFields) {
|
|
20507
|
+
const candidate = value[field2];
|
|
20388
20508
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
20389
|
-
throw new Error(`Harness Usage '${
|
|
20509
|
+
throw new Error(`Harness Usage '${field2}' must be a non-negative safe integer`);
|
|
20390
20510
|
}
|
|
20391
20511
|
}
|
|
20392
20512
|
if (value.outputTokensPerSecond !== void 0 && (typeof value.outputTokensPerSecond !== "number" || !Number.isFinite(value.outputTokensPerSecond) || value.outputTokensPerSecond < 0)) {
|
|
@@ -20395,16 +20515,16 @@ function parseHostUsage(value) {
|
|
|
20395
20515
|
if (value.totalCostUsd !== void 0 && (typeof value.totalCostUsd !== "number" || !Number.isFinite(value.totalCostUsd) || value.totalCostUsd < 0)) {
|
|
20396
20516
|
throw new Error("Harness Usage 'totalCostUsd' must be a finite non-negative number");
|
|
20397
20517
|
}
|
|
20398
|
-
for (const
|
|
20399
|
-
const candidate = value[
|
|
20518
|
+
for (const field2 of ["totalCredits", "contextUsagePercent"]) {
|
|
20519
|
+
const candidate = value[field2];
|
|
20400
20520
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
20401
|
-
throw new Error(`Harness Usage '${
|
|
20521
|
+
throw new Error(`Harness Usage '${field2}' must be a finite non-negative number`);
|
|
20402
20522
|
}
|
|
20403
20523
|
}
|
|
20404
|
-
for (const
|
|
20405
|
-
const candidate = value[
|
|
20524
|
+
for (const field2 of percentFields) {
|
|
20525
|
+
const candidate = value[field2];
|
|
20406
20526
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0 || candidate > 100)) {
|
|
20407
|
-
throw new Error(`Harness Usage '${
|
|
20527
|
+
throw new Error(`Harness Usage '${field2}' must be between 0 and 100`);
|
|
20408
20528
|
}
|
|
20409
20529
|
}
|
|
20410
20530
|
if (value.sessionCacheUsage !== void 0) {
|
|
@@ -20443,9 +20563,9 @@ function parseHostUsage(value) {
|
|
|
20443
20563
|
if (value.costSource !== "publicPrice") {
|
|
20444
20564
|
throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
|
|
20445
20565
|
}
|
|
20446
|
-
return { ...value, unpricedModels: [...models] };
|
|
20566
|
+
return { ...value, ...indicators, unpricedModels: [...models] };
|
|
20447
20567
|
}
|
|
20448
|
-
return { ...value };
|
|
20568
|
+
return { ...value, ...indicators };
|
|
20449
20569
|
}
|
|
20450
20570
|
var requestTokenFields = [
|
|
20451
20571
|
"inputTokens",
|
|
@@ -20475,19 +20595,19 @@ function parseHostUsageRequest(value) {
|
|
|
20475
20595
|
if (typeof value.requestId !== "string" || value.requestId.length === 0) {
|
|
20476
20596
|
throw new Error("Harness Usage request 'requestId' must be a non-empty string");
|
|
20477
20597
|
}
|
|
20478
|
-
for (const
|
|
20479
|
-
const candidate = value[
|
|
20598
|
+
for (const field2 of ["model", "provider"]) {
|
|
20599
|
+
const candidate = value[field2];
|
|
20480
20600
|
if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
|
|
20481
|
-
throw new Error(`Harness Usage request '${
|
|
20601
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-empty string`);
|
|
20482
20602
|
}
|
|
20483
20603
|
}
|
|
20484
20604
|
if (value.historical !== void 0 && typeof value.historical !== "boolean") {
|
|
20485
20605
|
throw new Error("Harness Usage request 'historical' must be a boolean");
|
|
20486
20606
|
}
|
|
20487
|
-
for (const
|
|
20488
|
-
const candidate = value[
|
|
20607
|
+
for (const field2 of requestTokenFields) {
|
|
20608
|
+
const candidate = value[field2];
|
|
20489
20609
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
20490
|
-
throw new Error(`Harness Usage request '${
|
|
20610
|
+
throw new Error(`Harness Usage request '${field2}' must be a non-negative safe integer`);
|
|
20491
20611
|
}
|
|
20492
20612
|
}
|
|
20493
20613
|
if (value.inputTokens === void 0 || value.outputTokens === void 0) {
|
|
@@ -21302,9 +21422,9 @@ var DEEPSEEK_USAGE_COUNTERS = [
|
|
|
21302
21422
|
"reasoningOutputTokens"
|
|
21303
21423
|
];
|
|
21304
21424
|
function mergeDeepSeekUsage(current, next) {
|
|
21305
|
-
const counters = Object.fromEntries(DEEPSEEK_USAGE_COUNTERS.flatMap((
|
|
21306
|
-
const value = (current?.[
|
|
21307
|
-
return current?.[
|
|
21425
|
+
const counters = Object.fromEntries(DEEPSEEK_USAGE_COUNTERS.flatMap((field2) => {
|
|
21426
|
+
const value = (current?.[field2] ?? 0) + (next[field2] ?? 0);
|
|
21427
|
+
return current?.[field2] !== void 0 || next[field2] !== void 0 ? [[field2, value]] : [];
|
|
21308
21428
|
}));
|
|
21309
21429
|
const context = next.contextUsedTokens !== void 0 && next.contextWindowTokens !== void 0 ? {
|
|
21310
21430
|
contextUsedTokens: next.contextUsedTokens,
|
|
@@ -21716,7 +21836,7 @@ function onlyKeys(value, required2, optional2 = []) {
|
|
|
21716
21836
|
return required2.every((key) => Object.hasOwn(value, key)) && Reflect.ownKeys(value).every((key) => typeof key === "string" && allowed.has(key));
|
|
21717
21837
|
}
|
|
21718
21838
|
function requiredFields(value, fields) {
|
|
21719
|
-
if (fields.some((
|
|
21839
|
+
if (fields.some((field2) => !Object.hasOwn(value, field2)))
|
|
21720
21840
|
throw invalid("required fields");
|
|
21721
21841
|
}
|
|
21722
21842
|
function assertJsonValue2(value, label) {
|
|
@@ -22040,9 +22160,9 @@ function validateTeamPayload(type, data) {
|
|
|
22040
22160
|
identifier(value.id, "team payload id");
|
|
22041
22161
|
if (key === "member") {
|
|
22042
22162
|
requiredOptionalKeys(value, ["id", "name", "description", "provider", "context", "phase"], ["error"]);
|
|
22043
|
-
for (const
|
|
22044
|
-
if (typeof value[
|
|
22045
|
-
throw invalid(`team member ${
|
|
22163
|
+
for (const field2 of ["name", "description", "provider"])
|
|
22164
|
+
if (typeof value[field2] !== "string")
|
|
22165
|
+
throw invalid(`team member ${field2}`);
|
|
22046
22166
|
if (!["fresh", "fork"].includes(value.context) || !["provisioning", "active", "failed"].includes(value.phase) || value.error !== void 0 && typeof value.error !== "string")
|
|
22047
22167
|
throw invalid("team member");
|
|
22048
22168
|
} else if (key === "task") {
|
|
@@ -22056,8 +22176,8 @@ function validateTeamPayload(type, data) {
|
|
|
22056
22176
|
stringArray(value.writeScopes, "team task writeScopes");
|
|
22057
22177
|
} else {
|
|
22058
22178
|
exactKeys(value, ["id", "senderId", "senderName", "targetId", "content"]);
|
|
22059
|
-
for (const
|
|
22060
|
-
identifier(value[
|
|
22179
|
+
for (const field2 of ["senderId", "senderName", "targetId"])
|
|
22180
|
+
identifier(value[field2], `team message ${field2}`);
|
|
22061
22181
|
validateBlocks(value.content);
|
|
22062
22182
|
}
|
|
22063
22183
|
}
|
|
@@ -22502,7 +22622,7 @@ var DeepSeekGenerationProbeError = class extends Error {
|
|
|
22502
22622
|
this.stderrTail = options.stderrTail;
|
|
22503
22623
|
}
|
|
22504
22624
|
};
|
|
22505
|
-
var DEFAULT_TIMEOUT_MS =
|
|
22625
|
+
var DEFAULT_TIMEOUT_MS = 15e3;
|
|
22506
22626
|
var DEFAULT_CLEANUP_TIMEOUT_MS = 1e3;
|
|
22507
22627
|
var DEFAULT_OUTPUT_LIMIT_BYTES = 16 * 1024;
|
|
22508
22628
|
var DIAGNOSTIC_RAW_TAIL_BYTES = 16 * 1024;
|
|
@@ -22933,7 +23053,7 @@ var ModernRemoteConnectionError = class extends Error {
|
|
|
22933
23053
|
this.remoteFailure = sanitizeModernRemoteFailure(remoteFailure3);
|
|
22934
23054
|
}
|
|
22935
23055
|
};
|
|
22936
|
-
var DEFAULT_STARTUP_TIMEOUT_MS =
|
|
23056
|
+
var DEFAULT_STARTUP_TIMEOUT_MS = 9e4;
|
|
22937
23057
|
var DEFAULT_UNARY_TIMEOUT_MS = 1e4;
|
|
22938
23058
|
var DEFAULT_STREAM_OPEN_TIMEOUT_MS = 1e4;
|
|
22939
23059
|
var DEFAULT_CLOSE_TIMEOUT_MS = 3e3;
|
|
@@ -26239,15 +26359,24 @@ function attachedKnownInvocation(value, sinks) {
|
|
|
26239
26359
|
return { event: value.event, eventId: value.eventId, agentId: value.agentId };
|
|
26240
26360
|
}
|
|
26241
26361
|
function parseApprovalRequest(value) {
|
|
26242
|
-
if (!hasOnlyKeys(value, ["toolName"], ["callId", "reason"]) || !nonBlankString3(value.toolName) || Object.hasOwn(value, "callId") && !nonBlankString3(value.callId) || Object.hasOwn(value, "reason") && !boundedString3(value.reason)) {
|
|
26362
|
+
if (!hasOnlyKeys(value, ["toolName"], ["callId", "reason", "displayReason"]) || !nonBlankString3(value.toolName) || Object.hasOwn(value, "callId") && !nonBlankString3(value.callId) || Object.hasOwn(value, "reason") && !boundedString3(value.reason) || Object.hasOwn(value, "displayReason") && !isApprovalDisplayReason(value.displayReason)) {
|
|
26243
26363
|
throw invalidFrame();
|
|
26244
26364
|
}
|
|
26245
26365
|
return {
|
|
26246
26366
|
toolName: value.toolName,
|
|
26247
26367
|
...typeof value.callId === "string" ? { callId: value.callId } : {},
|
|
26248
|
-
...typeof value.reason === "string" ? { reason: value.reason } : {}
|
|
26368
|
+
...typeof value.reason === "string" ? { reason: value.reason } : {},
|
|
26369
|
+
...Object.hasOwn(value, "displayReason") ? { displayReason: value.displayReason } : {}
|
|
26249
26370
|
};
|
|
26250
26371
|
}
|
|
26372
|
+
function isApprovalDisplayReason(value) {
|
|
26373
|
+
if (!isPlainRecord6(value))
|
|
26374
|
+
return false;
|
|
26375
|
+
const entries = Object.entries(value);
|
|
26376
|
+
if (entries.length === 0)
|
|
26377
|
+
return false;
|
|
26378
|
+
return entries.every(([locale, text]) => locale.length > 0 && nonBlankString3(text) && boundedString3(text));
|
|
26379
|
+
}
|
|
26251
26380
|
function parseQuestionRequest(value) {
|
|
26252
26381
|
if (!hasOnlyKeys(value, ["questions"], ["wait"]) || !Array.isArray(value.questions)) {
|
|
26253
26382
|
throw invalidFrame();
|
|
@@ -28065,7 +28194,7 @@ function validateToolResultMessage(value, profile) {
|
|
|
28065
28194
|
return callId;
|
|
28066
28195
|
}
|
|
28067
28196
|
function requiredFields2(value, fields) {
|
|
28068
|
-
if (fields.some((
|
|
28197
|
+
if (fields.some((field2) => !Object.hasOwn(value, field2))) {
|
|
28069
28198
|
fail("Modern history known event omitted a required field");
|
|
28070
28199
|
}
|
|
28071
28200
|
}
|
|
@@ -28090,7 +28219,7 @@ function validUsage(value) {
|
|
|
28090
28219
|
if (!nonNegativeSafeInteger2(value.inputTokens) || !nonNegativeSafeInteger2(value.outputTokens)) {
|
|
28091
28220
|
return false;
|
|
28092
28221
|
}
|
|
28093
|
-
return fields.slice(2).every((
|
|
28222
|
+
return fields.slice(2).every((field2) => value[field2] === void 0 || nonNegativeSafeInteger2(value[field2]));
|
|
28094
28223
|
}
|
|
28095
28224
|
function validateTurnReason(value) {
|
|
28096
28225
|
if (!isRecord4(value) || typeof value.kind !== "string") {
|
|
@@ -28205,7 +28334,7 @@ function validateInboxSplice(data, profile) {
|
|
|
28205
28334
|
}
|
|
28206
28335
|
}
|
|
28207
28336
|
function validateApprovalAsked(data) {
|
|
28208
|
-
requiredOptionalKeys(data, ["id", "toolName"], ["callId", "reason"]);
|
|
28337
|
+
requiredOptionalKeys(data, ["id", "toolName"], ["callId", "reason", "displayReason"]);
|
|
28209
28338
|
requiredString(data.id, "approval/asked id");
|
|
28210
28339
|
requiredString(data.toolName, "approval/asked toolName");
|
|
28211
28340
|
if (data.callId !== void 0)
|
|
@@ -28213,6 +28342,17 @@ function validateApprovalAsked(data) {
|
|
|
28213
28342
|
if (data.reason !== void 0 && typeof data.reason !== "string") {
|
|
28214
28343
|
fail("Modern history approval/asked reason is malformed");
|
|
28215
28344
|
}
|
|
28345
|
+
if (data.displayReason !== void 0 && !isApprovalDisplayReason2(data.displayReason)) {
|
|
28346
|
+
fail("Modern history approval/asked displayReason is malformed");
|
|
28347
|
+
}
|
|
28348
|
+
}
|
|
28349
|
+
function isApprovalDisplayReason2(value) {
|
|
28350
|
+
if (!isRecord4(value))
|
|
28351
|
+
return false;
|
|
28352
|
+
const entries = Object.entries(value);
|
|
28353
|
+
if (entries.length === 0)
|
|
28354
|
+
return false;
|
|
28355
|
+
return entries.every(([locale, text]) => locale.length > 0 && typeof text === "string" && text.length > 0 && nonBlankString(text));
|
|
28216
28356
|
}
|
|
28217
28357
|
function validateApprovalDecided(data) {
|
|
28218
28358
|
exactKeys(data, ["id", "outcome"]);
|
|
@@ -28833,6 +28973,8 @@ var ModernHarnessSession = class {
|
|
|
28833
28973
|
switch (command.type) {
|
|
28834
28974
|
case "turn.start":
|
|
28835
28975
|
return this.#start(command);
|
|
28976
|
+
case "turn.steer":
|
|
28977
|
+
return Promise.resolve(unsupportedSteer("DeepSeek Harness"));
|
|
28836
28978
|
case "turn.cancel":
|
|
28837
28979
|
return this.#cancel(command);
|
|
28838
28980
|
case "interaction.respond":
|
|
@@ -29124,7 +29266,7 @@ var ModernHarnessSession = class {
|
|
|
29124
29266
|
type: "approval",
|
|
29125
29267
|
interactionId,
|
|
29126
29268
|
turnId: active.turnId,
|
|
29127
|
-
title: delivery.request.reason ?? `Allow ${delivery.request.toolName}?`,
|
|
29269
|
+
title: delivery.request.displayReason?.en ?? delivery.request.reason ?? `Allow ${delivery.request.toolName}?`,
|
|
29128
29270
|
description: delivery.request.callId ? `${delivery.request.toolName} (${delivery.request.callId})` : delivery.request.toolName,
|
|
29129
29271
|
subject: { type: "nativeAction" },
|
|
29130
29272
|
actions: [
|