@typeship-ax/mcp 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.
Files changed (73) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +43 -0
  3. package/api.json +5163 -0
  4. package/api.md +512 -0
  5. package/dist/core/http.d.ts +303 -0
  6. package/dist/core/http.d.ts.map +1 -0
  7. package/dist/core/http.js +770 -0
  8. package/dist/core/pagination.d.ts +51 -0
  9. package/dist/core/pagination.d.ts.map +1 -0
  10. package/dist/core/pagination.js +154 -0
  11. package/dist/dates.d.ts +33 -0
  12. package/dist/dates.d.ts.map +1 -0
  13. package/dist/dates.js +136 -0
  14. package/dist/errors.d.ts +81 -0
  15. package/dist/errors.d.ts.map +1 -0
  16. package/dist/errors.js +103 -0
  17. package/dist/index.d.ts +92 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +86 -0
  20. package/dist/mcp-protocol.d.ts +453 -0
  21. package/dist/mcp-protocol.d.ts.map +1 -0
  22. package/dist/mcp-protocol.js +1262 -0
  23. package/dist/mcp.d.ts +5 -0
  24. package/dist/mcp.d.ts.map +1 -0
  25. package/dist/mcp.js +449 -0
  26. package/dist/ops.d.ts +115 -0
  27. package/dist/ops.d.ts.map +1 -0
  28. package/dist/ops.js +79 -0
  29. package/dist/resources/account.d.ts +18 -0
  30. package/dist/resources/account.d.ts.map +1 -0
  31. package/dist/resources/account.js +26 -0
  32. package/dist/resources/api-keys.d.ts +37 -0
  33. package/dist/resources/api-keys.d.ts.map +1 -0
  34. package/dist/resources/api-keys.js +67 -0
  35. package/dist/resources/generate.d.ts +25 -0
  36. package/dist/resources/generate.d.ts.map +1 -0
  37. package/dist/resources/generate.js +41 -0
  38. package/dist/resources/generations.d.ts +31 -0
  39. package/dist/resources/generations.d.ts.map +1 -0
  40. package/dist/resources/generations.js +56 -0
  41. package/dist/resources/projects.d.ts +110 -0
  42. package/dist/resources/projects.d.ts.map +1 -0
  43. package/dist/resources/projects.js +220 -0
  44. package/dist/resources/spec-revisions.d.ts +47 -0
  45. package/dist/resources/spec-revisions.d.ts.map +1 -0
  46. package/dist/resources/spec-revisions.js +90 -0
  47. package/dist/schemas.d.ts +6 -0
  48. package/dist/schemas.d.ts.map +1 -0
  49. package/dist/schemas.js +88 -0
  50. package/dist/types.d.ts +759 -0
  51. package/dist/types.d.ts.map +1 -0
  52. package/dist/types.js +37 -0
  53. package/dist/worker.d.ts +5 -0
  54. package/dist/worker.d.ts.map +1 -0
  55. package/dist/worker.js +12 -0
  56. package/package.json +45 -0
  57. package/src/core/http.ts +1008 -0
  58. package/src/core/pagination.ts +195 -0
  59. package/src/dates.ts +126 -0
  60. package/src/errors.ts +117 -0
  61. package/src/index.ts +153 -0
  62. package/src/mcp-protocol.ts +1451 -0
  63. package/src/mcp.ts +448 -0
  64. package/src/ops.ts +174 -0
  65. package/src/resources/account.ts +43 -0
  66. package/src/resources/api-keys.ts +105 -0
  67. package/src/resources/generate.ts +69 -0
  68. package/src/resources/generations.ts +100 -0
  69. package/src/resources/projects.ts +391 -0
  70. package/src/resources/spec-revisions.ts +150 -0
  71. package/src/schemas.ts +90 -0
  72. package/src/types.ts +825 -0
  73. package/src/worker.ts +13 -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>