@cotal-ai/herdr 0.0.0 → 0.19.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.
@@ -0,0 +1,230 @@
1
+ import { mkdtempSync, rmSync, statSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { tmpdir } from "node:os";
4
+ import { hardenPrivate, registry, writeSecretFile, } from "@cotal-ai/core";
5
+ import * as herdr from "./driver.js";
6
+ const GRACE_MS = 2_000;
7
+ const CONFIRM_INTERVAL_MS = 1_000;
8
+ const MAX_CONFIRMS = 5;
9
+ function launcherSource(payload) {
10
+ return `import { spawn } from "node:child_process";\n` +
11
+ `import { rmSync } from "node:fs";\n` +
12
+ `const launch = ${JSON.stringify(payload)};\n` +
13
+ `try { rmSync(new URL(".", import.meta.url), { recursive: true, force: true }); } catch {}\n` +
14
+ `process.chdir(launch.cwd);\n` +
15
+ `const child = spawn(launch.command, launch.args, { env: launch.env, stdio: "inherit", windowsHide: false });\n` +
16
+ `let exiting = false;\n` +
17
+ `const forward = (signal) => { if (!exiting && child.pid) child.kill(signal); };\n` +
18
+ `process.on("SIGINT", () => forward("SIGINT"));\n` +
19
+ `process.on("SIGTERM", () => forward("SIGTERM"));\n` +
20
+ `child.on("error", (err) => { console.error("[cotal-herdr-launch] " + launch.command + ": " + err.message); process.exit(127); });\n` +
21
+ `child.on("exit", (code, signal) => { exiting = true; if (signal) process.exit(128); process.exit(code ?? 0); });\n`;
22
+ }
23
+ /** The connector-declared env (identity, creds, control token) must never appear on herdr's
24
+ * command line or in the server's pane records, so it rides an owner-only (0o600) launcher
25
+ * script in a private temp dir; herdr only ever sees `node <script>`. The script removes its
26
+ * own directory as soon as it has loaded. */
27
+ export function privateLauncher(spec, cwd) {
28
+ // Prefix is specifically `cotal-herdr-launch-`, not `cotal-herdr-`: the smoke counts launcher
29
+ // dirs to prove failed spawns clean up after themselves, and a shorter prefix would also match
30
+ // the driver's own `cotal-herdr-srv-` scratch, making that count wider than the claim it tests.
31
+ const dir = mkdtempSync(join(tmpdir(), "cotal-herdr-launch-"));
32
+ hardenPrivate(dir, "dir");
33
+ const script = join(dir, "launch.mjs");
34
+ writeSecretFile(script, launcherSource({ cwd, command: spec.command, args: spec.args, env: spec.env ?? {} }));
35
+ return { argv: [process.execPath, script], dir, script };
36
+ }
37
+ /** How spawned agents are laid out in the session: `tab` (default) gives each agent its own
38
+ * name-labeled tab; `split` shares one tab, splitting it per agent.
39
+ * Selected per manager process via COTAL_HERDR_LAYOUT; an unknown value fails loud. */
40
+ function layoutFromEnv() {
41
+ const raw = process.env.COTAL_HERDR_LAYOUT ?? "tab";
42
+ if (raw === "tab" || raw === "split")
43
+ return raw;
44
+ throw new Error(`herdr runtime: unknown COTAL_HERDR_LAYOUT ${JSON.stringify(raw)} (expected "tab" or "split")`);
45
+ }
46
+ function isDirectory(path) {
47
+ try {
48
+ return statSync(path).isDirectory();
49
+ }
50
+ catch {
51
+ return false;
52
+ }
53
+ }
54
+ function cleanupLauncher(launcher) {
55
+ try {
56
+ rmSync(launcher.dir, { recursive: true, force: true });
57
+ }
58
+ catch {
59
+ /* the launcher also removes itself after loading */
60
+ }
61
+ }
62
+ /**
63
+ * Spawns each managed agent into a pane of a DEDICATED named herdr session (`cotal-<space>`,
64
+ * from the manager) with its own server and socket — never the operator's default session, so
65
+ * no Cotal operation can inspect or kill unrelated panes. Panes are owned by the herdr server,
66
+ * so agents survive the manager's terminal going away; watch them with
67
+ * `herdr session attach <session>`. Lifecycle is keyed off the globally-unique `terminal_id`;
68
+ * the workspace-scoped public `pane_id` is re-resolved before every pane-scoped call (a pane
69
+ * move changes it) and never trusted from cache.
70
+ */
71
+ export class HerdrRuntime {
72
+ session;
73
+ kind = "herdr";
74
+ constructor(session) {
75
+ this.session = session;
76
+ }
77
+ spawn(name, spec, cwd) {
78
+ if (!/^[A-Za-z0-9_.-]+$/.test(name))
79
+ throw new Error(`herdr runtime: unsafe agent name ${JSON.stringify(name)} (allowed: letters, digits, _ . -)`);
80
+ if (!herdr.available()) {
81
+ const found = herdr.versionText();
82
+ throw new Error(`herdr runtime: no usable herdr on PATH - needs >= ${herdr.MIN_HERDR.join(".")}` +
83
+ (found ? ` (found "${found}")` : " (herdr not installed or not on PATH)"));
84
+ }
85
+ // herdr silently substitutes $HOME for a bad --cwd; validate here so a bad workspace
86
+ // fails loud at spawn instead of the agent starting somewhere else entirely (a non-directory
87
+ // would otherwise die later, invisibly, at the launcher's chdir).
88
+ if (!isDirectory(cwd))
89
+ throw new Error(`herdr runtime: cwd ${JSON.stringify(cwd)} is not a directory`);
90
+ const layout = layoutFromEnv(); // before any side effects, so a bad value spawns nothing
91
+ herdr.ensureServer(this.session);
92
+ // `split` shares a tab, so the tab set has to be sampled BEFORE this agent adds its own.
93
+ const tabsBefore = layout === "split" ? herdr.tabIds(this.session) : [];
94
+ const launcher = privateLauncher(spec, cwd);
95
+ let agent;
96
+ let startedTerminalId;
97
+ try {
98
+ // agentStart lands the agent in its own workspace + name-labeled tab, so the default
99
+ // layout needs no move at all.
100
+ agent = herdr.agentStart(this.session, name, cwd, launcher.argv);
101
+ startedTerminalId = agent.terminalId;
102
+ // `split`: fold this agent into a pre-existing tab. With none (the first agent) there is
103
+ // nothing to share and it stays where it is — that is the layout's meaning, not a fallback.
104
+ // The move changes the public pane id — keep the returned, terminal-pinned record.
105
+ if (layout === "split" && tabsBefore.length > 0)
106
+ agent = herdr.paneMoveIntoTab(this.session, agent.paneId, tabsBefore[0], startedTerminalId);
107
+ // Cosmetic but part of the spawn contract: fail loud, and don't leave the started pane behind.
108
+ herdr.reportMetadata(this.session, agent.paneId, "cotal", { cotal: this.session });
109
+ }
110
+ catch (err) {
111
+ if (startedTerminalId) {
112
+ // A move may have already changed the public pane id when the failure hit — never
113
+ // close whichever pane record happened to assign; re-resolve off the stable terminal.
114
+ try {
115
+ const current = herdr.agentInfo(this.session, startedTerminalId);
116
+ if (current)
117
+ herdr.closePane(this.session, current.paneId);
118
+ }
119
+ catch {
120
+ /* best-effort teardown of the half-spawned pane */
121
+ }
122
+ }
123
+ cleanupLauncher(launcher);
124
+ throw err;
125
+ }
126
+ const { terminalId } = agent;
127
+ const session = this.session;
128
+ /** The CURRENT pane id for this terminal — resolved fresh for every pane-scoped op, never
129
+ * the (possibly stale) id from spawn time. Gone terminal → HerdrCliError(pane_not_found). */
130
+ const currentPane = () => {
131
+ const info = herdr.agentInfo(session, terminalId);
132
+ if (!info)
133
+ throw new herdr.HerdrCliError("pane_not_found", `terminal ${terminalId} is gone`);
134
+ return info.paneId;
135
+ };
136
+ if (spec.confirm) {
137
+ for (let i = 1; i <= MAX_CONFIRMS; i++) {
138
+ setTimeout(() => {
139
+ try {
140
+ herdr.sendKeys(session, currentPane(), "enter");
141
+ }
142
+ catch {
143
+ /* pane may already be gone */
144
+ }
145
+ }, i * CONFIRM_INTERVAL_MS);
146
+ }
147
+ }
148
+ return {
149
+ name,
150
+ kind: "herdr",
151
+ // terminalState throws on any failed inventory (fail closed); for the status probe that
152
+ // uncertainty must read as "running" — preserving, like tmux — never as a false exit.
153
+ status: () => {
154
+ try {
155
+ return herdr.terminalState(session, terminalId);
156
+ }
157
+ catch {
158
+ return "running";
159
+ }
160
+ },
161
+ stop: (opts) => {
162
+ if (opts?.graceful === false) {
163
+ try {
164
+ herdr.closePane(session, currentPane());
165
+ }
166
+ catch (err) {
167
+ if (!(err instanceof herdr.HerdrCliError && err.code === "pane_not_found"))
168
+ throw err;
169
+ }
170
+ finally {
171
+ cleanupLauncher(launcher);
172
+ }
173
+ return;
174
+ }
175
+ // Graceful: type `/exit` so the agent session shuts down cleanly (its lifecycle hook
176
+ // leaves the mesh), then close the now-idle pane regardless. Both calls are pane-scoped,
177
+ // so resolve the pane ONCE — re-resolving between them would let the id move underneath.
178
+ try {
179
+ const pane = currentPane();
180
+ herdr.sendText(session, pane, "/exit");
181
+ herdr.sendKeys(session, pane, "enter");
182
+ }
183
+ catch {
184
+ /* terminal already gone — still ensure the pane closes below */
185
+ }
186
+ // Deferred: a throw here would be uncaught in a timer and crash the manager — guard it.
187
+ setTimeout(() => {
188
+ try {
189
+ herdr.closePane(session, currentPane());
190
+ }
191
+ catch (err) {
192
+ if (err instanceof herdr.HerdrCliError && err.code === "pane_not_found")
193
+ return;
194
+ console.error(`herdr runtime: failed to close pane for "${name}":`, err);
195
+ }
196
+ finally {
197
+ cleanupLauncher(launcher);
198
+ }
199
+ }, GRACE_MS);
200
+ },
201
+ waitForExit: () => herdr.waitForTerminalExit(session, terminalId),
202
+ interrupt: () => {
203
+ try {
204
+ herdr.sendKeys(session, currentPane(), "ctrl+c");
205
+ }
206
+ catch (err) {
207
+ if (err instanceof herdr.HerdrCliError && err.code === "pane_not_found")
208
+ return;
209
+ throw err;
210
+ }
211
+ },
212
+ attach: () => {
213
+ // NOT `agent attach`: herdr reserves its agent registry for recognized kinds, and a pane
214
+ // started by this runtime never joins it — that command would report the agent as missing.
215
+ throw new Error(`herdr runtime: attach natively - \`herdr session attach ${session}\`, ` +
216
+ `then select the "${name}" tab (terminal ${terminalId})`);
217
+ },
218
+ };
219
+ }
220
+ }
221
+ /** Self-registering runtime provider — `import "@cotal-ai/herdr"` makes the manager's `herdr`
222
+ * runtime available without the manager depending on this package. */
223
+ export const herdrRuntimeProvider = {
224
+ kind: "runtime",
225
+ name: "herdr",
226
+ available: () => herdr.available(),
227
+ create: (opts) => new HerdrRuntime(opts.session),
228
+ };
229
+ registry.register(herdrRuntimeProvider);
230
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EACL,aAAa,EACb,QAAQ,EACR,eAAe,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1
  {
2
2
  "name": "@cotal-ai/herdr",
3
- "version": "0.0.0",
4
- "description": "Placeholder for the Cotal Herdr runtime integration. Reserves the name so GitHub Actions trusted publishing (OIDC) can be configured; the real package publishes from the Cotal repo.",
3
+ "description": "Cotal Herdr integration: a Herdr Runtime provider for spawning agents into panes of a dedicated Herdr session.",
4
+ "version": "0.19.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/Cotal-AI/Cotal.git",
9
9
  "directory": "extensions/herdr"
10
10
  },
11
- "homepage": "https://github.com/Cotal-AI/Cotal/tree/main/extensions/herdr",
12
- "keywords": ["cotal", "herdr", "agents", "runtime", "placeholder"],
13
- "publishConfig": { "access": "public" },
14
- "files": ["README.md"]
15
- }
11
+ "type": "module",
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ }
19
+ },
20
+ "peerDependencies": {
21
+ "@cotal-ai/core": "*"
22
+ },
23
+ "devDependencies": {
24
+ "tsx": "^4.22.4",
25
+ "@cotal-ai/core": "0.19.0"
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "scripts": {
34
+ "typecheck": "tsc -p tsconfig.json --noEmit",
35
+ "build": "tsc -p tsconfig.json"
36
+ }
37
+ }