@evolvingmachines/sdk 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -19,7 +19,7 @@ ${h}
|
|
|
19
19
|
\`\`\``:h}});}}return {sessionUpdate:"tool_call_update",toolCallId:t,status:u?"failed":"completed",content:m}}function r(p,t){let u=Mt[p]||"other",d=[],m=[],f=p;switch(p){case "Read":case "read_file":f=`Read ${t.file_path||t.absolute_path||"file"}`,(t.file_path||t.absolute_path)&&m.push({path:t.file_path||t.absolute_path});break;case "Write":case "write_file":f=`Write ${t.file_path||"file"}`,t.file_path&&(m.push({path:t.file_path}),d.push({type:"diff",path:t.file_path,oldText:null,newText:t.content||""}));break;case "Edit":case "edit_file":f=`Edit ${t.file_path||"file"}`,t.file_path&&m.push({path:t.file_path});break;case "Bash":case "shell":case "run_shell_command":f=t.command?`\`${t.command}\``:"Run command",t.description&&d.push({type:"content",content:{type:"text",text:t.description}});break;case "WebFetch":f=t.url?`Fetch ${t.url}`:"Web fetch";break;case "WebSearch":case "brave_web_search":f=t.query?`"${t.query}"`:"Web search";break;case "Glob":f=`Find ${t.pattern||"files"}`,t.path&&m.push({path:t.path});break;case "Grep":f=`grep "${t.pattern||""}"`;break;case "LS":case "list_directory":f=`List ${t.path||"directory"}`,t.path&&m.push({path:t.path});break;case "Task":f=t.description||"Subagent task";break;case "TodoWrite":f="Update todos";break;case "ExitPlanMode":f="Exit plan mode";break;default:f=p;}return {title:f,kind:u,content:d,locations:m}}}function Le(c){return oe()(c)}function O(c){switch(c){case "claude":return ne();case "codex":return se();case "gemini":return ie();case "qwen":return oe();default:return ()=>null}}function Ot(c,e){let n=e.trim();return n?O(c)(n):null}function It(c,e){let n=[],s=e.split(`
|
|
20
20
|
`),a=O(c);for(let i of s){let o=i.trim();if(!o)continue;let l=a(o);l&&n.push(...l);}return n}function K(){return process.env.EVOLVE_GATEWAY_URL||"https://swarmkit-gateway-692833842999.us-central1.run.app"}function je(){return `${K()}`}function Ve(){return `${K()}/e2b`}function Ke(c){return {"browser-use":{type:"http",url:`${K()}/browser_use/mcp`,headers:{"x-litellm-api-key":`Bearer ${c}`}}}}var I="EVOLVE_API_KEY",re="E2B_API_KEY",ae="DAYTONA_API_KEY",ce="MODAL_TOKEN_ID",Se="MODAL_TOKEN_SECRET",We="claude",W=36e5,Je=4,ke=100,Ye="/home/user/workspace",J="https://dashboard.evolvingmachines.ai",Ge=".evolve-sdk/observability/sessions",ze=100,He=5e3,le=3,Te=1e3;function E(c){return c!==null&&typeof c=="object"&&"safeParse"in c&&typeof c.safeParse=="function"}function N(c){return JSON.stringify(At__default.default(c,{target:"jsonSchema7"}),null,2)}function B(c){return JSON.stringify(c,null,2)}function qe(c,e=false){let n={};function s(a,i){for(let o of P__namespace.readdirSync(a)){let l=Y__namespace.join(a,o),r=i?`${i}/${o}`:o;P__namespace.statSync(l).isDirectory()?e&&s(l,r):n[r]=P__namespace.readFileSync(l);}}return s(c,""),n}function Ze(c,e){for(let[n,s]of Object.entries(e)){let a=Y__namespace.join(c,n),i=Y__namespace.dirname(a);P__namespace.mkdirSync(i,{recursive:true});let o;s instanceof ArrayBuffer||s instanceof Uint8Array?o=Buffer.from(s):o=s,P__namespace.writeFileSync(a,o);}}function Dt(c){let e=c.replace(/^~/,process.env.HOME||"");if(!P__namespace.existsSync(e))throw new Error(`OAuth file not found: ${e}`);return P__namespace.readFileSync(e,"utf-8")}function _e(c){let e=c?.type??We,n=M(e);if(c?.oauthToken){if(e!=="claude")throw new Error(`oauthToken is only supported for claude agent (Claude Max subscription), not ${e}. Use providerApiKey for ${e} instead.`);return {type:e,apiKey:c.oauthToken,isDirectMode:true,isOAuth:true,model:c.model,reasoningEffort:c.reasoningEffort,betas:c.betas}}if(c?.providerApiKey){let o=c.providerBaseUrl??process.env[n.baseUrlEnv]??n.defaultBaseUrl;return {type:e,apiKey:c.providerApiKey,baseUrl:o,isDirectMode:true,model:c.model,reasoningEffort:c.reasoningEffort,betas:c.betas}}if(c?.apiKey)return {type:e,apiKey:c.apiKey,isDirectMode:false,model:c.model,reasoningEffort:c.reasoningEffort,betas:c.betas};let s=process.env[I];if(s)return {type:e,apiKey:s,isDirectMode:false,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas};let a=process.env[n.apiKeyEnv];if(a){let o=process.env[n.baseUrlEnv]??n.defaultBaseUrl;return {type:e,apiKey:a,baseUrl:o,isDirectMode:true,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas}}if(n.oauthEnv){let o=process.env[n.oauthEnv];if(o){if(n.oauthFileName){let l=Dt(o);return {type:e,apiKey:"__oauth_file__",isDirectMode:true,isOAuth:true,oauthFileContent:l,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas}}return {type:e,apiKey:o,isDirectMode:true,isOAuth:true,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas}}}let i=n.oauthEnv?n.oauthFileName?`, or ${n.oauthEnv}`:`, oauthToken, or ${n.oauthEnv}`:"";throw new Error(`No API key found for ${e}. Set apiKey (gateway), providerApiKey (direct)${i}, or ${I} / ${n.apiKeyEnv} env var.`)}async function Ee(){let c=process.env[re];if(c)try{let{createE2BProvider:i}=await import('@evolvingmachines/e2b');return i({apiKey:c})}catch(i){let o=i;throw o.message?.includes("Cannot find module")||o.message?.includes("MODULE_NOT_FOUND")?new Error(`${re} is set but @evolvingmachines/e2b failed to load.
|
|
21
21
|
Try reinstalling: npm install @evolvingmachines/sdk`):o}let e=process.env[ae];if(e)try{let{createDaytonaProvider:i}=await import('@evolvingmachines/daytona');return i({apiKey:e})}catch(i){let o=i;throw o.message?.includes("Cannot find module")||o.message?.includes("MODULE_NOT_FOUND")?new Error(`${ae} is set but @evolvingmachines/daytona failed to load.
|
|
22
|
-
Try installing: npm install @evolvingmachines/daytona`):o}let n=process.env[ce],s=process.env[Se];if(n&&s)try{let{createModalProvider:i}=await import('@evolvingmachines/modal');return i()}catch(i){let o=i;throw o.message?.includes("Cannot find module")||o.message?.includes("MODULE_NOT_FOUND")?new Error(`${ce} is set but @evolvingmachines/modal failed to load.
|
|
22
|
+
Try installing: npm install @evolvingmachines/daytona`):o}let n=process.env[ce],s=process.env[Se];if(n&&s)try{let{createModalProvider:i}=await import('@evolvingmachines/modal');return i({tokenId:n,tokenSecret:s})}catch(i){let o=i;throw o.message?.includes("Cannot find module")||o.message?.includes("MODULE_NOT_FOUND")?new Error(`${ce} is set but @evolvingmachines/modal failed to load.
|
|
23
23
|
Try installing: npm install @evolvingmachines/modal`):o}let a=process.env[I];if(a)try{let{createE2BProvider:i}=await import('@evolvingmachines/e2b');return process.env.E2B_API_URL=Ve(),i({apiKey:a})}catch(i){let o=i;throw o.message?.includes("Cannot find module")||o.message?.includes("MODULE_NOT_FOUND")?new Error(`${I} is set but @evolvingmachines/e2b failed to load.
|
|
24
24
|
Try reinstalling: npm install @evolvingmachines/sdk`):o}throw new Error(`No sandbox provider configured. Either:
|
|
25
25
|
1. Set ${I} environment variable (recommended, get key at https://dashboard.evolvingmachines.ai)
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ ${h}
|
|
|
19
19
|
\`\`\``:h}});}}return {sessionUpdate:"tool_call_update",toolCallId:t,status:u?"failed":"completed",content:m}}function r(p,t){let u=Mt[p]||"other",d=[],m=[],f=p;switch(p){case "Read":case "read_file":f=`Read ${t.file_path||t.absolute_path||"file"}`,(t.file_path||t.absolute_path)&&m.push({path:t.file_path||t.absolute_path});break;case "Write":case "write_file":f=`Write ${t.file_path||"file"}`,t.file_path&&(m.push({path:t.file_path}),d.push({type:"diff",path:t.file_path,oldText:null,newText:t.content||""}));break;case "Edit":case "edit_file":f=`Edit ${t.file_path||"file"}`,t.file_path&&m.push({path:t.file_path});break;case "Bash":case "shell":case "run_shell_command":f=t.command?`\`${t.command}\``:"Run command",t.description&&d.push({type:"content",content:{type:"text",text:t.description}});break;case "WebFetch":f=t.url?`Fetch ${t.url}`:"Web fetch";break;case "WebSearch":case "brave_web_search":f=t.query?`"${t.query}"`:"Web search";break;case "Glob":f=`Find ${t.pattern||"files"}`,t.path&&m.push({path:t.path});break;case "Grep":f=`grep "${t.pattern||""}"`;break;case "LS":case "list_directory":f=`List ${t.path||"directory"}`,t.path&&m.push({path:t.path});break;case "Task":f=t.description||"Subagent task";break;case "TodoWrite":f="Update todos";break;case "ExitPlanMode":f="Exit plan mode";break;default:f=p;}return {title:f,kind:u,content:d,locations:m}}}function Le(c){return oe()(c)}function O(c){switch(c){case "claude":return ne();case "codex":return se();case "gemini":return ie();case "qwen":return oe();default:return ()=>null}}function Ot(c,e){let n=e.trim();return n?O(c)(n):null}function It(c,e){let n=[],s=e.split(`
|
|
20
20
|
`),a=O(c);for(let i of s){let o=i.trim();if(!o)continue;let l=a(o);l&&n.push(...l);}return n}function K(){return process.env.EVOLVE_GATEWAY_URL||"https://swarmkit-gateway-692833842999.us-central1.run.app"}function je(){return `${K()}`}function Ve(){return `${K()}/e2b`}function Ke(c){return {"browser-use":{type:"http",url:`${K()}/browser_use/mcp`,headers:{"x-litellm-api-key":`Bearer ${c}`}}}}var I="EVOLVE_API_KEY",re="E2B_API_KEY",ae="DAYTONA_API_KEY",ce="MODAL_TOKEN_ID",Se="MODAL_TOKEN_SECRET",We="claude",W=36e5,Je=4,ke=100,Ye="/home/user/workspace",J="https://dashboard.evolvingmachines.ai",Ge=".evolve-sdk/observability/sessions",ze=100,He=5e3,le=3,Te=1e3;function E(c){return c!==null&&typeof c=="object"&&"safeParse"in c&&typeof c.safeParse=="function"}function N(c){return JSON.stringify(At(c,{target:"jsonSchema7"}),null,2)}function B(c){return JSON.stringify(c,null,2)}function qe(c,e=false){let n={};function s(a,i){for(let o of P.readdirSync(a)){let l=Y.join(a,o),r=i?`${i}/${o}`:o;P.statSync(l).isDirectory()?e&&s(l,r):n[r]=P.readFileSync(l);}}return s(c,""),n}function Ze(c,e){for(let[n,s]of Object.entries(e)){let a=Y.join(c,n),i=Y.dirname(a);P.mkdirSync(i,{recursive:true});let o;s instanceof ArrayBuffer||s instanceof Uint8Array?o=Buffer.from(s):o=s,P.writeFileSync(a,o);}}function Dt(c){let e=c.replace(/^~/,process.env.HOME||"");if(!P.existsSync(e))throw new Error(`OAuth file not found: ${e}`);return P.readFileSync(e,"utf-8")}function _e(c){let e=c?.type??We,n=M(e);if(c?.oauthToken){if(e!=="claude")throw new Error(`oauthToken is only supported for claude agent (Claude Max subscription), not ${e}. Use providerApiKey for ${e} instead.`);return {type:e,apiKey:c.oauthToken,isDirectMode:true,isOAuth:true,model:c.model,reasoningEffort:c.reasoningEffort,betas:c.betas}}if(c?.providerApiKey){let o=c.providerBaseUrl??process.env[n.baseUrlEnv]??n.defaultBaseUrl;return {type:e,apiKey:c.providerApiKey,baseUrl:o,isDirectMode:true,model:c.model,reasoningEffort:c.reasoningEffort,betas:c.betas}}if(c?.apiKey)return {type:e,apiKey:c.apiKey,isDirectMode:false,model:c.model,reasoningEffort:c.reasoningEffort,betas:c.betas};let s=process.env[I];if(s)return {type:e,apiKey:s,isDirectMode:false,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas};let a=process.env[n.apiKeyEnv];if(a){let o=process.env[n.baseUrlEnv]??n.defaultBaseUrl;return {type:e,apiKey:a,baseUrl:o,isDirectMode:true,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas}}if(n.oauthEnv){let o=process.env[n.oauthEnv];if(o){if(n.oauthFileName){let l=Dt(o);return {type:e,apiKey:"__oauth_file__",isDirectMode:true,isOAuth:true,oauthFileContent:l,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas}}return {type:e,apiKey:o,isDirectMode:true,isOAuth:true,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas}}}let i=n.oauthEnv?n.oauthFileName?`, or ${n.oauthEnv}`:`, oauthToken, or ${n.oauthEnv}`:"";throw new Error(`No API key found for ${e}. Set apiKey (gateway), providerApiKey (direct)${i}, or ${I} / ${n.apiKeyEnv} env var.`)}async function Ee(){let c=process.env[re];if(c)try{let{createE2BProvider:i}=await import('@evolvingmachines/e2b');return i({apiKey:c})}catch(i){let o=i;throw o.message?.includes("Cannot find module")||o.message?.includes("MODULE_NOT_FOUND")?new Error(`${re} is set but @evolvingmachines/e2b failed to load.
|
|
21
21
|
Try reinstalling: npm install @evolvingmachines/sdk`):o}let e=process.env[ae];if(e)try{let{createDaytonaProvider:i}=await import('@evolvingmachines/daytona');return i({apiKey:e})}catch(i){let o=i;throw o.message?.includes("Cannot find module")||o.message?.includes("MODULE_NOT_FOUND")?new Error(`${ae} is set but @evolvingmachines/daytona failed to load.
|
|
22
|
-
Try installing: npm install @evolvingmachines/daytona`):o}let n=process.env[ce],s=process.env[Se];if(n&&s)try{let{createModalProvider:i}=await import('@evolvingmachines/modal');return i()}catch(i){let o=i;throw o.message?.includes("Cannot find module")||o.message?.includes("MODULE_NOT_FOUND")?new Error(`${ce} is set but @evolvingmachines/modal failed to load.
|
|
22
|
+
Try installing: npm install @evolvingmachines/daytona`):o}let n=process.env[ce],s=process.env[Se];if(n&&s)try{let{createModalProvider:i}=await import('@evolvingmachines/modal');return i({tokenId:n,tokenSecret:s})}catch(i){let o=i;throw o.message?.includes("Cannot find module")||o.message?.includes("MODULE_NOT_FOUND")?new Error(`${ce} is set but @evolvingmachines/modal failed to load.
|
|
23
23
|
Try installing: npm install @evolvingmachines/modal`):o}let a=process.env[I];if(a)try{let{createE2BProvider:i}=await import('@evolvingmachines/e2b');return process.env.E2B_API_URL=Ve(),i({apiKey:a})}catch(i){let o=i;throw o.message?.includes("Cannot find module")||o.message?.includes("MODULE_NOT_FOUND")?new Error(`${I} is set but @evolvingmachines/e2b failed to load.
|
|
24
24
|
Try reinstalling: npm install @evolvingmachines/sdk`):o}throw new Error(`No sandbox provider configured. Either:
|
|
25
25
|
1. Set ${I} environment variable (recommended, get key at https://dashboard.evolvingmachines.ai)
|