@mnemonik/shared 5.120.1 → 5.131.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/hookTimeouts.d.ts +14 -1
- package/dist/hookTimeouts.d.ts.map +1 -1
- package/dist/hookTimeouts.js +14 -1
- package/dist/hookTimeouts.js.map +1 -1
- package/dist/instructions.d.ts +22 -3
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +22 -3
- package/dist/instructions.js.map +1 -1
- package/package.json +1 -1
- package/src/hookTimeouts.ts +14 -1
- package/src/instructions.ts +22 -3
package/dist/hookTimeouts.d.ts
CHANGED
|
@@ -13,7 +13,20 @@
|
|
|
13
13
|
* function. No fetch wrappers here — request shaping stays per-package
|
|
14
14
|
* because each host expresses its hook payloads differently.
|
|
15
15
|
*/
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Snapshot / file-context / policy-reminder / injections fetch budget. Critical-path.
|
|
18
|
+
*
|
|
19
|
+
* The bootstrap digest is delivered over `injections`, so it rides this 2s
|
|
20
|
+
* budget. That is intentional and sufficient: the server side
|
|
21
|
+
* (HooksDispatcher.buildBootstrapDigestPayload) only ever does a Redis GET on
|
|
22
|
+
* the delivery path — a cold synthesis build is fired in the background
|
|
23
|
+
* (fire-and-forget) and never awaited, so delivery is always sub-10ms. A cold
|
|
24
|
+
* cache returns the static `session_bootstrap` directive within this budget
|
|
25
|
+
* (the "cold-prompt" floor), never a blocked/empty response.
|
|
26
|
+
*
|
|
27
|
+
* Invariant: no endpoint on a hook's critical path may await an LLM synthesis
|
|
28
|
+
* call; client timeouts here only ever need to cover a Redis/DB read.
|
|
29
|
+
*/
|
|
17
30
|
export declare const FETCH_TIMEOUT_MS = 2000;
|
|
18
31
|
/** Telemetry fan-out budget. Drop the metric rather than hold the user. */
|
|
19
32
|
export declare const TELEMETRY_TIMEOUT_MS = 500;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hookTimeouts.d.ts","sourceRoot":"","sources":["../src/hookTimeouts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH
|
|
1
|
+
{"version":3,"file":"hookTimeouts.d.ts","sourceRoot":"","sources":["../src/hookTimeouts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,2FAA2F;AAC3F,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,+GAA+G;AAC/G,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAIxF"}
|
package/dist/hookTimeouts.js
CHANGED
|
@@ -13,7 +13,20 @@
|
|
|
13
13
|
* function. No fetch wrappers here — request shaping stays per-package
|
|
14
14
|
* because each host expresses its hook payloads differently.
|
|
15
15
|
*/
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Snapshot / file-context / policy-reminder / injections fetch budget. Critical-path.
|
|
18
|
+
*
|
|
19
|
+
* The bootstrap digest is delivered over `injections`, so it rides this 2s
|
|
20
|
+
* budget. That is intentional and sufficient: the server side
|
|
21
|
+
* (HooksDispatcher.buildBootstrapDigestPayload) only ever does a Redis GET on
|
|
22
|
+
* the delivery path — a cold synthesis build is fired in the background
|
|
23
|
+
* (fire-and-forget) and never awaited, so delivery is always sub-10ms. A cold
|
|
24
|
+
* cache returns the static `session_bootstrap` directive within this budget
|
|
25
|
+
* (the "cold-prompt" floor), never a blocked/empty response.
|
|
26
|
+
*
|
|
27
|
+
* Invariant: no endpoint on a hook's critical path may await an LLM synthesis
|
|
28
|
+
* call; client timeouts here only ever need to cover a Redis/DB read.
|
|
29
|
+
*/
|
|
17
30
|
export const FETCH_TIMEOUT_MS = 2000;
|
|
18
31
|
/** Telemetry fan-out budget. Drop the metric rather than hold the user. */
|
|
19
32
|
export const TELEMETRY_TIMEOUT_MS = 500;
|
package/dist/hookTimeouts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hookTimeouts.js","sourceRoot":"","sources":["../src/hookTimeouts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH
|
|
1
|
+
{"version":3,"file":"hookTimeouts.js","sourceRoot":"","sources":["../src/hookTimeouts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAErC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAExC,2FAA2F;AAC3F,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC,+GAA+G;AAC/G,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,EAAU;IACxC,MAAM,EAAE,GAAG,IAAI,eAAe,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/C,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;AACnE,CAAC"}
|
package/dist/instructions.d.ts
CHANGED
|
@@ -4,8 +4,27 @@
|
|
|
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-06-
|
|
7
|
+
* Version: 2.102
|
|
8
|
+
* Updated: 2026-06-29
|
|
9
|
+
*
|
|
10
|
+
* v2.102 — Strengthened the self-bootstrap trigger to a compelling imperative.
|
|
11
|
+
* The v2.101 phrasing ("At the start of a session, unless ... call ...")
|
|
12
|
+
* was too soft; agents on a blind first turn skipped it. Real-world hole
|
|
13
|
+
* it must cover: Cursor's FIRST chat after an IDE open fires no
|
|
14
|
+
* sessionStart (confirmed by hook-stdin capture), and beforeSubmitPrompt
|
|
15
|
+
* has NO model-facing output field (only user_message, shown to the
|
|
16
|
+
* human) — so neither the silent digest nor the hook's
|
|
17
|
+
* session_bootstrap_required directive reaches the model. The MCP
|
|
18
|
+
* instruction is the ONLY model-facing channel left for that turn, so it
|
|
19
|
+
* now leads with the blind-state check + a hard "FIRST action MUST be
|
|
20
|
+
* session_bootstrap, before you reply" and an explicit cwd-REQUIRED
|
|
21
|
+
* clause. Still self-scoping: skips when the "Mnemonik project context"
|
|
22
|
+
* block is already present (working hook/proxy delivery), so config-B/C
|
|
23
|
+
* with live delivery don't double-call. cwd stays host-agnostic — the
|
|
24
|
+
* agent passes the project root it is working in (Cursor exposes the
|
|
25
|
+
* working dir to HOOKS via the stdin `workspace_roots[0]`, which cwdOf
|
|
26
|
+
* already reads; it is NOT an agent-readable env var, so the instruction
|
|
27
|
+
* must not name one).
|
|
9
28
|
*
|
|
10
29
|
* v2.101 — Stripped to a single instruction: the session_bootstrap trigger.
|
|
11
30
|
* MCP instructions are set at Server construction (initialize), before
|
|
@@ -77,7 +96,7 @@ export declare function getMcpInstructions(): string;
|
|
|
77
96
|
* Raw instructions content (always returns the content, ignores env var).
|
|
78
97
|
* Use getMcpInstructions() for production code.
|
|
79
98
|
*/
|
|
80
|
-
export declare const MCP_INSTRUCTIONS_RAW = "
|
|
99
|
+
export declare const MCP_INSTRUCTIONS_RAW = "If your context does not contain a block beginning \"Mnemonik project context (cached\", 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.";
|
|
81
100
|
/**
|
|
82
101
|
* Default export for convenience.
|
|
83
102
|
* 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AAIH;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,+iBAAuB,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAuB,CAAC"}
|
package/dist/instructions.js
CHANGED
|
@@ -4,8 +4,27 @@
|
|
|
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-06-
|
|
7
|
+
* Version: 2.102
|
|
8
|
+
* Updated: 2026-06-29
|
|
9
|
+
*
|
|
10
|
+
* v2.102 — Strengthened the self-bootstrap trigger to a compelling imperative.
|
|
11
|
+
* The v2.101 phrasing ("At the start of a session, unless ... call ...")
|
|
12
|
+
* was too soft; agents on a blind first turn skipped it. Real-world hole
|
|
13
|
+
* it must cover: Cursor's FIRST chat after an IDE open fires no
|
|
14
|
+
* sessionStart (confirmed by hook-stdin capture), and beforeSubmitPrompt
|
|
15
|
+
* has NO model-facing output field (only user_message, shown to the
|
|
16
|
+
* human) — so neither the silent digest nor the hook's
|
|
17
|
+
* session_bootstrap_required directive reaches the model. The MCP
|
|
18
|
+
* instruction is the ONLY model-facing channel left for that turn, so it
|
|
19
|
+
* now leads with the blind-state check + a hard "FIRST action MUST be
|
|
20
|
+
* session_bootstrap, before you reply" and an explicit cwd-REQUIRED
|
|
21
|
+
* clause. Still self-scoping: skips when the "Mnemonik project context"
|
|
22
|
+
* block is already present (working hook/proxy delivery), so config-B/C
|
|
23
|
+
* with live delivery don't double-call. cwd stays host-agnostic — the
|
|
24
|
+
* agent passes the project root it is working in (Cursor exposes the
|
|
25
|
+
* working dir to HOOKS via the stdin `workspace_roots[0]`, which cwdOf
|
|
26
|
+
* already reads; it is NOT an agent-readable env var, so the instruction
|
|
27
|
+
* must not name one).
|
|
9
28
|
*
|
|
10
29
|
* v2.101 — Stripped to a single instruction: the session_bootstrap trigger.
|
|
11
30
|
* MCP instructions are set at Server construction (initialize), before
|
|
@@ -63,7 +82,7 @@
|
|
|
63
82
|
*
|
|
64
83
|
* Token-optimised rewrite (superseded by later instruction rewrites).
|
|
65
84
|
*/
|
|
66
|
-
const INSTRUCTIONS_CONTENT = `
|
|
85
|
+
const INSTRUCTIONS_CONTENT = `If your context does not contain a block beginning "Mnemonik project context (cached", 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.`;
|
|
67
86
|
/**
|
|
68
87
|
* Get MCP instructions, respecting MNEMONIK_INSTRUCTIONS_ENABLED env var.
|
|
69
88
|
* Set MNEMONIK_INSTRUCTIONS_ENABLED=false to disable for testing.
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AAEH,MAAM,oBAAoB,GAAG,8hBAA8hB,CAAC;AAE5jB;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,GAAG,GAAI,UAAyE,CAAC,OAAO;QAC5F,EAAE,GAAG,CAAC;IACR,IAAI,GAAG,EAAE,6BAA6B,KAAK,OAAO,EAAE,CAAC;QACnD,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/hookTimeouts.ts
CHANGED
|
@@ -14,7 +14,20 @@
|
|
|
14
14
|
* because each host expresses its hook payloads differently.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Snapshot / file-context / policy-reminder / injections fetch budget. Critical-path.
|
|
19
|
+
*
|
|
20
|
+
* The bootstrap digest is delivered over `injections`, so it rides this 2s
|
|
21
|
+
* budget. That is intentional and sufficient: the server side
|
|
22
|
+
* (HooksDispatcher.buildBootstrapDigestPayload) only ever does a Redis GET on
|
|
23
|
+
* the delivery path — a cold synthesis build is fired in the background
|
|
24
|
+
* (fire-and-forget) and never awaited, so delivery is always sub-10ms. A cold
|
|
25
|
+
* cache returns the static `session_bootstrap` directive within this budget
|
|
26
|
+
* (the "cold-prompt" floor), never a blocked/empty response.
|
|
27
|
+
*
|
|
28
|
+
* Invariant: no endpoint on a hook's critical path may await an LLM synthesis
|
|
29
|
+
* call; client timeouts here only ever need to cover a Redis/DB read.
|
|
30
|
+
*/
|
|
18
31
|
export const FETCH_TIMEOUT_MS = 2000;
|
|
19
32
|
|
|
20
33
|
/** Telemetry fan-out budget. Drop the metric rather than hold the user. */
|
package/src/instructions.ts
CHANGED
|
@@ -4,8 +4,27 @@
|
|
|
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-06-
|
|
7
|
+
* Version: 2.102
|
|
8
|
+
* Updated: 2026-06-29
|
|
9
|
+
*
|
|
10
|
+
* v2.102 — Strengthened the self-bootstrap trigger to a compelling imperative.
|
|
11
|
+
* The v2.101 phrasing ("At the start of a session, unless ... call ...")
|
|
12
|
+
* was too soft; agents on a blind first turn skipped it. Real-world hole
|
|
13
|
+
* it must cover: Cursor's FIRST chat after an IDE open fires no
|
|
14
|
+
* sessionStart (confirmed by hook-stdin capture), and beforeSubmitPrompt
|
|
15
|
+
* has NO model-facing output field (only user_message, shown to the
|
|
16
|
+
* human) — so neither the silent digest nor the hook's
|
|
17
|
+
* session_bootstrap_required directive reaches the model. The MCP
|
|
18
|
+
* instruction is the ONLY model-facing channel left for that turn, so it
|
|
19
|
+
* now leads with the blind-state check + a hard "FIRST action MUST be
|
|
20
|
+
* session_bootstrap, before you reply" and an explicit cwd-REQUIRED
|
|
21
|
+
* clause. Still self-scoping: skips when the "Mnemonik project context"
|
|
22
|
+
* block is already present (working hook/proxy delivery), so config-B/C
|
|
23
|
+
* with live delivery don't double-call. cwd stays host-agnostic — the
|
|
24
|
+
* agent passes the project root it is working in (Cursor exposes the
|
|
25
|
+
* working dir to HOOKS via the stdin `workspace_roots[0]`, which cwdOf
|
|
26
|
+
* already reads; it is NOT an agent-readable env var, so the instruction
|
|
27
|
+
* must not name one).
|
|
9
28
|
*
|
|
10
29
|
* v2.101 — Stripped to a single instruction: the session_bootstrap trigger.
|
|
11
30
|
* MCP instructions are set at Server construction (initialize), before
|
|
@@ -64,7 +83,7 @@
|
|
|
64
83
|
* Token-optimised rewrite (superseded by later instruction rewrites).
|
|
65
84
|
*/
|
|
66
85
|
|
|
67
|
-
const INSTRUCTIONS_CONTENT = `
|
|
86
|
+
const INSTRUCTIONS_CONTENT = `If your context does not contain a block beginning "Mnemonik project context (cached", 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.`;
|
|
68
87
|
|
|
69
88
|
/**
|
|
70
89
|
* Get MCP instructions, respecting MNEMONIK_INSTRUCTIONS_ENABLED env var.
|