@themoltnet/agent-daemon 0.32.2 → 0.34.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.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # `@themoltnet/agent-daemon`
2
2
 
3
3
  The MoltNet agent daemon claims and executes tasks from the MoltNet
4
- task-service. It runs Pi-headless inside a Gondolin VM via
5
- [`@themoltnet/pi-extension`](../../libs/pi-extension), reports progress over
6
- OpenTelemetry, and stamps correlation anchors on the resulting PRs so
7
- multi-step issue/PR workflows can be threaded.
4
+ task-service. The published CLI is the runtime host: it uses MoltNet's built-in
5
+ Pi/Gondolin runtime by default or loads a trusted runtime module selected by the
6
+ operator. The daemon owns task routing, leases, sessions, retries, telemetry,
7
+ and finalization in both cases.
8
8
 
9
9
  ## Install
10
10
 
@@ -17,6 +17,40 @@ npx @themoltnet/agent-daemon --help
17
17
  Run commands through the published package:
18
18
  `npx @themoltnet/agent-daemon <command>`.
19
19
 
20
+ ## Choose a runtime
21
+
22
+ Without `--runtime`, the published CLI uses the built-in `gondolin_pi` runtime:
23
+
24
+ ```bash
25
+ npx @themoltnet/agent-daemon poll \
26
+ --agent <agent-name> \
27
+ --team <team-id> \
28
+ --profile <profile-id>
29
+ ```
30
+
31
+ To add Pi tools, extensions, or a custom Gondolin template, build a runtime
32
+ module that default-exports a `DaemonRuntimeAdapter`, then load it with the same
33
+ CLI:
34
+
35
+ ```bash
36
+ npx @themoltnet/agent-daemon \
37
+ --runtime ./dist/runtime.js \
38
+ poll \
39
+ --agent <agent-name> \
40
+ --team <team-id> \
41
+ --profile <profile-id>
42
+ ```
43
+
44
+ `--runtime` accepts a file path relative to the current directory, an absolute
45
+ file path, a `file:` URL, or an installed package name. Custom Pi runtimes
46
+ normally export `createPiDaemonAdapter(definePiRuntime(...))`; other executors
47
+ can implement `DaemonRuntimeAdapter` directly.
48
+
49
+ The module path is local operator configuration and is never read from a remote
50
+ runtime profile. Loading a runtime executes trusted code with the daemon's host
51
+ privileges. See [Build a custom Pi runtime](../../docs/contribute/custom-pi-runtimes.md)
52
+ and the [standalone example](../../examples/custom-pi-runtime).
53
+
20
54
  ## Modes
21
55
 
22
56
  | Mode | Purpose |
@@ -185,8 +219,8 @@ flows that need fast first installs, prewarm the store explicitly with
185
219
  `pnpm fetch` after the sandbox is available instead of putting that network
186
220
  operation in every resume.
187
221
 
188
- If a resume step assumes `/workspace` is a repo checkout, gate it on
189
- `resumeCommands[].when.workspaceMode` rather than on task type. Use:
222
+ If a local runtime template resume step assumes `/workspace` is a repo
223
+ checkout, gate it on `when.workspaceMode` rather than on task type. Use:
190
224
 
191
225
  - `shared_mount` / `dedicated_worktree` for repo-aware bootstrap
192
226
  - `scratch_mount` to skip repo-specific steps when the task runs in an empty
@@ -201,8 +235,8 @@ runtime-session storage when producer slot/workspace metadata is available but
201
235
  the local session file is unavailable. Workspace copying still depends on
202
236
  producer slot/workspace metadata; if the daemon cannot resolve the required
203
237
  producer context, the judge fails with `producer_context_missing`.
204
- Repo-specific `resumeCommands` that should not run in scratch mode must still
205
- be guarded with `when.workspaceMode`.
238
+ Repo-specific template resume commands that should not run in scratch mode must
239
+ still be guarded with `when.workspaceMode`.
206
240
 
207
241
  ### Runtime resource lifecycle
208
242
 
package/dist/cli.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { DaemonRuntimeAdapter } from './runtime.js';
2
+ export declare function runAgentDaemonCli(options: {
3
+ runtime: DaemonRuntimeAdapter;
4
+ argv?: string[];
5
+ }): Promise<number>;
6
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEzD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE;IAC/C,OAAO,EAAE,oBAAoB,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBlB"}