@typeship-ax/mcp 0.10.0 → 0.19.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 (68) hide show
  1. package/AGENTS.md +10 -4
  2. package/README.md +16 -5
  3. package/api.json +4539 -616
  4. package/api.md +3827 -673
  5. package/dist/core/http.d.ts +3 -2
  6. package/dist/core/http.d.ts.map +1 -1
  7. package/dist/core/http.js +18 -6
  8. package/dist/errors.d.ts +17 -10
  9. package/dist/errors.d.ts.map +1 -1
  10. package/dist/errors.js +24 -15
  11. package/dist/index.d.ts +7 -3
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +9 -5
  14. package/dist/mcp-protocol.d.ts +10 -6
  15. package/dist/mcp-protocol.d.ts.map +1 -1
  16. package/dist/mcp-protocol.js +108 -37
  17. package/dist/mcp.d.ts.map +1 -1
  18. package/dist/mcp.js +36 -17
  19. package/dist/ops.d.ts +4 -0
  20. package/dist/ops.d.ts.map +1 -1
  21. package/dist/ops.js +45 -35
  22. package/dist/resources/account.d.ts +4 -4
  23. package/dist/resources/account.d.ts.map +1 -1
  24. package/dist/resources/account.js +10 -5
  25. package/dist/resources/api-keys.d.ts +40 -14
  26. package/dist/resources/api-keys.d.ts.map +1 -1
  27. package/dist/resources/api-keys.js +45 -13
  28. package/dist/resources/definition-revisions.d.ts +35 -18
  29. package/dist/resources/definition-revisions.d.ts.map +1 -1
  30. package/dist/resources/definition-revisions.js +43 -15
  31. package/dist/resources/definitions.d.ts +21 -6
  32. package/dist/resources/definitions.d.ts.map +1 -1
  33. package/dist/resources/definitions.js +16 -3
  34. package/dist/resources/generate.d.ts +44 -15
  35. package/dist/resources/generate.d.ts.map +1 -1
  36. package/dist/resources/generate.js +55 -13
  37. package/dist/resources/generations.d.ts +14 -6
  38. package/dist/resources/generations.d.ts.map +1 -1
  39. package/dist/resources/generations.js +26 -5
  40. package/dist/resources/projects.d.ts +106 -53
  41. package/dist/resources/projects.d.ts.map +1 -1
  42. package/dist/resources/projects.js +78 -31
  43. package/dist/resources/targets.d.ts +240 -40
  44. package/dist/resources/targets.d.ts.map +1 -1
  45. package/dist/resources/targets.js +307 -21
  46. package/dist/schemas.d.ts.map +1 -1
  47. package/dist/schemas.js +130 -78
  48. package/dist/types.d.ts +1969 -154
  49. package/dist/types.d.ts.map +1 -1
  50. package/dist/types.js +87 -3
  51. package/package.json +3 -3
  52. package/server.json +3 -3
  53. package/src/core/http.ts +17 -6
  54. package/src/errors.ts +25 -15
  55. package/src/index.ts +9 -5
  56. package/src/mcp-protocol.ts +93 -36
  57. package/src/mcp.ts +32 -15
  58. package/src/ops.ts +49 -35
  59. package/src/resources/account.ts +11 -4
  60. package/src/resources/api-keys.ts +84 -13
  61. package/src/resources/definition-revisions.ts +74 -16
  62. package/src/resources/definitions.ts +28 -4
  63. package/src/resources/generate.ts +78 -13
  64. package/src/resources/generations.ts +31 -4
  65. package/src/resources/projects.ts +141 -39
  66. package/src/resources/targets.ts +561 -27
  67. package/src/schemas.ts +130 -78
  68. package/src/types.ts +2105 -154
@@ -1,7 +1,7 @@
1
1
  // typeship — projects resource.
2
- // Generated by typeship — https://typeship.dev — do not edit by hand.
2
+ // Generated by typeship — https://typeship.dev
3
3
  import { paginate } from "../core/pagination.js";
