sigild 0.0.7 → 0.0.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.
Files changed (145) hide show
  1. package/README.md +80 -27
  2. package/THREAT_MODEL.md +6 -4
  3. package/dist/src/audit/log.d.ts +1 -1
  4. package/dist/src/audit/log.js +1 -1
  5. package/dist/src/bin/sigil-mcp.js +60 -16
  6. package/dist/src/bin/sigil-mcp.js.map +1 -1
  7. package/dist/src/cli/index.d.ts +2 -2
  8. package/dist/src/cli/index.d.ts.map +1 -1
  9. package/dist/src/cli/index.js.map +1 -1
  10. package/dist/src/cli/main.d.ts.map +1 -1
  11. package/dist/src/cli/main.js +35 -9
  12. package/dist/src/cli/main.js.map +1 -1
  13. package/dist/src/cli/paths.d.ts +15 -5
  14. package/dist/src/cli/paths.d.ts.map +1 -1
  15. package/dist/src/cli/paths.js +11 -1
  16. package/dist/src/cli/paths.js.map +1 -1
  17. package/dist/src/cli/portal.d.ts +14 -1
  18. package/dist/src/cli/portal.d.ts.map +1 -1
  19. package/dist/src/cli/portal.js +31 -1
  20. package/dist/src/cli/portal.js.map +1 -1
  21. package/dist/src/cli/status.d.ts +15 -12
  22. package/dist/src/cli/status.d.ts.map +1 -1
  23. package/dist/src/cli/status.js +17 -30
  24. package/dist/src/cli/status.js.map +1 -1
  25. package/dist/src/cli/unlock.d.ts +15 -15
  26. package/dist/src/cli/unlock.d.ts.map +1 -1
  27. package/dist/src/cli/unlock.js +83 -60
  28. package/dist/src/cli/unlock.js.map +1 -1
  29. package/dist/src/confirm/ack-server.d.ts +53 -0
  30. package/dist/src/confirm/ack-server.d.ts.map +1 -0
  31. package/dist/src/confirm/ack-server.js +87 -0
  32. package/dist/src/confirm/ack-server.js.map +1 -0
  33. package/dist/src/confirm/config.d.ts +54 -0
  34. package/dist/src/confirm/config.d.ts.map +1 -0
  35. package/dist/src/confirm/config.js +139 -0
  36. package/dist/src/confirm/config.js.map +1 -0
  37. package/dist/src/confirm/gate.d.ts +38 -0
  38. package/dist/src/confirm/gate.d.ts.map +1 -0
  39. package/dist/src/confirm/gate.js +66 -0
  40. package/dist/src/confirm/gate.js.map +1 -0
  41. package/dist/src/confirm/index.d.ts +6 -0
  42. package/dist/src/confirm/index.d.ts.map +1 -0
  43. package/dist/src/confirm/index.js +5 -0
  44. package/dist/src/confirm/index.js.map +1 -0
  45. package/dist/src/confirm/ntfy.d.ts +38 -0
  46. package/dist/src/confirm/ntfy.d.ts.map +1 -0
  47. package/dist/src/confirm/ntfy.js +47 -0
  48. package/dist/src/confirm/ntfy.js.map +1 -0
  49. package/dist/src/confirm/types.d.ts +66 -0
  50. package/dist/src/confirm/types.d.ts.map +1 -0
  51. package/dist/src/confirm/types.js +12 -0
  52. package/dist/src/confirm/types.js.map +1 -0
  53. package/dist/src/control/broadcast.d.ts +29 -0
  54. package/dist/src/control/broadcast.d.ts.map +1 -0
  55. package/dist/src/control/broadcast.js +88 -0
  56. package/dist/src/control/broadcast.js.map +1 -0
  57. package/dist/src/control/client.d.ts.map +1 -1
  58. package/dist/src/control/client.js +4 -1
  59. package/dist/src/control/client.js.map +1 -1
  60. package/dist/src/control/index.d.ts +1 -0
  61. package/dist/src/control/index.d.ts.map +1 -1
  62. package/dist/src/control/index.js +1 -0
  63. package/dist/src/control/index.js.map +1 -1
  64. package/dist/src/control/protocol.d.ts +6 -2
  65. package/dist/src/control/protocol.d.ts.map +1 -1
  66. package/dist/src/control/protocol.js +2 -1
  67. package/dist/src/control/protocol.js.map +1 -1
  68. package/dist/src/control/server.d.ts +10 -0
  69. package/dist/src/control/server.d.ts.map +1 -1
  70. package/dist/src/control/server.js +60 -7
  71. package/dist/src/control/server.js.map +1 -1
  72. package/dist/src/daemon/handles.d.ts +5 -2
  73. package/dist/src/daemon/handles.d.ts.map +1 -1
  74. package/dist/src/daemon/handles.js +11 -3
  75. package/dist/src/daemon/handles.js.map +1 -1
  76. package/dist/src/daemon/methods.d.ts +13 -3
  77. package/dist/src/daemon/methods.d.ts.map +1 -1
  78. package/dist/src/daemon/methods.js +121 -16
  79. package/dist/src/daemon/methods.js.map +1 -1
  80. package/dist/src/eth/secp.d.ts.map +1 -1
  81. package/dist/src/eth/secp.js +6 -2
  82. package/dist/src/eth/secp.js.map +1 -1
  83. package/dist/src/hooks/command-scanner.d.ts.map +1 -1
  84. package/dist/src/hooks/command-scanner.js +57 -13
  85. package/dist/src/hooks/command-scanner.js.map +1 -1
  86. package/dist/src/hooks/glob.js +1 -1
  87. package/dist/src/hooks/glob.js.map +1 -1
  88. package/dist/src/hooks/path-blocker.d.ts.map +1 -1
  89. package/dist/src/hooks/path-blocker.js +1 -8
  90. package/dist/src/hooks/path-blocker.js.map +1 -1
  91. package/dist/src/mcp/server.d.ts +14 -2
  92. package/dist/src/mcp/server.d.ts.map +1 -1
  93. package/dist/src/mcp/server.js +28 -14
  94. package/dist/src/mcp/server.js.map +1 -1
  95. package/dist/src/mcp/tools.d.ts +1 -1
  96. package/dist/src/mcp/tools.d.ts.map +1 -1
  97. package/dist/src/mcp/tools.js +38 -4
  98. package/dist/src/mcp/tools.js.map +1 -1
  99. package/dist/src/policy/evaluate.d.ts +10 -4
  100. package/dist/src/policy/evaluate.d.ts.map +1 -1
  101. package/dist/src/policy/evaluate.js +161 -20
  102. package/dist/src/policy/evaluate.js.map +1 -1
  103. package/dist/src/policy/loader.d.ts.map +1 -1
  104. package/dist/src/policy/loader.js +70 -0
  105. package/dist/src/policy/loader.js.map +1 -1
  106. package/dist/src/policy/template.d.ts +1 -1
  107. package/dist/src/policy/template.d.ts.map +1 -1
  108. package/dist/src/policy/template.js +30 -0
  109. package/dist/src/policy/template.js.map +1 -1
  110. package/dist/src/policy/types.d.ts +53 -3
  111. package/dist/src/policy/types.d.ts.map +1 -1
  112. package/dist/src/policy/types.js.map +1 -1
  113. package/dist/src/qr/encode.d.ts +36 -0
  114. package/dist/src/qr/encode.d.ts.map +1 -0
  115. package/dist/src/qr/encode.js +44 -0
  116. package/dist/src/qr/encode.js.map +1 -0
  117. package/dist/src/qr/index.d.ts +3 -0
  118. package/dist/src/qr/index.d.ts.map +1 -0
  119. package/dist/src/qr/index.js +3 -0
  120. package/dist/src/qr/index.js.map +1 -0
  121. package/dist/src/qr/render.d.ts +34 -0
  122. package/dist/src/qr/render.d.ts.map +1 -0
  123. package/dist/src/qr/render.js +43 -0
  124. package/dist/src/qr/render.js.map +1 -0
  125. package/dist/src/svm/address.d.ts +14 -0
  126. package/dist/src/svm/address.d.ts.map +1 -0
  127. package/dist/src/svm/address.js +18 -0
  128. package/dist/src/svm/address.js.map +1 -0
  129. package/dist/src/svm/base58.d.ts +15 -0
  130. package/dist/src/svm/base58.d.ts.map +1 -0
  131. package/dist/src/svm/base58.js +60 -0
  132. package/dist/src/svm/base58.js.map +1 -0
  133. package/dist/src/svm/ed25519.d.ts +19 -0
  134. package/dist/src/svm/ed25519.d.ts.map +1 -0
  135. package/dist/src/svm/ed25519.js +32 -0
  136. package/dist/src/svm/ed25519.js.map +1 -0
  137. package/dist/src/svm/index.d.ts +5 -0
  138. package/dist/src/svm/index.d.ts.map +1 -0
  139. package/dist/src/svm/index.js +5 -0
  140. package/dist/src/svm/index.js.map +1 -0
  141. package/dist/src/svm/transaction.d.ts +56 -0
  142. package/dist/src/svm/transaction.d.ts.map +1 -0
  143. package/dist/src/svm/transaction.js +182 -0
  144. package/dist/src/svm/transaction.js.map +1 -0
  145. package/package.json +4 -2
