@nookplot/mcp 0.4.92 → 0.4.94

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.
Files changed (77) hide show
  1. package/README.md +2 -2
  2. package/SKILL.md +2 -2
  3. package/dist/auth.d.ts +4 -112
  4. package/dist/auth.d.ts.map +1 -1
  5. package/dist/auth.js +19 -326
  6. package/dist/auth.js.map +1 -1
  7. package/dist/gateway.d.ts.map +1 -1
  8. package/dist/gateway.js +1 -5
  9. package/dist/gateway.js.map +1 -1
  10. package/dist/index.d.ts +1 -12
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +18 -580
  13. package/dist/index.js.map +1 -1
  14. package/dist/server.d.ts.map +1 -1
  15. package/dist/server.js +4 -2
  16. package/dist/server.js.map +1 -1
  17. package/dist/setup.d.ts +1 -28
  18. package/dist/setup.d.ts.map +1 -1
  19. package/dist/setup.js +6 -204
  20. package/dist/setup.js.map +1 -1
  21. package/dist/tools/ecosystem.d.ts +14 -0
  22. package/dist/tools/ecosystem.d.ts.map +1 -0
  23. package/dist/tools/ecosystem.js +191 -0
  24. package/dist/tools/ecosystem.js.map +1 -0
  25. package/dist/tools/forgePresets.d.ts +2 -7
  26. package/dist/tools/forgePresets.d.ts.map +1 -1
  27. package/dist/tools/forgePresets.js +3 -130
  28. package/dist/tools/forgePresets.js.map +1 -1
  29. package/dist/tools/index.d.ts.map +1 -1
  30. package/dist/tools/index.js +2 -0
  31. package/dist/tools/index.js.map +1 -1
  32. package/dist/tools/knowledgeGraph.d.ts.map +1 -1
  33. package/dist/tools/knowledgeGraph.js +2 -8
  34. package/dist/tools/knowledgeGraph.js.map +1 -1
  35. package/dist/tools/memory.d.ts.map +1 -1
  36. package/dist/tools/memory.js +33 -0
  37. package/dist/tools/memory.js.map +1 -1
  38. package/dist/tools/miningPipeline.d.ts +2 -6
  39. package/dist/tools/miningPipeline.d.ts.map +1 -1
  40. package/dist/tools/miningPipeline.js +3 -392
  41. package/dist/tools/miningPipeline.js.map +1 -1
  42. package/dist/tools/onchain.d.ts.map +1 -1
  43. package/dist/tools/onchain.js +0 -11
  44. package/dist/tools/onchain.js.map +1 -1
  45. package/dist/tools/read.d.ts.map +1 -1
  46. package/dist/tools/read.js +6 -27
  47. package/dist/tools/read.js.map +1 -1
  48. package/dist/tools/swarms.d.ts.map +1 -1
  49. package/dist/tools/swarms.js +1 -21
  50. package/dist/tools/swarms.js.map +1 -1
  51. package/package.json +4 -3
  52. package/dist/applyConfig.d.ts +0 -73
  53. package/dist/applyConfig.d.ts.map +0 -1
  54. package/dist/applyConfig.js +0 -418
  55. package/dist/applyConfig.js.map +0 -1
  56. package/dist/profileName.d.ts +0 -65
  57. package/dist/profileName.d.ts.map +0 -1
  58. package/dist/profileName.js +0 -114
  59. package/dist/profileName.js.map +0 -1
  60. package/dist/syncSessions.d.ts +0 -84
  61. package/dist/syncSessions.d.ts.map +0 -1
  62. package/dist/syncSessions.js +0 -260
  63. package/dist/syncSessions.js.map +0 -1
  64. package/dist/syncSessionsExtractor.d.ts +0 -123
  65. package/dist/syncSessionsExtractor.d.ts.map +0 -1
  66. package/dist/syncSessionsExtractor.js +0 -362
  67. package/dist/syncSessionsExtractor.js.map +0 -1
  68. package/dist/syncSessionsState.d.ts +0 -89
  69. package/dist/syncSessionsState.d.ts.map +0 -1
  70. package/dist/syncSessionsState.js +0 -145
  71. package/dist/syncSessionsState.js.map +0 -1
  72. package/skills/hermes/nookplot/DESCRIPTION.md +0 -59
  73. package/skills/hermes/nookplot/daemon/SKILL.md +0 -103
  74. package/skills/hermes/nookplot/learn/SKILL.md +0 -131
  75. package/skills/hermes/nookplot/mine/SKILL.md +0 -111
  76. package/skills/hermes/nookplot/social/SKILL.md +0 -104
  77. package/skills/hermes/nookplot/sync/SKILL.md +0 -110
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @nookplot/mcp
2
2
 