4
- import { BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PaymentRequiredError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
4
+ import { BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PayloadTooLargeError, PaymentRequiredError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
5
5
  export class ProjectsResource {
6
6
  _core;
7
7
  constructor(_core) {
@@ -27,6 +27,7 @@ export class ProjectsResource {
27
27
  "401": UnauthorizedError,
28
28
  "403": ForbiddenError,
29
29
  "429": RateLimitedError,
30
+ "500": InternalServerError,
30
31
  },
31
32
  idempotent: true,
32
33
  schemaKey: "projects.list",
@@ -43,10 +44,11 @@ export class ProjectsResource {
43
44
  /**
44
45
  * Create a project
45
46
  *
46
- * Stores a URL- or GitHub-sourced project. Free includes one stored project, every selected
47
- * target, and the first 25 operations, while keeping manual and automatic regeneration, history,
48
- * destination pull requests, and preview checks. Stateless POST /generate does not consume this
49
- * slot. Pro adds projects and generates every operation in the Definition.
47
+ * Creates a Project from a URL or GitHub Definition.
48
+ *
49
+ * Free includes one saved Project, all selected Targets, and the first 25 operations per Target,
50
+ * with regeneration, history, delivery pull requests, and previews. Pro supports additional
51
+ * Projects and all operations. One-shot generation does not use a Project slot.
50
52
  *
51
53
  * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
52
54
  * `POST /projects`
@@ -78,7 +80,8 @@ export class ProjectsResource {
78
80
  /**
79
81
  * Retrieve a project
80
82
  *
81
- * Returns Project-owned fields only. List Targets separately for Target and Delivery data.
83
+ * Returns the Project's settings and Definition ID. List its Targets separately to retrieve
84
+ * Target configuration and Deliveries.
82
85
  * `GET /projects/{project_id}`
83
86
  */
84
87
  async retrieve(projectId, options) {
@@ -91,6 +94,7 @@ export class ProjectsResource {
91
94
  "403": ForbiddenError,
92
95
  "404": NotFoundError,
93
96
  "429": RateLimitedError,
97
+ "500": InternalServerError,
94
98
  },
95
99
  idempotent: true,
96
100
  schemaKey: "projects.retrieve",
@@ -99,18 +103,31 @@ export class ProjectsResource {
99
103
  }
100
104
  /**
101
105
  * Delete a project
106
+ *
107
+ * A `502` response means the Project was not deleted because its release pull requests could not
108
+ * be retired. Retry deletion to finish retiring the remaining reviews. Repeating a completed
109
+ * deletion returns `404`.
110
+ * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
111
+ * and If-Match.
102
112
  * `DELETE /projects/{project_id}`
103
113
  */
104
- async delete(projectId, options) {
114
+ async delete(projectId, params, options) {
105
115
  return this._core.request({
106
116
  method: "DELETE",
107
117
  path: `/projects/${encodeURIComponent(String(projectId))}`,
108
118
  security: [{ "apiKey": [] }],
119
+ headers: {
120
+ "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
121
+ },
109
122
  errors: {
123
+ "400": BadRequestError,
110
124
  "401": UnauthorizedError,
111
125
  "403": ForbiddenError,
112
126
  "404": NotFoundError,
127
+ "412": PreconditionFailedError,
113
128
  "429": RateLimitedError,
129
+ "500": InternalServerError,
130
+ "502": BadGatewayError,
114
131
  },
115
132
  idempotent: true,
116
133
  schemaKey: "projects.delete",
@@ -119,13 +136,29 @@ export class ProjectsResource {
119
136
  }
120
137
  /**
121
138
  * Update a project
139
+ *
140
+ * Omitted fields keep their current values. A supplied config replaces the entire stored object;
141
+ * null or an empty object clears it.
142
+ * Omitting If-Match applies the update to the current resource; with If-Match, a stale ETag
143
+ * returns 412 precondition_failed without saving.
144
+ *
145
+ * A `409 target_busy` means a Target is publishing. Retrieve the Project, wait for publication to
146
+ * finish, reconcile your update, and retry.
147
+ * A `502` response means the Project was saved, but an obsolete release pull request could not be
148
+ * retired. Retrieve the Project and retry the same update to finish retiring reviews if that
149
+ * update is still desired.
150
+ * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
151
+ * and If-Match.
122
152
  * `PATCH /projects/{project_id}`
123
153
  */
124
- async update(projectId, body, options) {
154
+ async update(projectId, body, params, options) {
125
155
  return this._core.request({
126
156
  method: "PATCH",
127
157
  path: `/projects/${encodeURIComponent(String(projectId))}`,
128
158
  security: [{ "apiKey": [] }],
159
+ headers: {
160
+ "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
161
+ },
129
162
  body,
130
163
  errors: {
131
164
  "400": BadRequestError,
@@ -134,8 +167,10 @@ export class ProjectsResource {
134
167
  "403": ForbiddenError,
135
168
  "404": NotFoundError,
136
169
  "409": ConflictError,
170
+ "412": PreconditionFailedError,
137
171
  "422": UnprocessableEntityError,
138
172
  "429": RateLimitedError,
173
+ "500": InternalServerError,
139
174
  "502": BadGatewayError,
140
175
  },
141
176
  schemaKey: "projects.update",
@@ -145,10 +180,9 @@ export class ProjectsResource {
145
180
  /**
146
181
  * Analyze a project's latest Definition Revision
147
182
  *
148
- * Runs deterministic OpenAPI or GraphQL authorship checks against the latest observed immutable
149
- * Definition Revision after applying the Definition's existing patches. Diagnostics group every
150
- * affected location under a stable rule. Exact patches are included only when Typeship can derive
151
- * the change without inventing API behavior.
183
+ * Checks the latest Definition Revision after applying its saved patches. Each finding groups
184
+ * affected locations under a stable rule ID. A suggested patch is included only when the
185
+ * Definition provides enough information to determine the correction.
152
186
  * `GET /projects/{project_id}/diagnostics`
153
187
  */
154
188
  async retrieveDiagnostics(projectId, options) {
@@ -161,6 +195,7 @@ export class ProjectsResource {
161
195
  "403": ForbiddenError,
162
196
  "404": NotFoundError,
163
197
  "429": RateLimitedError,
198
+ "500": InternalServerError,
164
199
  },
165
200
  idempotent: true,
166
201
  schemaKey: "projects.retrieveDiagnostics",
@@ -170,9 +205,8 @@ export class ProjectsResource {
170
205
  /**
171
206
  * Refresh a project's Diagnostics from its configured source
172
207
  *
173
- * Fetches the complete configured source, records a new immutable revision only when content
174
- * changed, and returns its Diagnostics. This does not generate targets or consume a metered
175
- * generation.
208
+ * Fetches the configured source and returns updated Diagnostics. Creates a Definition Revision
209
+ * only when the content changes. Does not generate Targets or use a metered generation.
176
210
  *
177
211
  * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
178
212
  * `POST /projects/{project_id}/diagnostics`
@@ -186,12 +220,14 @@ export class ProjectsResource {
186
220
  "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
187
221
  },
188
222
  errors: {
223
+ "400": BadRequestError,
189
224
  "401": UnauthorizedError,
190
225
  "403": ForbiddenError,
191
226
  "404": NotFoundError,
192
227
  "409": ConflictError,
193
228
  "422": UnprocessableEntityError,
194
229
  "429": RateLimitedError,
230
+ "500": InternalServerError,
195
231
  },
196
232
  idempotencyKey: "Idempotency-Key",
197
233
  schemaKey: "projects.refreshDiagnostics",
@@ -201,9 +237,11 @@ export class ProjectsResource {
201
237
  /**
202
238
  * Apply exact, reviewed diagnostic remediations
203
239
  *
204
- * Applies only deterministic patches. Repository sources receive an updateable source pull
205
- * request; URL sources receive project overlays. Diagnostics that require API-owner intent return
206
- * 422 and include an authoring_brief in the Diagnostic instead.
240
+ * Applies reviewed patches from Diagnostics. For a repository source, opens or updates a source
241
+ * pull request. For a URL source, saves Definition patches.
242
+ *
243
+ * Findings that need an API-owner decision return `422`. Read the finding's `authoring_brief` and
244
+ * update the source instead.
207
245
  *
208
246
  * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
209
247
  * `POST /projects/{project_id}/diagnostics/remediations`
@@ -225,6 +263,7 @@ export class ProjectsResource {
225
263
  "409": ConflictError,
226
264
  "422": UnprocessableEntityError,
227
265
  "429": RateLimitedError,
266
+ "500": InternalServerError,
228
267
  },
229
268
  idempotencyKey: "Idempotency-Key",
230
269
  schemaKey: "projects.remediateDiagnostics",
@@ -234,9 +273,8 @@ export class ProjectsResource {
234
273
  /**
235
274
  * Diagnose a project's repository integrations
236
275
  *
237
- * Returns provider-neutral, machine-actionable source and destination access, Definition
238
- * readability, source-approval label setup, required status names, and the latest durable webhook
239
- * delivery. The Console renders this same result.
276
+ * Checks repository access, Definition readability, source-approval labels, and required checks.
277
+ * Includes the latest webhook delivery so you can investigate missing updates.
240
278
  * `GET /projects/{project_id}/integration-health`
241
279
  */
242
280
  async retrieveIntegrationHealth(projectId, options) {
@@ -249,6 +287,7 @@ export class ProjectsResource {
249
287
  "403": ForbiddenError,
250
288
  "404": NotFoundError,
251
289
  "429": RateLimitedError,
290
+ "500": InternalServerError,
252
291
  },
253
292
  idempotent: true,
254
293
  schemaKey: "projects.retrieveIntegrationHealth",
@@ -277,6 +316,7 @@ export class ProjectsResource {
277
316
  "403": ForbiddenError,
278
317
  "404": NotFoundError,
279
318
  "429": RateLimitedError,
319
+ "500": InternalServerError,
280
320
  },
281
321
  idempotent: true,
282
322
  schemaKey: "projects.listGenerations",
@@ -291,20 +331,23 @@ export class ProjectsResource {
291
331
  });
292
332
  }
293
333
  /**
294
- * Generate targets and open pull requests
334
+ * Start generation for active Targets
335
+ *
336
+ * Queues one Generation per active Target and returns their IDs. Retrieve each Generation until
337
+ * its status moves from `queued` to `running` and then `succeeded` or `failed`. `succeeded` means
338
+ * generated files are saved; check Delivery and Draft status separately for repository delivery
339
+ * and pull requests. A Target already queued or running is returned without starting another
340
+ * Generation. A matching Idempotency-Key replay returns the same Generations with their current
341
+ * statuses.
295
342
  *
296
- * Resolves the project's URL or GitHub source, generates every
297
- * configured delivery package, stores each result in the project's history,
298
- * and attempts to open a pull request in every configured destination.
299
- * When the complete generated tree already matches a destination, no
300
- * commit, branch, or pull request is created and that generation reports
301
- * `pr_status: no_changes`. This is the same pipeline automatic
302
- * regeneration runs after a source change.
343
+ * If the package already matches a destination and no Draft is open, delivery reports `pr_status:
344
+ * no_changes` without creating a commit, branch, or pull request. An existing Draft stays open.
345
+ * Automatic generation uses the same workflow.
303
346
  *
304
347
  * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
305
348
  * `POST /projects/{project_id}/generations`
306
349
  */
307
- async generate(projectId, params, options) {
350
+ async generate(projectId, body, params, options) {
308
351
  return this._core.request({
309
352
  method: "POST",
310
353
  path: `/projects/${encodeURIComponent(String(projectId))}/generations`,
@@ -312,15 +355,19 @@ export class ProjectsResource {
312
355
  headers: {
313
356
  "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
314
357
  },
358
+ body,
315
359
  errors: {
360
+ "400": BadRequestError,
316
361
  "401": UnauthorizedError,
317
362
  "402": PaymentRequiredError,
318
363
  "403": ForbiddenError,
319
364
  "404": NotFoundError,
320
365
  "409": ConflictError,
366
+ "413": PayloadTooLargeError,
321
367
  "422": UnprocessableEntityError,
322
368
  "429": RateLimitedError,
323
369
  "500": InternalServerError,
370
+ "502": BadGatewayError,
324
371
  },
325
372
  idempotencyKey: "Idempotency-Key",
326
373
  schemaKey: "projects.generate",