switchroom 0.7.8 → 0.7.10
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/switchroom.js
CHANGED
|
@@ -20701,8 +20701,8 @@ function emitAgentService(lines, a, imageTag, buildMode, buildContext, homePrefi
|
|
|
20701
20701
|
PIP_BREAK_SYSTEM_PACKAGES: "1",
|
|
20702
20702
|
PIP_USER: "1",
|
|
20703
20703
|
SWITCHROOM_AGENT_NAME: a.name,
|
|
20704
|
-
|
|
20705
|
-
SWITCHROOM_KERNEL_SOCKET: `/run/switchroom/kernel
|
|
20704
|
+
SWITCHROOM_VAULT_BROKER_SOCK: `/run/switchroom/broker/sock`,
|
|
20705
|
+
SWITCHROOM_KERNEL_SOCKET: `/run/switchroom/kernel/sock`,
|
|
20706
20706
|
SWITCHROOM_RUNTIME: "docker"
|
|
20707
20707
|
};
|
|
20708
20708
|
if (switchroomConfigPath) {
|
|
@@ -24035,8 +24035,8 @@ var {
|
|
|
24035
24035
|
} = import__.default;
|
|
24036
24036
|
|
|
24037
24037
|
// src/build-info.ts
|
|
24038
|
-
var VERSION = "0.7.
|
|
24039
|
-
var COMMIT_SHA = "
|
|
24038
|
+
var VERSION = "0.7.10";
|
|
24039
|
+
var COMMIT_SHA = "3e362edf";
|
|
24040
24040
|
|
|
24041
24041
|
// src/cli/deprecated.ts
|
|
24042
24042
|
init_source();
|
|
@@ -42444,7 +42444,9 @@ async function applyAutoUnlock(opts = {}) {
|
|
|
42444
42444
|
throw new Error(`docker compose restart exited ${restart.status}`);
|
|
42445
42445
|
}
|
|
42446
42446
|
log("\u2713 Restarted vault-broker container (docker compose restart)");
|
|
42447
|
-
const socket =
|
|
42447
|
+
const socket = resolveBrokerSocketPath({
|
|
42448
|
+
vaultBrokerSocket: config.vault?.broker?.socket ? resolvePath(config.vault.broker.socket) : undefined
|
|
42449
|
+
});
|
|
42448
42450
|
const poll = opts.pollStatus ?? (() => statusViaBroker({ socket }));
|
|
42449
42451
|
const deadline = Date.now() + verifyTimeoutMs;
|
|
42450
42452
|
while (Date.now() < deadline) {
|
|
@@ -42467,9 +42469,13 @@ var DEFAULT_SOCKET_PATH2 = "~/.switchroom/vault-broker.sock";
|
|
|
42467
42469
|
function getSocketPath(configPath) {
|
|
42468
42470
|
try {
|
|
42469
42471
|
const config = loadConfig(configPath);
|
|
42470
|
-
return
|
|
42472
|
+
return resolveBrokerSocketPath({
|
|
42473
|
+
vaultBrokerSocket: config.vault?.broker?.socket ? resolvePath(config.vault.broker.socket) : resolvePath(DEFAULT_SOCKET_PATH2)
|
|
42474
|
+
});
|
|
42471
42475
|
} catch {
|
|
42472
|
-
return
|
|
42476
|
+
return resolveBrokerSocketPath({
|
|
42477
|
+
vaultBrokerSocket: resolvePath(DEFAULT_SOCKET_PATH2)
|
|
42478
|
+
});
|
|
42473
42479
|
}
|
|
42474
42480
|
}
|
|
42475
42481
|
function getConfigPath2(configPath) {
|
|
@@ -42907,7 +42913,9 @@ function registerVaultDoctorCommand(vault, program3) {
|
|
|
42907
42913
|
const brokerConfigured = config.vault?.broker?.enabled !== false;
|
|
42908
42914
|
let brokerRunning = undefined;
|
|
42909
42915
|
if (brokerConfigured) {
|
|
42910
|
-
const socketPath =
|
|
42916
|
+
const socketPath = resolveBrokerSocketPath({
|
|
42917
|
+
vaultBrokerSocket: config.vault?.broker?.socket ? resolvePath(config.vault.broker.socket) : undefined
|
|
42918
|
+
});
|
|
42911
42919
|
const status = await statusViaBroker({ socket: socketPath, timeoutMs: 1500 });
|
|
42912
42920
|
brokerRunning = status !== null;
|
|
42913
42921
|
}
|
|
@@ -43116,10 +43124,12 @@ function parseDuration(raw) {
|
|
|
43116
43124
|
function getBrokerOpts(configPath) {
|
|
43117
43125
|
try {
|
|
43118
43126
|
const config = loadConfig(configPath);
|
|
43119
|
-
const socket =
|
|
43127
|
+
const socket = resolveBrokerSocketPath({
|
|
43128
|
+
vaultBrokerSocket: config.vault?.broker?.socket ? resolvePath(config.vault.broker.socket) : undefined
|
|
43129
|
+
});
|
|
43120
43130
|
return { socket };
|
|
43121
43131
|
} catch {
|
|
43122
|
-
return { socket:
|
|
43132
|
+
return { socket: resolveBrokerSocketPath() };
|
|
43123
43133
|
}
|
|
43124
43134
|
}
|
|
43125
43135
|
function formatDate(unixSec) {
|
|
@@ -43468,9 +43478,11 @@ function registerVaultCommand(program3) {
|
|
|
43468
43478
|
let brokerSocket;
|
|
43469
43479
|
try {
|
|
43470
43480
|
const config = loadConfig(parentOpts.config);
|
|
43471
|
-
brokerSocket =
|
|
43481
|
+
brokerSocket = resolveBrokerSocketPath({
|
|
43482
|
+
vaultBrokerSocket: config.vault?.broker?.socket ? resolvePath(config.vault.broker.socket) : undefined
|
|
43483
|
+
});
|
|
43472
43484
|
} catch {
|
|
43473
|
-
brokerSocket =
|
|
43485
|
+
brokerSocket = resolveBrokerSocketPath();
|
|
43474
43486
|
}
|
|
43475
43487
|
const brokerOpts = { socket: brokerSocket };
|
|
43476
43488
|
const status = await statusViaBroker(brokerOpts);
|
package/package.json
CHANGED
|
@@ -64,7 +64,7 @@ if [ "$SWITCHROOM_RUNTIME" = "docker" ] && [ -z "$SWITCHROOM_DOCKER_TMUX_INNER"
|
|
|
64
64
|
# Polls Telegram, writes gateway.sock for the in-claude MCP
|
|
65
65
|
# sidecar to bridge through. Mirrors the v0.6 sibling
|
|
66
66
|
# switchroom-<name>-gateway.service unit. Talks to the broker
|
|
67
|
-
# over
|
|
67
|
+
# over SWITCHROOM_VAULT_BROKER_SOCK (set by compose) for the bot
|
|
68
68
|
# token. Failure modes: vault locked → gateway boots, fails to
|
|
69
69
|
# fetch token, exits non-zero, supervisor respawns; bot token
|
|
70
70
|
# invalid → 401 from Telegram, gateway exits, same loop. The
|
|
@@ -26427,7 +26427,7 @@ function defaultUdsConnect(socketPath) {
|
|
|
26427
26427
|
});
|
|
26428
26428
|
}
|
|
26429
26429
|
async function probeBroker(socketPath, opts = {}) {
|
|
26430
|
-
return probeUds("Broker", socketPath ?? process.env.
|
|
26430
|
+
return probeUds("Broker", socketPath ?? process.env.SWITCHROOM_VAULT_BROKER_SOCK, opts);
|
|
26431
26431
|
}
|
|
26432
26432
|
async function probeKernel(socketPath, opts = {}) {
|
|
26433
26433
|
return probeUds("Kernel", socketPath ?? process.env.SWITCHROOM_KERNEL_SOCKET, opts);
|
|
@@ -40750,10 +40750,10 @@ function sweepStaleTurnActiveMarker(stateDir, opts) {
|
|
|
40750
40750
|
}
|
|
40751
40751
|
|
|
40752
40752
|
// ../src/build-info.ts
|
|
40753
|
-
var VERSION = "0.7.
|
|
40754
|
-
var COMMIT_SHA = "
|
|
40755
|
-
var COMMIT_DATE = "2026-05-
|
|
40756
|
-
var LATEST_PR =
|
|
40753
|
+
var VERSION = "0.7.10";
|
|
40754
|
+
var COMMIT_SHA = "3e362edf";
|
|
40755
|
+
var COMMIT_DATE = "2026-05-10T22:18:36+10:00";
|
|
40756
|
+
var LATEST_PR = 950;
|
|
40757
40757
|
var COMMITS_AHEAD_OF_TAG = 0;
|
|
40758
40758
|
|
|
40759
40759
|
// gateway/unhandled-rejection-policy.ts
|
|
@@ -1203,7 +1203,14 @@ export async function probeBroker(
|
|
|
1203
1203
|
socketPath?: string,
|
|
1204
1204
|
opts: { dockerMode?: boolean; connectImpl?: (path: string) => Promise<void> } = {},
|
|
1205
1205
|
): Promise<ProbeResult> {
|
|
1206
|
-
|
|
1206
|
+
// SWITCHROOM_VAULT_BROKER_SOCK is the canonical client-side env name
|
|
1207
|
+
// — matches what src/vault/broker/client.ts:293 and the secret-guard
|
|
1208
|
+
// hook (telegram-plugin/hooks/secret-guard-pretool.mjs:36) read.
|
|
1209
|
+
// The broker SERVER reads SWITCHROOM_BROKER_SOCKET as its bind-path
|
|
1210
|
+
// env (in the broker container only). Pre-fix the probe + compose
|
|
1211
|
+
// both used SWITCHROOM_BROKER_SOCKET in the agent container — wrong
|
|
1212
|
+
// name, fell through to dangling-symlink fallback, false-failed.
|
|
1213
|
+
return probeUds('Broker', socketPath ?? process.env.SWITCHROOM_VAULT_BROKER_SOCK, opts)
|
|
1207
1214
|
}
|
|
1208
1215
|
|
|
1209
1216
|
export async function probeKernel(
|
|
@@ -724,14 +724,20 @@ describe('probeBroker / probeKernel', () => {
|
|
|
724
724
|
})
|
|
725
725
|
|
|
726
726
|
it('probeBroker fails when no socket path is configured', async () => {
|
|
727
|
-
|
|
728
|
-
|
|
727
|
+
// SWITCHROOM_VAULT_BROKER_SOCK is the canonical client-side env
|
|
728
|
+
// var, matches what src/vault/broker/client.ts and the
|
|
729
|
+
// secret-guard hook read. (Pre-fix the probe used the wrong name
|
|
730
|
+
// SWITCHROOM_BROKER_SOCKET — the broker server's bind-path env —
|
|
731
|
+
// which compose was setting in agent containers but no client
|
|
732
|
+
// ever read.)
|
|
733
|
+
const oldEnv = process.env.SWITCHROOM_VAULT_BROKER_SOCK
|
|
734
|
+
delete process.env.SWITCHROOM_VAULT_BROKER_SOCK
|
|
729
735
|
try {
|
|
730
736
|
const result = await probeBroker(undefined, { dockerMode: true })
|
|
731
737
|
expect(result.status).toBe('fail')
|
|
732
738
|
expect(result.detail).toContain('not configured')
|
|
733
739
|
} finally {
|
|
734
|
-
if (oldEnv !== undefined) process.env.
|
|
740
|
+
if (oldEnv !== undefined) process.env.SWITCHROOM_VAULT_BROKER_SOCK = oldEnv
|
|
735
741
|
}
|
|
736
742
|
})
|
|
737
743
|
|