@discovery-tree/runner 0.1.17 → 0.1.19

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 (3) hide show
  1. package/README.md +29 -2
  2. package/dist/cli.js +3233 -391
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -89,6 +89,7 @@ readable only by you (mode 0600) because it holds the runner token. `login` writ
89
89
  | Option | Default | Meaning |
90
90
  | ------------------------------ | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
91
91
  | `maxSessions` | `2` | Sessions with a running Claude Code at once (1 to 64). Further starts are refused as busy and retried by the server. `--max-sessions` overrides it. |
92
+ | `maxJobs` | `2` | [Jobs](#jobs) run at once (1 to 16), apart from sessions. `--max-jobs` overrides it. |
92
93
  | `reposDir` | `$XDG_DATA_HOME/discovery-tree/runner/repos` | Clone cache. `--repos-dir` overrides it. |
93
94
  | `worktreesDir` | `$XDG_DATA_HOME/discovery-tree/runner/worktrees` | One worktree per session. |
94
95
  | `permissionMode` | `auto` | Claude Code `--permission-mode`. See below. |
@@ -318,6 +319,29 @@ fetches anything denied (`Bash`, `Edit`, `MultiEdit`, `Write`, `NotebookEdit`, `
318
319
  `WebSearch`, `Task`). Only the answer goes back to Discovery Tree. Requires dt-runner 0.1.9
319
320
  or later.
320
321
 
322
+ ## Jobs
323
+
324
+ A job is a command you approved in Discovery Tree (a dashboard, a dev server, a paper-trading
325
+ bot) that the runner keeps running outside every agent session, for as long as it runs: it
326
+ takes no session slot, the idle stop never touches it, and closing the session that asked for
327
+ it leaves it running (the session's worktree stays until the job ends, then goes). At most
328
+ `maxJobs` run at once. See `docs/features/RUNNER_JOBS.md` in the repository.
329
+
330
+ - **Where it runs.** In the directory you approved, with the tree's environment over the
331
+ runner's own (secrets in memory only, redacted from what is posted; never the runner's
332
+ token). On macOS and Linux the command runs in `/bin/sh`, in a process group of its own; on
333
+ Windows in Windows PowerShell (`powershell.exe`).
334
+ - **Its log.** Everything it writes is in `<state>/jobs/<job id>/stdout.log` and `stderr.log`
335
+ (`dt-runner status` prints the state folder), kept after it ends. The runner posts the lines
336
+ to Discovery Tree, which keeps the newest 2,000.
337
+ - **Stopping it.** Stop it in Discovery Tree: the runner asks it to end (SIGTERM to its group;
338
+ `taskkill /T` on Windows) and kills what is left of it 10 seconds later.
339
+ - **The runner stopping.** Jobs keep running when the runner stops or restarts; the next
340
+ `dt-runner start` takes up the ones still running and reports how the others ended. A job
341
+ that had secrets is no longer posted after a restart (the runner no longer holds them to
342
+ redact them); its log on disk goes on. A job whose process vanished without a word (the
343
+ computer restarted) is shown as lost.
344
+
321
345
  ## Repositories, worktrees and branches
322
346
 
323
347
  For a session on `https://github.com/owner/repo`:
@@ -430,8 +454,11 @@ used by the integration tests.
430
454
  workflow (`.github/workflows/publish-runner.yml`), never from a laptop.
431
455
 
432
456
  1. Bump `version` in `packages/runner/package.json` in a pull request and merge it to `main`.
433
- 2. Actions → **Publish dt-runner** → **Run workflow** on `main`. It refuses a version that is
434
- already on npm, runs lint, typecheck, tests and the build, then publishes publicly.
457
+ 2. Publish: merge an update to `packages/runner/publish-request.txt` on `main` (sets the
458
+ version line to match `package.json`), which dispatches **Publish dt-runner**; or run
459
+ Actions → **Publish dt-runner** → **Run workflow** on `main` by hand. The workflow refuses a
460
+ version that is already on npm, runs lint, typecheck, tests and the build, then publishes
461
+ publicly.
435
462
 
436
463
  The workflow runs in the `npm-publish` environment; add required reviewers there to gate
437
464
  releases.