@evolvingmachines/evolve 0.0.65 → 0.0.67-train-harness-wave-2026-09-25.20260926.e00a8a6d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-DK2MGUPB.js → chunk-DI6LPW2B.js} +2 -2
- package/dist/cli/index.cjs +29 -29
- package/dist/cli/index.d.cts +3 -3
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +18 -18
- package/dist/index.cjs +64 -60
- package/dist/index.d.cts +297 -18
- package/dist/index.d.ts +297 -18
- package/dist/index.js +48 -44
- package/dist/{types-B_qmzlMk.d.cts → types-Dj0iMl5V.d.cts} +70 -90
- package/dist/{types-B_qmzlMk.d.ts → types-Dj0iMl5V.d.ts} +70 -90
- package/harness-capabilities.json +285 -0
- package/package.json +9 -6
- package/skills/create-adapter/SKILL.md +71 -26
- package/skills/create-task/SKILL.md +124 -66
- package/skills/evolve/SKILL.md +37 -20
- package/skills/evolve-evals/SKILL.md +142 -69
- package/skills/evolve-evals/references/cli-reference/agent.md +76 -0
- package/skills/evolve-evals/references/cli-reference/analysis.md +78 -0
- package/skills/evolve-evals/references/cli-reference/analyze.md +97 -0
- package/skills/evolve-evals/references/cli-reference/auth.md +96 -0
- package/skills/evolve-evals/references/cli-reference/check.md +157 -0
- package/skills/evolve-evals/references/cli-reference/dataset.md +154 -0
- package/skills/evolve-evals/references/cli-reference/filesystem.md +168 -0
- package/skills/evolve-evals/references/cli-reference/index.md +149 -0
- package/skills/evolve-evals/references/cli-reference/job.md +198 -0
- package/skills/evolve-evals/references/cli-reference/run.md +188 -0
- package/skills/evolve-evals/references/cli-reference/secrets.md +77 -0
- package/skills/evolve-evals/references/cli-reference/session.md +56 -0
- package/skills/evolve-evals/references/cli-reference/skill.md +52 -0
- package/skills/evolve-evals/references/cli-reference/skills.md +85 -0
- package/skills/evolve-evals/references/cli-reference/trial.md +115 -0
- package/skills/evolve-evals/references/cli-reference/upload.md +72 -0
- package/skills/evolve-evals/references/core-concepts/agents.md +101 -0
- package/skills/evolve-evals/references/core-concepts/analyze.md +143 -0
- package/skills/evolve-evals/references/core-concepts/check.md +116 -0
- package/skills/evolve-evals/references/core-concepts/compatibility.md +39 -0
- package/skills/evolve-evals/references/core-concepts/compose.md +103 -0
- package/skills/evolve-evals/references/core-concepts/datasets.md +234 -0
- package/skills/evolve-evals/references/core-concepts/index.md +52 -0
- package/skills/evolve-evals/references/core-concepts/jobs.md +223 -0
- package/skills/evolve-evals/references/core-concepts/models.md +73 -0
- package/skills/evolve-evals/references/core-concepts/multi-step.md +93 -0
- package/skills/evolve-evals/references/core-concepts/rewardkit.md +341 -0
- package/skills/evolve-evals/references/core-concepts/sandboxes.md +73 -0
- package/skills/evolve-evals/references/core-concepts/secrets.md +86 -0
- package/skills/evolve-evals/references/core-concepts/sharing.md +81 -0
- package/skills/evolve-evals/references/core-concepts/skills.md +100 -0
- package/skills/evolve-evals/references/core-concepts/task-config.md +169 -0
- package/skills/evolve-evals/references/core-concepts/task-environment.md +127 -0
- package/skills/evolve-evals/references/core-concepts/task-reference.md +191 -0
- package/skills/evolve-evals/references/core-concepts/task-verifiers.md +209 -0
- package/skills/evolve-evals/references/core-concepts/tasks.md +90 -0
- package/skills/evolve-evals/references/core-concepts/teams.md +128 -0
- package/skills/evolve-evals/references/core-concepts/trial-outputs.md +225 -0
- package/skills/evolve-evals/references/core-concepts/trials.md +129 -0
- package/skills/evolve-evals/references/core-concepts/upload-sdk-session.md +240 -0
- package/skills/evolve-evals/references/core-concepts/upload.md +166 -0
- package/skills/evolve-evals/references/dashboard/checks.md +54 -0
- package/skills/evolve-evals/references/dashboard/datasets.md +65 -0
- package/skills/evolve-evals/references/dashboard/jobs.md +106 -0
- package/skills/evolve-evals/references/dashboard/traces.md +54 -0
- package/skills/evolve-evals/references/dashboard/trial-viewer.md +77 -0
- package/skills/evolve-evals/references/getting-started/first-task.md +228 -0
- package/skills/evolve-evals/references/getting-started/installation.md +79 -0
- package/skills/evolve-evals/references/getting-started/quick-start.md +100 -0
- package/skills/evolve-evals/references/index.md +58 -0
- package/skills/evolve-evals/references/sdk/http.md +110 -0
- package/skills/evolve-evals/references/sdk/python.md +108 -0
- package/skills/evolve-evals/references/sdk/typescript.md +104 -0
- package/skills/evolve-evals/references/sdk-reference/agents.md +75 -0
- package/skills/evolve-evals/references/sdk-reference/analyses.md +125 -0
- package/skills/evolve-evals/references/sdk-reference/auth.md +171 -0
- package/skills/evolve-evals/references/sdk-reference/checks.md +146 -0
- package/skills/evolve-evals/references/sdk-reference/datasets.md +170 -0
- package/skills/evolve-evals/references/sdk-reference/error-codes.md +231 -0
- package/skills/evolve-evals/references/sdk-reference/errors.md +98 -0
- package/skills/evolve-evals/references/sdk-reference/filesystem.md +166 -0
- package/skills/evolve-evals/references/sdk-reference/index.md +161 -0
- package/skills/evolve-evals/references/sdk-reference/jobs.md +250 -0
- package/skills/evolve-evals/references/sdk-reference/meta.md +54 -0
- package/skills/evolve-evals/references/sdk-reference/methods/agents.md +154 -0
- package/skills/evolve-evals/references/sdk-reference/methods/analyses.md +211 -0
- package/skills/evolve-evals/references/sdk-reference/methods/auth.md +257 -0
- package/skills/evolve-evals/references/sdk-reference/methods/checks.md +462 -0
- package/skills/evolve-evals/references/sdk-reference/methods/datasets.md +687 -0
- package/skills/evolve-evals/references/sdk-reference/methods/filesystem.md +527 -0
- package/skills/evolve-evals/references/sdk-reference/methods/jobs.md +1023 -0
- package/skills/evolve-evals/references/sdk-reference/methods/meta.md +213 -0
- package/skills/evolve-evals/references/sdk-reference/methods/secrets.md +157 -0
- package/skills/evolve-evals/references/sdk-reference/methods/skills.md +125 -0
- package/skills/evolve-evals/references/sdk-reference/methods/trials.md +371 -0
- package/skills/evolve-evals/references/sdk-reference/secrets.md +104 -0
- package/skills/evolve-evals/references/sdk-reference/skills.md +66 -0
- package/skills/evolve-evals/references/sdk-reference/trials.md +164 -0
- package/skills/evolve-evals/references/sdk-reference/types.md +1255 -0
- package/skills/publish/SKILL.md +103 -79
- package/skills/rewardkit/SKILL.md +78 -23
- package/spec/openapi.yaml +164 -160
- package/skills/evolve-evals/references/cli-reference/agent.mdx +0 -79
- package/skills/evolve-evals/references/cli-reference/analysis.mdx +0 -160
- package/skills/evolve-evals/references/cli-reference/analyze.mdx +0 -84
- package/skills/evolve-evals/references/cli-reference/auth.mdx +0 -133
- package/skills/evolve-evals/references/cli-reference/check.mdx +0 -263
- package/skills/evolve-evals/references/cli-reference/dataset.mdx +0 -151
- package/skills/evolve-evals/references/cli-reference/index.mdx +0 -108
- package/skills/evolve-evals/references/cli-reference/job.mdx +0 -278
- package/skills/evolve-evals/references/cli-reference/run.mdx +0 -204
- package/skills/evolve-evals/references/cli-reference/secrets.mdx +0 -95
- package/skills/evolve-evals/references/cli-reference/skill.mdx +0 -61
- package/skills/evolve-evals/references/cli-reference/skills.mdx +0 -81
- package/skills/evolve-evals/references/cli-reference/trial.mdx +0 -181
- package/skills/evolve-evals/references/cli-reference/upload.mdx +0 -36
- package/skills/evolve-evals/references/core-concepts/agents.mdx +0 -106
- package/skills/evolve-evals/references/core-concepts/analyze.mdx +0 -86
- package/skills/evolve-evals/references/core-concepts/check.mdx +0 -64
- package/skills/evolve-evals/references/core-concepts/datasets.mdx +0 -138
- package/skills/evolve-evals/references/core-concepts/index.mdx +0 -42
- package/skills/evolve-evals/references/core-concepts/jobs.mdx +0 -151
- package/skills/evolve-evals/references/core-concepts/models.mdx +0 -68
- package/skills/evolve-evals/references/core-concepts/sandboxes.mdx +0 -52
- package/skills/evolve-evals/references/core-concepts/secrets.mdx +0 -41
- package/skills/evolve-evals/references/core-concepts/sharing.mdx +0 -35
- package/skills/evolve-evals/references/core-concepts/skills.mdx +0 -42
- package/skills/evolve-evals/references/core-concepts/tasks.mdx +0 -216
- package/skills/evolve-evals/references/core-concepts/teams.mdx +0 -36
- package/skills/evolve-evals/references/core-concepts/trial-outputs.mdx +0 -117
- package/skills/evolve-evals/references/core-concepts/trials.mdx +0 -103
- package/skills/evolve-evals/references/core-concepts/upload.mdx +0 -93
- package/skills/evolve-evals/references/dashboard/checks.mdx +0 -21
- package/skills/evolve-evals/references/dashboard/datasets.mdx +0 -24
- package/skills/evolve-evals/references/dashboard/jobs.mdx +0 -65
- package/skills/evolve-evals/references/dashboard/traces.mdx +0 -17
- package/skills/evolve-evals/references/dashboard/trial-viewer.mdx +0 -30
- package/skills/evolve-evals/references/getting-started/installation.mdx +0 -56
- package/skills/evolve-evals/references/getting-started/quick-start.mdx +0 -94
- package/skills/evolve-evals/references/index.mdx +0 -48
- package/skills/evolve-evals/references/sdk/python.mdx +0 -161
- package/skills/evolve-evals/references/sdk/typescript.mdx +0 -163
- package/skills/evolve-evals/references/sdk-reference/agents.mdx +0 -108
- package/skills/evolve-evals/references/sdk-reference/analyses.mdx +0 -222
- package/skills/evolve-evals/references/sdk-reference/auth.mdx +0 -116
- package/skills/evolve-evals/references/sdk-reference/checks.mdx +0 -300
- package/skills/evolve-evals/references/sdk-reference/datasets.mdx +0 -346
- package/skills/evolve-evals/references/sdk-reference/errors.mdx +0 -210
- package/skills/evolve-evals/references/sdk-reference/index.mdx +0 -60
- package/skills/evolve-evals/references/sdk-reference/jobs.mdx +0 -822
- package/skills/evolve-evals/references/sdk-reference/meta.mdx +0 -52
- package/skills/evolve-evals/references/sdk-reference/skills.mdx +0 -69
- package/skills/evolve-evals/references/sdk-reference/trials.mdx +0 -302
- package/skills/evolve-evals/references/sdk-reference/types.mdx +0 -274
- package/skills/evolve-evals/references/snippets/global-options.mdx +0 -13
- package/skills/evolve-evals/references/snippets/list-flags.mdx +0 -23
package/dist/cli/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {H as H$1,G as G$1,P,ha as ha$1,Da as Da$1,ua as ua$1,ta as ta$1,na as na$1,oa as oa$1,ma as ma$1,Oa as Oa$1,sa as sa$1,ra as ra$1,qa as qa$1,N,pa as pa$1,da as da$1,ca as ca$1,ba as ba$1,ja as ja$1,E as E$1,O,V as V$1,T as T$1,U,M,C as C$1,F,D as D$1,I as I$1,W as W$1,ga as ga$1,fa as fa$1,ea as ea$1}from'../chunk-
|
|
3
|
-
`));return a.map(({destination:i,path:o,write:l})=>(l&&(mkdirSync(dirname(o),{recursive:true}),writeFileSync(o,n)),{target:i.target,path:o,status:l?"written":"unchanged"}))}var f=class extends Error{constructor(t){super(t),this.name="CliUsageError";}},
|
|
2
|
+
import {H as H$1,G as G$1,P,ha as ha$1,Da as Da$1,ua as ua$1,ta as ta$1,na as na$1,oa as oa$1,ma as ma$1,Oa as Oa$1,sa as sa$1,ra as ra$1,qa as qa$1,N,pa as pa$1,da as da$1,ca as ca$1,ba as ba$1,ja as ja$1,E as E$1,O,V as V$1,T as T$1,U,M,C as C$1,F,D as D$1,I as I$1,W as W$1,ga as ga$1,fa as fa$1,ea as ea$1}from'../chunk-DI6LPW2B.js';import'../chunk-HQJI3HHU.js';import'../chunk-5GVMBEYI.js';import {realpathSync,readFileSync,existsSync,mkdirSync,writeFileSync,chmodSync,statSync,readdirSync}from'fs';import {homedir}from'os';import {join,resolve,dirname,relative,sep}from'path';import {fileURLToPath,pathToFileURL}from'url';import {LineCounter,parseDocument,parse as parse$1}from'yaml';import {parse}from'smol-toml';var Be="evolve",Pn="evolve-agents",We="EVOLVE_SKILLS_DIR",Bt="evolve-",jn=["references","templates"],es=[".mdx",".md"],z=class extends Error{constructor(t){super(t),this.name="SkillsError";}};function _e(e){try{return statSync(e).isDirectory()}catch{return false}}function ts(e){try{return statSync(e).isFile()}catch{return false}}function An(e,t){return relative(e,t).split(sep).join("/")}function En(e){let t=[],s=n=>{for(let a of readdirSync(n,{withFileTypes:true})){let r=join(n,a.name);a.isDirectory()?s(r):a.isFile()&&t.push(r);}};return _e(e)&&s(e),t.sort()}function ue(e,t=process.env){let s=t[We];if(s!==void 0&&s!==""){if(!_e(s))throw new z(`${We} points at nothing: ${s}`);return resolve(s)}for(let n of [join(e,"skills"),join(e,"..","..","skills")])if(_e(n))return resolve(n);throw new z(`skills directory not found; set ${We} or reinstall @evolvingmachines/evolve`)}function Tn(e){let t=join(e,"SKILL.md"),s=readFileSync(t,"utf8"),n=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(s),a=n?s.slice(n[0].length).replace(/^\r?\n+/,""):s,r=null;if(n)try{r=parse$1(n[1]);}catch(c){throw new z(`${t}: front matter does not parse (${c.message})`)}let i=r!==null&&typeof r=="object"&&typeof r.description=="string"?r.description.replace(/\s+/g," ").trim():"",o=e.slice(e.lastIndexOf(sep)+1);return {name:o.startsWith(Bt)?o.slice(Bt.length):o,dir:e,description:i,content:s,body:a}}function Xe(e){return readdirSync(e,{withFileTypes:true}).filter(t=>t.isDirectory()&&t.name!==Pn&&ts(join(e,t.name,"SKILL.md"))).map(t=>Tn(join(e,t.name))).sort((t,s)=>t.name.localeCompare(s.name))}function Se(e){return Xe(e).filter(t=>t.name!==Be)}function ss(e,t){return Xe(e).some(s=>s.name===t)}function ce(e,t){let s=Xe(e).find(n=>n.name===t);if(!s){let n=Se(e).map(a=>a.name);throw new z(`unknown skill "${t}" (skills: ${n.join(", ")})`)}return s}function de(e){return jn.flatMap(t=>En(join(e.dir,t)).map(s=>({path:An(e.dir,s),content:readFileSync(s,"utf8")})))}function ns(e){return e.startsWith("references/")&&es.some(t=>e.endsWith(t))}function Cn(e){return de(e).filter(t=>ns(t.path)).map(t=>t.path.slice(11).replace(/\.mdx?$/,""))}function as(e,t){let s=`references/${t.replace(/^\.\//,"")}`,n=new Set([s,...es.map(r=>s+r)]),a=de(e).find(r=>ns(r.path)&&n.has(r.path));if(!a)throw new z(`no page "${t}" in skill ${e.name} (pages: ${Cn(e).join(", ")})`);return {page:a.path.slice(11).replace(/\.mdx?$/,""),path:a.path,content:a.content}}var fe=["claude","codex","cursor","copilot","gemini","opencode","agents"];function $e(e,t=process.env){if(e==="opencode"){let s=t.XDG_CONFIG_HOME!==void 0&&t.XDG_CONFIG_HOME!==""?t.XDG_CONFIG_HOME:join(homedir(),".config");return join(s,"opencode","skills")}return join(homedir(),`.${e}`,"skills")}function Nn(e){let t=e;for(;!existsSync(t);){let s=dirname(t);if(s===t)break;t=s;}return t}function rs(e,t,s){let n=ce(e,Be).content,a=[],r=[];for(let i of t){let o=join(i.skillsDir,Be,"SKILL.md"),l=Nn(o);if(l===o){if(!ts(o)){r.push(`${o} is a directory, not a file`);continue}let c=readFileSync(o,"utf8")===n;!c&&!s&&r.push(`${o} exists with different content; pass --force to overwrite it`),a.push({destination:i,path:o,write:!c});}else _e(l)?a.push({destination:i,path:o,write:true}):r.push(`${l} is a file, so ${o} cannot be created`);}if(r.length>0)throw new z(r.join(`
|
|
3
|
+
`));return a.map(({destination:i,path:o,write:l})=>(l&&(mkdirSync(dirname(o),{recursive:true}),writeFileSync(o,n)),{target:i.target,path:o,status:l?"written":"unchanged"}))}var f=class extends Error{constructor(t){super(t),this.name="CliUsageError";}},Ee={json:{kind:"boolean",help:"Machine-readable JSON output"},"api-key":{kind:"string",value:"<key>",help:"API key",default:"$EVOLVE_API_KEY"},"base-url":{kind:"string",value:"<url>",help:"API base URL",default:"the Evolve dashboard API"}},Qe={kind:"repeat",value:"<address>",help:"Share with this address; repeatable"},Ze={kind:"repeat",value:"<address>",help:"Remove this address's share; repeatable"},I={limit:{kind:"number",short:"l",value:"<n>",help:"Page size",group:"Paging"},cursor:{kind:"string",value:"<c>",help:"Resume from a page cursor",group:"Paging"},columns:{kind:"string",value:"<keys|all|help>",help:"Choose and order columns; 'help' lists them",group:"Output"},quiet:{kind:"boolean",short:"q",help:"Print only ids, one per line",group:"Output"},"no-trunc":{kind:"boolean",help:"Full cell content instead of one-line truncation",group:"Output"},"no-headers":{kind:"boolean",help:"Omit the header row in piped output",group:"Output"}},ne={kind:"string",value:"<my|shared|org>",help:"What you created, what teammates created, or everything in your organizations",default:"my",group:"Filter"},is={kind:"string",value:"<name>",help:"Organization it belongs to; else the default from `evolve auth org use`, else your personal org",group:"Organization"},et="An analysis id, or its unambiguous prefix, names that run. A trial id, or its prefix, names the trial's latest analysis, the one `trial show` prints on its analysis row. A prefix matching both an analysis and a trial is refused as ambiguous.",xe={kind:"number",value:"<n>",help:"Skip the first N events; to resume, pass the count you already hold",group:"Selection"},Fs={config:{kind:"string",short:"c",value:"<path>",help:"Job config file, YAML or JSON; flags override its fields",group:"Config"},"print-config":{kind:"boolean",help:"Print the resolved job body as JSON and exit",group:"Config"},"job-name":{kind:"string",value:"<name>",help:"Label for the job",default:"generated",group:"Job"},org:{kind:"string",value:"<name>",help:"Organization the job lands in; else the default from `evolve auth org use`, else your personal org",group:"Job"},"n-attempts":{kind:"number",short:"k",value:"<n>",help:"Attempts per task and arm",default:"1",group:"Job"},"n-concurrent":{kind:"number",short:"n",value:"<n>",help:"Parallel trials",default:"4",group:"Job"},yes:{kind:"boolean",short:"y",help:"Accepted for compatibility; a hosted run has nothing to confirm",group:"Job"},dataset:{kind:"repeat",short:"d",value:"<name[@version]>",help:"Dataset to run; repeatable; a bare name is the active version",group:"Datasets"},"include-task-name":{kind:"repeat",short:"i",value:"<glob>",help:"Only tasks matching the glob, in every dataset; repeatable",group:"Datasets"},"exclude-task-name":{kind:"repeat",short:"x",value:"<glob>",help:"Skip tasks matching the glob, in every dataset; repeatable",group:"Datasets"},"n-tasks":{kind:"number",short:"l",value:"<n>",help:"Cap the task count of each dataset, after the filters",group:"Datasets"},agent:{kind:"string",short:"a",value:"<name[@version]>",help:"Agent harness, built-in or registered",group:"Agent"},model:{kind:"repeat",short:"m",value:"<name>",help:"Model; repeatable, one arm per model",group:"Agent"},effort:{kind:"string",value:"<value>",help:"Reasoning effort for every arm; an agent that cannot honor it is refused",default:"the agent's own",group:"Agent"},preset:{kind:"string",value:"<name>",help:"Settings preset for every arm: no-internet or pinned-context",group:"Agent"},ak:{kind:"repeat",aliases:["agent-kwarg"],value:"key=value",help:"Agent kwarg for every arm; repeatable; config=<path|JSON> is the native settings file",group:"Agent"},skill:{kind:"repeat",aliases:["skills"],value:"<ref|path>",help:"Skill for every arm; repeatable: skills.sh/<owner>/<repo>[/<skill>], org/repo[@ref], a git URL, upload:<id>, name:<skill-name>, or a local folder",group:"Agent"},"verifier-env":{kind:"repeat",aliases:["ve"],value:"KEY=VALUE",help:"Env for every verifier run; repeatable; only REWARDKIT_JUDGE and REWARDKIT_MODEL",group:"Verifier"},secret:{kind:"repeat",value:"NAME[@LABEL][=ENVNAME]",help:"Attach a stored env secret to every agent run; repeatable; @LABEL picks a row, =ENVNAME renames it",group:"Secrets"},"secret-inline":{kind:"repeat",value:"NAME[@LABEL]:DELIVERY=VALUE",help:"Store VALUE as an env secret and attach it in one step; repeatable; DELIVERY is brokered or direct",group:"Secrets"},"max-trial-spend":{kind:"number",value:"<usd>",help:"Model-spend cap for each trial, in USD",default:"200",group:"Spend and retries"},"max-retries":{kind:"number",short:"r",value:"<n>",help:"Automatic retries per trial on infrastructure errors; 0 turns them off",default:"2, the platform default",group:"Spend and retries"},"retry-include":{kind:"repeat",value:"<exception>",help:"Exception types to retry on; repeatable",default:"everything --retry-exclude admits",group:"Spend and retries"},"retry-exclude":{kind:"repeat",value:"<exception>",help:"Exception types never retried; repeatable; wins over --retry-include",default:"Harbor's non-retryable set",group:"Spend and retries"},"system-log":{kind:"boolean",help:"Record the box's own system log stream beside agent and verifier (read it back with `trial logs --stream system`)",group:"Job"},analyze:{kind:"boolean",help:"Analyze each trial's trace against a rubric as it settles",group:"Analysis"},"analyze-agent":{kind:"string",value:"<name>",help:"Agent the analyzer runs on; implies --analyze",default:"the analyze default",group:"Analysis"},"analyze-model":{kind:"string",value:"<name>",help:"Model for the analyzer; implies --analyze",default:"the analyze default",group:"Analysis"},"analyze-rubric":{kind:"string",value:"<path>",help:"Rubric file for the analyzer, TOML, YAML or JSON; implies --analyze",default:"the built-in rubric",group:"Analysis"},"analyze-prompt":{kind:"string",value:"<path>",help:"Prompt file for the analyzer, replacing the built-in prompt; implies --analyze",group:"Analysis"},"analyze-provider":{kind:"string",value:"<provider>",help:"Sandbox provider for the analyzer; implies --analyze",default:"the analysis default",group:"Analysis"},"analyze-effort":{kind:"string",value:"<value>",help:"Reasoning effort for the analyzer; implies --analyze",default:"the model's own",group:"Analysis"},"timeout-multiplier":{kind:"number",value:"<x>",help:"Multiplier for every task timeout, this job only",default:"1.0",group:"Timeouts"},"agent-timeout-multiplier":{kind:"number",value:"<x>",help:"Multiplier for the agent execution timeout; overrides --timeout-multiplier",group:"Timeouts"},"verifier-timeout-multiplier":{kind:"number",value:"<x>",help:"Multiplier for the verifier timeout; overrides --timeout-multiplier",group:"Timeouts"},"agent-setup-timeout-multiplier":{kind:"number",value:"<x>",help:"Multiplier for the agent setup timeout; overrides --timeout-multiplier",group:"Timeouts"},"environment-build-timeout-multiplier":{kind:"number",value:"<x>",help:"Multiplier for the environment build timeout; overrides --timeout-multiplier",group:"Timeouts"},env:{kind:"string",short:"e",value:"<provider>",help:"Sandbox provider: e2b, daytona or modal",default:"daytona",group:"Environment"},watch:{kind:"boolean",help:"Stream the job's events until it finishes",group:"Output"},quiet:{kind:"boolean",short:"q",help:"With --watch, print only the final block",group:"Output"}};function Ms(e){return [`${e} -d terminal-bench-4@4.0 -a codex -m gpt-6-astra -l 5 --watch`,`${e} \\
|
|
4
4
|
-d deep-swe@1.1 \\
|
|
5
5
|
-a claude -m fable \\
|
|
6
6
|
--skills skills.sh/acme/skills/pdf \\
|
|
7
7
|
--secret GITHUB_TOKEN \\
|
|
8
8
|
-k 2 -n 8 \\
|
|
9
|
-
--analyze --watch`,`${e} -c job.yaml --print-config`]}var Gn="evolve skills get evals sdk-reference/errors",Q={skills:{summary:"The skills the CLI serves to coding agents",notes:"The skills ship with the CLI and match its version. `skills get evals` is the index of the documentation and `skills get evals <page>` one page of it; the `evolve` pointer skill that `skills install` writes is served but never listed. EVOLVE_SKILLS_DIR names another skills directory to serve.",defaultVerb:"list",commands:{list:{summary:"List the skills the installed version serves",flags:{},minPositionals:0,maxPositionals:0,examples:["evolve skills","evolve skills list --json"]},get:{summary:"Print one or more skills, or one reference page",notes:"A second word that is not a skill name is a page of the first skill: its path under references/ without the suffix, as the docs site spells it (`core-concepts/tasks`).",flags:{full:{kind:"boolean",help:"Also print every file under references/ and templates/, each behind a `--- <path> ---` line"},all:{kind:"boolean",help:"Every skill, instead of naming them"}},minPositionals:0,maxPositionals:1/0,positionalUsage:"<name> [name...] | <name> <page>",examples:["evolve skills get evals","evolve skills get evals core-concepts/tasks","evolve skills get create-task --full"]},path:{summary:"Print the skills directory, or one skill's folder",flags:{},minPositionals:0,maxPositionals:1,positionalUsage:"[name]",examples:["evolve skills path","evolve skills path evals"]},install:{summary:"Install the evolve pointer skill for your agents",notes:"Each target gets <folder>/evolve/SKILL.md; the path written is printed. A file already there with different content is left alone unless --force.",flags:{target:{kind:"string",value:`<${[...fe,"all"].join("|")}>`,help:"Which agent home: ~/.claude, ~/.codex, ~/.cursor, ~/.copilot, ~/.gemini, ~/.config/opencode or ~/.agents, each under skills/",default:"all",group:"Destination"},path:{kind:"string",value:"<dir>",help:"A skills directory of your own instead of --target",group:"Destination"},force:{kind:"boolean",help:"Overwrite an installed SKILL.md whose content differs"}},minPositionals:0,maxPositionals:0,examples:["evolve skills install","evolve skills install --target claude","evolve skills install --path ./skills"]}}},job:{summary:"Start, follow, and derive jobs",commands:{start:{summary:"Start a job",flags:Fs,minPositionals:0,maxPositionals:0,examples:Ms("evolve job start")},list:{summary:"List your jobs, newest first",flags:{...I,search:{kind:"string",value:"<text>",help:"Free-text filter over job name and dataset names",group:"Filter"},scope:ne,kind:{kind:"string",value:"<job|check|all>",help:"Jobs, task quality checks, or both in one list",default:"job",group:"Filter"}},minPositionals:0,maxPositionals:0,examples:["evolve job list","evolve job list --kind all --search deep-swe","evolve job list -l 20 -q"]},show:{summary:"Show one or more jobs in full",flags:{},minPositionals:1,maxPositionals:1/0,positionalUsage:"<id> [id...]",examples:["evolve job show 3e1f9a2c","evolve job show 3e1f9a2c 9b7d4e10 --json"]},trials:{summary:"List a job's trials",flags:{...I,status:{kind:"string",value:"<s1,s2,...>",help:"Only trials in these statuses",group:"Filter"},dataset:{kind:"string",value:"<name>",help:"Only one dataset's trials",group:"Filter"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job trials 3e1f9a2c","evolve job trials 3e1f9a2c --status INFRASTRUCTURE_ERROR,SCORING_ERROR"]},tasks:{summary:"Show a job's per-task rollup",flags:{...I},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job tasks 3e1f9a2c"]},compare:{summary:"Compare 2 to 10 jobs side by side",flags:{},minPositionals:2,maxPositionals:10,positionalUsage:"<id> <id> [...]",examples:["evolve job compare 3e1f9a2c 9b7d4e10"]},cancel:{summary:"Cancel a job",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job cancel 3e1f9a2c"]},delete:{summary:"Delete a job you created, with everything it stored",flags:{yes:{kind:"boolean",short:"y",help:"Delete without a confirmation prompt"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job delete 3e1f9a2c","evolve job delete 3e1f9a2c --yes"]},share:{summary:"Share a job you created by link or by email",notes:"--link prints the run's unlisted link (the same one every time). Each --email gets a link to the run by mail; an address with no account gets a sign-up link, unless it is already waitlisted or invited and keeps that path. Both flags may ride one command.",flags:{link:{kind:"boolean",help:"Enable the job's unlisted link and print it"},email:Qe},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job share 3e1f9a2c --link","evolve job share 3e1f9a2c --email alice@example.org --email bob@example.org"]},unshare:{summary:"Revoke a job's link or email shares",notes:"--link kills the link at once; a later share mints a new one. --email removes that address's share.",flags:{link:{kind:"boolean",help:"Disable the job's link"},email:Ze},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job unshare 3e1f9a2c --link","evolve job unshare 3e1f9a2c --email alice@example.org"]},shares:{summary:"Show who a job is shared with",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job shares 3e1f9a2c","evolve job shares 3e1f9a2c --json"]},stop:{summary:"Stop one dataset's live trials, keeping the job",flags:{dataset:{kind:"string",value:"<name>",help:"The dataset whose live trials to stop; required"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job stop 3e1f9a2c --dataset deep-swe"]},resume:{summary:"Start a linked job over failed or stopped trials",flags:{"filter-error-type":{kind:"repeat",short:"f",value:"<type>",help:"Failure types to resume, by exception type; repeatable",default:"the standard failure set plus stopped trials"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job resume 3e1f9a2c","evolve job resume 3e1f9a2c -f InfrastructureError"]},retry:{summary:"Start a linked job re-running chosen trials",notes:"Without a flag every trial runs again. --failed-only and --trial do not combine.",flags:{"failed-only":{kind:"boolean",help:"Only failed trials: SCORING_ERROR, INFRASTRUCTURE_ERROR, BUDGET, INDETERMINATE",group:"Selection"},trial:{kind:"repeat",short:"t",value:"<trial-id>",help:"Exactly this settled trial; repeatable, all or nothing",group:"Selection"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job retry 3e1f9a2c --failed-only","evolve job retry 3e1f9a2c -t d1a10c4e -t d1a10f72"]},regrade:{summary:"Re-run only the verifier over a finished job",notes:"The result is a new job linked to the source; the source is never changed.",flags:{status:{kind:"string",value:"<s1,s2,...>",help:"Only source trials in these statuses",group:"Selection"},task:{kind:"string",value:"<name>",help:"Only source trials of this task",group:"Selection"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job regrade 3e1f9a2c","evolve job regrade 3e1f9a2c --task tricky-task"]},imports:{summary:"List your job uploads, newest first",flags:{...I,status:{kind:"string",value:"<QUEUED|RUNNING|COMPLETED|FAILED>",help:"Only uploads in this status",group:"Filter"}},minPositionals:0,maxPositionals:0,examples:["evolve job imports","evolve job imports --status RUNNING"]},import:{summary:"Show one job upload, or follow it with --watch",flags:{watch:{kind:"boolean",help:"Poll until the upload is COMPLETED, printing the job, or FAILED"}},minPositionals:1,maxPositionals:1,positionalUsage:"<import-id>",examples:["evolve job import cmfl2q8r30001v4kx9zd1h7wa --watch"]},download:{summary:"Download a job as a Harbor job directory",notes:"The tree lands in <dir>/job-<id>/, with an evolve.json record beside each Harbor file.",flags:{"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Directory to unpack into",default:"the current directory"},overwrite:{kind:"boolean",help:"Replace an existing <dir>/job-<id>/"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job download 3e1f9a2c -o results/"]},grep:{summary:"Search every trial's trace for a pattern",flags:{type:{kind:"string",value:"<event-type>",help:"Only events of exactly this type",group:"Selection"},limit:{kind:"number",short:"l",value:"<n>",help:"Per-trial match groups per page, at most 200",default:"50",group:"Paging"},cursor:{kind:"string",value:"<c>",help:"Resume after this trial id, the previous page's nextCursor",group:"Paging"}},minPositionals:2,maxPositionals:2,positionalUsage:"<id> <pattern>",examples:["evolve job grep 3e1f9a2c 'permission denied'","evolve job grep 3e1f9a2c 'rm -rf' --type tool_call"]}}},trial:{summary:"Inspect, download, and act on single trials",commands:{show:{summary:"Show one trial in full",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial show d1a10c4e"]},trace:{summary:"Print a trial's parsed trace",flags:{type:{kind:"string",value:"<event-type>",help:"Only events of exactly this type",group:"Selection"},grep:{kind:"string",value:"<pattern>",help:"Only events matching this case-insensitive regex over type and content",group:"Selection"},tail:{kind:"number",value:"<n>",help:"Only the last N matching events",group:"Selection"},cursor:{kind:"string",value:"<seq>",help:"Resume after this seq",group:"Paging"},limit:{kind:"number",short:"l",value:"<n>",help:"Events per page, at most 1000",default:"200",group:"Paging"}},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial trace d1a10c4e","evolve trial trace d1a10c4e --grep 'permission denied' --tail 50"]},download:{summary:"Save a trial's tree, or stream one artifact",notes:"The tree is Harbor's trial directory, with an evolve.json record, under <dir>/<trial-id>/.",flags:{"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Directory to save under",default:"trials/",group:"Save"},overwrite:{kind:"boolean",help:"Replace an existing <dir>/<trial-id>/",group:"Save"},stream:{kind:"string",value:"<artifact>",help:"Print one artifact to stdout instead: trace-parsed, verifier, trace-stdout, trace-stderr, trace-atif (the ATIF trajectory), trajectory (reserved: the harness-native session file), agent-home or filesystem (the run's file system as one .tar.gz, raw bytes)",group:"Stream"},cursor:{kind:"string",value:"<seq>",help:"With --stream trace-parsed: resume after this seq",group:"Stream"},limit:{kind:"number",value:"<n>",help:"With --stream trace-parsed: max events per page",group:"Stream"}},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial download d1a10c4e -o trials/","evolve trial download d1a10c4e --stream trace-stdout"]},retry:{summary:"Run one settled trial again, as a new job",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial retry d1a10c4e"]},regrade:{summary:"Re-run only the verifier over one trial, as a new job",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial regrade d1a10c4e"]},stop:{summary:"Stop running trials, keeping their job",flags:{},minPositionals:1,maxPositionals:1/0,positionalUsage:"<trial-id> [trial-id...]",examples:["evolve trial stop d1a10c4e d1a10f72"]},"files status":{summary:"File system source: live, captured or none",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial files status d1a10c4e-\u2026"]},"files list":{summary:"List one folder of the file system (default /)",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},limit:{kind:"number",short:"l",value:"<n>",help:"Entries per page (default 500, max 1000)"},cursor:{kind:"string",value:"<name>",help:"Resume after this entry name (the previous page's next_cursor)"}},minPositionals:1,maxPositionals:2,positionalUsage:"<trial-id> [path]",examples:["evolve trial files ls d1a10c4e-\u2026 /app/work"]},"files cat":{summary:"Print one file, raw bytes",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},range:{kind:"string",value:"<bytes=a-b>",help:"One byte range: bytes=a-b, bytes=a- or bytes=-n"}},minPositionals:2,maxPositionals:2,positionalUsage:"<trial-id> <path>",examples:["evolve trial files cat d1a10c4e-\u2026 /app/work/main.py"]},"files search":{summary:"Search the trial's file system for text",flags:{path:{kind:"string",value:"<path>",help:"Folder to search under (default: /, the whole box \u2014 seconds)"},regex:{kind:"boolean",help:"Treat the text as a regular expression"},limit:{kind:"number",short:"l",value:"<n>",help:"Hit cap (default 200, max 1000)"},source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"}},minPositionals:2,maxPositionals:2,positionalUsage:"<trial-id> <text>",examples:["evolve trial files search d1a10c4e-\u2026 'permission denied' --path /app/work"]},"files changes":{summary:"Files created, modified or removed, by phase",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},phase:{kind:"string",value:"<setup|agent|verifier|all>",help:"Only one phase's changes (default all)"},limit:{kind:"number",short:"l",value:"<n>",help:"Rows per page (default 500, max 1000)"},cursor:{kind:"string",value:"<path>",help:"Resume after this path (the previous page's next_cursor)"}},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial files changes d1a10c4e-\u2026 --phase agent"]},"files archive":{summary:"Download one subtree as a .tar.gz",flags:{path:{kind:"string",value:"<path>",help:"Subtree to archive (default: /, the whole tree)"},source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Save the archive into this directory and print its path (default: raw bytes to stdout)"}},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial files archive d1a10c4e-\u2026 --path /app/work -o archives/"]},logs:{summary:"Read one sandbox log stream of the run",flags:{stream:{kind:"string",value:"<name>",help:"Which stream: agent | verifier | system (when the job asked for it); setup and metrics are named but not recorded today (required)"},follow:{kind:"boolean",short:"f",help:"Keep printing lines as they arrive while the box lives"},limit:{kind:"number",short:"l",value:"<n>",help:"Lines per page (default 1000, max 1000)"},cursor:{kind:"string",value:"<seq>",help:"Resume after this line seq"}},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial logs d1a10c4e-\u2026 --stream agent --follow"]},procs:{summary:"The trial's box process list (live only)",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial procs d1a10c4e-\u2026"]}}},analysis:{summary:"List, inspect, and download trace analyses",commands:{list:{summary:"List analysis runs, newest first",flags:{...I,scope:ne,job:{kind:"string",value:"<job-id>",help:"Only analyses of this job's trials; a prefix works",group:"Filter"},status:{kind:"string",value:"<s1,s2,...>",help:`Only these statuses: ${G$1.join(", ")}`,group:"Filter"}},minPositionals:0,maxPositionals:0,examples:["evolve analysis list","evolve analysis list --job 3e1f9a2c --status failed"]},show:{summary:"Show one analysis run: the verdict",notes:et,flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id | trial-id>",examples:["evolve analysis show a0a1b2c3","evolve analysis show d1a10c4e"]},trace:{summary:"Print the analyzer's own transcript",notes:et,flags:{since:$e},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id | trial-id>",examples:["evolve analysis trace a0a1b2c3","evolve analysis trace a0a1b2c3 --since 200"]},download:{summary:"Save an analysis run, or stream one artifact",notes:et,flags:{"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Directory to save the run's trial folder under",default:"analyses/",group:"Save"},overwrite:{kind:"boolean",help:"Replace an existing folder of the same name",group:"Save"},stream:{kind:"string",value:"<artifact>",help:"Print one artifact to stdout instead: analysis (the verdict), trace-parsed, trace-stdout, trace-stderr or agent-home",group:"Stream"},since:{...$e,help:"With --stream trace-parsed: skip the first N events",group:"Stream"}},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id | trial-id>",examples:["evolve analysis download a0a1b2c3 -o analyses/","evolve analysis download a0a1b2c3 --stream trace-stdout"]},"files status":{summary:"File system source: live, captured or none",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id>",examples:["evolve analysis files status a0a1b2c3-\u2026"]},"files list":{summary:"List one folder of the file system (default /)",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},limit:{kind:"number",short:"l",value:"<n>",help:"Entries per page (default 500, max 1000)"},cursor:{kind:"string",value:"<name>",help:"Resume after this entry name (the previous page's next_cursor)"}},minPositionals:1,maxPositionals:2,positionalUsage:"<analysis-id> [path]",examples:["evolve analysis files ls a0a1b2c3-\u2026 /app/work"]},"files cat":{summary:"Print one file, raw bytes",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},range:{kind:"string",value:"<bytes=a-b>",help:"One byte range: bytes=a-b, bytes=a- or bytes=-n"}},minPositionals:2,maxPositionals:2,positionalUsage:"<analysis-id> <path>",examples:["evolve analysis files cat a0a1b2c3-\u2026 /app/work/main.py"]},"files search":{summary:"Search the analysis run's file system for text",flags:{path:{kind:"string",value:"<path>",help:"Folder to search under (default: /, the whole box \u2014 seconds)"},regex:{kind:"boolean",help:"Treat the text as a regular expression"},limit:{kind:"number",short:"l",value:"<n>",help:"Hit cap (default 200, max 1000)"},source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"}},minPositionals:2,maxPositionals:2,positionalUsage:"<analysis-id> <text>",examples:["evolve analysis files search a0a1b2c3-\u2026 'permission denied' --path /app/work"]},"files changes":{summary:"Files created, modified or removed, by phase",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},phase:{kind:"string",value:"<setup|agent|verifier|all>",help:"Only one phase's changes (default all)"},limit:{kind:"number",short:"l",value:"<n>",help:"Rows per page (default 500, max 1000)"},cursor:{kind:"string",value:"<path>",help:"Resume after this path (the previous page's next_cursor)"}},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id>",examples:["evolve analysis files changes a0a1b2c3-\u2026 --phase agent"]},"files archive":{summary:"Download one subtree as a .tar.gz",flags:{path:{kind:"string",value:"<path>",help:"Subtree to archive (default: /, the whole tree)"},source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Save the archive into this directory and print its path (default: raw bytes to stdout)"}},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id>",examples:["evolve analysis files archive a0a1b2c3-\u2026 --path /app/work -o archives/"]},logs:{summary:"Read one sandbox log stream of the run",flags:{stream:{kind:"string",value:"<name>",help:"Which stream: agent | verifier | system (when the job asked for it); setup and metrics are named but not recorded today (required)"},follow:{kind:"boolean",short:"f",help:"Keep printing lines as they arrive while the box lives"},limit:{kind:"number",short:"l",value:"<n>",help:"Lines per page (default 1000, max 1000)"},cursor:{kind:"string",value:"<seq>",help:"Resume after this line seq"}},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id>",examples:["evolve analysis logs a0a1b2c3-\u2026 --stream agent --follow"]},procs:{summary:"The analysis run's box process list (live only)",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id>",examples:["evolve analysis procs a0a1b2c3-\u2026"]}}},check:{summary:"Read task quality checks back",commands:{list:{summary:"List your task quality checks, newest first",flags:{...I,scope:ne,status:{kind:"string",value:"<s1,s2,...>",help:`Only these statuses: ${H$1.join(", ")}`,group:"Filter"},dataset:{kind:"string",short:"d",value:"<name[@version]>",help:"Only checks on this dataset; a bare name is every version",group:"Filter"}},minPositionals:0,maxPositionals:0,examples:["evolve check list","evolve check list --status running","evolve check list --dataset terminal-bench-4@4.0"]},show:{summary:"Show one check: Harbor's check report, one row per task",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<check-id>",examples:["evolve check show 5f2c9b1e"]},share:{summary:"Share a check you created by link or by email",notes:"--link prints the check's unlisted link (the same one every time). Each --email gets a link to the check by mail; an address with no account gets a sign-up link, unless it is already waitlisted or invited and keeps that path. Both flags may ride one command.",flags:{link:{kind:"boolean",help:"Enable the check's unlisted link and print it"},email:Qe},minPositionals:1,maxPositionals:1,positionalUsage:"<check-id>",examples:["evolve check share 5f2c9b1e --link","evolve check share 5f2c9b1e --email alice@example.org"]},unshare:{summary:"Revoke a check's link or email shares",notes:"--link kills the link at once; a later share mints a new one. --email removes that address's share.",flags:{link:{kind:"boolean",help:"Disable the check's link"},email:Ze},minPositionals:1,maxPositionals:1,positionalUsage:"<check-id>",examples:["evolve check unshare 5f2c9b1e --link","evolve check unshare 5f2c9b1e --email alice@example.org"]},shares:{summary:"Show who a check is shared with",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<check-id>",examples:["evolve check shares 5f2c9b1e","evolve check shares 5f2c9b1e --json"]},trace:{summary:"Print the checker's transcript for one task check",flags:{since:$e},minPositionals:1,maxPositionals:1,positionalUsage:"<task-check-id>",examples:["evolve check trace 7c1d2e3f","evolve check trace 7c1d2e3f --since 200"]},download:{summary:"Save a check, one task check, or stream an artifact",notes:"A check id saves Harbor's check job folder, check_report.json and one folder per task, under <dir>/check-<id>/. A task check id saves that task's folder alone.",flags:{"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Directory to save under",default:"checks/",group:"Save"},overwrite:{kind:"boolean",help:"Replace an existing folder of the same name",group:"Save"},stream:{kind:"string",value:"<artifact>",help:"Print one artifact of a task check to stdout instead: task-check (the result), trace-parsed, trace-stdout, trace-stderr or agent-home",group:"Stream"},since:{...$e,help:"With --stream trace-parsed: skip the first N events",group:"Stream"}},minPositionals:1,maxPositionals:1,positionalUsage:"<check-id | task-check-id>",examples:["evolve check download 3f9a1c2e -o checks/","evolve check download 7c1d2e3f --stream trace-stdout"]},"files status":{summary:"File system source: live, captured or none",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<task-check-id>",examples:["evolve check files status 3f9a1c2e-\u2026"]},"files list":{summary:"List one folder of the file system (default /)",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},limit:{kind:"number",short:"l",value:"<n>",help:"Entries per page (default 500, max 1000)"},cursor:{kind:"string",value:"<name>",help:"Resume after this entry name (the previous page's next_cursor)"}},minPositionals:1,maxPositionals:2,positionalUsage:"<task-check-id> [path]",examples:["evolve check files ls 3f9a1c2e-\u2026 /app/work"]},"files cat":{summary:"Print one file, raw bytes",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},range:{kind:"string",value:"<bytes=a-b>",help:"One byte range: bytes=a-b, bytes=a- or bytes=-n"}},minPositionals:2,maxPositionals:2,positionalUsage:"<task-check-id> <path>",examples:["evolve check files cat 3f9a1c2e-\u2026 /app/work/main.py"]},"files search":{summary:"Search the task check's file system for text",flags:{path:{kind:"string",value:"<path>",help:"Folder to search under (default: /, the whole box \u2014 seconds)"},regex:{kind:"boolean",help:"Treat the text as a regular expression"},limit:{kind:"number",short:"l",value:"<n>",help:"Hit cap (default 200, max 1000)"},source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"}},minPositionals:2,maxPositionals:2,positionalUsage:"<task-check-id> <text>",examples:["evolve check files search 3f9a1c2e-\u2026 'permission denied' --path /app/work"]},"files changes":{summary:"Files created, modified or removed, by phase",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},phase:{kind:"string",value:"<setup|agent|verifier|all>",help:"Only one phase's changes (default all)"},limit:{kind:"number",short:"l",value:"<n>",help:"Rows per page (default 500, max 1000)"},cursor:{kind:"string",value:"<path>",help:"Resume after this path (the previous page's next_cursor)"}},minPositionals:1,maxPositionals:1,positionalUsage:"<task-check-id>",examples:["evolve check files changes 3f9a1c2e-\u2026 --phase agent"]},"files archive":{summary:"Download one subtree as a .tar.gz",flags:{path:{kind:"string",value:"<path>",help:"Subtree to archive (default: /, the whole tree)"},source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Save the archive into this directory and print its path (default: raw bytes to stdout)"}},minPositionals:1,maxPositionals:1,positionalUsage:"<task-check-id>",examples:["evolve check files archive 3f9a1c2e-\u2026 --path /app/work -o archives/"]},logs:{summary:"Read one sandbox log stream of the run",flags:{stream:{kind:"string",value:"<name>",help:"Which stream: agent | verifier | system (when the job asked for it); setup and metrics are named but not recorded today (required)"},follow:{kind:"boolean",short:"f",help:"Keep printing lines as they arrive while the box lives"},limit:{kind:"number",short:"l",value:"<n>",help:"Lines per page (default 1000, max 1000)"},cursor:{kind:"string",value:"<seq>",help:"Resume after this line seq"}},minPositionals:1,maxPositionals:1,positionalUsage:"<task-check-id>",examples:["evolve check logs 3f9a1c2e-\u2026 --stream agent --follow"]},procs:{summary:"The task check's box process list (live only)",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<task-check-id>",examples:["evolve check procs 3f9a1c2e-\u2026"]}}},session:{summary:"List, inspect and share managed-agent sessions",commands:{list:{summary:"List sessions, newest first",flags:{...I,scope:ne,state:{kind:"string",value:"<live|ended>",help:"Only live or only ended sessions",group:"Filter"},agent:{kind:"string",value:"<name>",help:"Only sessions of this agent harness",group:"Filter"},"tag-prefix":{kind:"string",value:"<prefix>",help:"Only sessions whose tag starts with this prefix",group:"Filter"}},minPositionals:0,maxPositionals:0,examples:["evolve session list","evolve session list --scope org","evolve session list --state ended --tag-prefix qa- -q"]},show:{summary:"Show one session in full",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<session-id>",examples:["evolve session show 5f2c1a0e"]},share:{summary:"Share a session you started by link or by email",notes:"--link prints the session's unlisted link (the same one every time); it opens the session, its transcript and its trace file, and nothing else. Each --email gets a link by mail; an address with no account gets a sign-up link, unless it is already waitlisted or invited and keeps that path. Both flags may ride one command.",flags:{link:{kind:"boolean",help:"Enable the session's unlisted link and print it"},email:Qe},minPositionals:1,maxPositionals:1,positionalUsage:"<session-id>",examples:["evolve session share 5f2c1a0e --link","evolve session share 5f2c1a0e --email alice@example.org"]},unshare:{summary:"Revoke a session's link or email shares",notes:"--link kills the link at once; a later share mints a new one. --email removes that address's share.",flags:{link:{kind:"boolean",help:"Disable the session's link"},email:Ze},minPositionals:1,maxPositionals:1,positionalUsage:"<session-id>",examples:["evolve session unshare 5f2c1a0e --link","evolve session unshare 5f2c1a0e --email alice@example.org"]},shares:{summary:"Show who a session is shared with",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<session-id>",examples:["evolve session shares 5f2c1a0e","evolve session shares 5f2c1a0e --json"]}}},dataset:{summary:"Browse and publish the dataset catalog",commands:{list:{summary:"List the dataset catalog",flags:{...I,search:{kind:"string",value:"<text>",help:"Free-text filter over name and description",group:"Filter"}},minPositionals:0,maxPositionals:0,examples:["evolve dataset list","evolve dataset list --search swe -q"]},show:{summary:"Show a dataset's versions, tasks and providers",flags:{limit:{kind:"number",short:"l",value:"<n>",help:"Task-list page size",group:"Paging"},cursor:{kind:"string",value:"<c>",help:"Resume the task list from a cursor",group:"Paging"}},minPositionals:1,maxPositionals:1,positionalUsage:"<name[@version]>",examples:["evolve dataset show terminal-bench-4@4.0"]},check:{summary:"Pre-flight a local corpus without uploading anything",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<dir>",examples:["evolve dataset check ./corpus"]},publish:{summary:"Publish a dataset version",notes:"One source per publish: a pinned git ref, a local directory, or a public tarball or Harbor hub package. --name and --version are required with --git and with --from <url>; a local dataset.toml or a hub package can supply them.",flags:{git:{kind:"string",value:"<url>",help:"Git repository URL, with --ref",group:"Source"},ref:{kind:"string",value:"<ref>",help:"Pinned git ref, a full commit sha or a tag; a branch is refused",group:"Source"},path:{kind:"string",value:"<subfolder>",help:"Repository subfolder holding the corpus, with --git",group:"Source"},dir:{kind:"string",value:"<path>",help:"Local corpus directory, pre-flighted then uploaded",group:"Source"},from:{kind:"string",value:"<url|hub:org/name[@ref]>",help:"A public https tarball URL, or a public Harbor hub package",group:"Source"},name:{kind:"string",value:"<dataset>",help:"Catalog dataset name to create or extend",group:"Version"},version:{kind:"string",value:"<v>",help:"Version label for the published version",group:"Version"},org:{kind:"string",value:"<name>",help:"Organization a new dataset lands in; else the default from `evolve auth org use`, else your personal org",group:"Version"},watch:{kind:"boolean",help:"Poll until the version is READY or FAILED",group:"Output"},"skip-preflight":{kind:"boolean",help:"Upload a --dir without the pre-flight check",group:"Source"}},minPositionals:0,maxPositionals:0,examples:["evolve dataset publish --from hub:cookbook/hello-world --watch","evolve dataset publish --dir ./corpus --name my-swe --version 1.0 --watch",`evolve dataset publish \\
|
|
9
|
+
--analyze --watch`,`${e} -c job.yaml --print-config`]}var Gn="evolve skills get evals sdk-reference/errors",Q={skills:{summary:"The skills the CLI serves to coding agents",notes:"The skills ship with the CLI and match its version. `skills get evals` is the index of the documentation and `skills get evals <page>` one page of it; the `evolve` pointer skill that `skills install` writes is served but never listed. EVOLVE_SKILLS_DIR names another skills directory to serve.",defaultVerb:"list",commands:{list:{summary:"List the skills the installed version serves",flags:{},minPositionals:0,maxPositionals:0,examples:["evolve skills","evolve skills list --json"]},get:{summary:"Print one or more skills, or one reference page",notes:"A second word that is not a skill name is a page of the first skill: its path under references/ without the suffix, as the docs site spells it (`core-concepts/tasks`).",flags:{full:{kind:"boolean",help:"Also print every file under references/ and templates/, each behind a `--- <path> ---` line"},all:{kind:"boolean",help:"Every skill, instead of naming them"}},minPositionals:0,maxPositionals:1/0,positionalUsage:"<name> [name...] | <name> <page>",examples:["evolve skills get evals","evolve skills get evals core-concepts/tasks","evolve skills get create-task --full"]},path:{summary:"Print the skills directory, or one skill's folder",flags:{},minPositionals:0,maxPositionals:1,positionalUsage:"[name]",examples:["evolve skills path","evolve skills path evals"]},install:{summary:"Install the evolve pointer skill for your agents",notes:"Each target gets <folder>/evolve/SKILL.md; the path written is printed. A file already there with different content is left alone unless --force.",flags:{target:{kind:"string",value:`<${[...fe,"all"].join("|")}>`,help:"Which agent home: ~/.claude, ~/.codex, ~/.cursor, ~/.copilot, ~/.gemini, ~/.config/opencode or ~/.agents, each under skills/",default:"all",group:"Destination"},path:{kind:"string",value:"<dir>",help:"A skills directory of your own instead of --target",group:"Destination"},force:{kind:"boolean",help:"Overwrite an installed SKILL.md whose content differs"}},minPositionals:0,maxPositionals:0,examples:["evolve skills install","evolve skills install --target claude","evolve skills install --path ./skills"]}}},job:{summary:"Start, follow, and derive jobs",commands:{start:{summary:"Start a job",flags:Fs,minPositionals:0,maxPositionals:0,examples:Ms("evolve job start")},list:{summary:"List your jobs, newest first",flags:{...I,search:{kind:"string",value:"<text>",help:"Free-text filter over job name and dataset names",group:"Filter"},scope:ne,kind:{kind:"string",value:"<job|check|all>",help:"Jobs, task quality checks, or both in one list",default:"job",group:"Filter"}},minPositionals:0,maxPositionals:0,examples:["evolve job list","evolve job list --kind all --search deep-swe","evolve job list -l 20 -q"]},show:{summary:"Show one or more jobs in full",flags:{},minPositionals:1,maxPositionals:1/0,positionalUsage:"<id> [id...]",examples:["evolve job show 3e1f9a2c","evolve job show 3e1f9a2c 9b7d4e10 --json"]},trials:{summary:"List a job's trials",flags:{...I,status:{kind:"string",value:"<s1,s2,...>",help:"Only trials in these statuses",group:"Filter"},dataset:{kind:"string",value:"<name>",help:"Only one dataset's trials",group:"Filter"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job trials 3e1f9a2c","evolve job trials 3e1f9a2c --status INFRASTRUCTURE_ERROR,SCORING_ERROR"]},tasks:{summary:"Show a job's per-task rollup",flags:{...I},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job tasks 3e1f9a2c"]},compare:{summary:"Compare 2 to 10 jobs side by side",flags:{},minPositionals:2,maxPositionals:10,positionalUsage:"<id> <id> [...]",examples:["evolve job compare 3e1f9a2c 9b7d4e10"]},cancel:{summary:"Cancel a job",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job cancel 3e1f9a2c"]},delete:{summary:"Delete a job you created, with everything it stored",flags:{yes:{kind:"boolean",short:"y",help:"Delete without a confirmation prompt"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job delete 3e1f9a2c","evolve job delete 3e1f9a2c --yes"]},share:{summary:"Share a job you created by link or by email",notes:"--link prints the run's unlisted link (the same one every time). Each --email gets a link to the run by mail; an address with no account gets a sign-up link, unless it is already waitlisted or invited and keeps that path. Both flags may ride one command.",flags:{link:{kind:"boolean",help:"Enable the job's unlisted link and print it"},email:Qe},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job share 3e1f9a2c --link","evolve job share 3e1f9a2c --email alice@example.org --email bob@example.org"]},unshare:{summary:"Revoke a job's link or email shares",notes:"--link kills the link at once; a later share mints a new one. --email removes that address's share.",flags:{link:{kind:"boolean",help:"Disable the job's link"},email:Ze},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job unshare 3e1f9a2c --link","evolve job unshare 3e1f9a2c --email alice@example.org"]},shares:{summary:"Show who a job is shared with",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job shares 3e1f9a2c","evolve job shares 3e1f9a2c --json"]},stop:{summary:"Stop one dataset's live trials, keeping the job",flags:{dataset:{kind:"string",value:"<name>",help:"The dataset whose live trials to stop; required"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job stop 3e1f9a2c --dataset deep-swe"]},resume:{summary:"Start a linked job over failed or stopped trials",flags:{"filter-error-type":{kind:"repeat",short:"f",value:"<type>",help:"Failure types to resume, by exception type; repeatable",default:"the standard failure set plus stopped trials"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job resume 3e1f9a2c","evolve job resume 3e1f9a2c -f InfrastructureError"]},retry:{summary:"Start a linked job re-running chosen trials",notes:"Without a flag every trial runs again. --failed-only and --trial do not combine.",flags:{"failed-only":{kind:"boolean",help:"Only failed trials: SCORING_ERROR, INFRASTRUCTURE_ERROR, BUDGET, INDETERMINATE",group:"Selection"},trial:{kind:"repeat",short:"t",value:"<trial-id>",help:"Exactly this settled trial; repeatable, all or nothing",group:"Selection"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job retry 3e1f9a2c --failed-only","evolve job retry 3e1f9a2c -t d1a10c4e -t d1a10f72"]},regrade:{summary:"Re-run only the verifier over a finished job",notes:"The result is a new job linked to the source; the source is never changed.",flags:{status:{kind:"string",value:"<s1,s2,...>",help:"Only source trials in these statuses",group:"Selection"},task:{kind:"string",value:"<name>",help:"Only source trials of this task",group:"Selection"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job regrade 3e1f9a2c","evolve job regrade 3e1f9a2c --task tricky-task"]},imports:{summary:"List your job uploads, newest first",flags:{...I,status:{kind:"string",value:"<QUEUED|RUNNING|COMPLETED|FAILED>",help:"Only uploads in this status",group:"Filter"}},minPositionals:0,maxPositionals:0,examples:["evolve job imports","evolve job imports --status RUNNING"]},import:{summary:"Show one job upload, or follow it with --watch",flags:{watch:{kind:"boolean",help:"Poll until the upload is COMPLETED, printing the job, or FAILED"}},minPositionals:1,maxPositionals:1,positionalUsage:"<import-id>",examples:["evolve job import cmfl2q8r30001v4kx9zd1h7wa --watch"]},download:{summary:"Download a job as a Harbor job directory",notes:"The tree lands in <dir>/job-<id>/, with an evolve.json record beside each Harbor file.",flags:{"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Directory to unpack into",default:"the current directory"},overwrite:{kind:"boolean",help:"Replace an existing <dir>/job-<id>/"}},minPositionals:1,maxPositionals:1,positionalUsage:"<id>",examples:["evolve job download 3e1f9a2c -o results/"]},grep:{summary:"Search every trial's trace for a pattern",flags:{type:{kind:"string",value:"<event-type>",help:"Only events of exactly this type",group:"Selection"},limit:{kind:"number",short:"l",value:"<n>",help:"Per-trial match groups per page, at most 200",default:"50",group:"Paging"},cursor:{kind:"string",value:"<c>",help:"Resume after this trial id, the previous page's nextCursor",group:"Paging"}},minPositionals:2,maxPositionals:2,positionalUsage:"<id> <pattern>",examples:["evolve job grep 3e1f9a2c 'permission denied'","evolve job grep 3e1f9a2c 'rm -rf' --type tool_call"]}}},trial:{summary:"Inspect, download, and act on single trials",commands:{show:{summary:"Show one trial in full",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial show d1a10c4e"]},trace:{summary:"Print a trial's parsed trace",flags:{type:{kind:"string",value:"<event-type>",help:"Only events of exactly this type",group:"Selection"},grep:{kind:"string",value:"<pattern>",help:"Only events matching this case-insensitive regex over type and content",group:"Selection"},tail:{kind:"number",value:"<n>",help:"Only the last N matching events",group:"Selection"},cursor:{kind:"string",value:"<seq>",help:"Resume after this seq",group:"Paging"},limit:{kind:"number",short:"l",value:"<n>",help:"Events per page, at most 1000",default:"200",group:"Paging"}},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial trace d1a10c4e","evolve trial trace d1a10c4e --grep 'permission denied' --tail 50"]},download:{summary:"Save a trial's tree, or stream one artifact",notes:"The tree is Harbor's trial directory, with an evolve.json record, under <dir>/<trial-id>/.",flags:{"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Directory to save under",default:"trials/",group:"Save"},overwrite:{kind:"boolean",help:"Replace an existing <dir>/<trial-id>/",group:"Save"},stream:{kind:"string",value:"<artifact>",help:"Print one artifact to stdout instead: trace-parsed, verifier, trace-stdout, trace-stderr, trace-atif (the ATIF trajectory), trajectory (reserved: the harness-native session file), agent-home or filesystem (the run's file system as one .tar.gz, raw bytes)",group:"Stream"},cursor:{kind:"string",value:"<seq>",help:"With --stream trace-parsed: resume after this seq",group:"Stream"},limit:{kind:"number",value:"<n>",help:"With --stream trace-parsed: max events per page",group:"Stream"}},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial download d1a10c4e -o trials/","evolve trial download d1a10c4e --stream trace-stdout"]},retry:{summary:"Run one settled trial again, as a new job",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial retry d1a10c4e"]},regrade:{summary:"Re-run only the verifier over one trial, as a new job",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial regrade d1a10c4e"]},stop:{summary:"Stop running trials, keeping their job",flags:{},minPositionals:1,maxPositionals:1/0,positionalUsage:"<trial-id> [trial-id...]",examples:["evolve trial stop d1a10c4e d1a10f72"]},"files status":{summary:"File system source: live, captured or none",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial files status d1a10c4e-\u2026"]},"files list":{summary:"List one folder of the file system (default /)",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},limit:{kind:"number",short:"l",value:"<n>",help:"Entries per page (default 500, max 1000)"},cursor:{kind:"string",value:"<name>",help:"Resume after this entry name (the previous page's next_cursor)"}},minPositionals:1,maxPositionals:2,positionalUsage:"<trial-id> [path]",examples:["evolve trial files ls d1a10c4e-\u2026 /app/work"]},"files cat":{summary:"Print one file, raw bytes",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},range:{kind:"string",value:"<bytes=a-b>",help:"One byte range: bytes=a-b, bytes=a- or bytes=-n"}},minPositionals:2,maxPositionals:2,positionalUsage:"<trial-id> <path>",examples:["evolve trial files cat d1a10c4e-\u2026 /app/work/main.py"]},"files search":{summary:"Search the trial's file system for text",flags:{path:{kind:"string",value:"<path>",help:"Folder to search under (default: /, the whole box \u2014 seconds)"},regex:{kind:"boolean",help:"Treat the text as a regular expression"},limit:{kind:"number",short:"l",value:"<n>",help:"Hit cap (default 200, max 1000)"},source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"}},minPositionals:2,maxPositionals:2,positionalUsage:"<trial-id> <text>",examples:["evolve trial files search d1a10c4e-\u2026 'permission denied' --path /app/work"]},"files changes":{summary:"Files created, modified or removed, by phase",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},phase:{kind:"string",value:"<setup|agent|verifier|all>",help:"Only one phase's changes (default all)"},limit:{kind:"number",short:"l",value:"<n>",help:"Rows per page (default 500, max 1000)"},cursor:{kind:"string",value:"<path>",help:"Resume after this path (the previous page's next_cursor)"}},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial files changes d1a10c4e-\u2026 --phase agent"]},"files archive":{summary:"Download one subtree as a .tar.gz",flags:{path:{kind:"string",value:"<path>",help:"Subtree to archive (default: /, the whole tree)"},source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Save the archive into this directory and print its path (default: raw bytes to stdout)"}},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial files archive d1a10c4e-\u2026 --path /app/work -o archives/"]},logs:{summary:"Read one sandbox log stream of the run",flags:{stream:{kind:"string",value:"<name>",help:"Which stream: agent | verifier | system (when the job asked for it); setup and metrics are named but not recorded today (required)"},follow:{kind:"boolean",short:"f",help:"Keep printing lines as they arrive while the box lives"},limit:{kind:"number",short:"l",value:"<n>",help:"Lines per page (default 1000, max 1000)"},cursor:{kind:"string",value:"<seq>",help:"Resume after this line seq"}},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial logs d1a10c4e-\u2026 --stream agent --follow"]},procs:{summary:"The trial's box process list (live only)",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<trial-id>",examples:["evolve trial procs d1a10c4e-\u2026"]}}},analysis:{summary:"List, inspect, and download trace analyses",commands:{list:{summary:"List analysis runs, newest first",flags:{...I,scope:ne,job:{kind:"string",value:"<job-id>",help:"Only analyses of this job's trials; a prefix works",group:"Filter"},status:{kind:"string",value:"<s1,s2,...>",help:`Only these statuses: ${G$1.join(", ")}`,group:"Filter"}},minPositionals:0,maxPositionals:0,examples:["evolve analysis list","evolve analysis list --job 3e1f9a2c --status failed"]},show:{summary:"Show one analysis run: its result",notes:et,flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id | trial-id>",examples:["evolve analysis show a0a1b2c3","evolve analysis show d1a10c4e"]},trace:{summary:"Print the analyzer's own transcript",notes:et,flags:{since:xe},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id | trial-id>",examples:["evolve analysis trace a0a1b2c3","evolve analysis trace a0a1b2c3 --since 200"]},download:{summary:"Save an analysis run, or stream one artifact",notes:et,flags:{"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Directory to save the run's trial folder under",default:"analyses/",group:"Save"},overwrite:{kind:"boolean",help:"Replace an existing folder of the same name",group:"Save"},stream:{kind:"string",value:"<artifact>",help:"Print one artifact to stdout instead: analysis (the result document), trace-parsed, trace-stdout, trace-stderr or agent-home",group:"Stream"},since:{...xe,help:"With --stream trace-parsed: skip the first N events",group:"Stream"}},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id | trial-id>",examples:["evolve analysis download a0a1b2c3 -o analyses/","evolve analysis download a0a1b2c3 --stream trace-stdout"]},"files status":{summary:"File system source: live, captured or none",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id>",examples:["evolve analysis files status a0a1b2c3-\u2026"]},"files list":{summary:"List one folder of the file system (default /)",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},limit:{kind:"number",short:"l",value:"<n>",help:"Entries per page (default 500, max 1000)"},cursor:{kind:"string",value:"<name>",help:"Resume after this entry name (the previous page's next_cursor)"}},minPositionals:1,maxPositionals:2,positionalUsage:"<analysis-id> [path]",examples:["evolve analysis files ls a0a1b2c3-\u2026 /app/work"]},"files cat":{summary:"Print one file, raw bytes",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},range:{kind:"string",value:"<bytes=a-b>",help:"One byte range: bytes=a-b, bytes=a- or bytes=-n"}},minPositionals:2,maxPositionals:2,positionalUsage:"<analysis-id> <path>",examples:["evolve analysis files cat a0a1b2c3-\u2026 /app/work/main.py"]},"files search":{summary:"Search the analysis run's file system for text",flags:{path:{kind:"string",value:"<path>",help:"Folder to search under (default: /, the whole box \u2014 seconds)"},regex:{kind:"boolean",help:"Treat the text as a regular expression"},limit:{kind:"number",short:"l",value:"<n>",help:"Hit cap (default 200, max 1000)"},source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"}},minPositionals:2,maxPositionals:2,positionalUsage:"<analysis-id> <text>",examples:["evolve analysis files search a0a1b2c3-\u2026 'permission denied' --path /app/work"]},"files changes":{summary:"Files created, modified or removed, by phase",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},phase:{kind:"string",value:"<setup|agent|verifier|all>",help:"Only one phase's changes (default all)"},limit:{kind:"number",short:"l",value:"<n>",help:"Rows per page (default 500, max 1000)"},cursor:{kind:"string",value:"<path>",help:"Resume after this path (the previous page's next_cursor)"}},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id>",examples:["evolve analysis files changes a0a1b2c3-\u2026 --phase agent"]},"files archive":{summary:"Download one subtree as a .tar.gz",flags:{path:{kind:"string",value:"<path>",help:"Subtree to archive (default: /, the whole tree)"},source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Save the archive into this directory and print its path (default: raw bytes to stdout)"}},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id>",examples:["evolve analysis files archive a0a1b2c3-\u2026 --path /app/work -o archives/"]},logs:{summary:"Read one sandbox log stream of the run",flags:{stream:{kind:"string",value:"<name>",help:"Which stream: agent | verifier | system (when the job asked for it); setup and metrics are named but not recorded today (required)"},follow:{kind:"boolean",short:"f",help:"Keep printing lines as they arrive while the box lives"},limit:{kind:"number",short:"l",value:"<n>",help:"Lines per page (default 1000, max 1000)"},cursor:{kind:"string",value:"<seq>",help:"Resume after this line seq"}},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id>",examples:["evolve analysis logs a0a1b2c3-\u2026 --stream agent --follow"]},procs:{summary:"The analysis run's box process list (live only)",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<analysis-id>",examples:["evolve analysis procs a0a1b2c3-\u2026"]}}},check:{summary:"Read task quality checks back",commands:{list:{summary:"List your task quality checks, newest first",flags:{...I,scope:ne,status:{kind:"string",value:"<s1,s2,...>",help:`Only these statuses: ${H$1.join(", ")}`,group:"Filter"},dataset:{kind:"string",short:"d",value:"<name[@version]>",help:"Only checks on this dataset; a bare name is every version",group:"Filter"}},minPositionals:0,maxPositionals:0,examples:["evolve check list","evolve check list --status running","evolve check list --dataset terminal-bench-4@4.0"]},show:{summary:"Show one check: Harbor's check report, one row per task",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<check-id>",examples:["evolve check show 5f2c9b1e"]},share:{summary:"Share a check you created by link or by email",notes:"--link prints the check's unlisted link (the same one every time). Each --email gets a link to the check by mail; an address with no account gets a sign-up link, unless it is already waitlisted or invited and keeps that path. Both flags may ride one command.",flags:{link:{kind:"boolean",help:"Enable the check's unlisted link and print it"},email:Qe},minPositionals:1,maxPositionals:1,positionalUsage:"<check-id>",examples:["evolve check share 5f2c9b1e --link","evolve check share 5f2c9b1e --email alice@example.org"]},unshare:{summary:"Revoke a check's link or email shares",notes:"--link kills the link at once; a later share mints a new one. --email removes that address's share.",flags:{link:{kind:"boolean",help:"Disable the check's link"},email:Ze},minPositionals:1,maxPositionals:1,positionalUsage:"<check-id>",examples:["evolve check unshare 5f2c9b1e --link","evolve check unshare 5f2c9b1e --email alice@example.org"]},shares:{summary:"Show who a check is shared with",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<check-id>",examples:["evolve check shares 5f2c9b1e","evolve check shares 5f2c9b1e --json"]},trace:{summary:"Print the checker's transcript for one task check",flags:{since:xe},minPositionals:1,maxPositionals:1,positionalUsage:"<task-check-id>",examples:["evolve check trace 7c1d2e3f","evolve check trace 7c1d2e3f --since 200"]},download:{summary:"Save a check, one task check, or stream an artifact",notes:"A check id saves Harbor's check job folder, check_report.json and one folder per task, under <dir>/check-<id>/. A task check id saves that task's folder alone.",flags:{"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Directory to save under",default:"checks/",group:"Save"},overwrite:{kind:"boolean",help:"Replace an existing folder of the same name",group:"Save"},stream:{kind:"string",value:"<artifact>",help:"Print one artifact of a task check to stdout instead: task-check (the result), trace-parsed, trace-stdout, trace-stderr or agent-home",group:"Stream"},since:{...xe,help:"With --stream trace-parsed: skip the first N events",group:"Stream"}},minPositionals:1,maxPositionals:1,positionalUsage:"<check-id | task-check-id>",examples:["evolve check download 3f9a1c2e -o checks/","evolve check download 7c1d2e3f --stream trace-stdout"]},"files status":{summary:"File system source: live, captured or none",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<task-check-id>",examples:["evolve check files status 3f9a1c2e-\u2026"]},"files list":{summary:"List one folder of the file system (default /)",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},limit:{kind:"number",short:"l",value:"<n>",help:"Entries per page (default 500, max 1000)"},cursor:{kind:"string",value:"<name>",help:"Resume after this entry name (the previous page's next_cursor)"}},minPositionals:1,maxPositionals:2,positionalUsage:"<task-check-id> [path]",examples:["evolve check files ls 3f9a1c2e-\u2026 /app/work"]},"files cat":{summary:"Print one file, raw bytes",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},range:{kind:"string",value:"<bytes=a-b>",help:"One byte range: bytes=a-b, bytes=a- or bytes=-n"}},minPositionals:2,maxPositionals:2,positionalUsage:"<task-check-id> <path>",examples:["evolve check files cat 3f9a1c2e-\u2026 /app/work/main.py"]},"files search":{summary:"Search the task check's file system for text",flags:{path:{kind:"string",value:"<path>",help:"Folder to search under (default: /, the whole box \u2014 seconds)"},regex:{kind:"boolean",help:"Treat the text as a regular expression"},limit:{kind:"number",short:"l",value:"<n>",help:"Hit cap (default 200, max 1000)"},source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"}},minPositionals:2,maxPositionals:2,positionalUsage:"<task-check-id> <text>",examples:["evolve check files search 3f9a1c2e-\u2026 'permission denied' --path /app/work"]},"files changes":{summary:"Files created, modified or removed, by phase",flags:{source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},phase:{kind:"string",value:"<setup|agent|verifier|all>",help:"Only one phase's changes (default all)"},limit:{kind:"number",short:"l",value:"<n>",help:"Rows per page (default 500, max 1000)"},cursor:{kind:"string",value:"<path>",help:"Resume after this path (the previous page's next_cursor)"}},minPositionals:1,maxPositionals:1,positionalUsage:"<task-check-id>",examples:["evolve check files changes 3f9a1c2e-\u2026 --phase agent"]},"files archive":{summary:"Download one subtree as a .tar.gz",flags:{path:{kind:"string",value:"<path>",help:"Subtree to archive (default: /, the whole tree)"},source:{kind:"string",value:"<live|capture>",help:"Read the running box (live) or the kept tree (capture); default: whichever the run has"},"output-dir":{kind:"string",short:"o",value:"<dir>",help:"Save the archive into this directory and print its path (default: raw bytes to stdout)"}},minPositionals:1,maxPositionals:1,positionalUsage:"<task-check-id>",examples:["evolve check files archive 3f9a1c2e-\u2026 --path /app/work -o archives/"]},logs:{summary:"Read one sandbox log stream of the run",flags:{stream:{kind:"string",value:"<name>",help:"Which stream: agent | verifier | system (when the job asked for it); setup and metrics are named but not recorded today (required)"},follow:{kind:"boolean",short:"f",help:"Keep printing lines as they arrive while the box lives"},limit:{kind:"number",short:"l",value:"<n>",help:"Lines per page (default 1000, max 1000)"},cursor:{kind:"string",value:"<seq>",help:"Resume after this line seq"}},minPositionals:1,maxPositionals:1,positionalUsage:"<task-check-id>",examples:["evolve check logs 3f9a1c2e-\u2026 --stream agent --follow"]},procs:{summary:"The task check's box process list (live only)",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<task-check-id>",examples:["evolve check procs 3f9a1c2e-\u2026"]}}},session:{summary:"List, inspect and share managed-agent sessions",commands:{list:{summary:"List sessions, newest first",flags:{...I,scope:ne,state:{kind:"string",value:"<live|ended>",help:"Only live or only ended sessions",group:"Filter"},agent:{kind:"string",value:"<name>",help:"Only sessions of this agent harness",group:"Filter"},"tag-prefix":{kind:"string",value:"<prefix>",help:"Only sessions whose tag starts with this prefix",group:"Filter"}},minPositionals:0,maxPositionals:0,examples:["evolve session list","evolve session list --scope org","evolve session list --state ended --tag-prefix qa- -q"]},show:{summary:"Show one session in full",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<session-id>",examples:["evolve session show 5f2c1a0e"]},share:{summary:"Share a session you started by link or by email",notes:"--link prints the session's unlisted link (the same one every time); it opens the session, its transcript and its trace file, and nothing else. Each --email gets a link by mail; an address with no account gets a sign-up link, unless it is already waitlisted or invited and keeps that path. Both flags may ride one command.",flags:{link:{kind:"boolean",help:"Enable the session's unlisted link and print it"},email:Qe},minPositionals:1,maxPositionals:1,positionalUsage:"<session-id>",examples:["evolve session share 5f2c1a0e --link","evolve session share 5f2c1a0e --email alice@example.org"]},unshare:{summary:"Revoke a session's link or email shares",notes:"--link kills the link at once; a later share mints a new one. --email removes that address's share.",flags:{link:{kind:"boolean",help:"Disable the session's link"},email:Ze},minPositionals:1,maxPositionals:1,positionalUsage:"<session-id>",examples:["evolve session unshare 5f2c1a0e --link","evolve session unshare 5f2c1a0e --email alice@example.org"]},shares:{summary:"Show who a session is shared with",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<session-id>",examples:["evolve session shares 5f2c1a0e","evolve session shares 5f2c1a0e --json"]}}},dataset:{summary:"Browse and publish the dataset catalog",commands:{list:{summary:"List the dataset catalog",flags:{...I,search:{kind:"string",value:"<text>",help:"Free-text filter over name and description",group:"Filter"}},minPositionals:0,maxPositionals:0,examples:["evolve dataset list","evolve dataset list --search swe -q"]},show:{summary:"Show a dataset's versions, tasks and providers",flags:{limit:{kind:"number",short:"l",value:"<n>",help:"Task-list page size",group:"Paging"},cursor:{kind:"string",value:"<c>",help:"Resume the task list from a cursor",group:"Paging"}},minPositionals:1,maxPositionals:1,positionalUsage:"<name[@version]>",examples:["evolve dataset show terminal-bench-4@4.0"]},check:{summary:"Pre-flight a local corpus without uploading anything",flags:{},minPositionals:1,maxPositionals:1,positionalUsage:"<dir>",examples:["evolve dataset check ./corpus"]},publish:{summary:"Publish a dataset version",notes:"One source per publish: a pinned git ref, a local directory, or a public tarball or Harbor hub package. --name and --version are required with --git and with --from <url>; a local dataset.toml or a hub package can supply them.",flags:{git:{kind:"string",value:"<url>",help:"Git repository URL, with --ref",group:"Source"},ref:{kind:"string",value:"<ref>",help:"Pinned git ref, a full commit sha or a tag; a branch is refused",group:"Source"},path:{kind:"string",value:"<subfolder>",help:"Repository subfolder holding the corpus, with --git",group:"Source"},dir:{kind:"string",value:"<path>",help:"Local corpus directory, pre-flighted then uploaded",group:"Source"},from:{kind:"string",value:"<url|hub:org/name[@ref]>",help:"A public https tarball URL, or a public Harbor hub package",group:"Source"},name:{kind:"string",value:"<dataset>",help:"Catalog dataset name to create or extend",group:"Version"},version:{kind:"string",value:"<v>",help:"Version label for the published version",group:"Version"},org:{kind:"string",value:"<name>",help:"Organization a new dataset lands in; else the default from `evolve auth org use`, else your personal org",group:"Version"},watch:{kind:"boolean",help:"Poll until the version is READY or FAILED",group:"Output"},"skip-preflight":{kind:"boolean",help:"Upload a --dir without the pre-flight check",group:"Source"}},minPositionals:0,maxPositionals:0,examples:["evolve dataset publish --from hub:cookbook/hello-world --watch","evolve dataset publish --dir ./corpus --name my-swe --version 1.0 --watch",`evolve dataset publish \\
|
|
10
10
|
--git https://github.com/acme/tasks \\
|
|
11
11
|
--ref v1.2.0 \\
|
|
12
12
|
--path corpus \\
|
|
@@ -20,27 +20,27 @@ import {H as H$1,G as G$1,P,ha as ha$1,Da as Da$1,ua as ua$1,ta as ta$1,na as na
|
|
|
20
20
|
--allowed-host api.github.com \\
|
|
21
21
|
--allowed-path-prefix / \\
|
|
22
22
|
--allowed-method GET`,`printf %s "$OPENAI_API_KEY" | evolve secrets set OPENAI_API_KEY \\
|
|
23
|
-
--delivery direct`]},list:{summary:"List your env secrets",flags:{columns:I.columns,quiet:{kind:"boolean",short:"q",help:"Print only name[:label], one per line",group:"Output"},"no-trunc":I["no-trunc"],"no-headers":I["no-headers"]},minPositionals:0,maxPositionals:0,examples:["evolve secrets list"]},delete:{summary:"Delete an env secret",notes:"Every runtime grant riding the row is revoked with it.",flags:{label:{kind:"string",value:"<label>",help:"The row to delete, when several share the name"}},minPositionals:1,maxPositionals:1,positionalUsage:"<NAME>",examples:["evolve secrets delete GITHUB_TOKEN","evolve secrets delete GITHUB_TOKEN --label staging"]}}}},
|
|
23
|
+
--delivery direct`]},list:{summary:"List your env secrets",flags:{columns:I.columns,quiet:{kind:"boolean",short:"q",help:"Print only name[:label], one per line",group:"Output"},"no-trunc":I["no-trunc"],"no-headers":I["no-headers"]},minPositionals:0,maxPositionals:0,examples:["evolve secrets list"]},delete:{summary:"Delete an env secret",notes:"Every runtime grant riding the row is revoked with it.",flags:{label:{kind:"string",value:"<label>",help:"The row to delete, when several share the name"}},minPositionals:1,maxPositionals:1,positionalUsage:"<NAME>",examples:["evolve secrets delete GITHUB_TOKEN","evolve secrets delete GITHUB_TOKEN --label staging"]}}}},kt={run:{summary:"Start a job; the short form of job start",flags:Fs,minPositionals:0,maxPositionals:0,examples:Ms("evolve run")},analyze:{summary:"Judge a finished job's trial traces against a rubric",notes:"Each trial gets its own analysis run; `analysis list --job <id>` finds them again. --show-defaults prints the platform's analyze defaults and exits.",flags:{agent:{kind:"string",short:"a",value:"<name>",help:"Agent the analyzer runs on",default:"claude",group:"Analyzer"},model:{kind:"string",short:"m",value:"<name>",help:"Model the analyzer runs, on the agent's roster",default:"openrouter/deepseek/deepseek-v4.1-flash",group:"Analyzer"},effort:{kind:"string",value:"<value>",help:"Reasoning effort the analyzer runs at",default:"the model's own",group:"Analyzer"},rubric:{kind:"string",short:"r",value:"<path>",help:"Rubric file, TOML, YAML or JSON, in Harbor's criteria shape",default:"the built-in analyze rubric",group:"Analyzer"},prompt:{kind:"string",short:"p",value:"<path>",help:"Prompt file for the analyzer, replacing the built-in prompt",group:"Analyzer"},env:{kind:"string",short:"e",value:"<provider>",help:"Sandbox provider the analyzer runs on",default:"the analysis default",group:"Analyzer"},"show-defaults":{kind:"boolean",help:"Print the built-in agent, model, effort, provider, prompt and rubric, then exit",group:"Analyzer"},trial:{kind:"repeat",short:"t",value:"<trial-id>",help:"Analyze only this trial; repeatable",group:"Selection"},"n-concurrent":{kind:"number",short:"n",value:"<n>",help:"Max concurrent trial analyses",default:"your organization's ceiling",group:"Selection"},passing:{kind:"boolean",help:"Only passing trials, reward 1.0",group:"Selection"},failing:{kind:"boolean",help:"Only failing trials, reward below 1.0 or an error",group:"Selection"},"n-trials":{kind:"number",short:"l",value:"<n>",help:"Max trials to analyze, after --passing or --failing",group:"Selection"},watch:{kind:"boolean",help:"Poll until every analysis settles",group:"Output"},quiet:{kind:"boolean",short:"q",help:"With --watch, print only the final block",group:"Output"}},minPositionals:0,maxPositionals:1,positionalUsage:"[<job-id>]",examples:["evolve analyze 3e1f9a2c --watch",`evolve analyze 3e1f9a2c \\
|
|
24
24
|
-r rubric.toml -p prompt.txt \\
|
|
25
25
|
--failing -l 20 -n 2 \\
|
|
26
|
-
--watch`,"evolve analyze 3e1f9a2c -t d1a10c4e -t d1a10f72"]},check:{summary:"Check task quality against a rubric",notes:"Checks a local task directory, a directory of them, or with -d a published dataset. Results are read back with the verbs below.",flags:{name:{kind:"string",value:"<name>",help:"A name for the check; default: the accept timestamp",group:"Checker"},model:{kind:"string",short:"m",value:"<name>",help:"Model the checker runs",default:"openrouter/deepseek/deepseek-v4.1-flash",group:"Checker"},effort:{kind:"string",value:"<value>",help:"Reasoning effort the checker runs at",default:"the model's own",group:"Checker"},rubric:{kind:"string",short:"r",value:"<path>",help:"Rubric file, TOML, YAML or JSON, in Harbor's criteria shape",default:"the built-in check rubric",group:"Checker"},prompt:{kind:"string",short:"p",value:"<path>",help:"Prompt file for the checker, replacing the built-in prompt",group:"Checker"},env:{kind:"string",short:"e",value:"<provider>",help:"Sandbox provider the checker runs on",default:"the analysis default",group:"Checker"},"show-defaults":{kind:"boolean",help:"Print the built-in
|
|
27
|
-
`).map((t,s)=>s===0?` ${t}`:` ${t}`)}function ls(e,t){let s=t.positionalUsage?` ${t.positionalUsage}`:"",n=Object.keys(t.flags).length>0?" [options]":"",a=[`evolve ${e} \u2014 ${t.summary}`,"",`Usage: evolve ${e}${s}${n}`];t.notes!==void 0&&a.push("",...ae(t.notes)),a.push(...Wn(t.flags)),a.push("","Global options:",...
|
|
26
|
+
--watch`,"evolve analyze 3e1f9a2c -t d1a10c4e -t d1a10f72"]},check:{summary:"Check task quality against a rubric",notes:"Checks a local task directory, a directory of them, or with -d a published dataset. Results are read back with the verbs below.",flags:{name:{kind:"string",value:"<name>",help:"A name for the check; default: the accept timestamp",group:"Checker"},agent:{kind:"string",short:"a",value:"<name>",help:"Agent the checker runs on",default:"claude",group:"Checker"},model:{kind:"string",short:"m",value:"<name>",help:"Model the checker runs, on the agent's roster",default:"openrouter/deepseek/deepseek-v4.1-flash",group:"Checker"},effort:{kind:"string",value:"<value>",help:"Reasoning effort the checker runs at",default:"the model's own",group:"Checker"},rubric:{kind:"string",short:"r",value:"<path>",help:"Rubric file, TOML, YAML or JSON, in Harbor's criteria shape",default:"the built-in check rubric",group:"Checker"},prompt:{kind:"string",short:"p",value:"<path>",help:"Prompt file for the checker, replacing the built-in prompt",group:"Checker"},env:{kind:"string",short:"e",value:"<provider>",help:"Sandbox provider the checker runs on",default:"the analysis default",group:"Checker"},"show-defaults":{kind:"boolean",help:"Print the built-in agent, model, effort, provider, prompt and rubric, then exit",group:"Checker"},"n-concurrent":{kind:"number",short:"n",value:"<n>",help:"Max concurrent task checks",default:"your organization's ceiling",group:"Selection"},"include-task-name":{kind:"repeat",short:"i",value:"<glob>",help:"Only tasks matching the glob; repeatable",group:"Selection"},"exclude-task-name":{kind:"repeat",short:"x",value:"<glob>",help:"Skip tasks matching the glob; repeatable",group:"Selection"},"n-tasks":{kind:"number",short:"l",value:"<n>",help:"Max tasks to check, after the globs, in sorted order",group:"Selection"},dataset:{kind:"string",short:"d",value:"<name[@version]>",help:"A published dataset's tasks instead of a local <path>; not both",group:"Source"},watch:{kind:"boolean",help:"Poll until every task check settles",group:"Output"},quiet:{kind:"boolean",short:"q",help:"With --watch, print only the final report",group:"Output"}},minPositionals:0,maxPositionals:1,positionalUsage:"[<path>]",examples:["evolve check ./tasks --watch","evolve check -d terminal-bench-4@4.0 -i 'abs-*' -l 10 --watch","evolve check --show-defaults"]},upload:{summary:"Upload a Harbor job directory as a finished job",notes:"Takes the directory, its .tar.gz, or with --from a public URL of one, and follows the upload to the job it becomes. What a trial folder must hold, the score included: evolve skills get evals core-concepts/upload",flags:{dataset:{kind:"string",short:"d",value:"<name[@version]>",help:"Link the uploaded trials to a published dataset version by task name",group:"Link"},from:{kind:"string",value:"<url>",help:"A public https URL of the job archive, instead of <job_dir>",group:"Source"},"no-wait":{kind:"boolean",help:"Return with the import id instead of following it; re-attach with job import <id> --watch",group:"Output"}},minPositionals:0,maxPositionals:1,positionalUsage:"<job_dir>",examples:["evolve upload ./job-2026-08-27__12-00-00 -d deep-swe@1.1","evolve upload --from https://example.com/job.tar.gz --no-wait"]}},zs={jobs:"job",trials:"trial",analyses:"analysis",sessions:"session",datasets:"dataset",secret:"secrets"},qs={agents:'"agents" is reserved for the managed-agents CLI (not released yet) \u2014 for eval agent arms use "evolve agent"'},os={ls:"list"},Vn=80,Ie=23;function ae(e,t="",s=Vn){let n=[],a=t;for(let r of e.split(/\s+/).filter(i=>i!==""))a!==t&&a.length+1+r.length>s&&(n.push(a),a=t),a+=(a===t?"":" ")+r;return a!==t&&n.push(a),n}function ge(e,t,s){let n="".padEnd(s),[a,...r]=ae(t,n);return [` ${e.padEnd(s-2)}${a.slice(s)}`,...r]}function Hn(e,t){let s=[...t.short?[`-${t.short}`]:[],...(t.aliases??[]).map(a=>`--${a}`),`--${e}`];return `${t.short?"":" "}${s.join(", ")}${t.value?` ${t.value}`:""}`}function bt(e){let t=Object.entries(e),s=t.map(([r,i])=>Hn(r,i)),n=Math.min(Math.max(...s.map(r=>r.length))+4,34),a=[];return t.forEach(([,r],i)=>{let o=r.default!==void 0?`${r.help} (default: ${r.default})`:r.help;s[i].length+4>n?a.push(` ${s[i]}`,...ae(o,"".padEnd(n))):a.push(...ge(s[i],o,n));}),a}function Wn(e){let t=new Map;for(let[n,a]of Object.entries(e)){let r=a.group===void 0?"Options":a.group;t.set(r,{...t.get(r)??{},[n]:a});}let s=[];for(let[n,a]of t)s.push("",`${n}:`,...bt(a));return s}function Bn(e){return e.split(`
|
|
27
|
+
`).map((t,s)=>s===0?` ${t}`:` ${t}`)}function ls(e,t){let s=t.positionalUsage?` ${t.positionalUsage}`:"",n=Object.keys(t.flags).length>0?" [options]":"",a=[`evolve ${e} \u2014 ${t.summary}`,"",`Usage: evolve ${e}${s}${n}`];t.notes!==void 0&&a.push("",...ae(t.notes)),a.push(...Wn(t.flags)),a.push("","Global options:",...bt(Ee));let r=Q[e];return r!==void 0&&a.push("","Commands:",...Ks(r)),a.push("","Examples:",...t.examples.flatMap(Bn)),a.join(`
|
|
28
28
|
`)}function Ks(e){let t=Math.max(...Object.keys(e.commands).map(s=>s.length))+4;return Object.entries(e.commands).flatMap(([s,n])=>ge(s,n.summary,t))}function us(e){let t=Q[e],s=[`evolve ${e} \u2014 ${t.summary}`,"",`Usage: evolve ${e} <command> [options]`];return t.notes!==void 0&&s.push("",...ae(t.notes)),s.push("","Commands:",...Ks(t)),s.push("",`Run "evolve ${e} <command> --help" for its options and examples.`),s.join(`
|
|
29
|
-
`)}function ut(){let e=["evolve \u2014 Evolve hosted jobs CLI","","Usage: evolve <command> [options]","","Start here (for AI agents):"," evolve skills get evals","",...ae("Skills ship with the CLI and match its version. `skills get evals` is the index of the documentation; `skills get evals <page>` prints one page; `--full` prints every page. Task authoring: `skills get create-task`, `rewardkit`, `create-adapter`, `publish`."," "),"","Commands:"];for(let[t,s]of Object.entries(
|
|
30
|
-
`)}var wo=ut(),he=fileURLToPath(new URL("../..",import.meta.url));function Yn(){try{return JSON.parse(readFileSync(join(he,"package.json"),"utf-8")).version??"unknown"}catch{return "unknown"}}function ct(e,t){let s=[e.flags,Ae];for(let n of s)for(let[a,r]of Object.entries(n))if(t.long!==void 0){if(a===t.long||(r.aliases??[]).includes(t.long))return {name:a,flag:r}}else if(t.short!==void 0&&r.short===t.short)return {name:a,flag:r}}function Xn(e,t){if(t==="--help"||t==="-h")return true;if(t.startsWith("--")){let s=t.slice(2).split("=")[0];return ct(e,{long:s})!==void 0}if(t.startsWith("-")&&t.length>1){let s=t.slice(1).split("=")[0];return ct(e,{short:s})!==void 0}return false}function tt(e,t,s){let n={},a=[];for(let r=0;r<s.length;r++){let i=s[r];if(i==="--help"||i==="-h")return {command:"help",positionals:e.split(" "),flags:{}};let o,l;if(i.startsWith("--")){let m=i.slice(2),k=m.indexOf("=");k!==-1&&(l=m.slice(k+1),m=m.slice(0,k)),o={long:m};}else if(i.startsWith("-")&&i.length>1){let m=i.slice(1),k=m.indexOf("=");k!==-1&&(l=m.slice(k+1),m=m.slice(0,k)),o={short:m};}else {a.push(i);continue}let c=ct(t,o);if(!c)throw new f(`Unknown option ${i.split("=")[0]} for "${e}"`);let{name:u,flag:d}=c;if(d.kind==="boolean"){if(l!==void 0)throw new f(`Option --${u} takes no value`);n[u]=true;continue}let p=l;if(p===void 0){let m=s[r+1];if(m===void 0||Xn(t,m)){let k=m!==void 0?` (use --${u}=${m} if that is the value)`:"";throw new f(`Option --${u} requires a value${k}`)}p=m,r++;}if(d.kind==="number"){let m=Number(p);if(p.trim()===""||!Number.isFinite(m))throw new f(`Option --${u} expects a number, got "${p}"`);n[u]=m;}else if(d.kind==="repeat"){let m=n[u]??[];m.push(p),n[u]=m;}else n[u]=p;}if(a.length<t.minPositionals)throw new f(`"${e}" requires ${t.positionalUsage??`${t.minPositionals} argument(s)`}`);if(a.length>t.maxPositionals)throw new f(`"${e}" got unexpected argument "${a[t.maxPositionals]}"`);return {command:e,positionals:a,flags:n}}function Qn(e){if(e.length===0)return {command:"help",positionals:[],flags:{}};let t=e[0];if(t==="--help"||t==="-h"||t==="help")return {command:"help",positionals:e.slice(1),flags:{}};if(t==="--version"||t==="-v")return {command:"version",positionals:[],flags:{}};let s=bt[t],n=t==="check"&&e[1]!==void 0&&!e[1].startsWith("-")?dt(Q.check,e.slice(1)):null;if(s&&n===null)return tt(t,s,e.slice(1));let a=qs[t];if(a)throw new f(a);let r=zs[t]??t,i=Q[r];if(!i)throw new f(`Unknown command "${t}"`);let o=e[1];if(o==="--help"||o==="-h")return {command:"help",positionals:[r],flags:{}};if(o===void 0||o.startsWith("-")){if(i.defaultVerb===void 0){if(o===void 0)return {command:"help",positionals:[r],flags:{}};throw new f(`"${r}" requires a command (run "evolve ${r} --help")`)}return tt(`${r} ${i.defaultVerb}`,i.commands[i.defaultVerb],e.slice(1))}let l=dt(i,e.slice(1));if(!l){let c=e[2];if(Zn(i,o)&&(c===void 0||c==="--help"||c==="-h"))return {command:"help",positionals:[r,o],flags:{}};throw new f(`Unknown command "${r} ${o}" (supported: ${Object.keys(i.commands).join(", ")})`)}return tt(`${r} ${l.verb}`,l.spec,e.slice(1+l.words))}function dt(e,t){let s=t[0],n=t[1];if(s!==void 0&&n!==void 0&&!n.startsWith("-")){let i=`${s} ${os[n]??n}`,o=e.commands[i];if(o)return {verb:i,spec:o,words:2}}if(s===void 0)return null;let a=os[s]??s,r=e.commands[a];return r?{verb:a,spec:r,words:1}:null}function Zn(e,t){return Object.keys(e.commands).some(s=>s.startsWith(`${t} `))}function ea(e){return e.map(t=>typeof t=="object"&&t.tag==="tag:yaml.org,2002:bool"&&t.test?{...t,test:t.identify?.(true)?/^(?:[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/:/^(?:[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/}:t)}var ta=/^(?:[-+]?[0-9][0-9_]*\.[0-9_]*|\.[0-9][0-9_]*)$/,sa=/^(?:[-+]?[0-9][0-9_]*\.[0-9_]*|\.[0-9][0-9_]*)[eE][-+][0-9]+$/;function na(e){return e.map(t=>typeof t!="object"||t.tag!=="tag:yaml.org,2002:float"||!t.test?t:t.test.test("1.5e+3")?{...t,test:sa}:t.test.test("1.5")?{...t,test:ta}:t)}var aa=/^[-+]?(?:0|[1-9][0-9_]*)$/,ra=/^[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+$/;function ia(e){return e.map(t=>typeof t!="object"||t.tag!=="tag:yaml.org,2002:int"||!t.test?t:t.test.test("1:00")?{...t,test:ra}:t.test.test("19")?{...t,test:aa}:t)}function oa(e,t){return Gs(e,t).value}function Gs(e,t){let s=new LineCounter,n=parseDocument(e,{version:"1.1",schema:"yaml-1.1",resolveKnownTags:false,lineCounter:s,customTags:o=>ia(na(ea(o)))}),a=n.errors[0]??n.warnings[0];if(a){let o=a.linePos?.[0]?.line??1,l=a.code==="MULTIPLE_DOCS"?"multi-document YAML is not supported here \u2014 one config per file":a.message.replace(/ at line \d+, column \d+:[\s\S]*$/,"");throw new f(`${t}:${o}: ${l}`)}n.options.logLevel="silent";let r;try{r=n.toJS()??{};}catch(o){throw new f(`${t}: ${o.message}`)}return {value:r,locate:o=>{let c=n.getIn(o,true)?.range?.[0];return c===void 0?void 0:s.linePos(c).line}}}var la=["../../spec/openapi.yaml","../../../../spec/openapi.yaml"],Ie;function ua(){if(Ie)return Ie;let e=[],t=la.map(n=>fileURLToPath(new URL(n,import.meta.url))),s=process.env.EVOLVE_OPENAPI_SPEC_PATH;s&&t.unshift(s);for(let n of t){if(e.push(n),!existsSync(n))continue;let r=parse$1(readFileSync(n,"utf-8"))?.components?.schemas,i=r?.JobCreate;if(!r||!i||typeof i!="object")throw new Error(`${n} carries no components.schemas.JobCreate \u2014 the contract this CLI validates -c against`);return Ie={root:i,components:r},Ie}throw new Error(`spec/openapi.yaml not found (tried: ${e.join(", ")}) \u2014 the package ships it; reinstall the SDK, or point EVOLVE_OPENAPI_SPEC_PATH at a contract checkout`)}function Vs(e){let t=e.type;return typeof t=="string"?[t]:Array.isArray(t)?t.filter(s=>typeof s=="string"):[]}function vt(e,t,s){let n=e.$ref;if(typeof n!="string")return {schema:e,specName:s};let a=n.replace("#/components/schemas/",""),r=t[a];if(!r)throw new Error(`spec/openapi.yaml: unresolvable $ref "${n}"`);return vt(r,t,a)}function ca(e){return e.length===1&&typeof e[0]=="string"?`"${e[0]}"`:e.map((t,s)=>typeof t=="number"?`[${t}]`:s===0?t:`.${t}`).join("")}function Hs(e,t){let s=t.locate?.(e),n=`${t.source}${s!==void 0?`:${s}`:""}`;return e.length===0?n:`${ca(e)} in ${n}`}function A(e,t,s,n){throw new f(`--config: ${Hs(e,t)} ${s} [spec: ${n}]`)}function da(e){for(let t=e.length-1;t>=0;t--)if(typeof e[t]=="string")return e[t];return "value"}function fa(e,t){if(!e)return "a list";let s=vt(e,t.components,""),n=Vs(s.schema);return n.includes("string")?"a list of strings":n.includes("object")?"a list of objects":"a list"}function Oe(e,t,s,n,a,r=false){let{schema:i,specName:o}=vt(t,a.components,n),l=Vs(i),c=u=>o?`${o}.${u}`:u;if(e===null){if(l.includes("null"))return;A(s,a,`must be a ${l[0]??"value"}, not null`,o);}if(l.includes("object")){let u=V(i.additionalProperties)?i.additionalProperties:void 0;if(!V(e)){let p=u&&!i.properties?`must be a map of KEY: "value" pairs, not ${X(e)}`:`must be an object like {${pa(i)}: "..."}, not ${X(e)}`;A(s,a,p,o);}let d=V(i.properties)?i.properties:void 0;if(d){if(!r&&Array.isArray(i.required))for(let p of i.required)typeof p=="string"&&e[p]===void 0&&A(s,a,`is missing the required key "${p}"`,o);for(let p of Object.keys(e))if(d[p]===void 0&&!u)throw new f(`--config: unknown key "${p}" in ${Hs([...s,p],a)} (allowed: ${Object.keys(d).join(", ")}) [spec: ${o}]`);for(let[p,m]of Object.entries(d)){let k=e[p];k!==void 0&&Oe(k,m,[...s,p],c(p),a);}}if(u)for(let[p,m]of Object.entries(e))d?.[p]===void 0&&Oe(m,u,[...s,p],o,a);return}if(l.includes("array")){let u=V(i.items)?i.items:void 0;Array.isArray(e)||A(s,a,`must be ${fa(u,a)}, not ${X(e)}`,o),typeof i.minItems=="number"&&e.length<i.minItems&&A(s,a,`needs at least ${i.minItems} ${i.minItems===1?"entry":"entries"}`,o),typeof i.maxItems=="number"&&e.length>i.maxItems&&A(s,a,`takes at most ${i.maxItems} entries`,o),u&&e.forEach((d,p)=>Oe(d,u,[...s,p],o,a));return}if(Array.isArray(i.enum)){i.enum.includes(e)||A(s,a,`must be one of: ${i.enum.join(", ")}`,o);return}if(l.includes("string")){typeof e!="string"&&A(s,a,`must be a string, not ${X(e)} \u2014 quote it (${da(s)}: "...")`,o),typeof i.maxLength=="number"&&e.length>i.maxLength&&A(s,a,`must be at most ${i.maxLength} characters (got ${e.length})`,o);return}if(l.includes("integer")||l.includes("number")){let u=l.includes("integer");(typeof e!="number"||u&&!Number.isInteger(e))&&A(s,a,`must be ${u?"an integer":"a number"}, not ${X(e)}`,o),typeof i.minimum=="number"&&e<i.minimum&&A(s,a,`must be at least ${i.minimum}`,o),typeof i.maximum=="number"&&e>i.maximum&&A(s,a,`must be at most ${i.maximum}`,o);return}l.includes("boolean")&&typeof e!="boolean"&&A(s,a,`must be a boolean, not ${X(e)}`,o);}function pa(e){let t=Array.isArray(e.required)?e.required[0]:void 0;return typeof t=="string"?t:(V(e.properties)?Object.keys(e.properties):[])[0]??"name"}function ga(e,t,s){let{root:n,components:a}=ua();Oe(e,n,[],"JobCreate",{source:t,locate:s,components:a},true);}function X(e){return e===null?"null":Array.isArray(e)?"a list":typeof e=="object"?`a ${e.constructor?.name??"object"}`:`a ${typeof e}`}function V(e){if(typeof e!="object"||e===null||Array.isArray(e))return false;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ft(e,t,s,n=new WeakSet){if(!(e===null||typeof e=="string"||typeof e=="boolean")){if(typeof e=="number"){if(Number.isFinite(e))return;throw new f(`--config: ${t} in ${s} is ${Number.isNaN(e)?".nan":"infinite"} \u2014 a JSON body carries finite numbers only`)}if(Array.isArray(e)||V(e)){if(n.has(e))throw new f(`--config: ${t} in ${s} is an alias of a value that contains it \u2014 a JSON body cannot carry a cycle`);if(n.add(e),Array.isArray(e))e.forEach((a,r)=>ft(a,`${t}[${r}]`,s,n));else for(let[a,r]of Object.entries(e))ft(r,`${t}.${a}`,s,n);n.delete(e);return}throw new f(`--config: ${t} in ${s} resolved to ${X(e)}, which a JSON body cannot carry \u2014 quote the value to keep it text`)}}function ma(e,t){let s;try{s=t(e);}catch(i){throw new f(`--config: cannot read ${e}: ${i.message}`)}let n,a;if(e.endsWith(".json"))try{n=JSON.parse(s);}catch(i){throw new f(`--config: ${e} is not valid JSON: ${i.message}`)}else ({value:n,locate:a}=Gs(s,e));if(!n||typeof n!="object"||Array.isArray(n))throw new f(`--config: ${e} must contain a JSON/YAML object`);let r=n;for(let[i,o]of Object.entries(r))ft(o,i,e);return ga(r,e,a),n}function cs(e,t){let s=e.indexOf("@");if(s===-1)return {name:e};let n=e.slice(0,s),a=e.slice(s+1);if(!n||!a)throw new f(`Invalid ${t} "${e}": expected name or name@version`);return {name:n,version:a}}function ha(e){let t=e.trim();try{return JSON.parse(t)}catch{return t==="True"?true:t==="False"?false:t==="None"?null:t}}function ya(e,t=s=>readFileSync(s,"utf-8")){let s={};for(let n of e){let a=n.indexOf("=");if(a<=0)throw new f(`Invalid --ak "${n}": expected key=value`);let r=n.slice(0,a).trim(),i=ha(n.slice(a+1));r==="config"&&typeof i=="string"&&(i=ka(i,t)),s[r]=i;}return s}function ka(e,t){let s;try{s=t(e);}catch(a){throw new f(`--ak config: cannot read ${e}: ${a.message}`)}let n;if(e.endsWith(".toml"))try{n=parse(s);}catch(a){throw new f(`--ak config: ${e} is not valid TOML: ${a.message}`)}else if(e.endsWith(".json"))try{n=JSON.parse(s);}catch(a){throw new f(`--ak config: ${e} is not valid JSON: ${a.message}`)}else try{n=JSON.parse(s);}catch{try{n=parse(s);}catch{throw new f(`--ak config: ${e} parses as neither JSON nor TOML; use a .json or .toml settings file`)}}if(!n||typeof n!="object"||Array.isArray(n))throw new f(`--ak config: ${e} must contain a settings object`);return n}function _t(e,t=s=>readFileSync(s,"utf-8")){let s;try{s=t(e);}catch(n){throw new f(`--prompt: cannot read ${e}: ${n.message}`)}if(s.trim().length===0)throw new f(`--prompt: ${e} is empty \u2014 the analyzer's prompt file must carry the instruction text`);return s}function St(e,t=s=>readFileSync(s,"utf-8")){let s;try{s=t(e);}catch(i){throw new f(`--rubric: cannot read ${e}: ${i.message}`)}let n;if(e.endsWith(".toml"))try{n=parse(s);}catch(i){throw new f(`--rubric: ${e} is not valid TOML: ${i.message}`)}else if(e.endsWith(".yaml")||e.endsWith(".yml"))n=oa(s,e);else if(e.endsWith(".json"))try{n=JSON.parse(s);}catch(i){throw new f(`--rubric: ${e} is not valid JSON: ${i.message}`)}else throw new f(`--rubric: unsupported rubric format "${e}" \u2014 use a .toml, .yaml, .yml, or .json file (Harbor's own set)`);if(!V(n))throw new f(`--rubric: ${e} must contain a {criteria: [...]} object`);let a=Object.keys(n).filter(i=>i!=="criteria");if(a.length>0)throw new f(`--rubric: unknown key${a.length===1?"":"s"} ${a.map(i=>`"${i}"`).join(", ")} in ${e} \u2014 a rubric is {criteria: [{name, description, guidance}]}`);let r=n.criteria;if(!Array.isArray(r)||r.length===0)throw new f(`--rubric: ${e} needs a non-empty criteria list ([[criteria]] entries in TOML)`);return {criteria:r.map((i,o)=>{let l=`criteria[${o}] in ${e}`;if(!V(i))throw new f(`--rubric: ${l} must be a {name, description, guidance} object`);let c=Object.keys(i).filter(u=>u!=="name"&&u!=="description"&&u!=="guidance");if(c.length>0)throw new f(`--rubric: unknown key${c.length===1?"":"s"} ${c.map(u=>`"${u}"`).join(", ")} in ${l} \u2014 a criterion is {name, description, guidance}`);for(let u of ["name","description","guidance"])if(typeof i[u]!="string"||i[u].length===0)throw new f(`--rubric: ${l} needs a non-empty string "${u}"`);return {name:i.name,description:i.description,guidance:i.guidance}})}}function ba(e){return e.map(t=>{let s=t.indexOf("="),n=s===-1?t:t.slice(0,s),a=s===-1?void 0:t.slice(s+1);if(s!==-1&&!a)throw new f(`Invalid --secret "${t}": expected NAME[@LABEL][=ENVNAME]`);let r=n.indexOf("@"),i=r===-1?n:n.slice(0,r),o=r===-1?void 0:n.slice(r+1);if(!i||r!==-1&&!o)throw new f(`Invalid --secret "${t}": expected NAME[@LABEL][=ENVNAME]`);return {name:i,...o!==void 0?{label:o}:{},...a!==void 0?{as:a}:{}}})}function wa(e){let t="NAME[@LABEL]:brokered|direct=VALUE";return e.map(s=>{let n=s.indexOf("=");if(n===-1)throw new f(`Invalid --secret-inline "${s}": expected ${t}`);let a=s.slice(0,n),r=s.slice(n+1);if(!r)throw new f(`Invalid --secret-inline "${s}": the value must not be empty`);let i=a.lastIndexOf(":");if(i===-1)throw new f(`Invalid --secret-inline "${a}=...": a delivery mode is required \u2014 ${t}`);let o=a.slice(0,i),l=a.slice(i+1);if(l!=="brokered"&&l!=="direct")throw new f(`Invalid --secret-inline delivery "${l}": expected brokered or direct`);let c=o.indexOf("@"),u=c===-1?o:o.slice(0,c),d=c===-1?void 0:o.slice(c+1);if(!u||c!==-1&&!d)throw new f(`Invalid --secret-inline "${a}=...": expected ${t}`);return {name:u,value:r,delivery:l,...d!==void 0?{label:d}:{}}})}function Ws(e,t){let s={};for(let n of e){let a=n.indexOf("=");if(a<=0)throw new f(`Invalid ${t} "${n}": expected KEY=VALUE`);s[n.slice(0,a)]=n.slice(a+1);}return s}function va(e,t=s=>readFileSync(s,"utf-8")){let s=e.flags,n=typeof s.config=="string"?ma(s.config,t):{},a;if(s.dataset!==void 0)a=s.dataset.map(h=>{let $=cs(h,"--dataset");return {name:$.name,...$.version?{version:$.version}:{}}});else if(Array.isArray(n.datasets)&&n.datasets.length>0)a=n.datasets.map(h=>({...h}));else throw new f(`"${e.command}" requires -d/--dataset (or datasets in --config)`);if(s["include-task-name"]!==void 0)for(let h of a)h.task_names=s["include-task-name"];if(s["exclude-task-name"]!==void 0)for(let h of a)h.exclude_task_names=s["exclude-task-name"];if(s["n-tasks"]!==void 0)for(let h of a)h.n_tasks=s["n-tasks"];let r;if(s.agent!==void 0||s.model!==void 0){if(s.agent===void 0)throw new f("-m/--model requires -a/--agent");if(s.model===void 0)throw new f("-a/--agent requires at least one -m/--model (the server applies no model default)");let h=cs(String(s.agent),"--agent");r=s.model.map($=>({name:h.name,model_name:$,...h.version?{version:h.version}:{}}));}else if(Array.isArray(n.agents)&&n.agents.length>0)r=n.agents.map(h=>({...h}));else throw new f(`"${e.command}" requires -a/--agent and -m/--model (or agents in --config)`);if(s.effort!==void 0&&(r=r.map(h=>({...h,reasoning_effort:s.effort}))),s.ak!==void 0){let h=ya(s.ak,t);r=r.map($=>({...$,kwargs:{...$.kwargs??{},...h}}));}s.preset!==void 0&&(r=r.map(h=>({...h,preset:s.preset}))),s.skill!==void 0&&(r=r.map(h=>({...h,skills:[...s.skill]})));let o=n.agent_env,l=s["verifier-env"]!==void 0?Ws(s["verifier-env"],"--verifier-env"):n.verifier_env,c=s.secret!==void 0||s["secret-inline"]!==void 0?[...s.secret!==void 0?ba(s.secret):[],...s["secret-inline"]!==void 0?wa(s["secret-inline"]):[]]:n.secrets,u=s["job-name"]!==void 0?String(s["job-name"]):n.job_name,d=s["n-attempts"]!==void 0?s["n-attempts"]:n.n_attempts,p=s["n-concurrent"]!==void 0?s["n-concurrent"]:n.n_concurrent_trials,m=s["max-trial-spend"]!==void 0?s["max-trial-spend"]:n.max_trial_spend_usd;if(s.env!==void 0&&!D$1.includes(String(s.env)))throw new f(`-e/--env must be one of: ${D$1.join(", ")}`);let k=s.env!==void 0?s.env:n.sandbox_provider,P={...n.retry??{}};s["max-retries"]!==void 0&&(P.max_retries=s["max-retries"]),s["retry-include"]!==void 0&&(P.include_exceptions=s["retry-include"]),s["retry-exclude"]!==void 0&&(P.exclude_exceptions=s["retry-exclude"]);let S=s.analyze===true||s["analyze-model"]!==void 0||s["analyze-rubric"]!==void 0||s["analyze-prompt"]!==void 0||s["analyze-provider"]!==void 0||s["analyze-effort"]!==void 0||n.analyze!==void 0,b={...n.analyze??{}};s["analyze-model"]!==void 0&&(b.model_name=String(s["analyze-model"])),s["analyze-rubric"]!==void 0&&(b.rubric=St(String(s["analyze-rubric"]),t)),s["analyze-prompt"]!==void 0&&(b.prompt=_t(String(s["analyze-prompt"]),t)),s["analyze-provider"]!==void 0&&(b.sandbox_provider=String(s["analyze-provider"])),s["analyze-effort"]!==void 0&&(b.reasoning_effort=String(s["analyze-effort"]));let _={};for(let[h,$]of [["timeout-multiplier","timeout_multiplier"],["agent-timeout-multiplier","agent_timeout_multiplier"],["verifier-timeout-multiplier","verifier_timeout_multiplier"],["agent-setup-timeout-multiplier","agent_setup_timeout_multiplier"],["environment-build-timeout-multiplier","environment_build_timeout_multiplier"]]){let O=s[h]!==void 0?s[h]:n[$];O!==void 0&&(_[$]=O);}return {...u!==void 0?{job_name:u}:{},datasets:a,agents:r,...d!==void 0?{n_attempts:d}:{},...p!==void 0?{n_concurrent_trials:p}:{},...m!==void 0?{max_trial_spend_usd:m}:{},...k!==void 0?{sandbox_provider:k}:{},...Object.keys(P).length>0?{retry:P}:{},...S?{analyze:b}:{},...s["system-log"]===true||n.system_log===true?{system_log:true}:{},..._,...o!==void 0?{agent_env:o}:{},...l!==void 0?{verifier_env:l}:{},...c!==void 0?{secrets:c}:{}}}function _a(e){let t=e.flags,s=typeof t.dir=="string",n=typeof t.git=="string"||typeof t.ref=="string"||typeof t.path=="string",a=typeof t.from=="string";if([s,n,a].filter(Boolean).length>1)throw new f('"dataset publish" takes EXACTLY ONE source: --dir, --git/--ref/--path, or --from');if(a){let i=t.from.trim();if(i.startsWith("hub:")){let o=i.slice(4);if(o==="")throw new f('"--from hub:" needs a package reference \u2014 hub:org/name[@ref], e.g. hub:cookbook/hello-world');return {source:{hub_package:o},...typeof t.name=="string"?{name:t.name}:{},...typeof t.version=="string"?{version:t.version}:{}}}if(!i.startsWith("https://"))throw new f(`"--from" takes a public https tarball url or hub:org/name[@ref] (got "${i}")`);for(let o of ["name","version"])if(typeof t[o]!="string")throw new f(`"dataset publish" requires --${o} with --from <url> \u2014 the server fetches the tarball only after the publish is accepted, so nothing can supply it later`);return {source:{archive_url:i},name:t.name,version:t.version}}if(s)return {source:{directory:t.dir},...typeof t.name=="string"?{name:t.name}:{},...typeof t.version=="string"?{version:t.version}:{}};for(let i of ["git","ref","name","version"])if(typeof t[i]!="string"){let o=i==="git"||i==="ref"?" (or --dir for a local corpus directory)":" (a git source cannot take it from dataset.toml \u2014 the repository is only cloned after the publish is accepted)";throw new f(`"dataset publish" requires --${i}${o}`)}return {source:{git_url:t.git,git_ref:t.ref,...typeof t.path=="string"?{git_path:t.path}:{}},name:t.name,version:t.version}}function Sa(e,t=s=>readFileSync(s,"utf-8")){let s=e.flags,n=typeof s.dir=="string",a=typeof s["install-script"]=="string";if(n&&a)throw new f('"agent add" takes EITHER --dir OR --install-script, not both');if(!n&&!a)throw new f('"agent add" requires --install-script (or --dir for a local agent directory)');if(typeof s.run!="string")throw new f('"agent add" requires --run');let r=Ws(s["agent-env"]??[],"--agent-env");return {name:e.positionals[0],...n?{directory:s.dir}:{install_script:t(s["install-script"])},run_command:s.run,...Object.keys(r).length>0?{env:r}:{}}}var $a={out:e=>process.stdout.write(e+`
|
|
29
|
+
`)}function ut(){let e=["evolve \u2014 Evolve hosted jobs CLI","","Usage: evolve <command> [options]","","Start here (for AI agents):"," evolve skills get evals","",...ae("Skills ship with the CLI and match its version. `skills get evals` is the index of the documentation; `skills get evals <page>` prints one page; `--full` prints every page. Task authoring: `skills get create-task`, `rewardkit`, `create-adapter`, `publish`."," "),"","Commands:"];for(let[t,s]of Object.entries(kt))e.push(...ge(t,s.summary,Ie));e.push(...ge("help [command]","Show help; also -h/--help on any command",Ie)),e.push("","Command groups (evolve <group> <verb>):");for(let[t,s]of Object.entries(Q))e.push(...ge(t,s.summary,Ie)),e.push(...ae(Object.keys(s.commands).join(", "),"".padEnd(Ie)));return e.push("","Global options:",...bt({...Ee,version:{kind:"boolean",short:"v",help:"Print the CLI version"}}),"","Examples:"," evolve run -d terminal-bench-4@4.0 -a codex -m gpt-6-astra -l 5 --watch"," evolve job list"," evolve skills get evals core-concepts/jobs"),e.join(`
|
|
30
|
+
`)}var wo=ut(),he=fileURLToPath(new URL("../..",import.meta.url));function Yn(){try{return JSON.parse(readFileSync(join(he,"package.json"),"utf-8")).version??"unknown"}catch{return "unknown"}}function ct(e,t){let s=[e.flags,Ee];for(let n of s)for(let[a,r]of Object.entries(n))if(t.long!==void 0){if(a===t.long||(r.aliases??[]).includes(t.long))return {name:a,flag:r}}else if(t.short!==void 0&&r.short===t.short)return {name:a,flag:r}}function Xn(e,t){if(t==="--help"||t==="-h")return true;if(t.startsWith("--")){let s=t.slice(2).split("=")[0];return ct(e,{long:s})!==void 0}if(t.startsWith("-")&&t.length>1){let s=t.slice(1).split("=")[0];return ct(e,{short:s})!==void 0}return false}function tt(e,t,s){let n={},a=[];for(let r=0;r<s.length;r++){let i=s[r];if(i==="--help"||i==="-h")return {command:"help",positionals:e.split(" "),flags:{}};let o,l;if(i.startsWith("--")){let m=i.slice(2),k=m.indexOf("=");k!==-1&&(l=m.slice(k+1),m=m.slice(0,k)),o={long:m};}else if(i.startsWith("-")&&i.length>1){let m=i.slice(1),k=m.indexOf("=");k!==-1&&(l=m.slice(k+1),m=m.slice(0,k)),o={short:m};}else {a.push(i);continue}let c=ct(t,o);if(!c)throw new f(`Unknown option ${i.split("=")[0]} for "${e}"`);let{name:u,flag:d}=c;if(d.kind==="boolean"){if(l!==void 0)throw new f(`Option --${u} takes no value`);n[u]=true;continue}let p=l;if(p===void 0){let m=s[r+1];if(m===void 0||Xn(t,m)){let k=m!==void 0?` (use --${u}=${m} if that is the value)`:"";throw new f(`Option --${u} requires a value${k}`)}p=m,r++;}if(d.kind==="number"){let m=Number(p);if(p.trim()===""||!Number.isFinite(m))throw new f(`Option --${u} expects a number, got "${p}"`);n[u]=m;}else if(d.kind==="repeat"){let m=n[u]??[];m.push(p),n[u]=m;}else n[u]=p;}if(a.length<t.minPositionals)throw new f(`"${e}" requires ${t.positionalUsage??`${t.minPositionals} argument(s)`}`);if(a.length>t.maxPositionals)throw new f(`"${e}" got unexpected argument "${a[t.maxPositionals]}"`);return {command:e,positionals:a,flags:n}}function Qn(e){if(e.length===0)return {command:"help",positionals:[],flags:{}};let t=e[0];if(t==="--help"||t==="-h"||t==="help")return {command:"help",positionals:e.slice(1),flags:{}};if(t==="--version"||t==="-v")return {command:"version",positionals:[],flags:{}};let s=kt[t],n=t==="check"&&e[1]!==void 0&&!e[1].startsWith("-")?dt(Q.check,e.slice(1)):null;if(s&&n===null)return tt(t,s,e.slice(1));let a=qs[t];if(a)throw new f(a);let r=zs[t]??t,i=Q[r];if(!i)throw new f(`Unknown command "${t}"`);let o=e[1];if(o==="--help"||o==="-h")return {command:"help",positionals:[r],flags:{}};if(o===void 0||o.startsWith("-")){if(i.defaultVerb===void 0){if(o===void 0)return {command:"help",positionals:[r],flags:{}};throw new f(`"${r}" requires a command (run "evolve ${r} --help")`)}return tt(`${r} ${i.defaultVerb}`,i.commands[i.defaultVerb],e.slice(1))}let l=dt(i,e.slice(1));if(!l){let c=e[2];if(Zn(i,o)&&(c===void 0||c==="--help"||c==="-h"))return {command:"help",positionals:[r,o],flags:{}};throw new f(`Unknown command "${r} ${o}" (supported: ${Object.keys(i.commands).join(", ")})`)}return tt(`${r} ${l.verb}`,l.spec,e.slice(1+l.words))}function dt(e,t){let s=t[0],n=t[1];if(s!==void 0&&n!==void 0&&!n.startsWith("-")){let i=`${s} ${os[n]??n}`,o=e.commands[i];if(o)return {verb:i,spec:o,words:2}}if(s===void 0)return null;let a=os[s]??s,r=e.commands[a];return r?{verb:a,spec:r,words:1}:null}function Zn(e,t){return Object.keys(e.commands).some(s=>s.startsWith(`${t} `))}function ea(e){return e.map(t=>typeof t=="object"&&t.tag==="tag:yaml.org,2002:bool"&&t.test?{...t,test:t.identify?.(true)?/^(?:[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/:/^(?:[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/}:t)}var ta=/^(?:[-+]?[0-9][0-9_]*\.[0-9_]*|\.[0-9][0-9_]*)$/,sa=/^(?:[-+]?[0-9][0-9_]*\.[0-9_]*|\.[0-9][0-9_]*)[eE][-+][0-9]+$/;function na(e){return e.map(t=>typeof t!="object"||t.tag!=="tag:yaml.org,2002:float"||!t.test?t:t.test.test("1.5e+3")?{...t,test:sa}:t.test.test("1.5")?{...t,test:ta}:t)}var aa=/^[-+]?(?:0|[1-9][0-9_]*)$/,ra=/^[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+$/;function ia(e){return e.map(t=>typeof t!="object"||t.tag!=="tag:yaml.org,2002:int"||!t.test?t:t.test.test("1:00")?{...t,test:ra}:t.test.test("19")?{...t,test:aa}:t)}function oa(e,t){return Gs(e,t).value}function Gs(e,t){let s=new LineCounter,n=parseDocument(e,{version:"1.1",schema:"yaml-1.1",resolveKnownTags:false,lineCounter:s,customTags:o=>ia(na(ea(o)))}),a=n.errors[0]??n.warnings[0];if(a){let o=a.linePos?.[0]?.line??1,l=a.code==="MULTIPLE_DOCS"?"multi-document YAML is not supported here \u2014 one config per file":a.message.replace(/ at line \d+, column \d+:[\s\S]*$/,"");throw new f(`${t}:${o}: ${l}`)}n.options.logLevel="silent";let r;try{r=n.toJS()??{};}catch(o){throw new f(`${t}: ${o.message}`)}return {value:r,locate:o=>{let c=n.getIn(o,true)?.range?.[0];return c===void 0?void 0:s.linePos(c).line}}}var la=["../../spec/openapi.yaml","../../../../spec/openapi.yaml"],Oe;function ua(){if(Oe)return Oe;let e=[],t=la.map(n=>fileURLToPath(new URL(n,import.meta.url))),s=process.env.EVOLVE_OPENAPI_SPEC_PATH;s&&t.unshift(s);for(let n of t){if(e.push(n),!existsSync(n))continue;let r=parse$1(readFileSync(n,"utf-8"))?.components?.schemas,i=r?.JobCreate;if(!r||!i||typeof i!="object")throw new Error(`${n} carries no components.schemas.JobCreate \u2014 the contract this CLI validates -c against`);return Oe={root:i,components:r},Oe}throw new Error(`spec/openapi.yaml not found (tried: ${e.join(", ")}) \u2014 the package ships it; reinstall the SDK, or point EVOLVE_OPENAPI_SPEC_PATH at a contract checkout`)}function Vs(e){let t=e.type;return typeof t=="string"?[t]:Array.isArray(t)?t.filter(s=>typeof s=="string"):[]}function wt(e,t,s){let n=e.$ref;if(typeof n!="string")return {schema:e,specName:s};let a=n.replace("#/components/schemas/",""),r=t[a];if(!r)throw new Error(`spec/openapi.yaml: unresolvable $ref "${n}"`);return wt(r,t,a)}function ca(e){return e.length===1&&typeof e[0]=="string"?`"${e[0]}"`:e.map((t,s)=>typeof t=="number"?`[${t}]`:s===0?t:`.${t}`).join("")}function Hs(e,t){let s=t.locate?.(e),n=`${t.source}${s!==void 0?`:${s}`:""}`;return e.length===0?n:`${ca(e)} in ${n}`}function A(e,t,s,n){throw new f(`--config: ${Hs(e,t)} ${s} [spec: ${n}]`)}function da(e){for(let t=e.length-1;t>=0;t--)if(typeof e[t]=="string")return e[t];return "value"}function fa(e,t){if(!e)return "a list";let s=wt(e,t.components,""),n=Vs(s.schema);return n.includes("string")?"a list of strings":n.includes("object")?"a list of objects":"a list"}function Pe(e,t,s,n,a,r=false){let{schema:i,specName:o}=wt(t,a.components,n),l=Vs(i),c=u=>o?`${o}.${u}`:u;if(e===null){if(l.includes("null"))return;A(s,a,`must be a ${l[0]??"value"}, not null`,o);}if(l.includes("object")){let u=V(i.additionalProperties)?i.additionalProperties:void 0;if(!V(e)){let p=u&&!i.properties?`must be a map of KEY: "value" pairs, not ${X(e)}`:`must be an object like {${pa(i)}: "..."}, not ${X(e)}`;A(s,a,p,o);}let d=V(i.properties)?i.properties:void 0;if(d){if(!r&&Array.isArray(i.required))for(let p of i.required)typeof p=="string"&&e[p]===void 0&&A(s,a,`is missing the required key "${p}"`,o);for(let p of Object.keys(e))if(d[p]===void 0&&!u)throw new f(`--config: unknown key "${p}" in ${Hs([...s,p],a)} (allowed: ${Object.keys(d).join(", ")}) [spec: ${o}]`);for(let[p,m]of Object.entries(d)){let k=e[p];k!==void 0&&Pe(k,m,[...s,p],c(p),a);}}if(u)for(let[p,m]of Object.entries(e))d?.[p]===void 0&&Pe(m,u,[...s,p],o,a);return}if(l.includes("array")){let u=V(i.items)?i.items:void 0;Array.isArray(e)||A(s,a,`must be ${fa(u,a)}, not ${X(e)}`,o),typeof i.minItems=="number"&&e.length<i.minItems&&A(s,a,`needs at least ${i.minItems} ${i.minItems===1?"entry":"entries"}`,o),typeof i.maxItems=="number"&&e.length>i.maxItems&&A(s,a,`takes at most ${i.maxItems} entries`,o),u&&e.forEach((d,p)=>Pe(d,u,[...s,p],o,a));return}if(Array.isArray(i.enum)){i.enum.includes(e)||A(s,a,`must be one of: ${i.enum.join(", ")}`,o);return}if(l.includes("string")){typeof e!="string"&&A(s,a,`must be a string, not ${X(e)} \u2014 quote it (${da(s)}: "...")`,o),typeof i.maxLength=="number"&&e.length>i.maxLength&&A(s,a,`must be at most ${i.maxLength} characters (got ${e.length})`,o);return}if(l.includes("integer")||l.includes("number")){let u=l.includes("integer");(typeof e!="number"||u&&!Number.isInteger(e))&&A(s,a,`must be ${u?"an integer":"a number"}, not ${X(e)}`,o),typeof i.minimum=="number"&&e<i.minimum&&A(s,a,`must be at least ${i.minimum}`,o),typeof i.maximum=="number"&&e>i.maximum&&A(s,a,`must be at most ${i.maximum}`,o);return}l.includes("boolean")&&typeof e!="boolean"&&A(s,a,`must be a boolean, not ${X(e)}`,o);}function pa(e){let t=Array.isArray(e.required)?e.required[0]:void 0;return typeof t=="string"?t:(V(e.properties)?Object.keys(e.properties):[])[0]??"name"}function ga(e,t,s){let{root:n,components:a}=ua();Pe(e,n,[],"JobCreate",{source:t,locate:s,components:a},true);}function X(e){return e===null?"null":Array.isArray(e)?"a list":typeof e=="object"?`a ${e.constructor?.name??"object"}`:`a ${typeof e}`}function V(e){if(typeof e!="object"||e===null||Array.isArray(e))return false;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ft(e,t,s,n=new WeakSet){if(!(e===null||typeof e=="string"||typeof e=="boolean")){if(typeof e=="number"){if(Number.isFinite(e))return;throw new f(`--config: ${t} in ${s} is ${Number.isNaN(e)?".nan":"infinite"} \u2014 a JSON body carries finite numbers only`)}if(Array.isArray(e)||V(e)){if(n.has(e))throw new f(`--config: ${t} in ${s} is an alias of a value that contains it \u2014 a JSON body cannot carry a cycle`);if(n.add(e),Array.isArray(e))e.forEach((a,r)=>ft(a,`${t}[${r}]`,s,n));else for(let[a,r]of Object.entries(e))ft(r,`${t}.${a}`,s,n);n.delete(e);return}throw new f(`--config: ${t} in ${s} resolved to ${X(e)}, which a JSON body cannot carry \u2014 quote the value to keep it text`)}}function ma(e,t){let s;try{s=t(e);}catch(i){throw new f(`--config: cannot read ${e}: ${i.message}`)}let n,a;if(e.endsWith(".json"))try{n=JSON.parse(s);}catch(i){throw new f(`--config: ${e} is not valid JSON: ${i.message}`)}else ({value:n,locate:a}=Gs(s,e));if(!n||typeof n!="object"||Array.isArray(n))throw new f(`--config: ${e} must contain a JSON/YAML object`);let r=n;for(let[i,o]of Object.entries(r))ft(o,i,e);return ga(r,e,a),n}function cs(e,t){let s=e.indexOf("@");if(s===-1)return {name:e};let n=e.slice(0,s),a=e.slice(s+1);if(!n||!a)throw new f(`Invalid ${t} "${e}": expected name or name@version`);return {name:n,version:a}}function ha(e){let t=e.trim();try{return JSON.parse(t)}catch{return t==="True"?true:t==="False"?false:t==="None"?null:t}}function ya(e,t=s=>readFileSync(s,"utf-8")){let s={};for(let n of e){let a=n.indexOf("=");if(a<=0)throw new f(`Invalid --ak "${n}": expected key=value`);let r=n.slice(0,a).trim(),i=ha(n.slice(a+1));r==="config"&&typeof i=="string"&&(i=ka(i,t)),s[r]=i;}return s}function ka(e,t){let s;try{s=t(e);}catch(a){throw new f(`--ak config: cannot read ${e}: ${a.message}`)}let n;if(e.endsWith(".toml"))try{n=parse(s);}catch(a){throw new f(`--ak config: ${e} is not valid TOML: ${a.message}`)}else if(e.endsWith(".json"))try{n=JSON.parse(s);}catch(a){throw new f(`--ak config: ${e} is not valid JSON: ${a.message}`)}else try{n=JSON.parse(s);}catch{try{n=parse(s);}catch{throw new f(`--ak config: ${e} parses as neither JSON nor TOML; use a .json or .toml settings file`)}}if(!n||typeof n!="object"||Array.isArray(n))throw new f(`--ak config: ${e} must contain a settings object`);return n}function vt(e,t=s=>readFileSync(s,"utf-8")){let s;try{s=t(e);}catch(n){throw new f(`--prompt: cannot read ${e}: ${n.message}`)}if(s.trim().length===0)throw new f(`--prompt: ${e} is empty \u2014 the analyzer's prompt file must carry the instruction text`);return s}function _t(e,t=s=>readFileSync(s,"utf-8")){let s;try{s=t(e);}catch(i){throw new f(`--rubric: cannot read ${e}: ${i.message}`)}let n;if(e.endsWith(".toml"))try{n=parse(s);}catch(i){throw new f(`--rubric: ${e} is not valid TOML: ${i.message}`)}else if(e.endsWith(".yaml")||e.endsWith(".yml"))n=oa(s,e);else if(e.endsWith(".json"))try{n=JSON.parse(s);}catch(i){throw new f(`--rubric: ${e} is not valid JSON: ${i.message}`)}else throw new f(`--rubric: unsupported rubric format "${e}" \u2014 use a .toml, .yaml, .yml, or .json file (Harbor's own set)`);if(!V(n))throw new f(`--rubric: ${e} must contain a {criteria: [...]} object`);let a=Object.keys(n).filter(i=>i!=="criteria");if(a.length>0)throw new f(`--rubric: unknown key${a.length===1?"":"s"} ${a.map(i=>`"${i}"`).join(", ")} in ${e} \u2014 a rubric is {criteria: [{name, description, guidance}]}`);let r=n.criteria;if(!Array.isArray(r)||r.length===0)throw new f(`--rubric: ${e} needs a non-empty criteria list ([[criteria]] entries in TOML)`);return {criteria:r.map((i,o)=>{let l=`criteria[${o}] in ${e}`;if(!V(i))throw new f(`--rubric: ${l} must be a {name, description, guidance} object`);let c=Object.keys(i).filter(u=>u!=="name"&&u!=="description"&&u!=="guidance");if(c.length>0)throw new f(`--rubric: unknown key${c.length===1?"":"s"} ${c.map(u=>`"${u}"`).join(", ")} in ${l} \u2014 a criterion is {name, description, guidance}`);for(let u of ["name","description","guidance"])if(typeof i[u]!="string"||i[u].length===0)throw new f(`--rubric: ${l} needs a non-empty string "${u}"`);return {name:i.name,description:i.description,guidance:i.guidance}})}}function ba(e){return e.map(t=>{let s=t.indexOf("="),n=s===-1?t:t.slice(0,s),a=s===-1?void 0:t.slice(s+1);if(s!==-1&&!a)throw new f(`Invalid --secret "${t}": expected NAME[@LABEL][=ENVNAME]`);let r=n.indexOf("@"),i=r===-1?n:n.slice(0,r),o=r===-1?void 0:n.slice(r+1);if(!i||r!==-1&&!o)throw new f(`Invalid --secret "${t}": expected NAME[@LABEL][=ENVNAME]`);return {name:i,...o!==void 0?{label:o}:{},...a!==void 0?{as:a}:{}}})}function wa(e){let t="NAME[@LABEL]:brokered|direct=VALUE";return e.map(s=>{let n=s.indexOf("=");if(n===-1)throw new f(`Invalid --secret-inline "${s}": expected ${t}`);let a=s.slice(0,n),r=s.slice(n+1);if(!r)throw new f(`Invalid --secret-inline "${s}": the value must not be empty`);let i=a.lastIndexOf(":");if(i===-1)throw new f(`Invalid --secret-inline "${a}=...": a delivery mode is required \u2014 ${t}`);let o=a.slice(0,i),l=a.slice(i+1);if(l!=="brokered"&&l!=="direct")throw new f(`Invalid --secret-inline delivery "${l}": expected brokered or direct`);let c=o.indexOf("@"),u=c===-1?o:o.slice(0,c),d=c===-1?void 0:o.slice(c+1);if(!u||c!==-1&&!d)throw new f(`Invalid --secret-inline "${a}=...": expected ${t}`);return {name:u,value:r,delivery:l,...d!==void 0?{label:d}:{}}})}function Ws(e,t){let s={};for(let n of e){let a=n.indexOf("=");if(a<=0)throw new f(`Invalid ${t} "${n}": expected KEY=VALUE`);s[n.slice(0,a)]=n.slice(a+1);}return s}function va(e,t=s=>readFileSync(s,"utf-8")){let s=e.flags,n=typeof s.config=="string"?ma(s.config,t):{},a;if(s.dataset!==void 0)a=s.dataset.map(h=>{let $=cs(h,"--dataset");return {name:$.name,...$.version?{version:$.version}:{}}});else if(Array.isArray(n.datasets)&&n.datasets.length>0)a=n.datasets.map(h=>({...h}));else throw new f(`"${e.command}" requires -d/--dataset (or datasets in --config)`);if(s["include-task-name"]!==void 0)for(let h of a)h.task_names=s["include-task-name"];if(s["exclude-task-name"]!==void 0)for(let h of a)h.exclude_task_names=s["exclude-task-name"];if(s["n-tasks"]!==void 0)for(let h of a)h.n_tasks=s["n-tasks"];let r;if(s.agent!==void 0||s.model!==void 0){if(s.agent===void 0)throw new f("-m/--model requires -a/--agent");if(s.model===void 0)throw new f("-a/--agent requires at least one -m/--model (the server applies no model default)");let h=cs(String(s.agent),"--agent");r=s.model.map($=>({name:h.name,model_name:$,...h.version?{version:h.version}:{}}));}else if(Array.isArray(n.agents)&&n.agents.length>0)r=n.agents.map(h=>({...h}));else throw new f(`"${e.command}" requires -a/--agent and -m/--model (or agents in --config)`);if(s.effort!==void 0&&(r=r.map(h=>({...h,reasoning_effort:s.effort}))),s.ak!==void 0){let h=ya(s.ak,t);r=r.map($=>({...$,kwargs:{...$.kwargs??{},...h}}));}s.preset!==void 0&&(r=r.map(h=>({...h,preset:s.preset}))),s.skill!==void 0&&(r=r.map(h=>({...h,skills:[...s.skill]})));let o=n.agent_env,l=s["verifier-env"]!==void 0?Ws(s["verifier-env"],"--verifier-env"):n.verifier_env,c=s.secret!==void 0||s["secret-inline"]!==void 0?[...s.secret!==void 0?ba(s.secret):[],...s["secret-inline"]!==void 0?wa(s["secret-inline"]):[]]:n.secrets,u=s["job-name"]!==void 0?String(s["job-name"]):n.job_name,d=s["n-attempts"]!==void 0?s["n-attempts"]:n.n_attempts,p=s["n-concurrent"]!==void 0?s["n-concurrent"]:n.n_concurrent_trials,m=s["max-trial-spend"]!==void 0?s["max-trial-spend"]:n.max_trial_spend_usd;if(s.env!==void 0&&!D$1.includes(String(s.env)))throw new f(`-e/--env must be one of: ${D$1.join(", ")}`);let k=s.env!==void 0?s.env:n.sandbox_provider,P={...n.retry??{}};s["max-retries"]!==void 0&&(P.max_retries=s["max-retries"]),s["retry-include"]!==void 0&&(P.include_exceptions=s["retry-include"]),s["retry-exclude"]!==void 0&&(P.exclude_exceptions=s["retry-exclude"]);let S=s.analyze===true||s["analyze-agent"]!==void 0||s["analyze-model"]!==void 0||s["analyze-rubric"]!==void 0||s["analyze-prompt"]!==void 0||s["analyze-provider"]!==void 0||s["analyze-effort"]!==void 0||n.analyze!==void 0,b={...n.analyze??{}};s["analyze-agent"]!==void 0&&(b.agent=String(s["analyze-agent"])),s["analyze-model"]!==void 0&&(b.model_name=String(s["analyze-model"])),s["analyze-rubric"]!==void 0&&(b.rubric=_t(String(s["analyze-rubric"]),t)),s["analyze-prompt"]!==void 0&&(b.prompt=vt(String(s["analyze-prompt"]),t)),s["analyze-provider"]!==void 0&&(b.sandbox_provider=String(s["analyze-provider"])),s["analyze-effort"]!==void 0&&(b.reasoning_effort=String(s["analyze-effort"]));let _={};for(let[h,$]of [["timeout-multiplier","timeout_multiplier"],["agent-timeout-multiplier","agent_timeout_multiplier"],["verifier-timeout-multiplier","verifier_timeout_multiplier"],["agent-setup-timeout-multiplier","agent_setup_timeout_multiplier"],["environment-build-timeout-multiplier","environment_build_timeout_multiplier"]]){let O=s[h]!==void 0?s[h]:n[$];O!==void 0&&(_[$]=O);}return {...u!==void 0?{job_name:u}:{},datasets:a,agents:r,...d!==void 0?{n_attempts:d}:{},...p!==void 0?{n_concurrent_trials:p}:{},...m!==void 0?{max_trial_spend_usd:m}:{},...k!==void 0?{sandbox_provider:k}:{},...Object.keys(P).length>0?{retry:P}:{},...S?{analyze:b}:{},...s["system-log"]===true||n.system_log===true?{system_log:true}:{},..._,...o!==void 0?{agent_env:o}:{},...l!==void 0?{verifier_env:l}:{},...c!==void 0?{secrets:c}:{}}}function _a(e){let t=e.flags,s=typeof t.dir=="string",n=typeof t.git=="string"||typeof t.ref=="string"||typeof t.path=="string",a=typeof t.from=="string";if([s,n,a].filter(Boolean).length>1)throw new f('"dataset publish" takes EXACTLY ONE source: --dir, --git/--ref/--path, or --from');if(a){let i=t.from.trim();if(i.startsWith("hub:")){let o=i.slice(4);if(o==="")throw new f('"--from hub:" needs a package reference \u2014 hub:org/name[@ref], e.g. hub:cookbook/hello-world');return {source:{hub_package:o},...typeof t.name=="string"?{name:t.name}:{},...typeof t.version=="string"?{version:t.version}:{}}}if(!i.startsWith("https://"))throw new f(`"--from" takes a public https tarball url or hub:org/name[@ref] (got "${i}")`);for(let o of ["name","version"])if(typeof t[o]!="string")throw new f(`"dataset publish" requires --${o} with --from <url> \u2014 the server fetches the tarball only after the publish is accepted, so nothing can supply it later`);return {source:{archive_url:i},name:t.name,version:t.version}}if(s)return {source:{directory:t.dir},...typeof t.name=="string"?{name:t.name}:{},...typeof t.version=="string"?{version:t.version}:{}};for(let i of ["git","ref","name","version"])if(typeof t[i]!="string"){let o=i==="git"||i==="ref"?" (or --dir for a local corpus directory)":" (a git source cannot take it from dataset.toml \u2014 the repository is only cloned after the publish is accepted)";throw new f(`"dataset publish" requires --${i}${o}`)}return {source:{git_url:t.git,git_ref:t.ref,...typeof t.path=="string"?{git_path:t.path}:{}},name:t.name,version:t.version}}function Sa(e,t=s=>readFileSync(s,"utf-8")){let s=e.flags,n=typeof s.dir=="string",a=typeof s["install-script"]=="string";if(n&&a)throw new f('"agent add" takes EITHER --dir OR --install-script, not both');if(!n&&!a)throw new f('"agent add" requires --install-script (or --dir for a local agent directory)');if(typeof s.run!="string")throw new f('"agent add" requires --run');let r=Ws(s["agent-env"]??[],"--agent-env");return {name:e.positionals[0],...n?{directory:s.dir}:{install_script:t(s["install-script"])},run_command:s.run,...Object.keys(r).length>0?{env:r}:{}}}var $a={out:e=>process.stdout.write(e+`
|
|
31
31
|
`),err:e=>process.stderr.write(e+`
|
|
32
|
-
`),tty:process.stdout.isTTY===true&&process.env.TERM!=="dumb",...process.stdin.isTTY===true?{confirm:async e=>{let{createInterface:t}=await import('readline/promises'),s=t({input:process.stdin,output:process.stderr});try{let n=(await s.question(`${e} [y/N] `)).trim().toLowerCase();return n==="y"||n==="yes"}finally{s.close();}}}:{}};function v(e){if(e.length===0)return [];let t=[];for(let s of e)s.forEach((n,a)=>{t[a]=Math.max(t[a]??0,n.length);});return e.map(s=>s.map((n,a)=>n.padEnd(t[a])).join(" ").trimEnd())}function E(e){return typeof e=="number"?`$${e.toFixed(2)}`:"-"}function re(e){return e.lane==="measured"?E(e.usd):e.lane==="floor"?`at least ${E(e.usd)}`:"-"}function Bs(e,t){if(!e.upload)return null;let s=e.upload.reported_totals;if(!s||s.cost_usd===null)return "-";let n=t?` (${s.n_trials_reporting}/${e.n_total_trials} trials reporting)`:"";return `reported ${E(s.cost_usd)}${n}`}function $t(e){if(e.input_tokens===null&&e.output_tokens===null)return null;let t=a=>a===null?"-":a.toLocaleString("en-US"),s=[e.cached_input_tokens!==null?`${t(e.cached_input_tokens)} cached`:null,e.cache_write_tokens!==null?`${t(e.cache_write_tokens)} written to cache`:null].filter(a=>a!==null),n=s.length>0?` (${s.join(", ")})`:"";return `in ${t(e.input_tokens)}${n} \xB7 out ${t(e.output_tokens)}`+(e.provisional?" \u2014 provisional":"")}function je(e){let t=`${e.name}:${e.model_name}`;return e.version?`${t}:${e.version}`:t}function pt(e){let t=[`${e.n_completed} completed`,`${e.n_failed} failed`,`${e.n_pending} pending`];return e.cost_usd!=null&&t.push(`spent $${e.cost_usd.toFixed(4)}`),t.join(" \xB7 ")}function Ee(e){return e.map(t=>`${t.name}@${t.version}`).join(", ")||"-"}function ee(e,t){return e.length>t?e.slice(0,t-1)+"\u2026":e}function H(e){return e.replace(/[\t\n\r]+/g," ")}function T(e,t,s,n,a,r){if(e.flags.quiet===true){for(let l of s)t.out(r(l));return}let i=xa(e,n,a);if(t.tty===true){let l=e.flags["no-trunc"]===true,c=[i.map(u=>u.header)];for(let u of s)c.push(i.map(d=>l?H(d.cell(u)):ee(H(d.cell(u)),60)));for(let u of v(c))t.out(u);}else {e.flags["no-headers"]!==true&&t.out(i.map(l=>l.header).join(" "));for(let l of s)t.out(i.map(c=>H(c.cell(l))).join(" "));}}function xa(e,t,s){let n=e.flags.columns;if(n===void 0)return s.map(r=>t.find(i=>i.key===r));if(n==="all")return t;let a=n.split(",").map(r=>r.trim()).filter(Boolean);if(a.length===0)throw new f("--columns got an empty column list");return a.map(r=>{let i=t.find(o=>o.key===r);if(!i)throw new f(`Unknown column "${r}" (available: ${t.map(o=>o.key).join(", ")}, or "all")`);return i})}function C(e,t,s){if(e.flags.columns!=="help")return false;for(let n of s)t.out(n.key);return true}function L(e,t={}){let s=[["id",e.id],["status",e.status],["datasets",Ee(e.datasets)]];s.push(["agents",e.agents.map(je).join(", ")]);for(let o of e.agents){o.skills.length>0&&s.push(["skills",`${je(o)}: ${o.skills.join(", ")}`]);for(let l of o.skill_locks??[])s.push(["skill lock",`${l.name} @ ${l.git_commit_id?l.git_commit_id.slice(0,12):W(l.digest)}`]);}s.push(["size",`${e.counts.agents} agent(s) x ${e.counts.tasks} task(s) = ${e.n_total_trials} trial(s)`]);let n=e.trials.byStatus.SCORED;s.push(["scored",`${n} of ${e.n_total_trials} trial(s)`]),e.upload&&e.n_total_trials>0&&n===0&&s.push(["warning","no uploaded trial carries verifier_result.rewards; see: evolve skills get evals core-concepts/upload"]);for(let o of e.build_exclusions)s.push(["build exclusions",o.note]);s.push(["attempts/task",String(e.n_attempts)]),s.push(["concurrency",String(e.n_concurrent_trials)]),s.push(["max spend/trial",E(e.max_trial_spend_usd)]),s.push(["worst case",E(e.worst_case_spend_usd)]),s.push(["retries",`${e.retry.max_retries}/trial on infrastructure errors`+((e.stats.n_retries??0)>0?` (${e.stats.n_retries} used)`:"")]),e.analyze&&s.push(["analyze",`${e.analyze.model_name} \xB7 ${e.analyze.rubric.criteria.length} criteri${e.analyze.rubric.criteria.length===1?"on":"a"}`+(e.analyze.sandbox_provider?` \xB7 ${e.analyze.sandbox_provider}`:"")]);{let l=[["agent",e.agent_timeout_multiplier],["verifier",e.verifier_timeout_multiplier],["agent setup",e.agent_setup_timeout_multiplier],["environment build",e.environment_build_timeout_multiplier]].filter(([,c])=>c!=null);(e.timeout_multiplier!==1||l.length>0)&&s.push(["timeouts",`x${e.timeout_multiplier}`+(l.length>0?` (${l.map(([c,u])=>`${c} x${u}`).join(", ")})`:"")]);}s.push(["provider",e.upload?"ported":e.sandbox_provider??"-"]),s.push(["visibility",e.visibility]),s.push(["spent",Bs(e,true)??re(V$1(e.stats.cost_usd,e.stats.n_unmeasured_trials))]),e.stats.gpu_cost_usd!=null&&s.push(["gpu compute (est.)",`$${e.stats.gpu_cost_usd.toFixed(4)}`]);let a=e.stats.n_unmeasured_judge_trials;if((e.stats.judge_cost_usd!=null&&e.stats.judge_cost_usd>0||typeof a=="number"&&a>0)&&s.push(["spent (judge)",re(V$1(e.stats.judge_cost_usd,a))]),e.upload?.reported_totals){let o=e.upload.reported_totals,l=[o.n_input_tokens!==null?`in ${o.n_input_tokens}`:null,o.n_cache_tokens!==null?`cache ${o.n_cache_tokens}`:null,o.n_output_tokens!==null?`out ${o.n_output_tokens}`:null].filter(c=>c!==null);l.length>0&&s.push(["reported tokens",l.join(" \xB7 ")]);}if(e.upload?.datasets&&e.upload.datasets.length>0&&s.push(["archive datasets",e.upload.datasets.map(o=>o.version?`${o.name}@${o.version}`:o.name).join(", ")]),(t.taskLinksRow??true)&&e.upload?.task_links&&e.upload.task_links.length>0){let o=e.upload.task_links,l=o.reduce((d,p)=>d+p.n_linked,0),c=o.reduce((d,p)=>d+p.n_trials,0),u=Array.from(new Set(o.flatMap(d=>d.datasets)));s.push(["task links",`${l} of ${c} ${c===1?"trial":"trials"} linked`+(u.length>0?` to ${u.join(", ")}`:"")+(l<c?` \u2014 ${c-l} without the task folder`:"")]);}if(e.stats.analysis){s.push(["analysis",pt(e.stats.analysis)]);for(let[o,l]of Object.entries(e.stats.analysis.checks))s.push([` ${o}`,`${l.n_pass} pass \xB7 ${l.n_fail} fail \xB7 ${l.n_not_applicable} n/a`+(typeof l.n_unknown=="number"?` \xB7 ${l.n_unknown} unknown`:"")]);}let i=Object.entries(e.trials.byStatus).filter(([,o])=>o>0).map(([o,l])=>`${o} ${l}`).join(" \xB7 ");i&&s.push(["trials",i]);for(let o of e.source_jobs)s.push([o.action==="regrade"?"regrade of":o.action==="retry"?"retry of":"resume of",o.job_id]);if(e.upload){let o=[e.upload.original_job_name,e.upload.original_job_id].filter(l=>l!==null).join(" \xB7 ");s.push(["uploaded",`${e.upload.uploaded_at}${o?` \u2014 originally ${o}`:""}`]);}return e.idempotent_replay&&s.push(["note","idempotent replay of an existing job"]),e.failure&&s.push(["failure",`${e.failure.code}: ${e.failure.message}`]),s.push(["started",e.started_at]),s.push(["updated",e.updated_at]),[...v(s),...Ia(e)]}function Ia(e){let t=I$1(e);if(t.length===0)return [];let s=t.map(n=>[` ${n.evals_key}`,n.points.map(a=>`pass@${a.k} ${a.value.toFixed(3)}`).join(" ")]);return ["","pass@k",...v(s)]}function Oa(e){return e.source.dataset??`archive ${e.source.sha256.slice(0,12)}`}var ds=[{key:"id",header:"ID",cell:e=>e.id},{key:"kind",header:"KIND",cell:e=>e.kind},{key:"name",header:"NAME",cell:e=>e.kind==="check"?e.name:e.job_name??"-"},{key:"status",header:"STATUS",cell:e=>e.status},{key:"datasets",header:"DATASETS",cell:e=>e.kind==="check"?Oa(e):Ee(e.datasets)},{key:"agents",header:"AGENTS",cell:e=>e.kind==="check"?`${e.model_name} (${e.reasoning_effort})`:e.agents.map(je).join(", ")},{key:"trials",header:"TRIALS",cell:e=>String(e.kind==="check"?e.tasks.total:e.trials.total)},{key:"spent",header:"SPENT",cell:e=>e.kind==="check"?E(e.cost_usd):Bs(e,false)??re(V$1(e.stats.cost_usd,e.stats.n_unmeasured_trials))},{key:"started",header:"STARTED",cell:e=>e.kind==="check"?e.created_at:e.started_at}],fs=["id","status","datasets","trials","spent","started"],ps=[{key:"task",header:"TASK",cell:e=>e.task_name},{key:"agent",header:"AGENT",cell:e=>je({name:e.agent_info.name,model_name:e.agent_info.model_info.name,version:e.agent_info.version,reasoning_effort:e.agent_info.reasoning_effort??null})},{key:"attempt",header:"ATTEMPT",cell:e=>String(e.attempt)},{key:"status",header:"STATUS",cell:e=>e.status},{key:"reward",header:"REWARD",cell:e=>e.reward!==null?String(e.reward):"-"},{key:"spent",header:"SPENT",cell:e=>re(W$1(e))},{key:"tokens",header:"TOKENS",cell:e=>e.usage&&$t(e.usage)||"-"},{key:"gpu",header:"GPU (EST)",cell:e=>e.gpu_cost?.estimate_usd!=null?`$${e.gpu_cost.estimate_usd.toFixed(4)}`:"-"},{key:"id",header:"TRIAL ID",cell:e=>e.id}],Pa=["task","agent","attempt","status","reward","spent","id"],gs=[{key:"task",header:"TASK",cell:e=>e.task_name},{key:"source",header:"DATASET",cell:e=>e.source},{key:"trials",header:"TRIALS",cell:e=>String(e.trials.total)},{key:"statuses",header:"STATUSES",cell:e=>Object.entries(e.trials.byStatus).filter(([,t])=>t>0).map(([t,s])=>`${t} ${s}`).join(" \xB7 ")||"-"},{key:"reward",header:"MEAN REWARD",cell:e=>mt(e.mean_reward)},{key:"spent",header:"SPENT",cell:e=>E(e.cost_usd)},{key:"check",header:"CHECK",cell:e=>Aa(e.check)},{key:"check-id",header:"TASK CHECK ID",cell:e=>e.check?.id??"-"}],ja=["task","source","trials","statuses","reward","spent","check"];function Ys(e){let t={pass:0,fail:0,not_applicable:0,unknown:0};for(let s of Object.values(e??{}))t[s.outcome]+=1;return t}function Te(e){return e===void 0?null:e===null?"custom rubric":e.replace(/_/g," ").toUpperCase()}function gt(e){let t=Te(e.label);return t===null||e.label===null?t:`${t}${e.executed===true?" \xB7 executed":e.executed===false?" \xB7 not executed":""}`}function Aa(e){if(e===null)return "-";if(e.status!=="completed")return e.status;let t=Ys(e.checks),s=`pass ${t.pass} \xB7 fail ${t.fail} \xB7 n/a ${t.not_applicable} \xB7 unknown ${t.unknown}`,n=gt(e);return n===null?s:`${n} \xB7 ${s}`}var ms=[{key:"name",header:"NAME",cell:e=>e.name},{key:"active",header:"ACTIVE",cell:e=>e.active_version?.version??"-"},{key:"state",header:"STATE",cell:e=>e.active_version?.state??"-"},{key:"tasks",header:"TASKS",cell:e=>e.active_version?String(e.active_version.task_count):"-"},{key:"title",header:"TITLE",cell:e=>e.title??"-"}],Ea=["name","active","state","tasks","title"];function W(e){return e.length>19?`${e.slice(0,19)}\u2026`:e}function B(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}var hs=[{key:"name",header:"NAME",cell:e=>e.name},{key:"id",header:"ID",cell:e=>e.id},{key:"org",header:"ORG",cell:e=>e.org??"-"},{key:"digest",header:"DIGEST",cell:e=>W(e.digest)},{key:"size",header:"SIZE",cell:e=>B(e.size_bytes)},{key:"created",header:"CREATED",cell:e=>e.created_at},{key:"description",header:"DESCRIPTION",cell:e=>e.description??"-"},{key:"ref",header:"REF",cell:e=>e.ref}],Ta=["name","id","digest","size","created"],ys=[{key:"name",header:"NAME",cell:e=>e.name},{key:"org",header:"ORG",cell:e=>e.org??"-"},{key:"source",header:"SOURCE",cell:e=>e.source},{key:"run",header:"RUN COMMAND",cell:e=>e.run_command},{key:"updated",header:"UPDATED",cell:e=>e.updated_at}],Ca=["name","source","run","updated"],ks=[{key:"name",header:"NAME",cell:e=>e.name},{key:"label",header:"LABEL",cell:e=>e.label??"default"},{key:"delivery",header:"DELIVERY",cell:e=>e.delivery??"brokered"},{key:"hosts",header:"ALLOWED HOSTS",cell:e=>e.allowedHosts.join(", ")||"-"},{key:"updated",header:"UPDATED",cell:e=>e.updatedAt},{key:"last-used",header:"LAST USED",cell:e=>e.lastUsedAt??"-"},{key:"id",header:"ID",cell:e=>e.id}],Na=["name","label","delivery","hosts","updated"];function Ra(e){let t=[["trial id",e.id],["job",e.job_id],["task",e.task_name],["dataset",e.source],["agent",`${e.agent_info.name}:${e.agent_info.model_info.name}`],["attempt",String(e.attempt)],["status",e.status],["reward",e.reward!==null?String(e.reward):"-"]],s=e.verifier_result?.rewards;if(s&&Object.keys(s).length>0&&t.push(["rewards",Object.entries(s).map(([n,a])=>`${n}=${a}`).join(" \xB7 ")]),t.push(["spent",re(T$1(e))]),e.judge_result&&t.push(["spent (judge)",re(U(e))]),(e.status==="RUNNING"||e.status==="SCORING")&&e.live_spent_usd!==null){let n=e.live_spend_at?` as of ${e.live_spend_at}`:"";t.push(["spent (live)",`at least $${e.live_spent_usd.toFixed(4)}${n}`]);}if(e.usage){let n=$t(e.usage);n&&t.push(["tokens",n]);}if(e.upload){let n=e.upload.reported_agent_result;n&&n.cost_usd!==null&&t.push(["reported cost",`$${n.cost_usd.toFixed(4)} (the original run's own record \u2014 not platform-metered)`]);let a=n?[n.n_input_tokens!==null?`in ${n.n_input_tokens}`:null,n.n_cache_tokens!==null?`cache ${n.n_cache_tokens}`:null,n.n_output_tokens!==null?`out ${n.n_output_tokens}`:null].filter(r=>r!==null):[];a.length>0&&t.push(["reported tokens",a.join(" \xB7 ")]),t.push(["uploaded from",`${e.upload.original_trial_name} \xB7 task ${e.upload.original_task_name}`+(e.upload.original_trial_id?` \xB7 ${e.upload.original_trial_id}`:"")]);}if(e.attempt_phase&&t.push(["phase",e.attempt_phase]),e.upload?t.push(["provider","ported"]):e.sandbox_provider&&t.push(["provider",e.sandbox_provider]),e.sandbox_provider_degrade){let n=e.sandbox_provider_degrade;t.push(["provider degrade",`${n.from} \u2192 ${n.to}: ${n.reason}`]);}if(e.gpu_cost){let n=e.gpu_cost;if(n.estimate_usd!=null){let a=n.gpu_type??"unknown type",r=n.duration_sec!=null?`${Math.round(n.duration_sec)}s`:"unmeasured",i=`rate card v${n.rate_card.version}${n.rate_card.source?`, ${n.rate_card.source} ${n.rate_card.source_date??""}`.trimEnd():""}`;t.push(["gpu compute (est.)",`$${n.estimate_usd.toFixed(4)} \u2014 ${a} x${n.gpu_count}, ${r} on ${n.provider} (${i})`]);}else t.push(["gpu compute (est.)",`not priced \u2014 ${n.unpriced_reason??"no reason recorded"}`]);}if(e.sandbox_id&&t.push(["sandbox",e.sandbox_id]),e.verifier_environment_mode&&t.push(["verifier",e.verifier_environment_mode]),e.verifier_sandbox_id&&t.push(["verifier sandbox",e.verifier_sandbox_id]),e.agent_info.version&&t.push(["agent version",e.agent_info.version]),e.exception_info&&(t.push(["failure type",e.exception_info.exception_type]),t.push(["failure detail",e.exception_info.exception_message])),e.n_retries>0){t.push(["auto-retries",String(e.n_retries)]);for(let n of e.retries)t.push([`attempt ${n.attempt_number}`,`${n.exception_info.exception_type} \xB7 spent ${E(n.cost_usd)}`+(n.settled_at?` \xB7 settled ${n.settled_at}`:"")]);}if(e.analysis){let n=e.analysis;t.push(["analysis",`${n.status} \xB7 ${n.model_name} \xB7 ${n.id}`]);let a=n.status==="completed"?Te(n.label):null;a!==null&&t.push([" label",a]);for(let[r,i]of Object.entries(n.checks??{}))t.push([` ${r}`,`${i.outcome} \u2014 ${i.explanation}`]);n.summary&&t.push([" summary",n.summary]),n.estimated_cost_usd!==null&&t.push([" analyzer spend",`$${n.estimated_cost_usd.toFixed(4)}`]),n.failure&&t.push([" failure",`${n.failure.phase}: ${n.failure.message}`]);}return e.session_ref&&t.push(["session",e.session_ref]),e.started_at&&t.push(["started",e.started_at]),e.finished_at&&t.push(["finished",e.finished_at]),v(t)}function La(e){let t=e.rubric.criteria.length,s=[["analysis id",e.id],["status",e.status],["model",e.model_name],["rubric",`${t} criteri${t===1?"on":"a"}`]],n=e.status==="completed"?Te(e.label):null;n!==null&&s.push(["label",n]);for(let[a,r]of Object.entries(e.checks??{})){s.push([` ${a}`,`${r.outcome} \u2014 ${r.explanation}`]);for(let i of r.evidence??[])s.push(["",`${i.where} \u2014 ${H(i.quote)}`]);}if(e.summary&&s.push(["summary",e.summary]),e.estimated_cost_usd!==null&&s.push(["spent",`$${e.estimated_cost_usd.toFixed(4)}`]),e.usage){let a=$t(e.usage);a&&s.push(["tokens",a]);}return e.failure&&s.push(["failure",`${e.failure.phase}: ${e.failure.message}`]),s.push(["created",e.created_at]),e.finished_at&&s.push(["finished",e.finished_at]),v(s)}function Xs(e){let t=[["name",e.name],["org",e.org??"-"],["source",e.source],["run command",e.run_command]],s=Object.keys(e.env??{});return s.length>0&&t.push(["env",s.sort().join(", ")]),t.push(["created",e.created_at]),t.push(["updated",e.updated_at]),v(t)}var Qs=["e2b","daytona","modal"];function Da(e){return Qs.filter(t=>e?.[t]!==void 0).map(t=>{let s=e[t];return s.ok?s.degrades_to?`${t} \u2192${s.degrades_to}`:`${t} ok`:`${t} NO`}).join(" \xB7 ")}function Ja(e){let t=e.gpus??0;if(t<=0)return null;let s=e.gpu_types&&e.gpu_types.length>0?e.gpu_types.join("|"):"any GPU";return `${t}x ${s}`}function mt(e){return e!==null?String(Math.round(e*1e3)/1e3):"-"}function Zs(e){let t=M(e);if(t!==null){let a=typeof e.data.model=="string"&&e.data.model!==""?e.data.model:"-",r=t.usage,i=`gateway ${a} in=${r.promptTokens} out=${r.completionTokens} cached=${r.cachedTokens} $${r.costUsd.toFixed(6)}${t.startedAt?` ${t.startedAt}`:""}`;return `#${String(e.seq).padStart(4)} ${e.type.padEnd(26)} ${i}`.trimEnd()}let s=e.data?.update;if(s&&typeof s=="object"&&s.sessionUpdate==="usage")return null;let n=ee(JSON.stringify(e.data??{}),140);return `#${String(e.seq).padStart(4)} ${e.type.padEnd(26)} ${n}`.trimEnd()}function D(e,t,s){if(t){e.out(JSON.stringify(s));return}let n=Zs(s);n!==null&&e.out(n);}function en(e){let t=e.failures?.length?` (${e.failures.length} task failure${e.failures.length===1?"":"s"})`:"";return `${e.message}${t}`}function tn(e){let t=[["id",e.id],["status",It(e)]];e.name!==void 0&&t.push(["dataset",e.name]),e.version!==void 0&&t.push(["version",e.version]),e.task_count!==void 0&&t.push(["tasks",String(e.task_count)]);for(let s of e.warnings)t.push(["warning",s.message??s.code]);if(e.failure){t.push(["failure",en(e.failure)]);for(let s of e.failure.failures??[])t.push([` ${s.task_name}`,s.error]);}return v(t)}function xt(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return `${t}s`;let s=Math.floor(t/60),n=t%60;return s<60?`${s}m${String(n).padStart(2,"0")}s`:`${Math.floor(s/60)}h${String(s%60).padStart(2,"0")}m`}function Ua(e,t=Date.now()){let s=e.phases[e.phases.length-1],n=[];s!==void 0&&s.total>0&&(n.push(`${s.done}/${s.total}`),s.banked!==void 0&&s.banked>0&&n.push(s.name==="copying"?`${s.banked} of ${s.total} images already banked`:`${s.banked} banked`));let a=s!==void 0?Date.parse(s.started_at):NaN;return Number.isFinite(a)&&n.push(xt(t-a)),`phase ${e.phase}${n.length>0?` ${n.join(" \xB7 ")}`:""}`}function Fa(e){let t=e.phases.map(a=>{let r=a.completed_at!==void 0?Date.parse(a.completed_at):NaN,i=Date.parse(a.started_at),o=Number.isFinite(r)&&Number.isFinite(i)?xt(r-i):"unfinished";return `${a.name} ${o}`}),s=e.images,n=e.codebuild;return v([["phases",t.join(" \xB7 ")],["images",`${s.built} built, ${s.mirrored} mirrored, ${s.banked} banked`],["codebuild",`${n.copy_builds} copy build(s), ${n.billed_minutes} billed minute(s)`]])}function It(e){return e.receiving===true?`${e.status} (receiving)`:e.status}function Ma(e){let t=[];return e.task_count!==void 0&&t.push(`tasks=${e.task_count}`),e.failure&&t.push(ee(en(e.failure),140)),`status ${It(e).padEnd(12)} ${t.join(" ")}`.trimEnd()}function za(e){return `state ${e.state}`}function qa(e,t){let s=[["state",e.state]];if(t){let n=t.active_version?.version??null;s.push(["active",n===e.version?`${n} (this publish)`:n?`${n} (unchanged)`:"none"]);}return v(s)}function Ka(e){let t={...e.data??{}},s=[];typeof t.trial_id=="string"&&s.push(t.trial_id),typeof t.task_name=="string"&&s.push(t.task_name),typeof t.status=="string"&&s.push(t.status),typeof t.reward=="number"&&s.push(`reward=${t.reward}`);let n=new Set(["trial_id","task_name","status","reward"]);for(let[r,i]of Object.entries(t))n.has(r)||s.push(`${r}=${typeof i=="object"?JSON.stringify(i):String(i)}`);let a=ee(s.join(" "),140);return `#${String(e.seq).padStart(4)} ${e.type.padEnd(26)} ${a}`.trimEnd()}function g(e){let t={};return typeof e.flags["api-key"]=="string"&&(t.apiKey=e.flags["api-key"]),typeof e.flags["base-url"]=="string"&&(t.baseUrl=e.flags["base-url"]),t}var sn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Ga=/^[0-9a-f][0-9a-f-]{7,34}$/i,bs=8,ie=200,Va={job:"jobs",trial:"trials",analysis:"analyses","analyzed trial":"analyzed trials",check:"checks","task check":"task checks",session:"sessions",skill:"skills"},ws=new WeakMap;function Ce(e,t,s){let n=ws.get(e);n===void 0&&(n=new Map,ws.set(e,n));let a=n.get(t);if(a!==void 0)return a;let r=s();return n.set(t,r),r}async function Ne(e){let t=[];for await(let s of e)t.push(s);return t}function Ot(e){let t=te(e);return t!==void 0?{scope:t}:{}}var nn=e=>Ce(e,"jobs",()=>Ne(pa$1(g(e)).list({limit:ie,...Ot(e)}))),vs=e=>Ce(e,"analyses",()=>Ne(ra$1(g(e)).list({limit:ie,...Ot(e)}))),_s=e=>Ce(e,"checks",()=>Ne(sa$1(g(e)).list({limit:ie,...Ot(e)})));async function Ha(e){let t=pa$1(g(e)),s=(await nn(e)).map(r=>r.id),n=[],a=0;for(let r of s){try{for await(let i of t.trials(r,{limit:ie}))n.push(i.id);}catch(i){throw i instanceof ha$1&&i.code==="rate_limited"?new f(`trial id prefixes resolve against every trial of your ${s.length} jobs (one read per job); the API's rate limit refused the walk after ${a} \u2014 pass the full trial id (evolve job trials <job> prints them)`):i}a+=1;}return n}async function Wa(e){let t=Oa$1(De(e)),s=[],n;do{let a=await t.list({limit:ie,state:"all",...n!==void 0?{cursor:n}:{}});for(let r of a.items)s.push(r.id);n=a.nextCursor??void 0;}while(n!==void 0);return s}var Ba={job:async e=>(await nn(e)).map(t=>t.id),trial:Ha,analysis:async e=>(await vs(e)).map(t=>t.id),"analyzed trial":async e=>(await vs(e)).map(t=>t.trial_id),check:async e=>(await _s(e)).map(t=>t.id),"task check":async e=>(await _s(e)).flatMap(t=>t.results.map(s=>s.id)),session:Wa,skill:async e=>(await Ne(oa$1(g(e)).list({limit:ie}))).map(t=>t.id)},Ya=(e,t)=>Ce(e,`ids:${t}`,()=>Ba[t](e));function Xa(e){return `${/^[aeiou]/.test(e[0])?"an":"a"} ${e.join(" or ")}`}async function Pt(e,t,s){if(s===void 0||sn.test(s))return {noun:null,id:s};if(/^[0-9a-f][0-9a-f-]*$/i.test(s)&&s.length<bs)throw new f(`"${s}" is too short to name ${Xa(t)} \u2014 id prefixes need at least ${bs} characters`);if(!Ga.test(s))return {noun:null,id:s};let n=s.toLowerCase(),a=[];for(let o of t){let l=new Set((await Ya(e,o)).filter(c=>c.startsWith(n)));for(let c of l)a.push({noun:o,id:c});}if(a.length===1)return a[0];if(a.length===0)throw new f(`no ${t.join(" or ")} id starts with "${s}"`);let r=t.map(o=>({noun:o,n:a.filter(l=>l.noun===o).length})).filter(({n:o})=>o>0).map(({noun:o,n:l})=>`${l} ${l===1?o:Va[o]}`),i=a.slice(0,5).map(o=>t.length>1?`${o.noun} ${o.id}`:o.id);throw new f(`"${s}" is ambiguous \u2014 it matches ${r.join(" and ")}: ${i.join(", ")}${a.length>5?", \u2026":""}`)}async function y(e,t,s){return (await Pt(e,[t],s)).id}async function jt(e,t,s){let n=await Pt(e,["analysis","analyzed trial"],s);if(n.noun==="analysis")return {id:n.id,analysis:null};if(n.noun==="analyzed trial")return Ss(e,await qa$1(g(e)).get(n.id));if(s===void 0||!sn.test(s))return {id:s,analysis:null};try{return {id:s,analysis:await t.get(s)}}catch(a){if(!(a instanceof ha$1)||a.status!==400)throw a;let r;try{r=await qa$1(g(e)).get(s);}catch(i){throw i instanceof ha$1&&i.status===404?a:i}return Ss(e,r)}}async function Ss(e,t){if(t.analysis)return {id:t.analysis.id,analysis:t.analysis};throw (await pa$1(g(e)).get(t.job_id)).is_regrade?new Error(`${t.id} is a regrade result \u2014 a regrade is never analyzed; analyses belong to its source trial`):new Error(`trial ${t.id} has no analysis yet \u2014 run: evolve analyze ${t.job_id}`)}function ht(e,t){return t.analysis!==null?Promise.resolve(t.analysis):e.get(t.id)}function x(e){return {...e.flags.limit!==void 0?{limit:e.flags.limit}:{},...e.flags.cursor!==void 0?{cursor:String(e.flags.cursor)}:{}}}function te(e){if(e.flags.scope===void 0)return;let t=String(e.flags.scope);if(!E$1.includes(t))throw new f(`--scope must be one of: ${E$1.join(", ")}; got: ${t}`+(t==="all"?" (Harbor's all adds public rows \u2014 nothing hosted is public)":""));return t}function Qa(e){if(e.flags.kind===void 0)return;let t=String(e.flags.kind);if(!F.includes(t))throw new f(`--kind must be one of: ${F.join(", ")}; got: ${t}`);return t}function Za(e){if(e.flags.status===void 0)return;let t=String(e.flags.status).split(",").map(n=>n.trim()).filter(Boolean);if(t.length===0)throw new f("--status got an empty status list");let s=t.filter(n=>!G$1.includes(n));if(s.length>0)throw new f(`--status must name analysis statuses (${G$1.join(", ")}); got: ${s.join(", ")}`);return t}function an(e){if(e.flags.status===void 0)return;let t=String(e.flags.status).split(",").map(n=>n.trim()).filter(Boolean);if(t.length===0)throw new f("--status got an empty status list");let s=t.filter(n=>!C$1.includes(n));if(s.length>0)throw new f(`--status must name trial statuses (${C$1.join(", ")}); got: ${s.join(", ")}`);return t}function er(e){return e.status==="COMPLETED"?0:e.status==="FAILED"||e.status==="CANCELLED"?1:0}function tr(e){return e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||e.startsWith("~")}async function sr(e,t,s){let n=new Set;for(let i of e.agents)for(let o of i.skills??[])tr(o)&&n.add(o);if(n.size===0)return e;let a=oa$1(g(t)),r=new Map;for(let i of n){let o=await a.upload(i);if(r.set(i,o.map(l=>l.ref)),t.flags.json!==true)for(let l of o)s.err(`Uploaded skill ${l.name} (${l.ref}, ${W(l.digest)})`);}return {...e,agents:e.agents.map(i=>({...i,...i.skills!==void 0&&i.skills!==null?{skills:i.skills.flatMap(o=>r.get(o)??[o])}:{}}))}}async function $s(e,t){let s=Je(va(e),e);if(e.flags["print-config"]===true)return t.out(JSON.stringify(s,null,2)),0;let n=e.flags.json===true,a=e.flags.watch===true,r=e.flags.quiet===true,i=pa$1(g(e)),o=await i.start(await sr(s,e,t));if(n||t.out(`org ${s.org??"personal"}`),!a){if(n)t.out(JSON.stringify(o));else {for(let c of L(o))t.out(c);t.out(""),t.out(`Follow it with: evolve job show ${o.id}`);}return 0}n?t.out(JSON.stringify({kind:"job.created",job:o})):t.out(`Job ${o.id} (${Ee(o.datasets)}) ${o.status} \u2014 watching\u2026`);let l=await i.watch(o.id,{onEvent:c=>{r||t.out(n?JSON.stringify({kind:"event",...c}):Ka(c));}});if(n)t.out(JSON.stringify({kind:"job.final",job:l}));else {t.out("");for(let c of L(l))t.out(c);}return er(l)}async function nr(e,t){if(C(e,t,ds))return 0;let s=te(e),n=Qa(e),r=await pa$1(g(e)).list({...x(e),...e.flags.search!==void 0?{search:String(e.flags.search)}:{},...s!==void 0?{scope:s}:{},...n!==void 0?{kind:n}:{}});if(e.flags.json===true)return t.out(JSON.stringify(r)),0;if(r.items.length===0)return e.flags.quiet!==true&&t.out(n==="check"?"No checks.":"No jobs."),0;let i=n===void 0||n==="job"?fs:["kind",...fs];return T(e,t,r.items,ds,i,o=>o.id),r.nextCursor&&t.tty===true&&e.flags.quiet!==true&&t.out(`
|
|
32
|
+
`),tty:process.stdout.isTTY===true&&process.env.TERM!=="dumb",...process.stdin.isTTY===true?{confirm:async e=>{let{createInterface:t}=await import('readline/promises'),s=t({input:process.stdin,output:process.stderr});try{let n=(await s.question(`${e} [y/N] `)).trim().toLowerCase();return n==="y"||n==="yes"}finally{s.close();}}}:{}};function v(e){if(e.length===0)return [];let t=[];for(let s of e)s.forEach((n,a)=>{t[a]=Math.max(t[a]??0,n.length);});return e.map(s=>s.map((n,a)=>n.padEnd(t[a])).join(" ").trimEnd())}function E(e){return typeof e=="number"?`$${e.toFixed(2)}`:"-"}function re(e){return e.lane==="measured"?E(e.usd):e.lane==="floor"?`at least ${E(e.usd)}`:"-"}function Bs(e,t){if(!e.upload)return null;let s=e.upload.reported_totals;if(!s||s.cost_usd===null)return "-";let n=t?` (${s.n_trials_reporting}/${e.n_total_trials} trials reporting)`:"";return `reported ${E(s.cost_usd)}${n}`}function St(e){if(e.input_tokens===null&&e.output_tokens===null)return null;let t=a=>a===null?"-":a.toLocaleString("en-US"),s=[e.cached_input_tokens!==null?`${t(e.cached_input_tokens)} cached`:null,e.cache_write_tokens!==null?`${t(e.cache_write_tokens)} written to cache`:null].filter(a=>a!==null),n=s.length>0?` (${s.join(", ")})`:"";return `in ${t(e.input_tokens)}${n} \xB7 out ${t(e.output_tokens)}`+(e.provisional?" \u2014 provisional":"")}function Ae(e){let t=`${e.name}:${e.model_name}`;return e.version?`${t}:${e.version}`:t}function $t(e){return e.agent?`${e.agent}:${e.model_name}`:e.model_name}function pt(e){let t=[`${e.n_completed} completed`,`${e.n_failed} failed`,`${e.n_pending} pending`];return e.cost_usd!=null&&t.push(`spent $${e.cost_usd.toFixed(4)}`),t.join(" \xB7 ")}function Te(e){return e.map(t=>`${t.name}@${t.version}`).join(", ")||"-"}function ee(e,t){return e.length>t?e.slice(0,t-1)+"\u2026":e}function H(e){return e.replace(/[\t\n\r]+/g," ")}function T(e,t,s,n,a,r){if(e.flags.quiet===true){for(let l of s)t.out(r(l));return}let i=xa(e,n,a);if(t.tty===true){let l=e.flags["no-trunc"]===true,c=[i.map(u=>u.header)];for(let u of s)c.push(i.map(d=>l?H(d.cell(u)):ee(H(d.cell(u)),60)));for(let u of v(c))t.out(u);}else {e.flags["no-headers"]!==true&&t.out(i.map(l=>l.header).join(" "));for(let l of s)t.out(i.map(c=>H(c.cell(l))).join(" "));}}function xa(e,t,s){let n=e.flags.columns;if(n===void 0)return s.map(r=>t.find(i=>i.key===r));if(n==="all")return t;let a=n.split(",").map(r=>r.trim()).filter(Boolean);if(a.length===0)throw new f("--columns got an empty column list");return a.map(r=>{let i=t.find(o=>o.key===r);if(!i)throw new f(`Unknown column "${r}" (available: ${t.map(o=>o.key).join(", ")}, or "all")`);return i})}function C(e,t,s){if(e.flags.columns!=="help")return false;for(let n of s)t.out(n.key);return true}function L(e,t={}){let s=[["id",e.id],["status",e.status],["datasets",Te(e.datasets)]];s.push(["agents",e.agents.map(Ae).join(", ")]);for(let o of e.agents){o.skills.length>0&&s.push(["skills",`${Ae(o)}: ${o.skills.join(", ")}`]);for(let l of o.skill_locks??[])s.push(["skill lock",`${l.name} @ ${l.git_commit_id?l.git_commit_id.slice(0,12):W(l.digest)}`]);}s.push(["size",`${e.counts.agents} agent(s) x ${e.counts.tasks} task(s) = ${e.n_total_trials} trial(s)`]);let n=e.trials.byStatus.SCORED;s.push(["scored",`${n} of ${e.n_total_trials} trial(s)`]),e.upload&&e.n_total_trials>0&&n===0&&s.push(["warning","no uploaded trial carries verifier_result.rewards; see: evolve skills get evals core-concepts/upload"]);for(let o of e.build_exclusions)s.push(["build exclusions",o.note]);s.push(["attempts/task",String(e.n_attempts)]),s.push(["concurrency",String(e.n_concurrent_trials)]),s.push(["max spend/trial",E(e.max_trial_spend_usd)]),s.push(["worst case",E(e.worst_case_spend_usd)]),s.push(["retries",`${e.retry.max_retries}/trial on infrastructure errors`+((e.stats.n_retries??0)>0?` (${e.stats.n_retries} used)`:"")]),e.analyze&&s.push(["analyze",`${$t(e.analyze)} \xB7 ${e.analyze.rubric.criteria.length} criteri${e.analyze.rubric.criteria.length===1?"on":"a"}`+(e.analyze.sandbox_provider?` \xB7 ${e.analyze.sandbox_provider}`:"")]);{let l=[["agent",e.agent_timeout_multiplier],["verifier",e.verifier_timeout_multiplier],["agent setup",e.agent_setup_timeout_multiplier],["environment build",e.environment_build_timeout_multiplier]].filter(([,c])=>c!=null);(e.timeout_multiplier!==1||l.length>0)&&s.push(["timeouts",`x${e.timeout_multiplier}`+(l.length>0?` (${l.map(([c,u])=>`${c} x${u}`).join(", ")})`:"")]);}s.push(["provider",e.upload?"ported":e.sandbox_provider??"-"]),s.push(["visibility",e.visibility]),s.push(["spent",Bs(e,true)??re(V$1(e.stats.cost_usd,e.stats.n_unmeasured_trials))]),e.stats.gpu_cost_usd!=null&&s.push(["gpu compute (est.)",`$${e.stats.gpu_cost_usd.toFixed(4)}`]);let a=e.stats.n_unmeasured_judge_trials;if((e.stats.judge_cost_usd!=null&&e.stats.judge_cost_usd>0||typeof a=="number"&&a>0)&&s.push(["spent (judge)",re(V$1(e.stats.judge_cost_usd,a))]),e.upload?.reported_totals){let o=e.upload.reported_totals,l=[o.n_input_tokens!==null?`in ${o.n_input_tokens}`:null,o.n_cache_tokens!==null?`cache ${o.n_cache_tokens}`:null,o.n_output_tokens!==null?`out ${o.n_output_tokens}`:null].filter(c=>c!==null);l.length>0&&s.push(["reported tokens",l.join(" \xB7 ")]);}if(e.upload?.datasets&&e.upload.datasets.length>0&&s.push(["archive datasets",e.upload.datasets.map(o=>o.version?`${o.name}@${o.version}`:o.name).join(", ")]),(t.taskLinksRow??true)&&e.upload?.task_links&&e.upload.task_links.length>0){let o=e.upload.task_links,l=o.reduce((d,p)=>d+p.n_linked,0),c=o.reduce((d,p)=>d+p.n_trials,0),u=Array.from(new Set(o.flatMap(d=>d.datasets)));s.push(["task links",`${l} of ${c} ${c===1?"trial":"trials"} linked`+(u.length>0?` to ${u.join(", ")}`:"")+(l<c?` \u2014 ${c-l} without the task folder`:"")]);}if(e.stats.analysis){s.push(["analysis",pt(e.stats.analysis)]);for(let[o,l]of Object.entries(e.stats.analysis.checks))s.push([` ${o}`,`${l.n_pass} pass \xB7 ${l.n_fail} fail \xB7 ${l.n_not_applicable} n/a`+(typeof l.n_unknown=="number"?` \xB7 ${l.n_unknown} unknown`:"")]);}let i=Object.entries(e.trials.byStatus).filter(([,o])=>o>0).map(([o,l])=>`${o} ${l}`).join(" \xB7 ");i&&s.push(["trials",i]);for(let o of e.source_jobs)s.push([o.action==="regrade"?"regrade of":o.action==="retry"?"retry of":"resume of",o.job_id]);if(e.upload){let o=[e.upload.original_job_name,e.upload.original_job_id].filter(l=>l!==null).join(" \xB7 ");s.push(["uploaded",`${e.upload.uploaded_at}${o?` \u2014 originally ${o}`:""}`]);}return e.idempotent_replay&&s.push(["note","idempotent replay of an existing job"]),e.failure&&s.push(["failure",`${e.failure.code}: ${e.failure.message}`]),s.push(["started",e.started_at]),s.push(["updated",e.updated_at]),[...v(s),...Ia(e)]}function Ia(e){let t=I$1(e);if(t.length===0)return [];let s=t.map(n=>[` ${n.evals_key}`,n.points.map(a=>`pass@${a.k} ${a.value.toFixed(3)}`).join(" ")]);return ["","pass@k",...v(s)]}function Oa(e){return e.source.dataset??`archive ${e.source.sha256.slice(0,12)}`}var ds=[{key:"id",header:"ID",cell:e=>e.id},{key:"kind",header:"KIND",cell:e=>e.kind},{key:"name",header:"NAME",cell:e=>e.kind==="check"?e.name:e.job_name??"-"},{key:"status",header:"STATUS",cell:e=>e.status},{key:"datasets",header:"DATASETS",cell:e=>e.kind==="check"?Oa(e):Te(e.datasets)},{key:"agents",header:"AGENTS",cell:e=>e.kind==="check"?$t(e)+(e.reasoning_effort?` (${e.reasoning_effort})`:""):e.agents.map(Ae).join(", ")},{key:"trials",header:"TRIALS",cell:e=>String(e.kind==="check"?e.tasks.total:e.trials.total)},{key:"spent",header:"SPENT",cell:e=>e.kind==="check"?E(e.cost_usd):Bs(e,false)??re(V$1(e.stats.cost_usd,e.stats.n_unmeasured_trials))},{key:"started",header:"STARTED",cell:e=>e.kind==="check"?e.created_at:e.started_at}],fs=["id","status","datasets","trials","spent","started"],ps=[{key:"task",header:"TASK",cell:e=>e.task_name},{key:"agent",header:"AGENT",cell:e=>Ae({name:e.agent_info.name,model_name:e.agent_info.model_info.name,version:e.agent_info.version,reasoning_effort:e.agent_info.reasoning_effort??null})},{key:"attempt",header:"ATTEMPT",cell:e=>String(e.attempt)},{key:"status",header:"STATUS",cell:e=>e.status},{key:"reward",header:"REWARD",cell:e=>e.reward!==null?String(e.reward):"-"},{key:"spent",header:"SPENT",cell:e=>re(W$1(e))},{key:"tokens",header:"TOKENS",cell:e=>e.usage&&St(e.usage)||"-"},{key:"gpu",header:"GPU (EST)",cell:e=>e.gpu_cost?.estimate_usd!=null?`$${e.gpu_cost.estimate_usd.toFixed(4)}`:"-"},{key:"id",header:"TRIAL ID",cell:e=>e.id}],Pa=["task","agent","attempt","status","reward","spent","id"],gs=[{key:"task",header:"TASK",cell:e=>e.task_name},{key:"source",header:"DATASET",cell:e=>e.source},{key:"trials",header:"TRIALS",cell:e=>String(e.trials.total)},{key:"statuses",header:"STATUSES",cell:e=>Object.entries(e.trials.byStatus).filter(([,t])=>t>0).map(([t,s])=>`${t} ${s}`).join(" \xB7 ")||"-"},{key:"reward",header:"MEAN REWARD",cell:e=>gt(e.mean_reward)},{key:"spent",header:"SPENT",cell:e=>E(e.cost_usd)},{key:"check",header:"CHECK",cell:e=>Aa(e.check)},{key:"check-id",header:"TASK CHECK ID",cell:e=>e.check?.id??"-"}],ja=["task","source","trials","statuses","reward","spent","check"];function Ys(e){let t={pass:0,fail:0,not_applicable:0,unknown:0};for(let s of Object.values(e??{}))t[s.outcome]+=1;return t}function ye(e){let t=Ys(e);return `pass ${t.pass} \xB7 fail ${t.fail} \xB7 unknown ${t.unknown} \xB7 n/a ${t.not_applicable}`}function Aa(e){return e===null?"-":e.status!=="completed"?e.status:ye(e.checks)}var ms=[{key:"name",header:"NAME",cell:e=>e.name},{key:"active",header:"ACTIVE",cell:e=>e.active_version?.version??"-"},{key:"state",header:"STATE",cell:e=>e.active_version?.state??"-"},{key:"tasks",header:"TASKS",cell:e=>e.active_version?String(e.active_version.task_count):"-"},{key:"title",header:"TITLE",cell:e=>e.title??"-"}],Ea=["name","active","state","tasks","title"];function W(e){return e.length>19?`${e.slice(0,19)}\u2026`:e}function B(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}var hs=[{key:"name",header:"NAME",cell:e=>e.name},{key:"id",header:"ID",cell:e=>e.id},{key:"org",header:"ORG",cell:e=>e.org??"-"},{key:"digest",header:"DIGEST",cell:e=>W(e.digest)},{key:"size",header:"SIZE",cell:e=>B(e.size_bytes)},{key:"created",header:"CREATED",cell:e=>e.created_at},{key:"description",header:"DESCRIPTION",cell:e=>e.description??"-"},{key:"ref",header:"REF",cell:e=>e.ref}],Ta=["name","id","digest","size","created"],ys=[{key:"name",header:"NAME",cell:e=>e.name},{key:"org",header:"ORG",cell:e=>e.org??"-"},{key:"source",header:"SOURCE",cell:e=>e.source},{key:"run",header:"RUN COMMAND",cell:e=>e.run_command},{key:"updated",header:"UPDATED",cell:e=>e.updated_at}],Ca=["name","source","run","updated"],ks=[{key:"name",header:"NAME",cell:e=>e.name},{key:"label",header:"LABEL",cell:e=>e.label??"default"},{key:"delivery",header:"DELIVERY",cell:e=>e.delivery??"brokered"},{key:"hosts",header:"ALLOWED HOSTS",cell:e=>e.allowedHosts.join(", ")||"-"},{key:"updated",header:"UPDATED",cell:e=>e.updatedAt},{key:"last-used",header:"LAST USED",cell:e=>e.lastUsedAt??"-"},{key:"id",header:"ID",cell:e=>e.id}],Na=["name","label","delivery","hosts","updated"];function Ra(e){let t=[["trial id",e.id],["job",e.job_id],["task",e.task_name],["dataset",e.source],["agent",`${e.agent_info.name}:${e.agent_info.model_info.name}`],["attempt",String(e.attempt)],["status",e.status],["reward",e.reward!==null?String(e.reward):"-"]],s=e.verifier_result?.rewards;if(s&&Object.keys(s).length>0&&t.push(["rewards",Object.entries(s).map(([n,a])=>`${n}=${a}`).join(" \xB7 ")]),t.push(["spent",re(T$1(e))]),e.judge_result&&t.push(["spent (judge)",re(U(e))]),(e.status==="RUNNING"||e.status==="SCORING")&&e.live_spent_usd!==null){let n=e.live_spend_at?` as of ${e.live_spend_at}`:"";t.push(["spent (live)",`at least $${e.live_spent_usd.toFixed(4)}${n}`]);}if(e.usage){let n=St(e.usage);n&&t.push(["tokens",n]);}if(e.upload){let n=e.upload.reported_agent_result;n&&n.cost_usd!==null&&t.push(["reported cost",`$${n.cost_usd.toFixed(4)} (the original run's own record \u2014 not platform-metered)`]);let a=n?[n.n_input_tokens!==null?`in ${n.n_input_tokens}`:null,n.n_cache_tokens!==null?`cache ${n.n_cache_tokens}`:null,n.n_output_tokens!==null?`out ${n.n_output_tokens}`:null].filter(r=>r!==null):[];a.length>0&&t.push(["reported tokens",a.join(" \xB7 ")]),t.push(["uploaded from",`${e.upload.original_trial_name} \xB7 task ${e.upload.original_task_name}`+(e.upload.original_trial_id?` \xB7 ${e.upload.original_trial_id}`:"")]);}if(e.attempt_phase&&t.push(["phase",e.attempt_phase]),e.upload?t.push(["provider","ported"]):e.sandbox_provider&&t.push(["provider",e.sandbox_provider]),e.sandbox_provider_degrade){let n=e.sandbox_provider_degrade;t.push(["provider degrade",`${n.from} \u2192 ${n.to}: ${n.reason}`]);}if(e.gpu_cost){let n=e.gpu_cost;if(n.estimate_usd!=null){let a=n.gpu_type??"unknown type",r=n.duration_sec!=null?`${Math.round(n.duration_sec)}s`:"unmeasured",i=`rate card v${n.rate_card.version}${n.rate_card.source?`, ${n.rate_card.source} ${n.rate_card.source_date??""}`.trimEnd():""}`;t.push(["gpu compute (est.)",`$${n.estimate_usd.toFixed(4)} \u2014 ${a} x${n.gpu_count}, ${r} on ${n.provider} (${i})`]);}else t.push(["gpu compute (est.)",`not priced \u2014 ${n.unpriced_reason??"no reason recorded"}`]);}if(e.sandbox_id&&t.push(["sandbox",e.sandbox_id]),e.verifier_environment_mode&&t.push(["verifier",e.verifier_environment_mode]),e.verifier_sandbox_id&&t.push(["verifier sandbox",e.verifier_sandbox_id]),e.agent_info.version&&t.push(["agent version",e.agent_info.version]),e.exception_info&&(t.push(["failure type",e.exception_info.exception_type]),t.push(["failure detail",e.exception_info.exception_message])),e.n_retries>0){t.push(["auto-retries",String(e.n_retries)]);for(let n of e.retries)t.push([`attempt ${n.attempt_number}`,`${n.exception_info.exception_type} \xB7 spent ${E(n.cost_usd)}`+(n.settled_at?` \xB7 settled ${n.settled_at}`:"")]);}if(e.analysis){let n=e.analysis;t.push(["analysis",`${n.status} \xB7 ${$t(n)} \xB7 ${n.id}`]),n.status==="completed"&&t.push([" outcomes",ye(n.checks)]);for(let[a,r]of Object.entries(n.checks??{}))t.push([` ${a}`,`${r.outcome} \u2014 ${r.explanation}`]);n.summary&&t.push([" summary",n.summary]),n.estimated_cost_usd!==null&&t.push([" analyzer spend",`$${n.estimated_cost_usd.toFixed(4)}`]),n.failure&&t.push([" failure",`${n.failure.phase}: ${n.failure.message}`]);}return e.session_ref&&t.push(["session",e.session_ref]),e.started_at&&t.push(["started",e.started_at]),e.finished_at&&t.push(["finished",e.finished_at]),v(t)}function La(e){let t=e.rubric.criteria.length,s=[["analysis id",e.id],["status",e.status],...e.agent?[["agent",e.agent]]:[],["model",e.model_name],["rubric",`${t} criteri${t===1?"on":"a"}`]];e.status==="completed"&&s.push(["outcomes",ye(e.checks)]);for(let[n,a]of Object.entries(e.checks??{})){s.push([` ${n}`,`${a.outcome} \u2014 ${a.explanation}`]);for(let r of a.evidence??[])s.push(["",`${r.where} \u2014 ${H(r.quote)}`]);}if(e.summary&&s.push(["summary",e.summary]),e.estimated_cost_usd!==null&&s.push(["spent",`$${e.estimated_cost_usd.toFixed(4)}`]),e.usage){let n=St(e.usage);n&&s.push(["tokens",n]);}return e.failure&&s.push(["failure",`${e.failure.phase}: ${e.failure.message}`]),s.push(["created",e.created_at]),e.finished_at&&s.push(["finished",e.finished_at]),v(s)}function Xs(e){let t=[["name",e.name],["org",e.org??"-"],["source",e.source],["run command",e.run_command]],s=Object.keys(e.env??{});return s.length>0&&t.push(["env",s.sort().join(", ")]),t.push(["created",e.created_at]),t.push(["updated",e.updated_at]),v(t)}var Qs=["e2b","daytona","modal"];function Da(e){return Qs.filter(t=>e?.[t]!==void 0).map(t=>{let s=e[t];return s.ok?s.degrades_to?`${t} \u2192${s.degrades_to}`:`${t} ok`:`${t} NO`}).join(" \xB7 ")}function Ja(e){let t=e.gpus??0;if(t<=0)return null;let s=e.gpu_types&&e.gpu_types.length>0?e.gpu_types.join("|"):"any GPU";return `${t}x ${s}`}function gt(e){return e!==null?String(Math.round(e*1e3)/1e3):"-"}function Zs(e){let t=M(e);if(t!==null){let a=typeof e.data.model=="string"&&e.data.model!==""?e.data.model:"-",r=t.usage,i=`gateway ${a} in=${r.promptTokens} out=${r.completionTokens} cached=${r.cachedTokens} $${r.costUsd.toFixed(6)}${t.startedAt?` ${t.startedAt}`:""}`;return `#${String(e.seq).padStart(4)} ${e.type.padEnd(26)} ${i}`.trimEnd()}let s=e.data?.update;if(s&&typeof s=="object"&&s.sessionUpdate==="usage")return null;let n=ee(JSON.stringify(e.data??{}),140);return `#${String(e.seq).padStart(4)} ${e.type.padEnd(26)} ${n}`.trimEnd()}function D(e,t,s){if(t){e.out(JSON.stringify(s));return}let n=Zs(s);n!==null&&e.out(n);}function en(e){let t=e.failures?.length?` (${e.failures.length} task failure${e.failures.length===1?"":"s"})`:"";return `${e.message}${t}`}function tn(e){let t=[["id",e.id],["status",It(e)]];e.name!==void 0&&t.push(["dataset",e.name]),e.version!==void 0&&t.push(["version",e.version]),e.task_count!==void 0&&t.push(["tasks",String(e.task_count)]);for(let s of e.warnings)t.push(["warning",s.message??s.code]);if(e.failure){t.push(["failure",en(e.failure)]);for(let s of e.failure.failures??[])t.push([` ${s.task_name}`,s.error]);}return v(t)}function xt(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return `${t}s`;let s=Math.floor(t/60),n=t%60;return s<60?`${s}m${String(n).padStart(2,"0")}s`:`${Math.floor(s/60)}h${String(s%60).padStart(2,"0")}m`}function Ua(e,t=Date.now()){let s=e.phases[e.phases.length-1],n=[];s!==void 0&&s.total>0&&(n.push(`${s.done}/${s.total}`),s.banked!==void 0&&s.banked>0&&n.push(s.name==="copying"?`${s.banked} of ${s.total} images already banked`:`${s.banked} banked`));let a=s!==void 0?Date.parse(s.started_at):NaN;return Number.isFinite(a)&&n.push(xt(t-a)),`phase ${e.phase}${n.length>0?` ${n.join(" \xB7 ")}`:""}`}function Fa(e){let t=e.phases.map(a=>{let r=a.completed_at!==void 0?Date.parse(a.completed_at):NaN,i=Date.parse(a.started_at),o=Number.isFinite(r)&&Number.isFinite(i)?xt(r-i):"unfinished";return `${a.name} ${o}`}),s=e.images,n=e.codebuild;return v([["phases",t.join(" \xB7 ")],["images",`${s.built} built, ${s.mirrored} mirrored, ${s.banked} banked`],["codebuild",`${n.copy_builds} copy build(s), ${n.billed_minutes} billed minute(s)`]])}function It(e){return e.receiving===true?`${e.status} (receiving)`:e.status}function Ma(e){let t=[];return e.task_count!==void 0&&t.push(`tasks=${e.task_count}`),e.failure&&t.push(ee(en(e.failure),140)),`status ${It(e).padEnd(12)} ${t.join(" ")}`.trimEnd()}function za(e){return `state ${e.state}`}function qa(e,t){let s=[["state",e.state]];if(t){let n=t.active_version?.version??null;s.push(["active",n===e.version?`${n} (this publish)`:n?`${n} (unchanged)`:"none"]);}return v(s)}function Ka(e){let t={...e.data??{}},s=[];typeof t.trial_id=="string"&&s.push(t.trial_id),typeof t.task_name=="string"&&s.push(t.task_name),typeof t.status=="string"&&s.push(t.status),typeof t.reward=="number"&&s.push(`reward=${t.reward}`);let n=new Set(["trial_id","task_name","status","reward"]);for(let[r,i]of Object.entries(t))n.has(r)||s.push(`${r}=${typeof i=="object"?JSON.stringify(i):String(i)}`);let a=ee(s.join(" "),140);return `#${String(e.seq).padStart(4)} ${e.type.padEnd(26)} ${a}`.trimEnd()}function g(e){let t={};return typeof e.flags["api-key"]=="string"&&(t.apiKey=e.flags["api-key"]),typeof e.flags["base-url"]=="string"&&(t.baseUrl=e.flags["base-url"]),t}var sn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Ga=/^[0-9a-f][0-9a-f-]{7,34}$/i,bs=8,ie=200,Va={job:"jobs",trial:"trials",analysis:"analyses","analyzed trial":"analyzed trials",check:"checks","task check":"task checks",session:"sessions",skill:"skills"},ws=new WeakMap;function Ce(e,t,s){let n=ws.get(e);n===void 0&&(n=new Map,ws.set(e,n));let a=n.get(t);if(a!==void 0)return a;let r=s();return n.set(t,r),r}async function Ne(e){let t=[];for await(let s of e)t.push(s);return t}function Ot(e){let t=te(e);return t!==void 0?{scope:t}:{}}var nn=e=>Ce(e,"jobs",()=>Ne(pa$1(g(e)).list({limit:ie,...Ot(e)}))),vs=e=>Ce(e,"analyses",()=>Ne(ra$1(g(e)).list({limit:ie,...Ot(e)}))),_s=e=>Ce(e,"checks",()=>Ne(sa$1(g(e)).list({limit:ie,...Ot(e)})));async function Ha(e){let t=pa$1(g(e)),s=(await nn(e)).map(r=>r.id),n=[],a=0;for(let r of s){try{for await(let i of t.trials(r,{limit:ie}))n.push(i.id);}catch(i){throw i instanceof ha$1&&i.code==="rate_limited"?new f(`trial id prefixes resolve against every trial of your ${s.length} jobs (one read per job); the API's rate limit refused the walk after ${a} \u2014 pass the full trial id (evolve job trials <job> prints them)`):i}a+=1;}return n}async function Wa(e){let t=Oa$1(De(e)),s=[],n;do{let a=await t.list({limit:ie,state:"all",...n!==void 0?{cursor:n}:{}});for(let r of a.items)s.push(r.id);n=a.nextCursor??void 0;}while(n!==void 0);return s}var Ba={job:async e=>(await nn(e)).map(t=>t.id),trial:Ha,analysis:async e=>(await vs(e)).map(t=>t.id),"analyzed trial":async e=>(await vs(e)).map(t=>t.trial_id),check:async e=>(await _s(e)).map(t=>t.id),"task check":async e=>(await _s(e)).flatMap(t=>t.results.map(s=>s.id)),session:Wa,skill:async e=>(await Ne(oa$1(g(e)).list({limit:ie}))).map(t=>t.id)},Ya=(e,t)=>Ce(e,`ids:${t}`,()=>Ba[t](e));function Xa(e){return `${/^[aeiou]/.test(e[0])?"an":"a"} ${e.join(" or ")}`}async function Pt(e,t,s){if(s===void 0||sn.test(s))return {noun:null,id:s};if(/^[0-9a-f][0-9a-f-]*$/i.test(s)&&s.length<bs)throw new f(`"${s}" is too short to name ${Xa(t)} \u2014 id prefixes need at least ${bs} characters`);if(!Ga.test(s))return {noun:null,id:s};let n=s.toLowerCase(),a=[];for(let o of t){let l=new Set((await Ya(e,o)).filter(c=>c.startsWith(n)));for(let c of l)a.push({noun:o,id:c});}if(a.length===1)return a[0];if(a.length===0)throw new f(`no ${t.join(" or ")} id starts with "${s}"`);let r=t.map(o=>({noun:o,n:a.filter(l=>l.noun===o).length})).filter(({n:o})=>o>0).map(({noun:o,n:l})=>`${l} ${l===1?o:Va[o]}`),i=a.slice(0,5).map(o=>t.length>1?`${o.noun} ${o.id}`:o.id);throw new f(`"${s}" is ambiguous \u2014 it matches ${r.join(" and ")}: ${i.join(", ")}${a.length>5?", \u2026":""}`)}async function y(e,t,s){return (await Pt(e,[t],s)).id}async function jt(e,t,s){let n=await Pt(e,["analysis","analyzed trial"],s);if(n.noun==="analysis")return {id:n.id,analysis:null};if(n.noun==="analyzed trial")return Ss(e,await qa$1(g(e)).get(n.id));if(s===void 0||!sn.test(s))return {id:s,analysis:null};try{return {id:s,analysis:await t.get(s)}}catch(a){if(!(a instanceof ha$1)||a.status!==400)throw a;let r;try{r=await qa$1(g(e)).get(s);}catch(i){throw i instanceof ha$1&&i.status===404?a:i}return Ss(e,r)}}async function Ss(e,t){if(t.analysis)return {id:t.analysis.id,analysis:t.analysis};throw (await pa$1(g(e)).get(t.job_id)).is_regrade?new Error(`${t.id} is a regrade result \u2014 a regrade is never analyzed; analyses belong to its source trial`):new Error(`trial ${t.id} has no analysis yet \u2014 run: evolve analyze ${t.job_id}`)}function mt(e,t){return t.analysis!==null?Promise.resolve(t.analysis):e.get(t.id)}function x(e){return {...e.flags.limit!==void 0?{limit:e.flags.limit}:{},...e.flags.cursor!==void 0?{cursor:String(e.flags.cursor)}:{}}}function te(e){if(e.flags.scope===void 0)return;let t=String(e.flags.scope);if(!E$1.includes(t))throw new f(`--scope must be one of: ${E$1.join(", ")}; got: ${t}`+(t==="all"?" (Harbor's all adds public rows \u2014 nothing hosted is public)":""));return t}function Qa(e){if(e.flags.kind===void 0)return;let t=String(e.flags.kind);if(!F.includes(t))throw new f(`--kind must be one of: ${F.join(", ")}; got: ${t}`);return t}function Za(e){if(e.flags.status===void 0)return;let t=String(e.flags.status).split(",").map(n=>n.trim()).filter(Boolean);if(t.length===0)throw new f("--status got an empty status list");let s=t.filter(n=>!G$1.includes(n));if(s.length>0)throw new f(`--status must name analysis statuses (${G$1.join(", ")}); got: ${s.join(", ")}`);return t}function an(e){if(e.flags.status===void 0)return;let t=String(e.flags.status).split(",").map(n=>n.trim()).filter(Boolean);if(t.length===0)throw new f("--status got an empty status list");let s=t.filter(n=>!C$1.includes(n));if(s.length>0)throw new f(`--status must name trial statuses (${C$1.join(", ")}); got: ${s.join(", ")}`);return t}function er(e){return e.status==="COMPLETED"?0:e.status==="FAILED"||e.status==="CANCELLED"?1:0}function tr(e){return e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||e.startsWith("~")}async function sr(e,t,s){let n=new Set;for(let i of e.agents)for(let o of i.skills??[])tr(o)&&n.add(o);if(n.size===0)return e;let a=oa$1(g(t)),r=new Map;for(let i of n){let o=await a.upload(i);if(r.set(i,o.map(l=>l.ref)),t.flags.json!==true)for(let l of o)s.err(`Uploaded skill ${l.name} (${l.ref}, ${W(l.digest)})`);}return {...e,agents:e.agents.map(i=>({...i,...i.skills!==void 0&&i.skills!==null?{skills:i.skills.flatMap(o=>r.get(o)??[o])}:{}}))}}async function $s(e,t){let s=Je(va(e),e);if(e.flags["print-config"]===true)return t.out(JSON.stringify(s,null,2)),0;let n=e.flags.json===true,a=e.flags.watch===true,r=e.flags.quiet===true,i=pa$1(g(e)),o=await i.start(await sr(s,e,t));if(n||t.out(`org ${s.org??"personal"}`),!a){if(n)t.out(JSON.stringify(o));else {for(let c of L(o))t.out(c);t.out(""),t.out(`Follow it with: evolve job show ${o.id}`);}return 0}n?t.out(JSON.stringify({kind:"job.created",job:o})):t.out(`Job ${o.id} (${Te(o.datasets)}) ${o.status} \u2014 watching\u2026`);let l=await i.watch(o.id,{onEvent:c=>{r||t.out(n?JSON.stringify({kind:"event",...c}):Ka(c));}});if(n)t.out(JSON.stringify({kind:"job.final",job:l}));else {t.out("");for(let c of L(l))t.out(c);}return er(l)}async function nr(e,t){if(C(e,t,ds))return 0;let s=te(e),n=Qa(e),r=await pa$1(g(e)).list({...x(e),...e.flags.search!==void 0?{search:String(e.flags.search)}:{},...s!==void 0?{scope:s}:{},...n!==void 0?{kind:n}:{}});if(e.flags.json===true)return t.out(JSON.stringify(r)),0;if(r.items.length===0)return e.flags.quiet!==true&&t.out(n==="check"?"No checks.":"No jobs."),0;let i=n===void 0||n==="job"?fs:["kind",...fs];return T(e,t,r.items,ds,i,o=>o.id),r.nextCursor&&t.tty===true&&e.flags.quiet!==true&&t.out(`
|
|
33
33
|
More: evolve job list --cursor ${r.nextCursor}`),0}async function ar(e,t){let s=pa$1(g(e)),n=[];for(let a of e.positionals)n.push(await s.get(await y(e,"job",a)));return e.flags.json===true?(t.out(JSON.stringify(n.length===1?n[0]:n)),0):(n.forEach((a,r)=>{r>0&&t.out("");for(let i of L(a))t.out(i);}),0)}async function rr(e,t){if(C(e,t,ps))return 0;let s=pa$1(g(e)),n=an(e),a=e.flags.dataset,r=await s.trials(await y(e,"job",e.positionals[0]),{...n!==void 0?{status:n}:{},...a!==void 0?{dataset:a}:{},...x(e)});return e.flags.json===true?(t.out(JSON.stringify(r)),0):r.items.length===0?(e.flags.quiet!==true&&t.out("No trials."),0):(T(e,t,r.items,ps,Pa,i=>i.id),t.tty===true&&e.flags.quiet!==true&&(t.out(`
|
|
34
34
|
${r.items.length} trial(s) shown`),r.nextCursor&&t.out(`More: evolve job trials ${e.positionals[0]} --cursor ${r.nextCursor}`)),0)}async function ir(e,t){if(C(e,t,gs))return 0;let n=await pa$1(g(e)).tasks(await y(e,"job",e.positionals[0]),x(e));return e.flags.json===true?(t.out(JSON.stringify(n)),0):n.items.length===0?(e.flags.quiet!==true&&t.out("No tasks."),0):(T(e,t,n.items,gs,ja,a=>a.task_name),n.nextCursor&&t.tty===true&&e.flags.quiet!==true&&t.out(`
|
|
35
|
-
More: evolve job tasks ${e.positionals[0]} --cursor ${n.nextCursor}`),0)}function or(e){let t=[],s=[["ID","DATASETS","STATUS","MEAN REWARD","COVERAGE","SPENT"]];for(let n of e.jobs)s.push([n.id,
|
|
36
|
-
`)[0]}`);return e.cost_usd!==null&&t.push(`Total agent cost: $${e.cost_usd.toFixed(4)}`),t}function on(e){let t={};for(let s of e.results)t[s.status]=(t[s.status]??0)+1;return Object.entries(t).map(([s,n])=>`${n} ${s}`).join(" \xB7 ")}function ln(e){let t=e.rubric.criteria.length,s=[["check id",e.id],["status",e.status],["source",e.source.type==="dataset"?`dataset ${e.source.dataset} (package sha256 ${e.source.sha256.slice(0,12)}\u2026)`:`archive ${e.source.bytes} bytes sha256 ${e.source.sha256.slice(0,12)}\u2026`],["tasks",`${e.results.length} (${on(e)})`],["model"
|
|
37
|
-
`),"","RUBRIC");for(let n of e.rubric.criteria)s.push(`${n.name}: ${n.description}`),n.guidance&&s.push(` ${n.guidance}`);return s}async function br(e,t){let s=e.flags.json===true,n=e.flags.watch===true,a=e.flags.quiet===true,r=sa$1(g(e));if(e.flags["show-defaults"]===true)return un(e,t,()=>r.defaults(),"check","<path>");let i={};e.flags.name!==void 0&&(i.name=String(e.flags.name)),e.flags.model!==void 0&&(i.model_name=String(e.flags.model)),e.flags.rubric!==void 0&&(i.rubric=
|
|
38
|
-
More: evolve check list --cursor ${r.nextCursor}`),0)}async function Sr(e,t){let s=await sa$1(g(e)).get(await y(e,"check",e.positionals[0]));if(e.flags.json===true)t.out(JSON.stringify(s));else for(let n of ln(s))t.out(n);return s.results.some(n=>n.status==="failed")?1:0}async function $r(e,t){let s=e.flags.json===true,n=e.flags.since,a=await sa$1(g(e)).transcript(await y(e,"task check",e.positionals[0]),n!==void 0?{since:n}:void 0);for(let r of a.events)D(t,s,r);for(let r of a.gateway_calls)D(t,s,r);return !s&&a.events.length===0&&t.out("No trace events."),0}var Ps=["task-check","trace-parsed",...P];async function js(e,t){try{return await e.task(t)}catch(s){throw s instanceof ha$1&&s.status===404?new Error(`'${t}' is not a task check \u2014 --stream reads one task check's artifacts (results[].id on \`evolve check show\`); to save the whole check by its check id, drop --stream`):s}}async function xr(e,t){let s=sa$1(g(e)),n=e.flags.json===true,a=e.flags.stream;if(a!==void 0&&(e.flags["output-dir"]!==void 0||e.flags.overwrite===true))throw new f('"check download" takes EITHER --stream OR -o/--overwrite, not both');if((a===void 0||a!=="trace-parsed")&&e.flags.since!==void 0)throw new f("--since pages the parsed events; it applies only to --stream trace-parsed");let r=(await Pt(e,a!==void 0?["task check"]:["check","task check"],e.positionals[0])).id,i=r;if(a!==void 0){if(!Ps.includes(a))throw new f(`--stream must be one of: ${Ps.join(", ")}`);if(a==="task-check"){let c=await js(s,i);return t.out(n?JSON.stringify({task_check:c}):JSON.stringify(c,null,2)),0}if(a==="trace-parsed"){let c=e.flags.since,u=await s.transcript(i,c!==void 0?{since:c}:void 0);for(let d of u.events)D(t,n,d);for(let d of u.gateway_calls)D(t,n,d);return !n&&u.events.length===0&&t.out("No trace events."),0}if(await js(s,i),a==="agent-home"){let c=await s.artifact(i,a);if(c===null)return t.out(n?JSON.stringify({files:null}):`No ${a} content was stored for this task check.`),0;if(n)t.out(JSON.stringify({files:c}));else for(let[u,d]of Object.entries(c))t.out(`===== ${u} (${Buffer.byteLength(d,"utf8")} bytes) =====`),t.out(d);return 0}let l=await s.artifact(i,a);return l===null?(t.out(n?JSON.stringify({log:null}):`No ${a} log was stored for this task check.`),0):(t.out(n?JSON.stringify({log:l}):l),0)}return await cn(e,t,{fetch:l=>s.download(r,{to:l}),outputDir:e.flags["output-dir"]??"checks",scratchPrefix:"evolve-check-download-",enrich:async l=>{let{readdir:c}=await import('fs/promises'),{join:u}=await import('path'),d=await Re(e),p=existsSync(u(l,"check_report.json")),m=p?(await c(l,{withFileTypes:true})).filter(_=>_.isDirectory()).map(_=>u(l,_.name)):[l],k=new Map;for(let _ of m){let h=await Ir(_);h!==null&&k.set(_,h);}let P=p?r:k.get(l)?.checkId;if(P===void 0)return [];let S=await s.get(P),b=[];p&&(await
|
|
35
|
+
More: evolve job tasks ${e.positionals[0]} --cursor ${n.nextCursor}`),0)}function or(e){let t=[],s=[["ID","DATASETS","STATUS","MEAN REWARD","COVERAGE","SPENT"]];for(let n of e.jobs)s.push([n.id,Te(n.datasets),n.status,gt(n.mean_reward),`${n.coverage.scored}/${n.coverage.total}`,E(n.cost_usd)]);if(t.push(...v(s)),e.taskMatrix.length>0){t.push("","Task matrix (disagreements first; columns in the order above):");let n=[["TASK","DIFF",...e.jobs.map((r,i)=>`JOB ${i+1}`)]],a=e.jobs.map(r=>r.id);for(let r of e.taskMatrix){let i=new Map(r.cells.map(o=>[o.job_id,o]));n.push([r.task_name,r.disagreement?"!":"",...a.map(o=>{let l=i.get(o);return l?l.mean_reward!==null?`${l.status} ${gt(l.mean_reward)}`:l.status:"-"})]);}t.push(...v(n));}return t}async function lr(e,t){let s=pa$1(g(e)),n=[];for(let r of e.positionals)n.push(await y(e,"job",r));let a=await s.compare(n);if(e.flags.json===true)t.out(JSON.stringify(a));else for(let r of or(a))t.out(r);return 0}async function ur(e,t){let n=await pa$1(g(e)).cancel(await y(e,"job",e.positionals[0]));if(e.flags.json===true)t.out(JSON.stringify(n));else for(let a of L(n))t.out(a);return 0}async function cr(e,t){let s=pa$1(g(e)),n=await y(e,"job",e.positionals[0]);if(e.flags.yes!==true){if(t.confirm===void 0)throw new Error("deleting a job is permanent \u2014 trials, traces, analyses and stored files. Re-run with --yes to confirm.");let r=await s.get(n);if(t.err(` ${r.id} ${r.job_name||"\u2014"}`),!await t.confirm("Permanently delete this job and all associated trials?"))return t.err("Delete cancelled."),1}let a=await s.delete(n);return e.flags.json===true?t.out(JSON.stringify(a)):t.out(`Deleted job ${a.job_id}: ${a.trials_deleted} trials, ${a.analyses_deleted} analyses destroyed.`),0}function xs(e){let t=e.flags.email??[],s=e.flags.link===true;if(!s&&t.length===0)throw new f("name a grant: --link and/or --email <address>");return {...s?{link:true}:{},...t.length>0?{emails:t}:{}}}function dr(e){let t=[`visibility ${e.visibility}`,e.link.enabled?`link ${e.link.url??"(enabled)"}`:"link off"];if(e.emails.length===0)t.push("emails none");else for(let s of e.emails)t.push(`email ${s.email} (shared by ${s.shared_by}, ${s.created_at})`);return t}function st(e,t,s){if(e.flags.json===true)t.out(JSON.stringify(s));else for(let n of dr(s))t.out(n);return 0}function At(e,t){return {share:async(r,i)=>{let o=xs(r),l=await t(r).share(await y(r,e,r.positionals[0]),o);return st(r,i,l)},unshare:async(r,i)=>{let o=xs(r),l=await t(r).unshare(await y(r,e,r.positionals[0]),o);return st(r,i,l)},shares:async(r,i)=>st(r,i,await t(r).shares(await y(r,e,r.positionals[0])))}}var nt=At("job",e=>pa$1(g(e))),at=At("check",e=>sa$1(g(e))),rt=At("session",e=>Oa$1(De(e)));async function fr(e,t){let s=e.flags.dataset;if(!s)throw new f("job stop needs --dataset <name> (to stop the whole job, use: evolve job cancel <id>)");let n=pa$1(g(e)),a=await n.get(await y(e,"job",e.positionals[0])),r=a.datasets.map(u=>u.name);if(!r.includes(s))throw new Error(`job ${a.id} does not run dataset ${s}; its datasets: ${r.join(", ")}`);let i=[];for await(let u of n.trials(a.id,{dataset:s}))i.push(u.id);if(i.length===0)return e.flags.json===true?t.out(JSON.stringify({stopped:[],stopped_analyses:[],already_terminal:[],not_found:[]})):t.out(`No trials in ${s}.`),0;let o=qa$1(g(e)),l={stopped:[],stopped_analyses:[],already_terminal:[],not_found:[]},c=0;try{for(let u=0;u<i.length;u+=100){let d=i.slice(u,u+100),p=await o.stop(d);c+=d.length,l.stopped.push(...p.stopped),l.stopped_analyses.push(...p.stopped_analyses),l.already_terminal.push(...p.already_terminal),l.not_found.push(...p.not_found);}}catch(u){throw Is(l,s,i.length,c,e,t),u}return Is(l,s,i.length,c,e,t),0}function Is(e,t,s,n,a,r){let i=s-n;if(a.flags.json===true){r.out(JSON.stringify(i>0?{...e,partial:true,unreported:i}:e));return}for(let o of e.stopped)r.out(`stopped ${o.id} (${o.task_name}) ${o.status}`);for(let o of e.already_terminal)r.out(`already terminal ${o}`);for(let o of e.not_found)r.out(`not found ${o}`);r.out(`${e.stopped.length} stopped, ${e.already_terminal.length} already terminal, ${e.not_found.length} not found (${t})`),i>0&&r.out(`PARTIAL: ${i} of ${s} trials have no report \u2014 no answer came back for trials ${n+1}-${Math.min(n+100,s)}; rerun the same command to finish the rest.`);}async function pr(e,t){let s=pa$1(g(e)),n=e.flags["filter-error-type"],a=await s.resume(await y(e,"job",e.positionals[0]),n!==void 0?{filter_error_types:n}:void 0);if(e.flags.json===true)t.out(JSON.stringify(a));else {for(let r of L(a))t.out(r);t.out(""),t.out(`Follow it with: evolve job show ${a.id}`);}return 0}async function gr(e,t){let s=e.flags.trial,n=e.flags["failed-only"]===true;if(s!==void 0&&n)throw new f('"job retry" takes EITHER -t/--trial OR --failed-only, not both \u2014 explicit ids are already a selection');let a={};s!==void 0&&(a.trial_ids=s),n&&(a.failed_only=true);let r=await pa$1(g(e)).retry(await y(e,"job",e.positionals[0]),a);if(e.flags.json===true)t.out(JSON.stringify(r));else {for(let i of L(r))t.out(i);t.out(""),t.out(`Follow it with: evolve job show ${r.id}`);}return 0}function mr(e){if(e.length===0)return ["No analyzed trials."];let t=[["TRIAL","TASK","CHECKS","COST","SUMMARY"]],s=[];for(let n of e){let a=n.analysis,r;if(a.status==="failed")r=`FAILED${a.failure?` (${a.failure.phase})`:""}`,a.failure&&s.push(`analysis failed ${n.id} (${n.task_name}) \u2014 ${a.failure.phase}: ${H(a.failure.message)}`);else {let i=Object.entries(a.checks??{}).map(([o,l])=>`${o} ${l.outcome}`).join(" \xB7 ")||a.status;r=a.status==="completed"?`${ye(a.checks)} \xB7 ${i}`:i;}t.push([n.id,n.task_name,r,a.estimated_cost_usd!==null?`$${a.estimated_cost_usd.toFixed(4)}`:"-",a.summary?ee(H(a.summary),60):"-"]);}return [...v(t),...s]}async function hr(e,t){let s=e.flags.json===true,n=e.flags.watch===true,a=e.flags.quiet===true;if(e.flags["show-defaults"]===true)return un(e,t,()=>ra$1(g(e)).defaults(),"analyze","<job-id>");if(e.positionals[0]===void 0)throw new f("analyze takes a <job-id> (or --show-defaults)");let r=pa$1(g(e)),i=await y(e,"job",e.positionals[0]),o={};e.flags.agent!==void 0&&(o.agent=String(e.flags.agent)),e.flags.model!==void 0&&(o.model_name=String(e.flags.model)),e.flags.rubric!==void 0&&(o.rubric=_t(String(e.flags.rubric))),e.flags.prompt!==void 0&&(o.prompt=vt(String(e.flags.prompt))),e.flags.env!==void 0&&(o.sandbox_provider=String(e.flags.env)),e.flags.effort!==void 0&&(o.reasoning_effort=String(e.flags.effort)),e.flags["n-concurrent"]!==void 0&&(o.n_concurrent=e.flags["n-concurrent"]),e.flags.passing===true&&(o.passing=true),e.flags.failing===true&&(o.failing=true),e.flags["n-trials"]!==void 0&&(o.n_trials=e.flags["n-trials"]),e.flags.trial!==void 0&&(o.trial_ids=e.flags.trial);let l=await r.get(i);if((l.upload?.task_links??[]).some(p=>p.n_unlinked>0))for(let p of Et(l.upload?.task_links??null))t.err(p);else l.upload!==null&&l.upload!==void 0&&l.upload.task_links===null&&t.err(jr);let c=await r.analyze(i,o);if(!n){if(s)t.out(JSON.stringify(c));else {for(let p of L(c))t.out(p);t.out(""),t.out(`Follow it with: evolve job show ${c.id}`);}return 0}s?t.out(JSON.stringify({kind:"analysis.accepted",job:c})):a||t.out(`Job ${c.id} \u2014 analyses enqueued, watching\u2026`);let u=await r.watchAnalysis(c.id,{onStats:p=>{a||p.stats.analysis&&t.out(s?JSON.stringify({kind:"analysis.stats",analysis:p.stats.analysis}):`analyses ${pt(p.stats.analysis)}`);}}),d=[];for await(let p of r.trials(u.id))p.analysis&&d.push(p);if(s)t.out(JSON.stringify({kind:"analysis.final",job:u,trials:d}));else {t.out("");for(let p of mr(d))t.out(p);u.stats.analysis&&(t.out(""),t.out(`analyses ${pt(u.stats.analysis)}`)),t.out("Details: evolve trial show <trial-id>");}return (u.stats.analysis?.n_failed??0)>0?1:0}function yr(e){return e.replace(/_/g," ").split(" ").map(t=>t&&t[0].toUpperCase()+t.slice(1).toLowerCase()).join(" ")}function rn(e){let t=[],s=e.results.filter(a=>a.status==="failed");if(e.results.length===1){let a=e.results[0];if(a.status==="failed"&&a.failure)return t.push(`\u274C ${a.task_name}: ${a.failure.phase}: ${a.failure.message}`),t;t.push(`Task Quality Checks: ${a.task_name}`),a.status==="completed"&&t.push(`Outcomes: ${ye(a.checks)}`);let r=[["CHECK","OUTCOME","EXPLANATION"]];for(let[i,o]of Object.entries(a.checks??{})){r.push([yr(i),o.outcome,H(o.explanation)]);for(let l of o.evidence??[])r.push(["","",`${l.where} \u2014 ${H(l.quote)}`]);}return r.length===1&&r.push(["-",a.status,"-"]),t.push(...v(r)),a.cost_usd!==null&&t.push(`Agent cost: $${a.cost_usd.toFixed(4)}`),t.push(`Task check id: ${a.id}`),t}t.push("Task Quality Checks");let n=[["TASK","PASS","FAIL","N/A","UNKNOWN","COST ($)","TASK CHECK ID"]];for(let a of e.results){if(a.status==="failed"){n.push([a.task_name,"-","-","-","-","-",a.id]);continue}if(a.status!=="completed"){n.push([`${a.task_name} \xB7 ${a.status}`,"-","-","-","-","-",a.id]);continue}let r=Ys(a.checks);n.push([a.task_name,String(r.pass),String(r.fail),String(r.not_applicable),String(r.unknown),a.cost_usd!==null?a.cost_usd.toFixed(4):"-",a.id]);}t.push(...v(n));for(let a of s)a.failure&&t.push(`\u274C ${a.task_name}: ${a.failure.phase}: ${a.failure.message.split(`
|
|
36
|
+
`)[0]}`);return e.cost_usd!==null&&t.push(`Total agent cost: $${e.cost_usd.toFixed(4)}`),t}function on(e){let t={};for(let s of e.results)t[s.status]=(t[s.status]??0)+1;return Object.entries(t).map(([s,n])=>`${n} ${s}`).join(" \xB7 ")}function ln(e){let t=e.rubric.criteria.length,s=[["check id",e.id],["status",e.status],["source",e.source.type==="dataset"?`dataset ${e.source.dataset} (package sha256 ${e.source.sha256.slice(0,12)}\u2026)`:`archive ${e.source.bytes} bytes sha256 ${e.source.sha256.slice(0,12)}\u2026`],["tasks",`${e.results.length} (${on(e)})`],...e.agent?[["agent",e.agent]]:[],["model",e.reasoning_effort?`${e.model_name} at effort ${e.reasoning_effort}`:e.model_name],["rubric",`${t} criteri${t===1?"on":"a"}`],["provider",e.sandbox_provider],["visibility",e.visibility]];return e.prompt!==null&&s.push(["prompt","custom (Harbor's -p text)"]),e.n_concurrent!==null&&s.push(["n_concurrent",String(e.n_concurrent)]),e.include_task_names.length>0&&s.push(["include",e.include_task_names.join(", ")]),e.exclude_task_names.length>0&&s.push(["exclude",e.exclude_task_names.join(", ")]),e.n_tasks!==null&&s.push(["n_tasks",String(e.n_tasks)]),s.push(["created",e.created_at]),e.finished_at&&s.push(["finished",e.finished_at]),[...v(s),"",...rn(e)]}async function un(e,t,s,n,a){let r=new Set(["show-defaults",...Object.keys(Ee)]),i=Object.keys(e.flags).filter(l=>!r.has(l));if(e.positionals[0]!==void 0||i.length>0)throw new f(`--show-defaults prints the platform's ${n} defaults and takes no ${a} and no other ${n} flag`+(i.length>0?` (given: ${i.map(l=>"--"+l).join(", ")})`:""));let o=await s();if(e.flags.json===true)t.out(JSON.stringify(o));else for(let l of kr(o))t.out(l);return 0}function kr(e){let t=e.rubric.criteria.length,s=v([...e.agent?[["agent",e.agent]]:[],["model",e.model_name],["effort",e.reasoning_effort??"-"],["provider",e.sandbox_provider],["rubric",`${t} criteri${t===1?"on":"a"}`]]);s.push("","PROMPT",...e.prompt.split(`
|
|
37
|
+
`),"","RUBRIC");for(let n of e.rubric.criteria)s.push(`${n.name}: ${n.description}`),n.guidance&&s.push(` ${n.guidance}`);return s}async function br(e,t){let s=e.flags.json===true,n=e.flags.watch===true,a=e.flags.quiet===true,r=sa$1(g(e));if(e.flags["show-defaults"]===true)return un(e,t,()=>r.defaults(),"check","<path>");let i={};e.flags.name!==void 0&&(i.name=String(e.flags.name)),e.flags.agent!==void 0&&(i.agent=String(e.flags.agent)),e.flags.model!==void 0&&(i.model_name=String(e.flags.model)),e.flags.rubric!==void 0&&(i.rubric=_t(String(e.flags.rubric))),e.flags.prompt!==void 0&&(i.prompt=vt(String(e.flags.prompt))),e.flags.env!==void 0&&(i.sandbox_provider=String(e.flags.env)),e.flags.effort!==void 0&&(i.reasoning_effort=String(e.flags.effort)),e.flags["n-concurrent"]!==void 0&&(i.n_concurrent=e.flags["n-concurrent"]),e.flags["include-task-name"]!==void 0&&(i.include_task_names=e.flags["include-task-name"]),e.flags["exclude-task-name"]!==void 0&&(i.exclude_task_names=e.flags["exclude-task-name"]),e.flags["n-tasks"]!==void 0&&(i.n_tasks=e.flags["n-tasks"]);let o=e.positionals[0],l=e.flags.dataset;if(o===void 0&&l===void 0)throw new f("check takes a <path> (a task directory, or a directory of them) or -d/--dataset <name[@version]>");if(o!==void 0&&l!==void 0)throw new f("check takes EITHER a <path> OR -d/--dataset, not both");let c=l!==void 0?{dataset:l}:{directory:o};!s&&!a&&t.out("\u{1F50E} Checking task quality...");let u=await r.create({source:c,...i});if(!n){if(s)t.out(JSON.stringify(u));else {for(let p of ln(u))t.out(p);t.out(""),t.out(`Follow it with: evolve check show ${u.id}`);}return 0}s?t.out(JSON.stringify({kind:"check.accepted",check:u})):a||t.out(`Check ${u.id} \u2014 ${u.results.length} task${u.results.length===1?"":"s"} queued, watching\u2026`);let d=await r.watch(u.id,{onProgress:p=>{a||t.out(s?JSON.stringify({kind:"check.progress",check:p}):`tasks ${on(p)}`);}});if(s)t.out(JSON.stringify({kind:"check.final",check:d}));else {t.out("");for(let p of rn(d))t.out(p);t.out(""),t.out(`Report: evolve check show ${d.id}`);}return d.results.some(p=>p.status==="failed")?1:0}function wr(e){if(e.flags.status===void 0)return;let t=String(e.flags.status).split(",").map(n=>n.trim()).filter(Boolean);if(t.length===0)throw new f("--status got an empty status list");let s=t.filter(n=>!H$1.includes(n));if(s.length>0)throw new f(`--status must name check statuses (${H$1.join(", ")}); got: ${s.join(", ")}`);return t}var Os=[{key:"id",header:"ID",cell:e=>e.id},{key:"status",header:"STATUS",cell:e=>e.status},{key:"tasks",header:"TASKS",cell:e=>String(e.results.length)},{key:"agent",header:"AGENT",cell:e=>e.agent??"-"},{key:"model",header:"MODEL",cell:e=>e.model_name},{key:"spent",header:"SPENT",cell:e=>e.cost_usd!==null?`$${e.cost_usd.toFixed(4)}`:"-"},{key:"created",header:"CREATED",cell:e=>e.created_at},{key:"finished",header:"FINISHED",cell:e=>e.finished_at??"-"}],vr=["id","status","tasks","agent","model","spent","created"];async function _r(e,t){if(C(e,t,Os))return 0;let s=te(e),n=wr(e),a=e.flags.dataset,r=await sa$1(g(e)).list({...x(e),...s!==void 0?{scope:s}:{},...n!==void 0?{status:n}:{},...a!==void 0?{dataset:a}:{}});return e.flags.json===true?(t.out(JSON.stringify(r)),0):r.items.length===0?(e.flags.quiet!==true&&t.out("No checks."),0):(T(e,t,r.items,Os,vr,i=>i.id),r.nextCursor&&t.tty===true&&e.flags.quiet!==true&&t.out(`
|
|
38
|
+
More: evolve check list --cursor ${r.nextCursor}`),0)}async function Sr(e,t){let s=await sa$1(g(e)).get(await y(e,"check",e.positionals[0]));if(e.flags.json===true)t.out(JSON.stringify(s));else for(let n of ln(s))t.out(n);return s.results.some(n=>n.status==="failed")?1:0}async function $r(e,t){let s=e.flags.json===true,n=e.flags.since,a=await sa$1(g(e)).transcript(await y(e,"task check",e.positionals[0]),n!==void 0?{since:n}:void 0);for(let r of a.events)D(t,s,r);for(let r of a.gateway_calls)D(t,s,r);return !s&&a.events.length===0&&t.out("No trace events."),0}var Ps=["task-check","trace-parsed",...P];async function js(e,t){try{return await e.task(t)}catch(s){throw s instanceof ha$1&&s.status===404?new Error(`'${t}' is not a task check \u2014 --stream reads one task check's artifacts (results[].id on \`evolve check show\`); to save the whole check by its check id, drop --stream`):s}}async function xr(e,t){let s=sa$1(g(e)),n=e.flags.json===true,a=e.flags.stream;if(a!==void 0&&(e.flags["output-dir"]!==void 0||e.flags.overwrite===true))throw new f('"check download" takes EITHER --stream OR -o/--overwrite, not both');if((a===void 0||a!=="trace-parsed")&&e.flags.since!==void 0)throw new f("--since pages the parsed events; it applies only to --stream trace-parsed");let r=(await Pt(e,a!==void 0?["task check"]:["check","task check"],e.positionals[0])).id,i=r;if(a!==void 0){if(!Ps.includes(a))throw new f(`--stream must be one of: ${Ps.join(", ")}`);if(a==="task-check"){let c=await js(s,i);return t.out(n?JSON.stringify({task_check:c}):JSON.stringify(c,null,2)),0}if(a==="trace-parsed"){let c=e.flags.since,u=await s.transcript(i,c!==void 0?{since:c}:void 0);for(let d of u.events)D(t,n,d);for(let d of u.gateway_calls)D(t,n,d);return !n&&u.events.length===0&&t.out("No trace events."),0}if(await js(s,i),a==="agent-home"){let c=await s.artifact(i,a);if(c===null)return t.out(n?JSON.stringify({files:null}):`No ${a} content was stored for this task check.`),0;if(n)t.out(JSON.stringify({files:c}));else for(let[u,d]of Object.entries(c))t.out(`===== ${u} (${Buffer.byteLength(d,"utf8")} bytes) =====`),t.out(d);return 0}let l=await s.artifact(i,a);return l===null?(t.out(n?JSON.stringify({log:null}):`No ${a} log was stored for this task check.`),0):(t.out(n?JSON.stringify({log:l}):l),0)}return await cn(e,t,{fetch:l=>s.download(r,{to:l}),outputDir:e.flags["output-dir"]??"checks",scratchPrefix:"evolve-check-download-",enrich:async l=>{let{readdir:c}=await import('fs/promises'),{join:u}=await import('path'),d=await Re(e),p=existsSync(u(l,"check_report.json")),m=p?(await c(l,{withFileTypes:true})).filter(_=>_.isDirectory()).map(_=>u(l,_.name)):[l],k=new Map;for(let _ of m){let h=await Ir(_);h!==null&&k.set(_,h);}let P=p?r:k.get(l)?.checkId;if(P===void 0)return [];let S=await s.get(P),b=[];p&&(await ht(u(l,"evolve.json"),ga$1(S,d)),b.push("evolve.json"));for(let[_,h]of k){let $=S.results.find(O=>O.id===h.taskCheckId);$!==void 0&&(await ht(u(_,"evolve.json"),fa$1($,S,d)),b.push(p?`${_.slice(l.length+1)}/evolve.json`:"evolve.json"));}return b}})}async function Ir(e){let{readFile:t}=await import('fs/promises'),{join:s}=await import('path');try{let n=JSON.parse(await t(s(e,"result.json"),"utf8")),a=n.x_evolve?.taskCheckId,r=n.x_evolve?.checkId;return typeof a=="string"&&typeof r=="string"?{taskCheckId:a,checkId:r}:null}catch{return null}}async function ht(e,t){let{writeFile:s}=await import('fs/promises');await s(e,JSON.stringify(t,null,2)+`
|
|
39
39
|
`);}async function cn(e,t,s){let{mkdtemp:n,rm:a}=await import('fs/promises'),{tmpdir:r}=await import('os'),{join:i}=await import('path'),{extractTarGz:o,tarGzTopLevelName:l}=await import('../tar-GVC4KE52.js'),c=await n(i(r(),s.scratchPrefix));try{let u=await s.fetch(c),d=await l(u),p=i(s.outputDir,d);if(existsSync(p)){if(e.flags.overwrite!==!0)throw new Error(`${p} already exists (pass --overwrite to replace it)`);await a(p,{recursive:!0,force:!0});}let m;try{m=await o(u,s.outputDir,d);}catch(k){throw await a(p,{recursive:!0,force:!0}).catch(()=>{}),k}return m.push(...await s.enrich(p)),e.flags.json===!0?t.out(JSON.stringify({path:p,files:m.length})):t.out(`Saved ${p} (${m.length} files)`),0}finally{await a(c,{recursive:true,force:true}).catch(()=>{});}}async function Or(e,t){let s=pa$1(g(e)),n={},a=an(e);a!==void 0&&(n.statuses=a),e.flags.task!==void 0&&(n.task_name=String(e.flags.task));let r=await s.regrade(await y(e,"job",e.positionals[0]),n);if(e.flags.json===true)t.out(JSON.stringify(r));else {for(let i of L(r))t.out(i);t.out(""),t.out(`Follow it with: evolve job show ${r.id}`);}return 0}async function Pr(e,t){let s=pa$1(g(e)),n=await y(e,"job",e.positionals[0]),{join:a}=await import('path'),r=e.flags["output-dir"]??process.cwd(),i=`job-${n}`,o=a(r,i);if(existsSync(o)&&e.flags.overwrite!==true)throw new Error(`${o} already exists (pass --overwrite to replace it)`);let{mkdtemp:l,rm:c}=await import('fs/promises'),{tmpdir:u}=await import('os'),{extractTarGz:d}=await import('../tar-GVC4KE52.js'),p=await l(a(u(),"evolve-job-download-"));try{let m=await s.download(n,{to:p});e.flags.overwrite===!0&&await c(o,{recursive:!0,force:!0});let k;try{k=await d(m,r,i);}catch(O){throw await c(o,{recursive:!0,force:!0}).catch(()=>{}),O}let{readdir:P,readFile:S,writeFile:b}=await import('fs/promises'),_=await s.get(n),h=await Re(e),$=new Map;for await(let O of s.trials(n))$.set(O.id,O);await b(a(o,"evolve.json"),JSON.stringify(ca$1(_,h),null,2)+`
|
|
40
40
|
`),k.push("evolve.json");for(let O of await P(o,{withFileTypes:!0})){if(!O.isDirectory())continue;let Ue;try{Ue=JSON.parse(await S(a(o,O.name,"result.json"),"utf8")).x_evolve?.trialId;}catch{continue}let Nt=Ue!==void 0?$.get(Ue):void 0;Nt&&(await b(a(o,O.name,"evolve.json"),JSON.stringify(ba$1(Nt,_,h),null,2)+`
|
|
41
41
|
`),k.push(`${O.name}/evolve.json`));}return e.flags.json===!0?t.out(JSON.stringify({path:o,files:k.length})):t.out(`Saved ${o} (${k.length} files)`),0}finally{await c(p,{recursive:true,force:true}).catch(()=>{});}}function me(e){return e.receiving?`${e.status} (receiving)`:e.status}function dn(e){let t=[["id",e.id],["status",me(e)]];return e.source!==null&&t.push(["source",e.source.type==="archive"?`archive (${W(`sha256:${e.source.sha256}`)})`:e.source.type==="archive_url"?`url ${e.source.url}`:`hub job ${e.source.job_id}`]),e.dataset!==null&&t.push(["dataset",e.dataset]),e.job_id!==null&&t.push(["job",e.job_id]),e.n_trials_uploaded!==null&&t.push(["trials",String(e.n_trials_uploaded)]),e.n_trials_skipped!==null&&t.push(["skipped",String(e.n_trials_skipped)]),e.progress!==null&&t.push(["phase",e.progress.phase]),e.failure!==null&&t.push(["failure",`${e.failure.code}: ${e.failure.message}`]),[...v(t),...fn(e.skipped_trials),...Et(e.task_links)]}var As={hash_mismatch:"hash mismatch",task_not_in_dataset:"task not in the dataset",no_dataset_named:"no dataset named",dataset_ambiguous:"same task in two datasets",no_hash_match:"no task with this hash",no_task_digest:"no task digest in the archive"},jr="uploaded before task linking existed: whether its trials carry the task folder is unknown here; each analysis row records it (task_absent_reason)";function Ar(e){return e==="dataset_flag"?"by task name, -d":"task hashes equal"}function Et(e){if(e===null||e.length===0)return [];let t=e.reduce((d,p)=>d+p.n_trials,0),s=e.reduce((d,p)=>d+p.n_linked,0),n=(d,p)=>`${d} ${p}${d===1?"":"s"}`,a=d=>Object.entries(d.link_reasons).map(([p,m])=>`${As[p]??p}${Object.keys(d.link_reasons).length>1?` ${m}`:""}`).join(", ")+(d.candidates.length>0?` [${d.candidates.join(", ")}]`:""),r=e.filter(d=>d.n_unlinked>0);if(s===0){let d=Array.from(new Set(r.flatMap(m=>Object.keys(m.link_reasons)))).map(m=>As[m]??m).join(", "),p=Array.from(new Set(r.flatMap(m=>m.candidates)));return [`no dataset matched (${d}${p.length>0?`: ${p.join(", ")}`:""}); analyses of this job will run without the task folder \u2014 link explicitly with -d`]}let i=new Map,o="";for(let d of e)if(d.n_linked!==0){o=Ar(d.linked_by);for(let p of d.datasets)i.set(p,(i.get(p)??0)+d.n_linked);}let l=Array.from(i.entries()),c=l.length===1?l[0][0]:l.map(([d,p])=>`${d} (${p})`).join(", "),u=[`linked ${s} of ${n(t,"trial")} to ${c} (${o})`];return r.length>0&&u.push(`not linked: ${r.map(d=>`${d.task_name} (${n(d.n_unlinked,"trial")}, ${a(d)})`).join(", ")} \u2014 analyses of those trials run without the task folder; link explicitly: evolve upload <dir> -d <name[@version]>`),u}function fn(e){return e===null||e.length===0?[]:e.map(t=>` skipped ${t.trial}: ${t.code}: ${t.message}`)}function Er(e){let t=e.failure!==null?ee(`${e.failure.code}: ${e.failure.message}`,140):"";return `status ${me(e).padEnd(20)} ${t}`.trimEnd()}function Tr(e,t=Date.now()){let s=xt(t-Date.parse(e.started_at));return `phase ${e.phase.padEnd(20)} ${s} elapsed`}async function pn(e,t,s,n){let a=pa$1(g(e)),r=e.flags.json===true;r||s.out(n==="accepted"?`Upload accepted: import ${t.id} ${me(t)} \u2014 watching\u2026`:`Import ${t.id} ${me(t)} \u2014 watching\u2026`);let i=await a.watchImport(t.id,{onStatus:u=>{r||s.out(Er(u));},onProgress:u=>{r||s.out(Tr(u));}});if(i.status==="FAILED"||i.job_id===null){let u=i.failure??{code:"import_failed",message:"the import settled without a job and without a recorded failure"};return r&&s.out(JSON.stringify({error:u})),s.err(`Error: ${u.message}`),1}let o=await a.get(i.job_id);if((i.n_trials_skipped??0)>0){s.err(`Skipped ${i.n_trials_skipped} trial(s) \u2014 see: evolve job import ${i.id}`);for(let u of fn(i.skipped_trials))s.err(u);}let l=Et(o.upload?.task_links??null),c=(o.upload?.task_links??[]).some(u=>u.n_unlinked>0);if(r){if(c)for(let u of l)s.err(u);return s.out(JSON.stringify(o)),0}s.out("");for(let u of L(o,{taskLinksRow:false}))s.out(u);if(l.length>0){s.out("");for(let u of l)s.out(u);}return s.out(""),s.out(`Analyze it with: evolve analyze ${o.id}`),0}async function Cr(e,t){let s=pa$1(g(e)),n=e.flags.json===true,a=e.flags.dataset,r=e.flags.from,i=e.positionals[0];if(r!==void 0&&i!==void 0)throw new f('"upload" takes EXACTLY ONE source: <job_dir>, or --from <url>');if(r===void 0&&i===void 0)throw new f('"upload" needs a source: <job_dir> (or its .tar.gz), or --from <url>');if(r!==void 0&&!r.trim().startsWith("https://"))throw new f(`"--from" takes a public https url of a job archive (got "${r}")`);let o=-1,l=await s.upload(r!==void 0?{archive_url:r.trim()}:i,{...a!==void 0?{dataset:a}:{},onUploadProgress:(c,u)=>{if(n)return;let d=u>0?Math.floor(c/u*10):10;d!==o&&(o=d,t.out(`upload ${c}/${u} (${Math.min(100,d*10)}%)`));},onRegistered:c=>{n||t.out(`Registered import ${c} \u2014 re-attach anytime with: evolve job import ${c} --watch`);}});if(e.flags["no-wait"]===true){if(n)return t.out(JSON.stringify(l)),0;for(let c of dn(l))t.out(c);return t.out(""),t.out(`Follow it with: evolve job import ${l.id} --watch`),0}return pn(e,l,t,"accepted")}var Es=[{key:"id",header:"ID",cell:e=>e.id},{key:"status",header:"STATUS",cell:me},{key:"job",header:"JOB",cell:e=>e.job_id??"-"},{key:"trials",header:"TRIALS",cell:e=>e.n_trials_uploaded===null?"-":String(e.n_trials_uploaded)},{key:"skipped",header:"SKIPPED",cell:e=>e.n_trials_skipped===null?"-":String(e.n_trials_skipped)},{key:"dataset",header:"DATASET",cell:e=>e.dataset??"-"},{key:"created",header:"CREATED",cell:e=>e.created_at??""}],Nr=["id","status","job","trials","skipped","dataset","created"];async function Rr(e,t){if(C(e,t,Es))return 0;let s=pa$1(g(e)),n=e.flags.status;if(n!==void 0&&!["QUEUED","RUNNING","COMPLETED","FAILED"].includes(n))throw new f(`"--status" must be one of QUEUED, RUNNING, COMPLETED, FAILED (got "${n}")`);let a=await s.listImports({...x(e),...n!==void 0?{status:n}:{}});return e.flags.json===true?(t.out(JSON.stringify(a)),0):a.items.length===0?(e.flags.quiet!==true&&t.out("No job imports."),0):(T(e,t,a.items,Es,Nr,r=>r.id),a.nextCursor&&t.tty===true&&e.flags.quiet!==true&&t.out(`
|
|
42
|
-
More: evolve job imports --cursor ${a.nextCursor}`),0)}async function Lr(e,t){let n=await pa$1(g(e)).getImport(e.positionals[0]);if(e.flags.watch===true)return pn(e,n,t,"attached");if(e.flags.json===true)return t.out(JSON.stringify(n)),0;for(let a of dn(n))t.out(a);return 0}async function Dr(e,t){let n=await qa$1(g(e)).get(await y(e,"trial",e.positionals[0]));if(e.flags.json===true)t.out(JSON.stringify(n));else for(let a of Ra(n))t.out(a);return 0}var Ts=N;async function Jr(e,t){let s=qa$1(g(e)),n=e.flags.json===true,a=e.flags.stream;if(a!==void 0&&(e.flags["output-dir"]!==void 0||e.flags.overwrite===true))throw new f('"trial download" takes EITHER --stream OR -o/--overwrite, not both');if((a===void 0||a!=="trace-parsed")&&(e.flags.cursor!==void 0||e.flags.limit!==void 0))throw new f("--cursor/--limit page the parsed events; they apply only to --stream trace-parsed");let r=await y(e,"trial",e.positionals[0]);if(a!==void 0){if(!Ts.includes(a))throw new f(`--stream must be one of: ${Ts.join(", ")}`);if(a==="trace-parsed"){let b=0;for await(let _ of s.traceEvents(r,x(e)))D(t,n,_),b+=1;return !n&&b===0&&t.out("No trace events."),0}if(a==="agent-home"){let b=await s.artifact(r,a);if(b===null)return t.out(n?JSON.stringify({files:null}):`No ${a} content was stored for this trial.`),0;if(n)t.out(JSON.stringify({files:b}));else for(let[_,h]of Object.entries(b))t.out(`===== ${_} (${Buffer.byteLength(h,"utf8")} bytes) =====`),t.out(h);return 0}if(a==="filesystem"){let b=await s.filesystem(r).archive();return n?t.out(JSON.stringify({stream:"filesystem",bytes:b.length,encoding:"base64",data:b.toString("base64")})):(t.bytes??(_=>process.stdout.write(_)))(b),0}let S=await s.artifact(r,a);return S===null?(t.out(n?JSON.stringify({log:null}):`No ${a} log was stored for this trial.`),0):(t.out(n?JSON.stringify({log:S}):S),0)}let{mkdir:i,writeFile:o}=await import('fs/promises'),{join:l,dirname:c}=await import('path'),u=l(e.flags["output-dir"]??"trials",r);if(existsSync(u)&&e.flags.overwrite!==true)throw new Error(`${u} already exists (pass --overwrite to replace it)`);let d=await s.get(r),p=null;try{p=await pa$1(g(e)).get(d.job_id);}catch{p=null;}let m=[];for await(let S of s.traceEvents(r))m.push(S);let k=da$1({trial:d,job:p,events:m,atif:await s.artifact(r,"trace-atif"),verifierLog:await s.artifact(r,"verifier"),stdout:await s.artifact(r,"trace-stdout"),stderr:await s.artifact(r,"trace-stderr"),home:await s.artifact(r,"agent-home"),userId:await Re(e)});await i(u,{recursive:true});let P=[];for(let S of Object.keys(k).sort()){let b=l(u,...S.split("/"));await i(c(b),{recursive:true}),await o(b,k[S]),P.push(S),n||t.out(S);}return n?t.out(JSON.stringify({path:u,saved:P})):t.out(`Saved ${u}`),0}async function Re(e){try{return (await ta$1(g(e)).status()).user_id}catch{return null}}async function Ur(e,t){let s=qa$1(g(e)),n=e.flags.json===true,a=x(e);e.flags.type!==void 0&&(a.type=String(e.flags.type)),e.flags.grep!==void 0&&(a.grep=String(e.flags.grep)),e.flags.tail!==void 0&&(a.tail=e.flags.tail);let r=0;for await(let i of s.traceEvents(await y(e,"trial",e.positionals[0]),a))D(t,n,i),r+=1;return !n&&r===0&&t.out("No trace events."),0}async function Fr(e,t){let s=pa$1(g(e)),n=await y(e,"job",e.positionals[0]),a=x(e);e.flags.type!==void 0&&(a.type=String(e.flags.type));let r=await s.grep(n,e.positionals[1],a);if(e.flags.json===true)return t.out(JSON.stringify(r)),0;if(r.items.length===0)return t.out("No matches."),0;for(let i of r.items){let o=i.match_count===1?"match":"matches";t.out(`${i.trial_id} ${i.task_name??"-"} ${i.match_count} ${o}`);for(let l of i.events){let c=Zs(l);c!==null&&t.out(` ${c}`);}}return r.hasMore&&r.nextCursor&&(t.out(""),t.out(`More trials match \u2014 resume with --cursor ${r.nextCursor}`)),0}async function Mr(e,t){let s=await qa$1(g(e)).retry(await y(e,"trial",e.positionals[0]));if(e.flags.json===true)t.out(JSON.stringify(s));else {for(let n of L(s))t.out(n);t.out(""),t.out(`Follow it with: evolve job show ${s.id}`);}return 0}async function zr(e,t){let s=await qa$1(g(e)).regrade(await y(e,"trial",e.positionals[0]));if(e.flags.json===true)t.out(JSON.stringify(s));else {for(let n of L(s))t.out(n);t.out(""),t.out(`Follow it with: evolve job show ${s.id}`);}return 0}async function qr(e){let t=await y(e,"trial",e.positionals[0]);return {fs:qa$1(g(e)).filesystem(t),label:t,pathAt:1}}async function Kr(e){let t=await y(e,"analysis",e.positionals[0]);return {fs:ra$1(g(e)).filesystem(t),label:t,pathAt:1}}async function Gr(e){let t=await y(e,"task check",e.positionals[0]),s=sa$1(g(e)),n=await s.task(t);return {fs:s.taskFilesystem(n.check_id,t),label:t,pathAt:1}}async function Vr(e){let[t,s]=e.positionals,n=ma$1(g(e)),a;try{a=n.taskFiles(t,s);}catch(r){throw new f(r instanceof Error?r.message:String(r))}return {fs:a,label:`${t}/${s}`,pathAt:2}}function pe(e){let t=e.flags.source;if(t!==void 0){if(t!=="live"&&t!=="capture")throw new f("--source must be live or capture");return t}}function Cs(e,t){(e.bytes??(s=>process.stdout.write(s)))(t);}function Hr(e){let t=[["state",e.state],["box",e.box?`${e.box.provider} ${e.box.id} (${e.box.role}, since ${e.box.since})`:"-"],["watcher",e.watcher??"-"],["work dir",e.work_dir]];if(e.capture){let s=e.capture;t.push(["capture",`${s.status} \xB7 ${s.phase} \xB7 ${s.entries} entries \xB7 ${s.changed_files} changed (${B(s.changed_bytes)}) \xB7 ${s.at}`]),s.left_out.length>0&&t.push(["left out",s.left_out.join(", ")]);}return t.map(([s,n])=>`${s.padEnd(10)} ${n}`)}function Wr(e){let t=[e.changed?`${e.changed}${e.phase?` (${e.phase})`:""}`:"",e.captured===false?"image only":""].filter(Boolean).join(", "),s=e.type==="dir"?`${e.name}/`:e.target?`${e.name} -> ${e.target}`:e.name;return `${e.type.padEnd(7)} ${e.mode.padEnd(5)} ${B(e.size).padStart(8)} ${e.mtime} ${s}${t?` [${t}]`:""}`}function Le(e){let t=s=>s.flags.json===true;return {async status(s,n){let{fs:a}=await e(s),r=await a.status();if(t(s))n.out(JSON.stringify(r));else for(let i of Hr(r))n.out(i);return 0},async list(s,n){let{fs:a,pathAt:r}=await e(s),i=await a.list({path:s.positionals[r]??"/",source:pe(s),...x(s)});if(t(s))return n.out(JSON.stringify(i)),0;for(let o of i.entries)n.out(Wr(o));return i.entries.length===0&&n.out(`(empty) ${i.path}`),i.next_cursor!==null&&n.out(`\u2026 more: --cursor ${i.next_cursor}`),0},async cat(s,n){let{fs:a,pathAt:r}=await e(s),i=s.positionals[r];if(i===void 0)throw new f("cat needs a <path>");let o=s.flags.range!==void 0?Br(String(s.flags.range)):void 0,l=await a.read(i,{source:pe(s),range:o});return t(s)?n.out(JSON.stringify({path:i,bytes:l.length,encoding:"base64",data:l.toString("base64")})):Cs(n,l),0},async search(s,n){let{fs:a,pathAt:r}=await e(s);if(!a.search)throw new f("this owner has no search");let i=s.positionals[r];if(i===void 0)throw new f("search needs the text to find");let o=await a.search({q:i,path:s.flags.path!==void 0?String(s.flags.path):void 0,regex:s.flags.regex===true,limit:s.flags.limit!==void 0?s.flags.limit:void 0,source:pe(s)});if(t(s))return n.out(JSON.stringify(o)),0;for(let l of o.hits)n.out(`${l.path}:${l.line}: ${l.snippet}`);return o.hits.length===0&&n.out("No hits."),o.truncated&&n.out("(truncated \u2014 narrow the path or the text)"),o.image_files_excluded&&n.out("(files the run never touched were not searched)"),0},async changes(s,n){let{fs:a}=await e(s);if(!a.changes)throw new f("this owner has no change list");let r=s.flags.phase!==void 0?String(s.flags.phase):void 0;if(r!==void 0&&!["setup","agent","verifier","all"].includes(r))throw new f("--phase must be setup, agent, verifier or all");let i=await a.changes({source:pe(s),phase:r,...x(s)});if(t(s))return n.out(JSON.stringify(i)),0;n.out(`${i.total} changed (${B(i.changed_bytes)}), ${i.source}`);for(let o of i.items)n.out(`${o.changed.padEnd(8)} ${o.phase.padEnd(8)} ${B(o.size).padStart(8)} ${o.path}`);return i.next_cursor!==null&&n.out(`\u2026 more: --cursor ${i.next_cursor}`),0},async archive(s,n){let{fs:a,label:r}=await e(s);if(!a.archive)throw new f("this owner has no archive");let i={path:s.flags.path!==void 0?String(s.flags.path):void 0,source:pe(s)},o=s.flags["output-dir"];if(o!==void 0){let c=await a.archive({...i,to:String(o)});return n.out(t(s)?JSON.stringify({saved:c}):c),0}let l=await a.archive(i);return t(s)?n.out(JSON.stringify({label:r,bytes:l.length,encoding:"base64",data:l.toString("base64")})):Cs(n,l),0},async logs(s,n){let{fs:a}=await e(s);if(!a.logs||!a.logEvents)throw new f("this owner has no sandbox logs");let r=String(s.flags.stream??"");if(!O.includes(r))throw new f(`--stream must be one of: ${O.join(", ")}`);let i=l=>{t(s)?n.out(JSON.stringify(l)):n.out(`${l.t??"-"} ${l.fd==="err"?"!":" "} ${l.line}`);};if(s.flags.follow===true){let l=s.flags.cursor!==void 0?`${r}:${s.flags.cursor}`:void 0;for await(let c of a.logEvents({lastEventId:l}))c.event==="line"&&c.data.stream===r&&i(c.data);return 0}let o=await a.logs({stream:r,...x(s)});if(t(s))return n.out(JSON.stringify(o)),0;for(let l of o.lines)i(l);return o.lines.length===0&&n.out("No lines."),o.next_cursor!==null&&n.out(`\u2026 more: --cursor ${o.next_cursor}`),0},async procs(s,n){let{fs:a}=await e(s);if(!a.procs)throw new f("this owner has no process list");let r=await a.procs();return n.out(t(s)?JSON.stringify(r):r.text),0}}}function Br(e){let t=/^bytes=(\d*)-(\d*)$/.exec(e.trim());if(!t||t[1]===""&&t[2]==="")throw new f("--range must be bytes=start-end, bytes=start- or bytes=-suffix");return t[1]===""?{suffix:Number(t[2])}:t[2]===""?{start:Number(t[1])}:{start:Number(t[1]),end:Number(t[2])}}var q=Le(qr),K=Le(Kr),G=Le(Gr),it=Le(Vr);async function Yr(e,t){let s=qa$1(g(e)),n=[];for(let r of e.positionals)n.push(await y(e,"trial",r));let a=await s.stop(n);if(e.flags.json===true)return t.out(JSON.stringify(a)),0;for(let r of a.stopped)t.out(`stopped ${r.id} (${r.task_name}) ${r.status}`);for(let r of a.stopped_analyses)t.out(`stopped analysis ${r.id} ${r.status}`);for(let r of a.already_terminal)t.out(`already terminal ${r}`);for(let r of a.not_found)t.out(`not found ${r}`);return 0}function Xr(e){if(typeof e.estimated_cost_usd=="number")return `$${e.estimated_cost_usd.toFixed(4)}`;let t=e.usage?.spent_usd;return typeof t=="number"&&e.usage?.provisional?`at least $${t.toFixed(4)}`:"-"}var Ns=[{key:"id",header:"ID",cell:e=>e.id},{key:"status",header:"STATUS",cell:e=>e.status},{key:"task",header:"TASK",cell:e=>e.task_name},{key:"job",header:"JOB",cell:e=>e.job_id},{key:"trial",header:"TRIAL",cell:e=>e.trial_id},{key:"model",header:"MODEL",cell:e=>e.model_name},{key:"attempts",header:"ATTEMPTS",cell:e=>String(e.attempts??1)},{key:"spent",header:"SPENT",cell:Xr},{key:"created",header:"CREATED",cell:e=>e.created_at},{key:"finished",header:"FINISHED",cell:e=>e.finished_at??"-"}],Qr=["id","status","task","model","spent","created"];async function Zr(e,t){if(C(e,t,Ns))return 0;let s=te(e),n=Za(e),a=e.flags.job!==void 0?await y(e,"job",String(e.flags.job)):void 0,i=await ra$1(g(e)).list({...x(e),...s!==void 0?{scope:s}:{},...a!==void 0?{job:a}:{},...n!==void 0?{status:n}:{}});return e.flags.json===true?(t.out(JSON.stringify(i)),0):i.items.length===0?(e.flags.quiet!==true&&t.out("No analyses."),0):(T(e,t,i.items,Ns,Qr,o=>o.id),i.nextCursor&&t.tty===true&&e.flags.quiet!==true&&t.out(`
|
|
43
|
-
More: evolve analysis list --cursor ${i.nextCursor}`),0)}async function ei(e,t){let s=ra$1(g(e)),n=await ht(s,await jt(e,s,e.positionals[0]));if(e.flags.json===true)t.out(JSON.stringify(n));else for(let a of La(n))t.out(a);return 0}async function ti(e,t){let s=ra$1(g(e)),n=e.flags.json===true,a=e.flags.since,r=await s.transcript((await jt(e,s,e.positionals[0])).id,a!==void 0?{since:a}:void 0);for(let i of r.events)D(t,n,i);for(let i of r.gateway_calls)D(t,n,i);return !n&&r.events.length===0&&t.out("No trace events."),0}var Rs=["analysis","trace-parsed",...P];async function si(e,t){let s=ra$1(g(e)),n=e.flags.json===true,a=e.flags.stream;if(a!==void 0&&(e.flags["output-dir"]!==void 0||e.flags.overwrite===true))throw new f('"analysis download" takes EITHER --stream OR -o/--overwrite, not both');if((a===void 0||a!=="trace-parsed")&&e.flags.since!==void 0)throw new f("--since pages the parsed events; it applies only to --stream trace-parsed");let r=await jt(e,s,e.positionals[0]),i=r.id;if(a!==void 0){if(!Rs.includes(a))throw new f(`--stream must be one of: ${Rs.join(", ")}`);if(a==="analysis"){let l=await ht(s,r);return t.out(n?JSON.stringify({analysis:l}):JSON.stringify(l,null,2)),0}if(a==="trace-parsed"){let l=e.flags.since,c=await s.transcript(i,l!==void 0?{since:l}:void 0);for(let u of c.events)D(t,n,u);for(let u of c.gateway_calls)D(t,n,u);return !n&&c.events.length===0&&t.out("No trace events."),0}if(a==="agent-home"){let l=await s.artifact(i,a);if(l===null)return t.out(n?JSON.stringify({files:null}):`No ${a} content was stored for this analysis.`),0;if(n)t.out(JSON.stringify({files:l}));else for(let[c,u]of Object.entries(l))t.out(`===== ${c} (${Buffer.byteLength(u,"utf8")} bytes) =====`),t.out(u);return 0}let o=await s.artifact(i,a);return o===null?(t.out(n?JSON.stringify({log:null}):`No ${a} log was stored for this analysis.`),0):(t.out(n?JSON.stringify({log:o}):o),0)}return cn(e,t,{fetch:o=>s.download(i,{to:o}),outputDir:e.flags["output-dir"]??"analyses",scratchPrefix:"evolve-analysis-download-",enrich:async o=>{let{join:l}=await import('path'),c=await ht(s,r);return await yt(l(o,"evolve.json"),ea$1(c,await Re(e))),["evolve.json"]}})}function ni(e){switch(e.kind){case "git":{let t=e.ref===e.commit?"":` @ ${e.ref}`;return [`source: ${e.git_url??"?"}${t} (commit ${e.commit.slice(0,12)})`,...e.path?[` subfolder: ${e.path}`]:[]]}case "archive":return [`source: uploaded archive (${W(e.digest)})`];case "archive_url":return [`source: ${e.archive_url} (${W(e.digest)})`];case "hub_package":return [`source: hub:${e.hub_package} (${W(e.digest)})`]}}function ai(e){return e.kind==="git"?e.commit.slice(0,12):W(e.digest)}function gn(e){let t=v([["name",e.name],["title",e.title??"-"],["description",e.description??"-"],["active version",e.active_version?.version??"-"]]),s=e.selected_version?.source??e.active_version?.source??null;if(s)t.push(...ni(s));else if(e.upstream){let a=e.upstream,r=a.ref===a.current_commit?"":` @ ${a.ref}`;t.push(`source: ${a.git_url??"?"}${r} (commit ${a.current_commit.slice(0,12)})`),a.path&&t.push(` subfolder: ${a.path}`);}let n=e.active_version?.manifest;if(n&&(t.push(`manifest: ${n.name}${n.version?`@${n.version}`:""}`+(n.task_count!==null?` (${n.task_count} tasks pinned)`:"")),n.authors.length>0&&t.push(` authors: ${n.authors.map(a=>a.email?`${a.name} <${a.email}>`:a.name).join(", ")}`),n.keywords.length>0&&t.push(` keywords: ${n.keywords.join(", ")}`)),e.versions&&e.versions.length>0){t.push("");let a=e.versions.some(o=>o.source!=null),r=e.versions.some(o=>o.n_failed_tasks>0),i=[["VERSION","STATE","TASKS",...r?["FAILED"]:[],"CREATED",...a?["SOURCE"]:[]]];for(let o of e.versions)i.push([o.version,o.state,String(o.task_count),...r?[o.n_failed_tasks>0?String(o.n_failed_tasks):"-"]:[],o.created_at??"-",...a?[o.source?ai(o.source):"-"]:[]]);t.push(...v(i));}if(e.tasks&&e.tasks.items.length>0){t.push("",`Tasks (version ${e.selected_version?.version??"?"}):`);let a=e.tasks.items.some(l=>(l.gpus??0)>0),r=e.tasks.items.some(l=>(l.notes??[]).length>0),i=[["TASK","AGENT TIMEOUT","VERIFIER TIMEOUT",...a?["GPU"]:[],"PROVIDERS",...r?["NOTES"]:[]]];for(let l of e.tasks.items)i.push([l.task_name,`${l.agent_timeout_sec}s`,`${l.verifier_timeout_sec}s`,...a?[Ja(l)??"-"]:[],Da(l.providers),...r?[(l.notes??[]).map(c=>c.code).join(", ")||"-"]:[]]);if(t.push(...v(i)),r){let l=new Map;for(let c of e.tasks.items)for(let u of c.notes??[]){let d=l.get(u.message)??{code:u.code,tasks:[]};d.tasks.push(c.task_name),l.set(u.message,d);}t.push("","Task notes:");for(let[c,u]of l)t.push(` ${u.code} (${u.tasks.length} task${u.tasks.length===1?"":"s"}): ${c}`);}e.tasks.nextCursor&&t.push(`More tasks: evolve dataset show ${e.name} --cursor ${e.tasks.nextCursor}`);let o=new Map;for(let l of e.tasks.items)for(let c of Qs){let u=l.providers?.[c];if(u){if(!u.ok)o.has(`${c}:${u.reason}`)||o.set(`${c}:${u.reason}`,`${c}: ${u.reason}`);else if(u.degrades_to&&u.reason){let d=`${c}:degrade:${u.reason}`;o.has(d)||o.set(d,`${c}: runs on ${u.degrades_to} \u2014 ${u.reason}`);}}}if(o.size>0){t.push("","Provider limitations:");for(let l of o.values())t.push(` ${l}`);}}return t.push(...ri(e)),t}function ri(e){let t=e.failed_tasks??[],s=e.selected_version??e.active_version??null,n=s?.n_failed_tasks??t.length;if(t.length===0&&n===0)return [];let a=["",`Failed tasks (version ${s?.version??"?"}) \u2014 not runnable in this version:`],r=[];for(let i of t)r.push([` ${i.task_name}`,`${i.failure.code} (${i.failure.step}): ${i.failure.message}`]);return a.push(...v(r)),n>t.length&&a.push(` \u2026 ${n-t.length} more (${n} failed in total)`),a.push(" Fix: re-publish a new version \u2014 versions are immutable."),a}function mn(e){let t=[];for(let s of e){if(!s.upstream?.moved)continue;let n=s.active_version?`@${s.active_version.version}`:"",a=s.upstream.latest_commit??s.upstream.ref,r=s.upstream.git_url??"<url>",i=s.upstream.path?` --path ${s.upstream.path}`:"";t.push(`${s.name}${n} \xB7 upstream ${s.upstream.ref} moved \u2014 run: evolve dataset publish --name ${s.name} --version <new-version> --git ${r} --ref ${a}${i}`);}return t}async function ii(e,t){if(C(e,t,ms))return 0;let n=await ma$1(g(e)).list({...x(e),...e.flags.search!==void 0?{search:String(e.flags.search)}:{}});if(e.flags.json===true)return t.out(JSON.stringify(n)),0;if(n.items.length===0)return e.flags.quiet!==true&&t.out("No datasets."),0;if(T(e,t,n.items,ms,Ea,a=>a.name),e.flags.quiet!==true)for(let a of mn(n.items))t.out(a);return 0}async function oi(e,t){let n=await ma$1(g(e)).get(e.positionals[0],x(e));if(e.flags.json===true)t.out(JSON.stringify(n));else {for(let a of gn(n))t.out(a);for(let a of mn([n]))t.out(a);}return 0}function kt(e){let t=[`Pre-flight (importer ${e.importer_version}): ${e.tasks_total} task${e.tasks_total===1?"":"s"} \u2014 ${e.tasks_ok} ok, ${e.tasks_refused} refused`];e.manifest!==null&&e.manifest.ok===false&&t.push(` dataset.toml REFUSED: ${e.manifest.reason}`);for(let s of e.tasks){if(!s.ok){t.push(` ${s.name} REFUSED: ${s.reason}`);continue}let n=Object.entries(s.providers??{}).filter(([,a])=>a.ok!==true||"degrades_to"in a).map(([a,r])=>r.ok?`${a}: runs via ${r.degrades_to}`:`${a}: ${r.reason}`);n.length>0&&t.push(` ${s.name}: ${n.join(" \xB7 ")}`);for(let a of s.notes??[])t.push(` ${s.name} NOTE ${a.code}: ${a.message}`);}return t.push(`Checked from task.toml alone; the import also checks: ${e.deferred.map(s=>s.name).join(", ")}.`),t}async function li(e,t){let n=await ma$1(g(e)).preflight({source:{directory:e.positionals[0]}});if(e.flags.json===true)t.out(JSON.stringify(n));else for(let r of kt(n))t.out(r);let a=n.manifest!==null&&n.manifest.ok===false;return n.tasks_refused>0||a?1:0}async function ui(e,t){let s=e.flags.json===true,n=ma$1(g(e)),a=Je(_a(e),e);if(a.source.directory!==void 0&&e.flags["skip-preflight"]!==true){let u=null;try{u=await n.preflight({source:{directory:a.source.directory}});}catch(d){if(d instanceof ha$1&&d.status===404)t.err("Pre-flight unavailable on this server \u2014 publishing without it.");else throw d}if(u!==null){let d=u.manifest!==null&&u.manifest.ok===false;if(u.tasks_refused>0||d){if(s)t.out(JSON.stringify({kind:"preflight.refused",preflight:u}));else {for(let p of kt(u))t.out(p);t.out(""),t.out("Nothing was uploaded. Fix the refused tasks, or pass --skip-preflight to publish anyway (a refused task then lands FAILED at import).");}return 1}if(s)e.flags.watch===true&&t.out(JSON.stringify({kind:"preflight.ok",preflight:u}));else for(let p of kt(u))t.out(p);}}let r=u=>{if(s){e.flags.watch===true&&t.out(JSON.stringify({kind:"import.registered",import_id:u}));return}t.out(`Registered import ${u} \u2014 re-attach anytime with: evolve dataset watch ${u}`);},i=Date.now(),o=-1,l=(u,d)=>{let p=d>0?Math.floor(u/d*10):10;if(!(p<=o)){if(o=p,s){t.out(JSON.stringify({kind:"upload.progress",sent_bytes:u,total_bytes:d,elapsed_sec:(Date.now()-i)/1e3}));return}t.out(`upload ${B(u)}/${B(d)} (${Math.min(p*10,100)}%)`);}},c=await n.publish(a,{onRegistered:r,...s&&e.flags.watch!==true?{}:{onUploadProgress:l}});if(e.flags.watch!==true){if(s)t.out(JSON.stringify(c));else {for(let u of tn(c))t.out(u);t.out(""),t.out(`Follow it with: evolve dataset show ${c.name}`);}return 0}return hn(n,c,t,s,"created")}async function hn(e,t,s,n,a){n?s.out(JSON.stringify({kind:`import.${a}`,datasetImport:t})):s.out(a==="created"?`Publish ${t.id} (${t.name}) ${t.status} \u2014 watching\u2026`:`Import ${t.id} (${t.name}@${t.version}) ${It(t)} \u2014 watching\u2026`);let r=null,i=null,o=new Set,l=d=>{for(let p of d.failed_tasks??[])o.has(p.task_name)||(o.add(p.task_name),s.out(n?JSON.stringify({kind:"task.failed",task:p}):fi(p)));},c;try{c=await e.watchImport(t.id,{onStatus:d=>{s.out(n?JSON.stringify({kind:"import.status",datasetImport:d}):Ma(d));},onProgress:d=>{s.out(n?JSON.stringify({kind:"import.progress",progress:d}):Ua(d));},onVersion:(d,p)=>{r=d,i=p,s.out(n?JSON.stringify({kind:"import.version",version:d}):za(d)),l(p);}});}catch(d){if(d instanceof ja$1)return n&&s.out(JSON.stringify({error:vn(d)})),s.err(`Error: ${d.message}`),s.err(`Follow it with: evolve dataset show ${d.dataset}@${d.version}`),1;throw d}let u=r;if(u!==null&&u.n_failed_tasks>0)try{let d=await e.get(`${c.name}@${c.version}`);i=d,l(d);}catch{}if(n)s.out(JSON.stringify({kind:"import.final",datasetImport:c}));else {s.out("");for(let d of tn(c))s.out(d);if(c.progress!==null)for(let d of Fa(c.progress))s.out(d);if(r!==null){for(let d of qa(r,i))s.out(d);for(let d of di(r,c))s.out(d);}}return c.status==="FAILED"?1:0}async function ci(e,t){let s=e.flags.json===true,n=ma$1(g(e)),a=e.positionals[0],r=null;try{r=await n.getImport(a);}catch(i){if(!(i instanceof ha$1&&i.status===404))throw i}if(r===null){let o=(await n.listImports({dataset:a,limit:50})).items;if(r=o.find(l=>l.status==="QUEUED"||l.status==="RUNNING")??null,r===null){let l=o[0],c=l!==void 0?`its newest import ${l.id} is ${l.status} \u2014 see it with: evolve dataset show ${a}`:"no import id and no dataset of yours carries that name",u=`Nothing to watch for "${a}": ${c}`;return s&&t.out(JSON.stringify({error:{code:"nothing_to_watch",message:u}})),t.err(`Error: ${u}`),1}}try{return await hn(n,r,t,s,"attached")}catch(i){if(i instanceof ha$1&&i.code==="import_not_found"){let o=`Import ${r.id} no longer exists \u2014 its upload was abandoned or refused before the corpus arrived, so the publish never happened. Re-run the publish to start a new one.`;return s&&t.out(JSON.stringify({error:{code:"import_not_found",message:o}})),t.err(`Error: ${o}`),1}throw i}}function di(e,t){if(e.n_failed_tasks<=0)return [];let s=e.task_count+e.n_failed_tasks;return [`built ${e.task_count} of ${s} tasks \u2014 ${e.n_failed_tasks} failed to build`,`Reasons: evolve dataset show ${t.name}@${t.version}`,"Fix: re-publish a new version \u2014 versions are immutable."]}function fi(e){return `task ${e.task_name} FAILED \u2014 ${e.failure.code} (${e.failure.step}): ${ee(e.failure.message,140)}`}async function pi(e,t){let n=await ma$1(g(e)).download(e.positionals[0],{to:e.flags["output-dir"]??process.cwd()});return e.flags.json===true?t.out(JSON.stringify({path:n})):t.out(`Saved ${n}`),0}async function gi(e,t){let s=ma$1(g(e)),[n,a]=e.positionals,r=await s.activate(n,a);if(e.flags.json===true)t.out(JSON.stringify(r));else for(let i of gn(r))t.out(i);return 0}function yn(e){let t=[["name",e.name],["id",e.id],["org",e.org??"-"],["ref",e.ref],["digest",e.digest],["size",B(e.size_bytes)]];return e.description&&t.push(["description",e.description]),t.push(["created",e.created_at]),v(t)}async function mi(e,t){if(C(e,t,hs))return 0;let s=oa$1(g(e)),n=te(e),a=await s.list({...x(e),...n!==void 0?{scope:n}:{}});return e.flags.json===true?(t.out(JSON.stringify(a)),0):a.items.length===0?(e.flags.quiet!==true&&t.out("No uploaded skills."),0):(T(e,t,a.items,hs,Ta,r=>r.id),a.nextCursor&&t.tty===true&&e.flags.quiet!==true&&t.out(`
|
|
42
|
+
More: evolve job imports --cursor ${a.nextCursor}`),0)}async function Lr(e,t){let n=await pa$1(g(e)).getImport(e.positionals[0]);if(e.flags.watch===true)return pn(e,n,t,"attached");if(e.flags.json===true)return t.out(JSON.stringify(n)),0;for(let a of dn(n))t.out(a);return 0}async function Dr(e,t){let n=await qa$1(g(e)).get(await y(e,"trial",e.positionals[0]));if(e.flags.json===true)t.out(JSON.stringify(n));else for(let a of Ra(n))t.out(a);return 0}var Ts=N;async function Jr(e,t){let s=qa$1(g(e)),n=e.flags.json===true,a=e.flags.stream;if(a!==void 0&&(e.flags["output-dir"]!==void 0||e.flags.overwrite===true))throw new f('"trial download" takes EITHER --stream OR -o/--overwrite, not both');if((a===void 0||a!=="trace-parsed")&&(e.flags.cursor!==void 0||e.flags.limit!==void 0))throw new f("--cursor/--limit page the parsed events; they apply only to --stream trace-parsed");let r=await y(e,"trial",e.positionals[0]);if(a!==void 0){if(!Ts.includes(a))throw new f(`--stream must be one of: ${Ts.join(", ")}`);if(a==="trace-parsed"){let b=0;for await(let _ of s.traceEvents(r,x(e)))D(t,n,_),b+=1;return !n&&b===0&&t.out("No trace events."),0}if(a==="agent-home"){let b=await s.artifact(r,a);if(b===null)return t.out(n?JSON.stringify({files:null}):`No ${a} content was stored for this trial.`),0;if(n)t.out(JSON.stringify({files:b}));else for(let[_,h]of Object.entries(b))t.out(`===== ${_} (${Buffer.byteLength(h,"utf8")} bytes) =====`),t.out(h);return 0}if(a==="filesystem"){let b=await s.filesystem(r).archive();return n?t.out(JSON.stringify({stream:"filesystem",bytes:b.length,encoding:"base64",data:b.toString("base64")})):(t.bytes??(_=>process.stdout.write(_)))(b),0}let S=await s.artifact(r,a);return S===null?(t.out(n?JSON.stringify({log:null}):`No ${a} log was stored for this trial.`),0):(t.out(n?JSON.stringify({log:S}):S),0)}let{mkdir:i,writeFile:o}=await import('fs/promises'),{join:l,dirname:c}=await import('path'),u=l(e.flags["output-dir"]??"trials",r);if(existsSync(u)&&e.flags.overwrite!==true)throw new Error(`${u} already exists (pass --overwrite to replace it)`);let d=await s.get(r),p=null;try{p=await pa$1(g(e)).get(d.job_id);}catch{p=null;}let m=[];for await(let S of s.traceEvents(r))m.push(S);let k=da$1({trial:d,job:p,events:m,atif:await s.artifact(r,"trace-atif"),verifierLog:await s.artifact(r,"verifier"),stdout:await s.artifact(r,"trace-stdout"),stderr:await s.artifact(r,"trace-stderr"),home:await s.artifact(r,"agent-home"),userId:await Re(e)});await i(u,{recursive:true});let P=[];for(let S of Object.keys(k).sort()){let b=l(u,...S.split("/"));await i(c(b),{recursive:true}),await o(b,k[S]),P.push(S),n||t.out(S);}return n?t.out(JSON.stringify({path:u,saved:P})):t.out(`Saved ${u}`),0}async function Re(e){try{return (await ta$1(g(e)).status()).user_id}catch{return null}}async function Ur(e,t){let s=qa$1(g(e)),n=e.flags.json===true,a=x(e);e.flags.type!==void 0&&(a.type=String(e.flags.type)),e.flags.grep!==void 0&&(a.grep=String(e.flags.grep)),e.flags.tail!==void 0&&(a.tail=e.flags.tail);let r=0;for await(let i of s.traceEvents(await y(e,"trial",e.positionals[0]),a))D(t,n,i),r+=1;return !n&&r===0&&t.out("No trace events."),0}async function Fr(e,t){let s=pa$1(g(e)),n=await y(e,"job",e.positionals[0]),a=x(e);e.flags.type!==void 0&&(a.type=String(e.flags.type));let r=await s.grep(n,e.positionals[1],a);if(e.flags.json===true)return t.out(JSON.stringify(r)),0;if(r.items.length===0)return t.out("No matches."),0;for(let i of r.items){let o=i.match_count===1?"match":"matches";t.out(`${i.trial_id} ${i.task_name??"-"} ${i.match_count} ${o}`);for(let l of i.events){let c=Zs(l);c!==null&&t.out(` ${c}`);}}return r.hasMore&&r.nextCursor&&(t.out(""),t.out(`More trials match \u2014 resume with --cursor ${r.nextCursor}`)),0}async function Mr(e,t){let s=await qa$1(g(e)).retry(await y(e,"trial",e.positionals[0]));if(e.flags.json===true)t.out(JSON.stringify(s));else {for(let n of L(s))t.out(n);t.out(""),t.out(`Follow it with: evolve job show ${s.id}`);}return 0}async function zr(e,t){let s=await qa$1(g(e)).regrade(await y(e,"trial",e.positionals[0]));if(e.flags.json===true)t.out(JSON.stringify(s));else {for(let n of L(s))t.out(n);t.out(""),t.out(`Follow it with: evolve job show ${s.id}`);}return 0}async function qr(e){let t=await y(e,"trial",e.positionals[0]);return {fs:qa$1(g(e)).filesystem(t),label:t,pathAt:1}}async function Kr(e){let t=await y(e,"analysis",e.positionals[0]);return {fs:ra$1(g(e)).filesystem(t),label:t,pathAt:1}}async function Gr(e){let t=await y(e,"task check",e.positionals[0]),s=sa$1(g(e)),n=await s.task(t);return {fs:s.taskFilesystem(n.check_id,t),label:t,pathAt:1}}async function Vr(e){let[t,s]=e.positionals,n=ma$1(g(e)),a;try{a=n.taskFiles(t,s);}catch(r){throw new f(r instanceof Error?r.message:String(r))}return {fs:a,label:`${t}/${s}`,pathAt:2}}function pe(e){let t=e.flags.source;if(t!==void 0){if(t!=="live"&&t!=="capture")throw new f("--source must be live or capture");return t}}function Cs(e,t){(e.bytes??(s=>process.stdout.write(s)))(t);}function Hr(e){let t=[["state",e.state],["box",e.box?`${e.box.provider} ${e.box.id} (${e.box.role}, since ${e.box.since})`:"-"],["watcher",e.watcher??"-"],["work dir",e.work_dir]];if(e.capture){let s=e.capture;t.push(["capture",`${s.status} \xB7 ${s.phase} \xB7 ${s.entries} entries \xB7 ${s.changed_files} changed (${B(s.changed_bytes)}) \xB7 ${s.at}`]),s.left_out.length>0&&t.push(["left out",s.left_out.join(", ")]);}return t.map(([s,n])=>`${s.padEnd(10)} ${n}`)}function Wr(e){let t=[e.changed?`${e.changed}${e.phase?` (${e.phase})`:""}`:"",e.captured===false?"image only":""].filter(Boolean).join(", "),s=e.type==="dir"?`${e.name}/`:e.target?`${e.name} -> ${e.target}`:e.name;return `${e.type.padEnd(7)} ${e.mode.padEnd(5)} ${B(e.size).padStart(8)} ${e.mtime} ${s}${t?` [${t}]`:""}`}function Le(e){let t=s=>s.flags.json===true;return {async status(s,n){let{fs:a}=await e(s),r=await a.status();if(t(s))n.out(JSON.stringify(r));else for(let i of Hr(r))n.out(i);return 0},async list(s,n){let{fs:a,pathAt:r}=await e(s),i=await a.list({path:s.positionals[r]??"/",source:pe(s),...x(s)});if(t(s))return n.out(JSON.stringify(i)),0;for(let o of i.entries)n.out(Wr(o));return i.entries.length===0&&n.out(`(empty) ${i.path}`),i.next_cursor!==null&&n.out(`\u2026 more: --cursor ${i.next_cursor}`),0},async cat(s,n){let{fs:a,pathAt:r}=await e(s),i=s.positionals[r];if(i===void 0)throw new f("cat needs a <path>");let o=s.flags.range!==void 0?Br(String(s.flags.range)):void 0,l=await a.read(i,{source:pe(s),range:o});return t(s)?n.out(JSON.stringify({path:i,bytes:l.length,encoding:"base64",data:l.toString("base64")})):Cs(n,l),0},async search(s,n){let{fs:a,pathAt:r}=await e(s);if(!a.search)throw new f("this owner has no search");let i=s.positionals[r];if(i===void 0)throw new f("search needs the text to find");let o=await a.search({q:i,path:s.flags.path!==void 0?String(s.flags.path):void 0,regex:s.flags.regex===true,limit:s.flags.limit!==void 0?s.flags.limit:void 0,source:pe(s)});if(t(s))return n.out(JSON.stringify(o)),0;for(let l of o.hits)n.out(`${l.path}:${l.line}: ${l.snippet}`);return o.hits.length===0&&n.out("No hits."),o.truncated&&n.out("(truncated \u2014 narrow the path or the text)"),o.image_files_excluded&&n.out("(files the run never touched were not searched)"),0},async changes(s,n){let{fs:a}=await e(s);if(!a.changes)throw new f("this owner has no change list");let r=s.flags.phase!==void 0?String(s.flags.phase):void 0;if(r!==void 0&&!["setup","agent","verifier","all"].includes(r))throw new f("--phase must be setup, agent, verifier or all");let i=await a.changes({source:pe(s),phase:r,...x(s)});if(t(s))return n.out(JSON.stringify(i)),0;n.out(`${i.total} changed (${B(i.changed_bytes)}), ${i.source}`);for(let o of i.items)n.out(`${o.changed.padEnd(8)} ${o.phase.padEnd(8)} ${B(o.size).padStart(8)} ${o.path}`);return i.next_cursor!==null&&n.out(`\u2026 more: --cursor ${i.next_cursor}`),0},async archive(s,n){let{fs:a,label:r}=await e(s);if(!a.archive)throw new f("this owner has no archive");let i={path:s.flags.path!==void 0?String(s.flags.path):void 0,source:pe(s)},o=s.flags["output-dir"];if(o!==void 0){let c=await a.archive({...i,to:String(o)});return n.out(t(s)?JSON.stringify({saved:c}):c),0}let l=await a.archive(i);return t(s)?n.out(JSON.stringify({label:r,bytes:l.length,encoding:"base64",data:l.toString("base64")})):Cs(n,l),0},async logs(s,n){let{fs:a}=await e(s);if(!a.logs||!a.logEvents)throw new f("this owner has no sandbox logs");let r=String(s.flags.stream??"");if(!O.includes(r))throw new f(`--stream must be one of: ${O.join(", ")}`);let i=l=>{t(s)?n.out(JSON.stringify(l)):n.out(`${l.t??"-"} ${l.fd==="err"?"!":" "} ${l.line}`);};if(s.flags.follow===true){let l=s.flags.cursor!==void 0?`${r}:${s.flags.cursor}`:void 0;for await(let c of a.logEvents({lastEventId:l}))c.event==="line"&&c.data.stream===r&&i(c.data);return 0}let o=await a.logs({stream:r,...x(s)});if(t(s))return n.out(JSON.stringify(o)),0;for(let l of o.lines)i(l);return o.lines.length===0&&n.out("No lines."),o.next_cursor!==null&&n.out(`\u2026 more: --cursor ${o.next_cursor}`),0},async procs(s,n){let{fs:a}=await e(s);if(!a.procs)throw new f("this owner has no process list");let r=await a.procs();return n.out(t(s)?JSON.stringify(r):r.text),0}}}function Br(e){let t=/^bytes=(\d*)-(\d*)$/.exec(e.trim());if(!t||t[1]===""&&t[2]==="")throw new f("--range must be bytes=start-end, bytes=start- or bytes=-suffix");return t[1]===""?{suffix:Number(t[2])}:t[2]===""?{start:Number(t[1])}:{start:Number(t[1]),end:Number(t[2])}}var q=Le(qr),K=Le(Kr),G=Le(Gr),it=Le(Vr);async function Yr(e,t){let s=qa$1(g(e)),n=[];for(let r of e.positionals)n.push(await y(e,"trial",r));let a=await s.stop(n);if(e.flags.json===true)return t.out(JSON.stringify(a)),0;for(let r of a.stopped)t.out(`stopped ${r.id} (${r.task_name}) ${r.status}`);for(let r of a.stopped_analyses)t.out(`stopped analysis ${r.id} ${r.status}`);for(let r of a.already_terminal)t.out(`already terminal ${r}`);for(let r of a.not_found)t.out(`not found ${r}`);return 0}function Xr(e){if(typeof e.estimated_cost_usd=="number")return `$${e.estimated_cost_usd.toFixed(4)}`;let t=e.usage?.spent_usd;return typeof t=="number"&&e.usage?.provisional?`at least $${t.toFixed(4)}`:"-"}var Ns=[{key:"id",header:"ID",cell:e=>e.id},{key:"status",header:"STATUS",cell:e=>e.status},{key:"task",header:"TASK",cell:e=>e.task_name},{key:"job",header:"JOB",cell:e=>e.job_id},{key:"trial",header:"TRIAL",cell:e=>e.trial_id},{key:"agent",header:"AGENT",cell:e=>e.agent??"-"},{key:"model",header:"MODEL",cell:e=>e.model_name},{key:"attempts",header:"ATTEMPTS",cell:e=>String(e.attempts??1)},{key:"spent",header:"SPENT",cell:Xr},{key:"created",header:"CREATED",cell:e=>e.created_at},{key:"finished",header:"FINISHED",cell:e=>e.finished_at??"-"}],Qr=["id","status","task","agent","model","spent","created"];async function Zr(e,t){if(C(e,t,Ns))return 0;let s=te(e),n=Za(e),a=e.flags.job!==void 0?await y(e,"job",String(e.flags.job)):void 0,i=await ra$1(g(e)).list({...x(e),...s!==void 0?{scope:s}:{},...a!==void 0?{job:a}:{},...n!==void 0?{status:n}:{}});return e.flags.json===true?(t.out(JSON.stringify(i)),0):i.items.length===0?(e.flags.quiet!==true&&t.out("No analyses."),0):(T(e,t,i.items,Ns,Qr,o=>o.id),i.nextCursor&&t.tty===true&&e.flags.quiet!==true&&t.out(`
|
|
43
|
+
More: evolve analysis list --cursor ${i.nextCursor}`),0)}async function ei(e,t){let s=ra$1(g(e)),n=await mt(s,await jt(e,s,e.positionals[0]));if(e.flags.json===true)t.out(JSON.stringify(n));else for(let a of La(n))t.out(a);return 0}async function ti(e,t){let s=ra$1(g(e)),n=e.flags.json===true,a=e.flags.since,r=await s.transcript((await jt(e,s,e.positionals[0])).id,a!==void 0?{since:a}:void 0);for(let i of r.events)D(t,n,i);for(let i of r.gateway_calls)D(t,n,i);return !n&&r.events.length===0&&t.out("No trace events."),0}var Rs=["analysis","trace-parsed",...P];async function si(e,t){let s=ra$1(g(e)),n=e.flags.json===true,a=e.flags.stream;if(a!==void 0&&(e.flags["output-dir"]!==void 0||e.flags.overwrite===true))throw new f('"analysis download" takes EITHER --stream OR -o/--overwrite, not both');if((a===void 0||a!=="trace-parsed")&&e.flags.since!==void 0)throw new f("--since pages the parsed events; it applies only to --stream trace-parsed");let r=await jt(e,s,e.positionals[0]),i=r.id;if(a!==void 0){if(!Rs.includes(a))throw new f(`--stream must be one of: ${Rs.join(", ")}`);if(a==="analysis"){let l=await mt(s,r);return t.out(n?JSON.stringify({analysis:l}):JSON.stringify(l,null,2)),0}if(a==="trace-parsed"){let l=e.flags.since,c=await s.transcript(i,l!==void 0?{since:l}:void 0);for(let u of c.events)D(t,n,u);for(let u of c.gateway_calls)D(t,n,u);return !n&&c.events.length===0&&t.out("No trace events."),0}if(a==="agent-home"){let l=await s.artifact(i,a);if(l===null)return t.out(n?JSON.stringify({files:null}):`No ${a} content was stored for this analysis.`),0;if(n)t.out(JSON.stringify({files:l}));else for(let[c,u]of Object.entries(l))t.out(`===== ${c} (${Buffer.byteLength(u,"utf8")} bytes) =====`),t.out(u);return 0}let o=await s.artifact(i,a);return o===null?(t.out(n?JSON.stringify({log:null}):`No ${a} log was stored for this analysis.`),0):(t.out(n?JSON.stringify({log:o}):o),0)}return cn(e,t,{fetch:o=>s.download(i,{to:o}),outputDir:e.flags["output-dir"]??"analyses",scratchPrefix:"evolve-analysis-download-",enrich:async o=>{let{join:l}=await import('path'),c=await mt(s,r);return await ht(l(o,"evolve.json"),ea$1(c,await Re(e))),["evolve.json"]}})}function ni(e){switch(e.kind){case "git":{let t=e.ref===e.commit?"":` @ ${e.ref}`;return [`source: ${e.git_url??"?"}${t} (commit ${e.commit.slice(0,12)})`,...e.path?[` subfolder: ${e.path}`]:[]]}case "archive":return [`source: uploaded archive (${W(e.digest)})`];case "archive_url":return [`source: ${e.archive_url} (${W(e.digest)})`];case "hub_package":return [`source: hub:${e.hub_package} (${W(e.digest)})`]}}function ai(e){return e.kind==="git"?e.commit.slice(0,12):W(e.digest)}function gn(e){let t=v([["name",e.name],["title",e.title??"-"],["description",e.description??"-"],["active version",e.active_version?.version??"-"]]),s=e.selected_version?.source??e.active_version?.source??null;if(s)t.push(...ni(s));else if(e.upstream){let a=e.upstream,r=a.ref===a.current_commit?"":` @ ${a.ref}`;t.push(`source: ${a.git_url??"?"}${r} (commit ${a.current_commit.slice(0,12)})`),a.path&&t.push(` subfolder: ${a.path}`);}let n=e.active_version?.manifest;if(n&&(t.push(`manifest: ${n.name}${n.version?`@${n.version}`:""}`+(n.task_count!==null?` (${n.task_count} tasks pinned)`:"")),n.authors.length>0&&t.push(` authors: ${n.authors.map(a=>a.email?`${a.name} <${a.email}>`:a.name).join(", ")}`),n.keywords.length>0&&t.push(` keywords: ${n.keywords.join(", ")}`)),e.versions&&e.versions.length>0){t.push("");let a=e.versions.some(o=>o.source!=null),r=e.versions.some(o=>o.n_failed_tasks>0),i=[["VERSION","STATE","TASKS",...r?["FAILED"]:[],"CREATED",...a?["SOURCE"]:[]]];for(let o of e.versions)i.push([o.version,o.state,String(o.task_count),...r?[o.n_failed_tasks>0?String(o.n_failed_tasks):"-"]:[],o.created_at??"-",...a?[o.source?ai(o.source):"-"]:[]]);t.push(...v(i));}if(e.tasks&&e.tasks.items.length>0){t.push("",`Tasks (version ${e.selected_version?.version??"?"}):`);let a=e.tasks.items.some(l=>(l.gpus??0)>0),r=e.tasks.items.some(l=>(l.notes??[]).length>0),i=[["TASK","AGENT TIMEOUT","VERIFIER TIMEOUT",...a?["GPU"]:[],"PROVIDERS",...r?["NOTES"]:[]]];for(let l of e.tasks.items)i.push([l.task_name,`${l.agent_timeout_sec}s`,`${l.verifier_timeout_sec}s`,...a?[Ja(l)??"-"]:[],Da(l.providers),...r?[(l.notes??[]).map(c=>c.code).join(", ")||"-"]:[]]);if(t.push(...v(i)),r){let l=new Map;for(let c of e.tasks.items)for(let u of c.notes??[]){let d=l.get(u.message)??{code:u.code,tasks:[]};d.tasks.push(c.task_name),l.set(u.message,d);}t.push("","Task notes:");for(let[c,u]of l)t.push(` ${u.code} (${u.tasks.length} task${u.tasks.length===1?"":"s"}): ${c}`);}e.tasks.nextCursor&&t.push(`More tasks: evolve dataset show ${e.name} --cursor ${e.tasks.nextCursor}`);let o=new Map;for(let l of e.tasks.items)for(let c of Qs){let u=l.providers?.[c];if(u){if(!u.ok)o.has(`${c}:${u.reason}`)||o.set(`${c}:${u.reason}`,`${c}: ${u.reason}`);else if(u.degrades_to&&u.reason){let d=`${c}:degrade:${u.reason}`;o.has(d)||o.set(d,`${c}: runs on ${u.degrades_to} \u2014 ${u.reason}`);}}}if(o.size>0){t.push("","Provider limitations:");for(let l of o.values())t.push(` ${l}`);}}return t.push(...ri(e)),t}function ri(e){let t=e.failed_tasks??[],s=e.selected_version??e.active_version??null,n=s?.n_failed_tasks??t.length;if(t.length===0&&n===0)return [];let a=["",`Failed tasks (version ${s?.version??"?"}) \u2014 not runnable in this version:`],r=[];for(let i of t)r.push([` ${i.task_name}`,`${i.failure.code} (${i.failure.step}): ${i.failure.message}`]);return a.push(...v(r)),n>t.length&&a.push(` \u2026 ${n-t.length} more (${n} failed in total)`),a.push(" Fix: re-publish a new version \u2014 versions are immutable."),a}function mn(e){let t=[];for(let s of e){if(!s.upstream?.moved)continue;let n=s.active_version?`@${s.active_version.version}`:"",a=s.upstream.latest_commit??s.upstream.ref,r=s.upstream.git_url??"<url>",i=s.upstream.path?` --path ${s.upstream.path}`:"";t.push(`${s.name}${n} \xB7 upstream ${s.upstream.ref} moved \u2014 run: evolve dataset publish --name ${s.name} --version <new-version> --git ${r} --ref ${a}${i}`);}return t}async function ii(e,t){if(C(e,t,ms))return 0;let n=await ma$1(g(e)).list({...x(e),...e.flags.search!==void 0?{search:String(e.flags.search)}:{}});if(e.flags.json===true)return t.out(JSON.stringify(n)),0;if(n.items.length===0)return e.flags.quiet!==true&&t.out("No datasets."),0;if(T(e,t,n.items,ms,Ea,a=>a.name),e.flags.quiet!==true)for(let a of mn(n.items))t.out(a);return 0}async function oi(e,t){let n=await ma$1(g(e)).get(e.positionals[0],x(e));if(e.flags.json===true)t.out(JSON.stringify(n));else {for(let a of gn(n))t.out(a);for(let a of mn([n]))t.out(a);}return 0}function yt(e){let t=[`Pre-flight (importer ${e.importer_version}): ${e.tasks_total} task${e.tasks_total===1?"":"s"} \u2014 ${e.tasks_ok} ok, ${e.tasks_refused} refused`];e.manifest!==null&&e.manifest.ok===false&&t.push(` dataset.toml REFUSED: ${e.manifest.reason}`);for(let s of e.tasks){if(!s.ok){t.push(` ${s.name} REFUSED: ${s.reason}`);continue}let n=Object.entries(s.providers??{}).filter(([,a])=>a.ok!==true||"degrades_to"in a).map(([a,r])=>r.ok?`${a}: runs via ${r.degrades_to}`:`${a}: ${r.reason}`);n.length>0&&t.push(` ${s.name}: ${n.join(" \xB7 ")}`);for(let a of s.notes??[])t.push(` ${s.name} NOTE ${a.code}: ${a.message}`);}return t.push(`Checked from task.toml alone; the import also checks: ${e.deferred.map(s=>s.name).join(", ")}.`),t}async function li(e,t){let n=await ma$1(g(e)).preflight({source:{directory:e.positionals[0]}});if(e.flags.json===true)t.out(JSON.stringify(n));else for(let r of yt(n))t.out(r);let a=n.manifest!==null&&n.manifest.ok===false;return n.tasks_refused>0||a?1:0}async function ui(e,t){let s=e.flags.json===true,n=ma$1(g(e)),a=Je(_a(e),e);if(a.source.directory!==void 0&&e.flags["skip-preflight"]!==true){let u=null;try{u=await n.preflight({source:{directory:a.source.directory}});}catch(d){if(d instanceof ha$1&&d.status===404)t.err("Pre-flight unavailable on this server \u2014 publishing without it.");else throw d}if(u!==null){let d=u.manifest!==null&&u.manifest.ok===false;if(u.tasks_refused>0||d){if(s)t.out(JSON.stringify({kind:"preflight.refused",preflight:u}));else {for(let p of yt(u))t.out(p);t.out(""),t.out("Nothing was uploaded. Fix the refused tasks, or pass --skip-preflight to publish anyway (a refused task then lands FAILED at import).");}return 1}if(s)e.flags.watch===true&&t.out(JSON.stringify({kind:"preflight.ok",preflight:u}));else for(let p of yt(u))t.out(p);}}let r=u=>{if(s){e.flags.watch===true&&t.out(JSON.stringify({kind:"import.registered",import_id:u}));return}t.out(`Registered import ${u} \u2014 re-attach anytime with: evolve dataset watch ${u}`);},i=Date.now(),o=-1,l=(u,d)=>{let p=d>0?Math.floor(u/d*10):10;if(!(p<=o)){if(o=p,s){t.out(JSON.stringify({kind:"upload.progress",sent_bytes:u,total_bytes:d,elapsed_sec:(Date.now()-i)/1e3}));return}t.out(`upload ${B(u)}/${B(d)} (${Math.min(p*10,100)}%)`);}},c=await n.publish(a,{onRegistered:r,...s&&e.flags.watch!==true?{}:{onUploadProgress:l}});if(e.flags.watch!==true){if(s)t.out(JSON.stringify(c));else {for(let u of tn(c))t.out(u);t.out(""),t.out(`Follow it with: evolve dataset show ${c.name}`);}return 0}return hn(n,c,t,s,"created")}async function hn(e,t,s,n,a){n?s.out(JSON.stringify({kind:`import.${a}`,datasetImport:t})):s.out(a==="created"?`Publish ${t.id} (${t.name}) ${t.status} \u2014 watching\u2026`:`Import ${t.id} (${t.name}@${t.version}) ${It(t)} \u2014 watching\u2026`);let r=null,i=null,o=new Set,l=d=>{for(let p of d.failed_tasks??[])o.has(p.task_name)||(o.add(p.task_name),s.out(n?JSON.stringify({kind:"task.failed",task:p}):fi(p)));},c;try{c=await e.watchImport(t.id,{onStatus:d=>{s.out(n?JSON.stringify({kind:"import.status",datasetImport:d}):Ma(d));},onProgress:d=>{s.out(n?JSON.stringify({kind:"import.progress",progress:d}):Ua(d));},onVersion:(d,p)=>{r=d,i=p,s.out(n?JSON.stringify({kind:"import.version",version:d}):za(d)),l(p);}});}catch(d){if(d instanceof ja$1)return n&&s.out(JSON.stringify({error:vn(d)})),s.err(`Error: ${d.message}`),s.err(`Follow it with: evolve dataset show ${d.dataset}@${d.version}`),1;throw d}let u=r;if(u!==null&&u.n_failed_tasks>0)try{let d=await e.get(`${c.name}@${c.version}`);i=d,l(d);}catch{}if(n)s.out(JSON.stringify({kind:"import.final",datasetImport:c}));else {s.out("");for(let d of tn(c))s.out(d);if(c.progress!==null)for(let d of Fa(c.progress))s.out(d);if(r!==null){for(let d of qa(r,i))s.out(d);for(let d of di(r,c))s.out(d);}}return c.status==="FAILED"?1:0}async function ci(e,t){let s=e.flags.json===true,n=ma$1(g(e)),a=e.positionals[0],r=null;try{r=await n.getImport(a);}catch(i){if(!(i instanceof ha$1&&i.status===404))throw i}if(r===null){let o=(await n.listImports({dataset:a,limit:50})).items;if(r=o.find(l=>l.status==="QUEUED"||l.status==="RUNNING")??null,r===null){let l=o[0],c=l!==void 0?`its newest import ${l.id} is ${l.status} \u2014 see it with: evolve dataset show ${a}`:"no import id and no dataset of yours carries that name",u=`Nothing to watch for "${a}": ${c}`;return s&&t.out(JSON.stringify({error:{code:"nothing_to_watch",message:u}})),t.err(`Error: ${u}`),1}}try{return await hn(n,r,t,s,"attached")}catch(i){if(i instanceof ha$1&&i.code==="import_not_found"){let o=`Import ${r.id} no longer exists \u2014 its upload was abandoned or refused before the corpus arrived, so the publish never happened. Re-run the publish to start a new one.`;return s&&t.out(JSON.stringify({error:{code:"import_not_found",message:o}})),t.err(`Error: ${o}`),1}throw i}}function di(e,t){if(e.n_failed_tasks<=0)return [];let s=e.task_count+e.n_failed_tasks;return [`built ${e.task_count} of ${s} tasks \u2014 ${e.n_failed_tasks} failed to build`,`Reasons: evolve dataset show ${t.name}@${t.version}`,"Fix: re-publish a new version \u2014 versions are immutable."]}function fi(e){return `task ${e.task_name} FAILED \u2014 ${e.failure.code} (${e.failure.step}): ${ee(e.failure.message,140)}`}async function pi(e,t){let n=await ma$1(g(e)).download(e.positionals[0],{to:e.flags["output-dir"]??process.cwd()});return e.flags.json===true?t.out(JSON.stringify({path:n})):t.out(`Saved ${n}`),0}async function gi(e,t){let s=ma$1(g(e)),[n,a]=e.positionals,r=await s.activate(n,a);if(e.flags.json===true)t.out(JSON.stringify(r));else for(let i of gn(r))t.out(i);return 0}function yn(e){let t=[["name",e.name],["id",e.id],["org",e.org??"-"],["ref",e.ref],["digest",e.digest],["size",B(e.size_bytes)]];return e.description&&t.push(["description",e.description]),t.push(["created",e.created_at]),v(t)}async function mi(e,t){if(C(e,t,hs))return 0;let s=oa$1(g(e)),n=te(e),a=await s.list({...x(e),...n!==void 0?{scope:n}:{}});return e.flags.json===true?(t.out(JSON.stringify(a)),0):a.items.length===0?(e.flags.quiet!==true&&t.out("No uploaded skills."),0):(T(e,t,a.items,hs,Ta,r=>r.id),a.nextCursor&&t.tty===true&&e.flags.quiet!==true&&t.out(`
|
|
44
44
|
More: evolve skill list --cursor ${a.nextCursor}`),0)}async function hi(e,t){let n=await oa$1(g(e)).upload(e.positionals[0],Je({},e));return e.flags.json===true?(t.out(JSON.stringify(n.length===1?n[0]:n)),0):(n.forEach((a,r)=>{r>0&&t.out("");for(let i of yn(a))t.out(i);}),t.out(""),t.out(`Use it with: evolve run --skill name:${n[0].name} (moving pointer) or --skill ${n[0].ref} (this exact content)`),0)}async function yi(e,t){let s=await oa$1(g(e)).get(await y(e,"skill",e.positionals[0]));if(e.flags.json===true)return t.out(JSON.stringify(s)),0;for(let n of yn(s))t.out(n);return s.skill_md&&(t.out(""),t.out(s.skill_md)),0}async function ki(e,t){let s=await y(e,"skill",e.positionals[0]);return await oa$1(g(e)).delete(s),e.flags.json===true?t.out(JSON.stringify({id:s,deleted:true})):t.out(`Deleted skill ${s}`),0}async function bi(e,t){if(C(e,t,ys))return 0;let s=na$1(g(e)),n=te(e),a=await s.list({...x(e),...n!==void 0?{scope:n}:{}});return e.flags.json===true?(t.out(JSON.stringify(a)),0):a.items.length===0?(e.flags.quiet!==true&&t.out("No registered agents."),0):(T(e,t,a.items,ys,Ca,r=>r.name),0)}async function wi(e,t){let n=await na$1(g(e)).get(e.positionals[0]);if(e.flags.json===true)t.out(JSON.stringify(n));else for(let a of Xs(n))t.out(a);return 0}async function vi(e,t){let n=await na$1(g(e)).create(Je(Sa(e),e));if(e.flags.json===true)t.out(JSON.stringify(n));else {for(let a of Xs(n))t.out(a);t.out(""),t.out(`Use it with: evolve run -d <dataset> -a ${n.name} -m <model>`);}return 0}async function _i(e,t){let s=na$1(g(e)),n=e.positionals[0];return await s.delete(n),e.flags.json===true?t.out(JSON.stringify({name:n,deleted:true})):t.out(`Deleted agent ${n}`),0}function Si(e){let t=[["user",e.user_id],["email",e.email??"-"],["key id",e.key.id]];return e.key.label&&t.push(["key label",e.key.label]),t.push(["key created",e.key.created_at]),e.key.last_used_at&&t.push(["key last used",e.key.last_used_at]),v(t)}function De(e){let t={};return typeof e.flags["api-key"]=="string"&&(t.apiKey=e.flags["api-key"]),typeof e.flags["base-url"]=="string"&&(t.dashboardUrl=e.flags["base-url"]),t}function kn(e){let t=e.usage;return t&&typeof t.spent_usd=="number"?t.provisional?`at least $${t.spent_usd.toFixed(2)}`:`$${t.spent_usd.toFixed(2)}`:E(e.cost)}var Ls=[{key:"id",header:"ID",cell:e=>e.id},{key:"tag",header:"TAG",cell:e=>e.tag},{key:"agent",header:"AGENT",cell:e=>e.agent},{key:"model",header:"MODEL",cell:e=>e.model??"-"},{key:"provider",header:"PROVIDER",cell:e=>e.provider},{key:"org",header:"ORG",cell:e=>e.org??"-"},{key:"sandbox",header:"SANDBOX",cell:e=>e.sandboxId??"-"},{key:"state",header:"STATE",cell:e=>e.state},{key:"runtime",header:"RUNTIME",cell:e=>e.runtimeStatus},{key:"cost",header:"COST",cell:kn},{key:"steps",header:"STEPS",cell:e=>String(e.stepCount)},{key:"created",header:"CREATED",cell:e=>e.createdAt},{key:"ended",header:"ENDED",cell:e=>e.endedAt??"-"}],$i=["id","tag","agent","model","state","cost","created"];function xi(e){let t=[["id",e.id],["tag",e.tag],["agent",e.agent],["model",e.model??"-"],["effort",e.reasoningEffort??"-"],["org",e.org??"-"],["provider",e.provider],["sandbox",e.sandboxId??"-"],["state",e.state],["runtime",e.runtimeStatus],["visibility",e.visibility],["cost",kn(e)]];return e.usage&&t.push(["tokens",`${e.usage.input_tokens??"-"} in / ${e.usage.cached_input_tokens??"-"} cached / `+(e.usage.cache_write_tokens!==null?`${e.usage.cache_write_tokens} written to cache / `:"")+`${e.usage.output_tokens??"-"} out`+(e.usage.provisional?" (provisional)":"")]),t.push(["steps",String(e.stepCount)]),e.toolStats&&Object.keys(e.toolStats).length>0&&t.push(["tools",Object.entries(e.toolStats).map(([s,n])=>`${s} ${n}`).join(", ")]),t.push(["created",e.createdAt]),t.push(["ended",e.endedAt??"-"]),v(t)}async function Ii(e,t){if(C(e,t,Ls))return 0;let s=e.flags.state===void 0?void 0:String(e.flags.state);if(s!==void 0&&s!=="live"&&s!=="ended")throw new f(`--state must be live or ended; got: ${s}`);let n=te(e),r=await Oa$1(De(e)).list({...x(e),...n!==void 0?{scope:n}:{},...s!==void 0?{state:s}:{},...e.flags.agent!==void 0?{agent:String(e.flags.agent)}:{},...e.flags["tag-prefix"]!==void 0?{tagPrefix:String(e.flags["tag-prefix"])}:{}});return e.flags.json===true?(t.out(JSON.stringify(r)),0):r.items.length===0?(e.flags.quiet!==true&&t.out("No sessions."),0):(T(e,t,r.items,Ls,$i,i=>i.id),r.nextCursor&&t.tty===true&&e.flags.quiet!==true&&t.out(`
|
|
45
45
|
More: evolve session list --cursor ${r.nextCursor}`),0)}async function Oi(e,t){let s=await Oa$1(De(e)).get(await y(e,"session",e.positionals[0]));if(e.flags.json===true)t.out(JSON.stringify(s));else for(let n of xi(s))t.out(n);return 0}async function Pi(e,t){let s=await ta$1(g(e)).status();if(e.flags.json===true)t.out(JSON.stringify(s));else for(let n of Si(s))t.out(n);return 0}var Ds=[{key:"slug",header:"SLUG",cell:e=>e.slug},{key:"display_name",header:"DISPLAY NAME",cell:e=>e.display_name},{key:"role",header:"ROLE",cell:e=>e.role??"-"},{key:"personal",header:"PERSONAL",cell:e=>e.personal?"yes":"no"},{key:"created",header:"CREATED",cell:e=>e.created_at}],ji=["slug","display_name","role","created"];function Ai(e,t){let s=t.toLowerCase();return e.filter(n=>n.slug.toLowerCase().includes(s)||n.display_name.toLowerCase().includes(s)||(n.role??"").toLowerCase().includes(s))}async function Ei(e,t){if(C(e,t,Ds))return 0;let s=await ua$1(g(e)).list(),n=e.flags.search!==void 0?Ai(s,String(e.flags.search)):s;return e.flags.json===true?(t.out(JSON.stringify(n)),0):n.length===0?(e.flags.quiet!==true&&t.out("No organizations found."),0):(T(e,t,n,Ds,ji,a=>a.slug),0)}function Ti(e){let{quota:t,usage:s}=e,n=s.month_spend_usd===null?"unavailable":E(s.month_spend_usd),a=s.month_spend_as_of===null?"":` (as of ${s.month_spend_as_of})`,r=t.monthly_budget_usd===null?`${n} / no budget${a}`:`${n} / ${E(t.monthly_budget_usd)}${a}`,i=[["slug",e.slug],["display name",e.display_name],["personal",e.personal?"yes":"no"],["role",e.role??"-"],["members",String(e.member_count)],["created",e.created_at],["concurrent trials",`${s.in_flight_trials}/${t.max_concurrent_trials}`],["queued trials",`${s.queued_trials}/${t.max_queued_trials}`],["concurrent imports",`${s.in_flight_imports}/${t.max_concurrent_imports}`],["concurrent analyses",`${s.in_flight_analyses}/${t.max_concurrent_analyses}`],["concurrent sessions",`${s.active_sessions}/${t.max_concurrent_sessions}`],["e2b sandbox ceiling",String(t.max_concurrent_sandboxes_e2b)],["daytona sandbox ceiling",String(t.max_concurrent_sandboxes_daytona)],["modal sandbox ceiling",String(t.max_concurrent_sandboxes_modal)],["month spend",r]];return v(i)}async function Ci(e,t){let s=await ua$1(g(e)).get(e.positionals[0]);if(e.flags.json===true)t.out(JSON.stringify(s));else for(let n of Ti(s))t.out(n);return 0}function Tt(){let e=process.env.XDG_CONFIG_HOME,t=e&&e.trim()!==""?e:join(homedir(),".config");return join(t,"evolve","config.json")}function bn(){let e=Tt();if(!existsSync(e))return {};try{let t=JSON.parse(readFileSync(e,"utf8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{throw new f(`${e} is not valid JSON \u2014 fix or delete it`)}}function wn(){let e=bn().org;return typeof e=="string"&&e.trim()!==""?e.trim():void 0}function Ni(e){let t=Tt(),s=bn();return e===null?delete s.org:s.org=e,mkdirSync(dirname(t),{recursive:true,mode:448}),writeFileSync(t,JSON.stringify(s,null,2)+`
|
|
46
46
|
`,{mode:384}),chmodSync(t,384),t}function Je(e,t){let s=typeof t.flags.org=="string"?t.flags.org.trim():void 0;if(s==="personal"){let{org:a,...r}=e;return r}let n=s!==void 0&&s!==""?s:e.org??wn();return n!==void 0?{...e,org:n}:e}async function Ri(e,t){let s=typeof e.flags["display-name"]=="string"?String(e.flags["display-name"]):void 0,n=await ua$1(g(e)).create(e.positionals[0],{displayName:s});return e.flags.json===true?(t.out(JSON.stringify(n)),0):(t.out(`Created organization ${n.slug}`),t.out(`slug ${n.slug}`),t.out(`display name ${n.display_name}`),t.out(`role ${n.role??"owner"}`),t.out(""),t.out(`Invite a teammate with: evolve auth org invite ${n.slug}`),0)}async function Li(e,t){let s=await ua$1(g(e)).invite(e.positionals[0]);return e.flags.json===true?(t.out(JSON.stringify(s)),0):(t.out(`token ${s.token}`),t.out(`expires ${s.expires_at??"never"}`),t.out(`uses ${s.max_uses===null?"unlimited":String(s.max_uses)}`),t.out(""),t.out(`Send the teammate this command: evolve auth org join ${s.token}`),0)}async function Di(e,t){let s=await ua$1(g(e)).join(e.positionals[0]);return e.flags.json===true?(t.out(JSON.stringify(s)),0):(t.out(s.already_member?`Already a member of ${s.org.slug}`:`Joined ${s.org.slug} as member`),t.out(`Run in it with: evolve run --org ${s.org.slug} ... or set it once: evolve auth org use ${s.org.slug}`),0)}async function Ji(e,t){let s=e.flags.json===true,n=e.positionals[0];if(n===void 0){let i=wn(),o=Tt();return s?t.out(JSON.stringify({org:i??null,source:i!==void 0?"config":"personal",path:o})):t.out(i!==void 0?`org ${i} (from ${o})`:`org personal (no default in ${o})`),0}let a=n.trim();if(a==="")throw new f("org name must not be empty");let r=Ni(a==="personal"?null:a);return s?t.out(JSON.stringify({org:a==="personal"?null:a,path:r})):t.out(a==="personal"?`Default org cleared: personal (${r})`:`Default org: ${a} (${r})`),0}function Ct(e){let t={};return typeof e.flags["api-key"]=="string"&&(t.apiKey=e.flags["api-key"]),typeof e.flags["base-url"]=="string"&&(t.dashboardUrl=e.flags["base-url"]),t}function Ui(e){let t=e.flags.value;if(typeof t=="string"){if(t.length===0)throw new f("--value must not be empty");return t}if(process.stdin.isTTY)throw new f('no value given: pass --value <value> or pipe the value on stdin (e.g. printf %s "$TOKEN" | evolve secrets set NAME --delivery ...)');let s=readFileSync(0,"utf8"),n=s.endsWith(`\r
|
|
@@ -49,8 +49,8 @@ More: evolve session list --cursor ${r.nextCursor}`),0)}async function Oi(e,t){l
|
|
|
49
49
|
`)?t.slice(0,-1):t);}function qi(e,t){let s=[e.body];if(t)for(let n of de(e))s.push(`
|
|
50
50
|
--- ${n.path} ---
|
|
51
51
|
|
|
52
|
-
${n.content}`);return s.join("")}function Ki(e,t){if(e.length<=t)return e;let s=e.slice(0,t-3),n=s.lastIndexOf(" ");return `${(n>0?s.slice(0,n):s).trimEnd()}...`}async function Gi(e,t){let s=
|
|
52
|
+
${n.content}`);return s.join("")}function Ki(e,t){if(e.length<=t)return e;let s=e.slice(0,t-3),n=s.lastIndexOf(" ");return `${(n>0?s.slice(0,n):s).trimEnd()}...`}async function Gi(e,t){let s=Se(ue(he));if(e.flags.json===true)return t.out(JSON.stringify(s.map(a=>({name:a.name,description:a.description,path:a.dir})))),0;let n=Math.max(...s.map(a=>a.name.length));for(let a of s)t.out(` ${a.name.padEnd(n)} ${Ki(a.description,70)}`);return 0}async function Vi(e,t){let s=ue(he),n=e.flags.full===true,a=e.flags.all===true,r=e.positionals;if(a&&r.length>0)throw new f('"skills get" takes either names or --all, not both');if(!a&&r.length===0)throw new f('"skills get" requires <name> [name...] or --all');if(!a&&r.length===2&&!ss(s,r[1])){if(n)throw new f("--full applies to a skill; a page is one file");let o=ce(s,r[0]),l=as(o,r[1]);return e.flags.json===true?t.out(JSON.stringify([{name:o.name,page:l.page,path:join(o.dir,l.path),content:l.content}])):Js(t,l.content),0}let i=a?Se(s):r.map(o=>ce(s,o));return e.flags.json===true?(t.out(JSON.stringify(i.map(o=>({name:o.name,path:o.dir,content:o.content,...n?{files:de(o)}:{}})))),0):(Js(t,i.map(o=>qi(o,n)).join(`
|
|
53
53
|
---
|
|
54
54
|
|
|
55
|
-
`)),0)}async function Hi(e,t){let s=ue(he);if(e.positionals.length===0)return t.out(e.flags.json===true?JSON.stringify({path:s}):s),0;let n=ce(s,e.positionals[0]);return t.out(e.flags.json===true?JSON.stringify({name:n.name,path:n.dir}):n.dir),0}async function Wi(e,t){let s=ue(he),n=typeof e.flags.target=="string"?e.flags.target:void 0,a=typeof e.flags.path=="string"?e.flags.path:void 0;if(n!==void 0&&a!==void 0)throw new f("--target and --path both name the destination; pass one of them");let r;if(a!==void 0)r=[{target:"path",skillsDir:resolve(a)}];else {let o=n??"all";if(o!=="all"&&!fe.includes(o))throw new f(`--target must be one of ${[...fe,"all"].join(", ")}, got "${o}"`);let c=o==="all"?[...fe]:[o],u=o==="all"?c.filter(d=>existsSync(dirname(
|
|
56
|
-
`),process.exitCode=1;});function _n(e){return e.replace(/^\w+\(\) requires an API key\. Set EVOLVE_API_KEY or pass \{ apiKey \} in config\./,"An API key is required. Set EVOLVE_API_KEY or pass --api-key <key>.")}export{f as CliUsageError,ps as TRIAL_COLUMNS,wo as USAGE,La as analysisDetailLines,mr as analysisResultLines,Sa as buildAgentInput,va as buildJobInput,_a as buildPublishInput,di as buildSettleSummaryLines,ln as checkDetailLines,rn as checkResultLines,Tt as cliConfigPath,_n as cliMessage,Ka as eventLine,fi as failedTaskOutcomeLine,Ua as importProgressLine,Ma as importStatusLine,
|
|
55
|
+
`)),0)}async function Hi(e,t){let s=ue(he);if(e.positionals.length===0)return t.out(e.flags.json===true?JSON.stringify({path:s}):s),0;let n=ce(s,e.positionals[0]);return t.out(e.flags.json===true?JSON.stringify({name:n.name,path:n.dir}):n.dir),0}async function Wi(e,t){let s=ue(he),n=typeof e.flags.target=="string"?e.flags.target:void 0,a=typeof e.flags.path=="string"?e.flags.path:void 0;if(n!==void 0&&a!==void 0)throw new f("--target and --path both name the destination; pass one of them");let r;if(a!==void 0)r=[{target:"path",skillsDir:resolve(a)}];else {let o=n??"all";if(o!=="all"&&!fe.includes(o))throw new f(`--target must be one of ${[...fe,"all"].join(", ")}, got "${o}"`);let c=o==="all"?[...fe]:[o],u=o==="all"?c.filter(d=>existsSync(dirname($e(d)))):c;if(o==="all"){for(let d of c.filter(p=>!u.includes(p)))t.err(`skipped ${d}: no ${dirname($e(d))}`);u.length===0&&t.err("no agent home found; name one with --target <agent> or a folder with --path <dir>");}r=u.map(d=>({target:d,skillsDir:$e(d)}));}let i=rs(s,r,e.flags.force===true);if(e.flags.json===true)t.out(JSON.stringify(i));else for(let o of i)t.out(o.path);return 0}function Bi(e){if(e.length===0)return {text:ut(),code:0};let t=kt[e[0]];if(t&&(e.length===1||!Q[e[0]]))return {text:ls(e[0],t),code:0};let s=qs[e[0]];if(s)return {text:s,code:0};let n=zs[e[0]]??e[0],a=Q[n];if(!a)return {text:ut(),code:0};if(e.length===1)return {text:us(n),code:0};let r=dt(a,e.slice(1));return r?{text:ls(`${n} ${r.verb}`,r.spec),code:0}:{text:us(n),code:0}}var Yi={run:$s,analyze:hr,check:br,upload:Cr,"skills list":Gi,"skills get":Vi,"skills path":Hi,"skills install":Wi,"job start":$s,"job list":nr,"job show":ar,"job trials":rr,"job tasks":ir,"job compare":lr,"job cancel":ur,"job delete":cr,"job share":nt.share,"job unshare":nt.unshare,"job shares":nt.shares,"job stop":fr,"job resume":pr,"job retry":gr,"job regrade":Or,"job download":Pr,"job imports":Rr,"job import":Lr,"job grep":Fr,"trial show":Dr,"trial trace":Ur,"trial download":Jr,"trial retry":Mr,"trial regrade":zr,"trial stop":Yr,"trial files status":q.status,"trial files list":q.list,"trial files cat":q.cat,"trial files search":q.search,"trial files changes":q.changes,"trial files archive":q.archive,"trial logs":q.logs,"trial procs":q.procs,"analysis list":Zr,"analysis show":ei,"analysis trace":ti,"analysis download":si,"analysis files status":K.status,"analysis files list":K.list,"analysis files cat":K.cat,"analysis files search":K.search,"analysis files changes":K.changes,"analysis files archive":K.archive,"analysis logs":K.logs,"analysis procs":K.procs,"check list":_r,"check show":Sr,"check share":at.share,"check unshare":at.unshare,"check shares":at.shares,"check trace":$r,"check download":xr,"check files status":G.status,"check files list":G.list,"check files cat":G.cat,"check files search":G.search,"check files changes":G.changes,"check files archive":G.archive,"check logs":G.logs,"check procs":G.procs,"session list":Ii,"session show":Oi,"session share":rt.share,"session unshare":rt.unshare,"session shares":rt.shares,"dataset list":ii,"dataset show":oi,"dataset check":li,"dataset publish":ui,"dataset watch":ci,"dataset download":pi,"dataset activate":gi,"dataset files status":it.status,"dataset files list":it.list,"dataset files cat":it.cat,"skill list":mi,"skill upload":hi,"skill show":yi,"skill delete":ki,"agent list":bi,"agent show":wi,"agent add":vi,"agent remove":_i,"auth status":Pi,"auth org list":Ei,"auth org show":Ci,"auth org create":Ri,"auth org invite":Li,"auth org join":Di,"auth org use":Ji,"secrets set":Fi,"secrets list":Mi,"secrets delete":zi};function vn(e){return e instanceof ha$1?{code:e.code,message:e.message,...e.param!==void 0?{param:e.param}:{},...e.details!==void 0?{details:e.details}:{},...e.retryAfterSec!==void 0?{retryAfterSec:e.retryAfterSec}:{},...e.requestId!==void 0?{request_id:e.requestId}:{}}:e instanceof ja$1?{code:e.code,message:e.message}:{message:e instanceof Error?e.message:String(e)}}async function Xi(e,t=$a){let s;try{s=Qn(e);}catch(n){if(n instanceof f)return t.err(`Error: ${n.message}`),t.err('Run "evolve help" for usage.'),2;throw n}if(s.command==="help"){let{text:n,code:a}=Bi(s.positionals);return t.out(n),a}if(s.command==="version")return t.out(Yn()),0;try{let n=Yi[s.command];return n?await n(s,t):(t.err(`Error: unknown command "${s.command}"`),2)}catch(n){if(n instanceof f)return t.err(`Error: ${n.message}`),t.err(`Run "evolve ${s.command} --help" for usage.`),2;s.flags.json===true&&t.out(JSON.stringify({error:vn(n)}));let a=Qi(n,t);return n instanceof ha$1&&t.err(`Docs: ${Gn}`),a}}function Qi(e,t){if(e instanceof ha$1&&e.code==="quota_exceeded")return t.err(`Launch quota exceeded: ${e.message}`),2;if(e instanceof ha$1&&e.status===429){let s=e.retryAfterSec!==void 0?`retry in ${e.retryAfterSec}s`:"retry shortly";return t.err(`Error: rate limited by the server \u2014 ${s}.`),1}if(t.err(`Error: ${_n(e.message)}`),e instanceof ha$1&&e.code==="task_failed_to_build"){let s=e.details??{},n=Array.isArray(s.failed_tasks)?s.failed_tasks:[];for(let a of n){if(!a||typeof a!="object")continue;let r=a.failure??{},i=typeof r.message=="string"&&r.message?`${r.code??"?"} (${r.step??"?"}): ${r.message}`:"build failed (reason not recorded)";t.err(` ${a.task_name}: ${i}`);}t.err(" Fix: re-publish a new version, or drop the failed task(s) from --include-task-name.");}return 1}var Zi=(()=>{let e=process.argv[1];if(!e)return false;let t=s=>{try{return import.meta.url===pathToFileURL(s).href}catch{return false}};if(t(e))return true;try{return t(realpathSync(e))}catch{return false}})();Zi&&Xi(process.argv.slice(2)).then(e=>{process.exitCode=e;},e=>{process.stderr.write(`Error: ${_n(e?.message??String(e))}
|
|
56
|
+
`),process.exitCode=1;});function _n(e){return e.replace(/^\w+\(\) requires an API key\. Set EVOLVE_API_KEY or pass \{ apiKey \} in config\./,"An API key is required. Set EVOLVE_API_KEY or pass --api-key <key>.")}export{f as CliUsageError,ps as TRIAL_COLUMNS,wo as USAGE,La as analysisDetailLines,mr as analysisResultLines,Sa as buildAgentInput,va as buildJobInput,_a as buildPublishInput,di as buildSettleSummaryLines,ln as checkDetailLines,rn as checkResultLines,Tt as cliConfigPath,_n as cliMessage,Ka as eventLine,fi as failedTaskOutcomeLine,Ua as importProgressLine,Ma as importStatusLine,vt as loadPromptFile,_t as loadRubricFile,ya as parseAgentKwargs,Qn as parseArgs,Ws as parseEnvPairs,wa as parseInlineSecrets,ba as parseSecretRefs,oa as parseYamlConfig,Gs as parseYamlConfigLocated,Fa as progressSettleLines,Xi as runCli,Zs as traceEventLine,Ra as trialDetailLines,za as versionStatusLine};
|