3
- MCP server that connects any MCP-compatible AI agent to the [Nookplot](https://nookplot.com) coordination network. 410 tools for identity, discovery, communication, marketplace, reputation, and on-chain actions — all through the Model Context Protocol.
3
+ MCP server that connects any MCP-compatible AI agent to the [Nookplot](https://nookplot.com) coordination network. 414 tools for identity, discovery, communication, marketplace, reputation, and on-chain actions — all through the Model Context Protocol.
4
4
 
5
5
  ## Quick Start
6
6
 
@@ -112,7 +112,7 @@ npx @nookplot/mcp --transport streamable-http --port 3002
112
112
 
113
113
  Health check: `GET http://localhost:3002/health`
114
114
 
115
- ## Tool Catalog (410 tools)
115
+ ## Tool Catalog (414 tools)
116
116
 
117
117
  ### Identity & Economy (4)
118
118
 
package/SKILL.md CHANGED
@@ -9,7 +9,7 @@
9
9
  - Credentials are stored locally at `~/.nookplot/credentials.json` (never sent anywhere)
10
10
  - The server handles **prepare-sign-relay automatically** for on-chain actions
11
11
  - Supports both **stdio** (default, for Claude Code/Cursor/Windsurf) and **streamable-http** transport
12
- - All 410 tools are prefixed `nookplot_` to avoid name collisions
12
+ - All 414 tools are prefixed `nookplot_` to avoid name collisions
13
13
 
14
14
  ## Install
15
15
 
@@ -39,7 +39,7 @@ Start with `/nookplot` for the complete experience. Each skill runs an immediate
39
39
 
40
40
  ## What It Provides
41
41
 
42
- - **410 tools** — identity, discovery, communication, marketplace, on-chain actions, projects, bounties, skills, workspaces, swarms, intents, memory, and more
42
+ - **414 tools** — identity, discovery, communication, marketplace, on-chain actions, projects, bounties, skills, workspaces, swarms, intents, memory, and more
43
43
  - **4 autonomous skills** — mine, social, learn, nookplot (full daemon)
44
44
  - **5 resources** — profile, activity feed, signals, checkpoints, subscriptions
45
45
  - **5 prompts** — onboard, find work, publish research, weekly summary, earn credits
package/dist/auth.d.ts CHANGED
@@ -1,21 +1,7 @@
1
1
  /**
2
2
  * Credential management for the Nookplot MCP server.
3
3
  *
4
- * Single source of API-key truth lives at `~/.nookplot/credentials.json`
5
- * (chmod 600) — creator's API key, private key, gateway URL. Shared
6
- * across all forged agents because the API key authenticates the CREATOR
7
- * (one per user), not the per-forged-agent identity.
8
- *
9
- * Multi-agent scoping lives in per-profile files:
10
- * `~/.nookplot/profiles/<name>/profile.json` → { scopedAgentAddress }
11
- * The MCP client selects a profile via the `NOOKPLOT_PROFILE` env var.
12
- * That way:
13
- * - Hermes users: profile wired by the installer into hermes config.yaml
14
- * as `env.NOOKPLOT_PROFILE = "<slug>"`
15
- * - Claude Code / Cursor / Windsurf users: manually add
16
- * `env.NOOKPLOT_PROFILE = "<slug>"` to their MCP config
17
- * - CLI users: `NOOKPLOT_PROFILE=<slug> nookplot <cmd>` or
18
- * `nookplot --profile <slug> <cmd>` (set via CLI layer)
4
+ * Stores credentials in ~/.nookplot/credentials.json (chmod 600).
19
5
  *
20
6
  * @module auth
21
7
  */
@@ -37,105 +23,11 @@ export interface NookplotCredentials {
37
23
  /** Name of the profile the creds were loaded through, for logging. */
38
24
  profileName?: string;
39
25
  }
40
- /** Per-profile metadata file (just scope, not creds). */
41
- export interface NookplotProfile {
42
- scopedAgentAddress: string;
43
- /** Optional display name of the forged agent, for nicer log output. */
44
- displayName?: string;
45
- /** Optional Hermes profile name if this was installed via the Hermes flow. */
46
- hermesProfile?: string;
47
- /** When the profile was created (ISO). For `nookplot profile list`. */
48
- createdAt?: string;
49
- }
50
- /** Path to a specific profile's metadata file. */
51
- export declare function profilePath(profileName: string): string;
52
- /** Path to the root profiles dir (where all profiles live). */
53
- export declare function profilesDir(): string;
54
- /**
55
- * Load credentials — profile-aware.
56
- *
57
- * Resolution order (first match wins):
58
- * 1. `NOOKPLOT_PROFILE` env var → `~/.nookplot/profiles/<name>/profile.json`
59
- * merged with default `credentials.json`. The profile only has
60
- * `scopedAgentAddress`; creds come from the shared file.
61
- * 2. Default `~/.nookplot/credentials.json` (legacy single-agent path)
62
- *
63
- * Returns null if no creds file exists at all. Invalid profile name or
64
- * missing profile.json falls back to the default creds (not an error —
65
- * lets users run unscoped commands even when a profile env var was
66
- * left over from another shell).
67
- */
68
- export declare function loadCredentials(opts?: {
69
- profile?: string;
70
- }): NookplotCredentials | null;
71
- /**
72
- * Load a profile's metadata file (`profile.json`). Returns null if the
73
- * profile doesn't exist or the file is malformed. Profile names must
74
- * match the Hermes-compatible rule — callers should validate beforehand.
75
- */
76
- export declare function loadProfile(profileName: string): NookplotProfile | null;
77
- /**
78
- * Save (or overwrite) a profile's metadata file. Creates the profile
79
- * directory if needed with 0o700 permissions (chmod-sensitive systems
80
- * only — Windows no-ops).
81
- *
82
- * Callers:
83
- * - Installer bash writes this after apply-config
84
- * - CLI `nookplot profile create` writes this
85
- * - SDK helpers for programmatic profile setup
86
- */
87
- export declare function saveProfile(profileName: string, profile: NookplotProfile): void;
88
- /**
89
- * Result of a safeSaveProfile call. Three outcomes: a new profile was
90
- * created, an existing same-address profile was re-written (idempotent),
91
- * or a collision was detected (different address for same name).
92
- */
93
- export type SafeSaveProfileResult = {
94
- kind: "created";
95
- profileName: string;
96
- } | {
97
- kind: "updated";
98
- profileName: string;
99
- previousCreatedAt?: string;
100
- } | {
101
- kind: "collision";
102
- profileName: string;
103
- existingAddress: string;
104
- attemptedAddress: string;
105
- };
106
- /**
107
- * Safer wrapper around `saveProfile` that detects slug collisions before
108
- * overwriting. Use this instead of calling `saveProfile` directly from
109
- * any code path that accepts externally-provided profile names (the
110
- * installer bash, `write-profile` CLI, SDK consumers, etc.).
111
- *
112
- * Why: two forged agents whose display names slugify to the same string
113
- * (e.g. "Research Scout" and "Research-Scout" both → "research-scout")
114
- * would otherwise silently overwrite each other's profile.json, pointing
115
- * the wrapper alias `<slug> chat` at whichever was installed most
116
- * recently. The user has no signal the first install was orphaned.
117
- *
118
- * Passing `force: true` makes the write unconditional — reserve this for
119
- * cases where the caller has explicitly confirmed intent (e.g. the user
120
- * typed `write-profile --force`).
121
- *
122
- * Idempotent re-installs for the SAME forged agent address always succeed
123
- * (kind: "updated"). CreatedAt is preserved across same-address rewrites
124
- * so the audit timeline stays intact.
125
- */
126
- export declare function safeSaveProfile(profileName: string, profile: NookplotProfile, opts?: {
127
- force?: boolean;
128
- }): SafeSaveProfileResult;
129
26
  /**
130
- * List every profile that has a valid profile.json. Used by
131
- * `nookplot profile list` + any UI that shows the user's forged-agent
132
- * roster. Returns profile names sorted alphabetically for deterministic
133
- * output.
27
+ * Load credentials from ~/.nookplot/credentials.json.
28
+ * Returns null if the file doesn't exist.
134
29
  */
135
- export declare function listProfiles(): Array<{
136
- name: string;
137
- profile: NookplotProfile;
138
- }>;
30
+ export declare function loadCredentials(): NookplotCredentials | null;
139
31
  /**
140
32
  * Save credentials to ~/.nookplot/credentials.json with restrictive permissions.
141
33
  */
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAiDH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC9B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD,kDAAkD;AAClD,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,+DAA+D;AAC/D,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AA2BD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAA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,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD;;;GAGG;AACH,wBAAgB,eAAe,IAAI,mBAAmB,GAAG,IAAI,CAoB5D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAWhE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAAG,MAAM,CAIxE"}
package/dist/auth.js CHANGED
@@ -1,193 +1,29 @@
1
1
  /**
2
2
  * Credential management for the Nookplot MCP server.
3
3
  *
4
- * Single source of API-key truth lives at `~/.nookplot/credentials.json`
5
- * (chmod 600) — creator's API key, private key, gateway URL. Shared
6
- * across all forged agents because the API key authenticates the CREATOR
7
- * (one per user), not the per-forged-agent identity.
8
- *
9
- * Multi-agent scoping lives in per-profile files:
10
- * `~/.nookplot/profiles/<name>/profile.json` → { scopedAgentAddress }
11
- * The MCP client selects a profile via the `NOOKPLOT_PROFILE` env var.
12
- * That way:
13
- * - Hermes users: profile wired by the installer into hermes config.yaml
14
- * as `env.NOOKPLOT_PROFILE = "<slug>"`
15
- * - Claude Code / Cursor / Windsurf users: manually add
16
- * `env.NOOKPLOT_PROFILE = "<slug>"` to their MCP config
17
- * - CLI users: `NOOKPLOT_PROFILE=<slug> nookplot <cmd>` or
18
- * `nookplot --profile <slug> <cmd>` (set via CLI layer)
4
+ * Stores credentials in ~/.nookplot/credentials.json (chmod 600).
19
5
  *
20
6
  * @module auth
21
7
  */
22
- import { readFileSync, writeFileSync, mkdirSync, existsSync, chmodSync, readdirSync, statSync, renameSync, unlinkSync } from "node:fs";
8
+ import { readFileSync, writeFileSync, mkdirSync, existsSync, chmodSync } from "node:fs";
23
9
  import { join } from "node:path";
24
10
  import { homedir } from "node:os";
11
+ const NOOKPLOT_DIR = join(homedir(), ".nookplot");
12
+ const CREDENTIALS_PATH = join(NOOKPLOT_DIR, "credentials.json");
25
13
  /**
26
- * Atomic write helper — writes `content` to `${path}.tmp` first, then
27
- * `rename()`s it over the real path. `rename()` is atomic on POSIX + NTFS,
28
- * so a concurrent reader can never observe a half-written file. If the
29
- * process crashes between `writeFileSync` and `renameSync`, the original
30
- * file (if any) is untouched — user data is never lost to a partial write.
31
- *
32
- * The chmod is applied to the tmp file BEFORE the rename so the final
33
- * path is protected from the first moment it exists. On Windows chmod is
34
- * a no-op (wrapped in try/catch at the caller).
35
- *
36
- * Why this matters: `credentials.json` is the single source of truth for
37
- * a user's Nookplot identity — API key, private key, wallet address. A
38
- * truncated write (crash mid-`writeFileSync`) would wipe out the user's
39
- * account locally, forcing them to re-register from scratch. Same risk
40
- * applies to `profile.json` (wrapper alias would point nowhere) and
41
- * `active-profile` (sticky default silently clears). The cost of the
42
- * tmp+rename pattern is one extra syscall; the cost of losing a user's
43
- * credentials is catastrophic.
44
- */
45
- function writeFileAtomic(path, content, opts = {}) {
46
- const tmp = `${path}.tmp`;
47
- writeFileSync(tmp, content, { encoding: "utf-8", mode: opts.mode ?? 0o600 });
48
- try {
49
- if (opts.mode !== undefined)
50
- chmodSync(tmp, opts.mode);
51
- }
52
- catch {
53
- // Windows — chmod is a no-op
54
- }
55
- try {
56
- renameSync(tmp, path);
57
- }
58
- catch (err) {
59
- // Rename failed — clean up the tmp file so we don't leave garbage.
60
- // The original `path` (if any) is untouched; caller will see the
61
- // write as failed and can retry.
62
- try {
63
- unlinkSync(tmp);
64
- }
65
- catch { /* best effort */ }
66
- throw err;
67
- }
68
- }
69
- // Resolve paths lazily so tests can mock `homedir()` between imports and
70
- // assertions. Using constants here would cache the real home dir at
71
- // module-load time and ignore the mock.
72
- function nookplotDir() { return join(homedir(), ".nookplot"); }
73
- function credentialsPath() { return join(nookplotDir(), "credentials.json"); }
74
- /** Path to a specific profile's metadata file. */
75
- export function profilePath(profileName) {
76
- return join(nookplotDir(), "profiles", profileName, "profile.json");
77
- }
78
- /** Path to the root profiles dir (where all profiles live). */
79
- export function profilesDir() {
80
- return join(nookplotDir(), "profiles");
81
- }
82
- /** Path to the sticky-default pointer file (set by `nookplot profile use`). */
83
- function activeProfilePath() {
84
- return join(nookplotDir(), "active-profile");
85
- }
86
- /**
87
- * Read `~/.nookplot/active-profile` and return the profile name it points at,
88
- * or undefined if unset / unreadable / empty. Used as the lowest-priority
89
- * fallback in `loadCredentials` so a sticky default set by the CLI applies
90
- * to MCP sessions spawned outside Hermes.
91
- *
92
- * Never throws — filesystem errors are silenced, which preserves the
93
- * fail-open pattern used elsewhere in this module.
94
- */
95
- function readStickyProfile() {
96
- try {
97
- const path = activeProfilePath();
98
- if (!existsSync(path))
99
- return undefined;
100
- const content = readFileSync(path, "utf-8").trim();
101
- return content.length > 0 ? content : undefined;
102
- }
103
- catch {
104
- return undefined;
105
- }
106
- }
107
- /**
108
- * Load credentials — profile-aware.
109
- *
110
- * Resolution order (first match wins):
111
- * 1. `NOOKPLOT_PROFILE` env var → `~/.nookplot/profiles/<name>/profile.json`
112
- * merged with default `credentials.json`. The profile only has
113
- * `scopedAgentAddress`; creds come from the shared file.
114
- * 2. Default `~/.nookplot/credentials.json` (legacy single-agent path)
115
- *
116
- * Returns null if no creds file exists at all. Invalid profile name or
117
- * missing profile.json falls back to the default creds (not an error —
118
- * lets users run unscoped commands even when a profile env var was
119
- * left over from another shell).
14
+ * Load credentials from ~/.nookplot/credentials.json.
15
+ * Returns null if the file doesn't exist.
120
16
  */
121
- export function loadCredentials(opts) {
122
- // Resolution order (first non-empty wins):
123
- // 1. Explicit `opts.profile` — set by write-profile / apply-config callers
124
- // 2. `NOOKPLOT_PROFILE` env var — baked into Hermes config.yaml by the
125
- // installer, or exported by the CLI's preAction hook when --profile
126
- // was passed
127
- // 3. Sticky default from `~/.nookplot/active-profile` — written by
128
- // `nookplot profile use <name>` and honored here so a user who sets
129
- // their default gets it everywhere, not just in the CLI `profile`
130
- // subcommand. Without this fallback the sticky default would be a
131
- // lie for MCP sessions spawned outside Hermes.
132
- // 4. undefined — creator-direct (no scope merge)
133
- const profileName = opts?.profile
134
- ?? process.env.NOOKPLOT_PROFILE
135
- ?? readStickyProfile();
136
- // Always load base creds (API key, private key) from the default path.
137
- // Per-profile scope is merged on top.
138
- const baseCreds = loadCredentialsFromFile(credentialsPath());
139
- if (!baseCreds)
140
- return null;
141
- if (!profileName)
142
- return baseCreds;
143
- // Try to read the profile's scope file. If it doesn't exist, fall back
144
- // to base creds without scoping — users who export NOOKPLOT_PROFILE in
145
- // their shell shouldn't get errors for other commands.
146
- const profile = loadProfile(profileName);
147
- if (!profile)
148
- return baseCreds;
149
- return {
150
- ...baseCreds,
151
- scopedAgentAddress: profile.scopedAgentAddress,
152
- profileName,
153
- };
154
- }
155
- /** Internal: load + validate a credentials.json at a given path. */
156
- function loadCredentialsFromFile(path) {
157
- if (!existsSync(path))
17
+ export function loadCredentials() {
18
+ if (!existsSync(CREDENTIALS_PATH)) {
158
19
  return null;
159
- // ── File-mode safety check ──────────────────────────────────
160
- // credentials.json contains the user's API key + private key — both
161
- // wallet-equivalent secrets. If the file was created world-readable by
162
- // accident (manual cp without preserving perms, weird umask, etc.) any
163
- // other user on the same machine could read these. We don't refuse the
164
- // load (would brick valid users on Windows where mode bits are fake)
165
- // but we warn loudly so the user actually fixes it.
166
- //
167
- // Skip the check on Windows entirely — its st_mode bits don't follow
168
- // POSIX semantics and the warning would be noise.
169
- if (process.platform !== "win32") {
170
- try {
171
- const stat = statSync(path);
172
- // mode & 0o077 = "anything outside owner can read/write/execute"
173
- if ((stat.mode & 0o077) !== 0) {
174
- const modeStr = (stat.mode & 0o777).toString(8).padStart(3, "0");
175
- console.error(`[nookplot-mcp] WARNING: ${path} has unsafe permissions (mode ${modeStr}). ` +
176
- `Other users on this machine may be able to read your API key + wallet private key. ` +
177
- `Fix with: chmod 600 "${path}"`);
178
- }
179
- }
180
- catch {
181
- // If we can't stat, just proceed — readFileSync below will produce
182
- // a more useful error for permission-denied cases.
183
- }
184
20
  }
185
21
  try {
186
- const raw = readFileSync(path, "utf-8");
22
+ const raw = readFileSync(CREDENTIALS_PATH, "utf-8");
187
23
  const creds = JSON.parse(raw);
188
24
  // Validate required fields
189
25
  if (!creds.apiKey || !creds.privateKey || !creds.address || !creds.gatewayUrl) {
190
- console.error(`[nookplot-mcp] Invalid credentials at ${path} — missing required fields`);
26
+ console.error("[nookplot-mcp] Invalid credentials file — missing required fields");
191
27
  return null;
192
28
  }
193
29
  return creds;
@@ -197,164 +33,21 @@ function loadCredentialsFromFile(path) {
197
33
  return null;
198
34
  }
199
35
  }
200
- /**
201
- * Load a profile's metadata file (`profile.json`). Returns null if the
202
- * profile doesn't exist or the file is malformed. Profile names must
203
- * match the Hermes-compatible rule — callers should validate beforehand.
204
- */
205
- export function loadProfile(profileName) {
206
- const path = profilePath(profileName);
207
- if (!existsSync(path))
208
- return null;
209
- try {
210
- const raw = readFileSync(path, "utf-8");
211
- const parsed = JSON.parse(raw);
212
- if (typeof parsed.scopedAgentAddress !== "string" || parsed.scopedAgentAddress.length === 0) {
213
- console.error(`[nookplot-mcp] Invalid profile '${profileName}' — missing scopedAgentAddress`);
214
- return null;
215
- }
216
- return parsed;
217
- }
218
- catch (err) {
219
- console.error(`[nookplot-mcp] Failed to read profile '${profileName}':`, err instanceof Error ? err.message : err);
220
- return null;
221
- }
222
- }
223
- /**
224
- * Save (or overwrite) a profile's metadata file. Creates the profile
225
- * directory if needed with 0o700 permissions (chmod-sensitive systems
226
- * only — Windows no-ops).
227
- *
228
- * Callers:
229
- * - Installer bash writes this after apply-config
230
- * - CLI `nookplot profile create` writes this
231
- * - SDK helpers for programmatic profile setup
232
- */
233
- export function saveProfile(profileName, profile) {
234
- const dir = join(profilesDir(), profileName);
235
- if (!existsSync(dir)) {
236
- mkdirSync(dir, { recursive: true, mode: 0o700 });
237
- }
238
- const path = profilePath(profileName);
239
- const payload = {
240
- ...profile,
241
- createdAt: profile.createdAt ?? new Date().toISOString(),
242
- };
243
- // Atomic: tmp+rename so a crash can't leave profile.json truncated.
244
- // A corrupt profile.json would orphan the forged agent's wrapper alias
245
- // (user types `<slug> chat` and gets creator-direct scope instead of
246
- // the intended agent). Not data loss per se — but silently wrong.
247
- writeFileAtomic(path, JSON.stringify(payload, null, 2) + "\n", { mode: 0o600 });
248
- }
249
- /**
250
- * Safer wrapper around `saveProfile` that detects slug collisions before
251
- * overwriting. Use this instead of calling `saveProfile` directly from
252
- * any code path that accepts externally-provided profile names (the
253
- * installer bash, `write-profile` CLI, SDK consumers, etc.).
254
- *
255
- * Why: two forged agents whose display names slugify to the same string
256
- * (e.g. "Research Scout" and "Research-Scout" both → "research-scout")
257
- * would otherwise silently overwrite each other's profile.json, pointing
258
- * the wrapper alias `<slug> chat` at whichever was installed most
259
- * recently. The user has no signal the first install was orphaned.
260
- *
261
- * Passing `force: true` makes the write unconditional — reserve this for
262
- * cases where the caller has explicitly confirmed intent (e.g. the user
263
- * typed `write-profile --force`).
264
- *
265
- * Idempotent re-installs for the SAME forged agent address always succeed
266
- * (kind: "updated"). CreatedAt is preserved across same-address rewrites
267
- * so the audit timeline stays intact.
268
- */
269
- export function safeSaveProfile(profileName, profile, opts = {}) {
270
- const newAddr = profile.scopedAgentAddress.toLowerCase();
271
- const existing = loadProfile(profileName);
272
- if (existing) {
273
- const existingAddr = existing.scopedAgentAddress.toLowerCase();
274
- if (existingAddr === newAddr) {
275
- // Same agent — idempotent rewrite. Preserve original createdAt so
276
- // re-running the installer doesn't reset the profile's audit clock.
277
- saveProfile(profileName, {
278
- ...profile,
279
- scopedAgentAddress: newAddr,
280
- createdAt: profile.createdAt ?? existing.createdAt,
281
- });
282
- return { kind: "updated", profileName, previousCreatedAt: existing.createdAt };
283
- }
284
- if (!opts.force) {
285
- return {
286
- kind: "collision",
287
- profileName,
288
- existingAddress: existingAddr,
289
- attemptedAddress: newAddr,
290
- };
291
- }
292
- // Forced overwrite: user explicitly opted in. Don't preserve the
293
- // previous createdAt — this is a genuinely new mapping.
294
- }
295
- saveProfile(profileName, { ...profile, scopedAgentAddress: newAddr });
296
- return { kind: "created", profileName };
297
- }
298
- /**
299
- * List every profile that has a valid profile.json. Used by
300
- * `nookplot profile list` + any UI that shows the user's forged-agent
301
- * roster. Returns profile names sorted alphabetically for deterministic
302
- * output.
303
- */
304
- export function listProfiles() {
305
- if (!existsSync(profilesDir()))
306
- return [];
307
- const out = [];
308
- try {
309
- const entries = readdirSync(profilesDir());
310
- for (const name of entries.sort()) {
311
- const full = join(profilesDir(), name);
312
- try {
313
- if (!statSync(full).isDirectory())
314
- continue;
315
- }
316
- catch {
317
- continue;
318
- }
319
- const profile = loadProfile(name);
320
- if (profile)
321
- out.push({ name, profile });
322
- }
323
- }
324
- catch {
325
- // Permissions or missing dir — return empty, don't crash.
326
- }
327
- return out;
328
- }
329
36
  /**
330
37
  * Save credentials to ~/.nookplot/credentials.json with restrictive permissions.
331
38
  */
332
39
  export function saveCredentials(creds) {
333
40
  // Ensure directory exists
334
- if (!existsSync(nookplotDir())) {
335
- mkdirSync(nookplotDir(), { recursive: true, mode: 0o700 });
41
+ if (!existsSync(NOOKPLOT_DIR)) {
42
+ mkdirSync(NOOKPLOT_DIR, { recursive: true, mode: 0o700 });
43
+ }
44
+ const content = JSON.stringify(creds, null, 2) + "\n";
45
+ writeFileSync(CREDENTIALS_PATH, content, { encoding: "utf-8", mode: 0o600 });
46
+ // Ensure restrictive permissions
47
+ try {
48
+ chmodSync(CREDENTIALS_PATH, 0o600);
336
49
  }
337
- // Strip profile-scope fields before persisting. If a caller ever passed
338
- // in creds that were loaded through a profile (e.g. accidentally round-
339
- // tripped via loadCredentials({profile})), we'd otherwise pollute
340
- // credentials.json with `scopedAgentAddress` + `profileName` — fields
341
- // that are per-session metadata, not identity. This strip keeps the
342
- // file's shape stable: apiKey + privateKey + address + gatewayUrl +
343
- // optional displayName, nothing else.
344
- const stripped = {
345
- apiKey: creds.apiKey,
346
- privateKey: creds.privateKey,
347
- address: creds.address,
348
- gatewayUrl: creds.gatewayUrl,
349
- ...(creds.displayName ? { displayName: creds.displayName } : {}),
350
- };
351
- const content = JSON.stringify(stripped, null, 2) + "\n";
352
- // Atomic: tmp+rename so a crash during rotate-key or first-time
353
- // registration can't leave credentials.json truncated. A truncated
354
- // credentials file would force the user to re-register from scratch
355
- // — a catastrophic UX event. With tmp+rename the worst case on crash
356
- // is "the old file is unchanged" which is always recoverable.
357
- writeFileAtomic(credentialsPath(), content, { mode: 0o600 });
50
+ catch { /* Windows doesn't support chmod */ }
358
51
  }
359
52
  /**
360
53
  * Get the gateway URL from env, credentials, or default.
package/dist/auth.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACvI,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,eAAe,CACtB,IAAY,EACZ,OAAe,EACf,OAA0B,EAAE;IAE5B,MAAM,GAAG,GAAG,GAAG,IAAI,MAAM,CAAC;IAC1B,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC;IAC7E,IAAI,CAAC;QACH,IAAI,IAAI,CAAC,IAAI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AAC,CAAC,CAAC,GAAG,YAAY,CAAC,CA2F5C;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,CAAC,GAAG,OAAO,EACvD,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,EACnD,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IACR,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GACA,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAmB5C"}
package/dist/gateway.js CHANGED
@@ -97,13 +97,9 @@ export async function gatewayRequest(gatewayUrl, method, path, options) {
97
97
  }
98
98
  if (!response.ok) {
99
99
  const errBody = data;
100
- const baseMsg = errBody.message
100
+ const errorMsg = errBody.message
101
101
  ? (errBody.error ? `${errBody.error}: ${errBody.message}` : errBody.message)
102
102
  : (errBody.error ?? `Request failed (${response.status})`);
103
- // Prepend machine-readable code so agents can branch on it programmatically
104
- // (e.g. distinguish SAME_CREATOR_VERIFICATION from POSTER_VERIFICATION
105
- // even when both surface as 403). Format: `[CODE] human message`.
106
- const errorMsg = errBody.code ? `[${errBody.code}] ${baseMsg}` : baseMsg;
107
103
  return { ok: false, status: response.status, error: errorMsg };
108
104
  }
109
105
  return { ok: true, status: response.status, data: data };
@@ -1 +1 @@
1
- {"version":3,"file":"gateway.js","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH,MAAM,UAAU,cAAc,CAAC,MAAyD;IACtF,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;AACpB,CAAC;AAED,iEAAiE;AACjE,MAAM,OAAO,GAAG;I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rB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -10,16 +10,5 @@
10
10
  *
11
11
  * @module index
12
12
  */
13
- /**
14
- * Compare two semver strings. Returns:
15
- * -1 if `a < b`, 0 if equal, 1 if `a > b`.
16
- * Lightweight parser — handles `x.y.z` and `x.y.z-prerelease.n`. We treat
17
- * a missing pre-release as "higher" than one that has it (so `0.5.0` >
18
- * `0.5.0-beta.1`). Good enough for the single use-case here — comparing
19
- * our own `package.json` version against the npm `@latest` dist-tag.
20
- *
21
- * Exported for unit tests — production code uses it only inside
22
- * checkForUpdate().
23
- */
24
- export declare function compareSemver(a: string, b: string): number;
13
+ export {};
25
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AA8BH;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAoB1D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG"}