@mnemonik/shared 7.2.2 → 7.27.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/dist/instructions.d.ts +28 -3
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +29 -2
- package/dist/instructions.js.map +1 -1
- package/package.json +1 -1
- package/src/instructions.ts +29 -2
package/dist/instructions.d.ts
CHANGED
|
@@ -4,8 +4,33 @@
|
|
|
4
4
|
* This is the SINGLE SOURCE OF TRUTH for MCP instructions.
|
|
5
5
|
* Shared instruction content imported by the server.
|
|
6
6
|
*
|
|
7
|
-
* Version: 2.
|
|
8
|
-
* Updated: 2026-
|
|
7
|
+
* Version: 2.109
|
|
8
|
+
* Updated: 2026-08-11
|
|
9
|
+
*
|
|
10
|
+
* v2.109 — Compressed the v2.108 memory-search clause. It restated, verbatim,
|
|
11
|
+
* the same search guidance carried by SESSION_OPENER_INSTRUCTION
|
|
12
|
+
* (bootstrapDigestRender.ts) — and both co-occur in the same agent
|
|
13
|
+
* session as the bootstrap digest's capabilities.search block, which
|
|
14
|
+
* already states the memory_search/code_search call signatures in
|
|
15
|
+
* full. Kept the essential behavior (memory holds the why; search it
|
|
16
|
+
* before assuming files or git history are the whole story; verify
|
|
17
|
+
* with Grep/Read; reach for code_search when concepts don't share
|
|
18
|
+
* the user's words), dropped the restated call shapes, and pointed at
|
|
19
|
+
* the session context's capabilities block for the exact signatures
|
|
20
|
+
* once it loads — this text fires at `initialize`, before any
|
|
21
|
+
* digest exists, so it cannot point "above" the way the trimmed
|
|
22
|
+
* SESSION_OPENER clause does. recall-first-class plan, Task A3
|
|
23
|
+
* rider (reviewer-flagged: character-for-character duplicate).
|
|
24
|
+
* v2.108 — Added front-loaded education that persistent project memory is part
|
|
25
|
+
* of the agent's working knowledge. A live Config-B fixture rejected
|
|
26
|
+
* the first generic invitation: the agent searched code, docs, and git
|
|
27
|
+
* history, then called the rationale undocumented without searching
|
|
28
|
+
* memory. The instruction now names the missing reasoning step and its
|
|
29
|
+
* address: rationale/intent questions use mnemonik.memory_search inside
|
|
30
|
+
* memory_tools, paired with current-source inspection; conceptual code
|
|
31
|
+
* discovery uses code_search alongside exact Grep/Read. The accepted
|
|
32
|
+
* wording stays a compact startup floor, not a token-heavy tutorial or
|
|
33
|
+
* recurring nudge.
|
|
9
34
|
*
|
|
10
35
|
* v2.106 — Added a static "Which tool for what" floor map. Rides the already-
|
|
11
36
|
* cached instructions at near-zero cost and gives every agent a baseline
|
|
@@ -123,7 +148,7 @@ export declare function getMcpInstructions(): string;
|
|
|
123
148
|
* Raw instructions content (always returns the content, ignores env var).
|
|
124
149
|
* Use getMcpInstructions() for production code.
|
|
125
150
|
*/
|
|
126
|
-
export declare const MCP_INSTRUCTIONS_RAW = "If your context does not contain a block beginning \"PROJECT_CONTEXT schemaVersion=\", call session_bootstrap before replying or taking any other action \u2014 e.g. session_bootstrap({ cwd: \"/absolute/path/to/project\" }), where cwd is the real absolute path to the project root you are working in (required; the call fails without it \u2014 substitute your actual path, not the example). It loads this project's prior decisions, open tasks, and policies. If that block is already present, do not call session_bootstrap; the context is already loaded.\n\nLarge retrievals arrive as complete hydrated records plus exact pointer rows and extent/facet counts. Select relevant IDs and hydrate exact originals with mnemonik.memory_get({ memoryIds: [...], includeRaw: true }); refine the query or continue the index cursor when the visible index is incomplete\u2014do not page full bodies merely to discover what exists.\n\nProject work items and pending tasks live in mnemonik.tasks, not the host TaskList. A pending-task list requires mnemonik.tasks({ action:\"list\", status:\"pending\", ... }); never omit action:\"list\". If the request says pending, status:\"pending\" is required\u2014an unfiltered list is wrong. For in-progress, completed, or all-status requests, use the matching status or no status filter. Each list page is { hydrated, index, extent, cursor }, not { tasks }. When the user requests a complete or all-results list, collect [...page.hydrated, ...page.index] in one memory_tools program, repeat the same inner query with each returned cursor until cursor is null, then return compact id/title/status rows. Every row carries title, priority and status \u2014 hydrated and pointer alike; read them uniformly and never hydrate a body just to label it. Do not stop at the first retrieval envelope.\n\nWhich tool for what \u2014 reach past memory_search and checkpoint for these:\n- memory_add \u2014 persist a discrete decision or root cause the moment you make it; do not bury it in a checkpoint summary.\n- memory_state \u2014 a memory is wrong or outdated: supersede/deprecate/dispute it, do not add a competing copy.\n- memory_info \u2014 a memory looks suspect (low confidence, odd origin): investigate it before you act on or discard it.\n- memory_links \u2014 connect related decisions so they surface together.\n- assist \u2014 search results are thin or empty: check for coverage gaps.\n- search_summaries \u2014 find past work by topic or date across prior sessions.\n- policy \u2014 a durable rule or preference belongs here (enforced), not in a memory.\n- tasks \u2014 create follow-up work here, and close tasks when done so the pending list stays honest.";
|
|
151
|
+
export declare const MCP_INSTRUCTIONS_RAW = "If your context does not contain a block beginning \"PROJECT_CONTEXT schemaVersion=\", call session_bootstrap before replying or taking any other action \u2014 e.g. session_bootstrap({ cwd: \"/absolute/path/to/project\" }), where cwd is the real absolute path to the project root you are working in (required; the call fails without it \u2014 substitute your actual path, not the example). It loads this project's prior decisions, open tasks, and policies. If that block is already present, do not call session_bootstrap; the context is already loaded.\n\nTreat persistent memory as working knowledge: code and docs show current artifacts, git shows changes, and Mnemonik can remember why. For rationale or intent, search memory before relying on files or git history alone, then verify current source with Grep or Read; use code_search when concepts don't share the user's words. Exact call shapes load with the session context.\n\nLarge retrievals arrive as complete hydrated records plus exact pointer rows and extent/facet counts. Select relevant IDs and hydrate exact originals with mnemonik.memory_get({ memoryIds: [...], includeRaw: true }); refine the query or continue the index cursor when the visible index is incomplete\u2014do not page full bodies merely to discover what exists.\n\nProject work items and pending tasks live in mnemonik.tasks, not the host TaskList. A pending-task list requires mnemonik.tasks({ action:\"list\", status:\"pending\", ... }); never omit action:\"list\". If the request says pending, status:\"pending\" is required\u2014an unfiltered list is wrong. For in-progress, completed, or all-status requests, use the matching status or no status filter. Each list page is { hydrated, index, extent, cursor }, not { tasks }. When the user requests a complete or all-results list, collect [...page.hydrated, ...page.index] in one memory_tools program, repeat the same inner query with each returned cursor until cursor is null, then return compact id/title/status rows. Every row carries title, priority and status \u2014 hydrated and pointer alike; read them uniformly and never hydrate a body just to label it. Do not stop at the first retrieval envelope.\n\nWhich tool for what \u2014 reach past memory_search and checkpoint for these:\n- memory_add \u2014 persist a discrete decision or root cause the moment you make it; do not bury it in a checkpoint summary.\n- memory_state \u2014 a memory is wrong or outdated: supersede/deprecate/dispute it, do not add a competing copy.\n- memory_info \u2014 a memory looks suspect (low confidence, odd origin): investigate it before you act on or discard it.\n- memory_links \u2014 connect related decisions so they surface together.\n- assist \u2014 search results are thin or empty: check for coverage gaps.\n- search_summaries \u2014 find past work by topic or date across prior sessions.\n- policy \u2014 a durable rule or preference belongs here (enforced), not in a memory.\n- tasks \u2014 create follow-up work here, and close tasks when done so the pending list stays honest.";
|
|
127
152
|
/**
|
|
128
153
|
* Default export for convenience.
|
|
129
154
|
* Note: This respects the MNEMONIK_INSTRUCTIONS_ENABLED env var.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuIG;AAsBH;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAa3C;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,2/FAAuB,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAuB,CAAC"}
|
package/dist/instructions.js
CHANGED
|
@@ -4,8 +4,33 @@
|
|
|
4
4
|
* This is the SINGLE SOURCE OF TRUTH for MCP instructions.
|
|
5
5
|
* Shared instruction content imported by the server.
|
|
6
6
|
*
|
|
7
|
-
* Version: 2.
|
|
8
|
-
* Updated: 2026-
|
|
7
|
+
* Version: 2.109
|
|
8
|
+
* Updated: 2026-08-11
|
|
9
|
+
*
|
|
10
|
+
* v2.109 — Compressed the v2.108 memory-search clause. It restated, verbatim,
|
|
11
|
+
* the same search guidance carried by SESSION_OPENER_INSTRUCTION
|
|
12
|
+
* (bootstrapDigestRender.ts) — and both co-occur in the same agent
|
|
13
|
+
* session as the bootstrap digest's capabilities.search block, which
|
|
14
|
+
* already states the memory_search/code_search call signatures in
|
|
15
|
+
* full. Kept the essential behavior (memory holds the why; search it
|
|
16
|
+
* before assuming files or git history are the whole story; verify
|
|
17
|
+
* with Grep/Read; reach for code_search when concepts don't share
|
|
18
|
+
* the user's words), dropped the restated call shapes, and pointed at
|
|
19
|
+
* the session context's capabilities block for the exact signatures
|
|
20
|
+
* once it loads — this text fires at `initialize`, before any
|
|
21
|
+
* digest exists, so it cannot point "above" the way the trimmed
|
|
22
|
+
* SESSION_OPENER clause does. recall-first-class plan, Task A3
|
|
23
|
+
* rider (reviewer-flagged: character-for-character duplicate).
|
|
24
|
+
* v2.108 — Added front-loaded education that persistent project memory is part
|
|
25
|
+
* of the agent's working knowledge. A live Config-B fixture rejected
|
|
26
|
+
* the first generic invitation: the agent searched code, docs, and git
|
|
27
|
+
* history, then called the rationale undocumented without searching
|
|
28
|
+
* memory. The instruction now names the missing reasoning step and its
|
|
29
|
+
* address: rationale/intent questions use mnemonik.memory_search inside
|
|
30
|
+
* memory_tools, paired with current-source inspection; conceptual code
|
|
31
|
+
* discovery uses code_search alongside exact Grep/Read. The accepted
|
|
32
|
+
* wording stays a compact startup floor, not a token-heavy tutorial or
|
|
33
|
+
* recurring nudge.
|
|
9
34
|
*
|
|
10
35
|
* v2.106 — Added a static "Which tool for what" floor map. Rides the already-
|
|
11
36
|
* cached instructions at near-zero cost and gives every agent a baseline
|
|
@@ -113,6 +138,8 @@
|
|
|
113
138
|
// Config-A interpretation fallback when no hook/proxy guidance channel is available.
|
|
114
139
|
const INSTRUCTIONS_CONTENT = `If your context does not contain a block beginning "PROJECT_CONTEXT schemaVersion=", call session_bootstrap before replying or taking any other action — e.g. session_bootstrap({ cwd: "/absolute/path/to/project" }), where cwd is the real absolute path to the project root you are working in (required; the call fails without it — substitute your actual path, not the example). It loads this project's prior decisions, open tasks, and policies. If that block is already present, do not call session_bootstrap; the context is already loaded.
|
|
115
140
|
|
|
141
|
+
Treat persistent memory as working knowledge: code and docs show current artifacts, git shows changes, and Mnemonik can remember why. For rationale or intent, search memory before relying on files or git history alone, then verify current source with Grep or Read; use code_search when concepts don't share the user's words. Exact call shapes load with the session context.
|
|
142
|
+
|
|
116
143
|
Large retrievals arrive as complete hydrated records plus exact pointer rows and extent/facet counts. Select relevant IDs and hydrate exact originals with mnemonik.memory_get({ memoryIds: [...], includeRaw: true }); refine the query or continue the index cursor when the visible index is incomplete—do not page full bodies merely to discover what exists.
|
|
117
144
|
|
|
118
145
|
Project work items and pending tasks live in mnemonik.tasks, not the host TaskList. A pending-task list requires mnemonik.tasks({ action:"list", status:"pending", ... }); never omit action:"list". If the request says pending, status:"pending" is required—an unfiltered list is wrong. For in-progress, completed, or all-status requests, use the matching status or no status filter. Each list page is { hydrated, index, extent, cursor }, not { tasks }. When the user requests a complete or all-results list, collect [...page.hydrated, ...page.index] in one memory_tools program, repeat the same inner query with each returned cursor until cursor is null, then return compact id/title/status rows. Every row carries title, priority and status — hydrated and pointer alike; read them uniformly and never hydrate a body just to label it. Do not stop at the first retrieval envelope.
|
package/dist/instructions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuIG;AAEH,oFAAoF;AACpF,qFAAqF;AACrF,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;kGAgBqE,CAAC;AAEnG;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB;IAChC,0EAA0E;IAC1E,2EAA2E;IAC3E,+DAA+D;IAC/D,MAAM,OAAO,GAAI,UAAyE;SACvF,OAAO,CAAC;IACX,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IACD,IAAI,OAAO,CAAC,GAAG,CAAC,6BAA6B,KAAK,OAAO,EAAE,CAAC;QAC1D,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAEzD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,EAAE,CAAC"}
|
package/package.json
CHANGED
package/src/instructions.ts
CHANGED
|
@@ -4,8 +4,33 @@
|
|
|
4
4
|
* This is the SINGLE SOURCE OF TRUTH for MCP instructions.
|
|
5
5
|
* Shared instruction content imported by the server.
|
|
6
6
|
*
|
|
7
|
-
* Version: 2.
|
|
8
|
-
* Updated: 2026-
|
|
7
|
+
* Version: 2.109
|
|
8
|
+
* Updated: 2026-08-11
|
|
9
|
+
*
|
|
10
|
+
* v2.109 — Compressed the v2.108 memory-search clause. It restated, verbatim,
|
|
11
|
+
* the same search guidance carried by SESSION_OPENER_INSTRUCTION
|
|
12
|
+
* (bootstrapDigestRender.ts) — and both co-occur in the same agent
|
|
13
|
+
* session as the bootstrap digest's capabilities.search block, which
|
|
14
|
+
* already states the memory_search/code_search call signatures in
|
|
15
|
+
* full. Kept the essential behavior (memory holds the why; search it
|
|
16
|
+
* before assuming files or git history are the whole story; verify
|
|
17
|
+
* with Grep/Read; reach for code_search when concepts don't share
|
|
18
|
+
* the user's words), dropped the restated call shapes, and pointed at
|
|
19
|
+
* the session context's capabilities block for the exact signatures
|
|
20
|
+
* once it loads — this text fires at `initialize`, before any
|
|
21
|
+
* digest exists, so it cannot point "above" the way the trimmed
|
|
22
|
+
* SESSION_OPENER clause does. recall-first-class plan, Task A3
|
|
23
|
+
* rider (reviewer-flagged: character-for-character duplicate).
|
|
24
|
+
* v2.108 — Added front-loaded education that persistent project memory is part
|
|
25
|
+
* of the agent's working knowledge. A live Config-B fixture rejected
|
|
26
|
+
* the first generic invitation: the agent searched code, docs, and git
|
|
27
|
+
* history, then called the rationale undocumented without searching
|
|
28
|
+
* memory. The instruction now names the missing reasoning step and its
|
|
29
|
+
* address: rationale/intent questions use mnemonik.memory_search inside
|
|
30
|
+
* memory_tools, paired with current-source inspection; conceptual code
|
|
31
|
+
* discovery uses code_search alongside exact Grep/Read. The accepted
|
|
32
|
+
* wording stays a compact startup floor, not a token-heavy tutorial or
|
|
33
|
+
* recurring nudge.
|
|
9
34
|
*
|
|
10
35
|
* v2.106 — Added a static "Which tool for what" floor map. Rides the already-
|
|
11
36
|
* cached instructions at near-zero cost and gives every agent a baseline
|
|
@@ -114,6 +139,8 @@
|
|
|
114
139
|
// Config-A interpretation fallback when no hook/proxy guidance channel is available.
|
|
115
140
|
const INSTRUCTIONS_CONTENT = `If your context does not contain a block beginning "PROJECT_CONTEXT schemaVersion=", call session_bootstrap before replying or taking any other action — e.g. session_bootstrap({ cwd: "/absolute/path/to/project" }), where cwd is the real absolute path to the project root you are working in (required; the call fails without it — substitute your actual path, not the example). It loads this project's prior decisions, open tasks, and policies. If that block is already present, do not call session_bootstrap; the context is already loaded.
|
|
116
141
|
|
|
142
|
+
Treat persistent memory as working knowledge: code and docs show current artifacts, git shows changes, and Mnemonik can remember why. For rationale or intent, search memory before relying on files or git history alone, then verify current source with Grep or Read; use code_search when concepts don't share the user's words. Exact call shapes load with the session context.
|
|
143
|
+
|
|
117
144
|
Large retrievals arrive as complete hydrated records plus exact pointer rows and extent/facet counts. Select relevant IDs and hydrate exact originals with mnemonik.memory_get({ memoryIds: [...], includeRaw: true }); refine the query or continue the index cursor when the visible index is incomplete—do not page full bodies merely to discover what exists.
|
|
118
145
|
|
|
119
146
|
Project work items and pending tasks live in mnemonik.tasks, not the host TaskList. A pending-task list requires mnemonik.tasks({ action:"list", status:"pending", ... }); never omit action:"list". If the request says pending, status:"pending" is required—an unfiltered list is wrong. For in-progress, completed, or all-status requests, use the matching status or no status filter. Each list page is { hydrated, index, extent, cursor }, not { tasks }. When the user requests a complete or all-results list, collect [...page.hydrated, ...page.index] in one memory_tools program, repeat the same inner query with each returned cursor until cursor is null, then return compact id/title/status rows. Every row carries title, priority and status — hydrated and pointer alike; read them uniformly and never hydrate a body just to label it. Do not stop at the first retrieval envelope.
|