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