agent-shim 11.51.0 → 11.52.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -142,6 +142,9 @@ var init_proxyBypass = __esm({
142
142
  function distinctList(member) {
143
143
  return import_zod.z.array(member).refine((items) => new Set(items).size === items.length, "must not repeat a segment");
144
144
  }
145
+ function isSingleVisibleGrapheme(text) {
146
+ return [...GRAPHEMES.segment(text)].length === 1 && !/[\p{C}\p{Z}]/u.test(text);
147
+ }
145
148
  function isPlainObject(value) {
146
149
  return typeof value === "object" && value !== null && !Array.isArray(value);
147
150
  }
@@ -162,17 +165,41 @@ function resolveStatusline(settings) {
162
165
  }
163
166
  return resolved;
164
167
  }
165
- var import_zod, STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, MAX_PERCENT, MAX_STATUSLINE_LABEL_CHARS, MAX_BAR_CELLS, LABEL_RE2, labelText, wholePercent, SHAPES, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
168
+ var import_zod, STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_COLOUR_NAMES, MAX_PERCENT, MAX_STATUSLINE_PALETTE_INDEX, MAX_STATUSLINE_LABEL_CHARS, MAX_BAR_CELLS, LABEL_RE2, colourValue, GRAPHEMES, barCharacter, labelText, wholePercent, SHAPES, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
166
169
  var init_statusline = __esm({
167
170
  "src/config/statusline.ts"() {
168
171
  "use strict";
169
172
  import_zod = require("zod");
170
173
  STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom"];
171
174
  STATUSLINE_ROWS = ["context", "quota"];
175
+ STATUSLINE_COLOUR_NAMES = [
176
+ "default",
177
+ "dim",
178
+ "black",
179
+ "red",
180
+ "green",
181
+ "yellow",
182
+ "blue",
183
+ "magenta",
184
+ "cyan",
185
+ "white",
186
+ "brightBlack",
187
+ "brightRed",
188
+ "brightGreen",
189
+ "brightYellow",
190
+ "brightBlue",
191
+ "brightMagenta",
192
+ "brightCyan",
193
+ "brightWhite"
194
+ ];
172
195
  MAX_PERCENT = 100;
196
+ MAX_STATUSLINE_PALETTE_INDEX = 255;
173
197
  MAX_STATUSLINE_LABEL_CHARS = 12;
174
198
  MAX_BAR_CELLS = 40;
175
199
  LABEL_RE2 = /^[^\p{C}\p{Z}]+(?: [^\p{C}\p{Z}]+)*$/u;
200
+ 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")]);
201
+ GRAPHEMES = new Intl.Segmenter(void 0, { granularity: "grapheme" });
202
+ barCharacter = import_zod.z.string().refine(isSingleVisibleGrapheme, "must be a single visible character");
176
203
  labelText = import_zod.z.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters");
177
204
  wholePercent = import_zod.z.number().int().min(1).max(MAX_PERCENT);
178
205
  SHAPES = {
@@ -189,26 +216,50 @@ var init_statusline = __esm({
189
216
  sevenDay: labelText.describe("The name of the weekly subscription window.")
190
217
  },
191
218
  bar: {
192
- width: import_zod.z.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.")
219
+ width: import_zod.z.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."),
220
+ filled: barCharacter.describe("The character that draws the used part of a bar."),
221
+ empty: barCharacter.describe("The character that draws the unused part of a bar.")
222
+ },
223
+ colours: {
224
+ context: colourValue.describe("The colour of the context bar and its figures below the warning threshold."),
225
+ usage: colourValue.describe("The colour of the quota bars and their figures below the warning threshold."),
226
+ warning: colourValue.describe("The colour of the context bar at or above bands.warnAt, and of a cache hit share that is middling."),
227
+ usageWarning: colourValue.describe("The colour of a quota bar at or above bands.warnAt."),
228
+ critical: colourValue.describe("The colour of a bar at or above bands.criticalAt, and of a cache hit share that is nearly nothing."),
229
+ model: colourValue.describe("The colour of the model and provider segments."),
230
+ label: colourValue.describe("The colour of labels and secondary text: row labels, and the route, account, identity and headroom segments."),
231
+ empty: colourValue.describe("The colour of the unused part of a bar.")
193
232
  }
194
233
  };
195
234
  StatuslineSchema = import_zod.z.strictObject({
196
235
  layout: import_zod.z.strictObject(SHAPES.layout).partial().optional(),
197
236
  bands: import_zod.z.strictObject(SHAPES.bands).partial().optional(),
198
237
  labels: import_zod.z.strictObject(SHAPES.labels).partial().optional(),
199
- bar: import_zod.z.strictObject(SHAPES.bar).partial().optional()
238
+ bar: import_zod.z.strictObject(SHAPES.bar).partial().optional(),
239
+ colours: import_zod.z.strictObject(SHAPES.colours).partial().optional()
200
240
  });
201
241
  ResolvedStatuslineSchema = import_zod.z.strictObject({
202
242
  layout: import_zod.z.strictObject(SHAPES.layout),
203
243
  bands: import_zod.z.strictObject(SHAPES.bands),
204
244
  labels: import_zod.z.strictObject(SHAPES.labels),
205
- bar: import_zod.z.strictObject(SHAPES.bar)
245
+ bar: import_zod.z.strictObject(SHAPES.bar),
246
+ colours: import_zod.z.strictObject(SHAPES.colours)
206
247
  });
207
248
  STATUSLINE_DEFAULTS = {
208
249
  layout: { header: [...STATUSLINE_HEADER_SEGMENTS], rows: [...STATUSLINE_ROWS] },
209
250
  bands: { warnAt: 70, criticalAt: 90 },
210
251
  labels: { fiveHour: "5h", sevenDay: "Wk" },
211
- bar: { width: 10 }
252
+ bar: { width: 10, filled: "\u2588", empty: "\u2591" },
253
+ colours: {
254
+ context: "green",
255
+ usage: "green",
256
+ warning: "yellow",
257
+ usageWarning: "yellow",
258
+ critical: "red",
259
+ model: "default",
260
+ label: "default",
261
+ empty: "brightBlack"
262
+ }
212
263
  };
213
264
  STATUSLINE_ENV = "AGENT_SHIM_STATUSLINE";
214
265
  }
@@ -4274,7 +4325,7 @@ var init_package = __esm({
4274
4325
  "package.json"() {
4275
4326
  package_default = {
4276
4327
  name: "agent-shim",
4277
- version: "11.51.0",
4328
+ version: "11.52.1",
4278
4329
  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.",
4279
4330
  license: "MIT",
4280
4331
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -7453,6 +7504,9 @@ function keyOf(path43, leaf) {
7453
7504
  if (leaf instanceof import_zod15.z.ZodString) {
7454
7505
  return { ...common, kind: "text", choices: [] };
7455
7506
  }
7507
+ if (leaf instanceof import_zod15.z.ZodUnion) {
7508
+ return { ...common, kind: "colour", choices: [...STATUSLINE_COLOUR_NAMES] };
7509
+ }
7456
7510
  if (leaf instanceof import_zod15.z.ZodEnum) {
7457
7511
  return { ...common, kind: "choice", choices: Object.values(leaf.enum).map(String) };
7458
7512
  }
package/dist/index.mjs CHANGED
@@ -121,6 +121,9 @@ import { z } from "zod";
121
121
  function distinctList(member) {
122
122
  return z.array(member).refine((items) => new Set(items).size === items.length, "must not repeat a segment");
123
123
  }
124
+ function isSingleVisibleGrapheme(text) {
125
+ return [...GRAPHEMES.segment(text)].length === 1 && !/[\p{C}\p{Z}]/u.test(text);
126
+ }
124
127
  function isPlainObject(value) {
125
128
  return typeof value === "object" && value !== null && !Array.isArray(value);
126
129
  }
@@ -141,16 +144,40 @@ function resolveStatusline(settings) {
141
144
  }
142
145
  return resolved;
143
146
  }
144
- var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, MAX_PERCENT, MAX_STATUSLINE_LABEL_CHARS, MAX_BAR_CELLS, LABEL_RE2, labelText, wholePercent, SHAPES, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
147
+ var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_COLOUR_NAMES, MAX_PERCENT, MAX_STATUSLINE_PALETTE_INDEX, MAX_STATUSLINE_LABEL_CHARS, MAX_BAR_CELLS, LABEL_RE2, colourValue, GRAPHEMES, barCharacter, labelText, wholePercent, SHAPES, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
145
148
  var init_statusline = __esm({
146
149
  "src/config/statusline.ts"() {
147
150
  "use strict";
148
151
  STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom"];
149
152
  STATUSLINE_ROWS = ["context", "quota"];
153
+ STATUSLINE_COLOUR_NAMES = [
154
+ "default",
155
+ "dim",
156
+ "black",
157
+ "red",
158
+ "green",
159
+ "yellow",
160
+ "blue",
161
+ "magenta",
162
+ "cyan",
163
+ "white",
164
+ "brightBlack",
165
+ "brightRed",
166
+ "brightGreen",
167
+ "brightYellow",
168
+ "brightBlue",
169
+ "brightMagenta",
170
+ "brightCyan",
171
+ "brightWhite"
172
+ ];
150
173
  MAX_PERCENT = 100;
174
+ MAX_STATUSLINE_PALETTE_INDEX = 255;
151
175
  MAX_STATUSLINE_LABEL_CHARS = 12;
152
176
  MAX_BAR_CELLS = 40;
153
177
  LABEL_RE2 = /^[^\p{C}\p{Z}]+(?: [^\p{C}\p{Z}]+)*$/u;
178
+ 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")]);
179
+ GRAPHEMES = new Intl.Segmenter(void 0, { granularity: "grapheme" });
180
+ barCharacter = z.string().refine(isSingleVisibleGrapheme, "must be a single visible character");
154
181
  labelText = z.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters");
155
182
  wholePercent = z.number().int().min(1).max(MAX_PERCENT);
156
183
  SHAPES = {
@@ -167,26 +194,50 @@ var init_statusline = __esm({
167
194
  sevenDay: labelText.describe("The name of the weekly subscription window.")
168
195
  },
169
196
  bar: {
170
- width: z.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.")
197
+ width: z.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."),
198
+ filled: barCharacter.describe("The character that draws the used part of a bar."),
199
+ empty: barCharacter.describe("The character that draws the unused part of a bar.")
200
+ },
201
+ colours: {
202
+ context: colourValue.describe("The colour of the context bar and its figures below the warning threshold."),
203
+ usage: colourValue.describe("The colour of the quota bars and their figures below the warning threshold."),
204
+ warning: colourValue.describe("The colour of the context bar at or above bands.warnAt, and of a cache hit share that is middling."),
205
+ usageWarning: colourValue.describe("The colour of a quota bar at or above bands.warnAt."),
206
+ critical: colourValue.describe("The colour of a bar at or above bands.criticalAt, and of a cache hit share that is nearly nothing."),
207
+ model: colourValue.describe("The colour of the model and provider segments."),
208
+ label: colourValue.describe("The colour of labels and secondary text: row labels, and the route, account, identity and headroom segments."),
209
+ empty: colourValue.describe("The colour of the unused part of a bar.")
171
210
  }
172
211
  };
173
212
  StatuslineSchema = z.strictObject({
174
213
  layout: z.strictObject(SHAPES.layout).partial().optional(),
175
214
  bands: z.strictObject(SHAPES.bands).partial().optional(),
176
215
  labels: z.strictObject(SHAPES.labels).partial().optional(),
177
- bar: z.strictObject(SHAPES.bar).partial().optional()
216
+ bar: z.strictObject(SHAPES.bar).partial().optional(),
217
+ colours: z.strictObject(SHAPES.colours).partial().optional()
178
218
  });
179
219
  ResolvedStatuslineSchema = z.strictObject({
180
220
  layout: z.strictObject(SHAPES.layout),
181
221
  bands: z.strictObject(SHAPES.bands),
182
222
  labels: z.strictObject(SHAPES.labels),
183
- bar: z.strictObject(SHAPES.bar)
223
+ bar: z.strictObject(SHAPES.bar),
224
+ colours: z.strictObject(SHAPES.colours)
184
225
  });
185
226
  STATUSLINE_DEFAULTS = {
186
227
  layout: { header: [...STATUSLINE_HEADER_SEGMENTS], rows: [...STATUSLINE_ROWS] },
187
228
  bands: { warnAt: 70, criticalAt: 90 },
188
229
  labels: { fiveHour: "5h", sevenDay: "Wk" },
189
- bar: { width: 10 }
230
+ bar: { width: 10, filled: "\u2588", empty: "\u2591" },
231
+ colours: {
232
+ context: "green",
233
+ usage: "green",
234
+ warning: "yellow",
235
+ usageWarning: "yellow",
236
+ critical: "red",
237
+ model: "default",
238
+ label: "default",
239
+ empty: "brightBlack"
240
+ }
190
241
  };
191
242
  STATUSLINE_ENV = "AGENT_SHIM_STATUSLINE";
192
243
  }
@@ -4250,7 +4301,7 @@ var init_package = __esm({
4250
4301
  "package.json"() {
4251
4302
  package_default = {
4252
4303
  name: "agent-shim",
4253
- version: "11.51.0",
4304
+ version: "11.52.1",
4254
4305
  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.",
4255
4306
  license: "MIT",
4256
4307
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -7428,6 +7479,9 @@ function keyOf(path43, leaf) {
7428
7479
  if (leaf instanceof z15.ZodString) {
7429
7480
  return { ...common, kind: "text", choices: [] };
7430
7481
  }
7482
+ if (leaf instanceof z15.ZodUnion) {
7483
+ return { ...common, kind: "colour", choices: [...STATUSLINE_COLOUR_NAMES] };
7484
+ }
7431
7485
  if (leaf instanceof z15.ZodEnum) {
7432
7486
  return { ...common, kind: "choice", choices: Object.values(leaf.enum).map(String) };
7433
7487
  }