agent-shim 7.1.1 → 7.1.2
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 +19 -2
- package/dist/types/legacy.d.ts +5 -0
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -56173,6 +56173,23 @@ function aliasLegacyEnv(env) {
|
|
|
56173
56173
|
}
|
|
56174
56174
|
return aliased;
|
|
56175
56175
|
}
|
|
56176
|
+
var WIRE_HEADER_PREFIX = "x-agent-shim-";
|
|
56177
|
+
var LEGACY_WIRE_HEADER_PREFIX = "x-claude-use-";
|
|
56178
|
+
function aliasLegacyWireHeaders(headers) {
|
|
56179
|
+
const result = {};
|
|
56180
|
+
for (const [name, value] of Object.entries(headers)) {
|
|
56181
|
+
if (!name.startsWith(LEGACY_WIRE_HEADER_PREFIX)) {
|
|
56182
|
+
result[name] = value;
|
|
56183
|
+
}
|
|
56184
|
+
}
|
|
56185
|
+
for (const [name, value] of Object.entries(headers)) {
|
|
56186
|
+
if (name.startsWith(LEGACY_WIRE_HEADER_PREFIX)) {
|
|
56187
|
+
const current = `${WIRE_HEADER_PREFIX}${name.slice(LEGACY_WIRE_HEADER_PREFIX.length)}`;
|
|
56188
|
+
result[current] ??= value;
|
|
56189
|
+
}
|
|
56190
|
+
}
|
|
56191
|
+
return result;
|
|
56192
|
+
}
|
|
56176
56193
|
|
|
56177
56194
|
// src/configure.ts
|
|
56178
56195
|
var import_node_fs8 = __toESM(require("node:fs"), 1);
|
|
@@ -61034,7 +61051,7 @@ function resolveLaunchIdentity(paths, cwd) {
|
|
|
61034
61051
|
// package.json
|
|
61035
61052
|
var package_default = {
|
|
61036
61053
|
name: "agent-shim",
|
|
61037
|
-
version: "7.1.
|
|
61054
|
+
version: "7.1.2",
|
|
61038
61055
|
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.",
|
|
61039
61056
|
license: "MIT",
|
|
61040
61057
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -65282,7 +65299,7 @@ function createFrontDoorServer(pipeline, log, tls2) {
|
|
|
65282
65299
|
}
|
|
65283
65300
|
});
|
|
65284
65301
|
const handle = async () => {
|
|
65285
|
-
await pipeline({ method: request6.method ?? "GET", url: request6.url ?? "/", headers: request6.headers, body: request6, signal: abort.signal, response });
|
|
65302
|
+
await pipeline({ method: request6.method ?? "GET", url: request6.url ?? "/", headers: aliasLegacyWireHeaders(request6.headers), body: request6, signal: abort.signal, response });
|
|
65286
65303
|
if (!request6.readableEnded) {
|
|
65287
65304
|
request6.resume();
|
|
65288
65305
|
}
|
package/dist/types/legacy.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IncomingHttpHeaders } from "node:http";
|
|
1
2
|
/**
|
|
2
3
|
* Everything agent-shim still honours from its former name, `claude-use`, so an installation, a committed project config or an exported environment written for the old name keeps working. Nothing here is consulted when the current name's equivalent is present: a current name always wins, and the legacy form is only a fallback that `agent-shim doctor` reports so it can be retired.
|
|
3
4
|
*/
|
|
@@ -22,3 +23,7 @@ export declare const LEGACY_COMMAND_NAME = "claude-use";
|
|
|
22
23
|
* Copies every `CLAUDE_USE_*` variable in `env` to its `AGENT_SHIM_*` name unless that name is already set, mutating `env`. Returns the legacy names that supplied a value, in sorted order. An empty current value counts as set, so exporting `AGENT_SHIM_X=` still overrides a stale `CLAUDE_USE_X`.
|
|
23
24
|
*/
|
|
24
25
|
export declare function aliasLegacyEnv(env: NodeJS.ProcessEnv): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Returns `headers` with every `x-claude-use-*` header renamed to its `x-agent-shim-*` name, and no legacy name left in the result, so everything downstream (admission, the identity strip that keeps internal headers from reaching an upstream) sees only the current names. A current-name header that is also present wins and the legacy copy is dropped. Header names arrive lowercased from Node's HTTP parser.
|
|
28
|
+
*/
|
|
29
|
+
export declare function aliasLegacyWireHeaders(headers: Readonly<IncomingHttpHeaders>): IncomingHttpHeaders;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-shim",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.2",
|
|
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>",
|