sigild 0.0.8 → 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.
- package/README.md +74 -22
- package/THREAT_MODEL.md +6 -4
- package/dist/src/bin/sigil-mcp.js +59 -16
- package/dist/src/bin/sigil-mcp.js.map +1 -1
- package/dist/src/cli/index.d.ts +2 -2
- package/dist/src/cli/index.d.ts.map +1 -1
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/main.d.ts.map +1 -1
- package/dist/src/cli/main.js +10 -8
- package/dist/src/cli/main.js.map +1 -1
- package/dist/src/cli/paths.d.ts +15 -5
- package/dist/src/cli/paths.d.ts.map +1 -1
- package/dist/src/cli/paths.js +11 -1
- package/dist/src/cli/paths.js.map +1 -1
- package/dist/src/cli/portal.d.ts +3 -0
- package/dist/src/cli/portal.d.ts.map +1 -1
- package/dist/src/cli/portal.js +7 -1
- package/dist/src/cli/portal.js.map +1 -1
- package/dist/src/cli/status.d.ts +15 -12
- package/dist/src/cli/status.d.ts.map +1 -1
- package/dist/src/cli/status.js +17 -30
- package/dist/src/cli/status.js.map +1 -1
- package/dist/src/cli/unlock.d.ts +15 -15
- package/dist/src/cli/unlock.d.ts.map +1 -1
- package/dist/src/cli/unlock.js +83 -60
- package/dist/src/cli/unlock.js.map +1 -1
- package/dist/src/confirm/ack-server.d.ts +53 -0
- package/dist/src/confirm/ack-server.d.ts.map +1 -0
- package/dist/src/confirm/ack-server.js +87 -0
- package/dist/src/confirm/ack-server.js.map +1 -0
- package/dist/src/confirm/config.d.ts +54 -0
- package/dist/src/confirm/config.d.ts.map +1 -0
- package/dist/src/confirm/config.js +139 -0
- package/dist/src/confirm/config.js.map +1 -0
- package/dist/src/confirm/gate.d.ts +38 -0
- package/dist/src/confirm/gate.d.ts.map +1 -0
- package/dist/src/confirm/gate.js +66 -0
- package/dist/src/confirm/gate.js.map +1 -0
- package/dist/src/confirm/index.d.ts +6 -0
- package/dist/src/confirm/index.d.ts.map +1 -0
- package/dist/src/confirm/index.js +5 -0
- package/dist/src/confirm/index.js.map +1 -0
- package/dist/src/confirm/ntfy.d.ts +38 -0
- package/dist/src/confirm/ntfy.d.ts.map +1 -0
- package/dist/src/confirm/ntfy.js +47 -0
- package/dist/src/confirm/ntfy.js.map +1 -0
- package/dist/src/confirm/types.d.ts +66 -0
- package/dist/src/confirm/types.d.ts.map +1 -0
- package/dist/src/confirm/types.js +12 -0
- package/dist/src/confirm/types.js.map +1 -0
- package/dist/src/control/broadcast.d.ts +29 -0
- package/dist/src/control/broadcast.d.ts.map +1 -0
- package/dist/src/control/broadcast.js +88 -0
- package/dist/src/control/broadcast.js.map +1 -0
- package/dist/src/control/client.d.ts.map +1 -1
- package/dist/src/control/client.js +4 -1
- package/dist/src/control/client.js.map +1 -1
- package/dist/src/control/index.d.ts +1 -0
- package/dist/src/control/index.d.ts.map +1 -1
- package/dist/src/control/index.js +1 -0
- package/dist/src/control/index.js.map +1 -1
- package/dist/src/control/protocol.d.ts +5 -1
- package/dist/src/control/protocol.d.ts.map +1 -1
- package/dist/src/control/protocol.js +2 -1
- package/dist/src/control/protocol.js.map +1 -1
- package/dist/src/control/server.js +6 -6
- package/dist/src/control/server.js.map +1 -1
- package/dist/src/daemon/handles.d.ts +3 -0
- package/dist/src/daemon/handles.d.ts.map +1 -1
- package/dist/src/daemon/handles.js +3 -1
- package/dist/src/daemon/handles.js.map +1 -1
- package/dist/src/daemon/methods.d.ts +13 -3
- package/dist/src/daemon/methods.d.ts.map +1 -1
- package/dist/src/daemon/methods.js +121 -16
- package/dist/src/daemon/methods.js.map +1 -1
- package/dist/src/mcp/server.d.ts +14 -2
- package/dist/src/mcp/server.d.ts.map +1 -1
- package/dist/src/mcp/server.js +28 -14
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/mcp/tools.d.ts +1 -1
- package/dist/src/mcp/tools.d.ts.map +1 -1
- package/dist/src/mcp/tools.js +37 -3
- package/dist/src/mcp/tools.js.map +1 -1
- package/dist/src/policy/evaluate.d.ts +10 -4
- package/dist/src/policy/evaluate.d.ts.map +1 -1
- package/dist/src/policy/evaluate.js +161 -20
- package/dist/src/policy/evaluate.js.map +1 -1
- package/dist/src/policy/loader.d.ts.map +1 -1
- package/dist/src/policy/loader.js +70 -0
- package/dist/src/policy/loader.js.map +1 -1
- package/dist/src/policy/template.d.ts +1 -1
- package/dist/src/policy/template.d.ts.map +1 -1
- package/dist/src/policy/template.js +30 -0
- package/dist/src/policy/template.js.map +1 -1
- package/dist/src/policy/types.d.ts +53 -3
- package/dist/src/policy/types.d.ts.map +1 -1
- package/dist/src/policy/types.js.map +1 -1
- package/dist/src/svm/address.d.ts +14 -0
- package/dist/src/svm/address.d.ts.map +1 -0
- package/dist/src/svm/address.js +18 -0
- package/dist/src/svm/address.js.map +1 -0
- package/dist/src/svm/base58.d.ts +15 -0
- package/dist/src/svm/base58.d.ts.map +1 -0
- package/dist/src/svm/base58.js +60 -0
- package/dist/src/svm/base58.js.map +1 -0
- package/dist/src/svm/ed25519.d.ts +19 -0
- package/dist/src/svm/ed25519.d.ts.map +1 -0
- package/dist/src/svm/ed25519.js +32 -0
- package/dist/src/svm/ed25519.js.map +1 -0
- package/dist/src/svm/index.d.ts +5 -0
- package/dist/src/svm/index.d.ts.map +1 -0
- package/dist/src/svm/index.js +5 -0
- package/dist/src/svm/index.js.map +1 -0
- package/dist/src/svm/transaction.d.ts +56 -0
- package/dist/src/svm/transaction.d.ts.map +1 -0
- package/dist/src/svm/transaction.js +182 -0
- package/dist/src/svm/transaction.js.map +1 -0
- package/package.json +2 -1
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,
|
|
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,
|
|
11
|
+
One MCP server process, four bins, six runtime deps (all pinned, zero transitive):
|
|
12
12
|
|
|
13
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
|
|
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
|
|
|
@@ -57,11 +57,11 @@ sigil portal add evm: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
|
|
60
|
+
# 4. In a separate terminal, push the passphrase to every running sigil-mcp.
|
|
61
61
|
sigil unlock
|
|
62
|
-
# → prompts
|
|
62
|
+
# → prompts once, decrypts every keyfile in ~/.sigil/keys/ into each open window
|
|
63
63
|
|
|
64
|
-
# 5. Use Claude Code. The
|
|
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
|
|
121
|
-
|
|
122
|
-
of
|
|
123
|
-
|
|
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.
|
|
127
|
-
with sigil unlock — sigil-mcp
|
|
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
|
|
131
|
-
|
|
132
|
-
|
|
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 `
|
|
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
|
|
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,21 +163,68 @@ 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
|
|
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
|
-
- **
|
|
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
|
|
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)
|
|
176
228
|
- [`@iarna/toml`](https://github.com/iarna/iarna-toml) for parsing per-portal policy TOML files
|
|
177
229
|
- [`qrcode-generator`](https://github.com/kazuhikoarase/qrcode-generator) for `sigil portal qr` rendering
|
|
178
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.
|
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
|
|
29
|
-
2. The user runs `sigil unlock` in a separate terminal; the CLI prompts for the passphrase, connects to
|
|
30
|
-
3. `sigil-mcp` decrypts every keyfile in `~/.sigil/keys/`, populates
|
|
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:**
|
|
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
|
|
@@ -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
|
|
15
|
-
* log, constructs an EMPTY (locked) HandleTable, binds
|
|
16
|
-
* socket at ~/.sigil/control
|
|
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,7 +71,7 @@ async function main() {
|
|
|
36
71
|
let control = null;
|
|
37
72
|
try {
|
|
38
73
|
control = await startControlServer({
|
|
39
|
-
socketPath
|
|
74
|
+
socketPath,
|
|
40
75
|
keysDir: paths.keysDir,
|
|
41
76
|
policyDir: paths.policyDir,
|
|
42
77
|
handles,
|
|
@@ -44,20 +79,18 @@ async function main() {
|
|
|
44
79
|
});
|
|
45
80
|
}
|
|
46
81
|
catch (err) {
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
process.stderr.write(`sigil-mcp: control socket unavailable (${err.message}). ` +
|
|
52
|
-
`This session will stay locked; sign calls will return DAEMON_LOCKED
|
|
53
|
-
`Run "sigil unlock" against the primary sigil-mcp from your first ` +
|
|
54
|
-
`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`);
|
|
55
88
|
}
|
|
56
89
|
if (control) {
|
|
57
90
|
process.stderr.write(`sigil-mcp: ready (locked; run "sigil unlock" to load keys from ${paths.keysDir})\n`);
|
|
58
91
|
}
|
|
59
92
|
else {
|
|
60
|
-
process.stderr.write(`sigil-mcp: ready (
|
|
93
|
+
process.stderr.write(`sigil-mcp: ready (locked — no control socket; cannot be unlocked)\n`);
|
|
61
94
|
}
|
|
62
95
|
const shutdown = () => {
|
|
63
96
|
handles.dispose();
|
|
@@ -66,12 +99,20 @@ async function main() {
|
|
|
66
99
|
controlClosed = true;
|
|
67
100
|
control.close().catch(() => { });
|
|
68
101
|
}
|
|
102
|
+
if (ackServer) {
|
|
103
|
+
ackServer.close().catch(() => { });
|
|
104
|
+
}
|
|
69
105
|
};
|
|
70
106
|
process.on('exit', shutdown);
|
|
71
107
|
process.on('SIGINT', () => process.exit(0));
|
|
72
108
|
process.on('SIGTERM', () => process.exit(0));
|
|
73
109
|
await runMcpStdio({
|
|
74
|
-
context: {
|
|
110
|
+
context: {
|
|
111
|
+
handles,
|
|
112
|
+
audit,
|
|
113
|
+
policy,
|
|
114
|
+
...(confirmGate ? { confirm: confirmGate } : {}),
|
|
115
|
+
},
|
|
75
116
|
stdin: process.stdin,
|
|
76
117
|
stdout: process.stdout,
|
|
77
118
|
onLog: (e) => process.stderr.write(JSON.stringify(e) + '\n'),
|
|
@@ -82,6 +123,8 @@ async function main() {
|
|
|
82
123
|
controlClosed = true;
|
|
83
124
|
await control.close();
|
|
84
125
|
}
|
|
126
|
+
if (ackServer)
|
|
127
|
+
await ackServer.close();
|
|
85
128
|
process.exit(0);
|
|
86
129
|
}
|
|
87
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;
|
|
1
|
+
{"version":3,"file":"sigil-mcp.js","sourceRoot":"","sources":["../../../src/bin/sigil-mcp.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,WAAW,EACX,+BAA+B,EAC/B,UAAU,EACV,aAAa,EACb,cAAc,GAGf,MAAM,qBAAqB,CAAC;AAC7B,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;;;;;;;;;;;;;;;;;;;;;GAqBG;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,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7D,SAAS,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,C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;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/src/cli/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { type SigilPaths, resolvePaths } from './paths.js';
|
|
2
2
|
export { ArgsError, parseSubcommand } from './args.js';
|
|
3
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,
|
|
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;
|
|
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,
|
|
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.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/cli/main.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAsCpD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAC5C,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAC/B,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAuN/D"}
|
package/dist/src/cli/main.js
CHANGED
|
@@ -31,8 +31,9 @@ the MCP server in ~/.claude.json (with --user) or <root>/.mcp.json
|
|
|
31
31
|
to get a locked-down template you fill in before any sign succeeds.
|
|
32
32
|
"sigil policy init" provisions a policy file for an existing portal
|
|
33
33
|
whose policy is missing (e.g. keyfile from an older sigil version).
|
|
34
|
-
"sigil unlock" prompts for the passphrase and pushes it to
|
|
35
|
-
sigil-mcp
|
|
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.
|
|
36
37
|
Set SIGIL_HOME to override ~/.sigil.
|
|
37
38
|
`;
|
|
38
39
|
/**
|
|
@@ -74,8 +75,8 @@ export async function runCli(opts) {
|
|
|
74
75
|
if (head === 'unlock') {
|
|
75
76
|
const passphrase = await askPassphrase();
|
|
76
77
|
try {
|
|
77
|
-
const
|
|
78
|
-
const { message, code } = formatResult('unlock',
|
|
78
|
+
const sessions = await unlock({ paths, passphrase });
|
|
79
|
+
const { message, code } = formatResult('unlock', sessions);
|
|
79
80
|
(code === 0 ? out : err).write(message + '\n');
|
|
80
81
|
return { code };
|
|
81
82
|
}
|
|
@@ -84,8 +85,8 @@ export async function runCli(opts) {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
if (head === 'lock') {
|
|
87
|
-
const
|
|
88
|
-
const { message, code } = formatResult('lock',
|
|
88
|
+
const sessions = await lock({ paths });
|
|
89
|
+
const { message, code } = formatResult('lock', sessions);
|
|
89
90
|
(code === 0 ? out : err).write(message + '\n');
|
|
90
91
|
return { code };
|
|
91
92
|
}
|
|
@@ -169,8 +170,9 @@ export async function runCli(opts) {
|
|
|
169
170
|
out.write('(no portals)\n');
|
|
170
171
|
}
|
|
171
172
|
else {
|
|
172
|
-
for (const p of portals)
|
|
173
|
-
out.write(`${p.handle}\
|
|
173
|
+
for (const p of portals) {
|
|
174
|
+
out.write(`${p.handle}\n evm: ${p.address}\n svm: ${p.svmAddress}\n`);
|
|
175
|
+
}
|
|
174
176
|
}
|
|
175
177
|
}
|
|
176
178
|
finally {
|
package/dist/src/cli/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/cli/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAkB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,M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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"}
|
package/dist/src/cli/paths.d.ts
CHANGED
|
@@ -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
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
|
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
|
|
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"}
|
package/dist/src/cli/paths.js
CHANGED
|
@@ -6,8 +6,18 @@ export function resolvePaths(env = process.env) {
|
|
|
6
6
|
home,
|
|
7
7
|
keysDir: join(home, 'keys'),
|
|
8
8
|
policyDir: join(home, 'policy'),
|
|
9
|
-
|
|
9
|
+
controlDir: env['SIGIL_CONTROL_DIR'] ?? join(home, 'control'),
|
|
10
10
|
auditLog: join(home, 'audit.log'),
|
|
11
|
+
configFile: join(home, 'config.toml'),
|
|
11
12
|
};
|
|
12
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* The control socket path for a single sigil-mcp instance, named for its PID.
|
|
16
|
+
* Unique per live process, so two sessions never contend for the same path
|
|
17
|
+
* (a same-PID collision only happens after PID reuse, which the server's
|
|
18
|
+
* stale-socket recovery handles on bind).
|
|
19
|
+
*/
|
|
20
|
+
export function sessionSocketPath(controlDir, pid) {
|
|
21
|
+
return join(controlDir, `${pid}.sock`);
|
|
22
|
+
}
|
|
13
23
|
//# sourceMappingURL=paths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/cli/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/cli/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAsBjC,MAAM,UAAU,YAAY,CAAC,MAAyB,OAAO,CAAC,GAAG;IAC/D,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC5D,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;QAC3B,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;QAC/B,UAAU,EAAE,GAAG,CAAC,mBAAmB,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;QAC7D,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC;QACjC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC;KACtC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAkB,EAAE,GAAW;IAC/D,OAAO,IAAI,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/src/cli/portal.d.ts
CHANGED
|
@@ -61,7 +61,10 @@ export declare function portalNew(paths: SigilPaths, opts: PortalNewOpts): {
|
|
|
61
61
|
export interface PortalInfo {
|
|
62
62
|
handle: string;
|
|
63
63
|
kind: 'evm';
|
|
64
|
+
/** EVM address (secp256k1). */
|
|
64
65
|
address: string;
|
|
66
|
+
/** Solana address (ed25519) derived from the same secret. */
|
|
67
|
+
svmAddress: string;
|
|
65
68
|
}
|
|
66
69
|
/**
|
|
67
70
|
* Lists portals by reading the keys directory and decrypting each keyfile
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/cli/portal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAW,YAAY,EAAa,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/cli/portal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAW,YAAY,EAAa,MAAM,oBAAoB,CAAC;AAItF,OAAO,EAAE,KAAK,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC5B,MAAM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Aa3F;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,GACf;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAa1C;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,kBAAkB,CAalF;AAqBD,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/src/cli/portal.js
CHANGED
|
@@ -2,6 +2,7 @@ import { existsSync, mkdirSync, readdirSync, readFileSync, unlinkSync, writeFile
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { sealKey, SecretBuffer, unsealKey } from '../crypto/index.js';
|
|
4
4
|
import { addressFromPrivateKey, randomSecretKey } from '../eth/index.js';
|
|
5
|
+
import { svmAddressFromSecret } from '../svm/index.js';
|
|
5
6
|
import { HandleTable } from '../daemon/handles.js';
|
|
6
7
|
import { policyTemplate } from '../policy/index.js';
|
|
7
8
|
/**
|
|
@@ -93,7 +94,12 @@ export function portalListFromDisk(paths, passphrase) {
|
|
|
93
94
|
const blob = readFileSync(join(paths.keysDir, filename));
|
|
94
95
|
const sb = unsealKey(blob, passphrase);
|
|
95
96
|
try {
|
|
96
|
-
out.push({
|
|
97
|
+
out.push({
|
|
98
|
+
handle,
|
|
99
|
+
kind: 'evm',
|
|
100
|
+
address: addressFromPrivateKey(sb.bytes()),
|
|
101
|
+
svmAddress: svmAddressFromSecret(sb.bytes()),
|
|
102
|
+
});
|
|
97
103
|
}
|
|
98
104
|
finally {
|
|
99
105
|
sb.dispose();
|