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