@appsoftwareltd/etherpk-mcp 0.9.1 → 0.9.2
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/main.js +13 -13
- package/dist/main.js.map +1 -1
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -36,7 +36,7 @@ import { UndirectedGraph } from "graphology";
|
|
|
36
36
|
import louvain from "graphology-communities-louvain";
|
|
37
37
|
var package_default = {
|
|
38
38
|
name: "@appsoftwareltd/etherpk-mcp",
|
|
39
|
-
version: "0.9.
|
|
39
|
+
version: "0.9.2",
|
|
40
40
|
license: "Elastic-2.0",
|
|
41
41
|
description: "EtherPK Headless Client: an MCP server over a synced knowledge graph, run beside the agent on the user's own machine.",
|
|
42
42
|
type: "module",
|
|
@@ -1528,7 +1528,7 @@ function createGraphNamePublisher(deps) {
|
|
|
1528
1528
|
/** The account has no vault yet, so there is nothing for a Recovery Code to open. */
|
|
1529
1529
|
var NoVaultError = class extends Error {
|
|
1530
1530
|
constructor() {
|
|
1531
|
-
super("This account has no
|
|
1531
|
+
super("This account has no Encryption Keys yet, so there is nothing for a Recovery Code to open.");
|
|
1532
1532
|
this.name = "NoVaultError";
|
|
1533
1533
|
}
|
|
1534
1534
|
};
|
|
@@ -1544,7 +1544,7 @@ async function openVaultWithRecoveryCode(api, code) {
|
|
|
1544
1544
|
try {
|
|
1545
1545
|
return (await openVault(fromBase64Url(stored.vault), wrapKey)).vaultKey;
|
|
1546
1546
|
} catch (error) {
|
|
1547
|
-
if (error instanceof EnvelopeError) throw new RecoveryCodeError("That Recovery Code does not open this account’s
|
|
1547
|
+
if (error instanceof EnvelopeError) throw new RecoveryCodeError("That Recovery Code does not open this account’s Encryption Keys. Check it character by character - only the most recently issued code works.");
|
|
1548
1548
|
throw error;
|
|
1549
1549
|
}
|
|
1550
1550
|
}
|
|
@@ -2490,7 +2490,7 @@ async function connectAccount(config) {
|
|
|
2490
2490
|
*/
|
|
2491
2491
|
async function openAccountVault(api, vaultKey) {
|
|
2492
2492
|
const stored = await api.getVault();
|
|
2493
|
-
if (!stored) throw new Error("This account has no
|
|
2493
|
+
if (!stored) throw new Error("This account has no Encryption Keys yet. Open EtherPK, create or accept a synced graph, and save the Recovery Code first.");
|
|
2494
2494
|
return (await openVault(fromBase64Url(stored.vault), vaultKey)).vault;
|
|
2495
2495
|
}
|
|
2496
2496
|
/**
|
|
@@ -16457,7 +16457,7 @@ async function unlockByDeviceApproval(api, io) {
|
|
|
16457
16457
|
const where = io.clientUrl ? `open EtherPK at ${io.clientUrl}` : "open EtherPK in a browser";
|
|
16458
16458
|
io.say("");
|
|
16459
16459
|
io.say(`To approve this device, ${where} (any page - it need not be a note), connected to this account`);
|
|
16460
|
-
io.say("with its
|
|
16460
|
+
io.say("with its Encryption Keys unlocked. A prompt will appear there, and this terminal then shows a code to compare.");
|
|
16461
16461
|
io.say("");
|
|
16462
16462
|
io.say("Waiting (up to ten minutes)…");
|
|
16463
16463
|
const abandon = async () => {
|
|
@@ -22669,8 +22669,8 @@ var USAGE = `etherpk-mcp - EtherPK Headless Client (an MCP server over one synce
|
|
|
22669
22669
|
${CMD} login --sync-server <url> [--pat <token>] [--recovery-code]
|
|
22670
22670
|
Sign this machine in as a device of your account. Prompts for a Personal Access
|
|
22671
22671
|
Token (an account-wide one, from the Sync Server portal at <url>/account/tokens)
|
|
22672
|
-
unless --pat or ETHERPK_PAT is given, then unlocks your
|
|
22673
|
-
open EtherPK in a browser connected to the account with its
|
|
22672
|
+
unless --pat or ETHERPK_PAT is given, then unlocks your Encryption Keys by Device Approval:
|
|
22673
|
+
open EtherPK in a browser connected to the account with its Encryption Keys unlocked, approve
|
|
22674
22674
|
there if it shows the same code, then press y. Press r while waiting, or pass
|
|
22675
22675
|
--recovery-code, to type your Recovery Code instead (or ETHERPK_RECOVERY_CODE, for a
|
|
22676
22676
|
scripted setup).
|
|
@@ -22689,7 +22689,7 @@ var USAGE = `etherpk-mcp - EtherPK Headless Client (an MCP server over one synce
|
|
|
22689
22689
|
The folder must already be a graph (open it in EtherPK once) - its index is kept under
|
|
22690
22690
|
the cache directory, never in the folder.
|
|
22691
22691
|
${CMD} logout [--sync-server <url> | --all]
|
|
22692
|
-
Forget that server's token,
|
|
22692
|
+
Forget that server's token, Encryption Keys and cached graphs on this machine.
|
|
22693
22693
|
${CMD} semantic setup
|
|
22694
22694
|
Let the agent search by meaning. Installs a ~300 MB native runtime (onnxruntime-node,
|
|
22695
22695
|
with your npm) and downloads a 23 MB embedding model into the cache directory, once
|
|
@@ -22807,7 +22807,7 @@ async function login(args) {
|
|
|
22807
22807
|
vaultKey: toBase64Url(vaultKey)
|
|
22808
22808
|
};
|
|
22809
22809
|
await writeConfig(path, config);
|
|
22810
|
-
console.log(`Keys unlocked and cached in ${path} (owner-only). Anyone who can read your files on this machine can read this account, as with a signed-in browser.`);
|
|
22810
|
+
console.log(`Encryption Keys unlocked and cached in ${path} (owner-only). Anyone who can read your files on this machine can read this account, as with a signed-in browser.`);
|
|
22811
22811
|
const others = Object.keys(config.servers).filter((server) => server !== syncServer);
|
|
22812
22812
|
if (others.length > 0) console.log(`Also logged in to ${others.join(", ")} - commands now need --sync-server <url> to say which.`);
|
|
22813
22813
|
await listGraphs({
|
|
@@ -22924,12 +22924,12 @@ async function openVaultFor(account, login) {
|
|
|
22924
22924
|
try {
|
|
22925
22925
|
return await openAccountVault(account.api, fromBase64Url(login.vaultKey));
|
|
22926
22926
|
} catch (error) {
|
|
22927
|
-
if (error instanceof EnvelopeError) fail(`Your
|
|
22927
|
+
if (error instanceof EnvelopeError) fail(`Your Encryption Keys on ${login.syncServer} were replaced or reset on another device, so the key saved on this computer no longer opens them. Run: ${CMD} login --sync-server ${login.syncServer}`);
|
|
22928
22928
|
throw error;
|
|
22929
22929
|
}
|
|
22930
22930
|
}
|
|
22931
22931
|
async function listGraphs(login, several) {
|
|
22932
|
-
if (!login.vaultKey) fail(`Keys are not unlocked on this machine for ${login.syncServer}. Run: ${CMD} login --sync-server ${login.syncServer}`);
|
|
22932
|
+
if (!login.vaultKey) fail(`Encryption Keys are not unlocked on this machine for ${login.syncServer}. Run: ${CMD} login --sync-server ${login.syncServer}`);
|
|
22933
22933
|
const account = await connectAccount(login);
|
|
22934
22934
|
const vault = await openVaultFor(account, {
|
|
22935
22935
|
...login,
|
|
@@ -23099,7 +23099,7 @@ async function openFolderForServe(folder, args) {
|
|
|
23099
23099
|
}
|
|
23100
23100
|
async function openSyncedForServe(wanted, args) {
|
|
23101
23101
|
const login = requireServer(await loadConfig(defaultConfigPath()), args["sync-server"]);
|
|
23102
|
-
if (!login.vaultKey) fail(`Keys are not unlocked on this machine for ${login.syncServer}. Run: ${CMD} login --sync-server ${login.syncServer}`);
|
|
23102
|
+
if (!login.vaultKey) fail(`Encryption Keys are not unlocked on this machine for ${login.syncServer}. Run: ${CMD} login --sync-server ${login.syncServer}`);
|
|
23103
23103
|
const account = await connectAccount(login);
|
|
23104
23104
|
const vault = await openVaultFor(account, {
|
|
23105
23105
|
...login,
|
|
@@ -23229,7 +23229,7 @@ async function logout(args) {
|
|
|
23229
23229
|
});
|
|
23230
23230
|
await removeCacheRoot(process.env);
|
|
23231
23231
|
} else await writeConfig(path, config);
|
|
23232
|
-
console.log(`Forgot the token,
|
|
23232
|
+
console.log(`Forgot the token, Encryption Keys and cached graphs for ${login.syncServer}. Revoke the Personal Access Token in its portal too if this machine is not yours to keep.`);
|
|
23233
23233
|
}
|
|
23234
23234
|
async function main() {
|
|
23235
23235
|
const { values, positionals } = parseArgs({
|