agent-shim 10.0.2 → 10.1.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 CHANGED
@@ -33363,6 +33363,8 @@ var init_schema2 = __esm({
33363
33363
  sessionId: external_exports.string().optional(),
33364
33364
  /** The project the launch ran in (its git repository root), when the launch sent one: headroom launches do. */
33365
33365
  project: external_exports.string().optional(),
33366
+ /** 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. */
33367
+ viaHeadroom: external_exports.boolean().optional(),
33366
33368
  /** The front-door route that served the request. */
33367
33369
  route: external_exports.string(),
33368
33370
  method: external_exports.string(),
@@ -33967,7 +33969,7 @@ var init_package = __esm({
33967
33969
  "package.json"() {
33968
33970
  package_default = {
33969
33971
  name: "agent-shim",
33970
- version: "10.0.2",
33972
+ version: "10.1.0",
33971
33973
  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.",
33972
33974
  license: "MIT",
33973
33975
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -34586,6 +34588,7 @@ function buildRecord(event, context) {
34586
34588
  provider,
34587
34589
  ...sessionId === void 0 ? {} : { sessionId },
34588
34590
  ...projectId === void 0 ? {} : { project: projectId },
34591
+ viaHeadroom: event.viaHeadroom,
34589
34592
  route: event.route,
34590
34593
  method: event.method,
34591
34594
  endpoint,
@@ -126383,7 +126386,7 @@ function createRoutedResponse(response, context) {
126383
126386
  start: (status, headers) => {
126384
126387
  for (const observe of deps.responseObservers) {
126385
126388
  try {
126386
- const body = observe({ session, route, method: request7.method, path: request7.path, receivedAt: request7.receivedAt, status, headers });
126389
+ const body = observe({ session, route, method: request7.method, path: request7.path, receivedAt: request7.receivedAt, viaHeadroom: request7.viaHeadroom, status, headers });
126387
126390
  if (body !== void 0) {
126388
126391
  bodyObservers.push(body);
126389
126392
  }
@@ -126424,7 +126427,7 @@ function createRoutedResponse(response, context) {
126424
126427
  };
126425
126428
  }
126426
126429
  async function serveRouted(request7, deps) {
126427
- const observed = { method: request7.method, path: pathOf(request7.url), receivedAt: deps.now() };
126430
+ const observed = { method: request7.method, path: pathOf(request7.url), receivedAt: deps.now(), viaHeadroom: false };
126428
126431
  const identified = identifyRequest(request7.headers);
126429
126432
  const admission = deps.admit({ url: request7.url, headers: request7.headers, forwardable: identified.forwardableHeaders });
126430
126433
  if (!admission.ok) {
@@ -126450,9 +126453,10 @@ async function serveRouted(request7, deps) {
126450
126453
  response2.end();
126451
126454
  return;
126452
126455
  }
126453
- const response = createRoutedResponse(request7.response, { deps, session: identified.session, route: resolution.route.name, request: observed });
126456
+ const viaHeadroom = identified.session.headroom && resolution.route.headroomEligible && deps.headroom !== void 0;
126457
+ const response = createRoutedResponse(request7.response, { deps, session: identified.session, route: resolution.route.name, request: { ...observed, viaHeadroom } });
126454
126458
  try {
126455
- if (identified.session.headroom && resolution.route.headroomEligible && deps.headroom !== void 0) {
126459
+ if (viaHeadroom) {
126456
126460
  await applyHeadroomHop(routed, response, resolution.route.headroomUpstream, deps.headroom);
126457
126461
  } else {
126458
126462
  await resolution.route.serve(routed, response);
package/dist/index.cjs CHANGED
@@ -2758,7 +2758,7 @@ var init_package = __esm({
2758
2758
  "package.json"() {
2759
2759
  package_default = {
2760
2760
  name: "agent-shim",
2761
- version: "10.0.2",
2761
+ version: "10.1.0",
2762
2762
  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.",
2763
2763
  license: "MIT",
2764
2764
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -4624,6 +4624,8 @@ var init_schema2 = __esm({
4624
4624
  sessionId: import_zod10.z.string().optional(),
4625
4625
  /** The project the launch ran in (its git repository root), when the launch sent one: headroom launches do. */
4626
4626
  project: import_zod10.z.string().optional(),
4627
+ /** 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. */
4628
+ viaHeadroom: import_zod10.z.boolean().optional(),
4627
4629
  /** The front-door route that served the request. */
4628
4630
  route: import_zod10.z.string(),
4629
4631
  method: import_zod10.z.string(),
package/dist/index.mjs CHANGED
@@ -2734,7 +2734,7 @@ var init_package = __esm({
2734
2734
  "package.json"() {
2735
2735
  package_default = {
2736
2736
  name: "agent-shim",
2737
- version: "10.0.2",
2737
+ version: "10.1.0",
2738
2738
  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.",
2739
2739
  license: "MIT",
2740
2740
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -4598,6 +4598,8 @@ var init_schema2 = __esm({
4598
4598
  sessionId: z10.string().optional(),
4599
4599
  /** The project the launch ran in (its git repository root), when the launch sent one: headroom launches do. */
4600
4600
  project: z10.string().optional(),
4601
+ /** 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. */
4602
+ viaHeadroom: z10.boolean().optional(),
4601
4603
  /** The front-door route that served the request. */
4602
4604
  route: z10.string(),
4603
4605
  method: z10.string(),
@@ -5206,6 +5206,7 @@ declare const UsageRecordSchema: z.ZodObject<{
5206
5206
  provider: z.ZodString;
5207
5207
  sessionId: z.ZodOptional<z.ZodString>;
5208
5208
  project: z.ZodOptional<z.ZodString>;
5209
+ viaHeadroom: z.ZodOptional<z.ZodBoolean>;
5209
5210
  route: z.ZodString;
5210
5211
  method: z.ZodString;
5211
5212
  endpoint: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-shim",
3
- "version": "10.0.2",
3
+ "version": "10.1.0",
4
4
  "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.",
5
5
  "license": "MIT",
6
6
  "author": "Joseph Mearman <joseph@mearman.co.uk>",