@sleep2agi/agent-network 0.0.10 → 0.0.12
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 +4 -1
- package/dist/bin/cli.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -206,7 +206,10 @@ const { CommHub } = require('@sleep2agi/agent-network');
|
|
|
206
206
|
|
|
207
207
|
| 版本 | 变更 |
|
|
208
208
|
|------|------|
|
|
209
|
-
| 0.0.
|
|
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
|
@@ -24,7 +24,7 @@ Quick start:
|
|
|
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(`
|
|
27
|
-
✅ Project ready. Next: anet init profile <id> --alias <名字> --channel server:commhub`)}function Bz(){let z=$[2];if(!z)console.error("Usage: anet init profile <id> --alias <名字> [--channel ...] [--env ...]"),process.exit(1);let B=I(),Q=k(),V=Q.alias||z,X=Q.hub||B.hub;if(!X)console.error("Run 'anet init' first to configure hub URL"),process.exit(1);let Z={};for(let R of Q._envs){let _=R.indexOf("=");if(_>0)Z[R.slice(0,_)]=R.slice(_+1)}let L={
|
|
27
|
+
✅ Project ready. Next: anet init profile <id> --alias <名字> --channel server:commhub`)}function Bz(){let z=$[2];if(!z)console.error("Usage: anet init profile <id> --alias <名字> [--channel ...] [--env ...]"),process.exit(1);let B=I(),Q=k(),V=Q.alias||z,X=Q.hub||B.hub;if(!X)console.error("Run 'anet init' first to configure hub URL"),process.exit(1);let Z={};for(let R of Q._envs){let _=R.indexOf("=");if(_>0)Z[R.slice(0,_)]=R.slice(_+1)}let L={anet_version:"0.0.11",...Q.name?{name:Q.name}:{},alias:V,hub:X,channels:Q._channels.length>0?Q._channels:["server:commhub"],env:Z,flags:{dangerouslySkipPermissions:!0,...Q["teammate-mode"]?{teammateMode:Q["teammate-mode"]}:{}},...Q.resume?{resume:Q.resume}:{},...Q["resume-alias"]?{resumeAlias:Q["resume-alias"]}:{}},W=N(O,".claude","channels","commhub"),Y=process.cwd().replace(/\//g,"-"),U=N(W,Y);if(J(U,{recursive:!0}),T(N(U,".env"),`COMMHUB_ALIAS=${V}
|
|
28
28
|
`),e(z,L),console.log(`
|
|
29
29
|
✅ Profile "${z}" saved`),console.log(` alias: ${V}`),console.log(` channels: ${L.channels.join(", ")}`),Object.keys(Z).length)console.log(` env: ${Object.keys(Z).join(", ")}`);console.log(`
|
|
30
30
|
Start: anet start ${z}`)}function u(z,B){let Q=G(z);if(!Q)console.error(`Profile "${z}" not found. Run: anet ls`),process.exit(1);let V={...process.env,COMMHUB_ALIAS:Q.alias};for(let[W,Y]of Object.entries(Q.env))V[W]=Y.replace(/^~/,O);let X=[];if(Q.flags.dangerouslySkipPermissions)X.push("--dangerously-skip-permissions");for(let W of Q.channels)if(W.startsWith("server:"))X.push("--dangerously-load-development-channels",W);else X.push("--channels",W);if(Q.flags.teammateMode)X.push("--teammate-mode",Q.flags.teammateMode);if(B==="resume"){let W=Q.resumeAlias||Q.name||Q.alias;X.push("--resume",W)}X.push("-n",Q.name||Q.alias),console.log(`[anet] ${B==="start"?"Starting new":"Resuming"} "${z}" (${Q.alias})...
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sleep2agi/agent-network",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
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",
|