@typeship-ax/cli 0.10.0 → 0.20.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 (70) hide show
  1. package/AGENTS.md +9 -4
  2. package/README.md +4 -4
  3. package/api.json +4829 -679
  4. package/api.md +387 -91
  5. package/dist/cli-agent.d.ts +5 -5
  6. package/dist/cli-agent.d.ts.map +1 -1
  7. package/dist/cli-agent.js +14 -10
  8. package/dist/cli.js +151 -75
  9. package/dist/core/http.d.ts +3 -2
  10. package/dist/core/http.d.ts.map +1 -1
  11. package/dist/core/http.js +18 -6
  12. package/dist/errors.d.ts +17 -10
  13. package/dist/errors.d.ts.map +1 -1
  14. package/dist/errors.js +24 -15
  15. package/dist/index.d.ts +7 -3
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +9 -5
  18. package/dist/ops.d.ts +4 -0
  19. package/dist/ops.d.ts.map +1 -1
  20. package/dist/ops.js +45 -35
  21. package/dist/polling-login.d.ts.map +1 -1
  22. package/dist/polling-login.js +11 -1
  23. package/dist/resources/account.d.ts +4 -4
  24. package/dist/resources/account.d.ts.map +1 -1
  25. package/dist/resources/account.js +10 -5
  26. package/dist/resources/api-keys.d.ts +40 -14
  27. package/dist/resources/api-keys.d.ts.map +1 -1
  28. package/dist/resources/api-keys.js +45 -13
  29. package/dist/resources/definition-revisions.d.ts +35 -18
  30. package/dist/resources/definition-revisions.d.ts.map +1 -1
  31. package/dist/resources/definition-revisions.js +43 -15
  32. package/dist/resources/definitions.d.ts +21 -6
  33. package/dist/resources/definitions.d.ts.map +1 -1
  34. package/dist/resources/definitions.js +16 -3
  35. package/dist/resources/generate.d.ts +44 -15
  36. package/dist/resources/generate.d.ts.map +1 -1
  37. package/dist/resources/generate.js +55 -13
  38. package/dist/resources/generations.d.ts +14 -6
  39. package/dist/resources/generations.d.ts.map +1 -1
  40. package/dist/resources/generations.js +26 -5
  41. package/dist/resources/projects.d.ts +106 -53
  42. package/dist/resources/projects.d.ts.map +1 -1
  43. package/dist/resources/projects.js +78 -31
  44. package/dist/resources/targets.d.ts +240 -40
  45. package/dist/resources/targets.d.ts.map +1 -1
  46. package/dist/resources/targets.js +307 -21
  47. package/dist/schemas.d.ts +1 -0
  48. package/dist/schemas.d.ts.map +1 -1
  49. package/dist/schemas.js +171 -111
  50. package/dist/types.d.ts +1969 -154
  51. package/dist/types.d.ts.map +1 -1
  52. package/dist/types.js +87 -3
  53. package/package.json +3 -3
  54. package/src/cli-agent.ts +17 -13
  55. package/src/cli.ts +138 -70
  56. package/src/core/http.ts +17 -6
  57. package/src/errors.ts +25 -15
  58. package/src/index.ts +9 -5
  59. package/src/ops.ts +49 -35
  60. package/src/polling-login.ts +10 -1
  61. package/src/resources/account.ts +11 -4
  62. package/src/resources/api-keys.ts +84 -13
  63. package/src/resources/definition-revisions.ts +74 -16
  64. package/src/resources/definitions.ts +28 -4
  65. package/src/resources/generate.ts +78 -13
  66. package/src/resources/generations.ts +31 -4
  67. package/src/resources/projects.ts +141 -39
  68. package/src/resources/targets.ts +561 -27
  69. package/src/schemas.ts +172 -112
  70. package/src/types.ts +2105 -154
package/src/types.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // typeship — API types.
2
- // Generated by typeship — https://typeship.dev — do not edit by hand.
2
+ // Generated by typeship — https://typeship.dev
3
3
 
4
4
  /** Unique identifier for a project. */
5
5
  export type ProjectId = string;
@@ -38,13 +38,15 @@ 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.
41
+ * Targets may use the same generator. cli is the TypeScript CLI; go-cli is the native Go CLI, a
42
+ * distinct product that imports one exact paired Go SDK module rather than a client of its own.
42
43
  */
43
44
  export const GeneratorKind = {
44
45
  TYPESCRIPT_SDK: "typescript-sdk",
45
46
  PYTHON_SDK: "python-sdk",
46
47
  GO_SDK: "go-sdk",
47
48
  CLI: "cli",
49
+ GO_CLI: "go-cli",
48
50
  MCP: "mcp",
49
51
  } as const;
50
52
  export type GeneratorKind = (typeof GeneratorKind)[keyof typeof GeneratorKind];
@@ -58,7 +60,7 @@ export interface UrlDefinitionInput {
58
60
  url: string;
59
61
  /**
60
62
  * Request headers for a protected URL. Sent on the document GET and GraphQL introspection POST,
61
- * never returned or retained by stateless generation.
63
+ * never returned or retained by one-shot generation.
62
64
  */
63
65
  headers?: Record<string, string>;
64
66
  }
@@ -78,15 +80,49 @@ export interface InlineDefinitionInput {
78
80
  inline: string;
79
81
  }
80
82
 
81
- /** A Definition for stateless generation, provided as exactly one URL or inline entrypoint. */
83
+ /** A Definition for one-shot generation, provided as exactly one URL or inline entrypoint. */
82
84
  export type DefinitionInput = UrlDefinitionInput | InlineDefinitionInput;
83
85
 
84
86
  /** Response shape for DefinitionInput. */
85
87
  export type DefinitionInputRead = UrlDefinitionInputRead | InlineDefinitionInput;
