@namzu/cli 29.1.0 → 32.0.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/CHANGELOG.md +296 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +5 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/acp.d.ts +20 -2
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/acp.js +42 -5
- package/dist/commands/acp.js.map +1 -1
- package/dist/commands/drain.d.ts.map +1 -1
- package/dist/commands/drain.js +2 -1
- package/dist/commands/drain.js.map +1 -1
- package/dist/commands/exec-json.d.ts.map +1 -1
- package/dist/commands/exec-json.js +24 -1
- package/dist/commands/exec-json.js.map +1 -1
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/exec.js +5 -1
- package/dist/commands/exec.js.map +1 -1
- package/dist/commands/prior-messages.d.ts.map +1 -1
- package/dist/commands/prior-messages.js +42 -2
- package/dist/commands/prior-messages.js.map +1 -1
- package/dist/commands/schedule.d.ts.map +1 -1
- package/dist/commands/schedule.js +7 -5
- package/dist/commands/schedule.js.map +1 -1
- package/dist/config/composer-triggers.d.ts +41 -0
- package/dist/config/composer-triggers.d.ts.map +1 -0
- package/dist/config/composer-triggers.js +80 -0
- package/dist/config/composer-triggers.js.map +1 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +58 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/schema.d.ts +34 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/context/doctrine.d.ts +3 -3
- package/dist/context/doctrine.d.ts.map +1 -1
- package/dist/context/doctrine.js +3 -3
- package/dist/context/doctrine.js.map +1 -1
- package/dist/context/environment.d.ts +26 -3
- package/dist/context/environment.d.ts.map +1 -1
- package/dist/context/environment.js +68 -9
- package/dist/context/environment.js.map +1 -1
- package/dist/context/runtime-message.d.ts.map +1 -1
- package/dist/context/runtime-message.js +4 -0
- package/dist/context/runtime-message.js.map +1 -1
- package/dist/integrations/mcp/servers.d.ts +72 -5
- package/dist/integrations/mcp/servers.d.ts.map +1 -1
- package/dist/integrations/mcp/servers.js +144 -23
- package/dist/integrations/mcp/servers.js.map +1 -1
- package/dist/integrations/notifications/desktop.d.ts +2 -0
- package/dist/integrations/notifications/desktop.d.ts.map +1 -1
- package/dist/integrations/notifications/desktop.js +6 -5
- package/dist/integrations/notifications/desktop.js.map +1 -1
- package/dist/integrations/plugins/runtime.d.ts +10 -2
- package/dist/integrations/plugins/runtime.d.ts.map +1 -1
- package/dist/integrations/plugins/runtime.js +16 -29
- package/dist/integrations/plugins/runtime.js.map +1 -1
- package/dist/integrations/providers/harness-credentials.d.ts +9 -4
- package/dist/integrations/providers/harness-credentials.d.ts.map +1 -1
- package/dist/integrations/providers/harness-credentials.js +16 -8
- package/dist/integrations/providers/harness-credentials.js.map +1 -1
- package/dist/integrations/resident/session-step.d.ts.map +1 -1
- package/dist/integrations/resident/session-step.js +2 -1
- package/dist/integrations/resident/session-step.js.map +1 -1
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/sessions/store.js +20 -2
- package/dist/integrations/sessions/store.js.map +1 -1
- package/dist/integrations/subagents/NamzuCliAgent.d.ts +8 -0
- package/dist/integrations/subagents/NamzuCliAgent.d.ts.map +1 -0
- package/dist/integrations/subagents/NamzuCliAgent.js +9 -0
- package/dist/integrations/subagents/NamzuCliAgent.js.map +1 -0
- package/dist/integrations/subagents/runtime.d.ts +5 -4
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.js +46 -11
- package/dist/integrations/subagents/runtime.js.map +1 -1
- package/dist/integrations/web/open-url.d.ts +24 -0
- package/dist/integrations/web/open-url.d.ts.map +1 -0
- package/dist/integrations/web/open-url.js +73 -0
- package/dist/integrations/web/open-url.js.map +1 -0
- package/dist/integrations/web/search.d.ts.map +1 -1
- package/dist/integrations/web/search.js +8 -6
- package/dist/integrations/web/search.js.map +1 -1
- package/dist/permissions/rules.d.ts +5 -1
- package/dist/permissions/rules.d.ts.map +1 -1
- package/dist/permissions/rules.js +85 -3
- package/dist/permissions/rules.js.map +1 -1
- package/dist/schedule/build.d.ts +26 -2
- package/dist/schedule/build.d.ts.map +1 -1
- package/dist/schedule/build.js +139 -20
- package/dist/schedule/build.js.map +1 -1
- package/dist/schedule/changes.d.ts +6 -0
- package/dist/schedule/changes.d.ts.map +1 -1
- package/dist/schedule/changes.js +23 -0
- package/dist/schedule/changes.js.map +1 -1
- package/dist/schedule/commands/add.d.ts +1 -1
- package/dist/schedule/commands/add.d.ts.map +1 -1
- package/dist/schedule/commands/add.js +188 -54
- package/dist/schedule/commands/add.js.map +1 -1
- package/dist/schedule/commands/lifecycle.d.ts.map +1 -1
- package/dist/schedule/commands/lifecycle.js +2 -1
- package/dist/schedule/commands/lifecycle.js.map +1 -1
- package/dist/schedule/commands/list.d.ts +2 -0
- package/dist/schedule/commands/list.d.ts.map +1 -1
- package/dist/schedule/commands/list.js +69 -20
- package/dist/schedule/commands/list.js.map +1 -1
- package/dist/schedule/daemon/daemon.d.ts +1 -1
- package/dist/schedule/daemon/daemon.d.ts.map +1 -1
- package/dist/schedule/daemon/daemon.js +22 -5
- package/dist/schedule/daemon/daemon.js.map +1 -1
- package/dist/schedule/daemon/notify.d.ts +29 -2
- package/dist/schedule/daemon/notify.d.ts.map +1 -1
- package/dist/schedule/daemon/notify.js +71 -2
- package/dist/schedule/daemon/notify.js.map +1 -1
- package/dist/schedule/env.d.ts +8 -4
- package/dist/schedule/env.d.ts.map +1 -1
- package/dist/schedule/env.js +13 -6
- package/dist/schedule/env.js.map +1 -1
- package/dist/schedule/fire/calls.d.ts +49 -0
- package/dist/schedule/fire/calls.d.ts.map +1 -0
- package/dist/schedule/fire/calls.js +114 -0
- package/dist/schedule/fire/calls.js.map +1 -0
- package/dist/schedule/fire/fire.d.ts +1 -1
- package/dist/schedule/fire/fire.d.ts.map +1 -1
- package/dist/schedule/fire/fire.js +209 -15
- package/dist/schedule/fire/fire.js.map +1 -1
- package/dist/schedule/fire/result.d.ts +1 -1
- package/dist/schedule/fire/result.d.ts.map +1 -1
- package/dist/schedule/fire/result.js +2 -1
- package/dist/schedule/fire/result.js.map +1 -1
- package/dist/schedule/fire/run-script.d.ts +46 -0
- package/dist/schedule/fire/run-script.d.ts.map +1 -0
- package/dist/schedule/fire/run-script.js +81 -0
- package/dist/schedule/fire/run-script.js.map +1 -0
- package/dist/schedule/fire/unattended-note.d.ts +8 -0
- package/dist/schedule/fire/unattended-note.d.ts.map +1 -1
- package/dist/schedule/fire/unattended-note.js +5 -0
- package/dist/schedule/fire/unattended-note.js.map +1 -1
- package/dist/schedule/fire/wake-gate.d.ts +39 -0
- package/dist/schedule/fire/wake-gate.d.ts.map +1 -0
- package/dist/schedule/fire/wake-gate.js +90 -0
- package/dist/schedule/fire/wake-gate.js.map +1 -0
- package/dist/schedule/floor.d.ts +28 -8
- package/dist/schedule/floor.d.ts.map +1 -1
- package/dist/schedule/floor.js +624 -114
- package/dist/schedule/floor.js.map +1 -1
- package/dist/schedule/policy.d.ts +40 -0
- package/dist/schedule/policy.d.ts.map +1 -1
- package/dist/schedule/policy.js +36 -0
- package/dist/schedule/policy.js.map +1 -1
- package/dist/schedule/script-check.d.ts +53 -0
- package/dist/schedule/script-check.d.ts.map +1 -0
- package/dist/schedule/script-check.js +145 -0
- package/dist/schedule/script-check.js.map +1 -0
- package/dist/schedule/script-shell.d.ts +3 -0
- package/dist/schedule/script-shell.d.ts.map +1 -0
- package/dist/schedule/script-shell.js +5 -0
- package/dist/schedule/script-shell.js.map +1 -0
- package/dist/schedule/service/index.d.ts +1 -1
- package/dist/schedule/service/index.d.ts.map +1 -1
- package/dist/schedule/service/index.js +20 -11
- package/dist/schedule/service/index.js.map +1 -1
- package/dist/schedule/service/manifest.js +1 -1
- package/dist/schedule/service/manifest.js.map +1 -1
- package/dist/schedule/service/windows-task.d.ts +7 -0
- package/dist/schedule/service/windows-task.d.ts.map +1 -1
- package/dist/schedule/service/windows-task.js +65 -0
- package/dist/schedule/service/windows-task.js.map +1 -1
- package/dist/schedule/service/wsl.d.ts +13 -1
- package/dist/schedule/service/wsl.d.ts.map +1 -1
- package/dist/schedule/service/wsl.js +16 -6
- package/dist/schedule/service/wsl.js.map +1 -1
- package/dist/schedule/store/atomic.d.ts +5 -2
- package/dist/schedule/store/atomic.d.ts.map +1 -1
- package/dist/schedule/store/atomic.js +7 -4
- package/dist/schedule/store/atomic.js.map +1 -1
- package/dist/schedule/store/claims.js +1 -1
- package/dist/schedule/store/claims.js.map +1 -1
- package/dist/schedule/store/history.d.ts +1 -1
- package/dist/schedule/store/history.d.ts.map +1 -1
- package/dist/schedule/store/history.js +4 -1
- package/dist/schedule/store/history.js.map +1 -1
- package/dist/schedule/store/jobs.d.ts +19 -3
- package/dist/schedule/store/jobs.d.ts.map +1 -1
- package/dist/schedule/store/jobs.js +83 -16
- package/dist/schedule/store/jobs.js.map +1 -1
- package/dist/schedule/store/state.js +1 -1
- package/dist/schedule/store/state.js.map +1 -1
- package/dist/schedule/types.d.ts +98 -6
- package/dist/schedule/types.d.ts.map +1 -1
- package/dist/schedule/types.js +25 -1
- package/dist/schedule/types.js.map +1 -1
- package/dist/schedule/visible-source.d.ts +18 -0
- package/dist/schedule/visible-source.d.ts.map +1 -0
- package/dist/schedule/visible-source.js +59 -0
- package/dist/schedule/visible-source.js.map +1 -0
- package/dist/skills/directory.d.ts +38 -0
- package/dist/skills/directory.d.ts.map +1 -0
- package/dist/skills/directory.js +51 -0
- package/dist/skills/directory.js.map +1 -0
- package/dist/test-support/toolset.d.ts +23 -0
- package/dist/test-support/toolset.d.ts.map +1 -0
- package/dist/test-support/toolset.js +27 -0
- package/dist/test-support/toolset.js.map +1 -0
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +343 -64
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/ChoicePicker.d.ts +2 -0
- package/dist/tui/ChoicePicker.d.ts.map +1 -1
- package/dist/tui/ChoicePicker.js +10 -2
- package/dist/tui/ChoicePicker.js.map +1 -1
- package/dist/tui/Composer.d.ts +62 -3
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/Composer.js +162 -25
- package/dist/tui/Composer.js.map +1 -1
- package/dist/tui/ComposerFrame.d.ts +1 -1
- package/dist/tui/ComposerFrame.js +3 -3
- package/dist/tui/ComposerFrame.js.map +1 -1
- package/dist/tui/EffortSlider.d.ts +8 -9
- package/dist/tui/EffortSlider.d.ts.map +1 -1
- package/dist/tui/EffortSlider.js +15 -12
- package/dist/tui/EffortSlider.js.map +1 -1
- package/dist/tui/PermissionOverlay.d.ts +13 -1
- package/dist/tui/PermissionOverlay.d.ts.map +1 -1
- package/dist/tui/PermissionOverlay.js +26 -4
- package/dist/tui/PermissionOverlay.js.map +1 -1
- package/dist/tui/StatusBar.d.ts +12 -12
- package/dist/tui/StatusBar.d.ts.map +1 -1
- package/dist/tui/StatusBar.js +15 -15
- package/dist/tui/StatusBar.js.map +1 -1
- package/dist/tui/agent.d.ts +73 -12
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/agent.js +430 -180
- package/dist/tui/agent.js.map +1 -1
- package/dist/tui/hypermode.d.ts +37 -0
- package/dist/tui/hypermode.d.ts.map +1 -0
- package/dist/tui/hypermode.js +58 -0
- package/dist/tui/hypermode.js.map +1 -0
- package/dist/tui/open-browser.d.ts +29 -1
- package/dist/tui/open-browser.d.ts.map +1 -1
- package/dist/tui/open-browser.js +83 -11
- package/dist/tui/open-browser.js.map +1 -1
- package/dist/tui/permission-review.d.ts +11 -2
- package/dist/tui/permission-review.d.ts.map +1 -1
- package/dist/tui/permission-review.js +176 -19
- package/dist/tui/permission-review.js.map +1 -1
- package/dist/tui/schedule/host-commands.d.ts.map +1 -1
- package/dist/tui/schedule/host-commands.js +95 -33
- package/dist/tui/schedule/host-commands.js.map +1 -1
- package/dist/tui/schedule/integration.d.ts +6 -2
- package/dist/tui/schedule/integration.d.ts.map +1 -1
- package/dist/tui/schedule/integration.js +3 -1
- package/dist/tui/schedule/integration.js.map +1 -1
- package/dist/tui/schedule/resume.d.ts.map +1 -1
- package/dist/tui/schedule/resume.js +10 -1
- package/dist/tui/schedule/resume.js.map +1 -1
- package/dist/tui/schedule/tool-host.d.ts +18 -1
- package/dist/tui/schedule/tool-host.d.ts.map +1 -1
- package/dist/tui/schedule/tool-host.js +384 -84
- package/dist/tui/schedule/tool-host.js.map +1 -1
- package/dist/tui/slashCommands.d.ts +23 -5
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/slashCommands.js +80 -31
- package/dist/tui/slashCommands.js.map +1 -1
- package/dist/tui/theme.d.ts +10 -4
- package/dist/tui/theme.d.ts.map +1 -1
- package/dist/tui/theme.js +4 -3
- package/dist/tui/theme.js.map +1 -1
- package/dist/tui/triggers/analyze.d.ts +57 -0
- package/dist/tui/triggers/analyze.d.ts.map +1 -0
- package/dist/tui/triggers/analyze.js +221 -0
- package/dist/tui/triggers/analyze.js.map +1 -0
- package/dist/tui/triggers/context-text.d.ts +21 -0
- package/dist/tui/triggers/context-text.d.ts.map +1 -0
- package/dist/tui/triggers/context-text.js +44 -0
- package/dist/tui/triggers/context-text.js.map +1 -0
- package/dist/tui/triggers/copy.d.ts +38 -0
- package/dist/tui/triggers/copy.d.ts.map +1 -0
- package/dist/tui/triggers/copy.js +163 -0
- package/dist/tui/triggers/copy.js.map +1 -0
- package/dist/tui/triggers/detect.d.ts +83 -0
- package/dist/tui/triggers/detect.d.ts.map +1 -0
- package/dist/tui/triggers/detect.js +295 -0
- package/dist/tui/triggers/detect.js.map +1 -0
- package/dist/tui/triggers/fold.d.ts +34 -0
- package/dist/tui/triggers/fold.d.ts.map +1 -0
- package/dist/tui/triggers/fold.js +44 -0
- package/dist/tui/triggers/fold.js.map +1 -0
- package/dist/tui/triggers/pattern.d.ts +66 -0
- package/dist/tui/triggers/pattern.d.ts.map +1 -0
- package/dist/tui/triggers/pattern.js +243 -0
- package/dist/tui/triggers/pattern.js.map +1 -0
- package/dist/tui/triggers/provenance.d.ts +58 -0
- package/dist/tui/triggers/provenance.d.ts.map +1 -0
- package/dist/tui/triggers/provenance.js +98 -0
- package/dist/tui/triggers/provenance.js.map +1 -0
- package/dist/tui/triggers/registry.d.ts +113 -0
- package/dist/tui/triggers/registry.d.ts.map +1 -0
- package/dist/tui/triggers/registry.js +164 -0
- package/dist/tui/triggers/registry.js.map +1 -0
- package/dist/tui/triggers/setting.d.ts +18 -0
- package/dist/tui/triggers/setting.d.ts.map +1 -0
- package/dist/tui/triggers/setting.js +61 -0
- package/dist/tui/triggers/setting.js.map +1 -0
- package/dist/tui/triggers/verbs.d.ts +29 -0
- package/dist/tui/triggers/verbs.d.ts.map +1 -0
- package/dist/tui/triggers/verbs.js +140 -0
- package/dist/tui/triggers/verbs.js.map +1 -0
- package/dist/tui/types.d.ts +3 -1
- package/dist/tui/types.d.ts.map +1 -1
- package/package.json +12 -12
- package/skills/README.md +5 -0
- package/skills/schedule-task/SKILL.md +123 -5
|
@@ -18,6 +18,109 @@ chooses Create, Create paused or Cancel; nothing exists until they do.
|
|
|
18
18
|
Ask the user whatever you cannot infer, then propose. Do not create a job
|
|
19
19
|
the user did not ask for.
|
|
20
20
|
|
|
21
|
+
## 0. Choosing a kind
|
|
22
|
+
|
|
23
|
+
`kind` picks what the run does; it changes what every later section means,
|
|
24
|
+
so decide it first. Absent, a job is `"agent"`.
|
|
25
|
+
|
|
26
|
+
- **`"agent"`** (default): the model runs `prompt`. Use it whenever the task
|
|
27
|
+
needs judgement, reading varied content, or producing prose.
|
|
28
|
+
- **`"script"`**: a fixed shell script (`script: {body, shell}`) runs
|
|
29
|
+
on its own, unattended — no model call, no `prompt` (leave it out; it is
|
|
30
|
+
unused). Use it for a fixed, deterministic check that would otherwise cost
|
|
31
|
+
tokens for no reason: a status poll, a file check, a health probe. The
|
|
32
|
+
canonical case is a job that ran an agent every two minutes just to read
|
|
33
|
+
one number and decide there was nothing to report, at real cost for zero
|
|
34
|
+
judgement — that shape is a `script` job, always.
|
|
35
|
+
- **`"script+agent"`**: a cheap gate script (`script`, the wake-gate) runs
|
|
36
|
+
first; only when it decides to wake does the model run `prompt`, on the
|
|
37
|
+
same job. Use it when a cheap check can usually tell "nothing to do" from
|
|
38
|
+
"something needs judgement": write the gate to print
|
|
39
|
+
`{"wake": false, "context": ""}` on the ordinary case and
|
|
40
|
+
`{"wake": true, "context": "<what changed, in one paragraph>"}` otherwise —
|
|
41
|
+
stdout must be exactly that one JSON line, its own last line. `prompt` is
|
|
42
|
+
still required: it is the agent's actual instruction, run only when the
|
|
43
|
+
gate wakes it. `context` is **not** the operator's instruction — say so
|
|
44
|
+
nowhere near the model reads it as one; the run is told this explicitly,
|
|
45
|
+
but do not write a `prompt` that treats `context` as trusted input either.
|
|
46
|
+
|
|
47
|
+
For `"script"`/`"script+agent"`, the script body's OWN check is narrower than
|
|
48
|
+
`permissions` as a whole: the scheduled-run floor reads the whole script, and
|
|
49
|
+
then every `deny` rule (the operator's own, and any config file's) is
|
|
50
|
+
checked against each command in it, naming the command and the rule if one
|
|
51
|
+
matches. **`allow`/`ask` rules and `unmatched` are never consulted for the
|
|
52
|
+
script** — the operator's confirmation of the exact text is what allows it,
|
|
53
|
+
the same way their confirmation of a prompt is; there is nothing to
|
|
54
|
+
improve by proposing `{"bash": "allow"}` or any other allow rule for a
|
|
55
|
+
script, and no need to. Propose `permissions` for what you actually want to
|
|
56
|
+
forbid (`deny` rules) plus whatever the AGENT phase of a `"script+agent"`
|
|
57
|
+
job needs once it wakes — `unmatched`/`allow`/`ask` rules apply ONLY to that
|
|
58
|
+
phase, exactly as for an `"agent"` job, never to the gate or to a pure
|
|
59
|
+
`"script"` job. `unmatched: "park"` is refused for a pure `"script"` job:
|
|
60
|
+
nothing can wait for the operator mid-script; use `park` only on a
|
|
61
|
+
`"script+agent"` job, where it governs the agent phase after the gate
|
|
62
|
+
wakes it. `execution: "sandbox"` is not yet supported for the script/gate
|
|
63
|
+
phase; leave `execution` unset (host).
|
|
64
|
+
|
|
65
|
+
The operator confirms the **exact script text**, once; a later change needs
|
|
66
|
+
re-confirmation, so do not propose a script expecting to iterate on it live
|
|
67
|
+
— get it right, or `update` it (which asks again).
|
|
68
|
+
|
|
69
|
+
Only `bash`/`sh` scripts are supported; the selected interpreter must be
|
|
70
|
+
installed on the host at creation, confirmation and run time. There is no
|
|
71
|
+
PowerShell dialect, so a
|
|
72
|
+
PowerShell payload cannot be verified and is refused. From WSL, a bash
|
|
73
|
+
script may still reach Windows: shell out to `powershell.exe` **by absolute
|
|
74
|
+
path**, with `-Command '<literal text>'` — never `-EncodedCommand`, which is
|
|
75
|
+
refused outright because its base64 payload cannot be read at all.
|
|
76
|
+
|
|
77
|
+
**Command substitution (`$(...)` or `` `...` ``) is read as its own nested
|
|
78
|
+
command line and checked against the same deny rules as the rest of the
|
|
79
|
+
script** — `count=$(grep -c ERROR /var/log/app.log)` is fine on its own. A
|
|
80
|
+
few shapes around it are still refused outright, not run unverified, because
|
|
81
|
+
what they actually run cannot be pinned down from the text alone:
|
|
82
|
+
|
|
83
|
+
- Brace expansion beside a substitution in the SAME word (`$(cmd){a,b}`,
|
|
84
|
+
`${x:-$(cmd)}{a,b}`) — bash runs `cmd` once per brace alternative, not
|
|
85
|
+
once, so the check cannot say how many times it runs.
|
|
86
|
+
- An unquoted substitution used AS a `<`/`>` redirection target
|
|
87
|
+
(`< $(cmd)`, `> ${x:-$(cmd)}`) — for a `${x:-...}`-style default value
|
|
88
|
+
this can run `cmd` twice (measured, real bash). Quote it
|
|
89
|
+
(`< "$(cmd)"`) and it is fine, exactly one word either way.
|
|
90
|
+
- `${ list; }` (bash 5.3's brace-form substitution), process substitution
|
|
91
|
+
(`<(cmd)`, `>(cmd)`), and anything else the checker cannot fully parse —
|
|
92
|
+
same as before, refused with the reason named.
|
|
93
|
+
|
|
94
|
+
If a proposed script hits one of these, restructure it rather than working
|
|
95
|
+
around it — for example, capture into a file and read the file on a later
|
|
96
|
+
line instead of using a substitution as a redirect target:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
grep -c ERROR /var/log/app.log > /tmp/error-count.txt
|
|
100
|
+
count="$(cat /tmp/error-count.txt)"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
or, when only a yes/no matters, test directly (`grep -q ERROR file &&
|
|
104
|
+
...`) rather than counting into a variable at all.
|
|
105
|
+
|
|
106
|
+
**Put the program name in literal text; use substitutions only in
|
|
107
|
+
arguments.** A command whose OWN NAME is decided at runtime —
|
|
108
|
+
`$(echo git) push origin main`, `` `echo rm` -rf x``, or a variable holding
|
|
109
|
+
it (`$X push`) — is refused outright, naming the command, even though the
|
|
110
|
+
script is otherwise readable: no `deny` rule written against the real
|
|
111
|
+
program name (`"git push*": "deny"`) can be trusted to see one that never
|
|
112
|
+
appears as that name anywhere in the script's own text. This is not a
|
|
113
|
+
narrower version of the substitution support above — it applies however
|
|
114
|
+
plain the intent looks, because a script confirmed once is never reviewed
|
|
115
|
+
again the way a live call is. Write the program name literally and put
|
|
116
|
+
whatever needs computing in the arguments instead:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
git push origin main # fine: the name is literal
|
|
120
|
+
$(echo git) push origin main # refused: the name is not
|
|
121
|
+
git push origin "$(cat branch-name.txt)" # fine: only the argument is computed
|
|
122
|
+
```
|
|
123
|
+
|
|
21
124
|
## 1. The permission set (required, no default)
|
|
22
125
|
|
|
23
126
|
Start from the smallest set that can do the job.
|
|
@@ -98,14 +201,21 @@ report its error. Do not install or change anything."
|
|
|
98
201
|
|
|
99
202
|
## 5. Propose, then confirm
|
|
100
203
|
|
|
101
|
-
Call `schedule` with `name` (lowercase, digits, dashes), `
|
|
102
|
-
|
|
103
|
-
`
|
|
204
|
+
Call `schedule` with `name` (lowercase, digits, dashes), `when` and
|
|
205
|
+
`permissions`, plus `prompt` (unless `kind` is `"script"`) and `script`
|
|
206
|
+
(when `kind` is not `"agent"`). Leave `folder` (the session's folder), `tz`,
|
|
207
|
+
`execution`, `budget` and `headed` unset unless the user asked for them. The operator
|
|
104
208
|
sees one confirmation screen with the job as it will run, and every value
|
|
105
209
|
you set that differs from the default is marked as yours. Do not ask them
|
|
106
210
|
to confirm again in chat. Afterwards, `schedule` with
|
|
107
|
-
`action: "list"` shows
|
|
108
|
-
or `namzu schedule list`.
|
|
211
|
+
`action: "list"` shows every job, in any folder, and the operator manages
|
|
212
|
+
them with `/schedule` or `namzu schedule list`.
|
|
213
|
+
|
|
214
|
+
To change a job, call `schedule` with `action: "update"`, `job` (its name)
|
|
215
|
+
and only the fields that change (`prompt`, `when`, `folder`, `tz`, `budget`,
|
|
216
|
+
or `permissions` as the whole new set). The operator sees what changes and
|
|
217
|
+
confirms it; the job keeps its history. Never delete a job and create it
|
|
218
|
+
again to change it: its history is lost. Jobs run only when the scheduler service is
|
|
109
219
|
installed: if the result says none is installed, tell the user to run
|
|
110
220
|
`namzu schedule install`; do not say the job is set up and running.
|
|
111
221
|
|
|
@@ -138,3 +248,11 @@ the user the command to run themselves, for example:
|
|
|
138
248
|
and for a browser job
|
|
139
249
|
|
|
140
250
|
`namzu schedule add morning-post --prompt "…" --when "0 9 * * *" --permissions read-only --unmatched deny --browser social --browser-site http://localhost:8123=act`
|
|
251
|
+
|
|
252
|
+
and for a `script` job:
|
|
253
|
+
|
|
254
|
+
`namzu schedule add disk-check --kind script --script-file check.sh --shell bash --when "every 5m" --permissions rules.json`
|
|
255
|
+
|
|
256
|
+
(`rules.json`: `{"rules": {}, "unmatched": "deny"}` — no `bash` rule needed
|
|
257
|
+
at all for the script itself; a file, since `--permissions` takes a preset
|
|
258
|
+
name or a path, never inline JSON).
|