claude-use 9.15.0 → 9.16.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/README.md +1 -0
- package/dist/cli.cjs +31 -12
- package/dist/index.cjs +457 -71
- package/dist/index.mjs +444 -66
- package/dist/types/index.d.ts +169 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -199,6 +199,7 @@ src/
|
|
|
199
199
|
configure.ts, check.ts, doctor.ts, claudeShim.ts # interactive picker, the check and doctor commands, `claude` shim
|
|
200
200
|
checkReport.ts, checkReportSchema.ts, doctorReport.ts, poolPickReport.ts # the dry-run inspector, the Zod schema of its JSON form, the whole-tree audit and the pool ranking as data, free of command-line dependencies and exported by the library
|
|
201
201
|
resolve/ # the pure cascade resolver: flatten, decide, extends, walk, plan, reconcile
|
|
202
|
+
agents/ # the agent tree reader: a session's subagents, forks, workflow runs and task list from the transcripts on disk, over an injected filesystem
|
|
202
203
|
config/ # Zod schemas, cosmiconfig loading, category classification, atomic JSON store
|
|
203
204
|
index.ts # the library surface (see below): resolver, farm sync, headroom routing, the ambient-credential guard
|
|
204
205
|
schema/ # published JSON Schemas, generated by `pnpm schema`
|
package/dist/cli.cjs
CHANGED
|
@@ -33317,7 +33317,7 @@ var init_package = __esm({
|
|
|
33317
33317
|
"package.json"() {
|
|
33318
33318
|
package_default = {
|
|
33319
33319
|
name: "claude-use",
|
|
33320
|
-
version: "9.
|
|
33320
|
+
version: "9.16.0",
|
|
33321
33321
|
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.",
|
|
33322
33322
|
license: "MIT",
|
|
33323
33323
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -111885,7 +111885,7 @@ function requireJob(paths, name) {
|
|
|
111885
111885
|
return job;
|
|
111886
111886
|
}
|
|
111887
111887
|
function writeJobs(paths, jobs) {
|
|
111888
|
-
applyPatch(paths.globalConfigFile, GlobalConfigSchema, { jobs }, { defaults: {} });
|
|
111888
|
+
applyPatch(paths.globalConfigFile, GlobalConfigSchema, { jobs: Object.keys(jobs).length === 0 ? void 0 : jobs }, { defaults: {} });
|
|
111889
111889
|
}
|
|
111890
111890
|
function addJob(paths, name, job) {
|
|
111891
111891
|
if (!PoolNameSchema.safeParse(name).success) {
|
|
@@ -111922,6 +111922,19 @@ init_realAnthropicUsageProbe();
|
|
|
111922
111922
|
var import_node_path38 = __toESM(require("node:path"), 1);
|
|
111923
111923
|
init_conditions();
|
|
111924
111924
|
init_identityClaude();
|
|
111925
|
+
|
|
111926
|
+
// src/usage/sdkResult.ts
|
|
111927
|
+
function successfulResult(message) {
|
|
111928
|
+
if (message.subtype !== "success") {
|
|
111929
|
+
throw new Error(`the run ended as ${message.subtype}`);
|
|
111930
|
+
}
|
|
111931
|
+
if (message.is_error) {
|
|
111932
|
+
throw new Error(`the run ended on an error: ${message.result}`);
|
|
111933
|
+
}
|
|
111934
|
+
return message.result;
|
|
111935
|
+
}
|
|
111936
|
+
|
|
111937
|
+
// src/usage/realJobRunner.ts
|
|
111925
111938
|
var JOB_LAUNCH_FLAGS = ["--no-headroom", "--no-remote-control", "--track-usage"];
|
|
111926
111939
|
var JOB_ISOLATION_OPTIONS = { settingSources: ["user"], mcpServers: {}, strictMcpConfig: true };
|
|
111927
111940
|
function logEntry(name, identity, endedAt, outcome) {
|
|
@@ -111958,10 +111971,7 @@ function createRealJobRunner(params) {
|
|
|
111958
111971
|
try {
|
|
111959
111972
|
for await (const message of session) {
|
|
111960
111973
|
if (message.type === "result") {
|
|
111961
|
-
|
|
111962
|
-
throw new Error(`the run ended as ${message.subtype}`);
|
|
111963
|
-
}
|
|
111964
|
-
return message.result;
|
|
111974
|
+
return successfulResult(message);
|
|
111965
111975
|
}
|
|
111966
111976
|
}
|
|
111967
111977
|
throw new Error("the run ended without a result");
|
|
@@ -112009,9 +112019,7 @@ function createRealWindowOpener(params) {
|
|
|
112009
112019
|
try {
|
|
112010
112020
|
for await (const message of session) {
|
|
112011
112021
|
if (message.type === "result") {
|
|
112012
|
-
|
|
112013
|
-
throw new Error(`the opening request ended as ${message.subtype}`);
|
|
112014
|
-
}
|
|
112022
|
+
successfulResult(message);
|
|
112015
112023
|
return;
|
|
112016
112024
|
}
|
|
112017
112025
|
}
|
|
@@ -112057,6 +112065,7 @@ function writeHandled(fs22, file2, handled) {
|
|
|
112057
112065
|
|
|
112058
112066
|
// src/usage/jobKeeper.ts
|
|
112059
112067
|
init_middleware();
|
|
112068
|
+
init_pick();
|
|
112060
112069
|
init_preflight();
|
|
112061
112070
|
|
|
112062
112071
|
// src/usage/windowKeeper.ts
|
|
@@ -112125,6 +112134,10 @@ async function runWindowKeeper(ports) {
|
|
|
112125
112134
|
}
|
|
112126
112135
|
|
|
112127
112136
|
// src/usage/jobKeeper.ts
|
|
112137
|
+
var WINDOW_LENGTH_MS = { fiveHour: FIVE_HOUR_WINDOW_MS, sevenDay: SEVEN_DAY_WINDOW_MS };
|
|
112138
|
+
function sameWindowInstance(handledMs, resetsAtMs, window) {
|
|
112139
|
+
return handledMs !== void 0 && Math.abs(handledMs - resetsAtMs) < WINDOW_LENGTH_MS[window] / 2;
|
|
112140
|
+
}
|
|
112128
112141
|
function pendingReset(snapshot, window, nowMs) {
|
|
112129
112142
|
const recorded = snapshot?.providers[ANTHROPIC_PROVIDER]?.rateLimit?.unified?.[window];
|
|
112130
112143
|
return recorded === void 0 ? void 0 : effectiveWindow(recorded, nowMs).resetsAtMs;
|
|
@@ -112203,7 +112216,7 @@ function runJobs(ports) {
|
|
|
112203
112216
|
outcomes.push({ name, status: "skipped", detail: `${identity} has no ${trigger.beforeReset} window to run before` });
|
|
112204
112217
|
continue;
|
|
112205
112218
|
}
|
|
112206
|
-
if (resetsAtMs - parseDuration(trigger.lead) > nowMs || handled[name]
|
|
112219
|
+
if (resetsAtMs - parseDuration(trigger.lead) > nowMs || sameWindowInstance(handled[name], resetsAtMs, trigger.beforeReset)) {
|
|
112207
112220
|
outcomes.push({ name, status: "waiting", detail: `${trigger.beforeReset} window resets in ${formatAge(resetsAtMs - nowMs)}` });
|
|
112208
112221
|
continue;
|
|
112209
112222
|
}
|
|
@@ -129251,8 +129264,14 @@ function realFrontDoorSupervisorPorts(paths) {
|
|
|
129251
129264
|
const quotaRefresher = createRealQuotaRefresher({ paths, store: usageStore, log });
|
|
129252
129265
|
const anthropicRefresher = createRealAnthropicUsageRefresher({ paths, store: usageStore, cwd: process.cwd(), spawnDaemon: spawnDetachedSupervisor, log });
|
|
129253
129266
|
setInterval(() => {
|
|
129254
|
-
|
|
129255
|
-
|
|
129267
|
+
try {
|
|
129268
|
+
const pools = readPools(paths);
|
|
129269
|
+
refreshStalePoolMembers({ poolNames: Object.keys(pools), pools, loadMembers: (identities) => loadPoolMembers(realFarmFs, paths, identities, Date.now()), refresher: anthropicRefresher }).catch((error63) => {
|
|
129270
|
+
log(`pool usage refresh failed: ${error63 instanceof Error ? error63.message : String(error63)}`);
|
|
129271
|
+
});
|
|
129272
|
+
} catch (error63) {
|
|
129273
|
+
log(`pool usage refresh failed: ${error63 instanceof Error ? error63.message : String(error63)}`);
|
|
129274
|
+
}
|
|
129256
129275
|
}, ANTHROPIC_USAGE_FRESHNESS_MS).unref();
|
|
129257
129276
|
const windowOpener = createRealWindowOpener({ paths, cwd: process.cwd(), spawnDaemon: spawnDetachedSupervisor });
|
|
129258
129277
|
let keeperRunning = false;
|