@sanctuary-framework/mcp-server 0.5.11 → 0.5.12

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/dist/index.cjs CHANGED
@@ -1278,9 +1278,13 @@ var IdentityManager = class {
1278
1278
  get encryptionKey() {
1279
1279
  return derivePurposeKey(this.masterKey, "identity-encryption");
1280
1280
  }
1281
- /** Load identities from storage on startup */
1281
+ /** Load identities from storage on startup.
1282
+ * Returns { total: number of encrypted files found, loaded: number successfully decrypted }.
1283
+ * A mismatch (total > 0, loaded === 0) indicates a wrong master key / missing passphrase.
1284
+ */
1282
1285
  async load() {
1283
1286
  const entries = await this.storage.list("_identities");
1287
+ let failed = 0;
1284
1288
  for (const entry of entries) {
1285
1289
  const raw = await this.storage.read("_identities", entry.key);
1286
1290
  if (!raw) continue;
@@ -1293,8 +1297,10 @@ var IdentityManager = class {
1293
1297
  this.primaryIdentityId = identity.identity_id;
1294
1298
  }
1295
1299
  } catch {
1300
+ failed++;
1296
1301
  }
1297
1302
  }
1303
+ return { total: entries.length, loaded: this.identities.size, failed };
1298
1304
  }
1299
1305
  /** Save an identity to storage */
1300
1306
  async save(identity) {
@@ -12866,7 +12872,29 @@ async function createSanctuaryServer(options) {
12866
12872
  keyProtection,
12867
12873
  auditLog
12868
12874
  );
12869
- await identityManager.load();
12875
+ const loadResult = await identityManager.load();
12876
+ if (loadResult.total > 0 && loadResult.loaded === 0) {
12877
+ console.error(
12878
+ `
12879
+ \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
12880
+ \u2551 \u26A0 WARNING: Encrypted identities found but NONE loaded \u2551
12881
+ \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
12882
+ \u2551 ${loadResult.total} encrypted identity file(s) found on disk \u2551
12883
+ \u2551 0 could be decrypted with the current master key \u2551
12884
+ \u2551 \u2551
12885
+ \u2551 This usually means SANCTUARY_PASSPHRASE is missing or \u2551
12886
+ \u2551 incorrect. The server will start but with NO identity data. \u2551
12887
+ \u2551 \u2551
12888
+ \u2551 To fix: set SANCTUARY_PASSPHRASE to the passphrase used \u2551
12889
+ \u2551 when this Sanctuary instance was first configured. \u2551
12890
+ \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
12891
+ `
12892
+ );
12893
+ } else if (loadResult.failed > 0) {
12894
+ console.error(
12895
+ `Warning: ${loadResult.failed} of ${loadResult.total} identity files could not be decrypted (possibly corrupted).`
12896
+ );
12897
+ }
12870
12898
  const l2Tools = [
12871
12899
  {
12872
12900
  name: "sanctuary/exec_attest",