dsh-plugin-mesh 0.5.8 → 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/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 they find each other on the
14
- LAN, show up in a sidebar panel, and accept tasks from one another. The receiving
15
- machine wakes its own agent to do the work, and the result is dispatched back.
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
- **With `requirePairing: false` (the default), any host that can reach TCP `45917` can
64
- POST a task, and that task wakes an agent session** using the configured
65
- `permissionPreset`. Discovery is intentionally public so you can see machines before
66
- deciding to talk to them.
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
- On an untrusted network (café, dorm, office):
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