@cogitator-ai/bridge 0.0.0-stage → 0.3.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.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +330 -2
  3. package/dist/adapter.d.ts +123 -0
  4. package/dist/adapter.d.ts.map +1 -0
  5. package/dist/adapter.js +2 -0
  6. package/dist/adapter.js.map +1 -0
  7. package/dist/adapters/claude.d.ts +90 -0
  8. package/dist/adapters/claude.d.ts.map +1 -0
  9. package/dist/adapters/claude.js +359 -0
  10. package/dist/adapters/claude.js.map +1 -0
  11. package/dist/adapters/codex.d.ts +58 -0
  12. package/dist/adapters/codex.d.ts.map +1 -0
  13. package/dist/adapters/codex.js +330 -0
  14. package/dist/adapters/codex.js.map +1 -0
  15. package/dist/adapters/exec.d.ts +57 -0
  16. package/dist/adapters/exec.d.ts.map +1 -0
  17. package/dist/adapters/exec.js +149 -0
  18. package/dist/adapters/exec.js.map +1 -0
  19. package/dist/adapters/hosted.d.ts +168 -0
  20. package/dist/adapters/hosted.d.ts.map +1 -0
  21. package/dist/adapters/hosted.js +361 -0
  22. package/dist/adapters/hosted.js.map +1 -0
  23. package/dist/client.d.ts +81 -0
  24. package/dist/client.d.ts.map +1 -0
  25. package/dist/client.js +216 -0
  26. package/dist/client.js.map +1 -0
  27. package/dist/dispatcher.d.ts +296 -0
  28. package/dist/dispatcher.d.ts.map +1 -0
  29. package/dist/dispatcher.js +1524 -0
  30. package/dist/dispatcher.js.map +1 -0
  31. package/dist/errors.d.ts +10 -0
  32. package/dist/errors.d.ts.map +1 -0
  33. package/dist/errors.js +16 -0
  34. package/dist/errors.js.map +1 -0
  35. package/dist/guards.d.ts +36 -0
  36. package/dist/guards.d.ts.map +1 -0
  37. package/dist/guards.js +85 -0
  38. package/dist/guards.js.map +1 -0
  39. package/dist/host.d.ts +49 -0
  40. package/dist/host.d.ts.map +1 -0
  41. package/dist/host.js +150 -0
  42. package/dist/host.js.map +1 -0
  43. package/dist/index.d.ts +50 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +32 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/inputs.d.ts +184 -0
  48. package/dist/inputs.d.ts.map +1 -0
  49. package/dist/inputs.js +116 -0
  50. package/dist/inputs.js.map +1 -0
  51. package/dist/job-record.d.ts +47 -0
  52. package/dist/job-record.d.ts.map +1 -0
  53. package/dist/job-record.js +65 -0
  54. package/dist/job-record.js.map +1 -0
  55. package/dist/letters.d.ts +49 -0
  56. package/dist/letters.d.ts.map +1 -0
  57. package/dist/letters.js +96 -0
  58. package/dist/letters.js.map +1 -0
  59. package/dist/paths.d.ts +38 -0
  60. package/dist/paths.d.ts.map +1 -0
  61. package/dist/paths.js +149 -0
  62. package/dist/paths.js.map +1 -0
  63. package/dist/protocol.d.ts +83 -0
  64. package/dist/protocol.d.ts.map +1 -0
  65. package/dist/protocol.js +71 -0
  66. package/dist/protocol.js.map +1 -0
  67. package/dist/registry.d.ts +62 -0
  68. package/dist/registry.d.ts.map +1 -0
  69. package/dist/registry.js +185 -0
  70. package/dist/registry.js.map +1 -0
  71. package/dist/server.d.ts +31 -0
  72. package/dist/server.d.ts.map +1 -0
  73. package/dist/server.js +254 -0
  74. package/dist/server.js.map +1 -0
  75. package/dist/store/sqlite.d.ts +56 -0
  76. package/dist/store/sqlite.d.ts.map +1 -0
  77. package/dist/store/sqlite.js +737 -0
  78. package/dist/store/sqlite.js.map +1 -0
  79. package/dist/store/store.d.ts +128 -0
  80. package/dist/store/store.d.ts.map +1 -0
  81. package/dist/store/store.js +2 -0
  82. package/dist/store/store.js.map +1 -0
  83. package/dist/testing/conformance.d.ts +65 -0
  84. package/dist/testing/conformance.d.ts.map +1 -0
  85. package/dist/testing/conformance.js +217 -0
  86. package/dist/testing/conformance.js.map +1 -0
  87. package/dist/testing/fake-harnesses.d.ts +101 -0
  88. package/dist/testing/fake-harnesses.d.ts.map +1 -0
  89. package/dist/testing/fake-harnesses.js +291 -0
  90. package/dist/testing/fake-harnesses.js.map +1 -0
  91. package/dist/testing/index.d.ts +5 -0
  92. package/dist/testing/index.d.ts.map +1 -0
  93. package/dist/testing/index.js +3 -0
  94. package/dist/testing/index.js.map +1 -0
  95. package/dist/types.d.ts +286 -0
  96. package/dist/types.d.ts.map +1 -0
  97. package/dist/types.js +132 -0
  98. package/dist/types.js.map +1 -0
  99. package/dist/waiter.d.ts +36 -0
  100. package/dist/waiter.d.ts.map +1 -0
  101. package/dist/waiter.js +92 -0
  102. package/dist/waiter.js.map +1 -0
  103. package/fakes/claude.mjs +450 -0
  104. package/fakes/codex.mjs +391 -0
  105. package/fakes/lib.mjs +507 -0
  106. package/package.json +76 -3
