claude-use 11.58.0 → 11.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.cjs +492 -230
- package/dist/index.cjs +42 -8
- package/dist/index.mjs +42 -8
- package/dist/types/index.d.ts +572 -22
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -170,27 +170,41 @@ function distinctList(member) {
|
|
|
170
170
|
function isSingleVisibleGrapheme(text) {
|
|
171
171
|
return graphemesOf(text).length === 1 && (0, import_string_width2.default)(text) === 1 && !/[\p{C}\p{Z}]/u.test(text) && !drawsNothing(text);
|
|
172
172
|
}
|
|
173
|
+
function unsettable(setting) {
|
|
174
|
+
return setting.unwrap().nullable().optional().describe(`${setting.description ?? ""} ${UNSET_NOTE}`);
|
|
175
|
+
}
|
|
173
176
|
function isPlainObject(value) {
|
|
174
177
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
175
178
|
}
|
|
176
179
|
function mergeStatuslineSettings(base, over) {
|
|
177
|
-
if (!isPlainObject(
|
|
180
|
+
if (!isPlainObject(over)) {
|
|
178
181
|
return over === void 0 ? base : over;
|
|
179
182
|
}
|
|
180
|
-
const merged = { ...base };
|
|
183
|
+
const merged = isPlainObject(base) ? { ...base } : {};
|
|
181
184
|
for (const [key, value] of Object.entries(over)) {
|
|
182
|
-
|
|
185
|
+
if (value === null) {
|
|
186
|
+
Reflect.deleteProperty(merged, key);
|
|
187
|
+
} else {
|
|
188
|
+
merged[key] = mergeStatuslineSettings(merged[key], value);
|
|
189
|
+
}
|
|
183
190
|
}
|
|
184
191
|
return merged;
|
|
185
192
|
}
|
|
193
|
+
function contextBands({ bands, context }) {
|
|
194
|
+
return { warnAt: context.warnAt ?? bands.warnAt, criticalAt: context.criticalAt ?? bands.criticalAt };
|
|
195
|
+
}
|
|
186
196
|
function resolveStatusline(settings) {
|
|
187
197
|
const resolved = ResolvedStatuslineSchema.parse(mergeStatuslineSettings(STATUSLINE_DEFAULTS, settings));
|
|
188
198
|
if (resolved.bands.warnAt >= resolved.bands.criticalAt) {
|
|
189
199
|
throw new RangeError(`statusline bands.warnAt (${String(resolved.bands.warnAt)}) must be below bands.criticalAt (${String(resolved.bands.criticalAt)})`);
|
|
190
200
|
}
|
|
201
|
+
const forContext = contextBands(resolved);
|
|
202
|
+
if (forContext.warnAt >= forContext.criticalAt) {
|
|
203
|
+
throw new RangeError(`statusline context.warnAt (${String(forContext.warnAt)}) must be below context.criticalAt (${String(forContext.criticalAt)}), each following bands while it is unset`);
|
|
204
|
+
}
|
|
191
205
|
return resolved;
|
|
192
206
|
}
|
|
193
|
-
var import_string_width2, import_zod, STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_SESSION_TIME_PARTS, PROMPT_CACHE_TTL_SECONDS, STATUSLINE_COLOUR_NAMES, DEFAULT_HEADER_SEGMENTS, DEFAULT_ROWS, STATUSLINE_PATH_LEVELS, STATUSLINE_USAGE_VALUES, STATUSLINE_TIME_FORMATS, STATUSLINE_HOUR_CYCLES, MAX_PERCENT, MAX_STATUSLINE_PALETTE_INDEX, MAX_STATUSLINE_LABEL_COLUMNS, MAX_BAR_CELLS, MAX_ACCOUNT_USER_CHARS, MAX_DISPLAY_TEXT_CHARS, LABEL_RE2, OPTIONAL_LABEL_RE, colourValue, barCharacter, labelText, overrideText, wholePercent, thresholdPercent, SHAPES, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
|
|
207
|
+
var import_string_width2, import_zod, STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_SESSION_TIME_PARTS, PROMPT_CACHE_TTL_SECONDS, STATUSLINE_COLOUR_NAMES, DEFAULT_HEADER_SEGMENTS, DEFAULT_ROWS, STATUSLINE_PATH_LEVELS, STATUSLINE_USAGE_VALUES, STATUSLINE_TIME_FORMATS, STATUSLINE_HOUR_CYCLES, MAX_PERCENT, MAX_STATUSLINE_PALETTE_INDEX, MAX_STATUSLINE_LABEL_COLUMNS, MAX_BAR_CELLS, MAX_ACCOUNT_USER_CHARS, MAX_DISPLAY_TEXT_CHARS, LABEL_RE2, OPTIONAL_LABEL_RE, colourValue, barCharacter, STATUSLINE_CONTEXT_VALUES, STATUSLINE_CONTEXT_ESTIMATES, AUTOCOMPACT_RESERVE_FRACTION, AUTOCOMPACT_RESERVE_RAMP_START, AUTOCOMPACT_RESERVE_RAMP_END, labelText, overrideText, wholePercent, thresholdPercent, SHAPES, UNSET_NOTE, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
|
|
194
208
|
var init_statusline = __esm({
|
|
195
209
|
"src/config/statusline.ts"() {
|
|
196
210
|
"use strict";
|
|
@@ -199,7 +213,7 @@ var init_statusline = __esm({
|
|
|
199
213
|
init_blank();
|
|
200
214
|
init_graphemes();
|
|
201
215
|
STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom", "project", "vcs", "effort", "advisor", "version", "outputStyle", "cost", "dailyCost", "sessionName", "duration", "speed"];
|
|
202
|
-
STATUSLINE_ROWS = ["context", "quota", "addedDirs", "gitFiles", "memory", "environment", "sessionTime", "promptCache", "compactions"];
|
|
216
|
+
STATUSLINE_ROWS = ["context", "quota", "addedDirs", "gitFiles", "memory", "environment", "sessionTime", "promptCache", "compactions", "tokens"];
|
|
203
217
|
STATUSLINE_SESSION_TIME_PARTS = ["started", "lastReply"];
|
|
204
218
|
PROMPT_CACHE_TTL_SECONDS = { fiveMinutes: 300, oneHour: 3600 };
|
|
205
219
|
STATUSLINE_COLOUR_NAMES = [
|
|
@@ -238,6 +252,11 @@ var init_statusline = __esm({
|
|
|
238
252
|
OPTIONAL_LABEL_RE = /^(?:[^\p{C}\p{Z}]+(?: [^\p{C}\p{Z}]+)*)?$/u;
|
|
239
253
|
colourValue = import_zod.z.union([import_zod.z.enum(STATUSLINE_COLOUR_NAMES), import_zod.z.number().int().min(0).max(MAX_STATUSLINE_PALETTE_INDEX), import_zod.z.string().regex(/^#[0-9a-fA-F]{6}$/, "must be a colour name, a palette index from 0 to 255 or #rrggbb")]);
|
|
240
254
|
barCharacter = import_zod.z.string().refine(isSingleVisibleGrapheme, "must be a single visible character that takes one terminal column");
|
|
255
|
+
STATUSLINE_CONTEXT_VALUES = ["both", "percent", "tokens", "remaining"];
|
|
256
|
+
STATUSLINE_CONTEXT_ESTIMATES = ["never", "raw", "buffered"];
|
|
257
|
+
AUTOCOMPACT_RESERVE_FRACTION = 0.165;
|
|
258
|
+
AUTOCOMPACT_RESERVE_RAMP_START = 0.05;
|
|
259
|
+
AUTOCOMPACT_RESERVE_RAMP_END = 0.5;
|
|
241
260
|
labelText = import_zod.z.string().refine((text) => (0, import_string_width2.default)(text) <= MAX_STATUSLINE_LABEL_COLUMNS, `must take no more than ${String(MAX_STATUSLINE_LABEL_COLUMNS)} terminal columns`).refine((text) => !drawsNothing(text), "must show something: a label of only combining marks or blank characters draws nothing").regex(LABEL_RE2, "must be visible text without control characters");
|
|
242
261
|
overrideText = import_zod.z.string().max(MAX_DISPLAY_TEXT_CHARS).regex(OPTIONAL_LABEL_RE, "must be visible text without control characters");
|
|
243
262
|
wholePercent = import_zod.z.number().int().min(1).max(MAX_PERCENT);
|
|
@@ -265,6 +284,15 @@ var init_statusline = __esm({
|
|
|
265
284
|
advisor: {
|
|
266
285
|
override: overrideText.describe("A name to show for the advisor model in place of the one the session's transcript records; empty shows the transcript's, prettified.")
|
|
267
286
|
},
|
|
287
|
+
context: {
|
|
288
|
+
bar: import_zod.z.enum(["shown", "hidden"]).describe("Whether the context row draws its bar, or only its figures on one line of text."),
|
|
289
|
+
value: import_zod.z.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)."),
|
|
290
|
+
warnAt: wholePercent.optional().describe("The whole percentage of the context window at which the context bar turns yellow; while it is unset the context bar follows bands.warnAt."),
|
|
291
|
+
criticalAt: wholePercent.optional().describe("The whole percentage of the context window at which the context bar turns red and, with context.breakdown set to critical, the token breakdown appears; while it is unset the context bar follows bands.criticalAt."),
|
|
292
|
+
autoCompactWindow: import_zod.z.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."),
|
|
293
|
+
estimate: import_zod.z.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, 0 included, is drawn as it is, and none reported 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)}%).`),
|
|
294
|
+
breakdown: import_zod.z.enum(["never", "critical"]).describe("Whether to add the input and cache tokens of the last request to the context row once its use reaches context.criticalAt.")
|
|
295
|
+
},
|
|
268
296
|
bands: {
|
|
269
297
|
warnAt: wholePercent.describe("The whole percentage of use at which a bar turns yellow; it must be below criticalAt."),
|
|
270
298
|
criticalAt: wholePercent.describe("The whole percentage of use at which a bar turns red.")
|
|
@@ -336,6 +364,7 @@ var init_statusline = __esm({
|
|
|
336
364
|
showConflicts: import_zod.z.boolean().describe("Whether the segment shows !conflict when the working-copy commit has an unresolved conflict.")
|
|
337
365
|
}
|
|
338
366
|
};
|
|
367
|
+
UNSET_NOTE = "A layer may write null to return it to unset when a shallower layer sets it.";
|
|
339
368
|
StatuslineSchema = import_zod.z.strictObject({
|
|
340
369
|
layout: import_zod.z.strictObject(SHAPES.layout).partial().optional(),
|
|
341
370
|
model: import_zod.z.strictObject(SHAPES.model).partial().optional(),
|
|
@@ -343,6 +372,7 @@ var init_statusline = __esm({
|
|
|
343
372
|
account: import_zod.z.strictObject(SHAPES.account).partial().optional(),
|
|
344
373
|
effort: import_zod.z.strictObject(SHAPES.effort).partial().optional(),
|
|
345
374
|
advisor: import_zod.z.strictObject(SHAPES.advisor).partial().optional(),
|
|
375
|
+
context: import_zod.z.strictObject({ ...SHAPES.context, warnAt: unsettable(SHAPES.context.warnAt), criticalAt: unsettable(SHAPES.context.criticalAt), autoCompactWindow: unsettable(SHAPES.context.autoCompactWindow) }).partial().optional(),
|
|
346
376
|
bands: import_zod.z.strictObject(SHAPES.bands).partial().optional(),
|
|
347
377
|
labels: import_zod.z.strictObject(SHAPES.labels).partial().optional(),
|
|
348
378
|
bar: import_zod.z.strictObject(SHAPES.bar).partial().optional(),
|
|
@@ -364,6 +394,7 @@ var init_statusline = __esm({
|
|
|
364
394
|
account: import_zod.z.strictObject(SHAPES.account),
|
|
365
395
|
effort: import_zod.z.strictObject(SHAPES.effort),
|
|
366
396
|
advisor: import_zod.z.strictObject(SHAPES.advisor),
|
|
397
|
+
context: import_zod.z.strictObject(SHAPES.context),
|
|
367
398
|
bands: import_zod.z.strictObject(SHAPES.bands),
|
|
368
399
|
labels: import_zod.z.strictObject(SHAPES.labels),
|
|
369
400
|
bar: import_zod.z.strictObject(SHAPES.bar),
|
|
@@ -385,6 +416,7 @@ var init_statusline = __esm({
|
|
|
385
416
|
account: { parts: ["user", "organisation", "plan"], userLength: 0 },
|
|
386
417
|
effort: { format: "full" },
|
|
387
418
|
advisor: { override: "" },
|
|
419
|
+
context: { bar: "shown", value: "both", estimate: "never", breakdown: "never" },
|
|
388
420
|
bands: { warnAt: 70, criticalAt: 90 },
|
|
389
421
|
labels: { fiveHour: "5h", sevenDay: "Wk" },
|
|
390
422
|
bar: { width: 10, filled: "\u2588", empty: "\u2591" },
|
|
@@ -4476,7 +4508,7 @@ var init_package = __esm({
|
|
|
4476
4508
|
"package.json"() {
|
|
4477
4509
|
package_default = {
|
|
4478
4510
|
name: "claude-use",
|
|
4479
|
-
version: "11.
|
|
4511
|
+
version: "11.60.0",
|
|
4480
4512
|
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.",
|
|
4481
4513
|
license: "MIT",
|
|
4482
4514
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -7669,8 +7701,10 @@ function valueAt(source, path43) {
|
|
|
7669
7701
|
}
|
|
7670
7702
|
return current;
|
|
7671
7703
|
}
|
|
7672
|
-
function keyOf(path43,
|
|
7673
|
-
const
|
|
7704
|
+
function keyOf(path43, declared) {
|
|
7705
|
+
const optional = declared instanceof import_zod15.z.ZodOptional;
|
|
7706
|
+
const leaf = optional ? declared.unwrap() : declared;
|
|
7707
|
+
const common = { path: path43.join("."), description: declared.description ?? "", defaultValue: valueAt(STATUSLINE_DEFAULTS, path43), optional };
|
|
7674
7708
|
if (leaf instanceof import_zod15.z.ZodNumber) {
|
|
7675
7709
|
return { ...common, kind: "integer", choices: [] };
|
|
7676
7710
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -150,34 +150,48 @@ function distinctList(member) {
|
|
|
150
150
|
function isSingleVisibleGrapheme(text) {
|
|
151
151
|
return graphemesOf(text).length === 1 && stringWidth2(text) === 1 && !/[\p{C}\p{Z}]/u.test(text) && !drawsNothing(text);
|
|
152
152
|
}
|
|
153
|
+
function unsettable(setting) {
|
|
154
|
+
return setting.unwrap().nullable().optional().describe(`${setting.description ?? ""} ${UNSET_NOTE}`);
|
|
155
|
+
}
|
|
153
156
|
function isPlainObject(value) {
|
|
154
157
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
155
158
|
}
|
|
156
159
|
function mergeStatuslineSettings(base, over) {
|
|
157
|
-
if (!isPlainObject(
|
|
160
|
+
if (!isPlainObject(over)) {
|
|
158
161
|
return over === void 0 ? base : over;
|
|
159
162
|
}
|
|
160
|
-
const merged = { ...base };
|
|
163
|
+
const merged = isPlainObject(base) ? { ...base } : {};
|
|
161
164
|
for (const [key, value] of Object.entries(over)) {
|
|
162
|
-
|
|
165
|
+
if (value === null) {
|
|
166
|
+
Reflect.deleteProperty(merged, key);
|
|
167
|
+
} else {
|
|
168
|
+
merged[key] = mergeStatuslineSettings(merged[key], value);
|
|
169
|
+
}
|
|
163
170
|
}
|
|
164
171
|
return merged;
|
|
165
172
|
}
|
|
173
|
+
function contextBands({ bands, context }) {
|
|
174
|
+
return { warnAt: context.warnAt ?? bands.warnAt, criticalAt: context.criticalAt ?? bands.criticalAt };
|
|
175
|
+
}
|
|
166
176
|
function resolveStatusline(settings) {
|
|
167
177
|
const resolved = ResolvedStatuslineSchema.parse(mergeStatuslineSettings(STATUSLINE_DEFAULTS, settings));
|
|
168
178
|
if (resolved.bands.warnAt >= resolved.bands.criticalAt) {
|
|
169
179
|
throw new RangeError(`statusline bands.warnAt (${String(resolved.bands.warnAt)}) must be below bands.criticalAt (${String(resolved.bands.criticalAt)})`);
|
|
170
180
|
}
|
|
181
|
+
const forContext = contextBands(resolved);
|
|
182
|
+
if (forContext.warnAt >= forContext.criticalAt) {
|
|
183
|
+
throw new RangeError(`statusline context.warnAt (${String(forContext.warnAt)}) must be below context.criticalAt (${String(forContext.criticalAt)}), each following bands while it is unset`);
|
|
184
|
+
}
|
|
171
185
|
return resolved;
|
|
172
186
|
}
|
|
173
|
-
var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_SESSION_TIME_PARTS, PROMPT_CACHE_TTL_SECONDS, STATUSLINE_COLOUR_NAMES, DEFAULT_HEADER_SEGMENTS, DEFAULT_ROWS, STATUSLINE_PATH_LEVELS, STATUSLINE_USAGE_VALUES, STATUSLINE_TIME_FORMATS, STATUSLINE_HOUR_CYCLES, MAX_PERCENT, MAX_STATUSLINE_PALETTE_INDEX, MAX_STATUSLINE_LABEL_COLUMNS, MAX_BAR_CELLS, MAX_ACCOUNT_USER_CHARS, MAX_DISPLAY_TEXT_CHARS, LABEL_RE2, OPTIONAL_LABEL_RE, colourValue, barCharacter, labelText, overrideText, wholePercent, thresholdPercent, SHAPES, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
|
|
187
|
+
var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_SESSION_TIME_PARTS, PROMPT_CACHE_TTL_SECONDS, STATUSLINE_COLOUR_NAMES, DEFAULT_HEADER_SEGMENTS, DEFAULT_ROWS, STATUSLINE_PATH_LEVELS, STATUSLINE_USAGE_VALUES, STATUSLINE_TIME_FORMATS, STATUSLINE_HOUR_CYCLES, MAX_PERCENT, MAX_STATUSLINE_PALETTE_INDEX, MAX_STATUSLINE_LABEL_COLUMNS, MAX_BAR_CELLS, MAX_ACCOUNT_USER_CHARS, MAX_DISPLAY_TEXT_CHARS, LABEL_RE2, OPTIONAL_LABEL_RE, colourValue, barCharacter, STATUSLINE_CONTEXT_VALUES, STATUSLINE_CONTEXT_ESTIMATES, AUTOCOMPACT_RESERVE_FRACTION, AUTOCOMPACT_RESERVE_RAMP_START, AUTOCOMPACT_RESERVE_RAMP_END, labelText, overrideText, wholePercent, thresholdPercent, SHAPES, UNSET_NOTE, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
|
|
174
188
|
var init_statusline = __esm({
|
|
175
189
|
"src/config/statusline.ts"() {
|
|
176
190
|
"use strict";
|
|
177
191
|
init_blank();
|
|
178
192
|
init_graphemes();
|
|
179
193
|
STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom", "project", "vcs", "effort", "advisor", "version", "outputStyle", "cost", "dailyCost", "sessionName", "duration", "speed"];
|
|
180
|
-
STATUSLINE_ROWS = ["context", "quota", "addedDirs", "gitFiles", "memory", "environment", "sessionTime", "promptCache", "compactions"];
|
|
194
|
+
STATUSLINE_ROWS = ["context", "quota", "addedDirs", "gitFiles", "memory", "environment", "sessionTime", "promptCache", "compactions", "tokens"];
|
|
181
195
|
STATUSLINE_SESSION_TIME_PARTS = ["started", "lastReply"];
|
|
182
196
|
PROMPT_CACHE_TTL_SECONDS = { fiveMinutes: 300, oneHour: 3600 };
|
|
183
197
|
STATUSLINE_COLOUR_NAMES = [
|
|
@@ -216,6 +230,11 @@ var init_statusline = __esm({
|
|
|
216
230
|
OPTIONAL_LABEL_RE = /^(?:[^\p{C}\p{Z}]+(?: [^\p{C}\p{Z}]+)*)?$/u;
|
|
217
231
|
colourValue = z.union([z.enum(STATUSLINE_COLOUR_NAMES), z.number().int().min(0).max(MAX_STATUSLINE_PALETTE_INDEX), z.string().regex(/^#[0-9a-fA-F]{6}$/, "must be a colour name, a palette index from 0 to 255 or #rrggbb")]);
|
|
218
232
|
barCharacter = z.string().refine(isSingleVisibleGrapheme, "must be a single visible character that takes one terminal column");
|
|
233
|
+
STATUSLINE_CONTEXT_VALUES = ["both", "percent", "tokens", "remaining"];
|
|
234
|
+
STATUSLINE_CONTEXT_ESTIMATES = ["never", "raw", "buffered"];
|
|
235
|
+
AUTOCOMPACT_RESERVE_FRACTION = 0.165;
|
|
236
|
+
AUTOCOMPACT_RESERVE_RAMP_START = 0.05;
|
|
237
|
+
AUTOCOMPACT_RESERVE_RAMP_END = 0.5;
|
|
219
238
|
labelText = z.string().refine((text) => stringWidth2(text) <= MAX_STATUSLINE_LABEL_COLUMNS, `must take no more than ${String(MAX_STATUSLINE_LABEL_COLUMNS)} terminal columns`).refine((text) => !drawsNothing(text), "must show something: a label of only combining marks or blank characters draws nothing").regex(LABEL_RE2, "must be visible text without control characters");
|
|
220
239
|
overrideText = z.string().max(MAX_DISPLAY_TEXT_CHARS).regex(OPTIONAL_LABEL_RE, "must be visible text without control characters");
|
|
221
240
|
wholePercent = z.number().int().min(1).max(MAX_PERCENT);
|
|
@@ -243,6 +262,15 @@ var init_statusline = __esm({
|
|
|
243
262
|
advisor: {
|
|
244
263
|
override: overrideText.describe("A name to show for the advisor model in place of the one the session's transcript records; empty shows the transcript's, prettified.")
|
|
245
264
|
},
|
|
265
|
+
context: {
|
|
266
|
+
bar: z.enum(["shown", "hidden"]).describe("Whether the context row draws its bar, or only its figures on one line of text."),
|
|
267
|
+
value: z.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)."),
|
|
268
|
+
warnAt: wholePercent.optional().describe("The whole percentage of the context window at which the context bar turns yellow; while it is unset the context bar follows bands.warnAt."),
|
|
269
|
+
criticalAt: wholePercent.optional().describe("The whole percentage of the context window at which the context bar turns red and, with context.breakdown set to critical, the token breakdown appears; while it is unset the context bar follows bands.criticalAt."),
|
|
270
|
+
autoCompactWindow: z.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."),
|
|
271
|
+
estimate: z.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, 0 included, is drawn as it is, and none reported 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)}%).`),
|
|
272
|
+
breakdown: z.enum(["never", "critical"]).describe("Whether to add the input and cache tokens of the last request to the context row once its use reaches context.criticalAt.")
|
|
273
|
+
},
|
|
246
274
|
bands: {
|
|
247
275
|
warnAt: wholePercent.describe("The whole percentage of use at which a bar turns yellow; it must be below criticalAt."),
|
|
248
276
|
criticalAt: wholePercent.describe("The whole percentage of use at which a bar turns red.")
|
|
@@ -314,6 +342,7 @@ var init_statusline = __esm({
|
|
|
314
342
|
showConflicts: z.boolean().describe("Whether the segment shows !conflict when the working-copy commit has an unresolved conflict.")
|
|
315
343
|
}
|
|
316
344
|
};
|
|
345
|
+
UNSET_NOTE = "A layer may write null to return it to unset when a shallower layer sets it.";
|
|
317
346
|
StatuslineSchema = z.strictObject({
|
|
318
347
|
layout: z.strictObject(SHAPES.layout).partial().optional(),
|
|
319
348
|
model: z.strictObject(SHAPES.model).partial().optional(),
|
|
@@ -321,6 +350,7 @@ var init_statusline = __esm({
|
|
|
321
350
|
account: z.strictObject(SHAPES.account).partial().optional(),
|
|
322
351
|
effort: z.strictObject(SHAPES.effort).partial().optional(),
|
|
323
352
|
advisor: z.strictObject(SHAPES.advisor).partial().optional(),
|
|
353
|
+
context: z.strictObject({ ...SHAPES.context, warnAt: unsettable(SHAPES.context.warnAt), criticalAt: unsettable(SHAPES.context.criticalAt), autoCompactWindow: unsettable(SHAPES.context.autoCompactWindow) }).partial().optional(),
|
|
324
354
|
bands: z.strictObject(SHAPES.bands).partial().optional(),
|
|
325
355
|
labels: z.strictObject(SHAPES.labels).partial().optional(),
|
|
326
356
|
bar: z.strictObject(SHAPES.bar).partial().optional(),
|
|
@@ -342,6 +372,7 @@ var init_statusline = __esm({
|
|
|
342
372
|
account: z.strictObject(SHAPES.account),
|
|
343
373
|
effort: z.strictObject(SHAPES.effort),
|
|
344
374
|
advisor: z.strictObject(SHAPES.advisor),
|
|
375
|
+
context: z.strictObject(SHAPES.context),
|
|
345
376
|
bands: z.strictObject(SHAPES.bands),
|
|
346
377
|
labels: z.strictObject(SHAPES.labels),
|
|
347
378
|
bar: z.strictObject(SHAPES.bar),
|
|
@@ -363,6 +394,7 @@ var init_statusline = __esm({
|
|
|
363
394
|
account: { parts: ["user", "organisation", "plan"], userLength: 0 },
|
|
364
395
|
effort: { format: "full" },
|
|
365
396
|
advisor: { override: "" },
|
|
397
|
+
context: { bar: "shown", value: "both", estimate: "never", breakdown: "never" },
|
|
366
398
|
bands: { warnAt: 70, criticalAt: 90 },
|
|
367
399
|
labels: { fiveHour: "5h", sevenDay: "Wk" },
|
|
368
400
|
bar: { width: 10, filled: "\u2588", empty: "\u2591" },
|
|
@@ -4452,7 +4484,7 @@ var init_package = __esm({
|
|
|
4452
4484
|
"package.json"() {
|
|
4453
4485
|
package_default = {
|
|
4454
4486
|
name: "claude-use",
|
|
4455
|
-
version: "11.
|
|
4487
|
+
version: "11.60.0",
|
|
4456
4488
|
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.",
|
|
4457
4489
|
license: "MIT",
|
|
4458
4490
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -7646,8 +7678,10 @@ function valueAt(source, path43) {
|
|
|
7646
7678
|
}
|
|
7647
7679
|
return current;
|
|
7648
7680
|
}
|
|
7649
|
-
function keyOf(path43,
|
|
7650
|
-
const
|
|
7681
|
+
function keyOf(path43, declared) {
|
|
7682
|
+
const optional = declared instanceof z15.ZodOptional;
|
|
7683
|
+
const leaf = optional ? declared.unwrap() : declared;
|
|
7684
|
+
const common = { path: path43.join("."), description: declared.description ?? "", defaultValue: valueAt(STATUSLINE_DEFAULTS, path43), optional };
|
|
7651
7685
|
if (leaf instanceof z15.ZodNumber) {
|
|
7652
7686
|
return { ...common, kind: "integer", choices: [] };
|
|
7653
7687
|
}
|