@mmmbuto/nexuscrew 0.9.0 → 0.9.1

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 (38) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +22 -4
  3. package/frontend/dist/assets/index-Bu_-2-Uu.js +93 -0
  4. package/frontend/dist/index.html +1 -1
  5. package/frontend/dist/version.json +1 -1
  6. package/lib/cli/commands.js +14 -0
  7. package/lib/config.js +9 -0
  8. package/lib/live-host/routes.js +9 -3
  9. package/lib/nodes/commands.js +15 -4
  10. package/lib/nodes/store.js +43 -0
  11. package/lib/nodes/tunnel.js +19 -0
  12. package/lib/proxy/federation.js +25 -1
  13. package/lib/proxy/panel-auth.js +63 -33
  14. package/lib/proxy/panel-proxy.js +41 -10
  15. package/lib/server.js +128 -6
  16. package/lib/settings/pairing-coordinator.js +32 -0
  17. package/lib/settings/public-peering-routes.js +13 -1
  18. package/package.json +1 -1
  19. package/skills/aidesktop/SKILL.md +201 -0
  20. package/skills/aidesktop/docker/Dockerfile +21 -0
  21. package/skills/aidesktop/docker/custom-cont-init.d/10-cdp-relay.sh +20 -0
  22. package/skills/aidesktop/docker/docker-compose.example.yml +75 -0
  23. package/skills/live/SKILL.md +90 -0
  24. package/skills/nexuscrew/SKILL.md +113 -0
  25. package/frontend/dist/assets/index-zjL6kZ7J.js +0 -93
  26. package/skills/alibaba-token-media/SKILL.md +0 -152
  27. package/skills/alibaba-token-media/agents/openai.yaml +0 -4
  28. package/skills/alibaba-token-media/references/api-contract.md +0 -97
  29. package/skills/alibaba-token-media/scripts/alibaba_token_media.py +0 -550
  30. package/skills/fill-forms/SKILL.md +0 -177
  31. package/skills/fill-forms/agents/openai.yaml +0 -4
  32. package/skills/fill-forms/references/overlay-technique.md +0 -99
  33. package/skills/fill-forms/requirements.txt +0 -4
  34. package/skills/fill-forms/scripts/dump_docx.py +0 -70
  35. package/skills/fill-forms/scripts/fill_docx.py +0 -207
  36. package/skills/fill-forms/scripts/fill_pdf.py +0 -424
  37. package/skills/fill-forms/scripts/inspect_pdf.py +0 -188
  38. package/skills/fill-forms/scripts/prepare_signature.py +0 -171
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: live
3
+ description: Use when a user wants to know or change which cell is the Live host on a node, asks why a Live host designation was rejected, or needs to grant or revoke another node's permission to designate a Live host cell on this one (liveHostAccess, via nexuscrew nodes live-host).
4
+ ---
5
+
6
+ # Live host cell
7
+
8
+ Live is the phone-facing quick-open flow: a single **host cell**, designated
9
+ per node, is what a Live session lands on. See
10
+ [Fleet and terminals](../../docs/FLEET.md) for what Live is; this skill covers
11
+ designating it, clearing it, and permitting it across nodes.
12
+
13
+ ## One host cell per node, guarded by a revision
14
+
15
+ Each node keeps exactly one `hostCell` (or none). Changing it is a
16
+ compare-and-swap on a `revision` number, never an unconditional write:
17
+
18
+ 1. `GET .../live-host` returns `{ hostCell, revision, eligible, host: { lease } }`.
19
+ 2. `POST .../live-host/designate { cellId, expectedRevision }` — `expectedRevision`
20
+ must be the value just read. A stale revision (someone else changed the
21
+ designation meanwhile) is rejected with 409, not silently overwritten.
22
+ 3. `POST .../live-host/clear { expectedRevision }` — same rule, removes the
23
+ designation.
24
+
25
+ Always re-read the revision immediately before writing; never reuse one from
26
+ an earlier render. This is what keeps two people (or two tabs) racing to star
27
+ a cell from leaving the store in a mixed state — one write wins, the other
28
+ gets a 409 and re-reads.
29
+
30
+ The designation survives the cell going inactive; it is never dropped just
31
+ because tmux is not attached right now. `eligible` is computed fresh on every
32
+ read from the roster and the designated cell's lease state
33
+ (`live`/`grace`/`expired`/`none`/`unavailable`) — a designated-but-not-eligible
34
+ host is a distinct, readable state, not an error to explain away.
35
+
36
+ ## Command the node that owns the cell, not the one serving the page
37
+
38
+ This is the point of the feature: **the request must reach the node whose
39
+ roster contains the cell**, not whichever node happens to be rendering the
40
+ current page. Route it exactly like a federated deck — an empty route for a
41
+ local cell, that node's route array for a remote one:
42
+
43
+ ```js
44
+ getLiveHost(token, route) // route: [] or [...hops]
45
+ designateHostCell(token, cellId, expectedRevision, route)
46
+ clearHostCell(token, expectedRevision, route)
47
+ ```
48
+
49
+ Before 0.9.1 these calls took no `route`, so starring a cell shown from a
50
+ remote node either did nothing or silently changed the wrong node's
51
+ designation. That mismatch — not a missing capability — was the defect: a
52
+ parameter nobody passed does not exist.
53
+
54
+ ## Federated permission: liveHostAccess
55
+
56
+ A peer may designate or read another node's Live host only if that node has
57
+ granted it. The permission is per peer, **denied by default**, and granted by
58
+ the node that **owns** the cell — never by the one asking:
59
+
60
+ ```bash
61
+ nexuscrew nodes live-host <node> on
62
+ nexuscrew nodes live-host <node> off
63
+ ```
64
+
65
+ Without it, the request gets a **named** rejection, not a timeout or a star
66
+ that quietly does nothing: HTTP 403 with `reason: "live-host-not-granted"`.
67
+ Surface this distinctly from a generic failure — the fix is a grant on the
68
+ owning node, not a retry from the requester.
69
+
70
+ ## Common mistakes
71
+
72
+ - **Reusing a stale `revision`.** `GET` immediately before every
73
+ `designate`/`clear`; a revision read earlier in the session is stale by
74
+ definition once anything else has changed the designation.
75
+ - **Designating a cell that belongs to a different node than the route
76
+ targets.** The route selects which node's roster is searched; a `cellId`
77
+ absent from that node's local roster is rejected with 404, never forwarded
78
+ further to guess where it might live.
79
+ - **Reading a `live-host-not-granted` rejection as a bug.** It means exactly
80
+ what it says: run `nexuscrew nodes live-host <node> on` on the node that
81
+ owns the cell, not on the node making the request.
82
+ - **Assuming Live host state is global.** It is one value **per node**; a node
83
+ with nothing designated still answers `GET` with `hostCell: null` — a valid
84
+ state, distinct from "not permitted to ask".
85
+
86
+ ## Dependencies
87
+
88
+ **Bundled:** this is a NexusCrew core feature. No external MCP companion or
89
+ separate service is required — only a running NexusCrew node on each side of
90
+ the designation.
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: nexuscrew
3
+ description: Read this first when working with NexusCrew for any reason — understanding what it is, what an AI agent can do through it, how cells, nodes, decks, engines, panels and Live fit together, which companion skills cover which capability, and where the trust boundaries are. This is the entry point: every other NexusCrew skill assumes what is written here.
4
+ ---
5
+
6
+ # NexusCrew — what it is and what you can do through it
7
+
8
+ Read this before the other NexusCrew skills. They describe individual
9
+ capabilities; this one describes the machine they belong to, and the rules that
10
+ hold across all of them.
11
+
12
+ If the running build and this document disagree, **the build wins**. Check with
13
+ `nexuscrew status`, `nexuscrew doctor`, and the MCP tool list actually exposed
14
+ in your session.
15
+
16
+ ## The shape of the system
17
+
18
+ NexusCrew turns live tmux sessions, AI CLI workers and connected machines into
19
+ one local-first control plane, reachable from a browser.
20
+
21
+ Five nouns carry almost everything:
22
+
23
+ - **Node** — one installation on one machine. Its identity is an opaque
24
+ `instanceId`; the human-readable name is a **label**, and two nodes may
25
+ legitimately carry the same one. **Address things by id, never by name.**
26
+ - **Cell** — one stable working identity (`Dev`, `Research`, …) bound to one
27
+ tmux session and one engine. A cell is not a process: it survives restarts of
28
+ the service, and stopping it does not end the work it was doing.
29
+ - **Engine** — what a cell runs: an AI CLI, a plain shell, a command in a
30
+ container. Some are *managed* (the service knows how to describe and
31
+ configure them), some are not.
32
+ - **Deck** — a relationship between cells that work together. Not a duplicate
33
+ cell, not a group chat: an arrangement.
34
+ - **Panel** — an optional web interface a cell can carry, served next to its
35
+ terminal. A remote desktop, a notebook, a dashboard.
36
+
37
+ Two machines that have paired are **peers**. Federation is the normal case, not
38
+ the exception: assume the human is driving from one node toward another.
39
+
40
+ ## What an AI agent can actually do
41
+
42
+ Through the MCP bridge, when the tools are exposed in your session:
43
+
44
+ | You want to | Use | Covered by |
45
+ |---|---|---|
46
+ | tell the human something, or ask | `nc_notify`, `nc_ask` | `nexuscrew-agent` |
47
+ | read runtime state, identity, decks | `nc_status`, `nc_identity`, `nc_deck` | `nexuscrew-agent` |
48
+ | find and message another cell | `nc_cells` then `nc_send_cell` | `nexuscrew-agent` |
49
+ | speak on a node or audio group | `nc_speak`, `nc_speak_group` | `nexuscrew-agent` |
50
+ | hand a file to the human | `nc_send_file`, `nc_inbox` | `nexuscrew-agent` |
51
+ | find out why a cell will not start | `nc_cell_diagnostics` | `nexuscrew-agent` |
52
+ | keep state across sessions | Memory MCP | `memory` |
53
+ | index and retrieve documents | MSA MCP | `vl-msa` |
54
+ | delegate bounded work to workers | Crew MCP | `crew` |
55
+ | read, search and triage mail | Mail MCP | `mail-assistant` |
56
+
57
+ The last four are **optional companions**, listed in
58
+ [`mcp-companions.json`](../../mcp-companions.json). They are separate servers:
59
+ absent unless installed, and never installed silently.
60
+
61
+ ## Four rules that will save you a wasted hour
62
+
63
+ **A receipt is not an outcome.** `submitted` from `nc_send_cell` means the text
64
+ was pasted and Enter was pressed. It does not mean the message was understood,
65
+ accepted, or acted on. If completion matters, ask for an explicit answer.
66
+
67
+ **There is no offline queue.** A cell that is not active cannot receive. A
68
+ `canReceive: false` peer is not "queued", it is unreachable.
69
+
70
+ **Discovery is not authorization.** Seeing a cell or node in a listing does not
71
+ mean you may act on it. Panels in particular are denied by default and granted
72
+ per peer, by the node that owns the cell.
73
+
74
+ **A cell that looks idle may not be.** A TUI queues incoming messages while it
75
+ works, which is healthy. Do not conclude a cell is stuck from a quiet pane.
76
+
77
+ ## Trust boundaries
78
+
79
+ - Everything binds to **loopback** by default. Reaching a node from elsewhere
80
+ means a tunnel or a pairing, deliberately.
81
+ - A **panel** must point at loopback on the machine that runs the node. This is
82
+ not a port-forward: the caller picks *which cell*, never *where to connect*.
83
+ Without that rule, opening "a panel" would be a way to reach anything the
84
+ node can reach.
85
+ - Never put tokens, keys, cookies or pairing material into MCP payloads,
86
+ messages to cells, or documents. Do not read credential files to work around
87
+ a missing tool.
88
+ - Mutations are honoured or refused, never faked: `NEXUSCREW_READONLY=1` and
89
+ routed-peer inspect-only limits are real, and a refusal is information.
90
+
91
+ ## Where to look next
92
+
93
+ | Topic | Document |
94
+ |---|---|
95
+ | Cells, engines, decks | [Fleet](../../docs/FLEET.md) |
96
+ | Peers, pairing, visibility | [Nodes](../../docs/NODES.md) |
97
+ | The MCP bridge and client setup | [MCP](../../docs/MCP.md) |
98
+ | A cell's web panel | [Cell panel](../../docs/CELL_PANEL.md) |
99
+ | Files, environment, settings | [Configuration](../../docs/CONFIGURATION.md) |
100
+ | CLI, boot, backup, diagnostics | [Operations](../../docs/OPERATIONS.md) |
101
+ | Trust boundaries in depth | [Security](../../docs/SECURITY.md) |
102
+
103
+ ## When something does not work
104
+
105
+ In this order, because each step rules out the one before:
106
+
107
+ 1. `nexuscrew status` — is the service running, on which port, in which roles?
108
+ 2. `nexuscrew doctor` — local diagnostics.
109
+ 3. Is the tool you need **actually exposed** in this session? Do not emulate a
110
+ missing tool by reading state files; say it is missing and degrade openly.
111
+ 4. For a cell that will not start: `nc_cell_diagnostics` before anything else —
112
+ it returns the redacted command and the last startup failure.
113
+ 5. Only then look at files, and say that you are doing so and why.