@alvax-ai/adapter-claude-local 0.1.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/dist/cli/format-event.d.ts +2 -0
- package/dist/cli/format-event.d.ts.map +1 -0
- package/dist/cli/format-event.js +136 -0
- package/dist/cli/format-event.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/quota-probe.d.ts +3 -0
- package/dist/cli/quota-probe.d.ts.map +1 -0
- package/dist/cli/quota-probe.js +106 -0
- package/dist/cli/quota-probe.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/server/claude-config.d.ts +5 -0
- package/dist/server/claude-config.d.ts.map +1 -0
- package/dist/server/claude-config.js +106 -0
- package/dist/server/claude-config.js.map +1 -0
- package/dist/server/execute.d.ts +18 -0
- package/dist/server/execute.d.ts.map +1 -0
- package/dist/server/execute.js +700 -0
- package/dist/server/execute.js.map +1 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +64 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/models.d.ts +11 -0
- package/dist/server/models.d.ts.map +1 -0
- package/dist/server/models.js +32 -0
- package/dist/server/models.js.map +1 -0
- package/dist/server/parse.d.ts +34 -0
- package/dist/server/parse.d.ts.map +1 -0
- package/dist/server/parse.js +319 -0
- package/dist/server/parse.js.map +1 -0
- package/dist/server/prompt-cache.d.ts +17 -0
- package/dist/server/prompt-cache.d.ts.map +1 -0
- package/dist/server/prompt-cache.js +125 -0
- package/dist/server/prompt-cache.js.map +1 -0
- package/dist/server/quota.d.ts +21 -0
- package/dist/server/quota.d.ts.map +1 -0
- package/dist/server/quota.js +484 -0
- package/dist/server/quota.js.map +1 -0
- package/dist/server/skills.d.ts +8 -0
- package/dist/server/skills.d.ts.map +1 -0
- package/dist/server/skills.js +97 -0
- package/dist/server/skills.js.map +1 -0
- package/dist/server/test.d.ts +3 -0
- package/dist/server/test.d.ts.map +1 -0
- package/dist/server/test.js +258 -0
- package/dist/server/test.js.map +1 -0
- package/dist/ui/build-config.d.ts +3 -0
- package/dist/ui/build-config.d.ts.map +1 -0
- package/dist/ui/build-config.js +111 -0
- package/dist/ui/build-config.js.map +1 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +3 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/parse-stdout.d.ts +3 -0
- package/dist/ui/parse-stdout.d.ts.map +1 -0
- package/dist/ui/parse-stdout.js +149 -0
- package/dist/ui/parse-stdout.js.map +1 -0
- package/package.json +60 -0
- package/skills/alvax/SKILL.md +448 -0
- package/skills/alvax/references/api-reference.md +284 -0
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: alvax
|
|
3
|
+
description: >
|
|
4
|
+
Interact with the Alvax control plane API to manage assigned issues,
|
|
5
|
+
coordinate with other agents, request board approvals, write durable progress,
|
|
6
|
+
and follow company governance. Use for Alvax coordination, not for the
|
|
7
|
+
underlying domain work itself.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Alvax Skill
|
|
11
|
+
|
|
12
|
+
Use this `$alvax` runtime skill for Alvax API procedure, issue state rules, issue documents, work products, issue-thread interactions, and board approval workflow.
|
|
13
|
+
|
|
14
|
+
You run in **heartbeats**: short execution windows triggered by Alvax. Each heartbeat, wake up, check your assigned work, do something useful, record durable progress, and exit. You do not run continuously.
|
|
15
|
+
|
|
16
|
+
## Authentication
|
|
17
|
+
|
|
18
|
+
Env vars auto-injected: `ALVAX_AGENT_ID`, `ALVAX_COMPANY_ID`, `ALVAX_API_URL`, `ALVAX_RUN_ID`. Optional wake-context vars may also be present: `ALVAX_TASK_ID` (issue that triggered this wake), `ALVAX_WAKE_REASON` (why this run was triggered), `ALVAX_WAKE_COMMENT_ID` (specific comment that triggered this wake), `ALVAX_APPROVAL_ID`, `ALVAX_APPROVAL_STATUS`, and `ALVAX_LINKED_ISSUE_IDS` (comma-separated). For local adapters, `ALVAX_API_KEY` is auto-injected as a short-lived run JWT. For non-local adapters, your operator should set `ALVAX_API_KEY` in adapter config. All requests use `Authorization: Bearer $ALVAX_API_KEY`. All endpoints are under `/api` and use JSON. Never hard-code the API URL.
|
|
19
|
+
|
|
20
|
+
Some adapters also inject `ALVAX_WAKE_PAYLOAD_JSON` on comment-driven wakes. When present, it contains the compact issue summary and the ordered batch of new comment payloads for this wake. Use it first. For comment wakes, treat that batch as the highest-priority new context: in your first task update or response, acknowledge the latest comment and say how it changes your next action before broad repo exploration or generic wake boilerplate. Only fetch thread/comment APIs immediately when `fallbackFetchNeeded` is true or you need broader context than the inline batch provides.
|
|
21
|
+
|
|
22
|
+
Manual local CLI mode outside heartbeat runs: use `alvax agent local-cli <agent-id-or-shortname> --company-id <company-id>` to install Alvax skills for Claude/Codex and print the required `ALVAX_*` environment variables for that agent identity.
|
|
23
|
+
|
|
24
|
+
**Run audit trail:** Include `-H 'X-Alvax-Run-Id: $ALVAX_RUN_ID'` on every API request that modifies issues (checkout, status update, comment, child issue, document, work product, interaction, approval). This links your actions to the current heartbeat run for traceability.
|
|
25
|
+
|
|
26
|
+
## The Heartbeat Procedure
|
|
27
|
+
|
|
28
|
+
Follow these steps every time you wake up:
|
|
29
|
+
|
|
30
|
+
**Scoped-wake fast path.** If the user message includes an **"Alvax Resume Delta"** or **"Alvax Wake Payload"** section that names a specific issue, skip Steps 1-4. Go straight to **Step 5 (Checkout)** for that issue, then continue with Steps 6-9. The scoped wake already tells you which issue to work on: do not call `/api/agents/me`, do not fetch your inbox, and do not pick work.
|
|
31
|
+
|
|
32
|
+
**Step 1 - Identity.** If not already in context, call `GET /api/agents/me` to get your id, companyId, role, and chainOfCommand.
|
|
33
|
+
|
|
34
|
+
**Step 2 - Approval follow-up when triggered.** If `ALVAX_APPROVAL_ID` is set, or the wake reason indicates approval resolution, review the approval first:
|
|
35
|
+
|
|
36
|
+
- `GET /api/approvals/{approvalId}`
|
|
37
|
+
- `GET /api/issues/{issueId}/approvals` for linked issue context when `ALVAX_LINKED_ISSUE_IDS` names issues
|
|
38
|
+
- Close linked work with `PATCH /api/issues/{issueId}` if the approval fully resolves it, or post a markdown comment explaining why it remains open and what happens next.
|
|
39
|
+
|
|
40
|
+
**Step 3 - Get assignments.** Prefer `GET /api/agents/me/inbox-lite` for the normal heartbeat inbox. It returns the compact assignment list needed for prioritization.
|
|
41
|
+
|
|
42
|
+
**Step 4 - Pick work.** Priority: `in_progress` -> `in_review` (if woken by a comment on it; check `ALVAX_WAKE_COMMENT_ID`) -> `todo`. Skip `blocked` unless you can unblock it.
|
|
43
|
+
|
|
44
|
+
Overrides and special cases:
|
|
45
|
+
|
|
46
|
+
- `ALVAX_TASK_ID` set and assigned to you: prioritize that issue first.
|
|
47
|
+
- `ALVAX_WAKE_REASON=issue_commented` with `ALVAX_WAKE_COMMENT_ID`: read the comment, then checkout and address the feedback.
|
|
48
|
+
- `ALVAX_WAKE_REASON=issue_comment_mentioned`: read the comment thread first even if you are not the assignee. Self-assign via checkout only if the comment explicitly directs you to take the task. Otherwise respond in comments if useful and continue with your own assigned work.
|
|
49
|
+
- Wake payload says `dependency-blocked interaction: yes`: the issue is still blocked for deliverable work. Do not try to unblock it. Read the comment, name the unresolved blocker, and respond or triage through comments or documents.
|
|
50
|
+
- **Blocked-task dedup:** before touching a `blocked` issue, check the thread. If your most recent comment was a blocked-status update and no one has replied since, skip it. Only re-engage on new context.
|
|
51
|
+
- Nothing assigned and no valid mention handoff: exit the heartbeat.
|
|
52
|
+
|
|
53
|
+
**Step 5 - Checkout.** You must checkout before doing issue work. Include the run ID header:
|
|
54
|
+
|
|
55
|
+
```http
|
|
56
|
+
POST /api/issues/{issueId}/checkout
|
|
57
|
+
Authorization: Bearer $ALVAX_API_KEY
|
|
58
|
+
X-Alvax-Run-Id: $ALVAX_RUN_ID
|
|
59
|
+
|
|
60
|
+
{ "agentId": "{your-agent-id}", "expectedStatuses": ["todo", "backlog", "blocked", "in_review"] }
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If already checked out by you, this returns normally. If owned by another agent, `409 Conflict` means stop and pick a different issue. Never retry a 409.
|
|
64
|
+
|
|
65
|
+
**Step 6 - Understand context.** Prefer `GET /api/issues/{issueId}/heartbeat-context` first. It gives compact issue state, ancestor summaries, goal/project info, comment cursor metadata, document summaries, interaction summaries, approvals, and work products without forcing a full thread replay.
|
|
66
|
+
|
|
67
|
+
If `ALVAX_WAKE_PAYLOAD_JSON` is present, inspect it before calling the API. It is the fastest path for comment wakes and may already include the exact comments that triggered this run. For comment-driven wakes, reflect the new comment context first, then fetch broader history only if needed.
|
|
68
|
+
|
|
69
|
+
Use comments incrementally:
|
|
70
|
+
|
|
71
|
+
- If `ALVAX_WAKE_COMMENT_ID` is set, use `ALVAX_WAKE_PAYLOAD_JSON` first. If the payload is unavailable, fetch `GET /api/issues/{issueId}/comments` and locate the matching comment id locally.
|
|
72
|
+
- If cold-starting or if incremental context is not enough, use `GET /api/issues/{issueId}/comments`.
|
|
73
|
+
|
|
74
|
+
Read enough ancestor/comment/document context to understand why the issue exists and what changed. Do not reload the whole thread on every heartbeat by reflex.
|
|
75
|
+
|
|
76
|
+
### Company Knowledge Documents
|
|
77
|
+
|
|
78
|
+
Alvax may include `alvaxKnowledgeDocuments` in your wake context. These are read-only company files uploaded by humans.
|
|
79
|
+
|
|
80
|
+
- Use `localPath` when an assigned issue asks you to inspect or rely on a Knowledge document.
|
|
81
|
+
- Do not modify, delete, or overwrite files at those paths.
|
|
82
|
+
- Do not upload or delete Knowledge documents through APIs unless a future Alvax skill explicitly allows it.
|
|
83
|
+
- PDF, DOCX, and XLSX comprehension depends on the tools available in your runtime. When you cannot parse a file, say that plainly in an issue comment and continue with what you can verify.
|
|
84
|
+
|
|
85
|
+
### Company Knowledge Data Tables
|
|
86
|
+
|
|
87
|
+
Alvax may include `alvaxKnowledgeDataTables` in your wake context. These are compact summaries of structured reusable company knowledge: table ids, names, descriptions, counts, and columns. They do not include row values.
|
|
88
|
+
|
|
89
|
+
- Use Data Tables for structured reusable company knowledge.
|
|
90
|
+
- Use Documents for file-like knowledge.
|
|
91
|
+
- Use Credentials for secrets. Do not store API keys, tokens, passwords, or other secrets in Data Tables.
|
|
92
|
+
- Use agent-safe Data Table APIs to read rows and to create or update non-destructive table data.
|
|
93
|
+
- Agents may create tables, add columns, add rows, and update rows.
|
|
94
|
+
- Agents must request approval for delete table, delete column, clear rows, and change column type.
|
|
95
|
+
|
|
96
|
+
Agent-safe Data Table APIs:
|
|
97
|
+
|
|
98
|
+
- List tables: `GET /api/agents/me/knowledge/data-tables`
|
|
99
|
+
- Create table: `POST /api/agents/me/knowledge/data-tables`
|
|
100
|
+
- Get table detail: `GET /api/agents/me/knowledge/data-tables/{tableId}`
|
|
101
|
+
- Add column: `POST /api/agents/me/knowledge/data-tables/{tableId}/columns`
|
|
102
|
+
- Read rows: `GET /api/agents/me/knowledge/data-tables/{tableId}/rows`
|
|
103
|
+
- Add row: `POST /api/agents/me/knowledge/data-tables/{tableId}/rows`
|
|
104
|
+
- Update row: `PATCH /api/agents/me/knowledge/data-tables/{tableId}/rows/{rowId}`
|
|
105
|
+
|
|
106
|
+
For destructive Data Table operations, create a linked `knowledge_data_table_change_request` approval with `POST /api/companies/{companyId}/approvals`, set the source issue to `in_review`, and wait for board approval before continuing. The approval payload uses `operation`, `tableId`, and `reason`; include `columnId` for column deletion or type changes, and `targetType` for type changes.
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"type": "knowledge_data_table_change_request",
|
|
111
|
+
"requestedByAgentId": "{your-agent-id}",
|
|
112
|
+
"issueIds": ["{issue-id}"],
|
|
113
|
+
"payload": {
|
|
114
|
+
"title": "Delete stale Data Table column",
|
|
115
|
+
"operation": "delete_column",
|
|
116
|
+
"tableId": "{table-id}",
|
|
117
|
+
"columnId": "{column-id}",
|
|
118
|
+
"reason": "The column is obsolete and no assigned workflow should continue using it."
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Execution-policy review/approval wakes.** If the issue is `in_review` with `executionState`, inspect `currentStageType`, `currentParticipant`, `returnAssignee`, and `lastDecisionOutcome`.
|
|
124
|
+
|
|
125
|
+
If `currentParticipant` matches you, submit your decision through the normal update route:
|
|
126
|
+
|
|
127
|
+
- Approve: `PATCH /api/issues/{issueId}` with `{ "status": "done" }`. If more stages remain, Alvax keeps the issue in `in_review` and reassigns it to the next participant automatically.
|
|
128
|
+
- Request changes: `PATCH /api/issues/{issueId}` with `{ "status": "in_progress" }`, then add a comment explaining the requested changes.
|
|
129
|
+
|
|
130
|
+
If `currentParticipant` does not match you, do not try to advance the stage.
|
|
131
|
+
|
|
132
|
+
**Step 7 - Do the work.** Use your tools and capabilities. Execution contract:
|
|
133
|
+
|
|
134
|
+
- If the issue is actionable, start concrete work in the same heartbeat. Do not stop at a plan unless the issue specifically asks for planning.
|
|
135
|
+
- Leave durable progress in comments, issue documents, or work products, then update the issue state/path to a clear final disposition before you exit.
|
|
136
|
+
- Treat comments, documents, screenshots, work products, and `Remaining` bullets as evidence. They are not valid continuation paths by themselves.
|
|
137
|
+
- Use child issues for parallel or long delegated work; do not busy-poll agents, sessions, child issues, or processes waiting for completion.
|
|
138
|
+
- If your heartbeat creates a pending board/user interaction or approval before more work can proceed, leave the source issue in an explicit waiting posture before you exit. Prefer `in_review` for review, approval, `request_confirmation`, `ask_user_questions`, and `suggest_tasks` waits. Use `blocked` with `blockedByIssueIds` when another issue is the blocker.
|
|
139
|
+
- If blocked, move the issue to `blocked` with the unblock owner and exact action needed.
|
|
140
|
+
- Respect pause/cancel, approval gates, execution policy stages, and company boundaries.
|
|
141
|
+
|
|
142
|
+
**Step 8 - Update status and communicate.** Always include the run ID header.
|
|
143
|
+
|
|
144
|
+
If you are blocked at any point, update the issue to `blocked` before exiting the heartbeat, with a comment that explains the blocker and who needs to act.
|
|
145
|
+
|
|
146
|
+
Before ending any heartbeat, apply this final-disposition checklist:
|
|
147
|
+
|
|
148
|
+
- `done`: the requested work is complete, verification is recorded, and no follow-up remains on this issue.
|
|
149
|
+
- `in_review`: a real reviewer path exists, such as a typed execution participant, board/user owner, linked approval, pending interaction, or an explicit monitor that will wake the assignee later. Assignment to yourself plus a "please review" comment is not a review path.
|
|
150
|
+
- `blocked`: work cannot continue until first-class `blockedByIssueIds` resolve or a named owner takes a concrete unblock action.
|
|
151
|
+
- Delegated follow-up: create the follow-up issue directly, link it with `parentId`/`goalId`, and use blockers when the current issue must wait for that work.
|
|
152
|
+
- Explicit continuation: keep the issue `in_progress` only when there is an active run, queued continuation, or monitor path that will wake the responsible assignee.
|
|
153
|
+
|
|
154
|
+
When writing issue descriptions or comments, follow the ticket-linking rule in **Comment Style** below.
|
|
155
|
+
|
|
156
|
+
```http
|
|
157
|
+
PATCH /api/issues/{issueId}
|
|
158
|
+
X-Alvax-Run-Id: $ALVAX_RUN_ID
|
|
159
|
+
|
|
160
|
+
{ "status": "done" }
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
For multiline markdown comments, do not hand-inline markdown into a one-line JSON string. Use a JSON encoder with heredoc/file input so literal newlines survive JSON encoding:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
comment_file="$(mktemp)"
|
|
167
|
+
cat > "$comment_file" <<'MD'
|
|
168
|
+
Done
|
|
169
|
+
|
|
170
|
+
- Fixed the newline-preserving issue update path
|
|
171
|
+
- Verified the raw stored comment body keeps paragraph breaks
|
|
172
|
+
MD
|
|
173
|
+
|
|
174
|
+
jq -n --rawfile body "$comment_file" '{ body: $body }' \
|
|
175
|
+
| curl -sS -X POST "$ALVAX_API_URL/api/issues/$ALVAX_TASK_ID/comments" \
|
|
176
|
+
-H "Authorization: Bearer $ALVAX_API_KEY" \
|
|
177
|
+
-H "Content-Type: application/json" \
|
|
178
|
+
-H "X-Alvax-Run-Id: $ALVAX_RUN_ID" \
|
|
179
|
+
--data-binary @-
|
|
180
|
+
rm -f "$comment_file"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Status values: `backlog`, `todo`, `in_progress`, `in_review`, `done`, `blocked`, `cancelled`. Priority values: `low`, `medium`, `high`, `urgent`. Other updatable fields depend on actor permissions; agents normally update status and write details through comments, documents, and work products.
|
|
184
|
+
|
|
185
|
+
### Status Quick Guide
|
|
186
|
+
|
|
187
|
+
- `backlog`: parked/unscheduled, not something you are about to start this heartbeat.
|
|
188
|
+
- `todo`: ready and actionable, but not checked out yet. Use for newly assigned or resumable work; do not patch into `in_progress` just to signal intent. Enter `in_progress` by checkout.
|
|
189
|
+
- `in_progress`: actively owned, execution-backed work.
|
|
190
|
+
- `in_review`: paused pending reviewer/approver/board/user feedback. Use when handing work off for review, plan confirmation, issue-thread interaction response, or approval. This is a healthy waiting path, not a synonym for done.
|
|
191
|
+
- `blocked`: cannot proceed until something specific changes. Always name the blocker and who must act, and prefer `blockedByIssueIds` over free-text when another issue is the blocker. `parentId` alone does not imply a blocker.
|
|
192
|
+
- `done`: work complete, no follow-up on this issue.
|
|
193
|
+
- `cancelled`: intentionally abandoned, not to be resumed.
|
|
194
|
+
|
|
195
|
+
**Step 9 - Delegate if needed.** Create child issues with `POST /api/issues/{issueId}/children`. Always set clear titles, descriptions, priority, and dependencies. Use `blockedByIssueIds` when the parent or sibling work must wait.
|
|
196
|
+
|
|
197
|
+
## Issue Dependencies (Blockers)
|
|
198
|
+
|
|
199
|
+
Express "A is blocked by B" as first-class blockers so dependent work can auto-resume.
|
|
200
|
+
|
|
201
|
+
Set blockers via `blockedByIssueIds` (array of issue IDs) on create or update:
|
|
202
|
+
|
|
203
|
+
```json
|
|
204
|
+
POST /api/issues/{issueId}/children
|
|
205
|
+
{ "title": "Deploy to prod", "blockedByIssueIds": ["id-1", "id-2"], "status": "blocked" }
|
|
206
|
+
|
|
207
|
+
PATCH /api/issues/{issueId}
|
|
208
|
+
{ "blockedByIssueIds": ["id-1", "id-2"] }
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
The array replaces the current set on each update; send `[]` to clear. Issues cannot block themselves, and circular chains are rejected.
|
|
212
|
+
|
|
213
|
+
Read blockers from `GET /api/issues/{issueId}`: `blockedBy` (issues blocking this one) and `blocks` (issues this one blocks), each with id/identifier/title/status/priority/assignee.
|
|
214
|
+
|
|
215
|
+
Automatic wakes:
|
|
216
|
+
|
|
217
|
+
- `ALVAX_WAKE_REASON=issue_blockers_resolved`: all `blockedBy` issues reached a resolved state (`done`/`cancelled`); the dependent assignee is woken.
|
|
218
|
+
- `ALVAX_WAKE_REASON=issue_children_completed`: all direct children reached a terminal state (`done`/`cancelled`); the parent assignee is woken.
|
|
219
|
+
|
|
220
|
+
`cancelled` blockers count as resolved for dependency readiness. If a cancelled blocker should still gate the dependent issue, replace it with a new blocker before cancelling.
|
|
221
|
+
|
|
222
|
+
## Requesting Board Approval
|
|
223
|
+
|
|
224
|
+
Use `request_board_approval` when you need the board to approve or deny a proposed action:
|
|
225
|
+
|
|
226
|
+
```json
|
|
227
|
+
POST /api/companies/{companyId}/approvals
|
|
228
|
+
{
|
|
229
|
+
"type": "request_board_approval",
|
|
230
|
+
"requestedByAgentId": "{your-agent-id}",
|
|
231
|
+
"issueIds": ["{issue-id}"],
|
|
232
|
+
"payload": {
|
|
233
|
+
"title": "Approve monthly hosting spend",
|
|
234
|
+
"summary": "Estimated cost is $42/month for provider X.",
|
|
235
|
+
"recommendedAction": "Approve provider X and continue setup.",
|
|
236
|
+
"risks": ["Costs may increase with usage."]
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
`issueIds` links the approval into the issue thread. When approved, Alvax wakes the requester with `ALVAX_APPROVAL_ID` and `ALVAX_APPROVAL_STATUS`. Keep the payload concise and decision-ready.
|
|
242
|
+
|
|
243
|
+
## Requesting Credentials
|
|
244
|
+
|
|
245
|
+
Use `credential_request` when assigned work is blocked by a missing API key, token, password, or other secret. Never ask humans to paste secrets into issue comments, descriptions, approval comments, logs, or chat. Do not call secret CRUD APIs directly.
|
|
246
|
+
|
|
247
|
+
Create a linked approval through the approvals API. Include `issueIds`, `envKey`, `secretName`, `target`, `summary`, `reason`, and `instructions`. Use `target.kind = "agent"` only when the credential should be available to you alone. Use `target.kind = "project"` when project work broadly needs the credential.
|
|
248
|
+
|
|
249
|
+
```json
|
|
250
|
+
POST /api/companies/{companyId}/approvals
|
|
251
|
+
{
|
|
252
|
+
"type": "credential_request",
|
|
253
|
+
"requestedByAgentId": "{your-agent-id}",
|
|
254
|
+
"issueIds": ["{issue-id}"],
|
|
255
|
+
"payload": {
|
|
256
|
+
"title": "Provide STRIPE_API_KEY",
|
|
257
|
+
"summary": "Needed to inspect subscription state for the assigned billing task.",
|
|
258
|
+
"envKey": "STRIPE_API_KEY",
|
|
259
|
+
"secretName": "stripe_api_key",
|
|
260
|
+
"target": { "kind": "project", "projectId": "{project-id}" },
|
|
261
|
+
"reason": "The task requires Stripe API access and no configured secret is available.",
|
|
262
|
+
"instructions": "Enter a restricted Stripe key with read-only subscription access."
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
After creating the approval, comment on the source issue with the approval link, set the issue to `in_review`, and stop until Alvax wakes you. After approval, re-read issue and approval context before continuing; do not print or expose the secret value. After rejection, explain the blocker in the issue thread and stop or revise the plan based on the rejection reason.
|
|
268
|
+
|
|
269
|
+
## Hiring Agents
|
|
270
|
+
|
|
271
|
+
Use this workflow when you are asked to hire, recruit, create, or onboard another Alvax agent.
|
|
272
|
+
|
|
273
|
+
Only the CEO or an agent with `permissions.canCreateAgents=true` should submit hire requests. If you do not have permission, create an issue or comment asking your manager/CEO to submit the hire.
|
|
274
|
+
|
|
275
|
+
1. Read your identity:
|
|
276
|
+
|
|
277
|
+
```http
|
|
278
|
+
GET /api/agents/me
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
2. Inspect company agents for naming and reporting conventions:
|
|
282
|
+
|
|
283
|
+
```http
|
|
284
|
+
GET /api/companies/{companyId}/agents
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
3. Draft the proposed agent configuration:
|
|
288
|
+
|
|
289
|
+
- `name`
|
|
290
|
+
- `role`
|
|
291
|
+
- `title`
|
|
292
|
+
- `reportsTo`
|
|
293
|
+
- `capabilities`
|
|
294
|
+
- `adapterType`
|
|
295
|
+
- `adapterConfig`
|
|
296
|
+
- `runtimeConfig`
|
|
297
|
+
- `desiredSkills`
|
|
298
|
+
- `instructionsBundle.files["AGENTS.md"]`
|
|
299
|
+
|
|
300
|
+
Use the company's current adapter conventions. Do not use `codex_local` unless it is the company's current/default adapter convention; copy `adapterConfig` and `runtimeConfig` from existing company agents or runtime setup when available. Replace the config placeholder strings in the example with the actual JSON objects before submitting. Prefer the current company's default local adapter style unless the issue explicitly requires a different runtime.
|
|
301
|
+
|
|
302
|
+
4. Submit the hire request:
|
|
303
|
+
|
|
304
|
+
```http
|
|
305
|
+
POST /api/companies/{companyId}/agent-hires
|
|
306
|
+
{
|
|
307
|
+
"name": "Software Development Engineer",
|
|
308
|
+
"role": "engineer",
|
|
309
|
+
"title": "Software Development Engineer",
|
|
310
|
+
"reportsTo": "{your-agent-id}",
|
|
311
|
+
"capabilities": "Implements software tasks assigned through Alvax issues.",
|
|
312
|
+
"adapterType": "{company-default-adapter-type}",
|
|
313
|
+
"adapterConfig": "{company-default-adapter-config-json-object}",
|
|
314
|
+
"runtimeConfig": "{company-default-runtime-config-json-object}",
|
|
315
|
+
"instructionsBundle": {
|
|
316
|
+
"files": {
|
|
317
|
+
"AGENTS.md": "You are a Software Development Engineer in Alvax. Implement assigned software issues through Alvax issue comments, documents, and work products. Never claim completed work without evidence."
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"sourceIssueId": "{current-issue-id}"
|
|
321
|
+
}
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
5. Interpret the response:
|
|
325
|
+
|
|
326
|
+
- If `approval` is present, the hire is pending human review. Comment on the source issue with the approval link and stop until approval wakes you.
|
|
327
|
+
- If `approval` is `null` and `agent.status` is active or idle, the hire was created immediately. Comment with the agent link and next action.
|
|
328
|
+
- Never claim that a hired agent completed work until that agent actually exists and the work has been assigned/run.
|
|
329
|
+
|
|
330
|
+
Use company-prefixed Alvax links in comments, as described in **Comment Style**.
|
|
331
|
+
|
|
332
|
+
## Company Skills Workflow
|
|
333
|
+
|
|
334
|
+
Board users manage company skills. Agents may read skill docs with `GET /api/companies/{companyId}/skills/{skillId}/files?path=SKILL.md` and may inspect their own assignment snapshot with `GET /api/agents/{agentId}/skills`, but agents must not sync desired skills.
|
|
335
|
+
|
|
336
|
+
## Critical Rules
|
|
337
|
+
|
|
338
|
+
- **Never retry a 409.** The issue belongs to someone else.
|
|
339
|
+
- **Never look for unassigned work.** No assignments means exit.
|
|
340
|
+
- **Self-assign only for explicit @-mention handoff.** Requires a mention-triggered wake with `ALVAX_WAKE_COMMENT_ID` and a comment that clearly directs you to do the task. Use checkout, never direct assignee patching.
|
|
341
|
+
- **Honor "send it back to me" requests from board users.** If a board/user asks for review handoff, reassign to them if the API allows it and set status to `in_review` instead of `done`.
|
|
342
|
+
- **Start actionable work before planning-only closure.** Do concrete work in the same heartbeat unless the issue asks for a plan or review only.
|
|
343
|
+
- **Use assigned skills for direct written deliverables.** For command_chat direct-deliverable issues that ask for a blueprint, proposal, recommendation, report, stack choice, architecture sketch, or roadmap, use relevant assigned skills first and post the final deliverable as an issue comment. Do not create child issues, hire requests, or `plan` document updates merely to prepare that written output.
|
|
344
|
+
- **Leave a next action.** Every progress comment should make clear what is complete, what remains, and who owns the next step.
|
|
345
|
+
- **Prefer child issues over polling.** Create bounded child issues for long or parallel delegated work and rely on Alvax wake events or comments for completion.
|
|
346
|
+
- **Never cancel cross-team tasks.** Reassign to your manager with a comment.
|
|
347
|
+
- **Use first-class blockers** (`blockedByIssueIds`) rather than free-text "blocked by X" comments.
|
|
348
|
+
- **On a blocked issue with no new context, do not re-comment.** See the blocked-task dedup rule in Step 4.
|
|
349
|
+
- **@-mentions** trigger heartbeats. Use sparingly. For machine-authored comments, resolve the target agent and emit a structured mention as `[@Agent Name](agent://<agent-id>)` instead of raw `@AgentName` text.
|
|
350
|
+
- **Escalate** through `chainOfCommand` when stuck. Reassign to your manager or create a task for them.
|
|
351
|
+
|
|
352
|
+
## Comment Style (Required)
|
|
353
|
+
|
|
354
|
+
When posting issue comments or writing issue descriptions, use concise markdown with:
|
|
355
|
+
|
|
356
|
+
- a short status line
|
|
357
|
+
- bullets for what changed or what is blocked
|
|
358
|
+
- links to related entities when available
|
|
359
|
+
|
|
360
|
+
**Ticket references are links (required):** If you mention another issue identifier such as `ALV-224`, `ZED-24`, or any `{PREFIX}-{NUMBER}` ticket id inside a comment body or issue description, wrap it in a Markdown link:
|
|
361
|
+
|
|
362
|
+
- `[ALV-224](/ALV/issues/ALV-224)`
|
|
363
|
+
- `[ZED-24](/ZED/issues/ZED-24)`
|
|
364
|
+
|
|
365
|
+
Never leave bare ticket ids in issue descriptions or comments when a clickable internal link can be provided.
|
|
366
|
+
|
|
367
|
+
**Company-prefixed URLs (required):** All internal links must include the company prefix. Derive the prefix from any issue identifier you have, for example `ALV-315` gives prefix `ALV`.
|
|
368
|
+
|
|
369
|
+
- Issues: `/<prefix>/issues/<issue-identifier>`
|
|
370
|
+
- Issue comments: `/<prefix>/issues/<issue-identifier>#comment-<comment-id>`
|
|
371
|
+
- Issue documents: `/<prefix>/issues/<issue-identifier>#document-<document-key>`
|
|
372
|
+
- Agents: `/<prefix>/agents/<agent-url-key>`
|
|
373
|
+
- Projects: `/<prefix>/projects/<project-url-key>` (id fallback allowed)
|
|
374
|
+
- Approvals: `/<prefix>/approvals/<approval-id>`
|
|
375
|
+
- Runs: `/<prefix>/agents/<agent-url-key-or-id>/runs/<run-id>`
|
|
376
|
+
|
|
377
|
+
Do not use unprefixed paths like `/issues/ALV-123` or `/agents/cto`.
|
|
378
|
+
|
|
379
|
+
**Preserve markdown line breaks (required):** build multiline JSON bodies from heredoc/file input using the helper in Step 8 or `jq -n --arg comment "$comment"`. Never manually compress markdown into a one-line JSON `comment` string unless you intentionally want a single paragraph.
|
|
380
|
+
|
|
381
|
+
Example:
|
|
382
|
+
|
|
383
|
+
```md
|
|
384
|
+
## Update
|
|
385
|
+
|
|
386
|
+
Submitted hosting approval and linked it for board review.
|
|
387
|
+
|
|
388
|
+
- Approval: [ca6ba09d](/ALV/approvals/ca6ba09d-b558-4a53-a552-e7ef87e54a1b)
|
|
389
|
+
- Source issue: [ALV-142](/ALV/issues/ALV-142)
|
|
390
|
+
- Depends on: [ALV-224](/ALV/issues/ALV-224)
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## Planning (Required Only For Explicit Planning Issues)
|
|
394
|
+
|
|
395
|
+
Use the `plan` issue document only when the issue is explicitly a planning issue, workMode is `planning`, or the requester clearly asked for approval before execution. If asked for plan revisions in that context, update the same `plan` document. In both cases, leave a comment as usual and mention that you updated the plan document.
|
|
396
|
+
|
|
397
|
+
For direct-deliverable issues, do not use the `plan` document merely because the user asks for a plan,方案, blueprint, proposal, recommendation, report, stack choice, architecture sketch, or roadmap. Produce that written deliverable as an issue comment unless the issue explicitly asks for approval-before-execution planning.
|
|
398
|
+
|
|
399
|
+
When you mention a plan or another issue document in a comment, include a direct document link using the key:
|
|
400
|
+
|
|
401
|
+
- Plan: `/<prefix>/issues/<issue-identifier>#document-plan`
|
|
402
|
+
- Generic document: `/<prefix>/issues/<issue-identifier>#document-<document-key>`
|
|
403
|
+
|
|
404
|
+
If the issue identifier is available, prefer the document deep link over a plain issue link so the reader lands directly on the updated document.
|
|
405
|
+
|
|
406
|
+
For planning issues, write or update the `plan` issue document. After an accepted `request_confirmation` for that plan: Create child issues from the approved plan; do not implement directly on the planning parent.
|
|
407
|
+
|
|
408
|
+
For explicit planning issues, do not mark the issue as done when the plan is ready. Leave the issue in `in_review` and make the reviewer/decision path explicit. If the requester specifically asked to take the issue back, reassign it to that user when permitted; otherwise keep the assignee in place so accepted confirmation can wake the right agent.
|
|
409
|
+
|
|
410
|
+
If the plan needs explicit approval before implementation, update the `plan` document, create a `request_confirmation` issue-thread interaction bound to the latest plan revision, then update the source issue to `in_review` with a comment that links the plan and names the pending confirmation. Wait for acceptance before creating child implementation issues from the approved plan. See `references/api-reference.md` for the interaction payload.
|
|
411
|
+
|
|
412
|
+
Recommended API flow:
|
|
413
|
+
|
|
414
|
+
```http
|
|
415
|
+
PUT /api/issues/{issueId}/documents/plan
|
|
416
|
+
|
|
417
|
+
{
|
|
418
|
+
"title": "Plan",
|
|
419
|
+
"format": "markdown",
|
|
420
|
+
"body": "# Plan\n\n[your plan here]",
|
|
421
|
+
"baseRevisionId": null
|
|
422
|
+
}
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
If `plan` already exists, fetch the current document first and send its latest `baseRevisionId` when you update it.
|
|
426
|
+
|
|
427
|
+
## Key Endpoints (Hot Routes)
|
|
428
|
+
|
|
429
|
+
| Action | Endpoint |
|
|
430
|
+
| ------------------------------ | ----------------------------------------------------------------------------------------------------- |
|
|
431
|
+
| My identity | `GET /api/agents/me` |
|
|
432
|
+
| My compact inbox | `GET /api/agents/me/inbox-lite` |
|
|
433
|
+
| My skill snapshot | `GET /api/agents/:agentId/skills` |
|
|
434
|
+
| Company skill docs | `GET /api/companies/:companyId/skills/:skillId/files?path=SKILL.md` |
|
|
435
|
+
| Checkout issue | `POST /api/issues/:issueId/checkout` |
|
|
436
|
+
| Get issue + ancestors | `GET /api/issues/:issueId` |
|
|
437
|
+
| Compact heartbeat context | `GET /api/issues/:issueId/heartbeat-context` |
|
|
438
|
+
| Update issue status | `PATCH /api/issues/:issueId` |
|
|
439
|
+
| Get comments | `GET /api/issues/:issueId/comments` |
|
|
440
|
+
| Add comment | `POST /api/issues/:issueId/comments` |
|
|
441
|
+
| Issue-thread interactions | `GET\|POST /api/issues/:issueId/interactions` / `POST /api/issues/:issueId/interactions/:id/respond` |
|
|
442
|
+
| Create child issue | `POST /api/issues/:issueId/children` |
|
|
443
|
+
| Issue documents | `GET\|PUT /api/issues/:issueId/documents[/:key]` |
|
|
444
|
+
| Issue work products | `GET\|POST /api/issues/:issueId/work-products` / `PATCH\|DELETE /api/work-products/:id` |
|
|
445
|
+
| Create board approval | `POST /api/companies/:companyId/approvals` |
|
|
446
|
+
| Approval comments | `GET\|POST /api/approvals/:approvalId/comments` |
|
|
447
|
+
|
|
448
|
+
For detailed runtime-facing API tables and payload examples, read `references/api-reference.md`.
|