@nodus-ai/equile 0.0.1-preview

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/nodus.js ADDED
@@ -0,0 +1 @@
1
+ var u=class extends Error{constructor(p,a,n){super(p);this.status=a;this.data=n;this.name="NodusError";let d=n&&typeof n=="object"?n:null;this.code=typeof d?.code=="string"?d.code:null,this.retryAt=typeof d?.retryAt=="string"?d.retryAt:null;}status;data;code;retryAt},k=new Set(["completed","failed","cancelled","timed_out"]);function I(m){let R=m.baseUrl.replace(/\/+$/,""),p=m.fetch??globalThis.fetch,a=m.requestTimeoutMs??9e5,n=async(e,t,s,r={})=>{let o=new AbortController,i=r.timeoutMs??a,l=()=>o.abort(r.signal?.reason);r.signal?.addEventListener("abort",l,{once:true});let g=setTimeout(()=>o.abort(new Error("Nodus request timed out.")),i);try{let c=await p(`${R}${t}`,{method:e,headers:{authorization:`Bearer ${m.apiKey}`,...s===void 0?{}:{"content-type":"application/json"}},...s===void 0?{}:{body:JSON.stringify(s)},signal:o.signal}),y=await c.json().catch(()=>({}));if(!c.ok)throw new u(String(y.error??`Nodus request failed: ${c.status}`),c.status,y);return y}catch(c){throw r.signal?.aborted?new u("Nodus request was aborted.",499,null):o.signal.aborted?new u("Nodus request timed out.",504,{method:e,path:t,timeoutMs:i}):c}finally{clearTimeout(g),r.signal?.removeEventListener("abort",l);}},d=async(e,t={})=>{let s=Date.now()+(t.timeoutMs??18e5),r=t.pollIntervalMs??1e3;for(;Date.now()<s;){if(t.signal?.aborted)throw new u("Nodus agent run was aborted.",499,null);let{run:o}=await n("GET",`/agent-runs/${encodeURIComponent(e)}?view=status`,void 0,{signal:t.signal});if(k.has(o.status)&&!o.cleanupCompletedAt){await new Promise(i=>setTimeout(i,r));continue}if(o.status==="completed")return (await n("GET",`/agent-runs/${encodeURIComponent(e)}`)).run;if(k.has(o.status))throw new u(o.error??`Nodus agent run ${o.status}.`,502,{run:o});await new Promise(i=>setTimeout(i,r));}throw new u("Timed out waiting for Nodus agent run.",504,{runId:e})},b=(e,t={})=>n("GET",`/agent-runs/${encodeURIComponent(e)}/events?after=${t.after??0}&detail=full`),f=(e,t={})=>n("GET",`/runtime-sessions/${encodeURIComponent(e)}/events?after=${t.after??0}&detail=full`),w=async(e,t)=>{let s=Date.now()+(t.timeoutMs??144e5),r=t.afterSequence??0,o=[];for(;Date.now()<s;){if(t.signal?.aborted)throw new u("Nodus session turn was aborted.",499,null);let i=Math.max(10,Math.ceil((s-Date.now())/1e3)),l=Math.min(840,t.waitSeconds??840,i),g=await n("POST",`/runtime-sessions/${encodeURIComponent(e)}/wait?detail=full`,{turnId:t.turnId,afterSequence:r,timeoutSeconds:l},{signal:t.signal,timeoutMs:Math.max(a,(l+30)*1e3)});o.push(...g.events),r=Math.max(r,g.lastSequence);let c={...g,events:o};if(g.status==="completed")return c;if(g.status==="failed")throw new u(g.error??"Nodus session turn failed.",502,c)}throw new u("Timed out waiting for Nodus session turn.",504,{sessionId:e,turnId:t.turnId,afterSequence:r})},h=async function*(e,t={},s){let r=t.after??0,o=t.pollIntervalMs??1e3;for(;!t.signal?.aborted;){let{events:i}=await e(r,t.signal);for(let l of i)r=Math.max(r,l.sequence),yield l;if(s&&await s())return;await new Promise(l=>setTimeout(l,o));}};return {agents:{list:async()=>(await n("GET","/agent-runs/agents")).agents,create:e=>n("POST","/agent-runs/agents",e),update:(e,t)=>n("PATCH",`/agent-runs/agents/${encodeURIComponent(e)}/configuration`,t),setRunConcurrency:(e,t)=>n("POST",`/agent-runs/agents/${encodeURIComponent(e)}/concurrency`,{maxConcurrency:t}),quota:(e,t)=>n("GET",`/agent-runs/agents/${encodeURIComponent(e)}/quota${t?.refresh?"?refresh=1":""}`),setConcurrency:(e,t)=>n("POST",`/agent-runs/agents/${encodeURIComponent(e)}/concurrency`,{maxConcurrency:t})},agentRuns:{list:(e={})=>{let t=new URLSearchParams;e.agentId&&t.set("agentId",e.agentId),e.status&&t.set("status",e.status),e.cursor&&t.set("cursor",e.cursor),e.limit&&t.set("limit",String(e.limit));for(let[s,r]of Object.entries(e.metadata??{}))t.append("metadata",`${s}=${r}`);return n("GET",`/agent-runs?${t}`)},queueStats:()=>n("GET","/agent-runs/queue-stats"),create:e=>n("POST","/agent-runs",e),get:e=>n("GET",`/agent-runs/${encodeURIComponent(e)}`),events:b,stream:(e,t)=>h((s,r)=>n("GET",`/agent-runs/${encodeURIComponent(e)}/events?after=${s}&detail=full`,void 0,{signal:r}),t,async()=>{let{run:s}=await n("GET",`/agent-runs/${encodeURIComponent(e)}?view=status`);return k.has(s.status)&&!!s.cleanupCompletedAt}),cancel:e=>n("POST",`/agent-runs/${encodeURIComponent(e)}/cancel`),cancelMany:e=>Promise.all(e.map(async t=>(await n("POST",`/agent-runs/${encodeURIComponent(t)}/cancel`)).run)),getArtifactDownloadUrl:(e,t)=>n("GET",`/agent-runs/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}/download`),wait:d,createAndWait:async(e,t)=>{let{run:s}=await n("POST","/agent-runs",e);return s.status==="completed"&&s.cleanupCompletedAt?s:d(s.id,t)}},sessions:{create:e=>n("POST","/runtime-sessions",e),list:(e={})=>{let t=new URLSearchParams(Object.entries(e).filter(s=>s[1]!==void 0).map(([s,r])=>[s,String(r)]));return n("GET",`/runtime-sessions${t.size?`?${t}`:""}`)},get:e=>n("GET",`/runtime-sessions/${encodeURIComponent(e)}`),telemetry:e=>n("GET",`/runtime-sessions/${encodeURIComponent(e)}/telemetry`),telemetryHistory:(e,t={})=>{let s=new URLSearchParams(Object.entries(t).filter(r=>r[1]!==void 0).map(([r,o])=>[r,String(o)]));return n("GET",`/runtime-sessions/${encodeURIComponent(e)}/telemetry-history${s.size?`?${s}`:""}`)},diff:(e,t)=>n("GET",`/runtime-sessions/${encodeURIComponent(e)}/diff${t?`?known=${encodeURIComponent(t)}`:""}`),terminalTicket:e=>n("POST",`/runtime-sessions/${encodeURIComponent(e)}/terminal-ticket`),ports:(e,t)=>n("GET",`/runtime-sessions/${encodeURIComponent(e)}/ports${t?`?known=${encodeURIComponent(t)}`:""}`),git:(e,t)=>n("POST",`/runtime-sessions/${encodeURIComponent(e)}/git`,t),run:(e,t,s={})=>n("POST",`/runtime-sessions/${encodeURIComponent(e)}/messages`,{text:t,...s.attachments?.length?{attachments:s.attachments}:{}}),execWorkspace:(e,t,s)=>n("POST",`/runtime-sessions/${encodeURIComponent(e)}/workspace/exec`,{cmd:t,...s?{timeoutSeconds:s}:{}},{timeoutMs:s?Math.max(a,(s+30)*1e3):a}),waitForIdle:w,runAndWait:async(e,t,s={})=>{let{attachments:r,...o}=s,{turn:i}=await n("POST",`/runtime-sessions/${encodeURIComponent(e)}/messages`,{text:t,...r?.length?{attachments:r}:{}});return w(e,{...o,turnId:i.id,afterSequence:i.acceptedSequence})},events:f,stream:(e,t)=>h((s,r)=>n("GET",`/runtime-sessions/${encodeURIComponent(e)}/events?after=${s}&detail=full`,void 0,{signal:r}),t),pause:e=>n("POST",`/runtime-sessions/${encodeURIComponent(e)}/pause`),resume:e=>n("POST",`/runtime-sessions/${encodeURIComponent(e)}/resume`),activate:e=>n("POST",`/runtime-sessions/${encodeURIComponent(e)}/activate`),destroy:e=>n("DELETE",`/runtime-sessions/${encodeURIComponent(e)}`)},workspaces:{create:e=>n("POST","/workspace-runtimes",e),list:async()=>(await n("GET","/workspace-runtimes")).workspaces,get:e=>n("GET",`/workspace-runtimes/${encodeURIComponent(e)}`),archive:e=>n("DELETE",`/workspace-runtimes/${encodeURIComponent(e)}`),revisions:async e=>{let t=await n("GET",`/workspace-runtimes/${encodeURIComponent(e)}/revisions`);if(!Array.isArray(t.revisions))throw new Error("Invalid Workspace revisions response.");return t.revisions},startBuilder:(e,t={})=>n("POST",`/workspace-runtimes/${encodeURIComponent(e)}/builds`,{mode:"interactive",...t}),getBuild:e=>n("GET",`/workspace-builds/${encodeURIComponent(e)}`),exec:(e,t,s)=>n("POST",`/workspace-builds/${encodeURIComponent(e)}/exec`,{cmd:t,...s?{timeoutSeconds:s}:{}},{timeoutMs:s?Math.max(a,(s+30)*1e3):a}),listFiles:(e,t="/")=>n("GET",`/workspace-builds/${encodeURIComponent(e)}/files?path=${encodeURIComponent(t)}`),readFile:(e,t)=>n("GET",`/workspace-builds/${encodeURIComponent(e)}/file?path=${encodeURIComponent(t)}`),writeFile:(e,t,s)=>n("PUT",`/workspace-builds/${encodeURIComponent(e)}/file`,{path:t,contentBase64:Buffer.from(s).toString("base64")}),upload:(e,t,s)=>n("PUT",`/workspace-builds/${encodeURIComponent(e)}/file`,{path:t,contentBase64:Buffer.from(s).toString("base64")}),download:async(e,t)=>Buffer.from((await n("GET",`/workspace-builds/${encodeURIComponent(e)}/file?path=${encodeURIComponent(t)}`)).contentBase64,"base64"),publish:e=>n("POST",`/workspace-builds/${encodeURIComponent(e)}/publish`),destroyBuilder:e=>n("DELETE",`/workspace-builds/${encodeURIComponent(e)}`),createContextUpload:e=>n("POST",`/workspace-runtimes/${encodeURIComponent(e)}/context-upload`),buildFromDockerfile:(e,t)=>n("POST",`/workspace-runtimes/${encodeURIComponent(e)}/builds`,{mode:"dockerfile",...t}),buildFromContext:(e,t)=>n("POST",`/workspace-runtimes/${encodeURIComponent(e)}/builds`,{mode:"dockerfile",...t})},desktopRuntimes:{list:async(e={})=>(await n("GET",`/desktop-runtimes${e.agentId?`?agentId=${encodeURIComponent(e.agentId)}`:""}`)).desktopRuntimes,get:e=>n("GET",`/desktop-runtimes/${encodeURIComponent(e)}`),rename:(e,t)=>n("PATCH",`/desktop-runtimes/${encodeURIComponent(e)}`,{name:t}),bind:(e,t)=>n("PATCH",`/desktop-runtimes/${encodeURIComponent(e)}/bind`,{agentId:t}),grants:e=>n("GET",`/desktop-runtimes/${encodeURIComponent(e)}/grants`),grant:(e,t,s)=>n("PUT",`/desktop-runtimes/${encodeURIComponent(e)}/grants/${encodeURIComponent(t)}`,{permission:s}),revokeGrant:(e,t)=>n("DELETE",`/desktop-runtimes/${encodeURIComponent(e)}/grants/${encodeURIComponent(t)}`),browse:(e,t={})=>n("POST",`/desktop-runtimes/${encodeURIComponent(e)}/browse`,t),read:(e,t)=>n("POST",`/desktop-runtimes/${encodeURIComponent(e)}/read`,{path:t}),ports:(e,t)=>n("POST",`/desktop-runtimes/${encodeURIComponent(e)}/ports`,t?{known:t}:{}),attach:(e,t)=>n("POST",`/desktop-runtimes/${encodeURIComponent(e)}/attach`,t),terminalTicket:e=>n("POST",`/desktop-runtimes/${encodeURIComponent(e)}/terminal-ticket`),reveal:(e,t)=>n("POST",`/desktop-runtimes/${encodeURIComponent(e)}/reveal`,t),disconnect:e=>n("DELETE",`/desktop-runtimes/${encodeURIComponent(e)}`)}}}var A="0.4.0-preview.47";function v(){return {workspaceCredentialFailover:true,fixedSessionIdentity:true,persistentSessionSnapshots:true,runtimeResourceTelemetry:true,cliIntrospection:true,inlineRunResources:true,sessionAttachments:true,providers:["claude","codex","grok","gemini","cursor","factory"]}}function T(){return [{command:"nodus login|auth status|logout",description:"Authorize the CLI in a browser and manage local credential profiles."},{command:"nodus sdk",description:"List installed SDK methods, features, and CLI commands."},{command:"nodus capabilities",description:"Alias for `nodus sdk`."},{command:"nodus agents list|quota|configure|concurrency",description:"Inspect and configure every Agent available to the SDK key."},{command:"nodus agents deploy --provider <provider> --api-key <key> [--name <displayName>] [--owner-tag <tag>]",description:"Create an Agent in the key's Workspace and authenticate it with a provider API key."},{command:"nodus run --agent <id> --prompt <text> [--goal-file <markdown>] [--attach <file>]... [--wait]",description:"Run one task on a specific Agent. Goal Markdown is stored separately from the initial prompt."},{command:"nodus run --provider <provider> [--model <model>] --prompt <text> [--goal-file <markdown>] [--attach <file>]... [--wait]",description:"Let a Workspace key route a task; --goal-file enables Codex Goal mode."},{command:"nodus runs list|get|events|cancel|artifact",description:"Inspect and control existing Agent Runs, including artifact download URLs."},{command:"nodus session list|create|get|run|exec|events|telemetry|telemetry-history|diff|ports|git|terminal-ticket|pause|resume|destroy",description:"List, create, observe, and control persistent or temporary runtime Sessions."},{command:"nodus workspace create|list|get|revisions|archive|build",description:"Create, inspect, archive, and build persistent Workspace runtimes."},{command:"nodus workspace builder start|exec|put|get|files|status|publish|destroy",description:"Build and publish Workspace revisions interactively."},{command:"nodus desktop connect|list|get|rename|browse|read|ports|attach|reveal|terminal-ticket|disconnect",description:"Attach, inspect, control, or disconnect a local Desktop runtime."},{command:"nodus desktop bind --desktop <id> [--agent <id>|--none]",description:"Bind a Desktop runtime to one Agent (only that Agent's runs/sessions may use it) or unbind it."}]}function C(m){let R=[],p=(a,n="")=>{if(!(!a||typeof a!="object"))for(let[d,b]of Object.entries(a)){let f=n?`${n}.${d}`:d;typeof b=="function"?R.push(f):p(b,f);}};return p(m),R.sort()}export{A as NODUS_SDK_VERSION,u as NodusError,I as createNodus,T as getNodusCliManifest,v as getNodusFeatureManifest,C as listNodusCapabilities};
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@nodus-ai/equile",
3
+ "version": "0.0.1-preview",
4
+ "description": "Equile preview CLI + SDK for running user-owned Codex, Claude, and other runtime agents.",
5
+ "type": "module",
6
+ "main": "./dist/nodus.cjs",
7
+ "module": "./dist/nodus.js",
8
+ "types": "./dist/nodus.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/nodus.d.ts",
12
+ "import": "./dist/nodus.js",
13
+ "require": "./dist/nodus.cjs"
14
+ }
15
+ },
16
+ "bin": {
17
+ "equile": "dist/cli.js"
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "README.md"
22
+ ],
23
+ "sideEffects": false,
24
+ "engines": {
25
+ "node": ">=18"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ }
30
+ }