@@ -0,0 +1,291 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync, } from 'node:fs';
3
+ import { tmpdir } from 'node:os';
4
+ import { delimiter, dirname, join, resolve } from 'node:path';
5
+ import { setTimeout as sleep } from 'node:timers/promises';
6
+ import { fileURLToPath } from 'node:url';
7
+ /**
8
+ * The value a caller gave a variable on purpose: one in `base` that is not simply what the
9
+ * process running the tests has, as in `env({ ...process.env, COGITATOR_BRIDGE_HOME: mine })`.
10
+ */
11
+ function named(base, variable) {
12
+ const value = base?.[variable];
13
+ return value !== undefined && value !== process.env[variable] ? value : undefined;
14
+ }
15
+ const HARNESSES = ['claude', 'codex'];
16
+ const SURROUNDING_SESSION_VARIABLES = ['CLAUDE_CODE_SESSION_ID', 'CODEX_THREAD_ID'];
17
+ /**
18
+ * Folders code under test would otherwise look for in the home of the person running the tests:
19
+ * the bridge's own, and where Claude Code keeps its settings and the folders it trusts
20
+ */
21
+ const OWN_FOLDERS = {
22
+ COGITATOR_BRIDGE_HOME: 'bridge',
23
+ CLAUDE_CONFIG_DIR: 'claude-config',
24
+ };
25
+ const TRANSCRIPT_FOLDERS = { claude: 'sessions', codex: 'threads' };
26
+ const POLL_MS = 20;
27
+ const STOP_GRACE_MS = 5_000;
28
+ const DEFAULT_TURN_TIMEOUT_MS = 10_000;
29
+ /**
30
+ * Installs executable stand-ins of `claude` and `codex` for tests of code that drives the real
31
+ * command lines. Each call gets its own executables and its own state, `cleanup()` ends it.
32
+ */
33
+ export function installFakeHarnesses(options = {}) {
34
+ if (process.platform === 'win32') {
35
+ throw new Error('The fake claude and codex executables need a POSIX shell, win32 has none');
36
+ }
37
+ const { bin, home, created } = createFolders(options.dir);
38
+ for (const harness of HARNESSES)
39
+ writeWrapper(bin, harness);
40
+ const running = new Set();
41
+ const env = (base) => {
42
+ const merged = { ...withoutSurroundingSession(base ?? process.env), ...options.env };
43
+ return {
44
+ ...merged,
45
+ PATH: [bin, merged.PATH].filter(Boolean).join(delimiter),
46
+ FAKE_HARNESS_HOME: home,
47
+ ...Object.fromEntries(Object.entries(OWN_FOLDERS).map(([variable, folder]) => [
48
+ variable,
49
+ options.env?.[variable] ?? named(base, variable) ?? join(home, folder),
50
+ ])),
51
+ };
52
+ };
53
+ const run = (harness, args, options = {}) => execute(join(bin, harness), args, { ...options, env: { ...env(), ...options.env } }, running);
54
+ const succeed = async (harness, args, options) => {
55
+ const { code, stdout, stderr } = await run(harness, args, options);
56
+ if (code === 0)
57
+ return stdout.trim();
58
+ throw new Error(`fake ${harness} ${args.join(' ')} exited with ${code}: ${stderr.trim()}`);
59
+ };
60
+ const transcript = (harness, id) => readTranscript(join(home, harness, TRANSCRIPT_FOLDERS[harness]), id);
61
+ return {
62
+ bin,
63
+ home,
64
+ env,
65
+ run,
66
+ transcript,
67
+ trustFolder(folder) {
68
+ const file = join(home, 'claude', 'trusted.json');
69
+ const trusted = new Set([...stringsIn(readJson(file)), resolve(folder)]);
70
+ writeJson(file, [...trusted]);
71
+ },
72
+ async openClaudeWindow({ cwd, settings, name, env: extra }) {
73
+ const args = [
74
+ '__open',
75
+ ...(settings === undefined ? [] : ['--settings', settingsArgument(settings)]),
76
+ ...(name === undefined ? [] : ['--name', name]),
77
+ ];
78
+ return succeed('claude', args, { cwd, env: extra });
79
+ },
80
+ async say(sessionId, text) {
81
+ await succeed('claude', ['__say', sessionId, text]);
82
+ },
83
+ async claudeSessions({ all = false } = {}) {
84
+ const listing = await succeed('claude', ['agents', '--json', ...(all ? ['--all'] : [])]);
85
+ return JSON.parse(listing);
86
+ },
87
+ async openCodexThread({ cwd, owner = 'app' }) {
88
+ return succeed('codex', ['__open', '-C', cwd, '--owner', owner]);
89
+ },
90
+ async startCodexApp() {
91
+ await succeed('codex', ['__app', 'start']);
92
+ },
93
+ async stopCodexApp() {
94
+ await succeed('codex', ['__app', 'stop']);
95
+ },
96
+ async startCodexDaemon() {
97
+ await succeed('codex', ['app-server', 'daemon', 'start']);
98
+ },
99
+ async stopCodexDaemon() {
100
+ await succeed('codex', ['app-server', 'daemon', 'stop']);
101
+ },
102
+ async waitForTurn(harness, id, matches, waiting = {}) {
103
+ const { timeoutMs = DEFAULT_TURN_TIMEOUT_MS, what = 'a matching turn' } = waiting;
104
+ const deadline = Date.now() + timeoutMs;
105
+ for (;;) {
106
+ const turns = transcript(harness, id);
107
+ const found = turns.find(matches);
108
+ if (found)
109
+ return found;
110
+ if (Date.now() >= deadline) {
111
+ throw new Error(`Timed out after ${timeoutMs} ms waiting for ${what} of ${harness} ${id}, ` +
112
+ `turns seen: ${JSON.stringify(turns)}`);
113
+ }
114
+ await sleep(POLL_MS);
115
+ }
116
+ },
117
+ async cleanup() {
118
+ const started = [...running].map((child) => child.pid);
119
+ try {
120
+ await stopAll([...recordedPids(home), ...started].filter(isPid));
121
+ }
122
+ finally {
123
+ for (const folder of created)
124
+ rmSync(folder, { recursive: true, force: true });
125
+ }
126
+ },
127
+ };
128
+ }
129
+ /**
130
+ * The folders of one installation. The temp folder sits under `/tmp` where there is one: the
131
+ * temp folder of macOS is too deep for the unix sockets tests create next to it.
132
+ */
133
+ function createFolders(dir) {
134
+ if (dir === undefined) {
135
+ const base = existsSync('/tmp') ? '/tmp' : tmpdir();
136
+ const root = mkdtempSync(join(base, 'fake-harness-'));
137
+ return { ...createStateFolders(root), created: [root] };
138
+ }
139
+ const folders = createStateFolders(resolve(dir));
140
+ return { ...folders, created: [folders.bin, folders.home] };
141
+ }
142
+ function createStateFolders(root) {
143
+ const bin = join(root, 'bin');
144
+ const home = join(root, 'home');
145
+ mkdirSync(bin);
146
+ mkdirSync(home);
147
+ return { bin, home };
148
+ }
149
+ function shellQuote(text) {
150
+ return `'${text.replaceAll("'", `'\\''`)}'`;
151
+ }
152
+ function writeWrapper(bin, harness) {
153
+ const script = fileURLToPath(new URL(`../../fakes/${harness}.mjs`, import.meta.url));
154
+ const wrapper = join(bin, harness);
155
+ const command = `exec ${shellQuote(process.execPath)} ${shellQuote(script)} "$@"`;
156
+ writeFileSync(wrapper, `#!/bin/sh\n${command}\n`);
157
+ chmodSync(wrapper, 0o755);
158
+ }
159
+ function withoutSurroundingSession(base) {
160
+ const kept = Object.entries(base).filter(([name]) => !SURROUNDING_SESSION_VARIABLES.includes(name));
161
+ return Object.fromEntries(kept);
162
+ }
163
+ function settingsArgument(settings) {
164
+ return typeof settings === 'string' ? settings : JSON.stringify(settings);
165
+ }
166
+ function execute(file, args, options, running) {
167
+ const { cwd, env, input } = options;
168
+ return new Promise((resolveRun, rejectRun) => {
169
+ const stdin = input === undefined ? 'ignore' : 'pipe';
170
+ const child = spawn(file, args, { cwd, env, stdio: [stdin, 'pipe', 'pipe'] });
171
+ const output = { stdout: '', stderr: '' };
172
+ running.add(child);
173
+ child.stdout?.setEncoding('utf8').on('data', (chunk) => (output.stdout += chunk));
174
+ child.stderr?.setEncoding('utf8').on('data', (chunk) => (output.stderr += chunk));
175
+ child.on('error', (error) => {
176
+ running.delete(child);
177
+ rejectRun(error);
178
+ });
179
+ child.on('close', (code) => {
180
+ running.delete(child);
181
+ resolveRun({ code, ...output });
182
+ });
183
+ child.stdin?.on('error', () => undefined);
184
+ child.stdin?.end(input);
185
+ });
186
+ }
187
+ function readJson(file) {
188
+ try {
189
+ return JSON.parse(readFileSync(file, 'utf8'));
190
+ }
191
+ catch {
192
+ return undefined;
193
+ }
194
+ }
195
+ function writeJson(file, value) {
196
+ mkdirSync(dirname(file), { recursive: true });
197
+ const draft = `${file}.${process.pid}.tmp`;
198
+ writeFileSync(draft, JSON.stringify(value, null, 2));
199
+ renameSync(draft, file);
200
+ }
201
+ function stringsIn(value) {
202
+ const items = Array.isArray(value) ? value : [];
203
+ return items.filter((item) => typeof item === 'string');
204
+ }
205
+ function namesIn(folder) {
206
+ try {
207
+ return readdirSync(folder);
208
+ }
209
+ catch {
210
+ return [];
211
+ }
212
+ }
213
+ /** The transcript of the session or thread whose id is `id` or starts with it (a short id) */
214
+ function readTranscript(folder, id) {
215
+ const name = namesIn(folder).find((entry) => entry.startsWith(id) && entry.endsWith('.jsonl'));
216
+ if (name === undefined)
217
+ return [];
218
+ try {
219
+ const lines = readFileSync(join(folder, name), 'utf8').split('\n').slice(0, -1);
220
+ return lines.map((line) => JSON.parse(line));
221
+ }
222
+ catch {
223
+ return [];
224
+ }
225
+ }
226
+ function isPid(value) {
227
+ return typeof value === 'number' && Number.isInteger(value) && value > 1;
228
+ }
229
+ function pidsOf(record) {
230
+ if (typeof record !== 'object' || record === null)
231
+ return [];
232
+ const { pid, hookPids } = record;
233
+ const hooks = Array.isArray(hookPids) ? hookPids : [];
234
+ return [pid, ...hooks].filter(isPid);
235
+ }
236
+ /**
237
+ * The processes the state names: sessions, their running hooks, the daemon, the app and every
238
+ * `codex exec` in the middle of its turn
239
+ */
240
+ function recordedPids(home) {
241
+ const sessions = join(home, 'claude', 'sessions');
242
+ const threads = join(home, 'codex', 'threads');
243
+ const records = [
244
+ ...namesIn(sessions)
245
+ .filter((name) => name.endsWith('.json'))
246
+ .map((name) => join(sessions, name)),
247
+ join(home, 'codex', 'daemon.json'),
248
+ join(home, 'codex', 'app.json'),
249
+ ...namesIn(threads)
250
+ .filter((name) => name.endsWith('.pid'))
251
+ .map((name) => join(threads, name)),
252
+ ];
253
+ return records.flatMap((file) => pidsOf(readJson(file)));
254
+ }
255
+ function isAlive(pid) {
256
+ try {
257
+ process.kill(pid, 0);
258
+ return true;
259
+ }
260
+ catch (error) {
261
+ return error.code === 'EPERM';
262
+ }
263
+ }
264
+ /** Signals a process and, when it leads a process group as sessions and hooks do, its group */
265
+ function signal(pid, name) {
266
+ for (const target of [-pid, pid]) {
267
+ try {
268
+ process.kill(target, name);
269
+ }
270
+ catch { }
271
+ }
272
+ }
273
+ async function allGone(pids) {
274
+ const deadline = Date.now() + STOP_GRACE_MS;
275
+ while (pids.some(isAlive)) {
276
+ if (Date.now() >= deadline)
277
+ return false;
278
+ await sleep(POLL_MS);
279
+ }
280
+ return true;
281
+ }
282
+ async function stopAll(pids) {
283
+ for (const name of ['SIGTERM', 'SIGKILL']) {
284
+ for (const pid of pids.filter(isAlive))
285
+ signal(pid, name);
286
+ if (await allGone(pids))
287
+ return;
288
+ }
289
+ throw new Error(`Fake harness processes outlived SIGKILL: ${pids.filter(isAlive).join(', ')}`);
290
+ }
291
+ //# sourceMappingURL=fake-harnesses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fake-harnesses.js","sourceRoot":"","sources":["../../src/testing/fake-harnesses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,MAAM,EACN,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CA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AU,EAAE,CAAC;QACnD,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YAAE,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC1D,IAAI,MAAM,OAAO,CAAC,IAAI,CAAC;YAAE,OAAO;IAClC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACjG,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { adapterConformanceCases } from './conformance.js';
2
+ export type { AdapterConformanceCase, AdapterConformanceContext, AdapterConformanceTarget, AdapterFeature, AdapterScenario, } from './conformance.js';
3
+ export { installFakeHarnesses } from './fake-harnesses.js';
4
+ export type { FakeClaudeSession, FakeCommandRun, FakeHarnessOptions, FakeHarnesses, FakeTurn, } from './fake-harnesses.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,YAAY,EACV,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,EACd,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,QAAQ,GACT,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { adapterConformanceCases } from './conformance.js';
2
+ export { installFakeHarnesses } from './fake-harnesses.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAQ3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,286 @@
1
+ import { z } from 'zod';
2
+ /** Metadata key of an A2A task holding the bridge's record of the job. */
3
+ export declare const BRIDGE_JOB_KEY = "cogitator:bridge";
4
+ /** The sender of letters the bridge writes itself: reminders, and news of a job that ended. */
5
+ export declare const BRIDGE_SENDER = "bridge";
6
+ /** Harnesses the bridge knows by name. Any other string names a harness an adapter brings. */
7
+ export declare const HARNESSES: {
8
+ readonly claudeCode: "claude-code";
9
+ readonly codex: "codex";
10
+ readonly acp: "acp";
11
+ readonly cogitator: "cogitator";
12
+ };
13
+ /** What an adapter can do with the sessions of its harness. */
14
+ export interface AdapterCapabilities {
15
+ /** Starts a session of the harness for a job */
16
+ createSession: boolean;
17
+ /** Wakes an idle session with a letter, without the agent asking for its mail */
18
+ push: boolean;
19
+ /** Reaches a session in the middle of its turn */
20
+ steer: boolean;
21
+ /** The session lives in the harness's own app, where the person sees it and can step in */
22
+ nativeWindow: boolean;
23
+ }
24
+ export declare const AdapterCapabilitiesSchema: z.ZodObject<{
25
+ createSession: z.ZodBoolean;
26
+ push: z.ZodBoolean;
27
+ steer: z.ZodBoolean;
28
+ nativeWindow: z.ZodBoolean;
29
+ }, z.core.$strip>;
30
+ /** What a session without an adapter can do: it reads its mail when it asks for it. */
31
+ export declare const NO_CAPABILITIES: AdapterCapabilities;
32
+ /** How letters reach a session that has no adapter: it takes them from its inbox itself. */
33
+ export declare const INBOX_DELIVERY = "inbox";
34
+ /**
35
+ * `starting`: the bridge asked an adapter to start the session and waits for its id, `active`:
36
+ * the session is known by its id, `gone`: it is not reached any more, because it could not be
37
+ * started or has not called the bridge for `limits.agentIdleMs`. A session that is gone and calls
38
+ * again is active again, under the same name
39
+ */
40
+ export type AgentStatus = 'starting' | 'active' | 'gone';
41
+ /** A session of a harness as the bridge's address book keeps it. */
42
+ export interface AgentRecord {
43
+ /** The address other agents use, unique in the book: `codex@my-project` */
44
+ name: string;
45
+ harness: string;
46
+ /** The harness's own id of the session, empty while the session is `starting` */
47
+ sessionId: string;
48
+ /** What the person called the session, when the harness tells */
49
+ sessionName?: string;
50
+ /** The root of the project the session works in, an absolute path */
51
+ project: string;
52
+ /** The folder the session runs in, an absolute path */
53
+ cwd: string;
54
+ /** How letters reach it: the adapter's mechanism, or `inbox` when it fetches them itself */
55
+ delivery: string;
56
+ capabilities: AdapterCapabilities;
57
+ status: AgentStatus;
58
+ /** ISO 8601 */
59
+ registeredAt: string;
60
+ /** ISO 8601 time of the last call it made as an agent: a job, a letter, its inbox */
61
+ lastSeenAt: string;
62
+ }
63
+ /** Who calls the bridge, as read from the caller's environment. */
64
+ export interface CallerIdentity {
65
+ /** The harness, compared without regard to case: letters, digits, `.`, `_` and `-` */
66
+ harness: string;
67
+ sessionId: string;
68
+ /** The folder the session runs in, an absolute path */
69
+ cwd: string;
70
+ /** The project root, an absolute path, found from `cwd` when absent */
71
+ project?: string;
72
+ sessionName?: string;
73
+ /** The name the bridge gave a session it started, handed to that session in its environment */
74
+ agentName?: string;
75
+ }
76
+ /**
77
+ * The name of a harness: letters, digits, `.`, `_` and `-`, compared without regard to case and
78
+ * kept in lower case. It becomes part of agent names, so it takes nothing else.
79
+ */
80
+ export declare const HarnessNameSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
81
+ export declare const CallerIdentitySchema: z.ZodObject<{
82
+ harness: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
83
+ sessionId: z.ZodString;
84
+ cwd: z.ZodString;
85
+ project: z.ZodOptional<z.ZodString>;
86
+ sessionName: z.ZodOptional<z.ZodString>;
87
+ agentName: z.ZodOptional<z.ZodString>;
88
+ }, z.core.$strict>;
89
+ /**
90
+ * The lifecycle of a job, the states of the A2A task under it: `submitted` (handed over, not
91
+ * picked up yet), `working`, `input-required` (the one doing it asked and waits), and the
92
+ * terminal `completed`, `failed`, `canceled`
93
+ */
94
+ export type JobState = 'submitted' | 'working' | 'input-required' | 'completed' | 'failed' | 'canceled';
95
+ export declare const JOB_STATES: readonly JobState[];
96
+ /** A command that shows whether the job's result holds. */
97
+ export interface JobCheck {
98
+ name?: string;
99
+ command: string;
100
+ /** Where it runs, the job's folder by default */
101
+ cwd?: string;
102
+ timeoutMs?: number;
103
+ }
104
+ export declare const JobCheckSchema: z.ZodObject<{
105
+ name: z.ZodOptional<z.ZodString>;
106
+ command: z.ZodString;
107
+ cwd: z.ZodOptional<z.ZodString>;
108
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
109
+ }, z.core.$strip>;
110
+ /** What a job may spend before the bridge fails it. */
111
+ export interface JobBudget {
112
+ /** Letters the agents may exchange on the job */
113
+ letters: number;
114
+ /** How long the job may run, in ms from its creation */
115
+ durationMs: number;
116
+ /** How long a letter that needs an answer waits before a reminder, and after it before the job fails */
117
+ replyTimeoutMs: number;
118
+ }
119
+ export declare const JobBudgetSchema: z.ZodObject<{
120
+ letters: z.ZodNumber;
121
+ durationMs: z.ZodNumber;
122
+ replyTimeoutMs: z.ZodNumber;
123
+ }, z.core.$strip>;
124
+ /** Whether the checks of a job confirmed its result. Absent on a job nobody checked yet. */
125
+ export interface JobVerification {
126
+ verified: boolean;
127
+ /** ISO 8601 */
128
+ checkedAt: string;
129
+ /** What the checks showed, in a few lines */
130
+ summary?: string;
131
+ }
132
+ /** What the bridge keeps about a job in the metadata of its A2A task. */
133
+ export interface BridgeJobRecord {
134
+ number: number;
135
+ title: string;
136
+ /** The agent that handed the job over */
137
+ from: string;
138
+ /** The agent that carries it out */
139
+ to: string;
140
+ project: string;
141
+ cwd: string;
142
+ /** The git worktree the job is done in, when the bridge gave it one */
143
+ worktree?: string;
144
+ checks: JobCheck[];
145
+ budget: JobBudget;
146
+ lettersUsed: number;
147
+ /** 1 for a job from a person's session, one more for every job handed over from inside a job */
148
+ depth: number;
149
+ parent?: number;
150
+ /** ISO 8601 time the job was handed over */
151
+ createdAt: string;
152
+ /** ISO 8601 time the job fails at when it is still running */
153
+ deadlineAt: string;
154
+ /** Why the job failed or was canceled */
155
+ reason?: string;
156
+ verification?: JobVerification;
157
+ }
158
+ /** A job as the bridge reports it: its record and the state of the A2A task under it. */
159
+ export interface BridgeJob extends BridgeJobRecord {
160
+ taskId: string;
161
+ state: JobState;
162
+ /** ISO 8601 time of its last change of state */
163
+ updatedAt: string;
164
+ }
165
+ /**
166
+ * `task`: the job itself, `question` and `permission`: need an `answer`, `report`: the result
167
+ * that ends the job, `note`: something to know that needs no answer
168
+ */
169
+ export type LetterKind = 'task' | 'question' | 'answer' | 'report' | 'note' | 'permission';
170
+ export declare const LETTER_KINDS: readonly LetterKind[];
171
+ /**
172
+ * `queued`: the bridge has it, `delivered`: handed to the recipient's harness, `read`: the
173
+ * recipient took it, `handled`: the recipient answered it or said it is done with it. A letter
174
+ * only moves forward
175
+ */
176
+ export type DeliveryState = 'queued' | 'delivered' | 'read' | 'handled';
177
+ export declare const DELIVERY_STATES: readonly DeliveryState[];
178
+ /** How a report ends its job. */
179
+ export type ReportOutcome = 'completed' | 'failed';
180
+ export interface Letter {
181
+ id: string;
182
+ /** Its place in the order letters were accepted in */
183
+ seq: number;
184
+ job: number;
185
+ kind: LetterKind;
186
+ /** The agent that wrote it, or `bridge` */
187
+ from: string;
188
+ to: string;
189
+ body: string;
190
+ /** The letter it answers */
191
+ inReplyTo?: string;
192
+ /** Of a `report`: how it ends the job */
193
+ outcome?: ReportOutcome;
194
+ state: DeliveryState;
195
+ /** ISO 8601 */
196
+ createdAt: string;
197
+ deliveredAt?: string;
198
+ readAt?: string;
199
+ handledAt?: string;
200
+ /** How many times an adapter tried to deliver it */
201
+ attempts: number;
202
+ /** Why the last attempt failed */
203
+ lastError?: string;
204
+ /** ISO 8601 time of the next attempt, absent when none is planned */
205
+ nextAttemptAt?: string;
206
+ /** ISO 8601 time the recipient must have reacted by, absent when nothing is expected */
207
+ replyDueAt?: string;
208
+ /** ISO 8601 time the recipient was reminded of it */
209
+ remindedAt?: string;
210
+ }
211
+ /** A letter with the text its recipient sees: the signature line, then the body. */
212
+ export interface RenderedLetter extends Letter {
213
+ text: string;
214
+ }
215
+ export type JournalEntryType = 'agent.registered' | 'agent.gone' | 'job.created' | 'job.state' | 'job.verified' | 'letter.queued' | 'letter.delivered' | 'letter.read' | 'letter.handled' | 'letter.rejected' | 'letter.undelivered' | 'letter.reminded';
216
+ /** One line of the bridge's append-only journal. */
217
+ export interface JournalEntry {
218
+ seq: number;
219
+ /** ISO 8601 */
220
+ at: string;
221
+ type: JournalEntryType;
222
+ job?: number;
223
+ letter?: string;
224
+ agent?: string;
225
+ data?: Record<string, unknown>;
226
+ }
227
+ /** The limits the bridge applies to every job, each overridable per dispatcher. */
228
+ export interface BridgeLimits {
229
+ /** How deep jobs may nest: a job, a job handed over from it, and so on */
230
+ maxDepth: number;
231
+ /** The budget of a job that names none */
232
+ budget: JobBudget;
233
+ /** The most a job may ask for */
234
+ maxBudget: JobBudget;
235
+ /** How many times an adapter tries a letter before the bridge leaves it for the inbox */
236
+ deliveryAttempts: number;
237
+ /** The wait before the second attempt, doubled for each one after, in ms */
238
+ deliveryBackoffMs: number;
239
+ /** The longest wait between attempts, in ms */
240
+ deliveryBackoffMaxMs: number;
241
+ /** How long an adapter may take to hand one letter over before the attempt counts as failed, in ms */
242
+ deliveryTimeoutMs: number;
243
+ /** How long an adapter may take to start a session, in ms */
244
+ sessionStartTimeoutMs: number;
245
+ /** The longest letter body, in characters */
246
+ maxBodyLength: number;
247
+ /**
248
+ * How long a session may stay silent before the bridge takes it for gone, in ms. A session
249
+ * with a job in progress is never taken for gone
250
+ */
251
+ agentIdleMs: number;
252
+ /** How many jobs an agent may have handed over that are still in progress */
253
+ maxOpenJobs: number;
254
+ /** How many jobs an agent may hand over in an hour */
255
+ jobsPerHour: number;
256
+ /** How many sessions adapters may be starting at once */
257
+ maxStartingSessions: number;
258
+ /** How often adapters that can list their sessions are asked which of them still run */
259
+ presenceCheckMs: number;
260
+ }
261
+ export declare const BridgeLimitsSchema: z.ZodObject<{
262
+ maxDepth: z.ZodNumber;
263
+ budget: z.ZodObject<{
264
+ letters: z.ZodNumber;
265
+ durationMs: z.ZodNumber;
266
+ replyTimeoutMs: z.ZodNumber;
267
+ }, z.core.$strip>;
268
+ maxBudget: z.ZodObject<{
269
+ letters: z.ZodNumber;
270
+ durationMs: z.ZodNumber;
271
+ replyTimeoutMs: z.ZodNumber;
272
+ }, z.core.$strip>;
273
+ deliveryAttempts: z.ZodNumber;
274
+ deliveryBackoffMs: z.ZodNumber;
275
+ deliveryBackoffMaxMs: z.ZodNumber;
276
+ deliveryTimeoutMs: z.ZodNumber;
277
+ sessionStartTimeoutMs: z.ZodNumber;
278
+ maxBodyLength: z.ZodNumber;
279
+ agentIdleMs: z.ZodNumber;
280
+ maxOpenJobs: z.ZodNumber;
281
+ jobsPerHour: z.ZodNumber;
282
+ maxStartingSessions: z.ZodNumber;
283
+ presenceCheckMs: z.ZodNumber;
284
+ }, z.core.$strict>;
285
+ export declare const DEFAULT_LIMITS: BridgeLimits;
286
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0EAA0E;AAC1E,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD,+FAA+F;AAC/F,eAAO,MAAM,aAAa,WAAW,CAAC;AAEtC,8FAA8F;AAC9F,eAAO,MAAM,SAAS;;;;;CAKZ,CAAC;AAEX,+DAA+D;AAC/D,MAAM,WAAW,mBAAmB;IAClC,gDAAgD;IAChD,aAAa,EAAE,OAAO,CAAC;IACvB,iFAAiF;IACjF,IAAI,EAAE,OAAO,CAAC;IACd,kDAAkD;IAClD,KAAK,EAAE,OAAO,CAAC;IACf,2FAA2F;IAC3F,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,yBA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