package/README.md CHANGED
@@ -4,19 +4,19 @@
4
4
 
5
5
  `sigil` is a local signing tool and Claude Code integration that lets agentic coding tools use private keys without ever putting key material in the model's context window.
6
6
 
7
- **Status:** pre-alpha. The MCP server, CLI, unlock flow, ward hooks, and policy engine (static checks) all work end-to-end. Out-of-band confirmation, rolling-window value caps, and EIP-712 domain allowlists are not yet implemented. Until they land — and until the supply-chain attestations promised for v0.1.0 ship — **do not use this with real funds yet.** Build plan lives in the [tracking issue](https://github.com/cdrn/sigil/issues/9).
7
+ **Status:** pre-alpha. The MCP server, CLI, unlock flow, ward hooks, policy engine (static checks), and out-of-band confirmation via ntfy all work end-to-end. Rolling-window value caps and EIP-712 domain allowlists are not yet implemented. Until they land — and until the supply-chain attestations promised for v0.1.0 ship — **do not use this with real funds yet.** Build plan lives in the [tracking issue](https://github.com/cdrn/sigil/issues/9).
8
8
 
9
9
  ## What it is
10
10
 
11
- One MCP server process, four bins, three runtime deps:
11
+ One MCP server process, four bins, six runtime deps (all pinned, zero transitive):
12
12
 
13
- 1. **`sigil-mcp`** — the only thing that runs. Claude Code spawns it per session via your `mcpServers` config; it dies when Claude exits. Holds unlocked keys in process memory (zeroized on shutdown, `sigil lock`, or unlock-failure; mlock against swap is planned). Keys at rest are encrypted with XChaCha20-Poly1305 and an Argon2id-derived key. Signs over stdio using a DIY MCP wire protocol (~200 lines, no SDK dep). Claude never sees key material — only opaque handles like `eth:executor`.
13
+ 1. **`sigil-mcp`** — the only thing that runs. Claude Code spawns it per session via your `mcpServers` config; it dies when Claude exits. Holds unlocked keys in process memory (zeroized on shutdown, `sigil lock`, or unlock-failure; mlock against swap is planned). Keys at rest are encrypted with XChaCha20-Poly1305 and an Argon2id-derived key. Signs over stdio using a DIY MCP wire protocol (~200 lines, no SDK dep). Claude never sees key material — only opaque handles like `evm:executor`.
14
14
  2. **`sigil`** — control CLI. `init`, `status`, `portal add`/`list`/`remove`, `unlock`, `lock`.
15
15
  3. **`sigil-hook-pre` / `sigil-hook-post`** — Claude Code hook binaries that block reads of common key paths and redact key-shaped strings from tool output.
16
16
 
17
- `sigil-mcp` boots **locked**: empty in-memory handle table, no keys loaded. Sign methods return `DAEMON_LOCKED` (-32003) with a "run sigil unlock" message until you push the passphrase in from a separate terminal via `sigil unlock`. That CLI connects to a Unix socket at `~/.sigil/control.sock` (0600) that `sigil-mcp` opens at startup. After unlock, signs work for the rest of the session; `sigil lock` zeroizes the table without killing the process.
17
+ `sigil-mcp` boots **locked**: empty in-memory handle table, no keys loaded. Sign methods return `DAEMON_LOCKED` (-32003) with a "run sigil unlock" message until you push the passphrase in from a separate terminal via `sigil unlock`. That CLI connects to a per-session Unix socket at `~/.sigil/control/<pid>.sock` (0600) that `sigil-mcp` opens at startup — and fans out to every such socket so one `sigil unlock` reaches all open windows. After unlock, signs work for the rest of the session; `sigil lock` zeroizes the table without killing the process.
18
18
 
19
- Sign methods exposed today: EIP-191 personal_sign, EIP-1559 + legacy transactions, EIP-712 typed data.
19
+ Sign methods exposed today: EIP-191 personal_sign, EIP-1559 + legacy transactions, EIP-712 typed data, plus Solana (ed25519) message + transaction signing — see [Solana support](#solana-svm) below.
20
20
 
21
21
  ## What it isn't
22
22
 
@@ -41,13 +41,13 @@ Requires Node 22+.
41
41
  sigil init
42
42
 
43
43
  # 2a. Generate a fresh key inside sigil (no plaintext ever hits disk):
44
- sigil portal new eth:bot
44
+ sigil portal new evm:bot
45
45
  # → prompts for a passphrase, mints a fresh secp256k1 key, prints the
46
- # address, writes ~/.sigil/keys/eth:bot.sigil + permissive policy.
46
+ # address, writes ~/.sigil/keys/evm:bot.sigil + permissive policy.
47
47
  #
48
48
  # 2b. OR import an existing private key from a file:
49
49
  # Accepts either 32 raw bytes or 64 hex chars (with optional 0x prefix).
50
- sigil portal add eth:bot --key-file ./private.hex
50
+ sigil portal add evm:bot --key-file ./private.hex
51
51
  # → same as above but seeded from the file. Source file is deleted by
52
52
  # default (pass --no-remove-source to keep it).
53
53
  #
@@ -57,11 +57,11 @@ sigil portal add eth:bot --key-file ./private.hex
57
57
  # 3. Open Claude Code. It spawns sigil-mcp automatically via your MCP config.
58
58
  # sigil-mcp boots locked — the first sign attempt will return DAEMON_LOCKED.
59
59
 
60
- # 4. In a separate terminal, push the passphrase to the running sigil-mcp.
60
+ # 4. In a separate terminal, push the passphrase to every running sigil-mcp.
61
61
  sigil unlock
62
- # → prompts for the passphrase, decrypts every keyfile in ~/.sigil/keys/
62
+ # → prompts once, decrypts every keyfile in ~/.sigil/keys/ into each open window
63
63
 
64
- # 5. Use Claude Code. The four sigil_* tools will work for the rest of the session.
64
+ # 5. Use Claude Code. The sigil_* tools (EVM + Solana) will work for the rest of the session.
65
65
 
66
66
  # Optional: re-lock without restarting Claude.
67
67
  sigil lock
@@ -117,26 +117,31 @@ sigil portal remove <handle>
117
117
  Delete a keyfile from disk.
118
118
 
119
119
  sigil unlock
120
- Prompt for the passphrase and push it to the running sigil-mcp over
121
- the control socket. After unlock, sign calls succeed for the rest
122
- of the Claude session. Fails if sigil-mcp is not running (start a
123
- Claude Code session first) or if already unlocked.
120
+ Prompt for the passphrase and push it to every running sigil-mcp at
121
+ once (one per Claude window). After unlock, sign calls succeed for the
122
+ rest of each session. Idempotent — sessions already unlocked are left
123
+ as-is. Fails if no sigil-mcp is running (start a Claude Code session
124
+ first).
124
125
 
125
126
  sigil lock
126
- Tell sigil-mcp to zeroize and clear its in-memory keys. Re-unlock
127
- with sigil unlock — sigil-mcp keeps running.
127
+ Tell every running sigil-mcp to zeroize and clear its in-memory keys.
128
+ Re-unlock with sigil unlock — the sigil-mcp processes keep running.
128
129
 
129
130
  sigil status
130
- Report whether sigil-mcp is running (probes ~/.sigil/control.sock),
131
- its PID, whether it's unlocked, what portals it has loaded, and
132
- how many keyfiles exist on disk. Does not require the passphrase.
131
+ Report which sigil-mcp sessions are running (one entry per window,
132
+ with PID, unlocked flag, and loaded portals) and how many keyfiles
133
+ exist on disk. Does not require the passphrase.
133
134
  ```
134
135
 
135
- Set `SIGIL_HOME` to override `~/.sigil`. Set `SIGIL_CONTROL_SOCK` to override the control socket path.
136
+ Set `SIGIL_HOME` to override `~/.sigil`. Set `SIGIL_CONTROL_DIR` to override the control-socket directory.
136
137
 
137
138
  ## Multi-window behaviour
138
139
 
139
- Each Claude Code window spawns its own `sigil-mcp`. They share the on-disk keyfiles + audit log but have separate in-memory handle tables — you `sigil unlock` once per window. (The first MCP to start owns `control.sock`; further sessions will get their own socket once flock-based per-instance sockets land in Phase C of [#23](https://github.com/cdrn/sigil/issues/23). Until then, only the first window's `sigil-mcp` is reachable from the CLI.)
140
+ Each Claude Code window spawns its own `sigil-mcp`, and each binds its own control socket at `~/.sigil/control/<pid>.sock`. They share the on-disk keyfiles + audit log but keep separate in-memory handle tables.
141
+
142
+ `sigil unlock` / `lock` / `status` fan out across **every** socket in `~/.sigil/control/`, so a single `sigil unlock` loads keys into all currently-open windows — no more guessing which process the CLI reaches. Sockets left behind by hard-killed sessions are detected and cleaned up automatically on the next CLI call.
143
+
144
+ Each window still holds its own decrypted keys only for its own lifetime: closing a window zeroizes that session's keys, and a window opened *after* you unlock starts locked (run `sigil unlock` again to include it). Keys never outlive the Claude sessions that use them — a deliberate property from [#23](https://github.com/cdrn/sigil/issues/23).
140
145
 
141
146
  OS-keychain integration (planned, v0.3) will make unlock zero-touch for users who set it up.
142
147
 
@@ -158,22 +163,70 @@ allowed_selectors = [] # 4-byte function selectors, e.g. "0xa
158
163
 
159
164
  allow_message_signing = false # EIP-191 personal_sign (e.g. SIWE)
160
165
  allow_typed_data = false # EIP-712 (Permit, OpenSea — can be financial)
166
+
167
+ # Optional: above this value, sigil pushes a notification to your phone and
168
+ # waits for an approve/deny tap before signing. See "Out-of-band confirm"
169
+ # below. Must be strictly less than max_value_wei.
170
+ require_confirm_above_wei = "10000000000000000" # 0.01 ETH
161
171
  ```
162
172
 
163
173
  A failed rule throws `POLICY_DENIED` (-32001) back to the agent with the human-readable reason ("tx denied — value X exceeds max_value_wei Y"), and the deny is appended to the hash-chained audit log alongside allows. Denies are forensically the more interesting half — they're the prompt-injection canary.
164
174
 
165
- What's deferred to follow-up PRs (still in [#3](https://github.com/cdrn/sigil/issues/3)): rolling-window value caps (e.g. 1 ETH/day per portal), EIP-712 domain + primary-type allowlists, decoded-calldata arg checks, and the `require_confirm_above_wei` outcome that hooks into the OOB push gate ([#4](https://github.com/cdrn/sigil/issues/4)).
175
+ What's deferred to follow-up PRs (still in [#3](https://github.com/cdrn/sigil/issues/3)): rolling-window value caps (e.g. 1 ETH/day per portal), EIP-712 domain + primary-type allowlists, decoded-calldata arg checks.
176
+
177
+ ## Out-of-band confirm
178
+
179
+ For sign requests above `require_confirm_above_wei`, sigil pushes a notification to a channel you control (not the agent) and waits for an explicit human ack before signing. Today the only transport is [ntfy](https://ntfy.sh) — zero-setup, no accounts. SMS and Telegram transports are wired behind the same `ConfirmTransport` interface and will land in follow-ups.
180
+
181
+ Wire it up in `~/.sigil/config.toml`:
182
+
183
+ ```toml
184
+ [confirm.ntfy]
185
+ topic = "your-unguessable-string-here" # the topic name IS the credential
186
+ # server = "https://ntfy.example.com" # optional, default https://ntfy.sh
187
+
188
+ [confirm]
189
+ # timeout_ms = 60000 # default 60s; timeout = deny
190
+ ```
191
+
192
+ Install the ntfy app on your phone, subscribe to that topic, and you'll get a push with **Approve** / **Deny** buttons every time the threshold is crossed. The buttons hit a local `127.0.0.1` listener inside `sigil-mcp` with a one-time, request-bound token — a leaked or replayed token can't approve a different sign. Timeout, deny click, and push-provider outage all fail closed.
193
+
194
+ If any policy file sets `require_confirm_above_wei` but no transport is configured, `sigil-mcp` refuses to start with a clear error rather than silently degrading every confirm-gated sign to a deny.
195
+
196
+ ## Solana (SVM)
197
+
198
+ Every portal also controls a **Solana address**, derived from the *same secret*. EVM uses secp256k1; Solana uses ed25519 — different curves, so you can't share a public key. But the portal's raw 32-byte secret doubles as an ed25519 seed, yielding one secret → two addresses:
199
+
200
+ ```
201
+ $ sigil portal list
202
+ evm:executor
203
+ evm: 0x1234…abcd
204
+ svm: 7vWxK…Qm9f # base58 ed25519 address, same key
205
+ ```
206
+
207
+ This is exactly the derivation Phantom/Solflare perform on **"import private key"**, so the Solana address is recoverable there (it does *not* match a seed-phrase / BIP44 account — it's the raw-key account).
208
+
209
+ Two MCP tools:
210
+
211
+ - **`sigil_svm_sign_message`** — sign arbitrary off-chain bytes (e.g. Sign-In With Solana) with the ed25519 key. Input is base64; returns a base58 signature.
212
+ - **`sigil_svm_sign_transaction`** — pass a serialized Solana transaction *message* (base64, legacy or v0); sigil ed25519-signs those bytes and returns the base58 signature for you to assemble into the transaction.
213
+
214
+ **Policy.** Solana hides most semantics behind account indices and on-chain state, so sigil only decodes what it can offline: **native SOL (System Program) transfers**, which it gates on `svm_allow_to` (base58 recipient allowlist) and `svm_max_lamports` (per-tx cap), exactly like EVM. Anything it *can't* fully decode — SPL tokens, program calls, address-lookup-table accounts — is **routed to the out-of-band confirm gate**, never silently allowed. Auto-allow is all-or-nothing: a tx is only signed without a human tap if **every** instruction decoded and passed policy. `require_confirm_above_lamports` adds a value threshold (and, in strict mode, the undecodable-tx confirm); in strict mode an undecodable tx with no confirm transport configured fails closed (deny).
215
+
216
+ Relevant policy fields (`~/.sigil/policy/<handle>.toml`): `allow_svm_message_signing`, `svm_allow_to`, `svm_max_lamports`, `require_confirm_above_lamports`.
166
217
 
167
218
  ## Supply chain posture
168
219
 
169
220
  Key-management libraries die from supply chain compromise, not from clever attacks on the code. Given the npm ecosystem in 2026 (Mini Shai-Hulud, Axios, pgserve, TanStack), `sigil` commits to:
170
221
 
171
222
  - **Zero install scripts.** No `postinstall`, `preinstall`, `prepare`. CI-enforced (planned: a CI guard that fails if any dep adds one).
172
- - **Three runtime deps, all version-pinned** (no caret ranges):
223
+ - **Six runtime deps, all version-pinned** (no caret ranges), all zero-transitive — the entire `npm ls --omit dev` tree is exactly these six packages:
173
224
  - [`@noble/ciphers`](https://github.com/paulmillr/noble-ciphers) for XChaCha20-Poly1305
174
- - [`@noble/hashes`](https://github.com/paulmillr/noble-hashes) for Argon2id, keccak256, sha2, HMAC
175
- - [`@noble/secp256k1`](https://github.com/paulmillr/noble-secp256k1) for ECDSA
176
- All by paulmillr, audited, zero transitive deps.
225
+ - [`@noble/hashes`](https://github.com/paulmillr/noble-hashes) for Argon2id, keccak256, sha2/sha512, HMAC
226
+ - [`@noble/secp256k1`](https://github.com/paulmillr/noble-secp256k1) for ECDSA (EVM)
227
+ - [`@noble/ed25519`](https://github.com/paulmillr/noble-ed25519) for EdDSA (Solana)
228
+ - [`@iarna/toml`](https://github.com/iarna/iarna-toml) for parsing per-portal policy TOML files
229
+ - [`qrcode-generator`](https://github.com/kazuhikoarase/qrcode-generator) for `sigil portal qr` rendering
177
230
  - **No MCP SDK.** The official `@modelcontextprotocol/sdk` pulls 92 transitive deps (ajv, hono, cors, cross-spawn, etc) — unacceptable surface. We implement the MCP wire protocol directly in ~200 lines.
178
231
  - **No Bun.** Plain Node only. Bun is currently being weaponized by Mini Shai-Hulud as an evasion layer; we will not give that pattern any cover.
179
232
  - **Provenance attestations on every npm publish.** Starting v0.0.4, releases are built by [a GitHub Actions workflow](./.github/workflows/release.yml) under OIDC trusted-publisher auth, signed with a Sigstore attestation. No long-lived npm token; tampered or out-of-band publishes fail signature verification.
package/THREAT_MODEL.md CHANGED
@@ -25,9 +25,9 @@ Keys at rest are encrypted on disk in `~/.sigil/keys/<handle>.sigil` (XChaCha20-
25
25
 
26
26
  The unlock path:
27
27
 
28
- 1. `sigil-mcp` opens a Unix socket at `~/.sigil/control.sock` (chmod 0600).
29
- 2. The user runs `sigil unlock` in a separate terminal; the CLI prompts for the passphrase, connects to the socket, and sends `{method: "unlock", passphraseB64: ...}`.
30
- 3. `sigil-mcp` decrypts every keyfile in `~/.sigil/keys/`, populates the in-memory table, zeroizes the passphrase buffer.
28
+ 1. `sigil-mcp` opens a Unix socket at `~/.sigil/control/<pid>.sock` (chmod 0600), one per running session.
29
+ 2. The user runs `sigil unlock` in a separate terminal; the CLI prompts for the passphrase, then connects to **every** socket in `~/.sigil/control/` and sends `{method: "unlock", passphraseB64: ...}` to each.
30
+ 3. Each `sigil-mcp` decrypts every keyfile in `~/.sigil/keys/`, populates its own in-memory table, and zeroizes the passphrase buffer.
31
31
 
32
32
  This shape was chosen so the agent has no path to trigger unlock — only a human at the local TTY can. `sigil lock` zeroizes the in-memory table without killing the process; subsequent signs return `DAEMON_LOCKED` again until the next `sigil unlock`.
33
33
 
@@ -59,6 +59,8 @@ The policy engine (per-portal `~/.sigil/policy/<handle>.toml`) is the layer that
59
59
  - On/off toggles for personal_sign (`allow_message_signing`) and EIP-712 typed data (`allow_typed_data`).
60
60
  - Append-only hash-chained audit log records both allow AND deny decisions. Denies are the prompt-injection canary.
61
61
  - Runtime fail-closed when the policy file is missing for a portal — keys can't be used without an explicit decision.
62
+ - **Solana (SVM) key reuse.** A portal's 32-byte secret doubles as an ed25519 seed, so one secret controls both an EVM (secp256k1) and a Solana (ed25519) address. This is *shared fate* by construction: compromising the secret compromises both chains. There is no known attack that combines observed ECDSA and EdDSA signatures to recover the key — both schemes are signature-secure — so reuse adds no cross-protocol weakness beyond "it is literally the same secret." SVM signing is gated by its own policy fields (`allow_svm_message_signing`, `svm_allow_to`, `svm_max_lamports`, `require_confirm_above_lamports`).
63
+ - **SVM policy is decode-limited.** Unlike EVM, Solana hides most transaction semantics behind account indices and on-chain state. sigil only decodes **native System-Program SOL transfers** offline; everything else (SPL tokens, arbitrary programs, address-lookup-table accounts) is *not* auto-allowed — it is routed to the out-of-band confirm gate (and in strict mode with no confirm transport, denied). Auto-allow is all-or-nothing: a tx signs without a human tap only if every instruction decoded and passed policy, which closes the "hide a drain behind a recognized transfer" smuggling vector. sigil signs the serialized message bytes the caller provides; it does not fetch on-chain state.
62
64
 
63
65
  **Planned:**
64
66
  - Rolling-window value caps (`max_value_per_hour_wei`, etc.) backed by a per-portal ledger with flock for multi-instance safety.
@@ -104,7 +106,7 @@ Given the 2026 npm threat landscape, a compromised release of `sigil` would be c
104
106
  - The MCP stdio is the agent's exposed surface; the control socket is the user's exposed surface. Both are unauthenticated within the user's session — any process running as `$USER` can talk to either. This is consistent with the threat model (we don't defend against local user compromise) but worth stating explicitly.
105
107
  - **mlock is not yet implemented.** Plaintext key material lives in a regular `Buffer` that is zeroized on `sigil-mcp` shutdown, on `sigil lock`, or on a failed unlock. This means keys are vulnerable to being paged to swap on a memory-pressured system. mlock requires a native module, which we will ship as bundled prebuilds (no install scripts) rather than via a compile-on-install dependency. Tracked as a planned layer.
106
108
  - **Passphrase in transit through V8 strings.** The control socket carries the passphrase base64-encoded inside a JSON message. The CLI's `Buffer` and the server's decoded `Buffer` are zeroized after use, but the intermediate JSON string sits in V8's string heap and cannot be reliably wiped. This is the same trade-off as `readPassphrase`'s internal accumulator and is considered acceptable for v0.x; mitigations would require either a custom binary framing or a fully native crypto path.
107
- - **Multi-window:** the first `sigil-mcp` to start owns `~/.sigil/control.sock`. Subsequent sessions in other Claude windows still run, but their `sigil-mcp` cannot be reached by `sigil unlock` — only the first one is addressable. Phase C of [#23](https://github.com/cdrn/sigil/issues/23) will add per-PID sockets + a flock'd audit log so multi-window sessions coexist cleanly.
109
+ - **Multi-window:** each `sigil-mcp` binds its own `~/.sigil/control/<pid>.sock`, and `sigil unlock`/`lock`/`status` fan out across all of them, so every open Claude window is reachable from one CLI call. Each session keeps a separate in-memory handle table and unlocks independently; the passphrase is sent (base64 in JSON, same transit caveat as above) to each live session. A window opened after an unlock starts locked until the next `sigil unlock`. Sockets orphaned by hard-killed sessions are unlinked on the next CLI call. Keys still never outlive the sessions that hold them — see [#23](https://github.com/cdrn/sigil/issues/23). The fan-out widens the control surface from one well-known socket to "every `<pid>.sock` in the directory": a hostile process running as `$USER` could plant its own listener in `~/.sigil/control/` and harvest the passphrase on the next `sigil unlock`. The `~/.sigil/` tree is 0700 so this requires same-user code execution, which is already out of scope (above); it is not a new trust boundary, only a larger surface within the existing one.
108
110
  - Out-of-band confirmation (planned, [#4](https://github.com/cdrn/sigil/issues/4)) depends on a working push channel. If the push provider is down, high-value signs are denied, not approved.
109
111
 
110
112
  ## Reporting issues
@@ -70,7 +70,7 @@ export declare function readHead(path: string): ChainHead;
70
70
  *
71
71
  * Typical use:
72
72
  * const w = new AuditWriter('/path/to/audit.log');
73
- * w.append({ kind: 'eth_sign_message', portal: 'eth:bot', payload, decision: 'allow', sig });
73
+ * w.append({ kind: 'eth_sign_message', portal: 'evm:bot', payload, decision: 'allow', sig });
74
74
  * w.close();
75
75
  *
76
76
  * The seq and prev_hash fields are managed by the writer; callers supply
@@ -175,7 +175,7 @@ export function readHead(path) {
175
175
  *
176
176
  * Typical use:
177
177
  * const w = new AuditWriter('/path/to/audit.log');
178
- * w.append({ kind: 'eth_sign_message', portal: 'eth:bot', payload, decision: 'allow', sig });
178
+ * w.append({ kind: 'eth_sign_message', portal: 'evm:bot', payload, decision: 'allow', sig });
179
179
  * w.close();
180
180
  *
181
181
  * The seq and prev_hash fields are managed by the writer; callers supply
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { mkdirSync } from 'node:fs';
2
+ import { chmodSync, mkdirSync } from 'node:fs';
3
3
  import { AuditWriter } from '../audit/index.js';
4
- import { resolvePaths } from '../cli/paths.js';
4
+ import { resolvePaths, sessionSocketPath } from '../cli/paths.js';
5
+ import { ConfirmGate, enforceConfirmTransportPresence, loadConfig, NtfyTransport, startAckServer, } from '../confirm/index.js';
5
6
  import { startControlServer } from '../control/index.js';
6
7
  import { HandleTable } from '../daemon/handles.js';
7
8
  import { runMcpStdio } from '../mcp/server.js';
@@ -11,9 +12,9 @@ import { FileSystemPolicyResolver } from '../policy/index.js';
11
12
  * session via the .claude/settings.json mcpServers entry.
12
13
  *
13
14
  * Lifecycle:
14
- * - On startup: ensures ~/.sigil/{,keys/} exist (0o700), opens the audit
15
- * log, constructs an EMPTY (locked) HandleTable, binds the control
16
- * socket at ~/.sigil/control.sock (0o600).
15
+ * - On startup: ensures ~/.sigil/{,keys/,control/} exist (0o700), opens the
16
+ * audit log, constructs an EMPTY (locked) HandleTable, binds a per-session
17
+ * control socket at ~/.sigil/control/<pid>.sock (0o600).
17
18
  * - During the session: runs the MCP wire loop on stdio. Sign methods
18
19
  * return DAEMON_LOCKED until the user runs `sigil unlock`, which pushes
19
20
  * the passphrase over the control socket; the HandleTable loads the
@@ -21,6 +22,10 @@ import { FileSystemPolicyResolver } from '../policy/index.js';
21
22
  * - On stdin close (Claude exited): closes the control socket, locks +
22
23
  * disposes the HandleTable, closes the audit writer, exits.
23
24
  *
25
+ * Each session owns a distinct socket (named for its PID), so multiple Claude
26
+ * windows no longer contend for a single control.sock — `sigil unlock` fans
27
+ * out across every socket in the directory and unlocks them all at once.
28
+ *
24
29
  * The control socket is unref'd so it doesn't keep the loop alive on its own;
25
30
  * stdin alone gates process lifetime.
26
31
  */
@@ -29,6 +34,36 @@ async function main() {
29
34
  mkdirSync(paths.home, { recursive: true, mode: 0o700 });
30
35
  mkdirSync(paths.keysDir, { recursive: true, mode: 0o700 });
31
36
  mkdirSync(paths.policyDir, { recursive: true, mode: 0o700 });
37
+ mkdirSync(paths.controlDir, { recursive: true, mode: 0o700 });
38
+ // mkdir's `mode` only applies to a freshly-created dir (and is masked by
39
+ // umask), so re-assert 0o700 in case the dir pre-existed with looser perms.
40
+ // The per-socket file gets its own 0o600 from the control server on bind.
41
+ try {
42
+ chmodSync(paths.controlDir, 0o700);
43
+ }
44
+ catch { /* best-effort */ }
45
+ const socketPath = sessionSocketPath(paths.controlDir, process.pid);
46
+ // Load config + fail-closed check. If any portal policy requires OOB
47
+ // confirmation but no transport is configured, refuse to start — running
48
+ // would silently degrade every confirm-gated sign to a deny.
49
+ const config = loadConfig(paths.configFile);
50
+ enforceConfirmTransportPresence(config, paths.policyDir);
51
+ // Stand up the confirm pipeline only if a transport is configured. When
52
+ // it's absent, sign_transaction will reject any tx that hits a confirm
53
+ // threshold via the gatePolicy fail-closed path inside daemon/methods.ts.
54
+ let confirmGate;
55
+ let ackServer;
56
+ if (config.confirm?.ntfy) {
57
+ const transport = new NtfyTransport(config.confirm.ntfy);
58
+ ackServer = await startAckServer();
59
+ const opts = {
60
+ transport,
61
+ ackServer,
62
+ ...(config.confirm.timeoutMs !== undefined ? { timeoutMs: config.confirm.timeoutMs } : {}),
63
+ };
64
+ confirmGate = new ConfirmGate(opts);
65
+ process.stderr.write(`sigil-mcp: confirm transport "${transport.name}" ready (ack on ${ackServer.baseUrl})\n`);
66
+ }
32
67
  const handles = new HandleTable();
33
68
  const audit = new AuditWriter(paths.auditLog);
34
69
  const policy = new FileSystemPolicyResolver(paths.policyDir);
@@ -36,27 +71,26 @@ async function main() {
36
71
  let control = null;
37
72
  try {
38
73
  control = await startControlServer({
39
- socketPath: paths.controlSocket,
74
+ socketPath,
40
75
  keysDir: paths.keysDir,
76
+ policyDir: paths.policyDir,
41
77
  handles,
42
78
  onLog: (e) => process.stderr.write(`control: ${JSON.stringify(e)}\n`),
43
79
  });
44
80
  }
45
81
  catch (err) {
46
- // Another sigil-mcp already owns the control socket (or some other bind
47
- // failure). Stay up without a control socket so the MCP stdio still
48
- // works, but warn — this session will be permanently locked, since the
49
- // primary sigil-mcp is what `sigil unlock` reaches.
50
- process.stderr.write(`sigil-mcp: control socket unavailable (${err.message}). ` +
51
- `This session will stay locked; sign calls will return DAEMON_LOCKED. ` +
52
- `Run "sigil unlock" against the primary sigil-mcp from your first ` +
53
- `Claude session — phase C of #23 will lift this limitation.\n`);
82
+ // The per-PID socket is ours alone, so this is genuinely exceptional
83
+ // (e.g. controlDir not writable). Stay up so the MCP stdio still works,
84
+ // but warn — without a control socket this session can't be unlocked and
85
+ // sign calls will return DAEMON_LOCKED.
86
+ process.stderr.write(`sigil-mcp: control socket unavailable at ${socketPath} (${err.message}). ` +
87
+ `This session will stay locked; sign calls will return DAEMON_LOCKED.\n`);
54
88
  }
55
89
  if (control) {
56
90
  process.stderr.write(`sigil-mcp: ready (locked; run "sigil unlock" to load keys from ${paths.keysDir})\n`);
57
91
  }
58
92
  else {
59
- process.stderr.write(`sigil-mcp: ready (permanently locked — no control socket)\n`);
93
+ process.stderr.write(`sigil-mcp: ready (locked — no control socket; cannot be unlocked)\n`);
60
94
  }
61
95
  const shutdown = () => {
62
96
  handles.dispose();
@@ -65,12 +99,20 @@ async function main() {
65
99
  controlClosed = true;
66
100
  control.close().catch(() => { });
67
101
  }
102
+ if (ackServer) {
103
+ ackServer.close().catch(() => { });
104
+ }
68
105
  };
69
106
  process.on('exit', shutdown);
70
107
  process.on('SIGINT', () => process.exit(0));
71
108
  process.on('SIGTERM', () => process.exit(0));
72
109
  await runMcpStdio({
73
- context: { handles, audit, policy },
110
+ context: {
111
+ handles,
112
+ audit,
113
+ policy,
114
+ ...(confirmGate ? { confirm: confirmGate } : {}),
115
+ },
74
116
  stdin: process.stdin,
75
117
  stdout: process.stdout,
76
118
  onLog: (e) => process.stderr.write(JSON.stringify(e) + '\n'),
@@ -81,6 +123,8 @@ async function main() {
81
123
  controlClosed = true;
82
124
  await control.close();
83
125
  }
126
+ if (ackServer)
127
+ await ackServer.close();
84
128
  process.exit(0);
85
129
  }
86
130
  main().catch((err) => {
@@ -1 +1 @@
1
- {"version":3,"file":"sigil-mcp.js","sourceRoot":"","sources":["../../../src/bin/sigil-mcp.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D;;;;;;;;;;;;;;;;;GAiBG;AACH,KAAK,UAAU,IAAI;IACjB,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACxD,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3D,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI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
3
  export { type PortalAddOpts, type PortalInfo, type PortalRemoveResult, portalAdd, portalListFromDisk, portalRemove, } from './portal.js';
4
- export { type StatusReport, status } from './status.js';
5
- export { type UnlockOpts, type LockOpts, type UnlockResult, formatResult, lock, unlock, } from './unlock.js';
4
+ export { type StatusReport, type SessionStatus, status } from './status.js';
5
+ export { type UnlockOpts, type LockOpts, formatResult, lock, unlock, } from './unlock.js';
6
6
  export { type RunCliOpts, type CliExit, runCli } from './main.js';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,SAAS,EACT,kBAAkB,EAClB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,YAAY,EACZ,IAAI,EACJ,MAAM,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,SAAS,EACT,kBAAkB,EAClB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EACL,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,YAAY,EACZ,IAAI,EACJ,MAAM,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAIL,SAAS,EACT,kBAAkB,EAClB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAqB,MAAM,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAIL,YAAY,EACZ,IAAI,EACJ,MAAM,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAiC,MAAM,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAIL,SAAS,EACT,kBAAkB,EAClB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAyC,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAGL,YAAY,EACZ,IAAI,EACJ,MAAM,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAiC,MAAM,EAAE,MAAM,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/cli/main.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AAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAuN/D"}
@@ -5,7 +5,8 @@ import { installInto } from '../hooks/install.js';
5
5
  import { parsePolicy } from '../policy/index.js';
6
6
  import { ArgsError, parseSubcommand } from './args.js';
7
7
  import { resolvePaths } from './paths.js';
8
- import { policyInit, portalAdd, portalListFromDisk, portalNew, portalRemove } from './portal.js';
8
+ import { encode as encodeQr, renderTerminal } from '../qr/index.js';
9
+ import { policyInit, portalAdd, portalAddress, portalListFromDisk, portalNew, portalRemove } from './portal.js';
9
10
  import { status } from './status.js';
10
11
  import { formatResult, lock, unlock } from './unlock.js';
11
12
  const USAGE = `sigil — local signing control for Claude Code
@@ -16,6 +17,7 @@ Usage:
16
17
  sigil portal new <handle> [--strict]
17
18
  sigil portal add <handle> --key-file <path> [--no-remove-source] [--strict]
18
19
  sigil portal list
20
+ sigil portal qr <handle>
19
21
  sigil portal remove <handle>
20
22
  sigil policy show <handle>
21
23
  sigil policy init <handle> [--strict]
@@ -29,8 +31,9 @@ the MCP server in ~/.claude.json (with --user) or <root>/.mcp.json
29
31
  to get a locked-down template you fill in before any sign succeeds.
30
32
  "sigil policy init" provisions a policy file for an existing portal
31
33
  whose policy is missing (e.g. keyfile from an older sigil version).
32
- "sigil unlock" prompts for the passphrase and pushes it to the running
33
- sigil-mcp process (spawned by Claude Code) over the control socket.
34
+ "sigil unlock" prompts for the passphrase and pushes it to every running
35
+ sigil-mcp session (one per Claude Code window) over their control sockets,
36
+ so a single unlock covers all open windows.
34
37
  Set SIGIL_HOME to override ~/.sigil.
35
38
  `;
36
39
  /**
@@ -72,8 +75,8 @@ export async function runCli(opts) {
72
75
  if (head === 'unlock') {
73
76
  const passphrase = await askPassphrase();
74
77
  try {
75
- const result = await unlock({ paths, passphrase });
76
- const { message, code } = formatResult('unlock', result);
78
+ const sessions = await unlock({ paths, passphrase });
79
+ const { message, code } = formatResult('unlock', sessions);
77
80
  (code === 0 ? out : err).write(message + '\n');
78
81
  return { code };
79
82
  }
@@ -82,8 +85,8 @@ export async function runCli(opts) {
82
85
  }
83
86
  }
84
87
  if (head === 'lock') {
85
- const result = await lock({ paths });
86
- const { message, code } = formatResult('lock', result);
88
+ const sessions = await lock({ paths });
89
+ const { message, code } = formatResult('lock', sessions);
87
90
  (code === 0 ? out : err).write(message + '\n');
88
91
  return { code };
89
92
  }
@@ -102,6 +105,7 @@ export async function runCli(opts) {
102
105
  },
103
106
  },
104
107
  list: { options: {} },
108
+ qr: { options: {} },
105
109
  remove: { options: {} },
106
110
  });
107
111
  if (sub.command === 'new') {
@@ -166,8 +170,9 @@ export async function runCli(opts) {
166
170
  out.write('(no portals)\n');
167
171
  }
168
172
  else {
169
- for (const p of portals)
170
- out.write(`${p.handle}\t${p.address}\n`);
173
+ for (const p of portals) {
174
+ out.write(`${p.handle}\n evm: ${p.address}\n svm: ${p.svmAddress}\n`);
175
+ }
171
176
  }
172
177
  }
173
178
  finally {
@@ -175,6 +180,27 @@ export async function runCli(opts) {
175
180
  }
176
181
  return { code: 0 };
177
182
  }
183
+ if (sub.command === 'qr') {
184
+ const handle = sub.positionals[0];
185
+ if (!handle)
186
+ throw new ArgsError('portal qr: missing handle');
187
+ const passphrase = await askPassphrase();
188
+ let address;
189
+ try {
190
+ address = portalAddress(paths, handle, passphrase);
191
+ }
192
+ finally {
193
+ passphrase.fill(0);
194
+ }
195
+ // Byte mode preserves the address as-is. The earlier alphanumeric
196
+ // encoding uppercased everything, which broke wallets that validate
197
+ // EIP-55 (those reject "0X..." and all-uppercase as invalid).
198
+ const matrix = encodeQr(address);
199
+ out.write(`${handle} — ${address}\n\n`);
200
+ out.write(renderTerminal(matrix));
201
+ out.write(`\n${handle} — ${address}\n`);
202
+ return { code: 0 };
203
+ }
178
204
  if (sub.command === 'remove') {
179
205
  const handle = sub.positionals[0];
180
206
  if (!handle)
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/cli/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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BACT,GAAG,CAAC,KAAK,CAAC,WAAY,CAAW,CAAC,OAAO,IAAI,CAAC,CAAC;oBAC/C,GAAG,CAAC,KAAK,CAAC,YAAY,UAAU,0DAA0D,CAAC,CAAC;oBAC5F,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;gBACrB,CAAC;gBACD,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAClB,GAAG,CAAC,KAAK,CAAC,KAAK,UAAU,IAAI,CAAC,CAAC;gBAC/B,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;YACrB,CAAC;QACH,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,uBAAuB,IAAI,GAAG,CAAC,CAAC;IACtD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,SAAS,EAAE,CAAC;YAC3B,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC;YACnC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;YACxB,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QACrB,CAAC;QACD,GAAG,CAAC,KAAK,CAAC,UAAW,CAAW,CAAC,OAAO,IAAI,CAAC,CAAC;QAC9C,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
@@ -2,17 +2,27 @@
2
2
  * Resolves the locations sigil cares about, honouring SIGIL_HOME env override.
3
3
  * One source of truth used by the CLI, daemon entrypoint, and tests.
4
4
  *
5
- * The control socket is where the running sigil-mcp listens for unlock/lock/
6
- * status commands from the `sigil` CLI. It lives inside ~/.sigil so it
7
- * inherits the 0o700 directory permission; the socket file itself is also
8
- * chmod'd to 0o600 by the server on bind.
5
+ * The control directory holds one `<pid>.sock` per running sigil-mcp. Each
6
+ * Claude Code session spawns its own sigil-mcp, which binds a socket named for
7
+ * its PID; the `sigil` CLI fans `unlock`/`lock`/`status` out across every
8
+ * socket in the directory (reaping any that are stale). The directory lives
9
+ * inside ~/.sigil so it inherits the 0o700 permission; each socket file is
10
+ * also chmod'd to 0o600 by the server on bind.
9
11
  */
10
12
  export interface SigilPaths {
11
13
  readonly home: string;
12
14
  readonly keysDir: string;
13
15
  readonly policyDir: string;
14
- readonly controlSocket: string;
16
+ readonly controlDir: string;
15
17
  readonly auditLog: string;
18
+ readonly configFile: string;
16
19
  }
17
20
  export declare function resolvePaths(env?: NodeJS.ProcessEnv): SigilPaths;
21
+ /**
22
+ * The control socket path for a single sigil-mcp instance, named for its PID.
23
+ * Unique per live process, so two sessions never contend for the same path
24
+ * (a same-PID collision only happens after PID reuse, which the server's
25
+ * stale-socket recovery handles on bind).
26
+ */
27
+ export declare function sessionSocketPath(controlDir: string, pid: number): string;
18
28
  //# sourceMappingURL=paths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/cli/paths.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,UAAU,CAS7E"}
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/cli/paths.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,UAAU,CAU7E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzE"}