claude-use 11.66.2 → 11.67.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/dist/cli.cjs +790 -514
- package/dist/index.cjs +51 -36
- package/dist/index.mjs +51 -36
- package/dist/types/index.d.ts +72 -28
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -25495,6 +25495,9 @@ function isSingleVisibleGrapheme(text5) {
|
|
|
25495
25495
|
function unsettable(setting) {
|
|
25496
25496
|
return setting.unwrap().nullable().optional().describe(`${setting.description ?? ""} ${UNSET_NOTE}`);
|
|
25497
25497
|
}
|
|
25498
|
+
function resettable(setting) {
|
|
25499
|
+
return setting.nullable().optional().describe(`${setting.description ?? ""} ${RESET_NOTE}`);
|
|
25500
|
+
}
|
|
25498
25501
|
function canonicalLanguage(tag) {
|
|
25499
25502
|
return tag === "zh" || tag === "zh-TW" ? LANGUAGE_ALIASES[tag] : tag;
|
|
25500
25503
|
}
|
|
@@ -25515,8 +25518,8 @@ function mergeKeys(base, over) {
|
|
|
25515
25518
|
}
|
|
25516
25519
|
return merged;
|
|
25517
25520
|
}
|
|
25518
|
-
function
|
|
25519
|
-
return
|
|
25521
|
+
function contextBreakdownAt({ context }) {
|
|
25522
|
+
return context.breakdownAt ?? context.criticalAt;
|
|
25520
25523
|
}
|
|
25521
25524
|
function isPresetName(value2) {
|
|
25522
25525
|
return STATUSLINE_PRESETS.some((name) => name === value2);
|
|
@@ -25526,13 +25529,12 @@ function mergeStatuslineSettings(base, over) {
|
|
|
25526
25529
|
return mergeKeys(isPresetName(preset) ? mergeKeys(base, PRESET_BUNDLES[preset]) : base, over);
|
|
25527
25530
|
}
|
|
25528
25531
|
function resolveStatusline(settings2) {
|
|
25529
|
-
const resolved = ResolvedStatuslineSchema.parse(mergeStatuslineSettings(STATUSLINE_DEFAULTS, settings2));
|
|
25532
|
+
const resolved = ResolvedStatuslineSchema.parse(mergeStatuslineSettings(STATUSLINE_DEFAULTS, mergeKeys(void 0, settings2)));
|
|
25530
25533
|
if (resolved.bands.warnAt >= resolved.bands.criticalAt) {
|
|
25531
25534
|
throw new RangeError(`statusline bands.warnAt (${String(resolved.bands.warnAt)}) must be below bands.criticalAt (${String(resolved.bands.criticalAt)})`);
|
|
25532
25535
|
}
|
|
25533
|
-
|
|
25534
|
-
|
|
25535
|
-
throw new RangeError(`statusline context.warnAt (${String(forContext.warnAt)}) must be below context.criticalAt (${String(forContext.criticalAt)}), each following bands while it is unset`);
|
|
25536
|
+
if (resolved.context.warnAt >= resolved.context.criticalAt) {
|
|
25537
|
+
throw new RangeError(`statusline context.warnAt (${String(resolved.context.warnAt)}) must be below context.criticalAt (${String(resolved.context.criticalAt)}); set both when moving one`);
|
|
25536
25538
|
}
|
|
25537
25539
|
const merged = new Set(resolved.layout.merge.flat());
|
|
25538
25540
|
const unmerged = resolved.layout.rightAlign.filter((row) => !merged.has(row));
|
|
@@ -25544,7 +25546,7 @@ function resolveStatusline(settings2) {
|
|
|
25544
25546
|
}
|
|
25545
25547
|
return resolved;
|
|
25546
25548
|
}
|
|
25547
|
-
var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_SESSION_TIME_PARTS, PROMPT_CACHE_TTL_SECONDS, ORANGE_PALETTE_INDEX, 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_BAR_GRADIENTS, 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, MAX_EXTRA_COMMAND_ARGUMENTS, MAX_EXTRA_COMMAND_ARGUMENT_CHARS, STATUSLINE_EXTRA_GROUP, commandArgument, 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;
|
|
25549
|
+
var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_SESSION_TIME_PARTS, PROMPT_CACHE_TTL_SECONDS, ORANGE_PALETTE_INDEX, STATUSLINE_COLOUR_NAMES, DEFAULT_HEADER_SEGMENTS, DEFAULT_ROWS, CLAUDE_HUD_DEFAULTS, STATUSLINE_PRESETS, GIT_WITH_DIRTY_MARKER, JJ_OFF, PRESET_BUNDLES, STATUSLINE_PATH_LEVELS, STATUSLINE_USAGE_VALUES, STATUSLINE_BAR_GRADIENTS, 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, MAX_EXTRA_COMMAND_ARGUMENTS, MAX_EXTRA_COMMAND_ARGUMENT_CHARS, STATUSLINE_EXTRA_GROUP, commandArgument, 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, RESET_NOTE, LANGUAGE_DESCRIPTION, LANGUAGE_TAGS, LANGUAGE_ALIASES, TOP_LEVEL, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
|
|
25548
25550
|
var init_statusline = __esm({
|
|
25549
25551
|
"src/config/statusline.ts"() {
|
|
25550
25552
|
"use strict";
|
|
@@ -25578,13 +25580,18 @@ var init_statusline = __esm({
|
|
|
25578
25580
|
"brightCyan",
|
|
25579
25581
|
"brightWhite"
|
|
25580
25582
|
];
|
|
25581
|
-
DEFAULT_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom"];
|
|
25582
|
-
DEFAULT_ROWS = ["context", "quota"];
|
|
25583
|
+
DEFAULT_HEADER_SEGMENTS = ["model", "project", "vcs", "provider", "route", "account", "identity", "headroom", "extra"];
|
|
25584
|
+
DEFAULT_ROWS = ["context", "quota", "addedDirs"];
|
|
25585
|
+
CLAUDE_HUD_DEFAULTS = {
|
|
25586
|
+
model: { platform: true },
|
|
25587
|
+
usage: { resetLabel: true, modelScoped: true, sevenDayThreshold: 80 },
|
|
25588
|
+
context: { estimate: "buffered", breakdown: "critical", warnAt: 70, criticalAt: 85 }
|
|
25589
|
+
};
|
|
25583
25590
|
STATUSLINE_PRESETS = ["standard", "full", "essential", "minimal"];
|
|
25584
25591
|
GIT_WITH_DIRTY_MARKER = { enabled: true, showDirty: true, showAheadBehind: false, showLineDiff: false };
|
|
25585
25592
|
JJ_OFF = { enabled: false, showDirty: true, showConflicts: true };
|
|
25586
25593
|
PRESET_BUNDLES = {
|
|
25587
|
-
standard: { layout: { header: DEFAULT_HEADER_SEGMENTS, rows: DEFAULT_ROWS }, git: GIT_WITH_DIRTY_MARKER, jj: JJ_OFF, usage: { resetLabel:
|
|
25594
|
+
standard: { layout: { header: DEFAULT_HEADER_SEGMENTS, rows: DEFAULT_ROWS }, git: GIT_WITH_DIRTY_MARKER, jj: JJ_OFF, usage: { resetLabel: CLAUDE_HUD_DEFAULTS.usage.resetLabel }, context: { breakdown: CLAUDE_HUD_DEFAULTS.context.breakdown } },
|
|
25588
25595
|
full: {
|
|
25589
25596
|
layout: { header: ["model", "project", "vcs", "effort", "advisor", "version", "extra", "outputStyle", "cost", "sessionName", "duration"], rows: ["context", "quota", "addedDirs", "memory", "environment", "tools", "skills", "mcp", "agents", "todos", "promptCache", "compactions", "tokens"] },
|
|
25590
25597
|
git: GIT_WITH_DIRTY_MARKER,
|
|
@@ -25641,7 +25648,7 @@ var init_statusline = __esm({
|
|
|
25641
25648
|
rows: distinctList(external_exports.enum(STATUSLINE_ROWS)).describe("The rows to draw below the header, in drawing order; a row left out is hidden, and an empty list hides every row."),
|
|
25642
25649
|
mode: external_exports.enum(["expanded", "compact"]).describe("How the statusline is laid out: expanded draws the header and then the rows, each on lines of its own as layout.merge allows, and compact draws the header segments and every row's content on one line, starting a new line only where the line would be wider than the width. layout.mergeBars, layout.merge, layout.rightAlign and layout.rule have no effect in compact."),
|
|
25643
25650
|
rule: external_exports.enum(["none", "belowHeader"]).describe(`Whether a rule is drawn across the line between the header and the rows beneath it, as wide as the header's widest line (at least ${String(MIN_STATUSLINE_COLUMNS)} columns, at most the width); it is drawn only when both the header and the rows have something to show, and not in the compact layout.`),
|
|
25644
|
-
mergeBars: external_exports.boolean().describe("Whether bar rows that sit next to each other in layout.rows share a line, and one grid, when they fit (the context and quota bars do by default); when false each bar row is on a line of its own, its bars
|
|
25651
|
+
mergeBars: external_exports.boolean().describe("Whether bar rows that sit next to each other in layout.rows share a line, and one grid, when they fit (the context and quota bars do by default); when false each bar row is on a line of its own, its bars aligned to its neighbours' while the line is wide enough for that. A row of text is never joined by this setting, whichever form the quota row takes: layout.merge does that."),
|
|
25645
25652
|
merge: mergeGroups.describe("Groups of rows that share a line when they sit next to each other in layout.rows and fit on one line together, and are drawn on lines of their own when they do not; each group names at least two rows, and no row belongs to two groups. A group may mix bar rows and rows of text, which are joined with the separator when every member is a single line. Bar rows outside a group follow layout.mergeBars. A group in which no row has anything to show draws nothing: one with a row of text in it still ends a run of bars sharing a line, as an empty row of text does, and one of bar rows alone is left out, so the bars either side of it share as if it were not there."),
|
|
25646
25653
|
rightAlign: distinctList(external_exports.enum(STATUSLINE_ROWS)).describe("Rows that start the right-aligned part of a merged line: the first of them to appear on a line, and the rows after it, are pushed to the right edge, with the gap padded by spaces. A row named here must belong to a group in layout.merge, and it has no effect when it is the first row of its line."),
|
|
25647
25654
|
maxWidth: external_exports.number().int().min(0).max(MAX_STATUSLINE_COLUMNS).refine((columns) => columns === 0 || columns >= MIN_STATUSLINE_COLUMNS, `must be 0, or at least ${String(MIN_STATUSLINE_COLUMNS)} columns`).describe(`The exact width in columns lines are drawn to when the client reports none and the COLUMNS environment variable names none, in place of the default width it would assume for the terminal; unlike a terminal's width, it is not reduced by the columns Claude Code keeps back for itself. It is 0, to leave it unset, or from ${String(MIN_STATUSLINE_COLUMNS)} to ${String(MAX_STATUSLINE_COLUMNS)}; a value outside that is refused, not clamped.`),
|
|
@@ -25650,7 +25657,8 @@ var init_statusline = __esm({
|
|
|
25650
25657
|
model: {
|
|
25651
25658
|
format: external_exports.enum(["full", "compact", "short"]).describe("How the model's name is written: full is the name as the client gives it, compact drops a context-window suffix such as (1M context), and short also drops a leading Claude."),
|
|
25652
25659
|
override: overrideText.describe("A name to show in place of the client's own model name, whatever model is running; empty shows the model's own name. A dynamic mode's served model still follows it."),
|
|
25653
|
-
source: external_exports.enum(["client", "transcript", "auto"]).describe("Where the model's name comes from: client is the name the client reports, transcript is the model the session's last reply came from (what a proxy actually served), and auto uses the transcript's model only when it is not a Claude model, which is what a proxy redirect looks like.")
|
|
25660
|
+
source: external_exports.enum(["client", "transcript", "auto"]).describe("Where the model's name comes from: client is the name the client reports (its display name, else its model id, each trimmed and read as absent when blank), transcript is the model the session's last reply came from (what a proxy actually served), and auto uses the transcript's model only when it is not a Claude model, which is what a proxy redirect looks like."),
|
|
25661
|
+
platform: external_exports.boolean().describe("Whether the model segment ends with the label claude-hud draws beside the model name, chosen from the client's environment and model id as claude-hud chooses it, the first that holds: Bedrock when CLAUDE_CODE_USE_BEDROCK is 1, Vertex when CLAUDE_CODE_USE_VERTEX is 1, MiniMax when ANTHROPIC_BASE_URL (else ANTHROPIC_API_BASE_URL), trimmed, is https://api.minimax.io/anthropic or https://api.minimaxi.com/anthropic compared by origin and path with any trailing slash, query or default port ignored, and Enterprise when the model id is opusplan, sonnetplan or haikuplan in any case. Nothing is drawn when none holds, and the label stands alone when no name is known: the client's display name and model id are both absent or blank, no override is set, and model.source supplies no transcript name (under transcript it supplies one when the transcript has an assistant record with a model, and under auto only for such a model that is not a Claude one), or model.format leaves nothing of the name. The switches and the model ids are Claude Code's, so an Antigravity client never draws the label. It is not the provider segment, which names the agent-shim provider the launch selected and the door routes to.")
|
|
25654
25662
|
},
|
|
25655
25663
|
provider: {
|
|
25656
25664
|
name: overrideText.describe("A label to show in place of the launch's provider name, or on its own when the launch has no provider; empty shows the provider's own name.")
|
|
@@ -25668,11 +25676,16 @@ var init_statusline = __esm({
|
|
|
25668
25676
|
context: {
|
|
25669
25677
|
bar: external_exports.enum(["shown", "hidden"]).describe("Whether the context row draws its bar, or only its figures on one line of text."),
|
|
25670
25678
|
value: external_exports.enum(STATUSLINE_CONTEXT_VALUES).describe("The context figure: both (the tokens held against the window, then the percentage), percent, tokens, or remaining (the percentage of the window left)."),
|
|
25671
|
-
warnAt: wholePercent.
|
|
25672
|
-
criticalAt: wholePercent.
|
|
25679
|
+
warnAt: wholePercent.describe("The whole percentage of the context window at which the context bar turns yellow when bar.gradient is off (a bar.gradient of use holds the warning colour exactly where the bar turns yellow, half a point below this percentage for the rounding, and width colours a bar by its cells, not its use, once a cell of its used part is drawn; both fall back to the band colours when a stop's colour is default or dim, and width also when no cell of its used part is drawn); it must be below context.criticalAt. The percentage is rounded to a whole number before it is compared with this, as claude-hud rounds it, so a reading within half a point below counts as at it. It is the context bar's own threshold, apart from bands.warnAt, which colours the other bars and the context row's cache hit share, and its default is claude-hud's contextWarningThreshold."),
|
|
25680
|
+
criticalAt: wholePercent.describe("The whole percentage of the context window at which the context bar turns red when bar.gradient is off (a bar.gradient of use holds the critical colour from where the bar turns red, half a point below this percentage for the rounding, and width colours a bar by its cells, not its use, once a cell of its used part is drawn; both fall back to the band colours when a stop's colour is default or dim, and width also when no cell of its used part is drawn), and from which the token breakdown appears while context.breakdownAt is unset. The percentage is rounded to a whole number before it is compared with this, as claude-hud rounds it, so a reading within half a point below counts as at it. It is the context bar's own threshold, apart from bands.criticalAt, which colours the other bars and the context row's cache hit share, and its default is claude-hud's contextCriticalThreshold, which also starts claude-hud's breakdown."),
|
|
25681
|
+
breakdownAt: wholePercent.optional().describe(
|
|
25682
|
+
"The whole percentage of the context window from which the token breakdown appears, with context.breakdown set to critical; while it is unset the breakdown appears from context.criticalAt. The percentage is rounded to a whole number before it is compared with this, as claude-hud rounds it, so a reading within half a point below counts as at it. It need not relate to context.warnAt or context.criticalAt, since it decides when a piece of information is shown and not a colour, so it may sit below, at or above either."
|
|
25683
|
+
),
|
|
25673
25684
|
autoCompactWindow: external_exports.number().int().positive().optional().describe("A window in tokens to measure the context against instead of the model's, matching the figure /context gives once Claude Code compacts before the window is full. While it is set, the row draws nothing until the client reports the tokens held, since without them there is nothing to measure against it; while it is unset the model's own window is used."),
|
|
25674
|
-
estimate: external_exports.enum(STATUSLINE_CONTEXT_ESTIMATES).describe(`What to draw when the client reports no percentage of the window in use, or reports 0 while tokens are already held (which is how a client says it has not worked it out yet): never (nothing is estimated: a percentage reported
|
|
25675
|
-
breakdown: external_exports.enum(["never", "critical"]).describe(
|
|
25685
|
+
estimate: external_exports.enum(STATUSLINE_CONTEXT_ESTIMATES).describe(`What to draw when the client reports no percentage of the window in use (a negative one counts as none), or reports 0 while tokens are already held (which is how a client says it has not worked it out yet): never (nothing is estimated: a percentage reported from 0 to 100 is drawn as it is, one above 100 as 100, and a negative or missing one draws nothing), raw (the tokens held over the window), or buffered (that, plus the ${String(AUTOCOMPACT_RESERVE_FRACTION * MAX_PERCENT)}% of the window Claude Code reserves for compaction, rising from nothing at ${String(AUTOCOMPACT_RESERVE_RAMP_START * MAX_PERCENT)}% of the window held to the whole reserve at ${String(AUTOCOMPACT_RESERVE_RAMP_END * MAX_PERCENT)}%).`),
|
|
25686
|
+
breakdown: external_exports.enum(["never", "critical"]).describe(
|
|
25687
|
+
"Whether to add the input and cache tokens of the last request to the context row: critical adds them once the percentage the row draws (the one the client reports, or the estimate context.estimate makes, or, with context.autoCompactWindow set, the tokens held over that window), rounded to a whole number, reaches the breakdown threshold, which is context.breakdownAt, or context.criticalAt while that is unset, and never leaves them off. With no percentage to draw the row draws nothing, and when the client does not report the last request's tokens there is no breakdown to add."
|
|
25688
|
+
)
|
|
25676
25689
|
},
|
|
25677
25690
|
customLine: {
|
|
25678
25691
|
text: overrideText.describe(`A line of your own text to draw, in colours.custom; empty draws nothing. It is refused when longer than ${String(MAX_DISPLAY_TEXT_CHARS)} characters or when it holds control, format or separator characters, and words are separated by single spaces. A character that passes but draws nothing, such as a braille blank, is removed, and the line is cut to the usable width.`),
|
|
@@ -25684,17 +25697,17 @@ var init_statusline = __esm({
|
|
|
25684
25697
|
)
|
|
25685
25698
|
},
|
|
25686
25699
|
bands: {
|
|
25687
|
-
warnAt: wholePercent.describe("The whole percentage of use at which a bar turns yellow when bar.gradient is off; it must be below criticalAt. A bar.gradient of use holds the warning colour exactly there, and width colours a bar by its cells, not its use, once a cell of its used part is drawn; both fall back to the band colours when a stop's colour is default or dim, and width also when no cell of its used part is drawn."),
|
|
25688
|
-
criticalAt: wholePercent.describe("The whole percentage of use at which a bar turns red when bar.gradient is off. A bar.gradient of use holds the critical colour from there, and width colours a bar by its cells, not its use, once a cell of its used part is drawn; both fall back to the band colours when a stop's colour is default or dim, and width also when no cell of its used part is drawn.")
|
|
25700
|
+
warnAt: wholePercent.describe("The whole percentage of use at which a bar other than the context bar turns yellow when bar.gradient is off (the context bar has context.warnAt); it must be below criticalAt. A bar.gradient of use holds the warning colour exactly there, and width colours a bar by its cells, not its use, once a cell of its used part is drawn; both fall back to the band colours when a stop's colour is default or dim, and width also when no cell of its used part is drawn. The context row's cache hit share is coloured by these bands too."),
|
|
25701
|
+
criticalAt: wholePercent.describe("The whole percentage of use at which a bar other than the context bar turns red when bar.gradient is off (the context bar has context.criticalAt). A bar.gradient of use holds the critical colour from there, and width colours a bar by its cells, not its use, once a cell of its used part is drawn; both fall back to the band colours when a stop's colour is default or dim, and width also when no cell of its used part is drawn. The context row's cache hit share is coloured by these bands too.")
|
|
25689
25702
|
},
|
|
25690
25703
|
labels: {
|
|
25691
|
-
fiveHour: windowLabel.describe("The name of the five-hour
|
|
25692
|
-
sevenDay: windowLabel.describe("The name of the weekly
|
|
25704
|
+
fiveHour: windowLabel.describe("The name of the five-hour window; empty uses the language's own name for it."),
|
|
25705
|
+
sevenDay: windowLabel.describe("The name of the weekly window; empty uses the language's own name for it.")
|
|
25693
25706
|
},
|
|
25694
25707
|
bar: {
|
|
25695
25708
|
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."),
|
|
25696
25709
|
gradient: external_exports.enum(STATUSLINE_BAR_GRADIENTS).describe(
|
|
25697
|
-
"How a bar's used part is coloured: off (the default) draws the band's single colour, the bar's own colour below the warning threshold, the warning colour from there and the critical one from the critical threshold; use blends the bar's colour with its use, from its own colour at none in use to the warning colour at the warning threshold and the critical one at the critical threshold, holding exactly the colour the
|
|
25710
|
+
"How a bar's used part is coloured: off (the default) draws the band's single colour, the bar's own colour below the warning threshold, the warning colour from there and the critical one from the critical threshold; use blends the bar's colour with its use, from its own colour at none in use to the warning colour at the warning threshold and the critical one at the critical threshold, holding exactly the colour the bar draws without a gradient at each threshold (the context bar's sit half a point below its whole percentages) and the critical colour above it; and width colours each cell of the used part across the bar's width, from the bar's own colour at the first cell to the critical one at the last, whatever the use, with a bar one cell wide drawing that cell in its own colour. A bar's thresholds are bands.warnAt and bands.criticalAt, and the context bar's are context.warnAt and context.criticalAt, and the figures beside a bar keep the band's colours in every mode. The unused part keeps colours.empty in every mode, and when that is default or dim, which set no colour of their own, it draws in the colour the used part ends in: under off the band's colour, under use the blend for the bar's use (even where no cell of the used part is drawn), and under width the last drawn cell's colour (the band's colour where no cell is drawn). A gradient blends RGB values, so a colour name, or a palette index below 16, is blended at the default RGB the xterm scheme gives it rather than the shade a themed terminal draws it in, while a stop itself, where a mode holds it exactly, is drawn as the bands draw that role. A bar whose stops include a role set to default or dim, which names no colour of its own, is drawn in the band's single colour: for use those stops are the bar's own, warning and critical roles, and for width its own and critical roles. A width bar with no cell of its used part drawn has no cell to colour, so it takes the band's colours as off does."
|
|
25698
25711
|
),
|
|
25699
25712
|
filled: barCharacter.describe("The character that draws the used part of a bar."),
|
|
25700
25713
|
empty: barCharacter.describe("The character that draws the unused part of a bar.")
|
|
@@ -25704,10 +25717,10 @@ var init_statusline = __esm({
|
|
|
25704
25717
|
bar: external_exports.boolean().describe("Whether each quota window is drawn as a bar, or as text alone."),
|
|
25705
25718
|
compact: external_exports.boolean().describe("Whether the quota windows are drawn as one short line of text (`5h: 25.0% (1h 30m)`) in place of bars; it takes precedence over usage.bar."),
|
|
25706
25719
|
resetLabel: external_exports.boolean().describe("Whether a window's reset time is introduced with `resets in` (`resets` for a wall-clock time), as in `(resets in 1h 30m)`, rather than the bare `(1h 30m)`."),
|
|
25707
|
-
modelScoped: external_exports.boolean().describe("Whether the per-model weekly windows the client reports (rate_limits.model_scoped) are drawn after the
|
|
25720
|
+
modelScoped: external_exports.boolean().describe("Whether the per-model weekly windows the client reports (rate_limits.model_scoped) are drawn after the five-hour and weekly windows (one reported with a null, missing or non-numeric figure is drawn as two hyphens beside its reset); they describe the signed-in account, so a session that selected a provider never shows them, nor does a Bedrock session, whose subscription windows do not apply."),
|
|
25708
25721
|
timeFormat: external_exports.enum(STATUSLINE_TIME_FORMATS).describe("How a window's reset is shown: the time left (`1h 30m`), the wall-clock time (`at 14:30`), both, the share of the window already gone (`53% elapsed`), or that share and the wall-clock time. A window whose length is not known shows no share."),
|
|
25709
|
-
threshold: thresholdPercent.describe("The whole percentage of use that at least one quota window must reach for the quota row to be drawn at all; 0
|
|
25710
|
-
sevenDayThreshold: thresholdPercent.describe("The whole percentage of use at which the weekly window is drawn beside the five-hour one; below it the weekly window is hidden. A weekly window with no five-hour window beside it is
|
|
25722
|
+
threshold: thresholdPercent.describe("The whole percentage of use that at least one quota window must reach for the quota row to be drawn at all, the use compared after rounding to a whole percentage, as claude-hud compares it; 0 never hides it. A Bedrock session that selected no provider draws no five-hour, weekly or per-model window, whatever this is."),
|
|
25723
|
+
sevenDayThreshold: thresholdPercent.describe("The whole percentage of use at which the weekly window is drawn beside the five-hour one, the use compared after rounding to a whole percentage, as claude-hud compares it; below it the weekly window is hidden, and 0 never hides it. A weekly window with no five-hour window beside it is never hidden by this setting. A Bedrock session that selected no provider draws no five-hour, weekly or per-model window, so this setting has nothing to hide there, and usage.threshold can still hide the whole row.")
|
|
25711
25724
|
},
|
|
25712
25725
|
clock: {
|
|
25713
25726
|
hourCycle: external_exports.enum(STATUSLINE_HOUR_CYCLES).describe("The hour cycle of a wall-clock time: `auto` follows the system locale, `h23` and `h24` are 24-hour time (`h24` writes midnight as 24:00), and `h12` and `h11` are 12-hour time with am or pm (`h11` writes the hour after midnight as 0)."),
|
|
@@ -25730,11 +25743,11 @@ var init_statusline = __esm({
|
|
|
25730
25743
|
maxVisible: external_exports.number().int().min(0).describe("The most kinds of finished tool call the tools row names, the most-used first, with the rest counted as +N more. 0 names every kind.")
|
|
25731
25744
|
},
|
|
25732
25745
|
colours: {
|
|
25733
|
-
context: colourValue.describe("The colour of the context bar below the warning threshold while bar.gradient is off, of the figures beside it below that threshold in every mode, and the colour a bar.gradient of use or width blends the context bar from (at none in use for use, at the first cell for width), while a gradient bar with a stop whose colour is default or dim, or a width bar with no cell of its used part drawn, takes the band's colours."),
|
|
25746
|
+
context: colourValue.describe("The colour of the context bar below the warning threshold while bar.gradient is off, of the figures beside it below that threshold in every mode, of a cache hit share above 100 less bands.warnAt percent, and the colour a bar.gradient of use or width blends the context bar from (at none in use for use, at the first cell for width), while a gradient bar with a stop whose colour is default or dim, or a width bar with no cell of its used part drawn, takes the band's colours."),
|
|
25734
25747
|
usage: colourValue.describe("The colour of the quota bars and the memory bar below the warning threshold while bar.gradient is off, of the figures beside them below that threshold in every mode, and the colour a bar.gradient of use or width blends those bars from (at none in use for use, at the first cell for width), while a gradient bar with a stop whose colour is default or dim, or a width bar with no cell of its used part drawn, takes the band's colours."),
|
|
25735
|
-
warning: colourValue.describe("The colour of the context bar from
|
|
25748
|
+
warning: colourValue.describe("The colour of the context bar from context.warnAt up to context.criticalAt when bar.gradient is off (a bar.gradient of use holds it exactly where the bar turns yellow, and a gradient bar with a stop whose colour is default or dim draws the band's colours instead, and so does a width bar with no cell of its used part drawn), of the figures beside the bar from that threshold up to context.criticalAt in every mode, and of a cache hit share above 100 less bands.criticalAt percent and at most 100 less bands.warnAt percent."),
|
|
25736
25749
|
usageWarning: colourValue.describe("The colour of a quota bar or the memory bar from bands.warnAt up to bands.criticalAt when bar.gradient is off (a bar.gradient of use holds it exactly at bands.warnAt, and a gradient bar with a stop whose colour is default or dim draws the band's colours instead, and so does a width bar with no cell of its used part drawn), and of the figures beside the bar from that threshold up to bands.criticalAt in every mode."),
|
|
25737
|
-
critical: colourValue.describe("The colour of a bar at or above its critical threshold (
|
|
25750
|
+
critical: colourValue.describe("The colour of a bar at or above its critical threshold (context.criticalAt for the context bar, bands.criticalAt for any other bar) when bar.gradient is off or use, of the last cell of a full bar more than one cell wide under a bar.gradient of width (a bar one cell wide draws its cell in its own colour, and a width bar whose own colour or this one is default or dim, or that has no cell of its used part drawn, draws the band's colours instead), of the figures beside a bar from its critical threshold in every mode, and of a cache hit share of at most 100 less bands.criticalAt percent."),
|
|
25738
25751
|
model: colourValue.describe("The colour of the model and provider segments."),
|
|
25739
25752
|
label: colourValue.describe("The colour of labels and secondary text: row labels, and the route, account, identity and headroom segments."),
|
|
25740
25753
|
empty: colourValue.describe("The colour of the unused part of a bar."),
|
|
@@ -25765,12 +25778,13 @@ var init_statusline = __esm({
|
|
|
25765
25778
|
}
|
|
25766
25779
|
};
|
|
25767
25780
|
UNSET_NOTE = "A layer may write null to return it to unset when a shallower layer sets it.";
|
|
25781
|
+
RESET_NOTE = "A layer may write null to return it to its default when a shallower layer sets it.";
|
|
25768
25782
|
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.";
|
|
25769
25783
|
LANGUAGE_TAGS = [...STATUSLINE_LANGUAGES, "zh", "zh-TW"];
|
|
25770
25784
|
LANGUAGE_ALIASES = { zh: "zh-Hans", "zh-TW": "zh-Hant" };
|
|
25771
25785
|
TOP_LEVEL = {
|
|
25772
25786
|
language: external_exports.enum(STATUSLINE_LANGUAGES).describe(LANGUAGE_DESCRIPTION),
|
|
25773
|
-
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, the extra segment once extra.command is set, 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, tools, skills, mcp, agents, todos, prompt cache, compactions and session tokens rows, with the token breakdown
|
|
25787
|
+
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 default, everything claude-hud's default configuration draws plus agent-shim's own segments; full, essential and minimal are claude-hud's presets. Each draws the model, project and version control segments, the extra segment once extra.command is set, and the context row; standard adds the provider, route, account, identity and headroom segments and the quota and added directories rows, with the reset label and the token breakdown from its threshold, full adds the effort, advisor, version, output style, cost, session name and duration segments and the quota, added directories, memory, environment, tools, skills, mcp, agents, todos, prompt cache, compactions and session tokens rows, with the token breakdown from its threshold, essential adds the duration, the added directories row and the tools, agents and todos rows, and minimal adds the added directories row alone.")
|
|
25774
25788
|
};
|
|
25775
25789
|
StatuslineSchema = external_exports.strictObject({
|
|
25776
25790
|
language: external_exports.enum(LANGUAGE_TAGS).transform(canonicalLanguage).describe(LANGUAGE_DESCRIPTION).optional(),
|
|
@@ -25781,7 +25795,7 @@ var init_statusline = __esm({
|
|
|
25781
25795
|
account: external_exports.strictObject(SHAPES.account).partial().optional(),
|
|
25782
25796
|
effort: external_exports.strictObject(SHAPES.effort).partial().optional(),
|
|
25783
25797
|
advisor: external_exports.strictObject(SHAPES.advisor).partial().optional(),
|
|
25784
|
-
context: external_exports.strictObject({ ...SHAPES.context, warnAt:
|
|
25798
|
+
context: external_exports.strictObject({ ...SHAPES.context, warnAt: resettable(SHAPES.context.warnAt), criticalAt: resettable(SHAPES.context.criticalAt), breakdownAt: unsettable(SHAPES.context.breakdownAt), autoCompactWindow: unsettable(SHAPES.context.autoCompactWindow) }).partial().optional(),
|
|
25785
25799
|
customLine: external_exports.strictObject(SHAPES.customLine).partial().optional(),
|
|
25786
25800
|
extra: external_exports.strictObject(SHAPES.extra).partial().optional(),
|
|
25787
25801
|
bands: external_exports.strictObject(SHAPES.bands).partial().optional(),
|
|
@@ -25830,18 +25844,18 @@ var init_statusline = __esm({
|
|
|
25830
25844
|
language: "en",
|
|
25831
25845
|
preset: "standard",
|
|
25832
25846
|
layout: { header: [...DEFAULT_HEADER_SEGMENTS], rows: [...DEFAULT_ROWS], mode: "expanded", rule: "none", mergeBars: true, merge: [], rightAlign: [], maxWidth: 0, forceMaxWidth: false },
|
|
25833
|
-
model: { format: "full", override: "", source: "client" },
|
|
25847
|
+
model: { format: "full", override: "", source: "client", platform: CLAUDE_HUD_DEFAULTS.model.platform },
|
|
25834
25848
|
provider: { name: "" },
|
|
25835
25849
|
account: { parts: ["user", "organisation", "plan"], userLength: 0 },
|
|
25836
25850
|
effort: { format: "full" },
|
|
25837
25851
|
advisor: { override: "" },
|
|
25838
|
-
context: { bar: "shown", value: "both", estimate:
|
|
25852
|
+
context: { bar: "shown", value: "both", warnAt: CLAUDE_HUD_DEFAULTS.context.warnAt, criticalAt: CLAUDE_HUD_DEFAULTS.context.criticalAt, estimate: CLAUDE_HUD_DEFAULTS.context.estimate, breakdown: CLAUDE_HUD_DEFAULTS.context.breakdown },
|
|
25839
25853
|
customLine: { text: "", position: "last" },
|
|
25840
25854
|
extra: { command: [] },
|
|
25841
25855
|
bands: { warnAt: 70, criticalAt: 90 },
|
|
25842
25856
|
labels: { fiveHour: "", sevenDay: "" },
|
|
25843
25857
|
bar: { width: 10, gradient: "off", filled: "\u2588", empty: "\u2591" },
|
|
25844
|
-
usage: { value: "used", bar: true, compact: false, resetLabel:
|
|
25858
|
+
usage: { value: "used", bar: true, compact: false, resetLabel: CLAUDE_HUD_DEFAULTS.usage.resetLabel, modelScoped: CLAUDE_HUD_DEFAULTS.usage.modelScoped, timeFormat: "relative", threshold: 0, sevenDayThreshold: CLAUDE_HUD_DEFAULTS.usage.sevenDayThreshold },
|
|
25845
25859
|
clock: { hourCycle: "auto", seconds: false },
|
|
25846
25860
|
cost: { routed: false },
|
|
25847
25861
|
environment: { threshold: 0 },
|
|
@@ -25872,20 +25886,7 @@ var init_statusline = __esm({
|
|
|
25872
25886
|
}
|
|
25873
25887
|
});
|
|
25874
25888
|
|
|
25875
|
-
// node_modules/.pnpm/trilean@1.
|
|
25876
|
-
var complexFromPolar;
|
|
25877
|
-
var init_complex = __esm({
|
|
25878
|
-
"node_modules/.pnpm/trilean@1.7.1/node_modules/trilean/dist/complex.js"() {
|
|
25879
|
-
complexFromPolar = (magnitude, phase, unit) => ({
|
|
25880
|
-
kind: "complex",
|
|
25881
|
-
re: magnitude * Math.cos(phase),
|
|
25882
|
-
im: magnitude * Math.sin(phase),
|
|
25883
|
-
unit
|
|
25884
|
-
});
|
|
25885
|
-
}
|
|
25886
|
-
});
|
|
25887
|
-
|
|
25888
|
-
// node_modules/.pnpm/trilean@1.7.1/node_modules/trilean/dist/computed-value.js
|
|
25889
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/computed-value.js
|
|
25889
25890
|
function normalizeUnit(unit) {
|
|
25890
25891
|
if (unit === void 0) return {};
|
|
25891
25892
|
const normalized = {};
|
|
@@ -25916,7 +25917,7 @@ function combineUnitsForDivide(a10, b) {
|
|
|
25916
25917
|
}
|
|
25917
25918
|
var UnitSchema, DurationUnitSchema, ComputedValueSchema;
|
|
25918
25919
|
var init_computed_value = __esm({
|
|
25919
|
-
"node_modules/.pnpm/trilean@1.
|
|
25920
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/computed-value.js"() {
|
|
25920
25921
|
init_zod();
|
|
25921
25922
|
UnitSchema = external_exports.record(external_exports.string(), external_exports.number());
|
|
25922
25923
|
DurationUnitSchema = external_exports.enum([
|
|
@@ -25959,7 +25960,20 @@ var init_computed_value = __esm({
|
|
|
25959
25960
|
}
|
|
25960
25961
|
});
|
|
25961
25962
|
|
|
25962
|
-
// node_modules/.pnpm/trilean@1.
|
|
25963
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/complex.js
|
|
25964
|
+
var complexFromPolar;
|
|
25965
|
+
var init_complex = __esm({
|
|
25966
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/complex.js"() {
|
|
25967
|
+
complexFromPolar = (magnitude, phase, unit) => ({
|
|
25968
|
+
kind: "complex",
|
|
25969
|
+
re: magnitude * Math.cos(phase),
|
|
25970
|
+
im: magnitude * Math.sin(phase),
|
|
25971
|
+
unit
|
|
25972
|
+
});
|
|
25973
|
+
}
|
|
25974
|
+
});
|
|
25975
|
+
|
|
25976
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluation.js
|
|
25963
25977
|
function definite(value2) {
|
|
25964
25978
|
return {
|
|
25965
25979
|
status: "definite",
|
|
@@ -25980,7 +25994,7 @@ function firstIndeterminate(...results) {
|
|
|
25980
25994
|
}
|
|
25981
25995
|
var IndeterminateReasonSchema;
|
|
25982
25996
|
var init_evaluation = __esm({
|
|
25983
|
-
"node_modules/.pnpm/trilean@1.
|
|
25997
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluation.js"() {
|
|
25984
25998
|
init_zod();
|
|
25985
25999
|
IndeterminateReasonSchema = external_exports.object({
|
|
25986
26000
|
/** Which of the three reason categories applies. */
|
|
@@ -25995,10 +26009,10 @@ var init_evaluation = __esm({
|
|
|
25995
26009
|
}
|
|
25996
26010
|
});
|
|
25997
26011
|
|
|
25998
|
-
// node_modules/.pnpm/trilean@1.
|
|
26012
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/json-value.js
|
|
25999
26013
|
var JsonValueSchema;
|
|
26000
26014
|
var init_json_value = __esm({
|
|
26001
|
-
"node_modules/.pnpm/trilean@1.
|
|
26015
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/json-value.js"() {
|
|
26002
26016
|
init_zod();
|
|
26003
26017
|
JsonValueSchema = external_exports.lazy(() => external_exports.union([
|
|
26004
26018
|
external_exports.string(),
|
|
@@ -26011,10 +26025,10 @@ var init_json_value = __esm({
|
|
|
26011
26025
|
}
|
|
26012
26026
|
});
|
|
26013
26027
|
|
|
26014
|
-
// node_modules/.pnpm/trilean@1.
|
|
26028
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/tree.js
|
|
26015
26029
|
var ComparisonOperatorSchema, TextComparisonOperatorSchema, MembershipOperatorSchema, ArithmeticOperatorSchema, HitPolicySchema, NotNodeSchema, AndNodeSchema, OrNodeSchema, AllOfNodeSchema, AnyOfNodeSchema, CompareNodeSchema, TextCompareNodeSchema, MemberOfNodeSchema, ExistsNodeSchema, SomeNodeSchema, EveryNodeSchema, TreeReferenceNodeSchema, PredicateNodeSchema, NumberLiteralNodeSchema, TextLiteralNodeSchema, BooleanLiteralNodeSchema, InstantLiteralNodeSchema, DurationLiteralNodeSchema, ComplexRectangularLiteralNodeSchema, ComplexPolarLiteralNodeSchema, ComplexLiteralNodeSchema, ReferenceNodeSchema, ArithmeticNodeSchema, NegateNodeSchema, CallNodeSchema, LookupNodeSchema, ConditionalCaseSchema, ConditionalNodeSchema, FoldCombinerSchema, FoldNodeSchema, AccumulatorNodeSchema, DelegateNodeSchema, CoreExpressionNodeSchema, ExpressionNodeSchema;
|
|
26016
26030
|
var init_tree = __esm({
|
|
26017
|
-
"node_modules/.pnpm/trilean@1.
|
|
26031
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/tree.js"() {
|
|
26018
26032
|
init_computed_value();
|
|
26019
26033
|
init_json_value();
|
|
26020
26034
|
init_zod();
|
|
@@ -26302,15 +26316,15 @@ var init_tree = __esm({
|
|
|
26302
26316
|
}
|
|
26303
26317
|
});
|
|
26304
26318
|
|
|
26305
|
-
// node_modules/.pnpm/trilean@1.
|
|
26319
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/functions.js
|
|
26306
26320
|
var emptyFunctionRegistry;
|
|
26307
26321
|
var init_functions = __esm({
|
|
26308
|
-
"node_modules/.pnpm/trilean@1.
|
|
26322
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/functions.js"() {
|
|
26309
26323
|
emptyFunctionRegistry = {};
|
|
26310
26324
|
}
|
|
26311
26325
|
});
|
|
26312
26326
|
|
|
26313
|
-
// node_modules/.pnpm/trilean@1.
|
|
26327
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-budget.js
|
|
26314
26328
|
function createEvaluationBudget(maxNodes, maxNestingDepth) {
|
|
26315
26329
|
let nodesVisited = 0;
|
|
26316
26330
|
return { checkNode(nestingDepth) {
|
|
@@ -26321,13 +26335,13 @@ function createEvaluationBudget(maxNodes, maxNestingDepth) {
|
|
|
26321
26335
|
}
|
|
26322
26336
|
var DEFAULT_MAX_EVALUATION_NODES;
|
|
26323
26337
|
var init_evaluator_budget = __esm({
|
|
26324
|
-
"node_modules/.pnpm/trilean@1.
|
|
26338
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-budget.js"() {
|
|
26325
26339
|
init_evaluation();
|
|
26326
26340
|
DEFAULT_MAX_EVALUATION_NODES = 1e4;
|
|
26327
26341
|
}
|
|
26328
26342
|
});
|
|
26329
26343
|
|
|
26330
|
-
// node_modules/.pnpm/trilean@1.
|
|
26344
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-effect.js
|
|
26331
26345
|
function* wait(value2) {
|
|
26332
26346
|
return yield {
|
|
26333
26347
|
kind: "wait",
|
|
@@ -26366,11 +26380,11 @@ function runSync(task) {
|
|
|
26366
26380
|
return step2.value;
|
|
26367
26381
|
}
|
|
26368
26382
|
var init_evaluator_effect = __esm({
|
|
26369
|
-
"node_modules/.pnpm/trilean@1.
|
|
26383
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-effect.js"() {
|
|
26370
26384
|
}
|
|
26371
26385
|
});
|
|
26372
26386
|
|
|
26373
|
-
// node_modules/.pnpm/trilean@1.
|
|
26387
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-collection.js
|
|
26374
26388
|
function* resolveParticipatingItems(evaluatePredicate2, collection, filter, context, resolvers, functions, visitedTreeKeys, treeReferenceDepth, budget, nestingDepth) {
|
|
26375
26389
|
const candidates = yield* wait(resolvers.resolveCollection(collection, context));
|
|
26376
26390
|
return yield* all(candidates.map(function* (item) {
|
|
@@ -26396,12 +26410,136 @@ function firstFilterIndeterminate(participating) {
|
|
|
26396
26410
|
}
|
|
26397
26411
|
}
|
|
26398
26412
|
var init_evaluator_collection = __esm({
|
|
26399
|
-
"node_modules/.pnpm/trilean@1.
|
|
26413
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-collection.js"() {
|
|
26400
26414
|
init_evaluator_effect();
|
|
26401
26415
|
}
|
|
26402
26416
|
});
|
|
26403
26417
|
|
|
26404
|
-
// node_modules/.pnpm/trilean
|
|
26418
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/complex-division.js
|
|
26419
|
+
function scaleByPowerOfTwo(value2, exponent) {
|
|
26420
|
+
const firstHalf = Math.trunc(exponent / 2);
|
|
26421
|
+
return value2 * 2 ** firstHalf * 2 ** (exponent - firstHalf);
|
|
26422
|
+
}
|
|
26423
|
+
function scaleToAboutAQuarter(larger2) {
|
|
26424
|
+
return -Math.floor(Math.log2(larger2)) - 2;
|
|
26425
|
+
}
|
|
26426
|
+
function divideComplexComponents(dividend, divisor) {
|
|
26427
|
+
const largerDividend = Math.max(Math.abs(dividend.re), Math.abs(dividend.im));
|
|
26428
|
+
if (largerDividend === 0) return {
|
|
26429
|
+
re: 0,
|
|
26430
|
+
im: 0
|
|
26431
|
+
};
|
|
26432
|
+
const largerDivisor = Math.max(Math.abs(divisor.re), Math.abs(divisor.im));
|
|
26433
|
+
const dividendScale = scaleToAboutAQuarter(largerDividend);
|
|
26434
|
+
const divisorScale = scaleToAboutAQuarter(largerDivisor);
|
|
26435
|
+
const a10 = scaleByPowerOfTwo(dividend.re, dividendScale);
|
|
26436
|
+
const b = scaleByPowerOfTwo(dividend.im, dividendScale);
|
|
26437
|
+
const c10 = scaleByPowerOfTwo(divisor.re, divisorScale);
|
|
26438
|
+
const d = scaleByPowerOfTwo(divisor.im, divisorScale);
|
|
26439
|
+
const denominator = c10 * c10 + d * d;
|
|
26440
|
+
const shift = divisorScale - dividendScale;
|
|
26441
|
+
return {
|
|
26442
|
+
re: scaleByPowerOfTwo((a10 * c10 + b * d) / denominator, shift),
|
|
26443
|
+
im: scaleByPowerOfTwo((b * c10 - a10 * d) / denominator, shift)
|
|
26444
|
+
};
|
|
26445
|
+
}
|
|
26446
|
+
var init_complex_division = __esm({
|
|
26447
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/complex-division.js"() {
|
|
26448
|
+
}
|
|
26449
|
+
});
|
|
26450
|
+
|
|
26451
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/duration-order.js
|
|
26452
|
+
function exactParts(magnitude) {
|
|
26453
|
+
scratchValue[0] = magnitude;
|
|
26454
|
+
const bits = scratchBits[0];
|
|
26455
|
+
if (bits === void 0) throw new Error("a one-element array always has an element zero");
|
|
26456
|
+
const exponentField = Number(bits >> FRACTION_BITS & EXPONENT_FIELD_MASK);
|
|
26457
|
+
const fraction = bits & FRACTION_MASK;
|
|
26458
|
+
if (exponentField === 0) return {
|
|
26459
|
+
significand: fraction,
|
|
26460
|
+
exponent: SUBNORMAL_EXPONENT
|
|
26461
|
+
};
|
|
26462
|
+
return {
|
|
26463
|
+
significand: fraction | IMPLICIT_LEADING_BIT,
|
|
26464
|
+
exponent: exponentField - EXPONENT_BIAS_WITH_FRACTION
|
|
26465
|
+
};
|
|
26466
|
+
}
|
|
26467
|
+
function orderOf(left, right) {
|
|
26468
|
+
if (left < right) return -1;
|
|
26469
|
+
return left > right ? 1 : 0;
|
|
26470
|
+
}
|
|
26471
|
+
function exactOrder(left, right) {
|
|
26472
|
+
const leftSign = Math.sign(left.value);
|
|
26473
|
+
const rightSign = Math.sign(right.value);
|
|
26474
|
+
if (leftSign !== rightSign) return leftSign < rightSign ? -1 : 1;
|
|
26475
|
+
if (leftSign === 0) return 0;
|
|
26476
|
+
const leftParts = exactParts(Math.abs(left.value));
|
|
26477
|
+
const rightParts = exactParts(Math.abs(right.value));
|
|
26478
|
+
let leftProduct = leftParts.significand * BigInt(left.size);
|
|
26479
|
+
let rightProduct = rightParts.significand * BigInt(right.size);
|
|
26480
|
+
const shift = leftParts.exponent - rightParts.exponent;
|
|
26481
|
+
if (shift > 0) leftProduct <<= BigInt(shift);
|
|
26482
|
+
else rightProduct <<= BigInt(-shift);
|
|
26483
|
+
return leftSign < 0 ? orderOf(rightProduct, leftProduct) : orderOf(leftProduct, rightProduct);
|
|
26484
|
+
}
|
|
26485
|
+
function compareDurations(left, right) {
|
|
26486
|
+
if (Number.isNaN(left.value) || Number.isNaN(right.value)) return void 0;
|
|
26487
|
+
if (!Number.isFinite(left.value) || !Number.isFinite(right.value)) return orderOf(left.value, right.value);
|
|
26488
|
+
const leftSize = millisecondsPerDurationUnit[left.unit];
|
|
26489
|
+
const rightSize = millisecondsPerDurationUnit[right.unit];
|
|
26490
|
+
const sharedSize = Math.max(leftSize, rightSize);
|
|
26491
|
+
const leftInShared = left.value / (sharedSize / leftSize);
|
|
26492
|
+
const rightInShared = right.value / (sharedSize / rightSize);
|
|
26493
|
+
if (leftInShared < rightInShared) return -1;
|
|
26494
|
+
if (leftInShared > rightInShared) return 1;
|
|
26495
|
+
return exactOrder({
|
|
26496
|
+
value: left.value,
|
|
26497
|
+
size: leftSize
|
|
26498
|
+
}, {
|
|
26499
|
+
value: right.value,
|
|
26500
|
+
size: rightSize
|
|
26501
|
+
});
|
|
26502
|
+
}
|
|
26503
|
+
var millisecondsPerDurationUnit, ONE, FRACTION_BITS, FRACTION_MASK, IMPLICIT_LEADING_BIT, EXPONENT_FIELD_MASK, EXPONENT_BIAS_WITH_FRACTION, SUBNORMAL_EXPONENT, scratchValue, scratchBits;
|
|
26504
|
+
var init_duration_order = __esm({
|
|
26505
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/duration-order.js"() {
|
|
26506
|
+
millisecondsPerDurationUnit = {
|
|
26507
|
+
ms: 1,
|
|
26508
|
+
s: 1e3,
|
|
26509
|
+
min: 6e4,
|
|
26510
|
+
h: 36e5,
|
|
26511
|
+
d: 864e5
|
|
26512
|
+
};
|
|
26513
|
+
ONE = 1n;
|
|
26514
|
+
FRACTION_BITS = 52n;
|
|
26515
|
+
FRACTION_MASK = (ONE << FRACTION_BITS) - ONE;
|
|
26516
|
+
IMPLICIT_LEADING_BIT = ONE << FRACTION_BITS;
|
|
26517
|
+
EXPONENT_FIELD_MASK = 2047n;
|
|
26518
|
+
EXPONENT_BIAS_WITH_FRACTION = 1075;
|
|
26519
|
+
SUBNORMAL_EXPONENT = -1074;
|
|
26520
|
+
scratchValue = /* @__PURE__ */ new Float64Array(1);
|
|
26521
|
+
scratchBits = new BigUint64Array(scratchValue.buffer);
|
|
26522
|
+
}
|
|
26523
|
+
});
|
|
26524
|
+
|
|
26525
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/integer-power.js
|
|
26526
|
+
function powerByRepeatedSquaring({ base, exponent, identity, multiply }) {
|
|
26527
|
+
let result = identity;
|
|
26528
|
+
let factor = base;
|
|
26529
|
+
let remaining = exponent;
|
|
26530
|
+
while (remaining > 0) {
|
|
26531
|
+
if (remaining % 2 === 1) result = multiply(result, factor);
|
|
26532
|
+
remaining = Math.floor(remaining / 2);
|
|
26533
|
+
if (remaining > 0) factor = multiply(factor, factor);
|
|
26534
|
+
}
|
|
26535
|
+
return result;
|
|
26536
|
+
}
|
|
26537
|
+
var init_integer_power = __esm({
|
|
26538
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/integer-power.js"() {
|
|
26539
|
+
}
|
|
26540
|
+
});
|
|
26541
|
+
|
|
26542
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/ast.js
|
|
26405
26543
|
function rangeContains(range2, unit) {
|
|
26406
26544
|
return unit >= range2.from && unit <= range2.to;
|
|
26407
26545
|
}
|
|
@@ -26410,14 +26548,14 @@ function charClassMatches(node2, unit) {
|
|
|
26410
26548
|
return node2.negated ? !inRanges : inRanges;
|
|
26411
26549
|
}
|
|
26412
26550
|
var init_ast = __esm({
|
|
26413
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
26551
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/ast.js"() {
|
|
26414
26552
|
}
|
|
26415
26553
|
});
|
|
26416
26554
|
|
|
26417
|
-
// node_modules/.pnpm/trilean-regex@1.0.
|
|
26555
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/errors.js
|
|
26418
26556
|
var RegexParseError;
|
|
26419
26557
|
var init_errors3 = __esm({
|
|
26420
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
26558
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/errors.js"() {
|
|
26421
26559
|
RegexParseError = class extends Error {
|
|
26422
26560
|
pattern;
|
|
26423
26561
|
index;
|
|
@@ -26433,7 +26571,7 @@ var init_errors3 = __esm({
|
|
|
26433
26571
|
}
|
|
26434
26572
|
});
|
|
26435
26573
|
|
|
26436
|
-
// node_modules/.pnpm/trilean-regex@1.0.
|
|
26574
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/shorthand-classes.js
|
|
26437
26575
|
function codeOf(char) {
|
|
26438
26576
|
return char.charCodeAt(0);
|
|
26439
26577
|
}
|
|
@@ -26494,7 +26632,7 @@ function expandShorthandClass(letter) {
|
|
|
26494
26632
|
}
|
|
26495
26633
|
var DIGIT_RANGES, WORD_RANGES, SPACE_RANGES;
|
|
26496
26634
|
var init_shorthand_classes = __esm({
|
|
26497
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
26635
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/shorthand-classes.js"() {
|
|
26498
26636
|
DIGIT_RANGES = [range("0", "9")];
|
|
26499
26637
|
WORD_RANGES = [
|
|
26500
26638
|
range("A", "Z"),
|
|
@@ -26513,7 +26651,7 @@ var init_shorthand_classes = __esm({
|
|
|
26513
26651
|
}
|
|
26514
26652
|
});
|
|
26515
26653
|
|
|
26516
|
-
// node_modules/.pnpm/trilean-regex@1.0.
|
|
26654
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/parser.js
|
|
26517
26655
|
function parseRegex(pattern) {
|
|
26518
26656
|
const parser = new Parser(pattern);
|
|
26519
26657
|
const node2 = parser.parseAlternation();
|
|
@@ -26522,7 +26660,7 @@ function parseRegex(pattern) {
|
|
|
26522
26660
|
}
|
|
26523
26661
|
var SEQUENCE_TERMINATORS, SIMPLE_ESCAPES, Parser;
|
|
26524
26662
|
var init_parser = __esm({
|
|
26525
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
26663
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/parser.js"() {
|
|
26526
26664
|
init_errors3();
|
|
26527
26665
|
init_shorthand_classes();
|
|
26528
26666
|
SEQUENCE_TERMINATORS = /* @__PURE__ */ new Set(["|", ")"]);
|
|
@@ -26837,13 +26975,13 @@ var init_parser = __esm({
|
|
|
26837
26975
|
}
|
|
26838
26976
|
});
|
|
26839
26977
|
|
|
26840
|
-
// node_modules/.pnpm/trilean-regex@1.0.
|
|
26978
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/nfa.js
|
|
26841
26979
|
function compileToNfa(node2) {
|
|
26842
26980
|
return new NfaBuilder().build(node2);
|
|
26843
26981
|
}
|
|
26844
26982
|
var NfaBuilder;
|
|
26845
26983
|
var init_nfa = __esm({
|
|
26846
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
26984
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/nfa.js"() {
|
|
26847
26985
|
init_ast();
|
|
26848
26986
|
NfaBuilder = class {
|
|
26849
26987
|
states = [];
|
|
@@ -27085,7 +27223,7 @@ var init_nfa = __esm({
|
|
|
27085
27223
|
}
|
|
27086
27224
|
});
|
|
27087
27225
|
|
|
27088
|
-
// node_modules/.pnpm/trilean-regex@1.0.
|
|
27226
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/matcher.js
|
|
27089
27227
|
function closure(nfa, seeds, pos, length) {
|
|
27090
27228
|
const result = /* @__PURE__ */ new Set();
|
|
27091
27229
|
const visited = /* @__PURE__ */ new Set();
|
|
@@ -27141,21 +27279,21 @@ function compilePattern(pattern) {
|
|
|
27141
27279
|
return { test: (input2) => matchesNfa(nfa, input2) };
|
|
27142
27280
|
}
|
|
27143
27281
|
var init_matcher = __esm({
|
|
27144
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
27282
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/matcher.js"() {
|
|
27145
27283
|
init_parser();
|
|
27146
27284
|
init_nfa();
|
|
27147
27285
|
}
|
|
27148
27286
|
});
|
|
27149
27287
|
|
|
27150
|
-
// node_modules/.pnpm/trilean-regex@1.0.
|
|
27288
|
+
// node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/index.js
|
|
27151
27289
|
var init_dist = __esm({
|
|
27152
|
-
"node_modules/.pnpm/trilean-regex@1.0.
|
|
27290
|
+
"node_modules/.pnpm/trilean-regex@1.0.13/node_modules/trilean-regex/dist/index.js"() {
|
|
27153
27291
|
init_errors3();
|
|
27154
27292
|
init_matcher();
|
|
27155
27293
|
}
|
|
27156
27294
|
});
|
|
27157
27295
|
|
|
27158
|
-
// node_modules/.pnpm/trilean@1.
|
|
27296
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-operations.js
|
|
27159
27297
|
function combineAnd(left, right) {
|
|
27160
27298
|
if (left.status === "definite" && !left.value) return definite(false);
|
|
27161
27299
|
if (right.status === "definite" && !right.value) return definite(false);
|
|
@@ -27232,9 +27370,11 @@ function compareValues(op, left, right) {
|
|
|
27232
27370
|
if (rightEpoch === void 0) return unparseableInstant(right.value);
|
|
27233
27371
|
return definite(applyComparisonOperator(op, leftEpoch, rightEpoch));
|
|
27234
27372
|
}
|
|
27235
|
-
case "duration":
|
|
27373
|
+
case "duration": {
|
|
27236
27374
|
if (right.kind !== "duration") return indeterminate("wrong-type", `cannot compare a 'duration' value with a '${right.kind}' value`);
|
|
27237
|
-
|
|
27375
|
+
const order = compareDurations(left, right);
|
|
27376
|
+
return definite(applyComparisonOperator(op, order ?? NaN, 0));
|
|
27377
|
+
}
|
|
27238
27378
|
case "complex":
|
|
27239
27379
|
if (op !== "eq" && op !== "neq") return indeterminate("wrong-type", `ordering operator '${op}' is not defined for complex values; the complex plane has no total order`);
|
|
27240
27380
|
if (right.kind !== "complex") return indeterminate("wrong-type", `cannot compare a 'complex' value with a '${right.kind}' value`);
|
|
@@ -27301,7 +27441,7 @@ function computeMembershipMatch(operand, candidate) {
|
|
|
27301
27441
|
}
|
|
27302
27442
|
case "duration":
|
|
27303
27443
|
if (candidate.kind !== "duration") return indeterminate("wrong-type", `cannot compare a 'duration' value with a '${candidate.kind}' value for membership`);
|
|
27304
|
-
return definite(
|
|
27444
|
+
return definite(compareDurations(operand, candidate) === 0);
|
|
27305
27445
|
case "complex":
|
|
27306
27446
|
if (candidate.kind !== "complex") return indeterminate("wrong-type", `cannot compare a 'complex' value with a '${candidate.kind}' value for membership`);
|
|
27307
27447
|
if (!unitsEqual(operand.unit, candidate.unit)) return indeterminate("wrong-type", "cannot compare complex values with incompatible units for membership");
|
|
@@ -27451,12 +27591,12 @@ function applyArithmeticOnComplex(op, left, right) {
|
|
|
27451
27591
|
case "multiply":
|
|
27452
27592
|
return definite(multiplyComplexValues(left, right));
|
|
27453
27593
|
case "divide": {
|
|
27454
|
-
|
|
27455
|
-
|
|
27594
|
+
if (right.re === 0 && right.im === 0) return indeterminate("domain-error", "division by zero");
|
|
27595
|
+
const quotient = divideComplexComponents(left, right);
|
|
27456
27596
|
return definite({
|
|
27457
27597
|
kind: "complex",
|
|
27458
|
-
re:
|
|
27459
|
-
im:
|
|
27598
|
+
re: quotient.re,
|
|
27599
|
+
im: quotient.im,
|
|
27460
27600
|
unit: combineUnitsForDivide(left.unit, right.unit)
|
|
27461
27601
|
});
|
|
27462
27602
|
}
|
|
@@ -27466,6 +27606,20 @@ function applyArithmeticOnComplex(op, left, right) {
|
|
|
27466
27606
|
throw new Error("unreachable arithmetic operator");
|
|
27467
27607
|
}
|
|
27468
27608
|
}
|
|
27609
|
+
function reciprocalOf(value2) {
|
|
27610
|
+
return {
|
|
27611
|
+
kind: "complex",
|
|
27612
|
+
...divideComplexComponents({
|
|
27613
|
+
re: 1,
|
|
27614
|
+
im: 0
|
|
27615
|
+
}, value2),
|
|
27616
|
+
unit: combineUnitsForDivide({}, value2.unit)
|
|
27617
|
+
};
|
|
27618
|
+
}
|
|
27619
|
+
function isFiniteAndNonZero(value2) {
|
|
27620
|
+
const larger2 = Math.max(Math.abs(value2.re), Math.abs(value2.im));
|
|
27621
|
+
return Number.isFinite(larger2) && larger2 > 0;
|
|
27622
|
+
}
|
|
27469
27623
|
function applyComplexPower(base, exponent) {
|
|
27470
27624
|
if (exponent.kind !== "number" || !Number.isInteger(exponent.value)) return indeterminate("wrong-type", "'power' with a complex operand requires a real integer exponent");
|
|
27471
27625
|
if (!isDimensionless(base.unit) || !isDimensionless(exponent.unit)) return indeterminate("wrong-type", "'power' requires dimensionless operands");
|
|
@@ -27476,12 +27630,28 @@ function applyComplexPower(base, exponent) {
|
|
|
27476
27630
|
unit: {}
|
|
27477
27631
|
};
|
|
27478
27632
|
const complexBase = toComplexValue(base);
|
|
27479
|
-
|
|
27480
|
-
|
|
27481
|
-
|
|
27482
|
-
|
|
27633
|
+
if (exponent.value >= 0) return definite(powerByRepeatedSquaring({
|
|
27634
|
+
base: complexBase,
|
|
27635
|
+
exponent: exponent.value,
|
|
27636
|
+
identity: complexUnit,
|
|
27637
|
+
multiply: multiplyComplexValues
|
|
27638
|
+
}));
|
|
27639
|
+
if (complexBase.re === 0 && complexBase.im === 0) return indeterminate("domain-error", "division by zero");
|
|
27640
|
+
const positivePower = powerByRepeatedSquaring({
|
|
27641
|
+
base: complexBase,
|
|
27642
|
+
exponent: -exponent.value,
|
|
27643
|
+
identity: complexUnit,
|
|
27644
|
+
multiply: multiplyComplexValues
|
|
27645
|
+
});
|
|
27646
|
+
if (isFiniteAndNonZero(positivePower)) return definite(reciprocalOf(positivePower));
|
|
27647
|
+
return definite(powerByRepeatedSquaring({
|
|
27648
|
+
base: reciprocalOf(complexBase),
|
|
27649
|
+
exponent: -exponent.value,
|
|
27650
|
+
identity: complexUnit,
|
|
27651
|
+
multiply: multiplyComplexValues
|
|
27652
|
+
}));
|
|
27483
27653
|
}
|
|
27484
|
-
function
|
|
27654
|
+
function applyArithmeticByKind(op, left, right) {
|
|
27485
27655
|
if (left.kind === "instant" && right.kind === "instant" && op === "subtract") {
|
|
27486
27656
|
const leftEpoch = toEpochMilliseconds(left.value);
|
|
27487
27657
|
if (leftEpoch === void 0) return unparseableInstant(left.value);
|
|
@@ -27514,6 +27684,26 @@ function applyArithmetic(op, left, right) {
|
|
|
27514
27684
|
}
|
|
27515
27685
|
return applyArithmeticOnNumbers(op, left, right);
|
|
27516
27686
|
}
|
|
27687
|
+
function hasFiniteMagnitude(value2) {
|
|
27688
|
+
switch (value2.kind) {
|
|
27689
|
+
case "number":
|
|
27690
|
+
case "duration":
|
|
27691
|
+
return Number.isFinite(value2.value);
|
|
27692
|
+
case "complex":
|
|
27693
|
+
return Number.isFinite(value2.re) && Number.isFinite(value2.im);
|
|
27694
|
+
case "text":
|
|
27695
|
+
case "boolean":
|
|
27696
|
+
case "instant":
|
|
27697
|
+
return true;
|
|
27698
|
+
default:
|
|
27699
|
+
throw new Error("unreachable computed-value kind");
|
|
27700
|
+
}
|
|
27701
|
+
}
|
|
27702
|
+
function applyArithmetic(op, left, right) {
|
|
27703
|
+
const result = applyArithmeticByKind(op, left, right);
|
|
27704
|
+
if (result.status === "definite" && !hasFiniteMagnitude(result.value)) return indeterminate("domain-error", "result is not a finite number");
|
|
27705
|
+
return result;
|
|
27706
|
+
}
|
|
27517
27707
|
function checkReferenceUnit(expectedUnit, resolvedValue) {
|
|
27518
27708
|
if (expectedUnit === void 0) return void 0;
|
|
27519
27709
|
if (resolvedValue.kind !== "number" && resolvedValue.kind !== "complex") return indeterminate("wrong-type", "a unit was expected on a reference that resolved to a non-numeric value");
|
|
@@ -27524,25 +27714,21 @@ function invokeRegisteredFunction(functions, fnName, args) {
|
|
|
27524
27714
|
if (fn2 === void 0) return indeterminate("wrong-type", `no function registered under the name '${fnName}'`);
|
|
27525
27715
|
const outcome = fn2(args);
|
|
27526
27716
|
if ("domainError" in outcome) return indeterminate("domain-error", outcome.domainError);
|
|
27717
|
+
if ("wrongType" in outcome) return indeterminate("wrong-type", outcome.wrongType);
|
|
27527
27718
|
return definite(outcome);
|
|
27528
27719
|
}
|
|
27529
|
-
var millisecondsPerDurationUnit;
|
|
27530
27720
|
var init_evaluator_operations = __esm({
|
|
27531
|
-
"node_modules/.pnpm/trilean@1.
|
|
27721
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-operations.js"() {
|
|
27532
27722
|
init_computed_value();
|
|
27723
|
+
init_complex_division();
|
|
27724
|
+
init_duration_order();
|
|
27533
27725
|
init_evaluation();
|
|
27726
|
+
init_integer_power();
|
|
27534
27727
|
init_dist();
|
|
27535
|
-
millisecondsPerDurationUnit = {
|
|
27536
|
-
ms: 1,
|
|
27537
|
-
s: 1e3,
|
|
27538
|
-
min: 6e4,
|
|
27539
|
-
h: 36e5,
|
|
27540
|
-
d: 864e5
|
|
27541
|
-
};
|
|
27542
27728
|
}
|
|
27543
27729
|
});
|
|
27544
27730
|
|
|
27545
|
-
// node_modules/.pnpm/trilean@1.
|
|
27731
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator.js
|
|
27546
27732
|
function* evaluatePredicateInternal(node2, context, resolvers, accumulator, functions, visitedTreeKeys, treeReferenceDepth, budget, nestingDepth) {
|
|
27547
27733
|
const budgetExceeded = budget.checkNode(nestingDepth);
|
|
27548
27734
|
if (budgetExceeded !== void 0) return budgetExceeded;
|
|
@@ -27788,7 +27974,7 @@ function* evaluateValueInternal(node2, context, resolvers, accumulator, function
|
|
|
27788
27974
|
}
|
|
27789
27975
|
}
|
|
27790
27976
|
var init_evaluator = __esm({
|
|
27791
|
-
"node_modules/.pnpm/trilean@1.
|
|
27977
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator.js"() {
|
|
27792
27978
|
init_complex();
|
|
27793
27979
|
init_evaluation();
|
|
27794
27980
|
init_evaluator_effect();
|
|
@@ -27798,7 +27984,7 @@ var init_evaluator = __esm({
|
|
|
27798
27984
|
}
|
|
27799
27985
|
});
|
|
27800
27986
|
|
|
27801
|
-
// node_modules/.pnpm/trilean@1.
|
|
27987
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-factory.js
|
|
27802
27988
|
function createEvaluator({ functions = emptyFunctionRegistry, maxNodes = DEFAULT_MAX_EVALUATION_NODES, maxNestingDepth = 500 }) {
|
|
27803
27989
|
return {
|
|
27804
27990
|
evaluatePredicate: async (node2, context, resolvers) => runAsync(evaluatePredicateInternal(node2, context, resolvers, void 0, functions, /* @__PURE__ */ new Set(), 0, createEvaluationBudget(maxNodes, maxNestingDepth), 0)),
|
|
@@ -27813,7 +27999,7 @@ function createSyncEvaluator({ functions = emptyFunctionRegistry, maxNodes = DEF
|
|
|
27813
27999
|
}
|
|
27814
28000
|
var evaluatePredicate, evaluateValue;
|
|
27815
28001
|
var init_evaluator_factory = __esm({
|
|
27816
|
-
"node_modules/.pnpm/trilean@1.
|
|
28002
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/evaluator-factory.js"() {
|
|
27817
28003
|
init_evaluator_budget();
|
|
27818
28004
|
init_evaluator_effect();
|
|
27819
28005
|
init_evaluator();
|
|
@@ -27822,9 +28008,9 @@ var init_evaluator_factory = __esm({
|
|
|
27822
28008
|
}
|
|
27823
28009
|
});
|
|
27824
28010
|
|
|
27825
|
-
// node_modules/.pnpm/trilean@1.
|
|
28011
|
+
// node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/index.js
|
|
27826
28012
|
var init_dist2 = __esm({
|
|
27827
|
-
"node_modules/.pnpm/trilean@1.
|
|
28013
|
+
"node_modules/.pnpm/trilean@1.9.0/node_modules/trilean/dist/index.js"() {
|
|
27828
28014
|
init_tree();
|
|
27829
28015
|
init_evaluator_factory();
|
|
27830
28016
|
}
|
|
@@ -32742,10 +32928,14 @@ function valueAt(source, path72) {
|
|
|
32742
32928
|
}
|
|
32743
32929
|
return current;
|
|
32744
32930
|
}
|
|
32931
|
+
function acceptsNull(path72) {
|
|
32932
|
+
const layer = path72.reduceRight((inner, part) => ({ [part]: inner }), null);
|
|
32933
|
+
return StatuslineSchema.safeParse(layer).success;
|
|
32934
|
+
}
|
|
32745
32935
|
function keyOf(path72, declared) {
|
|
32746
32936
|
const optional2 = declared instanceof external_exports.ZodOptional;
|
|
32747
32937
|
const leaf = optional2 ? declared.unwrap() : declared;
|
|
32748
|
-
const common = { path: path72.join("."), description: declared.description ?? "", defaultValue: valueAt(STATUSLINE_DEFAULTS, path72), optional: optional2 };
|
|
32938
|
+
const common = { path: path72.join("."), description: declared.description ?? "", defaultValue: valueAt(STATUSLINE_DEFAULTS, path72), optional: optional2, unsettable: acceptsNull(path72) };
|
|
32749
32939
|
if (leaf instanceof external_exports.ZodNumber) {
|
|
32750
32940
|
return { ...common, kind: "integer", choices: [] };
|
|
32751
32941
|
}
|
|
@@ -32778,10 +32968,17 @@ function walk(shape, prefix) {
|
|
|
32778
32968
|
function statuslineKeys() {
|
|
32779
32969
|
return walk(ResolvedStatuslineSchema.shape, []);
|
|
32780
32970
|
}
|
|
32971
|
+
function defaultText(key) {
|
|
32972
|
+
if (key.optional) {
|
|
32973
|
+
return "no default; none unsets it over shallower layers";
|
|
32974
|
+
}
|
|
32975
|
+
const value2 = `default ${JSON.stringify(key.defaultValue)}`;
|
|
32976
|
+
return key.unsettable ? `${value2}; none returns it to the default over shallower layers` : value2;
|
|
32977
|
+
}
|
|
32781
32978
|
function formatStatuslineKeys(keys) {
|
|
32782
32979
|
return keys.map((key) => {
|
|
32783
32980
|
const takes = key.kind === "choice" || key.kind === "list" || key.kind === "groups" || key.kind === "colour" ? `${key.kind} of ${key.choices.join(", ")}` : key.kind;
|
|
32784
|
-
return `${key.path} (${takes}; ${
|
|
32981
|
+
return `${key.path} (${takes}; ${defaultText(key)})
|
|
32785
32982
|
${key.description}`;
|
|
32786
32983
|
}).join("\n");
|
|
32787
32984
|
}
|
|
@@ -32824,7 +33021,7 @@ function parseStatuslineAssignment(text5) {
|
|
|
32824
33021
|
const path72 = text5.slice(0, split);
|
|
32825
33022
|
const raw = text5.slice(split + 1);
|
|
32826
33023
|
const key = keyNamed(path72);
|
|
32827
|
-
if (key.
|
|
33024
|
+
if (key.unsettable && raw === UNSET_WORD) {
|
|
32828
33025
|
return { path: path72, value: null };
|
|
32829
33026
|
}
|
|
32830
33027
|
switch (key.kind) {
|
|
@@ -37182,7 +37379,7 @@ var init_package = __esm({
|
|
|
37182
37379
|
"package.json"() {
|
|
37183
37380
|
package_default = {
|
|
37184
37381
|
name: "claude-use",
|
|
37185
|
-
version: "11.
|
|
37382
|
+
version: "11.67.0",
|
|
37186
37383
|
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.",
|
|
37187
37384
|
license: "MIT",
|
|
37188
37385
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -37241,7 +37438,7 @@ var init_package = __esm({
|
|
|
37241
37438
|
cosmiconfig: "^10.0.1",
|
|
37242
37439
|
picomatch: "^4.0.7",
|
|
37243
37440
|
"string-width": "8.3.0",
|
|
37244
|
-
trilean: "1.
|
|
37441
|
+
trilean: "1.9.0",
|
|
37245
37442
|
undici: "7.30.1",
|
|
37246
37443
|
zod: "^4.6.7"
|
|
37247
37444
|
},
|
|
@@ -140263,6 +140460,45 @@ init_modelsStore();
|
|
|
140263
140460
|
// src/statusline/doorCost.ts
|
|
140264
140461
|
init_read();
|
|
140265
140462
|
|
|
140463
|
+
// src/statusline/platform.ts
|
|
140464
|
+
var SWITCH_ON = "1";
|
|
140465
|
+
var MINIMAX_ENDPOINTS = /* @__PURE__ */ new Set(["https://api.minimax.io/anthropic", "https://api.minimaxi.com/anthropic"]);
|
|
140466
|
+
var ENTERPRISE_MODEL_IDS = /* @__PURE__ */ new Set(["opusplan", "sonnetplan", "haikuplan"]);
|
|
140467
|
+
function isMiniMaxEndpoint(env) {
|
|
140468
|
+
const base = [env.ANTHROPIC_BASE_URL, env.ANTHROPIC_API_BASE_URL].map((value2) => value2?.trim() ?? "").find((value2) => value2 !== "");
|
|
140469
|
+
if (base === void 0 || !URL.canParse(base)) {
|
|
140470
|
+
return false;
|
|
140471
|
+
}
|
|
140472
|
+
const url2 = new URL(base);
|
|
140473
|
+
return MINIMAX_ENDPOINTS.has(`${url2.origin}${url2.pathname.replace(/\/+$/, "")}`);
|
|
140474
|
+
}
|
|
140475
|
+
function modelPlatformOf(env, modelId) {
|
|
140476
|
+
if (env.CLAUDE_CODE_USE_BEDROCK === SWITCH_ON) {
|
|
140477
|
+
return "Bedrock";
|
|
140478
|
+
}
|
|
140479
|
+
if (env.CLAUDE_CODE_USE_VERTEX === SWITCH_ON) {
|
|
140480
|
+
return "Vertex";
|
|
140481
|
+
}
|
|
140482
|
+
if (isMiniMaxEndpoint(env)) {
|
|
140483
|
+
return "MiniMax";
|
|
140484
|
+
}
|
|
140485
|
+
if (modelId !== void 0 && ENTERPRISE_MODEL_IDS.has(modelId.toLowerCase())) {
|
|
140486
|
+
return "Enterprise";
|
|
140487
|
+
}
|
|
140488
|
+
return void 0;
|
|
140489
|
+
}
|
|
140490
|
+
var BEDROCK_MODEL_ID_MARK = "anthropic.claude-";
|
|
140491
|
+
function isBedrockModelId(modelId) {
|
|
140492
|
+
return modelId?.toLowerCase().includes(BEDROCK_MODEL_ID_MARK) === true;
|
|
140493
|
+
}
|
|
140494
|
+
function hidesSubscriptionWindows(env, modelId) {
|
|
140495
|
+
return modelPlatformOf(env, modelId) === "Bedrock" || isBedrockModelId(modelId);
|
|
140496
|
+
}
|
|
140497
|
+
var NONE2 = { env: {}, modelId: void 0 };
|
|
140498
|
+
function platformInputsOf(payload, env, modelId) {
|
|
140499
|
+
return isAntigravityPayload(payload) ? NONE2 : { env, modelId };
|
|
140500
|
+
}
|
|
140501
|
+
|
|
140266
140502
|
// src/statusline/cost.ts
|
|
140267
140503
|
var TOKENS_PER_MILLION = 1e6;
|
|
140268
140504
|
var CACHE_WRITE_PRICE_RATIO = 1.25;
|
|
@@ -140286,7 +140522,7 @@ function doorCostUsdOf(records, prices) {
|
|
|
140286
140522
|
return costed === 0 ? void 0 : totalUsd;
|
|
140287
140523
|
}
|
|
140288
140524
|
function isCloudModelId(modelId) {
|
|
140289
|
-
return modelId !== void 0 && (modelId
|
|
140525
|
+
return modelId !== void 0 && (isBedrockModelId(modelId) || modelId.includes("@"));
|
|
140290
140526
|
}
|
|
140291
140527
|
function isRoutedSession(summary, payload) {
|
|
140292
140528
|
return summary.provider !== void 0 || isCloudModelId(payload.model?.id);
|
|
@@ -140332,6 +140568,291 @@ function readDoorCostUsd(params) {
|
|
|
140332
140568
|
|
|
140333
140569
|
// src/statusline/payload.ts
|
|
140334
140570
|
init_zod();
|
|
140571
|
+
|
|
140572
|
+
// src/statusline/colour.ts
|
|
140573
|
+
init_statusline();
|
|
140574
|
+
var FULL_CHANNEL = 255;
|
|
140575
|
+
var NORMAL_PRIMARY = 205;
|
|
140576
|
+
var SCHEME_WHITE = 229;
|
|
140577
|
+
var SCHEME_BLUE = 238;
|
|
140578
|
+
var BRIGHT_BLACK_GREY = 127;
|
|
140579
|
+
var BRIGHT_BLUE_TINT = 92;
|
|
140580
|
+
var NAMED_DEFAULT_RGB = {
|
|
140581
|
+
black: [0, 0, 0],
|
|
140582
|
+
red: [NORMAL_PRIMARY, 0, 0],
|
|
140583
|
+
green: [0, NORMAL_PRIMARY, 0],
|
|
140584
|
+
yellow: [NORMAL_PRIMARY, NORMAL_PRIMARY, 0],
|
|
140585
|
+
blue: [0, 0, SCHEME_BLUE],
|
|
140586
|
+
magenta: [NORMAL_PRIMARY, 0, NORMAL_PRIMARY],
|
|
140587
|
+
cyan: [0, NORMAL_PRIMARY, NORMAL_PRIMARY],
|
|
140588
|
+
white: [SCHEME_WHITE, SCHEME_WHITE, SCHEME_WHITE],
|
|
140589
|
+
brightBlack: [BRIGHT_BLACK_GREY, BRIGHT_BLACK_GREY, BRIGHT_BLACK_GREY],
|
|
140590
|
+
brightRed: [FULL_CHANNEL, 0, 0],
|
|
140591
|
+
brightGreen: [0, FULL_CHANNEL, 0],
|
|
140592
|
+
brightYellow: [FULL_CHANNEL, FULL_CHANNEL, 0],
|
|
140593
|
+
brightBlue: [BRIGHT_BLUE_TINT, BRIGHT_BLUE_TINT, FULL_CHANNEL],
|
|
140594
|
+
brightMagenta: [FULL_CHANNEL, 0, FULL_CHANNEL],
|
|
140595
|
+
brightCyan: [0, FULL_CHANNEL, FULL_CHANNEL],
|
|
140596
|
+
brightWhite: [FULL_CHANNEL, FULL_CHANNEL, FULL_CHANNEL]
|
|
140597
|
+
};
|
|
140598
|
+
function isNamedColour(value2) {
|
|
140599
|
+
return value2 !== "default" && value2 !== "dim" && STATUSLINE_COLOUR_NAMES.some((name) => name === value2);
|
|
140600
|
+
}
|
|
140601
|
+
var NAMED_RGB_IN_PALETTE_ORDER = STATUSLINE_COLOUR_NAMES.filter(isNamedColour).map((name) => NAMED_DEFAULT_RGB[name]);
|
|
140602
|
+
var CUBE_SIDE = 6;
|
|
140603
|
+
var CUBE_FIRST_INDEX = 16;
|
|
140604
|
+
var GREYSCALE_FIRST_INDEX = CUBE_FIRST_INDEX + CUBE_SIDE * CUBE_SIDE * CUBE_SIDE;
|
|
140605
|
+
var GREYSCALE_START = 8;
|
|
140606
|
+
var GREYSCALE_STEP = 10;
|
|
140607
|
+
var CUBE_CHANNEL_BASE = 55;
|
|
140608
|
+
var CUBE_CHANNEL_STEP = 40;
|
|
140609
|
+
function cubeChannel(level) {
|
|
140610
|
+
return level === 0 ? 0 : CUBE_CHANNEL_BASE + CUBE_CHANNEL_STEP * level;
|
|
140611
|
+
}
|
|
140612
|
+
function paletteIndexRgb(index) {
|
|
140613
|
+
if (index < CUBE_FIRST_INDEX) {
|
|
140614
|
+
return NAMED_RGB_IN_PALETTE_ORDER[index];
|
|
140615
|
+
}
|
|
140616
|
+
if (index < GREYSCALE_FIRST_INDEX) {
|
|
140617
|
+
const cube = index - CUBE_FIRST_INDEX;
|
|
140618
|
+
return [cubeChannel(Math.floor(cube / CUBE_SIDE ** 2)), cubeChannel(Math.floor(cube / CUBE_SIDE) % CUBE_SIDE), cubeChannel(cube % CUBE_SIDE)];
|
|
140619
|
+
}
|
|
140620
|
+
const grey = GREYSCALE_START + GREYSCALE_STEP * (index - GREYSCALE_FIRST_INDEX);
|
|
140621
|
+
return [grey, grey, grey];
|
|
140622
|
+
}
|
|
140623
|
+
var CHANNEL_DIGITS = 2;
|
|
140624
|
+
var HEX_RADIX2 = 16;
|
|
140625
|
+
var HASH_LENGTH = 1;
|
|
140626
|
+
function rgbOfHex(value2) {
|
|
140627
|
+
const channel = (index) => Number.parseInt(value2.slice(HASH_LENGTH + index * CHANNEL_DIGITS, HASH_LENGTH + (index + 1) * CHANNEL_DIGITS), HEX_RADIX2);
|
|
140628
|
+
return [channel(0), channel(1), channel(2)];
|
|
140629
|
+
}
|
|
140630
|
+
function rgbOfSetting(value2) {
|
|
140631
|
+
if (typeof value2 === "number") {
|
|
140632
|
+
return paletteIndexRgb(value2);
|
|
140633
|
+
}
|
|
140634
|
+
if (value2.startsWith("#")) {
|
|
140635
|
+
return rgbOfHex(value2);
|
|
140636
|
+
}
|
|
140637
|
+
return isNamedColour(value2) ? NAMED_DEFAULT_RGB[value2] : void 0;
|
|
140638
|
+
}
|
|
140639
|
+
function blendRgb(from, to2, at2) {
|
|
140640
|
+
const channel = (start, end) => Math.round(start + (end - start) * at2);
|
|
140641
|
+
return [channel(from[0], to2[0]), channel(from[1], to2[1]), channel(from[2], to2[2])];
|
|
140642
|
+
}
|
|
140643
|
+
|
|
140644
|
+
// src/statusline/ansi.ts
|
|
140645
|
+
init_string_width();
|
|
140646
|
+
init_graphemes();
|
|
140647
|
+
var ESCAPE_CHAR_CODE = 27;
|
|
140648
|
+
var ESCAPE = String.fromCharCode(ESCAPE_CHAR_CODE);
|
|
140649
|
+
var BELL = "\\u0007";
|
|
140650
|
+
var ESCAPE_SEQUENCE_PATTERN = [`${ESCAPE}\\[[0-?]*[ -/]*[@-~]`, `${ESCAPE}\\][^${BELL}${ESCAPE}]*(?:${BELL}|${ESCAPE}\\\\)?`, `${ESCAPE}[@-Z\\\\-_]`].join("|");
|
|
140651
|
+
var SPLIT_ON_ESCAPES = new RegExp(`(${ESCAPE_SEQUENCE_PATTERN})`);
|
|
140652
|
+
function visibleLength(text5) {
|
|
140653
|
+
return stringWidth(text5);
|
|
140654
|
+
}
|
|
140655
|
+
function truncateToColumns(text5, columns) {
|
|
140656
|
+
let used = 0;
|
|
140657
|
+
let kept = "";
|
|
140658
|
+
text5.split(SPLIT_ON_ESCAPES).forEach((part, index) => {
|
|
140659
|
+
if (index % 2 === 1) {
|
|
140660
|
+
kept += part;
|
|
140661
|
+
return;
|
|
140662
|
+
}
|
|
140663
|
+
for (const grapheme of graphemesOf(part)) {
|
|
140664
|
+
used += visibleLength(grapheme);
|
|
140665
|
+
if (used > columns) {
|
|
140666
|
+
return;
|
|
140667
|
+
}
|
|
140668
|
+
kept += grapheme;
|
|
140669
|
+
}
|
|
140670
|
+
});
|
|
140671
|
+
return kept;
|
|
140672
|
+
}
|
|
140673
|
+
function truncateWithEllipsis(text5, columns, ellipsis) {
|
|
140674
|
+
if (visibleLength(text5) <= columns) {
|
|
140675
|
+
return text5;
|
|
140676
|
+
}
|
|
140677
|
+
return `${truncateToColumns(text5, Math.max(0, columns - visibleLength(ellipsis)))}${ellipsis}`;
|
|
140678
|
+
}
|
|
140679
|
+
|
|
140680
|
+
// src/statusline/palette.ts
|
|
140681
|
+
init_statusline();
|
|
140682
|
+
var RESET = `${ESCAPE}[0m`;
|
|
140683
|
+
var SGR_BY_NAME = {
|
|
140684
|
+
default: "",
|
|
140685
|
+
dim: "2",
|
|
140686
|
+
black: "30",
|
|
140687
|
+
red: "31",
|
|
140688
|
+
green: "32",
|
|
140689
|
+
yellow: "33",
|
|
140690
|
+
blue: "34",
|
|
140691
|
+
magenta: "35",
|
|
140692
|
+
cyan: "36",
|
|
140693
|
+
white: "37",
|
|
140694
|
+
brightBlack: "90",
|
|
140695
|
+
brightRed: "91",
|
|
140696
|
+
brightGreen: "92",
|
|
140697
|
+
brightYellow: "93",
|
|
140698
|
+
brightBlue: "94",
|
|
140699
|
+
brightMagenta: "95",
|
|
140700
|
+
brightCyan: "96",
|
|
140701
|
+
brightWhite: "97"
|
|
140702
|
+
};
|
|
140703
|
+
function isColourName(value2) {
|
|
140704
|
+
return STATUSLINE_COLOUR_NAMES.some((name) => name === value2);
|
|
140705
|
+
}
|
|
140706
|
+
function rgbSgr(channels) {
|
|
140707
|
+
return `38;2;${channels.join(";")}`;
|
|
140708
|
+
}
|
|
140709
|
+
function sgrOf(value2) {
|
|
140710
|
+
if (typeof value2 === "number") {
|
|
140711
|
+
return `38;5;${String(value2)}`;
|
|
140712
|
+
}
|
|
140713
|
+
if (value2.startsWith("#")) {
|
|
140714
|
+
return rgbSgr(rgbOfHex(value2));
|
|
140715
|
+
}
|
|
140716
|
+
return isColourName(value2) ? SGR_BY_NAME[value2] : "";
|
|
140717
|
+
}
|
|
140718
|
+
function colourEnabled(env) {
|
|
140719
|
+
return env.NO_COLOR === void 0;
|
|
140720
|
+
}
|
|
140721
|
+
function createPalette(colours, enabled) {
|
|
140722
|
+
const ansi = (role) => {
|
|
140723
|
+
const sgr = enabled ? sgrOf(colours[role]) : "";
|
|
140724
|
+
return sgr === "" ? "" : `${ESCAPE}[${sgr}m`;
|
|
140725
|
+
};
|
|
140726
|
+
return {
|
|
140727
|
+
ansi,
|
|
140728
|
+
paint: (role, text5) => {
|
|
140729
|
+
const start = ansi(role);
|
|
140730
|
+
return start === "" ? text5 : `${start}${text5}${RESET}`;
|
|
140731
|
+
},
|
|
140732
|
+
rgb: (channels) => enabled ? `${ESCAPE}[${rgbSgr(channels)}m` : "",
|
|
140733
|
+
rgbOf: (role) => rgbOfSetting(colours[role])
|
|
140734
|
+
};
|
|
140735
|
+
}
|
|
140736
|
+
|
|
140737
|
+
// src/statusline/style.ts
|
|
140738
|
+
var SECONDS_PER_MINUTE2 = 60;
|
|
140739
|
+
var MINUTES_PER_HOUR4 = 60;
|
|
140740
|
+
var SECONDS_PER_DAY = 86400;
|
|
140741
|
+
var THOUSAND = 1e3;
|
|
140742
|
+
var MILLION = 1e6;
|
|
140743
|
+
var TEN = 10;
|
|
140744
|
+
var FULL_PERCENT3 = 100;
|
|
140745
|
+
var ONE_PERCENT = 1;
|
|
140746
|
+
function withColor(color, text5) {
|
|
140747
|
+
return color === "" ? text5 : `${color}${text5}${RESET}`;
|
|
140748
|
+
}
|
|
140749
|
+
function warningRoleOf(style) {
|
|
140750
|
+
return style.okRole === "usage" ? "usageWarning" : "warning";
|
|
140751
|
+
}
|
|
140752
|
+
function statusColor(fraction, isUsedMetric, style) {
|
|
140753
|
+
const yellowAt = style.bands.warnAt / FULL_PERCENT3;
|
|
140754
|
+
const redAt = style.bands.criticalAt / FULL_PERCENT3;
|
|
140755
|
+
const { ansi } = style.palette;
|
|
140756
|
+
if (isUsedMetric) {
|
|
140757
|
+
if (fraction >= redAt) {
|
|
140758
|
+
return ansi("critical");
|
|
140759
|
+
}
|
|
140760
|
+
return fraction >= yellowAt ? ansi(warningRoleOf(style)) : ansi(style.okRole);
|
|
140761
|
+
}
|
|
140762
|
+
if (fraction <= (FULL_PERCENT3 - style.bands.criticalAt) / FULL_PERCENT3) {
|
|
140763
|
+
return ansi("critical");
|
|
140764
|
+
}
|
|
140765
|
+
return fraction <= (FULL_PERCENT3 - style.bands.warnAt) / FULL_PERCENT3 ? ansi(warningRoleOf(style)) : ansi(style.okRole);
|
|
140766
|
+
}
|
|
140767
|
+
function stopOf(role, style) {
|
|
140768
|
+
const rgb = style.palette.rgbOf(role);
|
|
140769
|
+
return rgb === void 0 ? void 0 : { role, rgb };
|
|
140770
|
+
}
|
|
140771
|
+
function colourBetween(from, to2, at2, style) {
|
|
140772
|
+
if (at2 <= 0) {
|
|
140773
|
+
return style.palette.ansi(from.role);
|
|
140774
|
+
}
|
|
140775
|
+
if (at2 >= 1) {
|
|
140776
|
+
return style.palette.ansi(to2.role);
|
|
140777
|
+
}
|
|
140778
|
+
return style.palette.rgb(blendRgb(from.rgb, to2.rgb, at2));
|
|
140779
|
+
}
|
|
140780
|
+
function gradientColorOf(fraction, style) {
|
|
140781
|
+
const ok2 = stopOf(style.okRole, style);
|
|
140782
|
+
const warning = stopOf(warningRoleOf(style), style);
|
|
140783
|
+
const critical = stopOf("critical", style);
|
|
140784
|
+
if (ok2 === void 0 || warning === void 0 || critical === void 0) {
|
|
140785
|
+
return void 0;
|
|
140786
|
+
}
|
|
140787
|
+
const warnAt = style.bands.warnAt / FULL_PERCENT3;
|
|
140788
|
+
const criticalAt = style.bands.criticalAt / FULL_PERCENT3;
|
|
140789
|
+
return fraction < warnAt ? colourBetween(ok2, warning, fraction / warnAt, style) : colourBetween(warning, critical, (fraction - warnAt) / (criticalAt - warnAt), style);
|
|
140790
|
+
}
|
|
140791
|
+
function widthStopsOf(style) {
|
|
140792
|
+
const ok2 = stopOf(style.okRole, style);
|
|
140793
|
+
const critical = stopOf("critical", style);
|
|
140794
|
+
return ok2 === void 0 || critical === void 0 ? void 0 : { ok: ok2, critical };
|
|
140795
|
+
}
|
|
140796
|
+
function acrossBar(column, cells) {
|
|
140797
|
+
return cells <= 1 ? 0 : column / (cells - 1);
|
|
140798
|
+
}
|
|
140799
|
+
function fillOf(fraction, filled, cells, style) {
|
|
140800
|
+
const stops = style.gradient === "width" ? widthStopsOf(style) : void 0;
|
|
140801
|
+
if (stops !== void 0 && filled > 0) {
|
|
140802
|
+
return Array.from({ length: filled }, (_, column) => `${colourBetween(stops.ok, stops.critical, acrossBar(column, cells), style)}${style.filled}`).join("");
|
|
140803
|
+
}
|
|
140804
|
+
const color = style.gradient === "use" ? gradientColorOf(fraction, style) : void 0;
|
|
140805
|
+
return `${color ?? statusColor(style.bandFraction ?? fraction, true, style)}${style.filled.repeat(filled)}`;
|
|
140806
|
+
}
|
|
140807
|
+
function drawBar(fraction, cells, style) {
|
|
140808
|
+
const clamped = Math.max(0, Math.min(1, fraction));
|
|
140809
|
+
const filled = Math.round(clamped * cells);
|
|
140810
|
+
const emptyColor = style.palette.ansi("empty");
|
|
140811
|
+
const fill = fillOf(clamped, filled, cells, style);
|
|
140812
|
+
const empty = style.empty.repeat(cells - filled);
|
|
140813
|
+
return fill === style.filled.repeat(filled) && emptyColor === "" ? `[${fill}${empty}]` : `[${fill}${emptyColor}${empty}${RESET}]`;
|
|
140814
|
+
}
|
|
140815
|
+
function formatTokens(num) {
|
|
140816
|
+
if (num >= MILLION) {
|
|
140817
|
+
const val = num / MILLION;
|
|
140818
|
+
return val % 1 === 0 ? `${String(Math.round(val))}M` : `${val.toFixed(1)}M`;
|
|
140819
|
+
}
|
|
140820
|
+
if (num >= THOUSAND) {
|
|
140821
|
+
const val = num / THOUSAND;
|
|
140822
|
+
return val >= TEN ? `${String(Math.round(val))}k` : `${val.toFixed(1)}k`;
|
|
140823
|
+
}
|
|
140824
|
+
return String(Math.round(num));
|
|
140825
|
+
}
|
|
140826
|
+
function formatDuration(seconds, t10) {
|
|
140827
|
+
if (seconds === void 0 || seconds <= 0) {
|
|
140828
|
+
return t10("quota.available");
|
|
140829
|
+
}
|
|
140830
|
+
if (seconds < SECONDS_PER_MINUTE2) {
|
|
140831
|
+
return `${String(seconds)}s`;
|
|
140832
|
+
}
|
|
140833
|
+
const days = Math.floor(seconds / SECONDS_PER_DAY);
|
|
140834
|
+
const hours = Math.floor(seconds % SECONDS_PER_DAY / (MINUTES_PER_HOUR4 * SECONDS_PER_MINUTE2));
|
|
140835
|
+
const minutes = Math.floor(seconds % (MINUTES_PER_HOUR4 * SECONDS_PER_MINUTE2) / SECONDS_PER_MINUTE2);
|
|
140836
|
+
if (days > 0) {
|
|
140837
|
+
return `${String(days)}d ${String(hours)}h`;
|
|
140838
|
+
}
|
|
140839
|
+
if (hours > 0) {
|
|
140840
|
+
return `${String(hours)}h ${String(minutes).padStart(2, "0")}m`;
|
|
140841
|
+
}
|
|
140842
|
+
return `${String(minutes)}m`;
|
|
140843
|
+
}
|
|
140844
|
+
function secondsUntil(resetAt, nowMs) {
|
|
140845
|
+
if (resetAt === void 0) {
|
|
140846
|
+
return void 0;
|
|
140847
|
+
}
|
|
140848
|
+
const resetMs = Date.parse(resetAt);
|
|
140849
|
+
return Number.isNaN(resetMs) ? void 0 : Math.max(0, Math.round((resetMs - nowMs) / THOUSAND));
|
|
140850
|
+
}
|
|
140851
|
+
function barCell(prefix, suffix, fraction, style) {
|
|
140852
|
+
return { prefix, suffix, draw: (cells) => drawBar(fraction, cells, style) };
|
|
140853
|
+
}
|
|
140854
|
+
|
|
140855
|
+
// src/statusline/payload.ts
|
|
140335
140856
|
var number4 = external_exports.number().optional().catch(void 0);
|
|
140336
140857
|
var text2 = external_exports.string().optional().catch(void 0);
|
|
140337
140858
|
var ClientPayloadSchema = external_exports.looseObject({
|
|
@@ -140345,7 +140866,7 @@ var ClientPayloadSchema = external_exports.looseObject({
|
|
|
140345
140866
|
workspace: external_exports.looseObject({
|
|
140346
140867
|
current_dir: text2,
|
|
140347
140868
|
project_dir: text2,
|
|
140348
|
-
added_dirs: external_exports.array(external_exports.
|
|
140869
|
+
added_dirs: external_exports.array(external_exports.unknown()).transform((dirs) => dirs.filter((dir) => typeof dir === "string")).optional().catch(void 0),
|
|
140349
140870
|
git_worktree: text2
|
|
140350
140871
|
}).optional().catch(void 0),
|
|
140351
140872
|
model: external_exports.looseObject({ id: text2, display_name: text2 }).optional().catch(void 0),
|
|
@@ -140362,17 +140883,28 @@ var ClientPayloadSchema = external_exports.looseObject({
|
|
|
140362
140883
|
rate_limits: external_exports.looseObject({
|
|
140363
140884
|
five_hour: external_exports.looseObject({ used_percentage: number4, resets_at: number4 }).optional().catch(void 0),
|
|
140364
140885
|
seven_day: external_exports.looseObject({ used_percentage: number4, resets_at: number4 }).optional().catch(void 0),
|
|
140365
|
-
model_scoped: external_exports.array(external_exports.looseObject({ display_name: text2, utilization: number4, resets_at: text2 })).optional().catch(void 0)
|
|
140886
|
+
model_scoped: external_exports.array(external_exports.looseObject({ display_name: text2, utilization: number4, resets_at: text2 }).optional().catch(void 0)).transform((windows) => windows.filter((window) => window !== void 0)).optional().catch(void 0)
|
|
140366
140887
|
}).optional().catch(void 0)
|
|
140367
140888
|
}).catch({});
|
|
140368
140889
|
function parseClientPayload(raw) {
|
|
140369
140890
|
return ClientPayloadSchema.parse(raw);
|
|
140370
140891
|
}
|
|
140892
|
+
function nonNegative(value2) {
|
|
140893
|
+
return value2 !== void 0 && value2 < 0 ? void 0 : value2;
|
|
140894
|
+
}
|
|
140895
|
+
function reportedPercent(value2) {
|
|
140896
|
+
const kept = nonNegative(value2);
|
|
140897
|
+
return kept === void 0 ? void 0 : Math.min(kept, FULL_PERCENT3);
|
|
140898
|
+
}
|
|
140899
|
+
function nonBlank(value2) {
|
|
140900
|
+
const trimmed = value2?.trim();
|
|
140901
|
+
return trimmed === "" ? void 0 : trimmed;
|
|
140902
|
+
}
|
|
140371
140903
|
function viewOf(payload) {
|
|
140372
140904
|
return {
|
|
140373
|
-
|
|
140374
|
-
contextUsedPercentage: payload.context_window?.used_percentage,
|
|
140375
|
-
contextTotalTokens: payload.context_window?.total_input_tokens,
|
|
140905
|
+
clientModelName: nonBlank(payload.model?.display_name) ?? nonBlank(payload.model?.id),
|
|
140906
|
+
contextUsedPercentage: reportedPercent(payload.context_window?.used_percentage),
|
|
140907
|
+
contextTotalTokens: nonNegative(payload.context_window?.total_input_tokens),
|
|
140376
140908
|
contextWindowTokens: payload.context_window?.context_window_size,
|
|
140377
140909
|
cacheHitRatio: payload.prompt_cache?.hit_ratio,
|
|
140378
140910
|
cacheReadTokens: payload.context_window?.current_usage?.cache_read_input_tokens,
|
|
@@ -140674,44 +141206,6 @@ function parseClaudeModelId(id2) {
|
|
|
140674
141206
|
|
|
140675
141207
|
// src/statusline/sanitise.ts
|
|
140676
141208
|
init_statusline();
|
|
140677
|
-
|
|
140678
|
-
// src/statusline/ansi.ts
|
|
140679
|
-
init_string_width();
|
|
140680
|
-
init_graphemes();
|
|
140681
|
-
var ESCAPE_CHAR_CODE = 27;
|
|
140682
|
-
var ESCAPE = String.fromCharCode(ESCAPE_CHAR_CODE);
|
|
140683
|
-
var BELL = "\\u0007";
|
|
140684
|
-
var ESCAPE_SEQUENCE_PATTERN = [`${ESCAPE}\\[[0-?]*[ -/]*[@-~]`, `${ESCAPE}\\][^${BELL}${ESCAPE}]*(?:${BELL}|${ESCAPE}\\\\)?`, `${ESCAPE}[@-Z\\\\-_]`].join("|");
|
|
140685
|
-
var SPLIT_ON_ESCAPES = new RegExp(`(${ESCAPE_SEQUENCE_PATTERN})`);
|
|
140686
|
-
function visibleLength(text5) {
|
|
140687
|
-
return stringWidth(text5);
|
|
140688
|
-
}
|
|
140689
|
-
function truncateToColumns(text5, columns) {
|
|
140690
|
-
let used = 0;
|
|
140691
|
-
let kept = "";
|
|
140692
|
-
text5.split(SPLIT_ON_ESCAPES).forEach((part, index) => {
|
|
140693
|
-
if (index % 2 === 1) {
|
|
140694
|
-
kept += part;
|
|
140695
|
-
return;
|
|
140696
|
-
}
|
|
140697
|
-
for (const grapheme of graphemesOf(part)) {
|
|
140698
|
-
used += visibleLength(grapheme);
|
|
140699
|
-
if (used > columns) {
|
|
140700
|
-
return;
|
|
140701
|
-
}
|
|
140702
|
-
kept += grapheme;
|
|
140703
|
-
}
|
|
140704
|
-
});
|
|
140705
|
-
return kept;
|
|
140706
|
-
}
|
|
140707
|
-
function truncateWithEllipsis(text5, columns, ellipsis) {
|
|
140708
|
-
if (visibleLength(text5) <= columns) {
|
|
140709
|
-
return text5;
|
|
140710
|
-
}
|
|
140711
|
-
return `${truncateToColumns(text5, Math.max(0, columns - visibleLength(ellipsis)))}${ellipsis}`;
|
|
140712
|
-
}
|
|
140713
|
-
|
|
140714
|
-
// src/statusline/sanitise.ts
|
|
140715
141209
|
init_blank();
|
|
140716
141210
|
init_graphemes();
|
|
140717
141211
|
var ESCAPE_SEQUENCES = new RegExp(ESCAPE_SEQUENCE_PATTERN, "g");
|
|
@@ -141014,32 +141508,32 @@ function dailyCostSegment(context) {
|
|
|
141014
141508
|
|
|
141015
141509
|
// src/statusline/elements/sessionFormat.ts
|
|
141016
141510
|
var MS_PER_SECOND18 = 1e3;
|
|
141017
|
-
var
|
|
141018
|
-
var
|
|
141511
|
+
var SECONDS_PER_MINUTE3 = 60;
|
|
141512
|
+
var MINUTES_PER_HOUR5 = 60;
|
|
141019
141513
|
var HOURS_PER_DAY9 = 24;
|
|
141020
141514
|
function formatElapsed(ms2) {
|
|
141021
|
-
const minutes = Math.floor(ms2 / (MS_PER_SECOND18 *
|
|
141515
|
+
const minutes = Math.floor(ms2 / (MS_PER_SECOND18 * SECONDS_PER_MINUTE3));
|
|
141022
141516
|
if (minutes < 1) {
|
|
141023
141517
|
return "<1m";
|
|
141024
141518
|
}
|
|
141025
|
-
if (minutes <
|
|
141519
|
+
if (minutes < MINUTES_PER_HOUR5) {
|
|
141026
141520
|
return `${String(minutes)}m`;
|
|
141027
141521
|
}
|
|
141028
|
-
return `${String(Math.floor(minutes /
|
|
141522
|
+
return `${String(Math.floor(minutes / MINUTES_PER_HOUR5))}h ${String(minutes % MINUTES_PER_HOUR5)}m`;
|
|
141029
141523
|
}
|
|
141030
141524
|
function formatSpan(ms2) {
|
|
141031
141525
|
if (ms2 < MS_PER_SECOND18) {
|
|
141032
141526
|
return "<1s";
|
|
141033
141527
|
}
|
|
141034
141528
|
const seconds = Math.floor(ms2 / MS_PER_SECOND18);
|
|
141035
|
-
if (seconds <
|
|
141529
|
+
if (seconds < SECONDS_PER_MINUTE3) {
|
|
141036
141530
|
return `${String(seconds)}s`;
|
|
141037
141531
|
}
|
|
141038
|
-
const minutes = Math.floor(seconds /
|
|
141039
|
-
if (minutes <
|
|
141040
|
-
return `${String(minutes)}m ${String(seconds %
|
|
141532
|
+
const minutes = Math.floor(seconds / SECONDS_PER_MINUTE3);
|
|
141533
|
+
if (minutes < MINUTES_PER_HOUR5) {
|
|
141534
|
+
return `${String(minutes)}m ${String(seconds % SECONDS_PER_MINUTE3)}s`;
|
|
141041
141535
|
}
|
|
141042
|
-
return `${String(Math.floor(minutes /
|
|
141536
|
+
return `${String(Math.floor(minutes / MINUTES_PER_HOUR5))}h ${String(minutes % MINUTES_PER_HOUR5)}m`;
|
|
141043
141537
|
}
|
|
141044
141538
|
function twoUnits(larger2, smaller, largerUnit, smallerUnit) {
|
|
141045
141539
|
return smaller > 0 ? `${String(larger2)}${largerUnit} ${String(smaller)}${smallerUnit}` : `${String(larger2)}${largerUnit}`;
|
|
@@ -141049,16 +141543,16 @@ function formatAgo(ms2, t10) {
|
|
|
141049
141543
|
return t10("time.justNow");
|
|
141050
141544
|
}
|
|
141051
141545
|
const seconds = Math.floor(ms2 / MS_PER_SECOND18);
|
|
141052
|
-
if (seconds <
|
|
141546
|
+
if (seconds < SECONDS_PER_MINUTE3) {
|
|
141053
141547
|
return t10("time.ago", { value: `${String(seconds)}s` });
|
|
141054
141548
|
}
|
|
141055
|
-
const minutes = Math.floor(seconds /
|
|
141056
|
-
if (minutes <
|
|
141549
|
+
const minutes = Math.floor(seconds / SECONDS_PER_MINUTE3);
|
|
141550
|
+
if (minutes < MINUTES_PER_HOUR5) {
|
|
141057
141551
|
return t10("time.ago", { value: `${String(minutes)}m` });
|
|
141058
141552
|
}
|
|
141059
|
-
const hours = Math.floor(minutes /
|
|
141553
|
+
const hours = Math.floor(minutes / MINUTES_PER_HOUR5);
|
|
141060
141554
|
if (hours < HOURS_PER_DAY9) {
|
|
141061
|
-
return t10("time.ago", { value: twoUnits(hours, minutes %
|
|
141555
|
+
return t10("time.ago", { value: twoUnits(hours, minutes % MINUTES_PER_HOUR5, "h", "m") });
|
|
141062
141556
|
}
|
|
141063
141557
|
return t10("time.ago", { value: twoUnits(Math.floor(hours / HOURS_PER_DAY9), hours % HOURS_PER_DAY9, "d", "h") });
|
|
141064
141558
|
}
|
|
@@ -141069,253 +141563,6 @@ function durationSegment(context) {
|
|
|
141069
141563
|
return startedAtMs === void 0 ? void 0 : `\u23F1\uFE0F ${formatElapsed(context.nowMs - startedAtMs)}`;
|
|
141070
141564
|
}
|
|
141071
141565
|
|
|
141072
|
-
// src/statusline/colour.ts
|
|
141073
|
-
init_statusline();
|
|
141074
|
-
var FULL_CHANNEL = 255;
|
|
141075
|
-
var NORMAL_PRIMARY = 205;
|
|
141076
|
-
var SCHEME_WHITE = 229;
|
|
141077
|
-
var SCHEME_BLUE = 238;
|
|
141078
|
-
var BRIGHT_BLACK_GREY = 127;
|
|
141079
|
-
var BRIGHT_BLUE_TINT = 92;
|
|
141080
|
-
var NAMED_DEFAULT_RGB = {
|
|
141081
|
-
black: [0, 0, 0],
|
|
141082
|
-
red: [NORMAL_PRIMARY, 0, 0],
|
|
141083
|
-
green: [0, NORMAL_PRIMARY, 0],
|
|
141084
|
-
yellow: [NORMAL_PRIMARY, NORMAL_PRIMARY, 0],
|
|
141085
|
-
blue: [0, 0, SCHEME_BLUE],
|
|
141086
|
-
magenta: [NORMAL_PRIMARY, 0, NORMAL_PRIMARY],
|
|
141087
|
-
cyan: [0, NORMAL_PRIMARY, NORMAL_PRIMARY],
|
|
141088
|
-
white: [SCHEME_WHITE, SCHEME_WHITE, SCHEME_WHITE],
|
|
141089
|
-
brightBlack: [BRIGHT_BLACK_GREY, BRIGHT_BLACK_GREY, BRIGHT_BLACK_GREY],
|
|
141090
|
-
brightRed: [FULL_CHANNEL, 0, 0],
|
|
141091
|
-
brightGreen: [0, FULL_CHANNEL, 0],
|
|
141092
|
-
brightYellow: [FULL_CHANNEL, FULL_CHANNEL, 0],
|
|
141093
|
-
brightBlue: [BRIGHT_BLUE_TINT, BRIGHT_BLUE_TINT, FULL_CHANNEL],
|
|
141094
|
-
brightMagenta: [FULL_CHANNEL, 0, FULL_CHANNEL],
|
|
141095
|
-
brightCyan: [0, FULL_CHANNEL, FULL_CHANNEL],
|
|
141096
|
-
brightWhite: [FULL_CHANNEL, FULL_CHANNEL, FULL_CHANNEL]
|
|
141097
|
-
};
|
|
141098
|
-
function isNamedColour(value2) {
|
|
141099
|
-
return value2 !== "default" && value2 !== "dim" && STATUSLINE_COLOUR_NAMES.some((name) => name === value2);
|
|
141100
|
-
}
|
|
141101
|
-
var NAMED_RGB_IN_PALETTE_ORDER = STATUSLINE_COLOUR_NAMES.filter(isNamedColour).map((name) => NAMED_DEFAULT_RGB[name]);
|
|
141102
|
-
var CUBE_SIDE = 6;
|
|
141103
|
-
var CUBE_FIRST_INDEX = 16;
|
|
141104
|
-
var GREYSCALE_FIRST_INDEX = CUBE_FIRST_INDEX + CUBE_SIDE * CUBE_SIDE * CUBE_SIDE;
|
|
141105
|
-
var GREYSCALE_START = 8;
|
|
141106
|
-
var GREYSCALE_STEP = 10;
|
|
141107
|
-
var CUBE_CHANNEL_BASE = 55;
|
|
141108
|
-
var CUBE_CHANNEL_STEP = 40;
|
|
141109
|
-
function cubeChannel(level) {
|
|
141110
|
-
return level === 0 ? 0 : CUBE_CHANNEL_BASE + CUBE_CHANNEL_STEP * level;
|
|
141111
|
-
}
|
|
141112
|
-
function paletteIndexRgb(index) {
|
|
141113
|
-
if (index < CUBE_FIRST_INDEX) {
|
|
141114
|
-
return NAMED_RGB_IN_PALETTE_ORDER[index];
|
|
141115
|
-
}
|
|
141116
|
-
if (index < GREYSCALE_FIRST_INDEX) {
|
|
141117
|
-
const cube = index - CUBE_FIRST_INDEX;
|
|
141118
|
-
return [cubeChannel(Math.floor(cube / CUBE_SIDE ** 2)), cubeChannel(Math.floor(cube / CUBE_SIDE) % CUBE_SIDE), cubeChannel(cube % CUBE_SIDE)];
|
|
141119
|
-
}
|
|
141120
|
-
const grey = GREYSCALE_START + GREYSCALE_STEP * (index - GREYSCALE_FIRST_INDEX);
|
|
141121
|
-
return [grey, grey, grey];
|
|
141122
|
-
}
|
|
141123
|
-
var CHANNEL_DIGITS = 2;
|
|
141124
|
-
var HEX_RADIX2 = 16;
|
|
141125
|
-
var HASH_LENGTH = 1;
|
|
141126
|
-
function rgbOfHex(value2) {
|
|
141127
|
-
const channel = (index) => Number.parseInt(value2.slice(HASH_LENGTH + index * CHANNEL_DIGITS, HASH_LENGTH + (index + 1) * CHANNEL_DIGITS), HEX_RADIX2);
|
|
141128
|
-
return [channel(0), channel(1), channel(2)];
|
|
141129
|
-
}
|
|
141130
|
-
function rgbOfSetting(value2) {
|
|
141131
|
-
if (typeof value2 === "number") {
|
|
141132
|
-
return paletteIndexRgb(value2);
|
|
141133
|
-
}
|
|
141134
|
-
if (value2.startsWith("#")) {
|
|
141135
|
-
return rgbOfHex(value2);
|
|
141136
|
-
}
|
|
141137
|
-
return isNamedColour(value2) ? NAMED_DEFAULT_RGB[value2] : void 0;
|
|
141138
|
-
}
|
|
141139
|
-
function blendRgb(from, to2, at2) {
|
|
141140
|
-
const channel = (start, end) => Math.round(start + (end - start) * at2);
|
|
141141
|
-
return [channel(from[0], to2[0]), channel(from[1], to2[1]), channel(from[2], to2[2])];
|
|
141142
|
-
}
|
|
141143
|
-
|
|
141144
|
-
// src/statusline/palette.ts
|
|
141145
|
-
init_statusline();
|
|
141146
|
-
var RESET = `${ESCAPE}[0m`;
|
|
141147
|
-
var SGR_BY_NAME = {
|
|
141148
|
-
default: "",
|
|
141149
|
-
dim: "2",
|
|
141150
|
-
black: "30",
|
|
141151
|
-
red: "31",
|
|
141152
|
-
green: "32",
|
|
141153
|
-
yellow: "33",
|
|
141154
|
-
blue: "34",
|
|
141155
|
-
magenta: "35",
|
|
141156
|
-
cyan: "36",
|
|
141157
|
-
white: "37",
|
|
141158
|
-
brightBlack: "90",
|
|
141159
|
-
brightRed: "91",
|
|
141160
|
-
brightGreen: "92",
|
|
141161
|
-
brightYellow: "93",
|
|
141162
|
-
brightBlue: "94",
|
|
141163
|
-
brightMagenta: "95",
|
|
141164
|
-
brightCyan: "96",
|
|
141165
|
-
brightWhite: "97"
|
|
141166
|
-
};
|
|
141167
|
-
function isColourName(value2) {
|
|
141168
|
-
return STATUSLINE_COLOUR_NAMES.some((name) => name === value2);
|
|
141169
|
-
}
|
|
141170
|
-
function rgbSgr(channels) {
|
|
141171
|
-
return `38;2;${channels.join(";")}`;
|
|
141172
|
-
}
|
|
141173
|
-
function sgrOf(value2) {
|
|
141174
|
-
if (typeof value2 === "number") {
|
|
141175
|
-
return `38;5;${String(value2)}`;
|
|
141176
|
-
}
|
|
141177
|
-
if (value2.startsWith("#")) {
|
|
141178
|
-
return rgbSgr(rgbOfHex(value2));
|
|
141179
|
-
}
|
|
141180
|
-
return isColourName(value2) ? SGR_BY_NAME[value2] : "";
|
|
141181
|
-
}
|
|
141182
|
-
function colourEnabled(env) {
|
|
141183
|
-
return env.NO_COLOR === void 0;
|
|
141184
|
-
}
|
|
141185
|
-
function createPalette(colours, enabled) {
|
|
141186
|
-
const ansi = (role) => {
|
|
141187
|
-
const sgr = enabled ? sgrOf(colours[role]) : "";
|
|
141188
|
-
return sgr === "" ? "" : `${ESCAPE}[${sgr}m`;
|
|
141189
|
-
};
|
|
141190
|
-
return {
|
|
141191
|
-
ansi,
|
|
141192
|
-
paint: (role, text5) => {
|
|
141193
|
-
const start = ansi(role);
|
|
141194
|
-
return start === "" ? text5 : `${start}${text5}${RESET}`;
|
|
141195
|
-
},
|
|
141196
|
-
rgb: (channels) => enabled ? `${ESCAPE}[${rgbSgr(channels)}m` : "",
|
|
141197
|
-
rgbOf: (role) => rgbOfSetting(colours[role])
|
|
141198
|
-
};
|
|
141199
|
-
}
|
|
141200
|
-
|
|
141201
|
-
// src/statusline/style.ts
|
|
141202
|
-
var SECONDS_PER_MINUTE3 = 60;
|
|
141203
|
-
var MINUTES_PER_HOUR5 = 60;
|
|
141204
|
-
var SECONDS_PER_DAY = 86400;
|
|
141205
|
-
var THOUSAND = 1e3;
|
|
141206
|
-
var MILLION = 1e6;
|
|
141207
|
-
var TEN = 10;
|
|
141208
|
-
var FULL_PERCENT3 = 100;
|
|
141209
|
-
var ONE_PERCENT = 1;
|
|
141210
|
-
function withColor(color, text5) {
|
|
141211
|
-
return color === "" ? text5 : `${color}${text5}${RESET}`;
|
|
141212
|
-
}
|
|
141213
|
-
function warningRoleOf(style) {
|
|
141214
|
-
return style.okRole === "usage" ? "usageWarning" : "warning";
|
|
141215
|
-
}
|
|
141216
|
-
function statusColor(fraction, isUsedMetric, style) {
|
|
141217
|
-
const yellowAt = style.bands.warnAt / FULL_PERCENT3;
|
|
141218
|
-
const redAt = style.bands.criticalAt / FULL_PERCENT3;
|
|
141219
|
-
const { ansi } = style.palette;
|
|
141220
|
-
if (isUsedMetric) {
|
|
141221
|
-
if (fraction >= redAt) {
|
|
141222
|
-
return ansi("critical");
|
|
141223
|
-
}
|
|
141224
|
-
return fraction >= yellowAt ? ansi(warningRoleOf(style)) : ansi(style.okRole);
|
|
141225
|
-
}
|
|
141226
|
-
if (fraction <= 1 - redAt) {
|
|
141227
|
-
return ansi("critical");
|
|
141228
|
-
}
|
|
141229
|
-
return fraction <= 1 - yellowAt ? ansi(warningRoleOf(style)) : ansi(style.okRole);
|
|
141230
|
-
}
|
|
141231
|
-
function stopOf(role, style) {
|
|
141232
|
-
const rgb = style.palette.rgbOf(role);
|
|
141233
|
-
return rgb === void 0 ? void 0 : { role, rgb };
|
|
141234
|
-
}
|
|
141235
|
-
function colourBetween(from, to2, at2, style) {
|
|
141236
|
-
if (at2 <= 0) {
|
|
141237
|
-
return style.palette.ansi(from.role);
|
|
141238
|
-
}
|
|
141239
|
-
if (at2 >= 1) {
|
|
141240
|
-
return style.palette.ansi(to2.role);
|
|
141241
|
-
}
|
|
141242
|
-
return style.palette.rgb(blendRgb(from.rgb, to2.rgb, at2));
|
|
141243
|
-
}
|
|
141244
|
-
function gradientColorOf(fraction, style) {
|
|
141245
|
-
const ok2 = stopOf(style.okRole, style);
|
|
141246
|
-
const warning = stopOf(warningRoleOf(style), style);
|
|
141247
|
-
const critical = stopOf("critical", style);
|
|
141248
|
-
if (ok2 === void 0 || warning === void 0 || critical === void 0) {
|
|
141249
|
-
return void 0;
|
|
141250
|
-
}
|
|
141251
|
-
const warnAt = style.bands.warnAt / FULL_PERCENT3;
|
|
141252
|
-
const criticalAt = style.bands.criticalAt / FULL_PERCENT3;
|
|
141253
|
-
return fraction < warnAt ? colourBetween(ok2, warning, fraction / warnAt, style) : colourBetween(warning, critical, (fraction - warnAt) / (criticalAt - warnAt), style);
|
|
141254
|
-
}
|
|
141255
|
-
function widthStopsOf(style) {
|
|
141256
|
-
const ok2 = stopOf(style.okRole, style);
|
|
141257
|
-
const critical = stopOf("critical", style);
|
|
141258
|
-
return ok2 === void 0 || critical === void 0 ? void 0 : { ok: ok2, critical };
|
|
141259
|
-
}
|
|
141260
|
-
function acrossBar(column, cells) {
|
|
141261
|
-
return cells <= 1 ? 0 : column / (cells - 1);
|
|
141262
|
-
}
|
|
141263
|
-
function fillOf(fraction, filled, cells, style) {
|
|
141264
|
-
const stops = style.gradient === "width" ? widthStopsOf(style) : void 0;
|
|
141265
|
-
if (stops !== void 0 && filled > 0) {
|
|
141266
|
-
return Array.from({ length: filled }, (_, column) => `${colourBetween(stops.ok, stops.critical, acrossBar(column, cells), style)}${style.filled}`).join("");
|
|
141267
|
-
}
|
|
141268
|
-
const color = style.gradient === "use" ? gradientColorOf(fraction, style) : void 0;
|
|
141269
|
-
return `${color ?? statusColor(fraction, true, style)}${style.filled.repeat(filled)}`;
|
|
141270
|
-
}
|
|
141271
|
-
function drawBar(fraction, cells, style) {
|
|
141272
|
-
const clamped = Math.max(0, Math.min(1, fraction));
|
|
141273
|
-
const filled = Math.round(clamped * cells);
|
|
141274
|
-
const emptyColor = style.palette.ansi("empty");
|
|
141275
|
-
const fill = fillOf(clamped, filled, cells, style);
|
|
141276
|
-
const empty = style.empty.repeat(cells - filled);
|
|
141277
|
-
return fill === style.filled.repeat(filled) && emptyColor === "" ? `[${fill}${empty}]` : `[${fill}${emptyColor}${empty}${RESET}]`;
|
|
141278
|
-
}
|
|
141279
|
-
function formatTokens(num) {
|
|
141280
|
-
if (num >= MILLION) {
|
|
141281
|
-
const val = num / MILLION;
|
|
141282
|
-
return val % 1 === 0 ? `${String(Math.round(val))}M` : `${val.toFixed(1)}M`;
|
|
141283
|
-
}
|
|
141284
|
-
if (num >= THOUSAND) {
|
|
141285
|
-
const val = num / THOUSAND;
|
|
141286
|
-
return val >= TEN ? `${String(Math.round(val))}k` : `${val.toFixed(1)}k`;
|
|
141287
|
-
}
|
|
141288
|
-
return String(Math.round(num));
|
|
141289
|
-
}
|
|
141290
|
-
function formatDuration(seconds, t10) {
|
|
141291
|
-
if (seconds === void 0 || seconds <= 0) {
|
|
141292
|
-
return t10("quota.available");
|
|
141293
|
-
}
|
|
141294
|
-
if (seconds < SECONDS_PER_MINUTE3) {
|
|
141295
|
-
return `${String(seconds)}s`;
|
|
141296
|
-
}
|
|
141297
|
-
const days = Math.floor(seconds / SECONDS_PER_DAY);
|
|
141298
|
-
const hours = Math.floor(seconds % SECONDS_PER_DAY / (MINUTES_PER_HOUR5 * SECONDS_PER_MINUTE3));
|
|
141299
|
-
const minutes = Math.floor(seconds % (MINUTES_PER_HOUR5 * SECONDS_PER_MINUTE3) / SECONDS_PER_MINUTE3);
|
|
141300
|
-
if (days > 0) {
|
|
141301
|
-
return `${String(days)}d ${String(hours)}h`;
|
|
141302
|
-
}
|
|
141303
|
-
if (hours > 0) {
|
|
141304
|
-
return `${String(hours)}h ${String(minutes).padStart(2, "0")}m`;
|
|
141305
|
-
}
|
|
141306
|
-
return `${String(minutes)}m`;
|
|
141307
|
-
}
|
|
141308
|
-
function secondsUntil(resetAt, nowMs) {
|
|
141309
|
-
if (resetAt === void 0) {
|
|
141310
|
-
return void 0;
|
|
141311
|
-
}
|
|
141312
|
-
const resetMs = Date.parse(resetAt);
|
|
141313
|
-
return Number.isNaN(resetMs) ? void 0 : Math.max(0, Math.round((resetMs - nowMs) / THOUSAND));
|
|
141314
|
-
}
|
|
141315
|
-
function barCell(prefix, suffix, fraction, style) {
|
|
141316
|
-
return { prefix, suffix, draw: (cells) => drawBar(fraction, cells, style) };
|
|
141317
|
-
}
|
|
141318
|
-
|
|
141319
141566
|
// src/statusline/elements/header/headroom.ts
|
|
141320
141567
|
function headroomText(stats, t10) {
|
|
141321
141568
|
if (stats === void 0) {
|
|
@@ -141341,6 +141588,73 @@ function identitySegment({ summary }) {
|
|
|
141341
141588
|
return void 0;
|
|
141342
141589
|
}
|
|
141343
141590
|
|
|
141591
|
+
// src/statusline/headerLayout.ts
|
|
141592
|
+
var SEPARATOR3 = " | ";
|
|
141593
|
+
function headerUnits(parts, overflow) {
|
|
141594
|
+
const units = [];
|
|
141595
|
+
parts.forEach((part, index) => {
|
|
141596
|
+
const before = parts[index - 1];
|
|
141597
|
+
if (overflow === "truncate" && part.name === "vcs" && before?.name === "project") {
|
|
141598
|
+
units[units.length - 1] = `${units.at(-1) ?? ""} ${part.text}`;
|
|
141599
|
+
} else {
|
|
141600
|
+
units.push(part.text);
|
|
141601
|
+
}
|
|
141602
|
+
});
|
|
141603
|
+
return units;
|
|
141604
|
+
}
|
|
141605
|
+
function justify(texts, maxWidth, separator) {
|
|
141606
|
+
if (texts.length < 2) {
|
|
141607
|
+
return texts.join(separator);
|
|
141608
|
+
}
|
|
141609
|
+
const separatorLength = visibleLength(separator);
|
|
141610
|
+
const total = texts.reduce((sum2, text5) => sum2 + visibleLength(text5), 0) + separatorLength * (texts.length - 1);
|
|
141611
|
+
const spare = maxWidth - total;
|
|
141612
|
+
if (spare <= 0) {
|
|
141613
|
+
return texts.join(separator);
|
|
141614
|
+
}
|
|
141615
|
+
const gaps = texts.length - 1;
|
|
141616
|
+
const extraPerGap = Math.floor(spare / gaps);
|
|
141617
|
+
let remainder = spare % gaps;
|
|
141618
|
+
const parts = [];
|
|
141619
|
+
texts.forEach((text5, index) => {
|
|
141620
|
+
if (index > 0) {
|
|
141621
|
+
const extra = extraPerGap + (remainder > 0 ? 1 : 0);
|
|
141622
|
+
if (remainder > 0) {
|
|
141623
|
+
remainder -= 1;
|
|
141624
|
+
}
|
|
141625
|
+
const left = Math.floor(extra / 2);
|
|
141626
|
+
parts.push(`${" ".repeat(left + 1)}|${" ".repeat(extra - left + 1)}`);
|
|
141627
|
+
}
|
|
141628
|
+
parts.push(text5);
|
|
141629
|
+
});
|
|
141630
|
+
return parts.join("");
|
|
141631
|
+
}
|
|
141632
|
+
function packLines(texts, maxWidth, separator) {
|
|
141633
|
+
const separatorLength = visibleLength(separator);
|
|
141634
|
+
const lines = [];
|
|
141635
|
+
let current = [];
|
|
141636
|
+
let currentWidth = 0;
|
|
141637
|
+
for (const text5 of texts) {
|
|
141638
|
+
const width = visibleLength(text5);
|
|
141639
|
+
const added = current.length === 0 ? width : width + separatorLength;
|
|
141640
|
+
if (current.length > 0 && currentWidth + added > maxWidth) {
|
|
141641
|
+
lines.push(current);
|
|
141642
|
+
current = [text5];
|
|
141643
|
+
currentWidth = width;
|
|
141644
|
+
} else {
|
|
141645
|
+
current.push(text5);
|
|
141646
|
+
currentWidth += added;
|
|
141647
|
+
}
|
|
141648
|
+
}
|
|
141649
|
+
if (current.length > 0) {
|
|
141650
|
+
lines.push(current);
|
|
141651
|
+
}
|
|
141652
|
+
return lines;
|
|
141653
|
+
}
|
|
141654
|
+
function layoutHeader(texts, maxWidth, separator) {
|
|
141655
|
+
return packLines(texts, maxWidth, separator).map((line) => justify(line, maxWidth, separator)).join("\n");
|
|
141656
|
+
}
|
|
141657
|
+
|
|
141344
141658
|
// src/statusline/elements/header/model.ts
|
|
141345
141659
|
function choiceNamesProvider(summary) {
|
|
141346
141660
|
return summary.modelChoice !== void 0 && (summary.modelChoice.providers.length > 1 || summary.routedTarget !== void 0);
|
|
@@ -141367,9 +141681,18 @@ function modelNameOf({ view, settings: settings2, transcriptIdentity }) {
|
|
|
141367
141681
|
return { name: formatModelName(served, settings2.model.format), isServed: true };
|
|
141368
141682
|
}
|
|
141369
141683
|
}
|
|
141370
|
-
return view.
|
|
141684
|
+
return view.clientModelName === void 0 ? void 0 : { name: formatModelName(view.clientModelName, settings2.model.format), isServed: false };
|
|
141371
141685
|
}
|
|
141372
141686
|
function modelSegment(context) {
|
|
141687
|
+
const name = modelName(context);
|
|
141688
|
+
const inputs = platformInputsOf(context.payload, context.ports.env, context.payload.model?.id);
|
|
141689
|
+
const platform = context.settings.model.platform ? modelPlatformOf(inputs.env, inputs.modelId) : void 0;
|
|
141690
|
+
if (platform === void 0) {
|
|
141691
|
+
return name;
|
|
141692
|
+
}
|
|
141693
|
+
return name === void 0 ? platform : `${name}${SEPARATOR3}${platform}`;
|
|
141694
|
+
}
|
|
141695
|
+
function modelName(context) {
|
|
141373
141696
|
const { summary } = context;
|
|
141374
141697
|
const model = modelNameOf(context);
|
|
141375
141698
|
if (model === void 0 || model.name === "") {
|
|
@@ -141916,73 +142239,6 @@ function addedDirsRow({ payload, settings: settings2, palette, t: t10 }) {
|
|
|
141916
142239
|
return { kind: "text", lines: [writeAround(t10, "addedDirs.label", drawn.join(label2(t10("list.separator"))), label2)] };
|
|
141917
142240
|
}
|
|
141918
142241
|
|
|
141919
|
-
// src/statusline/headerLayout.ts
|
|
141920
|
-
var SEPARATOR3 = " | ";
|
|
141921
|
-
function headerUnits(parts, overflow) {
|
|
141922
|
-
const units = [];
|
|
141923
|
-
parts.forEach((part, index) => {
|
|
141924
|
-
const before = parts[index - 1];
|
|
141925
|
-
if (overflow === "truncate" && part.name === "vcs" && before?.name === "project") {
|
|
141926
|
-
units[units.length - 1] = `${units.at(-1) ?? ""} ${part.text}`;
|
|
141927
|
-
} else {
|
|
141928
|
-
units.push(part.text);
|
|
141929
|
-
}
|
|
141930
|
-
});
|
|
141931
|
-
return units;
|
|
141932
|
-
}
|
|
141933
|
-
function justify(texts, maxWidth, separator) {
|
|
141934
|
-
if (texts.length < 2) {
|
|
141935
|
-
return texts.join(separator);
|
|
141936
|
-
}
|
|
141937
|
-
const separatorLength = visibleLength(separator);
|
|
141938
|
-
const total = texts.reduce((sum2, text5) => sum2 + visibleLength(text5), 0) + separatorLength * (texts.length - 1);
|
|
141939
|
-
const spare = maxWidth - total;
|
|
141940
|
-
if (spare <= 0) {
|
|
141941
|
-
return texts.join(separator);
|
|
141942
|
-
}
|
|
141943
|
-
const gaps = texts.length - 1;
|
|
141944
|
-
const extraPerGap = Math.floor(spare / gaps);
|
|
141945
|
-
let remainder = spare % gaps;
|
|
141946
|
-
const parts = [];
|
|
141947
|
-
texts.forEach((text5, index) => {
|
|
141948
|
-
if (index > 0) {
|
|
141949
|
-
const extra = extraPerGap + (remainder > 0 ? 1 : 0);
|
|
141950
|
-
if (remainder > 0) {
|
|
141951
|
-
remainder -= 1;
|
|
141952
|
-
}
|
|
141953
|
-
const left = Math.floor(extra / 2);
|
|
141954
|
-
parts.push(`${" ".repeat(left + 1)}|${" ".repeat(extra - left + 1)}`);
|
|
141955
|
-
}
|
|
141956
|
-
parts.push(text5);
|
|
141957
|
-
});
|
|
141958
|
-
return parts.join("");
|
|
141959
|
-
}
|
|
141960
|
-
function packLines(texts, maxWidth, separator) {
|
|
141961
|
-
const separatorLength = visibleLength(separator);
|
|
141962
|
-
const lines = [];
|
|
141963
|
-
let current = [];
|
|
141964
|
-
let currentWidth = 0;
|
|
141965
|
-
for (const text5 of texts) {
|
|
141966
|
-
const width = visibleLength(text5);
|
|
141967
|
-
const added = current.length === 0 ? width : width + separatorLength;
|
|
141968
|
-
if (current.length > 0 && currentWidth + added > maxWidth) {
|
|
141969
|
-
lines.push(current);
|
|
141970
|
-
current = [text5];
|
|
141971
|
-
currentWidth = width;
|
|
141972
|
-
} else {
|
|
141973
|
-
current.push(text5);
|
|
141974
|
-
currentWidth += added;
|
|
141975
|
-
}
|
|
141976
|
-
}
|
|
141977
|
-
if (current.length > 0) {
|
|
141978
|
-
lines.push(current);
|
|
141979
|
-
}
|
|
141980
|
-
return lines;
|
|
141981
|
-
}
|
|
141982
|
-
function layoutHeader(texts, maxWidth, separator) {
|
|
141983
|
-
return packLines(texts, maxWidth, separator).map((line) => justify(line, maxWidth, separator)).join("\n");
|
|
141984
|
-
}
|
|
141985
|
-
|
|
141986
142242
|
// src/statusline/elements/rows/activityParts.ts
|
|
141987
142243
|
var RUNNING_MARK = "\u25D0";
|
|
141988
142244
|
var DONE_MARK = "\u2713";
|
|
@@ -142105,10 +142361,11 @@ function cacheShareText(view, style, t10) {
|
|
|
142105
142361
|
function windowTokensOf({ settings: settings2, view }) {
|
|
142106
142362
|
return settings2.context.autoCompactWindow ?? view.contextWindowTokens;
|
|
142107
142363
|
}
|
|
142364
|
+
var ROUNDING_HALF_POINT = 0.5;
|
|
142108
142365
|
function bufferedPercent(tokens, windowTokens) {
|
|
142109
142366
|
const held = tokens / windowTokens;
|
|
142110
142367
|
const ramp = Math.max(0, Math.min(1, (held - AUTOCOMPACT_RESERVE_RAMP_START) / (AUTOCOMPACT_RESERVE_RAMP_END - AUTOCOMPACT_RESERVE_RAMP_START)));
|
|
142111
|
-
return Math.min(FULL_PERCENT3, (
|
|
142368
|
+
return Math.min(FULL_PERCENT3, (tokens + windowTokens * AUTOCOMPACT_RESERVE_FRACTION * ramp) / windowTokens * FULL_PERCENT3);
|
|
142112
142369
|
}
|
|
142113
142370
|
function usedPercentOf(context) {
|
|
142114
142371
|
const { settings: settings2, view } = context;
|
|
@@ -142140,9 +142397,10 @@ function contextRow(context) {
|
|
|
142140
142397
|
return settings2.context.bar === "shown" ? { kind: "bars", cells: [] } : { kind: "text", lines: [] };
|
|
142141
142398
|
}
|
|
142142
142399
|
const style = barStyleOf(context, "context");
|
|
142143
|
-
const bands =
|
|
142400
|
+
const bands = { warnAt: settings2.context.warnAt - ROUNDING_HALF_POINT, criticalAt: settings2.context.criticalAt - ROUNDING_HALF_POINT };
|
|
142144
142401
|
const fraction = Math.max(0, Math.min(1, percent2 / FULL_PERCENT3));
|
|
142145
|
-
const
|
|
142402
|
+
const bandFraction = Math.max(0, Math.min(1, Math.round(percent2) / FULL_PERCENT3));
|
|
142403
|
+
const color = statusColor(bandFraction, true, { ...style, bands });
|
|
142146
142404
|
const windowTokens = windowTokensOf(context);
|
|
142147
142405
|
const tokens = view.contextTotalTokens;
|
|
142148
142406
|
const heldAgainstWindow = tokens === void 0 || windowTokens === void 0 ? void 0 : `${formatTokens(tokens)}/${formatTokens(windowTokens)}`;
|
|
@@ -142172,7 +142430,7 @@ function contextRow(context) {
|
|
|
142172
142430
|
default:
|
|
142173
142431
|
return settings2.context.value;
|
|
142174
142432
|
}
|
|
142175
|
-
const high = settings2.context.breakdown === "critical" && percent2 >=
|
|
142433
|
+
const high = settings2.context.breakdown === "critical" && Math.round(percent2) >= contextBreakdownAt(settings2) ? breakdownText(context) : void 0;
|
|
142176
142434
|
if (settings2.context.bar === "hidden" && afterBar.length === 0) {
|
|
142177
142435
|
return { kind: "text", lines: [] };
|
|
142178
142436
|
}
|
|
@@ -142180,7 +142438,7 @@ function contextRow(context) {
|
|
|
142180
142438
|
const label2 = [context.t("context.label"), ...beforeBar].join(" ");
|
|
142181
142439
|
if (settings2.context.bar === "shown") {
|
|
142182
142440
|
const suffix = afterBar.length === 0 ? trailer : ` ${afterBar.join(" ")}${trailer}`;
|
|
142183
|
-
return { kind: "bars", cells: [barCell(palette.paint("label", `${label2} `), suffix, fraction, { ...style, bands })] };
|
|
142441
|
+
return { kind: "bars", cells: [barCell(palette.paint("label", `${label2} `), suffix, fraction, { ...style, bands, bandFraction })] };
|
|
142184
142442
|
}
|
|
142185
142443
|
return { kind: "text", lines: [`${[palette.paint("label", label2), ...afterBar].join(" ")}${trailer}`] };
|
|
142186
142444
|
}
|
|
@@ -142459,8 +142717,8 @@ function promptCacheRow(context) {
|
|
|
142459
142717
|
}
|
|
142460
142718
|
|
|
142461
142719
|
// src/statusline/elements/rows/quota.ts
|
|
142462
|
-
init_statusline();
|
|
142463
142720
|
init_pick();
|
|
142721
|
+
init_graphemes();
|
|
142464
142722
|
|
|
142465
142723
|
// src/statusline/resetTime.ts
|
|
142466
142724
|
function elapsedPercent(resetMs, periodMs, nowMs) {
|
|
@@ -142503,55 +142761,69 @@ function formatResetTime(window, nowMs, settings2, clock, t10, labelled) {
|
|
|
142503
142761
|
}
|
|
142504
142762
|
|
|
142505
142763
|
// src/statusline/elements/rows/quota.ts
|
|
142506
|
-
|
|
142507
|
-
|
|
142764
|
+
var MODEL_WINDOW_NAME_CHARACTERS = 64;
|
|
142765
|
+
function modelWindowName(name) {
|
|
142766
|
+
return leadingGraphemes(visibleDisplayText(name), MODEL_WINDOW_NAME_CHARACTERS).join("").trim();
|
|
142508
142767
|
}
|
|
142509
142768
|
function modelScopedWindows({ payload }) {
|
|
142510
142769
|
return (payload.rate_limits?.model_scoped ?? []).flatMap((window) => {
|
|
142511
|
-
const label2 =
|
|
142512
|
-
if (label2 === ""
|
|
142770
|
+
const label2 = modelWindowName(window.display_name ?? "");
|
|
142771
|
+
if (label2 === "") {
|
|
142513
142772
|
return [];
|
|
142514
142773
|
}
|
|
142515
|
-
|
|
142774
|
+
const fraction = window.utilization !== void 0 && Number.isFinite(window.utilization) ? Math.max(0, Math.min(FULL_PERCENT3, window.utilization)) / FULL_PERCENT3 : void 0;
|
|
142775
|
+
return [{ label: label2, fraction, resetsAt: window.resets_at, periodMs: SEVEN_DAY_WINDOW_MS, weekly: false }];
|
|
142516
142776
|
});
|
|
142517
142777
|
}
|
|
142518
|
-
function
|
|
142778
|
+
function unifiedWindows(context) {
|
|
142519
142779
|
const { summary, settings: settings2 } = context;
|
|
142520
|
-
|
|
142521
|
-
|
|
142780
|
+
const inputs = platformInputsOf(context.payload, context.ports.env, context.payload.model?.id);
|
|
142781
|
+
if (summary.provider === void 0 && hidesSubscriptionWindows(inputs.env, inputs.modelId)) {
|
|
142782
|
+
return { unified: [], modelScoped: [] };
|
|
142522
142783
|
}
|
|
142523
|
-
const
|
|
142784
|
+
const unified = [];
|
|
142524
142785
|
if (summary.fiveHourUsed !== void 0) {
|
|
142525
|
-
|
|
142786
|
+
unified.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 });
|
|
142526
142787
|
}
|
|
142527
142788
|
if (summary.sevenDayUsed !== void 0) {
|
|
142528
|
-
|
|
142789
|
+
unified.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 });
|
|
142529
142790
|
}
|
|
142530
|
-
|
|
142531
|
-
|
|
142532
|
-
|
|
142533
|
-
|
|
142534
|
-
|
|
142791
|
+
return { unified, modelScoped: settings2.usage.modelScoped && summary.provider === void 0 ? modelScopedWindows(context) : [] };
|
|
142792
|
+
}
|
|
142793
|
+
function candidateWindows(context) {
|
|
142794
|
+
const { summary } = context;
|
|
142795
|
+
if (summary.quotaFamilies.length > 0) {
|
|
142796
|
+
return summary.quotaFamilies.map((window) => ({ label: window.measures, fraction: window.utilization, resetsAt: window.resetsAt, periodMs: void 0, weekly: false }));
|
|
142535
142797
|
}
|
|
142536
|
-
|
|
142798
|
+
const { unified, modelScoped } = unifiedWindows(context);
|
|
142799
|
+
const providerWindows = unified.length > 0 ? [] : summary.providerQuotaWindows.map((window) => ({ label: window.measures, fraction: window.utilization, resetsAt: window.resetsAt, periodMs: window.periodMs, weekly: false }));
|
|
142800
|
+
return [...unified, ...providerWindows, ...modelScoped];
|
|
142801
|
+
}
|
|
142802
|
+
var REPORTED_PERCENT_DIGITS = 9;
|
|
142803
|
+
function wholePercentOf(fraction) {
|
|
142804
|
+
return Math.round(Number((fraction * FULL_PERCENT3).toFixed(REPORTED_PERCENT_DIGITS)));
|
|
142537
142805
|
}
|
|
142538
142806
|
function visibleWindows(context) {
|
|
142539
142807
|
const { summary, settings: settings2 } = context;
|
|
142540
142808
|
const candidates = candidateWindows(context);
|
|
142541
|
-
const mostUsed = Math.max(0, ...candidates.map((window) => window.fraction
|
|
142809
|
+
const mostUsed = Math.max(0, ...candidates.map((window) => window.fraction === void 0 ? 0 : wholePercentOf(window.fraction)));
|
|
142542
142810
|
if (mostUsed < settings2.usage.threshold) {
|
|
142543
142811
|
return [];
|
|
142544
142812
|
}
|
|
142545
|
-
const hidesWeekly = summary.fiveHourUsed !== void 0 && summary.sevenDayUsed !== void 0 && summary.sevenDayUsed < settings2.usage.sevenDayThreshold;
|
|
142813
|
+
const hidesWeekly = summary.fiveHourUsed !== void 0 && summary.sevenDayUsed !== void 0 && Math.round(summary.sevenDayUsed) < settings2.usage.sevenDayThreshold;
|
|
142546
142814
|
return hidesWeekly ? candidates.filter((window) => !window.weekly) : candidates;
|
|
142547
142815
|
}
|
|
142816
|
+
var NO_FIGURE = "--";
|
|
142548
142817
|
function figuresOf(window, context, style) {
|
|
142549
142818
|
const { settings: settings2, nowMs, ports } = context;
|
|
142819
|
+
const reset = formatResetTime(window, nowMs, settings2, ports.clock, context.t, settings2.usage.resetLabel).text;
|
|
142820
|
+
const plainReset = settings2.usage.resetLabel ? formatResetTime(window, nowMs, settings2, ports.clock, context.t, false).text : reset;
|
|
142821
|
+
if (window.fraction === void 0) {
|
|
142822
|
+
return { value: NO_FIGURE, reset, plainReset };
|
|
142823
|
+
}
|
|
142550
142824
|
const clamped = Math.max(0, Math.min(1, window.fraction));
|
|
142551
142825
|
const used = window.fraction * FULL_PERCENT3;
|
|
142552
142826
|
const shown = settings2.usage.value === "remaining" ? Math.max(0, FULL_PERCENT3 - used) : used;
|
|
142553
|
-
const reset = formatResetTime(window, nowMs, settings2, ports.clock, context.t, settings2.usage.resetLabel).text;
|
|
142554
|
-
const plainReset = settings2.usage.resetLabel ? formatResetTime(window, nowMs, settings2, ports.clock, context.t, false).text : reset;
|
|
142555
142827
|
return { value: withColor(statusColor(clamped, true, style), `${shown.toFixed(1)}%`), reset, plainReset };
|
|
142556
142828
|
}
|
|
142557
142829
|
function parenthesised(reset) {
|
|
@@ -142576,7 +142848,7 @@ function quotaRow(context) {
|
|
|
142576
142848
|
const lines = parts.map(({ window, value: value2, suffix }) => `${palette.paint("label", `${window.label} `)}${value2}${suffix === "" ? "" : ` ${suffix}`}`);
|
|
142577
142849
|
return { kind: "text", lines: wrapped(lines, context.width) };
|
|
142578
142850
|
}
|
|
142579
|
-
const cells = parts.map(({ window, value: value2, suffix }) => barCell(palette.paint("label", `${window.label} `), ` ${value2}${suffix === "" ? "" : ` ${suffix}`}`, Math.max(0, Math.min(1, window.fraction)), style));
|
|
142851
|
+
const cells = parts.map(({ window, value: value2, suffix }) => barCell(palette.paint("label", `${window.label} `), ` ${value2}${suffix === "" ? "" : ` ${suffix}`}`, Math.max(0, Math.min(1, window.fraction ?? 0)), style));
|
|
142580
142852
|
return { kind: "bars", cells };
|
|
142581
142853
|
}
|
|
142582
142854
|
|
|
@@ -143201,7 +143473,11 @@ function layoutBarGrid(units, maxWidth, separator, baseBarCells) {
|
|
|
143201
143473
|
if (groups.length > 1) {
|
|
143202
143474
|
return groups.flatMap((group) => layoutBarGrid([[group]], maxWidth, separator, baseBarCells));
|
|
143203
143475
|
}
|
|
143204
|
-
|
|
143476
|
+
const oneToARow = chunked(1);
|
|
143477
|
+
if (oneToARow.baseWidth <= maxWidth) {
|
|
143478
|
+
return renderGrid(oneToARow, maxWidth, separator, baseBarCells);
|
|
143479
|
+
}
|
|
143480
|
+
return oneToARow.rows.flatMap((row) => renderGrid(measureGrid([row], separatorLength, baseBarCells), maxWidth, separator, baseBarCells));
|
|
143205
143481
|
}
|
|
143206
143482
|
|
|
143207
143483
|
// src/statusline/rowsLayout.ts
|
|
@@ -144269,7 +144545,7 @@ function registerStatuslineCommand(program2, deps) {
|
|
|
144269
144545
|
stackedUnderDefault = false;
|
|
144270
144546
|
}
|
|
144271
144547
|
}
|
|
144272
|
-
const view = { ...viewOf(clientPayload), ...stackedUnderDefault ? {
|
|
144548
|
+
const view = { ...viewOf(clientPayload), ...stackedUnderDefault ? { clientModelName: void 0 } : {} };
|
|
144273
144549
|
const widths = widthsOf(payload, process.env, settings2.layout);
|
|
144274
144550
|
console.log(renderStatuslineBlock({ summary, view, payload: clientPayload, terminalWidth: widths.terminal, lineWidth: widths.line, nowMs, settings: settings2, ports: realStatuslinePorts(process.env, deps.paths.statuslineDir) }));
|
|
144275
144551
|
}),
|
|
@@ -154048,9 +154324,9 @@ var StoredMcpPermissionsSchema = external_exports.strictObject({
|
|
|
154048
154324
|
history: external_exports.boolean().default(false)
|
|
154049
154325
|
});
|
|
154050
154326
|
var OWNER_ONLY_MODE = 384;
|
|
154051
|
-
var
|
|
154327
|
+
var NONE3 = { writes: false, remoteControl: false, history: false };
|
|
154052
154328
|
function readStoredMcpPermissions(paths) {
|
|
154053
|
-
return readJson(paths.mcpPermissionsFile, StoredMcpPermissionsSchema) ??
|
|
154329
|
+
return readJson(paths.mcpPermissionsFile, StoredMcpPermissionsSchema) ?? NONE3;
|
|
154054
154330
|
}
|
|
154055
154331
|
function writeStoredMcpPermissions(paths, permissions) {
|
|
154056
154332
|
writeJsonAtomic(paths.mcpPermissionsFile, { writes: permissions.writes, remoteControl: permissions.remoteControl, history: permissions.history });
|