@appsoftwareltd/etherpk-mcp 0.1.2 → 0.2.0

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 CHANGED
@@ -17,18 +17,18 @@ server and graph filled in. They are:
17
17
 
18
18
  ```sh
19
19
  # Once per computer. Prompts for an account-wide Personal Access Token (make one at
20
- # https://server.etherpk.com/account/tokens, also reachable from "Access tokens" in
20
+ # https://sync.etherpk.com/account/tokens, also reachable from "Access tokens" in
21
21
  # EtherPK's account menu), then shows a short code and the address of your EtherPK:
22
22
  # open EtherPK there in a browser where you're signed in with your graphs unlocked -
23
23
  # any page will do - and confirm the code. The same step as adding a phone.
24
- npx @appsoftwareltd/etherpk-mcp login --server https://server.etherpk.com
24
+ npx @appsoftwareltd/etherpk-mcp login --sync-server https://sync.etherpk.com
25
25
 
26
26
  # Self-hosting your own Sync Server? Give its address instead:
27
- # npx @appsoftwareltd/etherpk-mcp login --server https://sync.your-domain.example
27
+ # npx @appsoftwareltd/etherpk-mcp login --sync-server https://sync.your-domain.example
28
28
 
29
29
  # No EtherPK to hand on this computer (a server you reach over SSH, say)? Press r while
30
30
  # login is waiting, or use your Recovery Code from the start:
31
- # npx @appsoftwareltd/etherpk-mcp login --server https://server.etherpk.com --recovery-code
31
+ # npx @appsoftwareltd/etherpk-mcp login --sync-server https://sync.etherpk.com --recovery-code
32
32
 
33
33
  # Tell the agent about the graph (Claude Code shown; the Agents tab has the others).
34
34
  claude mcp add etherpk -- npx @appsoftwareltd/etherpk-mcp serve --graph <graph id>
@@ -83,7 +83,7 @@ pnpm publish --access public --no-git-checks # prepack runs the build; pnpm re
83
83
  npx -y @appsoftwareltd/etherpk-mcp@<version> --version # verify, once the registry lists it (a few minutes)
84
84
  ```
85
85
 
86
- The end-to-end specs in `tests-server/agents/` build and drive this bundle against a real Sync
86
+ The end-to-end specs in `tests-sync/agents/` build and drive this bundle against a real Sync
87
87
  Server; the technical notes are in the repo under `docs/docs/technical/Headless Client.md`.
88
88
 
89
89
  Full guide, including how the cache stays current and what an agent can and can't do:
