@sleep2agi/agent-network 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/README.md CHANGED
@@ -206,7 +206,10 @@ const { CommHub } = require('@sleep2agi/agent-network');
206
206
 
207
207
  | 版本 | 变更 |
208
208
  |------|------|
209
- | 0.0.9 | start/resume 分离,resume 按名字搜索恢复 session |
209
+ | 0.0.12 | README 同步 + 文档更新 |
210
+ | 0.0.11 | node config 加 anet_version 字段 |
211
+ | 0.0.10 | resumeAlias 字段,resume 按名字搜索 |
212
+ | 0.0.9 | start/resume 分离 |
210
213
  | 0.0.8 | init project 所有文件放 .anet/(不碰全局 ~/.claude/) |
211
214
  | 0.0.7 | init project 改写 .mcp.json(不写 ~/.claude.json) |
212
215
  | 0.0.6 | 三级 init(全局/项目/profile),`anet ls` 简化为当前目录 |
package/dist/bin/cli.js CHANGED
@@ -20,7 +20,7 @@ Quick start:
20
20
  anet init profile 指挥室 --alias 指挥室 --channel server:commhub
21
21
  anet start 指挥室 # 新建
22
22
  anet resume 指挥室 # 下次恢复
23
- `)}async function s(){let z=k(),B=z.hub;if(!B)process.stdout.write("CommHub URL (e.g. http://YOUR_IP:9200): "),B=await new Promise((V)=>{let X="";process.stdin.setEncoding("utf-8"),process.stdin.once("data",(Z)=>{V(Z.toString().trim())})});if(!B)console.error("Error: hub URL required"),process.exit(1);try{let X=await(await fetch(`${B}/health`)).json();console.log(`✅ CommHub v${X.version} — ${X.sessions} sessions, ${X.sse_connections} SSE`)}catch(V){console.error(`❌ Cannot reach ${B}: ${V.message}`),process.exit(1)}let Q=I();if(Q.hub=B,z.token)Q.token=z.token;i(Q),console.log(`
23
+ `)}async function s(){let z=k(),B=z.hub;if(!B)process.stdout.write("CommHub URL (e.g. http://YOUR_IP:9200): "),B=await new Promise((V)=>{process.stdin.setEncoding("utf-8"),process.stdin.once("data",(X)=>{process.stdin.unref(),V(X.toString().trim())})});if(!B)console.error("Error: hub URL required"),process.exit(1);try{let X=await(await fetch(`${B}/health`)).json();console.log(`✅ CommHub v${X.version} — ${X.sessions} sessions, ${X.sse_connections} SSE`)}catch(V){console.error(`❌ Cannot reach ${B}: ${V.message}`),process.exit(1)}let Q=I();if(Q.hub=B,z.token)Q.token=z.token;i(Q),console.log(`
24
24
  Saved to ${S()}`),console.log("Next: anet init project")}async function zz(){let B=I().hub;if(!B)console.error("Run 'anet init' first to configure hub URL"),process.exit(1);let Q=N(process.cwd(),".anet");J(Q,{recursive:!0});let V=N(Q,"server.ts");if(!q(V)){console.log("Downloading Channel plugin...");try{let Y=await fetch("https://raw.githubusercontent.com/sleep2agi/agent-comm-hub/main/channel/server.ts");if(Y.ok)T(V,await Y.text()),console.log(" ✅ .anet/server.ts")}catch(Y){console.log(` ❌ Failed: ${Y.message}`),console.log(" Manual: curl -sL https://raw.githubusercontent.com/sleep2agi/agent-comm-hub/main/channel/server.ts -o .anet/server.ts")}}else console.log("Channel plugin: exists");let X=N(Q,"package.json");if(!q(X))try{let Y=await fetch("https://raw.githubusercontent.com/sleep2agi/agent-comm-hub/main/channel/package.json");if(Y.ok){T(X,await Y.text());try{let{execSync:U}=await import("child_process");U("bun install",{cwd:Q,stdio:"pipe"}),console.log(" ✅ Dependencies installed")}catch{console.log(" ⚠️ Run: cd .anet && bun install")}}}catch{}let Z=N(Q,".env");T(Z,`COMMHUB_URL=${B}
25
25
  `),console.log(`CommHub URL: ${B}`);let L=N(process.cwd(),".mcp.json"),W={};if(q(L))try{W=JSON.parse(E(L,"utf-8"))}catch{}if(!W.mcpServers?.commhub)W.mcpServers=W.mcpServers||{},W.mcpServers.commhub={type:"stdio",command:"bun",args:[".anet/server.ts"]},T(L,JSON.stringify(W,null,2)+`
26
26
  `),console.log(".mcp.json: commhub → .anet/server.ts");else console.log(".mcp.json: commhub already set");console.log(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "AI Agent Network — Server + Client + Setup in one package. SSE real-time communication for multi-agent orchestration.",
5
5
  "type": "module",
6
6
  "main": "dist/src/client.js",