@typeship-ax/mcp 0.10.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/AGENTS.md +10 -4
  2. package/README.md +16 -5
  3. package/api.json +4539 -616
  4. package/api.md +3827 -673
  5. package/dist/core/http.d.ts +3 -2
  6. package/dist/core/http.d.ts.map +1 -1
  7. package/dist/core/http.js +18 -6
  8. package/dist/errors.d.ts +17 -10
  9. package/dist/errors.d.ts.map +1 -1
  10. package/dist/errors.js +24 -15
  11. package/dist/index.d.ts +7 -3
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +9 -5
  14. package/dist/mcp-protocol.d.ts +10 -6
  15. package/dist/mcp-protocol.d.ts.map +1 -1
  16. package/dist/mcp-protocol.js +108 -37
  17. package/dist/mcp.d.ts.map +1 -1
  18. package/dist/mcp.js +36 -17
  19. package/dist/ops.d.ts +4 -0
  20. package/dist/ops.d.ts.map +1 -1
  21. package/dist/ops.js +45 -35
  22. package/dist/resources/account.d.ts +4 -4
  23. package/dist/resources/account.d.ts.map +1 -1
  24. package/dist/resources/account.js +10 -5
  25. package/dist/resources/api-keys.d.ts +40 -14
  26. package/dist/resources/api-keys.d.ts.map +1 -1
  27. package/dist/resources/api-keys.js +45 -13
  28. package/dist/resources/definition-revisions.d.ts +35 -18
  29. package/dist/resources/definition-revisions.d.ts.map +1 -1
  30. package/dist/resources/definition-revisions.js +43 -15
  31. package/dist/resources/definitions.d.ts +21 -6
  32. package/dist/resources/definitions.d.ts.map +1 -1
  33. package/dist/resources/definitions.js +16 -3
  34. package/dist/resources/generate.d.ts +44 -15
  35. package/dist/resources/generate.d.ts.map +1 -1
  36. package/dist/resources/generate.js +55 -13
  37. package/dist/resources/generations.d.ts +14 -6
  38. package/dist/resources/generations.d.ts.map +1 -1
  39. package/dist/resources/generations.js +26 -5
  40. package/dist/resources/projects.d.ts +106 -53
  41. package/dist/resources/projects.d.ts.map +1 -1
  42. package/dist/resources/projects.js +78 -31
  43. package/dist/resources/targets.d.ts +240 -40
  44. package/dist/resources/targets.d.ts.map +1 -1
  45. package/dist/resources/targets.js +307 -21
  46. package/dist/schemas.d.ts.map +1 -1
  47. package/dist/schemas.js +130 -78
  48. package/dist/types.d.ts +1969 -154
  49. package/dist/types.d.ts.map +1 -1
  50. package/dist/types.js +87 -3
  51. package/package.json +3 -3
  52. package/server.json +3 -3
  53. package/src/core/http.ts +17 -6
  54. package/src/errors.ts +25 -15
  55. package/src/index.ts +9 -5
  56. package/src/mcp-protocol.ts +93 -36
  57. package/src/mcp.ts +32 -15
  58. package/src/ops.ts +49 -35
  59. package/src/resources/account.ts +11 -4
  60. package/src/resources/api-keys.ts +84 -13
  61. package/src/resources/definition-revisions.ts +74 -16
  62. package/src/resources/definitions.ts +28 -4
  63. package/src/resources/generate.ts +78 -13
  64. package/src/resources/generations.ts +31 -4
  65. package/src/resources/projects.ts +141 -39
  66. package/src/resources/targets.ts +561 -27
  67. package/src/schemas.ts +130 -78
  68. package/src/types.ts +2105 -154
package/dist/types.d.ts CHANGED
@@ -23,13 +23,15 @@ export type TargetReleaseId = string;
23
23
  export type PublicationId = string;
24
24
  /**
25
25
  * Generator implementation selected by a Target. This is configuration, not identity; several
26
- * Targets may use the same generator.
26
+ * Targets may use the same generator. cli is the TypeScript CLI; go-cli is the native Go CLI, a
27
+ * distinct product that imports one exact paired Go SDK module rather than a client of its own.
27
28
  */
28
29
  export declare const GeneratorKind: {
29
30
  readonly TYPESCRIPT_SDK: "typescript-sdk";
30
31
  readonly PYTHON_SDK: "python-sdk";
31
32
  readonly GO_SDK: "go-sdk";
32
33
  readonly CLI: "cli";
34
+ readonly GO_CLI: "go-cli";
33
35
  readonly MCP: "mcp";
34
36
  };
35
37
  export type GeneratorKind = (typeof GeneratorKind)[keyof typeof GeneratorKind];
@@ -42,7 +44,7 @@ export interface UrlDefinitionInput {
42
44
  url: string;
43
45
  /**
44
46
  * Request headers for a protected URL. Sent on the document GET and GraphQL introspection POST,
45
- * never returned or retained by stateless generation.
47
+ * never returned or retained by one-shot generation.
46
48
  */
47
49
  headers?: Record<string, string>;
48
50
  }
@@ -59,13 +61,46 @@ export interface InlineDefinitionInput {
59
61
  /** Raw Definition text (OpenAPI JSON/YAML or GraphQL SDL). Up to 10MB. */
60
62
  inline: string;
61
63
  }
62
- /** A Definition for stateless generation, provided as exactly one URL or inline entrypoint. */
64
+ /** A Definition for one-shot generation, provided as exactly one URL or inline entrypoint. */
63
65
  export type DefinitionInput = UrlDefinitionInput | InlineDefinitionInput;
64
66
  /** Response shape for DefinitionInput. */
65
67
  export type DefinitionInputRead = UrlDefinitionInputRead | InlineDefinitionInput;
