@trusty-squire/mcp 1.1.17 → 1.1.18-rc.2
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/assets/chrome-scope-launcher +11 -0
- package/dist/bin.js +11 -6
- package/dist/bin.js.map +1 -1
- package/dist/bot/broker/daemon.d.ts +3 -6
- package/dist/bot/broker/daemon.d.ts.map +1 -1
- package/dist/bot/broker/daemon.js +25 -46
- package/dist/bot/broker/daemon.js.map +1 -1
- package/dist/bot/broker/discovery.d.ts +0 -62
- package/dist/bot/broker/discovery.d.ts.map +1 -1
- package/dist/bot/broker/discovery.js +73 -342
- package/dist/bot/broker/discovery.js.map +1 -1
- package/dist/bot/broker/mcp-principal.d.ts +18 -0
- package/dist/bot/broker/mcp-principal.d.ts.map +1 -0
- package/dist/bot/broker/mcp-principal.js +148 -0
- package/dist/bot/broker/mcp-principal.js.map +1 -0
- package/dist/bot/broker/mcp-socket-path.d.ts +2 -0
- package/dist/bot/broker/mcp-socket-path.d.ts.map +1 -0
- package/dist/bot/broker/mcp-socket-path.js +14 -0
- package/dist/bot/broker/mcp-socket-path.js.map +1 -0
- package/dist/bot/broker/mcp-socket.d.ts +8 -0
- package/dist/bot/broker/mcp-socket.d.ts.map +1 -0
- package/dist/bot/broker/mcp-socket.js +150 -0
- package/dist/bot/broker/mcp-socket.js.map +1 -0
- package/dist/bot/broker/operator.d.ts.map +1 -1
- package/dist/bot/broker/operator.js +8 -0
- package/dist/bot/broker/operator.js.map +1 -1
- package/dist/bot/broker/runtime.d.ts +2 -3
- package/dist/bot/broker/runtime.d.ts.map +1 -1
- package/dist/bot/broker/runtime.js +13 -30
- package/dist/bot/broker/runtime.js.map +1 -1
- package/dist/bot/broker/status.js +1 -1
- package/dist/bot/broker/status.js.map +1 -1
- package/dist/bot/broker/transport.d.ts +1 -9
- package/dist/bot/broker/transport.d.ts.map +1 -1
- package/dist/bot/broker/transport.js +8 -56
- package/dist/bot/broker/transport.js.map +1 -1
- package/dist/bot/browser-launch-marker.d.ts +4 -0
- package/dist/bot/browser-launch-marker.d.ts.map +1 -0
- package/dist/bot/browser-launch-marker.js +7 -0
- package/dist/bot/browser-launch-marker.js.map +1 -0
- package/dist/bot/browser-process-owner.d.ts.map +1 -1
- package/dist/bot/browser-process-owner.js +98 -38
- package/dist/bot/browser-process-owner.js.map +1 -1
- package/dist/bot/browser-process-runtime.d.ts +0 -1
- package/dist/bot/browser-process-runtime.d.ts.map +1 -1
- package/dist/bot/browser-process-runtime.js +22 -35
- package/dist/bot/browser-process-runtime.js.map +1 -1
- package/dist/bot/browser-scope.d.ts +15 -0
- package/dist/bot/browser-scope.d.ts.map +1 -0
- package/dist/bot/browser-scope.js +101 -0
- package/dist/bot/browser-scope.js.map +1 -0
- package/dist/bot/browser.d.ts +3 -0
- package/dist/bot/browser.d.ts.map +1 -1
- package/dist/bot/browser.js +11 -3
- package/dist/bot/browser.js.map +1 -1
- package/dist/bot/capture/verification.d.ts +3 -0
- package/dist/bot/capture/verification.d.ts.map +1 -1
- package/dist/bot/capture/verification.js +42 -11
- package/dist/bot/capture/verification.js.map +1 -1
- package/dist/bot/drive-snapshot.d.ts.map +1 -1
- package/dist/bot/drive-snapshot.js +3 -0
- package/dist/bot/drive-snapshot.js.map +1 -1
- package/dist/bot/google-login.js +1 -1
- package/dist/bot/google-login.js.map +1 -1
- package/dist/bot/operate-drive.d.ts +3 -1
- package/dist/bot/operate-drive.d.ts.map +1 -1
- package/dist/bot/operate-drive.js +39 -11
- package/dist/bot/operate-drive.js.map +1 -1
- package/dist/bot/owner-process-reaper.d.ts +14 -92
- package/dist/bot/owner-process-reaper.d.ts.map +1 -1
- package/dist/bot/owner-process-reaper.js +32 -1067
- package/dist/bot/owner-process-reaper.js.map +1 -1
- package/dist/bot/profile-path.d.ts +11 -0
- package/dist/bot/profile-path.d.ts.map +1 -0
- package/dist/bot/profile-path.js +33 -0
- package/dist/bot/profile-path.js.map +1 -0
- package/dist/bot/profile.d.ts +14 -31
- package/dist/bot/profile.d.ts.map +1 -1
- package/dist/bot/profile.js +61 -298
- package/dist/bot/profile.js.map +1 -1
- package/dist/bot/provision-session.d.ts.map +1 -1
- package/dist/bot/provision-session.js +11 -10
- package/dist/bot/provision-session.js.map +1 -1
- package/dist/bot/session/lifecycle.d.ts.map +1 -1
- package/dist/bot/session/lifecycle.js +32 -47
- package/dist/bot/session/lifecycle.js.map +1 -1
- package/dist/bot/session/model.d.ts +1 -2
- package/dist/bot/session/model.d.ts.map +1 -1
- package/dist/bot/session/model.js.map +1 -1
- package/dist/browser-busy.d.ts.map +1 -1
- package/dist/browser-busy.js +11 -4
- package/dist/browser-busy.js.map +1 -1
- package/dist/install/connect-report.d.ts +4 -1
- package/dist/install/connect-report.d.ts.map +1 -1
- package/dist/install/connect-report.js +6 -19
- package/dist/install/connect-report.js.map +1 -1
- package/dist/relay.d.ts +3 -0
- package/dist/relay.d.ts.map +1 -0
- package/dist/relay.js +139 -0
- package/dist/relay.js.map +1 -0
- package/dist/server-instance-registry.d.ts.map +1 -1
- package/dist/server-instance-registry.js +0 -7
- package/dist/server-instance-registry.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -10
- package/dist/server.js.map +1 -1
- package/dist/session-guard.d.ts +1 -0
- package/dist/session-guard.d.ts.map +1 -1
- package/dist/session-guard.js +8 -0
- package/dist/session-guard.js.map +1 -1
- package/dist/tools/credential-mutations.d.ts +20 -20
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/inject-card-schema.d.ts +3 -0
- package/dist/tools/inject-card-schema.d.ts.map +1 -0
- package/dist/tools/inject-card-schema.js +75 -0
- package/dist/tools/inject-card-schema.js.map +1 -0
- package/dist/tools/provision-drive-schema.d.ts +20 -0
- package/dist/tools/provision-drive-schema.d.ts.map +1 -0
- package/dist/tools/provision-drive-schema.js +1114 -0
- package/dist/tools/provision-drive-schema.js.map +1 -0
- package/package.json +1 -1
- package/dist/bot/operator-browser-watchdog.d.ts +0 -127
- package/dist/bot/operator-browser-watchdog.d.ts.map +0 -1
- package/dist/bot/operator-browser-watchdog.js +0 -438
- package/dist/bot/operator-browser-watchdog.js.map +0 -1
- package/dist/bot/owner-process-reaper-worker.d.ts +0 -2
- package/dist/bot/owner-process-reaper-worker.d.ts.map +0 -1
- package/dist/bot/owner-process-reaper-worker.js +0 -17
- package/dist/bot/owner-process-reaper-worker.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Playwright's executablePath entrypoint. The broker remains outside the scope.
|
|
3
|
+
if [ "$TRUSTY_SQUIRE_CHROME_CONTAINMENT" = "scope" ]; then
|
|
4
|
+
exec setpriv --pdeathsig INT systemd-run --user --scope --collect \
|
|
5
|
+
--unit "$TRUSTY_SQUIRE_CHROME_SCOPE_UNIT" \
|
|
6
|
+
"$TRUSTY_SQUIRE_CHROME_BINARY" "$@"
|
|
7
|
+
fi
|
|
8
|
+
if [ "$TRUSTY_SQUIRE_CHROME_SET_PRIV" = "1" ]; then
|
|
9
|
+
exec setpriv --pdeathsig INT "$TRUSTY_SQUIRE_CHROME_BINARY" "$@"
|
|
10
|
+
fi
|
|
11
|
+
exec "$TRUSTY_SQUIRE_CHROME_BINARY" "$@"
|
package/dist/bin.js
CHANGED
|
@@ -13,10 +13,6 @@
|
|
|
13
13
|
// "am I main?" guard — duplicated in cli.ts and server.ts, and wrong in
|
|
14
14
|
// both when launched via a bin symlink — is gone by construction.
|
|
15
15
|
import process from "node:process";
|
|
16
|
-
import { runBrokerDaemon } from "./bot/broker/daemon.js";
|
|
17
|
-
import { MissingSessionError } from "./api-client.js";
|
|
18
|
-
import { runCli } from "./install/cli.js";
|
|
19
|
-
import { runServer } from "./server.js";
|
|
20
16
|
import { VERSION } from "./version.js";
|
|
21
17
|
const argv = process.argv.slice(2);
|
|
22
18
|
// Check for version flags early, before dispatching to subcommands.
|
|
@@ -29,21 +25,30 @@ if (isVersionFlag) {
|
|
|
29
25
|
}
|
|
30
26
|
const isServer = argv[0] === "server";
|
|
31
27
|
const isBroker = argv[0] === "broker";
|
|
28
|
+
const isRelay = argv[0] === "relay";
|
|
32
29
|
// NB: the `housekeeper` subcommand moved to its own operator-only package
|
|
33
30
|
// (@trusty-squire/housekeeper, the `ts-housekeeper` bin). `mcp housekeeper`
|
|
34
31
|
// no longer exists here; the systemd timer invokes ts-housekeeper directly.
|
|
35
32
|
async function dispatch() {
|
|
36
33
|
if (isBroker) {
|
|
34
|
+
const { runBrokerDaemon } = await import("./bot/broker/daemon.js");
|
|
37
35
|
await runBrokerDaemon();
|
|
38
36
|
return 0;
|
|
39
37
|
}
|
|
40
38
|
if (isServer) {
|
|
39
|
+
const { runServer } = await import("./server.js");
|
|
41
40
|
await runServer();
|
|
42
41
|
// runServer force-exits when its client disconnects or it receives a
|
|
43
42
|
// termination signal. A return here is therefore only a normal startup
|
|
44
43
|
// path with no active stdio loop left to keep alive.
|
|
45
44
|
return 0;
|
|
46
45
|
}
|
|
46
|
+
if (isRelay) {
|
|
47
|
+
const { runRelay } = await import("./relay.js");
|
|
48
|
+
await runRelay();
|
|
49
|
+
return 0;
|
|
50
|
+
}
|
|
51
|
+
const { runCli } = await import("./install/cli.js");
|
|
47
52
|
await runCli(argv);
|
|
48
53
|
return 0;
|
|
49
54
|
}
|
|
@@ -58,12 +63,12 @@ dispatch()
|
|
|
58
63
|
//
|
|
59
64
|
// The `server` branch exits from runServer's disconnect/signal shutdown
|
|
60
65
|
// path; `skill` returns its own code via T30 taxonomy.
|
|
61
|
-
if (!isServer && !isBroker)
|
|
66
|
+
if (!isServer && !isBroker && !isRelay)
|
|
62
67
|
process.exit(code);
|
|
63
68
|
})
|
|
64
69
|
.catch((err) => {
|
|
65
70
|
// stderr lands in the host agent's MCP log; keep it useful.
|
|
66
|
-
if (err instanceof MissingSessionError) {
|
|
71
|
+
if (err instanceof Error && err.name === "MissingSessionError") {
|
|
67
72
|
console.error(err.message);
|
|
68
73
|
}
|
|
69
74
|
else {
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,sDAAsD;AACtD,EAAE;AACF,mEAAmE;AACnE,uEAAuE;AACvE,sEAAsE;AACtE,6CAA6C;AAC7C,+EAA+E;AAC/E,iEAAiE;AACjE,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,wEAAwE;AACxE,kEAAkE;AAClE,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,sDAAsD;AACtD,EAAE;AACF,mEAAmE;AACnE,uEAAuE;AACvE,sEAAsE;AACtE,6CAA6C;AAC7C,+EAA+E;AAC/E,iEAAiE;AACjE,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,wEAAwE;AACxE,kEAAkE;AAClE,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,oEAAoE;AACpE,8DAA8D;AAC9D,oCAAoC;AACpC,MAAM,aAAa,GACjB,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAE3F,IAAI,aAAa,EAAE,CAAC;IAClB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,C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AQ,IAAI,CAAC,OAAO;QAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC,CAAC;KACD,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACtB,4DAA4D;IAC5D,IAAI,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,IAAI,KAAK,qBAAqB,EAAE,CAAC;QAC/D,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;QAC5C,OAAO,CAAC,KAAK,CACX,mBAAmB,OAAO,WAAW,GAAG,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAC3F,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
export declare function brokerIdleTimeoutMs(env?: NodeJS.ProcessEnv): number;
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* probe-before-act pattern on any cadence under the idle bound would pin the
|
|
6
|
-
* browser tree forever.
|
|
2
|
+
* Wire connections that hold a claim on the browser. Status probes are reads
|
|
3
|
+
* and do not count as active clients when explicit shutdown checks drain.
|
|
7
4
|
*/
|
|
8
5
|
export declare class BrokerClientRegistry {
|
|
9
6
|
private readonly counting;
|
|
10
7
|
private readonly probes;
|
|
11
8
|
admit(clientId: string, probe: boolean): void;
|
|
12
|
-
/** Whether this client
|
|
9
|
+
/** Whether this wire client holds a claim during explicit shutdown. */
|
|
13
10
|
counts(clientId: string): boolean;
|
|
14
11
|
touch(clientId: string): void;
|
|
15
12
|
retire(clientId: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../../src/bot/broker/daemon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../../src/bot/broker/daemon.ts"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAE5C,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAK7C,uEAAuE;IACvE,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIjC,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI7B,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAK9B,IAAI,IAAI,OAAO;CAGhB;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAqHrD"}
|
|
@@ -1,31 +1,21 @@
|
|
|
1
1
|
import { resolveBrokerSocket } from "./discovery.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { dirname } from "node:path";
|
|
2
|
+
import { lstat, rm, unlink } from "node:fs/promises";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
5
4
|
import { createHash } from "node:crypto";
|
|
6
5
|
import { createSessionGuard, setServingAccountId } from "../../session-guard.js";
|
|
7
6
|
import { setSelfManagedChromeTerminationSignalExitEnabled } from "../browser.js";
|
|
8
|
-
import { startOwnerProcessReaper } from "../owner-process-reaper.js";
|
|
9
7
|
import { acquireProfileOperationGuard, profilePathIdentity, CHROME_PROFILE_DIR, readLockHolder, } from "../profile.js";
|
|
10
8
|
import { brokerBusyStatus } from "./status.js";
|
|
11
9
|
import { installBrokerBrowserCustody } from "./custody.js";
|
|
12
10
|
import { BrokerRuntime } from "./runtime.js";
|
|
11
|
+
import { stopBrowserScope } from "../browser-scope.js";
|
|
13
12
|
import { OperatorBroker } from "./operator.js";
|
|
14
13
|
import { BrokerRefusal } from "./refusal.js";
|
|
15
14
|
import { listenBroker } from "./transport.js";
|
|
16
|
-
|
|
17
|
-
const DEFAULT_BROKER_IDLE_TIMEOUT_MS = 5 * 60_000;
|
|
18
|
-
export function brokerIdleTimeoutMs(env = process.env) {
|
|
19
|
-
const configured = Number(env.TRUSTY_SQUIRE_BROKER_IDLE_TIMEOUT_MS);
|
|
20
|
-
if (!Number.isFinite(configured) || configured <= 0)
|
|
21
|
-
return DEFAULT_BROKER_IDLE_TIMEOUT_MS;
|
|
22
|
-
return Math.max(MIN_BROKER_IDLE_TIMEOUT_MS, configured);
|
|
23
|
-
}
|
|
15
|
+
import { listenSharedMcp } from "./mcp-socket.js";
|
|
24
16
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* probe-before-act pattern on any cadence under the idle bound would pin the
|
|
28
|
-
* browser tree forever.
|
|
17
|
+
* Wire connections that hold a claim on the browser. Status probes are reads
|
|
18
|
+
* and do not count as active clients when explicit shutdown checks drain.
|
|
29
19
|
*/
|
|
30
20
|
export class BrokerClientRegistry {
|
|
31
21
|
counting = new Set();
|
|
@@ -36,7 +26,7 @@ export class BrokerClientRegistry {
|
|
|
36
26
|
else
|
|
37
27
|
this.counting.add(clientId);
|
|
38
28
|
}
|
|
39
|
-
/** Whether this client
|
|
29
|
+
/** Whether this wire client holds a claim during explicit shutdown. */
|
|
40
30
|
counts(clientId) {
|
|
41
31
|
return !this.probes.has(clientId);
|
|
42
32
|
}
|
|
@@ -76,15 +66,17 @@ export async function runBrokerDaemon() {
|
|
|
76
66
|
const cellId = createHash("sha256")
|
|
77
67
|
.update(JSON.stringify([session?.account_id ?? null, profilePathIdentity(CHROME_PROFILE_DIR)]))
|
|
78
68
|
.digest("hex");
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
// The fd is the broker's sole profile authority. A crash releases it in the
|
|
70
|
+
// kernel; the remaining inode carries no owner record.
|
|
71
|
+
const profileElection = acquireProfileOperationGuard(CHROME_PROFILE_DIR);
|
|
72
|
+
await stopBrowserScope(CHROME_PROFILE_DIR);
|
|
73
|
+
// One-time upgrade cleanup. Old file leases are not consulted by this broker.
|
|
74
|
+
await rm(join(dirname(profilePathIdentity(CHROME_PROFILE_DIR)), ".trusty-squire-broker-leases"), {
|
|
75
|
+
recursive: true, force: true,
|
|
76
|
+
});
|
|
81
77
|
const runtime = new BrokerRuntime();
|
|
82
78
|
installBrokerBrowserCustody(runtime);
|
|
83
79
|
setSelfManagedChromeTerminationSignalExitEnabled(false);
|
|
84
|
-
startOwnerProcessReaper();
|
|
85
|
-
// Broker election is anchored beside the canonical profile, independent of
|
|
86
|
-
// each client's socket path or TMPDIR.
|
|
87
|
-
const profileElection = acquireProfileOperationGuard(CHROME_PROFILE_DIR, electionRoot);
|
|
88
80
|
runtime.claimProfile();
|
|
89
81
|
const operator = new OperatorBroker({
|
|
90
82
|
registryBaseUrl: process.env.ADAPTER_REGISTRY_URL ?? "https://registry.trustysquire.ai",
|
|
@@ -92,27 +84,27 @@ export async function runBrokerDaemon() {
|
|
|
92
84
|
const clients = new BrokerClientRegistry();
|
|
93
85
|
let closing = false;
|
|
94
86
|
let listenerClosed = false;
|
|
95
|
-
let idleTimer;
|
|
96
|
-
const idleTimeout = brokerIdleTimeoutMs();
|
|
97
87
|
const drained = () => {
|
|
98
88
|
const inventory = operator.authority.inventory();
|
|
99
89
|
return inventory.sessions === 0 && inventory.admitting === 0 && inventory.closing === 0;
|
|
100
90
|
};
|
|
91
|
+
// Only the elected SQLite lock holder may remove a dead predecessor's socket.
|
|
92
|
+
// The transport itself simply binds and therefore respects live listeners.
|
|
93
|
+
await unlink(path).catch((error) => {
|
|
94
|
+
if (error.code !== "ENOENT")
|
|
95
|
+
throw error;
|
|
96
|
+
});
|
|
101
97
|
const listener = await listenBroker(path, {
|
|
102
98
|
connected: async (principal, params) => {
|
|
103
99
|
const probe = params.probe === true;
|
|
104
100
|
clients.admit(principal.clientId, probe);
|
|
105
101
|
if (probe)
|
|
106
102
|
return;
|
|
107
|
-
if (idleTimer !== undefined)
|
|
108
|
-
clearTimeout(idleTimer);
|
|
109
103
|
},
|
|
110
104
|
call: async (principal, method, params, id) => {
|
|
111
105
|
const execute = async (registeredSignal) => {
|
|
112
106
|
if (clients.counts(principal.clientId)) {
|
|
113
107
|
clients.touch(principal.clientId);
|
|
114
|
-
if (idleTimer !== undefined)
|
|
115
|
-
clearTimeout(idleTimer);
|
|
116
108
|
}
|
|
117
109
|
if (closing)
|
|
118
110
|
throw new BrokerRefusal("broker_lost", "Broker is shutting down; no operator command was dispatched");
|
|
@@ -147,27 +139,13 @@ export async function runBrokerDaemon() {
|
|
|
147
139
|
},
|
|
148
140
|
abort: (principal, requestId) => operator.cancel(principal, requestId),
|
|
149
141
|
disconnect: async (principal, explicit) => {
|
|
150
|
-
const counted = clients.counts(principal.clientId);
|
|
151
142
|
await operator.disconnect(principal, explicit);
|
|
152
143
|
clients.retire(principal.clientId);
|
|
153
|
-
// A probe never held off the countdown, so its departure must not re-arm one.
|
|
154
|
-
if (!counted)
|
|
155
|
-
return;
|
|
156
|
-
scheduleShutdownIfIdle();
|
|
157
144
|
},
|
|
158
145
|
});
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
idleTimer = undefined;
|
|
163
|
-
if (closing || !clients.idle())
|
|
164
|
-
return;
|
|
165
|
-
idleTimer = setTimeout(() => {
|
|
166
|
-
idleTimer = undefined;
|
|
167
|
-
void shutdown();
|
|
168
|
-
}, idleTimeout);
|
|
169
|
-
idleTimer.unref();
|
|
170
|
-
}
|
|
146
|
+
// The MCP listener is a separate surface on the elected broker. It does not
|
|
147
|
+
// participate in profile election, Chrome custody, or the broker wire.
|
|
148
|
+
const mcpListener = await listenSharedMcp(operator);
|
|
171
149
|
const shutdown = async () => {
|
|
172
150
|
if (closing || !clients.idle() || !drained())
|
|
173
151
|
return;
|
|
@@ -179,6 +157,7 @@ export async function runBrokerDaemon() {
|
|
|
179
157
|
}
|
|
180
158
|
if (!listenerClosed) {
|
|
181
159
|
listenerClosed = true;
|
|
160
|
+
await mcpListener.close();
|
|
182
161
|
await listener.close();
|
|
183
162
|
}
|
|
184
163
|
profileElection.release();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon.js","sourceRoot":"","sources":["../../../src/bot/broker/daemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"daemon.js","sourceRoot":"","sources":["../../../src/bot/broker/daemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,gDAAgD,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,YA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AAG,IAAI,CAAC,CAAC;AACzF,CAAC"}
|
|
@@ -1,75 +1,13 @@
|
|
|
1
1
|
import { BrokerClient } from "./transport.js";
|
|
2
|
-
/** Bounded reclaim windows for a resident broker: SIGTERM first, then
|
|
3
|
-
* SIGKILL only if the graceful window does not clear the profile election
|
|
4
|
-
* lease and socket. Shared by prior-contract (#823) and same-contract
|
|
5
|
-
* stale-credential (#849) reclaim. Internal timing only — never a tool
|
|
6
|
-
* parameter or config knob. */
|
|
7
|
-
interface ReclaimTimings {
|
|
8
|
-
termGraceMs: number;
|
|
9
|
-
killGraceMs: number;
|
|
10
|
-
pollMs: number;
|
|
11
|
-
}
|
|
12
|
-
/** Canonical profile discovery is independent of cwd and each client's TMPDIR. */
|
|
13
2
|
export declare function defaultBrokerSocket(profileDir?: string): string;
|
|
14
|
-
/** Where a profile's broker socket lives: the configured override, else the
|
|
15
|
-
* derived default. Pure — no directory is created and nothing is asserted, so
|
|
16
|
-
* a read-only probe can ask for a path that may not exist. */
|
|
17
3
|
export declare function brokerSocketPath(profileDir?: string): string;
|
|
18
4
|
export declare function resolveBrokerSocket(profileDir?: string): string;
|
|
19
|
-
export declare function brokerElectionRoot(profileDir?: string): string;
|
|
20
|
-
export declare function brokerLaunchRoot(profileDir?: string): string;
|
|
21
|
-
/** True when the error means "no live broker socket could be reached at
|
|
22
|
-
* all" — no listener (ENOENT), connection refused, or the broker was lost
|
|
23
|
-
* mid-handshake. Exported for the ceremony's connect-or-launch decision: a
|
|
24
|
-
* genuinely absent broker means "self-launch may serve", while any other
|
|
25
|
-
* failure (an identified resident's refusal, a handshake timeout) must
|
|
26
|
-
* propagate verbatim instead of being swallowed into a self-launch that
|
|
27
|
-
* fail-fasts with the generic profile-busy message. */
|
|
28
5
|
export declare function isUnavailable(error: unknown): boolean;
|
|
29
|
-
/** The refusals that mean another session HAS the browser, as opposed to the
|
|
30
|
-
* broker failing at something. `broker_unavailable` is an identified resident
|
|
31
|
-
* declining to yield; `profile_busy` is the profile layer itself saying "not
|
|
32
|
-
* now". Every other code (a lost connection, a launch timeout, a server-side
|
|
33
|
-
* execution failure) is this run breaking, not contention, and a caller told
|
|
34
|
-
* to wait for a holder would wait on nothing. */
|
|
35
6
|
export declare function isBrowserContentionRefusal(error: unknown): boolean;
|
|
36
|
-
/** Reclaims a resident prior-contract broker for this profile, if one is
|
|
37
|
-
* positively identified: a live daemon that refuses Contract B's `connect`
|
|
38
|
-
* but still authenticates the pre-Contract-B `hello` handshake, while
|
|
39
|
-
* holding this profile's election lease. A same-contract daemon never
|
|
40
|
-
* authenticates `hello` (or is reached only through the ENOENT/unavailable
|
|
41
|
-
* path), so it is never a prior-contract reclaim target — stale-credential
|
|
42
|
-
* reclaim owns that case separately. Returns whether a reclaim happened;
|
|
43
|
-
* throws only when a reclaim was proven possible but could not complete. */
|
|
44
|
-
export declare function reclaimPriorContractBrokerIfPresent(path: string, token: string | undefined, connectError: unknown, timings?: ReclaimTimings): Promise<boolean>;
|
|
45
|
-
/** Reclaims a resident broker from an older Contract B release, if one is
|
|
46
|
-
* positively identified: it refuses the token-less `connect` that this release
|
|
47
|
-
* sends (`unauthorized: Authenticate before issuing commands`), it holds this
|
|
48
|
-
* profile's election lease with a live, broker-argv-corroborated owner pid on
|
|
49
|
-
* this host, and the profile's account binding names the caller's own enrolled
|
|
50
|
-
* account. Every release before the token-less handshake gated `connect` on a
|
|
51
|
-
* credential, so that refusal is the upgrade signal; the binding is what
|
|
52
|
-
* proves the resident is OURS before any signal is sent, and a resident with
|
|
53
|
-
* attached clients is never killed.
|
|
54
|
-
*
|
|
55
|
-
* A broker bound to another account (or carrying no readable binding) is left
|
|
56
|
-
* alone and the original refusal propagates. SIGKILL is skipped if a client
|
|
57
|
-
* appears after SIGTERM. Returns whether a reclaim happened; throws when the
|
|
58
|
-
* resident is identified but must not be (or could not be) reclaimed. */
|
|
59
|
-
export declare function reclaimStaleCredentialBrokerIfPresent(path: string, accountId: string | undefined, connectError: unknown, timings?: ReclaimTimings): Promise<boolean>;
|
|
60
7
|
export declare function brokerEnvironment(env: NodeJS.ProcessEnv, path: string): NodeJS.ProcessEnv;
|
|
61
|
-
/**
|
|
62
|
-
* What a caller may supply when connecting-or-launching. Nothing here is
|
|
63
|
-
* required to reach the broker, and nothing here is an admission credential:
|
|
64
|
-
* connecting takes nothing. The enrolled account is carried ONLY so an
|
|
65
|
-
* upgrade can positively identify a resident broker from an older release
|
|
66
|
-
* before reclaiming it — a pre-Contract-B daemon authenticates the legacy
|
|
67
|
-
* `hello` probe with that same agent session token.
|
|
68
|
-
*/
|
|
69
8
|
export interface BrokerConnectOptions {
|
|
70
9
|
accountId?: string | undefined;
|
|
71
10
|
agentSessionToken?: string | undefined;
|
|
72
11
|
}
|
|
73
12
|
export declare function connectOrLaunchBroker(path: string, options?: BrokerConnectOptions): Promise<BrokerClient>;
|
|
74
|
-
export {};
|
|
75
13
|
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/bot/broker/discovery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/bot/broker/discovery.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AAOtE,wBAAgB,mBAAmB,CAAC,UAAU,SAAsB,GAAG,MAAM,CAG5E;AAED,wBAAgB,gBAAgB,CAAC,UAAU,SAAsB,GAAG,MAAM,CAEzE;AAED,wBAAgB,mBAAmB,CAAC,UAAU,SAAsB,GAAG,MAAM,CAS5E;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGrD;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGlE;AAsDD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,UAAU,CAEzF;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC,CA6BnH"}
|