claude-use 11.61.0 → 11.62.1
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/dist/cli.cjs +438 -108
- package/dist/index.cjs +62 -8
- package/dist/index.mjs +62 -8
- package/dist/types/index.d.ts +286 -0
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -25412,6 +25412,15 @@ var init_graphemes = __esm({
|
|
|
25412
25412
|
}
|
|
25413
25413
|
});
|
|
25414
25414
|
|
|
25415
|
+
// src/statusline/messages/languages.ts
|
|
25416
|
+
var STATUSLINE_LANGUAGES;
|
|
25417
|
+
var init_languages = __esm({
|
|
25418
|
+
"src/statusline/messages/languages.ts"() {
|
|
25419
|
+
"use strict";
|
|
25420
|
+
STATUSLINE_LANGUAGES = ["en", "zh-Hans", "zh-Hant"];
|
|
25421
|
+
}
|
|
25422
|
+
});
|
|
25423
|
+
|
|
25415
25424
|
// src/config/statusline.ts
|
|
25416
25425
|
function distinctList(member) {
|
|
25417
25426
|
return external_exports.array(member).refine((items) => new Set(items).size === items.length, "must not repeat an entry");
|
|
@@ -25422,10 +25431,13 @@ function isSingleVisibleGrapheme(text5) {
|
|
|
25422
25431
|
function unsettable(setting) {
|
|
25423
25432
|
return setting.unwrap().nullable().optional().describe(`${setting.description ?? ""} ${UNSET_NOTE}`);
|
|
25424
25433
|
}
|
|
25434
|
+
function canonicalLanguage(tag) {
|
|
25435
|
+
return tag === "zh" || tag === "zh-TW" ? LANGUAGE_ALIASES[tag] : tag;
|
|
25436
|
+
}
|
|
25425
25437
|
function isPlainObject2(value2) {
|
|
25426
25438
|
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
25427
25439
|
}
|
|
25428
|
-
function
|
|
25440
|
+
function mergeKeys(base, over) {
|
|
25429
25441
|
if (!isPlainObject2(over)) {
|
|
25430
25442
|
return over === void 0 ? base : over;
|
|
25431
25443
|
}
|
|
@@ -25434,7 +25446,7 @@ function mergeStatuslineSettings(base, over) {
|
|
|
25434
25446
|
if (value2 === null) {
|
|
25435
25447
|
Reflect.deleteProperty(merged, key);
|
|
25436
25448
|
} else {
|
|
25437
|
-
merged[key] =
|
|
25449
|
+
merged[key] = mergeKeys(merged[key], value2);
|
|
25438
25450
|
}
|
|
25439
25451
|
}
|
|
25440
25452
|
return merged;
|
|
@@ -25442,6 +25454,13 @@ function mergeStatuslineSettings(base, over) {
|
|
|
25442
25454
|
function contextBands({ bands, context }) {
|
|
25443
25455
|
return { warnAt: context.warnAt ?? bands.warnAt, criticalAt: context.criticalAt ?? bands.criticalAt };
|
|
25444
25456
|
}
|
|
25457
|
+
function isPresetName(value2) {
|
|
25458
|
+
return STATUSLINE_PRESETS.some((name) => name === value2);
|
|
25459
|
+
}
|
|
25460
|
+
function mergeStatuslineSettings(base, over) {
|
|
25461
|
+
const preset = isPlainObject2(over) ? over.preset : void 0;
|
|
25462
|
+
return mergeKeys(isPresetName(preset) ? mergeKeys(base, PRESET_BUNDLES[preset]) : base, over);
|
|
25463
|
+
}
|
|
25445
25464
|
function resolveStatusline(settings2) {
|
|
25446
25465
|
const resolved = ResolvedStatuslineSchema.parse(mergeStatuslineSettings(STATUSLINE_DEFAULTS, settings2));
|
|
25447
25466
|
if (resolved.bands.warnAt >= resolved.bands.criticalAt) {
|
|
@@ -25461,7 +25480,7 @@ function resolveStatusline(settings2) {
|
|
|
25461
25480
|
}
|
|
25462
25481
|
return resolved;
|
|
25463
25482
|
}
|
|
25464
|
-
var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_SESSION_TIME_PARTS, PROMPT_CACHE_TTL_SECONDS, STATUSLINE_COLOUR_NAMES, DEFAULT_HEADER_SEGMENTS, DEFAULT_ROWS, STATUSLINE_PATH_LEVELS, STATUSLINE_USAGE_VALUES, STATUSLINE_TIME_FORMATS, STATUSLINE_HOUR_CYCLES, MAX_PERCENT, MAX_STATUSLINE_PALETTE_INDEX, MAX_STATUSLINE_LABEL_COLUMNS, MIN_STATUSLINE_COLUMNS, MAX_STATUSLINE_COLUMNS, MAX_BAR_CELLS, MAX_ACCOUNT_USER_CHARS, MAX_DISPLAY_TEXT_CHARS, LABEL_RE2, OPTIONAL_LABEL_RE, mergeGroups, colourValue, barCharacter, STATUSLINE_CONTEXT_VALUES, STATUSLINE_CONTEXT_ESTIMATES, AUTOCOMPACT_RESERVE_FRACTION, AUTOCOMPACT_RESERVE_RAMP_START, AUTOCOMPACT_RESERVE_RAMP_END,
|
|
25483
|
+
var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_SESSION_TIME_PARTS, PROMPT_CACHE_TTL_SECONDS, STATUSLINE_COLOUR_NAMES, DEFAULT_HEADER_SEGMENTS, DEFAULT_ROWS, STATUSLINE_PRESETS, GIT_WITH_DIRTY_MARKER, JJ_OFF, PRESET_BUNDLES, STATUSLINE_PATH_LEVELS, STATUSLINE_USAGE_VALUES, STATUSLINE_TIME_FORMATS, STATUSLINE_HOUR_CYCLES, MAX_PERCENT, MAX_STATUSLINE_PALETTE_INDEX, MAX_STATUSLINE_LABEL_COLUMNS, MIN_STATUSLINE_COLUMNS, MAX_STATUSLINE_COLUMNS, MAX_BAR_CELLS, MAX_ACCOUNT_USER_CHARS, MAX_DISPLAY_TEXT_CHARS, LABEL_RE2, OPTIONAL_LABEL_RE, mergeGroups, colourValue, barCharacter, STATUSLINE_CONTEXT_VALUES, STATUSLINE_CONTEXT_ESTIMATES, AUTOCOMPACT_RESERVE_FRACTION, AUTOCOMPACT_RESERVE_RAMP_START, AUTOCOMPACT_RESERVE_RAMP_END, labelWithinColumns, labelWithinColumnsMessage, labelShowsSomething, labelShowsSomethingMessage, labelIsPlainText, labelIsPlainTextMessage, windowLabel, overrideText, wholePercent, thresholdPercent, SHAPES, UNSET_NOTE, LANGUAGE_DESCRIPTION, LANGUAGE_TAGS, LANGUAGE_ALIASES, TOP_LEVEL, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
|
|
25465
25484
|
var init_statusline = __esm({
|
|
25466
25485
|
"src/config/statusline.ts"() {
|
|
25467
25486
|
"use strict";
|
|
@@ -25469,6 +25488,7 @@ var init_statusline = __esm({
|
|
|
25469
25488
|
init_zod();
|
|
25470
25489
|
init_blank();
|
|
25471
25490
|
init_graphemes();
|
|
25491
|
+
init_languages();
|
|
25472
25492
|
STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom", "project", "vcs", "effort", "advisor", "version", "outputStyle", "cost", "dailyCost", "sessionName", "duration", "speed"];
|
|
25473
25493
|
STATUSLINE_ROWS = ["context", "quota", "addedDirs", "gitFiles", "memory", "environment", "sessionTime", "promptCache", "compactions", "tokens"];
|
|
25474
25494
|
STATUSLINE_SESSION_TIME_PARTS = ["started", "lastReply"];
|
|
@@ -25495,6 +25515,21 @@ var init_statusline = __esm({
|
|
|
25495
25515
|
];
|
|
25496
25516
|
DEFAULT_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom"];
|
|
25497
25517
|
DEFAULT_ROWS = ["context", "quota"];
|
|
25518
|
+
STATUSLINE_PRESETS = ["standard", "full", "essential", "minimal"];
|
|
25519
|
+
GIT_WITH_DIRTY_MARKER = { enabled: true, showDirty: true, showAheadBehind: false, showLineDiff: false };
|
|
25520
|
+
JJ_OFF = { enabled: false, showDirty: true, showConflicts: true };
|
|
25521
|
+
PRESET_BUNDLES = {
|
|
25522
|
+
standard: { layout: { header: DEFAULT_HEADER_SEGMENTS, rows: DEFAULT_ROWS }, git: GIT_WITH_DIRTY_MARKER, jj: JJ_OFF, usage: { resetLabel: false }, context: { breakdown: "never" } },
|
|
25523
|
+
full: {
|
|
25524
|
+
layout: { header: ["model", "project", "vcs", "effort", "advisor", "version", "outputStyle", "cost", "sessionName", "duration"], rows: ["context", "quota", "addedDirs", "memory", "environment", "promptCache", "compactions", "tokens"] },
|
|
25525
|
+
git: GIT_WITH_DIRTY_MARKER,
|
|
25526
|
+
jj: { enabled: true, showDirty: true, showConflicts: true },
|
|
25527
|
+
usage: { resetLabel: true },
|
|
25528
|
+
context: { breakdown: "critical" }
|
|
25529
|
+
},
|
|
25530
|
+
essential: { layout: { header: ["model", "project", "vcs", "duration"], rows: ["context", "addedDirs"] }, git: GIT_WITH_DIRTY_MARKER, jj: JJ_OFF, usage: { resetLabel: true }, context: { breakdown: "never" } },
|
|
25531
|
+
minimal: { layout: { header: ["model", "project", "vcs"], rows: ["context", "addedDirs"] }, git: GIT_WITH_DIRTY_MARKER, jj: JJ_OFF, usage: { resetLabel: true }, context: { breakdown: "never" } }
|
|
25532
|
+
};
|
|
25498
25533
|
STATUSLINE_PATH_LEVELS = ["1", "2", "3", "full"];
|
|
25499
25534
|
STATUSLINE_USAGE_VALUES = ["used", "remaining"];
|
|
25500
25535
|
STATUSLINE_TIME_FORMATS = ["relative", "absolute", "both", "elapsed", "elapsedAndAbsolute"];
|
|
@@ -25520,7 +25555,13 @@ var init_statusline = __esm({
|
|
|
25520
25555
|
AUTOCOMPACT_RESERVE_FRACTION = 0.165;
|
|
25521
25556
|
AUTOCOMPACT_RESERVE_RAMP_START = 0.05;
|
|
25522
25557
|
AUTOCOMPACT_RESERVE_RAMP_END = 0.5;
|
|
25523
|
-
|
|
25558
|
+
labelWithinColumns = (text5) => stringWidth(text5) <= MAX_STATUSLINE_LABEL_COLUMNS;
|
|
25559
|
+
labelWithinColumnsMessage = `must take no more than ${String(MAX_STATUSLINE_LABEL_COLUMNS)} terminal columns`;
|
|
25560
|
+
labelShowsSomething = (text5) => !drawsNothing(text5);
|
|
25561
|
+
labelShowsSomethingMessage = "must show something: a label of only combining marks or blank characters draws nothing";
|
|
25562
|
+
labelIsPlainText = (text5) => LABEL_RE2.test(text5);
|
|
25563
|
+
labelIsPlainTextMessage = "must be visible text without control characters";
|
|
25564
|
+
windowLabel = external_exports.string().refine((text5) => text5 === "" || labelWithinColumns(text5), labelWithinColumnsMessage).refine((text5) => text5 === "" || labelShowsSomething(text5), labelShowsSomethingMessage).refine((text5) => text5 === "" || labelIsPlainText(text5), labelIsPlainTextMessage);
|
|
25524
25565
|
overrideText = external_exports.string().max(MAX_DISPLAY_TEXT_CHARS).regex(OPTIONAL_LABEL_RE, "must be visible text without control characters");
|
|
25525
25566
|
wholePercent = external_exports.number().int().min(1).max(MAX_PERCENT);
|
|
25526
25567
|
thresholdPercent = external_exports.number().int().min(0).max(MAX_PERCENT);
|
|
@@ -25568,8 +25609,8 @@ var init_statusline = __esm({
|
|
|
25568
25609
|
criticalAt: wholePercent.describe("The whole percentage of use at which a bar turns red.")
|
|
25569
25610
|
},
|
|
25570
25611
|
labels: {
|
|
25571
|
-
fiveHour:
|
|
25572
|
-
sevenDay:
|
|
25612
|
+
fiveHour: windowLabel.describe("The name of the five-hour subscription window; empty uses the language's own name for it."),
|
|
25613
|
+
sevenDay: windowLabel.describe("The name of the weekly subscription window; empty uses the language's own name for it.")
|
|
25573
25614
|
},
|
|
25574
25615
|
bar: {
|
|
25575
25616
|
width: external_exports.number().int().min(1).max(MAX_BAR_CELLS).describe("A bar's width in cells before the line's spare width is shared out among the bars."),
|
|
@@ -25635,7 +25676,16 @@ var init_statusline = __esm({
|
|
|
25635
25676
|
}
|
|
25636
25677
|
};
|
|
25637
25678
|
UNSET_NOTE = "A layer may write null to return it to unset when a shallower layer sets it.";
|
|
25679
|
+
LANGUAGE_DESCRIPTION = "The language of the words the statusline writes (labels, units of waiting such as `ago`, the names of effort levels): en, zh-Hans for Chinese in simplified characters, and zh-Hant for traditional; zh and zh-TW are read as zh-Hans and zh-Hant, and any other tag is refused. Durations, token counts, the dollar sign and clock times are written the same in every language, and a clock time follows the system locale and the clock settings.";
|
|
25680
|
+
LANGUAGE_TAGS = [...STATUSLINE_LANGUAGES, "zh", "zh-TW"];
|
|
25681
|
+
LANGUAGE_ALIASES = { zh: "zh-Hans", "zh-TW": "zh-Hant" };
|
|
25682
|
+
TOP_LEVEL = {
|
|
25683
|
+
language: external_exports.enum(STATUSLINE_LANGUAGES).describe(LANGUAGE_DESCRIPTION),
|
|
25684
|
+
preset: external_exports.enum(STATUSLINE_PRESETS).describe("A named bundle of settings (layout.header, layout.rows, git.enabled, git.showDirty, git.showAheadBehind, git.showLineDiff, jj.enabled, jj.showDirty, jj.showConflicts, usage.resetLabel and context.breakdown) that this layer sets beneath the keys it names itself and above everything the shallower layers set: standard is the statusline's own; full, essential and minimal are claude-hud's presets. Each draws the model, project and version control segments and the context row; full adds the effort, advisor, version, output style, cost, session name and duration segments and the quota, added directories, memory, environment, prompt cache, compactions and session tokens rows, with the token breakdown at high use, essential adds the duration and the added directories row, and minimal adds the added directories row alone.")
|
|
25685
|
+
};
|
|
25638
25686
|
StatuslineSchema = external_exports.strictObject({
|
|
25687
|
+
language: external_exports.enum(LANGUAGE_TAGS).transform(canonicalLanguage).describe(LANGUAGE_DESCRIPTION).optional(),
|
|
25688
|
+
preset: TOP_LEVEL.preset.optional(),
|
|
25639
25689
|
layout: external_exports.strictObject(SHAPES.layout).partial().optional(),
|
|
25640
25690
|
model: external_exports.strictObject(SHAPES.model).partial().optional(),
|
|
25641
25691
|
provider: external_exports.strictObject(SHAPES.provider).partial().optional(),
|
|
@@ -25658,6 +25708,8 @@ var init_statusline = __esm({
|
|
|
25658
25708
|
jj: external_exports.strictObject(SHAPES.jj).partial().optional()
|
|
25659
25709
|
});
|
|
25660
25710
|
ResolvedStatuslineSchema = external_exports.strictObject({
|
|
25711
|
+
language: TOP_LEVEL.language,
|
|
25712
|
+
preset: TOP_LEVEL.preset,
|
|
25661
25713
|
layout: external_exports.strictObject(SHAPES.layout),
|
|
25662
25714
|
model: external_exports.strictObject(SHAPES.model),
|
|
25663
25715
|
provider: external_exports.strictObject(SHAPES.provider),
|
|
@@ -25680,6 +25732,8 @@ var init_statusline = __esm({
|
|
|
25680
25732
|
jj: external_exports.strictObject(SHAPES.jj)
|
|
25681
25733
|
});
|
|
25682
25734
|
STATUSLINE_DEFAULTS = {
|
|
25735
|
+
language: "en",
|
|
25736
|
+
preset: "standard",
|
|
25683
25737
|
layout: { header: [...DEFAULT_HEADER_SEGMENTS], rows: [...DEFAULT_ROWS], mode: "expanded", rule: "none", mergeBars: true, merge: [], rightAlign: [], maxWidth: 0, forceMaxWidth: false },
|
|
25684
25738
|
model: { format: "full", override: "", source: "client" },
|
|
25685
25739
|
provider: { name: "" },
|
|
@@ -25688,7 +25742,7 @@ var init_statusline = __esm({
|
|
|
25688
25742
|
advisor: { override: "" },
|
|
25689
25743
|
context: { bar: "shown", value: "both", estimate: "never", breakdown: "never" },
|
|
25690
25744
|
bands: { warnAt: 70, criticalAt: 90 },
|
|
25691
|
-
labels: { fiveHour: "
|
|
25745
|
+
labels: { fiveHour: "", sevenDay: "" },
|
|
25692
25746
|
bar: { width: 10, filled: "\u2588", empty: "\u2591" },
|
|
25693
25747
|
usage: { value: "used", bar: true, compact: false, resetLabel: false, modelScoped: false, timeFormat: "relative", threshold: 0, sevenDayThreshold: 0 },
|
|
25694
25748
|
clock: { hourCycle: "auto", seconds: false },
|
|
@@ -36978,7 +37032,7 @@ var init_package = __esm({
|
|
|
36978
37032
|
"package.json"() {
|
|
36979
37033
|
package_default = {
|
|
36980
37034
|
name: "claude-use",
|
|
36981
|
-
version: "11.
|
|
37035
|
+
version: "11.62.1",
|
|
36982
37036
|
description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
36983
37037
|
license: "MIT",
|
|
36984
37038
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -138428,13 +138482,13 @@ function prettifyModelId(id2) {
|
|
|
138428
138482
|
const version2 = major === void 0 ? "" : ` ${major}${minor === void 0 ? "" : `.${minor}`}`;
|
|
138429
138483
|
return `${family.charAt(0).toUpperCase()}${family.slice(1).toLowerCase()}${version2}`;
|
|
138430
138484
|
}
|
|
138431
|
-
function advisorSegment({ settings: settings2, transcriptIdentity }) {
|
|
138485
|
+
function advisorSegment({ settings: settings2, transcriptIdentity, t: t10 }) {
|
|
138432
138486
|
if (settings2.advisor.override !== "") {
|
|
138433
|
-
return
|
|
138487
|
+
return t10("advisor.name", { name: settings2.advisor.override });
|
|
138434
138488
|
}
|
|
138435
138489
|
const recorded = transcriptIdentity().advisor;
|
|
138436
138490
|
const advisor = recorded === void 0 ? "" : boundedDisplayText(prettifyModelId(recorded));
|
|
138437
|
-
return advisor === "" ? void 0 :
|
|
138491
|
+
return advisor === "" ? void 0 : t10("advisor.name", { name: advisor });
|
|
138438
138492
|
}
|
|
138439
138493
|
|
|
138440
138494
|
// src/statusline/elements/header/effort.ts
|
|
@@ -138445,20 +138499,37 @@ var EFFORT_SYMBOLS = /* @__PURE__ */ new Map([
|
|
|
138445
138499
|
["xhigh", "\u25D5"],
|
|
138446
138500
|
["max", "\u25CF"]
|
|
138447
138501
|
]);
|
|
138502
|
+
function effortName(level, t10) {
|
|
138503
|
+
switch (level) {
|
|
138504
|
+
case "low":
|
|
138505
|
+
return t10("effort.low");
|
|
138506
|
+
case "medium":
|
|
138507
|
+
return t10("effort.medium");
|
|
138508
|
+
case "high":
|
|
138509
|
+
return t10("effort.high");
|
|
138510
|
+
case "xhigh":
|
|
138511
|
+
return t10("effort.xhigh");
|
|
138512
|
+
case "max":
|
|
138513
|
+
return t10("effort.max");
|
|
138514
|
+
default:
|
|
138515
|
+
return level;
|
|
138516
|
+
}
|
|
138517
|
+
}
|
|
138448
138518
|
function effortLevelOf(effort) {
|
|
138449
138519
|
const level = boundedDisplayText((typeof effort === "string" ? effort : effort?.level) ?? "").toLowerCase();
|
|
138450
138520
|
return level === "" ? void 0 : level;
|
|
138451
138521
|
}
|
|
138452
|
-
function formatEffort(level, format) {
|
|
138522
|
+
function formatEffort(level, format, t10) {
|
|
138453
138523
|
const symbol3 = EFFORT_SYMBOLS.get(level);
|
|
138524
|
+
const name = effortName(level, t10);
|
|
138454
138525
|
if (symbol3 === void 0 || format === "text") {
|
|
138455
|
-
return
|
|
138526
|
+
return name;
|
|
138456
138527
|
}
|
|
138457
|
-
return format === "symbol" ? symbol3 : `${symbol3} ${
|
|
138528
|
+
return format === "symbol" ? symbol3 : `${symbol3} ${name}`;
|
|
138458
138529
|
}
|
|
138459
|
-
function effortSegment({ payload, settings: settings2 }) {
|
|
138530
|
+
function effortSegment({ payload, settings: settings2, t: t10 }) {
|
|
138460
138531
|
const level = effortLevelOf(payload.effort);
|
|
138461
|
-
return level === void 0 ? void 0 : formatEffort(level, settings2.effort.format);
|
|
138532
|
+
return level === void 0 ? void 0 : formatEffort(level, settings2.effort.format, t10);
|
|
138462
138533
|
}
|
|
138463
138534
|
|
|
138464
138535
|
// src/statusline/dailyLedger.ts
|
|
@@ -138538,11 +138609,11 @@ function costSegment(context) {
|
|
|
138538
138609
|
if (cost === void 0) {
|
|
138539
138610
|
return void 0;
|
|
138540
138611
|
}
|
|
138541
|
-
return
|
|
138612
|
+
return context.t(cost.source === "native" ? "cost.session" : "cost.estimated", { amount: formatUsd(cost.usd) });
|
|
138542
138613
|
}
|
|
138543
138614
|
function dailyCostSegment(context) {
|
|
138544
138615
|
const spend = recordDailySpend(context.ports, context.nowMs, context.payload.session_id, resolveSessionCost(context));
|
|
138545
|
-
return spend === void 0 ? void 0 :
|
|
138616
|
+
return spend === void 0 ? void 0 : context.t("cost.today", { amount: formatUsd(spend) });
|
|
138546
138617
|
}
|
|
138547
138618
|
|
|
138548
138619
|
// src/statusline/elements/sessionFormat.ts
|
|
@@ -138563,23 +138634,23 @@ function formatElapsed(ms2) {
|
|
|
138563
138634
|
function twoUnits(larger2, smaller, largerUnit, smallerUnit) {
|
|
138564
138635
|
return smaller > 0 ? `${String(larger2)}${largerUnit} ${String(smaller)}${smallerUnit}` : `${String(larger2)}${largerUnit}`;
|
|
138565
138636
|
}
|
|
138566
|
-
function formatAgo(ms2) {
|
|
138637
|
+
function formatAgo(ms2, t10) {
|
|
138567
138638
|
if (ms2 < 0) {
|
|
138568
|
-
return "
|
|
138639
|
+
return t10("time.justNow");
|
|
138569
138640
|
}
|
|
138570
138641
|
const seconds = Math.floor(ms2 / MS_PER_SECOND18);
|
|
138571
138642
|
if (seconds < SECONDS_PER_MINUTE2) {
|
|
138572
|
-
return `${String(seconds)}s
|
|
138643
|
+
return t10("time.ago", { value: `${String(seconds)}s` });
|
|
138573
138644
|
}
|
|
138574
138645
|
const minutes = Math.floor(seconds / SECONDS_PER_MINUTE2);
|
|
138575
138646
|
if (minutes < MINUTES_PER_HOUR4) {
|
|
138576
|
-
return `${String(minutes)}m
|
|
138647
|
+
return t10("time.ago", { value: `${String(minutes)}m` });
|
|
138577
138648
|
}
|
|
138578
138649
|
const hours = Math.floor(minutes / MINUTES_PER_HOUR4);
|
|
138579
138650
|
if (hours < HOURS_PER_DAY9) {
|
|
138580
|
-
return
|
|
138651
|
+
return t10("time.ago", { value: twoUnits(hours, minutes % MINUTES_PER_HOUR4, "h", "m") });
|
|
138581
138652
|
}
|
|
138582
|
-
return
|
|
138653
|
+
return t10("time.ago", { value: twoUnits(Math.floor(hours / HOURS_PER_DAY9), hours % HOURS_PER_DAY9, "d", "h") });
|
|
138583
138654
|
}
|
|
138584
138655
|
|
|
138585
138656
|
// src/statusline/elements/header/duration.ts
|
|
@@ -138683,9 +138754,9 @@ function formatTokens(num) {
|
|
|
138683
138754
|
}
|
|
138684
138755
|
return String(Math.round(num));
|
|
138685
138756
|
}
|
|
138686
|
-
function formatDuration(seconds) {
|
|
138757
|
+
function formatDuration(seconds, t10) {
|
|
138687
138758
|
if (seconds === void 0 || seconds <= 0) {
|
|
138688
|
-
return "available";
|
|
138759
|
+
return t10("quota.available");
|
|
138689
138760
|
}
|
|
138690
138761
|
if (seconds < SECONDS_PER_MINUTE3) {
|
|
138691
138762
|
return `${String(seconds)}s`;
|
|
@@ -138724,20 +138795,20 @@ function barCell(prefix, suffix, fraction, style) {
|
|
|
138724
138795
|
}
|
|
138725
138796
|
|
|
138726
138797
|
// src/statusline/elements/header/headroom.ts
|
|
138727
|
-
function headroomText(stats) {
|
|
138798
|
+
function headroomText(stats, t10) {
|
|
138728
138799
|
if (stats === void 0) {
|
|
138729
138800
|
return void 0;
|
|
138730
138801
|
}
|
|
138731
|
-
const overall = stats.savingsPercent === void 0 ? void 0 :
|
|
138802
|
+
const overall = stats.savingsPercent === void 0 ? void 0 : t10("headroom.overall", { percent: stats.savingsPercent.toFixed(stats.savingsPercent < ONE_PERCENT ? 2 : 1) });
|
|
138732
138803
|
const parts = [
|
|
138733
|
-
stats.tokensSaved === void 0 ? void 0 :
|
|
138804
|
+
stats.tokensSaved === void 0 ? void 0 : t10("headroom.saved", { tokens: formatTokens(stats.tokensSaved) }),
|
|
138734
138805
|
overall,
|
|
138735
138806
|
stats.savingsUsd === void 0 ? void 0 : `$${stats.savingsUsd.toFixed(2)}`
|
|
138736
138807
|
].filter((part) => part !== void 0);
|
|
138737
|
-
return parts.length === 0 ? void 0 :
|
|
138808
|
+
return parts.length === 0 ? void 0 : t10("headroom.label", { parts: parts.join(" \xB7 ") });
|
|
138738
138809
|
}
|
|
138739
|
-
function headroomSegment({ summary }) {
|
|
138740
|
-
return headroomText(summary.headroom);
|
|
138810
|
+
function headroomSegment({ summary, t: t10 }) {
|
|
138811
|
+
return headroomText(summary.headroom, t10);
|
|
138741
138812
|
}
|
|
138742
138813
|
|
|
138743
138814
|
// src/statusline/elements/header/identity.ts
|
|
@@ -138807,7 +138878,7 @@ function outputStyleIn(file2, readText2) {
|
|
|
138807
138878
|
const style = settings2.success ? boundedDisplayText(settings2.data.outputStyle ?? "") : "";
|
|
138808
138879
|
return style === "" ? void 0 : style;
|
|
138809
138880
|
}
|
|
138810
|
-
function outputStyleSegment({ payload, ports }) {
|
|
138881
|
+
function outputStyleSegment({ payload, ports, t: t10 }) {
|
|
138811
138882
|
const pinned = ports.env.CLAUDE_CONFIG_DIR;
|
|
138812
138883
|
const configDirectory = pinned === void 0 || pinned === "" ? import_node_path56.default.join(ports.homeDirectory, ".claude") : pinned;
|
|
138813
138884
|
const projectDirectory = payload.cwd ?? payload.workspace?.current_dir;
|
|
@@ -138817,7 +138888,7 @@ function outputStyleSegment({ payload, ports }) {
|
|
|
138817
138888
|
...projectDirectory === void 0 ? [] : [import_node_path56.default.join(projectDirectory, ".claude", "settings.json"), import_node_path56.default.join(projectDirectory, ".claude", "settings.local.json")]
|
|
138818
138889
|
];
|
|
138819
138890
|
const style = files.map((file2) => outputStyleIn(file2, ports.readText)).findLast((name) => name !== void 0);
|
|
138820
|
-
return style === void 0 ? void 0 :
|
|
138891
|
+
return style === void 0 ? void 0 : t10("outputStyle.name", { name: style });
|
|
138821
138892
|
}
|
|
138822
138893
|
|
|
138823
138894
|
// src/statusline/projectPath.ts
|
|
@@ -138861,9 +138932,9 @@ function workingDirectoryOf(payload) {
|
|
|
138861
138932
|
}
|
|
138862
138933
|
|
|
138863
138934
|
// src/statusline/elements/header/project.ts
|
|
138864
|
-
function inlineAddedDirs({ payload, palette }) {
|
|
138935
|
+
function inlineAddedDirs({ payload, palette, t: t10 }) {
|
|
138865
138936
|
const { names, more } = addedDirNames(payload.workspace?.added_dirs);
|
|
138866
|
-
const drawn = [...names.map((name) => `+${name}`), ...more > 0 ? [
|
|
138937
|
+
const drawn = [...names.map((name) => `+${name}`), ...more > 0 ? [t10("more", { count: more })] : []];
|
|
138867
138938
|
return drawn.length === 0 ? void 0 : drawn.map((text5) => palette.paint("label", text5)).join(" ");
|
|
138868
138939
|
}
|
|
138869
138940
|
function projectSegment(context) {
|
|
@@ -138884,14 +138955,14 @@ function providerSegment({ summary, settings: settings2 }) {
|
|
|
138884
138955
|
}
|
|
138885
138956
|
|
|
138886
138957
|
// src/statusline/elements/header/route.ts
|
|
138887
|
-
function routeSegment({ summary }) {
|
|
138888
|
-
return summary.routedTarget !== void 0 && !choiceNamesProvider(summary) ?
|
|
138958
|
+
function routeSegment({ summary, t: t10 }) {
|
|
138959
|
+
return summary.routedTarget !== void 0 && !choiceNamesProvider(summary) ? t10("route.via", { target: summary.routedTarget }) : void 0;
|
|
138889
138960
|
}
|
|
138890
138961
|
|
|
138891
138962
|
// src/statusline/elements/header/version.ts
|
|
138892
|
-
function versionSegment({ payload }) {
|
|
138963
|
+
function versionSegment({ payload, t: t10 }) {
|
|
138893
138964
|
const version2 = boundedDisplayText(payload.version ?? "");
|
|
138894
|
-
return version2 === "" ? void 0 :
|
|
138965
|
+
return version2 === "" ? void 0 : t10("version.label", { version: version2 });
|
|
138895
138966
|
}
|
|
138896
138967
|
|
|
138897
138968
|
// src/statusline/elements/header/sessionName.ts
|
|
@@ -139001,7 +139072,7 @@ function speedSegment(context) {
|
|
|
139001
139072
|
}
|
|
139002
139073
|
const outputTokens = context.payload.context_window?.current_usage?.output_tokens;
|
|
139003
139074
|
const tokensPerSecond = trackSpeed(context.ports, transcriptPath, { at: context.nowMs, outputTokens, transcriptBytes: outputTokens === void 0 ? context.transcript()?.bytes : void 0 });
|
|
139004
|
-
return tokensPerSecond === void 0 ? void 0 :
|
|
139075
|
+
return tokensPerSecond === void 0 ? void 0 : context.t("speed.rate", { rate: tokensPerSecond.toFixed(1) });
|
|
139005
139076
|
}
|
|
139006
139077
|
|
|
139007
139078
|
// src/statusline/vcs/git.ts
|
|
@@ -139096,10 +139167,10 @@ function parseNumstat(output2) {
|
|
|
139096
139167
|
function detachedName(ports, cwd) {
|
|
139097
139168
|
const tag = ports.run(GIT, ["describe", "--tags", "--exact-match", "HEAD"], cwd)?.trim();
|
|
139098
139169
|
if (tag !== void 0 && tag !== "") {
|
|
139099
|
-
return tag;
|
|
139170
|
+
return { name: tag, detached: false };
|
|
139100
139171
|
}
|
|
139101
139172
|
const commit = ports.run(GIT, ["rev-parse", "--short", "HEAD"], cwd)?.trim();
|
|
139102
|
-
return commit === void 0 || commit === "" ? void 0 :
|
|
139173
|
+
return commit === void 0 || commit === "" ? void 0 : { name: commit, detached: true };
|
|
139103
139174
|
}
|
|
139104
139175
|
function byRecency(ports, cwd, files) {
|
|
139105
139176
|
const root = ports.run(GIT, ["rev-parse", "--show-toplevel"], cwd)?.trim();
|
|
@@ -139112,16 +139183,16 @@ function byRecency(ports, cwd, files) {
|
|
|
139112
139183
|
function readGitStatus(ports, cwd, query) {
|
|
139113
139184
|
if (!query.workingTree) {
|
|
139114
139185
|
const abbreviated = ports.run(GIT, ["rev-parse", "--abbrev-ref", "HEAD"], cwd)?.trim();
|
|
139115
|
-
const
|
|
139116
|
-
return
|
|
139186
|
+
const head2 = abbreviated === DETACHED_ABBREV ? detachedName(ports, cwd) : { name: abbreviated, detached: false };
|
|
139187
|
+
return head2?.name === void 0 || head2.name === "" ? void 0 : { kind: "git", branch: sanitiseDisplayText(head2.name), detached: head2.detached, dirty: false, conflict: false, ahead: 0, behind: 0, lineDiff: void 0, files: void 0 };
|
|
139117
139188
|
}
|
|
139118
139189
|
const output2 = ports.run(GIT, ["--no-optional-locks", "status", "--porcelain=v2", "--branch", "-z"], cwd);
|
|
139119
139190
|
if (output2 === void 0) {
|
|
139120
139191
|
return void 0;
|
|
139121
139192
|
}
|
|
139122
139193
|
const status = parseStatus(output2);
|
|
139123
|
-
const
|
|
139124
|
-
if (status.noCommitYet ||
|
|
139194
|
+
const head = status.head === DETACHED_HEAD ? detachedName(ports, cwd) : { name: status.head, detached: false };
|
|
139195
|
+
if (status.noCommitYet || head?.name === void 0 || head.name === "") {
|
|
139125
139196
|
return void 0;
|
|
139126
139197
|
}
|
|
139127
139198
|
const numstat = query.lineDiff && status.dirty ? ports.run(GIT, ["--no-optional-locks", "diff", "--numstat", "-z", "HEAD"], cwd) : void 0;
|
|
@@ -139129,7 +139200,8 @@ function readGitStatus(ports, cwd, query) {
|
|
|
139129
139200
|
const tracked = query.files && status.tracked.length > 0 ? byRecency(ports, cwd, status.tracked) : status.tracked;
|
|
139130
139201
|
return {
|
|
139131
139202
|
kind: "git",
|
|
139132
|
-
branch: sanitiseDisplayText(
|
|
139203
|
+
branch: sanitiseDisplayText(head.name),
|
|
139204
|
+
detached: head.detached,
|
|
139133
139205
|
dirty: status.dirty,
|
|
139134
139206
|
conflict: false,
|
|
139135
139207
|
ahead: status.ahead,
|
|
@@ -139202,7 +139274,7 @@ function parse4(output2) {
|
|
|
139202
139274
|
return void 0;
|
|
139203
139275
|
}
|
|
139204
139276
|
const branch = label(bookmarks[0] ?? changeId);
|
|
139205
|
-
return branch === void 0 ? void 0 : { kind: "jj", branch, dirty: dirtyFlag === "1", conflict: conflictFlag === "1", ahead: 0, behind: 0, lineDiff: void 0, files: void 0 };
|
|
139277
|
+
return branch === void 0 ? void 0 : { kind: "jj", branch, detached: false, dirty: dirtyFlag === "1", conflict: conflictFlag === "1", ahead: 0, behind: 0, lineDiff: void 0, files: void 0 };
|
|
139206
139278
|
}
|
|
139207
139279
|
function readJjStatus(ports, cwd) {
|
|
139208
139280
|
const directory = ports.realPath(cwd);
|
|
@@ -139256,7 +139328,7 @@ function vcsSegment(context) {
|
|
|
139256
139328
|
const { settings: settings2, palette } = context;
|
|
139257
139329
|
const isGit = status.kind === "git";
|
|
139258
139330
|
const showDirty = isGit ? settings2.git.showDirty : settings2.jj.showDirty;
|
|
139259
|
-
const inner = [palette.paint("gitBranch", status.branch + (showDirty && status.dirty ? "*" : ""))];
|
|
139331
|
+
const inner = [palette.paint("gitBranch", (status.detached ? context.t("vcs.detached", { commit: status.branch }) : status.branch) + (showDirty && status.dirty ? "*" : ""))];
|
|
139260
139332
|
if (isGit && settings2.git.showAheadBehind) {
|
|
139261
139333
|
if (status.ahead > 0) {
|
|
139262
139334
|
inner.push(aheadText(status.ahead, context));
|
|
@@ -139273,19 +139345,54 @@ function vcsSegment(context) {
|
|
|
139273
139345
|
}
|
|
139274
139346
|
}
|
|
139275
139347
|
if (!isGit && settings2.jj.showConflicts && status.conflict) {
|
|
139276
|
-
inner.push(palette.paint("critical", "
|
|
139348
|
+
inner.push(palette.paint("critical", context.t("vcs.conflict")));
|
|
139277
139349
|
}
|
|
139278
139350
|
return `${status.kind}:(${inner.join(" ")}${palette.paint("git", ")")}`;
|
|
139279
139351
|
}
|
|
139280
139352
|
|
|
139353
|
+
// src/statusline/messages/around.ts
|
|
139354
|
+
var VALUE_MARK = String.fromCharCode(1);
|
|
139355
|
+
function paintCore(text5, paint) {
|
|
139356
|
+
const core = text5.trim();
|
|
139357
|
+
if (core === "") {
|
|
139358
|
+
return text5;
|
|
139359
|
+
}
|
|
139360
|
+
const start = text5.indexOf(core);
|
|
139361
|
+
return `${text5.slice(0, start)}${paint(core)}${text5.slice(start + core.length)}`;
|
|
139362
|
+
}
|
|
139363
|
+
function aroundValue(message, value2, paint) {
|
|
139364
|
+
const sides = message.split(VALUE_MARK);
|
|
139365
|
+
const [before, after] = sides;
|
|
139366
|
+
if (sides.length !== 2 || before === void 0 || after === void 0) {
|
|
139367
|
+
throw new TypeError(`message "${message}" must hold the value mark exactly once, and holds it ${String(sides.length - 1)} times`);
|
|
139368
|
+
}
|
|
139369
|
+
return `${paintCore(before, paint)}${value2}${paintCore(after, paint)}`;
|
|
139370
|
+
}
|
|
139371
|
+
function marked(t10, id2) {
|
|
139372
|
+
switch (id2) {
|
|
139373
|
+
case "sessionTime.started":
|
|
139374
|
+
return t10(id2, { time: VALUE_MARK });
|
|
139375
|
+
case "sessionTime.lastReply":
|
|
139376
|
+
return t10(id2, { ago: VALUE_MARK });
|
|
139377
|
+
case "addedDirs.label":
|
|
139378
|
+
return t10(id2, { dirs: VALUE_MARK });
|
|
139379
|
+
default:
|
|
139380
|
+
return id2;
|
|
139381
|
+
}
|
|
139382
|
+
}
|
|
139383
|
+
function writeAround(t10, id2, value2, paint) {
|
|
139384
|
+
return aroundValue(marked(t10, id2), value2, paint);
|
|
139385
|
+
}
|
|
139386
|
+
|
|
139281
139387
|
// src/statusline/elements/rows/addedDirs.ts
|
|
139282
|
-
function addedDirsRow({ payload, settings: settings2, palette }) {
|
|
139388
|
+
function addedDirsRow({ payload, settings: settings2, palette, t: t10 }) {
|
|
139283
139389
|
const { names, more } = addedDirNames(payload.workspace?.added_dirs);
|
|
139284
139390
|
if (settings2.project.addedDirsLayout !== "row" || names.length === 0) {
|
|
139285
139391
|
return { kind: "text", lines: [] };
|
|
139286
139392
|
}
|
|
139287
|
-
const
|
|
139288
|
-
|
|
139393
|
+
const label2 = (text5) => palette.paint("label", text5);
|
|
139394
|
+
const drawn = [...names, ...more > 0 ? [t10("more", { count: more })] : []].map(label2);
|
|
139395
|
+
return { kind: "text", lines: [writeAround(t10, "addedDirs.label", drawn.join(label2(t10("list.separator"))), label2)] };
|
|
139289
139396
|
}
|
|
139290
139397
|
|
|
139291
139398
|
// src/statusline/elements/rows/compactions.ts
|
|
@@ -139294,7 +139401,7 @@ function compactionsRow(context) {
|
|
|
139294
139401
|
if (transcript === void 0 || transcript.session.compactions === 0) {
|
|
139295
139402
|
return { kind: "text", lines: [] };
|
|
139296
139403
|
}
|
|
139297
|
-
return { kind: "text", lines: [context.palette.paint("label",
|
|
139404
|
+
return { kind: "text", lines: [context.palette.paint("label", context.t("compactions.label", { count: `${String(transcript.session.compactions)}${transcript.complete ? "" : "+"}` }))] };
|
|
139298
139405
|
}
|
|
139299
139406
|
|
|
139300
139407
|
// src/statusline/elements/rows/context.ts
|
|
@@ -139306,18 +139413,18 @@ function barStyleOf({ settings: settings2, palette }, okRole) {
|
|
|
139306
139413
|
}
|
|
139307
139414
|
|
|
139308
139415
|
// src/statusline/elements/rows/context.ts
|
|
139309
|
-
function cacheHitText(hitFraction, style) {
|
|
139416
|
+
function cacheHitText(hitFraction, style, t10) {
|
|
139310
139417
|
const clamped = Math.max(0, Math.min(1, hitFraction));
|
|
139311
|
-
return ` (
|
|
139418
|
+
return ` (${t10("context.cacheShare", { percent: withColor(statusColor(clamped, false, style), `${(clamped * FULL_PERCENT3).toFixed(0)}%`) })})`;
|
|
139312
139419
|
}
|
|
139313
|
-
function cacheShareText(view, style) {
|
|
139420
|
+
function cacheShareText(view, style, t10) {
|
|
139314
139421
|
const hitRatio = view.cacheHitRatio;
|
|
139315
139422
|
if (hitRatio !== void 0 && Number.isFinite(hitRatio)) {
|
|
139316
|
-
return cacheHitText(hitRatio, style);
|
|
139423
|
+
return cacheHitText(hitRatio, style, t10);
|
|
139317
139424
|
}
|
|
139318
139425
|
const promptTotal = (view.cacheReadTokens ?? 0) + (view.freshInputTokens ?? 0);
|
|
139319
139426
|
if (promptTotal > 0 && (view.cacheReadTokens ?? 0) > 0) {
|
|
139320
|
-
return cacheHitText((view.cacheReadTokens ?? 0) / promptTotal, style);
|
|
139427
|
+
return cacheHitText((view.cacheReadTokens ?? 0) / promptTotal, style, t10);
|
|
139321
139428
|
}
|
|
139322
139429
|
return "";
|
|
139323
139430
|
}
|
|
@@ -139344,13 +139451,13 @@ function usedPercentOf(context) {
|
|
|
139344
139451
|
function estimateOf(kind, tokens, windowTokens) {
|
|
139345
139452
|
return kind === "buffered" ? bufferedPercent(tokens, windowTokens) : Math.min(FULL_PERCENT3, tokens / windowTokens * FULL_PERCENT3);
|
|
139346
139453
|
}
|
|
139347
|
-
function breakdownText({ payload }) {
|
|
139454
|
+
function breakdownText({ payload, t: t10 }) {
|
|
139348
139455
|
const usage = payload.context_window?.current_usage;
|
|
139349
139456
|
if (usage === void 0) {
|
|
139350
139457
|
return void 0;
|
|
139351
139458
|
}
|
|
139352
139459
|
const cached2 = (usage.cache_creation_input_tokens ?? 0) + (usage.cache_read_input_tokens ?? 0);
|
|
139353
|
-
return ` (
|
|
139460
|
+
return ` (${t10("context.breakdown", { input: formatTokens(usage.input_tokens ?? 0), cached: formatTokens(cached2) })})`;
|
|
139354
139461
|
}
|
|
139355
139462
|
function contextRow(context) {
|
|
139356
139463
|
const { view, palette, settings: settings2 } = context;
|
|
@@ -139395,8 +139502,8 @@ function contextRow(context) {
|
|
|
139395
139502
|
if (settings2.context.bar === "hidden" && afterBar.length === 0) {
|
|
139396
139503
|
return { kind: "text", lines: [] };
|
|
139397
139504
|
}
|
|
139398
|
-
const trailer = `${cacheShareText(view, style)}${high === void 0 ? "" : palette.paint("label", high)}`;
|
|
139399
|
-
const label2 = ["
|
|
139505
|
+
const trailer = `${cacheShareText(view, style, context.t)}${high === void 0 ? "" : palette.paint("label", high)}`;
|
|
139506
|
+
const label2 = [context.t("context.label"), ...beforeBar].join(" ");
|
|
139400
139507
|
if (settings2.context.bar === "shown") {
|
|
139401
139508
|
const suffix = afterBar.length === 0 ? trailer : ` ${afterBar.join(" ")}${trailer}`;
|
|
139402
139509
|
return { kind: "bars", cells: [barCell(palette.paint("label", `${label2} `), suffix, fraction, { ...style, bands })] };
|
|
@@ -139413,7 +139520,7 @@ var KIND_MARKS = {
|
|
|
139413
139520
|
modified: { mark: "~", role: "warning" }
|
|
139414
139521
|
};
|
|
139415
139522
|
function gitFilesRow(context) {
|
|
139416
|
-
const { palette, terminalWidth } = context;
|
|
139523
|
+
const { palette, terminalWidth, t: t10 } = context;
|
|
139417
139524
|
const none = { kind: "text", lines: [] };
|
|
139418
139525
|
const files = terminalWidth < MIN_COLUMNS ? void 0 : vcsStatusOf(context)?.files;
|
|
139419
139526
|
if (files === void 0 || files.tracked.length === 0 && files.untracked === 0) {
|
|
@@ -139429,7 +139536,7 @@ function gitFilesRow(context) {
|
|
|
139429
139536
|
});
|
|
139430
139537
|
const overflow = files.tracked.length - shown.length;
|
|
139431
139538
|
if (overflow > 0) {
|
|
139432
|
-
entries.push(palette.paint("label",
|
|
139539
|
+
entries.push(palette.paint("label", t10("more", { count: overflow })));
|
|
139433
139540
|
}
|
|
139434
139541
|
if (files.untracked > 0) {
|
|
139435
139542
|
entries.push(palette.paint("label", `?${String(files.untracked)}`));
|
|
@@ -139637,17 +139744,41 @@ function layoutHeader(texts, maxWidth, separator) {
|
|
|
139637
139744
|
}
|
|
139638
139745
|
|
|
139639
139746
|
// src/statusline/elements/rows/environment.ts
|
|
139640
|
-
function counted(count2,
|
|
139641
|
-
|
|
139747
|
+
function counted(count2, one2, other) {
|
|
139748
|
+
if (count2 === 0) {
|
|
139749
|
+
return void 0;
|
|
139750
|
+
}
|
|
139751
|
+
return count2 === 1 ? one2(count2) : other(count2);
|
|
139642
139752
|
}
|
|
139643
139753
|
function environmentRow(context) {
|
|
139644
|
-
const { payload, settings: settings2, palette, ports } = context;
|
|
139754
|
+
const { payload, settings: settings2, palette, ports, t: t10 } = context;
|
|
139645
139755
|
const counts = countConfiguration(ports, payload.cwd ?? payload.workspace?.current_dir);
|
|
139646
139756
|
const total = counts.claudeMd + counts.rules + counts.mcpServers + counts.hookEvents;
|
|
139647
139757
|
if (total === 0 || total < settings2.environment.threshold) {
|
|
139648
139758
|
return { kind: "text", lines: [] };
|
|
139649
139759
|
}
|
|
139650
|
-
const parts = [
|
|
139760
|
+
const parts = [
|
|
139761
|
+
counted(
|
|
139762
|
+
counts.claudeMd,
|
|
139763
|
+
(count2) => t10("environment.claudeMd.one", { count: count2 }),
|
|
139764
|
+
(count2) => t10("environment.claudeMd.other", { count: count2 })
|
|
139765
|
+
),
|
|
139766
|
+
counted(
|
|
139767
|
+
counts.rules,
|
|
139768
|
+
(count2) => t10("environment.rules.one", { count: count2 }),
|
|
139769
|
+
(count2) => t10("environment.rules.other", { count: count2 })
|
|
139770
|
+
),
|
|
139771
|
+
counted(
|
|
139772
|
+
counts.mcpServers,
|
|
139773
|
+
(count2) => t10("environment.mcp.one", { count: count2 }),
|
|
139774
|
+
(count2) => t10("environment.mcp.other", { count: count2 })
|
|
139775
|
+
),
|
|
139776
|
+
counted(
|
|
139777
|
+
counts.hookEvents,
|
|
139778
|
+
(count2) => t10("environment.hooks.one", { count: count2 }),
|
|
139779
|
+
(count2) => t10("environment.hooks.other", { count: count2 })
|
|
139780
|
+
)
|
|
139781
|
+
].filter((part) => part !== void 0);
|
|
139651
139782
|
return { kind: "text", lines: packLines(parts.map((part) => palette.paint("label", part)), context.width, SEPARATOR2).map((line) => line.join(SEPARATOR2)) };
|
|
139652
139783
|
}
|
|
139653
139784
|
|
|
@@ -139659,7 +139790,7 @@ function memoryRow(context) {
|
|
|
139659
139790
|
const style = barStyleOf(context, "usage");
|
|
139660
139791
|
const fraction = Math.max(0, Math.min(1, use2.usedBytes / use2.totalBytes));
|
|
139661
139792
|
const percent2 = withColor(statusColor(fraction, true, style), `${(fraction * FULL_PERCENT3).toFixed(1)}%`);
|
|
139662
|
-
cells.push(barCell(context.palette.paint("label", "
|
|
139793
|
+
cells.push(barCell(context.palette.paint("label", `${context.t("memory.label")} `), ` ${percent2} (${formatBytes(use2.usedBytes)} / ${formatBytes(use2.totalBytes)})`, fraction, style));
|
|
139663
139794
|
}
|
|
139664
139795
|
return { kind: "bars", cells };
|
|
139665
139796
|
}
|
|
@@ -139702,16 +139833,16 @@ function promptCacheRow(context) {
|
|
|
139702
139833
|
if (cache === void 0) {
|
|
139703
139834
|
return { kind: "text", lines: [] };
|
|
139704
139835
|
}
|
|
139705
|
-
const { palette, nowMs, settings: settings2 } = context;
|
|
139836
|
+
const { palette, nowMs, settings: settings2, t: t10 } = context;
|
|
139706
139837
|
const ttlSeconds = cache.ttlSeconds ?? settings2.promptCache.ttlSeconds;
|
|
139707
139838
|
const expiresAtMs = cache.anchorAtMs + ttlSeconds * MS_PER_SECOND21;
|
|
139708
139839
|
const remainingMs = expiresAtMs - nowMs;
|
|
139709
|
-
const name = palette.paint("label", "
|
|
139840
|
+
const name = palette.paint("label", t10("promptCache.label"));
|
|
139710
139841
|
if (remainingMs <= 0) {
|
|
139711
|
-
return { kind: "text", lines: [`${name} ${palette.paint("label",
|
|
139842
|
+
return { kind: "text", lines: [`${name} ${palette.paint("label", `\u23F1 ${t10("promptCache.expired")}`)}`] };
|
|
139712
139843
|
}
|
|
139713
139844
|
const role = remainingMs <= warningSecondsOf(ttlSeconds) * MS_PER_SECOND21 ? "warning" : "context";
|
|
139714
|
-
return { kind: "text", lines: [`${name} ${palette.paint(role, `\u23F1 until
|
|
139845
|
+
return { kind: "text", lines: [`${name} ${palette.paint(role, `\u23F1 ${t10("promptCache.until", { time: formatWallClock(expiresAtMs, nowMs, context.ports.clock, settings2.clock) })}`)}`] };
|
|
139715
139846
|
}
|
|
139716
139847
|
|
|
139717
139848
|
// src/statusline/elements/rows/quota.ts
|
|
@@ -139719,7 +139850,6 @@ init_statusline();
|
|
|
139719
139850
|
init_pick();
|
|
139720
139851
|
|
|
139721
139852
|
// src/statusline/resetTime.ts
|
|
139722
|
-
var AVAILABLE = formatDuration(void 0);
|
|
139723
139853
|
function elapsedPercent(resetMs, periodMs, nowMs) {
|
|
139724
139854
|
if (!Number.isFinite(resetMs) || periodMs === void 0) {
|
|
139725
139855
|
return void 0;
|
|
@@ -139727,25 +139857,33 @@ function elapsedPercent(resetMs, periodMs, nowMs) {
|
|
|
139727
139857
|
const share = (nowMs - (resetMs - periodMs)) / periodMs * FULL_PERCENT3;
|
|
139728
139858
|
return Math.max(0, Math.min(FULL_PERCENT3, Math.round(share)));
|
|
139729
139859
|
}
|
|
139730
|
-
function formatResetTime(window, nowMs, settings2, clock) {
|
|
139860
|
+
function formatResetTime(window, nowMs, settings2, clock, t10, labelled) {
|
|
139731
139861
|
const resetMs = window.resetsAt === void 0 ? Number.NaN : Date.parse(window.resetsAt);
|
|
139732
139862
|
const secondsLeft = secondsUntil(window.resetsAt, nowMs);
|
|
139733
139863
|
const pending = secondsLeft !== void 0 && secondsLeft > 0;
|
|
139734
|
-
const
|
|
139735
|
-
|
|
139864
|
+
const available = t10("quota.available");
|
|
139865
|
+
if (!pending && settings2.usage.timeFormat !== "elapsed" && settings2.usage.timeFormat !== "elapsedAndAbsolute") {
|
|
139866
|
+
return { text: settings2.usage.timeFormat === "relative" ? formatDuration(secondsLeft, t10) : available, pending };
|
|
139867
|
+
}
|
|
139868
|
+
const introduced = labelled && pending;
|
|
139869
|
+
const relative = formatDuration(secondsLeft, t10);
|
|
139870
|
+
const time4 = pending ? formatWallClock(resetMs, nowMs, clock, settings2.clock) : "";
|
|
139736
139871
|
const elapsed = elapsedPercent(resetMs, window.periodMs, nowMs);
|
|
139737
|
-
const elapsedText = elapsed === void 0 ? void 0 :
|
|
139872
|
+
const elapsedText = elapsed === void 0 ? void 0 : t10("quota.elapsed", { percent: elapsed });
|
|
139738
139873
|
switch (settings2.usage.timeFormat) {
|
|
139739
139874
|
case "relative":
|
|
139740
|
-
return { text: relative, pending };
|
|
139875
|
+
return { text: introduced ? t10("quota.resetsIn", { time: relative }) : relative, pending };
|
|
139741
139876
|
case "absolute":
|
|
139742
|
-
return { text:
|
|
139877
|
+
return { text: introduced ? t10("quota.resetsAt", { time: time4 }) : t10("quota.at", { time: time4 }), pending };
|
|
139743
139878
|
case "both":
|
|
139744
|
-
return { text:
|
|
139879
|
+
return { text: introduced ? t10("quota.resetsInAt", { relative, time: time4 }) : t10("quota.relativeAt", { relative, time: time4 }), pending };
|
|
139745
139880
|
case "elapsed":
|
|
139746
139881
|
return { text: elapsedText ?? "", pending };
|
|
139747
139882
|
case "elapsedAndAbsolute":
|
|
139748
|
-
|
|
139883
|
+
if (elapsedText === void 0) {
|
|
139884
|
+
return { text: pending ? t10("quota.at", { time: time4 }) : "", pending };
|
|
139885
|
+
}
|
|
139886
|
+
return { text: pending ? t10("quota.elapsedAt", { elapsed: elapsedText, time: time4 }) : elapsedText, pending };
|
|
139749
139887
|
default:
|
|
139750
139888
|
return settings2.usage.timeFormat;
|
|
139751
139889
|
}
|
|
@@ -139771,10 +139909,10 @@ function candidateWindows(context) {
|
|
|
139771
139909
|
}
|
|
139772
139910
|
const windows = [];
|
|
139773
139911
|
if (summary.fiveHourUsed !== void 0) {
|
|
139774
|
-
windows.push({ label: settings2.labels.fiveHour, fraction: summary.fiveHourUsed / FULL_PERCENT3, resetsAt: summary.fiveHourResetAt, periodMs: FIVE_HOUR_WINDOW_MS, weekly: false });
|
|
139912
|
+
windows.push({ label: settings2.labels.fiveHour === "" ? context.t("quota.fiveHour") : settings2.labels.fiveHour, fraction: summary.fiveHourUsed / FULL_PERCENT3, resetsAt: summary.fiveHourResetAt, periodMs: FIVE_HOUR_WINDOW_MS, weekly: false });
|
|
139775
139913
|
}
|
|
139776
139914
|
if (summary.sevenDayUsed !== void 0) {
|
|
139777
|
-
windows.push({ label: settings2.labels.sevenDay, fraction: summary.sevenDayUsed / FULL_PERCENT3, resetsAt: summary.sevenDayResetAt, periodMs: SEVEN_DAY_WINDOW_MS, weekly: true });
|
|
139915
|
+
windows.push({ label: settings2.labels.sevenDay === "" ? context.t("quota.sevenDay") : settings2.labels.sevenDay, fraction: summary.sevenDayUsed / FULL_PERCENT3, resetsAt: summary.sevenDayResetAt, periodMs: SEVEN_DAY_WINDOW_MS, weekly: true });
|
|
139778
139916
|
}
|
|
139779
139917
|
if (summary.fiveHourUsed === void 0 && summary.sevenDayUsed === void 0) {
|
|
139780
139918
|
windows.push(...summary.providerQuotaWindows.map((window) => ({ label: window.measures, fraction: window.utilization, resetsAt: window.resetsAt, periodMs: window.periodMs, weekly: false })));
|
|
@@ -139799,19 +139937,12 @@ function figuresOf(window, context, style) {
|
|
|
139799
139937
|
const clamped = Math.max(0, Math.min(1, window.fraction));
|
|
139800
139938
|
const used = window.fraction * FULL_PERCENT3;
|
|
139801
139939
|
const shown = settings2.usage.value === "remaining" ? Math.max(0, FULL_PERCENT3 - used) : used;
|
|
139802
|
-
const
|
|
139803
|
-
|
|
139940
|
+
const reset = formatResetTime(window, nowMs, settings2, ports.clock, context.t, settings2.usage.resetLabel).text;
|
|
139941
|
+
const plainReset = settings2.usage.resetLabel ? formatResetTime(window, nowMs, settings2, ports.clock, context.t, false).text : reset;
|
|
139942
|
+
return { value: withColor(statusColor(clamped, true, style), `${shown.toFixed(1)}%`), reset, plainReset };
|
|
139804
139943
|
}
|
|
139805
|
-
function
|
|
139806
|
-
|
|
139807
|
-
return "";
|
|
139808
|
-
}
|
|
139809
|
-
const { usage } = context.settings;
|
|
139810
|
-
const elapsedForm = usage.timeFormat === "elapsed" || usage.timeFormat === "elapsedAndAbsolute";
|
|
139811
|
-
if (!usage.resetLabel || !pending || elapsedForm) {
|
|
139812
|
-
return `(${reset})`;
|
|
139813
|
-
}
|
|
139814
|
-
return `(${usage.timeFormat === "absolute" ? "resets" : "resets in"} ${reset})`;
|
|
139944
|
+
function parenthesised(reset) {
|
|
139945
|
+
return reset === "" ? "" : `(${reset})`;
|
|
139815
139946
|
}
|
|
139816
139947
|
function wrapped(windows, width) {
|
|
139817
139948
|
return packLines(windows, width, SEPARATOR2).map((line) => line.join(SEPARATOR2));
|
|
@@ -139821,11 +139952,11 @@ function quotaRow(context) {
|
|
|
139821
139952
|
const style = barStyleOf(context, "usage");
|
|
139822
139953
|
const windows = visibleWindows(context);
|
|
139823
139954
|
const parts = windows.map((window) => {
|
|
139824
|
-
const { value: value2, reset,
|
|
139825
|
-
return { window, value: value2,
|
|
139955
|
+
const { value: value2, reset, plainReset } = figuresOf(window, context, style);
|
|
139956
|
+
return { window, value: value2, plainReset, suffix: parenthesised(reset) };
|
|
139826
139957
|
});
|
|
139827
139958
|
if (settings2.usage.compact) {
|
|
139828
|
-
const lines = parts.map(({ window, value: value2,
|
|
139959
|
+
const lines = parts.map(({ window, value: value2, plainReset }) => `${paintCore(context.t("quota.compactLabel", { label: window.label }), (text5) => palette.paint("label", text5))}${value2}${plainReset === "" ? "" : ` ${palette.paint("label", `(${plainReset})`)}`}`);
|
|
139829
139960
|
return { kind: "text", lines: wrapped(lines, context.width) };
|
|
139830
139961
|
}
|
|
139831
139962
|
if (!settings2.usage.bar) {
|
|
@@ -139839,12 +139970,13 @@ function quotaRow(context) {
|
|
|
139839
139970
|
// src/statusline/elements/rows/sessionTime.ts
|
|
139840
139971
|
function sessionTimeRow(context) {
|
|
139841
139972
|
const session = context.transcript()?.session;
|
|
139842
|
-
const { palette, nowMs, settings: settings2 } = context;
|
|
139973
|
+
const { palette, nowMs, settings: settings2, t: t10 } = context;
|
|
139974
|
+
const label2 = (text5) => palette.paint("label", text5);
|
|
139843
139975
|
const parts = settings2.sessionTime.parts.flatMap((part) => {
|
|
139844
139976
|
if (part === "started") {
|
|
139845
|
-
return session?.startedAtMs === void 0 ? [] :
|
|
139977
|
+
return session?.startedAtMs === void 0 ? [] : writeAround(t10, "sessionTime.started", formatWallClock(session.startedAtMs, nowMs, context.ports.clock, settings2.clock), label2);
|
|
139846
139978
|
}
|
|
139847
|
-
return session?.lastResponseAtMs === void 0 ? [] :
|
|
139979
|
+
return session?.lastResponseAtMs === void 0 ? [] : writeAround(t10, "sessionTime.lastReply", formatAgo(nowMs - session.lastResponseAtMs, t10), label2);
|
|
139848
139980
|
});
|
|
139849
139981
|
return { kind: "text", lines: parts.length === 0 ? [] : [parts.join(` ${palette.paint("label", "\u2502")} `)] };
|
|
139850
139982
|
}
|
|
@@ -139905,19 +140037,19 @@ function foldTokens(state, record2) {
|
|
|
139905
140037
|
}
|
|
139906
140038
|
|
|
139907
140039
|
// src/statusline/elements/rows/tokens.ts
|
|
139908
|
-
function tokensRow({ palette, transcript }) {
|
|
140040
|
+
function tokensRow({ palette, transcript, t: t10 }) {
|
|
139909
140041
|
const facts = transcript();
|
|
139910
140042
|
const total = facts === void 0 ? 0 : totalTokens(facts.tokens);
|
|
139911
140043
|
if (facts === void 0 || total === 0) {
|
|
139912
140044
|
return { kind: "text", lines: [] };
|
|
139913
140045
|
}
|
|
139914
140046
|
const { tokens } = facts;
|
|
139915
|
-
const parts = [
|
|
140047
|
+
const parts = [t10("tokens.input", { count: formatTokens(tokens.inputTokens) }), t10("tokens.output", { count: formatTokens(tokens.outputTokens) })];
|
|
139916
140048
|
const cached2 = tokens.cacheCreationTokens + tokens.cacheReadTokens;
|
|
139917
140049
|
if (cached2 > 0) {
|
|
139918
|
-
parts.push(
|
|
140050
|
+
parts.push(t10("tokens.cache", { count: formatTokens(cached2) }));
|
|
139919
140051
|
}
|
|
139920
|
-
return { kind: "text", lines: [palette.paint("label",
|
|
140052
|
+
return { kind: "text", lines: [palette.paint("label", t10("tokens.summary", { total: `${formatTokens(total)}${facts.complete ? "" : "+"}`, parts: parts.join(t10("list.separator")) }))] };
|
|
139921
140053
|
}
|
|
139922
140054
|
|
|
139923
140055
|
// src/statusline/elements/registry.ts
|
|
@@ -140053,6 +140185,203 @@ function readTranscriptIdentity(ports, transcriptPath) {
|
|
|
140053
140185
|
return floor === 0 ? identityOfLine(decoder.decode(joined2(carry))) ?? NOT_FOUND : NOT_FOUND;
|
|
140054
140186
|
}
|
|
140055
140187
|
|
|
140188
|
+
// src/statusline/messages/en.ts
|
|
140189
|
+
var EN2 = {
|
|
140190
|
+
"context.label": "Ctx",
|
|
140191
|
+
"context.cacheShare": "Cache: {percent}",
|
|
140192
|
+
"context.breakdown": "in: {input}, cache: {cached}",
|
|
140193
|
+
"quota.fiveHour": "5h",
|
|
140194
|
+
"quota.sevenDay": "Wk",
|
|
140195
|
+
"quota.resetsIn": "resets in {time}",
|
|
140196
|
+
"quota.resetsAt": "resets at {time}",
|
|
140197
|
+
"quota.resetsInAt": "resets in {relative}, at {time}",
|
|
140198
|
+
"quota.at": "at {time}",
|
|
140199
|
+
"quota.relativeAt": "{relative}, at {time}",
|
|
140200
|
+
"quota.compactLabel": "{label}: ",
|
|
140201
|
+
"quota.available": "available",
|
|
140202
|
+
"quota.elapsed": "{percent}% elapsed",
|
|
140203
|
+
"quota.elapsedAt": "{elapsed}, at {time}",
|
|
140204
|
+
"memory.label": "RAM",
|
|
140205
|
+
"cost.session": "Cost {amount}",
|
|
140206
|
+
"cost.estimated": "Est. {amount}",
|
|
140207
|
+
"cost.today": "Today {amount}",
|
|
140208
|
+
"advisor.name": "Advisor: {name}",
|
|
140209
|
+
"outputStyle.name": "style: {name}",
|
|
140210
|
+
"route.via": "via {target}",
|
|
140211
|
+
"speed.rate": "out: {rate} tok/s",
|
|
140212
|
+
"headroom.label": "headroom {parts}",
|
|
140213
|
+
"headroom.saved": "{tokens} saved",
|
|
140214
|
+
"headroom.overall": "{percent}% overall",
|
|
140215
|
+
"version.label": "CC v{version}",
|
|
140216
|
+
"vcs.conflict": "!conflict",
|
|
140217
|
+
"vcs.detached": "detached:{commit}",
|
|
140218
|
+
"effort.low": "low",
|
|
140219
|
+
"effort.medium": "medium",
|
|
140220
|
+
"effort.high": "high",
|
|
140221
|
+
"effort.xhigh": "xhigh",
|
|
140222
|
+
"effort.max": "max",
|
|
140223
|
+
"more": "+{count} more",
|
|
140224
|
+
"addedDirs.label": "Added dirs: {dirs}",
|
|
140225
|
+
"sessionTime.started": "Started: {time}",
|
|
140226
|
+
"sessionTime.lastReply": "Last reply: {ago}",
|
|
140227
|
+
"time.justNow": "just now",
|
|
140228
|
+
"time.ago": "{value} ago",
|
|
140229
|
+
"promptCache.label": "Cache",
|
|
140230
|
+
"promptCache.expired": "expired",
|
|
140231
|
+
"promptCache.until": "until {time}",
|
|
140232
|
+
"tokens.summary": "Tokens {total} ({parts})",
|
|
140233
|
+
"tokens.input": "in: {count}",
|
|
140234
|
+
"tokens.output": "out: {count}",
|
|
140235
|
+
"tokens.cache": "cache: {count}",
|
|
140236
|
+
"list.separator": ", ",
|
|
140237
|
+
"compactions.label": "Compactions: {count}",
|
|
140238
|
+
"environment.claudeMd.one": "{count} CLAUDE.md",
|
|
140239
|
+
"environment.claudeMd.other": "{count} CLAUDE.md",
|
|
140240
|
+
"environment.rules.one": "{count} rule",
|
|
140241
|
+
"environment.rules.other": "{count} rules",
|
|
140242
|
+
"environment.mcp.one": "{count} MCP",
|
|
140243
|
+
"environment.mcp.other": "{count} MCPs",
|
|
140244
|
+
"environment.hooks.one": "{count} hook",
|
|
140245
|
+
"environment.hooks.other": "{count} hooks"
|
|
140246
|
+
};
|
|
140247
|
+
|
|
140248
|
+
// src/statusline/messages/zhHans.ts
|
|
140249
|
+
var ZH_HANS = {
|
|
140250
|
+
"context.label": "\u4E0A\u4E0B\u6587",
|
|
140251
|
+
"context.breakdown": "\u8F93\u5165\uFF1A{input}\uFF0C\u7F13\u5B58\uFF1A{cached}",
|
|
140252
|
+
"context.cacheShare": "\u7F13\u5B58\uFF1A{percent}",
|
|
140253
|
+
"quota.fiveHour": "5\u5C0F\u65F6",
|
|
140254
|
+
"quota.sevenDay": "\u672C\u5468",
|
|
140255
|
+
"quota.resetsIn": "\u8DDD\u91CD\u7F6E {time}",
|
|
140256
|
+
"quota.resetsAt": "\u91CD\u7F6E\u4E8E {time}",
|
|
140257
|
+
"quota.resetsInAt": "\u8DDD\u91CD\u7F6E {relative}\uFF0C\u4E8E {time}",
|
|
140258
|
+
"quota.at": "{time} \u91CD\u7F6E",
|
|
140259
|
+
"quota.relativeAt": "{relative}\uFF0C{time} \u91CD\u7F6E",
|
|
140260
|
+
"quota.compactLabel": "{label}\uFF1A",
|
|
140261
|
+
"quota.available": "\u53EF\u7528",
|
|
140262
|
+
"quota.elapsed": "\u5DF2\u8FC7 {percent}%",
|
|
140263
|
+
"quota.elapsedAt": "{elapsed}\uFF0C{time} \u91CD\u7F6E",
|
|
140264
|
+
"memory.label": "\u5185\u5B58",
|
|
140265
|
+
"cost.session": "\u8D39\u7528 {amount}",
|
|
140266
|
+
"cost.estimated": "\u4F30\u7B97 {amount}",
|
|
140267
|
+
"cost.today": "\u4ECA\u65E5 {amount}",
|
|
140268
|
+
"advisor.name": "\u987E\u95EE\uFF1A{name}",
|
|
140269
|
+
"outputStyle.name": "\u8F93\u51FA\u98CE\u683C\uFF1A{name}",
|
|
140270
|
+
"route.via": "\u7ECF\u7531 {target}",
|
|
140271
|
+
"speed.rate": "\u8F93\u51FA\uFF1A{rate} tok/s",
|
|
140272
|
+
"headroom.label": "headroom {parts}",
|
|
140273
|
+
"headroom.saved": "\u5DF2\u8282\u7701 {tokens}",
|
|
140274
|
+
"headroom.overall": "\u603B\u8BA1 {percent}%",
|
|
140275
|
+
"version.label": "CC v{version}",
|
|
140276
|
+
"vcs.conflict": "!\u51B2\u7A81",
|
|
140277
|
+
"vcs.detached": "\u5206\u79BB\u4E8E {commit}",
|
|
140278
|
+
"effort.low": "\u4F4E",
|
|
140279
|
+
"effort.medium": "\u4E2D",
|
|
140280
|
+
"effort.high": "\u9AD8",
|
|
140281
|
+
"effort.xhigh": "\u8D85\u9AD8",
|
|
140282
|
+
"effort.max": "\u6700\u9AD8",
|
|
140283
|
+
"more": "\u53E6\u6709 {count} \u4E2A",
|
|
140284
|
+
"addedDirs.label": "\u9644\u52A0\u76EE\u5F55\uFF1A{dirs}",
|
|
140285
|
+
"sessionTime.started": "\u5F00\u59CB\uFF1A{time}",
|
|
140286
|
+
"sessionTime.lastReply": "\u4E0A\u6B21\u56DE\u590D\uFF1A{ago}",
|
|
140287
|
+
"time.justNow": "\u521A\u521A",
|
|
140288
|
+
"time.ago": "{value}\u524D",
|
|
140289
|
+
"promptCache.label": "\u7F13\u5B58",
|
|
140290
|
+
"promptCache.expired": "\u5DF2\u8FC7\u671F",
|
|
140291
|
+
"promptCache.until": "\u81F3 {time}",
|
|
140292
|
+
"tokens.summary": "\u8BCD\u5143 {total}\uFF08{parts}\uFF09",
|
|
140293
|
+
"tokens.input": "\u8F93\u5165 {count}",
|
|
140294
|
+
"tokens.output": "\u8F93\u51FA {count}",
|
|
140295
|
+
"tokens.cache": "\u7F13\u5B58 {count}",
|
|
140296
|
+
"list.separator": "\uFF0C",
|
|
140297
|
+
"compactions.label": "\u538B\u7F29\u6B21\u6570\uFF1A{count}",
|
|
140298
|
+
"environment.claudeMd.one": "{count} \u4E2A CLAUDE.md",
|
|
140299
|
+
"environment.claudeMd.other": "{count} \u4E2A CLAUDE.md",
|
|
140300
|
+
"environment.rules.one": "{count} \u6761\u89C4\u5219",
|
|
140301
|
+
"environment.rules.other": "{count} \u6761\u89C4\u5219",
|
|
140302
|
+
"environment.mcp.one": "{count} \u4E2A MCP",
|
|
140303
|
+
"environment.mcp.other": "{count} \u4E2A MCP",
|
|
140304
|
+
"environment.hooks.one": "{count} \u4E2A\u94A9\u5B50",
|
|
140305
|
+
"environment.hooks.other": "{count} \u4E2A\u94A9\u5B50"
|
|
140306
|
+
};
|
|
140307
|
+
|
|
140308
|
+
// src/statusline/messages/zhHant.ts
|
|
140309
|
+
var ZH_HANT = {
|
|
140310
|
+
"context.label": "\u4E0A\u4E0B\u6587",
|
|
140311
|
+
"context.breakdown": "\u8F38\u5165\uFF1A{input}\uFF0C\u5FEB\u53D6\uFF1A{cached}",
|
|
140312
|
+
"context.cacheShare": "\u5FEB\u53D6\uFF1A{percent}",
|
|
140313
|
+
"quota.fiveHour": "5\u5C0F\u6642",
|
|
140314
|
+
"quota.sevenDay": "\u672C\u9031",
|
|
140315
|
+
"quota.resetsIn": "\u8DDD\u91CD\u8A2D {time}",
|
|
140316
|
+
"quota.resetsAt": "\u91CD\u8A2D\u65BC {time}",
|
|
140317
|
+
"quota.resetsInAt": "\u8DDD\u91CD\u8A2D {relative}\uFF0C\u65BC {time}",
|
|
140318
|
+
"quota.at": "{time} \u91CD\u8A2D",
|
|
140319
|
+
"quota.relativeAt": "{relative}\uFF0C{time} \u91CD\u8A2D",
|
|
140320
|
+
"quota.compactLabel": "{label}\uFF1A",
|
|
140321
|
+
"quota.available": "\u53EF\u7528",
|
|
140322
|
+
"quota.elapsed": "\u5DF2\u904E {percent}%",
|
|
140323
|
+
"quota.elapsedAt": "{elapsed}\uFF0C{time} \u91CD\u8A2D",
|
|
140324
|
+
"memory.label": "\u8A18\u61B6\u9AD4",
|
|
140325
|
+
"cost.session": "\u8CBB\u7528 {amount}",
|
|
140326
|
+
"cost.estimated": "\u4F30\u7B97 {amount}",
|
|
140327
|
+
"cost.today": "\u4ECA\u65E5 {amount}",
|
|
140328
|
+
"advisor.name": "\u9867\u554F\uFF1A{name}",
|
|
140329
|
+
"outputStyle.name": "\u8F38\u51FA\u98A8\u683C\uFF1A{name}",
|
|
140330
|
+
"route.via": "\u7D93\u7531 {target}",
|
|
140331
|
+
"speed.rate": "\u8F38\u51FA\uFF1A{rate} tok/s",
|
|
140332
|
+
"headroom.label": "headroom {parts}",
|
|
140333
|
+
"headroom.saved": "\u5DF2\u7BC0\u7701 {tokens}",
|
|
140334
|
+
"headroom.overall": "\u7E3D\u8A08 {percent}%",
|
|
140335
|
+
"version.label": "CC v{version}",
|
|
140336
|
+
"vcs.conflict": "!\u885D\u7A81",
|
|
140337
|
+
"vcs.detached": "\u5206\u96E2\u65BC {commit}",
|
|
140338
|
+
"effort.low": "\u4F4E",
|
|
140339
|
+
"effort.medium": "\u4E2D",
|
|
140340
|
+
"effort.high": "\u9AD8",
|
|
140341
|
+
"effort.xhigh": "\u8D85\u9AD8",
|
|
140342
|
+
"effort.max": "\u6700\u9AD8",
|
|
140343
|
+
"more": "\u53E6\u6709 {count} \u500B",
|
|
140344
|
+
"addedDirs.label": "\u9644\u52A0\u76EE\u9304\uFF1A{dirs}",
|
|
140345
|
+
"sessionTime.started": "\u958B\u59CB\uFF1A{time}",
|
|
140346
|
+
"sessionTime.lastReply": "\u4E0A\u6B21\u56DE\u8986\uFF1A{ago}",
|
|
140347
|
+
"time.justNow": "\u525B\u525B",
|
|
140348
|
+
"time.ago": "{value}\u524D",
|
|
140349
|
+
"promptCache.label": "\u5FEB\u53D6",
|
|
140350
|
+
"promptCache.expired": "\u5DF2\u904E\u671F",
|
|
140351
|
+
"promptCache.until": "\u81F3 {time}",
|
|
140352
|
+
"tokens.summary": "\u8A5E\u5143 {total}\uFF08{parts}\uFF09",
|
|
140353
|
+
"tokens.input": "\u8F38\u5165 {count}",
|
|
140354
|
+
"tokens.output": "\u8F38\u51FA {count}",
|
|
140355
|
+
"tokens.cache": "\u5FEB\u53D6 {count}",
|
|
140356
|
+
"list.separator": "\uFF0C",
|
|
140357
|
+
"compactions.label": "\u58D3\u7E2E\u6B21\u6578\uFF1A{count}",
|
|
140358
|
+
"environment.claudeMd.one": "{count} \u500B CLAUDE.md",
|
|
140359
|
+
"environment.claudeMd.other": "{count} \u500B CLAUDE.md",
|
|
140360
|
+
"environment.rules.one": "{count} \u689D\u898F\u5247",
|
|
140361
|
+
"environment.rules.other": "{count} \u689D\u898F\u5247",
|
|
140362
|
+
"environment.mcp.one": "{count} \u500B MCP",
|
|
140363
|
+
"environment.mcp.other": "{count} \u500B MCP",
|
|
140364
|
+
"environment.hooks.one": "{count} \u500B\u9264\u5B50",
|
|
140365
|
+
"environment.hooks.other": "{count} \u500B\u9264\u5B50"
|
|
140366
|
+
};
|
|
140367
|
+
|
|
140368
|
+
// src/statusline/messages/catalogues.ts
|
|
140369
|
+
var CATALOGUES = { en: EN2, "zh-Hans": ZH_HANS, "zh-Hant": ZH_HANT };
|
|
140370
|
+
var PLACEHOLDER = /\{(\w+)\}/g;
|
|
140371
|
+
function fillPlaceholders(pattern, values) {
|
|
140372
|
+
return pattern.replace(PLACEHOLDER, (_placeholder, name) => {
|
|
140373
|
+
const value2 = values[name];
|
|
140374
|
+
if (value2 === void 0) {
|
|
140375
|
+
throw new TypeError(`message "${pattern}" needs a value for {${name}}`);
|
|
140376
|
+
}
|
|
140377
|
+
return String(value2);
|
|
140378
|
+
});
|
|
140379
|
+
}
|
|
140380
|
+
function translatorFor(language) {
|
|
140381
|
+
const messages = CATALOGUES[language];
|
|
140382
|
+
return (id2, ...values) => fillPlaceholders(messages[id2], values[0] ?? {});
|
|
140383
|
+
}
|
|
140384
|
+
|
|
140056
140385
|
// src/statusline/barGrid.ts
|
|
140057
140386
|
var BRACKET_COLUMNS = 2;
|
|
140058
140387
|
function chunk(items, size) {
|
|
@@ -140528,6 +140857,7 @@ function renderStatuslineBlock(input2) {
|
|
|
140528
140857
|
terminalWidth,
|
|
140529
140858
|
width,
|
|
140530
140859
|
settings: settings2,
|
|
140860
|
+
t: translatorFor(settings2.language),
|
|
140531
140861
|
palette: createPalette(settings2.colours, colourEnabled(input2.ports.env)),
|
|
140532
140862
|
ports: input2.ports,
|
|
140533
140863
|
transcriptIdentity: once2(() => input2.payload.transcript_path === void 0 ? { model: void 0, advisor: void 0 } : readTranscriptIdentity(input2.ports, input2.payload.transcript_path)),
|