@app-vitals/agent-lib 1.20.0 → 1.20.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 (2) hide show
  1. package/admin-types.ts +945 -803
  2. package/package.json +1 -1
package/admin-types.ts CHANGED
@@ -145,9 +145,7 @@ export interface paths {
145
145
  [name: string]: unknown;
146
146
  };
147
147
  content: {
148
- "application/json":
149
- | components["schemas"]["ProvisionAgentResult"]
150
- | components["schemas"]["ProvisionSkippedResult"];
148
+ "application/json": components["schemas"]["ProvisionAgentResult"] | components["schemas"]["ProvisionSkippedResult"];
151
149
  };
152
150
  };
153
151
  /** @description Forbidden */
@@ -185,7 +183,7 @@ export interface paths {
185
183
  };
186
184
  /**
187
185
  * Get an agent
188
- * @description Admin-only. Returns the full agent record including `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `specialty`, `accountId` (null for unassigned agents), and `missingRequiredEnv` — required env keys declared by the agent's type manifest with no corresponding AgentEnv row yet (informational only).
186
+ * @description Admin-only. Returns the full agent record including `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `specialty`, `accountId` (null for unassigned agents), and `missingRequiredEnv` — required env keys declared by the agent's type with no corresponding AgentEnv row yet (informational only).
189
187
  */
