@evolvingmachines/sdk 0.0.2 → 0.0.4
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
|
@@ -17,7 +17,7 @@ ${d}
|
|
|
17
17
|
\`\`\``:d}});else if(Array.isArray(d)){for(let f of d)if(f.type==="text"){let h=f.text;m.push({type:"content",content:{type:"text",text:u?`\`\`\`
|
|
18
18
|
${h}
|
|
19
19
|
\`\`\``:h}});}}return {sessionUpdate:"tool_call_update",toolCallId:t,status:u?"failed":"completed",content:m}}function i(p,t){let u=_t[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 $e(c){return oe()(c)}function I(c){switch(c){case "claude":return ne();case "codex":return se();case "gemini":return ie();case "qwen":return oe();default:return ()=>null}}function Rt(c,e){let n=e.trim();return n?I(c)(n):null}function Pt(c,e){let n=[],s=e.split(`
|
|
20
|
-
`),r=I(c);for(let o of s){let a=o.trim();if(!a)continue;let l=r(a);l&&n.push(...l);}return n}function K(){return process.env.EVOLVE_GATEWAY_URL||"https://
|
|
20
|
+
`),r=I(c);for(let o of s){let a=o.trim();if(!a)continue;let l=r(a);l&&n.push(...l);}return n}function K(){return process.env.EVOLVE_GATEWAY_URL||"https://swarmkit-gateway-692833842999.us-central1.run.app"}function Ue(){return `${K()}`}function Be(){return `${K()}/e2b`}function Ne(c){return {"browser-use":{type:"http",url:`${K()}/browser_use/mcp`,headers:{"x-litellm-api-key":`Bearer ${c}`}}}}var O="EVOLVE_API_KEY",re="E2B_API_KEY",je="claude",W=36e5,Le=4,be=100,Ve="/home/user/workspace",J="https://dashboard.evolvingmachines.ai",Ke=".evolve-sdk/observability/sessions",We=100,Je=5e3,ae=3,we=1e3;function R(c){return c!==null&&typeof c=="object"&&"safeParse"in c&&typeof c.safeParse=="function"}function B(c){return JSON.stringify(Et__default.default(c,{target:"jsonSchema7"}),null,2)}function N(c){return JSON.stringify(c,null,2)}function Ye(c,e=false){let n={};function s(r,o){for(let a of P__namespace.readdirSync(r)){let l=Y__namespace.join(r,a),i=o?`${o}/${a}`:a;P__namespace.statSync(l).isDirectory()?e&&s(l,i):n[i]=P__namespace.readFileSync(l);}}return s(c,""),n}function Ge(c,e){for(let[n,s]of Object.entries(e)){let r=Y__namespace.join(c,n),o=Y__namespace.dirname(r);P__namespace.mkdirSync(o,{recursive:true});let a;s instanceof ArrayBuffer||s instanceof Uint8Array?a=Buffer.from(s):a=s,P__namespace.writeFileSync(r,a);}}function Ce(c){let e=c?.type??je,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 a=c.providerBaseUrl??process.env[n.baseUrlEnv]??n.defaultBaseUrl;return {type:e,apiKey:c.providerApiKey,baseUrl:a,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[O];if(s)return {type:e,apiKey:s,isDirectMode:false,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas};let r=process.env[n.apiKeyEnv];if(r){let a=process.env[n.baseUrlEnv]??n.defaultBaseUrl;return {type:e,apiKey:r,baseUrl:a,isDirectMode:true,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas}}if(n.oauthEnv){let a=process.env[n.oauthEnv];if(a)return {type:e,apiKey:a,isDirectMode:true,isOAuth:true,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas}}let o=n.oauthEnv?`, oauthToken (Claude Max), or ${n.oauthEnv}`:"";throw new Error(`No API key found for ${e}. Set apiKey (gateway), providerApiKey (direct)${o}, or ${O} / ${n.apiKeyEnv} env var.`)}async function Se(){let c=process.env[O];if(c)try{let{createE2BProvider:n}=await import('@evolvingmachines/e2b');return process.env.E2B_API_URL=Be(),n({apiKey:c})}catch(n){let s=n;throw s.message?.includes("Cannot find module")||s.message?.includes("MODULE_NOT_FOUND")?new Error(`${O} is set but @evolvingmachines/e2b failed to load.
|
|
21
21
|
Try reinstalling: npm install @evolvingmachines/sdk`):s}let e=process.env[re];if(e)try{let{createE2BProvider:n}=await import('@evolvingmachines/e2b');return n({apiKey:e})}catch(n){let s=n;throw s.message?.includes("Cannot find module")||s.message?.includes("MODULE_NOT_FOUND")?new Error(`${re} is set but @evolvingmachines/e2b failed to load.
|
|
22
22
|
Try reinstalling: npm install @evolvingmachines/sdk`):s}throw new Error(`No sandbox provider configured. Either:
|
|
23
23
|
1. Set ${O} environment variable (recommended, get key at https://dashboard.evolvingmachines.ai)
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ ${d}
|
|
|
17
17
|
\`\`\``:d}});else if(Array.isArray(d)){for(let f of d)if(f.type==="text"){let h=f.text;m.push({type:"content",content:{type:"text",text:u?`\`\`\`
|
|
18
18
|
${h}
|
|
19
19
|
\`\`\``:h}});}}return {sessionUpdate:"tool_call_update",toolCallId:t,status:u?"failed":"completed",content:m}}function i(p,t){let u=_t[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 $e(c){return oe()(c)}function I(c){switch(c){case "claude":return ne();case "codex":return se();case "gemini":return ie();case "qwen":return oe();default:return ()=>null}}function Rt(c,e){let n=e.trim();return n?I(c)(n):null}function Pt(c,e){let n=[],s=e.split(`
|
|
20
|
-
`),r=I(c);for(let o of s){let a=o.trim();if(!a)continue;let l=r(a);l&&n.push(...l);}return n}function K(){return process.env.EVOLVE_GATEWAY_URL||"https://
|
|
20
|
+
`),r=I(c);for(let o of s){let a=o.trim();if(!a)continue;let l=r(a);l&&n.push(...l);}return n}function K(){return process.env.EVOLVE_GATEWAY_URL||"https://swarmkit-gateway-692833842999.us-central1.run.app"}function Ue(){return `${K()}`}function Be(){return `${K()}/e2b`}function Ne(c){return {"browser-use":{type:"http",url:`${K()}/browser_use/mcp`,headers:{"x-litellm-api-key":`Bearer ${c}`}}}}var O="EVOLVE_API_KEY",re="E2B_API_KEY",je="claude",W=36e5,Le=4,be=100,Ve="/home/user/workspace",J="https://dashboard.evolvingmachines.ai",Ke=".evolve-sdk/observability/sessions",We=100,Je=5e3,ae=3,we=1e3;function R(c){return c!==null&&typeof c=="object"&&"safeParse"in c&&typeof c.safeParse=="function"}function B(c){return JSON.stringify(Et(c,{target:"jsonSchema7"}),null,2)}function N(c){return JSON.stringify(c,null,2)}function Ye(c,e=false){let n={};function s(r,o){for(let a of P.readdirSync(r)){let l=Y.join(r,a),i=o?`${o}/${a}`:a;P.statSync(l).isDirectory()?e&&s(l,i):n[i]=P.readFileSync(l);}}return s(c,""),n}function Ge(c,e){for(let[n,s]of Object.entries(e)){let r=Y.join(c,n),o=Y.dirname(r);P.mkdirSync(o,{recursive:true});let a;s instanceof ArrayBuffer||s instanceof Uint8Array?a=Buffer.from(s):a=s,P.writeFileSync(r,a);}}function Ce(c){let e=c?.type??je,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 a=c.providerBaseUrl??process.env[n.baseUrlEnv]??n.defaultBaseUrl;return {type:e,apiKey:c.providerApiKey,baseUrl:a,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[O];if(s)return {type:e,apiKey:s,isDirectMode:false,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas};let r=process.env[n.apiKeyEnv];if(r){let a=process.env[n.baseUrlEnv]??n.defaultBaseUrl;return {type:e,apiKey:r,baseUrl:a,isDirectMode:true,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas}}if(n.oauthEnv){let a=process.env[n.oauthEnv];if(a)return {type:e,apiKey:a,isDirectMode:true,isOAuth:true,model:c?.model,reasoningEffort:c?.reasoningEffort,betas:c?.betas}}let o=n.oauthEnv?`, oauthToken (Claude Max), or ${n.oauthEnv}`:"";throw new Error(`No API key found for ${e}. Set apiKey (gateway), providerApiKey (direct)${o}, or ${O} / ${n.apiKeyEnv} env var.`)}async function Se(){let c=process.env[O];if(c)try{let{createE2BProvider:n}=await import('@evolvingmachines/e2b');return process.env.E2B_API_URL=Be(),n({apiKey:c})}catch(n){let s=n;throw s.message?.includes("Cannot find module")||s.message?.includes("MODULE_NOT_FOUND")?new Error(`${O} is set but @evolvingmachines/e2b failed to load.
|
|
21
21
|
Try reinstalling: npm install @evolvingmachines/sdk`):s}let e=process.env[re];if(e)try{let{createE2BProvider:n}=await import('@evolvingmachines/e2b');return n({apiKey:e})}catch(n){let s=n;throw s.message?.includes("Cannot find module")||s.message?.includes("MODULE_NOT_FOUND")?new Error(`${re} is set but @evolvingmachines/e2b failed to load.
|
|
22
22
|
Try reinstalling: npm install @evolvingmachines/sdk`):s}throw new Error(`No sandbox provider configured. Either:
|
|
23
23
|
1. Set ${O} environment variable (recommended, get key at https://dashboard.evolvingmachines.ai)
|