@codexhost/cli-darwin-x64 0.13.2 → 0.14.0
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 +94 -8
- package/app/console-web.js +537 -146
- package/app/desktop-controller.mjs +108 -12
- package/app/host-runtime.mjs +847 -235
- package/app/plugins/antigravity/plugin.mjs +143 -20
- package/app/plugins/claude-code/plugin.mjs +601 -71
- package/app/plugins/codebuddy/plugin.mjs +227 -30
- package/app/plugins/codex-usage/plugin.mjs +212 -77
- package/app/plugins/copilot/assets/icon.png +0 -0
- package/app/plugins/copilot/manifest.json +26 -0
- package/app/plugins/copilot/plugin.mjs +34546 -0
- package/app/plugins/cursor-cli/plugin.mjs +20805 -44862
- package/app/plugins/deepseek-harness/manifest.json +2 -2
- package/app/plugins/deepseek-harness/plugin.mjs +202 -21
- package/app/plugins/enabled.json +1 -0
- package/app/plugins/grok/plugin.mjs +278 -29
- package/app/plugins/hermes/plugin.mjs +143 -12
- package/app/plugins/kimi-code/plugin.mjs +140 -16
- package/app/plugins/kiro-cli/plugin.mjs +121 -10
- package/app/plugins/omp/plugin.mjs +2200 -2002
- package/app/plugins/opencode/plugin.mjs +137 -16
- package/app/plugins/pi/plugin.mjs +2563 -2282
- package/app/plugins/qoder/plugin.mjs +133 -14
- package/app/plugins/qoder-cn/plugin.mjs +133 -14
- package/app/plugins/workbuddy/plugin.mjs +603 -56
- package/app/plugins/zcode/plugin.mjs +133 -14
- package/app/renderer-extension.js +1171 -529
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
|
@@ -15080,6 +15080,15 @@ var harnessDisplaySetSchema = external_exports.strictObject({
|
|
|
15080
15080
|
initializeOnly: external_exports.boolean().optional()
|
|
15081
15081
|
});
|
|
15082
15082
|
|
|
15083
|
+
// ../../shared-contracts/dist/harness-presentation.js
|
|
15084
|
+
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
15085
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
|
|
15086
|
+
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
15087
|
+
label: displayText(256).optional(),
|
|
15088
|
+
description: displayText(1024).optional()
|
|
15089
|
+
}).strict()).refine((entries) => Object.keys(entries).length <= 16, "Too many locales");
|
|
15090
|
+
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");
|
|
15091
|
+
|
|
15083
15092
|
// ../../shared-contracts/dist/model-price-overrides.js
|
|
15084
15093
|
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
15085
15094
|
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
@@ -15129,10 +15138,19 @@ var model = external_exports.string().min(1).max(512);
|
|
|
15129
15138
|
var project = external_exports.string().min(1).max(4096);
|
|
15130
15139
|
var usageStatisticsParamsSchema = external_exports.strictObject({
|
|
15131
15140
|
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
15141
|
+
/** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
|
|
15142
|
+
timeZone: external_exports.string().min(1).max(128).refine((value) => {
|
|
15143
|
+
try {
|
|
15144
|
+
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
15145
|
+
return true;
|
|
15146
|
+
} catch {
|
|
15147
|
+
return false;
|
|
15148
|
+
}
|
|
15149
|
+
}, "Unsupported usage statistics timezone").optional(),
|
|
15132
15150
|
harness: harness.optional(),
|
|
15133
15151
|
model: model.nullable().optional(),
|
|
15134
15152
|
project: project.nullable().optional(),
|
|
15135
|
-
/** One
|
|
15153
|
+
/** One date in the query timezone inside the range. */
|
|
15136
15154
|
date: localDate.optional()
|
|
15137
15155
|
});
|
|
15138
15156
|
var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
@@ -15168,7 +15186,7 @@ var usageStatisticsSessionSchema = external_exports.strictObject({
|
|
|
15168
15186
|
});
|
|
15169
15187
|
var usageStatisticsResultSchema = external_exports.strictObject({
|
|
15170
15188
|
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
15171
|
-
/** First
|
|
15189
|
+
/** First date in the query timezone (Host local when omitted); null for all time. */
|
|
15172
15190
|
from: localDate.nullable(),
|
|
15173
15191
|
to: localDate,
|
|
15174
15192
|
/** The filters these figures apply, echoed so a late answer to older filters is recognised. */
|
|
@@ -15208,7 +15226,7 @@ var usageStatisticsResultSchema = external_exports.strictObject({
|
|
|
15208
15226
|
totals: usageStatisticsTotalsSchema,
|
|
15209
15227
|
/** Each date and Harness of the range: every filter except the day. */
|
|
15210
15228
|
daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
|
|
15211
|
-
/**
|
|
15229
|
+
/** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
|
|
15212
15230
|
hourly: external_exports.array(external_exports.strictObject({
|
|
15213
15231
|
weekday: external_exports.number().int().min(0).max(6),
|
|
15214
15232
|
hour: external_exports.number().int().min(0).max(23),
|
|
@@ -15268,6 +15286,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
15268
15286
|
"codexhost/harness/display-settings/set",
|
|
15269
15287
|
"codexhost/harness/inspect",
|
|
15270
15288
|
"codexhost/harness/installation",
|
|
15289
|
+
"codexhost/harness/installation/start",
|
|
15290
|
+
"codexhost/harness/installation/status",
|
|
15271
15291
|
"codexhost/harness/launch-settings/get",
|
|
15272
15292
|
"codexhost/harness/launch-settings/set",
|
|
15273
15293
|
"codexhost/harness/web-ui/open",
|
|
@@ -15343,7 +15363,18 @@ var threadManualCompactionStartedSchema = external_exports.strictObject({
|
|
|
15343
15363
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
15344
15364
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15345
15365
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15366
|
+
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
15367
|
+
var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
15368
|
+
kind: external_exports.literal("countdown"),
|
|
15369
|
+
id: external_exports.string().min(1).max(64),
|
|
15370
|
+
expiresAtUnix: nonNegativeSafeIntegerSchema,
|
|
15371
|
+
label: indicatorTextSchema(256).optional(),
|
|
15372
|
+
tooltip: indicatorTextSchema(1024).optional()
|
|
15373
|
+
}).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, {
|
|
15374
|
+
message: "Composer indicator IDs must be unique"
|
|
15375
|
+
});
|
|
15346
15376
|
var threadUsageSnapshotSchema = external_exports.object({
|
|
15377
|
+
composerIndicators: composerIndicatorsSchema.optional(),
|
|
15347
15378
|
inputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15348
15379
|
cachedInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15349
15380
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
@@ -15416,8 +15447,24 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15416
15447
|
}
|
|
15417
15448
|
});
|
|
15418
15449
|
var usagePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15450
|
+
var accountCreditsPeriodSchema = external_exports.enum([
|
|
15451
|
+
"weekly",
|
|
15452
|
+
"monthly",
|
|
15453
|
+
"five_hour",
|
|
15454
|
+
"seven_day",
|
|
15455
|
+
"unknown"
|
|
15456
|
+
]);
|
|
15457
|
+
var accountCreditsScopeSchema = external_exports.object({
|
|
15458
|
+
id: external_exports.string().min(1).max(256),
|
|
15459
|
+
label: external_exports.string().min(1).max(256),
|
|
15460
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
15461
|
+
}).strict();
|
|
15419
15462
|
var accountCreditsProductUsageSchema = external_exports.object({
|
|
15420
15463
|
product: external_exports.string().min(1),
|
|
15464
|
+
/** Native period and scope, never inferred from the display name. */
|
|
15465
|
+
periodType: accountCreditsPeriodSchema.optional(),
|
|
15466
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
15467
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15421
15468
|
used: external_exports.number().finite().nonnegative().optional(),
|
|
15422
15469
|
// Zero is a real empty cap, not an absent field.
|
|
15423
15470
|
limit: external_exports.number().finite().nonnegative().optional(),
|
|
@@ -15437,9 +15484,11 @@ var accountCreditsSnapshotSchema = external_exports.object({
|
|
|
15437
15484
|
unit: external_exports.string().min(1).max(32).optional(),
|
|
15438
15485
|
/** Native label when the primary limit is scoped to a model or product group. */
|
|
15439
15486
|
label: external_exports.string().min(1).optional(),
|
|
15487
|
+
scope: accountCreditsScopeSchema.optional(),
|
|
15488
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
15440
15489
|
usedPercent: usagePercentSchema,
|
|
15441
15490
|
resetsAt: external_exports.string().min(1).optional(),
|
|
15442
|
-
periodType:
|
|
15491
|
+
periodType: accountCreditsPeriodSchema,
|
|
15443
15492
|
productUsage: external_exports.array(accountCreditsProductUsageSchema).min(1).optional(),
|
|
15444
15493
|
resetCredits: accountResetCreditsSchema.optional()
|
|
15445
15494
|
}).strict();
|
|
@@ -15450,7 +15499,9 @@ var threadUsageInspectionParamsSchema = external_exports.object({
|
|
|
15450
15499
|
var threadUsageInspectionSchema = external_exports.object({
|
|
15451
15500
|
threadId: hostThreadIdSchema,
|
|
15452
15501
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
15453
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15502
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
15503
|
+
/** Whether this source can provide cached account quota independently of usage. */
|
|
15504
|
+
accountCreditsSupported: external_exports.boolean().optional()
|
|
15454
15505
|
}).strict();
|
|
15455
15506
|
|
|
15456
15507
|
// ../../shared-contracts/dist/harness-accounts.js
|
|
@@ -15577,7 +15628,8 @@ var harnessPermissionModeSchema = external_exports.object({
|
|
|
15577
15628
|
id: harnessPermissionModeIdSchema,
|
|
15578
15629
|
label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
|
|
15579
15630
|
description: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_DESCRIPTION_MAX_LENGTH).optional(),
|
|
15580
|
-
dangerous: external_exports.boolean().optional()
|
|
15631
|
+
dangerous: external_exports.boolean().optional(),
|
|
15632
|
+
localizations: harnessLocalizationsSchema.optional()
|
|
15581
15633
|
}).strict();
|
|
15582
15634
|
var harnessPermissionModeCatalogSchema = external_exports.object({
|
|
15583
15635
|
modes: external_exports.array(harnessPermissionModeSchema).min(1).max(HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH),
|
|
@@ -15730,7 +15782,9 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
|
|
|
15730
15782
|
}).strict().optional(),
|
|
15731
15783
|
autonomousTurns: external_exports.object({
|
|
15732
15784
|
observe: external_exports.boolean()
|
|
15733
|
-
}).strict().optional()
|
|
15785
|
+
}).strict().optional(),
|
|
15786
|
+
/** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
|
|
15787
|
+
steer: external_exports.boolean().optional()
|
|
15734
15788
|
}).strict();
|
|
15735
15789
|
var harnessConfigurationStateSchema = external_exports.object({
|
|
15736
15790
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
@@ -15777,7 +15831,9 @@ var harnessInspectionSchema = external_exports.union([
|
|
|
15777
15831
|
var harnessInspectParamsSchema = external_exports.object({
|
|
15778
15832
|
harnessId: harnessIdSchema,
|
|
15779
15833
|
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
15780
|
-
refresh: external_exports.boolean().optional()
|
|
15834
|
+
refresh: external_exports.boolean().optional(),
|
|
15835
|
+
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
15836
|
+
purpose: external_exports.literal("availability").optional()
|
|
15781
15837
|
}).strict();
|
|
15782
15838
|
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15783
15839
|
harnessId: harnessIdSchema
|
|
@@ -15860,6 +15916,15 @@ var threadOwnershipListResultSchema = external_exports.object({
|
|
|
15860
15916
|
seen.add(thread.threadId);
|
|
15861
15917
|
}
|
|
15862
15918
|
});
|
|
15919
|
+
var threadSteeringInspectParamsSchema = external_exports.object({
|
|
15920
|
+
threadId: hostThreadIdSchema,
|
|
15921
|
+
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
15922
|
+
text: external_exports.string().optional()
|
|
15923
|
+
}).strict();
|
|
15924
|
+
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
15925
|
+
var threadSteeringInspectResultSchema = external_exports.object({
|
|
15926
|
+
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
15927
|
+
}).strict();
|
|
15863
15928
|
|
|
15864
15929
|
// ../../shared-contracts/dist/harness-plugins.js
|
|
15865
15930
|
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
@@ -15961,11 +16026,31 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
15961
16026
|
latestVersion: external_exports.string().min(1).max(128),
|
|
15962
16027
|
updateAvailable: external_exports.boolean(),
|
|
15963
16028
|
canUpdate: external_exports.boolean(),
|
|
16029
|
+
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
16030
|
+
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
16031
|
+
/** Official download opened by the user; does not imply an automatic installation. */
|
|
16032
|
+
manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
|
|
15964
16033
|
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
15965
16034
|
message: external_exports.string().max(2048).optional(),
|
|
15966
16035
|
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
16036
|
+
/** Safe plugin-owned explanation, distinct from raw diagnostic message. */
|
|
16037
|
+
notice: harnessLocalizedTextSchema.optional(),
|
|
15967
16038
|
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
15968
16039
|
}).strict();
|
|
16040
|
+
var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
|
|
16041
|
+
var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
|
|
16042
|
+
external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
|
|
16043
|
+
external_exports.object({
|
|
16044
|
+
taskId: external_exports.string().uuid(),
|
|
16045
|
+
status: external_exports.literal("succeeded"),
|
|
16046
|
+
result: harnessInstallationStateSchema
|
|
16047
|
+
}).strict(),
|
|
16048
|
+
external_exports.object({
|
|
16049
|
+
taskId: external_exports.string().uuid(),
|
|
16050
|
+
status: external_exports.literal("failed"),
|
|
16051
|
+
error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
|
|
16052
|
+
}).strict()
|
|
16053
|
+
]);
|
|
15969
16054
|
|
|
15970
16055
|
// ../../shared-contracts/dist/codex-accounts.js
|
|
15971
16056
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
@@ -16090,6 +16175,7 @@ var harnessCommandDescriptorSchema = external_exports.object({
|
|
|
16090
16175
|
invocation: commandInvocationSchema,
|
|
16091
16176
|
label: commandLabelSchema,
|
|
16092
16177
|
description: commandDescriptionSchema.optional(),
|
|
16178
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
16093
16179
|
argumentMode: external_exports.enum(["none", "text"]),
|
|
16094
16180
|
/**
|
|
16095
16181
|
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
@@ -16467,6 +16553,18 @@ function sanitizeDiagnosticTail(value) {
|
|
|
16467
16553
|
return redacted.length <= DIAGNOSTIC_TAIL_MAX_LENGTH ? redacted : redacted.slice(-DIAGNOSTIC_TAIL_MAX_LENGTH);
|
|
16468
16554
|
}
|
|
16469
16555
|
|
|
16556
|
+
// ../../harness-adapter/dist/steer.js
|
|
16557
|
+
function unsupportedSteer(harnessLabel) {
|
|
16558
|
+
return {
|
|
16559
|
+
ok: false,
|
|
16560
|
+
error: {
|
|
16561
|
+
code: "unsupported",
|
|
16562
|
+
message: `${harnessLabel} cannot steer an active Turn natively`,
|
|
16563
|
+
retryable: false
|
|
16564
|
+
}
|
|
16565
|
+
};
|
|
16566
|
+
}
|
|
16567
|
+
|
|
16470
16568
|
// ../../harness-adapter/dist/usage.js
|
|
16471
16569
|
var tokenFields = [
|
|
16472
16570
|
"inputTokens",
|
|
@@ -16494,6 +16592,7 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
16494
16592
|
...safeIntegerFields,
|
|
16495
16593
|
...percentFields,
|
|
16496
16594
|
"sessionCacheUsage",
|
|
16595
|
+
"composerIndicators",
|
|
16497
16596
|
"totalCostUsd",
|
|
16498
16597
|
"totalCredits",
|
|
16499
16598
|
"contextUsagePercent",
|
|
@@ -16516,6 +16615,7 @@ function parseHostUsage(value) {
|
|
|
16516
16615
|
throw new Error(`Harness Usage contains unknown field '${key}'`);
|
|
16517
16616
|
}
|
|
16518
16617
|
}
|
|
16618
|
+
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
16519
16619
|
for (const field of [
|
|
16520
16620
|
"totalCredits",
|
|
16521
16621
|
"contextUsagePercent",
|
|
@@ -16586,9 +16686,9 @@ function parseHostUsage(value) {
|
|
|
16586
16686
|
if (value.costSource !== "publicPrice") {
|
|
16587
16687
|
throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
|
|
16588
16688
|
}
|
|
16589
|
-
return { ...value, unpricedModels: [...models] };
|
|
16689
|
+
return { ...value, ...indicators, unpricedModels: [...models] };
|
|
16590
16690
|
}
|
|
16591
|
-
return { ...value };
|
|
16691
|
+
return { ...value, ...indicators };
|
|
16592
16692
|
}
|
|
16593
16693
|
var requestTokenFields = [
|
|
16594
16694
|
"inputTokens",
|
|
@@ -16764,6 +16864,27 @@ function nativeError(error51, profile = CODEBUDDY_RUNTIME_PROFILE) {
|
|
|
16764
16864
|
function failure(code, message, profile = CODEBUDDY_RUNTIME_PROFILE) {
|
|
16765
16865
|
return { ok: false, error: nativeError(new CodeBuddyError(code, message), profile) };
|
|
16766
16866
|
}
|
|
16867
|
+
function nativeTurnError(stopReason, meta3, profile) {
|
|
16868
|
+
const fallback = `Native Turn stopped: ${text(stopReason) || "unknown"} (${text(meta3["codebuddy.ai/outcome"]) || "no native outcome"})`;
|
|
16869
|
+
const raw = text(meta3["codebuddy.ai/errorMessage"]).trim();
|
|
16870
|
+
let diagnostic = "";
|
|
16871
|
+
let category;
|
|
16872
|
+
if (raw) {
|
|
16873
|
+
try {
|
|
16874
|
+
const error51 = record2(JSON.parse(raw));
|
|
16875
|
+
const data = record2(error51.data);
|
|
16876
|
+
diagnostic = text(data.details).trim() || text(error51.message).trim();
|
|
16877
|
+
category = data.category;
|
|
16878
|
+
} catch {
|
|
16879
|
+
diagnostic = raw;
|
|
16880
|
+
}
|
|
16881
|
+
}
|
|
16882
|
+
return nativeError(new CodeBuddyError(
|
|
16883
|
+
// -32000 is shared by native refusals; the category identifies authentication failures.
|
|
16884
|
+
category === "auth" ? "authenticationRequired" : "nativeFailure",
|
|
16885
|
+
diagnostic ? `${fallback}: ${diagnostic}` : fallback
|
|
16886
|
+
), profile);
|
|
16887
|
+
}
|
|
16767
16888
|
async function bounded(operation, milliseconds, label, onTimeout) {
|
|
16768
16889
|
let timer;
|
|
16769
16890
|
try {
|
|
@@ -16869,6 +16990,11 @@ function commandCatalog(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
|
|
|
16869
16990
|
id: `${profile.harnessId}.${name}`,
|
|
16870
16991
|
invocation: `/${name}`,
|
|
16871
16992
|
label: name,
|
|
16993
|
+
...name === "compact" && !skill ? {
|
|
16994
|
+
localizations: {
|
|
16995
|
+
"zh-CN": { label: "压缩上下文", description: "压缩当前对话上下文" }
|
|
16996
|
+
}
|
|
16997
|
+
} : {},
|
|
16872
16998
|
...text(entry.description).trim() ? { description: text(entry.description).trim().slice(0, 512) } : {},
|
|
16873
16999
|
argumentMode: name === "compact" || record2(entry.input).hint || record2(entry._meta).type === "skill" ? "text" : "none",
|
|
16874
17000
|
...record2(entry._meta).type === "skill" ? { kind: "skill" } : {}
|
|
@@ -16919,10 +17045,13 @@ function usageSessionTitle(value) {
|
|
|
16919
17045
|
return void 0;
|
|
16920
17046
|
if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
|
|
16921
17047
|
return normalized;
|
|
16922
|
-
|
|
16923
|
-
|
|
16924
|
-
|
|
16925
|
-
|
|
17048
|
+
let title = "";
|
|
17049
|
+
for (const character of normalized) {
|
|
17050
|
+
if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
|
|
17051
|
+
break;
|
|
17052
|
+
title += character;
|
|
17053
|
+
}
|
|
17054
|
+
return `${title.trimEnd()}…`;
|
|
16926
17055
|
}
|
|
16927
17056
|
function sessionIdOk(value) {
|
|
16928
17057
|
return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
|
|
@@ -17018,6 +17147,40 @@ import { homedir as homedir2 } from "node:os";
|
|
|
17018
17147
|
import path6 from "node:path";
|
|
17019
17148
|
import { isDeepStrictEqual } from "node:util";
|
|
17020
17149
|
|
|
17150
|
+
// dist/permission-presentation.js
|
|
17151
|
+
var labels = {
|
|
17152
|
+
"Always Ask": "始终询问",
|
|
17153
|
+
"Accept Edits": "接受编辑",
|
|
17154
|
+
Plan: "规划模式",
|
|
17155
|
+
Auto: "自动",
|
|
17156
|
+
"Auto mode": "自动模式",
|
|
17157
|
+
"Don't Ask": "不询问",
|
|
17158
|
+
"Bypass Permissions": "绕过权限",
|
|
17159
|
+
"Full Access": "完全访问",
|
|
17160
|
+
Delegate: "由父会话管理",
|
|
17161
|
+
Default: "默认"
|
|
17162
|
+
};
|
|
17163
|
+
var descriptions = {
|
|
17164
|
+
"Prompts for permission on first use of each tool": "首次使用每种工具时请求权限。",
|
|
17165
|
+
"Automatically accepts file edit permissions for the session": "自动接受本会话中的文件编辑权限。",
|
|
17166
|
+
"Agent can analyze but not modify files or execute commands": "Agent 可以分析,但不能修改文件或执行命令。",
|
|
17167
|
+
"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 分类器评估原本需要询问的操作:安全操作自动批准,风险操作拒绝。分类器不可用时改为询问;无法显示询问时拒绝。",
|
|
17168
|
+
"Does not show permission prompts; pre-approved and safe read-only actions run, everything else that would prompt is denied": "不显示权限询问;已获批准和安全的只读操作可以执行,其余原本需要询问的操作会被拒绝。",
|
|
17169
|
+
"Skips all permission prompts": "跳过常规权限询问。",
|
|
17170
|
+
"Skips ALL permission checks including dangerous commands for all agents": "为所有 Agent 跳过全部权限检查,包括危险命令。",
|
|
17171
|
+
"Permissions managed by parent session": "由父会话管理权限。"
|
|
17172
|
+
};
|
|
17173
|
+
function permissionLocalizations(label, description) {
|
|
17174
|
+
const localizedLabel = Object.hasOwn(labels, label) ? labels[label] : void 0;
|
|
17175
|
+
const localizedDescription = Object.hasOwn(descriptions, description) ? descriptions[description] : void 0;
|
|
17176
|
+
return {
|
|
17177
|
+
"zh-CN": {
|
|
17178
|
+
...localizedLabel ? { label: localizedLabel } : {},
|
|
17179
|
+
...localizedDescription ? { description: localizedDescription } : {}
|
|
17180
|
+
}
|
|
17181
|
+
};
|
|
17182
|
+
}
|
|
17183
|
+
|
|
17021
17184
|
// dist/configuration.js
|
|
17022
17185
|
var CODEBUDDY_CAPABILITIES = {
|
|
17023
17186
|
configuration: {
|
|
@@ -17075,6 +17238,7 @@ function configuration(value, profile = CODEBUDDY_RUNTIME_PROFILE) {
|
|
|
17075
17238
|
modes: rows(mode.options).map((option) => ({
|
|
17076
17239
|
id: option.value,
|
|
17077
17240
|
label: option.name,
|
|
17241
|
+
localizations: permissionLocalizations(text(option.name), text(option.description)),
|
|
17078
17242
|
...option.description ? { description: option.description } : {},
|
|
17079
17243
|
...["bypassPermissions", "fullAccess"].includes(text(option.value)) ? { dangerous: true } : {}
|
|
17080
17244
|
})),
|
|
@@ -22537,9 +22701,23 @@ var ClientSideConnection = class {
|
|
|
22537
22701
|
|
|
22538
22702
|
// dist/copy-cleanup.js
|
|
22539
22703
|
import { randomBytes } from "node:crypto";
|
|
22704
|
+
|
|
22705
|
+
// dist/acp-stdio.js
|
|
22540
22706
|
import { createInterface as createInterface2 } from "node:readline";
|
|
22541
|
-
import { stripVTControlCharacters } from "node:util";
|
|
22542
22707
|
import { Readable } from "node:stream";
|
|
22708
|
+
import { stripVTControlCharacters } from "node:util";
|
|
22709
|
+
function codeBuddyAcpOutput(stdout, onLine) {
|
|
22710
|
+
return Readable.from((async function* () {
|
|
22711
|
+
for await (const line of createInterface2({ input: stdout })) {
|
|
22712
|
+
onLine?.(stripVTControlCharacters(line));
|
|
22713
|
+
if (line.trimStart().startsWith("{"))
|
|
22714
|
+
yield Buffer.from(`${line}
|
|
22715
|
+
`);
|
|
22716
|
+
}
|
|
22717
|
+
})());
|
|
22718
|
+
}
|
|
22719
|
+
|
|
22720
|
+
// dist/copy-cleanup.js
|
|
22543
22721
|
var CodeBuddyCopyCleanup = class {
|
|
22544
22722
|
copyId;
|
|
22545
22723
|
cwd;
|
|
@@ -22569,17 +22747,11 @@ var CodeBuddyCopyCleanup = class {
|
|
|
22569
22747
|
}
|
|
22570
22748
|
/** Native --serve banners include its password; never pass them to the ACP parser/logs. */
|
|
22571
22749
|
protocolOutput(stdout) {
|
|
22572
|
-
return
|
|
22573
|
-
|
|
22574
|
-
async *#protocolLines(stdout) {
|
|
22575
|
-
for await (const line of createInterface2({ input: stdout })) {
|
|
22576
|
-
const endpoint = /^\s*Endpoint\s+(http:\/\/127\.0\.0\.1:\d+)\s*$/u.exec(stripVTControlCharacters(line));
|
|
22750
|
+
return codeBuddyAcpOutput(stdout, (line) => {
|
|
22751
|
+
const endpoint = /^\s*Endpoint\s+(http:\/\/127\.0\.0\.1:\d+)\s*$/u.exec(line);
|
|
22577
22752
|
if (endpoint)
|
|
22578
22753
|
this.#endpoint = endpoint[1];
|
|
22579
|
-
|
|
22580
|
-
yield Buffer.from(`${line}
|
|
22581
|
-
`);
|
|
22582
|
-
}
|
|
22754
|
+
});
|
|
22583
22755
|
}
|
|
22584
22756
|
async remove() {
|
|
22585
22757
|
if (!this.#endpoint)
|
|
@@ -22659,7 +22831,7 @@ var CodeBuddyAcpClient = class {
|
|
|
22659
22831
|
return { outcome: "cancelled" };
|
|
22660
22832
|
return options.handlers.question(params);
|
|
22661
22833
|
}
|
|
22662
|
-
}), ndJsonStream2(Writable.toWeb(this.#child.stdin), Readable2.toWeb(this.#copyCleanup?.protocolOutput(this.#child.stdout) ?? this.#child.stdout)));
|
|
22834
|
+
}), ndJsonStream2(Writable.toWeb(this.#child.stdin), Readable2.toWeb(this.#copyCleanup?.protocolOutput(this.#child.stdout) ?? (invocation.arguments.includes("--serve") ? codeBuddyAcpOutput(this.#child.stdout) : this.#child.stdout))));
|
|
22663
22835
|
void this.#connection.closed.then(() => {
|
|
22664
22836
|
this.#fault(new CodeBuddyError("processExited", "ACP connection closed"));
|
|
22665
22837
|
}).catch((error51) => {
|
|
@@ -24686,6 +24858,8 @@ var CodeBuddySession = class {
|
|
|
24686
24858
|
async #execute(command, nativeCommand = false) {
|
|
24687
24859
|
if (this.#closed || this.#fault)
|
|
24688
24860
|
return failure("invalidState", "Session is closed or faulted", this.profile);
|
|
24861
|
+
if (command.type === "turn.steer")
|
|
24862
|
+
return unsupportedSteer(this.profile.displayName);
|
|
24689
24863
|
if (command.type === "interaction.respond")
|
|
24690
24864
|
return this.#interactions.respond(command);
|
|
24691
24865
|
if (command.type === "turn.cancel") {
|
|
@@ -24755,7 +24929,7 @@ var CodeBuddySession = class {
|
|
|
24755
24929
|
// Those remain visible on individual Items; they do not fail the completed Turn.
|
|
24756
24930
|
(!meta3["codebuddy.ai/outcome"] || meta3["codebuddy.ai/outcome"] === "SUCCESS" || meta3["codebuddy.ai/outcome"] === "PARTIAL_SUCCESS") ? { status: "succeeded" } : {
|
|
24757
24931
|
status: "failed",
|
|
24758
|
-
error:
|
|
24932
|
+
error: nativeTurnError(stop, meta3, this.profile)
|
|
24759
24933
|
};
|
|
24760
24934
|
const snapshot = await this.#snapshot();
|
|
24761
24935
|
const added = snapshot.turns.filter((turn) => !active.before.has(turn.nativeTurnRef.nativeTurnKey));
|
|
@@ -25063,6 +25237,10 @@ function createCodeBuddyInstallation(environment) {
|
|
|
25063
25237
|
canUpdate,
|
|
25064
25238
|
...!canUpdate ? {
|
|
25065
25239
|
messageCode: "codebuddy-npm-required",
|
|
25240
|
+
notice: {
|
|
25241
|
+
en: "Use CodeBuddy's native updater or original package manager. Latest-version checks here require an identified npm installation.",
|
|
25242
|
+
"zh-CN": "请使用 CodeBuddy 原生更新器或原包管理器更新。此处仅能查询已识别的 npm 安装的最新版本。"
|
|
25243
|
+
},
|
|
25066
25244
|
message: "Use CodeBuddy's native updater or original package manager for this installation. Latest-version checks here require an identified npm installation."
|
|
25067
25245
|
} : {}
|
|
25068
25246
|
};
|
|
@@ -25095,6 +25273,7 @@ var harnessBrokerMethodSchema = external_exports.enum([
|
|
|
25095
25273
|
"adapter.open",
|
|
25096
25274
|
"adapter.subagent.readSnapshot",
|
|
25097
25275
|
"session.readSnapshot",
|
|
25276
|
+
"session.readCapabilities",
|
|
25098
25277
|
"session.refreshUsage",
|
|
25099
25278
|
"session.execute",
|
|
25100
25279
|
"session.commands.list",
|
|
@@ -25275,6 +25454,11 @@ var turnStartSchema = external_exports.object({
|
|
|
25275
25454
|
turnId: hostTurnIdSchema,
|
|
25276
25455
|
input: external_exports.array(textInputSchema)
|
|
25277
25456
|
}).strict();
|
|
25457
|
+
var turnSteerSchema = external_exports.object({
|
|
25458
|
+
type: external_exports.literal("turn.steer"),
|
|
25459
|
+
turnId: hostTurnIdSchema,
|
|
25460
|
+
input: external_exports.array(textInputSchema)
|
|
25461
|
+
}).strict();
|
|
25278
25462
|
var turnCancelSchema = external_exports.object({ type: external_exports.literal("turn.cancel"), turnId: hostTurnIdSchema }).strict();
|
|
25279
25463
|
var interactionResponseSchema = external_exports.union([
|
|
25280
25464
|
external_exports.object({
|
|
@@ -25300,6 +25484,7 @@ var permissionSelectSchema = external_exports.object({
|
|
|
25300
25484
|
}).strict();
|
|
25301
25485
|
var brokerHostCommandSchema = external_exports.discriminatedUnion("type", [
|
|
25302
25486
|
turnStartSchema,
|
|
25487
|
+
turnSteerSchema,
|
|
25303
25488
|
turnCancelSchema,
|
|
25304
25489
|
interactionRespondSchema,
|
|
25305
25490
|
modelSelectSchema,
|
|
@@ -25492,6 +25677,7 @@ function parseSessionMetadata(value) {
|
|
|
25492
25677
|
sessionId: candidate.sessionId,
|
|
25493
25678
|
sessionGeneration: candidate.sessionGeneration,
|
|
25494
25679
|
capabilities: harnessSessionCapabilitiesSchema.parse(candidate.capabilities),
|
|
25680
|
+
readCapabilities: candidate.readCapabilities === true,
|
|
25495
25681
|
initialState: state,
|
|
25496
25682
|
initialUsage: candidate.initialUsage === null ? null : parseHostUsage(candidate.initialUsage),
|
|
25497
25683
|
commands: candidate.commands === true
|
|
@@ -25843,6 +26029,11 @@ var BrokeredHarnessSession = class {
|
|
|
25843
26029
|
event: { type: "session.faulted", error: unavailable(error51.message) }
|
|
25844
26030
|
});
|
|
25845
26031
|
}
|
|
26032
|
+
async readCapabilities() {
|
|
26033
|
+
if (!this.#metadata.readCapabilities)
|
|
26034
|
+
return { ...this.capabilities, steer: false };
|
|
26035
|
+
return harnessSessionCapabilitiesSchema.parse(await this.#request("session.readCapabilities", {}));
|
|
26036
|
+
}
|
|
25846
26037
|
async refreshUsage() {
|
|
25847
26038
|
await this.#request("session.refreshUsage", {});
|
|
25848
26039
|
}
|
|
@@ -25874,6 +26065,8 @@ var BrokeredHarnessSession = class {
|
|
|
25874
26065
|
try {
|
|
25875
26066
|
return parseHarnessResult(await this.#request("session.execute", { command }));
|
|
25876
26067
|
} catch (error51) {
|
|
26068
|
+
if (command.type === "turn.steer")
|
|
26069
|
+
throw error51;
|
|
25877
26070
|
return {
|
|
25878
26071
|
ok: false,
|
|
25879
26072
|
error: unavailable(error51 instanceof Error ? error51.message : String(error51))
|
|
@@ -25961,6 +26154,8 @@ var BrokeredHarnessAdapter = class {
|
|
|
25961
26154
|
commandCatalog;
|
|
25962
26155
|
liveCommandCatalog;
|
|
25963
26156
|
harnessId;
|
|
26157
|
+
credits;
|
|
26158
|
+
refreshCredits;
|
|
25964
26159
|
#descriptorPath;
|
|
25965
26160
|
#forwardEnvironment;
|
|
25966
26161
|
#isInstalled;
|
|
@@ -25981,6 +26176,10 @@ var BrokeredHarnessAdapter = class {
|
|
|
25981
26176
|
};
|
|
25982
26177
|
constructor(input = {}) {
|
|
25983
26178
|
this.harnessId = harnessPluginIdSchema.parse(input.harnessId ?? "claude-code");
|
|
26179
|
+
if (input.accountCredits !== false) {
|
|
26180
|
+
this.credits = () => this.#credits;
|
|
26181
|
+
this.refreshCredits = () => this.#refreshAccountCredits();
|
|
26182
|
+
}
|
|
25984
26183
|
this.#forwardEnvironment = input.forwardDelegationEnvironment === true;
|
|
25985
26184
|
if (input.commandCatalog)
|
|
25986
26185
|
this.commandCatalog = input.commandCatalog;
|
|
@@ -25992,10 +26191,7 @@ var BrokeredHarnessAdapter = class {
|
|
|
25992
26191
|
this.#startBroker = input.startBroker === false ? void 0 : input.startBroker ?? (process.platform === "darwin" && !input.descriptorPath ? () => startBrokerLaunchAgent(this.harnessId, environment) : void 0);
|
|
25993
26192
|
this.#startTimeoutMs = input.startTimeoutMs ?? BROKER_START_TIMEOUT_MS;
|
|
25994
26193
|
}
|
|
25995
|
-
|
|
25996
|
-
return this.#credits;
|
|
25997
|
-
}
|
|
25998
|
-
refreshCredits() {
|
|
26194
|
+
#refreshAccountCredits() {
|
|
25999
26195
|
if (this.#closed)
|
|
26000
26196
|
return Promise.resolve(null);
|
|
26001
26197
|
if (this.#creditsRefresh)
|
|
@@ -26167,6 +26363,7 @@ function createHarnessAdapter(context) {
|
|
|
26167
26363
|
if (context.platform === "darwin" && context.managedRemoteHost) {
|
|
26168
26364
|
const environment2 = { ...context.environment };
|
|
26169
26365
|
return new BrokeredHarnessAdapter({
|
|
26366
|
+
accountCredits: false,
|
|
26170
26367
|
harnessId: "codebuddy",
|
|
26171
26368
|
forwardDelegationEnvironment: true,
|
|
26172
26369
|
commandCatalog: CODEBUDDY_COMMAND_CATALOG,
|