@eloxiv/daemon 0.0.0-stage → 0.1.1

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 (119) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -2
  3. package/dist/Acp.d.ts +8 -0
  4. package/dist/Acp.d.ts.map +1 -0
  5. package/dist/Acp.js +268 -0
  6. package/dist/Acp.js.map +1 -0
  7. package/dist/Canonical.d.ts +3 -0
  8. package/dist/Canonical.d.ts.map +1 -0
  9. package/dist/Canonical.js +12 -0
  10. package/dist/Canonical.js.map +1 -0
  11. package/dist/Client.d.ts +102 -0
  12. package/dist/Client.d.ts.map +1 -0
  13. package/dist/Client.js +482 -0
  14. package/dist/Client.js.map +1 -0
  15. package/dist/Commands.d.ts +85 -0
  16. package/dist/Commands.d.ts.map +1 -0
  17. package/dist/Commands.js +370 -0
  18. package/dist/Commands.js.map +1 -0
  19. package/dist/Config.d.ts +74 -0
  20. package/dist/Config.d.ts.map +1 -0
  21. package/dist/Config.js +126 -0
  22. package/dist/Config.js.map +1 -0
  23. package/dist/Daemon.d.ts +243 -0
  24. package/dist/Daemon.d.ts.map +1 -0
  25. package/dist/Daemon.js +965 -0
  26. package/dist/Daemon.js.map +1 -0
  27. package/dist/Harness.d.ts +133 -0
  28. package/dist/Harness.d.ts.map +1 -0
  29. package/dist/Harness.js +734 -0
  30. package/dist/Harness.js.map +1 -0
  31. package/dist/Http.d.ts +15 -0
  32. package/dist/Http.d.ts.map +1 -0
  33. package/dist/Http.js +548 -0
  34. package/dist/Http.js.map +1 -0
  35. package/dist/KernelLink.d.ts +145 -0
  36. package/dist/KernelLink.d.ts.map +1 -0
  37. package/dist/KernelLink.js +109 -0
  38. package/dist/KernelLink.js.map +1 -0
  39. package/dist/LocalAuth.d.ts +99 -0
  40. package/dist/LocalAuth.d.ts.map +1 -0
  41. package/dist/LocalAuth.js +225 -0
  42. package/dist/LocalAuth.js.map +1 -0
  43. package/dist/Main.d.ts +51 -0
  44. package/dist/Main.d.ts.map +1 -0
  45. package/dist/Main.js +219 -0
  46. package/dist/Main.js.map +1 -0
  47. package/dist/PersonSession.d.ts +49 -0
  48. package/dist/PersonSession.d.ts.map +1 -0
  49. package/dist/PersonSession.js +173 -0
  50. package/dist/PersonSession.js.map +1 -0
  51. package/dist/Secrets.d.ts +21 -0
  52. package/dist/Secrets.d.ts.map +1 -0
  53. package/dist/Secrets.js +204 -0
  54. package/dist/Secrets.js.map +1 -0
  55. package/dist/SecureUrl.d.ts +11 -0
  56. package/dist/SecureUrl.d.ts.map +1 -0
  57. package/dist/SecureUrl.js +23 -0
  58. package/dist/SecureUrl.js.map +1 -0
  59. package/dist/State.d.ts +77 -0
  60. package/dist/State.d.ts.map +1 -0
  61. package/dist/State.js +38 -0
  62. package/dist/State.js.map +1 -0
  63. package/dist/Terminals.d.ts +49 -0
  64. package/dist/Terminals.d.ts.map +1 -0
  65. package/dist/Terminals.js +203 -0
  66. package/dist/Terminals.js.map +1 -0
  67. package/dist/bin-node.d.ts +2 -0
  68. package/dist/bin-node.d.ts.map +1 -0
  69. package/dist/bin-node.js +4 -0
  70. package/dist/bin-node.js.map +1 -0
  71. package/dist/bin.d.ts +2 -0
  72. package/dist/bin.d.ts.map +1 -0
  73. package/dist/bin.js +4 -0
  74. package/dist/bin.js.map +1 -0
  75. package/dist/index.d.ts +18 -0
  76. package/dist/index.d.ts.map +1 -0
  77. package/dist/index.js +18 -0
  78. package/dist/index.js.map +1 -0
  79. package/dist/runtime/bun.d.ts +11 -0
  80. package/dist/runtime/bun.d.ts.map +1 -0
  81. package/dist/runtime/bun.js +20 -0
  82. package/dist/runtime/bun.js.map +1 -0
  83. package/dist/runtime/node.d.ts +11 -0
  84. package/dist/runtime/node.d.ts.map +1 -0
  85. package/dist/runtime/node.js +21 -0
  86. package/dist/runtime/node.js.map +1 -0
  87. package/dist/testing.d.ts +25 -0
  88. package/dist/testing.d.ts.map +1 -0
  89. package/dist/testing.js +27 -0
  90. package/dist/testing.js.map +1 -0
  91. package/fixtures/claude-code-env-vars.txt +409 -0
  92. package/fixtures/fake-acp-agent.mjs +222 -0
  93. package/fixtures/fake-harness.mjs +299 -0
  94. package/fixtures/recorded/claude-code.jsonl +7 -0
  95. package/fixtures/recorded/codex.jsonl +6 -0
  96. package/package.json +64 -3
  97. package/scripts/build-sidecar.ts +86 -0
  98. package/src/Acp.ts +292 -0
  99. package/src/Canonical.ts +9 -0
  100. package/src/Client.ts +590 -0
  101. package/src/Commands.ts +427 -0
  102. package/src/Config.ts +179 -0
  103. package/src/Daemon.ts +1092 -0
  104. package/src/Harness.ts +839 -0
  105. package/src/Http.ts +563 -0
  106. package/src/KernelLink.ts +197 -0
  107. package/src/LocalAuth.ts +301 -0
  108. package/src/Main.ts +281 -0
  109. package/src/PersonSession.ts +203 -0
  110. package/src/Secrets.ts +226 -0
  111. package/src/SecureUrl.ts +21 -0
  112. package/src/State.ts +109 -0
  113. package/src/Terminals.ts +227 -0
  114. package/src/bin-node.ts +4 -0
  115. package/src/bin.ts +4 -0
  116. package/src/index.ts +17 -0
  117. package/src/runtime/bun.ts +29 -0
  118. package/src/runtime/node.ts +30 -0
  119. package/src/testing.ts +43 -0
