@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.
- package/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/Acp.d.ts +8 -0
- package/dist/Acp.d.ts.map +1 -0
- package/dist/Acp.js +268 -0
- package/dist/Acp.js.map +1 -0
- package/dist/Canonical.d.ts +3 -0
- package/dist/Canonical.d.ts.map +1 -0
- package/dist/Canonical.js +12 -0
- package/dist/Canonical.js.map +1 -0
- package/dist/Client.d.ts +102 -0
- package/dist/Client.d.ts.map +1 -0
- package/dist/Client.js +482 -0
- package/dist/Client.js.map +1 -0
- package/dist/Commands.d.ts +85 -0
- package/dist/Commands.d.ts.map +1 -0
- package/dist/Commands.js +370 -0
- package/dist/Commands.js.map +1 -0
- package/dist/Config.d.ts +74 -0
- package/dist/Config.d.ts.map +1 -0
- package/dist/Config.js +126 -0
- package/dist/Config.js.map +1 -0
- package/dist/Daemon.d.ts +243 -0
- package/dist/Daemon.d.ts.map +1 -0
- package/dist/Daemon.js +965 -0
- package/dist/Daemon.js.map +1 -0
- package/dist/Harness.d.ts +133 -0
- package/dist/Harness.d.ts.map +1 -0
- package/dist/Harness.js +734 -0
- package/dist/Harness.js.map +1 -0
- package/dist/Http.d.ts +15 -0
- package/dist/Http.d.ts.map +1 -0
- package/dist/Http.js +548 -0
- package/dist/Http.js.map +1 -0
- package/dist/KernelLink.d.ts +145 -0
- package/dist/KernelLink.d.ts.map +1 -0
- package/dist/KernelLink.js +109 -0
- package/dist/KernelLink.js.map +1 -0
- package/dist/LocalAuth.d.ts +99 -0
- package/dist/LocalAuth.d.ts.map +1 -0
- package/dist/LocalAuth.js +225 -0
- package/dist/LocalAuth.js.map +1 -0
- package/dist/Main.d.ts +51 -0
- package/dist/Main.d.ts.map +1 -0
- package/dist/Main.js +219 -0
- package/dist/Main.js.map +1 -0
- package/dist/PersonSession.d.ts +49 -0
- package/dist/PersonSession.d.ts.map +1 -0
- package/dist/PersonSession.js +173 -0
- package/dist/PersonSession.js.map +1 -0
- package/dist/Secrets.d.ts +21 -0
- package/dist/Secrets.d.ts.map +1 -0
- package/dist/Secrets.js +204 -0
- package/dist/Secrets.js.map +1 -0
- package/dist/SecureUrl.d.ts +11 -0
- package/dist/SecureUrl.d.ts.map +1 -0
- package/dist/SecureUrl.js +23 -0
- package/dist/SecureUrl.js.map +1 -0
- package/dist/State.d.ts +77 -0
- package/dist/State.d.ts.map +1 -0
- package/dist/State.js +38 -0
- package/dist/State.js.map +1 -0
- package/dist/Terminals.d.ts +49 -0
- package/dist/Terminals.d.ts.map +1 -0
- package/dist/Terminals.js +203 -0
- package/dist/Terminals.js.map +1 -0
- package/dist/bin-node.d.ts +2 -0
- package/dist/bin-node.d.ts.map +1 -0
- package/dist/bin-node.js +4 -0
- package/dist/bin-node.js.map +1 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +4 -0
- package/dist/bin.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/bun.d.ts +11 -0
- package/dist/runtime/bun.d.ts.map +1 -0
- package/dist/runtime/bun.js +20 -0
- package/dist/runtime/bun.js.map +1 -0
- package/dist/runtime/node.d.ts +11 -0
- package/dist/runtime/node.d.ts.map +1 -0
- package/dist/runtime/node.js +21 -0
- package/dist/runtime/node.js.map +1 -0
- package/dist/testing.d.ts +25 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +27 -0
- package/dist/testing.js.map +1 -0
- package/fixtures/claude-code-env-vars.txt +409 -0
- package/fixtures/fake-acp-agent.mjs +222 -0
- package/fixtures/fake-harness.mjs +299 -0
- package/fixtures/recorded/claude-code.jsonl +7 -0
- package/fixtures/recorded/codex.jsonl +6 -0
- package/package.json +64 -3
- package/scripts/build-sidecar.ts +86 -0
- package/src/Acp.ts +292 -0
- package/src/Canonical.ts +9 -0
- package/src/Client.ts +590 -0
- package/src/Commands.ts +427 -0
- package/src/Config.ts +179 -0
- package/src/Daemon.ts +1092 -0
- package/src/Harness.ts +839 -0
- package/src/Http.ts +563 -0
- package/src/KernelLink.ts +197 -0
- package/src/LocalAuth.ts +301 -0
- package/src/Main.ts +281 -0
- package/src/PersonSession.ts +203 -0
- package/src/Secrets.ts +226 -0
- package/src/SecureUrl.ts +21 -0
- package/src/State.ts +109 -0
- package/src/Terminals.ts +227 -0
- package/src/bin-node.ts +4 -0
- package/src/bin.ts +4 -0
- package/src/index.ts +17 -0
- package/src/runtime/bun.ts +29 -0
- package/src/runtime/node.ts +30 -0
- package/src/testing.ts +43 -0
package/src/testing.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For tests and conformance kits: the fake harness binary, which speaks Claude Code's and Codex's stream
|
|
3
|
+
* formats (recorded from real runs, `fixtures/recorded/`) and calls tools through the daemon's MCP relay, so no
|
|
4
|
+
* subscription is needed.
|
|
5
|
+
*/
|
|
6
|
+
import type { HarnessKind } from "@eloxiv/contracts"
|
|
7
|
+
import { fileURLToPath } from "node:url"
|
|
8
|
+
import type { Daemon } from "./Daemon.ts"
|
|
9
|
+
import type { HarnessConfig } from "./Harness.ts"
|
|
10
|
+
|
|
11
|
+
/** The daemon's server layer on `port` (0: any free port) for this runtime (Bun or Node). */
|
|
12
|
+
export const serverLayerFor = async (port: number, daemon: Daemon) => {
|
|
13
|
+
const runtime =
|
|
14
|
+
typeof process.versions["bun"] === "string" ? await import("./runtime/bun.ts") : await import("./runtime/node.ts")
|
|
15
|
+
return runtime.serverLayer({ port }, daemon)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** `fixtures/fake-harness.mjs`, resolved from both `src` and `dist`. */
|
|
19
|
+
export const fakeHarnessPath = fileURLToPath(new URL("../fixtures/fake-harness.mjs", import.meta.url))
|
|
20
|
+
|
|
21
|
+
/** `fixtures/fake-acp-agent.mjs`: an Agent Client Protocol agent that runs the same prompt scripts. */
|
|
22
|
+
export const fakeAcpAgentPath = fileURLToPath(new URL("../fixtures/fake-acp-agent.mjs", import.meta.url))
|
|
23
|
+
|
|
24
|
+
/** The recorded real outputs (`claude-code.jsonl`, `codex.jsonl`). */
|
|
25
|
+
export const recordedStreamPath = (kind: HarnessKind) =>
|
|
26
|
+
fileURLToPath(new URL(`../fixtures/recorded/${kind}.jsonl`, import.meta.url))
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Harness configs that run the fake harness on this runtime (Bun or Node) for every kind: the CLIs' streams for
|
|
30
|
+
* Claude Code and Codex, the fake ACP agent for OpenCode (not tools-only, as OpenCode is not) and for a configured ACP
|
|
31
|
+
* agent the person declared tools-only.
|
|
32
|
+
*/
|
|
33
|
+
export const fakeHarnesses = (): Record<HarnessKind, HarnessConfig> => ({
|
|
34
|
+
"claude-code": { kind: "claude-code", command: [process.execPath, fakeHarnessPath] },
|
|
35
|
+
codex: { kind: "codex", command: [process.execPath, fakeHarnessPath] },
|
|
36
|
+
opencode: { kind: "opencode", command: [process.execPath, fakeAcpAgentPath], protocol: "acp", toolsOnly: false },
|
|
37
|
+
acp: { kind: "acp", command: [process.execPath, fakeAcpAgentPath], protocol: "acp", toolsOnly: true },
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
/** This runtime's synchronous SQLite opener (`bun:sqlite` or `node:sqlite`), for a daemon serving LocalClient. */
|
|
41
|
+
export const runtimeSqlite = async () =>
|
|
42
|
+
(typeof process.versions["bun"] === "string" ? await import("./runtime/bun.ts") : await import("./runtime/node.ts"))
|
|
43
|
+
.openSqlite
|