@vm0/cli 5.8.0 → 5.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +633 -316
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
- import { Command as Command36 } from "commander";
5
- import chalk37 from "chalk";
4
+ import { Command as Command40 } from "commander";
5
+ import chalk40 from "chalk";
6
6
 
7
7
  // src/lib/api/auth.ts
8
8
  import chalk from "chalk";
@@ -192,7 +192,7 @@ import { parse as parseYaml2 } from "yaml";
192
192
  import prompts from "prompts";
193
193
 
194
194
  // ../../packages/core/src/variable-expander.ts
195
- var VARIABLE_PATTERN = /\$\{\{\s*(env|vars|secrets)\.([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g;
195
+ var VARIABLE_PATTERN = /\$\{\{\s*(env|vars|secrets|credentials)\.([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g;
196
196
  function extractVariableReferencesFromString(value) {
197
197
  const refs = [];
198
198
  const matches = value.matchAll(VARIABLE_PATTERN);
@@ -237,7 +237,8 @@ function groupVariablesBySource(refs) {
237
237
  const groups = {
238
238
  env: [],
239
239
  vars: [],
240
- secrets: []
240
+ secrets: [],
241
+ credentials: []
241
242
  };
242
243
  for (const ref of refs) {
243
244
  groups[ref.source].push(ref);
@@ -1646,43 +1647,137 @@ var scopeContract = c9.router({
1646
1647
  }
1647
1648
  });
1648
1649
 
1649
- // ../../packages/core/src/contracts/sessions.ts
1650
+ // ../../packages/core/src/contracts/credentials.ts
1650
1651
  import { z as z12 } from "zod";
1651
1652
  var c10 = initContract();
1652
- var sessionResponseSchema = z12.object({
1653
- id: z12.string(),
1654
- agentComposeId: z12.string(),
1655
- agentComposeVersionId: z12.string().nullable(),
1656
- conversationId: z12.string().nullable(),
1657
- artifactName: z12.string().nullable(),
1658
- vars: z12.record(z12.string(), z12.string()).nullable(),
1659
- secretNames: z12.array(z12.string()).nullable(),
1660
- volumeVersions: z12.record(z12.string(), z12.string()).nullable(),
1653
+ var credentialNameSchema = z12.string().min(1, "Credential name is required").max(255, "Credential name must be at most 255 characters").regex(
1654
+ /^[A-Z][A-Z0-9_]*$/,
1655
+ "Credential name must contain only uppercase letters, numbers, and underscores, and must start with a letter (e.g., MY_API_KEY)"
1656
+ );
1657
+ var credentialResponseSchema = z12.object({
1658
+ id: z12.string().uuid(),
1659
+ name: z12.string(),
1660
+ description: z12.string().nullable(),
1661
1661
  createdAt: z12.string(),
1662
1662
  updatedAt: z12.string()
1663
1663
  });
1664
- var agentComposeSnapshotSchema = z12.object({
1665
- agentComposeVersionId: z12.string(),
1666
- vars: z12.record(z12.string(), z12.string()).optional(),
1667
- secretNames: z12.array(z12.string()).optional()
1664
+ var credentialListResponseSchema = z12.object({
1665
+ credentials: z12.array(credentialResponseSchema)
1666
+ });
1667
+ var setCredentialRequestSchema = z12.object({
1668
+ name: credentialNameSchema,
1669
+ value: z12.string().min(1, "Credential value is required"),
1670
+ description: z12.string().max(1e3).optional()
1671
+ });
1672
+ var credentialsMainContract = c10.router({
1673
+ /**
1674
+ * GET /api/credentials
1675
+ * List all credentials for the current user's scope (metadata only)
1676
+ */
1677
+ list: {
1678
+ method: "GET",
1679
+ path: "/api/credentials",
1680
+ responses: {
1681
+ 200: credentialListResponseSchema,
1682
+ 401: apiErrorSchema,
1683
+ 500: apiErrorSchema
1684
+ },
1685
+ summary: "List all credentials (metadata only)"
1686
+ },
1687
+ /**
1688
+ * PUT /api/credentials
1689
+ * Create or update a credential
1690
+ */
1691
+ set: {
1692
+ method: "PUT",
1693
+ path: "/api/credentials",
1694
+ body: setCredentialRequestSchema,
1695
+ responses: {
1696
+ 200: credentialResponseSchema,
1697
+ 201: credentialResponseSchema,
1698
+ 400: apiErrorSchema,
1699
+ 401: apiErrorSchema,
1700
+ 500: apiErrorSchema
1701
+ },
1702
+ summary: "Create or update a credential"
1703
+ }
1704
+ });
1705
+ var credentialsByNameContract = c10.router({
1706
+ /**
1707
+ * GET /api/credentials/:name
1708
+ * Get a credential by name (metadata only)
1709
+ */
1710
+ get: {
1711
+ method: "GET",
1712
+ path: "/api/credentials/:name",
1713
+ pathParams: z12.object({
1714
+ name: credentialNameSchema
1715
+ }),
1716
+ responses: {
1717
+ 200: credentialResponseSchema,
1718
+ 401: apiErrorSchema,
1719
+ 404: apiErrorSchema,
1720
+ 500: apiErrorSchema
1721
+ },
1722
+ summary: "Get credential metadata by name"
1723
+ },
1724
+ /**
1725
+ * DELETE /api/credentials/:name
1726
+ * Delete a credential by name
1727
+ */
1728
+ delete: {
1729
+ method: "DELETE",
1730
+ path: "/api/credentials/:name",
1731
+ pathParams: z12.object({
1732
+ name: credentialNameSchema
1733
+ }),
1734
+ responses: {
1735
+ 204: z12.undefined(),
1736
+ 401: apiErrorSchema,
1737
+ 404: apiErrorSchema,
1738
+ 500: apiErrorSchema
1739
+ },
1740
+ summary: "Delete a credential"
1741
+ }
1742
+ });
1743
+
1744
+ // ../../packages/core/src/contracts/sessions.ts
1745
+ import { z as z13 } from "zod";
1746
+ var c11 = initContract();
1747
+ var sessionResponseSchema = z13.object({
1748
+ id: z13.string(),
1749
+ agentComposeId: z13.string(),
1750
+ agentComposeVersionId: z13.string().nullable(),
1751
+ conversationId: z13.string().nullable(),
1752
+ artifactName: z13.string().nullable(),
1753
+ vars: z13.record(z13.string(), z13.string()).nullable(),
1754
+ secretNames: z13.array(z13.string()).nullable(),
1755
+ volumeVersions: z13.record(z13.string(), z13.string()).nullable(),
1756
+ createdAt: z13.string(),
1757
+ updatedAt: z13.string()
1668
1758
  });
1669
- var artifactSnapshotSchema2 = z12.object({
1670
- artifactName: z12.string(),
1671
- artifactVersion: z12.string()
1759
+ var agentComposeSnapshotSchema = z13.object({
1760
+ agentComposeVersionId: z13.string(),
1761
+ vars: z13.record(z13.string(), z13.string()).optional(),
1762
+ secretNames: z13.array(z13.string()).optional()
1672
1763
  });
1673
- var volumeVersionsSnapshotSchema2 = z12.object({
1674
- versions: z12.record(z12.string(), z12.string())
1764
+ var artifactSnapshotSchema2 = z13.object({
1765
+ artifactName: z13.string(),
1766
+ artifactVersion: z13.string()
1675
1767
  });
1676
- var checkpointResponseSchema = z12.object({
1677
- id: z12.string(),
1678
- runId: z12.string(),
1679
- conversationId: z12.string(),
1768
+ var volumeVersionsSnapshotSchema2 = z13.object({
1769
+ versions: z13.record(z13.string(), z13.string())
1770
+ });
1771
+ var checkpointResponseSchema = z13.object({
1772
+ id: z13.string(),
1773
+ runId: z13.string(),
1774
+ conversationId: z13.string(),
1680
1775
  agentComposeSnapshot: agentComposeSnapshotSchema,
1681
1776
  artifactSnapshot: artifactSnapshotSchema2.nullable(),
1682
1777
  volumeVersionsSnapshot: volumeVersionsSnapshotSchema2.nullable(),
1683
- createdAt: z12.string()
1778
+ createdAt: z13.string()
1684
1779
  });
1685
- var sessionsByIdContract = c10.router({
1780
+ var sessionsByIdContract = c11.router({
1686
1781
  /**
1687
1782
  * GET /api/agent/sessions/:id
1688
1783
  * Get session by ID
@@ -1690,8 +1785,8 @@ var sessionsByIdContract = c10.router({
1690
1785
  getById: {
1691
1786
  method: "GET",
1692
1787
  path: "/api/agent/sessions/:id",
1693
- pathParams: z12.object({
1694
- id: z12.string().min(1, "Session ID is required")
1788
+ pathParams: z13.object({
1789
+ id: z13.string().min(1, "Session ID is required")
1695
1790
  }),
1696
1791
  responses: {
1697
1792
  200: sessionResponseSchema,
@@ -1702,7 +1797,7 @@ var sessionsByIdContract = c10.router({
1702
1797
  summary: "Get session by ID"
1703
1798
  }
1704
1799
  });
1705
- var checkpointsByIdContract = c10.router({
1800
+ var checkpointsByIdContract = c11.router({
1706
1801
  /**
1707
1802
  * GET /api/agent/checkpoints/:id
1708
1803
  * Get checkpoint by ID
@@ -1710,8 +1805,8 @@ var checkpointsByIdContract = c10.router({
1710
1805
  getById: {
1711
1806
  method: "GET",
1712
1807
  path: "/api/agent/checkpoints/:id",
1713
- pathParams: z12.object({
1714
- id: z12.string().min(1, "Checkpoint ID is required")
1808
+ pathParams: z13.object({
1809
+ id: z13.string().min(1, "Checkpoint ID is required")
1715
1810
  }),
1716
1811
  responses: {
1717
1812
  200: checkpointResponseSchema,
@@ -1724,91 +1819,91 @@ var checkpointsByIdContract = c10.router({
1724
1819
  });
1725
1820
 
1726
1821
  // ../../packages/core/src/contracts/schedules.ts
1727
- import { z as z13 } from "zod";
1728
- var c11 = initContract();
1729
- var scheduleTriggerSchema = z13.object({
1730
- cron: z13.string().optional(),
1731
- at: z13.string().optional(),
1732
- timezone: z13.string().default("UTC")
1822
+ import { z as z14 } from "zod";
1823
+ var c12 = initContract();
1824
+ var scheduleTriggerSchema = z14.object({
1825
+ cron: z14.string().optional(),
1826
+ at: z14.string().optional(),
1827
+ timezone: z14.string().default("UTC")
1733
1828
  }).refine((data) => data.cron && !data.at || !data.cron && data.at, {
1734
1829
  message: "Exactly one of 'cron' or 'at' must be specified"
1735
1830
  });
1736
- var scheduleRunConfigSchema = z13.object({
1737
- agent: z13.string().min(1, "Agent reference required"),
1738
- prompt: z13.string().min(1, "Prompt required"),
1739
- vars: z13.record(z13.string(), z13.string()).optional(),
1740
- secrets: z13.record(z13.string(), z13.string()).optional(),
1741
- artifactName: z13.string().optional(),
1742
- artifactVersion: z13.string().optional(),
1743
- volumeVersions: z13.record(z13.string(), z13.string()).optional()
1831
+ var scheduleRunConfigSchema = z14.object({
1832
+ agent: z14.string().min(1, "Agent reference required"),
1833
+ prompt: z14.string().min(1, "Prompt required"),
1834
+ vars: z14.record(z14.string(), z14.string()).optional(),
1835
+ secrets: z14.record(z14.string(), z14.string()).optional(),
1836
+ artifactName: z14.string().optional(),
1837
+ artifactVersion: z14.string().optional(),
1838
+ volumeVersions: z14.record(z14.string(), z14.string()).optional()
1744
1839
  });
1745
- var scheduleDefinitionSchema = z13.object({
1840
+ var scheduleDefinitionSchema = z14.object({
1746
1841
  on: scheduleTriggerSchema,
1747
1842
  run: scheduleRunConfigSchema
1748
1843
  });
1749
- var scheduleYamlSchema = z13.object({
1750
- version: z13.literal("1.0"),
1751
- schedules: z13.record(z13.string(), scheduleDefinitionSchema)
1752
- });
1753
- var deployScheduleRequestSchema = z13.object({
1754
- name: z13.string().min(1).max(64, "Schedule name max 64 chars"),
1755
- cronExpression: z13.string().optional(),
1756
- atTime: z13.string().optional(),
1757
- timezone: z13.string().default("UTC"),
1758
- prompt: z13.string().min(1, "Prompt required"),
1759
- vars: z13.record(z13.string(), z13.string()).optional(),
1760
- secrets: z13.record(z13.string(), z13.string()).optional(),
1761
- artifactName: z13.string().optional(),
1762
- artifactVersion: z13.string().optional(),
1763
- volumeVersions: z13.record(z13.string(), z13.string()).optional(),
1844
+ var scheduleYamlSchema = z14.object({
1845
+ version: z14.literal("1.0"),
1846
+ schedules: z14.record(z14.string(), scheduleDefinitionSchema)
1847
+ });
1848
+ var deployScheduleRequestSchema = z14.object({
1849
+ name: z14.string().min(1).max(64, "Schedule name max 64 chars"),
1850
+ cronExpression: z14.string().optional(),
1851
+ atTime: z14.string().optional(),
1852
+ timezone: z14.string().default("UTC"),
1853
+ prompt: z14.string().min(1, "Prompt required"),
1854
+ vars: z14.record(z14.string(), z14.string()).optional(),
1855
+ secrets: z14.record(z14.string(), z14.string()).optional(),
1856
+ artifactName: z14.string().optional(),
1857
+ artifactVersion: z14.string().optional(),
1858
+ volumeVersions: z14.record(z14.string(), z14.string()).optional(),
1764
1859
  // Resolved agent compose ID (CLI resolves scope/name:version → composeId)
1765
- composeId: z13.string().uuid("Invalid compose ID")
1860
+ composeId: z14.string().uuid("Invalid compose ID")
1766
1861
  }).refine(
1767
1862
  (data) => data.cronExpression && !data.atTime || !data.cronExpression && data.atTime,
1768
1863
  {
1769
1864
  message: "Exactly one of 'cronExpression' or 'atTime' must be specified"
1770
1865
  }
1771
1866
  );
1772
- var scheduleResponseSchema = z13.object({
1773
- id: z13.string().uuid(),
1774
- composeId: z13.string().uuid(),
1775
- composeName: z13.string(),
1776
- scopeSlug: z13.string(),
1777
- name: z13.string(),
1778
- cronExpression: z13.string().nullable(),
1779
- atTime: z13.string().nullable(),
1780
- timezone: z13.string(),
1781
- prompt: z13.string(),
1782
- vars: z13.record(z13.string(), z13.string()).nullable(),
1867
+ var scheduleResponseSchema = z14.object({
1868
+ id: z14.string().uuid(),
1869
+ composeId: z14.string().uuid(),
1870
+ composeName: z14.string(),
1871
+ scopeSlug: z14.string(),
1872
+ name: z14.string(),
1873
+ cronExpression: z14.string().nullable(),
1874
+ atTime: z14.string().nullable(),
1875
+ timezone: z14.string(),
1876
+ prompt: z14.string(),
1877
+ vars: z14.record(z14.string(), z14.string()).nullable(),
1783
1878
  // Secret names only (values are never returned)
1784
- secretNames: z13.array(z13.string()).nullable(),
1785
- artifactName: z13.string().nullable(),
1786
- artifactVersion: z13.string().nullable(),
1787
- volumeVersions: z13.record(z13.string(), z13.string()).nullable(),
1788
- enabled: z13.boolean(),
1789
- nextRunAt: z13.string().nullable(),
1790
- createdAt: z13.string(),
1791
- updatedAt: z13.string()
1792
- });
1793
- var runSummarySchema = z13.object({
1794
- id: z13.string().uuid(),
1795
- status: z13.enum(["pending", "running", "completed", "failed", "timeout"]),
1796
- createdAt: z13.string(),
1797
- completedAt: z13.string().nullable(),
1798
- error: z13.string().nullable()
1799
- });
1800
- var scheduleRunsResponseSchema = z13.object({
1801
- runs: z13.array(runSummarySchema)
1802
- });
1803
- var scheduleListResponseSchema = z13.object({
1804
- schedules: z13.array(scheduleResponseSchema)
1805
- });
1806
- var deployScheduleResponseSchema = z13.object({
1879
+ secretNames: z14.array(z14.string()).nullable(),
1880
+ artifactName: z14.string().nullable(),
1881
+ artifactVersion: z14.string().nullable(),
1882
+ volumeVersions: z14.record(z14.string(), z14.string()).nullable(),
1883
+ enabled: z14.boolean(),
1884
+ nextRunAt: z14.string().nullable(),
1885
+ createdAt: z14.string(),
1886
+ updatedAt: z14.string()
1887
+ });
1888
+ var runSummarySchema = z14.object({
1889
+ id: z14.string().uuid(),
1890
+ status: z14.enum(["pending", "running", "completed", "failed", "timeout"]),
1891
+ createdAt: z14.string(),
1892
+ completedAt: z14.string().nullable(),
1893
+ error: z14.string().nullable()
1894
+ });
1895
+ var scheduleRunsResponseSchema = z14.object({
1896
+ runs: z14.array(runSummarySchema)
1897
+ });
1898
+ var scheduleListResponseSchema = z14.object({
1899
+ schedules: z14.array(scheduleResponseSchema)
1900
+ });
1901
+ var deployScheduleResponseSchema = z14.object({
1807
1902
  schedule: scheduleResponseSchema,
1808
- created: z13.boolean()
1903
+ created: z14.boolean()
1809
1904
  // true if created, false if updated
1810
1905
  });
1811
- var schedulesMainContract = c11.router({
1906
+ var schedulesMainContract = c12.router({
1812
1907
  /**
1813
1908
  * POST /api/agent/schedules
1814
1909
  * Deploy (create or update) a schedule
@@ -1844,7 +1939,7 @@ var schedulesMainContract = c11.router({
1844
1939
  summary: "List all schedules"
1845
1940
  }
1846
1941
  });
1847
- var schedulesByNameContract = c11.router({
1942
+ var schedulesByNameContract = c12.router({
1848
1943
  /**
1849
1944
  * GET /api/agent/schedules/:name
1850
1945
  * Get schedule by name
@@ -1852,11 +1947,11 @@ var schedulesByNameContract = c11.router({
1852
1947
  getByName: {
1853
1948
  method: "GET",
1854
1949
  path: "/api/agent/schedules/:name",
1855
- pathParams: z13.object({
1856
- name: z13.string().min(1, "Schedule name required")
1950
+ pathParams: z14.object({
1951
+ name: z14.string().min(1, "Schedule name required")
1857
1952
  }),
1858
- query: z13.object({
1859
- composeId: z13.string().uuid("Compose ID required")
1953
+ query: z14.object({
1954
+ composeId: z14.string().uuid("Compose ID required")
1860
1955
  }),
1861
1956
  responses: {
1862
1957
  200: scheduleResponseSchema,
@@ -1872,21 +1967,21 @@ var schedulesByNameContract = c11.router({
1872
1967
  delete: {
1873
1968
  method: "DELETE",
1874
1969
  path: "/api/agent/schedules/:name",
1875
- pathParams: z13.object({
1876
- name: z13.string().min(1, "Schedule name required")
1970
+ pathParams: z14.object({
1971
+ name: z14.string().min(1, "Schedule name required")
1877
1972
  }),
1878
- query: z13.object({
1879
- composeId: z13.string().uuid("Compose ID required")
1973
+ query: z14.object({
1974
+ composeId: z14.string().uuid("Compose ID required")
1880
1975
  }),
1881
1976
  responses: {
1882
- 204: z13.undefined(),
1977
+ 204: z14.undefined(),
1883
1978
  401: apiErrorSchema,
1884
1979
  404: apiErrorSchema
1885
1980
  },
1886
1981
  summary: "Delete schedule"
1887
1982
  }
1888
1983
  });
1889
- var schedulesEnableContract = c11.router({
1984
+ var schedulesEnableContract = c12.router({
1890
1985
  /**
1891
1986
  * POST /api/agent/schedules/:name/enable
1892
1987
  * Enable a disabled schedule
@@ -1894,11 +1989,11 @@ var schedulesEnableContract = c11.router({
1894
1989
  enable: {
1895
1990
  method: "POST",
1896
1991
  path: "/api/agent/schedules/:name/enable",
1897
- pathParams: z13.object({
1898
- name: z13.string().min(1, "Schedule name required")
1992
+ pathParams: z14.object({
1993
+ name: z14.string().min(1, "Schedule name required")
1899
1994
  }),
1900
- body: z13.object({
1901
- composeId: z13.string().uuid("Compose ID required")
1995
+ body: z14.object({
1996
+ composeId: z14.string().uuid("Compose ID required")
1902
1997
  }),
1903
1998
  responses: {
1904
1999
  200: scheduleResponseSchema,
@@ -1914,11 +2009,11 @@ var schedulesEnableContract = c11.router({
1914
2009
  disable: {
1915
2010
  method: "POST",
1916
2011
  path: "/api/agent/schedules/:name/disable",
1917
- pathParams: z13.object({
1918
- name: z13.string().min(1, "Schedule name required")
2012
+ pathParams: z14.object({
2013
+ name: z14.string().min(1, "Schedule name required")
1919
2014
  }),
1920
- body: z13.object({
1921
- composeId: z13.string().uuid("Compose ID required")
2015
+ body: z14.object({
2016
+ composeId: z14.string().uuid("Compose ID required")
1922
2017
  }),
1923
2018
  responses: {
1924
2019
  200: scheduleResponseSchema,
@@ -1928,7 +2023,7 @@ var schedulesEnableContract = c11.router({
1928
2023
  summary: "Disable schedule"
1929
2024
  }
1930
2025
  });
1931
- var scheduleRunsContract = c11.router({
2026
+ var scheduleRunsContract = c12.router({
1932
2027
  /**
1933
2028
  * GET /api/agent/schedules/:name/runs
1934
2029
  * List recent runs for a schedule
@@ -1936,12 +2031,12 @@ var scheduleRunsContract = c11.router({
1936
2031
  listRuns: {
1937
2032
  method: "GET",
1938
2033
  path: "/api/agent/schedules/:name/runs",
1939
- pathParams: z13.object({
1940
- name: z13.string().min(1, "Schedule name required")
2034
+ pathParams: z14.object({
2035
+ name: z14.string().min(1, "Schedule name required")
1941
2036
  }),
1942
- query: z13.object({
1943
- composeId: z13.string().uuid("Compose ID required"),
1944
- limit: z13.coerce.number().min(0).max(100).default(5)
2037
+ query: z14.object({
2038
+ composeId: z14.string().uuid("Compose ID required"),
2039
+ limit: z14.coerce.number().min(0).max(100).default(5)
1945
2040
  }),
1946
2041
  responses: {
1947
2042
  200: scheduleRunsResponseSchema,
@@ -1953,8 +2048,8 @@ var scheduleRunsContract = c11.router({
1953
2048
  });
1954
2049
 
1955
2050
  // ../../packages/core/src/contracts/public/common.ts
1956
- import { z as z14 } from "zod";
1957
- var publicApiErrorTypeSchema = z14.enum([
2051
+ import { z as z15 } from "zod";
2052
+ var publicApiErrorTypeSchema = z15.enum([
1958
2053
  "api_error",
1959
2054
  // Internal server error (5xx)
1960
2055
  "invalid_request_error",
@@ -1966,55 +2061,55 @@ var publicApiErrorTypeSchema = z14.enum([
1966
2061
  "conflict_error"
1967
2062
  // Resource conflict (409)
1968
2063
  ]);
1969
- var publicApiErrorSchema = z14.object({
1970
- error: z14.object({
2064
+ var publicApiErrorSchema = z15.object({
2065
+ error: z15.object({
1971
2066
  type: publicApiErrorTypeSchema,
1972
- code: z14.string(),
1973
- message: z14.string(),
1974
- param: z14.string().optional(),
1975
- doc_url: z14.string().url().optional()
2067
+ code: z15.string(),
2068
+ message: z15.string(),
2069
+ param: z15.string().optional(),
2070
+ doc_url: z15.string().url().optional()
1976
2071
  })
1977
2072
  });
1978
- var paginationSchema = z14.object({
1979
- has_more: z14.boolean(),
1980
- next_cursor: z14.string().nullable()
2073
+ var paginationSchema = z15.object({
2074
+ has_more: z15.boolean(),
2075
+ next_cursor: z15.string().nullable()
1981
2076
  });
1982
2077
  function createPaginatedResponseSchema(dataSchema) {
1983
- return z14.object({
1984
- data: z14.array(dataSchema),
2078
+ return z15.object({
2079
+ data: z15.array(dataSchema),
1985
2080
  pagination: paginationSchema
1986
2081
  });
1987
2082
  }
1988
- var listQuerySchema = z14.object({
1989
- cursor: z14.string().optional(),
1990
- limit: z14.coerce.number().min(1).max(100).default(20)
2083
+ var listQuerySchema = z15.object({
2084
+ cursor: z15.string().optional(),
2085
+ limit: z15.coerce.number().min(1).max(100).default(20)
1991
2086
  });
1992
- var requestIdSchema = z14.string().uuid();
1993
- var timestampSchema = z14.string().datetime();
2087
+ var requestIdSchema = z15.string().uuid();
2088
+ var timestampSchema = z15.string().datetime();
1994
2089
 
1995
2090
  // ../../packages/core/src/contracts/public/agents.ts
1996
- import { z as z15 } from "zod";
1997
- var c12 = initContract();
1998
- var publicAgentSchema = z15.object({
1999
- id: z15.string(),
2000
- name: z15.string(),
2001
- current_version_id: z15.string().nullable(),
2091
+ import { z as z16 } from "zod";
2092
+ var c13 = initContract();
2093
+ var publicAgentSchema = z16.object({
2094
+ id: z16.string(),
2095
+ name: z16.string(),
2096
+ current_version_id: z16.string().nullable(),
2002
2097
  created_at: timestampSchema,
2003
2098
  updated_at: timestampSchema
2004
2099
  });
2005
- var agentVersionSchema = z15.object({
2006
- id: z15.string(),
2007
- agent_id: z15.string(),
2008
- version_number: z15.number(),
2100
+ var agentVersionSchema = z16.object({
2101
+ id: z16.string(),
2102
+ agent_id: z16.string(),
2103
+ version_number: z16.number(),
2009
2104
  created_at: timestampSchema
2010
2105
  });
2011
2106
  var publicAgentDetailSchema = publicAgentSchema;
2012
2107
  var paginatedAgentsSchema = createPaginatedResponseSchema(publicAgentSchema);
2013
2108
  var paginatedAgentVersionsSchema = createPaginatedResponseSchema(agentVersionSchema);
2014
2109
  var agentListQuerySchema = listQuerySchema.extend({
2015
- name: z15.string().optional()
2110
+ name: z16.string().optional()
2016
2111
  });
2017
- var publicAgentsListContract = c12.router({
2112
+ var publicAgentsListContract = c13.router({
2018
2113
  list: {
2019
2114
  method: "GET",
2020
2115
  path: "/v1/agents",
@@ -2028,12 +2123,12 @@ var publicAgentsListContract = c12.router({
2028
2123
  description: "List all agents in the current scope with pagination. Use the `name` query parameter to filter by agent name."
2029
2124
  }
2030
2125
  });
2031
- var publicAgentByIdContract = c12.router({
2126
+ var publicAgentByIdContract = c13.router({
2032
2127
  get: {
2033
2128
  method: "GET",
2034
2129
  path: "/v1/agents/:id",
2035
- pathParams: z15.object({
2036
- id: z15.string().min(1, "Agent ID is required")
2130
+ pathParams: z16.object({
2131
+ id: z16.string().min(1, "Agent ID is required")
2037
2132
  }),
2038
2133
  responses: {
2039
2134
  200: publicAgentDetailSchema,
@@ -2045,12 +2140,12 @@ var publicAgentByIdContract = c12.router({
2045
2140
  description: "Get agent details by ID"
2046
2141
  }
2047
2142
  });
2048
- var publicAgentVersionsContract = c12.router({
2143
+ var publicAgentVersionsContract = c13.router({
2049
2144
  list: {
2050
2145
  method: "GET",
2051
2146
  path: "/v1/agents/:id/versions",
2052
- pathParams: z15.object({
2053
- id: z15.string().min(1, "Agent ID is required")
2147
+ pathParams: z16.object({
2148
+ id: z16.string().min(1, "Agent ID is required")
2054
2149
  }),
2055
2150
  query: listQuerySchema,
2056
2151
  responses: {
@@ -2065,9 +2160,9 @@ var publicAgentVersionsContract = c12.router({
2065
2160
  });
2066
2161
 
2067
2162
  // ../../packages/core/src/contracts/public/runs.ts
2068
- import { z as z16 } from "zod";
2069
- var c13 = initContract();
2070
- var publicRunStatusSchema = z16.enum([
2163
+ import { z as z17 } from "zod";
2164
+ var c14 = initContract();
2165
+ var publicRunStatusSchema = z17.enum([
2071
2166
  "pending",
2072
2167
  "running",
2073
2168
  "completed",
@@ -2075,56 +2170,56 @@ var publicRunStatusSchema = z16.enum([
2075
2170
  "timeout",
2076
2171
  "cancelled"
2077
2172
  ]);
2078
- var publicRunSchema = z16.object({
2079
- id: z16.string(),
2080
- agent_id: z16.string(),
2081
- agent_name: z16.string(),
2173
+ var publicRunSchema = z17.object({
2174
+ id: z17.string(),
2175
+ agent_id: z17.string(),
2176
+ agent_name: z17.string(),
2082
2177
  status: publicRunStatusSchema,
2083
- prompt: z16.string(),
2178
+ prompt: z17.string(),
2084
2179
  created_at: timestampSchema,
2085
2180
  started_at: timestampSchema.nullable(),
2086
2181
  completed_at: timestampSchema.nullable()
2087
2182
  });
2088
2183
  var publicRunDetailSchema = publicRunSchema.extend({
2089
- error: z16.string().nullable(),
2090
- execution_time_ms: z16.number().nullable(),
2091
- checkpoint_id: z16.string().nullable(),
2092
- session_id: z16.string().nullable(),
2093
- artifact_name: z16.string().nullable(),
2094
- artifact_version: z16.string().nullable(),
2095
- volumes: z16.record(z16.string(), z16.string()).optional()
2184
+ error: z17.string().nullable(),
2185
+ execution_time_ms: z17.number().nullable(),
2186
+ checkpoint_id: z17.string().nullable(),
2187
+ session_id: z17.string().nullable(),
2188
+ artifact_name: z17.string().nullable(),
2189
+ artifact_version: z17.string().nullable(),
2190
+ volumes: z17.record(z17.string(), z17.string()).optional()
2096
2191
  });
2097
2192
  var paginatedRunsSchema = createPaginatedResponseSchema(publicRunSchema);
2098
- var createRunRequestSchema = z16.object({
2193
+ var createRunRequestSchema = z17.object({
2099
2194
  // Agent identification (one of: agent, agent_id, session_id, checkpoint_id)
2100
- agent: z16.string().optional(),
2195
+ agent: z17.string().optional(),
2101
2196
  // Agent name
2102
- agent_id: z16.string().optional(),
2197
+ agent_id: z17.string().optional(),
2103
2198
  // Agent ID
2104
- agent_version: z16.string().optional(),
2199
+ agent_version: z17.string().optional(),
2105
2200
  // Version specifier (e.g., "latest", "v1", specific ID)
2106
2201
  // Continue session
2107
- session_id: z16.string().optional(),
2202
+ session_id: z17.string().optional(),
2108
2203
  // Resume from checkpoint
2109
- checkpoint_id: z16.string().optional(),
2204
+ checkpoint_id: z17.string().optional(),
2110
2205
  // Required
2111
- prompt: z16.string().min(1, "Prompt is required"),
2206
+ prompt: z17.string().min(1, "Prompt is required"),
2112
2207
  // Optional configuration
2113
- variables: z16.record(z16.string(), z16.string()).optional(),
2114
- secrets: z16.record(z16.string(), z16.string()).optional(),
2115
- artifact_name: z16.string().optional(),
2208
+ variables: z17.record(z17.string(), z17.string()).optional(),
2209
+ secrets: z17.record(z17.string(), z17.string()).optional(),
2210
+ artifact_name: z17.string().optional(),
2116
2211
  // Artifact name to mount
2117
- artifact_version: z16.string().optional(),
2212
+ artifact_version: z17.string().optional(),
2118
2213
  // Artifact version (defaults to latest)
2119
- volumes: z16.record(z16.string(), z16.string()).optional()
2214
+ volumes: z17.record(z17.string(), z17.string()).optional()
2120
2215
  // volume_name -> version
2121
2216
  });
2122
2217
  var runListQuerySchema = listQuerySchema.extend({
2123
- agent_id: z16.string().optional(),
2218
+ agent_id: z17.string().optional(),
2124
2219
  status: publicRunStatusSchema.optional(),
2125
2220
  since: timestampSchema.optional()
2126
2221
  });
2127
- var publicRunsListContract = c13.router({
2222
+ var publicRunsListContract = c14.router({
2128
2223
  list: {
2129
2224
  method: "GET",
2130
2225
  path: "/v1/runs",
@@ -2153,12 +2248,12 @@ var publicRunsListContract = c13.router({
2153
2248
  description: "Create and execute a new agent run. Returns 202 Accepted as runs execute asynchronously."
2154
2249
  }
2155
2250
  });
2156
- var publicRunByIdContract = c13.router({
2251
+ var publicRunByIdContract = c14.router({
2157
2252
  get: {
2158
2253
  method: "GET",
2159
2254
  path: "/v1/runs/:id",
2160
- pathParams: z16.object({
2161
- id: z16.string().min(1, "Run ID is required")
2255
+ pathParams: z17.object({
2256
+ id: z17.string().min(1, "Run ID is required")
2162
2257
  }),
2163
2258
  responses: {
2164
2259
  200: publicRunDetailSchema,
@@ -2170,14 +2265,14 @@ var publicRunByIdContract = c13.router({
2170
2265
  description: "Get run details by ID"
2171
2266
  }
2172
2267
  });
2173
- var publicRunCancelContract = c13.router({
2268
+ var publicRunCancelContract = c14.router({
2174
2269
  cancel: {
2175
2270
  method: "POST",
2176
2271
  path: "/v1/runs/:id/cancel",
2177
- pathParams: z16.object({
2178
- id: z16.string().min(1, "Run ID is required")
2272
+ pathParams: z17.object({
2273
+ id: z17.string().min(1, "Run ID is required")
2179
2274
  }),
2180
- body: z16.undefined(),
2275
+ body: z17.undefined(),
2181
2276
  responses: {
2182
2277
  200: publicRunDetailSchema,
2183
2278
  400: publicApiErrorSchema,
@@ -2190,26 +2285,26 @@ var publicRunCancelContract = c13.router({
2190
2285
  description: "Cancel a pending or running execution"
2191
2286
  }
2192
2287
  });
2193
- var logEntrySchema = z16.object({
2288
+ var logEntrySchema = z17.object({
2194
2289
  timestamp: timestampSchema,
2195
- type: z16.enum(["agent", "system", "network"]),
2196
- level: z16.enum(["debug", "info", "warn", "error"]),
2197
- message: z16.string(),
2198
- metadata: z16.record(z16.string(), z16.unknown()).optional()
2290
+ type: z17.enum(["agent", "system", "network"]),
2291
+ level: z17.enum(["debug", "info", "warn", "error"]),
2292
+ message: z17.string(),
2293
+ metadata: z17.record(z17.string(), z17.unknown()).optional()
2199
2294
  });
2200
2295
  var paginatedLogsSchema = createPaginatedResponseSchema(logEntrySchema);
2201
2296
  var logsQuerySchema = listQuerySchema.extend({
2202
- type: z16.enum(["agent", "system", "network", "all"]).default("all"),
2297
+ type: z17.enum(["agent", "system", "network", "all"]).default("all"),
2203
2298
  since: timestampSchema.optional(),
2204
2299
  until: timestampSchema.optional(),
2205
- order: z16.enum(["asc", "desc"]).default("asc")
2300
+ order: z17.enum(["asc", "desc"]).default("asc")
2206
2301
  });
2207
- var publicRunLogsContract = c13.router({
2302
+ var publicRunLogsContract = c14.router({
2208
2303
  getLogs: {
2209
2304
  method: "GET",
2210
2305
  path: "/v1/runs/:id/logs",
2211
- pathParams: z16.object({
2212
- id: z16.string().min(1, "Run ID is required")
2306
+ pathParams: z17.object({
2307
+ id: z17.string().min(1, "Run ID is required")
2213
2308
  }),
2214
2309
  query: logsQuerySchema,
2215
2310
  responses: {
@@ -2222,29 +2317,29 @@ var publicRunLogsContract = c13.router({
2222
2317
  description: "Get unified logs for a run. Combines agent, system, and network logs."
2223
2318
  }
2224
2319
  });
2225
- var metricPointSchema = z16.object({
2320
+ var metricPointSchema = z17.object({
2226
2321
  timestamp: timestampSchema,
2227
- cpu_percent: z16.number(),
2228
- memory_used_mb: z16.number(),
2229
- memory_total_mb: z16.number(),
2230
- disk_used_mb: z16.number(),
2231
- disk_total_mb: z16.number()
2232
- });
2233
- var metricsSummarySchema = z16.object({
2234
- avg_cpu_percent: z16.number(),
2235
- max_memory_used_mb: z16.number(),
2236
- total_duration_ms: z16.number().nullable()
2237
- });
2238
- var metricsResponseSchema2 = z16.object({
2239
- data: z16.array(metricPointSchema),
2322
+ cpu_percent: z17.number(),
2323
+ memory_used_mb: z17.number(),
2324
+ memory_total_mb: z17.number(),
2325
+ disk_used_mb: z17.number(),
2326
+ disk_total_mb: z17.number()
2327
+ });
2328
+ var metricsSummarySchema = z17.object({
2329
+ avg_cpu_percent: z17.number(),
2330
+ max_memory_used_mb: z17.number(),
2331
+ total_duration_ms: z17.number().nullable()
2332
+ });
2333
+ var metricsResponseSchema2 = z17.object({
2334
+ data: z17.array(metricPointSchema),
2240
2335
  summary: metricsSummarySchema
2241
2336
  });
2242
- var publicRunMetricsContract = c13.router({
2337
+ var publicRunMetricsContract = c14.router({
2243
2338
  getMetrics: {
2244
2339
  method: "GET",
2245
2340
  path: "/v1/runs/:id/metrics",
2246
- pathParams: z16.object({
2247
- id: z16.string().min(1, "Run ID is required")
2341
+ pathParams: z17.object({
2342
+ id: z17.string().min(1, "Run ID is required")
2248
2343
  }),
2249
2344
  responses: {
2250
2345
  200: metricsResponseSchema2,
@@ -2256,7 +2351,7 @@ var publicRunMetricsContract = c13.router({
2256
2351
  description: "Get CPU, memory, and disk metrics for a run"
2257
2352
  }
2258
2353
  });
2259
- var sseEventTypeSchema = z16.enum([
2354
+ var sseEventTypeSchema = z17.enum([
2260
2355
  "status",
2261
2356
  // Run status change
2262
2357
  "output",
@@ -2268,25 +2363,25 @@ var sseEventTypeSchema = z16.enum([
2268
2363
  "heartbeat"
2269
2364
  // Keep-alive
2270
2365
  ]);
2271
- var sseEventSchema = z16.object({
2366
+ var sseEventSchema = z17.object({
2272
2367
  event: sseEventTypeSchema,
2273
- data: z16.unknown(),
2274
- id: z16.string().optional()
2368
+ data: z17.unknown(),
2369
+ id: z17.string().optional()
2275
2370
  // For Last-Event-ID reconnection
2276
2371
  });
2277
- var publicRunEventsContract = c13.router({
2372
+ var publicRunEventsContract = c14.router({
2278
2373
  streamEvents: {
2279
2374
  method: "GET",
2280
2375
  path: "/v1/runs/:id/events",
2281
- pathParams: z16.object({
2282
- id: z16.string().min(1, "Run ID is required")
2376
+ pathParams: z17.object({
2377
+ id: z17.string().min(1, "Run ID is required")
2283
2378
  }),
2284
- query: z16.object({
2285
- last_event_id: z16.string().optional()
2379
+ query: z17.object({
2380
+ last_event_id: z17.string().optional()
2286
2381
  // For reconnection
2287
2382
  }),
2288
2383
  responses: {
2289
- 200: z16.any(),
2384
+ 200: z17.any(),
2290
2385
  // SSE stream - actual content is text/event-stream
2291
2386
  401: publicApiErrorSchema,
2292
2387
  404: publicApiErrorSchema,
@@ -2298,28 +2393,28 @@ var publicRunEventsContract = c13.router({
2298
2393
  });
2299
2394
 
2300
2395
  // ../../packages/core/src/contracts/public/artifacts.ts
2301
- import { z as z17 } from "zod";
2302
- var c14 = initContract();
2303
- var publicArtifactSchema = z17.object({
2304
- id: z17.string(),
2305
- name: z17.string(),
2306
- current_version_id: z17.string().nullable(),
2307
- size: z17.number(),
2396
+ import { z as z18 } from "zod";
2397
+ var c15 = initContract();
2398
+ var publicArtifactSchema = z18.object({
2399
+ id: z18.string(),
2400
+ name: z18.string(),
2401
+ current_version_id: z18.string().nullable(),
2402
+ size: z18.number(),
2308
2403
  // Total size in bytes
2309
- file_count: z17.number(),
2404
+ file_count: z18.number(),
2310
2405
  created_at: timestampSchema,
2311
2406
  updated_at: timestampSchema
2312
2407
  });
2313
- var artifactVersionSchema = z17.object({
2314
- id: z17.string(),
2408
+ var artifactVersionSchema = z18.object({
2409
+ id: z18.string(),
2315
2410
  // SHA-256 content hash
2316
- artifact_id: z17.string(),
2317
- size: z17.number(),
2411
+ artifact_id: z18.string(),
2412
+ size: z18.number(),
2318
2413
  // Size in bytes
2319
- file_count: z17.number(),
2320
- message: z17.string().nullable(),
2414
+ file_count: z18.number(),
2415
+ message: z18.string().nullable(),
2321
2416
  // Optional commit message
2322
- created_by: z17.string(),
2417
+ created_by: z18.string(),
2323
2418
  created_at: timestampSchema
2324
2419
  });
2325
2420
  var publicArtifactDetailSchema = publicArtifactSchema.extend({
@@ -2329,7 +2424,7 @@ var paginatedArtifactsSchema = createPaginatedResponseSchema(publicArtifactSchem
2329
2424
  var paginatedArtifactVersionsSchema = createPaginatedResponseSchema(
2330
2425
  artifactVersionSchema
2331
2426
  );
2332
- var publicArtifactsListContract = c14.router({
2427
+ var publicArtifactsListContract = c15.router({
2333
2428
  list: {
2334
2429
  method: "GET",
2335
2430
  path: "/v1/artifacts",
@@ -2343,12 +2438,12 @@ var publicArtifactsListContract = c14.router({
2343
2438
  description: "List all artifacts in the current scope with pagination"
2344
2439
  }
2345
2440
  });
2346
- var publicArtifactByIdContract = c14.router({
2441
+ var publicArtifactByIdContract = c15.router({
2347
2442
  get: {
2348
2443
  method: "GET",
2349
2444
  path: "/v1/artifacts/:id",
2350
- pathParams: z17.object({
2351
- id: z17.string().min(1, "Artifact ID is required")
2445
+ pathParams: z18.object({
2446
+ id: z18.string().min(1, "Artifact ID is required")
2352
2447
  }),
2353
2448
  responses: {
2354
2449
  200: publicArtifactDetailSchema,
@@ -2360,12 +2455,12 @@ var publicArtifactByIdContract = c14.router({
2360
2455
  description: "Get artifact details by ID"
2361
2456
  }
2362
2457
  });
2363
- var publicArtifactVersionsContract = c14.router({
2458
+ var publicArtifactVersionsContract = c15.router({
2364
2459
  list: {
2365
2460
  method: "GET",
2366
2461
  path: "/v1/artifacts/:id/versions",
2367
- pathParams: z17.object({
2368
- id: z17.string().min(1, "Artifact ID is required")
2462
+ pathParams: z18.object({
2463
+ id: z18.string().min(1, "Artifact ID is required")
2369
2464
  }),
2370
2465
  query: listQuerySchema,
2371
2466
  responses: {
@@ -2378,19 +2473,19 @@ var publicArtifactVersionsContract = c14.router({
2378
2473
  description: "List all versions of an artifact with pagination"
2379
2474
  }
2380
2475
  });
2381
- var publicArtifactDownloadContract = c14.router({
2476
+ var publicArtifactDownloadContract = c15.router({
2382
2477
  download: {
2383
2478
  method: "GET",
2384
2479
  path: "/v1/artifacts/:id/download",
2385
- pathParams: z17.object({
2386
- id: z17.string().min(1, "Artifact ID is required")
2480
+ pathParams: z18.object({
2481
+ id: z18.string().min(1, "Artifact ID is required")
2387
2482
  }),
2388
- query: z17.object({
2389
- version_id: z17.string().optional()
2483
+ query: z18.object({
2484
+ version_id: z18.string().optional()
2390
2485
  // Defaults to current version
2391
2486
  }),
2392
2487
  responses: {
2393
- 302: z17.undefined(),
2488
+ 302: z18.undefined(),
2394
2489
  // Redirect to presigned URL
2395
2490
  401: publicApiErrorSchema,
2396
2491
  404: publicApiErrorSchema,
@@ -2402,28 +2497,28 @@ var publicArtifactDownloadContract = c14.router({
2402
2497
  });
2403
2498
 
2404
2499
  // ../../packages/core/src/contracts/public/volumes.ts
2405
- import { z as z18 } from "zod";
2406
- var c15 = initContract();
2407
- var publicVolumeSchema = z18.object({
2408
- id: z18.string(),
2409
- name: z18.string(),
2410
- current_version_id: z18.string().nullable(),
2411
- size: z18.number(),
2500
+ import { z as z19 } from "zod";
2501
+ var c16 = initContract();
2502
+ var publicVolumeSchema = z19.object({
2503
+ id: z19.string(),
2504
+ name: z19.string(),
2505
+ current_version_id: z19.string().nullable(),
2506
+ size: z19.number(),
2412
2507
  // Total size in bytes
2413
- file_count: z18.number(),
2508
+ file_count: z19.number(),
2414
2509
  created_at: timestampSchema,
2415
2510
  updated_at: timestampSchema
2416
2511
  });
2417
- var volumeVersionSchema = z18.object({
2418
- id: z18.string(),
2512
+ var volumeVersionSchema = z19.object({
2513
+ id: z19.string(),
2419
2514
  // SHA-256 content hash
2420
- volume_id: z18.string(),
2421
- size: z18.number(),
2515
+ volume_id: z19.string(),
2516
+ size: z19.number(),
2422
2517
  // Size in bytes
2423
- file_count: z18.number(),
2424
- message: z18.string().nullable(),
2518
+ file_count: z19.number(),
2519
+ message: z19.string().nullable(),
2425
2520
  // Optional commit message
2426
- created_by: z18.string(),
2521
+ created_by: z19.string(),
2427
2522
  created_at: timestampSchema
2428
2523
  });
2429
2524
  var publicVolumeDetailSchema = publicVolumeSchema.extend({
@@ -2431,7 +2526,7 @@ var publicVolumeDetailSchema = publicVolumeSchema.extend({
2431
2526
  });
2432
2527
  var paginatedVolumesSchema = createPaginatedResponseSchema(publicVolumeSchema);
2433
2528
  var paginatedVolumeVersionsSchema = createPaginatedResponseSchema(volumeVersionSchema);
2434
- var publicVolumesListContract = c15.router({
2529
+ var publicVolumesListContract = c16.router({
2435
2530
  list: {
2436
2531
  method: "GET",
2437
2532
  path: "/v1/volumes",
@@ -2445,12 +2540,12 @@ var publicVolumesListContract = c15.router({
2445
2540
  description: "List all volumes in the current scope with pagination"
2446
2541
  }
2447
2542
  });
2448
- var publicVolumeByIdContract = c15.router({
2543
+ var publicVolumeByIdContract = c16.router({
2449
2544
  get: {
2450
2545
  method: "GET",
2451
2546
  path: "/v1/volumes/:id",
2452
- pathParams: z18.object({
2453
- id: z18.string().min(1, "Volume ID is required")
2547
+ pathParams: z19.object({
2548
+ id: z19.string().min(1, "Volume ID is required")
2454
2549
  }),
2455
2550
  responses: {
2456
2551
  200: publicVolumeDetailSchema,
@@ -2462,12 +2557,12 @@ var publicVolumeByIdContract = c15.router({
2462
2557
  description: "Get volume details by ID"
2463
2558
  }
2464
2559
  });
2465
- var publicVolumeVersionsContract = c15.router({
2560
+ var publicVolumeVersionsContract = c16.router({
2466
2561
  list: {
2467
2562
  method: "GET",
2468
2563
  path: "/v1/volumes/:id/versions",
2469
- pathParams: z18.object({
2470
- id: z18.string().min(1, "Volume ID is required")
2564
+ pathParams: z19.object({
2565
+ id: z19.string().min(1, "Volume ID is required")
2471
2566
  }),
2472
2567
  query: listQuerySchema,
2473
2568
  responses: {
@@ -2480,19 +2575,19 @@ var publicVolumeVersionsContract = c15.router({
2480
2575
  description: "List all versions of a volume with pagination"
2481
2576
  }
2482
2577
  });
2483
- var publicVolumeDownloadContract = c15.router({
2578
+ var publicVolumeDownloadContract = c16.router({
2484
2579
  download: {
2485
2580
  method: "GET",
2486
2581
  path: "/v1/volumes/:id/download",
2487
- pathParams: z18.object({
2488
- id: z18.string().min(1, "Volume ID is required")
2582
+ pathParams: z19.object({
2583
+ id: z19.string().min(1, "Volume ID is required")
2489
2584
  }),
2490
- query: z18.object({
2491
- version_id: z18.string().optional()
2585
+ query: z19.object({
2586
+ version_id: z19.string().optional()
2492
2587
  // Defaults to current version
2493
2588
  }),
2494
2589
  responses: {
2495
- 302: z18.undefined(),
2590
+ 302: z19.undefined(),
2496
2591
  // Redirect to presigned URL
2497
2592
  401: publicApiErrorSchema,
2498
2593
  404: publicApiErrorSchema,
@@ -3292,6 +3387,86 @@ var ApiClient = class {
3292
3387
  }
3293
3388
  return response.json();
3294
3389
  }
3390
+ /**
3391
+ * List credentials (metadata only, no values)
3392
+ */
3393
+ async listCredentials() {
3394
+ const baseUrl = await this.getBaseUrl();
3395
+ const headers = await this.getHeaders();
3396
+ const client = initClient(credentialsMainContract, {
3397
+ baseUrl,
3398
+ baseHeaders: headers,
3399
+ jsonQuery: true
3400
+ });
3401
+ const result = await client.list();
3402
+ if (result.status === 200) {
3403
+ return result.body;
3404
+ }
3405
+ const errorBody = result.body;
3406
+ const message = errorBody.error?.message || "Failed to list credentials";
3407
+ throw new Error(message);
3408
+ }
3409
+ /**
3410
+ * Get credential by name (metadata only, no value)
3411
+ */
3412
+ async getCredential(name) {
3413
+ const baseUrl = await this.getBaseUrl();
3414
+ const headers = await this.getHeaders();
3415
+ const client = initClient(credentialsByNameContract, {
3416
+ baseUrl,
3417
+ baseHeaders: headers,
3418
+ jsonQuery: true
3419
+ });
3420
+ const result = await client.get({
3421
+ params: { name }
3422
+ });
3423
+ if (result.status === 200) {
3424
+ return result.body;
3425
+ }
3426
+ const errorBody = result.body;
3427
+ const message = errorBody.error?.message || `Credential "${name}" not found`;
3428
+ throw new Error(message);
3429
+ }
3430
+ /**
3431
+ * Set (create or update) a credential
3432
+ */
3433
+ async setCredential(body) {
3434
+ const baseUrl = await this.getBaseUrl();
3435
+ const headers = await this.getHeaders();
3436
+ const client = initClient(credentialsMainContract, {
3437
+ baseUrl,
3438
+ baseHeaders: headers,
3439
+ jsonQuery: true
3440
+ });
3441
+ const result = await client.set({ body });
3442
+ if (result.status === 200 || result.status === 201) {
3443
+ return result.body;
3444
+ }
3445
+ const errorBody = result.body;
3446
+ const message = errorBody.error?.message || "Failed to set credential";
3447
+ throw new Error(message);
3448
+ }
3449
+ /**
3450
+ * Delete a credential by name
3451
+ */
3452
+ async deleteCredential(name) {
3453
+ const baseUrl = await this.getBaseUrl();
3454
+ const headers = await this.getHeaders();
3455
+ const client = initClient(credentialsByNameContract, {
3456
+ baseUrl,
3457
+ baseHeaders: headers,
3458
+ jsonQuery: true
3459
+ });
3460
+ const result = await client.delete({
3461
+ params: { name }
3462
+ });
3463
+ if (result.status === 204) {
3464
+ return;
3465
+ }
3466
+ const errorBody = result.body;
3467
+ const message = errorBody.error?.message || `Credential "${name}" not found`;
3468
+ throw new Error(message);
3469
+ }
3295
3470
  /**
3296
3471
  * Generic GET request
3297
3472
  */
@@ -3363,7 +3538,7 @@ var ApiClient = class {
3363
3538
  var apiClient = new ApiClient();
3364
3539
 
3365
3540
  // src/lib/domain/yaml-validator.ts
3366
- import { z as z19 } from "zod";
3541
+ import { z as z20 } from "zod";
3367
3542
 
3368
3543
  // src/lib/domain/provider-config.ts
3369
3544
  var PROVIDER_DEFAULTS = {
@@ -3430,7 +3605,7 @@ function getDefaultImageWithApps(provider, apps) {
3430
3605
  }
3431
3606
 
3432
3607
  // src/lib/domain/yaml-validator.ts
3433
- var cliAgentNameSchema = z19.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
3608
+ var cliAgentNameSchema = z20.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
3434
3609
  /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?$/,
3435
3610
  "Agent name must start and end with letter or number, and contain only letters, numbers, and hyphens"
3436
3611
  );
@@ -3443,14 +3618,14 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
3443
3618
  const providerSupported = isProviderSupported(agent.provider);
3444
3619
  if (!agent.image && !providerSupported) {
3445
3620
  ctx.addIssue({
3446
- code: z19.ZodIssueCode.custom,
3621
+ code: z20.ZodIssueCode.custom,
3447
3622
  message: "Missing agent.image (required when provider is not auto-configured)",
3448
3623
  path: ["image"]
3449
3624
  });
3450
3625
  }
3451
3626
  if (!agent.working_dir && !providerSupported) {
3452
3627
  ctx.addIssue({
3453
- code: z19.ZodIssueCode.custom,
3628
+ code: z20.ZodIssueCode.custom,
3454
3629
  message: "Missing agent.working_dir (required when provider is not auto-configured)",
3455
3630
  path: ["working_dir"]
3456
3631
  });
@@ -3460,7 +3635,7 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
3460
3635
  const skillUrl = agent.skills[i];
3461
3636
  if (skillUrl && !validateGitHubTreeUrl(skillUrl)) {
3462
3637
  ctx.addIssue({
3463
- code: z19.ZodIssueCode.custom,
3638
+ code: z20.ZodIssueCode.custom,
3464
3639
  message: `Invalid skill URL: ${skillUrl}. Expected format: https://github.com/{owner}/{repo}/tree/{branch}/{path}`,
3465
3640
  path: ["skills", i]
3466
3641
  });
@@ -3469,15 +3644,15 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
3469
3644
  }
3470
3645
  }
3471
3646
  );
3472
- var cliComposeSchema = z19.object({
3473
- version: z19.string().min(1, "Missing config.version"),
3474
- agents: z19.record(cliAgentNameSchema, cliAgentDefinitionSchema),
3475
- volumes: z19.record(z19.string(), volumeConfigSchema).optional()
3647
+ var cliComposeSchema = z20.object({
3648
+ version: z20.string().min(1, "Missing config.version"),
3649
+ agents: z20.record(cliAgentNameSchema, cliAgentDefinitionSchema),
3650
+ volumes: z20.record(z20.string(), volumeConfigSchema).optional()
3476
3651
  }).superRefine((config, ctx) => {
3477
3652
  const agentKeys = Object.keys(config.agents);
3478
3653
  if (agentKeys.length === 0) {
3479
3654
  ctx.addIssue({
3480
- code: z19.ZodIssueCode.custom,
3655
+ code: z20.ZodIssueCode.custom,
3481
3656
  message: "agents must have at least one agent defined",
3482
3657
  path: ["agents"]
3483
3658
  });
@@ -3485,7 +3660,7 @@ var cliComposeSchema = z19.object({
3485
3660
  }
3486
3661
  if (agentKeys.length > 1) {
3487
3662
  ctx.addIssue({
3488
- code: z19.ZodIssueCode.custom,
3663
+ code: z20.ZodIssueCode.custom,
3489
3664
  message: "Multiple agents not supported yet. Only one agent allowed.",
3490
3665
  path: ["agents"]
3491
3666
  });
@@ -3497,7 +3672,7 @@ var cliComposeSchema = z19.object({
3497
3672
  if (agentVolumes && agentVolumes.length > 0) {
3498
3673
  if (!config.volumes) {
3499
3674
  ctx.addIssue({
3500
- code: z19.ZodIssueCode.custom,
3675
+ code: z20.ZodIssueCode.custom,
3501
3676
  message: "Agent references volumes but no volumes section defined. Each volume must have explicit name and version.",
3502
3677
  path: ["volumes"]
3503
3678
  });
@@ -3507,7 +3682,7 @@ var cliComposeSchema = z19.object({
3507
3682
  const parts = volDeclaration.split(":");
3508
3683
  if (parts.length !== 2) {
3509
3684
  ctx.addIssue({
3510
- code: z19.ZodIssueCode.custom,
3685
+ code: z20.ZodIssueCode.custom,
3511
3686
  message: `Invalid volume declaration: ${volDeclaration}. Expected format: volume-key:/mount/path`,
3512
3687
  path: ["agents", agentName, "volumes"]
3513
3688
  });
@@ -3516,7 +3691,7 @@ var cliComposeSchema = z19.object({
3516
3691
  const volumeKey = parts[0].trim();
3517
3692
  if (!config.volumes[volumeKey]) {
3518
3693
  ctx.addIssue({
3519
- code: z19.ZodIssueCode.custom,
3694
+ code: z20.ZodIssueCode.custom,
3520
3695
  message: `Volume "${volumeKey}" is not defined in volumes section. Each volume must have explicit name and version.`,
3521
3696
  path: ["volumes", volumeKey]
3522
3697
  });
@@ -4577,9 +4752,9 @@ var CodexEventParser = class {
4577
4752
  }
4578
4753
  }
4579
4754
  if (itemType === "file_change" && item.changes && item.changes.length > 0) {
4580
- const changes = item.changes.map((c16) => {
4581
- const action = c16.kind === "add" ? "Created" : c16.kind === "modify" ? "Modified" : "Deleted";
4582
- return `${action}: ${c16.path}`;
4755
+ const changes = item.changes.map((c17) => {
4756
+ const action = c17.kind === "add" ? "Created" : c17.kind === "modify" ? "Modified" : "Deleted";
4757
+ return `${action}: ${c17.path}`;
4583
4758
  }).join("\n");
4584
4759
  return {
4585
4760
  type: "text",
@@ -4920,9 +5095,9 @@ var CodexEventRenderer = class {
4920
5095
  return;
4921
5096
  }
4922
5097
  if (itemType === "file_change" && item.changes && item.changes.length > 0) {
4923
- const summary = item.changes.map((c16) => {
4924
- const icon = c16.kind === "add" ? "+" : c16.kind === "delete" ? "-" : "~";
4925
- return `${icon}${c16.path}`;
5098
+ const summary = item.changes.map((c17) => {
5099
+ const icon = c17.kind === "add" ? "+" : c17.kind === "delete" ? "-" : "~";
5100
+ return `${icon}${c17.path}`;
4926
5101
  }).join(", ");
4927
5102
  console.log(chalk4.green("[files]") + ` ${summary}`);
4928
5103
  return;
@@ -6772,7 +6947,7 @@ async function autoPullArtifact(runOutput, artifactDir) {
6772
6947
  var cookCmd = new Command17().name("cook").description("One-click agent preparation and execution from vm0.yaml");
6773
6948
  cookCmd.argument("[prompt]", "Prompt for the agent").option("-y, --yes", "Skip confirmation prompts").option("--debug-no-mock-claude").action(
6774
6949
  async (prompt, options) => {
6775
- const shouldExit = await checkAndUpgrade("5.8.0", prompt);
6950
+ const shouldExit = await checkAndUpgrade("5.9.0", prompt);
6776
6951
  if (shouldExit) {
6777
6952
  process.exit(0);
6778
6953
  }
@@ -7473,7 +7648,7 @@ var listCommand3 = new Command22().name("list").alias("ls").description("List al
7473
7648
  );
7474
7649
  return;
7475
7650
  }
7476
- const nameWidth = Math.max(4, ...data.composes.map((c16) => c16.name.length));
7651
+ const nameWidth = Math.max(4, ...data.composes.map((c17) => c17.name.length));
7477
7652
  const header = ["NAME".padEnd(nameWidth), "VERSION", "UPDATED"].join(
7478
7653
  " "
7479
7654
  );
@@ -9627,11 +9802,152 @@ var usageCommand = new Command35().name("usage").description("View usage statist
9627
9802
  }
9628
9803
  });
9629
9804
 
9805
+ // src/commands/credential/index.ts
9806
+ import { Command as Command39 } from "commander";
9807
+
9808
+ // src/commands/credential/list.ts
9809
+ import { Command as Command36 } from "commander";
9810
+ import chalk37 from "chalk";
9811
+ var listCommand5 = new Command36().name("list").description("List all credentials").option("--json", "Output in JSON format").action(async (options) => {
9812
+ try {
9813
+ const result = await apiClient.listCredentials();
9814
+ if (options.json) {
9815
+ console.log(JSON.stringify(result.credentials, null, 2));
9816
+ return;
9817
+ }
9818
+ if (result.credentials.length === 0) {
9819
+ console.log(chalk37.dim("No credentials found."));
9820
+ console.log();
9821
+ console.log("To add a credential:");
9822
+ console.log(chalk37.cyan(" vm0 credential set MY_API_KEY <value>"));
9823
+ return;
9824
+ }
9825
+ console.log(chalk37.bold("Credentials:"));
9826
+ console.log();
9827
+ for (const credential of result.credentials) {
9828
+ console.log(` ${chalk37.cyan(credential.name)}`);
9829
+ if (credential.description) {
9830
+ console.log(` ${chalk37.dim(credential.description)}`);
9831
+ }
9832
+ console.log(
9833
+ ` ${chalk37.dim(`Updated: ${new Date(credential.updatedAt).toLocaleString()}`)}`
9834
+ );
9835
+ console.log();
9836
+ }
9837
+ console.log(
9838
+ chalk37.dim(`Total: ${result.credentials.length} credential(s)`)
9839
+ );
9840
+ } catch (error) {
9841
+ if (error instanceof Error) {
9842
+ if (error.message.includes("Not authenticated")) {
9843
+ console.error(chalk37.red("\u2717 Not authenticated. Run: vm0 auth login"));
9844
+ } else {
9845
+ console.error(chalk37.red(`\u2717 ${error.message}`));
9846
+ }
9847
+ } else {
9848
+ console.error(chalk37.red("\u2717 An unexpected error occurred"));
9849
+ }
9850
+ process.exit(1);
9851
+ }
9852
+ });
9853
+
9854
+ // src/commands/credential/set.ts
9855
+ import { Command as Command37 } from "commander";
9856
+ import chalk38 from "chalk";
9857
+ var setCommand2 = new Command37().name("set").description("Create or update a credential").argument("<name>", "Credential name (uppercase, e.g., MY_API_KEY)").argument("<value>", "Credential value").option("-d, --description <description>", "Optional description").action(
9858
+ async (name, value, options) => {
9859
+ try {
9860
+ const credential = await apiClient.setCredential({
9861
+ name,
9862
+ value,
9863
+ description: options.description
9864
+ });
9865
+ console.log(chalk38.green(`\u2713 Credential "${credential.name}" saved`));
9866
+ console.log();
9867
+ console.log("Use in vm0.yaml:");
9868
+ console.log(chalk38.cyan(` environment:`));
9869
+ console.log(chalk38.cyan(` ${name}: \${{ credentials.${name} }}`));
9870
+ } catch (error) {
9871
+ if (error instanceof Error) {
9872
+ if (error.message.includes("Not authenticated")) {
9873
+ console.error(
9874
+ chalk38.red("\u2717 Not authenticated. Run: vm0 auth login")
9875
+ );
9876
+ } else if (error.message.includes("must contain only uppercase")) {
9877
+ console.error(chalk38.red(`\u2717 ${error.message}`));
9878
+ console.log();
9879
+ console.log("Examples of valid credential names:");
9880
+ console.log(chalk38.dim(" MY_API_KEY"));
9881
+ console.log(chalk38.dim(" GITHUB_TOKEN"));
9882
+ console.log(chalk38.dim(" AWS_ACCESS_KEY_ID"));
9883
+ } else {
9884
+ console.error(chalk38.red(`\u2717 ${error.message}`));
9885
+ }
9886
+ } else {
9887
+ console.error(chalk38.red("\u2717 An unexpected error occurred"));
9888
+ }
9889
+ process.exit(1);
9890
+ }
9891
+ }
9892
+ );
9893
+
9894
+ // src/commands/credential/delete.ts
9895
+ import { Command as Command38 } from "commander";
9896
+ import chalk39 from "chalk";
9897
+ var deleteCommand2 = new Command38().name("delete").description("Delete a credential").argument("<name>", "Credential name to delete").option("-y, --yes", "Skip confirmation prompt").action(async (name, options) => {
9898
+ try {
9899
+ try {
9900
+ await apiClient.getCredential(name);
9901
+ } catch {
9902
+ console.error(chalk39.red(`\u2717 Credential "${name}" not found`));
9903
+ process.exit(1);
9904
+ }
9905
+ if (!options.yes) {
9906
+ const readline2 = await import("readline");
9907
+ const rl = readline2.createInterface({
9908
+ input: process.stdin,
9909
+ output: process.stdout
9910
+ });
9911
+ const confirmed = await new Promise((resolve2) => {
9912
+ rl.question(
9913
+ chalk39.yellow(
9914
+ `Are you sure you want to delete credential "${name}"? (y/N) `
9915
+ ),
9916
+ (answer) => {
9917
+ rl.close();
9918
+ resolve2(answer.toLowerCase() === "y");
9919
+ }
9920
+ );
9921
+ });
9922
+ if (!confirmed) {
9923
+ console.log(chalk39.dim("Cancelled."));
9924
+ return;
9925
+ }
9926
+ }
9927
+ await apiClient.deleteCredential(name);
9928
+ console.log(chalk39.green(`\u2713 Credential "${name}" deleted`));
9929
+ } catch (error) {
9930
+ if (error instanceof Error) {
9931
+ if (error.message.includes("Not authenticated")) {
9932
+ console.error(chalk39.red("\u2717 Not authenticated. Run: vm0 auth login"));
9933
+ } else {
9934
+ console.error(chalk39.red(`\u2717 ${error.message}`));
9935
+ }
9936
+ } else {
9937
+ console.error(chalk39.red("\u2717 An unexpected error occurred"));
9938
+ }
9939
+ process.exit(1);
9940
+ }
9941
+ });
9942
+
9943
+ // src/commands/credential/index.ts
9944
+ var credentialCommand = new Command39().name("experimental-credential").description("[Experimental] Manage stored credentials for agent runs").addCommand(listCommand5).addCommand(setCommand2).addCommand(deleteCommand2);
9945
+
9630
9946
  // src/index.ts
9631
- var program = new Command36();
9632
- program.name("vm0").description("VM0 CLI - A modern build tool").version("5.8.0");
9947
+ var program = new Command40();
9948
+ program.name("vm0").description("VM0 CLI - A modern build tool").version("5.9.0");
9633
9949
  program.command("info").description("Display environment information").action(async () => {
9634
- console.log(chalk37.bold("System Information:"));
9950
+ console.log(chalk40.bold("System Information:"));
9635
9951
  console.log(`Node Version: ${process.version}`);
9636
9952
  console.log(`Platform: ${process.platform}`);
9637
9953
  console.log(`Architecture: ${process.arch}`);
@@ -9663,6 +9979,7 @@ program.addCommand(initCommand3);
9663
9979
  program.addCommand(setupGithubCommand);
9664
9980
  program.addCommand(scheduleCommand);
9665
9981
  program.addCommand(usageCommand);
9982
+ program.addCommand(credentialCommand);
9666
9983
  if (process.argv[1]?.endsWith("index.js") || process.argv[1]?.endsWith("index.ts") || process.argv[1]?.endsWith("vm0")) {
9667
9984
  program.parse();
9668
9985
  }