@evolvingmachines/evolve 0.0.55-project-sable.20260916.db0bc0bb
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/LICENSE +201 -0
- package/README.md +25 -0
- package/dist/chunk-5GVMBEYI.js +11 -0
- package/dist/chunk-HQJI3HHU.js +1 -0
- package/dist/chunk-JS2UTK2I.js +427 -0
- package/dist/cli/index.cjs +73 -0
- package/dist/cli/index.d.cts +270 -0
- package/dist/cli/index.d.ts +270 -0
- package/dist/cli/index.js +54 -0
- package/dist/index.cjs +669 -0
- package/dist/index.d.cts +5023 -0
- package/dist/index.d.ts +5023 -0
- package/dist/index.js +230 -0
- package/dist/managed-modal-IJW62SSK.js +4 -0
- package/dist/resumable-HFSICSH3.js +1 -0
- package/dist/tar-GVC4KE52.js +1 -0
- package/dist/types-DlpTxdR_.d.cts +4777 -0
- package/dist/types-DlpTxdR_.d.ts +4777 -0
- package/dist/upload-KPYDMWFJ.js +1 -0
- package/docs-agents/SKILL.md +138 -0
- package/docs-agents/index.md +81 -0
- package/docs-agents/python/01-getting-started.md +511 -0
- package/docs-agents/python/02-configuration.md +855 -0
- package/docs-agents/python/03-runtime.md +899 -0
- package/docs-agents/python/04-streaming.md +451 -0
- package/docs-agents/python/05-swarm-pipeline.md +953 -0
- package/docs-agents/python/index.md +122 -0
- package/docs-agents/typescript/01-getting-started.md +494 -0
- package/docs-agents/typescript/02-configuration.md +841 -0
- package/docs-agents/typescript/03-runtime.md +864 -0
- package/docs-agents/typescript/04-streaming.md +478 -0
- package/docs-agents/typescript/05-swarm-pipeline.md +957 -0
- package/docs-agents/typescript/index.md +121 -0
- package/docs-evals/SKILL.md +112 -0
- package/docs-evals/cli-reference/agent.mdx +67 -0
- package/docs-evals/cli-reference/analysis.mdx +91 -0
- package/docs-evals/cli-reference/analyze.mdx +74 -0
- package/docs-evals/cli-reference/auth.mdx +60 -0
- package/docs-evals/cli-reference/check.mdx +146 -0
- package/docs-evals/cli-reference/dataset.mdx +133 -0
- package/docs-evals/cli-reference/index.mdx +108 -0
- package/docs-evals/cli-reference/job.mdx +239 -0
- package/docs-evals/cli-reference/run.mdx +196 -0
- package/docs-evals/cli-reference/secrets.mdx +95 -0
- package/docs-evals/cli-reference/skill.mdx +51 -0
- package/docs-evals/cli-reference/skills.mdx +81 -0
- package/docs-evals/cli-reference/trial.mdx +112 -0
- package/docs-evals/cli-reference/upload.mdx +36 -0
- package/docs-evals/core-concepts/agents.mdx +106 -0
- package/docs-evals/core-concepts/analyze.mdx +86 -0
- package/docs-evals/core-concepts/check.mdx +51 -0
- package/docs-evals/core-concepts/datasets.mdx +138 -0
- package/docs-evals/core-concepts/index.mdx +42 -0
- package/docs-evals/core-concepts/jobs.mdx +136 -0
- package/docs-evals/core-concepts/models.mdx +68 -0
- package/docs-evals/core-concepts/sandboxes.mdx +52 -0
- package/docs-evals/core-concepts/secrets.mdx +41 -0
- package/docs-evals/core-concepts/skills.mdx +42 -0
- package/docs-evals/core-concepts/tasks.mdx +216 -0
- package/docs-evals/core-concepts/trial-outputs.mdx +103 -0
- package/docs-evals/core-concepts/trials.mdx +103 -0
- package/docs-evals/core-concepts/upload.mdx +45 -0
- package/docs-evals/dashboard/checks.mdx +15 -0
- package/docs-evals/dashboard/datasets.mdx +24 -0
- package/docs-evals/dashboard/jobs.mdx +65 -0
- package/docs-evals/dashboard/traces.mdx +15 -0
- package/docs-evals/dashboard/trial-viewer.mdx +30 -0
- package/docs-evals/docs.json +180 -0
- package/docs-evals/getting-started/installation.mdx +56 -0
- package/docs-evals/getting-started/quick-start.mdx +85 -0
- package/docs-evals/index.mdx +36 -0
- package/docs-evals/sdk/python.mdx +139 -0
- package/docs-evals/sdk/typescript.mdx +141 -0
- package/docs-evals/sdk-reference/agents.mdx +105 -0
- package/docs-evals/sdk-reference/analyses.mdx +125 -0
- package/docs-evals/sdk-reference/auth.mdx +76 -0
- package/docs-evals/sdk-reference/checks.mdx +166 -0
- package/docs-evals/sdk-reference/datasets.mdx +305 -0
- package/docs-evals/sdk-reference/errors.mdx +199 -0
- package/docs-evals/sdk-reference/index.mdx +58 -0
- package/docs-evals/sdk-reference/jobs.mdx +731 -0
- package/docs-evals/sdk-reference/meta.mdx +52 -0
- package/docs-evals/sdk-reference/skills.mdx +68 -0
- package/docs-evals/sdk-reference/trials.mdx +232 -0
- package/docs-evals/sdk-reference/types.mdx +272 -0
- package/docs-evals/snippets/global-options.mdx +13 -0
- package/docs-evals/snippets/list-flags.mdx +23 -0
- package/harness-capabilities.json +430 -0
- package/hosted-error-codes.json +120 -0
- package/package.json +163 -0
- package/skills/create-adapter/SKILL.md +287 -0
- package/skills/create-task/SKILL.md +491 -0
- package/skills/evolve/SKILL.md +39 -0
- package/skills/publish/SKILL.md +142 -0
- package/skills/rewardkit/SKILL.md +330 -0
- package/spec/atif/README.md +45 -0
- package/spec/atif/trajectory.schema.json +865 -0
- package/spec/openapi.yaml +13447 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var g=class extends Error{bytes;constructor(e,t){super(`Managed Modal ${e} body is ${t} bytes; the managed door caps every request at 1048576 bytes (1 MiB) of wire bytes, base64 inflation included. Split the payload into smaller writes.`),this.name="ManagedModalWriteLimitError",this.bytes=t;}};function M(a){if(typeof a=="string")return new TextEncoder().encode(a);if(a instanceof Uint8Array)return new Uint8Array(a);if(a instanceof ArrayBuffer)return new Uint8Array(a);throw new Error(`Unsupported data type: ${typeof a}`)}var m=class{constructor(e){this.config=e;}async request(e,t,n){let r=await fetch(`${this.config.baseUrl}${t}`,{...n,headers:{authorization:`Bearer ${this.config.apiKey}`,...n.headers??{}}});if(!r.ok){let s="";try{s=(await r.json())?.error??"";}catch{}throw new Error(`Managed Modal ${e} failed (${r.status})${s?`: ${s}`:""}`)}return r}json(e){return {method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}}},h=class{constructor(e,t){this.door=e;this.sandboxId=t;}async run(e,t){let n=await this.door.request("exec",`/sandboxes/${encodeURIComponent(this.sandboxId)}/exec`,this.door.json({command:e,...t?.cwd?{cwd:t.cwd}:{},...t?.envs?{envs:t.envs}:{},...t?.timeoutMs!==void 0?{timeoutMs:t.timeoutMs}:{}})),r="",s="",i,l=d=>{if(!d.trim())return;let o;try{o=JSON.parse(d);}catch{throw new Error(`Managed Modal exec stream carried a garbled record: ${d}`)}o.stream==="stdout"&&typeof o.data=="string"?(r+=o.data,t?.onStdout?.(o.data)):o.stream==="stderr"&&typeof o.data=="string"?(s+=o.data,t?.onStderr?.(o.data)):i=o;};if(n.body){let d=n.body.getReader(),o=new TextDecoder,c="";for(;;){let{done:y,value:p}=await d.read();if(y)break;c+=o.decode(p,{stream:true});let f;for(;(f=c.indexOf(`
|
|
2
|
+
`))!==-1;)l(c.slice(0,f)),c=c.slice(f+1);}c+=o.decode(),l(c);}else for(let d of (await n.text()).split(`
|
|
3
|
+
`))l(d);if(i?.error!==void 0)throw new Error(`Managed Modal exec failed: ${i.error}`);if(typeof i?.exitCode!="number")throw new Error("Managed Modal exec stream ended without a terminal record \u2014 the connection died mid-run.");return {exitCode:i.exitCode,stdout:r,stderr:s}}async spawn(e,t){let n=this.run(e,t);return n.catch(()=>{}),{processId:`managed-modal-${Date.now()}-${Math.random().toString(36).slice(2)}`,wait:()=>n,kill:async()=>false}}async list(){return (await this.run("ps -eo pid,comm,args")).stdout.trim().split(`
|
|
4
|
+
`).slice(1).filter(n=>n.trim()).map(n=>{let r=n.trim().split(/\s+/);return {processId:r[0],cmd:r[1]||"",args:r.slice(2),envs:{}}})}async kill(e){return /^\d+$/.test(e)?(await this.run(`kill -9 ${e}`)).exitCode===0:false}},b=class{constructor(e,t){this.door=e;this.sandboxId=t;}filesPath(e){return `/sandboxes/${encodeURIComponent(this.sandboxId)}/files/${e}`}encodeContent(e){return typeof e=="string"?{content:e}:{content:Buffer.from(M(e)).toString("base64"),encoding:"base64"}}boundedJson(e,t){let n=this.door.json(t),r=Buffer.byteLength(n.body,"utf8");if(r>1048576)throw new g(e,r);return n}async read(e){let n=await(await this.door.request("file read",this.filesPath("read"),this.door.json({path:e}))).json();return n.encoding==="base64"?new Uint8Array(Buffer.from(n.content??"","base64")):n.content??""}async write(e,t){await this.door.request("file write",this.filesPath("write"),this.boundedJson("file write",{path:e,...this.encodeContent(t)}));}async writeBatch(e){e.length!==0&&await this.door.request("file writeBatch",this.filesPath("writeBatch"),this.boundedJson("file writeBatch",{files:e.map(t=>({path:t.path,...this.encodeContent(t.data)}))}));}async makeDir(e){await this.door.request("makeDir",this.filesPath("makeDir"),this.door.json({path:e}));}};function x(a){return {sandboxId:a.sandboxId,image:a.image??"",metadata:a.metadata??{},startedAt:a.startedAt??""}}var u=class{constructor(e,t){this.door=e;this.sandboxId=t;this.commands=new h(e,t),this.files=new b(e,t);}commands;files;async getHost(e){throw new Error("Managed Modal sandboxes expose no tunnels, so getHost() is unavailable through the managed door.")}async kill(){try{await this.door.request("kill",`/sandboxes/${encodeURIComponent(this.sandboxId)}`,{method:"DELETE"});}catch(e){if(e instanceof Error&&e.message.includes("(404)"))return;throw e}}async pause(){throw new Error("Modal does not support pause/resume. Persist progress with Evolve checkpoints and resume in a fresh sandbox, or use kill() to terminate.")}async isRunning(){try{return await this.getInfo(),!0}catch(e){if(e instanceof Error&&e.message.includes("(404)"))return false;throw e}}async getInfo(){let e=await this.door.request("get",`/sandboxes/${encodeURIComponent(this.sandboxId)}`,{method:"GET"});return x(await e.json())}},w=class{providerType="modal";name="Managed Modal";door;constructor(e){this.door=new m(e);}async create(e){if(e.resources!==void 0)throw new Error("Managed Modal sandboxes are platform-sized; `resources` cannot be enforced through the managed door.");if(e.network!==void 0)throw new Error("Managed Modal sandboxes run the platform's network policy; `network` cannot be enforced through the managed door.");if(e.user!==void 0)throw new Error("Managed Modal sandboxes run as the platform's sandbox user; `user` cannot be enforced through the managed door.");if(e.idleTimeoutMs!==void 0)throw new Error("The managed Modal door takes no idle timeout; bound the sandbox with `timeoutMs` instead.");if(e.bootCommand!==void 0)throw new Error("Managed Modal sandboxes boot the platform image as configured; `bootCommand` cannot be enforced through the managed door.");let n=await(await this.door.request("create","/sandboxes",this.door.json({...e.image?{image:e.image}:{},...e.timeoutMs!==void 0?{timeoutMs:e.timeoutMs}:{},...e.workingDirectory?{workingDirectory:e.workingDirectory}:{},...e.envs?{envs:e.envs}:{},...e.metadata?{metadata:e.metadata}:{}}))).json();return new u(this.door,n.sandboxId)}async connect(e,t){let n=new u(this.door,e);return await n.getInfo(),n}async list(e){if(e?.state&&!e.state.includes("running"))return [];let r=((await(await this.door.request("list","/sandboxes",{method:"GET"})).json()).sandboxes??[]).map(x);if(e?.metadata){let s=Object.entries(e.metadata);r=r.filter(i=>s.every(([l,d])=>i.metadata[l]===d));}return e?.limit!==void 0&&(r=r.slice(0,e.limit)),r}async listAll(e){if(e?.state&&!e.state.includes("running"))return {sandboxes:[],complete:true,pagesFetched:0};let t;try{t=await this.list({...e,limit:void 0});}catch(s){return {sandboxes:[],complete:false,pagesFetched:0,error:`sandbox list failed: ${s instanceof Error?s.message:String(s)}`}}let n=e?.limit!==void 0?t.slice(0,e.limit):t,r=n.length<t.length;return {sandboxes:n,complete:!r,pagesFetched:1,...r?{error:`stopped at the requested limit of ${e?.limit} with more sandboxes available`}:{}}}},S=(a,e)=>new u(new m(a),e);export{w as ManagedModalProvider,g as ManagedModalWriteLimitError,S as _testManagedModalSandbox};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{d as RESUMABLE_UPLOAD_CHUNK_BYTES,e as RESUMABLE_UPLOAD_MAX_ATTEMPTS,f as RESUMABLE_UPLOAD_MAX_RATE_LIMIT_WAITS,g as RESUMABLE_UPLOAD_MAX_RETRY_AFTER_SEC,b as RESUMABLE_UPLOAD_THRESHOLD_BYTES,h as retryAfterWaitMs,c as setResumableUploadThresholdBytes,i as uploadArchiveResumable}from'./chunk-HQJI3HHU.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import R,{deflateRawSync,constants,createGunzip}from'zlib';import {createWriteStream,createReadStream}from'fs';import {open,mkdtemp,stat,readFile,rm,mkdir,readdir,lstat}from'fs/promises';import {tmpdir}from'os';import {join,dirname}from'path';import {pipeline,finished}from'stream/promises';import {pack,extract}from'tar-stream';var Y=new Set([".git",".DS_Store",".venv"]);async function j(n){let t=[],e=async r=>{let i=r===""?n:join(n,r),a=await readdir(i,{withFileTypes:true});a.sort((s,o)=>s.name<o.name?-1:s.name>o.name?1:0);for(let s of a){if(Y.has(s.name))continue;let o=r===""?s.name:`${r}/${s.name}`,c=join(i,s.name),l=await lstat(c);l.isSymbolicLink()||(l.isDirectory()?await e(o):l.isFile()&&t.push({rel:o,abs:c,mode:l.mode&73?493:420,size:l.size}));}};return await e(""),t.sort((r,i)=>r.rel<i.rel?-1:r.rel>i.rel?1:0)}var V=64*1024,S=128*1024,X=65535,Z=1024*1024,y=32*1024;async function q(n,t){if(t<V)return false;let e=await open(n,"r"),r;try{let a=Buffer.allocUnsafe(S),{bytesRead:s}=await e.read(a,0,S,0);r=a.subarray(0,s);}finally{await e.close();}return r.length===0?false:deflateRawSync(r,{level:1}).length*20>=r.length*19}function J(n,t=0){let e=~t;for(let r=0;r<n.length;r++)e=Q[(e^n[r])&255]^e>>>8;return ~e>>>0}var Q=(()=>{let n=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e;}return n})(),tt=R.crc32??J,p=class n{constructor(t){this.sink=t;}static HEADER=Buffer.from([31,139,8,0,0,0,0,0,0,255]);static FINAL_BLOCK=Buffer.from([1,0,0,255,255]);crc=0;plainLength=0;held=[];heldBytes=0;window=null;stored=false;started=false;async setStored(t){t!==this.stored&&(await this.drainHeld(true),this.stored=t);}async write(t){this.started||(this.started=true,await this.out(n.HEADER)),this.held.push(t),this.heldBytes+=t.length,await this.drainHeld(false);}async close(){this.started||(this.started=true,await this.out(n.HEADER)),await this.drainHeld(true),await this.out(n.FINAL_BLOCK);let t=Buffer.allocUnsafe(8);t.writeUInt32LE(this.crc>>>0,0),t.writeUInt32LE(this.plainLength%4294967296,4),await this.out(t);}async drainHeld(t){let e=this.stored?X:Z;for(;this.heldBytes>=e||t&&this.heldBytes>0;){let r=this.held.length===1?this.held[0]:Buffer.concat(this.held,this.heldBytes),i=Math.min(e,r.length),a=r.subarray(i);this.held=a.length>0?[a]:[],this.heldBytes=a.length,await this.emitBlock(r.subarray(0,i));}}async emitBlock(t){if(this.crc=tt(t,this.crc),this.plainLength+=t.length,this.stored){let e=Buffer.allocUnsafe(5+t.length);e[0]=0,e.writeUInt16LE(t.length,1),e.writeUInt16LE(t.length^65535,3),t.copy(e,5),await this.out(e);}else await this.out(deflateRawSync(t,{level:9,finishFlush:constants.Z_SYNC_FLUSH,...this.window?{dictionary:this.window}:{}}));this.window=t.length>=y?Buffer.from(t.subarray(t.length-y)):this.window?Buffer.concat([this.window,t]).subarray(-y):Buffer.from(t);}out(t){return new Promise((e,r)=>{this.sink.write(t,i=>i==null?e():r(i));})}},b=Symbol("feed settled");async function et(n){let t=Symbol("pending"),e=await Promise.race([n,Promise.resolve(t)]);return e===t?null:e}async function rt(n,t){let e=await j(n),r=pack(),i=createWriteStream(t);i.on("error",()=>{}),r.on("error",()=>{});let a=new p(i),s=r[Symbol.asyncIterator](),o=null,c=()=>o??=s.next();try{for(let{rel:l,abs:f,mode:_,size:E}of e){await a.setStored(await q(f,E));let A=r.entry({name:l,size:E,mode:_,mtime:new Date(0),uid:0,gid:0,uname:"",gname:"",type:"file"}),v=pipeline(createReadStream(f),A),B=!1,m=null;for(v.then(()=>{},()=>{}).then(()=>{B=!0,m?.(b);});;){if(!B){let h=await new Promise((x,F)=>{m=x,c().then(x,F);});if(m=null,h===b)continue;if(o=null,h.done)break;await a.write(h.value);continue}await new Promise(h=>setImmediate(h));let w=await et(c());if(w===null||(o=null,w.done))break;await a.write(w.value);}await v;}for(r.finalize();;){let l=await c();if(o=null,l.done)break;await a.write(l.value);}await a.close(),i.end(),await finished(i);}catch(l){throw o?.catch(()=>{}),r.destroy(),i.destroy(),l}}var it=256*1024*1024;async function ut(n,t=it){let e=await mkdtemp(join(tmpdir(),"evolve-tar-"));try{let r=join(e,"archive.tar.gz");await rt(n,r);let{size:i}=await stat(r);if(i>t)throw new Error(`directory ${n} tars to ${i} bytes compressed \u2014 over the ${t}-byte cap for in-memory archives. Only the sandbox skill mount uses this path; a skill folder this large is not mountable.`);return await readFile(r)}finally{await rm(e,{recursive:true,force:true});}}async function ht(n,t,e){let r=extract(),i=[],a=(async()=>{for await(let s of r){let o=s.header.name,c=o.split("/").filter(f=>f!==""&&f!==".");if(o.startsWith("/")||o.includes("\\")||c.length===0||c.some(f=>f===".."))throw new Error(`refusing to extract "${o}": the path escapes the target directory`);if(c[0]!==e)throw new Error(`refusing to extract "${o}": entry outside ${e}/`);if(s.header.type==="directory"){await mkdir(join(t,...c),{recursive:true}),s.resume();continue}if(s.header.type!=="file")throw new Error(`refusing to extract "${o}": unsupported entry type "${s.header.type}"`);let l=join(t,...c);await mkdir(dirname(l),{recursive:true}),await pipeline(s,createWriteStream(l)),i.push(c.join("/"));}})();try{await Promise.all([pipeline(createReadStream(n),createGunzip(),r),a]);}catch(s){throw r.destroy(),s}return i}async function dt(n){let t=extract(),e=null,r=(async()=>{for await(let i of t){let a=i.header.name,s=a.split("/").filter(o=>o!==""&&o!==".");if(a.startsWith("/")||a.includes("\\")||s.length===0||s.some(o=>o===".."))throw new Error(`refusing to extract "${a}": the path escapes the target directory`);if(e===null)e=s[0];else if(s[0]!==e)throw new Error(`refusing to extract "${a}": the archive holds more than one top-level directory (${e}/)`);i.resume();}})();try{await Promise.all([pipeline(createReadStream(n),createGunzip(),t),r]);}catch(i){throw t.destroy(),i}if(e===null)throw new Error("refusing to extract: the archive holds no entries");return e}export{it as MAX_INLINE_ARCHIVE_BYTES,J as crc32Fallback,ht as extractTarGz,q as shouldStore,dt as tarGzTopLevelName,ut as tarGzipDirectory,rt as tarGzipDirectoryToFile};
|