claude-use 11.5.2 → 11.6.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 +43 -1
- package/dist/index.cjs +43 -1
- package/dist/index.mjs +43 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -24697,6 +24697,35 @@ var init_store = __esm({
|
|
|
24697
24697
|
}
|
|
24698
24698
|
});
|
|
24699
24699
|
|
|
24700
|
+
// src/processRole.ts
|
|
24701
|
+
function enterProcessRole(role) {
|
|
24702
|
+
const previous = currentRole;
|
|
24703
|
+
currentRole = role;
|
|
24704
|
+
return () => {
|
|
24705
|
+
currentRole = previous;
|
|
24706
|
+
};
|
|
24707
|
+
}
|
|
24708
|
+
function refuseToBlockInRole(operation) {
|
|
24709
|
+
if (currentRole !== void 0) {
|
|
24710
|
+
throw new BlockingInEventLoopError(operation, currentRole);
|
|
24711
|
+
}
|
|
24712
|
+
}
|
|
24713
|
+
var currentRole, BlockingInEventLoopError;
|
|
24714
|
+
var init_processRole = __esm({
|
|
24715
|
+
"src/processRole.ts"() {
|
|
24716
|
+
"use strict";
|
|
24717
|
+
init_cliError();
|
|
24718
|
+
BlockingInEventLoopError = class extends CliError {
|
|
24719
|
+
constructor(operation, role) {
|
|
24720
|
+
super(
|
|
24721
|
+
`${operation} blocks the calling thread, which in the ${role} is the event loop that answers every session; it must not run there (a launch planned inside the door reaches it through its own addresses, never through the launcher's synchronous coordination)`
|
|
24722
|
+
);
|
|
24723
|
+
this.name = "BlockingInEventLoopError";
|
|
24724
|
+
}
|
|
24725
|
+
};
|
|
24726
|
+
}
|
|
24727
|
+
});
|
|
24728
|
+
|
|
24700
24729
|
// src/versionDiscovery.ts
|
|
24701
24730
|
function defaultVersionsDir() {
|
|
24702
24731
|
return import_node_path3.default.join(import_node_os.default.homedir(), ".local", "share", "claude", "versions");
|
|
@@ -28498,6 +28527,7 @@ function isErrorWithCode(error63, code) {
|
|
|
28498
28527
|
return typeof error63 === "object" && error63 !== null && "code" in error63 && error63.code === code;
|
|
28499
28528
|
}
|
|
28500
28529
|
function realSleepSync(ms2) {
|
|
28530
|
+
refuseToBlockInRole("a synchronous sleep");
|
|
28501
28531
|
Atomics.wait(new Int32Array(new SharedArrayBuffer(INT32_BYTE_LENGTH)), 0, 0, ms2);
|
|
28502
28532
|
}
|
|
28503
28533
|
function realIsProcessAlive(pid) {
|
|
@@ -28786,6 +28816,7 @@ var import_node_child_process2, import_node_crypto4, import_node_fs3, import_nod
|
|
|
28786
28816
|
var init_realPorts = __esm({
|
|
28787
28817
|
"src/realPorts.ts"() {
|
|
28788
28818
|
"use strict";
|
|
28819
|
+
init_processRole();
|
|
28789
28820
|
import_node_child_process2 = require("node:child_process");
|
|
28790
28821
|
import_node_crypto4 = require("node:crypto");
|
|
28791
28822
|
import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
@@ -33976,7 +34007,7 @@ var init_package = __esm({
|
|
|
33976
34007
|
"package.json"() {
|
|
33977
34008
|
package_default = {
|
|
33978
34009
|
name: "claude-use",
|
|
33979
|
-
version: "11.
|
|
34010
|
+
version: "11.6.0",
|
|
33980
34011
|
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.",
|
|
33981
34012
|
license: "MIT",
|
|
33982
34013
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -61947,6 +61978,7 @@ var init_ensure2 = __esm({
|
|
|
61947
61978
|
|
|
61948
61979
|
// src/frontdoor/probe.ts
|
|
61949
61980
|
function probeFrontDoorSync(port, caPem) {
|
|
61981
|
+
refuseToBlockInRole("a synchronous probe of the front door");
|
|
61950
61982
|
const shared = new SharedArrayBuffer(HEADER_SLOTS * INT32_BYTES + REASON_BYTES);
|
|
61951
61983
|
const header = new Int32Array(shared, 0, HEADER_SLOTS);
|
|
61952
61984
|
const worker = new import_node_worker_threads.Worker(PROBE_SOURCE, {
|
|
@@ -61973,6 +62005,7 @@ var import_node_worker_threads, PROBE_TIMEOUT_MS, PROBE_WAIT_MARGIN_MS, REASON_B
|
|
|
61973
62005
|
var init_probe = __esm({
|
|
61974
62006
|
"src/frontdoor/probe.ts"() {
|
|
61975
62007
|
"use strict";
|
|
62008
|
+
init_processRole();
|
|
61976
62009
|
import_node_worker_threads = require("node:worker_threads");
|
|
61977
62010
|
PROBE_TIMEOUT_MS = 2e3;
|
|
61978
62011
|
PROBE_WAIT_MARGIN_MS = 1e3;
|
|
@@ -114096,6 +114129,7 @@ init_route();
|
|
|
114096
114129
|
init_state();
|
|
114097
114130
|
|
|
114098
114131
|
// src/frontdoor/supervisor.ts
|
|
114132
|
+
init_processRole();
|
|
114099
114133
|
var import_node_path44 = __toESM(require("node:path"), 1);
|
|
114100
114134
|
init_state();
|
|
114101
114135
|
function watchedInstallEntry(resolvedOwnExecutablePath, siblingExists) {
|
|
@@ -114110,6 +114144,14 @@ var FRONTDOOR_SUPERVISOR_STILL_RUNNING = -1;
|
|
|
114110
114144
|
var FRONTDOOR_POLL_MS = 1e3;
|
|
114111
114145
|
var MS_PER_MINUTE3 = 6e4;
|
|
114112
114146
|
async function runFrontDoorSupervisor(idleShutdownMinutes, ports, options = {}) {
|
|
114147
|
+
const leaveRole = enterProcessRole("frontdoor-supervisor");
|
|
114148
|
+
try {
|
|
114149
|
+
return await serveFrontDoor(idleShutdownMinutes, ports, options);
|
|
114150
|
+
} finally {
|
|
114151
|
+
leaveRole();
|
|
114152
|
+
}
|
|
114153
|
+
}
|
|
114154
|
+
async function serveFrontDoor(idleShutdownMinutes, ports, options) {
|
|
114113
114155
|
const { fs: fs23, paths } = ports;
|
|
114114
114156
|
const servingBinary = ports.statOwnExecutable();
|
|
114115
114157
|
const previous = readFrontDoorState(fs23, paths.frontdoorStateFile);
|
package/dist/index.cjs
CHANGED
|
@@ -2752,13 +2752,42 @@ var init_state = __esm({
|
|
|
2752
2752
|
}
|
|
2753
2753
|
});
|
|
2754
2754
|
|
|
2755
|
+
// src/processRole.ts
|
|
2756
|
+
function enterProcessRole(role) {
|
|
2757
|
+
const previous = currentRole;
|
|
2758
|
+
currentRole = role;
|
|
2759
|
+
return () => {
|
|
2760
|
+
currentRole = previous;
|
|
2761
|
+
};
|
|
2762
|
+
}
|
|
2763
|
+
function refuseToBlockInRole(operation) {
|
|
2764
|
+
if (currentRole !== void 0) {
|
|
2765
|
+
throw new BlockingInEventLoopError(operation, currentRole);
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
var currentRole, BlockingInEventLoopError;
|
|
2769
|
+
var init_processRole = __esm({
|
|
2770
|
+
"src/processRole.ts"() {
|
|
2771
|
+
"use strict";
|
|
2772
|
+
init_cliError();
|
|
2773
|
+
BlockingInEventLoopError = class extends CliError {
|
|
2774
|
+
constructor(operation, role) {
|
|
2775
|
+
super(
|
|
2776
|
+
`${operation} blocks the calling thread, which in the ${role} is the event loop that answers every session; it must not run there (a launch planned inside the door reaches it through its own addresses, never through the launcher's synchronous coordination)`
|
|
2777
|
+
);
|
|
2778
|
+
this.name = "BlockingInEventLoopError";
|
|
2779
|
+
}
|
|
2780
|
+
};
|
|
2781
|
+
}
|
|
2782
|
+
});
|
|
2783
|
+
|
|
2755
2784
|
// package.json
|
|
2756
2785
|
var package_default;
|
|
2757
2786
|
var init_package = __esm({
|
|
2758
2787
|
"package.json"() {
|
|
2759
2788
|
package_default = {
|
|
2760
2789
|
name: "claude-use",
|
|
2761
|
-
version: "11.
|
|
2790
|
+
version: "11.6.0",
|
|
2762
2791
|
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.",
|
|
2763
2792
|
license: "MIT",
|
|
2764
2793
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -3932,6 +3961,7 @@ function isErrorWithCode(error, code) {
|
|
|
3932
3961
|
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
3933
3962
|
}
|
|
3934
3963
|
function realSleepSync(ms) {
|
|
3964
|
+
refuseToBlockInRole("a synchronous sleep");
|
|
3935
3965
|
Atomics.wait(new Int32Array(new SharedArrayBuffer(INT32_BYTE_LENGTH)), 0, 0, ms);
|
|
3936
3966
|
}
|
|
3937
3967
|
function realIsProcessAlive(pid) {
|
|
@@ -4165,6 +4195,7 @@ var import_node_child_process2, import_node_crypto8, import_node_fs2, import_nod
|
|
|
4165
4195
|
var init_realPorts = __esm({
|
|
4166
4196
|
"src/realPorts.ts"() {
|
|
4167
4197
|
"use strict";
|
|
4198
|
+
init_processRole();
|
|
4168
4199
|
import_node_child_process2 = require("node:child_process");
|
|
4169
4200
|
import_node_crypto8 = require("node:crypto");
|
|
4170
4201
|
import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
@@ -8039,6 +8070,7 @@ var init_ownCli = __esm({
|
|
|
8039
8070
|
|
|
8040
8071
|
// src/frontdoor/probe.ts
|
|
8041
8072
|
function probeFrontDoorSync(port, caPem) {
|
|
8073
|
+
refuseToBlockInRole("a synchronous probe of the front door");
|
|
8042
8074
|
const shared = new SharedArrayBuffer(HEADER_SLOTS * INT32_BYTES + REASON_BYTES);
|
|
8043
8075
|
const header = new Int32Array(shared, 0, HEADER_SLOTS);
|
|
8044
8076
|
const worker = new import_node_worker_threads.Worker(PROBE_SOURCE, {
|
|
@@ -8065,6 +8097,7 @@ var import_node_worker_threads, PROBE_TIMEOUT_MS, PROBE_WAIT_MARGIN_MS, REASON_B
|
|
|
8065
8097
|
var init_probe = __esm({
|
|
8066
8098
|
"src/frontdoor/probe.ts"() {
|
|
8067
8099
|
"use strict";
|
|
8100
|
+
init_processRole();
|
|
8068
8101
|
import_node_worker_threads = require("node:worker_threads");
|
|
8069
8102
|
PROBE_TIMEOUT_MS = 2e3;
|
|
8070
8103
|
PROBE_WAIT_MARGIN_MS = 1e3;
|
|
@@ -9381,6 +9414,7 @@ init_route();
|
|
|
9381
9414
|
init_state();
|
|
9382
9415
|
|
|
9383
9416
|
// src/frontdoor/supervisor.ts
|
|
9417
|
+
init_processRole();
|
|
9384
9418
|
var import_node_path9 = __toESM(require("node:path"), 1);
|
|
9385
9419
|
init_state();
|
|
9386
9420
|
function watchedInstallEntry(resolvedOwnExecutablePath, siblingExists) {
|
|
@@ -9395,6 +9429,14 @@ var FRONTDOOR_SUPERVISOR_STILL_RUNNING = -1;
|
|
|
9395
9429
|
var FRONTDOOR_POLL_MS = 1e3;
|
|
9396
9430
|
var MS_PER_MINUTE = 6e4;
|
|
9397
9431
|
async function runFrontDoorSupervisor(idleShutdownMinutes, ports, options = {}) {
|
|
9432
|
+
const leaveRole = enterProcessRole("frontdoor-supervisor");
|
|
9433
|
+
try {
|
|
9434
|
+
return await serveFrontDoor(idleShutdownMinutes, ports, options);
|
|
9435
|
+
} finally {
|
|
9436
|
+
leaveRole();
|
|
9437
|
+
}
|
|
9438
|
+
}
|
|
9439
|
+
async function serveFrontDoor(idleShutdownMinutes, ports, options) {
|
|
9398
9440
|
const { fs: fs12, paths } = ports;
|
|
9399
9441
|
const servingBinary = ports.statOwnExecutable();
|
|
9400
9442
|
const previous = readFrontDoorState(fs12, paths.frontdoorStateFile);
|
package/dist/index.mjs
CHANGED
|
@@ -2728,13 +2728,42 @@ var init_state = __esm({
|
|
|
2728
2728
|
}
|
|
2729
2729
|
});
|
|
2730
2730
|
|
|
2731
|
+
// src/processRole.ts
|
|
2732
|
+
function enterProcessRole(role) {
|
|
2733
|
+
const previous = currentRole;
|
|
2734
|
+
currentRole = role;
|
|
2735
|
+
return () => {
|
|
2736
|
+
currentRole = previous;
|
|
2737
|
+
};
|
|
2738
|
+
}
|
|
2739
|
+
function refuseToBlockInRole(operation) {
|
|
2740
|
+
if (currentRole !== void 0) {
|
|
2741
|
+
throw new BlockingInEventLoopError(operation, currentRole);
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
var currentRole, BlockingInEventLoopError;
|
|
2745
|
+
var init_processRole = __esm({
|
|
2746
|
+
"src/processRole.ts"() {
|
|
2747
|
+
"use strict";
|
|
2748
|
+
init_cliError();
|
|
2749
|
+
BlockingInEventLoopError = class extends CliError {
|
|
2750
|
+
constructor(operation, role) {
|
|
2751
|
+
super(
|
|
2752
|
+
`${operation} blocks the calling thread, which in the ${role} is the event loop that answers every session; it must not run there (a launch planned inside the door reaches it through its own addresses, never through the launcher's synchronous coordination)`
|
|
2753
|
+
);
|
|
2754
|
+
this.name = "BlockingInEventLoopError";
|
|
2755
|
+
}
|
|
2756
|
+
};
|
|
2757
|
+
}
|
|
2758
|
+
});
|
|
2759
|
+
|
|
2731
2760
|
// package.json
|
|
2732
2761
|
var package_default;
|
|
2733
2762
|
var init_package = __esm({
|
|
2734
2763
|
"package.json"() {
|
|
2735
2764
|
package_default = {
|
|
2736
2765
|
name: "claude-use",
|
|
2737
|
-
version: "11.
|
|
2766
|
+
version: "11.6.0",
|
|
2738
2767
|
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.",
|
|
2739
2768
|
license: "MIT",
|
|
2740
2769
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -3913,6 +3942,7 @@ function isErrorWithCode(error, code) {
|
|
|
3913
3942
|
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
3914
3943
|
}
|
|
3915
3944
|
function realSleepSync(ms) {
|
|
3945
|
+
refuseToBlockInRole("a synchronous sleep");
|
|
3916
3946
|
Atomics.wait(new Int32Array(new SharedArrayBuffer(INT32_BYTE_LENGTH)), 0, 0, ms);
|
|
3917
3947
|
}
|
|
3918
3948
|
function realIsProcessAlive(pid) {
|
|
@@ -4146,6 +4176,7 @@ var realFsPort, OWNER_ONLY_DIR_MODE, OWNER_ONLY_FILE_MODE, PERMISSION_BITS, real
|
|
|
4146
4176
|
var init_realPorts = __esm({
|
|
4147
4177
|
"src/realPorts.ts"() {
|
|
4148
4178
|
"use strict";
|
|
4179
|
+
init_processRole();
|
|
4149
4180
|
init_load();
|
|
4150
4181
|
init_versionDiscovery();
|
|
4151
4182
|
init_supervisorProcesses();
|
|
@@ -8011,6 +8042,7 @@ var init_ownCli = __esm({
|
|
|
8011
8042
|
// src/frontdoor/probe.ts
|
|
8012
8043
|
import { Worker } from "node:worker_threads";
|
|
8013
8044
|
function probeFrontDoorSync(port, caPem) {
|
|
8045
|
+
refuseToBlockInRole("a synchronous probe of the front door");
|
|
8014
8046
|
const shared = new SharedArrayBuffer(HEADER_SLOTS * INT32_BYTES + REASON_BYTES);
|
|
8015
8047
|
const header = new Int32Array(shared, 0, HEADER_SLOTS);
|
|
8016
8048
|
const worker = new Worker(PROBE_SOURCE, {
|
|
@@ -8037,6 +8069,7 @@ var PROBE_TIMEOUT_MS, PROBE_WAIT_MARGIN_MS, REASON_BYTES, HEADER_SLOTS, INT32_BY
|
|
|
8037
8069
|
var init_probe = __esm({
|
|
8038
8070
|
"src/frontdoor/probe.ts"() {
|
|
8039
8071
|
"use strict";
|
|
8072
|
+
init_processRole();
|
|
8040
8073
|
PROBE_TIMEOUT_MS = 2e3;
|
|
8041
8074
|
PROBE_WAIT_MARGIN_MS = 1e3;
|
|
8042
8075
|
REASON_BYTES = 1024;
|
|
@@ -8968,6 +9001,7 @@ init_route();
|
|
|
8968
9001
|
init_state();
|
|
8969
9002
|
|
|
8970
9003
|
// src/frontdoor/supervisor.ts
|
|
9004
|
+
init_processRole();
|
|
8971
9005
|
init_state();
|
|
8972
9006
|
import path9 from "node:path";
|
|
8973
9007
|
function watchedInstallEntry(resolvedOwnExecutablePath, siblingExists) {
|
|
@@ -8982,6 +9016,14 @@ var FRONTDOOR_SUPERVISOR_STILL_RUNNING = -1;
|
|
|
8982
9016
|
var FRONTDOOR_POLL_MS = 1e3;
|
|
8983
9017
|
var MS_PER_MINUTE = 6e4;
|
|
8984
9018
|
async function runFrontDoorSupervisor(idleShutdownMinutes, ports, options = {}) {
|
|
9019
|
+
const leaveRole = enterProcessRole("frontdoor-supervisor");
|
|
9020
|
+
try {
|
|
9021
|
+
return await serveFrontDoor(idleShutdownMinutes, ports, options);
|
|
9022
|
+
} finally {
|
|
9023
|
+
leaveRole();
|
|
9024
|
+
}
|
|
9025
|
+
}
|
|
9026
|
+
async function serveFrontDoor(idleShutdownMinutes, ports, options) {
|
|
8985
9027
|
const { fs: fs12, paths } = ports;
|
|
8986
9028
|
const servingBinary = ports.statOwnExecutable();
|
|
8987
9029
|
const previous = readFrontDoorState(fs12, paths.frontdoorStateFile);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-use",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.6.0",
|
|
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>",
|