@sleep2agi/agent-node 2.4.15-preview.1 → 2.4.15-preview.2
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/cli.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -76,7 +76,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
76
76
|
`),ug(v,this.filePath)}catch(u){try{og(v)}catch{}throw u}}}function q_(r){Y_(r.runtime);let i=new Date;return{goal_id:X_(),text:r.text,status:"active",interval_ms:r.interval_ms,next_wake_at:new Date(i.getTime()+r.interval_ms).toISOString(),parent_task_id:r.parent_task_id,report_to:r.report_to,runtime:r.runtime,created_at:i.toISOString(),updated_at:i.toISOString(),progress_log:[]}}function Q_(r,i){let v=i.filter((u)=>u.status==="active");if(r==="claude"){if(v.length===0)return{kind:"skip",runScheduler:!1,reason:"claude runtime — native /loop in use"};let u=W_(v);return{kind:"archive",runScheduler:!1,reason:`claude runtime started with ${v.length} non-claude goal(s) (${u.join(",")}) — archive + skip scheduler so anet doesn't double-fire alongside Claude Code's native /loop`,foreignCount:v.length,foreignBuckets:u}}if(r==="codex"||r==="grok"){let u=v.filter((n)=>{let $=Hi(n.runtime);return $!==r&&$!=="unknown"});if(u.length>0){let n=W_(u);return{kind:"fatal",runScheduler:!1,reason:`${r} runtime started but goals.json holds ${u.length} ${n.join("/")} goal(s) — thread / session IDs cannot be re-used across SDK runtimes. Cancel or archive the foreign goals before relaunching.`,foreignCount:u.length,foreignBuckets:n}}return{kind:"ok",runScheduler:!0}}return{kind:"skip",runScheduler:!1,reason:"unknown runtime bucket — anet scheduler refuses to run; check --runtime / RUNTIME env / config.runtime"}}function W_(r){let i=new Set;for(let v of r)i.add(Hi(v.runtime));return Array.from(i)}function O_(r,i){let v=i.getTime(),u=[],n=0,$=0,t=0;for(let o of r){if(o.status!=="active"){t++;continue}n++;let b=cg(o.next_wake_at);if(b===null){u.push(o);continue}if(b<=v)u.push(o);else $++}return{due:u,active:n,pending:$,skipped:t}}function cg(r){if(typeof r!=="string"||!r)return null;let i=Date.parse(r);return Number.isFinite(i)?i:null}async function G_(r,i,v){let u=r.goal_id.slice(0,8),n=v.log??K_,$=v.warn??K_,t,o=!1,b;if(r.codex_thread_id)try{t=(await v.newCodex()).resumeThread(r.codex_thread_id,v.buildOpts()),n(`[goal-codex] ${u} resumed thread ${r.codex_thread_id}`)}catch(_){b=`resumeThread failed: ${(_?.message||String(_)).slice(0,200)}`,$(`[goal-codex] ${u} ${b} — rebuilding`),t=void 0,o=!0}if(!t)try{t=(await v.newCodex()).startThread(v.buildOpts()),n(`[goal-codex] ${u} startThread (fresh${o?" — rebuilt":""})`)}catch(_){let c=(_?.message||String(_)).slice(0,200);return $(`[goal-codex] ${u} startThread failed: ${c}`),{text:`执行出错: codex startThread failed — ${c}`,failed:!0,threadRebuilt:o,rebuildReason:b}}let U="";try{let{events:_}=await t.runStreamed(i);for await(let c of _)if(c.type==="item.completed"&&c.item?.type==="agent_message")U=c.item.text??""}catch(_){let c=(_?.message||String(_)).slice(0,200);return $(`[goal-codex] ${u} run failed: ${c}`),{text:`执行出错: ${c}`,failed:!0,threadId:typeof t.id==="string"?t.id:void 0,threadRebuilt:o,rebuildReason:b}}let I=typeof t.id==="string"?t.id:void 0;return{text:U||"(无回复)",failed:!1,threadId:I,threadRebuilt:o,rebuildReason:b}}function K_(){}var zg=/(^|\n)\s*(目标已完成|GOAL_COMPLETE|GOAL COMPLETE)\s*(\n|$)/;function B_(r){if(!r)return!1;return zg.test(r)}import{existsSync as gg,readFileSync as kg}from"node:fs";import{spawn as jg}from"node:child_process";import{homedir as Jg}from"node:os";var Fi={pollIntervalMs:60000,idleThresholdMs:300000,forceRestartAfterDeadMs:1200000,thrashWindowMs:1800000,adminAlias:"通信龙"};function Ng(r){if(!r)return r;return r.startsWith("~")?r.replace(/^~/,Jg()):r}function wg(r){if(!r)return null;let i=r.includes("T")?r:r.replace(" ","T")+"Z",v=Date.parse(i);return Number.isFinite(v)?v:null}function L_(r,i){let v=r.pollIntervalMs??Fi.pollIntervalMs,u=r.idleThresholdMs??Fi.idleThresholdMs,n=r.forceRestartAfterDeadMs??Fi.forceRestartAfterDeadMs,$=r.thrashWindowMs??Fi.thrashWindowMs,t=r.adminAlias??Fi.adminAlias,o=`${Ng(r.stateDir)}/bot.pid`,b=0,U=0,I=!1,_=()=>{if(!gg(o))return!1;try{let K=parseInt(kg(o,"utf8"),10);if(!Number.isFinite(K)||K<=1)return!1;return process.kill(K,0),!0}catch{return!1}},c=async()=>{try{let K=await fetch(`${r.commhubUrl}/api/status?light=1`,{headers:{Authorization:`Bearer ${r.commhubToken}`},signal:AbortSignal.timeout(5000)});if(!K.ok)return null;let Q=((await K.json()).sessions??[]).find((T)=>T.alias===r.alias);if(!Q)return null;return{status:Q.status??"unknown",lastSeenMs:wg(Q.updated_at)}}catch{return null}},g=async(K)=>{try{await fetch(`${r.commhubUrl}/mcp`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r.commhubToken}`,Accept:"application/json, text/event-stream"},body:JSON.stringify({jsonrpc:"2.0",id:Date.now(),method:"tools/call",params:{name:"send_message",arguments:{alias:t,message:`[telegram-watchdog] ${r.alias}: ${K}`}}}),signal:AbortSignal.timeout(8000)})}catch(S){i(`admin notify failed: ${S?.message??String(S)}`)}},w=async(K)=>{i(`triggering restart — reason: ${K}`),await g(`telegram poller down, restarting in 10s (${K})`),await new Promise((T)=>setTimeout(T,1e4));let S=`setsid sh -c 'sleep 5 && anet node stop ${JSON.stringify(r.alias)} >> /tmp/telegram-watchdog-${r.alias}.log 2>&1 && sleep 2 && anet node start ${JSON.stringify(r.alias)} --accept-dev-channels >> /tmp/telegram-watchdog-${r.alias}.log 2>&1' >> /tmp/telegram-watchdog-${r.alias}.log 2>&1 < /dev/null &`;jg("bash",["-c",S],{detached:!0,stdio:"ignore"}).unref(),U=Date.now(),b=0},P=async()=>{if(I){i("tick skipped — previous tick still in flight (pre-restart grace)");return}I=!0;try{await O()}finally{I=!1}},O=async()=>{let K=Date.now();if(_()){if(b>0)i(`poller back alive (was down ${Math.round((K-b)/1000)}s)`);b=0;return}if(!b){b=K,i("poller DEAD detected (bot.pid missing or pid not alive)");return}if(U&&K-U<$){let gr=Math.round(($-(K-U))/60000);i(`thrash cap held — next restart allowed in ${gr} min`);return}let S=K-b,Q=await c(),T=Q?.status==="idle",Gr=Q?.lastSeenMs?K-Q.lastSeenMs>u:!1;if(T&&Gr){let gr=Q?.lastSeenMs?Math.round((K-Q.lastSeenMs)/60000):null;await w(`idle path (status=idle, last activity ~${gr??"?"} min ago)`);return}if(S>n){let gr=Math.round(S/60000);await w(`force path (dead ${gr} min, agent active or status unknown)`);return}i(`waiting — dead for ${Math.round(S/60000)} min, status=${Q?.status??"unknown"}, last_seen=${Q?.lastSeenMs?Math.round((K-Q.lastSeenMs)/60000)+"min ago":"?"}`)};return i(`started — poll=${v/1000}s, idle_threshold=${u/60000}min, force_after=${n/60000}min, thrash_cap=${$/60000}min, state_dir=${r.stateDir}`),{timer:setInterval(()=>{P().catch((K)=>i(`tick error: ${K?.message??String(K)}`))},v)}}var Vg=new Set(["你","我","他","她","它","对方","大家","我们","你们","他们"]);function Wg(r){return r.trim().replace(/^[@@]+/,"").replace(/^[「『“"'【\[]+|[」』”"'】\]]+$/g,"").replace(/[::,,。.!?!?]+$/g,"").trim()}function H_(r){let i=r.trim();if(!i)return null;if(!/\b(?:mcp_commhub__send_task|commhub_send_task|send_task)\b|发任务|派任务|派给|转给|交给|发给|沟通一下|让|请|麻烦|和|你去给|给\s+\S+\s+(?:发|说|沟通|打)/.test(i))return null;let v=[/\b(?:mcp_commhub__send_task|commhub_send_task|send_task)\s*\(\s*alias\s*=\s*["']([^"']+)["']\s*,\s*task\s*=\s*["']([\s\S]+?)["']\s*\)/i,/\b(?:mcp_commhub__send_task|commhub_send_task|send_task)\s*\(\s*["']([^"']+)["']\s*,\s*["']([\s\S]+?)["']\s*\)/i,/^send_task\s+(\S+)\s+([\s\S]+)$/i,/给\s+(.+?)\s*(?:发任务|派任务|send_task)(?:\s*[::]\s*([\s\S]+))?$/i,/给\s+[「『"'’“@@]?(\S+?)[」』"'’“]?\s+(?:发(?:个?消息|个)?|说(?:一下)?|沟通(?:一下)?|打(?:个?招呼)?)\s+([\s\S]+)$/i,/(?:派给|转给|交给|发给)\s+(.+?)\s*[::,,]\s*([\s\S]+)$/i,/你去给\s+[「『"'’“@@]?(\S+?)[」』"'’“]?\s+([\s\S]+)$/i,/(?:你\s*)?和\s*(@?[^\s,,::。.!?!?]+)\s*(?:沟通一下|send_task(?:\s*一下)?)(?:\s*(?:[,,::]\s*)?([\s\S]+))?$/i,/(?:你\s*)?和\s*(@?[\s\S]+?)\s*沟通一下\s*[,,]\s*([\s\S]+)$/i,/(?:让|请|麻烦)\s+(@?[^\s,,::。.!?!?]+)\s+([\s\S]+)$/i],u="",n="";for(let $ of v){let t=i.match($);if(!t?.[1])continue;u=Wg(t[1]),n=t[2]?.trim()||"";break}if(!u||Vg.has(u))return null;if(!n){let $=i.match(/(?:发任务|派任务|send_task)\s*[::]\s*([\s\S]+)$/i);if($?.[1])n=$[1].trim();else n=i.match(/(?:让|请)\s*(?:他|她|它|对方|该节点)?\s*([\s\S]+?)(?:。|$)/)?.[1]?.trim()||i}if(n=n.replace(/必须.*?(?:总结回|回复)\s*(?:admin|我).*$/i,"").replace(/并?用\s*commhub_get_task[\s\S]*$/i,"").replace(/^[::,,\s]+/,"").trim(),!n)n=i;return{alias:u,childTask:n}}import{existsSync as Xg,readFileSync as Yg,writeFileSync as Pg,renameSync as qg,unlinkSync as Qg}from"fs";class Qr extends Error{code;payload;appLevel;constructor(r,i={}){super(r);this.name="CommHubError",this.code=i.code,this.payload=i.payload,this.appLevel=i.appLevel??!1}}function S_(r){if(r?.error){let u=`${r.error.code??"?"}: ${r.error.message??"no message"}`;return{kind:"retryable",error:new Qr(`JSON-RPC error: ${u}`,{code:r.error.code,payload:r.error})}}if(r?.result?.isError===!0){let u=r?.result?.content?.[0]?.text||"tool returned isError";return{kind:"retryable",error:new Qr(`tool isError: ${u.slice(0,200)}`,{payload:r.result})}}let i=r?.result?.content?.[0]?.text,v;if(typeof i==="string")try{v=JSON.parse(i)}catch{return{kind:"ok",payload:i}}else v=r;if(v&&typeof v==="object"&&v.ok===!1){let u=v.error||v.message||"no detail";return{kind:"appLevel",error:new Qr(`app-level rejection: ${u}`,{code:v.error,payload:v,appLevel:!0})}}return{kind:"ok",payload:v}}function A_(r){let i=1083885398,v=-537806866;for(let u=0;u<r.length;u++){let n=r.charCodeAt(u);i=Math.imul(i^n,2654435761),v=Math.imul(v^n,1597334677)}return i=Math.imul(i^i>>>16,2246822507)^Math.imul(v^v>>>13,3266489909),v=Math.imul(v^v>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),(4294967296*(2097151&v)+(i>>>0)).toString(16).padStart(16,"0").repeat(2).slice(0,32)}class Mb{filePath;constructor(r){this.filePath=r}load(){try{if(!Xg(this.filePath))return[];let r=Yg(this.filePath,"utf8"),i=JSON.parse(r);return Array.isArray(i)?i:[]}catch{return[]}}save(r){let i=`${this.filePath}.tmp`;try{Pg(i,JSON.stringify(r,null,2)),qg(i,this.filePath)}catch(v){try{Qg(i)}catch{}throw v}}persist(r){let i=this.load(),v=this.findIndex(i,r.to,r.taskId,r.text);if(v>=0)i[v]={...i[v],...r,attempts:i[v].attempts};else i.push({...r,attempts:0});this.save(i)}clear(r,i){if(!i)return;let v=this.load(),u=`${r}|task:${i}`,n=v.filter(($)=>F_($)!==u);if(n.length!==v.length)this.save(n)}async drain(r){let i=this.load(),v=0,u=0,n=[];for(let $ of i)try{await r($),v++}catch(t){if(t instanceof Qr&&t.appLevel){u++;continue}n.push({...$,attempts:$.attempts+1,lastTryAt:Date.now(),lastError:t?.message??String(t)})}if(i.length>0)this.save(n);return{delivered:v,dropped:u,requeued:n.length}}findIndex(r,i,v,u){let n=v?`${i}|task:${v}`:`${i}|sha:${A_(u??"")}`;return r.findIndex(($)=>F_($)===n)}}function F_(r){return r.taskId?`${r.to}|task:${r.taskId}`:`${r.to}|sha:${A_(r.text)}`}function X$(r){let i=Z_(r.envValue);if(i!==null)return{valueMs:i,source:"env",rawValue:String(r.envValue)};let v=Z_(r.flagValue);if(v!==null)return{valueMs:v,source:"flags",rawValue:String(r.flagValue)};return{valueMs:r.defaultMs,source:"default"}}function Z_(r){if(r===void 0||r===null)return null;if(typeof r==="number")return Number.isFinite(r)&&r>0?r:null;if(typeof r==="string"){if(r.trim()==="")return null;let i=Number(r);return Number.isFinite(i)&&i>0?i:null}return null}import{dirname as Og}from"path";var En="@openai/codex-sdk",l_="@openai/codex",P$="^0.133.0";async function Tb(r,i){try{return{module:await r.importCodexSdk(),source:"already-installed"}}catch(v){r.log?.(`[codex] ${En} not resolved — auto-installing to ${i} ...`);try{await r.npmInstall(i,[`${En}@${P$}`,`${l_}@${P$}`])}catch(u){throw E_({agentNodeDir:i,initialReason:Y$(v),installReason:Y$(u)})}try{let u=await r.importCodexSdk();return r.log?.(`[codex] ${En} installed and loaded`),{module:u,source:"auto-installed"}}catch(u){throw E_({agentNodeDir:i,initialReason:Y$(v),installReason:`install succeeded but ${En} still does not resolve: ${Y$(u)}`})}}}function Rb(r){return Og(r)}function E_(r){let i=[`${En} not available and the auto-install attempt failed.`,"","Recovery — install both packages into agent-node's own node_modules:","",` npm install --prefix ${xb(r.agentNodeDir)} \\`,` ${En}@${P$} \\`,` ${l_}@${P$}`,"","Then restart this node.","","Underlying reasons:",` - initial import: ${r.initialReason}`,` - auto-install: ${r.installReason}`],v=Error(i.join(`
|
|
77
77
|
`));return v.name="CodexSdkUnavailable",v}function Y$(r){if(!r)return"unknown";if(r instanceof Error)return r.message||r.name||"unknown Error";if(typeof r==="string")return r;try{return JSON.stringify(r).slice(0,240)}catch{return String(r)}}function xb(r){return/[^A-Za-z0-9_\-./@~]/.test(r)?`'${r.replace(/'/g,"'\\''")}'`:r}function Cb(r){return async(i,v)=>{let u=v.map(xb).join(" "),n=`npm install --no-save --prefix ${xb(i)} ${u}`;r(n,{stdio:"pipe",timeout:90000})}}async function M_(r,i,v={}){let u=Math.max(1,Math.min(100,v.limit??100)),n=Math.max(1,Math.min(50,v.topN??10));try{let t=v.serverSupportsFromNodeId===!0&&!!r.nodeId?{from_node_id:r.nodeId,limit:u}:{from_name:r.alias,limit:u},o=await i(t),b=Array.isArray(o?.tasks)?o.tasks:[],U=(I)=>{let _=typeof I.from_node_id==="string"?I.from_node_id:"",c=typeof I.from_name==="string"?I.from_name:"";if(_&&r.nodeId)return _===r.nodeId;if(c)return c===r.alias;return!1};return b.filter((I)=>!!I&&typeof I.task_id==="string"&&typeof I.to_name==="string"&&(I.status==="delivered"||I.status==="started")).filter(U).slice(0,n)}catch{return[]}}function x_(r){if(!r.length)return null;return["【⚠ 节点 resume 提醒 — 你停机前已派出但仍在等回复的任务】","",r.map((v,u)=>{let n=String(v.task_id||"?").slice(0,8),$=String(v.to_name||"?"),t=v.created_at?`, sent ${v.created_at}`:"",o=Kg(v.content);return` ${u+1}. → ${$} [task ${n}${t}]: ${o}`}).join(`
|
|
78
78
|
`),"","重要约束 (do NOT re-dispatch):","- 上面这些任务 **已经发出去过**, 对方尚未回复。**不要再次** 用 commhub_send_task 发同样内容。",'- 如果需要跟进进度, 用 commhub_send_message(alias=对方, message="任务 <task_id> 进度?") 发一条**轻问询**, **不是** send_task。',"- server 端有自动去重护栏会拒绝重复 send_task, 但请不要靠它兜底 — 直接按上面规则处理。",'- 如果用户现在派的新任务跟上面某条**实质相同**, 直接告诉用户 "task <id> 已派给 <对方>, 仍在等回复, 不重新派", 不要 send_task。'].join(`
|
|
79
|
-
`)}function Kg(r){let i=String(r??"").replace(/```/g,"ʼʼʼ").replace(/\s+/g," ").trim(),v=120;return i.length>120?i.slice(0,117)+"...":i||"(empty content)"}class mb{opts;cachedAlias;cachedAt;fetchInFlight=null;cacheTtlMs;constructor(r){this.opts=r;this.cachedAlias=r.initialAlias,this.cachedAt=0,this.cacheTtlMs=r.cacheTtlMs??30000}current(){return this.cachedAlias}async refresh(r=Date.now()){if(!this.opts.nodeId)return this.cachedAlias;let i=r-this.cachedAt;if(this.cacheTtlMs>0&&this.cachedAt>0&&i>=0&&i<this.cacheTtlMs)return this.cachedAlias;if(this.fetchInFlight)return this.fetchInFlight;let v=(async()=>{try{let u=await this.opts.fetchCanonicalAlias(this.opts.nodeId);if(u&&u.length>0&&u!==this.cachedAlias)this.opts.onDrift?.(this.cachedAlias,u,"fetch"),this.cachedAlias=u}catch(u){this.opts.warn?.(`currentAlias: fetch failed (${u?.message??u}); keeping cached value "${this.cachedAlias}"`)}finally{this.cachedAt=r,this.fetchInFlight=null}return this.cachedAlias})();return this.fetchInFlight=v,v}set(r,i=Date.now()){if(!r)return;if(r!==this.cachedAlias)this.opts.onDrift?.(this.cachedAlias,r,"snapshot"),this.cachedAlias=r;this.cachedAt=i}get nodeId(){return this.opts.nodeId}ageMs(r=Date.now()){if(this.cachedAt===0)return Number.POSITIVE_INFINITY;return Math.max(0,r-this.cachedAt)}isFresh(r=Date.now()){if(this.cachedAt===0)return!1;let i=r-this.cachedAt;return i>=0&&i<this.cacheTtlMs}}function T_(r,i,v){if(!Array.isArray(r))return{exists:!1,reason:"no_sessions_field"};if(r.length===0)return{exists:!1,reason:"empty_sessions"};let u=(i??"").trim(),n=(v??"").trim();if(!u)return{exists:!1,reason:"not_in_sessions"};let $=!1;for(let t of r){let o=typeof t?.alias==="string"?t.alias.trim():"";if(!o)continue;if(o===u){if(o===n){$=!0;continue}return{exists:!0,source:"session"}}}return{exists:!1,reason:$?"self_only":"not_in_sessions"}}import{mkdirSync as qD,appendFileSync as Jk}from"fs";var __dirname="/tmp/
|
|
79
|
+
`)}function Kg(r){let i=String(r??"").replace(/```/g,"ʼʼʼ").replace(/\s+/g," ").trim(),v=120;return i.length>120?i.slice(0,117)+"...":i||"(empty content)"}class mb{opts;cachedAlias;cachedAt;fetchInFlight=null;cacheTtlMs;constructor(r){this.opts=r;this.cachedAlias=r.initialAlias,this.cachedAt=0,this.cacheTtlMs=r.cacheTtlMs??30000}current(){return this.cachedAlias}async refresh(r=Date.now()){if(!this.opts.nodeId)return this.cachedAlias;let i=r-this.cachedAt;if(this.cacheTtlMs>0&&this.cachedAt>0&&i>=0&&i<this.cacheTtlMs)return this.cachedAlias;if(this.fetchInFlight)return this.fetchInFlight;let v=(async()=>{try{let u=await this.opts.fetchCanonicalAlias(this.opts.nodeId);if(u&&u.length>0&&u!==this.cachedAlias)this.opts.onDrift?.(this.cachedAlias,u,"fetch"),this.cachedAlias=u}catch(u){this.opts.warn?.(`currentAlias: fetch failed (${u?.message??u}); keeping cached value "${this.cachedAlias}"`)}finally{this.cachedAt=r,this.fetchInFlight=null}return this.cachedAlias})();return this.fetchInFlight=v,v}set(r,i=Date.now()){if(!r)return;if(r!==this.cachedAlias)this.opts.onDrift?.(this.cachedAlias,r,"snapshot"),this.cachedAlias=r;this.cachedAt=i}get nodeId(){return this.opts.nodeId}ageMs(r=Date.now()){if(this.cachedAt===0)return Number.POSITIVE_INFINITY;return Math.max(0,r-this.cachedAt)}isFresh(r=Date.now()){if(this.cachedAt===0)return!1;let i=r-this.cachedAt;return i>=0&&i<this.cacheTtlMs}}function T_(r,i,v){if(!Array.isArray(r))return{exists:!1,reason:"no_sessions_field"};if(r.length===0)return{exists:!1,reason:"empty_sessions"};let u=(i??"").trim(),n=(v??"").trim();if(!u)return{exists:!1,reason:"not_in_sessions"};let $=!1;for(let t of r){let o=typeof t?.alias==="string"?t.alias.trim():"";if(!o)continue;if(o===u){if(o===n){$=!0;continue}return{exists:!0,source:"session"}}}return{exists:!1,reason:$?"self_only":"not_in_sessions"}}import{mkdirSync as qD,appendFileSync as Jk}from"fs";var __dirname="/tmp/feishu-channel/agent-node/src";var ND=nk(),Dr=process.argv.slice(2),x={},wD=[],VD="2.1.0";try{let r=new URL(".",import.meta.url).pathname;for(let i of["../package.json","../../package.json"])try{let v=JSON.parse($n(M(r,i),"utf-8"));if(v.version){VD=v.version;break}}catch{}}catch{}for(let r=0;r<Dr.length;r++){if(Dr[r]==="--version"||Dr[r]==="-v")console.log(`agent-node v${VD}`),process.exit(0);if(Dr[r]==="-h"||Dr[r]==="--help")console.log(`
|
|
80
80
|
@sleep2agi/agent-node — AI Agent 节点,一行命令加入 CommHub 网络
|
|
81
81
|
|
|
82
82
|
用法:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sleep2agi/agent-node",
|
|
3
|
-
"version": "2.4.15-preview.
|
|
3
|
+
"version": "2.4.15-preview.2",
|
|
4
4
|
"description": "AI Agent runtime for CommHub networks. Supports 4 runtimes: Claude Code CLI, Claude Agent SDK, Codex SDK, and Grok Build ACP.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"agent-node": "dist/cli.js"
|