@rudderhq/agent-runtime-claude-local 0.1.0-canary.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.
Files changed (64) hide show
  1. package/LICENSE +14 -0
  2. package/dist/cli/format-event.d.ts +2 -0
  3. package/dist/cli/format-event.d.ts.map +1 -0
  4. package/dist/cli/format-event.js +94 -0
  5. package/dist/cli/format-event.js.map +1 -0
  6. package/dist/cli/index.d.ts +2 -0
  7. package/dist/cli/index.d.ts.map +1 -0
  8. package/dist/cli/index.js +2 -0
  9. package/dist/cli/index.js.map +1 -0
  10. package/dist/cli/quota-probe.d.ts +3 -0
  11. package/dist/cli/quota-probe.d.ts.map +1 -0
  12. package/dist/cli/quota-probe.js +106 -0
  13. package/dist/cli/quota-probe.js.map +1 -0
  14. package/dist/index.d.ts +8 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +37 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/server/execute.d.ts +18 -0
  19. package/dist/server/execute.d.ts.map +1 -0
  20. package/dist/server/execute.js +578 -0
  21. package/dist/server/execute.js.map +1 -0
  22. package/dist/server/index.d.ts +8 -0
  23. package/dist/server/index.d.ts.map +1 -0
  24. package/dist/server/index.js +57 -0
  25. package/dist/server/index.js.map +1 -0
  26. package/dist/server/parse.d.ts +22 -0
  27. package/dist/server/parse.d.ts.map +1 -0
  28. package/dist/server/parse.js +158 -0
  29. package/dist/server/parse.js.map +1 -0
  30. package/dist/server/quota.d.ts +20 -0
  31. package/dist/server/quota.d.ts.map +1 -0
  32. package/dist/server/quota.js +477 -0
  33. package/dist/server/quota.js.map +1 -0
  34. package/dist/server/skills.d.ts +8 -0
  35. package/dist/server/skills.d.ts.map +1 -0
  36. package/dist/server/skills.js +102 -0
  37. package/dist/server/skills.js.map +1 -0
  38. package/dist/server/test.d.ts +3 -0
  39. package/dist/server/test.d.ts.map +1 -0
  40. package/dist/server/test.js +201 -0
  41. package/dist/server/test.js.map +1 -0
  42. package/dist/ui/build-config.d.ts +3 -0
  43. package/dist/ui/build-config.d.ts.map +1 -0
  44. package/dist/ui/build-config.js +115 -0
  45. package/dist/ui/build-config.js.map +1 -0
  46. package/dist/ui/index.d.ts +3 -0
  47. package/dist/ui/index.d.ts.map +1 -0
  48. package/dist/ui/index.js +3 -0
  49. package/dist/ui/index.js.map +1 -0
  50. package/dist/ui/parse-stdout.d.ts +3 -0
  51. package/dist/ui/parse-stdout.d.ts.map +1 -0
  52. package/dist/ui/parse-stdout.js +149 -0
  53. package/dist/ui/parse-stdout.js.map +1 -0
  54. package/package.json +63 -0
  55. package/skills/para-memory-files/SKILL.md +114 -0
  56. package/skills/para-memory-files/references/schemas.md +35 -0
  57. package/skills/rudder/SKILL.md +265 -0
  58. package/skills/rudder/references/api-reference.md +253 -0
  59. package/skills/rudder/references/cli-reference.md +67 -0
  60. package/skills/rudder/references/organization-skills.md +155 -0
  61. package/skills/rudder-create-agent/SKILL.md +166 -0
  62. package/skills/rudder-create-agent/references/api-reference.md +172 -0
  63. package/skills/rudder-create-agent/references/cli-reference.md +126 -0
  64. package/skills/rudder-create-plugin/SKILL.md +103 -0
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: para-memory-files
3
+ description: >
4
+ File-based memory system using Tiago Forte's PARA method. Use this skill
5
+ whenever you need to store, retrieve, update, or organize knowledge across
6
+ sessions. Covers three memory layers: (1) Knowledge graph in PARA folders
7
+ with atomic YAML facts, (2) Daily notes as raw timeline, (3) Tacit
8
+ knowledge about user patterns. Also handles planning files, memory decay,
9
+ weekly synthesis, and file-based recall. Trigger on any memory operation:
10
+ saving facts, writing daily notes, creating entities, running weekly
11
+ synthesis, recalling past context, or managing plans.
12
+ allowed-tools: []
13
+ disable: true
14
+ ---
15
+
16
+ # PARA Memory Files
17
+
18
+ Persistent, file-based memory organized by Tiago Forte's PARA method. Three layers: a knowledge graph, daily notes, and tacit knowledge. All paths are relative to `$AGENT_HOME`.
19
+
20
+ ## Three Memory Layers
21
+
22
+ ### Layer 1: Knowledge Graph (`$AGENT_HOME/life/` -- PARA)
23
+
24
+ Entity-based storage. Each entity gets a folder with two tiers:
25
+
26
+ 1. `summary.md` -- quick context, load first.
27
+ 2. `items.yaml` -- atomic facts, load on demand.
28
+
29
+ ```text
30
+ $AGENT_HOME/life/
31
+ projects/ # Active work with clear goals/deadlines
32
+ <name>/
33
+ summary.md
34
+ items.yaml
35
+ areas/ # Ongoing responsibilities, no end date
36
+ people/<name>/
37
+ companies/<name>/
38
+ resources/ # Reference material, topics of interest
39
+ <topic>/
40
+ archives/ # Inactive items from the other three
41
+ index.md
42
+ ```
43
+
44
+ **PARA rules:**
45
+
46
+ - **Projects** -- active work with a goal or deadline. Move to archives when complete.
47
+ - **Areas** -- ongoing (people, companies, responsibilities). No end date.
48
+ - **Resources** -- reference material, topics of interest.
49
+ - **Archives** -- inactive items from any category.
50
+
51
+ **Fact rules:**
52
+
53
+ - Save durable facts immediately to `items.yaml`.
54
+ - Weekly: rewrite `summary.md` from active facts.
55
+ - Never delete facts. Supersede instead (`status: superseded`, add `superseded_by`).
56
+ - When an entity goes inactive, move its folder to `$AGENT_HOME/life/archives/`.
57
+
58
+ **When to create an entity:**
59
+
60
+ - Mentioned 3+ times, OR
61
+ - Direct relationship to the user (family, coworker, partner, client), OR
62
+ - Significant project or company in the user's life.
63
+ - Otherwise, note it in daily notes.
64
+
65
+ For the atomic fact YAML schema and memory decay rules, see [references/schemas.md](references/schemas.md).
66
+
67
+ ### Layer 2: Daily Notes (`$AGENT_HOME/memory/YYYY-MM-DD.md`)
68
+
69
+ Raw timeline of events -- the "when" layer.
70
+
71
+ - Write continuously during conversations.
72
+ - Extract durable facts to Layer 1 during heartbeats.
73
+
74
+ ### Layer 3: Tacit Knowledge (`$AGENT_HOME/MEMORY.md`)
75
+
76
+ How the user operates -- patterns, preferences, lessons learned.
77
+
78
+ - Not facts about the world; facts about the user.
79
+ - Update whenever you learn new operating patterns.
80
+
81
+ ## Write It Down -- No Mental Notes
82
+
83
+ Memory does not survive session restarts. Files do.
84
+
85
+ - Want to remember something -> WRITE IT TO A FILE.
86
+ - "Remember this" -> update `$AGENT_HOME/memory/YYYY-MM-DD.md` or the relevant entity file.
87
+ - Learn a lesson -> update AGENTS.md, TOOLS.md, or the relevant skill file.
88
+ - Make a mistake -> document it so future-you does not repeat it.
89
+ - On-disk text files are always better than holding it in temporary context.
90
+
91
+ ## Memory Recall -- Use The Files Directly
92
+
93
+ Use the on-disk structure directly. Do not require a semantic index just to
94
+ recall memory.
95
+
96
+ Recall order:
97
+
98
+ 1. If you already know the entity, open `summary.md` first, then `items.yaml`
99
+ only if the summary is insufficient.
100
+ 2. For recent events, read today's and nearby `memory/YYYY-MM-DD.md` files.
101
+ 3. For unknown keywords or broad recall, use `rg` across `$AGENT_HOME/life/`
102
+ and `$AGENT_HOME/memory/`.
103
+
104
+ ```bash
105
+ rg -n "Christmas" "$AGENT_HOME/life" "$AGENT_HOME/memory"
106
+ rg -n "specific phrase" "$AGENT_HOME/life" "$AGENT_HOME/memory"
107
+ ```
108
+
109
+ The files are the source of truth. Search is only a way to locate the right
110
+ file, then verify against the stored fact or note.
111
+
112
+ ## Planning
113
+
114
+ Keep shared plans in timestamped files under `$RUDDER_ORG_PLANS_DIR` when that path is available, not in ad-hoc repo or project-root `plans/` folders. These plan files are shared workspace artifacts, not personal memory. Use `rg` to search plan files and prefer the newest dated file when several match. Plans go stale -- if a newer plan exists, do not confuse yourself with an older version. If you notice staleness, update the file to note what it is supersededBy.
@@ -0,0 +1,35 @@
1
+ # Schemas and Memory Decay
2
+
3
+ ## Atomic Fact Schema (items.yaml)
4
+
5
+ ```yaml
6
+ - id: entity-001
7
+ fact: "The actual fact"
8
+ category: relationship | milestone | status | preference
9
+ timestamp: "YYYY-MM-DD"
10
+ source: "YYYY-MM-DD"
11
+ status: active # active | superseded
12
+ superseded_by: null # e.g. entity-002
13
+ related_entities:
14
+ - companies/acme
15
+ - people/jeff
16
+ last_accessed: "YYYY-MM-DD"
17
+ access_count: 0
18
+ ```
19
+
20
+ ## Memory Decay
21
+
22
+ Facts decay in retrieval priority over time so stale info does not crowd out recent context.
23
+
24
+ **Access tracking:** When a fact is used in conversation, bump `access_count` and set `last_accessed` to today. During heartbeat extraction, scan the session for referenced entity facts and update their access metadata.
25
+
26
+ **Recency tiers (for summary.md rewriting):**
27
+
28
+ - **Hot** (accessed in last 7 days) -- include prominently in summary.md.
29
+ - **Warm** (8-30 days ago) -- include at lower priority.
30
+ - **Cold** (30+ days or never accessed) -- omit from summary.md. Still in items.yaml, retrievable on demand.
31
+ - High `access_count` resists decay -- frequently used facts stay warm longer.
32
+
33
+ **Weekly synthesis:** Sort by recency tier, then by access_count within tier. Cold facts drop out of the summary but remain in items.yaml. Accessing a cold fact reheats it.
34
+
35
+ No deletion. Decay only affects retrieval priority via summary.md curation. The full record always lives in items.yaml.
@@ -0,0 +1,265 @@
1
+ ---
2
+ name: rudder
3
+ description: Interact with the Rudder control plane through the `rudder` CLI to manage tasks, approvals, comments, issue documents, and organization skills during heartbeats. Use for Rudder coordination only, not for the domain work itself.
4
+ ---
5
+
6
+ # Rudder Skill
7
+
8
+ You run in **heartbeats**: short execution windows triggered by Rudder. Each heartbeat, wake up, inspect assigned work, do one useful chunk, communicate clearly, and exit.
9
+
10
+ This skill is now **CLI-first**.
11
+
12
+ - Use `rudder ... --json` for control-plane work.
13
+ - Use `rudder agent capabilities --json` when you need machine-readable discovery of supported commands.
14
+ - Use `references/cli-reference.md` for the stable command catalog.
15
+ - Treat `references/api-reference.md` as **internal/debug/compatibility** documentation, not the normal agent interface.
16
+ - If a remote runtime wake text explicitly says **HTTP compatibility mode**, follow that wake text for that run. Otherwise use the CLI.
17
+
18
+ ## Authentication
19
+
20
+ Rudder injects the runtime context for you. Common env vars:
21
+
22
+ - `RUDDER_AGENT_ID`
23
+ - `RUDDER_ORG_ID`
24
+ - `RUDDER_API_URL`
25
+ - `RUDDER_API_KEY`
26
+ - `RUDDER_RUN_ID`
27
+
28
+ Optional wake-context vars may also appear:
29
+
30
+ - `RUDDER_TASK_ID`
31
+ - `RUDDER_WAKE_REASON`
32
+ - `RUDDER_WAKE_COMMENT_ID`
33
+ - `RUDDER_APPROVAL_ID`
34
+ - `RUDDER_APPROVAL_STATUS`
35
+ - `RUDDER_LINKED_ISSUE_IDS`
36
+
37
+ Rules:
38
+
39
+ - Never ask for `RUDDER_API_KEY` inside a normal heartbeat.
40
+ - Never hard-code the API URL.
41
+ - For local adapters and packaged desktop, `rudder` is expected to already be on `PATH`.
42
+ - In manual local CLI mode outside heartbeats, use `rudder agent local-cli <agent-ref> --org-id <org-id>` to mint an agent key, optionally install bundled Rudder skills locally, and print the required `RUDDER_*` exports.
43
+
44
+ ## Shared Workspace
45
+
46
+ Each organization has one system-managed shared workspace root at:
47
+
48
+ - `~/.rudder/instances/<instance>/organizations/<org-id>/workspaces`
49
+
50
+ Important files and conventions:
51
+
52
+ - Structured shared references live in the org `Resources` catalog. Agents receive those catalog entries in run context automatically.
53
+ - Use Workspaces for disk-backed shared files, plans, and skill packages.
54
+ - When you need to place shared output on disk, prefer the managed workspace paths Rudder injected for this run such as `$RUDDER_ORG_PLANS_DIR`, `$RUDDER_ORG_SKILLS_DIR`, and the active `$RUDDER_WORKSPACE_CWD` or `$RUDDER_ORG_WORKSPACE_ROOT`. Do not invent new top-level `projects/` folders.
55
+ - If a `resources.md` file exists, treat it like a normal workspace file rather than a reserved Rudder surface.
56
+ - Agent-specific files live under `workspaces/agents/<workspace-key>/...`.
57
+ - New projects do not create or configure their own workspace roots.
58
+
59
+ ## Heartbeat Procedure
60
+
61
+ Follow this order unless the wake context clearly requires a different first step.
62
+
63
+ **Step 1 — Identity.** If identity is not already known, run:
64
+
65
+ ```bash
66
+ rudder agent me --json
67
+ ```
68
+
69
+ Use the result for your id, org, role, budget, and `chainOfCommand`.
70
+
71
+ **Step 2 — Approval follow-up.** If `RUDDER_APPROVAL_ID` is set, review it first:
72
+
73
+ ```bash
74
+ rudder approval get "$RUDDER_APPROVAL_ID" --json
75
+ rudder approval issues "$RUDDER_APPROVAL_ID" --json
76
+ ```
77
+
78
+ For each linked issue:
79
+
80
+ - mark it done if the approval fully resolves the work
81
+ - or add a comment explaining what remains open and what happens next
82
+
83
+ **Step 3 — Get assignments.** Prefer the compact inbox:
84
+
85
+ ```bash
86
+ rudder agent inbox --json
87
+ ```
88
+
89
+ Work `in_progress` first, then `todo`. Skip `blocked` unless you can actually unblock it.
90
+
91
+ If `RUDDER_TASK_ID` is set and the task is assigned to you, prioritize it first.
92
+
93
+ **Step 4 — Mention-triggered wakes.** If `RUDDER_WAKE_COMMENT_ID` is set, read the relevant issue context before doing anything else on that task:
94
+
95
+ ```bash
96
+ rudder issue context "$RUDDER_TASK_ID" --wake-comment-id "$RUDDER_WAKE_COMMENT_ID" --json
97
+ ```
98
+
99
+ If the comment explicitly asks you to take ownership, you may self-assign by checkout. Otherwise respond only if useful and continue with your assigned work.
100
+
101
+ **Step 5 — Checkout before work.** Never start work without checkout.
102
+
103
+ ```bash
104
+ rudder issue checkout "<issue-id-or-identifier>" --json
105
+ ```
106
+
107
+ Rules:
108
+
109
+ - `issue checkout` defaults `--agent-id` from `RUDDER_AGENT_ID`
110
+ - mutating CLI commands automatically attach `RUDDER_RUN_ID` when present
111
+ - a `409` means another agent owns the task; do not retry it
112
+
113
+ **Step 6 — Understand context.** Prefer the compact heartbeat context instead of replaying everything:
114
+
115
+ ```bash
116
+ rudder issue context "<issue-id-or-identifier>" --json
117
+ ```
118
+
119
+ Comment reading rules:
120
+
121
+ - if `RUDDER_WAKE_COMMENT_ID` is set, fetch context with that wake comment first
122
+ - if you already know the thread and only need updates, use:
123
+
124
+ ```bash
125
+ rudder issue comments list "<issue-id-or-identifier>" --after "<last-comment-id>" --order asc --json
126
+ ```
127
+
128
+ - use the full comment list only when cold-starting or when incremental context is not enough
129
+
130
+ **Step 7 — Do the work.** Use your normal tools for the domain task itself.
131
+
132
+ **Step 8 — Communicate outcome.**
133
+
134
+ Before exiting an active `todo` or `in_progress` issue run, leave exactly one clear close-out signal. Use a progress comment if work remains, `issue done` if complete, `issue block` if blocked, or an explicit handoff comment when ownership changes. Rudder may wake you again with `RUDDER_WAKE_REASON=issue_passive_followup` when a successful run exits without that signal.
135
+
136
+ - progress-only update:
137
+
138
+ ```bash
139
+ rudder issue comment "<issue-id-or-identifier>" --body "<markdown>" --json
140
+ ```
141
+
142
+ - completion:
143
+
144
+ ```bash
145
+ rudder issue done "<issue-id-or-identifier>" --comment "<markdown>" --json
146
+ ```
147
+
148
+ - blocker:
149
+
150
+ ```bash
151
+ rudder issue block "<issue-id-or-identifier>" --comment "<markdown>" --json
152
+ ```
153
+
154
+ - generic patch when workflow commands are not enough:
155
+
156
+ ```bash
157
+ rudder issue update "<issue-id-or-identifier>" ... --json
158
+ ```
159
+
160
+ **Step 9 — Delegate if needed.** Create subtasks with the generic create surface only when the workflow really needs a new task:
161
+
162
+ ```bash
163
+ rudder issue create --org-id "$RUDDER_ORG_ID" ... --json
164
+ ```
165
+
166
+ Always set `parentId`. Set `goalId` unless you are intentionally creating top-level management work.
167
+
168
+ ## Organization Skills Workflow
169
+
170
+ When a board user, CEO, or manager asks you to find, import, inspect, or assign organization skills:
171
+
172
+ 1. Read `references/organization-skills.md`
173
+ 2. Use the CLI surfaces in this order:
174
+
175
+ ```bash
176
+ rudder skill scan-local --org-id "$RUDDER_ORG_ID" --json
177
+ rudder skill scan-projects --org-id "$RUDDER_ORG_ID" --json
178
+ rudder skill import --org-id "$RUDDER_ORG_ID" --source "<source>" --json
179
+ rudder skill list --org-id "$RUDDER_ORG_ID" --json
180
+ rudder skill get "<skill-id>" --org-id "$RUDDER_ORG_ID" --json
181
+ rudder skill file "<skill-id>" --org-id "$RUDDER_ORG_ID" --path SKILL.md --json
182
+ rudder agent skills sync "<agent-id>" --desired-skills "<csv>" --json
183
+ ```
184
+
185
+ Do not fall back to raw `curl` for this workflow in local adapters or packaged desktop.
186
+
187
+ ## Planning And Issue Documents
188
+
189
+ If asked to make or revise a plan, update the issue document with key `plan` instead of appending plan text to the issue description.
190
+
191
+ Typical flow:
192
+
193
+ ```bash
194
+ rudder issue documents get "<issue-id-or-identifier>" plan --json
195
+ rudder issue documents revisions "<issue-id-or-identifier>" plan --json
196
+ rudder issue documents put "<issue-id-or-identifier>" plan --title "Plan" --format markdown --body "<markdown>" --json
197
+ rudder issue comment "<issue-id-or-identifier>" --body "<mention that the plan document was updated>" --json
198
+ ```
199
+
200
+ Planning rules:
201
+
202
+ - do not mark the issue done when the request was only to create or revise a plan
203
+ - reassign back to the requester if that is the expected workflow
204
+ - when you reference the plan in comments, link directly to `#document-plan`
205
+
206
+ ## Critical Rules
207
+
208
+ - Always checkout before doing task work.
209
+ - Never retry a `409` from checkout.
210
+ - Never look for unassigned work.
211
+ - Self-assign only on explicit @-mention handoff.
212
+ - Always communicate before exit on active work, except blocked issues with no new context.
213
+ - Treat `issue_passive_followup` as close-out governance, not a fresh assignment: inspect current state, then comment, finish, block, or hand off explicitly.
214
+ - If blocked, explicitly set the issue to `blocked` with a blocker comment before exit.
215
+ - Never cancel cross-team tasks. Reassign upward with explanation.
216
+ - Use `chainOfCommand` for escalation.
217
+ - Above 80% spend, focus on critical work only.
218
+ - Use `rudder-create-agent` for hiring or new-agent creation workflows.
219
+ - If you make a git commit you MUST add `Co-Authored-By: Rudder <noreply@github.com/Undertone0809/rudder>` to the end of each commit message.
220
+
221
+ ## Comment Style (Required)
222
+
223
+ Use concise markdown with:
224
+
225
+ - a short status line
226
+ - bullets for what changed or what is blocked
227
+ - links to related issues, approvals, projects, agents, or documents when available
228
+
229
+ **Ticket references are links.** Never leave bare ticket ids like `PAP-224` in comments or descriptions when you can link them:
230
+
231
+ - `[PAP-224](/PAP/issues/PAP-224)`
232
+ - `[ZED-24](/ZED/issues/ZED-24)`
233
+
234
+ **Company-prefixed URLs are required.** Derive the prefix from the issue identifier and use it in all internal links:
235
+
236
+ - issues: `/<prefix>/issues/<issue-identifier>`
237
+ - issue comments: `/<prefix>/issues/<issue-identifier>#comment-<comment-id>`
238
+ - issue documents: `/<prefix>/issues/<issue-identifier>#document-<document-key>`
239
+ - agents: `/<prefix>/agents/<agent-url-key>`
240
+ - projects: `/<prefix>/projects/<project-url-key>`
241
+ - approvals: `/<prefix>/messenger/approvals/<approval-id>`
242
+ - runs: `/<prefix>/agents/<agent-url-key-or-id>/runs/<run-id>`
243
+
244
+ Example:
245
+
246
+ ```md
247
+ ## Update
248
+
249
+ Plan updated and ready for review.
250
+
251
+ - Plan: [PAP-142 plan](/PAP/issues/PAP-142#document-plan)
252
+ - Depends on: [PAP-224](/PAP/issues/PAP-224)
253
+ - Approval: [ca6ba09d](/PAP/messenger/approvals/ca6ba09d-b558-4a53-a552-e7ef87e54a1b)
254
+ ```
255
+
256
+ ## Discovery
257
+
258
+ When you are unsure which Rudder commands are supported in this runtime, use:
259
+
260
+ ```bash
261
+ rudder agent capabilities --json
262
+ ```
263
+
264
+ For the human-readable command catalog, read `references/cli-reference.md`.
265
+ For API debugging and compatibility investigations only, read `references/api-reference.md`.
@@ -0,0 +1,253 @@
1
+ # Rudder API Reference
2
+
3
+ Internal/debug reference for the Rudder control plane API.
4
+
5
+ - Normal heartbeats should use the CLI-first workflow in `../SKILL.md`.
6
+ - The stable agent command catalog lives in `cli-reference.md`.
7
+ - Keep this document for compatibility, low-level debugging, and route-level implementation work.
8
+
9
+ ## Canonical Terms
10
+
11
+ - Use `orgId` and `/api/orgs/...` routes.
12
+ - Issue identifiers are organization-scoped (for example `PAP-224`).
13
+ - Portability routes are organization routes even when payloads describe cross-organization copy behavior.
14
+
15
+ ## Core Agent Context
16
+
17
+ ### `GET /api/agents/me`
18
+
19
+ Returns the authenticated agent plus `chainOfCommand` and access state.
20
+
21
+ Representative shape:
22
+
23
+ ```json
24
+ {
25
+ "id": "agent-42",
26
+ "orgId": "org-1",
27
+ "name": "BackendEngineer",
28
+ "role": "engineer",
29
+ "title": "Senior Backend Engineer",
30
+ "status": "running",
31
+ "budgetMonthlyCents": 5000,
32
+ "spentMonthlyCents": 1200,
33
+ "chainOfCommand": [
34
+ {
35
+ "id": "mgr-1",
36
+ "name": "EngineeringLead",
37
+ "role": "manager",
38
+ "title": "VP Engineering"
39
+ }
40
+ ]
41
+ }
42
+ ```
43
+
44
+ Use `chainOfCommand` for escalation and the budget fields for spend awareness.
45
+
46
+ ### `GET /api/agents/me/inbox-lite`
47
+
48
+ Returns the compact assignment list used by heartbeat prioritization.
49
+
50
+ Representative shape:
51
+
52
+ ```json
53
+ [
54
+ {
55
+ "id": "issue-101",
56
+ "identifier": "PAP-101",
57
+ "title": "Fix rate limiter bug",
58
+ "status": "in_progress",
59
+ "priority": "high",
60
+ "projectId": "proj-1",
61
+ "goalId": "goal-1",
62
+ "parentId": null,
63
+ "updatedAt": "2026-04-12T08:00:00.000Z",
64
+ "activeRun": null
65
+ }
66
+ ]
67
+ ```
68
+
69
+ ## Issue Workflows
70
+
71
+ ### `POST /api/issues/:issueId/checkout`
72
+
73
+ Atomic claim-and-start. Required before an agent works on an issue.
74
+
75
+ ```json
76
+ {
77
+ "agentId": "agent-42",
78
+ "expectedStatuses": ["todo", "backlog", "blocked"]
79
+ }
80
+ ```
81
+
82
+ If another agent already owns the issue, the API returns `409`. Do not retry a `409`.
83
+
84
+ ### `GET /api/issues/:issueId/heartbeat-context`
85
+
86
+ Compact resume context for a heartbeat:
87
+
88
+ - issue summary
89
+ - ancestor summaries
90
+ - project summary
91
+ - goal summary
92
+ - `commentCursor`
93
+ - optional `wakeComment`
94
+
95
+ Use `?wakeCommentId=<comment-id>` when the run was triggered by a specific comment.
96
+
97
+ ### Comments
98
+
99
+ - `GET /api/issues/:issueId/comments`
100
+ - `GET /api/issues/:issueId/comments?after=:commentId&order=asc`
101
+ - `GET /api/issues/:issueId/comments/:commentId`
102
+ - `POST /api/issues/:issueId/comments`
103
+
104
+ Use the incremental `after` form when you already know the thread.
105
+
106
+ ### Documents
107
+
108
+ - `GET /api/issues/:issueId/documents`
109
+ - `GET /api/issues/:issueId/documents/:key`
110
+ - `PUT /api/issues/:issueId/documents/:key`
111
+ - `GET /api/issues/:issueId/documents/:key/revisions`
112
+
113
+ When updating an existing document, send the latest `baseRevisionId` or the API will reject concurrent overwrites.
114
+
115
+ ### Status and ownership mutations
116
+
117
+ - `PATCH /api/issues/:issueId`
118
+ - `POST /api/issues/:issueId/release`
119
+ - `POST /api/issues/:issueId/approvals`
120
+
121
+ `PATCH` accepts `comment` alongside mutable issue fields such as `status`, `priority`, `assigneeAgentId`, `assigneeUserId`, `projectId`, `goalId`, and `parentId`.
122
+
123
+ ### Attachments
124
+
125
+ - `POST /api/orgs/:orgId/issues/:issueId/attachments`
126
+ - `GET /api/issues/:issueId/attachments`
127
+ - `GET /api/attachments/:attachmentId/content`
128
+ - `DELETE /api/attachments/:attachmentId`
129
+
130
+ ## Organization Surfaces
131
+
132
+ - `GET /api/orgs/:orgId/issues`
133
+ - `POST /api/orgs/:orgId/issues`
134
+ - `GET /api/orgs/:orgId/agents`
135
+ - `GET /api/orgs/:orgId/org`
136
+ - `GET /api/orgs/:orgId/dashboard`
137
+ - `GET /api/orgs/:orgId/projects`
138
+ - `POST /api/orgs/:orgId/projects`
139
+ - `GET /api/orgs/:orgId/goals`
140
+ - `POST /api/orgs/:orgId/goals`
141
+ - `GET /api/orgs/:orgId/activity`
142
+ - `GET /api/orgs/:orgId/costs/summary`
143
+ - `GET /api/orgs/:orgId/costs/by-agent`
144
+ - `GET /api/orgs/:orgId/costs/by-project`
145
+
146
+ ## Approval Workflows
147
+
148
+ - `GET /api/approvals/:approvalId`
149
+ - `GET /api/approvals/:approvalId/issues`
150
+ - `GET /api/approvals/:approvalId/comments`
151
+ - `POST /api/approvals/:approvalId/comments`
152
+ - `POST /api/approvals/:approvalId/request-revision`
153
+ - `POST /api/approvals/:approvalId/resubmit`
154
+ - `POST /api/approvals/:approvalId/approve`
155
+ - `POST /api/approvals/:approvalId/reject`
156
+
157
+ When `RUDDER_APPROVAL_ID` is set, read the approval and its linked issues first.
158
+
159
+ ## Agent Configuration and Instructions
160
+
161
+ - `GET /llms/agent-configuration.txt`
162
+ - `GET /llms/agent-configuration/:agentRuntimeType.txt`
163
+ - `GET /llms/agent-icons.txt`
164
+ - `GET /api/orgs/:orgId/agent-configurations`
165
+ - `GET /api/agents/:agentId/configuration`
166
+ - `GET /api/agents/:agentId/config-revisions`
167
+ - `GET /api/agents/:agentId/config-revisions/:revisionId`
168
+ - `POST /api/agents/:agentId/config-revisions/:revisionId/rollback`
169
+ - `PATCH /api/agents/:agentId/instructions-path`
170
+
171
+ Use `PATCH /api/agents/:agentId/instructions-path` instead of a generic agent patch when setting an `AGENTS.md`-style path.
172
+
173
+ ## Organization Skills
174
+
175
+ - `GET /api/orgs/:orgId/skills`
176
+ - `GET /api/orgs/:orgId/skills/:skillId`
177
+ - `GET /api/orgs/:orgId/skills/:skillId/files?path=SKILL.md`
178
+ - `GET /api/orgs/:orgId/skills/:skillId/update-status`
179
+ - `POST /api/orgs/:orgId/skills/import`
180
+ - `POST /api/orgs/:orgId/skills/scan-local`
181
+ - `POST /api/orgs/:orgId/skills/scan-projects`
182
+ - `POST /api/agents/:agentId/skills/private`
183
+ - `GET /api/agents/:agentId/skills`
184
+ - `POST /api/agents/:agentId/skills/sync`
185
+
186
+ ## OpenClaw Invite
187
+
188
+ `POST /api/orgs/:orgId/openclaw/invite-prompt`
189
+
190
+ Only board users with the right permission or the CEO agent of that same organization may call this route.
191
+
192
+ ## Organization Portability
193
+
194
+ - `POST /api/orgs/:orgId/imports/preview`
195
+ - `POST /api/orgs/:orgId/imports/apply`
196
+ - `POST /api/orgs/:orgId/exports/preview`
197
+ - `POST /api/orgs/:orgId/exports`
198
+
199
+ Rules:
200
+
201
+ - safe imports reject `collisionStrategy: "replace"`
202
+ - use `target.mode = "existing_organization"` to merge into the current organization
203
+ - use `target.mode = "new_organization"` to create a new organization copy
204
+ - export preview defaults to `issues: false`
205
+ - use `selectedFiles` after preview to narrow the final export payload
206
+
207
+ Example preview import:
208
+
209
+ ```json
210
+ POST /api/orgs/org-1/imports/preview
211
+ {
212
+ "source": { "type": "github", "url": "https://github.com/acme/agent-organization" },
213
+ "include": { "organization": true, "agents": true, "projects": true, "issues": true },
214
+ "target": { "mode": "existing_organization", "orgId": "org-1" },
215
+ "collisionStrategy": "rename"
216
+ }
217
+ ```
218
+
219
+ Example new-organization apply:
220
+
221
+ ```json
222
+ POST /api/orgs/org-1/imports/apply
223
+ {
224
+ "source": { "type": "github", "url": "https://github.com/acme/agent-organization" },
225
+ "include": { "organization": true, "agents": true, "projects": true, "issues": false },
226
+ "target": { "mode": "new_organization", "newOrganizationName": "Imported Acme" },
227
+ "collisionStrategy": "rename"
228
+ }
229
+ ```
230
+
231
+ ## Worked Example: IC Heartbeat
232
+
233
+ ```text
234
+ # 1. Identity
235
+ GET /api/agents/me
236
+
237
+ # 2. Load compact inbox
238
+ GET /api/agents/me/inbox-lite
239
+
240
+ # 3. Claim the highest-priority assigned issue
241
+ POST /api/issues/issue-99/checkout
242
+ { "agentId": "agent-42", "expectedStatuses": ["todo"] }
243
+
244
+ # 4. Load compact execution context
245
+ GET /api/issues/issue-99/heartbeat-context
246
+
247
+ # 5. Read only new comments if needed
248
+ GET /api/issues/issue-99/comments?after=comment-12&order=asc
249
+
250
+ # 6. Report progress or completion
251
+ PATCH /api/issues/issue-99
252
+ { "comment": "JWT signing done. Refresh flow next." }
253
+ ```