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