@a5c-ai/agent-runtime 5.0.1-staging.016f0b0e8119
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 +23 -0
- package/dist/apiResult.d.ts +19 -0
- package/dist/apiResult.d.ts.map +1 -0
- package/dist/apiResult.js +16 -0
- package/dist/background/state.d.ts +14 -0
- package/dist/background/state.d.ts.map +1 -0
- package/dist/background/state.js +25 -0
- package/dist/backgroundProcessRegistry.d.ts +66 -0
- package/dist/backgroundProcessRegistry.d.ts.map +1 -0
- package/dist/backgroundProcessRegistry.js +202 -0
- package/dist/cost/claudeCodeParser.d.ts +81 -0
- package/dist/cost/claudeCodeParser.d.ts.map +1 -0
- package/dist/cost/claudeCodeParser.js +232 -0
- package/dist/cost/collector.d.ts +42 -0
- package/dist/cost/collector.d.ts.map +1 -0
- package/dist/cost/collector.js +105 -0
- package/dist/cost/effectCost.d.ts +23 -0
- package/dist/cost/effectCost.d.ts.map +1 -0
- package/dist/cost/effectCost.js +26 -0
- package/dist/cost/index.d.ts +19 -0
- package/dist/cost/index.d.ts.map +1 -0
- package/dist/cost/index.js +39 -0
- package/dist/cost/journal.d.ts +40 -0
- package/dist/cost/journal.d.ts.map +1 -0
- package/dist/cost/journal.js +137 -0
- package/dist/cost/types.d.ts +164 -0
- package/dist/cost/types.d.ts.map +1 -0
- package/dist/cost/types.js +228 -0
- package/dist/daemon/automationExecutor.d.ts +16 -0
- package/dist/daemon/automationExecutor.d.ts.map +1 -0
- package/dist/daemon/automationExecutor.js +222 -0
- package/dist/daemon/config.d.ts +8 -0
- package/dist/daemon/config.d.ts.map +1 -0
- package/dist/daemon/config.js +209 -0
- package/dist/daemon/daemonLog.d.ts +13 -0
- package/dist/daemon/daemonLog.d.ts.map +1 -0
- package/dist/daemon/daemonLog.js +64 -0
- package/dist/daemon/fileWatcher.d.ts +9 -0
- package/dist/daemon/fileWatcher.d.ts.map +1 -0
- package/dist/daemon/fileWatcher.js +141 -0
- package/dist/daemon/index.d.ts +13 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +22 -0
- package/dist/daemon/lifecycle.d.ts +12 -0
- package/dist/daemon/lifecycle.d.ts.map +1 -0
- package/dist/daemon/lifecycle.js +257 -0
- package/dist/daemon/loop.d.ts +21 -0
- package/dist/daemon/loop.d.ts.map +1 -0
- package/dist/daemon/loop.js +196 -0
- package/dist/daemon/timerScheduler.d.ts +13 -0
- package/dist/daemon/timerScheduler.d.ts.map +1 -0
- package/dist/daemon/timerScheduler.js +122 -0
- package/dist/daemon/types.d.ts +93 -0
- package/dist/daemon/types.d.ts.map +1 -0
- package/dist/daemon/types.js +25 -0
- package/dist/daemon/webhookListener.d.ts +6 -0
- package/dist/daemon/webhookListener.d.ts.map +1 -0
- package/dist/daemon/webhookListener.js +110 -0
- package/dist/execution/index.d.ts +8 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +12 -0
- package/dist/execution/modes/docker.d.ts +21 -0
- package/dist/execution/modes/docker.d.ts.map +1 -0
- package/dist/execution/modes/docker.js +125 -0
- package/dist/execution/modes/index.d.ts +10 -0
- package/dist/execution/modes/index.d.ts.map +1 -0
- package/dist/execution/modes/index.js +14 -0
- package/dist/execution/modes/kubernetes.d.ts +29 -0
- package/dist/execution/modes/kubernetes.d.ts.map +1 -0
- package/dist/execution/modes/kubernetes.js +121 -0
- package/dist/execution/modes/local.d.ts +23 -0
- package/dist/execution/modes/local.d.ts.map +1 -0
- package/dist/execution/modes/local.js +102 -0
- package/dist/execution/modes/ssh.d.ts +23 -0
- package/dist/execution/modes/ssh.d.ts.map +1 -0
- package/dist/execution/modes/ssh.js +134 -0
- package/dist/execution/provider.d.ts +32 -0
- package/dist/execution/provider.d.ts.map +1 -0
- package/dist/execution/provider.js +90 -0
- package/dist/execution/types.d.ts +105 -0
- package/dist/execution/types.d.ts.map +1 -0
- package/dist/execution/types.js +9 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/observability/health.d.ts +19 -0
- package/dist/observability/health.d.ts.map +1 -0
- package/dist/observability/health.js +129 -0
- package/dist/observability/index.d.ts +6 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +20 -0
- package/dist/observability/runStatus.d.ts +44 -0
- package/dist/observability/runStatus.d.ts.map +1 -0
- package/dist/observability/runStatus.js +169 -0
- package/dist/observability/timeline.d.ts +11 -0
- package/dist/observability/timeline.d.ts.map +1 -0
- package/dist/observability/timeline.js +176 -0
- package/dist/observability/types.d.ts +62 -0
- package/dist/observability/types.d.ts.map +1 -0
- package/dist/observability/types.js +8 -0
- package/dist/observability/webhooks.d.ts +68 -0
- package/dist/observability/webhooks.d.ts.map +1 -0
- package/dist/observability/webhooks.js +132 -0
- package/dist/resources/budget-tracker.d.ts +56 -0
- package/dist/resources/budget-tracker.d.ts.map +1 -0
- package/dist/resources/budget-tracker.js +131 -0
- package/dist/resources/concurrency-guard.d.ts +55 -0
- package/dist/resources/concurrency-guard.d.ts.map +1 -0
- package/dist/resources/concurrency-guard.js +132 -0
- package/dist/resources/index.d.ts +12 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +20 -0
- package/dist/resources/manager.d.ts +49 -0
- package/dist/resources/manager.d.ts.map +1 -0
- package/dist/resources/manager.js +111 -0
- package/dist/resources/timeout-cascade.d.ts +56 -0
- package/dist/resources/timeout-cascade.d.ts.map +1 -0
- package/dist/resources/timeout-cascade.js +145 -0
- package/dist/resources/types.d.ts +108 -0
- package/dist/resources/types.d.ts.map +1 -0
- package/dist/resources/types.js +9 -0
- package/dist/session/context.d.ts +22 -0
- package/dist/session/context.d.ts.map +1 -0
- package/dist/session/context.js +113 -0
- package/dist/session/continuityState.d.ts +39 -0
- package/dist/session/continuityState.d.ts.map +1 -0
- package/dist/session/continuityState.js +164 -0
- package/dist/session/cost.d.ts +63 -0
- package/dist/session/cost.d.ts.map +1 -0
- package/dist/session/cost.js +194 -0
- package/dist/session/discovery.d.ts +22 -0
- package/dist/session/discovery.d.ts.map +1 -0
- package/dist/session/discovery.js +35 -0
- package/dist/session/history.d.ts +30 -0
- package/dist/session/history.d.ts.map +1 -0
- package/dist/session/history.js +143 -0
- package/dist/session/index.d.ts +20 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +78 -0
- package/dist/session/memoryExtraction.d.ts +65 -0
- package/dist/session/memoryExtraction.d.ts.map +1 -0
- package/dist/session/memoryExtraction.js +201 -0
- package/dist/session/parse.d.ts +45 -0
- package/dist/session/parse.d.ts.map +1 -0
- package/dist/session/parse.js +170 -0
- package/dist/session/persistence.d.ts +46 -0
- package/dist/session/persistence.d.ts.map +1 -0
- package/dist/session/persistence.js +180 -0
- package/dist/session/types.d.ts +267 -0
- package/dist/session/types.d.ts.map +1 -0
- package/dist/session/types.js +45 -0
- package/dist/session/write.d.ts +61 -0
- package/dist/session/write.d.ts.map +1 -0
- package/dist/session/write.js +213 -0
- package/dist/telemetry/audit-log.d.ts +56 -0
- package/dist/telemetry/audit-log.d.ts.map +1 -0
- package/dist/telemetry/audit-log.js +59 -0
- package/dist/telemetry/index.d.ts +9 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +15 -0
- package/dist/telemetry/provider.d.ts +39 -0
- package/dist/telemetry/provider.d.ts.map +1 -0
- package/dist/telemetry/provider.js +91 -0
- package/dist/telemetry/span-tree.d.ts +46 -0
- package/dist/telemetry/span-tree.d.ts.map +1 -0
- package/dist/telemetry/span-tree.js +93 -0
- package/dist/telemetry/types.d.ts +85 -0
- package/dist/telemetry/types.d.ts.map +1 -0
- package/dist/telemetry/types.js +21 -0
- package/package.json +90 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LocalExecutor — spawns processes on the host machine via child_process.
|
|
4
|
+
*
|
|
5
|
+
* This is the fully-functional executor: it creates real child processes,
|
|
6
|
+
* tracks them by handle ID, and supports attach (reconnect to streams)
|
|
7
|
+
* and destroy (kill process) operations.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.LocalExecutor = void 0;
|
|
11
|
+
const node_child_process_1 = require("node:child_process");
|
|
12
|
+
const node_crypto_1 = require("node:crypto");
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// LocalExecutor
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
class LocalExecutor {
|
|
17
|
+
processes = new Map();
|
|
18
|
+
async spawn(command, args, config) {
|
|
19
|
+
const id = (0, node_crypto_1.randomUUID)();
|
|
20
|
+
const child = (0, node_child_process_1.spawn)(command, args, {
|
|
21
|
+
cwd: config.cwd,
|
|
22
|
+
env: config.env ? { ...process.env, ...config.env } : process.env,
|
|
23
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
24
|
+
});
|
|
25
|
+
const handle = {
|
|
26
|
+
id,
|
|
27
|
+
mode: "local",
|
|
28
|
+
status: "running",
|
|
29
|
+
};
|
|
30
|
+
const entry = { handle, process: child, config };
|
|
31
|
+
this.processes.set(id, entry);
|
|
32
|
+
// Update status when the child exits.
|
|
33
|
+
child.on("exit", (code) => {
|
|
34
|
+
handle.status = code === 0 ? "stopped" : "failed";
|
|
35
|
+
});
|
|
36
|
+
child.on("error", () => {
|
|
37
|
+
handle.status = "failed";
|
|
38
|
+
});
|
|
39
|
+
return this._toPublicHandle(entry);
|
|
40
|
+
}
|
|
41
|
+
async attach(id) {
|
|
42
|
+
const entry = this.processes.get(id);
|
|
43
|
+
if (!entry)
|
|
44
|
+
return undefined;
|
|
45
|
+
return this._toPublicHandle(entry);
|
|
46
|
+
}
|
|
47
|
+
list() {
|
|
48
|
+
return [...this.processes.values()].map((e) => this._toPublicHandle(e));
|
|
49
|
+
}
|
|
50
|
+
async destroy(id) {
|
|
51
|
+
const entry = this.processes.get(id);
|
|
52
|
+
if (!entry)
|
|
53
|
+
return;
|
|
54
|
+
const child = entry.process;
|
|
55
|
+
if (!child.killed && child.exitCode === null) {
|
|
56
|
+
child.kill("SIGTERM");
|
|
57
|
+
// Give the process a short window to exit gracefully before SIGKILL.
|
|
58
|
+
await new Promise((resolve) => {
|
|
59
|
+
const timeout = setTimeout(() => {
|
|
60
|
+
if (!child.killed && child.exitCode === null) {
|
|
61
|
+
child.kill("SIGKILL");
|
|
62
|
+
}
|
|
63
|
+
resolve();
|
|
64
|
+
}, 3_000);
|
|
65
|
+
child.on("exit", () => {
|
|
66
|
+
clearTimeout(timeout);
|
|
67
|
+
resolve();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
entry.handle.status = "stopped";
|
|
72
|
+
this.processes.delete(id);
|
|
73
|
+
}
|
|
74
|
+
// ---------- Helpers -------------------------------------------------------
|
|
75
|
+
_toPublicHandle(entry) {
|
|
76
|
+
const self = this;
|
|
77
|
+
return {
|
|
78
|
+
get id() {
|
|
79
|
+
return entry.handle.id;
|
|
80
|
+
},
|
|
81
|
+
get mode() {
|
|
82
|
+
return entry.handle.mode;
|
|
83
|
+
},
|
|
84
|
+
get status() {
|
|
85
|
+
return entry.handle.status;
|
|
86
|
+
},
|
|
87
|
+
async attach() {
|
|
88
|
+
// Re-attach to stdout/stderr by piping to the current process streams.
|
|
89
|
+
if (entry.process.stdout) {
|
|
90
|
+
entry.process.stdout.pipe(process.stdout, { end: false });
|
|
91
|
+
}
|
|
92
|
+
if (entry.process.stderr) {
|
|
93
|
+
entry.process.stderr.pipe(process.stderr, { end: false });
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
async destroy() {
|
|
97
|
+
await self.destroy(entry.handle.id);
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.LocalExecutor = LocalExecutor;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SshExecutor — constructs `ssh` commands from SshExecutionConfig and
|
|
3
|
+
* spawns them via child_process.
|
|
4
|
+
*
|
|
5
|
+
* This is a structural stub: it correctly assembles the SSH CLI invocation
|
|
6
|
+
* but the host must have an SSH client installed and the target must be
|
|
7
|
+
* reachable for it to work at runtime.
|
|
8
|
+
*/
|
|
9
|
+
import type { ExecutionHandle, SshExecutionConfig } from "../types";
|
|
10
|
+
import type { Executor } from "./local";
|
|
11
|
+
export declare class SshExecutor implements Executor<SshExecutionConfig> {
|
|
12
|
+
private readonly processes;
|
|
13
|
+
spawn(command: string, args: string[], config: SshExecutionConfig): Promise<ExecutionHandle>;
|
|
14
|
+
attach(id: string): Promise<ExecutionHandle | undefined>;
|
|
15
|
+
list(): ExecutionHandle[];
|
|
16
|
+
destroy(id: string): Promise<void>;
|
|
17
|
+
/** Build the full `ssh` argument list. */
|
|
18
|
+
_buildSshArgs(command: string, args: string[], config: SshExecutionConfig): string[];
|
|
19
|
+
/** Minimal shell escaping for remote command construction. */
|
|
20
|
+
private _shellEscape;
|
|
21
|
+
private _toPublicHandle;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ssh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssh.d.ts","sourceRoot":"","sources":["../../../src/execution/modes/ssh.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAsBxC,qBAAa,WAAY,YAAW,QAAQ,CAAC,kBAAkB,CAAC;IAC9D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiC;IAErD,KAAK,CACT,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,eAAe,CAAC;IA2BrB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAM9D,IAAI,IAAI,eAAe,EAAE;IAInB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BxC,0CAA0C;IAC1C,aAAa,CACX,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,kBAAkB,GACzB,MAAM,EAAE;IAoCX,8DAA8D;IAC9D,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,eAAe;CAyBxB"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SshExecutor — constructs `ssh` commands from SshExecutionConfig and
|
|
4
|
+
* spawns them via child_process.
|
|
5
|
+
*
|
|
6
|
+
* This is a structural stub: it correctly assembles the SSH CLI invocation
|
|
7
|
+
* but the host must have an SSH client installed and the target must be
|
|
8
|
+
* reachable for it to work at runtime.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.SshExecutor = void 0;
|
|
12
|
+
const node_child_process_1 = require("node:child_process");
|
|
13
|
+
const node_crypto_1 = require("node:crypto");
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// SshExecutor
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
class SshExecutor {
|
|
18
|
+
processes = new Map();
|
|
19
|
+
async spawn(command, args, config) {
|
|
20
|
+
const id = (0, node_crypto_1.randomUUID)();
|
|
21
|
+
const sshArgs = this._buildSshArgs(command, args, config);
|
|
22
|
+
const child = (0, node_child_process_1.spawn)("ssh", sshArgs, {
|
|
23
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
24
|
+
});
|
|
25
|
+
const handle = {
|
|
26
|
+
id,
|
|
27
|
+
mode: "ssh",
|
|
28
|
+
status: "running",
|
|
29
|
+
};
|
|
30
|
+
const entry = { handle, process: child, config };
|
|
31
|
+
this.processes.set(id, entry);
|
|
32
|
+
child.on("exit", (code) => {
|
|
33
|
+
handle.status = code === 0 ? "stopped" : "failed";
|
|
34
|
+
});
|
|
35
|
+
child.on("error", () => {
|
|
36
|
+
handle.status = "failed";
|
|
37
|
+
});
|
|
38
|
+
return this._toPublicHandle(entry);
|
|
39
|
+
}
|
|
40
|
+
async attach(id) {
|
|
41
|
+
const entry = this.processes.get(id);
|
|
42
|
+
if (!entry)
|
|
43
|
+
return undefined;
|
|
44
|
+
return this._toPublicHandle(entry);
|
|
45
|
+
}
|
|
46
|
+
list() {
|
|
47
|
+
return [...this.processes.values()].map((e) => this._toPublicHandle(e));
|
|
48
|
+
}
|
|
49
|
+
async destroy(id) {
|
|
50
|
+
const entry = this.processes.get(id);
|
|
51
|
+
if (!entry)
|
|
52
|
+
return;
|
|
53
|
+
const child = entry.process;
|
|
54
|
+
if (!child.killed && child.exitCode === null) {
|
|
55
|
+
child.kill("SIGTERM");
|
|
56
|
+
await new Promise((resolve) => {
|
|
57
|
+
const timeout = setTimeout(() => {
|
|
58
|
+
if (!child.killed && child.exitCode === null) {
|
|
59
|
+
child.kill("SIGKILL");
|
|
60
|
+
}
|
|
61
|
+
resolve();
|
|
62
|
+
}, 3_000);
|
|
63
|
+
child.on("exit", () => {
|
|
64
|
+
clearTimeout(timeout);
|
|
65
|
+
resolve();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
entry.handle.status = "stopped";
|
|
70
|
+
this.processes.delete(id);
|
|
71
|
+
}
|
|
72
|
+
// ---------- Helpers -------------------------------------------------------
|
|
73
|
+
/** Build the full `ssh` argument list. */
|
|
74
|
+
_buildSshArgs(command, args, config) {
|
|
75
|
+
const sshArgs = [];
|
|
76
|
+
// Identity file.
|
|
77
|
+
if (config.keyPath) {
|
|
78
|
+
sshArgs.push("-i", config.keyPath);
|
|
79
|
+
}
|
|
80
|
+
// Port.
|
|
81
|
+
if (config.port && config.port !== 22) {
|
|
82
|
+
sshArgs.push("-p", String(config.port));
|
|
83
|
+
}
|
|
84
|
+
// Disable strict host key checking for automated usage.
|
|
85
|
+
sshArgs.push("-o", "StrictHostKeyChecking=no");
|
|
86
|
+
sshArgs.push("-o", "BatchMode=yes");
|
|
87
|
+
// Target: user@host.
|
|
88
|
+
sshArgs.push(`${config.user}@${config.host}`);
|
|
89
|
+
// Build the remote command string.
|
|
90
|
+
// Prepend env vars if provided.
|
|
91
|
+
let remoteCommand = "";
|
|
92
|
+
if (config.env) {
|
|
93
|
+
const envPrefix = Object.entries(config.env)
|
|
94
|
+
.map(([k, v]) => `${k}=${this._shellEscape(v)}`)
|
|
95
|
+
.join(" ");
|
|
96
|
+
remoteCommand = `${envPrefix} `;
|
|
97
|
+
}
|
|
98
|
+
remoteCommand += [command, ...args].map((a) => this._shellEscape(a)).join(" ");
|
|
99
|
+
sshArgs.push("--", remoteCommand);
|
|
100
|
+
return sshArgs;
|
|
101
|
+
}
|
|
102
|
+
/** Minimal shell escaping for remote command construction. */
|
|
103
|
+
_shellEscape(s) {
|
|
104
|
+
if (/^[a-zA-Z0-9_/.:=-]+$/.test(s))
|
|
105
|
+
return s;
|
|
106
|
+
return `'${s.replace(/'/g, "'\\''")}'`;
|
|
107
|
+
}
|
|
108
|
+
_toPublicHandle(entry) {
|
|
109
|
+
const self = this;
|
|
110
|
+
return {
|
|
111
|
+
get id() {
|
|
112
|
+
return entry.handle.id;
|
|
113
|
+
},
|
|
114
|
+
get mode() {
|
|
115
|
+
return entry.handle.mode;
|
|
116
|
+
},
|
|
117
|
+
get status() {
|
|
118
|
+
return entry.handle.status;
|
|
119
|
+
},
|
|
120
|
+
async attach() {
|
|
121
|
+
if (entry.process.stdout) {
|
|
122
|
+
entry.process.stdout.pipe(process.stdout, { end: false });
|
|
123
|
+
}
|
|
124
|
+
if (entry.process.stderr) {
|
|
125
|
+
entry.process.stderr.pipe(process.stderr, { end: false });
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
async destroy() {
|
|
129
|
+
await self.destroy(entry.handle.id);
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.SshExecutor = SshExecutor;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExecutionProviderImpl — dispatches spawn/attach/list/destroy calls to
|
|
3
|
+
* mode-specific executors registered at construction time.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* const provider = new ExecutionProviderImpl(
|
|
9
|
+
* new Map([
|
|
10
|
+
* ["local", localExecutor],
|
|
11
|
+
* ["docker", dockerExecutor],
|
|
12
|
+
* ["ssh", sshExecutor],
|
|
13
|
+
* ["kubernetes", k8sExecutor],
|
|
14
|
+
* ]),
|
|
15
|
+
* );
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
import type { ExecutionConfig, ExecutionHandle, ExecutionMode, ExecutionProvider } from "./types";
|
|
19
|
+
import type { Executor } from "./modes/local";
|
|
20
|
+
export declare class ExecutionProviderImpl implements ExecutionProvider {
|
|
21
|
+
/** Registered mode executors. */
|
|
22
|
+
private readonly executors;
|
|
23
|
+
/** Global index: handleId -> mode, so attach/destroy can route correctly. */
|
|
24
|
+
private readonly handleIndex;
|
|
25
|
+
constructor(executors: Map<ExecutionMode, Executor<unknown>>);
|
|
26
|
+
spawn(config: ExecutionConfig): Promise<ExecutionHandle>;
|
|
27
|
+
attach(id: string): Promise<ExecutionHandle | undefined>;
|
|
28
|
+
list(): Promise<ExecutionHandle[]>;
|
|
29
|
+
destroy(id: string): Promise<void>;
|
|
30
|
+
private _executorFor;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/execution/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,aAAa,EACb,iBAAiB,EAClB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAM9C,qBAAa,qBAAsB,YAAW,iBAAiB;IAC7D,iCAAiC;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsC;IAChE,6EAA6E;IAC7E,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoC;gBAEpD,SAAS,EAAE,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAQtD,KAAK,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAaxD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAexD,IAAI,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IASlC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBxC,OAAO,CAAC,YAAY;CAOrB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ExecutionProviderImpl — dispatches spawn/attach/list/destroy calls to
|
|
4
|
+
* mode-specific executors registered at construction time.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* const provider = new ExecutionProviderImpl(
|
|
10
|
+
* new Map([
|
|
11
|
+
* ["local", localExecutor],
|
|
12
|
+
* ["docker", dockerExecutor],
|
|
13
|
+
* ["ssh", sshExecutor],
|
|
14
|
+
* ["kubernetes", k8sExecutor],
|
|
15
|
+
* ]),
|
|
16
|
+
* );
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.ExecutionProviderImpl = void 0;
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// ExecutionProviderImpl
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
class ExecutionProviderImpl {
|
|
25
|
+
/** Registered mode executors. */
|
|
26
|
+
executors;
|
|
27
|
+
/** Global index: handleId -> mode, so attach/destroy can route correctly. */
|
|
28
|
+
handleIndex = new Map();
|
|
29
|
+
constructor(executors) {
|
|
30
|
+
// Cast once at the boundary — internally we dispatch with the correct
|
|
31
|
+
// config type per mode so this is type-safe in practice.
|
|
32
|
+
this.executors = executors;
|
|
33
|
+
}
|
|
34
|
+
// ---------- ExecutionProvider interface ------------------------------------
|
|
35
|
+
async spawn(config) {
|
|
36
|
+
const executor = this._executorFor(config.mode);
|
|
37
|
+
// Each executor.spawn() takes (command, args, config). The provider
|
|
38
|
+
// layer doesn't know the command/args — those are part of the config
|
|
39
|
+
// at a higher level. For the provider's spawn() we pass a default
|
|
40
|
+
// shell invocation and forward the mode-specific config.
|
|
41
|
+
const handle = await executor.spawn("sh", ["-c", "true"], config);
|
|
42
|
+
this.handleIndex.set(handle.id, config.mode);
|
|
43
|
+
return handle;
|
|
44
|
+
}
|
|
45
|
+
async attach(id) {
|
|
46
|
+
const mode = this.handleIndex.get(id);
|
|
47
|
+
if (!mode) {
|
|
48
|
+
// Try all executors — the handle may predate this provider instance.
|
|
49
|
+
for (const executor of this.executors.values()) {
|
|
50
|
+
const handle = await executor.attach(id);
|
|
51
|
+
if (handle)
|
|
52
|
+
return handle;
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
const executor = this.executors.get(mode);
|
|
57
|
+
return executor?.attach(id);
|
|
58
|
+
}
|
|
59
|
+
async list() {
|
|
60
|
+
const all = [];
|
|
61
|
+
for (const executor of this.executors.values()) {
|
|
62
|
+
const handles = executor.list();
|
|
63
|
+
all.push(...handles);
|
|
64
|
+
}
|
|
65
|
+
return all;
|
|
66
|
+
}
|
|
67
|
+
async destroy(id) {
|
|
68
|
+
const mode = this.handleIndex.get(id);
|
|
69
|
+
if (!mode) {
|
|
70
|
+
// Attempt all executors — best effort.
|
|
71
|
+
for (const executor of this.executors.values()) {
|
|
72
|
+
await executor.destroy(id);
|
|
73
|
+
}
|
|
74
|
+
this.handleIndex.delete(id);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const executor = this.executors.get(mode);
|
|
78
|
+
await executor?.destroy(id);
|
|
79
|
+
this.handleIndex.delete(id);
|
|
80
|
+
}
|
|
81
|
+
// ---------- Helpers -------------------------------------------------------
|
|
82
|
+
_executorFor(mode) {
|
|
83
|
+
const executor = this.executors.get(mode);
|
|
84
|
+
if (!executor) {
|
|
85
|
+
throw new Error(`No executor registered for execution mode "${mode}"`);
|
|
86
|
+
}
|
|
87
|
+
return executor;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.ExecutionProviderImpl = ExecutionProviderImpl;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution mode abstraction for Babysitter Agent Runtime.
|
|
3
|
+
*
|
|
4
|
+
* Defines how effects and sub-agents are spawned — locally, in Docker,
|
|
5
|
+
* over SSH, or on Kubernetes. Interface-only stubs; implementations
|
|
6
|
+
* will follow in issue #217.
|
|
7
|
+
*/
|
|
8
|
+
/** Supported execution environments. */
|
|
9
|
+
export type ExecutionMode = "local" | "docker" | "ssh" | "kubernetes";
|
|
10
|
+
/** Configuration for local (host-process) execution. */
|
|
11
|
+
export interface LocalExecutionConfig {
|
|
12
|
+
readonly mode: "local";
|
|
13
|
+
/** Working directory for spawned processes. */
|
|
14
|
+
readonly cwd: string;
|
|
15
|
+
/** Optional environment variable overrides. */
|
|
16
|
+
readonly env?: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
/** Configuration for Docker-based execution. */
|
|
19
|
+
export interface DockerExecutionConfig {
|
|
20
|
+
readonly mode: "docker";
|
|
21
|
+
/** Container image reference (e.g. "node:20-slim"). */
|
|
22
|
+
readonly image: string;
|
|
23
|
+
/** Volume mounts in "host:container" format. */
|
|
24
|
+
readonly volumes?: string[];
|
|
25
|
+
/** Docker network to attach to. */
|
|
26
|
+
readonly network?: string;
|
|
27
|
+
/** Optional environment variable overrides. */
|
|
28
|
+
readonly env?: Record<string, string>;
|
|
29
|
+
}
|
|
30
|
+
/** Configuration for SSH-based remote execution. */
|
|
31
|
+
export interface SshExecutionConfig {
|
|
32
|
+
readonly mode: "ssh";
|
|
33
|
+
/** Remote hostname or IP address. */
|
|
34
|
+
readonly host: string;
|
|
35
|
+
/** SSH port; defaults to 22. */
|
|
36
|
+
readonly port?: number;
|
|
37
|
+
/** Remote user. */
|
|
38
|
+
readonly user: string;
|
|
39
|
+
/** Path to the private key file. */
|
|
40
|
+
readonly keyPath?: string;
|
|
41
|
+
/** Optional environment variable overrides. */
|
|
42
|
+
readonly env?: Record<string, string>;
|
|
43
|
+
}
|
|
44
|
+
/** Configuration for Kubernetes pod-based execution. */
|
|
45
|
+
export interface KubernetesExecutionConfig {
|
|
46
|
+
readonly mode: "kubernetes";
|
|
47
|
+
/** Kubernetes namespace. */
|
|
48
|
+
readonly namespace: string;
|
|
49
|
+
/** Container image reference. */
|
|
50
|
+
readonly image: string;
|
|
51
|
+
/** Service account to run under. */
|
|
52
|
+
readonly serviceAccount?: string;
|
|
53
|
+
/** Resource requests/limits (e.g. `{ cpu: "500m", memory: "256Mi" }`). */
|
|
54
|
+
readonly resources?: Record<string, string>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Discriminated union of all execution config types.
|
|
58
|
+
* Discriminant field is `mode`.
|
|
59
|
+
*/
|
|
60
|
+
export type ExecutionConfig = LocalExecutionConfig | DockerExecutionConfig | SshExecutionConfig | KubernetesExecutionConfig;
|
|
61
|
+
/** Handle to a running or completed execution. */
|
|
62
|
+
export interface ExecutionHandle {
|
|
63
|
+
/** Unique identifier for this execution instance. */
|
|
64
|
+
readonly id: string;
|
|
65
|
+
/** The execution mode this handle was spawned with. */
|
|
66
|
+
readonly mode: ExecutionMode;
|
|
67
|
+
/** Current lifecycle status. */
|
|
68
|
+
readonly status: "running" | "stopped" | "failed";
|
|
69
|
+
/**
|
|
70
|
+
* Attach to the execution's I/O streams (e.g. for log tailing).
|
|
71
|
+
*/
|
|
72
|
+
attach(): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Tear down the execution and release its resources.
|
|
75
|
+
*/
|
|
76
|
+
destroy(): Promise<void>;
|
|
77
|
+
}
|
|
78
|
+
/** Abstraction over an execution backend. */
|
|
79
|
+
export interface ExecutionProvider {
|
|
80
|
+
/**
|
|
81
|
+
* Spawn a new execution from the given config.
|
|
82
|
+
*
|
|
83
|
+
* @param config - Discriminated execution configuration.
|
|
84
|
+
* @returns A handle to the running execution.
|
|
85
|
+
*/
|
|
86
|
+
spawn(config: ExecutionConfig): Promise<ExecutionHandle>;
|
|
87
|
+
/**
|
|
88
|
+
* Re-attach to a previously spawned execution.
|
|
89
|
+
*
|
|
90
|
+
* @param id - Execution identifier returned by a prior `spawn`.
|
|
91
|
+
* @returns The handle, or undefined if not found.
|
|
92
|
+
*/
|
|
93
|
+
attach(id: string): Promise<ExecutionHandle | undefined>;
|
|
94
|
+
/**
|
|
95
|
+
* List all known execution handles managed by this provider.
|
|
96
|
+
*/
|
|
97
|
+
list(): Promise<ExecutionHandle[]>;
|
|
98
|
+
/**
|
|
99
|
+
* Destroy an execution by ID.
|
|
100
|
+
*
|
|
101
|
+
* @param id - Execution identifier.
|
|
102
|
+
*/
|
|
103
|
+
destroy(id: string): Promise<void>;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/execution/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Execution mode abstraction for Babysitter Agent Runtime.
|
|
4
|
+
*
|
|
5
|
+
* Defines how effects and sub-agents are spawned — locally, in Docker,
|
|
6
|
+
* over SSH, or on Kubernetes. Interface-only stubs; implementations
|
|
7
|
+
* will follow in issue #217.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { BackgroundProcessRegistry, type BackgroundTaskRecord, type BackgroundCompletionEvent, type SpawnOptions, } from "./backgroundProcessRegistry";
|
|
2
|
+
export { getBackgroundRegistry, disposeBackgroundRegistry, } from "./background/state";
|
|
3
|
+
export { ok, fail, type ApiResult } from "./apiResult";
|
|
4
|
+
export * from "./daemon";
|
|
5
|
+
export * from "./session";
|
|
6
|
+
export * from "./cost";
|
|
7
|
+
export * from "./observability";
|
|
8
|
+
export * from "./telemetry";
|
|
9
|
+
export * from "./execution";
|
|
10
|
+
export * from "./resources";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,yBAAyB,EACzB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,YAAY,GAClB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAGvD,cAAc,UAAU,CAAC;AAGzB,cAAc,WAAW,CAAC;AAG1B,cAAc,QAAQ,CAAC;AAGvB,cAAc,iBAAiB,CAAC;AAGhC,cAAc,aAAa,CAAC;AAG5B,cAAc,aAAa,CAAC;AAG5B,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// L5 Agent-Runtime layer exports
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.fail = exports.ok = exports.disposeBackgroundRegistry = exports.getBackgroundRegistry = exports.BackgroundProcessRegistry = void 0;
|
|
19
|
+
// Background process management (moved from agent-core)
|
|
20
|
+
var backgroundProcessRegistry_1 = require("./backgroundProcessRegistry");
|
|
21
|
+
Object.defineProperty(exports, "BackgroundProcessRegistry", { enumerable: true, get: function () { return backgroundProcessRegistry_1.BackgroundProcessRegistry; } });
|
|
22
|
+
var state_1 = require("./background/state");
|
|
23
|
+
Object.defineProperty(exports, "getBackgroundRegistry", { enumerable: true, get: function () { return state_1.getBackgroundRegistry; } });
|
|
24
|
+
Object.defineProperty(exports, "disposeBackgroundRegistry", { enumerable: true, get: function () { return state_1.disposeBackgroundRegistry; } });
|
|
25
|
+
// Result envelope utility (used by daemon lifecycle/config)
|
|
26
|
+
var apiResult_1 = require("./apiResult");
|
|
27
|
+
Object.defineProperty(exports, "ok", { enumerable: true, get: function () { return apiResult_1.ok; } });
|
|
28
|
+
Object.defineProperty(exports, "fail", { enumerable: true, get: function () { return apiResult_1.fail; } });
|
|
29
|
+
// Daemon management (moved from agent-platform)
|
|
30
|
+
__exportStar(require("./daemon"), exports);
|
|
31
|
+
// Session state management (moved from agent-platform)
|
|
32
|
+
__exportStar(require("./session"), exports);
|
|
33
|
+
// Cost tracking (moved from agent-platform)
|
|
34
|
+
__exportStar(require("./cost"), exports);
|
|
35
|
+
// Observability (moved from agent-platform)
|
|
36
|
+
__exportStar(require("./observability"), exports);
|
|
37
|
+
// Telemetry (L5 type stubs — issue #217)
|
|
38
|
+
__exportStar(require("./telemetry"), exports);
|
|
39
|
+
// Execution modes (L5 type stubs — issue #217)
|
|
40
|
+
__exportStar(require("./execution"), exports);
|
|
41
|
+
// Resource management (L5 type stubs — issue #217)
|
|
42
|
+
__exportStar(require("./resources"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run Health Model (GAP-STATE-008).
|
|
3
|
+
*
|
|
4
|
+
* Computes a point-in-time health snapshot from journal events.
|
|
5
|
+
* Pure function — no file I/O, takes events as input.
|
|
6
|
+
*/
|
|
7
|
+
import type { JournalEvent } from "@a5c-ai/babysitter-sdk";
|
|
8
|
+
import type { RunHealthSnapshot, HealthConfig } from "./types";
|
|
9
|
+
interface HealthOptions {
|
|
10
|
+
config?: Partial<HealthConfig>;
|
|
11
|
+
/** Override "now" for testing. */
|
|
12
|
+
now?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Compute a health snapshot from an array of journal events.
|
|
16
|
+
*/
|
|
17
|
+
export declare function computeRunHealthFromEvents(events: JournalEvent[], options?: HealthOptions): RunHealthSnapshot;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/observability/health.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EACV,iBAAiB,EAGjB,YAAY,EACb,MAAM,SAAS,CAAC;AAiBjB,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,kCAAkC;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,YAAY,EAAE,EACtB,OAAO,CAAC,EAAE,aAAa,GACtB,iBAAiB,CAiInB"}
|