@agensis/agensis-agent 0.0.5
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 +21 -0
- package/README.md +94 -0
- package/bin/agensis.mjs +40 -0
- package/package.json +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 agensis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# @agensis/agensis-agent
|
|
2
|
+
|
|
3
|
+
Run a local [agensis](https://agensis.io) workspace agent daemon from your machine.
|
|
4
|
+
|
|
5
|
+
It connects to an agensis workspace over WebSocket, receives `@mention` jobs,
|
|
6
|
+
runs your configured coding CLI in the local folder, and posts results back to
|
|
7
|
+
the workspace. The installed command is `agensis`.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install -g @agensis/agensis-agent
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or run without installing:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npx @agensis/agensis-agent agensis --help
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Connect an agent
|
|
22
|
+
|
|
23
|
+
In agensis, open the agent profile, choose **Connect**, and copy the generated
|
|
24
|
+
command. It looks like:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
agensis connect \
|
|
28
|
+
--url https://agensis.io \
|
|
29
|
+
--token aga_... \
|
|
30
|
+
--workspace <workspace-id> \
|
|
31
|
+
--agent <agent-id> \
|
|
32
|
+
--handle general \
|
|
33
|
+
--name general \
|
|
34
|
+
--model claude-haiku-4-5 \
|
|
35
|
+
--permission-mode default
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Run it from the folder where the coding CLI should execute:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
cd /path/to/repo
|
|
42
|
+
agensis connect --url ... --token ... --workspace ... --agent ...
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The command stays connected, sends heartbeats, accepts queued jobs, and exits on
|
|
46
|
+
Ctrl+C.
|
|
47
|
+
|
|
48
|
+
## Options
|
|
49
|
+
|
|
50
|
+
Required:
|
|
51
|
+
|
|
52
|
+
- `--url <url>` — agensis app/backend URL, e.g. `https://agensis.io` or `http://localhost:5173`
|
|
53
|
+
- `--token <token>` — agent connection token from agensis
|
|
54
|
+
- `--workspace <id>` — workspace id
|
|
55
|
+
- `--agent <id>` — workspace agent id
|
|
56
|
+
|
|
57
|
+
Optional:
|
|
58
|
+
|
|
59
|
+
- `--handle <name>` — mention handle used in channels
|
|
60
|
+
- `--name <name>` — display name
|
|
61
|
+
- `--cwd <path>` — folder where the coding CLI runs
|
|
62
|
+
- `--coding-cmd <command>` — command used for jobs (default `claude -p`)
|
|
63
|
+
- `--model <id>` — default model passed to supported coding CLIs
|
|
64
|
+
- `--permission-mode <mode>` — `default`, `accept_edits`, or `yolo`
|
|
65
|
+
- `--yolo` / `--no-sandbox` — alias for `--permission-mode yolo`
|
|
66
|
+
- `--timeout-ms <ms>` — kill a job after this time (default `1800000`)
|
|
67
|
+
- `--heartbeat-ms <ms>` — heartbeat interval (default `15000`)
|
|
68
|
+
- `--once` — run one queued job then exit
|
|
69
|
+
- `--version` — print the CLI version
|
|
70
|
+
- `--help` — show help
|
|
71
|
+
|
|
72
|
+
Environment fallbacks: `AGENSIS_URL`, `AGENSIS_TOKEN`,
|
|
73
|
+
`AGENSIS_WORKSPACE` / `AGENSIS_WORKSPACE_ID`, `AGENSIS_AGENT` / `AGENSIS_AGENT_ID`,
|
|
74
|
+
`AGENSIS_HANDLE`, `AGENSIS_NAME`, `AGENSIS_CWD`, `AGENSIS_CODING_CMD` / `CODING_CMD`,
|
|
75
|
+
`AGENSIS_MODEL` / `CLAUDE_MODEL`, `AGENSIS_PERMISSION_MODE`, `AGENSIS_TIMEOUT_MS`,
|
|
76
|
+
`AGENSIS_HEARTBEAT_MS`, `AGENSIS_ONCE=1`.
|
|
77
|
+
|
|
78
|
+
## Security
|
|
79
|
+
|
|
80
|
+
The daemon runs on your machine and executes the configured coding command in
|
|
81
|
+
the working directory you start it in. Your local credentials and filesystem
|
|
82
|
+
stay local; agensis sends the job payload and receives the result. Treat it like
|
|
83
|
+
any local coding agent with access to that folder.
|
|
84
|
+
|
|
85
|
+
Keep `aga_...` tokens out of shared logs and shell history. Generate a fresh
|
|
86
|
+
token from agensis if one is exposed.
|
|
87
|
+
|
|
88
|
+
## Requirements
|
|
89
|
+
|
|
90
|
+
- Node.js >= 18
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
[MIT](./LICENSE)
|
package/bin/agensis.mjs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import I from"node:process";import U from"node:os";import l from"node:process";import F from"ws";import{spawn as K}from"node:child_process";function G(n){let e=Math.max(0,Math.round(n/1e3)),t=Math.floor(e/60),r=e%60;return t>0?`${t}m ${r}s`:`${r}s`}var H=50*1024*1024;function O(n){let{cmd:e,args:t=[],cwd:r,timeoutMs:o=0,label:s="working",heartbeatMs:c=15e3,now:u=Date.now,log:a=console,signal:f,onData:m}=n||{};return new Promise(h=>{if(f?.aborted){h({status:null,stdout:"",stderr:"",aborted:!0,error:new Error("cancelled")});return}let d;try{d=K(e,t,{cwd:r,detached:!0})}catch(g){h({status:null,stdout:"",stderr:"",error:g});return}let p="",i="";d.stdout?.setEncoding("utf8"),d.stderr?.setEncoding("utf8");let S=(g,b)=>g.length>=H?g:g+b;d.stdout?.on("data",g=>{if(p=S(p,g),m)try{m(g)}catch{}}),d.stderr?.on("data",g=>i=S(i,g));let w=u(),k=c>0?setInterval(()=>{a.log(` \u2026 still ${s} (${G(u()-w)}) \u2014 Ctrl+C to cancel`)},c):null;k?.unref&&k.unref();let A=g=>{if(d.pid!=null)try{process.kill(-d.pid,g)}catch{try{d.kill(g)}catch{}}},x=!1,v=o>0?setTimeout(()=>{x=!0,A("SIGKILL")},o):null;v?.unref&&v.unref();let $=!1,M=null,T=()=>{$=!0,A("SIGTERM"),M=setTimeout(()=>A("SIGKILL"),3e3),M?.unref&&M.unref()};f&&f.addEventListener("abort",T,{once:!0});let D=(g,b)=>{k&&clearInterval(k),v&&clearTimeout(v),M&&clearTimeout(M),f&&f.removeEventListener("abort",T),h({status:g,stdout:p,stderr:i,aborted:$,error:b||($?new Error("cancelled"):x?new Error(`timed out after ${G(o)}`):null)})};d.on("error",g=>D(null,g)),d.on("close",g=>D(g,null))})}function R(n={}){let{runJob:e,concurrency:t=1}=n,r=[],o=null,s=!1,c=[];function u(i){return i==null?!1:o&&!o.cancelled&&o.job.key===i?!0:r.some(S=>S.key===i)}async function a(){if(s)return;for(s=!0;r.length;){let S=r.shift(),w=new AbortController;o={job:S,controller:w};try{await e(S,{signal:w.signal})}catch{}o=null}s=!1;let i=c;c=[];for(let S of i)S()}function f(i){if(i&&i.key!=null&&u(i.key))return{accepted:!1,deduped:!0,position:0,startedImmediately:!1};let S=!o&&r.length===0;r.push(i);let w=r.length+(o?1:0);return a(),{accepted:!0,deduped:!1,position:w,startedImmediately:S}}function m(i){return o?(o.cancelled=!0,o.controller.abort(i||"cancelled"),!0):!1}function h(){return r.length}function d(){return o?1:0}function p(){return!o&&r.length===0?Promise.resolve():new Promise(i=>c.push(i))}return{enqueue:f,cancelActive:m,has:u,size:h,active:d,idle:p}}var j=30*60*1e3,V=15*1e3,Q="claude-opus-4-8",N="0.0.5";async function W(n={}){let e=Y(n),t=!1,r=null,o=null,s=null,c=0,u=null,a=null,f="",m=()=>{t=!0,o&&clearTimeout(o),s&&clearInterval(s);try{r?.close()}catch{}u&&u()};a=R({runJob:async(d,p)=>{await ee(e,d,p),e.once&&m()}}),l.once("SIGINT",m),l.once("SIGTERM",m);let h=()=>{if(t)return;let d=X(e.url,e.token,e);f="",E(`Connecting to ${d.replace(e.token,"redacted")}`),r=new F(d),r.on("open",()=>{E(`Connected. Registering @${e.handle||"agent"} from ${e.cwd}`),_(r,{action:"agent_register",workspaceId:e.workspace,agentId:e.agent,handle:e.handle,name:e.name,host:U.hostname(),cwd:e.cwd,metadata:{codingCmd:e.codingCmd,model:e.model,permissionMode:e.permissionMode,permissionFlags:C(e.permissionMode),once:e.once,runtime:"agensis",version:N}}),s=setInterval(()=>{_(r,{action:"agent_heartbeat",metadata:{busy:a.active()>0,queueSize:a.size(),cwd:e.cwd,model:e.model,permissionMode:e.permissionMode,permissionFlags:C(e.permissionMode)}})},e.heartbeatMs),s.unref&&s.unref()}),r.on("message",p=>{let i=ae(p);if(i){if(i.type==="agent_registered"){P(e,i.agent),E(`Registered as ${i.connection?.name||e.name} on ${i.connection?.host||U.hostname()}`);return}if(i.type==="agent_config"){P(e,i.agent),E(`Updated config for @${e.handle||"agent"}: model=${e.model}, permission=${e.permissionMode}`);return}if(i.type==="error"){E(`Server rejected request: ${i.message||"unknown error"}`);return}if(i.type==="agent_job"&&i.job?.id){let S=a.enqueue({...i.job,key:i.job.id,ws:r});S.accepted&&(c+=1,E(`Queued job ${i.job.id} at position ${S.position}`),e.once&&a.idle().then(()=>m()))}}}),r.on("close",(p,i)=>{if(E(`Socket closed (${p||"no-code"}${i?`: ${i}`:""})`),s&&(clearInterval(s),s=null),f==="ECONNREFUSED"&&Z(e.url)){E("Local agent backend is not running on 127.0.0.1:3142."),E("Start it in another terminal with: npm run backend"),E("Then rerun this connect command."),m();return}e.once&&c>0&&a.active()===0&&a.size()===0&&m(),!(t||e.once)&&(o=setTimeout(h,2e3),o.unref&&o.unref())}),r.on("error",p=>{f=p?.code||"",E(`Socket error: ${p?.message||p}`)})};h(),await new Promise(d=>{let p=setInterval(async()=>{e.once&&c>0&&a.active()===0&&a.size()===0&&m(),t&&m()},500);u=()=>{clearInterval(p),d()}}),u=null,l.off("SIGINT",m),l.off("SIGTERM",m)}function Y(n){let e={url:String(n.url||n.baseUrl||l.env.AGENSIS_URL||"").trim(),token:String(n.token||l.env.AGENSIS_TOKEN||"").trim(),workspace:String(n.workspace||n.workspaceId||l.env.AGENSIS_WORKSPACE||l.env.AGENSIS_WORKSPACE_ID||"").trim(),agent:String(n.agent||n.agentId||l.env.AGENSIS_AGENT||l.env.AGENSIS_AGENT_ID||"").trim(),handle:J(n.handle||l.env.AGENSIS_HANDLE||n.name||l.env.AGENSIS_NAME||"agent"),name:String(n.name||l.env.AGENSIS_NAME||n.handle||l.env.AGENSIS_HANDLE||"agensis Agent").trim(),cwd:String(n.cwd||l.env.AGENSIS_CWD||l.cwd()).trim(),codingCmd:String(n.codingCmd||l.env.AGENSIS_CODING_CMD||l.env.CODING_CMD||"claude -p").trim(),model:L(n.model||l.env.AGENSIS_MODEL||l.env.CLAUDE_MODEL||""),permissionMode:y(n.permissionMode||n.permission_mode||n.permission||l.env.AGENSIS_PERMISSION_MODE||"default"),timeoutMs:Number(n.timeoutMs||l.env.AGENSIS_TIMEOUT_MS||j),heartbeatMs:Number(n.heartbeatMs||l.env.AGENSIS_HEARTBEAT_MS||V),once:!!(n.once||l.env.AGENSIS_ONCE==="1"),exitOnOnce:!!n.exitOnOnce},t=[];if(e.url||t.push("--url"),e.token||t.push("--token"),e.workspace||t.push("--workspace"),e.agent||t.push("--agent"),t.length)throw new Error(`Missing required option(s): ${t.join(", ")}`);return e}function X(n,e,t={}){let r=z(n);return r.protocol=r.protocol==="https:"?"wss:":"ws:",r.pathname="/backend/ws",r.search="",r.searchParams.set("agentToken",e),t.workspace&&r.searchParams.set("workspaceId",t.workspace),t.agent&&r.searchParams.set("agentId",t.agent),r.toString()}function z(n){let e=new URL(n);return(e.hostname==="localhost"||e.hostname==="127.0.0.1"||e.hostname==="0.0.0.0")&&e.port==="8888"&&(e.protocol="http:",e.hostname="127.0.0.1",e.port="3142"),e}function Z(n){try{let e=z(n);return(e.hostname==="localhost"||e.hostname==="127.0.0.1"||e.hostname==="0.0.0.0")&&e.port==="3142"}catch{return!1}}async function ee(n,e,{signal:t}){let r=Date.now();E(`Starting job ${e.id}`);let o=te(n,e),s=ne(n,e),c="",u="",a=0,f=(w="")=>{_(e.ws,{action:"agent_job_delta",jobId:e.id,content:w,elapsedMs:Date.now()-r,model:o.model,permissionMode:o.permissionMode,permissionFlags:o.permissionFlags})};f("");let m=setInterval(()=>f(c),1e3);m.unref&&m.unref();let h=await O({cmd:o.cmd,args:[...o.args,s],cwd:n.cwd,timeoutMs:n.timeoutMs,heartbeatMs:n.heartbeatMs,label:"agent job",signal:t,onData:w=>{c+=String(w||""),u=le(`${u}
|
|
3
|
+
${w}`);let k=Date.now();k-a>500&&(a=k,f(c))}});clearInterval(m);let d=String(h.stdout||"").trim(),p=String(h.stderr||"").trim(),i=h.error?h.error.message:h.status===0?"":p||`Command exited with status ${h.status}`,S=d||(i?"":p)||u||"";_(e.ws,{action:"agent_job_result",jobId:e.id,response:S,error:i,elapsedMs:Date.now()-r,model:o.model,permissionMode:o.permissionMode,permissionFlags:o.permissionFlags}),E(`Finished job ${e.id} in ${Math.round((Date.now()-r)/1e3)}s`),n.once&&(E("One-shot job complete; exiting."),setTimeout(()=>l.exit(0),150))}function ne(n,e){let t=e.agent||{},r=Array.isArray(t.skills)?t.skills.join(", "):String(t.skills||""),o=Array.isArray(t.tools)?t.tools.join(", "):String(t.tools||""),s=q(n,e),c=B(n,e);return["You are running as a local agensis workspace agent daemon.",`Workspace: ${e.workspaceId||n.workspace}`,`Channel session: ${e.sessionId||""}`,`Agent: ${t.name||n.name} (@${t.handle||n.handle})`,`Requested model: ${s}`,`Permission mode: ${c}`,t.description?`Description:
|
|
4
|
+
${t.description}`:"",t.soul?`Soul:
|
|
5
|
+
${t.soul}`:"",t.system_prompt?`System instructions:
|
|
6
|
+
${t.system_prompt}`:"",t.instructions?`Additional instructions:
|
|
7
|
+
${t.instructions}`:"",o?`Enabled tools:
|
|
8
|
+
${o}`:"",r?`Enabled skills:
|
|
9
|
+
${r}`:"","Respond with a clear channel-ready result. If you changed files, summarize the files and verification. If you cannot complete it, say exactly why.","User message:",String(e.prompt||"")].filter(Boolean).join(`
|
|
10
|
+
|
|
11
|
+
`)}function te(n,e){let{cmd:t,args:r}=ie(n.codingCmd),o=q(n,e),s=B(n,e),c=oe(r),u=C(s);if(re(t)){let a=[...c];return o&&a.push("--model",o),s==="accept_edits"&&a.push("--permission-mode","acceptEdits"),s==="yolo"&&a.push("--dangerously-skip-permissions"),{cmd:t,args:a,model:o,permissionMode:s,permissionFlags:u}}if(se(t)){let a=[...c];return o&&a.push("--model",o),s==="yolo"&&a.push("--sandbox","danger-full-access","--ask-for-approval","never"),{cmd:t,args:a,model:o,permissionMode:s,permissionFlags:u}}return{cmd:t,args:r,model:o,permissionMode:s,permissionFlags:u}}function q(n,e){return L(e?.agent?.model||e?.model||n.model)}function L(n){let e=String(n||"").trim();return!e||e==="auto"||e==="claude-fable-5"?Q:e}function B(n,e){return y(e?.agent?.permissionMode||e?.agent?.permission_mode||e?.permissionMode||e?.permission_mode||n.permissionMode)}function y(n){let e=String(n||"").trim().toLowerCase().replace(/[-\s]+/g,"_");return["yolo","no_sandbox","danger","danger_full_access","dangerously_skip_permissions"].includes(e)?"yolo":["accept_edits","acceptedits","auto_approve","auto_approve_edits"].includes(e)?"accept_edits":"default"}function C(n){return y(n)==="yolo"?["--no-sandbox","--yolo"]:[]}function P(n,e){if(!e||typeof e!="object")return;e.name&&(n.name=String(e.name).trim()||n.name),(e.handle||e.name)&&(n.handle=J(e.handle||e.name||n.handle)),e.model&&(n.model=L(e.model));let t=e.permissionMode||e.permission_mode;t&&(n.permissionMode=y(t))}function oe(n){let e=new Set(["--model","-m","--permission-mode","--sandbox","--ask-for-approval","--approval-policy"]),t=new Set(["--dangerously-skip-permissions","--no-sandbox","--yolo","--accept-edits"]),r=[];for(let o=0;o<n.length;o+=1){let s=n[o],[c]=String(s).split("=",1);if(!t.has(s)){if(e.has(c)){String(s).includes("=")||(o+=1);continue}r.push(s)}}return r}function re(n){return/(^|\/)claude(?:$|\.)/.test(String(n||""))}function se(n){return/(^|\/)codex(?:$|\.)/.test(String(n||""))}function ie(n){let e=[],t="",r="",o=!1;for(let s of n){if(o){t+=s,o=!1;continue}if(s==="\\"){o=!0;continue}if(r){s===r?r="":t+=s;continue}if(s==='"'||s==="'"){r=s;continue}if(/\s/.test(s)){t&&(e.push(t),t="");continue}t+=s}if(t&&e.push(t),!e.length)throw new Error("coding command is empty");return{cmd:e[0],args:e.slice(1)}}function ae(n){try{return JSON.parse(String(n))}catch{return null}}function _(n,e){return!n||n.readyState!==F.OPEN?!1:(n.send(JSON.stringify(e)),!0)}function le(n){return String(n||"").split(/\r?\n/).map(e=>e.trim()).filter(Boolean).slice(-1)[0]||""}function J(n){return String(n||"").trim().toLowerCase().replace(/^@+/,"").replace(/[^a-z0-9_.-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function E(n){l.stderr.write(`[agensis] ${n}
|
|
12
|
+
`)}function ce(n){let e={command:"connect"},t=[...n],r=t[0];r&&!r.startsWith("-")&&(e.command=t.shift());for(let o=0;o<t.length;o+=1){let s=t[o];if(!s.startsWith("--"))throw new Error(`Unexpected argument: ${s}`);let[c,u]=s.slice(2).split(/=(.*)/s,2),a=c.replace(/-([a-z])/g,(m,h)=>h.toUpperCase());if(a==="help"){e.help=!0;continue}if(a==="version"){e.version=!0;continue}if(a==="once"){e.once=!0;continue}if(a==="yolo"||a==="noSandbox"){e.permissionMode="yolo";continue}if(a==="acceptEdits"){e.permissionMode="accept_edits";continue}let f=u!==void 0?u:t[++o];if(f==null||f.startsWith("--"))throw new Error(`Missing value for --${c}`);e[a]=f}return e}function ue(){return`agensis agent daemon
|
|
13
|
+
|
|
14
|
+
Usage:
|
|
15
|
+
agensis --url <workspace-url> --token <token> --workspace <id> --agent <id> [options]
|
|
16
|
+
agensis connect --url <workspace-url> --token <token> --workspace <id> --agent <id> [options]
|
|
17
|
+
|
|
18
|
+
Required:
|
|
19
|
+
--url <url> agensis app/backend URL, for example https://agensis.io or http://localhost:5173
|
|
20
|
+
--token <token> Agent connection token from agensis
|
|
21
|
+
--workspace <id> Workspace id
|
|
22
|
+
--agent <id> Workspace agent id
|
|
23
|
+
|
|
24
|
+
Options:
|
|
25
|
+
--handle <name> Mention handle used in channels
|
|
26
|
+
--name <name> Display name
|
|
27
|
+
--cwd <path> Folder where the coding CLI runs
|
|
28
|
+
--coding-cmd <command> Command used for jobs, default: claude -p
|
|
29
|
+
--model <id> Default model to pass to supported coding CLIs
|
|
30
|
+
--permission-mode <m> default, accept_edits, or yolo
|
|
31
|
+
--yolo Alias for --permission-mode yolo
|
|
32
|
+
--no-sandbox Alias for --permission-mode yolo
|
|
33
|
+
--timeout-ms <ms> Kill a job after this time, default: 1800000
|
|
34
|
+
--heartbeat-ms <ms> Local terminal heartbeat interval, default: 15000
|
|
35
|
+
--once Run one queued job then exit
|
|
36
|
+
--version Print the CLI version
|
|
37
|
+
--help Show this help
|
|
38
|
+
`}async function de(){let n=ce(I.argv.slice(2));if(n.help){I.stdout.write(ue());return}if(n.version){I.stdout.write(`${N}
|
|
39
|
+
`);return}if(n.command!=="connect")throw new Error(`Unknown command "${n.command}". Use "agensis --url ..." or "agensis connect --url ...".`);n.exitOnOnce=!0,await W(n),n.once&&I.exit(0)}de().catch(n=>{I.stderr.write(`${n?.message||n}
|
|
40
|
+
`),I.exitCode=1});
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agensis/agensis-agent",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "Run a local agensis workspace agent daemon. Connects to a workspace, receives @mention jobs, runs a configured coding CLI in the local folder, and posts results back to agensis. Ships as a single minified bundle.",
|
|
5
|
+
"homepage": "https://agensis.io",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/jasonkneen/agensis.git",
|
|
9
|
+
"directory": "agent/agensis-agent"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/jasonkneen/agensis/issues"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"bin": {
|
|
16
|
+
"agensis": "bin/agensis.mjs",
|
|
17
|
+
"agensis-agent": "bin/agensis.mjs"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"bin/agensis.mjs",
|
|
21
|
+
"README.md",
|
|
22
|
+
"LICENSE"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"agensis",
|
|
29
|
+
"workspace",
|
|
30
|
+
"agent",
|
|
31
|
+
"daemon",
|
|
32
|
+
"claude-code",
|
|
33
|
+
"codex",
|
|
34
|
+
"cursor",
|
|
35
|
+
"coding-agent"
|
|
36
|
+
],
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"ws": "^8.20.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"esbuild": "^0.21.5"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "node build.mjs",
|
|
45
|
+
"prepack": "node build.mjs",
|
|
46
|
+
"pack:dry-run": "npm pack --dry-run"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"license": "MIT"
|
|
52
|
+
}
|