@withgauge/cli 0.12.1 → 0.13.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/README.md +0 -1
- package/dist/index.js +1102 -1800
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1934,295 +1934,20 @@ var executionTargetsResponseSchema = z21.object({
|
|
|
1934
1934
|
items: z21.array(executionTargetSchema)
|
|
1935
1935
|
});
|
|
1936
1936
|
|
|
1937
|
-
// ../packages/api-schemas/src/
|
|
1938
|
-
var experiments_exports = {};
|
|
1939
|
-
__export(experiments_exports, {
|
|
1940
|
-
EXPERIMENT_MODES: () => EXPERIMENT_MODES,
|
|
1941
|
-
EXPERIMENT_STATUSES: () => EXPERIMENT_STATUSES,
|
|
1942
|
-
SUPPORT_CLASSES: () => SUPPORT_CLASSES,
|
|
1943
|
-
TERMINAL_EXPERIMENT_STATUSES: () => TERMINAL_EXPERIMENT_STATUSES,
|
|
1944
|
-
addVariantBodySchema: () => addVariantBodySchema,
|
|
1945
|
-
cancelResponseSchema: () => cancelResponseSchema,
|
|
1946
|
-
createExperimentBodyFields: () => createExperimentBodyFields,
|
|
1947
|
-
createExperimentBodySchema: () => createExperimentBodySchema,
|
|
1948
|
-
createExperimentResponseSchema: () => createExperimentResponseSchema,
|
|
1949
|
-
eligibleExperimentRunSchema: () => eligibleExperimentRunSchema,
|
|
1950
|
-
experimentBoundarySchema: () => experimentBoundarySchema,
|
|
1951
|
-
experimentContentQuerySchema: () => experimentContentQuerySchema,
|
|
1952
|
-
experimentContentResponseSchema: () => experimentContentResponseSchema,
|
|
1953
|
-
experimentContentTypeSchema: () => experimentContentTypeSchema,
|
|
1954
|
-
experimentDetailSchema: () => experimentDetailSchema,
|
|
1955
|
-
experimentListQuerySchema: () => experimentListQuerySchema,
|
|
1956
|
-
experimentListResponseSchema: () => experimentListResponseSchema,
|
|
1957
|
-
experimentModeSchema: () => experimentModeSchema,
|
|
1958
|
-
experimentStatusResponseSchema: () => experimentStatusResponseSchema,
|
|
1959
|
-
experimentStatusSchema: () => experimentStatusSchema,
|
|
1960
|
-
experimentSummarySchema: () => experimentSummarySchema,
|
|
1961
|
-
experimentVariantSchema: () => experimentVariantSchema,
|
|
1962
|
-
fixerEditSchema: () => fixerEditSchema,
|
|
1963
|
-
launchResultSchema: () => launchResultSchema,
|
|
1964
|
-
patchVariantBodySchema: () => patchVariantBodySchema,
|
|
1965
|
-
recommendationSchema: () => recommendationSchema,
|
|
1966
|
-
shipBodySchema: () => shipBodySchema,
|
|
1967
|
-
supportClassSchema: () => supportClassSchema,
|
|
1968
|
-
variantDeltaSchema: () => variantDeltaSchema,
|
|
1969
|
-
variantRefSchema: () => variantRefSchema,
|
|
1970
|
-
variantRunSchema: () => variantRunSchema,
|
|
1971
|
-
writeRoundResponseSchema: () => writeRoundResponseSchema,
|
|
1972
|
-
writeVariantContentBodySchema: () => writeVariantContentBodySchema,
|
|
1973
|
-
writeVariantContentResponseSchema: () => writeVariantContentResponseSchema
|
|
1974
|
-
});
|
|
1937
|
+
// ../packages/api-schemas/src/invites.ts
|
|
1975
1938
|
import { z as z22 } from "zod";
|
|
1976
|
-
var
|
|
1977
|
-
"DRAFT",
|
|
1978
|
-
"GENERATING",
|
|
1979
|
-
"LAUNCHING",
|
|
1980
|
-
"RUNNING",
|
|
1981
|
-
"SYNTHESIZING",
|
|
1982
|
-
"COMPLETE",
|
|
1983
|
-
"PARTIAL",
|
|
1984
|
-
"FAILED",
|
|
1985
|
-
"CANCELED"
|
|
1986
|
-
];
|
|
1987
|
-
var experimentStatusSchema = z22.enum(EXPERIMENT_STATUSES);
|
|
1988
|
-
var TERMINAL_EXPERIMENT_STATUSES = [
|
|
1989
|
-
"COMPLETE",
|
|
1990
|
-
"PARTIAL",
|
|
1991
|
-
"FAILED",
|
|
1992
|
-
"CANCELED"
|
|
1993
|
-
];
|
|
1994
|
-
var SUPPORT_CLASSES = [
|
|
1995
|
-
"RECOMMENDED",
|
|
1996
|
-
"PROMISING",
|
|
1997
|
-
"NOT_SUPPORTED",
|
|
1998
|
-
"NOT_EVALUABLE"
|
|
1999
|
-
];
|
|
2000
|
-
var supportClassSchema = z22.enum(SUPPORT_CLASSES);
|
|
2001
|
-
var jsonValue = z22.unknown();
|
|
2002
|
-
var EXPERIMENT_MODES = ["PROPOSE", "DIRECT", "MANUAL"];
|
|
2003
|
-
var experimentModeSchema = z22.enum(EXPERIMENT_MODES);
|
|
2004
|
-
var createExperimentBodyFields = z22.object({
|
|
2005
|
-
runId: z22.string().min(1),
|
|
2006
|
-
boundarySeq: z22.string().min(1),
|
|
2007
|
-
problemText: z22.string().trim().min(1).optional(),
|
|
2008
|
-
/** OPTIONAL, and it stays optional: a CLI built before the bifurcation must
|
|
2009
|
-
* keep working, and omitting it means PROPOSE — the behaviour it already
|
|
2010
|
-
* expects. */
|
|
2011
|
-
mode: experimentModeSchema.optional(),
|
|
2012
|
-
/** DIRECT only: the one change to make, in the author's own words. Ignored
|
|
2013
|
-
* in the other modes. Carried as the single rewrite's title, and REQUIRED
|
|
2014
|
-
* when `mode` is DIRECT — see the cross-field check below. */
|
|
2015
|
-
changeInstruction: z22.string().trim().min(1).max(200).optional()
|
|
2016
|
-
});
|
|
2017
|
-
var createExperimentBodySchema = createExperimentBodyFields.superRefine((body, ctx) => {
|
|
2018
|
-
if (body.mode === "DIRECT" && !body.changeInstruction) {
|
|
2019
|
-
ctx.addIssue({
|
|
2020
|
-
code: "custom",
|
|
2021
|
-
path: ["changeInstruction"],
|
|
2022
|
-
message: "mode DIRECT requires changeInstruction \u2014 the one change to make, in your own words"
|
|
2023
|
-
});
|
|
2024
|
-
}
|
|
2025
|
-
});
|
|
2026
|
-
var createExperimentResponseSchema = z22.object({
|
|
2027
|
-
experimentId: z22.string(),
|
|
2028
|
-
/** false = an existing draft for this (run, boundary) was resumed. */
|
|
2029
|
-
created: z22.boolean(),
|
|
2030
|
-
/** What is persisted — a resume keeps the statement it was opened with. */
|
|
2031
|
-
problemText: z22.string(),
|
|
2032
|
-
/** The PERSISTED mode, echoed for the same reason `problemText` is: exactly
|
|
2033
|
-
* one live draft exists per (run, boundary), so a resume returns the mode
|
|
2034
|
-
* that draft was opened with — which may not be the one this call asked
|
|
2035
|
-
* for. Clients report what came back, not what they sent. */
|
|
2036
|
-
mode: experimentModeSchema
|
|
2037
|
-
});
|
|
2038
|
-
var experimentListQuerySchema = z22.object({
|
|
2039
|
-
status: z22.string().transform(
|
|
2040
|
-
(s) => s.split(",").map((x) => x.trim().toUpperCase()).filter(Boolean)
|
|
2041
|
-
).pipe(z22.array(experimentStatusSchema)).optional(),
|
|
2042
|
-
limit: z22.coerce.number().int().min(1).max(100).default(25)
|
|
2043
|
-
});
|
|
2044
|
-
var experimentSummarySchema = z22.object({
|
|
1939
|
+
var inviteSchema = z22.object({
|
|
2045
1940
|
id: z22.string(),
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
variantCount: z22.number().int(),
|
|
2051
|
-
createdAt: z22.string()
|
|
2052
|
-
});
|
|
2053
|
-
var experimentListResponseSchema = z22.object({
|
|
2054
|
-
items: z22.array(experimentSummarySchema)
|
|
2055
|
-
});
|
|
2056
|
-
var eligibleExperimentRunSchema = z22.object({
|
|
2057
|
-
runId: z22.string(),
|
|
2058
|
-
agent: agentSchema,
|
|
2059
|
-
promptText: z22.string(),
|
|
2060
|
-
createdAt: z22.string(),
|
|
2061
|
-
verdict: z22.string().nullable(),
|
|
2062
|
-
boundaryCount: z22.number().int()
|
|
2063
|
-
});
|
|
2064
|
-
var experimentBoundarySchema = z22.object({
|
|
2065
|
-
boundarySeq: z22.union([z22.string(), z22.number()]),
|
|
2066
|
-
turn: z22.number().int().nullable(),
|
|
2067
|
-
url: z22.string(),
|
|
2068
|
-
domain: z22.string().nullable(),
|
|
2069
|
-
fetchPrompt: z22.string().nullable(),
|
|
2070
|
-
source: z22.string(),
|
|
2071
|
-
boundaryCheckpointId: z22.string().nullable(),
|
|
2072
|
-
boundaryOrdinal: z22.number().int().nullable(),
|
|
2073
|
-
capturedOccurrence: z22.number().int().nullable()
|
|
2074
|
-
});
|
|
2075
|
-
var variantRunSchema = z22.object({
|
|
2076
|
-
runId: z22.string(),
|
|
2077
|
-
status: z22.string(),
|
|
2078
|
-
failureReason: z22.string().nullable(),
|
|
2079
|
-
integrations: z22.array(jsonValue)
|
|
2080
|
-
});
|
|
2081
|
-
var experimentVariantSchema = z22.object({
|
|
2082
|
-
variantId: z22.string(),
|
|
2083
|
-
key: z22.string(),
|
|
2084
|
-
title: z22.string(),
|
|
2085
|
-
hypothesis: z22.string(),
|
|
2086
|
-
rewriteChars: z22.number().int(),
|
|
2087
|
-
hasRewrite: z22.boolean(),
|
|
2088
|
-
invalidReason: z22.string().nullable(),
|
|
2089
|
-
planStatus: z22.string().nullable(),
|
|
2090
|
-
planError: z22.string().nullable(),
|
|
2091
|
-
runs: z22.array(variantRunSchema),
|
|
2092
|
-
/** Arm verdict / finding counts / EXPERIMENT_DELTA output — server-owned
|
|
2093
|
-
* analytic JSON, null until computable. */
|
|
2094
|
-
verdict: jsonValue.nullable(),
|
|
2095
|
-
findings: jsonValue.nullable(),
|
|
2096
|
-
delta: jsonValue.nullable()
|
|
2097
|
-
});
|
|
2098
|
-
var experimentDetailSchema = z22.object({
|
|
2099
|
-
id: z22.string(),
|
|
2100
|
-
status: experimentStatusSchema,
|
|
2101
|
-
problem: z22.string(),
|
|
2102
|
-
boundaryUrl: z22.string().nullable(),
|
|
2103
|
-
createdAt: z22.string(),
|
|
2104
|
-
editable: z22.boolean(),
|
|
2105
|
-
roundInFlight: z22.boolean(),
|
|
2106
|
-
launching: z22.boolean(),
|
|
2107
|
-
launchError: z22.string().nullable(),
|
|
2108
|
-
planned: z22.boolean(),
|
|
2109
|
-
livePage: jsonValue.nullable(),
|
|
2110
|
-
sourceRun: z22.object({
|
|
2111
|
-
runId: z22.string(),
|
|
2112
|
-
agent: agentSchema,
|
|
2113
|
-
status: z22.string(),
|
|
2114
|
-
task: z22.string(),
|
|
2115
|
-
repoUrl: z22.string().nullable(),
|
|
2116
|
-
verdict: jsonValue.nullable(),
|
|
2117
|
-
integrations: z22.array(jsonValue)
|
|
1941
|
+
email: z22.string(),
|
|
1942
|
+
invitedBy: z22.object({
|
|
1943
|
+
name: z22.string().nullable(),
|
|
1944
|
+
email: z22.string().nullable()
|
|
2118
1945
|
}),
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
summary: jsonValue.nullable()
|
|
2122
|
-
});
|
|
2123
|
-
var experimentStatusResponseSchema = z22.object({
|
|
2124
|
-
id: z22.string(),
|
|
2125
|
-
status: experimentStatusSchema,
|
|
2126
|
-
planned: z22.boolean(),
|
|
2127
|
-
writeStartedAt: z22.string().nullable(),
|
|
2128
|
-
launchStartedAt: z22.string().nullable(),
|
|
2129
|
-
launchError: z22.string().nullable(),
|
|
2130
|
-
shippedVariantId: z22.string().nullable(),
|
|
2131
|
-
shippedAt: z22.string().nullable()
|
|
2132
|
-
});
|
|
2133
|
-
var addVariantBodySchema = z22.object({
|
|
2134
|
-
title: z22.string().optional(),
|
|
2135
|
-
hypothesis: z22.string().optional()
|
|
2136
|
-
});
|
|
2137
|
-
var patchVariantBodySchema = z22.object({
|
|
2138
|
-
title: z22.string().optional(),
|
|
2139
|
-
hypothesis: z22.string().optional()
|
|
2140
|
-
});
|
|
2141
|
-
var fixerEditSchema = z22.object({
|
|
2142
|
-
find: z22.string().min(1),
|
|
2143
|
-
replace: z22.string()
|
|
2144
|
-
});
|
|
2145
|
-
var experimentContentTypeSchema = z22.string().trim().toLowerCase().max(127).regex(
|
|
2146
|
-
/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/,
|
|
2147
|
-
"contentType must be a MIME type such as text/markdown"
|
|
2148
|
-
);
|
|
2149
|
-
var writeVariantContentBodySchema = z22.object({
|
|
2150
|
-
content: z22.string().optional(),
|
|
2151
|
-
edits: z22.array(fixerEditSchema).optional(),
|
|
2152
|
-
contentType: experimentContentTypeSchema.optional()
|
|
2153
|
-
});
|
|
2154
|
-
var writeVariantContentResponseSchema = z22.object({
|
|
2155
|
-
variantId: z22.string(),
|
|
2156
|
-
chars: z22.number().int(),
|
|
2157
|
-
truncated: z22.boolean(),
|
|
2158
|
-
applied: z22.number().int(),
|
|
2159
|
-
skipped: z22.number().int()
|
|
2160
|
-
});
|
|
2161
|
-
var experimentContentQuerySchema = z22.object({
|
|
2162
|
-
variantId: z22.string().optional(),
|
|
2163
|
-
offset: z22.coerce.number().int().min(0).default(0),
|
|
2164
|
-
maxChars: z22.coerce.number().int().min(1).max(4e4).default(2e4)
|
|
2165
|
-
});
|
|
2166
|
-
var experimentContentResponseSchema = z22.object({
|
|
2167
|
-
source: z22.string(),
|
|
2168
|
-
totalChars: z22.number().int(),
|
|
2169
|
-
offset: z22.number().int(),
|
|
2170
|
-
returnedChars: z22.number().int(),
|
|
2171
|
-
nextOffset: z22.number().int().nullable(),
|
|
2172
|
-
content: z22.string()
|
|
2173
|
-
});
|
|
2174
|
-
var writeRoundResponseSchema = z22.object({
|
|
2175
|
-
queued: z22.number().int(),
|
|
2176
|
-
reason: z22.enum(["round_in_flight", "nothing_pending"]).optional()
|
|
2177
|
-
});
|
|
2178
|
-
var launchResultSchema = z22.object({
|
|
2179
|
-
experimentId: z22.string(),
|
|
2180
|
-
status: z22.literal("LAUNCHING")
|
|
2181
|
-
});
|
|
2182
|
-
var shipBodySchema = z22.object({ variantId: z22.string().min(1) });
|
|
2183
|
-
var cancelResponseSchema = z22.object({
|
|
2184
|
-
id: z22.string(),
|
|
2185
|
-
status: z22.literal("CANCELED")
|
|
2186
|
-
});
|
|
2187
|
-
var variantDeltaSchema = z22.object({
|
|
2188
|
-
changed: z22.boolean().nullable(),
|
|
2189
|
-
hypothesisSupported: z22.enum(["supported", "refuted", "inconclusive"]).nullable(),
|
|
2190
|
-
summary: z22.string().nullable()
|
|
2191
|
-
});
|
|
2192
|
-
var variantRefSchema = z22.object({
|
|
2193
|
-
key: z22.string(),
|
|
2194
|
-
title: z22.string(),
|
|
2195
|
-
effect: z22.number().nullable(),
|
|
2196
|
-
consistency: z22.string().nullable(),
|
|
2197
|
-
note: z22.string().nullable(),
|
|
2198
|
-
delta: variantDeltaSchema.nullable().optional()
|
|
2199
|
-
});
|
|
2200
|
-
var recommendationSchema = z22.object({
|
|
2201
|
-
evaluatorVersion: z22.string(),
|
|
2202
|
-
summary: z22.string(),
|
|
2203
|
-
groups: z22.object({
|
|
2204
|
-
recommended: z22.array(variantRefSchema),
|
|
2205
|
-
promising: z22.array(variantRefSchema),
|
|
2206
|
-
notSupported: z22.array(variantRefSchema),
|
|
2207
|
-
notEvaluable: z22.array(variantRefSchema)
|
|
2208
|
-
}),
|
|
2209
|
-
tradeoffs: z22.array(z22.string())
|
|
2210
|
-
});
|
|
2211
|
-
|
|
2212
|
-
// ../packages/api-schemas/src/invites.ts
|
|
2213
|
-
import { z as z23 } from "zod";
|
|
2214
|
-
var inviteSchema = z23.object({
|
|
2215
|
-
id: z23.string(),
|
|
2216
|
-
email: z23.string(),
|
|
2217
|
-
invitedBy: z23.object({
|
|
2218
|
-
name: z23.string().nullable(),
|
|
2219
|
-
email: z23.string().nullable()
|
|
2220
|
-
}),
|
|
2221
|
-
createdAt: z23.string(),
|
|
2222
|
-
expiresAt: z23.string()
|
|
1946
|
+
createdAt: z22.string(),
|
|
1947
|
+
expiresAt: z22.string()
|
|
2223
1948
|
});
|
|
2224
|
-
var listInvitesResponseSchema =
|
|
2225
|
-
items:
|
|
1949
|
+
var listInvitesResponseSchema = z22.object({
|
|
1950
|
+
items: z22.array(inviteSchema)
|
|
2226
1951
|
});
|
|
2227
1952
|
|
|
2228
1953
|
// ../packages/api-schemas/src/keys.ts
|
|
@@ -2235,177 +1960,177 @@ __export(keys_exports, {
|
|
|
2235
1960
|
setProviderKeyBodySchema: () => setProviderKeyBodySchema,
|
|
2236
1961
|
setProviderKeyResponseSchema: () => setProviderKeyResponseSchema
|
|
2237
1962
|
});
|
|
2238
|
-
import { z as
|
|
1963
|
+
import { z as z23 } from "zod";
|
|
2239
1964
|
var PROVIDER_TYPES = ["anthropic", "openai"];
|
|
2240
|
-
var providerTypeSchema =
|
|
2241
|
-
var setProviderKeyBodySchema =
|
|
1965
|
+
var providerTypeSchema = z23.enum(PROVIDER_TYPES);
|
|
1966
|
+
var setProviderKeyBodySchema = z23.object({
|
|
2242
1967
|
/** The raw provider API key. Verified + stored server-side (AWS Secrets
|
|
2243
1968
|
* Manager); never persisted in the app DB and never echoed back. */
|
|
2244
|
-
key:
|
|
1969
|
+
key: z23.string().min(1)
|
|
2245
1970
|
});
|
|
2246
|
-
var setProviderKeyResponseSchema =
|
|
1971
|
+
var setProviderKeyResponseSchema = z23.object({
|
|
2247
1972
|
providerType: providerTypeSchema,
|
|
2248
|
-
last4:
|
|
1973
|
+
last4: z23.string()
|
|
2249
1974
|
});
|
|
2250
|
-
var providerKeySchema =
|
|
1975
|
+
var providerKeySchema = z23.object({
|
|
2251
1976
|
providerType: providerTypeSchema,
|
|
2252
|
-
last4:
|
|
2253
|
-
createdAt:
|
|
1977
|
+
last4: z23.string(),
|
|
1978
|
+
createdAt: z23.string(),
|
|
2254
1979
|
/** When the key was last saved/rotated. */
|
|
2255
|
-
updatedAt:
|
|
1980
|
+
updatedAt: z23.string()
|
|
2256
1981
|
});
|
|
2257
1982
|
var providerKeyListResponseSchema = listResponseSchema(providerKeySchema);
|
|
2258
1983
|
|
|
2259
1984
|
// ../packages/api-schemas/src/mcp.ts
|
|
2260
|
-
import { z as
|
|
1985
|
+
import { z as z25 } from "zod";
|
|
2261
1986
|
|
|
2262
1987
|
// ../packages/api-schemas/src/skills.ts
|
|
2263
|
-
import { z as
|
|
1988
|
+
import { z as z24 } from "zod";
|
|
2264
1989
|
var sha256Hex = sha256DigestSchema;
|
|
2265
|
-
var skillHandleSchema =
|
|
2266
|
-
var skillSetEntrySchema =
|
|
2267
|
-
skillId:
|
|
1990
|
+
var skillHandleSchema = z24.string().min(1).max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/, "invalid skill handle").refine((name) => name !== "." && name !== "..", "invalid skill handle");
|
|
1991
|
+
var skillSetEntrySchema = z24.object({
|
|
1992
|
+
skillId: z24.string().min(1),
|
|
2268
1993
|
name: skillHandleSchema,
|
|
2269
|
-
label:
|
|
1994
|
+
label: z24.string().min(1),
|
|
2270
1995
|
contentDigest: sha256Hex,
|
|
2271
1996
|
blobDigest: sha256Hex,
|
|
2272
1997
|
/** `cas/v2/<scope>/skills/sha256/<ab>/<blobDigest>.tar.zst`. */
|
|
2273
|
-
blobKey:
|
|
1998
|
+
blobKey: z24.string().min(1),
|
|
2274
1999
|
/** Raw canonical-tar size. Bounds the decompression allocation when present. */
|
|
2275
|
-
rawBytes:
|
|
2000
|
+
rawBytes: z24.number().int().positive().optional(),
|
|
2276
2001
|
/** Stored compressed size, verified against the object when present. */
|
|
2277
|
-
storedBytes:
|
|
2002
|
+
storedBytes: z24.number().int().positive().optional(),
|
|
2278
2003
|
/**
|
|
2279
2004
|
* What the MODEL sees, parsed from the frontmatter at push time
|
|
2280
2005
|
* (`{ name, description, descriptionChars, bodyBytes }`). Carried through to
|
|
2281
2006
|
* the trace for the record; the staging path never branches on it.
|
|
2282
2007
|
*/
|
|
2283
|
-
exposure:
|
|
2008
|
+
exposure: z24.record(z24.string(), z24.unknown()).optional()
|
|
2284
2009
|
});
|
|
2285
2010
|
var MAX_SKILL_SET_ENTRIES = 32;
|
|
2286
|
-
var skillSetSchema =
|
|
2011
|
+
var skillSetSchema = z24.array(skillSetEntrySchema).max(
|
|
2287
2012
|
MAX_SKILL_SET_ENTRIES,
|
|
2288
2013
|
`a run may stage at most ${MAX_SKILL_SET_ENTRIES} skills`
|
|
2289
2014
|
);
|
|
2290
|
-
var skillSourceWireSchema =
|
|
2291
|
-
repoFullName:
|
|
2292
|
-
ref:
|
|
2293
|
-
subpath:
|
|
2294
|
-
autoIngest:
|
|
2295
|
-
lastSeenCommit:
|
|
2296
|
-
lastCheckedAt:
|
|
2297
|
-
lastError:
|
|
2298
|
-
});
|
|
2299
|
-
var skillVersionWireSchema =
|
|
2300
|
-
id:
|
|
2301
|
-
label:
|
|
2302
|
-
contentDigest:
|
|
2303
|
-
ingestTrigger:
|
|
2304
|
-
createdAt:
|
|
2305
|
-
});
|
|
2306
|
-
var skillListItemSchema =
|
|
2307
|
-
id:
|
|
2015
|
+
var skillSourceWireSchema = z24.object({
|
|
2016
|
+
repoFullName: z24.string(),
|
|
2017
|
+
ref: z24.string(),
|
|
2018
|
+
subpath: z24.string(),
|
|
2019
|
+
autoIngest: z24.boolean(),
|
|
2020
|
+
lastSeenCommit: z24.string().nullable(),
|
|
2021
|
+
lastCheckedAt: z24.string().nullable(),
|
|
2022
|
+
lastError: z24.string().nullable()
|
|
2023
|
+
});
|
|
2024
|
+
var skillVersionWireSchema = z24.object({
|
|
2025
|
+
id: z24.string(),
|
|
2026
|
+
label: z24.string(),
|
|
2027
|
+
contentDigest: z24.string(),
|
|
2028
|
+
ingestTrigger: z24.string().nullable(),
|
|
2029
|
+
createdAt: z24.string()
|
|
2030
|
+
});
|
|
2031
|
+
var skillListItemSchema = z24.object({
|
|
2032
|
+
id: z24.string(),
|
|
2308
2033
|
/** OUR storage handle — the {ref} segment. */
|
|
2309
2034
|
name: skillHandleSchema,
|
|
2310
|
-
note:
|
|
2035
|
+
note: z24.string().nullable(),
|
|
2311
2036
|
source: skillSourceWireSchema.nullable(),
|
|
2312
2037
|
latestVersion: skillVersionWireSchema.nullable(),
|
|
2313
|
-
versionCount:
|
|
2314
|
-
createdAt:
|
|
2315
|
-
updatedAt:
|
|
2038
|
+
versionCount: z24.number().int(),
|
|
2039
|
+
createdAt: z24.string(),
|
|
2040
|
+
updatedAt: z24.string()
|
|
2316
2041
|
});
|
|
2317
|
-
var listSkillsResponseSchema =
|
|
2318
|
-
items:
|
|
2042
|
+
var listSkillsResponseSchema = z24.object({
|
|
2043
|
+
items: z24.array(skillListItemSchema)
|
|
2319
2044
|
});
|
|
2320
|
-
var skillDetailSchema = skillListItemSchema.omit({ latestVersion: true }).extend({ versions:
|
|
2321
|
-
var addSkillBodySchema =
|
|
2322
|
-
reference:
|
|
2045
|
+
var skillDetailSchema = skillListItemSchema.omit({ latestVersion: true }).extend({ versions: z24.array(skillVersionWireSchema) });
|
|
2046
|
+
var addSkillBodySchema = z24.object({
|
|
2047
|
+
reference: z24.string().min(1),
|
|
2323
2048
|
/** OUR handle; defaults to the resolved directory basename. */
|
|
2324
2049
|
handle: skillHandleSchema.optional(),
|
|
2325
2050
|
/** Explicit version label — a typed label is intent and always mints;
|
|
2326
2051
|
* omitted derives from the resolved anchor and dedups by digest. */
|
|
2327
|
-
label:
|
|
2052
|
+
label: z24.string().min(1).max(120).optional(),
|
|
2328
2053
|
/** Select one skill from a source holding several. */
|
|
2329
|
-
skill:
|
|
2330
|
-
note:
|
|
2054
|
+
skill: z24.string().min(1).optional(),
|
|
2055
|
+
note: z24.string().max(2e3).optional(),
|
|
2331
2056
|
/** Track the source branch for auto re-ingest (needs an explicit branch). */
|
|
2332
|
-
trackSource:
|
|
2057
|
+
trackSource: z24.boolean().optional()
|
|
2333
2058
|
});
|
|
2334
|
-
var addSkillResponseSchema =
|
|
2335
|
-
skillId:
|
|
2336
|
-
handle:
|
|
2337
|
-
label:
|
|
2059
|
+
var addSkillResponseSchema = z24.object({
|
|
2060
|
+
skillId: z24.string().nullable(),
|
|
2061
|
+
handle: z24.string(),
|
|
2062
|
+
label: z24.string(),
|
|
2338
2063
|
/** True = the newest version already carried this content; nothing minted. */
|
|
2339
|
-
unchanged:
|
|
2064
|
+
unchanged: z24.boolean()
|
|
2340
2065
|
});
|
|
2341
|
-
var updateSkillBodySchema =
|
|
2066
|
+
var updateSkillBodySchema = z24.object({
|
|
2342
2067
|
name: skillHandleSchema.optional(),
|
|
2343
|
-
note:
|
|
2344
|
-
source:
|
|
2345
|
-
repoFullName:
|
|
2068
|
+
note: z24.string().max(2e3).nullish(),
|
|
2069
|
+
source: z24.object({
|
|
2070
|
+
repoFullName: z24.string().min(1),
|
|
2346
2071
|
/** A branch name — never HEAD, never a SHA. */
|
|
2347
|
-
ref:
|
|
2348
|
-
subpath:
|
|
2349
|
-
autoIngest:
|
|
2072
|
+
ref: z24.string().min(1),
|
|
2073
|
+
subpath: z24.string().optional(),
|
|
2074
|
+
autoIngest: z24.boolean().optional()
|
|
2350
2075
|
}).nullish()
|
|
2351
2076
|
});
|
|
2352
|
-
var reingestSkillResponseSchema =
|
|
2353
|
-
label:
|
|
2077
|
+
var reingestSkillResponseSchema = z24.object({
|
|
2078
|
+
label: z24.string().nullable(),
|
|
2354
2079
|
/** True = "already current": the source content matches the newest version. */
|
|
2355
|
-
unchanged:
|
|
2080
|
+
unchanged: z24.boolean()
|
|
2356
2081
|
});
|
|
2357
|
-
var addSkillVersionBodySchema =
|
|
2358
|
-
reference:
|
|
2082
|
+
var addSkillVersionBodySchema = z24.object({
|
|
2083
|
+
reference: z24.string().min(1),
|
|
2359
2084
|
/** Omitted defaults to the ref name (branch/tag), else the anchor. */
|
|
2360
|
-
label:
|
|
2361
|
-
});
|
|
2362
|
-
var addSkillVersionResponseSchema =
|
|
2363
|
-
label:
|
|
2364
|
-
unchanged:
|
|
2365
|
-
});
|
|
2366
|
-
var skillRunWireSchema =
|
|
2367
|
-
runId:
|
|
2368
|
-
agent:
|
|
2369
|
-
turns:
|
|
2370
|
-
durationMs:
|
|
2371
|
-
costUsd:
|
|
2372
|
-
finishedAt:
|
|
2085
|
+
label: z24.string().min(1).max(120).optional()
|
|
2086
|
+
});
|
|
2087
|
+
var addSkillVersionResponseSchema = z24.object({
|
|
2088
|
+
label: z24.string(),
|
|
2089
|
+
unchanged: z24.boolean()
|
|
2090
|
+
});
|
|
2091
|
+
var skillRunWireSchema = z24.object({
|
|
2092
|
+
runId: z24.string(),
|
|
2093
|
+
agent: z24.string(),
|
|
2094
|
+
turns: z24.number().int().nullable(),
|
|
2095
|
+
durationMs: z24.number().int().nullable(),
|
|
2096
|
+
costUsd: z24.number().nullable(),
|
|
2097
|
+
finishedAt: z24.string().nullable(),
|
|
2373
2098
|
/** WHICH version of the skill the session staged. */
|
|
2374
|
-
versionLabel:
|
|
2099
|
+
versionLabel: z24.string().nullable()
|
|
2375
2100
|
});
|
|
2376
|
-
var listSkillRunsResponseSchema =
|
|
2377
|
-
items:
|
|
2101
|
+
var listSkillRunsResponseSchema = z24.object({
|
|
2102
|
+
items: z24.array(skillRunWireSchema)
|
|
2378
2103
|
});
|
|
2379
2104
|
|
|
2380
2105
|
// ../packages/api-schemas/src/mcp.ts
|
|
2381
2106
|
var mcpServerHandleSchema = skillHandleSchema;
|
|
2382
2107
|
var MCP_SPEC_VERSION = 1;
|
|
2383
|
-
var envVarNameSchema =
|
|
2108
|
+
var envVarNameSchema = z25.string().min(1).max(128).regex(
|
|
2384
2109
|
/^[A-Za-z_][A-Za-z0-9_]*$/,
|
|
2385
2110
|
"an environment variable name (letters, digits, underscore; not starting with a digit)"
|
|
2386
2111
|
);
|
|
2387
|
-
var headerNameSchema2 =
|
|
2112
|
+
var headerNameSchema2 = z25.string().min(1).max(128).regex(
|
|
2388
2113
|
/^[A-Za-z0-9!#$%&'*+\-.^_`|~]+$/,
|
|
2389
2114
|
"an HTTP header name (a token \u2014 no colon, no spaces)"
|
|
2390
2115
|
);
|
|
2391
|
-
var mcpToolSchema =
|
|
2392
|
-
name:
|
|
2393
|
-
description:
|
|
2116
|
+
var mcpToolSchema = z25.object({
|
|
2117
|
+
name: z25.string().min(1).max(128),
|
|
2118
|
+
description: z25.string().max(4096).optional()
|
|
2394
2119
|
});
|
|
2395
|
-
var mcpSpecSchema =
|
|
2396
|
-
specVersion:
|
|
2397
|
-
transport:
|
|
2120
|
+
var mcpSpecSchema = z25.object({
|
|
2121
|
+
specVersion: z25.literal(MCP_SPEC_VERSION),
|
|
2122
|
+
transport: z25.enum(["stdio", "http"]),
|
|
2398
2123
|
// stdio
|
|
2399
|
-
command:
|
|
2400
|
-
args:
|
|
2401
|
-
envNames:
|
|
2124
|
+
command: z25.string().min(1).max(512).optional(),
|
|
2125
|
+
args: z25.array(z25.string().max(4096)).max(64).optional(),
|
|
2126
|
+
envNames: z25.array(envVarNameSchema).max(32).optional(),
|
|
2402
2127
|
// http
|
|
2403
|
-
url:
|
|
2404
|
-
headerNames:
|
|
2128
|
+
url: z25.string().url().max(2048).optional(),
|
|
2129
|
+
headerNames: z25.array(headerNameSchema2).max(32).optional(),
|
|
2405
2130
|
// display only — outside the digest (D13)
|
|
2406
2131
|
serverName: mcpServerHandleSchema,
|
|
2407
|
-
description:
|
|
2408
|
-
tools:
|
|
2132
|
+
description: z25.string().max(4096).optional(),
|
|
2133
|
+
tools: z25.array(mcpToolSchema).max(256).optional()
|
|
2409
2134
|
}).strict().superRefine((spec, ctx) => {
|
|
2410
2135
|
if (spec.transport === "stdio") {
|
|
2411
2136
|
if (!spec.command) {
|
|
@@ -2449,17 +2174,17 @@ var mcpSpecSchema = z26.object({
|
|
|
2449
2174
|
}
|
|
2450
2175
|
}
|
|
2451
2176
|
});
|
|
2452
|
-
var mcpExposureSchema =
|
|
2453
|
-
serverName:
|
|
2454
|
-
description:
|
|
2455
|
-
tools:
|
|
2177
|
+
var mcpExposureSchema = z25.object({
|
|
2178
|
+
serverName: z25.string().min(1),
|
|
2179
|
+
description: z25.string().optional(),
|
|
2180
|
+
tools: z25.array(mcpToolSchema).default([]),
|
|
2456
2181
|
/** Declared credential NAMES, mirrored here so the picker and the index row can
|
|
2457
2182
|
* render the contract without parsing `spec`. Never values. */
|
|
2458
|
-
envNames:
|
|
2459
|
-
headerNames:
|
|
2183
|
+
envNames: z25.array(z25.string()).default([]),
|
|
2184
|
+
headerNames: z25.array(z25.string()).default([])
|
|
2460
2185
|
});
|
|
2461
|
-
var mcpWarningSchema =
|
|
2462
|
-
code:
|
|
2186
|
+
var mcpWarningSchema = z25.object({
|
|
2187
|
+
code: z25.enum([
|
|
2463
2188
|
"unpinned_package",
|
|
2464
2189
|
"credential_required",
|
|
2465
2190
|
"value_discarded",
|
|
@@ -2469,122 +2194,122 @@ var mcpWarningSchema = z26.object({
|
|
|
2469
2194
|
// contract was recorded when none was (Bugbot, medium).
|
|
2470
2195
|
"flag_ignored"
|
|
2471
2196
|
]),
|
|
2472
|
-
message:
|
|
2197
|
+
message: z25.string()
|
|
2473
2198
|
});
|
|
2474
|
-
var mcpSetEntrySchema =
|
|
2199
|
+
var mcpSetEntrySchema = z25.object({
|
|
2475
2200
|
/** `McpServer.id` — the stable handle a UI chip links back to; `label` already
|
|
2476
2201
|
* names the version, so this is deliberately not `McpServerVersion.id`. */
|
|
2477
|
-
serverId:
|
|
2202
|
+
serverId: z25.string().min(1),
|
|
2478
2203
|
/** `McpServer.name` — OUR handle, and the CONFIG KEY the serializer writes. NOT
|
|
2479
2204
|
* the agent-visible `spec.serverName`. */
|
|
2480
2205
|
name: mcpServerHandleSchema,
|
|
2481
|
-
label:
|
|
2482
|
-
specDigest:
|
|
2206
|
+
label: z25.string().min(1),
|
|
2207
|
+
specDigest: z25.string().min(1),
|
|
2483
2208
|
spec: mcpSpecSchema,
|
|
2484
2209
|
/** Declared tools/description as at authoring time. The preparation path never
|
|
2485
2210
|
* branches on it; it rides along for the trace and the UI. */
|
|
2486
|
-
exposure:
|
|
2211
|
+
exposure: z25.record(z25.string(), z25.unknown()).optional(),
|
|
2487
2212
|
/** Connection selected by this immutable MCP version. The matching non-secret
|
|
2488
2213
|
* provider metadata lives in Batch.connectionSet. */
|
|
2489
|
-
connectionId:
|
|
2214
|
+
connectionId: z25.string().min(1).optional()
|
|
2490
2215
|
});
|
|
2491
2216
|
var MAX_MCP_SET_ENTRIES = 8;
|
|
2492
|
-
var mcpSetSchema =
|
|
2217
|
+
var mcpSetSchema = z25.array(mcpSetEntrySchema).max(
|
|
2493
2218
|
MAX_MCP_SET_ENTRIES,
|
|
2494
2219
|
`a run may prepare at most ${MAX_MCP_SET_ENTRIES} MCP servers`
|
|
2495
2220
|
);
|
|
2496
|
-
var mcpRefSchema =
|
|
2221
|
+
var mcpRefSchema = z25.string().min(3).max(320).regex(
|
|
2497
2222
|
/^[A-Za-z0-9][A-Za-z0-9._-]*@[^,]+$/,
|
|
2498
2223
|
'an MCP server reference must be "name@label" (a bare name is not a reference)'
|
|
2499
2224
|
);
|
|
2500
|
-
var mcpRefsSchema =
|
|
2501
|
-
var mcpVersionWireSchema =
|
|
2502
|
-
id:
|
|
2503
|
-
label:
|
|
2504
|
-
specDigest:
|
|
2225
|
+
var mcpRefsSchema = z25.array(mcpRefSchema).max(MAX_MCP_SET_ENTRIES);
|
|
2226
|
+
var mcpVersionWireSchema = z25.object({
|
|
2227
|
+
id: z25.string(),
|
|
2228
|
+
label: z25.string(),
|
|
2229
|
+
specDigest: z25.string(),
|
|
2505
2230
|
spec: mcpSpecSchema,
|
|
2506
2231
|
exposure: mcpExposureSchema,
|
|
2507
|
-
warnings:
|
|
2508
|
-
createdAt:
|
|
2232
|
+
warnings: z25.array(mcpWarningSchema),
|
|
2233
|
+
createdAt: z25.string()
|
|
2509
2234
|
});
|
|
2510
|
-
var mcpServerListItemSchema =
|
|
2511
|
-
id:
|
|
2235
|
+
var mcpServerListItemSchema = z25.object({
|
|
2236
|
+
id: z25.string(),
|
|
2512
2237
|
/** OUR handle — the {ref} segment and the config key the serializer writes. */
|
|
2513
2238
|
name: mcpServerHandleSchema,
|
|
2514
|
-
note:
|
|
2239
|
+
note: z25.string().nullable(),
|
|
2515
2240
|
latestVersion: mcpVersionWireSchema.nullable(),
|
|
2516
|
-
versionCount:
|
|
2517
|
-
createdAt:
|
|
2518
|
-
updatedAt:
|
|
2241
|
+
versionCount: z25.number().int(),
|
|
2242
|
+
createdAt: z25.string(),
|
|
2243
|
+
updatedAt: z25.string()
|
|
2519
2244
|
});
|
|
2520
|
-
var listMcpServersResponseSchema =
|
|
2521
|
-
items:
|
|
2245
|
+
var listMcpServersResponseSchema = z25.object({
|
|
2246
|
+
items: z25.array(mcpServerListItemSchema)
|
|
2522
2247
|
});
|
|
2523
|
-
var mcpServerDetailSchema = mcpServerListItemSchema.omit({ latestVersion: true }).extend({ versions:
|
|
2524
|
-
var saveMcpServerBodySchema =
|
|
2248
|
+
var mcpServerDetailSchema = mcpServerListItemSchema.omit({ latestVersion: true }).extend({ versions: z25.array(mcpVersionWireSchema) });
|
|
2249
|
+
var saveMcpServerBodySchema = z25.object({
|
|
2525
2250
|
name: mcpServerHandleSchema,
|
|
2526
|
-
spec:
|
|
2251
|
+
spec: z25.unknown(),
|
|
2527
2252
|
/** A typed label is intent and always mints; omitted defaults to a UTC
|
|
2528
2253
|
* timestamp label and dedups by spec digest. */
|
|
2529
|
-
label:
|
|
2530
|
-
note:
|
|
2531
|
-
});
|
|
2532
|
-
var saveMcpServerResponseSchema =
|
|
2533
|
-
serverId:
|
|
2534
|
-
handle:
|
|
2535
|
-
label:
|
|
2536
|
-
specDigest:
|
|
2537
|
-
warnings:
|
|
2254
|
+
label: z25.string().min(1).max(120).optional(),
|
|
2255
|
+
note: z25.string().max(2e3).optional()
|
|
2256
|
+
});
|
|
2257
|
+
var saveMcpServerResponseSchema = z25.object({
|
|
2258
|
+
serverId: z25.string().nullable(),
|
|
2259
|
+
handle: z25.string(),
|
|
2260
|
+
label: z25.string(),
|
|
2261
|
+
specDigest: z25.string(),
|
|
2262
|
+
warnings: z25.array(mcpWarningSchema),
|
|
2538
2263
|
/** True = the newest version already carries this exact spec. */
|
|
2539
|
-
unchanged:
|
|
2264
|
+
unchanged: z25.boolean(),
|
|
2540
2265
|
/** Display-only rendered invocation or URL. */
|
|
2541
|
-
invocation:
|
|
2266
|
+
invocation: z25.string()
|
|
2542
2267
|
});
|
|
2543
|
-
var updateMcpServerBodySchema =
|
|
2268
|
+
var updateMcpServerBodySchema = z25.object({
|
|
2544
2269
|
name: mcpServerHandleSchema.optional(),
|
|
2545
|
-
note:
|
|
2270
|
+
note: z25.string().max(2e3).nullish()
|
|
2546
2271
|
});
|
|
2547
2272
|
|
|
2548
2273
|
// ../packages/api-schemas/src/me.ts
|
|
2549
|
-
import { z as
|
|
2550
|
-
var meUserSchema =
|
|
2551
|
-
id:
|
|
2552
|
-
email:
|
|
2553
|
-
isSuperuser:
|
|
2274
|
+
import { z as z26 } from "zod";
|
|
2275
|
+
var meUserSchema = z26.object({
|
|
2276
|
+
id: z26.string(),
|
|
2277
|
+
email: z26.string().nullable(),
|
|
2278
|
+
isSuperuser: z26.boolean()
|
|
2554
2279
|
});
|
|
2555
|
-
var meOrgSchema =
|
|
2556
|
-
slug:
|
|
2280
|
+
var meOrgSchema = z26.object({
|
|
2281
|
+
slug: z26.string(),
|
|
2557
2282
|
// Gauge's immutable Organization.public_id; null for LOCAL orgs.
|
|
2558
|
-
publicId:
|
|
2559
|
-
name:
|
|
2283
|
+
publicId: z26.string().nullable(),
|
|
2284
|
+
name: z26.string()
|
|
2560
2285
|
});
|
|
2561
|
-
var meResponseSchema =
|
|
2286
|
+
var meResponseSchema = z26.object({
|
|
2562
2287
|
user: meUserSchema,
|
|
2563
2288
|
// Membership-scoped for normal users; superusers see every org (mirrors the
|
|
2564
2289
|
// web tier's userOrgs).
|
|
2565
|
-
orgs:
|
|
2290
|
+
orgs: z26.array(meOrgSchema)
|
|
2566
2291
|
});
|
|
2567
2292
|
|
|
2568
2293
|
// ../packages/api-schemas/src/optimizations.ts
|
|
2569
|
-
import { z as
|
|
2294
|
+
import { z as z30 } from "zod";
|
|
2570
2295
|
|
|
2571
2296
|
// ../packages/api-schemas/src/cli-interventions.ts
|
|
2572
|
-
import { z as
|
|
2573
|
-
var digest =
|
|
2574
|
-
var token =
|
|
2575
|
-
var optionFlag =
|
|
2576
|
-
var envKey =
|
|
2577
|
-
var relativePath =
|
|
2297
|
+
import { z as z27 } from "zod";
|
|
2298
|
+
var digest = z27.string().regex(/^[a-f0-9]{64}$/);
|
|
2299
|
+
var token = z27.string().min(1).max(4096);
|
|
2300
|
+
var optionFlag = z27.string().regex(/^--?[A-Za-z0-9][A-Za-z0-9-]*$/);
|
|
2301
|
+
var envKey = z27.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);
|
|
2302
|
+
var relativePath = z27.string().min(1).max(1024).refine(
|
|
2578
2303
|
(path2) => !path2.startsWith("/") && !path2.includes("\\") && !path2.includes("\0") && path2.split("/").every(
|
|
2579
2304
|
(part) => part && part !== "." && part !== ".." && ![".git", "node_modules", ".pnpm", ".yarn", ".venv"].includes(part)
|
|
2580
2305
|
),
|
|
2581
2306
|
"Use a workspace-relative path without traversal"
|
|
2582
2307
|
);
|
|
2583
|
-
var sourcedValue =
|
|
2584
|
-
|
|
2585
|
-
|
|
2308
|
+
var sourcedValue = z27.discriminatedUnion("source", [
|
|
2309
|
+
z27.object({ source: z27.literal("literal"), value: z27.string().max(8192) }).strict(),
|
|
2310
|
+
z27.object({ source: z27.literal("localFact"), key: envKey }).strict()
|
|
2586
2311
|
]);
|
|
2587
|
-
var cliLaunchFormSchema =
|
|
2312
|
+
var cliLaunchFormSchema = z27.enum([
|
|
2588
2313
|
"native",
|
|
2589
2314
|
"path",
|
|
2590
2315
|
"symlink",
|
|
@@ -2595,7 +2320,7 @@ var cliLaunchFormSchema = z28.enum([
|
|
|
2595
2320
|
"execveat-path",
|
|
2596
2321
|
"execveat-fd"
|
|
2597
2322
|
]);
|
|
2598
|
-
var cliObservationReasonSchema =
|
|
2323
|
+
var cliObservationReasonSchema = z27.enum([
|
|
2599
2324
|
"eligible",
|
|
2600
2325
|
"other-target",
|
|
2601
2326
|
"other-command",
|
|
@@ -2609,14 +2334,14 @@ var cliObservationReasonSchema = z28.enum([
|
|
|
2609
2334
|
"operation-profile",
|
|
2610
2335
|
"descriptor-lifetime"
|
|
2611
2336
|
]);
|
|
2612
|
-
var cliIoProfileSchema =
|
|
2337
|
+
var cliIoProfileSchema = z27.enum([
|
|
2613
2338
|
"pipes",
|
|
2614
2339
|
"redirected",
|
|
2615
2340
|
"shared-descriptor",
|
|
2616
2341
|
"pty"
|
|
2617
2342
|
]);
|
|
2618
|
-
var cliObservationSchema =
|
|
2619
|
-
invocationId:
|
|
2343
|
+
var cliObservationSchema = z27.object({
|
|
2344
|
+
invocationId: z27.string().regex(/^[a-f0-9]{32}$/),
|
|
2620
2345
|
targetId: token,
|
|
2621
2346
|
commandId: token.nullable(),
|
|
2622
2347
|
entrypointSha256: digest,
|
|
@@ -2625,18 +2350,18 @@ var cliObservationSchema = z28.object({
|
|
|
2625
2350
|
ioProfile: cliIoProfileSchema.nullable(),
|
|
2626
2351
|
reason: cliObservationReasonSchema
|
|
2627
2352
|
});
|
|
2628
|
-
var cliCoverageSchema =
|
|
2629
|
-
attempt:
|
|
2630
|
-
observedInvocationCount:
|
|
2631
|
-
invocationCount:
|
|
2632
|
-
appliedInvocationCount:
|
|
2633
|
-
incompleteCount:
|
|
2634
|
-
unsupportedCount:
|
|
2635
|
-
instrumentationFailed:
|
|
2636
|
-
observations:
|
|
2637
|
-
unsupportedDiagnostics:
|
|
2638
|
-
});
|
|
2639
|
-
var cliOperationKindSchema =
|
|
2353
|
+
var cliCoverageSchema = z27.object({
|
|
2354
|
+
attempt: z27.number().int().nonnegative(),
|
|
2355
|
+
observedInvocationCount: z27.number().int().nonnegative().nullable(),
|
|
2356
|
+
invocationCount: z27.number().int().nonnegative(),
|
|
2357
|
+
appliedInvocationCount: z27.number().int().nonnegative(),
|
|
2358
|
+
incompleteCount: z27.number().int().nonnegative(),
|
|
2359
|
+
unsupportedCount: z27.number().int().nonnegative(),
|
|
2360
|
+
instrumentationFailed: z27.boolean(),
|
|
2361
|
+
observations: z27.array(cliObservationSchema),
|
|
2362
|
+
unsupportedDiagnostics: z27.array(z27.string())
|
|
2363
|
+
});
|
|
2364
|
+
var cliOperationKindSchema = z27.enum([
|
|
2640
2365
|
"ensureOption",
|
|
2641
2366
|
"replaceOption",
|
|
2642
2367
|
"setEnv",
|
|
@@ -2646,17 +2371,17 @@ var cliOperationKindSchema = z28.enum([
|
|
|
2646
2371
|
"promptRecipe",
|
|
2647
2372
|
"generatedFile"
|
|
2648
2373
|
]);
|
|
2649
|
-
var commandCapabilitiesSchema =
|
|
2650
|
-
operations:
|
|
2651
|
-
options:
|
|
2652
|
-
settings:
|
|
2653
|
-
localFacts:
|
|
2654
|
-
generatedPaths:
|
|
2655
|
-
outputModes:
|
|
2656
|
-
stdinFormats:
|
|
2657
|
-
recipeIds:
|
|
2374
|
+
var commandCapabilitiesSchema = z27.object({
|
|
2375
|
+
operations: z27.array(cliOperationKindSchema).max(8),
|
|
2376
|
+
options: z27.array(z27.object({ flag: optionFlag, takesValue: z27.boolean() }).strict()).max(100).default([]),
|
|
2377
|
+
settings: z27.array(envKey).max(100).default([]),
|
|
2378
|
+
localFacts: z27.array(envKey).max(30).default([]),
|
|
2379
|
+
generatedPaths: z27.array(relativePath).max(50).default([]),
|
|
2380
|
+
outputModes: z27.array(z27.enum(["streaming", "completed"])).max(2).default([]),
|
|
2381
|
+
stdinFormats: z27.array(z27.enum(["text", "json", "jsonl"])).max(3).default([]),
|
|
2382
|
+
recipeIds: z27.array(token).max(50).default([])
|
|
2658
2383
|
}).strict();
|
|
2659
|
-
var cliTargetSchema =
|
|
2384
|
+
var cliTargetSchema = z27.object({
|
|
2660
2385
|
id: token,
|
|
2661
2386
|
vendor: token,
|
|
2662
2387
|
package: token,
|
|
@@ -2665,22 +2390,22 @@ var cliTargetSchema = z28.object({
|
|
|
2665
2390
|
artifactSha256: digest.nullable(),
|
|
2666
2391
|
entrypointSha256: digest.nullable(),
|
|
2667
2392
|
/** Trace-derived recognition hints. Actual bytes are captured by record mode. */
|
|
2668
|
-
discovery:
|
|
2393
|
+
discovery: z27.object({
|
|
2669
2394
|
ecosystem: token.nullable(),
|
|
2670
2395
|
program: token,
|
|
2671
|
-
executables:
|
|
2396
|
+
executables: z27.array(token).max(20)
|
|
2672
2397
|
}).strict().optional(),
|
|
2673
|
-
ownershipEvidence:
|
|
2674
|
-
entrypoints:
|
|
2398
|
+
ownershipEvidence: z27.string().min(1).max(2048),
|
|
2399
|
+
entrypoints: z27.array(z27.string().min(1).max(1024)).max(20),
|
|
2675
2400
|
/** Flags accepted before the subcommand, with explicit value arity. */
|
|
2676
|
-
globalOptions:
|
|
2677
|
-
launchForms:
|
|
2678
|
-
ioProfiles:
|
|
2679
|
-
commands:
|
|
2680
|
-
|
|
2401
|
+
globalOptions: z27.array(z27.object({ flag: optionFlag, takesValue: z27.boolean() }).strict()).max(100),
|
|
2402
|
+
launchForms: z27.array(cliLaunchFormSchema).min(1),
|
|
2403
|
+
ioProfiles: z27.array(cliIoProfileSchema).min(1),
|
|
2404
|
+
commands: z27.array(
|
|
2405
|
+
z27.object({
|
|
2681
2406
|
id: token,
|
|
2682
2407
|
/** Tokens following global options, before a literal `--`. */
|
|
2683
|
-
subcommand:
|
|
2408
|
+
subcommand: z27.array(token).max(8),
|
|
2684
2409
|
capabilities: commandCapabilitiesSchema
|
|
2685
2410
|
}).strict()
|
|
2686
2411
|
).min(1)
|
|
@@ -2760,11 +2485,11 @@ var cliTargetSchema = z28.object({
|
|
|
2760
2485
|
}
|
|
2761
2486
|
});
|
|
2762
2487
|
var CLI_CATALOG_MAX_TARGETS = 100;
|
|
2763
|
-
var cliCatalogSchema =
|
|
2764
|
-
version:
|
|
2488
|
+
var cliCatalogSchema = z27.object({
|
|
2489
|
+
version: z27.union([z27.literal(1), z27.literal(2)]),
|
|
2765
2490
|
engineVersion: token,
|
|
2766
2491
|
digest,
|
|
2767
|
-
targets:
|
|
2492
|
+
targets: z27.array(cliTargetSchema).max(CLI_CATALOG_MAX_TARGETS)
|
|
2768
2493
|
}).strict().superRefine((catalog, ctx) => {
|
|
2769
2494
|
if (catalog.version === 1 && (!catalog.targets.length || catalog.targets.some((target) => target.discovery)))
|
|
2770
2495
|
ctx.addIssue({
|
|
@@ -2780,15 +2505,15 @@ var cliCatalogSchema = z28.object({
|
|
|
2780
2505
|
});
|
|
2781
2506
|
});
|
|
2782
2507
|
});
|
|
2783
|
-
var exitPredicate =
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
kind:
|
|
2787
|
-
value:
|
|
2508
|
+
var exitPredicate = z27.discriminatedUnion("kind", [
|
|
2509
|
+
z27.object({ kind: z27.literal("any") }).strict(),
|
|
2510
|
+
z27.object({
|
|
2511
|
+
kind: z27.literal("code"),
|
|
2512
|
+
value: z27.number().int().min(0).max(255)
|
|
2788
2513
|
}).strict()
|
|
2789
2514
|
]);
|
|
2790
|
-
var outputStream =
|
|
2791
|
-
var literalEdit =
|
|
2515
|
+
var outputStream = z27.enum(["stdout", "stderr", "combined"]);
|
|
2516
|
+
var literalEdit = z27.object({ find: z27.string().min(1).max(8192), replace: z27.string().max(8192) }).strict();
|
|
2792
2517
|
function boundedOutputPattern(pattern) {
|
|
2793
2518
|
let at = pattern.startsWith("^") ? 1 : 0;
|
|
2794
2519
|
const end = pattern.endsWith("$") && pattern.length > at ? pattern.length - 1 : pattern.length;
|
|
@@ -2811,86 +2536,86 @@ function boundedOutputPattern(pattern) {
|
|
|
2811
2536
|
}
|
|
2812
2537
|
return literalBytes > 0;
|
|
2813
2538
|
}
|
|
2814
|
-
var operationSchema =
|
|
2815
|
-
|
|
2816
|
-
kind:
|
|
2539
|
+
var operationSchema = z27.discriminatedUnion("kind", [
|
|
2540
|
+
z27.object({
|
|
2541
|
+
kind: z27.literal("ensureOption"),
|
|
2817
2542
|
option: optionFlag,
|
|
2818
2543
|
value: sourcedValue.optional()
|
|
2819
2544
|
}).strict(),
|
|
2820
|
-
|
|
2821
|
-
kind:
|
|
2545
|
+
z27.object({
|
|
2546
|
+
kind: z27.literal("replaceOption"),
|
|
2822
2547
|
option: optionFlag,
|
|
2823
2548
|
value: sourcedValue
|
|
2824
2549
|
}).strict(),
|
|
2825
|
-
|
|
2826
|
-
kind:
|
|
2550
|
+
z27.object({
|
|
2551
|
+
kind: z27.literal("setEnv"),
|
|
2827
2552
|
key: envKey,
|
|
2828
2553
|
value: sourcedValue,
|
|
2829
|
-
whenAbsent:
|
|
2554
|
+
whenAbsent: z27.boolean()
|
|
2830
2555
|
}).strict(),
|
|
2831
|
-
|
|
2832
|
-
kind:
|
|
2556
|
+
z27.object({
|
|
2557
|
+
kind: z27.literal("streamOutput"),
|
|
2833
2558
|
stream: outputStream,
|
|
2834
2559
|
edit: literalEdit
|
|
2835
2560
|
}).strict(),
|
|
2836
|
-
|
|
2837
|
-
kind:
|
|
2561
|
+
z27.object({
|
|
2562
|
+
kind: z27.literal("completeOutput"),
|
|
2838
2563
|
stream: outputStream,
|
|
2839
|
-
matcher:
|
|
2840
|
-
|
|
2841
|
-
kind:
|
|
2842
|
-
text:
|
|
2564
|
+
matcher: z27.discriminatedUnion("kind", [
|
|
2565
|
+
z27.object({
|
|
2566
|
+
kind: z27.literal("literal"),
|
|
2567
|
+
text: z27.string().min(1).max(8192)
|
|
2843
2568
|
}).strict(),
|
|
2844
|
-
|
|
2845
|
-
kind:
|
|
2846
|
-
pattern:
|
|
2569
|
+
z27.object({
|
|
2570
|
+
kind: z27.literal("re2"),
|
|
2571
|
+
pattern: z27.string().min(1).max(2048).refine(
|
|
2847
2572
|
boundedOutputPattern,
|
|
2848
2573
|
"Use literals, anchors, and at most one greedy .*; escape literal regex punctuation"
|
|
2849
2574
|
)
|
|
2850
2575
|
}).strict()
|
|
2851
2576
|
]),
|
|
2852
|
-
replace:
|
|
2577
|
+
replace: z27.string().max(8192),
|
|
2853
2578
|
exit: exitPredicate
|
|
2854
2579
|
}).strict(),
|
|
2855
|
-
|
|
2856
|
-
kind:
|
|
2857
|
-
format:
|
|
2580
|
+
z27.object({
|
|
2581
|
+
kind: z27.literal("structuredStdin"),
|
|
2582
|
+
format: z27.enum(["text", "json", "jsonl"]),
|
|
2858
2583
|
payload: sourcedValue,
|
|
2859
|
-
timing:
|
|
2860
|
-
callerInput:
|
|
2861
|
-
eof:
|
|
2584
|
+
timing: z27.literal("onLaunch"),
|
|
2585
|
+
callerInput: z27.literal("replace"),
|
|
2586
|
+
eof: z27.literal("close")
|
|
2862
2587
|
}).strict(),
|
|
2863
|
-
|
|
2864
|
-
kind:
|
|
2588
|
+
z27.object({
|
|
2589
|
+
kind: z27.literal("promptRecipe"),
|
|
2865
2590
|
recipeId: token,
|
|
2866
|
-
steps:
|
|
2867
|
-
|
|
2868
|
-
prompt:
|
|
2591
|
+
steps: z27.array(
|
|
2592
|
+
z27.object({
|
|
2593
|
+
prompt: z27.string().min(1).max(4096),
|
|
2869
2594
|
response: sourcedValue,
|
|
2870
|
-
timeoutMs:
|
|
2595
|
+
timeoutMs: z27.number().int().min(1).max(12e4)
|
|
2871
2596
|
}).strict()
|
|
2872
2597
|
).min(1).max(20),
|
|
2873
|
-
overallTimeoutMs:
|
|
2874
|
-
completion:
|
|
2598
|
+
overallTimeoutMs: z27.number().int().min(1).max(6e5),
|
|
2599
|
+
completion: z27.string().min(1).max(4096)
|
|
2875
2600
|
}).strict(),
|
|
2876
|
-
|
|
2877
|
-
kind:
|
|
2601
|
+
z27.object({
|
|
2602
|
+
kind: z27.literal("generatedFile"),
|
|
2878
2603
|
path: relativePath,
|
|
2879
2604
|
beforeSha256: digest.nullable(),
|
|
2880
2605
|
generatedSha256: digest,
|
|
2881
2606
|
outcome: exitPredicate,
|
|
2882
2607
|
edit: literalEdit,
|
|
2883
|
-
required:
|
|
2608
|
+
required: z27.boolean()
|
|
2884
2609
|
}).strict()
|
|
2885
2610
|
]);
|
|
2886
|
-
var cliBaselineRecordFileSchema =
|
|
2887
|
-
pathIndex:
|
|
2611
|
+
var cliBaselineRecordFileSchema = z27.object({
|
|
2612
|
+
pathIndex: z27.number().int().nonnegative().max(49),
|
|
2888
2613
|
path: relativePath,
|
|
2889
|
-
status:
|
|
2614
|
+
status: z27.enum(["generated", "not-exercised"]),
|
|
2890
2615
|
beforeSha256: digest.nullable(),
|
|
2891
2616
|
generatedSha256: digest.nullable()
|
|
2892
2617
|
}).strict();
|
|
2893
|
-
var baselineInvocationSchema =
|
|
2618
|
+
var baselineInvocationSchema = z27.object({
|
|
2894
2619
|
runId: token,
|
|
2895
2620
|
invocationId: token,
|
|
2896
2621
|
targetId: token,
|
|
@@ -2901,33 +2626,33 @@ var baselineInvocationSchema = z28.object({
|
|
|
2901
2626
|
runtimeSha256: digest.optional(),
|
|
2902
2627
|
launchForm: cliLaunchFormSchema,
|
|
2903
2628
|
ioProfile: cliIoProfileSchema,
|
|
2904
|
-
recordFiles:
|
|
2629
|
+
recordFiles: z27.array(cliBaselineRecordFileSchema).max(50).default([])
|
|
2905
2630
|
}).strict();
|
|
2906
|
-
var cliInterventionSchema =
|
|
2907
|
-
schemaVersion:
|
|
2908
|
-
identityPolicy:
|
|
2631
|
+
var cliInterventionSchema = z27.object({
|
|
2632
|
+
schemaVersion: z27.union([z27.literal(1), z27.literal(2)]),
|
|
2633
|
+
identityPolicy: z27.literal("artifact").optional(),
|
|
2909
2634
|
engineVersion: token,
|
|
2910
2635
|
engineSha256: digest.nullable(),
|
|
2911
2636
|
bundleSha256: digest,
|
|
2912
2637
|
catalog: cliCatalogSchema,
|
|
2913
|
-
mode:
|
|
2914
|
-
captureProfiles:
|
|
2638
|
+
mode: z27.enum(["record", "trial"]),
|
|
2639
|
+
captureProfiles: z27.array(cliIoProfileSchema).min(1),
|
|
2915
2640
|
activeTargetId: token.nullable(),
|
|
2916
2641
|
activeCommandId: token.nullable(),
|
|
2917
|
-
selector:
|
|
2918
|
-
optionPresent:
|
|
2919
|
-
optionAbsent:
|
|
2642
|
+
selector: z27.object({
|
|
2643
|
+
optionPresent: z27.array(optionFlag).max(20),
|
|
2644
|
+
optionAbsent: z27.array(optionFlag).max(20)
|
|
2920
2645
|
}).strict().nullable(),
|
|
2921
|
-
baselineInvocations:
|
|
2922
|
-
operations:
|
|
2923
|
-
limits:
|
|
2924
|
-
completedStreamBytes:
|
|
2925
|
-
replacementBytes:
|
|
2926
|
-
generatedFileBytes:
|
|
2927
|
-
generatedAggregateBytes:
|
|
2928
|
-
generatedFileCount:
|
|
2646
|
+
baselineInvocations: z27.array(baselineInvocationSchema).max(500),
|
|
2647
|
+
operations: z27.array(operationSchema).max(50),
|
|
2648
|
+
limits: z27.object({
|
|
2649
|
+
completedStreamBytes: z27.number().int().min(1).max(2 * 1024 * 1024),
|
|
2650
|
+
replacementBytes: z27.number().int().min(1).max(8192),
|
|
2651
|
+
generatedFileBytes: z27.number().int().min(1).max(2 * 1024 * 1024),
|
|
2652
|
+
generatedAggregateBytes: z27.number().int().min(1).max(8 * 1024 * 1024),
|
|
2653
|
+
generatedFileCount: z27.number().int().min(1).max(50)
|
|
2929
2654
|
}).strict(),
|
|
2930
|
-
shippingIntent:
|
|
2655
|
+
shippingIntent: z27.enum([
|
|
2931
2656
|
"default",
|
|
2932
2657
|
"message",
|
|
2933
2658
|
"interaction",
|
|
@@ -3128,7 +2853,7 @@ var cliInterventionSchema = z28.object({
|
|
|
3128
2853
|
"Generated file count exceeds limit"
|
|
3129
2854
|
);
|
|
3130
2855
|
});
|
|
3131
|
-
var cliTrialChangeSchema =
|
|
2856
|
+
var cliTrialChangeSchema = z27.object({
|
|
3132
2857
|
targetId: token,
|
|
3133
2858
|
commandId: token,
|
|
3134
2859
|
selector: cliInterventionSchema.shape.selector.unwrap(),
|
|
@@ -3137,7 +2862,7 @@ var cliTrialChangeSchema = z28.object({
|
|
|
3137
2862
|
}).strict();
|
|
3138
2863
|
|
|
3139
2864
|
// ../packages/api-schemas/src/climb.ts
|
|
3140
|
-
import { z as
|
|
2865
|
+
import { z as z29 } from "zod";
|
|
3141
2866
|
|
|
3142
2867
|
// ../packages/api-schemas/src/climb-kinds.ts
|
|
3143
2868
|
var LEVER_KINDS = [
|
|
@@ -3167,35 +2892,35 @@ var LEVER_INTERVENTIONS = {
|
|
|
3167
2892
|
};
|
|
3168
2893
|
|
|
3169
2894
|
// ../packages/api-schemas/src/sandbox-overrides.ts
|
|
3170
|
-
import { z as
|
|
2895
|
+
import { z as z28 } from "zod";
|
|
3171
2896
|
var SANDBOX_OVERRIDE_KINDS = ["packages", "clis"];
|
|
3172
|
-
var ecosystemSchema =
|
|
3173
|
-
var overrideFilesSchema =
|
|
3174
|
-
|
|
3175
|
-
path:
|
|
2897
|
+
var ecosystemSchema = z28.enum(["npm", "pypi", "cargo", "go", "gem"]);
|
|
2898
|
+
var overrideFilesSchema = z28.array(
|
|
2899
|
+
z28.object({
|
|
2900
|
+
path: z28.string().min(1).refine(
|
|
3176
2901
|
(path2) => !path2.startsWith("/") && !path2.includes("\\") && !path2.split("/").includes(".."),
|
|
3177
2902
|
"Use a relative path within the target"
|
|
3178
2903
|
),
|
|
3179
|
-
body:
|
|
2904
|
+
body: z28.string()
|
|
3180
2905
|
}).strict()
|
|
3181
2906
|
).min(1);
|
|
3182
2907
|
var contentShape = {
|
|
3183
|
-
version:
|
|
2908
|
+
version: z28.string().trim().min(1).optional(),
|
|
3184
2909
|
files: overrideFilesSchema.optional()
|
|
3185
2910
|
};
|
|
3186
2911
|
var hasContent = (value) => value.version !== void 0 || value.files !== void 0;
|
|
3187
|
-
var sandboxOverridesSchema =
|
|
3188
|
-
version:
|
|
3189
|
-
packages:
|
|
3190
|
-
|
|
2912
|
+
var sandboxOverridesSchema = z28.object({
|
|
2913
|
+
version: z28.literal(1),
|
|
2914
|
+
packages: z28.array(
|
|
2915
|
+
z28.object({
|
|
3191
2916
|
ecosystem: ecosystemSchema,
|
|
3192
|
-
name:
|
|
2917
|
+
name: z28.string().trim().min(1),
|
|
3193
2918
|
...contentShape
|
|
3194
2919
|
}).strict().refine(hasContent, "Specify a version or files")
|
|
3195
2920
|
).optional(),
|
|
3196
|
-
clis:
|
|
3197
|
-
|
|
3198
|
-
name:
|
|
2921
|
+
clis: z28.array(
|
|
2922
|
+
z28.object({
|
|
2923
|
+
name: z28.string().trim().min(1),
|
|
3199
2924
|
...contentShape
|
|
3200
2925
|
}).strict().refine(hasContent, "Specify a version or files")
|
|
3201
2926
|
).optional()
|
|
@@ -3222,11 +2947,11 @@ var sandboxOverridesSchema = z29.object({
|
|
|
3222
2947
|
});
|
|
3223
2948
|
|
|
3224
2949
|
// ../packages/api-schemas/src/climb.ts
|
|
3225
|
-
var climbSubjectKindSchema =
|
|
3226
|
-
var leverKindSchema =
|
|
3227
|
-
var interventionKindSchema =
|
|
3228
|
-
var skill =
|
|
3229
|
-
var empty =
|
|
2950
|
+
var climbSubjectKindSchema = z29.enum(["EVAL_SET", "VISIBILITY_PROMPT"]);
|
|
2951
|
+
var leverKindSchema = z29.enum(LEVER_KINDS);
|
|
2952
|
+
var interventionKindSchema = z29.enum(INTERVENTION_KINDS);
|
|
2953
|
+
var skill = z29.object({ skillVersionId: z29.string().min(1) }).strict();
|
|
2954
|
+
var empty = z29.object({}).strict();
|
|
3230
2955
|
function validateFixtureIntervention(value, ctx) {
|
|
3231
2956
|
const result = webFixtureSchema.safeParse({ version: 1, ...value });
|
|
3232
2957
|
if (!result.success) {
|
|
@@ -3239,75 +2964,75 @@ function validateFixtureIntervention(value, ctx) {
|
|
|
3239
2964
|
}
|
|
3240
2965
|
}
|
|
3241
2966
|
}
|
|
3242
|
-
var interventionSchema =
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
kind:
|
|
3249
|
-
before:
|
|
3250
|
-
after:
|
|
2967
|
+
var interventionSchema = z29.discriminatedUnion("kind", [
|
|
2968
|
+
z29.object({ kind: z29.literal("BASELINE"), after: empty }),
|
|
2969
|
+
z29.object({ kind: z29.literal("ADD_SKILL"), after: skill }),
|
|
2970
|
+
z29.object({ kind: z29.literal("REMOVE_SKILL"), before: skill, after: empty }),
|
|
2971
|
+
z29.object({ kind: z29.literal("EDIT_SKILL"), before: skill, after: skill }),
|
|
2972
|
+
z29.object({
|
|
2973
|
+
kind: z29.literal("REWRITE_DOCS"),
|
|
2974
|
+
before: z29.json().optional(),
|
|
2975
|
+
after: z29.object({ pages: webFixtureSchema.shape.pages.unwrap().min(1) }).strict().superRefine(validateFixtureIntervention)
|
|
3251
2976
|
}),
|
|
3252
|
-
|
|
3253
|
-
kind:
|
|
3254
|
-
after:
|
|
2977
|
+
z29.object({
|
|
2978
|
+
kind: z29.literal("PACKAGE_VERSION"),
|
|
2979
|
+
after: z29.object({
|
|
3255
2980
|
ecosystem: ecosystemSchema,
|
|
3256
|
-
name:
|
|
3257
|
-
version:
|
|
2981
|
+
name: z29.string().min(1),
|
|
2982
|
+
version: z29.string().min(1)
|
|
3258
2983
|
}).strict()
|
|
3259
2984
|
}),
|
|
3260
|
-
|
|
3261
|
-
kind:
|
|
3262
|
-
after:
|
|
2985
|
+
z29.object({
|
|
2986
|
+
kind: z29.literal("PACKAGE_CONTENT"),
|
|
2987
|
+
after: z29.object({
|
|
3263
2988
|
ecosystem: ecosystemSchema,
|
|
3264
|
-
name:
|
|
2989
|
+
name: z29.string().min(1),
|
|
3265
2990
|
files: overrideFilesSchema
|
|
3266
2991
|
}).strict()
|
|
3267
2992
|
}),
|
|
3268
|
-
|
|
3269
|
-
kind:
|
|
3270
|
-
after:
|
|
2993
|
+
z29.object({
|
|
2994
|
+
kind: z29.literal("CLI_VERSION"),
|
|
2995
|
+
after: z29.object({ name: z29.string().min(1), version: z29.string().min(1) }).strict()
|
|
3271
2996
|
}),
|
|
3272
|
-
|
|
3273
|
-
kind:
|
|
2997
|
+
z29.object({
|
|
2998
|
+
kind: z29.literal("CLI_INTERVENTION"),
|
|
3274
2999
|
after: cliInterventionSchema.refine((bundle) => bundle.mode === "trial", {
|
|
3275
3000
|
message: "A CLI trial requires a trial-mode bundle"
|
|
3276
3001
|
})
|
|
3277
3002
|
})
|
|
3278
3003
|
]);
|
|
3279
|
-
var climbSettingsSchema =
|
|
3280
|
-
maxRounds:
|
|
3281
|
-
sampleCount:
|
|
3282
|
-
creditCap:
|
|
3283
|
-
targetScore:
|
|
3004
|
+
var climbSettingsSchema = z29.object({
|
|
3005
|
+
maxRounds: z29.number().int().positive().default(5),
|
|
3006
|
+
sampleCount: z29.number().int().positive().default(1),
|
|
3007
|
+
creditCap: z29.number().int().nonnegative(),
|
|
3008
|
+
targetScore: z29.number().min(0).max(1).default(1),
|
|
3284
3009
|
// Narrow the subject's whole roster to one slot, for the baseline and every
|
|
3285
3010
|
// trial alike. A subject rostering ten models otherwise multiplies every
|
|
3286
3011
|
// trial by ten, and a one-model trial measured against a ten-model baseline
|
|
3287
3012
|
// is not a comparison. `pinnedModel` empty means the agent's default model.
|
|
3288
3013
|
pinnedAgent: schedulableAgentSchema.optional(),
|
|
3289
|
-
pinnedModel:
|
|
3290
|
-
maxTrialsPerRound:
|
|
3014
|
+
pinnedModel: z29.string().optional(),
|
|
3015
|
+
maxTrialsPerRound: z29.number().int().min(1).max(10).default(3),
|
|
3291
3016
|
// The round a continuation started at; the no-improvement counter
|
|
3292
3017
|
// restarts here.
|
|
3293
|
-
continuedAtRound:
|
|
3018
|
+
continuedAtRound: z29.number().int().nonnegative().optional()
|
|
3294
3019
|
}).strip().refine((value) => value.pinnedAgent !== void 0 || !value.pinnedModel, {
|
|
3295
3020
|
path: ["pinnedAgent"],
|
|
3296
3021
|
message: "Pin an agent with the model"
|
|
3297
3022
|
});
|
|
3298
|
-
var climbDirectionSchema =
|
|
3299
|
-
focus:
|
|
3300
|
-
preserve:
|
|
3301
|
-
exclude:
|
|
3302
|
-
notes:
|
|
3303
|
-
});
|
|
3304
|
-
var climbDirectionPatchSchema =
|
|
3305
|
-
focus:
|
|
3306
|
-
preserve:
|
|
3307
|
-
exclude:
|
|
3308
|
-
notes:
|
|
3023
|
+
var climbDirectionSchema = z29.object({
|
|
3024
|
+
focus: z29.string().trim().max(2e3).nullable().default(null),
|
|
3025
|
+
preserve: z29.array(z29.string().trim().min(1).max(500)).max(20).default([]),
|
|
3026
|
+
exclude: z29.array(z29.string().trim().min(1).max(500)).max(20).default([]),
|
|
3027
|
+
notes: z29.string().trim().max(4e3).nullable().default(null)
|
|
3028
|
+
});
|
|
3029
|
+
var climbDirectionPatchSchema = z29.object({
|
|
3030
|
+
focus: z29.string().trim().max(2e3).nullable().optional(),
|
|
3031
|
+
preserve: z29.array(z29.string().trim().min(1).max(500)).max(20).optional(),
|
|
3032
|
+
exclude: z29.array(z29.string().trim().min(1).max(500)).max(20).optional(),
|
|
3033
|
+
notes: z29.string().trim().max(4e3).nullable().optional(),
|
|
3309
3034
|
/** One line on why this was recorded; becomes the DIRECTION row summary. */
|
|
3310
|
-
rationale:
|
|
3035
|
+
rationale: z29.string().trim().max(500).optional()
|
|
3311
3036
|
}).strict();
|
|
3312
3037
|
var CLIMB_ACTIVITY_KINDS = [
|
|
3313
3038
|
"STARTED",
|
|
@@ -3326,74 +3051,74 @@ var CLIMB_ACTIVITY_KINDS = [
|
|
|
3326
3051
|
"CONTINUED",
|
|
3327
3052
|
"CANCELED"
|
|
3328
3053
|
];
|
|
3329
|
-
var climbActivityKindSchema =
|
|
3330
|
-
var proposerTraceStepSchema =
|
|
3331
|
-
tool:
|
|
3332
|
-
args:
|
|
3333
|
-
result:
|
|
3334
|
-
isError:
|
|
3335
|
-
});
|
|
3336
|
-
var proposerTraceSchema =
|
|
3337
|
-
steps:
|
|
3338
|
-
reasoning:
|
|
3339
|
-
durationMs:
|
|
3340
|
-
model:
|
|
3341
|
-
});
|
|
3342
|
-
var climbActivitySchema =
|
|
3343
|
-
id:
|
|
3344
|
-
climbId:
|
|
3345
|
-
roundId:
|
|
3346
|
-
trialId:
|
|
3054
|
+
var climbActivityKindSchema = z29.enum(CLIMB_ACTIVITY_KINDS);
|
|
3055
|
+
var proposerTraceStepSchema = z29.object({
|
|
3056
|
+
tool: z29.string(),
|
|
3057
|
+
args: z29.string(),
|
|
3058
|
+
result: z29.string().nullable(),
|
|
3059
|
+
isError: z29.boolean().optional()
|
|
3060
|
+
});
|
|
3061
|
+
var proposerTraceSchema = z29.object({
|
|
3062
|
+
steps: z29.array(proposerTraceStepSchema),
|
|
3063
|
+
reasoning: z29.string(),
|
|
3064
|
+
durationMs: z29.number().int().nonnegative(),
|
|
3065
|
+
model: z29.string()
|
|
3066
|
+
});
|
|
3067
|
+
var climbActivitySchema = z29.object({
|
|
3068
|
+
id: z29.string(),
|
|
3069
|
+
climbId: z29.string(),
|
|
3070
|
+
roundId: z29.string().nullable(),
|
|
3071
|
+
trialId: z29.string().nullable(),
|
|
3347
3072
|
kind: climbActivityKindSchema,
|
|
3348
|
-
actorUserId:
|
|
3349
|
-
actorName:
|
|
3350
|
-
summary:
|
|
3351
|
-
detail:
|
|
3352
|
-
createdAt:
|
|
3353
|
-
});
|
|
3354
|
-
var activityQuerySchema =
|
|
3355
|
-
after:
|
|
3356
|
-
limit:
|
|
3357
|
-
});
|
|
3358
|
-
var climbConfigSnapshotSchema =
|
|
3359
|
-
promptText:
|
|
3360
|
-
scenario:
|
|
3361
|
-
repoUrl:
|
|
3362
|
-
repoRef:
|
|
3363
|
-
profileId:
|
|
3364
|
-
profileName:
|
|
3365
|
-
profileDescription:
|
|
3366
|
-
profileModel:
|
|
3367
|
-
limits:
|
|
3368
|
-
agents:
|
|
3369
|
-
skillRefs:
|
|
3370
|
-
mcpRefs:
|
|
3371
|
-
skillVersionIds:
|
|
3372
|
-
mcpServerVersionIds:
|
|
3373
|
-
skillSet:
|
|
3374
|
-
mcpSet:
|
|
3375
|
-
connectionIds:
|
|
3376
|
-
connectionSet:
|
|
3377
|
-
agentContext:
|
|
3378
|
-
agentContextDigest:
|
|
3073
|
+
actorUserId: z29.string().nullable(),
|
|
3074
|
+
actorName: z29.string().nullable(),
|
|
3075
|
+
summary: z29.string(),
|
|
3076
|
+
detail: z29.unknown().nullable(),
|
|
3077
|
+
createdAt: z29.string()
|
|
3078
|
+
});
|
|
3079
|
+
var activityQuerySchema = z29.object({
|
|
3080
|
+
after: z29.string().datetime().optional(),
|
|
3081
|
+
limit: z29.coerce.number().int().min(1).max(500).default(500)
|
|
3082
|
+
});
|
|
3083
|
+
var climbConfigSnapshotSchema = z29.object({
|
|
3084
|
+
promptText: z29.string(),
|
|
3085
|
+
scenario: z29.enum(["GREENFIELD", "MIGRATION"]),
|
|
3086
|
+
repoUrl: z29.string().nullable(),
|
|
3087
|
+
repoRef: z29.string().nullable(),
|
|
3088
|
+
profileId: z29.string().nullable(),
|
|
3089
|
+
profileName: z29.string().nullable(),
|
|
3090
|
+
profileDescription: z29.string().nullable(),
|
|
3091
|
+
profileModel: z29.string().nullable(),
|
|
3092
|
+
limits: z29.json(),
|
|
3093
|
+
agents: z29.array(agentConfigSchema).min(1),
|
|
3094
|
+
skillRefs: z29.array(z29.string()),
|
|
3095
|
+
mcpRefs: z29.array(z29.string()),
|
|
3096
|
+
skillVersionIds: z29.array(z29.string()),
|
|
3097
|
+
mcpServerVersionIds: z29.array(z29.string()),
|
|
3098
|
+
skillSet: z29.json().nullable(),
|
|
3099
|
+
mcpSet: z29.json().nullable(),
|
|
3100
|
+
connectionIds: z29.array(z29.string()),
|
|
3101
|
+
connectionSet: z29.json().nullable(),
|
|
3102
|
+
agentContext: z29.json().nullable(),
|
|
3103
|
+
agentContextDigest: z29.string().nullable(),
|
|
3379
3104
|
webFixture: webFixtureSchema.nullable(),
|
|
3380
3105
|
cliIntervention: cliInterventionSchema.nullable().default(null),
|
|
3381
3106
|
sandboxOverrides: sandboxOverridesSchema.nullable(),
|
|
3382
|
-
visibilityScenarioId:
|
|
3107
|
+
visibilityScenarioId: z29.string().nullable()
|
|
3383
3108
|
}).strict();
|
|
3384
|
-
var targetRefSchema =
|
|
3385
|
-
kind:
|
|
3386
|
-
id:
|
|
3387
|
-
url:
|
|
3388
|
-
package:
|
|
3109
|
+
var targetRefSchema = z29.object({
|
|
3110
|
+
kind: z29.string().min(1),
|
|
3111
|
+
id: z29.string().optional(),
|
|
3112
|
+
url: z29.url().optional(),
|
|
3113
|
+
package: z29.string().optional()
|
|
3389
3114
|
}).strict();
|
|
3390
|
-
var trialInputSchema =
|
|
3391
|
-
title:
|
|
3392
|
-
hypothesis:
|
|
3115
|
+
var trialInputSchema = z29.object({
|
|
3116
|
+
title: z29.string().trim().min(1).max(200),
|
|
3117
|
+
hypothesis: z29.string().max(4e3).optional(),
|
|
3393
3118
|
lever: leverKindSchema,
|
|
3394
3119
|
targetRef: targetRefSchema.optional(),
|
|
3395
3120
|
intervention: interventionSchema,
|
|
3396
|
-
authorMode:
|
|
3121
|
+
authorMode: z29.enum(["MANUAL", "DIRECT", "PROPOSE"]).default("MANUAL")
|
|
3397
3122
|
}).strict().superRefine((value, ctx) => {
|
|
3398
3123
|
const allowed = LEVER_INTERVENTIONS[value.lever];
|
|
3399
3124
|
if (!allowed.includes(value.intervention.kind))
|
|
@@ -3412,7 +3137,7 @@ var OPTIMIZATION_STATUSES = [
|
|
|
3412
3137
|
"DONE",
|
|
3413
3138
|
"ARCHIVED"
|
|
3414
3139
|
];
|
|
3415
|
-
var optimizationStatusSchema =
|
|
3140
|
+
var optimizationStatusSchema = z30.enum(OPTIMIZATION_STATUSES);
|
|
3416
3141
|
var ROUND_STATUSES = [
|
|
3417
3142
|
"PROPOSING",
|
|
3418
3143
|
"PROPOSED",
|
|
@@ -3441,61 +3166,61 @@ var OPTIMIZATION_EFFORTS = [
|
|
|
3441
3166
|
{ value: "HIGH", label: "Thorough", sampleCount: 2, maxRounds: 8 },
|
|
3442
3167
|
{ value: "XHIGH", label: "Exhaustive", sampleCount: 3, maxRounds: 12 }
|
|
3443
3168
|
];
|
|
3444
|
-
var optimizationEffortSchema =
|
|
3169
|
+
var optimizationEffortSchema = z30.enum(
|
|
3445
3170
|
OPTIMIZATION_EFFORTS.map((preset) => preset.value)
|
|
3446
3171
|
);
|
|
3447
|
-
var listOptimizationsQuerySchema =
|
|
3448
|
-
status:
|
|
3172
|
+
var listOptimizationsQuerySchema = z30.object({
|
|
3173
|
+
status: z30.string().optional().transform(
|
|
3449
3174
|
(value) => value ? value.split(",").map((part) => part.trim().toUpperCase()).filter(Boolean) : void 0
|
|
3450
|
-
).pipe(
|
|
3175
|
+
).pipe(z30.array(optimizationStatusSchema).optional()),
|
|
3451
3176
|
subjectKind: climbSubjectKindSchema.optional(),
|
|
3452
|
-
subjectId:
|
|
3453
|
-
limit:
|
|
3177
|
+
subjectId: z30.string().min(1).optional(),
|
|
3178
|
+
limit: z30.coerce.number().int().min(1).max(200).default(50),
|
|
3454
3179
|
/** Drafts are workspaces, not runs; older clients never see them. */
|
|
3455
|
-
includeDrafts:
|
|
3180
|
+
includeDrafts: z30.union([z30.boolean(), z30.string()]).optional().transform((value) => value === true || value === "true" || value === "1")
|
|
3456
3181
|
});
|
|
3457
|
-
var optimizationSummarySchema =
|
|
3458
|
-
id:
|
|
3459
|
-
name:
|
|
3182
|
+
var optimizationSummarySchema = z30.object({
|
|
3183
|
+
id: z30.string(),
|
|
3184
|
+
name: z30.string(),
|
|
3460
3185
|
status: optimizationStatusSchema,
|
|
3461
|
-
mode:
|
|
3186
|
+
mode: z30.enum(["MANUAL", "AUTO"]),
|
|
3462
3187
|
/** Autonomous launches every proposed round; interactive waits for one. */
|
|
3463
|
-
autonomous:
|
|
3464
|
-
stopReason:
|
|
3188
|
+
autonomous: z30.boolean(),
|
|
3189
|
+
stopReason: z30.string().nullable(),
|
|
3465
3190
|
subjectKind: climbSubjectKindSchema,
|
|
3466
|
-
subjectId:
|
|
3467
|
-
subjectName:
|
|
3191
|
+
subjectId: z30.string(),
|
|
3192
|
+
subjectName: z30.string(),
|
|
3468
3193
|
lever: leverKindSchema.nullable(),
|
|
3469
|
-
round:
|
|
3470
|
-
maxRounds:
|
|
3194
|
+
round: z30.number().int(),
|
|
3195
|
+
maxRounds: z30.number().int(),
|
|
3471
3196
|
/** Starting baseline score, 0..1. */
|
|
3472
|
-
before:
|
|
3197
|
+
before: z30.number().nullable(),
|
|
3473
3198
|
/** Score of the marked winner, or best BETTER trial, 0..1. */
|
|
3474
|
-
after:
|
|
3199
|
+
after: z30.number().nullable(),
|
|
3475
3200
|
/** Percentage-point change from the baseline to the winner or best BETTER trial. */
|
|
3476
|
-
delta:
|
|
3201
|
+
delta: z30.number().nullable(),
|
|
3477
3202
|
/** Score after each round, baseline first. */
|
|
3478
|
-
path:
|
|
3479
|
-
creditsSpent:
|
|
3480
|
-
creditsReserved:
|
|
3481
|
-
summary:
|
|
3482
|
-
href:
|
|
3483
|
-
createdAt:
|
|
3484
|
-
updatedAt:
|
|
3485
|
-
});
|
|
3486
|
-
var listOptimizationsResponseSchema =
|
|
3487
|
-
items:
|
|
3488
|
-
});
|
|
3489
|
-
var targetSchema =
|
|
3203
|
+
path: z30.array(z30.number()),
|
|
3204
|
+
creditsSpent: z30.number().int(),
|
|
3205
|
+
creditsReserved: z30.number().int(),
|
|
3206
|
+
summary: z30.string().nullable(),
|
|
3207
|
+
href: z30.string(),
|
|
3208
|
+
createdAt: z30.string(),
|
|
3209
|
+
updatedAt: z30.string()
|
|
3210
|
+
});
|
|
3211
|
+
var listOptimizationsResponseSchema = z30.object({
|
|
3212
|
+
items: z30.array(optimizationSummarySchema)
|
|
3213
|
+
});
|
|
3214
|
+
var targetSchema = z30.object({
|
|
3490
3215
|
agent: schedulableAgentSchema.optional(),
|
|
3491
3216
|
/** Empty or omitted means the agent's default model. */
|
|
3492
|
-
model:
|
|
3217
|
+
model: z30.string().optional()
|
|
3493
3218
|
});
|
|
3494
3219
|
var planShape = {
|
|
3495
3220
|
effort: optimizationEffortSchema.optional(),
|
|
3496
|
-
sampleCount:
|
|
3497
|
-
maxRounds:
|
|
3498
|
-
maxTrialsPerRound:
|
|
3221
|
+
sampleCount: z30.number().int().min(1).max(100).optional(),
|
|
3222
|
+
maxRounds: z30.number().int().min(1).max(100).optional(),
|
|
3223
|
+
maxTrialsPerRound: z30.number().int().min(1).max(10).optional()
|
|
3499
3224
|
};
|
|
3500
3225
|
function refinePlan(value, ctx) {
|
|
3501
3226
|
if (value.effort && (value.sampleCount || value.maxRounds))
|
|
@@ -3511,18 +3236,18 @@ function refinePlan(value, ctx) {
|
|
|
3511
3236
|
message: "Pin an agent with the model"
|
|
3512
3237
|
});
|
|
3513
3238
|
}
|
|
3514
|
-
var startOptimizationBodySchema =
|
|
3239
|
+
var startOptimizationBodySchema = z30.object({
|
|
3515
3240
|
subjectKind: climbSubjectKindSchema,
|
|
3516
|
-
subjectId:
|
|
3517
|
-
name:
|
|
3241
|
+
subjectId: z30.string().min(1),
|
|
3242
|
+
name: z30.string().trim().min(1).max(200).optional(),
|
|
3518
3243
|
...planShape,
|
|
3519
|
-
creditCap:
|
|
3520
|
-
targetScore:
|
|
3244
|
+
creditCap: z30.number().int().nonnegative().optional(),
|
|
3245
|
+
targetScore: z30.number().min(0).max(1).optional(),
|
|
3521
3246
|
target: targetSchema.extend({ agent: schedulableAgentSchema })
|
|
3522
3247
|
}).strict().superRefine(refinePlan);
|
|
3523
|
-
var estimateOptimizationBodySchema =
|
|
3248
|
+
var estimateOptimizationBodySchema = z30.object({
|
|
3524
3249
|
subjectKind: climbSubjectKindSchema,
|
|
3525
|
-
subjectId:
|
|
3250
|
+
subjectId: z30.string().min(1),
|
|
3526
3251
|
...planShape,
|
|
3527
3252
|
target: targetSchema.optional()
|
|
3528
3253
|
}).strict().superRefine(refinePlan);
|
|
@@ -3534,101 +3259,101 @@ var RUN_CREDIT_BASES = [
|
|
|
3534
3259
|
"byok",
|
|
3535
3260
|
"reserve"
|
|
3536
3261
|
];
|
|
3537
|
-
var runCreditBasisSchema =
|
|
3538
|
-
var optimizationEstimateSchema =
|
|
3539
|
-
sampleCount:
|
|
3540
|
-
maxRounds:
|
|
3541
|
-
runsPerTrial:
|
|
3542
|
-
executionCredits:
|
|
3543
|
-
judgeCredits:
|
|
3544
|
-
leverPassCredits:
|
|
3545
|
-
trialCredits:
|
|
3262
|
+
var runCreditBasisSchema = z30.enum(RUN_CREDIT_BASES);
|
|
3263
|
+
var optimizationEstimateSchema = z30.object({
|
|
3264
|
+
sampleCount: z30.number().int(),
|
|
3265
|
+
maxRounds: z30.number().int(),
|
|
3266
|
+
runsPerTrial: z30.number(),
|
|
3267
|
+
executionCredits: z30.number(),
|
|
3268
|
+
judgeCredits: z30.number(),
|
|
3269
|
+
leverPassCredits: z30.number(),
|
|
3270
|
+
trialCredits: z30.number(),
|
|
3546
3271
|
/** Estimate, not a reservation or enforced spending cap. */
|
|
3547
|
-
estimate:
|
|
3272
|
+
estimate: z30.number().int(),
|
|
3548
3273
|
/** True when no price or history covered a model: a bound, not a forecast. */
|
|
3549
|
-
approximate:
|
|
3274
|
+
approximate: z30.boolean().default(false),
|
|
3550
3275
|
/** Which rung priced the run, so the UI can say why a figure is what it is. */
|
|
3551
3276
|
basis: runCreditBasisSchema.optional()
|
|
3552
3277
|
});
|
|
3553
|
-
var diagnoseBodySchema =
|
|
3278
|
+
var diagnoseBodySchema = z30.object({
|
|
3554
3279
|
subjectKind: climbSubjectKindSchema,
|
|
3555
|
-
subjectId:
|
|
3280
|
+
subjectId: z30.string().min(1)
|
|
3556
3281
|
}).strict();
|
|
3557
|
-
var diagnosisSchema =
|
|
3558
|
-
id:
|
|
3559
|
-
status:
|
|
3282
|
+
var diagnosisSchema = z30.object({
|
|
3283
|
+
id: z30.string(),
|
|
3284
|
+
status: z30.enum(["GENERATING", "READY", "FAILED"]),
|
|
3560
3285
|
subjectKind: climbSubjectKindSchema,
|
|
3561
|
-
subjectId:
|
|
3562
|
-
runCount:
|
|
3563
|
-
summary:
|
|
3286
|
+
subjectId: z30.string(),
|
|
3287
|
+
runCount: z30.number().int(),
|
|
3288
|
+
summary: z30.string().nullable(),
|
|
3564
3289
|
recommendedLever: leverKindSchema.nullable(),
|
|
3565
|
-
recommendedTarget:
|
|
3566
|
-
clusters:
|
|
3567
|
-
|
|
3568
|
-
title:
|
|
3569
|
-
failureMode:
|
|
3570
|
-
criterionIds:
|
|
3571
|
-
runIds:
|
|
3290
|
+
recommendedTarget: z30.unknown().nullable(),
|
|
3291
|
+
clusters: z30.array(
|
|
3292
|
+
z30.object({
|
|
3293
|
+
title: z30.string(),
|
|
3294
|
+
failureMode: z30.string(),
|
|
3295
|
+
criterionIds: z30.array(z30.string()),
|
|
3296
|
+
runIds: z30.array(z30.string()),
|
|
3572
3297
|
lever: leverKindSchema.nullable(),
|
|
3573
|
-
targetRef:
|
|
3574
|
-
confidence:
|
|
3298
|
+
targetRef: z30.unknown().nullable(),
|
|
3299
|
+
confidence: z30.number()
|
|
3575
3300
|
})
|
|
3576
3301
|
),
|
|
3577
|
-
unsupportedLevers:
|
|
3578
|
-
createdAt:
|
|
3302
|
+
unsupportedLevers: z30.array(leverKindSchema).default([]),
|
|
3303
|
+
createdAt: z30.string()
|
|
3579
3304
|
});
|
|
3580
|
-
var trialRunSchema =
|
|
3581
|
-
id:
|
|
3582
|
-
status:
|
|
3305
|
+
var trialRunSchema = z30.object({
|
|
3306
|
+
id: z30.string(),
|
|
3307
|
+
status: z30.string(),
|
|
3583
3308
|
cliCoverage: cliCoverageSchema.nullable().optional(),
|
|
3584
|
-
passed:
|
|
3585
|
-
criteria:
|
|
3586
|
-
|
|
3309
|
+
passed: z30.boolean().nullable(),
|
|
3310
|
+
criteria: z30.array(
|
|
3311
|
+
z30.object({ name: z30.string(), passed: z30.boolean(), reasoning: z30.string() })
|
|
3587
3312
|
),
|
|
3588
|
-
levers:
|
|
3589
|
-
|
|
3590
|
-
lever:
|
|
3591
|
-
attributed:
|
|
3592
|
-
note:
|
|
3313
|
+
levers: z30.array(
|
|
3314
|
+
z30.object({
|
|
3315
|
+
lever: z30.string(),
|
|
3316
|
+
attributed: z30.boolean(),
|
|
3317
|
+
note: z30.string().nullable()
|
|
3593
3318
|
})
|
|
3594
3319
|
)
|
|
3595
3320
|
});
|
|
3596
|
-
var trialSchema =
|
|
3597
|
-
id:
|
|
3598
|
-
climbId:
|
|
3599
|
-
roundNumber:
|
|
3600
|
-
key:
|
|
3321
|
+
var trialSchema = z30.object({
|
|
3322
|
+
id: z30.string(),
|
|
3323
|
+
climbId: z30.string(),
|
|
3324
|
+
roundNumber: z30.number().int(),
|
|
3325
|
+
key: z30.string(),
|
|
3601
3326
|
/** @deprecated All trials branch from the baseline. */
|
|
3602
|
-
parentTrialId:
|
|
3327
|
+
parentTrialId: z30.string().nullable(),
|
|
3603
3328
|
/** @deprecated Always the baseline key for non-baseline trials. */
|
|
3604
|
-
parentKey:
|
|
3605
|
-
title:
|
|
3606
|
-
hypothesis:
|
|
3329
|
+
parentKey: z30.string().nullable(),
|
|
3330
|
+
title: z30.string(),
|
|
3331
|
+
hypothesis: z30.string().nullable(),
|
|
3607
3332
|
lever: leverKindSchema.nullable(),
|
|
3608
3333
|
kind: interventionKindSchema,
|
|
3609
|
-
status:
|
|
3610
|
-
verdict:
|
|
3611
|
-
score:
|
|
3612
|
-
baselineScore:
|
|
3334
|
+
status: z30.enum(TRIAL_STATUSES),
|
|
3335
|
+
verdict: z30.enum(TRIAL_VERDICTS).nullable(),
|
|
3336
|
+
score: z30.number().nullable(),
|
|
3337
|
+
baselineScore: z30.number().nullable(),
|
|
3613
3338
|
/** Judged sessions behind `score`. */
|
|
3614
|
-
sessions:
|
|
3615
|
-
isBaseline:
|
|
3339
|
+
sessions: z30.number().int(),
|
|
3340
|
+
isBaseline: z30.boolean(),
|
|
3616
3341
|
/** The user marked this trial as the winner; it does not move the baseline. */
|
|
3617
|
-
adopted:
|
|
3618
|
-
adoptedAt:
|
|
3619
|
-
outcome:
|
|
3342
|
+
adopted: z30.boolean(),
|
|
3343
|
+
adoptedAt: z30.string().nullable(),
|
|
3344
|
+
outcome: z30.string().nullable(),
|
|
3620
3345
|
/** The kind-specific `after` payload (skill version id, pages, package). */
|
|
3621
|
-
after:
|
|
3622
|
-
before:
|
|
3623
|
-
runs:
|
|
3624
|
-
createdAt:
|
|
3625
|
-
});
|
|
3626
|
-
var roundSchema =
|
|
3627
|
-
id:
|
|
3628
|
-
number:
|
|
3629
|
-
status:
|
|
3630
|
-
narrative:
|
|
3631
|
-
trials:
|
|
3346
|
+
after: z30.unknown(),
|
|
3347
|
+
before: z30.unknown(),
|
|
3348
|
+
runs: z30.array(trialRunSchema),
|
|
3349
|
+
createdAt: z30.string()
|
|
3350
|
+
});
|
|
3351
|
+
var roundSchema = z30.object({
|
|
3352
|
+
id: z30.string(),
|
|
3353
|
+
number: z30.number().int(),
|
|
3354
|
+
status: z30.enum(ROUND_STATUSES),
|
|
3355
|
+
narrative: z30.string().nullable(),
|
|
3356
|
+
trials: z30.array(trialSchema)
|
|
3632
3357
|
});
|
|
3633
3358
|
var OPTIMIZATION_NEXT_ACTIONS = [
|
|
3634
3359
|
"START",
|
|
@@ -3639,375 +3364,375 @@ var OPTIMIZATION_NEXT_ACTIONS = [
|
|
|
3639
3364
|
"RESUME",
|
|
3640
3365
|
"NONE"
|
|
3641
3366
|
];
|
|
3642
|
-
var optimizationNextActionSchema =
|
|
3367
|
+
var optimizationNextActionSchema = z30.enum(OPTIMIZATION_NEXT_ACTIONS);
|
|
3643
3368
|
var optimizationDetailSchema = optimizationSummarySchema.extend({
|
|
3644
|
-
baselineTrialId:
|
|
3369
|
+
baselineTrialId: z30.string().nullable(),
|
|
3645
3370
|
/** The one thing a client does next. WAIT and NONE need nobody. */
|
|
3646
3371
|
nextAction: optimizationNextActionSchema,
|
|
3647
|
-
settings:
|
|
3648
|
-
sampleCount:
|
|
3649
|
-
maxRounds:
|
|
3650
|
-
maxTrialsPerRound:
|
|
3651
|
-
creditCap:
|
|
3652
|
-
targetScore:
|
|
3653
|
-
pinnedAgent:
|
|
3654
|
-
pinnedModel:
|
|
3655
|
-
continuedAtRound:
|
|
3372
|
+
settings: z30.object({
|
|
3373
|
+
sampleCount: z30.number().int(),
|
|
3374
|
+
maxRounds: z30.number().int(),
|
|
3375
|
+
maxTrialsPerRound: z30.number().int(),
|
|
3376
|
+
creditCap: z30.number().int(),
|
|
3377
|
+
targetScore: z30.number(),
|
|
3378
|
+
pinnedAgent: z30.string().nullable(),
|
|
3379
|
+
pinnedModel: z30.string().nullable(),
|
|
3380
|
+
continuedAtRound: z30.number().int().nullable()
|
|
3656
3381
|
}),
|
|
3657
3382
|
direction: climbDirectionSchema,
|
|
3658
|
-
rounds:
|
|
3383
|
+
rounds: z30.array(roundSchema)
|
|
3659
3384
|
});
|
|
3660
|
-
var listTrialsResponseSchema =
|
|
3661
|
-
items:
|
|
3385
|
+
var listTrialsResponseSchema = z30.object({
|
|
3386
|
+
items: z30.array(trialSchema)
|
|
3662
3387
|
});
|
|
3663
|
-
var trialDocumentSchema =
|
|
3664
|
-
path:
|
|
3665
|
-
before:
|
|
3666
|
-
after:
|
|
3388
|
+
var trialDocumentSchema = z30.object({
|
|
3389
|
+
path: z30.string(),
|
|
3390
|
+
before: z30.string(),
|
|
3391
|
+
after: z30.string()
|
|
3667
3392
|
});
|
|
3668
|
-
var trialContentSchema =
|
|
3669
|
-
trialId:
|
|
3393
|
+
var trialContentSchema = z30.object({
|
|
3394
|
+
trialId: z30.string(),
|
|
3670
3395
|
kind: interventionKindSchema,
|
|
3671
|
-
documents:
|
|
3396
|
+
documents: z30.array(trialDocumentSchema),
|
|
3672
3397
|
/** Full page bodies for a docs rewrite, ready to paste; null otherwise. */
|
|
3673
|
-
copyableBody:
|
|
3674
|
-
configSnapshot:
|
|
3398
|
+
copyableBody: z30.string().nullable(),
|
|
3399
|
+
configSnapshot: z30.unknown()
|
|
3675
3400
|
});
|
|
3676
|
-
var createTrialBodySchema =
|
|
3401
|
+
var createTrialBodySchema = z30.object({
|
|
3677
3402
|
trial: trialInputSchema,
|
|
3678
3403
|
files: overrideFilesSchema.optional(),
|
|
3679
|
-
fork:
|
|
3680
|
-
launch:
|
|
3404
|
+
fork: z30.object({ runId: z30.string().min(1), boundarySeq: z30.string().min(1) }).strict().optional(),
|
|
3405
|
+
launch: z30.boolean().default(false),
|
|
3681
3406
|
/** Replays return the trial the first call created instead of a second
|
|
3682
3407
|
* one. Scoped to the optimization. */
|
|
3683
|
-
idempotencyKey:
|
|
3408
|
+
idempotencyKey: z30.string().min(1).max(200).optional()
|
|
3684
3409
|
}).strict();
|
|
3685
|
-
var skillFilesResponseSchema =
|
|
3686
|
-
versionId:
|
|
3410
|
+
var skillFilesResponseSchema = z30.object({
|
|
3411
|
+
versionId: z30.string(),
|
|
3687
3412
|
files: overrideFilesSchema
|
|
3688
3413
|
});
|
|
3689
|
-
var pageBodyResponseSchema =
|
|
3690
|
-
url:
|
|
3691
|
-
body:
|
|
3692
|
-
contentType:
|
|
3414
|
+
var pageBodyResponseSchema = z30.object({
|
|
3415
|
+
url: z30.string(),
|
|
3416
|
+
body: z30.string(),
|
|
3417
|
+
contentType: z30.string().optional()
|
|
3693
3418
|
});
|
|
3694
|
-
var launchTrialResponseSchema =
|
|
3695
|
-
trialId:
|
|
3696
|
-
batchIds:
|
|
3697
|
-
runIds:
|
|
3419
|
+
var launchTrialResponseSchema = z30.object({
|
|
3420
|
+
trialId: z30.string(),
|
|
3421
|
+
batchIds: z30.array(z30.string()),
|
|
3422
|
+
runIds: z30.array(z30.string())
|
|
3698
3423
|
});
|
|
3699
|
-
var createDraftOptimizationBodySchema =
|
|
3424
|
+
var createDraftOptimizationBodySchema = z30.object({
|
|
3700
3425
|
subjectKind: climbSubjectKindSchema,
|
|
3701
|
-
subjectId:
|
|
3702
|
-
name:
|
|
3426
|
+
subjectId: z30.string().min(1),
|
|
3427
|
+
name: z30.string().trim().min(1).max(200).optional(),
|
|
3703
3428
|
...planShape,
|
|
3704
3429
|
target: targetSchema.optional(),
|
|
3705
|
-
autonomous:
|
|
3430
|
+
autonomous: z30.boolean().optional()
|
|
3706
3431
|
}).strict().superRefine(refinePlan);
|
|
3707
3432
|
var planPatchShape = {
|
|
3708
|
-
name:
|
|
3433
|
+
name: z30.string().trim().min(1).max(200).optional(),
|
|
3709
3434
|
...planShape,
|
|
3710
3435
|
target: targetSchema.optional()
|
|
3711
3436
|
};
|
|
3712
|
-
var optimizationPlanPatchSchema =
|
|
3713
|
-
var startDraftOptimizationBodySchema =
|
|
3437
|
+
var optimizationPlanPatchSchema = z30.object(planPatchShape).strict().superRefine(refinePlan);
|
|
3438
|
+
var startDraftOptimizationBodySchema = z30.object({
|
|
3714
3439
|
...planPatchShape,
|
|
3715
|
-
creditCap:
|
|
3440
|
+
creditCap: z30.number().int().nonnegative().optional()
|
|
3716
3441
|
}).strict().superRefine(refinePlan);
|
|
3717
|
-
var setModeBodySchema =
|
|
3718
|
-
var launchRoundResponseSchema =
|
|
3719
|
-
roundNumber:
|
|
3720
|
-
launched:
|
|
3442
|
+
var setModeBodySchema = z30.object({ autonomous: z30.boolean() }).strict();
|
|
3443
|
+
var launchRoundResponseSchema = z30.object({
|
|
3444
|
+
roundNumber: z30.number().int().nullable(),
|
|
3445
|
+
launched: z30.array(z30.string()),
|
|
3721
3446
|
/** True when nothing was left to launch: someone else got there first. */
|
|
3722
|
-
alreadyLaunched:
|
|
3447
|
+
alreadyLaunched: z30.boolean()
|
|
3723
3448
|
});
|
|
3724
|
-
var resolveChatResponseSchema =
|
|
3725
|
-
chatId:
|
|
3726
|
-
href:
|
|
3449
|
+
var resolveChatResponseSchema = z30.object({
|
|
3450
|
+
chatId: z30.string(),
|
|
3451
|
+
href: z30.string()
|
|
3727
3452
|
});
|
|
3728
|
-
var continueOptimizationBodySchema =
|
|
3729
|
-
rounds:
|
|
3730
|
-
maxTrialsPerRound:
|
|
3453
|
+
var continueOptimizationBodySchema = z30.object({
|
|
3454
|
+
rounds: z30.number().int().min(1).max(20).default(1),
|
|
3455
|
+
maxTrialsPerRound: z30.number().int().min(1).max(10).optional()
|
|
3731
3456
|
}).strict();
|
|
3732
|
-
var patchOptimizationBodySchema =
|
|
3457
|
+
var patchOptimizationBodySchema = z30.object({
|
|
3733
3458
|
...planPatchShape,
|
|
3734
3459
|
direction: climbDirectionPatchSchema.optional(),
|
|
3735
|
-
autonomous:
|
|
3460
|
+
autonomous: z30.boolean().optional()
|
|
3736
3461
|
}).strict().superRefine(refinePlan);
|
|
3737
3462
|
|
|
3738
3463
|
// ../packages/api-schemas/src/orgs.ts
|
|
3739
|
-
import { z as
|
|
3740
|
-
var createOrgRequestSchema =
|
|
3464
|
+
import { z as z31 } from "zod";
|
|
3465
|
+
var createOrgRequestSchema = z31.object({
|
|
3741
3466
|
/** Workspace display name; the slug is derived server-side. */
|
|
3742
|
-
name:
|
|
3467
|
+
name: z31.string().trim().min(1).max(200),
|
|
3743
3468
|
/** Optional company site (logo source; stamped onto the org). */
|
|
3744
|
-
website:
|
|
3469
|
+
website: z31.string().trim().max(300).optional()
|
|
3745
3470
|
});
|
|
3746
|
-
var createOrgResponseSchema =
|
|
3747
|
-
slug:
|
|
3748
|
-
name:
|
|
3471
|
+
var createOrgResponseSchema = z31.object({
|
|
3472
|
+
slug: z31.string(),
|
|
3473
|
+
name: z31.string(),
|
|
3749
3474
|
// LOCAL orgs never have a Gauge publicId.
|
|
3750
|
-
publicId:
|
|
3475
|
+
publicId: z31.string().nullable()
|
|
3751
3476
|
});
|
|
3752
|
-
var orgSettingsSchema =
|
|
3753
|
-
slug:
|
|
3754
|
-
name:
|
|
3755
|
-
publicId:
|
|
3756
|
-
website:
|
|
3477
|
+
var orgSettingsSchema = z31.object({
|
|
3478
|
+
slug: z31.string(),
|
|
3479
|
+
name: z31.string(),
|
|
3480
|
+
publicId: z31.string().nullable(),
|
|
3481
|
+
website: z31.string().nullable(),
|
|
3757
3482
|
/** Per-run max-spend override in USD; null = the server default. */
|
|
3758
|
-
maxSpendUsd:
|
|
3759
|
-
overageEnabled:
|
|
3483
|
+
maxSpendUsd: z31.number().nullable(),
|
|
3484
|
+
overageEnabled: z31.boolean(),
|
|
3760
3485
|
/** Per-cycle overage cap in credits; null = uncapped. */
|
|
3761
|
-
overageCapCredits:
|
|
3486
|
+
overageCapCredits: z31.number().int().nullable(),
|
|
3762
3487
|
/** Domain claimed for same-domain auto-join; null = off. */
|
|
3763
|
-
autoJoinDomain:
|
|
3488
|
+
autoJoinDomain: z31.string().nullable()
|
|
3764
3489
|
});
|
|
3765
|
-
var orgMemberSchema =
|
|
3766
|
-
userId:
|
|
3767
|
-
name:
|
|
3768
|
-
email:
|
|
3769
|
-
joinedAt:
|
|
3490
|
+
var orgMemberSchema = z31.object({
|
|
3491
|
+
userId: z31.string(),
|
|
3492
|
+
name: z31.string().nullable(),
|
|
3493
|
+
email: z31.string().nullable(),
|
|
3494
|
+
joinedAt: z31.string()
|
|
3770
3495
|
});
|
|
3771
|
-
var listMembersResponseSchema =
|
|
3772
|
-
items:
|
|
3496
|
+
var listMembersResponseSchema = z31.object({
|
|
3497
|
+
items: z31.array(orgMemberSchema)
|
|
3773
3498
|
});
|
|
3774
3499
|
|
|
3775
3500
|
// ../packages/api-schemas/src/personas.ts
|
|
3776
|
-
import { z as
|
|
3777
|
-
var personaSchema =
|
|
3778
|
-
id:
|
|
3779
|
-
name:
|
|
3780
|
-
description:
|
|
3501
|
+
import { z as z32 } from "zod";
|
|
3502
|
+
var personaSchema = z32.object({
|
|
3503
|
+
id: z32.string(),
|
|
3504
|
+
name: z32.string(),
|
|
3505
|
+
description: z32.string(),
|
|
3781
3506
|
/** The judge model this persona calls (Claude only). */
|
|
3782
|
-
model:
|
|
3783
|
-
createdAt:
|
|
3784
|
-
updatedAt:
|
|
3507
|
+
model: z32.string(),
|
|
3508
|
+
createdAt: z32.string(),
|
|
3509
|
+
updatedAt: z32.string()
|
|
3785
3510
|
});
|
|
3786
|
-
var listPersonasResponseSchema =
|
|
3787
|
-
items:
|
|
3511
|
+
var listPersonasResponseSchema = z32.object({
|
|
3512
|
+
items: z32.array(personaSchema)
|
|
3788
3513
|
});
|
|
3789
|
-
var createPersonaBodySchema =
|
|
3790
|
-
name:
|
|
3791
|
-
description:
|
|
3514
|
+
var createPersonaBodySchema = z32.object({
|
|
3515
|
+
name: z32.string().min(1).max(120),
|
|
3516
|
+
description: z32.string().min(1)
|
|
3792
3517
|
});
|
|
3793
|
-
var updatePersonaBodySchema =
|
|
3794
|
-
name:
|
|
3795
|
-
description:
|
|
3518
|
+
var updatePersonaBodySchema = z32.object({
|
|
3519
|
+
name: z32.string().min(1).max(120).optional(),
|
|
3520
|
+
description: z32.string().min(1).optional()
|
|
3796
3521
|
});
|
|
3797
3522
|
|
|
3798
3523
|
// ../packages/api-schemas/src/prompts.ts
|
|
3799
|
-
import { z as
|
|
3524
|
+
import { z as z35 } from "zod";
|
|
3800
3525
|
|
|
3801
3526
|
// ../packages/api-schemas/src/tags.ts
|
|
3802
|
-
import { z as
|
|
3803
|
-
var tagSchema =
|
|
3804
|
-
id:
|
|
3805
|
-
name:
|
|
3527
|
+
import { z as z33 } from "zod";
|
|
3528
|
+
var tagSchema = z33.object({
|
|
3529
|
+
id: z33.string(),
|
|
3530
|
+
name: z33.string(),
|
|
3806
3531
|
/** A Mantine palette name (e.g. "blue", "grape"); unknown values are
|
|
3807
3532
|
* normalized server-side to the default ("gray"). */
|
|
3808
|
-
color:
|
|
3533
|
+
color: z33.string()
|
|
3809
3534
|
});
|
|
3810
|
-
var createTagBodySchema =
|
|
3811
|
-
name:
|
|
3812
|
-
color:
|
|
3535
|
+
var createTagBodySchema = z33.object({
|
|
3536
|
+
name: z33.string().min(1),
|
|
3537
|
+
color: z33.string().optional()
|
|
3813
3538
|
});
|
|
3814
|
-
var updateTagBodySchema =
|
|
3815
|
-
name:
|
|
3816
|
-
color:
|
|
3539
|
+
var updateTagBodySchema = z33.object({
|
|
3540
|
+
name: z33.string().min(1).optional(),
|
|
3541
|
+
color: z33.string().optional()
|
|
3817
3542
|
});
|
|
3818
3543
|
var tagListResponseSchema = listResponseSchema(tagSchema);
|
|
3819
3544
|
|
|
3820
3545
|
// ../packages/api-schemas/src/topics.ts
|
|
3821
|
-
import { z as
|
|
3822
|
-
var topicSchema =
|
|
3823
|
-
id:
|
|
3824
|
-
name:
|
|
3546
|
+
import { z as z34 } from "zod";
|
|
3547
|
+
var topicSchema = z34.object({
|
|
3548
|
+
id: z34.string(),
|
|
3549
|
+
name: z34.string()
|
|
3825
3550
|
});
|
|
3826
|
-
var createTopicBodySchema =
|
|
3827
|
-
name:
|
|
3551
|
+
var createTopicBodySchema = z34.object({
|
|
3552
|
+
name: z34.string().min(1, "name is required")
|
|
3828
3553
|
});
|
|
3829
3554
|
var topicListResponseSchema = listResponseSchema(topicSchema);
|
|
3830
3555
|
|
|
3831
3556
|
// ../packages/api-schemas/src/prompts.ts
|
|
3832
|
-
var promptSummarySchema =
|
|
3833
|
-
id:
|
|
3834
|
-
text:
|
|
3835
|
-
isBranded:
|
|
3557
|
+
var promptSummarySchema = z35.object({
|
|
3558
|
+
id: z35.string(),
|
|
3559
|
+
text: z35.string(),
|
|
3560
|
+
isBranded: z35.boolean(),
|
|
3836
3561
|
/** Battery-spec identity (idempotent applies); null for UI/CLI-created prompts. */
|
|
3837
|
-
externalKey:
|
|
3562
|
+
externalKey: z35.string().nullable(),
|
|
3838
3563
|
topic: topicSchema.nullable(),
|
|
3839
|
-
tags:
|
|
3840
|
-
createdAt:
|
|
3564
|
+
tags: z35.array(tagSchema),
|
|
3565
|
+
createdAt: z35.string()
|
|
3841
3566
|
});
|
|
3842
3567
|
var promptListResponseSchema = listResponseSchema(promptSummarySchema);
|
|
3843
3568
|
var listPromptsQuerySchema = listQuerySchema.extend({
|
|
3844
|
-
topic:
|
|
3845
|
-
tag:
|
|
3846
|
-
q:
|
|
3847
|
-
});
|
|
3848
|
-
var createPromptBodySchema =
|
|
3849
|
-
text:
|
|
3850
|
-
isBranded:
|
|
3851
|
-
topic:
|
|
3852
|
-
tags:
|
|
3853
|
-
});
|
|
3854
|
-
var updatePromptBodySchema =
|
|
3855
|
-
text:
|
|
3856
|
-
isBranded:
|
|
3857
|
-
topicId:
|
|
3858
|
-
tags:
|
|
3859
|
-
});
|
|
3860
|
-
var runPromptBodySchema =
|
|
3569
|
+
topic: z35.string().min(1).optional(),
|
|
3570
|
+
tag: z35.string().min(1).optional(),
|
|
3571
|
+
q: z35.string().min(1).optional()
|
|
3572
|
+
});
|
|
3573
|
+
var createPromptBodySchema = z35.object({
|
|
3574
|
+
text: z35.string().min(1, "text is required"),
|
|
3575
|
+
isBranded: z35.boolean().default(false),
|
|
3576
|
+
topic: z35.string().min(1).optional(),
|
|
3577
|
+
tags: z35.array(z35.string().min(1)).default([])
|
|
3578
|
+
});
|
|
3579
|
+
var updatePromptBodySchema = z35.object({
|
|
3580
|
+
text: z35.string().min(1).optional(),
|
|
3581
|
+
isBranded: z35.boolean().optional(),
|
|
3582
|
+
topicId: z35.string().min(1).nullish(),
|
|
3583
|
+
tags: z35.array(z35.string().min(1)).optional()
|
|
3584
|
+
});
|
|
3585
|
+
var runPromptBodySchema = z35.object({
|
|
3861
3586
|
/** Preferred paired representation; each agent may pin its own model tiers. */
|
|
3862
|
-
agentConfigs:
|
|
3587
|
+
agentConfigs: z35.array(agentConfigInputSchema).min(1).optional(),
|
|
3863
3588
|
/** Legacy agent set (no per-agent pins), kept during the API transition. */
|
|
3864
|
-
agents:
|
|
3865
|
-
repoUrl:
|
|
3866
|
-
repoRef:
|
|
3867
|
-
samplesPerCycle:
|
|
3589
|
+
agents: z35.array(z35.enum(["CLAUDE_CODE", "CODEX_CLI", "CURSOR"])).min(1, "Select at least one agent").default(["CLAUDE_CODE", "CODEX_CLI"]),
|
|
3590
|
+
repoUrl: z35.string().min(1).nullish(),
|
|
3591
|
+
repoRef: z35.string().min(1).nullish(),
|
|
3592
|
+
samplesPerCycle: z35.number().int().min(1).max(10).default(1),
|
|
3868
3593
|
webFixture: webFixtureSchema.optional()
|
|
3869
3594
|
});
|
|
3870
|
-
var runPromptResponseSchema =
|
|
3871
|
-
batchIds:
|
|
3872
|
-
runIds:
|
|
3873
|
-
blocked:
|
|
3595
|
+
var runPromptResponseSchema = z35.object({
|
|
3596
|
+
batchIds: z35.array(z35.string()),
|
|
3597
|
+
runIds: z35.array(z35.string()),
|
|
3598
|
+
blocked: z35.enum(["insufficient_credits", "needs_provider_key"]).optional()
|
|
3874
3599
|
});
|
|
3875
3600
|
|
|
3876
3601
|
// ../packages/api-schemas/src/repos.ts
|
|
3877
|
-
import { z as
|
|
3602
|
+
import { z as z36 } from "zod";
|
|
3878
3603
|
var REPO_SIZE_BUCKETS = [
|
|
3879
3604
|
"small",
|
|
3880
3605
|
"medium",
|
|
3881
3606
|
"large",
|
|
3882
3607
|
"xlarge"
|
|
3883
3608
|
];
|
|
3884
|
-
var repoSizeBucketSchema =
|
|
3885
|
-
var repoSchema =
|
|
3886
|
-
url:
|
|
3887
|
-
name:
|
|
3888
|
-
isSystem:
|
|
3889
|
-
languages:
|
|
3890
|
-
frameworks:
|
|
3609
|
+
var repoSizeBucketSchema = z36.enum(REPO_SIZE_BUCKETS);
|
|
3610
|
+
var repoSchema = z36.object({
|
|
3611
|
+
url: z36.string(),
|
|
3612
|
+
name: z36.string(),
|
|
3613
|
+
isSystem: z36.boolean(),
|
|
3614
|
+
languages: z36.array(z36.string()),
|
|
3615
|
+
frameworks: z36.array(z36.string()),
|
|
3891
3616
|
/** Faceted labels (complexity:L2, buildable:yes, stack:nextjs, …). */
|
|
3892
|
-
tags:
|
|
3893
|
-
primaryLanguage:
|
|
3894
|
-
sizeKb:
|
|
3617
|
+
tags: z36.array(z36.string()),
|
|
3618
|
+
primaryLanguage: z36.string(),
|
|
3619
|
+
sizeKb: z36.number(),
|
|
3895
3620
|
sizeBucket: repoSizeBucketSchema.nullable(),
|
|
3896
|
-
stars:
|
|
3621
|
+
stars: z36.number()
|
|
3897
3622
|
});
|
|
3898
3623
|
var repoListResponseSchema = listResponseSchema(repoSchema);
|
|
3899
|
-
var addRepoBodySchema =
|
|
3900
|
-
url:
|
|
3624
|
+
var addRepoBodySchema = z36.object({
|
|
3625
|
+
url: z36.string().min(1, "url is required"),
|
|
3901
3626
|
/**
|
|
3902
3627
|
* Reserved (accepted, not yet persisted): the catalog keys repos by URL only
|
|
3903
3628
|
* — `fact_repo` has no ref column and metadata sync always reads the default
|
|
3904
3629
|
* branch. Kept in the wire format so `gauge repos add --ref` is stable once
|
|
3905
3630
|
* the catalog learns refs.
|
|
3906
3631
|
*/
|
|
3907
|
-
ref:
|
|
3632
|
+
ref: z36.string().min(1).optional(),
|
|
3908
3633
|
/** Display name; defaults to the `owner/repo` label of the URL. */
|
|
3909
|
-
name:
|
|
3634
|
+
name: z36.string().min(1).optional(),
|
|
3910
3635
|
/** Manual override; defaults to frameworks detected from the repo's manifests. */
|
|
3911
|
-
frameworks:
|
|
3912
|
-
tags:
|
|
3636
|
+
frameworks: z36.array(z36.string()).optional(),
|
|
3637
|
+
tags: z36.array(z36.string()).optional()
|
|
3913
3638
|
});
|
|
3914
|
-
var updateRepoBodySchema =
|
|
3915
|
-
url:
|
|
3916
|
-
name:
|
|
3917
|
-
frameworks:
|
|
3918
|
-
tags:
|
|
3639
|
+
var updateRepoBodySchema = z36.object({
|
|
3640
|
+
url: z36.string().min(1, "url is required"),
|
|
3641
|
+
name: z36.string().min(1).optional(),
|
|
3642
|
+
frameworks: z36.array(z36.string()).optional(),
|
|
3643
|
+
tags: z36.array(z36.string()).optional()
|
|
3919
3644
|
});
|
|
3920
|
-
var resyncRepoBodySchema =
|
|
3921
|
-
url:
|
|
3645
|
+
var resyncRepoBodySchema = z36.object({
|
|
3646
|
+
url: z36.string().min(1, "url is required")
|
|
3922
3647
|
});
|
|
3923
|
-
var deleteRepoQuerySchema =
|
|
3924
|
-
url:
|
|
3648
|
+
var deleteRepoQuerySchema = z36.object({
|
|
3649
|
+
url: z36.string().min(1, "url is required")
|
|
3925
3650
|
});
|
|
3926
|
-
var repoSyncResultSchema =
|
|
3651
|
+
var repoSyncResultSchema = z36.object({
|
|
3927
3652
|
repo: repoSchema,
|
|
3928
|
-
synced:
|
|
3653
|
+
synced: z36.boolean()
|
|
3929
3654
|
});
|
|
3930
3655
|
|
|
3931
3656
|
// ../packages/api-schemas/src/runAddons.ts
|
|
3932
|
-
import { z as
|
|
3933
|
-
var runAddonsSchema =
|
|
3934
|
-
browser:
|
|
3935
|
-
session:
|
|
3936
|
-
projectId:
|
|
3937
|
-
region:
|
|
3657
|
+
import { z as z37 } from "zod";
|
|
3658
|
+
var runAddonsSchema = z37.object({
|
|
3659
|
+
browser: z37.object({
|
|
3660
|
+
session: z37.string().min(1),
|
|
3661
|
+
projectId: z37.number().int().positive(),
|
|
3662
|
+
region: z37.literal("us").default("us")
|
|
3938
3663
|
}).strict().optional()
|
|
3939
3664
|
}).strict();
|
|
3940
3665
|
|
|
3941
3666
|
// ../packages/api-schemas/src/runDefinitions.ts
|
|
3942
|
-
import { z as
|
|
3667
|
+
import { z as z39 } from "zod";
|
|
3943
3668
|
|
|
3944
3669
|
// ../packages/api-schemas/src/runPlan.ts
|
|
3945
|
-
import { z as
|
|
3946
|
-
var runPlanCriterionSchema =
|
|
3947
|
-
id:
|
|
3948
|
-
name:
|
|
3949
|
-
rubric:
|
|
3670
|
+
import { z as z38 } from "zod";
|
|
3671
|
+
var runPlanCriterionSchema = z38.object({
|
|
3672
|
+
id: z38.string().min(1),
|
|
3673
|
+
name: z38.string(),
|
|
3674
|
+
rubric: z38.string()
|
|
3950
3675
|
});
|
|
3951
|
-
var criteriaSnapshotV1Schema =
|
|
3952
|
-
version:
|
|
3676
|
+
var criteriaSnapshotV1Schema = z38.object({
|
|
3677
|
+
version: z38.literal(1),
|
|
3953
3678
|
// File-authored criteria have no saved EvalSet; their identity is frozen
|
|
3954
3679
|
// in the request and result rows retain the criterion text without an FK.
|
|
3955
|
-
evalSetId:
|
|
3956
|
-
criteria:
|
|
3957
|
-
});
|
|
3958
|
-
var runPlanCaseSchema =
|
|
3959
|
-
id:
|
|
3960
|
-
prompt:
|
|
3961
|
-
workspace:
|
|
3962
|
-
repoUrl:
|
|
3963
|
-
repoRef:
|
|
3680
|
+
evalSetId: z38.string().min(1).nullable(),
|
|
3681
|
+
criteria: z38.array(runPlanCriterionSchema)
|
|
3682
|
+
});
|
|
3683
|
+
var runPlanCaseSchema = z38.object({
|
|
3684
|
+
id: z38.string().min(1),
|
|
3685
|
+
prompt: z38.object({ id: z38.string().min(1), text: z38.string() }),
|
|
3686
|
+
workspace: z38.object({
|
|
3687
|
+
repoUrl: z38.string().nullable(),
|
|
3688
|
+
repoRef: z38.string().nullable()
|
|
3964
3689
|
}),
|
|
3965
|
-
agents:
|
|
3690
|
+
agents: z38.array(
|
|
3966
3691
|
agentConfigSchema.extend({
|
|
3967
3692
|
// Validated against the current catalog request schema when lowered.
|
|
3968
|
-
catalogSelections:
|
|
3693
|
+
catalogSelections: z38.record(z38.string(), z38.unknown()).optional()
|
|
3969
3694
|
})
|
|
3970
3695
|
),
|
|
3971
|
-
samples:
|
|
3972
|
-
evalSetId:
|
|
3696
|
+
samples: z38.number().int().min(1).max(50),
|
|
3697
|
+
evalSetId: z38.string().min(1).optional(),
|
|
3973
3698
|
criteriaSnapshot: criteriaSnapshotV1Schema.optional(),
|
|
3974
|
-
sourceRepoCommit:
|
|
3975
|
-
experiment:
|
|
3976
|
-
membershipTagIds:
|
|
3977
|
-
profile:
|
|
3978
|
-
id:
|
|
3979
|
-
name:
|
|
3980
|
-
description:
|
|
3981
|
-
model:
|
|
3699
|
+
sourceRepoCommit: z38.string().nullable().optional(),
|
|
3700
|
+
experiment: z38.string().nullable().optional(),
|
|
3701
|
+
membershipTagIds: z38.array(z38.string()).optional(),
|
|
3702
|
+
profile: z38.object({
|
|
3703
|
+
id: z38.string(),
|
|
3704
|
+
name: z38.string(),
|
|
3705
|
+
description: z38.string(),
|
|
3706
|
+
model: z38.string()
|
|
3982
3707
|
}).nullable().optional(),
|
|
3983
3708
|
skillSet: skillSetSchema.optional(),
|
|
3984
3709
|
mcpSet: mcpSetSchema.optional(),
|
|
3985
3710
|
connectionSet: connectionSetSchema.optional(),
|
|
3986
3711
|
// The server's agentContextSnapshotV1Schema validates this at lowering.
|
|
3987
|
-
agentContext:
|
|
3988
|
-
agentContextDigest:
|
|
3712
|
+
agentContext: z38.unknown().optional(),
|
|
3713
|
+
agentContextDigest: z38.string().nullable().optional(),
|
|
3989
3714
|
addons: runAddonsSchema.optional(),
|
|
3990
3715
|
/** Names of resources the coordinator must prepare before expansion. */
|
|
3991
|
-
inputs:
|
|
3992
|
-
});
|
|
3993
|
-
var builtDirectoryResourceSchema =
|
|
3994
|
-
name:
|
|
3995
|
-
type:
|
|
3996
|
-
source:
|
|
3997
|
-
type:
|
|
3998
|
-
repoUrl:
|
|
3999
|
-
commit:
|
|
3716
|
+
inputs: z38.array(z38.string().min(1)).default([])
|
|
3717
|
+
});
|
|
3718
|
+
var builtDirectoryResourceSchema = z38.object({
|
|
3719
|
+
name: z38.string().min(1),
|
|
3720
|
+
type: z38.literal("built-directory"),
|
|
3721
|
+
source: z38.object({
|
|
3722
|
+
type: z38.literal("git-checkout"),
|
|
3723
|
+
repoUrl: z38.string().min(1),
|
|
3724
|
+
commit: z38.string().regex(/^[a-f0-9]{40}$/i)
|
|
4000
3725
|
}),
|
|
4001
|
-
build:
|
|
4002
|
-
runtime:
|
|
4003
|
-
run:
|
|
4004
|
-
output:
|
|
3726
|
+
build: z38.object({
|
|
3727
|
+
runtime: z38.literal("node-24"),
|
|
3728
|
+
run: z38.string().min(1),
|
|
3729
|
+
output: z38.string().min(1),
|
|
4005
3730
|
/** Declared command name plus args, invoked from a clean cwd before a session. */
|
|
4006
|
-
smoke:
|
|
3731
|
+
smoke: z38.array(z38.string().min(1)).min(1)
|
|
4007
3732
|
}),
|
|
4008
|
-
expose:
|
|
4009
|
-
type:
|
|
4010
|
-
commands:
|
|
3733
|
+
expose: z38.object({
|
|
3734
|
+
type: z38.literal("command"),
|
|
3735
|
+
commands: z38.record(z38.string().min(1), z38.array(z38.string().min(1)).min(1))
|
|
4011
3736
|
})
|
|
4012
3737
|
}).superRefine((resource, ctx) => {
|
|
4013
3738
|
if (!(resource.build.smoke[0] in resource.expose.commands))
|
|
@@ -4017,24 +3742,24 @@ var builtDirectoryResourceSchema = z39.object({
|
|
|
4017
3742
|
message: "Smoke command must name an exposed command"
|
|
4018
3743
|
});
|
|
4019
3744
|
});
|
|
4020
|
-
var bundleRelativeScriptSchema =
|
|
3745
|
+
var bundleRelativeScriptSchema = z38.string().min(1).refine(
|
|
4021
3746
|
(path2) => !path2.startsWith("/") && !path2.includes("\\") && !path2.includes("\0") && !path2.split("/").includes("..") && path2.split("/").some((part) => part !== "" && part !== "."),
|
|
4022
3747
|
"Install script must be a bundle-relative path without traversal"
|
|
4023
3748
|
);
|
|
4024
|
-
var preparedDirectoryPrepareSchema =
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
type:
|
|
4028
|
-
build:
|
|
3749
|
+
var preparedDirectoryPrepareSchema = z38.union([
|
|
3750
|
+
z38.object({ run: z38.string().min(1) }).strict(),
|
|
3751
|
+
z38.object({
|
|
3752
|
+
type: z38.literal("npm-cli"),
|
|
3753
|
+
build: z38.string().min(1).optional()
|
|
4029
3754
|
}).strict()
|
|
4030
3755
|
]);
|
|
4031
|
-
var preparedDirectoryResourceSchema =
|
|
4032
|
-
name:
|
|
4033
|
-
type:
|
|
4034
|
-
source:
|
|
4035
|
-
type:
|
|
4036
|
-
repoUrl:
|
|
4037
|
-
commit:
|
|
3756
|
+
var preparedDirectoryResourceSchema = z38.object({
|
|
3757
|
+
name: z38.string().min(1),
|
|
3758
|
+
type: z38.literal("prepared-directory"),
|
|
3759
|
+
source: z38.object({
|
|
3760
|
+
type: z38.literal("git-checkout"),
|
|
3761
|
+
repoUrl: z38.string().min(1),
|
|
3762
|
+
commit: z38.string().regex(/^[a-f0-9]{40}$/i)
|
|
4038
3763
|
}).strict(),
|
|
4039
3764
|
prepare: preparedDirectoryPrepareSchema,
|
|
4040
3765
|
install: bundleRelativeScriptSchema.optional()
|
|
@@ -4046,46 +3771,46 @@ var preparedDirectoryResourceSchema = z39.object({
|
|
|
4046
3771
|
message: "npm-cli products cannot declare an install script"
|
|
4047
3772
|
});
|
|
4048
3773
|
});
|
|
4049
|
-
var runPlanResourceSchema =
|
|
3774
|
+
var runPlanResourceSchema = z38.union([
|
|
4050
3775
|
builtDirectoryResourceSchema,
|
|
4051
3776
|
preparedDirectoryResourceSchema
|
|
4052
3777
|
]);
|
|
4053
|
-
var runPlanSchema =
|
|
4054
|
-
version:
|
|
3778
|
+
var runPlanSchema = z38.object({
|
|
3779
|
+
version: z38.literal(1),
|
|
4055
3780
|
/** Existing launches keep their current measurement semantics. */
|
|
4056
|
-
measurementMode:
|
|
4057
|
-
cases:
|
|
4058
|
-
resources:
|
|
3781
|
+
measurementMode: z38.enum(["EXISTING", "AGENT_EXPERIENCE"]),
|
|
3782
|
+
cases: z38.array(runPlanCaseSchema).min(1),
|
|
3783
|
+
resources: z38.array(runPlanResourceSchema).default([]),
|
|
4059
3784
|
/** Server-populated context retained across deferred preparation. */
|
|
4060
|
-
launch:
|
|
4061
|
-
origin:
|
|
4062
|
-
|
|
4063
|
-
initiator:
|
|
4064
|
-
userId:
|
|
4065
|
-
email:
|
|
3785
|
+
launch: z38.object({
|
|
3786
|
+
origin: z38.discriminatedUnion("initiator", [
|
|
3787
|
+
z38.object({
|
|
3788
|
+
initiator: z38.literal("API"),
|
|
3789
|
+
userId: z38.string().min(1),
|
|
3790
|
+
email: z38.string().nullable()
|
|
4066
3791
|
}).strict(),
|
|
4067
|
-
|
|
4068
|
-
initiator:
|
|
4069
|
-
userId:
|
|
4070
|
-
email:
|
|
3792
|
+
z38.object({
|
|
3793
|
+
initiator: z38.literal("GITHUB"),
|
|
3794
|
+
userId: z38.null(),
|
|
3795
|
+
email: z38.null()
|
|
4071
3796
|
}).strict()
|
|
4072
3797
|
]),
|
|
4073
|
-
funding:
|
|
4074
|
-
queueClass:
|
|
3798
|
+
funding: z38.enum(["ORG", "PLATFORM"]),
|
|
3799
|
+
queueClass: z38.literal("INTERACTIVE")
|
|
4075
3800
|
}).strict().optional(),
|
|
4076
|
-
provenance:
|
|
4077
|
-
definition:
|
|
4078
|
-
repoUrl:
|
|
4079
|
-
commit:
|
|
4080
|
-
digest:
|
|
3801
|
+
provenance: z38.object({
|
|
3802
|
+
definition: z38.object({
|
|
3803
|
+
repoUrl: z38.string().min(1),
|
|
3804
|
+
commit: z38.string().regex(/^[a-f0-9]{40}$/i),
|
|
3805
|
+
digest: z38.string().min(1),
|
|
4081
3806
|
/** File submissions are asserted by the caller until server-side
|
|
4082
3807
|
* committed-byte fetching is available. */
|
|
4083
|
-
verification:
|
|
3808
|
+
verification: z38.enum(["SUBMITTED_UNVERIFIED", "GITHUB_VERIFIED"]).optional()
|
|
4084
3809
|
}).optional(),
|
|
4085
|
-
liveDependencies:
|
|
4086
|
-
|
|
4087
|
-
name:
|
|
4088
|
-
url:
|
|
3810
|
+
liveDependencies: z38.array(
|
|
3811
|
+
z38.object({
|
|
3812
|
+
name: z38.string().min(1),
|
|
3813
|
+
url: z38.string().url().optional()
|
|
4089
3814
|
})
|
|
4090
3815
|
).default([])
|
|
4091
3816
|
})
|
|
@@ -4136,7 +3861,7 @@ var runPlanSchema = z39.object({
|
|
|
4136
3861
|
});
|
|
4137
3862
|
|
|
4138
3863
|
// ../packages/api-schemas/src/runDefinitions.ts
|
|
4139
|
-
var uncredentialedRepoUrlSchema =
|
|
3864
|
+
var uncredentialedRepoUrlSchema = z39.string().min(1).refine((raw) => {
|
|
4140
3865
|
if (!/^[a-z][a-z0-9+.-]*:\/\//i.test(raw)) return true;
|
|
4141
3866
|
try {
|
|
4142
3867
|
const url = new URL(raw);
|
|
@@ -4145,36 +3870,36 @@ var uncredentialedRepoUrlSchema = z40.string().min(1).refine((raw) => {
|
|
|
4145
3870
|
return false;
|
|
4146
3871
|
}
|
|
4147
3872
|
}, "Repository URL must not contain embedded credentials or query parameters");
|
|
4148
|
-
var runDefinitionConfigSchema =
|
|
4149
|
-
agents:
|
|
4150
|
-
sampleCount:
|
|
3873
|
+
var runDefinitionConfigSchema = z39.object({
|
|
3874
|
+
agents: z39.array(agentConfigInputSchema).min(1),
|
|
3875
|
+
sampleCount: z39.number().int().min(1).max(50).optional(),
|
|
4151
3876
|
repoUrl: uncredentialedRepoUrlSchema.nullable().optional(),
|
|
4152
|
-
repoRef:
|
|
4153
|
-
profileId:
|
|
3877
|
+
repoRef: z39.string().min(1).nullable().optional(),
|
|
3878
|
+
profileId: z39.string().min(1).nullable().optional(),
|
|
4154
3879
|
skillRefs: assetRefListSchema.optional(),
|
|
4155
3880
|
mcpRefs: assetRefListSchema.optional(),
|
|
4156
|
-
connectionIds:
|
|
3881
|
+
connectionIds: z39.array(z39.string().min(1)).max(32).optional(),
|
|
4157
3882
|
addons: runAddonsSchema.optional()
|
|
4158
3883
|
}).strict();
|
|
4159
|
-
var githubCasePathSchema =
|
|
3884
|
+
var githubCasePathSchema = z39.string().regex(
|
|
4160
3885
|
/^evals\/[A-Za-z0-9_./-]+\.md$/,
|
|
4161
3886
|
"Expected an explicit evals/*.md path"
|
|
4162
3887
|
).refine(
|
|
4163
3888
|
(path2) => path2.split("/").every((part) => part !== "" && part !== "." && part !== ".."),
|
|
4164
3889
|
"Case path must not contain traversal or empty segments"
|
|
4165
3890
|
);
|
|
4166
|
-
var runDefinitionFileConfigSchema =
|
|
4167
|
-
version:
|
|
4168
|
-
org:
|
|
4169
|
-
product:
|
|
4170
|
-
type:
|
|
4171
|
-
build:
|
|
3891
|
+
var runDefinitionFileConfigSchema = z39.object({
|
|
3892
|
+
version: z39.literal(1).default(1),
|
|
3893
|
+
org: z39.string().min(1).optional(),
|
|
3894
|
+
product: z39.object({
|
|
3895
|
+
type: z39.literal("npm-cli"),
|
|
3896
|
+
build: z39.string().min(1).optional()
|
|
4172
3897
|
}).strict().optional(),
|
|
4173
|
-
prepare:
|
|
3898
|
+
prepare: z39.string().min(1).optional(),
|
|
4174
3899
|
install: bundleRelativeScriptSchema.optional(),
|
|
4175
|
-
github:
|
|
4176
|
-
enabled:
|
|
4177
|
-
files:
|
|
3900
|
+
github: z39.object({
|
|
3901
|
+
enabled: z39.literal(true),
|
|
3902
|
+
files: z39.array(githubCasePathSchema).min(1).max(20).refine(
|
|
4178
3903
|
(paths) => new Set(paths).size === paths.length,
|
|
4179
3904
|
"Case paths must be unique"
|
|
4180
3905
|
)
|
|
@@ -4193,27 +3918,27 @@ var runDefinitionFileConfigSchema = z40.object({
|
|
|
4193
3918
|
message: "npm-cli products cannot declare an install script"
|
|
4194
3919
|
});
|
|
4195
3920
|
});
|
|
4196
|
-
var runDefinitionCriterionSchema =
|
|
4197
|
-
var runDefinitionFrontmatterSchema =
|
|
4198
|
-
criteria:
|
|
3921
|
+
var runDefinitionCriterionSchema = z39.object({ name: z39.string().min(1), rubric: z39.string().min(1) }).strict();
|
|
3922
|
+
var runDefinitionFrontmatterSchema = z39.object({
|
|
3923
|
+
criteria: z39.array(runDefinitionCriterionSchema).min(1),
|
|
4199
3924
|
config: runDefinitionConfigSchema
|
|
4200
3925
|
}).strict();
|
|
4201
|
-
var runDefinitionCaseSchema =
|
|
4202
|
-
path:
|
|
4203
|
-
prompt:
|
|
4204
|
-
criteria:
|
|
3926
|
+
var runDefinitionCaseSchema = z39.object({
|
|
3927
|
+
path: z39.string().min(1),
|
|
3928
|
+
prompt: z39.string().min(1),
|
|
3929
|
+
criteria: z39.array(runDefinitionCriterionSchema).min(1),
|
|
4205
3930
|
config: runDefinitionConfigSchema
|
|
4206
3931
|
}).strict();
|
|
4207
|
-
var runDefinitionSubmissionSchema =
|
|
4208
|
-
version:
|
|
4209
|
-
source:
|
|
3932
|
+
var runDefinitionSubmissionSchema = z39.object({
|
|
3933
|
+
version: z39.literal(1),
|
|
3934
|
+
source: z39.object({
|
|
4210
3935
|
repoUrl: uncredentialedRepoUrlSchema,
|
|
4211
|
-
commit:
|
|
4212
|
-
digest:
|
|
4213
|
-
verification:
|
|
3936
|
+
commit: z39.string().regex(/^[a-f0-9]{40}$/i),
|
|
3937
|
+
digest: z39.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
3938
|
+
verification: z39.enum(["SUBMITTED_UNVERIFIED", "GITHUB_VERIFIED"])
|
|
4214
3939
|
}).strict(),
|
|
4215
|
-
resources:
|
|
4216
|
-
cases:
|
|
3940
|
+
resources: z39.array(preparedDirectoryResourceSchema).max(1).default([]),
|
|
3941
|
+
cases: z39.array(runDefinitionCaseSchema).min(1)
|
|
4217
3942
|
}).strict().superRefine((definition, ctx) => {
|
|
4218
3943
|
const paths = /* @__PURE__ */ new Set();
|
|
4219
3944
|
for (const [index, item] of definition.cases.entries()) {
|
|
@@ -4259,41 +3984,41 @@ var runDefinitionPublicSubmissionSchema = runDefinitionSubmissionSchema.refine(
|
|
|
4259
3984
|
message: "Only the GitHub App may verify committed bytes"
|
|
4260
3985
|
}
|
|
4261
3986
|
);
|
|
4262
|
-
var runDefinitionPlanResponseSchema =
|
|
3987
|
+
var runDefinitionPlanResponseSchema = z39.object({
|
|
4263
3988
|
source: runDefinitionSubmissionSchema.shape.source,
|
|
4264
|
-
measurementMode:
|
|
4265
|
-
cases:
|
|
4266
|
-
|
|
4267
|
-
path:
|
|
4268
|
-
agents:
|
|
4269
|
-
samples:
|
|
4270
|
-
expectedRuns:
|
|
4271
|
-
workspace:
|
|
4272
|
-
repoUrl:
|
|
4273
|
-
repoRef:
|
|
3989
|
+
measurementMode: z39.literal("AGENT_EXPERIENCE"),
|
|
3990
|
+
cases: z39.array(
|
|
3991
|
+
z39.object({
|
|
3992
|
+
path: z39.string(),
|
|
3993
|
+
agents: z39.array(agentConfigSchema),
|
|
3994
|
+
samples: z39.number().int().nonnegative(),
|
|
3995
|
+
expectedRuns: z39.number().int().nonnegative(),
|
|
3996
|
+
workspace: z39.object({
|
|
3997
|
+
repoUrl: z39.string().nullable(),
|
|
3998
|
+
repoRef: z39.string().nullable()
|
|
4274
3999
|
}),
|
|
4275
|
-
criteriaCount:
|
|
4276
|
-
inputs:
|
|
4000
|
+
criteriaCount: z39.number().int().nonnegative(),
|
|
4001
|
+
inputs: z39.array(z39.string())
|
|
4277
4002
|
})
|
|
4278
4003
|
),
|
|
4279
|
-
resources:
|
|
4280
|
-
|
|
4004
|
+
resources: z39.array(
|
|
4005
|
+
z39.object({ name: z39.string(), type: z39.literal("prepared-directory") })
|
|
4281
4006
|
),
|
|
4282
|
-
expectedRuns:
|
|
4283
|
-
canRun:
|
|
4007
|
+
expectedRuns: z39.number().int().nonnegative(),
|
|
4008
|
+
canRun: z39.boolean()
|
|
4284
4009
|
});
|
|
4285
|
-
var runDefinitionRunResponseSchema =
|
|
4286
|
-
runRequestId:
|
|
4287
|
-
batchIds:
|
|
4288
|
-
runIds:
|
|
4289
|
-
requestedRuns:
|
|
4290
|
-
createdRuns:
|
|
4291
|
-
aggregateUrl:
|
|
4010
|
+
var runDefinitionRunResponseSchema = z39.object({
|
|
4011
|
+
runRequestId: z39.string(),
|
|
4012
|
+
batchIds: z39.array(z39.string()),
|
|
4013
|
+
runIds: z39.array(z39.string()),
|
|
4014
|
+
requestedRuns: z39.number().int().nonnegative(),
|
|
4015
|
+
createdRuns: z39.number().int().nonnegative(),
|
|
4016
|
+
aggregateUrl: z39.string()
|
|
4292
4017
|
});
|
|
4293
4018
|
|
|
4294
4019
|
// ../packages/api-schemas/src/runRequests.ts
|
|
4295
|
-
import { z as
|
|
4296
|
-
var runRequestStatusSchema =
|
|
4020
|
+
import { z as z40 } from "zod";
|
|
4021
|
+
var runRequestStatusSchema = z40.enum([
|
|
4297
4022
|
"PENDING",
|
|
4298
4023
|
"PREPARING",
|
|
4299
4024
|
"RUNNING",
|
|
@@ -4301,7 +4026,7 @@ var runRequestStatusSchema = z41.enum([
|
|
|
4301
4026
|
"FAILED",
|
|
4302
4027
|
"CANCELED"
|
|
4303
4028
|
]);
|
|
4304
|
-
var runRequestResultSchema =
|
|
4029
|
+
var runRequestResultSchema = z40.enum([
|
|
4305
4030
|
"PENDING",
|
|
4306
4031
|
"PASSED",
|
|
4307
4032
|
"QUALITY_FAILED",
|
|
@@ -4311,222 +4036,222 @@ var runRequestResultSchema = z41.enum([
|
|
|
4311
4036
|
"INCOMPLETE",
|
|
4312
4037
|
"CANCELED"
|
|
4313
4038
|
]);
|
|
4314
|
-
var runRequestCriterionResultSchema =
|
|
4315
|
-
criterionId:
|
|
4316
|
-
name:
|
|
4317
|
-
passed:
|
|
4318
|
-
reasoning:
|
|
4319
|
-
});
|
|
4320
|
-
var runRequestRunSchema =
|
|
4321
|
-
id:
|
|
4322
|
-
batchId:
|
|
4323
|
-
status:
|
|
4039
|
+
var runRequestCriterionResultSchema = z40.object({
|
|
4040
|
+
criterionId: z40.string().nullable(),
|
|
4041
|
+
name: z40.string(),
|
|
4042
|
+
passed: z40.boolean(),
|
|
4043
|
+
reasoning: z40.string().nullable()
|
|
4044
|
+
});
|
|
4045
|
+
var runRequestRunSchema = z40.object({
|
|
4046
|
+
id: z40.string(),
|
|
4047
|
+
batchId: z40.string(),
|
|
4048
|
+
status: z40.string(),
|
|
4324
4049
|
agent: agentSchema,
|
|
4325
|
-
model:
|
|
4050
|
+
model: z40.string(),
|
|
4326
4051
|
result: runRequestResultSchema,
|
|
4327
|
-
judge:
|
|
4328
|
-
criterionResults:
|
|
4052
|
+
judge: z40.object({ status: z40.string() }).nullable(),
|
|
4053
|
+
criterionResults: z40.array(runRequestCriterionResultSchema)
|
|
4329
4054
|
});
|
|
4330
|
-
var runRequestResponseSchema =
|
|
4331
|
-
id:
|
|
4055
|
+
var runRequestResponseSchema = z40.object({
|
|
4056
|
+
id: z40.string(),
|
|
4332
4057
|
status: runRequestStatusSchema,
|
|
4333
4058
|
result: runRequestResultSchema,
|
|
4334
|
-
settled:
|
|
4335
|
-
counts:
|
|
4336
|
-
requestedRuns:
|
|
4337
|
-
createdRuns:
|
|
4338
|
-
terminalRuns:
|
|
4339
|
-
judgedRuns:
|
|
4340
|
-
passedRuns:
|
|
4341
|
-
qualityFailedRuns:
|
|
4342
|
-
executionFailedRuns:
|
|
4343
|
-
judgeFailedRuns:
|
|
4344
|
-
pendingRuns:
|
|
4059
|
+
settled: z40.boolean(),
|
|
4060
|
+
counts: z40.object({
|
|
4061
|
+
requestedRuns: z40.number().int().nonnegative(),
|
|
4062
|
+
createdRuns: z40.number().int().nonnegative(),
|
|
4063
|
+
terminalRuns: z40.number().int().nonnegative(),
|
|
4064
|
+
judgedRuns: z40.number().int().nonnegative(),
|
|
4065
|
+
passedRuns: z40.number().int().nonnegative(),
|
|
4066
|
+
qualityFailedRuns: z40.number().int().nonnegative(),
|
|
4067
|
+
executionFailedRuns: z40.number().int().nonnegative(),
|
|
4068
|
+
judgeFailedRuns: z40.number().int().nonnegative(),
|
|
4069
|
+
pendingRuns: z40.number().int().nonnegative()
|
|
4345
4070
|
}),
|
|
4346
|
-
batches:
|
|
4347
|
-
|
|
4071
|
+
batches: z40.array(
|
|
4072
|
+
z40.object({ id: z40.string(), runs: z40.array(runRequestRunSchema) })
|
|
4348
4073
|
),
|
|
4349
|
-
createdAt:
|
|
4350
|
-
updatedAt:
|
|
4351
|
-
finishedAt:
|
|
4074
|
+
createdAt: z40.string(),
|
|
4075
|
+
updatedAt: z40.string(),
|
|
4076
|
+
finishedAt: z40.string().nullable()
|
|
4352
4077
|
});
|
|
4353
4078
|
|
|
4354
4079
|
// ../packages/api-schemas/src/summary.ts
|
|
4355
|
-
import { z as
|
|
4080
|
+
import { z as z41 } from "zod";
|
|
4356
4081
|
function cardResultSchema(data) {
|
|
4357
|
-
return
|
|
4358
|
-
|
|
4359
|
-
|
|
4082
|
+
return z41.union([
|
|
4083
|
+
z41.object({ ok: z41.literal(true), data }),
|
|
4084
|
+
z41.object({ ok: z41.literal(false), error: z41.string() })
|
|
4360
4085
|
]);
|
|
4361
4086
|
}
|
|
4362
|
-
var summaryActionSchema =
|
|
4363
|
-
id:
|
|
4364
|
-
title:
|
|
4365
|
-
priority:
|
|
4366
|
-
status:
|
|
4367
|
-
evidenceCount:
|
|
4087
|
+
var summaryActionSchema = z41.object({
|
|
4088
|
+
id: z41.string(),
|
|
4089
|
+
title: z41.string(),
|
|
4090
|
+
priority: z41.string(),
|
|
4091
|
+
status: z41.string(),
|
|
4092
|
+
evidenceCount: z41.number().int()
|
|
4368
4093
|
});
|
|
4369
|
-
var summaryAeCardSchema =
|
|
4370
|
-
id:
|
|
4371
|
-
name:
|
|
4372
|
-
judgedRuns:
|
|
4373
|
-
passRate:
|
|
4094
|
+
var summaryAeCardSchema = z41.object({
|
|
4095
|
+
id: z41.string(),
|
|
4096
|
+
name: z41.string(),
|
|
4097
|
+
judgedRuns: z41.number().int(),
|
|
4098
|
+
passRate: z41.number().nullable(),
|
|
4374
4099
|
/** pp delta vs the prior 30d; null with no prior. */
|
|
4375
|
-
deltaPP:
|
|
4100
|
+
deltaPP: z41.number().nullable()
|
|
4376
4101
|
});
|
|
4377
|
-
var summaryVisibilityCardSchema =
|
|
4378
|
-
name:
|
|
4379
|
-
owned:
|
|
4380
|
-
name:
|
|
4381
|
-
rank:
|
|
4382
|
-
chosenRate:
|
|
4383
|
-
mentionRate:
|
|
4102
|
+
var summaryVisibilityCardSchema = z41.object({
|
|
4103
|
+
name: z41.string(),
|
|
4104
|
+
owned: z41.object({
|
|
4105
|
+
name: z41.string(),
|
|
4106
|
+
rank: z41.number(),
|
|
4107
|
+
chosenRate: z41.number(),
|
|
4108
|
+
mentionRate: z41.number()
|
|
4384
4109
|
}).nullable(),
|
|
4385
|
-
chosenDeltaPP:
|
|
4110
|
+
chosenDeltaPP: z41.number().nullable()
|
|
4386
4111
|
});
|
|
4387
|
-
var homeSummarySchema =
|
|
4388
|
-
hasAnyRuns:
|
|
4389
|
-
lastSynthesisAt:
|
|
4390
|
-
actions: cardResultSchema(
|
|
4112
|
+
var homeSummarySchema = z41.object({
|
|
4113
|
+
hasAnyRuns: z41.boolean(),
|
|
4114
|
+
lastSynthesisAt: z41.string().nullable(),
|
|
4115
|
+
actions: cardResultSchema(z41.array(summaryActionSchema)),
|
|
4391
4116
|
visibility: cardResultSchema(
|
|
4392
|
-
|
|
4393
|
-
cards:
|
|
4394
|
-
marketsTotal:
|
|
4395
|
-
promptCount:
|
|
4117
|
+
z41.object({
|
|
4118
|
+
cards: z41.array(summaryVisibilityCardSchema),
|
|
4119
|
+
marketsTotal: z41.number().int(),
|
|
4120
|
+
promptCount: z41.number().int()
|
|
4396
4121
|
})
|
|
4397
4122
|
),
|
|
4398
4123
|
agentExperience: cardResultSchema(
|
|
4399
|
-
|
|
4400
|
-
cards:
|
|
4401
|
-
total:
|
|
4402
|
-
setCount:
|
|
4124
|
+
z41.object({
|
|
4125
|
+
cards: z41.array(summaryAeCardSchema),
|
|
4126
|
+
total: z41.number().int(),
|
|
4127
|
+
setCount: z41.number().int()
|
|
4403
4128
|
})
|
|
4404
4129
|
),
|
|
4405
|
-
notableSessions: cardResultSchema(
|
|
4130
|
+
notableSessions: cardResultSchema(z41.array(z41.unknown()))
|
|
4406
4131
|
});
|
|
4407
4132
|
|
|
4408
4133
|
// ../packages/api-schemas/src/tokens.ts
|
|
4409
|
-
import { z as
|
|
4410
|
-
var apiTokenSchema =
|
|
4411
|
-
id:
|
|
4412
|
-
name:
|
|
4134
|
+
import { z as z42 } from "zod";
|
|
4135
|
+
var apiTokenSchema = z42.object({
|
|
4136
|
+
id: z42.string(),
|
|
4137
|
+
name: z42.string(),
|
|
4413
4138
|
/** Last 4 chars of the plaintext, for recognizability (non-secret). */
|
|
4414
|
-
last4:
|
|
4415
|
-
expiresAt:
|
|
4416
|
-
lastUsedAt:
|
|
4417
|
-
createdAt:
|
|
4418
|
-
revokedAt:
|
|
4419
|
-
});
|
|
4420
|
-
var createTokenRequestSchema =
|
|
4421
|
-
name:
|
|
4139
|
+
last4: z42.string(),
|
|
4140
|
+
expiresAt: z42.iso.datetime().nullable(),
|
|
4141
|
+
lastUsedAt: z42.iso.datetime().nullable(),
|
|
4142
|
+
createdAt: z42.iso.datetime(),
|
|
4143
|
+
revokedAt: z42.iso.datetime().nullable()
|
|
4144
|
+
});
|
|
4145
|
+
var createTokenRequestSchema = z42.object({
|
|
4146
|
+
name: z42.string().min(1).max(100),
|
|
4422
4147
|
/** ISO-8601 datetime; omit for no expiry. */
|
|
4423
|
-
expiresAt:
|
|
4148
|
+
expiresAt: z42.iso.datetime({ offset: true }).optional()
|
|
4424
4149
|
});
|
|
4425
4150
|
var createTokenResponseSchema = apiTokenSchema.extend({
|
|
4426
|
-
token:
|
|
4151
|
+
token: z42.string()
|
|
4427
4152
|
});
|
|
4428
4153
|
var listTokensResponseSchema = listResponseSchema(apiTokenSchema);
|
|
4429
4154
|
|
|
4430
4155
|
// ../packages/api-schemas/src/visibility.ts
|
|
4431
|
-
import { z as
|
|
4156
|
+
import { z as z43 } from "zod";
|
|
4432
4157
|
var VISIBILITY_PROMPT_KINDS = ["HEAD_TO_HEAD", "RECOMMEND"];
|
|
4433
|
-
var visibilityPromptKindSchema =
|
|
4158
|
+
var visibilityPromptKindSchema = z43.enum(VISIBILITY_PROMPT_KINDS);
|
|
4434
4159
|
var visibilityPromptSchema = visibilityPromptSettingsSchema.extend({
|
|
4435
|
-
id:
|
|
4436
|
-
name:
|
|
4160
|
+
id: z43.string(),
|
|
4161
|
+
name: z43.string(),
|
|
4437
4162
|
kind: visibilityPromptKindSchema,
|
|
4438
|
-
promptText:
|
|
4163
|
+
promptText: z43.string(),
|
|
4439
4164
|
/** HEAD_TO_HEAD is always branded; RECOMMEND may be either. */
|
|
4440
|
-
branded:
|
|
4441
|
-
brandA:
|
|
4442
|
-
brandB:
|
|
4443
|
-
market:
|
|
4444
|
-
position:
|
|
4445
|
-
createdAt:
|
|
4165
|
+
branded: z43.boolean(),
|
|
4166
|
+
brandA: z43.string().nullable(),
|
|
4167
|
+
brandB: z43.string().nullable(),
|
|
4168
|
+
market: z43.object({ id: z43.string(), slug: z43.string(), name: z43.string() }).nullable(),
|
|
4169
|
+
position: z43.number().int(),
|
|
4170
|
+
createdAt: z43.string(),
|
|
4446
4171
|
/** User tag names on the hidden backing prompt (Surface:* excluded). */
|
|
4447
|
-
tags:
|
|
4448
|
-
runCount:
|
|
4449
|
-
lastRunAt:
|
|
4450
|
-
scenarios:
|
|
4172
|
+
tags: z43.array(z43.string()),
|
|
4173
|
+
runCount: z43.number().int(),
|
|
4174
|
+
lastRunAt: z43.string().nullable(),
|
|
4175
|
+
scenarios: z43.array(visibilityScenarioSchema)
|
|
4451
4176
|
});
|
|
4452
|
-
var listVisibilityPromptsResponseSchema =
|
|
4453
|
-
items:
|
|
4177
|
+
var listVisibilityPromptsResponseSchema = z43.object({
|
|
4178
|
+
items: z43.array(visibilityPromptSchema)
|
|
4454
4179
|
});
|
|
4455
|
-
var createVisibilityPromptBodySchema =
|
|
4456
|
-
name:
|
|
4457
|
-
promptText:
|
|
4180
|
+
var createVisibilityPromptBodySchema = z43.object({
|
|
4181
|
+
name: z43.string().min(1),
|
|
4182
|
+
promptText: z43.string().min(1),
|
|
4458
4183
|
kind: visibilityPromptKindSchema,
|
|
4459
|
-
branded:
|
|
4184
|
+
branded: z43.boolean().optional(),
|
|
4460
4185
|
/** Required pair for HEAD_TO_HEAD (order-independent). */
|
|
4461
|
-
brandA:
|
|
4462
|
-
brandB:
|
|
4186
|
+
brandA: z43.string().nullish(),
|
|
4187
|
+
brandB: z43.string().nullish(),
|
|
4463
4188
|
/** Measured market id from the org's tracked set. */
|
|
4464
|
-
marketId:
|
|
4465
|
-
tags:
|
|
4189
|
+
marketId: z43.string().nullish(),
|
|
4190
|
+
tags: z43.array(z43.string()).optional(),
|
|
4466
4191
|
agents: visibilityPromptSettingsInputShape.agents.optional(),
|
|
4467
4192
|
skillRefs: visibilityPromptSettingsInputShape.skillRefs,
|
|
4468
4193
|
mcpRefs: visibilityPromptSettingsInputShape.mcpRefs,
|
|
4469
4194
|
connectionIds: visibilityPromptSettingsInputShape.connectionIds,
|
|
4470
4195
|
cadence: visibilityPromptSettingsInputShape.cadence,
|
|
4471
4196
|
sampleCount: visibilityPromptSettingsInputShape.sampleCount,
|
|
4472
|
-
scenarios:
|
|
4197
|
+
scenarios: z43.array(visibilityScenarioInputSchema).optional().default([])
|
|
4473
4198
|
}).strict();
|
|
4474
|
-
var synthesizeResponseSchema =
|
|
4199
|
+
var synthesizeResponseSchema = z43.object({
|
|
4475
4200
|
/** False when the pre-check found no new evidence and nothing was queued. */
|
|
4476
|
-
queued:
|
|
4477
|
-
});
|
|
4478
|
-
var updateVisibilityPromptBodySchema =
|
|
4479
|
-
name:
|
|
4480
|
-
promptText:
|
|
4481
|
-
branded:
|
|
4482
|
-
brandA:
|
|
4483
|
-
brandB:
|
|
4484
|
-
marketId:
|
|
4485
|
-
tags:
|
|
4201
|
+
queued: z43.boolean()
|
|
4202
|
+
});
|
|
4203
|
+
var updateVisibilityPromptBodySchema = z43.object({
|
|
4204
|
+
name: z43.string().min(1).optional(),
|
|
4205
|
+
promptText: z43.string().min(1).optional(),
|
|
4206
|
+
branded: z43.boolean().optional(),
|
|
4207
|
+
brandA: z43.string().nullish(),
|
|
4208
|
+
brandB: z43.string().nullish(),
|
|
4209
|
+
marketId: z43.string().nullish(),
|
|
4210
|
+
tags: z43.array(z43.string()).optional(),
|
|
4486
4211
|
...visibilityPromptSettingsPatchShape,
|
|
4487
4212
|
/** Replaces the whole scenario set when present. */
|
|
4488
|
-
scenarios:
|
|
4213
|
+
scenarios: z43.array(visibilityScenarioInputSchema).optional()
|
|
4489
4214
|
}).strict();
|
|
4490
|
-
var runVisibilityPromptResponseSchema =
|
|
4491
|
-
batchIds:
|
|
4492
|
-
runIds:
|
|
4215
|
+
var runVisibilityPromptResponseSchema = z43.object({
|
|
4216
|
+
batchIds: z43.array(z43.string()),
|
|
4217
|
+
runIds: z43.array(z43.string())
|
|
4493
4218
|
});
|
|
4494
|
-
var visibilityPromptRunSchema =
|
|
4495
|
-
id:
|
|
4496
|
-
status:
|
|
4219
|
+
var visibilityPromptRunSchema = z43.object({
|
|
4220
|
+
id: z43.string(),
|
|
4221
|
+
status: z43.string(),
|
|
4497
4222
|
agent: agentSchema,
|
|
4498
|
-
model:
|
|
4499
|
-
resolvedModel:
|
|
4500
|
-
createdAt:
|
|
4501
|
-
startedAt:
|
|
4502
|
-
finishedAt:
|
|
4503
|
-
failureReason:
|
|
4504
|
-
verdict:
|
|
4505
|
-
status:
|
|
4506
|
-
error:
|
|
4507
|
-
payload:
|
|
4223
|
+
model: z43.string().nullable(),
|
|
4224
|
+
resolvedModel: z43.string().nullable(),
|
|
4225
|
+
createdAt: z43.string(),
|
|
4226
|
+
startedAt: z43.string().nullable(),
|
|
4227
|
+
finishedAt: z43.string().nullable(),
|
|
4228
|
+
failureReason: z43.string().nullable(),
|
|
4229
|
+
verdict: z43.object({
|
|
4230
|
+
status: z43.string(),
|
|
4231
|
+
error: z43.string().nullable(),
|
|
4232
|
+
payload: z43.unknown().nullable()
|
|
4508
4233
|
}).nullable()
|
|
4509
4234
|
});
|
|
4510
|
-
var listVisibilityPromptRunsResponseSchema =
|
|
4511
|
-
items:
|
|
4235
|
+
var listVisibilityPromptRunsResponseSchema = z43.object({
|
|
4236
|
+
items: z43.array(visibilityPromptRunSchema)
|
|
4512
4237
|
});
|
|
4513
|
-
var orgMarketSchema =
|
|
4514
|
-
marketId:
|
|
4515
|
-
slug:
|
|
4516
|
-
name:
|
|
4238
|
+
var orgMarketSchema = z43.object({
|
|
4239
|
+
marketId: z43.string(),
|
|
4240
|
+
slug: z43.string(),
|
|
4241
|
+
name: z43.string(),
|
|
4517
4242
|
/** The one line saying what the market measures. */
|
|
4518
|
-
capability:
|
|
4243
|
+
capability: z43.string(),
|
|
4519
4244
|
/** SUGGESTED (the matcher) | USER (a human picked it). */
|
|
4520
|
-
source:
|
|
4245
|
+
source: z43.string()
|
|
4521
4246
|
});
|
|
4522
4247
|
var addableMarketSchema = orgMarketSchema.omit({ source: true });
|
|
4523
|
-
var listMarketsResponseSchema =
|
|
4524
|
-
tracked:
|
|
4248
|
+
var listMarketsResponseSchema = z43.object({
|
|
4249
|
+
tracked: z43.array(orgMarketSchema),
|
|
4525
4250
|
/** Published markets the org does not track yet (closed set — no free-text
|
|
4526
4251
|
* market creation). */
|
|
4527
|
-
addable:
|
|
4252
|
+
addable: z43.array(addableMarketSchema)
|
|
4528
4253
|
});
|
|
4529
|
-
var addMarketBodySchema =
|
|
4254
|
+
var addMarketBodySchema = z43.object({ marketId: z43.string().min(1) });
|
|
4530
4255
|
|
|
4531
4256
|
// src/version.ts
|
|
4532
4257
|
import { createRequire } from "module";
|
|
@@ -4911,7 +4636,7 @@ __export(apply_exports, {
|
|
|
4911
4636
|
register: () => register2
|
|
4912
4637
|
});
|
|
4913
4638
|
import { readFileSync as readFileSync3 } from "fs";
|
|
4914
|
-
import { z as
|
|
4639
|
+
import { z as z44 } from "zod";
|
|
4915
4640
|
function assertRequiredExperiment(spec, required) {
|
|
4916
4641
|
if (required.length === 0) {
|
|
4917
4642
|
throw new CliError(
|
|
@@ -5063,7 +4788,7 @@ function register2(program2) {
|
|
|
5063
4788
|
).option("--schema", "print the battery spec JSON Schema and exit").option("--example", "print a minimal example battery spec and exit").action(
|
|
5064
4789
|
async (opts, command) => {
|
|
5065
4790
|
if (opts.schema) {
|
|
5066
|
-
printJson(
|
|
4791
|
+
printJson(z44.toJSONSchema(batteries_exports.batterySpecSchema));
|
|
5067
4792
|
return;
|
|
5068
4793
|
}
|
|
5069
4794
|
if (opts.example) {
|
|
@@ -6929,422 +6654,10 @@ function register11(program2) {
|
|
|
6929
6654
|
);
|
|
6930
6655
|
}
|
|
6931
6656
|
|
|
6932
|
-
// src/commands/experiments.ts
|
|
6933
|
-
var experiments_exports2 = {};
|
|
6934
|
-
__export(experiments_exports2, {
|
|
6935
|
-
register: () => register12,
|
|
6936
|
-
rewriteContentType: () => rewriteContentType
|
|
6937
|
-
});
|
|
6938
|
-
import { readFileSync as readFileSync7 } from "fs";
|
|
6939
|
-
import { extname } from "path";
|
|
6940
|
-
var TERMINAL = /* @__PURE__ */ new Set(["COMPLETE", "PARTIAL", "FAILED", "CANCELED"]);
|
|
6941
|
-
function experimentsPath(org) {
|
|
6942
|
-
return `/api/v1/orgs/${encodeURIComponent(org)}/experiments`;
|
|
6943
|
-
}
|
|
6944
|
-
function itemPath(org, id) {
|
|
6945
|
-
return `${experimentsPath(org)}/${encodeURIComponent(id)}`;
|
|
6946
|
-
}
|
|
6947
|
-
function readText(path2) {
|
|
6948
|
-
return readFileSync7(path2 === "-" ? 0 : path2, "utf8");
|
|
6949
|
-
}
|
|
6950
|
-
var REWRITE_FILE_CONTENT_TYPES = {
|
|
6951
|
-
".md": "text/markdown",
|
|
6952
|
-
".markdown": "text/markdown",
|
|
6953
|
-
".html": "text/html",
|
|
6954
|
-
".htm": "text/html",
|
|
6955
|
-
".txt": "text/plain"
|
|
6956
|
-
};
|
|
6957
|
-
function rewriteContentType(path2, explicit) {
|
|
6958
|
-
if (explicit !== void 0) return explicit;
|
|
6959
|
-
if (path2 === void 0 || path2 === "-") return void 0;
|
|
6960
|
-
return REWRITE_FILE_CONTENT_TYPES[extname(path2).toLowerCase()];
|
|
6961
|
-
}
|
|
6962
|
-
function sleep2(ms) {
|
|
6963
|
-
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
6964
|
-
}
|
|
6965
|
-
function toRow3(e) {
|
|
6966
|
-
return {
|
|
6967
|
-
id: e.id,
|
|
6968
|
-
status: e.status,
|
|
6969
|
-
problem: e.problem.length > 60 ? `${e.problem.slice(0, 57)}...` : e.problem,
|
|
6970
|
-
page: e.boundaryUrl ?? "",
|
|
6971
|
-
variants: e.variantCount,
|
|
6972
|
-
"source run": e.sourceRunId,
|
|
6973
|
-
created: e.createdAt
|
|
6974
|
-
};
|
|
6975
|
-
}
|
|
6976
|
-
function printDetail3(e) {
|
|
6977
|
-
console.log(`id: ${e.id}`);
|
|
6978
|
-
console.log(`status: ${e.status}`);
|
|
6979
|
-
console.log(`problem: ${e.problem}`);
|
|
6980
|
-
console.log(`page: ${e.boundaryUrl ?? "(none)"}`);
|
|
6981
|
-
console.log(`source run: ${e.sourceRun.runId} (${e.sourceRun.agent})`);
|
|
6982
|
-
if (e.launchError) console.log(`launch err: ${e.launchError}`);
|
|
6983
|
-
console.log("variants:");
|
|
6984
|
-
for (const v of e.variants) {
|
|
6985
|
-
const rewrite = v.hasRewrite ? `${v.rewriteChars} chars` : "no rewrite yet";
|
|
6986
|
-
const state = v.invalidReason ? `invalid: ${v.invalidReason}` : v.planStatus ?? "draft";
|
|
6987
|
-
console.log(
|
|
6988
|
-
` [${v.key}] ${v.title || "(untitled)"} \u2014 ${rewrite}, ${state}`
|
|
6989
|
-
);
|
|
6990
|
-
if (v.hypothesis) console.log(` hypothesis: ${v.hypothesis}`);
|
|
6991
|
-
for (const r of v.runs) {
|
|
6992
|
-
console.log(
|
|
6993
|
-
` run ${r.runId}: ${r.status}${r.failureReason ? ` (${r.failureReason})` : ""}`
|
|
6994
|
-
);
|
|
6995
|
-
}
|
|
6996
|
-
}
|
|
6997
|
-
}
|
|
6998
|
-
function register12(program2) {
|
|
6999
|
-
const group = program2.command("experiments").description(
|
|
7000
|
-
"Author, launch, and read content experiments (legacy: orgs with Optimizations reject writes; use `gauge optimizations`)"
|
|
7001
|
-
);
|
|
7002
|
-
group.command("list").description("List the org's experiments").option(
|
|
7003
|
-
"--status <statuses>",
|
|
7004
|
-
"comma-separated statuses (e.g. RUNNING,COMPLETE)"
|
|
7005
|
-
).option("--limit <n>", "max rows (default 25)").action(async (opts, cmd) => {
|
|
7006
|
-
const org = resolveOrg(cmd);
|
|
7007
|
-
const res = await createClient().get(
|
|
7008
|
-
experimentsPath(org),
|
|
7009
|
-
{ status: opts.status, limit: opts.limit }
|
|
7010
|
-
);
|
|
7011
|
-
if (resolveOutput(cmd) === "json") printJson(res.items);
|
|
7012
|
-
else printItems(res.items.map(toRow3), "table");
|
|
7013
|
-
});
|
|
7014
|
-
group.command("eligible").description("Recent runs worth experimenting on (worst verdicts first)").action(async (_opts, cmd) => {
|
|
7015
|
-
const org = resolveOrg(cmd);
|
|
7016
|
-
const res = await createClient().get(`${experimentsPath(org)}/eligible-runs`);
|
|
7017
|
-
if (resolveOutput(cmd) === "json") printJson(res.items);
|
|
7018
|
-
else
|
|
7019
|
-
printItems(
|
|
7020
|
-
res.items.map((r) => ({
|
|
7021
|
-
"run id": r.runId,
|
|
7022
|
-
agent: r.agent,
|
|
7023
|
-
verdict: r.verdict ?? "-",
|
|
7024
|
-
boundaries: r.boundaryCount,
|
|
7025
|
-
created: r.createdAt
|
|
7026
|
-
})),
|
|
7027
|
-
"table"
|
|
7028
|
-
);
|
|
7029
|
-
});
|
|
7030
|
-
group.command("boundaries").description("The forkable fetches of a run (pass boundarySeq to create)").requiredOption("--run <runId>", "source run id").action(async (opts, cmd) => {
|
|
7031
|
-
const org = resolveOrg(cmd);
|
|
7032
|
-
const res = await createClient().get(`${experimentsPath(org)}/boundaries`, { runId: opts.run });
|
|
7033
|
-
if (resolveOutput(cmd) === "json") printJson(res.items);
|
|
7034
|
-
else
|
|
7035
|
-
printItems(
|
|
7036
|
-
res.items.map((b) => ({
|
|
7037
|
-
boundarySeq: String(b.boundarySeq),
|
|
7038
|
-
turn: b.turn ?? "?",
|
|
7039
|
-
url: b.url,
|
|
7040
|
-
prompt: b.fetchPrompt ?? ""
|
|
7041
|
-
})),
|
|
7042
|
-
"table"
|
|
7043
|
-
);
|
|
7044
|
-
});
|
|
7045
|
-
group.command("create").description(
|
|
7046
|
-
"Open (or resume) an experiment draft and start the plan round"
|
|
7047
|
-
).requiredOption("--run <runId>", "source run id").requiredOption(
|
|
7048
|
-
"--boundary <seq>",
|
|
7049
|
-
"opaque boundarySeq from `experiments boundaries`"
|
|
7050
|
-
).option("--problem <text>", "problem statement (derived if omitted)").option(
|
|
7051
|
-
"--mode <mode>",
|
|
7052
|
-
"who writes the rewrites: propose (default, directions are proposed then each is written), direct (one --change instruction, one write), manual (no generation \u2014 the rewrite is seeded with the page the agent read)",
|
|
7053
|
-
"propose"
|
|
7054
|
-
).option(
|
|
7055
|
-
"--change <text>",
|
|
7056
|
-
"--mode direct only: the one change to make, in your words"
|
|
7057
|
-
).action(
|
|
7058
|
-
async (opts, cmd) => {
|
|
7059
|
-
const org = resolveOrg(cmd);
|
|
7060
|
-
const parsedMode = experiments_exports.experimentModeSchema.safeParse(
|
|
7061
|
-
opts.mode.toUpperCase()
|
|
7062
|
-
);
|
|
7063
|
-
if (!parsedMode.success) {
|
|
7064
|
-
throw new Error(
|
|
7065
|
-
`--mode must be one of ${experiments_exports.EXPERIMENT_MODES.map((m) => m.toLowerCase()).join(", ")}`
|
|
7066
|
-
);
|
|
7067
|
-
}
|
|
7068
|
-
const mode = parsedMode.data;
|
|
7069
|
-
if (mode === "DIRECT" && !opts.change?.trim()) {
|
|
7070
|
-
throw new Error("--mode direct requires --change <text>");
|
|
7071
|
-
}
|
|
7072
|
-
if (mode !== "DIRECT" && opts.change !== void 0) {
|
|
7073
|
-
throw new Error(`--change only applies to --mode direct`);
|
|
7074
|
-
}
|
|
7075
|
-
const body = {
|
|
7076
|
-
runId: opts.run,
|
|
7077
|
-
boundarySeq: opts.boundary,
|
|
7078
|
-
...opts.problem !== void 0 ? { problemText: opts.problem } : {},
|
|
7079
|
-
mode,
|
|
7080
|
-
...opts.change !== void 0 ? { changeInstruction: opts.change.trim() } : {}
|
|
7081
|
-
};
|
|
7082
|
-
const result = await createClient().post(
|
|
7083
|
-
experimentsPath(org),
|
|
7084
|
-
body
|
|
7085
|
-
);
|
|
7086
|
-
if (resolveOutput(cmd) === "json") {
|
|
7087
|
-
printJson(result);
|
|
7088
|
-
return;
|
|
7089
|
-
}
|
|
7090
|
-
console.log(
|
|
7091
|
-
`${result.created ? "Created" : "Resumed"} experiment ${result.experimentId}`
|
|
7092
|
-
);
|
|
7093
|
-
console.log(`Problem: ${result.problemText}`);
|
|
7094
|
-
console.log(`Mode: ${result.mode.toLowerCase()}`);
|
|
7095
|
-
if (!result.created && result.mode !== mode) {
|
|
7096
|
-
console.error(
|
|
7097
|
-
`Note: this fetch already had a live ${result.mode.toLowerCase()} draft, so --mode ${mode.toLowerCase()} was not applied \u2014 that draft was resumed instead.`
|
|
7098
|
-
);
|
|
7099
|
-
}
|
|
7100
|
-
console.error(
|
|
7101
|
-
result.mode === "MANUAL" ? `Tip: \`gauge experiments get ${result.experimentId}\` shows the seeded rewrite once the page is recovered` : `Tip: \`gauge experiments watch ${result.experimentId}\` follows the ${result.mode === "DIRECT" ? "write" : "plan"} round`
|
|
7102
|
-
);
|
|
7103
|
-
}
|
|
7104
|
-
);
|
|
7105
|
-
group.command("get <id>").description("Full detail: directions, rewrites, arms, verdicts").action(async (id, _opts, cmd) => {
|
|
7106
|
-
const org = resolveOrg(cmd);
|
|
7107
|
-
const detail = await createClient().get(
|
|
7108
|
-
itemPath(org, id)
|
|
7109
|
-
);
|
|
7110
|
-
if (resolveOutput(cmd) === "json") printJson(detail);
|
|
7111
|
-
else printDetail3(detail);
|
|
7112
|
-
});
|
|
7113
|
-
group.command("status <id>").description("The async round/launch state (carries launchError)").action(async (id, _opts, cmd) => {
|
|
7114
|
-
const org = resolveOrg(cmd);
|
|
7115
|
-
const status = await createClient().get(
|
|
7116
|
-
`${itemPath(org, id)}/status`
|
|
7117
|
-
);
|
|
7118
|
-
if (resolveOutput(cmd) === "json") printJson(status);
|
|
7119
|
-
else {
|
|
7120
|
-
console.log(`status: ${status.status}`);
|
|
7121
|
-
if (status.launchError)
|
|
7122
|
-
console.log(`launch error: ${status.launchError}`);
|
|
7123
|
-
if (status.shippedVariantId)
|
|
7124
|
-
console.log(
|
|
7125
|
-
`shipped: ${status.shippedVariantId} at ${status.shippedAt}`
|
|
7126
|
-
);
|
|
7127
|
-
}
|
|
7128
|
-
});
|
|
7129
|
-
const variants = group.command("variants").description("Manage a draft's rewrite directions");
|
|
7130
|
-
variants.command("add <experimentId>").description("Add a direction (a candidate rewrite slot)").option("--title <title>", "direction title").option("--hypothesis <text>", "what this rewrite should change").action(
|
|
7131
|
-
async (experimentId, opts, cmd) => {
|
|
7132
|
-
const org = resolveOrg(cmd);
|
|
7133
|
-
const created = await createClient().post(
|
|
7134
|
-
`${itemPath(org, experimentId)}/variants`,
|
|
7135
|
-
opts
|
|
7136
|
-
);
|
|
7137
|
-
if (resolveOutput(cmd) === "json") printJson(created);
|
|
7138
|
-
else console.log(`Added variant ${created.key} (${created.id})`);
|
|
7139
|
-
}
|
|
7140
|
-
);
|
|
7141
|
-
variants.command("edit <experimentId> <variantId>").description("Retitle / re-hypothesize a direction").option("--title <title>", "direction title").option("--hypothesis <text>", "hypothesis").action(
|
|
7142
|
-
async (experimentId, variantId, opts, cmd) => {
|
|
7143
|
-
if (opts.title === void 0 && opts.hypothesis === void 0)
|
|
7144
|
-
throw new CliError("usage", "nothing to change");
|
|
7145
|
-
const org = resolveOrg(cmd);
|
|
7146
|
-
await createClient().patch(
|
|
7147
|
-
`${itemPath(org, experimentId)}/variants/${encodeURIComponent(variantId)}`,
|
|
7148
|
-
opts
|
|
7149
|
-
);
|
|
7150
|
-
if (resolveOutput(cmd) !== "json") console.log("Updated");
|
|
7151
|
-
}
|
|
7152
|
-
);
|
|
7153
|
-
variants.command("rm <experimentId> <variantId>").description("Remove a direction from the draft").action(
|
|
7154
|
-
async (experimentId, variantId, _o, cmd) => {
|
|
7155
|
-
const org = resolveOrg(cmd);
|
|
7156
|
-
await createClient().delete(
|
|
7157
|
-
`${itemPath(org, experimentId)}/variants/${encodeURIComponent(variantId)}`
|
|
7158
|
-
);
|
|
7159
|
-
if (resolveOutput(cmd) !== "json") console.log("Removed");
|
|
7160
|
-
}
|
|
7161
|
-
);
|
|
7162
|
-
group.command("content <id>").description("Read the live page (or a rewrite) in bounded windows").option("--variant <variantId>", "read this variant's rewrite instead").option("--offset <n>", "start offset (default 0)").option("--max-chars <n>", "window size (default 20000, max 40000)").action(
|
|
7163
|
-
async (id, opts, cmd) => {
|
|
7164
|
-
const org = resolveOrg(cmd);
|
|
7165
|
-
const result = await createClient().get(
|
|
7166
|
-
`${itemPath(org, id)}/content`,
|
|
7167
|
-
{
|
|
7168
|
-
variantId: opts.variant,
|
|
7169
|
-
offset: opts.offset,
|
|
7170
|
-
maxChars: opts.maxChars
|
|
7171
|
-
}
|
|
7172
|
-
);
|
|
7173
|
-
if (resolveOutput(cmd) === "json") {
|
|
7174
|
-
printJson(result);
|
|
7175
|
-
return;
|
|
7176
|
-
}
|
|
7177
|
-
process.stdout.write(result.content);
|
|
7178
|
-
if (result.nextOffset != null)
|
|
7179
|
-
console.error(
|
|
7180
|
-
`
|
|
7181
|
-
--- ${result.returnedChars}/${result.totalChars} chars; continue with --offset ${result.nextOffset}`
|
|
7182
|
-
);
|
|
7183
|
-
}
|
|
7184
|
-
);
|
|
7185
|
-
group.command("rewrite <id> <variantId>").description(
|
|
7186
|
-
"Write a variant's page: --file replaces it; --edits-file applies {find, replace} ops"
|
|
7187
|
-
).option("--file <path>", 'full content ("-" for stdin)').option(
|
|
7188
|
-
"--content-type <mime>",
|
|
7189
|
-
"rewrite MIME type (inferred for .md, .markdown, .html, .htm, and .txt)"
|
|
7190
|
-
).option(
|
|
7191
|
-
"--edits-file <path>",
|
|
7192
|
-
'JSON array of {find, replace} ops ("-" for stdin)'
|
|
7193
|
-
).action(
|
|
7194
|
-
async (id, variantId, opts, cmd) => {
|
|
7195
|
-
if (opts.file === void 0 === (opts.editsFile === void 0))
|
|
7196
|
-
throw new CliError(
|
|
7197
|
-
"usage",
|
|
7198
|
-
"pass exactly one of --file or --edits-file"
|
|
7199
|
-
);
|
|
7200
|
-
const org = resolveOrg(cmd);
|
|
7201
|
-
const body = {};
|
|
7202
|
-
if (opts.file !== void 0) body.content = readText(opts.file);
|
|
7203
|
-
else {
|
|
7204
|
-
let parsed;
|
|
7205
|
-
try {
|
|
7206
|
-
parsed = JSON.parse(readText(opts.editsFile));
|
|
7207
|
-
} catch (e) {
|
|
7208
|
-
throw new CliError(
|
|
7209
|
-
"usage",
|
|
7210
|
-
`could not read --edits-file: ${e instanceof Error ? e.message : e}`
|
|
7211
|
-
);
|
|
7212
|
-
}
|
|
7213
|
-
if (!Array.isArray(parsed) || parsed.length === 0)
|
|
7214
|
-
throw new CliError(
|
|
7215
|
-
"usage",
|
|
7216
|
-
"--edits-file must be a non-empty JSON array of {find, replace}"
|
|
7217
|
-
);
|
|
7218
|
-
body.edits = parsed;
|
|
7219
|
-
}
|
|
7220
|
-
body.contentType = rewriteContentType(opts.file, opts.contentType);
|
|
7221
|
-
const result = await createClient().put(
|
|
7222
|
-
`${itemPath(org, id)}/variants/${encodeURIComponent(variantId)}/content`,
|
|
7223
|
-
body
|
|
7224
|
-
);
|
|
7225
|
-
if (resolveOutput(cmd) === "json") printJson(result);
|
|
7226
|
-
else {
|
|
7227
|
-
console.log(`Wrote ${result.chars} chars`);
|
|
7228
|
-
if (body.edits)
|
|
7229
|
-
console.log(
|
|
7230
|
-
`Edits: ${result.applied} applied, ${result.skipped} skipped`
|
|
7231
|
-
);
|
|
7232
|
-
if (result.truncated) console.error("warning: content was truncated");
|
|
7233
|
-
}
|
|
7234
|
-
}
|
|
7235
|
-
);
|
|
7236
|
-
group.command("replan <id>").description("Discard the directions and propose fresh ones").action(async (id, _opts, cmd) => {
|
|
7237
|
-
const org = resolveOrg(cmd);
|
|
7238
|
-
await createClient().post(`${itemPath(org, id)}/replan`, {});
|
|
7239
|
-
if (resolveOutput(cmd) !== "json")
|
|
7240
|
-
console.log("Replanning \u2014 follow with `gauge experiments watch`");
|
|
7241
|
-
});
|
|
7242
|
-
group.command("write <id>").description("Write rewrites for directions that lack one").action(async (id, _opts, cmd) => {
|
|
7243
|
-
const org = resolveOrg(cmd);
|
|
7244
|
-
const result = await createClient().post(
|
|
7245
|
-
`${itemPath(org, id)}/write`,
|
|
7246
|
-
{}
|
|
7247
|
-
);
|
|
7248
|
-
if (resolveOutput(cmd) === "json") {
|
|
7249
|
-
printJson(result);
|
|
7250
|
-
return;
|
|
7251
|
-
}
|
|
7252
|
-
if (result.queued > 0) console.log(`Queued ${result.queued} rewrite(s)`);
|
|
7253
|
-
else if (result.reason === "round_in_flight")
|
|
7254
|
-
console.log("A round is already running");
|
|
7255
|
-
else console.log("Nothing pending \u2014 every direction has a rewrite");
|
|
7256
|
-
});
|
|
7257
|
-
group.command("launch <id>").description("Claim the draft for launch (spends credits; async fan-out)").action(async (id, _opts, cmd) => {
|
|
7258
|
-
const org = resolveOrg(cmd);
|
|
7259
|
-
const result = await createClient().post(
|
|
7260
|
-
`${itemPath(org, id)}/launch`,
|
|
7261
|
-
{}
|
|
7262
|
-
);
|
|
7263
|
-
if (resolveOutput(cmd) === "json") printJson(result);
|
|
7264
|
-
else
|
|
7265
|
-
console.log(
|
|
7266
|
-
`Launching ${result.experimentId} \u2014 \`gauge experiments watch ${result.experimentId}\` follows it`
|
|
7267
|
-
);
|
|
7268
|
-
});
|
|
7269
|
-
group.command("watch <id>").description(
|
|
7270
|
-
"Follow the running round or launch; prints the recommendation on settle"
|
|
7271
|
-
).option("--interval <seconds>", "poll interval (default 10)").action(async (id, opts, cmd) => {
|
|
7272
|
-
const org = resolveOrg(cmd);
|
|
7273
|
-
const client = createClient();
|
|
7274
|
-
const intervalMs = Math.max(Number(opts.interval ?? 10) * 1e3, 2e3);
|
|
7275
|
-
const GRACE_POLLS = 3;
|
|
7276
|
-
let sawActive = false;
|
|
7277
|
-
let draftPolls = 0;
|
|
7278
|
-
let last = "";
|
|
7279
|
-
for (; ; ) {
|
|
7280
|
-
const status = await client.get(
|
|
7281
|
-
`${itemPath(org, id)}/status`
|
|
7282
|
-
);
|
|
7283
|
-
if (status.status !== last) {
|
|
7284
|
-
last = status.status;
|
|
7285
|
-
console.error(`status: ${status.status}`);
|
|
7286
|
-
if (status.launchError)
|
|
7287
|
-
console.error(`launch error: ${status.launchError}`);
|
|
7288
|
-
}
|
|
7289
|
-
if (TERMINAL.has(status.status)) break;
|
|
7290
|
-
if (status.status === "DRAFT") {
|
|
7291
|
-
if (status.launchError) {
|
|
7292
|
-
process.exitCode = 1;
|
|
7293
|
-
return;
|
|
7294
|
-
}
|
|
7295
|
-
if (sawActive) {
|
|
7296
|
-
console.error(
|
|
7297
|
-
`Round finished \u2014 \`gauge experiments get ${id}\` shows the directions and rewrites.`
|
|
7298
|
-
);
|
|
7299
|
-
return;
|
|
7300
|
-
}
|
|
7301
|
-
draftPolls += 1;
|
|
7302
|
-
if (draftPolls >= GRACE_POLLS) {
|
|
7303
|
-
console.error(
|
|
7304
|
-
`Nothing is running \u2014 \`gauge experiments get ${id}\` shows the draft.`
|
|
7305
|
-
);
|
|
7306
|
-
return;
|
|
7307
|
-
}
|
|
7308
|
-
} else {
|
|
7309
|
-
sawActive = true;
|
|
7310
|
-
}
|
|
7311
|
-
await sleep2(intervalMs);
|
|
7312
|
-
}
|
|
7313
|
-
const rec = await client.get(
|
|
7314
|
-
`${itemPath(org, id)}/recommendation`
|
|
7315
|
-
);
|
|
7316
|
-
printJson(rec);
|
|
7317
|
-
});
|
|
7318
|
-
group.command("export <id>").description("Print the settled recommendation (JSON)").action(async (id, _opts, cmd) => {
|
|
7319
|
-
const org = resolveOrg(cmd);
|
|
7320
|
-
const rec = await createClient().get(
|
|
7321
|
-
`${itemPath(org, id)}/recommendation`
|
|
7322
|
-
);
|
|
7323
|
-
printJson(rec);
|
|
7324
|
-
});
|
|
7325
|
-
group.command("ship <id> <variantId>").description("Mark a variant as shipped to your live docs").action(
|
|
7326
|
-
async (id, variantId, _o, cmd) => {
|
|
7327
|
-
const org = resolveOrg(cmd);
|
|
7328
|
-
await createClient().post(`${itemPath(org, id)}/ship`, { variantId });
|
|
7329
|
-
if (resolveOutput(cmd) !== "json") console.log("Marked shipped");
|
|
7330
|
-
}
|
|
7331
|
-
);
|
|
7332
|
-
group.command("unship <id>").description("Clear the shipped mark").action(async (id, _opts, cmd) => {
|
|
7333
|
-
const org = resolveOrg(cmd);
|
|
7334
|
-
await createClient().delete(`${itemPath(org, id)}/ship`);
|
|
7335
|
-
if (resolveOutput(cmd) !== "json") console.log("Cleared");
|
|
7336
|
-
});
|
|
7337
|
-
group.command("cancel <id>").description("Cancel a draft/generating/launching experiment").action(async (id, _opts, cmd) => {
|
|
7338
|
-
const org = resolveOrg(cmd);
|
|
7339
|
-
await createClient().post(`${itemPath(org, id)}/cancel`, {});
|
|
7340
|
-
if (resolveOutput(cmd) !== "json") console.log(`Canceled ${id}`);
|
|
7341
|
-
});
|
|
7342
|
-
}
|
|
7343
|
-
|
|
7344
6657
|
// src/commands/instructions.ts
|
|
7345
6658
|
var instructions_exports = {};
|
|
7346
6659
|
__export(instructions_exports, {
|
|
7347
|
-
register: () =>
|
|
6660
|
+
register: () => register12
|
|
7348
6661
|
});
|
|
7349
6662
|
import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
7350
6663
|
import { join as join3 } from "path";
|
|
@@ -7463,7 +6776,7 @@ function resolveTopic(topic) {
|
|
|
7463
6776
|
|
|
7464
6777
|
// src/commands/instructions.ts
|
|
7465
6778
|
var INSTALL_ROOT = ".claude/skills";
|
|
7466
|
-
function
|
|
6779
|
+
function register12(program2) {
|
|
7467
6780
|
program2.command("instructions [topic]").description(
|
|
7468
6781
|
`Instructions for a coding agent using this CLI. Run before your first gauge command; a topic reprints one group: ${TOPIC_NAMES.join(", ")}`
|
|
7469
6782
|
).option("--list", "print the topic names only").option(
|
|
@@ -7496,7 +6809,7 @@ function register13(program2) {
|
|
|
7496
6809
|
// src/commands/keys.ts
|
|
7497
6810
|
var keys_exports2 = {};
|
|
7498
6811
|
__export(keys_exports2, {
|
|
7499
|
-
register: () =>
|
|
6812
|
+
register: () => register13
|
|
7500
6813
|
});
|
|
7501
6814
|
function keysPath(org) {
|
|
7502
6815
|
return `/api/v1/orgs/${encodeURIComponent(org)}/provider-keys`;
|
|
@@ -7539,7 +6852,7 @@ async function readKeyInput(opts) {
|
|
|
7539
6852
|
}
|
|
7540
6853
|
return key;
|
|
7541
6854
|
}
|
|
7542
|
-
function
|
|
6855
|
+
function register13(program2) {
|
|
7543
6856
|
const group = program2.command("keys").description("Manage BYOK provider keys (write-only; reads show last4)");
|
|
7544
6857
|
group.command("set <provider>").description(
|
|
7545
6858
|
"Set a provider key (anthropic|openai); reads it from stdin or GAUGE_PROVIDER_KEY"
|
|
@@ -7595,9 +6908,9 @@ function register14(program2) {
|
|
|
7595
6908
|
// src/commands/mcp.ts
|
|
7596
6909
|
var mcp_exports2 = {};
|
|
7597
6910
|
__export(mcp_exports2, {
|
|
7598
|
-
register: () =>
|
|
6911
|
+
register: () => register14
|
|
7599
6912
|
});
|
|
7600
|
-
import { readFileSync as
|
|
6913
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
7601
6914
|
function mcpPath(org) {
|
|
7602
6915
|
return `/api/v1/orgs/${encodeURIComponent(org)}/mcp-servers`;
|
|
7603
6916
|
}
|
|
@@ -7613,7 +6926,7 @@ function specFromOpts(opts) {
|
|
|
7613
6926
|
throw new CliError("usage", "--spec-file conflicts with --command/--url");
|
|
7614
6927
|
try {
|
|
7615
6928
|
return JSON.parse(
|
|
7616
|
-
|
|
6929
|
+
readFileSync7(opts.specFile === "-" ? 0 : opts.specFile, "utf8")
|
|
7617
6930
|
);
|
|
7618
6931
|
} catch (e) {
|
|
7619
6932
|
throw new CliError(
|
|
@@ -7642,7 +6955,7 @@ function specFromOpts(opts) {
|
|
|
7642
6955
|
...tools.length ? { tools } : {}
|
|
7643
6956
|
};
|
|
7644
6957
|
}
|
|
7645
|
-
function
|
|
6958
|
+
function register14(program2) {
|
|
7646
6959
|
const group = program2.command("mcp").description("Manage MCP servers used by eval and visibility runs");
|
|
7647
6960
|
group.command("list").description("List the org's MCP servers with their newest version").action(async (_opts, cmd) => {
|
|
7648
6961
|
const org = resolveOrg(cmd);
|
|
@@ -7773,9 +7086,9 @@ function register15(program2) {
|
|
|
7773
7086
|
// src/commands/members.ts
|
|
7774
7087
|
var members_exports = {};
|
|
7775
7088
|
__export(members_exports, {
|
|
7776
|
-
register: () =>
|
|
7089
|
+
register: () => register15
|
|
7777
7090
|
});
|
|
7778
|
-
function
|
|
7091
|
+
function register15(program2) {
|
|
7779
7092
|
const group = program2.command("members").description("Team members and pending invites (read-only)");
|
|
7780
7093
|
group.command("list").description("List members and pending invites").action(async (_opts, cmd) => {
|
|
7781
7094
|
const org = resolveOrg(cmd);
|
|
@@ -7817,7 +7130,7 @@ var models_exports = {};
|
|
|
7817
7130
|
__export(models_exports, {
|
|
7818
7131
|
capabilityLabel: () => capabilityLabel,
|
|
7819
7132
|
executionTargetsPath: () => executionTargetsPath,
|
|
7820
|
-
register: () =>
|
|
7133
|
+
register: () => register16
|
|
7821
7134
|
});
|
|
7822
7135
|
function executionTargetsPath(org) {
|
|
7823
7136
|
return `/api/v1/orgs/${encodeURIComponent(org)}/execution-targets`;
|
|
@@ -7825,7 +7138,7 @@ function executionTargetsPath(org) {
|
|
|
7825
7138
|
function capabilityLabel(capabilities) {
|
|
7826
7139
|
return Object.entries(capabilities).filter(([, supported]) => supported).map(([name]) => name === "agentContext" ? "context" : name).join(", ");
|
|
7827
7140
|
}
|
|
7828
|
-
function
|
|
7141
|
+
function register16(program2) {
|
|
7829
7142
|
const group = program2.command("models").description("Discover supported models, harnesses, and providers");
|
|
7830
7143
|
group.command("list", { isDefault: true }).description("List execution targets available to the organization").action(async (_opts, cmd) => {
|
|
7831
7144
|
const org = resolveOrg(cmd);
|
|
@@ -7852,7 +7165,7 @@ function register17(program2) {
|
|
|
7852
7165
|
// src/commands/onboard.ts
|
|
7853
7166
|
var onboard_exports = {};
|
|
7854
7167
|
__export(onboard_exports, {
|
|
7855
|
-
register: () =>
|
|
7168
|
+
register: () => register17
|
|
7856
7169
|
});
|
|
7857
7170
|
function orgNameFromEmail(email) {
|
|
7858
7171
|
const domain = email?.split("@")[1] ?? "";
|
|
@@ -7860,7 +7173,7 @@ function orgNameFromEmail(email) {
|
|
|
7860
7173
|
if (!base) return "My Workspace";
|
|
7861
7174
|
return base.charAt(0).toUpperCase() + base.slice(1);
|
|
7862
7175
|
}
|
|
7863
|
-
function
|
|
7176
|
+
function register17(program2) {
|
|
7864
7177
|
program2.command("onboard").description(
|
|
7865
7178
|
"Self-serve onboarding: sign in (device flow) and create your first workspace"
|
|
7866
7179
|
).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(
|
|
@@ -7967,28 +7280,28 @@ __export(optimizations_exports2, {
|
|
|
7967
7280
|
parseTarget: () => parseTarget,
|
|
7968
7281
|
planFromOpts: () => planFromOpts,
|
|
7969
7282
|
readSkillDir: () => readSkillDir,
|
|
7970
|
-
register: () =>
|
|
7283
|
+
register: () => register18,
|
|
7971
7284
|
trialBodyFromOpts: () => trialBodyFromOpts,
|
|
7972
7285
|
trialTemplate: () => trialTemplate,
|
|
7973
7286
|
watchStops: () => watchStops
|
|
7974
7287
|
});
|
|
7975
|
-
import { readdirSync, readFileSync as
|
|
7288
|
+
import { readdirSync, readFileSync as readFileSync8, statSync } from "fs";
|
|
7976
7289
|
import { join as join4, relative as relative2, sep as sep2 } from "path";
|
|
7977
|
-
var
|
|
7290
|
+
var TERMINAL = /* @__PURE__ */ new Set(["DONE", "ARCHIVED"]);
|
|
7978
7291
|
var EFFORTS = ["low", "medium", "high", "xhigh"];
|
|
7979
7292
|
function basePath(org) {
|
|
7980
7293
|
return `/api/v1/orgs/${encodeURIComponent(org)}/optimizations`;
|
|
7981
7294
|
}
|
|
7982
|
-
function
|
|
7295
|
+
function itemPath(org, id) {
|
|
7983
7296
|
return `${basePath(org)}/${encodeURIComponent(id)}`;
|
|
7984
7297
|
}
|
|
7985
7298
|
function trialPath(org, id, trialId) {
|
|
7986
|
-
return `${
|
|
7299
|
+
return `${itemPath(org, id)}/trials/${encodeURIComponent(trialId)}`;
|
|
7987
7300
|
}
|
|
7988
|
-
function
|
|
7989
|
-
return
|
|
7301
|
+
function readText(path2) {
|
|
7302
|
+
return readFileSync8(path2 === "-" ? 0 : path2, "utf8");
|
|
7990
7303
|
}
|
|
7991
|
-
function
|
|
7304
|
+
function sleep2(ms) {
|
|
7992
7305
|
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
7993
7306
|
}
|
|
7994
7307
|
function parseSubject(opts) {
|
|
@@ -8041,19 +7354,19 @@ var NEXT_ACTION_HINT = {
|
|
|
8041
7354
|
AUTHOR_TRIAL: "author the next trial: `gauge optimizations trials add <id>`",
|
|
8042
7355
|
LAUNCH_ROUND: "launch the saved round: `gauge optimizations launch <id>`",
|
|
8043
7356
|
ADOPT: "adopt the winning trial: `gauge optimizations adopt <id> <trial>`",
|
|
8044
|
-
RESUME: "resume it
|
|
7357
|
+
RESUME: "resume it in the web app, or `gauge optimizations cancel <id>`",
|
|
8045
7358
|
NONE: "nothing to do in Gauge"
|
|
8046
7359
|
};
|
|
8047
7360
|
function awaitingInput(detail) {
|
|
8048
7361
|
return detail.nextAction !== "WAIT" && detail.nextAction !== "NONE";
|
|
8049
7362
|
}
|
|
8050
7363
|
function watchStops(detail, follow) {
|
|
8051
|
-
return
|
|
7364
|
+
return TERMINAL.has(detail.status) || detail.nextAction === "NONE" || !follow && awaitingInput(detail);
|
|
8052
7365
|
}
|
|
8053
7366
|
function readObject(path2) {
|
|
8054
7367
|
let value;
|
|
8055
7368
|
try {
|
|
8056
|
-
value = JSON.parse(
|
|
7369
|
+
value = JSON.parse(readText(path2));
|
|
8057
7370
|
} catch {
|
|
8058
7371
|
throw new CliError("usage", "the file must contain valid JSON");
|
|
8059
7372
|
}
|
|
@@ -8086,7 +7399,7 @@ function parseStatuses(raw) {
|
|
|
8086
7399
|
);
|
|
8087
7400
|
return parts.join(",");
|
|
8088
7401
|
}
|
|
8089
|
-
function readSkillDir(dir, read =
|
|
7402
|
+
function readSkillDir(dir, read = readText, walk = listFiles) {
|
|
8090
7403
|
const paths = walk(dir).sort();
|
|
8091
7404
|
if (!paths.length)
|
|
8092
7405
|
throw new CliError("usage", `no files under ${dir} to send`);
|
|
@@ -8113,7 +7426,7 @@ function listFiles(dir) {
|
|
|
8113
7426
|
return statSync(path2).isDirectory() ? listFiles(path2) : [path2];
|
|
8114
7427
|
});
|
|
8115
7428
|
}
|
|
8116
|
-
function trialBodyFromOpts(opts, read =
|
|
7429
|
+
function trialBodyFromOpts(opts, read = readText, walk) {
|
|
8117
7430
|
const launch = opts.launch === true;
|
|
8118
7431
|
const idempotencyKey = opts.idempotencyKey;
|
|
8119
7432
|
const fork = opts.forkRun || opts.forkBoundary ? (() => {
|
|
@@ -8255,7 +7568,7 @@ function pct(value) {
|
|
|
8255
7568
|
function subjectLabel(kind) {
|
|
8256
7569
|
return kind === "EVAL_SET" ? "eval" : "preference";
|
|
8257
7570
|
}
|
|
8258
|
-
function
|
|
7571
|
+
function toRow3(o) {
|
|
8259
7572
|
return {
|
|
8260
7573
|
id: o.id,
|
|
8261
7574
|
name: o.name.length > 40 ? `${o.name.slice(0, 37)}...` : o.name,
|
|
@@ -8284,7 +7597,7 @@ function trialRow(t) {
|
|
|
8284
7597
|
id: t.id
|
|
8285
7598
|
};
|
|
8286
7599
|
}
|
|
8287
|
-
function
|
|
7600
|
+
function printDetail3(o) {
|
|
8288
7601
|
console.log(`id: ${o.id}`);
|
|
8289
7602
|
console.log(`name: ${o.name}`);
|
|
8290
7603
|
console.log(
|
|
@@ -8408,7 +7721,7 @@ function addPlanOptions(command) {
|
|
|
8408
7721
|
"the one harness/model every session runs on, e.g. claude-code:claude-opus-4-8"
|
|
8409
7722
|
);
|
|
8410
7723
|
}
|
|
8411
|
-
function
|
|
7724
|
+
function register18(program2) {
|
|
8412
7725
|
const group = program2.command("optimizations").alias("optimize").description(
|
|
8413
7726
|
"Start, steer, and read optimizations: Gauge changes one owned surface per trial and reports the best measured change against the baseline"
|
|
8414
7727
|
);
|
|
@@ -8430,14 +7743,14 @@ function register19(program2) {
|
|
|
8430
7743
|
}
|
|
8431
7744
|
);
|
|
8432
7745
|
if (resolveOutput(cmd) === "json") printJson(res.items);
|
|
8433
|
-
else printItems(res.items.map(
|
|
7746
|
+
else printItems(res.items.map(toRow3), "table");
|
|
8434
7747
|
}
|
|
8435
7748
|
);
|
|
8436
7749
|
group.command("get <id>").description("One optimization: settings, score, and its trial ladder").action(async (id, _opts, cmd) => {
|
|
8437
7750
|
const org = resolveOrg(cmd);
|
|
8438
|
-
const detail = await createClient().get(
|
|
7751
|
+
const detail = await createClient().get(itemPath(org, id));
|
|
8439
7752
|
if (resolveOutput(cmd) === "json") printJson(detail);
|
|
8440
|
-
else
|
|
7753
|
+
else printDetail3(detail);
|
|
8441
7754
|
});
|
|
8442
7755
|
addSubjectOptions(
|
|
8443
7756
|
group.command("diagnose").description(
|
|
@@ -8520,7 +7833,7 @@ function register19(program2) {
|
|
|
8520
7833
|
opts.yes
|
|
8521
7834
|
);
|
|
8522
7835
|
const detail = await createClient().post(
|
|
8523
|
-
`${
|
|
7836
|
+
`${itemPath(org, id)}/cancel`,
|
|
8524
7837
|
{}
|
|
8525
7838
|
);
|
|
8526
7839
|
if (resolveOutput(cmd) === "json") printJson(detail);
|
|
@@ -8544,7 +7857,7 @@ function register19(program2) {
|
|
|
8544
7857
|
}
|
|
8545
7858
|
);
|
|
8546
7859
|
if (resolveOutput(cmd) === "json") printJson(detail);
|
|
8547
|
-
else
|
|
7860
|
+
else printDetail3(detail);
|
|
8548
7861
|
}
|
|
8549
7862
|
);
|
|
8550
7863
|
addPlanOptions(
|
|
@@ -8563,11 +7876,11 @@ function register19(program2) {
|
|
|
8563
7876
|
if (!Object.keys(body).length)
|
|
8564
7877
|
throw new CliError("usage", "pass plan flags, --name, or --file");
|
|
8565
7878
|
const detail = await createClient().patch(
|
|
8566
|
-
|
|
7879
|
+
itemPath(resolveOrg(cmd), id),
|
|
8567
7880
|
body
|
|
8568
7881
|
);
|
|
8569
7882
|
if (resolveOutput(cmd) === "json") printJson(detail);
|
|
8570
|
-
else
|
|
7883
|
+
else printDetail3(detail);
|
|
8571
7884
|
}
|
|
8572
7885
|
);
|
|
8573
7886
|
addPlanOptions(
|
|
@@ -8578,11 +7891,11 @@ function register19(program2) {
|
|
|
8578
7891
|
const client = createClient();
|
|
8579
7892
|
const plan = planFromOpts(opts);
|
|
8580
7893
|
const creditCap = parseCreditEstimate(opts.creditCap);
|
|
8581
|
-
const current = await client.get(
|
|
7894
|
+
const current = await client.get(itemPath(org, id));
|
|
8582
7895
|
if (current.status !== "DRAFT")
|
|
8583
7896
|
throw new CliError(
|
|
8584
7897
|
"usage",
|
|
8585
|
-
"only a draft can start; use
|
|
7898
|
+
"only a draft can start; use continue instead"
|
|
8586
7899
|
);
|
|
8587
7900
|
const target = plan.target ?? (current.settings.pinnedAgent ? {
|
|
8588
7901
|
agent: current.settings.pinnedAgent,
|
|
@@ -8610,13 +7923,13 @@ function register19(program2) {
|
|
|
8610
7923
|
`Start baseline for ${id}? Estimated full optimization: ${creditCap ?? estimate.estimate} credits, not a spending cap.`,
|
|
8611
7924
|
opts.yes
|
|
8612
7925
|
);
|
|
8613
|
-
const detail = await client.post(`${
|
|
7926
|
+
const detail = await client.post(`${itemPath(org, id)}/start`, {
|
|
8614
7927
|
...plan,
|
|
8615
7928
|
name: opts.name,
|
|
8616
7929
|
creditCap
|
|
8617
7930
|
});
|
|
8618
7931
|
if (resolveOutput(cmd) === "json") printJson(detail);
|
|
8619
|
-
else
|
|
7932
|
+
else printDetail3(detail);
|
|
8620
7933
|
}
|
|
8621
7934
|
);
|
|
8622
7935
|
group.command("launch <id>").description(
|
|
@@ -8627,7 +7940,7 @@ function register19(program2) {
|
|
|
8627
7940
|
opts.yes
|
|
8628
7941
|
);
|
|
8629
7942
|
const result = await createClient().post(
|
|
8630
|
-
`${
|
|
7943
|
+
`${itemPath(resolveOrg(cmd), id)}/rounds/current/launch`,
|
|
8631
7944
|
{}
|
|
8632
7945
|
);
|
|
8633
7946
|
if (resolveOutput(cmd) === "json") printJson(result);
|
|
@@ -8651,26 +7964,16 @@ function register19(program2) {
|
|
|
8651
7964
|
opts.yes
|
|
8652
7965
|
);
|
|
8653
7966
|
const detail = await createClient().post(
|
|
8654
|
-
`${
|
|
7967
|
+
`${itemPath(resolveOrg(cmd), id)}/continue`,
|
|
8655
7968
|
{ rounds, maxTrialsPerRound }
|
|
8656
7969
|
);
|
|
8657
7970
|
if (resolveOutput(cmd) === "json") printJson(detail);
|
|
8658
|
-
else
|
|
7971
|
+
else printDetail3(detail);
|
|
8659
7972
|
}
|
|
8660
7973
|
);
|
|
8661
|
-
group.command("resume <id>").description(
|
|
8662
|
-
"Resume a legacy paused optimization with interactive authoring"
|
|
8663
|
-
).action(async (id, _opts, cmd) => {
|
|
8664
|
-
const detail = await createClient().post(
|
|
8665
|
-
`${itemPath2(resolveOrg(cmd), id)}/resume`,
|
|
8666
|
-
{}
|
|
8667
|
-
);
|
|
8668
|
-
if (resolveOutput(cmd) === "json") printJson(detail);
|
|
8669
|
-
else printDetail4(detail);
|
|
8670
|
-
});
|
|
8671
7974
|
group.command("activity <id>").description("Read the optimization's decision log").option("--after <timestamp>", "entries after this ISO timestamp").option("--limit <n>", "maximum entries (1\u2013500)").action(
|
|
8672
7975
|
async (id, opts, cmd) => {
|
|
8673
|
-
const res = await createClient().get(`${
|
|
7976
|
+
const res = await createClient().get(`${itemPath(resolveOrg(cmd), id)}/activity`, {
|
|
8674
7977
|
after: opts.after,
|
|
8675
7978
|
limit: parseCount(opts.limit, "--limit", 500)
|
|
8676
7979
|
});
|
|
@@ -8689,7 +7992,7 @@ function register19(program2) {
|
|
|
8689
7992
|
);
|
|
8690
7993
|
group.command("chat <id>").description("Resolve your optimization chat and print its URL path").action(async (id, _opts, cmd) => {
|
|
8691
7994
|
const res = await createClient().post(
|
|
8692
|
-
`${
|
|
7995
|
+
`${itemPath(resolveOrg(cmd), id)}/chat`,
|
|
8693
7996
|
{}
|
|
8694
7997
|
);
|
|
8695
7998
|
if (resolveOutput(cmd) === "json") printJson(res);
|
|
@@ -8700,7 +8003,7 @@ function register19(program2) {
|
|
|
8700
8003
|
`Delete optimization ${id}, its rounds, trials, and activity? Session history is kept.`,
|
|
8701
8004
|
opts.yes
|
|
8702
8005
|
);
|
|
8703
|
-
await createClient().delete(
|
|
8006
|
+
await createClient().delete(itemPath(resolveOrg(cmd), id));
|
|
8704
8007
|
if (resolveOutput(cmd) === "json") printJson({ deleted: id });
|
|
8705
8008
|
else console.log(`Deleted ${id}.`);
|
|
8706
8009
|
});
|
|
@@ -8712,7 +8015,7 @@ function register19(program2) {
|
|
|
8712
8015
|
opts.yes
|
|
8713
8016
|
);
|
|
8714
8017
|
const detail = await createClient().post(
|
|
8715
|
-
`${
|
|
8018
|
+
`${itemPath(org, id)}/complete`,
|
|
8716
8019
|
opts.adopt ? { adoptTrialId: opts.adopt } : {}
|
|
8717
8020
|
);
|
|
8718
8021
|
if (resolveOutput(cmd) === "json") printJson(detail);
|
|
@@ -8735,7 +8038,7 @@ function register19(program2) {
|
|
|
8735
8038
|
const intervalMs = Math.max(interval * 1e3, 2e3);
|
|
8736
8039
|
let last = "";
|
|
8737
8040
|
for (; ; ) {
|
|
8738
|
-
const detail = await client.get(
|
|
8041
|
+
const detail = await client.get(itemPath(org, id));
|
|
8739
8042
|
const trials2 = detail.rounds.flatMap((round2) => round2.trials);
|
|
8740
8043
|
const line = `${detail.status}${detail.stopReason ? ` (${detail.stopReason})` : ""} \xB7 round ${detail.round}/${detail.maxRounds} \xB7 ${pct(detail.before)} \u2192 ${pct(detail.after)} \xB7 ${detail.creditsSpent} credits spent \xB7 ${trials2.filter((t) => t.status === "RUNNING").map((t) => t.key).join(",") || "idle"}`;
|
|
8741
8044
|
if (line !== last) {
|
|
@@ -8745,11 +8048,11 @@ function register19(program2) {
|
|
|
8745
8048
|
const needsInput = awaitingInput(detail);
|
|
8746
8049
|
if (watchStops(detail, !!opts.follow)) {
|
|
8747
8050
|
if (resolveOutput(cmd) === "json") printJson(detail);
|
|
8748
|
-
else
|
|
8051
|
+
else printDetail3(detail);
|
|
8749
8052
|
if (needsInput) process.exitCode = NEEDS_INPUT_EXIT;
|
|
8750
8053
|
return;
|
|
8751
8054
|
}
|
|
8752
|
-
await
|
|
8055
|
+
await sleep2(intervalMs);
|
|
8753
8056
|
}
|
|
8754
8057
|
}
|
|
8755
8058
|
);
|
|
@@ -8757,7 +8060,7 @@ function register19(program2) {
|
|
|
8757
8060
|
"What the next round may change: kinds, CLI targets and commands, baseline invocations, revision"
|
|
8758
8061
|
).action(async (id, _opts, cmd) => {
|
|
8759
8062
|
printJson(
|
|
8760
|
-
await createClient().get(`${
|
|
8063
|
+
await createClient().get(`${itemPath(resolveOrg(cmd), id)}/authoring`)
|
|
8761
8064
|
);
|
|
8762
8065
|
});
|
|
8763
8066
|
group.command("invocation <id> <invocationId>").description(
|
|
@@ -8766,7 +8069,7 @@ function register19(program2) {
|
|
|
8766
8069
|
async (id, invocationId, _opts, cmd) => {
|
|
8767
8070
|
printJson(
|
|
8768
8071
|
await createClient().get(
|
|
8769
|
-
`${
|
|
8072
|
+
`${itemPath(resolveOrg(cmd), id)}/authoring/target`,
|
|
8770
8073
|
{ cliInvocationId: invocationId }
|
|
8771
8074
|
)
|
|
8772
8075
|
);
|
|
@@ -8777,7 +8080,7 @@ function register19(program2) {
|
|
|
8777
8080
|
).requiredOption("--file <path>", "the change JSON; '-' for stdin").action(async (id, opts, cmd) => {
|
|
8778
8081
|
printJson(
|
|
8779
8082
|
await createClient().post(
|
|
8780
|
-
`${
|
|
8083
|
+
`${itemPath(resolveOrg(cmd), id)}/cli-changes`,
|
|
8781
8084
|
readObject(opts.file)
|
|
8782
8085
|
)
|
|
8783
8086
|
);
|
|
@@ -8787,7 +8090,7 @@ function register19(program2) {
|
|
|
8787
8090
|
);
|
|
8788
8091
|
round.command("preview <id>").description("Validate a round file and print its diff and previewDigest").requiredOption("--file <path>", "the round JSON; '-' for stdin").action(async (id, opts, cmd) => {
|
|
8789
8092
|
const preview = await createClient().post(
|
|
8790
|
-
`${
|
|
8093
|
+
`${itemPath(resolveOrg(cmd), id)}/rounds/current/preview`,
|
|
8791
8094
|
readObject(opts.file)
|
|
8792
8095
|
);
|
|
8793
8096
|
if (resolveOutput(cmd) === "json") printJson(preview);
|
|
@@ -8798,7 +8101,7 @@ function register19(program2) {
|
|
|
8798
8101
|
).requiredOption("--file <path>", "the round JSON you previewed").requiredOption("--digest <digest>", "previewDigest from `round preview`").action(
|
|
8799
8102
|
async (id, opts, cmd) => {
|
|
8800
8103
|
const result = await createClient().put(
|
|
8801
|
-
`${
|
|
8104
|
+
`${itemPath(resolveOrg(cmd), id)}/rounds/current`,
|
|
8802
8105
|
{ ...readObject(opts.file), previewDigest: opts.digest }
|
|
8803
8106
|
);
|
|
8804
8107
|
if (resolveOutput(cmd) === "json") printJson(result);
|
|
@@ -8811,7 +8114,7 @@ function register19(program2) {
|
|
|
8811
8114
|
trials.command("list <id>").description("Every trial of an optimization with score and verdict").action(async (id, _opts, cmd) => {
|
|
8812
8115
|
const org = resolveOrg(cmd);
|
|
8813
8116
|
const res = await createClient().get(
|
|
8814
|
-
`${
|
|
8117
|
+
`${itemPath(org, id)}/trials`
|
|
8815
8118
|
);
|
|
8816
8119
|
if (resolveOutput(cmd) === "json") printJson(res.items);
|
|
8817
8120
|
else printItems(res.items.map(trialRow), "table");
|
|
@@ -8829,7 +8132,7 @@ function register19(program2) {
|
|
|
8829
8132
|
"local directory holding the complete edited bundle, SKILL.md included"
|
|
8830
8133
|
).option("--page <url>", "docs page to rewrite (with --body-file)").option("--body-file <path>", "the rewritten page body; '-' for stdin").option("--fork-run <runId>", "fork-at-fetch source run for a docs rewrite").option(
|
|
8831
8134
|
"--fork-boundary <seq>",
|
|
8832
|
-
"fork-at-fetch boundary from `gauge
|
|
8135
|
+
"fork-at-fetch boundary from `gauge runs fork-boundaries`"
|
|
8833
8136
|
).option(
|
|
8834
8137
|
"--launch",
|
|
8835
8138
|
"run the trial after saving (spends credits); otherwise save a draft"
|
|
@@ -8845,7 +8148,7 @@ function register19(program2) {
|
|
|
8845
8148
|
`Run trial "${body.trial.title}" on ${id} now? Spends credits.`,
|
|
8846
8149
|
opts.yes
|
|
8847
8150
|
);
|
|
8848
|
-
const result = await createClient().post(`${
|
|
8151
|
+
const result = await createClient().post(`${itemPath(org, id)}/trials`, body);
|
|
8849
8152
|
if (resolveOutput(cmd) === "json") printJson(result);
|
|
8850
8153
|
else if (result.replayed)
|
|
8851
8154
|
console.log(
|
|
@@ -8951,7 +8254,7 @@ function register19(program2) {
|
|
|
8951
8254
|
).requiredOption("--url <url>", "the page URL").action(async (id, opts, cmd) => {
|
|
8952
8255
|
const org = resolveOrg(cmd);
|
|
8953
8256
|
const res = await createClient().get(
|
|
8954
|
-
`${
|
|
8257
|
+
`${itemPath(org, id)}/page`,
|
|
8955
8258
|
{ url: opts.url }
|
|
8956
8259
|
);
|
|
8957
8260
|
if (resolveOutput(cmd) === "json") printJson(res);
|
|
@@ -8962,7 +8265,7 @@ function register19(program2) {
|
|
|
8962
8265
|
// src/commands/org.ts
|
|
8963
8266
|
var org_exports = {};
|
|
8964
8267
|
__export(org_exports, {
|
|
8965
|
-
register: () =>
|
|
8268
|
+
register: () => register19
|
|
8966
8269
|
});
|
|
8967
8270
|
function printSettings(s) {
|
|
8968
8271
|
console.log(`slug: ${s.slug}`);
|
|
@@ -8976,7 +8279,7 @@ function printSettings(s) {
|
|
|
8976
8279
|
);
|
|
8977
8280
|
console.log(`auto-join: ${s.autoJoinDomain ?? "off"}`);
|
|
8978
8281
|
}
|
|
8979
|
-
function
|
|
8282
|
+
function register19(program2) {
|
|
8980
8283
|
const group = program2.command("org").description(
|
|
8981
8284
|
"This org's settings, read-only (see `gauge orgs` for the org list)"
|
|
8982
8285
|
);
|
|
@@ -8993,12 +8296,12 @@ function register20(program2) {
|
|
|
8993
8296
|
// src/commands/orgs.ts
|
|
8994
8297
|
var orgs_exports2 = {};
|
|
8995
8298
|
__export(orgs_exports2, {
|
|
8996
|
-
register: () =>
|
|
8299
|
+
register: () => register20
|
|
8997
8300
|
});
|
|
8998
8301
|
function isDefault(org, defaultOrg) {
|
|
8999
8302
|
return defaultOrg !== void 0 && (org.slug === defaultOrg || org.publicId === defaultOrg);
|
|
9000
8303
|
}
|
|
9001
|
-
function
|
|
8304
|
+
function register20(program2) {
|
|
9002
8305
|
const orgs = program2.command("orgs").description("Organizations");
|
|
9003
8306
|
orgs.command("list").description("List orgs you belong to").action(async (_opts, command) => {
|
|
9004
8307
|
const output = resolveOutput(command);
|
|
@@ -9069,12 +8372,12 @@ function register21(program2) {
|
|
|
9069
8372
|
// src/commands/personas.ts
|
|
9070
8373
|
var personas_exports2 = {};
|
|
9071
8374
|
__export(personas_exports2, {
|
|
9072
|
-
register: () =>
|
|
8375
|
+
register: () => register21
|
|
9073
8376
|
});
|
|
9074
8377
|
function personasPath(org) {
|
|
9075
8378
|
return `/api/v1/orgs/${encodeURIComponent(org)}/personas`;
|
|
9076
8379
|
}
|
|
9077
|
-
function
|
|
8380
|
+
function register21(program2) {
|
|
9078
8381
|
const group = program2.command("personas").description("Manage simulated-user personas for eval and visibility runs");
|
|
9079
8382
|
group.command("list").description("List the org's personas").action(async (_opts, cmd) => {
|
|
9080
8383
|
const org = resolveOrg(cmd);
|
|
@@ -9147,7 +8450,7 @@ function register22(program2) {
|
|
|
9147
8450
|
// src/commands/query.ts
|
|
9148
8451
|
var query_exports2 = {};
|
|
9149
8452
|
__export(query_exports2, {
|
|
9150
|
-
register: () =>
|
|
8453
|
+
register: () => register22
|
|
9151
8454
|
});
|
|
9152
8455
|
var collect3 = (value, prev = []) => [
|
|
9153
8456
|
...prev,
|
|
@@ -9339,7 +8642,7 @@ async function showMetadata(command, mode, dataset) {
|
|
|
9339
8642
|
console.error(`dataset: ${ds.name} \u2014 ${ds.grain}`);
|
|
9340
8643
|
printItems(rows, "table");
|
|
9341
8644
|
}
|
|
9342
|
-
function
|
|
8645
|
+
function register22(program2) {
|
|
9343
8646
|
const group = program2.command("query").description(
|
|
9344
8647
|
"Flexible reports over your event warehouse (run a report, or discover the catalog)"
|
|
9345
8648
|
);
|
|
@@ -9375,7 +8678,7 @@ function register23(program2) {
|
|
|
9375
8678
|
// src/commands/repos.ts
|
|
9376
8679
|
var repos_exports2 = {};
|
|
9377
8680
|
__export(repos_exports2, {
|
|
9378
|
-
register: () =>
|
|
8681
|
+
register: () => register23
|
|
9379
8682
|
});
|
|
9380
8683
|
function reposPath(org) {
|
|
9381
8684
|
return `/api/v1/orgs/${encodeURIComponent(org)}/repos`;
|
|
@@ -9383,7 +8686,7 @@ function reposPath(org) {
|
|
|
9383
8686
|
async function fetchAllRepos(client, org) {
|
|
9384
8687
|
return fetchAllPages(client, reposPath(org));
|
|
9385
8688
|
}
|
|
9386
|
-
function
|
|
8689
|
+
function toRow4(repo) {
|
|
9387
8690
|
return {
|
|
9388
8691
|
name: repo.name,
|
|
9389
8692
|
url: repo.url,
|
|
@@ -9398,7 +8701,7 @@ function toRow5(repo) {
|
|
|
9398
8701
|
function syncWarning(repo) {
|
|
9399
8702
|
return `warning: GitHub metadata sync failed; retry with \`gauge repos resync ${repo.url}\``;
|
|
9400
8703
|
}
|
|
9401
|
-
function
|
|
8704
|
+
function register23(program2) {
|
|
9402
8705
|
const repos = program2.command("repos").description("Manage repositories");
|
|
9403
8706
|
repos.command("list").description("List repositories (yours + read-only Gauge-provided ones)").action(async (_opts, command) => {
|
|
9404
8707
|
const org = resolveOrg(command);
|
|
@@ -9408,7 +8711,7 @@ function register24(program2) {
|
|
|
9408
8711
|
printJson(items);
|
|
9409
8712
|
return;
|
|
9410
8713
|
}
|
|
9411
|
-
printItems(items.map(
|
|
8714
|
+
printItems(items.map(toRow4), "table");
|
|
9412
8715
|
});
|
|
9413
8716
|
repos.command("add <url>").description("Add a repository (pulls languages/size/stars from GitHub)").option(
|
|
9414
8717
|
"--ref <ref>",
|
|
@@ -9495,10 +8798,10 @@ function register24(program2) {
|
|
|
9495
8798
|
// src/commands/runRequests.ts
|
|
9496
8799
|
var runRequests_exports2 = {};
|
|
9497
8800
|
__export(runRequests_exports2, {
|
|
9498
|
-
register: () =>
|
|
8801
|
+
register: () => register24
|
|
9499
8802
|
});
|
|
9500
8803
|
var pollIntervalMs = 5e3;
|
|
9501
|
-
function
|
|
8804
|
+
function register24(program2) {
|
|
9502
8805
|
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 (id, _opts, cmd) => {
|
|
9503
8806
|
const org = resolveOrg(cmd);
|
|
9504
8807
|
const path2 = `/api/v1/orgs/${encodeURIComponent(org)}/run-requests/${encodeURIComponent(id)}`;
|
|
@@ -9533,7 +8836,7 @@ function register25(program2) {
|
|
|
9533
8836
|
// src/commands/runs.ts
|
|
9534
8837
|
var runs_exports2 = {};
|
|
9535
8838
|
__export(runs_exports2, {
|
|
9536
|
-
register: () =>
|
|
8839
|
+
register: () => register25
|
|
9537
8840
|
});
|
|
9538
8841
|
function runPath(id) {
|
|
9539
8842
|
return `/api/v1/runs/${encodeURIComponent(id)}`;
|
|
@@ -9554,7 +8857,7 @@ function compact(value, max = 140) {
|
|
|
9554
8857
|
const one = s.replace(/\s+/g, " ").trim();
|
|
9555
8858
|
return one.length > max ? `${one.slice(0, max - 1)}\u2026` : one;
|
|
9556
8859
|
}
|
|
9557
|
-
function
|
|
8860
|
+
function toRow5(run) {
|
|
9558
8861
|
const selected = run.selectedProvider?.slug ?? "";
|
|
9559
8862
|
const observed = run.observedProvider?.slug;
|
|
9560
8863
|
return {
|
|
@@ -9793,7 +9096,7 @@ async function streamRun(id, json, opts) {
|
|
|
9793
9096
|
if (drainTimer) clearTimeout(drainTimer);
|
|
9794
9097
|
}
|
|
9795
9098
|
}
|
|
9796
|
-
function
|
|
9099
|
+
function register25(program2) {
|
|
9797
9100
|
const runs = program2.command("runs").description("Inspect and manage runs");
|
|
9798
9101
|
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(
|
|
9799
9102
|
async (opts, command) => {
|
|
@@ -9816,7 +9119,7 @@ function register26(program2) {
|
|
|
9816
9119
|
printJson(page);
|
|
9817
9120
|
return;
|
|
9818
9121
|
}
|
|
9819
|
-
printItems(page.items.map(
|
|
9122
|
+
printItems(page.items.map(toRow5), "table");
|
|
9820
9123
|
if (page.nextCursor) {
|
|
9821
9124
|
console.error(
|
|
9822
9125
|
`(more results \u2014 rerun with --cursor ${page.nextCursor})`
|
|
@@ -9932,7 +9235,7 @@ function register26(program2) {
|
|
|
9932
9235
|
var skills_exports2 = {};
|
|
9933
9236
|
__export(skills_exports2, {
|
|
9934
9237
|
buildSkillEditBody: () => buildSkillEditBody,
|
|
9935
|
-
register: () =>
|
|
9238
|
+
register: () => register26
|
|
9936
9239
|
});
|
|
9937
9240
|
function skillsPath(org) {
|
|
9938
9241
|
return `/api/v1/orgs/${encodeURIComponent(org)}/skills`;
|
|
@@ -9994,7 +9297,7 @@ async function buildSkillEditBody(opts, fetchCurrentSource) {
|
|
|
9994
9297
|
throw new CliError("usage", "nothing to change");
|
|
9995
9298
|
return body;
|
|
9996
9299
|
}
|
|
9997
|
-
function
|
|
9300
|
+
function register26(program2) {
|
|
9998
9301
|
const group = program2.command("skills").description("Manage agent skills used by eval and visibility runs");
|
|
9999
9302
|
group.command("list").description("List the org's skills with their newest version").action(async (_opts, cmd) => {
|
|
10000
9303
|
const org = resolveOrg(cmd);
|
|
@@ -10135,7 +9438,7 @@ function register27(program2) {
|
|
|
10135
9438
|
// src/commands/stats.ts
|
|
10136
9439
|
var stats_exports2 = {};
|
|
10137
9440
|
__export(stats_exports2, {
|
|
10138
|
-
register: () =>
|
|
9441
|
+
register: () => register27
|
|
10139
9442
|
});
|
|
10140
9443
|
function addFilterOptions(cmd) {
|
|
10141
9444
|
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)");
|
|
@@ -10168,7 +9471,7 @@ function noteFreshness2(f) {
|
|
|
10168
9471
|
);
|
|
10169
9472
|
}
|
|
10170
9473
|
}
|
|
10171
|
-
async function runStats(command, resource, opts,
|
|
9474
|
+
async function runStats(command, resource, opts, toRow7) {
|
|
10172
9475
|
const org = resolveOrg(command);
|
|
10173
9476
|
const output = resolveOutput(command);
|
|
10174
9477
|
const res = await createClient().get(
|
|
@@ -10179,7 +9482,7 @@ async function runStats(command, resource, opts, toRow8) {
|
|
|
10179
9482
|
printJson(res);
|
|
10180
9483
|
return;
|
|
10181
9484
|
}
|
|
10182
|
-
printItems(res.items.map(
|
|
9485
|
+
printItems(res.items.map(toRow7), "table");
|
|
10183
9486
|
noteFreshness2(res.freshness);
|
|
10184
9487
|
}
|
|
10185
9488
|
var rankingRow = (r) => ({
|
|
@@ -10218,7 +9521,7 @@ var domainRow = (r) => ({
|
|
|
10218
9521
|
rate: pct3(r.rate),
|
|
10219
9522
|
requests: r.requests
|
|
10220
9523
|
});
|
|
10221
|
-
function
|
|
9524
|
+
function register27(program2) {
|
|
10222
9525
|
const group = program2.command("stats").description("Read-only analytics over your runs");
|
|
10223
9526
|
addFilterOptions(
|
|
10224
9527
|
group.command("rankings").description("Brands ranked by install rate")
|
|
@@ -10250,7 +9553,7 @@ function register28(program2) {
|
|
|
10250
9553
|
// src/commands/status.ts
|
|
10251
9554
|
var status_exports = {};
|
|
10252
9555
|
__export(status_exports, {
|
|
10253
|
-
register: () =>
|
|
9556
|
+
register: () => register28
|
|
10254
9557
|
});
|
|
10255
9558
|
function pct4(rate) {
|
|
10256
9559
|
return rate == null ? "\u2014" : `${Math.round(rate * 100)}%`;
|
|
@@ -10260,7 +9563,7 @@ function delta2(pp) {
|
|
|
10260
9563
|
const rounded = Math.round(pp);
|
|
10261
9564
|
return rounded === 0 ? "" : ` (${rounded > 0 ? "+" : ""}${rounded}pp)`;
|
|
10262
9565
|
}
|
|
10263
|
-
function
|
|
9566
|
+
function register28(program2) {
|
|
10264
9567
|
program2.command("status").description("One-shot org summary: actions, visibility, agent experience").action(async (_opts, cmd) => {
|
|
10265
9568
|
const org = resolveOrg(cmd);
|
|
10266
9569
|
const s = await createClient().get(
|
|
@@ -10322,12 +9625,12 @@ function register29(program2) {
|
|
|
10322
9625
|
// src/commands/tags.ts
|
|
10323
9626
|
var tags_exports2 = {};
|
|
10324
9627
|
__export(tags_exports2, {
|
|
10325
|
-
register: () =>
|
|
9628
|
+
register: () => register29
|
|
10326
9629
|
});
|
|
10327
9630
|
function tagsPath(org) {
|
|
10328
9631
|
return `/api/v1/orgs/${encodeURIComponent(org)}/tags`;
|
|
10329
9632
|
}
|
|
10330
|
-
function
|
|
9633
|
+
function register29(program2) {
|
|
10331
9634
|
const group = program2.command("tags").description("Manage org tags");
|
|
10332
9635
|
group.command("list").description("List tags").action(async (_opts, cmd) => {
|
|
10333
9636
|
const org = resolveOrg(cmd);
|
|
@@ -10370,9 +9673,9 @@ function register30(program2) {
|
|
|
10370
9673
|
// src/commands/usage.ts
|
|
10371
9674
|
var usage_exports = {};
|
|
10372
9675
|
__export(usage_exports, {
|
|
10373
|
-
register: () =>
|
|
9676
|
+
register: () => register30
|
|
10374
9677
|
});
|
|
10375
|
-
function
|
|
9678
|
+
function register30(program2) {
|
|
10376
9679
|
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(
|
|
10377
9680
|
async (opts, cmd) => {
|
|
10378
9681
|
const org = resolveOrg(cmd);
|
|
@@ -10419,7 +9722,7 @@ function register31(program2) {
|
|
|
10419
9722
|
// src/commands/visibility.ts
|
|
10420
9723
|
var visibility_exports2 = {};
|
|
10421
9724
|
__export(visibility_exports2, {
|
|
10422
|
-
register: () =>
|
|
9725
|
+
register: () => register31,
|
|
10423
9726
|
visibilityPath: () => visibilityPath
|
|
10424
9727
|
});
|
|
10425
9728
|
import { Option as Option3 } from "commander";
|
|
@@ -10451,7 +9754,7 @@ function brandsLabel(v) {
|
|
|
10451
9754
|
if (v.kind === "HEAD_TO_HEAD") return `${v.brandA} vs ${v.brandB}`;
|
|
10452
9755
|
return v.branded ? v.brandA ?? "branded" : "organic";
|
|
10453
9756
|
}
|
|
10454
|
-
function
|
|
9757
|
+
function toRow6(v) {
|
|
10455
9758
|
return {
|
|
10456
9759
|
id: v.id,
|
|
10457
9760
|
name: v.name,
|
|
@@ -10463,7 +9766,7 @@ function toRow7(v) {
|
|
|
10463
9766
|
"last run": v.lastRunAt ?? "-"
|
|
10464
9767
|
};
|
|
10465
9768
|
}
|
|
10466
|
-
function
|
|
9769
|
+
function printDetail4(v) {
|
|
10467
9770
|
console.log(`id: ${v.id}`);
|
|
10468
9771
|
console.log(`name: ${v.name}`);
|
|
10469
9772
|
console.log(`kind: ${v.kind}`);
|
|
@@ -10498,7 +9801,7 @@ function registerPreferenceGroup(group) {
|
|
|
10498
9801
|
visibilityPath(org)
|
|
10499
9802
|
);
|
|
10500
9803
|
if (resolveOutput(cmd) === "json") printJson(res.items);
|
|
10501
|
-
else printItems(res.items.map(
|
|
9804
|
+
else printItems(res.items.map(toRow6), "table");
|
|
10502
9805
|
});
|
|
10503
9806
|
group.command("get <id>").description("Show one preference prompt").action(async (id, _opts, cmd) => {
|
|
10504
9807
|
const org = resolveOrg(cmd);
|
|
@@ -10506,7 +9809,7 @@ function registerPreferenceGroup(group) {
|
|
|
10506
9809
|
`${visibilityPath(org)}/${encodeURIComponent(id)}`
|
|
10507
9810
|
);
|
|
10508
9811
|
if (resolveOutput(cmd) === "json") printJson(vp);
|
|
10509
|
-
else
|
|
9812
|
+
else printDetail4(vp);
|
|
10510
9813
|
});
|
|
10511
9814
|
addRunSettingsCreateOptions(
|
|
10512
9815
|
group.command("create").description(
|
|
@@ -10775,7 +10078,7 @@ function registerPreferenceGroup(group) {
|
|
|
10775
10078
|
);
|
|
10776
10079
|
});
|
|
10777
10080
|
}
|
|
10778
|
-
function
|
|
10081
|
+
function register31(program2) {
|
|
10779
10082
|
const preference = program2.command("preference").description("Manage Agent Preference prompts and measured markets");
|
|
10780
10083
|
registerPreferenceGroup(preference);
|
|
10781
10084
|
const legacy = program2.command("visibility", { hidden: true });
|
|
@@ -10811,7 +10114,6 @@ for (const group of [
|
|
|
10811
10114
|
runs_exports2,
|
|
10812
10115
|
runRequests_exports2,
|
|
10813
10116
|
optimizations_exports2,
|
|
10814
|
-
experiments_exports2,
|
|
10815
10117
|
apply_exports,
|
|
10816
10118
|
batches_exports,
|
|
10817
10119
|
brands_exports2,
|