@typeship-ax/cli 0.6.0 → 0.8.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 (78) hide show
  1. package/api.json +5597 -3010
  2. package/api.md +433 -54
  3. package/dist/cli-agent.d.ts +9 -1
  4. package/dist/cli-agent.d.ts.map +1 -1
  5. package/dist/cli-agent.js +26 -9
  6. package/dist/cli.js +83 -232
  7. package/dist/core/http.d.ts +6 -92
  8. package/dist/core/http.d.ts.map +1 -1
  9. package/dist/core/http.js +70 -209
  10. package/dist/core/pagination.d.ts.map +1 -1
  11. package/dist/core/pagination.js +6 -34
  12. package/dist/dates.d.ts +0 -2
  13. package/dist/dates.d.ts.map +1 -1
  14. package/dist/dates.js +0 -1
  15. package/dist/docs.d.ts +11 -0
  16. package/dist/docs.d.ts.map +1 -0
  17. package/dist/docs.js +114 -0
  18. package/dist/errors.d.ts +27 -27
  19. package/dist/errors.d.ts.map +1 -1
  20. package/dist/errors.js +7 -7
  21. package/dist/index.d.ts +19 -11
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +23 -13
  24. package/dist/ops.d.ts +5 -0
  25. package/dist/ops.d.ts.map +1 -1
  26. package/dist/ops.js +31 -17
  27. package/dist/resources/account.d.ts +2 -2
  28. package/dist/resources/account.d.ts.map +1 -1
  29. package/dist/resources/api-keys.d.ts +10 -5
  30. package/dist/resources/api-keys.d.ts.map +1 -1
  31. package/dist/resources/api-keys.js +3 -1
  32. package/dist/resources/definition-revisions.d.ts +58 -0
  33. package/dist/resources/definition-revisions.d.ts.map +1 -0
  34. package/dist/resources/definition-revisions.js +110 -0
  35. package/dist/resources/definitions.d.ts +24 -0
  36. package/dist/resources/definitions.d.ts.map +1 -0
  37. package/dist/resources/definitions.js +51 -0
  38. package/dist/resources/generate.d.ts +5 -5
  39. package/dist/resources/generate.d.ts.map +1 -1
  40. package/dist/resources/generate.js +3 -3
  41. package/dist/resources/generations.d.ts +3 -3
  42. package/dist/resources/generations.d.ts.map +1 -1
  43. package/dist/resources/generations.js +1 -1
  44. package/dist/resources/projects.d.ts +66 -26
  45. package/dist/resources/projects.d.ts.map +1 -1
  46. package/dist/resources/projects.js +87 -13
  47. package/dist/resources/targets.d.ts +86 -0
  48. package/dist/resources/targets.d.ts.map +1 -0
  49. package/dist/resources/targets.js +184 -0
  50. package/dist/schemas.d.ts.map +1 -1
  51. package/dist/schemas.js +119 -62
  52. package/dist/types.d.ts +1761 -222
  53. package/dist/types.d.ts.map +1 -1
  54. package/dist/types.js +9 -3
  55. package/package.json +1 -1
  56. package/src/cli-agent.ts +28 -11
  57. package/src/cli.ts +89 -233
  58. package/src/core/http.ts +75 -293
  59. package/src/core/pagination.ts +6 -30
  60. package/src/dates.ts +0 -1
  61. package/src/docs.ts +101 -0
  62. package/src/errors.ts +30 -30
  63. package/src/index.ts +23 -13
  64. package/src/ops.ts +43 -17
  65. package/src/resources/account.ts +3 -3
  66. package/src/resources/api-keys.ts +22 -7
  67. package/src/resources/definition-revisions.ts +198 -0
  68. package/src/resources/definitions.ts +97 -0
  69. package/src/resources/generate.ts +6 -6
  70. package/src/resources/generations.ts +4 -4
  71. package/src/resources/projects.ts +182 -37
  72. package/src/resources/targets.ts +346 -0
  73. package/src/schemas.ts +119 -62
  74. package/src/types.ts +1947 -281
  75. package/dist/resources/spec-revisions.d.ts +0 -47
  76. package/dist/resources/spec-revisions.d.ts.map +0 -1
  77. package/dist/resources/spec-revisions.js +0 -90
  78. package/src/resources/spec-revisions.ts +0 -150
package/dist/types.d.ts CHANGED
@@ -2,25 +2,37 @@
2
2
  export type ProjectId = string;
3
3
  /** Unique identifier for a generation. */
4
4
  export type GenerationId = string;
5
- /** Unique identifier for an immutable specification revision. */
6
- export type SpecRevisionId = string;
7
- /** Identifier used to correlate an API error with Typeship logs. */
5
+ /** Unique identifier for a project's logical API Definition. */
6
+ export type DefinitionId = string;
7
+ /** Unique identifier for a source document captured in a Definition Revision. */
8
+ export type DefinitionDocumentId = string;
9
+ /** Unique identifier for an immutable resolved Definition Revision. */
10
+ export type DefinitionRevisionId = string;
11
+ /** Server-generated identifier used to correlate this response with Typeship logs. */
8
12
  export type RequestId = string;
13
+ /** Request-level metadata present at the top level of every JSON response. */
14
+ export interface ResponseMetadata {
15
+ request_id: RequestId;
16
+ }
9
17
  /** Identifies a cursor-paginated collection. */
10
18
  export type ListObject = "list";
19
+ /** Stable identifier for one configured generated product. */
20
+ export type TargetId = string;
21
+ export type DeliveryId = string;
22
+ export type TargetReleaseId = string;
11
23
  /**
12
- * One customer-selected output. CLI and MCP include the private TypeScript request runtime they
13
- * need; that dependency is not a selected or billable TypeScript SDK.
24
+ * Generator implementation selected by a Target. This is configuration, not identity; several
25
+ * Targets may use the same generator.
14
26
  */
