@typeship-ax/cli 0.9.1 → 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 +6257 -589
  4. package/api.md +475 -81
  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 -31
  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 +285 -22
  45. package/dist/resources/targets.d.ts.map +1 -1
  46. package/dist/resources/targets.js +408 -10
  47. package/dist/schemas.d.ts +1 -0
  48. package/dist/schemas.d.ts.map +1 -1
  49. package/dist/schemas.js +175 -102
  50. package/dist/types.d.ts +2162 -134
  51. package/dist/types.d.ts.map +1 -1
  52. package/dist/types.js +99 -2
  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 -31
  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 +756 -13
  69. package/src/schemas.ts +176 -103
  70. package/src/types.ts +2372 -189
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;
@@ -34,15 +34,19 @@ export type DeliveryId = string;
34
34
 
35
35
  export type TargetReleaseId = string;
36
36
 
37
+ export type PublicationId = string;
38
+
37
39
  /**
38
40
  * Generator implementation selected by a Target. This is configuration, not identity; several
39
- * 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.
40
43
  */
41
44
  export const GeneratorKind = {
42
45
  TYPESCRIPT_SDK: "typescript-sdk",
43
46
  PYTHON_SDK: "python-sdk",
44
47
  GO_SDK: "go-sdk",
45
48
  CLI: "cli",
49
+ GO_CLI: "go-cli",
46
50
  MCP: "mcp",
47
51
  } as const;
48
52
  export type GeneratorKind = (typeof GeneratorKind)[keyof typeof GeneratorKind];
@@ -56,7 +60,7 @@ export interface UrlDefinitionInput {
56
60
  url: string;
57
61
  /**
58
62
  * Request headers for a protected URL. Sent on the document GET and GraphQL introspection POST,
59
- * never returned or retained by stateless generation.
63
+ * never returned or retained by one-shot generation.
60
64
  */
61
65
  headers?: Record<string, string>;
62
66
  }
@@ -76,15 +80,49 @@ export interface InlineDefinitionInput {
76
80
  inline: string;
77
81
  }
78
82
 
79
- /** 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. */
80
84
  export type DefinitionInput = UrlDefinitionInput | InlineDefinitionInput;
81
85
 
82
86
  /** Response shape for DefinitionInput. */
83
87
  export type DefinitionInputRead = UrlDefinitionInputRead | InlineDefinitionInput;
