swarph-cli 0.9.4__tar.gz → 0.10.0__tar.gz
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.
- {swarph_cli-0.9.4/src/swarph_cli.egg-info → swarph_cli-0.10.0}/PKG-INFO +67 -2
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/README.md +63 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/pyproject.toml +7 -2
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/__init__.py +1 -1
- swarph_cli-0.10.0/src/swarph_cli/commands/add.py +1446 -0
- swarph_cli-0.10.0/src/swarph_cli/commands/hooks.py +755 -0
- swarph_cli-0.10.0/src/swarph_cli/commands/mcp_server.py +212 -0
- swarph_cli-0.10.0/src/swarph_cli/commands/protocol_handler.py +383 -0
- swarph_cli-0.10.0/src/swarph_cli/commands/security.py +389 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/spawn.py +111 -15
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/watchdog.py +472 -25
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/main.py +5 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0/src/swarph_cli.egg-info}/PKG-INFO +67 -2
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli.egg-info/SOURCES.txt +28 -1
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli.egg-info/requires.txt +3 -0
- swarph_cli-0.10.0/tests/test_add_security_gate.py +72 -0
- swarph_cli-0.10.0/tests/test_artifact_add.py +196 -0
- swarph_cli-0.10.0/tests/test_artifact_hash.py +223 -0
- swarph_cli-0.10.0/tests/test_artifact_lib.py +217 -0
- swarph_cli-0.10.0/tests/test_artifact_mcp.py +228 -0
- swarph_cli-0.10.0/tests/test_artifact_skill.py +183 -0
- swarph_cli-0.10.0/tests/test_artifact_tool.py +218 -0
- swarph_cli-0.10.0/tests/test_artifact_uri.py +134 -0
- swarph_cli-0.10.0/tests/test_feature_to_uri.py +164 -0
- swarph_cli-0.10.0/tests/test_hooks_add.py +321 -0
- swarph_cli-0.10.0/tests/test_hooks_bundle.py +200 -0
- swarph_cli-0.10.0/tests/test_hooks_init.py +126 -0
- swarph_cli-0.10.0/tests/test_hooks_lifecycle.py +205 -0
- swarph_cli-0.10.0/tests/test_hooks_merge.py +240 -0
- swarph_cli-0.10.0/tests/test_mcp_server.py +172 -0
- swarph_cli-0.10.0/tests/test_protocol_handler.py +272 -0
- swarph_cli-0.10.0/tests/test_security.py +226 -0
- swarph_cli-0.10.0/tests/test_spawn_windows_relaunch.py +168 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_watchdog.py +8 -3
- swarph_cli-0.10.0/tests/test_watchdog_dm_wake.py +106 -0
- swarph_cli-0.10.0/tests/test_watchdog_dm_wake_cooldown.py +178 -0
- swarph_cli-0.10.0/tests/test_watchdog_dm_wake_wiring.py +195 -0
- swarph_cli-0.10.0/tests/test_watchdog_model_rung.py +465 -0
- swarph_cli-0.10.0/tests/test_watchdog_stale_peers.py +130 -0
- swarph_cli-0.9.4/tests/test_spawn_windows_relaunch.py +0 -129
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/LICENSE +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/setup.cfg +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/caller.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/cell.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/__init__.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/chat.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/daemon.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/hook_output.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/import_session.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/init.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/install_hook.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/memory_sync.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/mesh.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/onboard.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/commands/ratify.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/parsers/__init__.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/parsers/claude.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/systemd/swarph-watchdog.default +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/systemd/swarph-watchdog.service +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli/systemd/swarph-watchdog.timer +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli.egg-info/dependency_links.txt +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli.egg-info/entry_points.txt +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/src/swarph_cli.egg-info/top_level.txt +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_cell_loader.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_chat_command.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_claude_parser.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_daemon_command.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_hook_output.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_import_command.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_init_command.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_install_hook.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_main.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_memory_sync.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_mesh_command.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_mesh_sidecar.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_onboard_command.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_ratify_command.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_smoke_chat.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_smoke_one_shot.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_smoke_phase_5_5.py +0 -0
- {swarph_cli-0.9.4 → swarph_cli-0.10.0}/tests/test_spawn_command.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: swarph-cli
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: The `swarph` binary — multi-LLM CLI + mesh-gateway integration: multi-provider `swarph spawn` (claude/codex/antigravity per cell.provider via a ProviderMembrane + subprocess billing-scrub), interactive `swarph init`, `swarph mesh` (send/inbox/register) + inbox sidecar, `assisted_memory` (git-backed durable memory), session import, watchdog. v0.9.
|
|
3
|
+
Version: 0.10.0
|
|
4
|
+
Summary: The `swarph` binary — multi-LLM CLI + mesh-gateway integration: multi-provider `swarph spawn` (claude/codex/antigravity per cell.provider via a ProviderMembrane + subprocess billing-scrub), interactive `swarph init`, `swarph mesh` (send/inbox/register) + inbox sidecar, `assisted_memory` (git-backed durable memory), session import, watchdog. v0.9.5: foolproof Windows auto-relaunch (genuine-WT detection via process ancestry, not WT_SESSION).
|
|
5
5
|
Author: Pierre Samson, Claude Opus
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/darw007d/swarph-cli
|
|
@@ -29,6 +29,8 @@ Requires-Dist: swarph-shared>=0.3.1
|
|
|
29
29
|
Requires-Dist: PyYAML>=6.0
|
|
30
30
|
Provides-Extra: dev
|
|
31
31
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
32
|
+
Provides-Extra: mcp
|
|
33
|
+
Requires-Dist: mcp>=1.0; extra == "mcp"
|
|
32
34
|
Dynamic: license-file
|
|
33
35
|
|
|
34
36
|
# swarph-cli
|
|
@@ -178,6 +180,69 @@ tail -f /var/log/swarph-watchdog.log # append-log alternative
|
|
|
178
180
|
|
|
179
181
|
Why this matters: pre-v0.7.3, swarph-cli shipped the watchdog code but no install path. Lab ran it via cron (manual setup); droplet never installed it at all. A real production silence-window (drop's ~24min mute 2026-05-14 08:38→09:02 UTC after an Anthropic API error) made the install-gap visible. v0.7.3 closes it for any peer with one command.
|
|
180
182
|
|
|
183
|
+
**Cross-host throttle-recovery wake (`--dm-wake`, "mesh-monitor mode"):**
|
|
184
|
+
|
|
185
|
+
A1 (local tmux send-keys) and A2 (respawn) can only recover a cell on the watchdog's *own* host. `--dm-wake` adds the cross-host complement: the watchdog also scans the gateway `/peers` list, finds peers whose `last_health` is stale (throttle-stranded sessions on *other* hosts), and sends each a wake DM (`kind="fyi"`) via the gateway `/messages`. The wake chain is **watchdog → wake DM → target peer's sidecar/inbox-watcher → `tmux send-keys` wakes that session**. Reuses the same `--gateway` URL + `MESH_GATEWAY_TOKEN` and the same `--threshold` staleness window as the local check.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
swarph watchdog --check --peer lab-ovh --gateway http://localhost:8788 --dm-wake --dm-wake-cooldown-sec 1800
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
- `--dm-wake-cooldown-sec SEC` (default `1800` / 30 min) — no-spam gate: each stale peer is DM-woken at most once per window, so a peer that stays stale across many ticks is woken once, not every tick. Per-peer cooldown state lives at `$XDG_STATE_HOME/swarph/dm_wake_state.json` (falls back to `~/.local/state/swarph/dm_wake_state.json`).
|
|
192
|
+
|
|
193
|
+
**Scope honesty (v1):** the wake DM is *wake + re-drain* — the woken cell drains its inbox and resumes work; it does **not** resume the exact throttled in-flight task (per-cell task-checkpointing is future v2 scope).
|
|
194
|
+
|
|
195
|
+
**Exit codes:**
|
|
196
|
+
|
|
197
|
+
| Code | Meaning |
|
|
198
|
+
|------|---------|
|
|
199
|
+
| `0` | no action (session healthy / no unread DMs queued) or install ok |
|
|
200
|
+
| `1` | A1 fired (local tmux send-keys wake-prompt) |
|
|
201
|
+
| `2` | A2 fired (local full respawn) |
|
|
202
|
+
| `3` | watchdog acted/couldn't-read — **either** a cross-host wake DM (A1-DM) fired this tick (local was a no-op) **or** detection error (cursor unreadable / gateway unreachable). Both map to `3`. |
|
|
203
|
+
| `4` | configuration error (invalid args, no cell.yaml resolved); install needs sudo |
|
|
204
|
+
| `5` | install error (file write failed / systemctl failed) |
|
|
205
|
+
|
|
206
|
+
**Deploy (COMMANDER-GATED — lab does not self-publish/self-deploy):** now that `--dm-wake` ships, the lab + droplet watchdog crons can drop their placeholder note ("REMOVE when lab ships `swarph watchdog --dm-wake`"). The deploy step — described here, not an instruction to run — is: (a) publish the new swarph-cli, (b) add `--dm-wake` (and optionally `--dm-wake-cooldown-sec`) to the watchdog cron line on the always-on mesh-monitor host (lab), (c) drop the placeholder note from that cron entry.
|
|
207
|
+
|
|
208
|
+
### `swarph hooks`
|
|
209
|
+
|
|
210
|
+
Installs Claude Code hooks as **content** wired into `~/.claude/settings.json` — a hook becomes an installable artifact (a script + its event/matcher bindings merged into your settings) with no swarph-cli version bump per hook, the same way `watchdog --install-service` ships systemd units as bundled data.
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
swarph hooks init # install the recommended bundled set (cell-resilience)
|
|
214
|
+
swarph hooks add cell-resilience # install one builtin by name
|
|
215
|
+
swarph hooks add ./my-hook # install a local bundle dir (hook.json + script)
|
|
216
|
+
swarph hooks list # builtins + install status (installed|available)
|
|
217
|
+
swarph hooks remove cell-resilience
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Trust model.** Three tiers: `builtin` (trusted, bundled with swarph-cli — installs without a prompt), `local` (a bundle dir you point at — shown then confirmed before any write), and `published`/`@cell/name` (**fails closed in v1** — never installs another cell's unreviewed code). Signed-publisher identity plus a publish-time security gate is the v2 model (see the scope doc `research/architecture/swarph_hooks_installer_scope.md` §3.1 in the hedge-fund-mcp repo).
|
|
221
|
+
|
|
222
|
+
**Bundled `cell-resilience`.** Binds `StopFailure`/`rate_limit` + `Stop`/`(all)` to a script that writes `$XDG_STATE_HOME/swarph/idle_since.json` (`{"session","reason","hook_event","ts"}`, `reason=throttle|normal`) — the push-side throttle detector the watchdog's `--dm-wake` can read instead of polling. Observational only: it never blocks the session and always exits 0 (jq if present, printf/sed fallback otherwise).
|
|
223
|
+
|
|
224
|
+
**Activation caveat.** A freshly-installed hook does not go live in the current session — Claude Code can't hot-load it. Reopen `/hooks` (or restart the session) once to activate.
|
|
225
|
+
|
|
226
|
+
### `swarph add`
|
|
227
|
+
|
|
228
|
+
The unified, typed install verb over the swarph commons — **one command installs any commons artifact**, routed by class. Where `swarph hooks add` installs only hooks, `swarph add` takes a single content-addressed URI and dispatches to the right per-class installer.
|
|
229
|
+
|
|
230
|
+
**The URI ("magnet link").** An artifact is named by `swarph://<class>/<publisher>/<name>[@<version>][#<sha256>]`. The four classes are `hook` / `mcp` / `skill` / `tool`. The optional `#sha256` is **content-addressed**: it pins the exact bytes of the artifact, so the install is tamper-evident and verifiable from *any* cell that serves the same content — the BitTorrent-magnet property (the URI, not a trusted host, is the source of truth).
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
swarph add swarph://hook/swarph-builtin/cell-resilience # install a builtin hook
|
|
234
|
+
swarph add swarph://mcp/swarph-builtin/everything # install the reference MCP server
|
|
235
|
+
swarph add swarph://skill/swarph-builtin/swarph-intro # install a builtin skill
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
(`tool` is not yet implemented — it bridges to swarph-mesh's adapter registry as a follow-on.)
|
|
239
|
+
|
|
240
|
+
**Trust model (v1).** Builtin publishers (`swarph-builtin`) install; **any other publisher fails closed** — a published/untrusted URI never installs another cell's unreviewed code. Signed-publisher identity plus a per-class publish-time security gate is the v2 model (scope `research/architecture/swarph_artifact_uri_scope.md` §4 and the hooks scope §3.1 in the hedge-fund-mcp repo). When a URI carries `#sha256`, the resolved artifact is hash-verified and **refused on mismatch** — nothing is written.
|
|
241
|
+
|
|
242
|
+
**Resolving from metaedge.surf.** A search result on metaedge hands back a `swarph://` URI; you `swarph add` it. The link resolves *to the swarph*, not to a particular server: the CLI fetches the artifact from the publishing cell/registry and hash-verifies it against `#sha256`, so the same artifact can be served from any cell. Today this is copy-paste; a `swarph://` OS protocol-handler for click-to-install — the way `magnet:` opens a torrent client — is a future UX layer.
|
|
243
|
+
|
|
244
|
+
**Activation.** Like hooks, freshly-installed hooks and skills are not hot-loaded into the running session — reopen `/hooks` (or restart the session) once to pick them up.
|
|
245
|
+
|
|
181
246
|
### `swarph onboard` + `swarph ratify` (Phase 5.5)
|
|
182
247
|
|
|
183
248
|
Per PLAN.md §15, onboarding splits into a **mechanics phase** (`swarph onboard`) that automates the boring parts (registry POST, scaffolding, token resolution) and a **manual contract phase** (the new peer composes the handshake DM in their own words). A witness peer judges the handshake and runs `swarph ratify <peer>` to flip `ratified=true`, gating `task_claim` server-side.
|
|
@@ -145,6 +145,69 @@ tail -f /var/log/swarph-watchdog.log # append-log alternative
|
|
|
145
145
|
|
|
146
146
|
Why this matters: pre-v0.7.3, swarph-cli shipped the watchdog code but no install path. Lab ran it via cron (manual setup); droplet never installed it at all. A real production silence-window (drop's ~24min mute 2026-05-14 08:38→09:02 UTC after an Anthropic API error) made the install-gap visible. v0.7.3 closes it for any peer with one command.
|
|
147
147
|
|
|
148
|
+
**Cross-host throttle-recovery wake (`--dm-wake`, "mesh-monitor mode"):**
|
|
149
|
+
|
|
150
|
+
A1 (local tmux send-keys) and A2 (respawn) can only recover a cell on the watchdog's *own* host. `--dm-wake` adds the cross-host complement: the watchdog also scans the gateway `/peers` list, finds peers whose `last_health` is stale (throttle-stranded sessions on *other* hosts), and sends each a wake DM (`kind="fyi"`) via the gateway `/messages`. The wake chain is **watchdog → wake DM → target peer's sidecar/inbox-watcher → `tmux send-keys` wakes that session**. Reuses the same `--gateway` URL + `MESH_GATEWAY_TOKEN` and the same `--threshold` staleness window as the local check.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
swarph watchdog --check --peer lab-ovh --gateway http://localhost:8788 --dm-wake --dm-wake-cooldown-sec 1800
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
- `--dm-wake-cooldown-sec SEC` (default `1800` / 30 min) — no-spam gate: each stale peer is DM-woken at most once per window, so a peer that stays stale across many ticks is woken once, not every tick. Per-peer cooldown state lives at `$XDG_STATE_HOME/swarph/dm_wake_state.json` (falls back to `~/.local/state/swarph/dm_wake_state.json`).
|
|
157
|
+
|
|
158
|
+
**Scope honesty (v1):** the wake DM is *wake + re-drain* — the woken cell drains its inbox and resumes work; it does **not** resume the exact throttled in-flight task (per-cell task-checkpointing is future v2 scope).
|
|
159
|
+
|
|
160
|
+
**Exit codes:**
|
|
161
|
+
|
|
162
|
+
| Code | Meaning |
|
|
163
|
+
|------|---------|
|
|
164
|
+
| `0` | no action (session healthy / no unread DMs queued) or install ok |
|
|
165
|
+
| `1` | A1 fired (local tmux send-keys wake-prompt) |
|
|
166
|
+
| `2` | A2 fired (local full respawn) |
|
|
167
|
+
| `3` | watchdog acted/couldn't-read — **either** a cross-host wake DM (A1-DM) fired this tick (local was a no-op) **or** detection error (cursor unreadable / gateway unreachable). Both map to `3`. |
|
|
168
|
+
| `4` | configuration error (invalid args, no cell.yaml resolved); install needs sudo |
|
|
169
|
+
| `5` | install error (file write failed / systemctl failed) |
|
|
170
|
+
|
|
171
|
+
**Deploy (COMMANDER-GATED — lab does not self-publish/self-deploy):** now that `--dm-wake` ships, the lab + droplet watchdog crons can drop their placeholder note ("REMOVE when lab ships `swarph watchdog --dm-wake`"). The deploy step — described here, not an instruction to run — is: (a) publish the new swarph-cli, (b) add `--dm-wake` (and optionally `--dm-wake-cooldown-sec`) to the watchdog cron line on the always-on mesh-monitor host (lab), (c) drop the placeholder note from that cron entry.
|
|
172
|
+
|
|
173
|
+
### `swarph hooks`
|
|
174
|
+
|
|
175
|
+
Installs Claude Code hooks as **content** wired into `~/.claude/settings.json` — a hook becomes an installable artifact (a script + its event/matcher bindings merged into your settings) with no swarph-cli version bump per hook, the same way `watchdog --install-service` ships systemd units as bundled data.
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
swarph hooks init # install the recommended bundled set (cell-resilience)
|
|
179
|
+
swarph hooks add cell-resilience # install one builtin by name
|
|
180
|
+
swarph hooks add ./my-hook # install a local bundle dir (hook.json + script)
|
|
181
|
+
swarph hooks list # builtins + install status (installed|available)
|
|
182
|
+
swarph hooks remove cell-resilience
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**Trust model.** Three tiers: `builtin` (trusted, bundled with swarph-cli — installs without a prompt), `local` (a bundle dir you point at — shown then confirmed before any write), and `published`/`@cell/name` (**fails closed in v1** — never installs another cell's unreviewed code). Signed-publisher identity plus a publish-time security gate is the v2 model (see the scope doc `research/architecture/swarph_hooks_installer_scope.md` §3.1 in the hedge-fund-mcp repo).
|
|
186
|
+
|
|
187
|
+
**Bundled `cell-resilience`.** Binds `StopFailure`/`rate_limit` + `Stop`/`(all)` to a script that writes `$XDG_STATE_HOME/swarph/idle_since.json` (`{"session","reason","hook_event","ts"}`, `reason=throttle|normal`) — the push-side throttle detector the watchdog's `--dm-wake` can read instead of polling. Observational only: it never blocks the session and always exits 0 (jq if present, printf/sed fallback otherwise).
|
|
188
|
+
|
|
189
|
+
**Activation caveat.** A freshly-installed hook does not go live in the current session — Claude Code can't hot-load it. Reopen `/hooks` (or restart the session) once to activate.
|
|
190
|
+
|
|
191
|
+
### `swarph add`
|
|
192
|
+
|
|
193
|
+
The unified, typed install verb over the swarph commons — **one command installs any commons artifact**, routed by class. Where `swarph hooks add` installs only hooks, `swarph add` takes a single content-addressed URI and dispatches to the right per-class installer.
|
|
194
|
+
|
|
195
|
+
**The URI ("magnet link").** An artifact is named by `swarph://<class>/<publisher>/<name>[@<version>][#<sha256>]`. The four classes are `hook` / `mcp` / `skill` / `tool`. The optional `#sha256` is **content-addressed**: it pins the exact bytes of the artifact, so the install is tamper-evident and verifiable from *any* cell that serves the same content — the BitTorrent-magnet property (the URI, not a trusted host, is the source of truth).
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
swarph add swarph://hook/swarph-builtin/cell-resilience # install a builtin hook
|
|
199
|
+
swarph add swarph://mcp/swarph-builtin/everything # install the reference MCP server
|
|
200
|
+
swarph add swarph://skill/swarph-builtin/swarph-intro # install a builtin skill
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
(`tool` is not yet implemented — it bridges to swarph-mesh's adapter registry as a follow-on.)
|
|
204
|
+
|
|
205
|
+
**Trust model (v1).** Builtin publishers (`swarph-builtin`) install; **any other publisher fails closed** — a published/untrusted URI never installs another cell's unreviewed code. Signed-publisher identity plus a per-class publish-time security gate is the v2 model (scope `research/architecture/swarph_artifact_uri_scope.md` §4 and the hooks scope §3.1 in the hedge-fund-mcp repo). When a URI carries `#sha256`, the resolved artifact is hash-verified and **refused on mismatch** — nothing is written.
|
|
206
|
+
|
|
207
|
+
**Resolving from metaedge.surf.** A search result on metaedge hands back a `swarph://` URI; you `swarph add` it. The link resolves *to the swarph*, not to a particular server: the CLI fetches the artifact from the publishing cell/registry and hash-verifies it against `#sha256`, so the same artifact can be served from any cell. Today this is copy-paste; a `swarph://` OS protocol-handler for click-to-install — the way `magnet:` opens a torrent client — is a future UX layer.
|
|
208
|
+
|
|
209
|
+
**Activation.** Like hooks, freshly-installed hooks and skills are not hot-loaded into the running session — reopen `/hooks` (or restart the session) once to pick them up.
|
|
210
|
+
|
|
148
211
|
### `swarph onboard` + `swarph ratify` (Phase 5.5)
|
|
149
212
|
|
|
150
213
|
Per PLAN.md §15, onboarding splits into a **mechanics phase** (`swarph onboard`) that automates the boring parts (registry POST, scaffolding, token resolution) and a **manual contract phase** (the new peer composes the handshake DM in their own words). A witness peer judges the handshake and runs `swarph ratify <peer>` to flip `ratified=true`, gating `task_claim` server-side.
|
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "swarph-cli"
|
|
7
|
-
version = "0.
|
|
8
|
-
description = "The `swarph` binary — multi-LLM CLI + mesh-gateway integration: multi-provider `swarph spawn` (claude/codex/antigravity per cell.provider via a ProviderMembrane + subprocess billing-scrub), interactive `swarph init`, `swarph mesh` (send/inbox/register) + inbox sidecar, `assisted_memory` (git-backed durable memory), session import, watchdog. v0.9.
|
|
7
|
+
version = "0.10.0"
|
|
8
|
+
description = "The `swarph` binary — multi-LLM CLI + mesh-gateway integration: multi-provider `swarph spawn` (claude/codex/antigravity per cell.provider via a ProviderMembrane + subprocess billing-scrub), interactive `swarph init`, `swarph mesh` (send/inbox/register) + inbox sidecar, `assisted_memory` (git-backed durable memory), session import, watchdog. v0.9.5: foolproof Windows auto-relaunch (genuine-WT detection via process ancestry, not WT_SESSION)."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
11
11
|
requires-python = ">=3.10"
|
|
@@ -55,6 +55,11 @@ Spec = "https://github.com/darw007d/hedge-fund-mcp/blob/main/research/swarph_cli
|
|
|
55
55
|
|
|
56
56
|
[project.optional-dependencies]
|
|
57
57
|
dev = ["pytest>=7.0"]
|
|
58
|
+
# Door 1: `swarph mcp-server` runs an MCP (stdio) server exposing the swarph
|
|
59
|
+
# toolbelt (swarph_search/add/describe) to any MCP host. The SDK is an extra
|
|
60
|
+
# so the core one-shot/mesh paths don't pull it in; `swarph mcp-server`
|
|
61
|
+
# prints a `pip install swarph-cli[mcp]` hint when it's absent.
|
|
62
|
+
mcp = ["mcp>=1.0"]
|
|
58
63
|
|
|
59
64
|
[project.scripts]
|
|
60
65
|
swarph = "swarph_cli.main:main"
|