claude-use 14.6.1 → 14.7.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/README.md CHANGED
@@ -155,7 +155,7 @@ pnpm schema # regenerate schema/*.schema.json from src/config/schema.ts; CI
155
155
 
156
156
  Run a single test file directly with `pnpm exec vitest run <path>`. Tests never touch a real identity: `vitest.config.ts` sets `AGENT_SHIM_HOME` to a throwaway directory, and a setup file refuses to run at all if that variable is unset or resolves to the real `~/.agent-shim`.
157
157
 
158
- Commits are gated by Husky hooks: `commit-msg` enforces conventional-commit format, `pre-commit` runs `eslint --fix` on staged files and rejects merge/squash commits and mass deletions on `main`, and `pre-push` runs typecheck, the schema drift check, knip and the tests related to what the push changes (CI runs the full suite) and also rejects a push that would delete more than 100 files on the remote.
158
+ Commits are gated by Husky hooks: `commit-msg` enforces conventional-commit format, `pre-commit` runs `eslint --fix` on staged files and rejects merge/squash commits and mass deletions on `main`, and `pre-push` runs typecheck, the schema drift check, knip, the tests related to what the push changes and the tests that read the repository's own files (`*.repo.test.ts`; CI runs the full suite) and also rejects a push that would delete more than 100 files on the remote.
159
159
 
160
160
  A fresh clone needs one extra step before committing anything, since git stores filter definitions in `.git/config` rather than in the repository:
161
161
 
package/dist/cli.cjs CHANGED
@@ -29787,7 +29787,7 @@ function pruneDeadFrontDoorDirectRecords(fs37, recordsDir, records, liveness) {
29787
29787
  }
29788
29788
  }
29789
29789
  function recordOf(details) {
29790
- return details === void 0 ? {} : { sessionId: details.sessionId, ...details.identity === void 0 ? {} : { identity: details.identity }, ...details.models === void 0 ? {} : { models: details.models }, ...details.configDir === void 0 ? {} : { configDir: details.configDir } };
29790
+ return details === void 0 ? {} : { sessionId: details.sessionId, ...details.identity === void 0 ? {} : { identity: details.identity }, ...details.models === void 0 ? {} : { models: details.models }, ...details.configDir === void 0 ? {} : { configDir: details.configDir }, ...details.claudeVersion === void 0 ? {} : { claudeVersion: details.claudeVersion } };
29791
29791
  }
