@withgauge/cli 0.20.0 → 0.21.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/dist/index.js +1738 -1648
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
  };
7
7
 
8
8
  // src/index.ts
9
- import { Command, CommanderError, Option as Option4 } from "commander";
9
+ import { Command, CommanderError, Option as Option5 } from "commander";
10
10
 
11
11
  // src/commands/actions.ts
12
12
  var actions_exports2 = {};
@@ -1574,10 +1574,10 @@ var deviceTokenResultSchema = z16.discriminatedUnion("status", [
1574
1574
  ]);
1575
1575
 
1576
1576
  // ../packages/api-schemas/src/evals.ts
1577
- import { z as z22 } from "zod";
1577
+ import { z as z23 } from "zod";
1578
1578
 
1579
1579
  // ../packages/api-schemas/src/ownedConfigurations.ts
1580
- import { z as z21 } from "zod";
1580
+ import { z as z22 } from "zod";
1581
1581
 
1582
1582
  // ../packages/api-schemas/src/runConfig.ts
1583
1583
  var runConfig_exports = {};
@@ -1593,36 +1593,112 @@ __export(runConfig_exports, {
1593
1593
  schedulableAgentSchema: () => schedulableAgentSchema,
1594
1594
  totalRunsPerCycle: () => totalRunsPerCycle
1595
1595
  });
1596
- import { z as z20 } from "zod";
1596
+ import { z as z21 } from "zod";
1597
1597
 
1598
1598
  // ../packages/api-schemas/src/runs.ts
1599
- import { z as z19 } from "zod";
1599
+ import { z as z20 } from "zod";
1600
+
1601
+ // ../packages/api-schemas/src/sessionAnalysis.ts
1602
+ import { z as z17 } from "zod";
1603
+ var evidenceRefSchema = z17.discriminatedUnion("kind", [
1604
+ z17.object({ kind: z17.literal("trace"), seq: z17.number().int().nonnegative() }),
1605
+ z17.object({ kind: z17.literal("diff"), path: z17.string() })
1606
+ ]);
1607
+ var INSTALL_PHASES = [
1608
+ "NONE",
1609
+ "ATTEMPTED",
1610
+ "CONFIGURED",
1611
+ "EXERCISED"
1612
+ ];
1613
+ var sessionProductSchema = z17.object({
1614
+ name: z17.string(),
1615
+ mentioned: z17.boolean(),
1616
+ considered: z17.boolean(),
1617
+ recommended: z17.boolean(),
1618
+ chosen: z17.boolean(),
1619
+ rejected: z17.boolean(),
1620
+ abandoned: z17.boolean(),
1621
+ installPhase: z17.enum(INSTALL_PHASES),
1622
+ rank: z17.number().int().nullable(),
1623
+ source: z17.enum([
1624
+ "BRIEF",
1625
+ "PERSONA",
1626
+ "PRIOR",
1627
+ "SEARCH",
1628
+ "PAGE",
1629
+ "REPO",
1630
+ "UNKNOWN"
1631
+ ]),
1632
+ reason: z17.string(),
1633
+ categories: z17.array(z17.string()),
1634
+ /** Evidence per stage ("source", "considered", "chosen", …). */
1635
+ evidence: z17.record(z17.string(), z17.array(evidenceRefSchema))
1636
+ });
1637
+ var sessionObservationSchema = z17.object({
1638
+ id: z17.string(),
1639
+ kind: z17.enum(["FRICTION", "OBJECTION", "OPPORTUNITY"]),
1640
+ label: z17.string(),
1641
+ detail: z17.string(),
1642
+ subject: z17.string(),
1643
+ basis: z17.enum(["OBSERVED", "AGENT_CLAIM", "INFERRED"]),
1644
+ effect: z17.enum([
1645
+ "BLOCKED",
1646
+ "RECOVERED",
1647
+ "EXTRA_WORK",
1648
+ "SELECTION_LOSS",
1649
+ "UNKNOWN"
1650
+ ]),
1651
+ cause: z17.enum([
1652
+ "PRODUCT",
1653
+ "CONTENT",
1654
+ "ACCESS",
1655
+ "ENVIRONMENT",
1656
+ "AGENT",
1657
+ "UNKNOWN"
1658
+ ]),
1659
+ tags: z17.array(z17.string()),
1660
+ evidence: z17.array(evidenceRefSchema)
1661
+ });
1662
+ var sessionAnalysisSchema2 = z17.object({
1663
+ id: z17.string(),
1664
+ runId: z17.string(),
1665
+ attempt: z17.number().int(),
1666
+ createdAt: z17.string(),
1667
+ origin: z17.enum(["MODEL", "LEGACY"]),
1668
+ model: z17.string().nullable(),
1669
+ assessability: z17.enum(["ASSESSED", "PARTIAL", "UNASSESSABLE"]),
1670
+ limitation: z17.string().nullable(),
1671
+ selection: z17.enum(["MEASURED", "UNASSESSABLE", "NOT_MEASURED"]),
1672
+ directed: z17.boolean(),
1673
+ products: z17.array(sessionProductSchema),
1674
+ observations: z17.array(sessionObservationSchema)
1675
+ });
1600
1676
 
1601
1677
  // ../packages/api-schemas/src/web-fixtures.ts
1602
- import { z as z18 } from "zod";
1678
+ import { z as z19 } from "zod";
1603
1679
 
1604
1680
  // ../packages/api-schemas/src/websiteInputs.ts
