@liberseek/boft-cli-linux-x64 0.8.1 → 0.8.3
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 +36 -3
- package/app/console-web.js +100 -75
- package/app/desktop-controller.mjs +36 -3
- package/app/host-runtime.mjs +81 -21
- package/app/plugins/antigravity/plugin.mjs +52 -7
- package/app/plugins/claude-code/plugin.mjs +206 -54
- package/app/plugins/codebuddy/plugin.mjs +110 -8
- package/app/plugins/codex-usage/plugin.mjs +36 -3
- package/app/plugins/cursor-cli/plugin.mjs +71 -10
- package/app/plugins/deepseek-harness/manifest.json +2 -2
- package/app/plugins/deepseek-harness/plugin.mjs +198 -26
- package/app/plugins/grok/plugin.mjs +100 -21
- package/app/plugins/hermes/plugin.mjs +63 -3
- package/app/plugins/kimi-code/plugin.mjs +64 -9
- package/app/plugins/kiro-cli/plugin.mjs +45 -3
- package/app/plugins/muse/plugin.mjs +36 -3
- package/app/plugins/omp/plugin.mjs +46 -3
- package/app/plugins/opencode/plugin.mjs +52 -5
- package/app/plugins/pi/plugin.mjs +37 -3
- package/app/plugins/qoder/plugin.mjs +50 -3
- package/app/plugins/qoder-cn/plugin.mjs +50 -3
- package/app/plugins/workbuddy/plugin.mjs +227 -12
- package/app/plugins/zcode/plugin.mjs +49 -3
- package/app/renderer-extension.js +369 -281
- package/bin/boft +0 -0
- package/libexec/boft-shim +0 -0
- package/libexec/boft-updater +0 -0
- package/package.json +1 -1
|
@@ -19356,6 +19356,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
|
|
|
19356
19356
|
initializeOnly: external_exports.boolean().optional()
|
|
19357
19357
|
});
|
|
19358
19358
|
|
|
19359
|
+
// ../../shared-contracts/dist/harness-presentation.js
|
|
19360
|
+
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
19361
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text) => text.trim().length > 0);
|
|
19362
|
+
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
19363
|
+
label: displayText(256).optional(),
|
|
19364
|
+
description: displayText(1024).optional()
|
|
19365
|
+
}).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
19366
|
+
var harnessLocalizedTextSchema = external_exports.record(localeSchema, displayText(4096)).refine((entries) => typeof entries.en === "string", "English fallback is required").refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
19367
|
+
|
|
19359
19368
|
// ../../shared-contracts/dist/model-price-overrides.js
|
|
19360
19369
|
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
19361
19370
|
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
@@ -19776,8 +19785,24 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
19776
19785
|
}
|
|
19777
19786
|
});
|
|
19778
19787
|
var usagePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
19788
|
+
var accountCreditsPeriodSchema = external_exports.enum([
|
|
19789
|
+
"weekly",
|
|
19790
|
+
"monthly",
|
|
19791
|
+
"five_hour",
|
|
19792
|
+
"seven_day",
|
|
19793
|
+
"unknown"
|
|
19794
|
+
]);
|
|
19795
|
+
var accountCreditsScopeSchema = external_exports.object({
|
|
19796
|
+
id: external_exports.string().min(1).max(256),
|
|
19797
|
+
label: external_exports.string().min(1).max(256),
|
|
19798
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
19799
|
+
}).strict();
|
|
19779
19800
|
var accountCreditsProductUsageSchema = external_exports.object({
|
|
19780
19801
|
product: external_exports.string().min(1),
|
|
19802
|
+
/** Native period and scope, never inferred from the display name. */
|
|
19803
|
+
periodType: accountCreditsPeriodSchema.optional(),
|
|
19804
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
19805
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
19781
19806
|
used: external_exports.number().finite().nonnegative().optional(),
|
|
19782
19807
|
// Zero is a real empty cap, not an absent field.
|
|
19783
19808
|
limit: external_exports.number().finite().nonnegative().optional(),
|
|
@@ -19799,8 +19824,10 @@ var accountCreditsSnapshotSchema = external_exports.object({
|
|
|
19799
19824
|
label: external_exports.string().min(1).optional(),
|
|
19800
19825
|
usedPercent: usagePercentSchema.optional(),
|
|
19801
19826
|
remaining: external_exports.number().finite().optional(),
|
|
19827
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
19828
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
19802
19829
|
resetsAt: external_exports.string().min(1).optional(),
|
|
19803
|
-
periodType:
|
|
19830
|
+
periodType: accountCreditsPeriodSchema,
|
|
19804
19831
|
productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
|
|
19805
19832
|
resetCredits: accountResetCreditsSchema.optional()
|
|
19806
19833
|
}).strict().superRefine((credits, context) => {
|
|
@@ -19825,7 +19852,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
|
|
|
19825
19852
|
var threadUsageInspectionSchema = external_exports.object({
|
|
19826
19853
|
threadId: hostThreadIdSchema,
|
|
19827
19854
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
19828
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
19855
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
19856
|
+
/** Whether this source can provide cached account quota independently of usage. */
|
|
19857
|
+
accountCreditsSupported: external_exports.boolean().optional()
|
|
19829
19858
|
}).strict();
|
|
19830
19859
|
|
|
19831
19860
|
// ../../shared-contracts/dist/harness-accounts.js
|
|
@@ -19952,7 +19981,8 @@ var harnessPermissionModeSchema = external_exports.object({
|
|
|
19952
19981
|
id: harnessPermissionModeIdSchema,
|
|
19953
19982
|
label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
|
|
19954
19983
|
description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
19955
|
-
dangerous: external_exports.boolean().optional()
|
|
19984
|
+
dangerous: external_exports.boolean().optional(),
|
|
19985
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
19956
19986
|
}).strict();
|
|
19957
19987
|
var harnessPermissionModeCatalogSchema = external_exports.object({
|
|
19958
19988
|
modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
|
|
@@ -20275,6 +20305,8 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
20275
20305
|
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
20276
20306
|
message: external_exports.string().max(2048).optional(),
|
|
20277
20307
|
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
20308
|
+
/** Safe plugin-owned explanation, distinct from raw diagnostic message. */
|
|
20309
|
+
notice: harnessLocalizedTextSchema.optional(),
|
|
20278
20310
|
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
20279
20311
|
}).strict();
|
|
20280
20312
|
|
|
@@ -20413,6 +20445,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
|
|
|
20413
20445
|
invocation: commandInvocationSchema,
|
|
20414
20446
|
label: commandLabelSchema,
|
|
20415
20447
|
description: commandDescriptionSchema.optional(),
|
|
20448
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
20416
20449
|
argumentMode: external_exports.enum(["none", "text"]),
|
|
20417
20450
|
/**
|
|
20418
20451
|
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
@@ -21114,9 +21147,8 @@ function resolveGrokExecutable(input = {}) {
|
|
|
21114
21147
|
}
|
|
21115
21148
|
function grokInvocation(command, platform = process.platform, modelId) {
|
|
21116
21149
|
const arguments_ = ["agent", "--no-leader"];
|
|
21117
|
-
|
|
21118
|
-
|
|
21119
|
-
arguments_.push("--model", trimmed);
|
|
21150
|
+
if (modelId?.trim())
|
|
21151
|
+
arguments_.push("--model", modelId);
|
|
21120
21152
|
arguments_.push("stdio");
|
|
21121
21153
|
return commandInvocation(command, arguments_, process.env, platform);
|
|
21122
21154
|
}
|
|
@@ -23537,16 +23569,23 @@ var GROK_PERMISSION_MODE_CATALOG = harnessPermissionModeCatalogSchema.parse({
|
|
|
23537
23569
|
{
|
|
23538
23570
|
id: "ask",
|
|
23539
23571
|
label: "Ask",
|
|
23572
|
+
localizations: { "zh-CN": { label: "询问", description: "执行受保护的工具操作前询问。" } },
|
|
23540
23573
|
description: "Ask before protected tool actions."
|
|
23541
23574
|
},
|
|
23542
23575
|
{
|
|
23543
23576
|
id: "auto",
|
|
23544
23577
|
label: "Auto",
|
|
23578
|
+
localizations: {
|
|
23579
|
+
"zh-CN": { label: "自动", description: "由 Grok Build 决定哪些工具操作可自动运行。" }
|
|
23580
|
+
},
|
|
23545
23581
|
description: "Let Grok Build decide which tool actions may run automatically."
|
|
23546
23582
|
},
|
|
23547
23583
|
{
|
|
23548
23584
|
id: "always-approve",
|
|
23549
23585
|
label: "Always approve",
|
|
23586
|
+
localizations: {
|
|
23587
|
+
"zh-CN": { label: "始终批准", description: "无需提示即可批准所有工具操作。" }
|
|
23588
|
+
},
|
|
23550
23589
|
description: "Approve all tool actions without prompting.",
|
|
23551
23590
|
dangerous: true
|
|
23552
23591
|
}
|
|
@@ -24755,6 +24794,27 @@ function isRecord16(value) {
|
|
|
24755
24794
|
function nonBlank(value) {
|
|
24756
24795
|
return typeof value === "string" && value.trim().length > 0;
|
|
24757
24796
|
}
|
|
24797
|
+
var ENCODED_MODEL_REF_PREFIX = "grok-model~";
|
|
24798
|
+
function encodeGrokModelRef(modelId) {
|
|
24799
|
+
if (!nonBlank(modelId) || modelId.length > HARNESS_MODEL_REF_MAX_LENGTH || new RegExp("\\p{Cc}", "u").test(modelId))
|
|
24800
|
+
return null;
|
|
24801
|
+
const direct = harnessModelRefSchema.safeParse({ id: modelId });
|
|
24802
|
+
if (direct.success && !modelId.startsWith(ENCODED_MODEL_REF_PREFIX))
|
|
24803
|
+
return direct.data;
|
|
24804
|
+
const encoded = harnessModelRefSchema.safeParse({
|
|
24805
|
+
id: `${ENCODED_MODEL_REF_PREFIX}${Buffer.from(modelId, "utf8").toString("base64url")}`
|
|
24806
|
+
});
|
|
24807
|
+
return encoded.success ? encoded.data : null;
|
|
24808
|
+
}
|
|
24809
|
+
function decodeGrokModelRef(ref) {
|
|
24810
|
+
const { id } = harnessModelRefSchema.parse(ref);
|
|
24811
|
+
if (!id.startsWith(ENCODED_MODEL_REF_PREFIX))
|
|
24812
|
+
return id;
|
|
24813
|
+
const modelId = Buffer.from(id.slice(ENCODED_MODEL_REF_PREFIX.length), "base64url").toString("utf8");
|
|
24814
|
+
if (encodeGrokModelRef(modelId)?.id !== id)
|
|
24815
|
+
throw new Error("Invalid Grok Model Ref");
|
|
24816
|
+
return modelId;
|
|
24817
|
+
}
|
|
24758
24818
|
function thinkingOptions(value) {
|
|
24759
24819
|
if (!Array.isArray(value))
|
|
24760
24820
|
return [];
|
|
@@ -24775,8 +24835,8 @@ function parseGrokModelState(value) {
|
|
|
24775
24835
|
if (!isRecord16(value) || !nonBlank(value.currentModelId) || !Array.isArray(value.availableModels)) {
|
|
24776
24836
|
return null;
|
|
24777
24837
|
}
|
|
24778
|
-
const currentModel =
|
|
24779
|
-
if (!currentModel
|
|
24838
|
+
const currentModel = encodeGrokModelRef(value.currentModelId);
|
|
24839
|
+
if (!currentModel)
|
|
24780
24840
|
return null;
|
|
24781
24841
|
const allThinking = /* @__PURE__ */ new Map();
|
|
24782
24842
|
const contextWindowTokensByModel = /* @__PURE__ */ new Map();
|
|
@@ -24786,16 +24846,16 @@ function parseGrokModelState(value) {
|
|
|
24786
24846
|
for (const candidate of value.availableModels) {
|
|
24787
24847
|
if (!isRecord16(candidate) || !nonBlank(candidate.modelId) || !nonBlank(candidate.name))
|
|
24788
24848
|
continue;
|
|
24789
|
-
const ref =
|
|
24790
|
-
if (!ref
|
|
24849
|
+
const ref = encodeGrokModelRef(candidate.modelId);
|
|
24850
|
+
if (!ref)
|
|
24791
24851
|
continue;
|
|
24792
24852
|
const metadata = isRecord16(candidate._meta) ? candidate._meta : {};
|
|
24793
24853
|
const options2 = thinkingOptions(metadata.reasoningEfforts);
|
|
24794
24854
|
if (Array.isArray(metadata.contextWindows) && metadata.contextWindows.includes(5e5)) {
|
|
24795
|
-
defaultContextWindowTokensByModel.set(ref.
|
|
24855
|
+
defaultContextWindowTokensByModel.set(ref.id, 5e5);
|
|
24796
24856
|
}
|
|
24797
24857
|
if (typeof metadata.totalContextTokens === "number" && Number.isSafeInteger(metadata.totalContextTokens) && metadata.totalContextTokens > 0) {
|
|
24798
|
-
contextWindowTokensByModel.set(ref.
|
|
24858
|
+
contextWindowTokensByModel.set(ref.id, metadata.totalContextTokens);
|
|
24799
24859
|
}
|
|
24800
24860
|
for (const option of options2)
|
|
24801
24861
|
allThinking.set(option.id, option);
|
|
@@ -24806,22 +24866,22 @@ function parseGrokModelState(value) {
|
|
|
24806
24866
|
}
|
|
24807
24867
|
}
|
|
24808
24868
|
models.push({
|
|
24809
|
-
ref
|
|
24869
|
+
ref,
|
|
24810
24870
|
label: candidate.name,
|
|
24811
24871
|
...options2.length > 0 ? { supportedThinkingOptionIds: options2.map(({ id }) => id) } : {}
|
|
24812
24872
|
});
|
|
24813
24873
|
}
|
|
24814
|
-
if (!models.some(({ ref }) => ref.id === currentModel.
|
|
24874
|
+
if (!models.some(({ ref }) => ref.id === currentModel.id))
|
|
24815
24875
|
return null;
|
|
24816
24876
|
const options = [...allThinking.values()];
|
|
24817
24877
|
return {
|
|
24818
|
-
currentModel
|
|
24878
|
+
currentModel,
|
|
24819
24879
|
contextWindowTokensByModel,
|
|
24820
24880
|
defaultContextWindowTokensByModel,
|
|
24821
24881
|
...currentThinkingOptionId ? { currentThinkingOptionId } : {},
|
|
24822
24882
|
catalog: {
|
|
24823
24883
|
models,
|
|
24824
|
-
defaultModel: currentModel
|
|
24884
|
+
defaultModel: currentModel,
|
|
24825
24885
|
thinkingOptions: options,
|
|
24826
24886
|
...currentThinkingOptionId ? { defaultThinkingOptionId: currentThinkingOptionId } : {}
|
|
24827
24887
|
}
|
|
@@ -24891,7 +24951,20 @@ function productUsageFrom(value) {
|
|
|
24891
24951
|
if (!isRecord17(entry) || typeof entry.product !== "string")
|
|
24892
24952
|
return [];
|
|
24893
24953
|
const usagePercent = finitePercent(entry.usagePercent);
|
|
24894
|
-
|
|
24954
|
+
const labels = {
|
|
24955
|
+
GrokBuild: "Build",
|
|
24956
|
+
GrokChat: "Chat",
|
|
24957
|
+
GrokImagine: "Imagine",
|
|
24958
|
+
GrokVoice: "Voice"
|
|
24959
|
+
};
|
|
24960
|
+
const label = Object.hasOwn(labels, entry.product) ? labels[entry.product] : void 0;
|
|
24961
|
+
return usagePercent === void 0 ? [] : [
|
|
24962
|
+
{
|
|
24963
|
+
product: entry.product,
|
|
24964
|
+
...label ? { localizations: { en: { label }, "zh-CN": { label } } } : {},
|
|
24965
|
+
usagePercent
|
|
24966
|
+
}
|
|
24967
|
+
];
|
|
24895
24968
|
});
|
|
24896
24969
|
return products.length > 0 ? products : void 0;
|
|
24897
24970
|
}
|
|
@@ -25288,6 +25361,7 @@ var grokCommandCatalog = harnessCommandCatalogSchema.parse({
|
|
|
25288
25361
|
{
|
|
25289
25362
|
id: "grok.compact",
|
|
25290
25363
|
invocation: "/compact",
|
|
25364
|
+
localizations: { "zh-CN": { label: "压缩上下文", description: "压缩当前对话上下文" } },
|
|
25291
25365
|
label: "Compact context",
|
|
25292
25366
|
description: "Compact the current conversation context",
|
|
25293
25367
|
argumentMode: "text"
|
|
@@ -25703,7 +25777,7 @@ var GrokHarnessSession = class {
|
|
|
25703
25777
|
this.#configuring = true;
|
|
25704
25778
|
try {
|
|
25705
25779
|
const contextWindow = this.#modelState.defaultContextWindowTokensByModel.get(model2.id);
|
|
25706
|
-
await this.#transport.setModel(model2
|
|
25780
|
+
await this.#transport.setModel(decodeGrokModelRef(model2), thinkingOptionId, contextWindow);
|
|
25707
25781
|
if (contextWindow !== void 0) {
|
|
25708
25782
|
this.#modelState.contextWindowTokensByModel = new Map([
|
|
25709
25783
|
...this.#modelState.contextWindowTokensByModel,
|
|
@@ -26477,10 +26551,15 @@ var GrokAdapter = class {
|
|
|
26477
26551
|
async inspectAccount() {
|
|
26478
26552
|
if (this.#closePromise)
|
|
26479
26553
|
return null;
|
|
26480
|
-
|
|
26554
|
+
const account = await (this.#dependencies.fetchAccount ?? fetchGrokAccount)({
|
|
26481
26555
|
...this.#environment ? { environment: this.#environment } : {},
|
|
26482
26556
|
signal: this.#accountAbort.signal
|
|
26483
26557
|
});
|
|
26558
|
+
if (!account?.credits)
|
|
26559
|
+
return account;
|
|
26560
|
+
const credits = { ...account.credits };
|
|
26561
|
+
delete credits.productUsage;
|
|
26562
|
+
return { ...account, credits };
|
|
26484
26563
|
}
|
|
26485
26564
|
credits() {
|
|
26486
26565
|
return this.#credits;
|
|
@@ -26664,7 +26743,7 @@ var GrokAdapter = class {
|
|
|
26664
26743
|
} : {
|
|
26665
26744
|
kind: "create",
|
|
26666
26745
|
permissionModeId: requestedPermissionModeId,
|
|
26667
|
-
...input.kind === "create" && input.model ? { modelId: input.model
|
|
26746
|
+
...input.kind === "create" && input.model ? { modelId: decodeGrokModelRef(input.model) } : {}
|
|
26668
26747
|
});
|
|
26669
26748
|
}
|
|
26670
26749
|
if (!opened) {
|
|
@@ -26722,7 +26801,7 @@ var GrokAdapter = class {
|
|
|
26722
26801
|
}
|
|
26723
26802
|
const contextWindow = modelState.defaultContextWindowTokensByModel.get(modelState.currentModel.id);
|
|
26724
26803
|
if (modelState.currentModel.id !== nativeModelId || modelState.currentThinkingOptionId !== nativeThinkingOptionId || contextWindow !== void 0 && modelState.contextWindowTokensByModel.get(modelState.currentModel.id) !== contextWindow) {
|
|
26725
|
-
await transport.setModel(modelState.currentModel
|
|
26804
|
+
await transport.setModel(decodeGrokModelRef(modelState.currentModel), modelState.currentThinkingOptionId, contextWindow);
|
|
26726
26805
|
if (contextWindow !== void 0) {
|
|
26727
26806
|
modelState.contextWindowTokensByModel = new Map([
|
|
26728
26807
|
...modelState.contextWindowTokensByModel,
|
|
@@ -14965,6 +14965,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
|
|
|
14965
14965
|
initializeOnly: external_exports.boolean().optional()
|
|
14966
14966
|
});
|
|
14967
14967
|
|
|
14968
|
+
// ../../shared-contracts/dist/harness-presentation.js
|
|
14969
|
+
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
14970
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
|
|
14971
|
+
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
14972
|
+
label: displayText(256).optional(),
|
|
14973
|
+
description: displayText(1024).optional()
|
|
14974
|
+
}).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
14975
|
+
var harnessLocalizedTextSchema = external_exports.record(localeSchema, displayText(4096)).refine((entries) => typeof entries.en === "string", "English fallback is required").refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
14976
|
+
|
|
14968
14977
|
// ../../shared-contracts/dist/model-price-overrides.js
|
|
14969
14978
|
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
14970
14979
|
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
@@ -15385,8 +15394,24 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15385
15394
|
}
|
|
15386
15395
|
});
|
|
15387
15396
|
var usagePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15397
|
+
var accountCreditsPeriodSchema = external_exports.enum([
|
|
15398
|
+
"weekly",
|
|
15399
|
+
"monthly",
|
|
15400
|
+
"five_hour",
|
|
15401
|
+
"seven_day",
|
|
15402
|
+
"unknown"
|
|
15403
|
+
]);
|
|
15404
|
+
var accountCreditsScopeSchema = external_exports.object({
|
|
15405
|
+
id: external_exports.string().min(1).max(256),
|
|
15406
|
+
label: external_exports.string().min(1).max(256),
|
|
15407
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
15408
|
+
}).strict();
|
|
15388
15409
|
var accountCreditsProductUsageSchema = external_exports.object({
|
|
15389
15410
|
product: external_exports.string().min(1),
|
|
15411
|
+
/** Native period and scope, never inferred from the display name. */
|
|
15412
|
+
periodType: accountCreditsPeriodSchema.optional(),
|
|
15413
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
15414
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15390
15415
|
used: external_exports.number().finite().nonnegative().optional(),
|
|
15391
15416
|
// Zero is a real empty cap, not an absent field.
|
|
15392
15417
|
limit: external_exports.number().finite().nonnegative().optional(),
|
|
@@ -15408,8 +15433,10 @@ var accountCreditsSnapshotSchema = external_exports.object({
|
|
|
15408
15433
|
label: external_exports.string().min(1).optional(),
|
|
15409
15434
|
usedPercent: usagePercentSchema.optional(),
|
|
15410
15435
|
remaining: external_exports.number().finite().optional(),
|
|
15436
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
15437
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15411
15438
|
resetsAt: external_exports.string().min(1).optional(),
|
|
15412
|
-
periodType:
|
|
15439
|
+
periodType: accountCreditsPeriodSchema,
|
|
15413
15440
|
productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
|
|
15414
15441
|
resetCredits: accountResetCreditsSchema.optional()
|
|
15415
15442
|
}).strict().superRefine((credits, context) => {
|
|
@@ -15434,7 +15461,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
|
|
|
15434
15461
|
var threadUsageInspectionSchema = external_exports.object({
|
|
15435
15462
|
threadId: hostThreadIdSchema,
|
|
15436
15463
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
15437
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15464
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
15465
|
+
/** Whether this source can provide cached account quota independently of usage. */
|
|
15466
|
+
accountCreditsSupported: external_exports.boolean().optional()
|
|
15438
15467
|
}).strict();
|
|
15439
15468
|
|
|
15440
15469
|
// ../../shared-contracts/dist/harness-accounts.js
|
|
@@ -15561,7 +15590,8 @@ var harnessPermissionModeSchema = external_exports.object({
|
|
|
15561
15590
|
id: harnessPermissionModeIdSchema,
|
|
15562
15591
|
label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
|
|
15563
15592
|
description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
15564
|
-
dangerous: external_exports.boolean().optional()
|
|
15593
|
+
dangerous: external_exports.boolean().optional(),
|
|
15594
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
15565
15595
|
}).strict();
|
|
15566
15596
|
var harnessPermissionModeCatalogSchema = external_exports.object({
|
|
15567
15597
|
modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
|
|
@@ -15884,6 +15914,8 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
15884
15914
|
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
15885
15915
|
message: external_exports.string().max(2048).optional(),
|
|
15886
15916
|
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
15917
|
+
/** Safe plugin-owned explanation, distinct from raw diagnostic message. */
|
|
15918
|
+
notice: harnessLocalizedTextSchema.optional(),
|
|
15887
15919
|
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
15888
15920
|
}).strict();
|
|
15889
15921
|
|
|
@@ -16022,6 +16054,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
|
|
|
16022
16054
|
invocation: commandInvocationSchema,
|
|
16023
16055
|
label: commandLabelSchema,
|
|
16024
16056
|
description: commandDescriptionSchema.optional(),
|
|
16057
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
16025
16058
|
argumentMode: external_exports.enum(["none", "text"]),
|
|
16026
16059
|
/**
|
|
16027
16060
|
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
@@ -20027,11 +20060,23 @@ function gatewayPermissionModes() {
|
|
|
20027
20060
|
{
|
|
20028
20061
|
id: "default",
|
|
20029
20062
|
label: "原生审批策略",
|
|
20063
|
+
localizations: {
|
|
20064
|
+
en: {
|
|
20065
|
+
label: "Native approval policy",
|
|
20066
|
+
description: "Follow the Hermes global approval policy; disable YOLO for this Session."
|
|
20067
|
+
}
|
|
20068
|
+
},
|
|
20030
20069
|
description: "遵循 Hermes 全局审批策略,关闭本会话 YOLO。"
|
|
20031
20070
|
},
|
|
20032
20071
|
{
|
|
20033
20072
|
id: "dont_ask",
|
|
20034
20073
|
label: "会话 YOLO",
|
|
20074
|
+
localizations: {
|
|
20075
|
+
en: {
|
|
20076
|
+
label: "Session YOLO",
|
|
20077
|
+
description: "Automatically approve Hermes tool actions in this Session."
|
|
20078
|
+
}
|
|
20079
|
+
},
|
|
20035
20080
|
description: "本会话自动批准 Hermes 工具操作。",
|
|
20036
20081
|
dangerous: true
|
|
20037
20082
|
}
|
|
@@ -20434,6 +20479,10 @@ function createHermesInstallation(environment, command) {
|
|
|
20434
20479
|
updateAvailable: false,
|
|
20435
20480
|
canUpdate: false,
|
|
20436
20481
|
messageCode: "hermes-update-plan-unavailable",
|
|
20482
|
+
notice: {
|
|
20483
|
+
en: "This Hermes release does not expose a safe update plan. Use the original installer.",
|
|
20484
|
+
"zh-CN": "此 Hermes 版本不提供安全的更新计划,请使用原安装方式更新。"
|
|
20485
|
+
},
|
|
20437
20486
|
message: "This Hermes release does not expose a safe update plan. Use the original installer."
|
|
20438
20487
|
};
|
|
20439
20488
|
const plan = await run(["update", "--plan"]);
|
|
@@ -20446,6 +20495,10 @@ function createHermesInstallation(environment, command) {
|
|
|
20446
20495
|
updateAvailable: false,
|
|
20447
20496
|
canUpdate: false,
|
|
20448
20497
|
messageCode: "hermes-externally-managed",
|
|
20498
|
+
notice: {
|
|
20499
|
+
en: "This Hermes installation is managed externally. Update it through its desktop app, container, or original package manager.",
|
|
20500
|
+
"zh-CN": "此 Hermes 安装由外部工具管理,请通过其桌面应用、容器或原包管理器更新。"
|
|
20501
|
+
},
|
|
20449
20502
|
message: "This Hermes installation is managed externally. Update it through its desktop app, container, or original package manager."
|
|
20450
20503
|
};
|
|
20451
20504
|
const output = await run(["update", "--check"]);
|
|
@@ -20464,6 +20517,13 @@ function createHermesInstallation(environment, command) {
|
|
|
20464
20517
|
canUpdate,
|
|
20465
20518
|
...updateAvailable && !release ? { latestVersionKind: "tracking-branch" } : {},
|
|
20466
20519
|
messageCode: canUpdate ? "hermes-update-channel" : "hermes-manual-update",
|
|
20520
|
+
notice: canUpdate ? {
|
|
20521
|
+
en: "Uses Hermes's configured update channel. Gateway restarts are deferred; existing processes keep their running code.",
|
|
20522
|
+
"zh-CN": "使用 Hermes 配置的更新渠道,暂不重启 Gateway;现有进程继续运行原有代码。"
|
|
20523
|
+
} : {
|
|
20524
|
+
en: "Use the native updater manually. Safe non-interactive updates require a clean source checkout, commit identity, and Gateway restart deferral.",
|
|
20525
|
+
"zh-CN": "请手动使用原生更新器。安全的非交互更新要求源码目录无未提交修改、可识别当前提交,并支持推迟 Gateway 重启。"
|
|
20526
|
+
},
|
|
20467
20527
|
message: canUpdate ? "Uses Hermes's configured update channel. Gateway restarts are deferred; existing processes keep their running code." : "Use the native updater manually. Safe non-interactive updates require a clean source checkout, commit identity, and Gateway restart deferral."
|
|
20468
20528
|
};
|
|
20469
20529
|
},
|
|
@@ -15085,6 +15085,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
|
|
|
15085
15085
|
initializeOnly: external_exports.boolean().optional()
|
|
15086
15086
|
});
|
|
15087
15087
|
|
|
15088
|
+
// ../../shared-contracts/dist/harness-presentation.js
|
|
15089
|
+
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
15090
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text) => text.trim().length > 0);
|
|
15091
|
+
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
15092
|
+
label: displayText(256).optional(),
|
|
15093
|
+
description: displayText(1024).optional()
|
|
15094
|
+
}).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
15095
|
+
var harnessLocalizedTextSchema = external_exports.record(localeSchema, displayText(4096)).refine((entries) => typeof entries.en === "string", "English fallback is required").refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
15096
|
+
|
|
15088
15097
|
// ../../shared-contracts/dist/model-price-overrides.js
|
|
15089
15098
|
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
15090
15099
|
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
@@ -15505,8 +15514,24 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15505
15514
|
}
|
|
15506
15515
|
});
|
|
15507
15516
|
var usagePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15517
|
+
var accountCreditsPeriodSchema = external_exports.enum([
|
|
15518
|
+
"weekly",
|
|
15519
|
+
"monthly",
|
|
15520
|
+
"five_hour",
|
|
15521
|
+
"seven_day",
|
|
15522
|
+
"unknown"
|
|
15523
|
+
]);
|
|
15524
|
+
var accountCreditsScopeSchema = external_exports.object({
|
|
15525
|
+
id: external_exports.string().min(1).max(256),
|
|
15526
|
+
label: external_exports.string().min(1).max(256),
|
|
15527
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
15528
|
+
}).strict();
|
|
15508
15529
|
var accountCreditsProductUsageSchema = external_exports.object({
|
|
15509
15530
|
product: external_exports.string().min(1),
|
|
15531
|
+
/** Native period and scope, never inferred from the display name. */
|
|
15532
|
+
periodType: accountCreditsPeriodSchema.optional(),
|
|
15533
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
15534
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15510
15535
|
used: external_exports.number().finite().nonnegative().optional(),
|
|
15511
15536
|
// Zero is a real empty cap, not an absent field.
|
|
15512
15537
|
limit: external_exports.number().finite().nonnegative().optional(),
|
|
@@ -15528,8 +15553,10 @@ var accountCreditsSnapshotSchema = external_exports.object({
|
|
|
15528
15553
|
label: external_exports.string().min(1).optional(),
|
|
15529
15554
|
usedPercent: usagePercentSchema.optional(),
|
|
15530
15555
|
remaining: external_exports.number().finite().optional(),
|
|
15556
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
15557
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15531
15558
|
resetsAt: external_exports.string().min(1).optional(),
|
|
15532
|
-
periodType:
|
|
15559
|
+
periodType: accountCreditsPeriodSchema,
|
|
15533
15560
|
productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
|
|
15534
15561
|
resetCredits: accountResetCreditsSchema.optional()
|
|
15535
15562
|
}).strict().superRefine((credits, context) => {
|
|
@@ -15554,7 +15581,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
|
|
|
15554
15581
|
var threadUsageInspectionSchema = external_exports.object({
|
|
15555
15582
|
threadId: hostThreadIdSchema,
|
|
15556
15583
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
15557
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15584
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
15585
|
+
/** Whether this source can provide cached account quota independently of usage. */
|
|
15586
|
+
accountCreditsSupported: external_exports.boolean().optional()
|
|
15558
15587
|
}).strict();
|
|
15559
15588
|
|
|
15560
15589
|
// ../../shared-contracts/dist/harness-accounts.js
|
|
@@ -15681,7 +15710,8 @@ var harnessPermissionModeSchema = external_exports.object({
|
|
|
15681
15710
|
id: harnessPermissionModeIdSchema,
|
|
15682
15711
|
label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
|
|
15683
15712
|
description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
15684
|
-
dangerous: external_exports.boolean().optional()
|
|
15713
|
+
dangerous: external_exports.boolean().optional(),
|
|
15714
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
15685
15715
|
}).strict();
|
|
15686
15716
|
var harnessPermissionModeCatalogSchema = external_exports.object({
|
|
15687
15717
|
modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
|
|
@@ -16004,6 +16034,8 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
16004
16034
|
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
16005
16035
|
message: external_exports.string().max(2048).optional(),
|
|
16006
16036
|
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
16037
|
+
/** Safe plugin-owned explanation, distinct from raw diagnostic message. */
|
|
16038
|
+
notice: harnessLocalizedTextSchema.optional(),
|
|
16007
16039
|
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
16008
16040
|
}).strict();
|
|
16009
16041
|
|
|
@@ -16142,6 +16174,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
|
|
|
16142
16174
|
invocation: commandInvocationSchema,
|
|
16143
16175
|
label: commandLabelSchema,
|
|
16144
16176
|
description: commandDescriptionSchema.optional(),
|
|
16177
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
16145
16178
|
argumentMode: external_exports.enum(["none", "text"]),
|
|
16146
16179
|
/**
|
|
16147
16180
|
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
@@ -21382,6 +21415,8 @@ function projectKimiUsages(payload) {
|
|
|
21382
21415
|
return [
|
|
21383
21416
|
{
|
|
21384
21417
|
product: "Kimi Code · 5-hour window",
|
|
21418
|
+
periodType: "five_hour",
|
|
21419
|
+
scope: { id: "kimi-code", label: "Kimi Code" },
|
|
21385
21420
|
usagePercent: share.usedPercent,
|
|
21386
21421
|
...share.resetsAt ? { resetsAt: share.resetsAt } : {}
|
|
21387
21422
|
}
|
|
@@ -22838,21 +22873,37 @@ var kimiPermissionModeCatalog = harnessPermissionModeCatalogSchema.parse({
|
|
|
22838
22873
|
{
|
|
22839
22874
|
id: harnessPermissionModeIdSchema.parse("default"),
|
|
22840
22875
|
label: "询问确认",
|
|
22876
|
+
localizations: {
|
|
22877
|
+
en: { label: "Ask for approval" },
|
|
22878
|
+
"zh-CN": { description: "工具正常执行,需要时手动审批。" }
|
|
22879
|
+
},
|
|
22841
22880
|
description: "Manual approvals; tools execute normally."
|
|
22842
22881
|
},
|
|
22843
22882
|
{
|
|
22844
22883
|
id: harnessPermissionModeIdSchema.parse("plan"),
|
|
22845
22884
|
label: "计划模式",
|
|
22885
|
+
localizations: {
|
|
22886
|
+
en: { label: "Plan mode" },
|
|
22887
|
+
"zh-CN": { description: "只读规划,不执行工具。" }
|
|
22888
|
+
},
|
|
22846
22889
|
description: "Read-only planning; no tool execution."
|
|
22847
22890
|
},
|
|
22848
22891
|
{
|
|
22849
22892
|
id: harnessPermissionModeIdSchema.parse("auto"),
|
|
22850
22893
|
label: "按需询问",
|
|
22894
|
+
localizations: {
|
|
22895
|
+
en: { label: "Ask as needed" },
|
|
22896
|
+
"zh-CN": { description: "自动批准安全操作。" }
|
|
22897
|
+
},
|
|
22851
22898
|
description: "Auto-approve safe operations."
|
|
22852
22899
|
},
|
|
22853
22900
|
{
|
|
22854
22901
|
id: harnessPermissionModeIdSchema.parse("yolo"),
|
|
22855
22902
|
label: "无需询问",
|
|
22903
|
+
localizations: {
|
|
22904
|
+
en: { label: "No approval prompts" },
|
|
22905
|
+
"zh-CN": { description: "自动批准所有操作。" }
|
|
22906
|
+
},
|
|
22856
22907
|
description: "Auto-approve everything.",
|
|
22857
22908
|
dangerous: true
|
|
22858
22909
|
}
|
|
@@ -24117,6 +24168,11 @@ async function copyKimiCommandHistory(turns, sessionId, options) {
|
|
|
24117
24168
|
}
|
|
24118
24169
|
|
|
24119
24170
|
// dist/slash-commands.js
|
|
24171
|
+
var KIMI_COMPACT_COMMAND = {
|
|
24172
|
+
name: "compact",
|
|
24173
|
+
description: "Compact the conversation context",
|
|
24174
|
+
input: { hint: "prompt" }
|
|
24175
|
+
};
|
|
24120
24176
|
function buildKimiCommandCatalog(availableCommands) {
|
|
24121
24177
|
const seenIds = /* @__PURE__ */ new Set();
|
|
24122
24178
|
const descriptors = [];
|
|
@@ -24136,17 +24192,16 @@ function buildKimiCommandCatalog(availableCommands) {
|
|
|
24136
24192
|
invocation: `/${cleanId}`,
|
|
24137
24193
|
label: cleanId,
|
|
24138
24194
|
argumentMode,
|
|
24139
|
-
...description ? { description } : {}
|
|
24195
|
+
...description ? { description } : {},
|
|
24196
|
+
// Only the known native built-in gets plugin copy. A live command with
|
|
24197
|
+
// the same name but different wording/input retains its own semantics.
|
|
24198
|
+
...cleanId === KIMI_COMPACT_COMMAND.name && rawDesc === KIMI_COMPACT_COMMAND.description && command.input?.hint === KIMI_COMPACT_COMMAND.input?.hint ? { localizations: { "zh-CN": { label: "压缩上下文", description: "压缩当前对话上下文" } } } : {}
|
|
24140
24199
|
});
|
|
24141
24200
|
}
|
|
24142
24201
|
return harnessCommandCatalogSchema.parse({ commands: descriptors });
|
|
24143
24202
|
}
|
|
24144
24203
|
var KIMI_DEFAULT_COMMANDS = [
|
|
24145
|
-
|
|
24146
|
-
name: "compact",
|
|
24147
|
-
description: "Compact the conversation context",
|
|
24148
|
-
input: { hint: "prompt" }
|
|
24149
|
-
},
|
|
24204
|
+
KIMI_COMPACT_COMMAND,
|
|
24150
24205
|
{
|
|
24151
24206
|
name: "status",
|
|
24152
24207
|
description: "Show current session status"
|