@provos/ironcurtain 0.5.1 → 0.7.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 +85 -66
- package/dist/cli-help.d.ts +63 -0
- package/dist/cli-help.js +102 -0
- package/dist/cli-help.js.map +1 -0
- package/dist/cli.js +78 -52
- package/dist/cli.js.map +1 -1
- package/dist/config/config-command.js +136 -2
- package/dist/config/config-command.js.map +1 -1
- package/dist/config/generated/tool-annotations.json +487 -338
- package/dist/config/index.d.ts +21 -1
- package/dist/config/index.js +12 -4
- package/dist/config/index.js.map +1 -1
- package/dist/config/mcp-servers.json +2 -8
- package/dist/config/paths.d.ts +30 -0
- package/dist/config/paths.js +58 -0
- package/dist/config/paths.js.map +1 -1
- package/dist/config/tool-description-hints.json +15 -0
- package/dist/config/types.d.ts +13 -0
- package/dist/config/user-config.d.ts +21 -0
- package/dist/config/user-config.js +8 -0
- package/dist/config/user-config.js.map +1 -1
- package/dist/cron/compile-task-policy.d.ts +17 -0
- package/dist/cron/compile-task-policy.js +39 -0
- package/dist/cron/compile-task-policy.js.map +1 -0
- package/dist/cron/cron-scheduler.d.ts +65 -0
- package/dist/cron/cron-scheduler.js +184 -0
- package/dist/cron/cron-scheduler.js.map +1 -0
- package/dist/cron/file-lock.d.ts +41 -0
- package/dist/cron/file-lock.js +156 -0
- package/dist/cron/file-lock.js.map +1 -0
- package/dist/cron/format-utils.d.ts +18 -0
- package/dist/cron/format-utils.js +145 -0
- package/dist/cron/format-utils.js.map +1 -0
- package/dist/cron/git-sync.d.ts +22 -0
- package/dist/cron/git-sync.js +121 -0
- package/dist/cron/git-sync.js.map +1 -0
- package/dist/cron/headless-transport.d.ts +27 -0
- package/dist/cron/headless-transport.js +43 -0
- package/dist/cron/headless-transport.js.map +1 -0
- package/dist/cron/job-commands.d.ts +39 -0
- package/dist/cron/job-commands.js +522 -0
- package/dist/cron/job-commands.js.map +1 -0
- package/dist/cron/job-store.d.ts +35 -0
- package/dist/cron/job-store.js +111 -0
- package/dist/cron/job-store.js.map +1 -0
- package/dist/cron/types.d.ts +127 -0
- package/dist/cron/types.js +25 -0
- package/dist/cron/types.js.map +1 -0
- package/dist/daemon/control-socket.d.ts +127 -0
- package/dist/daemon/control-socket.js +261 -0
- package/dist/daemon/control-socket.js.map +1 -0
- package/dist/daemon/daemon-command.d.ts +13 -0
- package/dist/daemon/daemon-command.js +230 -0
- package/dist/daemon/daemon-command.js.map +1 -0
- package/dist/daemon/ironcurtain-daemon.d.ts +90 -0
- package/dist/daemon/ironcurtain-daemon.js +548 -0
- package/dist/daemon/ironcurtain-daemon.js.map +1 -0
- package/dist/docker/adapters/claude-code.js +8 -48
- package/dist/docker/adapters/claude-code.js.map +1 -1
- package/dist/docker/adapters/goose.d.ts +58 -0
- package/dist/docker/adapters/goose.js +250 -0
- package/dist/docker/adapters/goose.js.map +1 -0
- package/dist/docker/adapters/shared-scripts.d.ts +29 -0
- package/dist/docker/adapters/shared-scripts.js +80 -0
- package/dist/docker/adapters/shared-scripts.js.map +1 -0
- package/dist/docker/agent-adapter.d.ts +12 -0
- package/dist/docker/agent-adapter.js.map +1 -1
- package/dist/docker/agent-registry.d.ts +6 -1
- package/dist/docker/agent-registry.js +10 -1
- package/dist/docker/agent-registry.js.map +1 -1
- package/dist/docker/docker-agent-session.d.ts +2 -25
- package/dist/docker/docker-agent-session.js +7 -106
- package/dist/docker/docker-agent-session.js.map +1 -1
- package/dist/docker/docker-infrastructure.d.ts +8 -0
- package/dist/docker/docker-infrastructure.js +22 -14
- package/dist/docker/docker-infrastructure.js.map +1 -1
- package/dist/docker/mitm-proxy.d.ts +5 -2
- package/dist/docker/mitm-proxy.js +169 -46
- package/dist/docker/mitm-proxy.js.map +1 -1
- package/dist/docker/oauth-credentials.d.ts +15 -2
- package/dist/docker/oauth-credentials.js +92 -8
- package/dist/docker/oauth-credentials.js.map +1 -1
- package/dist/docker/oauth-token-manager.d.ts +80 -0
- package/dist/docker/oauth-token-manager.js +133 -0
- package/dist/docker/oauth-token-manager.js.map +1 -0
- package/dist/docker/pty-session.d.ts +2 -0
- package/dist/docker/pty-session.js +17 -8
- package/dist/docker/pty-session.js.map +1 -1
- package/dist/escalation/escalation-watcher.d.ts +2 -0
- package/dist/escalation/escalation-watcher.js +5 -0
- package/dist/escalation/escalation-watcher.js.map +1 -1
- package/dist/escalation/listener-command.js +9 -58
- package/dist/escalation/listener-command.js.map +1 -1
- package/dist/escalation/listener-lock.d.ts +20 -0
- package/dist/escalation/listener-lock.js +69 -0
- package/dist/escalation/listener-lock.js.map +1 -0
- package/dist/escalation/session-registry.js +1 -14
- package/dist/escalation/session-registry.js.map +1 -1
- package/dist/index.js +51 -2
- package/dist/index.js.map +1 -1
- package/dist/mux/mux-app.d.ts +24 -0
- package/dist/mux/mux-app.js +450 -0
- package/dist/mux/mux-app.js.map +1 -0
- package/dist/mux/mux-command.d.ts +7 -0
- package/dist/mux/mux-command.js +104 -0
- package/dist/mux/mux-command.js.map +1 -0
- package/dist/mux/mux-escalation-manager.d.ts +48 -0
- package/dist/mux/mux-escalation-manager.js +162 -0
- package/dist/mux/mux-escalation-manager.js.map +1 -0
- package/dist/mux/mux-input-handler.d.ts +54 -0
- package/dist/mux/mux-input-handler.js +512 -0
- package/dist/mux/mux-input-handler.js.map +1 -0
- package/dist/mux/mux-renderer.d.ts +106 -0
- package/dist/mux/mux-renderer.js +850 -0
- package/dist/mux/mux-renderer.js.map +1 -0
- package/dist/mux/mux-splash.d.ts +17 -0
- package/dist/mux/mux-splash.js +323 -0
- package/dist/mux/mux-splash.js.map +1 -0
- package/dist/mux/paste-interceptor.d.ts +22 -0
- package/dist/mux/paste-interceptor.js +143 -0
- package/dist/mux/paste-interceptor.js.map +1 -0
- package/dist/mux/pty-bridge.d.ts +79 -0
- package/dist/mux/pty-bridge.js +151 -0
- package/dist/mux/pty-bridge.js.map +1 -0
- package/dist/mux/trusted-input.d.ts +27 -0
- package/dist/mux/trusted-input.js +27 -0
- package/dist/mux/trusted-input.js.map +1 -0
- package/dist/mux/types.d.ts +99 -0
- package/dist/mux/types.js +57 -0
- package/dist/mux/types.js.map +1 -0
- package/dist/pipeline/annotate.js +2 -1
- package/dist/pipeline/annotate.js.map +1 -1
- package/dist/pipeline/compile.d.ts +4 -34
- package/dist/pipeline/compile.js +29 -568
- package/dist/pipeline/compile.js.map +1 -1
- package/dist/pipeline/constitution-compiler.js +1 -1
- package/dist/pipeline/mcp-connections.d.ts +16 -0
- package/dist/pipeline/mcp-connections.js +61 -0
- package/dist/pipeline/mcp-connections.js.map +1 -0
- package/dist/pipeline/pipeline-runner.d.ts +86 -0
- package/dist/pipeline/pipeline-runner.js +554 -0
- package/dist/pipeline/pipeline-runner.js.map +1 -0
- package/dist/pipeline/pipeline-shared.d.ts +29 -2
- package/dist/pipeline/pipeline-shared.js +68 -12
- package/dist/pipeline/pipeline-shared.js.map +1 -1
- package/dist/pipeline/refresh-lists.js +38 -12
- package/dist/pipeline/refresh-lists.js.map +1 -1
- package/dist/pipeline/scenario-generator.js +2 -1
- package/dist/pipeline/scenario-generator.js.map +1 -1
- package/dist/pipeline/tool-annotator.d.ts +3 -3
- package/dist/pipeline/tool-annotator.js +96 -4
- package/dist/pipeline/tool-annotator.js.map +1 -1
- package/dist/pipeline/types.d.ts +52 -0
- package/dist/sandbox/index.js +40 -1
- package/dist/sandbox/index.js.map +1 -1
- package/dist/session/agent-session.d.ts +3 -0
- package/dist/session/agent-session.js +13 -1
- package/dist/session/agent-session.js.map +1 -1
- package/dist/session/index.js +65 -9
- package/dist/session/index.js.map +1 -1
- package/dist/session/preflight.js +26 -6
- package/dist/session/preflight.js.map +1 -1
- package/dist/session/prompts.d.ts +14 -0
- package/dist/session/prompts.js +39 -2
- package/dist/session/prompts.js.map +1 -1
- package/dist/session/session-manager.d.ts +105 -0
- package/dist/session/session-manager.js +134 -0
- package/dist/session/session-manager.js.map +1 -0
- package/dist/session/types.d.ts +33 -0
- package/dist/session/workspace-validation.d.ts +19 -0
- package/dist/session/workspace-validation.js +66 -0
- package/dist/session/workspace-validation.js.map +1 -0
- package/dist/signal/bot-command.d.ts +2 -0
- package/dist/signal/bot-command.js +8 -0
- package/dist/signal/bot-command.js.map +1 -1
- package/dist/signal/format.d.ts +27 -0
- package/dist/signal/format.js +59 -0
- package/dist/signal/format.js.map +1 -1
- package/dist/signal/signal-bot-daemon.d.ts +27 -25
- package/dist/signal/signal-bot-daemon.js +145 -130
- package/dist/signal/signal-bot-daemon.js.map +1 -1
- package/dist/signal/signal-container.js +63 -19
- package/dist/signal/signal-container.js.map +1 -1
- package/dist/signal/signal-transport.js +3 -8
- package/dist/signal/signal-transport.js.map +1 -1
- package/dist/trusted-process/auto-approver.d.ts +13 -4
- package/dist/trusted-process/auto-approver.js +12 -5
- package/dist/trusted-process/auto-approver.js.map +1 -1
- package/dist/trusted-process/domain-utils.d.ts +38 -4
- package/dist/trusted-process/domain-utils.js +118 -11
- package/dist/trusted-process/domain-utils.js.map +1 -1
- package/dist/trusted-process/escalation.js +5 -0
- package/dist/trusted-process/escalation.js.map +1 -1
- package/dist/trusted-process/index.js +6 -2
- package/dist/trusted-process/index.js.map +1 -1
- package/dist/trusted-process/mcp-client-manager.js +11 -5
- package/dist/trusted-process/mcp-client-manager.js.map +1 -1
- package/dist/trusted-process/mcp-proxy-server.d.ts +2 -0
- package/dist/trusted-process/mcp-proxy-server.js +98 -32
- package/dist/trusted-process/mcp-proxy-server.js.map +1 -1
- package/dist/trusted-process/permissive-output-validator.d.ts +23 -0
- package/dist/trusted-process/permissive-output-validator.js +10 -0
- package/dist/trusted-process/permissive-output-validator.js.map +1 -0
- package/dist/trusted-process/policy-engine.d.ts +27 -4
- package/dist/trusted-process/policy-engine.js +152 -57
- package/dist/trusted-process/policy-engine.js.map +1 -1
- package/dist/trusted-process/tool-description-hints.d.ts +19 -0
- package/dist/trusted-process/tool-description-hints.js +53 -0
- package/dist/trusted-process/tool-description-hints.js.map +1 -0
- package/dist/types/argument-roles.d.ts +33 -1
- package/dist/types/argument-roles.js +129 -1
- package/dist/types/argument-roles.js.map +1 -1
- package/docker/Dockerfile.goose +34 -0
- package/docker/entrypoint-goose.sh +30 -0
- package/package.json +6 -1
- package/src/config/generated/tool-annotations.json +487 -338
- package/src/config/mcp-servers.json +2 -8
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PtyBridge -- bridges a node-pty child process to a headless xterm terminal.
|
|
3
|
+
*
|
|
4
|
+
* Data flow:
|
|
5
|
+
* node-pty child -> raw bytes -> @xterm/headless Terminal.write()
|
|
6
|
+
* @xterm/headless buffer -> readBuffer() -> MuxRenderer
|
|
7
|
+
*
|
|
8
|
+
* Each PtyBridge instance owns:
|
|
9
|
+
* - One node-pty child process (the `ironcurtain start --pty` invocation)
|
|
10
|
+
* - One @xterm/headless Terminal (the virtual terminal buffer)
|
|
11
|
+
* - The session's escalation directory path (for trusted input writes)
|
|
12
|
+
*/
|
|
13
|
+
import type { Terminal as TerminalType } from '@xterm/headless';
|
|
14
|
+
import type { PtySessionRegistration } from '../docker/pty-types.js';
|
|
15
|
+
export interface PtyBridge {
|
|
16
|
+
/** The headless terminal instance for reading buffer state. */
|
|
17
|
+
readonly terminal: TerminalType;
|
|
18
|
+
/** The session ID (extracted from child process registration). */
|
|
19
|
+
readonly sessionId: string | undefined;
|
|
20
|
+
/** The escalation directory path for this session. */
|
|
21
|
+
readonly escalationDir: string | undefined;
|
|
22
|
+
/** Whether the child process is still running. */
|
|
23
|
+
readonly alive: boolean;
|
|
24
|
+
/** The child process exit code, if exited. */
|
|
25
|
+
readonly exitCode: number | undefined;
|
|
26
|
+
/** The child process PID. */
|
|
27
|
+
readonly pid: number;
|
|
28
|
+
/**
|
|
29
|
+
* Writes raw bytes to the child process's PTY stdin.
|
|
30
|
+
* Used in PTY mode to forward keystrokes.
|
|
31
|
+
*/
|
|
32
|
+
write(data: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Resizes the child PTY and the headless terminal.
|
|
35
|
+
*/
|
|
36
|
+
resize(cols: number, rows: number): void;
|
|
37
|
+
/**
|
|
38
|
+
* Kills the child process and cleans up resources.
|
|
39
|
+
*/
|
|
40
|
+
kill(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Registers a callback invoked when new output arrives.
|
|
43
|
+
*/
|
|
44
|
+
onOutput(callback: () => void): void;
|
|
45
|
+
/**
|
|
46
|
+
* Registers a callback invoked when the child process exits.
|
|
47
|
+
*/
|
|
48
|
+
onExit(callback: (exitCode: number) => void): void;
|
|
49
|
+
/**
|
|
50
|
+
* Registers a callback invoked when the child's session registration
|
|
51
|
+
* is discovered (sessionId and escalationDir become available).
|
|
52
|
+
*/
|
|
53
|
+
onSessionDiscovered(callback: (registration: PtySessionRegistration | null) => void): void;
|
|
54
|
+
/**
|
|
55
|
+
* Updates the registration if not already set (e.g. from late discovery
|
|
56
|
+
* via the escalation manager's registry polling). Fires any queued
|
|
57
|
+
* session callbacks.
|
|
58
|
+
*/
|
|
59
|
+
updateRegistration(registration: PtySessionRegistration): void;
|
|
60
|
+
}
|
|
61
|
+
export interface PtyBridgeOptions {
|
|
62
|
+
/** Columns for the initial PTY size. */
|
|
63
|
+
readonly cols: number;
|
|
64
|
+
/** Rows for the initial PTY size. */
|
|
65
|
+
readonly rows: number;
|
|
66
|
+
/** The ironcurtain binary path (or runtime like tsx/node). */
|
|
67
|
+
readonly ironcurtainBin: string;
|
|
68
|
+
/** Extra args to insert before the 'start' subcommand (e.g. the script path when running via tsx). */
|
|
69
|
+
readonly prefixArgs?: string[];
|
|
70
|
+
/** Agent to pass to --agent flag. */
|
|
71
|
+
readonly agent: string;
|
|
72
|
+
/** Optional workspace directory path (passed as --workspace to the child). */
|
|
73
|
+
readonly workspacePath?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Spawns a new `ironcurtain start --pty` child process via node-pty
|
|
77
|
+
* and wires it to a headless xterm terminal.
|
|
78
|
+
*/
|
|
79
|
+
export declare function createPtyBridge(options: PtyBridgeOptions): Promise<PtyBridge>;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PtyBridge -- bridges a node-pty child process to a headless xterm terminal.
|
|
3
|
+
*
|
|
4
|
+
* Data flow:
|
|
5
|
+
* node-pty child -> raw bytes -> @xterm/headless Terminal.write()
|
|
6
|
+
* @xterm/headless buffer -> readBuffer() -> MuxRenderer
|
|
7
|
+
*
|
|
8
|
+
* Each PtyBridge instance owns:
|
|
9
|
+
* - One node-pty child process (the `ironcurtain start --pty` invocation)
|
|
10
|
+
* - One @xterm/headless Terminal (the virtual terminal buffer)
|
|
11
|
+
* - The session's escalation directory path (for trusted input writes)
|
|
12
|
+
*/
|
|
13
|
+
import xtermHeadless from '@xterm/headless';
|
|
14
|
+
const { Terminal } = xtermHeadless;
|
|
15
|
+
import { getPtyRegistryDir } from '../config/paths.js';
|
|
16
|
+
import { readActiveRegistrations } from '../escalation/session-registry.js';
|
|
17
|
+
/** Session discovery timeout (ms). */
|
|
18
|
+
const DISCOVERY_TIMEOUT_MS = 10_000;
|
|
19
|
+
/** Session discovery poll interval (ms). */
|
|
20
|
+
const DISCOVERY_POLL_MS = 200;
|
|
21
|
+
/**
|
|
22
|
+
* Spawns a new `ironcurtain start --pty` child process via node-pty
|
|
23
|
+
* and wires it to a headless xterm terminal.
|
|
24
|
+
*/
|
|
25
|
+
export async function createPtyBridge(options) {
|
|
26
|
+
const nodePty = (await import('node-pty'));
|
|
27
|
+
const terminal = new Terminal({
|
|
28
|
+
cols: options.cols,
|
|
29
|
+
rows: options.rows,
|
|
30
|
+
allowProposedApi: true,
|
|
31
|
+
});
|
|
32
|
+
const spawnArgs = [...(options.prefixArgs ?? []), 'start', '--pty', '--agent', options.agent];
|
|
33
|
+
if (options.workspacePath) {
|
|
34
|
+
spawnArgs.push('--workspace', options.workspacePath);
|
|
35
|
+
}
|
|
36
|
+
const child = nodePty.spawn(options.ironcurtainBin, spawnArgs, {
|
|
37
|
+
cols: options.cols,
|
|
38
|
+
rows: options.rows,
|
|
39
|
+
name: 'xterm-256color',
|
|
40
|
+
env: process.env,
|
|
41
|
+
});
|
|
42
|
+
const outputCallbacks = [];
|
|
43
|
+
const exitCallbacks = [];
|
|
44
|
+
const sessionCallbacks = [];
|
|
45
|
+
let _alive = true;
|
|
46
|
+
let _exitCode;
|
|
47
|
+
let _registration;
|
|
48
|
+
// Wire child output to headless terminal
|
|
49
|
+
child.onData((data) => {
|
|
50
|
+
terminal.write(data, () => {
|
|
51
|
+
for (const cb of outputCallbacks)
|
|
52
|
+
cb();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
const discoveryAbort = new AbortController();
|
|
56
|
+
child.onExit(({ exitCode }) => {
|
|
57
|
+
_alive = false;
|
|
58
|
+
_exitCode = exitCode;
|
|
59
|
+
discoveryAbort.abort();
|
|
60
|
+
// If discovery hasn't resolved yet, flush callbacks with null
|
|
61
|
+
if (_registration === undefined) {
|
|
62
|
+
_registration = null;
|
|
63
|
+
for (const cb of sessionCallbacks)
|
|
64
|
+
cb(null);
|
|
65
|
+
sessionCallbacks.length = 0;
|
|
66
|
+
}
|
|
67
|
+
for (const cb of exitCallbacks)
|
|
68
|
+
cb(exitCode);
|
|
69
|
+
});
|
|
70
|
+
// Start session discovery
|
|
71
|
+
void discoverSessionRegistration(child.pid, discoveryAbort.signal).then((registration) => {
|
|
72
|
+
if (!_alive)
|
|
73
|
+
return; // child already exited; ignore late result
|
|
74
|
+
_registration = registration;
|
|
75
|
+
for (const cb of sessionCallbacks)
|
|
76
|
+
cb(registration);
|
|
77
|
+
sessionCallbacks.length = 0;
|
|
78
|
+
});
|
|
79
|
+
return {
|
|
80
|
+
get terminal() {
|
|
81
|
+
return terminal;
|
|
82
|
+
},
|
|
83
|
+
get sessionId() {
|
|
84
|
+
return _registration?.sessionId;
|
|
85
|
+
},
|
|
86
|
+
get escalationDir() {
|
|
87
|
+
return _registration?.escalationDir;
|
|
88
|
+
},
|
|
89
|
+
get alive() {
|
|
90
|
+
return _alive;
|
|
91
|
+
},
|
|
92
|
+
get exitCode() {
|
|
93
|
+
return _exitCode;
|
|
94
|
+
},
|
|
95
|
+
get pid() {
|
|
96
|
+
return child.pid;
|
|
97
|
+
},
|
|
98
|
+
write(data) {
|
|
99
|
+
if (_alive)
|
|
100
|
+
child.write(data);
|
|
101
|
+
},
|
|
102
|
+
resize(cols, rows) {
|
|
103
|
+
if (_alive)
|
|
104
|
+
child.resize(cols, rows);
|
|
105
|
+
terminal.resize(cols, rows);
|
|
106
|
+
},
|
|
107
|
+
kill() {
|
|
108
|
+
if (_alive)
|
|
109
|
+
child.kill('SIGTERM');
|
|
110
|
+
},
|
|
111
|
+
onOutput(callback) {
|
|
112
|
+
outputCallbacks.push(callback);
|
|
113
|
+
},
|
|
114
|
+
onExit(callback) {
|
|
115
|
+
exitCallbacks.push(callback);
|
|
116
|
+
},
|
|
117
|
+
onSessionDiscovered(callback) {
|
|
118
|
+
// If already discovered, call immediately with the stored registration
|
|
119
|
+
if (_registration !== undefined || !_alive) {
|
|
120
|
+
callback(_registration ?? null);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
sessionCallbacks.push(callback);
|
|
124
|
+
},
|
|
125
|
+
updateRegistration(registration) {
|
|
126
|
+
if (_registration)
|
|
127
|
+
return; // already have one
|
|
128
|
+
_registration = registration;
|
|
129
|
+
for (const cb of sessionCallbacks)
|
|
130
|
+
cb(registration);
|
|
131
|
+
sessionCallbacks.length = 0;
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Polls the PTY registry for a registration matching the child PID.
|
|
137
|
+
* Stops early if the abort signal fires (e.g. child exited).
|
|
138
|
+
*/
|
|
139
|
+
async function discoverSessionRegistration(childPid, signal) {
|
|
140
|
+
const registryDir = getPtyRegistryDir();
|
|
141
|
+
const deadline = Date.now() + DISCOVERY_TIMEOUT_MS;
|
|
142
|
+
while (Date.now() < deadline && !signal.aborted) {
|
|
143
|
+
const registrations = readActiveRegistrations(registryDir);
|
|
144
|
+
const match = registrations.find((r) => r.pid === childPid);
|
|
145
|
+
if (match)
|
|
146
|
+
return match;
|
|
147
|
+
await new Promise((r) => setTimeout(r, DISCOVERY_POLL_MS));
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=pty-bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pty-bridge.js","sourceRoot":"","sources":["../../src/mux/pty-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AA6E5E,sCAAsC;AACtC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AACpC,4CAA4C;AAC5C,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAyB;IAC7D,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,CAA8B,CAAC;IAExE,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC;QAC5B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9F,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;QAC1B,SAAS,CAAC,IAAI,CAAC,aAAa,EAAE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 -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trusted input module for the terminal multiplexer.
|
|
3
|
+
*
|
|
4
|
+
* Writes user-context.json with a `source: "mux-trusted-input"` field
|
|
5
|
+
* that the auto-approver can check to distinguish trusted input from
|
|
6
|
+
* context written by the session (which is in-sandbox and untrusted
|
|
7
|
+
* in PTY mode).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The user-context.json schema for mux trusted input.
|
|
11
|
+
*/
|
|
12
|
+
export interface TrustedUserContext {
|
|
13
|
+
/** The user's message text. */
|
|
14
|
+
readonly userMessage: string;
|
|
15
|
+
/** ISO 8601 timestamp when the input was captured. */
|
|
16
|
+
readonly timestamp: string;
|
|
17
|
+
/** Source identifier. Must be "mux-trusted-input" for auto-approver trust. */
|
|
18
|
+
readonly source: 'mux-trusted-input';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Writes a trusted user context file to the session's escalation directory.
|
|
22
|
+
* Uses atomicWriteJsonSync for crash-safe writes.
|
|
23
|
+
*
|
|
24
|
+
* @param escalationDir - Absolute path to the session's escalation directory
|
|
25
|
+
* @param userMessage - The user's message text
|
|
26
|
+
*/
|
|
27
|
+
export declare function writeTrustedUserContext(escalationDir: string, userMessage: string): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trusted input module for the terminal multiplexer.
|
|
3
|
+
*
|
|
4
|
+
* Writes user-context.json with a `source: "mux-trusted-input"` field
|
|
5
|
+
* that the auto-approver can check to distinguish trusted input from
|
|
6
|
+
* context written by the session (which is in-sandbox and untrusted
|
|
7
|
+
* in PTY mode).
|
|
8
|
+
*/
|
|
9
|
+
import { atomicWriteJsonSync } from '../escalation/escalation-watcher.js';
|
|
10
|
+
import { resolve } from 'node:path';
|
|
11
|
+
/**
|
|
12
|
+
* Writes a trusted user context file to the session's escalation directory.
|
|
13
|
+
* Uses atomicWriteJsonSync for crash-safe writes.
|
|
14
|
+
*
|
|
15
|
+
* @param escalationDir - Absolute path to the session's escalation directory
|
|
16
|
+
* @param userMessage - The user's message text
|
|
17
|
+
*/
|
|
18
|
+
export function writeTrustedUserContext(escalationDir, userMessage) {
|
|
19
|
+
const contextPath = resolve(escalationDir, 'user-context.json');
|
|
20
|
+
const context = {
|
|
21
|
+
userMessage,
|
|
22
|
+
timestamp: new Date().toISOString(),
|
|
23
|
+
source: 'mux-trusted-input',
|
|
24
|
+
};
|
|
25
|
+
atomicWriteJsonSync(contextPath, context);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=trusted-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trusted-input.js","sourceRoot":"","sources":["../../src/mux/trusted-input.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,aAAqB,EAAE,WAAmB;IAChF,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;IAChE,MAAM,OAAO,GAAuB;QAClC,WAAW;QACX,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,MAAM,EAAE,mBAAmB;KAC5B,CAAC;IACF,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the terminal multiplexer (`ironcurtain mux`).
|
|
3
|
+
*/
|
|
4
|
+
import type { PtyBridge } from './pty-bridge.js';
|
|
5
|
+
/** Input mode for the mux. */
|
|
6
|
+
export type InputMode = 'pty' | 'command' | 'picker';
|
|
7
|
+
/** A single tab in the mux. */
|
|
8
|
+
export interface MuxTab {
|
|
9
|
+
/** Sequential tab number (1-based, for display). */
|
|
10
|
+
readonly number: number;
|
|
11
|
+
/** The PtyBridge instance for this tab. */
|
|
12
|
+
readonly bridge: PtyBridge;
|
|
13
|
+
/** Display label for the tab. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Whether the child process has exited. */
|
|
16
|
+
status: 'running' | 'exited';
|
|
17
|
+
/** Exit code if exited. */
|
|
18
|
+
exitCode?: number;
|
|
19
|
+
/** Whether escalation watching is available for this session. */
|
|
20
|
+
escalationAvailable: boolean;
|
|
21
|
+
/** Scroll offset into xterm buffer (null = live/bottom). */
|
|
22
|
+
scrollOffset: number | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Actions produced by the input handler for the orchestrator to execute.
|
|
26
|
+
*/
|
|
27
|
+
export type MuxAction = {
|
|
28
|
+
readonly kind: 'none';
|
|
29
|
+
} | {
|
|
30
|
+
readonly kind: 'write-pty';
|
|
31
|
+
readonly data: string;
|
|
32
|
+
} | {
|
|
33
|
+
readonly kind: 'enter-command-mode';
|
|
34
|
+
} | {
|
|
35
|
+
readonly kind: 'enter-pty-mode';
|
|
36
|
+
} | {
|
|
37
|
+
readonly kind: 'command';
|
|
38
|
+
readonly command: string;
|
|
39
|
+
readonly args: string[];
|
|
40
|
+
} | {
|
|
41
|
+
readonly kind: 'trusted-input';
|
|
42
|
+
readonly text: string;
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: 'redraw-input';
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: 'enter-picker-mode';
|
|
47
|
+
} | {
|
|
48
|
+
readonly kind: 'picker-spawn';
|
|
49
|
+
readonly workspacePath?: string;
|
|
50
|
+
} | {
|
|
51
|
+
readonly kind: 'picker-cancel';
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: 'redraw-picker';
|
|
54
|
+
} | {
|
|
55
|
+
readonly kind: 'scroll-up';
|
|
56
|
+
readonly amount: number;
|
|
57
|
+
} | {
|
|
58
|
+
readonly kind: 'scroll-down';
|
|
59
|
+
readonly amount: number;
|
|
60
|
+
} | {
|
|
61
|
+
readonly kind: 'quit';
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Layout calculations for the screen regions.
|
|
65
|
+
*/
|
|
66
|
+
export interface Layout {
|
|
67
|
+
/** Y position of the tab bar (always 0). */
|
|
68
|
+
readonly tabBarY: number;
|
|
69
|
+
/** Y position of the PTY viewport. */
|
|
70
|
+
readonly ptyViewportY: number;
|
|
71
|
+
/** Height of the PTY viewport in rows (CONSTANT -- never changes on mode switch). */
|
|
72
|
+
readonly ptyViewportRows: number;
|
|
73
|
+
/** Y position of the footer. */
|
|
74
|
+
readonly footerY: number;
|
|
75
|
+
/** Total overlay rows in command mode (0 in PTY mode). */
|
|
76
|
+
readonly overlayRows: number;
|
|
77
|
+
/** Y position where overlay starts. */
|
|
78
|
+
readonly overlayY: number;
|
|
79
|
+
/** Height of the escalation panel within the overlay. */
|
|
80
|
+
readonly escalationPanelRows: number;
|
|
81
|
+
/** Rows available for the picker overlay (half of viewport). */
|
|
82
|
+
readonly pickerRows: number;
|
|
83
|
+
/** Y position where the picker overlay starts. */
|
|
84
|
+
readonly pickerY: number;
|
|
85
|
+
/** Actual number of input rows allocated (after clamping). */
|
|
86
|
+
readonly inputLineRows: number;
|
|
87
|
+
}
|
|
88
|
+
export declare const MAX_INPUT_LINE_ROWS = 6;
|
|
89
|
+
/**
|
|
90
|
+
* Calculates the screen layout.
|
|
91
|
+
*
|
|
92
|
+
* The PTY viewport is CONSTANT: totalRows - TAB_BAR_ROWS - FOOTER_ROWS.
|
|
93
|
+
* In command mode, the overlay paints over the bottom rows of the PTY viewport.
|
|
94
|
+
*
|
|
95
|
+
* @param inputLineRows - Number of input rows requested (default 1). Clamped
|
|
96
|
+
* between MIN_INPUT_LINE_ROWS and MAX_INPUT_LINE_ROWS, then further clamped
|
|
97
|
+
* by available viewport space.
|
|
98
|
+
*/
|
|
99
|
+
export declare function calculateLayout(totalRows: number, mode: InputMode, pendingCount: number, inputLineRows?: number): Layout;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the terminal multiplexer (`ironcurtain mux`).
|
|
3
|
+
*/
|
|
4
|
+
// Layout constants
|
|
5
|
+
const TAB_BAR_ROWS = 1;
|
|
6
|
+
const FOOTER_ROWS = 2;
|
|
7
|
+
const HINT_BAR_ROWS = 1;
|
|
8
|
+
const MIN_INPUT_LINE_ROWS = 1;
|
|
9
|
+
export const MAX_INPUT_LINE_ROWS = 6;
|
|
10
|
+
const ESCALATION_ROWS_PER_ITEM = 4;
|
|
11
|
+
const MAX_ESCALATION_PANEL_ROWS = 12;
|
|
12
|
+
/**
|
|
13
|
+
* Calculates the screen layout.
|
|
14
|
+
*
|
|
15
|
+
* The PTY viewport is CONSTANT: totalRows - TAB_BAR_ROWS - FOOTER_ROWS.
|
|
16
|
+
* In command mode, the overlay paints over the bottom rows of the PTY viewport.
|
|
17
|
+
*
|
|
18
|
+
* @param inputLineRows - Number of input rows requested (default 1). Clamped
|
|
19
|
+
* between MIN_INPUT_LINE_ROWS and MAX_INPUT_LINE_ROWS, then further clamped
|
|
20
|
+
* by available viewport space.
|
|
21
|
+
*/
|
|
22
|
+
export function calculateLayout(totalRows, mode, pendingCount, inputLineRows = 1) {
|
|
23
|
+
// Ensure footer fits on screen; degrade gracefully on tiny terminals
|
|
24
|
+
const footerRows = Math.min(FOOTER_ROWS, Math.max(0, totalRows - TAB_BAR_ROWS));
|
|
25
|
+
const ptyViewportRows = Math.max(1, totalRows - TAB_BAR_ROWS - footerRows);
|
|
26
|
+
let overlayRows = 0;
|
|
27
|
+
let escalationPanelRows = 0;
|
|
28
|
+
let allocatedInputRows = MIN_INPUT_LINE_ROWS;
|
|
29
|
+
if (mode === 'command') {
|
|
30
|
+
if (pendingCount > 0) {
|
|
31
|
+
escalationPanelRows = Math.min(pendingCount * ESCALATION_ROWS_PER_ITEM, MAX_ESCALATION_PANEL_ROWS);
|
|
32
|
+
}
|
|
33
|
+
const actualInputRows = Math.min(Math.max(inputLineRows, MIN_INPUT_LINE_ROWS), MAX_INPUT_LINE_ROWS);
|
|
34
|
+
// Ensure overlay fits at least the hint bar + 1 input row, even on tiny terminals.
|
|
35
|
+
const minOverlay = Math.min(ptyViewportRows, HINT_BAR_ROWS + MIN_INPUT_LINE_ROWS);
|
|
36
|
+
overlayRows = Math.max(minOverlay, Math.min(escalationPanelRows + HINT_BAR_ROWS + actualInputRows, Math.floor(ptyViewportRows / 2), ptyViewportRows));
|
|
37
|
+
// Clamp escalation panel to fit within overlay budget, reserving
|
|
38
|
+
// space for the hint bar and at least one input row.
|
|
39
|
+
escalationPanelRows = Math.min(escalationPanelRows, Math.max(0, overlayRows - HINT_BAR_ROWS - MIN_INPUT_LINE_ROWS));
|
|
40
|
+
allocatedInputRows = Math.max(MIN_INPUT_LINE_ROWS, overlayRows - escalationPanelRows - HINT_BAR_ROWS);
|
|
41
|
+
}
|
|
42
|
+
const pickerRows = mode === 'picker' ? Math.min(Math.floor(ptyViewportRows / 2), ptyViewportRows) : 0;
|
|
43
|
+
const pickerY = TAB_BAR_ROWS + ptyViewportRows - pickerRows;
|
|
44
|
+
return {
|
|
45
|
+
tabBarY: 0,
|
|
46
|
+
ptyViewportY: TAB_BAR_ROWS,
|
|
47
|
+
ptyViewportRows,
|
|
48
|
+
footerY: TAB_BAR_ROWS + ptyViewportRows,
|
|
49
|
+
overlayRows,
|
|
50
|
+
overlayY: TAB_BAR_ROWS + ptyViewportRows - overlayRows,
|
|
51
|
+
escalationPanelRows,
|
|
52
|
+
pickerRows,
|
|
53
|
+
pickerY,
|
|
54
|
+
inputLineRows: mode === 'command' ? allocatedInputRows : 1,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/mux/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAsEH,mBAAmB;AACnB,MAAM,YA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BAAmB,GAAG,aAAa,GAAG,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,CAAC,CAAC,EAAE,eAAe,CAAC,CAClH,CAAC;QACF,iEAAiE;QACjE,qDAAqD;QACrD,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,aAAa,GAAG,mBAAmB,CAAC,CAAC,CAAC;QACpH,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,WAAW,GAAG,mBAAmB,GAAG,aAAa,CAAC,CAAC;IACxG,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtG,MAAM,OAAO,GAAG,YAAY,GAAG,eAAe,GAAG,UAAU,CAAC;IAE5D,OAAO;QACL,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,YAAY;QAC1B,eAAe;QACf,OAAO,EAAE,YAAY,GAAG,eAAe;QACvC,WAAW;QACX,QAAQ,EAAE,YAAY,GAAG,eAAe,GAAG,WAAW;QACtD,mBAAmB;QACnB,UAAU;QACV,OAAO;QACP,aAAa,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;KAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { resolve } from 'node:path';
|
|
|
10
10
|
import { fileURLToPath } from 'node:url';
|
|
11
11
|
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
12
12
|
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
13
|
+
import { permissiveJsonSchemaValidator } from '../trusted-process/permissive-output-validator.js';
|
|
13
14
|
import chalk from 'chalk';
|
|
14
15
|
import { computeHash, createPipelineLlm, loadExistingArtifact, loadPipelineConfig, showCached, writeArtifact, withSpinner, } from './pipeline-shared.js';
|
|
15
16
|
import { annotateTools, buildAnnotationPrompt, validateAnnotationsHeuristic } from './tool-annotator.js';
|
|
@@ -33,7 +34,7 @@ async function connectAndDiscoverTools(mcpServers) {
|
|
|
33
34
|
if (transport.stderr) {
|
|
34
35
|
transport.stderr.on('data', () => { });
|
|
35
36
|
}
|
|
36
|
-
client = new Client({ name: 'ironcurtain-annotator', version: VERSION });
|
|
37
|
+
client = new Client({ name: 'ironcurtain-annotator', version: VERSION }, { jsonSchemaValidator: permissiveJsonSchemaValidator });
|
|
37
38
|
await client.connect(transport);
|
|
38
39
|
const toolsResult = await client.listTools();
|
|
39
40
|
totalTools += toolsResult.tools.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotate.js","sourceRoot":"","sources":["../../src/pipeline/annotate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAEzG,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAWxC,KAAK,UAAU,uBAAuB,CACpC,UAA2C;IAE3C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,WAAW,CAClC,iCAAiC,EACjC,KAAK,EAAE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
|
2
2
|
* CLI entry point for `ironcurtain compile-policy`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* 2. Generate test scenarios via LLM
|
|
7
|
-
* 3. Verify compiled policy against real engine + LLM judge
|
|
4
|
+
* Thin wrapper over PipelineRunner that handles CLI-specific concerns:
|
|
5
|
+
* loading config, printing the progress banner, and exit codes.
|
|
8
6
|
*
|
|
9
|
-
*
|
|
10
|
-
* `npm run annotate-tools` first to generate it.
|
|
7
|
+
* The core compile-verify-repair loop lives in PipelineRunner.
|
|
11
8
|
*/
|
|
12
|
-
|
|
13
|
-
import { type McpServerConnection } from './list-resolver.js';
|
|
14
|
-
import type { CompiledRule, DiscardedScenario, ListDefinition, TestScenario } from './types.js';
|
|
15
|
-
/**
|
|
16
|
-
* Merges replacement scenarios from the regeneration session into the
|
|
17
|
-
* scenario list. Removes corrected and discarded scenarios, then adds
|
|
18
|
-
* unique replacements that don't duplicate any remaining scenario.
|
|
19
|
-
*/
|
|
20
|
-
export declare function mergeReplacements(scenarios: TestScenario[], replacements: TestScenario[], corrections: ReadonlyArray<{
|
|
21
|
-
scenarioDescription: string;
|
|
22
|
-
}>, discardedScenarios: ReadonlyArray<DiscardedScenario>): TestScenario[];
|
|
23
|
-
/**
|
|
24
|
-
* Resolves all `paths.within` values in compiled rules to their real
|
|
25
|
-
* filesystem paths, following symlinks. This ensures that symlinked
|
|
26
|
-
* directories (e.g., ~/Downloads -> /mnt/c/.../Downloads on WSL) are
|
|
27
|
-
* resolved to their canonical form so that runtime path comparisons
|
|
28
|
-
* match correctly.
|
|
29
|
-
*
|
|
30
|
-
* Falls back to path.resolve() if the path does not exist on disk.
|
|
31
|
-
*/
|
|
32
|
-
export declare function resolveRulePaths(rules: CompiledRule[]): CompiledRule[];
|
|
33
|
-
/**
|
|
34
|
-
* Connects to MCP servers needed for data-backed list resolution.
|
|
35
|
-
* Only connects to servers hinted by list definitions with requiresMcp: true.
|
|
36
|
-
* Returns a map keyed by server name for the resolver.
|
|
37
|
-
*/
|
|
38
|
-
export declare function connectMcpServersForLists(definitions: ListDefinition[], mcpServers: Record<string, MCPServerConfig>): Promise<Map<string, McpServerConnection>>;
|
|
39
|
-
export declare function disconnectMcpServers(connections: Map<string, McpServerConnection>): Promise<void>;
|
|
9
|
+
export { resolveRulePaths, mergeReplacements } from './pipeline-shared.js';
|
|
40
10
|
export declare function main(): Promise<void>;
|