1605
- import { z as z17 } from "zod";
1606
- var websiteUrlSchema = z17.url().refine((raw) => {
1681
+ import { z as z18 } from "zod";
1682
+ var websiteUrlSchema = z18.url().refine((raw) => {
1607
1683
  const u = new URL(raw);
1608
1684
  return u.protocol === "https:" && !u.username && !u.password && !u.port && !u.search && !u.hash;
1609
1685
  }, "Expected an HTTPS documentation URL without credentials, port, query or fragment");
1610
- var websiteUseSchema = z17.object({
1611
- type: z17.literal("website"),
1686
+ var websiteUseSchema = z18.object({
1687
+ type: z18.literal("website"),
1612
1688
  url: websiteUrlSchema.refine(
1613
1689
  (url) => new URL(url).pathname === "/",
1614
1690
  "Website inputs require an origin without a path"
1615
1691
  )
1616
1692
  }).strict();
1617
- var deploymentSourceSchema = z17.object({
1618
- type: z17.literal("github-deployment"),
1619
- environment: z17.string().min(1).max(128)
1693
+ var deploymentSourceSchema = z18.object({
1694
+ type: z18.literal("github-deployment"),
1695
+ environment: z18.string().min(1).max(128)
1620
1696
  }).strict();
1621
- var commentSourceSchema = z17.object({
1622
- type: z17.literal("github-pr-comment"),
1623
- author: z17.string().min(1).max(100).regex(/^[a-zA-Z0-9-]+(?:\[bot\])?$/),
1624
- bodyIncludes: z17.string().min(1).max(256).describe("Literal marker identifying the provider's preview comment."),
1625
- pattern: z17.string().min(1).max(2048).refine((pattern) => {
1697
+ var commentSourceSchema = z18.object({
1698
+ type: z18.literal("github-pr-comment"),
1699
+ author: z18.string().min(1).max(100).regex(/^[a-zA-Z0-9-]+(?:\[bot\])?$/),
1700
+ bodyIncludes: z18.string().min(1).max(256).describe("Literal marker identifying the provider's preview comment."),
1701
+ pattern: z18.string().min(1).max(2048).refine((pattern) => {
1626
1702
  try {
1627
1703
  new RegExp(pattern, "gm");
1628
1704
  return pattern.includes("(?<url>") && pattern.includes("(?<sha>");
@@ -1632,11 +1708,11 @@ var commentSourceSchema = z17.object({
1632
1708
  }, "Use a valid regex with named url and sha captures; match only a ready preview").describe(
1633
1709
  "JavaScript regex (gm flags) matching readiness and capturing url and sha (7\u201340 hex characters). Execution is time limited."
1634
1710
  ),
1635
- failureIncludes: z17.string().min(1).max(256).optional().describe(
1711
+ failureIncludes: z18.string().min(1).max(256).optional().describe(
1636
1712
  "Literal failure marker in the selected comment; failure never falls back to older comments."
1637
1713
  )
1638
1714
  }).strict();
1639
- var websiteSourceSchema = z17.discriminatedUnion("type", [
1715
+ var websiteSourceSchema = z18.discriminatedUnion("type", [
1640
1716
  deploymentSourceSchema,
1641
1717
  commentSourceSchema
1642
1718
  ]);
@@ -1648,31 +1724,31 @@ function normalizeWebFixtureUrl(raw) {
1648
1724
  url.hash = "";
1649
1725
  return url.href;
1650
1726
  }
1651
- var searchResultSchema = z18.object({
1652
- title: z18.string().min(1),
1653
- url: z18.url().transform(normalizeWebFixtureUrl),
1654
- snippet: z18.string()
1727
+ var searchResultSchema = z19.object({
1728
+ title: z19.string().min(1),
1729
+ url: z19.url().transform(normalizeWebFixtureUrl),
1730
+ snippet: z19.string()
1655
1731
  });
1656
- var searchFixtureSchema = z18.object({
1657
- query: z18.string().trim().min(1),
1658
- results: z18.array(searchResultSchema)
1732
+ var searchFixtureSchema = z19.object({
1733
+ query: z19.string().trim().min(1),
1734
+ results: z19.array(searchResultSchema)
1659
1735
  });
1660
- var pageFixtureSchema = z18.object({
1661
- url: z18.url().transform(normalizeWebFixtureUrl),
1662
- status: z18.int().min(100).max(599).default(200),
1663
- contentType: z18.string().trim().min(1).default("text/html"),
1664
- body: z18.string()
1736
+ var pageFixtureSchema = z19.object({
1737
+ url: z19.url().transform(normalizeWebFixtureUrl),
1738
+ status: z19.int().min(100).max(599).default(200),
1739
+ contentType: z19.string().trim().min(1).default("text/html"),
1740
+ body: z19.string()
1665
1741
  });
1666
- var originProxySchema = z18.object({
1742
+ var originProxySchema = z19.object({
1667
1743
  origin: websiteUrlSchema.refine((raw) => new URL(raw).pathname === "/", "Expected an origin").transform((raw) => new URL(raw).origin),
1668
1744
  upstream: websiteUrlSchema.refine((raw) => new URL(raw).pathname === "/", "Expected an origin").transform((raw) => new URL(raw).origin)
1669
1745
  }).strict();
1670
- var webFixtureSchema = z18.object({
1671
- version: z18.literal(1),
1672
- origins: z18.array(originProxySchema).max(32).optional(),
1673
- scopes: z18.array(websiteUrlSchema.transform(normalizeWebFixtureUrl)).max(32).optional(),
1674
- searches: z18.array(searchFixtureSchema).default([]),
1675
- pages: z18.array(pageFixtureSchema).default([])
1746
+ var webFixtureSchema = z19.object({
1747
+ version: z19.literal(1),
1748
+ origins: z19.array(originProxySchema).max(32).optional(),
1749
+ scopes: z19.array(websiteUrlSchema.transform(normalizeWebFixtureUrl)).max(32).optional(),
1750
+ searches: z19.array(searchFixtureSchema).default([]),
1751
+ pages: z19.array(pageFixtureSchema).default([])
1676
1752
  }).superRefine((fixture, ctx) => {
1677
1753
  if (fixture.scopes?.some(
1678
1754
  (scope) => !fixture.pages.some(
@@ -1737,7 +1813,7 @@ var RUN_STATUSES = [
1737
1813
  "TIMED_OUT",
1738
1814
  "CANCELED"
1739
1815
  ];
1740
- var runStatusSchema = z19.enum(RUN_STATUSES);
1816
+ var runStatusSchema = z20.enum(RUN_STATUSES);
1741
1817
  var AGENTS = [
1742
1818
  "CLAUDE_CODE",
1743
1819
  "CODEX_CLI",
@@ -1745,20 +1821,20 @@ var AGENTS = [
1745
1821
  "PI",
1746
1822
  "OPENCODE"
1747
1823
  ];
1748
- var agentSchema = z19.enum(AGENTS);
1824
+ var agentSchema = z20.enum(AGENTS);
1749
1825
  var OBSERVED_PROVIDER_SOURCES = [
1750
1826
  "AGENT_STREAM",
1751
1827
  "GATEWAY_RESPONSE",
1752
1828
  "GATEWAY_AUDIT",
1753
1829
  "CANARY"
1754
1830
  ];
1755
- var observedProviderSourceSchema = z19.enum(OBSERVED_PROVIDER_SOURCES);
1756
- var selectedProviderSchema = z19.object({
1757
- slug: z19.string(),
1758
- displayName: z19.string()
1831
+ var observedProviderSourceSchema = z20.enum(OBSERVED_PROVIDER_SOURCES);
1832
+ var selectedProviderSchema = z20.object({
1833
+ slug: z20.string(),
1834
+ displayName: z20.string()
1759
1835
  });
1760
- var observedProviderSchema = z19.object({
1761
- slug: z19.string(),
1836
+ var observedProviderSchema = z20.object({
1837
+ slug: z20.string(),
1762
1838
  source: observedProviderSourceSchema
1763
1839
  });
1764
1840
  var RUN_TRIGGER_SOURCES = [
@@ -1770,159 +1846,159 @@ var RUN_TRIGGER_SOURCES = [
1770
1846
  "OPERATOR",
1771
1847
  "GITHUB"
1772
1848
  ];
1773
- var runTriggerSourceSchema = z19.enum(RUN_TRIGGER_SOURCES);
1774
- var runTriggeredBySchema = z19.object({
1849
+ var runTriggerSourceSchema = z20.enum(RUN_TRIGGER_SOURCES);
1850
+ var runTriggeredBySchema = z20.object({
1775
1851
  source: runTriggerSourceSchema,
1776
- userId: z19.string().nullable(),
1777
- email: z19.string().nullable()
1852
+ userId: z20.string().nullable(),
1853
+ email: z20.string().nullable()
1778
1854
  });
1779
- var runCreditsChargedSchema = z19.number().int().nullable();
1780
- var runStatusFilterSchema = z19.string().transform(
1855
+ var runCreditsChargedSchema = z20.number().int().nullable();
1856
+ var runStatusFilterSchema = z20.string().transform(
1781
1857
  (raw) => raw.split(",").map((s) => s.trim().toUpperCase()).filter(Boolean)
1782
- ).pipe(z19.array(runStatusSchema).min(1));
1858
+ ).pipe(z20.array(runStatusSchema).min(1));
1783
1859
  var runListQuerySchema = listQuerySchema.extend({
1784
1860
  status: runStatusFilterSchema.optional(),
1785
- batch: z19.string().optional(),
1786
- prompt: z19.string().optional(),
1787
- experiment: z19.string().optional(),
1788
- evalSet: z19.string().optional(),
1789
- since: z19.string().optional()
1790
- });
1791
- var runListItemSchema = z19.object({
1792
- id: z19.string(),
1861
+ batch: z20.string().optional(),
1862
+ prompt: z20.string().optional(),
1863
+ experiment: z20.string().optional(),
1864
+ evalSet: z20.string().optional(),
1865
+ since: z20.string().optional()
1866
+ });
1867
+ var runListItemSchema = z20.object({
1868
+ id: z20.string(),
1793
1869
  status: runStatusSchema,
1794
1870
  agent: agentSchema,
1795
1871
  /** Requested logical-model pin. Empty means the platform default was used. */
1796
- model: z19.string(),
1872
+ model: z20.string(),
1797
1873
  /** Model reported by the harness; null until observed or on legacy runs. */
1798
- resolvedModel: z19.string().nullable().optional(),
1874
+ resolvedModel: z20.string().nullable().optional(),
1799
1875
  /** Catalog presentation label for the selected logical model. */
1800
- modelDisplayName: z19.string().nullable().optional(),
1876
+ modelDisplayName: z20.string().nullable().optional(),
1801
1877
  /** Catalog provider selected before execution; null on legacy runs. */
1802
1878
  selectedProvider: selectedProviderSchema.nullable().optional(),
1803
1879
  /** Trusted terminal upstream observation; may differ from the selected
1804
1880
  * aggregator and is null when the runtime supplies no provenance. */
1805
1881
  observedProvider: observedProviderSchema.nullable().optional(),
1806
- promptId: z19.string(),
1882
+ promptId: z20.string(),
1807
1883
  /** First ~80 chars of the batch's prompt snapshot, whitespace-collapsed. */
1808
- promptSnippet: z19.string(),
1809
- batchId: z19.string(),
1810
- experiment: z19.string().nullable(),
1884
+ promptSnippet: z20.string(),
1885
+ batchId: z20.string(),
1886
+ experiment: z20.string().nullable(),
1811
1887
  /** The eval set whose expansion (or backfill) minted the batch; null for
1812
1888
  * schedule/visibility/ad-hoc runs. */
1813
- evalSetId: z19.string().nullable(),
1814
- turns: z19.number().int().nullable(),
1815
- usdCost: z19.number().nullable(),
1889
+ evalSetId: z20.string().nullable(),
1890
+ turns: z20.number().int().nullable(),
1891
+ usdCost: z20.number().nullable(),
1816
1892
  creditsCharged: runCreditsChargedSchema.optional(),
1817
1893
  triggeredBy: runTriggeredBySchema.optional(),
1818
- durationMs: z19.number().int().nullable(),
1819
- exitReason: z19.string().nullable(),
1820
- createdAt: z19.string(),
1821
- startedAt: z19.string().nullable(),
1822
- finishedAt: z19.string().nullable(),
1894
+ durationMs: z20.number().int().nullable(),
1895
+ exitReason: z20.string().nullable(),
1896
+ createdAt: z20.string(),
1897
+ startedAt: z20.string().nullable(),
1898
+ finishedAt: z20.string().nullable(),
1823
1899
  /** Fork lineage (fork-simulations WS1): the source run this was forked from,
1824
1900
  * or null for an organic run. Forks are excluded from aggregate analytics but
1825
1901
  * kept visible; consumers badge on these fields. */
1826
- parentRunId: z19.string().nullable(),
1902
+ parentRunId: z20.string().nullable(),
1827
1903
  /** Set when this run is a fetch-fork simulation variant (injected web
1828
1904
  * content); null otherwise. Distinguishes a "Simulation" badge from a plain
1829
1905
  * conversation fork. */
1830
- fetchForkPlanId: z19.string().nullable()
1906
+ fetchForkPlanId: z20.string().nullable()
1831
1907
  });
1832
1908
  var runListResponseSchema = listResponseSchema(runListItemSchema);
1833
- var runSkillSchema = z19.discriminatedUnion("source", [
1834
- z19.object({
1835
- source: z19.literal("saved"),
1836
- skillId: z19.string(),
1837
- name: z19.string(),
1838
- label: z19.string()
1909
+ var runSkillSchema = z20.discriminatedUnion("source", [
1910
+ z20.object({
1911
+ source: z20.literal("saved"),
1912
+ skillId: z20.string(),
1913
+ name: z20.string(),
1914
+ label: z20.string()
1839
1915
  }),
1840
- z19.object({
1841
- source: z19.literal("input"),
1842
- name: z19.string(),
1916
+ z20.object({
1917
+ source: z20.literal("input"),
1918
+ name: z20.string(),
1843
1919
  /** Null when the Skill was supplied directly. */
1844
- commit: z19.string().nullable(),
1920
+ commit: z20.string().nullable(),
1845
1921
  /** The GitHub PR that launched the run; null for API launches. */
1846
- pullNumber: z19.number().int().nullable()
1922
+ pullNumber: z20.number().int().nullable()
1847
1923
  })
1848
1924
  ]);
1849
1925
  var runDetailSchema = runListItemSchema.omit({ promptSnippet: true }).extend({
1850
- promptText: z19.string(),
1851
- attempt: z19.number().int(),
1852
- cancelRequested: z19.boolean(),
1853
- failureReason: z19.string().nullable(),
1854
- repoUrl: z19.string().nullable(),
1855
- repoRef: z19.string().nullable(),
1856
- scenario: z19.string(),
1857
- funding: z19.string(),
1926
+ promptText: z20.string(),
1927
+ attempt: z20.number().int(),
1928
+ cancelRequested: z20.boolean(),
1929
+ failureReason: z20.string().nullable(),
1930
+ repoUrl: z20.string().nullable(),
1931
+ repoRef: z20.string().nullable(),
1932
+ scenario: z20.string(),
1933
+ funding: z20.string(),
1858
1934
  /** Raw harness usage write-back (token counts etc.); shape may evolve. */
1859
- usage: z19.unknown().nullable(),
1935
+ usage: z20.unknown().nullable(),
1860
1936
  /** Artifact pointer: a working-tree diff exists at GET /runs/{id}/diff. */
1861
- hasDiff: z19.boolean(),
1862
- claimedAt: z19.string().nullable(),
1937
+ hasDiff: z20.boolean(),
1938
+ claimedAt: z20.string().nullable(),
1863
1939
  /** Judged criteria verdicts for eval-set runs (empty otherwise). `name`
1864
1940
  * is the judge-time snapshot; `criterionId` is null once the criterion
1865
1941
  * was deleted from its set. */
1866
- criterionResults: z19.array(
1867
- z19.object({
1868
- criterionId: z19.string().nullable(),
1869
- name: z19.string(),
1870
- passed: z19.boolean(),
1871
- reasoning: z19.string().nullable()
1942
+ criterionResults: z20.array(
1943
+ z20.object({
1944
+ criterionId: z20.string().nullable(),
1945
+ name: z20.string(),
1946
+ passed: z20.boolean().nullable(),
1947
+ reasoning: z20.string().nullable()
1872
1948
  })
1873
1949
  ),
1874
1950
  /** Skills this run was configured with: saved catalog Skills, plus Skills
1875
1951
  * prepared from the run's inputs (not in the catalog). */
1876
- skills: z19.array(runSkillSchema).optional()
1952
+ skills: z20.array(runSkillSchema).optional()
1877
1953
  });
1878
- var cancelRunResponseSchema = z19.object({
1879
- id: z19.string(),
1954
+ var cancelRunResponseSchema = z20.object({
1955
+ id: z20.string(),
1880
1956
  status: runStatusSchema,
1881
- cancelRequested: z19.boolean(),
1882
- note: z19.string().optional()
1957
+ cancelRequested: z20.boolean(),
1958
+ note: z20.string().optional()
1883
1959
  });
1884
- var regradeRunResponseSchema = z19.object({
1885
- runId: z19.string(),
1886
- evalSetId: z19.string(),
1887
- criteria: z19.number().int()
1960
+ var regradeRunResponseSchema = z20.object({
1961
+ runId: z20.string(),
1962
+ evalSetId: z20.string(),
1963
+ criteria: z20.number().int()
1888
1964
  });
1889
- var forkRunBodySchema = z19.object({
1890
- prompt: z19.string().trim().min(1).max(2e4),
1891
- turn: z19.number().int().min(0).optional(),
1965
+ var forkRunBodySchema = z20.object({
1966
+ prompt: z20.string().trim().min(1).max(2e4),
1967
+ turn: z20.number().int().min(0).optional(),
1892
1968
  webFixture: webFixtureSchema.optional()
1893
1969
  });
1894
- var forkRunResponseSchema = z19.object({
1895
- runId: z19.string(),
1896
- batchId: z19.string(),
1897
- parentRunId: z19.string(),
1898
- checkpointId: z19.string(),
1899
- turn: z19.number().int().min(0)
1970
+ var forkRunResponseSchema = z20.object({
1971
+ runId: z20.string(),
1972
+ batchId: z20.string(),
1973
+ parentRunId: z20.string(),
1974
+ checkpointId: z20.string(),
1975
+ turn: z20.number().int().min(0)
1900
1976
  });
1901
- var fetchForkAtFetchBodySchema = z19.object({
1902
- boundarySeq: z19.string().min(1),
1903
- injectedContent: z19.string(),
1904
- prompts: z19.array(z19.string()).min(1)
1977
+ var fetchForkAtFetchBodySchema = z20.object({
1978
+ boundarySeq: z20.string().min(1),
1979
+ injectedContent: z20.string(),
1980
+ prompts: z20.array(z20.string()).min(1)
1905
1981
  });
1906
- var fetchForkAtFetchResponseSchema = z19.object({
1907
- planId: z19.string()
1982
+ var fetchForkAtFetchResponseSchema = z20.object({
1983
+ planId: z20.string()
1908
1984
  });
1909
- var fetchForkPlanStatusSchema = z19.enum([
1985
+ var fetchForkPlanStatusSchema = z20.enum([
1910
1986
  "DRAFT",
1911
1987
  "SURGERY_RUNNING",
1912
1988
  "SURGERY_READY",
1913
1989
  "FORKED",
1914
1990
  "FAILED"
1915
1991
  ]);
1916
- var fetchForkPlanResponseSchema = z19.object({
1917
- id: z19.string(),
1992
+ var fetchForkPlanResponseSchema = z20.object({
1993
+ id: z20.string(),
1918
1994
  status: fetchForkPlanStatusSchema,
1919
- boundaryUrl: z19.string(),
1920
- boundaryTurn: z19.number().int(),
1921
- prompts: z19.array(z19.string()),
1922
- surgicalCheckpointId: z19.string().nullable(),
1923
- forkBatchId: z19.string().nullable(),
1924
- errorText: z19.string().nullable(),
1925
- forkedRunIds: z19.array(z19.string())
1995
+ boundaryUrl: z20.string(),
1996
+ boundaryTurn: z20.number().int(),
1997
+ prompts: z20.array(z20.string()),
1998
+ surgicalCheckpointId: z20.string().nullable(),
1999
+ forkBatchId: z20.string().nullable(),
2000
+ errorText: z20.string().nullable(),
2001
+ forkedRunIds: z20.array(z20.string())
1926
2002
  });
1927
2003
  var RUN_INSIGHT_STATUSES = [
1928
2004
  "PENDING",
@@ -1931,52 +2007,52 @@ var RUN_INSIGHT_STATUSES = [
1931
2007
  "FAILED",
1932
2008
  "SKIPPED"
1933
2009
  ];
1934
- var runInsightStatusSchema = z19.enum(RUN_INSIGHT_STATUSES);
1935
- var insightPassSchema = z19.object({
2010
+ var runInsightStatusSchema = z20.enum(RUN_INSIGHT_STATUSES);
2011
+ var insightPassSchema = z20.object({
1936
2012
  status: runInsightStatusSchema,
1937
- model: z19.string().nullable(),
1938
- inputTokens: z19.number().int().nullable(),
1939
- outputTokens: z19.number().int().nullable(),
1940
- usdCost: z19.number().nullable(),
1941
- error: z19.string().nullable()
1942
- });
1943
- var runDecisionSchema = z19.object({
1944
- index: z19.number().int(),
1945
- category: z19.string(),
1946
- categoryRaw: z19.string().nullable(),
1947
- chosenName: z19.string(),
1948
- chosenEcosystem: z19.string().nullable(),
1949
- chosenPackage: z19.string().nullable(),
1950
- reversed: z19.boolean(),
1951
- detail: z19.unknown()
2013
+ model: z20.string().nullable(),
2014
+ inputTokens: z20.number().int().nullable(),
2015
+ outputTokens: z20.number().int().nullable(),
2016
+ usdCost: z20.number().nullable(),
2017
+ error: z20.string().nullable()
2018
+ });
2019
+ var runDecisionSchema = z20.object({
2020
+ index: z20.number().int(),
2021
+ category: z20.string(),
2022
+ categoryRaw: z20.string().nullable(),
2023
+ chosenName: z20.string(),
2024
+ chosenEcosystem: z20.string().nullable(),
2025
+ chosenPackage: z20.string().nullable(),
2026
+ reversed: z20.boolean(),
2027
+ detail: z20.unknown()
1952
2028
  });
1953
2029
  var RUN_INSIGHT_PASS_KINDS = [
1954
- "INSTALL",
1955
- "DECISION",
1956
- "EVAL",
1957
- "EXPERIMENT_DELTA",
1958
- "VISIBILITY"
2030
+ "ANALYSIS",
2031
+ "CLI_DISCOVERY",
2032
+ "LEVER",
2033
+ "EXPERIMENT_DELTA"
1959
2034
  ];
1960
- var runInsightPassKindSchema = z19.enum(RUN_INSIGHT_PASS_KINDS);
2035
+ var runInsightPassKindSchema = z20.enum(RUN_INSIGHT_PASS_KINDS);
1961
2036
  var insightPipelinePassSchema = insightPassSchema.extend({
1962
2037
  kind: runInsightPassKindSchema
1963
2038
  });
1964
- var runInsightResponseSchema = z19.object({
1965
- runId: z19.string(),
2039
+ var runInsightResponseSchema = z20.object({
2040
+ runId: z20.string(),
1966
2041
  decision: insightPassSchema,
1967
- passes: z19.array(insightPipelinePassSchema),
1968
- decisions: z19.array(runDecisionSchema),
1969
- experimentDelta: z19.unknown().nullable(),
1970
- /** The VISIBILITY pass's output (winners/picks) — loose server JSON, null
1971
- * for non-visibility runs or before the pass completes. */
1972
- visibilityVerdict: z19.unknown().nullable()
1973
- });
1974
- var runEventSchema = z19.looseObject({
1975
- run_id: z19.string(),
1976
- seq: z19.number(),
1977
- turn: z19.number(),
1978
- ts: z19.string(),
1979
- type: z19.string()
2042
+ passes: z20.array(insightPipelinePassSchema),
2043
+ decisions: z20.array(runDecisionSchema),
2044
+ experimentDelta: z20.unknown().nullable(),
2045
+ /** The preference verdict (winner/picks) derived from `analysis` — loose
2046
+ * server JSON, null for sessions not asked to choose a product. */
2047
+ visibilityVerdict: z20.unknown().nullable(),
2048
+ analysis: sessionAnalysisSchema2.nullable()
2049
+ });
2050
+ var runEventSchema = z20.looseObject({
2051
+ run_id: z20.string(),
2052
+ seq: z20.number(),
2053
+ turn: z20.number(),
2054
+ ts: z20.string(),
2055
+ type: z20.string()
1980
2056
  });
1981
2057
 
1982
2058
  // ../packages/api-schemas/src/runConfig.ts
@@ -1986,16 +2062,16 @@ var SCHEDULABLE_AGENTS = [
1986
2062
  "PI",
1987
2063
  "OPENCODE"
1988
2064
  ];
1989
- var schedulableAgentSchema = z20.enum(SCHEDULABLE_AGENTS);
1990
- var agentConfigSchema = z20.object({
2065
+ var schedulableAgentSchema = z21.enum(SCHEDULABLE_AGENTS);
2066
+ var agentConfigSchema = z21.object({
1991
2067
  agent: agentSchema,
1992
- models: z20.array(z20.string().min(1))
2068
+ models: z21.array(z21.string().min(1))
1993
2069
  });
1994
- var agentConfigInputSchema = z20.object({
2070
+ var agentConfigInputSchema = z21.object({
1995
2071
  agent: schedulableAgentSchema,
1996
- models: z20.array(z20.string().min(1)).default([])
2072
+ models: z21.array(z21.string().min(1)).default([])
1997
2073
  });
1998
- var assetRefSchema = z20.string().max(320).regex(
2074
+ var assetRefSchema = z21.string().max(320).regex(
1999
2075
  /^[A-Za-z0-9][A-Za-z0-9._-]*@[^\s,]+$/,
2000
2076
  'asset references must be "name@label"'
2001
2077
  );
@@ -2003,7 +2079,7 @@ function refAssetName(ref) {
2003
2079
  const at = ref.indexOf("@");
2004
2080
  return at < 0 ? ref : ref.slice(0, at);
2005
2081
  }
2006
- var assetRefListSchema = z20.array(assetRefSchema).superRefine((refs, ctx) => {
2082
+ var assetRefListSchema = z21.array(assetRefSchema).superRefine((refs, ctx) => {
2007
2083
  const names = /* @__PURE__ */ new Set();
2008
2084
  for (const ref of refs) {
2009
2085
  const name = refAssetName(ref);
@@ -2027,62 +2103,62 @@ function totalRunsPerCycle(owners, samplesPerCycle) {
2027
2103
  }
2028
2104
 
2029
2105
  // ../packages/api-schemas/src/ownedConfigurations.ts
2030
- var sampleCountSchema = z21.number().int().min(1).max(50);
2031
- var nextRunAtInputSchema = z21.string().regex(/^\d{4}-\d{2}-\d{2}/, "Next run must be a calendar date").nullable();
2032
- var ownedCadenceSchema = z21.enum([
2106
+ var sampleCountSchema = z22.number().int().min(1).max(50);
2107
+ var nextRunAtInputSchema = z22.string().regex(/^\d{4}-\d{2}-\d{2}/, "Next run must be a calendar date").nullable();
2108
+ var ownedCadenceSchema = z22.enum([
2033
2109
  "NONE",
2034
2110
  "DAILY",
2035
2111
  "WEEKLY",
2036
2112
  "MONTHLY"
2037
2113
  ]);
2038
2114
  var ownedConfigurationInputShape = {
2039
- repoUrl: z21.string().nullish(),
2040
- repoRef: z21.string().nullish(),
2041
- profileId: z21.string().nullish(),
2042
- agents: z21.array(agentConfigInputSchema).min(1, "Select at least one agent"),
2115
+ repoUrl: z22.string().nullish(),
2116
+ repoRef: z22.string().nullish(),
2117
+ profileId: z22.string().nullish(),
2118
+ agents: z22.array(agentConfigInputSchema).min(1, "Select at least one agent"),
2043
2119
  skillRefs: assetRefListSchema.optional().default([]),
2044
2120
  mcpRefs: assetRefListSchema.optional().default([]),
2045
- connectionIds: z21.array(z21.string().min(1)).max(32).optional().default([]),
2121
+ connectionIds: z22.array(z22.string().min(1)).max(32).optional().default([]),
2046
2122
  cadence: ownedCadenceSchema.optional().default("NONE"),
2047
2123
  nextRunAt: nextRunAtInputSchema.optional(),
2048
2124
  sampleCount: sampleCountSchema.optional().default(1)
2049
2125
  };
2050
- var ownedConfigurationInputSchema = z21.object(ownedConfigurationInputShape).strict();
2126
+ var ownedConfigurationInputSchema = z22.object(ownedConfigurationInputShape).strict();
2051
2127
  var ownedConfigurationPatchShape = {
2052
- repoUrl: z21.string().nullish(),
2053
- repoRef: z21.string().nullish(),
2054
- profileId: z21.string().nullish(),
2055
- agents: z21.array(agentConfigInputSchema).min(1, "Select at least one agent").optional(),
2128
+ repoUrl: z22.string().nullish(),
2129
+ repoRef: z22.string().nullish(),
2130
+ profileId: z22.string().nullish(),
2131
+ agents: z22.array(agentConfigInputSchema).min(1, "Select at least one agent").optional(),
2056
2132
  skillRefs: assetRefListSchema.optional(),
2057
2133
  mcpRefs: assetRefListSchema.optional(),
2058
- connectionIds: z21.array(z21.string().min(1)).max(32).optional(),
2134
+ connectionIds: z22.array(z22.string().min(1)).max(32).optional(),
2059
2135
  cadence: ownedCadenceSchema.optional(),
2060
2136
  nextRunAt: nextRunAtInputSchema.optional(),
2061
2137
  sampleCount: sampleCountSchema.optional()
2062
2138
  };
2063
- var ownedConfigurationSchema = z21.object({
2064
- repoUrl: z21.string().nullable(),
2065
- repoRef: z21.string().nullable(),
2066
- profile: z21.object({ id: z21.string(), name: z21.string() }).nullable(),
2067
- agents: z21.array(agentConfigSchema),
2068
- skillRefs: z21.array(z21.string()),
2069
- mcpRefs: z21.array(z21.string()),
2070
- connectionIds: z21.array(z21.string()),
2139
+ var ownedConfigurationSchema = z22.object({
2140
+ repoUrl: z22.string().nullable(),
2141
+ repoRef: z22.string().nullable(),
2142
+ profile: z22.object({ id: z22.string(), name: z22.string() }).nullable(),
2143
+ agents: z22.array(agentConfigSchema),
2144
+ skillRefs: z22.array(z22.string()),
2145
+ mcpRefs: z22.array(z22.string()),
2146
+ connectionIds: z22.array(z22.string()),
2071
2147
  cadence: ownedCadenceSchema,
2072
2148
  sampleCount: sampleCountSchema,
2073
- lastScheduledAt: z21.string().nullable(),
2074
- nextRunAt: z21.string().nullable()
2075
- });
2076
- var visibilityScenarioSchema = z21.object({
2077
- id: z21.string(),
2078
- repoUrl: z21.string().nullable(),
2079
- repoRef: z21.string().nullable(),
2080
- profile: z21.object({ id: z21.string(), name: z21.string() }).nullable()
2081
- });
2082
- var visibilityScenarioInputSchema = z21.object({
2083
- repoUrl: z21.string().nullish(),
2084
- repoRef: z21.string().nullish(),
2085
- profileId: z21.string().nullish()
2149
+ lastScheduledAt: z22.string().nullable(),
2150
+ nextRunAt: z22.string().nullable()
2151
+ });
2152
+ var visibilityScenarioSchema = z22.object({
2153
+ id: z22.string(),
2154
+ repoUrl: z22.string().nullable(),
2155
+ repoRef: z22.string().nullable(),
2156
+ profile: z22.object({ id: z22.string(), name: z22.string() }).nullable()
2157
+ });
2158
+ var visibilityScenarioInputSchema = z22.object({
2159
+ repoUrl: z22.string().nullish(),
2160
+ repoRef: z22.string().nullish(),
2161
+ profileId: z22.string().nullish()
2086
2162
  }).strict();
2087
2163
  var visibilityPromptSettingsInputShape = {
2088
2164
  agents: ownedConfigurationInputShape.agents,
@@ -2102,157 +2178,179 @@ var visibilityPromptSettingsPatchShape = {
2102
2178
  nextRunAt: ownedConfigurationPatchShape.nextRunAt,
2103
2179
  sampleCount: ownedConfigurationPatchShape.sampleCount
2104
2180
  };
2105
- var visibilityPromptSettingsSchema = z21.object({
2106
- agents: z21.array(agentConfigSchema),
2107
- skillRefs: z21.array(z21.string()),
2108
- mcpRefs: z21.array(z21.string()),
2109
- connectionIds: z21.array(z21.string()),
2181
+ var visibilityPromptSettingsSchema = z22.object({
2182
+ agents: z22.array(agentConfigSchema),
2183
+ skillRefs: z22.array(z22.string()),
2184
+ mcpRefs: z22.array(z22.string()),
2185
+ connectionIds: z22.array(z22.string()),
2110
2186
  cadence: ownedCadenceSchema,
2111
2187
  sampleCount: sampleCountSchema,
2112
- lastScheduledAt: z21.string().nullable(),
2113
- nextRunAt: z21.string().nullable()
2114
- });
2115
- var runAgentsOverrideSchema = z21.array(agentConfigInputSchema).min(1, "Select at least one agent");
2116
- var runEvalBodySchema = z21.object({ billToOrg: z21.boolean().optional() }).strict();
2117
- var runVisibilityBodySchema = z21.object({
2118
- billToOrg: z21.boolean().optional(),
2119
- visibilityScenarioIds: z21.array(z21.string().min(1)).min(1).optional()
2188
+ lastScheduledAt: z22.string().nullable(),
2189
+ nextRunAt: z22.string().nullable()
2190
+ });
2191
+ var runAgentsOverrideSchema = z22.array(agentConfigInputSchema).min(1, "Select at least one agent");
2192
+ var runEvalBodySchema = z22.object({ billToOrg: z22.boolean().optional() }).strict();
2193
+ var runVisibilityBodySchema = z22.object({
2194
+ billToOrg: z22.boolean().optional(),
2195
+ visibilityScenarioIds: z22.array(z22.string().min(1)).min(1).optional()
2120
2196
  }).strict();
2121
2197
 
2122
2198
  // ../packages/api-schemas/src/evals.ts
2123
- var criterionSchema = z22.object({
2124
- id: z22.string(),
2125
- name: z22.string(),
2126
- rubric: z22.string(),
2127
- position: z22.number().int()
2199
+ var criterionSchema = z23.object({
2200
+ id: z23.string(),
2201
+ name: z23.string(),
2202
+ rubric: z23.string(),
2203
+ position: z23.number().int()
2128
2204
  });
2129
- var criterionInputSchema = z22.object({
2205
+ var criterionInputSchema = z23.object({
2130
2206
  /** Present = update in place; absent = create. */
2131
- id: z22.string().optional(),
2207
+ id: z23.string().optional(),
2132
2208
  /** Label only; omit and the server derives it from the rubric. */
2133
- name: z22.string().min(1).optional(),
2134
- rubric: z22.string().min(1)
2209
+ name: z23.string().min(1).optional(),
2210
+ rubric: z23.string().min(1)
2135
2211
  });
2136
- var evalSetSchema = z22.object({
2137
- id: z22.string(),
2212
+ var evalSetSchema = z23.object({
2213
+ id: z23.string(),
2138
2214
  /** Repository-generated suite provenance; null for ordinary evals. */
2139
- suiteId: z22.string().nullable(),
2140
- name: z22.string(),
2141
- promptText: z22.string(),
2142
- createdAt: z22.string(),
2143
- criteria: z22.array(criterionSchema),
2215
+ suiteId: z23.string().nullable(),
2216
+ name: z23.string(),
2217
+ promptText: z23.string(),
2218
+ createdAt: z23.string(),
2219
+ criteria: z23.array(criterionSchema),
2144
2220
  /** User tag names on the hidden backing prompt (Surface:* excluded). */
2145
- tags: z22.array(z22.string())
2221
+ tags: z23.array(z23.string())
2146
2222
  }).extend(ownedConfigurationSchema.shape);
2147
- var agentPassRateSchema = z22.object({
2223
+ var agentPassRateSchema = z23.object({
2148
2224
  agent: agentSchema,
2149
- model: z22.string(),
2150
- runId: z22.string(),
2151
- finishedAt: z22.string().nullable(),
2152
- passed: z22.number().int(),
2153
- total: z22.number().int()
2154
- });
2155
- var evalSetStatSchema = z22.object({
2156
- passRates: z22.array(agentPassRateSchema),
2157
- runCount: z22.number().int(),
2225
+ model: z23.string(),
2226
+ runId: z23.string(),
2227
+ finishedAt: z23.string().nullable(),
2228
+ passed: z23.number().int(),
2229
+ total: z23.number().int()
2230
+ });
2231
+ var evalSetStatSchema = z23.object({
2232
+ passRates: z23.array(agentPassRateSchema),
2233
+ runCount: z23.number().int(),
2158
2234
  /** Run-level aggregate: a run passes only when every criterion passed. */
2159
- judgedRuns: z22.number().int(),
2160
- passedRuns: z22.number().int()
2235
+ judgedRuns: z23.number().int(),
2236
+ passedRuns: z23.number().int()
2161
2237
  });
2162
- var csv2 = z22.string().transform(
2238
+ var csv2 = z23.string().transform(
2163
2239
  (s) => s.split(",").map((x) => x.trim()).filter(Boolean)
2164
2240
  );
2165
- var listEvalSetsQuerySchema = z22.object({
2166
- agents: csv2.pipe(z22.array(agentSchema)).optional(),
2241
+ var listEvalSetsQuerySchema = z23.object({
2242
+ agents: csv2.pipe(z23.array(agentSchema)).optional(),
2167
2243
  models: csv2.optional(),
2168
- since: z22.coerce.date().optional()
2244
+ since: z23.coerce.date().optional()
2169
2245
  });
2170
2246
  var evalSetListItemSchema = evalSetSchema.extend({
2171
2247
  stats: evalSetStatSchema
2172
2248
  });
2173
- var listEvalSetsResponseSchema = z22.object({
2174
- items: z22.array(evalSetListItemSchema)
2249
+ var listEvalSetsResponseSchema = z23.object({
2250
+ items: z23.array(evalSetListItemSchema)
2175
2251
  });
2176
- var createEvalSetBodySchema = z22.object({
2177
- name: z22.string().min(1),
2178
- promptText: z22.string().min(1),
2179
- criteria: z22.array(criterionInputSchema).min(1),
2252
+ var createEvalSetBodySchema = z23.object({
2253
+ name: z23.string().min(1),
2254
+ promptText: z23.string().min(1),
2255
+ criteria: z23.array(criterionInputSchema).min(1),
2180
2256
  /** User tag names, create-on-type (Surface:* rejected/dropped). */
2181
- tags: z22.array(z22.string()).optional()
2257
+ tags: z23.array(z23.string()).optional()
2182
2258
  }).extend(ownedConfigurationInputSchema.shape).strict();
2183
- var updateEvalSetBodySchema = z22.object({
2184
- name: z22.string().min(1).optional(),
2185
- promptText: z22.string().min(1).optional(),
2186
- criteria: z22.array(criterionInputSchema).min(1).optional(),
2187
- tags: z22.array(z22.string()).optional()
2259
+ var updateEvalSetBodySchema = z23.object({
2260
+ name: z23.string().min(1).optional(),
2261
+ promptText: z23.string().min(1).optional(),
2262
+ criteria: z23.array(criterionInputSchema).min(1).optional(),
2263
+ tags: z23.array(z23.string()).optional()
2188
2264
  }).extend(ownedConfigurationPatchShape).strict();
2189
- var runEvalSetResponseSchema = z22.object({
2190
- batchIds: z22.array(z22.string()),
2191
- runIds: z22.array(z22.string()),
2265
+ var runEvalSetResponseSchema = z23.object({
2266
+ batchIds: z23.array(z23.string()),
2267
+ runIds: z23.array(z23.string()),
2192
2268
  /** Durable launch request; absent for older and climb-trial launch paths. */
2193
- runRequestId: z22.string().optional()
2269
+ runRequestId: z23.string().optional()
2194
2270
  });
2195
- var evalSetRunSchema = z22.object({
2196
- id: z22.string(),
2197
- status: z22.string(),
2271
+ var evalSetRunSchema = z23.object({
2272
+ id: z23.string(),
2273
+ status: z23.string(),
2198
2274
  agent: agentSchema,
2199
- model: z22.string().nullable(),
2200
- resolvedModel: z22.string().nullable(),
2201
- createdAt: z22.string(),
2202
- startedAt: z22.string().nullable(),
2203
- finishedAt: z22.string().nullable(),
2204
- failureReason: z22.string().nullable(),
2275
+ model: z23.string().nullable(),
2276
+ resolvedModel: z23.string().nullable(),
2277
+ createdAt: z23.string(),
2278
+ startedAt: z23.string().nullable(),
2279
+ finishedAt: z23.string().nullable(),
2280
+ failureReason: z23.string().nullable(),
2205
2281
  creditsCharged: runCreditsChargedSchema.optional(),
2206
2282
  triggeredBy: runTriggeredBySchema.optional(),
2207
- judge: z22.object({ status: z22.string(), error: z22.string().nullable() }).nullable(),
2208
- criterionResults: z22.array(
2209
- z22.object({
2210
- criterionId: z22.string().nullable(),
2211
- name: z22.string(),
2212
- passed: z22.boolean(),
2213
- reasoning: z22.string().nullable()
2283
+ judge: z23.object({ status: z23.string(), error: z23.string().nullable() }).nullable(),
2284
+ criterionResults: z23.array(
2285
+ z23.object({
2286
+ criterionId: z23.string().nullable(),
2287
+ name: z23.string(),
2288
+ passed: z23.boolean().nullable(),
2289
+ reasoning: z23.string().nullable()
2214
2290
  })
2215
2291
  )
2216
2292
  });
2217
2293
  var listEvalSetRunsResponseSchema = listResponseSchema(evalSetRunSchema);
2218
2294
 
2219
2295
  // ../packages/api-schemas/src/executionTargets.ts
2220
- import { z as z23 } from "zod";
2221
- var executionTargetCapabilitiesSchema = z23.object({
2222
- skills: z23.boolean(),
2223
- mcp: z23.boolean(),
2224
- connections: z23.boolean(),
2225
- agentContext: z23.boolean(),
2226
- resume: z23.boolean()
2227
- });
2228
- var executionTargetSchema = z23.object({
2296
+ import { z as z24 } from "zod";
2297
+ var executionTargetCapabilitiesSchema = z24.object({
2298
+ skills: z24.boolean(),
2299
+ mcp: z24.boolean(),
2300
+ connections: z24.boolean(),
2301
+ agentContext: z24.boolean(),
2302
+ resume: z24.boolean()
2303
+ });
2304
+ var executionTargetSchema = z24.object({
2229
2305
  harness: agentSchema,
2230
- harnessSlug: z23.string(),
2231
- harnessLabel: z23.string(),
2232
- model: z23.string(),
2233
- modelLabel: z23.string(),
2234
- providerSlug: z23.string(),
2235
- providerLabel: z23.string(),
2306
+ harnessSlug: z24.string(),
2307
+ harnessLabel: z24.string(),
2308
+ model: z24.string(),
2309
+ modelLabel: z24.string(),
2310
+ providerSlug: z24.string(),
2311
+ providerLabel: z24.string(),
2236
2312
  capabilities: executionTargetCapabilitiesSchema
2237
2313
  });
2238
- var executionTargetsResponseSchema = z23.object({
2239
- items: z23.array(executionTargetSchema)
2314
+ var executionTargetsResponseSchema = z24.object({
2315
+ items: z24.array(executionTargetSchema)
2316
+ });
2317
+
2318
+ // ../packages/api-schemas/src/feedback.ts
2319
+ var feedback_exports = {};
2320
+ __export(feedback_exports, {
2321
+ FEEDBACK_KINDS: () => FEEDBACK_KINDS,
2322
+ createFeedbackBodySchema: () => createFeedbackBodySchema,
2323
+ createFeedbackResponseSchema: () => createFeedbackResponseSchema,
2324
+ feedbackKindSchema: () => feedbackKindSchema
2325
+ });
2326
+ import { z as z25 } from "zod";
2327
+ var FEEDBACK_KINDS = ["friction", "missing", "bug", "other"];
2328
+ var feedbackKindSchema = z25.enum(FEEDBACK_KINDS);
2329
+ var createFeedbackBodySchema = z25.object({
2330
+ message: z25.string().trim().min(1).max(4e3),
2331
+ kind: feedbackKindSchema.default("other"),
2332
+ command: z25.string().trim().max(500).optional(),
2333
+ // Unresolvable orgs are dropped server-side rather than rejecting feedback.
2334
+ org: z25.string().optional()
2335
+ });
2336
+ var createFeedbackResponseSchema = z25.object({
2337
+ id: z25.string()
2240
2338
  });
2241
2339
 
2242
2340
  // ../packages/api-schemas/src/invites.ts
2243
- import { z as z24 } from "zod";
2244
- var inviteSchema = z24.object({
2245
- id: z24.string(),
2246
- email: z24.string(),
2247
- invitedBy: z24.object({
2248
- name: z24.string().nullable(),
2249
- email: z24.string().nullable()
2341
+ import { z as z26 } from "zod";
2342
+ var inviteSchema = z26.object({
2343
+ id: z26.string(),
2344
+ email: z26.string(),
2345
+ invitedBy: z26.object({
2346
+ name: z26.string().nullable(),
2347
+ email: z26.string().nullable()
2250
2348
  }),
2251
- createdAt: z24.string(),
2252
- expiresAt: z24.string()
2349
+ createdAt: z26.string(),
2350
+ expiresAt: z26.string()
2253
2351
  });
2254
- var listInvitesResponseSchema = z24.object({
2255
- items: z24.array(inviteSchema)
2352
+ var listInvitesResponseSchema = z26.object({
2353
+ items: z26.array(inviteSchema)
2256
2354
  });
2257
2355
 
2258
2356
  // ../packages/api-schemas/src/keys.ts
@@ -2265,177 +2363,177 @@ __export(keys_exports, {
2265
2363
  setProviderKeyBodySchema: () => setProviderKeyBodySchema,
2266
2364
  setProviderKeyResponseSchema: () => setProviderKeyResponseSchema
2267
2365
  });
2268
- import { z as z25 } from "zod";
2366
+ import { z as z27 } from "zod";
2269
2367
  var PROVIDER_TYPES = ["anthropic", "openai"];
2270
- var providerTypeSchema = z25.enum(PROVIDER_TYPES);
2271
- var setProviderKeyBodySchema = z25.object({
2368
+ var providerTypeSchema = z27.enum(PROVIDER_TYPES);
2369
+ var setProviderKeyBodySchema = z27.object({
2272
2370
  /** The raw provider API key. Verified + stored server-side (AWS Secrets
2273
2371
  * Manager); never persisted in the app DB and never echoed back. */
2274
- key: z25.string().min(1)
2372
+ key: z27.string().min(1)
2275
2373
  });
2276
- var setProviderKeyResponseSchema = z25.object({
2374
+ var setProviderKeyResponseSchema = z27.object({
2277
2375
  providerType: providerTypeSchema,
2278
- last4: z25.string()
2376
+ last4: z27.string()
2279
2377
  });
2280
- var providerKeySchema = z25.object({
2378
+ var providerKeySchema = z27.object({
2281
2379
  providerType: providerTypeSchema,
2282
- last4: z25.string(),
2283
- createdAt: z25.string(),
2380
+ last4: z27.string(),
2381
+ createdAt: z27.string(),
2284
2382
  /** When the key was last saved/rotated. */
2285
- updatedAt: z25.string()
2383
+ updatedAt: z27.string()
2286
2384
  });
2287
2385
  var providerKeyListResponseSchema = listResponseSchema(providerKeySchema);
2288
2386
 
2289
2387
  // ../packages/api-schemas/src/mcp.ts
2290
- import { z as z27 } from "zod";
2388
+ import { z as z29 } from "zod";
2291
2389
 
2292
2390
  // ../packages/api-schemas/src/skills.ts
2293
- import { z as z26 } from "zod";
2391
+ import { z as z28 } from "zod";
2294
2392
  var sha256Hex = sha256DigestSchema;
2295
- var skillHandleSchema = z26.string().min(1).max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/, "invalid skill handle").refine((name) => name !== "." && name !== "..", "invalid skill handle");
2296
- var skillSetEntrySchema = z26.object({
2297
- skillId: z26.string().min(1),
2393
+ var skillHandleSchema = z28.string().min(1).max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/, "invalid skill handle").refine((name) => name !== "." && name !== "..", "invalid skill handle");
2394
+ var skillSetEntrySchema = z28.object({
2395
+ skillId: z28.string().min(1),
2298
2396
  name: skillHandleSchema,
2299
- label: z26.string().min(1),
2397
+ label: z28.string().min(1),
2300
2398
  contentDigest: sha256Hex,
2301
2399
  blobDigest: sha256Hex,
2302
2400
  /** `cas/v2/<scope>/skills/sha256/<ab>/<blobDigest>.tar.zst`. */
2303
- blobKey: z26.string().min(1),
2401
+ blobKey: z28.string().min(1),
2304
2402
  /** Raw canonical-tar size. Bounds the decompression allocation when present. */
2305
- rawBytes: z26.number().int().positive().optional(),
2403
+ rawBytes: z28.number().int().positive().optional(),
2306
2404
  /** Stored compressed size, verified against the object when present. */
2307
- storedBytes: z26.number().int().positive().optional(),
2405
+ storedBytes: z28.number().int().positive().optional(),
2308
2406
  /**
2309
2407
  * What the MODEL sees, parsed from the frontmatter at push time
2310
2408
  * (`{ name, description, descriptionChars, bodyBytes }`). Carried through to
2311
2409
  * the trace for the record; the staging path never branches on it.
2312
2410
  */
2313
- exposure: z26.record(z26.string(), z26.unknown()).optional()
2411
+ exposure: z28.record(z28.string(), z28.unknown()).optional()
2314
2412
  });
2315
2413
  var MAX_SKILL_SET_ENTRIES = 32;
2316
- var skillSetSchema = z26.array(skillSetEntrySchema).max(
2414
+ var skillSetSchema = z28.array(skillSetEntrySchema).max(
2317
2415
  MAX_SKILL_SET_ENTRIES,
2318
2416
  `a run may stage at most ${MAX_SKILL_SET_ENTRIES} skills`
2319
2417
  );
2320
- var skillSourceWireSchema = z26.object({
2321
- repoFullName: z26.string(),
2322
- ref: z26.string(),
2323
- subpath: z26.string(),
2324
- autoIngest: z26.boolean(),
2325
- lastSeenCommit: z26.string().nullable(),
2326
- lastCheckedAt: z26.string().nullable(),
2327
- lastError: z26.string().nullable()
2328
- });
2329
- var skillVersionWireSchema = z26.object({
2330
- id: z26.string(),
2331
- label: z26.string(),
2332
- contentDigest: z26.string(),
2333
- ingestTrigger: z26.string().nullable(),
2334
- createdAt: z26.string()
2418
+ var skillSourceWireSchema = z28.object({
2419
+ repoFullName: z28.string(),
2420
+ ref: z28.string(),
2421
+ subpath: z28.string(),
2422
+ autoIngest: z28.boolean(),
2423
+ lastSeenCommit: z28.string().nullable(),
2424
+ lastCheckedAt: z28.string().nullable(),
2425
+ lastError: z28.string().nullable()
2426
+ });
2427
+ var skillVersionWireSchema = z28.object({
2428
+ id: z28.string(),
2429
+ label: z28.string(),
2430
+ contentDigest: z28.string(),
2431
+ ingestTrigger: z28.string().nullable(),
2432
+ createdAt: z28.string()
2335
2433
  });
2336
- var skillListItemSchema = z26.object({
2337
- id: z26.string(),
2434
+ var skillListItemSchema = z28.object({
2435
+ id: z28.string(),
2338
2436
  /** OUR storage handle — the {ref} segment. */
2339
2437
  name: skillHandleSchema,
2340
- note: z26.string().nullable(),
2438
+ note: z28.string().nullable(),
2341
2439
  source: skillSourceWireSchema.nullable(),
2342
2440
  latestVersion: skillVersionWireSchema.nullable(),
2343
- versionCount: z26.number().int(),
2344
- createdAt: z26.string(),
2345
- updatedAt: z26.string()
2441
+ versionCount: z28.number().int(),
2442
+ createdAt: z28.string(),
2443
+ updatedAt: z28.string()
2346
2444
  });
2347
- var listSkillsResponseSchema = z26.object({
2348
- items: z26.array(skillListItemSchema)
2445
+ var listSkillsResponseSchema = z28.object({
2446
+ items: z28.array(skillListItemSchema)
2349
2447
  });
2350
- var skillDetailSchema = skillListItemSchema.omit({ latestVersion: true }).extend({ versions: z26.array(skillVersionWireSchema) });
2351
- var addSkillBodySchema = z26.object({
2352
- reference: z26.string().min(1),
2448
+ var skillDetailSchema = skillListItemSchema.omit({ latestVersion: true }).extend({ versions: z28.array(skillVersionWireSchema) });
2449
+ var addSkillBodySchema = z28.object({
2450
+ reference: z28.string().min(1),
2353
2451
  /** OUR handle; defaults to the resolved directory basename. */
2354
2452
  handle: skillHandleSchema.optional(),
2355
2453
  /** Explicit version label — a typed label is intent and always mints;
2356
2454
  * omitted derives from the resolved anchor and dedups by digest. */
2357
- label: z26.string().min(1).max(120).optional(),
2455
+ label: z28.string().min(1).max(120).optional(),
2358
2456
  /** Select one skill from a source holding several. */
2359
- skill: z26.string().min(1).optional(),
2360
- note: z26.string().max(2e3).optional(),
2457
+ skill: z28.string().min(1).optional(),
2458
+ note: z28.string().max(2e3).optional(),
2361
2459
  /** Track the source branch for auto re-ingest (needs an explicit branch). */
2362
- trackSource: z26.boolean().optional()
2460
+ trackSource: z28.boolean().optional()
2363
2461
  });
2364
- var addSkillResponseSchema = z26.object({
2365
- skillId: z26.string().nullable(),
2366
- handle: z26.string(),
2367
- label: z26.string(),
2462
+ var addSkillResponseSchema = z28.object({
2463
+ skillId: z28.string().nullable(),
2464
+ handle: z28.string(),
2465
+ label: z28.string(),
2368
2466
  /** True = the newest version already carried this content; nothing minted. */
2369
- unchanged: z26.boolean()
2467
+ unchanged: z28.boolean()
2370
2468
  });
2371
- var updateSkillBodySchema = z26.object({
2469
+ var updateSkillBodySchema = z28.object({
2372
2470
  name: skillHandleSchema.optional(),
2373
- note: z26.string().max(2e3).nullish(),
2374
- source: z26.object({
2375
- repoFullName: z26.string().min(1),
2471
+ note: z28.string().max(2e3).nullish(),
2472
+ source: z28.object({
2473
+ repoFullName: z28.string().min(1),
2376
2474
  /** A branch name — never HEAD, never a SHA. */
2377
- ref: z26.string().min(1),
2378
- subpath: z26.string().optional(),
2379
- autoIngest: z26.boolean().optional()
2475
+ ref: z28.string().min(1),
2476
+ subpath: z28.string().optional(),
2477
+ autoIngest: z28.boolean().optional()
2380
2478
  }).nullish()
2381
2479
  });
2382
- var reingestSkillResponseSchema = z26.object({
2383
- label: z26.string().nullable(),
2480
+ var reingestSkillResponseSchema = z28.object({
2481
+ label: z28.string().nullable(),
2384
2482
  /** True = "already current": the source content matches the newest version. */
2385
- unchanged: z26.boolean()
2483
+ unchanged: z28.boolean()
2386
2484
  });
2387
- var addSkillVersionBodySchema = z26.object({
2388
- reference: z26.string().min(1),
2485
+ var addSkillVersionBodySchema = z28.object({
2486
+ reference: z28.string().min(1),
2389
2487
  /** Omitted defaults to the ref name (branch/tag), else the anchor. */
2390
- label: z26.string().min(1).max(120).optional()
2391
- });
2392
- var addSkillVersionResponseSchema = z26.object({
2393
- label: z26.string(),
2394
- unchanged: z26.boolean()
2395
- });
2396
- var skillRunWireSchema = z26.object({
2397
- runId: z26.string(),
2398
- agent: z26.string(),
2399
- turns: z26.number().int().nullable(),
2400
- durationMs: z26.number().int().nullable(),
2401
- costUsd: z26.number().nullable(),
2402
- finishedAt: z26.string().nullable(),
2488
+ label: z28.string().min(1).max(120).optional()
2489
+ });
2490
+ var addSkillVersionResponseSchema = z28.object({
2491
+ label: z28.string(),
2492
+ unchanged: z28.boolean()
2493
+ });
2494
+ var skillRunWireSchema = z28.object({
2495
+ runId: z28.string(),
2496
+ agent: z28.string(),
2497
+ turns: z28.number().int().nullable(),
2498
+ durationMs: z28.number().int().nullable(),
2499
+ costUsd: z28.number().nullable(),
2500
+ finishedAt: z28.string().nullable(),
2403
2501
  /** WHICH version of the skill the session staged. */
2404
- versionLabel: z26.string().nullable()
2502
+ versionLabel: z28.string().nullable()
2405
2503
  });
2406
- var listSkillRunsResponseSchema = z26.object({
2407
- items: z26.array(skillRunWireSchema)
2504
+ var listSkillRunsResponseSchema = z28.object({
2505
+ items: z28.array(skillRunWireSchema)
2408
2506
  });
2409
2507
 
2410
2508
  // ../packages/api-schemas/src/mcp.ts
2411
2509
  var mcpServerHandleSchema = skillHandleSchema;
2412
2510
  var MCP_SPEC_VERSION = 1;
2413
- var envVarNameSchema = z27.string().min(1).max(128).regex(
2511
+ var envVarNameSchema = z29.string().min(1).max(128).regex(
2414
2512
  /^[A-Za-z_][A-Za-z0-9_]*$/,
2415
2513
  "an environment variable name (letters, digits, underscore; not starting with a digit)"
2416
2514
  );
2417
- var headerNameSchema2 = z27.string().min(1).max(128).regex(
2515
+ var headerNameSchema2 = z29.string().min(1).max(128).regex(
2418
2516
  /^[A-Za-z0-9!#$%&'*+\-.^_`|~]+$/,
2419
2517
  "an HTTP header name (a token \u2014 no colon, no spaces)"
2420
2518
  );
2421
- var mcpToolSchema = z27.object({
2422
- name: z27.string().min(1).max(128),
2423
- description: z27.string().max(4096).optional()
2519
+ var mcpToolSchema = z29.object({
2520
+ name: z29.string().min(1).max(128),
2521
+ description: z29.string().max(4096).optional()
2424
2522
  });
2425
- var mcpSpecSchema = z27.object({
2426
- specVersion: z27.literal(MCP_SPEC_VERSION),
2427
- transport: z27.enum(["stdio", "http"]),
2523
+ var mcpSpecSchema = z29.object({
2524
+ specVersion: z29.literal(MCP_SPEC_VERSION),
2525
+ transport: z29.enum(["stdio", "http"]),
2428
2526
  // stdio
2429
- command: z27.string().min(1).max(512).optional(),
2430
- args: z27.array(z27.string().max(4096)).max(64).optional(),
2431
- envNames: z27.array(envVarNameSchema).max(32).optional(),
2527
+ command: z29.string().min(1).max(512).optional(),
2528
+ args: z29.array(z29.string().max(4096)).max(64).optional(),
2529
+ envNames: z29.array(envVarNameSchema).max(32).optional(),
2432
2530
  // http
2433
- url: z27.string().url().max(2048).optional(),
2434
- headerNames: z27.array(headerNameSchema2).max(32).optional(),
2531
+ url: z29.string().url().max(2048).optional(),
2532
+ headerNames: z29.array(headerNameSchema2).max(32).optional(),
2435
2533
  // display only — outside the digest (D13)
2436
2534
  serverName: mcpServerHandleSchema,
2437
- description: z27.string().max(4096).optional(),
2438
- tools: z27.array(mcpToolSchema).max(256).optional()
2535
+ description: z29.string().max(4096).optional(),
2536
+ tools: z29.array(mcpToolSchema).max(256).optional()
2439
2537
  }).strict().superRefine((spec, ctx) => {
2440
2538
  if (spec.transport === "stdio") {
2441
2539
  if (!spec.command) {
@@ -2479,17 +2577,17 @@ var mcpSpecSchema = z27.object({
2479
2577
  }
2480
2578
  }
2481
2579
  });
2482
- var mcpExposureSchema = z27.object({
2483
- serverName: z27.string().min(1),
2484
- description: z27.string().optional(),
2485
- tools: z27.array(mcpToolSchema).default([]),
2580
+ var mcpExposureSchema = z29.object({
2581
+ serverName: z29.string().min(1),
2582
+ description: z29.string().optional(),
2583
+ tools: z29.array(mcpToolSchema).default([]),
2486
2584
  /** Declared credential NAMES, mirrored here so the picker and the index row can
2487
2585
  * render the contract without parsing `spec`. Never values. */
2488
- envNames: z27.array(z27.string()).default([]),
2489
- headerNames: z27.array(z27.string()).default([])
2586
+ envNames: z29.array(z29.string()).default([]),
2587
+ headerNames: z29.array(z29.string()).default([])
2490
2588
  });
2491
- var mcpWarningSchema = z27.object({
2492
- code: z27.enum([
2589
+ var mcpWarningSchema = z29.object({
2590
+ code: z29.enum([
2493
2591
  "unpinned_package",
2494
2592
  "credential_required",
2495
2593
  "value_discarded",
@@ -2499,139 +2597,139 @@ var mcpWarningSchema = z27.object({
2499
2597
  // contract was recorded when none was (Bugbot, medium).
2500
2598
  "flag_ignored"
2501
2599
  ]),
2502
- message: z27.string()
2600
+ message: z29.string()
2503
2601
  });
2504
- var mcpSetEntrySchema = z27.object({
2602
+ var mcpSetEntrySchema = z29.object({
2505
2603
  /** `McpServer.id` — the stable handle a UI chip links back to; `label` already
2506
2604
  * names the version, so this is deliberately not `McpServerVersion.id`. */
2507
- serverId: z27.string().min(1),
2605
+ serverId: z29.string().min(1),
2508
2606
  /** `McpServer.name` — OUR handle, and the CONFIG KEY the serializer writes. NOT
2509
2607
  * the agent-visible `spec.serverName`. */
2510
2608
  name: mcpServerHandleSchema,
2511
- label: z27.string().min(1),
2512
- specDigest: z27.string().min(1),
2609
+ label: z29.string().min(1),
2610
+ specDigest: z29.string().min(1),
2513
2611
  spec: mcpSpecSchema,
2514
2612
  /** Declared tools/description as at authoring time. The preparation path never
2515
2613
  * branches on it; it rides along for the trace and the UI. */
2516
- exposure: z27.record(z27.string(), z27.unknown()).optional(),
2614
+ exposure: z29.record(z29.string(), z29.unknown()).optional(),
2517
2615
  /** Connection selected by this immutable MCP version. The matching non-secret
2518
2616
  * provider metadata lives in Batch.connectionSet. */
2519
- connectionId: z27.string().min(1).optional()
2617
+ connectionId: z29.string().min(1).optional()
2520
2618
  });
2521
2619
  var MAX_MCP_SET_ENTRIES = 8;
2522
- var mcpSetSchema = z27.array(mcpSetEntrySchema).max(
2620
+ var mcpSetSchema = z29.array(mcpSetEntrySchema).max(
2523
2621
  MAX_MCP_SET_ENTRIES,
2524
2622
  `a run may prepare at most ${MAX_MCP_SET_ENTRIES} MCP servers`
2525
2623
  );
2526
- var mcpRefSchema = z27.string().min(3).max(320).regex(
2624
+ var mcpRefSchema = z29.string().min(3).max(320).regex(
2527
2625
  /^[A-Za-z0-9][A-Za-z0-9._-]*@[^,]+$/,
2528
2626
  'an MCP server reference must be "name@label" (a bare name is not a reference)'
2529
2627
  );
2530
- var mcpRefsSchema = z27.array(mcpRefSchema).max(MAX_MCP_SET_ENTRIES);
2531
- var mcpVersionWireSchema = z27.object({
2532
- id: z27.string(),
2533
- label: z27.string(),
2534
- specDigest: z27.string(),
2628
+ var mcpRefsSchema = z29.array(mcpRefSchema).max(MAX_MCP_SET_ENTRIES);
2629
+ var mcpVersionWireSchema = z29.object({
2630
+ id: z29.string(),
2631
+ label: z29.string(),
2632
+ specDigest: z29.string(),
2535
2633
  spec: mcpSpecSchema,
2536
2634
  exposure: mcpExposureSchema,
2537
- warnings: z27.array(mcpWarningSchema),
2538
- createdAt: z27.string()
2635
+ warnings: z29.array(mcpWarningSchema),
2636
+ createdAt: z29.string()
2539
2637
  });
2540
- var mcpServerListItemSchema = z27.object({
2541
- id: z27.string(),
2638
+ var mcpServerListItemSchema = z29.object({
2639
+ id: z29.string(),
2542
2640
  /** OUR handle — the {ref} segment and the config key the serializer writes. */
2543
2641
  name: mcpServerHandleSchema,
2544
- note: z27.string().nullable(),
2642
+ note: z29.string().nullable(),
2545
2643
  latestVersion: mcpVersionWireSchema.nullable(),
2546
- versionCount: z27.number().int(),
2547
- createdAt: z27.string(),
2548
- updatedAt: z27.string()
2644
+ versionCount: z29.number().int(),
2645
+ createdAt: z29.string(),
2646
+ updatedAt: z29.string()
2549
2647
  });
2550
- var listMcpServersResponseSchema = z27.object({
2551
- items: z27.array(mcpServerListItemSchema)
2648
+ var listMcpServersResponseSchema = z29.object({
2649
+ items: z29.array(mcpServerListItemSchema)
2552
2650
  });
2553
- var mcpServerDetailSchema = mcpServerListItemSchema.omit({ latestVersion: true }).extend({ versions: z27.array(mcpVersionWireSchema) });
2554
- var saveMcpServerBodySchema = z27.object({
2651
+ var mcpServerDetailSchema = mcpServerListItemSchema.omit({ latestVersion: true }).extend({ versions: z29.array(mcpVersionWireSchema) });
2652
+ var saveMcpServerBodySchema = z29.object({
2555
2653
  name: mcpServerHandleSchema,
2556
- spec: z27.unknown(),
2654
+ spec: z29.unknown(),
2557
2655
  /** A typed label is intent and always mints; omitted defaults to a UTC
2558
2656
  * timestamp label and dedups by spec digest. */
2559
- label: z27.string().min(1).max(120).optional(),
2560
- note: z27.string().max(2e3).optional()
2561
- });
2562
- var saveMcpServerResponseSchema = z27.object({
2563
- serverId: z27.string().nullable(),
2564
- handle: z27.string(),
2565
- label: z27.string(),
2566
- specDigest: z27.string(),
2567
- warnings: z27.array(mcpWarningSchema),
2657
+ label: z29.string().min(1).max(120).optional(),
2658
+ note: z29.string().max(2e3).optional()
2659
+ });
2660
+ var saveMcpServerResponseSchema = z29.object({
2661
+ serverId: z29.string().nullable(),
2662
+ handle: z29.string(),
2663
+ label: z29.string(),
2664
+ specDigest: z29.string(),
2665
+ warnings: z29.array(mcpWarningSchema),
2568
2666
  /** True = the newest version already carries this exact spec. */
2569
- unchanged: z27.boolean(),
2667
+ unchanged: z29.boolean(),
2570
2668
  /** Display-only rendered invocation or URL. */
2571
- invocation: z27.string()
2669
+ invocation: z29.string()
2572
2670
  });
2573
- var updateMcpServerBodySchema = z27.object({
2671
+ var updateMcpServerBodySchema = z29.object({
2574
2672
  name: mcpServerHandleSchema.optional(),
2575
- note: z27.string().max(2e3).nullish()
2673
+ note: z29.string().max(2e3).nullish()
2576
2674
  });
2577
2675
 
2578
2676
  // ../packages/api-schemas/src/me.ts
2579
- import { z as z28 } from "zod";
2580
- var meUserSchema = z28.object({
2581
- id: z28.string(),
2582
- email: z28.string().nullable(),
2583
- isSuperuser: z28.boolean()
2677
+ import { z as z30 } from "zod";
2678
+ var meUserSchema = z30.object({
2679
+ id: z30.string(),
2680
+ email: z30.string().nullable(),
2681
+ isSuperuser: z30.boolean()
2584
2682
  });
2585
- var meOrgSchema = z28.object({
2586
- slug: z28.string(),
2683
+ var meOrgSchema = z30.object({
2684
+ slug: z30.string(),
2587
2685
  // Gauge's immutable Organization.public_id; null for LOCAL orgs.
2588
- publicId: z28.string().nullable(),
2589
- name: z28.string()
2686
+ publicId: z30.string().nullable(),
2687
+ name: z30.string()
2590
2688
  });
2591
- var meResponseSchema = z28.object({
2689
+ var meResponseSchema = z30.object({
2592
2690
  user: meUserSchema,
2593
2691
  // Membership-scoped for normal users; superusers see every org (mirrors the
2594
2692
  // web tier's userOrgs).
2595
- orgs: z28.array(meOrgSchema)
2693
+ orgs: z30.array(meOrgSchema)
2596
2694
  });
2597
2695
 
2598
2696
  // ../packages/api-schemas/src/optimizations.ts
2599
- import { z as z35 } from "zod";
2697
+ import { z as z37 } from "zod";
2600
2698
 
2601
2699
  // ../packages/api-schemas/src/candidate-delivery.ts
2602
- import { z as z29 } from "zod";
2603
- var candidateDeliverySchema = z29.object({
2604
- runId: z29.string(),
2605
- attempt: z29.number().int().nonnegative(),
2606
- surface: z29.enum(["docs", "cli"]),
2607
- candidateDigest: z29.string(),
2608
- installed: z29.boolean(),
2609
- evidenceComplete: z29.boolean(),
2610
- exposure: z29.enum(["exercised", "not_exercised", "unknown"]),
2611
- deliveryFailures: z29.number().int().nonnegative(),
2612
- observedArtifacts: z29.array(z29.string()).max(512),
2613
- expectedArtifacts: z29.array(z29.string()).max(512)
2700
+ import { z as z31 } from "zod";
2701
+ var candidateDeliverySchema = z31.object({
2702
+ runId: z31.string(),
2703
+ attempt: z31.number().int().nonnegative(),
2704
+ surface: z31.enum(["docs", "cli"]),
2705
+ candidateDigest: z31.string(),
2706
+ installed: z31.boolean(),
2707
+ evidenceComplete: z31.boolean(),
2708
+ exposure: z31.enum(["exercised", "not_exercised", "unknown"]),
2709
+ deliveryFailures: z31.number().int().nonnegative(),
2710
+ observedArtifacts: z31.array(z31.string()).max(512),
2711
+ expectedArtifacts: z31.array(z31.string()).max(512)
2614
2712
  });
2615
2713
 
2616
2714
  // ../packages/api-schemas/src/candidate-starts.ts
2617
- import { z as z30 } from "zod";
2715
+ import { z as z32 } from "zod";
2618
2716
  var slot = {
2619
- configurationIndex: z30.number().int().nonnegative(),
2620
- repetitionIndex: z30.number().int().nonnegative()
2717
+ configurationIndex: z32.number().int().nonnegative(),
2718
+ repetitionIndex: z32.number().int().nonnegative()
2621
2719
  };
2622
- var candidateStartSchema = z30.discriminatedUnion("kind", [
2623
- z30.object({
2720
+ var candidateStartSchema = z32.discriminatedUnion("kind", [
2721
+ z32.object({
2624
2722
  ...slot,
2625
- kind: z30.literal("checkpoint"),
2626
- checkpointId: z30.string().min(1)
2723
+ kind: z32.literal("checkpoint"),
2724
+ checkpointId: z32.string().min(1)
2627
2725
  }).strict(),
2628
- z30.object({
2726
+ z32.object({
2629
2727
  ...slot,
2630
- kind: z30.literal("fresh"),
2631
- reason: z30.string().min(1).max(1024)
2728
+ kind: z32.literal("fresh"),
2729
+ reason: z32.string().min(1).max(1024)
2632
2730
  }).strict()
2633
2731
  ]);
2634
- var candidateStartsSchema = z30.array(candidateStartSchema).refine(
2732
+ var candidateStartsSchema = z32.array(candidateStartSchema).refine(
2635
2733
  (rows) => new Set(
2636
2734
  rows.map((row2) => `${row2.configurationIndex}:${row2.repetitionIndex}`)
2637
2735
  ).size === rows.length,
@@ -2639,8 +2737,8 @@ var candidateStartsSchema = z30.array(candidateStartSchema).refine(
2639
2737
  );
2640
2738
 
2641
2739
  // ../packages/api-schemas/src/cli-rule-evidence.ts
2642
- import { z as z31 } from "zod";
2643
- var cliRuleDeliverySchema = z31.enum([
2740
+ import { z as z33 } from "zod";
2741
+ var cliRuleDeliverySchema = z33.enum([
2644
2742
  "applied",
2645
2743
  "matched_unchanged",
2646
2744
  "not_exercised",
@@ -2648,94 +2746,94 @@ var cliRuleDeliverySchema = z31.enum([
2648
2746
  "partial",
2649
2747
  "unavailable"
2650
2748
  ]);
2651
- var cliRuleInvocationResultSchema = z31.object({
2652
- invocationId: z31.string(),
2653
- ruleId: z31.string(),
2654
- engineSha256: z31.string(),
2655
- entrypointSha256: z31.string(),
2656
- outcome: z31.number().nullable(),
2657
- complete: z31.boolean(),
2658
- deliveryFailure: z31.boolean().nullable(),
2659
- failureReason: z31.string().nullable().optional(),
2660
- inputs: z31.array(
2661
- z31.object({
2662
- operationId: z31.string(),
2663
- kind: z31.string(),
2664
- key: z31.string(),
2665
- source: z31.string(),
2666
- sourceKey: z31.string(),
2667
- present: z31.boolean(),
2668
- sourceBytes: z31.number(),
2669
- applied: z31.boolean(),
2670
- preflight: z31.boolean(),
2671
- deliveredBytes: z31.number(),
2672
- originalStdin: z31.literal("not_read")
2749
+ var cliRuleInvocationResultSchema = z33.object({
2750
+ invocationId: z33.string(),
2751
+ ruleId: z33.string(),
2752
+ engineSha256: z33.string(),
2753
+ entrypointSha256: z33.string(),
2754
+ outcome: z33.number().nullable(),
2755
+ complete: z33.boolean(),
2756
+ deliveryFailure: z33.boolean().nullable(),
2757
+ failureReason: z33.string().nullable().optional(),
2758
+ inputs: z33.array(
2759
+ z33.object({
2760
+ operationId: z33.string(),
2761
+ kind: z33.string(),
2762
+ key: z33.string(),
2763
+ source: z33.string(),
2764
+ sourceKey: z33.string(),
2765
+ present: z33.boolean(),
2766
+ sourceBytes: z33.number(),
2767
+ applied: z33.boolean(),
2768
+ preflight: z33.boolean(),
2769
+ deliveredBytes: z33.number(),
2770
+ originalStdin: z33.literal("not_read")
2673
2771
  })
2674
2772
  ).max(50).default([]),
2675
- operations: z31.array(
2676
- z31.object({
2677
- id: z31.string(),
2678
- kind: z31.string(),
2679
- count: z31.number().nullable()
2773
+ operations: z33.array(
2774
+ z33.object({
2775
+ id: z33.string(),
2776
+ kind: z33.string(),
2777
+ count: z33.number().nullable()
2680
2778
  })
2681
2779
  ).max(50),
2682
- excerpts: z31.array(
2683
- z31.object({
2684
- stream: z31.enum(["stdout", "stderr", "combined", "stdin"]),
2685
- before: z31.string().max(4096),
2686
- after: z31.string().max(4096),
2687
- originalBytes: z31.number().nullable(),
2688
- deliveredBytes: z31.number().nullable(),
2689
- omitted: z31.boolean(),
2690
- redacted: z31.boolean().optional(),
2691
- beforeTruncated: z31.boolean().optional(),
2692
- afterTruncated: z31.boolean().optional(),
2693
- omissionReason: z31.string().max(128).optional()
2780
+ excerpts: z33.array(
2781
+ z33.object({
2782
+ stream: z33.enum(["stdout", "stderr", "combined", "stdin"]),
2783
+ before: z33.string().max(4096),
2784
+ after: z33.string().max(4096),
2785
+ originalBytes: z33.number().nullable(),
2786
+ deliveredBytes: z33.number().nullable(),
2787
+ omitted: z33.boolean(),
2788
+ redacted: z33.boolean().optional(),
2789
+ beforeTruncated: z33.boolean().optional(),
2790
+ afterTruncated: z33.boolean().optional(),
2791
+ omissionReason: z33.string().max(128).optional()
2694
2792
  })
2695
2793
  ).max(4)
2696
2794
  });
2697
- var cliRuleSummarySchema = z31.object({
2698
- protocolVersion: z31.literal(3),
2699
- bundleSha256: z31.string(),
2700
- journalSha256: z31.string().nullable(),
2701
- journalComplete: z31.boolean(),
2702
- journalLimited: z31.boolean(),
2795
+ var cliRuleSummarySchema = z33.object({
2796
+ protocolVersion: z33.literal(3),
2797
+ bundleSha256: z33.string(),
2798
+ journalSha256: z33.string().nullable(),
2799
+ journalComplete: z33.boolean(),
2800
+ journalLimited: z33.boolean(),
2703
2801
  delivery: cliRuleDeliverySchema,
2704
- appliedInvocations: z31.number(),
2705
- matchedInvocations: z31.number(),
2706
- recognizedInvocations: z31.number().optional(),
2707
- unmatchedInvocations: z31.number().optional(),
2708
- unsupportedInvocations: z31.number(),
2709
- retainedExcerptBytes: z31.number(),
2710
- diagnostics: z31.array(z31.string().max(256)).max(50),
2711
- observations: z31.array(
2712
- z31.object({
2713
- invocationId: z31.string(),
2714
- ruleId: z31.string().nullable(),
2715
- reason: z31.string(),
2716
- entrypointSha256: z31.string().nullable(),
2717
- launchForm: z31.string().nullable(),
2718
- ioProfile: z31.string().nullable()
2802
+ appliedInvocations: z33.number(),
2803
+ matchedInvocations: z33.number(),
2804
+ recognizedInvocations: z33.number().optional(),
2805
+ unmatchedInvocations: z33.number().optional(),
2806
+ unsupportedInvocations: z33.number(),
2807
+ retainedExcerptBytes: z33.number(),
2808
+ diagnostics: z33.array(z33.string().max(256)).max(50),
2809
+ observations: z33.array(
2810
+ z33.object({
2811
+ invocationId: z33.string(),
2812
+ ruleId: z33.string().nullable(),
2813
+ reason: z33.string(),
2814
+ entrypointSha256: z33.string().nullable(),
2815
+ launchForm: z33.string().nullable(),
2816
+ ioProfile: z33.string().nullable()
2719
2817
  })
2720
2818
  ).max(200).optional()
2721
2819
  });
2722
- var cliRuleCoverageSchema = z31.object({
2723
- invocationCount: z31.number(),
2724
- observedInvocationCount: z31.number().nullable(),
2725
- appliedInvocationCount: z31.number(),
2726
- incompleteCount: z31.number(),
2727
- unsupportedCount: z31.number(),
2728
- instrumentationFailed: z31.boolean(),
2729
- unsupportedDiagnostics: z31.array(z31.string()),
2820
+ var cliRuleCoverageSchema = z33.object({
2821
+ invocationCount: z33.number(),
2822
+ observedInvocationCount: z33.number().nullable(),
2823
+ appliedInvocationCount: z33.number(),
2824
+ incompleteCount: z33.number(),
2825
+ unsupportedCount: z33.number(),
2826
+ instrumentationFailed: z33.boolean(),
2827
+ unsupportedDiagnostics: z33.array(z33.string()),
2730
2828
  v3: cliRuleSummarySchema,
2731
- invocations: z31.array(cliRuleInvocationResultSchema).default([])
2829
+ invocations: z33.array(cliRuleInvocationResultSchema).default([])
2732
2830
  });
2733
2831
 
2734
2832
  // ../packages/api-schemas/src/climb.ts
2735
- import { z as z34 } from "zod";
2833
+ import { z as z36 } from "zod";
2736
2834
 
2737
2835
  // ../packages/api-schemas/src/cli-rules.ts
2738
- import { z as z32 } from "zod";
2836
+ import { z as z34 } from "zod";
2739
2837
 
2740
2838
  // ../packages/api-schemas/src/cli-rule-arguments.ts
2741
2839
  function parseCliRuleArguments(argv, arity) {
@@ -2798,7 +2896,7 @@ var CLI_RULE_LIMITS = {
2798
2896
  };
2799
2897
  var encoder = new TextEncoder();
2800
2898
  var cliUtf8Bytes = (value) => encoder.encode(value).length;
2801
- var text = (max, nonempty = false) => z32.string().superRefine((value, ctx) => {
2899
+ var text = (max, nonempty = false) => z34.string().superRefine((value, ctx) => {
2802
2900
  if (nonempty && !value.length || cliUtf8Bytes(value) > max || /\0|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/u.test(
2803
2901
  value
2804
2902
  ))
@@ -2807,26 +2905,26 @@ var text = (max, nonempty = false) => z32.string().superRefine((value, ctx) => {
2807
2905
  message: `Use valid non-NUL UTF-8 text of at most ${max} bytes${nonempty ? ", not empty" : ""}`
2808
2906
  });
2809
2907
  });
2810
- var id = z32.string().regex(/^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/);
2811
- var flag = z32.string().regex(/^(?:-[A-Za-z0-9]|--[A-Za-z0-9][A-Za-z0-9-]{0,125})$/);
2812
- var envKey = z32.string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,126}$/);
2908
+ var id = z34.string().regex(/^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/);
2909
+ var flag = z34.string().regex(/^(?:-[A-Za-z0-9]|--[A-Za-z0-9][A-Za-z0-9-]{0,125})$/);
2910
+ var envKey = z34.string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,126}$/);
2813
2911
  var arg = text(CLI_RULE_LIMITS.argumentBytes);
2814
2912
  var literal = text(CLI_RULE_LIMITS.literalBytes);
2815
- var stream = z32.enum(["stdout", "stderr", "combined"]);
2816
- var exit = z32.discriminatedUnion("kind", [
2817
- z32.object({ kind: z32.literal("any") }).strict(),
2818
- z32.object({
2819
- kind: z32.literal("code"),
2820
- value: z32.number().int().min(0).max(255)
2913
+ var stream = z34.enum(["stdout", "stderr", "combined"]);
2914
+ var exit = z34.discriminatedUnion("kind", [
2915
+ z34.object({ kind: z34.literal("any") }).strict(),
2916
+ z34.object({
2917
+ kind: z34.literal("code"),
2918
+ value: z34.number().int().min(0).max(255)
2821
2919
  }).strict()
2822
2920
  ]);
2823
2921
  var buffer = {
2824
- maxBufferBytes: z32.number().int().min(1).max(CLI_RULE_LIMITS.bufferBytes).default(CLI_RULE_LIMITS.bufferBytes),
2825
- maxWaitMs: z32.number().int().min(1).max(CLI_RULE_LIMITS.maxBufferWaitMs).default(CLI_RULE_LIMITS.bufferWaitMs)
2922
+ maxBufferBytes: z34.number().int().min(1).max(CLI_RULE_LIMITS.bufferBytes).default(CLI_RULE_LIMITS.bufferBytes),
2923
+ maxWaitMs: z34.number().int().min(1).max(CLI_RULE_LIMITS.maxBufferWaitMs).default(CLI_RULE_LIMITS.bufferWaitMs)
2826
2924
  };
2827
- var source = (value) => z32.discriminatedUnion("source", [
2828
- z32.object({ source: z32.literal("literal"), value }).strict(),
2829
- z32.object({ source: z32.literal("localFact"), key: envKey }).strict()
2925
+ var source = (value) => z34.discriminatedUnion("source", [
2926
+ z34.object({ source: z34.literal("literal"), value }).strict(),
2927
+ z34.object({ source: z34.literal("localFact"), key: envKey }).strict()
2830
2928
  ]);
2831
2929
  function cliBoundedPattern(pattern) {
2832
2930
  let at = pattern.startsWith("^") ? 1 : 0;
@@ -2847,62 +2945,62 @@ function cliBoundedPattern(pattern) {
2847
2945
  }
2848
2946
  return literals > 0;
2849
2947
  }
2850
- var cliRuleTargetSchema = z32.discriminatedUnion("kind", [
2851
- z32.object({
2852
- kind: z32.literal("npmBin"),
2853
- packageName: z32.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/),
2854
- program: z32.string().max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/)
2948
+ var cliRuleTargetSchema = z34.discriminatedUnion("kind", [
2949
+ z34.object({
2950
+ kind: z34.literal("npmBin"),
2951
+ packageName: z34.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/),
2952
+ program: z34.string().max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/)
2855
2953
  }).strict(),
2856
- z32.object({
2857
- kind: z32.literal("path"),
2954
+ z34.object({
2955
+ kind: z34.literal("path"),
2858
2956
  path: text(1024, true).refine(
2859
2957
  (value) => !value.includes("\\") && !value.split("/").includes(".."),
2860
2958
  "Use a sandbox path without traversal"
2861
2959
  )
2862
2960
  }).strict()
2863
2961
  ]);
2864
- var cliRuleSelectorSchema = z32.discriminatedUnion("kind", [
2865
- z32.object({
2866
- kind: z32.literal("exact"),
2867
- argv: z32.array(arg).max(CLI_RULE_LIMITS.arguments - 1)
2962
+ var cliRuleSelectorSchema = z34.discriminatedUnion("kind", [
2963
+ z34.object({
2964
+ kind: z34.literal("exact"),
2965
+ argv: z34.array(arg).max(CLI_RULE_LIMITS.arguments - 1)
2868
2966
  }).strict(),
2869
- z32.object({
2870
- kind: z32.literal("command"),
2871
- positionals: z32.object({
2872
- mode: z32.enum(["exact", "prefix"]),
2873
- tokens: z32.array(arg).max(CLI_RULE_LIMITS.arguments - 1)
2967
+ z34.object({
2968
+ kind: z34.literal("command"),
2969
+ positionals: z34.object({
2970
+ mode: z34.enum(["exact", "prefix"]),
2971
+ tokens: z34.array(arg).max(CLI_RULE_LIMITS.arguments - 1)
2874
2972
  }).strict(),
2875
- optionsPresent: z32.array(flag).max(100).default([]),
2876
- optionsAbsent: z32.array(flag).max(100).default([]),
2877
- optionValues: z32.record(flag, arg).default({})
2973
+ optionsPresent: z34.array(flag).max(100).default([]),
2974
+ optionsAbsent: z34.array(flag).max(100).default([]),
2975
+ optionValues: z34.record(flag, arg).default({})
2878
2976
  }).strict()
2879
2977
  ]);
2880
- var cliRuleOperationSchema = z32.discriminatedUnion("kind", [
2881
- z32.object({
2978
+ var cliRuleOperationSchema = z34.discriminatedUnion("kind", [
2979
+ z34.object({
2882
2980
  id,
2883
- kind: z32.literal("replaceOutput"),
2981
+ kind: z34.literal("replaceOutput"),
2884
2982
  stream,
2885
2983
  exit,
2886
2984
  replacement: literal,
2887
2985
  ...buffer
2888
2986
  }).strict(),
2889
- z32.object({
2987
+ z34.object({
2890
2988
  id,
2891
- kind: z32.literal("streamOutput"),
2989
+ kind: z34.literal("streamOutput"),
2892
2990
  stream,
2893
- edit: z32.object({ find: text(8192, true), replace: literal }).strict()
2991
+ edit: z34.object({ find: text(8192, true), replace: literal }).strict()
2894
2992
  }).strict(),
2895
- z32.object({
2993
+ z34.object({
2896
2994
  id,
2897
- kind: z32.literal("completeOutput"),
2995
+ kind: z34.literal("completeOutput"),
2898
2996
  stream,
2899
2997
  exit,
2900
2998
  replace: literal,
2901
2999
  ...buffer,
2902
- matcher: z32.discriminatedUnion("kind", [
2903
- z32.object({ kind: z32.literal("literal"), text: text(8192, true) }).strict(),
2904
- z32.object({
2905
- kind: z32.literal("re2"),
3000
+ matcher: z34.discriminatedUnion("kind", [
3001
+ z34.object({ kind: z34.literal("literal"), text: text(8192, true) }).strict(),
3002
+ z34.object({
3003
+ kind: z34.literal("re2"),
2906
3004
  pattern: text(2048, true).refine(
2907
3005
  cliBoundedPattern,
2908
3006
  "Use literals, optional anchors, and at most one greedy .*"
@@ -2910,33 +3008,33 @@ var cliRuleOperationSchema = z32.discriminatedUnion("kind", [
2910
3008
  }).strict()
2911
3009
  ])
2912
3010
  }).strict(),
2913
- z32.object({
3011
+ z34.object({
2914
3012
  id,
2915
- kind: z32.literal("ensureOption"),
3013
+ kind: z34.literal("ensureOption"),
2916
3014
  option: flag,
2917
3015
  value: source(arg).optional()
2918
3016
  }).strict(),
2919
- z32.object({
3017
+ z34.object({
2920
3018
  id,
2921
- kind: z32.literal("replaceOption"),
3019
+ kind: z34.literal("replaceOption"),
2922
3020
  option: flag,
2923
3021
  value: source(arg)
2924
3022
  }).strict(),
2925
- z32.object({
3023
+ z34.object({
2926
3024
  id,
2927
- kind: z32.literal("setEnv"),
3025
+ kind: z34.literal("setEnv"),
2928
3026
  key: envKey,
2929
3027
  value: source(arg),
2930
- whenAbsent: z32.boolean()
3028
+ whenAbsent: z34.boolean()
2931
3029
  }).strict(),
2932
- z32.object({
3030
+ z34.object({
2933
3031
  id,
2934
- kind: z32.literal("structuredStdin"),
2935
- format: z32.enum(["text", "json", "jsonl"]),
3032
+ kind: z34.literal("structuredStdin"),
3033
+ format: z34.enum(["text", "json", "jsonl"]),
2936
3034
  payload: source(literal),
2937
- timing: z32.literal("onLaunch"),
2938
- callerInput: z32.literal("replace"),
2939
- eof: z32.literal("close")
3035
+ timing: z34.literal("onLaunch"),
3036
+ callerInput: z34.literal("replace"),
3037
+ eof: z34.literal("close")
2940
3038
  }).strict()
2941
3039
  ]);
2942
3040
  function cliStructuredInputValid(format, payload) {
@@ -2952,11 +3050,11 @@ function cliStructuredInputValid(format, payload) {
2952
3050
  return false;
2953
3051
  }
2954
3052
  }
2955
- var cliRuleSchema = z32.object({
3053
+ var cliRuleSchema = z34.object({
2956
3054
  id,
2957
3055
  selector: cliRuleSelectorSchema,
2958
- optionArity: z32.record(flag, z32.union([z32.literal(0), z32.literal(1)])).default({}),
2959
- operations: z32.array(cliRuleOperationSchema).min(1).max(CLI_RULE_LIMITS.operations)
3056
+ optionArity: z34.record(flag, z34.union([z34.literal(0), z34.literal(1)])).default({}),
3057
+ operations: z34.array(cliRuleOperationSchema).min(1).max(CLI_RULE_LIMITS.operations)
2960
3058
  }).strict().superRefine((rule, ctx) => {
2961
3059
  const fail = (path3, message2) => ctx.addIssue({ code: "custom", path: path3, message: message2 });
2962
3060
  if (Object.keys(rule.optionArity).length > 100)
@@ -3037,10 +3135,10 @@ var cliRuleSchema = z32.object({
3037
3135
  );
3038
3136
  });
3039
3137
  var body = {
3040
- schemaVersion: z32.literal(3),
3138
+ schemaVersion: z34.literal(3),
3041
3139
  target: cliRuleTargetSchema,
3042
- rules: z32.array(cliRuleSchema).min(1).max(CLI_RULE_LIMITS.rules),
3043
- shippingIntent: z32.enum([
3140
+ rules: z34.array(cliRuleSchema).min(1).max(CLI_RULE_LIMITS.rules),
3141
+ shippingIntent: z34.enum([
3044
3142
  "default",
3045
3143
  "message",
3046
3144
  "interaction",
@@ -3079,13 +3177,13 @@ function validateBundle(value, ctx) {
3079
3177
  message: "CLI bundle exceeds the native JSON token bound"
3080
3178
  });
3081
3179
  }
3082
- var cliRuleAuthorInputSchema = z32.object(body).strict().superRefine(validateBundle);
3083
- var normalizedLimits = z32.object({
3084
- expansionBytes: z32.literal(CLI_RULE_LIMITS.expansionBytes),
3085
- excerptBytes: z32.literal(CLI_RULE_LIMITS.excerptBytes),
3086
- attemptExcerptBytes: z32.literal(CLI_RULE_LIMITS.attemptExcerptBytes),
3087
- journalBytes: z32.literal(CLI_RULE_LIMITS.journalBytes),
3088
- supervisorTasks: z32.literal(CLI_RULE_LIMITS.supervisorTasks)
3180
+ var cliRuleAuthorInputSchema = z34.object(body).strict().superRefine(validateBundle);
3181
+ var normalizedLimits = z34.object({
3182
+ expansionBytes: z34.literal(CLI_RULE_LIMITS.expansionBytes),
3183
+ excerptBytes: z34.literal(CLI_RULE_LIMITS.excerptBytes),
3184
+ attemptExcerptBytes: z34.literal(CLI_RULE_LIMITS.attemptExcerptBytes),
3185
+ journalBytes: z34.literal(CLI_RULE_LIMITS.journalBytes),
3186
+ supervisorTasks: z34.literal(CLI_RULE_LIMITS.supervisorTasks)
3089
3187
  }).strict().default({
3090
3188
  expansionBytes: CLI_RULE_LIMITS.expansionBytes,
3091
3189
  excerptBytes: CLI_RULE_LIMITS.excerptBytes,
@@ -3093,10 +3191,10 @@ var normalizedLimits = z32.object({
3093
3191
  journalBytes: CLI_RULE_LIMITS.journalBytes,
3094
3192
  supervisorTasks: CLI_RULE_LIMITS.supervisorTasks
3095
3193
  });
3096
- var cliRuleBundleSchema = z32.object({
3194
+ var cliRuleBundleSchema = z34.object({
3097
3195
  ...body,
3098
3196
  limits: normalizedLimits,
3099
- bundleSha256: z32.string().regex(/^[a-f0-9]{64}$/)
3197
+ bundleSha256: z34.string().regex(/^[a-f0-9]{64}$/)
3100
3198
  }).strict().superRefine(validateBundle);
3101
3199
 
3102
3200
  // ../packages/api-schemas/src/climb-kinds.ts
@@ -3127,35 +3225,35 @@ var LEVER_INTERVENTIONS = {
3127
3225
  };
3128
3226
 
3129
3227
  // ../packages/api-schemas/src/sandbox-overrides.ts
3130
- import { z as z33 } from "zod";
3228
+ import { z as z35 } from "zod";
3131
3229
  var SANDBOX_OVERRIDE_KINDS = ["packages", "clis"];
3132
- var ecosystemSchema = z33.enum(["npm", "pypi", "cargo", "go", "gem"]);
3133
- var overrideFilesSchema = z33.array(
3134
- z33.object({
3135
- path: z33.string().min(1).refine(
3230
+ var ecosystemSchema = z35.enum(["npm", "pypi", "cargo", "go", "gem"]);
3231
+ var overrideFilesSchema = z35.array(
3232
+ z35.object({
3233
+ path: z35.string().min(1).refine(
3136
3234
  (path3) => !path3.startsWith("/") && !path3.includes("\\") && !path3.split("/").includes(".."),
3137
3235
  "Use a relative path within the target"
3138
3236
  ),
3139
- body: z33.string()
3237
+ body: z35.string()
3140
3238
  }).strict()
3141
3239
  ).min(1);
3142
3240
  var contentShape = {
3143
- version: z33.string().trim().min(1).optional(),
3241
+ version: z35.string().trim().min(1).optional(),
3144
3242
  files: overrideFilesSchema.optional()
3145
3243
  };
3146
3244
  var hasContent = (value) => value.version !== void 0 || value.files !== void 0;
3147
- var sandboxOverridesSchema = z33.object({
3148
- version: z33.literal(1),
3149
- packages: z33.array(
3150
- z33.object({
3245
+ var sandboxOverridesSchema = z35.object({
3246
+ version: z35.literal(1),
3247
+ packages: z35.array(
3248
+ z35.object({
3151
3249
  ecosystem: ecosystemSchema,
3152
- name: z33.string().trim().min(1),
3250
+ name: z35.string().trim().min(1),
3153
3251
  ...contentShape
3154
3252
  }).strict().refine(hasContent, "Specify a version or files")
3155
3253
  ).optional(),
3156
- clis: z33.array(
3157
- z33.object({
3158
- name: z33.string().trim().min(1),
3254
+ clis: z35.array(
3255
+ z35.object({
3256
+ name: z35.string().trim().min(1),
3159
3257
  ...contentShape
3160
3258
  }).strict().refine(hasContent, "Specify a version or files")
3161
3259
  ).optional()
@@ -3182,11 +3280,11 @@ var sandboxOverridesSchema = z33.object({
3182
3280
  });
3183
3281
 
3184
3282
  // ../packages/api-schemas/src/climb.ts
3185
- var climbSubjectKindSchema = z34.enum(["EVAL_SET", "VISIBILITY_PROMPT"]);
3186
- var leverKindSchema = z34.enum(LEVER_KINDS);
3187
- var interventionKindSchema = z34.enum(INTERVENTION_KINDS);
3188
- var skill = z34.object({ skillVersionId: z34.string().min(1) }).strict();
3189
- var empty = z34.object({}).strict();
3283
+ var climbSubjectKindSchema = z36.enum(["EVAL_SET", "VISIBILITY_PROMPT"]);
3284
+ var leverKindSchema = z36.enum(LEVER_KINDS);
3285
+ var interventionKindSchema = z36.enum(INTERVENTION_KINDS);
3286
+ var skill = z36.object({ skillVersionId: z36.string().min(1) }).strict();
3287
+ var empty = z36.object({}).strict();
3190
3288
  function validateFixtureIntervention(value, ctx) {
3191
3289
  const result = webFixtureSchema.safeParse({ version: 1, ...value });
3192
3290
  if (!result.success) {
@@ -3199,73 +3297,73 @@ function validateFixtureIntervention(value, ctx) {
3199
3297
  }
3200
3298
  }
3201
3299
  }
3202
- var interventionSchema = z34.discriminatedUnion("kind", [
3203
- z34.object({ kind: z34.literal("BASELINE"), after: empty }),
3204
- z34.object({ kind: z34.literal("ADD_SKILL"), after: skill }),
3205
- z34.object({ kind: z34.literal("REMOVE_SKILL"), before: skill, after: empty }),
3206
- z34.object({ kind: z34.literal("EDIT_SKILL"), before: skill, after: skill }),
3207
- z34.object({
3208
- kind: z34.literal("REWRITE_DOCS"),
3209
- before: z34.json().optional(),
3210
- after: z34.object({ pages: webFixtureSchema.shape.pages.unwrap().min(1) }).strict().superRefine(validateFixtureIntervention)
3300
+ var interventionSchema = z36.discriminatedUnion("kind", [
3301
+ z36.object({ kind: z36.literal("BASELINE"), after: empty }),
3302
+ z36.object({ kind: z36.literal("ADD_SKILL"), after: skill }),
3303
+ z36.object({ kind: z36.literal("REMOVE_SKILL"), before: skill, after: empty }),
3304
+ z36.object({ kind: z36.literal("EDIT_SKILL"), before: skill, after: skill }),
3305
+ z36.object({
3306
+ kind: z36.literal("REWRITE_DOCS"),
3307
+ before: z36.json().optional(),
3308
+ after: z36.object({ pages: webFixtureSchema.shape.pages.unwrap().min(1) }).strict().superRefine(validateFixtureIntervention)
3211
3309
  }),
3212
- z34.object({
3213
- kind: z34.literal("PACKAGE_VERSION"),
3214
- after: z34.object({
3310
+ z36.object({
3311
+ kind: z36.literal("PACKAGE_VERSION"),
3312
+ after: z36.object({
3215
3313
  ecosystem: ecosystemSchema,
3216
- name: z34.string().min(1),
3217
- version: z34.string().min(1)
3314
+ name: z36.string().min(1),
3315
+ version: z36.string().min(1)
3218
3316
  }).strict()
3219
3317
  }),
3220
- z34.object({
3221
- kind: z34.literal("PACKAGE_CONTENT"),
3222
- after: z34.object({
3318
+ z36.object({
3319
+ kind: z36.literal("PACKAGE_CONTENT"),
3320
+ after: z36.object({
3223
3321
  ecosystem: ecosystemSchema,
3224
- name: z34.string().min(1),
3322
+ name: z36.string().min(1),
3225
3323
  files: overrideFilesSchema
3226
3324
  }).strict()
3227
3325
  }),
3228
- z34.object({
3229
- kind: z34.literal("CLI_VERSION"),
3230
- after: z34.object({ name: z34.string().min(1), version: z34.string().min(1) }).strict()
3326
+ z36.object({
3327
+ kind: z36.literal("CLI_VERSION"),
3328
+ after: z36.object({ name: z36.string().min(1), version: z36.string().min(1) }).strict()
3231
3329
  }),
3232
- z34.object({
3233
- kind: z34.literal("CLI_INTERVENTION"),
3330
+ z36.object({
3331
+ kind: z36.literal("CLI_INTERVENTION"),
3234
3332
  after: cliRuleBundleSchema
3235
3333
  })
3236
3334
  ]);
3237
- var climbSettingsSchema = z34.object({
3238
- maxRounds: z34.number().int().positive().default(5),
3239
- sampleCount: z34.number().int().positive().default(1),
3240
- creditCap: z34.number().int().nonnegative(),
3241
- targetScore: z34.number().min(0).max(1).default(1),
3335
+ var climbSettingsSchema = z36.object({
3336
+ maxRounds: z36.number().int().positive().default(5),
3337
+ sampleCount: z36.number().int().positive().default(1),
3338
+ creditCap: z36.number().int().nonnegative(),
3339
+ targetScore: z36.number().min(0).max(1).default(1),
3242
3340
  // Narrow the subject's whole roster to one slot, for the baseline and every
3243
3341
  // trial alike. A subject rostering ten models otherwise multiplies every
3244
3342
  // trial by ten, and a one-model trial measured against a ten-model baseline
3245
3343
  // is not a comparison. `pinnedModel` empty means the agent's default model.
3246
3344
  pinnedAgent: schedulableAgentSchema.optional(),
3247
- pinnedModel: z34.string().optional(),
3248
- maxTrialsPerRound: z34.number().int().min(1).max(10).default(3),
3345
+ pinnedModel: z36.string().optional(),
3346
+ maxTrialsPerRound: z36.number().int().min(1).max(10).default(3),
3249
3347
  // The round a continuation started at; the no-improvement counter
3250
3348
  // restarts here.
3251
- continuedAtRound: z34.number().int().nonnegative().optional()
3349
+ continuedAtRound: z36.number().int().nonnegative().optional()
3252
3350
  }).strip().refine((value) => value.pinnedAgent !== void 0 || !value.pinnedModel, {
3253
3351
  path: ["pinnedAgent"],
3254
3352
  message: "Pin an agent with the model"
3255
3353
  });
3256
- var climbDirectionSchema = z34.object({
3257
- focus: z34.string().trim().max(2e3).nullable().default(null),
3258
- preserve: z34.array(z34.string().trim().min(1).max(500)).max(20).default([]),
3259
- exclude: z34.array(z34.string().trim().min(1).max(500)).max(20).default([]),
3260
- notes: z34.string().trim().max(4e3).nullable().default(null)
3261
- });
3262
- var climbDirectionPatchSchema = z34.object({
3263
- focus: z34.string().trim().max(2e3).nullable().optional(),
3264
- preserve: z34.array(z34.string().trim().min(1).max(500)).max(20).optional(),
3265
- exclude: z34.array(z34.string().trim().min(1).max(500)).max(20).optional(),
3266
- notes: z34.string().trim().max(4e3).nullable().optional(),
3354
+ var climbDirectionSchema = z36.object({
3355
+ focus: z36.string().trim().max(2e3).nullable().default(null),
3356
+ preserve: z36.array(z36.string().trim().min(1).max(500)).max(20).default([]),
3357
+ exclude: z36.array(z36.string().trim().min(1).max(500)).max(20).default([]),
3358
+ notes: z36.string().trim().max(4e3).nullable().default(null)
3359
+ });
3360
+ var climbDirectionPatchSchema = z36.object({
3361
+ focus: z36.string().trim().max(2e3).nullable().optional(),
3362
+ preserve: z36.array(z36.string().trim().min(1).max(500)).max(20).optional(),
3363
+ exclude: z36.array(z36.string().trim().min(1).max(500)).max(20).optional(),
3364
+ notes: z36.string().trim().max(4e3).nullable().optional(),
3267
3365
  /** One line on why this was recorded; becomes the DIRECTION row summary. */
3268
- rationale: z34.string().trim().max(500).optional()
3366
+ rationale: z36.string().trim().max(500).optional()
3269
3367
  }).strict();
3270
3368
  var CLIMB_ACTIVITY_KINDS = [
3271
3369
  "STARTED",
@@ -3284,74 +3382,74 @@ var CLIMB_ACTIVITY_KINDS = [
3284
3382
  "CONTINUED",
3285
3383
  "CANCELED"
3286
3384
  ];
3287
- var climbActivityKindSchema = z34.enum(CLIMB_ACTIVITY_KINDS);
3288
- var proposerTraceStepSchema = z34.object({
3289
- tool: z34.string(),
3290
- args: z34.string(),
3291
- result: z34.string().nullable(),
3292
- isError: z34.boolean().optional()
3293
- });
3294
- var proposerTraceSchema = z34.object({
3295
- steps: z34.array(proposerTraceStepSchema),
3296
- reasoning: z34.string(),
3297
- durationMs: z34.number().int().nonnegative(),
3298
- model: z34.string()
3299
- });
3300
- var climbActivitySchema = z34.object({
3301
- id: z34.string(),
3302
- climbId: z34.string(),
3303
- roundId: z34.string().nullable(),
3304
- trialId: z34.string().nullable(),
3385
+ var climbActivityKindSchema = z36.enum(CLIMB_ACTIVITY_KINDS);
3386
+ var proposerTraceStepSchema = z36.object({
3387
+ tool: z36.string(),
3388
+ args: z36.string(),
3389
+ result: z36.string().nullable(),
3390
+ isError: z36.boolean().optional()
3391
+ });
3392
+ var proposerTraceSchema = z36.object({
3393
+ steps: z36.array(proposerTraceStepSchema),
3394
+ reasoning: z36.string(),
3395
+ durationMs: z36.number().int().nonnegative(),
3396
+ model: z36.string()
3397
+ });
3398
+ var climbActivitySchema = z36.object({
3399
+ id: z36.string(),
3400
+ climbId: z36.string(),
3401
+ roundId: z36.string().nullable(),
3402
+ trialId: z36.string().nullable(),
3305
3403
  kind: climbActivityKindSchema,
3306
- actorUserId: z34.string().nullable(),
3307
- actorName: z34.string().nullable(),
3308
- summary: z34.string(),
3309
- detail: z34.unknown().nullable(),
3310
- createdAt: z34.string()
3311
- });
3312
- var activityQuerySchema = z34.object({
3313
- after: z34.string().datetime().optional(),
3314
- limit: z34.coerce.number().int().min(1).max(500).default(500)
3315
- });
3316
- var climbConfigSnapshotSchema = z34.object({
3317
- promptText: z34.string(),
3318
- scenario: z34.enum(["GREENFIELD", "MIGRATION"]),
3319
- repoUrl: z34.string().nullable(),
3320
- repoRef: z34.string().nullable(),
3321
- profileId: z34.string().nullable(),
3322
- profileName: z34.string().nullable(),
3323
- profileDescription: z34.string().nullable(),
3324
- profileModel: z34.string().nullable(),
3325
- limits: z34.json(),
3326
- agents: z34.array(agentConfigSchema).min(1),
3327
- skillRefs: z34.array(z34.string()),
3328
- mcpRefs: z34.array(z34.string()),
3329
- skillVersionIds: z34.array(z34.string()),
3330
- mcpServerVersionIds: z34.array(z34.string()),
3331
- skillSet: z34.json().nullable(),
3332
- mcpSet: z34.json().nullable(),
3333
- connectionIds: z34.array(z34.string()),
3334
- connectionSet: z34.json().nullable(),
3335
- agentContext: z34.json().nullable(),
3336
- agentContextDigest: z34.string().nullable(),
3404
+ actorUserId: z36.string().nullable(),
3405
+ actorName: z36.string().nullable(),
3406
+ summary: z36.string(),
3407
+ detail: z36.unknown().nullable(),
3408
+ createdAt: z36.string()
3409
+ });
3410
+ var activityQuerySchema = z36.object({
3411
+ after: z36.string().datetime().optional(),
3412
+ limit: z36.coerce.number().int().min(1).max(500).default(500)
3413
+ });
3414
+ var climbConfigSnapshotSchema = z36.object({
3415
+ promptText: z36.string(),
3416
+ scenario: z36.enum(["GREENFIELD", "MIGRATION"]),
3417
+ repoUrl: z36.string().nullable(),
3418
+ repoRef: z36.string().nullable(),
3419
+ profileId: z36.string().nullable(),
3420
+ profileName: z36.string().nullable(),
3421
+ profileDescription: z36.string().nullable(),
3422
+ profileModel: z36.string().nullable(),
3423
+ limits: z36.json(),
3424
+ agents: z36.array(agentConfigSchema).min(1),
3425
+ skillRefs: z36.array(z36.string()),
3426
+ mcpRefs: z36.array(z36.string()),
3427
+ skillVersionIds: z36.array(z36.string()),
3428
+ mcpServerVersionIds: z36.array(z36.string()),
3429
+ skillSet: z36.json().nullable(),
3430
+ mcpSet: z36.json().nullable(),
3431
+ connectionIds: z36.array(z36.string()),
3432
+ connectionSet: z36.json().nullable(),
3433
+ agentContext: z36.json().nullable(),
3434
+ agentContextDigest: z36.string().nullable(),
3337
3435
  webFixture: webFixtureSchema.nullable(),
3338
3436
  cliIntervention: cliRuleBundleSchema.nullable().default(null),
3339
3437
  sandboxOverrides: sandboxOverridesSchema.nullable(),
3340
- visibilityScenarioId: z34.string().nullable()
3438
+ visibilityScenarioId: z36.string().nullable()
3341
3439
  }).strict();
3342
- var targetRefSchema = z34.object({
3343
- kind: z34.string().min(1),
3344
- id: z34.string().optional(),
3345
- url: z34.url().optional(),
3346
- package: z34.string().optional()
3440
+ var targetRefSchema = z36.object({
3441
+ kind: z36.string().min(1),
3442
+ id: z36.string().optional(),
3443
+ url: z36.url().optional(),
3444
+ package: z36.string().optional()
3347
3445
  }).strict();
3348
- var trialInputSchema = z34.object({
3349
- title: z34.string().trim().min(1).max(200),
3350
- hypothesis: z34.string().max(4e3).optional(),
3446
+ var trialInputSchema = z36.object({
3447
+ title: z36.string().trim().min(1).max(200),
3448
+ hypothesis: z36.string().max(4e3).optional(),
3351
3449
  lever: leverKindSchema,
3352
3450
  targetRef: targetRefSchema.optional(),
3353
3451
  intervention: interventionSchema,
3354
- authorMode: z34.enum(["MANUAL", "DIRECT", "PROPOSE"]).default("MANUAL"),
3452
+ authorMode: z36.enum(["MANUAL", "DIRECT", "PROPOSE"]).default("MANUAL"),
3355
3453
  startingPoints: candidateStartsSchema.optional()
3356
3454
  }).strict().superRefine((value, ctx) => {
3357
3455
  const allowed = LEVER_INTERVENTIONS[value.lever];
@@ -3371,7 +3469,7 @@ var OPTIMIZATION_STATUSES = [
3371
3469
  "DONE",
3372
3470
  "ARCHIVED"
3373
3471
  ];
3374
- var optimizationStatusSchema = z35.enum(OPTIMIZATION_STATUSES);
3472
+ var optimizationStatusSchema = z37.enum(OPTIMIZATION_STATUSES);
3375
3473
  var ROUND_STATUSES = [
3376
3474
  "PROPOSING",
3377
3475
  "PROPOSED",
@@ -3400,103 +3498,103 @@ var OPTIMIZATION_EFFORTS = [
3400
3498
  { value: "HIGH", label: "Thorough", sampleCount: 2, maxRounds: 8 },
3401
3499
  { value: "XHIGH", label: "Exhaustive", sampleCount: 3, maxRounds: 12 }
3402
3500
  ];
3403
- var optimizationEffortSchema = z35.enum(
3501
+ var optimizationEffortSchema = z37.enum(
3404
3502
  OPTIMIZATION_EFFORTS.map((preset) => preset.value)
3405
3503
  );
3406
- var listOptimizationsQuerySchema = z35.object({
3407
- status: z35.string().optional().transform(
3504
+ var listOptimizationsQuerySchema = z37.object({
3505
+ status: z37.string().optional().transform(
3408
3506
  (value) => value ? value.split(",").map((part) => part.trim().toUpperCase()).filter(Boolean) : void 0
3409
- ).pipe(z35.array(optimizationStatusSchema).optional()),
3507
+ ).pipe(z37.array(optimizationStatusSchema).optional()),
3410
3508
  subjectKind: climbSubjectKindSchema.optional(),
3411
- subjectId: z35.string().min(1).optional(),
3412
- limit: z35.coerce.number().int().min(1).max(200).default(50),
3509
+ subjectId: z37.string().min(1).optional(),
3510
+ limit: z37.coerce.number().int().min(1).max(200).default(50),
3413
3511
  /** Drafts are workspaces, not runs; older clients never see them. */
3414
- includeDrafts: z35.union([z35.boolean(), z35.string()]).optional().transform((value) => value === true || value === "true" || value === "1")
3512
+ includeDrafts: z37.union([z37.boolean(), z37.string()]).optional().transform((value) => value === true || value === "true" || value === "1")
3415
3513
  });
3416
- var optimizationSummarySchema = z35.object({
3417
- id: z35.string(),
3418
- name: z35.string(),
3514
+ var optimizationSummarySchema = z37.object({
3515
+ id: z37.string(),
3516
+ name: z37.string(),
3419
3517
  status: optimizationStatusSchema,
3420
- mode: z35.enum(["MANUAL", "AUTO"]),
3518
+ mode: z37.enum(["MANUAL", "AUTO"]),
3421
3519
  /** Autonomous launches every proposed round; interactive waits for one. */
3422
- autonomous: z35.boolean(),
3423
- stopReason: z35.string().nullable(),
3520
+ autonomous: z37.boolean(),
3521
+ stopReason: z37.string().nullable(),
3424
3522
  subjectKind: climbSubjectKindSchema,
3425
- subjectId: z35.string(),
3426
- subjectName: z35.string(),
3523
+ subjectId: z37.string(),
3524
+ subjectName: z37.string(),
3427
3525
  lever: leverKindSchema.nullable(),
3428
- round: z35.number().int(),
3429
- maxRounds: z35.number().int(),
3526
+ round: z37.number().int(),
3527
+ maxRounds: z37.number().int(),
3430
3528
  /** Starting baseline score, 0..1. */
3431
- before: z35.number().nullable(),
3529
+ before: z37.number().nullable(),
3432
3530
  /** Score of the marked winner, or best BETTER trial, 0..1. */
3433
- after: z35.number().nullable(),
3531
+ after: z37.number().nullable(),
3434
3532
  /** Percentage-point change from the baseline to the winner or best BETTER trial. */
3435
- delta: z35.number().nullable(),
3533
+ delta: z37.number().nullable(),
3436
3534
  /** Score after each round, baseline first. */
3437
- path: z35.array(z35.number()),
3438
- creditsSpent: z35.number().int(),
3439
- creditsReserved: z35.number().int(),
3440
- summary: z35.string().nullable(),
3441
- href: z35.string(),
3442
- createdAt: z35.string(),
3443
- updatedAt: z35.string()
3444
- });
3445
- var listOptimizationsResponseSchema = z35.object({
3446
- items: z35.array(optimizationSummarySchema)
3447
- });
3448
- var baselineDiscoveryQuerySchema = z35.object({
3535
+ path: z37.array(z37.number()),
3536
+ creditsSpent: z37.number().int(),
3537
+ creditsReserved: z37.number().int(),
3538
+ summary: z37.string().nullable(),
3539
+ href: z37.string(),
3540
+ createdAt: z37.string(),
3541
+ updatedAt: z37.string()
3542
+ });
3543
+ var listOptimizationsResponseSchema = z37.object({
3544
+ items: z37.array(optimizationSummarySchema)
3545
+ });
3546
+ var baselineDiscoveryQuerySchema = z37.object({
3449
3547
  subjectKind: climbSubjectKindSchema,
3450
- subjectId: z35.string().min(1),
3451
- limit: z35.coerce.number().int().min(1).max(100).default(50),
3452
- cursor: z35.string().min(1).optional()
3548
+ subjectId: z37.string().min(1),
3549
+ limit: z37.coerce.number().int().min(1).max(100).default(50),
3550
+ cursor: z37.string().min(1).optional()
3453
3551
  }).strict();
3454
- var baselineRunSchema = z35.object({
3455
- resolvedModel: z35.string().nullable(),
3456
- runId: z35.string(),
3457
- agent: z35.string(),
3458
- model: z35.string(),
3459
- status: z35.string(),
3460
- createdAt: z35.string(),
3461
- outcome: z35.object({
3462
- passedCriteria: z35.number(),
3463
- totalCriteria: z35.number(),
3464
- judgingStatus: z35.string().nullable()
3552
+ var baselineRunSchema = z37.object({
3553
+ resolvedModel: z37.string().nullable(),
3554
+ runId: z37.string(),
3555
+ agent: z37.string(),
3556
+ model: z37.string(),
3557
+ status: z37.string(),
3558
+ createdAt: z37.string(),
3559
+ outcome: z37.object({
3560
+ passedCriteria: z37.number(),
3561
+ totalCriteria: z37.number(),
3562
+ judgingStatus: z37.string().nullable()
3465
3563
  }),
3466
- surfaces: z35.array(
3467
- z35.object({
3468
- lever: z35.string(),
3469
- label: z35.string(),
3470
- targetRef: z35.unknown(),
3471
- evidence: z35.unknown(),
3472
- command: z35.unknown().optional()
3564
+ surfaces: z37.array(
3565
+ z37.object({
3566
+ lever: z37.string(),
3567
+ label: z37.string(),
3568
+ targetRef: z37.unknown(),
3569
+ evidence: z37.unknown(),
3570
+ command: z37.unknown().optional()
3473
3571
  })
3474
3572
  ),
3475
- evidenceStatus: z35.object({
3476
- surfaces: z35.string().nullable(),
3477
- cli: z35.string().nullable()
3573
+ evidenceStatus: z37.object({
3574
+ surfaces: z37.string().nullable(),
3575
+ cli: z37.string().nullable()
3478
3576
  }),
3479
- eligibility: z35.object({
3480
- eligible: z35.boolean(),
3481
- reason: z35.string().nullable(),
3482
- baselineRunIds: z35.array(z35.string())
3577
+ eligibility: z37.object({
3578
+ eligible: z37.boolean(),
3579
+ reason: z37.string().nullable(),
3580
+ baselineRunIds: z37.array(z37.string())
3483
3581
  })
3484
3582
  });
3485
- var baselineDiscoveryResponseSchema = z35.object({
3486
- items: z35.array(baselineRunSchema),
3487
- nextCursor: z35.string().nullable(),
3488
- note: z35.string()
3583
+ var baselineDiscoveryResponseSchema = z37.object({
3584
+ items: z37.array(baselineRunSchema),
3585
+ nextCursor: z37.string().nullable(),
3586
+ note: z37.string()
3489
3587
  });
3490
- var targetSchema = z35.object({
3588
+ var targetSchema = z37.object({
3491
3589
  agent: schedulableAgentSchema.optional(),
3492
3590
  /** Empty or omitted means the agent's default model. */
3493
- model: z35.string().optional()
3591
+ model: z37.string().optional()
3494
3592
  });
3495
3593
  var planShape = {
3496
3594
  effort: optimizationEffortSchema.optional(),
3497
- sampleCount: z35.number().int().min(1).max(100).optional(),
3498
- maxRounds: z35.number().int().min(1).max(100).optional(),
3499
- maxTrialsPerRound: z35.number().int().min(1).max(10).optional()
3595
+ sampleCount: z37.number().int().min(1).max(100).optional(),
3596
+ maxRounds: z37.number().int().min(1).max(100).optional(),
3597
+ maxTrialsPerRound: z37.number().int().min(1).max(10).optional()
3500
3598
  };
3501
3599
  function refinePlan(value, ctx) {
3502
3600
  if (value.effort && (value.sampleCount || value.maxRounds))
@@ -3512,15 +3610,15 @@ function refinePlan(value, ctx) {
3512
3610
  message: "Pin an agent with the model"
3513
3611
  });
3514
3612
  }
3515
- var startOptimizationBodySchema = z35.object({
3613
+ var startOptimizationBodySchema = z37.object({
3516
3614
  subjectKind: climbSubjectKindSchema,
3517
- subjectId: z35.string().min(1),
3518
- name: z35.string().trim().min(1).max(200).optional(),
3615
+ subjectId: z37.string().min(1),
3616
+ name: z37.string().trim().min(1).max(200).optional(),
3519
3617
  ...planShape,
3520
- creditCap: z35.number().int().nonnegative().optional(),
3521
- targetScore: z35.number().min(0).max(1).optional(),
3618
+ creditCap: z37.number().int().nonnegative().optional(),
3619
+ targetScore: z37.number().min(0).max(1).optional(),
3522
3620
  target: targetSchema.extend({ agent: schedulableAgentSchema }).optional(),
3523
- fromRun: z35.string().min(1).optional()
3621
+ fromRun: z37.string().min(1).optional()
3524
3622
  }).strict().superRefine(refinePlan).superRefine((value, ctx) => {
3525
3623
  if (!!value.target === !!value.fromRun)
3526
3624
  ctx.addIssue({
@@ -3529,9 +3627,9 @@ var startOptimizationBodySchema = z35.object({
3529
3627
  path: ["target"]
3530
3628
  });
3531
3629
  });
3532
- var estimateOptimizationBodySchema = z35.object({
3630
+ var estimateOptimizationBodySchema = z37.object({
3533
3631
  subjectKind: climbSubjectKindSchema,
3534
- subjectId: z35.string().min(1),
3632
+ subjectId: z37.string().min(1),
3535
3633
  ...planShape,
3536
3634
  target: targetSchema.optional()
3537
3635
  }).strict().superRefine(refinePlan);
@@ -3543,127 +3641,131 @@ var RUN_CREDIT_BASES = [
3543
3641
  "byok",
3544
3642
  "reserve"
3545
3643
  ];
3546
- var runCreditBasisSchema = z35.enum(RUN_CREDIT_BASES);
3547
- var optimizationEstimateSchema = z35.object({
3548
- sampleCount: z35.number().int(),
3549
- maxRounds: z35.number().int(),
3550
- runsPerTrial: z35.number(),
3551
- executionCredits: z35.number(),
3552
- judgeCredits: z35.number(),
3553
- leverPassCredits: z35.number(),
3554
- trialCredits: z35.number(),
3644
+ var runCreditBasisSchema = z37.enum(RUN_CREDIT_BASES);
3645
+ var optimizationEstimateSchema = z37.object({
3646
+ sampleCount: z37.number().int(),
3647
+ maxRounds: z37.number().int(),
3648
+ runsPerTrial: z37.number(),
3649
+ executionCredits: z37.number(),
3650
+ judgeCredits: z37.number(),
3651
+ leverPassCredits: z37.number(),
3652
+ trialCredits: z37.number(),
3555
3653
  /** Estimate, not a reservation or enforced spending cap. */
3556
- estimate: z35.number().int(),
3654
+ estimate: z37.number().int(),
3557
3655
  /** True when no price or history covered a model: a bound, not a forecast. */
3558
- approximate: z35.boolean().default(false),
3656
+ approximate: z37.boolean().default(false),
3559
3657
  /** Which rung priced the run, so the UI can say why a figure is what it is. */
3560
3658
  basis: runCreditBasisSchema.optional()
3561
3659
  });
3562
- var diagnoseBodySchema = z35.object({
3660
+ var diagnoseBodySchema = z37.object({
3563
3661
  subjectKind: climbSubjectKindSchema,
3564
- subjectId: z35.string().min(1)
3662
+ subjectId: z37.string().min(1)
3565
3663
  }).strict();
3566
- var diagnosisSchema = z35.object({
3567
- id: z35.string(),
3568
- status: z35.enum(["GENERATING", "READY", "FAILED"]),
3664
+ var diagnosisSchema = z37.object({
3665
+ id: z37.string(),
3666
+ status: z37.enum(["GENERATING", "READY", "FAILED"]),
3569
3667
  subjectKind: climbSubjectKindSchema,
3570
- subjectId: z35.string(),
3571
- runCount: z35.number().int(),
3572
- summary: z35.string().nullable(),
3668
+ subjectId: z37.string(),
3669
+ runCount: z37.number().int(),
3670
+ summary: z37.string().nullable(),
3573
3671
  recommendedLever: leverKindSchema.nullable(),
3574
- recommendedTarget: z35.unknown().nullable(),
3575
- clusters: z35.array(
3576
- z35.object({
3577
- title: z35.string(),
3578
- failureMode: z35.string(),
3579
- criterionIds: z35.array(z35.string()),
3580
- runIds: z35.array(z35.string()),
3672
+ recommendedTarget: z37.unknown().nullable(),
3673
+ clusters: z37.array(
3674
+ z37.object({
3675
+ title: z37.string(),
3676
+ failureMode: z37.string(),
3677
+ criterionIds: z37.array(z37.string()),
3678
+ runIds: z37.array(z37.string()),
3581
3679
  lever: leverKindSchema.nullable(),
3582
- targetRef: z35.unknown().nullable(),
3583
- confidence: z35.number()
3680
+ targetRef: z37.unknown().nullable(),
3681
+ confidence: z37.number()
3584
3682
  })
3585
3683
  ),
3586
- unsupportedLevers: z35.array(leverKindSchema).default([]),
3587
- createdAt: z35.string()
3588
- });
3589
- var candidateExecutionSchema = z35.object({
3590
- runId: z35.string(),
3591
- startMode: z35.enum(["checkpoint", "fresh"]),
3592
- checkpointId: z35.string().nullable(),
3593
- sourceRunId: z35.string().nullable(),
3594
- status: z35.string(),
3595
- continuation: z35.literal("running-process").optional(),
3596
- sourceAttempt: z35.number().int().positive().optional(),
3597
- estimatedSavedWork: z35.object({
3598
- elapsedMs: z35.number().nonnegative(),
3599
- usage: z35.object({
3600
- input_tokens: z35.number().nonnegative(),
3601
- output_tokens: z35.number().nonnegative(),
3602
- cache_read_input_tokens: z35.number().nonnegative(),
3603
- cache_creation_input_tokens: z35.number().nonnegative()
3684
+ unsupportedLevers: z37.array(leverKindSchema).default([]),
3685
+ createdAt: z37.string()
3686
+ });
3687
+ var candidateExecutionSchema = z37.object({
3688
+ runId: z37.string(),
3689
+ startMode: z37.enum(["checkpoint", "fresh"]),
3690
+ checkpointId: z37.string().nullable(),
3691
+ sourceRunId: z37.string().nullable(),
3692
+ status: z37.string(),
3693
+ continuation: z37.literal("running-process").optional(),
3694
+ sourceAttempt: z37.number().int().positive().optional(),
3695
+ estimatedSavedWork: z37.object({
3696
+ elapsedMs: z37.number().nonnegative(),
3697
+ usage: z37.object({
3698
+ input_tokens: z37.number().nonnegative(),
3699
+ output_tokens: z37.number().nonnegative(),
3700
+ cache_read_input_tokens: z37.number().nonnegative(),
3701
+ cache_creation_input_tokens: z37.number().nonnegative()
3604
3702
  }),
3605
- attribution: z35.literal("approximate")
3703
+ attribution: z37.literal("approximate")
3606
3704
  }).optional()
3607
3705
  });
3608
- var trialRunSchema = z35.object({
3609
- id: z35.string(),
3610
- status: z35.string(),
3611
- failureReason: z35.string().nullable(),
3612
- exitReason: z35.string().nullable(),
3706
+ var trialRunSchema = z37.object({
3707
+ id: z37.string(),
3708
+ status: z37.string(),
3709
+ failureReason: z37.string().nullable(),
3710
+ exitReason: z37.string().nullable(),
3613
3711
  candidateDelivery: candidateDeliverySchema.nullable().optional(),
3614
3712
  candidateExecution: candidateExecutionSchema.nullable().optional(),
3615
3713
  cliCoverage: cliRuleCoverageSchema.nullable().optional(),
3616
- passed: z35.boolean().nullable(),
3617
- criteria: z35.array(
3618
- z35.object({ name: z35.string(), passed: z35.boolean(), reasoning: z35.string() })
3714
+ passed: z37.boolean().nullable(),
3715
+ criteria: z37.array(
3716
+ z37.object({
3717
+ name: z37.string(),
3718
+ passed: z37.boolean().nullable(),
3719
+ reasoning: z37.string()
3720
+ })
3619
3721
  ),
3620
- levers: z35.array(
3621
- z35.object({
3622
- lever: z35.string(),
3623
- attributed: z35.boolean(),
3624
- note: z35.string().nullable()
3722
+ levers: z37.array(
3723
+ z37.object({
3724
+ lever: z37.string(),
3725
+ attributed: z37.boolean(),
3726
+ note: z37.string().nullable()
3625
3727
  })
3626
3728
  )
3627
3729
  });
3628
- var trialSchema = z35.object({
3629
- id: z35.string(),
3630
- climbId: z35.string(),
3631
- roundNumber: z35.number().int(),
3632
- key: z35.string(),
3730
+ var trialSchema = z37.object({
3731
+ id: z37.string(),
3732
+ climbId: z37.string(),
3733
+ roundNumber: z37.number().int(),
3734
+ key: z37.string(),
3633
3735
  /** @deprecated All trials branch from the baseline. */
3634
- parentTrialId: z35.string().nullable(),
3736
+ parentTrialId: z37.string().nullable(),
3635
3737
  /** @deprecated Always the baseline key for non-baseline trials. */
3636
- parentKey: z35.string().nullable(),
3637
- title: z35.string(),
3638
- hypothesis: z35.string().nullable(),
3738
+ parentKey: z37.string().nullable(),
3739
+ title: z37.string(),
3740
+ hypothesis: z37.string().nullable(),
3639
3741
  lever: leverKindSchema.nullable(),
3640
3742
  kind: interventionKindSchema,
3641
- status: z35.enum(TRIAL_STATUSES),
3642
- verdict: z35.enum(TRIAL_VERDICTS).nullable(),
3643
- score: z35.number().nullable(),
3644
- baselineScore: z35.number().nullable(),
3743
+ status: z37.enum(TRIAL_STATUSES),
3744
+ verdict: z37.enum(TRIAL_VERDICTS).nullable(),
3745
+ score: z37.number().nullable(),
3746
+ baselineScore: z37.number().nullable(),
3645
3747
  /** Judged sessions behind `score`. */
3646
- sessions: z35.number().int(),
3748
+ sessions: z37.number().int(),
3647
3749
  /** Sessions that FAILED or TIMED_OUT; `score` leaves them out. */
3648
- failedSessions: z35.number().int(),
3649
- isBaseline: z35.boolean(),
3750
+ failedSessions: z37.number().int(),
3751
+ isBaseline: z37.boolean(),
3650
3752
  /** The user marked this trial as the winner; it does not move the baseline. */
3651
- adopted: z35.boolean(),
3652
- adoptedAt: z35.string().nullable(),
3653
- outcome: z35.string().nullable(),
3753
+ adopted: z37.boolean(),
3754
+ adoptedAt: z37.string().nullable(),
3755
+ outcome: z37.string().nullable(),
3654
3756
  /** The kind-specific `after` payload (skill version id, pages, package). */
3655
- after: z35.unknown(),
3656
- before: z35.unknown(),
3757
+ after: z37.unknown(),
3758
+ before: z37.unknown(),
3657
3759
  startingPoints: candidateStartsSchema.optional(),
3658
- runs: z35.array(trialRunSchema),
3659
- createdAt: z35.string()
3760
+ runs: z37.array(trialRunSchema),
3761
+ createdAt: z37.string()
3660
3762
  });
3661
- var roundSchema = z35.object({
3662
- id: z35.string(),
3663
- number: z35.number().int(),
3664
- status: z35.enum(ROUND_STATUSES),
3665
- narrative: z35.string().nullable(),
3666
- trials: z35.array(trialSchema)
3763
+ var roundSchema = z37.object({
3764
+ id: z37.string(),
3765
+ number: z37.number().int(),
3766
+ status: z37.enum(ROUND_STATUSES),
3767
+ narrative: z37.string().nullable(),
3768
+ trials: z37.array(trialSchema)
3667
3769
  });
3668
3770
  var OPTIMIZATION_NEXT_ACTIONS = [
3669
3771
  "START",
@@ -3674,421 +3776,430 @@ var OPTIMIZATION_NEXT_ACTIONS = [
3674
3776
  "RESUME",
3675
3777
  "NONE"
3676
3778
  ];
3677
- var optimizationNextActionSchema = z35.enum(OPTIMIZATION_NEXT_ACTIONS);
3779
+ var optimizationNextActionSchema = z37.enum(OPTIMIZATION_NEXT_ACTIONS);
3678
3780
  var optimizationDetailSchema = optimizationSummarySchema.extend({
3679
- baselineTrialId: z35.string().nullable(),
3781
+ baselineTrialId: z37.string().nullable(),
3680
3782
  /** The one thing a client does next. WAIT and NONE need nobody. */
3681
3783
  nextAction: optimizationNextActionSchema,
3682
- settings: z35.object({
3683
- sampleCount: z35.number().int(),
3684
- maxRounds: z35.number().int(),
3685
- maxTrialsPerRound: z35.number().int(),
3686
- creditCap: z35.number().int(),
3687
- targetScore: z35.number(),
3688
- pinnedAgent: z35.string().nullable(),
3689
- pinnedModel: z35.string().nullable(),
3690
- continuedAtRound: z35.number().int().nullable()
3784
+ settings: z37.object({
3785
+ sampleCount: z37.number().int(),
3786
+ maxRounds: z37.number().int(),
3787
+ maxTrialsPerRound: z37.number().int(),
3788
+ creditCap: z37.number().int(),
3789
+ targetScore: z37.number(),
3790
+ pinnedAgent: z37.string().nullable(),
3791
+ pinnedModel: z37.string().nullable(),
3792
+ continuedAtRound: z37.number().int().nullable()
3691
3793
  }),
3692
3794
  direction: climbDirectionSchema,
3693
- rounds: z35.array(roundSchema)
3795
+ rounds: z37.array(roundSchema)
3694
3796
  });
3695
- var optimizationHandoffSchema = z35.object({
3696
- trialId: z35.string(),
3697
- trialKey: z35.string(),
3698
- prompt: z35.string()
3797
+ var optimizationHandoffSchema = z37.object({
3798
+ trialId: z37.string(),
3799
+ trialKey: z37.string(),
3800
+ prompt: z37.string()
3699
3801
  });
3700
- var listTrialsResponseSchema = z35.object({
3701
- items: z35.array(trialSchema)
3802
+ var listTrialsResponseSchema = z37.object({
3803
+ items: z37.array(trialSchema)
3702
3804
  });
3703
- var trialDocumentSchema = z35.object({
3704
- path: z35.string(),
3705
- before: z35.string(),
3706
- after: z35.string()
3805
+ var trialDocumentSchema = z37.object({
3806
+ path: z37.string(),
3807
+ before: z37.string(),
3808
+ after: z37.string()
3707
3809
  });
3708
- var trialContentSchema = z35.object({
3709
- trialId: z35.string(),
3810
+ var trialContentSchema = z37.object({
3811
+ trialId: z37.string(),
3710
3812
  kind: interventionKindSchema,
3711
- documents: z35.array(trialDocumentSchema),
3813
+ documents: z37.array(trialDocumentSchema),
3712
3814
  /** Full page bodies for a docs rewrite, ready to paste; null otherwise. */
3713
- copyableBody: z35.string().nullable(),
3714
- configSnapshot: z35.unknown()
3815
+ copyableBody: z37.string().nullable(),
3816
+ configSnapshot: z37.unknown()
3715
3817
  });
3716
- var createTrialBodySchema = z35.object({
3818
+ var createTrialBodySchema = z37.object({
3717
3819
  trial: trialInputSchema,
3718
3820
  files: overrideFilesSchema.optional(),
3719
- fork: z35.object({ runId: z35.string().min(1), boundarySeq: z35.string().min(1) }).strict().optional(),
3720
- launch: z35.boolean().default(false),
3821
+ fork: z37.object({ runId: z37.string().min(1), boundarySeq: z37.string().min(1) }).strict().optional(),
3822
+ launch: z37.boolean().default(false),
3721
3823
  /** Replays return the trial the first call created instead of a second
3722
3824
  * one. Scoped to the optimization. */
3723
- idempotencyKey: z35.string().min(1).max(200).optional()
3825
+ idempotencyKey: z37.string().min(1).max(200).optional()
3724
3826
  }).strict();
3725
- var skillFilesResponseSchema = z35.object({
3726
- versionId: z35.string(),
3827
+ var skillFilesResponseSchema = z37.object({
3828
+ versionId: z37.string(),
3727
3829
  files: overrideFilesSchema
3728
3830
  });
3729
- var pageBodyResponseSchema = z35.object({
3730
- source: z35.string().optional(),
3731
- url: z35.string(),
3732
- body: z35.string(),
3733
- contentType: z35.string().optional()
3831
+ var pageBodyResponseSchema = z37.object({
3832
+ source: z37.string().optional(),
3833
+ url: z37.string(),
3834
+ body: z37.string(),
3835
+ contentType: z37.string().optional()
3734
3836
  });
3735
- var launchTrialResponseSchema = z35.object({
3736
- trialId: z35.string(),
3737
- batchIds: z35.array(z35.string()),
3738
- runIds: z35.array(z35.string())
3837
+ var launchTrialResponseSchema = z37.object({
3838
+ trialId: z37.string(),
3839
+ batchIds: z37.array(z37.string()),
3840
+ runIds: z37.array(z37.string())
3739
3841
  });
3740
- var createDraftOptimizationBodySchema = z35.object({
3842
+ var createDraftOptimizationBodySchema = z37.object({
3741
3843
  subjectKind: climbSubjectKindSchema,
3742
- subjectId: z35.string().min(1),
3743
- name: z35.string().trim().min(1).max(200).optional(),
3844
+ subjectId: z37.string().min(1),
3845
+ name: z37.string().trim().min(1).max(200).optional(),
3744
3846
  ...planShape,
3745
3847
  target: targetSchema.optional(),
3746
- autonomous: z35.boolean().optional()
3848
+ autonomous: z37.boolean().optional()
3747
3849
  }).strict().superRefine(refinePlan);
3748
3850
  var planPatchShape = {
3749
- name: z35.string().trim().min(1).max(200).optional(),
3851
+ name: z37.string().trim().min(1).max(200).optional(),
3750
3852
  ...planShape,
3751
3853
  target: targetSchema.optional()
3752
3854
  };
3753
- var optimizationPlanPatchSchema = z35.object(planPatchShape).strict().superRefine(refinePlan);
3754
- var startDraftOptimizationBodySchema = z35.object({
3855
+ var optimizationPlanPatchSchema = z37.object(planPatchShape).strict().superRefine(refinePlan);
3856
+ var startDraftOptimizationBodySchema = z37.object({
3755
3857
  ...planPatchShape,
3756
- creditCap: z35.number().int().nonnegative().optional()
3858
+ creditCap: z37.number().int().nonnegative().optional()
3757
3859
  }).strict().superRefine(refinePlan);
3758
- var setModeBodySchema = z35.object({ autonomous: z35.boolean() }).strict();
3759
- var launchRoundResponseSchema = z35.object({
3760
- roundNumber: z35.number().int().nullable(),
3761
- launched: z35.array(z35.string()),
3860
+ var setModeBodySchema = z37.object({ autonomous: z37.boolean() }).strict();
3861
+ var launchRoundResponseSchema = z37.object({
3862
+ roundNumber: z37.number().int().nullable(),
3863
+ launched: z37.array(z37.string()),
3762
3864
  /** True when nothing was left to launch: someone else got there first. */
3763
- alreadyLaunched: z35.boolean()
3865
+ alreadyLaunched: z37.boolean()
3764
3866
  });
3765
- var resolveChatResponseSchema = z35.object({
3766
- chatId: z35.string(),
3767
- href: z35.string()
3867
+ var resolveChatResponseSchema = z37.object({
3868
+ chatId: z37.string(),
3869
+ href: z37.string()
3768
3870
  });
3769
- var continueOptimizationBodySchema = z35.object({
3770
- rounds: z35.number().int().min(1).max(20).default(1),
3771
- maxTrialsPerRound: z35.number().int().min(1).max(10).optional()
3871
+ var continueOptimizationBodySchema = z37.object({
3872
+ rounds: z37.number().int().min(1).max(20).default(1),
3873
+ maxTrialsPerRound: z37.number().int().min(1).max(10).optional()
3772
3874
  }).strict();
3773
- var patchOptimizationBodySchema = z35.object({
3875
+ var patchOptimizationBodySchema = z37.object({
3774
3876
  ...planPatchShape,
3775
3877
  direction: climbDirectionPatchSchema.optional(),
3776
- autonomous: z35.boolean().optional()
3878
+ autonomous: z37.boolean().optional()
3777
3879
  }).strict().superRefine(refinePlan);
3778
3880
 
3779
3881
  // ../packages/api-schemas/src/orgs.ts
3780
- import { z as z36 } from "zod";
3781
- var createOrgRequestSchema = z36.object({
3882
+ import { z as z38 } from "zod";
3883
+ var createOrgRequestSchema = z38.object({
3782
3884
  /** Workspace display name; the slug is derived server-side. */
3783
- name: z36.string().trim().min(1).max(200),
3885
+ name: z38.string().trim().min(1).max(200),
3784
3886
  /** Optional company site (logo source; stamped onto the org). */
3785
- website: z36.string().trim().max(300).optional()
3887
+ website: z38.string().trim().max(300).optional()
3786
3888
  });
3787
- var createOrgResponseSchema = z36.object({
3788
- slug: z36.string(),
3789
- name: z36.string(),
3889
+ var createOrgResponseSchema = z38.object({
3890
+ slug: z38.string(),
3891
+ name: z38.string(),
3790
3892
  // LOCAL orgs never have a Gauge publicId.
3791
- publicId: z36.string().nullable()
3893
+ publicId: z38.string().nullable()
3792
3894
  });
3793
- var orgSettingsSchema = z36.object({
3794
- slug: z36.string(),
3795
- name: z36.string(),
3796
- publicId: z36.string().nullable(),
3797
- website: z36.string().nullable(),
3895
+ var orgSettingsSchema = z38.object({
3896
+ slug: z38.string(),
3897
+ name: z38.string(),
3898
+ publicId: z38.string().nullable(),
3899
+ website: z38.string().nullable(),
3798
3900
  /** Per-run max-spend override in USD; null = the server default. */
3799
- maxSpendUsd: z36.number().nullable(),
3800
- overageEnabled: z36.boolean(),
3901
+ maxSpendUsd: z38.number().nullable(),
3902
+ overageEnabled: z38.boolean(),
3801
3903
  /** Per-cycle overage cap in credits; null = uncapped. */
3802
- overageCapCredits: z36.number().int().nullable(),
3904
+ overageCapCredits: z38.number().int().nullable(),
3803
3905
  /** Domain claimed for same-domain auto-join; null = off. */
3804
- autoJoinDomain: z36.string().nullable()
3906
+ autoJoinDomain: z38.string().nullable()
3805
3907
  });
3806
- var orgMemberSchema = z36.object({
3807
- userId: z36.string(),
3808
- name: z36.string().nullable(),
3809
- email: z36.string().nullable(),
3810
- joinedAt: z36.string()
3908
+ var orgMemberSchema = z38.object({
3909
+ userId: z38.string(),
3910
+ name: z38.string().nullable(),
3911
+ email: z38.string().nullable(),
3912
+ joinedAt: z38.string()
3811
3913
  });
3812
- var listMembersResponseSchema = z36.object({
3813
- items: z36.array(orgMemberSchema)
3914
+ var listMembersResponseSchema = z38.object({
3915
+ items: z38.array(orgMemberSchema)
3814
3916
  });
3815
3917
 
3816
3918
  // ../packages/api-schemas/src/personas.ts
3817
- import { z as z37 } from "zod";
3818
- var personaSchema = z37.object({
3819
- id: z37.string(),
3820
- name: z37.string(),
3821
- description: z37.string(),
3919
+ import { z as z39 } from "zod";
3920
+ var personaSchema = z39.object({
3921
+ id: z39.string(),
3922
+ name: z39.string(),
3923
+ description: z39.string(),
3822
3924
  /** The judge model this persona calls (Claude only). */
3823
- model: z37.string(),
3824
- createdAt: z37.string(),
3825
- updatedAt: z37.string()
3925
+ model: z39.string(),
3926
+ createdAt: z39.string(),
3927
+ updatedAt: z39.string()
3826
3928
  });
3827
- var listPersonasResponseSchema = z37.object({
3828
- items: z37.array(personaSchema)
3929
+ var listPersonasResponseSchema = z39.object({
3930
+ items: z39.array(personaSchema)
3829
3931
  });
3830
- var createPersonaBodySchema = z37.object({
3831
- name: z37.string().min(1).max(120),
3832
- description: z37.string().min(1)
3932
+ var createPersonaBodySchema = z39.object({
3933
+ name: z39.string().min(1).max(120),
3934
+ description: z39.string().min(1)
3833
3935
  });
3834
- var updatePersonaBodySchema = z37.object({
3835
- name: z37.string().min(1).max(120).optional(),
3836
- description: z37.string().min(1).optional()
3936
+ var updatePersonaBodySchema = z39.object({
3937
+ name: z39.string().min(1).max(120).optional(),
3938
+ description: z39.string().min(1).optional()
3837
3939
  });
3838
3940
 
3839
3941
  // ../packages/api-schemas/src/prompts.ts
3840
- import { z as z40 } from "zod";
3942
+ import { z as z42 } from "zod";
3841
3943
 
3842
3944
  // ../packages/api-schemas/src/tags.ts
3843
- import { z as z38 } from "zod";
3844
- var tagSchema = z38.object({
3845
- id: z38.string(),
3846
- name: z38.string(),
3945
+ import { z as z40 } from "zod";
3946
+ var tagSchema = z40.object({
3947
+ id: z40.string(),
3948
+ name: z40.string(),
3847
3949
  /** A Mantine palette name (e.g. "blue", "grape"); unknown values are
3848
3950
  * normalized server-side to the default ("gray"). */
3849
- color: z38.string()
3951
+ color: z40.string()
3850
3952
  });
3851
- var createTagBodySchema = z38.object({
3852
- name: z38.string().min(1),
3853
- color: z38.string().optional()
3953
+ var createTagBodySchema = z40.object({
3954
+ name: z40.string().min(1),
3955
+ color: z40.string().optional()
3854
3956
  });
3855
- var updateTagBodySchema = z38.object({
3856
- name: z38.string().min(1).optional(),
3857
- color: z38.string().optional()
3957
+ var updateTagBodySchema = z40.object({
3958
+ name: z40.string().min(1).optional(),
3959
+ color: z40.string().optional()
3858
3960
  });
3859
3961
  var tagListResponseSchema = listResponseSchema(tagSchema);
3860
3962
 
3861
3963
  // ../packages/api-schemas/src/topics.ts
3862
- import { z as z39 } from "zod";
3863
- var topicSchema = z39.object({
3864
- id: z39.string(),
3865
- name: z39.string()
3964
+ import { z as z41 } from "zod";
3965
+ var topicSchema = z41.object({
3966
+ id: z41.string(),
3967
+ name: z41.string()
3866
3968
  });
3867
- var createTopicBodySchema = z39.object({
3868
- name: z39.string().min(1, "name is required")
3969
+ var createTopicBodySchema = z41.object({
3970
+ name: z41.string().min(1, "name is required")
3869
3971
  });
3870
3972
  var topicListResponseSchema = listResponseSchema(topicSchema);
3871
3973
 
3872
3974
  // ../packages/api-schemas/src/prompts.ts
3873
- var promptSummarySchema = z40.object({
3874
- id: z40.string(),
3875
- text: z40.string(),
3876
- isBranded: z40.boolean(),
3975
+ var promptSummarySchema = z42.object({
3976
+ id: z42.string(),
3977
+ text: z42.string(),
3978
+ isBranded: z42.boolean(),
3877
3979
  /** Battery-spec identity (idempotent applies); null for UI/CLI-created prompts. */
3878
- externalKey: z40.string().nullable(),
3980
+ externalKey: z42.string().nullable(),
3879
3981
  topic: topicSchema.nullable(),
3880
- tags: z40.array(tagSchema),
3881
- createdAt: z40.string()
3982
+ tags: z42.array(tagSchema),
3983
+ createdAt: z42.string()
3882
3984
  });
3883
3985
  var promptListResponseSchema = listResponseSchema(promptSummarySchema);
3884
3986
  var listPromptsQuerySchema = listQuerySchema.extend({
3885
- topic: z40.string().min(1).optional(),
3886
- tag: z40.string().min(1).optional(),
3887
- q: z40.string().min(1).optional()
3888
- });
3889
- var createPromptBodySchema = z40.object({
3890
- text: z40.string().min(1, "text is required"),
3891
- isBranded: z40.boolean().default(false),
3892
- topic: z40.string().min(1).optional(),
3893
- tags: z40.array(z40.string().min(1)).default([])
3894
- });
3895
- var updatePromptBodySchema = z40.object({
3896
- text: z40.string().min(1).optional(),
3897
- isBranded: z40.boolean().optional(),
3898
- topicId: z40.string().min(1).nullish(),
3899
- tags: z40.array(z40.string().min(1)).optional()
3900
- });
3901
- var runPromptBodySchema = z40.object({
3987
+ topic: z42.string().min(1).optional(),
3988
+ tag: z42.string().min(1).optional(),
3989
+ q: z42.string().min(1).optional()
3990
+ });
3991
+ var createPromptBodySchema = z42.object({
3992
+ text: z42.string().min(1, "text is required"),
3993
+ isBranded: z42.boolean().default(false),
3994
+ topic: z42.string().min(1).optional(),
3995
+ tags: z42.array(z42.string().min(1)).default([])
3996
+ });
3997
+ var updatePromptBodySchema = z42.object({
3998
+ text: z42.string().min(1).optional(),
3999
+ isBranded: z42.boolean().optional(),
4000
+ topicId: z42.string().min(1).nullish(),
4001
+ tags: z42.array(z42.string().min(1)).optional()
4002
+ });
4003
+ var runPromptBodySchema = z42.object({
3902
4004
  /** Preferred paired representation; each agent may pin its own model tiers. */
3903
- agentConfigs: z40.array(agentConfigInputSchema).min(1).optional(),
4005
+ agentConfigs: z42.array(agentConfigInputSchema).min(1).optional(),
3904
4006
  /** Legacy agent set (no per-agent pins), kept during the API transition. */
3905
- agents: z40.array(z40.enum(["CLAUDE_CODE", "CODEX_CLI", "CURSOR"])).min(1, "Select at least one agent").default(["CLAUDE_CODE", "CODEX_CLI"]),
3906
- repoUrl: z40.string().min(1).nullish(),
3907
- repoRef: z40.string().min(1).nullish(),
3908
- samplesPerCycle: z40.number().int().min(1).max(10).default(1),
4007
+ agents: z42.array(z42.enum(["CLAUDE_CODE", "CODEX_CLI", "CURSOR"])).min(1, "Select at least one agent").default(["CLAUDE_CODE", "CODEX_CLI"]),
4008
+ repoUrl: z42.string().min(1).nullish(),
4009
+ repoRef: z42.string().min(1).nullish(),
4010
+ samplesPerCycle: z42.number().int().min(1).max(10).default(1),
3909
4011
  webFixture: webFixtureSchema.optional()
3910
4012
  });
3911
- var runPromptResponseSchema = z40.object({
3912
- batchIds: z40.array(z40.string()),
3913
- runIds: z40.array(z40.string()),
3914
- blocked: z40.enum(["insufficient_credits", "needs_provider_key"]).optional()
4013
+ var runPromptResponseSchema = z42.object({
4014
+ batchIds: z42.array(z42.string()),
4015
+ runIds: z42.array(z42.string()),
4016
+ blocked: z42.enum(["insufficient_credits", "needs_provider_key"]).optional()
3915
4017
  });
3916
4018
 
3917
4019
  // ../packages/api-schemas/src/repos.ts
3918
- import { z as z41 } from "zod";
4020
+ import { z as z43 } from "zod";
3919
4021
  var REPO_SIZE_BUCKETS = [
3920
4022
  "small",
3921
4023
  "medium",
3922
4024
  "large",
3923
4025
  "xlarge"
3924
4026
  ];
3925
- var repoSizeBucketSchema = z41.enum(REPO_SIZE_BUCKETS);
3926
- var repoSchema = z41.object({
3927
- url: z41.string(),
3928
- name: z41.string(),
3929
- isSystem: z41.boolean(),
3930
- languages: z41.array(z41.string()),
3931
- frameworks: z41.array(z41.string()),
4027
+ var repoSizeBucketSchema = z43.enum(REPO_SIZE_BUCKETS);
4028
+ var repoSchema = z43.object({
4029
+ url: z43.string(),
4030
+ name: z43.string(),
4031
+ isSystem: z43.boolean(),
4032
+ languages: z43.array(z43.string()),
4033
+ frameworks: z43.array(z43.string()),
3932
4034
  /** Faceted labels (complexity:L2, buildable:yes, stack:nextjs, …). */
3933
- tags: z41.array(z41.string()),
3934
- primaryLanguage: z41.string(),
3935
- sizeKb: z41.number(),
4035
+ tags: z43.array(z43.string()),
4036
+ primaryLanguage: z43.string(),
4037
+ sizeKb: z43.number(),
3936
4038
  sizeBucket: repoSizeBucketSchema.nullable(),
3937
- stars: z41.number()
4039
+ stars: z43.number()
3938
4040
  });
3939
4041
  var repoListResponseSchema = listResponseSchema(repoSchema);
3940
- var addRepoBodySchema = z41.object({
3941
- url: z41.string().min(1, "url is required"),
4042
+ var addRepoBodySchema = z43.object({
4043
+ url: z43.string().min(1, "url is required"),
3942
4044
  /**
3943
4045
  * Reserved (accepted, not yet persisted): the catalog keys repos by URL only
3944
4046
  * — `fact_repo` has no ref column and metadata sync always reads the default
3945
4047
  * branch. Kept in the wire format so `gauge repos add --ref` is stable once
3946
4048
  * the catalog learns refs.
3947
4049
  */
3948
- ref: z41.string().min(1).optional(),
4050
+ ref: z43.string().min(1).optional(),
3949
4051
  /** Display name; defaults to the `owner/repo` label of the URL. */
3950
- name: z41.string().min(1).optional(),
4052
+ name: z43.string().min(1).optional(),
3951
4053
  /** Manual override; defaults to frameworks detected from the repo's manifests. */
3952
- frameworks: z41.array(z41.string()).optional(),
3953
- tags: z41.array(z41.string()).optional()
4054
+ frameworks: z43.array(z43.string()).optional(),
4055
+ tags: z43.array(z43.string()).optional()
3954
4056
  });
3955
- var updateRepoBodySchema = z41.object({
3956
- url: z41.string().min(1, "url is required"),
3957
- name: z41.string().min(1).optional(),
3958
- frameworks: z41.array(z41.string()).optional(),
3959
- tags: z41.array(z41.string()).optional()
4057
+ var updateRepoBodySchema = z43.object({
4058
+ url: z43.string().min(1, "url is required"),
4059
+ name: z43.string().min(1).optional(),
4060
+ frameworks: z43.array(z43.string()).optional(),
4061
+ tags: z43.array(z43.string()).optional()
3960
4062
  });
3961
- var resyncRepoBodySchema = z41.object({
3962
- url: z41.string().min(1, "url is required")
4063
+ var resyncRepoBodySchema = z43.object({
4064
+ url: z43.string().min(1, "url is required")
3963
4065
  });
3964
- var deleteRepoQuerySchema = z41.object({
3965
- url: z41.string().min(1, "url is required")
4066
+ var deleteRepoQuerySchema = z43.object({
4067
+ url: z43.string().min(1, "url is required")
3966
4068
  });
3967
- var repoSyncResultSchema = z41.object({
4069
+ var repoSyncResultSchema = z43.object({
3968
4070
  repo: repoSchema,
3969
- synced: z41.boolean()
4071
+ synced: z43.boolean()
3970
4072
  });
3971
4073
 
3972
4074
  // ../packages/api-schemas/src/runAddons.ts
3973
- import { z as z42 } from "zod";
3974
- var runAddonsSchema = z42.object({
3975
- browser: z42.object({
3976
- session: z42.string().min(1),
3977
- projectId: z42.number().int().positive(),
3978
- region: z42.literal("us").default("us")
4075
+ import { z as z44 } from "zod";
4076
+ var runAddonsSchema = z44.object({
4077
+ browser: z44.object({
4078
+ session: z44.string().min(1),
4079
+ projectId: z44.number().int().positive(),
4080
+ region: z44.literal("us").default("us")
3979
4081
  }).strict().optional()
3980
4082
  }).strict();
3981
4083
 
3982
4084
  // ../packages/api-schemas/src/runDefinitions.ts
3983
- import { z as z46 } from "zod";
4085
+ import { z as z48 } from "zod";
3984
4086
 
3985
4087
  // ../packages/api-schemas/src/preference.ts
3986
- import { z as z43 } from "zod";
3987
- var preferenceDefinitionSchema = z43.discriminatedUnion("kind", [
3988
- z43.object({
3989
- kind: z43.literal("open-ended"),
3990
- branded: z43.boolean().default(false)
4088
+ import { z as z45 } from "zod";
4089
+ var preferenceDefinitionSchema = z45.discriminatedUnion("kind", [
4090
+ z45.object({
4091
+ kind: z45.literal("open-ended"),
4092
+ branded: z45.boolean().default(false)
3991
4093
  }).strict(),
3992
- z43.object({
3993
- kind: z43.literal("head-to-head"),
3994
- brandA: z43.string().trim().min(1),
3995
- brandB: z43.string().trim().min(1)
4094
+ z45.object({
4095
+ kind: z45.literal("head-to-head"),
4096
+ brandA: z45.string().trim().min(1),
4097
+ brandB: z45.string().trim().min(1)
3996
4098
  }).strict().refine(
3997
4099
  (p) => p.brandA.toLowerCase() !== p.brandB.toLowerCase(),
3998
4100
  "A head-to-head needs two different brands"
3999
4101
  )
4000
4102
  ]);
4001
- var preferenceSnapshotSchema = z43.object({ version: z43.literal(1), preference: preferenceDefinitionSchema }).strict();
4002
- var headToHeadSchema = z43.object({
4003
- kind: z43.literal("HEAD_TO_HEAD"),
4004
- winner: z43.enum(["A", "B", "neither"]),
4005
- brandA: z43.string(),
4006
- brandB: z43.string(),
4007
- rationale: z43.string(),
4008
- brandAReasoning: z43.string(),
4009
- brandBReasoning: z43.string(),
4010
- brandAWhyRaised: z43.string().optional(),
4011
- brandBWhyRaised: z43.string().optional()
4012
- });
4013
- var recommendPickSchema = z43.object({
4014
- brand: z43.string(),
4015
- rank: z43.number().int(),
4016
- adopted: z43.boolean(),
4017
- reasoning: z43.string().optional(),
4018
- whyRaised: z43.string().optional()
4019
- });
4020
- var recommendSchema = z43.object({
4021
- kind: z43.literal("RECOMMEND"),
4022
- picks: z43.array(recommendPickSchema).default([]),
4023
- singlePick: z43.boolean(),
4024
- complianceNote: z43.string()
4025
- });
4026
- var visibilityVerdictSchema = z43.discriminatedUnion("kind", [
4103
+ var preferenceSnapshotSchema = z45.object({ version: z45.literal(1), preference: preferenceDefinitionSchema }).strict();
4104
+ var headToHeadSchema = z45.object({
4105
+ kind: z45.literal("HEAD_TO_HEAD"),
4106
+ assessability: z45.enum(["assessed", "partial", "unassessable"]).optional(),
4107
+ selectionStatus: z45.enum(["measured", "not_measured", "unassessable"]).optional(),
4108
+ winner: z45.enum(["A", "B", "both", "neither"]),
4109
+ brandA: z45.string(),
4110
+ brandB: z45.string(),
4111
+ rationale: z45.string(),
4112
+ brandAReasoning: z45.string(),
4113
+ brandBReasoning: z45.string(),
4114
+ brandAWhyRaised: z45.string().optional(),
4115
+ brandBWhyRaised: z45.string().optional()
4116
+ });
4117
+ var recommendPickSchema = z45.object({
4118
+ brand: z45.string(),
4119
+ rank: z45.number().int(),
4120
+ adopted: z45.boolean(),
4121
+ reasoning: z45.string().optional(),
4122
+ whyRaised: z45.string().optional()
4123
+ });
4124
+ var recommendSchema = z45.object({
4125
+ kind: z45.literal("RECOMMEND"),
4126
+ selectedBrands: z45.array(z45.string()).optional(),
4127
+ assessability: z45.enum(["assessed", "partial", "unassessable"]).optional(),
4128
+ selectionStatus: z45.enum(["measured", "not_measured", "unassessable"]).optional(),
4129
+ picks: z45.array(recommendPickSchema).default([]),
4130
+ singlePick: z45.boolean(),
4131
+ complianceNote: z45.string()
4132
+ });
4133
+ var visibilityVerdictSchema = z45.discriminatedUnion("kind", [
4027
4134
  headToHeadSchema,
4028
4135
  recommendSchema
4029
4136
  ]);
4030
4137
  function preferenceSelectionLabel(verdict) {
4138
+ if (verdict.assessability === "unassessable" || verdict.selectionStatus === "unassessable")
4139
+ return "Not assessable";
4031
4140
  if (verdict.kind === "HEAD_TO_HEAD")
4032
- return verdict.winner === "A" ? verdict.brandA : verdict.winner === "B" ? verdict.brandB : "Neither";
4141
+ return verdict.winner === "A" ? verdict.brandA : verdict.winner === "B" ? verdict.brandB : verdict.winner === "both" ? `${verdict.brandA} and ${verdict.brandB}` : "Neither";
4142
+ if (verdict.selectedBrands !== void 0)
4143
+ return verdict.selectedBrands.length ? verdict.selectedBrands.join(", ") : "No selection";
4033
4144
  if (!verdict.singlePick)
4034
4145
  return verdict.picks.length ? "No clear selection" : "No selection";
4035
4146
  return verdict.picks.find((pick) => pick.rank === 1)?.brand ?? "No selection";
4036
4147
  }
4037
4148
 
4038
4149
  // ../packages/api-schemas/src/runDefinitionInputs.ts
4039
- import { z as z45 } from "zod";
4150
+ import { z as z47 } from "zod";
4040
4151
 
4041
4152
  // ../packages/api-schemas/src/runPlan.ts
4042
- import { z as z44 } from "zod";
4043
- var runPlanCriterionSchema = z44.object({
4044
- id: z44.string().min(1),
4045
- name: z44.string(),
4046
- rubric: z44.string()
4153
+ import { z as z46 } from "zod";
4154
+ var runPlanCriterionSchema = z46.object({
4155
+ id: z46.string().min(1),
4156
+ name: z46.string(),
4157
+ rubric: z46.string()
4047
4158
  });
4048
- var criteriaSnapshotV1Schema = z44.object({
4049
- version: z44.literal(1),
4159
+ var criteriaSnapshotV1Schema = z46.object({
4160
+ version: z46.literal(1),
4050
4161
  // File-authored criteria have no saved EvalSet; their identity is frozen
4051
4162
  // in the request and result rows retain the criterion text without an FK.
4052
- evalSetId: z44.string().min(1).nullable(),
4053
- criteria: z44.array(runPlanCriterionSchema)
4054
- });
4055
- var runPlanCaseSchema = z44.object({
4056
- id: z44.string().min(1),
4057
- prompt: z44.object({ id: z44.string().min(1), text: z44.string() }),
4058
- workspace: z44.object({
4059
- repoUrl: z44.string().nullable(),
4060
- repoRef: z44.string().nullable()
4163
+ evalSetId: z46.string().min(1).nullable(),
4164
+ criteria: z46.array(runPlanCriterionSchema)
4165
+ });
4166
+ var runPlanCaseSchema = z46.object({
4167
+ id: z46.string().min(1),
4168
+ prompt: z46.object({ id: z46.string().min(1), text: z46.string() }),
4169
+ workspace: z46.object({
4170
+ repoUrl: z46.string().nullable(),
4171
+ repoRef: z46.string().nullable()
4061
4172
  }),
4062
- agents: z44.array(
4173
+ agents: z46.array(
4063
4174
  agentConfigSchema.extend({
4064
4175
  // Validated against the current catalog request schema when lowered.
4065
- catalogSelections: z44.record(z44.string(), z44.unknown()).optional()
4176
+ catalogSelections: z46.record(z46.string(), z46.unknown()).optional()
4066
4177
  })
4067
4178
  ),
4068
- samples: z44.number().int().min(1).max(50),
4069
- evalSetId: z44.string().min(1).optional(),
4179
+ samples: z46.number().int().min(1).max(50),
4180
+ evalSetId: z46.string().min(1).optional(),
4070
4181
  criteriaSnapshot: criteriaSnapshotV1Schema.optional(),
4071
4182
  preferenceSnapshot: preferenceSnapshotSchema.optional(),
4072
- sourceRepoCommit: z44.string().nullable().optional(),
4073
- experiment: z44.string().nullable().optional(),
4074
- membershipTagIds: z44.array(z44.string()).optional(),
4075
- profile: z44.object({
4076
- id: z44.string(),
4077
- name: z44.string(),
4078
- description: z44.string(),
4079
- model: z44.string()
4183
+ sourceRepoCommit: z46.string().nullable().optional(),
4184
+ experiment: z46.string().nullable().optional(),
4185
+ membershipTagIds: z46.array(z46.string()).optional(),
4186
+ profile: z46.object({
4187
+ id: z46.string(),
4188
+ name: z46.string(),
4189
+ description: z46.string(),
4190
+ model: z46.string()
4080
4191
  }).nullable().optional(),
4081
4192
  skillSet: skillSetSchema.optional(),
4082
4193
  mcpSet: mcpSetSchema.optional(),
4083
4194
  connectionSet: connectionSetSchema.optional(),
4084
4195
  // The server's agentContextSnapshotV1Schema validates this at lowering.
4085
- agentContext: z44.unknown().optional(),
4086
- agentContextDigest: z44.string().nullable().optional(),
4196
+ agentContext: z46.unknown().optional(),
4197
+ agentContextDigest: z46.string().nullable().optional(),
4087
4198
  addons: runAddonsSchema.optional(),
4088
4199
  /** Names of resources the coordinator must prepare before expansion. */
4089
- inputs: z44.array(z44.string().min(1)).default([])
4200
+ inputs: z46.array(z46.string().min(1)).default([])
4090
4201
  });
4091
- var inputPathSchema = z44.string().min(1).max(256).regex(
4202
+ var inputPathSchema = z46.string().min(1).max(256).regex(
4092
4203
  // biome-ignore lint/suspicious/noControlCharactersInRegex: Reject unsafe control characters in authored paths.
4093
4204
  /^(?![!/])(?!.*[\\\x00-\x1f\x7f])(?!.*(?:^|\/)\.{1,2}(?:\/|$))(?!.*\/\/)(?!.*\/$).+$/,
4094
4205
  "Expected a repository-relative path or glob without traversal"
@@ -4123,20 +4234,20 @@ var reservedBinaryCommands = [
4123
4234
  "pi",
4124
4235
  "wizard"
4125
4236
  ];
4126
- var binaryCommandSchema = z44.string().max(128).regex(
4237
+ var binaryCommandSchema = z46.string().max(128).regex(
4127
4238
  /^[A-Za-z0-9_][A-Za-z0-9_.+-]*$/,
4128
4239
  "Expected a command name without paths or shell syntax"
4129
4240
  ).refine(
4130
4241
  (name) => !reservedBinaryCommands.includes(name),
4131
4242
  "Command is reserved for Gauge workspace setup or the agent harness; choose another command name"
4132
4243
  );
4133
- var binaryUseSchema = z44.object({
4134
- type: z44.literal("binary"),
4135
- paths: z44.array(inputPathSchema).min(1).max(32),
4136
- platform: z44.literal("linux-x64").describe(
4244
+ var binaryUseSchema = z46.object({
4245
+ type: z46.literal("binary"),
4246
+ paths: z46.array(inputPathSchema).min(1).max(32),
4247
+ platform: z46.literal("linux-x64").describe(
4137
4248
  "Linux x86-64 ELF executables compatible with the consumer sandbox. No system packages are installed."
4138
4249
  ),
4139
- commands: z44.record(
4250
+ commands: z46.record(
4140
4251
  binaryCommandSchema,
4141
4252
  inputPathSchema.regex(
4142
4253
  /^[^*?{}[\]]+$/,
@@ -4147,69 +4258,69 @@ var binaryUseSchema = z44.object({
4147
4258
  "Declare between 1 and 32 commands"
4148
4259
  ).meta({ minProperties: 1, maxProperties: 32 })
4149
4260
  }).strict();
4150
- var inputUseSchema = z44.discriminatedUnion("type", [
4261
+ var inputUseSchema = z46.discriminatedUnion("type", [
4151
4262
  binaryUseSchema,
4152
4263
  websiteUseSchema,
4153
- z44.object({
4154
- type: z44.literal("files"),
4155
- paths: z44.array(inputPathSchema).min(1).max(32).optional()
4264
+ z46.object({
4265
+ type: z46.literal("files"),
4266
+ paths: z46.array(inputPathSchema).min(1).max(32).optional()
4156
4267
  }).strict(),
4157
- z44.object({
4158
- type: z44.literal("npm-cli"),
4268
+ z46.object({
4269
+ type: z46.literal("npm-cli"),
4159
4270
  package: inputPathSchema,
4160
- install: z44.enum(["environment", "workspace"]).optional()
4271
+ install: z46.enum(["environment", "workspace"]).optional()
4161
4272
  }).strict(),
4162
- z44.object({
4163
- type: z44.literal("npm-package"),
4273
+ z46.object({
4274
+ type: z46.literal("npm-package"),
4164
4275
  package: inputPathSchema,
4165
- install: z44.enum(["environment", "workspace"]).optional()
4276
+ install: z46.enum(["environment", "workspace"]).optional()
4166
4277
  }).strict(),
4167
- z44.object({
4168
- type: z44.literal("skill"),
4169
- root: z44.union([z44.literal("."), inputPathSchema]).refine(
4278
+ z46.object({
4279
+ type: z46.literal("skill"),
4280
+ root: z46.union([z46.literal("."), inputPathSchema]).refine(
4170
4281
  (path3) => !/[*?{}[\]]/.test(path3),
4171
4282
  "Skill root must be an explicit directory"
4172
4283
  )
4173
4284
  }).strict()
4174
4285
  ]);
4175
- var inputSourceSchema = z44.discriminatedUnion("type", [
4176
- z44.object({
4177
- type: z44.literal("git"),
4178
- paths: z44.array(inputPathSchema).min(1).max(32)
4286
+ var inputSourceSchema = z46.discriminatedUnion("type", [
4287
+ z46.object({
4288
+ type: z46.literal("git"),
4289
+ paths: z46.array(inputPathSchema).min(1).max(32)
4179
4290
  }).strict(),
4180
- z44.object({
4181
- type: z44.literal("github-actions"),
4291
+ z46.object({
4292
+ type: z46.literal("github-actions"),
4182
4293
  // Omit to discover the sole artifact from the selected workflow run.
4183
4294
  // Names are supplied by CI and need not encode the PR head revision.
4184
- artifact: z44.string().min(1).max(256).optional()
4295
+ artifact: z46.string().min(1).max(256).optional()
4185
4296
  }).strict()
4186
4297
  ]);
4187
- var runPlanResourceSchema = z44.object({
4188
- name: z44.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).max(64),
4189
- type: z44.literal("input"),
4190
- source: z44.discriminatedUnion("type", [
4191
- z44.object({
4192
- type: z44.literal("upload"),
4193
- sha256: z44.string().regex(/^sha256:[a-f0-9]{64}$/),
4194
- bytes: z44.number().int().positive().max(512 * 1024 * 1024),
4195
- repoUrl: z44.string().nullable(),
4196
- commit: z44.string().regex(/^[a-f0-9]{40}$/i).nullable()
4298
+ var runPlanResourceSchema = z46.object({
4299
+ name: z46.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).max(64),
4300
+ type: z46.literal("input"),
4301
+ source: z46.discriminatedUnion("type", [
4302
+ z46.object({
4303
+ type: z46.literal("upload"),
4304
+ sha256: z46.string().regex(/^sha256:[a-f0-9]{64}$/),
4305
+ bytes: z46.number().int().positive().max(512 * 1024 * 1024),
4306
+ repoUrl: z46.string().nullable(),
4307
+ commit: z46.string().regex(/^[a-f0-9]{40}$/i).nullable()
4197
4308
  }).strict(),
4198
4309
  commentSourceSchema.extend({
4199
- repoUrl: z44.string(),
4200
- commit: z44.string().regex(/^[a-f0-9]{40}$/i)
4310
+ repoUrl: z46.string(),
4311
+ commit: z46.string().regex(/^[a-f0-9]{40}$/i)
4201
4312
  }).strict(),
4202
4313
  deploymentSourceSchema.extend({
4203
- repoUrl: z44.string(),
4204
- commit: z44.string().regex(/^[a-f0-9]{40}$/i)
4314
+ repoUrl: z46.string(),
4315
+ commit: z46.string().regex(/^[a-f0-9]{40}$/i)
4205
4316
  }).strict(),
4206
4317
  inputSourceSchema.options[0].extend({
4207
- repoUrl: z44.string(),
4208
- commit: z44.string().regex(/^[a-f0-9]{40}$/i)
4318
+ repoUrl: z46.string(),
4319
+ commit: z46.string().regex(/^[a-f0-9]{40}$/i)
4209
4320
  }).strict(),
4210
4321
  inputSourceSchema.options[1].extend({
4211
- repoUrl: z44.string(),
4212
- commit: z44.string().regex(/^[a-f0-9]{40}$/i),
4322
+ repoUrl: z46.string(),
4323
+ commit: z46.string().regex(/^[a-f0-9]{40}$/i),
4213
4324
  workflow: inputPathSchema
4214
4325
  }).strict()
4215
4326
  ]),
@@ -4218,47 +4329,49 @@ var runPlanResourceSchema = z44.object({
4218
4329
  (r) => r.use.type === "website" === (r.source.type === "github-deployment" || r.source.type === "github-pr-comment"),
4219
4330
  "Website inputs require a deployment or PR comment source; file inputs require Git, Actions, or an upload"
4220
4331
  );
4221
- var runPlanSchema = z44.object({
4222
- version: z44.literal(1),
4332
+ var runPlanSchema = z46.object({
4333
+ version: z46.literal(1),
4334
+ /** Server-resolved checkpoint; preserved through deferred input preparation. */
4335
+ executionCheckpointId: z46.uuid().optional(),
4223
4336
  /** Existing launches keep their current measurement semantics. */
4224
- measurementMode: z44.enum([
4337
+ measurementMode: z46.enum([
4225
4338
  "EXISTING",
4226
4339
  "AGENT_EXPERIENCE",
4227
4340
  "AGENT_PREFERENCE",
4228
4341
  "MIXED"
4229
4342
  ]),
4230
- cases: z44.array(runPlanCaseSchema).min(1),
4231
- resources: z44.array(runPlanResourceSchema).default([]),
4343
+ cases: z46.array(runPlanCaseSchema).min(1),
4344
+ resources: z46.array(runPlanResourceSchema).default([]),
4232
4345
  /** Server-populated context retained across deferred preparation. */
4233
- launch: z44.object({
4234
- origin: z44.discriminatedUnion("initiator", [
4235
- z44.object({
4236
- initiator: z44.literal("API"),
4237
- userId: z44.string().min(1),
4238
- email: z44.string().nullable()
4346
+ launch: z46.object({
4347
+ origin: z46.discriminatedUnion("initiator", [
4348
+ z46.object({
4349
+ initiator: z46.literal("API"),
4350
+ userId: z46.string().min(1),
4351
+ email: z46.string().nullable()
4239
4352
  }).strict(),
4240
- z44.object({
4241
- initiator: z44.literal("GITHUB"),
4242
- userId: z44.null(),
4243
- email: z44.null()
4353
+ z46.object({
4354
+ initiator: z46.literal("GITHUB"),
4355
+ userId: z46.null(),
4356
+ email: z46.null()
4244
4357
  }).strict()
4245
4358
  ]),
4246
- funding: z44.enum(["ORG", "PLATFORM"]),
4247
- queueClass: z44.literal("INTERACTIVE")
4359
+ funding: z46.enum(["ORG", "PLATFORM"]),
4360
+ queueClass: z46.literal("INTERACTIVE")
4248
4361
  }).strict().optional(),
4249
- provenance: z44.object({
4250
- definition: z44.object({
4251
- repoUrl: z44.string().min(1).nullable(),
4252
- commit: z44.string().regex(/^[a-f0-9]{40}$/i).nullable(),
4253
- digest: z44.string().min(1),
4362
+ provenance: z46.object({
4363
+ definition: z46.object({
4364
+ repoUrl: z46.string().min(1).nullable(),
4365
+ commit: z46.string().regex(/^[a-f0-9]{40}$/i).nullable(),
4366
+ digest: z46.string().min(1),
4254
4367
  /** File submissions are asserted by the caller until server-side
4255
4368
  * committed-byte fetching is available. */
4256
- verification: z44.enum(["SUBMITTED_UNVERIFIED", "GITHUB_VERIFIED", "LOCAL"]).optional()
4369
+ verification: z46.enum(["SUBMITTED_UNVERIFIED", "GITHUB_VERIFIED", "LOCAL"]).optional()
4257
4370
  }).optional(),
4258
- liveDependencies: z44.array(
4259
- z44.object({
4260
- name: z44.string().min(1),
4261
- url: z44.string().url().optional()
4371
+ liveDependencies: z46.array(
4372
+ z46.object({
4373
+ name: z46.string().min(1),
4374
+ url: z46.string().url().optional()
4262
4375
  })
4263
4376
  ).default([])
4264
4377
  })
@@ -4330,43 +4443,43 @@ var runPlanSchema = z44.object({
4330
4443
  });
4331
4444
 
4332
4445
  // ../packages/api-schemas/src/runDefinitionInputs.ts
4333
- var definitionInputSourceSchema = z45.discriminatedUnion("type", [
4334
- z45.object({ type: z45.literal("git") }).strict(),
4335
- z45.object({
4336
- type: z45.literal("github-actions"),
4446
+ var definitionInputSourceSchema = z47.discriminatedUnion("type", [
4447
+ z47.object({ type: z47.literal("git") }).strict(),
4448
+ z47.object({
4449
+ type: z47.literal("github-actions"),
4337
4450
  workflow: inputPathSchema.regex(/^\.github\/workflows\/[^/*?{}[\]]+\.ya?ml$/).describe(
4338
4451
  "Workflow file in this repository, for example .github/workflows/build.yml."
4339
4452
  ),
4340
- artifact: z45.string().min(1).max(256).optional().describe(
4453
+ artifact: z47.string().min(1).max(256).optional().describe(
4341
4454
  "Upload name or pattern. Omit only when the workflow produces exactly one artifact."
4342
4455
  )
4343
4456
  }).strict()
4344
4457
  ]);
4345
- var skillInputPathSchema = z45.union([z45.literal("."), inputPathSchema.regex(/^[^*?{}[\]]+$/)]).describe(
4458
+ var skillInputPathSchema = z47.union([z47.literal("."), inputPathSchema.regex(/^[^*?{}[\]]+$/)]).describe(
4346
4459
  "Explicit Skill directory or ZIP/tar.gz file containing SKILL.md at its root."
4347
4460
  );
4348
- var runDefinitionInputSchema = z45.discriminatedUnion("type", [
4461
+ var runDefinitionInputSchema = z47.discriminatedUnion("type", [
4349
4462
  binaryUseSchema.extend({ source: definitionInputSourceSchema.default({ type: "git" }) }).strict(),
4350
4463
  websiteUseSchema.extend({ source: websiteSourceSchema }).strict(),
4351
- z45.object({
4352
- type: z45.literal("npm-package"),
4464
+ z47.object({
4465
+ type: z47.literal("npm-package"),
4353
4466
  source: definitionInputSourceSchema.default({ type: "git" }),
4354
4467
  path: inputPathSchema.describe(
4355
4468
  "Path or glob selecting exactly one packed npm .tgz file."
4356
4469
  ),
4357
- install: z45.enum(["environment", "workspace"]).default("environment").describe(
4470
+ install: z47.enum(["environment", "workspace"]).default("environment").describe(
4358
4471
  "environment exposes the package's commands on PATH; workspace adds a consumer application dependency."
4359
4472
  )
4360
4473
  }).strict(),
4361
- z45.object({
4362
- type: z45.literal("skill"),
4474
+ z47.object({
4475
+ type: z47.literal("skill"),
4363
4476
  source: definitionInputSourceSchema.default({ type: "git" }),
4364
4477
  path: skillInputPathSchema
4365
4478
  }).strict(),
4366
- z45.object({
4367
- type: z45.literal("files"),
4479
+ z47.object({
4480
+ type: z47.literal("files"),
4368
4481
  source: definitionInputSourceSchema.default({ type: "git" }),
4369
- paths: z45.array(inputPathSchema).min(1).max(32).describe(
4482
+ paths: z47.array(inputPathSchema).min(1).max(32).describe(
4370
4483
  "Files or globs selected from the committed Git tree or the uploaded artifact."
4371
4484
  )
4372
4485
  }).strict()
@@ -4400,11 +4513,11 @@ function compileDefinitionInput(name, input, repoUrl, commit) {
4400
4513
  }
4401
4514
 
4402
4515
  // ../packages/api-schemas/src/runDefinitions.ts
4403
- var inputUploadSpecSchema = z46.object({
4404
- sha256: z46.string().regex(/^sha256:[a-f0-9]{64}$/),
4405
- bytes: z46.number().int().positive().max(512 * 1024 * 1024)
4516
+ var inputUploadSpecSchema = z48.object({
4517
+ sha256: z48.string().regex(/^sha256:[a-f0-9]{64}$/),
4518
+ bytes: z48.number().int().positive().max(512 * 1024 * 1024)
4406
4519
  }).strict();
4407
- var uncredentialedRepoUrlSchema = z46.string().min(1).refine((raw) => {
4520
+ var uncredentialedRepoUrlSchema = z48.string().min(1).refine((raw) => {
4408
4521
  if (!/^[a-z][a-z0-9+.-]*:\/\//i.test(raw)) return true;
4409
4522
  try {
4410
4523
  const url = new URL(raw);
@@ -4413,71 +4526,71 @@ var uncredentialedRepoUrlSchema = z46.string().min(1).refine((raw) => {
4413
4526
  return false;
4414
4527
  }
4415
4528
  }, "Repository URL must not contain embedded credentials or query parameters");
4416
- var runDefinitionChecksSchema = z46.object({ paths: z46.array(inputPathSchema).min(1).max(32) }).strict();
4417
- var runDefinitionConfigSchema = z46.object({
4418
- agents: z46.array(agentConfigInputSchema).min(1),
4419
- sampleCount: z46.number().int().min(1).max(50).optional(),
4529
+ var runDefinitionChecksSchema = z48.object({ paths: z48.array(inputPathSchema).min(1).max(32) }).strict();
4530
+ var runDefinitionConfigSchema = z48.object({
4531
+ agents: z48.array(agentConfigInputSchema).min(1),
4532
+ sampleCount: z48.number().int().min(1).max(50).optional(),
4420
4533
  repoUrl: uncredentialedRepoUrlSchema.nullable().optional(),
4421
- repoRef: z46.string().min(1).nullable().optional(),
4422
- profileId: z46.string().min(1).nullable().optional(),
4534
+ repoRef: z48.string().min(1).nullable().optional(),
4535
+ profileId: z48.string().min(1).nullable().optional(),
4423
4536
  skillRefs: assetRefListSchema.optional(),
4424
4537
  mcpRefs: assetRefListSchema.optional(),
4425
- connectionIds: z46.array(z46.string().min(1)).max(32).optional(),
4538
+ connectionIds: z48.array(z48.string().min(1)).max(32).optional(),
4426
4539
  addons: runAddonsSchema.optional(),
4427
- inputs: z46.array(z46.string()).optional(),
4540
+ inputs: z48.array(z48.string()).optional(),
4428
4541
  checks: runDefinitionChecksSchema.optional()
4429
4542
  }).strict();
4430
- var runDefinitionFileConfigSchema = z46.object({
4431
- version: z46.literal(2).default(2),
4432
- org: z46.string().min(1).optional(),
4543
+ var runDefinitionFileConfigSchema = z48.object({
4544
+ version: z48.literal(2).default(2),
4545
+ org: z48.string().min(1).optional(),
4433
4546
  checks: runDefinitionChecksSchema.optional(),
4434
- cases: z46.array(inputPathSchema).min(1).max(32).default(["gauge-evals/**/*.md"]),
4435
- inputs: z46.record(
4436
- z46.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).max(64),
4547
+ cases: z48.array(inputPathSchema).min(1).max(32).default(["gauge-evals/**/*.md"]),
4548
+ inputs: z48.record(
4549
+ z48.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).max(64),
4437
4550
  runDefinitionInputSchema
4438
4551
  ).refine(
4439
4552
  (inputs) => Object.keys(inputs).length <= 32,
4440
4553
  "At most 32 inputs are allowed"
4441
4554
  ).meta({ maxProperties: 32 }).default({})
4442
4555
  }).strict();
4443
- var runDefinitionCriterionSchema = z46.object({ name: z46.string().min(1), rubric: z46.string().min(1) }).strict();
4556
+ var runDefinitionCriterionSchema = z48.object({ name: z48.string().min(1), rubric: z48.string().min(1) }).strict();
4444
4557
  var caseMeasurement = {
4445
- criteria: z46.array(runDefinitionCriterionSchema).min(1).optional(),
4558
+ criteria: z48.array(runDefinitionCriterionSchema).min(1).optional(),
4446
4559
  preference: preferenceDefinitionSchema.optional()
4447
4560
  };
4448
4561
  function exactlyOneMeasurement(item) {
4449
4562
  return item.criteria !== void 0 !== (item.preference !== void 0);
4450
4563
  }
4451
- var runDefinitionFrontmatterSchema = z46.object({
4564
+ var runDefinitionFrontmatterSchema = z48.object({
4452
4565
  ...caseMeasurement,
4453
4566
  config: runDefinitionConfigSchema
4454
4567
  }).strict().refine(
4455
4568
  exactlyOneMeasurement,
4456
4569
  "Specify exactly one of criteria or preference"
4457
4570
  );
4458
- var runDefinitionCaseSchema = z46.object({
4459
- path: z46.string().min(1),
4460
- prompt: z46.string().min(1),
4571
+ var runDefinitionCaseSchema = z48.object({
4572
+ path: z48.string().min(1),
4573
+ prompt: z48.string().min(1),
4461
4574
  ...caseMeasurement,
4462
4575
  config: runDefinitionConfigSchema
4463
4576
  }).strict().refine(
4464
4577
  exactlyOneMeasurement,
4465
4578
  "Specify exactly one of criteria or preference"
4466
4579
  );
4467
- var runDefinitionSubmissionSchema = z46.object({
4468
- version: z46.literal(2),
4469
- source: z46.object({
4580
+ var runDefinitionSubmissionSchema = z48.object({
4581
+ version: z48.literal(2),
4582
+ source: z48.object({
4470
4583
  repoUrl: uncredentialedRepoUrlSchema.nullable(),
4471
- commit: z46.string().regex(/^[a-f0-9]{40}$/i).nullable(),
4472
- digest: z46.string().regex(/^sha256:[a-f0-9]{64}$/),
4473
- verification: z46.enum([
4584
+ commit: z48.string().regex(/^[a-f0-9]{40}$/i).nullable(),
4585
+ digest: z48.string().regex(/^sha256:[a-f0-9]{64}$/),
4586
+ verification: z48.enum([
4474
4587
  "SUBMITTED_UNVERIFIED",
4475
4588
  "GITHUB_VERIFIED",
4476
4589
  "LOCAL"
4477
4590
  ])
4478
4591
  }).strict(),
4479
- resources: z46.array(runPlanResourceSchema).max(32).default([]),
4480
- cases: z46.array(runDefinitionCaseSchema).min(1).max(20)
4592
+ resources: z48.array(runPlanResourceSchema).max(32).default([]),
4593
+ cases: z48.array(runDefinitionCaseSchema).min(1).max(20)
4481
4594
  }).strict().superRefine((definition, ctx) => {
4482
4595
  if (definition.source.verification !== "LOCAL" && (!definition.source.repoUrl || !definition.source.commit))
4483
4596
  ctx.addIssue({
@@ -4532,29 +4645,29 @@ var runDefinitionPublicSubmissionSchema = runDefinitionSubmissionSchema.refine(
4532
4645
  message: "Only the GitHub App may verify committed bytes"
4533
4646
  }
4534
4647
  );
4535
- var runDefinitionPlanResponseSchema = z46.object({
4648
+ var runDefinitionPlanResponseSchema = z48.object({
4536
4649
  source: runDefinitionSubmissionSchema.shape.source,
4537
- measurementMode: z46.enum(["AGENT_EXPERIENCE", "AGENT_PREFERENCE", "MIXED"]),
4538
- cases: z46.array(
4539
- z46.object({
4540
- path: z46.string(),
4541
- agents: z46.array(agentConfigSchema),
4542
- samples: z46.number().int().nonnegative(),
4543
- expectedRuns: z46.number().int().nonnegative(),
4544
- workspace: z46.object({
4545
- repoUrl: z46.string().nullable(),
4546
- repoRef: z46.string().nullable()
4650
+ measurementMode: z48.enum(["AGENT_EXPERIENCE", "AGENT_PREFERENCE", "MIXED"]),
4651
+ cases: z48.array(
4652
+ z48.object({
4653
+ path: z48.string(),
4654
+ agents: z48.array(agentConfigSchema),
4655
+ samples: z48.number().int().nonnegative(),
4656
+ expectedRuns: z48.number().int().nonnegative(),
4657
+ workspace: z48.object({
4658
+ repoUrl: z48.string().nullable(),
4659
+ repoRef: z48.string().nullable()
4547
4660
  }),
4548
- criteriaCount: z46.number().int().nonnegative(),
4661
+ criteriaCount: z48.number().int().nonnegative(),
4549
4662
  preference: preferenceDefinitionSchema.optional(),
4550
- inputs: z46.array(z46.string())
4663
+ inputs: z48.array(z48.string())
4551
4664
  })
4552
4665
  ),
4553
- resources: z46.array(
4554
- z46.object({
4555
- name: z46.string(),
4556
- type: z46.literal("input"),
4557
- source: z46.enum([
4666
+ resources: z48.array(
4667
+ z48.object({
4668
+ name: z48.string(),
4669
+ type: z48.literal("input"),
4670
+ source: z48.enum([
4558
4671
  "git",
4559
4672
  "github-actions",
4560
4673
  "github-deployment",
@@ -4562,26 +4675,26 @@ var runDefinitionPlanResponseSchema = z46.object({
4562
4675
  "upload"
4563
4676
  ]),
4564
4677
  use: inputUseSchema,
4565
- readiness: z46.enum(["READY", "WAITING", "FAILED"]),
4566
- detail: z46.string().optional(),
4567
- commands: z46.array(z46.string()).optional()
4678
+ readiness: z48.enum(["READY", "WAITING", "FAILED"]),
4679
+ detail: z48.string().optional(),
4680
+ commands: z48.array(z48.string()).optional()
4568
4681
  })
4569
4682
  ),
4570
- expectedRuns: z46.number().int().nonnegative(),
4571
- canRun: z46.boolean()
4683
+ expectedRuns: z48.number().int().nonnegative(),
4684
+ canRun: z48.boolean()
4572
4685
  });
4573
- var runDefinitionRunResponseSchema = z46.object({
4574
- runRequestId: z46.string(),
4575
- batchIds: z46.array(z46.string()),
4576
- runIds: z46.array(z46.string()),
4577
- requestedRuns: z46.number().int().nonnegative(),
4578
- createdRuns: z46.number().int().nonnegative(),
4579
- aggregateUrl: z46.string()
4686
+ var runDefinitionRunResponseSchema = z48.object({
4687
+ runRequestId: z48.string(),
4688
+ batchIds: z48.array(z48.string()),
4689
+ runIds: z48.array(z48.string()),
4690
+ requestedRuns: z48.number().int().nonnegative(),
4691
+ createdRuns: z48.number().int().nonnegative(),
4692
+ aggregateUrl: z48.string()
4580
4693
  });
4581
4694
 
4582
4695
  // ../packages/api-schemas/src/runRequests.ts
4583
- import { z as z47 } from "zod";
4584
- var runRequestStatusSchema = z47.enum([
4696
+ import { z as z49 } from "zod";
4697
+ var runRequestStatusSchema = z49.enum([
4585
4698
  "PENDING",
4586
4699
  "PREPARING",
4587
4700
  "RUNNING",
@@ -4589,7 +4702,7 @@ var runRequestStatusSchema = z47.enum([
4589
4702
  "FAILED",
4590
4703
  "CANCELED"
4591
4704
  ]);
4592
- var runRequestResultSchema = z47.enum([
4705
+ var runRequestResultSchema = z49.enum([
4593
4706
  "PENDING",
4594
4707
  "PASSED",
4595
4708
  "MEASURED",
@@ -4600,230 +4713,226 @@ var runRequestResultSchema = z47.enum([
4600
4713
  "INCOMPLETE",
4601
4714
  "CANCELED"
4602
4715
  ]);
4603
- var runRequestCriterionResultSchema = z47.object({
4604
- criterionId: z47.string().nullable(),
4605
- name: z47.string(),
4606
- passed: z47.boolean(),
4607
- reasoning: z47.string().nullable()
4608
- });
4609
- var runRequestRunSchema = z47.object({
4610
- id: z47.string(),
4611
- url: z47.string().url().optional(),
4612
- batchId: z47.string(),
4613
- status: z47.string(),
4716
+ var runRequestCriterionResultSchema = z49.object({
4717
+ criterionId: z49.string().nullable(),
4718
+ name: z49.string(),
4719
+ passed: z49.boolean().nullable(),
4720
+ reasoning: z49.string().nullable()
4721
+ });
4722
+ var runRequestRunSchema = z49.object({
4723
+ id: z49.string(),
4724
+ url: z49.string().url().optional(),
4725
+ batchId: z49.string(),
4726
+ status: z49.string(),
4614
4727
  agent: agentSchema,
4615
- model: z47.string(),
4728
+ model: z49.string(),
4616
4729
  result: runRequestResultSchema,
4617
- judge: z47.object({ status: z47.string() }).nullable(),
4618
- criterionResults: z47.array(runRequestCriterionResultSchema),
4730
+ judge: z49.object({ status: z49.string() }).nullable(),
4731
+ criterionResults: z49.array(runRequestCriterionResultSchema),
4619
4732
  preference: visibilityVerdictSchema.nullable().optional(),
4620
- measurement: z47.enum(["experience", "preference"]).optional()
4733
+ measurement: z49.enum(["experience", "preference"]).optional()
4621
4734
  });
4622
- var runRequestResponseSchema = z47.object({
4623
- id: z47.string(),
4735
+ var runRequestResponseSchema = z49.object({
4736
+ id: z49.string(),
4624
4737
  status: runRequestStatusSchema,
4625
4738
  result: runRequestResultSchema,
4626
- error: z47.string().nullable().optional(),
4627
- inputs: z47.unknown().optional(),
4628
- settled: z47.boolean(),
4629
- counts: z47.object({
4630
- requestedRuns: z47.number().int().nonnegative(),
4631
- createdRuns: z47.number().int().nonnegative(),
4632
- terminalRuns: z47.number().int().nonnegative(),
4633
- judgedRuns: z47.number().int().nonnegative(),
4634
- passedRuns: z47.number().int().nonnegative(),
4635
- measuredRuns: z47.number().int().nonnegative().optional(),
4636
- qualityFailedRuns: z47.number().int().nonnegative(),
4637
- executionFailedRuns: z47.number().int().nonnegative(),
4638
- judgeFailedRuns: z47.number().int().nonnegative(),
4639
- pendingRuns: z47.number().int().nonnegative()
4739
+ error: z49.string().nullable().optional(),
4740
+ inputs: z49.unknown().optional(),
4741
+ settled: z49.boolean(),
4742
+ counts: z49.object({
4743
+ requestedRuns: z49.number().int().nonnegative(),
4744
+ createdRuns: z49.number().int().nonnegative(),
4745
+ terminalRuns: z49.number().int().nonnegative(),
4746
+ judgedRuns: z49.number().int().nonnegative(),
4747
+ passedRuns: z49.number().int().nonnegative(),
4748
+ measuredRuns: z49.number().int().nonnegative().optional(),
4749
+ qualityFailedRuns: z49.number().int().nonnegative(),
4750
+ executionFailedRuns: z49.number().int().nonnegative(),
4751
+ judgeFailedRuns: z49.number().int().nonnegative(),
4752
+ pendingRuns: z49.number().int().nonnegative()
4640
4753
  }),
4641
- batches: z47.array(
4642
- z47.object({ id: z47.string(), runs: z47.array(runRequestRunSchema) })
4754
+ batches: z49.array(
4755
+ z49.object({ id: z49.string(), runs: z49.array(runRequestRunSchema) })
4643
4756
  ),
4644
- createdAt: z47.string(),
4645
- updatedAt: z47.string(),
4646
- finishedAt: z47.string().nullable()
4757
+ createdAt: z49.string(),
4758
+ updatedAt: z49.string(),
4759
+ finishedAt: z49.string().nullable()
4647
4760
  });
4648
4761
 
4649
4762
  // ../packages/api-schemas/src/summary.ts
4650
- import { z as z48 } from "zod";
4763
+ import { z as z50 } from "zod";
4651
4764
  function cardResultSchema(data) {
4652
- return z48.union([
4653
- z48.object({ ok: z48.literal(true), data }),
4654
- z48.object({ ok: z48.literal(false), error: z48.string() })
4765
+ return z50.union([
4766
+ z50.object({ ok: z50.literal(true), data }),
4767
+ z50.object({ ok: z50.literal(false), error: z50.string() })
4655
4768
  ]);
4656
4769
  }
4657
- var summaryActionSchema = z48.object({
4658
- id: z48.string(),
4659
- title: z48.string(),
4660
- priority: z48.string(),
4661
- status: z48.string(),
4662
- evidenceCount: z48.number().int()
4663
- });
4664
- var summaryAeCardSchema = z48.object({
4665
- id: z48.string(),
4666
- name: z48.string(),
4667
- judgedRuns: z48.number().int(),
4668
- passRate: z48.number().nullable(),
4770
+ var summaryActionSchema = z50.object({
4771
+ id: z50.string(),
4772
+ title: z50.string(),
4773
+ priority: z50.string(),
4774
+ status: z50.string(),
4775
+ evidenceCount: z50.number().int()
4776
+ });
4777
+ var summaryAeCardSchema = z50.object({
4778
+ id: z50.string(),
4779
+ name: z50.string(),
4780
+ judgedRuns: z50.number().int(),
4781
+ passRate: z50.number().nullable(),
4669
4782
  /** pp delta vs the prior 30d; null with no prior. */
4670
- deltaPP: z48.number().nullable()
4671
- });
4672
- var summaryVisibilityCardSchema = z48.object({
4673
- name: z48.string(),
4674
- owned: z48.object({
4675
- name: z48.string(),
4676
- rank: z48.number(),
4677
- chosenRate: z48.number(),
4678
- mentionRate: z48.number()
4783
+ deltaPP: z50.number().nullable()
4784
+ });
4785
+ var summaryVisibilityCardSchema = z50.object({
4786
+ name: z50.string(),
4787
+ owned: z50.object({
4788
+ name: z50.string(),
4789
+ rank: z50.number(),
4790
+ chosenRate: z50.number(),
4791
+ mentionRate: z50.number()
4679
4792
  }).nullable(),
4680
- chosenDeltaPP: z48.number().nullable()
4793
+ chosenDeltaPP: z50.number().nullable()
4681
4794
  });
4682
- var homeSummarySchema = z48.object({
4683
- hasAnyRuns: z48.boolean(),
4684
- lastSynthesisAt: z48.string().nullable(),
4685
- actions: cardResultSchema(z48.array(summaryActionSchema)),
4795
+ var homeSummarySchema = z50.object({
4796
+ hasAnyRuns: z50.boolean(),
4797
+ lastSynthesisAt: z50.string().nullable(),
4798
+ actions: cardResultSchema(z50.array(summaryActionSchema)),
4686
4799
  visibility: cardResultSchema(
4687
- z48.object({
4688
- cards: z48.array(summaryVisibilityCardSchema),
4689
- marketsTotal: z48.number().int(),
4690
- promptCount: z48.number().int()
4800
+ z50.object({
4801
+ cards: z50.array(summaryVisibilityCardSchema),
4802
+ marketsTotal: z50.number().int(),
4803
+ promptCount: z50.number().int()
4691
4804
  })
4692
4805
  ),
4693
4806
  agentExperience: cardResultSchema(
4694
- z48.object({
4695
- cards: z48.array(summaryAeCardSchema),
4696
- total: z48.number().int(),
4697
- setCount: z48.number().int()
4807
+ z50.object({
4808
+ cards: z50.array(summaryAeCardSchema),
4809
+ total: z50.number().int(),
4810
+ setCount: z50.number().int()
4698
4811
  })
4699
4812
  ),
4700
- notableSessions: cardResultSchema(z48.array(z48.unknown()))
4813
+ notableSessions: cardResultSchema(z50.array(z50.unknown()))
4701
4814
  });
4702
4815
 
4703
4816
  // ../packages/api-schemas/src/tokens.ts
4704
- import { z as z49 } from "zod";
4705
- var apiTokenSchema = z49.object({
4706
- id: z49.string(),
4707
- name: z49.string(),
4817
+ import { z as z51 } from "zod";
4818
+ var apiTokenSchema = z51.object({
4819
+ id: z51.string(),
4820
+ name: z51.string(),
4708
4821
  /** Last 4 chars of the plaintext, for recognizability (non-secret). */
4709
- last4: z49.string(),
4710
- expiresAt: z49.iso.datetime().nullable(),
4711
- lastUsedAt: z49.iso.datetime().nullable(),
4712
- createdAt: z49.iso.datetime(),
4713
- revokedAt: z49.iso.datetime().nullable()
4714
- });
4715
- var createTokenRequestSchema = z49.object({
4716
- name: z49.string().min(1).max(100),
4822
+ last4: z51.string(),
4823
+ expiresAt: z51.iso.datetime().nullable(),
4824
+ lastUsedAt: z51.iso.datetime().nullable(),
4825
+ createdAt: z51.iso.datetime(),
4826
+ revokedAt: z51.iso.datetime().nullable()
4827
+ });
4828
+ var createTokenRequestSchema = z51.object({
4829
+ name: z51.string().min(1).max(100),
4717
4830
  /** ISO-8601 datetime; omit for no expiry. */
4718
- expiresAt: z49.iso.datetime({ offset: true }).optional()
4831
+ expiresAt: z51.iso.datetime({ offset: true }).optional()
4719
4832
  });
4720
4833
  var createTokenResponseSchema = apiTokenSchema.extend({
4721
- token: z49.string()
4834
+ token: z51.string()
4722
4835
  });
4723
4836
  var listTokensResponseSchema = listResponseSchema(apiTokenSchema);
4724
4837
 
4725
4838
  // ../packages/api-schemas/src/visibility.ts
4726
- import { z as z50 } from "zod";
4839
+ import { z as z52 } from "zod";
4727
4840
  var VISIBILITY_PROMPT_KINDS = ["HEAD_TO_HEAD", "RECOMMEND"];
4728
- var visibilityPromptKindSchema = z50.enum(VISIBILITY_PROMPT_KINDS);
4841
+ var visibilityPromptKindSchema = z52.enum(VISIBILITY_PROMPT_KINDS);
4729
4842
  var visibilityPromptSchema = visibilityPromptSettingsSchema.extend({
4730
- id: z50.string(),
4731
- name: z50.string(),
4843
+ id: z52.string(),
4844
+ name: z52.string(),
4732
4845
  kind: visibilityPromptKindSchema,
4733
- promptText: z50.string(),
4846
+ promptText: z52.string(),
4734
4847
  /** HEAD_TO_HEAD is always branded; RECOMMEND may be either. */
4735
- branded: z50.boolean(),
4736
- brandA: z50.string().nullable(),
4737
- brandB: z50.string().nullable(),
4738
- market: z50.object({ id: z50.string(), slug: z50.string(), name: z50.string() }).nullable(),
4739
- position: z50.number().int(),
4740
- createdAt: z50.string(),
4848
+ branded: z52.boolean(),
4849
+ brandA: z52.string().nullable(),
4850
+ brandB: z52.string().nullable(),
4851
+ market: z52.object({ id: z52.string(), slug: z52.string(), name: z52.string() }).nullable(),
4852
+ position: z52.number().int(),
4853
+ createdAt: z52.string(),
4741
4854
  /** User tag names on the hidden backing prompt (Surface:* excluded). */
4742
- tags: z50.array(z50.string()),
4743
- runCount: z50.number().int(),
4744
- lastRunAt: z50.string().nullable(),
4745
- scenarios: z50.array(visibilityScenarioSchema)
4855
+ tags: z52.array(z52.string()),
4856
+ runCount: z52.number().int(),
4857
+ lastRunAt: z52.string().nullable(),
4858
+ scenarios: z52.array(visibilityScenarioSchema)
4746
4859
  });
4747
- var listVisibilityPromptsResponseSchema = z50.object({
4748
- items: z50.array(visibilityPromptSchema)
4860
+ var listVisibilityPromptsResponseSchema = z52.object({
4861
+ items: z52.array(visibilityPromptSchema)
4749
4862
  });
4750
- var createVisibilityPromptBodySchema = z50.object({
4751
- name: z50.string().min(1),
4752
- promptText: z50.string().min(1),
4863
+ var createVisibilityPromptBodySchema = z52.object({
4864
+ name: z52.string().min(1),
4865
+ promptText: z52.string().min(1),
4753
4866
  kind: visibilityPromptKindSchema,
4754
- branded: z50.boolean().optional(),
4867
+ branded: z52.boolean().optional(),
4755
4868
  /** Required pair for HEAD_TO_HEAD (order-independent). */
4756
- brandA: z50.string().nullish(),
4757
- brandB: z50.string().nullish(),
4869
+ brandA: z52.string().nullish(),
4870
+ brandB: z52.string().nullish(),
4758
4871
  /** Measured market id from the org's tracked set. */
4759
- marketId: z50.string().nullish(),
4760
- tags: z50.array(z50.string()).optional(),
4872
+ marketId: z52.string().nullish(),
4873
+ tags: z52.array(z52.string()).optional(),
4761
4874
  agents: visibilityPromptSettingsInputShape.agents.optional(),
4762
4875
  skillRefs: visibilityPromptSettingsInputShape.skillRefs,
4763
4876
  mcpRefs: visibilityPromptSettingsInputShape.mcpRefs,
4764
4877
  connectionIds: visibilityPromptSettingsInputShape.connectionIds,
4765
4878
  cadence: visibilityPromptSettingsInputShape.cadence,
4766
4879
  sampleCount: visibilityPromptSettingsInputShape.sampleCount,
4767
- scenarios: z50.array(visibilityScenarioInputSchema).optional().default([])
4880
+ scenarios: z52.array(visibilityScenarioInputSchema).optional().default([])
4768
4881
  }).strict();
4769
- var synthesizeResponseSchema = z50.object({
4770
- /** False when the pre-check found no new evidence and nothing was queued. */
4771
- queued: z50.boolean()
4772
- });
4773
- var updateVisibilityPromptBodySchema = z50.object({
4774
- name: z50.string().min(1).optional(),
4775
- promptText: z50.string().min(1).optional(),
4776
- branded: z50.boolean().optional(),
4777
- brandA: z50.string().nullish(),
4778
- brandB: z50.string().nullish(),
4779
- marketId: z50.string().nullish(),
4780
- tags: z50.array(z50.string()).optional(),
4882
+ var updateVisibilityPromptBodySchema = z52.object({
4883
+ name: z52.string().min(1).optional(),
4884
+ promptText: z52.string().min(1).optional(),
4885
+ branded: z52.boolean().optional(),
4886
+ brandA: z52.string().nullish(),
4887
+ brandB: z52.string().nullish(),
4888
+ marketId: z52.string().nullish(),
4889
+ tags: z52.array(z52.string()).optional(),
4781
4890
  ...visibilityPromptSettingsPatchShape,
4782
4891
  /** Replaces the whole scenario set when present. */
4783
- scenarios: z50.array(visibilityScenarioInputSchema).optional()
4892
+ scenarios: z52.array(visibilityScenarioInputSchema).optional()
4784
4893
  }).strict();
4785
- var runVisibilityPromptResponseSchema = z50.object({
4786
- batchIds: z50.array(z50.string()),
4787
- runIds: z50.array(z50.string())
4894
+ var runVisibilityPromptResponseSchema = z52.object({
4895
+ batchIds: z52.array(z52.string()),
4896
+ runIds: z52.array(z52.string())
4788
4897
  });
4789
- var visibilityPromptRunSchema = z50.object({
4790
- id: z50.string(),
4791
- status: z50.string(),
4898
+ var visibilityPromptRunSchema = z52.object({
4899
+ id: z52.string(),
4900
+ status: z52.string(),
4792
4901
  agent: agentSchema,
4793
- model: z50.string().nullable(),
4794
- resolvedModel: z50.string().nullable(),
4795
- createdAt: z50.string(),
4796
- startedAt: z50.string().nullable(),
4797
- finishedAt: z50.string().nullable(),
4798
- failureReason: z50.string().nullable(),
4902
+ model: z52.string().nullable(),
4903
+ resolvedModel: z52.string().nullable(),
4904
+ createdAt: z52.string(),
4905
+ startedAt: z52.string().nullable(),
4906
+ finishedAt: z52.string().nullable(),
4907
+ failureReason: z52.string().nullable(),
4799
4908
  creditsCharged: runCreditsChargedSchema.optional(),
4800
4909
  triggeredBy: runTriggeredBySchema.optional(),
4801
- verdict: z50.object({
4802
- status: z50.string(),
4803
- error: z50.string().nullable(),
4804
- payload: z50.unknown().nullable()
4910
+ verdict: z52.object({
4911
+ status: z52.string(),
4912
+ error: z52.string().nullable(),
4913
+ payload: z52.unknown().nullable()
4805
4914
  }).nullable()
4806
4915
  });
4807
4916
  var listVisibilityPromptRunsResponseSchema = listResponseSchema(
4808
4917
  visibilityPromptRunSchema
4809
4918
  );
4810
- var orgMarketSchema = z50.object({
4811
- marketId: z50.string(),
4812
- slug: z50.string(),
4813
- name: z50.string(),
4919
+ var orgMarketSchema = z52.object({
4920
+ marketId: z52.string(),
4921
+ slug: z52.string(),
4922
+ name: z52.string(),
4814
4923
  /** The one line saying what the market measures. */
4815
- capability: z50.string(),
4924
+ capability: z52.string(),
4816
4925
  /** SUGGESTED (the matcher) | USER (a human picked it). */
4817
- source: z50.string()
4926
+ source: z52.string()
4818
4927
  });
4819
4928
  var addableMarketSchema = orgMarketSchema.omit({ source: true });
4820
- var listMarketsResponseSchema = z50.object({
4821
- tracked: z50.array(orgMarketSchema),
4929
+ var listMarketsResponseSchema = z52.object({
4930
+ tracked: z52.array(orgMarketSchema),
4822
4931
  /** Published markets the org does not track yet (closed set — no free-text
4823
4932
  * market creation). */
4824
- addable: z50.array(addableMarketSchema)
4933
+ addable: z52.array(addableMarketSchema)
4825
4934
  });
4826
- var addMarketBodySchema = z50.object({ marketId: z50.string().min(1) });
4935
+ var addMarketBodySchema = z52.object({ marketId: z52.string().min(1) });
4827
4936
 
4828
4937
  // src/version.ts
4829
4938
  import { createRequire } from "module";
@@ -5208,7 +5317,7 @@ __export(apply_exports, {
5208
5317
  register: () => register2
5209
5318
  });
5210
5319
  import { readFileSync as readFileSync3 } from "fs";
5211
- import { z as z51 } from "zod";
5320
+ import { z as z53 } from "zod";
5212
5321
  function assertRequiredExperiment(spec, required) {
5213
5322
  if (required.length === 0) {
5214
5323
  throw new CliError(
@@ -5360,7 +5469,7 @@ function register2(program2) {
5360
5469
  ).option("--schema", "print the battery spec JSON Schema and exit").option("--example", "print a minimal example battery spec and exit").action(
5361
5470
  async (opts, command) => {
5362
5471
  if (opts.schema) {
5363
- printJson(z51.toJSONSchema(batteries_exports.batterySpecSchema));
5472
+ printJson(z53.toJSONSchema(batteries_exports.batterySpecSchema));
5364
5473
  return;
5365
5474
  }
5366
5475
  if (opts.example) {
@@ -8061,7 +8170,7 @@ function register12(program2) {
8061
8170
  credits: r.creditsCharged ?? "",
8062
8171
  created: r.createdAt,
8063
8172
  judge: r.judge?.status ?? "-",
8064
- verdicts: r.criterionResults.length === 0 ? "-" : `${r.criterionResults.filter((c) => c.passed).length}/${r.criterionResults.length} passed`
8173
+ verdicts: r.criterionResults.length === 0 ? "-" : `${r.criterionResults.filter((c) => c.passed).length} passed, ${r.criterionResults.filter((c) => c.passed === false).length} failed, ${r.criterionResults.filter((c) => c.passed === null).length} not assessed`
8065
8174
  })),
8066
8175
  "table"
8067
8176
  );
@@ -8097,10 +8206,40 @@ function register12(program2) {
8097
8206
  );
8098
8207
  }
8099
8208
 
8209
+ // src/commands/feedback.ts
8210
+ var feedback_exports2 = {};
8211
+ __export(feedback_exports2, {
8212
+ register: () => register13
8213
+ });
8214
+ import { Option as Option3 } from "commander";
8215
+ function register13(program2) {
8216
+ program2.command("feedback").description(
8217
+ "Send feedback about this CLI to the Gauge team: friction you hit, missing commands or flags, bugs"
8218
+ ).requiredOption("-m, --message <text>", "what happened").addOption(
8219
+ new Option3("--kind <kind>", "feedback type").choices([...feedback_exports.FEEDBACK_KINDS]).default("other")
8220
+ ).option("--command <command>", "the gauge command the feedback is about").action(
8221
+ async (opts, cmd) => {
8222
+ const { org } = cmd.optsWithGlobals();
8223
+ const body2 = {
8224
+ message: opts.message,
8225
+ kind: opts.kind,
8226
+ command: opts.command,
8227
+ org: org ?? readConfig().defaultOrg
8228
+ };
8229
+ const res = await createClient().post(
8230
+ "/api/v1/feedback",
8231
+ body2
8232
+ );
8233
+ if (resolveOutput(cmd) === "json") printJson(res);
8234
+ else console.log(`Feedback sent (${res.id}). Thank you.`);
8235
+ }
8236
+ );
8237
+ }
8238
+
8100
8239
  // src/commands/instructions.ts
8101
8240
  var instructions_exports = {};
8102
8241
  __export(instructions_exports, {
8103
- register: () => register13
8242
+ register: () => register14
8104
8243
  });
8105
8244
  import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
8106
8245
  import { join as join5 } from "path";
@@ -8248,6 +8387,8 @@ improvements. \`gauge models list\` shows the available agent/model targets.
8248
8387
  - Report measured results with sample counts and evidence, including limits.
8249
8388
  - Run \`gauge update\` to install the latest published CLI.
8250
8389
  - Exit codes: 0 ok, 1 error, 2 usage, 3 billing-blocked, 4 needs your input.
8390
+ - When the CLI gets in your way (friction, a missing command or flag, a bug),
8391
+ report it: \`gauge feedback -m "<what happened>" --kind friction|missing|bug\`.
8251
8392
 
8252
8393
  ## Module guidance
8253
8394
 
@@ -8370,7 +8511,7 @@ function resolveTopic(topic) {
8370
8511
 
8371
8512
  // src/commands/instructions.ts
8372
8513
  var INSTALL_ROOT = ".claude/skills";
8373
- function register13(program2) {
8514
+ function register14(program2) {
8374
8515
  program2.command("instructions [topic]").description(
8375
8516
  `Instructions for a coding agent using this CLI. Run before your first gauge command; a topic loads the full module guidance: ${TOPIC_NAMES.join(", ")}`
8376
8517
  ).option("--list", "print the topic names only").option(
@@ -8403,7 +8544,7 @@ function register13(program2) {
8403
8544
  // src/commands/keys.ts
8404
8545
  var keys_exports2 = {};
8405
8546
  __export(keys_exports2, {
8406
- register: () => register14
8547
+ register: () => register15
8407
8548
  });
8408
8549
  function keysPath(org) {
8409
8550
  return `/api/v1/orgs/${encodeURIComponent(org)}/provider-keys`;
@@ -8446,7 +8587,7 @@ async function readKeyInput(opts) {
8446
8587
  }
8447
8588
  return key2;
8448
8589
  }
8449
- function register14(program2) {
8590
+ function register15(program2) {
8450
8591
  const group = program2.command("keys").description("Manage BYOK provider keys (write-only; reads show last4)");
8451
8592
  group.command("set <provider>").description(
8452
8593
  "Set a provider key (anthropic|openai); reads it from stdin or GAUGE_PROVIDER_KEY"
@@ -8502,7 +8643,7 @@ function register14(program2) {
8502
8643
  // src/commands/mcp.ts
8503
8644
  var mcp_exports2 = {};
8504
8645
  __export(mcp_exports2, {
8505
- register: () => register15
8646
+ register: () => register16
8506
8647
  });
8507
8648
  import { readFileSync as readFileSync8 } from "fs";
8508
8649
  function mcpPath(org) {
@@ -8549,7 +8690,7 @@ function specFromOpts(opts) {
8549
8690
  ...tools.length ? { tools } : {}
8550
8691
  };
8551
8692
  }
8552
- function register15(program2) {
8693
+ function register16(program2) {
8553
8694
  const group = program2.command("mcp").description("Manage MCP servers used by eval and visibility runs");
8554
8695
  group.command("list").description("List the org's MCP servers with their newest version").action(async (_opts, cmd) => {
8555
8696
  const org = resolveOrg(cmd);
@@ -8680,9 +8821,9 @@ function register15(program2) {
8680
8821
  // src/commands/members.ts
8681
8822
  var members_exports = {};
8682
8823
  __export(members_exports, {
8683
- register: () => register16
8824
+ register: () => register17
8684
8825
  });
8685
- function register16(program2) {
8826
+ function register17(program2) {
8686
8827
  const group = program2.command("members").description("Team members and pending invites (read-only)");
8687
8828
  group.command("list").description("List members and pending invites").action(async (_opts, cmd) => {
8688
8829
  const org = resolveOrg(cmd);
@@ -8724,7 +8865,7 @@ var models_exports = {};
8724
8865
  __export(models_exports, {
8725
8866
  capabilityLabel: () => capabilityLabel,
8726
8867
  executionTargetsPath: () => executionTargetsPath,
8727
- register: () => register17
8868
+ register: () => register18
8728
8869
  });
8729
8870
  function executionTargetsPath(org) {
8730
8871
  return `/api/v1/orgs/${encodeURIComponent(org)}/execution-targets`;
@@ -8732,7 +8873,7 @@ function executionTargetsPath(org) {
8732
8873
  function capabilityLabel(capabilities2) {
8733
8874
  return Object.entries(capabilities2).filter(([, supported]) => supported).map(([name]) => name === "agentContext" ? "context" : name).join(", ");
8734
8875
  }
8735
- function register17(program2) {
8876
+ function register18(program2) {
8736
8877
  const group = program2.command("models").description("Discover supported models, harnesses, and providers");
8737
8878
  group.command("list", { isDefault: true }).description("List execution targets available to the organization").action(async (_opts, cmd) => {
8738
8879
  const org = resolveOrg(cmd);
@@ -8759,7 +8900,7 @@ function register17(program2) {
8759
8900
  // src/commands/onboard.ts
8760
8901
  var onboard_exports = {};
8761
8902
  __export(onboard_exports, {
8762
- register: () => register18
8903
+ register: () => register19
8763
8904
  });
8764
8905
  function orgNameFromEmail(email) {
8765
8906
  const domain = email?.split("@")[1] ?? "";
@@ -8767,7 +8908,7 @@ function orgNameFromEmail(email) {
8767
8908
  if (!base) return "My Workspace";
8768
8909
  return base.charAt(0).toUpperCase() + base.slice(1);
8769
8910
  }
8770
- function register18(program2) {
8911
+ function register19(program2) {
8771
8912
  program2.command("onboard").description(
8772
8913
  "Self-serve onboarding: sign in (device flow) and create your first workspace"
8773
8914
  ).option("--email <email>", "email a sign-in link (device-flow convenience)").option("--org-name <name>", "workspace name (default: from your email)").option("--website <url>", "company site (scanned to seed the workspace)").option("--new", "create a new workspace even if you already belong to one").option(
@@ -8871,7 +9012,7 @@ __export(optimizations_exports2, {
8871
9012
  parseSubject: () => parseSubject,
8872
9013
  parseTarget: () => parseTarget,
8873
9014
  readSkillDir: () => readSkillDir,
8874
- register: () => register19,
9015
+ register: () => register20,
8875
9016
  trialBodyFromOpts: () => trialBodyFromOpts,
8876
9017
  trialTemplate: () => trialTemplate,
8877
9018
  trialWarnings: () => trialWarnings,
@@ -8994,14 +9135,6 @@ function listFiles(dir) {
8994
9135
  function trialBodyFromOpts(opts, read2 = readText, walk) {
8995
9136
  const launch = opts.launch === true;
8996
9137
  const idempotencyKey = opts.idempotencyKey;
8997
- const fork = opts.forkRun || opts.forkBoundary ? (() => {
8998
- if (!opts.forkRun || !opts.forkBoundary)
8999
- throw new CliError(
9000
- "usage",
9001
- "--fork-run and --fork-boundary go together"
9002
- );
9003
- return { runId: opts.forkRun, boundarySeq: opts.forkBoundary };
9004
- })() : void 0;
9005
9138
  if (opts.file) {
9006
9139
  let parsed;
9007
9140
  try {
@@ -9032,7 +9165,6 @@ function trialBodyFromOpts(opts, read2 = readText, walk) {
9032
9165
  const body2 = "trial" in record2 ? record2 : { trial: record2 };
9033
9166
  return {
9034
9167
  ...body2,
9035
- ...fork ? { fork } : {},
9036
9168
  ...idempotencyKey ? { idempotencyKey } : {},
9037
9169
  launch
9038
9170
  };
@@ -9076,7 +9208,6 @@ function trialBodyFromOpts(opts, read2 = readText, walk) {
9076
9208
  return {
9077
9209
  trial,
9078
9210
  ...files ? { files } : {},
9079
- ...fork ? { fork } : {},
9080
9211
  ...idempotencyKey ? { idempotencyKey } : {},
9081
9212
  launch
9082
9213
  };
@@ -9234,7 +9365,7 @@ function printTrial(t) {
9234
9365
  if (t.runs.length) {
9235
9366
  console.log("sessions:");
9236
9367
  for (const run of t.runs) {
9237
- const verdict = run.passed === null ? "unjudged" : run.passed ? "pass" : "fail";
9368
+ const verdict = run.passed === null ? "not assessed" : run.passed ? "pass" : "fail";
9238
9369
  console.log(` ${run.id}: ${run.status} \xB7 ${verdict}`);
9239
9370
  if (FAILED_RUN.has(run.status))
9240
9371
  console.log(
@@ -9243,7 +9374,9 @@ function printTrial(t) {
9243
9374
  else if (run.cliCoverage?.instrumentationFailed)
9244
9375
  console.log(" warning: command evidence is incomplete");
9245
9376
  for (const criterion of run.criteria)
9246
- console.log(` ${criterion.passed ? "\u2713" : "\u2717"} ${criterion.name}`);
9377
+ console.log(
9378
+ ` ${criterion.passed === null ? "?" : criterion.passed ? "\u2713" : "\u2717"} ${criterion.name}`
9379
+ );
9247
9380
  }
9248
9381
  }
9249
9382
  for (const line of trialWarnings(t)) console.error(line);
@@ -9293,7 +9426,7 @@ function addTargetOption(command) {
9293
9426
  "the one harness/model every session runs on, e.g. claude-code:claude-opus-4-8"
9294
9427
  );
9295
9428
  }
9296
- function register19(program2) {
9429
+ function register20(program2) {
9297
9430
  const group = program2.command("optimizations").alias("optimize").description(
9298
9431
  "Start, steer, and read optimizations: Gauge changes one owned surface per trial and reports the best measured change against the baseline"
9299
9432
  );
@@ -9689,10 +9822,7 @@ function register19(program2) {
9689
9822
  ).option(
9690
9823
  "--skill-dir <path>",
9691
9824
  "local directory holding the complete edited bundle, SKILL.md included"
9692
- ).option("--page <url>", "docs page to rewrite (with --body-file)").option("--body-file <path>", "the rewritten page body; '-' for stdin").option("--fork-run <runId>", "fork-at-fetch source run for a docs rewrite").option(
9693
- "--fork-boundary <seq>",
9694
- "fork-at-fetch boundary from `gauge runs fork-boundaries`"
9695
- ).option(
9825
+ ).option("--page <url>", "docs page to rewrite (with --body-file)").option("--body-file <path>", "the rewritten page body; '-' for stdin").option(
9696
9826
  "--launch",
9697
9827
  "run the trial after saving (spends credits); otherwise save a draft"
9698
9828
  ).option(
@@ -9841,7 +9971,7 @@ function register19(program2) {
9841
9971
  // src/commands/org.ts
9842
9972
  var org_exports = {};
9843
9973
  __export(org_exports, {
9844
- register: () => register20
9974
+ register: () => register21
9845
9975
  });
9846
9976
  function printSettings(s, billingStatus) {
9847
9977
  console.log(`slug: ${s.slug}`);
@@ -9853,7 +9983,7 @@ function printSettings(s, billingStatus) {
9853
9983
  console.log(`overage: ${fmtOverage(billingStatus)}`);
9854
9984
  console.log(`auto-join: ${s.autoJoinDomain ?? "off"}`);
9855
9985
  }
9856
- function register20(program2) {
9986
+ function register21(program2) {
9857
9987
  const group = program2.command("org").description(
9858
9988
  "This org's settings, read-only (see `gauge orgs` for the org list)"
9859
9989
  );
@@ -9878,12 +10008,12 @@ function register20(program2) {
9878
10008
  // src/commands/orgs.ts
9879
10009
  var orgs_exports2 = {};
9880
10010
  __export(orgs_exports2, {
9881
- register: () => register21
10011
+ register: () => register22
9882
10012
  });
9883
10013
  function isDefault(org, defaultOrg) {
9884
10014
  return defaultOrg !== void 0 && (org.slug === defaultOrg || org.publicId === defaultOrg);
9885
10015
  }
9886
- function register21(program2) {
10016
+ function register22(program2) {
9887
10017
  const orgs = program2.command("orgs").description("Organizations");
9888
10018
  orgs.command("list").description("List orgs you belong to").action(async (_opts, command) => {
9889
10019
  const output = resolveOutput(command);
@@ -9954,12 +10084,12 @@ function register21(program2) {
9954
10084
  // src/commands/personas.ts
9955
10085
  var personas_exports2 = {};
9956
10086
  __export(personas_exports2, {
9957
- register: () => register22
10087
+ register: () => register23
9958
10088
  });
9959
10089
  function personasPath(org) {
9960
10090
  return `/api/v1/orgs/${encodeURIComponent(org)}/personas`;
9961
10091
  }
9962
- function register22(program2) {
10092
+ function register23(program2) {
9963
10093
  const group = program2.command("personas").description("Manage simulated-user personas for eval and visibility runs");
9964
10094
  group.command("list").description("List the org's personas").action(async (_opts, cmd) => {
9965
10095
  const org = resolveOrg(cmd);
@@ -10032,7 +10162,7 @@ function register22(program2) {
10032
10162
  // src/commands/query.ts
10033
10163
  var query_exports2 = {};
10034
10164
  __export(query_exports2, {
10035
- register: () => register23
10165
+ register: () => register24
10036
10166
  });
10037
10167
  var collect3 = (value, prev = []) => [
10038
10168
  ...prev,
@@ -10224,7 +10354,7 @@ async function showMetadata(command, mode, dataset) {
10224
10354
  console.error(`dataset: ${ds.name} \u2014 ${ds.grain}`);
10225
10355
  printItems(rows, "table");
10226
10356
  }
10227
- function register23(program2) {
10357
+ function register24(program2) {
10228
10358
  const group = program2.command("query").description(
10229
10359
  "Flexible reports over your event warehouse (run a report, or discover the catalog)"
10230
10360
  );
@@ -10260,7 +10390,7 @@ function register23(program2) {
10260
10390
  // src/commands/repos.ts
10261
10391
  var repos_exports2 = {};
10262
10392
  __export(repos_exports2, {
10263
- register: () => register24
10393
+ register: () => register25
10264
10394
  });
10265
10395
  function reposPath(org) {
10266
10396
  return `/api/v1/orgs/${encodeURIComponent(org)}/repos`;
@@ -10283,7 +10413,7 @@ function toRow4(repo) {
10283
10413
  function syncWarning(repo) {
10284
10414
  return `warning: GitHub metadata sync failed; retry with \`gauge repos resync ${repo.url}\``;
10285
10415
  }
10286
- function register24(program2) {
10416
+ function register25(program2) {
10287
10417
  const repos = program2.command("repos").description("Manage repositories");
10288
10418
  repos.command("list").description("List repositories (yours + read-only Gauge-provided ones)").action(async (_opts, command) => {
10289
10419
  const org = resolveOrg(command);
@@ -10380,10 +10510,10 @@ function register24(program2) {
10380
10510
  // src/commands/runRequests.ts
10381
10511
  var runRequests_exports2 = {};
10382
10512
  __export(runRequests_exports2, {
10383
- register: () => register25
10513
+ register: () => register26
10384
10514
  });
10385
10515
  var pollIntervalMs = 5e3;
10386
- function register25(program2) {
10516
+ function register26(program2) {
10387
10517
  program2.command("run-requests").description("Read a durable launch and its aggregate verdict").command("wait <id>").description("Wait for all sessions and judging in a launch request").action(async (id2, _opts, cmd) => {
10388
10518
  const org = resolveOrg(cmd);
10389
10519
  const path3 = `/api/v1/orgs/${encodeURIComponent(org)}/run-requests/${encodeURIComponent(id2)}`;
@@ -10425,7 +10555,7 @@ function register25(program2) {
10425
10555
  // src/commands/runs.ts
10426
10556
  var runs_exports2 = {};
10427
10557
  __export(runs_exports2, {
10428
- register: () => register26
10558
+ register: () => register27
10429
10559
  });
10430
10560
  function runPath(id2) {
10431
10561
  return `/api/v1/runs/${encodeURIComponent(id2)}`;
@@ -10521,48 +10651,45 @@ function passLine(label, pass) {
10521
10651
  if (pass.error) bits.push(`error: ${compact(pass.error, 60)}`);
10522
10652
  return `${label.padEnd(20)} ${bits.join(" ")}`;
10523
10653
  }
10524
- function decisionVia(detail) {
10525
- const d = detail;
10526
- if (typeof d?.source === "string") return d.source;
10527
- const raw = d?.influences;
10528
- if (!Array.isArray(raw)) return "";
10529
- const types = [];
10530
- for (const inf of raw) {
10531
- const type = inf?.type;
10532
- if (typeof type === "string" && !types.includes(type)) types.push(type);
10533
- }
10534
- return types.join(", ");
10535
- }
10536
10654
  var PASS_LABELS = {
10537
- INSTALL: "Install pass",
10538
- DECISION: "Decision pass",
10539
- EVAL: "Criteria pass",
10655
+ ANALYSIS: "Session analysis",
10656
+ CLI_DISCOVERY: "CLI discovery",
10657
+ LEVER: "Improvement levers",
10540
10658
  EXPERIMENT_DELTA: "Experiment delta"
10541
10659
  };
10660
+ var INSTALLED = {
10661
+ NONE: "",
10662
+ ATTEMPTED: "attempted",
10663
+ CONFIGURED: "configured",
10664
+ EXERCISED: "exercised"
10665
+ };
10666
+ var check2 = (value) => value ? "yes" : "";
10542
10667
  function printInsight(insight) {
10543
- if (insight.passes.length > 0) {
10544
- for (const pass of insight.passes) {
10545
- console.log(passLine(PASS_LABELS[pass.kind] ?? pass.kind, pass));
10546
- }
10547
- } else {
10548
- console.log(passLine("Decision pass", insight.decision));
10668
+ for (const pass of insight.passes) {
10669
+ console.log(passLine(PASS_LABELS[pass.kind] ?? pass.kind, pass));
10670
+ }
10671
+ const analysis = insight.analysis;
10672
+ if (!analysis) {
10673
+ console.log(insight.decision.status === "SKIPPED" ? "\n(skipped)" : "\n(no analysis yet)");
10674
+ return;
10549
10675
  }
10676
+ if (analysis.limitation) console.log(`
10677
+ ${compact(analysis.limitation, 200)}`);
10550
10678
  console.log(`
10551
- Decisions (${insight.decisions.length})`);
10552
- if (insight.decisions.length === 0) {
10553
- console.log(insight.decision.status === "SKIPPED" ? "(skipped)" : "(none)");
10554
- } else {
10679
+ Products (${analysis.products.length})`);
10680
+ if (analysis.products.length > 0)
10555
10681
  printItems(
10556
- insight.decisions.map((d) => ({
10557
- "#": d.index,
10558
- arena: d.category === "other" && d.categoryRaw ? d.categoryRaw : d.category,
10559
- chosen: d.chosenPackage ?? d.chosenName,
10560
- reversed: d.reversed ? "yes" : "",
10561
- via: decisionVia(d.detail)
10682
+ analysis.products.map((p) => ({
10683
+ product: p.name,
10684
+ considered: check2(p.considered),
10685
+ chosen: check2(p.chosen),
10686
+ rejected: check2(p.rejected),
10687
+ installed: INSTALLED[p.installPhase] ?? p.installPhase,
10688
+ rank: p.rank ?? "",
10689
+ source: p.source.toLowerCase()
10562
10690
  })),
10563
10691
  "table"
10564
10692
  );
10565
- }
10566
10693
  const delta3 = insight.experimentDelta;
10567
10694
  if (delta3 && typeof delta3 === "object") {
10568
10695
  console.log("\nExperiment delta");
@@ -10574,9 +10701,7 @@ Decisions (${insight.decisions.length})`);
10574
10701
  );
10575
10702
  if (delta3.summary) console.log(compact(delta3.summary, 300));
10576
10703
  }
10577
- if (insight.decisions.length > 0) {
10578
- console.error("\n(full detail: rerun with -o json)");
10579
- }
10704
+ console.error("\n(full detail: rerun with -o json)");
10580
10705
  }
10581
10706
  function parseEvent(data) {
10582
10707
  try {
@@ -10693,7 +10818,7 @@ async function streamRun(id2, json, opts) {
10693
10818
  if (drainTimer) clearTimeout(drainTimer);
10694
10819
  }
10695
10820
  }
10696
- function register26(program2) {
10821
+ function register27(program2) {
10697
10822
  const runs = program2.command("runs").description("Inspect and manage runs");
10698
10823
  runs.command("list").description("List runs (newest first)").option("--status <status>", "filter by status, e.g. running,queued").option("--batch <id>", "filter by batch").option("--prompt <id>", "filter by prompt").option("--experiment <experiment>", "filter by experiment label").option("--eval-set <id>", "filter by eval set").option("--since <window>", "e.g. 24h, 7d, or an ISO date").option("--limit <n>", "page size (1-200)", "50").option("--cursor <cursor>", "resume from a previous page's nextCursor").action(
10699
10824
  async (opts, command) => {
@@ -10787,29 +10912,9 @@ function register26(program2) {
10787
10912
  }
10788
10913
  process.stdout.write(diff);
10789
10914
  });
10790
- runs.command("fork <id>").description("Fork a finished run from its latest conversation checkpoint").requiredOption("--prompt <text>", "continuation prompt for the child run").action(async (id2, opts, command) => {
10791
- const result = await createClient().post(
10792
- `${runPath(id2)}/fork`,
10793
- { prompt: opts.prompt }
10794
- );
10795
- if (resolveOutput(command) === "json") {
10796
- printJson(result);
10797
- return;
10798
- }
10799
- console.log(
10800
- `Forked run ${result.runId} from ${result.parentRunId} at turn ${result.turn}`
10801
- );
10802
- console.error(`Watch it with: gauge runs watch ${result.runId}`);
10803
- });
10804
- runs.command("fork-boundaries <id>").description(
10805
- "The run's forkable fetch boundaries + checkpoint availability"
10806
- ).action(async (id2) => {
10807
- const result = await createClient().get(
10808
- `${runPath(id2)}/fork-boundaries`
10809
- );
10810
- printJson(result);
10811
- });
10812
- runs.command("fork-plan <planId>").description("Inspect a fetch-fork plan (status, forked run ids)").action(async (planId) => {
10915
+ runs.command("fork-plan <planId>").description(
10916
+ "Inspect a historical fetch-fork plan (status, forked run ids)"
10917
+ ).action(async (planId) => {
10813
10918
  const result = await createClient().get(
10814
10919
  `/api/v1/fork-plans/${encodeURIComponent(planId)}`
10815
10920
  );
@@ -10834,7 +10939,7 @@ function register26(program2) {
10834
10939
  var skills_exports2 = {};
10835
10940
  __export(skills_exports2, {
10836
10941
  buildSkillEditBody: () => buildSkillEditBody,
10837
- register: () => register27
10942
+ register: () => register28
10838
10943
  });
10839
10944
  function skillsPath(org) {
10840
10945
  return `/api/v1/orgs/${encodeURIComponent(org)}/skills`;
@@ -10896,7 +11001,7 @@ async function buildSkillEditBody(opts, fetchCurrentSource) {
10896
11001
  throw new CliError("usage", "nothing to change");
10897
11002
  return body2;
10898
11003
  }
10899
- function register27(program2) {
11004
+ function register28(program2) {
10900
11005
  const group = program2.command("skills").description("Manage agent skills used by eval and visibility runs");
10901
11006
  group.command("list").description("List the org's skills with their newest version").action(async (_opts, cmd) => {
10902
11007
  const org = resolveOrg(cmd);
@@ -11037,7 +11142,7 @@ function register27(program2) {
11037
11142
  // src/commands/stats.ts
11038
11143
  var stats_exports2 = {};
11039
11144
  __export(stats_exports2, {
11040
- register: () => register28
11145
+ register: () => register29
11041
11146
  });
11042
11147
  function addFilterOptions(cmd) {
11043
11148
  return cmd.option("--prompt <id>", "filter to a single prompt").option("--tag <ids>", "comma-separated tag ids").option("--repo <urls>", "comma-separated base repo urls").option("--language <langs>", "comma-separated repo languages").option("--framework <names>", "comma-separated repo frameworks").option("--size <buckets>", "comma-separated codebase-size buckets").option("--branded", "only branded prompts").option("--unbranded", "only non-branded prompts").option("--limit <n>", "max rows (default 50)").option("--full", "return all rows (up to 1000)");
@@ -11120,7 +11225,7 @@ var domainRow = (r) => ({
11120
11225
  rate: pct3(r.rate),
11121
11226
  requests: r.requests
11122
11227
  });
11123
- function register28(program2) {
11228
+ function register29(program2) {
11124
11229
  const group = program2.command("stats").description("Read-only analytics over your runs");
11125
11230
  addFilterOptions(
11126
11231
  group.command("rankings").description("Brands ranked by install rate")
@@ -11152,7 +11257,7 @@ function register28(program2) {
11152
11257
  // src/commands/status.ts
11153
11258
  var status_exports = {};
11154
11259
  __export(status_exports, {
11155
- register: () => register29
11260
+ register: () => register30
11156
11261
  });
11157
11262
  function pct4(rate) {
11158
11263
  return rate == null ? "\u2014" : `${Math.round(rate * 100)}%`;
@@ -11162,7 +11267,7 @@ function delta2(pp) {
11162
11267
  const rounded = Math.round(pp);
11163
11268
  return rounded === 0 ? "" : ` (${rounded > 0 ? "+" : ""}${rounded}pp)`;
11164
11269
  }
11165
- function register29(program2) {
11270
+ function register30(program2) {
11166
11271
  program2.command("status").description("One-shot org summary: actions, visibility, agent experience").action(async (_opts, cmd) => {
11167
11272
  const org = resolveOrg(cmd);
11168
11273
  const s = await createClient().get(
@@ -11224,12 +11329,12 @@ function register29(program2) {
11224
11329
  // src/commands/tags.ts
11225
11330
  var tags_exports2 = {};
11226
11331
  __export(tags_exports2, {
11227
- register: () => register30
11332
+ register: () => register31
11228
11333
  });
11229
11334
  function tagsPath(org) {
11230
11335
  return `/api/v1/orgs/${encodeURIComponent(org)}/tags`;
11231
11336
  }
11232
- function register30(program2) {
11337
+ function register31(program2) {
11233
11338
  const group = program2.command("tags").description("Manage org tags");
11234
11339
  group.command("list").description("List tags").action(async (_opts, cmd) => {
11235
11340
  const org = resolveOrg(cmd);
@@ -11272,12 +11377,12 @@ function register30(program2) {
11272
11377
  // src/commands/update.ts
11273
11378
  var update_exports = {};
11274
11379
  __export(update_exports, {
11275
- register: () => register31
11380
+ register: () => register32
11276
11381
  });
11277
11382
  import {
11278
11383
  spawnSync
11279
11384
  } from "child_process";
11280
- function register31(program2, { run = spawnSync, platform = process.platform } = {}) {
11385
+ function register32(program2, { run = spawnSync, platform = process.platform } = {}) {
11281
11386
  program2.command("update").description(
11282
11387
  "Update the globally installed Gauge CLI to the latest version"
11283
11388
  ).action((_opts, command) => {
@@ -11314,9 +11419,9 @@ Retry with: npm install --global @withgauge/cli@latest`
11314
11419
  // src/commands/usage.ts
11315
11420
  var usage_exports = {};
11316
11421
  __export(usage_exports, {
11317
- register: () => register32
11422
+ register: () => register33
11318
11423
  });
11319
- function register32(program2) {
11424
+ function register33(program2) {
11320
11425
  program2.command("usage").description("List credit ledger entries").option("--since <window>", 'e.g. "30d", "24h", or an ISO date').option("--limit <n>", "page size (1-200)", parseLimit, 50).option("--cursor <cursor>", "resume from a previous page's nextCursor").action(
11321
11426
  async (opts, cmd) => {
11322
11427
  const org = resolveOrg(cmd);
@@ -11363,10 +11468,10 @@ function register32(program2) {
11363
11468
  // src/commands/visibility.ts
11364
11469
  var visibility_exports2 = {};
11365
11470
  __export(visibility_exports2, {
11366
- register: () => register33,
11471
+ register: () => register34,
11367
11472
  visibilityPath: () => visibilityPath
11368
11473
  });
11369
- import { Option as Option3 } from "commander";
11474
+ import { Option as Option4 } from "commander";
11370
11475
  function visibilityPath(org) {
11371
11476
  return `/api/v1/orgs/${encodeURIComponent(org)}/visibility-prompts`;
11372
11477
  }
@@ -11597,7 +11702,7 @@ function registerPreferenceGroup(group) {
11597
11702
  collect,
11598
11703
  []
11599
11704
  ).addOption(
11600
- new Option3(
11705
+ new Option4(
11601
11706
  "--bill-to-org",
11602
11707
  "bill this run to the org's credits instead (superusers)"
11603
11708
  ).hideHelp(!staffCommandsVisible())
@@ -11622,22 +11727,6 @@ function registerPreferenceGroup(group) {
11622
11727
  );
11623
11728
  }
11624
11729
  );
11625
- group.command("synthesize").description(
11626
- "Queue the Agent Preference insight synthesizer now (org-wide \u2014 reads the whole surface)"
11627
- ).action(async (_opts, cmd) => {
11628
- const org = resolveOrg(cmd);
11629
- const result = await createClient().post(
11630
- `${visibilityPath(org)}/synthesize`,
11631
- {}
11632
- );
11633
- if (resolveOutput(cmd) === "json") {
11634
- printJson(result);
11635
- return;
11636
- }
11637
- console.log(
11638
- result.queued ? "Synthesis queued \u2014 insights land on the Agent Preference page shortly" : "Nothing new since the last pass \u2014 no synthesis queued"
11639
- );
11640
- });
11641
11730
  group.command("runs <id>").description("The prompt's run log with Agent Preference verdicts").option("--limit <n>", "page size (1-500, default 100)").option("--cursor <cursor>", "resume from a previous page's nextCursor").action(
11642
11731
  async (id2, opts, cmd) => {
11643
11732
  const org = resolveOrg(cmd);
@@ -11730,7 +11819,7 @@ function registerPreferenceGroup(group) {
11730
11819
  );
11731
11820
  });
11732
11821
  }
11733
- function register33(program2) {
11822
+ function register34(program2) {
11734
11823
  const preference = program2.command("preference").description("Manage Agent Preference prompts and measured markets");
11735
11824
  registerPreferenceGroup(preference);
11736
11825
  const legacy = program2.command("visibility", { hidden: true });
@@ -11745,7 +11834,7 @@ program.name("gauge").description(
11745
11834
  "--org <org>",
11746
11835
  "organization slug or public id (default: `gauge config get defaultOrg`)"
11747
11836
  ).addOption(
11748
- new Option4("-o, --output <format>", "output format").choices([...OUTPUT_FORMATS]).default("table")
11837
+ new Option5("-o, --output <format>", "output format").choices([...OUTPUT_FORMATS]).default("table")
11749
11838
  );
11750
11839
  for (const group of [
11751
11840
  instructions_exports,
@@ -11778,7 +11867,8 @@ for (const group of [
11778
11867
  usage_exports,
11779
11868
  stats_exports2,
11780
11869
  query_exports2,
11781
- config_exports
11870
+ config_exports,
11871
+ feedback_exports2
11782
11872
  ]) {
11783
11873
  group.register(program);
11784
11874
  }