@xpufx/paseo-x-comms 0.3.0

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.
Files changed (152) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +149 -0
  3. package/client/attribution.ts +7 -0
  4. package/client/conversations.ts +229 -0
  5. package/client/main.tsx +885 -0
  6. package/client/peer-label.ts +98 -0
  7. package/client/peer-status.tsx +201 -0
  8. package/client/settings-prototype.tsx +395 -0
  9. package/client/tool-call.ts +115 -0
  10. package/client/vendor/paseo-plugin-helper/command-center.ts +43 -0
  11. package/client/vendor/paseo-plugin-helper/components/AboutSection.tsx +493 -0
  12. package/client/vendor/paseo-plugin-helper/components/AttentionBeacon.tsx +250 -0
  13. package/client/vendor/paseo-plugin-helper/components/Badge.tsx +156 -0
  14. package/client/vendor/paseo-plugin-helper/components/Button.tsx +178 -0
  15. package/client/vendor/paseo-plugin-helper/components/Card.tsx +225 -0
  16. package/client/vendor/paseo-plugin-helper/components/CodeBlock.tsx +196 -0
  17. package/client/vendor/paseo-plugin-helper/components/Collapsible.tsx +277 -0
  18. package/client/vendor/paseo-plugin-helper/components/CommandBox.tsx +172 -0
  19. package/client/vendor/paseo-plugin-helper/components/CopyButton.tsx +180 -0
  20. package/client/vendor/paseo-plugin-helper/components/DataTable.tsx +200 -0
  21. package/client/vendor/paseo-plugin-helper/components/EmptyState.tsx +97 -0
  22. package/client/vendor/paseo-plugin-helper/components/HighlightedText.tsx +70 -0
  23. package/client/vendor/paseo-plugin-helper/components/InlineButton.tsx +73 -0
  24. package/client/vendor/paseo-plugin-helper/components/KeyValue.tsx +446 -0
  25. package/client/vendor/paseo-plugin-helper/components/MetricGauge.tsx +247 -0
  26. package/client/vendor/paseo-plugin-helper/components/ProgressBar.tsx +117 -0
  27. package/client/vendor/paseo-plugin-helper/components/Responsive.tsx +53 -0
  28. package/client/vendor/paseo-plugin-helper/components/SearchInput.tsx +118 -0
  29. package/client/vendor/paseo-plugin-helper/components/SectionHeader.tsx +80 -0
  30. package/client/vendor/paseo-plugin-helper/components/Select.tsx +215 -0
  31. package/client/vendor/paseo-plugin-helper/components/StatusDot.tsx +80 -0
  32. package/client/vendor/paseo-plugin-helper/components/Tabs.tsx +319 -0
  33. package/client/vendor/paseo-plugin-helper/components/TextInput.tsx +150 -0
  34. package/client/vendor/paseo-plugin-helper/components/Toggle.tsx +163 -0
  35. package/client/vendor/paseo-plugin-helper/components/TruncatedText.tsx +157 -0
  36. package/client/vendor/paseo-plugin-helper/components/index.ts +25 -0
  37. package/client/vendor/paseo-plugin-helper/custom-pills.tsx +224 -0
  38. package/client/vendor/paseo-plugin-helper/forge-icon.tsx +79 -0
  39. package/client/vendor/paseo-plugin-helper/host.ts +277 -0
  40. package/client/vendor/paseo-plugin-helper/icon.tsx +39 -0
  41. package/client/vendor/paseo-plugin-helper/index.ts +28 -0
  42. package/client/vendor/paseo-plugin-helper/layout/ActionBar.tsx +49 -0
  43. package/client/vendor/paseo-plugin-helper/layout/FormRow.tsx +103 -0
  44. package/client/vendor/paseo-plugin-helper/layout/Grid.tsx +65 -0
  45. package/client/vendor/paseo-plugin-helper/layout/ModalBody.tsx +378 -0
  46. package/client/vendor/paseo-plugin-helper/layout/ModalContent.tsx +49 -0
  47. package/client/vendor/paseo-plugin-helper/layout/Row.tsx +39 -0
  48. package/client/vendor/paseo-plugin-helper/layout/Stack.tsx +39 -0
  49. package/client/vendor/paseo-plugin-helper/layout/index.ts +7 -0
  50. package/client/vendor/paseo-plugin-helper/panel.tsx +81 -0
  51. package/client/vendor/paseo-plugin-helper/pill.tsx +884 -0
  52. package/client/vendor/paseo-plugin-helper/query-refresh.ts +79 -0
  53. package/client/vendor/paseo-plugin-helper/query.ts +66 -0
  54. package/client/vendor/paseo-plugin-helper/settings-screen.tsx +372 -0
  55. package/client/vendor/paseo-plugin-helper/settings.ts +181 -0
  56. package/client/vendor/paseo-plugin-helper/shared-settings.ts +46 -0
  57. package/client/vendor/paseo-plugin-helper/snapshot.ts +68 -0
  58. package/client/vendor/paseo-plugin-helper/surface.tsx +80 -0
  59. package/client/vendor/paseo-plugin-helper/theme/color-utils.ts +118 -0
  60. package/client/vendor/paseo-plugin-helper/theme/flair.ts +76 -0
  61. package/client/vendor/paseo-plugin-helper/theme/host-variables.ts +121 -0
  62. package/client/vendor/paseo-plugin-helper/theme/index.ts +7 -0
  63. package/client/vendor/paseo-plugin-helper/theme/provider.tsx +214 -0
  64. package/client/vendor/paseo-plugin-helper/theme/responsive.ts +213 -0
  65. package/client/vendor/paseo-plugin-helper/theme/tokens.ts +161 -0
  66. package/client/vendor/paseo-plugin-helper/theme/useResponsive.ts +57 -0
  67. package/client/vendor/paseo-plugin-helper/utils/clipboard.ts +149 -0
  68. package/client/vendor/paseo-plugin-helper/utils/haptics.ts +34 -0
  69. package/client/via-x-comms.tsx +15 -0
  70. package/client/x-comms-conversation.tsx +449 -0
  71. package/client/x-comms-panel.tsx +6 -0
  72. package/client/x-comms-pill.tsx +193 -0
  73. package/client/x-comms-timeline.tsx +176 -0
  74. package/client/x-comms-tool-call.tsx +85 -0
  75. package/docs/mesh.md +115 -0
  76. package/mcp/LICENSE +202 -0
  77. package/mcp/README.md +287 -0
  78. package/mcp/mcp-config.example.json +8 -0
  79. package/mcp/package-lock.json +1186 -0
  80. package/mcp/package.json +43 -0
  81. package/mcp/paseo-cross-daemon-comms.example.json +5 -0
  82. package/mcp/paseo-x-comms.bundled.mjs +36964 -0
  83. package/mcp/paseo-x-comms.mjs +630 -0
  84. package/mcp/test/fixtures/extensions/block/10-block.mjs +4 -0
  85. package/mcp/test/fixtures/extensions/broken-hook/10-thrower.mjs +6 -0
  86. package/mcp/test/fixtures/extensions/broken-hook/20-good.mjs +4 -0
  87. package/mcp/test/fixtures/extensions/broken-load/10-thrower.mjs +4 -0
  88. package/mcp/test/fixtures/extensions/broken-load/20-good.mjs +4 -0
  89. package/mcp/test/fixtures/extensions/custom-tool/10-tool.mjs +12 -0
  90. package/mcp/test/fixtures/extensions/tool-block/10-block.mjs +8 -0
  91. package/mcp/test/fixtures/extensions/transform/10-transform.mjs +15 -0
  92. package/mcp/test/fixtures/fake-paseo.mjs +92 -0
  93. package/mcp/test/register-ts-hooks.mjs +6 -0
  94. package/mcp/test/resolve-ts-hooks.mjs +46 -0
  95. package/package.json +58 -0
  96. package/paseo-plugin.json +7 -0
  97. package/server/conversations-snapshot.ts +249 -0
  98. package/server/handlers.ts +1081 -0
  99. package/server/injection.ts +152 -0
  100. package/server/local-send.ts +153 -0
  101. package/server/mcp-client.ts +47 -0
  102. package/server/outbox.ts +233 -0
  103. package/server/peer-channel.ts +151 -0
  104. package/server/peer-status.ts +233 -0
  105. package/server/presence.ts +204 -0
  106. package/server/registry.ts +215 -0
  107. package/server/relay-status.ts +9 -0
  108. package/server/server-status.ts +138 -0
  109. package/server/settings.ts +81 -0
  110. package/server/snapshot.ts +176 -0
  111. package/server/vendor/paseo-plugin-helper/agent.ts +85 -0
  112. package/server/vendor/paseo-plugin-helper/custom-pills.ts +344 -0
  113. package/server/vendor/paseo-plugin-helper/index.ts +18 -0
  114. package/server/vendor/paseo-plugin-helper/jsonc.ts +78 -0
  115. package/server/vendor/paseo-plugin-helper/logger.ts +210 -0
  116. package/server/vendor/paseo-plugin-helper/mcp/client.ts +349 -0
  117. package/server/vendor/paseo-plugin-helper/mcp/http-client.ts +399 -0
  118. package/server/vendor/paseo-plugin-helper/mcp/index.ts +5 -0
  119. package/server/vendor/paseo-plugin-helper/mcp/process-killer.ts +65 -0
  120. package/server/vendor/paseo-plugin-helper/mcp/ring-buffer.ts +29 -0
  121. package/server/vendor/paseo-plugin-helper/mcp/types.ts +41 -0
  122. package/server/vendor/paseo-plugin-helper/mcp-config.ts +367 -0
  123. package/server/vendor/paseo-plugin-helper/mcp-injection.ts +85 -0
  124. package/server/vendor/paseo-plugin-helper/network.ts +91 -0
  125. package/server/vendor/paseo-plugin-helper/plugins.ts +160 -0
  126. package/server/vendor/paseo-plugin-helper/process.ts +186 -0
  127. package/server/vendor/paseo-plugin-helper/redact.ts +86 -0
  128. package/server/vendor/paseo-plugin-helper/rpc-guard.ts +77 -0
  129. package/server/vendor/paseo-plugin-helper/settings.ts +97 -0
  130. package/server/vendor/paseo-plugin-helper/shared-settings.ts +243 -0
  131. package/server/vendor/paseo-plugin-helper/storage.ts +244 -0
  132. package/server/vendor/paseo-plugin-helper/system.ts +128 -0
  133. package/server/vendor/paseo-plugin-helper/task.ts +116 -0
  134. package/server/vendor/paseo-plugin-helper/version.ts +153 -0
  135. package/server/vendor/paseo-plugin-helper/workspace-beacon.ts +418 -0
  136. package/shared/conversations-snapshot.ts +39 -0
  137. package/shared/envelope.ts +92 -0
  138. package/shared/outbox.ts +21 -0
  139. package/shared/registry.ts +366 -0
  140. package/shared/vendor/paseo-plugin-helper/README.md +11 -0
  141. package/shared/vendor/paseo-plugin-helper/async.ts +35 -0
  142. package/shared/vendor/paseo-plugin-helper/custom-pills.ts +169 -0
  143. package/shared/vendor/paseo-plugin-helper/forge.ts +110 -0
  144. package/shared/vendor/paseo-plugin-helper/formatters.ts +271 -0
  145. package/shared/vendor/paseo-plugin-helper/highlight.ts +184 -0
  146. package/shared/vendor/paseo-plugin-helper/index.ts +10 -0
  147. package/shared/vendor/paseo-plugin-helper/rpc.ts +72 -0
  148. package/shared/vendor/paseo-plugin-helper/settings.ts +138 -0
  149. package/shared/vendor/paseo-plugin-helper/suite-settings.ts +17 -0
  150. package/shared/vendor/paseo-plugin-helper/suppressed.ts +31 -0
  151. package/shared/vendor/paseo-plugin-helper/types.ts +36 -0
  152. package/shared/version.ts +2 -0