68
+ /**
69
+ * The exact paired Go SDK a go-cli generation is built on. Required when target.generator is go-cli
70
+ * and rejected otherwise. The descriptor is closed and immutable, because a CLI that pins a range
71
+ * or a branch pins nothing.
72
+ */
73
+ export interface GoSdkDescriptor {
74
+ /**
75
+ * Go module path of the SDK the CLI imports, for example github.com/acme/payments-go. Must be a
76
+ * valid Go module path.
77
+ */
78
+ module_path: string;
79
+ /**
80
+ * Exact SDK module version the CLI requires: v-prefixed SemVer such as v1.2.3, or an immutable Go
81
+ * pseudo-version naming a commit such as v0.0.0-20240824120000-abcdef123456. Ranges, branches,
82
+ * and "latest" are rejected.
83
+ */
84
+ version: string;
85
+ /**
86
+ * SHA-256 hex digest of the Definition the SDK was generated from. Must match the resolved
87
+ * Definition, or the request fails with spec_error.
88
+ */
89
+ definition_digest: string;
90
+ /**
91
+ * The generator edition the SDK was generated with. Only the current edition, 2026-08-24, is
92
+ * accepted.
93
+ */
94
+ edition: string;
95
+ /**
96
+ * Go package identifier of the SDK, when the module path's last element does not imply it.
97
+ * Optional.
98
+ */
99
+ package_name?: string;
100
+ }
66
101
  export interface GenerateRequest {
67
102
  definition: DefinitionInput;
68
- /** Stateless generator descriptor; no persisted Target is created. */
103
+ /** One-shot generator descriptor; no persisted Target is created. */
69
104
  target: {
70
105
  generator: GeneratorKind;
71
106
  };
@@ -75,16 +110,17 @@ export interface GenerateRequest {
75
110
  */
76
111
  package_name?: string;
77
112
  /**
78
- * Go module path override. Valid only for the Go SDK. Linked projects derive this from the Go
79
- * destination repository by default.
113
+ * Go module path override for the generated artifact's own module. Valid only for the Go SDK and
114
+ * Go CLI outputs. Linked projects derive this from the Go destination repository by default.
80
115
  */
81
116
  module_path?: string;
117
+ go_sdk?: GoSdkDescriptor;
82
118
  config?: Config;
83
119
  }
84
120
  /** Response shape for GenerateRequest. */
85
121
  export interface GenerateRequestRead {
86
122
  definition: DefinitionInputRead;
87
- /** Stateless generator descriptor; no persisted Target is created. */
123
+ /** One-shot generator descriptor; no persisted Target is created. */
88
124
  target: {
89
125
  generator: GeneratorKind | (string & {});
90
126
  };
@@ -94,16 +130,33 @@ export interface GenerateRequestRead {
94
130
  */
95
131
  package_name?: string;
96
132
  /**
97
- * Go module path override. Valid only for the Go SDK. Linked projects derive this from the Go
98
- * destination repository by default.
133
+ * Go module path override for the generated artifact's own module. Valid only for the Go SDK and
134
+ * Go CLI outputs. Linked projects derive this from the Go destination repository by default.
99
135
  */
100
136
  module_path?: string;
137
+ go_sdk?: GoSdkDescriptor;
101
138
  config?: ConfigRead;
102
139
  }
103
140
  export interface GeneratedFile {
104
141
  /** Repo-relative path inside the generated package. */
105
142
  path: string;
106
143
  content: string;
144
+ /**
145
+ * Exact Git file mode. Omitted one-shot outputs are regular files.
146
+ * Default: "100644"
147
+ */
148
+ mode?: "100644" | "100755";
149
+ }
150
+ /** Response shape for GeneratedFile. */
151
+ export interface GeneratedFileRead {
152
+ /** Repo-relative path inside the generated package. */
153
+ path: string;
154
+ content: string;
155
+ /**
156
+ * Exact Git file mode. Omitted one-shot outputs are regular files.
157
+ * Default: "100644"
158
+ */
159
+ mode?: ("100644" | "100755") | (string & {});
107
160
  }
108
161
  export interface GenerationMeta {
109
162
  title: string;
@@ -124,6 +177,18 @@ export interface GenerationMeta {
124
177
  * Generation.
125
178
  */
126
179
  generators: GeneratorKind[];
180
+ /**
181
+ * Present for go-cli generations only. Names the exact paired Go SDK module and version the CLI
182
+ * was generated against, as its go.mod requires it.
183
+ */
184
+ go_sdk?: {
185
+ /** Go module path of the SDK the Go CLI imports and pins. */
186
+ module_path: string;
187
+ /** Exact SDK module version the Go CLI requires, v-prefixed SemVer or a Go pseudo-version. */
188
+ version: string;
189
+ /** Go package identifier of the SDK, when the module path does not imply it. */
190
+ package_name?: string;
191
+ };
127
192
  resource_count?: number;
128
193
  operation_count?: number;
129
194
  schema_count?: number;
@@ -140,11 +205,6 @@ export interface GenerationMeta {
140
205
  * matched, or could not be opened.
141
206
  */
142
207
  pr_status?: "opened" | "no_changes" | "blocked";
143
- /**
144
- * Why the configured destination pull request was not opened. Generation itself still succeeded;
145
- * fix this action and regenerate.
146
- */
147
- pr_error?: string;
148
208
  /**
149
209
  * Markdown changelog entry for this regeneration, from the API surface diff. Absent on a first
150
210
  * generation or when nothing changed.
@@ -156,10 +216,10 @@ export interface GenerationMeta {
156
216
  */
157
217
  breaking_count?: number;
158
218
  /**
159
- * What the diff was measured against; "destination" means the .typeship/surface.json merged in
160
- * the destination repository.
219
+ * What the diff was measured against. destination uses the accepted repository state;
220
+ * last-generation uses the previous successful Generation; none means no baseline was available.
161
221
  */
162
- baseline?: "destination" | "none";
222
+ baseline?: "destination" | "last-generation" | "none";
163
223
  /** Objective compatibility of the generated API surface against the merged destination baseline. */
164
224
  api_compatibility?: "compatible" | "breaking" | "unknown";
165
225
  /**
@@ -176,11 +236,18 @@ export interface GenerationMeta {
176
236
  * The destination pull request's combined readiness decision for the exact bot-generated head.
177
237
  * Compatibility and version correctness remain separate fields above.
178
238
  */
179
- release_readiness?: "success" | "failure" | "error";
239
+ release_readiness?: "success" | "failure" | "pending" | "error";
180
240
  /** The release-readiness decision in one line, as the commit status describes it. */
181
241
  release_readiness_note?: string;
182
242
  /** The package version the destination had before this regeneration. */
183
243
  previous_version?: string;
244
+ /** Files changed by the customer relative to the accepted combined baseline. */
245
+ customer_change_count?: number;
246
+ integration_state?: "conflicted" | "checking" | "checks_failed" | "ready" | "accepted" | "outdated";
247
+ /** Separate compatibility result against the last published artifact. */
248
+ published_compatibility?: "compatible" | "breaking" | "unknown" | "not_applicable";
249
+ /** Version of the last published artifact used by published_compatibility. */
250
+ published_version?: string;
184
251
  file_count?: number;
185
252
  total_lines?: number;
186
253
  /** Deterministic Diagnostic summary for the exact Definition Revision consumed. */
@@ -209,6 +276,18 @@ export interface GenerationMetaRead {
209
276
  * Generation.
210
277
  */
211
278
  generators: Array<GeneratorKind | (string & {})>;
279
+ /**
280
+ * Present for go-cli generations only. Names the exact paired Go SDK module and version the CLI
281
+ * was generated against, as its go.mod requires it.
282
+ */
283
+ go_sdk?: {
284
+ /** Go module path of the SDK the Go CLI imports and pins. */
285
+ module_path: string;
286
+ /** Exact SDK module version the Go CLI requires, v-prefixed SemVer or a Go pseudo-version. */
287
+ version: string;
288
+ /** Go package identifier of the SDK, when the module path does not imply it. */
289
+ package_name?: string;
290
+ };
212
291
  resource_count?: number;
213
292
  operation_count?: number;
214
293
  schema_count?: number;
@@ -225,11 +304,6 @@ export interface GenerationMetaRead {
225
304
  * matched, or could not be opened.
226
305
  */
227
306
  pr_status?: ("opened" | "no_changes" | "blocked") | (string & {});
228
- /**
229
- * Why the configured destination pull request was not opened. Generation itself still succeeded;
230
- * fix this action and regenerate.
231
- */
232
- pr_error?: string;
233
307
  /**
234
308
  * Markdown changelog entry for this regeneration, from the API surface diff. Absent on a first
235
309
  * generation or when nothing changed.
@@ -241,10 +315,10 @@ export interface GenerationMetaRead {
241
315
  */
242
316
  breaking_count?: number;
243
317
  /**
244
- * What the diff was measured against; "destination" means the .typeship/surface.json merged in
245
- * the destination repository.
318
+ * What the diff was measured against. destination uses the accepted repository state;
319
+ * last-generation uses the previous successful Generation; none means no baseline was available.
246
320
  */
247
- baseline?: ("destination" | "none") | (string & {});
321
+ baseline?: ("destination" | "last-generation" | "none") | (string & {});
248
322
  /** Objective compatibility of the generated API surface against the merged destination baseline. */
249
323
  api_compatibility?: ("compatible" | "breaking" | "unknown") | (string & {});
250
324
  /**
@@ -261,11 +335,18 @@ export interface GenerationMetaRead {
261
335
  * The destination pull request's combined readiness decision for the exact bot-generated head.
262
336
  * Compatibility and version correctness remain separate fields above.
263
337
  */
264
- release_readiness?: ("success" | "failure" | "error") | (string & {});
338
+ release_readiness?: ("success" | "failure" | "pending" | "error") | (string & {});
265
339
  /** The release-readiness decision in one line, as the commit status describes it. */
266
340
  release_readiness_note?: string;
267
341
  /** The package version the destination had before this regeneration. */
268
342
  previous_version?: string;
343
+ /** Files changed by the customer relative to the accepted combined baseline. */
344
+ customer_change_count?: number;
345
+ integration_state?: ("conflicted" | "checking" | "checks_failed" | "ready" | "accepted" | "outdated") | (string & {});
346
+ /** Separate compatibility result against the last published artifact. */
347
+ published_compatibility?: ("compatible" | "breaking" | "unknown" | "not_applicable") | (string & {});
348
+ /** Version of the last published artifact used by published_compatibility. */
349
+ published_version?: string;
269
350
  file_count?: number;
270
351
  total_lines?: number;
271
352
  /** Deterministic Diagnostic summary for the exact Definition Revision consumed. */
@@ -276,6 +357,7 @@ export interface GenerationMetaRead {
276
357
  }
277
358
  export interface GenerationResult {
278
359
  files: GeneratedFile[];
360
+ download?: GenerationDownload;
279
361
  warnings: string[];
280
362
  meta: GenerationMeta;
281
363
  limits?: GenerationLimits;
@@ -293,7 +375,8 @@ export interface GenerationResult {
293
375
  }
294
376
  /** Response shape for GenerationResult. */
295
377
  export interface GenerationResultRead {
296
- files: GeneratedFile[];
378
+ files: GeneratedFileRead[];
379
+ download?: GenerationDownload;
297
380
  warnings: string[];
298
381
  meta: GenerationMetaRead;
299
382
  limits?: GenerationLimitsRead;
@@ -309,6 +392,22 @@ export interface GenerationResultRead {
309
392
  };
310
393
  request_id: RequestId;
311
394
  }
395
+ /**
396
+ * Complete package ZIP from this exact result. Present on requests with Idempotency-Key, including
397
+ * automatic CLI, MCP, and SDK keys. Download before expires_at, verify sha256, and extract into an
398
+ * empty directory. Anyone with this URL can download the package; keep it private. Reading does not
399
+ * generate again or extend the 24-hour replay window.
400
+ */
401
+ export interface GenerationDownload {
402
+ /** Format: uri */
403
+ url: string;
404
+ /** Format: date-time */
405
+ expires_at: string;
406
+ /** SHA-256 of the downloaded ZIP bytes. */
407
+ sha256: string;
408
+ size_bytes: number;
409
+ file_count: number;
410
+ }
312
411
  /**
313
412
  * Present when the generation was capped: by the free plan, or because the call was anonymous.
314
413
  * Absent on uncapped generations.
@@ -389,14 +488,14 @@ export interface RepositoryReferenceRead {
389
488
  }
390
489
  export interface RepositoryDefinitionSource {
391
490
  kind: "repository";
392
- repository: RepositoryReference;
491
+ repository: RepositoryReferenceResponse;
393
492
  /** Repository-relative Definition entrypoint. */
394
493
  path: string;
395
494
  }
396
495
  /** Response shape for RepositoryDefinitionSource. */
397
496
  export interface RepositoryDefinitionSourceRead {
398
497
  kind: "repository" | (string & {});
399
- repository: RepositoryReferenceRead;
498
+ repository: RepositoryReferenceResponseRead;
400
499
  /** Repository-relative Definition entrypoint. */
401
500
  path: string;
402
501
  }
@@ -507,7 +606,7 @@ export interface DiagnosticFix {
507
606
  */
508
607
  kind: "spec_patch" | "source_edit";
509
608
  /** Exact patches when kind is spec_patch. */
510
- patches?: DefinitionPatch[];
609
+ patches?: DefinitionPatchResponse[];
511
610
  /** Source-level guidance when an exact patch would invent intent. */
512
611
  instructions?: string;
513
612
  }
@@ -521,7 +620,7 @@ export interface DiagnosticFixRead {
521
620
  */
522
621
  kind: ("spec_patch" | "source_edit") | (string & {});
523
622
  /** Exact patches when kind is spec_patch. */
524
- patches?: DefinitionPatchRead[];
623
+ patches?: DefinitionPatchResponseRead[];
525
624
  /** Source-level guidance when an exact patch would invent intent. */
526
625
  instructions?: string;
527
626
  }
@@ -537,7 +636,7 @@ export interface Diagnostic {
537
636
  title: string;
538
637
  /** What the API author should change. */
539
638
  description: string;
540
- /** Why consumers of generated SDK, CLI, or MCP surfaces care. */
639
+ /** Why consumers of generated CLI, MCP, or SDK surfaces care. */
541
640
  impact: string;
542
641
  /** Public surfaces affected by the root cause. */
543
642
  surfaces: Array<"api" | "sdk" | "cli" | "mcp">;
@@ -548,7 +647,7 @@ export interface Diagnostic {
548
647
  evidence_basis: "contract" | "heuristic" | "implementation";
549
648
  /** Whether remediation requires intent that the Definition cannot prove. */
550
649
  owner_decision_required: boolean;
551
- /** Concrete generated SDK, CLI, or MCP naming effect when Typeship can state it. */
650
+ /** Concrete generated CLI, MCP, or SDK naming effect when Typeship can state it. */
552
651
  surface_impact?: string;
553
652
  /** All affected coordinates, kept under one grouped diagnostic. */
554
653
  locations: DiagnosticLocation[];
@@ -571,7 +670,7 @@ export interface DiagnosticRead {
571
670
  title: string;
572
671
  /** What the API author should change. */
573
672
  description: string;
574
- /** Why consumers of generated SDK, CLI, or MCP surfaces care. */
673
+ /** Why consumers of generated CLI, MCP, or SDK surfaces care. */
575
674
  impact: string;
576
675
  /** Public surfaces affected by the root cause. */
577
676
  surfaces: Array<("api" | "sdk" | "cli" | "mcp") | (string & {})>;
@@ -582,7 +681,7 @@ export interface DiagnosticRead {
582
681
  evidence_basis: ("contract" | "heuristic" | "implementation") | (string & {});
583
682
  /** Whether remediation requires intent that the Definition cannot prove. */
584
683
  owner_decision_required: boolean;
585
- /** Concrete generated SDK, CLI, or MCP naming effect when Typeship can state it. */
684
+ /** Concrete generated CLI, MCP, or SDK naming effect when Typeship can state it. */
586
685
  surface_impact?: string;
587
686
  /** All affected coordinates, kept under one grouped diagnostic. */
588
687
  locations: DiagnosticLocation[];
@@ -675,7 +774,7 @@ export interface DiagnosticSuppressionSignal {
675
774
  export interface DiagnosticQualitySignals {
676
775
  suppressed_by_rule: DiagnosticSuppressionSignal[];
677
776
  /** Reviewed exceptions whose rule or exact path no longer matches this revision. */
678
- stale_suppressions: DiagnosticSuppression[];
777
+ stale_suppressions: DiagnosticSuppressionResponse[];
679
778
  }
680
779
  /** Compact rule and location reference; full guidance appears once in diagnostics. */
681
780
  export interface DiagnosticReference {
@@ -721,7 +820,7 @@ export interface DiagnosticReport {
721
820
  summary: DiagnosticSummary;
722
821
  /** Stable grouped diagnostics, ordered by severity and rule identifier. */
723
822
  diagnostics: Diagnostic[];
724
- policy: DiagnosticPolicy;
823
+ policy: DiagnosticPolicyResponse;
725
824
  evaluation: DiagnosticEvaluation;
726
825
  quality_signals: DiagnosticQualitySignals;
727
826
  delta: DiagnosticDelta;
@@ -743,7 +842,7 @@ export interface DiagnosticReportRead {
743
842
  summary: DiagnosticSummary;
744
843
  /** Stable grouped diagnostics, ordered by severity and rule identifier. */
745
844
  diagnostics: DiagnosticRead[];
746
- policy: DiagnosticPolicyRead;
845
+ policy: DiagnosticPolicyResponseRead;
747
846
  evaluation: DiagnosticEvaluationRead;
748
847
  quality_signals: DiagnosticQualitySignals;
749
848
  delta: DiagnosticDeltaRead;
@@ -782,7 +881,7 @@ export interface RepositoryDeliveryInput {
782
881
  directory?: string | null;
783
882
  /** npm or Python registry identity where applicable. */
784
883
  package_name?: string | null;
785
- /** Explicit Go module path where applicable. */
884
+ /** Go module identity for the Go SDK or Go CLI Target where applicable. */
786
885
  module_path?: string | null;
787
886
  /**
788
887
  * Commit repository-owned registry automation and report publication after the Draft merges.
@@ -797,7 +896,7 @@ export interface RepositoryDeliveryInputRead {
797
896
  directory?: string | null;
798
897
  /** npm or Python registry identity where applicable. */
799
898
  package_name?: string | null;
800
- /** Explicit Go module path where applicable. */
899
+ /** Go module identity for the Go SDK or Go CLI Target where applicable. */
801
900
  module_path?: string | null;
802
901
  /**
803
902
  * Commit repository-owned registry automation and report publication after the Draft merges.
@@ -823,7 +922,7 @@ export interface RepositoryDelivery {
823
922
  target_id: TargetId;
824
923
  kind: "repository";
825
924
  state: "active" | "disabled";
826
- repository: RepositoryReference;
925
+ repository: RepositoryReferenceResponse;
827
926
  directory: string | null;
828
927
  package_name: string | null;
829
928
  module_path: string | null;
@@ -840,7 +939,7 @@ export interface RepositoryDeliveryRead {
840
939
  target_id: TargetId;
841
940
  kind: "repository" | (string & {});
842
941
  state: ("active" | "disabled") | (string & {});
843
- repository: RepositoryReferenceRead;
942
+ repository: RepositoryReferenceResponseRead;
844
943
  directory: string | null;
845
944
  package_name: string | null;
846
945
  module_path: string | null;
@@ -882,6 +981,88 @@ export type Delivery = RepositoryDelivery | HostedMcpDelivery;
882
981
  export type DeliveryRead = RepositoryDeliveryRead | HostedMcpDeliveryRead | Record<string, unknown> & {
883
982
  kind?: string;
884
983
  };
984
+ /**
985
+ * Repository fields are present for a repository Delivery; url is present for a hosted_mcp
986
+ * Delivery.
987
+ */
988
+ export interface DeliveryResponse {
989
+ id: DeliveryId;
990
+ object: "delivery";
991
+ target_id: TargetId;
992
+ kind: "repository" | "hosted_mcp";
993
+ state: "active" | "disabled";
994
+ repository?: RepositoryReferenceResponse;
995
+ directory?: string | null;
996
+ package_name?: string | null;
997
+ module_path?: string | null;
998
+ publish_on_merge?: boolean;
999
+ /** Format: uri */
1000
+ url?: string | null;
1001
+ /** Format: date-time */
1002
+ created_at: string;
1003
+ /** Format: date-time */
1004
+ updated_at: string;
1005
+ request_id: RequestId;
1006
+ }
1007
+ /** Response shape for DeliveryResponse. */
1008
+ export interface DeliveryResponseRead {
1009
+ id: DeliveryId;
1010
+ object: "delivery" | (string & {});
1011
+ target_id: TargetId;
1012
+ kind: ("repository" | "hosted_mcp") | (string & {});
1013
+ state: ("active" | "disabled") | (string & {});
1014
+ repository?: RepositoryReferenceResponseRead;
1015
+ directory?: string | null;
1016
+ package_name?: string | null;
1017
+ module_path?: string | null;
1018
+ publish_on_merge?: boolean;
1019
+ /** Format: uri */
1020
+ url?: string | null;
1021
+ /** Format: date-time */
1022
+ created_at: string;
1023
+ /** Format: date-time */
1024
+ updated_at: string;
1025
+ request_id: RequestId;
1026
+ }
1027
+ /**
1028
+ * One Target generated from a sibling Target. A go-cli Target carries kind go_sdk_module, naming
1029
+ * the Go SDK Target it is generated against.
1030
+ */
1031
+ export interface TargetDependency {
1032
+ kind: "go_sdk_module";
1033
+ target_id: TargetId;
1034
+ }
1035
+ /** Response shape for TargetDependency. */
1036
+ export interface TargetDependencyRead {
1037
+ kind: "go_sdk_module" | (string & {});
1038
+ target_id: TargetId;
1039
+ }
1040
+ /**
1041
+ * Required checks run against the complete combined package. Generated checks and customer commands
1042
+ * share one reproducible workflow; repository_required names existing repository checks. Supplying
1043
+ * checks replaces all settings. Omitted generated restores build, package, and public_entrypoint;
1044
+ * omitted repository_required and customer restore empty lists. An empty object restores these
1045
+ * defaults. An empty array clears the corresponding list.
1046
+ */
1047
+ export interface TargetChecks {
1048
+ /** Default: ["build","package","public_entrypoint"] */
1049
+ generated?: Array<"build" | "package" | "public_entrypoint">;
1050
+ repository_required?: string[];
1051
+ customer?: Array<{
1052
+ name: string;
1053
+ command: string;
1054
+ }>;
1055
+ }
1056
+ /** Response shape for TargetChecks. */
1057
+ export interface TargetChecksRead {
1058
+ /** Default: ["build","package","public_entrypoint"] */
1059
+ generated?: Array<("build" | "package" | "public_entrypoint") | (string & {})>;
1060
+ repository_required?: string[];
1061
+ customer?: Array<{
1062
+ name: string;
1063
+ command: string;
1064
+ }>;
1065
+ }
885
1066
  export interface TargetFields {
886
1067
  name: string;
887
1068
  definition_id: DefinitionId;
@@ -894,6 +1075,7 @@ export interface TargetFields {
894
1075
  release_channel?: "stable" | "prerelease";
895
1076
  /** Optional larger or prerelease SemVer for the next reviewed release. */
896
1077
  proposed_version?: string | null;
1078
+ checks?: TargetChecks;
897
1079
  /**
898
1080
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
899
1081
  * belong to the Definition.
@@ -914,6 +1096,7 @@ export interface TargetFieldsRead {
914
1096
  release_channel?: ("stable" | "prerelease") | (string & {});
915
1097
  /** Optional larger or prerelease SemVer for the next reviewed release. */
916
1098
  proposed_version?: string | null;
1099
+ checks?: TargetChecksRead;
917
1100
  /**
918
1101
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
919
1102
  * belong to the Definition.
@@ -931,6 +1114,7 @@ export interface InitialTargetFields {
931
1114
  /** Default: "stable" */
932
1115
  release_channel?: "stable" | "prerelease";
933
1116
  proposed_version?: string | null;
1117
+ checks?: TargetChecks;
934
1118
  /**
935
1119
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
936
1120
  * belong to the Definition.
@@ -949,6 +1133,7 @@ export interface InitialTargetFieldsRead {
949
1133
  /** Default: "stable" */
950
1134
  release_channel?: ("stable" | "prerelease") | (string & {});
951
1135
  proposed_version?: string | null;
1136
+ checks?: TargetChecksRead;
952
1137
  /**
953
1138
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
954
1139
  * belong to the Definition.
@@ -961,12 +1146,25 @@ export interface TargetUpdateRequest {
961
1146
  state?: "active" | "disabled";
962
1147
  edition?: string;
963
1148
  release_channel?: "stable" | "prerelease";
1149
+ /**
1150
+ * Send only this field to select an exact SemVer, or null for automatic selection. The Target and
1151
+ * Draft endpoints both support an optional If-Match precondition.
1152
+ */
964
1153
  proposed_version?: string | null;
1154
+ checks?: TargetChecks;
965
1155
  /**
966
- * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
967
- * belong to the Definition.
1156
+ * Replaces the complete stored override object. Send null or an empty object to resume Project
1157
+ * inheritance. Effective values merge over Project.config; GraphQL settings belong to the
1158
+ * Definition.
968
1159
  */
969
1160
  config?: TargetConfig | null;
1161
+ /**
1162
+ * Replaces the Delivery set; include each kind you want to keep. Retained kinds preserve their
1163
+ * ID, creation time, and hosted URL. Each supplied Delivery replaces its configuration, so
1164
+ * omitted optional settings reset to their defaults. Omit deliveries to keep the existing set, or
1165
+ * send [] to remove all Deliveries. Removing and later recreating a kind allocates a new ID and,
1166
+ * for hosted_mcp, a new URL.
1167
+ */
970
1168
  deliveries?: DeliveryInput[];
971
1169
  }
972
1170
  /** Response shape for TargetUpdateRequest. */
@@ -975,15 +1173,69 @@ export interface TargetUpdateRequestRead {
975
1173
  state?: ("active" | "disabled") | (string & {});
976
1174
  edition?: string;
977
1175
  release_channel?: ("stable" | "prerelease") | (string & {});
1176
+ /**
1177
+ * Send only this field to select an exact SemVer, or null for automatic selection. The Target and
1178
+ * Draft endpoints both support an optional If-Match precondition.
1179
+ */
978
1180
  proposed_version?: string | null;
1181
+ checks?: TargetChecksRead;
979
1182
  /**
980
- * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
981
- * belong to the Definition.
1183
+ * Replaces the complete stored override object. Send null or an empty object to resume Project
1184
+ * inheritance. Effective values merge over Project.config; GraphQL settings belong to the
1185
+ * Definition.
982
1186
  */
983
1187
  config?: TargetConfigRead | null;
1188
+ /**
1189
+ * Replaces the Delivery set; include each kind you want to keep. Retained kinds preserve their
1190
+ * ID, creation time, and hosted URL. Each supplied Delivery replaces its configuration, so
1191
+ * omitted optional settings reset to their defaults. Omit deliveries to keep the existing set, or
1192
+ * send [] to remove all Deliveries. Removing and later recreating a kind allocates a new ID and,
1193
+ * for hosted_mcp, a new URL.
1194
+ */
984
1195
  deliveries?: DeliveryInputRead[];
985
1196
  }
986
1197
  export interface Target {
1198
+ id: TargetId;
1199
+ object: "target";
1200
+ project_id: ProjectId;
1201
+ definition_id: DefinitionId;
1202
+ name: string;
1203
+ generator: GeneratorKind;
1204
+ /**
1205
+ * Present only on a go-cli Target, naming the sibling Go SDK Target the CLI is generated against.
1206
+ * Every other generator reports null.
1207
+ */
1208
+ dependency: TargetDependency | null;
1209
+ state: "active" | "disabled";
1210
+ edition: string;
1211
+ release_channel: "stable" | "prerelease";
1212
+ version_policy: {
1213
+ mode: "reviewed_semver";
1214
+ pre1_breaking: "minor";
1215
+ };
1216
+ /**
1217
+ * Read-only version of the Target's Current release, or null before its first release. Registry
1218
+ * publication status is separate; inspect the Target Release for publication results.
1219
+ */
1220
+ current_version: string | null;
1221
+ proposed_version: string | null;
1222
+ proposed_version_source: "console" | "api" | "github" | null;
1223
+ checks: TargetChecksResponse;
1224
+ /**
1225
+ * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
1226
+ * never appear here.
1227
+ */
1228
+ config: TargetConfigResponse | null;
1229
+ /** At most one repository and one hosted MCP Delivery. */
1230
+ deliveries: Delivery[];
1231
+ /** Format: date-time */
1232
+ created_at: string;
1233
+ /** Format: date-time */
1234
+ updated_at: string;
1235
+ request_id?: RequestId;
1236
+ }
1237
+ /** Request shape for Target. */
1238
+ export interface TargetWrite {
987
1239
  id: TargetId;
988
1240
  object: "target";
989
1241
  project_id: ProjectId;
@@ -998,21 +1250,18 @@ export interface Target {
998
1250
  pre1_breaking: "minor";
999
1251
  };
1000
1252
  /**
1001
- * Deprecated projection of the newest immutable Target Release; null until a release becomes
1002
- * Current.
1003
- * @deprecated
1253
+ * Read-only version of the Target's Current release, or null before its first release. Registry
1254
+ * publication status is separate; inspect the Target Release for publication results.
1004
1255
  */
1005
1256
  current_version: string | null;
1006
1257
  proposed_version: string | null;
1007
1258
  proposed_version_source: "console" | "api" | "github" | null;
1008
- proposed_version_actor: string | null;
1009
- /** Optimistic concurrency revision for Draft selections. */
1010
- release_revision: number;
1259
+ checks: TargetChecksResponse;
1011
1260
  /**
1012
1261
  * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
1013
1262
  * never appear here.
1014
1263
  */
1015
- config: TargetConfig | null;
1264
+ config: TargetConfigResponse | null;
1016
1265
  /** At most one repository and one hosted MCP Delivery. */
1017
1266
  deliveries: Delivery[];
1018
1267
  /** Format: date-time */
@@ -1029,6 +1278,11 @@ export interface TargetRead {
1029
1278
  definition_id: DefinitionId;
1030
1279
  name: string;
1031
1280
  generator: GeneratorKind | (string & {});
1281
+ /**
1282
+ * Present only on a go-cli Target, naming the sibling Go SDK Target the CLI is generated against.
1283
+ * Every other generator reports null.
1284
+ */
1285
+ dependency: TargetDependencyRead | null;
1032
1286
  state: ("active" | "disabled") | (string & {});
1033
1287
  edition: string;
1034
1288
  release_channel: ("stable" | "prerelease") | (string & {});
@@ -1037,21 +1291,18 @@ export interface TargetRead {
1037
1291
  pre1_breaking: "minor" | (string & {});
1038
1292
  };
1039
1293
  /**
1040
- * Deprecated projection of the newest immutable Target Release; null until a release becomes
1041
- * Current.
1042
- * @deprecated
1294
+ * Read-only version of the Target's Current release, or null before its first release. Registry
1295
+ * publication status is separate; inspect the Target Release for publication results.
1043
1296
  */
1044
1297
  current_version: string | null;
1045
1298
  proposed_version: string | null;
1046
1299
  proposed_version_source: ("console" | "api" | "github" | null) | (string & {}) | null;
1047
- proposed_version_actor: string | null;
1048
- /** Optimistic concurrency revision for Draft selections. */
1049
- release_revision: number;
1300
+ checks: TargetChecksResponseRead;
1050
1301
  /**
1051
1302
  * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
1052
1303
  * never appear here.
1053
1304
  */
1054
- config: TargetConfigRead | null;
1305
+ config: TargetConfigResponseRead | null;
1055
1306
  /** At most one repository and one hosted MCP Delivery. */
1056
1307
  deliveries: DeliveryRead[];
1057
1308
  /** Format: date-time */
@@ -1061,6 +1312,8 @@ export interface TargetRead {
1061
1312
  request_id?: RequestId;
1062
1313
  }
1063
1314
  export type TargetResponse = Target & ResponseMetadata;
1315
+ /** Request shape for TargetResponse. */
1316
+ export type TargetResponseWrite = TargetWrite & ResponseMetadata;
1064
1317
  /** Response shape for TargetResponse. */
1065
1318
  export type TargetResponseRead = TargetRead & ResponseMetadata;
1066
1319
  export interface TargetList {
@@ -1070,6 +1323,14 @@ export interface TargetList {
1070
1323
  next_cursor: string | null;
1071
1324
  request_id: RequestId;
1072
1325
  }
1326
+ /** Request shape for TargetList. */
1327
+ export interface TargetListWrite {
1328
+ object: ListObject;
1329
+ data: TargetWrite[];
1330
+ has_more: boolean;
1331
+ next_cursor: string | null;
1332
+ request_id: RequestId;
1333
+ }
1073
1334
  /** Response shape for TargetList. */
1074
1335
  export interface TargetListRead {
1075
1336
  object: ListObject;
@@ -1090,10 +1351,14 @@ export interface TargetRelease {
1090
1351
  channel: "stable" | "prerelease";
1091
1352
  /** Delivery provider that accepted the release. */
1092
1353
  provider: string;
1093
- repository: RepositoryReference | null;
1354
+ repository: RepositoryReferenceResponse | null;
1094
1355
  definition_revision_id: DefinitionRevisionId | null;
1095
1356
  /** Immutable provider-native revision that was merged or published. */
1096
1357
  delivery_revision: string;
1358
+ /** Digest of the exact accepted source tree used for publication. */
1359
+ source_digest: string | null;
1360
+ checks: PackageCheck[];
1361
+ accepted_risks: AcceptedCompatibilityRisk[];
1097
1362
  import_provenance: {
1098
1363
  tag: string | null;
1099
1364
  /** Format: uri */
@@ -1120,10 +1385,14 @@ export interface TargetReleaseRead {
1120
1385
  channel: ("stable" | "prerelease") | (string & {});
1121
1386
  /** Delivery provider that accepted the release. */
1122
1387
  provider: string;
1123
- repository: RepositoryReferenceRead | null;
1388
+ repository: RepositoryReferenceResponseRead | null;
1124
1389
  definition_revision_id: DefinitionRevisionId | null;
1125
1390
  /** Immutable provider-native revision that was merged or published. */
1126
1391
  delivery_revision: string;
1392
+ /** Digest of the exact accepted source tree used for publication. */
1393
+ source_digest: string | null;
1394
+ checks: PackageCheckRead[];
1395
+ accepted_risks: AcceptedCompatibilityRiskRead[];
1127
1396
  import_provenance: {
1128
1397
  tag: string | null;
1129
1398
  /** Format: uri */
@@ -1160,14 +1429,15 @@ export interface Publication {
1160
1429
  object: "publication";
1161
1430
  target_release_id: TargetReleaseId;
1162
1431
  destination: "github" | "npm" | "pypi" | "go" | "mcp";
1163
- state: "pending" | "publishing" | "published" | "failed";
1432
+ state: "pending" | "publishing" | "published" | "failed" | "disabled";
1164
1433
  attempt: number;
1165
1434
  /** Format: uri */
1166
1435
  run_url: string | null;
1167
1436
  /** Format: uri */
1168
1437
  registry_url: string | null;
1169
1438
  artifact_digest: string | null;
1170
- error: string | null;
1439
+ /** Recorded failures. Empty when this resource has no recorded failure. */
1440
+ errors: DomainError[];
1171
1441
  /** Format: date-time */
1172
1442
  started_at: string | null;
1173
1443
  /** Format: date-time */
@@ -1181,14 +1451,15 @@ export interface PublicationRead {
1181
1451
  object: "publication" | (string & {});
1182
1452
  target_release_id: TargetReleaseId;
1183
1453
  destination: ("github" | "npm" | "pypi" | "go" | "mcp") | (string & {});
1184
- state: ("pending" | "publishing" | "published" | "failed") | (string & {});
1454
+ state: ("pending" | "publishing" | "published" | "failed" | "disabled") | (string & {});
1185
1455
  attempt: number;
1186
1456
  /** Format: uri */
1187
1457
  run_url: string | null;
1188
1458
  /** Format: uri */
1189
1459
  registry_url: string | null;
1190
1460
  artifact_digest: string | null;
1191
- error: string | null;
1461
+ /** Recorded failures. Empty when this resource has no recorded failure. */
1462
+ errors: DomainErrorRead[];
1192
1463
  /** Format: date-time */
1193
1464
  started_at: string | null;
1194
1465
  /** Format: date-time */
@@ -1196,13 +1467,22 @@ export interface PublicationRead {
1196
1467
  /** Format: date-time */
1197
1468
  updated_at: string;
1198
1469
  }
1470
+ export type PublicationResponse = Publication & {
1471
+ /** Format: date-time */
1472
+ created_at: string;
1473
+ } & ResponseMetadata;
1474
+ /** Response shape for PublicationResponse. */
1475
+ export type PublicationResponseRead = PublicationRead & {
1476
+ /** Format: date-time */
1477
+ created_at: string;
1478
+ } & ResponseMetadata;
1199
1479
  export type TargetDraftSelection = {
1200
1480
  mode: "automatic";
1201
1481
  } | {
1202
1482
  mode: "exact";
1203
1483
  version: string;
1484
+ /** Where the selection was made. */
1204
1485
  source: "console" | "api" | "github" | null;
1205
- actor: string | null;
1206
1486
  };
1207
1487
  /** Response shape for TargetDraftSelection. */
1208
1488
  export type TargetDraftSelectionRead = {
@@ -1210,47 +1490,175 @@ export type TargetDraftSelectionRead = {
1210
1490
  } | {
1211
1491
  mode: "exact" | (string & {});
1212
1492
  version: string;
1493
+ /** Where the selection was made. */
1213
1494
  source: ("console" | "api" | "github" | null) | (string & {}) | null;
1214
- actor: string | null;
1215
1495
  };
1496
+ /**
1497
+ * The Draft's state and its one next step. no_draft: no Draft is open; generate the Target.
1498
+ * generating: Typeship is updating the Draft branch; retrieve the Draft again. branch_changed: the
1499
+ * Draft branch has a commit Typeship has not integrated, such as your push or a discard; Typeship
1500
+ * starts that integration from the repository event, so retrieve the Draft again, and generate the
1501
+ * Target only if the status persists. conflicted: some conflicts have no decision; list files with
1502
+ * filter=conflicted and resolve them. needs_generation: saved conflict decisions, an approved
1503
+ * history recovery, or a settings change are not applied yet; generate the Target.
1504
+ * history_rewritten: the default branch no longer contains the accepted package; review files with
1505
+ * filter=history and approve history recovery. checking: package checks are running on
1506
+ * head_revision; retrieve the Draft again. failed: readiness failed or could not be assessed;
1507
+ * inspect readiness and checks, fix the package or pull request, and push to the Draft. ready:
1508
+ * every required check passed on head_revision; merge the pull request.
1509
+ */
1510
+ export declare const DraftStatus: {
1511
+ readonly NO_DRAFT: "no_draft";
1512
+ readonly GENERATING: "generating";
1513
+ readonly BRANCH_CHANGED: "branch_changed";
1514
+ readonly CONFLICTED: "conflicted";
1515
+ readonly NEEDS_GENERATION: "needs_generation";
1516
+ readonly HISTORY_REWRITTEN: "history_rewritten";
1517
+ readonly CHECKING: "checking";
1518
+ readonly FAILED: "failed";
1519
+ readonly READY: "ready";
1520
+ };
1521
+ export type DraftStatus = (typeof DraftStatus)[keyof typeof DraftStatus];
1522
+ export interface TargetDraftConflicts {
1523
+ /** Conflicts in the current merge stage. */
1524
+ total: number;
1525
+ /** Conflicts with a saved decision for head_revision. */
1526
+ decided: number;
1527
+ }
1528
+ /** The approval inputs for a default-branch history rewrite. */
1529
+ export interface TargetDraftHistoryRecovery {
1530
+ /** Rewritten default-branch commit. Send it as expected_default_revision. */
1531
+ default_revision: string;
1532
+ /** Draft commit Typeship last observed. Send it as expected_head_revision. */
1533
+ head_revision: string | null;
1534
+ /** Existing Draft branch that stays available after recovery opens a new Draft. */
1535
+ preserved_branch: string | null;
1536
+ }
1537
+ /**
1538
+ * Readiness decision for the Draft's head_revision. Null readiness on the Draft means no candidate
1539
+ * exists.
1540
+ */
1541
+ export interface TargetDraftReadiness {
1542
+ /**
1543
+ * success means required checks passed; failure means the Draft needs correction or review; error
1544
+ * means assessment could not finish; pending means checks have not finished.
1545
+ */
1546
+ state: "success" | "failure" | "error" | "pending";
1547
+ /** Human-readable explanation of the current decision. Do not parse it for control flow. */
1548
+ description: string;
1549
+ /** API surface comparison against Current. unknown means analysis is unavailable. */
1550
+ api_compatibility: "compatible" | "breaking" | "unknown";
1551
+ /**
1552
+ * Package and supported SDK source comparison against Current. unknown means analysis is
1553
+ * incomplete or unavailable.
1554
+ */
1555
+ package_compatibility: "compatible" | "breaking" | "unknown";
1556
+ /** Whether the version satisfies the assessed change. Null when no verdict is available. */
1557
+ version_correct: boolean | null;
1558
+ /** Minimum assessed version bump. Null when no bump has been determined. */
1559
+ required_bump: "major" | "minor" | "patch" | null;
1560
+ /** Version used for the comparison. Null when no comparison version is available. */
1561
+ previous_version: string | null;
1562
+ /** Draft title error that must be corrected before release. Null when none is recorded. */
1563
+ title_error: string | null;
1564
+ }
1565
+ /** Response shape for TargetDraftReadiness. */
1566
+ export interface TargetDraftReadinessRead {
1567
+ /**
1568
+ * success means required checks passed; failure means the Draft needs correction or review; error
1569
+ * means assessment could not finish; pending means checks have not finished.
1570
+ */
1571
+ state: ("success" | "failure" | "error" | "pending") | (string & {});
1572
+ /** Human-readable explanation of the current decision. Do not parse it for control flow. */
1573
+ description: string;
1574
+ /** API surface comparison against Current. unknown means analysis is unavailable. */
1575
+ api_compatibility: ("compatible" | "breaking" | "unknown") | (string & {});
1576
+ /**
1577
+ * Package and supported SDK source comparison against Current. unknown means analysis is
1578
+ * incomplete or unavailable.
1579
+ */
1580
+ package_compatibility: ("compatible" | "breaking" | "unknown") | (string & {});
1581
+ /** Whether the version satisfies the assessed change. Null when no verdict is available. */
1582
+ version_correct: boolean | null;
1583
+ /** Minimum assessed version bump. Null when no bump has been determined. */
1584
+ required_bump: ("major" | "minor" | "patch" | null) | (string & {}) | null;
1585
+ /** Version used for the comparison. Null when no comparison version is available. */
1586
+ previous_version: string | null;
1587
+ /** Draft title error that must be corrected before release. Null when none is recorded. */
1588
+ title_error: string | null;
1589
+ }
1216
1590
  export interface TargetDraft {
1217
1591
  object: "target_draft";
1218
1592
  target_id: TargetId;
1219
- revision: number;
1593
+ project_id: ProjectId;
1594
+ status: DraftStatus;
1220
1595
  current_version: string | null;
1221
1596
  version: string | null;
1222
1597
  selection: TargetDraftSelection;
1223
- readiness: Record<string, unknown> | null;
1598
+ readiness: TargetDraftReadiness | null;
1224
1599
  changes: {
1225
1600
  /** Cumulative changelog against Current. */
1226
1601
  changelog?: string | null;
1227
1602
  breaking_count?: number | null;
1228
1603
  previous_version?: string | null;
1229
1604
  } | null;
1605
+ /**
1606
+ * Draft commit that readiness, checks, and conflicts describe. Send it as expected_head_revision
1607
+ * when resolving or discarding.
1608
+ */
1230
1609
  head_revision: string | null;
1231
1610
  /** Format: uri */
1232
1611
  pull_request_url: string | null;
1612
+ /** Generation whose package this Draft contains. */
1613
+ generation_id: GenerationId | null;
1614
+ /** Conflict counts for the current merge stage; null when the Draft has no conflicts. */
1615
+ conflicts: TargetDraftConflicts | null;
1616
+ /**
1617
+ * Files where the Draft differs from the last accepted package; null until the Draft is
1618
+ * integrated.
1619
+ */
1620
+ customized_files: number | null;
1621
+ /** Present only while status is history_rewritten. */
1622
+ history_recovery: TargetDraftHistoryRecovery | null;
1233
1623
  request_id?: RequestId;
1624
+ checks: PackageCheck[];
1234
1625
  }
1235
1626
  /** Response shape for TargetDraft. */
1236
1627
  export interface TargetDraftRead {
1237
1628
  object: "target_draft" | (string & {});
1238
1629
  target_id: TargetId;
1239
- revision: number;
1630
+ project_id: ProjectId;
1631
+ status: DraftStatus | (string & {});
1240
1632
  current_version: string | null;
1241
1633
  version: string | null;
1242
1634
  selection: TargetDraftSelectionRead;
1243
- readiness: Record<string, unknown> | null;
1635
+ readiness: TargetDraftReadinessRead | null;
1244
1636
  changes: {
1245
1637
  /** Cumulative changelog against Current. */
1246
1638
  changelog?: string | null;
1247
1639
  breaking_count?: number | null;
1248
1640
  previous_version?: string | null;
1249
1641
  } | null;
1642
+ /**
1643
+ * Draft commit that readiness, checks, and conflicts describe. Send it as expected_head_revision
1644
+ * when resolving or discarding.
1645
+ */
1250
1646
  head_revision: string | null;
1251
1647
  /** Format: uri */
1252
1648
  pull_request_url: string | null;
1649
+ /** Generation whose package this Draft contains. */
1650
+ generation_id: GenerationId | null;
1651
+ /** Conflict counts for the current merge stage; null when the Draft has no conflicts. */
1652
+ conflicts: TargetDraftConflicts | null;
1653
+ /**
1654
+ * Files where the Draft differs from the last accepted package; null until the Draft is
1655
+ * integrated.
1656
+ */
1657
+ customized_files: number | null;
1658
+ /** Present only while status is history_rewritten. */
1659
+ history_recovery: TargetDraftHistoryRecovery | null;
1253
1660
  request_id?: RequestId;
1661
+ checks: PackageCheckRead[];
1254
1662
  }
1255
1663
  export type TargetDraftResponse = TargetDraft & ResponseMetadata;
1256
1664
  /** Response shape for TargetDraftResponse. */
@@ -1258,7 +1666,48 @@ export type TargetDraftResponseRead = TargetDraftRead & ResponseMetadata;
1258
1666
  export interface TargetDraftUpdate {
1259
1667
  /** Exact SemVer, or null to return to automatic selection. */
1260
1668
  version: string | null;
1261
- expected_revision?: number;
1669
+ }
1670
+ export interface PackageCheck {
1671
+ name: string;
1672
+ source: "typeship" | "customer" | "repository" | "compatibility";
1673
+ required: boolean;
1674
+ state: "pending" | "passed" | "failed" | "not_assessed";
1675
+ reason: string;
1676
+ revision: string;
1677
+ /** Format: uri */
1678
+ url: string | null;
1679
+ /** Format: date-time */
1680
+ observed_at: string | null;
1681
+ }
1682
+ /** Response shape for PackageCheck. */
1683
+ export interface PackageCheckRead {
1684
+ name: string;
1685
+ source: ("typeship" | "customer" | "repository" | "compatibility") | (string & {});
1686
+ required: boolean;
1687
+ state: ("pending" | "passed" | "failed" | "not_assessed") | (string & {});
1688
+ reason: string;
1689
+ revision: string;
1690
+ /** Format: uri */
1691
+ url: string | null;
1692
+ /** Format: date-time */
1693
+ observed_at: string | null;
1694
+ }
1695
+ export interface AcceptedCompatibilityRisk {
1696
+ comparison: "current" | "published";
1697
+ reason: string;
1698
+ approved_by: string;
1699
+ approved_revision: string;
1700
+ /** Format: date-time */
1701
+ approved_at: string;
1702
+ }
1703
+ /** Response shape for AcceptedCompatibilityRisk. */
1704
+ export interface AcceptedCompatibilityRiskRead {
1705
+ comparison: ("current" | "published") | (string & {});
1706
+ reason: string;
1707
+ approved_by: string;
1708
+ approved_revision: string;
1709
+ /** Format: date-time */
1710
+ approved_at: string;
1262
1711
  }
1263
1712
  export interface TargetAdoption {
1264
1713
  /** Exact already-published package version to make Current. */
@@ -1276,7 +1725,7 @@ export interface RepositoryHealthIssueRead {
1276
1725
  message: string;
1277
1726
  }
1278
1727
  export interface RepositoryHealth {
1279
- repository: RepositoryReference;
1728
+ repository: RepositoryReferenceResponse;
1280
1729
  roles: Array<"source" | "destination">;
1281
1730
  status: "ready" | "action_required";
1282
1731
  default_branch?: string;
@@ -1291,7 +1740,7 @@ export interface RepositoryHealth {
1291
1740
  }
1292
1741
  /** Response shape for RepositoryHealth. */
1293
1742
  export interface RepositoryHealthRead {
1294
- repository: RepositoryReferenceRead;
1743
+ repository: RepositoryReferenceResponseRead;
1295
1744
  roles: Array<("source" | "destination") | (string & {})>;
1296
1745
  status: ("ready" | "action_required") | (string & {});
1297
1746
  default_branch?: string;
@@ -1371,9 +1820,9 @@ export interface Definition {
1371
1820
  project_id: ProjectId;
1372
1821
  source: DefinitionSource;
1373
1822
  format: "openapi" | "graphql" | null;
1374
- patches: DefinitionPatch[];
1375
- graphql: GraphqlSettings | null;
1376
- diagnostic_policy: DiagnosticPolicy;
1823
+ patches: DefinitionPatchResponse[];
1824
+ graphql: GraphqlSettingsResponse | null;
1825
+ diagnostic_policy: DiagnosticPolicyResponse;
1377
1826
  latest_revision_id: DefinitionRevisionId | null;
1378
1827
  /** Format: date-time */
1379
1828
  created_at: string;
@@ -1388,9 +1837,9 @@ export interface DefinitionWrite {
1388
1837
  project_id: ProjectId;
1389
1838
  source: DefinitionSourceWrite;
1390
1839
  format: "openapi" | "graphql" | null;
1391
- patches: DefinitionPatch[];
1392
- graphql: GraphqlSettings | null;
1393
- diagnostic_policy: DiagnosticPolicy;
1840
+ patches: DefinitionPatchResponse[];
1841
+ graphql: GraphqlSettingsResponse | null;
1842
+ diagnostic_policy: DiagnosticPolicyResponse;
1394
1843
  latest_revision_id: DefinitionRevisionId | null;
1395
1844
  /** Format: date-time */
1396
1845
  created_at: string;
@@ -1405,9 +1854,9 @@ export interface DefinitionRead {
1405
1854
  project_id: ProjectId;
1406
1855
  source: DefinitionSourceRead;
1407
1856
  format: ("openapi" | "graphql" | null) | (string & {}) | null;
1408
- patches: DefinitionPatchRead[];
1409
- graphql: GraphqlSettingsRead | null;
1410
- diagnostic_policy: DiagnosticPolicyRead;
1857
+ patches: DefinitionPatchResponseRead[];
1858
+ graphql: GraphqlSettingsResponseRead | null;
1859
+ diagnostic_policy: DiagnosticPolicyResponseRead;
1411
1860
  latest_revision_id: DefinitionRevisionId | null;
1412
1861
  /** Format: date-time */
1413
1862
  created_at: string;
@@ -1415,17 +1864,28 @@ export interface DefinitionRead {
1415
1864
  updated_at: string;
1416
1865
  request_id: RequestId;
1417
1866
  }
1867
+ /**
1868
+ * Omitted fields remain unchanged. Supplied objects and arrays replace the whole field. URL source
1869
+ * headers are preserved when the URL is unchanged and headers are omitted; null or empty headers
1870
+ * clear them.
1871
+ */
1418
1872
  export interface DefinitionUpdateRequest {
1419
1873
  source?: DefinitionSourceInput;
1874
+ /** Replace all patches in order. An empty array removes every patch; null is invalid. */
1420
1875
  patches?: DefinitionPatch[];
1876
+ /** Replace all GraphQL settings. Null or an empty object clears them. */
1421
1877
  graphql?: GraphqlSettings | null;
1878
+ /** Replace the complete policy and suppression list. Null and an empty object are invalid. */
1422
1879
  diagnostic_policy?: DiagnosticPolicy;
1423
1880
  }
1424
1881
  /** Response shape for DefinitionUpdateRequest. */
1425
1882
  export interface DefinitionUpdateRequestRead {
1426
1883
  source?: DefinitionSourceInputRead;
1884
+ /** Replace all patches in order. An empty array removes every patch; null is invalid. */
1427
1885
  patches?: DefinitionPatchRead[];
1886
+ /** Replace all GraphQL settings. Null or an empty object clears them. */
1428
1887
  graphql?: GraphqlSettingsRead | null;
1888
+ /** Replace the complete policy and suppression list. Null and an empty object are invalid. */
1429
1889
  diagnostic_policy?: DiagnosticPolicyRead;
1430
1890
  }
1431
1891
  /**
@@ -1453,7 +1913,7 @@ export interface Project {
1453
1913
  * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
1454
1914
  * settings remain Definition-owned.
1455
1915
  */
1456
- config: ProjectConfig | null;
1916
+ config: ProjectConfigResponse | null;
1457
1917
  /** Format: date-time */
1458
1918
  created_at: string;
1459
1919
  /**
@@ -1483,7 +1943,7 @@ export interface ProjectWrite {
1483
1943
  * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
1484
1944
  * settings remain Definition-owned.
1485
1945
  */
1486
- config: ProjectConfig | null;
1946
+ config: ProjectConfigResponse | null;
1487
1947
  request_id: RequestId;
1488
1948
  }
1489
1949
  /** Response shape for Project. */
@@ -1508,7 +1968,7 @@ export interface ProjectRead {
1508
1968
  * Shared defaults inherited by every Target. A Target's config overrides these defaults; GraphQL
1509
1969
  * settings remain Definition-owned.
1510
1970
  */
1511
- config: ProjectConfigRead | null;
1971
+ config: ProjectConfigResponseRead | null;
1512
1972
  /** Format: date-time */
1513
1973
  created_at: string;
1514
1974
  /**
@@ -1708,19 +2168,26 @@ export interface OAuthApplicationRead {
1708
2168
  }
1709
2169
  /**
1710
2170
  * Authenticated identity read used to verify a login before it is saved. Operation is auto-detected
1711
- * when omitted. Requests must include at least one of subject_field, account_field, or
1712
- * organization_field.
2171
+ * when omitted or null. At least one of subject_field, account_field, or organization_field must be
2172
+ * a non-null JSON Pointer. Null clears an individual mapping while another remains. Set
2173
+ * identity_verification itself to null to remove the whole policy.
1713
2174
  */
1714
- export interface IdentityVerification {
2175
+ export type IdentityVerification = {
1715
2176
  /** resource.method of a safe identity read with no required arguments. */
1716
- operation?: string;
2177
+ operation?: string | null;
1717
2178
  /** JSON Pointer to the stable caller ID in the identity response. */
1718
- subject_field?: string;
2179
+ subject_field?: string | null;
1719
2180
  /** JSON Pointer to the customer account ID. */
1720
- account_field?: string;
2181
+ account_field?: string | null;
1721
2182
  /** JSON Pointer to the customer organization ID. */
1722
- organization_field?: string;
1723
- }
2183
+ organization_field?: string | null;
2184
+ } & ({
2185
+ subject_field: string;
2186
+ } | {
2187
+ account_field: string;
2188
+ } | {
2189
+ organization_field: string;
2190
+ });
1724
2191
  /** OAuth application and request-value overrides for one named API environment. */
1725
2192
  export interface AuthenticationEnvironment {
1726
2193
  oauth_application?: string | null;
@@ -1731,7 +2198,7 @@ export interface AuthenticationEnvironment {
1731
2198
  }
1732
2199
  /**
1733
2200
  * Public authentication defaults for generated clients and tools. Stored Projects own the OAuth
1734
- * server, application catalog, and identity policy; stateless generation accepts the same shape for
2201
+ * server, application catalog, and identity policy; one-shot generation accepts the same shape for
1735
2202
  * one run. Runtime credentials and client secrets are never accepted.
1736
2203
  */
1737
2204
  export interface AuthenticationConfig {
@@ -1772,6 +2239,12 @@ export interface CliBehavior {
1772
2239
  * code phones nobody unless this is enabled.
1773
2240
  */
1774
2241
  update_notice?: boolean;
2242
+ /**
2243
+ * Public HTTP(S) URL read by the optional changelog command in generated CLIs. Supports UTF-8
2244
+ * Markdown, plain text, and static HTML; embedded credentials are not allowed. Omit or clear to
2245
+ * disable, then regenerate.
2246
+ */
2247
+ changelog_url?: string | null;
1775
2248
  /**
1776
2249
  * Where the generated CLI's feedback command sends users. GitHub issues/new URLs get a prefilled
1777
2250
  * title and environment details.
@@ -1939,7 +2412,7 @@ export interface PackageBehavior {
1939
2412
  * Everything Typeship needs beyond the Definition, in one object: generation customization
1940
2413
  * (globals, retries, pagination, readme) and how the generated tooling behaves (cli, mcp, package,
1941
2414
  * docs_url). Plain configuration. Typeship never requires vendor extensions inside the Definition
1942
- * itself. Stateless generation also accepts GraphQL settings here; stored projects keep those
2415
+ * itself. One-shot generation also accepts GraphQL settings here; stored projects keep those
1943
2416
  * settings on their Definition.
1944
2417
  */
1945
2418
  export interface Config {
@@ -1965,6 +2438,7 @@ export interface Config {
1965
2438
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
1966
2439
  * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
1967
2440
  * externalDocs URL.
2441
+ * Format: uri
1968
2442
  */
1969
2443
  docs_url?: string | null;
1970
2444
  /**
@@ -1997,6 +2471,7 @@ export interface ConfigRead {
1997
2471
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
1998
2472
  * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
1999
2473
  * externalDocs URL.
2474
+ * Format: uri
2000
2475
  */
2001
2476
  docs_url?: string | null;
2002
2477
  /**
@@ -2033,6 +2508,7 @@ export interface ProjectConfig {
2033
2508
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2034
2509
  * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2035
2510
  * externalDocs URL.
2511
+ * Format: uri
2036
2512
  */
2037
2513
  docs_url?: string | null;
2038
2514
  /**
@@ -2064,6 +2540,7 @@ export interface ProjectConfigRead {
2064
2540
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2065
2541
  * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2066
2542
  * externalDocs URL.
2543
+ * Format: uri
2067
2544
  */
2068
2545
  docs_url?: string | null;
2069
2546
  /**
@@ -2078,32 +2555,66 @@ export interface ProjectConfigRead {
2078
2555
  * Self-hosted MCP access may be overridden for a Target-specific deployment.
2079
2556
  */
2080
2557
  export interface TargetConfig {
2558
+ /**
2559
+ * Wire names of query/header parameters that become settable once on the generated client and
2560
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
2561
+ * are reported as generation warnings.
2562
+ */
2081
2563
  globals?: string[];
2082
2564
  retries?: RetryTuning;
2565
+ /**
2566
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
2567
+ * reported as generation warnings.
2568
+ */
2083
2569
  pagination?: Record<string, PaginationRule | boolean>;
2084
2570
  auth?: TargetAuthenticationConfig;
2085
2571
  cli?: CliBehavior;
2086
2572
  mcp?: McpBehavior;
2087
2573
  readme?: ReadmeBehavior;
2088
2574
  package?: PackageBehavior;
2089
- /** Format: uri */
2575
+ /**
2576
+ * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2577
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2578
+ * externalDocs URL.
2579
+ * Format: uri
2580
+ */
2090
2581
  docs_url?: string | null;
2091
- /** Format: uri */
2582
+ /**
2583
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
2584
+ * Format: uri
2585
+ */
2092
2586
  docs_index_url?: string | null;
2093
2587
  }
2094
2588
  /** Response shape for TargetConfig. */
2095
2589
  export interface TargetConfigRead {
2590
+ /**
2591
+ * Wire names of query/header parameters that become settable once on the generated client and
2592
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
2593
+ * are reported as generation warnings.
2594
+ */
2096
2595
  globals?: string[];
2097
2596
  retries?: RetryTuning;
2597
+ /**
2598
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
2599
+ * reported as generation warnings.
2600
+ */
2098
2601
  pagination?: Record<string, PaginationRuleRead | boolean>;
2099
2602
  auth?: TargetAuthenticationConfig;
2100
2603
  cli?: CliBehavior;
2101
2604
  mcp?: McpBehaviorRead;
2102
2605
  readme?: ReadmeBehavior;
2103
2606
  package?: PackageBehavior;
2104
- /** Format: uri */
2607
+ /**
2608
+ * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
2609
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
2610
+ * externalDocs URL.
2611
+ * Format: uri
2612
+ */
2105
2613
  docs_url?: string | null;
2106
- /** Format: uri */
2614
+ /**
2615
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
2616
+ * Format: uri
2617
+ */
2107
2618
  docs_index_url?: string | null;
2108
2619
  }
2109
2620
  /** What a GraphQL schema cannot say about itself. Ignored for OpenAPI specs. */
@@ -2232,8 +2743,21 @@ export interface PaginationRuleRead {
2232
2743
  export interface FileStub {
2233
2744
  path: string;
2234
2745
  bytes: number;
2746
+ mode: "100644" | "100755";
2747
+ }
2748
+ /** Response shape for FileStub. */
2749
+ export interface FileStubRead {
2750
+ path: string;
2751
+ bytes: number;
2752
+ mode: ("100644" | "100755") | (string & {});
2235
2753
  }
2754
+ /**
2755
+ * A Generation moves from queued to running, then succeeds when its files are saved or fails.
2756
+ * Delivery and Draft status are separate.
2757
+ */
2236
2758
  export declare const GenerationStatus: {
2759
+ readonly QUEUED: "queued";
2760
+ readonly RUNNING: "running";
2237
2761
  readonly SUCCEEDED: "succeeded";
2238
2762
  readonly FAILED: "failed";
2239
2763
  };
@@ -2248,18 +2772,24 @@ export type GenerationTrigger = (typeof GenerationTrigger)[keyof typeof Generati
2248
2772
  export interface GenerationProvenance {
2249
2773
  /** Pinned generator contract edition. */
2250
2774
  generator_edition: string;
2251
- /** Exact engine build identifier used for replay and support. */
2252
- engine_build: string;
2253
- /**
2254
- * Immutable effective Target configuration used by this run; source credentials are never
2255
- * included.
2256
- */
2257
- resolved_config: Record<string, unknown> | null;
2258
- config_hash: string | null;
2259
- /** Resolved generator and entitlement plan used to select the emitted public surface. */
2260
- surface_plan: Record<string, unknown> | null;
2261
- surface_plan_hash: string | null;
2262
- entitlement_cap: number | null;
2775
+ /**
2776
+ * Recorded configuration for this Generation in the public Config format, including inherited
2777
+ * Project defaults and Target overrides. Later edits do not change it. Source credentials are
2778
+ * never included. Null when no configuration was recorded.
2779
+ */
2780
+ resolved_config: ConfigResponse | null;
2781
+ package_version: string | null;
2782
+ }
2783
+ /** Response shape for GenerationProvenance. */
2784
+ export interface GenerationProvenanceRead {
2785
+ /** Pinned generator contract edition. */
2786
+ generator_edition: string;
2787
+ /**
2788
+ * Recorded configuration for this Generation in the public Config format, including inherited
2789
+ * Project defaults and Target overrides. Later edits do not change it. Source credentials are
2790
+ * never included. Null when no configuration was recorded.
2791
+ */
2792
+ resolved_config: ConfigResponseRead | null;
2263
2793
  package_version: string | null;
2264
2794
  }
2265
2795
  export interface Generation {
@@ -2275,17 +2805,18 @@ export interface Generation {
2275
2805
  definition_revision_id: DefinitionRevisionId | null;
2276
2806
  status: GenerationStatus;
2277
2807
  trigger: GenerationTrigger;
2278
- /** Persisted Target identity. Null only for stateless generation. */
2808
+ /** Persisted Target identity. Null only for one-shot generation. */
2279
2809
  target_id: TargetId | null;
2280
2810
  /** Resolved generator implementation; provenance rather than resource identity. */
2281
2811
  generator: GeneratorKind;
2282
2812
  provenance: GenerationProvenance;
2283
- /** Null only for a failed or legacy generation that produced no metadata. */
2813
+ /** Null while queued or running, or when a failed or legacy generation produced no metadata. */
2284
2814
  meta: GenerationMeta | null;
2285
2815
  warnings: string[];
2286
2816
  /** Present on retrieve and create; omitted in lists. */
2287
2817
  files?: GeneratedFile[];
2288
- error: string | null;
2818
+ /** Recorded failures. Empty when this resource has no recorded failure. */
2819
+ errors: DomainError[];
2289
2820
  /** Format: date-time */
2290
2821
  created_at: string;
2291
2822
  request_id?: RequestId;
@@ -2303,17 +2834,18 @@ export interface GenerationWrite {
2303
2834
  definition_revision_id: DefinitionRevisionId | null;
2304
2835
  status: GenerationStatus;
2305
2836
  trigger: GenerationTrigger;
2306
- /** Persisted Target identity. Null only for stateless generation. */
2837
+ /** Persisted Target identity. Null only for one-shot generation. */
2307
2838
  target_id: TargetId | null;
2308
2839
  /** Resolved generator implementation; provenance rather than resource identity. */
2309
2840
  generator: GeneratorKind;
2310
2841
  provenance: GenerationProvenance;
2311
- /** Null only for a failed or legacy generation that produced no metadata. */
2842
+ /** Null while queued or running, or when a failed or legacy generation produced no metadata. */
2312
2843
  meta: GenerationMeta | null;
2313
2844
  warnings: string[];
2314
2845
  /** Present on retrieve and create; omitted in lists. */
2315
2846
  files?: GeneratedFile[];
2316
- error: string | null;
2847
+ /** Recorded failures. Empty when this resource has no recorded failure. */
2848
+ errors: DomainError[];
2317
2849
  /** Format: date-time */
2318
2850
  created_at: string;
2319
2851
  request_id?: RequestId;
@@ -2327,22 +2859,23 @@ export interface GenerationRead {
2327
2859
  * fetched one at a time via GET /generations/{generation_id}/file.
2328
2860
  */
2329
2861
  files_omitted?: boolean;
2330
- files_index?: FileStub[];
2862
+ files_index?: FileStubRead[];
2331
2863
  project_id: ProjectId;
2332
2864
  definition_revision_id: DefinitionRevisionId | null;
2333
2865
  status: GenerationStatus | (string & {});
2334
2866
  trigger: GenerationTrigger | (string & {});
2335
- /** Persisted Target identity. Null only for stateless generation. */
2867
+ /** Persisted Target identity. Null only for one-shot generation. */
2336
2868
  target_id: TargetId | null;
2337
2869
  /** Resolved generator implementation; provenance rather than resource identity. */
2338
2870
  generator: GeneratorKind | (string & {});
2339
- provenance: GenerationProvenance;
2340
- /** Null only for a failed or legacy generation that produced no metadata. */
2871
+ provenance: GenerationProvenanceRead;
2872
+ /** Null while queued or running, or when a failed or legacy generation produced no metadata. */
2341
2873
  meta: GenerationMetaRead | null;
2342
2874
  warnings: string[];
2343
2875
  /** Present on retrieve and create; omitted in lists. */
2344
- files?: GeneratedFile[];
2345
- error: string | null;
2876
+ files?: GeneratedFileRead[];
2877
+ /** Recorded failures. Empty when this resource has no recorded failure. */
2878
+ errors: DomainErrorRead[];
2346
2879
  /** Format: date-time */
2347
2880
  created_at: string;
2348
2881
  request_id?: RequestId;
@@ -2358,7 +2891,7 @@ export interface GenerationSummary {
2358
2891
  definition_revision_id: DefinitionRevisionId | null;
2359
2892
  status: GenerationStatus;
2360
2893
  trigger: GenerationTrigger;
2361
- /** Persisted Target identity. Null only for stateless generation. */
2894
+ /** Persisted Target identity. Null only for one-shot generation. */
2362
2895
  target_id: TargetId | null;
2363
2896
  /** Resolved generator implementation; provenance rather than resource identity. */
2364
2897
  generator: GeneratorKind;
@@ -2366,7 +2899,8 @@ export interface GenerationSummary {
2366
2899
  /** Null only for a failed or legacy generation that produced no metadata. */
2367
2900
  meta: GenerationMeta | null;
2368
2901
  warnings: string[];
2369
- error: string | null;
2902
+ /** Recorded failures. Empty when this resource has no recorded failure. */
2903
+ errors: DomainError[];
2370
2904
  /** Format: date-time */
2371
2905
  created_at: string;
2372
2906
  }
@@ -2377,7 +2911,7 @@ export interface GenerationSummaryWrite {
2377
2911
  definition_revision_id: DefinitionRevisionId | null;
2378
2912
  status: GenerationStatus;
2379
2913
  trigger: GenerationTrigger;
2380
- /** Persisted Target identity. Null only for stateless generation. */
2914
+ /** Persisted Target identity. Null only for one-shot generation. */
2381
2915
  target_id: TargetId | null;
2382
2916
  /** Resolved generator implementation; provenance rather than resource identity. */
2383
2917
  generator: GeneratorKind;
@@ -2385,7 +2919,8 @@ export interface GenerationSummaryWrite {
2385
2919
  /** Null only for a failed or legacy generation that produced no metadata. */
2386
2920
  meta: GenerationMeta | null;
2387
2921
  warnings: string[];
2388
- error: string | null;
2922
+ /** Recorded failures. Empty when this resource has no recorded failure. */
2923
+ errors: DomainError[];
2389
2924
  /** Format: date-time */
2390
2925
  created_at: string;
2391
2926
  }
@@ -2397,15 +2932,16 @@ export interface GenerationSummaryRead {
2397
2932
  definition_revision_id: DefinitionRevisionId | null;
2398
2933
  status: GenerationStatus | (string & {});
2399
2934
  trigger: GenerationTrigger | (string & {});
2400
- /** Persisted Target identity. Null only for stateless generation. */
2935
+ /** Persisted Target identity. Null only for one-shot generation. */
2401
2936
  target_id: TargetId | null;
2402
2937
  /** Resolved generator implementation; provenance rather than resource identity. */
2403
2938
  generator: GeneratorKind | (string & {});
2404
- provenance: GenerationProvenance;
2939
+ provenance: GenerationProvenanceRead;
2405
2940
  /** Null only for a failed or legacy generation that produced no metadata. */
2406
2941
  meta: GenerationMetaRead | null;
2407
2942
  warnings: string[];
2408
- error: string | null;
2943
+ /** Recorded failures. Empty when this resource has no recorded failure. */
2944
+ errors: DomainErrorRead[];
2409
2945
  /** Format: date-time */
2410
2946
  created_at: string;
2411
2947
  }
@@ -2419,31 +2955,33 @@ export interface GenerationFailure {
2419
2955
  target_id: TargetId;
2420
2956
  generator: GeneratorKind;
2421
2957
  status: "failed";
2422
- error: string;
2958
+ /** Recorded failures. Empty when this resource has no recorded failure. */
2959
+ errors: DomainError[];
2423
2960
  }
2424
2961
  /** Response shape for GenerationFailure. */
2425
2962
  export interface GenerationFailureRead {
2426
2963
  target_id: TargetId;
2427
2964
  generator: GeneratorKind | (string & {});
2428
2965
  status: "failed" | (string & {});
2429
- error: string;
2966
+ /** Recorded failures. Empty when this resource has no recorded failure. */
2967
+ errors: DomainErrorRead[];
2430
2968
  }
2431
2969
  /**
2432
- * Metadata for each Target generation attempted by a Project run. Retrieve one Generation
2433
- * separately for generated files.
2970
+ * One Generation per selected Target. Retrieve each Generation for current status and generated
2971
+ * files.
2434
2972
  */
2435
2973
  export interface GenerationBatch {
2436
- data: Array<GenerationSummary | GenerationFailure>;
2974
+ data: GenerationSummary[];
2437
2975
  request_id: RequestId;
2438
2976
  }
2439
2977
  /** Request shape for GenerationBatch. */
2440
2978
  export interface GenerationBatchWrite {
2441
- data: Array<GenerationSummaryWrite | GenerationFailure>;
2979
+ data: GenerationSummaryWrite[];
2442
2980
  request_id: RequestId;
2443
2981
  }
2444
2982
  /** Response shape for GenerationBatch. */
2445
2983
  export interface GenerationBatchRead {
2446
- data: Array<GenerationSummaryRead | GenerationFailureRead>;
2984
+ data: GenerationSummaryRead[];
2447
2985
  request_id: RequestId;
2448
2986
  }
2449
2987
  export interface ApiKey {
@@ -2489,7 +3027,7 @@ export interface UrlDefinitionRevisionSourceRead {
2489
3027
  }
2490
3028
  export interface RepositoryDefinitionRevisionSource {
2491
3029
  kind: "repository";
2492
- repository: RepositoryReference;
3030
+ repository: RepositoryReferenceResponse;
2493
3031
  /** Repository-relative Definition entrypoint path. */
2494
3032
  path: string;
2495
3033
  /** Git ref resolved for this revision, when recorded. */
@@ -2500,7 +3038,7 @@ export interface RepositoryDefinitionRevisionSource {
2500
3038
  /** Response shape for RepositoryDefinitionRevisionSource. */
2501
3039
  export interface RepositoryDefinitionRevisionSourceRead {
2502
3040
  kind: "repository" | (string & {});
2503
- repository: RepositoryReferenceRead;
3041
+ repository: RepositoryReferenceResponseRead;
2504
3042
  /** Repository-relative Definition entrypoint path. */
2505
3043
  path: string;
2506
3044
  /** Git ref resolved for this revision, when recorded. */
@@ -2530,6 +3068,33 @@ export interface DefinitionDocumentRead {
2530
3068
  sha256: string;
2531
3069
  size_bytes: number;
2532
3070
  }
3071
+ export interface DefinitionDocumentResponse {
3072
+ id: DefinitionDocumentId;
3073
+ object: "definition_document";
3074
+ definition_revision_id: DefinitionRevisionId;
3075
+ role: "entrypoint" | "reference";
3076
+ /** Repository-relative path or same-origin URL captured in this revision. */
3077
+ coordinate: string;
3078
+ sha256: string;
3079
+ size_bytes: number;
3080
+ /** Format: date-time */
3081
+ created_at: string;
3082
+ request_id: RequestId;
3083
+ }
3084
+ /** Response shape for DefinitionDocumentResponse. */
3085
+ export interface DefinitionDocumentResponseRead {
3086
+ id: DefinitionDocumentId;
3087
+ object: "definition_document" | (string & {});
3088
+ definition_revision_id: DefinitionRevisionId;
3089
+ role: ("entrypoint" | "reference") | (string & {});
3090
+ /** Repository-relative path or same-origin URL captured in this revision. */
3091
+ coordinate: string;
3092
+ sha256: string;
3093
+ size_bytes: number;
3094
+ /** Format: date-time */
3095
+ created_at: string;
3096
+ request_id: RequestId;
3097
+ }
2533
3098
  export interface DefinitionRevision {
2534
3099
  id: DefinitionRevisionId;
2535
3100
  object: "definition_revision";
@@ -2693,6 +3258,7 @@ export declare const ErrorType: {
2693
3258
  readonly SOURCE_ERROR: "source_error";
2694
3259
  readonly RATE_LIMIT_ERROR: "rate_limit_error";
2695
3260
  readonly API_ERROR: "api_error";
3261
+ readonly UNKNOWN_ERROR: "unknown_error";
2696
3262
  };
2697
3263
  export type ErrorType = (typeof ErrorType)[keyof typeof ErrorType];
2698
3264
  /** Stable programmatic identifier. Do not branch on message. */
@@ -2704,13 +3270,18 @@ export declare const ErrorCode: {
2704
3270
  readonly INSUFFICIENT_SCOPE: "insufficient_scope";
2705
3271
  readonly FORBIDDEN: "forbidden";
2706
3272
  readonly NOT_FOUND: "not_found";
3273
+ readonly METHOD_NOT_ALLOWED: "method_not_allowed";
2707
3274
  readonly SPEC_ERROR: "spec_error";
2708
3275
  readonly FETCH_ERROR: "fetch_error";
2709
3276
  readonly REPOSITORY_PROVIDER_UNSUPPORTED: "repository_provider_unsupported";
2710
3277
  readonly EDITION_UNAVAILABLE: "edition_unavailable";
2711
3278
  readonly TARGET_BUSY: "target_busy";
3279
+ readonly NO_DRAFT: "no_draft";
3280
+ readonly STALE_DRAFT: "stale_draft";
3281
+ readonly NO_CHANGES: "no_changes";
2712
3282
  readonly INVALID_VERSION: "invalid_version";
2713
- readonly STALE_RELEASE_REVISION: "stale_release_revision";
3283
+ readonly PRECONDITION_FAILED: "precondition_failed";
3284
+ readonly DEFINITION_CHANGED: "definition_changed";
2714
3285
  readonly VERSION_OCCUPIED: "version_occupied";
2715
3286
  readonly VERSION_TOO_LOW: "version_too_low";
2716
3287
  readonly RELEASE_ANALYSIS_STALE: "release_analysis_stale";
@@ -2728,16 +3299,50 @@ export declare const ErrorCode: {
2728
3299
  readonly PAYLOAD_TOO_LARGE: "payload_too_large";
2729
3300
  readonly RATE_LIMITED: "rate_limited";
2730
3301
  readonly INTERNAL_ERROR: "internal_error";
3302
+ readonly DEPENDENCY_MISSING: "dependency_missing";
3303
+ readonly DEPENDENCY_NOT_FOUND: "dependency_not_found";
3304
+ readonly DEPENDENCY_SELF: "dependency_self";
3305
+ readonly DEPENDENCY_CYCLE: "dependency_cycle";
3306
+ readonly DEPENDENCY_CROSS_PROJECT: "dependency_cross_project";
3307
+ readonly DEPENDENCY_CROSS_LINEAGE: "dependency_cross_lineage";
3308
+ readonly DEPENDENCY_WRONG_GENERATOR: "dependency_wrong_generator";
3309
+ readonly DEPENDENCY_DISABLED: "dependency_disabled";
3310
+ readonly DEPENDENCY_MODULE_PATH_MISSING: "dependency_module_path_missing";
3311
+ readonly DEPENDENCY_UNRELEASED: "dependency_unreleased";
3312
+ readonly DEPENDENCY_REVISION_MISMATCH: "dependency_revision_mismatch";
3313
+ readonly DEPENDENCY_EDITION_INCOMPATIBLE: "dependency_edition_incompatible";
3314
+ readonly PUBLICATION_FAILED: "publication_failed";
3315
+ readonly CUSTOMIZATION_CONFLICT: "customization_conflict";
3316
+ readonly HISTORY_RECOVERY_REQUIRED: "history_recovery_required";
3317
+ readonly CHECKS_UNAVAILABLE: "checks_unavailable";
3318
+ readonly GENERATION_STALE: "generation_stale";
3319
+ readonly UNCLASSIFIED_ERROR: "unclassified_error";
2731
3320
  };
2732
3321
  export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
2733
3322
  export interface ErrorDetail {
2734
3323
  type: ErrorType;
2735
3324
  code: ErrorCode;
2736
- /** JSON Pointer to the invalid request field, when one field caused the error. */
3325
+ phase?: FailurePhase;
3326
+ /** The affected Target when an operation reports failures for multiple Targets. */
3327
+ target_id?: TargetId;
3328
+ /**
3329
+ * JSON Pointer to the invalid field within the request part named by in. When in is omitted, the
3330
+ * pointer refers to the request body. Header pointers use lowercase header names, such as
3331
+ * /idempotency-key.
3332
+ */
2737
3333
  field?: string;
3334
+ /**
3335
+ * Request part containing field. Query-parameter errors use query; header errors use header. Body
3336
+ * errors use body or omit in.
3337
+ */
3338
+ in?: "body" | "query" | "header";
2738
3339
  /** Human-readable explanation. Its wording may change. */
2739
3340
  message: string;
2740
- /** Whether retrying later can succeed without changing the request. */
3341
+ /**
3342
+ * Whether another attempt can succeed without correcting the inputs. For a recorded failure,
3343
+ * start generation or publication again; retrieving the resource or replaying an idempotency key
3344
+ * does not start another attempt.
3345
+ */
2741
3346
  retryable: boolean;
2742
3347
  /** Stable, concise recovery instruction suitable for a person or agent. */
2743
3348
  suggested_action: string;
@@ -2751,11 +3356,27 @@ export interface ErrorDetail {
2751
3356
  export interface ErrorDetailRead {
2752
3357
  type: ErrorType | (string & {});
2753
3358
  code: ErrorCode | (string & {});
2754
- /** JSON Pointer to the invalid request field, when one field caused the error. */
3359
+ phase?: FailurePhase | (string & {});
3360
+ /** The affected Target when an operation reports failures for multiple Targets. */
3361
+ target_id?: TargetId;
3362
+ /**
3363
+ * JSON Pointer to the invalid field within the request part named by in. When in is omitted, the
3364
+ * pointer refers to the request body. Header pointers use lowercase header names, such as
3365
+ * /idempotency-key.
3366
+ */
2755
3367
  field?: string;
3368
+ /**
3369
+ * Request part containing field. Query-parameter errors use query; header errors use header. Body
3370
+ * errors use body or omit in.
3371
+ */
3372
+ in?: ("body" | "query" | "header") | (string & {});
2756
3373
  /** Human-readable explanation. Its wording may change. */
2757
3374
  message: string;
2758
- /** Whether retrying later can succeed without changing the request. */
3375
+ /**
3376
+ * Whether another attempt can succeed without correcting the inputs. For a recorded failure,
3377
+ * start generation or publication again; retrieving the resource or replaying an idempotency key
3378
+ * does not start another attempt.
3379
+ */
2759
3380
  retryable: boolean;
2760
3381
  /** Stable, concise recovery instruction suitable for a person or agent. */
2761
3382
  suggested_action: string;
@@ -2765,13 +3386,1207 @@ export interface ErrorDetailRead {
2765
3386
  */
2766
3387
  docs_url: string;
2767
3388
  }
2768
- export interface ErrorModel {
2769
- errors: ErrorDetail[];
2770
- request_id: RequestId;
3389
+ export interface RepositoryReferenceResponse {
3390
+ /** GitHub is the only launch provider; the field is stable for future adapters. */
3391
+ provider: "github";
3392
+ /** Provider-native repository identity, opaque outside its adapter. */
3393
+ identifier: string;
2771
3394
  }
2772
- /** Response shape for ErrorModel. */
2773
- export interface ErrorModelRead {
2774
- errors: ErrorDetailRead[];
2775
- request_id: RequestId;
3395
+ /** Response shape for RepositoryReferenceResponse. */
3396
+ export interface RepositoryReferenceResponseRead {
3397
+ /** GitHub is the only launch provider; the field is stable for future adapters. */
3398
+ provider: "github" | (string & {});
3399
+ /** Provider-native repository identity, opaque outside its adapter. */
3400
+ identifier: string;
3401
+ }
3402
+ /**
3403
+ * A fix applied to the resolved Definition before generation. Paths are JSON
3404
+ * Pointers into the document. A patch whose target no longer exists is
3405
+ * skipped and reported as a warning on the generation, never silently.
3406
+ */
3407
+ export interface DefinitionPatchResponse {
3408
+ op: "set" | "append" | "remove" | "rename";
3409
+ /**
3410
+ * JSON-Pointer-style path. Pattern segments enable bulk fixes:
3411
+ * * (any child), ** (any depth), [key=value] (filter), e.g.
3412
+ * /paths/**\/parameters/[name=account_id]/schema/type. Renaming a
3413
+ * schema under /components/schemas also rewrites its $refs.
3414
+ */
3415
+ path: string;
3416
+ /** set only; the replacement value. */
3417
+ value?: unknown;
3418
+ /** rename only; the new key name. */
3419
+ to?: string | null;
3420
+ reason?: string | null;
3421
+ }
3422
+ /** Response shape for DefinitionPatchResponse. */
3423
+ export interface DefinitionPatchResponseRead {
3424
+ op: ("set" | "append" | "remove" | "rename") | (string & {});
3425
+ /**
3426
+ * JSON-Pointer-style path. Pattern segments enable bulk fixes:
3427
+ * * (any child), ** (any depth), [key=value] (filter), e.g.
3428
+ * /paths/**\/parameters/[name=account_id]/schema/type. Renaming a
3429
+ * schema under /components/schemas also rewrites its $refs.
3430
+ */
3431
+ path: string;
3432
+ /** set only; the replacement value. */
3433
+ value?: unknown;
3434
+ /** rename only; the new key name. */
3435
+ to?: string | null;
3436
+ reason?: string | null;
3437
+ }
3438
+ export interface DiagnosticSuppressionResponse {
3439
+ rule_id: string;
3440
+ /** Exact schema coordinate. Omit only to suppress every occurrence of the rule. */
3441
+ path?: string;
3442
+ /** The reviewed product decision behind this exception. */
3443
+ reason: string;
3444
+ }
3445
+ /**
3446
+ * Source pull-request enforcement threshold, new-versus-complete baseline, and explicitly reviewed
3447
+ * rule or location exceptions.
3448
+ */
3449
+ export interface DiagnosticPolicyResponse {
3450
+ /**
3451
+ * Severity threshold that fails the API change review check.
3452
+ * Default: "error"
3453
+ */
3454
+ fail_on: "never" | "error" | "warning";
3455
+ /**
3456
+ * Enforce only occurrences introduced by the proposed source change.
3457
+ * Default: true
3458
+ */
3459
+ only_new: boolean;
3460
+ /** Default: [] */
3461
+ suppressions: DiagnosticSuppressionResponse[];
3462
+ }
3463
+ /** Response shape for DiagnosticPolicyResponse. */
3464
+ export interface DiagnosticPolicyResponseRead {
3465
+ /**
3466
+ * Severity threshold that fails the API change review check.
3467
+ * Default: "error"
3468
+ */
3469
+ fail_on: ("never" | "error" | "warning") | (string & {});
3470
+ /**
3471
+ * Enforce only occurrences introduced by the proposed source change.
3472
+ * Default: true
3473
+ */
3474
+ only_new: boolean;
3475
+ /** Default: [] */
3476
+ suppressions: DiagnosticSuppressionResponse[];
3477
+ }
3478
+ /**
3479
+ * Required checks run against the complete combined package. Generated checks and customer commands
3480
+ * share one reproducible workflow; repository_required names existing repository checks. Supplying
3481
+ * checks replaces all settings. Omitted generated restores build, package, and public_entrypoint;
3482
+ * omitted repository_required and customer restore empty lists. An empty object restores these
3483
+ * defaults. An empty array clears the corresponding list.
3484
+ */
3485
+ export interface TargetChecksResponse {
3486
+ /** Default: ["build","package","public_entrypoint"] */
3487
+ generated?: Array<"build" | "package" | "public_entrypoint">;
3488
+ repository_required?: string[];
3489
+ customer?: Array<{
3490
+ name: string;
3491
+ command: string;
3492
+ }>;
3493
+ }
3494
+ /** Response shape for TargetChecksResponse. */
3495
+ export interface TargetChecksResponseRead {
3496
+ /** Default: ["build","package","public_entrypoint"] */
3497
+ generated?: Array<("build" | "package" | "public_entrypoint") | (string & {})>;
3498
+ repository_required?: string[];
3499
+ customer?: Array<{
3500
+ name: string;
3501
+ command: string;
3502
+ }>;
3503
+ }
3504
+ /**
3505
+ * Authorization-server metadata used by generated OAuth flows. Secrets and runtime credentials are
3506
+ * never accepted here.
3507
+ */
3508
+ export interface OAuthServerResponse {
3509
+ /**
3510
+ * Exact authorization-server issuer, including any tenant path.
3511
+ * Format: uri
3512
+ */
3513
+ issuer?: string | null;
3514
+ /**
3515
+ * Exact metadata URL when it cannot be derived from the issuer.
3516
+ * Format: uri
3517
+ */
3518
+ discovery_url?: string | null;
3519
+ /**
3520
+ * Authorization endpoint override.
3521
+ * Format: uri
3522
+ */
3523
+ authorization_url?: string | null;
3524
+ /**
3525
+ * Token endpoint override.
3526
+ * Format: uri
3527
+ */
3528
+ token_url?: string | null;
3529
+ /**
3530
+ * Device-authorization endpoint override.
3531
+ * Format: uri
3532
+ */
3533
+ device_authorization_url?: string | null;
3534
+ /** Default scopes requested during login. */
3535
+ scopes?: string[] | null;
3536
+ /** Default audience included in authorization and token requests. */
3537
+ audience?: string | null;
3538
+ /**
3539
+ * Protected API resource included in authorization and token requests.
3540
+ * Format: uri
3541
+ */
3542
+ resource?: string | null;
3543
+ }
3544
+ /**
3545
+ * OAuth application available to generated products. Public clients support interactive login;
3546
+ * confidential clients support runtime-supplied machine credentials. Client secrets are never
3547
+ * stored.
3548
+ */
3549
+ export interface OAuthApplicationResponse {
3550
+ /** OAuth client identifier. */
3551
+ client_id: string;
3552
+ /** Interactive login method. Browser login uses Authorization Code with PKCE. */
3553
+ login_method?: "browser" | "device" | null;
3554
+ /** How a runtime-supplied client secret is sent for machine grants. */
3555
+ client_auth_method?: "post" | "basic" | null;
3556
+ /**
3557
+ * Loopback callback URL for browser login.
3558
+ * Format: uri
3559
+ */
3560
+ redirect_uri?: string | null;
3561
+ /** Provider parameter used to request an organization during browser login. */
3562
+ organization_parameter?: "organization" | "organization_id" | null;
3563
+ }
3564
+ /** Response shape for OAuthApplicationResponse. */
3565
+ export interface OAuthApplicationResponseRead {
3566
+ /** OAuth client identifier. */
3567
+ client_id: string;
3568
+ /** Interactive login method. Browser login uses Authorization Code with PKCE. */
3569
+ login_method?: ("browser" | "device" | null) | (string & {}) | null;
3570
+ /** How a runtime-supplied client secret is sent for machine grants. */
3571
+ client_auth_method?: ("post" | "basic" | null) | (string & {}) | null;
3572
+ /**
3573
+ * Loopback callback URL for browser login.
3574
+ * Format: uri
3575
+ */
3576
+ redirect_uri?: string | null;
3577
+ /** Provider parameter used to request an organization during browser login. */
3578
+ organization_parameter?: ("organization" | "organization_id" | null) | (string & {}) | null;
3579
+ }
3580
+ /**
3581
+ * Authenticated identity read used to verify a login before it is saved. Operation is auto-detected
3582
+ * when omitted or null. At least one of subject_field, account_field, or organization_field must be
3583
+ * a non-null JSON Pointer. Null clears an individual mapping while another remains. Set
3584
+ * identity_verification itself to null to remove the whole policy.
3585
+ */
3586
+ export type IdentityVerificationResponse = {
3587
+ /** resource.method of a safe identity read with no required arguments. */
3588
+ operation?: string | null;
3589
+ /** JSON Pointer to the stable caller ID in the identity response. */
3590
+ subject_field?: string | null;
3591
+ /** JSON Pointer to the customer account ID. */
3592
+ account_field?: string | null;
3593
+ /** JSON Pointer to the customer organization ID. */
3594
+ organization_field?: string | null;
3595
+ } & ({
3596
+ subject_field: string;
3597
+ } | {
3598
+ account_field: string;
3599
+ } | {
3600
+ organization_field: string;
3601
+ });
3602
+ /** OAuth application and request-value overrides for one named API environment. */
3603
+ export interface AuthenticationEnvironmentResponse {
3604
+ oauth_application?: string | null;
3605
+ scopes?: string[] | null;
3606
+ audience?: string | null;
3607
+ /** Format: uri */
3608
+ resource?: string | null;
3609
+ }
3610
+ /**
3611
+ * Public authentication defaults for generated clients and tools. Stored Projects own the OAuth
3612
+ * server, application catalog, and identity policy; one-shot generation accepts the same shape for
3613
+ * one run. Runtime credentials and client secrets are never accepted.
3614
+ */
3615
+ export interface AuthenticationConfigResponse {
3616
+ oauth_server?: OAuthServerResponse | null;
3617
+ /** OAuth applications keyed by a stable name. */
3618
+ oauth_applications?: Record<string, OAuthApplicationResponse> | null;
3619
+ /** Default OAuth application used by generated products. */
3620
+ oauth_application?: string | null;
3621
+ identity_verification?: IdentityVerificationResponse | null;
3622
+ /**
3623
+ * Base URL of a custom browser-approval backend implementing the start, status, and revoke
3624
+ * contract. Used only when OAuth is not configured.
3625
+ * Format: uri
3626
+ */
3627
+ approval_url?: string | null;
3628
+ /** Authentication selections keyed by generated API environment name. */
3629
+ environments?: Record<string, AuthenticationEnvironmentResponse> | null;
3630
+ }
3631
+ export interface TargetAuthenticationEnvironmentResponse {
3632
+ oauth_application?: string | null;
3633
+ }
3634
+ /**
3635
+ * Selects a Project OAuth application for one Target. OAuth server metadata, applications, and
3636
+ * identity policy remain Project-owned.
3637
+ */
3638
+ export interface TargetAuthenticationConfigResponse {
3639
+ /** Project OAuth application to use. Omit to inherit the Project default. */
3640
+ oauth_application?: string | null;
3641
+ /** Project OAuth application selections keyed by API environment. */
3642
+ environments?: Record<string, TargetAuthenticationEnvironmentResponse> | null;
3643
+ }
3644
+ /** How the generated CLI behaves. Part of Config. */
3645
+ export interface CliBehaviorResponse {
3646
+ /** Command users run, independent of how the CLI is distributed. */
3647
+ command_name?: string | null;
3648
+ /**
3649
+ * Opt in to a once-a-day registry check that prints an upgrade hint. Off by default; generated
3650
+ * code phones nobody unless this is enabled.
3651
+ */
3652
+ update_notice?: boolean;
3653
+ /**
3654
+ * Public HTTP(S) URL read by the optional changelog command in generated CLIs. Supports UTF-8
3655
+ * Markdown, plain text, and static HTML; embedded credentials are not allowed. Omit or clear to
3656
+ * disable, then regenerate.
3657
+ */
3658
+ changelog_url?: string | null;
3659
+ /**
3660
+ * Where the generated CLI's feedback command sends users. GitHub issues/new URLs get a prefilled
3661
+ * title and environment details.
3662
+ */
3663
+ support_url?: string | null;
3664
+ /**
3665
+ * Hosted MCP endpoint installed by the generated CLI instead of launching the package's local
3666
+ * stdio server.
3667
+ */
3668
+ mcp_url?: string | null;
3669
+ /** GitHub owner/name of the skills package the generated CLI offers to install during init. */
3670
+ skills_repo?: string | null;
3671
+ }
3672
+ /** How generated MCP servers and the Typeship-hosted endpoint behave. Part of Config. */
3673
+ export interface McpBehaviorResponse {
3674
+ /** Stable official MCP registry name, independent of the server runtime. */
3675
+ registry_name?: string | null;
3676
+ /**
3677
+ * Authorization for callers connecting to a generated MCP server deployed over HTTP. The hosting
3678
+ * application resolves upstream API credentials separately at runtime. This setting does not
3679
+ * apply to the Typeship-hosted endpoint.
3680
+ */
3681
+ access?: {
3682
+ /**
3683
+ * Exact issuer allowed to sign MCP connection tokens.
3684
+ * Format: uri
3685
+ */
3686
+ issuer: string;
3687
+ /**
3688
+ * Canonical public URL of the self-hosted MCP endpoint that connection tokens must target.
3689
+ * Format: uri
3690
+ */
3691
+ resource: string;
3692
+ /**
3693
+ * Public signing-key endpoint. Omit to discover it from the issuer.
3694
+ * Format: uri
3695
+ */
3696
+ jwks_url?: string;
3697
+ /** Minimum scopes required to connect to the self-hosted MCP server. */
3698
+ scopes?: string[];
3699
+ };
3700
+ /**
3701
+ * MCP tool shape. meta collapses per-operation tools into search_docs, read_docs, and execute so
3702
+ * large APIs don't flood an agent's context window. Auto considers the serialized tool schemas,
3703
+ * switching near 10k tokens or above 100 operations.
3704
+ */
3705
+ tool_mode?: "auto" | "operations" | "meta";
3706
+ /**
3707
+ * Guidance appended to the MCP server's instructions, which agents read once when they connect
3708
+ * (server/discover): what to call first, conventions the spec does not state, what not to do.
3709
+ * Carried by the package's server and the hosted endpoint alike.
3710
+ */
3711
+ instructions?: string | null;
3712
+ /**
3713
+ * Hand-written MCP tool descriptions keyed by operationId or "METHOD /path". Each replaces the
3714
+ * text typeship derives for that operation (summary, first sentence, method and path, deprecation
3715
+ * and auth notes). For flows the spec cannot describe, such as a multi-step upload. Keys that
3716
+ * match no operation are reported as generation warnings.
3717
+ */
3718
+ tool_descriptions?: Record<string, string>;
3719
+ /**
3720
+ * Exact name-or-ID resolver overrides keyed first by the target operationId or "METHOD /path",
3721
+ * then by its wire argument name. A resolver names one read collection operation plus 1-4 item
3722
+ * fields to match case-insensitively; false opts that argument out of strict inference.
3723
+ */
3724
+ reference_resolvers?: Record<string, Record<string, false | {
3725
+ /** OperationId, "METHOD /path", MCP tool name, or dotted resource.method of the list operation. */
3726
+ via: string;
3727
+ /** Item fields compared exactly and case-insensitively, such as name, slug, key, or email. */
3728
+ match: string[];
3729
+ /** Item field substituted into the requested argument. Defaults to id. */
3730
+ id?: string;
3731
+ }>>;
3732
+ }
3733
+ /** Response shape for McpBehaviorResponse. */
3734
+ export interface McpBehaviorResponseRead {
3735
+ /** Stable official MCP registry name, independent of the server runtime. */
3736
+ registry_name?: string | null;
3737
+ /**
3738
+ * Authorization for callers connecting to a generated MCP server deployed over HTTP. The hosting
3739
+ * application resolves upstream API credentials separately at runtime. This setting does not
3740
+ * apply to the Typeship-hosted endpoint.
3741
+ */
3742
+ access?: {
3743
+ /**
3744
+ * Exact issuer allowed to sign MCP connection tokens.
3745
+ * Format: uri
3746
+ */
3747
+ issuer: string;
3748
+ /**
3749
+ * Canonical public URL of the self-hosted MCP endpoint that connection tokens must target.
3750
+ * Format: uri
3751
+ */
3752
+ resource: string;
3753
+ /**
3754
+ * Public signing-key endpoint. Omit to discover it from the issuer.
3755
+ * Format: uri
3756
+ */
3757
+ jwks_url?: string;
3758
+ /** Minimum scopes required to connect to the self-hosted MCP server. */
3759
+ scopes?: string[];
3760
+ };
3761
+ /**
3762
+ * MCP tool shape. meta collapses per-operation tools into search_docs, read_docs, and execute so
3763
+ * large APIs don't flood an agent's context window. Auto considers the serialized tool schemas,
3764
+ * switching near 10k tokens or above 100 operations.
3765
+ */
3766
+ tool_mode?: ("auto" | "operations" | "meta") | (string & {});
3767
+ /**
3768
+ * Guidance appended to the MCP server's instructions, which agents read once when they connect
3769
+ * (server/discover): what to call first, conventions the spec does not state, what not to do.
3770
+ * Carried by the package's server and the hosted endpoint alike.
3771
+ */
3772
+ instructions?: string | null;
3773
+ /**
3774
+ * Hand-written MCP tool descriptions keyed by operationId or "METHOD /path". Each replaces the
3775
+ * text typeship derives for that operation (summary, first sentence, method and path, deprecation
3776
+ * and auth notes). For flows the spec cannot describe, such as a multi-step upload. Keys that
3777
+ * match no operation are reported as generation warnings.
3778
+ */
3779
+ tool_descriptions?: Record<string, string>;
3780
+ /**
3781
+ * Exact name-or-ID resolver overrides keyed first by the target operationId or "METHOD /path",
3782
+ * then by its wire argument name. A resolver names one read collection operation plus 1-4 item
3783
+ * fields to match case-insensitively; false opts that argument out of strict inference.
3784
+ */
3785
+ reference_resolvers?: Record<string, Record<string, false | (string & {}) | {
3786
+ /** OperationId, "METHOD /path", MCP tool name, or dotted resource.method of the list operation. */
3787
+ via: string;
3788
+ /** Item fields compared exactly and case-insensitively, such as name, slug, key, or email. */
3789
+ match: string[];
3790
+ /** Item field substituted into the requested argument. Defaults to id. */
3791
+ id?: string;
3792
+ }>>;
3793
+ }
3794
+ /** Generated README behavior. Part of Config. */
3795
+ export interface ReadmeBehaviorResponse {
3796
+ /**
3797
+ * operationId or "METHOD /path" to feature as the README's first API call. It must be present in
3798
+ * the generated package and callable with no required input beyond path placeholders. Missing or
3799
+ * unsuitable choices produce a warning and use the automatic example.
3800
+ */
3801
+ quickstart_operation?: string | null;
3802
+ }
3803
+ /**
3804
+ * Published-package metadata the API spec does not own. Repository is derived from each
3805
+ * destination.
3806
+ */
3807
+ export interface PackageBehaviorResponse {
3808
+ /** Homepage written into registry metadata. */
3809
+ homepage?: string | null;
3810
+ /** SPDX identifier written into registry metadata. Defaults to info.license. */
3811
+ license?: string | null;
3812
+ /**
3813
+ * Exact LICENSE file contents. Supply this for licences the engine does not build in; MIT is
3814
+ * built in when copyright is also set.
3815
+ */
3816
+ license_text?: string | null;
3817
+ /** Copyright line used in generated license files. */
3818
+ copyright?: string | null;
3819
+ /** Go identifier when the destination repository name is unsuitable. */
3820
+ go_package_name?: string | null;
3821
+ }
3822
+ /**
3823
+ * Everything Typeship needs beyond the Definition, in one object: generation customization
3824
+ * (globals, retries, pagination, readme) and how the generated tooling behaves (cli, mcp, package,
3825
+ * docs_url). Plain configuration. Typeship never requires vendor extensions inside the Definition
3826
+ * itself. One-shot generation also accepts GraphQL settings here; stored projects keep those
3827
+ * settings on their Definition.
3828
+ */
3829
+ export interface ConfigResponse {
3830
+ /**
3831
+ * Wire names of query/header parameters that become settable once on the generated client and
3832
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
3833
+ * are reported as generation warnings.
3834
+ */
3835
+ globals?: string[];
3836
+ retries?: RetryTuningResponse;
3837
+ /**
3838
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
3839
+ * reported as generation warnings.
3840
+ */
3841
+ pagination?: Record<string, PaginationRuleResponse | boolean>;
3842
+ graphql?: GraphqlSettingsResponse;
3843
+ auth?: AuthenticationConfigResponse;
3844
+ cli?: CliBehaviorResponse;
3845
+ mcp?: McpBehaviorResponse;
3846
+ readme?: ReadmeBehaviorResponse;
3847
+ package?: PackageBehaviorResponse;
3848
+ /**
3849
+ * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
3850
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
3851
+ * externalDocs URL.
3852
+ * Format: uri
3853
+ */
3854
+ docs_url?: string | null;
3855
+ /**
3856
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
3857
+ * Format: uri
3858
+ */
3859
+ docs_index_url?: string | null;
3860
+ }
3861
+ /** Response shape for ConfigResponse. */
3862
+ export interface ConfigResponseRead {
3863
+ /**
3864
+ * Wire names of query/header parameters that become settable once on the generated client and
3865
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
3866
+ * are reported as generation warnings.
3867
+ */
3868
+ globals?: string[];
3869
+ retries?: RetryTuningResponse;
3870
+ /**
3871
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
3872
+ * reported as generation warnings.
3873
+ */
3874
+ pagination?: Record<string, PaginationRuleResponseRead | boolean>;
3875
+ graphql?: GraphqlSettingsResponseRead;
3876
+ auth?: AuthenticationConfigResponse;
3877
+ cli?: CliBehaviorResponse;
3878
+ mcp?: McpBehaviorResponseRead;
3879
+ readme?: ReadmeBehaviorResponse;
3880
+ package?: PackageBehaviorResponse;
3881
+ /**
3882
+ * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
3883
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
3884
+ * externalDocs URL.
3885
+ * Format: uri
3886
+ */
3887
+ docs_url?: string | null;
3888
+ /**
3889
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
3890
+ * Format: uri
3891
+ */
3892
+ docs_index_url?: string | null;
3893
+ }
3894
+ /**
3895
+ * Shared generated-client and tooling behavior for a stored Project. Every Target inherits these
3896
+ * defaults. Target.config is merged over them for one Target; top-level values replace defaults
3897
+ * while cli, mcp, auth, readme, and package merge by field. GraphQL-only source settings live on
3898
+ * the Project's Definition and are rejected in both stored config scopes.
3899
+ */
3900
+ export interface ProjectConfigResponse {
3901
+ /**
3902
+ * Wire names of query/header parameters that become settable once on the generated client and
3903
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
3904
+ * are reported as generation warnings.
3905
+ */
3906
+ globals?: string[];
3907
+ retries?: RetryTuningResponse;
3908
+ /**
3909
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
3910
+ * reported as generation warnings.
3911
+ */
3912
+ pagination?: Record<string, PaginationRuleResponse | boolean>;
3913
+ auth?: AuthenticationConfigResponse;
3914
+ cli?: CliBehaviorResponse;
3915
+ mcp?: McpBehaviorResponse;
3916
+ readme?: ReadmeBehaviorResponse;
3917
+ package?: PackageBehaviorResponse;
3918
+ /**
3919
+ * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
3920
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
3921
+ * externalDocs URL.
3922
+ * Format: uri
3923
+ */
3924
+ docs_url?: string | null;
3925
+ /**
3926
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
3927
+ * Format: uri
3928
+ */
3929
+ docs_index_url?: string | null;
3930
+ }
3931
+ /** Response shape for ProjectConfigResponse. */
3932
+ export interface ProjectConfigResponseRead {
3933
+ /**
3934
+ * Wire names of query/header parameters that become settable once on the generated client and
3935
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
3936
+ * are reported as generation warnings.
3937
+ */
3938
+ globals?: string[];
3939
+ retries?: RetryTuningResponse;
3940
+ /**
3941
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
3942
+ * reported as generation warnings.
3943
+ */
3944
+ pagination?: Record<string, PaginationRuleResponseRead | boolean>;
3945
+ auth?: AuthenticationConfigResponse;
3946
+ cli?: CliBehaviorResponse;
3947
+ mcp?: McpBehaviorResponseRead;
3948
+ readme?: ReadmeBehaviorResponse;
3949
+ package?: PackageBehaviorResponse;
3950
+ /**
3951
+ * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
3952
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
3953
+ * externalDocs URL.
3954
+ * Format: uri
3955
+ */
3956
+ docs_url?: string | null;
3957
+ /**
3958
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
3959
+ * Format: uri
3960
+ */
3961
+ docs_index_url?: string | null;
3962
+ }
3963
+ /**
3964
+ * Target-specific generation and delivery overrides. Authentication may only select a Project-owned
3965
+ * OAuth application. OAuth server metadata, applications, and identity policy remain Project-owned.
3966
+ * Self-hosted MCP access may be overridden for a Target-specific deployment.
3967
+ */
3968
+ export interface TargetConfigResponse {
3969
+ /**
3970
+ * Wire names of query/header parameters that become settable once on the generated client and
3971
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
3972
+ * are reported as generation warnings.
3973
+ */
3974
+ globals?: string[];
3975
+ retries?: RetryTuningResponse;
3976
+ /**
3977
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
3978
+ * reported as generation warnings.
3979
+ */
3980
+ pagination?: Record<string, PaginationRuleResponse | boolean>;
3981
+ auth?: TargetAuthenticationConfigResponse;
3982
+ cli?: CliBehaviorResponse;
3983
+ mcp?: McpBehaviorResponse;
3984
+ readme?: ReadmeBehaviorResponse;
3985
+ package?: PackageBehaviorResponse;
3986
+ /**
3987
+ * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
3988
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
3989
+ * externalDocs URL.
3990
+ * Format: uri
3991
+ */
3992
+ docs_url?: string | null;
3993
+ /**
3994
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
3995
+ * Format: uri
3996
+ */
3997
+ docs_index_url?: string | null;
3998
+ }
3999
+ /** Response shape for TargetConfigResponse. */
4000
+ export interface TargetConfigResponseRead {
4001
+ /**
4002
+ * Wire names of query/header parameters that become settable once on the generated client and
4003
+ * auto-apply to every operation that accepts them; per-call values win. Names that match nothing
4004
+ * are reported as generation warnings.
4005
+ */
4006
+ globals?: string[];
4007
+ retries?: RetryTuningResponse;
4008
+ /**
4009
+ * Per-operation pagination control, keyed by operationId or "METHOD /path". Unmatched keys are
4010
+ * reported as generation warnings.
4011
+ */
4012
+ pagination?: Record<string, PaginationRuleResponseRead | boolean>;
4013
+ auth?: TargetAuthenticationConfigResponse;
4014
+ cli?: CliBehaviorResponse;
4015
+ mcp?: McpBehaviorResponseRead;
4016
+ readme?: ReadmeBehaviorResponse;
4017
+ package?: PackageBehaviorResponse;
4018
+ /**
4019
+ * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
4020
+ * the MCP server's docs tools, and the package's AGENTS.md. Defaults to the Definition's
4021
+ * externalDocs URL.
4022
+ * Format: uri
4023
+ */
4024
+ docs_url?: string | null;
4025
+ /**
4026
+ * Exact llms.txt URL when the documentation site does not publish it at docs_url + /llms.txt.
4027
+ * Format: uri
4028
+ */
4029
+ docs_index_url?: string | null;
4030
+ }
4031
+ /** What a GraphQL schema cannot say about itself. Ignored for OpenAPI specs. */
4032
+ export interface GraphqlSettingsResponse {
4033
+ /**
4034
+ * The URL every request is POSTed to; the generated client's default baseUrl. Defaults to the URL
4035
+ * the schema was fetched from. Without either, baseUrl is a required client option.
4036
+ * Format: uri
4037
+ */
4038
+ endpoint?: string;
4039
+ /**
4040
+ * Named endpoints (sandbox, production). Each becomes a client environment; the first is the
4041
+ * default unless endpoint is set.
4042
+ */
4043
+ environments?: Array<{
4044
+ name: string;
4045
+ /** Format: uri */
4046
+ url: string;
4047
+ }>;
4048
+ /**
4049
+ * How requests authenticate. bearer sends Authorization: Bearer; basic is for key-pair APIs
4050
+ * (public key as username, private key as password); api_key sends a header named by
4051
+ * api_key_header; none generates no auth option.
4052
+ * Default: "bearer"
4053
+ */
4054
+ auth?: "bearer" | "basic" | "api_key" | "none";
4055
+ /**
4056
+ * Header carrying the key when auth is api_key. Required for that mode; Typeship does not invent
4057
+ * a vendor-specific header name.
4058
+ */
4059
+ api_key_header?: string;
4060
+ /**
4061
+ * The API's name; drives the package and client names ("Acme" gives acme and AcmeClient).
4062
+ * Defaults to a name derived from the endpoint's host.
4063
+ */
4064
+ title?: string;
4065
+ /**
4066
+ * JSON representation of each custom scalar, keyed by GraphQL scalar name. Unmapped scalars
4067
+ * generate as the language's untyped JSON value and produce a warning. Unmatched keys warn.
4068
+ */
4069
+ scalars?: Record<string, "string" | "integer" | "number" | "boolean" | "json">;
4070
+ }
4071
+ /** Response shape for GraphqlSettingsResponse. */
4072
+ export interface GraphqlSettingsResponseRead {
4073
+ /**
4074
+ * The URL every request is POSTed to; the generated client's default baseUrl. Defaults to the URL
4075
+ * the schema was fetched from. Without either, baseUrl is a required client option.
4076
+ * Format: uri
4077
+ */
4078
+ endpoint?: string;
4079
+ /**
4080
+ * Named endpoints (sandbox, production). Each becomes a client environment; the first is the
4081
+ * default unless endpoint is set.
4082
+ */
4083
+ environments?: Array<{
4084
+ name: string;
4085
+ /** Format: uri */
4086
+ url: string;
4087
+ }>;
4088
+ /**
4089
+ * How requests authenticate. bearer sends Authorization: Bearer; basic is for key-pair APIs
4090
+ * (public key as username, private key as password); api_key sends a header named by
4091
+ * api_key_header; none generates no auth option.
4092
+ * Default: "bearer"
4093
+ */
4094
+ auth?: ("bearer" | "basic" | "api_key" | "none") | (string & {});
4095
+ /**
4096
+ * Header carrying the key when auth is api_key. Required for that mode; Typeship does not invent
4097
+ * a vendor-specific header name.
4098
+ */
4099
+ api_key_header?: string;
4100
+ /**
4101
+ * The API's name; drives the package and client names ("Acme" gives acme and AcmeClient).
4102
+ * Defaults to a name derived from the endpoint's host.
4103
+ */
4104
+ title?: string;
4105
+ /**
4106
+ * JSON representation of each custom scalar, keyed by GraphQL scalar name. Unmapped scalars
4107
+ * generate as the language's untyped JSON value and produce a warning. Unmatched keys warn.
4108
+ */
4109
+ scalars?: Record<string, ("string" | "integer" | "number" | "boolean" | "json") | (string & {})>;
4110
+ }
4111
+ /**
4112
+ * Retry behavior. Top-level fields adjust every operation; operations maps operationId or "METHOD
4113
+ * /path" keys to per-operation overrides.
4114
+ */
4115
+ export interface RetryTuningResponse {
4116
+ max_retries?: number;
4117
+ /** Replaces the default retryable set (408, 429, 500, 502, 503, 504). */
4118
+ statuses?: number[];
4119
+ initial_delay_ms?: number;
4120
+ max_delay_ms?: number;
4121
+ /** Also retry non-idempotent methods (POST/PATCH). */
4122
+ retry_non_idempotent?: boolean;
4123
+ /** Shorthand for max_retries 0. */
4124
+ disabled?: boolean;
4125
+ operations?: Record<string, RetryTuningResponse>;
4126
+ }
4127
+ export interface PaginationRuleResponse {
4128
+ /** Default: "cursor" */
4129
+ style?: "cursor" | "cursorFromLastId" | "page" | "offset";
4130
+ /** Response field holding the item array. */
4131
+ items_field: string;
4132
+ cursor_param?: string;
4133
+ next_cursor_field?: string;
4134
+ has_more_field?: string;
4135
+ id_field?: string;
4136
+ page_param?: string;
4137
+ offset_param?: string;
4138
+ limit_param?: string;
4139
+ }
4140
+ /** Response shape for PaginationRuleResponse. */
4141
+ export interface PaginationRuleResponseRead {
4142
+ /** Default: "cursor" */
4143
+ style?: ("cursor" | "cursorFromLastId" | "page" | "offset") | (string & {});
4144
+ /** Response field holding the item array. */
4145
+ items_field: string;
4146
+ cursor_param?: string;
4147
+ next_cursor_field?: string;
4148
+ has_more_field?: string;
4149
+ id_field?: string;
4150
+ page_param?: string;
4151
+ offset_param?: string;
4152
+ limit_param?: string;
4153
+ }
4154
+ export interface ErrorModel {
4155
+ errors: ErrorDetail[];
4156
+ request_id: RequestId;
4157
+ }
4158
+ /** Response shape for ErrorModel. */
4159
+ export interface ErrorModelRead {
4160
+ errors: ErrorDetailRead[];
4161
+ request_id: RequestId;
4162
+ }
4163
+ /** Git file mode. 100755 is executable; 120000 is a symbolic link whose content is its target. */
4164
+ export declare const GitFileMode: {
4165
+ readonly V_100644: "100644";
4166
+ readonly V_100755: "100755";
4167
+ readonly V_120000: "120000";
4168
+ };
4169
+ export type GitFileMode = (typeof GitFileMode)[keyof typeof GitFileMode];
4170
+ /**
4171
+ * One side of a Draft file comparison. A conflict has base (the common version before both
4172
+ * changes), repository (the file on the Draft), and incoming (the file the merge brings in). A
4173
+ * default-branch history rewrite has accepted (the last accepted package), default (the rewritten
4174
+ * default branch), and draft (the current Draft branch).
4175
+ */
4176
+ export declare const DraftFileSide: {
4177
+ readonly BASE: "base";
4178
+ readonly REPOSITORY: "repository";
4179
+ readonly INCOMING: "incoming";
4180
+ readonly ACCEPTED: "accepted";
4181
+ readonly DEFAULT: "default";
4182
+ readonly DRAFT: "draft";
4183
+ };
4184
+ export type DraftFileSide = (typeof DraftFileSide)[keyof typeof DraftFileSide];
4185
+ export interface DraftFileSideSummary {
4186
+ side: DraftFileSide;
4187
+ mode: GitFileMode;
4188
+ size_bytes: number;
4189
+ /** utf8 for text; base64 for binary content. */
4190
+ encoding: "utf8" | "base64";
4191
+ }
4192
+ /** Response shape for DraftFileSideSummary. */
4193
+ export interface DraftFileSideSummaryRead {
4194
+ side: DraftFileSide | (string & {});
4195
+ mode: GitFileMode | (string & {});
4196
+ size_bytes: number;
4197
+ /** utf8 for text; base64 for binary content. */
4198
+ encoding: ("utf8" | "base64") | (string & {});
4199
+ }
4200
+ export interface DraftFileConflict {
4201
+ /**
4202
+ * Why the merge stopped. no_common_version: there is no earlier version to compare, such as the
4203
+ * first Draft of an adopted package. file_ownership: generated output collides with a file you
4204
+ * added. repository_deleted_incoming_changed and incoming_deleted_repository_changed: one side
4205
+ * deleted a file the other changed. overlapping_text: both sides edited the same lines.
4206
+ * too_large_to_merge: the file has too many changed lines to merge line by line. binary_changed
4207
+ * and file_mode_changed: both sides changed binary content or the file mode.
4208
+ */
4209
+ kind: "no_common_version" | "file_ownership" | "repository_deleted_incoming_changed" | "incoming_deleted_repository_changed" | "overlapping_text" | "too_large_to_merge" | "binary_changed" | "file_mode_changed";
4210
+ /**
4211
+ * Where the incoming version comes from: the new Generation, commits on the default branch, or
4212
+ * the code of a Draft whose branch was rebased, reset, or deleted (its old branch is preserved).
4213
+ * The merge applies previous_draft, then default_branch, then generation, and stops at the first
4214
+ * stage with conflicts, so applying one stage's decisions can report conflicts from the next.
4215
+ */
4216
+ source: "generation" | "default_branch" | "previous_draft";
4217
+ /**
4218
+ * Decision saved for this conflict on head_revision; null when none. Saved decisions apply when
4219
+ * the Target is generated.
4220
+ */
4221
+ decision: "repository" | "incoming" | "content" | null;
4222
+ }
4223
+ /** Response shape for DraftFileConflict. */
4224
+ export interface DraftFileConflictRead {
4225
+ /**
4226
+ * Why the merge stopped. no_common_version: there is no earlier version to compare, such as the
4227
+ * first Draft of an adopted package. file_ownership: generated output collides with a file you
4228
+ * added. repository_deleted_incoming_changed and incoming_deleted_repository_changed: one side
4229
+ * deleted a file the other changed. overlapping_text: both sides edited the same lines.
4230
+ * too_large_to_merge: the file has too many changed lines to merge line by line. binary_changed
4231
+ * and file_mode_changed: both sides changed binary content or the file mode.
4232
+ */
4233
+ kind: ("no_common_version" | "file_ownership" | "repository_deleted_incoming_changed" | "incoming_deleted_repository_changed" | "overlapping_text" | "too_large_to_merge" | "binary_changed" | "file_mode_changed") | (string & {});
4234
+ /**
4235
+ * Where the incoming version comes from: the new Generation, commits on the default branch, or
4236
+ * the code of a Draft whose branch was rebased, reset, or deleted (its old branch is preserved).
4237
+ * The merge applies previous_draft, then default_branch, then generation, and stops at the first
4238
+ * stage with conflicts, so applying one stage's decisions can report conflicts from the next.
4239
+ */
4240
+ source: ("generation" | "default_branch" | "previous_draft") | (string & {});
4241
+ /**
4242
+ * Decision saved for this conflict on head_revision; null when none. Saved decisions apply when
4243
+ * the Target is generated.
4244
+ */
4245
+ decision: ("repository" | "incoming" | "content" | null) | (string & {}) | null;
4246
+ }
4247
+ export interface DraftFileHistory {
4248
+ /**
4249
+ * How the rewritten default branch differs from the last accepted package; null when only the
4250
+ * Draft differs.
4251
+ */
4252
+ change: "added" | "edited" | "deleted" | "mode_changed" | null;
4253
+ /**
4254
+ * The Draft branch has a different version than the rewritten default branch. Recovery carries
4255
+ * the Draft version forward.
4256
+ */
4257
+ draft_differs: boolean;
4258
+ }
4259
+ /** Response shape for DraftFileHistory. */
4260
+ export interface DraftFileHistoryRead {
4261
+ /**
4262
+ * How the rewritten default branch differs from the last accepted package; null when only the
4263
+ * Draft differs.
4264
+ */
4265
+ change: ("added" | "edited" | "deleted" | "mode_changed" | null) | (string & {}) | null;
4266
+ /**
4267
+ * The Draft branch has a different version than the rewritten default branch. Recovery carries
4268
+ * the Draft version forward.
4269
+ */
4270
+ draft_differs: boolean;
4271
+ }
4272
+ export interface DraftFile {
4273
+ object: "draft_file";
4274
+ /** Path relative to the Target's package directory. */
4275
+ path: string;
4276
+ /** How the Draft differs from the last accepted package at this path; null when it does not. */
4277
+ customization: "added" | "edited" | "deleted" | "mode_changed" | null;
4278
+ conflict: DraftFileConflict | null;
4279
+ history: DraftFileHistory | null;
4280
+ /**
4281
+ * Sides of the comparison to read with retrieveDraftFileContent. A missing side means the file is
4282
+ * absent there. Listed for conflicts and history files.
4283
+ */
4284
+ sides: DraftFileSideSummary[];
4285
+ }
4286
+ /** Response shape for DraftFile. */
4287
+ export interface DraftFileRead {
4288
+ object: "draft_file" | (string & {});
4289
+ /** Path relative to the Target's package directory. */
4290
+ path: string;
4291
+ /** How the Draft differs from the last accepted package at this path; null when it does not. */
4292
+ customization: ("added" | "edited" | "deleted" | "mode_changed" | null) | (string & {}) | null;
4293
+ conflict: DraftFileConflictRead | null;
4294
+ history: DraftFileHistoryRead | null;
4295
+ /**
4296
+ * Sides of the comparison to read with retrieveDraftFileContent. A missing side means the file is
4297
+ * absent there. Listed for conflicts and history files.
4298
+ */
4299
+ sides: DraftFileSideSummaryRead[];
4300
+ }
4301
+ export interface DraftFileList {
4302
+ object: ListObject;
4303
+ data: DraftFile[];
4304
+ has_more: boolean;
4305
+ next_cursor: string | null;
4306
+ request_id: RequestId;
4307
+ }
4308
+ /** Response shape for DraftFileList. */
4309
+ export interface DraftFileListRead {
4310
+ object: ListObject;
4311
+ data: DraftFileRead[];
4312
+ has_more: boolean;
4313
+ next_cursor: string | null;
4314
+ request_id: RequestId;
4315
+ }
4316
+ export interface DraftFileContent {
4317
+ object: "draft_file_content";
4318
+ target_id: TargetId;
4319
+ path: string;
4320
+ side: DraftFileSide;
4321
+ /** utf8 means content is text; base64 means content is base64-encoded binary bytes. */
4322
+ encoding: "utf8" | "base64";
4323
+ /**
4324
+ * At most 24 KiB of the file starting at offset. Text chunks never split a character; concatenate
4325
+ * chunks in order.
4326
+ */
4327
+ content: string;
4328
+ mode: GitFileMode;
4329
+ /** Size of the whole file in bytes. */
4330
+ size_bytes: number;
4331
+ /** Byte offset of this chunk in the file. */
4332
+ offset: number;
4333
+ /**
4334
+ * Pass as cursor, with the same path and side, to read the next chunk; null at the end of the
4335
+ * file.
4336
+ */
4337
+ next_cursor: string | null;
4338
+ }
4339
+ /** Response shape for DraftFileContent. */
4340
+ export interface DraftFileContentRead {
4341
+ object: "draft_file_content" | (string & {});
4342
+ target_id: TargetId;
4343
+ path: string;
4344
+ side: DraftFileSide | (string & {});
4345
+ /** utf8 means content is text; base64 means content is base64-encoded binary bytes. */
4346
+ encoding: ("utf8" | "base64") | (string & {});
4347
+ /**
4348
+ * At most 24 KiB of the file starting at offset. Text chunks never split a character; concatenate
4349
+ * chunks in order.
4350
+ */
4351
+ content: string;
4352
+ mode: GitFileMode | (string & {});
4353
+ /** Size of the whole file in bytes. */
4354
+ size_bytes: number;
4355
+ /** Byte offset of this chunk in the file. */
4356
+ offset: number;
4357
+ /**
4358
+ * Pass as cursor, with the same path and side, to read the next chunk; null at the end of the
4359
+ * file.
4360
+ */
4361
+ next_cursor: string | null;
4362
+ }
4363
+ export type DraftFileContentResponse = DraftFileContent & ResponseMetadata;
4364
+ /** Response shape for DraftFileContentResponse. */
4365
+ export type DraftFileContentResponseRead = DraftFileContentRead & ResponseMetadata;
4366
+ export type DraftConflictDecision = {
4367
+ path: string;
4368
+ /** Keep that version of the file exactly. Keeping an absent version deletes the path. */
4369
+ keep: "repository" | "incoming";
4370
+ } | {
4371
+ path: string;
4372
+ keep: "content";
4373
+ /** Final file text, stored as UTF-8. An empty string creates an empty file. */
4374
+ content: string;
4375
+ mode: GitFileMode;
4376
+ } | {
4377
+ path: string;
4378
+ keep: "content";
4379
+ /** Final file bytes as canonical base64, for binary files. */
4380
+ content_base64: string;
4381
+ mode: GitFileMode;
4382
+ } | {
4383
+ path: string;
4384
+ keep: "content";
4385
+ /** Delete this file. */
4386
+ content: null;
4387
+ };
4388
+ /** Response shape for DraftConflictDecision. */
4389
+ export type DraftConflictDecisionRead = {
4390
+ path: string;
4391
+ /** Keep that version of the file exactly. Keeping an absent version deletes the path. */
4392
+ keep: ("repository" | "incoming") | (string & {});
4393
+ } | {
4394
+ path: string;
4395
+ keep: "content" | (string & {});
4396
+ /** Final file text, stored as UTF-8. An empty string creates an empty file. */
4397
+ content: string;
4398
+ mode: GitFileMode | (string & {});
4399
+ } | {
4400
+ path: string;
4401
+ keep: "content" | (string & {});
4402
+ /** Final file bytes as canonical base64, for binary files. */
4403
+ content_base64: string;
4404
+ mode: GitFileMode | (string & {});
4405
+ } | {
4406
+ path: string;
4407
+ keep: "content" | (string & {});
4408
+ /** Delete this file. */
4409
+ content: null;
4410
+ };
4411
+ export interface ResolveDraftConflicts {
4412
+ /** The Draft's head_revision. A newer Draft commit returns 409 stale_draft without saving. */
4413
+ expected_head_revision: string;
4414
+ /**
4415
+ * Unique current conflict paths. Final file content must total at most 2 MiB. Decisions save
4416
+ * together or not at all.
4417
+ */
4418
+ resolutions: DraftConflictDecision[];
4419
+ /**
4420
+ * Validate the decisions and return the planned files without saving.
4421
+ * Default: false
4422
+ */
4423
+ dry_run?: boolean;
4424
+ }
4425
+ /** Response shape for ResolveDraftConflicts. */
4426
+ export interface ResolveDraftConflictsRead {
4427
+ /** The Draft's head_revision. A newer Draft commit returns 409 stale_draft without saving. */
4428
+ expected_head_revision: string;
4429
+ /**
4430
+ * Unique current conflict paths. Final file content must total at most 2 MiB. Decisions save
4431
+ * together or not at all.
4432
+ */
4433
+ resolutions: DraftConflictDecisionRead[];
4434
+ /**
4435
+ * Validate the decisions and return the planned files without saving.
4436
+ * Default: false
4437
+ */
4438
+ dry_run?: boolean;
4439
+ }
4440
+ export interface DiscardDraftCustomizations {
4441
+ /** The Draft's head_revision. A newer Draft commit returns 409 stale_draft without committing. */
4442
+ expected_head_revision: string;
4443
+ /**
4444
+ * Customized paths that are not conflicts, to replace with the generated files. A listed file
4445
+ * that exists only on the Draft is deleted.
4446
+ */
4447
+ paths: string[];
4448
+ /**
4449
+ * Return the planned writes and deletions without committing.
4450
+ * Default: false
4451
+ */
4452
+ dry_run?: boolean;
4453
+ }
4454
+ export interface DraftPlannedFile {
4455
+ path: string;
4456
+ /** keep: the Draft's version stays. write: the file gets new content. delete: the path is removed. */
4457
+ action: "keep" | "write" | "delete";
4458
+ mode: GitFileMode | null;
4459
+ /** Size of the resulting file; null when it is deleted. */
4460
+ size_bytes: number | null;
4461
+ }
4462
+ /** Response shape for DraftPlannedFile. */
4463
+ export interface DraftPlannedFileRead {
4464
+ path: string;
4465
+ /** keep: the Draft's version stays. write: the file gets new content. delete: the path is removed. */
4466
+ action: ("keep" | "write" | "delete") | (string & {});
4467
+ mode: GitFileMode | (string & {}) | null;
4468
+ /** Size of the resulting file; null when it is deleted. */
4469
+ size_bytes: number | null;
4470
+ }
4471
+ export interface DraftConflictResolution {
4472
+ object: "draft_conflict_resolution";
4473
+ target_id: TargetId;
4474
+ /** Draft commit the decisions belong to. */
4475
+ head_revision: string;
4476
+ /**
4477
+ * preview: nothing was saved. saved: the decisions are stored and apply when the Target is
4478
+ * generated.
4479
+ */
4480
+ status: "preview" | "saved";
4481
+ files: DraftPlannedFile[];
4482
+ /**
4483
+ * Conflicts without a decision once these are saved. At 0 the Draft status becomes
4484
+ * needs_generation.
4485
+ */
4486
+ remaining_conflicts: number;
4487
+ }
4488
+ /** Response shape for DraftConflictResolution. */
4489
+ export interface DraftConflictResolutionRead {
4490
+ object: "draft_conflict_resolution" | (string & {});
4491
+ target_id: TargetId;
4492
+ /** Draft commit the decisions belong to. */
4493
+ head_revision: string;
4494
+ /**
4495
+ * preview: nothing was saved. saved: the decisions are stored and apply when the Target is
4496
+ * generated.
4497
+ */
4498
+ status: ("preview" | "saved") | (string & {});
4499
+ files: DraftPlannedFileRead[];
4500
+ /**
4501
+ * Conflicts without a decision once these are saved. At 0 the Draft status becomes
4502
+ * needs_generation.
4503
+ */
4504
+ remaining_conflicts: number;
4505
+ }
4506
+ export type DraftConflictResolutionResponse = DraftConflictResolution & ResponseMetadata;
4507
+ /** Response shape for DraftConflictResolutionResponse. */
4508
+ export type DraftConflictResolutionResponseRead = DraftConflictResolutionRead & ResponseMetadata;
4509
+ export interface DraftCustomizationDiscard {
4510
+ object: "draft_customization_discard";
4511
+ target_id: TargetId;
4512
+ /** preview: the inspected Draft commit. committed: the new Draft commit. */
4513
+ head_revision: string;
4514
+ /**
4515
+ * preview: nothing was written. committed: one commit was added to the Draft branch; the Draft
4516
+ * status is branch_changed until Typeship integrates it.
4517
+ */
4518
+ status: "preview" | "committed";
4519
+ files: DraftPlannedFile[];
4520
+ }
4521
+ /** Response shape for DraftCustomizationDiscard. */
4522
+ export interface DraftCustomizationDiscardRead {
4523
+ object: "draft_customization_discard" | (string & {});
4524
+ target_id: TargetId;
4525
+ /** preview: the inspected Draft commit. committed: the new Draft commit. */
4526
+ head_revision: string;
4527
+ /**
4528
+ * preview: nothing was written. committed: one commit was added to the Draft branch; the Draft
4529
+ * status is branch_changed until Typeship integrates it.
4530
+ */
4531
+ status: ("preview" | "committed") | (string & {});
4532
+ files: DraftPlannedFileRead[];
4533
+ }
4534
+ export type DraftCustomizationDiscardResponse = DraftCustomizationDiscard & ResponseMetadata;
4535
+ /** Response shape for DraftCustomizationDiscardResponse. */
4536
+ export type DraftCustomizationDiscardResponseRead = DraftCustomizationDiscardRead & ResponseMetadata;
4537
+ export interface GenerateProjectRequest {
4538
+ /** Generate only this active Target. Omit to generate all active Targets in the Project. */
4539
+ target_id?: TargetId;
4540
+ }
4541
+ /** The stage that failed. A delivery failure does not change a Generation's succeeded status. */
4542
+ export declare const FailurePhase: {
4543
+ readonly DEFINITION: "definition";
4544
+ readonly GENERATION: "generation";
4545
+ readonly DELIVERY: "delivery";
4546
+ readonly PUBLICATION: "publication";
4547
+ };
4548
+ export type FailurePhase = (typeof FailurePhase)[keyof typeof FailurePhase];
4549
+ export type DomainError = ErrorDetail & {
4550
+ phase: FailurePhase;
4551
+ };
4552
+ /** Response shape for DomainError. */
4553
+ export type DomainErrorRead = ErrorDetailRead & {
4554
+ phase: FailurePhase | (string & {});
4555
+ };
4556
+ export interface RecoverDraftHistory {
4557
+ /** The Draft's history_recovery.default_revision. */
4558
+ expected_default_revision: string;
4559
+ /** The Draft's history_recovery.head_revision; null when the Draft branch is absent. */
4560
+ expected_head_revision: string | null;
4561
+ }
4562
+ export interface DraftHistoryRecovery {
4563
+ object: "draft_history_recovery";
4564
+ target_id: TargetId;
4565
+ /**
4566
+ * approved: recovery is saved and the Draft status is needs_generation. not_needed: the default
4567
+ * branch still contains the accepted package.
4568
+ */
4569
+ status: "approved" | "not_needed";
4570
+ default_revision: string;
4571
+ head_revision: string | null;
4572
+ /** Existing Draft branch that stays available when Generate opens the recovered Draft. */
4573
+ preserved_branch: string | null;
4574
+ }
4575
+ /** Response shape for DraftHistoryRecovery. */
4576
+ export interface DraftHistoryRecoveryRead {
4577
+ object: "draft_history_recovery" | (string & {});
4578
+ target_id: TargetId;
4579
+ /**
4580
+ * approved: recovery is saved and the Draft status is needs_generation. not_needed: the default
4581
+ * branch still contains the accepted package.
4582
+ */
4583
+ status: ("approved" | "not_needed") | (string & {});
4584
+ default_revision: string;
4585
+ head_revision: string | null;
4586
+ /** Existing Draft branch that stays available when Generate opens the recovered Draft. */
4587
+ preserved_branch: string | null;
2776
4588
  }
4589
+ export type DraftHistoryRecoveryResponse = DraftHistoryRecovery & ResponseMetadata;
4590
+ /** Response shape for DraftHistoryRecoveryResponse. */
4591
+ export type DraftHistoryRecoveryResponseRead = DraftHistoryRecoveryRead & ResponseMetadata;
2777
4592
  //# sourceMappingURL=types.d.ts.map