claude-use 14.6.0 → 14.6.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/cli.cjs CHANGED
@@ -44182,7 +44182,7 @@ function rcEventWriteResultFromAnswer(answer) {
44182
44182
  return { ok: true, sequenceNums };
44183
44183
  }
44184
44184
  function noOAuthCredentialResult(sessionId) {
44185
- return { ok: false, message: `no claude.ai OAuth bearer has been observed for session ${sessionId}: only worker calls crossed this door, and the worker JWT they carry is answered 401 on the client half. Reconnect Remote Control through this door and the create's own bearer will be observed` };
44185
+ return { ok: false, message: `no claude.ai OAuth bearer has been observed for session ${sessionId}: only worker calls crossed this door, and the worker JWT they carry is answered 401 on the client half. Reconnect Remote Control through this door and the create's own bearer will be observed`, refusal: "session-state" };
44186
44186
  }
44187
44187
  function rcSessionNotObservedMessage(sessionId) {
44188
44188
  return `the front door has not observed Remote Control session ${sessionId}: it may never have passed through this door, or it ended or expired (an entry lives only a bounded idle period past its last observed traffic)`;
@@ -44203,7 +44203,7 @@ function rcWriteHeaders(credential) {
44203
44203
  async function injectRcUserMessage(deps, sessionId, text5) {
44204
44204
  const credential = deps.credentialOf(sessionId);
44205
44205
  if (credential === void 0) {
44206
- return { ok: false, message: rcSessionNotObservedMessage(sessionId) };
44206
+ return { ok: false, message: rcSessionNotObservedMessage(sessionId), refusal: "not-observed" };
44207
44207
  }
44208
44208
  if (credential.authorization === void 0) {
44209
44209
  return noOAuthCredentialResult(sessionId);
@@ -44300,22 +44300,22 @@ function questionAnswerInput(deps, sessionId, pending, decision) {
44300
44300
  async function answerRcControlRequest(deps, sessionId, requestId, decision) {
44301
44301
  const credential = deps.credentialOf(sessionId);
44302
44302
  if (credential === void 0) {
44303
- return { ok: false, message: rcSessionNotObservedMessage(sessionId) };
44303
+ return { ok: false, message: rcSessionNotObservedMessage(sessionId), refusal: "not-observed" };
44304
44304
  }
44305
44305
  if (credential.authorization === void 0) {
44306
44306
  return noOAuthCredentialResult(sessionId);
44307
44307
  }
44308
44308
  const pending = deps.pendingOf(sessionId).find((candidate) => candidate.requestId === requestId);
44309
44309
  if (pending === void 0) {
44310
- return { ok: false, message: `the front door has not observed control request ${requestId} pending on session ${sessionId}: it was answered already (by this door, by an attached client or in the session's own terminal), the worker withdrew it, or it never passed through this door` };
44310
+ return { ok: false, message: `the front door has not observed control request ${requestId} pending on session ${sessionId}: it was answered already (by this door, by an attached client or in the session's own terminal), the worker withdrew it, or it never passed through this door`, refusal: "not-observed" };
44311
44311
  }
44312
44312
  const updatedInput = questionAnswerInput(deps, sessionId, pending, decision);
44313
44313
  if (updatedInput !== void 0 && "error" in updatedInput) {
44314
- return { ok: false, message: updatedInput.error };
44314
+ return { ok: false, message: updatedInput.error, refusal: "invalid-input" };
44315
44315
  }
44316
44316
  const release = deps.claimPending(sessionId, requestId);
44317
44317
  if (release === void 0) {
44318
- return { ok: false, message: `another answer to control request ${requestId} on session ${sessionId} is being written right now; the worker takes only one, so this one was not sent` };
44318
+ return { ok: false, message: `another answer to control request ${requestId} on session ${sessionId} is being written right now; the worker takes only one, so this one was not sent`, refusal: "session-state" };
44319
44319
  }
44320
44320
  const body = JSON.stringify(buildRcEventWriteBody(buildRcControlResponsePayload(requestId, decision, updatedInput?.input)));
44321
44321
  let answer;
@@ -44336,7 +44336,7 @@ async function answerRcControlRequest(deps, sessionId, requestId, decision) {
44336
44336
  async function deliverRcClientPayload(deps, sessionId, payload, action, to2 = "events") {
44337
44337
  const credential = deps.credentialOf(sessionId);
44338
44338
  if (credential === void 0) {
44339
- return { ok: false, message: rcSessionNotObservedMessage(sessionId) };
44339
+ return { ok: false, message: rcSessionNotObservedMessage(sessionId), refusal: "not-observed" };
44340
44340
  }
44341
44341
  if (credential.authorization === void 0) {
44342
44342
  return noOAuthCredentialResult(sessionId);
@@ -44361,7 +44361,7 @@ async function interruptRcSession(deps, sessionId) {
44361
44361
  }
44362
44362
  async function setRcSessionModel(deps, sessionId, model) {
44363
44363
  if (model === "") {
44364
- return { ok: false, message: "a set-model write needs a non-empty model id: the SDK's own field treats an omitted or null value as a reset to the session default, which this operation never sends, and an empty string is neither" };
44364
+ return { ok: false, message: "a set-model write needs a non-empty model id: the SDK's own field treats an omitted or null value as a reset to the session default, which this operation never sends, and an empty string is neither", refusal: "invalid-input" };
44365
44365
  }
44366
44366
  const requestId = deps.newUuid();
44367
44367
  const result = await deliverRcClientPayload(deps, sessionId, buildRcSetModelPayload(requestId, model), `set the model on session ${sessionId}`);
@@ -44374,7 +44374,7 @@ async function setRcSessionPermissionMode(deps, sessionId, mode) {
44374
44374
  }
44375
44375
  async function endRcSession(deps, sessionId, reason) {
44376
44376
  if (reason === "") {
44377
- return { ok: false, message: "an end-session write needs either no reason or a non-empty one: the worker reads an absent reason as its own unspecified form, and an empty string is neither" };
44377
+ return { ok: false, message: "an end-session write needs either no reason or a non-empty one: the worker reads an absent reason as its own unspecified form, and an empty string is neither", refusal: "invalid-input" };
44378
44378
  }
44379
44379
  const requestId = deps.newUuid();
44380
44380
  const result = await deliverRcClientPayload(deps, sessionId, buildRcEndSessionPayload(requestId, reason), `end session ${sessionId}`);
@@ -44392,10 +44392,10 @@ async function getRcSessionContextUsage(deps, sessionId, detail) {
44392
44392
  }
44393
44393
  async function readRcSessionFile(deps, sessionId, path106, options) {
44394
44394
  if (path106 === "") {
44395
- return { ok: false, message: "a read-file write needs a non-empty path: the SDK's own field names the file the worker resolves against the session's cwd, and an empty string names none" };
44395
+ return { ok: false, message: "a read-file write needs a non-empty path: the SDK's own field names the file the worker resolves against the session's cwd, and an empty string names none", refusal: "invalid-input" };
44396
44396
  }
44397
44397
  if (options?.maxBytes !== void 0 && (!Number.isInteger(options.maxBytes) || options.maxBytes <= 0)) {
44398
- return { ok: false, message: "a read-file write's max-bytes is a positive whole number of bytes: the SDK's own field caps the read, and a zero or negative cap reads nothing" };
44398
+ return { ok: false, message: "a read-file write's max-bytes is a positive whole number of bytes: the SDK's own field caps the read, and a zero or negative cap reads nothing", refusal: "invalid-input" };
44399
44399
  }
44400
44400
  const requestId = deps.newUuid();
44401
44401
  const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId, path106, options), `read ${path106} from session ${sessionId}`);
@@ -44413,7 +44413,7 @@ async function getRcSessionMcpStatus(deps, sessionId) {
44413
44413
  }
44414
44414
  async function reconnectRcSessionMcpServer(deps, sessionId, serverName) {
44415
44415
  if (serverName === "") {
44416
- return { ok: false, message: "an mcp-reconnect write needs a non-empty server name: the SDK's own field names the server as mcp_status reports it, and an empty string names none" };
44416
+ return { ok: false, message: "an mcp-reconnect write needs a non-empty server name: the SDK's own field names the server as mcp_status reports it, and an empty string names none", refusal: "invalid-input" };
44417
44417
  }
44418
44418
  const requestId = deps.newUuid();
44419
44419
  const result = await deliverRcClientPayload(deps, sessionId, buildRcMcpReconnectPayload(requestId, serverName), `reconnect MCP server ${serverName} on session ${sessionId}`);
@@ -44421,7 +44421,7 @@ async function reconnectRcSessionMcpServer(deps, sessionId, serverName) {
44421
44421
  }
44422
44422
  async function authenticateRcSessionMcpServer(deps, sessionId, serverName, redirectUri) {
44423
44423
  if (serverName === "" || redirectUri === "") {
44424
- return { ok: false, message: "an mcp-authenticate write needs a non-empty server name and redirect URI: the CLI's own request names the server and where its OAuth flow redirects back to, and an empty string names neither" };
44424
+ return { ok: false, message: "an mcp-authenticate write needs a non-empty server name and redirect URI: the CLI's own request names the server and where its OAuth flow redirects back to, and an empty string names neither", refusal: "invalid-input" };
44425
44425
  }
44426
44426
  const requestId = deps.newUuid();
44427
44427
  const result = await deliverRcClientPayload(deps, sessionId, buildRcMcpAuthenticatePayload(requestId, serverName, redirectUri), `authenticate MCP server ${serverName} on session ${sessionId}`);
@@ -44429,7 +44429,7 @@ async function authenticateRcSessionMcpServer(deps, sessionId, serverName, redir
44429
44429
  }
44430
44430
  async function submitRcSessionMcpOAuthCallbackUrl(deps, sessionId, serverName, callbackUrl) {
44431
44431
  if (serverName === "" || callbackUrl === "") {
44432
- return { ok: false, message: "an mcp-oauth-callback-url write needs a non-empty server name and callback URL: the CLI's own request names the server and the URL its OAuth flow landed on, and an empty string names neither" };
44432
+ return { ok: false, message: "an mcp-oauth-callback-url write needs a non-empty server name and callback URL: the CLI's own request names the server and the URL its OAuth flow landed on, and an empty string names neither", refusal: "invalid-input" };
44433
44433
  }
44434
44434
  const requestId = deps.newUuid();
44435
44435
  const result = await deliverRcClientPayload(deps, sessionId, buildRcMcpOAuthCallbackUrlPayload(requestId, serverName, callbackUrl), `hand MCP server ${serverName}'s OAuth callback to session ${sessionId}`);
@@ -44440,7 +44440,7 @@ async function sendRcKeepAlive(deps, sessionId) {
44440
44440
  }
44441
44441
  async function teleportRcSession(deps, sessionId, marker) {
44442
44442
  if (marker === "") {
44443
- return { ok: false, message: "a teleport write needs a non-empty marker: the teleport relay anchors on a marker line's uuid and string content, and an empty string carries neither" };
44443
+ return { ok: false, message: "a teleport write needs a non-empty marker: the teleport relay anchors on a marker line's uuid and string content, and an empty string carries neither", refusal: "invalid-input" };
44444
44444
  }
44445
44445
  return await deliverRcClientPayload(deps, sessionId, buildRcUserMessagePayload(deps.newUuid(), sessionId, marker), `teleport a marker into session ${sessionId}`, "teleport-events");
44446
44446
  }
@@ -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.0",
75624
+ version: "14.6.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>",
@@ -145013,10 +145013,10 @@ function createRcSessionCommands(deps) {
145013
145013
  return void 0;
145014
145014
  }
145015
145015
  if ("refused" in target) {
145016
- return { kind: "refused", message: target.refused };
145016
+ return { kind: "refused", message: target.refused, refusal: "session-state" };
145017
145017
  }
145018
145018
  if (target.version === void 0 || !RC_SESSION_COMMAND_VERIFIED_VERSIONS.includes(target.version)) {
145019
- return { kind: "refused", message: unverifiedVersionMessage(sessionId, target.version, route === "supervised" ? "its supervisor's control plugin has not loaded" : "its launch's control plugin has not loaded") };
145019
+ return { kind: "refused", message: unverifiedVersionMessage(sessionId, target.version, route === "supervised" ? "its supervisor's control plugin has not loaded" : "its launch's control plugin has not loaded"), refusal: "session-state" };
145020
145020
  }
145021
145021
  return { kind: route, target };
145022
145022
  };
@@ -145030,18 +145030,18 @@ function createRcSessionCommands(deps) {
145030
145030
  return launched;
145031
145031
  }
145032
145032
  if (!deps.isObserved(sessionId)) {
145033
- return { kind: "refused", message: `the front door has not observed Remote Control session ${sessionId}` };
145033
+ return { kind: "refused", message: `the front door has not observed Remote Control session ${sessionId}`, refusal: "not-observed" };
145034
145034
  }
145035
145035
  if (deps.selfHost === void 0) {
145036
- return { kind: "refused", message: unsupportedMessage(sessionId) };
145036
+ return { kind: "refused", message: unsupportedMessage(sessionId), refusal: "session-state" };
145037
145037
  }
145038
145038
  const unavailable = deps.selfHost.unavailable();
145039
145039
  if (unavailable !== void 0) {
145040
- return { kind: "refused", message: `${noPluginReason(sessionId)}, and the door's self-hosted surface cannot take a command: ${unavailable}` };
145040
+ return { kind: "refused", message: `${noPluginReason(sessionId)}, and the door's self-hosted surface cannot take a command: ${unavailable}`, refusal: "session-state" };
145041
145041
  }
145042
145042
  const version2 = deps.selfHost.versionOf(sessionId);
145043
145043
  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") };
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" };
145045
145045
  }
145046
145046
  return { kind: "self-hosted", selfHost: deps.selfHost };
145047
145047
  };
@@ -145052,7 +145052,7 @@ function createRcSessionCommands(deps) {
145052
145052
  }
145053
145053
  const resolved = await resolveRoute(sessionId);
145054
145054
  if (resolved.kind === "refused") {
145055
- return { ok: false, message: resolved.message };
145055
+ return { ok: false, message: resolved.message, refusal: resolved.refusal };
145056
145056
  }
145057
145057
  if (resolved.kind !== "self-hosted") {
145058
145058
  const waitMs2 = options.waitMs ?? COMPACT_TIMEOUT_MS;
@@ -145078,7 +145078,7 @@ function createRcSessionCommands(deps) {
145078
145078
  const transcriptGoal = async (sessionId, target) => {
145079
145079
  const goal = target.transcriptPath === void 0 ? void 0 : await deps.goalOf(target.transcriptPath);
145080
145080
  if (goal === void 0) {
145081
- return { ok: false, message: `session ${sessionId}'s transcript has not been recorded yet, which is where its goal is read from; retry once it has finished a turn` };
145081
+ return { ok: false, message: `session ${sessionId}'s transcript has not been recorded yet, which is where its goal is read from; retry once it has finished a turn`, refusal: "session-state" };
145082
145082
  }
145083
145083
  return { ok: true, report: goal };
145084
145084
  };
@@ -145094,7 +145094,7 @@ function createRcSessionCommands(deps) {
145094
145094
  const waitOf = (options) => options.waitMs;
145095
145095
  const transcriptPluginTurns = async (sessionId, target) => {
145096
145096
  const turns = target.transcriptPath === void 0 ? void 0 : await deps.pluginTurnsOf(target.transcriptPath);
145097
- return turns === void 0 ? { ok: false, message: `session ${sessionId}'s transcript has not been recorded yet, which is where a turn is confirmed from; retry once it has finished a turn` } : { ok: true, report: turns };
145097
+ return turns === void 0 ? { ok: false, message: `session ${sessionId}'s transcript has not been recorded yet, which is where a turn is confirmed from; retry once it has finished a turn`, refusal: "session-state" } : { ok: true, report: turns };
145098
145098
  };
145099
145099
  return {
145100
145100
  /** Which route the verbs would take for the session now, or the refusal naming why none would; reads only, outside the session's queue, so a verb waiting on the session never delays it. */
@@ -145107,13 +145107,13 @@ function createRcSessionCommands(deps) {
145107
145107
  */
145108
145108
  turn: async (sessionId, text5, options = {}) => {
145109
145109
  if (text5.trim() === "") {
145110
- return { ok: false, message: "a turn needs non-empty text" };
145110
+ return { ok: false, message: "a turn needs non-empty text", refusal: "invalid-input" };
145111
145111
  }
145112
145112
  if (text5.trimStart().startsWith("/")) {
145113
- return { ok: false, message: "a turn's text starts with /, which the session would read as a slash command rather than a message, and the turn could not be confirmed as one; use the goal or compaction verbs for those commands, or start the text with something else" };
145113
+ return { ok: false, message: "a turn's text starts with /, which the session would read as a slash command rather than a message, and the turn could not be confirmed as one; use the goal or compaction verbs for those commands, or start the text with something else", refusal: "invalid-input" };
145114
145114
  }
145115
145115
  if (text5.length > RC_TURN_TEXT_MAX_CHARS) {
145116
- return { ok: false, message: `a turn's text is limited to ${String(RC_TURN_TEXT_MAX_CHARS)} characters, and this one has ${String(text5.length)}` };
145116
+ return { ok: false, message: `a turn's text is limited to ${String(RC_TURN_TEXT_MAX_CHARS)} characters, and this one has ${String(text5.length)}`, refusal: "invalid-input" };
145117
145117
  }
145118
145118
  return await onRoute(sessionId, options, {
145119
145119
  plugin: async (target, route, signal, waitMs) => {
@@ -145162,16 +145162,16 @@ function createRcSessionCommands(deps) {
145162
145162
  goalSet: async (sessionId, condition, options = {}) => {
145163
145163
  const trimmed = condition.trim();
145164
145164
  if (trimmed === "") {
145165
- return { ok: false, message: "a goal set needs a non-empty condition" };
145165
+ return { ok: false, message: "a goal set needs a non-empty condition", refusal: "invalid-input" };
145166
145166
  }
145167
145167
  if (RC_GOAL_CLEAR_WORDS.includes(trimmed.toLowerCase())) {
145168
- return { ok: false, message: `"${trimmed}" cannot be set as a goal condition: /goal reads ${RC_GOAL_CLEAR_WORDS.join(", ")} as a request to clear the goal, so use the clear verb for that` };
145168
+ return { ok: false, message: `"${trimmed}" cannot be set as a goal condition: /goal reads ${RC_GOAL_CLEAR_WORDS.join(", ")} as a request to clear the goal, so use the clear verb for that`, refusal: "invalid-input" };
145169
145169
  }
145170
145170
  if (/[\r\n]/u.test(trimmed)) {
145171
- return { ok: false, message: "a goal condition is one line: /goal reads its condition from the line it is typed on, and both routes confirm the goal by the exact condition, so a condition spanning lines is refused rather than set as something else" };
145171
+ return { ok: false, message: "a goal condition is one line: /goal reads its condition from the line it is typed on, and both routes confirm the goal by the exact condition, so a condition spanning lines is refused rather than set as something else", refusal: "invalid-input" };
145172
145172
  }
145173
145173
  if (trimmed.length > RC_GOAL_CONDITION_MAX_CHARS) {
145174
- return { ok: false, message: `a goal condition is limited to ${String(RC_GOAL_CONDITION_MAX_CHARS)} characters, and this one has ${String(trimmed.length)}` };
145174
+ return { ok: false, message: `a goal condition is limited to ${String(RC_GOAL_CONDITION_MAX_CHARS)} characters, and this one has ${String(trimmed.length)}`, refusal: "invalid-input" };
145175
145175
  }
145176
145176
  return await onRoute(sessionId, options, {
145177
145177
  plugin: async (target, route, signal, waitMs) => {
@@ -145314,17 +145314,25 @@ function doorApiAuth(expectedToken) {
145314
145314
  }
145315
145315
  var RC_API_TAG = "remote-control";
145316
145316
  var RC_DIRECTIVE_TAG = "remote-control-directives";
145317
+ var RC_REFUSAL_CODES = {
145318
+ "invalid-input": "BAD_REQUEST",
145319
+ "not-observed": "NOT_FOUND",
145320
+ "session-state": "CONFLICT"
145321
+ };
145322
+ function refusalOf(failure2) {
145323
+ return new ORPCError(failure2.refusal === void 0 ? "BAD_GATEWAY" : RC_REFUSAL_CODES[failure2.refusal], { message: failure2.message });
145324
+ }
145317
145325
  function createRcApiRouter(deps) {
145318
145326
  const authed = doorApiAuth(deps.expectedToken);
145319
145327
  const delivered = (sessionId, result) => {
145320
145328
  if (!result.ok) {
145321
- throw new ORPCError("BAD_GATEWAY", { message: result.message });
145329
+ throw refusalOf(result);
145322
145330
  }
145323
145331
  return result.sequenceNums;
145324
145332
  };
145325
145333
  const deliveredControl = (sessionId, result) => {
145326
145334
  if (!result.ok) {
145327
- throw new ORPCError("BAD_GATEWAY", { message: result.message });
145335
+ throw refusalOf(result);
145328
145336
  }
145329
145337
  if (result.requestId === void 0) {
145330
145338
  throw new ORPCError("INTERNAL_SERVER_ERROR", { message: "the control request was delivered but the door cannot name the request id it minted, so the worker's answer cannot be matched" });
@@ -145333,7 +145341,7 @@ function createRcApiRouter(deps) {
145333
145341
  };
145334
145342
  const commanded = (sessionId, result) => {
145335
145343
  if (!result.ok) {
145336
- throw new ORPCError("BAD_GATEWAY", { message: result.message });
145344
+ throw refusalOf(result);
145337
145345
  }
145338
145346
  return { session: sessionId, ...result.report };
145339
145347
  };
@@ -173805,7 +173813,7 @@ function memberTexts(member, nowMs) {
173805
173813
  ...quotaRow2 === void 0 ? {} : { quota: quotaRow2.detail === void 0 ? quotaRow2.value : `${quotaRow2.value} (${quotaRow2.detail})` }
173806
173814
  };
173807
173815
  }
173808
- function refusalOf(candidate) {
173816
+ function refusalOf2(candidate) {
173809
173817
  return candidate.class === "ineligible" ? candidate.reasons[0] : void 0;
173810
173818
  }
173811
173819
  function accountsDiffer(members2, left, right) {
@@ -173845,7 +173853,7 @@ function poolContext(params, poolName, resuming, nowMs) {
173845
173853
  rank: index + 1,
173846
173854
  heading: candidateHeading(candidate),
173847
173855
  picked: candidate.identity === pick2,
173848
- detail: refusalOf(candidate),
173856
+ detail: refusalOf2(candidate),
173849
173857
  ...memberTexts(members2.find((member) => member.identity === candidate.identity), nowMs)
173850
173858
  })
173851
173859
  })),
@@ -173875,7 +173883,7 @@ function identityContext(params, resuming, nowMs) {
173875
173883
  const limited = named !== void 0 && candidates.some((candidate) => candidate.identity === named && candidate.class === "ineligible");
173876
173884
  const identityEntries = candidates.map((candidate) => ({
173877
173885
  value: candidate.identity,
173878
- label: pickerLabel({ identity: candidate.identity, detail: refusalOf(candidate), ...memberTexts(members2.find((member) => member.identity === candidate.identity), nowMs) })
173886
+ label: pickerLabel({ identity: candidate.identity, detail: refusalOf2(candidate), ...memberTexts(members2.find((member) => member.identity === candidate.identity), nowMs) })
173879
173887
  }));
173880
173888
  const poolEntries = Object.entries(params.pools ?? {}).map(([name, pool]) => ({
173881
173889
  value: `pool:${name}`,
package/dist/index.cjs CHANGED
@@ -7532,7 +7532,7 @@ function rcEventWriteResultFromAnswer(answer) {
7532
7532
  return { ok: true, sequenceNums };
7533
7533
  }
7534
7534
  function noOAuthCredentialResult(sessionId) {
7535
- return { ok: false, message: `no claude.ai OAuth bearer has been observed for session ${sessionId}: only worker calls crossed this door, and the worker JWT they carry is answered 401 on the client half. Reconnect Remote Control through this door and the create's own bearer will be observed` };
7535
+ return { ok: false, message: `no claude.ai OAuth bearer has been observed for session ${sessionId}: only worker calls crossed this door, and the worker JWT they carry is answered 401 on the client half. Reconnect Remote Control through this door and the create's own bearer will be observed`, refusal: "session-state" };
7536
7536
  }
7537
7537
  function rcSessionNotObservedMessage(sessionId) {
7538
7538
  return `the front door has not observed Remote Control session ${sessionId}: it may never have passed through this door, or it ended or expired (an entry lives only a bounded idle period past its last observed traffic)`;
@@ -7553,7 +7553,7 @@ function rcWriteHeaders(credential) {
7553
7553
  async function injectRcUserMessage(deps, sessionId, text) {
7554
7554
  const credential = deps.credentialOf(sessionId);
7555
7555
  if (credential === void 0) {
7556
- return { ok: false, message: rcSessionNotObservedMessage(sessionId) };
7556
+ return { ok: false, message: rcSessionNotObservedMessage(sessionId), refusal: "not-observed" };
7557
7557
  }
7558
7558
  if (credential.authorization === void 0) {
7559
7559
  return noOAuthCredentialResult(sessionId);
@@ -7650,22 +7650,22 @@ function questionAnswerInput(deps, sessionId, pending, decision) {
7650
7650
  async function answerRcControlRequest(deps, sessionId, requestId, decision) {
7651
7651
  const credential = deps.credentialOf(sessionId);
7652
7652
  if (credential === void 0) {
7653
- return { ok: false, message: rcSessionNotObservedMessage(sessionId) };
7653
+ return { ok: false, message: rcSessionNotObservedMessage(sessionId), refusal: "not-observed" };
7654
7654
  }
7655
7655
  if (credential.authorization === void 0) {
7656
7656
  return noOAuthCredentialResult(sessionId);
7657
7657
  }
7658
7658
  const pending = deps.pendingOf(sessionId).find((candidate) => candidate.requestId === requestId);
7659
7659
  if (pending === void 0) {
7660
- return { ok: false, message: `the front door has not observed control request ${requestId} pending on session ${sessionId}: it was answered already (by this door, by an attached client or in the session's own terminal), the worker withdrew it, or it never passed through this door` };
7660
+ return { ok: false, message: `the front door has not observed control request ${requestId} pending on session ${sessionId}: it was answered already (by this door, by an attached client or in the session's own terminal), the worker withdrew it, or it never passed through this door`, refusal: "not-observed" };
7661
7661
  }
7662
7662
  const updatedInput = questionAnswerInput(deps, sessionId, pending, decision);
7663
7663
  if (updatedInput !== void 0 && "error" in updatedInput) {
7664
- return { ok: false, message: updatedInput.error };
7664
+ return { ok: false, message: updatedInput.error, refusal: "invalid-input" };
7665
7665
  }
7666
7666
  const release = deps.claimPending(sessionId, requestId);
7667
7667
  if (release === void 0) {
7668
- return { ok: false, message: `another answer to control request ${requestId} on session ${sessionId} is being written right now; the worker takes only one, so this one was not sent` };
7668
+ return { ok: false, message: `another answer to control request ${requestId} on session ${sessionId} is being written right now; the worker takes only one, so this one was not sent`, refusal: "session-state" };
7669
7669
  }
7670
7670
  const body = JSON.stringify(buildRcEventWriteBody(buildRcControlResponsePayload(requestId, decision, updatedInput?.input)));
7671
7671
  let answer;
@@ -7686,7 +7686,7 @@ async function answerRcControlRequest(deps, sessionId, requestId, decision) {
7686
7686
  async function deliverRcClientPayload(deps, sessionId, payload, action, to = "events") {
7687
7687
  const credential = deps.credentialOf(sessionId);
7688
7688
  if (credential === void 0) {
7689
- return { ok: false, message: rcSessionNotObservedMessage(sessionId) };
7689
+ return { ok: false, message: rcSessionNotObservedMessage(sessionId), refusal: "not-observed" };
7690
7690
  }
7691
7691
  if (credential.authorization === void 0) {
7692
7692
  return noOAuthCredentialResult(sessionId);
@@ -7711,7 +7711,7 @@ async function interruptRcSession(deps, sessionId) {
7711
7711
  }
7712
7712
  async function setRcSessionModel(deps, sessionId, model) {
7713
7713
  if (model === "") {
7714
- return { ok: false, message: "a set-model write needs a non-empty model id: the SDK's own field treats an omitted or null value as a reset to the session default, which this operation never sends, and an empty string is neither" };
7714
+ return { ok: false, message: "a set-model write needs a non-empty model id: the SDK's own field treats an omitted or null value as a reset to the session default, which this operation never sends, and an empty string is neither", refusal: "invalid-input" };
7715
7715
  }
7716
7716
  const requestId = deps.newUuid();
7717
7717
  const result = await deliverRcClientPayload(deps, sessionId, buildRcSetModelPayload(requestId, model), `set the model on session ${sessionId}`);
@@ -7724,7 +7724,7 @@ async function setRcSessionPermissionMode(deps, sessionId, mode) {
7724
7724
  }
7725
7725
  async function endRcSession(deps, sessionId, reason) {
7726
7726
  if (reason === "") {
7727
- return { ok: false, message: "an end-session write needs either no reason or a non-empty one: the worker reads an absent reason as its own unspecified form, and an empty string is neither" };
7727
+ return { ok: false, message: "an end-session write needs either no reason or a non-empty one: the worker reads an absent reason as its own unspecified form, and an empty string is neither", refusal: "invalid-input" };
7728
7728
  }
7729
7729
  const requestId = deps.newUuid();
7730
7730
  const result = await deliverRcClientPayload(deps, sessionId, buildRcEndSessionPayload(requestId, reason), `end session ${sessionId}`);
@@ -7742,10 +7742,10 @@ async function getRcSessionContextUsage(deps, sessionId, detail) {
7742
7742
  }
7743
7743
  async function readRcSessionFile(deps, sessionId, path59, options) {
7744
7744
  if (path59 === "") {
7745
- return { ok: false, message: "a read-file write needs a non-empty path: the SDK's own field names the file the worker resolves against the session's cwd, and an empty string names none" };
7745
+ return { ok: false, message: "a read-file write needs a non-empty path: the SDK's own field names the file the worker resolves against the session's cwd, and an empty string names none", refusal: "invalid-input" };
7746
7746
  }
7747
7747
  if (options?.maxBytes !== void 0 && (!Number.isInteger(options.maxBytes) || options.maxBytes <= 0)) {
7748
- return { ok: false, message: "a read-file write's max-bytes is a positive whole number of bytes: the SDK's own field caps the read, and a zero or negative cap reads nothing" };
7748
+ return { ok: false, message: "a read-file write's max-bytes is a positive whole number of bytes: the SDK's own field caps the read, and a zero or negative cap reads nothing", refusal: "invalid-input" };
7749
7749
  }
7750
7750
  const requestId = deps.newUuid();
7751
7751
  const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId, path59, options), `read ${path59} from session ${sessionId}`);
@@ -7763,7 +7763,7 @@ async function getRcSessionMcpStatus(deps, sessionId) {
7763
7763
  }
7764
7764
  async function reconnectRcSessionMcpServer(deps, sessionId, serverName) {
7765
7765
  if (serverName === "") {
7766
- return { ok: false, message: "an mcp-reconnect write needs a non-empty server name: the SDK's own field names the server as mcp_status reports it, and an empty string names none" };
7766
+ return { ok: false, message: "an mcp-reconnect write needs a non-empty server name: the SDK's own field names the server as mcp_status reports it, and an empty string names none", refusal: "invalid-input" };
7767
7767
  }
7768
7768
  const requestId = deps.newUuid();
7769
7769
  const result = await deliverRcClientPayload(deps, sessionId, buildRcMcpReconnectPayload(requestId, serverName), `reconnect MCP server ${serverName} on session ${sessionId}`);
@@ -7771,7 +7771,7 @@ async function reconnectRcSessionMcpServer(deps, sessionId, serverName) {
7771
7771
  }
7772
7772
  async function authenticateRcSessionMcpServer(deps, sessionId, serverName, redirectUri) {
7773
7773
  if (serverName === "" || redirectUri === "") {
7774
- return { ok: false, message: "an mcp-authenticate write needs a non-empty server name and redirect URI: the CLI's own request names the server and where its OAuth flow redirects back to, and an empty string names neither" };
7774
+ return { ok: false, message: "an mcp-authenticate write needs a non-empty server name and redirect URI: the CLI's own request names the server and where its OAuth flow redirects back to, and an empty string names neither", refusal: "invalid-input" };
7775
7775
  }
7776
7776
  const requestId = deps.newUuid();
7777
7777
  const result = await deliverRcClientPayload(deps, sessionId, buildRcMcpAuthenticatePayload(requestId, serverName, redirectUri), `authenticate MCP server ${serverName} on session ${sessionId}`);
@@ -7779,7 +7779,7 @@ async function authenticateRcSessionMcpServer(deps, sessionId, serverName, redir
7779
7779
  }
7780
7780
  async function submitRcSessionMcpOAuthCallbackUrl(deps, sessionId, serverName, callbackUrl) {
7781
7781
  if (serverName === "" || callbackUrl === "") {
7782
- return { ok: false, message: "an mcp-oauth-callback-url write needs a non-empty server name and callback URL: the CLI's own request names the server and the URL its OAuth flow landed on, and an empty string names neither" };
7782
+ return { ok: false, message: "an mcp-oauth-callback-url write needs a non-empty server name and callback URL: the CLI's own request names the server and the URL its OAuth flow landed on, and an empty string names neither", refusal: "invalid-input" };
7783
7783
  }
7784
7784
  const requestId = deps.newUuid();
7785
7785
  const result = await deliverRcClientPayload(deps, sessionId, buildRcMcpOAuthCallbackUrlPayload(requestId, serverName, callbackUrl), `hand MCP server ${serverName}'s OAuth callback to session ${sessionId}`);
@@ -7790,7 +7790,7 @@ async function sendRcKeepAlive(deps, sessionId) {
7790
7790
  }
7791
7791
  async function teleportRcSession(deps, sessionId, marker) {
7792
7792
  if (marker === "") {
7793
- return { ok: false, message: "a teleport write needs a non-empty marker: the teleport relay anchors on a marker line's uuid and string content, and an empty string carries neither" };
7793
+ return { ok: false, message: "a teleport write needs a non-empty marker: the teleport relay anchors on a marker line's uuid and string content, and an empty string carries neither", refusal: "invalid-input" };
7794
7794
  }
7795
7795
  return await deliverRcClientPayload(deps, sessionId, buildRcUserMessagePayload(deps.newUuid(), sessionId, marker), `teleport a marker into session ${sessionId}`, "teleport-events");
7796
7796
  }
@@ -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.0",
14307
+ version: "14.6.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>",
@@ -20625,10 +20625,10 @@ function createRcSessionCommands(deps) {
20625
20625
  return void 0;
20626
20626
  }
20627
20627
  if ("refused" in target) {
20628
- return { kind: "refused", message: target.refused };
20628
+ return { kind: "refused", message: target.refused, refusal: "session-state" };
20629
20629
  }
20630
20630
  if (target.version === void 0 || !RC_SESSION_COMMAND_VERIFIED_VERSIONS.includes(target.version)) {
20631
- return { kind: "refused", message: unverifiedVersionMessage(sessionId, target.version, route === "supervised" ? "its supervisor's control plugin has not loaded" : "its launch's control plugin has not loaded") };
20631
+ return { kind: "refused", message: unverifiedVersionMessage(sessionId, target.version, route === "supervised" ? "its supervisor's control plugin has not loaded" : "its launch's control plugin has not loaded"), refusal: "session-state" };
20632
20632
  }
20633
20633
  return { kind: route, target };
20634
20634
  };
@@ -20642,18 +20642,18 @@ function createRcSessionCommands(deps) {
20642
20642
  return launched;
20643
20643
  }
20644
20644
  if (!deps.isObserved(sessionId)) {
20645
- return { kind: "refused", message: `the front door has not observed Remote Control session ${sessionId}` };
20645
+ return { kind: "refused", message: `the front door has not observed Remote Control session ${sessionId}`, refusal: "not-observed" };
20646
20646
  }
20647
20647
  if (deps.selfHost === void 0) {
20648
- return { kind: "refused", message: unsupportedMessage(sessionId) };
20648
+ return { kind: "refused", message: unsupportedMessage(sessionId), refusal: "session-state" };
20649
20649
  }
20650
20650
  const unavailable = deps.selfHost.unavailable();
20651
20651
  if (unavailable !== void 0) {
20652
- return { kind: "refused", message: `${noPluginReason(sessionId)}, and the door's self-hosted surface cannot take a command: ${unavailable}` };
20652
+ return { kind: "refused", message: `${noPluginReason(sessionId)}, and the door's self-hosted surface cannot take a command: ${unavailable}`, refusal: "session-state" };
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") };
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" };
20657
20657
  }
20658
20658
  return { kind: "self-hosted", selfHost: deps.selfHost };
20659
20659
  };
@@ -20664,7 +20664,7 @@ function createRcSessionCommands(deps) {
20664
20664
  }
20665
20665
  const resolved = await resolveRoute(sessionId);
20666
20666
  if (resolved.kind === "refused") {
20667
- return { ok: false, message: resolved.message };
20667
+ return { ok: false, message: resolved.message, refusal: resolved.refusal };
20668
20668
  }
20669
20669
  if (resolved.kind !== "self-hosted") {
20670
20670
  const waitMs2 = options.waitMs ?? COMPACT_TIMEOUT_MS;
@@ -20690,7 +20690,7 @@ function createRcSessionCommands(deps) {
20690
20690
  const transcriptGoal = async (sessionId, target) => {
20691
20691
  const goal = target.transcriptPath === void 0 ? void 0 : await deps.goalOf(target.transcriptPath);
20692
20692
  if (goal === void 0) {
20693
- return { ok: false, message: `session ${sessionId}'s transcript has not been recorded yet, which is where its goal is read from; retry once it has finished a turn` };
20693
+ return { ok: false, message: `session ${sessionId}'s transcript has not been recorded yet, which is where its goal is read from; retry once it has finished a turn`, refusal: "session-state" };
20694
20694
  }
20695
20695
  return { ok: true, report: goal };
20696
20696
  };
@@ -20706,7 +20706,7 @@ function createRcSessionCommands(deps) {
20706
20706
  const waitOf = (options) => options.waitMs;
20707
20707
  const transcriptPluginTurns = async (sessionId, target) => {
20708
20708
  const turns = target.transcriptPath === void 0 ? void 0 : await deps.pluginTurnsOf(target.transcriptPath);
20709
- return turns === void 0 ? { ok: false, message: `session ${sessionId}'s transcript has not been recorded yet, which is where a turn is confirmed from; retry once it has finished a turn` } : { ok: true, report: turns };
20709
+ return turns === void 0 ? { ok: false, message: `session ${sessionId}'s transcript has not been recorded yet, which is where a turn is confirmed from; retry once it has finished a turn`, refusal: "session-state" } : { ok: true, report: turns };
20710
20710
  };
20711
20711
  return {
20712
20712
  /** Which route the verbs would take for the session now, or the refusal naming why none would; reads only, outside the session's queue, so a verb waiting on the session never delays it. */
@@ -20719,13 +20719,13 @@ function createRcSessionCommands(deps) {
20719
20719
  */
20720
20720
  turn: async (sessionId, text, options = {}) => {
20721
20721
  if (text.trim() === "") {
20722
- return { ok: false, message: "a turn needs non-empty text" };
20722
+ return { ok: false, message: "a turn needs non-empty text", refusal: "invalid-input" };
20723
20723
  }
20724
20724
  if (text.trimStart().startsWith("/")) {
20725
- return { ok: false, message: "a turn's text starts with /, which the session would read as a slash command rather than a message, and the turn could not be confirmed as one; use the goal or compaction verbs for those commands, or start the text with something else" };
20725
+ return { ok: false, message: "a turn's text starts with /, which the session would read as a slash command rather than a message, and the turn could not be confirmed as one; use the goal or compaction verbs for those commands, or start the text with something else", refusal: "invalid-input" };
20726
20726
  }
20727
20727
  if (text.length > RC_TURN_TEXT_MAX_CHARS) {
20728
- return { ok: false, message: `a turn's text is limited to ${String(RC_TURN_TEXT_MAX_CHARS)} characters, and this one has ${String(text.length)}` };
20728
+ return { ok: false, message: `a turn's text is limited to ${String(RC_TURN_TEXT_MAX_CHARS)} characters, and this one has ${String(text.length)}`, refusal: "invalid-input" };
20729
20729
  }
20730
20730
  return await onRoute(sessionId, options, {
20731
20731
  plugin: async (target, route, signal, waitMs) => {
@@ -20774,16 +20774,16 @@ function createRcSessionCommands(deps) {
20774
20774
  goalSet: async (sessionId, condition, options = {}) => {
20775
20775
  const trimmed = condition.trim();
20776
20776
  if (trimmed === "") {
20777
- return { ok: false, message: "a goal set needs a non-empty condition" };
20777
+ return { ok: false, message: "a goal set needs a non-empty condition", refusal: "invalid-input" };
20778
20778
  }
20779
20779
  if (RC_GOAL_CLEAR_WORDS.includes(trimmed.toLowerCase())) {
20780
- return { ok: false, message: `"${trimmed}" cannot be set as a goal condition: /goal reads ${RC_GOAL_CLEAR_WORDS.join(", ")} as a request to clear the goal, so use the clear verb for that` };
20780
+ return { ok: false, message: `"${trimmed}" cannot be set as a goal condition: /goal reads ${RC_GOAL_CLEAR_WORDS.join(", ")} as a request to clear the goal, so use the clear verb for that`, refusal: "invalid-input" };
20781
20781
  }
20782
20782
  if (/[\r\n]/u.test(trimmed)) {
20783
- return { ok: false, message: "a goal condition is one line: /goal reads its condition from the line it is typed on, and both routes confirm the goal by the exact condition, so a condition spanning lines is refused rather than set as something else" };
20783
+ return { ok: false, message: "a goal condition is one line: /goal reads its condition from the line it is typed on, and both routes confirm the goal by the exact condition, so a condition spanning lines is refused rather than set as something else", refusal: "invalid-input" };
20784
20784
  }
20785
20785
  if (trimmed.length > RC_GOAL_CONDITION_MAX_CHARS) {
20786
- return { ok: false, message: `a goal condition is limited to ${String(RC_GOAL_CONDITION_MAX_CHARS)} characters, and this one has ${String(trimmed.length)}` };
20786
+ return { ok: false, message: `a goal condition is limited to ${String(RC_GOAL_CONDITION_MAX_CHARS)} characters, and this one has ${String(trimmed.length)}`, refusal: "invalid-input" };
20787
20787
  }
20788
20788
  return await onRoute(sessionId, options, {
20789
20789
  plugin: async (target, route, signal, waitMs) => {
@@ -20926,17 +20926,25 @@ function doorApiAuth(expectedToken) {
20926
20926
  }
20927
20927
  var RC_API_TAG = "remote-control";
20928
20928
  var RC_DIRECTIVE_TAG = "remote-control-directives";
20929
+ var RC_REFUSAL_CODES = {
20930
+ "invalid-input": "BAD_REQUEST",
20931
+ "not-observed": "NOT_FOUND",
20932
+ "session-state": "CONFLICT"
20933
+ };
20934
+ function refusalOf(failure) {
20935
+ return new import_client.ORPCError(failure.refusal === void 0 ? "BAD_GATEWAY" : RC_REFUSAL_CODES[failure.refusal], { message: failure.message });
20936
+ }
20929
20937
  function createRcApiRouter(deps) {
20930
20938
  const authed = doorApiAuth(deps.expectedToken);
20931
20939
  const delivered = (sessionId, result) => {
20932
20940
  if (!result.ok) {
20933
- throw new import_client.ORPCError("BAD_GATEWAY", { message: result.message });
20941
+ throw refusalOf(result);
20934
20942
  }
20935
20943
  return result.sequenceNums;
20936
20944
  };
20937
20945
  const deliveredControl = (sessionId, result) => {
20938
20946
  if (!result.ok) {
20939
- throw new import_client.ORPCError("BAD_GATEWAY", { message: result.message });
20947
+ throw refusalOf(result);
20940
20948
  }
20941
20949
  if (result.requestId === void 0) {
20942
20950
  throw new import_client.ORPCError("INTERNAL_SERVER_ERROR", { message: "the control request was delivered but the door cannot name the request id it minted, so the worker's answer cannot be matched" });
@@ -20945,7 +20953,7 @@ function createRcApiRouter(deps) {
20945
20953
  };
20946
20954
  const commanded = (sessionId, result) => {
20947
20955
  if (!result.ok) {
20948
- throw new import_client.ORPCError("BAD_GATEWAY", { message: result.message });
20956
+ throw refusalOf(result);
20949
20957
  }
20950
20958
  return { session: sessionId, ...result.report };
20951
20959
  };
package/dist/index.mjs CHANGED
@@ -7507,7 +7507,7 @@ function rcEventWriteResultFromAnswer(answer) {
7507
7507
  return { ok: true, sequenceNums };
7508
7508
  }
7509
7509
  function noOAuthCredentialResult(sessionId) {
7510
- return { ok: false, message: `no claude.ai OAuth bearer has been observed for session ${sessionId}: only worker calls crossed this door, and the worker JWT they carry is answered 401 on the client half. Reconnect Remote Control through this door and the create's own bearer will be observed` };
7510
+ return { ok: false, message: `no claude.ai OAuth bearer has been observed for session ${sessionId}: only worker calls crossed this door, and the worker JWT they carry is answered 401 on the client half. Reconnect Remote Control through this door and the create's own bearer will be observed`, refusal: "session-state" };
7511
7511
  }
7512
7512
  function rcSessionNotObservedMessage(sessionId) {
7513
7513
  return `the front door has not observed Remote Control session ${sessionId}: it may never have passed through this door, or it ended or expired (an entry lives only a bounded idle period past its last observed traffic)`;
@@ -7528,7 +7528,7 @@ function rcWriteHeaders(credential) {
7528
7528
  async function injectRcUserMessage(deps, sessionId, text) {
7529
7529
  const credential = deps.credentialOf(sessionId);
7530
7530
  if (credential === void 0) {
7531
- return { ok: false, message: rcSessionNotObservedMessage(sessionId) };
7531
+ return { ok: false, message: rcSessionNotObservedMessage(sessionId), refusal: "not-observed" };
7532
7532
  }
7533
7533
  if (credential.authorization === void 0) {
7534
7534
  return noOAuthCredentialResult(sessionId);
@@ -7625,22 +7625,22 @@ function questionAnswerInput(deps, sessionId, pending, decision) {
7625
7625
  async function answerRcControlRequest(deps, sessionId, requestId, decision) {
7626
7626
  const credential = deps.credentialOf(sessionId);
7627
7627
  if (credential === void 0) {
7628
- return { ok: false, message: rcSessionNotObservedMessage(sessionId) };
7628
+ return { ok: false, message: rcSessionNotObservedMessage(sessionId), refusal: "not-observed" };
7629
7629
  }
7630
7630
  if (credential.authorization === void 0) {
7631
7631
  return noOAuthCredentialResult(sessionId);
7632
7632
  }
7633
7633
  const pending = deps.pendingOf(sessionId).find((candidate) => candidate.requestId === requestId);
7634
7634
  if (pending === void 0) {
7635
- return { ok: false, message: `the front door has not observed control request ${requestId} pending on session ${sessionId}: it was answered already (by this door, by an attached client or in the session's own terminal), the worker withdrew it, or it never passed through this door` };
7635
+ return { ok: false, message: `the front door has not observed control request ${requestId} pending on session ${sessionId}: it was answered already (by this door, by an attached client or in the session's own terminal), the worker withdrew it, or it never passed through this door`, refusal: "not-observed" };
7636
7636
  }
7637
7637
  const updatedInput = questionAnswerInput(deps, sessionId, pending, decision);
7638
7638
  if (updatedInput !== void 0 && "error" in updatedInput) {
7639
- return { ok: false, message: updatedInput.error };
7639
+ return { ok: false, message: updatedInput.error, refusal: "invalid-input" };
7640
7640
  }
7641
7641
  const release = deps.claimPending(sessionId, requestId);
7642
7642
  if (release === void 0) {
7643
- return { ok: false, message: `another answer to control request ${requestId} on session ${sessionId} is being written right now; the worker takes only one, so this one was not sent` };
7643
+ return { ok: false, message: `another answer to control request ${requestId} on session ${sessionId} is being written right now; the worker takes only one, so this one was not sent`, refusal: "session-state" };
7644
7644
  }
7645
7645
  const body = JSON.stringify(buildRcEventWriteBody(buildRcControlResponsePayload(requestId, decision, updatedInput?.input)));
7646
7646
  let answer;
@@ -7661,7 +7661,7 @@ async function answerRcControlRequest(deps, sessionId, requestId, decision) {
7661
7661
  async function deliverRcClientPayload(deps, sessionId, payload, action, to = "events") {
7662
7662
  const credential = deps.credentialOf(sessionId);
7663
7663
  if (credential === void 0) {
7664
- return { ok: false, message: rcSessionNotObservedMessage(sessionId) };
7664
+ return { ok: false, message: rcSessionNotObservedMessage(sessionId), refusal: "not-observed" };
7665
7665
  }
7666
7666
  if (credential.authorization === void 0) {
7667
7667
  return noOAuthCredentialResult(sessionId);
@@ -7686,7 +7686,7 @@ async function interruptRcSession(deps, sessionId) {
7686
7686
  }
7687
7687
  async function setRcSessionModel(deps, sessionId, model) {
7688
7688
  if (model === "") {
7689
- return { ok: false, message: "a set-model write needs a non-empty model id: the SDK's own field treats an omitted or null value as a reset to the session default, which this operation never sends, and an empty string is neither" };
7689
+ return { ok: false, message: "a set-model write needs a non-empty model id: the SDK's own field treats an omitted or null value as a reset to the session default, which this operation never sends, and an empty string is neither", refusal: "invalid-input" };
7690
7690
  }
7691
7691
  const requestId = deps.newUuid();
7692
7692
  const result = await deliverRcClientPayload(deps, sessionId, buildRcSetModelPayload(requestId, model), `set the model on session ${sessionId}`);
@@ -7699,7 +7699,7 @@ async function setRcSessionPermissionMode(deps, sessionId, mode) {
7699
7699
  }
7700
7700
  async function endRcSession(deps, sessionId, reason) {
7701
7701
  if (reason === "") {
7702
- return { ok: false, message: "an end-session write needs either no reason or a non-empty one: the worker reads an absent reason as its own unspecified form, and an empty string is neither" };
7702
+ return { ok: false, message: "an end-session write needs either no reason or a non-empty one: the worker reads an absent reason as its own unspecified form, and an empty string is neither", refusal: "invalid-input" };
7703
7703
  }
7704
7704
  const requestId = deps.newUuid();
7705
7705
  const result = await deliverRcClientPayload(deps, sessionId, buildRcEndSessionPayload(requestId, reason), `end session ${sessionId}`);
@@ -7717,10 +7717,10 @@ async function getRcSessionContextUsage(deps, sessionId, detail) {
7717
7717
  }
7718
7718
  async function readRcSessionFile(deps, sessionId, path59, options) {
7719
7719
  if (path59 === "") {
7720
- return { ok: false, message: "a read-file write needs a non-empty path: the SDK's own field names the file the worker resolves against the session's cwd, and an empty string names none" };
7720
+ return { ok: false, message: "a read-file write needs a non-empty path: the SDK's own field names the file the worker resolves against the session's cwd, and an empty string names none", refusal: "invalid-input" };
7721
7721
  }
7722
7722
  if (options?.maxBytes !== void 0 && (!Number.isInteger(options.maxBytes) || options.maxBytes <= 0)) {
7723
- return { ok: false, message: "a read-file write's max-bytes is a positive whole number of bytes: the SDK's own field caps the read, and a zero or negative cap reads nothing" };
7723
+ return { ok: false, message: "a read-file write's max-bytes is a positive whole number of bytes: the SDK's own field caps the read, and a zero or negative cap reads nothing", refusal: "invalid-input" };
7724
7724
  }
7725
7725
  const requestId = deps.newUuid();
7726
7726
  const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId, path59, options), `read ${path59} from session ${sessionId}`);
@@ -7738,7 +7738,7 @@ async function getRcSessionMcpStatus(deps, sessionId) {
7738
7738
  }
7739
7739
  async function reconnectRcSessionMcpServer(deps, sessionId, serverName) {
7740
7740
  if (serverName === "") {
7741
- return { ok: false, message: "an mcp-reconnect write needs a non-empty server name: the SDK's own field names the server as mcp_status reports it, and an empty string names none" };
7741
+ return { ok: false, message: "an mcp-reconnect write needs a non-empty server name: the SDK's own field names the server as mcp_status reports it, and an empty string names none", refusal: "invalid-input" };
7742
7742
  }
7743
7743
  const requestId = deps.newUuid();
7744
7744
  const result = await deliverRcClientPayload(deps, sessionId, buildRcMcpReconnectPayload(requestId, serverName), `reconnect MCP server ${serverName} on session ${sessionId}`);
@@ -7746,7 +7746,7 @@ async function reconnectRcSessionMcpServer(deps, sessionId, serverName) {
7746
7746
  }
7747
7747
  async function authenticateRcSessionMcpServer(deps, sessionId, serverName, redirectUri) {
7748
7748
  if (serverName === "" || redirectUri === "") {
7749
- return { ok: false, message: "an mcp-authenticate write needs a non-empty server name and redirect URI: the CLI's own request names the server and where its OAuth flow redirects back to, and an empty string names neither" };
7749
+ return { ok: false, message: "an mcp-authenticate write needs a non-empty server name and redirect URI: the CLI's own request names the server and where its OAuth flow redirects back to, and an empty string names neither", refusal: "invalid-input" };
7750
7750
  }
7751
7751
  const requestId = deps.newUuid();
7752
7752
  const result = await deliverRcClientPayload(deps, sessionId, buildRcMcpAuthenticatePayload(requestId, serverName, redirectUri), `authenticate MCP server ${serverName} on session ${sessionId}`);
@@ -7754,7 +7754,7 @@ async function authenticateRcSessionMcpServer(deps, sessionId, serverName, redir
7754
7754
  }
7755
7755
  async function submitRcSessionMcpOAuthCallbackUrl(deps, sessionId, serverName, callbackUrl) {
7756
7756
  if (serverName === "" || callbackUrl === "") {
7757
- return { ok: false, message: "an mcp-oauth-callback-url write needs a non-empty server name and callback URL: the CLI's own request names the server and the URL its OAuth flow landed on, and an empty string names neither" };
7757
+ return { ok: false, message: "an mcp-oauth-callback-url write needs a non-empty server name and callback URL: the CLI's own request names the server and the URL its OAuth flow landed on, and an empty string names neither", refusal: "invalid-input" };
7758
7758
  }
7759
7759
  const requestId = deps.newUuid();
7760
7760
  const result = await deliverRcClientPayload(deps, sessionId, buildRcMcpOAuthCallbackUrlPayload(requestId, serverName, callbackUrl), `hand MCP server ${serverName}'s OAuth callback to session ${sessionId}`);
@@ -7765,7 +7765,7 @@ async function sendRcKeepAlive(deps, sessionId) {
7765
7765
  }
7766
7766
  async function teleportRcSession(deps, sessionId, marker) {
7767
7767
  if (marker === "") {
7768
- return { ok: false, message: "a teleport write needs a non-empty marker: the teleport relay anchors on a marker line's uuid and string content, and an empty string carries neither" };
7768
+ return { ok: false, message: "a teleport write needs a non-empty marker: the teleport relay anchors on a marker line's uuid and string content, and an empty string carries neither", refusal: "invalid-input" };
7769
7769
  }
7770
7770
  return await deliverRcClientPayload(deps, sessionId, buildRcUserMessagePayload(deps.newUuid(), sessionId, marker), `teleport a marker into session ${sessionId}`, "teleport-events");
7771
7771
  }
@@ -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.0",
14280
+ version: "14.6.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>",
@@ -20174,10 +20174,10 @@ function createRcSessionCommands(deps) {
20174
20174
  return void 0;
20175
20175
  }
20176
20176
  if ("refused" in target) {
20177
- return { kind: "refused", message: target.refused };
20177
+ return { kind: "refused", message: target.refused, refusal: "session-state" };
20178
20178
  }
20179
20179
  if (target.version === void 0 || !RC_SESSION_COMMAND_VERIFIED_VERSIONS.includes(target.version)) {
20180
- return { kind: "refused", message: unverifiedVersionMessage(sessionId, target.version, route === "supervised" ? "its supervisor's control plugin has not loaded" : "its launch's control plugin has not loaded") };
20180
+ return { kind: "refused", message: unverifiedVersionMessage(sessionId, target.version, route === "supervised" ? "its supervisor's control plugin has not loaded" : "its launch's control plugin has not loaded"), refusal: "session-state" };
20181
20181
  }
20182
20182
  return { kind: route, target };
20183
20183
  };
@@ -20191,18 +20191,18 @@ function createRcSessionCommands(deps) {
20191
20191
  return launched;
20192
20192
  }
20193
20193
  if (!deps.isObserved(sessionId)) {
20194
- return { kind: "refused", message: `the front door has not observed Remote Control session ${sessionId}` };
20194
+ return { kind: "refused", message: `the front door has not observed Remote Control session ${sessionId}`, refusal: "not-observed" };
20195
20195
  }
20196
20196
  if (deps.selfHost === void 0) {
20197
- return { kind: "refused", message: unsupportedMessage(sessionId) };
20197
+ return { kind: "refused", message: unsupportedMessage(sessionId), refusal: "session-state" };
20198
20198
  }
20199
20199
  const unavailable = deps.selfHost.unavailable();
20200
20200
  if (unavailable !== void 0) {
20201
- return { kind: "refused", message: `${noPluginReason(sessionId)}, and the door's self-hosted surface cannot take a command: ${unavailable}` };
20201
+ return { kind: "refused", message: `${noPluginReason(sessionId)}, and the door's self-hosted surface cannot take a command: ${unavailable}`, refusal: "session-state" };
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") };
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" };
20206
20206
  }
20207
20207
  return { kind: "self-hosted", selfHost: deps.selfHost };
20208
20208
  };
@@ -20213,7 +20213,7 @@ function createRcSessionCommands(deps) {
20213
20213
  }
20214
20214
  const resolved = await resolveRoute(sessionId);
20215
20215
  if (resolved.kind === "refused") {
20216
- return { ok: false, message: resolved.message };
20216
+ return { ok: false, message: resolved.message, refusal: resolved.refusal };
20217
20217
  }
20218
20218
  if (resolved.kind !== "self-hosted") {
20219
20219
  const waitMs2 = options.waitMs ?? COMPACT_TIMEOUT_MS;
@@ -20239,7 +20239,7 @@ function createRcSessionCommands(deps) {
20239
20239
  const transcriptGoal = async (sessionId, target) => {
20240
20240
  const goal = target.transcriptPath === void 0 ? void 0 : await deps.goalOf(target.transcriptPath);
20241
20241
  if (goal === void 0) {
20242
- return { ok: false, message: `session ${sessionId}'s transcript has not been recorded yet, which is where its goal is read from; retry once it has finished a turn` };
20242
+ return { ok: false, message: `session ${sessionId}'s transcript has not been recorded yet, which is where its goal is read from; retry once it has finished a turn`, refusal: "session-state" };
20243
20243
  }
20244
20244
  return { ok: true, report: goal };
20245
20245
  };
@@ -20255,7 +20255,7 @@ function createRcSessionCommands(deps) {
20255
20255
  const waitOf = (options) => options.waitMs;
20256
20256
  const transcriptPluginTurns = async (sessionId, target) => {
20257
20257
  const turns = target.transcriptPath === void 0 ? void 0 : await deps.pluginTurnsOf(target.transcriptPath);
20258
- return turns === void 0 ? { ok: false, message: `session ${sessionId}'s transcript has not been recorded yet, which is where a turn is confirmed from; retry once it has finished a turn` } : { ok: true, report: turns };
20258
+ return turns === void 0 ? { ok: false, message: `session ${sessionId}'s transcript has not been recorded yet, which is where a turn is confirmed from; retry once it has finished a turn`, refusal: "session-state" } : { ok: true, report: turns };
20259
20259
  };
20260
20260
  return {
20261
20261
  /** Which route the verbs would take for the session now, or the refusal naming why none would; reads only, outside the session's queue, so a verb waiting on the session never delays it. */
@@ -20268,13 +20268,13 @@ function createRcSessionCommands(deps) {
20268
20268
  */
20269
20269
  turn: async (sessionId, text, options = {}) => {
20270
20270
  if (text.trim() === "") {
20271
- return { ok: false, message: "a turn needs non-empty text" };
20271
+ return { ok: false, message: "a turn needs non-empty text", refusal: "invalid-input" };
20272
20272
  }
20273
20273
  if (text.trimStart().startsWith("/")) {
20274
- return { ok: false, message: "a turn's text starts with /, which the session would read as a slash command rather than a message, and the turn could not be confirmed as one; use the goal or compaction verbs for those commands, or start the text with something else" };
20274
+ return { ok: false, message: "a turn's text starts with /, which the session would read as a slash command rather than a message, and the turn could not be confirmed as one; use the goal or compaction verbs for those commands, or start the text with something else", refusal: "invalid-input" };
20275
20275
  }
20276
20276
  if (text.length > RC_TURN_TEXT_MAX_CHARS) {
20277
- return { ok: false, message: `a turn's text is limited to ${String(RC_TURN_TEXT_MAX_CHARS)} characters, and this one has ${String(text.length)}` };
20277
+ return { ok: false, message: `a turn's text is limited to ${String(RC_TURN_TEXT_MAX_CHARS)} characters, and this one has ${String(text.length)}`, refusal: "invalid-input" };
20278
20278
  }
20279
20279
  return await onRoute(sessionId, options, {
20280
20280
  plugin: async (target, route, signal, waitMs) => {
@@ -20323,16 +20323,16 @@ function createRcSessionCommands(deps) {
20323
20323
  goalSet: async (sessionId, condition, options = {}) => {
20324
20324
  const trimmed = condition.trim();
20325
20325
  if (trimmed === "") {
20326
- return { ok: false, message: "a goal set needs a non-empty condition" };
20326
+ return { ok: false, message: "a goal set needs a non-empty condition", refusal: "invalid-input" };
20327
20327
  }
20328
20328
  if (RC_GOAL_CLEAR_WORDS.includes(trimmed.toLowerCase())) {
20329
- return { ok: false, message: `"${trimmed}" cannot be set as a goal condition: /goal reads ${RC_GOAL_CLEAR_WORDS.join(", ")} as a request to clear the goal, so use the clear verb for that` };
20329
+ return { ok: false, message: `"${trimmed}" cannot be set as a goal condition: /goal reads ${RC_GOAL_CLEAR_WORDS.join(", ")} as a request to clear the goal, so use the clear verb for that`, refusal: "invalid-input" };
20330
20330
  }
20331
20331
  if (/[\r\n]/u.test(trimmed)) {
20332
- return { ok: false, message: "a goal condition is one line: /goal reads its condition from the line it is typed on, and both routes confirm the goal by the exact condition, so a condition spanning lines is refused rather than set as something else" };
20332
+ return { ok: false, message: "a goal condition is one line: /goal reads its condition from the line it is typed on, and both routes confirm the goal by the exact condition, so a condition spanning lines is refused rather than set as something else", refusal: "invalid-input" };
20333
20333
  }
20334
20334
  if (trimmed.length > RC_GOAL_CONDITION_MAX_CHARS) {
20335
- return { ok: false, message: `a goal condition is limited to ${String(RC_GOAL_CONDITION_MAX_CHARS)} characters, and this one has ${String(trimmed.length)}` };
20335
+ return { ok: false, message: `a goal condition is limited to ${String(RC_GOAL_CONDITION_MAX_CHARS)} characters, and this one has ${String(trimmed.length)}`, refusal: "invalid-input" };
20336
20336
  }
20337
20337
  return await onRoute(sessionId, options, {
20338
20338
  plugin: async (target, route, signal, waitMs) => {
@@ -20475,17 +20475,25 @@ function doorApiAuth(expectedToken) {
20475
20475
  }
20476
20476
  var RC_API_TAG = "remote-control";
20477
20477
  var RC_DIRECTIVE_TAG = "remote-control-directives";
20478
+ var RC_REFUSAL_CODES = {
20479
+ "invalid-input": "BAD_REQUEST",
20480
+ "not-observed": "NOT_FOUND",
20481
+ "session-state": "CONFLICT"
20482
+ };
20483
+ function refusalOf(failure) {
20484
+ return new ORPCError(failure.refusal === void 0 ? "BAD_GATEWAY" : RC_REFUSAL_CODES[failure.refusal], { message: failure.message });
20485
+ }
20478
20486
  function createRcApiRouter(deps) {
20479
20487
  const authed = doorApiAuth(deps.expectedToken);
20480
20488
  const delivered = (sessionId, result) => {
20481
20489
  if (!result.ok) {
20482
- throw new ORPCError("BAD_GATEWAY", { message: result.message });
20490
+ throw refusalOf(result);
20483
20491
  }
20484
20492
  return result.sequenceNums;
20485
20493
  };
20486
20494
  const deliveredControl = (sessionId, result) => {
20487
20495
  if (!result.ok) {
20488
- throw new ORPCError("BAD_GATEWAY", { message: result.message });
20496
+ throw refusalOf(result);
20489
20497
  }
20490
20498
  if (result.requestId === void 0) {
20491
20499
  throw new ORPCError("INTERNAL_SERVER_ERROR", { message: "the control request was delivered but the door cannot name the request id it minted, so the worker's answer cannot be matched" });
@@ -20494,7 +20502,7 @@ function createRcApiRouter(deps) {
20494
20502
  };
20495
20503
  const commanded = (sessionId, result) => {
20496
20504
  if (!result.ok) {
20497
- throw new ORPCError("BAD_GATEWAY", { message: result.message });
20505
+ throw refusalOf(result);
20498
20506
  }
20499
20507
  return { session: sessionId, ...result.report };
20500
20508
  };
@@ -7587,6 +7587,8 @@ interface RcEventDial {
7587
7587
  */
7588
7588
  readonly writeTeleportEvents: (sessionId: string, headers: Readonly<Record<string, string>>, body: string) => Promise<RcDialAnswer>;
7589
7589
  }
7590
+ /** Why the door refused an operation itself, before the session, the API host or the worker could fail it: `invalid-input` is a request that can never succeed as written, `not-observed` names a session (or, for an answer, a control request) the door does not observe, and `session-state` is a session the door observes but whose state does not let the operation run now (no route reaches it, its version is unverified, two launches claim it, only worker calls crossed the door, another answer is being written, its transcript is not recorded yet). A failure without one was attempted and not delivered: the API host, the plugin or the worker did not deliver it. */
7591
+ type RcRefusalKind = "invalid-input" | "not-observed" | "session-state";
7590
7592
  /**
7591
7593
  * What one client-half write produced: the sequence numbers the real service assigned, or a verbose failure message ready to show a user. A write that carried a `control_request` also names the request id it minted, because the worker's `control_response` echoes exactly that id on the stream: a consumer that wants the answer matches it there, and the id is surfaced here since only the door ever knew it.
7592
7594
  */
@@ -7597,6 +7599,7 @@ type RcEventWriteResult = {
7597
7599
  } | {
7598
7600
  readonly ok: false;
7599
7601
  readonly message: string;
7602
+ readonly refusal?: RcRefusalKind;
7600
7603
  };
7601
7604
  /** Maps one dial answer to the write result: an accepted write yields its sequence numbers; anything else yields a verbose message, with the 401 case naming the stale observed bearer as the cause. */
7602
7605
  declare function rcEventWriteResultFromAnswer(answer: RcDialAnswer): RcEventWriteResult;
@@ -8548,13 +8551,14 @@ type RcSessionRoute = {
8548
8551
  readonly route: null;
8549
8552
  readonly refused: string;
8550
8553
  };
8551
- /** One verb's outcome: the report, or a verbose failure ready to show a user. */
8554
+ /** One verb's outcome: the report, or a verbose failure ready to show a user. A failure carries a `refusal` when the door refused the verb itself; without one the verb was attempted and the session, its plugin or its worker did not deliver it (no answer in time, an answer that says it failed). */
8552
8555
  type RcSessionCommandResult<T> = {
8553
8556
  readonly ok: true;
8554
8557
  readonly report: T;
8555
8558
  } | {
8556
8559
  readonly ok: false;
8557
8560
  readonly message: string;
8561
+ readonly refusal?: RcRefusalKind;
8558
8562
  };
8559
8563
  /** The options every verb takes. */
8560
8564
  interface RcSessionCommandOptions {
@@ -28783,4 +28787,4 @@ declare const OWN_CLI_FILE_NAME = "cli.cjs";
28783
28787
  declare function agentShimCliPath(distDir?: string | undefined): string;
28784
28788
 
28785
28789
  export { AMBIENT_CREDENTIAL_VARS, AgentKindSchema, AgentMetaSchema, AgentNodeSchema, AgentTreesListInputSchema, AgentTreesListOutputSchema, AgentTreesShowInputSchema, AgentTreesShowOutputSchema, CHECK_CREDENTIAL_APPLIES, CODEX_APP_SERVER_GENERATED_AGAINST, CODEX_APP_SERVER_TIMEOUT_MS, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CheckReportJsonSchema, CheckRunInputSchema, CliError, CodexAccountReadSchema, CodexAppServerProtocolError, CodexAppServerRequestError, CodexAppServerUnavailableError, CodexLogoutOutputSchema, CodexRateLimitsReadSchema, CodexSignInSchema, CodexStatusOutputSchema, ConfigIdentityAddInputSchema, ConfigIdentityAddOutputSchema, ConfigIdentityRemoveInputSchema, ConfigIdentityRemoveOutputSchema, ConfigIdentitySetInputSchema, ConfigIdentitySetOutputSchema, ConfigIdentityUseOutputSchema, ConfigNameInputSchema, ConfigPoolAddInputSchema, ConfigPoolAddOutputSchema, ConfigPoolRemoveInputSchema, ConfigPoolRemoveOutputSchema, ConfigPoolSetInputSchema, ConfigPoolSetOutputSchema, ConfigPoolUseOutputSchema, ConfigProfileAddInputSchema, ConfigProfileAddOutputSchema, ConfigProfileRemoveInputSchema, ConfigProfileRemoveOutputSchema, ConfigProfileSchema, ConfigProfileSetInputSchema, ConfigProfileSetOutputSchema, ConfigProfileUseOutputSchema, ConfigProviderAddInputSchema, ConfigProviderAddOutputSchema, ConfigProviderRemoveInputSchema, ConfigProviderRemoveOutputSchema, ConfigProviderSetInputSchema, ConfigProviderSetOutputSchema, ConfigRuleAddInputSchema, ConfigRuleAddOutputSchema, ConfigRuleRemoveInputSchema, ConfigRuleRemoveOutputSchema, ConfigRuleSetInputSchema, ConfigRuleSetOutputSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, CredentialSummarySchema, DOOR_EVENT_BUFFER_EVENTS, DOOR_EVENT_SOURCE_RC, DOOR_HEALTH_EVENT_SOURCE, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, DoctorFindingSchema, DoctorRunOutputSchema, DoorEventSchema, DoorEventSourceQuerySchema, DoorHealthEventSchema, DuplicateIdentityNameError, EXIT_FAILURE, EXIT_USAGE, EffectiveWindowSchema, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorControlMaterialError, FrontDoorNotServingError, FrontDoorRestartOutputSchema, FrontDoorSessionStatusSchema, FrontDoorSessionsOutputSchema, FrontDoorStartError, FrontDoorStateSchema, FrontDoorStatusOutputSchema, GlobalConfigSchema, HeadroomSocketTargetSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LAUNCH_EVENT_SOURCE, LIVE_TASK_CAP, LaunchLifecycleEventSchema, LaunchRefusedError, LaunchResolveInputSchema, LaunchResolveOutputSchema, LegacyProviderFileError, LiveTaskSchema, MergedAgentNodeSchema, MergedAgentTreeSchema, OWN_CLI_FILE_NAME, PROMPT_CACHE_TTL_MS, PlanClassSchema, PoolGraphError, PoolNameSchema, PoolNotFoundError, PoolPickReportSchema, PoolSchema, PortableConfigSchema, ProfileAlreadyExistsError, ProfileNotFoundError, ProviderAlreadyExistsError, ProviderKindMismatchError, ProviderNotFoundError, ProviderSchema, QUOTA_EXPIRING_EVENT_SOURCE, QuotaExpiringEventSchema, RC_CONTEXT_USAGE_DETAILS, RC_GOAL_CLEAR_WORDS, RC_GOAL_CONDITION_MAX_CHARS, RC_IDLE_EXPIRY_MS, RC_ORPC_PATH_PREFIX, RC_PENDING_RETIRE_REASONS, RC_PERMISSION_MODES, RC_READ_FILE_ENCODINGS, RC_REQUEST_PARSE_CAP_BYTES, RC_SELF_HOST_ENV, RC_SELF_HOST_KEEPALIVE_MS, RC_SELF_HOST_RECORD_DIR, RC_SELF_HOST_RECORD_FILE, RC_SELF_HOST_RETENTION_MS, RC_SELF_HOST_SCOPE_LIST, RC_SELF_HOST_WORKER_JWT_TTL_SECONDS, RC_SESSIONS_PATH_PREFIX, RC_SESSION_COMMAND_MAX_WAIT_MS, RC_SESSION_COMMAND_VERIFIED_VERSIONS, RC_SESSION_END_REASONS, RC_SESSION_EVENT_LOG_CAPACITY, RC_STREAM_BACKOFF_MS, RC_WEB_FETCH_ALLOW_PRIVATE_ENV, RC_WEB_FETCH_DEADLINE_MS, RC_WEB_FETCH_MAX_BYTES, RC_WEB_FETCH_MAX_REDIRECTS, ROUTED_PATH_PREFIX, RcLiveRateLimitSchema, RcPermissionModeSchema, RcRateLimitInfoSchema, RcRateLimitWindowSchema, RcSessionEventCursorExpiredError, RcSessionEventSchema, RcSessionEventsPageInputSchema, RcSessionEventsReadInputSchema, RcSessionEventsReadOutputSchema, RcSessionEventsStreamInputSchema, RcSessionTransitionSchema, RcStreamEnvelopeSchema, RcStreamEventSchema, ResetRowSchema, ResetScheduleSchema, SessionAgentTreeSchema, SessionLookupError, SessionSummarySchema, TaskItemSchema, USAGE_EVENT_SOURCE, UpdateCheckOutputSchema, UsageChangeEventSchema, UsageError, UsageListOutputSchema, UsageLiveOutputSchema, UsageSnapshotError, UsageSnapshotSchema, UsageWindowsInputSchema, UsageWindowsOutputSchema, WhenSchema, WorkflowRunSchema, addDirectoryRule, addIdentity, addPool, addProvider, agentShimCliPath, answerRcControlRequest, applyAgentTaskEvent, authenticateRcSessionMcpServer, buildEntryFacts, buildLayoutPaths, buildRcControlRequestPayload, buildRcControlResponsePayload, buildRcEndSessionPayload, buildRcEventWriteBody, buildRcFileSuggestionsPayload, buildRcGetContextUsagePayload, buildRcGetUsagePayload, buildRcInterruptPayload, buildRcKeepAlivePayload, buildRcMarkReadBody, buildRcMcpAuthenticatePayload, buildRcMcpOAuthCallbackUrlPayload, buildRcMcpReconnectPayload, buildRcMcpStatusPayload, buildRcReadFilePayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, changePool, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectFrontDoorStatus, collectPoolPick, collectResets, collectSessionList, createAgentTreesApiRouter, createCodexApiRouter, createConfigApiRouter, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createDoorHealthPublisher, createEventsApiRouter, createLaunchApiRouter, createLaunchEventPublisher, createLeafCache, createLifecycleApiRouter, createLiveSessionRegistry, createProfile, createQuotaExpiringPublisher, createRcApiNodeHandler, createRcApiRouter, createRcClaudeCodeVersions, createRcControlHandler, createRcCredentialStore, createRcEventFanout, createRcLiveUsage, createRcSelfHostSurface, createRcSessionCommands, createRcSessionEventLog, createRcSessionEventsApiRouter, createRcSessionRegistryReader, createRcSessionTracker, createRcStreamHub, createSseParser, describeProviderEndpoint, detectAmbientCredential, doorApiAuth, doorApiNodeHandlerOf, effectiveWindow, endRcSession, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, evaluateWhen, fetchThroughWebProxy, followRcSessionEvents, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, formatFrontDoorStatus, forwardableHeaders, frontDoorApiClient, frontDoorApiFromState, frontDoorApiLink, frontDoorRcApiClient, frontDoorRcControl, generateCa, getRcSessionContextUsage, getRcSessionMcpStatus, getRcSessionUsage, headroomSocketTarget, identityExists, identityIdOf, identityNameOf, identityRecords, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isPrivateAddress, isRcContextUsageDetail, isRcPermissionMode, isRcReadFileEncoding, lateRcEventDial, lateRcStreamDial, launchRequiredUpstreams, listDirectoryRules, listIdentities, listProfiles, listProviders, listSessions, listUsageSnapshots, locateSession, matchBranch, mergeLiveTasks, mintLeaf, mintRcSelfHostCredential, observingRoutedRoute, parseConnectTarget, parseRcGoalOutput, parseRcStreamEnvelope, planOf, poolIdentities, poolSelectedByLaunch, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcFanoutOnDoorHub, rcLocalCommandAnswerOf, rcManualCompactBoundaryOf, rcObserverAsPassthrough, rcRateLimitInfoOf, rcSelfHostFromEnv, rcStatusWithRegistry, rcWebFetchAllowsPrivateFromEnv, readActiveIdentity, readCodexAccount, readCodexRateLimits, readDirectoryRules, readFarmManifest, readFrontDoorControlMaterial, readGlobalConfig, readIdentity, readIdentityById, readIdentityRecords, readPools, readProfile, readProvider, readRcSelfHostRecord, readRcSessionFile, readSessionAgentTree, readUsageSnapshot, realCodexAppServerPort, realConnectCertStore, realConnectEffects, realMemberProviderResolver, realRcControlTransport, realRcEventDial, realRcStreamDial, realRcWebFetch, realSessionFs, reconnectRcSessionMcpServer, recoverFarm, recoveryDiagnostics, refreshLaunchPoolUsage, refreshPoolUsage, refreshStalePoolMembers, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveClaudeLaunch, resolveDecisions, resolveLaunch, resolveLaunchSelection, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runClaudeLaunch, runDoctor, runFrontDoorSupervisor, runLaunchPlan, runLauncher, runSupervisor, sendRcKeepAlive, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, showSession, snapshotPath, spawnClaude, startConnectServer, submitRcSessionMcpOAuthCallbackUrl, suggestRcSessionFiles, summariseSession, teleportRcSession, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, watchedInstallEntry, withRegisteredSessionFacts, writeDirectoryRules };
28786
- export type { AddDirectoryRuleOptions, AddProviderInput, AgentKind, AgentNode, AgentReadFs, AgentTreesApiDeps, AgentTreesApiRouter, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, AnthropicUsageRefresher, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CheckReportJson, ClaudeLaunchPlan, ClaudeLaunchResolution, CodexAccountRead, CodexApiClient, CodexApiDeps, CodexApiRouter, CodexAppServerConnection, CodexAppServerPort, CodexAppServerReadOptions, CodexRateLimitsRead, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigApiDeps, ConfigApiRouter, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectLocalSurface, ConnectServerConfig, ConnectServerHandle, ConnectTarget, ControlApiClient, ControlApiDeps, ControlApiRouter, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, DoorApiClient, DoorApiContext, DoorApiDeps, DoorApiRouter, DoorEvent, DoorEventHub, DoorEventPublisher, DoorEventStream, DoorEventsApiDeps, DoorHealthEvent, DoorHealthPublisher, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorControlMaterial, FrontDoorRcControl, FrontDoorSessionStatus, FrontDoorStatus, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, IdentityNameRead, IdentityRecord, IdentityRecordsPort, IdentitySession, InjectedCredential, LaunchApiDeps, LaunchApiRouter, LaunchDecision, LaunchEventPublisher, LaunchLifecycleEvent, LaunchPlan, LaunchPoolDecision, LaunchResolution, LaunchSelection, Layer, LayerId, LayoutPaths, LeafCert, LifecycleApiClient, LifecycleApiDeps, LifecycleApiRouter, LiveSessionRegistry, LiveSessionRegistryPorts, LiveTask, LiveTaskBook, LocatedSession, MergedAgentNode, MergedAgentTree, NestedContribution, OwnExecutableStat, PlanClass, Pool, PoolChange, PoolMember, PoolPickReport, PoolPolicy, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, ProviderOf, QuotaExpiringEvent, QuotaExpiringPublisher, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcApiClient, RcApiDeps, RcApiRouter, RcClaudeCodeVersions, RcCompactOptions, RcCompactReport, RcContextUsageDetail, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcCredentialStore, RcDialAnswer, RcDialTarget, RcEventDial, RcEventFanout, RcEventWriteResult, RcExchangeObserver, RcGoal, RcGoalClearReport, RcGoalReport, RcGoalSetReport, RcInjectDeps, RcLiveRateLimit, RcLiveUsage, RcLiveUsageDeps, RcObservedCredential, RcObservedRequest, RcPendingQuestion, RcPendingRequestSummary, RcPendingRetireReason, RcPermissionMode, RcPresenceAnswer, RcQuestionOption, RcQuestionSelection, RcRateLimitInfo, RcRateLimitWindow, RcReadFileEncoding, RcReadFileOptions, RcRegisteredSession, RcRegistryIdentity, RcSelfHostCredentialRecord, RcSelfHostDeps, RcSelfHostMintResult, RcSelfHostSurface, RcSessionCommandDeps, RcSessionCommandOptions, RcSessionCommandResult, RcSessionCommandRoute, RcSessionCommands, RcSessionEndReason, RcSessionEvent, RcSessionEventLog, RcSessionEventLogDeps, RcSessionEventsApiDeps, RcSessionEventsApiRouter, RcSessionEventsRead, RcSessionEventsReadInput, RcSessionRegistryDeps, RcSessionRegistryFs, RcSessionRoute, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcSessionTransition, RcStreamAnswer, RcStreamDial, RcStreamEnvelope, RcStreamEvent, RcStreamHub, RcStreamHubDeps, RcSupervisedTarget, RcTurnReport, RcWebFetchDeps, RcWebFetchHop, RcWebFetchOutcome, RcWebFetcher, RcWorkerFact, RcWriteHeaders, ReadSessionOptions, RealMemberProviderParams, RecoverFarmParams, RecoveryResult, RefreshLaunchPoolUsageOptions, RefreshPoolUsageParams, RefreshStalePoolMembersParams, ResetRow, ResetSchedule, ResolveClaudeLaunchOptions, ResolveDecisionsInput, ResolveLaunchSelectionParams, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunClaudeLaunchOptions, RunDoctorParams, RunFrontDoorSupervisorOptions, RunLauncherParams, RunSupervisorOptions, SessionAgentTree, SessionCommandFs, SessionListFilters, SessionRef, SessionSummary, SessionView, SpawnClaudeParams, SseParsedEvent, StickyPick, SupervisorPorts, TaskItem, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageChangeEvent, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation, WorkflowRun };
28790
+ export type { AddDirectoryRuleOptions, AddProviderInput, AgentKind, AgentNode, AgentReadFs, AgentTreesApiDeps, AgentTreesApiRouter, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, AnthropicUsageRefresher, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CheckReportJson, ClaudeLaunchPlan, ClaudeLaunchResolution, CodexAccountRead, CodexApiClient, CodexApiDeps, CodexApiRouter, CodexAppServerConnection, CodexAppServerPort, CodexAppServerReadOptions, CodexRateLimitsRead, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigApiDeps, ConfigApiRouter, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectLocalSurface, ConnectServerConfig, ConnectServerHandle, ConnectTarget, ControlApiClient, ControlApiDeps, ControlApiRouter, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, DoorApiClient, DoorApiContext, DoorApiDeps, DoorApiRouter, DoorEvent, DoorEventHub, DoorEventPublisher, DoorEventStream, DoorEventsApiDeps, DoorHealthEvent, DoorHealthPublisher, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorControlMaterial, FrontDoorRcControl, FrontDoorSessionStatus, FrontDoorStatus, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, IdentityNameRead, IdentityRecord, IdentityRecordsPort, IdentitySession, InjectedCredential, LaunchApiDeps, LaunchApiRouter, LaunchDecision, LaunchEventPublisher, LaunchLifecycleEvent, LaunchPlan, LaunchPoolDecision, LaunchResolution, LaunchSelection, Layer, LayerId, LayoutPaths, LeafCert, LifecycleApiClient, LifecycleApiDeps, LifecycleApiRouter, LiveSessionRegistry, LiveSessionRegistryPorts, LiveTask, LiveTaskBook, LocatedSession, MergedAgentNode, MergedAgentTree, NestedContribution, OwnExecutableStat, PlanClass, Pool, PoolChange, PoolMember, PoolPickReport, PoolPolicy, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, ProviderOf, QuotaExpiringEvent, QuotaExpiringPublisher, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcApiClient, RcApiDeps, RcApiRouter, RcClaudeCodeVersions, RcCompactOptions, RcCompactReport, RcContextUsageDetail, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcCredentialStore, RcDialAnswer, RcDialTarget, RcEventDial, RcEventFanout, RcEventWriteResult, RcExchangeObserver, RcGoal, RcGoalClearReport, RcGoalReport, RcGoalSetReport, RcInjectDeps, RcLiveRateLimit, RcLiveUsage, RcLiveUsageDeps, RcObservedCredential, RcObservedRequest, RcPendingQuestion, RcPendingRequestSummary, RcPendingRetireReason, RcPermissionMode, RcPresenceAnswer, RcQuestionOption, RcQuestionSelection, RcRateLimitInfo, RcRateLimitWindow, RcReadFileEncoding, RcReadFileOptions, RcRefusalKind, RcRegisteredSession, RcRegistryIdentity, RcSelfHostCredentialRecord, RcSelfHostDeps, RcSelfHostMintResult, RcSelfHostSurface, RcSessionCommandDeps, RcSessionCommandOptions, RcSessionCommandResult, RcSessionCommandRoute, RcSessionCommands, RcSessionEndReason, RcSessionEvent, RcSessionEventLog, RcSessionEventLogDeps, RcSessionEventsApiDeps, RcSessionEventsApiRouter, RcSessionEventsRead, RcSessionEventsReadInput, RcSessionRegistryDeps, RcSessionRegistryFs, RcSessionRoute, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcSessionTransition, RcStreamAnswer, RcStreamDial, RcStreamEnvelope, RcStreamEvent, RcStreamHub, RcStreamHubDeps, RcSupervisedTarget, RcTurnReport, RcWebFetchDeps, RcWebFetchHop, RcWebFetchOutcome, RcWebFetcher, RcWorkerFact, RcWriteHeaders, ReadSessionOptions, RealMemberProviderParams, RecoverFarmParams, RecoveryResult, RefreshLaunchPoolUsageOptions, RefreshPoolUsageParams, RefreshStalePoolMembersParams, ResetRow, ResetSchedule, ResolveClaudeLaunchOptions, ResolveDecisionsInput, ResolveLaunchSelectionParams, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunClaudeLaunchOptions, RunDoctorParams, RunFrontDoorSupervisorOptions, RunLauncherParams, RunSupervisorOptions, SessionAgentTree, SessionCommandFs, SessionListFilters, SessionRef, SessionSummary, SessionView, SpawnClaudeParams, SseParsedEvent, StickyPick, SupervisorPorts, TaskItem, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageChangeEvent, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation, WorkflowRun };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "14.6.0",
3
+ "version": "14.6.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>",