Commit eb6dfc9
feat(duty): query Agent Schedule runs, findings & reports (read-only) (#25)
Add a `praxis duty` command family so a local AI host can triage what
the org's scheduled "duty" agents did — without opening the Praxis web
UI. Closes #24.
Surface (all read-only, --json + non-TTY auto-JSON):
praxis duty list duties under the agent
praxis duty runs --duty <name|id> recent runs (newest first)
praxis duty run <run_id> one run's detail
praxis duty report <run_id> the report artifact a run produced
praxis duty findings <duty> a duty's findings (open|resolved|all)
- internal/duties: typed REST client mirroring internal/memory — generic
doJSON transport, Bearer auth, var function seams for test stubbing.
- internal/agentcatalog: add Agent.ID and FetchIncludingGlobal so the
global "praxis" duty agent (and others) can be resolved by name→id;
Fetch/FetchIncludingGlobal share fetchActiveSorted.
- cmd/duty: --agent (default "praxis") and <duty> args accept a name or
id; empty-state output names the agent (+ resolved id). Reuses
activeOrAuthExit/reportHTTPErr/render from cmd/memory.
Auth confirmed live: the schedule/run/finding/artifact routes accept the
CLI's API-key Bearer token (validate_user_cookie checks it before
cookies), so no backend change was needed. Verified end-to-end against a
real deployment.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 2b3aa53 commit eb6dfc9
8 files changed
Lines changed: 1397 additions & 2 deletions
File tree
- cmd
- internal
- agentcatalog
- duties
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
| |||
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
125 | | - | |
| 132 | + | |
126 | 133 | | |
127 | 134 | | |
128 | 135 | | |
| |||
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
158 | 175 | | |
159 | 176 | | |
160 | 177 | | |
| |||
0 commit comments