@typeship-ax/mcp 0.8.0 → 0.9.1

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 +1617 -712
  4. package/api.md +8292 -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 +30 -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 +20 -9
  69. package/dist/resources/targets.d.ts.map +1 -1
  70. package/dist/resources/targets.js +14 -1
  71. package/dist/schemas.d.ts.map +1 -1
  72. package/dist/schemas.js +38 -22
  73. package/dist/types.d.ts +385 -119
  74. package/dist/types.d.ts.map +1 -1
  75. package/dist/types.js +11 -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 +44 -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 +32 -0
  101. package/src/schemas.ts +38 -22
  102. package/src/types.ts +404 -119
  103. package/src/worker.ts +4 -4
package/dist/types.d.ts CHANGED
@@ -849,7 +849,7 @@ export interface TargetFields {
849
849
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
850
850
  * belong to the Definition.
851
851
  */
852
- config?: ProjectConfig | null;
852
+ config?: TargetConfig | null;
853
853
  deliveries?: DeliveryInput[];
854
854
  }
855
855
  /** Response shape for TargetFields. */
@@ -869,7 +869,7 @@ export interface TargetFieldsRead {
869
869
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
870
870
  * belong to the Definition.
871
871
  */
872
- config?: ProjectConfigRead | null;
872
+ config?: TargetConfigRead | null;
873
873
  deliveries?: DeliveryInputRead[];
874
874
  }
