dsh-plugin-mesh 0.5.7 → 0.5.9
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/AGENTS.md +9 -2
- package/README.en.md +28 -9
- package/README.md +77 -976
- package/client/client.js +628 -38
- package/cordis.patch.yml +10 -0
- package/lib/_selftest-approval.mjs +165 -0
- package/lib/_selftest-at-mention-host.mjs +377 -0
- package/lib/_selftest-at-mention.mjs +168 -0
- package/lib/_selftest-capabilities.mjs +11 -7
- package/lib/_selftest-prompt.mjs +7 -0
- package/lib/_selftest-reply-route.mjs +60 -1
- package/lib/_selftest-update.mjs +20 -3
- package/lib/_selftest-upgrade.mjs +623 -0
- package/lib/_selftest-workbench.mjs +163 -20
- package/lib/approval.js +152 -0
- package/lib/at-mention.js +109 -0
- package/lib/index.js +712 -99
- package/lib/prompt.js +5 -1
- package/lib/update.js +3 -0
- package/lib/upgrade.js +635 -0
- package/llms.txt +23 -3
- package/package.json +14 -10
- package/scripts/check-tdz.mjs +54 -9
package/AGENTS.md
CHANGED
|
@@ -100,7 +100,10 @@ lib/identity.js persistent UUID + OS machine fingerprint (claim only)
|
|
|
100
100
|
lib/conversation.js conversation key + reply target (both sides compute independently)
|
|
101
101
|
lib/capabilities.js runtime/GPU/capability collection, sanitising, staleness
|
|
102
102
|
lib/prompt.js task prompt text generation (pure, unit-tested)
|
|
103
|
+
lib/at-mention.js chat-window `@machine` parsing + rewritten prompt (pure, unit-tested)
|
|
103
104
|
lib/switch.js one-click shutdown resolver (pure, unit-tested): state.json `shutdown`
|
|
105
|
+
lib/update.js version comparison + npm registry lookup (pure + injectable fetch, unit-tested)
|
|
106
|
+
lib/upgrade.js one-click upgrade: sha512 verify, tar extract, loadability gate, atomic swap (unit-tested)
|
|
104
107
|
lib/tsnet/ sidecar download/verify, per-channel process manager, tailnet HTTP bridge,
|
|
105
108
|
channel-list resolution (channels.js, pure and unit-tested)
|
|
106
109
|
client/client.js renderer: sidebar icon + Mesh panel, hand-written bundle
|
|
@@ -120,9 +123,13 @@ inject the prompt → the peer's agent replies by calling `mesh_run`.
|
|
|
120
123
|
|---|---|---|
|
|
121
124
|
| Core / tsnet | `npm run selftest` | discovery, multi-channel endpoints, channel resolution, conversation keys, stall detection (76) |
|
|
122
125
|
| Capabilities | `npm run selftest:caps` | sanitising, GPU parsing, retry-on-timeout, claim rules (72) |
|
|
123
|
-
| Client render | `npm run selftest:client` | bundle loads, `apply()` registers slots, component output, kill-switch rows + overview bar (
|
|
124
|
-
| Prompt | `npm run selftest:prompt` | reply target must be a machine name, not `machine/user
|
|
126
|
+
| Client render | `npm run selftest:client` | bundle loads, `apply()` registers slots, component output, kill-switch rows + overview bar, chat-window @ source (72) |
|
|
127
|
+
| Prompt | `npm run selftest:prompt` | reply target must be a machine name, not `machine/user`; results must not carry noWake (16) |
|
|
128
|
+
| Chat-window @ | `npm run selftest:at` | leading `@machine` parsing, name-with-spaces matching, failure wording (19) |
|
|
129
|
+
| Chat-window @ (host) | `npm run selftest:at:host` | real `agent/pre-step` → loopback POST, dedupe, offline/ambiguous/closed failures, inbound gate bypass for human tasks (17) |
|
|
125
130
|
| Kill switch | `npm run selftest:switch` | shutdown merge rules: `off` defaults to true, `all` closes both scopes, strict booleans only (15) |
|
|
131
|
+
| Update check | `npm run selftest:update` | version compare/prerelease, registry fallback, "failure is not up-to-date" (22) |
|
|
132
|
+
| One-click upgrade | `npm run selftest:upgrade` | integrity, tar paths, change classification, atomic swap/rollback (26) |
|
|
126
133
|
|
|
127
134
|
`lib/_selftest-newsession.mjs` is a manual end-to-end check that needs a dev host
|
|
128
135
|
running; it is deliberately not part of `npm test` because it creates real agent
|
package/README.en.md
CHANGED
|
@@ -10,9 +10,24 @@
|
|
|
10
10
|
|
|
11
11
|
## What it is
|
|
12
12
|
|
|
13
|
-
A dsh plugin. Install it on two or more machines and
|
|
14
|
-
LAN, show up in a sidebar panel, and
|
|
15
|
-
|
|
13
|
+
A dsh plugin. Install it on two or more machines and the agents find each other on
|
|
14
|
+
the LAN, show up in a sidebar panel, and hand work to one another. The receiving
|
|
15
|
+
agent decides how to do it, and the result is dispatched back into **Tasks** —
|
|
16
|
+
dispatch only means "delivered", the result arrives on its own.
|
|
17
|
+
|
|
18
|
+
This is **agent-to-agent delegation**, not remote execution: you state the outcome,
|
|
19
|
+
the other agent runs the commands.
|
|
20
|
+
|
|
21
|
+
### Examples
|
|
22
|
+
|
|
23
|
+
| Scenario | You say | The peer agent does | You get |
|
|
24
|
+
|---|---|---|---|
|
|
25
|
+
| Compile on the PC | “Build the Windows target, send the artifact and errors.” | pulls, builds, collects | artifact path, exit code, errors |
|
|
26
|
+
| Deploy & verify on Android | “Install that build on the Android device, launch it, send a screenshot and logs.” | installs, launches, screenshots, logs | screenshot, key logs, launch status |
|
|
27
|
+
| Plugin adaptation | “On Windows, install the latest build, restart, confirm health reports the new version.” | upgrades, restarts, probes health | version, whether it took effect |
|
|
28
|
+
|
|
29
|
+
Chains work too: A sends to B to compile, B hands it to C to deploy, and the result
|
|
30
|
+
comes back to A. Each hop is just another `mesh_run` — no central scheduler.
|
|
16
31
|
|
|
17
32
|
When machines are not on the same network, an optional bundled userspace Tailscale
|
|
18
33
|
node (tsnet) provides a second channel. It is a separate Go binary, downloaded per
|
|
@@ -57,17 +72,21 @@ is often blocked by routers — the panel's **Scan subnet** button works around
|
|
|
57
72
|
rather than assumed-good.
|
|
58
73
|
- **Traceable routing** — every task records why it went where it went, and why it
|
|
59
74
|
failed if it did. Both are readable from the peer.
|
|
75
|
+
- **A demo that needs one machine** — the panel's **看演示 / demo** entry plays the
|
|
76
|
+
whole dispatch → run → result loop locally (no network, no agent session, no
|
|
77
|
+
tokens), so a single-machine user can see what it is for.
|
|
60
78
|
|
|
61
79
|
## Security defaults — read this
|
|
62
80
|
|
|
63
|
-
**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
**A first task from an unknown machine does not run.** It is held as
|
|
82
|
+
`needs-approval` and the panel asks the owner once ("Allow" / "Deny"); nothing wakes
|
|
83
|
+
until it is allowed. Approved machines are remembered locally (`approvedPeers` in
|
|
84
|
+
`state.json`). Set `requireApproval: false` to restore fully unattended dispatch.
|
|
67
85
|
|
|
68
|
-
|
|
86
|
+
Discovery is intentionally public so you can see machines before deciding to talk to
|
|
87
|
+
them. On an untrusted network (café, dorm, office) also turn on pairing:
|
|
69
88
|
|
|
70
|
-
1. Flip the switch in the Mesh panel's **pairing** card — it takes effect immediately, no restart. (Writing `requirePairing: true` in `cordis.patch.yml` also works and pins it on, so the UI cannot turn it off.)
|
|
89
|
+
1. Flip the switch in the Mesh panel's **pairing** card — it takes effect immediately, no restart. (Writing `requirePairing: true` in `cordis.patch.yml` also works and pins it on, so the UI cannot turn it off. Pairing also skips the per-machine approval prompt, since it is the stronger trust gesture.)
|
|
71
90
|
2. Make the pairing secret identical on both machines (the Mesh panel has a field for it).
|
|
72
91
|
|
|
73
92
|
Note the token travels in a plain HTTP header: it guards against stray devices on
|