@typeship-ax/mcp 0.8.0 → 0.10.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 (103) hide show
  1. package/AGENTS.md +31 -0
  2. package/README.md +66 -9
  3. package/api.json +3153 -761
  4. package/api.md +9796 -382
  5. package/dist/api-identity.d.ts +40 -0
  6. package/dist/api-identity.d.ts.map +1 -0
  7. package/dist/api-identity.js +128 -0
  8. package/dist/auth-profiles.d.ts +30 -0
  9. package/dist/auth-profiles.d.ts.map +1 -0
  10. package/dist/auth-profiles.js +138 -0
  11. package/dist/core/http.d.ts +17 -2
  12. package/dist/core/http.d.ts.map +1 -1
  13. package/dist/core/http.js +78 -17
  14. package/dist/credential-storage.d.ts +24 -0
  15. package/dist/credential-storage.d.ts.map +1 -0
  16. package/dist/credential-storage.js +207 -0
  17. package/dist/docs.d.ts +25 -0
  18. package/dist/docs.d.ts.map +1 -1
  19. package/dist/docs.js +144 -0
  20. package/dist/errors.d.ts +18 -10
  21. package/dist/errors.d.ts.map +1 -1
  22. package/dist/errors.js +24 -14
  23. package/dist/index.d.ts +10 -3
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +20 -4
  26. package/dist/mcp-authorization.d.ts +52 -0
  27. package/dist/mcp-authorization.d.ts.map +1 -0
  28. package/dist/mcp-authorization.js +232 -0
  29. package/dist/mcp-protocol.d.ts +51 -2
  30. package/dist/mcp-protocol.d.ts.map +1 -1
  31. package/dist/mcp-protocol.js +249 -37
  32. package/dist/mcp.d.ts +21 -3
  33. package/dist/mcp.d.ts.map +1 -1
  34. package/dist/mcp.js +185 -68
  35. package/dist/named-credentials.d.ts +21 -0
  36. package/dist/named-credentials.d.ts.map +1 -0
  37. package/dist/named-credentials.js +86 -0
  38. package/dist/oauth-request.d.ts +21 -0
  39. package/dist/oauth-request.d.ts.map +1 -0
  40. package/dist/oauth-request.js +119 -0
  41. package/dist/oauth-session.d.ts +106 -0
  42. package/dist/oauth-session.d.ts.map +1 -0
  43. package/dist/oauth-session.js +244 -0
  44. package/dist/ops.d.ts +14 -1
  45. package/dist/ops.d.ts.map +1 -1
  46. package/dist/ops.js +34 -30
  47. package/dist/resources/account.d.ts +2 -2
  48. package/dist/resources/account.d.ts.map +1 -1
  49. package/dist/resources/account.js +1 -0
  50. package/dist/resources/api-keys.d.ts +3 -3
  51. package/dist/resources/api-keys.d.ts.map +1 -1
  52. package/dist/resources/api-keys.js +2 -0
  53. package/dist/resources/definition-revisions.d.ts +5 -5
  54. package/dist/resources/definition-revisions.d.ts.map +1 -1
  55. package/dist/resources/definition-revisions.js +4 -0
  56. package/dist/resources/definitions.d.ts +15 -4
  57. package/dist/resources/definitions.d.ts.map +1 -1
  58. package/dist/resources/definitions.js +11 -2
  59. package/dist/resources/generate.d.ts +14 -3
  60. package/dist/resources/generate.d.ts.map +1 -1
  61. package/dist/resources/generate.js +10 -2
  62. package/dist/resources/generations.d.ts +3 -3
  63. package/dist/resources/generations.d.ts.map +1 -1
  64. package/dist/resources/generations.js +2 -0
  65. package/dist/resources/projects.d.ts +56 -20
  66. package/dist/resources/projects.d.ts.map +1 -1
  67. package/dist/resources/projects.js +40 -4
  68. package/dist/resources/targets.d.ts +84 -10
  69. package/dist/resources/targets.d.ts.map +1 -1
  70. package/dist/resources/targets.js +127 -2
  71. package/dist/schemas.d.ts.map +1 -1
  72. package/dist/schemas.js +55 -26
  73. package/dist/types.d.ts +602 -123
  74. package/dist/types.d.ts.map +1 -1
  75. package/dist/types.js +24 -0
  76. package/dist/worker.js +4 -4
  77. package/package.json +11 -1
  78. package/server.json +42 -0
  79. package/src/api-identity.ts +98 -0
  80. package/src/auth-profiles.ts +114 -0
  81. package/src/core/http.ts +88 -19
  82. package/src/credential-storage.ts +183 -0
  83. package/src/docs.ts +138 -0
  84. package/src/errors.ts +26 -15
  85. package/src/index.ts +29 -4
  86. package/src/mcp-authorization.ts +211 -0
  87. package/src/mcp-protocol.ts +287 -38
  88. package/src/mcp.ts +186 -72
  89. package/src/named-credentials.ts +74 -0
  90. package/src/oauth-request.ts +90 -0
  91. package/src/oauth-session.ts +258 -0
  92. package/src/ops.ts +48 -31
  93. package/src/resources/account.ts +3 -0
  94. package/src/resources/api-keys.ts +5 -0
  95. package/src/resources/definition-revisions.ts +9 -0
  96. package/src/resources/definitions.ts +25 -0
  97. package/src/resources/generate.ts +23 -0
  98. package/src/resources/generations.ts +5 -0
  99. package/src/resources/projects.ts +95 -7
  100. package/src/resources/targets.ts +241 -0
  101. package/src/schemas.ts +55 -26
  102. package/src/types.ts +640 -123
  103. package/src/worker.ts +4 -4
package/dist/types.d.ts CHANGED
@@ -20,6 +20,7 @@ export type ListObject = "list";
20
20
  export type TargetId = string;
21
21
  export type DeliveryId = string;
22
22
  export type TargetReleaseId = string;
23
+ export type PublicationId = string;
23
24
  /**
24
25
  * Generator implementation selected by a Target. This is configuration, not identity; several
25
26
  * Targets may use the same generator.
@@ -540,6 +541,15 @@ export interface Diagnostic {
540
541
  impact: string;
541
542
  /** Public surfaces affected by the root cause. */
542
543
  surfaces: Array<"api" | "sdk" | "cli" | "mcp">;
544
+ /**
545
+ * Whether the finding is provable from the Definition, a conservative review suggestion, or a
546
+ * documented Typeship implementation limitation.
547
+ */
548
+ evidence_basis: "contract" | "heuristic" | "implementation";
549
+ /** Whether remediation requires intent that the Definition cannot prove. */
550
+ owner_decision_required: boolean;
551
+ /** Concrete generated SDK, CLI, or MCP naming effect when Typeship can state it. */
552
+ surface_impact?: string;
543
553
  /** All affected coordinates, kept under one grouped diagnostic. */
544
554
  locations: DiagnosticLocation[];
545
555
  fix?: DiagnosticFix;
