zooid 0.6.1 → 0.7.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 (81) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +36 -444
  3. package/dist/bin.js +1891 -0
  4. package/dist/bin.js.map +1 -0
  5. package/dist/chunk-SUPTPSN3.js +31434 -0
  6. package/dist/chunk-SUPTPSN3.js.map +1 -0
  7. package/dist/index.d.ts +64 -0
  8. package/dist/index.js +4 -3790
  9. package/dist/index.js.map +1 -0
  10. package/dist/web/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
  11. package/dist/web/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
  12. package/dist/web/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
  13. package/dist/web/assets/index-C2MAIew3.css +1 -0
  14. package/dist/web/assets/index-CqfWXqvO.js +118066 -0
  15. package/dist/web/assets/index-Cz5fEZBc.js +295 -0
  16. package/dist/web/assets/reaction-picker-emoji-cME0vOsX.js +716 -0
  17. package/dist/web/favicon.svg +1 -0
  18. package/dist/web/index.html +14 -0
  19. package/package.json +43 -22
  20. package/src/bin.ts +115 -0
  21. package/src/bootstrap/admin.test.ts +69 -0
  22. package/src/bootstrap/admin.ts +37 -0
  23. package/src/bootstrap/configs.test.ts +24 -0
  24. package/src/bootstrap/configs.ts +64 -0
  25. package/src/bootstrap/data-layout.test.ts +25 -0
  26. package/src/bootstrap/data-layout.ts +20 -0
  27. package/src/bootstrap/derive.test.ts +74 -0
  28. package/src/bootstrap/derive.ts +40 -0
  29. package/src/bootstrap/paths.test.ts +22 -0
  30. package/src/bootstrap/paths.ts +27 -0
  31. package/src/bootstrap/tokens.test.ts +44 -0
  32. package/src/bootstrap/tokens.ts +43 -0
  33. package/src/build-registry.context.test.ts +61 -0
  34. package/src/build-registry.test.ts +59 -0
  35. package/src/build-registry.ts +343 -0
  36. package/src/build-registry.zod043.test.ts +64 -0
  37. package/src/build-registry.zod044.test.ts +261 -0
  38. package/src/commands/dev-cascade.test.ts +38 -0
  39. package/src/commands/dev-cascade.ts +35 -0
  40. package/src/commands/dev-data-layout.test.ts +55 -0
  41. package/src/commands/dev.ts +316 -0
  42. package/src/commands/init/generators.test.ts +97 -0
  43. package/src/commands/init/generators.ts +124 -0
  44. package/src/commands/init/prompts.ts +123 -0
  45. package/src/commands/init/registry.test.ts +33 -0
  46. package/src/commands/init/registry.ts +75 -0
  47. package/src/commands/init/sniff.test.ts +41 -0
  48. package/src/commands/init/sniff.ts +30 -0
  49. package/src/commands/init.test.ts +131 -0
  50. package/src/commands/init.ts +158 -0
  51. package/src/commands/logs.test.ts +105 -0
  52. package/src/commands/logs.ts +108 -0
  53. package/src/commands/start.ts +28 -0
  54. package/src/commands/status.test.ts +73 -0
  55. package/src/commands/status.ts +105 -0
  56. package/src/daemon/start-daemon.test.ts +67 -0
  57. package/src/daemon/start-daemon.ts +270 -0
  58. package/src/index.ts +2 -0
  59. package/src/observability/capture-agent.ts +58 -0
  60. package/src/observability/capture-tuwunel.test.ts +57 -0
  61. package/src/observability/capture-tuwunel.ts +24 -0
  62. package/src/observability/file-sink.test.ts +68 -0
  63. package/src/observability/file-sink.ts +78 -0
  64. package/src/observability/observability.integration.test.ts +162 -0
  65. package/src/observability/paths.test.ts +104 -0
  66. package/src/observability/paths.ts +94 -0
  67. package/src/prepull-images.test.ts +149 -0
  68. package/src/prepull-images.ts +100 -0
  69. package/src/services/tuwunel.test.ts +64 -0
  70. package/src/services/tuwunel.ts +91 -0
  71. package/src/web/resolve.test.ts +50 -0
  72. package/src/web/resolve.ts +31 -0
  73. package/src/web/static.test.ts +51 -0
  74. package/src/web/static.ts +61 -0
  75. package/src/web/watch.ts +103 -0
  76. package/dist/chunk-67ZRMVHO.js +0 -174
  77. package/dist/chunk-AR456MHY.js +0 -29
  78. package/dist/chunk-VBGU2NST.js +0 -139
  79. package/dist/client-4VMFEFDX.js +0 -22
  80. package/dist/config-2KK5GX42.js +0 -27
  81. package/dist/template-T5IB4YWC.js +0 -92
