claude-use 14.8.0 → 14.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +109 -36
- package/dist/index.cjs +86 -24
- package/dist/index.mjs +85 -24
- package/dist/types/index.d.ts +79 -47
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5549,7 +5549,7 @@ var init_state = __esm({
|
|
|
5549
5549
|
"use strict";
|
|
5550
5550
|
init_schema();
|
|
5551
5551
|
init_baseUrlDial();
|
|
5552
|
-
FRONT_DOOR_PROTOCOL =
|
|
5552
|
+
FRONT_DOOR_PROTOCOL = 12;
|
|
5553
5553
|
FRONT_DOOR_HANDOVER_PROTOCOL = 6;
|
|
5554
5554
|
FrontDoorSessionSchema = z9.strictObject({ pid: z9.number().int().positive(), startedAt: z9.number(), token: z9.string().min(1), supervisorPid: z9.number().int().positive().optional(), sessionId: z9.string().min(1).optional(), identity: z9.string().min(1).optional(), models: ModelsConfigSchema.optional(), configDir: z9.string().min(1).optional(), claudeVersion: z9.string().min(1).optional() });
|
|
5555
5555
|
MAX_CONTEXT_TEXT_LENGTH = 256;
|
|
@@ -7798,7 +7798,7 @@ import { z as z12 } from "zod";
|
|
|
7798
7798
|
function workerFactSchema(value) {
|
|
7799
7799
|
return z12.strictObject({ value, observedAt: z12.number() });
|
|
7800
7800
|
}
|
|
7801
|
-
var RcPermissionModeSchema, RcSessionSummarySchema, RcQuestionOptionSchema, RcPendingQuestionSchema, RcPendingRequestSummarySchema, RcSessionStatusSchema, RcStreamEnvelopeSchema, RcStreamEventSchema, RcRateLimitWindowSchema, RcRateLimitInfoSchema, RcLiveRateLimitSchema, RcSessionQuerySchema, RcSendInputSchema, RcQuestionSelectionSchema, RcQuestionChoicesSchema, RcAnswerInputSchema, RcInterruptInputSchema, RcSetModelInputSchema, RcSetPermissionModeInputSchema, RcEndSessionInputSchema, RcGetUsageInputSchema, RcGetContextUsageInputSchema, RcReadFileInputSchema, RcFileSuggestionsInputSchema, RcKeepAliveInputSchema, RcMcpStatusInputSchema, RcMcpReconnectInputSchema, RcMcpAuthenticateInputSchema, RcMcpOAuthCallbackUrlInputSchema, RcTeleportInputSchema, RcListOutputSchema, RcSessionRouteSchema, RcStatusOutputSchema, RcPendingOutputSchema, RcWriteOutputSchema, RcControlWriteOutputSchema, RcAnswerOutputSchema;
|
|
7801
|
+
var RcPermissionModeSchema, RcSessionSummarySchema, RcQuestionOptionSchema, RcPendingQuestionSchema, RcPendingRequestSummarySchema, RcSessionStatusSchema, RcStreamEnvelopeSchema, RcStreamEventSchema, RcRateLimitWindowSchema, RcRateLimitInfoSchema, RcLiveRateLimitSchema, RcSessionQuerySchema, RcSendInputSchema, RcQuestionSelectionSchema, RcQuestionChoicesSchema, RcAnswerInputSchema, RcInterruptInputSchema, RcSetModelInputSchema, RcSetPermissionModeInputSchema, RcEndSessionInputSchema, RcGetUsageInputSchema, RcGetContextUsageInputSchema, RcReadFileInputSchema, RcFileSuggestionsInputSchema, RcKeepAliveInputSchema, RcMcpStatusInputSchema, RcMcpReconnectInputSchema, RcMcpAuthenticateInputSchema, RcMcpOAuthCallbackUrlInputSchema, RcTeleportInputSchema, RcListOutputSchema, RcSessionCommandRouteSchema, RcVersionGateWarningsSchema, RcSessionRouteSchema, RcStatusOutputSchema, RcPendingOutputSchema, RcWriteOutputSchema, RcControlWriteOutputSchema, RcAnswerOutputSchema;
|
|
7802
7802
|
var init_rcSchemas = __esm({
|
|
7803
7803
|
"src/frontdoor/rcSchemas.ts"() {
|
|
7804
7804
|
"use strict";
|
|
@@ -7967,7 +7967,9 @@ var init_rcSchemas = __esm({
|
|
|
7967
7967
|
marker: z12.string().min(1)
|
|
7968
7968
|
});
|
|
7969
7969
|
RcListOutputSchema = z12.strictObject({ sessions: z12.readonly(z12.array(RcSessionSummarySchema)) });
|
|
7970
|
-
|
|
7970
|
+
RcSessionCommandRouteSchema = z12.enum(["supervised", "launched", "self-hosted"]);
|
|
7971
|
+
RcVersionGateWarningsSchema = z12.readonly(z12.array(z12.string()).min(1)).optional();
|
|
7972
|
+
RcSessionRouteSchema = z12.union([z12.strictObject({ route: RcSessionCommandRouteSchema, warnings: RcVersionGateWarningsSchema }), z12.strictObject({ route: z12.null(), refused: z12.string() })]);
|
|
7971
7973
|
RcStatusOutputSchema = z12.strictObject({ statuses: z12.readonly(z12.array(z12.strictObject({ ...RcSessionStatusSchema.shape, route: RcSessionRouteSchema }))) });
|
|
7972
7974
|
RcPendingOutputSchema = z12.strictObject({
|
|
7973
7975
|
pending: z12.readonly(z12.array(RcPendingRequestSummarySchema)),
|
|
@@ -14277,7 +14279,7 @@ var init_package = __esm({
|
|
|
14277
14279
|
"package.json"() {
|
|
14278
14280
|
package_default = {
|
|
14279
14281
|
name: "claude-use",
|
|
14280
|
-
version: "14.
|
|
14282
|
+
version: "14.10.0",
|
|
14281
14283
|
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
14284
|
license: "MIT",
|
|
14283
14285
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -14398,11 +14400,44 @@ var init_sessionControl = __esm({
|
|
|
14398
14400
|
});
|
|
14399
14401
|
|
|
14400
14402
|
// src/supervise/verifiedVersions.ts
|
|
14401
|
-
|
|
14403
|
+
function parseReleaseVersion(version) {
|
|
14404
|
+
const match = RELEASE_VERSION.exec(version);
|
|
14405
|
+
return match === null ? void 0 : { major: Number(match[1]), minor: Number(match[2]), patch: Number(match[3]) };
|
|
14406
|
+
}
|
|
14407
|
+
function minorOf(version) {
|
|
14408
|
+
return `${String(version.major)}.${String(version.minor)}`;
|
|
14409
|
+
}
|
|
14410
|
+
function verifiedMinors() {
|
|
14411
|
+
return [...new Set(RC_SESSION_COMMAND_VERIFIED_VERSIONS.map((listed) => {
|
|
14412
|
+
const parsed = parseReleaseVersion(listed);
|
|
14413
|
+
if (parsed === void 0) {
|
|
14414
|
+
throw new Error(`RC_SESSION_COMMAND_VERIFIED_VERSIONS lists ${listed}, which is not a plain release version`);
|
|
14415
|
+
}
|
|
14416
|
+
return minorOf(parsed);
|
|
14417
|
+
}))];
|
|
14418
|
+
}
|
|
14419
|
+
function claudeCodeVersionGate(version) {
|
|
14420
|
+
if (version === void 0) {
|
|
14421
|
+
return { kind: "refused" };
|
|
14422
|
+
}
|
|
14423
|
+
if (RC_SESSION_COMMAND_VERIFIED_VERSIONS.includes(version)) {
|
|
14424
|
+
return { kind: "verified" };
|
|
14425
|
+
}
|
|
14426
|
+
const parsed = parseReleaseVersion(version);
|
|
14427
|
+
if (parsed === void 0 || !verifiedMinors().includes(minorOf(parsed))) {
|
|
14428
|
+
return { kind: "refused" };
|
|
14429
|
+
}
|
|
14430
|
+
return { kind: "unverified-patch", warning: `Claude Code ${version} has not been verified for goal, compaction and turn control (verified: ${RC_SESSION_COMMAND_VERIFIED_VERSIONS.join(", ")}); it is a patch release of verified minor ${minorOf(parsed)}, so the control plugin and the verbs run on it unchecked` };
|
|
14431
|
+
}
|
|
14432
|
+
function claudeCodeVersionsGated() {
|
|
14433
|
+
return `Claude Code ${RC_SESSION_COMMAND_VERIFIED_VERSIONS.join(", ")}, or another patch release of ${verifiedMinors().join(" or ")} with a warning that it is unverified`;
|
|
14434
|
+
}
|
|
14435
|
+
var RC_SESSION_COMMAND_VERIFIED_VERSIONS, RELEASE_VERSION;
|
|
14402
14436
|
var init_verifiedVersions = __esm({
|
|
14403
14437
|
"src/supervise/verifiedVersions.ts"() {
|
|
14404
14438
|
"use strict";
|
|
14405
14439
|
RC_SESSION_COMMAND_VERIFIED_VERSIONS = ["2.1.319", "2.1.325"];
|
|
14440
|
+
RELEASE_VERSION = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/u;
|
|
14406
14441
|
}
|
|
14407
14442
|
});
|
|
14408
14443
|
|
|
@@ -18147,17 +18182,26 @@ function registerLaunchControl(fs17, directory, control, isRunning) {
|
|
|
18147
18182
|
fs17.removeRecursive(file);
|
|
18148
18183
|
};
|
|
18149
18184
|
}
|
|
18150
|
-
function
|
|
18185
|
+
function launchControlPluginGate(candidate) {
|
|
18151
18186
|
const end = candidate.args.indexOf("--");
|
|
18152
18187
|
const options = end === -1 ? candidate.args : candidate.args.slice(0, end);
|
|
18153
|
-
|
|
18188
|
+
if (candidate.supervised || !candidate.startsSession || options.includes("--bare")) {
|
|
18189
|
+
return void 0;
|
|
18190
|
+
}
|
|
18191
|
+
const gate = claudeCodeVersionGate(candidate.version);
|
|
18192
|
+
return gate.kind === "refused" ? void 0 : gate;
|
|
18154
18193
|
}
|
|
18155
18194
|
function stageControlPluginFor(candidate, stage, warn) {
|
|
18156
|
-
|
|
18195
|
+
const gate = launchControlPluginGate(candidate);
|
|
18196
|
+
if (stage === void 0 || gate === void 0) {
|
|
18157
18197
|
return void 0;
|
|
18158
18198
|
}
|
|
18159
18199
|
try {
|
|
18160
|
-
|
|
18200
|
+
const staged = stage();
|
|
18201
|
+
if (gate.kind === "unverified-patch") {
|
|
18202
|
+
warn(`agent-shim: ${gate.warning}`);
|
|
18203
|
+
}
|
|
18204
|
+
return staged;
|
|
18161
18205
|
} catch (error) {
|
|
18162
18206
|
warn(`agent-shim: the in-process control plugin could not be staged, so this session starts without it and the front door cannot reach it for goal, compaction and turn control: ${error instanceof Error ? error.message : String(error)}`);
|
|
18163
18207
|
return void 0;
|
|
@@ -19903,6 +19947,7 @@ init_rcWrites();
|
|
|
19903
19947
|
init_rcSchemas();
|
|
19904
19948
|
|
|
19905
19949
|
// src/frontdoor/rcSlashCommandSchemas.ts
|
|
19950
|
+
init_rcSchemas();
|
|
19906
19951
|
import { z as z25 } from "zod";
|
|
19907
19952
|
|
|
19908
19953
|
// src/frontdoor/rcSessionCommands.ts
|
|
@@ -20144,15 +20189,18 @@ var MAX_JSON_BYTES_PER_CODE_UNIT = 6;
|
|
|
20144
20189
|
var RC_COMPACT_INSTRUCTIONS_MAX_CHARS = Math.floor(CONTROL_BODY_CAP_BYTES / MAX_JSON_BYTES_PER_CODE_UNIT);
|
|
20145
20190
|
var RC_TURN_TEXT_MAX_CHARS = Math.floor(CONTROL_BODY_CAP_BYTES / MAX_JSON_BYTES_PER_CODE_UNIT);
|
|
20146
20191
|
var RC_SESSION_COMMAND_MAX_WAIT_MS = 2147483647;
|
|
20147
|
-
function
|
|
20148
|
-
const
|
|
20149
|
-
return version === void 0 ? `session ${sessionId} has not reported its Claude Code version (${source}), and goal, compaction and turn control
|
|
20192
|
+
function refusedVersionMessage(sessionId, version, source) {
|
|
20193
|
+
const gated = claudeCodeVersionsGated();
|
|
20194
|
+
return version === void 0 ? `session ${sessionId} has not reported its Claude Code version (${source}), and goal, compaction and turn control runs only on ${gated}` : `session ${sessionId} runs Claude Code ${version}, and goal, compaction and turn control runs only on ${gated}: the door will not act on a version of a minor it has not verified. Start the session on one of those versions`;
|
|
20195
|
+
}
|
|
20196
|
+
function warningsOf(gate) {
|
|
20197
|
+
return gate.kind === "unverified-patch" ? [gate.warning] : [];
|
|
20150
20198
|
}
|
|
20151
20199
|
function noPluginReason(sessionId) {
|
|
20152
|
-
return `no agent-shim launch's in-process control plugin records session ${sessionId}: it was started outside the launcher (with claude's own command, or agent-shim run --native), with --bare, on a Claude Code version the
|
|
20200
|
+
return `no agent-shim launch's in-process control plugin records session ${sessionId}: it was started outside the launcher (with claude's own command, or agent-shim run --native), with --bare, on a Claude Code version the gate refuses, or its plugin has not yet recorded its transcript, which it does from the session's first hook event`;
|
|
20153
20201
|
}
|
|
20154
20202
|
function unsupportedMessage(sessionId) {
|
|
20155
|
-
return `${noPluginReason(sessionId)}, so the door has no in-process channel into it, and it is not on the door's own self-hosted surface. Over the real Remote Control service, Claude Code
|
|
20203
|
+
return `${noPluginReason(sessionId)}, so the door has no in-process channel into it, and it is not on the door's own self-hosted surface. Over the real Remote Control service, Claude Code takes a message as a person's (running it when it is a slash command) only when a person's app wrote it and treats any other writer as a peer, whose message the model reads as another session's, and the door does not claim to be a person's app on a service it does not run. Start the session through agent-shim run on ${claudeCodeVersionsGated()} without --bare, or run it against the door's self-hosted surface.`;
|
|
20156
20204
|
}
|
|
20157
20205
|
function createRcSessionCommands(deps) {
|
|
20158
20206
|
const queues = /* @__PURE__ */ new Map();
|
|
@@ -20177,10 +20225,11 @@ function createRcSessionCommands(deps) {
|
|
|
20177
20225
|
if ("refused" in target) {
|
|
20178
20226
|
return { kind: "refused", message: target.refused, refusal: "session-state" };
|
|
20179
20227
|
}
|
|
20180
|
-
|
|
20181
|
-
|
|
20228
|
+
const gate = claudeCodeVersionGate(target.version);
|
|
20229
|
+
if (gate.kind === "refused") {
|
|
20230
|
+
return { kind: "refused", message: refusedVersionMessage(sessionId, target.version, route === "supervised" ? "its supervisor's control plugin has not loaded" : "its launch's control plugin has not loaded"), refusal: "session-state" };
|
|
20182
20231
|
}
|
|
20183
|
-
return { kind: route, target };
|
|
20232
|
+
return { kind: route, target, warnings: warningsOf(gate) };
|
|
20184
20233
|
};
|
|
20185
20234
|
const resolveRoute = async (sessionId) => {
|
|
20186
20235
|
const supervised = await pluginRoute(sessionId, "supervised", deps.supervisedOf);
|
|
@@ -20202,10 +20251,11 @@ function createRcSessionCommands(deps) {
|
|
|
20202
20251
|
return { kind: "refused", message: `${noPluginReason(sessionId)}, and the door's self-hosted surface cannot take a command: ${unavailable}`, refusal: "session-state" };
|
|
20203
20252
|
}
|
|
20204
20253
|
const version = deps.selfHost.versionOf(sessionId);
|
|
20205
|
-
|
|
20206
|
-
|
|
20254
|
+
const gate = claudeCodeVersionGate(version);
|
|
20255
|
+
if (gate.kind === "refused") {
|
|
20256
|
+
return { kind: "refused", message: refusedVersionMessage(sessionId, version, "its launch recorded none and no system/init from its worker has been observed on its stream; send it a prompt so it reports one"), refusal: "session-state" };
|
|
20207
20257
|
}
|
|
20208
|
-
return { kind: "self-hosted", selfHost: deps.selfHost };
|
|
20258
|
+
return { kind: "self-hosted", selfHost: deps.selfHost, warnings: warningsOf(gate) };
|
|
20209
20259
|
};
|
|
20210
20260
|
const onRoute = async (sessionId, options, actions) => await serialised(sessionId, async () => {
|
|
20211
20261
|
const { signal } = options;
|
|
@@ -20216,12 +20266,13 @@ function createRcSessionCommands(deps) {
|
|
|
20216
20266
|
if (resolved.kind === "refused") {
|
|
20217
20267
|
return { ok: false, message: resolved.message, refusal: resolved.refusal };
|
|
20218
20268
|
}
|
|
20269
|
+
const warned2 = (result2) => result2.ok && resolved.warnings.length > 0 ? { ok: true, report: { ...result2.report, warnings: resolved.warnings } } : result2;
|
|
20219
20270
|
if (resolved.kind !== "self-hosted") {
|
|
20220
20271
|
const waitMs2 = options.waitMs ?? COMPACT_TIMEOUT_MS;
|
|
20221
20272
|
const timeout2 = AbortSignal.timeout(waitMs2);
|
|
20222
20273
|
const bounded3 = signal === void 0 ? timeout2 : AbortSignal.any([signal, timeout2]);
|
|
20223
20274
|
try {
|
|
20224
|
-
return await actions.plugin(resolved.target, resolved.kind, bounded3, waitMs2);
|
|
20275
|
+
return warned2(await actions.plugin(resolved.target, resolved.kind, bounded3, waitMs2));
|
|
20225
20276
|
} catch (error) {
|
|
20226
20277
|
if (timeout2.aborted) {
|
|
20227
20278
|
return { ok: false, message: `session ${sessionId}'s control plugin did not answer within ${String(waitMs2)} ms. A request the plugin had not started is withdrawn; one it had started runs once the session is idle (a turn waiting on a permission prompt holds it), so read the session's goal or transcript before asking again` };
|
|
@@ -20235,7 +20286,7 @@ function createRcSessionCommands(deps) {
|
|
|
20235
20286
|
if (!result.ok && timeout.aborted) {
|
|
20236
20287
|
return { ok: false, message: `session ${sessionId}'s worker did not answer within ${String(waitMs)} ms in all; it may still be queued behind a running turn, so read the session's stream before asking again` };
|
|
20237
20288
|
}
|
|
20238
|
-
return result;
|
|
20289
|
+
return warned2(result);
|
|
20239
20290
|
});
|
|
20240
20291
|
const transcriptGoal = async (sessionId, target) => {
|
|
20241
20292
|
const goal = target.transcriptPath === void 0 ? void 0 : await deps.goalOf(target.transcriptPath);
|
|
@@ -20262,7 +20313,10 @@ function createRcSessionCommands(deps) {
|
|
|
20262
20313
|
/** 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. */
|
|
20263
20314
|
routeOf: async (sessionId) => {
|
|
20264
20315
|
const resolved = await resolveRoute(sessionId);
|
|
20265
|
-
|
|
20316
|
+
if (resolved.kind === "refused") {
|
|
20317
|
+
return { route: null, refused: resolved.message };
|
|
20318
|
+
}
|
|
20319
|
+
return resolved.warnings.length === 0 ? { route: resolved.kind } : { route: resolved.kind, warnings: resolved.warnings };
|
|
20266
20320
|
},
|
|
20267
20321
|
/**
|
|
20268
20322
|
* Puts `text` into the session as a person's typed turn, and resolves once the session recorded it as a user entry from the person, never as a peer's message: on the supervised route a transcript row the control plugin submitted as the person's words (`origin: { kind: "plugin", asUser: true }`), on the self-hosted route the worker's mirrored entry with a person's origin (`{ kind: "human" }`). The text reaches the session's model as its user's words (`docs/rc-slash-commands.md`, the trust boundary). Refused unsent: text that is empty, starts with `/` (a slash command, which the goal and compaction verbs run), or is longer than one request carries. Resolves when the turn entered the session, not when the model has answered it.
|
|
@@ -20428,7 +20482,8 @@ var RcTurnInputSchema = z25.strictObject({
|
|
|
20428
20482
|
});
|
|
20429
20483
|
var commandAnswerShape = {
|
|
20430
20484
|
session: z25.string(),
|
|
20431
|
-
route:
|
|
20485
|
+
route: RcSessionCommandRouteSchema,
|
|
20486
|
+
warnings: RcVersionGateWarningsSchema
|
|
20432
20487
|
};
|
|
20433
20488
|
var RcGoalGetOutputSchema = z25.strictObject({
|
|
20434
20489
|
...commandAnswerShape,
|
|
@@ -22563,6 +22618,7 @@ function jobWindowReadFindings(jobs, pools, windowsOf) {
|
|
|
22563
22618
|
|
|
22564
22619
|
// src/doctorReport.ts
|
|
22565
22620
|
init_extends();
|
|
22621
|
+
init_verifiedVersions();
|
|
22566
22622
|
var DOCTOR_SEVERITIES = ["pass", "warn", "fail"];
|
|
22567
22623
|
var DOCTOR_SECTIONS = [
|
|
22568
22624
|
"ambient-credential",
|
|
@@ -22779,6 +22835,10 @@ function runDoctor(params) {
|
|
|
22779
22835
|
const { binary } = params.binaryDiscovery;
|
|
22780
22836
|
const versionNote = binary.version === void 0 ? "" : `, version ${binary.version}`;
|
|
22781
22837
|
push("binary-discovery", "pass", `Found ${binary.path} (${binary.source}${versionNote}).`);
|
|
22838
|
+
const gate = claudeCodeVersionGate(binary.version);
|
|
22839
|
+
if (gate.kind === "unverified-patch") {
|
|
22840
|
+
push("binary-discovery", "warn", `${gate.warning}.`);
|
|
22841
|
+
}
|
|
22782
22842
|
} else {
|
|
22783
22843
|
push("binary-discovery", "fail", params.binaryDiscovery.message);
|
|
22784
22844
|
}
|
|
@@ -27437,6 +27497,7 @@ export {
|
|
|
27437
27497
|
changePool,
|
|
27438
27498
|
checkReportHasWarnings,
|
|
27439
27499
|
checkReportToJson,
|
|
27500
|
+
claudeCodeVersionGate,
|
|
27440
27501
|
collectCheckReport,
|
|
27441
27502
|
collectDoctorReport,
|
|
27442
27503
|
collectFrontDoorStatus,
|