15
- export declare const OutputId: {
27
+ export declare const GeneratorKind: {
16
28
  readonly TYPESCRIPT_SDK: "typescript-sdk";
17
29
  readonly PYTHON_SDK: "python-sdk";
18
30
  readonly GO_SDK: "go-sdk";
19
31
  readonly CLI: "cli";
20
32
  readonly MCP: "mcp";
21
33
  };
22
- export type OutputId = (typeof OutputId)[keyof typeof OutputId];
23
- export interface UrlSpecInput {
34
+ export type GeneratorKind = (typeof GeneratorKind)[keyof typeof GeneratorKind];
35
+ export interface UrlDefinitionInput {
24
36
  /**
25
37
  * URL of an OpenAPI document, a GraphQL SDL file, or a GraphQL
26
38
  * endpoint (introspected automatically). Fetched server-side.
@@ -33,26 +45,60 @@ export interface UrlSpecInput {
33
45
  */
34
46
  headers?: Record<string, string>;
35
47
  }
36
- export interface InlineSpecInput {
37
- /** Raw spec text (OpenAPI JSON/YAML or GraphQL SDL). Up to 10MB. */
48
+ /** Response shape for UrlDefinitionInput. */
49
+ export interface UrlDefinitionInputRead {
50
+ /**
51
+ * URL of an OpenAPI document, a GraphQL SDL file, or a GraphQL
52
+ * endpoint (introspected automatically). Fetched server-side.
53
+ * Format: uri
54
+ */
55
+ url: string;
56
+ }
57
+ export interface InlineDefinitionInput {
58
+ /** Raw Definition text (OpenAPI JSON/YAML or GraphQL SDL). Up to 10MB. */
38
59
  inline: string;
39
60
  }
40
- /** The specification for stateless generation, provided as exactly one URL or inline document. */
41
- export type SpecInput = UrlSpecInput | InlineSpecInput;
61
+ /** A Definition for stateless generation, provided as exactly one URL or inline entrypoint. */
62
+ export type DefinitionInput = UrlDefinitionInput | InlineDefinitionInput;
63
+ /** Response shape for DefinitionInput. */
64
+ export type DefinitionInputRead = UrlDefinitionInputRead | InlineDefinitionInput;
42
65
  export interface GenerateRequest {
43
- spec: SpecInput;
66
+ definition: DefinitionInput;
67
+ /** Stateless generator descriptor; no persisted Target is created. */
68
+ target: {
69
+ generator: GeneratorKind;
70
+ };
44
71
  /**
45
- * The one output package to generate. Linked projects can select any combination of outputs and
46
- * keep each package current.
72
+ * npm package or Python distribution override. Valid only for the TypeScript and Python SDK
73
+ * targets.
47
74
  */
48
- outputs: OutputId[];
75
+ package_name?: string;
49
76
  /**
50
- * Registry name for the selected delivery package: an npm package, Python distribution, or Go
51
- * module path. Defaults to a name derived from the API title.
77
+ * Go module path override. Valid only for the Go SDK. Linked projects derive this from the Go
78
+ * destination repository by default.
52
79
  */
53
- package_name?: string;
80
+ module_path?: string;
54
81
  config?: Config;
55
82
  }
83
+ /** Response shape for GenerateRequest. */
84
+ export interface GenerateRequestRead {
85
+ definition: DefinitionInputRead;
86
+ /** Stateless generator descriptor; no persisted Target is created. */
87
+ target: {
88
+ generator: GeneratorKind | (string & {});
89
+ };
90
+ /**
91
+ * npm package or Python distribution override. Valid only for the TypeScript and Python SDK
92
+ * targets.
93
+ */
94
+ package_name?: string;
95
+ /**
96
+ * Go module path override. Valid only for the Go SDK. Linked projects derive this from the Go
97
+ * destination repository by default.
98
+ */
99
+ module_path?: string;
100
+ config?: ConfigRead;
101
+ }
56
102
  export interface GeneratedFile {
57
103
  /** Repo-relative path inside the generated package. */
58
104
  path: string;
@@ -60,22 +106,31 @@ export interface GeneratedFile {
60
106
  }
61
107
  export interface GenerationMeta {
62
108
  title: string;
109
+ /** Version declared by the customer's API Definition. It never controls package releases. */
110
+ api_version: string;
111
+ /** Package version selected by the Target's release stream for this generation. */
63
112
  version: string;
64
113
  spec_format?: "openapi" | "graphql";
65
- /** Detected spec version, "2.0", "3.0", or "3.1". */
114
+ /** Detected OpenAPI version, "2.0", "3.0", or "3.1". */
66
115
  oas_version: string;
67
116
  /** True when the input was Swagger 2.0 and was converted. */
68
117
  converted?: boolean;
69
- package_name: string;
118
+ /** Ecosystem-neutral identity of the generated artifact. */
119
+ artifact_name: string;
70
120
  client_name: string;
71
- /** Customer-selected outputs present in this delivery package. */
72
- outputs: OutputId[];
121
+ /**
122
+ * Generator implementations present in this artifact. Persisted Target identity is reported on
123
+ * Generation.
124
+ */
125
+ generators: GeneratorKind[];
73
126
  resource_count?: number;
74
127
  operation_count?: number;
75
128
  schema_count?: number;
76
129
  paginated_operation_count?: number;
77
130
  /** Operations beyond the plan's endpoint allowance, not generated. */
78
131
  omitted_operation_count?: number;
132
+ /** METHOD/path identities of operations omitted by the generation cap. */
133
+ omitted_operations?: string[];
79
134
  /** Pull request opened by this regeneration, when one was. */
80
135
  pr_url?: string | null;
81
136
  pr_number?: number | null;
@@ -103,18 +158,120 @@ export interface GenerationMeta {
103
158
  * What the diff was measured against; "destination" means the .typeship/surface.json merged in
104
159
  * the destination repository.
105
160
  */
106
- baseline?: "destination" | "last-generation" | "none";
161
+ baseline?: "destination" | "none";
162
+ /** Objective compatibility of the generated API surface against the merged destination baseline. */
163
+ api_compatibility?: "compatible" | "breaking" | "unknown";
164
+ /**
165
+ * Objective compatibility of public package entry points and selected targets against the merged
166
+ * destination baseline.
167
+ */
168
+ package_compatibility?: "compatible" | "breaking" | "unknown";
169
+ /**
170
+ * Whether the generated package version satisfies the cumulative change. Null when there is no
171
+ * prior version or analysis is unavailable.
172
+ */
173
+ version_correct?: boolean | null;
174
+ /**
175
+ * The destination pull request's combined readiness decision for the exact bot-generated head.
176
+ * Compatibility and version correctness remain separate fields above.
177
+ */
178
+ release_readiness?: "success" | "failure" | "error";
179
+ /** The release-readiness decision in one line, as the commit status describes it. */
180
+ release_readiness_note?: string;
181
+ /** The package version the destination had before this regeneration. */
182
+ previous_version?: string;
183
+ file_count?: number;
184
+ total_lines?: number;
185
+ /** Deterministic Diagnostic summary for the exact Definition Revision consumed. */
186
+ diagnostics?: {
187
+ format: "openapi" | "graphql";
188
+ summary: DiagnosticSummary;
189
+ };
190
+ }
191
+ /** Response shape for GenerationMeta. */
192
+ export interface GenerationMetaRead {
193
+ title: string;
194
+ /** Version declared by the customer's API Definition. It never controls package releases. */
195
+ api_version: string;
196
+ /** Package version selected by the Target's release stream for this generation. */
197
+ version: string;
198
+ spec_format?: ("openapi" | "graphql") | (string & {});
199
+ /** Detected OpenAPI version, "2.0", "3.0", or "3.1". */
200
+ oas_version: string;
201
+ /** True when the input was Swagger 2.0 and was converted. */
202
+ converted?: boolean;
203
+ /** Ecosystem-neutral identity of the generated artifact. */
204
+ artifact_name: string;
205
+ client_name: string;
206
+ /**
207
+ * Generator implementations present in this artifact. Persisted Target identity is reported on
208
+ * Generation.
209
+ */
210
+ generators: Array<GeneratorKind | (string & {})>;
211
+ resource_count?: number;
212
+ operation_count?: number;
213
+ schema_count?: number;
214
+ paginated_operation_count?: number;
215
+ /** Operations beyond the plan's endpoint allowance, not generated. */
216
+ omitted_operation_count?: number;
217
+ /** METHOD/path identities of operations omitted by the generation cap. */
218
+ omitted_operations?: string[];
219
+ /** Pull request opened by this regeneration, when one was. */
220
+ pr_url?: string | null;
221
+ pr_number?: number | null;
222
+ /**
223
+ * Whether a destination pull request opened, was unnecessary because the generated tree already
224
+ * matched, or could not be opened.
225
+ */
226
+ pr_status?: ("opened" | "no_changes" | "blocked") | (string & {});
227
+ /**
228
+ * Why the configured destination pull request was not opened. Generation itself still succeeded;
229
+ * fix this action and regenerate.
230
+ */
231
+ pr_error?: string;
232
+ /**
233
+ * Markdown changelog entry for this regeneration, from the API surface diff. Absent on a first
234
+ * generation or when nothing changed.
235
+ */
236
+ changelog?: string;
237
+ /**
238
+ * Breaking changes in the diff; removed methods and fields, changed types, inputs that became
239
+ * required.
240
+ */
241
+ breaking_count?: number;
242
+ /**
243
+ * What the diff was measured against; "destination" means the .typeship/surface.json merged in
244
+ * the destination repository.
245
+ */
246
+ baseline?: ("destination" | "none") | (string & {});
247
+ /** Objective compatibility of the generated API surface against the merged destination baseline. */
248
+ api_compatibility?: ("compatible" | "breaking" | "unknown") | (string & {});
249
+ /**
250
+ * Objective compatibility of public package entry points and selected targets against the merged
251
+ * destination baseline.
252
+ */
253
+ package_compatibility?: ("compatible" | "breaking" | "unknown") | (string & {});
254
+ /**
255
+ * Whether the generated package version satisfies the cumulative change. Null when there is no
256
+ * prior version or analysis is unavailable.
257
+ */
258
+ version_correct?: boolean | null;
107
259
  /**
108
- * The package compatibility verdict on the regeneration pull request; failure means breaking
109
- * changes without a major version bump.
260
+ * The destination pull request's combined readiness decision for the exact bot-generated head.
261
+ * Compatibility and version correctness remain separate fields above.
110
262
  */
111
- package_compatibility?: "success" | "failure";
112
- /** The verdict in one line, as the commit status describes it. */
113
- package_compatibility_note?: string;
263
+ release_readiness?: ("success" | "failure" | "error") | (string & {});
264
+ /** The release-readiness decision in one line, as the commit status describes it. */
265
+ release_readiness_note?: string;
114
266
  /** The package version the destination had before this regeneration. */
115
267
  previous_version?: string;
116
268
  file_count?: number;
117
269
  total_lines?: number;
270
+ /** Deterministic Diagnostic summary for the exact Definition Revision consumed. */
271
+ diagnostics?: {
272
+ format: ("openapi" | "graphql") | (string & {});
273
+ summary: DiagnosticSummary;
274
+ };
118
275
  }
119
276
  export interface GenerationResult {
120
277
  files: GeneratedFile[];
@@ -123,14 +280,33 @@ export interface GenerationResult {
123
280
  limits?: GenerationLimits;
124
281
  /**
125
282
  * Anonymous, URL-sourced generations only. A link a signed-in person can open to turn this run
126
- * into a project in their organization (same spec, outputs, and config). Lasts seven days. Null
127
- * for inline specs; absent on keyed calls.
283
+ * into a project in their organization (same Definition, Target, and config). Lasts seven days.
284
+ * Null for inline Definitions; absent on keyed calls.
128
285
  */
129
286
  claim?: null | {
130
287
  url: string;
131
288
  /** Format: date-time */
132
289
  expires_at: string;
133
290
  };
291
+ request_id: RequestId;
292
+ }
293
+ /** Response shape for GenerationResult. */
294
+ export interface GenerationResultRead {
295
+ files: GeneratedFile[];
296
+ warnings: string[];
297
+ meta: GenerationMetaRead;
298
+ limits?: GenerationLimitsRead;
299
+ /**
300
+ * Anonymous, URL-sourced generations only. A link a signed-in person can open to turn this run
301
+ * into a project in their organization (same Definition, Target, and config). Lasts seven days.
302
+ * Null for inline Definitions; absent on keyed calls.
303
+ */
304
+ claim?: null | {
305
+ url: string;
306
+ /** Format: date-time */
307
+ expires_at: string;
308
+ };
309
+ request_id: RequestId;
134
310
  }
135
311
  /**
136
312
  * Present when the generation was capped: by the free plan, or because the call was anonymous.
@@ -139,15 +315,35 @@ export interface GenerationResult {
139
315
  export interface GenerationLimits {
140
316
  /** How many operations this generation was allowed to include. */
141
317
  max_operations: number;
142
- /** How many operations in the spec were left out. */
318
+ /** How many operations are present in the generated package. */
319
+ generated_operations: number;
320
+ /** How many operations in the Definition were left out. */
143
321
  omitted_operations: number;
322
+ /** How many operations Typeship found in the complete Definition. */
323
+ total_operations: number;
144
324
  reason: "anonymous" | "free_plan";
145
325
  /** Anonymous calls only. Where to create an account. */
146
326
  signup_url?: string;
147
327
  /** Where the cap is lifted. */
148
328
  upgrade_url: string;
149
329
  }
150
- export interface UrlProjectSource {
330
+ /** Response shape for GenerationLimits. */
331
+ export interface GenerationLimitsRead {
332
+ /** How many operations this generation was allowed to include. */
333
+ max_operations: number;
334
+ /** How many operations are present in the generated package. */
335
+ generated_operations: number;
336
+ /** How many operations in the Definition were left out. */
337
+ omitted_operations: number;
338
+ /** How many operations Typeship found in the complete Definition. */
339
+ total_operations: number;
340
+ reason: ("anonymous" | "free_plan") | (string & {});
341
+ /** Anonymous calls only. Where to create an account. */
342
+ signup_url?: string;
343
+ /** Where the cap is lifted. */
344
+ upgrade_url: string;
345
+ }
346
+ export interface UrlDefinitionSource {
151
347
  kind: "url";
152
348
  /**
153
349
  * URL fetched for every generation.
@@ -157,16 +353,61 @@ export interface UrlProjectSource {
157
353
  /** Whether Typeship has stored write-only request headers for this URL. */
158
354
  headers_configured: boolean;
159
355
  }
160
- export interface GithubProjectSource {
161
- kind: "github";
162
- /** GitHub repository in owner/name form. */
163
- repository: string;
164
- /** Repository-relative path to the specification. */
356
+ /** Request shape for UrlDefinitionSource. */
357
+ export interface UrlDefinitionSourceWrite {
358
+ kind: "url";
359
+ /**
360
+ * URL fetched for every generation.
361
+ * Format: uri
362
+ */
363
+ url: string;
364
+ }
365
+ /** Response shape for UrlDefinitionSource. */
366
+ export interface UrlDefinitionSourceRead {
367
+ kind: "url" | (string & {});
368
+ /**
369
+ * URL fetched for every generation.
370
+ * Format: uri
371
+ */
372
+ url: string;
373
+ /** Whether Typeship has stored write-only request headers for this URL. */
374
+ headers_configured: boolean;
375
+ }
376
+ export interface RepositoryReference {
377
+ /** GitHub is the only launch provider; the field is stable for future adapters. */
378
+ provider: "github";
379
+ /** Provider-native repository identity, opaque outside its adapter. */
380
+ identifier: string;
381
+ }
382
+ /** Response shape for RepositoryReference. */
383
+ export interface RepositoryReferenceRead {
384
+ /** GitHub is the only launch provider; the field is stable for future adapters. */
385
+ provider: "github" | (string & {});
386
+ /** Provider-native repository identity, opaque outside its adapter. */
387
+ identifier: string;
388
+ }
389
+ export interface RepositoryDefinitionSource {
390
+ kind: "repository";
391
+ repository: RepositoryReference;
392
+ /** Repository-relative Definition entrypoint. */
165
393
  path: string;
166
394
  }
167
- /** The single source of truth for where a project's specification lives. */
168
- export type ProjectSource = UrlProjectSource | GithubProjectSource;
169
- export interface UrlProjectSourceInput {
395
+ /** Response shape for RepositoryDefinitionSource. */
396
+ export interface RepositoryDefinitionSourceRead {
397
+ kind: "repository" | (string & {});
398
+ repository: RepositoryReferenceRead;
399
+ /** Repository-relative Definition entrypoint. */
400
+ path: string;
401
+ }
402
+ /** The single source of truth for where a Project's Definition lives. */
403
+ export type DefinitionSource = UrlDefinitionSource | RepositoryDefinitionSource;
404
+ /** Request shape for DefinitionSource. */
405
+ export type DefinitionSourceWrite = UrlDefinitionSourceWrite | RepositoryDefinitionSource;
406
+ /** Response shape for DefinitionSource. */
407
+ export type DefinitionSourceRead = UrlDefinitionSourceRead | RepositoryDefinitionSourceRead | Record<string, unknown> & {
408
+ kind?: string;
409
+ };
410
+ export interface UrlDefinitionSourceInput {
170
411
  kind: "url";
171
412
  /**
172
413
  * URL of an OpenAPI document, GraphQL SDL file, or GraphQL endpoint.
@@ -181,20 +422,39 @@ export interface UrlProjectSourceInput {
181
422
  */
182
423
  headers?: Record<string, string> | null;
183
424
  }
184
- export interface GithubProjectSourceInput {
185
- kind: "github";
186
- /** GitHub repository in owner/name form. */
187
- repository: string;
188
- /** Repository-relative path to the specification. */
425
+ /** Response shape for UrlDefinitionSourceInput. */
426
+ export interface UrlDefinitionSourceInputRead {
427
+ kind: "url" | (string & {});
428
+ /**
429
+ * URL of an OpenAPI document, GraphQL SDL file, or GraphQL endpoint.
430
+ * Format: uri
431
+ */
432
+ url: string;
433
+ }
434
+ export interface RepositoryDefinitionSourceInput {
435
+ kind: "repository";
436
+ repository: RepositoryReference;
437
+ /** Repository-relative Definition entrypoint. */
438
+ path: string;
439
+ }
440
+ /** Response shape for RepositoryDefinitionSourceInput. */
441
+ export interface RepositoryDefinitionSourceInputRead {
442
+ kind: "repository" | (string & {});
443
+ repository: RepositoryReferenceRead;
444
+ /** Repository-relative Definition entrypoint. */
189
445
  path: string;
190
446
  }
191
- export type ProjectSourceInput = UrlProjectSourceInput | GithubProjectSourceInput;
447
+ export type DefinitionSourceInput = UrlDefinitionSourceInput | RepositoryDefinitionSourceInput;
448
+ /** Response shape for DefinitionSourceInput. */
449
+ export type DefinitionSourceInputRead = UrlDefinitionSourceInputRead | RepositoryDefinitionSourceInputRead | Record<string, unknown> & {
450
+ kind?: string;
451
+ };
192
452
  /**
193
- * A fix applied to the spec before generation. Targets are JSON
453
+ * A fix applied to the resolved Definition before generation. Paths are JSON
194
454
  * Pointers into the document. A patch whose target no longer exists is
195
455
  * skipped and reported as a warning on the generation, never silently.
196
456
  */
197
- export interface SpecPatch {
457
+ export interface DefinitionPatch {
198
458
  op: "set" | "append" | "remove" | "rename";
199
459
  /**
200
460
  * JSON-Pointer-style path. Pattern segments enable bulk fixes:
@@ -209,76 +469,641 @@ export interface SpecPatch {
209
469
  to?: string | null;
210
470
  reason?: string | null;
211
471
  }
212
- /** Where regeneration pull requests land. */
213
- export interface Destination {
214
- /** Defaults to the source repository when the source is a repo. */
215
- repo?: string | null;
216
- /** Directory the generated package is written to. */
217
- directory?: string | null;
472
+ /** Response shape for DefinitionPatch. */
473
+ export interface DefinitionPatchRead {
474
+ op: ("set" | "append" | "remove" | "rename") | (string & {});
475
+ /**
476
+ * JSON-Pointer-style path. Pattern segments enable bulk fixes:
477
+ * * (any child), ** (any depth), [key=value] (filter), e.g.
478
+ * /paths/**\/parameters/[name=account_id]/schema/type. Renaming a
479
+ * schema under /components/schemas also rewrites its $refs.
480
+ */
481
+ path: string;
482
+ /** set only; the replacement value. */
483
+ value?: unknown;
484
+ /** rename only; the new key name. */
485
+ to?: string | null;
486
+ reason?: string | null;
487
+ }
488
+ /** One exact place where a Diagnostic rule found evidence. */
489
+ export interface DiagnosticLocation {
490
+ /** Source document coordinate when the Definition contains multiple files. */
491
+ document?: string;
492
+ /** JSON Pointer for OpenAPI, or schema coordinate for GraphQL. */
493
+ path: string;
494
+ /** Human-readable operation coordinate when the location belongs to an operation. */
495
+ operation?: string;
496
+ /** Occurrence-specific evidence. This is not a remediation instruction. */
497
+ evidence?: string;
498
+ }
499
+ /** A reviewable remediation that does not invent API behavior. */
500
+ export interface DiagnosticFix {
501
+ /** Concise action for the API author. */
502
+ title: string;
503
+ /**
504
+ * spec_patch is an exact OpenAPI edit Typeship can derive; source_edit requires author intent or
505
+ * a lossless GraphQL source edit.
506
+ */
507
+ kind: "spec_patch" | "source_edit";
508
+ /** Exact patches when kind is spec_patch. */
509
+ patches?: DefinitionPatch[];
510
+ /** Source-level guidance when an exact patch would invent intent. */
511
+ instructions?: string;
218
512
  }
219
- /** Registry identity and reviewed pull-request destination for one delivery package. */
220
- export interface PackageDelivery {
513
+ /** Response shape for DiagnosticFix. */
514
+ export interface DiagnosticFixRead {
515
+ /** Concise action for the API author. */
516
+ title: string;
221
517
  /**
222
- * npm package name, Python distribution name, or Go module path. Null derives a name from the API
223
- * title.
518
+ * spec_patch is an exact OpenAPI edit Typeship can derive; source_edit requires author intent or
519
+ * a lossless GraphQL source edit.
224
520
  */
225
- name?: string | null;
521
+ kind: ("spec_patch" | "source_edit") | (string & {});
522
+ /** Exact patches when kind is spec_patch. */
523
+ patches?: DefinitionPatchRead[];
524
+ /** Source-level guidance when an exact patch would invent intent. */
525
+ instructions?: string;
526
+ }
527
+ /** Every occurrence of one stable Diagnostic rule, grouped into one decision. */
528
+ export interface Diagnostic {
529
+ /** Stable rule identifier for automation and suppressions. */
530
+ id: string;
531
+ /** Whether the rule reports invalid behavior, material risk, or an improvement. */
532
+ severity: "error" | "warning" | "suggestion";
533
+ /** Product dimension affected by the diagnostic. */
534
+ category: "correctness" | "sdk_ergonomics" | "agent_usability" | "safety";
535
+ /** Concise statement of the root cause. */
536
+ title: string;
537
+ /** What the API author should change. */
538
+ description: string;
539
+ /** Why consumers of generated SDK, CLI, or MCP surfaces care. */
540
+ impact: string;
541
+ /** Public surfaces affected by the root cause. */
542
+ surfaces: Array<"api" | "sdk" | "cli" | "mcp">;
543
+ /** All affected coordinates, kept under one grouped diagnostic. */
544
+ locations: DiagnosticLocation[];
545
+ fix?: DiagnosticFix;
546
+ /**
547
+ * Grounded instructions an agent can use to edit the source. The brief preserves existing
548
+ * behavior and requires owner input when the contract cannot prove the missing product decision.
549
+ */
550
+ authoring_brief: string;
551
+ }
552
+ /** Response shape for Diagnostic. */
553
+ export interface DiagnosticRead {
554
+ /** Stable rule identifier for automation and suppressions. */
555
+ id: string;
556
+ /** Whether the rule reports invalid behavior, material risk, or an improvement. */
557
+ severity: ("error" | "warning" | "suggestion") | (string & {});
558
+ /** Product dimension affected by the diagnostic. */
559
+ category: ("correctness" | "sdk_ergonomics" | "agent_usability" | "safety") | (string & {});
560
+ /** Concise statement of the root cause. */
561
+ title: string;
562
+ /** What the API author should change. */
563
+ description: string;
564
+ /** Why consumers of generated SDK, CLI, or MCP surfaces care. */
565
+ impact: string;
566
+ /** Public surfaces affected by the root cause. */
567
+ surfaces: Array<("api" | "sdk" | "cli" | "mcp") | (string & {})>;
568
+ /** All affected coordinates, kept under one grouped diagnostic. */
569
+ locations: DiagnosticLocation[];
570
+ fix?: DiagnosticFixRead;
226
571
  /**
227
- * Release version for this output package. Null falls back to the legacy config.package.version,
228
- * then the specification version.
572
+ * Grounded instructions an agent can use to edit the source. The brief preserves existing
573
+ * behavior and requires owner input when the contract cannot prove the missing product decision.
229
574
  */
230
- version?: string | null;
231
- destination?: Destination | null;
575
+ authoring_brief: string;
576
+ }
577
+ /** Counts distinguish decisions from the number of affected schema locations. */
578
+ export interface DiagnosticSummary {
579
+ /** Number of grouped rule diagnostics. */
580
+ diagnostics: number;
581
+ /** Total affected locations across all diagnostics. */
582
+ occurrences: number;
583
+ /** Grouped correctness errors. */
584
+ errors: number;
585
+ /** Grouped material risks. */
586
+ warnings: number;
587
+ /** Grouped improvements. */
588
+ suggestions: number;
589
+ /** Diagnostics with exact reviewable Definition patches. */
590
+ auto_fixable: number;
591
+ }
592
+ export interface DiagnosticSuppression {
593
+ rule_id: string;
594
+ /** Exact schema coordinate. Omit only to suppress every occurrence of the rule. */
595
+ path?: string;
596
+ /** The reviewed product decision behind this exception. */
597
+ reason: string;
232
598
  }
233
599
  /**
234
- * Independent delivery packages keyed by output. Every selected output owns its registry identity,
235
- * version, destination pull request, and release lifecycle. Selected outputs must resolve to
236
- * distinct repository-and-directory trees; the TypeScript SDK, CLI, and MCP packages must also have
237
- * distinct npm names.
600
+ * Source pull-request enforcement threshold, new-versus-complete baseline, and explicitly reviewed
601
+ * rule or location exceptions.
238
602
  */
239
- export interface Packages {
240
- "typescript-sdk"?: PackageDelivery;
241
- "python-sdk"?: PackageDelivery;
242
- "go-sdk"?: PackageDelivery;
243
- cli?: PackageDelivery;
244
- mcp?: PackageDelivery;
245
- }
246
- export interface ProjectDestination {
247
- repo: string | null;
248
- directory: string | null;
603
+ export interface DiagnosticPolicy {
604
+ /**
605
+ * Severity threshold that fails the API change review check.
606
+ * Default: "error"
607
+ */
608
+ fail_on: "never" | "error" | "warning";
609
+ /**
610
+ * Enforce only occurrences introduced by the proposed source change.
611
+ * Default: true
612
+ */
613
+ only_new: boolean;
614
+ /** Default: [] */
615
+ suppressions: DiagnosticSuppression[];
249
616
  }
250
- export interface ProjectPackageDelivery {
251
- name: string | null;
252
- version: string | null;
253
- destination: ProjectDestination | null;
617
+ /** Response shape for DiagnosticPolicy. */
618
+ export interface DiagnosticPolicyRead {
619
+ /**
620
+ * Severity threshold that fails the API change review check.
621
+ * Default: "error"
622
+ */
623
+ fail_on: ("never" | "error" | "warning") | (string & {});
624
+ /**
625
+ * Enforce only occurrences introduced by the proposed source change.
626
+ * Default: true
627
+ */
628
+ only_new: boolean;
629
+ /** Default: [] */
630
+ suppressions: DiagnosticSuppression[];
631
+ }
632
+ export interface DiagnosticEvaluation {
633
+ state: "pass" | "fail";
634
+ blocking: DiagnosticReference[];
635
+ considered_occurrences: number;
636
+ suppressed_occurrences: number;
637
+ }
638
+ /** Response shape for DiagnosticEvaluation. */
639
+ export interface DiagnosticEvaluationRead {
640
+ state: ("pass" | "fail") | (string & {});
641
+ blocking: DiagnosticReferenceRead[];
642
+ considered_occurrences: number;
643
+ suppressed_occurrences: number;
644
+ }
645
+ /** Compact rule and location reference; full guidance appears once in diagnostics. */
646
+ export interface DiagnosticReference {
647
+ rule_id: string;
648
+ severity: "error" | "warning" | "suggestion";
649
+ title: string;
650
+ locations: DiagnosticLocation[];
651
+ }
652
+ /** Response shape for DiagnosticReference. */
653
+ export interface DiagnosticReferenceRead {
654
+ rule_id: string;
655
+ severity: ("error" | "warning" | "suggestion") | (string & {});
656
+ title: string;
657
+ locations: DiagnosticLocation[];
658
+ }
659
+ export interface DiagnosticDelta {
660
+ added: DiagnosticReference[];
661
+ resolved: DiagnosticReference[];
662
+ baseline_definition_revision_id: DefinitionRevisionId | null;
663
+ }
664
+ /** Response shape for DiagnosticDelta. */
665
+ export interface DiagnosticDeltaRead {
666
+ added: DiagnosticReferenceRead[];
667
+ resolved: DiagnosticReferenceRead[];
668
+ baseline_definition_revision_id: DefinitionRevisionId | null;
254
669
  }
255
670
  /**
256
- * Complete package configuration. All outputs are returned even when their output is not selected,
257
- * so saved delivery settings do not disappear when an output is disabled.
671
+ * Deterministic Diagnostics for one immutable Definition Revision after existing patches. No
672
+ * model-generated facts or silent edits.
258
673
  */
259
- export interface ProjectPackages {
260
- "typescript-sdk": ProjectPackageDelivery;
261
- "python-sdk": ProjectPackageDelivery;
262
- "go-sdk": ProjectPackageDelivery;
263
- cli: ProjectPackageDelivery;
264
- mcp: ProjectPackageDelivery;
265
- }
266
- export interface GithubHealthIssue {
267
- code: "installation_missing" | "spec_unreadable" | "contents_write_missing" | "breaking_label_missing" | "github_unavailable";
674
+ export interface DiagnosticReport {
675
+ object: "diagnostic_report";
676
+ /** Contract format Typeship analyzed. */
677
+ format: "openapi" | "graphql";
678
+ project_id: ProjectId;
679
+ definition_revision_id: DefinitionRevisionId;
680
+ /** SHA-256 digest of the immutable raw source revision. */
681
+ source_sha256: string;
682
+ /** SHA-256 digest after applying the Definition's current patches. */
683
+ analyzed_sha256: string;
684
+ /** Loud misses or conflicts from the Definition's existing patches. */
685
+ patch_diagnostics: string[];
686
+ summary: DiagnosticSummary;
687
+ /** Stable grouped diagnostics, ordered by severity and rule identifier. */
688
+ diagnostics: Diagnostic[];
689
+ policy: DiagnosticPolicy;
690
+ evaluation: DiagnosticEvaluation;
691
+ delta: DiagnosticDelta;
692
+ request_id: RequestId;
693
+ }
694
+ /** Response shape for DiagnosticReport. */
695
+ export interface DiagnosticReportRead {
696
+ object: "diagnostic_report" | (string & {});
697
+ /** Contract format Typeship analyzed. */
698
+ format: ("openapi" | "graphql") | (string & {});
699
+ project_id: ProjectId;
700
+ definition_revision_id: DefinitionRevisionId;
701
+ /** SHA-256 digest of the immutable raw source revision. */
702
+ source_sha256: string;
703
+ /** SHA-256 digest after applying the Definition's current patches. */
704
+ analyzed_sha256: string;
705
+ /** Loud misses or conflicts from the Definition's existing patches. */
706
+ patch_diagnostics: string[];
707
+ summary: DiagnosticSummary;
708
+ /** Stable grouped diagnostics, ordered by severity and rule identifier. */
709
+ diagnostics: DiagnosticRead[];
710
+ policy: DiagnosticPolicyRead;
711
+ evaluation: DiagnosticEvaluationRead;
712
+ delta: DiagnosticDeltaRead;
713
+ request_id: RequestId;
714
+ }
715
+ export interface DiagnosticRemediationRequest {
716
+ /** Stable IDs of current diagnostics whose exact patches should be reviewed and applied. */
717
+ diagnostic_ids: string[];
718
+ }
719
+ export interface DiagnosticRemediation {
720
+ object: "diagnostic_remediation";
721
+ kind: "overlay" | "source_review";
722
+ patches_applied: number;
723
+ /**
724
+ * Source pull request for repository projects; absent for URL overlays.
725
+ * Format: uri
726
+ */
727
+ review_url?: string | null;
728
+ request_id: RequestId;
729
+ }
730
+ /** Response shape for DiagnosticRemediation. */
731
+ export interface DiagnosticRemediationRead {
732
+ object: "diagnostic_remediation" | (string & {});
733
+ kind: ("overlay" | "source_review") | (string & {});
734
+ patches_applied: number;
735
+ /**
736
+ * Source pull request for repository projects; absent for URL overlays.
737
+ * Format: uri
738
+ */
739
+ review_url?: string | null;
740
+ request_id: RequestId;
741
+ }
742
+ export interface RepositoryDeliveryInput {
743
+ kind: "repository";
744
+ repository: RepositoryReference;
745
+ directory?: string | null;
746
+ /** npm or Python registry identity where applicable. */
747
+ package_name?: string | null;
748
+ /** Explicit Go module path where applicable. */
749
+ module_path?: string | null;
750
+ }
751
+ /** Response shape for RepositoryDeliveryInput. */
752
+ export interface RepositoryDeliveryInputRead {
753
+ kind: "repository" | (string & {});
754
+ repository: RepositoryReferenceRead;
755
+ directory?: string | null;
756
+ /** npm or Python registry identity where applicable. */
757
+ package_name?: string | null;
758
+ /** Explicit Go module path where applicable. */
759
+ module_path?: string | null;
760
+ }
761
+ export interface HostedMcpDeliveryInput {
762
+ kind: "hosted_mcp";
763
+ }
764
+ /** Response shape for HostedMcpDeliveryInput. */
765
+ export interface HostedMcpDeliveryInputRead {
766
+ kind: "hosted_mcp" | (string & {});
767
+ }
768
+ export type DeliveryInput = RepositoryDeliveryInput | HostedMcpDeliveryInput;
769
+ /** Response shape for DeliveryInput. */
770
+ export type DeliveryInputRead = RepositoryDeliveryInputRead | HostedMcpDeliveryInputRead | Record<string, unknown> & {
771
+ kind?: string;
772
+ };
773
+ export interface RepositoryDelivery {
774
+ id: DeliveryId;
775
+ object: "delivery";
776
+ target_id: TargetId;
777
+ kind: "repository";
778
+ state: "active" | "disabled";
779
+ repository: RepositoryReference;
780
+ directory: string | null;
781
+ package_name: string | null;
782
+ module_path: string | null;
783
+ /** Format: date-time */
784
+ created_at: string;
785
+ /** Format: date-time */
786
+ updated_at: string;
787
+ }
788
+ /** Response shape for RepositoryDelivery. */
789
+ export interface RepositoryDeliveryRead {
790
+ id: DeliveryId;
791
+ object: "delivery" | (string & {});
792
+ target_id: TargetId;
793
+ kind: "repository" | (string & {});
794
+ state: ("active" | "disabled") | (string & {});
795
+ repository: RepositoryReferenceRead;
796
+ directory: string | null;
797
+ package_name: string | null;
798
+ module_path: string | null;
799
+ /** Format: date-time */
800
+ created_at: string;
801
+ /** Format: date-time */
802
+ updated_at: string;
803
+ }
804
+ export interface HostedMcpDelivery {
805
+ id: DeliveryId;
806
+ object: "delivery";
807
+ target_id: TargetId;
808
+ kind: "hosted_mcp";
809
+ state: "active" | "disabled";
810
+ /** Format: uri */
811
+ url: string | null;
812
+ /** Format: date-time */
813
+ created_at: string;
814
+ /** Format: date-time */
815
+ updated_at: string;
816
+ }
817
+ /** Response shape for HostedMcpDelivery. */
818
+ export interface HostedMcpDeliveryRead {
819
+ id: DeliveryId;
820
+ object: "delivery" | (string & {});
821
+ target_id: TargetId;
822
+ kind: "hosted_mcp" | (string & {});
823
+ state: ("active" | "disabled") | (string & {});
824
+ /** Format: uri */
825
+ url: string | null;
826
+ /** Format: date-time */
827
+ created_at: string;
828
+ /** Format: date-time */
829
+ updated_at: string;
830
+ }
831
+ export type Delivery = RepositoryDelivery | HostedMcpDelivery;
832
+ /** Response shape for Delivery. */
833
+ export type DeliveryRead = RepositoryDeliveryRead | HostedMcpDeliveryRead | Record<string, unknown> & {
834
+ kind?: string;
835
+ };
836
+ export interface TargetFields {
837
+ name: string;
838
+ definition_id: DefinitionId;
839
+ generator: GeneratorKind;
840
+ /** Default: "active" */
841
+ state?: "active" | "disabled";
842
+ /** Default: "2026-08-24" */
843
+ edition?: string;
844
+ /** Default: "stable" */
845
+ release_channel?: "stable" | "prerelease";
846
+ /** Optional larger or prerelease SemVer for the next reviewed release. */
847
+ proposed_version?: string | null;
848
+ /**
849
+ * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
850
+ * belong to the Definition.
851
+ */
852
+ config?: ProjectConfig | null;
853
+ deliveries?: DeliveryInput[];
854
+ }
855
+ /** Response shape for TargetFields. */
856
+ export interface TargetFieldsRead {
857
+ name: string;
858
+ definition_id: DefinitionId;
859
+ generator: GeneratorKind | (string & {});
860
+ /** Default: "active" */
861
+ state?: ("active" | "disabled") | (string & {});
862
+ /** Default: "2026-08-24" */
863
+ edition?: string;
864
+ /** Default: "stable" */
865
+ release_channel?: ("stable" | "prerelease") | (string & {});
866
+ /** Optional larger or prerelease SemVer for the next reviewed release. */
867
+ proposed_version?: string | null;
868
+ /**
869
+ * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
870
+ * belong to the Definition.
871
+ */
872
+ config?: ProjectConfigRead | null;
873
+ deliveries?: DeliveryInputRead[];
874
+ }
875
+ export interface InitialTargetFields {
876
+ name: string;
877
+ generator: GeneratorKind;
878
+ /** Default: "active" */
879
+ state?: "active" | "disabled";
880
+ /** Default: "2026-08-24" */
881
+ edition?: string;
882
+ /** Default: "stable" */
883
+ release_channel?: "stable" | "prerelease";
884
+ proposed_version?: string | null;
885
+ /**
886
+ * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
887
+ * belong to the Definition.
888
+ */
889
+ config?: ProjectConfig | null;
890
+ deliveries?: DeliveryInput[];
891
+ }
892
+ /** Response shape for InitialTargetFields. */
893
+ export interface InitialTargetFieldsRead {
894
+ name: string;
895
+ generator: GeneratorKind | (string & {});
896
+ /** Default: "active" */
897
+ state?: ("active" | "disabled") | (string & {});
898
+ /** Default: "2026-08-24" */
899
+ edition?: string;
900
+ /** Default: "stable" */
901
+ release_channel?: ("stable" | "prerelease") | (string & {});
902
+ proposed_version?: string | null;
903
+ /**
904
+ * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
905
+ * belong to the Definition.
906
+ */
907
+ config?: ProjectConfigRead | null;
908
+ deliveries?: DeliveryInputRead[];
909
+ }
910
+ export interface TargetUpdateRequest {
911
+ name?: string;
912
+ state?: "active" | "disabled";
913
+ edition?: string;
914
+ release_channel?: "stable" | "prerelease";
915
+ proposed_version?: string | null;
916
+ /**
917
+ * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
918
+ * belong to the Definition.
919
+ */
920
+ config?: ProjectConfig | null;
921
+ deliveries?: DeliveryInput[];
922
+ }
923
+ /** Response shape for TargetUpdateRequest. */
924
+ export interface TargetUpdateRequestRead {
925
+ name?: string;
926
+ state?: ("active" | "disabled") | (string & {});
927
+ edition?: string;
928
+ release_channel?: ("stable" | "prerelease") | (string & {});
929
+ proposed_version?: string | null;
930
+ /**
931
+ * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
932
+ * belong to the Definition.
933
+ */
934
+ config?: ProjectConfigRead | null;
935
+ deliveries?: DeliveryInputRead[];
936
+ }
937
+ export interface Target {
938
+ id: TargetId;
939
+ object: "target";
940
+ project_id: ProjectId;
941
+ definition_id: DefinitionId;
942
+ name: string;
943
+ generator: GeneratorKind;
944
+ state: "active" | "disabled";
945
+ edition: string;
946
+ release_channel: "stable" | "prerelease";
947
+ version_policy: {
948
+ mode: "reviewed_semver";
949
+ pre1_breaking: "minor";
950
+ };
951
+ current_version: string;
952
+ proposed_version: string | null;
953
+ /**
954
+ * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
955
+ * never appear here.
956
+ */
957
+ config: ProjectConfig | null;
958
+ deliveries: Delivery[];
959
+ /** Format: date-time */
960
+ created_at: string;
961
+ /** Format: date-time */
962
+ updated_at: string;
963
+ request_id?: RequestId;
964
+ }
965
+ /** Response shape for Target. */
966
+ export interface TargetRead {
967
+ id: TargetId;
968
+ object: "target" | (string & {});
969
+ project_id: ProjectId;
970
+ definition_id: DefinitionId;
971
+ name: string;
972
+ generator: GeneratorKind | (string & {});
973
+ state: ("active" | "disabled") | (string & {});
974
+ edition: string;
975
+ release_channel: ("stable" | "prerelease") | (string & {});
976
+ version_policy: {
977
+ mode: "reviewed_semver" | (string & {});
978
+ pre1_breaking: "minor" | (string & {});
979
+ };
980
+ current_version: string;
981
+ proposed_version: string | null;
982
+ /**
983
+ * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
984
+ * never appear here.
985
+ */
986
+ config: ProjectConfigRead | null;
987
+ deliveries: DeliveryRead[];
988
+ /** Format: date-time */
989
+ created_at: string;
990
+ /** Format: date-time */
991
+ updated_at: string;
992
+ request_id?: RequestId;
993
+ }
994
+ export type TargetResponse = Target & ResponseMetadata;
995
+ /** Response shape for TargetResponse. */
996
+ export type TargetResponseRead = TargetRead & ResponseMetadata;
997
+ export interface TargetList {
998
+ object: ListObject;
999
+ data: Target[];
1000
+ has_more: boolean;
1001
+ next_cursor: string | null;
1002
+ request_id: RequestId;
1003
+ }
1004
+ /** Response shape for TargetList. */
1005
+ export interface TargetListRead {
1006
+ object: ListObject;
1007
+ data: TargetRead[];
1008
+ has_more: boolean;
1009
+ next_cursor: string | null;
1010
+ request_id: RequestId;
1011
+ }
1012
+ export interface TargetRelease {
1013
+ id: TargetReleaseId;
1014
+ object: "target_release";
1015
+ target_id: TargetId;
1016
+ generation_id: GenerationId;
1017
+ /** Immutable package version released from this Target. */
1018
+ version: string;
1019
+ channel: "stable" | "prerelease";
1020
+ /** Delivery provider that accepted the release. */
1021
+ provider: string;
1022
+ repository: RepositoryReference | null;
1023
+ definition_revision_id: DefinitionRevisionId | null;
1024
+ /** Immutable provider-native revision that was merged or published. */
1025
+ delivery_revision: string;
1026
+ /** Format: date-time */
1027
+ created_at: string;
1028
+ request_id?: RequestId;
1029
+ }
1030
+ /** Response shape for TargetRelease. */
1031
+ export interface TargetReleaseRead {
1032
+ id: TargetReleaseId;
1033
+ object: "target_release" | (string & {});
1034
+ target_id: TargetId;
1035
+ generation_id: GenerationId;
1036
+ /** Immutable package version released from this Target. */
1037
+ version: string;
1038
+ channel: ("stable" | "prerelease") | (string & {});
1039
+ /** Delivery provider that accepted the release. */
1040
+ provider: string;
1041
+ repository: RepositoryReferenceRead | null;
1042
+ definition_revision_id: DefinitionRevisionId | null;
1043
+ /** Immutable provider-native revision that was merged or published. */
1044
+ delivery_revision: string;
1045
+ /** Format: date-time */
1046
+ created_at: string;
1047
+ request_id?: RequestId;
1048
+ }
1049
+ export type TargetReleaseResponse = TargetRelease & ResponseMetadata;
1050
+ /** Response shape for TargetReleaseResponse. */
1051
+ export type TargetReleaseResponseRead = TargetReleaseRead & ResponseMetadata;
1052
+ export interface TargetReleaseList {
1053
+ object: ListObject;
1054
+ data: TargetRelease[];
1055
+ has_more: boolean;
1056
+ next_cursor: string | null;
1057
+ request_id: RequestId;
1058
+ }
1059
+ /** Response shape for TargetReleaseList. */
1060
+ export interface TargetReleaseListRead {
1061
+ object: ListObject;
1062
+ data: TargetReleaseRead[];
1063
+ has_more: boolean;
1064
+ next_cursor: string | null;
1065
+ request_id: RequestId;
1066
+ }
1067
+ export interface RepositoryHealthIssue {
1068
+ code: "connection_missing" | "definition_unreadable" | "contents_write_missing" | "review_write_missing" | "breaking_acknowledgement_missing" | "provider_unavailable";
1069
+ message: string;
1070
+ }
1071
+ /** Response shape for RepositoryHealthIssue. */
1072
+ export interface RepositoryHealthIssueRead {
1073
+ code: ("connection_missing" | "definition_unreadable" | "contents_write_missing" | "review_write_missing" | "breaking_acknowledgement_missing" | "provider_unavailable") | (string & {});
268
1074
  message: string;
269
1075
  }
270
- export interface GithubRepositoryHealth {
271
- repository: string;
1076
+ export interface RepositoryHealth {
1077
+ repository: RepositoryReference;
272
1078
  roles: Array<"source" | "destination">;
273
1079
  status: "ready" | "action_required";
274
1080
  default_branch?: string;
275
- can_read?: boolean;
276
- can_write?: boolean;
277
- breaking_label?: boolean | null;
278
- spec?: "readable" | "missing";
279
- issues: GithubHealthIssue[];
1081
+ capabilities?: string[];
1082
+ /**
1083
+ * Whether a source repository has the optional typeship:breaking-approved policy label. Null when
1084
+ * the repository is not a source or labels could not be read.
1085
+ */
1086
+ breaking_acknowledgement?: boolean | null;
1087
+ definition?: "readable" | "missing";
1088
+ issues: RepositoryHealthIssue[];
280
1089
  }
281
- export interface GithubDeliveryHealth {
1090
+ /** Response shape for RepositoryHealth. */
1091
+ export interface RepositoryHealthRead {
1092
+ repository: RepositoryReferenceRead;
1093
+ roles: Array<("source" | "destination") | (string & {})>;
1094
+ status: ("ready" | "action_required") | (string & {});
1095
+ default_branch?: string;
1096
+ capabilities?: string[];
1097
+ /**
1098
+ * Whether a source repository has the optional typeship:breaking-approved policy label. Null when
1099
+ * the repository is not a source or labels could not be read.
1100
+ */
1101
+ breaking_acknowledgement?: boolean | null;
1102
+ definition?: ("readable" | "missing") | (string & {});
1103
+ issues: RepositoryHealthIssueRead[];
1104
+ }
1105
+ export interface RepositoryEventHealth {
1106
+ provider: string;
282
1107
  id: string;
283
1108
  event: string;
284
1109
  status: "queued" | "processing" | "succeeded" | "failed" | "superseded";
@@ -286,49 +1111,150 @@ export interface GithubDeliveryHealth {
286
1111
  /** Format: date-time */
287
1112
  created_at: string;
288
1113
  }
289
- export interface GithubIntegrationHealth {
290
- object: "github_integration_health";
1114
+ /** Response shape for RepositoryEventHealth. */
1115
+ export interface RepositoryEventHealthRead {
1116
+ provider: string;
1117
+ id: string;
1118
+ event: string;
1119
+ status: ("queued" | "processing" | "succeeded" | "failed" | "superseded") | (string & {});
1120
+ error: string | null;
1121
+ /** Format: date-time */
1122
+ created_at: string;
1123
+ }
1124
+ export interface RepositoryIntegrationHealth {
1125
+ object: "repository_integration_health";
291
1126
  project_id: ProjectId;
292
1127
  status: "ready" | "action_required";
293
- repositories: GithubRepositoryHealth[];
294
- required_statuses: {
1128
+ repositories: RepositoryHealth[];
1129
+ required_checks: {
1130
+ source: string[];
1131
+ destination: string[];
1132
+ };
1133
+ last_event: RepositoryEventHealth | null;
1134
+ request_id: RequestId;
1135
+ }
1136
+ /** Response shape for RepositoryIntegrationHealth. */
1137
+ export interface RepositoryIntegrationHealthRead {
1138
+ object: "repository_integration_health" | (string & {});
1139
+ project_id: ProjectId;
1140
+ status: ("ready" | "action_required") | (string & {});
1141
+ repositories: RepositoryHealthRead[];
1142
+ required_checks: {
295
1143
  source: string[];
296
1144
  destination: string[];
297
1145
  };
298
- last_delivery: GithubDeliveryHealth | null;
1146
+ last_event: RepositoryEventHealthRead | null;
1147
+ request_id: RequestId;
1148
+ }
1149
+ export interface DefinitionFields {
1150
+ source: DefinitionSourceInput;
1151
+ /** Default: [] */
1152
+ patches?: DefinitionPatch[];
1153
+ /** GraphQL-only endpoint, auth, environment, title, and scalar settings. */
1154
+ graphql?: GraphqlSettings | null;
1155
+ diagnostic_policy?: DiagnosticPolicy;
1156
+ }
1157
+ /** Response shape for DefinitionFields. */
1158
+ export interface DefinitionFieldsRead {
1159
+ source: DefinitionSourceInputRead;
1160
+ /** Default: [] */
1161
+ patches?: DefinitionPatchRead[];
1162
+ /** GraphQL-only endpoint, auth, environment, title, and scalar settings. */
1163
+ graphql?: GraphqlSettingsRead | null;
1164
+ diagnostic_policy?: DiagnosticPolicyRead;
1165
+ }
1166
+ export interface Definition {
1167
+ id: DefinitionId;
1168
+ object: "definition";
1169
+ project_id: ProjectId;
1170
+ source: DefinitionSource;
1171
+ format: "openapi" | "graphql" | null;
1172
+ patches: DefinitionPatch[];
1173
+ graphql: GraphqlSettings | null;
1174
+ diagnostic_policy: DiagnosticPolicy;
1175
+ latest_revision_id: DefinitionRevisionId | null;
1176
+ /** Format: date-time */
1177
+ created_at: string;
1178
+ /** Format: date-time */
1179
+ updated_at: string;
1180
+ request_id: RequestId;
1181
+ }
1182
+ /** Request shape for Definition. */
1183
+ export interface DefinitionWrite {
1184
+ id: DefinitionId;
1185
+ object: "definition";
1186
+ project_id: ProjectId;
1187
+ source: DefinitionSourceWrite;
1188
+ format: "openapi" | "graphql" | null;
1189
+ patches: DefinitionPatch[];
1190
+ graphql: GraphqlSettings | null;
1191
+ diagnostic_policy: DiagnosticPolicy;
1192
+ latest_revision_id: DefinitionRevisionId | null;
1193
+ /** Format: date-time */
1194
+ created_at: string;
1195
+ /** Format: date-time */
1196
+ updated_at: string;
1197
+ request_id: RequestId;
1198
+ }
1199
+ /** Response shape for Definition. */
1200
+ export interface DefinitionRead {
1201
+ id: DefinitionId;
1202
+ object: "definition" | (string & {});
1203
+ project_id: ProjectId;
1204
+ source: DefinitionSourceRead;
1205
+ format: ("openapi" | "graphql" | null) | (string & {}) | null;
1206
+ patches: DefinitionPatchRead[];
1207
+ graphql: GraphqlSettingsRead | null;
1208
+ diagnostic_policy: DiagnosticPolicyRead;
1209
+ latest_revision_id: DefinitionRevisionId | null;
1210
+ /** Format: date-time */
1211
+ created_at: string;
1212
+ /** Format: date-time */
1213
+ updated_at: string;
1214
+ request_id: RequestId;
1215
+ }
1216
+ export interface DefinitionUpdateRequest {
1217
+ source?: DefinitionSourceInput;
1218
+ patches?: DefinitionPatch[];
1219
+ graphql?: GraphqlSettings | null;
1220
+ diagnostic_policy?: DiagnosticPolicy;
1221
+ }
1222
+ /** Response shape for DefinitionUpdateRequest. */
1223
+ export interface DefinitionUpdateRequestRead {
1224
+ source?: DefinitionSourceInputRead;
1225
+ patches?: DefinitionPatchRead[];
1226
+ graphql?: GraphqlSettingsRead | null;
1227
+ diagnostic_policy?: DiagnosticPolicyRead;
299
1228
  }
300
1229
  export interface Project {
301
1230
  id: ProjectId;
302
1231
  object: "project";
303
1232
  name: string;
304
- source: ProjectSource;
305
- packages: ProjectPackages;
1233
+ definition_id: DefinitionId;
1234
+ /** All configured Targets, including disabled Targets and their saved Deliveries. */
1235
+ targets: Target[];
306
1236
  /**
307
- * Regenerate when the spec changes: on every push to the default branch for a repository source,
308
- * every 30 minutes for a URL source. Off by default: the first generation is always one you asked
309
- * for. Off means only "generate now" and POST /projects/{project_id}/generations regenerate.
1237
+ * Flattened convenience view derived from the same Target bundles. Every Delivery retains
1238
+ * target_id so ownership is explicit.
310
1239
  */
311
- auto_regen: boolean;
312
- spec_patches: SpecPatch[];
313
- config: Config | null;
1240
+ deliveries: Delivery[];
314
1241
  /**
315
- * Whether the hosted MCP endpoint is on. Requires the MCP output and Enterprise; turning the
316
- * output off turns this off.
1242
+ * Regenerate when the Definition changes: on every push to the default branch for a repository
1243
+ * source, every 30 minutes for a URL source. Off by default: the first generation is always one
1244
+ * you asked for. Off means only "generate now" and POST /projects/{project_id}/generations
1245
+ * regenerate.
317
1246
  */
318
- mcp_enabled: boolean;
319
- /** Path of the hosted MCP endpoint while it is on; read-only. */
320
- mcp_url: string | null;
1247
+ auto_generate: boolean;
321
1248
  /**
322
1249
  * Whether the webhook relay is on, letting the generated CLI's webhooks listen command mint relay
323
- * sessions. Requires the cli output and Pro; turning the output off turns this off.
1250
+ * sessions. Requires the cli target and Pro; turning the target off turns this off.
324
1251
  */
325
1252
  relay_enabled: boolean;
326
1253
  /**
327
- * First-class generated outputs. Any non-empty combination is valid. Free keeps every selected
328
- * output current for the first 25 operations in one linked project. On Pro, each selected output
329
- * is billed once; shared implementation runtimes are included.
1254
+ * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
1255
+ * settings remain Definition-owned.
330
1256
  */
331
- outputs: OutputId[];
1257
+ config: ProjectConfig | null;
332
1258
  /** Format: date-time */
333
1259
  created_at: string;
334
1260
  /**
@@ -336,55 +1262,163 @@ export interface Project {
336
1262
  * Format: date-time
337
1263
  */
338
1264
  updated_at: string;
1265
+ request_id: RequestId;
1266
+ }
1267
+ /** Request shape for Project. */
1268
+ export interface ProjectWrite {
1269
+ name: string;
1270
+ definition_id: DefinitionId;
1271
+ /** All configured Targets, including disabled Targets and their saved Deliveries. */
1272
+ targets: Target[];
1273
+ /**
1274
+ * Flattened convenience view derived from the same Target bundles. Every Delivery retains
1275
+ * target_id so ownership is explicit.
1276
+ */
1277
+ deliveries: Delivery[];
1278
+ /**
1279
+ * Regenerate when the Definition changes: on every push to the default branch for a repository
1280
+ * source, every 30 minutes for a URL source. Off by default: the first generation is always one
1281
+ * you asked for. Off means only "generate now" and POST /projects/{project_id}/generations
1282
+ * regenerate.
1283
+ */
1284
+ auto_generate: boolean;
1285
+ /**
1286
+ * Whether the webhook relay is on, letting the generated CLI's webhooks listen command mint relay
1287
+ * sessions. Requires the cli target and Pro; turning the target off turns this off.
1288
+ */
1289
+ relay_enabled: boolean;
1290
+ /**
1291
+ * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
1292
+ * settings remain Definition-owned.
1293
+ */
1294
+ config: ProjectConfig | null;
1295
+ request_id: RequestId;
1296
+ }
1297
+ /** Response shape for Project. */
1298
+ export interface ProjectRead {
1299
+ id: ProjectId;
1300
+ object: "project" | (string & {});
1301
+ name: string;
1302
+ definition_id: DefinitionId;
1303
+ /** All configured Targets, including disabled Targets and their saved Deliveries. */
1304
+ targets: TargetRead[];
1305
+ /**
1306
+ * Flattened convenience view derived from the same Target bundles. Every Delivery retains
1307
+ * target_id so ownership is explicit.
1308
+ */
1309
+ deliveries: DeliveryRead[];
1310
+ /**
1311
+ * Regenerate when the Definition changes: on every push to the default branch for a repository
1312
+ * source, every 30 minutes for a URL source. Off by default: the first generation is always one
1313
+ * you asked for. Off means only "generate now" and POST /projects/{project_id}/generations
1314
+ * regenerate.
1315
+ */
1316
+ auto_generate: boolean;
1317
+ /**
1318
+ * Whether the webhook relay is on, letting the generated CLI's webhooks listen command mint relay
1319
+ * sessions. Requires the cli target and Pro; turning the target off turns this off.
1320
+ */
1321
+ relay_enabled: boolean;
1322
+ /**
1323
+ * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
1324
+ * settings remain Definition-owned.
1325
+ */
1326
+ config: ProjectConfigRead | null;
1327
+ /** Format: date-time */
1328
+ created_at: string;
1329
+ /**
1330
+ * When the project configuration last changed.
1331
+ * Format: date-time
1332
+ */
1333
+ updated_at: string;
1334
+ request_id: RequestId;
1335
+ }
1336
+ /**
1337
+ * Lean Project identity returned by collection endpoints. Retrieve the Project or list its Targets
1338
+ * for the complete aggregate.
1339
+ */
1340
+ export interface ProjectSummary {
1341
+ id: ProjectId;
1342
+ object: "project";
1343
+ name: string;
1344
+ definition_id: DefinitionId;
1345
+ auto_generate: boolean;
1346
+ /** Format: date-time */
1347
+ created_at: string;
1348
+ /** Format: date-time */
1349
+ updated_at: string;
1350
+ }
1351
+ /** Response shape for ProjectSummary. */
1352
+ export interface ProjectSummaryRead {
1353
+ id: ProjectId;
1354
+ object: "project" | (string & {});
1355
+ name: string;
1356
+ definition_id: DefinitionId;
1357
+ auto_generate: boolean;
1358
+ /** Format: date-time */
1359
+ created_at: string;
1360
+ /** Format: date-time */
1361
+ updated_at: string;
339
1362
  }
340
1363
  export interface CreateProjectRequest {
341
1364
  name: string;
342
- source: ProjectSourceInput;
343
- /** First-class outputs Typeship will keep current for this project. */
344
- outputs: OutputId[];
1365
+ definition: DefinitionFields;
345
1366
  /**
346
- * Initial package names, versions, and destinations. Omitted outputs use derived names and no
347
- * destination.
1367
+ * Initial first-class Targets. More than one may use the same generator with different identities
1368
+ * or Deliveries.
348
1369
  */
349
- packages?: Packages;
1370
+ targets: InitialTargetFields[];
350
1371
  /**
351
1372
  * Whether Typeship should regenerate automatically when the source changes.
352
1373
  * Default: false
353
1374
  */
354
- auto_regen?: boolean;
355
- /** Initial patches. Omit or pass an empty array for none. */
356
- spec_patches?: SpecPatch[];
1375
+ auto_generate?: boolean;
1376
+ /**
1377
+ * Enable webhook relay sessions. Requires the CLI target and Pro.
1378
+ * Default: false
1379
+ */
1380
+ relay_enabled?: boolean;
1381
+ /** Shared defaults inherited by every Target. GraphQL settings belong in definition.graphql. */
1382
+ config?: ProjectConfig | null;
1383
+ }
1384
+ /** Response shape for CreateProjectRequest. */
1385
+ export interface CreateProjectRequestRead {
1386
+ name: string;
1387
+ definition: DefinitionFieldsRead;
1388
+ /**
1389
+ * Initial first-class Targets. More than one may use the same generator with different identities
1390
+ * or Deliveries.
1391
+ */
1392
+ targets: InitialTargetFieldsRead[];
357
1393
  /**
358
- * Serve this project as a hosted MCP endpoint. Requires the MCP output and Enterprise.
1394
+ * Whether Typeship should regenerate automatically when the source changes.
359
1395
  * Default: false
360
1396
  */
361
- mcp_enabled?: boolean;
1397
+ auto_generate?: boolean;
362
1398
  /**
363
- * Enable webhook relay sessions. Requires the CLI output and Pro.
1399
+ * Enable webhook relay sessions. Requires the CLI target and Pro.
364
1400
  * Default: false
365
1401
  */
366
1402
  relay_enabled?: boolean;
367
- config?: Config | null;
1403
+ /** Shared defaults inherited by every Target. GraphQL settings belong in definition.graphql. */
1404
+ config?: ProjectConfigRead | null;
368
1405
  }
369
1406
  export interface UpdateProjectRequest {
370
1407
  name?: string;
371
- source?: ProjectSourceInput;
372
- /** Replaces the selected outputs; delivered files are not deleted. */
373
- outputs?: OutputId[];
374
- /**
375
- * Replaces package configuration for every output. Include any existing output settings you want
376
- * to keep.
377
- */
378
- packages?: Packages;
379
- auto_regen?: boolean;
380
- /** Replaces the full patch list. Pass an empty array to clear it. */
381
- spec_patches?: SpecPatch[];
382
- /** Serve this project as a hosted MCP endpoint. Requires the MCP output and Enterprise. */
383
- mcp_enabled?: boolean;
384
- /** Enable webhook relay sessions. Requires the CLI output and Pro. */
1408
+ auto_generate?: boolean;
1409
+ /** Enable webhook relay sessions. Requires the CLI target and Pro. */
1410
+ relay_enabled?: boolean;
1411
+ /** Replaces the Project's shared Target defaults. Send null to clear them. */
1412
+ config?: ProjectConfig | null;
1413
+ }
1414
+ /** Response shape for UpdateProjectRequest. */
1415
+ export interface UpdateProjectRequestRead {
1416
+ name?: string;
1417
+ auto_generate?: boolean;
1418
+ /** Enable webhook relay sessions. Requires the CLI target and Pro. */
385
1419
  relay_enabled?: boolean;
386
- /** Replaces the entire configuration; pass null to clear it. */
387
- config?: Config | null;
1420
+ /** Replaces the Project's shared Target defaults. Send null to clear them. */
1421
+ config?: ProjectConfigRead | null;
388
1422
  }
389
1423
  /**
390
1424
  * The organization an API key belongs to. Members share its projects, keys, and plan; sign-in
@@ -398,9 +1432,23 @@ export interface Account {
398
1432
  plan: "free" | "pro" | "enterprise";
399
1433
  /** Format: date-time */
400
1434
  created_at: string;
1435
+ request_id: RequestId;
1436
+ }
1437
+ /** Response shape for Account. */
1438
+ export interface AccountRead {
1439
+ id: string;
1440
+ object: "account" | (string & {});
1441
+ /** The organization's display name. */
1442
+ name: string;
1443
+ plan: ("free" | "pro" | "enterprise") | (string & {});
1444
+ /** Format: date-time */
1445
+ created_at: string;
1446
+ request_id: RequestId;
401
1447
  }
402
1448
  /** How the generated CLI behaves. Part of Config. */
403
1449
  export interface CliBehavior {
1450
+ /** Command users run, independent of how the CLI is distributed. */
1451
+ command_name?: string | null;
404
1452
  /**
405
1453
  * resource.method of a zero-argument GET that the generated CLI's whoami command calls. Overrides
406
1454
  * auto-detection; a value that matches nothing is reported as a generation warning.
@@ -446,62 +1494,144 @@ export interface CliBehavior {
446
1494
  }
447
1495
  /** How the generated MCP server and the hosted endpoint behave. Part of Config. */
448
1496
  export interface McpBehavior {
1497
+ /** Stable official MCP registry name, independent of the server runtime. */
1498
+ registry_name?: string | null;
1499
+ /**
1500
+ * MCP tool shape. meta collapses per-operation tools into search_docs, read_docs, and execute so
1501
+ * large APIs don't flood an agent's context window. Auto considers the serialized tool schemas,
1502
+ * switching near 10k tokens or above 100 operations.
1503
+ */
1504
+ tool_mode?: "auto" | "operations" | "meta";
1505
+ /**
1506
+ * Guidance appended to the MCP server's instructions, which agents read once when they connect
1507
+ * (server/discover): what to call first, conventions the spec does not state, what not to do.
1508
+ * Carried by the package's server and the hosted endpoint alike.
1509
+ */
1510
+ instructions?: string | null;
1511
+ /**
1512
+ * Hand-written MCP tool descriptions keyed by operationId or "METHOD /path". Each replaces the
1513
+ * text typeship derives for that operation (summary, first sentence, method and path, deprecation
1514
+ * and auth notes). For flows the spec cannot describe, such as a multi-step upload. Keys that
1515
+ * match no operation are reported as generation warnings.
1516
+ */
1517
+ tool_descriptions?: Record<string, string>;
1518
+ }
1519
+ /** Response shape for McpBehavior. */
1520
+ export interface McpBehaviorRead {
1521
+ /** Stable official MCP registry name, independent of the server runtime. */
1522
+ registry_name?: string | null;
1523
+ /**
1524
+ * MCP tool shape. meta collapses per-operation tools into search_docs, read_docs, and execute so
1525
+ * large APIs don't flood an agent's context window. Auto considers the serialized tool schemas,
1526
+ * switching near 10k tokens or above 100 operations.
1527
+ */
1528
+ tool_mode?: ("auto" | "operations" | "meta") | (string & {});
1529
+ /**
1530
+ * Guidance appended to the MCP server's instructions, which agents read once when they connect
1531
+ * (server/discover): what to call first, conventions the spec does not state, what not to do.
1532
+ * Carried by the package's server and the hosted endpoint alike.
1533
+ */
1534
+ instructions?: string | null;
1535
+ /**
1536
+ * Hand-written MCP tool descriptions keyed by operationId or "METHOD /path". Each replaces the
1537
+ * text typeship derives for that operation (summary, first sentence, method and path, deprecation
1538
+ * and auth notes). For flows the spec cannot describe, such as a multi-step upload. Keys that
1539
+ * match no operation are reported as generation warnings.
1540
+ */
1541
+ tool_descriptions?: Record<string, string>;
1542
+ }
1543
+ /**
1544
+ * Published-package metadata the API spec does not own. Repository is derived from each
1545
+ * destination.
1546
+ */
1547
+ export interface PackageBehavior {
1548
+ /** Homepage written into registry metadata. */
1549
+ homepage?: string | null;
1550
+ /** SPDX identifier written into registry metadata. Defaults to info.license. */
1551
+ license?: string | null;
1552
+ /**
1553
+ * Exact LICENSE file contents. Supply this for licences the engine does not build in; MIT is
1554
+ * built in when copyright is also set.
1555
+ */
1556
+ license_text?: string | null;
1557
+ /** Copyright line used in generated license files. */
1558
+ copyright?: string | null;
1559
+ /** Go identifier when the destination repository name is unsuitable. */
1560
+ go_package_name?: string | null;
1561
+ }
1562
+ /**
1563
+ * Everything Typeship needs beyond the Definition, in one object: generation customization
1564
+ * (globals, retries, pagination) and how the generated tooling behaves (cli, mcp, package,
1565
+ * docs_url). Plain configuration. Typeship never requires vendor extensions inside the Definition
1566
+ * itself. Stateless generation also accepts GraphQL settings here; stored projects keep those
1567
+ * settings on their Definition.
1568
+ */
1569
+ export interface Config {
1570
+ /**
1571
+ * Wire names of query/header parameters that become settable once on the generated client and
1572
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
1573
+ * are reported as generation warnings.
1574
+ */
1575
+ globals?: string[];
1576
+ retries?: RetryTuning;
1577
+ /**
1578
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
1579
+ * reported as generation warnings.
1580
+ */
1581
+ pagination?: Record<string, PaginationRule | boolean>;
1582
+ graphql?: GraphqlSettings;
1583
+ cli?: CliBehavior;
1584
+ mcp?: McpBehavior;
1585
+ package?: PackageBehavior;
1586
+ /**
1587
+ * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
1588
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
1589
+ * externalDocs URL.
1590
+ */
1591
+ docs_url?: string | null;
449
1592
  /**
450
- * MCP tool shape. meta collapses per-operation tools into search_docs, read_docs, and execute so
451
- * large APIs don't flood an agent's context window. Auto considers the serialized tool schemas,
452
- * switching near 10k tokens or above 100 operations.
1593
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
1594
+ * Format: uri
453
1595
  */
454
- tool_mode?: "auto" | "operations" | "meta";
1596
+ docs_index_url?: string | null;
1597
+ }
1598
+ /** Response shape for Config. */
1599
+ export interface ConfigRead {
455
1600
  /**
456
- * Guidance appended to the MCP server's instructions, which agents read once when they connect
457
- * (server/discover): what to call first, conventions the spec does not state, what not to do.
458
- * Carried by the package's server and the hosted endpoint alike.
1601
+ * Wire names of query/header parameters that become settable once on the generated client and
1602
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
1603
+ * are reported as generation warnings.
459
1604
  */
460
- instructions?: string | null;
1605
+ globals?: string[];
1606
+ retries?: RetryTuning;
461
1607
  /**
462
- * Hand-written MCP tool descriptions keyed by operationId or "METHOD /path". Each replaces the
463
- * text typeship derives for that operation (summary, first sentence, method and path, deprecation
464
- * and auth notes). For flows the spec cannot describe, such as a multi-step upload. Keys that
465
- * match no operation are reported as generation warnings.
1608
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
1609
+ * reported as generation warnings.
466
1610
  */
467
- tool_descriptions?: Record<string, string>;
468
- }
469
- /**
470
- * Published-package metadata the API spec does not own. Repository is derived from each
471
- * destination; release versions belong to packages.
472
- */
473
- export interface PackageBehavior {
1611
+ pagination?: Record<string, PaginationRuleRead | boolean>;
1612
+ graphql?: GraphqlSettingsRead;
1613
+ cli?: CliBehavior;
1614
+ mcp?: McpBehaviorRead;
1615
+ package?: PackageBehavior;
474
1616
  /**
475
- * Lockstep version fallback. Prefer packages.<output>.version so every SDK, CLI, and MCP package
476
- * can advance independently.
477
- * @deprecated
1617
+ * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
1618
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
1619
+ * externalDocs URL.
478
1620
  */
479
- version?: string | null;
480
- /** Homepage written into registry metadata. */
481
- homepage?: string | null;
482
- /** SPDX identifier written into registry metadata. Defaults to info.license. */
483
- license?: string | null;
1621
+ docs_url?: string | null;
484
1622
  /**
485
- * Exact LICENSE file contents. Supply this for licences the engine does not build in; MIT is
486
- * built in when copyright is also set.
1623
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
1624
+ * Format: uri
487
1625
  */
488
- license_text?: string | null;
489
- /** Copyright line used in generated license files. */
490
- copyright?: string | null;
491
- /** CLI executable name when it differs from the npm package name. */
492
- bin_name?: string | null;
493
- /** Go identifier when the destination repository name is unsuitable. */
494
- go_package_name?: string | null;
495
- /** Official MCP registry name written into package.json. */
496
- mcp_name?: string | null;
1626
+ docs_index_url?: string | null;
497
1627
  }
498
1628
  /**
499
- * Everything typeship needs beyond the spec, in one object: generation customization (globals,
500
- * retries, pagination) and how the generated tooling behaves (cli, mcp, package, docs_url). Plain
501
- * configuration. typeship never requires vendor extensions inside the spec itself. The same shape
502
- * is accepted on a project and on POST /generate.
1629
+ * Shared generated-client and tooling behavior for a stored Project. Every Target inherits these
1630
+ * defaults. Target.config is merged over them for one Target; top-level values replace defaults
1631
+ * while cli, mcp, and package merge by field. GraphQL-only source settings live on the Project's
1632
+ * Definition and are rejected in both stored config scopes.
503
1633
  */
504
- export interface Config {
1634
+ export interface ProjectConfig {
505
1635
  /**
506
1636
  * Wire names of query/header parameters that become settable once on the generated client and
507
1637
  * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
@@ -514,16 +1644,49 @@ export interface Config {
514
1644
  * reported as generation warnings.
515
1645
  */
516
1646
  pagination?: Record<string, PaginationRule | boolean>;
517
- graphql?: GraphqlSettings;
518
1647
  cli?: CliBehavior;
519
1648
  mcp?: McpBehavior;
520
1649
  package?: PackageBehavior;
521
1650
  /**
522
1651
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
523
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the spec's externalDocs
524
- * URL.
1652
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
1653
+ * externalDocs URL.
1654
+ */
1655
+ docs_url?: string | null;
1656
+ /**
1657
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
1658
+ * Format: uri
1659
+ */
1660
+ docs_index_url?: string | null;
1661
+ }
1662
+ /** Response shape for ProjectConfig. */
1663
+ export interface ProjectConfigRead {
1664
+ /**
1665
+ * Wire names of query/header parameters that become settable once on the generated client and
1666
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
1667
+ * are reported as generation warnings.
1668
+ */
1669
+ globals?: string[];
1670
+ retries?: RetryTuning;
1671
+ /**
1672
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
1673
+ * reported as generation warnings.
1674
+ */
1675
+ pagination?: Record<string, PaginationRuleRead | boolean>;
1676
+ cli?: CliBehavior;
1677
+ mcp?: McpBehaviorRead;
1678
+ package?: PackageBehavior;
1679
+ /**
1680
+ * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
1681
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
1682
+ * externalDocs URL.
525
1683
  */
526
1684
  docs_url?: string | null;
1685
+ /**
1686
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
1687
+ * Format: uri
1688
+ */
1689
+ docs_index_url?: string | null;
527
1690
  }
528
1691
  /** What a GraphQL schema cannot say about itself. Ignored for OpenAPI specs. */
529
1692
  export interface GraphqlSettings {
@@ -555,8 +1718,8 @@ export interface GraphqlSettings {
555
1718
  */
556
1719
  api_key_header?: string;
557
1720
  /**
558
- * The API's name; drives the package and client names ("Braintree" gives braintree and
559
- * BraintreeClient). Defaults to a name derived from the endpoint's host.
1721
+ * The API's name; drives the package and client names ("Acme" gives acme and AcmeClient).
1722
+ * Defaults to a name derived from the endpoint's host.
560
1723
  */
561
1724
  title?: string;
562
1725
  /**
@@ -565,6 +1728,46 @@ export interface GraphqlSettings {
565
1728
  */
566
1729
  scalars?: Record<string, "string" | "integer" | "number" | "boolean" | "json">;
567
1730
  }
1731
+ /** Response shape for GraphqlSettings. */
1732
+ export interface GraphqlSettingsRead {
1733
+ /**
1734
+ * The URL every request is POSTed to; the generated client's default baseUrl. Defaults to the URL
1735
+ * the schema was fetched from. Without either, baseUrl is a required client option.
1736
+ * Format: uri
1737
+ */
1738
+ endpoint?: string;
1739
+ /**
1740
+ * Named endpoints (sandbox, production). Each becomes a client environment; the first is the
1741
+ * default unless endpoint is set.
1742
+ */
1743
+ environments?: Array<{
1744
+ name: string;
1745
+ /** Format: uri */
1746
+ url: string;
1747
+ }>;
1748
+ /**
1749
+ * How requests authenticate. bearer sends Authorization: Bearer; basic is for key-pair APIs
1750
+ * (public key as username, private key as password); api_key sends a header named by
1751
+ * api_key_header; none generates no auth option.
1752
+ * Default: "bearer"
1753
+ */
1754
+ auth?: ("bearer" | "basic" | "api_key" | "none") | (string & {});
1755
+ /**
1756
+ * Header carrying the key when auth is api_key. Required for that mode; Typeship does not invent
1757
+ * a vendor-specific header name.
1758
+ */
1759
+ api_key_header?: string;
1760
+ /**
1761
+ * The API's name; drives the package and client names ("Acme" gives acme and AcmeClient).
1762
+ * Defaults to a name derived from the endpoint's host.
1763
+ */
1764
+ title?: string;
1765
+ /**
1766
+ * JSON representation of each custom scalar, keyed by GraphQL scalar name. Unmapped scalars
1767
+ * generate as the language's untyped JSON value and produce a warning. Unmatched keys warn.
1768
+ */
1769
+ scalars?: Record<string, ("string" | "integer" | "number" | "boolean" | "json") | (string & {})>;
1770
+ }
568
1771
  /**
569
1772
  * Retry behavior. Top-level fields adjust every operation; operations maps operationId or "METHOD
570
1773
  * /path" keys to per-operation overrides.
@@ -594,6 +1797,20 @@ export interface PaginationRule {
594
1797
  offset_param?: string;
595
1798
  limit_param?: string;
596
1799
  }
1800
+ /** Response shape for PaginationRule. */
1801
+ export interface PaginationRuleRead {
1802
+ /** Default: "cursor" */
1803
+ style?: ("cursor" | "cursorFromLastId" | "page" | "offset") | (string & {});
1804
+ /** Response field holding the item array. */
1805
+ items_field: string;
1806
+ cursor_param?: string;
1807
+ next_cursor_field?: string;
1808
+ has_more_field?: string;
1809
+ id_field?: string;
1810
+ page_param?: string;
1811
+ offset_param?: string;
1812
+ limit_param?: string;
1813
+ }
597
1814
  export interface FileStub {
598
1815
  path: string;
599
1816
  bytes: number;
@@ -602,16 +1819,80 @@ export interface Generation {
602
1819
  id: GenerationId;
603
1820
  object: "generation";
604
1821
  /**
605
- * Present and true when the generated output was too large to inline; files_index lists paths,
1822
+ * Present and true when the generated target was too large to inline; files_index lists paths,
1823
+ * fetched one at a time via GET /generations/{generation_id}/file.
1824
+ */
1825
+ files_omitted?: boolean;
1826
+ files_index?: FileStub[];
1827
+ project_id: ProjectId;
1828
+ definition_revision_id: DefinitionRevisionId | null;
1829
+ status: "succeeded" | "failed";
1830
+ trigger: "manual" | "webhook" | "poll" | "preview";
1831
+ /** Persisted Target identity. Null only for stateless generation. */
1832
+ target_id: TargetId | null;
1833
+ /** Resolved generator implementation; provenance rather than resource identity. */
1834
+ generator: GeneratorKind;
1835
+ provenance: {
1836
+ /** Pinned generator contract edition. */
1837
+ generator_edition: string;
1838
+ /** Exact engine build identifier used for replay and support. */
1839
+ engine_build: string;
1840
+ /**
1841
+ * Immutable effective Target configuration used by this run; source credentials are never
1842
+ * included.
1843
+ */
1844
+ resolved_config: Record<string, unknown> | null;
1845
+ config_hash: string | null;
1846
+ /** Resolved generator and entitlement plan used to select the emitted public surface. */
1847
+ surface_plan: Record<string, unknown> | null;
1848
+ surface_plan_hash: string | null;
1849
+ entitlement_cap: number | null;
1850
+ package_version: string | null;
1851
+ };
1852
+ /** Null only for a failed or legacy generation that produced no metadata. */
1853
+ meta: GenerationMeta | null;
1854
+ warnings: string[];
1855
+ /** Present on retrieve and create; omitted in lists. */
1856
+ files?: GeneratedFile[];
1857
+ error: string | null;
1858
+ /** Format: date-time */
1859
+ created_at: string;
1860
+ request_id?: RequestId;
1861
+ }
1862
+ /** Request shape for Generation. */
1863
+ export interface GenerationWrite {
1864
+ id: GenerationId;
1865
+ /**
1866
+ * Present and true when the generated target was too large to inline; files_index lists paths,
606
1867
  * fetched one at a time via GET /generations/{generation_id}/file.
607
1868
  */
608
1869
  files_omitted?: boolean;
609
1870
  files_index?: FileStub[];
610
1871
  project_id: ProjectId;
1872
+ definition_revision_id: DefinitionRevisionId | null;
611
1873
  status: "succeeded" | "failed";
612
1874
  trigger: "manual" | "webhook" | "poll" | "preview";
613
- /** The independently delivered output this run generated. */
614
- output: OutputId;
1875
+ /** Persisted Target identity. Null only for stateless generation. */
1876
+ target_id: TargetId | null;
1877
+ /** Resolved generator implementation; provenance rather than resource identity. */
1878
+ generator: GeneratorKind;
1879
+ provenance: {
1880
+ /** Pinned generator contract edition. */
1881
+ generator_edition: string;
1882
+ /** Exact engine build identifier used for replay and support. */
1883
+ engine_build: string;
1884
+ /**
1885
+ * Immutable effective Target configuration used by this run; source credentials are never
1886
+ * included.
1887
+ */
1888
+ resolved_config: Record<string, unknown> | null;
1889
+ config_hash: string | null;
1890
+ /** Resolved generator and entitlement plan used to select the emitted public surface. */
1891
+ surface_plan: Record<string, unknown> | null;
1892
+ surface_plan_hash: string | null;
1893
+ entitlement_cap: number | null;
1894
+ package_version: string | null;
1895
+ };
615
1896
  /** Null only for a failed or legacy generation that produced no metadata. */
616
1897
  meta: GenerationMeta | null;
617
1898
  warnings: string[];
@@ -620,15 +1901,85 @@ export interface Generation {
620
1901
  error: string | null;
621
1902
  /** Format: date-time */
622
1903
  created_at: string;
1904
+ request_id?: RequestId;
1905
+ }
1906
+ /** Response shape for Generation. */
1907
+ export interface GenerationRead {
1908
+ id: GenerationId;
1909
+ object: "generation" | (string & {});
1910
+ /**
1911
+ * Present and true when the generated target was too large to inline; files_index lists paths,
1912
+ * fetched one at a time via GET /generations/{generation_id}/file.
1913
+ */
1914
+ files_omitted?: boolean;
1915
+ files_index?: FileStub[];
1916
+ project_id: ProjectId;
1917
+ definition_revision_id: DefinitionRevisionId | null;
1918
+ status: ("succeeded" | "failed") | (string & {});
1919
+ trigger: ("manual" | "webhook" | "poll" | "preview") | (string & {});
1920
+ /** Persisted Target identity. Null only for stateless generation. */
1921
+ target_id: TargetId | null;
1922
+ /** Resolved generator implementation; provenance rather than resource identity. */
1923
+ generator: GeneratorKind | (string & {});
1924
+ provenance: {
1925
+ /** Pinned generator contract edition. */
1926
+ generator_edition: string;
1927
+ /** Exact engine build identifier used for replay and support. */
1928
+ engine_build: string;
1929
+ /**
1930
+ * Immutable effective Target configuration used by this run; source credentials are never
1931
+ * included.
1932
+ */
1933
+ resolved_config: Record<string, unknown> | null;
1934
+ config_hash: string | null;
1935
+ /** Resolved generator and entitlement plan used to select the emitted public surface. */
1936
+ surface_plan: Record<string, unknown> | null;
1937
+ surface_plan_hash: string | null;
1938
+ entitlement_cap: number | null;
1939
+ package_version: string | null;
1940
+ };
1941
+ /** Null only for a failed or legacy generation that produced no metadata. */
1942
+ meta: GenerationMetaRead | null;
1943
+ warnings: string[];
1944
+ /** Present on retrieve and create; omitted in lists. */
1945
+ files?: GeneratedFile[];
1946
+ error: string | null;
1947
+ /** Format: date-time */
1948
+ created_at: string;
1949
+ request_id?: RequestId;
623
1950
  }
624
- /** A selected output that did not generate in a multi-output run. */
1951
+ export type GenerationResponse = Generation & ResponseMetadata;
1952
+ /** Request shape for GenerationResponse. */
1953
+ export type GenerationResponseWrite = GenerationWrite & ResponseMetadata;
1954
+ /** Response shape for GenerationResponse. */
1955
+ export type GenerationResponseRead = GenerationRead & ResponseMetadata;
1956
+ /** A selected target that did not generate in a multi-target run. */
625
1957
  export interface GenerationFailure {
626
- output: OutputId;
1958
+ target_id: TargetId;
1959
+ generator: GeneratorKind;
627
1960
  status: "failed";
628
1961
  error: string;
629
1962
  }
1963
+ /** Response shape for GenerationFailure. */
1964
+ export interface GenerationFailureRead {
1965
+ target_id: TargetId;
1966
+ generator: GeneratorKind | (string & {});
1967
+ status: "failed" | (string & {});
1968
+ error: string;
1969
+ }
630
1970
  export interface GenerationBatch {
631
1971
  data: Array<Generation | GenerationFailure>;
1972
+ request_id: RequestId;
1973
+ }
1974
+ /** Request shape for GenerationBatch. */
1975
+ export interface GenerationBatchWrite {
1976
+ data: Array<GenerationWrite | GenerationFailure>;
1977
+ request_id: RequestId;
1978
+ }
1979
+ /** Response shape for GenerationBatch. */
1980
+ export interface GenerationBatchRead {
1981
+ data: Array<GenerationRead | GenerationFailureRead>;
1982
+ request_id: RequestId;
632
1983
  }
633
1984
  export interface ApiKey {
634
1985
  id: string;
@@ -641,44 +1992,139 @@ export interface ApiKey {
641
1992
  last_used_at: string | null;
642
1993
  /** Format: date-time */
643
1994
  created_at: string;
1995
+ request_id?: RequestId;
1996
+ }
1997
+ /** Response shape for ApiKey. */
1998
+ export interface ApiKeyRead {
1999
+ id: string;
2000
+ object: "api_key" | (string & {});
2001
+ name: string;
2002
+ /** Last four characters of the secret; the secret itself is never stored. */
2003
+ last4: string;
2004
+ revoked: boolean;
2005
+ /** Format: date-time */
2006
+ last_used_at: string | null;
2007
+ /** Format: date-time */
2008
+ created_at: string;
2009
+ request_id?: RequestId;
644
2010
  }
645
- export interface UrlSpecRevisionSource {
2011
+ export type ApiKeyResponse = ApiKey & ResponseMetadata;
2012
+ /** Response shape for ApiKeyResponse. */
2013
+ export type ApiKeyResponseRead = ApiKeyRead & ResponseMetadata;
2014
+ export interface UrlDefinitionRevisionSource {
646
2015
  kind: "url";
647
2016
  /** Format: uri */
648
2017
  url: string;
649
2018
  }
650
- export interface GithubSpecRevisionSource {
651
- kind: "github";
652
- /** GitHub repository in owner/name form. */
653
- repository: string;
654
- /** Repository-relative specification path. */
2019
+ /** Response shape for UrlDefinitionRevisionSource. */
2020
+ export interface UrlDefinitionRevisionSourceRead {
2021
+ kind: "url" | (string & {});
2022
+ /** Format: uri */
2023
+ url: string;
2024
+ }
2025
+ export interface RepositoryDefinitionRevisionSource {
2026
+ kind: "repository";
2027
+ repository: RepositoryReference;
2028
+ /** Repository-relative Definition entrypoint path. */
2029
+ path: string;
2030
+ /** Git ref resolved for this revision, when recorded. */
2031
+ ref?: string | null;
2032
+ /** Exact Git commit consumed, when recorded. */
2033
+ commit_sha?: string | null;
2034
+ }
2035
+ /** Response shape for RepositoryDefinitionRevisionSource. */
2036
+ export interface RepositoryDefinitionRevisionSourceRead {
2037
+ kind: "repository" | (string & {});
2038
+ repository: RepositoryReferenceRead;
2039
+ /** Repository-relative Definition entrypoint path. */
655
2040
  path: string;
656
2041
  /** Git ref resolved for this revision, when recorded. */
657
2042
  ref?: string | null;
658
2043
  /** Exact Git commit consumed, when recorded. */
659
2044
  commit_sha?: string | null;
660
2045
  }
661
- export type SpecRevisionSource = UrlSpecRevisionSource | GithubSpecRevisionSource;
662
- export interface SpecRevision {
663
- id: SpecRevisionId;
664
- object: "spec_revision";
2046
+ export type DefinitionRevisionSource = UrlDefinitionRevisionSource | RepositoryDefinitionRevisionSource;
2047
+ /** Response shape for DefinitionRevisionSource. */
2048
+ export type DefinitionRevisionSourceRead = UrlDefinitionRevisionSourceRead | RepositoryDefinitionRevisionSourceRead | Record<string, unknown> & {
2049
+ kind?: string;
2050
+ };
2051
+ export interface DefinitionDocument {
2052
+ id: DefinitionDocumentId;
2053
+ role: "entrypoint" | "reference";
2054
+ /** Repository-relative path or same-origin URL captured in this revision. */
2055
+ coordinate: string;
2056
+ sha256: string;
2057
+ size_bytes: number;
2058
+ }
2059
+ /** Response shape for DefinitionDocument. */
2060
+ export interface DefinitionDocumentRead {
2061
+ id: DefinitionDocumentId;
2062
+ role: ("entrypoint" | "reference") | (string & {});
2063
+ /** Repository-relative path or same-origin URL captured in this revision. */
2064
+ coordinate: string;
2065
+ sha256: string;
2066
+ size_bytes: number;
2067
+ }
2068
+ export interface DefinitionRevision {
2069
+ id: DefinitionRevisionId;
2070
+ object: "definition_revision";
2071
+ project_id: ProjectId;
2072
+ definition_id: DefinitionId;
2073
+ format: "openapi" | "graphql";
2074
+ document_count: number;
2075
+ /** Present on retrieve; list responses use document_count. */
2076
+ documents?: DefinitionDocument[];
2077
+ /** SHA-256 digest of every document coordinate, digest, and size in the resolved graph. */
2078
+ sha256: string;
2079
+ /** Total bytes across all source documents. */
2080
+ size_bytes: number;
2081
+ /** Origin recorded when this immutable revision was created. */
2082
+ source: DefinitionRevisionSource | null;
2083
+ /** Format: date-time */
2084
+ created_at: string;
2085
+ request_id?: RequestId;
2086
+ }
2087
+ /** Response shape for DefinitionRevision. */
2088
+ export interface DefinitionRevisionRead {
2089
+ id: DefinitionRevisionId;
2090
+ object: "definition_revision" | (string & {});
665
2091
  project_id: ProjectId;
666
- /** SHA-256 digest of the exact raw specification text. */
2092
+ definition_id: DefinitionId;
2093
+ format: ("openapi" | "graphql") | (string & {});
2094
+ document_count: number;
2095
+ /** Present on retrieve; list responses use document_count. */
2096
+ documents?: DefinitionDocumentRead[];
2097
+ /** SHA-256 digest of every document coordinate, digest, and size in the resolved graph. */
667
2098
  sha256: string;
668
- /** Size of the raw specification text in bytes. */
2099
+ /** Total bytes across all source documents. */
669
2100
  size_bytes: number;
670
2101
  /** Origin recorded when this immutable revision was created. */
671
- source: SpecRevisionSource | null;
2102
+ source: DefinitionRevisionSourceRead | null;
672
2103
  /** Format: date-time */
673
2104
  created_at: string;
2105
+ request_id?: RequestId;
674
2106
  }
2107
+ export type DefinitionRevisionResponse = DefinitionRevision & ResponseMetadata;
2108
+ /** Response shape for DefinitionRevisionResponse. */
2109
+ export type DefinitionRevisionResponseRead = DefinitionRevisionRead & ResponseMetadata;
675
2110
  export interface ProjectList {
676
2111
  object: ListObject;
677
- data: Project[];
2112
+ data: ProjectSummary[];
2113
+ /** Whether another page is available after this one. */
2114
+ has_more: boolean;
2115
+ /** Pass this value as cursor to retrieve the next page; null on the last page. */
2116
+ next_cursor: string | null;
2117
+ request_id: RequestId;
2118
+ }
2119
+ /** Response shape for ProjectList. */
2120
+ export interface ProjectListRead {
2121
+ object: ListObject;
2122
+ data: ProjectSummaryRead[];
678
2123
  /** Whether another page is available after this one. */
679
2124
  has_more: boolean;
680
2125
  /** Pass this value as cursor to retrieve the next page; null on the last page. */
681
2126
  next_cursor: string | null;
2127
+ request_id: RequestId;
682
2128
  }
683
2129
  export interface GenerationList {
684
2130
  object: ListObject;
@@ -687,14 +2133,46 @@ export interface GenerationList {
687
2133
  has_more: boolean;
688
2134
  /** Pass this value as cursor to retrieve the next page; null on the last page. */
689
2135
  next_cursor: string | null;
2136
+ request_id: RequestId;
2137
+ }
2138
+ /** Request shape for GenerationList. */
2139
+ export interface GenerationListWrite {
2140
+ object: ListObject;
2141
+ data: GenerationWrite[];
2142
+ /** Whether another page is available after this one. */
2143
+ has_more: boolean;
2144
+ /** Pass this value as cursor to retrieve the next page; null on the last page. */
2145
+ next_cursor: string | null;
2146
+ request_id: RequestId;
2147
+ }
2148
+ /** Response shape for GenerationList. */
2149
+ export interface GenerationListRead {
2150
+ object: ListObject;
2151
+ data: GenerationRead[];
2152
+ /** Whether another page is available after this one. */
2153
+ has_more: boolean;
2154
+ /** Pass this value as cursor to retrieve the next page; null on the last page. */
2155
+ next_cursor: string | null;
2156
+ request_id: RequestId;
2157
+ }
2158
+ export interface DefinitionRevisionList {
2159
+ object: ListObject;
2160
+ data: DefinitionRevision[];
2161
+ /** Whether another page is available after this one. */
2162
+ has_more: boolean;
2163
+ /** Pass this value as cursor to retrieve the next page; null on the last page. */
2164
+ next_cursor: string | null;
2165
+ request_id: RequestId;
690
2166
  }
691
- export interface SpecRevisionList {
2167
+ /** Response shape for DefinitionRevisionList. */
2168
+ export interface DefinitionRevisionListRead {
692
2169
  object: ListObject;
693
- data: SpecRevision[];
2170
+ data: DefinitionRevisionRead[];
694
2171
  /** Whether another page is available after this one. */
695
2172
  has_more: boolean;
696
2173
  /** Pass this value as cursor to retrieve the next page; null on the last page. */
697
2174
  next_cursor: string | null;
2175
+ request_id: RequestId;
698
2176
  }
699
2177
  export interface ApiKeyList {
700
2178
  object: ListObject;
@@ -703,11 +2181,43 @@ export interface ApiKeyList {
703
2181
  has_more: boolean;
704
2182
  /** Pass this value as cursor to retrieve the next page; null on the last page. */
705
2183
  next_cursor: string | null;
2184
+ request_id: RequestId;
2185
+ }
2186
+ /** Response shape for ApiKeyList. */
2187
+ export interface ApiKeyListRead {
2188
+ object: ListObject;
2189
+ data: ApiKeyRead[];
2190
+ /** Whether another page is available after this one. */
2191
+ has_more: boolean;
2192
+ /** Pass this value as cursor to retrieve the next page; null on the last page. */
2193
+ next_cursor: string | null;
2194
+ request_id: RequestId;
706
2195
  }
707
2196
  export interface DeletedProject {
708
2197
  id: ProjectId;
709
2198
  object: "project";
710
2199
  deleted: true;
2200
+ request_id: RequestId;
2201
+ }
2202
+ /** Response shape for DeletedProject. */
2203
+ export interface DeletedProjectRead {
2204
+ id: ProjectId;
2205
+ object: "project" | (string & {});
2206
+ deleted: true;
2207
+ request_id: RequestId;
2208
+ }
2209
+ export interface DeletedTarget {
2210
+ id: TargetId;
2211
+ object: "target";
2212
+ deleted: true;
2213
+ request_id: RequestId;
2214
+ }
2215
+ /** Response shape for DeletedTarget. */
2216
+ export interface DeletedTargetRead {
2217
+ id: TargetId;
2218
+ object: "target" | (string & {});
2219
+ deleted: true;
2220
+ request_id: RequestId;
711
2221
  }
712
2222
  /** Stable category for deciding how to handle the error. */
713
2223
  export declare const ErrorType: {
@@ -726,9 +2236,15 @@ export declare const ErrorCode: {
726
2236
  readonly IDEMPOTENCY_KEY_REUSED: "idempotency_key_reused";
727
2237
  readonly UNAUTHORIZED: "unauthorized";
728
2238
  readonly ORGANIZATION_REQUIRED: "organization_required";
2239
+ readonly INSUFFICIENT_SCOPE: "insufficient_scope";
2240
+ readonly FORBIDDEN: "forbidden";
729
2241
  readonly NOT_FOUND: "not_found";
730
2242
  readonly SPEC_ERROR: "spec_error";
731
2243
  readonly FETCH_ERROR: "fetch_error";
2244
+ readonly REPOSITORY_PROVIDER_UNSUPPORTED: "repository_provider_unsupported";
2245
+ readonly EDITION_UNAVAILABLE: "edition_unavailable";
2246
+ readonly DELIVERY_CONFLICT: "delivery_conflict";
2247
+ readonly RESOURCE_HAS_DEPENDENCIES: "resource_has_dependencies";
732
2248
  readonly PLAN_LIMIT_REACHED: "plan_limit_reached";
733
2249
  readonly PAYLOAD_TOO_LARGE: "payload_too_large";
734
2250
  readonly RATE_LIMITED: "rate_limited";
@@ -752,8 +2268,31 @@ export interface ErrorDetail {
752
2268
  */
753
2269
  docs_url: string;
754
2270
  }
2271
+ /** Response shape for ErrorDetail. */
2272
+ export interface ErrorDetailRead {
2273
+ type: ErrorType | (string & {});
2274
+ code: ErrorCode | (string & {});
2275
+ /** JSON Pointer to the invalid request field, when one field caused the error. */
2276
+ field?: string;
2277
+ /** Human-readable explanation. Its wording may change. */
2278
+ message: string;
2279
+ /** Whether retrying later can succeed without changing the request. */
2280
+ retryable: boolean;
2281
+ /** Stable, concise recovery instruction suitable for a person or agent. */
2282
+ suggested_action: string;
2283
+ /**
2284
+ * Documentation for this class of error.
2285
+ * Format: uri
2286
+ */
2287
+ docs_url: string;
2288
+ }
755
2289
  export interface ErrorModel {
756
2290
  errors: ErrorDetail[];
757
2291
  request_id: RequestId;
758
2292
  }
2293
+ /** Response shape for ErrorModel. */
2294
+ export interface ErrorModelRead {
2295
+ errors: ErrorDetailRead[];
2296
+ request_id: RequestId;
2297
+ }
759
2298
  //# sourceMappingURL=types.d.ts.map