@@ -0,0 +1,64 @@
1
+ import { AcpRuntime, ApprovalCorrelator, TapEvent, ZooidConfig, AcpAgentRegistry } from '@zooid/core';
2
+ import { SpawnRegistry } from '@zooid/context-mcp';
3
+
4
+ interface BuildAcpRegistryOptions {
5
+ /** Override the runtime selection (tests). */
6
+ runtime?: AcpRuntime;
7
+ /** When set, the registry's approval handler routes through this correlator. */
8
+ approvals?: ApprovalCorrelator;
9
+ /** Observability tap forwarded to each AcpClient. */
10
+ onTap?: (agentName: string, event: TapEvent) => void;
11
+ /**
12
+ * Per-agent state root (`<dataRoot>/agents/`). When set, each AcpClient
13
+ * persists its `(threadId → sessionId)` map under
14
+ * `<agentsDir>/<agentName>/sessions.json` so threads survive daemon restarts.
15
+ */
16
+ agentsDir?: string;
17
+ /**
18
+ * Per-spawn binding store for the zooid-context MCP server. When set
19
+ * together with `daemonSockPath`, agents bound to a transport that owns
20
+ * conversation context get a `contextSpawn` factory threaded into their
21
+ * AcpClient so `session/new mcpServers` includes the zooid-context entry.
22
+ */
23
+ contextSpawnRegistry?: SpawnRegistry;
24
+ /** Path to the daemon's context Unix socket. Passed to the MCP server bin. */
25
+ daemonSockPath?: string;
26
+ /**
27
+ * Directory containing zooid.yaml. Required when any agent uses the
28
+ * workspace auto-mount (the default under `runtime: docker | podman`):
29
+ * relative `agent.workdir` paths are resolved against this dir.
30
+ */
31
+ configDir?: string;
32
+ /**
33
+ * Daemon data root. Each agent's preset mounts target
34
+ * `<dataDir>/agents/<agentName>` on the host.
35
+ */
36
+ dataDir?: string;
37
+ /**
38
+ * Daemon user's `$HOME`. Sourced by the v1 preset `home` / `data` /
39
+ * `config` mounts. Tests inject a stub; production threads
40
+ * `process.env.HOME` from `start-daemon`.
41
+ */
42
+ daemonHome?: string;
43
+ /**
44
+ * Sink for the per-agent "resolved image + mounts" startup log lines.
45
+ * Defaults to `console.log`. Tests pass a capture array.
46
+ */
47
+ log?: (line: string) => void;
48
+ }
49
+ /**
50
+ * Build an `AcpAgentRegistry` from a parsed workforce config.
51
+ *
52
+ * - `runtime: local` → `LocalAcpRuntime`
53
+ * - `runtime: docker` → `DockerAcpRuntime` (engine: docker)
54
+ * - `runtime: podman` → `DockerAcpRuntime` (engine: podman)
55
+ *
56
+ * Compose layers (docker/podman only): workspace auto-mount → preset-declared
57
+ * canonical-id mounts (filtered by `container.disable_mounts`) → user mounts.
58
+ * Image resolution: agent.container.image > workforce container.image >
59
+ * preset.image. Under `runtime: docker | podman`, throws at startup if any
60
+ * agent has no resolvable image.
61
+ */
62
+ declare function buildAcpRegistry(cfg: ZooidConfig, opts?: BuildAcpRegistryOptions): AcpAgentRegistry;
63
+
64
+ export { type BuildAcpRegistryOptions, buildAcpRegistry };