@@ -565,6 +575,15 @@ export interface DiagnosticRead {
565
575
  impact: string;
566
576
  /** Public surfaces affected by the root cause. */
567
577
  surfaces: Array<("api" | "sdk" | "cli" | "mcp") | (string & {})>;
578
+ /**
579
+ * Whether the finding is provable from the Definition, a conservative review suggestion, or a
580
+ * documented Typeship implementation limitation.
581
+ */
582
+ evidence_basis: ("contract" | "heuristic" | "implementation") | (string & {});
583
+ /** Whether remediation requires intent that the Definition cannot prove. */
584
+ owner_decision_required: boolean;
585
+ /** Concrete generated SDK, CLI, or MCP naming effect when Typeship can state it. */
586
+ surface_impact?: string;
568
587
  /** All affected coordinates, kept under one grouped diagnostic. */
569
588
  locations: DiagnosticLocation[];
570
589
  fix?: DiagnosticFixRead;
@@ -642,6 +661,22 @@ export interface DiagnosticEvaluationRead {
642
661
  considered_occurrences: number;
643
662
  suppressed_occurrences: number;
644
663
  }
664
+ /** Current-revision suppression usage for one stable Diagnostic rule. */
665
+ export interface DiagnosticSuppressionSignal {
666
+ rule_id: string;
667
+ /** Current occurrences of this rule that are not suppressed. */
668
+ active_occurrences: number;
669
+ suppressed_occurrences: number;
670
+ }
671
+ /**
672
+ * Current-revision signals for tuning Diagnostics policy. These counts do not claim that a
673
+ * suppression is a false positive or that runtime behavior has been verified.
674
+ */
675
+ export interface DiagnosticQualitySignals {
676
+ suppressed_by_rule: DiagnosticSuppressionSignal[];
677
+ /** Reviewed exceptions whose rule or exact path no longer matches this revision. */
678
+ stale_suppressions: DiagnosticSuppression[];
679
+ }
645
680
  /** Compact rule and location reference; full guidance appears once in diagnostics. */
646
681
  export interface DiagnosticReference {
647
682
  rule_id: string;
@@ -688,6 +723,7 @@ export interface DiagnosticReport {
688
723
  diagnostics: Diagnostic[];
689
724
  policy: DiagnosticPolicy;
690
725
  evaluation: DiagnosticEvaluation;
726
+ quality_signals: DiagnosticQualitySignals;
691
727
  delta: DiagnosticDelta;
692
728
  request_id: RequestId;
693
729
  }
@@ -709,6 +745,7 @@ export interface DiagnosticReportRead {
709
745
  diagnostics: DiagnosticRead[];
710
746
  policy: DiagnosticPolicyRead;
711
747
  evaluation: DiagnosticEvaluationRead;
748
+ quality_signals: DiagnosticQualitySignals;
712
749
  delta: DiagnosticDeltaRead;
713
750
  request_id: RequestId;
714
751
  }
@@ -747,6 +784,11 @@ export interface RepositoryDeliveryInput {
747
784
  package_name?: string | null;
748
785
  /** Explicit Go module path where applicable. */
749
786
  module_path?: string | null;
787
+ /**
788
+ * Commit repository-owned registry automation and report publication after the Draft merges.
789
+ * Default: false
790
+ */
791
+ publish_on_merge?: boolean;
750
792
  }
751
793
  /** Response shape for RepositoryDeliveryInput. */
752
794
  export interface RepositoryDeliveryInputRead {
@@ -757,6 +799,11 @@ export interface RepositoryDeliveryInputRead {
757
799
  package_name?: string | null;
758
800
  /** Explicit Go module path where applicable. */
759
801
  module_path?: string | null;
802
+ /**
803
+ * Commit repository-owned registry automation and report publication after the Draft merges.
804
+ * Default: false
805
+ */
806
+ publish_on_merge?: boolean;
760
807
  }
761
808
  export interface HostedMcpDeliveryInput {
762
809
  kind: "hosted_mcp";
@@ -780,6 +827,7 @@ export interface RepositoryDelivery {
780
827
  directory: string | null;
781
828
  package_name: string | null;
782
829
  module_path: string | null;
830
+ publish_on_merge: boolean;
783
831
  /** Format: date-time */
784
832
  created_at: string;
785
833
  /** Format: date-time */
@@ -796,6 +844,7 @@ export interface RepositoryDeliveryRead {
796
844
  directory: string | null;
797
845
  package_name: string | null;
798
846
  module_path: string | null;
847
+ publish_on_merge: boolean;
799
848
  /** Format: date-time */
800
849
  created_at: string;
801
850
  /** Format: date-time */
@@ -849,7 +898,7 @@ export interface TargetFields {
849
898
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
850
899
  * belong to the Definition.
851
900
  */
852
- config?: ProjectConfig | null;
901
+ config?: TargetConfig | null;
853
902
  deliveries?: DeliveryInput[];
854
903
  }
855
904
  /** Response shape for TargetFields. */
@@ -869,7 +918,7 @@ export interface TargetFieldsRead {
869
918
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
870
919
  * belong to the Definition.
871
920
  */
872
- config?: ProjectConfigRead | null;
921
+ config?: TargetConfigRead | null;
873
922
  deliveries?: DeliveryInputRead[];
874
923
  }
875
924
  export interface InitialTargetFields {
@@ -886,7 +935,7 @@ export interface InitialTargetFields {
886
935
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
887
936
  * belong to the Definition.
888
937
  */
889
- config?: ProjectConfig | null;
938
+ config?: TargetConfig | null;
890
939
  deliveries?: DeliveryInput[];
891
940
  }
892
941
  /** Response shape for InitialTargetFields. */
@@ -904,7 +953,7 @@ export interface InitialTargetFieldsRead {
904
953
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
905
954
  * belong to the Definition.
906
955
  */
907
- config?: ProjectConfigRead | null;
956
+ config?: TargetConfigRead | null;
908
957
  deliveries?: DeliveryInputRead[];
909
958
  }
910
959
  export interface TargetUpdateRequest {
@@ -917,7 +966,7 @@ export interface TargetUpdateRequest {
917
966
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
918
967
  * belong to the Definition.
919
968
  */
920
- config?: ProjectConfig | null;
969
+ config?: TargetConfig | null;
921
970
  deliveries?: DeliveryInput[];
922
971
  }
923
972
  /** Response shape for TargetUpdateRequest. */
@@ -931,7 +980,7 @@ export interface TargetUpdateRequestRead {
931
980
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
932
981
  * belong to the Definition.
933
982
  */
934
- config?: ProjectConfigRead | null;
983
+ config?: TargetConfigRead | null;
935
984
  deliveries?: DeliveryInputRead[];
936
985
  }
937
986
  export interface Target {
@@ -948,13 +997,23 @@ export interface Target {
948
997
  mode: "reviewed_semver";
949
998
  pre1_breaking: "minor";
950
999
  };
951
- current_version: string;
1000
+ /**
1001
+ * Deprecated projection of the newest immutable Target Release; null until a release becomes
1002
+ * Current.
1003
+ * @deprecated
1004
+ */
1005
+ current_version: string | null;
952
1006
  proposed_version: string | null;
1007
+ proposed_version_source: "console" | "api" | "github" | null;
1008
+ proposed_version_actor: string | null;
1009
+ /** Optimistic concurrency revision for Draft selections. */
1010
+ release_revision: number;
953
1011
  /**
954
1012
  * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
955
1013
  * never appear here.
956
1014
  */
957
- config: ProjectConfig | null;
1015
+ config: TargetConfig | null;
1016
+ /** At most one repository and one hosted MCP Delivery. */
958
1017
  deliveries: Delivery[];
959
1018
  /** Format: date-time */
960
1019
  created_at: string;
@@ -977,13 +1036,23 @@ export interface TargetRead {
977
1036
  mode: "reviewed_semver" | (string & {});
978
1037
  pre1_breaking: "minor" | (string & {});
979
1038
  };
980
- current_version: string;
1039
+ /**
1040
+ * Deprecated projection of the newest immutable Target Release; null until a release becomes
1041
+ * Current.
1042
+ * @deprecated
1043
+ */
1044
+ current_version: string | null;
981
1045
  proposed_version: string | null;
1046
+ 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;
982
1050
  /**
983
1051
  * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
984
1052
  * never appear here.
985
1053
  */
986
- config: ProjectConfigRead | null;
1054
+ config: TargetConfigRead | null;
1055
+ /** At most one repository and one hosted MCP Delivery. */
987
1056
  deliveries: DeliveryRead[];
988
1057
  /** Format: date-time */
989
1058
  created_at: string;
@@ -1013,7 +1082,9 @@ export interface TargetRelease {
1013
1082
  id: TargetReleaseId;
1014
1083
  object: "target_release";
1015
1084
  target_id: TargetId;
1016
- generation_id: GenerationId;
1085
+ /** Null only for a verified release imported during package adoption. */
1086
+ generation_id: GenerationId | null;
1087
+ origin: "typeship" | "imported";
1017
1088
  /** Immutable package version released from this Target. */
1018
1089
  version: string;
1019
1090
  channel: "stable" | "prerelease";
@@ -1023,6 +1094,15 @@ export interface TargetRelease {
1023
1094
  definition_revision_id: DefinitionRevisionId | null;
1024
1095
  /** Immutable provider-native revision that was merged or published. */
1025
1096
  delivery_revision: string;
1097
+ import_provenance: {
1098
+ tag: string | null;
1099
+ /** Format: uri */
1100
+ registry_url: string | null;
1101
+ artifact_digest: string | null;
1102
+ /** Format: date-time */
1103
+ imported_at: string | null;
1104
+ } | null;
1105
+ publications: Publication[];
1026
1106
  /** Format: date-time */
1027
1107
  created_at: string;
1028
1108
  request_id?: RequestId;
@@ -1032,7 +1112,9 @@ export interface TargetReleaseRead {
1032
1112
  id: TargetReleaseId;
1033
1113
  object: "target_release" | (string & {});
1034
1114
  target_id: TargetId;
1035
- generation_id: GenerationId;
1115
+ /** Null only for a verified release imported during package adoption. */
1116
+ generation_id: GenerationId | null;
1117
+ origin: ("typeship" | "imported") | (string & {});
1036
1118
  /** Immutable package version released from this Target. */
1037
1119
  version: string;
1038
1120
  channel: ("stable" | "prerelease") | (string & {});
@@ -1042,6 +1124,15 @@ export interface TargetReleaseRead {
1042
1124
  definition_revision_id: DefinitionRevisionId | null;
1043
1125
  /** Immutable provider-native revision that was merged or published. */
1044
1126
  delivery_revision: string;
1127
+ import_provenance: {
1128
+ tag: string | null;
1129
+ /** Format: uri */
1130
+ registry_url: string | null;
1131
+ artifact_digest: string | null;
1132
+ /** Format: date-time */
1133
+ imported_at: string | null;
1134
+ } | null;
1135
+ publications: PublicationRead[];
1045
1136
  /** Format: date-time */
1046
1137
  created_at: string;
1047
1138
  request_id?: RequestId;
@@ -1064,6 +1155,117 @@ export interface TargetReleaseListRead {
1064
1155
  next_cursor: string | null;
1065
1156
  request_id: RequestId;
1066
1157
  }
1158
+ export interface Publication {
1159
+ id: PublicationId;
1160
+ object: "publication";
1161
+ target_release_id: TargetReleaseId;
1162
+ destination: "github" | "npm" | "pypi" | "go" | "mcp";
1163
+ state: "pending" | "publishing" | "published" | "failed";
1164
+ attempt: number;
1165
+ /** Format: uri */
1166
+ run_url: string | null;
1167
+ /** Format: uri */
1168
+ registry_url: string | null;
1169
+ artifact_digest: string | null;
1170
+ error: string | null;
1171
+ /** Format: date-time */
1172
+ started_at: string | null;
1173
+ /** Format: date-time */
1174
+ finished_at: string | null;
1175
+ /** Format: date-time */
1176
+ updated_at: string;
1177
+ }
1178
+ /** Response shape for Publication. */
1179
+ export interface PublicationRead {
1180
+ id: PublicationId;
1181
+ object: "publication" | (string & {});
1182
+ target_release_id: TargetReleaseId;
1183
+ destination: ("github" | "npm" | "pypi" | "go" | "mcp") | (string & {});
1184
+ state: ("pending" | "publishing" | "published" | "failed") | (string & {});
1185
+ attempt: number;
1186
+ /** Format: uri */
1187
+ run_url: string | null;
1188
+ /** Format: uri */
1189
+ registry_url: string | null;
1190
+ artifact_digest: string | null;
1191
+ error: string | null;
1192
+ /** Format: date-time */
1193
+ started_at: string | null;
1194
+ /** Format: date-time */
1195
+ finished_at: string | null;
1196
+ /** Format: date-time */
1197
+ updated_at: string;
1198
+ }
1199
+ export type TargetDraftSelection = {
1200
+ mode: "automatic";
1201
+ } | {
1202
+ mode: "exact";
1203
+ version: string;
1204
+ source: "console" | "api" | "github" | null;
1205
+ actor: string | null;
1206
+ };
1207
+ /** Response shape for TargetDraftSelection. */
1208
+ export type TargetDraftSelectionRead = {
1209
+ mode: "automatic" | (string & {});
1210
+ } | {
1211
+ mode: "exact" | (string & {});
1212
+ version: string;
1213
+ source: ("console" | "api" | "github" | null) | (string & {}) | null;
1214
+ actor: string | null;
1215
+ };
1216
+ export interface TargetDraft {
1217
+ object: "target_draft";
1218
+ target_id: TargetId;
1219
+ revision: number;
1220
+ current_version: string | null;
1221
+ version: string | null;
1222
+ selection: TargetDraftSelection;
1223
+ readiness: Record<string, unknown> | null;
1224
+ changes: {
1225
+ /** Cumulative changelog against Current. */
1226
+ changelog?: string | null;
1227
+ breaking_count?: number | null;
1228
+ previous_version?: string | null;
1229
+ } | null;
1230
+ head_revision: string | null;
1231
+ /** Format: uri */
1232
+ pull_request_url: string | null;
1233
+ request_id?: RequestId;
1234
+ }
1235
+ /** Response shape for TargetDraft. */
1236
+ export interface TargetDraftRead {
1237
+ object: "target_draft" | (string & {});
1238
+ target_id: TargetId;
1239
+ revision: number;
1240
+ current_version: string | null;
1241
+ version: string | null;
1242
+ selection: TargetDraftSelectionRead;
1243
+ readiness: Record<string, unknown> | null;
1244
+ changes: {
1245
+ /** Cumulative changelog against Current. */
1246
+ changelog?: string | null;
1247
+ breaking_count?: number | null;
1248
+ previous_version?: string | null;
1249
+ } | null;
1250
+ head_revision: string | null;
1251
+ /** Format: uri */
1252
+ pull_request_url: string | null;
1253
+ request_id?: RequestId;
1254
+ }
1255
+ export type TargetDraftResponse = TargetDraft & ResponseMetadata;
1256
+ /** Response shape for TargetDraftResponse. */
1257
+ export type TargetDraftResponseRead = TargetDraftRead & ResponseMetadata;
1258
+ export interface TargetDraftUpdate {
1259
+ /** Exact SemVer, or null to return to automatic selection. */
1260
+ version: string | null;
1261
+ expected_revision?: number;
1262
+ }
1263
+ export interface TargetAdoption {
1264
+ /** Exact already-published package version to make Current. */
1265
+ version: string;
1266
+ /** Immutable repository tag containing the matching package source. */
1267
+ tag: string;
1268
+ }
1067
1269
  export interface RepositoryHealthIssue {
1068
1270
  code: "connection_missing" | "definition_unreadable" | "contents_write_missing" | "review_write_missing" | "breaking_acknowledgement_missing" | "provider_unavailable";
1069
1271
  message: string;
@@ -1226,18 +1428,15 @@ export interface DefinitionUpdateRequestRead {
1226
1428
  graphql?: GraphqlSettingsRead | null;
1227
1429
  diagnostic_policy?: DiagnosticPolicyRead;
1228
1430
  }
1431
+ /**
1432
+ * Project-owned identity, Definition reference, generation controls, and shared configuration.
1433
+ * Targets and Deliveries are available only through their canonical Target endpoints.
1434
+ */
1229
1435
  export interface Project {
1230
1436
  id: ProjectId;
1231
1437
  object: "project";
1232
1438
  name: string;
1233
1439
  definition_id: DefinitionId;
1234
- /** All configured Targets, including disabled Targets and their saved Deliveries. */
1235
- targets: Target[];
1236
- /**
1237
- * Flattened convenience view derived from the same Target bundles. Every Delivery retains
1238
- * target_id so ownership is explicit.
1239
- */
1240
- deliveries: Delivery[];
1241
1440
  /**
1242
1441
  * Regenerate when the Definition changes: on every push to the default branch for a repository
1243
1442
  * source, every 30 minutes for a URL source. Off by default: the first generation is always one
@@ -1268,13 +1467,6 @@ export interface Project {
1268
1467
  export interface ProjectWrite {
1269
1468
  name: string;
1270
1469
  definition_id: DefinitionId;
1271
- /** All configured Targets, including disabled Targets and their saved Deliveries. */
1272
- targets: Target[];
1273
- /**
1274
- * Flattened convenience view derived from the same Target bundles. Every Delivery retains
1275
- * target_id so ownership is explicit.
1276
- */
1277
- deliveries: Delivery[];
1278
1470
  /**
1279
1471
  * Regenerate when the Definition changes: on every push to the default branch for a repository
1280
1472
  * source, every 30 minutes for a URL source. Off by default: the first generation is always one
@@ -1300,13 +1492,6 @@ export interface ProjectRead {
1300
1492
  object: "project" | (string & {});
1301
1493
  name: string;
1302
1494
  definition_id: DefinitionId;
1303
- /** All configured Targets, including disabled Targets and their saved Deliveries. */
1304
- targets: TargetRead[];
1305
- /**
1306
- * Flattened convenience view derived from the same Target bundles. Every Delivery retains
1307
- * target_id so ownership is explicit.
1308
- */
1309
- deliveries: DeliveryRead[];
1310
1495
  /**
1311
1496
  * Regenerate when the Definition changes: on every push to the default branch for a repository
1312
1497
  * source, every 30 minutes for a URL source. Off by default: the first generation is always one
@@ -1334,8 +1519,8 @@ export interface ProjectRead {
1334
1519
  request_id: RequestId;
1335
1520
  }
1336
1521
  /**
1337
- * Lean Project identity returned by collection endpoints. Retrieve the Project or list its Targets
1338
- * for the complete aggregate.
1522
+ * Lean Project identity returned by collection endpoints. Retrieve the Project for shared
1523
+ * configuration and list its Targets for the complete canonical child collection.
1339
1524
  */
1340
1525
  export interface ProjectSummary {
1341
1526
  id: ProjectId;
@@ -1445,30 +1630,143 @@ export interface AccountRead {
1445
1630
  created_at: string;
1446
1631
  request_id: RequestId;
1447
1632
  }
1448
- /** How the generated CLI behaves. Part of Config. */
1449
- export interface CliBehavior {
1450
- /** Command users run, independent of how the CLI is distributed. */
1451
- command_name?: string | null;
1633
+ /**
1634
+ * Authorization-server metadata used by generated OAuth flows. Secrets and runtime credentials are
1635
+ * never accepted here.
1636
+ */
1637
+ export interface OAuthServer {
1452
1638
  /**
1453
- * resource.method of a zero-argument GET that the generated CLI's whoami command calls. Overrides
1454
- * auto-detection; a value that matches nothing is reported as a generation warning.
1639
+ * Exact authorization-server issuer, including any tenant path.
1640
+ * Format: uri
1455
1641
  */
1456
- whoami_operation?: string | null;
1642
+ issuer?: string | null;
1457
1643
  /**
1458
- * OAuth client id baked into the generated CLI for device-flow login. Without it, login prompts
1459
- * for a pasted credential.
1644
+ * Exact metadata URL when it cannot be derived from the issuer.
1645
+ * Format: uri
1460
1646
  */
1461
- oauth_client_id?: string | null;
1647
+ discovery_url?: string | null;
1462
1648
  /**
1463
- * Scopes requested during device-flow login. Include offline_access if the authorization server
1464
- * gates refresh tokens behind it.
1649
+ * Authorization endpoint override.
1650
+ * Format: uri
1465
1651
  */
1466
- oauth_scopes?: string[];
1652
+ authorization_url?: string | null;
1467
1653
  /**
1468
- * Audience sent with the device-authorization request, for authorization servers that require one
1469
- * to issue API-valid access tokens.
1654
+ * Token endpoint override.
1655
+ * Format: uri
1656
+ */
1657
+ token_url?: string | null;
1658
+ /**
1659
+ * Device-authorization endpoint override.
1660
+ * Format: uri
1470
1661
  */
1471
- oauth_audience?: string | null;
1662
+ device_authorization_url?: string | null;
1663
+ /** Default scopes requested during login. */
1664
+ scopes?: string[] | null;
1665
+ /** Default audience included in authorization and token requests. */
1666
+ audience?: string | null;
1667
+ /**
1668
+ * Protected API resource included in authorization and token requests.
1669
+ * Format: uri
1670
+ */
1671
+ resource?: string | null;
1672
+ }
1673
+ /**
1674
+ * OAuth application available to generated products. Public clients support interactive login;
1675
+ * confidential clients support runtime-supplied machine credentials. Client secrets are never
1676
+ * stored.
1677
+ */
1678
+ export interface OAuthApplication {
1679
+ /** OAuth client identifier. */
1680
+ client_id: string;
1681
+ /** Interactive login method. Browser login uses Authorization Code with PKCE. */
1682
+ login_method?: "browser" | "device" | null;
1683
+ /** How a runtime-supplied client secret is sent for machine grants. */
1684
+ client_auth_method?: "post" | "basic" | null;
1685
+ /**
1686
+ * Loopback callback URL for browser login.
1687
+ * Format: uri
1688
+ */
1689
+ redirect_uri?: string | null;
1690
+ /** Provider parameter used to request an organization during browser login. */
1691
+ organization_parameter?: "organization" | "organization_id" | null;
1692
+ }
1693
+ /** Response shape for OAuthApplication. */
1694
+ export interface OAuthApplicationRead {
1695
+ /** OAuth client identifier. */
1696
+ client_id: string;
1697
+ /** Interactive login method. Browser login uses Authorization Code with PKCE. */
1698
+ login_method?: ("browser" | "device" | null) | (string & {}) | null;
1699
+ /** How a runtime-supplied client secret is sent for machine grants. */
1700
+ client_auth_method?: ("post" | "basic" | null) | (string & {}) | null;
1701
+ /**
1702
+ * Loopback callback URL for browser login.
1703
+ * Format: uri
1704
+ */
1705
+ redirect_uri?: string | null;
1706
+ /** Provider parameter used to request an organization during browser login. */
1707
+ organization_parameter?: ("organization" | "organization_id" | null) | (string & {}) | null;
1708
+ }
1709
+ /**
1710
+ * 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.
1713
+ */
1714
+ export interface IdentityVerification {
1715
+ /** resource.method of a safe identity read with no required arguments. */
1716
+ operation?: string;
1717
+ /** JSON Pointer to the stable caller ID in the identity response. */
1718
+ subject_field?: string;
1719
+ /** JSON Pointer to the customer account ID. */
1720
+ account_field?: string;
1721
+ /** JSON Pointer to the customer organization ID. */
1722
+ organization_field?: string;
1723
+ }
1724
+ /** OAuth application and request-value overrides for one named API environment. */
1725
+ export interface AuthenticationEnvironment {
1726
+ oauth_application?: string | null;
1727
+ scopes?: string[] | null;
1728
+ audience?: string | null;
1729
+ /** Format: uri */
1730
+ resource?: string | null;
1731
+ }
1732
+ /**
1733
+ * 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
1735
+ * one run. Runtime credentials and client secrets are never accepted.
1736
+ */
1737
+ export interface AuthenticationConfig {
1738
+ oauth_server?: OAuthServer | null;
1739
+ /** OAuth applications keyed by a stable name. */
1740
+ oauth_applications?: Record<string, OAuthApplication> | null;
1741
+ /** Default OAuth application used by generated products. */
1742
+ oauth_application?: string | null;
1743
+ identity_verification?: IdentityVerification | null;
1744
+ /**
1745
+ * Base URL of a custom browser-approval backend implementing the start, status, and revoke
1746
+ * contract. Used only when OAuth is not configured.
1747
+ * Format: uri
1748
+ */
1749
+ approval_url?: string | null;
1750
+ /** Authentication selections keyed by generated API environment name. */
1751
+ environments?: Record<string, AuthenticationEnvironment> | null;
1752
+ }
1753
+ export interface TargetAuthenticationEnvironment {
1754
+ oauth_application?: string | null;
1755
+ }
1756
+ /**
1757
+ * Selects a Project OAuth application for one Target. OAuth server metadata, applications, and
1758
+ * identity policy remain Project-owned.
1759
+ */
1760
+ export interface TargetAuthenticationConfig {
1761
+ /** Project OAuth application to use. Omit to inherit the Project default. */
1762
+ oauth_application?: string | null;
1763
+ /** Project OAuth application selections keyed by API environment. */
1764
+ environments?: Record<string, TargetAuthenticationEnvironment> | null;
1765
+ }
1766
+ /** How the generated CLI behaves. Part of Config. */
1767
+ export interface CliBehavior {
1768
+ /** Command users run, independent of how the CLI is distributed. */
1769
+ command_name?: string | null;
1472
1770
  /**
1473
1771
  * Opt in to a once-a-day registry check that prints an upgrade hint. Off by default; generated
1474
1772
  * code phones nobody unless this is enabled.
@@ -1479,11 +1777,6 @@ export interface CliBehavior {
1479
1777
  * title and environment details.
1480
1778
  */
1481
1779
  support_url?: string | null;
1482
- /**
1483
- * Base URL of the browser-approval endpoint pair used by CLI login. The CLI keeps the verifier
1484
- * and receives the credential directly; no key is pasted through a conversation.
1485
- */
1486
- auth_url?: string | null;
1487
1780
  /**
1488
1781
  * Hosted MCP endpoint installed by the generated CLI instead of launching the package's local
1489
1782
  * stdio server.
@@ -1492,10 +1785,34 @@ export interface CliBehavior {
1492
1785
  /** GitHub owner/name of the skills package the generated CLI offers to install during init. */
1493
1786
  skills_repo?: string | null;
1494
1787
  }
1495
- /** How the generated MCP server and the hosted endpoint behave. Part of Config. */
1788
+ /** How generated MCP servers and the Typeship-hosted endpoint behave. Part of Config. */
1496
1789
  export interface McpBehavior {
1497
1790
  /** Stable official MCP registry name, independent of the server runtime. */
1498
1791
  registry_name?: string | null;
1792
+ /**
1793
+ * Authorization for callers connecting to a generated MCP server deployed over HTTP. The hosting
1794
+ * application resolves upstream API credentials separately at runtime. This setting does not
1795
+ * apply to the Typeship-hosted endpoint.
1796
+ */
1797
+ access?: {
1798
+ /**
1799
+ * Exact issuer allowed to sign MCP connection tokens.
1800
+ * Format: uri
1801
+ */
1802
+ issuer: string;
1803
+ /**
1804
+ * Canonical public URL of the self-hosted MCP endpoint that connection tokens must target.
1805
+ * Format: uri
1806
+ */
1807
+ resource: string;
1808
+ /**
1809
+ * Public signing-key endpoint. Omit to discover it from the issuer.
1810
+ * Format: uri
1811
+ */
1812
+ jwks_url?: string;
1813
+ /** Minimum scopes required to connect to the self-hosted MCP server. */
1814
+ scopes?: string[];
1815
+ };
1499
1816
  /**
1500
1817
  * MCP tool shape. meta collapses per-operation tools into search_docs, read_docs, and execute so
1501
1818
  * large APIs don't flood an agent's context window. Auto considers the serialized tool schemas,
@@ -1515,11 +1832,48 @@ export interface McpBehavior {
1515
1832
  * match no operation are reported as generation warnings.
1516
1833
  */
1517
1834
  tool_descriptions?: Record<string, string>;
1835
+ /**
1836
+ * Exact name-or-ID resolver overrides keyed first by the target operationId or "METHOD /path",
1837
+ * then by its wire argument name. A resolver names one read collection operation plus 1-4 item
1838
+ * fields to match case-insensitively; false opts that argument out of strict inference.
1839
+ */
1840
+ reference_resolvers?: Record<string, Record<string, false | {
1841
+ /** OperationId, "METHOD /path", MCP tool name, or dotted resource.method of the list operation. */
1842
+ via: string;
1843
+ /** Item fields compared exactly and case-insensitively, such as name, slug, key, or email. */
1844
+ match: string[];
1845
+ /** Item field substituted into the requested argument. Defaults to id. */
1846
+ id?: string;
1847
+ }>>;
1518
1848
  }
1519
1849
  /** Response shape for McpBehavior. */
1520
1850
  export interface McpBehaviorRead {
1521
1851
  /** Stable official MCP registry name, independent of the server runtime. */
1522
1852
  registry_name?: string | null;
1853
+ /**
1854
+ * Authorization for callers connecting to a generated MCP server deployed over HTTP. The hosting
1855
+ * application resolves upstream API credentials separately at runtime. This setting does not
1856
+ * apply to the Typeship-hosted endpoint.
1857
+ */
1858
+ access?: {
1859
+ /**
1860
+ * Exact issuer allowed to sign MCP connection tokens.
1861
+ * Format: uri
1862
+ */
1863
+ issuer: string;
1864
+ /**
1865
+ * Canonical public URL of the self-hosted MCP endpoint that connection tokens must target.
1866
+ * Format: uri
1867
+ */
1868
+ resource: string;
1869
+ /**
1870
+ * Public signing-key endpoint. Omit to discover it from the issuer.
1871
+ * Format: uri
1872
+ */
1873
+ jwks_url?: string;
1874
+ /** Minimum scopes required to connect to the self-hosted MCP server. */
1875
+ scopes?: string[];
1876
+ };
1523
1877
  /**
1524
1878
  * MCP tool shape. meta collapses per-operation tools into search_docs, read_docs, and execute so
1525
1879
  * large APIs don't flood an agent's context window. Auto considers the serialized tool schemas,
@@ -1539,6 +1893,28 @@ export interface McpBehaviorRead {
1539
1893
  * match no operation are reported as generation warnings.
1540
1894
  */
1541
1895
  tool_descriptions?: Record<string, string>;
1896
+ /**
1897
+ * Exact name-or-ID resolver overrides keyed first by the target operationId or "METHOD /path",
1898
+ * then by its wire argument name. A resolver names one read collection operation plus 1-4 item
1899
+ * fields to match case-insensitively; false opts that argument out of strict inference.
1900
+ */
1901
+ reference_resolvers?: Record<string, Record<string, false | (string & {}) | {
1902
+ /** OperationId, "METHOD /path", MCP tool name, or dotted resource.method of the list operation. */
1903
+ via: string;
1904
+ /** Item fields compared exactly and case-insensitively, such as name, slug, key, or email. */
1905
+ match: string[];
1906
+ /** Item field substituted into the requested argument. Defaults to id. */
1907
+ id?: string;
1908
+ }>>;
1909
+ }
1910
+ /** Generated README behavior. Part of Config. */
1911
+ export interface ReadmeBehavior {
1912
+ /**
1913
+ * operationId or "METHOD /path" to feature as the README's first API call. It must be present in
1914
+ * the generated package and callable with no required input beyond path placeholders. Missing or
1915
+ * unsuitable choices produce a warning and use the automatic example.
1916
+ */
1917
+ quickstart_operation?: string | null;
1542
1918
  }
1543
1919
  /**
1544
1920
  * Published-package metadata the API spec does not own. Repository is derived from each
@@ -1561,7 +1937,7 @@ export interface PackageBehavior {
1561
1937
  }
1562
1938
  /**
1563
1939
  * Everything Typeship needs beyond the Definition, in one object: generation customization
1564
- * (globals, retries, pagination) and how the generated tooling behaves (cli, mcp, package,
1940
+ * (globals, retries, pagination, readme) and how the generated tooling behaves (cli, mcp, package,
1565
1941
  * docs_url). Plain configuration. Typeship never requires vendor extensions inside the Definition
1566
1942
  * itself. Stateless generation also accepts GraphQL settings here; stored projects keep those
1567
1943
  * settings on their Definition.
@@ -1580,8 +1956,10 @@ export interface Config {
1580
1956
  */
1581
1957
  pagination?: Record<string, PaginationRule | boolean>;
1582
1958
  graphql?: GraphqlSettings;
1959
+ auth?: AuthenticationConfig;
1583
1960
  cli?: CliBehavior;
1584
1961
  mcp?: McpBehavior;
1962
+ readme?: ReadmeBehavior;
1585
1963
  package?: PackageBehavior;
1586
1964
  /**
1587
1965
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
@@ -1610,8 +1988,10 @@ export interface ConfigRead {
1610
1988
  */
1611
1989
  pagination?: Record<string, PaginationRuleRead | boolean>;
1612
1990
  graphql?: GraphqlSettingsRead;
1991
+ auth?: AuthenticationConfig;
1613
1992
  cli?: CliBehavior;
1614
1993
  mcp?: McpBehaviorRead;
1994
+ readme?: ReadmeBehavior;
1615
1995
  package?: PackageBehavior;
1616
1996
  /**
1617
1997
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
@@ -1628,8 +2008,8 @@ export interface ConfigRead {
1628
2008
  /**
1629
2009
  * Shared generated-client and tooling behavior for a stored Project. Every Target inherits these
1630
2010
  * defaults. Target.config is merged over them for one Target; top-level values replace defaults
1631
- * while cli, mcp, and package merge by field. GraphQL-only source settings live on the Project's
1632
- * Definition and are rejected in both stored config scopes.
2011
+ * while cli, mcp, auth, readme, and package merge by field. GraphQL-only source settings live on
2012
+ * the Project's Definition and are rejected in both stored config scopes.
1633
2013
  */
1634
2014
  export interface ProjectConfig {
1635
2015
  /**
@@ -1644,8 +2024,10 @@ export interface ProjectConfig {
1644
2024
  * reported as generation warnings.
1645
2025
  */
1646
2026
  pagination?: Record<string, PaginationRule | boolean>;
2027
+ auth?: AuthenticationConfig;
1647
2028
  cli?: CliBehavior;
1648
2029
  mcp?: McpBehavior;
2030
+ readme?: ReadmeBehavior;
1649
2031
  package?: PackageBehavior;
1650
2032
  /**
1651
2033
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
@@ -1673,8 +2055,10 @@ export interface ProjectConfigRead {
1673
2055
  * reported as generation warnings.
1674
2056
  */
1675
2057
  pagination?: Record<string, PaginationRuleRead | boolean>;
2058
+ auth?: AuthenticationConfig;
1676
2059
  cli?: CliBehavior;
1677
2060
  mcp?: McpBehaviorRead;
2061
+ readme?: ReadmeBehavior;
1678
2062
  package?: PackageBehavior;
1679
2063
  /**
1680
2064
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
@@ -1688,6 +2072,40 @@ export interface ProjectConfigRead {
1688
2072
  */
1689
2073
  docs_index_url?: string | null;
1690
2074
  }
2075
+ /**
2076
+ * Target-specific generation and delivery overrides. Authentication may only select a Project-owned
2077
+ * OAuth application. OAuth server metadata, applications, and identity policy remain Project-owned.
2078
+ * Self-hosted MCP access may be overridden for a Target-specific deployment.
2079
+ */
2080
+ export interface TargetConfig {
2081
+ globals?: string[];
2082
+ retries?: RetryTuning;
2083
+ pagination?: Record<string, PaginationRule | boolean>;
2084
+ auth?: TargetAuthenticationConfig;
2085
+ cli?: CliBehavior;
2086
+ mcp?: McpBehavior;
2087
+ readme?: ReadmeBehavior;
2088
+ package?: PackageBehavior;
2089
+ /** Format: uri */
2090
+ docs_url?: string | null;
2091
+ /** Format: uri */
2092
+ docs_index_url?: string | null;
2093
+ }
2094
+ /** Response shape for TargetConfig. */
2095
+ export interface TargetConfigRead {
2096
+ globals?: string[];
2097
+ retries?: RetryTuning;
2098
+ pagination?: Record<string, PaginationRuleRead | boolean>;
2099
+ auth?: TargetAuthenticationConfig;
2100
+ cli?: CliBehavior;
2101
+ mcp?: McpBehaviorRead;
2102
+ readme?: ReadmeBehavior;
2103
+ package?: PackageBehavior;
2104
+ /** Format: uri */
2105
+ docs_url?: string | null;
2106
+ /** Format: uri */
2107
+ docs_index_url?: string | null;
2108
+ }
1691
2109
  /** What a GraphQL schema cannot say about itself. Ignored for OpenAPI specs. */
1692
2110
  export interface GraphqlSettings {
1693
2111
  /**
@@ -1815,6 +2233,35 @@ export interface FileStub {
1815
2233
  path: string;
1816
2234
  bytes: number;
1817
2235
  }
2236
+ export declare const GenerationStatus: {
2237
+ readonly SUCCEEDED: "succeeded";
2238
+ readonly FAILED: "failed";
2239
+ };
2240
+ export type GenerationStatus = (typeof GenerationStatus)[keyof typeof GenerationStatus];
2241
+ export declare const GenerationTrigger: {
2242
+ readonly MANUAL: "manual";
2243
+ readonly WEBHOOK: "webhook";
2244
+ readonly POLL: "poll";
2245
+ readonly PREVIEW: "preview";
2246
+ };
2247
+ export type GenerationTrigger = (typeof GenerationTrigger)[keyof typeof GenerationTrigger];
2248
+ export interface GenerationProvenance {
2249
+ /** Pinned generator contract edition. */
2250
+ 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;
2263
+ package_version: string | null;
2264
+ }
1818
2265
  export interface Generation {
1819
2266
  id: GenerationId;
1820
2267
  object: "generation";
@@ -1826,29 +2273,13 @@ export interface Generation {
1826
2273
  files_index?: FileStub[];
1827
2274
  project_id: ProjectId;
1828
2275
  definition_revision_id: DefinitionRevisionId | null;
1829
- status: "succeeded" | "failed";
1830
- trigger: "manual" | "webhook" | "poll" | "preview";
2276
+ status: GenerationStatus;
2277
+ trigger: GenerationTrigger;
1831
2278
  /** Persisted Target identity. Null only for stateless generation. */
1832
2279
  target_id: TargetId | null;
1833
2280
  /** Resolved generator implementation; provenance rather than resource identity. */
1834
2281
  generator: GeneratorKind;
1835
- provenance: {
1836
- /** Pinned generator contract edition. */
1837
- generator_edition: string;
1838
- /** Exact engine build identifier used for replay and support. */
1839
- engine_build: string;
1840
- /**
1841
- * Immutable effective Target configuration used by this run; source credentials are never
1842
- * included.
1843
- */
1844
- resolved_config: Record<string, unknown> | null;
1845
- config_hash: string | null;
1846
- /** Resolved generator and entitlement plan used to select the emitted public surface. */
1847
- surface_plan: Record<string, unknown> | null;
1848
- surface_plan_hash: string | null;
1849
- entitlement_cap: number | null;
1850
- package_version: string | null;
1851
- };
2282
+ provenance: GenerationProvenance;
1852
2283
  /** Null only for a failed or legacy generation that produced no metadata. */
1853
2284
  meta: GenerationMeta | null;
1854
2285
  warnings: string[];
@@ -1870,29 +2301,13 @@ export interface GenerationWrite {
1870
2301
  files_index?: FileStub[];
1871
2302
  project_id: ProjectId;
1872
2303
  definition_revision_id: DefinitionRevisionId | null;
1873
- status: "succeeded" | "failed";
1874
- trigger: "manual" | "webhook" | "poll" | "preview";
2304
+ status: GenerationStatus;
2305
+ trigger: GenerationTrigger;
1875
2306
  /** Persisted Target identity. Null only for stateless generation. */
1876
2307
  target_id: TargetId | null;
1877
2308
  /** Resolved generator implementation; provenance rather than resource identity. */
1878
2309
  generator: GeneratorKind;
1879
- provenance: {
1880
- /** Pinned generator contract edition. */
1881
- generator_edition: string;
1882
- /** Exact engine build identifier used for replay and support. */
1883
- engine_build: string;
1884
- /**
1885
- * Immutable effective Target configuration used by this run; source credentials are never
1886
- * included.
1887
- */
1888
- resolved_config: Record<string, unknown> | null;
1889
- config_hash: string | null;
1890
- /** Resolved generator and entitlement plan used to select the emitted public surface. */
1891
- surface_plan: Record<string, unknown> | null;
1892
- surface_plan_hash: string | null;
1893
- entitlement_cap: number | null;
1894
- package_version: string | null;
1895
- };
2310
+ provenance: GenerationProvenance;
1896
2311
  /** Null only for a failed or legacy generation that produced no metadata. */
1897
2312
  meta: GenerationMeta | null;
1898
2313
  warnings: string[];
@@ -1915,29 +2330,13 @@ export interface GenerationRead {
1915
2330
  files_index?: FileStub[];
1916
2331
  project_id: ProjectId;
1917
2332
  definition_revision_id: DefinitionRevisionId | null;
1918
- status: ("succeeded" | "failed") | (string & {});
1919
- trigger: ("manual" | "webhook" | "poll" | "preview") | (string & {});
2333
+ status: GenerationStatus | (string & {});
2334
+ trigger: GenerationTrigger | (string & {});
1920
2335
  /** Persisted Target identity. Null only for stateless generation. */
1921
2336
  target_id: TargetId | null;
1922
2337
  /** Resolved generator implementation; provenance rather than resource identity. */
1923
2338
  generator: GeneratorKind | (string & {});
1924
- provenance: {
1925
- /** Pinned generator contract edition. */
1926
- generator_edition: string;
1927
- /** Exact engine build identifier used for replay and support. */
1928
- engine_build: string;
1929
- /**
1930
- * Immutable effective Target configuration used by this run; source credentials are never
1931
- * included.
1932
- */
1933
- resolved_config: Record<string, unknown> | null;
1934
- config_hash: string | null;
1935
- /** Resolved generator and entitlement plan used to select the emitted public surface. */
1936
- surface_plan: Record<string, unknown> | null;
1937
- surface_plan_hash: string | null;
1938
- entitlement_cap: number | null;
1939
- package_version: string | null;
1940
- };
2339
+ provenance: GenerationProvenance;
1941
2340
  /** Null only for a failed or legacy generation that produced no metadata. */
1942
2341
  meta: GenerationMetaRead | null;
1943
2342
  warnings: string[];
@@ -1948,6 +2347,68 @@ export interface GenerationRead {
1948
2347
  created_at: string;
1949
2348
  request_id?: RequestId;
1950
2349
  }
2350
+ /**
2351
+ * Generation metadata returned by collection endpoints. Generated file contents and file indexes
2352
+ * are available only from retrieve and create operations.
2353
+ */
2354
+ export interface GenerationSummary {
2355
+ id: GenerationId;
2356
+ object: "generation";
2357
+ project_id: ProjectId;
2358
+ definition_revision_id: DefinitionRevisionId | null;
2359
+ status: GenerationStatus;
2360
+ trigger: GenerationTrigger;
2361
+ /** Persisted Target identity. Null only for stateless generation. */
2362
+ target_id: TargetId | null;
2363
+ /** Resolved generator implementation; provenance rather than resource identity. */
2364
+ generator: GeneratorKind;
2365
+ provenance: GenerationProvenance;
2366
+ /** Null only for a failed or legacy generation that produced no metadata. */
2367
+ meta: GenerationMeta | null;
2368
+ warnings: string[];
2369
+ error: string | null;
2370
+ /** Format: date-time */
2371
+ created_at: string;
2372
+ }
2373
+ /** Request shape for GenerationSummary. */
2374
+ export interface GenerationSummaryWrite {
2375
+ id: GenerationId;
2376
+ project_id: ProjectId;
2377
+ definition_revision_id: DefinitionRevisionId | null;
2378
+ status: GenerationStatus;
2379
+ trigger: GenerationTrigger;
2380
+ /** Persisted Target identity. Null only for stateless generation. */
2381
+ target_id: TargetId | null;
2382
+ /** Resolved generator implementation; provenance rather than resource identity. */
2383
+ generator: GeneratorKind;
2384
+ provenance: GenerationProvenance;
2385
+ /** Null only for a failed or legacy generation that produced no metadata. */
2386
+ meta: GenerationMeta | null;
2387
+ warnings: string[];
2388
+ error: string | null;
2389
+ /** Format: date-time */
2390
+ created_at: string;
2391
+ }
2392
+ /** Response shape for GenerationSummary. */
2393
+ export interface GenerationSummaryRead {
2394
+ id: GenerationId;
2395
+ object: "generation" | (string & {});
2396
+ project_id: ProjectId;
2397
+ definition_revision_id: DefinitionRevisionId | null;
2398
+ status: GenerationStatus | (string & {});
2399
+ trigger: GenerationTrigger | (string & {});
2400
+ /** Persisted Target identity. Null only for stateless generation. */
2401
+ target_id: TargetId | null;
2402
+ /** Resolved generator implementation; provenance rather than resource identity. */
2403
+ generator: GeneratorKind | (string & {});
2404
+ provenance: GenerationProvenance;
2405
+ /** Null only for a failed or legacy generation that produced no metadata. */
2406
+ meta: GenerationMetaRead | null;
2407
+ warnings: string[];
2408
+ error: string | null;
2409
+ /** Format: date-time */
2410
+ created_at: string;
2411
+ }
1951
2412
  export type GenerationResponse = Generation & ResponseMetadata;
1952
2413
  /** Request shape for GenerationResponse. */
1953
2414
  export type GenerationResponseWrite = GenerationWrite & ResponseMetadata;
@@ -1967,18 +2428,22 @@ export interface GenerationFailureRead {
1967
2428
  status: "failed" | (string & {});
1968
2429
  error: string;
1969
2430
  }
2431
+ /**
2432
+ * Metadata for each Target generation attempted by a Project run. Retrieve one Generation
2433
+ * separately for generated files.
2434
+ */
1970
2435
  export interface GenerationBatch {
1971
- data: Array<Generation | GenerationFailure>;
2436
+ data: Array<GenerationSummary | GenerationFailure>;
1972
2437
  request_id: RequestId;
1973
2438
  }
1974
2439
  /** Request shape for GenerationBatch. */
1975
2440
  export interface GenerationBatchWrite {
1976
- data: Array<GenerationWrite | GenerationFailure>;
2441
+ data: Array<GenerationSummaryWrite | GenerationFailure>;
1977
2442
  request_id: RequestId;
1978
2443
  }
1979
2444
  /** Response shape for GenerationBatch. */
1980
2445
  export interface GenerationBatchRead {
1981
- data: Array<GenerationRead | GenerationFailureRead>;
2446
+ data: Array<GenerationSummaryRead | GenerationFailureRead>;
1982
2447
  request_id: RequestId;
1983
2448
  }
1984
2449
  export interface ApiKey {
@@ -2128,7 +2593,7 @@ export interface ProjectListRead {
2128
2593
  }
2129
2594
  export interface GenerationList {
2130
2595
  object: ListObject;
2131
- data: Generation[];
2596
+ data: GenerationSummary[];
2132
2597
  /** Whether another page is available after this one. */
2133
2598
  has_more: boolean;
2134
2599
  /** Pass this value as cursor to retrieve the next page; null on the last page. */
@@ -2138,7 +2603,7 @@ export interface GenerationList {
2138
2603
  /** Request shape for GenerationList. */
2139
2604
  export interface GenerationListWrite {
2140
2605
  object: ListObject;
2141
- data: GenerationWrite[];
2606
+ data: GenerationSummaryWrite[];
2142
2607
  /** Whether another page is available after this one. */
2143
2608
  has_more: boolean;
2144
2609
  /** Pass this value as cursor to retrieve the next page; null on the last page. */
@@ -2148,7 +2613,7 @@ export interface GenerationListWrite {
2148
2613
  /** Response shape for GenerationList. */
2149
2614
  export interface GenerationListRead {
2150
2615
  object: ListObject;
2151
- data: GenerationRead[];
2616
+ data: GenerationSummaryRead[];
2152
2617
  /** Whether another page is available after this one. */
2153
2618
  has_more: boolean;
2154
2619
  /** Pass this value as cursor to retrieve the next page; null on the last page. */
@@ -2243,6 +2708,20 @@ export declare const ErrorCode: {
2243
2708
  readonly FETCH_ERROR: "fetch_error";
2244
2709
  readonly REPOSITORY_PROVIDER_UNSUPPORTED: "repository_provider_unsupported";
2245
2710
  readonly EDITION_UNAVAILABLE: "edition_unavailable";
2711
+ readonly TARGET_BUSY: "target_busy";
2712
+ readonly INVALID_VERSION: "invalid_version";
2713
+ readonly STALE_RELEASE_REVISION: "stale_release_revision";
2714
+ readonly VERSION_OCCUPIED: "version_occupied";
2715
+ readonly VERSION_TOO_LOW: "version_too_low";
2716
+ readonly RELEASE_ANALYSIS_STALE: "release_analysis_stale";
2717
+ readonly TARGET_ALREADY_RELEASED: "target_already_released";
2718
+ readonly ADOPTION_UNVERIFIED: "adoption_unverified";
2719
+ readonly PUBLICATION_DISABLED: "publication_disabled";
2720
+ readonly PUBLICATION_NOT_RETRYABLE: "publication_not_retryable";
2721
+ readonly PUBLICATION_RECOVERY_UNAVAILABLE: "publication_recovery_unavailable";
2722
+ readonly PUBLICATION_DISPATCH_FAILED: "publication_dispatch_failed";
2723
+ readonly REPOSITORY_DISCONNECTED: "repository_disconnected";
2724
+ readonly REGENERATION_FAILED: "regeneration_failed";
2246
2725
  readonly DELIVERY_CONFLICT: "delivery_conflict";
2247
2726
  readonly RESOURCE_HAS_DEPENDENCIES: "resource_has_dependencies";
2248
2727
  readonly PLAN_LIMIT_REACHED: "plan_limit_reached";