84
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
+
85
123
  export interface GenerateRequest {
86
124
  definition: DefinitionInput;
87
- /** Stateless generator descriptor; no persisted Target is created. */
125
+ /** One-shot generator descriptor; no persisted Target is created. */
88
126
  target: {
89
127
  generator: GeneratorKind;
90
128
  };
@@ -94,17 +132,18 @@ export interface GenerateRequest {
94
132
  */
95
133
  package_name?: string;
96
134
  /**
97
- * Go module path override. Valid only for the Go SDK. Linked projects derive this from the Go
98
- * 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.
99
137
  */
100
138
  module_path?: string;
139
+ go_sdk?: GoSdkDescriptor;
101
140
  config?: Config;
102
141
  }
103
142
 
104
143
  /** Response shape for GenerateRequest. */
105
144
  export interface GenerateRequestRead {
106
145
  definition: DefinitionInputRead;
107
- /** Stateless generator descriptor; no persisted Target is created. */
146
+ /** One-shot generator descriptor; no persisted Target is created. */
108
147
  target: {
109
148
  generator: GeneratorKind | (string & {});
110
149
  };
@@ -114,10 +153,11 @@ export interface GenerateRequestRead {
114
153
  */
115
154
  package_name?: string;
116
155
  /**
117
- * Go module path override. Valid only for the Go SDK. Linked projects derive this from the Go
118
- * 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.
119
158
  */
120
159
  module_path?: string;
160
+ go_sdk?: GoSdkDescriptor;
121
161
  config?: ConfigRead;
122
162
  }
123
163
 
@@ -125,6 +165,23 @@ export interface GeneratedFile {
125
165
  /** Repo-relative path inside the generated package. */
126
166
  path: string;
127
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 & {});
128
185
  }
129
186
 
130
187
  export interface GenerationMeta {
@@ -146,6 +203,18 @@ export interface GenerationMeta {
146
203
  * Generation.
147
204
  */
148
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
+ };
149
218
  resource_count?: number;
150
219
  operation_count?: number;
151
220
  schema_count?: number;
@@ -162,11 +231,6 @@ export interface GenerationMeta {
162
231
  * matched, or could not be opened.
163
232
  */
164
233
  pr_status?: "opened" | "no_changes" | "blocked";
165
- /**
166
- * Why the configured destination pull request was not opened. Generation itself still succeeded;
167
- * fix this action and regenerate.
168
- */
169
- pr_error?: string;
170
234
  /**
171
235
  * Markdown changelog entry for this regeneration, from the API surface diff. Absent on a first
172
236
  * generation or when nothing changed.
@@ -178,10 +242,10 @@ export interface GenerationMeta {
178
242
  */
179
243
  breaking_count?: number;
180
244
  /**
181
- * What the diff was measured against; "destination" means the .typeship/surface.json merged in
182
- * 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.
183
247
  */
184
- baseline?: "destination" | "none";
248
+ baseline?: "destination" | "last-generation" | "none";
185
249
  /** Objective compatibility of the generated API surface against the merged destination baseline. */
186
250
  api_compatibility?: "compatible" | "breaking" | "unknown";
187
251
  /**
@@ -198,11 +262,23 @@ export interface GenerationMeta {
198
262
  * The destination pull request's combined readiness decision for the exact bot-generated head.
199
263
  * Compatibility and version correctness remain separate fields above.
200
264
  */
201
- release_readiness?: "success" | "failure" | "error";
265
+ release_readiness?: "success" | "failure" | "pending" | "error";
202
266
  /** The release-readiness decision in one line, as the commit status describes it. */
203
267
  release_readiness_note?: string;
204
268
  /** The package version the destination had before this regeneration. */
205
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;
206
282
  file_count?: number;
207
283
  total_lines?: number;
208
284
  /** Deterministic Diagnostic summary for the exact Definition Revision consumed. */
@@ -232,6 +308,18 @@ export interface GenerationMetaRead {
232
308
  * Generation.
233
309
  */
234
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
+ };
235
323
  resource_count?: number;
236
324
  operation_count?: number;
237
325
  schema_count?: number;
@@ -248,11 +336,6 @@ export interface GenerationMetaRead {
248
336
  * matched, or could not be opened.
249
337
  */
250
338
  pr_status?: ("opened" | "no_changes" | "blocked") | (string & {});
251
- /**
252
- * Why the configured destination pull request was not opened. Generation itself still succeeded;
253
- * fix this action and regenerate.
254
- */
255
- pr_error?: string;
256
339
  /**
257
340
  * Markdown changelog entry for this regeneration, from the API surface diff. Absent on a first
258
341
  * generation or when nothing changed.
@@ -264,10 +347,10 @@ export interface GenerationMetaRead {
264
347
  */
265
348
  breaking_count?: number;
266
349
  /**
267
- * What the diff was measured against; "destination" means the .typeship/surface.json merged in
268
- * 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.
269
352
  */
270
- baseline?: ("destination" | "none") | (string & {});
353
+ baseline?: ("destination" | "last-generation" | "none") | (string & {});
271
354
  /** Objective compatibility of the generated API surface against the merged destination baseline. */
272
355
  api_compatibility?: ("compatible" | "breaking" | "unknown") | (string & {});
273
356
  /**
@@ -284,11 +367,23 @@ export interface GenerationMetaRead {
284
367
  * The destination pull request's combined readiness decision for the exact bot-generated head.
285
368
  * Compatibility and version correctness remain separate fields above.
286
369
  */
287
- release_readiness?: ("success" | "failure" | "error") | (string & {});
370
+ release_readiness?: ("success" | "failure" | "pending" | "error") | (string & {});
288
371
  /** The release-readiness decision in one line, as the commit status describes it. */
289
372
  release_readiness_note?: string;
290
373
  /** The package version the destination had before this regeneration. */
291
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;
292
387
  file_count?: number;
293
388
  total_lines?: number;
294
389
  /** Deterministic Diagnostic summary for the exact Definition Revision consumed. */
@@ -300,6 +395,7 @@ export interface GenerationMetaRead {
300
395
 
301
396
  export interface GenerationResult {
302
397
  files: GeneratedFile[];
398
+ download?: GenerationDownload;
303
399
  warnings: string[];
304
400
  meta: GenerationMeta;
305
401
  limits?: GenerationLimits;
@@ -319,7 +415,8 @@ export interface GenerationResult {
319
415
 
320
416
  /** Response shape for GenerationResult. */
321
417
  export interface GenerationResultRead {
322
- files: GeneratedFile[];
418
+ files: GeneratedFileRead[];
419
+ download?: GenerationDownload;
323
420
  warnings: string[];
324
421
  meta: GenerationMetaRead;
325
422
  limits?: GenerationLimitsRead;
@@ -337,6 +434,23 @@ export interface GenerationResultRead {
337
434
  request_id: RequestId;
338
435
  }
339
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
+
340
454
  /**
341
455
  * Present when the generation was capped: by the free plan, or because the call was anonymous.
342
456
  * Absent on uncapped generations.
@@ -424,7 +538,7 @@ export interface RepositoryReferenceRead {
424
538
 
425
539
  export interface RepositoryDefinitionSource {
426
540
  kind: "repository";
427
- repository: RepositoryReference;
541
+ repository: RepositoryReferenceResponse;
428
542
  /** Repository-relative Definition entrypoint. */
429
543
  path: string;
430
544
  }
@@ -432,7 +546,7 @@ export interface RepositoryDefinitionSource {
432
546
  /** Response shape for RepositoryDefinitionSource. */
433
547
  export interface RepositoryDefinitionSourceRead {
434
548
  kind: "repository" | (string & {});
435
- repository: RepositoryReferenceRead;
549
+ repository: RepositoryReferenceResponseRead;
436
550
  /** Repository-relative Definition entrypoint. */
437
551
  path: string;
438
552
  }
@@ -556,7 +670,7 @@ export interface DiagnosticFix {
556
670
  */
557
671
  kind: "spec_patch" | "source_edit";
558
672
  /** Exact patches when kind is spec_patch. */
559
- patches?: DefinitionPatch[];
673
+ patches?: DefinitionPatchResponse[];
560
674
  /** Source-level guidance when an exact patch would invent intent. */
561
675
  instructions?: string;
562
676
  }
@@ -571,7 +685,7 @@ export interface DiagnosticFixRead {
571
685
  */
572
686
  kind: ("spec_patch" | "source_edit") | (string & {});
573
687
  /** Exact patches when kind is spec_patch. */
574
- patches?: DefinitionPatchRead[];
688
+ patches?: DefinitionPatchResponseRead[];
575
689
  /** Source-level guidance when an exact patch would invent intent. */
576
690
  instructions?: string;
577
691
  }
@@ -588,10 +702,19 @@ export interface Diagnostic {
588
702
  title: string;
589
703
  /** What the API author should change. */
590
704
  description: string;
591
- /** Why consumers of generated SDK, CLI, or MCP surfaces care. */
705
+ /** Why consumers of generated CLI, MCP, or SDK surfaces care. */
592
706
  impact: string;
593
707
  /** Public surfaces affected by the root cause. */
594
708
  surfaces: Array<"api" | "sdk" | "cli" | "mcp">;
709
+ /**
710
+ * Whether the finding is provable from the Definition, a conservative review suggestion, or a
711
+ * documented Typeship implementation limitation.
712
+ */
713
+ evidence_basis: "contract" | "heuristic" | "implementation";
714
+ /** Whether remediation requires intent that the Definition cannot prove. */
715
+ owner_decision_required: boolean;
716
+ /** Concrete generated CLI, MCP, or SDK naming effect when Typeship can state it. */
717
+ surface_impact?: string;
595
718
  /** All affected coordinates, kept under one grouped diagnostic. */
596
719
  locations: DiagnosticLocation[];
597
720
  fix?: DiagnosticFix;
@@ -614,10 +737,19 @@ export interface DiagnosticRead {
614
737
  title: string;
615
738
  /** What the API author should change. */
616
739
  description: string;
617
- /** Why consumers of generated SDK, CLI, or MCP surfaces care. */
740
+ /** Why consumers of generated CLI, MCP, or SDK surfaces care. */
618
741
  impact: string;
619
742
  /** Public surfaces affected by the root cause. */
620
743
  surfaces: Array<("api" | "sdk" | "cli" | "mcp") | (string & {})>;
744
+ /**
745
+ * Whether the finding is provable from the Definition, a conservative review suggestion, or a
746
+ * documented Typeship implementation limitation.
747
+ */
748
+ evidence_basis: ("contract" | "heuristic" | "implementation") | (string & {});
749
+ /** Whether remediation requires intent that the Definition cannot prove. */
750
+ owner_decision_required: boolean;
751
+ /** Concrete generated CLI, MCP, or SDK naming effect when Typeship can state it. */
752
+ surface_impact?: string;
621
753
  /** All affected coordinates, kept under one grouped diagnostic. */
622
754
  locations: DiagnosticLocation[];
623
755
  fix?: DiagnosticFixRead;
@@ -702,6 +834,24 @@ export interface DiagnosticEvaluationRead {
702
834
  suppressed_occurrences: number;
703
835
  }
704
836
 
837
+ /** Current-revision suppression usage for one stable Diagnostic rule. */
838
+ export interface DiagnosticSuppressionSignal {
839
+ rule_id: string;
840
+ /** Current occurrences of this rule that are not suppressed. */
841
+ active_occurrences: number;
842
+ suppressed_occurrences: number;
843
+ }
844
+
845
+ /**
846
+ * Current-revision signals for tuning Diagnostics policy. These counts do not claim that a
847
+ * suppression is a false positive or that runtime behavior has been verified.
848
+ */
849
+ export interface DiagnosticQualitySignals {
850
+ suppressed_by_rule: DiagnosticSuppressionSignal[];
851
+ /** Reviewed exceptions whose rule or exact path no longer matches this revision. */
852
+ stale_suppressions: DiagnosticSuppressionResponse[];
853
+ }
854
+
705
855
  /** Compact rule and location reference; full guidance appears once in diagnostics. */
706
856
  export interface DiagnosticReference {
707
857
  rule_id: string;
@@ -750,8 +900,9 @@ export interface DiagnosticReport {
750
900
  summary: DiagnosticSummary;
751
901
  /** Stable grouped diagnostics, ordered by severity and rule identifier. */
752
902
  diagnostics: Diagnostic[];
753
- policy: DiagnosticPolicy;
903
+ policy: DiagnosticPolicyResponse;
754
904
  evaluation: DiagnosticEvaluation;
905
+ quality_signals: DiagnosticQualitySignals;
755
906
  delta: DiagnosticDelta;
756
907
  request_id: RequestId;
757
908
  }
@@ -772,8 +923,9 @@ export interface DiagnosticReportRead {
772
923
  summary: DiagnosticSummary;
773
924
  /** Stable grouped diagnostics, ordered by severity and rule identifier. */
774
925
  diagnostics: DiagnosticRead[];
775
- policy: DiagnosticPolicyRead;
926
+ policy: DiagnosticPolicyResponseRead;
776
927
  evaluation: DiagnosticEvaluationRead;
928
+ quality_signals: DiagnosticQualitySignals;
777
929
  delta: DiagnosticDeltaRead;
778
930
  request_id: RequestId;
779
931
  }
@@ -814,8 +966,13 @@ export interface RepositoryDeliveryInput {
814
966
  directory?: string | null;
815
967
  /** npm or Python registry identity where applicable. */
816
968
  package_name?: string | null;
817
- /** Explicit Go module path where applicable. */
969
+ /** Go module identity for the Go SDK or Go CLI Target where applicable. */
818
970
  module_path?: string | null;
971
+ /**
972
+ * Commit repository-owned registry automation and report publication after the Draft merges.
973
+ * Default: false
974
+ */
975
+ publish_on_merge?: boolean;
819
976
  }
820
977
 
821
978
  /** Response shape for RepositoryDeliveryInput. */
@@ -825,8 +982,13 @@ export interface RepositoryDeliveryInputRead {
825
982
  directory?: string | null;
826
983
  /** npm or Python registry identity where applicable. */
827
984
  package_name?: string | null;
828
- /** Explicit Go module path where applicable. */
985
+ /** Go module identity for the Go SDK or Go CLI Target where applicable. */
829
986
  module_path?: string | null;
987
+ /**
988
+ * Commit repository-owned registry automation and report publication after the Draft merges.
989
+ * Default: false
990
+ */
991
+ publish_on_merge?: boolean;
830
992
  }
831
993
 
832
994
  export interface HostedMcpDeliveryInput {
@@ -851,10 +1013,11 @@ export interface RepositoryDelivery {
851
1013
  target_id: TargetId;
852
1014
  kind: "repository";
853
1015
  state: "active" | "disabled";
854
- repository: RepositoryReference;
1016
+ repository: RepositoryReferenceResponse;
855
1017
  directory: string | null;
856
1018
  package_name: string | null;
857
1019
  module_path: string | null;
1020
+ publish_on_merge: boolean;
858
1021
  /** Format: date-time */
859
1022
  created_at: string;
860
1023
  /** Format: date-time */
@@ -868,10 +1031,11 @@ export interface RepositoryDeliveryRead {
868
1031
  target_id: TargetId;
869
1032
  kind: "repository" | (string & {});
870
1033
  state: ("active" | "disabled") | (string & {});
871
- repository: RepositoryReferenceRead;
1034
+ repository: RepositoryReferenceResponseRead;
872
1035
  directory: string | null;
873
1036
  package_name: string | null;
874
1037
  module_path: string | null;
1038
+ publish_on_merge: boolean;
875
1039
  /** Format: date-time */
876
1040
  created_at: string;
877
1041
  /** Format: date-time */
@@ -914,6 +1078,94 @@ export type DeliveryRead = RepositoryDeliveryRead
914
1078
  | HostedMcpDeliveryRead
915
1079
  | Record<string, unknown> & { kind?: string };
916
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
+
917
1169
  export interface TargetFields {
918
1170
  name: string;
919
1171
  definition_id: DefinitionId;
@@ -926,6 +1178,7 @@ export interface TargetFields {
926
1178
  release_channel?: "stable" | "prerelease";
927
1179
  /** Optional larger or prerelease SemVer for the next reviewed release. */
928
1180
  proposed_version?: string | null;
1181
+ checks?: TargetChecks;
929
1182
  /**
930
1183
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
931
1184
  * belong to the Definition.
@@ -947,6 +1200,7 @@ export interface TargetFieldsRead {
947
1200
  release_channel?: ("stable" | "prerelease") | (string & {});
948
1201
  /** Optional larger or prerelease SemVer for the next reviewed release. */
949
1202
  proposed_version?: string | null;
1203
+ checks?: TargetChecksRead;
950
1204
  /**
951
1205
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
952
1206
  * belong to the Definition.
@@ -965,6 +1219,7 @@ export interface InitialTargetFields {
965
1219
  /** Default: "stable" */
966
1220
  release_channel?: "stable" | "prerelease";
967
1221
  proposed_version?: string | null;
1222
+ checks?: TargetChecks;
968
1223
  /**
969
1224
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
970
1225
  * belong to the Definition.
@@ -984,6 +1239,7 @@ export interface InitialTargetFieldsRead {
984
1239
  /** Default: "stable" */
985
1240
  release_channel?: ("stable" | "prerelease") | (string & {});
986
1241
  proposed_version?: string | null;
1242
+ checks?: TargetChecksRead;
987
1243
  /**
988
1244
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
989
1245
  * belong to the Definition.
@@ -997,12 +1253,25 @@ export interface TargetUpdateRequest {
997
1253
  state?: "active" | "disabled";
998
1254
  edition?: string;
999
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
+ */
1000
1260
  proposed_version?: string | null;
1261
+ checks?: TargetChecks;
1001
1262
  /**
1002
- * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
1003
- * 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.
1004
1266
  */
1005
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
+ */
1006
1275
  deliveries?: DeliveryInput[];
1007
1276
  }
1008
1277
 
@@ -1012,16 +1281,71 @@ export interface TargetUpdateRequestRead {
1012
1281
  state?: ("active" | "disabled") | (string & {});
1013
1282
  edition?: string;
1014
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
+ */
1015
1288
  proposed_version?: string | null;
1289
+ checks?: TargetChecksRead;
1016
1290
  /**
1017
- * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
1018
- * 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.
1019
1294
  */
1020
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
+ */
1021
1303
  deliveries?: DeliveryInputRead[];
1022
1304
  }
1023
1305
 
1024
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 {
1025
1349
  id: TargetId;
1026
1350
  object: "target";
1027
1351
  project_id: ProjectId;
@@ -1035,13 +1359,19 @@ export interface Target {
1035
1359
  mode: "reviewed_semver";
1036
1360
  pre1_breaking: "minor";
1037
1361
  };
1038
- current_version: string;
1362
+ /**
1363
+ * Read-only version of the Target's Current release, or null before its first release. Registry
1364
+ * publication status is separate; inspect the Target Release for publication results.
1365
+ */
1366
+ current_version: string | null;
1039
1367
  proposed_version: string | null;
1368
+ proposed_version_source: "console" | "api" | "github" | null;
1369
+ checks: TargetChecksResponse;
1040
1370
  /**
1041
1371
  * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
1042
1372
  * never appear here.
1043
1373
  */
1044
- config: TargetConfig | null;
1374
+ config: TargetConfigResponse | null;
1045
1375
  /** At most one repository and one hosted MCP Delivery. */
1046
1376
  deliveries: Delivery[];
1047
1377
  /** Format: date-time */
@@ -1059,6 +1389,11 @@ export interface TargetRead {
1059
1389
  definition_id: DefinitionId;
1060
1390
  name: string;
1061
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;
1062
1397
  state: ("active" | "disabled") | (string & {});
1063
1398
  edition: string;
1064
1399
  release_channel: ("stable" | "prerelease") | (string & {});
@@ -1066,13 +1401,19 @@ export interface TargetRead {
1066
1401
  mode: "reviewed_semver" | (string & {});
1067
1402
  pre1_breaking: "minor" | (string & {});
1068
1403
  };
1069
- current_version: string;
1404
+ /**
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.
1407
+ */
1408
+ current_version: string | null;
1070
1409
  proposed_version: string | null;
1410
+ proposed_version_source: ("console" | "api" | "github" | null) | (string & {}) | null;
1411
+ checks: TargetChecksResponseRead;
1071
1412
  /**
1072
1413
  * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
1073
1414
  * never appear here.
1074
1415
  */
1075
- config: TargetConfigRead | null;
1416
+ config: TargetConfigResponseRead | null;
1076
1417
  /** At most one repository and one hosted MCP Delivery. */
1077
1418
  deliveries: DeliveryRead[];
1078
1419
  /** Format: date-time */
@@ -1084,6 +1425,9 @@ export interface TargetRead {
1084
1425
 
1085
1426
  export type TargetResponse = Target & ResponseMetadata;
1086
1427
 
1428
+ /** Request shape for TargetResponse. */
1429
+ export type TargetResponseWrite = TargetWrite & ResponseMetadata;
1430
+
1087
1431
  /** Response shape for TargetResponse. */
1088
1432
  export type TargetResponseRead = TargetRead & ResponseMetadata;
1089
1433
 
@@ -1095,6 +1439,15 @@ export interface TargetList {
1095
1439
  request_id: RequestId;
1096
1440
  }
1097
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
+
1098
1451
  /** Response shape for TargetList. */
1099
1452
  export interface TargetListRead {
1100
1453
  object: ListObject;
@@ -1108,16 +1461,32 @@ export interface TargetRelease {
1108
1461
  id: TargetReleaseId;
1109
1462
  object: "target_release";
1110
1463
  target_id: TargetId;
1111
- generation_id: GenerationId;
1464
+ /** Null only for a verified release imported during package adoption. */
1465
+ generation_id: GenerationId | null;
1466
+ origin: "typeship" | "imported";
1112
1467
  /** Immutable package version released from this Target. */
1113
1468
  version: string;
1114
1469
  channel: "stable" | "prerelease";
1115
1470
  /** Delivery provider that accepted the release. */
1116
1471
  provider: string;
1117
- repository: RepositoryReference | null;
1472
+ repository: RepositoryReferenceResponse | null;
1118
1473
  definition_revision_id: DefinitionRevisionId | null;
1119
1474
  /** Immutable provider-native revision that was merged or published. */
1120
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[];
1480
+ import_provenance: {
1481
+ tag: string | null;
1482
+ /** Format: uri */
1483
+ registry_url: string | null;
1484
+ artifact_digest: string | null;
1485
+ /** Format: date-time */
1486
+ imported_at: string | null;
1487
+ }
1488
+ | null;
1489
+ publications: Publication[];
1121
1490
  /** Format: date-time */
1122
1491
  created_at: string;
1123
1492
  request_id?: RequestId;
@@ -1128,16 +1497,32 @@ export interface TargetReleaseRead {
1128
1497
  id: TargetReleaseId;
1129
1498
  object: "target_release" | (string & {});
1130
1499
  target_id: TargetId;
1131
- generation_id: GenerationId;
1500
+ /** Null only for a verified release imported during package adoption. */
1501
+ generation_id: GenerationId | null;
1502
+ origin: ("typeship" | "imported") | (string & {});
1132
1503
  /** Immutable package version released from this Target. */
1133
1504
  version: string;
1134
1505
  channel: ("stable" | "prerelease") | (string & {});
1135
1506
  /** Delivery provider that accepted the release. */
1136
1507
  provider: string;
1137
- repository: RepositoryReferenceRead | null;
1508
+ repository: RepositoryReferenceResponseRead | null;
1138
1509
  definition_revision_id: DefinitionRevisionId | null;
1139
1510
  /** Immutable provider-native revision that was merged or published. */
1140
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[];
1516
+ import_provenance: {
1517
+ tag: string | null;
1518
+ /** Format: uri */
1519
+ registry_url: string | null;
1520
+ artifact_digest: string | null;
1521
+ /** Format: date-time */
1522
+ imported_at: string | null;
1523
+ }
1524
+ | null;
1525
+ publications: PublicationRead[];
1141
1526
  /** Format: date-time */
1142
1527
  created_at: string;
1143
1528
  request_id?: RequestId;
@@ -1165,81 +1550,397 @@ export interface TargetReleaseListRead {
1165
1550
  request_id: RequestId;
1166
1551
  }
1167
1552
 
1168
- export interface RepositoryHealthIssue {
1169
- code: "connection_missing"
1170
- | "definition_unreadable"
1171
- | "contents_write_missing"
1172
- | "review_write_missing"
1173
- | "breaking_acknowledgement_missing"
1174
- | "provider_unavailable";
1175
- message: string;
1176
- }
1177
-
1178
- /** Response shape for RepositoryHealthIssue. */
1179
- export interface RepositoryHealthIssueRead {
1180
- code: ("connection_missing"
1181
- | "definition_unreadable"
1182
- | "contents_write_missing"
1183
- | "review_write_missing"
1184
- | "breaking_acknowledgement_missing"
1185
- | "provider_unavailable") | (string & {});
1186
- message: string;
1187
- }
1188
-
1189
- export interface RepositoryHealth {
1190
- repository: RepositoryReference;
1191
- roles: Array<"source" | "destination">;
1192
- status: "ready" | "action_required";
1193
- default_branch?: string;
1194
- capabilities?: string[];
1195
- /**
1196
- * Whether a source repository has the optional typeship:breaking-approved policy label. Null when
1197
- * the repository is not a source or labels could not be read.
1198
- */
1199
- breaking_acknowledgement?: boolean | null;
1200
- definition?: "readable" | "missing";
1201
- issues: RepositoryHealthIssue[];
1553
+ export interface Publication {
1554
+ id: PublicationId;
1555
+ object: "publication";
1556
+ target_release_id: TargetReleaseId;
1557
+ destination: "github" | "npm" | "pypi" | "go" | "mcp";
1558
+ state: "pending" | "publishing" | "published" | "failed" | "disabled";
1559
+ attempt: number;
1560
+ /** Format: uri */
1561
+ run_url: string | null;
1562
+ /** Format: uri */
1563
+ registry_url: string | null;
1564
+ artifact_digest: string | null;
1565
+ /** Recorded failures. Empty when this resource has no recorded failure. */
1566
+ errors: DomainError[];
1567
+ /** Format: date-time */
1568
+ started_at: string | null;
1569
+ /** Format: date-time */
1570
+ finished_at: string | null;
1571
+ /** Format: date-time */
1572
+ updated_at: string;
1202
1573
  }
1203
1574
 
1204
- /** Response shape for RepositoryHealth. */
1205
- export interface RepositoryHealthRead {
1206
- repository: RepositoryReferenceRead;
1207
- roles: Array<("source" | "destination") | (string & {})>;
1208
- status: ("ready" | "action_required") | (string & {});
1209
- default_branch?: string;
1210
- capabilities?: string[];
1211
- /**
1212
- * Whether a source repository has the optional typeship:breaking-approved policy label. Null when
1213
- * the repository is not a source or labels could not be read.
1214
- */
1215
- breaking_acknowledgement?: boolean | null;
1216
- definition?: ("readable" | "missing") | (string & {});
1217
- issues: RepositoryHealthIssueRead[];
1575
+ /** Response shape for Publication. */
1576
+ export interface PublicationRead {
1577
+ id: PublicationId;
1578
+ object: "publication" | (string & {});
1579
+ target_release_id: TargetReleaseId;
1580
+ destination: ("github" | "npm" | "pypi" | "go" | "mcp") | (string & {});
1581
+ state: ("pending" | "publishing" | "published" | "failed" | "disabled") | (string & {});
1582
+ attempt: number;
1583
+ /** Format: uri */
1584
+ run_url: string | null;
1585
+ /** Format: uri */
1586
+ registry_url: string | null;
1587
+ artifact_digest: string | null;
1588
+ /** Recorded failures. Empty when this resource has no recorded failure. */
1589
+ errors: DomainErrorRead[];
1590
+ /** Format: date-time */
1591
+ started_at: string | null;
1592
+ /** Format: date-time */
1593
+ finished_at: string | null;
1594
+ /** Format: date-time */
1595
+ updated_at: string;
1218
1596
  }
1219
1597
 
1220
- export interface RepositoryEventHealth {
1221
- provider: string;
1222
- id: string;
1223
- event: string;
1224
- status: "queued" | "processing" | "succeeded" | "failed" | "superseded";
1225
- error: string | null;
1598
+ export type PublicationResponse = Publication & {
1226
1599
  /** Format: date-time */
1227
1600
  created_at: string;
1228
- }
1601
+ } & ResponseMetadata;
1229
1602
 
1230
- /** Response shape for RepositoryEventHealth. */
1231
- export interface RepositoryEventHealthRead {
1232
- provider: string;
1233
- id: string;
1234
- event: string;
1235
- status: ("queued" | "processing" | "succeeded" | "failed" | "superseded") | (string & {});
1236
- error: string | null;
1603
+ /** Response shape for PublicationResponse. */
1604
+ export type PublicationResponseRead = PublicationRead & {
1237
1605
  /** Format: date-time */
1238
1606
  created_at: string;
1607
+ } & ResponseMetadata;
1608
+
1609
+ export type TargetDraftSelection = {
1610
+ mode: "automatic";
1239
1611
  }
1612
+ | {
1613
+ mode: "exact";
1614
+ version: string;
1615
+ /** Where the selection was made. */
1616
+ source: "console" | "api" | "github" | null;
1617
+ };
1240
1618
 
1241
- export interface RepositoryIntegrationHealth {
1242
- object: "repository_integration_health";
1619
+ /** Response shape for TargetDraftSelection. */
1620
+ export type TargetDraftSelectionRead = {
1621
+ mode: "automatic" | (string & {});
1622
+ }
1623
+ | {
1624
+ mode: "exact" | (string & {});
1625
+ version: string;
1626
+ /** Where the selection was made. */
1627
+ source: ("console" | "api" | "github" | null) | (string & {}) | null;
1628
+ };
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
+
1729
+ export interface TargetDraft {
1730
+ object: "target_draft";
1731
+ target_id: TargetId;
1732
+ project_id: ProjectId;
1733
+ status: DraftStatus;
1734
+ current_version: string | null;
1735
+ version: string | null;
1736
+ selection: TargetDraftSelection;
1737
+ readiness: TargetDraftReadiness | null;
1738
+ changes: {
1739
+ /** Cumulative changelog against Current. */
1740
+ changelog?: string | null;
1741
+ breaking_count?: number | null;
1742
+ previous_version?: string | null;
1743
+ }
1744
+ | null;
1745
+ /**
1746
+ * Draft commit that readiness, checks, and conflicts describe. Send it as expected_head_revision
1747
+ * when resolving or discarding.
1748
+ */
1749
+ head_revision: string | null;
1750
+ /** Format: uri */
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;
1763
+ request_id?: RequestId;
1764
+ checks: PackageCheck[];
1765
+ }
1766
+
1767
+ /** Response shape for TargetDraft. */
1768
+ export interface TargetDraftRead {
1769
+ object: "target_draft" | (string & {});
1770
+ target_id: TargetId;
1771
+ project_id: ProjectId;
1772
+ status: DraftStatus | (string & {});
1773
+ current_version: string | null;
1774
+ version: string | null;
1775
+ selection: TargetDraftSelectionRead;
1776
+ readiness: TargetDraftReadinessRead | null;
1777
+ changes: {
1778
+ /** Cumulative changelog against Current. */
1779
+ changelog?: string | null;
1780
+ breaking_count?: number | null;
1781
+ previous_version?: string | null;
1782
+ }
1783
+ | null;
1784
+ /**
1785
+ * Draft commit that readiness, checks, and conflicts describe. Send it as expected_head_revision
1786
+ * when resolving or discarding.
1787
+ */
1788
+ head_revision: string | null;
1789
+ /** Format: uri */
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;
1802
+ request_id?: RequestId;
1803
+ checks: PackageCheckRead[];
1804
+ }
1805
+
1806
+ export type TargetDraftResponse = TargetDraft & ResponseMetadata;
1807
+
1808
+ /** Response shape for TargetDraftResponse. */
1809
+ export type TargetDraftResponseRead = TargetDraftRead & ResponseMetadata;
1810
+
1811
+ export interface TargetDraftUpdate {
1812
+ /** Exact SemVer, or null to return to automatic selection. */
1813
+ version: string | null;
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;
1860
+ }
1861
+
1862
+ export interface TargetAdoption {
1863
+ /** Exact already-published package version to make Current. */
1864
+ version: string;
1865
+ /** Immutable repository tag containing the matching package source. */
1866
+ tag: string;
1867
+ }
1868
+
1869
+ export interface RepositoryHealthIssue {
1870
+ code: "connection_missing"
1871
+ | "definition_unreadable"
1872
+ | "contents_write_missing"
1873
+ | "review_write_missing"
1874
+ | "breaking_acknowledgement_missing"
1875
+ | "provider_unavailable";
1876
+ message: string;
1877
+ }
1878
+
1879
+ /** Response shape for RepositoryHealthIssue. */
1880
+ export interface RepositoryHealthIssueRead {
1881
+ code: ("connection_missing"
1882
+ | "definition_unreadable"
1883
+ | "contents_write_missing"
1884
+ | "review_write_missing"
1885
+ | "breaking_acknowledgement_missing"
1886
+ | "provider_unavailable") | (string & {});
1887
+ message: string;
1888
+ }
1889
+
1890
+ export interface RepositoryHealth {
1891
+ repository: RepositoryReferenceResponse;
1892
+ roles: Array<"source" | "destination">;
1893
+ status: "ready" | "action_required";
1894
+ default_branch?: string;
1895
+ capabilities?: string[];
1896
+ /**
1897
+ * Whether a source repository has the optional typeship:breaking-approved policy label. Null when
1898
+ * the repository is not a source or labels could not be read.
1899
+ */
1900
+ breaking_acknowledgement?: boolean | null;
1901
+ definition?: "readable" | "missing";
1902
+ issues: RepositoryHealthIssue[];
1903
+ }
1904
+
1905
+ /** Response shape for RepositoryHealth. */
1906
+ export interface RepositoryHealthRead {
1907
+ repository: RepositoryReferenceResponseRead;
1908
+ roles: Array<("source" | "destination") | (string & {})>;
1909
+ status: ("ready" | "action_required") | (string & {});
1910
+ default_branch?: string;
1911
+ capabilities?: string[];
1912
+ /**
1913
+ * Whether a source repository has the optional typeship:breaking-approved policy label. Null when
1914
+ * the repository is not a source or labels could not be read.
1915
+ */
1916
+ breaking_acknowledgement?: boolean | null;
1917
+ definition?: ("readable" | "missing") | (string & {});
1918
+ issues: RepositoryHealthIssueRead[];
1919
+ }
1920
+
1921
+ export interface RepositoryEventHealth {
1922
+ provider: string;
1923
+ id: string;
1924
+ event: string;
1925
+ status: "queued" | "processing" | "succeeded" | "failed" | "superseded";
1926
+ error: string | null;
1927
+ /** Format: date-time */
1928
+ created_at: string;
1929
+ }
1930
+
1931
+ /** Response shape for RepositoryEventHealth. */
1932
+ export interface RepositoryEventHealthRead {
1933
+ provider: string;
1934
+ id: string;
1935
+ event: string;
1936
+ status: ("queued" | "processing" | "succeeded" | "failed" | "superseded") | (string & {});
1937
+ error: string | null;
1938
+ /** Format: date-time */
1939
+ created_at: string;
1940
+ }
1941
+
1942
+ export interface RepositoryIntegrationHealth {
1943
+ object: "repository_integration_health";
1243
1944
  project_id: ProjectId;
1244
1945
  status: "ready" | "action_required";
1245
1946
  repositories: RepositoryHealth[];
@@ -1290,9 +1991,9 @@ export interface Definition {
1290
1991
  project_id: ProjectId;
1291
1992
  source: DefinitionSource;
1292
1993
  format: "openapi" | "graphql" | null;
1293
- patches: DefinitionPatch[];
1294
- graphql: GraphqlSettings | null;
1295
- diagnostic_policy: DiagnosticPolicy;
1994
+ patches: DefinitionPatchResponse[];
1995
+ graphql: GraphqlSettingsResponse | null;
1996
+ diagnostic_policy: DiagnosticPolicyResponse;
1296
1997
  latest_revision_id: DefinitionRevisionId | null;
1297
1998
  /** Format: date-time */
1298
1999
  created_at: string;
@@ -1308,9 +2009,9 @@ export interface DefinitionWrite {
1308
2009
  project_id: ProjectId;
1309
2010
  source: DefinitionSourceWrite;
1310
2011
  format: "openapi" | "graphql" | null;
1311
- patches: DefinitionPatch[];
1312
- graphql: GraphqlSettings | null;
1313
- diagnostic_policy: DiagnosticPolicy;
2012
+ patches: DefinitionPatchResponse[];
2013
+ graphql: GraphqlSettingsResponse | null;
2014
+ diagnostic_policy: DiagnosticPolicyResponse;
1314
2015
  latest_revision_id: DefinitionRevisionId | null;
1315
2016
  /** Format: date-time */
1316
2017
  created_at: string;
@@ -1326,9 +2027,9 @@ export interface DefinitionRead {
1326
2027
  project_id: ProjectId;
1327
2028
  source: DefinitionSourceRead;
1328
2029
  format: ("openapi" | "graphql" | null) | (string & {}) | null;
1329
- patches: DefinitionPatchRead[];
1330
- graphql: GraphqlSettingsRead | null;
1331
- diagnostic_policy: DiagnosticPolicyRead;
2030
+ patches: DefinitionPatchResponseRead[];
2031
+ graphql: GraphqlSettingsResponseRead | null;
2032
+ diagnostic_policy: DiagnosticPolicyResponseRead;
1332
2033
  latest_revision_id: DefinitionRevisionId | null;
1333
2034
  /** Format: date-time */
1334
2035
  created_at: string;
@@ -1337,18 +2038,29 @@ export interface DefinitionRead {
1337
2038
  request_id: RequestId;
1338
2039
  }
1339
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
+ */
1340
2046
  export interface DefinitionUpdateRequest {
1341
2047
  source?: DefinitionSourceInput;
2048
+ /** Replace all patches in order. An empty array removes every patch; null is invalid. */
1342
2049
  patches?: DefinitionPatch[];
2050
+ /** Replace all GraphQL settings. Null or an empty object clears them. */
1343
2051
  graphql?: GraphqlSettings | null;
2052
+ /** Replace the complete policy and suppression list. Null and an empty object are invalid. */
1344
2053
  diagnostic_policy?: DiagnosticPolicy;
1345
2054
  }
1346
2055
 
1347
2056
  /** Response shape for DefinitionUpdateRequest. */
1348
2057
  export interface DefinitionUpdateRequestRead {
1349
2058
  source?: DefinitionSourceInputRead;
2059
+ /** Replace all patches in order. An empty array removes every patch; null is invalid. */
1350
2060
  patches?: DefinitionPatchRead[];
2061
+ /** Replace all GraphQL settings. Null or an empty object clears them. */
1351
2062
  graphql?: GraphqlSettingsRead | null;
2063
+ /** Replace the complete policy and suppression list. Null and an empty object are invalid. */
1352
2064
  diagnostic_policy?: DiagnosticPolicyRead;
1353
2065
  }
1354
2066
 
@@ -1377,7 +2089,7 @@ export interface Project {
1377
2089
  * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
1378
2090
  * settings remain Definition-owned.
1379
2091
  */
1380
- config: ProjectConfig | null;
2092
+ config: ProjectConfigResponse | null;
1381
2093
  /** Format: date-time */
1382
2094
  created_at: string;
1383
2095
  /**
@@ -1408,7 +2120,7 @@ export interface ProjectWrite {
1408
2120
  * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
1409
2121
  * settings remain Definition-owned.
1410
2122
  */
1411
- config: ProjectConfig | null;
2123
+ config: ProjectConfigResponse | null;
1412
2124
  request_id: RequestId;
1413
2125
  }
1414
2126
 
@@ -1434,7 +2146,7 @@ export interface ProjectRead {
1434
2146
  * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
1435
2147
  * settings remain Definition-owned.
1436
2148
  */
1437
- config: ProjectConfigRead | null;
2149
+ config: ProjectConfigResponseRead | null;
1438
2150
  /** Format: date-time */
1439
2151
  created_at: string;
1440
2152
  /**
@@ -1646,19 +2358,28 @@ export interface OAuthApplicationRead {
1646
2358
 
1647
2359
  /**
1648
2360
  * Authenticated identity read used to verify a login before it is saved. Operation is auto-detected
1649
- * when omitted. Requests must include at least one of subject_field, account_field, or
1650
- * 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.
1651
2364
  */
1652
- export interface IdentityVerification {
2365
+ export type IdentityVerification = {
1653
2366
  /** resource.method of a safe identity read with no required arguments. */
1654
- operation?: string;
2367
+ operation?: string | null;
1655
2368
  /** JSON Pointer to the stable caller ID in the identity response. */
1656
- subject_field?: string;
2369
+ subject_field?: string | null;
1657
2370
  /** JSON Pointer to the customer account ID. */
1658
- account_field?: string;
2371
+ account_field?: string | null;
1659
2372
  /** JSON Pointer to the customer organization ID. */
1660
- organization_field?: string;
2373
+ organization_field?: string | null;
2374
+ } & ({
2375
+ subject_field: string;
1661
2376
  }
2377
+ | {
2378
+ account_field: string;
2379
+ }
2380
+ | {
2381
+ organization_field: string;
2382
+ });
1662
2383
 
1663
2384
  /** OAuth application and request-value overrides for one named API environment. */
1664
2385
  export interface AuthenticationEnvironment {
@@ -1671,7 +2392,7 @@ export interface AuthenticationEnvironment {
1671
2392
 
1672
2393
  /**
1673
2394
  * Public authentication defaults for generated clients and tools. Stored Projects own the OAuth
1674
- * 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
1675
2396
  * one run. Runtime credentials and client secrets are never accepted.
1676
2397
  */
1677
2398
  export interface AuthenticationConfig {
@@ -1715,6 +2436,12 @@ export interface CliBehavior {
1715
2436
  * code phones nobody unless this is enabled.
1716
2437
  */
1717
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;
1718
2445
  /**
1719
2446
  * Where the generated CLI's feedback command sends users. GitHub issues/new URLs get a prefilled
1720
2447
  * title and environment details.
@@ -1889,7 +2616,7 @@ export interface PackageBehavior {
1889
2616
  * Everything Typeship needs beyond the Definition, in one object: generation customization
1890
2617
  * (globals, retries, pagination, readme) and how the generated tooling behaves (cli, mcp, package,
1891
2618
  * docs_url). Plain configuration. Typeship never requires vendor extensions inside the Definition
1892
- * 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
1893
2620
  * settings on their Definition.
1894
2621
  */
1895
2622
  export interface Config {
@@ -1915,6 +2642,7 @@ export interface Config {
1915
2642
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
1916
2643
  * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
1917
2644
  * externalDocs URL.
2645
+ * Format: uri
1918
2646
  */
1919
2647
  docs_url?: string | null;
1920
2648
  /**
@@ -1948,6 +2676,7 @@ export interface ConfigRead {
1948
2676
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
1949
2677
  * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
1950
2678
  * externalDocs URL.
2679
+ * Format: uri
1951
2680
  */
1952
2681
  docs_url?: string | null;
1953
2682
  /**
@@ -1985,6 +2714,7 @@ export interface ProjectConfig {
1985
2714
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
1986
2715
  * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
1987
2716
  * externalDocs URL.
2717
+ * Format: uri
1988
2718
  */
1989
2719
  docs_url?: string | null;
1990
2720
  /**
@@ -2017,6 +2747,7 @@ export interface ProjectConfigRead {
2017
2747
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2018
2748
  * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2019
2749
  * externalDocs URL.
2750
+ * Format: uri
2020
2751
  */
2021
2752
  docs_url?: string | null;
2022
2753
  /**
@@ -2032,33 +2763,67 @@ export interface ProjectConfigRead {
2032
2763
  * Self-hosted MCP access may be overridden for a Target-specific deployment.
2033
2764
  */
2034
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
+ */
2035
2771
  globals?: string[];
2036
2772
  retries?: RetryTuning;
2773
+ /**
2774
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
2775
+ * reported as generation warnings.
2776
+ */
2037
2777
  pagination?: Record<string, PaginationRule | boolean>;
2038
2778
  auth?: TargetAuthenticationConfig;
2039
2779
  cli?: CliBehavior;
2040
2780
  mcp?: McpBehavior;
2041
2781
  readme?: ReadmeBehavior;
2042
2782
  package?: PackageBehavior;
2043
- /** 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
+ */
2044
2789
  docs_url?: string | null;
2045
- /** 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
+ */
2046
2794
  docs_index_url?: string | null;
2047
2795
  }
2048
2796
 
2049
2797
  /** Response shape for TargetConfig. */
2050
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
+ */
2051
2804
  globals?: string[];
2052
2805
  retries?: RetryTuning;
2806
+ /**
2807
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
2808
+ * reported as generation warnings.
2809
+ */
2053
2810
  pagination?: Record<string, PaginationRuleRead | boolean>;
2054
2811
  auth?: TargetAuthenticationConfig;
2055
2812
  cli?: CliBehavior;
2056
2813
  mcp?: McpBehaviorRead;
2057
2814
  readme?: ReadmeBehavior;
2058
2815
  package?: PackageBehavior;
2059
- /** 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
+ */
2060
2822
  docs_url?: string | null;
2061
- /** 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
+ */
2062
2827
  docs_index_url?: string | null;
2063
2828
  }
2064
2829
 
@@ -2193,9 +2958,23 @@ export interface PaginationRuleRead {
2193
2958
  export interface FileStub {
2194
2959
  path: string;
2195
2960
  bytes: number;
2961
+ mode: "100644" | "100755";
2196
2962
  }
2197
2963
 
2964
+ /** Response shape for FileStub. */
2965
+ export interface FileStubRead {
2966
+ path: string;
2967
+ bytes: number;
2968
+ mode: ("100644" | "100755") | (string & {});
2969
+ }
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
+ */
2198
2975
  export const GenerationStatus = {
2976
+ QUEUED: "queued",
2977
+ RUNNING: "running",
2199
2978
  SUCCEEDED: "succeeded",
2200
2979
  FAILED: "failed",
2201
2980
  } as const;
@@ -2212,18 +2991,25 @@ export type GenerationTrigger = (typeof GenerationTrigger)[keyof typeof Generati
2212
2991
  export interface GenerationProvenance {
2213
2992
  /** Pinned generator contract edition. */
2214
2993
  generator_edition: string;
2215
- /** Exact engine build identifier used for replay and support. */
2216
- engine_build: string;
2217
- /**
2218
- * Immutable effective Target configuration used by this run; source credentials are never
2219
- * included.
2220
- */
2221
- resolved_config: Record<string, unknown> | null;
2222
- config_hash: string | null;
2223
- /** Resolved generator and entitlement plan used to select the emitted public surface. */
2224
- surface_plan: Record<string, unknown> | null;
2225
- surface_plan_hash: string | null;
2226
- 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;
2227
3013
  package_version: string | null;
2228
3014
  }
2229
3015
 
@@ -2240,17 +3026,18 @@ export interface Generation {
2240
3026
  definition_revision_id: DefinitionRevisionId | null;
2241
3027
  status: GenerationStatus;
2242
3028
  trigger: GenerationTrigger;
2243
- /** Persisted Target identity. Null only for stateless generation. */
3029
+ /** Persisted Target identity. Null only for one-shot generation. */
2244
3030
  target_id: TargetId | null;
2245
3031
  /** Resolved generator implementation; provenance rather than resource identity. */
2246
3032
  generator: GeneratorKind;
2247
3033
  provenance: GenerationProvenance;
2248
- /** 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. */
2249
3035
  meta: GenerationMeta | null;
2250
3036
  warnings: string[];
2251
3037
  /** Present on retrieve and create; omitted in lists. */
2252
3038
  files?: GeneratedFile[];
2253
- error: string | null;
3039
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3040
+ errors: DomainError[];
2254
3041
  /** Format: date-time */
2255
3042
  created_at: string;
2256
3043
  request_id?: RequestId;
@@ -2269,17 +3056,18 @@ export interface GenerationWrite {
2269
3056
  definition_revision_id: DefinitionRevisionId | null;
2270
3057
  status: GenerationStatus;
2271
3058
  trigger: GenerationTrigger;
2272
- /** Persisted Target identity. Null only for stateless generation. */
3059
+ /** Persisted Target identity. Null only for one-shot generation. */
2273
3060
  target_id: TargetId | null;
2274
3061
  /** Resolved generator implementation; provenance rather than resource identity. */
2275
3062
  generator: GeneratorKind;
2276
3063
  provenance: GenerationProvenance;
2277
- /** 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. */
2278
3065
  meta: GenerationMeta | null;
2279
3066
  warnings: string[];
2280
3067
  /** Present on retrieve and create; omitted in lists. */
2281
3068
  files?: GeneratedFile[];
2282
- error: string | null;
3069
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3070
+ errors: DomainError[];
2283
3071
  /** Format: date-time */
2284
3072
  created_at: string;
2285
3073
  request_id?: RequestId;
@@ -2294,22 +3082,23 @@ export interface GenerationRead {
2294
3082
  * fetched one at a time via GET /generations/{generation_id}/file.
2295
3083
  */
2296
3084
  files_omitted?: boolean;
2297
- files_index?: FileStub[];
3085
+ files_index?: FileStubRead[];
2298
3086
  project_id: ProjectId;
2299
3087
  definition_revision_id: DefinitionRevisionId | null;
2300
3088
  status: GenerationStatus | (string & {});
2301
3089
  trigger: GenerationTrigger | (string & {});
2302
- /** Persisted Target identity. Null only for stateless generation. */
3090
+ /** Persisted Target identity. Null only for one-shot generation. */
2303
3091
  target_id: TargetId | null;
2304
3092
  /** Resolved generator implementation; provenance rather than resource identity. */
2305
3093
  generator: GeneratorKind | (string & {});
2306
- provenance: GenerationProvenance;
2307
- /** 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. */
2308
3096
  meta: GenerationMetaRead | null;
2309
3097
  warnings: string[];
2310
3098
  /** Present on retrieve and create; omitted in lists. */
2311
- files?: GeneratedFile[];
2312
- error: string | null;
3099
+ files?: GeneratedFileRead[];
3100
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3101
+ errors: DomainErrorRead[];
2313
3102
  /** Format: date-time */
2314
3103
  created_at: string;
2315
3104
  request_id?: RequestId;
@@ -2326,7 +3115,7 @@ export interface GenerationSummary {
2326
3115
  definition_revision_id: DefinitionRevisionId | null;
2327
3116
  status: GenerationStatus;
2328
3117
  trigger: GenerationTrigger;
2329
- /** Persisted Target identity. Null only for stateless generation. */
3118
+ /** Persisted Target identity. Null only for one-shot generation. */
2330
3119
  target_id: TargetId | null;
2331
3120
  /** Resolved generator implementation; provenance rather than resource identity. */
2332
3121
  generator: GeneratorKind;
@@ -2334,7 +3123,8 @@ export interface GenerationSummary {
2334
3123
  /** Null only for a failed or legacy generation that produced no metadata. */
2335
3124
  meta: GenerationMeta | null;
2336
3125
  warnings: string[];
2337
- error: string | null;
3126
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3127
+ errors: DomainError[];
2338
3128
  /** Format: date-time */
2339
3129
  created_at: string;
2340
3130
  }
@@ -2346,7 +3136,7 @@ export interface GenerationSummaryWrite {
2346
3136
  definition_revision_id: DefinitionRevisionId | null;
2347
3137
  status: GenerationStatus;
2348
3138
  trigger: GenerationTrigger;
2349
- /** Persisted Target identity. Null only for stateless generation. */
3139
+ /** Persisted Target identity. Null only for one-shot generation. */
2350
3140
  target_id: TargetId | null;
2351
3141
  /** Resolved generator implementation; provenance rather than resource identity. */
2352
3142
  generator: GeneratorKind;
@@ -2354,7 +3144,8 @@ export interface GenerationSummaryWrite {
2354
3144
  /** Null only for a failed or legacy generation that produced no metadata. */
2355
3145
  meta: GenerationMeta | null;
2356
3146
  warnings: string[];
2357
- error: string | null;
3147
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3148
+ errors: DomainError[];
2358
3149
  /** Format: date-time */
2359
3150
  created_at: string;
2360
3151
  }
@@ -2367,15 +3158,16 @@ export interface GenerationSummaryRead {
2367
3158
  definition_revision_id: DefinitionRevisionId | null;
2368
3159
  status: GenerationStatus | (string & {});
2369
3160
  trigger: GenerationTrigger | (string & {});
2370
- /** Persisted Target identity. Null only for stateless generation. */
3161
+ /** Persisted Target identity. Null only for one-shot generation. */
2371
3162
  target_id: TargetId | null;
2372
3163
  /** Resolved generator implementation; provenance rather than resource identity. */
2373
3164
  generator: GeneratorKind | (string & {});
2374
- provenance: GenerationProvenance;
3165
+ provenance: GenerationProvenanceRead;
2375
3166
  /** Null only for a failed or legacy generation that produced no metadata. */
2376
3167
  meta: GenerationMetaRead | null;
2377
3168
  warnings: string[];
2378
- error: string | null;
3169
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3170
+ errors: DomainErrorRead[];
2379
3171
  /** Format: date-time */
2380
3172
  created_at: string;
2381
3173
  }
@@ -2393,7 +3185,8 @@ export interface GenerationFailure {
2393
3185
  target_id: TargetId;
2394
3186
  generator: GeneratorKind;
2395
3187
  status: "failed";
2396
- error: string;
3188
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3189
+ errors: DomainError[];
2397
3190
  }
2398
3191
 
2399
3192
  /** Response shape for GenerationFailure. */
@@ -2401,27 +3194,28 @@ export interface GenerationFailureRead {
2401
3194
  target_id: TargetId;
2402
3195
  generator: GeneratorKind | (string & {});
2403
3196
  status: "failed" | (string & {});
2404
- error: string;
3197
+ /** Recorded failures. Empty when this resource has no recorded failure. */
3198
+ errors: DomainErrorRead[];
2405
3199
  }
2406
3200
 
2407
3201
  /**
2408
- * Metadata for each Target generation attempted by a Project run. Retrieve one Generation
2409
- * separately for generated files.
3202
+ * One Generation per selected Target. Retrieve each Generation for current status and generated
3203
+ * files.
2410
3204
  */
2411
3205
  export interface GenerationBatch {
2412
- data: Array<GenerationSummary | GenerationFailure>;
3206
+ data: GenerationSummary[];
2413
3207
  request_id: RequestId;
2414
3208
  }
2415
3209
 
2416
3210
  /** Request shape for GenerationBatch. */
2417
3211
  export interface GenerationBatchWrite {
2418
- data: Array<GenerationSummaryWrite | GenerationFailure>;
3212
+ data: GenerationSummaryWrite[];
2419
3213
  request_id: RequestId;
2420
3214
  }
2421
3215
 
2422
3216
  /** Response shape for GenerationBatch. */
2423
3217
  export interface GenerationBatchRead {
2424
- data: Array<GenerationSummaryRead | GenerationFailureRead>;
3218
+ data: GenerationSummaryRead[];
2425
3219
  request_id: RequestId;
2426
3220
  }
2427
3221
 
@@ -2474,7 +3268,7 @@ export interface UrlDefinitionRevisionSourceRead {
2474
3268
 
2475
3269
  export interface RepositoryDefinitionRevisionSource {
2476
3270
  kind: "repository";
2477
- repository: RepositoryReference;
3271
+ repository: RepositoryReferenceResponse;
2478
3272
  /** Repository-relative Definition entrypoint path. */
2479
3273
  path: string;
2480
3274
  /** Git ref resolved for this revision, when recorded. */
@@ -2486,7 +3280,7 @@ export interface RepositoryDefinitionRevisionSource {
2486
3280
  /** Response shape for RepositoryDefinitionRevisionSource. */
2487
3281
  export interface RepositoryDefinitionRevisionSourceRead {
2488
3282
  kind: "repository" | (string & {});
2489
- repository: RepositoryReferenceRead;
3283
+ repository: RepositoryReferenceResponseRead;
2490
3284
  /** Repository-relative Definition entrypoint path. */
2491
3285
  path: string;
2492
3286
  /** Git ref resolved for this revision, when recorded. */
@@ -2521,6 +3315,35 @@ export interface DefinitionDocumentRead {
2521
3315
  size_bytes: number;
2522
3316
  }
2523
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
+
2524
3347
  export interface DefinitionRevision {
2525
3348
  id: DefinitionRevisionId;
2526
3349
  object: "definition_revision";
@@ -2701,6 +3524,7 @@ export const ErrorType = {
2701
3524
  SOURCE_ERROR: "source_error",
2702
3525
  RATE_LIMIT_ERROR: "rate_limit_error",
2703
3526
  API_ERROR: "api_error",
3527
+ UNKNOWN_ERROR: "unknown_error",
2704
3528
  } as const;
2705
3529
  export type ErrorType = (typeof ErrorType)[keyof typeof ErrorType];
2706
3530
 
@@ -2713,28 +3537,80 @@ export const ErrorCode = {
2713
3537
  INSUFFICIENT_SCOPE: "insufficient_scope",
2714
3538
  FORBIDDEN: "forbidden",
2715
3539
  NOT_FOUND: "not_found",
3540
+ METHOD_NOT_ALLOWED: "method_not_allowed",
2716
3541
  SPEC_ERROR: "spec_error",
2717
3542
  FETCH_ERROR: "fetch_error",
2718
3543
  REPOSITORY_PROVIDER_UNSUPPORTED: "repository_provider_unsupported",
2719
3544
  EDITION_UNAVAILABLE: "edition_unavailable",
2720
3545
  TARGET_BUSY: "target_busy",
3546
+ NO_DRAFT: "no_draft",
3547
+ STALE_DRAFT: "stale_draft",
3548
+ NO_CHANGES: "no_changes",
3549
+ INVALID_VERSION: "invalid_version",
3550
+ PRECONDITION_FAILED: "precondition_failed",
3551
+ DEFINITION_CHANGED: "definition_changed",
3552
+ VERSION_OCCUPIED: "version_occupied",
3553
+ VERSION_TOO_LOW: "version_too_low",
3554
+ RELEASE_ANALYSIS_STALE: "release_analysis_stale",
3555
+ TARGET_ALREADY_RELEASED: "target_already_released",
3556
+ ADOPTION_UNVERIFIED: "adoption_unverified",
3557
+ PUBLICATION_DISABLED: "publication_disabled",
3558
+ PUBLICATION_NOT_RETRYABLE: "publication_not_retryable",
3559
+ PUBLICATION_RECOVERY_UNAVAILABLE: "publication_recovery_unavailable",
3560
+ PUBLICATION_DISPATCH_FAILED: "publication_dispatch_failed",
3561
+ REPOSITORY_DISCONNECTED: "repository_disconnected",
3562
+ REGENERATION_FAILED: "regeneration_failed",
2721
3563
  DELIVERY_CONFLICT: "delivery_conflict",
2722
3564
  RESOURCE_HAS_DEPENDENCIES: "resource_has_dependencies",
2723
3565
  PLAN_LIMIT_REACHED: "plan_limit_reached",
2724
3566
  PAYLOAD_TOO_LARGE: "payload_too_large",
2725
3567
  RATE_LIMITED: "rate_limited",
2726
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",
2727
3587
  } as const;
2728
3588
  export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
2729
3589
 
2730
3590
  export interface ErrorDetail {
2731
3591
  type: ErrorType;
2732
3592
  code: ErrorCode;
2733
- /** 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
+ */
2734
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";
2735
3607
  /** Human-readable explanation. Its wording may change. */
2736
3608
  message: string;
2737
- /** 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
+ */
2738
3614
  retryable: boolean;
2739
3615
  /** Stable, concise recovery instruction suitable for a person or agent. */
2740
3616
  suggested_action: string;
@@ -2749,19 +3625,837 @@ export interface ErrorDetail {
2749
3625
  export interface ErrorDetailRead {
2750
3626
  type: ErrorType | (string & {});
2751
3627
  code: ErrorCode | (string & {});
2752
- /** JSON Pointer to the invalid request field, when one field caused the error. */
2753
- field?: string;
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
+ */
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 & {});
2754
3642
  /** Human-readable explanation. Its wording may change. */
2755
3643
  message: string;
2756
- /** 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
+ */
2757
3649
  retryable: boolean;
2758
3650
  /** Stable, concise recovery instruction suitable for a person or agent. */
2759
3651
  suggested_action: string;
2760
3652
  /**
2761
- * Documentation for this class of error.
3653
+ * Documentation for this class of error.
3654
+ * Format: uri
3655
+ */
3656
+ docs_url: string;
3657
+ }
3658
+
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;
3664
+ }
3665
+
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;
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.
2762
4379
  * Format: uri
2763
4380
  */
2764
- docs_url: string;
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;
2765
4459
  }
2766
4460
 
2767
4461
  export interface ErrorModel {
@@ -2774,3 +4468,492 @@ export interface ErrorModelRead {
2774
4468
  errors: ErrorDetailRead[];
2775
4469
  request_id: RequestId;
2776
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;