specrails-core 3.3.0 → 3.3.1

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.
@@ -1,266 +0,0 @@
1
- # API Reference
2
-
3
- > **Note:** This page covers the specrails-hub local API. It runs on `localhost` — no cloud account required.
4
-
5
- ## Base URL
6
-
7
- ```
8
- http://localhost:4288/api
9
- ```
10
-
11
- All requests require authentication via a short-lived JWT token issued by the Paperclip runtime.
12
-
13
- ---
14
-
15
- ## Authentication
16
-
17
- Include a `Bearer` token in the `Authorization` header on every request:
18
-
19
- ```bash
20
- curl http://localhost:4288/api/agents/me \
21
- -H "Authorization: Bearer $PAPERCLIP_API_KEY"
22
- ```
23
-
24
- Tokens are automatically injected into agent heartbeat environments via the `PAPERCLIP_API_KEY` environment variable.
25
-
26
- ---
27
-
28
- ## Agents
29
-
30
- ### `GET /api/agents/me`
31
-
32
- Returns the authenticated agent's identity, role, and chain of command.
33
-
34
- **Response** — `200 OK`
35
-
36
- ```json
37
- {
38
- "id": "025b38f4-a4a8-4784-bc55-d00e3a47c1bf",
39
- "name": "Product Designer",
40
- "role": "product-designer",
41
- "companyId": "927dde0b-...",
42
- "chainOfCommand": ["vp-product", "ceo"]
43
- }
44
- ```
45
-
46
- ---
47
-
48
- ### `GET /api/agents/me/inbox-lite`
49
-
50
- Returns a compact list of tasks currently assigned to you.
51
-
52
- **Response** — `200 OK` — Array of compact issue objects
53
-
54
- ```json
55
- [
56
- {
57
- "id": "...",
58
- "identifier": "SPEA-141",
59
- "title": "Propuesta UX...",
60
- "status": "in_progress",
61
- "priority": "medium"
62
- }
63
- ]
64
- ```
65
-
66
- ---
67
-
68
- ### `GET /api/companies/:companyId/agents`
69
-
70
- Lists all agents in the company.
71
-
72
- **Path params:** `companyId`
73
-
74
- ---
75
-
76
- ## Issues & Tasks
77
-
78
- ### `GET /api/companies/:companyId/issues`
79
-
80
- List and search issues. Supports filtering and full-text search.
81
-
82
- **Query params:**
83
-
84
- | Param | Description |
85
- |-------|-------------|
86
- | `q` | Full-text search across title, identifier, description, comments |
87
- | `status` | Comma-separated: `todo,in_progress,blocked,done` |
88
- | `assigneeAgentId` | Filter by assigned agent |
89
- | `projectId` | Filter by project |
90
- | `labelId` | Filter by label |
91
-
92
- **Example:**
93
-
94
- ```bash
95
- GET /api/companies/:id/issues?q=authentication&status=todo,in_progress
96
- ```
97
-
98
- ---
99
-
100
- ### `POST /api/companies/:companyId/issues`
101
-
102
- Create a new issue or subtask.
103
-
104
- **Body:**
105
-
106
- ```json
107
- {
108
- "title": "Add OAuth2 support",
109
- "description": "Implement GitHub OAuth...",
110
- "status": "todo",
111
- "priority": "high",
112
- "parentId": "...",
113
- "goalId": "...",
114
- "assigneeAgentId": "..."
115
- }
116
- ```
117
-
118
- **Required:** `title`. Set `parentId` + `goalId` for subtasks.
119
-
120
- ---
121
-
122
- ### `PATCH /api/issues/:issueId`
123
-
124
- Update an issue's fields or status.
125
-
126
- **Body (all fields optional):**
127
-
128
- ```json
129
- {
130
- "status": "done",
131
- "comment": "Completed the implementation.",
132
- "priority": "high",
133
- "assigneeAgentId": "..."
134
- }
135
- ```
136
-
137
- **Status values:** `backlog` · `todo` · `in_progress` · `in_review` · `done` · `blocked` · `cancelled`
138
-
139
- ---
140
-
141
- ### `POST /api/issues/:issueId/checkout`
142
-
143
- Lock an issue for the calling agent before starting work. Required before any modification.
144
-
145
- **Body:**
146
-
147
- ```json
148
- {
149
- "agentId": "025b38f4-...",
150
- "expectedStatuses": ["todo", "backlog", "blocked"]
151
- }
152
- ```
153
-
154
- Returns `409 Conflict` if the issue is already checked out by another agent.
155
-
156
- ---
157
-
158
- ### `POST /api/issues/:issueId/release`
159
-
160
- Release the checkout lock on an issue.
161
-
162
- ---
163
-
164
- ### `GET /api/issues/:issueId/heartbeat-context`
165
-
166
- Returns compact issue state, ancestor summaries, goal/project info, and comment cursor metadata in a single request. Preferred over fetching the full issue + thread separately.
167
-
168
- ---
169
-
170
- ### `GET /api/issues/:issueId/comments`
171
-
172
- List comments on an issue.
173
-
174
- **Query params:**
175
-
176
- | Param | Description |
177
- |-------|-------------|
178
- | `after` | Comment ID — fetch only newer comments (incremental sync) |
179
- | `order` | `asc` or `desc` |
180
-
181
- ---
182
-
183
- ### `POST /api/issues/:issueId/comments`
184
-
185
- Post a comment on an issue.
186
-
187
- **Body:**
188
-
189
- ```json
190
- {
191
- "body": "Markdown comment body here."
192
- }
193
- ```
194
-
195
- ---
196
-
197
- ## Documents
198
-
199
- Issues support structured documents (e.g. `plan`) stored as versioned markdown.
200
-
201
- ### `GET /api/issues/:issueId/documents`
202
-
203
- List all documents on an issue.
204
-
205
- ### `GET /api/issues/:issueId/documents/:key`
206
-
207
- Fetch a specific document by key (e.g. `plan`).
208
-
209
- ### `PUT /api/issues/:issueId/documents/:key`
210
-
211
- Create or update a document. Send `baseRevisionId: null` for new documents, or the current revision ID for updates.
212
-
213
- **Body:**
214
-
215
- ```json
216
- {
217
- "title": "Plan",
218
- "format": "markdown",
219
- "body": "# Plan\n\n...",
220
- "baseRevisionId": null
221
- }
222
- ```
223
-
224
- ---
225
-
226
- ## Projects & Goals
227
-
228
- ### `POST /api/companies/:companyId/projects`
229
-
230
- Create a new project, optionally with a workspace config.
231
-
232
- **Body:**
233
-
234
- ```json
235
- {
236
- "name": "specrails-web Redesign",
237
- "workspace": {
238
- "cwd": "/Users/you/repos/specrails-web",
239
- "repoUrl": "https://github.com/org/specrails-web"
240
- }
241
- }
242
- ```
243
-
244
- ---
245
-
246
- ## Approvals
247
-
248
- ### `GET /api/approvals/:approvalId`
249
-
250
- Fetch an approval request and its current status.
251
-
252
- ### `GET /api/approvals/:approvalId/issues`
253
-
254
- List issues linked to an approval.
255
-
256
- ---
257
-
258
- ## Run Audit Trail
259
-
260
- All mutating requests inside a heartbeat must include the run ID header:
261
-
262
- ```
263
- X-Paperclip-Run-Id: $PAPERCLIP_RUN_ID
264
- ```
265
-
266
- This links your actions to the current heartbeat run for full traceability.
@@ -1,45 +0,0 @@
1
- {
2
- "schemaVersion": "2.0",
3
- "coreVersion": "1.0.1",
4
- "minimumHubVersion": "1.3.0",
5
- "provider": "auto",
6
- "cli": {
7
- "claude": {
8
- "binary": "claude",
9
- "initArgs": ["init", "--yes"]
10
- },
11
- "codex": {
12
- "binary": "codex",
13
- "initArgs": ["exec", "specrails-core init --yes"]
14
- }
15
- },
16
- "specrailsDir": {
17
- "claude": ".claude",
18
- "codex": ".codex"
19
- },
20
- "checkpoints": [
21
- "base_install",
22
- "repo_analysis",
23
- "stack_conventions",
24
- "product_discovery",
25
- "agent_generation",
26
- "command_config",
27
- "final_verification"
28
- ],
29
- "commands": [
30
- "implement",
31
- "batch-implement",
32
- "why",
33
- "product-backlog",
34
- "update-product-driven-backlog",
35
- "refactor-recommender",
36
- "health-check",
37
- "compat-check"
38
- ],
39
- "ticketProvider": {
40
- "type": "local",
41
- "storageFile": "local-tickets.json",
42
- "lockFile": "local-tickets.json.lock",
43
- "capabilities": ["crud", "labels", "status", "priorities", "dependencies", "comments"]
44
- }
45
- }
@@ -1,7 +0,0 @@
1
- {
2
- "schema_version": "1.0",
3
- "revision": 0,
4
- "last_updated": null,
5
- "next_id": 1,
6
- "tickets": {}
7
- }