@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/cli.cjs +55 -5
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +55 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +30 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +30 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2083,8 +2083,15 @@ declare class IdentityManager {
|
|
|
2083
2083
|
private primaryIdentityId;
|
|
2084
2084
|
constructor(storage: StorageBackend, masterKey: Uint8Array);
|
|
2085
2085
|
private get encryptionKey();
|
|
2086
|
-
/** Load identities from storage on startup
|
|
2087
|
-
|
|
2086
|
+
/** Load identities from storage on startup.
|
|
2087
|
+
* Returns { total: number of encrypted files found, loaded: number successfully decrypted }.
|
|
2088
|
+
* A mismatch (total > 0, loaded === 0) indicates a wrong master key / missing passphrase.
|
|
2089
|
+
*/
|
|
2090
|
+
load(): Promise<{
|
|
2091
|
+
total: number;
|
|
2092
|
+
loaded: number;
|
|
2093
|
+
failed: number;
|
|
2094
|
+
}>;
|
|
2088
2095
|
/** Save an identity to storage */
|
|
2089
2096
|
save(identity: StoredIdentity): Promise<void>;
|
|
2090
2097
|
get(id: string): StoredIdentity | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -2083,8 +2083,15 @@ declare class IdentityManager {
|
|
|
2083
2083
|
private primaryIdentityId;
|
|
2084
2084
|
constructor(storage: StorageBackend, masterKey: Uint8Array);
|
|
2085
2085
|
private get encryptionKey();
|
|
2086
|
-
/** Load identities from storage on startup
|
|
2087
|
-
|
|
2086
|
+
/** Load identities from storage on startup.
|
|
2087
|
+
* Returns { total: number of encrypted files found, loaded: number successfully decrypted }.
|
|
2088
|
+
* A mismatch (total > 0, loaded === 0) indicates a wrong master key / missing passphrase.
|
|
2089
|
+
*/
|
|
2090
|
+
load(): Promise<{
|
|
2091
|
+
total: number;
|
|
2092
|
+
loaded: number;
|
|
2093
|
+
failed: number;
|
|
2094
|
+
}>;
|
|
2088
2095
|
/** Save an identity to storage */
|
|
2089
2096
|
save(identity: StoredIdentity): Promise<void>;
|
|
2090
2097
|
get(id: string): StoredIdentity | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1275,9 +1275,13 @@ var IdentityManager = class {
|
|
|
1275
1275
|
get encryptionKey() {
|
|
1276
1276
|
return derivePurposeKey(this.masterKey, "identity-encryption");
|
|
1277
1277
|
}
|
|
1278
|
-
/** Load identities from storage on startup
|
|
1278
|
+
/** Load identities from storage on startup.
|
|
1279
|
+
* Returns { total: number of encrypted files found, loaded: number successfully decrypted }.
|
|
1280
|
+
* A mismatch (total > 0, loaded === 0) indicates a wrong master key / missing passphrase.
|
|
1281
|
+
*/
|
|
1279
1282
|
async load() {
|
|
1280
1283
|
const entries = await this.storage.list("_identities");
|
|
1284
|
+
let failed = 0;
|
|
1281
1285
|
for (const entry of entries) {
|
|
1282
1286
|
const raw = await this.storage.read("_identities", entry.key);
|
|
1283
1287
|
if (!raw) continue;
|
|
@@ -1290,8 +1294,10 @@ var IdentityManager = class {
|
|
|
1290
1294
|
this.primaryIdentityId = identity.identity_id;
|
|
1291
1295
|
}
|
|
1292
1296
|
} catch {
|
|
1297
|
+
failed++;
|
|
1293
1298
|
}
|
|
1294
1299
|
}
|
|
1300
|
+
return { total: entries.length, loaded: this.identities.size, failed };
|
|
1295
1301
|
}
|
|
1296
1302
|
/** Save an identity to storage */
|
|
1297
1303
|
async save(identity) {
|
|
@@ -12863,7 +12869,29 @@ async function createSanctuaryServer(options) {
|
|
|
12863
12869
|
keyProtection,
|
|
12864
12870
|
auditLog
|
|
12865
12871
|
);
|
|
12866
|
-
await identityManager.load();
|
|
12872
|
+
const loadResult = await identityManager.load();
|
|
12873
|
+
if (loadResult.total > 0 && loadResult.loaded === 0) {
|
|
12874
|
+
console.error(
|
|
12875
|
+
`
|
|
12876
|
+
\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
|
|
12877
|
+
\u2551 \u26A0 WARNING: Encrypted identities found but NONE loaded \u2551
|
|
12878
|
+
\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
|
|
12879
|
+
\u2551 ${loadResult.total} encrypted identity file(s) found on disk \u2551
|
|
12880
|
+
\u2551 0 could be decrypted with the current master key \u2551
|
|
12881
|
+
\u2551 \u2551
|
|
12882
|
+
\u2551 This usually means SANCTUARY_PASSPHRASE is missing or \u2551
|
|
12883
|
+
\u2551 incorrect. The server will start but with NO identity data. \u2551
|
|
12884
|
+
\u2551 \u2551
|
|
12885
|
+
\u2551 To fix: set SANCTUARY_PASSPHRASE to the passphrase used \u2551
|
|
12886
|
+
\u2551 when this Sanctuary instance was first configured. \u2551
|
|
12887
|
+
\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
|
|
12888
|
+
`
|
|
12889
|
+
);
|
|
12890
|
+
} else if (loadResult.failed > 0) {
|
|
12891
|
+
console.error(
|
|
12892
|
+
`Warning: ${loadResult.failed} of ${loadResult.total} identity files could not be decrypted (possibly corrupted).`
|
|
12893
|
+
);
|
|
12894
|
+
}
|
|
12867
12895
|
const l2Tools = [
|
|
12868
12896
|
{
|
|
12869
12897
|
name: "sanctuary/exec_attest",
|