claude-use 11.56.0 → 11.57.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/index.cjs CHANGED
@@ -198,8 +198,8 @@ var init_statusline = __esm({
198
198
  import_zod = require("zod");
199
199
  init_blank();
200
200
  init_graphemes();
201
- STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom", "project", "vcs", "effort", "advisor", "version", "outputStyle"];
202
- STATUSLINE_ROWS = ["context", "quota", "addedDirs", "gitFiles"];
201
+ STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom", "project", "vcs", "effort", "advisor", "version", "outputStyle", "cost", "dailyCost"];
202
+ STATUSLINE_ROWS = ["context", "quota", "addedDirs", "gitFiles", "memory", "environment"];
203
203
  STATUSLINE_COLOUR_NAMES = [
204
204
  "default",
205
205
  "dim",
@@ -290,6 +290,12 @@ var init_statusline = __esm({
290
290
  hourCycle: import_zod.z.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)."),
291
291
  seconds: import_zod.z.boolean().describe("Whether a wall-clock time includes seconds (`14:30:07`).")
292
292
  },
293
+ cost: {
294
+ routed: import_zod.z.boolean().describe("Whether the cost segments draw for a session routed through a provider or a cloud platform's model id, where the client's own figure is not what was billed; the figure drawn is then priced from the door's usage log with `agent-shim model price`, else the client's own when it is above zero.")
295
+ },
296
+ environment: {
297
+ threshold: import_zod.z.number().int().min(0).describe("The fewest configuration items in total (CLAUDE.md files, rules, MCP servers and hook events) that must exist for the environment row to draw its counts.")
298
+ },
293
299
  colours: {
294
300
  context: colourValue.describe("The colour of the context bar and its figures below the warning threshold."),
295
301
  usage: colourValue.describe("The colour of the quota bars and their figures below the warning threshold."),
@@ -334,6 +340,8 @@ var init_statusline = __esm({
334
340
  bar: import_zod.z.strictObject(SHAPES.bar).partial().optional(),
335
341
  usage: import_zod.z.strictObject(SHAPES.usage).partial().optional(),
336
342
  clock: import_zod.z.strictObject(SHAPES.clock).partial().optional(),
343
+ cost: import_zod.z.strictObject(SHAPES.cost).partial().optional(),
344
+ environment: import_zod.z.strictObject(SHAPES.environment).partial().optional(),
337
345
  colours: import_zod.z.strictObject(SHAPES.colours).partial().optional(),
338
346
  project: import_zod.z.strictObject(SHAPES.project).partial().optional(),
339
347
  git: import_zod.z.strictObject(SHAPES.git).partial().optional(),
@@ -351,6 +359,8 @@ var init_statusline = __esm({
351
359
  bar: import_zod.z.strictObject(SHAPES.bar),
352
360
  usage: import_zod.z.strictObject(SHAPES.usage),
353
361
  clock: import_zod.z.strictObject(SHAPES.clock),
362
+ cost: import_zod.z.strictObject(SHAPES.cost),
363
+ environment: import_zod.z.strictObject(SHAPES.environment),
354
364
  colours: import_zod.z.strictObject(SHAPES.colours),
355
365
  project: import_zod.z.strictObject(SHAPES.project),
356
366
  git: import_zod.z.strictObject(SHAPES.git),
@@ -368,6 +378,8 @@ var init_statusline = __esm({
368
378
  bar: { width: 10, filled: "\u2588", empty: "\u2591" },
369
379
  usage: { value: "used", bar: true, compact: false, resetLabel: false, modelScoped: false, timeFormat: "relative", threshold: 0, sevenDayThreshold: 0 },
370
380
  clock: { hourCycle: "auto", seconds: false },
381
+ cost: { routed: false },
382
+ environment: { threshold: 0 },
371
383
  colours: {
372
384
  context: "green",
373
385
  usage: "green",
@@ -4450,7 +4462,7 @@ var init_package = __esm({
4450
4462
  "package.json"() {
4451
4463
  package_default = {
4452
4464
  name: "claude-use",
4453
- version: "11.56.0",
4465
+ version: "11.57.0",
4454
4466
  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.",
4455
4467
  license: "MIT",
4456
4468
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -6391,7 +6403,7 @@ var init_identity = __esm({
6391
6403
  });
6392
6404
 
6393
6405
  // src/usage/schema.ts
6394
- var import_zod11, USAGE_SCHEMA_VERSION, VersionSchema, InstantSchema, TokenCountSchema, TokenUsageSchema, LIMIT_KINDS, LimitClassificationSchema, UsageRecordSchema, QuotaWindowSchema, ExtraUsageSpendSchema, UnifiedRateLimitSchema, RateLimitStateSchema, LimitEventSchema, ProviderQuotaWindowSchema, ProviderAccountSchema, ProviderQuotaSchema, ProviderUsageStateSchema, AccountMetadataSchema, UsageSnapshotSchema;
6406
+ var import_zod11, USAGE_SCHEMA_VERSION, VersionSchema, InstantSchema, CLIENT_SESSION_ID_PATTERN, TokenCountSchema, TokenUsageSchema, LIMIT_KINDS, LimitClassificationSchema, UsageRecordSchema, QuotaWindowSchema, ExtraUsageSpendSchema, UnifiedRateLimitSchema, RateLimitStateSchema, LimitEventSchema, ProviderQuotaWindowSchema, ProviderAccountSchema, ProviderQuotaSchema, ProviderUsageStateSchema, AccountMetadataSchema, UsageSnapshotSchema;
6395
6407
  var init_schema2 = __esm({
6396
6408
  "src/usage/schema.ts"() {
6397
6409
  "use strict";
@@ -6399,6 +6411,7 @@ var init_schema2 = __esm({
6399
6411
  USAGE_SCHEMA_VERSION = 1;
6400
6412
  VersionSchema = import_zod11.z.literal(USAGE_SCHEMA_VERSION);
6401
6413
  InstantSchema = import_zod11.z.iso.datetime();
6414
+ CLIENT_SESSION_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
6402
6415
  TokenCountSchema = import_zod11.z.number().int().nonnegative();
6403
6416
  TokenUsageSchema = import_zod11.z.strictObject({
6404
6417
  inputTokens: TokenCountSchema.optional(),
@@ -6428,6 +6441,8 @@ var init_schema2 = __esm({
6428
6441
  provider: import_zod11.z.string(),
6429
6442
  /** The launch's session id, generated per launch. */
6430
6443
  sessionId: import_zod11.z.string().optional(),
6444
+ /** The client's own id for the conversation, from the request's `x-claude-code-session-id` header: it changes when the conversation is cleared inside one launch, which `sessionId` does not, so it is what ties a request to the client's per-conversation figures. Absent when the client sent none. */
6445
+ clientSessionId: import_zod11.z.string().regex(CLIENT_SESSION_ID_PATTERN).optional(),
6431
6446
  /** The project the launch ran in (its git repository root), when the launch sent one: headroom launches do. */
6432
6447
  project: import_zod11.z.string().optional(),
6433
6448
  /** Whether the request crossed headroom on its way upstream. Absent on a record written before the door recorded it, and false when the request went direct. */
@@ -7983,6 +7998,7 @@ function buildLayoutPaths(root) {
7983
7998
  usageDir: import_node_path23.default.join(root, "usage"),
7984
7999
  usageLogDir: import_node_path23.default.join(root, "usage", "log"),
7985
8000
  usageSnapshotsDir: import_node_path23.default.join(root, "usage", "snapshots"),
8001
+ statuslineDir: import_node_path23.default.join(root, "statusline"),
7986
8002
  catalogueDir: import_node_path23.default.join(root, "catalogues"),
7987
8003
  usagePicksFile: import_node_path23.default.join(root, "usage", "picks.json"),
7988
8004
  usageAnchorsFile: import_node_path23.default.join(root, "usage", "anchors.json"),
@@ -11626,8 +11642,11 @@ var init_doorLog = __esm({
11626
11642
  });
11627
11643
 
11628
11644
  // src/frontdoor/selfIdentity.ts
11645
+ function isDeclaredFrontDoor(pid) {
11646
+ return declaredPid !== void 0 && pid === declaredPid && pid === process.pid;
11647
+ }
11629
11648
  function isFrontDoorSupervisorPid(pid, identify) {
11630
- return declaredPid !== void 0 && pid === declaredPid && pid === process.pid || identify(pid);
11649
+ return isDeclaredFrontDoor(pid) || identify(pid);
11631
11650
  }
11632
11651
  var declaredPid;
11633
11652
  var init_selfIdentity = __esm({
@@ -11678,7 +11697,8 @@ var init_trust = __esm({
11678
11697
  function realEnsurePorts(paths, spawnDaemon) {
11679
11698
  return {
11680
11699
  fs: realFarmFs,
11681
- isRunning: realIsProcessRunning,
11700
+ // The door plans launches of its own (the usage probe, the window opener, jobs), and asked whether the supervisor the state file names is running, the answer for itself is known: a synchronous `ps` here would hold the loop that answers every session.
11701
+ isRunning: (pid) => isDeclaredFrontDoor(pid) || realIsProcessRunning(pid),
11682
11702
  now: () => Date.now(),
11683
11703
  sleep: realSleepSync,
11684
11704
  spawnSupervisor: (layout) => spawnDaemon(layout, "__frontdoor-supervisor", layout.frontdoorLogPath),
package/dist/index.mjs CHANGED
@@ -176,8 +176,8 @@ var init_statusline = __esm({
176
176
  "use strict";
177
177
  init_blank();
178
178
  init_graphemes();
179
- STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom", "project", "vcs", "effort", "advisor", "version", "outputStyle"];
180
- STATUSLINE_ROWS = ["context", "quota", "addedDirs", "gitFiles"];
179
+ STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom", "project", "vcs", "effort", "advisor", "version", "outputStyle", "cost", "dailyCost"];
180
+ STATUSLINE_ROWS = ["context", "quota", "addedDirs", "gitFiles", "memory", "environment"];
181
181
  STATUSLINE_COLOUR_NAMES = [
182
182
  "default",
183
183
  "dim",
@@ -268,6 +268,12 @@ var init_statusline = __esm({
268
268
  hourCycle: z.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)."),
269
269
  seconds: z.boolean().describe("Whether a wall-clock time includes seconds (`14:30:07`).")
270
270
  },
271
+ cost: {
272
+ routed: z.boolean().describe("Whether the cost segments draw for a session routed through a provider or a cloud platform's model id, where the client's own figure is not what was billed; the figure drawn is then priced from the door's usage log with `agent-shim model price`, else the client's own when it is above zero.")
273
+ },
274
+ environment: {
275
+ threshold: z.number().int().min(0).describe("The fewest configuration items in total (CLAUDE.md files, rules, MCP servers and hook events) that must exist for the environment row to draw its counts.")
276
+ },
271
277
  colours: {
272
278
  context: colourValue.describe("The colour of the context bar and its figures below the warning threshold."),
273
279
  usage: colourValue.describe("The colour of the quota bars and their figures below the warning threshold."),
@@ -312,6 +318,8 @@ var init_statusline = __esm({
312
318
  bar: z.strictObject(SHAPES.bar).partial().optional(),
313
319
  usage: z.strictObject(SHAPES.usage).partial().optional(),
314
320
  clock: z.strictObject(SHAPES.clock).partial().optional(),
321
+ cost: z.strictObject(SHAPES.cost).partial().optional(),
322
+ environment: z.strictObject(SHAPES.environment).partial().optional(),
315
323
  colours: z.strictObject(SHAPES.colours).partial().optional(),
316
324
  project: z.strictObject(SHAPES.project).partial().optional(),
317
325
  git: z.strictObject(SHAPES.git).partial().optional(),
@@ -329,6 +337,8 @@ var init_statusline = __esm({
329
337
  bar: z.strictObject(SHAPES.bar),
330
338
  usage: z.strictObject(SHAPES.usage),
331
339
  clock: z.strictObject(SHAPES.clock),
340
+ cost: z.strictObject(SHAPES.cost),
341
+ environment: z.strictObject(SHAPES.environment),
332
342
  colours: z.strictObject(SHAPES.colours),
333
343
  project: z.strictObject(SHAPES.project),
334
344
  git: z.strictObject(SHAPES.git),
@@ -346,6 +356,8 @@ var init_statusline = __esm({
346
356
  bar: { width: 10, filled: "\u2588", empty: "\u2591" },
347
357
  usage: { value: "used", bar: true, compact: false, resetLabel: false, modelScoped: false, timeFormat: "relative", threshold: 0, sevenDayThreshold: 0 },
348
358
  clock: { hourCycle: "auto", seconds: false },
359
+ cost: { routed: false },
360
+ environment: { threshold: 0 },
349
361
  colours: {
350
362
  context: "green",
351
363
  usage: "green",
@@ -4426,7 +4438,7 @@ var init_package = __esm({
4426
4438
  "package.json"() {
4427
4439
  package_default = {
4428
4440
  name: "claude-use",
4429
- version: "11.56.0",
4441
+ version: "11.57.0",
4430
4442
  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.",
4431
4443
  license: "MIT",
4432
4444
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -6366,13 +6378,14 @@ var init_identity = __esm({
6366
6378
 
6367
6379
  // src/usage/schema.ts
6368
6380
  import { z as z11 } from "zod";
6369
- var USAGE_SCHEMA_VERSION, VersionSchema, InstantSchema, TokenCountSchema, TokenUsageSchema, LIMIT_KINDS, LimitClassificationSchema, UsageRecordSchema, QuotaWindowSchema, ExtraUsageSpendSchema, UnifiedRateLimitSchema, RateLimitStateSchema, LimitEventSchema, ProviderQuotaWindowSchema, ProviderAccountSchema, ProviderQuotaSchema, ProviderUsageStateSchema, AccountMetadataSchema, UsageSnapshotSchema;
6381
+ var USAGE_SCHEMA_VERSION, VersionSchema, InstantSchema, CLIENT_SESSION_ID_PATTERN, TokenCountSchema, TokenUsageSchema, LIMIT_KINDS, LimitClassificationSchema, UsageRecordSchema, QuotaWindowSchema, ExtraUsageSpendSchema, UnifiedRateLimitSchema, RateLimitStateSchema, LimitEventSchema, ProviderQuotaWindowSchema, ProviderAccountSchema, ProviderQuotaSchema, ProviderUsageStateSchema, AccountMetadataSchema, UsageSnapshotSchema;
6370
6382
  var init_schema2 = __esm({
6371
6383
  "src/usage/schema.ts"() {
6372
6384
  "use strict";
6373
6385
  USAGE_SCHEMA_VERSION = 1;
6374
6386
  VersionSchema = z11.literal(USAGE_SCHEMA_VERSION);
6375
6387
  InstantSchema = z11.iso.datetime();
6388
+ CLIENT_SESSION_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
6376
6389
  TokenCountSchema = z11.number().int().nonnegative();
6377
6390
  TokenUsageSchema = z11.strictObject({
6378
6391
  inputTokens: TokenCountSchema.optional(),
@@ -6402,6 +6415,8 @@ var init_schema2 = __esm({
6402
6415
  provider: z11.string(),
6403
6416
  /** The launch's session id, generated per launch. */
6404
6417
  sessionId: z11.string().optional(),
6418
+ /** The client's own id for the conversation, from the request's `x-claude-code-session-id` header: it changes when the conversation is cleared inside one launch, which `sessionId` does not, so it is what ties a request to the client's per-conversation figures. Absent when the client sent none. */
6419
+ clientSessionId: z11.string().regex(CLIENT_SESSION_ID_PATTERN).optional(),
6405
6420
  /** The project the launch ran in (its git repository root), when the launch sent one: headroom launches do. */
6406
6421
  project: z11.string().optional(),
6407
6422
  /** Whether the request crossed headroom on its way upstream. Absent on a record written before the door recorded it, and false when the request went direct. */
@@ -7959,6 +7974,7 @@ function buildLayoutPaths(root) {
7959
7974
  usageDir: path23.join(root, "usage"),
7960
7975
  usageLogDir: path23.join(root, "usage", "log"),
7961
7976
  usageSnapshotsDir: path23.join(root, "usage", "snapshots"),
7977
+ statuslineDir: path23.join(root, "statusline"),
7962
7978
  catalogueDir: path23.join(root, "catalogues"),
7963
7979
  usagePicksFile: path23.join(root, "usage", "picks.json"),
7964
7980
  usageAnchorsFile: path23.join(root, "usage", "anchors.json"),
@@ -11595,8 +11611,11 @@ var init_doorLog = __esm({
11595
11611
  });
11596
11612
 
11597
11613
  // src/frontdoor/selfIdentity.ts
11614
+ function isDeclaredFrontDoor(pid) {
11615
+ return declaredPid !== void 0 && pid === declaredPid && pid === process.pid;
11616
+ }
11598
11617
  function isFrontDoorSupervisorPid(pid, identify) {
11599
- return declaredPid !== void 0 && pid === declaredPid && pid === process.pid || identify(pid);
11618
+ return isDeclaredFrontDoor(pid) || identify(pid);
11600
11619
  }
11601
11620
  var declaredPid;
11602
11621
  var init_selfIdentity = __esm({
@@ -11648,7 +11667,8 @@ import fs13 from "node:fs";
11648
11667
  function realEnsurePorts(paths, spawnDaemon) {
11649
11668
  return {
11650
11669
  fs: realFarmFs,
11651
- isRunning: realIsProcessRunning,
11670
+ // The door plans launches of its own (the usage probe, the window opener, jobs), and asked whether the supervisor the state file names is running, the answer for itself is known: a synchronous `ps` here would hold the loop that answers every session.
11671
+ isRunning: (pid) => isDeclaredFrontDoor(pid) || realIsProcessRunning(pid),
11652
11672
  now: () => Date.now(),
11653
11673
  sleep: realSleepSync,
11654
11674
  spawnSupervisor: (layout) => spawnDaemon(layout, "__frontdoor-supervisor", layout.frontdoorLogPath),