29792
29792
  function launchRouteStore(fs37, sessionsDir, log) {
29793
29793
  const failing = /* @__PURE__ */ new Set();
@@ -29962,9 +29962,9 @@ var init_state = __esm({
29962
29962
  init_zod();
29963
29963
  init_schema();
29964
29964
  init_baseUrlDial();
29965
- FRONT_DOOR_PROTOCOL = 10;
29965
+ FRONT_DOOR_PROTOCOL = 11;
29966
29966
  FRONT_DOOR_HANDOVER_PROTOCOL = 6;
29967
- FrontDoorSessionSchema = external_exports.strictObject({ pid: external_exports.number().int().positive(), startedAt: external_exports.number(), token: external_exports.string().min(1), supervisorPid: external_exports.number().int().positive().optional(), sessionId: external_exports.string().min(1).optional(), identity: external_exports.string().min(1).optional(), models: ModelsConfigSchema.optional(), configDir: external_exports.string().min(1).optional() });
29967
+ FrontDoorSessionSchema = external_exports.strictObject({ pid: external_exports.number().int().positive(), startedAt: external_exports.number(), token: external_exports.string().min(1), supervisorPid: external_exports.number().int().positive().optional(), sessionId: external_exports.string().min(1).optional(), identity: external_exports.string().min(1).optional(), models: ModelsConfigSchema.optional(), configDir: external_exports.string().min(1).optional(), claudeVersion: external_exports.string().min(1).optional() });
29968
29968
  MAX_CONTEXT_TEXT_LENGTH = 256;
29969
29969
  ContextText = external_exports.string().min(1).max(MAX_CONTEXT_TEXT_LENGTH);
29970
29970
  LaunchRouteSchema = external_exports.union([external_exports.strictObject({ kind: external_exports.literal("anthropic") }), external_exports.strictObject({ kind: external_exports.literal("provider"), provider: external_exports.string().min(1) })]);
@@ -75621,7 +75621,7 @@ var init_package = __esm({
75621
75621
  "package.json"() {
75622
75622
  package_default = {
75623
75623
  name: "claude-use",
75624
- version: "14.6.1",
75624
+ version: "14.7.1",
75625
75625
  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.",
75626
75626
  license: "MIT",
75627
75627
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -78075,7 +78075,7 @@ function prepareRegisteredLaunch(params, onRecorded) {
78075
78075
  const sessionId = params.supervised?.sessionId ?? (0, import_node_crypto29.randomUUID)();
78076
78076
  const resolvedModels = decided.models ?? (decided.globalModels === void 0 ? void 0 : {});
78077
78077
  const sessionModels = (0, import_node_util6.isDeepStrictEqual)(resolvedModels, decided.globalModels) ? void 0 : resolvedModels;
78078
- const session = { sessionId, ...decided.farmIdentity === void 0 ? {} : { identity: decided.farmIdentity }, ...sessionModels === void 0 ? {} : { models: sessionModels }, configDir: decision.configDir ?? import_node_path57.default.join(import_node_os14.default.homedir(), ".claude") };
78078
+ const session = { sessionId, ...decided.farmIdentity === void 0 ? {} : { identity: decided.farmIdentity }, ...sessionModels === void 0 ? {} : { models: sessionModels }, configDir: decision.configDir ?? import_node_path57.default.join(import_node_os14.default.homedir(), ".claude"), ...decided.binVersion === void 0 ? {} : { claudeVersion: decided.binVersion } };
78079
78079
  let frontDoor = frontDoorEngaged && frontDoorPort !== void 0 ? frontDoorPort.ensure(env.NODE_EXTRA_CA_CERTS, session) : void 0;
78080
78080
  if (frontDoor !== void 0 && frontDoorPort !== void 0) {
78081
78081
  let beforePid = frontDoor.supervisorPid;
@@ -144955,6 +144955,21 @@ async function runSelfHostedTurn(deps, sessionId, text5, waitMs, signal) {
144955
144955
  signal
144956
144956
  );
144957
144957
  }
144958
+ function createSelfHostedSessionVersions(sources) {
144959
+ const warned2 = /* @__PURE__ */ new Set();
144960
+ return (sessionId) => {
144961
+ const reported = sources.reported(sessionId);
144962
+ const recorded = sources.recorded(sessionId);
144963
+ if (reported !== void 0 && recorded !== void 0 && reported !== recorded) {
144964
+ const key = `${sessionId} ${recorded} ${reported}`;
144965
+ if (!warned2.has(key)) {
144966
+ warned2.add(key);
144967
+ sources.warn(`rc selfhost ${sessionId}: its launch recorded Claude Code ${recorded} and its worker reports ${reported}; the worker's report is the version its verbs are gated on`);
144968
+ }
144969
+ }
144970
+ return reported ?? recorded;
144971
+ };
144972
+ }
144958
144973
  function createRcClaudeCodeVersions(fanout) {
144959
144974
  const versions = /* @__PURE__ */ new Map();
144960
144975
  fanout.subscribe(void 0, (event) => {
@@ -145041,7 +145056,7 @@ function createRcSessionCommands(deps) {
145041
145056
  }
145042
145057
  const version2 = deps.selfHost.versionOf(sessionId);
145043
145058
  if (version2 === void 0 || !RC_SESSION_COMMAND_VERIFIED_VERSIONS.includes(version2)) {
145044
- return { kind: "refused", message: unverifiedVersionMessage(sessionId, version2, "no system/init from its worker has been observed on its stream; send it a prompt so it reports one"), refusal: "session-state" };
145059
+ return { kind: "refused", message: unverifiedVersionMessage(sessionId, version2, "its launch recorded none and no system/init from its worker has been observed on its stream; send it a prompt so it reports one"), refusal: "session-state" };
145045
145060
  }
145046
145061
  return { kind: "self-hosted", selfHost: deps.selfHost };
145047
145062
  };
@@ -146910,12 +146925,14 @@ function createLiveSessionRegistry(ports) {
146910
146925
  let bySessionId = /* @__PURE__ */ new Map();
146911
146926
  let launches = /* @__PURE__ */ new Set();
146912
146927
  const recordNames = () => fs37.readdir(sessionsDir).filter(isSessionRecordName);
146928
+ let byLaunch = /* @__PURE__ */ new Map();
146913
146929
  const rebuildIndexes = () => {
146914
146930
  const records = [...known.values()].flatMap(({ record: record3 }) => record3 === void 0 ? [] : [record3]);
146915
146931
  tokens = new Set(records.map((record3) => record3.token));
146916
146932
  byToken = new Map(records.map((record3) => [record3.token, record3]));
146917
146933
  bySessionId = new Map(records.flatMap((record3) => record3.sessionId === void 0 ? [] : [[record3.sessionId, record3]]));
146918
146934
  launches = new Set(records.map(launchKeyOf));
146935
+ byLaunch = new Map(records.map((record3) => [launchKeyOf(record3), record3]));
146919
146936
  };
146920
146937
  const load = (name, stat2) => {
146921
146938
  known.set(name, { stat: { mtimeMs: stat2.mtimeMs, sizeBytes: stat2.sizeBytes }, record: readFrontDoorSessionRecord(fs37, sessionsDir, name) });
@@ -146962,6 +146979,7 @@ function createLiveSessionRegistry(ports) {
146962
146979
  return held?.sessionId === void 0 ? void 0 : { pid: held.pid, startedAt: held.startedAt };
146963
146980
  },
146964
146981
  holdsLaunch: (launch) => launches.has(launchKeyOf(launch)) || reconcile() && launches.has(launchKeyOf(launch)),
146982
+ claudeVersionOf: (launch) => (byLaunch.get(launchKeyOf(launch)) ?? (reconcile() ? byLaunch.get(launchKeyOf(launch)) : void 0))?.claudeVersion,
146965
146983
  rescan: () => {
146966
146984
  known.clear();
146967
146985
  for (const name of recordNames()) {
@@ -153921,7 +153939,8 @@ data: ${JSON.stringify(envelope2)}
153921
153939
  clients: /* @__PURE__ */ new Map(),
153922
153940
  workerStatus: void 0,
153923
153941
  externalMetadata: void 0,
153924
- lastTrafficAt: deps.now()
153942
+ lastTrafficAt: deps.now(),
153943
+ launchVersion: request7.session.launch === void 0 ? void 0 : deps.launchVersionOf(request7.session.launch)
153925
153944
  };
153926
153945
  conversation.sessionIds.add(session.id);
153927
153946
  sessions.set(session.id, session);
@@ -153956,6 +153975,7 @@ data: ${JSON.stringify(envelope2)}
153956
153975
  return {
153957
153976
  route,
153958
153977
  local,
153978
+ launchVersionOf: (sessionId) => sessions.get(sessionId)?.launchVersion,
153959
153979
  close: () => {
153960
153980
  clearInterval(timer);
153961
153981
  clearInterval(keepalive);
@@ -154138,7 +154158,7 @@ function attributeRcSelfHostMint(paths, log) {
154138
154158
  log(`self-hosted Remote Control surface: the minted credential names no identity and ${String(backfill.holders)} identities hold it, so no launch can be told apart from it and every launch's calls on the intercepted hosts are refused until the identity is minted again (agent-shim frontdoor rc selfhost mint <identity>)`);
154139
154159
  }
154140
154160
  }
154141
- function createRealRcSelfHostSurface(paths, doorPid, env, log) {
154161
+ function createRealRcSelfHostSurface(paths, doorPid, env, launchVersionOf, log) {
154142
154162
  const ownership = realRcSelfHostLaunchCheck(paths, doorPid);
154143
154163
  return createRcSelfHostSurface({
154144
154164
  now: () => Date.now(),
@@ -154148,6 +154168,7 @@ function createRealRcSelfHostSurface(paths, doorPid, env, log) {
154148
154168
  webFetch: realRcWebFetch({ allowPrivate: rcWebFetchAllowsPrivateFromEnv(env) }),
154149
154169
  ownsLaunch: ownership.ownsLaunch,
154150
154170
  ownsPeer: ownership.ownsPeer,
154171
+ launchVersionOf,
154151
154172
  log
154152
154173
  });
154153
154174
  }
@@ -154486,10 +154507,14 @@ function createDoorRcSessionCommands(deps) {
154486
154507
  personWrite: selfHost.personWrite,
154487
154508
  unavailable: selfHost.unavailable,
154488
154509
  fanout: selfHost.fanout,
154489
- versionOf: (sessionId) => {
154490
- selfHost.versions.sweep(deps.isTracked);
154491
- return selfHost.versions.versionOf(sessionId);
154492
- },
154510
+ versionOf: createSelfHostedSessionVersions({
154511
+ reported: (sessionId) => {
154512
+ selfHost.versions.sweep(deps.isTracked);
154513
+ return selfHost.versions.versionOf(sessionId);
154514
+ },
154515
+ recorded: selfHost.launchVersionOf,
154516
+ warn: selfHost.log
154517
+ }),
154493
154518
  setTimer: (action, ms) => {
154494
154519
  const timer = setTimeout(action, ms);
154495
154520
  return () => {
@@ -155314,7 +155339,8 @@ function realFrontDoorSupervisorPorts(paths, respawnGeneration, lifecycle, track
155314
155339
  selfHostDialTarget ??= { host: "127.0.0.1", port: transparentPort, servername: CONNECT_INTERCEPT_HOST, ca: [loadCa().certPem] };
155315
155340
  return selfHostDialTarget;
155316
155341
  };
155317
- const rcSelfHostSurface = rcSelfHost ? createRealRcSelfHostSurface(paths, process.pid, process.env, log) : void 0;
155342
+ const sessionRegistry = createLiveSessionRegistry({ fs: realFarmFs, sessionsDir: paths.frontdoorSessionsDir });
155343
+ const rcSelfHostSurface = rcSelfHost ? createRealRcSelfHostSurface(paths, process.pid, process.env, sessionRegistry.claudeVersionOf, log) : void 0;
155318
155344
  const rcCredentialStore = createRcCredentialStore(realFarmFs, paths.frontdoorRcCredentialsDir);
155319
155345
  const rcSessionEvents = createRcSessionEventLog({ generation: (0, import_node_crypto35.randomUUID)(), capacity: RC_SESSION_EVENT_LOG_CAPACITY });
155320
155346
  const rcTracker = createRcSessionTracker({ now: () => Date.now(), idleMs: RC_IDLE_EXPIRY_MS, credentialStore: rcCredentialStore, onTransition: rcSessionEvents.append, onClose: rcSessionEvents.close });
@@ -155359,7 +155385,6 @@ function realFrontDoorSupervisorPorts(paths, respawnGeneration, lifecycle, track
155359
155385
  const routingSnapshots = /* @__PURE__ */ new Map();
155360
155386
  const rcControlToken = lifecycle.predecessor === void 0 ? (0, import_node_crypto35.randomUUID)() : inheritedControlToken(paths);
155361
155387
  const capture = captureFromEnv(process.env, paths.logsDir);
155362
- const sessionRegistry = createLiveSessionRegistry({ fs: realFarmFs, sessionsDir: paths.frontdoorSessionsDir });
155363
155388
  const resolveRoute = rcObservingResolver(
155364
155389
  createProviderRouteResolver({
155365
155390
  // Read live so a models-block edit reaches the next request without a door restart.
@@ -155591,11 +155616,15 @@ function realFrontDoorSupervisorPorts(paths, respawnGeneration, lifecycle, track
155591
155616
  const rcSessionCommands = createDoorRcSessionCommands({
155592
155617
  paths,
155593
155618
  isTracked: (sessionId) => rcTracker.statusOf(sessionId).length > 0,
155594
- selfHost: rcSelfHost ? {
155619
+ selfHost: rcSelfHostSurface !== void 0 ? {
155595
155620
  personWrite: { credentialOf: rcTracker.credentialOf, noteSequenceNums: rcTracker.noteSequenceNums, newUuid: import_node_crypto35.randomUUID, dial: rcSelfHostEventDial(rcSelfHostDialTarget) },
155596
155621
  unavailable: () => rcSelfHostDialTarget() === void 0 ? selfHostSurfaceUnboundReason(process.env.AGENT_SHIM_TRANSPARENT_SURFACE) : void 0,
155597
155622
  fanout: rcFanout,
155598
- versions: rcClaudeCodeVersions
155623
+ versions: rcClaudeCodeVersions,
155624
+ launchVersionOf: rcSelfHostSurface.launchVersionOf,
155625
+ log: (line) => {
155626
+ appendDoorLog(paths, `frontdoor ${String(process.pid)}: ${line}`);
155627
+ }
155599
155628
  } : void 0
155600
155629
  });
155601
155630
  const controlDeps = {
package/dist/index.cjs CHANGED
@@ -5498,7 +5498,7 @@ function pruneDeadFrontDoorDirectRecords(fs17, recordsDir, records, liveness) {
5498
5498
  }
5499
5499
  }
5500
5500
  function recordOf(details) {
5501
- return details === void 0 ? {} : { sessionId: details.sessionId, ...details.identity === void 0 ? {} : { identity: details.identity }, ...details.models === void 0 ? {} : { models: details.models }, ...details.configDir === void 0 ? {} : { configDir: details.configDir } };
5501
+ return details === void 0 ? {} : { sessionId: details.sessionId, ...details.identity === void 0 ? {} : { identity: details.identity }, ...details.models === void 0 ? {} : { models: details.models }, ...details.configDir === void 0 ? {} : { configDir: details.configDir }, ...details.claudeVersion === void 0 ? {} : { claudeVersion: details.claudeVersion } };
5502
5502
  }
5503
5503
  function writeFrontDoorSession(fs17, sessionsDir, session) {
5504
5504
  fs17.mkdirPrivate(sessionsDir);
@@ -5574,9 +5574,9 @@ var init_state = __esm({
5574
5574
  import_zod9 = require("zod");
5575
5575
  init_schema();
5576
5576
  init_baseUrlDial();
5577
- FRONT_DOOR_PROTOCOL = 10;
5577
+ FRONT_DOOR_PROTOCOL = 11;
5578
5578
  FRONT_DOOR_HANDOVER_PROTOCOL = 6;
5579
- FrontDoorSessionSchema = import_zod9.z.strictObject({ pid: import_zod9.z.number().int().positive(), startedAt: import_zod9.z.number(), token: import_zod9.z.string().min(1), supervisorPid: import_zod9.z.number().int().positive().optional(), sessionId: import_zod9.z.string().min(1).optional(), identity: import_zod9.z.string().min(1).optional(), models: ModelsConfigSchema.optional(), configDir: import_zod9.z.string().min(1).optional() });
5579
+ FrontDoorSessionSchema = import_zod9.z.strictObject({ pid: import_zod9.z.number().int().positive(), startedAt: import_zod9.z.number(), token: import_zod9.z.string().min(1), supervisorPid: import_zod9.z.number().int().positive().optional(), sessionId: import_zod9.z.string().min(1).optional(), identity: import_zod9.z.string().min(1).optional(), models: ModelsConfigSchema.optional(), configDir: import_zod9.z.string().min(1).optional(), claudeVersion: import_zod9.z.string().min(1).optional() });
5580
5580
  MAX_CONTEXT_TEXT_LENGTH = 256;
5581
5581
  ContextText = import_zod9.z.string().min(1).max(MAX_CONTEXT_TEXT_LENGTH);
5582
5582
  LaunchRouteSchema = import_zod9.z.union([import_zod9.z.strictObject({ kind: import_zod9.z.literal("anthropic") }), import_zod9.z.strictObject({ kind: import_zod9.z.literal("provider"), provider: import_zod9.z.string().min(1) })]);
@@ -14304,7 +14304,7 @@ var init_package = __esm({
14304
14304
  "package.json"() {
14305
14305
  package_default = {
14306
14306
  name: "claude-use",
14307
- version: "14.6.1",
14307
+ version: "14.7.1",
14308
14308
  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.",
14309
14309
  license: "MIT",
14310
14310
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -18773,7 +18773,7 @@ function prepareRegisteredLaunch(params, onRecorded) {
18773
18773
  const sessionId = params.supervised?.sessionId ?? (0, import_node_crypto19.randomUUID)();
18774
18774
  const resolvedModels = decided.models ?? (decided.globalModels === void 0 ? void 0 : {});
18775
18775
  const sessionModels = (0, import_node_util2.isDeepStrictEqual)(resolvedModels, decided.globalModels) ? void 0 : resolvedModels;
18776
- const session = { sessionId, ...decided.farmIdentity === void 0 ? {} : { identity: decided.farmIdentity }, ...sessionModels === void 0 ? {} : { models: sessionModels }, configDir: decision.configDir ?? import_node_path55.default.join(import_node_os10.default.homedir(), ".claude") };
18776
+ const session = { sessionId, ...decided.farmIdentity === void 0 ? {} : { identity: decided.farmIdentity }, ...sessionModels === void 0 ? {} : { models: sessionModels }, configDir: decision.configDir ?? import_node_path55.default.join(import_node_os10.default.homedir(), ".claude"), ...decided.binVersion === void 0 ? {} : { claudeVersion: decided.binVersion } };
18777
18777
  let frontDoor = frontDoorEngaged && frontDoorPort !== void 0 ? frontDoorPort.ensure(env.NODE_EXTRA_CA_CERTS, session) : void 0;
18778
18778
  if (frontDoor !== void 0 && frontDoorPort !== void 0) {
18779
18779
  let beforePid = frontDoor.supervisorPid;
@@ -20653,7 +20653,7 @@ function createRcSessionCommands(deps) {
20653
20653
  }
20654
20654
  const version = deps.selfHost.versionOf(sessionId);
20655
20655
  if (version === void 0 || !RC_SESSION_COMMAND_VERIFIED_VERSIONS.includes(version)) {
20656
- return { kind: "refused", message: unverifiedVersionMessage(sessionId, version, "no system/init from its worker has been observed on its stream; send it a prompt so it reports one"), refusal: "session-state" };
20656
+ return { kind: "refused", message: unverifiedVersionMessage(sessionId, version, "its launch recorded none and no system/init from its worker has been observed on its stream; send it a prompt so it reports one"), refusal: "session-state" };
20657
20657
  }
20658
20658
  return { kind: "self-hosted", selfHost: deps.selfHost };
20659
20659
  };
@@ -26920,7 +26920,8 @@ data: ${JSON.stringify(envelope)}
26920
26920
  clients: /* @__PURE__ */ new Map(),
26921
26921
  workerStatus: void 0,
26922
26922
  externalMetadata: void 0,
26923
- lastTrafficAt: deps.now()
26923
+ lastTrafficAt: deps.now(),
26924
+ launchVersion: request4.session.launch === void 0 ? void 0 : deps.launchVersionOf(request4.session.launch)
26924
26925
  };
26925
26926
  conversation.sessionIds.add(session.id);
26926
26927
  sessions.set(session.id, session);
@@ -26955,6 +26956,7 @@ data: ${JSON.stringify(envelope)}
26955
26956
  return {
26956
26957
  route,
26957
26958
  local,
26959
+ launchVersionOf: (sessionId) => sessions.get(sessionId)?.launchVersion,
26958
26960
  close: () => {
26959
26961
  clearInterval(timer);
26960
26962
  clearInterval(keepalive);
@@ -26987,12 +26989,14 @@ function createLiveSessionRegistry(ports) {
26987
26989
  let bySessionId = /* @__PURE__ */ new Map();
26988
26990
  let launches = /* @__PURE__ */ new Set();
26989
26991
  const recordNames = () => fs17.readdir(sessionsDir).filter(isSessionRecordName);
26992
+ let byLaunch = /* @__PURE__ */ new Map();
26990
26993
  const rebuildIndexes = () => {
26991
26994
  const records = [...known.values()].flatMap(({ record }) => record === void 0 ? [] : [record]);
26992
26995
  tokens = new Set(records.map((record) => record.token));
26993
26996
  byToken = new Map(records.map((record) => [record.token, record]));
26994
26997
  bySessionId = new Map(records.flatMap((record) => record.sessionId === void 0 ? [] : [[record.sessionId, record]]));
26995
26998
  launches = new Set(records.map(launchKeyOf));
26999
+ byLaunch = new Map(records.map((record) => [launchKeyOf(record), record]));
26996
27000
  };
26997
27001
  const load = (name, stat) => {
26998
27002
  known.set(name, { stat: { mtimeMs: stat.mtimeMs, sizeBytes: stat.sizeBytes }, record: readFrontDoorSessionRecord(fs17, sessionsDir, name) });
@@ -27039,6 +27043,7 @@ function createLiveSessionRegistry(ports) {
27039
27043
  return held?.sessionId === void 0 ? void 0 : { pid: held.pid, startedAt: held.startedAt };
27040
27044
  },
27041
27045
  holdsLaunch: (launch) => launches.has(launchKeyOf(launch)) || reconcile() && launches.has(launchKeyOf(launch)),
27046
+ claudeVersionOf: (launch) => (byLaunch.get(launchKeyOf(launch)) ?? (reconcile() ? byLaunch.get(launchKeyOf(launch)) : void 0))?.claudeVersion,
27042
27047
  rescan: () => {
27043
27048
  known.clear();
27044
27049
  for (const name of recordNames()) {
package/dist/index.mjs CHANGED
@@ -5475,7 +5475,7 @@ function pruneDeadFrontDoorDirectRecords(fs17, recordsDir, records, liveness) {
5475
5475
  }
5476
5476
  }
5477
5477
  function recordOf(details) {
5478
- return details === void 0 ? {} : { sessionId: details.sessionId, ...details.identity === void 0 ? {} : { identity: details.identity }, ...details.models === void 0 ? {} : { models: details.models }, ...details.configDir === void 0 ? {} : { configDir: details.configDir } };
5478
+ return details === void 0 ? {} : { sessionId: details.sessionId, ...details.identity === void 0 ? {} : { identity: details.identity }, ...details.models === void 0 ? {} : { models: details.models }, ...details.configDir === void 0 ? {} : { configDir: details.configDir }, ...details.claudeVersion === void 0 ? {} : { claudeVersion: details.claudeVersion } };
5479
5479
  }
5480
5480
  function writeFrontDoorSession(fs17, sessionsDir, session) {
5481
5481
  fs17.mkdirPrivate(sessionsDir);
@@ -5549,9 +5549,9 @@ var init_state = __esm({
5549
5549
  "use strict";
5550
5550
  init_schema();
5551
5551
  init_baseUrlDial();
5552
- FRONT_DOOR_PROTOCOL = 10;
5552
+ FRONT_DOOR_PROTOCOL = 11;
5553
5553
  FRONT_DOOR_HANDOVER_PROTOCOL = 6;
5554
- FrontDoorSessionSchema = z9.strictObject({ pid: z9.number().int().positive(), startedAt: z9.number(), token: z9.string().min(1), supervisorPid: z9.number().int().positive().optional(), sessionId: z9.string().min(1).optional(), identity: z9.string().min(1).optional(), models: ModelsConfigSchema.optional(), configDir: z9.string().min(1).optional() });
5554
+ FrontDoorSessionSchema = z9.strictObject({ pid: z9.number().int().positive(), startedAt: z9.number(), token: z9.string().min(1), supervisorPid: z9.number().int().positive().optional(), sessionId: z9.string().min(1).optional(), identity: z9.string().min(1).optional(), models: ModelsConfigSchema.optional(), configDir: z9.string().min(1).optional(), claudeVersion: z9.string().min(1).optional() });
5555
5555
  MAX_CONTEXT_TEXT_LENGTH = 256;
5556
5556
  ContextText = z9.string().min(1).max(MAX_CONTEXT_TEXT_LENGTH);
5557
5557
  LaunchRouteSchema = z9.union([z9.strictObject({ kind: z9.literal("anthropic") }), z9.strictObject({ kind: z9.literal("provider"), provider: z9.string().min(1) })]);
@@ -14277,7 +14277,7 @@ var init_package = __esm({
14277
14277
  "package.json"() {
14278
14278
  package_default = {
14279
14279
  name: "claude-use",
14280
- version: "14.6.1",
14280
+ version: "14.7.1",
14281
14281
  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.",
14282
14282
  license: "MIT",
14283
14283
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -18746,7 +18746,7 @@ function prepareRegisteredLaunch(params, onRecorded) {
18746
18746
  const sessionId = params.supervised?.sessionId ?? randomUUID7();
18747
18747
  const resolvedModels = decided.models ?? (decided.globalModels === void 0 ? void 0 : {});
18748
18748
  const sessionModels = isDeepStrictEqual(resolvedModels, decided.globalModels) ? void 0 : resolvedModels;
18749
- const session = { sessionId, ...decided.farmIdentity === void 0 ? {} : { identity: decided.farmIdentity }, ...sessionModels === void 0 ? {} : { models: sessionModels }, configDir: decision.configDir ?? path55.join(os10.homedir(), ".claude") };
18749
+ const session = { sessionId, ...decided.farmIdentity === void 0 ? {} : { identity: decided.farmIdentity }, ...sessionModels === void 0 ? {} : { models: sessionModels }, configDir: decision.configDir ?? path55.join(os10.homedir(), ".claude"), ...decided.binVersion === void 0 ? {} : { claudeVersion: decided.binVersion } };
18750
18750
  let frontDoor = frontDoorEngaged && frontDoorPort !== void 0 ? frontDoorPort.ensure(env.NODE_EXTRA_CA_CERTS, session) : void 0;
18751
18751
  if (frontDoor !== void 0 && frontDoorPort !== void 0) {
18752
18752
  let beforePid = frontDoor.supervisorPid;
@@ -20202,7 +20202,7 @@ function createRcSessionCommands(deps) {
20202
20202
  }
20203
20203
  const version = deps.selfHost.versionOf(sessionId);
20204
20204
  if (version === void 0 || !RC_SESSION_COMMAND_VERIFIED_VERSIONS.includes(version)) {
20205
- return { kind: "refused", message: unverifiedVersionMessage(sessionId, version, "no system/init from its worker has been observed on its stream; send it a prompt so it reports one"), refusal: "session-state" };
20205
+ return { kind: "refused", message: unverifiedVersionMessage(sessionId, version, "its launch recorded none and no system/init from its worker has been observed on its stream; send it a prompt so it reports one"), refusal: "session-state" };
20206
20206
  }
20207
20207
  return { kind: "self-hosted", selfHost: deps.selfHost };
20208
20208
  };
@@ -26469,7 +26469,8 @@ data: ${JSON.stringify(envelope)}
26469
26469
  clients: /* @__PURE__ */ new Map(),
26470
26470
  workerStatus: void 0,
26471
26471
  externalMetadata: void 0,
26472
- lastTrafficAt: deps.now()
26472
+ lastTrafficAt: deps.now(),
26473
+ launchVersion: request4.session.launch === void 0 ? void 0 : deps.launchVersionOf(request4.session.launch)
26473
26474
  };
26474
26475
  conversation.sessionIds.add(session.id);
26475
26476
  sessions.set(session.id, session);
@@ -26504,6 +26505,7 @@ data: ${JSON.stringify(envelope)}
26504
26505
  return {
26505
26506
  route,
26506
26507
  local,
26508
+ launchVersionOf: (sessionId) => sessions.get(sessionId)?.launchVersion,
26507
26509
  close: () => {
26508
26510
  clearInterval(timer);
26509
26511
  clearInterval(keepalive);
@@ -26536,12 +26538,14 @@ function createLiveSessionRegistry(ports) {
26536
26538
  let bySessionId = /* @__PURE__ */ new Map();
26537
26539
  let launches = /* @__PURE__ */ new Set();
26538
26540
  const recordNames = () => fs17.readdir(sessionsDir).filter(isSessionRecordName);
26541
+ let byLaunch = /* @__PURE__ */ new Map();
26539
26542
  const rebuildIndexes = () => {
26540
26543
  const records = [...known.values()].flatMap(({ record }) => record === void 0 ? [] : [record]);
26541
26544
  tokens = new Set(records.map((record) => record.token));
26542
26545
  byToken = new Map(records.map((record) => [record.token, record]));
26543
26546
  bySessionId = new Map(records.flatMap((record) => record.sessionId === void 0 ? [] : [[record.sessionId, record]]));
26544
26547
  launches = new Set(records.map(launchKeyOf));
26548
+ byLaunch = new Map(records.map((record) => [launchKeyOf(record), record]));
26545
26549
  };
26546
26550
  const load = (name, stat) => {
26547
26551
  known.set(name, { stat: { mtimeMs: stat.mtimeMs, sizeBytes: stat.sizeBytes }, record: readFrontDoorSessionRecord(fs17, sessionsDir, name) });
@@ -26588,6 +26592,7 @@ function createLiveSessionRegistry(ports) {
26588
26592
  return held?.sessionId === void 0 ? void 0 : { pid: held.pid, startedAt: held.startedAt };
26589
26593
  },
26590
26594
  holdsLaunch: (launch) => launches.has(launchKeyOf(launch)) || reconcile() && launches.has(launchKeyOf(launch)),
26595
+ claudeVersionOf: (launch) => (byLaunch.get(launchKeyOf(launch)) ?? (reconcile() ? byLaunch.get(launchKeyOf(launch)) : void 0))?.claudeVersion,
26591
26596
  rescan: () => {
26592
26597
  known.clear();
26593
26598
  for (const name of recordNames()) {
@@ -6024,6 +6024,7 @@ declare const FrontDoorSessionSchema: z.ZodObject<{
6024
6024
  }, z.core.$strict>>>;
6025
6025
  }, z.core.$strict>>;
6026
6026
  configDir: z.ZodOptional<z.ZodString>;
6027
+ claudeVersion: z.ZodOptional<z.ZodString>;
6027
6028
  }, z.core.$strict>;
6028
6029
  type FrontDoorSession = z.infer<typeof FrontDoorSessionSchema>;
6029
6030
  /** What names one launch: its launcher's pid and the time it registered. A launcher that registers again under its own pid (a relaunch after an account move, a `--resume`) writes a new start time, so per-launch state the door keeps never passes from one launch to the next, even when both carry the same session id. */
@@ -6058,6 +6059,8 @@ interface FrontDoorSessionDetails {
6058
6059
  readonly models?: ModelsConfig;
6059
6060
  /** The configuration directory the launch's child runs with, whichever way it was chosen (the identity's own, one the caller named, or Claude Code's default): what tells the door which login the launch holding this record's capability runs as, renames and the escape hatch included. Every launcher that knows the field names it, so a record without it was written by an older launcher. */
6060
6061
  readonly configDir?: string;
6062
+ /** The version of the Claude Code binary the launcher started, when it knows one (a binary found in the versions directory; one found only on `PATH` has none): what the self-hosted Remote Control route gates a session on until its worker reports its own version. */
6063
+ readonly claudeVersion?: string;
6061
6064
  }
6062
6065
  /** A registered launch as status and the idle decision see it: the pid and start time, never the token, so nothing that prints or serialises a session can leak the capability. */
6063
6066
  type FrontDoorSessionSummary = Pick<FrontDoorSession, "pid" | "startedAt" | "supervisorPid">;
@@ -8427,7 +8430,7 @@ interface RcSelfHostCommandDeps {
8427
8430
  readonly unavailable: () => string | undefined;
8428
8431
  /** The client attachment's fan-out, on which the worker's answer arrives. */
8429
8432
  readonly fanout: RcEventFanout;
8430
- /** The Claude Code version the session's worker last reported in a `system/init`, or undefined when none has been observed. */
8433
+ /** The Claude Code version the session runs (`createSelfHostedSessionVersions`: the worker's own report, else the version its launch recorded), or undefined when neither is known. */
8431
8434
  readonly versionOf: (sessionId: string) => string | undefined;
8432
8435
  /** Arms one timer, returning the function that cancels it: `setTimeout` in production, a controllable clock in tests. */
8433
8436
  readonly setTimer: (action: () => void, ms: number) => () => void;
@@ -26890,6 +26893,8 @@ interface RcSelfHostDeps {
26890
26893
  readonly ownsLaunch: (capability: string) => boolean;
26891
26894
  /** The same discriminator for a redirected connection, which carries no capability: whether the process holding its client end (on local port `port`) descends from a self-hosted launch, failing closed when it cannot be read. */
26892
26895
  readonly ownsPeer: (port: number) => Promise<boolean>;
26896
+ /** The Claude Code version the launch recorded for the binary it started (`FrontDoorSessionDetails.claudeVersion`, read from the door's session registry), or undefined when it recorded none: asked once per session, for the launch whose capability created it. */
26897
+ readonly launchVersionOf: (launch: Readonly<FrontDoorLaunch>) => string | undefined;
26893
26898
  readonly log?: (line: string) => void;
26894
26899
  }
26895
26900
  /** The self-hosted Remote Control service: the session-family route for the pipeline, and the local answers the connect surface consults before routing or piping. */
@@ -26898,6 +26903,8 @@ interface RcSelfHostSurface {
26898
26903
  readonly route: FrontDoorRoute;
26899
26904
  /** The connect surface's local answers: which hosts it takes over as HTTP, and the requests it answers itself. */
26900
26905
  readonly local: RcSelfHostLocal;
26906
+ /** The Claude Code version the launch that created a session recorded for its binary (`RcSelfHostDeps.launchVersionOf`), or undefined for a session this surface does not hold or whose launch recorded none. */
26907
+ readonly launchVersionOf: (sessionId: string) => string | undefined;
26901
26908
  /** Stops the service's timers and retires every open stream. The sessions themselves are unreachable the moment the door drops them. */
26902
26909
  readonly close: () => void;
26903
26910
  }
@@ -27033,6 +27040,8 @@ interface LiveSessionRegistry {
27033
27040
  readonly launchOfToken: (token: string) => FrontDoorLaunch | undefined;
27034
27041
  /** Whether `launch` is still registered, looked up as `modelsOf` looks one up: what bounds per-launch state the door keeps, which must live exactly as long as the launch it describes. */
27035
27042
  readonly holdsLaunch: (launch: Readonly<FrontDoorLaunch>) => boolean;
27043
+ /** The Claude Code version the live launch `launch` recorded for the binary it started, or undefined when the view holds no such launch or its record names none (an older launcher's, or a binary found only on `PATH`); looked up as `holdsLaunch` looks one up. */
27044
+ readonly claudeVersionOf: (launch: Readonly<FrontDoorLaunch>) => string | undefined;
27036
27045
  /** Drops the launches `pids` from the view, for the records the caller has just removed (the tick's prune), so their capabilities are refused at once rather than at the next `rescan`. */
27037
27046
  readonly forget: (pids: readonly number[]) => void;
27038
27047
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "14.6.1",
3
+ "version": "14.7.1",
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>",