package/mcp/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/mcp/README.md ADDED
@@ -0,0 +1,287 @@
1
+ # paseo-x-comms
2
+
3
+ > This repo closely follows stable releases of paseo in order to benefit
4
+ > from new features in the plugin system. Expect breaking changes between
5
+ > versions.
6
+
7
+ [paseo](https://paseo.sh) is an agent orchestrator: AI coding agents run on
8
+ paseo daemons, each managing its own workspaces, tools, and permissions.
9
+
10
+ paseo-x-comms is an MCP server that lets agents on one paseo daemon
11
+ (remote or local) talk to agents on another paseo daemon, even across hosts,
12
+ through the daemon's relay (WebSocket + E2EE) or directly over TCP.
13
+
14
+ ## How it works
15
+
16
+ ```
17
+ pi / opencode --MCP stdio--> paseo-x-comms (our server)
18
+ │ execFile("paseo", [cmd, "--host", <target>, "--json", …])
19
+
20
+ paseo CLI --relay (E2EE) or direct TCP--> daemon
21
+ ```
22
+
23
+ - The MCP server is just a **client** of daemons: it never runs a
24
+ daemon, and it only *talks* to agents; each agent does its own work on its
25
+ own local daemon.
26
+ - `--host` is an **opaque string**: paseo classifies it automatically: a value
27
+ containing `#offer=` is a relay connection (E2EE); anything else is a direct
28
+ host target. Our registry maps a short name to that string.
29
+ - Every MCP response and every tool result flows through the official SDK, so
30
+ framing, JSON-RPC, schema validation, and cancellation are protocol-correct
31
+ by construction.
32
+ - The server also announces its behavioral contract to clients via the MCP
33
+ `instructions` field (initialize result), so every model using it gets the
34
+ envelope format and behavior notes below automatically.
35
+
36
+ ## Install
37
+
38
+ ### As a standalone MCP server
39
+
40
+ ```sh
41
+ npm install -g @xpufx/paseo-x-comms
42
+ ```
43
+
44
+ Requires the `paseo` CLI on PATH. Node ≥ 18.
45
+
46
+ ### As a paseo plugin (recommended)
47
+
48
+ This repo also ships a paseo plugin that embeds the MCP server and adds the
49
+ x-comms UI (composer pill, agent panel, timeline rendering, and the
50
+ "Inject MCP into context" system-prompt toggle). The plugin is at the repo
51
+ root, so install without `--path`:
52
+
53
+ ```sh
54
+ paseo plugin add <owner>/paseo-x-comms
55
+ ```
56
+
57
+ paseo runs a single `npm install` at the repo root, which pulls both the
58
+ plugin dependencies and the embedded server's dependencies (`@modelcontextprotocol/sdk`,
59
+ `zod`) into one `node_modules`. The server is spawned from `./mcp` and resolves
60
+ its deps from that shared tree; no separate server install or PATH entry is
61
+ required.
62
+
63
+ ## Quick start
64
+
65
+ 1. On the **target** host, get its pairing offer:
66
+
67
+ ```sh
68
+ paseo daemon pair --json
69
+ # → { "relayEnabled": true, "url": "https://app.paseo.sh/#offer=<b64>", ... }
70
+ ```
71
+
72
+ (Or, if that daemon is directly reachable over TCP, e.g. LAN, Tailscale, VPN,
73
+ use its address, e.g. `10.0.0.5:6767`, instead of an offer.)
74
+
75
+ 2. On **this** host, write the registry file with a name for that daemon
76
+ (see `paseo-x-comms.example.json` for the format):
77
+
78
+ `~/.paseo/paseo-x-comms/registry.json`:
79
+
80
+ ```json
81
+ { "hsi": "https://app.paseo.sh/#offer=<b64>" }
82
+ ```
83
+
84
+ The registry is credentials; write it yourself and do not paste offers
85
+ into agent contexts.
86
+
87
+ 3. Discover and talk:
88
+
89
+ ```
90
+ x_comms_list_agents(daemon="hsi")
91
+ x_comms_send(daemon="hsi", agentId="…", prompt="…")
92
+ ```
93
+
94
+ ## Tools
95
+
96
+ > Tool names are `x_comms_*`. When a client (pi, opencode)
97
+ > loads this MCP server, it may prefix tool names with its own server
98
+ > registration (for example `paseo_2d_cross_2d_daemon_2d_comms_...` in pi).
99
+ > Match the tool names the client actually exposes in its tool list; the
100
+ > documented names below are the server's own, without any client prefix.
101
+
102
+ | Tool | Purpose |
103
+ |------|---------|
104
+ | `x_comms_list_daemons` | List registered daemons (names only) |
105
+ | `x_comms_add_daemon` | Register a daemon: pairing link or direct host |
106
+ | `x_comms_remove_daemon` | Forget a registered daemon |
107
+ | `x_comms_list_agents` | List agents on a daemon |
108
+ | `x_comms_inspect` | Inspect an agent on a daemon |
109
+ | `x_comms_send` | Send a message/task to an agent on a daemon (starts it if idle) |
110
+ | `x_comms_logs` | View an agent's activity/timeline on a daemon |
111
+ | `x_comms_wait` | Block until an agent on a daemon is idle; returns `permission` the moment it stalls on a prompt |
112
+ | `x_comms_list_permissions` | List pending permission requests on a daemon |
113
+ | `x_comms_allow_permission` | Allow an agent's permission request (`reqId` or `all`) |
114
+ | `x_comms_deny_permission` | Deny an agent's permission request (`reqId` or `all`, optional `message`/`interrupt`) |
115
+
116
+ ## Message envelope
117
+
118
+ `send` prepends a structured sender-meta envelope, one line, JSON:
119
+
120
+ ```
121
+ [x-comms] {"xComms":{"version":3,"type":"x-comms.incoming_message","sender":{…},"target":{…},"sentAt":"…"}}
122
+ ```
123
+
124
+ - `sender`: agentId, agentName, host, daemonServerId, cwd: who is talking and
125
+ from where. Sources: `agentId`/`cwd` from the environment
126
+ (`PASEO_AGENT_ID` / `PASEO_AGENT_CWD`), `host`/`daemonServerId` from
127
+ `paseo daemon status --json`, `agentName` from `paseo inspect <agentId> --json`.
128
+ - `target`: daemon name + recipient agentId.
129
+ - `sentAt`: ISO timestamp.
130
+ - The prompt text itself stays prose: the meta is for machines, the prompt is
131
+ for humans.
132
+
133
+ Recipients may parse the envelope and reply to `sender.agentId` on the
134
+ sender's daemon. The envelope is versioned (`version: 1`), so the format can
135
+ evolve without breaking older readers.
136
+
137
+ For best results, run the same version on each daemon: the envelope format,
138
+ tool names, and parameters evolve between releases, so a mismatched pair still
139
+ works, but the older side answers in its older format.
140
+
141
+ ## Behavior notes
142
+
143
+ - **Send is preemptive.** A message to a busy agent replaces its current run
144
+ (paseo's `replaceRunning: true` in `startAgentRun`, see
145
+ `packages/server/src/server/agent/agent-prompt.ts`) on both sides. If a
146
+ target may be busy, wait until it is idle before messaging it, or expect the
147
+ preemption.
148
+ - **Permission loop.** An agent may block on a permission prompt; `send`
149
+ returns `permission`, `wait` surfaces it, `list_permissions` shows details,
150
+ and `allow_permission`/`deny_permission` answer. The loop:
151
+ `send` → `wait` → on `permission`: `list_permissions` + allow/deny →
152
+ `wait` … → `idle`.
153
+ - **Preflight.** A target alias is resolved before dispatch: an unknown alias
154
+ fails with the exact string and a `pairing is required` hint, not a generic
155
+ failure.
156
+ - **Self-message.** Sending to your own agent (`agentId` equals the sender)
157
+ fails with the fixed `x-comms self-message` label. Same-daemon routing for a
158
+ *different* agent is the locality rule (#9), which is still open.
159
+
160
+ ## Host forms
161
+
162
+ The registry value is passed to paseo as an **opaque** `--host` string; paseo
163
+ classifies it:
164
+
165
+ - `https://app.paseo.sh/#offer=<b64>` : relay connection (E2EE)
166
+ - `host:port`, `tcp://host:port?ssl=true&password=secret`, `unix:///path`,
167
+ IPC paths, bare port: direct connection to a reachable daemon
168
+
169
+ Only these canonical forms are accepted. Anything else (e.g. a raw base64
170
+ payload) is passed through untouched and paseo fails visibly on it. (Note:
171
+ paseo's own `--host` help text lists only `host:port` and `tcp://…`; bare
172
+ ports and `unix://` also work but are not documented in the CLI help.)
173
+
174
+ ## Extensions
175
+
176
+ > [!WARNING]
177
+ > **Extensions are trusted, unsandboxed server-tier code.** They run in this
178
+ > MCP server's process with full Node privileges: filesystem, network, child
179
+ > processes. There is no sandbox, no permission prompt, and no isolation
180
+ > boundary — the same trust level as an installed paseo plugin. Only drop in
181
+ > `.mjs` files you would run yourself.
182
+
183
+ Drop `*.mjs` files into the extension dir (default
184
+ `~/.paseo/paseo-x-comms/extensions`, override with `PASEO_X_COMMS_EXTENSIONS`).
185
+ Each exports `register(api)` (default or named) and is loaded in filename
186
+ order at startup. Extensions can add filters and register their own tools on
187
+ the same MCP server:
188
+
189
+ ```js
190
+ export default function register(api) {
191
+ // payload + context -> transform (return new payload), block, or passthrough
192
+ api.onSend((message, context) => ({ ...message, prompt: message.prompt.trim() }));
193
+ api.onReceive((data, context) => data); // response from a daemon
194
+ api.onToolCall((args, context) => args); // every tool invocation
195
+
196
+ api.registerTool(
197
+ "x_comms_hello",
198
+ { title: "Hello", description: "Demo tool", inputSchema: {} },
199
+ () => ({ content: [{ type: "text", text: "hi" }] }),
200
+ );
201
+ }
202
+ ```
203
+
204
+ - `api.version` is the extension API version (currently `1`); it is bumped on
205
+ any breaking change to the surface above.
206
+ - A filter returns `undefined`/`null`/`{action:"pass"}` to pass through, a new
207
+ payload (or `{action:"transform", value}`) to transform, or
208
+ `{action:"block", reason}` to block. A block stops the chain and surfaces the
209
+ reason as the tool error.
210
+ - A file that throws while loading is skipped, and a hook that throws is logged
211
+ and treated as passthrough. One bad extension cannot take down the server or
212
+ the other extensions.
213
+
214
+ ## Security
215
+
216
+ The registry (default `~/.paseo/paseo-x-comms/registry.json`) holds live
217
+ pairing offers (serverId, daemon public keys, relay endpoints): it is
218
+ **credentials**. Never publish it. Configure it as a plain JSON file yourself
219
+ (see the example); do not paste offers into agent contexts and do not share
220
+ the file.
221
+
222
+ ## Configuration
223
+
224
+ | Env var | Default | Purpose |
225
+ |---------|---------|---------|
226
+ | `PASEO_X_COMMS_REMOTES` | `~/.paseo/paseo-x-comms/registry.json` | registry file path |
227
+ | `PASEO_X_COMMS_PASEO` | `paseo` | paseo binary |
228
+ | `PASEO_X_COMMS_TIMEOUT_MS` | `120000` | per paseo call timeout |
229
+ | `PASEO_X_COMMS_EXTENSIONS` | `~/.paseo/paseo-x-comms/extensions` | extension dir (trusted, unsandboxed) |
230
+
231
+ ## Registering with clients
232
+
233
+ Example configs live in this repo: `mcp-config.example.json` (pi-style
234
+ registration) and `paseo-x-comms.example.json` (registry format:
235
+ never commit your real registry).
236
+
237
+ pi (`~/.config/mcp/mcp.json`): the stdio form supports `env` (pi needs MCP
238
+ enabled for this to be picked up):
239
+
240
+ ```json
241
+ {
242
+ "mcpServers": {
243
+ "paseo-x-comms": {
244
+ "command": "node",
245
+ "args": ["/path/to/paseo-x-comms.mjs"],
246
+ "type": "stdio",
247
+ "env": { "PASEO_X_COMMS_REMOTES": "/path/to/paseo-x-comms.json" }
248
+ }
249
+ }
250
+ }
251
+ ```
252
+
253
+ opencode (`~/.config/opencode/opencode.jsonc`): note the key is `environment`
254
+ (per opencode's schema):
255
+
256
+ ```jsonc
257
+ {
258
+ "mcp": {
259
+ "paseo-x-comms": {
260
+ "type": "local",
261
+ "command": ["node", "/path/to/paseo-x-comms.mjs"],
262
+ "enabled": true,
263
+ "environment": { "PASEO_X_COMMS_REMOTES": "/path/to/paseo-x-comms.json" }
264
+ }
265
+ }
266
+ }
267
+ ```
268
+
269
+ ## Scope
270
+
271
+ Communication only. The toolset covers discovery (`list_agents`, `inspect`),
272
+ messaging (`send`), listening (`logs`, `wait`), answering (`allow_permission`,
273
+ `deny_permission`, `list_permissions`), and the daemon registry
274
+ (`list_daemons`, `add_daemon`, `remove_daemon`). It deliberately does not
275
+ operate resources on other daemons: no schedules, terminals, workspaces, or
276
+ agent creation.
277
+
278
+ ## Development
279
+
280
+ ```sh
281
+ npm install
282
+ npm test # hermetic: fake paseo CLI + temp registry, no live daemons
283
+ ```
284
+
285
+ ## License
286
+
287
+ Apache-2.0.
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "paseo-x-comms": {
4
+ "command": "paseo-x-comms",
5
+ "type": "stdio"
6
+ }
7
+ }
8
+ }