@typeship-ax/cli 0.6.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/LICENSE +9 -0
- package/README.md +40 -0
- package/api.json +5163 -0
- package/api.md +512 -0
- package/dist/cli-agent.d.ts +204 -0
- package/dist/cli-agent.d.ts.map +1 -0
- package/dist/cli-agent.js +525 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +2811 -0
- package/dist/core/http.d.ts +303 -0
- package/dist/core/http.d.ts.map +1 -0
- package/dist/core/http.js +770 -0
- package/dist/core/pagination.d.ts +51 -0
- package/dist/core/pagination.d.ts.map +1 -0
- package/dist/core/pagination.js +154 -0
- package/dist/dates.d.ts +33 -0
- package/dist/dates.d.ts.map +1 -0
- package/dist/dates.js +136 -0
- package/dist/errors.d.ts +81 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +103 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +86 -0
- package/dist/ops.d.ts +115 -0
- package/dist/ops.d.ts.map +1 -0
- package/dist/ops.js +79 -0
- package/dist/resources/account.d.ts +18 -0
- package/dist/resources/account.d.ts.map +1 -0
- package/dist/resources/account.js +26 -0
- package/dist/resources/api-keys.d.ts +37 -0
- package/dist/resources/api-keys.d.ts.map +1 -0
- package/dist/resources/api-keys.js +67 -0
- package/dist/resources/generate.d.ts +25 -0
- package/dist/resources/generate.d.ts.map +1 -0
- package/dist/resources/generate.js +41 -0
- package/dist/resources/generations.d.ts +31 -0
- package/dist/resources/generations.d.ts.map +1 -0
- package/dist/resources/generations.js +56 -0
- package/dist/resources/projects.d.ts +110 -0
- package/dist/resources/projects.d.ts.map +1 -0
- package/dist/resources/projects.js +220 -0
- package/dist/resources/spec-revisions.d.ts +47 -0
- package/dist/resources/spec-revisions.d.ts.map +1 -0
- package/dist/resources/spec-revisions.js +90 -0
- package/dist/schemas.d.ts +6 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +88 -0
- package/dist/types.d.ts +759 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +37 -0
- package/package.json +43 -0
- package/src/cli-agent.ts +685 -0
- package/src/cli.ts +2695 -0
- package/src/core/http.ts +1008 -0
- package/src/core/pagination.ts +195 -0
- package/src/dates.ts +126 -0
- package/src/errors.ts +117 -0
- package/src/index.ts +153 -0
- package/src/ops.ts +174 -0
- package/src/resources/account.ts +43 -0
- package/src/resources/api-keys.ts +105 -0
- package/src/resources/generate.ts +69 -0
- package/src/resources/generations.ts +100 -0
- package/src/resources/projects.ts +391 -0
- package/src/resources/spec-revisions.ts +150 -0
- package/src/schemas.ts +90 -0
- package/src/types.ts +825 -0
package/api.md
ADDED
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
# typeship — API reference
|
|
2
|
+
|
|
3
|
+
Version 0.6.0. Generated by typeship; regenerate rather than editing.
|
|
4
|
+
|
|
5
|
+
All methods return `ApiResult<T, E>`: check `result.ok`, or `unwrap(result)` to throw typed errors.
|
|
6
|
+
|
|
7
|
+
For complete input and output schemas, use [`api.json`](./api.json), the machine-readable companion to this reference. Collapsed wire arguments below use API field names for CLI and MCP; SDK calls use the native signature shown in each heading.
|
|
8
|
+
|
|
9
|
+
## generate
|
|
10
|
+
|
|
11
|
+
### `client.generate.run(body)`
|
|
12
|
+
|
|
13
|
+
Generate a package from a spec
|
|
14
|
+
|
|
15
|
+
`POST /generate`
|
|
16
|
+
|
|
17
|
+
Stateless generation: nothing is stored. Returns the full generated
|
|
18
|
+
package as files. Works without an API key: anonymous calls generate
|
|
19
|
+
the first 25 operations, rate limited per IP address, and the
|
|
20
|
+
response's `limits` object says what was held back and where to lift
|
|
21
|
+
it; anonymous calls from a spec URL also carry `claim.url`, a link
|
|
22
|
+
that turns the run into a project once a person signs in. With a key, the free plan generates the first 25 operations and
|
|
23
|
+
paid plans generate the whole spec. A present but invalid key is a
|
|
24
|
+
401, not a downgrade to anonymous.
|
|
25
|
+
|
|
26
|
+
Safety: **write** · Authentication: **optional**
|
|
27
|
+
|
|
28
|
+
Body: `GenerateRequest` (required)
|
|
29
|
+
|
|
30
|
+
Returns: `GenerationResult`
|
|
31
|
+
Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `PayloadTooLargeError` (413), `UnprocessableEntityError` (422), `RateLimitedError` (429), `ApiResponseError` (default)
|
|
32
|
+
|
|
33
|
+
<details>
|
|
34
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"spec": {
|
|
39
|
+
"url": "https://example.com"
|
|
40
|
+
},
|
|
41
|
+
"outputs": [
|
|
42
|
+
"typescript-sdk"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
## projects
|
|
50
|
+
|
|
51
|
+
### `client.projects.list(params)`
|
|
52
|
+
|
|
53
|
+
List projects
|
|
54
|
+
|
|
55
|
+
`GET /projects`
|
|
56
|
+
|
|
57
|
+
Safety: **read** · Authentication: **required**
|
|
58
|
+
|
|
59
|
+
| Parameter | In | Type | Required | Description |
|
|
60
|
+
| --- | --- | --- | --- | --- |
|
|
61
|
+
| `limit` | query | `number` | no | Maximum number of resources to return. |
|
|
62
|
+
| `cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. |
|
|
63
|
+
|
|
64
|
+
Returns: `PagePromise<Project>` — auto-paginating (`for await` walks every page)
|
|
65
|
+
Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `RateLimitedError` (429)
|
|
66
|
+
|
|
67
|
+
<details>
|
|
68
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
</details>
|
|
75
|
+
|
|
76
|
+
### `client.projects.create(body, params)`
|
|
77
|
+
|
|
78
|
+
Create a project
|
|
79
|
+
|
|
80
|
+
`POST /projects`
|
|
81
|
+
|
|
82
|
+
Stores a URL- or GitHub-sourced project. Free includes one stored project, every selected output, and the first 25 operations, while keeping manual and automatic regeneration, history, destination pull requests, and preview checks. Stateless POST /generate does not consume this slot. Pro adds projects and the whole spec.
|
|
83
|
+
|
|
84
|
+
Safety: **write** · Authentication: **required**
|
|
85
|
+
|
|
86
|
+
| Parameter | In | Type | Required | Description |
|
|
87
|
+
| --- | --- | --- | --- | --- |
|
|
88
|
+
| `idempotencyKey` | header | `string` | no | Uniquely identifies this creation attempt. Retrying the same request with the same key returns the original response instead of creating another project. Reusing a key with different parameters returns 409. |
|
|
89
|
+
|
|
90
|
+
Body: `CreateProjectRequest` (required)
|
|
91
|
+
|
|
92
|
+
Returns: `Project`
|
|
93
|
+
Errors: `BadRequestError` (400), `UnauthorizedError` (401), `PaymentRequiredError` (402), `ForbiddenError` (403), `ConflictError` (409), `RateLimitedError` (429), `InternalServerError` (500)
|
|
94
|
+
|
|
95
|
+
<details>
|
|
96
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"name": "example",
|
|
101
|
+
"source": {
|
|
102
|
+
"kind": "url",
|
|
103
|
+
"url": "https://example.com"
|
|
104
|
+
},
|
|
105
|
+
"outputs": [
|
|
106
|
+
"typescript-sdk"
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
</details>
|
|
112
|
+
|
|
113
|
+
### `client.projects.retrieve(projectId)`
|
|
114
|
+
|
|
115
|
+
Retrieve a project
|
|
116
|
+
|
|
117
|
+
`GET /projects/{project_id}`
|
|
118
|
+
|
|
119
|
+
Safety: **read** · Authentication: **required**
|
|
120
|
+
|
|
121
|
+
| Parameter | In | Type | Required | Description |
|
|
122
|
+
| --- | --- | --- | --- | --- |
|
|
123
|
+
| `projectId` | path | `ProjectId` | yes | — |
|
|
124
|
+
|
|
125
|
+
Returns: `Project`
|
|
126
|
+
Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
|
|
127
|
+
|
|
128
|
+
<details>
|
|
129
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"project_id": "prj_4f8k2m7x9q1v6b3n"
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
</details>
|
|
138
|
+
|
|
139
|
+
### `client.projects.delete(projectId)`
|
|
140
|
+
|
|
141
|
+
Delete a project
|
|
142
|
+
|
|
143
|
+
`DELETE /projects/{project_id}`
|
|
144
|
+
|
|
145
|
+
Safety: **destructive** · Authentication: **required**
|
|
146
|
+
|
|
147
|
+
| Parameter | In | Type | Required | Description |
|
|
148
|
+
| --- | --- | --- | --- | --- |
|
|
149
|
+
| `projectId` | path | `ProjectId` | yes | — |
|
|
150
|
+
|
|
151
|
+
Returns: `DeletedProject`
|
|
152
|
+
Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
|
|
153
|
+
|
|
154
|
+
<details>
|
|
155
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"project_id": "prj_4f8k2m7x9q1v6b3n"
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
</details>
|
|
164
|
+
|
|
165
|
+
### `client.projects.update(projectId, body)`
|
|
166
|
+
|
|
167
|
+
Update a project
|
|
168
|
+
|
|
169
|
+
`PATCH /projects/{project_id}`
|
|
170
|
+
|
|
171
|
+
Safety: **write** · Authentication: **required**
|
|
172
|
+
|
|
173
|
+
| Parameter | In | Type | Required | Description |
|
|
174
|
+
| --- | --- | --- | --- | --- |
|
|
175
|
+
| `projectId` | path | `ProjectId` | yes | — |
|
|
176
|
+
|
|
177
|
+
Body: `UpdateProjectRequest` (required)
|
|
178
|
+
|
|
179
|
+
Returns: `Project`
|
|
180
|
+
Errors: `BadRequestError` (400), `UnauthorizedError` (401), `PaymentRequiredError` (402), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
|
|
181
|
+
|
|
182
|
+
<details>
|
|
183
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"project_id": "prj_4f8k2m7x9q1v6b3n"
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
</details>
|
|
192
|
+
|
|
193
|
+
### `client.projects.retrieveGithubHealth(projectId)`
|
|
194
|
+
|
|
195
|
+
Diagnose a project's GitHub integration
|
|
196
|
+
|
|
197
|
+
`GET /projects/{project_id}/github`
|
|
198
|
+
|
|
199
|
+
Returns machine-actionable source and destination access, spec readability, optional label setup, required status names, and the latest durable webhook delivery. The console renders this same result.
|
|
200
|
+
|
|
201
|
+
Safety: **read** · Authentication: **required**
|
|
202
|
+
|
|
203
|
+
| Parameter | In | Type | Required | Description |
|
|
204
|
+
| --- | --- | --- | --- | --- |
|
|
205
|
+
| `projectId` | path | `ProjectId` | yes | — |
|
|
206
|
+
|
|
207
|
+
Returns: `GithubIntegrationHealth`
|
|
208
|
+
Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
|
|
209
|
+
|
|
210
|
+
<details>
|
|
211
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"project_id": "prj_4f8k2m7x9q1v6b3n"
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
</details>
|
|
220
|
+
|
|
221
|
+
### `client.projects.listGenerations(projectId, params)`
|
|
222
|
+
|
|
223
|
+
List a project's generations
|
|
224
|
+
|
|
225
|
+
`GET /projects/{project_id}/generations`
|
|
226
|
+
|
|
227
|
+
Safety: **read** · Authentication: **required**
|
|
228
|
+
|
|
229
|
+
| Parameter | In | Type | Required | Description |
|
|
230
|
+
| --- | --- | --- | --- | --- |
|
|
231
|
+
| `projectId` | path | `ProjectId` | yes | — |
|
|
232
|
+
| `limit` | query | `number` | no | Maximum number of resources to return. |
|
|
233
|
+
| `cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. |
|
|
234
|
+
| `output` | query | `OutputId` | no | Only generations for this output. |
|
|
235
|
+
|
|
236
|
+
Returns: `PagePromise<Generation>` — auto-paginating (`for await` walks every page)
|
|
237
|
+
Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
|
|
238
|
+
|
|
239
|
+
<details>
|
|
240
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
241
|
+
|
|
242
|
+
```json
|
|
243
|
+
{
|
|
244
|
+
"project_id": "prj_4f8k2m7x9q1v6b3n"
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
</details>
|
|
249
|
+
|
|
250
|
+
### `client.projects.generate(projectId)`
|
|
251
|
+
|
|
252
|
+
Generate outputs and open pull requests
|
|
253
|
+
|
|
254
|
+
`POST /projects/{project_id}/generations`
|
|
255
|
+
|
|
256
|
+
Resolves the project's URL or repository source, generates every
|
|
257
|
+
configured delivery package, stores each result in the project's history,
|
|
258
|
+
and attempts to open a pull request in every configured destination.
|
|
259
|
+
When the complete generated tree already matches a destination, no
|
|
260
|
+
commit, branch, or pull request is created and that generation reports
|
|
261
|
+
`pr_status: no_changes`. This is the same pipeline automatic
|
|
262
|
+
regeneration runs after a source change.
|
|
263
|
+
|
|
264
|
+
Safety: **write** · Authentication: **required**
|
|
265
|
+
|
|
266
|
+
| Parameter | In | Type | Required | Description |
|
|
267
|
+
| --- | --- | --- | --- | --- |
|
|
268
|
+
| `projectId` | path | `ProjectId` | yes | — |
|
|
269
|
+
|
|
270
|
+
Returns: `GenerationBatch`
|
|
271
|
+
Errors: `UnauthorizedError` (401), `PaymentRequiredError` (402), `ForbiddenError` (403), `NotFoundError` (404), `UnprocessableEntityError` (422), `RateLimitedError` (429), `InternalServerError` (500)
|
|
272
|
+
|
|
273
|
+
<details>
|
|
274
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
275
|
+
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"project_id": "prj_4f8k2m7x9q1v6b3n"
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
</details>
|
|
283
|
+
|
|
284
|
+
## generations
|
|
285
|
+
|
|
286
|
+
### `client.generations.retrieve(generationId)`
|
|
287
|
+
|
|
288
|
+
Retrieve a generation
|
|
289
|
+
|
|
290
|
+
`GET /generations/{generation_id}`
|
|
291
|
+
|
|
292
|
+
Includes the generated files when the generation succeeded.
|
|
293
|
+
|
|
294
|
+
Safety: **read** · Authentication: **required**
|
|
295
|
+
|
|
296
|
+
| Parameter | In | Type | Required | Description |
|
|
297
|
+
| --- | --- | --- | --- | --- |
|
|
298
|
+
| `generationId` | path | `GenerationId` | yes | — |
|
|
299
|
+
|
|
300
|
+
Returns: `Generation`
|
|
301
|
+
Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
|
|
302
|
+
|
|
303
|
+
<details>
|
|
304
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
305
|
+
|
|
306
|
+
```json
|
|
307
|
+
{
|
|
308
|
+
"generation_id": "gen_7h2p5d9c3m8w1k6q"
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
</details>
|
|
313
|
+
|
|
314
|
+
### `client.generations.retrieveFile(generationId, params)`
|
|
315
|
+
|
|
316
|
+
Fetch one file from a generation
|
|
317
|
+
|
|
318
|
+
`GET /generations/{generation_id}/file`
|
|
319
|
+
|
|
320
|
+
Raw file content, for generations whose output was too large to inline (files_omitted true). The generation's files_index lists valid paths.
|
|
321
|
+
|
|
322
|
+
Safety: **read** · Authentication: **required**
|
|
323
|
+
|
|
324
|
+
| Parameter | In | Type | Required | Description |
|
|
325
|
+
| --- | --- | --- | --- | --- |
|
|
326
|
+
| `generationId` | path | `GenerationId` | yes | — |
|
|
327
|
+
| `path` | query | `string` | yes | Repo-relative path inside the generated package. |
|
|
328
|
+
|
|
329
|
+
Returns: `string`
|
|
330
|
+
Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
|
|
331
|
+
|
|
332
|
+
<details>
|
|
333
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
334
|
+
|
|
335
|
+
```json
|
|
336
|
+
{
|
|
337
|
+
"generation_id": "gen_7h2p5d9c3m8w1k6q",
|
|
338
|
+
"path": "openapi.yaml"
|
|
339
|
+
}
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
</details>
|
|
343
|
+
|
|
344
|
+
## specRevisions
|
|
345
|
+
|
|
346
|
+
### `client.specRevisions.list(projectId, params)`
|
|
347
|
+
|
|
348
|
+
List specification revisions
|
|
349
|
+
|
|
350
|
+
`GET /projects/{project_id}/spec_revisions`
|
|
351
|
+
|
|
352
|
+
Immutable snapshots of the exact source text this project consumed, newest first. Raw content is available from each revision's content endpoint and is never embedded in a list response.
|
|
353
|
+
|
|
354
|
+
Safety: **read** · Authentication: **required**
|
|
355
|
+
|
|
356
|
+
| Parameter | In | Type | Required | Description |
|
|
357
|
+
| --- | --- | --- | --- | --- |
|
|
358
|
+
| `projectId` | path | `ProjectId` | yes | — |
|
|
359
|
+
| `limit` | query | `number` | no | Maximum number of resources to return. |
|
|
360
|
+
| `cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. |
|
|
361
|
+
|
|
362
|
+
Returns: `PagePromise<SpecRevision>` — auto-paginating (`for await` walks every page)
|
|
363
|
+
Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
|
|
364
|
+
|
|
365
|
+
<details>
|
|
366
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
367
|
+
|
|
368
|
+
```json
|
|
369
|
+
{
|
|
370
|
+
"project_id": "prj_4f8k2m7x9q1v6b3n"
|
|
371
|
+
}
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
</details>
|
|
375
|
+
|
|
376
|
+
### `client.specRevisions.retrieve(specRevisionId)`
|
|
377
|
+
|
|
378
|
+
Retrieve a specification revision
|
|
379
|
+
|
|
380
|
+
`GET /spec_revisions/{spec_revision_id}`
|
|
381
|
+
|
|
382
|
+
Metadata for one immutable source snapshot. Fetch raw source text from the content endpoint so metadata responses stay small and predictable.
|
|
383
|
+
|
|
384
|
+
Safety: **read** · Authentication: **required**
|
|
385
|
+
|
|
386
|
+
| Parameter | In | Type | Required | Description |
|
|
387
|
+
| --- | --- | --- | --- | --- |
|
|
388
|
+
| `specRevisionId` | path | `SpecRevisionId` | yes | — |
|
|
389
|
+
|
|
390
|
+
Returns: `SpecRevision`
|
|
391
|
+
Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
|
|
392
|
+
|
|
393
|
+
<details>
|
|
394
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
395
|
+
|
|
396
|
+
```json
|
|
397
|
+
{
|
|
398
|
+
"spec_revision_id": "spec_6m1q8v4k2p9d7h3c"
|
|
399
|
+
}
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
</details>
|
|
403
|
+
|
|
404
|
+
### `client.specRevisions.retrieveContent(specRevisionId)`
|
|
405
|
+
|
|
406
|
+
Retrieve a specification revision's raw text
|
|
407
|
+
|
|
408
|
+
`GET /spec_revisions/{spec_revision_id}/content`
|
|
409
|
+
|
|
410
|
+
Returns the exact source text identified by the revision's SHA-256 digest, suitable for saving or piping directly into a diff.
|
|
411
|
+
|
|
412
|
+
Safety: **read** · Authentication: **required**
|
|
413
|
+
|
|
414
|
+
| Parameter | In | Type | Required | Description |
|
|
415
|
+
| --- | --- | --- | --- | --- |
|
|
416
|
+
| `specRevisionId` | path | `SpecRevisionId` | yes | — |
|
|
417
|
+
|
|
418
|
+
Returns: `string`
|
|
419
|
+
Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
|
|
420
|
+
|
|
421
|
+
<details>
|
|
422
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
423
|
+
|
|
424
|
+
```json
|
|
425
|
+
{
|
|
426
|
+
"spec_revision_id": "spec_6m1q8v4k2p9d7h3c"
|
|
427
|
+
}
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
</details>
|
|
431
|
+
|
|
432
|
+
## account
|
|
433
|
+
|
|
434
|
+
### `client.account.retrieve()`
|
|
435
|
+
|
|
436
|
+
The account behind the presented credentials
|
|
437
|
+
|
|
438
|
+
`GET /me`
|
|
439
|
+
|
|
440
|
+
Returns the account that owns the presented API key. This is also the
|
|
441
|
+
identity endpoint the generated typeship CLI's `whoami` calls.
|
|
442
|
+
|
|
443
|
+
Safety: **read** · Authentication: **required**
|
|
444
|
+
|
|
445
|
+
Returns: `Account`
|
|
446
|
+
Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `RateLimitedError` (429)
|
|
447
|
+
|
|
448
|
+
<details>
|
|
449
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
450
|
+
|
|
451
|
+
```json
|
|
452
|
+
{}
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
</details>
|
|
456
|
+
|
|
457
|
+
## apiKeys
|
|
458
|
+
|
|
459
|
+
### `client.apiKeys.list(params)`
|
|
460
|
+
|
|
461
|
+
List API keys
|
|
462
|
+
|
|
463
|
+
`GET /api_keys`
|
|
464
|
+
|
|
465
|
+
Keys are never returned in full — only their identity and last four. Creation stays in the console deliberately: a leaked key that can mint more keys is a leaked account.
|
|
466
|
+
|
|
467
|
+
Safety: **read** · Authentication: **required**
|
|
468
|
+
|
|
469
|
+
| Parameter | In | Type | Required | Description |
|
|
470
|
+
| --- | --- | --- | --- | --- |
|
|
471
|
+
| `limit` | query | `number` | no | Maximum number of resources to return. |
|
|
472
|
+
| `cursor` | query | `string` | no | Opaque cursor from the preceding page's next_cursor. |
|
|
473
|
+
|
|
474
|
+
Returns: `PagePromise<ApiKey>` — auto-paginating (`for await` walks every page)
|
|
475
|
+
Errors: `BadRequestError` (400), `UnauthorizedError` (401), `ForbiddenError` (403), `RateLimitedError` (429)
|
|
476
|
+
|
|
477
|
+
<details>
|
|
478
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
479
|
+
|
|
480
|
+
```json
|
|
481
|
+
{}
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
</details>
|
|
485
|
+
|
|
486
|
+
### `client.apiKeys.revoke(apiKeyId)`
|
|
487
|
+
|
|
488
|
+
Revoke an API key
|
|
489
|
+
|
|
490
|
+
`DELETE /api_keys/{api_key_id}`
|
|
491
|
+
|
|
492
|
+
Idempotent: revoking an already-revoked key returns the same body, so a rotation script that re-runs does not have to special-case having already succeeded.
|
|
493
|
+
|
|
494
|
+
Safety: **destructive** · Authentication: **required**
|
|
495
|
+
|
|
496
|
+
| Parameter | In | Type | Required | Description |
|
|
497
|
+
| --- | --- | --- | --- | --- |
|
|
498
|
+
| `apiKeyId` | path | `string` | yes | — |
|
|
499
|
+
|
|
500
|
+
Returns: `ApiKey`
|
|
501
|
+
Errors: `UnauthorizedError` (401), `ForbiddenError` (403), `NotFoundError` (404), `RateLimitedError` (429)
|
|
502
|
+
|
|
503
|
+
<details>
|
|
504
|
+
<summary>Wire arguments (CLI and MCP)</summary>
|
|
505
|
+
|
|
506
|
+
```json
|
|
507
|
+
{
|
|
508
|
+
"api_key_id": "api_key_123"
|
|
509
|
+
}
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
</details>
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable codes an agent can branch on. The message is for people; the code
|
|
3
|
+
* is the contract. Additive only.
|
|
4
|
+
*/
|
|
5
|
+
export type IssueCode = "NO_AUTH" | "AUTH_INVALID" | "PLAN_LIMIT" | "NOT_FOUND" | "INVALID_REQUEST" | "SPEC_INVALID" | "RATE_LIMITED" | "SERVER_ERROR" | "NETWORK_ERROR" | "VALIDATION_FAILED" | "TTY_REQUIRED" | "CONFIRMATION_REQUIRED" | "INVALID_USAGE" | "UNKNOWN_COMMAND" | "UNKNOWN_FLAG" | "MISSING_ARGUMENT" | "COMMAND_FAILED";
|
|
6
|
+
export interface Issue {
|
|
7
|
+
code: IssueCode;
|
|
8
|
+
message: string;
|
|
9
|
+
}
|
|
10
|
+
export interface Envelope {
|
|
11
|
+
/** error: it failed. action_required: it stopped on purpose and next_steps says what unblocks it. */
|
|
12
|
+
status: "error" | "action_required";
|
|
13
|
+
issues: Issue[];
|
|
14
|
+
/** Where to read more; the docs site when one is configured. */
|
|
15
|
+
docs_url?: string;
|
|
16
|
+
/** Ordered, concrete, copy-pastable. Empty when there is nothing to suggest. */
|
|
17
|
+
next_steps: string[];
|
|
18
|
+
/** The API's own error body, the transport error, or the validation violations. */
|
|
19
|
+
detail?: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface EnvelopeInput {
|
|
22
|
+
status?: Envelope["status"];
|
|
23
|
+
code: IssueCode;
|
|
24
|
+
message: string;
|
|
25
|
+
docsUrl?: string | null;
|
|
26
|
+
nextSteps?: string[];
|
|
27
|
+
detail?: unknown;
|
|
28
|
+
}
|
|
29
|
+
export declare function envelope(input: EnvelopeInput): Envelope;
|
|
30
|
+
/** Exit code convention: 0 ok, 1 the request or command failed, 2 usage. */
|
|
31
|
+
export declare function exitCodeFor(code: IssueCode): 1 | 2;
|
|
32
|
+
/** Interpret an SDK error result: HTTP status, body, transport, validation. */
|
|
33
|
+
export declare function classifyApiError(error: unknown, context: {
|
|
34
|
+
bin: string;
|
|
35
|
+
hadCredential: boolean;
|
|
36
|
+
docsUrl: string | null;
|
|
37
|
+
}): EnvelopeInput;
|
|
38
|
+
export interface AgentModeInput {
|
|
39
|
+
flagMode: string | boolean | undefined;
|
|
40
|
+
envMode: string | undefined;
|
|
41
|
+
stdoutIsTTY: boolean;
|
|
42
|
+
stdinIsTTY: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* --mode agent beats <PREFIX>_MODE=agent beats "no terminal on either end".
|
|
46
|
+
* In agent mode nothing prompts, browsers are not opened, and every stop is
|
|
47
|
+
* an action_required envelope with next_steps.
|
|
48
|
+
*/
|
|
49
|
+
export declare function agentMode(input: AgentModeInput): boolean;
|
|
50
|
+
/** Which agent harness is running us, from its environment; analytics and AGENTS.md placement only. */
|
|
51
|
+
export declare function detectHarness(env?: NodeJS.ProcessEnv): string | null;
|
|
52
|
+
export type McpClientId = "claude-code" | "cursor" | "codex" | "vscode" | "windsurf" | "gemini-cli" | "opencode" | "zed" | "claude-desktop";
|
|
53
|
+
export interface McpEntry {
|
|
54
|
+
/** A hosted endpoint: {type:"http", url, headers?} */
|
|
55
|
+
url?: string;
|
|
56
|
+
/** Header name → value; values may be env references like ${VAR}. */
|
|
57
|
+
headers?: Record<string, string>;
|
|
58
|
+
/** A local stdio server: command + args. */
|
|
59
|
+
command?: string;
|
|
60
|
+
args?: string[];
|
|
61
|
+
env?: Record<string, string>;
|
|
62
|
+
}
|
|
63
|
+
export interface McpClient {
|
|
64
|
+
id: McpClientId;
|
|
65
|
+
label: string;
|
|
66
|
+
/** Where the config lives; project-scoped clients resolve against cwd. */
|
|
67
|
+
file: (cwd: string) => string;
|
|
68
|
+
/** Presence test: is this client on the machine (or in this project)? */
|
|
69
|
+
detect: (cwd: string) => boolean;
|
|
70
|
+
/** Merge an entry into the file's contents. */
|
|
71
|
+
write: (existing: string, name: string, entry: McpEntry) => string;
|
|
72
|
+
/** True when the client cannot speak the current MCP protocol; skipped by --all. */
|
|
73
|
+
incompatible?: string;
|
|
74
|
+
}
|
|
75
|
+
export declare const MCP_CLIENTS: McpClient[];
|
|
76
|
+
export declare function findMcpClient(id: string): McpClient | undefined;
|
|
77
|
+
export interface McpWriteResult {
|
|
78
|
+
client: McpClientId;
|
|
79
|
+
file: string;
|
|
80
|
+
written: boolean;
|
|
81
|
+
note?: string;
|
|
82
|
+
}
|
|
83
|
+
/** Merge the entry into one client's config file. Never writes a literal secret: callers pass env references. */
|
|
84
|
+
export declare function writeMcpConfig(client: McpClient, cwd: string, name: string, entry: McpEntry): McpWriteResult;
|
|
85
|
+
/** Does a client's config already mention this server? For doctor. */
|
|
86
|
+
export declare function mcpConfigured(client: McpClient, cwd: string, name: string): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Upsert a marked block into a repo's agent instructions. Idempotent: the
|
|
89
|
+
* block between the markers is replaced, everything else is untouched, and
|
|
90
|
+
* a missing file is created. Returns the file written and whether the
|
|
91
|
+
* block already existed.
|
|
92
|
+
*/
|
|
93
|
+
export declare function upsertAgentBlock(file: string, marker: string, body: string): {
|
|
94
|
+
file: string;
|
|
95
|
+
updated: boolean;
|
|
96
|
+
};
|
|
97
|
+
/** AGENTS.md by default; CLAUDE.md when only it exists, or when running under Claude Code and AGENTS.md is absent. */
|
|
98
|
+
export declare function agentInstructionsFile(cwd: string, harness: string | null): string;
|
|
99
|
+
export interface CommandFlagSummary {
|
|
100
|
+
flag: string;
|
|
101
|
+
/** string | number | boolean | array | object | json | file */
|
|
102
|
+
type: string;
|
|
103
|
+
/** Element type of an array flag. */
|
|
104
|
+
items?: {
|
|
105
|
+
type: string;
|
|
106
|
+
enum?: string[];
|
|
107
|
+
};
|
|
108
|
+
enum?: string[];
|
|
109
|
+
required: boolean;
|
|
110
|
+
description?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface CommandSummary {
|
|
113
|
+
resource: string;
|
|
114
|
+
command: string;
|
|
115
|
+
method: string;
|
|
116
|
+
path: string;
|
|
117
|
+
summary?: string;
|
|
118
|
+
paginated: boolean;
|
|
119
|
+
destructive: boolean;
|
|
120
|
+
/** required | optional | none — what the spec's security says. */
|
|
121
|
+
auth?: "required" | "optional" | "none";
|
|
122
|
+
flags: CommandFlagSummary[];
|
|
123
|
+
}
|
|
124
|
+
export interface AgentContext {
|
|
125
|
+
bin: string;
|
|
126
|
+
pkg: string;
|
|
127
|
+
apiTitle: string;
|
|
128
|
+
version: string;
|
|
129
|
+
envPrefix: string;
|
|
130
|
+
authEnvVars: string[];
|
|
131
|
+
docsUrl: string | null;
|
|
132
|
+
/** The API's hosted MCP endpoint, when it has one. */
|
|
133
|
+
mcpUrl: string | null;
|
|
134
|
+
/** Skills repository (owner/name) an agent can install with npx skills add. */
|
|
135
|
+
skillsRepo: string | null;
|
|
136
|
+
hasMcp: boolean;
|
|
137
|
+
builtins: string[];
|
|
138
|
+
}
|
|
139
|
+
/** One line per command, pipe-delimited: the compact index that goes into AGENTS.md. */
|
|
140
|
+
/** string, number, usd|eur, string[], usd|eur[], object, json — the type as a reader expects it. */
|
|
141
|
+
export declare function flagTypeLabel(f: CommandFlagSummary): string;
|
|
142
|
+
export declare function compactIndex(commands: CommandSummary[]): string;
|
|
143
|
+
/** The AGENTS.md block body. */
|
|
144
|
+
export declare function agentBlock(ctx: AgentContext, commands: CommandSummary[]): string;
|
|
145
|
+
/** What `agent-guide --format json` returns. */
|
|
146
|
+
export declare function agentGuide(ctx: AgentContext, commands: CommandSummary[]): Record<string, unknown>;
|
|
147
|
+
export interface SkillsInstallResult {
|
|
148
|
+
status: "installed" | "skipped" | "failed";
|
|
149
|
+
repo: string | null;
|
|
150
|
+
detail?: string;
|
|
151
|
+
}
|
|
152
|
+
/** Install a skills repository through the skills CLI (npx skills add). Best effort: init reports, never fails on it. */
|
|
153
|
+
export declare function installSkills(repo: string | null, options?: {
|
|
154
|
+
global?: boolean;
|
|
155
|
+
agent?: string | null;
|
|
156
|
+
}): SkillsInstallResult;
|
|
157
|
+
/**
|
|
158
|
+
* A response that carries files: an array property whose items have string
|
|
159
|
+
* `path` and `content`. typeship's own generate call is one; any API that
|
|
160
|
+
* returns generated or exported files is another. `--out <dir>` writes them.
|
|
161
|
+
*/
|
|
162
|
+
export declare function bundleProperty(outputSchema: Record<string, unknown> | undefined): string | null;
|
|
163
|
+
/** A non-page response whose result is a collection wrapped in one array
|
|
164
|
+
* property (`{data: [...]}` is the common shape). `--fields` applies to
|
|
165
|
+
* each item while preserving that envelope, just as it does for pages. */
|
|
166
|
+
export declare function collectionProperty(outputSchema: Record<string, unknown> | undefined): string | null;
|
|
167
|
+
export declare function writeBundle(dir: string, files: {
|
|
168
|
+
path: string;
|
|
169
|
+
content: string;
|
|
170
|
+
}[]): {
|
|
171
|
+
dir: string;
|
|
172
|
+
written: number;
|
|
173
|
+
paths: string[];
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* A response that carries a claim: an object property `claim` with a string
|
|
177
|
+
* `url` (typeship's anonymous generate is one). The CLI tells the person
|
|
178
|
+
* where to claim and leaves a breadcrumb in the working directory so a
|
|
179
|
+
* later session (or `doctor`) can list what is still unclaimed.
|
|
180
|
+
*/
|
|
181
|
+
export declare function claimProperty(outputSchema: Record<string, unknown> | undefined): boolean;
|
|
182
|
+
export interface ClaimBreadcrumb {
|
|
183
|
+
url: string;
|
|
184
|
+
expires_at?: string;
|
|
185
|
+
command: string;
|
|
186
|
+
created_at: string;
|
|
187
|
+
}
|
|
188
|
+
export declare function breadcrumbFile(cwd: string, bin: string): string;
|
|
189
|
+
/** Append a claim to .<bin>/claims.json (git-ignored when a .gitignore exists). */
|
|
190
|
+
export declare function recordClaim(cwd: string, bin: string, crumb: ClaimBreadcrumb): string;
|
|
191
|
+
/** Claims on file that have not expired. */
|
|
192
|
+
export declare function pendingClaims(cwd: string, bin: string): ClaimBreadcrumb[];
|
|
193
|
+
export interface DoctorCheck {
|
|
194
|
+
name: string;
|
|
195
|
+
ok: boolean;
|
|
196
|
+
detail?: string;
|
|
197
|
+
fix?: string;
|
|
198
|
+
}
|
|
199
|
+
export declare function summarizeDoctor(checks: DoctorCheck[]): {
|
|
200
|
+
status: "ok" | "action_required";
|
|
201
|
+
checks: DoctorCheck[];
|
|
202
|
+
next_steps: string[];
|
|
203
|
+
};
|
|
204
|
+
//# sourceMappingURL=cli-agent.d.ts.map
|