package/dist/main.js CHANGED
@@ -17,7 +17,7 @@ import { deserialize, serialize } from "node:v8";
17
17
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
18
18
  var package_default = {
19
19
  name: "@appsoftwareltd/etherpk-mcp",
20
- version: "0.1.2",
20
+ version: "0.2.0",
21
21
  license: "Elastic-2.0",
22
22
  description: "EtherPK Headless Client: an MCP server over a synced knowledge graph, run beside the agent on the user's own machine.",
23
23
  type: "module",
@@ -653,13 +653,13 @@ function createSyncTokenSource(mint, opts) {
653
653
  */
654
654
  function createHeadlessAccount(config) {
655
655
  const api = createSyncApi({
656
- baseUrl: config.server,
656
+ baseUrl: config.syncServer,
657
657
  token: config.pat
658
658
  });
659
659
  return {
660
660
  api,
661
- serverBaseUrl: config.server,
662
- relayUrl: relayUrlFrom(config.server),
661
+ serverBaseUrl: config.syncServer,
662
+ relayUrl: relayUrlFrom(config.syncServer),
663
663
  tokenFor: (graphId) => createSyncTokenSource(() => api.mintSyncToken(graphId))
664
664
  };
665
665
  }
@@ -729,9 +729,9 @@ function parseConfig(raw) {
729
729
  }
730
730
  if (typeof parsed !== "object" || parsed === null) return null;
731
731
  const rec = parsed;
732
- if (typeof rec.server !== "string" || typeof rec.pat !== "string") return null;
732
+ if (typeof rec.syncServer !== "string" || typeof rec.pat !== "string") return null;
733
733
  const out = {
734
- server: rec.server.replace(/\/$/, ""),
734
+ syncServer: rec.syncServer.replace(/\/$/, ""),
735
735
  pat: rec.pat
736
736
  };
737
737
  if (typeof rec.vaultKey === "string" && rec.vaultKey !== "") out.vaultKey = rec.vaultKey;
@@ -8390,7 +8390,7 @@ function createMcpServer(graph, info) {
8390
8390
  /**
8391
8391
  * `etherpk-mcp`: the [[Headless Client]]'s command line (ADR 0072).
8392
8392
  *
8393
- * etherpk-mcp login --server <url> [--pat <token>] [--recovery-code]
8393
+ * etherpk-mcp login --sync-server <url> [--pat <token>] [--recovery-code]
8394
8394
  * etherpk-mcp graphs
8395
8395
  * etherpk-mcp serve --graph <id or name>
8396
8396
  * etherpk-mcp logout
@@ -8408,7 +8408,7 @@ var VERSION = package_default.version;
8408
8408
  var CMD = /[\\/]_npx[\\/]/.test(process.argv[1] ?? "") ? "npx @appsoftwareltd/etherpk-mcp" : "etherpk-mcp";
8409
8409
  var USAGE = `etherpk-mcp - EtherPK Headless Client (an MCP server over one synced graph)
8410
8410
 
8411
- ${CMD} login --server <url> [--pat <token>] [--recovery-code]
8411
+ ${CMD} login --sync-server <url> [--pat <token>] [--recovery-code]
8412
8412
  Sign this machine in as a device of your account. Prompts for a Personal Access
8413
8413
  Token (an account-wide one, from the Sync Server portal at <url>/account/tokens)
8414
8414
  unless --pat or ETHERPK_PAT is given, then unlocks your keys by Device Approval:
@@ -8471,30 +8471,30 @@ async function ask(question, { secret = false } = {}) {
8471
8471
  }
8472
8472
  async function requireConfig(path) {
8473
8473
  const config = await readConfig(path);
8474
- if (!config) fail(`Not logged in on this machine. Run: ${CMD} login --server <url>`);
8474
+ if (!config) fail(`Not logged in on this machine. Run: ${CMD} login --sync-server <url>`);
8475
8475
  return config;
8476
8476
  }
8477
8477
  async function login(args) {
8478
8478
  const path = defaultConfigPath();
8479
- const server = (args.server ?? (await readConfig(path))?.server ?? await ask("Sync Server URL: ")).replace(/\/$/, "");
8480
- if (!/^https?:\/\//.test(server)) fail("The server must be an http(s) URL.");
8481
- const pat = args.pat ?? process.env.ETHERPK_PAT ?? await ask(`Personal Access Token (account-wide, from ${server}/account/tokens): `, { secret: true });
8479
+ const syncServer = (args["sync-server"] ?? (await readConfig(path))?.syncServer ?? await ask("Sync Server URL: ")).replace(/\/$/, "");
8480
+ if (!/^https?:\/\//.test(syncServer)) fail("The Sync Server must be an http(s) URL.");
8481
+ const pat = args.pat ?? process.env.ETHERPK_PAT ?? await ask(`Personal Access Token (account-wide, from ${syncServer}/account/tokens): `, { secret: true });
8482
8482
  if (!pat) fail("A Personal Access Token is required.");
8483
8483
  const account = await connectAccount({
8484
- server,
8484
+ syncServer,
8485
8485
  pat
8486
8486
  });
8487
- console.log(`Signed in to ${server} as ${account.principal.email ?? account.principal.name ?? account.principal.id}.`);
8487
+ console.log(`Signed in to ${syncServer} as ${account.principal.email ?? account.principal.name ?? account.principal.id}.`);
8488
8488
  const byRecoveryCode = async () => unlockByRecoveryCode(account.api, process.env.ETHERPK_RECOVERY_CODE ?? await ask("Recovery Code: ", { secret: true }));
8489
8489
  const vaultKey = args["recovery-code"] ? await byRecoveryCode() : await approveOrFallBack(account, byRecoveryCode);
8490
8490
  await writeConfig(path, {
8491
- server,
8491
+ syncServer,
8492
8492
  pat,
8493
8493
  vaultKey: toBase64Url(vaultKey)
8494
8494
  });
8495
8495
  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.`);
8496
8496
  await listGraphs({
8497
- server,
8497
+ syncServer,
8498
8498
  pat,
8499
8499
  vaultKey: toBase64Url(vaultKey)
8500
8500
  });
@@ -8642,7 +8642,7 @@ async function main() {
8642
8642
  args: process.argv.slice(2),
8643
8643
  allowPositionals: true,
8644
8644
  options: {
8645
- server: { type: "string" },
8645
+ "sync-server": { type: "string" },
8646
8646
  pat: { type: "string" },
8647
8647
  "recovery-code": { type: "boolean" },
8648
8648
  graph: { type: "string" },