@nookplot/mcp 0.4.114 → 0.4.116
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 +2 -2
- package/SKILL.md +2 -2
- package/dist/auth.d.ts +5 -112
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +53 -294
- package/dist/auth.js.map +1 -1
- package/dist/gateway.d.ts.map +1 -1
- package/dist/gateway.js +1 -5
- package/dist/gateway.js.map +1 -1
- package/dist/index.d.ts +1 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -615
- package/dist/index.js.map +1 -1
- package/dist/tools/cognitiveWorkspace.d.ts.map +1 -1
- package/dist/tools/cognitiveWorkspace.js +0 -30
- package/dist/tools/cognitiveWorkspace.js.map +1 -1
- package/dist/tools/ecosystem.d.ts.map +1 -1
- package/dist/tools/ecosystem.js +5 -1
- package/dist/tools/ecosystem.js.map +1 -1
- package/dist/tools/forgePresets.d.ts +2 -7
- package/dist/tools/forgePresets.d.ts.map +1 -1
- package/dist/tools/forgePresets.js +3 -133
- package/dist/tools/forgePresets.js.map +1 -1
- package/dist/tools/knowledgeGraph.js +1 -1
- package/dist/tools/knowledgeGraph.js.map +1 -1
- package/dist/tools/memory.d.ts.map +1 -1
- package/dist/tools/memory.js +33 -0
- package/dist/tools/memory.js.map +1 -1
- package/dist/tools/miningPipeline.d.ts +2 -6
- package/dist/tools/miningPipeline.d.ts.map +1 -1
- package/dist/tools/miningPipeline.js +3 -392
- package/dist/tools/miningPipeline.js.map +1 -1
- package/dist/tools/onchain.js +1 -1
- package/dist/tools/onchain.js.map +1 -1
- package/dist/tools/papers.d.ts.map +1 -1
- package/dist/tools/papers.js +0 -16
- package/dist/tools/papers.js.map +1 -1
- package/dist/tools/read.d.ts.map +1 -1
- package/dist/tools/read.js +77 -30
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/swarms.d.ts.map +1 -1
- package/dist/tools/swarms.js +1 -21
- package/dist/tools/swarms.js.map +1 -1
- package/dist/tools/tokens.d.ts.map +1 -1
- package/dist/tools/tokens.js +8 -3
- package/dist/tools/tokens.js.map +1 -1
- package/package.json +3 -3
- package/dist/profileName.d.ts +0 -65
- package/dist/profileName.d.ts.map +0 -1
- package/dist/profileName.js +0 -114
- package/dist/profileName.js.map +0 -1
- package/dist/syncSessions.d.ts +0 -84
- package/dist/syncSessions.d.ts.map +0 -1
- package/dist/syncSessions.js +0 -260
- package/dist/syncSessions.js.map +0 -1
- package/dist/syncSessionsExtractor.d.ts +0 -123
- package/dist/syncSessionsExtractor.d.ts.map +0 -1
- package/dist/syncSessionsExtractor.js +0 -362
- package/dist/syncSessionsExtractor.js.map +0 -1
- package/dist/syncSessionsState.d.ts +0 -89
- package/dist/syncSessionsState.d.ts.map +0 -1
- package/dist/syncSessionsState.js +0 -145
- package/dist/syncSessionsState.js.map +0 -1
- package/skills/hermes/nookplot/DESCRIPTION.md +0 -59
- package/skills/hermes/nookplot/daemon/SKILL.md +0 -103
- package/skills/hermes/nookplot/learn/SKILL.md +0 -131
- package/skills/hermes/nookplot/mine/SKILL.md +0 -111
- package/skills/hermes/nookplot/social/SKILL.md +0 -104
- package/skills/hermes/nookplot/sync/SKILL.md +0 -110
package/dist/tools/swarms.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export const swarmTools = [
|
|
7
7
|
{
|
|
8
8
|
name: "nookplot_create_swarm",
|
|
9
|
-
description: "Create a swarm to decompose a complex task into parallel subtasks assigned to specialist agents
|
|
9
|
+
description: "Create a swarm to decompose a complex task into parallel subtasks assigned to specialist agents",
|
|
10
10
|
category: "coordination",
|
|
11
11
|
inputSchema: {
|
|
12
12
|
type: "object",
|
|
@@ -14,7 +14,6 @@ export const swarmTools = [
|
|
|
14
14
|
title: { type: "string", description: "Swarm title" },
|
|
15
15
|
description: { type: "string", description: "Overall goal description" },
|
|
16
16
|
workspaceId: { type: "string", description: "Optional workspace ID to scope the swarm" },
|
|
17
|
-
parentSubtaskId: { type: "string", description: "Optional parent subtask ID for nested swarms (creates a child swarm linked to the parent)" },
|
|
18
17
|
subtasks: {
|
|
19
18
|
type: "array",
|
|
20
19
|
description: "Subtasks to create",
|
|
@@ -36,7 +35,6 @@ export const swarmTools = [
|
|
|
36
35
|
title: args.title,
|
|
37
36
|
description: args.description,
|
|
38
37
|
workspaceId: args.workspaceId,
|
|
39
|
-
parentSubtaskId: args.parentSubtaskId,
|
|
40
38
|
subtasks: args.subtasks,
|
|
41
39
|
}),
|
|
42
40
|
},
|
|
@@ -143,24 +141,6 @@ export const swarmTools = [
|
|
|
143
141
|
});
|
|
144
142
|
},
|
|
145
143
|
},
|
|
146
|
-
{
|
|
147
|
-
name: "nookplot_heartbeat_subtask",
|
|
148
|
-
description: "Send a heartbeat for a claimed subtask to prove you are still working on it. Call every 2-5 minutes to prevent timeout and reassignment.",
|
|
149
|
-
category: "coordination",
|
|
150
|
-
inputSchema: {
|
|
151
|
-
type: "object",
|
|
152
|
-
properties: {
|
|
153
|
-
subtaskId: { type: "string", description: "Subtask ID (UUID)" },
|
|
154
|
-
},
|
|
155
|
-
required: ["subtaskId"],
|
|
156
|
-
},
|
|
157
|
-
handler: async (args, ctx) => {
|
|
158
|
-
const subtaskId = args.subtaskId || args.id;
|
|
159
|
-
if (!subtaskId)
|
|
160
|
-
throw new Error("subtaskId is required");
|
|
161
|
-
return ctx.post(`/v1/swarms/subtasks/${encodeURIComponent(subtaskId)}/heartbeat`, {});
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
144
|
{
|
|
165
145
|
name: "nookplot_cancel_swarm",
|
|
166
146
|
description: "Cancel a swarm you created",
|
package/dist/tools/swarms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swarms.js","sourceRoot":"","sources":["../../src/tools/swarms.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,UAAU,GAAc;IACnC;QACE,IAAI,EAAE,uBAAuB;QAC7B,WA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AAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC;YACxC,IAAI,CAAC,OAAO;gBAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;YACrD,OAAO,GAAG,CAAC,IAAI,CAAC,cAAc,kBAAkB,CAAC,OAAO,CAAC,YAAY,EAAE;gBACrE,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;aAC5B,CAAC,CAAC;QACL,CAAC;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/tools/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/tools/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAoB1C,eAAO,MAAM,UAAU,EAAE,OAAO,EAmI/B,CAAC;AAEF;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,EACtF,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAqBrD"}
|
package/dist/tools/tokens.js
CHANGED
|
@@ -10,18 +10,23 @@
|
|
|
10
10
|
import { ethers } from "ethers";
|
|
11
11
|
const NOOK_ADDRESS = "0xb233BDFFD437E60fA451F62c6c09D3804d285Ba3";
|
|
12
12
|
const USDC_ADDRESS = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
13
|
+
const BOTCOIN_ADDRESS = "0xA601877977340862Ca67f816eb079958E5bd0BA3";
|
|
13
14
|
const ERC20_ABI = [
|
|
14
15
|
"function allowance(address owner, address spender) view returns (uint256)",
|
|
15
16
|
"function approve(address spender, uint256 amount) returns (bool)",
|
|
16
17
|
];
|
|
18
|
+
// Must mirror on-chain BountyContract.allowedTokens + ServiceMarketplace.allowedTokens
|
|
19
|
+
// AND gateway/src/routes/tokens.ts KNOWN_TOKENS. When adding a new partner token, update
|
|
20
|
+
// all three + send setAllowedToken on both contracts (see contracts/scripts/whitelist-<TOKEN>.ts).
|
|
17
21
|
const KNOWN_TOKENS = {
|
|
18
22
|
[NOOK_ADDRESS.toLowerCase()]: { symbol: "NOOK", decimals: 18 },
|
|
19
23
|
[USDC_ADDRESS.toLowerCase()]: { symbol: "USDC", decimals: 6 },
|
|
24
|
+
[BOTCOIN_ADDRESS.toLowerCase()]: { symbol: "BOTCOIN", decimals: 18 },
|
|
20
25
|
};
|
|
21
26
|
export const tokenTools = [
|
|
22
27
|
{
|
|
23
28
|
name: "nookplot_check_token_balance",
|
|
24
|
-
description: "Check your on-chain token balances (USDC, NOOK, and ETH for gas). Shows wallet balances, not credits.",
|
|
29
|
+
description: "Check your on-chain token balances (USDC, NOOK, BOTCOIN, and ETH for gas). Shows wallet balances, not credits.",
|
|
25
30
|
category: "economy",
|
|
26
31
|
inputSchema: { type: "object", properties: {} },
|
|
27
32
|
handler: async (_args, ctx) => ctx.get("/v1/token/balance"),
|
|
@@ -49,7 +54,7 @@ export const tokenTools = [
|
|
|
49
54
|
properties: {
|
|
50
55
|
tokenAddress: {
|
|
51
56
|
type: "string",
|
|
52
|
-
description: `Token to approve. NOOK: ${NOOK_ADDRESS}, USDC: ${USDC_ADDRESS}`,
|
|
57
|
+
description: `Token to approve. NOOK: ${NOOK_ADDRESS}, USDC: ${USDC_ADDRESS}, BOTCOIN: ${BOTCOIN_ADDRESS}`,
|
|
53
58
|
},
|
|
54
59
|
spenderAddress: {
|
|
55
60
|
type: "string",
|
|
@@ -72,7 +77,7 @@ export const tokenTools = [
|
|
|
72
77
|
throw new Error(`Invalid spender address: ${spenderAddr}`);
|
|
73
78
|
const tokenMeta = KNOWN_TOKENS[tokenAddr.toLowerCase()];
|
|
74
79
|
if (!tokenMeta)
|
|
75
|
-
throw new Error(`Unknown token. Use NOOK (${NOOK_ADDRESS})
|
|
80
|
+
throw new Error(`Unknown token. Use NOOK (${NOOK_ADDRESS}), USDC (${USDC_ADDRESS}), or BOTCOIN (${BOTCOIN_ADDRESS})`);
|
|
76
81
|
// Compute amount in smallest units
|
|
77
82
|
let amountWei;
|
|
78
83
|
if (amountStr.toLowerCase() === "max") {
|
package/dist/tools/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/tools/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,MAAM,YAAY,GAAG,4CAA4C,CAAC;AAClE,MAAM,YAAY,GAAG,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/tools/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,MAAM,YAAY,GAAG,4CAA4C,CAAC;AAClE,MAAM,YAAY,GAAG,4CAA4C,CAAC;AAClE,MAAM,eAAe,GAAG,4CAA4C,CAAC;AAErE,MAAM,SAAS,GAAG;IAChB,2EAA2E;IAC3E,kEAAkE;CACnE,CAAC;AAEF,uFAAuF;AACvF,yFAAyF;AACzF,mGAAmG;AACnG,MAAM,YAAY,GAAyD;IACzE,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,EAA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AAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AACjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
2
|
"name": "@nookplot/mcp",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "Nookplot MCP server
|
|
3
|
+
"version": "0.4.116",
|
|
4
|
+
"description": "Nookplot MCP server — connect any MCP-compatible agent to the Nookplot network",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"nookplot-mcp": "dist/index.js"
|
package/dist/profileName.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Profile-name derivation for Hermes's `hermes profile create <name>`.
|
|
3
|
-
*
|
|
4
|
-
* Every forged agent on Nookplot maps to its own Hermes profile — a fully
|
|
5
|
-
* isolated directory tree at `~/.hermes/profiles/<name>/` with its own
|
|
6
|
-
* config.yaml, .env, sessions, and (optionally) Telegram bot token. The
|
|
7
|
-
* profile name is the user-facing handle: they run `<name> chat` (via the
|
|
8
|
-
* alias wrapper at `~/.local/bin/<name>`), and it shows up in
|
|
9
|
-
* `hermes profile list`.
|
|
10
|
-
*
|
|
11
|
-
* Hermes's validation rule (from `hermes profile create --help`):
|
|
12
|
-
* "Profile name (lowercase, alphanumeric)"
|
|
13
|
-
*
|
|
14
|
-
* Empirically, it also accepts hyphens. The pattern we target is
|
|
15
|
-
* `/^[a-z][a-z0-9-]{0,30}[a-z0-9]$/` — 2..32 chars, letter-prefix,
|
|
16
|
-
* alnum-or-hyphen middle, alnum suffix.
|
|
17
|
-
*
|
|
18
|
-
* Input sources, in preference order:
|
|
19
|
-
* 1. `display_name` from `agents.display_name` (slugged)
|
|
20
|
-
* 2. `agent-<last6-hex>` fallback derived from the agent address
|
|
21
|
-
*
|
|
22
|
-
* Collision handling is the caller's job — we just produce the candidate
|
|
23
|
-
* from inputs. The bash installer does a `hermes profile show $NAME ||
|
|
24
|
-
* hermes profile create $NAME` pattern, so a name that already exists
|
|
25
|
-
* with a DIFFERENT agent is the user's problem (rare, and giving them a
|
|
26
|
-
* clear error beats silently shadowing).
|
|
27
|
-
*
|
|
28
|
-
* @module profileName
|
|
29
|
-
*/
|
|
30
|
-
/** Validate against Hermes's profile-name rule. Exported for tests. */
|
|
31
|
-
export declare function isValidProfileName(name: string): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Slugify a free-form string (display name, title, etc.) into a safe
|
|
34
|
-
* profile name. Rules:
|
|
35
|
-
* - lowercase
|
|
36
|
-
* - unicode → ASCII approximation (NFKD strips diacritics)
|
|
37
|
-
* - non-alnum runs become single hyphens
|
|
38
|
-
* - leading/trailing hyphens trimmed
|
|
39
|
-
* - leading digits replaced with "a-" so the name starts with a letter
|
|
40
|
-
* - length capped at MAX_PROFILE_NAME_LEN, trimmed at a hyphen if possible
|
|
41
|
-
*
|
|
42
|
-
* Returns empty string if the input has no usable alphanumeric chars
|
|
43
|
-
* (e.g. pure emoji). Callers should treat that as "fall back to the
|
|
44
|
-
* address-based default."
|
|
45
|
-
*/
|
|
46
|
-
export declare function slugifyDisplayName(input: string): string;
|
|
47
|
-
/**
|
|
48
|
-
* Fallback name from an agent's on-chain address: `agent-<last6-hex>`.
|
|
49
|
-
* Always valid (short, letter-prefix, alnum).
|
|
50
|
-
*/
|
|
51
|
-
export declare function profileNameFromAddress(address: string): string;
|
|
52
|
-
/**
|
|
53
|
-
* Top-level derivation: try display_name first, fall back to address.
|
|
54
|
-
*
|
|
55
|
-
* Takes optional collision-check hook — if provided, we'll try `<name>-2`,
|
|
56
|
-
* `<name>-3`, ... up to `-9` before giving up. That's enough headroom for
|
|
57
|
-
* normal users; power users who hit it can rename via `hermes profile
|
|
58
|
-
* rename` after the fact.
|
|
59
|
-
*/
|
|
60
|
-
export declare function deriveProfileName(opts: {
|
|
61
|
-
displayName?: string | null;
|
|
62
|
-
agentAddress: string;
|
|
63
|
-
isTaken?: (candidate: string) => boolean;
|
|
64
|
-
}): string;
|
|
65
|
-
//# sourceMappingURL=profileName.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profileName.d.ts","sourceRoot":"","sources":["../src/profileName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAKH,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA2BxD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI9D;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE;IACJ,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CAC1C,GACA,MAAM,CAmBR"}
|
package/dist/profileName.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Profile-name derivation for Hermes's `hermes profile create <name>`.
|
|
3
|
-
*
|
|
4
|
-
* Every forged agent on Nookplot maps to its own Hermes profile — a fully
|
|
5
|
-
* isolated directory tree at `~/.hermes/profiles/<name>/` with its own
|
|
6
|
-
* config.yaml, .env, sessions, and (optionally) Telegram bot token. The
|
|
7
|
-
* profile name is the user-facing handle: they run `<name> chat` (via the
|
|
8
|
-
* alias wrapper at `~/.local/bin/<name>`), and it shows up in
|
|
9
|
-
* `hermes profile list`.
|
|
10
|
-
*
|
|
11
|
-
* Hermes's validation rule (from `hermes profile create --help`):
|
|
12
|
-
* "Profile name (lowercase, alphanumeric)"
|
|
13
|
-
*
|
|
14
|
-
* Empirically, it also accepts hyphens. The pattern we target is
|
|
15
|
-
* `/^[a-z][a-z0-9-]{0,30}[a-z0-9]$/` — 2..32 chars, letter-prefix,
|
|
16
|
-
* alnum-or-hyphen middle, alnum suffix.
|
|
17
|
-
*
|
|
18
|
-
* Input sources, in preference order:
|
|
19
|
-
* 1. `display_name` from `agents.display_name` (slugged)
|
|
20
|
-
* 2. `agent-<last6-hex>` fallback derived from the agent address
|
|
21
|
-
*
|
|
22
|
-
* Collision handling is the caller's job — we just produce the candidate
|
|
23
|
-
* from inputs. The bash installer does a `hermes profile show $NAME ||
|
|
24
|
-
* hermes profile create $NAME` pattern, so a name that already exists
|
|
25
|
-
* with a DIFFERENT agent is the user's problem (rare, and giving them a
|
|
26
|
-
* clear error beats silently shadowing).
|
|
27
|
-
*
|
|
28
|
-
* @module profileName
|
|
29
|
-
*/
|
|
30
|
-
const MAX_PROFILE_NAME_LEN = 32;
|
|
31
|
-
const MIN_PROFILE_NAME_LEN = 2;
|
|
32
|
-
/** Validate against Hermes's profile-name rule. Exported for tests. */
|
|
33
|
-
export function isValidProfileName(name) {
|
|
34
|
-
return /^[a-z][a-z0-9-]{0,30}[a-z0-9]$/.test(name);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Slugify a free-form string (display name, title, etc.) into a safe
|
|
38
|
-
* profile name. Rules:
|
|
39
|
-
* - lowercase
|
|
40
|
-
* - unicode → ASCII approximation (NFKD strips diacritics)
|
|
41
|
-
* - non-alnum runs become single hyphens
|
|
42
|
-
* - leading/trailing hyphens trimmed
|
|
43
|
-
* - leading digits replaced with "a-" so the name starts with a letter
|
|
44
|
-
* - length capped at MAX_PROFILE_NAME_LEN, trimmed at a hyphen if possible
|
|
45
|
-
*
|
|
46
|
-
* Returns empty string if the input has no usable alphanumeric chars
|
|
47
|
-
* (e.g. pure emoji). Callers should treat that as "fall back to the
|
|
48
|
-
* address-based default."
|
|
49
|
-
*/
|
|
50
|
-
export function slugifyDisplayName(input) {
|
|
51
|
-
if (typeof input !== "string" || input.length === 0)
|
|
52
|
-
return "";
|
|
53
|
-
let s = input
|
|
54
|
-
.normalize("NFKD")
|
|
55
|
-
.replace(/[\u0300-\u036f]/g, "") // strip combining accents
|
|
56
|
-
.toLowerCase()
|
|
57
|
-
.replace(/[^a-z0-9]+/g, "-") // non-alnum runs → hyphen
|
|
58
|
-
.replace(/^-+|-+$/g, ""); // trim leading/trailing hyphens
|
|
59
|
-
if (s.length === 0)
|
|
60
|
-
return "";
|
|
61
|
-
// Hermes requires a letter prefix.
|
|
62
|
-
if (/^[0-9]/.test(s))
|
|
63
|
-
s = "a-" + s;
|
|
64
|
-
// Cap length. If we have to cut, prefer cutting at a hyphen so we don't
|
|
65
|
-
// leave a mid-word stump.
|
|
66
|
-
if (s.length > MAX_PROFILE_NAME_LEN) {
|
|
67
|
-
const cut = s.slice(0, MAX_PROFILE_NAME_LEN);
|
|
68
|
-
const lastHyphen = cut.lastIndexOf("-");
|
|
69
|
-
s = lastHyphen > MIN_PROFILE_NAME_LEN ? cut.slice(0, lastHyphen) : cut;
|
|
70
|
-
}
|
|
71
|
-
// Trim trailing hyphen that could remain after length cut.
|
|
72
|
-
s = s.replace(/-+$/, "");
|
|
73
|
-
// After all of that, still must pass the Hermes rule. If not, give up.
|
|
74
|
-
return isValidProfileName(s) ? s : "";
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Fallback name from an agent's on-chain address: `agent-<last6-hex>`.
|
|
78
|
-
* Always valid (short, letter-prefix, alnum).
|
|
79
|
-
*/
|
|
80
|
-
export function profileNameFromAddress(address) {
|
|
81
|
-
const clean = address.replace(/^0x/, "").toLowerCase();
|
|
82
|
-
const last6 = clean.slice(-6);
|
|
83
|
-
return `agent-${last6}`;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Top-level derivation: try display_name first, fall back to address.
|
|
87
|
-
*
|
|
88
|
-
* Takes optional collision-check hook — if provided, we'll try `<name>-2`,
|
|
89
|
-
* `<name>-3`, ... up to `-9` before giving up. That's enough headroom for
|
|
90
|
-
* normal users; power users who hit it can rename via `hermes profile
|
|
91
|
-
* rename` after the fact.
|
|
92
|
-
*/
|
|
93
|
-
export function deriveProfileName(opts) {
|
|
94
|
-
const fromDisplay = opts.displayName ? slugifyDisplayName(opts.displayName) : "";
|
|
95
|
-
const primary = fromDisplay || profileNameFromAddress(opts.agentAddress);
|
|
96
|
-
if (!opts.isTaken)
|
|
97
|
-
return primary;
|
|
98
|
-
if (!opts.isTaken(primary))
|
|
99
|
-
return primary;
|
|
100
|
-
for (let i = 2; i <= 9; i++) {
|
|
101
|
-
const candidate = `${primary}-${i}`;
|
|
102
|
-
if (candidate.length > MAX_PROFILE_NAME_LEN) {
|
|
103
|
-
// Primary was too long to suffix; fall back to address-based.
|
|
104
|
-
const addrName = profileNameFromAddress(opts.agentAddress);
|
|
105
|
-
return opts.isTaken(addrName) ? `${addrName}-${i}` : addrName;
|
|
106
|
-
}
|
|
107
|
-
if (!opts.isTaken(candidate))
|
|
108
|
-
return candidate;
|
|
109
|
-
}
|
|
110
|
-
// Give up — return the primary. Hermes will error on duplicate create;
|
|
111
|
-
// user sees the error and can rename.
|
|
112
|
-
return primary;
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=profileName.js.map
|
package/dist/profileName.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profileName.js","sourceRoot":"","sources":["../src/profileName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B,uEAAuE;AACvE,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,gCAAgC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,IAAI,OAAO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.
|
|
3
|
-
*
|
|
4
|
-
* `nookplot-mcp sync-sessions` walks `~/.hermes/sessions/session_*.json`,
|
|
5
|
-
* finds sessions we haven't processed yet, extracts findings + reasoning
|
|
6
|
-
* traces heuristically, and POSTs each to the Phase 2c capture queue at
|
|
7
|
-
* `/v1/me/captures`. Each POST goes through the same sybil gate +
|
|
8
|
-
* ContentScanner + rate-limit that the realtime MCP tools already use —
|
|
9
|
-
* this file is a thin driver, not a new write surface.
|
|
10
|
-
*
|
|
11
|
-
* Safety net positioning:
|
|
12
|
-
* - The MCP tools in Phase 2a run DURING the session; this subcommand
|
|
13
|
-
* runs AFTER. Together they ensure that even if the agent forgot to
|
|
14
|
-
* call `nookplot_capture_finding` during work, the synthesis it
|
|
15
|
-
* produced doesn't get lost.
|
|
16
|
-
* - Everything goes through the 24h review queue, so the user can
|
|
17
|
-
* still reject anything the heuristic misidentified as a finding.
|
|
18
|
-
* - Dedup is two-layered: `processed_sessions.json` skips whole
|
|
19
|
-
* sessions on the next run, and the gateway's UNIQUE (agent_address,
|
|
20
|
-
* kind, content_hash) index blocks exact-duplicate bodies across
|
|
21
|
-
* different sessions too.
|
|
22
|
-
*
|
|
23
|
-
* @module syncSessions
|
|
24
|
-
*/
|
|
25
|
-
import type { NookplotCredentials } from "./auth.js";
|
|
26
|
-
export interface SyncSessionsOptions {
|
|
27
|
-
/** Gateway URL. Defaults to $NOOKPLOT_GATEWAY_URL or the public gateway. */
|
|
28
|
-
gatewayUrl?: string;
|
|
29
|
-
/** Credentials (loaded from ~/.nookplot/credentials.json normally). */
|
|
30
|
-
credentials: NookplotCredentials;
|
|
31
|
-
/** If set, overrides the NOOKPLOT_AGENT_ADDRESS env var. */
|
|
32
|
-
scopedAgentAddress?: string;
|
|
33
|
-
/** Dry run — extract + report, but don't POST to the gateway. */
|
|
34
|
-
dryRun?: boolean;
|
|
35
|
-
/** Max sessions to process in this invocation. Default 10. */
|
|
36
|
-
limit?: number;
|
|
37
|
-
/** Only consider sessions modified after this time. */
|
|
38
|
-
since?: Date;
|
|
39
|
-
/** Re-process sessions marked as done. Item-level dedup still applies. */
|
|
40
|
-
force?: boolean;
|
|
41
|
-
/** Directory override for tests. Defaults to ~/.hermes/sessions. */
|
|
42
|
-
sessionsDir?: string;
|
|
43
|
-
/** State file path override for tests. */
|
|
44
|
-
statePath?: string;
|
|
45
|
-
/** Max ms per POST. */
|
|
46
|
-
timeoutMs?: number;
|
|
47
|
-
_fetch?: typeof fetch;
|
|
48
|
-
_now?: () => Date;
|
|
49
|
-
}
|
|
50
|
-
export interface SessionResult {
|
|
51
|
-
sessionId: string;
|
|
52
|
-
filePath: string;
|
|
53
|
-
/** 'processed' on success, 'skipped' if already done, 'failed' on fatal parse error. */
|
|
54
|
-
status: "processed" | "skipped" | "failed";
|
|
55
|
-
/** Items extracted (whether or not they posted successfully). */
|
|
56
|
-
extracted: number;
|
|
57
|
-
/** Items that successfully posted (or counted as duplicates). */
|
|
58
|
-
captured: number;
|
|
59
|
-
/** Per-item errors, if any. */
|
|
60
|
-
errors: string[];
|
|
61
|
-
/** Reason for skip, if status is 'skipped'. */
|
|
62
|
-
skipReason?: string;
|
|
63
|
-
}
|
|
64
|
-
export interface SyncSessionsResult {
|
|
65
|
-
/** Total sessions inspected on this run. */
|
|
66
|
-
inspected: number;
|
|
67
|
-
/** Sessions processed (extraction + POSTs attempted). */
|
|
68
|
-
processed: number;
|
|
69
|
-
/** Sessions skipped (already done or filtered by --since). */
|
|
70
|
-
skipped: number;
|
|
71
|
-
/** Sessions that failed to parse. */
|
|
72
|
-
failed: number;
|
|
73
|
-
/** Items captured into the review queue. */
|
|
74
|
-
capturesCreated: number;
|
|
75
|
-
/** Detailed per-session breakdown (for dry-run reporting). */
|
|
76
|
-
perSession: SessionResult[];
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Main entry point. Walks sessions, extracts, posts. Returns a summary
|
|
80
|
-
* caller can print. Tests drive this directly with mocked `_fetch` +
|
|
81
|
-
* `sessionsDir` + `statePath`.
|
|
82
|
-
*/
|
|
83
|
-
export declare function syncSessions(opts: SyncSessionsOptions): Promise<SyncSessionsResult>;
|
|
84
|
-
//# sourceMappingURL=syncSessions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"syncSessions.d.ts","sourceRoot":"","sources":["../src/syncSessions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAiBrD,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,WAAW,EAAE,mBAAmB,CAAC;IACjC,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iEAAiE;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,0EAA0E;IAC1E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,MAAM,CAAC,EAAE,OAAO,KAAK,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,wFAAwF;IACxF,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC3C,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,M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