@liberseek/boft-cli-win32-arm64 0.8.1 → 0.8.2
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 +64 -5
- 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.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
|
@@ -14604,6 +14604,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
|
|
|
14604
14604
|
initializeOnly: external_exports.boolean().optional()
|
|
14605
14605
|
});
|
|
14606
14606
|
|
|
14607
|
+
// ../../shared-contracts/dist/harness-presentation.js
|
|
14608
|
+
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
14609
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
|
|
14610
|
+
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
14611
|
+
label: displayText(256).optional(),
|
|
14612
|
+
description: displayText(1024).optional()
|
|
14613
|
+
}).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
14614
|
+
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");
|
|
14615
|
+
|
|
14607
14616
|
// ../../shared-contracts/dist/model-price-overrides.js
|
|
14608
14617
|
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
14609
14618
|
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
@@ -15024,8 +15033,24 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15024
15033
|
}
|
|
15025
15034
|
});
|
|
15026
15035
|
var usagePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15036
|
+
var accountCreditsPeriodSchema = external_exports.enum([
|
|
15037
|
+
"weekly",
|
|
15038
|
+
"monthly",
|
|
15039
|
+
"five_hour",
|
|
15040
|
+
"seven_day",
|
|
15041
|
+
"unknown"
|
|
15042
|
+
]);
|
|
15043
|
+
var accountCreditsScopeSchema = external_exports.object({
|
|
15044
|
+
id: external_exports.string().min(1).max(256),
|
|
15045
|
+
label: external_exports.string().min(1).max(256),
|
|
15046
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
15047
|
+
}).strict();
|
|
15027
15048
|
var accountCreditsProductUsageSchema = external_exports.object({
|
|
15028
15049
|
product: external_exports.string().min(1),
|
|
15050
|
+
/** Native period and scope, never inferred from the display name. */
|
|
15051
|
+
periodType: accountCreditsPeriodSchema.optional(),
|
|
15052
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
15053
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15029
15054
|
used: external_exports.number().finite().nonnegative().optional(),
|
|
15030
15055
|
// Zero is a real empty cap, not an absent field.
|
|
15031
15056
|
limit: external_exports.number().finite().nonnegative().optional(),
|
|
@@ -15047,8 +15072,10 @@ var accountCreditsSnapshotSchema = external_exports.object({
|
|
|
15047
15072
|
label: external_exports.string().min(1).optional(),
|
|
15048
15073
|
usedPercent: usagePercentSchema.optional(),
|
|
15049
15074
|
remaining: external_exports.number().finite().optional(),
|
|
15075
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
15076
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15050
15077
|
resetsAt: external_exports.string().min(1).optional(),
|
|
15051
|
-
periodType:
|
|
15078
|
+
periodType: accountCreditsPeriodSchema,
|
|
15052
15079
|
productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
|
|
15053
15080
|
resetCredits: accountResetCreditsSchema.optional()
|
|
15054
15081
|
}).strict().superRefine((credits, context) => {
|
|
@@ -15073,7 +15100,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
|
|
|
15073
15100
|
var threadUsageInspectionSchema = external_exports.object({
|
|
15074
15101
|
threadId: hostThreadIdSchema,
|
|
15075
15102
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
15076
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15103
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
15104
|
+
/** Whether this source can provide cached account quota independently of usage. */
|
|
15105
|
+
accountCreditsSupported: external_exports.boolean().optional()
|
|
15077
15106
|
}).strict();
|
|
15078
15107
|
|
|
15079
15108
|
// ../../shared-contracts/dist/harness-accounts.js
|
|
@@ -15200,7 +15229,8 @@ var harnessPermissionModeSchema = external_exports.object({
|
|
|
15200
15229
|
id: harnessPermissionModeIdSchema,
|
|
15201
15230
|
label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
|
|
15202
15231
|
description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
15203
|
-
dangerous: external_exports.boolean().optional()
|
|
15232
|
+
dangerous: external_exports.boolean().optional(),
|
|
15233
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
15204
15234
|
}).strict();
|
|
15205
15235
|
var harnessPermissionModeCatalogSchema = external_exports.object({
|
|
15206
15236
|
modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
|
|
@@ -15523,6 +15553,8 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
15523
15553
|
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
15524
15554
|
message: external_exports.string().max(2048).optional(),
|
|
15525
15555
|
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
15556
|
+
/** Safe plugin-owned explanation, distinct from raw diagnostic message. */
|
|
15557
|
+
notice: harnessLocalizedTextSchema.optional(),
|
|
15526
15558
|
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
15527
15559
|
}).strict();
|
|
15528
15560
|
|
|
@@ -15661,6 +15693,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
|
|
|
15661
15693
|
invocation: commandInvocationSchema,
|
|
15662
15694
|
label: commandLabelSchema,
|
|
15663
15695
|
description: commandDescriptionSchema.optional(),
|
|
15696
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15664
15697
|
argumentMode: external_exports.enum(["none", "text"]),
|
|
15665
15698
|
/**
|
|
15666
15699
|
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
@@ -17212,6 +17245,8 @@ var BrokeredHarnessAdapter = class {
|
|
|
17212
17245
|
commandCatalog;
|
|
17213
17246
|
liveCommandCatalog;
|
|
17214
17247
|
harnessId;
|
|
17248
|
+
credits;
|
|
17249
|
+
refreshCredits;
|
|
17215
17250
|
#descriptorPath;
|
|
17216
17251
|
#forwardEnvironment;
|
|
17217
17252
|
#isInstalled;
|
|
@@ -17311,6 +17346,10 @@ var BrokeredHarnessAdapter = class {
|
|
|
17311
17346
|
}
|
|
17312
17347
|
constructor(input = {}) {
|
|
17313
17348
|
this.harnessId = harnessPluginIdSchema.parse(input.harnessId ?? "claude-code");
|
|
17349
|
+
if (input.accountCredits !== false) {
|
|
17350
|
+
this.credits = () => this.#credits;
|
|
17351
|
+
this.refreshCredits = () => this.#refreshAccountCredits();
|
|
17352
|
+
}
|
|
17314
17353
|
this.#forwardEnvironment = input.forwardDelegationEnvironment === true;
|
|
17315
17354
|
if (input.commandCatalog)
|
|
17316
17355
|
this.commandCatalog = input.commandCatalog;
|
|
@@ -17322,10 +17361,7 @@ var BrokeredHarnessAdapter = class {
|
|
|
17322
17361
|
this.#startBroker = input.startBroker === false ? void 0 : input.startBroker ?? (process.platform === "darwin" && !input.descriptorPath ? () => startBrokerLaunchAgent(this.harnessId, environment) : void 0);
|
|
17323
17362
|
this.#startTimeoutMs = input.startTimeoutMs ?? BROKER_START_TIMEOUT_MS;
|
|
17324
17363
|
}
|
|
17325
|
-
|
|
17326
|
-
return this.#credits;
|
|
17327
|
-
}
|
|
17328
|
-
refreshCredits() {
|
|
17364
|
+
#refreshAccountCredits() {
|
|
17329
17365
|
if (this.#closed)
|
|
17330
17366
|
return Promise.resolve(null);
|
|
17331
17367
|
if (this.#creditsRefresh)
|
|
@@ -17643,6 +17679,27 @@ function nativeError(error51, profile = CODEBUDDY_RUNTIME_PROFILE) {
|
|
|
17643
17679
|
function failure(code, message, profile = CODEBUDDY_RUNTIME_PROFILE) {
|
|
17644
17680
|
return { ok: false, error: nativeError(new CodeBuddyError(code, message), profile) };
|
|
17645
17681
|
}
|
|
17682
|
+
function nativeTurnError(stopReason, meta3, profile) {
|
|
17683
|
+
const fallback = `Native Turn stopped: ${text(stopReason) || "unknown"} (${text(meta3["codebuddy.ai/outcome"]) || "no native outcome"})`;
|
|
17684
|
+
const raw = text(meta3["codebuddy.ai/errorMessage"]).trim();
|
|
17685
|
+
let diagnostic = "";
|
|
17686
|
+
let category;
|
|
17687
|
+
if (raw) {
|
|
17688
|
+
try {
|
|
17689
|
+
const error51 = record2(JSON.parse(raw));
|
|
17690
|
+
const data = record2(error51.data);
|
|
17691
|
+
diagnostic = text(data.details).trim() || text(error51.message).trim();
|
|
17692
|
+
category = data.category;
|
|
17693
|
+
} catch {
|
|
17694
|
+
diagnostic = raw;
|
|
17695
|
+
}
|
|
17696
|
+
}
|
|
17697
|
+
return nativeError(new CodeBuddyError(
|
|
17698
|
+
// -32000 is shared by native refusals; the category identifies authentication failures.
|
|
17699
|
+
category === "auth" ? "authenticationRequired" : "nativeFailure",
|
|
17700
|
+
diagnostic ? `${fallback}: ${diagnostic}` : fallback
|
|
17701
|
+
), profile);
|
|
17702
|
+
}
|
|
17646
17703
|
async function bounded(operation, milliseconds, label, onTimeout) {
|
|
17647
17704
|
let timer;
|
|
17648
17705
|
try {
|
|
@@ -17664,6 +17721,40 @@ async function bounded(operation, milliseconds, label, onTimeout) {
|
|
|
17664
17721
|
}
|
|
17665
17722
|
}
|
|
17666
17723
|
|
|
17724
|
+
// ../codebuddy/dist/permission-presentation.js
|
|
17725
|
+
var labels = {
|
|
17726
|
+
"Always Ask": "始终询问",
|
|
17727
|
+
"Accept Edits": "接受编辑",
|
|
17728
|
+
Plan: "规划模式",
|
|
17729
|
+
Auto: "自动",
|
|
17730
|
+
"Auto mode": "自动模式",
|
|
17731
|
+
"Don't Ask": "不询问",
|
|
17732
|
+
"Bypass Permissions": "绕过权限",
|
|
17733
|
+
"Full Access": "完全访问",
|
|
17734
|
+
Delegate: "由父会话管理",
|
|
17735
|
+
Default: "默认"
|
|
17736
|
+
};
|
|
17737
|
+
var descriptions = {
|
|
17738
|
+
"Prompts for permission on first use of each tool": "首次使用每种工具时请求权限。",
|
|
17739
|
+
"Automatically accepts file edit permissions for the session": "自动接受本会话中的文件编辑权限。",
|
|
17740
|
+
"Agent can analyze but not modify files or execute commands": "Agent 可以分析,但不能修改文件或执行命令。",
|
|
17741
|
+
"An AI classifier reviews actions that would normally prompt: safe ones are auto-approved, risky ones are denied. If the classifier is unavailable, the action falls back to a prompt (or is denied when prompts cannot be shown)": "由 AI 分类器评估原本需要询问的操作:安全操作自动批准,风险操作拒绝。分类器不可用时改为询问;无法显示询问时拒绝。",
|
|
17742
|
+
"Does not show permission prompts; pre-approved and safe read-only actions run, everything else that would prompt is denied": "不显示权限询问;已获批准和安全的只读操作可以执行,其余原本需要询问的操作会被拒绝。",
|
|
17743
|
+
"Skips all permission prompts": "跳过常规权限询问。",
|
|
17744
|
+
"Skips ALL permission checks including dangerous commands for all agents": "为所有 Agent 跳过全部权限检查,包括危险命令。",
|
|
17745
|
+
"Permissions managed by parent session": "由父会话管理权限。"
|
|
17746
|
+
};
|
|
17747
|
+
function permissionLocalizations(label, description) {
|
|
17748
|
+
const localizedLabel = Object.hasOwn(labels, label) ? labels[label] : void 0;
|
|
17749
|
+
const localizedDescription = Object.hasOwn(descriptions, description) ? descriptions[description] : void 0;
|
|
17750
|
+
return {
|
|
17751
|
+
"zh-CN": {
|
|
17752
|
+
...localizedLabel ? { label: localizedLabel } : {},
|
|
17753
|
+
...localizedDescription ? { description: localizedDescription } : {}
|
|
17754
|
+
}
|
|
17755
|
+
};
|
|
17756
|
+
}
|
|
17757
|
+
|
|
17667
17758
|
// ../codebuddy/dist/configuration.js
|
|
17668
17759
|
var CODEBUDDY_CAPABILITIES = {
|
|
17669
17760
|
configuration: {
|
|
@@ -17721,6 +17812,7 @@ function configuration(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
|
|
|
17721
17812
|
modes: rows(mode.options).map((option) => ({
|
|
17722
17813
|
id: option.value,
|
|
17723
17814
|
label: option.name,
|
|
17815
|
+
localizations: permissionLocalizations(text(option.name), text(option.description)),
|
|
17724
17816
|
...option.description ? { description: option.description } : {},
|
|
17725
17817
|
...["bypassPermissions", "fullAccess"].includes(text(option.value)) ? { dangerous: true } : {}
|
|
17726
17818
|
})),
|
|
@@ -18207,6 +18299,11 @@ function commandCatalog(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
|
|
|
18207
18299
|
id: `${profile.harnessId}.${name}`,
|
|
18208
18300
|
invocation: `/${name}`,
|
|
18209
18301
|
label: name,
|
|
18302
|
+
...name === "compact" && !skill ? {
|
|
18303
|
+
localizations: {
|
|
18304
|
+
"zh-CN": { label: "压缩上下文", description: "压缩当前对话上下文" }
|
|
18305
|
+
}
|
|
18306
|
+
} : {},
|
|
18210
18307
|
...text(entry.description).trim() ? { description: text(entry.description).trim().slice(0, 512) } : {},
|
|
18211
18308
|
argumentMode: name === "compact" || record2(entry.input).hint || record2(entry._meta).type === "skill" ? "text" : "none",
|
|
18212
18309
|
...record2(entry._meta).type === "skill" ? { kind: "skill" } : {}
|
|
@@ -25763,7 +25860,7 @@ var CodeBuddySession = class {
|
|
|
25763
25860
|
// Those remain visible on individual Items; they do not fail the completed Turn.
|
|
25764
25861
|
(!meta3["codebuddy.ai/outcome"] || meta3["codebuddy.ai/outcome"] === "SUCCESS" || meta3["codebuddy.ai/outcome"] === "PARTIAL_SUCCESS") ? { status: "succeeded" } : {
|
|
25765
25862
|
status: "failed",
|
|
25766
|
-
error:
|
|
25863
|
+
error: nativeTurnError(stop, meta3, this.profile)
|
|
25767
25864
|
};
|
|
25768
25865
|
const snapshot = await this.#snapshot();
|
|
25769
25866
|
const added = snapshot.turns.filter((turn) => !active.before.has(turn.nativeTurnRef.nativeTurnKey));
|
|
@@ -26070,6 +26167,121 @@ function workBuddyDelegationArguments(environment, ephemeral) {
|
|
|
26070
26167
|
return ["--append-system-prompt", WORKBUDDY_DELEGATION_INSTRUCTIONS];
|
|
26071
26168
|
}
|
|
26072
26169
|
|
|
26170
|
+
// dist/credential-bootstrap.js
|
|
26171
|
+
var WORKBUDDY_CREDENTIAL_PRELOAD = String.raw`
|
|
26172
|
+
(() => {
|
|
26173
|
+
const env = process.env;
|
|
26174
|
+
const bootstrapEnvironment = [
|
|
26175
|
+
"CODEBUDDY_SIDECAR_CREDENTIAL_BOOTSTRAP_SOCKET",
|
|
26176
|
+
"CODEBUDDY_SIDECAR_READY_SOCKET",
|
|
26177
|
+
"CODEBUDDY_SIDECAR_READY_TOKEN",
|
|
26178
|
+
"CODEBUDDY_SIDECAR_READY_SESSION_ID",
|
|
26179
|
+
];
|
|
26180
|
+
if (bootstrapEnvironment.some(name => env[name] !== undefined)) {
|
|
26181
|
+
if (!["WORKBUDDY_AT_REST_ENCRYPTION", ...bootstrapEnvironment].every(name => env[name]?.trim())) {
|
|
26182
|
+
throw Error("WorkBuddy credential bootstrap environment is incomplete");
|
|
26183
|
+
}
|
|
26184
|
+
return;
|
|
26185
|
+
}
|
|
26186
|
+
const policy = env.WORKBUDDY_AT_REST_ENCRYPTION?.trim();
|
|
26187
|
+
// Other explicit policies remain owned by the native CLI.
|
|
26188
|
+
if (policy && policy !== "fields") return;
|
|
26189
|
+
|
|
26190
|
+
let provider;
|
|
26191
|
+
try {
|
|
26192
|
+
provider = process._linkedBinding("electron_browser_workbuddy_storage");
|
|
26193
|
+
} catch {
|
|
26194
|
+
// Older app runtimes predate encrypted credential fields.
|
|
26195
|
+
return;
|
|
26196
|
+
}
|
|
26197
|
+
const crypto = require("node:crypto");
|
|
26198
|
+
const net = require("node:net");
|
|
26199
|
+
const fs = require("node:fs");
|
|
26200
|
+
const path = require("node:path");
|
|
26201
|
+
let payload;
|
|
26202
|
+
try { payload = JSON.parse(provider.loggerGet()); }
|
|
26203
|
+
catch { throw Error("WorkBuddy credential key provider is unavailable"); }
|
|
26204
|
+
let secret = payload && payload.atRestSecretKey;
|
|
26205
|
+
const decoded = typeof secret === "string" ? Buffer.from(secret, "base64") : Buffer.alloc(0);
|
|
26206
|
+
const valid = payload && payload.version === 1 && decoded.length === 32 &&
|
|
26207
|
+
decoded.toString("base64") === secret && !decoded.every(byte => byte === 0);
|
|
26208
|
+
decoded.fill(0);
|
|
26209
|
+
if (!valid) throw Error("WorkBuddy credential key payload is unsupported");
|
|
26210
|
+
// Match the native normalizeAtRestKeyPayload; the base64 text is hashed, not its decoded bytes.
|
|
26211
|
+
const key = crypto.createHash("sha256").update(secret, "utf8").digest();
|
|
26212
|
+
secret = undefined;
|
|
26213
|
+
payload = undefined;
|
|
26214
|
+
const token = crypto.randomBytes(24).toString("hex");
|
|
26215
|
+
const sessionId = crypto.randomUUID();
|
|
26216
|
+
let directory;
|
|
26217
|
+
let socketPath;
|
|
26218
|
+
if (process.platform === "win32") {
|
|
26219
|
+
socketPath = "\\\\.\\pipe\\codexhost-wb-" + process.pid + "-" + token;
|
|
26220
|
+
} else {
|
|
26221
|
+
let root = require("node:os").tmpdir();
|
|
26222
|
+
if (Buffer.byteLength(root) > 65) root = "/tmp";
|
|
26223
|
+
directory = fs.mkdtempSync(path.join(root, "ch-wb-"));
|
|
26224
|
+
fs.chmodSync(directory, 0o700);
|
|
26225
|
+
socketPath = path.join(directory, "c");
|
|
26226
|
+
}
|
|
26227
|
+
const cleanup = () => {
|
|
26228
|
+
if (directory) try { fs.rmSync(directory, {recursive:true,force:true}); } catch {}
|
|
26229
|
+
};
|
|
26230
|
+
process.once("exit", cleanup);
|
|
26231
|
+
Object.assign(env, {
|
|
26232
|
+
WORKBUDDY_AT_REST_ENCRYPTION: "fields",
|
|
26233
|
+
CODEBUDDY_SIDECAR_CREDENTIAL_BOOTSTRAP_SOCKET: socketPath,
|
|
26234
|
+
CODEBUDDY_SIDECAR_READY_SOCKET: socketPath + "-ready",
|
|
26235
|
+
CODEBUDDY_SIDECAR_READY_TOKEN: token,
|
|
26236
|
+
CODEBUDDY_SIDECAR_READY_SESSION_ID: sessionId,
|
|
26237
|
+
});
|
|
26238
|
+
let message = JSON.stringify({version:1,sessionId,token,pid:process.pid,bootstrap:{
|
|
26239
|
+
version:1,policy:"fields",
|
|
26240
|
+
symmetricKey:{keyId:crypto.createHash("sha256").update(key).digest("hex").slice(0,16),keyBase64:key.toString("base64")},
|
|
26241
|
+
asymmetricUnavailable:"missing-key",
|
|
26242
|
+
}}) + "\n";
|
|
26243
|
+
key.fill(0);
|
|
26244
|
+
let done = false;
|
|
26245
|
+
let socket;
|
|
26246
|
+
const finish = success => {
|
|
26247
|
+
if (done) return;
|
|
26248
|
+
done = true;
|
|
26249
|
+
clearTimeout(timer);
|
|
26250
|
+
socket && socket.destroy();
|
|
26251
|
+
message = "";
|
|
26252
|
+
cleanup();
|
|
26253
|
+
process.removeListener("exit", cleanup);
|
|
26254
|
+
if (!success) {
|
|
26255
|
+
process.stderr.write("WorkBuddy credential bootstrap failed\n");
|
|
26256
|
+
process.exit(1);
|
|
26257
|
+
}
|
|
26258
|
+
};
|
|
26259
|
+
const timer = setTimeout(() => finish(false), 4500);
|
|
26260
|
+
const connect = () => {
|
|
26261
|
+
if (done) return;
|
|
26262
|
+
socket = net.createConnection(socketPath);
|
|
26263
|
+
let reply = "";
|
|
26264
|
+
socket.once("connect", () => socket.end(message, () => { message = ""; }));
|
|
26265
|
+
socket.on("data", chunk => {
|
|
26266
|
+
reply += chunk;
|
|
26267
|
+
if (reply.length > 1024) return finish(false);
|
|
26268
|
+
if (!reply.includes("\n")) return;
|
|
26269
|
+
try {
|
|
26270
|
+
const result = JSON.parse(reply.slice(0, reply.indexOf("\n")));
|
|
26271
|
+
finish(result.ok === true && result.policy === "fields");
|
|
26272
|
+
} catch { finish(false); }
|
|
26273
|
+
});
|
|
26274
|
+
socket.once("end", () => { if (!done) finish(false); });
|
|
26275
|
+
socket.once("error", error => {
|
|
26276
|
+
socket.destroy();
|
|
26277
|
+
if (error.code === "ENOENT" || error.code === "ECONNREFUSED") setTimeout(connect, 20);
|
|
26278
|
+
else finish(false);
|
|
26279
|
+
});
|
|
26280
|
+
};
|
|
26281
|
+
setImmediate(connect);
|
|
26282
|
+
})();
|
|
26283
|
+
`;
|
|
26284
|
+
|
|
26073
26285
|
// dist/discovery.js
|
|
26074
26286
|
var WORKBUDDY_MACOS_ELECTRON = "/Applications/WorkBuddy AI.app/Contents/MacOS/Electron";
|
|
26075
26287
|
var windowsRoots = [
|
|
@@ -26214,7 +26426,8 @@ function workBuddyInvocation(environment, ephemeral, dependenciesOrArguments = {
|
|
|
26214
26426
|
} : configuredEnvironment;
|
|
26215
26427
|
return {
|
|
26216
26428
|
...commandInvocation(executable, [
|
|
26217
|
-
...bundle ? [
|
|
26429
|
+
...bundle ? ["--eval", `${WORKBUDDY_CREDENTIAL_PRELOAD}
|
|
26430
|
+
require(process.argv[1]);`, bundle.cli] : [],
|
|
26218
26431
|
...nativeArguments ?? [
|
|
26219
26432
|
"--acp",
|
|
26220
26433
|
...ephemeral ? ["--no-session-persistence"] : [],
|
|
@@ -26232,6 +26445,7 @@ var WORKBUDDY_COMMAND_CATALOG = harnessCommandCatalogSchema.parse({
|
|
|
26232
26445
|
{
|
|
26233
26446
|
id: "workbuddy.compact",
|
|
26234
26447
|
invocation: "/compact",
|
|
26448
|
+
localizations: { "zh-CN": { label: "压缩上下文", description: "压缩当前对话上下文" } },
|
|
26235
26449
|
label: "Compact context",
|
|
26236
26450
|
description: "Compact the current WorkBuddy Session context",
|
|
26237
26451
|
argumentMode: "text"
|
|
@@ -26359,15 +26573,15 @@ function normalizedLabel(value) {
|
|
|
26359
26573
|
}
|
|
26360
26574
|
function mergeWorkBuddyProductModels(catalog, productModels) {
|
|
26361
26575
|
const refs = new Set(catalog.models.map((model2) => model2.ref.id));
|
|
26362
|
-
const
|
|
26576
|
+
const labels2 = new Set(catalog.models.map((model2) => normalizedLabel(model2.label)));
|
|
26363
26577
|
const models = [...catalog.models];
|
|
26364
26578
|
for (const productModel of productModels) {
|
|
26365
26579
|
const ref = modelRef(productModel.id);
|
|
26366
26580
|
const labelKey = normalizedLabel(productModel.name);
|
|
26367
|
-
if (refs.has(ref.id) ||
|
|
26581
|
+
if (refs.has(ref.id) || labels2.has(labelKey))
|
|
26368
26582
|
continue;
|
|
26369
26583
|
refs.add(ref.id);
|
|
26370
|
-
|
|
26584
|
+
labels2.add(labelKey);
|
|
26371
26585
|
const creditLabel = productModel.credits?.replace(/^x/iu, "").replace(/\s*credits$/iu, "x");
|
|
26372
26586
|
const annotatedLabel = creditLabel ? `${productModel.name} · ${creditLabel}` : productModel.name;
|
|
26373
26587
|
models.push({
|
|
@@ -26431,6 +26645,7 @@ function createHarnessAdapter(context) {
|
|
|
26431
26645
|
...context.launchCommand ? { CODEXHOST_WORKBUDDY_COMMAND: context.launchCommand } : {}
|
|
26432
26646
|
};
|
|
26433
26647
|
return new BrokeredHarnessAdapter({
|
|
26648
|
+
accountCredits: false,
|
|
26434
26649
|
harnessId: "workbuddy",
|
|
26435
26650
|
commandCatalog: WORKBUDDY_COMMAND_CATALOG,
|
|
26436
26651
|
forwardDelegationEnvironment: true,
|
|
@@ -14787,6 +14787,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
|
|
|
14787
14787
|
initializeOnly: external_exports.boolean().optional()
|
|
14788
14788
|
});
|
|
14789
14789
|
|
|
14790
|
+
// ../../shared-contracts/dist/harness-presentation.js
|
|
14791
|
+
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
14792
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
|
|
14793
|
+
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
14794
|
+
label: displayText(256).optional(),
|
|
14795
|
+
description: displayText(1024).optional()
|
|
14796
|
+
}).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
14797
|
+
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");
|
|
14798
|
+
|
|
14790
14799
|
// ../../shared-contracts/dist/model-price-overrides.js
|
|
14791
14800
|
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
14792
14801
|
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
@@ -15207,8 +15216,24 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15207
15216
|
}
|
|
15208
15217
|
});
|
|
15209
15218
|
var usagePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15219
|
+
var accountCreditsPeriodSchema = external_exports.enum([
|
|
15220
|
+
"weekly",
|
|
15221
|
+
"monthly",
|
|
15222
|
+
"five_hour",
|
|
15223
|
+
"seven_day",
|
|
15224
|
+
"unknown"
|
|
15225
|
+
]);
|
|
15226
|
+
var accountCreditsScopeSchema = external_exports.object({
|
|
15227
|
+
id: external_exports.string().min(1).max(256),
|
|
15228
|
+
label: external_exports.string().min(1).max(256),
|
|
15229
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
15230
|
+
}).strict();
|
|
15210
15231
|
var accountCreditsProductUsageSchema = external_exports.object({
|
|
15211
15232
|
product: external_exports.string().min(1),
|
|
15233
|
+
/** Native period and scope, never inferred from the display name. */
|
|
15234
|
+
periodType: accountCreditsPeriodSchema.optional(),
|
|
15235
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
15236
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15212
15237
|
used: external_exports.number().finite().nonnegative().optional(),
|
|
15213
15238
|
// Zero is a real empty cap, not an absent field.
|
|
15214
15239
|
limit: external_exports.number().finite().nonnegative().optional(),
|
|
@@ -15230,8 +15255,10 @@ var accountCreditsSnapshotSchema = external_exports.object({
|
|
|
15230
15255
|
label: external_exports.string().min(1).optional(),
|
|
15231
15256
|
usedPercent: usagePercentSchema.optional(),
|
|
15232
15257
|
remaining: external_exports.number().finite().optional(),
|
|
15258
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
15259
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15233
15260
|
resetsAt: external_exports.string().min(1).optional(),
|
|
15234
|
-
periodType:
|
|
15261
|
+
periodType: accountCreditsPeriodSchema,
|
|
15235
15262
|
productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
|
|
15236
15263
|
resetCredits: accountResetCreditsSchema.optional()
|
|
15237
15264
|
}).strict().superRefine((credits, context) => {
|
|
@@ -15256,7 +15283,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
|
|
|
15256
15283
|
var threadUsageInspectionSchema = external_exports.object({
|
|
15257
15284
|
threadId: hostThreadIdSchema,
|
|
15258
15285
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
15259
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15286
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
15287
|
+
/** Whether this source can provide cached account quota independently of usage. */
|
|
15288
|
+
accountCreditsSupported: external_exports.boolean().optional()
|
|
15260
15289
|
}).strict();
|
|
15261
15290
|
|
|
15262
15291
|
// ../../shared-contracts/dist/harness-accounts.js
|
|
@@ -15383,7 +15412,8 @@ var harnessPermissionModeSchema = external_exports.object({
|
|
|
15383
15412
|
id: harnessPermissionModeIdSchema,
|
|
15384
15413
|
label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
|
|
15385
15414
|
description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
15386
|
-
dangerous: external_exports.boolean().optional()
|
|
15415
|
+
dangerous: external_exports.boolean().optional(),
|
|
15416
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
15387
15417
|
}).strict();
|
|
15388
15418
|
var harnessPermissionModeCatalogSchema = external_exports.object({
|
|
15389
15419
|
modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
|
|
@@ -15706,6 +15736,8 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
15706
15736
|
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
15707
15737
|
message: external_exports.string().max(2048).optional(),
|
|
15708
15738
|
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
15739
|
+
/** Safe plugin-owned explanation, distinct from raw diagnostic message. */
|
|
15740
|
+
notice: harnessLocalizedTextSchema.optional(),
|
|
15709
15741
|
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
15710
15742
|
}).strict();
|
|
15711
15743
|
|
|
@@ -15844,6 +15876,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
|
|
|
15844
15876
|
invocation: commandInvocationSchema,
|
|
15845
15877
|
label: commandLabelSchema,
|
|
15846
15878
|
description: commandDescriptionSchema.optional(),
|
|
15879
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15847
15880
|
argumentMode: external_exports.enum(["none", "text"]),
|
|
15848
15881
|
/**
|
|
15849
15882
|
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
@@ -16769,6 +16802,10 @@ function createZcodeInstallation(environment, app) {
|
|
|
16769
16802
|
updateAvailable: false,
|
|
16770
16803
|
canUpdate: false,
|
|
16771
16804
|
messageCode: "zcode-desktop-updater",
|
|
16805
|
+
notice: {
|
|
16806
|
+
en: "The CLI ships inside ZCode Desktop. Update ZCode Desktop itself to update it.",
|
|
16807
|
+
"zh-CN": "CLI 随 ZCode Desktop 一起发布,请直接更新 ZCode Desktop。"
|
|
16808
|
+
},
|
|
16772
16809
|
message: "The CLI ships inside ZCode Desktop. Update ZCode Desktop itself to update it."
|
|
16773
16810
|
};
|
|
16774
16811
|
};
|
|
@@ -18233,11 +18270,19 @@ var modeLabels = {
|
|
|
18233
18270
|
yolo: "Full access",
|
|
18234
18271
|
auto: "Auto"
|
|
18235
18272
|
};
|
|
18273
|
+
var chineseModeLabels = {
|
|
18274
|
+
build: "确认变更",
|
|
18275
|
+
edit: "自动编辑",
|
|
18276
|
+
plan: "规划模式",
|
|
18277
|
+
yolo: "完全访问",
|
|
18278
|
+
auto: "自动"
|
|
18279
|
+
};
|
|
18236
18280
|
function permissionModes(current = "build") {
|
|
18237
18281
|
return harnessPermissionModeCatalogSchema.parse({
|
|
18238
18282
|
modes: Object.entries(modeLabels).map(([id, label]) => ({
|
|
18239
18283
|
id,
|
|
18240
18284
|
label,
|
|
18285
|
+
localizations: { "zh-CN": { label: chineseModeLabels[id] } },
|
|
18241
18286
|
...id === "yolo" ? { dangerous: true } : {}
|
|
18242
18287
|
})),
|
|
18243
18288
|
defaultModeId: current
|
|
@@ -19277,6 +19322,7 @@ var COMMAND_CATALOG = harnessCommandCatalogSchema.parse({
|
|
|
19277
19322
|
{
|
|
19278
19323
|
id: "compact",
|
|
19279
19324
|
invocation: "/compact",
|
|
19325
|
+
localizations: { "zh-CN": { label: "压缩上下文", description: "压缩当前对话上下文" } },
|
|
19280
19326
|
label: "Compact",
|
|
19281
19327
|
description: "Compact the native ZCode conversation.",
|
|
19282
19328
|
argumentMode: "text"
|