@typeship-ax/cli 0.20.0 → 0.21.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 (99) hide show
  1. package/AGENTS.md +3 -3
  2. package/README.md +2 -2
  3. package/api.json +7355 -6233
  4. package/api.md +332 -398
  5. package/dist/api-identity.d.ts.map +1 -1
  6. package/dist/api-identity.js +6 -1
  7. package/dist/cli.js +15 -15
  8. package/dist/core/http.d.ts +26 -14
  9. package/dist/core/http.d.ts.map +1 -1
  10. package/dist/core/http.js +90 -19
  11. package/dist/core/pagination.d.ts +8 -8
  12. package/dist/core/pagination.d.ts.map +1 -1
  13. package/dist/core/pagination.js +7 -16
  14. package/dist/errors.d.ts +4 -4
  15. package/dist/errors.d.ts.map +1 -1
  16. package/dist/errors.js +7 -7
  17. package/dist/index.d.ts +33 -19
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +37 -17
  20. package/dist/ops.d.ts +1 -1
  21. package/dist/ops.d.ts.map +1 -1
  22. package/dist/ops.js +39 -42
  23. package/dist/resources/api-keys.d.ts +10 -10
  24. package/dist/resources/api-keys.d.ts.map +1 -1
  25. package/dist/resources/api-keys.js +6 -6
  26. package/dist/resources/deliveries.d.ts +46 -0
  27. package/dist/resources/deliveries.d.ts.map +1 -0
  28. package/dist/resources/deliveries.js +70 -0
  29. package/dist/resources/drafts.d.ts +155 -0
  30. package/dist/resources/drafts.d.ts.map +1 -0
  31. package/dist/resources/drafts.js +230 -0
  32. package/dist/resources/files.d.ts +23 -0
  33. package/dist/resources/files.d.ts.map +1 -0
  34. package/dist/resources/files.js +38 -0
  35. package/dist/resources/generate.d.ts +14 -14
  36. package/dist/resources/generate.d.ts.map +1 -1
  37. package/dist/resources/generate.js +7 -7
  38. package/dist/resources/generations.d.ts +65 -21
  39. package/dist/resources/generations.d.ts.map +1 -1
  40. package/dist/resources/generations.js +67 -20
  41. package/dist/resources/organization.d.ts +18 -0
  42. package/dist/resources/organization.d.ts.map +1 -0
  43. package/dist/resources/{account.js → organization.js} +10 -10
  44. package/dist/resources/projects.d.ts +36 -126
  45. package/dist/resources/projects.d.ts.map +1 -1
  46. package/dist/resources/projects.js +21 -171
  47. package/dist/resources/publications.d.ts +46 -0
  48. package/dist/resources/publications.d.ts.map +1 -0
  49. package/dist/resources/publications.js +70 -0
  50. package/dist/resources/releases.d.ts +66 -0
  51. package/dist/resources/releases.d.ts.map +1 -0
  52. package/dist/resources/releases.js +101 -0
  53. package/dist/resources/spec-revisions.d.ts +85 -0
  54. package/dist/resources/spec-revisions.d.ts.map +1 -0
  55. package/dist/resources/spec-revisions.js +116 -0
  56. package/dist/resources/specs.d.ts +72 -0
  57. package/dist/resources/specs.d.ts.map +1 -0
  58. package/dist/resources/specs.js +107 -0
  59. package/dist/resources/targets.d.ts +42 -262
  60. package/dist/resources/targets.d.ts.map +1 -1
  61. package/dist/resources/targets.js +28 -407
  62. package/dist/schemas.d.ts.map +1 -1
  63. package/dist/schemas.js +149 -154
  64. package/dist/types.d.ts +1281 -1611
  65. package/dist/types.d.ts.map +1 -1
  66. package/dist/types.js +44 -49
  67. package/package.json +1 -1
  68. package/src/api-identity.ts +6 -2
  69. package/src/cli.ts +16 -16
  70. package/src/core/http.ts +89 -24
  71. package/src/core/pagination.ts +13 -23
  72. package/src/errors.ts +7 -7
  73. package/src/index.ts +41 -23
  74. package/src/ops.ts +40 -43
  75. package/src/resources/api-keys.ts +13 -16
  76. package/src/resources/deliveries.ts +139 -0
  77. package/src/resources/drafts.ts +422 -0
  78. package/src/resources/files.ts +68 -0
  79. package/src/resources/generate.ts +16 -19
  80. package/src/resources/generations.ts +146 -35
  81. package/src/resources/{account.ts → organization.ts} +14 -14
  82. package/src/resources/projects.ts +42 -337
  83. package/src/resources/publications.ts +139 -0
  84. package/src/resources/releases.ts +199 -0
  85. package/src/resources/spec-revisions.ts +237 -0
  86. package/src/resources/specs.ts +200 -0
  87. package/src/resources/targets.ts +57 -760
  88. package/src/schemas.ts +149 -154
  89. package/src/types.ts +1357 -1692
  90. package/dist/resources/account.d.ts +0 -18
  91. package/dist/resources/account.d.ts.map +0 -1
  92. package/dist/resources/definition-revisions.d.ts +0 -75
  93. package/dist/resources/definition-revisions.d.ts.map +0 -1
  94. package/dist/resources/definition-revisions.js +0 -142
  95. package/dist/resources/definitions.d.ts +0 -50
  96. package/dist/resources/definitions.d.ts.map +0 -1
  97. package/dist/resources/definitions.js +0 -73
  98. package/src/resources/definition-revisions.ts +0 -265
  99. package/src/resources/definitions.ts +0 -146
package/src/types.ts CHANGED
@@ -7,14 +7,11 @@ export type ProjectId = string;
7
7
  /** Unique identifier for a generation. */
8
8
  export type GenerationId = string;
9
9
 
10
- /** Unique identifier for a project's logical API Definition. */
11
- export type DefinitionId = string;
10
+ /** Unique identifier for a project's logical API Spec. */
11
+ export type SpecId = string;
12
12
 
13
- /** Unique identifier for a source document captured in a Definition Revision. */
14
- export type DefinitionDocumentId = string;
15
-
16
- /** Unique identifier for an immutable resolved Definition Revision. */
17
- export type DefinitionRevisionId = string;
13
+ /** Unique identifier for an immutable resolved Spec Revision. */
14
+ export type SpecRevisionId = string;
18
15
 
19
16
  /** Server-generated identifier used to correlate this response with Typeship logs. */
20
17
  export type RequestId = string;
@@ -32,26 +29,29 @@ export type TargetId = string;
32
29
 
33
30
  export type DeliveryId = string;
34
31
 
35
- export type TargetReleaseId = string;
32
+ /** Unique identifier for a Draft. */
33
+ export type DraftId = string;
34
+
35
+ export type ReleaseId = string;
36
36
 
37
37
  export type PublicationId = string;
38
38
 
39
39
  /**
40
40
  * Generator implementation selected by a Target. This is configuration, not identity; several
41
- * Targets may use the same generator. cli is the TypeScript CLI; go-cli is the native Go CLI, a
41
+ * Targets may use the same generator. cli is the TypeScript CLI; go_cli is the native Go CLI, a
42
42
  * distinct product that imports one exact paired Go SDK module rather than a client of its own.
43
43
  */
44
44
  export const GeneratorKind = {
45
- TYPESCRIPT_SDK: "typescript-sdk",
46
- PYTHON_SDK: "python-sdk",
47
- GO_SDK: "go-sdk",
48
45
  CLI: "cli",
49
- GO_CLI: "go-cli",
46
+ GO_CLI: "go_cli",
50
47
  MCP: "mcp",
48
+ TYPESCRIPT_SDK: "typescript_sdk",
49
+ PYTHON_SDK: "python_sdk",
50
+ GO_SDK: "go_sdk",
51
51
  } as const;
52
52
  export type GeneratorKind = (typeof GeneratorKind)[keyof typeof GeneratorKind];
53
53
 
