{"_id":"@d3ara1n/pi-mesh","_rev":"6-98f8adf65a1a1e71e91e323f958276d8","name":"@d3ara1n/pi-mesh","dist-tags":{"latest":"0.3.2"},"versions":{"0.1.0":{"name":"@d3ara1n/pi-mesh","version":"0.1.0","keywords":["pi-package","pi","pi-extension"],"license":"MIT","_id":"@d3ara1n/pi-mesh@0.1.0","maintainers":[{"name":"d3ara1n","email":"d3ara1n@outlook.com"}],"homepage":"https://github.com/d3ara1n/pi-extensions#readme","bugs":{"url":"https://github.com/d3ara1n/pi-extensions/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"815d12cfced7ef2e310ba6578915bc65a3a51247","tarball":"https://registry.npmjs.org/@d3ara1n/pi-mesh/-/pi-mesh-0.1.0.tgz","fileCount":11,"integrity":"sha512-Qo1Hc0z/YewPkB88QJcTxUrU5jcELPba6ZPrHFku+XQUhHr9E3VlF7eJpfrI31RHpQxlhkWxRkSHMYIQhU8Ckw==","signatures":[{"sig":"MEUCIQDGxirCY24JsaZVf+1nt3KhHAwia5vS9RiYW0Vo/1feRwIgMmsgzjd0fK+w8dUm73hzXr2SfOS0XyJQeE1T/IEGCj4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57476},"main":"src/index.ts","type":"module","gitHead":"8d93453192810235175e0221b1e8dc83f17367a0","_npmUser":{"name":"d3ara1n","email":"d3ara1n@outlook.com"},"repository":{"url":"git+https://github.com/d3ara1n/pi-extensions.git","type":"git","directory":"packages/pi-mesh"},"_npmVersion":"12.0.1","description":"Agent mesh for pi — peer discovery + cross-instance transport. The neutral foundation that pi-peek-agent, chat-room, and other multi-instance workflows build on. Self-sufficient: install alone to discover peers and self-introduce a role.","directories":{},"_nodeVersion":"26.5.0","_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-mesh_0.1.0_1785310795458_0.8672386164398875","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@d3ara1n/pi-mesh","version":"0.1.1","keywords":["pi-package","pi","pi-extension"],"license":"MIT","_id":"@d3ara1n/pi-mesh@0.1.1","maintainers":[{"name":"d3ara1n","email":"d3ara1n@outlook.com"}],"homepage":"https://github.com/d3ara1n/pi-extensions#readme","bugs":{"url":"https://github.com/d3ara1n/pi-extensions/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"3e5d068f8480cd3d25d9915360fb4494e70b29c5","tarball":"https://registry.npmjs.org/@d3ara1n/pi-mesh/-/pi-mesh-0.1.1.tgz","fileCount":11,"integrity":"sha512-PXxr0gyXaelUgbv83sLezbSHffsBbv+kGn0MQyRolWp2WKRoAJudYCAdbr7YV06pu4xpevl8qp0Qp4nm6w+M/A==","signatures":[{"sig":"MEYCIQCI4toIdB0AQsyVBN7QURcTsXJxp+J5XBFbQ6BwQOHqKAIhAJsdSutDjIfq5+rgdgLEzFjIELe6TZIbIFvNbpUFuXZz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@d3ara1n%2fpi-mesh@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":57297},"main":"src/index.ts","type":"module","gitHead":"bc3001eb583738ab47657418303184b64974c163","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a030f1cc-c40d-488d-ab1d-8061b60bf632"}},"repository":{"url":"git+https://github.com/d3ara1n/pi-extensions.git","type":"git","directory":"packages/pi-mesh"},"_npmVersion":"11.17.0","description":"Agent mesh for pi — peer discovery + cross-instance transport. The neutral foundation that pi-peek-agent, chat-room, and other multi-instance workflows build on. Self-sufficient: install alone to discover peers and self-introduce a role.","directories":{},"_nodeVersion":"24.19.0","_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-mesh_0.1.1_1786708260707_0.20960771040587844","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@d3ara1n/pi-mesh","version":"0.2.0","keywords":["pi-package","pi","pi-extension"],"license":"MIT","_id":"@d3ara1n/pi-mesh@0.2.0","maintainers":[{"name":"d3ara1n","email":"d3ara1n@outlook.com"}],"homepage":"https://github.com/d3ara1n/pi-extensions#readme","bugs":{"url":"https://github.com/d3ara1n/pi-extensions/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"27045f7a5abdfdbad4422bb03d945d498708bef5","tarball":"https://registry.npmjs.org/@d3ara1n/pi-mesh/-/pi-mesh-0.2.0.tgz","fileCount":11,"integrity":"sha512-14M8R2J7S5+J6tDgOFpUpLDMVKb88MRoEW0TI/ew37QB7WHD8Moc7RKh1xFfKrkS7CKApzPz6FbPz7QUkqDUPw==","signatures":[{"sig":"MEUCIEh71T27JR8cJl5d4EJTa4wAtV8HxnJfCSrQO4PXNUE0AiEA0FJx5HYscT3QUH3G+mmnkobDTPQg9IysKEBeCgfTC7w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@d3ara1n%2fpi-mesh@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":59388},"main":"src/index.ts","type":"module","gitHead":"e370718cee125c5c42079027cadf0f077b3f8a46","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a030f1cc-c40d-488d-ab1d-8061b60bf632"}},"repository":{"url":"git+https://github.com/d3ara1n/pi-extensions.git","type":"git","directory":"packages/pi-mesh"},"_npmVersion":"11.17.0","description":"Agent mesh for pi — peer discovery + cross-instance transport. The neutral foundation that pi-peek-agent, chat-room, and other multi-instance workflows build on. Self-sufficient: install alone to discover peers and self-introduce a role.","directories":{},"_nodeVersion":"24.19.0","_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-mesh_0.2.0_1786871660358_0.9123371246402341","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@d3ara1n/pi-mesh","version":"0.3.0","keywords":["pi-package","pi","pi-extension"],"license":"MIT","_id":"@d3ara1n/pi-mesh@0.3.0","maintainers":[{"name":"d3ara1n","email":"d3ara1n@outlook.com"}],"homepage":"https://github.com/d3ara1n/pi-extensions#readme","bugs":{"url":"https://github.com/d3ara1n/pi-extensions/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"3d846a22deb36e809e89bba47234bbec6bde4452","tarball":"https://registry.npmjs.org/@d3ara1n/pi-mesh/-/pi-mesh-0.3.0.tgz","fileCount":12,"integrity":"sha512-hAnrqCWdR9GnWVmD7FgxEWyvDBpkD0ZmvApgHbiBIshkulbRDoPOwslB0iRsJgffOzjZMgwl4qNxO7bBAQhHyQ==","signatures":[{"sig":"MEUCIQCJJAAPjwDK5w1nshO79QPfCLyAOvz1Tp7qLah6A4jPbQIgU8MeO+C6ZUScUqapjAWTNJUlNR9IOsJ9NWHT0tHvZL8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@d3ara1n%2fpi-mesh@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":70554},"main":"src/index.ts","type":"module","gitHead":"f5a03a698069bee1c2a87d76b617ca4ba2e63392","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a030f1cc-c40d-488d-ab1d-8061b60bf632"}},"repository":{"url":"git+https://github.com/d3ara1n/pi-extensions.git","type":"git","directory":"packages/pi-mesh"},"_npmVersion":"11.17.0","description":"Agent mesh for pi — peer discovery + cross-instance transport. The neutral foundation that pi-peek-agent, chat-room, and other multi-instance workflows build on. Self-sufficient: install alone to discover peers and self-introduce a role.","directories":{},"_nodeVersion":"24.19.0","_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-mesh_0.3.0_1788364225249_0.119492852018793","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@d3ara1n/pi-mesh","version":"0.3.1","keywords":["pi-package","pi","pi-extension"],"license":"MIT","_id":"@d3ara1n/pi-mesh@0.3.1","maintainers":[{"name":"d3ara1n","email":"d3ara1n@outlook.com"}],"homepage":"https://github.com/d3ara1n/pi-extensions/tree/main/packages/pi-mesh#readme","bugs":{"url":"https://github.com/d3ara1n/pi-extensions/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"59f66c9e07e70715dbee822af3ffac8dbc100d83","tarball":"https://registry.npmjs.org/@d3ara1n/pi-mesh/-/pi-mesh-0.3.1.tgz","fileCount":12,"integrity":"sha512-U9oNLFtCJICQD2SYKcG6DTopR0CgowaiTb75tnG+zWjC26TVeSbaP+CGDX6ZqNIiXsNHQ5xGfJCLRvkSLtzCBw==","signatures":[{"sig":"MEYCIQDz9adxUhZnRseC/PzP8D0JoBLdNkOx7nNwnNS1u+Nk4gIhAI2bc/TlFqIXlsunTzeUMxj0DQpPmOEsNWbu2TkTCk56","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCmI+We8cPSsFr7VqwHI6xfSpqKdq4u/0rKPmK9xm8YHgIgTV5I7EjCWDjtMuX6spdBtgvPdbULSF1EBm2bZNFjXW8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@d3ara1n%2fpi-mesh@0.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":70728},"main":"src/index.ts","type":"module","gitHead":"ebb4d6c8a8daff7acbeddf59c804f1025ce5baab","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a030f1cc-c40d-488d-ab1d-8061b60bf632"}},"repository":{"url":"git+https://github.com/d3ara1n/pi-extensions.git","type":"git","directory":"packages/pi-mesh"},"_npmVersion":"11.19.0","description":"Agent mesh for pi — peer discovery + cross-instance transport. The neutral foundation that pi-peek-agent, chat-room, and other multi-instance workflows build on. Self-sufficient: install alone to discover peers and self-introduce a role.","directories":{},"_nodeVersion":"24.20.0","_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-mesh_0.3.1_1789971667954_0.6209728310433933","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"pi":{"extensions":["./src/index.ts"]},"_id":"@d3ara1n/pi-mesh@0.3.2","bugs":{"url":"https://github.com/d3ara1n/pi-extensions/issues"},"dist":{"shasum":"803f89cd29658dfc3afc5c1ab5fe857da8146208","tarball":"https://registry.npmjs.org/@d3ara1n/pi-mesh/-/pi-mesh-0.3.2.tgz","fileCount":12,"integrity":"sha512-/hAIcY77JS5ZK0Hphhv2Yq1/eCxuu651yxS8OHh2r0mky7UfPRp+YuXKjTTPZxeZl1T90nf64zsyEW9IWa/EKw==","signatures":[{"sig":"MEUCICfzTYufHLsqhaKL7qt4lYu/g11OHLksDrW1bH8GhLfnAiEA+T/wNoIniVtz+mw+A3Jl3oEhr2fcmDq7RFKcLcexjRI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCWqMtmXZBp075Djrpm3K0xRt0JBhPHoXuZAS4/e6E3tAIgSD84mfm9CyAChWeZcqO6t+PIP9WMPcI2+r8cOaSFhn8="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@d3ara1n%2fpi-mesh@0.3.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":70646},"main":"src/index.ts","name":"@d3ara1n/pi-mesh","type":"module","gitHead":"c0eb5d0c1a3373f937b6e23a1a5ae1c7938a4687","license":"MIT","version":"0.3.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"a030f1cc-c40d-488d-ab1d-8061b60bf632"}},"homepage":"https://github.com/d3ara1n/pi-extensions/tree/main/packages/pi-mesh#readme","keywords":["pi-package","pi","pi-extension"],"repository":{"url":"git+https://github.com/d3ara1n/pi-extensions.git","type":"git","directory":"packages/pi-mesh"},"_npmVersion":"11.19.0","description":"Agent mesh for pi — peer discovery + cross-instance transport. The neutral foundation that pi-peek-agent, chat-room, and other multi-instance workflows build on. Self-sufficient: install alone to discover peers and self-introduce a role.","directories":{},"maintainers":[{"name":"d3ara1n","email":"d3ara1n@outlook.com"}],"_nodeVersion":"24.21.0","_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-mesh_0.3.2_1790766946746_0.9122519594587613"}}},"time":{"created":"2026-07-29T07:39:55.263Z","modified":"2026-09-30T11:15:47.176Z","0.1.0":"2026-07-29T07:39:55.595Z","0.1.1":"2026-08-14T11:51:00.831Z","0.2.0":"2026-08-16T09:14:20.509Z","0.3.0":"2026-09-02T15:50:25.399Z","0.3.1":"2026-09-21T06:21:08.039Z","0.3.2":"2026-09-30T11:15:46.839Z"},"bugs":{"url":"https://github.com/d3ara1n/pi-extensions/issues"},"license":"MIT","homepage":"https://github.com/d3ara1n/pi-extensions/tree/main/packages/pi-mesh#readme","keywords":["pi-package","pi","pi-extension"],"repository":{"url":"git+https://github.com/d3ara1n/pi-extensions.git","type":"git","directory":"packages/pi-mesh"},"description":"Agent mesh for pi — peer discovery + cross-instance transport. The neutral foundation that pi-peek-agent, chat-room, and other multi-instance workflows build on. Self-sufficient: install alone to discover peers and self-introduce a role.","maintainers":[{"name":"d3ara1n","email":"d3ara1n@outlook.com"}],"readme":"# @d3ara1n/pi-mesh\n\n[![npm version](https://img.shields.io/npm/v/@d3ara1n/pi-mesh)](https://www.npmjs.com/package/@d3ara1n/pi-mesh) [![npm downloads](https://img.shields.io/npm/dm/@d3ara1n/pi-mesh)](https://www.npmjs.com/package/@d3ara1n/pi-mesh) [![license](https://img.shields.io/npm/l/@d3ara1n/pi-mesh)](https://www.npmjs.com/package/@d3ara1n/pi-mesh)\n\nAgent mesh for [pi](https://github.com/earendil-works/pi) — peer discovery and cross-instance transport. The neutral foundation that [`pi-peek-agent`](../pi-peek-agent) and [`pi-chat-room`](../pi-chat-room) build on.\n\nSelf-sufficient: install alone to discover other pi instances and self-declare a role. Knows nothing about peek, chat, or any specific workflow — it just discovers named peers and carries typed bytes between them.\n\n## How it works\n\n- **Discovery**: each instance writes a PID-file marker to `~/.pi/mesh/registry/`. Liveness is verified by `kill(pid, 0)` + a socket connect probe — no heartbeat drift, no stale leftovers (the kernel reclaims the socket fd on exit, including SIGKILL/crash).\n- **Transport**: Unix domain sockets via `node:net` (zero runtime dependencies). Requests are routed by a caller-defined `type` string to handlers registered via `serve()`; consumers (`pi-peek-agent`'s `\"ask\"`, `pi-chat-room`'s `\"message\"`) define their own types.\n- **Identity**: each instance gets a stable name derived deterministically from its session id (a hash into an adjective+noun pool). Renameable at runtime. `PI_MESH_NAME` overrides.\n- **Profile**: runtime role/description other agents see — the \"name card\" for multi-agent workflows.\n\n## Tools\n\n### `mesh_list`\n\nList other pi instances online, with each peer's name, cwd, model, git branch, and self-declared role. Same-project peers first.\n\n### `mesh_get_profile`\n\nRead a peer's (or your own) role/description and basic identity.\n\n### `mesh_set_profile`\n\nDeclare or update this instance's role and description — how you self-introduce on the mesh.\n\n## Commands\n\n- `/mesh:rename <name>` — override the derived identity name\n- `/mesh:status` — show self info, registry dir, and online peers\n\n## Installation\n\n```bash\npi install npm:@d3ara1n/pi-mesh\n```\n\nOr add to `~/.pi/agent/settings.json`:\n\n```jsonc\n{\n  \"extensions\": [\n    \"/absolute/path/to/pi-extensions/packages/pi-mesh\"\n  ]\n}\n```\n\n## Dependencies\n\nNone beyond the `pi` framework itself.\n\n## Configuration\n\nOptional, in `~/.pi/agent/settings.json` under `mesh`:\n\n```json\n{\n  \"mesh\": {\n    \"registryDir\": \"~/.pi/mesh/registry\",\n    \"heartbeatMs\": 15000\n  }\n}\n```\n\n`registryDir` accepts a leading `~`. `heartbeatMs` must be a positive finite number.\n\n## Naming\n\nEach instance gets a stable display name shown by `mesh_list`. The name is derived deterministically from the session id (hash → adjective+noun pool), so the same session always gets the same name across `/reload`, restarts, even machines. Renameable at runtime via `/mesh:rename`.\n\nOverride at startup:\n\n```bash\nPI_MESH_NAME=Fox pi\n```\n\nOtherwise the derived name (e.g. `QuietBrook`) is used. Name collisions are flagged in `mesh_list`; disambiguate by `sessionId`.\n\n## Order-agnostic consumers\n\nExtensions that depend on pi-mesh register their `serve()` handlers via the `mesh:ready` event (+ a `tryGetMeshAPI` fallback), so load order in `settings.json` is irrelevant — put pi-mesh anywhere.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}