86
88
 
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.
93
+ */
94
+ export interface GoSdkDescriptor {
95
+ /**
96
+ * Go module path of the SDK the CLI imports, for example github.com/acme/payments-go. Must be a
97
+ * valid Go module path.
98
+ */
99
+ module_path: string;
100
+ /**
101
+ * Exact SDK module version the CLI requires: v-prefixed SemVer such as v1.2.3, or an immutable Go
102
+ * pseudo-version naming a commit such as v0.0.0-20240824120000-abcdef123456. Ranges, branches,
103
+ * and "latest" are rejected.
104
+ */
105
+ version: string;
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.
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;
116
+ /**
117
+ * Go package identifier of the SDK, when the module path's last element does not imply it.
118
+ * Optional.
119
+ */
120
+ package_name?: string;
121
+ }
122
+
87
123
  export interface GenerateRequest {
88
124
  definition: DefinitionInput;
89
- /** Stateless generator descriptor; no persisted Target is created. */
125
+ /** One-shot generator descriptor; no persisted Target is created. */
90
126
  target: {
91
127
  generator: GeneratorKind;
92
128
  };
@@ -96,17 +132,18 @@ export interface GenerateRequest {
96
132
  */
97
133
  package_name?: string;
98
134
  /**
99
- * Go module path override. Valid only for the Go SDK. Linked projects derive this from the Go
100
- * destination repository by default.
135
+ * 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.
101
137
  */
102
138
  module_path?: string;
139
+ go_sdk?: GoSdkDescriptor;
103
140
  config?: Config;
104
141
  }
105
142
 
106
143
  /** Response shape for GenerateRequest. */
107
144
  export interface GenerateRequestRead {
108
145
  definition: DefinitionInputRead;
109
- /** Stateless generator descriptor; no persisted Target is created. */
146
+ /** One-shot generator descriptor; no persisted Target is created. */
110
147
  target: {
111
148
  generator: GeneratorKind | (string & {});
112
149
  };
@@ -116,10 +153,11 @@ export interface GenerateRequestRead {
116
153
  */
117
154
  package_name?: string;
118
155
  /**
119
- * Go module path override. Valid only for the Go SDK. Linked projects derive this from the Go
120
- * destination repository by default.
156
+ * 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.
121
158
  */
122
159
  module_path?: string;
160
+ go_sdk?: GoSdkDescriptor;
123
161
  config?: ConfigRead;
124
162
  }
125
163
 
@@ -127,6 +165,23 @@ export interface GeneratedFile {
127
165
  /** Repo-relative path inside the generated package. */
128
166
  path: string;
129
167
  content: string;
168
+ /**
169
+ * Exact Git file mode. Omitted one-shot outputs are regular files.
170
+ * Default: "100644"
171
+ */
172
+ mode?: "100644" | "100755";
173
+ }
174
+
175
+ /** Response shape for GeneratedFile. */
176
+ export interface GeneratedFileRead {
177
+ /** Repo-relative path inside the generated package. */
178
+ path: string;
179
+ content: string;
180
+ /**
181
+ * Exact Git file mode. Omitted one-shot outputs are regular files.
182
+ * Default: "100644"
183
+ */
184
+ mode?: ("100644" | "100755") | (string & {});
130
185
  }
131
186
 
132
187
  export interface GenerationMeta {
@@ -148,6 +203,18 @@ export interface GenerationMeta {
148
203
  * Generation.
149
204
  */
150
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
+ };
151
218
  resource_count?: number;
152
219
  operation_count?: number;
153
220
  schema_count?: number;
@@ -164,11 +231,6 @@ export interface GenerationMeta {
164
231
  * matched, or could not be opened.
165
232
  */
166
233
  pr_status?: "opened" | "no_changes" | "blocked";
167
- /**
168
- * Why the configured destination pull request was not opened. Generation itself still succeeded;
169
- * fix this action and regenerate.
170
- */
171
- pr_error?: string;
172
234
  /**
173
235
  * Markdown changelog entry for this regeneration, from the API surface diff. Absent on a first
174
236
  * generation or when nothing changed.
@@ -180,10 +242,10 @@ export interface GenerationMeta {
180
242
  */
181
243
  breaking_count?: number;
182
244
  /**
183
- * What the diff was measured against; "destination" means the .typeship/surface.json merged in
184
- * the destination repository.
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.
185
247
  */
186
- baseline?: "destination" | "none";
248
+ baseline?: "destination" | "last-generation" | "none";
187
249
  /** Objective compatibility of the generated API surface against the merged destination baseline. */
188
250
  api_compatibility?: "compatible" | "breaking" | "unknown";
189
251
  /**
@@ -200,11 +262,23 @@ export interface GenerationMeta {
200
262
  * The destination pull request's combined readiness decision for the exact bot-generated head.
201
263
  * Compatibility and version correctness remain separate fields above.
202
264
  */
203
- release_readiness?: "success" | "failure" | "error";
265
+ release_readiness?: "success" | "failure" | "pending" | "error";
204
266
  /** The release-readiness decision in one line, as the commit status describes it. */
205
267
  release_readiness_note?: string;
206
268
  /** The package version the destination had before this regeneration. */
207
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;
208
282
  file_count?: number;
209
283
  total_lines?: number;
210
284
  /** Deterministic Diagnostic summary for the exact Definition Revision consumed. */
@@ -234,6 +308,18 @@ export interface GenerationMetaRead {
234
308
  * Generation.
235
309
  */
236
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
+ };
237
323
  resource_count?: number;
238
324
  operation_count?: number;
239
325
  schema_count?: number;
@@ -250,11 +336,6 @@ export interface GenerationMetaRead {
250
336
  * matched, or could not be opened.
251
337
  */
252
338
  pr_status?: ("opened" | "no_changes" | "blocked") | (string & {});
253
- /**
254
- * Why the configured destination pull request was not opened. Generation itself still succeeded;
255
- * fix this action and regenerate.
256
- */
257
- pr_error?: string;
258
339
  /**
259
340
  * Markdown changelog entry for this regeneration, from the API surface diff. Absent on a first
260
341
  * generation or when nothing changed.
@@ -266,10 +347,10 @@ export interface GenerationMetaRead {
266
347
  */
267
348
  breaking_count?: number;
268
349
  /**
269
- * What the diff was measured against; "destination" means the .typeship/surface.json merged in
270
- * the destination repository.
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.
271
352
  */
272
- baseline?: ("destination" | "none") | (string & {});
353
+ baseline?: ("destination" | "last-generation" | "none") | (string & {});
273
354
  /** Objective compatibility of the generated API surface against the merged destination baseline. */
274
355
  api_compatibility?: ("compatible" | "breaking" | "unknown") | (string & {});
275
356
  /**
@@ -286,11 +367,23 @@ export interface GenerationMetaRead {
286
367
  * The destination pull request's combined readiness decision for the exact bot-generated head.
287
368
  * Compatibility and version correctness remain separate fields above.
288
369
  */
289
- release_readiness?: ("success" | "failure" | "error") | (string & {});
370
+ release_readiness?: ("success" | "failure" | "pending" | "error") | (string & {});
290
371
  /** The release-readiness decision in one line, as the commit status describes it. */
291
372
  release_readiness_note?: string;
292
373
  /** The package version the destination had before this regeneration. */
293
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;
294
387
  file_count?: number;
295
388
  total_lines?: number;
296
389
  /** Deterministic Diagnostic summary for the exact Definition Revision consumed. */
@@ -302,6 +395,7 @@ export interface GenerationMetaRead {
302
395
 
303
396
  export interface GenerationResult {
304
397
  files: GeneratedFile[];
398
+ download?: GenerationDownload;
305
399
  warnings: string[];
306
400
  meta: GenerationMeta;
307
401
  limits?: GenerationLimits;
@@ -321,7 +415,8 @@ export interface GenerationResult {
321
415
 
322
416
  /** Response shape for GenerationResult. */
323
417
  export interface GenerationResultRead {
324
- files: GeneratedFile[];
418
+ files: GeneratedFileRead[];
419
+ download?: GenerationDownload;
325
420
  warnings: string[];
326
421
  meta: GenerationMetaRead;
327
422
  limits?: GenerationLimitsRead;
@@ -339,6 +434,23 @@ export interface GenerationResultRead {
339
434
  request_id: RequestId;
340
435
  }
341
436
 
437
+ /**
438
+ * Complete package ZIP from this exact result. Present on requests with Idempotency-Key, including
439
+ * automatic CLI, MCP, and SDK keys. Download before expires_at, verify sha256, and extract into an
440
+ * empty directory. Anyone with this URL can download the package; keep it private. Reading does not
441
+ * generate again or extend the 24-hour replay window.
442
+ */
443
+ export interface GenerationDownload {
444
+ /** Format: uri */
445
+ url: string;
446
+ /** Format: date-time */
447
+ expires_at: string;
448
+ /** SHA-256 of the downloaded ZIP bytes. */
449
+ sha256: string;
450
+ size_bytes: number;
451
+ file_count: number;
452
+ }
453
+
342
454
  /**
343
455
  * Present when the generation was capped: by the free plan, or because the call was anonymous.
344
456
  * Absent on uncapped generations.
@@ -426,7 +538,7 @@ export interface RepositoryReferenceRead {
426
538
 
427
539
  export interface RepositoryDefinitionSource {
428
540
  kind: "repository";
429
- repository: RepositoryReference;
541
+ repository: RepositoryReferenceResponse;
430
542
  /** Repository-relative Definition entrypoint. */
431
543
  path: string;
432
544
  }
@@ -434,7 +546,7 @@ export interface RepositoryDefinitionSource {
434
546
  /** Response shape for RepositoryDefinitionSource. */
435
547
  export interface RepositoryDefinitionSourceRead {
436
548
  kind: "repository" | (string & {});
437
- repository: RepositoryReferenceRead;
549
+ repository: RepositoryReferenceResponseRead;
438
550
  /** Repository-relative Definition entrypoint. */
439
551
  path: string;
440
552
  }
@@ -558,7 +670,7 @@ export interface DiagnosticFix {
558
670
  */
559
671
  kind: "spec_patch" | "source_edit";
560
672
  /** Exact patches when kind is spec_patch. */
561
- patches?: DefinitionPatch[];
673
+ patches?: DefinitionPatchResponse[];
562
674
  /** Source-level guidance when an exact patch would invent intent. */
563
675
  instructions?: string;
564
676
  }
@@ -573,7 +685,7 @@ export interface DiagnosticFixRead {
573
685
  */
574
686
  kind: ("spec_patch" | "source_edit") | (string & {});
575
687
  /** Exact patches when kind is spec_patch. */
576
- patches?: DefinitionPatchRead[];
688
+ patches?: DefinitionPatchResponseRead[];
577
689
  /** Source-level guidance when an exact patch would invent intent. */
578
690
  instructions?: string;
579
691
  }
@@ -590,7 +702,7 @@ export interface Diagnostic {
590
702
  title: string;
591
703
  /** What the API author should change. */
592
704
  description: string;
593
- /** Why consumers of generated SDK, CLI, or MCP surfaces care. */
705
+ /** Why consumers of generated CLI, MCP, or SDK surfaces care. */
594
706
  impact: string;
595
707
  /** Public surfaces affected by the root cause. */
596
708
  surfaces: Array<"api" | "sdk" | "cli" | "mcp">;
@@ -601,7 +713,7 @@ export interface Diagnostic {
601
713
  evidence_basis: "contract" | "heuristic" | "implementation";
602
714
  /** Whether remediation requires intent that the Definition cannot prove. */
603
715
  owner_decision_required: boolean;
604
- /** Concrete generated SDK, CLI, or MCP naming effect when Typeship can state it. */
716
+ /** Concrete generated CLI, MCP, or SDK naming effect when Typeship can state it. */
605
717
  surface_impact?: string;
606
718
  /** All affected coordinates, kept under one grouped diagnostic. */
607
719
  locations: DiagnosticLocation[];
@@ -625,7 +737,7 @@ export interface DiagnosticRead {
625
737
  title: string;
626
738
  /** What the API author should change. */
627
739
  description: string;
628
- /** Why consumers of generated SDK, CLI, or MCP surfaces care. */
740
+ /** Why consumers of generated CLI, MCP, or SDK surfaces care. */
629
741
  impact: string;
630
742
  /** Public surfaces affected by the root cause. */
631
743
  surfaces: Array<("api" | "sdk" | "cli" | "mcp") | (string & {})>;
@@ -636,7 +748,7 @@ export interface DiagnosticRead {
636
748
  evidence_basis: ("contract" | "heuristic" | "implementation") | (string & {});
637
749
  /** Whether remediation requires intent that the Definition cannot prove. */
638
750
  owner_decision_required: boolean;
639
- /** Concrete generated SDK, CLI, or MCP naming effect when Typeship can state it. */
751
+ /** Concrete generated CLI, MCP, or SDK naming effect when Typeship can state it. */
640
752
  surface_impact?: string;
641
753
  /** All affected coordinates, kept under one grouped diagnostic. */
642
754
  locations: DiagnosticLocation[];
@@ -737,7 +849,7 @@ export interface DiagnosticSuppressionSignal {
737
849
  export interface DiagnosticQualitySignals {
738
850
  suppressed_by_rule: DiagnosticSuppressionSignal[];
739
851
  /** Reviewed exceptions whose rule or exact path no longer matches this revision. */
740
- stale_suppressions: DiagnosticSuppression[];
852
+ stale_suppressions: DiagnosticSuppressionResponse[];
741
853
  }
742
854
 
743
855
  /** Compact rule and location reference; full guidance appears once in diagnostics. */
@@ -788,7 +900,7 @@ export interface DiagnosticReport {
788
900
  summary: DiagnosticSummary;
789
901
  /** Stable grouped diagnostics, ordered by severity and rule identifier. */
790
902
  diagnostics: Diagnostic[];
791
- policy: DiagnosticPolicy;
903
+ policy: DiagnosticPolicyResponse;
792
904
  evaluation: DiagnosticEvaluation;
793
905
  quality_signals: DiagnosticQualitySignals;
794
906
  delta: DiagnosticDelta;
@@ -811,7 +923,7 @@ export interface DiagnosticReportRead {
811
923
  summary: DiagnosticSummary;
812
924
  /** Stable grouped diagnostics, ordered by severity and rule identifier. */
813
925
  diagnostics: DiagnosticRead[];
814
- policy: DiagnosticPolicyRead;
926
+ policy: DiagnosticPolicyResponseRead;
815
927
  evaluation: DiagnosticEvaluationRead;
816
928
  quality_signals: DiagnosticQualitySignals;
817
929
  delta: DiagnosticDeltaRead;
@@ -854,7 +966,7 @@ export interface RepositoryDeliveryInput {
854
966
  directory?: string | null;
855
967
  /** npm or Python registry identity where applicable. */
856
968
  package_name?: string | null;
857
- /** Explicit Go module path where applicable. */
969
+ /** Go module identity for the Go SDK or Go CLI Target where applicable. */
858
970
  module_path?: string | null;
859
971
  /**
860
972
  * Commit repository-owned registry automation and report publication after the Draft merges.
@@ -870,7 +982,7 @@ export interface RepositoryDeliveryInputRead {
870
982
  directory?: string | null;
871
983
  /** npm or Python registry identity where applicable. */
872
984
  package_name?: string | null;
873
- /** Explicit Go module path where applicable. */
985
+ /** Go module identity for the Go SDK or Go CLI Target where applicable. */
874
986
  module_path?: string | null;
875
987
  /**
876
988
  * Commit repository-owned registry automation and report publication after the Draft merges.
@@ -901,7 +1013,7 @@ export interface RepositoryDelivery {
901
1013
  target_id: TargetId;
902
1014
  kind: "repository";
903
1015
  state: "active" | "disabled";
904
- repository: RepositoryReference;
1016
+ repository: RepositoryReferenceResponse;
905
1017
  directory: string | null;
906
1018
  package_name: string | null;
907
1019
  module_path: string | null;
@@ -919,7 +1031,7 @@ export interface RepositoryDeliveryRead {
919
1031
  target_id: TargetId;
920
1032
  kind: "repository" | (string & {});
921
1033
  state: ("active" | "disabled") | (string & {});
922
- repository: RepositoryReferenceRead;
1034
+ repository: RepositoryReferenceResponseRead;
923
1035
  directory: string | null;
924
1036
  package_name: string | null;
925
1037
  module_path: string | null;
@@ -966,6 +1078,94 @@ export type DeliveryRead = RepositoryDeliveryRead
966
1078
  | HostedMcpDeliveryRead
967
1079
  | Record<string, unknown> & { kind?: string };
968
1080
 
1081
+ /**
1082
+ * Repository fields are present for a repository Delivery; url is present for a hosted_mcp
1083
+ * Delivery.
1084
+ */
1085
+ export interface DeliveryResponse {
1086
+ id: DeliveryId;
1087
+ object: "delivery";
1088
+ 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;
1098
+ /** Format: date-time */
1099
+ created_at: string;
1100
+ /** Format: date-time */
1101
+ updated_at: string;
1102
+ request_id: RequestId;
1103
+ }
1104
+
1105
+ /** Response shape for DeliveryResponse. */
1106
+ export interface DeliveryResponseRead {
1107
+ id: DeliveryId;
1108
+ object: "delivery" | (string & {});
1109
+ 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;
1119
+ /** Format: date-time */
1120
+ created_at: string;
1121
+ /** Format: date-time */
1122
+ updated_at: string;
1123
+ request_id: RequestId;
1124
+ }
1125
+
1126
+ /**
1127
+ * One Target generated from a sibling Target. A go-cli Target carries kind go_sdk_module, naming
1128
+ * the Go SDK Target it is generated against.
1129
+ */
1130
+ export interface TargetDependency {
1131
+ kind: "go_sdk_module";
1132
+ target_id: TargetId;
1133
+ }
1134
+
1135
+ /** Response shape for TargetDependency. */
1136
+ export interface TargetDependencyRead {
1137
+ kind: "go_sdk_module" | (string & {});
1138
+ target_id: TargetId;
1139
+ }
1140
+
1141
+ /**
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.
1147
+ */
1148
+ export interface TargetChecks {
1149
+ /** Default: ["build","package","public_entrypoint"] */
1150
+ generated?: Array<"build" | "package" | "public_entrypoint">;
1151
+ repository_required?: string[];
1152
+ customer?: Array<{
1153
+ name: string;
1154
+ command: string;
1155
+ }>;
1156
+ }
1157
+
1158
+ /** Response shape for TargetChecks. */
1159
+ export interface TargetChecksRead {
1160
+ /** Default: ["build","package","public_entrypoint"] */
1161
+ generated?: Array<("build" | "package" | "public_entrypoint") | (string & {})>;
1162
+ repository_required?: string[];
1163
+ customer?: Array<{
1164
+ name: string;
1165
+ command: string;
1166
+ }>;
1167
+ }
1168
+
969
1169
  export interface TargetFields {
970
1170
  name: string;
971
1171
  definition_id: DefinitionId;
@@ -978,6 +1178,7 @@ export interface TargetFields {
978
1178
  release_channel?: "stable" | "prerelease";
979
1179
  /** Optional larger or prerelease SemVer for the next reviewed release. */
980
1180
  proposed_version?: string | null;
1181
+ checks?: TargetChecks;
981
1182
  /**
982
1183
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
983
1184
  * belong to the Definition.
@@ -999,6 +1200,7 @@ export interface TargetFieldsRead {
999
1200
  release_channel?: ("stable" | "prerelease") | (string & {});
1000
1201
  /** Optional larger or prerelease SemVer for the next reviewed release. */
1001
1202
  proposed_version?: string | null;
1203
+ checks?: TargetChecksRead;
1002
1204
  /**
1003
1205
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
1004
1206
  * belong to the Definition.
@@ -1017,6 +1219,7 @@ export interface InitialTargetFields {
1017
1219
  /** Default: "stable" */
1018
1220
  release_channel?: "stable" | "prerelease";
1019
1221
  proposed_version?: string | null;
1222
+ checks?: TargetChecks;
1020
1223
  /**
1021
1224
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
1022
1225
  * belong to the Definition.
@@ -1036,6 +1239,7 @@ export interface InitialTargetFieldsRead {
1036
1239
  /** Default: "stable" */
1037
1240
  release_channel?: ("stable" | "prerelease") | (string & {});
1038
1241
  proposed_version?: string | null;
1242
+ checks?: TargetChecksRead;
1039
1243
  /**
1040
1244
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
1041
1245
  * belong to the Definition.
@@ -1049,12 +1253,25 @@ export interface TargetUpdateRequest {
1049
1253
  state?: "active" | "disabled";
1050
1254
  edition?: string;
1051
1255
  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
+ */
1052
1260
  proposed_version?: string | null;
1261
+ checks?: TargetChecks;
1053
1262
  /**
1054
- * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
1055
- * belong to the Definition.
1263
+ * 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.
1056
1266
  */
1057
1267
  config?: TargetConfig | null;
1268
+ /**
1269
+ * Replaces the Delivery set; include each kind you want to keep. Retained kinds preserve their
1270
+ * ID, creation time, and hosted URL. Each supplied Delivery replaces its configuration, so
1271
+ * omitted optional settings reset to their defaults. Omit deliveries to keep the existing set, or
1272
+ * send [] to remove all Deliveries. Removing and later recreating a kind allocates a new ID and,
1273
+ * for hosted_mcp, a new URL.
1274
+ */
1058
1275
  deliveries?: DeliveryInput[];
1059
1276
  }
1060
1277
 
@@ -1064,16 +1281,71 @@ export interface TargetUpdateRequestRead {
1064
1281
  state?: ("active" | "disabled") | (string & {});
1065
1282
  edition?: string;
1066
1283
  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
+ */
1067
1288
  proposed_version?: string | null;
1289
+ checks?: TargetChecksRead;
1068
1290
  /**
1069
- * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
1070
- * belong to the Definition.
1291
+ * 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.
1071
1294
  */
1072
1295
  config?: TargetConfigRead | null;
1296
+ /**
1297
+ * Replaces the Delivery set; include each kind you want to keep. Retained kinds preserve their
1298
+ * ID, creation time, and hosted URL. Each supplied Delivery replaces its configuration, so
1299
+ * omitted optional settings reset to their defaults. Omit deliveries to keep the existing set, or
1300
+ * send [] to remove all Deliveries. Removing and later recreating a kind allocates a new ID and,
1301
+ * for hosted_mcp, a new URL.
1302
+ */
1073
1303
  deliveries?: DeliveryInputRead[];
1074
1304
  }
1075
1305
 
1076
1306
  export interface Target {
1307
+ id: TargetId;
1308
+ object: "target";
1309
+ project_id: ProjectId;
1310
+ definition_id: DefinitionId;
1311
+ name: string;
1312
+ generator: GeneratorKind;
1313
+ /**
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.
1316
+ */
1317
+ dependency: TargetDependency | null;
1318
+ state: "active" | "disabled";
1319
+ edition: string;
1320
+ release_channel: "stable" | "prerelease";
1321
+ version_policy: {
1322
+ mode: "reviewed_semver";
1323
+ pre1_breaking: "minor";
1324
+ };
1325
+ /**
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.
1328
+ */
1329
+ current_version: string | null;
1330
+ proposed_version: string | null;
1331
+ proposed_version_source: "console" | "api" | "github" | null;
1332
+ checks: TargetChecksResponse;
1333
+ /**
1334
+ * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
1335
+ * never appear here.
1336
+ */
1337
+ config: TargetConfigResponse | null;
1338
+ /** At most one repository and one hosted MCP Delivery. */
1339
+ deliveries: Delivery[];
1340
+ /** Format: date-time */
1341
+ created_at: string;
1342
+ /** Format: date-time */
1343
+ updated_at: string;
1344
+ request_id?: RequestId;
1345
+ }
1346
+
1347
+ /** Request shape for Target. */
1348
+ export interface TargetWrite {
1077
1349
  id: TargetId;
1078
1350
  object: "target";
1079
1351
  project_id: ProjectId;
@@ -1088,21 +1360,18 @@ export interface Target {
1088
1360
  pre1_breaking: "minor";
1089
1361
  };
1090
1362
  /**
1091
- * Deprecated projection of the newest immutable Target Release; null until a release becomes
1092
- * Current.
1093
- * @deprecated
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.
1094
1365
  */
1095
1366
  current_version: string | null;
1096
1367
  proposed_version: string | null;
1097
1368
  proposed_version_source: "console" | "api" | "github" | null;
1098
- proposed_version_actor: string | null;
1099
- /** Optimistic concurrency revision for Draft selections. */
1100
- release_revision: number;
1369
+ checks: TargetChecksResponse;
1101
1370
  /**
1102
1371
  * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
1103
1372
  * never appear here.
1104
1373
  */
1105
- config: TargetConfig | null;
1374
+ config: TargetConfigResponse | null;
1106
1375
  /** At most one repository and one hosted MCP Delivery. */
1107
1376
  deliveries: Delivery[];
1108
1377
  /** Format: date-time */
@@ -1120,6 +1389,11 @@ export interface TargetRead {
1120
1389
  definition_id: DefinitionId;
1121
1390
  name: string;
1122
1391
  generator: GeneratorKind | (string & {});
1392
+ /**
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.
1395
+ */
1396
+ dependency: TargetDependencyRead | null;
1123
1397
  state: ("active" | "disabled") | (string & {});
1124
1398
  edition: string;
1125
1399
  release_channel: ("stable" | "prerelease") | (string & {});
@@ -1128,21 +1402,18 @@ export interface TargetRead {
1128
1402
  pre1_breaking: "minor" | (string & {});
1129
1403
  };
1130
1404
  /**
1131
- * Deprecated projection of the newest immutable Target Release; null until a release becomes
1132
- * Current.
1133
- * @deprecated
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.
1134
1407
  */
1135
1408
  current_version: string | null;
1136
1409
  proposed_version: string | null;
1137
1410
  proposed_version_source: ("console" | "api" | "github" | null) | (string & {}) | null;
1138
- proposed_version_actor: string | null;
1139
- /** Optimistic concurrency revision for Draft selections. */
1140
- release_revision: number;
1411
+ checks: TargetChecksResponseRead;
1141
1412
  /**
1142
1413
  * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
1143
1414
  * never appear here.
1144
1415
  */
1145
- config: TargetConfigRead | null;
1416
+ config: TargetConfigResponseRead | null;
1146
1417
  /** At most one repository and one hosted MCP Delivery. */
1147
1418
  deliveries: DeliveryRead[];
1148
1419
  /** Format: date-time */
@@ -1154,6 +1425,9 @@ export interface TargetRead {
1154
1425
 
1155
1426
  export type TargetResponse = Target & ResponseMetadata;
1156
1427
 
1428
+ /** Request shape for TargetResponse. */
1429
+ export type TargetResponseWrite = TargetWrite & ResponseMetadata;
1430
+
1157
1431
  /** Response shape for TargetResponse. */
1158
1432
  export type TargetResponseRead = TargetRead & ResponseMetadata;
1159
1433
 
@@ -1165,6 +1439,15 @@ export interface TargetList {
1165
1439
  request_id: RequestId;
1166
1440
  }
1167
1441
 
1442
+ /** Request shape for TargetList. */
1443
+ export interface TargetListWrite {
1444
+ object: ListObject;
1445
+ data: TargetWrite[];
1446
+ has_more: boolean;
1447
+ next_cursor: string | null;
1448
+ request_id: RequestId;
1449
+ }
1450
+
1168
1451
  /** Response shape for TargetList. */
1169
1452
  export interface TargetListRead {
1170
1453
  object: ListObject;
@@ -1186,10 +1469,14 @@ export interface TargetRelease {
1186
1469
  channel: "stable" | "prerelease";
1187
1470
  /** Delivery provider that accepted the release. */
1188
1471
  provider: string;
1189
- repository: RepositoryReference | null;
1472
+ repository: RepositoryReferenceResponse | null;
1190
1473
  definition_revision_id: DefinitionRevisionId | null;
1191
1474
  /** Immutable provider-native revision that was merged or published. */
1192
1475
  delivery_revision: string;
1476
+ /** Digest of the exact accepted source tree used for publication. */
1477
+ source_digest: string | null;
1478
+ checks: PackageCheck[];
1479
+ accepted_risks: AcceptedCompatibilityRisk[];
1193
1480
  import_provenance: {
1194
1481
  tag: string | null;
1195
1482
  /** Format: uri */
@@ -1218,10 +1505,14 @@ export interface TargetReleaseRead {
1218
1505
  channel: ("stable" | "prerelease") | (string & {});
1219
1506
  /** Delivery provider that accepted the release. */
1220
1507
  provider: string;
1221
- repository: RepositoryReferenceRead | null;
1508
+ repository: RepositoryReferenceResponseRead | null;
1222
1509
  definition_revision_id: DefinitionRevisionId | null;
1223
1510
  /** Immutable provider-native revision that was merged or published. */
1224
1511
  delivery_revision: string;
1512
+ /** Digest of the exact accepted source tree used for publication. */
1513
+ source_digest: string | null;
1514
+ checks: PackageCheckRead[];
1515
+ accepted_risks: AcceptedCompatibilityRiskRead[];
1225
1516
  import_provenance: {
1226
1517
  tag: string | null;
1227
1518
  /** Format: uri */
@@ -1264,14 +1555,15 @@ export interface Publication {
1264
1555
  object: "publication";
1265
1556
  target_release_id: TargetReleaseId;
1266
1557
  destination: "github" | "npm" | "pypi" | "go" | "mcp";
1267
- state: "pending" | "publishing" | "published" | "failed";
1558
+ state: "pending" | "publishing" | "published" | "failed" | "disabled";
1268
1559
  attempt: number;
1269
1560
  /** Format: uri */
1270
1561
  run_url: string | null;
1271
1562
  /** Format: uri */
1272
1563
  registry_url: string | null;
1273
1564
  artifact_digest: string | null;
1274
- error: string | null;
1565
+ /** Recorded failures. Empty when this resource has no recorded failure. */
1566
+ errors: DomainError[];
1275
1567
  /** Format: date-time */
1276
1568
  started_at: string | null;
1277
1569
  /** Format: date-time */
@@ -1286,14 +1578,15 @@ export interface PublicationRead {
1286
1578
  object: "publication" | (string & {});
1287
1579
  target_release_id: TargetReleaseId;
1288
1580
  destination: ("github" | "npm" | "pypi" | "go" | "mcp") | (string & {});
1289
- state: ("pending" | "publishing" | "published" | "failed") | (string & {});
1581
+ state: ("pending" | "publishing" | "published" | "failed" | "disabled") | (string & {});
1290
1582
  attempt: number;
1291
1583
  /** Format: uri */
1292
1584
  run_url: string | null;
1293
1585
  /** Format: uri */
1294
1586
  registry_url: string | null;
1295
1587
  artifact_digest: string | null;
1296
- error: string | null;
1588
+ /** Recorded failures. Empty when this resource has no recorded failure. */
1589
+ errors: DomainErrorRead[];
1297
1590
  /** Format: date-time */
1298
1591
  started_at: string | null;
1299
1592
  /** Format: date-time */
@@ -1302,14 +1595,25 @@ export interface PublicationRead {
1302
1595
  updated_at: string;
1303
1596
  }
1304
1597
 
1598
+ export type PublicationResponse = Publication & {
1599
+ /** Format: date-time */
1600
+ created_at: string;
1601
+ } & ResponseMetadata;
1602
+
1603
+ /** Response shape for PublicationResponse. */
1604
+ export type PublicationResponseRead = PublicationRead & {
1605
+ /** Format: date-time */
1606
+ created_at: string;
1607
+ } & ResponseMetadata;
1608
+
1305
1609
  export type TargetDraftSelection = {
1306
1610
  mode: "automatic";
1307
1611
  }
1308
1612
  | {
1309
1613
  mode: "exact";
1310
1614
  version: string;
1615
+ /** Where the selection was made. */
1311
1616
  source: "console" | "api" | "github" | null;
1312
- actor: string | null;
1313
1617
  };
1314
1618
 
1315
1619
  /** Response shape for TargetDraftSelection. */
@@ -1319,18 +1623,118 @@ export type TargetDraftSelectionRead = {
1319
1623
  | {
1320
1624
  mode: "exact" | (string & {});
1321
1625
  version: string;
1626
+ /** Where the selection was made. */
1322
1627
  source: ("console" | "api" | "github" | null) | (string & {}) | null;
1323
- actor: string | null;
1324
1628
  };
1325
1629
 
1630
+ /**
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.
1643
+ */
1644
+ 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",
1653
+ READY: "ready",
1654
+ } as const;
1655
+ export type DraftStatus = (typeof DraftStatus)[keyof typeof DraftStatus];
1656
+
1657
+ export interface TargetDraftConflicts {
1658
+ /** Conflicts in the current merge stage. */
1659
+ total: number;
1660
+ /** Conflicts with a saved decision for head_revision. */
1661
+ decided: number;
1662
+ }
1663
+
1664
+ /** 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;
1670
+ /** Existing Draft branch that stays available after recovery opens a new Draft. */
1671
+ preserved_branch: string | null;
1672
+ }
1673
+
1674
+ /**
1675
+ * Readiness decision for the Draft's head_revision. Null readiness on the Draft means no candidate
1676
+ * exists.
1677
+ */
1678
+ export interface TargetDraftReadiness {
1679
+ /**
1680
+ * success means required checks passed; failure means the Draft needs correction or review; error
1681
+ * means assessment could not finish; pending means checks have not finished.
1682
+ */
1683
+ state: "success" | "failure" | "error" | "pending";
1684
+ /** Human-readable explanation of the current decision. Do not parse it for control flow. */
1685
+ description: string;
1686
+ /** API surface comparison against Current. unknown means analysis is unavailable. */
1687
+ api_compatibility: "compatible" | "breaking" | "unknown";
1688
+ /**
1689
+ * Package and supported SDK source comparison against Current. unknown means analysis is
1690
+ * incomplete or unavailable.
1691
+ */
1692
+ package_compatibility: "compatible" | "breaking" | "unknown";
1693
+ /** Whether the version satisfies the assessed change. Null when no verdict is available. */
1694
+ 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;
1699
+ /** Draft title error that must be corrected before release. Null when none is recorded. */
1700
+ title_error: string | null;
1701
+ }
1702
+
1703
+ /** Response shape for TargetDraftReadiness. */
1704
+ export interface TargetDraftReadinessRead {
1705
+ /**
1706
+ * success means required checks passed; failure means the Draft needs correction or review; error
1707
+ * means assessment could not finish; pending means checks have not finished.
1708
+ */
1709
+ state: ("success" | "failure" | "error" | "pending") | (string & {});
1710
+ /** Human-readable explanation of the current decision. Do not parse it for control flow. */
1711
+ description: string;
1712
+ /** API surface comparison against Current. unknown means analysis is unavailable. */
1713
+ api_compatibility: ("compatible" | "breaking" | "unknown") | (string & {});
1714
+ /**
1715
+ * Package and supported SDK source comparison against Current. unknown means analysis is
1716
+ * incomplete or unavailable.
1717
+ */
1718
+ package_compatibility: ("compatible" | "breaking" | "unknown") | (string & {});
1719
+ /** Whether the version satisfies the assessed change. Null when no verdict is available. */
1720
+ 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;
1725
+ /** Draft title error that must be corrected before release. Null when none is recorded. */
1726
+ title_error: string | null;
1727
+ }
1728
+
1326
1729
  export interface TargetDraft {
1327
1730
  object: "target_draft";
1328
1731
  target_id: TargetId;
1329
- revision: number;
1732
+ project_id: ProjectId;
1733
+ status: DraftStatus;
1330
1734
  current_version: string | null;
1331
1735
  version: string | null;
1332
1736
  selection: TargetDraftSelection;
1333
- readiness: Record<string, unknown> | null;
1737
+ readiness: TargetDraftReadiness | null;
1334
1738
  changes: {
1335
1739
  /** Cumulative changelog against Current. */
1336
1740
  changelog?: string | null;
@@ -1338,21 +1742,38 @@ export interface TargetDraft {
1338
1742
  previous_version?: string | null;
1339
1743
  }
1340
1744
  | null;
1745
+ /**
1746
+ * Draft commit that readiness, checks, and conflicts describe. Send it as expected_head_revision
1747
+ * when resolving or discarding.
1748
+ */
1341
1749
  head_revision: string | null;
1342
1750
  /** Format: uri */
1343
1751
  pull_request_url: string | null;
1752
+ /** Generation whose package this Draft contains. */
1753
+ generation_id: GenerationId | null;
1754
+ /** Conflict counts for the current merge stage; null when the Draft has no conflicts. */
1755
+ conflicts: TargetDraftConflicts | null;
1756
+ /**
1757
+ * Files where the Draft differs from the last accepted package; null until the Draft is
1758
+ * integrated.
1759
+ */
1760
+ customized_files: number | null;
1761
+ /** Present only while status is history_rewritten. */
1762
+ history_recovery: TargetDraftHistoryRecovery | null;
1344
1763
  request_id?: RequestId;
1764
+ checks: PackageCheck[];
1345
1765
  }
1346
1766
 
1347
1767
  /** Response shape for TargetDraft. */
1348
1768
  export interface TargetDraftRead {
1349
1769
  object: "target_draft" | (string & {});
1350
1770
  target_id: TargetId;
1351
- revision: number;
1771
+ project_id: ProjectId;
1772
+ status: DraftStatus | (string & {});
1352
1773
  current_version: string | null;
1353
1774
  version: string | null;
1354
1775
  selection: TargetDraftSelectionRead;
1355
- readiness: Record<string, unknown> | null;
1776
+ readiness: TargetDraftReadinessRead | null;
1356
1777
  changes: {
1357
1778
  /** Cumulative changelog against Current. */
1358
1779
  changelog?: string | null;
@@ -1360,10 +1781,26 @@ export interface TargetDraftRead {
1360
1781
  previous_version?: string | null;
1361
1782
  }
1362
1783
  | null;
1784
+ /**
1785
+ * Draft commit that readiness, checks, and conflicts describe. Send it as expected_head_revision
1786
+ * when resolving or discarding.
1787
+ */
1363
1788
  head_revision: string | null;
1364
1789
  /** Format: uri */
1365
1790
  pull_request_url: string | null;
1791
+ /** Generation whose package this Draft contains. */
1792
+ generation_id: GenerationId | null;
1793
+ /** Conflict counts for the current merge stage; null when the Draft has no conflicts. */
1794
+ conflicts: TargetDraftConflicts | null;
1795
+ /**
1796
+ * Files where the Draft differs from the last accepted package; null until the Draft is
1797
+ * integrated.
1798
+ */
1799
+ customized_files: number | null;
1800
+ /** Present only while status is history_rewritten. */
1801
+ history_recovery: TargetDraftHistoryRecovery | null;
1366
1802
  request_id?: RequestId;
1803
+ checks: PackageCheckRead[];
1367
1804
  }
1368
1805
 
1369
1806
  export type TargetDraftResponse = TargetDraft & ResponseMetadata;
@@ -1374,7 +1811,52 @@ export type TargetDraftResponseRead = TargetDraftRead & ResponseMetadata;
1374
1811
  export interface TargetDraftUpdate {
1375
1812
  /** Exact SemVer, or null to return to automatic selection. */
1376
1813
  version: string | null;
1377
- expected_revision?: number;
1814
+ }
1815
+
1816
+ export interface PackageCheck {
1817
+ name: string;
1818
+ source: "typeship" | "customer" | "repository" | "compatibility";
1819
+ required: boolean;
1820
+ state: "pending" | "passed" | "failed" | "not_assessed";
1821
+ reason: string;
1822
+ revision: string;
1823
+ /** Format: uri */
1824
+ url: string | null;
1825
+ /** Format: date-time */
1826
+ observed_at: string | null;
1827
+ }
1828
+
1829
+ /** Response shape for PackageCheck. */
1830
+ export interface PackageCheckRead {
1831
+ name: string;
1832
+ source: ("typeship" | "customer" | "repository" | "compatibility") | (string & {});
1833
+ required: boolean;
1834
+ state: ("pending" | "passed" | "failed" | "not_assessed") | (string & {});
1835
+ reason: string;
1836
+ revision: string;
1837
+ /** Format: uri */
1838
+ url: string | null;
1839
+ /** Format: date-time */
1840
+ observed_at: string | null;
1841
+ }
1842
+
1843
+ export interface AcceptedCompatibilityRisk {
1844
+ comparison: "current" | "published";
1845
+ reason: string;
1846
+ approved_by: string;
1847
+ approved_revision: string;
1848
+ /** Format: date-time */
1849
+ approved_at: string;
1850
+ }
1851
+
1852
+ /** Response shape for AcceptedCompatibilityRisk. */
1853
+ export interface AcceptedCompatibilityRiskRead {
1854
+ comparison: ("current" | "published") | (string & {});
1855
+ reason: string;
1856
+ approved_by: string;
1857
+ approved_revision: string;
1858
+ /** Format: date-time */
1859
+ approved_at: string;
1378
1860
  }
1379
1861
 
1380
1862
  export interface TargetAdoption {
@@ -1406,7 +1888,7 @@ export interface RepositoryHealthIssueRead {
1406
1888
  }
1407
1889
 
1408
1890
  export interface RepositoryHealth {
1409
- repository: RepositoryReference;
1891
+ repository: RepositoryReferenceResponse;
1410
1892
  roles: Array<"source" | "destination">;
1411
1893
  status: "ready" | "action_required";
1412
1894
  default_branch?: string;
@@ -1422,7 +1904,7 @@ export interface RepositoryHealth {
1422
1904
 
1423
1905
  /** Response shape for RepositoryHealth. */
1424
1906
  export interface RepositoryHealthRead {
1425
- repository: RepositoryReferenceRead;
1907
+ repository: RepositoryReferenceResponseRead;
1426
1908
  roles: Array<("source" | "destination") | (string & {})>;
1427
1909
  status: ("ready" | "action_required") | (string & {});
1428
1910
  default_branch?: string;
@@ -1509,9 +1991,9 @@ export interface Definition {
1509
1991
  project_id: ProjectId;
1510
1992
  source: DefinitionSource;
1511
1993
  format: "openapi" | "graphql" | null;
1512
- patches: DefinitionPatch[];
1513
- graphql: GraphqlSettings | null;
1514
- diagnostic_policy: DiagnosticPolicy;
1994
+ patches: DefinitionPatchResponse[];
1995
+ graphql: GraphqlSettingsResponse | null;
1996
+ diagnostic_policy: DiagnosticPolicyResponse;
1515
1997
  latest_revision_id: DefinitionRevisionId | null;
1516
1998
  /** Format: date-time */
1517
1999
  created_at: string;
@@ -1527,9 +2009,9 @@ export interface DefinitionWrite {
1527
2009
  project_id: ProjectId;
1528
2010
  source: DefinitionSourceWrite;
1529
2011
  format: "openapi" | "graphql" | null;
1530
- patches: DefinitionPatch[];
1531
- graphql: GraphqlSettings | null;
1532
- diagnostic_policy: DiagnosticPolicy;
2012
+ patches: DefinitionPatchResponse[];
2013
+ graphql: GraphqlSettingsResponse | null;
2014
+ diagnostic_policy: DiagnosticPolicyResponse;
1533
2015
  latest_revision_id: DefinitionRevisionId | null;
1534
2016
  /** Format: date-time */
1535
2017
  created_at: string;
@@ -1545,9 +2027,9 @@ export interface DefinitionRead {
1545
2027
  project_id: ProjectId;
1546
2028
  source: DefinitionSourceRead;
1547
2029
  format: ("openapi" | "graphql" | null) | (string & {}) | null;
1548
- patches: DefinitionPatchRead[];
1549
- graphql: GraphqlSettingsRead | null;
1550
- diagnostic_policy: DiagnosticPolicyRead;
2030
+ patches: DefinitionPatchResponseRead[];
2031
+ graphql: GraphqlSettingsResponseRead | null;
2032
+ diagnostic_policy: DiagnosticPolicyResponseRead;
1551
2033
  latest_revision_id: DefinitionRevisionId | null;
1552
2034
  /** Format: date-time */
1553
2035
  created_at: string;
@@ -1556,18 +2038,29 @@ export interface DefinitionRead {
1556
2038
  request_id: RequestId;
1557
2039
  }
1558
2040
 
2041
+ /**
2042
+ * Omitted fields remain unchanged. Supplied objects and arrays replace the whole field. URL source
2043
+ * headers are preserved when the URL is unchanged and headers are omitted; null or empty headers
2044
+ * clear them.
2045
+ */
1559
2046
  export interface DefinitionUpdateRequest {
1560
2047
  source?: DefinitionSourceInput;
2048
+ /** Replace all patches in order. An empty array removes every patch; null is invalid. */
1561
2049
  patches?: DefinitionPatch[];
2050
+ /** Replace all GraphQL settings. Null or an empty object clears them. */
1562
2051
  graphql?: GraphqlSettings | null;
2052
+ /** Replace the complete policy and suppression list. Null and an empty object are invalid. */
1563
2053
  diagnostic_policy?: DiagnosticPolicy;
1564
2054
  }
1565
2055
 
1566
2056
  /** Response shape for DefinitionUpdateRequest. */
1567
2057
  export interface DefinitionUpdateRequestRead {
1568
2058
  source?: DefinitionSourceInputRead;
2059
+ /** Replace all patches in order. An empty array removes every patch; null is invalid. */
1569
2060
  patches?: DefinitionPatchRead[];
2061
+ /** Replace all GraphQL settings. Null or an empty object clears them. */
1570
2062
  graphql?: GraphqlSettingsRead | null;
2063
+ /** Replace the complete policy and suppression list. Null and an empty object are invalid. */
1571
2064
  diagnostic_policy?: DiagnosticPolicyRead;
1572
2065
  }
1573
2066
 
@@ -1596,7 +2089,7 @@ export interface Project {
1596
2089
  * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
1597
2090
  * settings remain Definition-owned.
1598
2091
  */
1599
- config: ProjectConfig | null;
2092
+ config: ProjectConfigResponse | null;
1600
2093
  /** Format: date-time */
1601
2094
  created_at: string;
1602
2095
  /**
@@ -1627,7 +2120,7 @@ export interface ProjectWrite {
1627
2120
  * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
1628
2121
  * settings remain Definition-owned.
1629
2122
  */
1630
- config: ProjectConfig | null;
2123
+ config: ProjectConfigResponse | null;
1631
2124
  request_id: RequestId;
1632
2125
  }
1633
2126
 
@@ -1653,7 +2146,7 @@ export interface ProjectRead {
1653
2146
  * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
1654
2147
  * settings remain Definition-owned.
1655
2148
  */
1656
- config: ProjectConfigRead | null;
2149
+ config: ProjectConfigResponseRead | null;
1657
2150
  /** Format: date-time */
1658
2151
  created_at: string;
1659
2152
  /**
@@ -1865,19 +2358,28 @@ export interface OAuthApplicationRead {
1865
2358
 
1866
2359
  /**
1867
2360
  * Authenticated identity read used to verify a login before it is saved. Operation is auto-detected
1868
- * when omitted. Requests must include at least one of subject_field, account_field, or
1869
- * organization_field.
2361
+ * when omitted or null. At least one of subject_field, account_field, or organization_field must be
2362
+ * a non-null JSON Pointer. Null clears an individual mapping while another remains. Set
2363
+ * identity_verification itself to null to remove the whole policy.
1870
2364
  */
1871
- export interface IdentityVerification {
2365
+ export type IdentityVerification = {
1872
2366
  /** resource.method of a safe identity read with no required arguments. */
1873
- operation?: string;
2367
+ operation?: string | null;
1874
2368
  /** JSON Pointer to the stable caller ID in the identity response. */
1875
- subject_field?: string;
2369
+ subject_field?: string | null;
1876
2370
  /** JSON Pointer to the customer account ID. */
1877
- account_field?: string;
2371
+ account_field?: string | null;
1878
2372
  /** JSON Pointer to the customer organization ID. */
1879
- organization_field?: string;
2373
+ organization_field?: string | null;
2374
+ } & ({
2375
+ subject_field: string;
1880
2376
  }
2377
+ | {
2378
+ account_field: string;
2379
+ }
2380
+ | {
2381
+ organization_field: string;
2382
+ });
1881
2383
 
1882
2384
  /** OAuth application and request-value overrides for one named API environment. */
1883
2385
  export interface AuthenticationEnvironment {
@@ -1890,7 +2392,7 @@ export interface AuthenticationEnvironment {
1890
2392
 
1891
2393
  /**
1892
2394
  * Public authentication defaults for generated clients and tools. Stored Projects own the OAuth
1893
- * server, application catalog, and identity policy; stateless generation accepts the same shape for
2395
+ * server, application catalog, and identity policy; one-shot generation accepts the same shape for
1894
2396
  * one run. Runtime credentials and client secrets are never accepted.
1895
2397
  */
1896
2398
  export interface AuthenticationConfig {
@@ -1934,6 +2436,12 @@ export interface CliBehavior {
1934
2436
  * code phones nobody unless this is enabled.
1935
2437
  */
1936
2438
  update_notice?: boolean;
2439
+ /**
2440
+ * Public HTTP(S) URL read by the optional changelog command in generated CLIs. Supports UTF-8
2441
+ * Markdown, plain text, and static HTML; embedded credentials are not allowed. Omit or clear to
2442
+ * disable, then regenerate.
2443
+ */
2444
+ changelog_url?: string | null;
1937
2445
  /**
1938
2446
  * Where the generated CLI's feedback command sends users. GitHub issues/new URLs get a prefilled
1939
2447
  * title and environment details.
@@ -2108,7 +2616,7 @@ export interface PackageBehavior {
2108
2616
  * Everything Typeship needs beyond the Definition, in one object: generation customization
2109
2617
  * (globals, retries, pagination, readme) and how the generated tooling behaves (cli, mcp, package,
2110
2618
  * docs_url). Plain configuration. Typeship never requires vendor extensions inside the Definition
2111
- * itself. Stateless generation also accepts GraphQL settings here; stored projects keep those
2619
+ * itself. One-shot generation also accepts GraphQL settings here; stored projects keep those
2112
2620
  * settings on their Definition.
2113
2621
  */
2114
2622
  export interface Config {
@@ -2134,6 +2642,7 @@ export interface Config {
2134
2642
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2135
2643
  * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2136
2644
  * externalDocs URL.
2645
+ * Format: uri
2137
2646
  */
2138
2647
  docs_url?: string | null;
2139
2648
  /**
@@ -2167,6 +2676,7 @@ export interface ConfigRead {
2167
2676
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2168
2677
  * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2169
2678
  * externalDocs URL.
2679
+ * Format: uri
2170
2680
  */
2171
2681
  docs_url?: string | null;
2172
2682
  /**
@@ -2204,6 +2714,7 @@ export interface ProjectConfig {
2204
2714
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2205
2715
  * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2206
2716
  * externalDocs URL.
2717
+ * Format: uri
2207
2718
  */
2208
2719
  docs_url?: string | null;
2209
2720
  /**
@@ -2236,6 +2747,7 @@ export interface ProjectConfigRead {
2236
2747
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2237
2748
  * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2238
2749
  * externalDocs URL.
2750
+ * Format: uri
2239
2751
  */
2240
2752
  docs_url?: string | null;
2241
2753
  /**
@@ -2251,33 +2763,67 @@ export interface ProjectConfigRead {
2251
2763
  * Self-hosted MCP access may be overridden for a Target-specific deployment.
2252
2764
  */
2253
2765
  export interface TargetConfig {
2766
+ /**
2767
+ * Wire names of query/header parameters that become settable once on the generated client and
2768
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
2769
+ * are reported as generation warnings.
2770
+ */
2254
2771
  globals?: string[];
2255
2772
  retries?: RetryTuning;
2773
+ /**
2774
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
2775
+ * reported as generation warnings.
2776
+ */
2256
2777
  pagination?: Record<string, PaginationRule | boolean>;
2257
2778
  auth?: TargetAuthenticationConfig;
2258
2779
  cli?: CliBehavior;
2259
2780
  mcp?: McpBehavior;
2260
2781
  readme?: ReadmeBehavior;
2261
2782
  package?: PackageBehavior;
2262
- /** Format: uri */
2783
+ /**
2784
+ * 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.
2787
+ * Format: uri
2788
+ */
2263
2789
  docs_url?: string | null;
2264
- /** Format: uri */
2790
+ /**
2791
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
2792
+ * Format: uri
2793
+ */
2265
2794
  docs_index_url?: string | null;
2266
2795
  }
2267
2796
 
2268
2797
  /** Response shape for TargetConfig. */
2269
2798
  export interface TargetConfigRead {
2799
+ /**
2800
+ * Wire names of query/header parameters that become settable once on the generated client and
2801
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
2802
+ * are reported as generation warnings.
2803
+ */
2270
2804
  globals?: string[];
2271
2805
  retries?: RetryTuning;
2806
+ /**
2807
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
2808
+ * reported as generation warnings.
2809
+ */
2272
2810
  pagination?: Record<string, PaginationRuleRead | boolean>;
2273
2811
  auth?: TargetAuthenticationConfig;
2274
2812
  cli?: CliBehavior;
2275
2813
  mcp?: McpBehaviorRead;
2276
2814
  readme?: ReadmeBehavior;
2277
2815
  package?: PackageBehavior;
2278
- /** Format: uri */
2816
+ /**
2817
+ * 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.
2820
+ * Format: uri
2821
+ */
2279
2822
  docs_url?: string | null;
2280
- /** Format: uri */
2823
+ /**
2824
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
2825
+ * Format: uri
2826
+ */
2281
2827
  docs_index_url?: string | null;
2282
2828
  }
2283
2829
 
@@ -2412,9 +2958,23 @@ export interface PaginationRuleRead {
2412
2958
  export interface FileStub {
2413
2959
  path: string;
2414
2960
  bytes: number;
2961
+ mode: "100644" | "100755";
2962
+ }
2963
+
2964
+ /** Response shape for FileStub. */
2965
+ export interface FileStubRead {
2966
+ path: string;
2967
+ bytes: number;
2968
+ mode: ("100644" | "100755") | (string & {});
2415
2969
  }
2416
2970
 
2971
+ /**
2972
+ * A Generation moves from queued to running, then succeeds when its files are saved or fails.
2973
+ * Delivery and Draft status are separate.
2974
+ */
2417
2975
  export const GenerationStatus = {
2976
+ QUEUED: "queued",
2977
+ RUNNING: "running",
2418
2978
  SUCCEEDED: "succeeded",
2419
2979
  FAILED: "failed",
2420
2980
  } as const;
@@ -2431,18 +2991,25 @@ export type GenerationTrigger = (typeof GenerationTrigger)[keyof typeof Generati
2431
2991
  export interface GenerationProvenance {
2432
2992
  /** Pinned generator contract edition. */
2433
2993
  generator_edition: string;
2434
- /** Exact engine build identifier used for replay and support. */
2435
- engine_build: string;
2436
- /**
2437
- * Immutable effective Target configuration used by this run; source credentials are never
2438
- * included.
2439
- */
2440
- resolved_config: Record<string, unknown> | null;
2441
- config_hash: string | null;
2442
- /** Resolved generator and entitlement plan used to select the emitted public surface. */
2443
- surface_plan: Record<string, unknown> | null;
2444
- surface_plan_hash: string | null;
2445
- entitlement_cap: number | null;
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;
2446
3013
  package_version: string | null;
2447
3014
  }
2448
3015
 
@@ -2459,17 +3026,18 @@ export interface Generation {
2459
3026
  definition_revision_id: DefinitionRevisionId | null;
2460
3027
  status: GenerationStatus;
2461
3028
  trigger: GenerationTrigger;
2462
- /** Persisted Target identity. Null only for stateless generation. */
3029
+ /** Persisted Target identity. Null only for one-shot generation. */
2463
3030
  target_id: TargetId | null;
2464
3031
  /** Resolved generator implementation; provenance rather than resource identity. */
2465
3032
  generator: GeneratorKind;
2466
3033
  provenance: GenerationProvenance;
2467
- /** Null only for a failed or legacy generation that produced no metadata. */
3034
+ /** Null while queued or running, or when a failed or legacy generation produced no metadata. */
2468
3035
  meta: GenerationMeta | null;
2469
3036
  warnings: string[];
2470
3037
  /** Present on retrieve and create; omitted in lists. */
2471
3038
  files?: GeneratedFile[];
2472
- error: string | null;
3039
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3040
+ errors: DomainError[];
2473
3041
  /** Format: date-time */
2474
3042
  created_at: string;
2475
3043
  request_id?: RequestId;
@@ -2488,17 +3056,18 @@ export interface GenerationWrite {
2488
3056
  definition_revision_id: DefinitionRevisionId | null;
2489
3057
  status: GenerationStatus;
2490
3058
  trigger: GenerationTrigger;
2491
- /** Persisted Target identity. Null only for stateless generation. */
3059
+ /** Persisted Target identity. Null only for one-shot generation. */
2492
3060
  target_id: TargetId | null;
2493
3061
  /** Resolved generator implementation; provenance rather than resource identity. */
2494
3062
  generator: GeneratorKind;
2495
3063
  provenance: GenerationProvenance;
2496
- /** Null only for a failed or legacy generation that produced no metadata. */
3064
+ /** Null while queued or running, or when a failed or legacy generation produced no metadata. */
2497
3065
  meta: GenerationMeta | null;
2498
3066
  warnings: string[];
2499
3067
  /** Present on retrieve and create; omitted in lists. */
2500
3068
  files?: GeneratedFile[];
2501
- error: string | null;
3069
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3070
+ errors: DomainError[];
2502
3071
  /** Format: date-time */
2503
3072
  created_at: string;
2504
3073
  request_id?: RequestId;
@@ -2513,22 +3082,23 @@ export interface GenerationRead {
2513
3082
  * fetched one at a time via GET /generations/{generation_id}/file.
2514
3083
  */
2515
3084
  files_omitted?: boolean;
2516
- files_index?: FileStub[];
3085
+ files_index?: FileStubRead[];
2517
3086
  project_id: ProjectId;
2518
3087
  definition_revision_id: DefinitionRevisionId | null;
2519
3088
  status: GenerationStatus | (string & {});
2520
3089
  trigger: GenerationTrigger | (string & {});
2521
- /** Persisted Target identity. Null only for stateless generation. */
3090
+ /** Persisted Target identity. Null only for one-shot generation. */
2522
3091
  target_id: TargetId | null;
2523
3092
  /** Resolved generator implementation; provenance rather than resource identity. */
2524
3093
  generator: GeneratorKind | (string & {});
2525
- provenance: GenerationProvenance;
2526
- /** Null only for a failed or legacy generation that produced no metadata. */
3094
+ provenance: GenerationProvenanceRead;
3095
+ /** Null while queued or running, or when a failed or legacy generation produced no metadata. */
2527
3096
  meta: GenerationMetaRead | null;
2528
3097
  warnings: string[];
2529
3098
  /** Present on retrieve and create; omitted in lists. */
2530
- files?: GeneratedFile[];
2531
- error: string | null;
3099
+ files?: GeneratedFileRead[];
3100
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3101
+ errors: DomainErrorRead[];
2532
3102
  /** Format: date-time */
2533
3103
  created_at: string;
2534
3104
  request_id?: RequestId;
@@ -2545,7 +3115,7 @@ export interface GenerationSummary {
2545
3115
  definition_revision_id: DefinitionRevisionId | null;
2546
3116
  status: GenerationStatus;
2547
3117
  trigger: GenerationTrigger;
2548
- /** Persisted Target identity. Null only for stateless generation. */
3118
+ /** Persisted Target identity. Null only for one-shot generation. */
2549
3119
  target_id: TargetId | null;
2550
3120
  /** Resolved generator implementation; provenance rather than resource identity. */
2551
3121
  generator: GeneratorKind;
@@ -2553,7 +3123,8 @@ export interface GenerationSummary {
2553
3123
  /** Null only for a failed or legacy generation that produced no metadata. */
2554
3124
  meta: GenerationMeta | null;
2555
3125
  warnings: string[];
2556
- error: string | null;
3126
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3127
+ errors: DomainError[];
2557
3128
  /** Format: date-time */
2558
3129
  created_at: string;
2559
3130
  }
@@ -2565,7 +3136,7 @@ export interface GenerationSummaryWrite {
2565
3136
  definition_revision_id: DefinitionRevisionId | null;
2566
3137
  status: GenerationStatus;
2567
3138
  trigger: GenerationTrigger;
2568
- /** Persisted Target identity. Null only for stateless generation. */
3139
+ /** Persisted Target identity. Null only for one-shot generation. */
2569
3140
  target_id: TargetId | null;
2570
3141
  /** Resolved generator implementation; provenance rather than resource identity. */
2571
3142
  generator: GeneratorKind;
@@ -2573,7 +3144,8 @@ export interface GenerationSummaryWrite {
2573
3144
  /** Null only for a failed or legacy generation that produced no metadata. */
2574
3145
  meta: GenerationMeta | null;
2575
3146
  warnings: string[];
2576
- error: string | null;
3147
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3148
+ errors: DomainError[];
2577
3149
  /** Format: date-time */
2578
3150
  created_at: string;
2579
3151
  }
@@ -2586,15 +3158,16 @@ export interface GenerationSummaryRead {
2586
3158
  definition_revision_id: DefinitionRevisionId | null;
2587
3159
  status: GenerationStatus | (string & {});
2588
3160
  trigger: GenerationTrigger | (string & {});
2589
- /** Persisted Target identity. Null only for stateless generation. */
3161
+ /** Persisted Target identity. Null only for one-shot generation. */
2590
3162
  target_id: TargetId | null;
2591
3163
  /** Resolved generator implementation; provenance rather than resource identity. */
2592
3164
  generator: GeneratorKind | (string & {});
2593
- provenance: GenerationProvenance;
3165
+ provenance: GenerationProvenanceRead;
2594
3166
  /** Null only for a failed or legacy generation that produced no metadata. */
2595
3167
  meta: GenerationMetaRead | null;
2596
3168
  warnings: string[];
2597
- error: string | null;
3169
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3170
+ errors: DomainErrorRead[];
2598
3171
  /** Format: date-time */
2599
3172
  created_at: string;
2600
3173
  }
@@ -2612,7 +3185,8 @@ export interface GenerationFailure {
2612
3185
  target_id: TargetId;
2613
3186
  generator: GeneratorKind;
2614
3187
  status: "failed";
2615
- error: string;
3188
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3189
+ errors: DomainError[];
2616
3190
  }
2617
3191
 
2618
3192
  /** Response shape for GenerationFailure. */
@@ -2620,27 +3194,28 @@ export interface GenerationFailureRead {
2620
3194
  target_id: TargetId;
2621
3195
  generator: GeneratorKind | (string & {});
2622
3196
  status: "failed" | (string & {});
2623
- error: string;
3197
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3198
+ errors: DomainErrorRead[];
2624
3199
  }
2625
3200
 
2626
3201
  /**
2627
- * Metadata for each Target generation attempted by a Project run. Retrieve one Generation
2628
- * separately for generated files.
3202
+ * One Generation per selected Target. Retrieve each Generation for current status and generated
3203
+ * files.
2629
3204
  */
2630
3205
  export interface GenerationBatch {
2631
- data: Array<GenerationSummary | GenerationFailure>;
3206
+ data: GenerationSummary[];
2632
3207
  request_id: RequestId;
2633
3208
  }
2634
3209
 
2635
3210
  /** Request shape for GenerationBatch. */
2636
3211
  export interface GenerationBatchWrite {
2637
- data: Array<GenerationSummaryWrite | GenerationFailure>;
3212
+ data: GenerationSummaryWrite[];
2638
3213
  request_id: RequestId;
2639
3214
  }
2640
3215
 
2641
3216
  /** Response shape for GenerationBatch. */
2642
3217
  export interface GenerationBatchRead {
2643
- data: Array<GenerationSummaryRead | GenerationFailureRead>;
3218
+ data: GenerationSummaryRead[];
2644
3219
  request_id: RequestId;
2645
3220
  }
2646
3221
 
@@ -2693,7 +3268,7 @@ export interface UrlDefinitionRevisionSourceRead {
2693
3268
 
2694
3269
  export interface RepositoryDefinitionRevisionSource {
2695
3270
  kind: "repository";
2696
- repository: RepositoryReference;
3271
+ repository: RepositoryReferenceResponse;
2697
3272
  /** Repository-relative Definition entrypoint path. */
2698
3273
  path: string;
2699
3274
  /** Git ref resolved for this revision, when recorded. */
@@ -2705,7 +3280,7 @@ export interface RepositoryDefinitionRevisionSource {
2705
3280
  /** Response shape for RepositoryDefinitionRevisionSource. */
2706
3281
  export interface RepositoryDefinitionRevisionSourceRead {
2707
3282
  kind: "repository" | (string & {});
2708
- repository: RepositoryReferenceRead;
3283
+ repository: RepositoryReferenceResponseRead;
2709
3284
  /** Repository-relative Definition entrypoint path. */
2710
3285
  path: string;
2711
3286
  /** Git ref resolved for this revision, when recorded. */
@@ -2740,6 +3315,35 @@ export interface DefinitionDocumentRead {
2740
3315
  size_bytes: number;
2741
3316
  }
2742
3317
 
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
+ }
3331
+
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
+ }
3346
+
2743
3347
  export interface DefinitionRevision {
2744
3348
  id: DefinitionRevisionId;
2745
3349
  object: "definition_revision";
@@ -2920,6 +3524,7 @@ export const ErrorType = {
2920
3524
  SOURCE_ERROR: "source_error",
2921
3525
  RATE_LIMIT_ERROR: "rate_limit_error",
2922
3526
  API_ERROR: "api_error",
3527
+ UNKNOWN_ERROR: "unknown_error",
2923
3528
  } as const;
2924
3529
  export type ErrorType = (typeof ErrorType)[keyof typeof ErrorType];
2925
3530
 
@@ -2932,13 +3537,18 @@ export const ErrorCode = {
2932
3537
  INSUFFICIENT_SCOPE: "insufficient_scope",
2933
3538
  FORBIDDEN: "forbidden",
2934
3539
  NOT_FOUND: "not_found",
3540
+ METHOD_NOT_ALLOWED: "method_not_allowed",
2935
3541
  SPEC_ERROR: "spec_error",
2936
3542
  FETCH_ERROR: "fetch_error",
2937
3543
  REPOSITORY_PROVIDER_UNSUPPORTED: "repository_provider_unsupported",
2938
3544
  EDITION_UNAVAILABLE: "edition_unavailable",
2939
3545
  TARGET_BUSY: "target_busy",
3546
+ NO_DRAFT: "no_draft",
3547
+ STALE_DRAFT: "stale_draft",
3548
+ NO_CHANGES: "no_changes",
2940
3549
  INVALID_VERSION: "invalid_version",
2941
- STALE_RELEASE_REVISION: "stale_release_revision",
3550
+ PRECONDITION_FAILED: "precondition_failed",
3551
+ DEFINITION_CHANGED: "definition_changed",
2942
3552
  VERSION_OCCUPIED: "version_occupied",
2943
3553
  VERSION_TOO_LOW: "version_too_low",
2944
3554
  RELEASE_ANALYSIS_STALE: "release_analysis_stale",
@@ -2956,17 +3566,51 @@ export const ErrorCode = {
2956
3566
  PAYLOAD_TOO_LARGE: "payload_too_large",
2957
3567
  RATE_LIMITED: "rate_limited",
2958
3568
  INTERNAL_ERROR: "internal_error",
3569
+ DEPENDENCY_MISSING: "dependency_missing",
3570
+ DEPENDENCY_NOT_FOUND: "dependency_not_found",
3571
+ DEPENDENCY_SELF: "dependency_self",
3572
+ DEPENDENCY_CYCLE: "dependency_cycle",
3573
+ DEPENDENCY_CROSS_PROJECT: "dependency_cross_project",
3574
+ DEPENDENCY_CROSS_LINEAGE: "dependency_cross_lineage",
3575
+ DEPENDENCY_WRONG_GENERATOR: "dependency_wrong_generator",
3576
+ DEPENDENCY_DISABLED: "dependency_disabled",
3577
+ DEPENDENCY_MODULE_PATH_MISSING: "dependency_module_path_missing",
3578
+ DEPENDENCY_UNRELEASED: "dependency_unreleased",
3579
+ DEPENDENCY_REVISION_MISMATCH: "dependency_revision_mismatch",
3580
+ DEPENDENCY_EDITION_INCOMPATIBLE: "dependency_edition_incompatible",
3581
+ PUBLICATION_FAILED: "publication_failed",
3582
+ CUSTOMIZATION_CONFLICT: "customization_conflict",
3583
+ HISTORY_RECOVERY_REQUIRED: "history_recovery_required",
3584
+ CHECKS_UNAVAILABLE: "checks_unavailable",
3585
+ GENERATION_STALE: "generation_stale",
3586
+ UNCLASSIFIED_ERROR: "unclassified_error",
2959
3587
  } as const;
2960
3588
  export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
2961
3589
 
2962
3590
  export interface ErrorDetail {
2963
3591
  type: ErrorType;
2964
3592
  code: ErrorCode;
2965
- /** JSON Pointer to the invalid request field, when one field caused the error. */
3593
+ phase?: FailurePhase;
3594
+ /** The affected Target when an operation reports failures for multiple Targets. */
3595
+ target_id?: TargetId;
3596
+ /**
3597
+ * JSON Pointer to the invalid field within the request part named by in. When in is omitted, the
3598
+ * pointer refers to the request body. Header pointers use lowercase header names, such as
3599
+ * /idempotency-key.
3600
+ */
2966
3601
  field?: string;
3602
+ /**
3603
+ * Request part containing field. Query-parameter errors use query; header errors use header. Body
3604
+ * errors use body or omit in.
3605
+ */
3606
+ in?: "body" | "query" | "header";
2967
3607
  /** Human-readable explanation. Its wording may change. */
2968
3608
  message: string;
2969
- /** Whether retrying later can succeed without changing the request. */
3609
+ /**
3610
+ * 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
3612
+ * does not start another attempt.
3613
+ */
2970
3614
  retryable: boolean;
2971
3615
  /** Stable, concise recovery instruction suitable for a person or agent. */
2972
3616
  suggested_action: string;
@@ -2981,11 +3625,27 @@ export interface ErrorDetail {
2981
3625
  export interface ErrorDetailRead {
2982
3626
  type: ErrorType | (string & {});
2983
3627
  code: ErrorCode | (string & {});
2984
- /** JSON Pointer to the invalid request field, when one field caused the error. */
3628
+ phase?: FailurePhase | (string & {});
3629
+ /** The affected Target when an operation reports failures for multiple Targets. */
3630
+ target_id?: TargetId;
3631
+ /**
3632
+ * JSON Pointer to the invalid field within the request part named by in. When in is omitted, the
3633
+ * pointer refers to the request body. Header pointers use lowercase header names, such as
3634
+ * /idempotency-key.
3635
+ */
2985
3636
  field?: string;
3637
+ /**
3638
+ * Request part containing field. Query-parameter errors use query; header errors use header. Body
3639
+ * errors use body or omit in.
3640
+ */
3641
+ in?: ("body" | "query" | "header") | (string & {});
2986
3642
  /** Human-readable explanation. Its wording may change. */
2987
3643
  message: string;
2988
- /** Whether retrying later can succeed without changing the request. */
3644
+ /**
3645
+ * 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
3647
+ * does not start another attempt.
3648
+ */
2989
3649
  retryable: boolean;
2990
3650
  /** Stable, concise recovery instruction suitable for a person or agent. */
2991
3651
  suggested_action: string;
@@ -2996,13 +3656,1304 @@ export interface ErrorDetailRead {
2996
3656
  docs_url: string;
2997
3657
  }
2998
3658
 
2999
- export interface ErrorModel {
3000
- errors: ErrorDetail[];
3001
- request_id: RequestId;
3659
+ 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;
3002
3664
  }
3003
3665
 
3004
- /** Response shape for ErrorModel. */
3005
- export interface ErrorModelRead {
3006
- errors: ErrorDetailRead[];
3007
- request_id: RequestId;
3666
+ /** Response shape for RepositoryReferenceResponse. */
3667
+ 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;
3672
+ }
3673
+
3674
+ /**
3675
+ * A fix applied to the resolved Definition before generation. Paths are JSON
3676
+ * Pointers into the document. A patch whose target no longer exists is
3677
+ * skipped and reported as a warning on the generation, never silently.
3678
+ */
3679
+ export interface DefinitionPatchResponse {
3680
+ op: "set" | "append" | "remove" | "rename";
3681
+ /**
3682
+ * JSON-Pointer-style path. Pattern segments enable bulk fixes:
3683
+ * * (any child), ** (any depth), [key=value] (filter), e.g.
3684
+ * /paths/**\/parameters/[name=account_id]/schema/type. Renaming a
3685
+ * schema under /components/schemas also rewrites its $refs.
3686
+ */
3687
+ path: string;
3688
+ /** set only; the replacement value. */
3689
+ value?: unknown;
3690
+ /** rename only; the new key name. */
3691
+ to?: string | null;
3692
+ reason?: string | null;
3693
+ }
3694
+
3695
+ /** Response shape for DefinitionPatchResponse. */
3696
+ export interface DefinitionPatchResponseRead {
3697
+ op: ("set" | "append" | "remove" | "rename") | (string & {});
3698
+ /**
3699
+ * JSON-Pointer-style path. Pattern segments enable bulk fixes:
3700
+ * * (any child), ** (any depth), [key=value] (filter), e.g.
3701
+ * /paths/**\/parameters/[name=account_id]/schema/type. Renaming a
3702
+ * schema under /components/schemas also rewrites its $refs.
3703
+ */
3704
+ path: string;
3705
+ /** set only; the replacement value. */
3706
+ value?: unknown;
3707
+ /** rename only; the new key name. */
3708
+ to?: string | null;
3709
+ reason?: string | null;
3710
+ }
3711
+
3712
+ export interface DiagnosticSuppressionResponse {
3713
+ rule_id: string;
3714
+ /** Exact schema coordinate. Omit only to suppress every occurrence of the rule. */
3715
+ path?: string;
3716
+ /** The reviewed product decision behind this exception. */
3717
+ reason: string;
3718
+ }
3719
+
3720
+ /**
3721
+ * Source pull-request enforcement threshold, new-versus-complete baseline, and explicitly reviewed
3722
+ * rule or location exceptions.
3723
+ */
3724
+ export interface DiagnosticPolicyResponse {
3725
+ /**
3726
+ * Severity threshold that fails the API change review check.
3727
+ * Default: "error"
3728
+ */
3729
+ fail_on: "never" | "error" | "warning";
3730
+ /**
3731
+ * Enforce only occurrences introduced by the proposed source change.
3732
+ * Default: true
3733
+ */
3734
+ only_new: boolean;
3735
+ /** Default: [] */
3736
+ suppressions: DiagnosticSuppressionResponse[];
3737
+ }
3738
+
3739
+ /** Response shape for DiagnosticPolicyResponse. */
3740
+ export interface DiagnosticPolicyResponseRead {
3741
+ /**
3742
+ * Severity threshold that fails the API change review check.
3743
+ * Default: "error"
3744
+ */
3745
+ fail_on: ("never" | "error" | "warning") | (string & {});
3746
+ /**
3747
+ * Enforce only occurrences introduced by the proposed source change.
3748
+ * Default: true
3749
+ */
3750
+ only_new: boolean;
3751
+ /** Default: [] */
3752
+ suppressions: DiagnosticSuppressionResponse[];
3753
+ }
3754
+
3755
+ /**
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.
3761
+ */
3762
+ export interface TargetChecksResponse {
3763
+ /** Default: ["build","package","public_entrypoint"] */
3764
+ generated?: Array<"build" | "package" | "public_entrypoint">;
3765
+ repository_required?: string[];
3766
+ customer?: Array<{
3767
+ name: string;
3768
+ command: string;
3769
+ }>;
3770
+ }
3771
+
3772
+ /** Response shape for TargetChecksResponse. */
3773
+ export interface TargetChecksResponseRead {
3774
+ /** Default: ["build","package","public_entrypoint"] */
3775
+ generated?: Array<("build" | "package" | "public_entrypoint") | (string & {})>;
3776
+ repository_required?: string[];
3777
+ customer?: Array<{
3778
+ name: string;
3779
+ command: string;
3780
+ }>;
3781
+ }
3782
+
3783
+ /**
3784
+ * Authorization-server metadata used by generated OAuth flows. Secrets and runtime credentials are
3785
+ * never accepted here.
3786
+ */
3787
+ export interface OAuthServerResponse {
3788
+ /**
3789
+ * Exact authorization-server issuer, including any tenant path.
3790
+ * Format: uri
3791
+ */
3792
+ issuer?: string | null;
3793
+ /**
3794
+ * Exact metadata URL when it cannot be derived from the issuer.
3795
+ * Format: uri
3796
+ */
3797
+ discovery_url?: string | null;
3798
+ /**
3799
+ * Authorization endpoint override.
3800
+ * Format: uri
3801
+ */
3802
+ authorization_url?: string | null;
3803
+ /**
3804
+ * Token endpoint override.
3805
+ * Format: uri
3806
+ */
3807
+ token_url?: string | null;
3808
+ /**
3809
+ * Device-authorization endpoint override.
3810
+ * Format: uri
3811
+ */
3812
+ device_authorization_url?: string | null;
3813
+ /** Default scopes requested during login. */
3814
+ scopes?: string[] | null;
3815
+ /** Default audience included in authorization and token requests. */
3816
+ audience?: string | null;
3817
+ /**
3818
+ * Protected API resource included in authorization and token requests.
3819
+ * Format: uri
3820
+ */
3821
+ resource?: string | null;
3822
+ }
3823
+
3824
+ /**
3825
+ * OAuth application available to generated products. Public clients support interactive login;
3826
+ * confidential clients support runtime-supplied machine credentials. Client secrets are never
3827
+ * stored.
3828
+ */
3829
+ export interface OAuthApplicationResponse {
3830
+ /** OAuth client identifier. */
3831
+ client_id: string;
3832
+ /** Interactive login method. Browser login uses Authorization Code with PKCE. */
3833
+ login_method?: "browser" | "device" | null;
3834
+ /** How a runtime-supplied client secret is sent for machine grants. */
3835
+ client_auth_method?: "post" | "basic" | null;
3836
+ /**
3837
+ * Loopback callback URL for browser login.
3838
+ * Format: uri
3839
+ */
3840
+ redirect_uri?: string | null;
3841
+ /** Provider parameter used to request an organization during browser login. */
3842
+ organization_parameter?: "organization" | "organization_id" | null;
3008
3843
  }
3844
+
3845
+ /** Response shape for OAuthApplicationResponse. */
3846
+ export interface OAuthApplicationResponseRead {
3847
+ /** OAuth client identifier. */
3848
+ client_id: string;
3849
+ /** Interactive login method. Browser login uses Authorization Code with PKCE. */
3850
+ login_method?: ("browser" | "device" | null) | (string & {}) | null;
3851
+ /** How a runtime-supplied client secret is sent for machine grants. */
3852
+ client_auth_method?: ("post" | "basic" | null) | (string & {}) | null;
3853
+ /**
3854
+ * Loopback callback URL for browser login.
3855
+ * Format: uri
3856
+ */
3857
+ redirect_uri?: string | null;
3858
+ /** Provider parameter used to request an organization during browser login. */
3859
+ organization_parameter?: ("organization" | "organization_id" | null) | (string & {}) | null;
3860
+ }
3861
+
3862
+ /**
3863
+ * Authenticated identity read used to verify a login before it is saved. Operation is auto-detected
3864
+ * when omitted or null. At least one of subject_field, account_field, or organization_field must be
3865
+ * a non-null JSON Pointer. Null clears an individual mapping while another remains. Set
3866
+ * identity_verification itself to null to remove the whole policy.
3867
+ */
3868
+ export type IdentityVerificationResponse = {
3869
+ /** resource.method of a safe identity read with no required arguments. */
3870
+ operation?: string | null;
3871
+ /** JSON Pointer to the stable caller ID in the identity response. */
3872
+ subject_field?: string | null;
3873
+ /** JSON Pointer to the customer account ID. */
3874
+ account_field?: string | null;
3875
+ /** JSON Pointer to the customer organization ID. */
3876
+ organization_field?: string | null;
3877
+ } & ({
3878
+ subject_field: string;
3879
+ }
3880
+ | {
3881
+ account_field: string;
3882
+ }
3883
+ | {
3884
+ organization_field: string;
3885
+ });
3886
+
3887
+ /** OAuth application and request-value overrides for one named API environment. */
3888
+ export interface AuthenticationEnvironmentResponse {
3889
+ oauth_application?: string | null;
3890
+ scopes?: string[] | null;
3891
+ audience?: string | null;
3892
+ /** Format: uri */
3893
+ resource?: string | null;
3894
+ }
3895
+
3896
+ /**
3897
+ * Public authentication defaults for generated clients and tools. Stored Projects own the OAuth
3898
+ * server, application catalog, and identity policy; one-shot generation accepts the same shape for
3899
+ * one run. Runtime credentials and client secrets are never accepted.
3900
+ */
3901
+ export interface AuthenticationConfigResponse {
3902
+ oauth_server?: OAuthServerResponse | null;
3903
+ /** OAuth applications keyed by a stable name. */
3904
+ oauth_applications?: Record<string, OAuthApplicationResponse> | null;
3905
+ /** Default OAuth application used by generated products. */
3906
+ oauth_application?: string | null;
3907
+ identity_verification?: IdentityVerificationResponse | null;
3908
+ /**
3909
+ * Base URL of a custom browser-approval backend implementing the start, status, and revoke
3910
+ * contract. Used only when OAuth is not configured.
3911
+ * Format: uri
3912
+ */
3913
+ approval_url?: string | null;
3914
+ /** Authentication selections keyed by generated API environment name. */
3915
+ environments?: Record<string, AuthenticationEnvironmentResponse> | null;
3916
+ }
3917
+
3918
+ export interface TargetAuthenticationEnvironmentResponse {
3919
+ oauth_application?: string | null;
3920
+ }
3921
+
3922
+ /**
3923
+ * Selects a Project OAuth application for one Target. OAuth server metadata, applications, and
3924
+ * identity policy remain Project-owned.
3925
+ */
3926
+ export interface TargetAuthenticationConfigResponse {
3927
+ /** Project OAuth application to use. Omit to inherit the Project default. */
3928
+ oauth_application?: string | null;
3929
+ /** Project OAuth application selections keyed by API environment. */
3930
+ environments?: Record<string, TargetAuthenticationEnvironmentResponse> | null;
3931
+ }
3932
+
3933
+ /** How the generated CLI behaves. Part of Config. */
3934
+ export interface CliBehaviorResponse {
3935
+ /** Command users run, independent of how the CLI is distributed. */
3936
+ command_name?: string | null;
3937
+ /**
3938
+ * Opt in to a once-a-day registry check that prints an upgrade hint. Off by default; generated
3939
+ * code phones nobody unless this is enabled.
3940
+ */
3941
+ update_notice?: boolean;
3942
+ /**
3943
+ * Public HTTP(S) URL read by the optional changelog command in generated CLIs. Supports UTF-8
3944
+ * Markdown, plain text, and static HTML; embedded credentials are not allowed. Omit or clear to
3945
+ * disable, then regenerate.
3946
+ */
3947
+ changelog_url?: string | null;
3948
+ /**
3949
+ * Where the generated CLI's feedback command sends users. GitHub issues/new URLs get a prefilled
3950
+ * title and environment details.
3951
+ */
3952
+ support_url?: string | null;
3953
+ /**
3954
+ * Hosted MCP endpoint installed by the generated CLI instead of launching the package's local
3955
+ * stdio server.
3956
+ */
3957
+ mcp_url?: string | null;
3958
+ /** GitHub owner/name of the skills package the generated CLI offers to install during init. */
3959
+ skills_repo?: string | null;
3960
+ }
3961
+
3962
+ /** How generated MCP servers and the Typeship-hosted endpoint behave. Part of Config. */
3963
+ export interface McpBehaviorResponse {
3964
+ /** Stable official MCP registry name, independent of the server runtime. */
3965
+ registry_name?: string | null;
3966
+ /**
3967
+ * Authorization for callers connecting to a generated MCP server deployed over HTTP. The hosting
3968
+ * application resolves upstream API credentials separately at runtime. This setting does not
3969
+ * apply to the Typeship-hosted endpoint.
3970
+ */
3971
+ access?: {
3972
+ /**
3973
+ * Exact issuer allowed to sign MCP connection tokens.
3974
+ * Format: uri
3975
+ */
3976
+ issuer: string;
3977
+ /**
3978
+ * Canonical public URL of the self-hosted MCP endpoint that connection tokens must target.
3979
+ * Format: uri
3980
+ */
3981
+ resource: string;
3982
+ /**
3983
+ * Public signing-key endpoint. Omit to discover it from the issuer.
3984
+ * Format: uri
3985
+ */
3986
+ jwks_url?: string;
3987
+ /** Minimum scopes required to connect to the self-hosted MCP server. */
3988
+ scopes?: string[];
3989
+ };
3990
+ /**
3991
+ * MCP tool shape. meta collapses per-operation tools into search_docs, read_docs, and execute so
3992
+ * large APIs don't flood an agent's context window. Auto considers the serialized tool schemas,
3993
+ * switching near 10k tokens or above 100 operations.
3994
+ */
3995
+ tool_mode?: "auto" | "operations" | "meta";
3996
+ /**
3997
+ * Guidance appended to the MCP server's instructions, which agents read once when they connect
3998
+ * (server/discover): what to call first, conventions the spec does not state, what not to do.
3999
+ * Carried by the package's server and the hosted endpoint alike.
4000
+ */
4001
+ instructions?: string | null;
4002
+ /**
4003
+ * Hand-written MCP tool descriptions keyed by operationId or "METHOD /path". Each replaces the
4004
+ * text typeship derives for that operation (summary, first sentence, method and path, deprecation
4005
+ * and auth notes). For flows the spec cannot describe, such as a multi-step upload. Keys that
4006
+ * match no operation are reported as generation warnings.
4007
+ */
4008
+ tool_descriptions?: Record<string, string>;
4009
+ /**
4010
+ * Exact name-or-ID resolver overrides keyed first by the target operationId or "METHOD /path",
4011
+ * then by its wire argument name. A resolver names one read collection operation plus 1-4 item
4012
+ * fields to match case-insensitively; false opts that argument out of strict inference.
4013
+ */
4014
+ reference_resolvers?: Record<string, Record<string, false
4015
+ | {
4016
+ /** OperationId, "METHOD /path", MCP tool name, or dotted resource.method of the list operation. */
4017
+ via: string;
4018
+ /** Item fields compared exactly and case-insensitively, such as name, slug, key, or email. */
4019
+ match: string[];
4020
+ /** Item field substituted into the requested argument. Defaults to id. */
4021
+ id?: string;
4022
+ }>>;
4023
+ }
4024
+
4025
+ /** Response shape for McpBehaviorResponse. */
4026
+ export interface McpBehaviorResponseRead {
4027
+ /** Stable official MCP registry name, independent of the server runtime. */
4028
+ registry_name?: string | null;
4029
+ /**
4030
+ * Authorization for callers connecting to a generated MCP server deployed over HTTP. The hosting
4031
+ * application resolves upstream API credentials separately at runtime. This setting does not
4032
+ * apply to the Typeship-hosted endpoint.
4033
+ */
4034
+ access?: {
4035
+ /**
4036
+ * Exact issuer allowed to sign MCP connection tokens.
4037
+ * Format: uri
4038
+ */
4039
+ issuer: string;
4040
+ /**
4041
+ * Canonical public URL of the self-hosted MCP endpoint that connection tokens must target.
4042
+ * Format: uri
4043
+ */
4044
+ resource: string;
4045
+ /**
4046
+ * Public signing-key endpoint. Omit to discover it from the issuer.
4047
+ * Format: uri
4048
+ */
4049
+ jwks_url?: string;
4050
+ /** Minimum scopes required to connect to the self-hosted MCP server. */
4051
+ scopes?: string[];
4052
+ };
4053
+ /**
4054
+ * MCP tool shape. meta collapses per-operation tools into search_docs, read_docs, and execute so
4055
+ * large APIs don't flood an agent's context window. Auto considers the serialized tool schemas,
4056
+ * switching near 10k tokens or above 100 operations.
4057
+ */
4058
+ tool_mode?: ("auto" | "operations" | "meta") | (string & {});
4059
+ /**
4060
+ * Guidance appended to the MCP server's instructions, which agents read once when they connect
4061
+ * (server/discover): what to call first, conventions the spec does not state, what not to do.
4062
+ * Carried by the package's server and the hosted endpoint alike.
4063
+ */
4064
+ instructions?: string | null;
4065
+ /**
4066
+ * Hand-written MCP tool descriptions keyed by operationId or "METHOD /path". Each replaces the
4067
+ * text typeship derives for that operation (summary, first sentence, method and path, deprecation
4068
+ * and auth notes). For flows the spec cannot describe, such as a multi-step upload. Keys that
4069
+ * match no operation are reported as generation warnings.
4070
+ */
4071
+ tool_descriptions?: Record<string, string>;
4072
+ /**
4073
+ * Exact name-or-ID resolver overrides keyed first by the target operationId or "METHOD /path",
4074
+ * then by its wire argument name. A resolver names one read collection operation plus 1-4 item
4075
+ * fields to match case-insensitively; false opts that argument out of strict inference.
4076
+ */
4077
+ reference_resolvers?: Record<string, Record<string, false | (string & {})
4078
+ | {
4079
+ /** OperationId, "METHOD /path", MCP tool name, or dotted resource.method of the list operation. */
4080
+ via: string;
4081
+ /** Item fields compared exactly and case-insensitively, such as name, slug, key, or email. */
4082
+ match: string[];
4083
+ /** Item field substituted into the requested argument. Defaults to id. */
4084
+ id?: string;
4085
+ }>>;
4086
+ }
4087
+
4088
+ /** Generated README behavior. Part of Config. */
4089
+ export interface ReadmeBehaviorResponse {
4090
+ /**
4091
+ * operationId or "METHOD /path" to feature as the README's first API call. It must be present in
4092
+ * the generated package and callable with no required input beyond path placeholders. Missing or
4093
+ * unsuitable choices produce a warning and use the automatic example.
4094
+ */
4095
+ quickstart_operation?: string | null;
4096
+ }
4097
+
4098
+ /**
4099
+ * Published-package metadata the API spec does not own. Repository is derived from each
4100
+ * destination.
4101
+ */
4102
+ export interface PackageBehaviorResponse {
4103
+ /** Homepage written into registry metadata. */
4104
+ homepage?: string | null;
4105
+ /** SPDX identifier written into registry metadata. Defaults to info.license. */
4106
+ license?: string | null;
4107
+ /**
4108
+ * Exact LICENSE file contents. Supply this for licences the engine does not build in; MIT is
4109
+ * built in when copyright is also set.
4110
+ */
4111
+ license_text?: string | null;
4112
+ /** Copyright line used in generated license files. */
4113
+ copyright?: string | null;
4114
+ /** Go identifier when the destination repository name is unsuitable. */
4115
+ go_package_name?: string | null;
4116
+ }
4117
+
4118
+ /**
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.
4124
+ */
4125
+ export interface ConfigResponse {
4126
+ /**
4127
+ * Wire names of query/header parameters that become settable once on the generated client and
4128
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
4129
+ * are reported as generation warnings.
4130
+ */
4131
+ globals?: string[];
4132
+ retries?: RetryTuningResponse;
4133
+ /**
4134
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
4135
+ * reported as generation warnings.
4136
+ */
4137
+ pagination?: Record<string, PaginationRuleResponse | boolean>;
4138
+ graphql?: GraphqlSettingsResponse;
4139
+ auth?: AuthenticationConfigResponse;
4140
+ cli?: CliBehaviorResponse;
4141
+ mcp?: McpBehaviorResponse;
4142
+ readme?: ReadmeBehaviorResponse;
4143
+ package?: PackageBehaviorResponse;
4144
+ /**
4145
+ * 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.
4148
+ * Format: uri
4149
+ */
4150
+ docs_url?: string | null;
4151
+ /**
4152
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
4153
+ * Format: uri
4154
+ */
4155
+ docs_index_url?: string | null;
4156
+ }
4157
+
4158
+ /** Response shape for ConfigResponse. */
4159
+ export interface ConfigResponseRead {
4160
+ /**
4161
+ * Wire names of query/header parameters that become settable once on the generated client and
4162
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
4163
+ * are reported as generation warnings.
4164
+ */
4165
+ globals?: string[];
4166
+ retries?: RetryTuningResponse;
4167
+ /**
4168
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
4169
+ * reported as generation warnings.
4170
+ */
4171
+ pagination?: Record<string, PaginationRuleResponseRead | boolean>;
4172
+ graphql?: GraphqlSettingsResponseRead;
4173
+ auth?: AuthenticationConfigResponse;
4174
+ cli?: CliBehaviorResponse;
4175
+ mcp?: McpBehaviorResponseRead;
4176
+ readme?: ReadmeBehaviorResponse;
4177
+ package?: PackageBehaviorResponse;
4178
+ /**
4179
+ * 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.
4182
+ * Format: uri
4183
+ */
4184
+ docs_url?: string | null;
4185
+ /**
4186
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
4187
+ * Format: uri
4188
+ */
4189
+ docs_index_url?: string | null;
4190
+ }
4191
+
4192
+ /**
4193
+ * Shared generated-client and tooling behavior for a stored Project. Every Target inherits these
4194
+ * defaults. Target.config is merged over them for one Target; top-level values replace defaults
4195
+ * 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.
4197
+ */
4198
+ export interface ProjectConfigResponse {
4199
+ /**
4200
+ * Wire names of query/header parameters that become settable once on the generated client and
4201
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
4202
+ * are reported as generation warnings.
4203
+ */
4204
+ globals?: string[];
4205
+ retries?: RetryTuningResponse;
4206
+ /**
4207
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
4208
+ * reported as generation warnings.
4209
+ */
4210
+ pagination?: Record<string, PaginationRuleResponse | boolean>;
4211
+ auth?: AuthenticationConfigResponse;
4212
+ cli?: CliBehaviorResponse;
4213
+ mcp?: McpBehaviorResponse;
4214
+ readme?: ReadmeBehaviorResponse;
4215
+ package?: PackageBehaviorResponse;
4216
+ /**
4217
+ * 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.
4220
+ * Format: uri
4221
+ */
4222
+ docs_url?: string | null;
4223
+ /**
4224
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
4225
+ * Format: uri
4226
+ */
4227
+ docs_index_url?: string | null;
4228
+ }
4229
+
4230
+ /** Response shape for ProjectConfigResponse. */
4231
+ export interface ProjectConfigResponseRead {
4232
+ /**
4233
+ * Wire names of query/header parameters that become settable once on the generated client and
4234
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
4235
+ * are reported as generation warnings.
4236
+ */
4237
+ globals?: string[];
4238
+ retries?: RetryTuningResponse;
4239
+ /**
4240
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
4241
+ * reported as generation warnings.
4242
+ */
4243
+ pagination?: Record<string, PaginationRuleResponseRead | boolean>;
4244
+ auth?: AuthenticationConfigResponse;
4245
+ cli?: CliBehaviorResponse;
4246
+ mcp?: McpBehaviorResponseRead;
4247
+ readme?: ReadmeBehaviorResponse;
4248
+ package?: PackageBehaviorResponse;
4249
+ /**
4250
+ * 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.
4253
+ * Format: uri
4254
+ */
4255
+ docs_url?: string | null;
4256
+ /**
4257
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
4258
+ * Format: uri
4259
+ */
4260
+ docs_index_url?: string | null;
4261
+ }
4262
+
4263
+ /**
4264
+ * Target-specific generation and delivery overrides. Authentication may only select a Project-owned
4265
+ * OAuth application. OAuth server metadata, applications, and identity policy remain Project-owned.
4266
+ * Self-hosted MCP access may be overridden for a Target-specific deployment.
4267
+ */
4268
+ export interface TargetConfigResponse {
4269
+ /**
4270
+ * Wire names of query/header parameters that become settable once on the generated client and
4271
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
4272
+ * are reported as generation warnings.
4273
+ */
4274
+ globals?: string[];
4275
+ retries?: RetryTuningResponse;
4276
+ /**
4277
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
4278
+ * reported as generation warnings.
4279
+ */
4280
+ pagination?: Record<string, PaginationRuleResponse | boolean>;
4281
+ auth?: TargetAuthenticationConfigResponse;
4282
+ cli?: CliBehaviorResponse;
4283
+ mcp?: McpBehaviorResponse;
4284
+ readme?: ReadmeBehaviorResponse;
4285
+ package?: PackageBehaviorResponse;
4286
+ /**
4287
+ * 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.
4290
+ * Format: uri
4291
+ */
4292
+ docs_url?: string | null;
4293
+ /**
4294
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
4295
+ * Format: uri
4296
+ */
4297
+ docs_index_url?: string | null;
4298
+ }
4299
+
4300
+ /** Response shape for TargetConfigResponse. */
4301
+ export interface TargetConfigResponseRead {
4302
+ /**
4303
+ * Wire names of query/header parameters that become settable once on the generated client and
4304
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
4305
+ * are reported as generation warnings.
4306
+ */
4307
+ globals?: string[];
4308
+ retries?: RetryTuningResponse;
4309
+ /**
4310
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
4311
+ * reported as generation warnings.
4312
+ */
4313
+ pagination?: Record<string, PaginationRuleResponseRead | boolean>;
4314
+ auth?: TargetAuthenticationConfigResponse;
4315
+ cli?: CliBehaviorResponse;
4316
+ mcp?: McpBehaviorResponseRead;
4317
+ readme?: ReadmeBehaviorResponse;
4318
+ package?: PackageBehaviorResponse;
4319
+ /**
4320
+ * 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.
4323
+ * Format: uri
4324
+ */
4325
+ docs_url?: string | null;
4326
+ /**
4327
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
4328
+ * Format: uri
4329
+ */
4330
+ docs_index_url?: string | null;
4331
+ }
4332
+
4333
+ /** What a GraphQL schema cannot say about itself. Ignored for OpenAPI specs. */
4334
+ export interface GraphqlSettingsResponse {
4335
+ /**
4336
+ * The URL every request is POSTed to; the generated client's default baseUrl. Defaults to the URL
4337
+ * the schema was fetched from. Without either, baseUrl is a required client option.
4338
+ * Format: uri
4339
+ */
4340
+ endpoint?: string;
4341
+ /**
4342
+ * Named endpoints (sandbox, production). Each becomes a client environment; the first is the
4343
+ * default unless endpoint is set.
4344
+ */
4345
+ environments?: Array<{
4346
+ name: string;
4347
+ /** Format: uri */
4348
+ url: string;
4349
+ }>;
4350
+ /**
4351
+ * How requests authenticate. bearer sends Authorization: Bearer; basic is for key-pair APIs
4352
+ * (public key as username, private key as password); api_key sends a header named by
4353
+ * api_key_header; none generates no auth option.
4354
+ * Default: "bearer"
4355
+ */
4356
+ auth?: "bearer" | "basic" | "api_key" | "none";
4357
+ /**
4358
+ * Header carrying the key when auth is api_key. Required for that mode; Typeship does not invent
4359
+ * a vendor-specific header name.
4360
+ */
4361
+ api_key_header?: string;
4362
+ /**
4363
+ * The API's name; drives the package and client names ("Acme" gives acme and AcmeClient).
4364
+ * Defaults to a name derived from the endpoint's host.
4365
+ */
4366
+ title?: string;
4367
+ /**
4368
+ * JSON representation of each custom scalar, keyed by GraphQL scalar name. Unmapped scalars
4369
+ * generate as the language's untyped JSON value and produce a warning. Unmatched keys warn.
4370
+ */
4371
+ scalars?: Record<string, "string" | "integer" | "number" | "boolean" | "json">;
4372
+ }
4373
+
4374
+ /** Response shape for GraphqlSettingsResponse. */
4375
+ export interface GraphqlSettingsResponseRead {
4376
+ /**
4377
+ * The URL every request is POSTed to; the generated client's default baseUrl. Defaults to the URL
4378
+ * the schema was fetched from. Without either, baseUrl is a required client option.
4379
+ * Format: uri
4380
+ */
4381
+ endpoint?: string;
4382
+ /**
4383
+ * Named endpoints (sandbox, production). Each becomes a client environment; the first is the
4384
+ * default unless endpoint is set.
4385
+ */
4386
+ environments?: Array<{
4387
+ name: string;
4388
+ /** Format: uri */
4389
+ url: string;
4390
+ }>;
4391
+ /**
4392
+ * How requests authenticate. bearer sends Authorization: Bearer; basic is for key-pair APIs
4393
+ * (public key as username, private key as password); api_key sends a header named by
4394
+ * api_key_header; none generates no auth option.
4395
+ * Default: "bearer"
4396
+ */
4397
+ auth?: ("bearer" | "basic" | "api_key" | "none") | (string & {});
4398
+ /**
4399
+ * Header carrying the key when auth is api_key. Required for that mode; Typeship does not invent
4400
+ * a vendor-specific header name.
4401
+ */
4402
+ api_key_header?: string;
4403
+ /**
4404
+ * The API's name; drives the package and client names ("Acme" gives acme and AcmeClient).
4405
+ * Defaults to a name derived from the endpoint's host.
4406
+ */
4407
+ title?: string;
4408
+ /**
4409
+ * JSON representation of each custom scalar, keyed by GraphQL scalar name. Unmapped scalars
4410
+ * generate as the language's untyped JSON value and produce a warning. Unmatched keys warn.
4411
+ */
4412
+ scalars?: Record<string, ("string" | "integer" | "number" | "boolean" | "json") | (string & {})>;
4413
+ }
4414
+
4415
+ /**
4416
+ * Retry behavior. Top-level fields adjust every operation; operations maps operationId or "METHOD
4417
+ * /path" keys to per-operation overrides.
4418
+ */
4419
+ export interface RetryTuningResponse {
4420
+ max_retries?: number;
4421
+ /** Replaces the default retryable set (408, 429, 500, 502, 503, 504). */
4422
+ statuses?: number[];
4423
+ initial_delay_ms?: number;
4424
+ max_delay_ms?: number;
4425
+ /** Also retry non-idempotent methods (POST/PATCH). */
4426
+ retry_non_idempotent?: boolean;
4427
+ /** Shorthand for max_retries 0. */
4428
+ disabled?: boolean;
4429
+ operations?: Record<string, RetryTuningResponse>;
4430
+ }
4431
+
4432
+ export interface PaginationRuleResponse {
4433
+ /** Default: "cursor" */
4434
+ style?: "cursor" | "cursorFromLastId" | "page" | "offset";
4435
+ /** Response field holding the item array. */
4436
+ items_field: string;
4437
+ cursor_param?: string;
4438
+ next_cursor_field?: string;
4439
+ has_more_field?: string;
4440
+ id_field?: string;
4441
+ page_param?: string;
4442
+ offset_param?: string;
4443
+ limit_param?: string;
4444
+ }
4445
+
4446
+ /** Response shape for PaginationRuleResponse. */
4447
+ export interface PaginationRuleResponseRead {
4448
+ /** Default: "cursor" */
4449
+ style?: ("cursor" | "cursorFromLastId" | "page" | "offset") | (string & {});
4450
+ /** Response field holding the item array. */
4451
+ items_field: string;
4452
+ cursor_param?: string;
4453
+ next_cursor_field?: string;
4454
+ has_more_field?: string;
4455
+ id_field?: string;
4456
+ page_param?: string;
4457
+ offset_param?: string;
4458
+ limit_param?: string;
4459
+ }
4460
+
4461
+ export interface ErrorModel {
4462
+ errors: ErrorDetail[];
4463
+ request_id: RequestId;
4464
+ }
4465
+
4466
+ /** Response shape for ErrorModel. */
4467
+ export interface ErrorModelRead {
4468
+ errors: ErrorDetailRead[];
4469
+ request_id: RequestId;
4470
+ }
4471
+
4472
+ /** Git file mode. 100755 is executable; 120000 is a symbolic link whose content is its target. */
4473
+ export const GitFileMode = {
4474
+ V_100644: "100644",
4475
+ V_100755: "100755",
4476
+ V_120000: "120000",
4477
+ } as const;
4478
+ export type GitFileMode = (typeof GitFileMode)[keyof typeof GitFileMode];
4479
+
4480
+ /**
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).
4485
+ */
4486
+ export const DraftFileSide = {
4487
+ BASE: "base",
4488
+ REPOSITORY: "repository",
4489
+ INCOMING: "incoming",
4490
+ ACCEPTED: "accepted",
4491
+ DEFAULT: "default",
4492
+ DRAFT: "draft",
4493
+ } as const;
4494
+ export type DraftFileSide = (typeof DraftFileSide)[keyof typeof DraftFileSide];
4495
+
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 & {});
4511
+ }
4512
+
4513
+ export interface DraftFileConflict {
4514
+ /**
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
4518
+ * deleted a file the other changed. overlapping_text: both sides edited the same lines.
4519
+ * too_large_to_merge: the file has too many changed lines to merge line by line. binary_changed
4520
+ * and file_mode_changed: both sides changed binary content or the file mode.
4521
+ */
4522
+ kind: "no_common_version"
4523
+ | "file_ownership"
4524
+ | "repository_deleted_incoming_changed"
4525
+ | "incoming_deleted_repository_changed"
4526
+ | "overlapping_text"
4527
+ | "too_large_to_merge"
4528
+ | "binary_changed"
4529
+ | "file_mode_changed";
4530
+ /**
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.
4535
+ */
4536
+ source: "generation" | "default_branch" | "previous_draft";
4537
+ /**
4538
+ * Decision saved for this conflict on head_revision; null when none. Saved decisions apply when
4539
+ * the Target is generated.
4540
+ */
4541
+ decision: "repository" | "incoming" | "content" | null;
4542
+ }
4543
+
4544
+ /** Response shape for DraftFileConflict. */
4545
+ export interface DraftFileConflictRead {
4546
+ /**
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
4550
+ * deleted a file the other changed. overlapping_text: both sides edited the same lines.
4551
+ * too_large_to_merge: the file has too many changed lines to merge line by line. binary_changed
4552
+ * and file_mode_changed: both sides changed binary content or the file mode.
4553
+ */
4554
+ kind: ("no_common_version"
4555
+ | "file_ownership"
4556
+ | "repository_deleted_incoming_changed"
4557
+ | "incoming_deleted_repository_changed"
4558
+ | "overlapping_text"
4559
+ | "too_large_to_merge"
4560
+ | "binary_changed"
4561
+ | "file_mode_changed") | (string & {});
4562
+ /**
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.
4567
+ */
4568
+ source: ("generation" | "default_branch" | "previous_draft") | (string & {});
4569
+ /**
4570
+ * Decision saved for this conflict on head_revision; null when none. Saved decisions apply when
4571
+ * the Target is generated.
4572
+ */
4573
+ decision: ("repository" | "incoming" | "content" | null) | (string & {}) | null;
4574
+ }
4575
+
4576
+ export interface DraftFileHistory {
4577
+ /**
4578
+ * How the rewritten default branch differs from the last accepted package; null when only the
4579
+ * Draft differs.
4580
+ */
4581
+ change: "added" | "edited" | "deleted" | "mode_changed" | null;
4582
+ /**
4583
+ * The Draft branch has a different version than the rewritten default branch. Recovery carries
4584
+ * the Draft version forward.
4585
+ */
4586
+ draft_differs: boolean;
4587
+ }
4588
+
4589
+ /** Response shape for DraftFileHistory. */
4590
+ export interface DraftFileHistoryRead {
4591
+ /**
4592
+ * How the rewritten default branch differs from the last accepted package; null when only the
4593
+ * Draft differs.
4594
+ */
4595
+ change: ("added" | "edited" | "deleted" | "mode_changed" | null) | (string & {}) | null;
4596
+ /**
4597
+ * The Draft branch has a different version than the rewritten default branch. Recovery carries
4598
+ * the Draft version forward.
4599
+ */
4600
+ draft_differs: boolean;
4601
+ }
4602
+
4603
+ export interface DraftFile {
4604
+ object: "draft_file";
4605
+ /** Path relative to the Target's package directory. */
4606
+ path: string;
4607
+ /** How the Draft differs from the last accepted package at this path; null when it does not. */
4608
+ customization: "added" | "edited" | "deleted" | "mode_changed" | null;
4609
+ conflict: DraftFileConflict | null;
4610
+ 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[];
4616
+ }
4617
+
4618
+ /** Response shape for DraftFile. */
4619
+ export interface DraftFileRead {
4620
+ object: "draft_file" | (string & {});
4621
+ /** Path relative to the Target's package directory. */
4622
+ path: string;
4623
+ /** How the Draft differs from the last accepted package at this path; null when it does not. */
4624
+ customization: ("added" | "edited" | "deleted" | "mode_changed" | null) | (string & {}) | null;
4625
+ conflict: DraftFileConflictRead | null;
4626
+ 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[];
4632
+ }
4633
+
4634
+ export interface DraftFileList {
4635
+ object: ListObject;
4636
+ data: DraftFile[];
4637
+ has_more: boolean;
4638
+ next_cursor: string | null;
4639
+ request_id: RequestId;
4640
+ }
4641
+
4642
+ /** Response shape for DraftFileList. */
4643
+ export interface DraftFileListRead {
4644
+ object: ListObject;
4645
+ data: DraftFileRead[];
4646
+ has_more: boolean;
4647
+ next_cursor: string | null;
4648
+ request_id: RequestId;
4649
+ }
4650
+
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
+ export type DraftConflictDecision = {
4706
+ path: string;
4707
+ /** Keep that version of the file exactly. Keeping an absent version deletes the path. */
4708
+ keep: "repository" | "incoming";
4709
+ }
4710
+ | {
4711
+ path: string;
4712
+ keep: "content";
4713
+ /** Final file text, stored as UTF-8. An empty string creates an empty file. */
4714
+ content: string;
4715
+ mode: GitFileMode;
4716
+ }
4717
+ | {
4718
+ path: string;
4719
+ keep: "content";
4720
+ /** Final file bytes as canonical base64, for binary files. */
4721
+ content_base64: string;
4722
+ mode: GitFileMode;
4723
+ }
4724
+ | {
4725
+ path: string;
4726
+ keep: "content";
4727
+ /** Delete this file. */
4728
+ content: null;
4729
+ };
4730
+
4731
+ /** Response shape for DraftConflictDecision. */
4732
+ export type DraftConflictDecisionRead = {
4733
+ path: string;
4734
+ /** Keep that version of the file exactly. Keeping an absent version deletes the path. */
4735
+ keep: ("repository" | "incoming") | (string & {});
4736
+ }
4737
+ | {
4738
+ path: string;
4739
+ keep: "content" | (string & {});
4740
+ /** Final file text, stored as UTF-8. An empty string creates an empty file. */
4741
+ content: string;
4742
+ mode: GitFileMode | (string & {});
4743
+ }
4744
+ | {
4745
+ path: string;
4746
+ keep: "content" | (string & {});
4747
+ /** Final file bytes as canonical base64, for binary files. */
4748
+ content_base64: string;
4749
+ mode: GitFileMode | (string & {});
4750
+ }
4751
+ | {
4752
+ path: string;
4753
+ keep: "content" | (string & {});
4754
+ /** Delete this file. */
4755
+ content: null;
4756
+ };
4757
+
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;
4761
+ /**
4762
+ * Unique current conflict paths. Final file content must total at most 2 MiB. Decisions save
4763
+ * together or not at all.
4764
+ */
4765
+ resolutions: DraftConflictDecision[];
4766
+ /**
4767
+ * Validate the decisions and return the planned files without saving.
4768
+ * Default: false
4769
+ */
4770
+ dry_run?: boolean;
4771
+ }
4772
+
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;
4777
+ /**
4778
+ * Unique current conflict paths. Final file content must total at most 2 MiB. Decisions save
4779
+ * together or not at all.
4780
+ */
4781
+ 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
+ }
4891
+
4892
+ export type DraftCustomizationDiscardResponse = DraftCustomizationDiscard & ResponseMetadata;
4893
+
4894
+ /** Response shape for DraftCustomizationDiscardResponse. */
4895
+ export type DraftCustomizationDiscardResponseRead = DraftCustomizationDiscardRead & ResponseMetadata;
4896
+
4897
+ export interface GenerateProjectRequest {
4898
+ /** Generate only this active Target. Omit to generate all active Targets in the Project. */
4899
+ target_id?: TargetId;
4900
+ }
4901
+
4902
+ /** The stage that failed. A delivery failure does not change a Generation's succeeded status. */
4903
+ export const FailurePhase = {
4904
+ DEFINITION: "definition",
4905
+ GENERATION: "generation",
4906
+ DELIVERY: "delivery",
4907
+ PUBLICATION: "publication",
4908
+ } as const;
4909
+ export type FailurePhase = (typeof FailurePhase)[keyof typeof FailurePhase];
4910
+
4911
+ export type DomainError = ErrorDetail & {
4912
+ phase: FailurePhase;
4913
+ };
4914
+
4915
+ /** Response shape for DomainError. */
4916
+ export type DomainErrorRead = ErrorDetailRead & {
4917
+ phase: FailurePhase | (string & {});
4918
+ };
4919
+
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;
4954
+ }
4955
+
4956
+ export type DraftHistoryRecoveryResponse = DraftHistoryRecovery & ResponseMetadata;
4957
+
4958
+ /** Response shape for DraftHistoryRecoveryResponse. */
4959
+ export type DraftHistoryRecoveryResponseRead = DraftHistoryRecoveryRead & ResponseMetadata;