54
- export interface UrlDefinitionInput {
54
+ export interface UrlSpecInput {
55
55
  /**
56
56
  * URL of an OpenAPI document, a GraphQL SDL file, or a GraphQL
57
57
  * endpoint (introspected automatically). Fetched server-side.
@@ -65,8 +65,8 @@ export interface UrlDefinitionInput {
65
65
  headers?: Record<string, string>;
66
66
  }
67
67
 
68
- /** Response shape for UrlDefinitionInput. */
69
- export interface UrlDefinitionInputRead {
68
+ /** Response shape for UrlSpecInput. */
69
+ export interface UrlSpecInputRead {
70
70
  /**
71
71
  * URL of an OpenAPI document, a GraphQL SDL file, or a GraphQL
72
72
  * endpoint (introspected automatically). Fetched server-side.
@@ -75,21 +75,21 @@ export interface UrlDefinitionInputRead {
75
75
  url: string;
76
76
  }
77
77
 
78
- export interface InlineDefinitionInput {
79
- /** Raw Definition text (OpenAPI JSON/YAML or GraphQL SDL). Up to 10MB. */
78
+ export interface InlineSpecInput {
79
+ /** Raw Spec text (OpenAPI JSON/YAML or GraphQL SDL). Up to 10MB. */
80
80
  inline: string;
81
81
  }
82
82
 
83
- /** A Definition for one-shot generation, provided as exactly one URL or inline entrypoint. */
84
- export type DefinitionInput = UrlDefinitionInput | InlineDefinitionInput;
83
+ /** A Spec for one-shot generation, provided as exactly one URL or inline entrypoint. */
84
+ export type SpecInput = UrlSpecInput | InlineSpecInput;
85
85
 
86
- /** Response shape for DefinitionInput. */
87
- export type DefinitionInputRead = UrlDefinitionInputRead | InlineDefinitionInput;
86
+ /** Response shape for SpecInput. */
87
+ export type SpecInputRead = UrlSpecInputRead | InlineSpecInput;
88
88
 
89
89
  /**
90
- * The exact paired Go SDK a go-cli generation is built on. Required when target.generator is go-cli
91
- * and rejected otherwise. The descriptor is closed and immutable, because a CLI that pins a range
92
- * or a branch pins nothing.
90
+ * The exact paired Go SDK a go_cli generation is built on. Required when target.type is go_cli and
91
+ * rejected otherwise. The descriptor is closed and immutable, because a CLI that pins a range or a
92
+ * branch pins nothing.
93
93
  */
94
94
  export interface GoSdkDescriptor {
95
95
  /**
@@ -104,15 +104,10 @@ export interface GoSdkDescriptor {
104
104
  */
105
105
  version: string;
106
106
  /**
107
- * SHA-256 hex digest of the Definition the SDK was generated from. Must match the resolved
108
- * Definition, or the request fails with spec_error.
107
+ * SHA-256 hex digest of the Spec the SDK was generated from. Must match the resolved Spec, or the
108
+ * request fails with spec_error.
109
109
  */
110
- definition_digest: string;
111
- /**
112
- * The generator edition the SDK was generated with. Only the current edition, 2026-08-24, is
113
- * accepted.
114
- */
115
- edition: string;
110
+ spec_digest: string;
116
111
  /**
117
112
  * Go package identifier of the SDK, when the module path's last element does not imply it.
118
113
  * Optional.
@@ -121,10 +116,10 @@ export interface GoSdkDescriptor {
121
116
  }
122
117
 
123
118
  export interface GenerateRequest {
124
- definition: DefinitionInput;
119
+ spec: SpecInput;
125
120
  /** One-shot generator descriptor; no persisted Target is created. */
126
121
  target: {
127
- generator: GeneratorKind;
122
+ type: GeneratorKind;
128
123
  };
129
124
  /**
130
125
  * npm package or Python distribution override. Valid only for the TypeScript and Python SDK
@@ -133,7 +128,7 @@ export interface GenerateRequest {
133
128
  package_name?: string;
134
129
  /**
135
130
  * Go module path override for the generated artifact's own module. Valid only for the Go SDK and
136
- * Go CLI outputs. Linked projects derive this from the Go destination repository by default.
131
+ * Go CLI Targets. Projects derive this from the Go destination repository by default.
137
132
  */
138
133
  module_path?: string;
139
134
  go_sdk?: GoSdkDescriptor;
@@ -142,10 +137,10 @@ export interface GenerateRequest {
142
137
 
143
138
  /** Response shape for GenerateRequest. */
144
139
  export interface GenerateRequestRead {
145
- definition: DefinitionInputRead;
140
+ spec: SpecInputRead;
146
141
  /** One-shot generator descriptor; no persisted Target is created. */
147
142
  target: {
148
- generator: GeneratorKind | (string & {});
143
+ type: GeneratorKind | (string & {});
149
144
  };
150
145
  /**
151
146
  * npm package or Python distribution override. Valid only for the TypeScript and Python SDK
@@ -154,7 +149,7 @@ export interface GenerateRequestRead {
154
149
  package_name?: string;
155
150
  /**
156
151
  * Go module path override for the generated artifact's own module. Valid only for the Go SDK and
157
- * Go CLI outputs. Linked projects derive this from the Go destination repository by default.
152
+ * Go CLI Targets. Projects derive this from the Go destination repository by default.
158
153
  */
159
154
  module_path?: string;
160
155
  go_sdk?: GoSdkDescriptor;
@@ -184,225 +179,187 @@ export interface GeneratedFileRead {
184
179
  mode?: ("100644" | "100755") | (string & {});
185
180
  }
186
181
 
187
- export interface GenerationMeta {
188
- title: string;
189
- /** Version declared by the customer's API Definition. It never controls package releases. */
190
- api_version: string;
191
- /** Package version selected by the Target's release stream for this generation. */
192
- version: string;
193
- spec_format?: "openapi" | "graphql";
194
- /** Detected OpenAPI version, "2.0", "3.0", or "3.1". */
195
- oas_version: string;
196
- /** True when the input was Swagger 2.0 and was converted. */
197
- converted?: boolean;
198
- /** Ecosystem-neutral identity of the generated artifact. */
199
- artifact_name: string;
200
- client_name: string;
201
- /**
202
- * Generator implementations present in this artifact. Persisted Target identity is reported on
203
- * Generation.
204
- */
205
- generators: GeneratorKind[];
206
- /**
207
- * Present for go-cli generations only. Names the exact paired Go SDK module and version the CLI
208
- * was generated against, as its go.mod requires it.
209
- */
210
- go_sdk?: {
211
- /** Go module path of the SDK the Go CLI imports and pins. */
212
- module_path: string;
213
- /** Exact SDK module version the Go CLI requires, v-prefixed SemVer or a Go pseudo-version. */
214
- version: string;
215
- /** Go package identifier of the SDK, when the module path does not imply it. */
216
- package_name?: string;
217
- };
218
- resource_count?: number;
219
- operation_count?: number;
220
- schema_count?: number;
221
- paginated_operation_count?: number;
222
- /** Operations beyond the plan's endpoint allowance, not generated. */
223
- omitted_operation_count?: number;
224
- /** METHOD/path identities of operations omitted by the generation cap. */
225
- omitted_operations?: string[];
226
- /** Pull request opened by this regeneration, when one was. */
227
- pr_url?: string | null;
228
- pr_number?: number | null;
229
- /**
230
- * Whether a destination pull request opened, was unnecessary because the generated tree already
231
- * matched, or could not be opened.
232
- */
233
- pr_status?: "opened" | "no_changes" | "blocked";
234
- /**
235
- * Markdown changelog entry for this regeneration, from the API surface diff. Absent on a first
236
- * generation or when nothing changed.
237
- */
238
- changelog?: string;
239
- /**
240
- * Breaking changes in the diff; removed methods and fields, changed types, inputs that became
241
- * required.
242
- */
243
- breaking_count?: number;
244
- /**
245
- * What the diff was measured against. destination uses the accepted repository state;
246
- * last-generation uses the previous successful Generation; none means no baseline was available.
247
- */
248
- baseline?: "destination" | "last-generation" | "none";
249
- /** Objective compatibility of the generated API surface against the merged destination baseline. */
250
- api_compatibility?: "compatible" | "breaking" | "unknown";
251
- /**
252
- * Objective compatibility of public package entry points and selected targets against the merged
253
- * destination baseline.
254
- */
255
- package_compatibility?: "compatible" | "breaking" | "unknown";
256
- /**
257
- * Whether the generated package version satisfies the cumulative change. Null when there is no
258
- * prior version or analysis is unavailable.
259
- */
260
- version_correct?: boolean | null;
261
- /**
262
- * The destination pull request's combined readiness decision for the exact bot-generated head.
263
- * Compatibility and version correctness remain separate fields above.
264
- */
265
- release_readiness?: "success" | "failure" | "pending" | "error";
266
- /** The release-readiness decision in one line, as the commit status describes it. */
267
- release_readiness_note?: string;
268
- /** The package version the destination had before this regeneration. */
269
- previous_version?: string;
270
- /** Files changed by the customer relative to the accepted combined baseline. */
271
- customer_change_count?: number;
272
- integration_state?: "conflicted"
273
- | "checking"
274
- | "checks_failed"
275
- | "ready"
276
- | "accepted"
277
- | "outdated";
278
- /** Separate compatibility result against the last published artifact. */
279
- published_compatibility?: "compatible" | "breaking" | "unknown" | "not_applicable";
280
- /** Version of the last published artifact used by published_compatibility. */
281
- published_version?: string;
282
- file_count?: number;
283
- total_lines?: number;
284
- /** Deterministic Diagnostic summary for the exact Definition Revision consumed. */
285
- diagnostics?: {
286
- format: "openapi" | "graphql";
287
- summary: DiagnosticSummary;
288
- };
182
+ export interface GenerationWarning {
183
+ /** Stable machine-readable warning code. */
184
+ code: string;
185
+ /** Human-readable explanation. */
186
+ message: string;
187
+ /** METHOD/path of the affected operation, when applicable. */
188
+ operation?: string;
289
189
  }
290
190
 
291
- /** Response shape for GenerationMeta. */
292
- export interface GenerationMetaRead {
293
- title: string;
294
- /** Version declared by the customer's API Definition. It never controls package releases. */
295
- api_version: string;
296
- /** Package version selected by the Target's release stream for this generation. */
297
- version: string;
298
- spec_format?: ("openapi" | "graphql") | (string & {});
299
- /** Detected OpenAPI version, "2.0", "3.0", or "3.1". */
300
- oas_version: string;
301
- /** True when the input was Swagger 2.0 and was converted. */
302
- converted?: boolean;
303
- /** Ecosystem-neutral identity of the generated artifact. */
304
- artifact_name: string;
305
- client_name: string;
306
- /**
307
- * Generator implementations present in this artifact. Persisted Target identity is reported on
308
- * Generation.
309
- */
310
- generators: Array<GeneratorKind | (string & {})>;
311
- /**
312
- * Present for go-cli generations only. Names the exact paired Go SDK module and version the CLI
313
- * was generated against, as its go.mod requires it.
314
- */
315
- go_sdk?: {
316
- /** Go module path of the SDK the Go CLI imports and pins. */
317
- module_path: string;
318
- /** Exact SDK module version the Go CLI requires, v-prefixed SemVer or a Go pseudo-version. */
319
- version: string;
320
- /** Go package identifier of the SDK, when the module path does not imply it. */
321
- package_name?: string;
322
- };
323
- resource_count?: number;
324
- operation_count?: number;
325
- schema_count?: number;
326
- paginated_operation_count?: number;
327
- /** Operations beyond the plan's endpoint allowance, not generated. */
328
- omitted_operation_count?: number;
329
- /** METHOD/path identities of operations omitted by the generation cap. */
330
- omitted_operations?: string[];
331
- /** Pull request opened by this regeneration, when one was. */
332
- pr_url?: string | null;
333
- pr_number?: number | null;
334
- /**
335
- * Whether a destination pull request opened, was unnecessary because the generated tree already
336
- * matched, or could not be opened.
337
- */
338
- pr_status?: ("opened" | "no_changes" | "blocked") | (string & {});
339
- /**
340
- * Markdown changelog entry for this regeneration, from the API surface diff. Absent on a first
341
- * generation or when nothing changed.
342
- */
343
- changelog?: string;
344
- /**
345
- * Breaking changes in the diff; removed methods and fields, changed types, inputs that became
346
- * required.
347
- */
348
- breaking_count?: number;
349
- /**
350
- * What the diff was measured against. destination uses the accepted repository state;
351
- * last-generation uses the previous successful Generation; none means no baseline was available.
352
- */
353
- baseline?: ("destination" | "last-generation" | "none") | (string & {});
354
- /** Objective compatibility of the generated API surface against the merged destination baseline. */
355
- api_compatibility?: ("compatible" | "breaking" | "unknown") | (string & {});
356
- /**
357
- * Objective compatibility of public package entry points and selected targets against the merged
358
- * destination baseline.
359
- */
360
- package_compatibility?: ("compatible" | "breaking" | "unknown") | (string & {});
361
- /**
362
- * Whether the generated package version satisfies the cumulative change. Null when there is no
363
- * prior version or analysis is unavailable.
364
- */
365
- version_correct?: boolean | null;
366
- /**
367
- * The destination pull request's combined readiness decision for the exact bot-generated head.
368
- * Compatibility and version correctness remain separate fields above.
369
- */
370
- release_readiness?: ("success" | "failure" | "pending" | "error") | (string & {});
371
- /** The release-readiness decision in one line, as the commit status describes it. */
372
- release_readiness_note?: string;
373
- /** The package version the destination had before this regeneration. */
374
- previous_version?: string;
375
- /** Files changed by the customer relative to the accepted combined baseline. */
376
- customer_change_count?: number;
377
- integration_state?: ("conflicted"
378
- | "checking"
379
- | "checks_failed"
380
- | "ready"
381
- | "accepted"
382
- | "outdated") | (string & {});
383
- /** Separate compatibility result against the last published artifact. */
384
- published_compatibility?: ("compatible" | "breaking" | "unknown" | "not_applicable") | (string & {});
385
- /** Version of the last published artifact used by published_compatibility. */
386
- published_version?: string;
387
- file_count?: number;
388
- total_lines?: number;
389
- /** Deterministic Diagnostic summary for the exact Definition Revision consumed. */
390
- diagnostics?: {
391
- format: ("openapi" | "graphql") | (string & {});
392
- summary: DiagnosticSummary;
393
- };
191
+ export interface GenerationCoverage {
192
+ generated: number;
193
+ omitted: number;
194
+ total: number;
195
+ /** METHOD/path identities of operations omitted from the package. */
196
+ omitted_operations: string[];
197
+ /** Present when a plan or anonymous limit omitted operations. */
198
+ reason?: "anonymous" | "free_plan";
199
+ /**
200
+ * Sign-up link for anonymous capped runs.
201
+ * Format: uri
202
+ */
203
+ signup_url?: string;
204
+ /**
205
+ * Upgrade link for capped signed-in runs.
206
+ * Format: uri
207
+ */
208
+ upgrade_url?: string;
209
+ }
210
+
211
+ /** Response shape for GenerationCoverage. */
212
+ export interface GenerationCoverageRead {
213
+ generated: number;
214
+ omitted: number;
215
+ total: number;
216
+ /** METHOD/path identities of operations omitted from the package. */
217
+ omitted_operations: string[];
218
+ /** Present when a plan or anonymous limit omitted operations. */
219
+ reason?: ("anonymous" | "free_plan") | (string & {});
220
+ /**
221
+ * Sign-up link for anonymous capped runs.
222
+ * Format: uri
223
+ */
224
+ signup_url?: string;
225
+ /**
226
+ * Upgrade link for capped signed-in runs.
227
+ * Format: uri
228
+ */
229
+ upgrade_url?: string;
230
+ }
231
+
232
+ /**
233
+ * Unique identifier for one immutable file snapshot. An ID always returns the same bytes: a Spec
234
+ * Revision, a Generation, and each Draft side name their own file IDs, and a new Draft commit gets
235
+ * new IDs.
236
+ */
237
+ export type FileId = string;
238
+
239
+ export interface FileModel {
240
+ id: FileId;
241
+ object: "file";
242
+ /** Path within the Spec Revision, Generation package, or Target package. */
243
+ path: string;
244
+ size_bytes: number;
245
+ /** Digest of the complete file. */
246
+ sha256: string;
247
+ /** utf8: content is text. base64: content is base64-encoded binary bytes. */
248
+ encoding: "utf8" | "base64";
249
+ /** Git file mode for package files; null for Spec source files. */
250
+ mode: GitFileMode | null;
251
+ /**
252
+ * When Typeship first issued this file ID.
253
+ * Format: date-time
254
+ */
255
+ created_at: string;
256
+ }
257
+
258
+ /** Response shape for FileModel. */
259
+ export interface FileModelRead {
260
+ id: FileId;
261
+ object: "file" | (string & {});
262
+ /** Path within the Spec Revision, Generation package, or Target package. */
263
+ path: string;
264
+ size_bytes: number;
265
+ /** Digest of the complete file. */
266
+ sha256: string;
267
+ /** utf8: content is text. base64: content is base64-encoded binary bytes. */
268
+ encoding: ("utf8" | "base64") | (string & {});
269
+ /** Git file mode for package files; null for Spec source files. */
270
+ mode: GitFileMode | (string & {}) | null;
271
+ /**
272
+ * When Typeship first issued this file ID.
273
+ * Format: date-time
274
+ */
275
+ created_at: string;
276
+ }
277
+
278
+ export type FileResponse = FileModel & {
279
+ /**
280
+ * At most 24 KiB of the file starting at offset, encoded as encoding says. Text chunks never
281
+ * split a character; concatenate chunks in order.
282
+ */
283
+ content: string;
284
+ /** Byte offset of this chunk in the file. */
285
+ offset: number;
286
+ /** Pass as cursor to read the next chunk; null at the end of the file. */
287
+ next_cursor: string | null;
288
+ } & ResponseMetadata;
289
+
290
+ /** Response shape for FileResponse. */
291
+ export type FileResponseRead = FileModelRead & {
292
+ /**
293
+ * At most 24 KiB of the file starting at offset, encoded as encoding says. Text chunks never
294
+ * split a character; concatenate chunks in order.
295
+ */
296
+ content: string;
297
+ /** Byte offset of this chunk in the file. */
298
+ offset: number;
299
+ /** Pass as cursor to read the next chunk; null at the end of the file. */
300
+ next_cursor: string | null;
301
+ } & ResponseMetadata;
302
+
303
+ export interface FileList {
304
+ object: ListObject;
305
+ data: FileModel[];
306
+ has_more: boolean;
307
+ next_cursor: string | null;
308
+ request_id: RequestId;
309
+ }
310
+
311
+ /** Response shape for FileList. */
312
+ export interface FileListRead {
313
+ object: ListObject;
314
+ data: FileModelRead[];
315
+ has_more: boolean;
316
+ next_cursor: string | null;
317
+ request_id: RequestId;
318
+ }
319
+
320
+ export type SpecRevisionFile = FileModel & {
321
+ /**
322
+ * entrypoint and reference: captured source files. resolved: the single normalized document
323
+ * Typeship generated from.
324
+ */
325
+ role: "entrypoint" | "reference" | "resolved";
326
+ };
327
+
328
+ /** Response shape for SpecRevisionFile. */
329
+ export type SpecRevisionFileRead = FileModelRead & {
330
+ /**
331
+ * entrypoint and reference: captured source files. resolved: the single normalized document
332
+ * Typeship generated from.
333
+ */
334
+ role: ("entrypoint" | "reference" | "resolved") | (string & {});
335
+ };
336
+
337
+ export interface SpecRevisionFileList {
338
+ object: ListObject;
339
+ data: SpecRevisionFile[];
340
+ has_more: boolean;
341
+ next_cursor: string | null;
342
+ request_id: RequestId;
343
+ }
344
+
345
+ /** Response shape for SpecRevisionFileList. */
346
+ export interface SpecRevisionFileListRead {
347
+ object: ListObject;
348
+ data: SpecRevisionFileRead[];
349
+ has_more: boolean;
350
+ next_cursor: string | null;
351
+ request_id: RequestId;
394
352
  }
395
353
 
396
354
  export interface GenerationResult {
397
355
  files: GeneratedFile[];
398
356
  download?: GenerationDownload;
399
- warnings: string[];
400
- meta: GenerationMeta;
401
- limits?: GenerationLimits;
357
+ warnings: GenerationWarning[];
358
+ coverage: GenerationCoverage;
402
359
  /**
403
360
  * Anonymous, URL-sourced generations only. A link a signed-in person can open to turn this run
404
- * into a project in their organization (same Definition, Target, and config). Lasts seven days.
405
- * Null for inline Definitions; absent on keyed calls.
361
+ * into a project in their organization (same Spec, Target, and config). Lasts seven days. Null
362
+ * for inline Specs; absent on keyed calls.
406
363
  */
407
364
  claim?: null
408
365
  | {
@@ -417,13 +374,12 @@ export interface GenerationResult {
417
374
  export interface GenerationResultRead {
418
375
  files: GeneratedFileRead[];
419
376
  download?: GenerationDownload;
420
- warnings: string[];
421
- meta: GenerationMetaRead;
422
- limits?: GenerationLimitsRead;
377
+ warnings: GenerationWarning[];
378
+ coverage: GenerationCoverageRead;
423
379
  /**
424
380
  * Anonymous, URL-sourced generations only. A link a signed-in person can open to turn this run
425
- * into a project in their organization (same Definition, Target, and config). Lasts seven days.
426
- * Null for inline Definitions; absent on keyed calls.
381
+ * into a project in their organization (same Spec, Target, and config). Lasts seven days. Null
382
+ * for inline Specs; absent on keyed calls.
427
383
  */
428
384
  claim?: null
429
385
  | {
@@ -451,45 +407,7 @@ export interface GenerationDownload {
451
407
  file_count: number;
452
408
  }
453
409
 
454
- /**
455
- * Present when the generation was capped: by the free plan, or because the call was anonymous.
456
- * Absent on uncapped generations.
457
- */
458
- export interface GenerationLimits {
459
- /** How many operations this generation was allowed to include. */
460
- max_operations: number;
461
- /** How many operations are present in the generated package. */
462
- generated_operations: number;
463
- /** How many operations in the Definition were left out. */
464
- omitted_operations: number;
465
- /** How many operations Typeship found in the complete Definition. */
466
- total_operations: number;
467
- reason: "anonymous" | "free_plan";
468
- /** Anonymous calls only. Where to create an account. */
469
- signup_url?: string;
470
- /** Where the cap is lifted. */
471
- upgrade_url: string;
472
- }
473
-
474
- /** Response shape for GenerationLimits. */
475
- export interface GenerationLimitsRead {
476
- /** How many operations this generation was allowed to include. */
477
- max_operations: number;
478
- /** How many operations are present in the generated package. */
479
- generated_operations: number;
480
- /** How many operations in the Definition were left out. */
481
- omitted_operations: number;
482
- /** How many operations Typeship found in the complete Definition. */
483
- total_operations: number;
484
- reason: ("anonymous" | "free_plan") | (string & {});
485
- /** Anonymous calls only. Where to create an account. */
486
- signup_url?: string;
487
- /** Where the cap is lifted. */
488
- upgrade_url: string;
489
- }
490
-
491
- export interface UrlDefinitionSource {
492
- kind: "url";
410
+ export interface UrlSpecSourceSettings {
493
411
  /**
494
412
  * URL fetched for every generation.
495
413
  * Format: uri
@@ -499,9 +417,8 @@ export interface UrlDefinitionSource {
499
417
  headers_configured: boolean;
500
418
  }
501
419
 
502
- /** Request shape for UrlDefinitionSource. */
503
- export interface UrlDefinitionSourceWrite {
504
- kind: "url";
420
+ /** Request shape for UrlSpecSourceSettings. */
421
+ export interface UrlSpecSourceSettingsWrite {
505
422
  /**
506
423
  * URL fetched for every generation.
507
424
  * Format: uri
@@ -509,61 +426,81 @@ export interface UrlDefinitionSourceWrite {
509
426
  url: string;
510
427
  }
511
428
 
512
- /** Response shape for UrlDefinitionSource. */
513
- export interface UrlDefinitionSourceRead {
514
- kind: "url" | (string & {});
515
- /**
516
- * URL fetched for every generation.
517
- * Format: uri
518
- */
519
- url: string;
520
- /** Whether Typeship has stored write-only request headers for this URL. */
521
- headers_configured: boolean;
429
+ export interface UrlSpecSource {
430
+ type: "url";
431
+ url: UrlSpecSourceSettings;
432
+ }
433
+
434
+ /** Request shape for UrlSpecSource. */
435
+ export interface UrlSpecSourceWrite {
436
+ type: "url";
437
+ url: UrlSpecSourceSettingsWrite;
522
438
  }
523
439
 
440
+ /** Response shape for UrlSpecSource. */
441
+ export interface UrlSpecSourceRead {
442
+ type: "url" | (string & {});
443
+ url: UrlSpecSourceSettings;
444
+ }
445
+
446
+ /** GitHub is the only launch provider; the field is stable for future adapters. */
447
+ export const RepositoryProvider = {
448
+ GITHUB: "github",
449
+ } as const;
450
+ export type RepositoryProvider = (typeof RepositoryProvider)[keyof typeof RepositoryProvider];
451
+
452
+ /** Provider-native repository identity, opaque outside its adapter. */
453
+ export type RepositoryIdentifier = string;
454
+
524
455
  export interface RepositoryReference {
525
- /** GitHub is the only launch provider; the field is stable for future adapters. */
526
- provider: "github";
527
- /** Provider-native repository identity, opaque outside its adapter. */
528
- identifier: string;
456
+ provider: RepositoryProvider;
457
+ identifier: RepositoryIdentifier;
529
458
  }
530
459
 
531
460
  /** Response shape for RepositoryReference. */
532
461
  export interface RepositoryReferenceRead {
533
- /** GitHub is the only launch provider; the field is stable for future adapters. */
534
- provider: "github" | (string & {});
535
- /** Provider-native repository identity, opaque outside its adapter. */
536
- identifier: string;
462
+ provider: RepositoryProvider | (string & {});
463
+ identifier: RepositoryIdentifier;
537
464
  }
538
465
 
539
- export interface RepositoryDefinitionSource {
540
- kind: "repository";
541
- repository: RepositoryReferenceResponse;
542
- /** Repository-relative Definition entrypoint. */
466
+ export interface RepositorySpecSourceSettings {
467
+ provider: RepositoryProvider;
468
+ identifier: RepositoryIdentifier;
469
+ /** Repository-relative Spec entrypoint. */
543
470
  path: string;
544
471
  }
545
472
 
546
- /** Response shape for RepositoryDefinitionSource. */
547
- export interface RepositoryDefinitionSourceRead {
548
- kind: "repository" | (string & {});
549
- repository: RepositoryReferenceResponseRead;
550
- /** Repository-relative Definition entrypoint. */
473
+ /** Response shape for RepositorySpecSourceSettings. */
474
+ export interface RepositorySpecSourceSettingsRead {
475
+ provider: RepositoryProvider | (string & {});
476
+ identifier: RepositoryIdentifier;
477
+ /** Repository-relative Spec entrypoint. */
551
478
  path: string;
552
479
  }
553
480
 
554
- /** The single source of truth for where a Project's Definition lives. */
555
- export type DefinitionSource = UrlDefinitionSource | RepositoryDefinitionSource;
481
+ export interface RepositorySpecSource {
482
+ type: "repository";
483
+ repository: RepositorySpecSourceSettings;
484
+ }
485
+
486
+ /** Response shape for RepositorySpecSource. */
487
+ export interface RepositorySpecSourceRead {
488
+ type: "repository" | (string & {});
489
+ repository: RepositorySpecSourceSettingsRead;
490
+ }
491
+
492
+ /** The single source of truth for where a Project's Spec lives. */
493
+ export type SpecSource = UrlSpecSource | RepositorySpecSource;
556
494
 
557
- /** Request shape for DefinitionSource. */
558
- export type DefinitionSourceWrite = UrlDefinitionSourceWrite | RepositoryDefinitionSource;
495
+ /** Request shape for SpecSource. */
496
+ export type SpecSourceWrite = UrlSpecSourceWrite | RepositorySpecSource;
559
497
 
560
- /** Response shape for DefinitionSource. */
561
- export type DefinitionSourceRead = UrlDefinitionSourceRead
562
- | RepositoryDefinitionSourceRead
563
- | Record<string, unknown> & { kind?: string };
498
+ /** Response shape for SpecSource. */
499
+ export type SpecSourceRead = UrlSpecSourceRead
500
+ | RepositorySpecSourceRead
501
+ | Record<string, unknown> & { type?: string };
564
502
 
565
- export interface UrlDefinitionSourceInput {
566
- kind: "url";
503
+ export interface UrlSpecSourceSettingsInput {
567
504
  /**
568
505
  * URL of an OpenAPI document, GraphQL SDL file, or GraphQL endpoint.
569
506
  * Format: uri
@@ -578,9 +515,8 @@ export interface UrlDefinitionSourceInput {
578
515
  headers?: Record<string, string> | null;
579
516
  }
580
517
 
581
- /** Response shape for UrlDefinitionSourceInput. */
582
- export interface UrlDefinitionSourceInputRead {
583
- kind: "url" | (string & {});
518
+ /** Response shape for UrlSpecSourceSettingsInput. */
519
+ export interface UrlSpecSourceSettingsInputRead {
584
520
  /**
585
521
  * URL of an OpenAPI document, GraphQL SDL file, or GraphQL endpoint.
586
522
  * Format: uri
@@ -588,34 +524,56 @@ export interface UrlDefinitionSourceInputRead {
588
524
  url: string;
589
525
  }
590
526
 
591
- export interface RepositoryDefinitionSourceInput {
592
- kind: "repository";
593
- repository: RepositoryReference;
594
- /** Repository-relative Definition entrypoint. */
527
+ export interface UrlSpecSourceInput {
528
+ type: "url";
529
+ url: UrlSpecSourceSettingsInput;
530
+ }
531
+
532
+ /** Response shape for UrlSpecSourceInput. */
533
+ export interface UrlSpecSourceInputRead {
534
+ type: "url" | (string & {});
535
+ url: UrlSpecSourceSettingsInputRead;
536
+ }
537
+
538
+ export interface RepositorySpecSourceSettingsInput {
539
+ provider: RepositoryProvider;
540
+ identifier: RepositoryIdentifier;
541
+ /** Repository-relative Spec entrypoint. */
595
542
  path: string;
596
543
  }
597
544
 
598
- /** Response shape for RepositoryDefinitionSourceInput. */
599
- export interface RepositoryDefinitionSourceInputRead {
600
- kind: "repository" | (string & {});
601
- repository: RepositoryReferenceRead;
602
- /** Repository-relative Definition entrypoint. */
545
+ /** Response shape for RepositorySpecSourceSettingsInput. */
546
+ export interface RepositorySpecSourceSettingsInputRead {
547
+ provider: RepositoryProvider | (string & {});
548
+ identifier: RepositoryIdentifier;
549
+ /** Repository-relative Spec entrypoint. */
603
550
  path: string;
604
551
  }
605
552
 
606
- export type DefinitionSourceInput = UrlDefinitionSourceInput | RepositoryDefinitionSourceInput;
553
+ export interface RepositorySpecSourceInput {
554
+ type: "repository";
555
+ repository: RepositorySpecSourceSettingsInput;
556
+ }
557
+
558
+ /** Response shape for RepositorySpecSourceInput. */
559
+ export interface RepositorySpecSourceInputRead {
560
+ type: "repository" | (string & {});
561
+ repository: RepositorySpecSourceSettingsInputRead;
562
+ }
563
+
564
+ export type SpecSourceInput = UrlSpecSourceInput | RepositorySpecSourceInput;
607
565
 
608
- /** Response shape for DefinitionSourceInput. */
609
- export type DefinitionSourceInputRead = UrlDefinitionSourceInputRead
610
- | RepositoryDefinitionSourceInputRead
611
- | Record<string, unknown> & { kind?: string };
566
+ /** Response shape for SpecSourceInput. */
567
+ export type SpecSourceInputRead = UrlSpecSourceInputRead
568
+ | RepositorySpecSourceInputRead
569
+ | Record<string, unknown> & { type?: string };
612
570
 
613
571
  /**
614
- * A fix applied to the resolved Definition before generation. Paths are JSON
572
+ * A fix applied to the resolved Spec before generation. Paths are JSON
615
573
  * Pointers into the document. A patch whose target no longer exists is
616
574
  * skipped and reported as a warning on the generation, never silently.
617
575
  */
618
- export interface DefinitionPatch {
576
+ export interface SpecPatch {
619
577
  op: "set" | "append" | "remove" | "rename";
620
578
  /**
621
579
  * JSON-Pointer-style path. Pattern segments enable bulk fixes:
@@ -631,8 +589,8 @@ export interface DefinitionPatch {
631
589
  reason?: string | null;
632
590
  }
633
591
 
634
- /** Response shape for DefinitionPatch. */
635
- export interface DefinitionPatchRead {
592
+ /** Response shape for SpecPatch. */
593
+ export interface SpecPatchRead {
636
594
  op: ("set" | "append" | "remove" | "rename") | (string & {});
637
595
  /**
638
596
  * JSON-Pointer-style path. Pattern segments enable bulk fixes:
@@ -650,8 +608,10 @@ export interface DefinitionPatchRead {
650
608
 
651
609
  /** One exact place where a Diagnostic rule found evidence. */
652
610
  export interface DiagnosticLocation {
653
- /** Source document coordinate when the Definition contains multiple files. */
654
- document?: string;
611
+ /** Source file path from the Spec Revision when the finding maps to a captured file. */
612
+ file_path?: string;
613
+ /** The captured source file, present with file_path. Read it with getFile. */
614
+ file_id?: FileId;
655
615
  /** JSON Pointer for OpenAPI, or schema coordinate for GraphQL. */
656
616
  path: string;
657
617
  /** Human-readable operation coordinate when the location belongs to an operation. */
@@ -668,9 +628,9 @@ export interface DiagnosticFix {
668
628
  * spec_patch is an exact OpenAPI edit Typeship can derive; source_edit requires author intent or
669
629
  * a lossless GraphQL source edit.
670
630
  */
671
- kind: "spec_patch" | "source_edit";
672
- /** Exact patches when kind is spec_patch. */
673
- patches?: DefinitionPatchResponse[];
631
+ type: "spec_patch" | "source_edit";
632
+ /** Exact patches when type is spec_patch. */
633
+ patches?: SpecPatchResponse[];
674
634
  /** Source-level guidance when an exact patch would invent intent. */
675
635
  instructions?: string;
676
636
  }
@@ -683,38 +643,43 @@ export interface DiagnosticFixRead {
683
643
  * spec_patch is an exact OpenAPI edit Typeship can derive; source_edit requires author intent or
684
644
  * a lossless GraphQL source edit.
685
645
  */
686
- kind: ("spec_patch" | "source_edit") | (string & {});
687
- /** Exact patches when kind is spec_patch. */
688
- patches?: DefinitionPatchResponseRead[];
646
+ type: ("spec_patch" | "source_edit") | (string & {});
647
+ /** Exact patches when type is spec_patch. */
648
+ patches?: SpecPatchResponseRead[];
689
649
  /** Source-level guidance when an exact patch would invent intent. */
690
650
  instructions?: string;
691
651
  }
692
652
 
693
- /** Every occurrence of one stable Diagnostic rule, grouped into one decision. */
653
+ /**
654
+ * Every occurrence of one Diagnostic rule in a Spec Revision, grouped into one decision.
655
+ * Diagnostics are evaluated when read, using the Spec's current patches and Diagnostic policy.
656
+ */
694
657
  export interface Diagnostic {
695
- /** Stable rule identifier for automation and suppressions. */
658
+ /** Stable rule identifier, unique within a Spec Revision. Suppressions name it as rule_id. */
696
659
  id: string;
660
+ object: "diagnostic";
661
+ /**
662
+ * Whether this Diagnostic fails the Spec's Diagnostic policy. Suppressed occurrences and, when
663
+ * only_new is set, occurrences present in the baseline never block.
664
+ */
665
+ blocking: boolean;
666
+ /**
667
+ * Whether any occurrence is new since baseline_spec_revision_id in the Diagnostic summary. Always
668
+ * true when there is no baseline.
669
+ */
670
+ introduced: boolean;
697
671
  /** Whether the rule reports invalid behavior, material risk, or an improvement. */
698
672
  severity: "error" | "warning" | "suggestion";
699
673
  /** Product dimension affected by the diagnostic. */
700
674
  category: "correctness" | "sdk_ergonomics" | "agent_usability" | "safety";
701
675
  /** Concise statement of the root cause. */
702
676
  title: string;
703
- /** What the API author should change. */
704
- description: string;
705
- /** Why consumers of generated CLI, MCP, or SDK surfaces care. */
706
- impact: string;
677
+ /** One explanation of the finding and why it matters. */
678
+ message: string;
707
679
  /** Public surfaces affected by the root cause. */
708
680
  surfaces: Array<"api" | "sdk" | "cli" | "mcp">;
709
- /**
710
- * Whether the finding is provable from the Definition, a conservative review suggestion, or a
711
- * documented Typeship implementation limitation.
712
- */
713
- evidence_basis: "contract" | "heuristic" | "implementation";
714
- /** Whether remediation requires intent that the Definition cannot prove. */
681
+ /** Whether remediation requires intent that the Spec cannot prove. */
715
682
  owner_decision_required: boolean;
716
- /** Concrete generated CLI, MCP, or SDK naming effect when Typeship can state it. */
717
- surface_impact?: string;
718
683
  /** All affected coordinates, kept under one grouped diagnostic. */
719
684
  locations: DiagnosticLocation[];
720
685
  fix?: DiagnosticFix;
@@ -727,29 +692,31 @@ export interface Diagnostic {
727
692
 
728
693
  /** Response shape for Diagnostic. */
729
694
  export interface DiagnosticRead {
730
- /** Stable rule identifier for automation and suppressions. */
695
+ /** Stable rule identifier, unique within a Spec Revision. Suppressions name it as rule_id. */
731
696
  id: string;
697
+ object: "diagnostic" | (string & {});
698
+ /**
699
+ * Whether this Diagnostic fails the Spec's Diagnostic policy. Suppressed occurrences and, when
700
+ * only_new is set, occurrences present in the baseline never block.
701
+ */
702
+ blocking: boolean;
703
+ /**
704
+ * Whether any occurrence is new since baseline_spec_revision_id in the Diagnostic summary. Always
705
+ * true when there is no baseline.
706
+ */
707
+ introduced: boolean;
732
708
  /** Whether the rule reports invalid behavior, material risk, or an improvement. */
733
709
  severity: ("error" | "warning" | "suggestion") | (string & {});
734
710
  /** Product dimension affected by the diagnostic. */
735
711
  category: ("correctness" | "sdk_ergonomics" | "agent_usability" | "safety") | (string & {});
736
712
  /** Concise statement of the root cause. */
737
713
  title: string;
738
- /** What the API author should change. */
739
- description: string;
740
- /** Why consumers of generated CLI, MCP, or SDK surfaces care. */
741
- impact: string;
714
+ /** One explanation of the finding and why it matters. */
715
+ message: string;
742
716
  /** Public surfaces affected by the root cause. */
743
717
  surfaces: Array<("api" | "sdk" | "cli" | "mcp") | (string & {})>;
744
- /**
745
- * Whether the finding is provable from the Definition, a conservative review suggestion, or a
746
- * documented Typeship implementation limitation.
747
- */
748
- evidence_basis: ("contract" | "heuristic" | "implementation") | (string & {});
749
- /** Whether remediation requires intent that the Definition cannot prove. */
718
+ /** Whether remediation requires intent that the Spec cannot prove. */
750
719
  owner_decision_required: boolean;
751
- /** Concrete generated CLI, MCP, or SDK naming effect when Typeship can state it. */
752
- surface_impact?: string;
753
720
  /** All affected coordinates, kept under one grouped diagnostic. */
754
721
  locations: DiagnosticLocation[];
755
722
  fix?: DiagnosticFixRead;
@@ -760,20 +727,51 @@ export interface DiagnosticRead {
760
727
  authoring_brief: string;
761
728
  }
762
729
 
763
- /** Counts distinguish decisions from the number of affected schema locations. */
730
+ /**
731
+ * Counts of grouped Diagnostics, one per rule. Retrieve the revision with include=diagnostics for
732
+ * each Diagnostic.
733
+ */
764
734
  export interface DiagnosticSummary {
765
- /** Number of grouped rule diagnostics. */
766
- diagnostics: number;
767
- /** Total affected locations across all diagnostics. */
768
- occurrences: number;
769
- /** Grouped correctness errors. */
770
- errors: number;
771
- /** Grouped material risks. */
772
- warnings: number;
773
- /** Grouped improvements. */
774
- suggestions: number;
775
- /** Diagnostics with exact reviewable Definition patches. */
776
- auto_fixable: number;
735
+ /**
736
+ * passed: no Diagnostic fails the Spec's Diagnostic policy. blocked: at least one does; retrieve
737
+ * with include=diagnostics and fix those marked blocking.
738
+ */
739
+ status: "passed" | "blocked";
740
+ /** Diagnostics reporting invalid behavior. */
741
+ error_count: number;
742
+ /** Diagnostics reporting material risk. */
743
+ warning_count: number;
744
+ /** Diagnostics suggesting an improvement. */
745
+ suggestion_count: number;
746
+ /** Diagnostics that fail the Spec's Diagnostic policy. */
747
+ blocking_count: number;
748
+ /**
749
+ * The previous revision of this Spec that introduced Diagnostics are compared with, or null for
750
+ * the first revision.
751
+ */
752
+ baseline_spec_revision_id: SpecRevisionId | null;
753
+ }
754
+
755
+ /** Response shape for DiagnosticSummary. */
756
+ export interface DiagnosticSummaryRead {
757
+ /**
758
+ * passed: no Diagnostic fails the Spec's Diagnostic policy. blocked: at least one does; retrieve
759
+ * with include=diagnostics and fix those marked blocking.
760
+ */
761
+ status: ("passed" | "blocked") | (string & {});
762
+ /** Diagnostics reporting invalid behavior. */
763
+ error_count: number;
764
+ /** Diagnostics reporting material risk. */
765
+ warning_count: number;
766
+ /** Diagnostics suggesting an improvement. */
767
+ suggestion_count: number;
768
+ /** Diagnostics that fail the Spec's Diagnostic policy. */
769
+ blocking_count: number;
770
+ /**
771
+ * The previous revision of this Spec that introduced Diagnostics are compared with, or null for
772
+ * the first revision.
773
+ */
774
+ baseline_spec_revision_id: SpecRevisionId | null;
777
775
  }
778
776
 
779
777
  export interface DiagnosticSuppression {
@@ -819,150 +817,32 @@ export interface DiagnosticPolicyRead {
819
817
  suppressions: DiagnosticSuppression[];
820
818
  }
821
819
 
822
- export interface DiagnosticEvaluation {
823
- state: "pass" | "fail";
824
- blocking: DiagnosticReference[];
825
- considered_occurrences: number;
826
- suppressed_occurrences: number;
827
- }
828
-
829
- /** Response shape for DiagnosticEvaluation. */
830
- export interface DiagnosticEvaluationRead {
831
- state: ("pass" | "fail") | (string & {});
832
- blocking: DiagnosticReferenceRead[];
833
- considered_occurrences: number;
834
- suppressed_occurrences: number;
835
- }
836
-
837
- /** Current-revision suppression usage for one stable Diagnostic rule. */
838
- export interface DiagnosticSuppressionSignal {
839
- rule_id: string;
840
- /** Current occurrences of this rule that are not suppressed. */
841
- active_occurrences: number;
842
- suppressed_occurrences: number;
843
- }
844
-
845
- /**
846
- * Current-revision signals for tuning Diagnostics policy. These counts do not claim that a
847
- * suppression is a false positive or that runtime behavior has been verified.
848
- */
849
- export interface DiagnosticQualitySignals {
850
- suppressed_by_rule: DiagnosticSuppressionSignal[];
851
- /** Reviewed exceptions whose rule or exact path no longer matches this revision. */
852
- stale_suppressions: DiagnosticSuppressionResponse[];
853
- }
854
-
855
- /** Compact rule and location reference; full guidance appears once in diagnostics. */
856
- export interface DiagnosticReference {
857
- rule_id: string;
858
- severity: "error" | "warning" | "suggestion";
859
- title: string;
860
- locations: DiagnosticLocation[];
861
- }
862
-
863
- /** Response shape for DiagnosticReference. */
864
- export interface DiagnosticReferenceRead {
865
- rule_id: string;
866
- severity: ("error" | "warning" | "suggestion") | (string & {});
867
- title: string;
868
- locations: DiagnosticLocation[];
869
- }
870
-
871
- export interface DiagnosticDelta {
872
- added: DiagnosticReference[];
873
- resolved: DiagnosticReference[];
874
- baseline_definition_revision_id: DefinitionRevisionId | null;
875
- }
876
-
877
- /** Response shape for DiagnosticDelta. */
878
- export interface DiagnosticDeltaRead {
879
- added: DiagnosticReferenceRead[];
880
- resolved: DiagnosticReferenceRead[];
881
- baseline_definition_revision_id: DefinitionRevisionId | null;
882
- }
883
-
884
- /**
885
- * Deterministic Diagnostics for one immutable Definition Revision after existing patches. No
886
- * model-generated facts or silent edits.
887
- */
888
- export interface DiagnosticReport {
889
- object: "diagnostic_report";
890
- /** Contract format Typeship analyzed. */
891
- format: "openapi" | "graphql";
892
- project_id: ProjectId;
893
- definition_revision_id: DefinitionRevisionId;
894
- /** SHA-256 digest of the immutable raw source revision. */
895
- source_sha256: string;
896
- /** SHA-256 digest after applying the Definition's current patches. */
897
- analyzed_sha256: string;
898
- /** Loud misses or conflicts from the Definition's existing patches. */
899
- patch_diagnostics: string[];
900
- summary: DiagnosticSummary;
901
- /** Stable grouped diagnostics, ordered by severity and rule identifier. */
902
- diagnostics: Diagnostic[];
903
- policy: DiagnosticPolicyResponse;
904
- evaluation: DiagnosticEvaluation;
905
- quality_signals: DiagnosticQualitySignals;
906
- delta: DiagnosticDelta;
907
- request_id: RequestId;
908
- }
909
-
910
- /** Response shape for DiagnosticReport. */
911
- export interface DiagnosticReportRead {
912
- object: "diagnostic_report" | (string & {});
913
- /** Contract format Typeship analyzed. */
914
- format: ("openapi" | "graphql") | (string & {});
915
- project_id: ProjectId;
916
- definition_revision_id: DefinitionRevisionId;
917
- /** SHA-256 digest of the immutable raw source revision. */
918
- source_sha256: string;
919
- /** SHA-256 digest after applying the Definition's current patches. */
920
- analyzed_sha256: string;
921
- /** Loud misses or conflicts from the Definition's existing patches. */
922
- patch_diagnostics: string[];
923
- summary: DiagnosticSummary;
924
- /** Stable grouped diagnostics, ordered by severity and rule identifier. */
925
- diagnostics: DiagnosticRead[];
926
- policy: DiagnosticPolicyResponseRead;
927
- evaluation: DiagnosticEvaluationRead;
928
- quality_signals: DiagnosticQualitySignals;
929
- delta: DiagnosticDeltaRead;
930
- request_id: RequestId;
931
- }
932
-
933
- export interface DiagnosticRemediationRequest {
934
- /** Stable IDs of current diagnostics whose exact patches should be reviewed and applied. */
935
- diagnostic_ids: string[];
936
- }
937
-
938
- export interface DiagnosticRemediation {
939
- object: "diagnostic_remediation";
940
- kind: "overlay" | "source_review";
941
- patches_applied: number;
942
- /**
943
- * Source pull request for repository projects; absent for URL overlays.
944
- * Format: uri
945
- */
946
- review_url?: string | null;
947
- request_id: RequestId;
820
+ export interface DiagnosticWarning {
821
+ code: "unsupported_format"
822
+ | "invalid_document"
823
+ | "invalid_patch"
824
+ | "no_match"
825
+ | "append_target_type"
826
+ | "rename_target_type"
827
+ | "rename_conflict";
828
+ message: string;
948
829
  }
949
830
 
950
- /** Response shape for DiagnosticRemediation. */
951
- export interface DiagnosticRemediationRead {
952
- object: "diagnostic_remediation" | (string & {});
953
- kind: ("overlay" | "source_review") | (string & {});
954
- patches_applied: number;
955
- /**
956
- * Source pull request for repository projects; absent for URL overlays.
957
- * Format: uri
958
- */
959
- review_url?: string | null;
960
- request_id: RequestId;
831
+ /** Response shape for DiagnosticWarning. */
832
+ export interface DiagnosticWarningRead {
833
+ code: ("unsupported_format"
834
+ | "invalid_document"
835
+ | "invalid_patch"
836
+ | "no_match"
837
+ | "append_target_type"
838
+ | "rename_target_type"
839
+ | "rename_conflict") | (string & {});
840
+ message: string;
961
841
  }
962
842
 
963
- export interface RepositoryDeliveryInput {
964
- kind: "repository";
965
- repository: RepositoryReference;
843
+ export interface RepositoryDeliverySettingsInput {
844
+ provider: RepositoryProvider;
845
+ identifier: RepositoryIdentifier;
966
846
  directory?: string | null;
967
847
  /** npm or Python registry identity where applicable. */
968
848
  package_name?: string | null;
@@ -975,10 +855,10 @@ export interface RepositoryDeliveryInput {
975
855
  publish_on_merge?: boolean;
976
856
  }
977
857
 
978
- /** Response shape for RepositoryDeliveryInput. */
979
- export interface RepositoryDeliveryInputRead {
980
- kind: "repository" | (string & {});
981
- repository: RepositoryReferenceRead;
858
+ /** Response shape for RepositoryDeliverySettingsInput. */
859
+ export interface RepositoryDeliverySettingsInputRead {
860
+ provider: RepositoryProvider | (string & {});
861
+ identifier: RepositoryIdentifier;
982
862
  directory?: string | null;
983
863
  /** npm or Python registry identity where applicable. */
984
864
  package_name?: string | null;
@@ -991,13 +871,24 @@ export interface RepositoryDeliveryInputRead {
991
871
  publish_on_merge?: boolean;
992
872
  }
993
873
 
874
+ export interface RepositoryDeliveryInput {
875
+ type: "repository";
876
+ repository: RepositoryDeliverySettingsInput;
877
+ }
878
+
879
+ /** Response shape for RepositoryDeliveryInput. */
880
+ export interface RepositoryDeliveryInputRead {
881
+ type: "repository" | (string & {});
882
+ repository: RepositoryDeliverySettingsInputRead;
883
+ }
884
+
994
885
  export interface HostedMcpDeliveryInput {
995
- kind: "hosted_mcp";
886
+ type: "hosted_mcp";
996
887
  }
997
888
 
998
889
  /** Response shape for HostedMcpDeliveryInput. */
999
890
  export interface HostedMcpDeliveryInputRead {
1000
- kind: "hosted_mcp" | (string & {});
891
+ type: "hosted_mcp" | (string & {});
1001
892
  }
1002
893
 
1003
894
  export type DeliveryInput = RepositoryDeliveryInput | HostedMcpDeliveryInput;
@@ -1005,19 +896,54 @@ export type DeliveryInput = RepositoryDeliveryInput | HostedMcpDeliveryInput;
1005
896
  /** Response shape for DeliveryInput. */
1006
897
  export type DeliveryInputRead = RepositoryDeliveryInputRead
1007
898
  | HostedMcpDeliveryInputRead
1008
- | Record<string, unknown> & { kind?: string };
899
+ | Record<string, unknown> & { type?: string };
1009
900
 
1010
- export interface RepositoryDelivery {
1011
- id: DeliveryId;
1012
- object: "delivery";
1013
- target_id: TargetId;
1014
- kind: "repository";
1015
- state: "active" | "disabled";
1016
- repository: RepositoryReferenceResponse;
901
+ export interface RepositoryDeliverySettings {
902
+ provider: RepositoryProvider;
903
+ identifier: RepositoryIdentifier;
1017
904
  directory: string | null;
1018
905
  package_name: string | null;
1019
906
  module_path: string | null;
1020
907
  publish_on_merge: boolean;
908
+ }
909
+
910
+ /** Response shape for RepositoryDeliverySettings. */
911
+ export interface RepositoryDeliverySettingsRead {
912
+ provider: RepositoryProvider | (string & {});
913
+ identifier: RepositoryIdentifier;
914
+ directory: string | null;
915
+ package_name: string | null;
916
+ module_path: string | null;
917
+ publish_on_merge: boolean;
918
+ }
919
+
920
+ export interface HostedMcpDeliverySettings {
921
+ /**
922
+ * Hosted MCP endpoint for this Target, or null while it is being provisioned.
923
+ * Format: uri
924
+ */
925
+ url: string | null;
926
+ }
927
+
928
+ export interface RepositoryDelivery {
929
+ id: DeliveryId;
930
+ object: "delivery";
931
+ target_id: TargetId;
932
+ type: "repository";
933
+ /**
934
+ * active: the repository accepts generated changes. action_required: inspect issues for the
935
+ * correction. disabled: the Target is disabled and receives no changes.
936
+ */
937
+ status: "active" | "action_required" | "disabled";
938
+ repository: RepositoryDeliverySettings;
939
+ issues: RepositoryDeliveryIssue[];
940
+ /** Repository check names Typeship expects before accepting a Draft. */
941
+ required_checks: string[];
942
+ /**
943
+ * Last observed repository event relevant to this Delivery, if available. A failed event adds an
944
+ * actionable issue.
945
+ */
946
+ last_event: RepositoryDeliveryEvent | null;
1021
947
  /** Format: date-time */
1022
948
  created_at: string;
1023
949
  /** Format: date-time */
@@ -1029,27 +955,82 @@ export interface RepositoryDeliveryRead {
1029
955
  id: DeliveryId;
1030
956
  object: "delivery" | (string & {});
1031
957
  target_id: TargetId;
1032
- kind: "repository" | (string & {});
1033
- state: ("active" | "disabled") | (string & {});
1034
- repository: RepositoryReferenceResponseRead;
1035
- directory: string | null;
1036
- package_name: string | null;
1037
- module_path: string | null;
1038
- publish_on_merge: boolean;
958
+ type: "repository" | (string & {});
959
+ /**
960
+ * active: the repository accepts generated changes. action_required: inspect issues for the
961
+ * correction. disabled: the Target is disabled and receives no changes.
962
+ */
963
+ status: ("active" | "action_required" | "disabled") | (string & {});
964
+ repository: RepositoryDeliverySettingsRead;
965
+ issues: RepositoryDeliveryIssueRead[];
966
+ /** Repository check names Typeship expects before accepting a Draft. */
967
+ required_checks: string[];
968
+ /**
969
+ * Last observed repository event relevant to this Delivery, if available. A failed event adds an
970
+ * actionable issue.
971
+ */
972
+ last_event: RepositoryDeliveryEventRead | null;
1039
973
  /** Format: date-time */
1040
974
  created_at: string;
1041
975
  /** Format: date-time */
1042
976
  updated_at: string;
1043
977
  }
1044
978
 
979
+ export interface RepositoryDeliveryIssue {
980
+ code: "app_not_installed"
981
+ | "repository_unreachable"
982
+ | "contents_write_missing"
983
+ | "pull_request_missing"
984
+ | "approval_label_missing"
985
+ | "check_missing"
986
+ | "event_failed";
987
+ /** Specific customer action or repository setting to inspect. */
988
+ message: string;
989
+ }
990
+
991
+ /** Response shape for RepositoryDeliveryIssue. */
992
+ export interface RepositoryDeliveryIssueRead {
993
+ code: ("app_not_installed"
994
+ | "repository_unreachable"
995
+ | "contents_write_missing"
996
+ | "pull_request_missing"
997
+ | "approval_label_missing"
998
+ | "check_missing"
999
+ | "event_failed") | (string & {});
1000
+ /** Specific customer action or repository setting to inspect. */
1001
+ message: string;
1002
+ }
1003
+
1004
+ export interface RepositoryDeliveryEvent {
1005
+ /** Repository event type. */
1006
+ event: string;
1007
+ /** superseded: a newer event for the same repository replaced this one before it finished. */
1008
+ status: "queued" | "running" | "completed" | "failed" | "superseded";
1009
+ /** Format: date-time */
1010
+ created_at: string;
1011
+ }
1012
+
1013
+ /** Response shape for RepositoryDeliveryEvent. */
1014
+ export interface RepositoryDeliveryEventRead {
1015
+ /** Repository event type. */
1016
+ event: string;
1017
+ /** superseded: a newer event for the same repository replaced this one before it finished. */
1018
+ status: ("queued" | "running" | "completed" | "failed" | "superseded") | (string & {});
1019
+ /** Format: date-time */
1020
+ created_at: string;
1021
+ }
1022
+
1045
1023
  export interface HostedMcpDelivery {
1046
1024
  id: DeliveryId;
1047
1025
  object: "delivery";
1048
1026
  target_id: TargetId;
1049
- kind: "hosted_mcp";
1050
- state: "active" | "disabled";
1051
- /** Format: uri */
1052
- url: string | null;
1027
+ type: "hosted_mcp";
1028
+ /**
1029
+ * active: the endpoint serves the Target's latest accepted package. disabled: the Target is
1030
+ * disabled and the endpoint is paused.
1031
+ */
1032
+ status: "active" | "disabled";
1033
+ hosted_mcp: HostedMcpDeliverySettings;
1053
1034
  /** Format: date-time */
1054
1035
  created_at: string;
1055
1036
  /** Format: date-time */
@@ -1061,10 +1042,13 @@ export interface HostedMcpDeliveryRead {
1061
1042
  id: DeliveryId;
1062
1043
  object: "delivery" | (string & {});
1063
1044
  target_id: TargetId;
1064
- kind: "hosted_mcp" | (string & {});
1065
- state: ("active" | "disabled") | (string & {});
1066
- /** Format: uri */
1067
- url: string | null;
1045
+ type: "hosted_mcp" | (string & {});
1046
+ /**
1047
+ * active: the endpoint serves the Target's latest accepted package. disabled: the Target is
1048
+ * disabled and the endpoint is paused.
1049
+ */
1050
+ status: ("active" | "disabled") | (string & {});
1051
+ hosted_mcp: HostedMcpDeliverySettings;
1068
1052
  /** Format: date-time */
1069
1053
  created_at: string;
1070
1054
  /** Format: date-time */
@@ -1076,25 +1060,23 @@ export type Delivery = RepositoryDelivery | HostedMcpDelivery;
1076
1060
  /** Response shape for Delivery. */
1077
1061
  export type DeliveryRead = RepositoryDeliveryRead
1078
1062
  | HostedMcpDeliveryRead
1079
- | Record<string, unknown> & { kind?: string };
1063
+ | Record<string, unknown> & { type?: string };
1080
1064
 
1081
1065
  /**
1082
- * Repository fields are present for a repository Delivery; url is present for a hosted_mcp
1083
- * Delivery.
1066
+ * repository is present for a repository Delivery, with issues, required_checks, and last_event;
1067
+ * hosted_mcp is present for a hosted_mcp Delivery.
1084
1068
  */
1085
1069
  export interface DeliveryResponse {
1086
1070
  id: DeliveryId;
1087
1071
  object: "delivery";
1088
1072
  target_id: TargetId;
1089
- kind: "repository" | "hosted_mcp";
1090
- state: "active" | "disabled";
1091
- repository?: RepositoryReferenceResponse;
1092
- directory?: string | null;
1093
- package_name?: string | null;
1094
- module_path?: string | null;
1095
- publish_on_merge?: boolean;
1096
- /** Format: uri */
1097
- url?: string | null;
1073
+ type: "repository" | "hosted_mcp";
1074
+ status: "active" | "action_required" | "disabled";
1075
+ repository?: RepositoryDeliverySettings;
1076
+ issues?: RepositoryDeliveryIssue[];
1077
+ required_checks?: string[];
1078
+ last_event?: RepositoryDeliveryEvent | null;
1079
+ hosted_mcp?: HostedMcpDeliverySettings;
1098
1080
  /** Format: date-time */
1099
1081
  created_at: string;
1100
1082
  /** Format: date-time */
@@ -1107,15 +1089,13 @@ export interface DeliveryResponseRead {
1107
1089
  id: DeliveryId;
1108
1090
  object: "delivery" | (string & {});
1109
1091
  target_id: TargetId;
1110
- kind: ("repository" | "hosted_mcp") | (string & {});
1111
- state: ("active" | "disabled") | (string & {});
1112
- repository?: RepositoryReferenceResponseRead;
1113
- directory?: string | null;
1114
- package_name?: string | null;
1115
- module_path?: string | null;
1116
- publish_on_merge?: boolean;
1117
- /** Format: uri */
1118
- url?: string | null;
1092
+ type: ("repository" | "hosted_mcp") | (string & {});
1093
+ status: ("active" | "action_required" | "disabled") | (string & {});
1094
+ repository?: RepositoryDeliverySettingsRead;
1095
+ issues?: RepositoryDeliveryIssueRead[];
1096
+ required_checks?: string[];
1097
+ last_event?: RepositoryDeliveryEventRead | null;
1098
+ hosted_mcp?: HostedMcpDeliverySettings;
1119
1099
  /** Format: date-time */
1120
1100
  created_at: string;
1121
1101
  /** Format: date-time */
@@ -1124,26 +1104,26 @@ export interface DeliveryResponseRead {
1124
1104
  }
1125
1105
 
1126
1106
  /**
1127
- * One Target generated from a sibling Target. A go-cli Target carries kind go_sdk_module, naming
1107
+ * One Target generated from a sibling Target. A go_cli Target carries type go_sdk_module, naming
1128
1108
  * the Go SDK Target it is generated against.
1129
1109
  */
1130
1110
  export interface TargetDependency {
1131
- kind: "go_sdk_module";
1111
+ type: "go_sdk_module";
1132
1112
  target_id: TargetId;
1133
1113
  }
1134
1114
 
1135
1115
  /** Response shape for TargetDependency. */
1136
1116
  export interface TargetDependencyRead {
1137
- kind: "go_sdk_module" | (string & {});
1117
+ type: "go_sdk_module" | (string & {});
1138
1118
  target_id: TargetId;
1139
1119
  }
1140
1120
 
1141
1121
  /**
1142
- * Required checks run against the complete combined package. Generated checks and customer commands
1143
- * share one reproducible workflow; repository_required names existing repository checks. Supplying
1144
- * checks replaces all settings. Omitted generated restores build, package, and public_entrypoint;
1145
- * omitted repository_required and customer restore empty lists. An empty object restores these
1146
- * defaults. An empty array clears the corresponding list.
1122
+ * Required checks run against the code in the Draft. Generated checks and customer commands share
1123
+ * one reproducible workflow; repository_required names existing repository checks. Supplying checks
1124
+ * replaces all settings. Omitted generated restores build, package, and public_entrypoint; omitted
1125
+ * repository_required and customer restore empty lists. An empty object restores these defaults. An
1126
+ * empty array clears the corresponding list.
1147
1127
  */
1148
1128
  export interface TargetChecks {
1149
1129
  /** Default: ["build","package","public_entrypoint"] */
@@ -1166,44 +1146,38 @@ export interface TargetChecksRead {
1166
1146
  }>;
1167
1147
  }
1168
1148
 
1169
- export interface TargetFields {
1149
+ export interface TargetCreateRequest {
1150
+ project_id: ProjectId;
1170
1151
  name: string;
1171
- definition_id: DefinitionId;
1172
- generator: GeneratorKind;
1152
+ spec_id: SpecId;
1153
+ type: GeneratorKind;
1173
1154
  /** Default: "active" */
1174
- state?: "active" | "disabled";
1175
- /** Default: "2026-08-24" */
1176
- edition?: string;
1155
+ status?: "active" | "disabled";
1177
1156
  /** Default: "stable" */
1178
1157
  release_channel?: "stable" | "prerelease";
1179
- /** Optional larger or prerelease SemVer for the next reviewed release. */
1180
- proposed_version?: string | null;
1181
1158
  checks?: TargetChecks;
1182
1159
  /**
1183
1160
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
1184
- * belong to the Definition.
1161
+ * belong to the Spec.
1185
1162
  */
1186
1163
  config?: TargetConfig | null;
1187
1164
  deliveries?: DeliveryInput[];
1188
1165
  }
1189
1166
 
1190
- /** Response shape for TargetFields. */
1191
- export interface TargetFieldsRead {
1167
+ /** Response shape for TargetCreateRequest. */
1168
+ export interface TargetCreateRequestRead {
1169
+ project_id: ProjectId;
1192
1170
  name: string;
1193
- definition_id: DefinitionId;
1194
- generator: GeneratorKind | (string & {});
1171
+ spec_id: SpecId;
1172
+ type: GeneratorKind | (string & {});
1195
1173
  /** Default: "active" */
1196
- state?: ("active" | "disabled") | (string & {});
1197
- /** Default: "2026-08-24" */
1198
- edition?: string;
1174
+ status?: ("active" | "disabled") | (string & {});
1199
1175
  /** Default: "stable" */
1200
1176
  release_channel?: ("stable" | "prerelease") | (string & {});
1201
- /** Optional larger or prerelease SemVer for the next reviewed release. */
1202
- proposed_version?: string | null;
1203
1177
  checks?: TargetChecksRead;
1204
1178
  /**
1205
1179
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
1206
- * belong to the Definition.
1180
+ * belong to the Spec.
1207
1181
  */
1208
1182
  config?: TargetConfigRead | null;
1209
1183
  deliveries?: DeliveryInputRead[];
@@ -1211,18 +1185,15 @@ export interface TargetFieldsRead {
1211
1185
 
1212
1186
  export interface InitialTargetFields {
1213
1187
  name: string;
1214
- generator: GeneratorKind;
1188
+ type: GeneratorKind;
1215
1189
  /** Default: "active" */
1216
- state?: "active" | "disabled";
1217
- /** Default: "2026-08-24" */
1218
- edition?: string;
1190
+ status?: "active" | "disabled";
1219
1191
  /** Default: "stable" */
1220
1192
  release_channel?: "stable" | "prerelease";
1221
- proposed_version?: string | null;
1222
1193
  checks?: TargetChecks;
1223
1194
  /**
1224
1195
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
1225
- * belong to the Definition.
1196
+ * belong to the Spec.
1226
1197
  */
1227
1198
  config?: TargetConfig | null;
1228
1199
  deliveries?: DeliveryInput[];
@@ -1231,18 +1202,15 @@ export interface InitialTargetFields {
1231
1202
  /** Response shape for InitialTargetFields. */
1232
1203
  export interface InitialTargetFieldsRead {
1233
1204
  name: string;
1234
- generator: GeneratorKind | (string & {});
1205
+ type: GeneratorKind | (string & {});
1235
1206
  /** Default: "active" */
1236
- state?: ("active" | "disabled") | (string & {});
1237
- /** Default: "2026-08-24" */
1238
- edition?: string;
1207
+ status?: ("active" | "disabled") | (string & {});
1239
1208
  /** Default: "stable" */
1240
1209
  release_channel?: ("stable" | "prerelease") | (string & {});
1241
- proposed_version?: string | null;
1242
1210
  checks?: TargetChecksRead;
1243
1211
  /**
1244
1212
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
1245
- * belong to the Definition.
1213
+ * belong to the Spec.
1246
1214
  */
1247
1215
  config?: TargetConfigRead | null;
1248
1216
  deliveries?: DeliveryInputRead[];
@@ -1250,19 +1218,12 @@ export interface InitialTargetFieldsRead {
1250
1218
 
1251
1219
  export interface TargetUpdateRequest {
1252
1220
  name?: string;
1253
- state?: "active" | "disabled";
1254
- edition?: string;
1221
+ status?: "active" | "disabled";
1255
1222
  release_channel?: "stable" | "prerelease";
1256
- /**
1257
- * Send only this field to select an exact SemVer, or null for automatic selection. The Target and
1258
- * Draft endpoints both support an optional If-Match precondition.
1259
- */
1260
- proposed_version?: string | null;
1261
1223
  checks?: TargetChecks;
1262
1224
  /**
1263
1225
  * Replaces the complete stored override object. Send null or an empty object to resume Project
1264
- * inheritance. Effective values merge over Project.config; GraphQL settings belong to the
1265
- * Definition.
1226
+ * inheritance. Effective values merge over Project.config; GraphQL settings belong to the Spec.
1266
1227
  */
1267
1228
  config?: TargetConfig | null;
1268
1229
  /**
@@ -1278,19 +1239,12 @@ export interface TargetUpdateRequest {
1278
1239
  /** Response shape for TargetUpdateRequest. */
1279
1240
  export interface TargetUpdateRequestRead {
1280
1241
  name?: string;
1281
- state?: ("active" | "disabled") | (string & {});
1282
- edition?: string;
1242
+ status?: ("active" | "disabled") | (string & {});
1283
1243
  release_channel?: ("stable" | "prerelease") | (string & {});
1284
- /**
1285
- * Send only this field to select an exact SemVer, or null for automatic selection. The Target and
1286
- * Draft endpoints both support an optional If-Match precondition.
1287
- */
1288
- proposed_version?: string | null;
1289
1244
  checks?: TargetChecksRead;
1290
1245
  /**
1291
1246
  * Replaces the complete stored override object. Send null or an empty object to resume Project
1292
- * inheritance. Effective values merge over Project.config; GraphQL settings belong to the
1293
- * Definition.
1247
+ * inheritance. Effective values merge over Project.config; GraphQL settings belong to the Spec.
1294
1248
  */
1295
1249
  config?: TargetConfigRead | null;
1296
1250
  /**
@@ -1303,36 +1257,35 @@ export interface TargetUpdateRequestRead {
1303
1257
  deliveries?: DeliveryInputRead[];
1304
1258
  }
1305
1259
 
1260
+ /**
1261
+ * All Targets follow reviewed SemVer. Before 1.0.0, breaking changes require a minor version; the
1262
+ * policy is fixed rather than configurable.
1263
+ */
1306
1264
  export interface Target {
1307
1265
  id: TargetId;
1308
1266
  object: "target";
1309
1267
  project_id: ProjectId;
1310
- definition_id: DefinitionId;
1268
+ spec_id: SpecId;
1311
1269
  name: string;
1312
- generator: GeneratorKind;
1270
+ type: GeneratorKind;
1313
1271
  /**
1314
- * Present only on a go-cli Target, naming the sibling Go SDK Target the CLI is generated against.
1315
- * Every other generator reports null.
1272
+ * Present only on a go_cli Target, naming the sibling Go SDK Target the CLI is generated against.
1273
+ * Every other Target type reports null.
1316
1274
  */
1317
1275
  dependency: TargetDependency | null;
1318
- state: "active" | "disabled";
1319
- edition: string;
1276
+ status: "active" | "disabled";
1320
1277
  release_channel: "stable" | "prerelease";
1321
- version_policy: {
1322
- mode: "reviewed_semver";
1323
- pre1_breaking: "minor";
1324
- };
1325
1278
  /**
1326
- * Read-only version of the Target's Current release, or null before its first release. Registry
1327
- * publication status is separate; inspect the Target Release for publication results.
1279
+ * Read-only version of the Target's latest release, or null before its first release. Publishing
1280
+ * status is separate; inspect the release for its results.
1328
1281
  */
1329
- current_version: string | null;
1330
- proposed_version: string | null;
1331
- proposed_version_source: "console" | "api" | "github" | null;
1282
+ version_current: string | null;
1283
+ /** The Target's open Draft. After a merge it names the next Draft. */
1284
+ draft_id: DraftId;
1332
1285
  checks: TargetChecksResponse;
1333
1286
  /**
1334
- * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
1335
- * never appear here.
1287
+ * Target-specific overrides merged over Project.config. GraphQL settings are Spec-owned and never
1288
+ * appear here.
1336
1289
  */
1337
1290
  config: TargetConfigResponse | null;
1338
1291
  /** At most one repository and one hosted MCP Delivery. */
@@ -1349,27 +1302,15 @@ export interface TargetWrite {
1349
1302
  id: TargetId;
1350
1303
  object: "target";
1351
1304
  project_id: ProjectId;
1352
- definition_id: DefinitionId;
1305
+ spec_id: SpecId;
1353
1306
  name: string;
1354
- generator: GeneratorKind;
1355
- state: "active" | "disabled";
1356
- edition: string;
1307
+ type: GeneratorKind;
1308
+ status: "active" | "disabled";
1357
1309
  release_channel: "stable" | "prerelease";
1358
- version_policy: {
1359
- mode: "reviewed_semver";
1360
- pre1_breaking: "minor";
1361
- };
1362
- /**
1363
- * Read-only version of the Target's Current release, or null before its first release. Registry
1364
- * publication status is separate; inspect the Target Release for publication results.
1365
- */
1366
- current_version: string | null;
1367
- proposed_version: string | null;
1368
- proposed_version_source: "console" | "api" | "github" | null;
1369
1310
  checks: TargetChecksResponse;
1370
1311
  /**
1371
- * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
1372
- * never appear here.
1312
+ * Target-specific overrides merged over Project.config. GraphQL settings are Spec-owned and never
1313
+ * appear here.
1373
1314
  */
1374
1315
  config: TargetConfigResponse | null;
1375
1316
  /** At most one repository and one hosted MCP Delivery. */
@@ -1386,32 +1327,27 @@ export interface TargetRead {
1386
1327
  id: TargetId;
1387
1328
  object: "target" | (string & {});
1388
1329
  project_id: ProjectId;
1389
- definition_id: DefinitionId;
1330
+ spec_id: SpecId;
1390
1331
  name: string;
1391
- generator: GeneratorKind | (string & {});
1332
+ type: GeneratorKind | (string & {});
1392
1333
  /**
1393
- * Present only on a go-cli Target, naming the sibling Go SDK Target the CLI is generated against.
1394
- * Every other generator reports null.
1334
+ * Present only on a go_cli Target, naming the sibling Go SDK Target the CLI is generated against.
1335
+ * Every other Target type reports null.
1395
1336
  */
1396
1337
  dependency: TargetDependencyRead | null;
1397
- state: ("active" | "disabled") | (string & {});
1398
- edition: string;
1338
+ status: ("active" | "disabled") | (string & {});
1399
1339
  release_channel: ("stable" | "prerelease") | (string & {});
1400
- version_policy: {
1401
- mode: "reviewed_semver" | (string & {});
1402
- pre1_breaking: "minor" | (string & {});
1403
- };
1404
1340
  /**
1405
- * Read-only version of the Target's Current release, or null before its first release. Registry
1406
- * publication status is separate; inspect the Target Release for publication results.
1341
+ * Read-only version of the Target's latest release, or null before its first release. Publishing
1342
+ * status is separate; inspect the release for its results.
1407
1343
  */
1408
- current_version: string | null;
1409
- proposed_version: string | null;
1410
- proposed_version_source: ("console" | "api" | "github" | null) | (string & {}) | null;
1344
+ version_current: string | null;
1345
+ /** The Target's open Draft. After a merge it names the next Draft. */
1346
+ draft_id: DraftId;
1411
1347
  checks: TargetChecksResponseRead;
1412
1348
  /**
1413
- * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
1414
- * never appear here.
1349
+ * Target-specific overrides merged over Project.config. GraphQL settings are Spec-owned and never
1350
+ * appear here.
1415
1351
  */
1416
1352
  config: TargetConfigResponseRead | null;
1417
1353
  /** At most one repository and one hosted MCP Delivery. */
@@ -1431,6 +1367,57 @@ export type TargetResponseWrite = TargetWrite & ResponseMetadata;
1431
1367
  /** Response shape for TargetResponse. */
1432
1368
  export type TargetResponseRead = TargetRead & ResponseMetadata;
1433
1369
 
1370
+ export interface DeliveryList {
1371
+ object: ListObject;
1372
+ data: Delivery[];
1373
+ has_more: boolean;
1374
+ next_cursor: string | null;
1375
+ request_id: RequestId;
1376
+ }
1377
+
1378
+ /** Response shape for DeliveryList. */
1379
+ export interface DeliveryListRead {
1380
+ object: ListObject;
1381
+ data: DeliveryRead[];
1382
+ has_more: boolean;
1383
+ next_cursor: string | null;
1384
+ request_id: RequestId;
1385
+ }
1386
+
1387
+ export interface PublicationList {
1388
+ object: ListObject;
1389
+ data: Publication[];
1390
+ has_more: boolean;
1391
+ next_cursor: string | null;
1392
+ request_id: RequestId;
1393
+ }
1394
+
1395
+ /** Response shape for PublicationList. */
1396
+ export interface PublicationListRead {
1397
+ object: ListObject;
1398
+ data: PublicationRead[];
1399
+ has_more: boolean;
1400
+ next_cursor: string | null;
1401
+ request_id: RequestId;
1402
+ }
1403
+
1404
+ export interface DraftList {
1405
+ object: ListObject;
1406
+ data: Draft[];
1407
+ has_more: boolean;
1408
+ next_cursor: string | null;
1409
+ request_id: RequestId;
1410
+ }
1411
+
1412
+ /** Response shape for DraftList. */
1413
+ export interface DraftListRead {
1414
+ object: ListObject;
1415
+ data: DraftRead[];
1416
+ has_more: boolean;
1417
+ next_cursor: string | null;
1418
+ request_id: RequestId;
1419
+ }
1420
+
1434
1421
  export interface TargetList {
1435
1422
  object: ListObject;
1436
1423
  data: Target[];
@@ -1457,9 +1444,9 @@ export interface TargetListRead {
1457
1444
  request_id: RequestId;
1458
1445
  }
1459
1446
 
1460
- export interface TargetRelease {
1461
- id: TargetReleaseId;
1462
- object: "target_release";
1447
+ export interface Release {
1448
+ id: ReleaseId;
1449
+ object: "release";
1463
1450
  target_id: TargetId;
1464
1451
  /** Null only for a verified release imported during package adoption. */
1465
1452
  generation_id: GenerationId | null;
@@ -1467,22 +1454,33 @@ export interface TargetRelease {
1467
1454
  /** Immutable package version released from this Target. */
1468
1455
  version: string;
1469
1456
  channel: "stable" | "prerelease";
1470
- /** Delivery provider that accepted the release. */
1471
- provider: string;
1472
1457
  repository: RepositoryReferenceResponse | null;
1473
- definition_revision_id: DefinitionRevisionId | null;
1474
- /** Immutable provider-native revision that was merged or published. */
1475
- delivery_revision: string;
1476
- /** Digest of the exact accepted source tree used for publication. */
1477
- source_digest: string | null;
1458
+ spec_revision_id: SpecRevisionId | null;
1459
+ /**
1460
+ * Git commit containing the accepted package. Compare it with the Delivery repository history or
1461
+ * checked-out commit.
1462
+ */
1463
+ commit_sha: string;
1478
1464
  checks: PackageCheck[];
1479
- accepted_risks: AcceptedCompatibilityRisk[];
1465
+ approvals: CompatibilityApproval[];
1466
+ /**
1467
+ * For an adopted Release, compare the tag and registry URL with the published package and its
1468
+ * artifact digest. Null for a Release created by Typeship.
1469
+ */
1480
1470
  import_provenance: {
1471
+ /** Git tag to compare with the repository release, if available. */
1481
1472
  tag: string | null;
1482
- /** Format: uri */
1473
+ /**
1474
+ * Published package page to inspect, if available.
1475
+ * Format: uri
1476
+ */
1483
1477
  registry_url: string | null;
1478
+ /** Published artifact digest to compare with registry metadata, if available. */
1484
1479
  artifact_digest: string | null;
1485
- /** Format: date-time */
1480
+ /**
1481
+ * When Typeship recorded the adopted package.
1482
+ * Format: date-time
1483
+ */
1486
1484
  imported_at: string | null;
1487
1485
  }
1488
1486
  | null;
@@ -1492,10 +1490,10 @@ export interface TargetRelease {
1492
1490
  request_id?: RequestId;
1493
1491
  }
1494
1492
 
1495
- /** Response shape for TargetRelease. */
1496
- export interface TargetReleaseRead {
1497
- id: TargetReleaseId;
1498
- object: "target_release" | (string & {});
1493
+ /** Response shape for Release. */
1494
+ export interface ReleaseRead {
1495
+ id: ReleaseId;
1496
+ object: "release" | (string & {});
1499
1497
  target_id: TargetId;
1500
1498
  /** Null only for a verified release imported during package adoption. */
1501
1499
  generation_id: GenerationId | null;
@@ -1503,22 +1501,33 @@ export interface TargetReleaseRead {
1503
1501
  /** Immutable package version released from this Target. */
1504
1502
  version: string;
1505
1503
  channel: ("stable" | "prerelease") | (string & {});
1506
- /** Delivery provider that accepted the release. */
1507
- provider: string;
1508
1504
  repository: RepositoryReferenceResponseRead | null;
1509
- definition_revision_id: DefinitionRevisionId | null;
1510
- /** Immutable provider-native revision that was merged or published. */
1511
- delivery_revision: string;
1512
- /** Digest of the exact accepted source tree used for publication. */
1513
- source_digest: string | null;
1505
+ spec_revision_id: SpecRevisionId | null;
1506
+ /**
1507
+ * Git commit containing the accepted package. Compare it with the Delivery repository history or
1508
+ * checked-out commit.
1509
+ */
1510
+ commit_sha: string;
1514
1511
  checks: PackageCheckRead[];
1515
- accepted_risks: AcceptedCompatibilityRiskRead[];
1512
+ approvals: CompatibilityApprovalRead[];
1513
+ /**
1514
+ * For an adopted Release, compare the tag and registry URL with the published package and its
1515
+ * artifact digest. Null for a Release created by Typeship.
1516
+ */
1516
1517
  import_provenance: {
1518
+ /** Git tag to compare with the repository release, if available. */
1517
1519
  tag: string | null;
1518
- /** Format: uri */
1520
+ /**
1521
+ * Published package page to inspect, if available.
1522
+ * Format: uri
1523
+ */
1519
1524
  registry_url: string | null;
1525
+ /** Published artifact digest to compare with registry metadata, if available. */
1520
1526
  artifact_digest: string | null;
1521
- /** Format: date-time */
1527
+ /**
1528
+ * When Typeship recorded the adopted package.
1529
+ * Format: date-time
1530
+ */
1522
1531
  imported_at: string | null;
1523
1532
  }
1524
1533
  | null;
@@ -1528,23 +1537,23 @@ export interface TargetReleaseRead {
1528
1537
  request_id?: RequestId;
1529
1538
  }
1530
1539
 
1531
- export type TargetReleaseResponse = TargetRelease & ResponseMetadata;
1540
+ export type ReleaseResponse = Release & ResponseMetadata;
1532
1541
 
1533
- /** Response shape for TargetReleaseResponse. */
1534
- export type TargetReleaseResponseRead = TargetReleaseRead & ResponseMetadata;
1542
+ /** Response shape for ReleaseResponse. */
1543
+ export type ReleaseResponseRead = ReleaseRead & ResponseMetadata;
1535
1544
 
1536
- export interface TargetReleaseList {
1545
+ export interface ReleaseList {
1537
1546
  object: ListObject;
1538
- data: TargetRelease[];
1547
+ data: Release[];
1539
1548
  has_more: boolean;
1540
1549
  next_cursor: string | null;
1541
1550
  request_id: RequestId;
1542
1551
  }
1543
1552
 
1544
- /** Response shape for TargetReleaseList. */
1545
- export interface TargetReleaseListRead {
1553
+ /** Response shape for ReleaseList. */
1554
+ export interface ReleaseListRead {
1546
1555
  object: ListObject;
1547
- data: TargetReleaseRead[];
1556
+ data: ReleaseRead[];
1548
1557
  has_more: boolean;
1549
1558
  next_cursor: string | null;
1550
1559
  request_id: RequestId;
@@ -1553,9 +1562,9 @@ export interface TargetReleaseListRead {
1553
1562
  export interface Publication {
1554
1563
  id: PublicationId;
1555
1564
  object: "publication";
1556
- target_release_id: TargetReleaseId;
1565
+ release_id: ReleaseId;
1557
1566
  destination: "github" | "npm" | "pypi" | "go" | "mcp";
1558
- state: "pending" | "publishing" | "published" | "failed" | "disabled";
1567
+ status: "pending" | "publishing" | "published" | "failed" | "disabled";
1559
1568
  attempt: number;
1560
1569
  /** Format: uri */
1561
1570
  run_url: string | null;
@@ -1568,6 +1577,10 @@ export interface Publication {
1568
1577
  started_at: string | null;
1569
1578
  /** Format: date-time */
1570
1579
  finished_at: string | null;
1580
+ /** Milliseconds from started_at to finished_at; null until the attempt finishes. */
1581
+ runtime_ms: number | null;
1582
+ /** Format: date-time */
1583
+ created_at: string;
1571
1584
  /** Format: date-time */
1572
1585
  updated_at: string;
1573
1586
  }
@@ -1576,9 +1589,9 @@ export interface Publication {
1576
1589
  export interface PublicationRead {
1577
1590
  id: PublicationId;
1578
1591
  object: "publication" | (string & {});
1579
- target_release_id: TargetReleaseId;
1592
+ release_id: ReleaseId;
1580
1593
  destination: ("github" | "npm" | "pypi" | "go" | "mcp") | (string & {});
1581
- state: ("pending" | "publishing" | "published" | "failed" | "disabled") | (string & {});
1594
+ status: ("pending" | "publishing" | "published" | "failed" | "disabled") | (string & {});
1582
1595
  attempt: number;
1583
1596
  /** Format: uri */
1584
1597
  run_url: string | null;
@@ -1591,235 +1604,266 @@ export interface PublicationRead {
1591
1604
  started_at: string | null;
1592
1605
  /** Format: date-time */
1593
1606
  finished_at: string | null;
1607
+ /** Milliseconds from started_at to finished_at; null until the attempt finishes. */
1608
+ runtime_ms: number | null;
1609
+ /** Format: date-time */
1610
+ created_at: string;
1594
1611
  /** Format: date-time */
1595
1612
  updated_at: string;
1596
1613
  }
1597
1614
 
1598
- export type PublicationResponse = Publication & {
1599
- /** Format: date-time */
1600
- created_at: string;
1601
- } & ResponseMetadata;
1615
+ export type PublicationResponse = Publication & ResponseMetadata;
1602
1616
 
1603
1617
  /** Response shape for PublicationResponse. */
1604
- export type PublicationResponseRead = PublicationRead & {
1605
- /** Format: date-time */
1606
- created_at: string;
1607
- } & ResponseMetadata;
1608
-
1609
- export type TargetDraftSelection = {
1610
- mode: "automatic";
1611
- }
1612
- | {
1613
- mode: "exact";
1614
- version: string;
1615
- /** Where the selection was made. */
1616
- source: "console" | "api" | "github" | null;
1617
- };
1618
-
1619
- /** Response shape for TargetDraftSelection. */
1620
- export type TargetDraftSelectionRead = {
1621
- mode: "automatic" | (string & {});
1622
- }
1623
- | {
1624
- mode: "exact" | (string & {});
1625
- version: string;
1626
- /** Where the selection was made. */
1627
- source: ("console" | "api" | "github" | null) | (string & {}) | null;
1628
- };
1618
+ export type PublicationResponseRead = PublicationRead & ResponseMetadata;
1629
1619
 
1630
1620
  /**
1631
- * The Draft's state and its one next step. no_draft: no Draft is open; generate the Target.
1632
- * generating: Typeship is updating the Draft branch; retrieve the Draft again. branch_changed: the
1633
- * Draft branch has a commit Typeship has not integrated, such as your push or a discard; Typeship
1634
- * starts that integration from the repository event, so retrieve the Draft again, and generate the
1635
- * Target only if the status persists. conflicted: some conflicts have no decision; list files with
1636
- * filter=conflicted and resolve them. needs_generation: saved conflict decisions, an approved
1637
- * history recovery, or a settings change are not applied yet; generate the Target.
1638
- * history_rewritten: the default branch no longer contains the accepted package; review files with
1639
- * filter=history and approve history recovery. checking: package checks are running on
1640
- * head_revision; retrieve the Draft again. failed: readiness failed or could not be assessed;
1641
- * inspect readiness and checks, fix the package or pull request, and push to the Draft. ready:
1642
- * every required check passed on head_revision; merge the pull request.
1621
+ * none: the open Draft has no pending change; generate the Target to start one. working: Typeship
1622
+ * is generating, carrying repository edits forward, applying decisions, or checking the Draft;
1623
+ * retrieve it again. action_required: use the typed reason to find the customer's next action.
1624
+ * ready: required checks passed on head_sha; merge the pull request. merged: the pull request
1625
+ * merged and the Draft is final; retrieve the Target for the draft_id of its next Draft.
1643
1626
  */
1644
1627
  export const DraftStatus = {
1645
- NO_DRAFT: "no_draft",
1646
- GENERATING: "generating",
1647
- BRANCH_CHANGED: "branch_changed",
1648
- CONFLICTED: "conflicted",
1649
- NEEDS_GENERATION: "needs_generation",
1650
- HISTORY_REWRITTEN: "history_rewritten",
1651
- CHECKING: "checking",
1652
- FAILED: "failed",
1628
+ NONE: "none",
1629
+ WORKING: "working",
1630
+ ACTION_REQUIRED: "action_required",
1653
1631
  READY: "ready",
1632
+ MERGED: "merged",
1654
1633
  } as const;
1655
1634
  export type DraftStatus = (typeof DraftStatus)[keyof typeof DraftStatus];
1656
1635
 
1657
- export interface TargetDraftConflicts {
1636
+ /**
1637
+ * conflict: resolve the listed files. checks_failed: correct failed package checks. review_failed:
1638
+ * correct the Draft title, version, or other readiness finding. checks_unavailable: restore a
1639
+ * required check. history_rewritten: review the affected files and approve recovery.
1640
+ */
1641
+ export const DraftActionReason = {
1642
+ CONFLICT: "conflict",
1643
+ CHECKS_FAILED: "checks_failed",
1644
+ REVIEW_FAILED: "review_failed",
1645
+ CHECKS_UNAVAILABLE: "checks_unavailable",
1646
+ HISTORY_REWRITTEN: "history_rewritten",
1647
+ } as const;
1648
+ export type DraftActionReason = (typeof DraftActionReason)[keyof typeof DraftActionReason];
1649
+
1650
+ export interface DraftConflicts {
1658
1651
  /** Conflicts in the current merge stage. */
1659
1652
  total: number;
1660
- /** Conflicts with a saved decision for head_revision. */
1653
+ /** Conflicts with a saved decision for head_sha. */
1661
1654
  decided: number;
1662
1655
  }
1663
1656
 
1664
1657
  /** The approval inputs for a default-branch history rewrite. */
1665
- export interface TargetDraftHistoryRecovery {
1666
- /** Rewritten default-branch commit. Send it as expected_default_revision. */
1667
- default_revision: string;
1668
- /** Draft commit Typeship last observed. Send it as expected_head_revision. */
1669
- head_revision: string | null;
1658
+ export interface DraftHistoryRecovery {
1659
+ /** Rewritten default-branch commit. Send it as expected_default_sha. */
1660
+ default_sha: string;
1661
+ /** Draft commit Typeship last observed. Send it as expected_head_sha. */
1662
+ head_sha: string | null;
1670
1663
  /** Existing Draft branch that stays available after recovery opens a new Draft. */
1671
1664
  preserved_branch: string | null;
1672
1665
  }
1673
1666
 
1674
1667
  /**
1675
- * Readiness decision for the Draft's head_revision. Null readiness on the Draft means no candidate
1676
- * exists.
1668
+ * Readiness decision for the Draft's head_sha. Null readiness on the Draft means no Draft has been
1669
+ * generated.
1677
1670
  */
1678
- export interface TargetDraftReadiness {
1671
+ export interface DraftReadiness {
1679
1672
  /**
1680
1673
  * success means required checks passed; failure means the Draft needs correction or review; error
1681
1674
  * means assessment could not finish; pending means checks have not finished.
1682
1675
  */
1683
- state: "success" | "failure" | "error" | "pending";
1676
+ status: "success" | "failure" | "error" | "pending";
1684
1677
  /** Human-readable explanation of the current decision. Do not parse it for control flow. */
1685
1678
  description: string;
1686
- /** API surface comparison against Current. unknown means analysis is unavailable. */
1687
- api_compatibility: "compatible" | "breaking" | "unknown";
1679
+ /** API surface comparison against the latest release. unknown means analysis is unavailable. */
1680
+ compatibility_api: "compatible" | "breaking" | "unknown";
1688
1681
  /**
1689
- * Package and supported SDK source comparison against Current. unknown means analysis is
1690
- * incomplete or unavailable.
1682
+ * Package and supported SDK source comparison against the latest release. unknown means analysis
1683
+ * is incomplete or unavailable.
1691
1684
  */
1692
- package_compatibility: "compatible" | "breaking" | "unknown";
1685
+ compatibility_package: "compatible" | "breaking" | "unknown";
1693
1686
  /** Whether the version satisfies the assessed change. Null when no verdict is available. */
1694
1687
  version_correct: boolean | null;
1695
- /** Minimum assessed version bump. Null when no bump has been determined. */
1696
- required_bump: "major" | "minor" | "patch" | null;
1697
- /** Version used for the comparison. Null when no comparison version is available. */
1698
- previous_version: string | null;
1688
+ /**
1689
+ * Minimum assessed version bump. Approval never waives an insufficient bump. Null when no bump
1690
+ * has been determined.
1691
+ */
1692
+ bump_required: "major" | "minor" | "patch" | null;
1693
+ /** Latest release version used for the comparison. Null before the first release. */
1694
+ version_previous: string | null;
1699
1695
  /** Draft title error that must be corrected before release. Null when none is recorded. */
1700
1696
  title_error: string | null;
1701
1697
  }
1702
1698
 
1703
- /** Response shape for TargetDraftReadiness. */
1704
- export interface TargetDraftReadinessRead {
1699
+ /** Response shape for DraftReadiness. */
1700
+ export interface DraftReadinessRead {
1705
1701
  /**
1706
1702
  * success means required checks passed; failure means the Draft needs correction or review; error
1707
1703
  * means assessment could not finish; pending means checks have not finished.
1708
1704
  */
1709
- state: ("success" | "failure" | "error" | "pending") | (string & {});
1705
+ status: ("success" | "failure" | "error" | "pending") | (string & {});
1710
1706
  /** Human-readable explanation of the current decision. Do not parse it for control flow. */
1711
1707
  description: string;
1712
- /** API surface comparison against Current. unknown means analysis is unavailable. */
1713
- api_compatibility: ("compatible" | "breaking" | "unknown") | (string & {});
1708
+ /** API surface comparison against the latest release. unknown means analysis is unavailable. */
1709
+ compatibility_api: ("compatible" | "breaking" | "unknown") | (string & {});
1714
1710
  /**
1715
- * Package and supported SDK source comparison against Current. unknown means analysis is
1716
- * incomplete or unavailable.
1711
+ * Package and supported SDK source comparison against the latest release. unknown means analysis
1712
+ * is incomplete or unavailable.
1717
1713
  */
1718
- package_compatibility: ("compatible" | "breaking" | "unknown") | (string & {});
1714
+ compatibility_package: ("compatible" | "breaking" | "unknown") | (string & {});
1719
1715
  /** Whether the version satisfies the assessed change. Null when no verdict is available. */
1720
1716
  version_correct: boolean | null;
1721
- /** Minimum assessed version bump. Null when no bump has been determined. */
1722
- required_bump: ("major" | "minor" | "patch" | null) | (string & {}) | null;
1723
- /** Version used for the comparison. Null when no comparison version is available. */
1724
- previous_version: string | null;
1717
+ /**
1718
+ * Minimum assessed version bump. Approval never waives an insufficient bump. Null when no bump
1719
+ * has been determined.
1720
+ */
1721
+ bump_required: ("major" | "minor" | "patch" | null) | (string & {}) | null;
1722
+ /** Latest release version used for the comparison. Null before the first release. */
1723
+ version_previous: string | null;
1725
1724
  /** Draft title error that must be corrected before release. Null when none is recorded. */
1726
1725
  title_error: string | null;
1727
1726
  }
1728
1727
 
1729
- export interface TargetDraft {
1730
- object: "target_draft";
1728
+ /**
1729
+ * One reviewed package change for a Target. A Target has one open Draft, named by its draft_id;
1730
+ * when the pull request merges, the Draft becomes merged and final, and the Target opens a new
1731
+ * Draft with a new ID.
1732
+ */
1733
+ export interface Draft {
1734
+ id: DraftId;
1735
+ object: "draft";
1731
1736
  target_id: TargetId;
1732
1737
  project_id: ProjectId;
1733
1738
  status: DraftStatus;
1734
- current_version: string | null;
1735
- version: string | null;
1736
- selection: TargetDraftSelection;
1737
- readiness: TargetDraftReadiness | null;
1739
+ /** Present and required when status is action_required; absent otherwise. */
1740
+ reason?: DraftActionReason;
1741
+ /** Next version for this Draft, or null before a version is selected. */
1742
+ version_next: string | null;
1743
+ /** Where version_next was selected; null once the Draft merged. */
1744
+ version_source: "automatic" | "console" | "api" | "github" | null;
1745
+ readiness: DraftReadiness | null;
1738
1746
  changes: {
1739
- /** Cumulative changelog against Current. */
1747
+ /** Cumulative changelog against the latest release. */
1740
1748
  changelog?: string | null;
1741
1749
  breaking_count?: number | null;
1742
- previous_version?: string | null;
1750
+ version_previous?: string | null;
1743
1751
  }
1744
1752
  | null;
1745
1753
  /**
1746
- * Draft commit that readiness, checks, and conflicts describe. Send it as expected_head_revision
1747
- * when resolving or discarding.
1754
+ * Draft commit that readiness, checks, and conflicts describe. Send it as expected_head_sha when
1755
+ * resolving or discarding.
1748
1756
  */
1749
- head_revision: string | null;
1750
- /** Format: uri */
1751
- pull_request_url: string | null;
1757
+ head_sha: string | null;
1758
+ /** The Draft pull request in the destination repository, or null before one is opened. */
1759
+ pull_request: {
1760
+ /** Format: uri */
1761
+ url: string;
1762
+ number: number;
1763
+ } | null;
1752
1764
  /** Generation whose package this Draft contains. */
1753
1765
  generation_id: GenerationId | null;
1766
+ /**
1767
+ * Release this Draft created when it merged; null while open, or when a merge changed only tests
1768
+ * or checks.
1769
+ */
1770
+ release_id: ReleaseId | null;
1771
+ /**
1772
+ * When the Draft opened.
1773
+ * Format: date-time
1774
+ */
1775
+ created_at: string;
1776
+ /** Format: date-time */
1777
+ updated_at: string;
1754
1778
  /** Conflict counts for the current merge stage; null when the Draft has no conflicts. */
1755
- conflicts: TargetDraftConflicts | null;
1779
+ conflicts: DraftConflicts | null;
1756
1780
  /**
1757
1781
  * Files where the Draft differs from the last accepted package; null until the Draft is
1758
1782
  * integrated.
1759
1783
  */
1760
1784
  customized_files: number | null;
1761
- /** Present only while status is history_rewritten. */
1762
- history_recovery: TargetDraftHistoryRecovery | null;
1785
+ /** Present only while status is action_required and reason is history_rewritten. */
1786
+ history_recovery: DraftHistoryRecovery | null;
1763
1787
  request_id?: RequestId;
1764
1788
  checks: PackageCheck[];
1765
1789
  }
1766
1790
 
1767
- /** Response shape for TargetDraft. */
1768
- export interface TargetDraftRead {
1769
- object: "target_draft" | (string & {});
1791
+ /** Response shape for Draft. */
1792
+ export interface DraftRead {
1793
+ id: DraftId;
1794
+ object: "draft" | (string & {});
1770
1795
  target_id: TargetId;
1771
1796
  project_id: ProjectId;
1772
1797
  status: DraftStatus | (string & {});
1773
- current_version: string | null;
1774
- version: string | null;
1775
- selection: TargetDraftSelectionRead;
1776
- readiness: TargetDraftReadinessRead | null;
1798
+ /** Present and required when status is action_required; absent otherwise. */
1799
+ reason?: DraftActionReason | (string & {});
1800
+ /** Next version for this Draft, or null before a version is selected. */
1801
+ version_next: string | null;
1802
+ /** Where version_next was selected; null once the Draft merged. */
1803
+ version_source: ("automatic" | "console" | "api" | "github" | null) | (string & {}) | null;
1804
+ readiness: DraftReadinessRead | null;
1777
1805
  changes: {
1778
- /** Cumulative changelog against Current. */
1806
+ /** Cumulative changelog against the latest release. */
1779
1807
  changelog?: string | null;
1780
1808
  breaking_count?: number | null;
1781
- previous_version?: string | null;
1809
+ version_previous?: string | null;
1782
1810
  }
1783
1811
  | null;
1784
1812
  /**
1785
- * Draft commit that readiness, checks, and conflicts describe. Send it as expected_head_revision
1786
- * when resolving or discarding.
1813
+ * Draft commit that readiness, checks, and conflicts describe. Send it as expected_head_sha when
1814
+ * resolving or discarding.
1787
1815
  */
1788
- head_revision: string | null;
1789
- /** Format: uri */
1790
- pull_request_url: string | null;
1816
+ head_sha: string | null;
1817
+ /** The Draft pull request in the destination repository, or null before one is opened. */
1818
+ pull_request: {
1819
+ /** Format: uri */
1820
+ url: string;
1821
+ number: number;
1822
+ } | null;
1791
1823
  /** Generation whose package this Draft contains. */
1792
1824
  generation_id: GenerationId | null;
1825
+ /**
1826
+ * Release this Draft created when it merged; null while open, or when a merge changed only tests
1827
+ * or checks.
1828
+ */
1829
+ release_id: ReleaseId | null;
1830
+ /**
1831
+ * When the Draft opened.
1832
+ * Format: date-time
1833
+ */
1834
+ created_at: string;
1835
+ /** Format: date-time */
1836
+ updated_at: string;
1793
1837
  /** Conflict counts for the current merge stage; null when the Draft has no conflicts. */
1794
- conflicts: TargetDraftConflicts | null;
1838
+ conflicts: DraftConflicts | null;
1795
1839
  /**
1796
1840
  * Files where the Draft differs from the last accepted package; null until the Draft is
1797
1841
  * integrated.
1798
1842
  */
1799
1843
  customized_files: number | null;
1800
- /** Present only while status is history_rewritten. */
1801
- history_recovery: TargetDraftHistoryRecovery | null;
1844
+ /** Present only while status is action_required and reason is history_rewritten. */
1845
+ history_recovery: DraftHistoryRecovery | null;
1802
1846
  request_id?: RequestId;
1803
1847
  checks: PackageCheckRead[];
1804
1848
  }
1805
1849
 
1806
- export type TargetDraftResponse = TargetDraft & ResponseMetadata;
1850
+ export type DraftResponse = Draft & ResponseMetadata;
1807
1851
 
1808
- /** Response shape for TargetDraftResponse. */
1809
- export type TargetDraftResponseRead = TargetDraftRead & ResponseMetadata;
1852
+ /** Response shape for DraftResponse. */
1853
+ export type DraftResponseRead = DraftRead & ResponseMetadata;
1810
1854
 
1811
- export interface TargetDraftUpdate {
1855
+ export interface DraftUpdateRequest {
1812
1856
  /** Exact SemVer, or null to return to automatic selection. */
1813
- version: string | null;
1857
+ version_next: string | null;
1814
1858
  }
1815
1859
 
1816
1860
  export interface PackageCheck {
1817
1861
  name: string;
1818
1862
  source: "typeship" | "customer" | "repository" | "compatibility";
1819
1863
  required: boolean;
1820
- state: "pending" | "passed" | "failed" | "not_assessed";
1864
+ status: "pending" | "passed" | "failed" | "not_assessed";
1821
1865
  reason: string;
1822
- revision: string;
1866
+ commit_sha: string;
1823
1867
  /** Format: uri */
1824
1868
  url: string | null;
1825
1869
  /** Format: date-time */
@@ -1831,170 +1875,70 @@ export interface PackageCheckRead {
1831
1875
  name: string;
1832
1876
  source: ("typeship" | "customer" | "repository" | "compatibility") | (string & {});
1833
1877
  required: boolean;
1834
- state: ("pending" | "passed" | "failed" | "not_assessed") | (string & {});
1878
+ status: ("pending" | "passed" | "failed" | "not_assessed") | (string & {});
1835
1879
  reason: string;
1836
- revision: string;
1880
+ commit_sha: string;
1837
1881
  /** Format: uri */
1838
1882
  url: string | null;
1839
1883
  /** Format: date-time */
1840
1884
  observed_at: string | null;
1841
1885
  }
1842
1886
 
1843
- export interface AcceptedCompatibilityRisk {
1844
- comparison: "current" | "published";
1887
+ export interface CompatibilityApproval {
1888
+ source: "source_pr" | "draft_pr";
1845
1889
  reason: string;
1846
1890
  approved_by: string;
1847
- approved_revision: string;
1891
+ approved_sha: string;
1848
1892
  /** Format: date-time */
1849
1893
  approved_at: string;
1850
1894
  }
1851
1895
 
1852
- /** Response shape for AcceptedCompatibilityRisk. */
1853
- export interface AcceptedCompatibilityRiskRead {
1854
- comparison: ("current" | "published") | (string & {});
1896
+ /** Response shape for CompatibilityApproval. */
1897
+ export interface CompatibilityApprovalRead {
1898
+ source: ("source_pr" | "draft_pr") | (string & {});
1855
1899
  reason: string;
1856
1900
  approved_by: string;
1857
- approved_revision: string;
1901
+ approved_sha: string;
1858
1902
  /** Format: date-time */
1859
1903
  approved_at: string;
1860
1904
  }
1861
1905
 
1862
1906
  export interface TargetAdoption {
1863
- /** Exact already-published package version to make Current. */
1907
+ /** Exact already-published package version to make the latest release. */
1864
1908
  version: string;
1865
1909
  /** Immutable repository tag containing the matching package source. */
1866
1910
  tag: string;
1867
1911
  }
1868
1912
 
1869
- export interface RepositoryHealthIssue {
1870
- code: "connection_missing"
1871
- | "definition_unreadable"
1872
- | "contents_write_missing"
1873
- | "review_write_missing"
1874
- | "breaking_acknowledgement_missing"
1875
- | "provider_unavailable";
1876
- message: string;
1877
- }
1878
-
1879
- /** Response shape for RepositoryHealthIssue. */
1880
- export interface RepositoryHealthIssueRead {
1881
- code: ("connection_missing"
1882
- | "definition_unreadable"
1883
- | "contents_write_missing"
1884
- | "review_write_missing"
1885
- | "breaking_acknowledgement_missing"
1886
- | "provider_unavailable") | (string & {});
1887
- message: string;
1888
- }
1889
-
1890
- export interface RepositoryHealth {
1891
- repository: RepositoryReferenceResponse;
1892
- roles: Array<"source" | "destination">;
1893
- status: "ready" | "action_required";
1894
- default_branch?: string;
1895
- capabilities?: string[];
1896
- /**
1897
- * Whether a source repository has the optional typeship:breaking-approved policy label. Null when
1898
- * the repository is not a source or labels could not be read.
1899
- */
1900
- breaking_acknowledgement?: boolean | null;
1901
- definition?: "readable" | "missing";
1902
- issues: RepositoryHealthIssue[];
1903
- }
1904
-
1905
- /** Response shape for RepositoryHealth. */
1906
- export interface RepositoryHealthRead {
1907
- repository: RepositoryReferenceResponseRead;
1908
- roles: Array<("source" | "destination") | (string & {})>;
1909
- status: ("ready" | "action_required") | (string & {});
1910
- default_branch?: string;
1911
- capabilities?: string[];
1912
- /**
1913
- * Whether a source repository has the optional typeship:breaking-approved policy label. Null when
1914
- * the repository is not a source or labels could not be read.
1915
- */
1916
- breaking_acknowledgement?: boolean | null;
1917
- definition?: ("readable" | "missing") | (string & {});
1918
- issues: RepositoryHealthIssueRead[];
1919
- }
1920
-
1921
- export interface RepositoryEventHealth {
1922
- provider: string;
1923
- id: string;
1924
- event: string;
1925
- status: "queued" | "processing" | "succeeded" | "failed" | "superseded";
1926
- error: string | null;
1927
- /** Format: date-time */
1928
- created_at: string;
1929
- }
1930
-
1931
- /** Response shape for RepositoryEventHealth. */
1932
- export interface RepositoryEventHealthRead {
1933
- provider: string;
1934
- id: string;
1935
- event: string;
1936
- status: ("queued" | "processing" | "succeeded" | "failed" | "superseded") | (string & {});
1937
- error: string | null;
1938
- /** Format: date-time */
1939
- created_at: string;
1940
- }
1941
-
1942
- export interface RepositoryIntegrationHealth {
1943
- object: "repository_integration_health";
1944
- project_id: ProjectId;
1945
- status: "ready" | "action_required";
1946
- repositories: RepositoryHealth[];
1947
- required_checks: {
1948
- source: string[];
1949
- destination: string[];
1950
- };
1951
- last_event: RepositoryEventHealth | null;
1952
- request_id: RequestId;
1953
- }
1954
-
1955
- /** Response shape for RepositoryIntegrationHealth. */
1956
- export interface RepositoryIntegrationHealthRead {
1957
- object: "repository_integration_health" | (string & {});
1958
- project_id: ProjectId;
1959
- status: ("ready" | "action_required") | (string & {});
1960
- repositories: RepositoryHealthRead[];
1961
- required_checks: {
1962
- source: string[];
1963
- destination: string[];
1964
- };
1965
- last_event: RepositoryEventHealthRead | null;
1966
- request_id: RequestId;
1967
- }
1968
-
1969
- export interface DefinitionFields {
1970
- source: DefinitionSourceInput;
1913
+ export interface SpecFields {
1914
+ source: SpecSourceInput;
1971
1915
  /** Default: [] */
1972
- patches?: DefinitionPatch[];
1916
+ patches?: SpecPatch[];
1973
1917
  /** GraphQL-only endpoint, auth, environment, title, and scalar settings. */
1974
1918
  graphql?: GraphqlSettings | null;
1975
1919
  diagnostic_policy?: DiagnosticPolicy;
1976
1920
  }
1977
1921
 
1978
- /** Response shape for DefinitionFields. */
1979
- export interface DefinitionFieldsRead {
1980
- source: DefinitionSourceInputRead;
1922
+ /** Response shape for SpecFields. */
1923
+ export interface SpecFieldsRead {
1924
+ source: SpecSourceInputRead;
1981
1925
  /** Default: [] */
1982
- patches?: DefinitionPatchRead[];
1926
+ patches?: SpecPatchRead[];
1983
1927
  /** GraphQL-only endpoint, auth, environment, title, and scalar settings. */
1984
1928
  graphql?: GraphqlSettingsRead | null;
1985
1929
  diagnostic_policy?: DiagnosticPolicyRead;
1986
1930
  }
1987
1931
 
1988
- export interface Definition {
1989
- id: DefinitionId;
1990
- object: "definition";
1932
+ export interface Spec {
1933
+ id: SpecId;
1934
+ object: "spec";
1991
1935
  project_id: ProjectId;
1992
- source: DefinitionSource;
1936
+ source: SpecSource;
1993
1937
  format: "openapi" | "graphql" | null;
1994
- patches: DefinitionPatchResponse[];
1938
+ patches: SpecPatchResponse[];
1995
1939
  graphql: GraphqlSettingsResponse | null;
1996
1940
  diagnostic_policy: DiagnosticPolicyResponse;
1997
- latest_revision_id: DefinitionRevisionId | null;
1941
+ revision_latest_id: SpecRevisionId | null;
1998
1942
  /** Format: date-time */
1999
1943
  created_at: string;
2000
1944
  /** Format: date-time */
@@ -2002,17 +1946,17 @@ export interface Definition {
2002
1946
  request_id: RequestId;
2003
1947
  }
2004
1948
 
2005
- /** Request shape for Definition. */
2006
- export interface DefinitionWrite {
2007
- id: DefinitionId;
2008
- object: "definition";
1949
+ /** Request shape for Spec. */
1950
+ export interface SpecWrite {
1951
+ id: SpecId;
1952
+ object: "spec";
2009
1953
  project_id: ProjectId;
2010
- source: DefinitionSourceWrite;
1954
+ source: SpecSourceWrite;
2011
1955
  format: "openapi" | "graphql" | null;
2012
- patches: DefinitionPatchResponse[];
1956
+ patches: SpecPatchResponse[];
2013
1957
  graphql: GraphqlSettingsResponse | null;
2014
1958
  diagnostic_policy: DiagnosticPolicyResponse;
2015
- latest_revision_id: DefinitionRevisionId | null;
1959
+ revision_latest_id: SpecRevisionId | null;
2016
1960
  /** Format: date-time */
2017
1961
  created_at: string;
2018
1962
  /** Format: date-time */
@@ -2020,17 +1964,17 @@ export interface DefinitionWrite {
2020
1964
  request_id: RequestId;
2021
1965
  }
2022
1966
 
2023
- /** Response shape for Definition. */
2024
- export interface DefinitionRead {
2025
- id: DefinitionId;
2026
- object: "definition" | (string & {});
1967
+ /** Response shape for Spec. */
1968
+ export interface SpecRead {
1969
+ id: SpecId;
1970
+ object: "spec" | (string & {});
2027
1971
  project_id: ProjectId;
2028
- source: DefinitionSourceRead;
1972
+ source: SpecSourceRead;
2029
1973
  format: ("openapi" | "graphql" | null) | (string & {}) | null;
2030
- patches: DefinitionPatchResponseRead[];
1974
+ patches: SpecPatchResponseRead[];
2031
1975
  graphql: GraphqlSettingsResponseRead | null;
2032
1976
  diagnostic_policy: DiagnosticPolicyResponseRead;
2033
- latest_revision_id: DefinitionRevisionId | null;
1977
+ revision_latest_id: SpecRevisionId | null;
2034
1978
  /** Format: date-time */
2035
1979
  created_at: string;
2036
1980
  /** Format: date-time */
@@ -2043,21 +1987,21 @@ export interface DefinitionRead {
2043
1987
  * headers are preserved when the URL is unchanged and headers are omitted; null or empty headers
2044
1988
  * clear them.
2045
1989
  */
2046
- export interface DefinitionUpdateRequest {
2047
- source?: DefinitionSourceInput;
1990
+ export interface SpecUpdateRequest {
1991
+ source?: SpecSourceInput;
2048
1992
  /** Replace all patches in order. An empty array removes every patch; null is invalid. */
2049
- patches?: DefinitionPatch[];
1993
+ patches?: SpecPatch[];
2050
1994
  /** Replace all GraphQL settings. Null or an empty object clears them. */
2051
1995
  graphql?: GraphqlSettings | null;
2052
1996
  /** Replace the complete policy and suppression list. Null and an empty object are invalid. */
2053
1997
  diagnostic_policy?: DiagnosticPolicy;
2054
1998
  }
2055
1999
 
2056
- /** Response shape for DefinitionUpdateRequest. */
2057
- export interface DefinitionUpdateRequestRead {
2058
- source?: DefinitionSourceInputRead;
2000
+ /** Response shape for SpecUpdateRequest. */
2001
+ export interface SpecUpdateRequestRead {
2002
+ source?: SpecSourceInputRead;
2059
2003
  /** Replace all patches in order. An empty array removes every patch; null is invalid. */
2060
- patches?: DefinitionPatchRead[];
2004
+ patches?: SpecPatchRead[];
2061
2005
  /** Replace all GraphQL settings. Null or an empty object clears them. */
2062
2006
  graphql?: GraphqlSettingsRead | null;
2063
2007
  /** Replace the complete policy and suppression list. Null and an empty object are invalid. */
@@ -2065,29 +2009,22 @@ export interface DefinitionUpdateRequestRead {
2065
2009
  }
2066
2010
 
2067
2011
  /**
2068
- * Project-owned identity, Definition reference, generation controls, and shared configuration.
2069
- * Targets and Deliveries are available only through their canonical Target endpoints.
2012
+ * Project-owned identity, Spec reference, generation controls, and shared configuration. Targets
2013
+ * and Deliveries are available only through their canonical Target endpoints.
2070
2014
  */
2071
2015
  export interface Project {
2072
2016
  id: ProjectId;
2073
2017
  object: "project";
2074
2018
  name: string;
2075
- definition_id: DefinitionId;
2019
+ spec_id: SpecId;
2076
2020
  /**
2077
- * Regenerate when the Definition changes: on every push to the default branch for a repository
2078
- * source, every 30 minutes for a URL source. Off by default: the first generation is always one
2079
- * you asked for. Off means only "generate now" and POST /projects/{project_id}/generations
2080
- * regenerate.
2021
+ * Regenerate when the Spec or saved configuration changes. Enabled by default for new Projects.
2022
+ * Set false to generate only when requested.
2081
2023
  */
2082
2024
  auto_generate: boolean;
2083
- /**
2084
- * Whether the webhook relay is on, letting the generated CLI's webhooks listen command mint relay
2085
- * sessions. Requires the cli target and Pro; turning the target off turns this off.
2086
- */
2087
- relay_enabled: boolean;
2088
2025
  /**
2089
2026
  * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
2090
- * settings remain Definition-owned.
2027
+ * settings remain Spec-owned.
2091
2028
  */
2092
2029
  config: ProjectConfigResponse | null;
2093
2030
  /** Format: date-time */
@@ -2103,22 +2040,15 @@ export interface Project {
2103
2040
  /** Request shape for Project. */
2104
2041
  export interface ProjectWrite {
2105
2042
  name: string;
2106
- definition_id: DefinitionId;
2043
+ spec_id: SpecId;
2107
2044
  /**
2108
- * Regenerate when the Definition changes: on every push to the default branch for a repository
2109
- * source, every 30 minutes for a URL source. Off by default: the first generation is always one
2110
- * you asked for. Off means only "generate now" and POST /projects/{project_id}/generations
2111
- * regenerate.
2045
+ * Regenerate when the Spec or saved configuration changes. Enabled by default for new Projects.
2046
+ * Set false to generate only when requested.
2112
2047
  */
2113
2048
  auto_generate: boolean;
2114
- /**
2115
- * Whether the webhook relay is on, letting the generated CLI's webhooks listen command mint relay
2116
- * sessions. Requires the cli target and Pro; turning the target off turns this off.
2117
- */
2118
- relay_enabled: boolean;
2119
2049
  /**
2120
2050
  * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
2121
- * settings remain Definition-owned.
2051
+ * settings remain Spec-owned.
2122
2052
  */
2123
2053
  config: ProjectConfigResponse | null;
2124
2054
  request_id: RequestId;
@@ -2129,22 +2059,15 @@ export interface ProjectRead {
2129
2059
  id: ProjectId;
2130
2060
  object: "project" | (string & {});
2131
2061
  name: string;
2132
- definition_id: DefinitionId;
2062
+ spec_id: SpecId;
2133
2063
  /**
2134
- * Regenerate when the Definition changes: on every push to the default branch for a repository
2135
- * source, every 30 minutes for a URL source. Off by default: the first generation is always one
2136
- * you asked for. Off means only "generate now" and POST /projects/{project_id}/generations
2137
- * regenerate.
2064
+ * Regenerate when the Spec or saved configuration changes. Enabled by default for new Projects.
2065
+ * Set false to generate only when requested.
2138
2066
  */
2139
2067
  auto_generate: boolean;
2140
- /**
2141
- * Whether the webhook relay is on, letting the generated CLI's webhooks listen command mint relay
2142
- * sessions. Requires the cli target and Pro; turning the target off turns this off.
2143
- */
2144
- relay_enabled: boolean;
2145
2068
  /**
2146
2069
  * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
2147
- * settings remain Definition-owned.
2070
+ * settings remain Spec-owned.
2148
2071
  */
2149
2072
  config: ProjectConfigResponseRead | null;
2150
2073
  /** Format: date-time */
@@ -2165,7 +2088,7 @@ export interface ProjectSummary {
2165
2088
  id: ProjectId;
2166
2089
  object: "project";
2167
2090
  name: string;
2168
- definition_id: DefinitionId;
2091
+ spec_id: SpecId;
2169
2092
  auto_generate: boolean;
2170
2093
  /** Format: date-time */
2171
2094
  created_at: string;
@@ -2178,7 +2101,7 @@ export interface ProjectSummaryRead {
2178
2101
  id: ProjectId;
2179
2102
  object: "project" | (string & {});
2180
2103
  name: string;
2181
- definition_id: DefinitionId;
2104
+ spec_id: SpecId;
2182
2105
  auto_generate: boolean;
2183
2106
  /** Format: date-time */
2184
2107
  created_at: string;
@@ -2188,54 +2111,44 @@ export interface ProjectSummaryRead {
2188
2111
 
2189
2112
  export interface CreateProjectRequest {
2190
2113
  name: string;
2191
- definition: DefinitionFields;
2114
+ spec: SpecFields;
2192
2115
  /**
2193
2116
  * Initial first-class Targets. More than one may use the same generator with different identities
2194
2117
  * or Deliveries.
2195
2118
  */
2196
2119
  targets: InitialTargetFields[];
2197
2120
  /**
2198
- * Whether Typeship should regenerate automatically when the source changes.
2199
- * Default: false
2121
+ * Whether Typeship should regenerate automatically when the source or saved configuration
2122
+ * changes.
2123
+ * Default: true
2200
2124
  */
2201
2125
  auto_generate?: boolean;
2202
- /**
2203
- * Enable webhook relay sessions. Requires the CLI target and Pro.
2204
- * Default: false
2205
- */
2206
- relay_enabled?: boolean;
2207
- /** Shared defaults inherited by every Target. GraphQL settings belong in definition.graphql. */
2126
+ /** Shared defaults inherited by every Target. GraphQL settings belong in spec.graphql. */
2208
2127
  config?: ProjectConfig | null;
2209
2128
  }
2210
2129
 
2211
2130
  /** Response shape for CreateProjectRequest. */
2212
2131
  export interface CreateProjectRequestRead {
2213
2132
  name: string;
2214
- definition: DefinitionFieldsRead;
2133
+ spec: SpecFieldsRead;
2215
2134
  /**
2216
2135
  * Initial first-class Targets. More than one may use the same generator with different identities
2217
2136
  * or Deliveries.
2218
2137
  */
2219
2138
  targets: InitialTargetFieldsRead[];
2220
2139
  /**
2221
- * Whether Typeship should regenerate automatically when the source changes.
2222
- * Default: false
2140
+ * Whether Typeship should regenerate automatically when the source or saved configuration
2141
+ * changes.
2142
+ * Default: true
2223
2143
  */
2224
2144
  auto_generate?: boolean;
2225
- /**
2226
- * Enable webhook relay sessions. Requires the CLI target and Pro.
2227
- * Default: false
2228
- */
2229
- relay_enabled?: boolean;
2230
- /** Shared defaults inherited by every Target. GraphQL settings belong in definition.graphql. */
2145
+ /** Shared defaults inherited by every Target. GraphQL settings belong in spec.graphql. */
2231
2146
  config?: ProjectConfigRead | null;
2232
2147
  }
2233
2148
 
2234
2149
  export interface UpdateProjectRequest {
2235
2150
  name?: string;
2236
2151
  auto_generate?: boolean;
2237
- /** Enable webhook relay sessions. Requires the CLI target and Pro. */
2238
- relay_enabled?: boolean;
2239
2152
  /** Replaces the Project's shared Target defaults. Send null to clear them. */
2240
2153
  config?: ProjectConfig | null;
2241
2154
  }
@@ -2244,8 +2157,6 @@ export interface UpdateProjectRequest {
2244
2157
  export interface UpdateProjectRequestRead {
2245
2158
  name?: string;
2246
2159
  auto_generate?: boolean;
2247
- /** Enable webhook relay sessions. Requires the CLI target and Pro. */
2248
- relay_enabled?: boolean;
2249
2160
  /** Replaces the Project's shared Target defaults. Send null to clear them. */
2250
2161
  config?: ProjectConfigRead | null;
2251
2162
  }
@@ -2254,26 +2165,45 @@ export interface UpdateProjectRequestRead {
2254
2165
  * The organization an API key belongs to. Members share its projects, keys, and plan; sign-in
2255
2166
  * identity is not part of the API.
2256
2167
  */
2257
- export interface Account {
2168
+ export interface Organization {
2169
+ /** Opaque, output-only organization identifier. Copy it unchanged; its format is not a contract. */
2258
2170
  id: string;
2259
- object: "account";
2171
+ object: "organization";
2172
+ /** The organization's display name. */
2173
+ name: string;
2174
+ plan: "free" | "pro" | "enterprise";
2175
+ /** Format: date-time */
2176
+ created_at: string;
2177
+ /** Format: date-time */
2178
+ updated_at: string;
2179
+ request_id: RequestId;
2180
+ }
2181
+
2182
+ /** Request shape for Organization. */
2183
+ export interface OrganizationWrite {
2184
+ object: "organization";
2260
2185
  /** The organization's display name. */
2261
2186
  name: string;
2262
2187
  plan: "free" | "pro" | "enterprise";
2263
2188
  /** Format: date-time */
2264
2189
  created_at: string;
2190
+ /** Format: date-time */
2191
+ updated_at: string;
2265
2192
  request_id: RequestId;
2266
2193
  }
2267
2194
 
2268
- /** Response shape for Account. */
2269
- export interface AccountRead {
2195
+ /** Response shape for Organization. */
2196
+ export interface OrganizationRead {
2197
+ /** Opaque, output-only organization identifier. Copy it unchanged; its format is not a contract. */
2270
2198
  id: string;
2271
- object: "account" | (string & {});
2199
+ object: "organization" | (string & {});
2272
2200
  /** The organization's display name. */
2273
2201
  name: string;
2274
2202
  plan: ("free" | "pro" | "enterprise") | (string & {});
2275
2203
  /** Format: date-time */
2276
2204
  created_at: string;
2205
+ /** Format: date-time */
2206
+ updated_at: string;
2277
2207
  request_id: RequestId;
2278
2208
  }
2279
2209
 
@@ -2456,6 +2386,40 @@ export interface CliBehavior {
2456
2386
  skills_repo?: string | null;
2457
2387
  }
2458
2388
 
2389
+ /** How the generated CLI behaves. Part of Config. */
2390
+ export interface TargetCliBehavior {
2391
+ /** Command users run, independent of how the CLI is distributed. */
2392
+ command_name?: string | null;
2393
+ /**
2394
+ * Opt in to a once-a-day registry check that prints an upgrade hint. Off by default; generated
2395
+ * code phones nobody unless this is enabled.
2396
+ */
2397
+ update_notice?: boolean;
2398
+ /**
2399
+ * Public HTTP(S) URL read by the optional changelog command in generated CLIs. Supports UTF-8
2400
+ * Markdown, plain text, and static HTML; embedded credentials are not allowed. Omit or clear to
2401
+ * disable, then regenerate.
2402
+ */
2403
+ changelog_url?: string | null;
2404
+ /**
2405
+ * Where the generated CLI's feedback command sends users. GitHub issues/new URLs get a prefilled
2406
+ * title and environment details.
2407
+ */
2408
+ support_url?: string | null;
2409
+ /**
2410
+ * Hosted MCP endpoint installed by the generated CLI instead of launching the package's local
2411
+ * stdio server.
2412
+ */
2413
+ mcp_url?: string | null;
2414
+ /** GitHub owner/name of the skills package the generated CLI offers to install during init. */
2415
+ skills_repo?: string | null;
2416
+ /**
2417
+ * Enable webhook relay sessions for this CLI Target. Requires Pro. Turning it off prevents new
2418
+ * sessions.
2419
+ */
2420
+ relay?: boolean;
2421
+ }
2422
+
2459
2423
  /** How generated MCP servers and the Typeship-hosted endpoint behave. Part of Config. */
2460
2424
  export interface McpBehavior {
2461
2425
  /** Stable official MCP registry name, independent of the server runtime. */
@@ -2613,11 +2577,10 @@ export interface PackageBehavior {
2613
2577
  }
2614
2578
 
2615
2579
  /**
2616
- * Everything Typeship needs beyond the Definition, in one object: generation customization
2617
- * (globals, retries, pagination, readme) and how the generated tooling behaves (cli, mcp, package,
2618
- * docs_url). Plain configuration. Typeship never requires vendor extensions inside the Definition
2619
- * itself. One-shot generation also accepts GraphQL settings here; stored projects keep those
2620
- * settings on their Definition.
2580
+ * Everything Typeship needs beyond the Spec, in one object: generation customization (globals,
2581
+ * retries, pagination, readme) and how the generated tooling behaves (cli, mcp, package, docs_url).
2582
+ * Plain configuration. Typeship never requires vendor extensions inside the Spec itself. One-shot
2583
+ * generation also accepts GraphQL settings here; stored projects keep those settings on their Spec.
2621
2584
  */
2622
2585
  export interface Config {
2623
2586
  /**
@@ -2640,8 +2603,8 @@ export interface Config {
2640
2603
  package?: PackageBehavior;
2641
2604
  /**
2642
2605
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2643
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2644
- * externalDocs URL.
2606
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Spec's externalDocs
2607
+ * URL.
2645
2608
  * Format: uri
2646
2609
  */
2647
2610
  docs_url?: string | null;
@@ -2674,8 +2637,8 @@ export interface ConfigRead {
2674
2637
  package?: PackageBehavior;
2675
2638
  /**
2676
2639
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2677
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2678
- * externalDocs URL.
2640
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Spec's externalDocs
2641
+ * URL.
2679
2642
  * Format: uri
2680
2643
  */
2681
2644
  docs_url?: string | null;
@@ -2690,7 +2653,7 @@ export interface ConfigRead {
2690
2653
  * Shared generated-client and tooling behavior for a stored Project. Every Target inherits these
2691
2654
  * defaults. Target.config is merged over them for one Target; top-level values replace defaults
2692
2655
  * while cli, mcp, auth, readme, and package merge by field. GraphQL-only source settings live on
2693
- * the Project's Definition and are rejected in both stored config scopes.
2656
+ * the Project's Spec and are rejected in both stored config scopes.
2694
2657
  */
2695
2658
  export interface ProjectConfig {
2696
2659
  /**
@@ -2712,8 +2675,8 @@ export interface ProjectConfig {
2712
2675
  package?: PackageBehavior;
2713
2676
  /**
2714
2677
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2715
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2716
- * externalDocs URL.
2678
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Spec's externalDocs
2679
+ * URL.
2717
2680
  * Format: uri
2718
2681
  */
2719
2682
  docs_url?: string | null;
@@ -2745,8 +2708,8 @@ export interface ProjectConfigRead {
2745
2708
  package?: PackageBehavior;
2746
2709
  /**
2747
2710
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2748
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2749
- * externalDocs URL.
2711
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Spec's externalDocs
2712
+ * URL.
2750
2713
  * Format: uri
2751
2714
  */
2752
2715
  docs_url?: string | null;
@@ -2776,14 +2739,14 @@ export interface TargetConfig {
2776
2739
  */
2777
2740
  pagination?: Record<string, PaginationRule | boolean>;
2778
2741
  auth?: TargetAuthenticationConfig;
2779
- cli?: CliBehavior;
2742
+ cli?: TargetCliBehavior;
2780
2743
  mcp?: McpBehavior;
2781
2744
  readme?: ReadmeBehavior;
2782
2745
  package?: PackageBehavior;
2783
2746
  /**
2784
2747
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2785
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2786
- * externalDocs URL.
2748
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Spec's externalDocs
2749
+ * URL.
2787
2750
  * Format: uri
2788
2751
  */
2789
2752
  docs_url?: string | null;
@@ -2809,14 +2772,14 @@ export interface TargetConfigRead {
2809
2772
  */
2810
2773
  pagination?: Record<string, PaginationRuleRead | boolean>;
2811
2774
  auth?: TargetAuthenticationConfig;
2812
- cli?: CliBehavior;
2775
+ cli?: TargetCliBehavior;
2813
2776
  mcp?: McpBehaviorRead;
2814
2777
  readme?: ReadmeBehavior;
2815
2778
  package?: PackageBehavior;
2816
2779
  /**
2817
2780
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2818
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2819
- * externalDocs URL.
2781
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Spec's externalDocs
2782
+ * URL.
2820
2783
  * Format: uri
2821
2784
  */
2822
2785
  docs_url?: string | null;
@@ -2928,7 +2891,7 @@ export interface RetryTuning {
2928
2891
 
2929
2892
  export interface PaginationRule {
2930
2893
  /** Default: "cursor" */
2931
- style?: "cursor" | "cursorFromLastId" | "page" | "offset";
2894
+ style?: "cursor" | "cursor_from_last_id" | "page" | "offset";
2932
2895
  /** Response field holding the item array. */
2933
2896
  items_field: string;
2934
2897
  cursor_param?: string;
@@ -2943,7 +2906,7 @@ export interface PaginationRule {
2943
2906
  /** Response shape for PaginationRule. */
2944
2907
  export interface PaginationRuleRead {
2945
2908
  /** Default: "cursor" */
2946
- style?: ("cursor" | "cursorFromLastId" | "page" | "offset") | (string & {});
2909
+ style?: ("cursor" | "cursor_from_last_id" | "page" | "offset") | (string & {});
2947
2910
  /** Response field holding the item array. */
2948
2911
  items_field: string;
2949
2912
  cursor_param?: string;
@@ -2969,208 +2932,124 @@ export interface FileStubRead {
2969
2932
  }
2970
2933
 
2971
2934
  /**
2972
- * A Generation moves from queued to running, then succeeds when its files are saved or fails.
2935
+ * A Generation moves from queued to running, then completes when its files are saved or fails.
2973
2936
  * Delivery and Draft status are separate.
2974
2937
  */
2975
2938
  export const GenerationStatus = {
2976
2939
  QUEUED: "queued",
2977
2940
  RUNNING: "running",
2978
- SUCCEEDED: "succeeded",
2941
+ COMPLETED: "completed",
2979
2942
  FAILED: "failed",
2980
2943
  } as const;
2981
2944
  export type GenerationStatus = (typeof GenerationStatus)[keyof typeof GenerationStatus];
2982
2945
 
2983
2946
  export const GenerationTrigger = {
2984
- MANUAL: "manual",
2985
- WEBHOOK: "webhook",
2986
- POLL: "poll",
2987
- PREVIEW: "preview",
2988
- } as const;
2989
- export type GenerationTrigger = (typeof GenerationTrigger)[keyof typeof GenerationTrigger];
2990
-
2991
- export interface GenerationProvenance {
2992
- /** Pinned generator contract edition. */
2993
- generator_edition: string;
2994
- /**
2995
- * Recorded configuration for this Generation in the public Config format, including inherited
2996
- * Project defaults and Target overrides. Later edits do not change it. Source credentials are
2997
- * never included. Null when no configuration was recorded.
2998
- */
2999
- resolved_config: ConfigResponse | null;
3000
- package_version: string | null;
3001
- }
3002
-
3003
- /** Response shape for GenerationProvenance. */
3004
- export interface GenerationProvenanceRead {
3005
- /** Pinned generator contract edition. */
3006
- generator_edition: string;
3007
- /**
3008
- * Recorded configuration for this Generation in the public Config format, including inherited
3009
- * Project defaults and Target overrides. Later edits do not change it. Source credentials are
3010
- * never included. Null when no configuration was recorded.
3011
- */
3012
- resolved_config: ConfigResponseRead | null;
3013
- package_version: string | null;
3014
- }
2947
+ MANUAL: "manual",
2948
+ SPEC_CHANGED: "spec_changed",
2949
+ CONFIG_CHANGED: "config_changed",
2950
+ PREVIEW: "preview",
2951
+ } as const;
2952
+ export type GenerationTrigger = (typeof GenerationTrigger)[keyof typeof GenerationTrigger];
3015
2953
 
3016
2954
  export interface Generation {
3017
2955
  id: GenerationId;
3018
2956
  object: "generation";
3019
- /**
3020
- * Present and true when the generated target was too large to inline; files_index lists paths,
3021
- * fetched one at a time via GET /generations/{generation_id}/file.
3022
- */
3023
- files_omitted?: boolean;
3024
- files_index?: FileStub[];
3025
2957
  project_id: ProjectId;
3026
- definition_revision_id: DefinitionRevisionId | null;
2958
+ spec_revision_id: SpecRevisionId | null;
3027
2959
  status: GenerationStatus;
3028
2960
  trigger: GenerationTrigger;
3029
- /** Persisted Target identity. Null only for one-shot generation. */
3030
2961
  target_id: TargetId | null;
3031
- /** Resolved generator implementation; provenance rather than resource identity. */
3032
- generator: GeneratorKind;
3033
- provenance: GenerationProvenance;
3034
- /** Null while queued or running, or when a failed or legacy generation produced no metadata. */
3035
- meta: GenerationMeta | null;
3036
- warnings: string[];
3037
- /** Present on retrieve and create; omitted in lists. */
3038
- files?: GeneratedFile[];
3039
- /** Recorded failures. Empty when this resource has no recorded failure. */
2962
+ type: GeneratorKind;
2963
+ /** Package name; null until known. */
2964
+ name: string | null;
2965
+ /** Package version; null until known. */
2966
+ version: string | null;
2967
+ warnings: GenerationWarning[];
2968
+ /** Operation coverage; null until generation has finished. */
2969
+ coverage: GenerationCoverage | null;
2970
+ /** Generated package files. List them with listGenerationFiles. */
2971
+ file_count: number;
3040
2972
  errors: DomainError[];
2973
+ /**
2974
+ * Milliseconds from the start of the run until it completed or failed; null while queued or
2975
+ * running.
2976
+ */
2977
+ runtime_ms: number | null;
3041
2978
  /** Format: date-time */
3042
2979
  created_at: string;
3043
- request_id?: RequestId;
2980
+ /** Format: date-time */
2981
+ updated_at: string;
3044
2982
  }
3045
2983
 
3046
2984
  /** Request shape for Generation. */
3047
2985
  export interface GenerationWrite {
3048
2986
  id: GenerationId;
3049
- /**
3050
- * Present and true when the generated target was too large to inline; files_index lists paths,
3051
- * fetched one at a time via GET /generations/{generation_id}/file.
3052
- */
3053
- files_omitted?: boolean;
3054
- files_index?: FileStub[];
3055
2987
  project_id: ProjectId;
3056
- definition_revision_id: DefinitionRevisionId | null;
2988
+ spec_revision_id: SpecRevisionId | null;
3057
2989
  status: GenerationStatus;
3058
2990
  trigger: GenerationTrigger;
3059
- /** Persisted Target identity. Null only for one-shot generation. */
3060
2991
  target_id: TargetId | null;
3061
- /** Resolved generator implementation; provenance rather than resource identity. */
3062
- generator: GeneratorKind;
3063
- provenance: GenerationProvenance;
3064
- /** Null while queued or running, or when a failed or legacy generation produced no metadata. */
3065
- meta: GenerationMeta | null;
3066
- warnings: string[];
3067
- /** Present on retrieve and create; omitted in lists. */
3068
- files?: GeneratedFile[];
3069
- /** Recorded failures. Empty when this resource has no recorded failure. */
2992
+ type: GeneratorKind;
2993
+ /** Package name; null until known. */
2994
+ name: string | null;
2995
+ /** Package version; null until known. */
2996
+ version: string | null;
2997
+ warnings: GenerationWarning[];
2998
+ /** Operation coverage; null until generation has finished. */
2999
+ coverage: GenerationCoverage | null;
3000
+ /** Generated package files. List them with listGenerationFiles. */
3001
+ file_count: number;
3070
3002
  errors: DomainError[];
3003
+ /**
3004
+ * Milliseconds from the start of the run until it completed or failed; null while queued or
3005
+ * running.
3006
+ */
3007
+ runtime_ms: number | null;
3071
3008
  /** Format: date-time */
3072
3009
  created_at: string;
3073
- request_id?: RequestId;
3010
+ /** Format: date-time */
3011
+ updated_at: string;
3074
3012
  }
3075
3013
 
3076
3014
  /** Response shape for Generation. */
3077
3015
  export interface GenerationRead {
3078
3016
  id: GenerationId;
3079
3017
  object: "generation" | (string & {});
3080
- /**
3081
- * Present and true when the generated target was too large to inline; files_index lists paths,
3082
- * fetched one at a time via GET /generations/{generation_id}/file.
3083
- */
3084
- files_omitted?: boolean;
3085
- files_index?: FileStubRead[];
3086
3018
  project_id: ProjectId;
3087
- definition_revision_id: DefinitionRevisionId | null;
3019
+ spec_revision_id: SpecRevisionId | null;
3088
3020
  status: GenerationStatus | (string & {});
3089
3021
  trigger: GenerationTrigger | (string & {});
3090
- /** Persisted Target identity. Null only for one-shot generation. */
3091
3022
  target_id: TargetId | null;
3092
- /** Resolved generator implementation; provenance rather than resource identity. */
3093
- generator: GeneratorKind | (string & {});
3094
- provenance: GenerationProvenanceRead;
3095
- /** Null while queued or running, or when a failed or legacy generation produced no metadata. */
3096
- meta: GenerationMetaRead | null;
3097
- warnings: string[];
3098
- /** Present on retrieve and create; omitted in lists. */
3099
- files?: GeneratedFileRead[];
3100
- /** Recorded failures. Empty when this resource has no recorded failure. */
3023
+ type: GeneratorKind | (string & {});
3024
+ /** Package name; null until known. */
3025
+ name: string | null;
3026
+ /** Package version; null until known. */
3027
+ version: string | null;
3028
+ warnings: GenerationWarning[];
3029
+ /** Operation coverage; null until generation has finished. */
3030
+ coverage: GenerationCoverageRead | null;
3031
+ /** Generated package files. List them with listGenerationFiles. */
3032
+ file_count: number;
3101
3033
  errors: DomainErrorRead[];
3034
+ /**
3035
+ * Milliseconds from the start of the run until it completed or failed; null while queued or
3036
+ * running.
3037
+ */
3038
+ runtime_ms: number | null;
3102
3039
  /** Format: date-time */
3103
3040
  created_at: string;
3104
- request_id?: RequestId;
3105
- }
3106
-
3107
- /**
3108
- * Generation metadata returned by collection endpoints. Generated file contents and file indexes
3109
- * are available only from retrieve and create operations.
3110
- */
3111
- export interface GenerationSummary {
3112
- id: GenerationId;
3113
- object: "generation";
3114
- project_id: ProjectId;
3115
- definition_revision_id: DefinitionRevisionId | null;
3116
- status: GenerationStatus;
3117
- trigger: GenerationTrigger;
3118
- /** Persisted Target identity. Null only for one-shot generation. */
3119
- target_id: TargetId | null;
3120
- /** Resolved generator implementation; provenance rather than resource identity. */
3121
- generator: GeneratorKind;
3122
- provenance: GenerationProvenance;
3123
- /** Null only for a failed or legacy generation that produced no metadata. */
3124
- meta: GenerationMeta | null;
3125
- warnings: string[];
3126
- /** Recorded failures. Empty when this resource has no recorded failure. */
3127
- errors: DomainError[];
3128
3041
  /** Format: date-time */
3129
- created_at: string;
3042
+ updated_at: string;
3130
3043
  }
3131
3044
 
3045
+ /** Generation metadata returned by collection endpoints. */
3046
+ export type GenerationSummary = Generation;
3047
+
3132
3048
  /** Request shape for GenerationSummary. */
3133
- export interface GenerationSummaryWrite {
3134
- id: GenerationId;
3135
- project_id: ProjectId;
3136
- definition_revision_id: DefinitionRevisionId | null;
3137
- status: GenerationStatus;
3138
- trigger: GenerationTrigger;
3139
- /** Persisted Target identity. Null only for one-shot generation. */
3140
- target_id: TargetId | null;
3141
- /** Resolved generator implementation; provenance rather than resource identity. */
3142
- generator: GeneratorKind;
3143
- provenance: GenerationProvenance;
3144
- /** Null only for a failed or legacy generation that produced no metadata. */
3145
- meta: GenerationMeta | null;
3146
- warnings: string[];
3147
- /** Recorded failures. Empty when this resource has no recorded failure. */
3148
- errors: DomainError[];
3149
- /** Format: date-time */
3150
- created_at: string;
3151
- }
3049
+ export type GenerationSummaryWrite = GenerationWrite;
3152
3050
 
3153
3051
  /** Response shape for GenerationSummary. */
3154
- export interface GenerationSummaryRead {
3155
- id: GenerationId;
3156
- object: "generation" | (string & {});
3157
- project_id: ProjectId;
3158
- definition_revision_id: DefinitionRevisionId | null;
3159
- status: GenerationStatus | (string & {});
3160
- trigger: GenerationTrigger | (string & {});
3161
- /** Persisted Target identity. Null only for one-shot generation. */
3162
- target_id: TargetId | null;
3163
- /** Resolved generator implementation; provenance rather than resource identity. */
3164
- generator: GeneratorKind | (string & {});
3165
- provenance: GenerationProvenanceRead;
3166
- /** Null only for a failed or legacy generation that produced no metadata. */
3167
- meta: GenerationMetaRead | null;
3168
- warnings: string[];
3169
- /** Recorded failures. Empty when this resource has no recorded failure. */
3170
- errors: DomainErrorRead[];
3171
- /** Format: date-time */
3172
- created_at: string;
3173
- }
3052
+ export type GenerationSummaryRead = GenerationRead;
3174
3053
 
3175
3054
  export type GenerationResponse = Generation & ResponseMetadata;
3176
3055
 
@@ -3183,7 +3062,7 @@ export type GenerationResponseRead = GenerationRead & ResponseMetadata;
3183
3062
  /** A selected target that did not generate in a multi-target run. */
3184
3063
  export interface GenerationFailure {
3185
3064
  target_id: TargetId;
3186
- generator: GeneratorKind;
3065
+ type: GeneratorKind;
3187
3066
  status: "failed";
3188
3067
  /** Recorded failures. Empty when this resource has no recorded failure. */
3189
3068
  errors: DomainError[];
@@ -3192,7 +3071,7 @@ export interface GenerationFailure {
3192
3071
  /** Response shape for GenerationFailure. */
3193
3072
  export interface GenerationFailureRead {
3194
3073
  target_id: TargetId;
3195
- generator: GeneratorKind | (string & {});
3074
+ type: GeneratorKind | (string & {});
3196
3075
  status: "failed" | (string & {});
3197
3076
  /** Recorded failures. Empty when this resource has no recorded failure. */
3198
3077
  errors: DomainErrorRead[];
@@ -3230,6 +3109,11 @@ export interface ApiKey {
3230
3109
  last_used_at: string | null;
3231
3110
  /** Format: date-time */
3232
3111
  created_at: string;
3112
+ /**
3113
+ * When the key last changed, such as its revocation.
3114
+ * Format: date-time
3115
+ */
3116
+ updated_at: string;
3233
3117
  request_id?: RequestId;
3234
3118
  }
3235
3119
 
@@ -3245,6 +3129,11 @@ export interface ApiKeyRead {
3245
3129
  last_used_at: string | null;
3246
3130
  /** Format: date-time */
3247
3131
  created_at: string;
3132
+ /**
3133
+ * When the key last changed, such as its revocation.
3134
+ * Format: date-time
3135
+ */
3136
+ updated_at: string;
3248
3137
  request_id?: RequestId;
3249
3138
  }
3250
3139
 
@@ -3253,142 +3142,118 @@ export type ApiKeyResponse = ApiKey & ResponseMetadata;
3253
3142
  /** Response shape for ApiKeyResponse. */
3254
3143
  export type ApiKeyResponseRead = ApiKeyRead & ResponseMetadata;
3255
3144
 
3256
- export interface UrlDefinitionRevisionSource {
3257
- kind: "url";
3258
- /** Format: uri */
3259
- url: string;
3260
- }
3261
-
3262
- /** Response shape for UrlDefinitionRevisionSource. */
3263
- export interface UrlDefinitionRevisionSourceRead {
3264
- kind: "url" | (string & {});
3265
- /** Format: uri */
3266
- url: string;
3267
- }
3268
-
3269
- export interface RepositoryDefinitionRevisionSource {
3270
- kind: "repository";
3271
- repository: RepositoryReferenceResponse;
3272
- /** Repository-relative Definition entrypoint path. */
3273
- path: string;
3274
- /** Git ref resolved for this revision, when recorded. */
3275
- ref?: string | null;
3276
- /** Exact Git commit consumed, when recorded. */
3277
- commit_sha?: string | null;
3145
+ export interface UrlSpecRevisionSource {
3146
+ type: "url";
3147
+ url: {
3148
+ /** Format: uri */
3149
+ url: string;
3150
+ };
3278
3151
  }
3279
3152
 
3280
- /** Response shape for RepositoryDefinitionRevisionSource. */
3281
- export interface RepositoryDefinitionRevisionSourceRead {
3282
- kind: "repository" | (string & {});
3283
- repository: RepositoryReferenceResponseRead;
3284
- /** Repository-relative Definition entrypoint path. */
3285
- path: string;
3286
- /** Git ref resolved for this revision, when recorded. */
3287
- ref?: string | null;
3288
- /** Exact Git commit consumed, when recorded. */
3289
- commit_sha?: string | null;
3153
+ /** Response shape for UrlSpecRevisionSource. */
3154
+ export interface UrlSpecRevisionSourceRead {
3155
+ type: "url" | (string & {});
3156
+ url: {
3157
+ /** Format: uri */
3158
+ url: string;
3159
+ };
3290
3160
  }
3291
3161
 
3292
- export type DefinitionRevisionSource = UrlDefinitionRevisionSource | RepositoryDefinitionRevisionSource;
3293
-
3294
- /** Response shape for DefinitionRevisionSource. */
3295
- export type DefinitionRevisionSourceRead = UrlDefinitionRevisionSourceRead
3296
- | RepositoryDefinitionRevisionSourceRead
3297
- | Record<string, unknown> & { kind?: string };
3298
-
3299
- export interface DefinitionDocument {
3300
- id: DefinitionDocumentId;
3301
- role: "entrypoint" | "reference";
3302
- /** Repository-relative path or same-origin URL captured in this revision. */
3303
- coordinate: string;
3304
- sha256: string;
3305
- size_bytes: number;
3162
+ export interface RepositorySpecRevisionSource {
3163
+ type: "repository";
3164
+ repository: {
3165
+ provider: RepositoryProvider;
3166
+ identifier: RepositoryIdentifier;
3167
+ /** Repository-relative Spec entrypoint path. */
3168
+ path: string;
3169
+ /** Git ref resolved for this revision, when recorded. */
3170
+ ref?: string | null;
3171
+ /** Exact Git commit consumed, when recorded. */
3172
+ commit_sha?: string | null;
3173
+ };
3306
3174
  }
3307
3175
 
3308
- /** Response shape for DefinitionDocument. */
3309
- export interface DefinitionDocumentRead {
3310
- id: DefinitionDocumentId;
3311
- role: ("entrypoint" | "reference") | (string & {});
3312
- /** Repository-relative path or same-origin URL captured in this revision. */
3313
- coordinate: string;
3314
- sha256: string;
3315
- size_bytes: number;
3176
+ /** Response shape for RepositorySpecRevisionSource. */
3177
+ export interface RepositorySpecRevisionSourceRead {
3178
+ type: "repository" | (string & {});
3179
+ repository: {
3180
+ provider: RepositoryProvider | (string & {});
3181
+ identifier: RepositoryIdentifier;
3182
+ /** Repository-relative Spec entrypoint path. */
3183
+ path: string;
3184
+ /** Git ref resolved for this revision, when recorded. */
3185
+ ref?: string | null;
3186
+ /** Exact Git commit consumed, when recorded. */
3187
+ commit_sha?: string | null;
3188
+ };
3316
3189
  }
3317
3190
 
3318
- export interface DefinitionDocumentResponse {
3319
- id: DefinitionDocumentId;
3320
- object: "definition_document";
3321
- definition_revision_id: DefinitionRevisionId;
3322
- role: "entrypoint" | "reference";
3323
- /** Repository-relative path or same-origin URL captured in this revision. */
3324
- coordinate: string;
3325
- sha256: string;
3326
- size_bytes: number;
3327
- /** Format: date-time */
3328
- created_at: string;
3329
- request_id: RequestId;
3330
- }
3191
+ export type SpecRevisionSource = UrlSpecRevisionSource | RepositorySpecRevisionSource;
3331
3192
 
3332
- /** Response shape for DefinitionDocumentResponse. */
3333
- export interface DefinitionDocumentResponseRead {
3334
- id: DefinitionDocumentId;
3335
- object: "definition_document" | (string & {});
3336
- definition_revision_id: DefinitionRevisionId;
3337
- role: ("entrypoint" | "reference") | (string & {});
3338
- /** Repository-relative path or same-origin URL captured in this revision. */
3339
- coordinate: string;
3340
- sha256: string;
3341
- size_bytes: number;
3342
- /** Format: date-time */
3343
- created_at: string;
3344
- request_id: RequestId;
3345
- }
3193
+ /** Response shape for SpecRevisionSource. */
3194
+ export type SpecRevisionSourceRead = UrlSpecRevisionSourceRead
3195
+ | RepositorySpecRevisionSourceRead
3196
+ | Record<string, unknown> & { type?: string };
3346
3197
 
3347
- export interface DefinitionRevision {
3348
- id: DefinitionRevisionId;
3349
- object: "definition_revision";
3198
+ export interface SpecRevision {
3199
+ id: SpecRevisionId;
3200
+ object: "spec_revision";
3350
3201
  project_id: ProjectId;
3351
- definition_id: DefinitionId;
3202
+ spec_id: SpecId;
3352
3203
  format: "openapi" | "graphql";
3353
- document_count: number;
3354
- /** Present on retrieve; list responses use document_count. */
3355
- documents?: DefinitionDocument[];
3356
- /** SHA-256 digest of every document coordinate, digest, and size in the resolved graph. */
3204
+ file_count: number;
3205
+ /** SHA-256 digest of every source file path, digest, and size in the resolved graph. */
3357
3206
  sha256: string;
3358
- /** Total bytes across all source documents. */
3207
+ /** Total bytes across all source files. */
3359
3208
  size_bytes: number;
3360
3209
  /** Origin recorded when this immutable revision was created. */
3361
- source: DefinitionRevisionSource | null;
3210
+ source: SpecRevisionSource | null;
3211
+ /** Present on retrieve; list responses omit it. */
3212
+ diagnostic_summary?: DiagnosticSummary;
3213
+ /** Present only with include=diagnostics. Ordered by severity, then rule identifier. */
3214
+ diagnostics?: Diagnostic[];
3215
+ /**
3216
+ * Present only with include=diagnostics. Coded misses or conflicts from applying the Spec's
3217
+ * patches to this revision.
3218
+ */
3219
+ patch_diagnostics?: DiagnosticWarning[];
3362
3220
  /** Format: date-time */
3363
3221
  created_at: string;
3364
3222
  request_id?: RequestId;
3365
3223
  }
3366
3224
 
3367
- /** Response shape for DefinitionRevision. */
3368
- export interface DefinitionRevisionRead {
3369
- id: DefinitionRevisionId;
3370
- object: "definition_revision" | (string & {});
3225
+ /** Response shape for SpecRevision. */
3226
+ export interface SpecRevisionRead {
3227
+ id: SpecRevisionId;
3228
+ object: "spec_revision" | (string & {});
3371
3229
  project_id: ProjectId;
3372
- definition_id: DefinitionId;
3230
+ spec_id: SpecId;
3373
3231
  format: ("openapi" | "graphql") | (string & {});
3374
- document_count: number;
3375
- /** Present on retrieve; list responses use document_count. */
3376
- documents?: DefinitionDocumentRead[];
3377
- /** SHA-256 digest of every document coordinate, digest, and size in the resolved graph. */
3232
+ file_count: number;
3233
+ /** SHA-256 digest of every source file path, digest, and size in the resolved graph. */
3378
3234
  sha256: string;
3379
- /** Total bytes across all source documents. */
3235
+ /** Total bytes across all source files. */
3380
3236
  size_bytes: number;
3381
3237
  /** Origin recorded when this immutable revision was created. */
3382
- source: DefinitionRevisionSourceRead | null;
3238
+ source: SpecRevisionSourceRead | null;
3239
+ /** Present on retrieve; list responses omit it. */
3240
+ diagnostic_summary?: DiagnosticSummaryRead;
3241
+ /** Present only with include=diagnostics. Ordered by severity, then rule identifier. */
3242
+ diagnostics?: DiagnosticRead[];
3243
+ /**
3244
+ * Present only with include=diagnostics. Coded misses or conflicts from applying the Spec's
3245
+ * patches to this revision.
3246
+ */
3247
+ patch_diagnostics?: DiagnosticWarningRead[];
3383
3248
  /** Format: date-time */
3384
3249
  created_at: string;
3385
3250
  request_id?: RequestId;
3386
3251
  }
3387
3252
 
3388
- export type DefinitionRevisionResponse = DefinitionRevision & ResponseMetadata;
3253
+ export type SpecRevisionResponse = SpecRevision & ResponseMetadata;
3389
3254
 
3390
- /** Response shape for DefinitionRevisionResponse. */
3391
- export type DefinitionRevisionResponseRead = DefinitionRevisionRead & ResponseMetadata;
3255
+ /** Response shape for SpecRevisionResponse. */
3256
+ export type SpecRevisionResponseRead = SpecRevisionRead & ResponseMetadata;
3392
3257
 
3393
3258
  export interface ProjectList {
3394
3259
  object: ListObject;
@@ -3443,9 +3308,9 @@ export interface GenerationListRead {
3443
3308
  request_id: RequestId;
3444
3309
  }
3445
3310
 
3446
- export interface DefinitionRevisionList {
3311
+ export interface SpecRevisionList {
3447
3312
  object: ListObject;
3448
- data: DefinitionRevision[];
3313
+ data: SpecRevision[];
3449
3314
  /** Whether another page is available after this one. */
3450
3315
  has_more: boolean;
3451
3316
  /** Pass this value as cursor to retrieve the next page; null on the last page. */
@@ -3453,10 +3318,10 @@ export interface DefinitionRevisionList {
3453
3318
  request_id: RequestId;
3454
3319
  }
3455
3320
 
3456
- /** Response shape for DefinitionRevisionList. */
3457
- export interface DefinitionRevisionListRead {
3321
+ /** Response shape for SpecRevisionList. */
3322
+ export interface SpecRevisionListRead {
3458
3323
  object: ListObject;
3459
- data: DefinitionRevisionRead[];
3324
+ data: SpecRevisionRead[];
3460
3325
  /** Whether another page is available after this one. */
3461
3326
  has_more: boolean;
3462
3327
  /** Pass this value as cursor to retrieve the next page; null on the last page. */
@@ -3524,7 +3389,6 @@ export const ErrorType = {
3524
3389
  SOURCE_ERROR: "source_error",
3525
3390
  RATE_LIMIT_ERROR: "rate_limit_error",
3526
3391
  API_ERROR: "api_error",
3527
- UNKNOWN_ERROR: "unknown_error",
3528
3392
  } as const;
3529
3393
  export type ErrorType = (typeof ErrorType)[keyof typeof ErrorType];
3530
3394
 
@@ -3541,17 +3405,14 @@ export const ErrorCode = {
3541
3405
  SPEC_ERROR: "spec_error",
3542
3406
  FETCH_ERROR: "fetch_error",
3543
3407
  REPOSITORY_PROVIDER_UNSUPPORTED: "repository_provider_unsupported",
3544
- EDITION_UNAVAILABLE: "edition_unavailable",
3545
3408
  TARGET_BUSY: "target_busy",
3546
3409
  NO_DRAFT: "no_draft",
3547
- STALE_DRAFT: "stale_draft",
3548
- NO_CHANGES: "no_changes",
3410
+ DRAFT_MERGED: "draft_merged",
3411
+ RESOURCE_CHANGED: "resource_changed",
3549
3412
  INVALID_VERSION: "invalid_version",
3550
3413
  PRECONDITION_FAILED: "precondition_failed",
3551
- DEFINITION_CHANGED: "definition_changed",
3552
3414
  VERSION_OCCUPIED: "version_occupied",
3553
3415
  VERSION_TOO_LOW: "version_too_low",
3554
- RELEASE_ANALYSIS_STALE: "release_analysis_stale",
3555
3416
  TARGET_ALREADY_RELEASED: "target_already_released",
3556
3417
  ADOPTION_UNVERIFIED: "adoption_unverified",
3557
3418
  PUBLICATION_DISABLED: "publication_disabled",
@@ -3577,13 +3438,10 @@ export const ErrorCode = {
3577
3438
  DEPENDENCY_MODULE_PATH_MISSING: "dependency_module_path_missing",
3578
3439
  DEPENDENCY_UNRELEASED: "dependency_unreleased",
3579
3440
  DEPENDENCY_REVISION_MISMATCH: "dependency_revision_mismatch",
3580
- DEPENDENCY_EDITION_INCOMPATIBLE: "dependency_edition_incompatible",
3581
3441
  PUBLICATION_FAILED: "publication_failed",
3582
3442
  CUSTOMIZATION_CONFLICT: "customization_conflict",
3583
3443
  HISTORY_RECOVERY_REQUIRED: "history_recovery_required",
3584
3444
  CHECKS_UNAVAILABLE: "checks_unavailable",
3585
- GENERATION_STALE: "generation_stale",
3586
- UNCLASSIFIED_ERROR: "unclassified_error",
3587
3445
  } as const;
3588
3446
  export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
3589
3447
 
@@ -3608,7 +3466,7 @@ export interface ErrorDetail {
3608
3466
  message: string;
3609
3467
  /**
3610
3468
  * Whether another attempt can succeed without correcting the inputs. For a recorded failure,
3611
- * start generation or publication again; retrieving the resource or replaying an idempotency key
3469
+ * start generation or publishing again; retrieving the resource or replaying an idempotency key
3612
3470
  * does not start another attempt.
3613
3471
  */
3614
3472
  retryable: boolean;
@@ -3643,7 +3501,7 @@ export interface ErrorDetailRead {
3643
3501
  message: string;
3644
3502
  /**
3645
3503
  * Whether another attempt can succeed without correcting the inputs. For a recorded failure,
3646
- * start generation or publication again; retrieving the resource or replaying an idempotency key
3504
+ * start generation or publishing again; retrieving the resource or replaying an idempotency key
3647
3505
  * does not start another attempt.
3648
3506
  */
3649
3507
  retryable: boolean;
@@ -3657,26 +3515,22 @@ export interface ErrorDetailRead {
3657
3515
  }
3658
3516
 
3659
3517
  export interface RepositoryReferenceResponse {
3660
- /** GitHub is the only launch provider; the field is stable for future adapters. */
3661
- provider: "github";
3662
- /** Provider-native repository identity, opaque outside its adapter. */
3663
- identifier: string;
3518
+ provider: RepositoryProvider;
3519
+ identifier: RepositoryIdentifier;
3664
3520
  }
3665
3521
 
3666
3522
  /** Response shape for RepositoryReferenceResponse. */
3667
3523
  export interface RepositoryReferenceResponseRead {
3668
- /** GitHub is the only launch provider; the field is stable for future adapters. */
3669
- provider: "github" | (string & {});
3670
- /** Provider-native repository identity, opaque outside its adapter. */
3671
- identifier: string;
3524
+ provider: RepositoryProvider | (string & {});
3525
+ identifier: RepositoryIdentifier;
3672
3526
  }
3673
3527
 
3674
3528
  /**
3675
- * A fix applied to the resolved Definition before generation. Paths are JSON
3529
+ * A fix applied to the resolved Spec before generation. Paths are JSON
3676
3530
  * Pointers into the document. A patch whose target no longer exists is
3677
3531
  * skipped and reported as a warning on the generation, never silently.
3678
3532
  */
3679
- export interface DefinitionPatchResponse {
3533
+ export interface SpecPatchResponse {
3680
3534
  op: "set" | "append" | "remove" | "rename";
3681
3535
  /**
3682
3536
  * JSON-Pointer-style path. Pattern segments enable bulk fixes:
@@ -3692,8 +3546,8 @@ export interface DefinitionPatchResponse {
3692
3546
  reason?: string | null;
3693
3547
  }
3694
3548
 
3695
- /** Response shape for DefinitionPatchResponse. */
3696
- export interface DefinitionPatchResponseRead {
3549
+ /** Response shape for SpecPatchResponse. */
3550
+ export interface SpecPatchResponseRead {
3697
3551
  op: ("set" | "append" | "remove" | "rename") | (string & {});
3698
3552
  /**
3699
3553
  * JSON-Pointer-style path. Pattern segments enable bulk fixes:
@@ -3753,11 +3607,11 @@ export interface DiagnosticPolicyResponseRead {
3753
3607
  }
3754
3608
 
3755
3609
  /**
3756
- * Required checks run against the complete combined package. Generated checks and customer commands
3757
- * share one reproducible workflow; repository_required names existing repository checks. Supplying
3758
- * checks replaces all settings. Omitted generated restores build, package, and public_entrypoint;
3759
- * omitted repository_required and customer restore empty lists. An empty object restores these
3760
- * defaults. An empty array clears the corresponding list.
3610
+ * Required checks run against the code in the Draft. Generated checks and customer commands share
3611
+ * one reproducible workflow; repository_required names existing repository checks. Supplying checks
3612
+ * replaces all settings. Omitted generated restores build, package, and public_entrypoint; omitted
3613
+ * repository_required and customer restore empty lists. An empty object restores these defaults. An
3614
+ * empty array clears the corresponding list.
3761
3615
  */
3762
3616
  export interface TargetChecksResponse {
3763
3617
  /** Default: ["build","package","public_entrypoint"] */
@@ -3959,6 +3813,40 @@ export interface CliBehaviorResponse {
3959
3813
  skills_repo?: string | null;
3960
3814
  }
3961
3815
 
3816
+ /** How the generated CLI behaves. Part of Config. */
3817
+ export interface TargetCliBehaviorResponse {
3818
+ /** Command users run, independent of how the CLI is distributed. */
3819
+ command_name?: string | null;
3820
+ /**
3821
+ * Opt in to a once-a-day registry check that prints an upgrade hint. Off by default; generated
3822
+ * code phones nobody unless this is enabled.
3823
+ */
3824
+ update_notice?: boolean;
3825
+ /**
3826
+ * Public HTTP(S) URL read by the optional changelog command in generated CLIs. Supports UTF-8
3827
+ * Markdown, plain text, and static HTML; embedded credentials are not allowed. Omit or clear to
3828
+ * disable, then regenerate.
3829
+ */
3830
+ changelog_url?: string | null;
3831
+ /**
3832
+ * Where the generated CLI's feedback command sends users. GitHub issues/new URLs get a prefilled
3833
+ * title and environment details.
3834
+ */
3835
+ support_url?: string | null;
3836
+ /**
3837
+ * Hosted MCP endpoint installed by the generated CLI instead of launching the package's local
3838
+ * stdio server.
3839
+ */
3840
+ mcp_url?: string | null;
3841
+ /** GitHub owner/name of the skills package the generated CLI offers to install during init. */
3842
+ skills_repo?: string | null;
3843
+ /**
3844
+ * Enable webhook relay sessions for this CLI Target. Requires Pro. Turning it off prevents new
3845
+ * sessions.
3846
+ */
3847
+ relay?: boolean;
3848
+ }
3849
+
3962
3850
  /** How generated MCP servers and the Typeship-hosted endpoint behave. Part of Config. */
3963
3851
  export interface McpBehaviorResponse {
3964
3852
  /** Stable official MCP registry name, independent of the server runtime. */
@@ -4116,11 +4004,10 @@ export interface PackageBehaviorResponse {
4116
4004
  }
4117
4005
 
4118
4006
  /**
4119
- * Everything Typeship needs beyond the Definition, in one object: generation customization
4120
- * (globals, retries, pagination, readme) and how the generated tooling behaves (cli, mcp, package,
4121
- * docs_url). Plain configuration. Typeship never requires vendor extensions inside the Definition
4122
- * itself. One-shot generation also accepts GraphQL settings here; stored projects keep those
4123
- * settings on their Definition.
4007
+ * Everything Typeship needs beyond the Spec, in one object: generation customization (globals,
4008
+ * retries, pagination, readme) and how the generated tooling behaves (cli, mcp, package, docs_url).
4009
+ * Plain configuration. Typeship never requires vendor extensions inside the Spec itself. One-shot
4010
+ * generation also accepts GraphQL settings here; stored projects keep those settings on their Spec.
4124
4011
  */
4125
4012
  export interface ConfigResponse {
4126
4013
  /**
@@ -4143,8 +4030,8 @@ export interface ConfigResponse {
4143
4030
  package?: PackageBehaviorResponse;
4144
4031
  /**
4145
4032
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
4146
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
4147
- * externalDocs URL.
4033
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Spec's externalDocs
4034
+ * URL.
4148
4035
  * Format: uri
4149
4036
  */
4150
4037
  docs_url?: string | null;
@@ -4177,8 +4064,8 @@ export interface ConfigResponseRead {
4177
4064
  package?: PackageBehaviorResponse;
4178
4065
  /**
4179
4066
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
4180
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
4181
- * externalDocs URL.
4067
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Spec's externalDocs
4068
+ * URL.
4182
4069
  * Format: uri
4183
4070
  */
4184
4071
  docs_url?: string | null;
@@ -4193,7 +4080,7 @@ export interface ConfigResponseRead {
4193
4080
  * Shared generated-client and tooling behavior for a stored Project. Every Target inherits these
4194
4081
  * defaults. Target.config is merged over them for one Target; top-level values replace defaults
4195
4082
  * while cli, mcp, auth, readme, and package merge by field. GraphQL-only source settings live on
4196
- * the Project's Definition and are rejected in both stored config scopes.
4083
+ * the Project's Spec and are rejected in both stored config scopes.
4197
4084
  */
4198
4085
  export interface ProjectConfigResponse {
4199
4086
  /**
@@ -4215,8 +4102,8 @@ export interface ProjectConfigResponse {
4215
4102
  package?: PackageBehaviorResponse;
4216
4103
  /**
4217
4104
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
4218
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
4219
- * externalDocs URL.
4105
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Spec's externalDocs
4106
+ * URL.
4220
4107
  * Format: uri
4221
4108
  */
4222
4109
  docs_url?: string | null;
@@ -4248,8 +4135,8 @@ export interface ProjectConfigResponseRead {
4248
4135
  package?: PackageBehaviorResponse;
4249
4136
  /**
4250
4137
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
4251
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
4252
- * externalDocs URL.
4138
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Spec's externalDocs
4139
+ * URL.
4253
4140
  * Format: uri
4254
4141
  */
4255
4142
  docs_url?: string | null;
@@ -4279,14 +4166,14 @@ export interface TargetConfigResponse {
4279
4166
  */
4280
4167
  pagination?: Record<string, PaginationRuleResponse | boolean>;
4281
4168
  auth?: TargetAuthenticationConfigResponse;
4282
- cli?: CliBehaviorResponse;
4169
+ cli?: TargetCliBehaviorResponse;
4283
4170
  mcp?: McpBehaviorResponse;
4284
4171
  readme?: ReadmeBehaviorResponse;
4285
4172
  package?: PackageBehaviorResponse;
4286
4173
  /**
4287
4174
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
4288
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
4289
- * externalDocs URL.
4175
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Spec's externalDocs
4176
+ * URL.
4290
4177
  * Format: uri
4291
4178
  */
4292
4179
  docs_url?: string | null;
@@ -4312,14 +4199,14 @@ export interface TargetConfigResponseRead {
4312
4199
  */
4313
4200
  pagination?: Record<string, PaginationRuleResponseRead | boolean>;
4314
4201
  auth?: TargetAuthenticationConfigResponse;
4315
- cli?: CliBehaviorResponse;
4202
+ cli?: TargetCliBehaviorResponse;
4316
4203
  mcp?: McpBehaviorResponseRead;
4317
4204
  readme?: ReadmeBehaviorResponse;
4318
4205
  package?: PackageBehaviorResponse;
4319
4206
  /**
4320
4207
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
4321
- * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
4322
- * externalDocs URL.
4208
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Spec's externalDocs
4209
+ * URL.
4323
4210
  * Format: uri
4324
4211
  */
4325
4212
  docs_url?: string | null;
@@ -4431,7 +4318,7 @@ export interface RetryTuningResponse {
4431
4318
 
4432
4319
  export interface PaginationRuleResponse {
4433
4320
  /** Default: "cursor" */
4434
- style?: "cursor" | "cursorFromLastId" | "page" | "offset";
4321
+ style?: "cursor" | "cursor_from_last_id" | "page" | "offset";
4435
4322
  /** Response field holding the item array. */
4436
4323
  items_field: string;
4437
4324
  cursor_param?: string;
@@ -4446,7 +4333,7 @@ export interface PaginationRuleResponse {
4446
4333
  /** Response shape for PaginationRuleResponse. */
4447
4334
  export interface PaginationRuleResponseRead {
4448
4335
  /** Default: "cursor" */
4449
- style?: ("cursor" | "cursorFromLastId" | "page" | "offset") | (string & {});
4336
+ style?: ("cursor" | "cursor_from_last_id" | "page" | "offset") | (string & {});
4450
4337
  /** Response field holding the item array. */
4451
4338
  items_field: string;
4452
4339
  cursor_param?: string;
@@ -4478,105 +4365,93 @@ export const GitFileMode = {
4478
4365
  export type GitFileMode = (typeof GitFileMode)[keyof typeof GitFileMode];
4479
4366
 
4480
4367
  /**
4481
- * One side of a Draft file comparison. A conflict has base (the common version before both
4482
- * changes), repository (the file on the Draft), and incoming (the file the merge brings in). A
4483
- * default-branch history rewrite has accepted (the last accepted package), default (the rewritten
4484
- * default branch), and draft (the current Draft branch).
4368
+ * One side of a Draft file comparison: base is the last merged version, yours is your repository
4369
+ * edit, and generated is the new version Typeship proposes for this conflict stage. The conflict
4370
+ * source identifies whether that version comes from a Generation, the default branch, or a saved
4371
+ * Draft. Missing sides represent deleted or absent files.
4485
4372
  */
4486
4373
  export const DraftFileSide = {
4487
4374
  BASE: "base",
4488
- REPOSITORY: "repository",
4489
- INCOMING: "incoming",
4490
- ACCEPTED: "accepted",
4491
- DEFAULT: "default",
4492
- DRAFT: "draft",
4375
+ YOURS: "yours",
4376
+ GENERATED: "generated",
4493
4377
  } as const;
4494
4378
  export type DraftFileSide = (typeof DraftFileSide)[keyof typeof DraftFileSide];
4495
4379
 
4496
- export interface DraftFileSideSummary {
4497
- side: DraftFileSide;
4498
- mode: GitFileMode;
4499
- size_bytes: number;
4500
- /** utf8 for text; base64 for binary content. */
4501
- encoding: "utf8" | "base64";
4502
- }
4503
-
4504
- /** Response shape for DraftFileSideSummary. */
4505
- export interface DraftFileSideSummaryRead {
4506
- side: DraftFileSide | (string & {});
4507
- mode: GitFileMode | (string & {});
4508
- size_bytes: number;
4509
- /** utf8 for text; base64 for binary content. */
4510
- encoding: ("utf8" | "base64") | (string & {});
4380
+ /**
4381
+ * File IDs for each side of a conflict or history comparison. null means the file is absent on that
4382
+ * side.
4383
+ */
4384
+ export interface DraftFileSides {
4385
+ base: FileId | null;
4386
+ yours: FileId | null;
4387
+ generated: FileId | null;
4511
4388
  }
4512
4389
 
4513
4390
  export interface DraftFileConflict {
4514
4391
  /**
4515
- * Why the merge stopped. no_common_version: there is no earlier version to compare, such as the
4516
- * first Draft of an adopted package. file_ownership: generated output collides with a file you
4517
- * added. repository_deleted_incoming_changed and incoming_deleted_repository_changed: one side
4392
+ * Why the Draft needs a decision. no_common_version: there is no last merged version to compare,
4393
+ * such as the first Draft of an adopted package. file_ownership: generated output collides with a
4394
+ * file you added. yours_deleted_generated_changed and generated_deleted_yours_changed: one side
4518
4395
  * deleted a file the other changed. overlapping_text: both sides edited the same lines.
4519
4396
  * too_large_to_merge: the file has too many changed lines to merge line by line. binary_changed
4520
4397
  * and file_mode_changed: both sides changed binary content or the file mode.
4521
4398
  */
4522
- kind: "no_common_version"
4399
+ type: "no_common_version"
4523
4400
  | "file_ownership"
4524
- | "repository_deleted_incoming_changed"
4525
- | "incoming_deleted_repository_changed"
4401
+ | "yours_deleted_generated_changed"
4402
+ | "generated_deleted_yours_changed"
4526
4403
  | "overlapping_text"
4527
4404
  | "too_large_to_merge"
4528
4405
  | "binary_changed"
4529
4406
  | "file_mode_changed";
4530
4407
  /**
4531
- * Where the incoming version comes from: the new Generation, commits on the default branch, or
4532
- * the code of a Draft whose branch was rebased, reset, or deleted (its old branch is preserved).
4533
- * The merge applies previous_draft, then default_branch, then generation, and stops at the first
4534
- * stage with conflicts, so applying one stage's decisions can report conflicts from the next.
4408
+ * Where the code in this Draft comes from: newly generated files, commits on the default branch,
4409
+ * or edits from a Draft whose branch was rebased, reset, or deleted. Typeship may find another
4410
+ * conflict after these decisions are applied.
4535
4411
  */
4536
4412
  source: "generation" | "default_branch" | "previous_draft";
4537
4413
  /**
4538
- * Decision saved for this conflict on head_revision; null when none. Saved decisions apply when
4539
- * the Target is generated.
4414
+ * Decision saved for this conflict on head_sha; null when none. Typeship continues when every
4415
+ * conflict has a decision.
4540
4416
  */
4541
- decision: "repository" | "incoming" | "content" | null;
4417
+ decision: "yours" | "generated" | "content" | null;
4542
4418
  }
4543
4419
 
4544
4420
  /** Response shape for DraftFileConflict. */
4545
4421
  export interface DraftFileConflictRead {
4546
4422
  /**
4547
- * Why the merge stopped. no_common_version: there is no earlier version to compare, such as the
4548
- * first Draft of an adopted package. file_ownership: generated output collides with a file you
4549
- * added. repository_deleted_incoming_changed and incoming_deleted_repository_changed: one side
4423
+ * Why the Draft needs a decision. no_common_version: there is no last merged version to compare,
4424
+ * such as the first Draft of an adopted package. file_ownership: generated output collides with a
4425
+ * file you added. yours_deleted_generated_changed and generated_deleted_yours_changed: one side
4550
4426
  * deleted a file the other changed. overlapping_text: both sides edited the same lines.
4551
4427
  * too_large_to_merge: the file has too many changed lines to merge line by line. binary_changed
4552
4428
  * and file_mode_changed: both sides changed binary content or the file mode.
4553
4429
  */
4554
- kind: ("no_common_version"
4430
+ type: ("no_common_version"
4555
4431
  | "file_ownership"
4556
- | "repository_deleted_incoming_changed"
4557
- | "incoming_deleted_repository_changed"
4432
+ | "yours_deleted_generated_changed"
4433
+ | "generated_deleted_yours_changed"
4558
4434
  | "overlapping_text"
4559
4435
  | "too_large_to_merge"
4560
4436
  | "binary_changed"
4561
4437
  | "file_mode_changed") | (string & {});
4562
4438
  /**
4563
- * Where the incoming version comes from: the new Generation, commits on the default branch, or
4564
- * the code of a Draft whose branch was rebased, reset, or deleted (its old branch is preserved).
4565
- * The merge applies previous_draft, then default_branch, then generation, and stops at the first
4566
- * stage with conflicts, so applying one stage's decisions can report conflicts from the next.
4439
+ * Where the code in this Draft comes from: newly generated files, commits on the default branch,
4440
+ * or edits from a Draft whose branch was rebased, reset, or deleted. Typeship may find another
4441
+ * conflict after these decisions are applied.
4567
4442
  */
4568
4443
  source: ("generation" | "default_branch" | "previous_draft") | (string & {});
4569
4444
  /**
4570
- * Decision saved for this conflict on head_revision; null when none. Saved decisions apply when
4571
- * the Target is generated.
4445
+ * Decision saved for this conflict on head_sha; null when none. Typeship continues when every
4446
+ * conflict has a decision.
4572
4447
  */
4573
- decision: ("repository" | "incoming" | "content" | null) | (string & {}) | null;
4448
+ decision: ("yours" | "generated" | "content" | null) | (string & {}) | null;
4574
4449
  }
4575
4450
 
4576
4451
  export interface DraftFileHistory {
4577
4452
  /**
4578
- * How the rewritten default branch differs from the last accepted package; null when only the
4579
- * Draft differs.
4453
+ * How the rewritten default branch differs from the last merged package; null when only the Draft
4454
+ * differs.
4580
4455
  */
4581
4456
  change: "added" | "edited" | "deleted" | "mode_changed" | null;
4582
4457
  /**
@@ -4589,8 +4464,8 @@ export interface DraftFileHistory {
4589
4464
  /** Response shape for DraftFileHistory. */
4590
4465
  export interface DraftFileHistoryRead {
4591
4466
  /**
4592
- * How the rewritten default branch differs from the last accepted package; null when only the
4593
- * Draft differs.
4467
+ * How the rewritten default branch differs from the last merged package; null when only the Draft
4468
+ * differs.
4594
4469
  */
4595
4470
  change: ("added" | "edited" | "deleted" | "mode_changed" | null) | (string & {}) | null;
4596
4471
  /**
@@ -4604,15 +4479,12 @@ export interface DraftFile {
4604
4479
  object: "draft_file";
4605
4480
  /** Path relative to the Target's package directory. */
4606
4481
  path: string;
4607
- /** How the Draft differs from the last accepted package at this path; null when it does not. */
4482
+ /** How the Draft differs from the last merged package at this path; null when it does not. */
4608
4483
  customization: "added" | "edited" | "deleted" | "mode_changed" | null;
4609
4484
  conflict: DraftFileConflict | null;
4610
4485
  history: DraftFileHistory | null;
4611
- /**
4612
- * Sides of the comparison to read with retrieveDraftFileContent. A missing side means the file is
4613
- * absent there. Listed for conflicts and history files.
4614
- */
4615
- sides: DraftFileSideSummary[];
4486
+ /** File IDs to read with getFile for a conflict or history file; null for other customized files. */
4487
+ sides: DraftFileSides | null;
4616
4488
  }
4617
4489
 
4618
4490
  /** Response shape for DraftFile. */
@@ -4620,15 +4492,12 @@ export interface DraftFileRead {
4620
4492
  object: "draft_file" | (string & {});
4621
4493
  /** Path relative to the Target's package directory. */
4622
4494
  path: string;
4623
- /** How the Draft differs from the last accepted package at this path; null when it does not. */
4495
+ /** How the Draft differs from the last merged package at this path; null when it does not. */
4624
4496
  customization: ("added" | "edited" | "deleted" | "mode_changed" | null) | (string & {}) | null;
4625
4497
  conflict: DraftFileConflictRead | null;
4626
4498
  history: DraftFileHistoryRead | null;
4627
- /**
4628
- * Sides of the comparison to read with retrieveDraftFileContent. A missing side means the file is
4629
- * absent there. Listed for conflicts and history files.
4630
- */
4631
- sides: DraftFileSideSummaryRead[];
4499
+ /** File IDs to read with getFile for a conflict or history file; null for other customized files. */
4500
+ sides: DraftFileSides | null;
4632
4501
  }
4633
4502
 
4634
4503
  export interface DraftFileList {
@@ -4648,64 +4517,10 @@ export interface DraftFileListRead {
4648
4517
  request_id: RequestId;
4649
4518
  }
4650
4519
 
4651
- export interface DraftFileContent {
4652
- object: "draft_file_content";
4653
- target_id: TargetId;
4654
- path: string;
4655
- side: DraftFileSide;
4656
- /** utf8 means content is text; base64 means content is base64-encoded binary bytes. */
4657
- encoding: "utf8" | "base64";
4658
- /**
4659
- * At most 24 KiB of the file starting at offset. Text chunks never split a character; concatenate
4660
- * chunks in order.
4661
- */
4662
- content: string;
4663
- mode: GitFileMode;
4664
- /** Size of the whole file in bytes. */
4665
- size_bytes: number;
4666
- /** Byte offset of this chunk in the file. */
4667
- offset: number;
4668
- /**
4669
- * Pass as cursor, with the same path and side, to read the next chunk; null at the end of the
4670
- * file.
4671
- */
4672
- next_cursor: string | null;
4673
- }
4674
-
4675
- /** Response shape for DraftFileContent. */
4676
- export interface DraftFileContentRead {
4677
- object: "draft_file_content" | (string & {});
4678
- target_id: TargetId;
4679
- path: string;
4680
- side: DraftFileSide | (string & {});
4681
- /** utf8 means content is text; base64 means content is base64-encoded binary bytes. */
4682
- encoding: ("utf8" | "base64") | (string & {});
4683
- /**
4684
- * At most 24 KiB of the file starting at offset. Text chunks never split a character; concatenate
4685
- * chunks in order.
4686
- */
4687
- content: string;
4688
- mode: GitFileMode | (string & {});
4689
- /** Size of the whole file in bytes. */
4690
- size_bytes: number;
4691
- /** Byte offset of this chunk in the file. */
4692
- offset: number;
4693
- /**
4694
- * Pass as cursor, with the same path and side, to read the next chunk; null at the end of the
4695
- * file.
4696
- */
4697
- next_cursor: string | null;
4698
- }
4699
-
4700
- export type DraftFileContentResponse = DraftFileContent & ResponseMetadata;
4701
-
4702
- /** Response shape for DraftFileContentResponse. */
4703
- export type DraftFileContentResponseRead = DraftFileContentRead & ResponseMetadata;
4704
-
4705
4520
  export type DraftConflictDecision = {
4706
4521
  path: string;
4707
4522
  /** Keep that version of the file exactly. Keeping an absent version deletes the path. */
4708
- keep: "repository" | "incoming";
4523
+ keep: "yours" | "generated";
4709
4524
  }
4710
4525
  | {
4711
4526
  path: string;
@@ -4732,7 +4547,7 @@ export type DraftConflictDecision = {
4732
4547
  export type DraftConflictDecisionRead = {
4733
4548
  path: string;
4734
4549
  /** Keep that version of the file exactly. Keeping an absent version deletes the path. */
4735
- keep: ("repository" | "incoming") | (string & {});
4550
+ keep: ("yours" | "generated") | (string & {});
4736
4551
  }
4737
4552
  | {
4738
4553
  path: string;
@@ -4755,153 +4570,37 @@ export type DraftConflictDecisionRead = {
4755
4570
  content: null;
4756
4571
  };
4757
4572
 
4758
- export interface ResolveDraftConflicts {
4759
- /** The Draft's head_revision. A newer Draft commit returns 409 stale_draft without saving. */
4760
- expected_head_revision: string;
4573
+ export interface DraftResolveRequest {
4574
+ /** The Draft's head_sha. A newer Draft commit returns 409 resource_changed without saving. */
4575
+ expected_head_sha: string;
4761
4576
  /**
4762
- * Unique current conflict paths. Final file content must total at most 2 MiB. Decisions save
4577
+ * Unique current conflict or customized paths. Choose generated to discard a customization,
4578
+ * including a Draft-only file. Final file content must total at most 2 MiB. Decisions apply
4763
4579
  * together or not at all.
4764
4580
  */
4765
4581
  resolutions: DraftConflictDecision[];
4766
- /**
4767
- * Validate the decisions and return the planned files without saving.
4768
- * Default: false
4769
- */
4770
- dry_run?: boolean;
4771
4582
  }
4772
4583
 
4773
- /** Response shape for ResolveDraftConflicts. */
4774
- export interface ResolveDraftConflictsRead {
4775
- /** The Draft's head_revision. A newer Draft commit returns 409 stale_draft without saving. */
4776
- expected_head_revision: string;
4584
+ /** Response shape for DraftResolveRequest. */
4585
+ export interface DraftResolveRequestRead {
4586
+ /** The Draft's head_sha. A newer Draft commit returns 409 resource_changed without saving. */
4587
+ expected_head_sha: string;
4777
4588
  /**
4778
- * Unique current conflict paths. Final file content must total at most 2 MiB. Decisions save
4589
+ * Unique current conflict or customized paths. Choose generated to discard a customization,
4590
+ * including a Draft-only file. Final file content must total at most 2 MiB. Decisions apply
4779
4591
  * together or not at all.
4780
4592
  */
4781
4593
  resolutions: DraftConflictDecisionRead[];
4782
- /**
4783
- * Validate the decisions and return the planned files without saving.
4784
- * Default: false
4785
- */
4786
- dry_run?: boolean;
4787
- }
4788
-
4789
- export interface DiscardDraftCustomizations {
4790
- /** The Draft's head_revision. A newer Draft commit returns 409 stale_draft without committing. */
4791
- expected_head_revision: string;
4792
- /**
4793
- * Customized paths that are not conflicts, to replace with the generated files. A listed file
4794
- * that exists only on the Draft is deleted.
4795
- */
4796
- paths: string[];
4797
- /**
4798
- * Return the planned writes and deletions without committing.
4799
- * Default: false
4800
- */
4801
- dry_run?: boolean;
4802
- }
4803
-
4804
- export interface DraftPlannedFile {
4805
- path: string;
4806
- /** keep: the Draft's version stays. write: the file gets new content. delete: the path is removed. */
4807
- action: "keep" | "write" | "delete";
4808
- mode: GitFileMode | null;
4809
- /** Size of the resulting file; null when it is deleted. */
4810
- size_bytes: number | null;
4811
- }
4812
-
4813
- /** Response shape for DraftPlannedFile. */
4814
- export interface DraftPlannedFileRead {
4815
- path: string;
4816
- /** keep: the Draft's version stays. write: the file gets new content. delete: the path is removed. */
4817
- action: ("keep" | "write" | "delete") | (string & {});
4818
- mode: GitFileMode | (string & {}) | null;
4819
- /** Size of the resulting file; null when it is deleted. */
4820
- size_bytes: number | null;
4821
- }
4822
-
4823
- export interface DraftConflictResolution {
4824
- object: "draft_conflict_resolution";
4825
- target_id: TargetId;
4826
- /** Draft commit the decisions belong to. */
4827
- head_revision: string;
4828
- /**
4829
- * preview: nothing was saved. saved: the decisions are stored and apply when the Target is
4830
- * generated.
4831
- */
4832
- status: "preview" | "saved";
4833
- files: DraftPlannedFile[];
4834
- /**
4835
- * Conflicts without a decision once these are saved. At 0 the Draft status becomes
4836
- * needs_generation.
4837
- */
4838
- remaining_conflicts: number;
4839
- }
4840
-
4841
- /** Response shape for DraftConflictResolution. */
4842
- export interface DraftConflictResolutionRead {
4843
- object: "draft_conflict_resolution" | (string & {});
4844
- target_id: TargetId;
4845
- /** Draft commit the decisions belong to. */
4846
- head_revision: string;
4847
- /**
4848
- * preview: nothing was saved. saved: the decisions are stored and apply when the Target is
4849
- * generated.
4850
- */
4851
- status: ("preview" | "saved") | (string & {});
4852
- files: DraftPlannedFileRead[];
4853
- /**
4854
- * Conflicts without a decision once these are saved. At 0 the Draft status becomes
4855
- * needs_generation.
4856
- */
4857
- remaining_conflicts: number;
4858
- }
4859
-
4860
- export type DraftConflictResolutionResponse = DraftConflictResolution & ResponseMetadata;
4861
-
4862
- /** Response shape for DraftConflictResolutionResponse. */
4863
- export type DraftConflictResolutionResponseRead = DraftConflictResolutionRead & ResponseMetadata;
4864
-
4865
- export interface DraftCustomizationDiscard {
4866
- object: "draft_customization_discard";
4867
- target_id: TargetId;
4868
- /** preview: the inspected Draft commit. committed: the new Draft commit. */
4869
- head_revision: string;
4870
- /**
4871
- * preview: nothing was written. committed: one commit was added to the Draft branch; the Draft
4872
- * status is branch_changed until Typeship integrates it.
4873
- */
4874
- status: "preview" | "committed";
4875
- files: DraftPlannedFile[];
4876
- }
4877
-
4878
- /** Response shape for DraftCustomizationDiscard. */
4879
- export interface DraftCustomizationDiscardRead {
4880
- object: "draft_customization_discard" | (string & {});
4881
- target_id: TargetId;
4882
- /** preview: the inspected Draft commit. committed: the new Draft commit. */
4883
- head_revision: string;
4884
- /**
4885
- * preview: nothing was written. committed: one commit was added to the Draft branch; the Draft
4886
- * status is branch_changed until Typeship integrates it.
4887
- */
4888
- status: ("preview" | "committed") | (string & {});
4889
- files: DraftPlannedFileRead[];
4890
4594
  }
4891
4595
 
4892
- export type DraftCustomizationDiscardResponse = DraftCustomizationDiscard & ResponseMetadata;
4893
-
4894
- /** Response shape for DraftCustomizationDiscardResponse. */
4895
- export type DraftCustomizationDiscardResponseRead = DraftCustomizationDiscardRead & ResponseMetadata;
4896
-
4897
4596
  export interface GenerateProjectRequest {
4898
4597
  /** Generate only this active Target. Omit to generate all active Targets in the Project. */
4899
4598
  target_id?: TargetId;
4900
4599
  }
4901
4600
 
4902
- /** The stage that failed. A delivery failure does not change a Generation's succeeded status. */
4601
+ /** The stage that failed. A delivery failure does not change a completed Generation's status. */
4903
4602
  export const FailurePhase = {
4904
- DEFINITION: "definition",
4603
+ SPEC: "spec",
4905
4604
  GENERATION: "generation",
4906
4605
  DELIVERY: "delivery",
4907
4606
  PUBLICATION: "publication",
@@ -4917,43 +4616,9 @@ export type DomainErrorRead = ErrorDetailRead & {
4917
4616
  phase: FailurePhase | (string & {});
4918
4617
  };
4919
4618
 
4920
- export interface RecoverDraftHistory {
4921
- /** The Draft's history_recovery.default_revision. */
4922
- expected_default_revision: string;
4923
- /** The Draft's history_recovery.head_revision; null when the Draft branch is absent. */
4924
- expected_head_revision: string | null;
4925
- }
4926
-
4927
- export interface DraftHistoryRecovery {
4928
- object: "draft_history_recovery";
4929
- target_id: TargetId;
4930
- /**
4931
- * approved: recovery is saved and the Draft status is needs_generation. not_needed: the default
4932
- * branch still contains the accepted package.
4933
- */
4934
- status: "approved" | "not_needed";
4935
- default_revision: string;
4936
- head_revision: string | null;
4937
- /** Existing Draft branch that stays available when Generate opens the recovered Draft. */
4938
- preserved_branch: string | null;
4939
- }
4940
-
4941
- /** Response shape for DraftHistoryRecovery. */
4942
- export interface DraftHistoryRecoveryRead {
4943
- object: "draft_history_recovery" | (string & {});
4944
- target_id: TargetId;
4945
- /**
4946
- * approved: recovery is saved and the Draft status is needs_generation. not_needed: the default
4947
- * branch still contains the accepted package.
4948
- */
4949
- status: ("approved" | "not_needed") | (string & {});
4950
- default_revision: string;
4951
- head_revision: string | null;
4952
- /** Existing Draft branch that stays available when Generate opens the recovered Draft. */
4953
- preserved_branch: string | null;
4619
+ export interface DraftRecoverRequest {
4620
+ /** The Draft's history_recovery.default_sha. */
4621
+ expected_default_sha: string;
4622
+ /** The Draft's history_recovery.head_sha; null when the Draft branch is absent. */
4623
+ expected_head_sha: string | null;
4954
4624
  }
4955
-
4956
- export type DraftHistoryRecoveryResponse = DraftHistoryRecovery & ResponseMetadata;
4957
-
4958
- /** Response shape for DraftHistoryRecoveryResponse. */
4959
- export type DraftHistoryRecoveryResponseRead = DraftHistoryRecoveryRead & ResponseMetadata;