sigelo-mcp 0.1.7 → 0.1.8

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/contact.mjs CHANGED
@@ -70,6 +70,8 @@ const TOOLS = [
70
70
  // one, a syntax error) throws: a broken install must not pass for an absent one.
71
71
  export async function load({ installed, id, env = process.env, clock, debug = () => {} }) {
72
72
  const held = await import(installed ? 'sigelo-agent/dist/sigelo-agent-contact.js' : '../../adapters/moadim/sigelo-agent-contact.ts');
73
+ // The carrier signs through the identity's key provider, never with a key read here.
74
+ const keys = await import(installed ? 'sigelo-agent/dist/sigelo-agent-keys.js' : '../../adapters/moadim/sigelo-agent-keys.ts');
73
75
  let lib, kdf;
74
76
  try { ({ lib, kdf } = await held.contactLib()); } catch (e) {
75
77
  if (!held.absent(e)) throw e;
@@ -82,7 +84,7 @@ export async function load({ installed, id, env = process.env, clock, debug = ()
82
84
  const carrier = (path) => {
83
85
  if (!carriers.has(path)) {
84
86
  carriers.set(path, new lib.Carrier({
85
- identity: () => { const s = id.load(path); return { secret: id.secretOf(s), bundle: id.bundleOf(s) }; },
87
+ identity: () => { const s = id.load(path); return { sign: keys.signer(path, s, env).sign, bundle: id.bundleOf(s) }; },
86
88
  ...lib.pathsFor(path), ...options, ...(clock && { clock }),
87
89
  }));
88
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigelo-mcp",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "mcpName": "io.github.csigelo/sigelo",
5
5
  "description": "MCP server: portable, offline-verifiable identity for AI agents (DID, challenges, attestations, bundles), optional Monero wallet",
6
6
  "keywords": [
@@ -40,11 +40,11 @@
40
40
  "test": "node test.mjs",
41
41
  "prepack": "node ../../release/prepack.mjs pre",
42
42
  "postpack": "node ../../release/prepack.mjs post",
43
- "prepublishOnly": "node -e \"if(process.env.SIGELO_PUBLISH!=='1'){console.error('refusing: the npm account and names are an Owner decision (ROADMAP D1); publish the release/build.sh tarballs with SIGELO_PUBLISH=1');process.exit(1)}\""
43
+ "prepublishOnly": "node -e \"if(process.env.SIGELO_PUBLISH!=='1'){console.error('refusing: publishing is a release step (release/RELEASE.md); publish the release/build.sh tarballs with SIGELO_PUBLISH=1');process.exit(1)}\""
44
44
  },
45
45
  "dependencies": {
46
- "sigelo": "^0.1.7",
47
- "sigelo-agent": "^0.1.7",
48
- "sigelo-spend": "^0.1.7"
46
+ "sigelo": "^0.1.8",
47
+ "sigelo-agent": "^0.1.8",
48
+ "sigelo-spend": "^0.1.8"
49
49
  }
50
50
  }
package/server.mjs CHANGED
@@ -17,6 +17,8 @@ const INSTALLED = fileURLToPath(import.meta.url).split(sep).includes('node_modul
17
17
  const lib = (pkg, repo) => import(INSTALLED ? pkg : repo);
18
18
  const { did, parse, parseBytes, verify, SigeloError } = await lib('sigelo', '../../ts/dist/sigelo.js');
19
19
  const id = await lib('sigelo-agent/dist/sigelo-agent.js', '../../adapters/moadim/sigelo-agent.ts');
20
+ // Every signature goes through the identity's key provider (design/key-providers.md): no handler reads a key.
21
+ const keys = await lib('sigelo-agent/dist/sigelo-agent-keys.js', '../../adapters/moadim/sigelo-agent-keys.ts');
20
22
  const { withLock } = await lib('sigelo-agent/dist/sigelo-agent-monero.js', '../../adapters/moadim/sigelo-agent-monero.ts');
21
23
  const { forgetIssuer } = await lib('sigelo-agent/dist/sigelo-agent-adopt.js', '../../adapters/moadim/sigelo-agent-adopt.ts');
22
24
 
@@ -26,7 +28,7 @@ console.log = console.info = console.debug = console.error;
26
28
 
27
29
  const MODERN = ['2026-07-28']; // per-request _meta era
28
30
  const LEGACY = ['2025-11-25', '2025-06-18', '2025-03-26', '2024-11-05']; // initialize era
29
- const SERVER_INFO = { name: 'sigelo', version: '0.1.7' };
31
+ const SERVER_INFO = { name: 'sigelo', version: '0.1.8' };
30
32
  const PV = 'io.modelcontextprotocol/protocolVersion';
31
33
  const env = process.env;
32
34
  const WALLET = Boolean(env.SIGELO_WALLET_URL && env.SIGELO_WALLET_TOKEN);
@@ -119,11 +121,11 @@ const HANDLERS = {
119
121
  sigelo_whoami: (_, path) => { const s = loadStore(path); return { did: did(id.head(s)), genesis: id.head(s), chain: id.chainOf(s), attestations: s.attestations.length, identity_file: path }; },
120
122
  sigelo_init: ({ recovery }, path) => {
121
123
  if (typeof recovery !== 'string' || !recovery) throw refusal('usage', 'recovery is required: a "z…" public key or "none"');
122
- const s = id.init(path, recovery === 'none' ? null : recovery);
124
+ const s = keys.init(path, recovery === 'none' ? null : recovery, env.SIGELO_KEY_PROVIDER);
123
125
  return { did: did(s.genesis), genesis: s.genesis, identity_file: path,
124
126
  ...(recovery === 'none' && { warning: 'NO recovery key: if this key is stolen the identity is lost permanently.' }) };
125
127
  },
126
- sigelo_sign_challenge: ({ challenge }, path) => id.signChallenge(loadStore(path), input(challenge, 'challenge')),
128
+ sigelo_sign_challenge: ({ challenge }, path) => keys.signChallenge(path, loadStore(path), input(challenge, 'challenge')),
127
129
  sigelo_add_issuer: ({ genesis }, path) => { const g = input(genesis, 'genesis'); loadStore(path); return update(path, (s) => { const store = id.addIssuer(s, g); return { store, result: { issuers: store.issuers.map(did) } }; }); },
128
130
  sigelo_add_attestation: ({ attestation, issuer }, path) => {
129
131
  const a = input(attestation, 'attestation'), g = issuer === undefined ? undefined : input(issuer, 'issuer');
@@ -139,7 +141,7 @@ const HANDLERS = {
139
141
  return { bundle, did: result.did, ...(notes.length && { notes }) };
140
142
  },
141
143
  sigelo_verify: ({ bundle, now }) => verify(input(bundle, 'bundle'), Number.isSafeInteger(now) ? now : nowS()),
142
- sigelo_rotate: (_, path) => { loadStore(path); const s = update(path, (st) => { const r = id.rotateKey(st, nowS()); return { store: r, result: r }; }); return { did: did(id.head(s)), chain: id.chainOf(s), next: 'ask each world to reissue its attestation to the new DID' }; },
144
+ sigelo_rotate: (_, path) => { loadStore(path); const s = update(path, (st) => { const r = keys.rotate(path, st, nowS()); return { store: r, result: r }; }); keys.commit(s); return { did: did(id.head(s)), chain: id.chainOf(s), next: 'ask each world to reissue its attestation to the new DID' }; },
143
145
  sigelo_wallet_balance: () => wallet(['balance']),
144
146
  sigelo_wallet_receive: ({ note }) => wallet(['receive', ...(note ? [String(note)] : [])]),
145
147
  sigelo_wallet_pay: ({ to, amount, purpose, ref }) => wallet(['pay', String(to ?? ''), String(amount ?? ''), String(purpose ?? ''), ...(ref ? ['--ref', String(ref)] : [])]),