875
875
  export interface InitialTargetFields {
@@ -886,7 +886,7 @@ export interface InitialTargetFields {
886
886
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
887
887
  * belong to the Definition.
888
888
  */
889
- config?: ProjectConfig | null;
889
+ config?: TargetConfig | null;
890
890
  deliveries?: DeliveryInput[];
891
891
  }
892
892
  /** Response shape for InitialTargetFields. */
@@ -904,7 +904,7 @@ export interface InitialTargetFieldsRead {
904
904
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
905
905
  * belong to the Definition.
906
906
  */
907
- config?: ProjectConfigRead | null;
907
+ config?: TargetConfigRead | null;
908
908
  deliveries?: DeliveryInputRead[];
909
909
  }
910
910
  export interface TargetUpdateRequest {
@@ -917,7 +917,7 @@ export interface TargetUpdateRequest {
917
917
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
918
918
  * belong to the Definition.
919
919
  */
920
- config?: ProjectConfig | null;
920
+ config?: TargetConfig | null;
921
921
  deliveries?: DeliveryInput[];
922
922
  }
923
923
  /** Response shape for TargetUpdateRequest. */
@@ -931,7 +931,7 @@ export interface TargetUpdateRequestRead {
931
931
  * Target-specific overrides merged over Project.config. GraphQL settings are rejected here and
932
932
  * belong to the Definition.
933
933
  */
934
- config?: ProjectConfigRead | null;
934
+ config?: TargetConfigRead | null;
935
935
  deliveries?: DeliveryInputRead[];
936
936
  }
937
937
  export interface Target {
@@ -954,7 +954,8 @@ export interface Target {
954
954
  * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
955
955
  * never appear here.
956
956
  */
957
- config: ProjectConfig | null;
957
+ config: TargetConfig | null;
958
+ /** At most one repository and one hosted MCP Delivery. */
958
959
  deliveries: Delivery[];
959
960
  /** Format: date-time */
960
961
  created_at: string;
@@ -983,7 +984,8 @@ export interface TargetRead {
983
984
  * Target-specific overrides merged over Project.config. GraphQL settings are Definition-owned and
984
985
  * never appear here.
985
986
  */
986
- config: ProjectConfigRead | null;
987
+ config: TargetConfigRead | null;
988
+ /** At most one repository and one hosted MCP Delivery. */
987
989
  deliveries: DeliveryRead[];
988
990
  /** Format: date-time */
989
991
  created_at: string;
@@ -1226,18 +1228,15 @@ export interface DefinitionUpdateRequestRead {
1226
1228
  graphql?: GraphqlSettingsRead | null;
1227
1229
  diagnostic_policy?: DiagnosticPolicyRead;
1228
1230
  }
1231
+ /**
1232
+ * Project-owned identity, Definition reference, generation controls, and shared configuration.
1233
+ * Targets and Deliveries are available only through their canonical Target endpoints.
1234
+ */
1229
1235
  export interface Project {
1230
1236
  id: ProjectId;
1231
1237
  object: "project";
1232
1238
  name: string;
1233
1239
  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
1240
  /**
1242
1241
  * Regenerate when the Definition changes: on every push to the default branch for a repository
1243
1242
  * source, every 30 minutes for a URL source. Off by default: the first generation is always one
@@ -1268,13 +1267,6 @@ export interface Project {
1268
1267
  export interface ProjectWrite {
1269
1268
  name: string;
1270
1269
  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
1270
  /**
1279
1271
  * Regenerate when the Definition changes: on every push to the default branch for a repository
1280
1272
  * source, every 30 minutes for a URL source. Off by default: the first generation is always one
@@ -1300,13 +1292,6 @@ export interface ProjectRead {
1300
1292
  object: "project" | (string & {});
1301
1293
  name: string;
1302
1294
  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
1295
  /**
1311
1296
  * Regenerate when the Definition changes: on every push to the default branch for a repository
1312
1297
  * source, every 30 minutes for a URL source. Off by default: the first generation is always one
@@ -1334,8 +1319,8 @@ export interface ProjectRead {
1334
1319
  request_id: RequestId;
1335
1320
  }
1336
1321
  /**
1337
- * Lean Project identity returned by collection endpoints. Retrieve the Project or list its Targets
1338
- * for the complete aggregate.
1322
+ * Lean Project identity returned by collection endpoints. Retrieve the Project for shared
1323
+ * configuration and list its Targets for the complete canonical child collection.
1339
1324
  */
1340
1325
  export interface ProjectSummary {
1341
1326
  id: ProjectId;
@@ -1445,30 +1430,143 @@ export interface AccountRead {
1445
1430
  created_at: string;
1446
1431
  request_id: RequestId;
1447
1432
  }
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;
1433
+ /**
1434
+ * Authorization-server metadata used by generated OAuth flows. Secrets and runtime credentials are
1435
+ * never accepted here.
1436
+ */
1437
+ export interface OAuthServer {
1452
1438
  /**
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.
1439
+ * Exact authorization-server issuer, including any tenant path.
1440
+ * Format: uri
1455
1441
  */
1456
- whoami_operation?: string | null;
1442
+ issuer?: string | null;
1457
1443
  /**
1458
- * OAuth client id baked into the generated CLI for device-flow login. Without it, login prompts
1459
- * for a pasted credential.
1444
+ * Exact metadata URL when it cannot be derived from the issuer.
1445
+ * Format: uri
1446
+ */
1447
+ discovery_url?: string | null;
1448
+ /**
1449
+ * Authorization endpoint override.
1450
+ * Format: uri
1451
+ */
1452
+ authorization_url?: string | null;
1453
+ /**
1454
+ * Token endpoint override.
1455
+ * Format: uri
1460
1456
  */
1461
- oauth_client_id?: string | null;
1457
+ token_url?: string | null;
1462
1458
  /**
1463
- * Scopes requested during device-flow login. Include offline_access if the authorization server
1464
- * gates refresh tokens behind it.
1459
+ * Device-authorization endpoint override.
1460
+ * Format: uri
1465
1461
  */
1466
- oauth_scopes?: string[];
1462
+ device_authorization_url?: string | null;
1463
+ /** Default scopes requested during login. */
1464
+ scopes?: string[] | null;
1465
+ /** Default audience included in authorization and token requests. */
1466
+ audience?: string | null;
1467
1467
  /**
1468
- * Audience sent with the device-authorization request, for authorization servers that require one
1469
- * to issue API-valid access tokens.
1468
+ * Protected API resource included in authorization and token requests.
1469
+ * Format: uri
1470
1470
  */
1471
- oauth_audience?: string | null;
1471
+ resource?: string | null;
1472
+ }
1473
+ /**
1474
+ * OAuth application available to generated products. Public clients support interactive login;
1475
+ * confidential clients support runtime-supplied machine credentials. Client secrets are never
1476
+ * stored.
1477
+ */
1478
+ export interface OAuthApplication {
1479
+ /** OAuth client identifier. */
1480
+ client_id: string;
1481
+ /** Interactive login method. Browser login uses Authorization Code with PKCE. */
1482
+ login_method?: "browser" | "device" | null;
1483
+ /** How a runtime-supplied client secret is sent for machine grants. */
1484
+ client_auth_method?: "post" | "basic" | null;
1485
+ /**
1486
+ * Loopback callback URL for browser login.
1487
+ * Format: uri
1488
+ */
1489
+ redirect_uri?: string | null;
1490
+ /** Provider parameter used to request an organization during browser login. */
1491
+ organization_parameter?: "organization" | "organization_id" | null;
1492
+ }
1493
+ /** Response shape for OAuthApplication. */
1494
+ export interface OAuthApplicationRead {
1495
+ /** OAuth client identifier. */
1496
+ client_id: string;
1497
+ /** Interactive login method. Browser login uses Authorization Code with PKCE. */
1498
+ login_method?: ("browser" | "device" | null) | (string & {}) | null;
1499
+ /** How a runtime-supplied client secret is sent for machine grants. */
1500
+ client_auth_method?: ("post" | "basic" | null) | (string & {}) | null;
1501
+ /**
1502
+ * Loopback callback URL for browser login.
1503
+ * Format: uri
1504
+ */
1505
+ redirect_uri?: string | null;
1506
+ /** Provider parameter used to request an organization during browser login. */
1507
+ organization_parameter?: ("organization" | "organization_id" | null) | (string & {}) | null;
1508
+ }
1509
+ /**
1510
+ * Authenticated identity read used to verify a login before it is saved. Operation is auto-detected
1511
+ * when omitted. Requests must include at least one of subject_field, account_field, or
1512
+ * organization_field.
1513
+ */
1514
+ export interface IdentityVerification {
1515
+ /** resource.method of a safe identity read with no required arguments. */
1516
+ operation?: string;
1517
+ /** JSON Pointer to the stable caller ID in the identity response. */
1518
+ subject_field?: string;
1519
+ /** JSON Pointer to the customer account ID. */
1520
+ account_field?: string;
1521
+ /** JSON Pointer to the customer organization ID. */
1522
+ organization_field?: string;
1523
+ }
1524
+ /** OAuth application and request-value overrides for one named API environment. */
1525
+ export interface AuthenticationEnvironment {
1526
+ oauth_application?: string | null;
1527
+ scopes?: string[] | null;
1528
+ audience?: string | null;
1529
+ /** Format: uri */
1530
+ resource?: string | null;
1531
+ }
1532
+ /**
1533
+ * Public authentication defaults for generated clients and tools. Stored Projects own the OAuth
1534
+ * server, application catalog, and identity policy; stateless generation accepts the same shape for
1535
+ * one run. Runtime credentials and client secrets are never accepted.
1536
+ */
1537
+ export interface AuthenticationConfig {
1538
+ oauth_server?: OAuthServer | null;
1539
+ /** OAuth applications keyed by a stable name. */
1540
+ oauth_applications?: Record<string, OAuthApplication> | null;
1541
+ /** Default OAuth application used by generated products. */
1542
+ oauth_application?: string | null;
1543
+ identity_verification?: IdentityVerification | null;
1544
+ /**
1545
+ * Base URL of a custom browser-approval backend implementing the start, status, and revoke
1546
+ * contract. Used only when OAuth is not configured.
1547
+ * Format: uri
1548
+ */
1549
+ approval_url?: string | null;
1550
+ /** Authentication selections keyed by generated API environment name. */
1551
+ environments?: Record<string, AuthenticationEnvironment> | null;
1552
+ }
1553
+ export interface TargetAuthenticationEnvironment {
1554
+ oauth_application?: string | null;
1555
+ }
1556
+ /**
1557
+ * Selects a Project OAuth application for one Target. OAuth server metadata, applications, and
1558
+ * identity policy remain Project-owned.
1559
+ */
1560
+ export interface TargetAuthenticationConfig {
1561
+ /** Project OAuth application to use. Omit to inherit the Project default. */
1562
+ oauth_application?: string | null;
1563
+ /** Project OAuth application selections keyed by API environment. */
1564
+ environments?: Record<string, TargetAuthenticationEnvironment> | null;
1565
+ }
1566
+ /** How the generated CLI behaves. Part of Config. */
1567
+ export interface CliBehavior {
1568
+ /** Command users run, independent of how the CLI is distributed. */
1569
+ command_name?: string | null;
1472
1570
  /**
1473
1571
  * Opt in to a once-a-day registry check that prints an upgrade hint. Off by default; generated
1474
1572
  * code phones nobody unless this is enabled.
@@ -1479,11 +1577,6 @@ export interface CliBehavior {
1479
1577
  * title and environment details.
1480
1578
  */
1481
1579
  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
1580
  /**
1488
1581
  * Hosted MCP endpoint installed by the generated CLI instead of launching the package's local
1489
1582
  * stdio server.
@@ -1492,10 +1585,34 @@ export interface CliBehavior {
1492
1585
  /** GitHub owner/name of the skills package the generated CLI offers to install during init. */
1493
1586
  skills_repo?: string | null;
1494
1587
  }
1495
- /** How the generated MCP server and the hosted endpoint behave. Part of Config. */
1588
+ /** How generated MCP servers and the Typeship-hosted endpoint behave. Part of Config. */
1496
1589
  export interface McpBehavior {
1497
1590
  /** Stable official MCP registry name, independent of the server runtime. */
1498
1591
  registry_name?: string | null;
1592
+ /**
1593
+ * Authorization for callers connecting to a generated MCP server deployed over HTTP. The hosting
1594
+ * application resolves upstream API credentials separately at runtime. This setting does not
1595
+ * apply to the Typeship-hosted endpoint.
1596
+ */
1597
+ access?: {
1598
+ /**
1599
+ * Exact issuer allowed to sign MCP connection tokens.
1600
+ * Format: uri
1601
+ */
1602
+ issuer: string;
1603
+ /**
1604
+ * Canonical public URL of the self-hosted MCP endpoint that connection tokens must target.
1605
+ * Format: uri
1606
+ */
1607
+ resource: string;
1608
+ /**
1609
+ * Public signing-key endpoint. Omit to discover it from the issuer.
1610
+ * Format: uri
1611
+ */
1612
+ jwks_url?: string;
1613
+ /** Minimum scopes required to connect to the self-hosted MCP server. */
1614
+ scopes?: string[];
1615
+ };
1499
1616
  /**
1500
1617
  * MCP tool shape. meta collapses per-operation tools into search_docs, read_docs, and execute so
1501
1618
  * large APIs don't flood an agent's context window. Auto considers the serialized tool schemas,
@@ -1515,11 +1632,48 @@ export interface McpBehavior {
1515
1632
  * match no operation are reported as generation warnings.
1516
1633
  */
1517
1634
  tool_descriptions?: Record<string, string>;
1635
+ /**
1636
+ * Exact name-or-ID resolver overrides keyed first by the target operationId or "METHOD /path",
1637
+ * then by its wire argument name. A resolver names one read collection operation plus 1-4 item
1638
+ * fields to match case-insensitively; false opts that argument out of strict inference.
1639
+ */
1640
+ reference_resolvers?: Record<string, Record<string, false | {
1641
+ /** OperationId, "METHOD /path", MCP tool name, or dotted resource.method of the list operation. */
1642
+ via: string;
1643
+ /** Item fields compared exactly and case-insensitively, such as name, slug, key, or email. */
1644
+ match: string[];
1645
+ /** Item field substituted into the requested argument. Defaults to id. */
1646
+ id?: string;
1647
+ }>>;
1518
1648
  }
1519
1649
  /** Response shape for McpBehavior. */
1520
1650
  export interface McpBehaviorRead {
1521
1651
  /** Stable official MCP registry name, independent of the server runtime. */
1522
1652
  registry_name?: string | null;
1653
+ /**
1654
+ * Authorization for callers connecting to a generated MCP server deployed over HTTP. The hosting
1655
+ * application resolves upstream API credentials separately at runtime. This setting does not
1656
+ * apply to the Typeship-hosted endpoint.
1657
+ */
1658
+ access?: {
1659
+ /**
1660
+ * Exact issuer allowed to sign MCP connection tokens.
1661
+ * Format: uri
1662
+ */
1663
+ issuer: string;
1664
+ /**
1665
+ * Canonical public URL of the self-hosted MCP endpoint that connection tokens must target.
1666
+ * Format: uri
1667
+ */
1668
+ resource: string;
1669
+ /**
1670
+ * Public signing-key endpoint. Omit to discover it from the issuer.
1671
+ * Format: uri
1672
+ */
1673
+ jwks_url?: string;
1674
+ /** Minimum scopes required to connect to the self-hosted MCP server. */
1675
+ scopes?: string[];
1676
+ };
1523
1677
  /**
1524
1678
  * MCP tool shape. meta collapses per-operation tools into search_docs, read_docs, and execute so
1525
1679
  * large APIs don't flood an agent's context window. Auto considers the serialized tool schemas,
@@ -1539,6 +1693,28 @@ export interface McpBehaviorRead {
1539
1693
  * match no operation are reported as generation warnings.
1540
1694
  */
1541
1695
  tool_descriptions?: Record<string, string>;
1696
+ /**
1697
+ * Exact name-or-ID resolver overrides keyed first by the target operationId or "METHOD /path",
1698
+ * then by its wire argument name. A resolver names one read collection operation plus 1-4 item
1699
+ * fields to match case-insensitively; false opts that argument out of strict inference.
1700
+ */
1701
+ reference_resolvers?: Record<string, Record<string, false | (string & {}) | {
1702
+ /** OperationId, "METHOD /path", MCP tool name, or dotted resource.method of the list operation. */
1703
+ via: string;
1704
+ /** Item fields compared exactly and case-insensitively, such as name, slug, key, or email. */
1705
+ match: string[];
1706
+ /** Item field substituted into the requested argument. Defaults to id. */
1707
+ id?: string;
1708
+ }>>;
1709
+ }
1710
+ /** Generated README behavior. Part of Config. */
1711
+ export interface ReadmeBehavior {
1712
+ /**
1713
+ * operationId or "METHOD /path" to feature as the README's first API call. It must be present in
1714
+ * the generated package and callable with no required input beyond path placeholders. Missing or
1715
+ * unsuitable choices produce a warning and use the automatic example.
1716
+ */
1717
+ quickstart_operation?: string | null;
1542
1718
  }
1543
1719
  /**
1544
1720
  * Published-package metadata the API spec does not own. Repository is derived from each
@@ -1561,7 +1737,7 @@ export interface PackageBehavior {
1561
1737
  }
1562
1738
  /**
1563
1739
  * Everything Typeship needs beyond the Definition, in one object: generation customization
1564
- * (globals, retries, pagination) and how the generated tooling behaves (cli, mcp, package,
1740
+ * (globals, retries, pagination, readme) and how the generated tooling behaves (cli, mcp, package,
1565
1741
  * docs_url). Plain configuration. Typeship never requires vendor extensions inside the Definition
1566
1742
  * itself. Stateless generation also accepts GraphQL settings here; stored projects keep those
1567
1743
  * settings on their Definition.
@@ -1580,8 +1756,10 @@ export interface Config {
1580
1756
  */
1581
1757
  pagination?: Record<string, PaginationRule | boolean>;
1582
1758
  graphql?: GraphqlSettings;
1759
+ auth?: AuthenticationConfig;
1583
1760
  cli?: CliBehavior;
1584
1761
  mcp?: McpBehavior;
1762
+ readme?: ReadmeBehavior;
1585
1763
  package?: PackageBehavior;
1586
1764
  /**
1587
1765
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
@@ -1610,8 +1788,10 @@ export interface ConfigRead {
1610
1788
  */
1611
1789
  pagination?: Record<string, PaginationRuleRead | boolean>;
1612
1790
  graphql?: GraphqlSettingsRead;
1791
+ auth?: AuthenticationConfig;
1613
1792
  cli?: CliBehavior;
1614
1793
  mcp?: McpBehaviorRead;
1794
+ readme?: ReadmeBehavior;
1615
1795
  package?: PackageBehavior;
1616
1796
  /**
1617
1797
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
@@ -1628,8 +1808,8 @@ export interface ConfigRead {
1628
1808
  /**
1629
1809
  * Shared generated-client and tooling behavior for a stored Project. Every Target inherits these
1630
1810
  * 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.
1811
+ * while cli, mcp, auth, readme, and package merge by field. GraphQL-only source settings live on
1812
+ * the Project's Definition and are rejected in both stored config scopes.
1633
1813
  */
1634
1814
  export interface ProjectConfig {
1635
1815
  /**
@@ -1644,8 +1824,10 @@ export interface ProjectConfig {
1644
1824
  * reported as generation warnings.
1645
1825
  */
1646
1826
  pagination?: Record<string, PaginationRule | boolean>;
1827
+ auth?: AuthenticationConfig;
1647
1828
  cli?: CliBehavior;
1648
1829
  mcp?: McpBehavior;
1830
+ readme?: ReadmeBehavior;
1649
1831
  package?: PackageBehavior;
1650
1832
  /**
1651
1833
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
@@ -1673,8 +1855,10 @@ export interface ProjectConfigRead {
1673
1855
  * reported as generation warnings.
1674
1856
  */
1675
1857
  pagination?: Record<string, PaginationRuleRead | boolean>;
1858
+ auth?: AuthenticationConfig;
1676
1859
  cli?: CliBehavior;
1677
1860
  mcp?: McpBehaviorRead;
1861
+ readme?: ReadmeBehavior;
1678
1862
  package?: PackageBehavior;
1679
1863
  /**
1680
1864
  * The API's documentation site. Read through its llms.txt by the generated CLI's docs command,
@@ -1688,6 +1872,40 @@ export interface ProjectConfigRead {
1688
1872
  */
1689
1873
  docs_index_url?: string | null;
1690
1874
  }
1875
+ /**
1876
+ * Target-specific generation and delivery overrides. Authentication may only select a Project-owned
1877
+ * OAuth application. OAuth server metadata, applications, and identity policy remain Project-owned.
1878
+ * Self-hosted MCP access may be overridden for a Target-specific deployment.
1879
+ */
1880
+ export interface TargetConfig {
1881
+ globals?: string[];
1882
+ retries?: RetryTuning;
1883
+ pagination?: Record<string, PaginationRule | boolean>;
1884
+ auth?: TargetAuthenticationConfig;
1885
+ cli?: CliBehavior;
1886
+ mcp?: McpBehavior;
1887
+ readme?: ReadmeBehavior;
1888
+ package?: PackageBehavior;
1889
+ /** Format: uri */
1890
+ docs_url?: string | null;
1891
+ /** Format: uri */
1892
+ docs_index_url?: string | null;
1893
+ }
1894
+ /** Response shape for TargetConfig. */
1895
+ export interface TargetConfigRead {
1896
+ globals?: string[];
1897
+ retries?: RetryTuning;
1898
+ pagination?: Record<string, PaginationRuleRead | boolean>;
1899
+ auth?: TargetAuthenticationConfig;
1900
+ cli?: CliBehavior;
1901
+ mcp?: McpBehaviorRead;
1902
+ readme?: ReadmeBehavior;
1903
+ package?: PackageBehavior;
1904
+ /** Format: uri */
1905
+ docs_url?: string | null;
1906
+ /** Format: uri */
1907
+ docs_index_url?: string | null;
1908
+ }
1691
1909
  /** What a GraphQL schema cannot say about itself. Ignored for OpenAPI specs. */
1692
1910
  export interface GraphqlSettings {
1693
1911
  /**
@@ -1815,6 +2033,35 @@ export interface FileStub {
1815
2033
  path: string;
1816
2034
  bytes: number;
1817
2035
  }
2036
+ export declare const GenerationStatus: {
2037
+ readonly SUCCEEDED: "succeeded";
2038
+ readonly FAILED: "failed";
2039
+ };
2040
+ export type GenerationStatus = (typeof GenerationStatus)[keyof typeof GenerationStatus];
2041
+ export declare const GenerationTrigger: {
2042
+ readonly MANUAL: "manual";
2043
+ readonly WEBHOOK: "webhook";
2044
+ readonly POLL: "poll";
2045
+ readonly PREVIEW: "preview";
2046
+ };
2047
+ export type GenerationTrigger = (typeof GenerationTrigger)[keyof typeof GenerationTrigger];
2048
+ export interface GenerationProvenance {
2049
+ /** Pinned generator contract edition. */
2050
+ generator_edition: string;
2051
+ /** Exact engine build identifier used for replay and support. */
2052
+ engine_build: string;
2053
+ /**
2054
+ * Immutable effective Target configuration used by this run; source credentials are never
2055
+ * included.
2056
+ */
2057
+ resolved_config: Record<string, unknown> | null;
2058
+ config_hash: string | null;
2059
+ /** Resolved generator and entitlement plan used to select the emitted public surface. */
2060
+ surface_plan: Record<string, unknown> | null;
2061
+ surface_plan_hash: string | null;
2062
+ entitlement_cap: number | null;
2063
+ package_version: string | null;
2064
+ }
1818
2065
  export interface Generation {
1819
2066
  id: GenerationId;
1820
2067
  object: "generation";
@@ -1826,29 +2073,13 @@ export interface Generation {
1826
2073
  files_index?: FileStub[];
1827
2074
  project_id: ProjectId;
1828
2075
  definition_revision_id: DefinitionRevisionId | null;
1829
- status: "succeeded" | "failed";
1830
- trigger: "manual" | "webhook" | "poll" | "preview";
2076
+ status: GenerationStatus;
2077
+ trigger: GenerationTrigger;
1831
2078
  /** Persisted Target identity. Null only for stateless generation. */
1832
2079
  target_id: TargetId | null;
1833
2080
  /** Resolved generator implementation; provenance rather than resource identity. */
1834
2081
  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
- };
2082
+ provenance: GenerationProvenance;
1852
2083
  /** Null only for a failed or legacy generation that produced no metadata. */
1853
2084
  meta: GenerationMeta | null;
1854
2085
  warnings: string[];
@@ -1870,29 +2101,13 @@ export interface GenerationWrite {
1870
2101
  files_index?: FileStub[];
1871
2102
  project_id: ProjectId;
1872
2103
  definition_revision_id: DefinitionRevisionId | null;
1873
- status: "succeeded" | "failed";
1874
- trigger: "manual" | "webhook" | "poll" | "preview";
2104
+ status: GenerationStatus;
2105
+ trigger: GenerationTrigger;
1875
2106
  /** Persisted Target identity. Null only for stateless generation. */
1876
2107
  target_id: TargetId | null;
1877
2108
  /** Resolved generator implementation; provenance rather than resource identity. */
1878
2109
  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
- };
2110
+ provenance: GenerationProvenance;
1896
2111
  /** Null only for a failed or legacy generation that produced no metadata. */
1897
2112
  meta: GenerationMeta | null;
1898
2113
  warnings: string[];
@@ -1915,29 +2130,13 @@ export interface GenerationRead {
1915
2130
  files_index?: FileStub[];
1916
2131
  project_id: ProjectId;
1917
2132
  definition_revision_id: DefinitionRevisionId | null;
1918
- status: ("succeeded" | "failed") | (string & {});
1919
- trigger: ("manual" | "webhook" | "poll" | "preview") | (string & {});
2133
+ status: GenerationStatus | (string & {});
2134
+ trigger: GenerationTrigger | (string & {});
1920
2135
  /** Persisted Target identity. Null only for stateless generation. */
1921
2136
  target_id: TargetId | null;
1922
2137
  /** Resolved generator implementation; provenance rather than resource identity. */
1923
2138
  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
- };
2139
+ provenance: GenerationProvenance;
1941
2140
  /** Null only for a failed or legacy generation that produced no metadata. */
1942
2141
  meta: GenerationMetaRead | null;
1943
2142
  warnings: string[];
@@ -1948,6 +2147,68 @@ export interface GenerationRead {
1948
2147
  created_at: string;
1949
2148
  request_id?: RequestId;
1950
2149
  }
2150
+ /**
2151
+ * Generation metadata returned by collection endpoints. Generated file contents and file indexes
2152
+ * are available only from retrieve and create operations.
2153
+ */
2154
+ export interface GenerationSummary {
2155
+ id: GenerationId;
2156
+ object: "generation";
2157
+ project_id: ProjectId;
2158
+ definition_revision_id: DefinitionRevisionId | null;
2159
+ status: GenerationStatus;
2160
+ trigger: GenerationTrigger;
2161
+ /** Persisted Target identity. Null only for stateless generation. */
2162
+ target_id: TargetId | null;
2163
+ /** Resolved generator implementation; provenance rather than resource identity. */
2164
+ generator: GeneratorKind;
2165
+ provenance: GenerationProvenance;
2166
+ /** Null only for a failed or legacy generation that produced no metadata. */
2167
+ meta: GenerationMeta | null;
2168
+ warnings: string[];
2169
+ error: string | null;
2170
+ /** Format: date-time */
2171
+ created_at: string;
2172
+ }
2173
+ /** Request shape for GenerationSummary. */
2174
+ export interface GenerationSummaryWrite {
2175
+ id: GenerationId;
2176
+ project_id: ProjectId;
2177
+ definition_revision_id: DefinitionRevisionId | null;
2178
+ status: GenerationStatus;
2179
+ trigger: GenerationTrigger;
2180
+ /** Persisted Target identity. Null only for stateless generation. */
2181
+ target_id: TargetId | null;
2182
+ /** Resolved generator implementation; provenance rather than resource identity. */
2183
+ generator: GeneratorKind;
2184
+ provenance: GenerationProvenance;
2185
+ /** Null only for a failed or legacy generation that produced no metadata. */
2186
+ meta: GenerationMeta | null;
2187
+ warnings: string[];
2188
+ error: string | null;
2189
+ /** Format: date-time */
2190
+ created_at: string;
2191
+ }
2192
+ /** Response shape for GenerationSummary. */
2193
+ export interface GenerationSummaryRead {
2194
+ id: GenerationId;
2195
+ object: "generation" | (string & {});
2196
+ project_id: ProjectId;
2197
+ definition_revision_id: DefinitionRevisionId | null;
2198
+ status: GenerationStatus | (string & {});
2199
+ trigger: GenerationTrigger | (string & {});
2200
+ /** Persisted Target identity. Null only for stateless generation. */
2201
+ target_id: TargetId | null;
2202
+ /** Resolved generator implementation; provenance rather than resource identity. */
2203
+ generator: GeneratorKind | (string & {});
2204
+ provenance: GenerationProvenance;
2205
+ /** Null only for a failed or legacy generation that produced no metadata. */
2206
+ meta: GenerationMetaRead | null;
2207
+ warnings: string[];
2208
+ error: string | null;
2209
+ /** Format: date-time */
2210
+ created_at: string;
2211
+ }
1951
2212
  export type GenerationResponse = Generation & ResponseMetadata;
1952
2213
  /** Request shape for GenerationResponse. */
1953
2214
  export type GenerationResponseWrite = GenerationWrite & ResponseMetadata;
@@ -1967,18 +2228,22 @@ export interface GenerationFailureRead {
1967
2228
  status: "failed" | (string & {});
1968
2229
  error: string;
1969
2230
  }
2231
+ /**
2232
+ * Metadata for each Target generation attempted by a Project run. Retrieve one Generation
2233
+ * separately for generated files.
2234
+ */
1970
2235
  export interface GenerationBatch {
1971
- data: Array<Generation | GenerationFailure>;
2236
+ data: Array<GenerationSummary | GenerationFailure>;
1972
2237
  request_id: RequestId;
1973
2238
  }
1974
2239
  /** Request shape for GenerationBatch. */
1975
2240
  export interface GenerationBatchWrite {
1976
- data: Array<GenerationWrite | GenerationFailure>;
2241
+ data: Array<GenerationSummaryWrite | GenerationFailure>;
1977
2242
  request_id: RequestId;
1978
2243
  }
1979
2244
  /** Response shape for GenerationBatch. */
1980
2245
  export interface GenerationBatchRead {
1981
- data: Array<GenerationRead | GenerationFailureRead>;
2246
+ data: Array<GenerationSummaryRead | GenerationFailureRead>;
1982
2247
  request_id: RequestId;
1983
2248
  }
1984
2249
  export interface ApiKey {
@@ -2128,7 +2393,7 @@ export interface ProjectListRead {
2128
2393
  }
2129
2394
  export interface GenerationList {
2130
2395
  object: ListObject;
2131
- data: Generation[];
2396
+ data: GenerationSummary[];
2132
2397
  /** Whether another page is available after this one. */
2133
2398
  has_more: boolean;
2134
2399
  /** Pass this value as cursor to retrieve the next page; null on the last page. */
@@ -2138,7 +2403,7 @@ export interface GenerationList {
2138
2403
  /** Request shape for GenerationList. */
2139
2404
  export interface GenerationListWrite {
2140
2405
  object: ListObject;
2141
- data: GenerationWrite[];
2406
+ data: GenerationSummaryWrite[];
2142
2407
  /** Whether another page is available after this one. */
2143
2408
  has_more: boolean;
2144
2409
  /** Pass this value as cursor to retrieve the next page; null on the last page. */
@@ -2148,7 +2413,7 @@ export interface GenerationListWrite {
2148
2413
  /** Response shape for GenerationList. */
2149
2414
  export interface GenerationListRead {
2150
2415
  object: ListObject;
2151
- data: GenerationRead[];
2416
+ data: GenerationSummaryRead[];
2152
2417
  /** Whether another page is available after this one. */
2153
2418
  has_more: boolean;
2154
2419
  /** Pass this value as cursor to retrieve the next page; null on the last page. */
@@ -2243,6 +2508,7 @@ export declare const ErrorCode: {
2243
2508
  readonly FETCH_ERROR: "fetch_error";
2244
2509
  readonly REPOSITORY_PROVIDER_UNSUPPORTED: "repository_provider_unsupported";
2245
2510
  readonly EDITION_UNAVAILABLE: "edition_unavailable";
2511
+ readonly TARGET_BUSY: "target_busy";
2246
2512
  readonly DELIVERY_CONFLICT: "delivery_conflict";
2247
2513
  readonly RESOURCE_HAS_DEPENDENCIES: "resource_has_dependencies";
2248
2514
  readonly PLAN_LIMIT_REACHED: "plan_limit_reached";