190
188
  get: {
191
189
  parameters: {
@@ -532,7 +530,7 @@ export interface paths {
532
530
  put?: never;
533
531
  /**
534
532
  * Create an agent
535
- * @description Admin-only. Validates name/specialty, creates the Agent row, seeds AgentTool/AgentPlugin rows from the resolved type manifest, attaches repos/allowlists/members, patches Claude credentials, and provisions Kubernetes when `runtime` is "in-cluster" — the same createAgent() implementation (APA-1.1) the web UI form at /admin/agents/new uses. Transactional: on any failure zero rows persist, and this route never returns a partial-success 200. Returns the created agent in the same shape as GET /agents/:id.
533
+ * @description Admin-only. Validates name/specialty, creates the Agent row, seeds AgentTool/AgentPlugin rows from the resolved type, attaches repos/allowlists/members, patches Claude credentials, and provisions Kubernetes when `runtime` is "in-cluster" — the same createAgent() implementation (APA-1.1) the web UI form at /admin/agents/new uses. Transactional: on any failure zero rows persist, and this route never returns a partial-success 200. Returns the created agent in the same shape as GET /agents/:id.
536
534
  */
537
535
  post: {
538
536
  parameters: {
@@ -847,7 +845,7 @@ export interface paths {
847
845
  put?: never;
848
846
  /**
849
847
  * Reconcile system crons
850
- * @description Reconciles the agent's system crons against the cron list declared by its Specialty manifest. Runs in three passes within a single transaction: create-or-update matched-by-name system crons (preserving IDs so run history survives), link/unlink parent-child cron relationships, and delete orphaned system crons no longer in the manifest. Called automatically on agent startup; returns created/updated/deleted counts.
848
+ * @description Reconciles the agent's system crons against the cron list supplied by the AdminExtension for its specialty. Runs in three passes within a single transaction: create-or-update matched-by-name system crons (preserving IDs so run history survives), link/unlink parent-child cron relationships, and delete orphaned system crons no longer in the defaults. Called automatically on agent startup; returns created/updated/deleted counts.
851
849
  */
852
850
  post: {
853
851
  parameters: {
@@ -1452,7 +1450,7 @@ export interface paths {
1452
1450
  patch?: never;
1453
1451
  trace?: never;
1454
1452
  };
1455
- "/agents/{id}/crons/{cronId}/runs/{runId}/transcript": {
1453
+ "/agents/{id}/chat-credentials": {
1456
1454
  parameters: {
1457
1455
  query?: never;
1458
1456
  header?: never;
@@ -1460,8 +1458,8 @@ export interface paths {
1460
1458
  cookie?: never;
1461
1459
  };
1462
1460
  /**
1463
- * Get a cron run transcript
1464
- * @description Returns the stored redacted transcript. `*`, `platform.read` and `platform.ops` callers only: an agent key is 403 even for its own runs. Every read writes an AgentTranscriptRead audit row before the response. 404 when SHIPWRIGHT_TRANSCRIPT_API_ENABLED is not `enabled` or no transcript exists.
1461
+ * List chat credentials
1462
+ * @description Lists the chat-service tokens scoped to the agent (id and label only — raw values are never returned). `*` or `platform.ops` callers only.
1465
1463
  */
1466
1464
  get: {
1467
1465
  parameters: {
@@ -1469,20 +1467,18 @@ export interface paths {
1469
1467
  header?: never;
1470
1468
  path: {
1471
1469
  id: string;
1472
- cronId: string;
1473
- runId: string;
1474
1470
  };
1475
1471
  cookie?: never;
1476
1472
  };
1477
1473
  requestBody?: never;
1478
1474
  responses: {
1479
- /** @description The transcript */
1475
+ /** @description Chat credential metadata */
1480
1476
  200: {
1481
1477
  headers: {
1482
1478
  [name: string]: unknown;
1483
1479
  };
1484
1480
  content: {
1485
- "application/json": components["schemas"]["CronRunTranscript"];
1481
+ "application/json": components["schemas"]["ChatCredentialsWrapper"];
1486
1482
  };
1487
1483
  };
1488
1484
  /** @description Forbidden */
@@ -1494,7 +1490,7 @@ export interface paths {
1494
1490
  "application/json": components["schemas"]["Error"];
1495
1491
  };
1496
1492
  };
1497
- /** @description No transcript, or transcript API disabled */
1493
+ /** @description Not found, or chat-credential minting disabled */
1498
1494
  404: {
1499
1495
  headers: {
1500
1496
  [name: string]: unknown;
@@ -1503,36 +1499,44 @@ export interface paths {
1503
1499
  "application/json": components["schemas"]["Error"];
1504
1500
  };
1505
1501
  };
1502
+ /** @description Chat service not configured */
1503
+ 503: {
1504
+ headers: {
1505
+ [name: string]: unknown;
1506
+ };
1507
+ content: {
1508
+ "application/json": components["schemas"]["Error"];
1509
+ };
1510
+ };
1506
1511
  };
1507
1512
  };
1513
+ put?: never;
1508
1514
  /**
1509
- * Upload a cron run transcript
1510
- * @description Stores (upserts) the runtime's already-redacted session transcript for a cron run, then keeps only the agent's newest 200 transcripts. Callers: the agent's own key, or `*`. `body` over 1 MiB (UTF-8 bytes) is a 413. 404 unless SHIPWRIGHT_TRANSCRIPT_API_ENABLED is `enabled`, or when the run is not owned by the cron/agent.
1515
+ * Mint a chat credential
1516
+ * @description Mints a chat-service token scoped to the agent in the path. `*` or `platform.ops` callers only — never the agent's own key. The body is closed: an `agentId` field is rejected with 400, so an unrestricted chat admin token cannot be minted here. The raw token is returned once and is never logged or stored by admin. 404 unless SHIPWRIGHT_CHAT_TOKEN_MINT_ENABLED is `enabled`.
1511
1517
  */
1512
- put: {
1518
+ post: {
1513
1519
  parameters: {
1514
1520
  query?: never;
1515
1521
  header?: never;
1516
1522
  path: {
1517
1523
  id: string;
1518
- cronId: string;
1519
- runId: string;
1520
1524
  };
1521
1525
  cookie?: never;
1522
1526
  };
1523
1527
  requestBody?: {
1524
1528
  content: {
1525
- "application/json": components["schemas"]["UploadCronRunTranscriptBody"];
1529
+ "application/json": components["schemas"]["CreateChatCredentialBody"];
1526
1530
  };
1527
1531
  };
1528
1532
  responses: {
1529
- /** @description Transcript stored */
1530
- 200: {
1533
+ /** @description Credential minted (raw token returned once) */
1534
+ 201: {
1531
1535
  headers: {
1532
1536
  [name: string]: unknown;
1533
1537
  };
1534
1538
  content: {
1535
- "application/json": components["schemas"]["CronRunTranscriptUploadResult"];
1539
+ "application/json": components["schemas"]["CreateChatCredentialResponse"];
1536
1540
  };
1537
1541
  };
1538
1542
  /** @description Bad request */
@@ -1544,7 +1548,7 @@ export interface paths {
1544
1548
  "application/json": components["schemas"]["Error"];
1545
1549
  };
1546
1550
  };
1547
- /** @description Caller not allowed */
1551
+ /** @description Forbidden */
1548
1552
  403: {
1549
1553
  headers: {
1550
1554
  [name: string]: unknown;
@@ -1553,7 +1557,7 @@ export interface paths {
1553
1557
  "application/json": components["schemas"]["Error"];
1554
1558
  };
1555
1559
  };
1556
- /** @description Run not found, or transcript API disabled */
1560
+ /** @description Not found, or chat-credential minting disabled */
1557
1561
  404: {
1558
1562
  headers: {
1559
1563
  [name: string]: unknown;
@@ -1562,8 +1566,8 @@ export interface paths {
1562
1566
  "application/json": components["schemas"]["Error"];
1563
1567
  };
1564
1568
  };
1565
- /** @description Transcript body over 1 MiB */
1566
- 413: {
1569
+ /** @description Chat service not configured */
1570
+ 503: {
1567
1571
  headers: {
1568
1572
  [name: string]: unknown;
1569
1573
  };
@@ -1573,50 +1577,91 @@ export interface paths {
1573
1577
  };
1574
1578
  };
1575
1579
  };
1576
- post?: never;
1577
1580
  delete?: never;
1578
1581
  options?: never;
1579
1582
  head?: never;
1580
1583
  patch?: never;
1581
1584
  trace?: never;
1582
1585
  };
1583
- "/agents/{id}/plugins": {
1586
+ "/agents/{id}/chat-credentials/{tokenId}": {
1584
1587
  parameters: {
1585
1588
  query?: never;
1586
1589
  header?: never;
1587
1590
  path?: never;
1588
1591
  cookie?: never;
1589
1592
  };
1593
+ get?: never;
1594
+ put?: never;
1595
+ post?: never;
1590
1596
  /**
1591
- * List plugins
1592
- * @description Returns every plugin installed for the agent.
1597
+ * Revoke a chat credential
1598
+ * @description Revokes a chat-service token. 404 when the token is not scoped to the agent in the path. `*` or `platform.ops` callers only.
1593
1599
  */
1594
- get: {
1600
+ delete: {
1595
1601
  parameters: {
1596
1602
  query?: never;
1597
1603
  header?: never;
1598
1604
  path: {
1599
1605
  id: string;
1606
+ tokenId: string;
1600
1607
  };
1601
1608
  cookie?: never;
1602
1609
  };
1603
1610
  requestBody?: never;
1604
1611
  responses: {
1605
- /** @description List of plugins */
1606
- 200: {
1612
+ /** @description Credential revoked */
1613
+ 204: {
1614
+ headers: {
1615
+ [name: string]: unknown;
1616
+ };
1617
+ content?: never;
1618
+ };
1619
+ /** @description Forbidden */
1620
+ 403: {
1607
1621
  headers: {
1608
1622
  [name: string]: unknown;
1609
1623
  };
1610
1624
  content: {
1611
- "application/json": components["schemas"]["PluginsWrapper"];
1625
+ "application/json": components["schemas"]["Error"];
1626
+ };
1627
+ };
1628
+ /** @description Not found, or chat-credential minting disabled */
1629
+ 404: {
1630
+ headers: {
1631
+ [name: string]: unknown;
1632
+ };
1633
+ content: {
1634
+ "application/json": components["schemas"]["Error"];
1635
+ };
1636
+ };
1637
+ /** @description Chat service not configured */
1638
+ 503: {
1639
+ headers: {
1640
+ [name: string]: unknown;
1641
+ };
1642
+ content: {
1643
+ "application/json": components["schemas"]["Error"];
1612
1644
  };
1613
1645
  };
1614
1646
  };
1615
1647
  };
1648
+ options?: never;
1649
+ head?: never;
1650
+ patch?: never;
1651
+ trace?: never;
1652
+ };
1653
+ "/agents/{id}/ask": {
1654
+ parameters: {
1655
+ query?: never;
1656
+ header?: never;
1657
+ path?: never;
1658
+ cookie?: never;
1659
+ };
1660
+ get?: never;
1616
1661
  put?: never;
1617
1662
  /**
1618
- * Install a plugin
1619
- * @description Adds a Claude Code marketplace plugin for the agent.
1663
+ * Ask another agent a question
1664
+ * @description Posts `question` from agent `from` into a new `kind: ask` chat thread of agent `{id}` (always created with `askDepth: 1`), then, when `waitMs > 0`, polls once per second until the agent replies or the budget ends. Callers: `*`, `platform.ops`, or the agent key whose id equals `from` (never impersonation). The `from>{id}` pair must be on SHIPWRIGHT_AGENT_ASK_ALLOWLIST. Every ask writes an AgentAsk audit row (no question text). 404 unless SHIPWRIGHT_AGENT_ASK_ENABLED is `enabled`; 503 when the chat service is not configured.
1620
1665
  */
1621
1666
  post: {
1622
1667
  parameters: {
@@ -1629,20 +1674,20 @@ export interface paths {
1629
1674
  };
1630
1675
  requestBody?: {
1631
1676
  content: {
1632
- "application/json": components["schemas"]["CreateAgentPluginBody"];
1677
+ "application/json": components["schemas"]["AgentAskBody"];
1633
1678
  };
1634
1679
  };
1635
1680
  responses: {
1636
- /** @description Plugin added */
1681
+ /** @description Ask posted; `replied` with the reply, or `pending` */
1637
1682
  201: {
1638
1683
  headers: {
1639
1684
  [name: string]: unknown;
1640
1685
  };
1641
1686
  content: {
1642
- "application/json": components["schemas"]["PluginWrapper"];
1687
+ "application/json": components["schemas"]["AgentAskResponse"];
1643
1688
  };
1644
1689
  };
1645
- /** @description Bad request */
1690
+ /** @description Bad request (including depth other than 1) */
1646
1691
  400: {
1647
1692
  headers: {
1648
1693
  [name: string]: unknown;
@@ -1651,16 +1696,57 @@ export interface paths {
1651
1696
  "application/json": components["schemas"]["Error"];
1652
1697
  };
1653
1698
  };
1699
+ /** @description Caller not allowed, or the pair is not allowlisted */
1700
+ 403: {
1701
+ headers: {
1702
+ [name: string]: unknown;
1703
+ };
1704
+ content: {
1705
+ "application/json": components["schemas"]["Error"];
1706
+ };
1707
+ };
1708
+ /** @description Agent not found, or agent ask disabled */
1709
+ 404: {
1710
+ headers: {
1711
+ [name: string]: unknown;
1712
+ };
1713
+ content: {
1714
+ "application/json": components["schemas"]["Error"];
1715
+ };
1716
+ };
1717
+ /** @description Chat service not configured */
1718
+ 503: {
1719
+ headers: {
1720
+ [name: string]: unknown;
1721
+ };
1722
+ content: {
1723
+ "application/json": components["schemas"]["Error"];
1724
+ };
1725
+ };
1654
1726
  };
1655
1727
  };
1728
+ delete?: never;
1729
+ options?: never;
1730
+ head?: never;
1731
+ patch?: never;
1732
+ trace?: never;
1733
+ };
1734
+ "/agents/{id}/asks": {
1735
+ parameters: {
1736
+ query?: never;
1737
+ header?: never;
1738
+ path?: never;
1739
+ cookie?: never;
1740
+ };
1656
1741
  /**
1657
- * Remove a plugin
1658
- * @description Removes the plugin identified by the required `name` query param.
1742
+ * List agent asks
1743
+ * @description Lists the AgentAsk audit rows the agent sent or received, newest first. `*`, `platform.read` and `platform.ops` callers only. 404 unless SHIPWRIGHT_AGENT_ASK_ENABLED is `enabled`.
1659
1744
  */
1660
- delete: {
1745
+ get: {
1661
1746
  parameters: {
1662
- query: {
1663
- name: string;
1747
+ query?: {
1748
+ limit?: number;
1749
+ offset?: number | null;
1664
1750
  };
1665
1751
  header?: never;
1666
1752
  path: {
@@ -1670,12 +1756,14 @@ export interface paths {
1670
1756
  };
1671
1757
  requestBody?: never;
1672
1758
  responses: {
1673
- /** @description Plugin removed */
1674
- 204: {
1759
+ /** @description Audit rows */
1760
+ 200: {
1675
1761
  headers: {
1676
1762
  [name: string]: unknown;
1677
1763
  };
1678
- content?: never;
1764
+ content: {
1765
+ "application/json": components["schemas"]["AgentAskList"];
1766
+ };
1679
1767
  };
1680
1768
  /** @description Bad request */
1681
1769
  400: {
@@ -1686,41 +1774,69 @@ export interface paths {
1686
1774
  "application/json": components["schemas"]["Error"];
1687
1775
  };
1688
1776
  };
1777
+ /** @description Forbidden */
1778
+ 403: {
1779
+ headers: {
1780
+ [name: string]: unknown;
1781
+ };
1782
+ content: {
1783
+ "application/json": components["schemas"]["Error"];
1784
+ };
1785
+ };
1786
+ /** @description Agent ask disabled */
1787
+ 404: {
1788
+ headers: {
1789
+ [name: string]: unknown;
1790
+ };
1791
+ content: {
1792
+ "application/json": components["schemas"]["Error"];
1793
+ };
1794
+ };
1689
1795
  };
1690
1796
  };
1797
+ put?: never;
1798
+ post?: never;
1799
+ delete?: never;
1691
1800
  options?: never;
1692
1801
  head?: never;
1802
+ patch?: never;
1803
+ trace?: never;
1804
+ };
1805
+ "/agents/{id}/crons/{cronId}/run-now": {
1806
+ parameters: {
1807
+ query?: never;
1808
+ header?: never;
1809
+ path?: never;
1810
+ cookie?: never;
1811
+ };
1812
+ get?: never;
1813
+ put?: never;
1693
1814
  /**
1694
- * Update a plugin
1695
- * @description Re-upserts the plugin identified by the required `name` query param with a new `version` and/or `enabled` state. Uses a query param rather than a path segment because a canonical plugin spec like "my-plugin@org/my-marketplace" can contain a literal "/" that would break path matching.
1815
+ * Request an immediate run of a cron job
1816
+ * @description Asks the agent's runtime to run the cron job once, now, with the job's own stored prompt. Takes no request body (any body is 400). Stamps `runRequestedAt` on the job and writes an AgentCronRunRequest audit row before returning 202; the runtime honours a fresh request (under 15 minutes old) once on its next cron sync. Callers: `*`, `platform.ops`, or the agent's own key. 404 unless SHIPWRIGHT_CRON_RUN_NOW_ENABLED is `enabled`; 409 when the trial-expiry lockdown disabled the cron.
1696
1817
  */
1697
- patch: {
1818
+ post: {
1698
1819
  parameters: {
1699
- query: {
1700
- name: string;
1701
- };
1820
+ query?: never;
1702
1821
  header?: never;
1703
1822
  path: {
1704
1823
  id: string;
1824
+ cronId: string;
1705
1825
  };
1706
1826
  cookie?: never;
1707
1827
  };
1708
- requestBody?: {
1709
- content: {
1710
- "application/json": components["schemas"]["PatchAgentPluginBody"];
1711
- };
1712
- };
1828
+ requestBody?: never;
1713
1829
  responses: {
1714
- /** @description Plugin version updated */
1715
- 200: {
1830
+ /** @description Run requested */
1831
+ 202: {
1716
1832
  headers: {
1717
1833
  [name: string]: unknown;
1718
1834
  };
1719
1835
  content: {
1720
- "application/json": components["schemas"]["PluginWrapper"];
1836
+ "application/json": components["schemas"]["CronRunNowResponse"];
1721
1837
  };
1722
1838
  };
1723
- /** @description Bad request */
1839
+ /** @description A request body was sent */
1724
1840
  400: {
1725
1841
  headers: {
1726
1842
  [name: string]: unknown;
@@ -1729,11 +1845,42 @@ export interface paths {
1729
1845
  "application/json": components["schemas"]["Error"];
1730
1846
  };
1731
1847
  };
1848
+ /** @description Caller not allowed */
1849
+ 403: {
1850
+ headers: {
1851
+ [name: string]: unknown;
1852
+ };
1853
+ content: {
1854
+ "application/json": components["schemas"]["Error"];
1855
+ };
1856
+ };
1857
+ /** @description Cron not found, or cron run-now disabled */
1858
+ 404: {
1859
+ headers: {
1860
+ [name: string]: unknown;
1861
+ };
1862
+ content: {
1863
+ "application/json": components["schemas"]["Error"];
1864
+ };
1865
+ };
1866
+ /** @description Cron disabled by lockdown */
1867
+ 409: {
1868
+ headers: {
1869
+ [name: string]: unknown;
1870
+ };
1871
+ content: {
1872
+ "application/json": components["schemas"]["Error"];
1873
+ };
1874
+ };
1732
1875
  };
1733
1876
  };
1877
+ delete?: never;
1878
+ options?: never;
1879
+ head?: never;
1880
+ patch?: never;
1734
1881
  trace?: never;
1735
1882
  };
1736
- "/agents/{id}/phase-methodology": {
1883
+ "/agents/{id}/crons/{cronId}/runs/{runId}/transcript": {
1737
1884
  parameters: {
1738
1885
  query?: never;
1739
1886
  header?: never;
@@ -1741,8 +1888,8 @@ export interface paths {
1741
1888
  cookie?: never;
1742
1889
  };
1743
1890
  /**
1744
- * List phase-methodology overrides
1745
- * @description Returns every phase-methodology override configured for the agent — which subagent type handles each pipeline phase (prd, plan-session, review, patch, deploy, dev-task). A phase with no explicit override is simply absent from this list; see GET /agents/:id/config's `phaseMethodology` map for the full six-phase view with defaults filled in.
1891
+ * Get a cron run transcript
1892
+ * @description Returns the stored redacted transcript. `*`, `platform.read` and `platform.ops` callers only: an agent key is 403 even for its own runs. Every read writes an AgentTranscriptRead audit row before the response. 404 when SHIPWRIGHT_TRANSCRIPT_API_ENABLED is not `enabled` or no transcript exists.
1746
1893
  */
1747
1894
  get: {
1748
1895
  parameters: {
@@ -1750,21 +1897,32 @@ export interface paths {
1750
1897
  header?: never;
1751
1898
  path: {
1752
1899
  id: string;
1900
+ cronId: string;
1901
+ runId: string;
1753
1902
  };
1754
1903
  cookie?: never;
1755
1904
  };
1756
1905
  requestBody?: never;
1757
1906
  responses: {
1758
- /** @description List of phase-methodology overrides */
1907
+ /** @description The transcript */
1759
1908
  200: {
1760
1909
  headers: {
1761
1910
  [name: string]: unknown;
1762
1911
  };
1763
1912
  content: {
1764
- "application/json": components["schemas"]["PhaseMethodologyListWrapper"];
1913
+ "application/json": components["schemas"]["CronRunTranscript"];
1765
1914
  };
1766
1915
  };
1767
- /** @description Agent not found */
1916
+ /** @description Forbidden */
1917
+ 403: {
1918
+ headers: {
1919
+ [name: string]: unknown;
1920
+ };
1921
+ content: {
1922
+ "application/json": components["schemas"]["Error"];
1923
+ };
1924
+ };
1925
+ /** @description No transcript, or transcript API disabled */
1768
1926
  404: {
1769
1927
  headers: {
1770
1928
  [name: string]: unknown;
@@ -1775,7 +1933,74 @@ export interface paths {
1775
1933
  };
1776
1934
  };
1777
1935
  };
1778
- put?: never;
1936
+ /**
1937
+ * Upload a cron run transcript
1938
+ * @description Stores (upserts) the runtime's already-redacted session transcript for a cron run, then keeps only the agent's newest 200 transcripts. Callers: the agent's own key, or `*`. `body` over 1 MiB (UTF-8 bytes) is a 413. 404 unless SHIPWRIGHT_TRANSCRIPT_API_ENABLED is `enabled`, or when the run is not owned by the cron/agent.
1939
+ */
1940
+ put: {
1941
+ parameters: {
1942
+ query?: never;
1943
+ header?: never;
1944
+ path: {
1945
+ id: string;
1946
+ cronId: string;
1947
+ runId: string;
1948
+ };
1949
+ cookie?: never;
1950
+ };
1951
+ requestBody?: {
1952
+ content: {
1953
+ "application/json": components["schemas"]["UploadCronRunTranscriptBody"];
1954
+ };
1955
+ };
1956
+ responses: {
1957
+ /** @description Transcript stored */
1958
+ 200: {
1959
+ headers: {
1960
+ [name: string]: unknown;
1961
+ };
1962
+ content: {
1963
+ "application/json": components["schemas"]["CronRunTranscriptUploadResult"];
1964
+ };
1965
+ };
1966
+ /** @description Bad request */
1967
+ 400: {
1968
+ headers: {
1969
+ [name: string]: unknown;
1970
+ };
1971
+ content: {
1972
+ "application/json": components["schemas"]["Error"];
1973
+ };
1974
+ };
1975
+ /** @description Caller not allowed */
1976
+ 403: {
1977
+ headers: {
1978
+ [name: string]: unknown;
1979
+ };
1980
+ content: {
1981
+ "application/json": components["schemas"]["Error"];
1982
+ };
1983
+ };
1984
+ /** @description Run not found, or transcript API disabled */
1985
+ 404: {
1986
+ headers: {
1987
+ [name: string]: unknown;
1988
+ };
1989
+ content: {
1990
+ "application/json": components["schemas"]["Error"];
1991
+ };
1992
+ };
1993
+ /** @description Transcript body over 1 MiB */
1994
+ 413: {
1995
+ headers: {
1996
+ [name: string]: unknown;
1997
+ };
1998
+ content: {
1999
+ "application/json": components["schemas"]["Error"];
2000
+ };
2001
+ };
2002
+ };
2003
+ };
1779
2004
  post?: never;
1780
2005
  delete?: never;
1781
2006
  options?: never;
@@ -1783,50 +2008,69 @@ export interface paths {
1783
2008
  patch?: never;
1784
2009
  trace?: never;
1785
2010
  };
1786
- "/agents/{id}/phase-methodology/{phase}": {
2011
+ "/agents/{id}/plugins": {
1787
2012
  parameters: {
1788
2013
  query?: never;
1789
2014
  header?: never;
1790
2015
  path?: never;
1791
2016
  cookie?: never;
1792
2017
  };
1793
- get?: never;
1794
2018
  /**
1795
- * Set a phase's subagent-type override
1796
- * @description Upserts the `subagentType` override for one pipeline phase. Passing `subagentType: null` clears the override (the phase falls back to its default methodology). `phase` must be one of prd, plan-session, review, patch, deploy, dev-task.
2019
+ * List plugins
2020
+ * @description Returns every plugin installed for the agent.
1797
2021
  */
1798
- put: {
2022
+ get: {
2023
+ parameters: {
2024
+ query?: never;
2025
+ header?: never;
2026
+ path: {
2027
+ id: string;
2028
+ };
2029
+ cookie?: never;
2030
+ };
2031
+ requestBody?: never;
2032
+ responses: {
2033
+ /** @description List of plugins */
2034
+ 200: {
2035
+ headers: {
2036
+ [name: string]: unknown;
2037
+ };
2038
+ content: {
2039
+ "application/json": components["schemas"]["PluginsWrapper"];
2040
+ };
2041
+ };
2042
+ };
2043
+ };
2044
+ put?: never;
2045
+ /**
2046
+ * Install a plugin
2047
+ * @description Adds a Claude Code marketplace plugin for the agent.
2048
+ */
2049
+ post: {
1799
2050
  parameters: {
1800
2051
  query?: never;
1801
2052
  header?: never;
1802
2053
  path: {
1803
2054
  id: string;
1804
- phase:
1805
- | "prd"
1806
- | "plan-session"
1807
- | "review"
1808
- | "patch"
1809
- | "deploy"
1810
- | "dev-task";
1811
2055
  };
1812
2056
  cookie?: never;
1813
2057
  };
1814
2058
  requestBody?: {
1815
2059
  content: {
1816
- "application/json": components["schemas"]["PutAgentPhaseMethodologyBody"];
2060
+ "application/json": components["schemas"]["CreateAgentPluginBody"];
1817
2061
  };
1818
2062
  };
1819
2063
  responses: {
1820
- /** @description Phase-methodology override upserted */
1821
- 200: {
2064
+ /** @description Plugin added */
2065
+ 201: {
1822
2066
  headers: {
1823
2067
  [name: string]: unknown;
1824
2068
  };
1825
2069
  content: {
1826
- "application/json": components["schemas"]["PhaseMethodologyWrapper"];
2070
+ "application/json": components["schemas"]["PluginWrapper"];
1827
2071
  };
1828
2072
  };
1829
- /** @description Bad request — invalid phase */
2073
+ /** @description Bad request */
1830
2074
  400: {
1831
2075
  headers: {
1832
2076
  [name: string]: unknown;
@@ -1835,8 +2079,34 @@ export interface paths {
1835
2079
  "application/json": components["schemas"]["Error"];
1836
2080
  };
1837
2081
  };
1838
- /** @description Agent not found */
1839
- 404: {
2082
+ };
2083
+ };
2084
+ /**
2085
+ * Remove a plugin
2086
+ * @description Removes the plugin identified by the required `name` query param.
2087
+ */
2088
+ delete: {
2089
+ parameters: {
2090
+ query: {
2091
+ name: string;
2092
+ };
2093
+ header?: never;
2094
+ path: {
2095
+ id: string;
2096
+ };
2097
+ cookie?: never;
2098
+ };
2099
+ requestBody?: never;
2100
+ responses: {
2101
+ /** @description Plugin removed */
2102
+ 204: {
2103
+ headers: {
2104
+ [name: string]: unknown;
2105
+ };
2106
+ content?: never;
2107
+ };
2108
+ /** @description Bad request */
2109
+ 400: {
1840
2110
  headers: {
1841
2111
  [name: string]: unknown;
1842
2112
  };
@@ -1846,14 +2116,52 @@ export interface paths {
1846
2116
  };
1847
2117
  };
1848
2118
  };
1849
- post?: never;
1850
- delete?: never;
1851
2119
  options?: never;
1852
2120
  head?: never;
1853
- patch?: never;
2121
+ /**
2122
+ * Update a plugin
2123
+ * @description Re-upserts the plugin identified by the required `name` query param with a new `version` and/or `enabled` state. Uses a query param rather than a path segment because a canonical plugin spec like "my-plugin@org/my-marketplace" can contain a literal "/" that would break path matching.
2124
+ */
2125
+ patch: {
2126
+ parameters: {
2127
+ query: {
2128
+ name: string;
2129
+ };
2130
+ header?: never;
2131
+ path: {
2132
+ id: string;
2133
+ };
2134
+ cookie?: never;
2135
+ };
2136
+ requestBody?: {
2137
+ content: {
2138
+ "application/json": components["schemas"]["PatchAgentPluginBody"];
2139
+ };
2140
+ };
2141
+ responses: {
2142
+ /** @description Plugin version updated */
2143
+ 200: {
2144
+ headers: {
2145
+ [name: string]: unknown;
2146
+ };
2147
+ content: {
2148
+ "application/json": components["schemas"]["PluginWrapper"];
2149
+ };
2150
+ };
2151
+ /** @description Bad request */
2152
+ 400: {
2153
+ headers: {
2154
+ [name: string]: unknown;
2155
+ };
2156
+ content: {
2157
+ "application/json": components["schemas"]["Error"];
2158
+ };
2159
+ };
2160
+ };
2161
+ };
1854
2162
  trace?: never;
1855
2163
  };
1856
- "/agents/all/cron-runs/stats": {
2164
+ "/agents/{id}/marketplaces": {
1857
2165
  parameters: {
1858
2166
  query?: never;
1859
2167
  header?: never;
@@ -1861,32 +2169,62 @@ export interface paths {
1861
2169
  cookie?: never;
1862
2170
  };
1863
2171
  /**
1864
- * Get aggregated cron-run token stats
1865
- * @description Admin-only. Returns token usage and cost aggregated across all agents' cron runs, broken down by agent, cron, model, day, and pipeline phase. Optional `from`/`to` ISO datetime query params bound the range.
2172
+ * List marketplaces
2173
+ * @description Returns every remote plugin marketplace configured for the agent.
1866
2174
  */
1867
2175
  get: {
1868
2176
  parameters: {
1869
- query?: {
1870
- from?: string;
1871
- to?: string;
2177
+ query?: never;
2178
+ header?: never;
2179
+ path: {
2180
+ id: string;
1872
2181
  };
2182
+ cookie?: never;
2183
+ };
2184
+ requestBody?: never;
2185
+ responses: {
2186
+ /** @description List of marketplaces */
2187
+ 200: {
2188
+ headers: {
2189
+ [name: string]: unknown;
2190
+ };
2191
+ content: {
2192
+ "application/json": components["schemas"]["MarketplacesWrapper"];
2193
+ };
2194
+ };
2195
+ };
2196
+ };
2197
+ put?: never;
2198
+ /**
2199
+ * Add or update a marketplace
2200
+ * @description Upserts a remote plugin marketplace by `name`. `source` must be a GitHub `owner/repo` or an https git URL (no credentials); `ref` optionally pins a branch, tag or sha. 422 on an invalid `name`, `source` or `ref`.
2201
+ */
2202
+ post: {
2203
+ parameters: {
2204
+ query?: never;
1873
2205
  header?: never;
1874
- path?: never;
2206
+ path: {
2207
+ id: string;
2208
+ };
1875
2209
  cookie?: never;
1876
2210
  };
1877
- requestBody?: never;
2211
+ requestBody?: {
2212
+ content: {
2213
+ "application/json": components["schemas"]["UpsertAgentMarketplaceBody"];
2214
+ };
2215
+ };
1878
2216
  responses: {
1879
- /** @description Aggregated cron-run token stats across all agents */
1880
- 200: {
2217
+ /** @description Marketplace added or updated */
2218
+ 201: {
1881
2219
  headers: {
1882
2220
  [name: string]: unknown;
1883
2221
  };
1884
2222
  content: {
1885
- "application/json": components["schemas"]["CronRunTokenStats"];
2223
+ "application/json": components["schemas"]["MarketplaceWrapper"];
1886
2224
  };
1887
2225
  };
1888
- /** @description Unauthorized */
1889
- 401: {
2226
+ /** @description Bad request */
2227
+ 400: {
1890
2228
  headers: {
1891
2229
  [name: string]: unknown;
1892
2230
  };
@@ -1894,8 +2232,8 @@ export interface paths {
1894
2232
  "application/json": components["schemas"]["Error"];
1895
2233
  };
1896
2234
  };
1897
- /** @description Forbidden — requires admin scope */
1898
- 403: {
2235
+ /** @description Invalid name, source or ref */
2236
+ 422: {
1899
2237
  headers: {
1900
2238
  [name: string]: unknown;
1901
2239
  };
@@ -1905,57 +2243,47 @@ export interface paths {
1905
2243
  };
1906
2244
  };
1907
2245
  };
1908
- put?: never;
1909
- post?: never;
1910
2246
  delete?: never;
1911
2247
  options?: never;
1912
2248
  head?: never;
1913
2249
  patch?: never;
1914
2250
  trace?: never;
1915
2251
  };
1916
- "/agents/all/cron-runs/outcomes": {
2252
+ "/agents/{id}/marketplaces/{marketplaceId}": {
1917
2253
  parameters: {
1918
2254
  query?: never;
1919
2255
  header?: never;
1920
2256
  path?: never;
1921
2257
  cookie?: never;
1922
2258
  };
2259
+ get?: never;
2260
+ put?: never;
2261
+ post?: never;
1923
2262
  /**
1924
- * Get cron-run outcomes per phase and context fingerprint
1925
- * @description Admin-only. Returns, per (phase, contextFingerprint): run, completed, failed, and skipped counts, a skipReasons histogram, avg and p50 duration, avg turns, avg tool calls, and avg first-turn context tokens. Optional `from`/`to` ISO datetime query params bound the range on startedAt.
2263
+ * Remove a marketplace
2264
+ * @description Removes the marketplace row by id. 404 when the id does not exist or belongs to a different agent.
1926
2265
  */
1927
- get: {
2266
+ delete: {
1928
2267
  parameters: {
1929
- query?: {
1930
- from?: string;
1931
- to?: string;
1932
- };
2268
+ query?: never;
1933
2269
  header?: never;
1934
- path?: never;
2270
+ path: {
2271
+ id: string;
2272
+ marketplaceId: string;
2273
+ };
1935
2274
  cookie?: never;
1936
2275
  };
1937
2276
  requestBody?: never;
1938
2277
  responses: {
1939
- /** @description Outcome series per (phase, contextFingerprint) */
1940
- 200: {
1941
- headers: {
1942
- [name: string]: unknown;
1943
- };
1944
- content: {
1945
- "application/json": components["schemas"]["CronRunOutcomes"];
1946
- };
1947
- };
1948
- /** @description Unauthorized */
1949
- 401: {
2278
+ /** @description Marketplace removed */
2279
+ 204: {
1950
2280
  headers: {
1951
2281
  [name: string]: unknown;
1952
2282
  };
1953
- content: {
1954
- "application/json": components["schemas"]["Error"];
1955
- };
2283
+ content?: never;
1956
2284
  };
1957
- /** @description Forbidden — requires admin scope */
1958
- 403: {
2285
+ /** @description Marketplace not found */
2286
+ 404: {
1959
2287
  headers: {
1960
2288
  [name: string]: unknown;
1961
2289
  };
@@ -1965,15 +2293,12 @@ export interface paths {
1965
2293
  };
1966
2294
  };
1967
2295
  };
1968
- put?: never;
1969
- post?: never;
1970
- delete?: never;
1971
2296
  options?: never;
1972
2297
  head?: never;
1973
2298
  patch?: never;
1974
2299
  trace?: never;
1975
2300
  };
1976
- "/agents/{id}/cron-runs/stats": {
2301
+ "/agents/all/cron-runs/stats": {
1977
2302
  parameters: {
1978
2303
  query?: never;
1979
2304
  header?: never;
@@ -1981,8 +2306,8 @@ export interface paths {
1981
2306
  cookie?: never;
1982
2307
  };
1983
2308
  /**
1984
- * Get aggregated cron-run token stats for one agent
1985
- * @description Same shape as GET /agents/all/cron-runs/stats, scoped to the given agent's runs. An agent's own bearer token may read its own stats; other agents' tokens are rejected. Optional `from`/`to` ISO datetime query params bound the range.
2309
+ * Get aggregated cron-run token stats
2310
+ * @description Admin-only. Returns token usage and cost aggregated across all agents' cron runs, broken down by agent, cron, model, day, and pipeline phase. Optional `from`/`to` ISO datetime query params bound the range.
1986
2311
  */
1987
2312
  get: {
1988
2313
  parameters: {
@@ -1991,14 +2316,12 @@ export interface paths {
1991
2316
  to?: string;
1992
2317
  };
1993
2318
  header?: never;
1994
- path: {
1995
- id: string;
1996
- };
2319
+ path?: never;
1997
2320
  cookie?: never;
1998
2321
  };
1999
2322
  requestBody?: never;
2000
2323
  responses: {
2001
- /** @description Aggregated cron-run token stats for the agent */
2324
+ /** @description Aggregated cron-run token stats across all agents */
2002
2325
  200: {
2003
2326
  headers: {
2004
2327
  [name: string]: unknown;
@@ -2016,7 +2339,7 @@ export interface paths {
2016
2339
  "application/json": components["schemas"]["Error"];
2017
2340
  };
2018
2341
  };
2019
- /** @description Forbidden */
2342
+ /** @description Forbidden — requires admin scope */
2020
2343
  403: {
2021
2344
  headers: {
2022
2345
  [name: string]: unknown;
@@ -2035,7 +2358,7 @@ export interface paths {
2035
2358
  patch?: never;
2036
2359
  trace?: never;
2037
2360
  };
2038
- "/agents/{id}/cron-runs/outcomes": {
2361
+ "/agents/all/cron-runs/outcomes": {
2039
2362
  parameters: {
2040
2363
  query?: never;
2041
2364
  header?: never;
@@ -2043,8 +2366,8 @@ export interface paths {
2043
2366
  cookie?: never;
2044
2367
  };
2045
2368
  /**
2046
- * Get cron-run outcomes per phase and context fingerprint for one agent
2047
- * @description Same shape as GET /agents/all/cron-runs/outcomes, scoped to the given agent's runs. An agent's own bearer token may read its own outcomes; other agents' tokens are rejected. Optional `from`/`to` ISO datetime query params bound the range on startedAt.
2369
+ * Get cron-run outcomes per phase and context fingerprint
2370
+ * @description Admin-only. Returns, per (phase, contextFingerprint): run, completed, failed, and skipped counts, a skipReasons histogram, avg and p50 duration, avg turns, avg tool calls, and avg first-turn context tokens. Optional `from`/`to` ISO datetime query params bound the range on startedAt.
2048
2371
  */
2049
2372
  get: {
2050
2373
  parameters: {
@@ -2053,14 +2376,12 @@ export interface paths {
2053
2376
  to?: string;
2054
2377
  };
2055
2378
  header?: never;
2056
- path: {
2057
- id: string;
2058
- };
2379
+ path?: never;
2059
2380
  cookie?: never;
2060
2381
  };
2061
2382
  requestBody?: never;
2062
2383
  responses: {
2063
- /** @description Outcome series per (phase, contextFingerprint) for the agent */
2384
+ /** @description Outcome series per (phase, contextFingerprint) */
2064
2385
  200: {
2065
2386
  headers: {
2066
2387
  [name: string]: unknown;
@@ -2078,7 +2399,7 @@ export interface paths {
2078
2399
  "application/json": components["schemas"]["Error"];
2079
2400
  };
2080
2401
  };
2081
- /** @description Forbidden */
2402
+ /** @description Forbidden — requires admin scope */
2082
2403
  403: {
2083
2404
  headers: {
2084
2405
  [name: string]: unknown;
@@ -2097,7 +2418,7 @@ export interface paths {
2097
2418
  patch?: never;
2098
2419
  trace?: never;
2099
2420
  };
2100
- "/agents/all/cron-runs/dev-task-adherence": {
2421
+ "/agents/{id}/cron-runs/stats": {
2101
2422
  parameters: {
2102
2423
  query?: never;
2103
2424
  header?: never;
@@ -2105,8 +2426,8 @@ export interface paths {
2105
2426
  cookie?: never;
2106
2427
  };
2107
2428
  /**
2108
- * Get dev-task adherence report
2109
- * @description Admin-only. Per dev-task run, compares skill-usage subagent dispatches against the required-steps table and reports per-step ran/skipped, with per-step adherence rates overall, per variant (contextFingerprint) and per commandVariant (default vs alternate). Rates cover task-bearing runs only (dispatched against a work item); `counts` separates them from silent no-ready-task ticks. A dispatch proves a step started, not that it was done well. Optional `from`/`to` ISO datetime params bound startedAt.
2429
+ * Get aggregated cron-run token stats for one agent
2430
+ * @description Same shape as GET /agents/all/cron-runs/stats, scoped to the given agent's runs. An agent's own bearer token may read its own stats; other agents' tokens are rejected. Optional `from`/`to` ISO datetime query params bound the range.
2110
2431
  */
2111
2432
  get: {
2112
2433
  parameters: {
@@ -2115,20 +2436,20 @@ export interface paths {
2115
2436
  to?: string;
2116
2437
  };
2117
2438
  header?: never;
2118
- path?: never;
2439
+ path: {
2440
+ id: string;
2441
+ };
2119
2442
  cookie?: never;
2120
2443
  };
2121
2444
  requestBody?: never;
2122
2445
  responses: {
2123
- /** @description Dev-task adherence report */
2446
+ /** @description Aggregated cron-run token stats for the agent */
2124
2447
  200: {
2125
2448
  headers: {
2126
2449
  [name: string]: unknown;
2127
2450
  };
2128
2451
  content: {
2129
- "application/json": {
2130
- [key: string]: unknown;
2131
- };
2452
+ "application/json": components["schemas"]["CronRunTokenStats"];
2132
2453
  };
2133
2454
  };
2134
2455
  /** @description Unauthorized */
@@ -2140,7 +2461,7 @@ export interface paths {
2140
2461
  "application/json": components["schemas"]["Error"];
2141
2462
  };
2142
2463
  };
2143
- /** @description Forbidden — requires admin scope */
2464
+ /** @description Forbidden */
2144
2465
  403: {
2145
2466
  headers: {
2146
2467
  [name: string]: unknown;
@@ -2149,15 +2470,6 @@ export interface paths {
2149
2470
  "application/json": components["schemas"]["Error"];
2150
2471
  };
2151
2472
  };
2152
- /** @description Adherence reporting not configured */
2153
- 404: {
2154
- headers: {
2155
- [name: string]: unknown;
2156
- };
2157
- content: {
2158
- "application/json": components["schemas"]["Error"];
2159
- };
2160
- };
2161
2473
  };
2162
2474
  };
2163
2475
  put?: never;
@@ -2168,7 +2480,7 @@ export interface paths {
2168
2480
  patch?: never;
2169
2481
  trace?: never;
2170
2482
  };
2171
- "/agents/{id}/dev-task-adherence": {
2483
+ "/agents/{id}/cron-runs/outcomes": {
2172
2484
  parameters: {
2173
2485
  query?: never;
2174
2486
  header?: never;
@@ -2176,8 +2488,8 @@ export interface paths {
2176
2488
  cookie?: never;
2177
2489
  };
2178
2490
  /**
2179
- * Get this agent's dev-task adherence report
2180
- * @description Self-serve variant of the fleet-wide dev-task adherence report, scoped to the agent in the path. Access is gated by the generic agent-route auth (an agent's own bearer token, an admin, or a member session) — no admin scope required. Same report shape and optional `from`/`to` params as GET /agents/all/cron-runs/dev-task-adherence.
2491
+ * Get cron-run outcomes per phase and context fingerprint for one agent
2492
+ * @description Same shape as GET /agents/all/cron-runs/outcomes, scoped to the given agent's runs. An agent's own bearer token may read its own outcomes; other agents' tokens are rejected. Optional `from`/`to` ISO datetime query params bound the range on startedAt.
2181
2493
  */
2182
2494
  get: {
2183
2495
  parameters: {
@@ -2193,15 +2505,13 @@ export interface paths {
2193
2505
  };
2194
2506
  requestBody?: never;
2195
2507
  responses: {
2196
- /** @description Dev-task adherence report for this agent's runs only */
2508
+ /** @description Outcome series per (phase, contextFingerprint) for the agent */
2197
2509
  200: {
2198
2510
  headers: {
2199
2511
  [name: string]: unknown;
2200
2512
  };
2201
2513
  content: {
2202
- "application/json": {
2203
- [key: string]: unknown;
2204
- };
2514
+ "application/json": components["schemas"]["CronRunOutcomes"];
2205
2515
  };
2206
2516
  };
2207
2517
  /** @description Unauthorized */
@@ -2222,15 +2532,6 @@ export interface paths {
2222
2532
  "application/json": components["schemas"]["Error"];
2223
2533
  };
2224
2534
  };
2225
- /** @description Adherence reporting not configured */
2226
- 404: {
2227
- headers: {
2228
- [name: string]: unknown;
2229
- };
2230
- content: {
2231
- "application/json": components["schemas"]["Error"];
2232
- };
2233
- };
2234
2535
  };
2235
2536
  };
2236
2537
  put?: never;
@@ -2426,7 +2727,7 @@ export interface paths {
2426
2727
  patch?: never;
2427
2728
  trace?: never;
2428
2729
  };
2429
- "/agents/{id}/work-queue": {
2730
+ "/agents/{id}/github-installations": {
2430
2731
  parameters: {
2431
2732
  query?: never;
2432
2733
  header?: never;
@@ -2434,8 +2735,8 @@ export interface paths {
2434
2735
  cookie?: never;
2435
2736
  };
2436
2737
  /**
2437
- * Get the latest work-queue snapshot
2438
- * @description Returns the most recently pushed work-queue snapshot, or 404 if the agent has never pushed one.
2738
+ * Get the latest GitHub installations snapshot
2739
+ * @description Returns the most recently reported GitHub installations snapshot, or 404 if the agent has never reported one.
2439
2740
  */
2440
2741
  get: {
2441
2742
  parameters: {
@@ -2448,115 +2749,13 @@ export interface paths {
2448
2749
  };
2449
2750
  requestBody?: never;
2450
2751
  responses: {
2451
- /** @description Latest work-queue snapshot */
2452
- 200: {
2453
- headers: {
2454
- [name: string]: unknown;
2455
- };
2456
- content: {
2457
- "application/json": components["schemas"]["WorkQueueSnapshotWrapper"];
2458
- };
2459
- };
2460
- /** @description No snapshot pushed yet */
2461
- 404: {
2462
- headers: {
2463
- [name: string]: unknown;
2464
- };
2465
- content: {
2466
- "application/json": components["schemas"]["Error"];
2467
- };
2468
- };
2469
- };
2470
- };
2471
- put?: never;
2472
- /**
2473
- * Push a work-queue snapshot
2474
- * @description Upserts the agent's single ranked work-queue snapshot (tasks/PRs across pipeline phases), overwriting any prior snapshot — there is no history.
2475
- */
2476
- post: {
2477
- parameters: {
2478
- query?: never;
2479
- header?: never;
2480
- path: {
2481
- id: string;
2482
- };
2483
- cookie?: never;
2484
- };
2485
- requestBody?: {
2486
- content: {
2487
- "application/json": components["schemas"]["PushWorkQueueSnapshotBody"];
2488
- };
2489
- };
2490
- responses: {
2491
- /** @description Snapshot upserted (overwrites any prior snapshot for this agent) */
2492
- 200: {
2493
- headers: {
2494
- [name: string]: unknown;
2495
- };
2496
- content: {
2497
- "application/json": components["schemas"]["WorkQueueSnapshotWrapper"];
2498
- };
2499
- };
2500
- /** @description Bad request */
2501
- 400: {
2502
- headers: {
2503
- [name: string]: unknown;
2504
- };
2505
- content: {
2506
- "application/json": components["schemas"]["Error"];
2507
- };
2508
- };
2509
- };
2510
- };
2511
- delete?: never;
2512
- options?: never;
2513
- head?: never;
2514
- patch?: never;
2515
- trace?: never;
2516
- };
2517
- "/agents/{id}/baked-marketplaces": {
2518
- parameters: {
2519
- query?: never;
2520
- header?: never;
2521
- path?: never;
2522
- cookie?: never;
2523
- };
2524
- get?: never;
2525
- /**
2526
- * Report the marketplaces baked into the agent's image
2527
- * @description Runtime-only report, authenticated with the agent's own key. Overwrites the stored list of baked marketplace names (the image's current state); it is exposed read-only as `bakedMarketplaces` on GET /agents/{id}. Other callers, including another agent's key, get 403.
2528
- */
2529
- put: {
2530
- parameters: {
2531
- query?: never;
2532
- header?: never;
2533
- path: {
2534
- id: string;
2535
- };
2536
- cookie?: never;
2537
- };
2538
- requestBody?: {
2539
- content: {
2540
- "application/json": components["schemas"]["PutBakedMarketplacesBody"];
2541
- };
2542
- };
2543
- responses: {
2544
- /** @description Baked marketplaces stored */
2752
+ /** @description Latest GitHub installations snapshot */
2545
2753
  200: {
2546
2754
  headers: {
2547
2755
  [name: string]: unknown;
2548
2756
  };
2549
2757
  content: {
2550
- "application/json": components["schemas"]["BakedMarketplacesResult"];
2551
- };
2552
- };
2553
- /** @description Bad request */
2554
- 400: {
2555
- headers: {
2556
- [name: string]: unknown;
2557
- };
2558
- content: {
2559
- "application/json": components["schemas"]["Error"];
2758
+ "application/json": components["schemas"]["GitHubInstallationsSnapshotWrapper"];
2560
2759
  };
2561
2760
  };
2562
2761
  /** @description Unauthorized */
@@ -2568,7 +2767,7 @@ export interface paths {
2568
2767
  "application/json": components["schemas"]["Error"];
2569
2768
  };
2570
2769
  };
2571
- /** @description Forbidden — only the agent's own key may report */
2770
+ /** @description Forbidden — token does not own this agent */
2572
2771
  403: {
2573
2772
  headers: {
2574
2773
  [name: string]: unknown;
@@ -2577,36 +2776,22 @@ export interface paths {
2577
2776
  "application/json": components["schemas"]["Error"];
2578
2777
  };
2579
2778
  };
2580
- /** @description Agent not found */
2779
+ /** @description No snapshot reported yet */
2581
2780
  404: {
2582
2781
  headers: {
2583
2782
  [name: string]: unknown;
2584
- };
2585
- content: {
2586
- "application/json": components["schemas"]["Error"];
2587
- };
2588
- };
2589
- };
2590
- };
2591
- post?: never;
2592
- delete?: never;
2593
- options?: never;
2594
- head?: never;
2595
- patch?: never;
2596
- trace?: never;
2597
- };
2598
- "/agents/{id}/github-installations": {
2599
- parameters: {
2600
- query?: never;
2601
- header?: never;
2602
- path?: never;
2603
- cookie?: never;
2783
+ };
2784
+ content: {
2785
+ "application/json": components["schemas"]["Error"];
2786
+ };
2787
+ };
2788
+ };
2604
2789
  };
2605
2790
  /**
2606
- * Get the latest GitHub installations snapshot
2607
- * @description Returns the most recently reported GitHub installations snapshot, or 404 if the agent has never reported one.
2791
+ * Replace the agent's GitHub installations snapshot
2792
+ * @description Upserts the agent's single GitHub App installations snapshot (owner, installation id, state, sanitized lastError), replacing the prior list wholesale — an installation absent from the body is dropped. The body schema is closed: unknown fields (e.g. tokens) are rejected with 400.
2608
2793
  */
2609
- get: {
2794
+ put: {
2610
2795
  parameters: {
2611
2796
  query?: never;
2612
2797
  header?: never;
@@ -2615,9 +2800,13 @@ export interface paths {
2615
2800
  };
2616
2801
  cookie?: never;
2617
2802
  };
2618
- requestBody?: never;
2803
+ requestBody?: {
2804
+ content: {
2805
+ "application/json": components["schemas"]["PutGitHubInstallationsBody"];
2806
+ };
2807
+ };
2619
2808
  responses: {
2620
- /** @description Latest GitHub installations snapshot */
2809
+ /** @description Snapshot replaced */
2621
2810
  200: {
2622
2811
  headers: {
2623
2812
  [name: string]: unknown;
@@ -2626,8 +2815,8 @@ export interface paths {
2626
2815
  "application/json": components["schemas"]["GitHubInstallationsSnapshotWrapper"];
2627
2816
  };
2628
2817
  };
2629
- /** @description Unauthorized */
2630
- 401: {
2818
+ /** @description Bad request */
2819
+ 400: {
2631
2820
  headers: {
2632
2821
  [name: string]: unknown;
2633
2822
  };
@@ -2635,8 +2824,8 @@ export interface paths {
2635
2824
  "application/json": components["schemas"]["Error"];
2636
2825
  };
2637
2826
  };
2638
- /** @description Forbidden — token does not own this agent */
2639
- 403: {
2827
+ /** @description Unauthorized */
2828
+ 401: {
2640
2829
  headers: {
2641
2830
  [name: string]: unknown;
2642
2831
  };
@@ -2644,8 +2833,8 @@ export interface paths {
2644
2833
  "application/json": components["schemas"]["Error"];
2645
2834
  };
2646
2835
  };
2647
- /** @description No snapshot reported yet */
2648
- 404: {
2836
+ /** @description Forbidden — token does not own this agent */
2837
+ 403: {
2649
2838
  headers: {
2650
2839
  [name: string]: unknown;
2651
2840
  };
@@ -2655,9 +2844,24 @@ export interface paths {
2655
2844
  };
2656
2845
  };
2657
2846
  };
2847
+ post?: never;
2848
+ delete?: never;
2849
+ options?: never;
2850
+ head?: never;
2851
+ patch?: never;
2852
+ trace?: never;
2853
+ };
2854
+ "/agents/{id}/baked-marketplaces": {
2855
+ parameters: {
2856
+ query?: never;
2857
+ header?: never;
2858
+ path?: never;
2859
+ cookie?: never;
2860
+ };
2861
+ get?: never;
2658
2862
  /**
2659
- * Replace the agent's GitHub installations snapshot
2660
- * @description Upserts the agent's single GitHub App installations snapshot (owner, installation id, state, sanitized lastError), replacing the prior list wholesale — an installation absent from the body is dropped. The body schema is closed: unknown fields (e.g. tokens) are rejected with 400.
2863
+ * Report the marketplaces baked into the agent's image
2864
+ * @description Runtime-only report, authenticated with the agent's own key. Overwrites the stored list of baked marketplace names (the image's current state); it is exposed read-only as `bakedMarketplaces` on GET /agents/{id}. Other callers, including another agent's key, get 403.
2661
2865
  */
2662
2866
  put: {
2663
2867
  parameters: {
@@ -2670,17 +2874,17 @@ export interface paths {
2670
2874
  };
2671
2875
  requestBody?: {
2672
2876
  content: {
2673
- "application/json": components["schemas"]["PutGitHubInstallationsBody"];
2877
+ "application/json": components["schemas"]["PutBakedMarketplacesBody"];
2674
2878
  };
2675
2879
  };
2676
2880
  responses: {
2677
- /** @description Snapshot replaced */
2881
+ /** @description Baked marketplaces stored */
2678
2882
  200: {
2679
2883
  headers: {
2680
2884
  [name: string]: unknown;
2681
2885
  };
2682
2886
  content: {
2683
- "application/json": components["schemas"]["GitHubInstallationsSnapshotWrapper"];
2887
+ "application/json": components["schemas"]["BakedMarketplacesResult"];
2684
2888
  };
2685
2889
  };
2686
2890
  /** @description Bad request */
@@ -2701,7 +2905,7 @@ export interface paths {
2701
2905
  "application/json": components["schemas"]["Error"];
2702
2906
  };
2703
2907
  };
2704
- /** @description Forbidden — token does not own this agent */
2908
+ /** @description Forbidden — only the agent's own key may report */
2705
2909
  403: {
2706
2910
  headers: {
2707
2911
  [name: string]: unknown;
@@ -2710,6 +2914,15 @@ export interface paths {
2710
2914
  "application/json": components["schemas"]["Error"];
2711
2915
  };
2712
2916
  };
2917
+ /** @description Agent not found */
2918
+ 404: {
2919
+ headers: {
2920
+ [name: string]: unknown;
2921
+ };
2922
+ content: {
2923
+ "application/json": components["schemas"]["Error"];
2924
+ };
2925
+ };
2713
2926
  };
2714
2927
  };
2715
2928
  post?: never;
@@ -2864,7 +3077,7 @@ export interface paths {
2864
3077
  patch?: never;
2865
3078
  trace?: never;
2866
3079
  };
2867
- "/agents/{id}/chat-credentials": {
3080
+ "/github-enterprise/apps": {
2868
3081
  parameters: {
2869
3082
  query?: never;
2870
3083
  header?: never;
@@ -2872,40 +3085,29 @@ export interface paths {
2872
3085
  cookie?: never;
2873
3086
  };
2874
3087
  /**
2875
- * List chat credentials
2876
- * @description Lists the chat-service tokens scoped to the agent (id and label only — raw values are never returned). `*` or `platform.ops` callers only.
3088
+ * GitHub Enterprise App status
3089
+ * @description Admin-only. Metadata and key-set flag per role; never the key. Returns configured=false with null roles when nothing is set.
2877
3090
  */
2878
3091
  get: {
2879
3092
  parameters: {
2880
3093
  query?: never;
2881
3094
  header?: never;
2882
- path: {
2883
- id: string;
2884
- };
3095
+ path?: never;
2885
3096
  cookie?: never;
2886
3097
  };
2887
3098
  requestBody?: never;
2888
3099
  responses: {
2889
- /** @description Chat credential metadata */
3100
+ /** @description Status */
2890
3101
  200: {
2891
3102
  headers: {
2892
3103
  [name: string]: unknown;
2893
3104
  };
2894
3105
  content: {
2895
- "application/json": components["schemas"]["ChatCredentialsWrapper"];
2896
- };
2897
- };
2898
- /** @description Forbidden */
2899
- 403: {
2900
- headers: {
2901
- [name: string]: unknown;
2902
- };
2903
- content: {
2904
- "application/json": components["schemas"]["Error"];
3106
+ "application/json": components["schemas"]["GithubEnterpriseStatus"];
2905
3107
  };
2906
3108
  };
2907
- /** @description Not found, or chat-credential minting disabled */
2908
- 404: {
3109
+ /** @description Unauthorized */
3110
+ 401: {
2909
3111
  headers: {
2910
3112
  [name: string]: unknown;
2911
3113
  };
@@ -2913,8 +3115,8 @@ export interface paths {
2913
3115
  "application/json": components["schemas"]["Error"];
2914
3116
  };
2915
3117
  };
2916
- /** @description Chat service not configured */
2917
- 503: {
3118
+ /** @description Forbidden (non-admin caller) */
3119
+ 403: {
2918
3120
  headers: {
2919
3121
  [name: string]: unknown;
2920
3122
  };
@@ -2925,32 +3127,47 @@ export interface paths {
2925
3127
  };
2926
3128
  };
2927
3129
  put?: never;
3130
+ post?: never;
3131
+ delete?: never;
3132
+ options?: never;
3133
+ head?: never;
3134
+ patch?: never;
3135
+ trace?: never;
3136
+ };
3137
+ "/github-enterprise/apps/{role}": {
3138
+ parameters: {
3139
+ query?: never;
3140
+ header?: never;
3141
+ path?: never;
3142
+ cookie?: never;
3143
+ };
3144
+ get?: never;
2928
3145
  /**
2929
- * Mint a chat credential
2930
- * @description Mints a chat-service token scoped to the agent in the path. `*` or `platform.ops` callers only — never the agent's own key. The body is closed: an `agentId` field is rejected with 400, so an unrestricted chat admin token cannot be minted here. The raw token is returned once and is never logged or stored by admin. 404 unless SHIPWRIGHT_CHAT_TOKEN_MINT_ENABLED is `enabled`.
3146
+ * Create or replace the App for a role
3147
+ * @description Admin-only. Stores the App id, slug, enterprise slug (installer) and the encrypted private key, and resets validation state. 422 when SHIPWRIGHT_ENCRYPTION_KEY is not configured.
2931
3148
  */
2932
- post: {
3149
+ put: {
2933
3150
  parameters: {
2934
3151
  query?: never;
2935
3152
  header?: never;
2936
3153
  path: {
2937
- id: string;
3154
+ role: "installer" | "lookup";
2938
3155
  };
2939
3156
  cookie?: never;
2940
3157
  };
2941
3158
  requestBody?: {
2942
3159
  content: {
2943
- "application/json": components["schemas"]["CreateChatCredentialBody"];
3160
+ "application/json": components["schemas"]["PutGithubEnterpriseAppBody"];
2944
3161
  };
2945
3162
  };
2946
3163
  responses: {
2947
- /** @description Credential minted (raw token returned once) */
2948
- 201: {
3164
+ /** @description Saved (metadata only) */
3165
+ 200: {
2949
3166
  headers: {
2950
3167
  [name: string]: unknown;
2951
3168
  };
2952
3169
  content: {
2953
- "application/json": components["schemas"]["CreateChatCredentialResponse"];
3170
+ "application/json": components["schemas"]["GithubEnterpriseApp"];
2954
3171
  };
2955
3172
  };
2956
3173
  /** @description Bad request */
@@ -2962,8 +3179,8 @@ export interface paths {
2962
3179
  "application/json": components["schemas"]["Error"];
2963
3180
  };
2964
3181
  };
2965
- /** @description Forbidden */
2966
- 403: {
3182
+ /** @description Unauthorized */
3183
+ 401: {
2967
3184
  headers: {
2968
3185
  [name: string]: unknown;
2969
3186
  };
@@ -2971,8 +3188,8 @@ export interface paths {
2971
3188
  "application/json": components["schemas"]["Error"];
2972
3189
  };
2973
3190
  };
2974
- /** @description Not found, or chat-credential minting disabled */
2975
- 404: {
3191
+ /** @description Forbidden (non-admin caller) */
3192
+ 403: {
2976
3193
  headers: {
2977
3194
  [name: string]: unknown;
2978
3195
  };
@@ -2980,8 +3197,8 @@ export interface paths {
2980
3197
  "application/json": components["schemas"]["Error"];
2981
3198
  };
2982
3199
  };
2983
- /** @description Chat service not configured */
2984
- 503: {
3200
+ /** @description Invalid key, or encryption unavailable */
3201
+ 422: {
2985
3202
  headers: {
2986
3203
  [name: string]: unknown;
2987
3204
  };
@@ -2991,56 +3208,31 @@ export interface paths {
2991
3208
  };
2992
3209
  };
2993
3210
  };
2994
- delete?: never;
2995
- options?: never;
2996
- head?: never;
2997
- patch?: never;
2998
- trace?: never;
2999
- };
3000
- "/agents/{id}/chat-credentials/{tokenId}": {
3001
- parameters: {
3002
- query?: never;
3003
- header?: never;
3004
- path?: never;
3005
- cookie?: never;
3006
- };
3007
- get?: never;
3008
- put?: never;
3009
3211
  post?: never;
3010
3212
  /**
3011
- * Revoke a chat credential
3012
- * @description Revokes a chat-service token. 404 when the token is not scoped to the agent in the path. `*` or `platform.ops` callers only.
3213
+ * Remove the App for a role
3214
+ * @description Admin-only. No-op when the role is not configured.
3013
3215
  */
3014
3216
  delete: {
3015
3217
  parameters: {
3016
3218
  query?: never;
3017
3219
  header?: never;
3018
3220
  path: {
3019
- id: string;
3020
- tokenId: string;
3221
+ role: "installer" | "lookup";
3021
3222
  };
3022
3223
  cookie?: never;
3023
3224
  };
3024
3225
  requestBody?: never;
3025
3226
  responses: {
3026
- /** @description Credential revoked */
3227
+ /** @description Removed */
3027
3228
  204: {
3028
3229
  headers: {
3029
3230
  [name: string]: unknown;
3030
3231
  };
3031
3232
  content?: never;
3032
3233
  };
3033
- /** @description Forbidden */
3034
- 403: {
3035
- headers: {
3036
- [name: string]: unknown;
3037
- };
3038
- content: {
3039
- "application/json": components["schemas"]["Error"];
3040
- };
3041
- };
3042
- /** @description Not found, or chat-credential minting disabled */
3043
- 404: {
3234
+ /** @description Unauthorized */
3235
+ 401: {
3044
3236
  headers: {
3045
3237
  [name: string]: unknown;
3046
3238
  };
@@ -3048,8 +3240,8 @@ export interface paths {
3048
3240
  "application/json": components["schemas"]["Error"];
3049
3241
  };
3050
3242
  };
3051
- /** @description Chat service not configured */
3052
- 503: {
3243
+ /** @description Forbidden (non-admin caller) */
3244
+ 403: {
3053
3245
  headers: {
3054
3246
  [name: string]: unknown;
3055
3247
  };
@@ -3064,7 +3256,7 @@ export interface paths {
3064
3256
  patch?: never;
3065
3257
  trace?: never;
3066
3258
  };
3067
- "/agents/{id}/crons/{cronId}/run-now": {
3259
+ "/github-enterprise/apps/{role}/validate": {
3068
3260
  parameters: {
3069
3261
  query?: never;
3070
3262
  header?: never;
@@ -3074,32 +3266,31 @@ export interface paths {
3074
3266
  get?: never;
3075
3267
  put?: never;
3076
3268
  /**
3077
- * Request an immediate run of a cron job
3078
- * @description Asks the agent's runtime to run the cron job once, now, with the job's own stored prompt. Takes no request body (any body is 400). Stamps `runRequestedAt` on the job and writes an AgentCronRunRequest audit row before returning 202; the runtime honours a fresh request (under 15 minutes old) once on its next cron sync. Callers: `*`, `platform.ops`, or the agent's own key. 404 unless SHIPWRIGHT_CRON_RUN_NOW_ENABLED is `enabled`; 409 when the trial-expiry lockdown disabled the cron.
3269
+ * Validate the App for a role
3270
+ * @description Admin-only. Authenticates as the App and checks the required permission (installer: enterprise_organization_installations write; lookup: metadata read). The outcome is persisted and returned; GitHub failures are reported as status=error with a generic message.
3079
3271
  */
3080
3272
  post: {
3081
3273
  parameters: {
3082
3274
  query?: never;
3083
3275
  header?: never;
3084
3276
  path: {
3085
- id: string;
3086
- cronId: string;
3277
+ role: "installer" | "lookup";
3087
3278
  };
3088
3279
  cookie?: never;
3089
3280
  };
3090
3281
  requestBody?: never;
3091
3282
  responses: {
3092
- /** @description Run requested */
3093
- 202: {
3283
+ /** @description Validation outcome */
3284
+ 200: {
3094
3285
  headers: {
3095
3286
  [name: string]: unknown;
3096
3287
  };
3097
3288
  content: {
3098
- "application/json": components["schemas"]["CronRunNowResponse"];
3289
+ "application/json": components["schemas"]["GithubEnterpriseValidateResult"];
3099
3290
  };
3100
3291
  };
3101
- /** @description A request body was sent */
3102
- 400: {
3292
+ /** @description Unauthorized */
3293
+ 401: {
3103
3294
  headers: {
3104
3295
  [name: string]: unknown;
3105
3296
  };
@@ -3107,7 +3298,7 @@ export interface paths {
3107
3298
  "application/json": components["schemas"]["Error"];
3108
3299
  };
3109
3300
  };
3110
- /** @description Caller not allowed */
3301
+ /** @description Forbidden (non-admin caller) */
3111
3302
  403: {
3112
3303
  headers: {
3113
3304
  [name: string]: unknown;
@@ -3116,7 +3307,7 @@ export interface paths {
3116
3307
  "application/json": components["schemas"]["Error"];
3117
3308
  };
3118
3309
  };
3119
- /** @description Cron not found, or cron run-now disabled */
3310
+ /** @description Role not configured */
3120
3311
  404: {
3121
3312
  headers: {
3122
3313
  [name: string]: unknown;
@@ -3125,15 +3316,6 @@ export interface paths {
3125
3316
  "application/json": components["schemas"]["Error"];
3126
3317
  };
3127
3318
  };
3128
- /** @description Cron disabled by lockdown */
3129
- 409: {
3130
- headers: {
3131
- [name: string]: unknown;
3132
- };
3133
- content: {
3134
- "application/json": components["schemas"]["Error"];
3135
- };
3136
- };
3137
3319
  };
3138
3320
  };
3139
3321
  delete?: never;
@@ -3142,45 +3324,39 @@ export interface paths {
3142
3324
  patch?: never;
3143
3325
  trace?: never;
3144
3326
  };
3145
- "/agents/{id}/ask": {
3327
+ "/github-enterprise/orgs": {
3146
3328
  parameters: {
3147
3329
  query?: never;
3148
3330
  header?: never;
3149
3331
  path?: never;
3150
3332
  cookie?: never;
3151
3333
  };
3152
- get?: never;
3153
- put?: never;
3154
3334
  /**
3155
- * Ask another agent a question
3156
- * @description Posts `question` from agent `from` into a new `kind: ask` chat thread of agent `{id}` (always created with `askDepth: 1`), then, when `waitMs > 0`, polls once per second until the agent replies or the budget ends. Callers: `*`, `platform.ops`, or the agent key whose id equals `from` (never impersonation). The `from>{id}` pair must be on SHIPWRIGHT_AGENT_ASK_ALLOWLIST. Every ask writes an AgentAsk audit row (no question text). 404 unless SHIPWRIGHT_AGENT_ASK_ENABLED is `enabled`; 503 when the chat service is not configured.
3335
+ * List installable organizations
3336
+ * @description Admin-only. Lists the enterprise's installable organizations, whether each has the lookup App installed, and (with agentId) whether each has that agent's App installed. Returns configured=false and no orgs when the installer App is not set.
3157
3337
  */
3158
- post: {
3338
+ get: {
3159
3339
  parameters: {
3160
- query?: never;
3161
- header?: never;
3162
- path: {
3163
- id: string;
3340
+ query?: {
3341
+ agentId?: string;
3164
3342
  };
3343
+ header?: never;
3344
+ path?: never;
3165
3345
  cookie?: never;
3166
3346
  };
3167
- requestBody?: {
3168
- content: {
3169
- "application/json": components["schemas"]["AgentAskBody"];
3170
- };
3171
- };
3347
+ requestBody?: never;
3172
3348
  responses: {
3173
- /** @description Ask posted; `replied` with the reply, or `pending` */
3174
- 201: {
3349
+ /** @description Organizations */
3350
+ 200: {
3175
3351
  headers: {
3176
3352
  [name: string]: unknown;
3177
3353
  };
3178
3354
  content: {
3179
- "application/json": components["schemas"]["AgentAskResponse"];
3355
+ "application/json": components["schemas"]["GithubEnterpriseOrgs"];
3180
3356
  };
3181
3357
  };
3182
- /** @description Bad request (including depth other than 1) */
3183
- 400: {
3358
+ /** @description Unauthorized */
3359
+ 401: {
3184
3360
  headers: {
3185
3361
  [name: string]: unknown;
3186
3362
  };
@@ -3188,7 +3364,7 @@ export interface paths {
3188
3364
  "application/json": components["schemas"]["Error"];
3189
3365
  };
3190
3366
  };
3191
- /** @description Caller not allowed, or the pair is not allowlisted */
3367
+ /** @description Forbidden (non-admin caller) */
3192
3368
  403: {
3193
3369
  headers: {
3194
3370
  [name: string]: unknown;
@@ -3197,7 +3373,7 @@ export interface paths {
3197
3373
  "application/json": components["schemas"]["Error"];
3198
3374
  };
3199
3375
  };
3200
- /** @description Agent not found, or agent ask disabled */
3376
+ /** @description Not found (or not found at GitHub) */
3201
3377
  404: {
3202
3378
  headers: {
3203
3379
  [name: string]: unknown;
@@ -3206,8 +3382,8 @@ export interface paths {
3206
3382
  "application/json": components["schemas"]["Error"];
3207
3383
  };
3208
3384
  };
3209
- /** @description Chat service not configured */
3210
- 503: {
3385
+ /** @description Refused or rejected by GitHub */
3386
+ 422: {
3211
3387
  headers: {
3212
3388
  [name: string]: unknown;
3213
3389
  };
@@ -3215,50 +3391,17 @@ export interface paths {
3215
3391
  "application/json": components["schemas"]["Error"];
3216
3392
  };
3217
3393
  };
3218
- };
3219
- };
3220
- delete?: never;
3221
- options?: never;
3222
- head?: never;
3223
- patch?: never;
3224
- trace?: never;
3225
- };
3226
- "/agents/{id}/asks": {
3227
- parameters: {
3228
- query?: never;
3229
- header?: never;
3230
- path?: never;
3231
- cookie?: never;
3232
- };
3233
- /**
3234
- * List agent asks
3235
- * @description Lists the AgentAsk audit rows the agent sent or received, newest first. `*`, `platform.read` and `platform.ops` callers only. 404 unless SHIPWRIGHT_AGENT_ASK_ENABLED is `enabled`.
3236
- */
3237
- get: {
3238
- parameters: {
3239
- query?: {
3240
- limit?: number;
3241
- offset?: number | null;
3242
- };
3243
- header?: never;
3244
- path: {
3245
- id: string;
3246
- };
3247
- cookie?: never;
3248
- };
3249
- requestBody?: never;
3250
- responses: {
3251
- /** @description Audit rows */
3252
- 200: {
3394
+ /** @description GitHub refused the configured App credentials or permission */
3395
+ 424: {
3253
3396
  headers: {
3254
3397
  [name: string]: unknown;
3255
3398
  };
3256
3399
  content: {
3257
- "application/json": components["schemas"]["AgentAskList"];
3400
+ "application/json": components["schemas"]["Error"];
3258
3401
  };
3259
3402
  };
3260
- /** @description Bad request */
3261
- 400: {
3403
+ /** @description GitHub rate limit */
3404
+ 429: {
3262
3405
  headers: {
3263
3406
  [name: string]: unknown;
3264
3407
  };
@@ -3266,8 +3409,8 @@ export interface paths {
3266
3409
  "application/json": components["schemas"]["Error"];
3267
3410
  };
3268
3411
  };
3269
- /** @description Forbidden */
3270
- 403: {
3412
+ /** @description GitHub unavailable or returned an unexpected response */
3413
+ 502: {
3271
3414
  headers: {
3272
3415
  [name: string]: unknown;
3273
3416
  };
@@ -3275,8 +3418,8 @@ export interface paths {
3275
3418
  "application/json": components["schemas"]["Error"];
3276
3419
  };
3277
3420
  };
3278
- /** @description Agent ask disabled */
3279
- 404: {
3421
+ /** @description GitHub unreachable */
3422
+ 504: {
3280
3423
  headers: {
3281
3424
  [name: string]: unknown;
3282
3425
  };
@@ -3294,70 +3437,72 @@ export interface paths {
3294
3437
  patch?: never;
3295
3438
  trace?: never;
3296
3439
  };
3297
- "/agents/{id}/marketplaces": {
3440
+ "/github-enterprise/orgs/{org}/install": {
3298
3441
  parameters: {
3299
3442
  query?: never;
3300
3443
  header?: never;
3301
3444
  path?: never;
3302
3445
  cookie?: never;
3303
3446
  };
3447
+ get?: never;
3448
+ put?: never;
3304
3449
  /**
3305
- * List marketplaces
3306
- * @description Returns every remote plugin marketplace configured for the agent.
3450
+ * Install an agent's App on an organization
3451
+ * @description Admin-only. Resolves the agent's stored GH_APP_SLUG, looks the App up through the public GET /apps/{slug} to get its client id, and installs it on the org with the installer App. 422 for an agent with no slug and for a private App (not visible to the public lookup); 409 when the installer App is not configured.
3307
3452
  */
3308
- get: {
3453
+ post: {
3309
3454
  parameters: {
3310
3455
  query?: never;
3311
3456
  header?: never;
3312
3457
  path: {
3313
- id: string;
3458
+ org: string;
3314
3459
  };
3315
3460
  cookie?: never;
3316
3461
  };
3317
- requestBody?: never;
3462
+ requestBody?: {
3463
+ content: {
3464
+ "application/json": components["schemas"]["GithubEnterpriseInstallBody"];
3465
+ };
3466
+ };
3318
3467
  responses: {
3319
- /** @description List of marketplaces */
3468
+ /** @description Installed (or already installed) */
3320
3469
  200: {
3321
3470
  headers: {
3322
3471
  [name: string]: unknown;
3323
3472
  };
3324
3473
  content: {
3325
- "application/json": components["schemas"]["MarketplacesWrapper"];
3474
+ "application/json": components["schemas"]["GithubEnterpriseInstallResult"];
3326
3475
  };
3327
3476
  };
3328
- };
3329
- };
3330
- put?: never;
3331
- /**
3332
- * Add or update a marketplace
3333
- * @description Upserts a remote plugin marketplace by `name`. `source` must be a GitHub `owner/repo` or an https git URL (no credentials); `ref` optionally pins a branch, tag or sha. 422 on an invalid `name`, `source` or `ref`.
3334
- */
3335
- post: {
3336
- parameters: {
3337
- query?: never;
3338
- header?: never;
3339
- path: {
3340
- id: string;
3477
+ /** @description Bad request */
3478
+ 400: {
3479
+ headers: {
3480
+ [name: string]: unknown;
3481
+ };
3482
+ content: {
3483
+ "application/json": components["schemas"]["Error"];
3484
+ };
3341
3485
  };
3342
- cookie?: never;
3343
- };
3344
- requestBody?: {
3345
- content: {
3346
- "application/json": components["schemas"]["UpsertAgentMarketplaceBody"];
3486
+ /** @description Unauthorized */
3487
+ 401: {
3488
+ headers: {
3489
+ [name: string]: unknown;
3490
+ };
3491
+ content: {
3492
+ "application/json": components["schemas"]["Error"];
3493
+ };
3347
3494
  };
3348
- };
3349
- responses: {
3350
- /** @description Marketplace added or updated */
3351
- 201: {
3495
+ /** @description Forbidden (non-admin caller) */
3496
+ 403: {
3352
3497
  headers: {
3353
3498
  [name: string]: unknown;
3354
3499
  };
3355
3500
  content: {
3356
- "application/json": components["schemas"]["MarketplaceWrapper"];
3501
+ "application/json": components["schemas"]["Error"];
3357
3502
  };
3358
3503
  };
3359
- /** @description Bad request */
3360
- 400: {
3504
+ /** @description Not found (or not found at GitHub) */
3505
+ 404: {
3361
3506
  headers: {
3362
3507
  [name: string]: unknown;
3363
3508
  };
@@ -3365,7 +3510,16 @@ export interface paths {
3365
3510
  "application/json": components["schemas"]["Error"];
3366
3511
  };
3367
3512
  };
3368
- /** @description Invalid name, source or ref */
3513
+ /** @description Installer App not configured */
3514
+ 409: {
3515
+ headers: {
3516
+ [name: string]: unknown;
3517
+ };
3518
+ content: {
3519
+ "application/json": components["schemas"]["Error"];
3520
+ };
3521
+ };
3522
+ /** @description Refused or rejected by GitHub */
3369
3523
  422: {
3370
3524
  headers: {
3371
3525
  [name: string]: unknown;
@@ -3374,49 +3528,35 @@ export interface paths {
3374
3528
  "application/json": components["schemas"]["Error"];
3375
3529
  };
3376
3530
  };
3377
- };
3378
- };
3379
- delete?: never;
3380
- options?: never;
3381
- head?: never;
3382
- patch?: never;
3383
- trace?: never;
3384
- };
3385
- "/agents/{id}/marketplaces/{marketplaceId}": {
3386
- parameters: {
3387
- query?: never;
3388
- header?: never;
3389
- path?: never;
3390
- cookie?: never;
3391
- };
3392
- get?: never;
3393
- put?: never;
3394
- post?: never;
3395
- /**
3396
- * Remove a marketplace
3397
- * @description Removes the marketplace row by id. 404 when the id does not exist or belongs to a different agent.
3398
- */
3399
- delete: {
3400
- parameters: {
3401
- query?: never;
3402
- header?: never;
3403
- path: {
3404
- id: string;
3405
- marketplaceId: string;
3531
+ /** @description GitHub refused the configured App credentials or permission */
3532
+ 424: {
3533
+ headers: {
3534
+ [name: string]: unknown;
3535
+ };
3536
+ content: {
3537
+ "application/json": components["schemas"]["Error"];
3538
+ };
3406
3539
  };
3407
- cookie?: never;
3408
- };
3409
- requestBody?: never;
3410
- responses: {
3411
- /** @description Marketplace removed */
3412
- 204: {
3540
+ /** @description GitHub rate limit */
3541
+ 429: {
3413
3542
  headers: {
3414
3543
  [name: string]: unknown;
3415
3544
  };
3416
- content?: never;
3545
+ content: {
3546
+ "application/json": components["schemas"]["Error"];
3547
+ };
3417
3548
  };
3418
- /** @description Marketplace not found */
3419
- 404: {
3549
+ /** @description GitHub unavailable or returned an unexpected response */
3550
+ 502: {
3551
+ headers: {
3552
+ [name: string]: unknown;
3553
+ };
3554
+ content: {
3555
+ "application/json": components["schemas"]["Error"];
3556
+ };
3557
+ };
3558
+ /** @description GitHub unreachable */
3559
+ 504: {
3420
3560
  headers: {
3421
3561
  [name: string]: unknown;
3422
3562
  };
@@ -3426,6 +3566,7 @@ export interface paths {
3426
3566
  };
3427
3567
  };
3428
3568
  };
3569
+ delete?: never;
3429
3570
  options?: never;
3430
3571
  head?: never;
3431
3572
  patch?: never;
@@ -3494,10 +3635,12 @@ export interface components {
3494
3635
  trialExpiryWarnedAt?: string | null;
3495
3636
  /** @example octocat */
3496
3637
  githubUsername?: string | null;
3497
- /** @example [
3638
+ /**
3639
+ * @example [
3498
3640
  * "example-marketplace",
3499
3641
  * "shipwright"
3500
- * ] */
3642
+ * ]
3643
+ */
3501
3644
  bakedMarketplaces?: string[];
3502
3645
  /** @example true */
3503
3646
  autoPostReviews: boolean;
@@ -3616,13 +3759,13 @@ export interface components {
3616
3759
  name: string;
3617
3760
  /** @example false */
3618
3761
  selfHosted: boolean;
3619
- /** @example coding */
3762
+ /** @example specialist */
3620
3763
  specialty: string;
3621
3764
  };
3622
3765
  CreateAgentBody: {
3623
3766
  /** @example Bodhi */
3624
3767
  name: string;
3625
- /** @example coding */
3768
+ /** @example specialist */
3626
3769
  specialty: string;
3627
3770
  /** @example in-cluster */
3628
3771
  runtime?: string;
@@ -3681,13 +3824,6 @@ export interface components {
3681
3824
  CronWrapper: {
3682
3825
  cron: components["schemas"]["AgentCronJob"];
3683
3826
  };
3684
- CronRunNowResponse: {
3685
- /**
3686
- * Format: date-time
3687
- * @example 2026-10-26T12:00:00.000Z
3688
- */
3689
- requestedAt: string;
3690
- };
3691
3827
  AgentCronJob: {
3692
3828
  /** @example clx1234567890 */
3693
3829
  id: string;
@@ -4125,8 +4261,122 @@ export interface components {
4125
4261
  /** @example ci-runner */
4126
4262
  label?: string;
4127
4263
  };
4128
- TokensWrapper: {
4129
- tokens: components["schemas"]["AgentToken"][];
4264
+ TokensWrapper: {
4265
+ tokens: components["schemas"]["AgentToken"][];
4266
+ };
4267
+ CreateChatCredentialResponse: {
4268
+ /** @example clx0987654321 */
4269
+ tokenId: string;
4270
+ /** @example ct_xxxxxxxxxxxxxxxxxxxxxxxx */
4271
+ rawToken: string;
4272
+ /** @example ask-caller */
4273
+ label: string;
4274
+ /** @example clx1234567890 */
4275
+ agentId: string;
4276
+ };
4277
+ CreateChatCredentialBody: {
4278
+ /** @example ask-caller */
4279
+ label: string;
4280
+ };
4281
+ ChatCredentialsWrapper: {
4282
+ credentials: components["schemas"]["ChatCredential"][];
4283
+ };
4284
+ ChatCredential: {
4285
+ /** @example clx0987654321 */
4286
+ tokenId: string;
4287
+ /** @example ask-caller */
4288
+ label: string | null;
4289
+ /** @example clx1234567890 */
4290
+ agentId: string;
4291
+ };
4292
+ AgentAskResponse: {
4293
+ /** @example clx1111111111 */
4294
+ askId: string;
4295
+ /** @example clx2222222222 */
4296
+ threadId: string;
4297
+ /**
4298
+ * @example pending
4299
+ * @enum {string}
4300
+ */
4301
+ status: "replied" | "pending";
4302
+ /**
4303
+ * @description The agent's reply body; present only when status is `replied`.
4304
+ * @example acme/web is deployed and green.
4305
+ */
4306
+ reply?: string;
4307
+ };
4308
+ AgentAskBody: {
4309
+ /**
4310
+ * @description Id of the asking agent. An agent key may only ask as itself (`from` must equal its own id).
4311
+ * @example clx0987654321
4312
+ */
4313
+ from: string;
4314
+ /**
4315
+ * @description The question, posted as the thread's user message. Never stored or logged by admin.
4316
+ * @example What is the deploy status of acme/web?
4317
+ */
4318
+ question: string;
4319
+ /**
4320
+ * @description How long to wait for the reply, polling once per second. 0 (default) returns `pending` immediately.
4321
+ * @default 0
4322
+ * @example 0
4323
+ */
4324
+ waitMs: number;
4325
+ /**
4326
+ * @description Ask chain depth. Capped at 1: any other value is a 400.
4327
+ * @default 1
4328
+ * @example 1
4329
+ */
4330
+ depth: number;
4331
+ /**
4332
+ * @description How long the ask stays relevant, in seconds. Recorded on the audit row.
4333
+ * @default 600
4334
+ * @example 600
4335
+ */
4336
+ ttlSeconds: number;
4337
+ };
4338
+ AgentAskList: {
4339
+ asks: components["schemas"]["AgentAskRecord"][];
4340
+ /** @example 1 */
4341
+ total: number;
4342
+ /** @example 50 */
4343
+ limit: number;
4344
+ /** @example 0 */
4345
+ offset: number;
4346
+ };
4347
+ AgentAskRecord: {
4348
+ /** @example clx1111111111 */
4349
+ id: string;
4350
+ /** @example clx0987654321 */
4351
+ fromAgentId: string;
4352
+ /** @example clx1234567890 */
4353
+ toAgentId: string;
4354
+ /** @example clx2222222222 */
4355
+ threadId: string | null;
4356
+ /** @example 1 */
4357
+ depth: number;
4358
+ /** @example 0 */
4359
+ waitMs: number;
4360
+ /** @example 600 */
4361
+ ttlSeconds: number;
4362
+ /**
4363
+ * @description created | pending | replied | failed
4364
+ * @example pending
4365
+ */
4366
+ status: string;
4367
+ /** @example ops (platform.ops) [platform-ops] */
4368
+ callerLabel: string;
4369
+ /** @example 2026-10-25T12:00:00.000Z */
4370
+ createdAt: string;
4371
+ /** @example null */
4372
+ repliedAt: string | null;
4373
+ };
4374
+ CronRunNowResponse: {
4375
+ /**
4376
+ * Format: date-time
4377
+ * @example 2026-10-26T12:00:00.000Z
4378
+ */
4379
+ requestedAt: string;
4130
4380
  };
4131
4381
  CronRunTranscriptUploadResult: {
4132
4382
  /** @example clx1111111111 */
@@ -4213,39 +4463,44 @@ export interface components {
4213
4463
  /** @example 1.3.0 */
4214
4464
  version?: string | null;
4215
4465
  };
4216
- PhaseMethodologyListWrapper: {
4217
- phaseMethodology: components["schemas"]["AgentPhaseMethodology"][];
4466
+ MarketplacesWrapper: {
4467
+ marketplaces: components["schemas"]["AgentMarketplace"][];
4218
4468
  };
4219
- AgentPhaseMethodology: {
4469
+ AgentMarketplace: {
4220
4470
  /** @example clx1234567890 */
4221
4471
  id: string;
4222
4472
  /** @example clx1234567890 */
4223
4473
  agentId: string;
4474
+ /** @example shipwright */
4475
+ name: string;
4476
+ /** @example app-vitals/shipwright */
4477
+ source: string;
4478
+ /** @example main */
4479
+ ref: string | null;
4224
4480
  /**
4225
- * @example review
4226
- * @enum {string}
4481
+ * Format: date-time
4482
+ * @example 2026-01-01T00:00:00.000Z
4227
4483
  */
4228
- phase:
4229
- | "prd"
4230
- | "plan-session"
4231
- | "review"
4232
- | "patch"
4233
- | "deploy"
4234
- | "dev-task";
4235
- /** @example shipwright:code-reviewer */
4236
- subagentType: string | null;
4484
+ createdAt: string;
4237
4485
  /**
4238
4486
  * Format: date-time
4239
4487
  * @example 2026-01-01T00:00:00.000Z
4240
4488
  */
4241
4489
  updatedAt: string;
4242
4490
  };
4243
- PhaseMethodologyWrapper: {
4244
- phaseMethodology: components["schemas"]["AgentPhaseMethodology"];
4491
+ MarketplaceWrapper: {
4492
+ marketplace: components["schemas"]["AgentMarketplace"];
4245
4493
  };
4246
- PutAgentPhaseMethodologyBody: {
4247
- /** @example shipwright:code-reviewer */
4248
- subagentType: string | null;
4494
+ UpsertAgentMarketplaceBody: {
4495
+ /** @example shipwright */
4496
+ name: string;
4497
+ /**
4498
+ * @description GitHub `owner/repo` or an https git URL
4499
+ * @example app-vitals/shipwright
4500
+ */
4501
+ source: string;
4502
+ /** @example main */
4503
+ ref?: string | null;
4249
4504
  };
4250
4505
  CronRunTokenStats: {
4251
4506
  totals: components["schemas"]["TokenAggregate"];
@@ -4416,55 +4671,6 @@ export interface components {
4416
4671
  /** @example 0.0012 */
4417
4672
  costUsd: number;
4418
4673
  };
4419
- WorkQueueSnapshotWrapper: {
4420
- snapshot: components["schemas"]["AgentWorkQueueSnapshot"];
4421
- };
4422
- AgentWorkQueueSnapshot: {
4423
- /** @example clx1234567890 */
4424
- id: string;
4425
- /** @example clx1234567890 */
4426
- agentId: string;
4427
- /**
4428
- * Format: date-time
4429
- * @example 2026-01-01T00:00:00.000Z
4430
- */
4431
- computedAt: string;
4432
- items: components["schemas"]["RankedWorkItem"][];
4433
- /**
4434
- * Format: date-time
4435
- * @example 2026-01-01T00:00:00.000Z
4436
- */
4437
- createdAt: string;
4438
- };
4439
- RankedWorkItem: {
4440
- /**
4441
- * @example task
4442
- * @enum {string}
4443
- */
4444
- type: "task" | "pr";
4445
- /** @example WLS-2.2 */
4446
- id: string;
4447
- /** @example Add work queue snapshot endpoints */
4448
- title?: string;
4449
- /**
4450
- * @example dev-task
4451
- * @enum {string}
4452
- */
4453
- phase: "dev-task" | "plan" | "review" | "patch" | "deploy";
4454
- /**
4455
- * @description ISO timestamp
4456
- * @example 2026-01-01T00:00:00.000Z
4457
- */
4458
- age: string;
4459
- };
4460
- PushWorkQueueSnapshotBody: {
4461
- /**
4462
- * Format: date-time
4463
- * @example 2026-01-01T00:00:00.000Z
4464
- */
4465
- computedAt: string;
4466
- items: components["schemas"]["RankedWorkItem"][];
4467
- };
4468
4674
  GitHubInstallationsSnapshotWrapper: {
4469
4675
  snapshot: components["schemas"]["AgentGitHubInstallationsSnapshot"];
4470
4676
  };
@@ -4521,14 +4727,15 @@ export interface components {
4521
4727
  */
4522
4728
  error?: "not_found" | "forbidden" | "rate_limited" | "network";
4523
4729
  };
4524
- PutBakedMarketplacesBody: {
4730
+ PutGitHubInstallationsBody: {
4525
4731
  /**
4526
- * @example [
4527
- * "example-marketplace",
4528
- * "shipwright"
4529
- * ]
4732
+ * Format: date-time
4733
+ * @example 2026-01-01T00:00:00.000Z
4530
4734
  */
4531
- names: string[];
4735
+ reportedAt: string;
4736
+ installations: components["schemas"]["GitHubInstallation"][];
4737
+ /** @description Per-repo access probe result (COS-44.1). Omit to leave the stored result unchanged; send [] to clear it. */
4738
+ repos?: components["schemas"]["RepoAccessEntry"][];
4532
4739
  };
4533
4740
  BakedMarketplacesResult: {
4534
4741
  /**
@@ -4538,15 +4745,14 @@ export interface components {
4538
4745
  */
4539
4746
  bakedMarketplaces: string[];
4540
4747
  };
4541
- PutGitHubInstallationsBody: {
4748
+ PutBakedMarketplacesBody: {
4542
4749
  /**
4543
- * Format: date-time
4544
- * @example 2026-01-01T00:00:00.000Z
4750
+ * @example [
4751
+ * "example-marketplace",
4752
+ * "shipwright"
4753
+ * ]
4545
4754
  */
4546
- reportedAt: string;
4547
- installations: components["schemas"]["GitHubInstallation"][];
4548
- /** @description Per-repo access probe result (COS-44.1). Omit to leave the stored result unchanged; send [] to clear it. */
4549
- repos?: components["schemas"]["RepoAccessEntry"][];
4755
+ names: string[];
4550
4756
  };
4551
4757
  GithubAccessPreview: {
4552
4758
  /**
@@ -4641,11 +4847,11 @@ export interface components {
4641
4847
  trialExpiresAt?: string | null;
4642
4848
  /** @example active */
4643
4849
  accountStatus?: string | null;
4644
- /** @example coding */
4850
+ /** @example specialist */
4645
4851
  specialty: string;
4646
4852
  /**
4647
4853
  * @deprecated
4648
- * @example coding
4854
+ * @example specialist
4649
4855
  */
4650
4856
  typeName?: string;
4651
4857
  /**
@@ -4669,6 +4875,14 @@ export interface components {
4669
4875
  /** @example shipwright */
4670
4876
  plugin: string;
4671
4877
  };
4878
+ AgentConfigMarketplace: {
4879
+ /** @example shipwright */
4880
+ name: string;
4881
+ /** @example app-vitals/shipwright */
4882
+ source: string;
4883
+ /** @example main */
4884
+ ref: string | null;
4885
+ };
4672
4886
  AgentConfigFeatures: {
4673
4887
  /**
4674
4888
  * @description True when SHIPWRIGHT_TRANSCRIPT_API_ENABLED is on: the runtime uploads a redacted transcript after each cron run.
@@ -4685,159 +4899,87 @@ export interface components {
4685
4899
  /** @example Not found */
4686
4900
  error: string;
4687
4901
  };
4688
- CreateChatCredentialResponse: {
4689
- /** @example clx0987654321 */
4690
- tokenId: string;
4691
- /** @example ct_xxxxxxxxxxxxxxxxxxxxxxxx */
4692
- rawToken: string;
4693
- /** @example ask-caller */
4694
- label: string;
4695
- /** @example clx1234567890 */
4696
- agentId: string;
4697
- };
4698
- CreateChatCredentialBody: {
4699
- /** @example ask-caller */
4700
- label: string;
4701
- };
4702
- ChatCredentialsWrapper: {
4703
- credentials: components["schemas"]["ChatCredential"][];
4704
- };
4705
- ChatCredential: {
4706
- /** @example clx0987654321 */
4707
- tokenId: string;
4708
- /** @example ask-caller */
4709
- label: string | null;
4710
- /** @example clx1234567890 */
4711
- agentId: string;
4712
- };
4713
- AgentAskResponse: {
4714
- /** @example clx1111111111 */
4715
- askId: string;
4716
- /** @example clx2222222222 */
4717
- threadId: string;
4718
- /**
4719
- * @example pending
4720
- * @enum {string}
4721
- */
4722
- status: "replied" | "pending";
4723
- /**
4724
- * @description The agent's reply body; present only when status is `replied`.
4725
- * @example acme/web is deployed and green.
4726
- */
4727
- reply?: string;
4728
- };
4729
- AgentAskBody: {
4730
- /**
4731
- * @description Id of the asking agent. An agent key may only ask as itself (`from` must equal its own id).
4732
- * @example clx0987654321
4733
- */
4734
- from: string;
4735
- /**
4736
- * @description The question, posted as the thread's user message. Never stored or logged by admin.
4737
- * @example What is the deploy status of acme/web?
4738
- */
4739
- question: string;
4740
- /**
4741
- * @description How long to wait for the reply, polling once per second. 0 (default) returns `pending` immediately.
4742
- * @default 0
4743
- * @example 0
4744
- */
4745
- waitMs: number;
4746
- /**
4747
- * @description Ask chain depth. Capped at 1: any other value is a 400.
4748
- * @default 1
4749
- * @example 1
4750
- */
4751
- depth: number;
4902
+ GithubEnterpriseStatus: {
4903
+ configured: boolean;
4904
+ installer: components["schemas"]["GithubEnterpriseApp"];
4905
+ lookup: components["schemas"]["GithubEnterpriseApp"];
4906
+ };
4907
+ GithubEnterpriseApp: {
4908
+ /** @example installer */
4909
+ role: string;
4910
+ /** @example 12345 */
4911
+ appId: string;
4912
+ /** @example example-installer */
4913
+ slug: string;
4914
+ /** @example acme */
4915
+ enterpriseSlug: string | null;
4916
+ /** @description True when a private key is stored. The key is never returned. */
4917
+ keySet: boolean;
4918
+ /** @example valid */
4919
+ lastValidationStatus: string | null;
4920
+ lastValidatedAt: string | null;
4921
+ lastValidationError: string | null;
4922
+ createdAt: string;
4923
+ updatedAt: string;
4924
+ } | null;
4925
+ PutGithubEnterpriseAppBody: {
4926
+ /** @example 12345 */
4927
+ appId: string;
4928
+ /** @example example-installer */
4929
+ slug: string;
4752
4930
  /**
4753
- * @description How long the ask stays relevant, in seconds. Recorded on the audit row.
4754
- * @default 600
4755
- * @example 600
4931
+ * @description Required for the installer role.
4932
+ * @example acme
4756
4933
  */
4757
- ttlSeconds: number;
4758
- };
4759
- AgentAskList: {
4760
- asks: components["schemas"]["AgentAskRecord"][];
4761
- /** @example 1 */
4762
- total: number;
4763
- /** @example 50 */
4764
- limit: number;
4765
- /** @example 0 */
4766
- offset: number;
4934
+ enterpriseSlug?: string | null;
4935
+ /** @description PEM private key. Write-only: encrypted at rest, never returned. */
4936
+ privateKey: string;
4937
+ };
4938
+ GithubEnterpriseValidateResult: {
4939
+ role: string;
4940
+ ok: boolean;
4941
+ /** @enum {string} */
4942
+ status: "valid" | "missing_permission" | "error";
4943
+ requiredPermission: string;
4944
+ grantedPermissions: {
4945
+ [key: string]: string;
4946
+ };
4947
+ error: string | null;
4948
+ app: components["schemas"]["GithubEnterpriseApp"];
4949
+ };
4950
+ GithubEnterpriseOrgs: {
4951
+ configured: boolean;
4952
+ agentAppSlug?: string | null;
4953
+ orgs: {
4954
+ id: number;
4955
+ login: string;
4956
+ /** @description Null when no lookup App is configured. */
4957
+ lookupAppInstalled: boolean | null;
4958
+ /** @description Null when no agentId (or no slug) was given. */
4959
+ agentAppInstalled: boolean | null;
4960
+ }[];
4767
4961
  };
4768
- AgentAskRecord: {
4769
- /** @example clx1111111111 */
4770
- id: string;
4771
- /** @example clx0987654321 */
4772
- fromAgentId: string;
4773
- /** @example clx1234567890 */
4774
- toAgentId: string;
4775
- /** @example clx2222222222 */
4776
- threadId: string | null;
4777
- /** @example 1 */
4778
- depth: number;
4779
- /** @example 0 */
4780
- waitMs: number;
4781
- /** @example 600 */
4782
- ttlSeconds: number;
4783
- /**
4784
- * @description created | pending | replied | failed
4785
- * @example pending
4786
- */
4787
- status: string;
4788
- /** @example ops (platform.ops) [platform-ops] */
4789
- callerLabel: string;
4790
- /** @example 2026-10-25T12:00:00.000Z */
4791
- createdAt: string;
4792
- /** @example null */
4793
- repliedAt: string | null;
4962
+ GithubEnterpriseInstallResult: {
4963
+ org: string;
4964
+ /** @description False when the App was already installed. */
4965
+ created: boolean;
4966
+ installation: {
4967
+ id: number;
4968
+ appSlug: string;
4969
+ accountLogin: string;
4970
+ /** @enum {string} */
4971
+ repositorySelection: "all" | "selected" | "none";
4972
+ };
4794
4973
  };
4795
- AgentMarketplace: {
4796
- /** @example clx1234567890 */
4797
- id: string;
4798
- /** @example clx1234567890 */
4974
+ GithubEnterpriseInstallBody: {
4975
+ /** @example agent-id */
4799
4976
  agentId: string;
4800
- /** @example shipwright */
4801
- name: string;
4802
- /** @example app-vitals/shipwright */
4803
- source: string;
4804
- /** @example main */
4805
- ref: string | null;
4806
- /**
4807
- * Format: date-time
4808
- * @example 2026-01-01T00:00:00.000Z
4809
- */
4810
- createdAt: string;
4811
- /**
4812
- * Format: date-time
4813
- * @example 2026-01-01T00:00:00.000Z
4814
- */
4815
- updatedAt: string;
4816
- };
4817
- UpsertAgentMarketplaceBody: {
4818
- /** @example shipwright */
4819
- name: string;
4820
4977
  /**
4821
- * @description GitHub `owner/repo` or an https git URL
4822
- * @example app-vitals/shipwright
4978
+ * @default all
4979
+ * @enum {string}
4823
4980
  */
4824
- source: string;
4825
- /** @example main */
4826
- ref?: string | null;
4827
- };
4828
- MarketplaceWrapper: {
4829
- marketplace: components["schemas"]["AgentMarketplace"];
4830
- };
4831
- MarketplacesWrapper: {
4832
- marketplaces: components["schemas"]["AgentMarketplace"][];
4833
- };
4834
- AgentConfigMarketplace: {
4835
- /** @example shipwright */
4836
- name: string;
4837
- /** @example app-vitals/shipwright */
4838
- source: string;
4839
- /** @example main */
4840
- ref: string | null;
4981
+ repositorySelection: "all" | "selected" | "none";
4982
+ repositories?: string[];
4841
4983
  };
4842
4984
  };
4843
4985
  responses: never;