@@ -0,0 +1,243 @@
1
+ /**
2
+ * The daemon's core, independent of the HTTP layer: the kernel pairing and the credential's custody, local
3
+ * clients, the relay's kernel sessions, local harness turns, the headless runner loop, and the sessions it
4
+ * reports (DeviceControl).
5
+ */
6
+ import type { CommandKind, DaemonStatus, DeviceAvailability, DeviceCapabilities, DeviceSession, HarnessEvent, HarnessKind, HarnessStatus, PairingStarted, PushSubscriptionInfo } from "@eloxiv/contracts";
7
+ import { LocalClientService, type ClientApp } from "./Client.ts";
8
+ import type { SyncSqliteDatabase } from "@eloxiv/client/storage";
9
+ import { CompanionQueue } from "./Commands.ts";
10
+ import { Terminals } from "./Terminals.ts";
11
+ import { type HarnessConfig, type HarnessResult } from "./Harness.ts";
12
+ import { KernelLink } from "./KernelLink.ts";
13
+ import { LocalAuth, type AuthenticatedClient, type LocalPairingOptions } from "./LocalAuth.ts";
14
+ import { type SecretStore } from "./Secrets.ts";
15
+ import { StateFile, type HarnessSessionRecord } from "./State.ts";
16
+ export interface DaemonOptions {
17
+ readonly mode: "desktop" | "headless";
18
+ readonly stateDir: string;
19
+ readonly secrets: SecretStore;
20
+ readonly hostSecret?: string | undefined;
21
+ readonly trustedOrigins: ReadonlyArray<string>;
22
+ /** Harness commands (default: `claude` and `codex` on the PATH, or the environment's overrides). */
23
+ readonly harnesses?: Partial<Record<HarnessKind, HarnessConfig>> | undefined;
24
+ /**
25
+ * The working directory turns run in when they name none; never inside the state directory. Default: a fresh,
26
+ * empty temporary directory per turn, removed when the turn ends.
27
+ */
28
+ readonly workspace?: string | undefined;
29
+ /** Where diagnostics go (default: stderr; stdout carries only the ready line). */
30
+ readonly log?: ((line: string) => void) | undefined;
31
+ /** Local pairing settings. */
32
+ readonly localPairing?: LocalPairingOptions | undefined;
33
+ /** How long a runner's long poll waits (ms, default 25 s). */
34
+ readonly pollWaitMs?: number | undefined;
35
+ /** The longest wait between retries of a turn's report (ms, default 30 s). */
36
+ readonly retryBackoffMaxMs?: number | undefined;
37
+ /** Print the ready line on stdout once listening (default true; in-process tests turn it off). */
38
+ readonly announce?: boolean | undefined;
39
+ /**
40
+ * The device command kinds this daemon serves (DeviceControl): `terminal` and `files` (in the workspace, which
41
+ * they need), `browser` and `computer` (through a companion). None by default.
42
+ */
43
+ readonly commands?: ReadonlyArray<CommandKind> | undefined;
44
+ /** The tools-only profile: turns never get workspace tools, and the terminal and files cannot be enabled. */
45
+ readonly toolsOnly?: boolean | undefined;
46
+ /**
47
+ * The app this sidecar serves LocalClient for (decision 14; `/client/v1`): its sync schema, named queries,
48
+ * mutators and module contracts. Without it, `/client/v1` answers `404 ClientNotConfigured`.
49
+ */
50
+ readonly clientApp?: ClientApp | undefined;
51
+ /** The runtime's synchronous SQLite (`bun:sqlite`, `node:sqlite`) for LocalClient's replica (default memory). */
52
+ readonly sqlite?: ((path: string) => SyncSqliteDatabase) | undefined;
53
+ /** The environment a `clientApp` reads its defaults from (default `process.env`). */
54
+ readonly env?: Readonly<Record<string, string | undefined>> | undefined;
55
+ }
56
+ /** How often a command the daemon took asks the kernel whether it was cancelled (ms). */
57
+ export declare const COMMAND_CHECK_MS = 1000;
58
+ /** The device commands one daemon runs at once. */
59
+ export declare const MAX_COMMANDS_AT_ONCE = 4;
60
+ /** Events per `appendTurnEvents` call: a larger backlog goes in several calls, in order. */
61
+ export declare const EVENT_PAGE = 200;
62
+ /** The daemon refused a kernel pairing it was asked for. */
63
+ export declare class PairingRefused extends Error {
64
+ readonly name = "PairingRefused";
65
+ readonly tag: "AlreadyPaired" | "InvalidInput";
66
+ constructor(tag: "AlreadyPaired" | "InvalidInput", message: string);
67
+ }
68
+ /**
69
+ * A kernel the daemon may pair with: `https`, or `http` only on loopback (a local kernel). A plain-http kernel
70
+ * elsewhere would see the device credential in clear.
71
+ */
72
+ export declare const checkKernelUrl: (raw: string) => string;
73
+ /**
74
+ * Where turns that name no directory work: one fresh directory each, under a root per state directory, outside
75
+ * it; the root is emptied when a daemon starts, so a killed process leaves nothing behind for long.
76
+ */
77
+ export declare const turnRootFor: (stateDir: string) => string;
78
+ /**
79
+ * Where resumable turns that name no directory keep theirs: one per kept harness session, outside the state
80
+ * directory, removed when the session is forgotten (never emptied at start-up: a follow-up needs it).
81
+ */
82
+ export declare const sessionRootFor: (stateDir: string) => string;
83
+ /** How many harness sessions the daemon keeps for follow-ups; the least recently used beyond it are forgotten. */
84
+ export declare const MAX_HARNESS_SESSIONS = 50;
85
+ /** The file `eloxiv-daemon approve-client` reads the daemon's control secret from (0600). */
86
+ export declare const controlSecretPath: (stateDir: string) => string;
87
+ export declare class Daemon {
88
+ #private;
89
+ readonly state: StateFile;
90
+ readonly auth: LocalAuth;
91
+ readonly log: (line: string) => void;
92
+ readonly harnesses: Record<HarnessKind, HarnessConfig>;
93
+ /** Browser and computer commands waiting for their companion. */
94
+ readonly companions: CompanionQueue;
95
+ /** Terminal sessions of local clients (`POST /terminals`). */
96
+ readonly terminals: Terminals;
97
+ /** LocalClient (`/client/v1`), when the sidecar was composed with a `clientApp`. */
98
+ readonly client: LocalClientService | undefined;
99
+ readonly options: DaemonOptions;
100
+ constructor(options: DaemonOptions);
101
+ get port(): number;
102
+ set port(port: number);
103
+ private credential;
104
+ /** Is the daemon paired with a kernel that (as far as it knows) still accepts it? */
105
+ get paired(): boolean;
106
+ /** The kernel as this device, or undefined when unpaired or revoked. */
107
+ kernel(): KernelLink | undefined;
108
+ /** The kernel refused the credential: forget it, and say so. */
109
+ markRevoked(reason: string): Promise<void>;
110
+ /**
111
+ * Run `body` against the kernel. A refused credential is checked once more (`GET /kernel/device/me`): only
112
+ * when the kernel refuses the device itself is it marked revoked and the credential deleted.
113
+ */
114
+ withKernel<A>(body: (kernel: KernelLink) => Promise<A>): Promise<A>;
115
+ private confirmRevocation;
116
+ /** Is the daemon started with this command kind (`--allow-commands`)? */
117
+ commandEnabled(kind: CommandKind): boolean;
118
+ /** Each command kind's availability now: enabled, and for a browser or the computer, a companion connected. */
119
+ availability(): DeviceAvailability;
120
+ /** The command kinds the daemon can serve now. */
121
+ availableKinds(): ReadonlyArray<CommandKind>;
122
+ capabilities(): Promise<DeviceCapabilities>;
123
+ /** Tell the kernel what the device offers now, if that changed since the last report. */
124
+ reportCapabilities(): Promise<void>;
125
+ /** A companion connected or went away: report what the device offers, and its sessions. */
126
+ private capabilitiesChanged;
127
+ /**
128
+ * Start pairing with the kernel at `url`: the kernel's user code is in the returned status (and the log). The
129
+ * daemon polls in the background and stores the credential once a signed-in person confirms the code.
130
+ */
131
+ startKernelPairing(raw: string, request: {
132
+ name?: string | undefined;
133
+ kind: "desktop" | "runner";
134
+ }): Promise<{
135
+ started: PairingStarted;
136
+ url: string;
137
+ done: Promise<void>;
138
+ }>;
139
+ private pollUntilPaired;
140
+ /** Forget the kernel pairing (the device stays listed on the kernel until someone revokes it there). */
141
+ unpair(): Promise<void>;
142
+ /** The harness sessions resumable turns kept, newest last. */
143
+ get harnessSessions(): ReadonlyArray<HarnessSessionRecord>;
144
+ /** Forget the kept sessions `which` selects, removing the directories the daemon created for them. */
145
+ private forgetSessions;
146
+ /** Keep `record` (replacing the session it continues), and forget the least recently used beyond the limit. */
147
+ private keepSession;
148
+ harnessStatus(refresh?: boolean): Promise<ReadonlyArray<HarnessStatus>>;
149
+ status(): Promise<DaemonStatus>;
150
+ get pairingError(): string | undefined;
151
+ /**
152
+ * The kernel credential a relayed call uses: a harness's turn session (agent-originated), a short-lived agent
153
+ * session for a local client's MCP use, or the device credential (the person) for a local client's action
154
+ * calls. Never returned to the client.
155
+ */
156
+ relayToken(client: AuthenticatedClient, purpose: "action" | "mcp"): Promise<string | undefined>;
157
+ /**
158
+ * The idempotency key a runner turn's tool call gets: the turn, the tool, its input and how many identical
159
+ * calls came before it in this attempt. A re-run attempt making the same calls replays them instead of acting
160
+ * again; a different call is a new key.
161
+ */
162
+ idempotencyKey(client: AuthenticatedClient, tool: string, input: unknown): string | undefined;
163
+ /**
164
+ * Before the relay forwards a call of a runner turn's harness: whether the turn was cancelled (or its lease
165
+ * lost). The runner otherwise hears of a cancellation only at its next heartbeat, and the harness could act in
166
+ * between; this asks the kernel now (a heartbeat), and a cancelled turn's harness is stopped before the call is
167
+ * refused. Not a runner turn (a local client's): false.
168
+ */
169
+ turnStopped(client: AuthenticatedClient): Promise<boolean>;
170
+ /**
171
+ * Run one harness turn on this machine with the Eloxiv tools through the relay, as the device's subject's
172
+ * agent (an agent session bound to this device). `scope` makes tool calls idempotent per turn (runner turns).
173
+ */
174
+ runTurn(input: {
175
+ readonly turnId: string;
176
+ readonly harness: HarnessKind;
177
+ readonly prompt: string;
178
+ readonly cwd: string | null;
179
+ readonly model: string | null;
180
+ readonly timeoutMs: number;
181
+ readonly idempotencyScope?: string | undefined;
182
+ /** A turn the kernel queued (a runner turn): its relay session carries the authority of whoever queued it. */
183
+ readonly kernelTurn?: boolean | undefined;
184
+ /** The Eloxiv actions the turn may call (undefined or null: every action the person's policy allows). */
185
+ readonly actions?: ReadonlyArray<string> | null | undefined;
186
+ readonly workspaceTools?: boolean | undefined;
187
+ /** Keep the harness session (and its working directory) for a follow-up. */
188
+ readonly resumable?: boolean | undefined;
189
+ /** Resume a session a resumable turn kept here (a follow-up); any other fails the turn without running. */
190
+ readonly resume?: string | null | undefined;
191
+ readonly signal?: AbortSignal | undefined;
192
+ readonly onEvent?: ((event: HarnessEvent) => void) | undefined;
193
+ readonly onRawLine?: ((line: string) => void) | undefined;
194
+ }): Promise<HarnessResult>;
195
+ /** Serve turns addressed to this device until stopped or revoked. */
196
+ startRunner(): {
197
+ stop: () => void;
198
+ done: Promise<void>;
199
+ };
200
+ private runnerLoop;
201
+ private serveTurn;
202
+ /**
203
+ * Report a turn's outcome until the kernel takes it: the result is kept in the state file first, so a restart
204
+ * reports it too, and it is retried (with backoff, without a cap on attempts) until the kernel settles the
205
+ * turn, says this attempt lost its lease, or refuses the device. Only those clear it.
206
+ */
207
+ private complete;
208
+ stopRunner(): Promise<void>;
209
+ /** Serve device commands (when the daemon is paired and enabled for some kind) until stopped or revoked. */
210
+ startCommands(): void;
211
+ stopCommands(): Promise<void>;
212
+ /** Stop everything that serves the kernel (the runner and the command loop). */
213
+ stop(): Promise<void>;
214
+ /** Open a terminal for a local client, in the workspace (or a directory in it). Only with the terminal enabled. */
215
+ openTerminal(owner: string, input: {
216
+ readonly cwd?: string | undefined;
217
+ readonly cols: number;
218
+ readonly rows: number;
219
+ }): {
220
+ id: `${string}-${string}-${string}-${string}-${string}`;
221
+ pty: boolean;
222
+ };
223
+ private commandLoop;
224
+ /** Run one command (here, or through its companion) and report it once, before its deadline. */
225
+ private serveCommand;
226
+ /** Register (or with null remove) the push subscription of the host beside this daemon. */
227
+ registerPush(subscription: PushSubscriptionInfo | null): Promise<{
228
+ registered: boolean;
229
+ }>;
230
+ sessions(): ReadonlyArray<DeviceSession>;
231
+ /**
232
+ * Report the sessions, one report at a time, each read when it is sent: two reports in flight at once (a client
233
+ * paired, then its companion connected) could commit at the kernel in the other order and leave the older state
234
+ * standing, with nothing to report again.
235
+ */
236
+ reportSessions(): Promise<void>;
237
+ onLocalClientPaired(client: {
238
+ clientId: string;
239
+ name: string;
240
+ kind: "shell" | "browser-extension" | "cli" | "computer-use" | "desktop-app";
241
+ }): void;
242
+ }
243
+ //# sourceMappingURL=Daemon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Daemon.d.ts","sourceRoot":"","sources":["../src/Daemon.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAEV,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACb,cAAc,EACd,oBAAoB,EACrB,MAAM,mBAAmB,CAAA;AAO1B,OAAO,EAAE,kBAAkB,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,cAAc,EAA8D,MAAM,eAAe,CAAA;AAC1G,OAAO,EAA+B,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAEvE,OAAO,EAA6C,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAA;AAChH,OAAO,EAA8B,UAAU,EAA6B,MAAM,iBAAiB,CAAA;AACnG,OAAO,EAAE,SAAS,EAAE,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAC9F,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAE9D,OAAO,EAAa,SAAS,EAAE,KAAK,oBAAoB,EAA0B,MAAM,YAAY,CAAA;AAEpG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAAA;IACrC,QA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