@gramatr/mcp 0.10.18 → 0.11.1

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 (71) hide show
  1. package/dist/bin/hook-dispatcher.d.ts.map +1 -1
  2. package/dist/bin/hook-dispatcher.js +15 -0
  3. package/dist/bin/hook-dispatcher.js.map +1 -1
  4. package/dist/bin/setup-config-io.js +1 -1
  5. package/dist/bin/setup-config-io.js.map +1 -1
  6. package/dist/bin/setup-shared.d.ts +1 -2
  7. package/dist/bin/setup-shared.d.ts.map +1 -1
  8. package/dist/bin/setup-shared.js +1 -9
  9. package/dist/bin/setup-shared.js.map +1 -1
  10. package/dist/bin/setup.d.ts.map +1 -1
  11. package/dist/bin/setup.js +2 -2
  12. package/dist/bin/setup.js.map +1 -1
  13. package/dist/hooks/generated/hook-registry.d.ts +23 -0
  14. package/dist/hooks/generated/hook-registry.d.ts.map +1 -0
  15. package/dist/hooks/generated/hook-registry.js +61 -0
  16. package/dist/hooks/generated/hook-registry.js.map +1 -0
  17. package/dist/hooks/index.d.ts +3 -0
  18. package/dist/hooks/index.d.ts.map +1 -1
  19. package/dist/hooks/index.js +3 -0
  20. package/dist/hooks/index.js.map +1 -1
  21. package/dist/hooks/instructions-loaded.d.ts +30 -0
  22. package/dist/hooks/instructions-loaded.d.ts.map +1 -0
  23. package/dist/hooks/instructions-loaded.js +205 -0
  24. package/dist/hooks/instructions-loaded.js.map +1 -0
  25. package/dist/hooks/lib/hook-state.d.ts.map +1 -1
  26. package/dist/hooks/lib/hook-state.js +3 -2
  27. package/dist/hooks/lib/hook-state.js.map +1 -1
  28. package/dist/hooks/manifest.d.ts +6 -36
  29. package/dist/hooks/manifest.d.ts.map +1 -1
  30. package/dist/hooks/manifest.js +6 -47
  31. package/dist/hooks/manifest.js.map +1 -1
  32. package/dist/hooks/subagent-route.d.ts +22 -0
  33. package/dist/hooks/subagent-route.d.ts.map +1 -0
  34. package/dist/hooks/subagent-route.js +95 -0
  35. package/dist/hooks/subagent-route.js.map +1 -0
  36. package/dist/hooks/task-quality-gate.d.ts +50 -0
  37. package/dist/hooks/task-quality-gate.d.ts.map +1 -0
  38. package/dist/hooks/task-quality-gate.js +175 -0
  39. package/dist/hooks/task-quality-gate.js.map +1 -0
  40. package/dist/proxy/local-client.d.ts +18 -15
  41. package/dist/proxy/local-client.d.ts.map +1 -1
  42. package/dist/proxy/local-client.js +54 -37
  43. package/dist/proxy/local-client.js.map +1 -1
  44. package/dist/setup/generated/instruction-blocks.d.ts +3 -3
  45. package/dist/setup/generated/instruction-blocks.d.ts.map +1 -1
  46. package/dist/setup/generated/instruction-blocks.js +3 -3
  47. package/dist/setup/generated/instruction-blocks.js.map +1 -1
  48. package/dist/setup/generated/platform-guidance.d.ts +39 -0
  49. package/dist/setup/generated/platform-guidance.d.ts.map +1 -0
  50. package/dist/setup/generated/platform-guidance.js +27 -0
  51. package/dist/setup/generated/platform-guidance.js.map +1 -0
  52. package/dist/setup/generated/platform-hooks.d.ts +4 -4
  53. package/dist/setup/generated/platform-hooks.d.ts.map +1 -1
  54. package/dist/setup/generated/platform-hooks.js +79 -27
  55. package/dist/setup/generated/platform-hooks.js.map +1 -1
  56. package/dist/setup/instructions.d.ts +4 -4
  57. package/dist/setup/instructions.d.ts.map +1 -1
  58. package/dist/setup/instructions.js +14 -16
  59. package/dist/setup/instructions.js.map +1 -1
  60. package/dist/setup/integrations.d.ts +9 -0
  61. package/dist/setup/integrations.d.ts.map +1 -1
  62. package/dist/setup/integrations.js +17 -1
  63. package/dist/setup/integrations.js.map +1 -1
  64. package/dist/setup/platform.d.ts +1 -1
  65. package/dist/setup/platform.js +1 -1
  66. package/package.json +4 -6
  67. package/scripts/postinstall.mjs +4 -0
  68. package/dist/__mocks__/bun-sqlite.d.ts +0 -34
  69. package/dist/__mocks__/bun-sqlite.d.ts.map +0 -1
  70. package/dist/__mocks__/bun-sqlite.js +0 -103
  71. package/dist/__mocks__/bun-sqlite.js.map +0 -1
@@ -0,0 +1,175 @@
1
+ /**
2
+ * task-quality-gate.ts — TaskCreated hook.
3
+ *
4
+ * Fires before a TaskCreate tool call is accepted. Reads the `tool_input`
5
+ * from stdin, extracts the Quality Gate criteria fields, and validates:
6
+ * 1. At least 4 criteria are present.
7
+ * 2. Each criterion is 8-12 words long.
8
+ * 3. At least 1 anti-criterion is present — identified by the criterion
9
+ * text containing "NOT" / "must not" / "anti-criterion", or an ID
10
+ * matching /^QG-A/ or /^ISC-A/.
11
+ *
12
+ * Output contract mirrors PreToolUse:
13
+ * { hookSpecificOutput: { hookEventName: 'TaskCreated', permissionDecision: 'allow' } }
14
+ * { hookSpecificOutput: { hookEventName: 'TaskCreated', permissionDecision: 'deny', permissionDecisionReason: ... } }
15
+ *
16
+ * To maximise compatibility with different Claude Code versions, the hook
17
+ * also emits `{ continue: true|false, stopReason }` alongside the structured
18
+ * permission block — unrecognised fields are ignored by clients that use
19
+ * one contract and not the other.
20
+ *
21
+ * Graceful degradation: any internal parse error outputs `continue: true`
22
+ * so a hook failure never blocks task creation.
23
+ */
24
+ import { HOOK_STDIN_DEFAULT_TIMEOUT_MS } from './generated/hook-timeouts.js';
25
+ // ── Constants ──
26
+ const MIN_CRITERIA = 4;
27
+ const MIN_WORDS = 8;
28
+ const MAX_WORDS = 12;
29
+ const DENY_MESSAGE = [
30
+ 'Quality Gate criteria required before creating a task.',
31
+ 'Format:',
32
+ ` - Minimum ${MIN_CRITERIA} criteria, ${MIN_WORDS}-${MAX_WORDS} words each, describing the ideal end STATE (not actions)`,
33
+ ' - At least 1 anti-criterion: what must NOT happen',
34
+ '',
35
+ 'Example:',
36
+ ' QG-C1: "Rate limiter enforces 100 requests per minute per user"',
37
+ ' QG-A1: "No request is silently dropped without a logged error"',
38
+ '',
39
+ 'Call TaskCreate again with criteria in the description or quality_gate_criteria field.',
40
+ ].join('\n');
41
+ // ── Stdin ──
42
+ function readStdin(timeoutMs) {
43
+ return new Promise((resolve) => {
44
+ let data = '';
45
+ const timer = setTimeout(() => resolve(data), timeoutMs);
46
+ process.stdin.setEncoding('utf-8');
47
+ process.stdin.on('data', (chunk) => {
48
+ data += chunk;
49
+ });
50
+ process.stdin.on('end', () => {
51
+ clearTimeout(timer);
52
+ resolve(data);
53
+ });
54
+ process.stdin.on('error', () => {
55
+ clearTimeout(timer);
56
+ resolve(data);
57
+ });
58
+ process.stdin.resume();
59
+ });
60
+ }
61
+ // ── Criterion extraction ──
62
+ const ANTI_ID_PATTERN = /^(QG-A|ISC-A)/i;
63
+ const ANTI_TEXT_PATTERNS = [
64
+ /\bNOT\b/,
65
+ /must not\b/i,
66
+ /anti-criterion/i,
67
+ /never\b/i,
68
+ ];
69
+ export function isAntiCriterion(c) {
70
+ if (c.is_anti === true)
71
+ return true;
72
+ if (typeof c.type === 'string' && c.type.toLowerCase().includes('anti'))
73
+ return true;
74
+ if (typeof c.id === 'string' && ANTI_ID_PATTERN.test(c.id))
75
+ return true;
76
+ const text = c.text || c.description || c.criterion || '';
77
+ return ANTI_TEXT_PATTERNS.some((r) => r.test(text));
78
+ }
79
+ export function criterionText(c) {
80
+ return (c.text || c.description || c.criterion || '').trim();
81
+ }
82
+ export function wordCount(text) {
83
+ if (!text)
84
+ return 0;
85
+ return text.trim().split(/\s+/).filter(Boolean).length;
86
+ }
87
+ /**
88
+ * Extract criteria from the TaskCreate tool_input. Accepts multiple shapes so
89
+ * the hook is tolerant of evolving TaskCreate schemas:
90
+ * - `quality_gate_criteria`: array of strings or objects
91
+ * - `criteria`: array of strings or objects
92
+ * - `acceptance_criteria`: array of strings or objects
93
+ */
94
+ export function extractCriteria(toolInput) {
95
+ if (!toolInput || typeof toolInput !== 'object')
96
+ return [];
97
+ const keys = ['quality_gate_criteria', 'criteria', 'acceptance_criteria'];
98
+ for (const key of keys) {
99
+ const value = toolInput[key];
100
+ if (Array.isArray(value) && value.length > 0) {
101
+ return value.map((v) => {
102
+ if (typeof v === 'string')
103
+ return { text: v };
104
+ if (v && typeof v === 'object')
105
+ return v;
106
+ return { text: String(v) };
107
+ });
108
+ }
109
+ }
110
+ return [];
111
+ }
112
+ // ── Validation ──
113
+ export function validateQualityGate(toolInput) {
114
+ const criteria = extractCriteria(toolInput);
115
+ if (criteria.length < MIN_CRITERIA) {
116
+ return { allow: false, reason: DENY_MESSAGE };
117
+ }
118
+ // Every criterion must be 8-12 words.
119
+ for (const c of criteria) {
120
+ const words = wordCount(criterionText(c));
121
+ if (words < MIN_WORDS || words > MAX_WORDS) {
122
+ return { allow: false, reason: DENY_MESSAGE };
123
+ }
124
+ }
125
+ // At least one anti-criterion must be present.
126
+ if (!criteria.some(isAntiCriterion)) {
127
+ return { allow: false, reason: DENY_MESSAGE };
128
+ }
129
+ return { allow: true };
130
+ }
131
+ function buildOutput(allow, reason) {
132
+ if (allow) {
133
+ return {
134
+ continue: true,
135
+ hookSpecificOutput: { hookEventName: 'TaskCreated', permissionDecision: 'allow' },
136
+ };
137
+ }
138
+ return {
139
+ continue: false,
140
+ stopReason: reason || 'Quality Gate validation failed.',
141
+ hookSpecificOutput: {
142
+ hookEventName: 'TaskCreated',
143
+ permissionDecision: 'deny',
144
+ permissionDecisionReason: reason || 'Quality Gate validation failed.',
145
+ },
146
+ };
147
+ }
148
+ // ── Hook runner ──
149
+ export async function runTaskQualityGateHook(_args = []) {
150
+ const raw = await readStdin(HOOK_STDIN_DEFAULT_TIMEOUT_MS);
151
+ if (!raw.trim()) {
152
+ process.stdout.write(JSON.stringify(buildOutput(true)));
153
+ return 0;
154
+ }
155
+ try {
156
+ const input = JSON.parse(raw);
157
+ // Only gate TaskCreate — any other tool is allowed through unchanged.
158
+ if (!input.tool_name || input.tool_name !== 'TaskCreate') {
159
+ process.stdout.write(JSON.stringify(buildOutput(true)));
160
+ return 0;
161
+ }
162
+ const decision = validateQualityGate(input.tool_input);
163
+ if (!decision.allow && decision.reason) {
164
+ // Write the guidance to stderr too so the user sees it in the terminal.
165
+ process.stderr.write(decision.reason + '\n');
166
+ }
167
+ process.stdout.write(JSON.stringify(buildOutput(decision.allow, decision.reason)));
168
+ }
169
+ catch {
170
+ // Never block on hook failures.
171
+ process.stdout.write(JSON.stringify(buildOutput(true)));
172
+ }
173
+ return 0;
174
+ }
175
+ //# sourceMappingURL=task-quality-gate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-quality-gate.js","sourceRoot":"","sources":["../../src/hooks/task-quality-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAuB7E,kBAAkB;AAElB,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,MAAM,YAAY,GAAG;IACnB,wDAAwD;IACxD,SAAS;IACT,eAAe,YAAY,cAAc,SAAS,IAAI,SAAS,2DAA2D;IAC1H,qDAAqD;IACrD,EAAE;IACF,UAAU;IACV,mEAAmE;IACnE,kEAAkE;IAClE,EAAE;IACF,wFAAwF;CACzF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,cAAc;AAEd,SAAS,SAAS,CAAC,SAAiB;IAClC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;QACzD,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE;YACzC,IAAI,IAAI,KAAK,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YAC3B,YAAY,CAAC,KAAK,CA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,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACxD,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAc,CAAC;QAE3C,sEAAsE;QACtE,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,KAAK,YAAY,EAAE,CAAC;YACzD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACxD,OAAO,CAAC,CAAC;QACX,CAAC;QAED,MAAM,QAAQ,GAAG,mBAAmB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACvD,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACvC,wEAAwE;YACxE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrF,CAAC;IAAC,MAAM,CAAC;QACP,gCAAgC;QAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -1,24 +1,27 @@
1
1
  /**
2
- * local-client.ts — Hook-side client for gramatr tool calls.
2
+ * local-client.ts — Hook-side MCP client.
3
3
  *
4
- * Hooks call gramatr tools through the proxyToolCall pipeline, which provides
5
- * validation, session management, caching, offline queue, and the
6
- * gmtr.tool.result.v1 envelope. The compiled binary IS the local MCP server —
7
- * all tools look local to the consumer.
4
+ * Spawns `npx -y @gramatr/mcp` via the MCP stdio transport so hooks call
5
+ * gramatr tools through the same server that Claude Code uses. Auth and
6
+ * session state are handled by that server process (reads from
7
+ * ~/.gramatr/settings.json). No direct HTTP calls or in-process proxy.
8
8
  *
9
- * Session context (project_id, interaction_id) is managed locally via SQLite
10
- * in hook-state.ts. pushSessionContextToLocal / pullSessionContextFromLocal
11
- * are retained as no-ops for call-site compatibility while the port IPC is removed.
9
+ * Connection is lazy-initialized on first callTool and reused for the
10
+ * lifetime of the hook process. Falls back to an error result (never
11
+ * throws) so hooks always degrade gracefully when the server is unavailable.
12
+ *
13
+ * pushSessionContextToLocal / pullSessionContextFromLocal are retained as
14
+ * no-ops for call-site compatibility.
12
15
  */
13
- import { type ToolCallResult } from './tool-proxy.js';
14
- /** Always true the proxy pipeline is available in-process. */
16
+ import type { ToolCallResult } from './tool-proxy.js';
17
+ export type { ToolCallResult };
18
+ /** Reset singleton for testing. Not for production use. */
19
+ export declare function _resetClientForTest(): void;
20
+ /** Always true — the stdio server is available on demand via npx. */
15
21
  export declare function isLocalHooksServerAvailable(): boolean;
16
22
  /**
17
- * Call a gramatr tool through the proxy pipeline.
18
- *
19
- * Lazy-loads the tool registry on first call. If the registry fails to load
20
- * (offline/unavailable) and proxyToolCall returns an "Unknown tool" error,
21
- * falls back to callRemoteTool directly to preserve current behavior.
23
+ * Call a gramatr tool via the local MCP stdio server.
24
+ * Never throws — returns an isError result on failure so hooks degrade gracefully.
22
25
  */
23
26
  export declare function callTool(name: string, args: Record<string, unknown>): Promise<ToolCallResult>;
24
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"local-client.d.ts","sourceRoot":"","sources":["../../src/proxy/local-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMrE,gEAAgE;AAChE,wBAAgB,2BAA2B,IAAI,OAAO,CAErD;AAED;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,cAAc,CAAC,CAwBzB;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAE/E;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAEzC"}
1
+ {"version":3,"file":"local-client.d.ts","sourceRoot":"","sources":["../../src/proxy/local-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,YAAY,EAAE,cAAc,EAAE,CAAC;AAQ/B,2DAA2D;AAC3D,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAyBD,qEAAqE;AACrE,wBAAgB,2BAA2B,IAAI,OAAO,CAErD;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,cAAc,CAAC,CAYzB;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAE/E;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAEzC"}
@@ -1,52 +1,69 @@
1
1
  /**
2
- * local-client.ts — Hook-side client for gramatr tool calls.
2
+ * local-client.ts — Hook-side MCP client.
3
3
  *
4
- * Hooks call gramatr tools through the proxyToolCall pipeline, which provides
5
- * validation, session management, caching, offline queue, and the
6
- * gmtr.tool.result.v1 envelope. The compiled binary IS the local MCP server —
7
- * all tools look local to the consumer.
4
+ * Spawns `npx -y @gramatr/mcp` via the MCP stdio transport so hooks call
5
+ * gramatr tools through the same server that Claude Code uses. Auth and
6
+ * session state are handled by that server process (reads from
7
+ * ~/.gramatr/settings.json). No direct HTTP calls or in-process proxy.
8
8
  *
9
- * Session context (project_id, interaction_id) is managed locally via SQLite
10
- * in hook-state.ts. pushSessionContextToLocal / pullSessionContextFromLocal
11
- * are retained as no-ops for call-site compatibility while the port IPC is removed.
9
+ * Connection is lazy-initialized on first callTool and reused for the
10
+ * lifetime of the hook process. Falls back to an error result (never
11
+ * throws) so hooks always degrade gracefully when the server is unavailable.
12
+ *
13
+ * pushSessionContextToLocal / pullSessionContextFromLocal are retained as
14
+ * no-ops for call-site compatibility.
12
15
  */
13
- import { proxyToolCall } from './tool-proxy.js';
14
- import { loadRemoteTools } from './tool-registry.js';
15
- import { callRemoteTool } from './remote-client.js';
16
- let registryLoaded = false;
17
- /** Always true — the proxy pipeline is available in-process. */
16
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
17
+ import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
18
+ const SERVER_COMMAND = 'npx';
19
+ const SERVER_ARGS = ['-y', '@gramatr/mcp'];
20
+ let _client = null;
21
+ let _connecting = null;
22
+ /** Reset singleton for testing. Not for production use. */
23
+ export function _resetClientForTest() {
24
+ _client = null;
25
+ _connecting = null;
26
+ }
27
+ async function getClient() {
28
+ if (_client)
29
+ return _client;
30
+ if (_connecting)
31
+ return _connecting;
32
+ _connecting = (async () => {
33
+ const transport = new StdioClientTransport({
34
+ command: SERVER_COMMAND,
35
+ args: SERVER_ARGS,
36
+ stderr: 'inherit',
37
+ });
38
+ const client = new Client({ name: 'gramatr-hook', version: '1.0.0' }, { capabilities: {} });
39
+ await client.connect(transport);
40
+ _client = client;
41
+ _connecting = null;
42
+ return client;
43
+ })();
44
+ return _connecting;
45
+ }
46
+ /** Always true — the stdio server is available on demand via npx. */
18
47
  export function isLocalHooksServerAvailable() {
19
48
  return true;
20
49
  }
21
50
  /**
22
- * Call a gramatr tool through the proxy pipeline.
23
- *
24
- * Lazy-loads the tool registry on first call. If the registry fails to load
25
- * (offline/unavailable) and proxyToolCall returns an "Unknown tool" error,
26
- * falls back to callRemoteTool directly to preserve current behavior.
51
+ * Call a gramatr tool via the local MCP stdio server.
52
+ * Never throws — returns an isError result on failure so hooks degrade gracefully.
27
53
  */
28
54
  export async function callTool(name, args) {
29
- // Lazy-init: load tool registry on first call
30
- if (!registryLoaded) {
31
- try {
32
- await loadRemoteTools();
33
- registryLoaded = true;
34
- }
35
- catch {
36
- // Registry unavailable (offline?) — fall through to proxyToolCall
37
- // which will handle unknown tools gracefully
38
- }
55
+ try {
56
+ const client = await getClient();
57
+ const result = await client.callTool({ name, arguments: args });
58
+ return result;
39
59
  }
40
- const result = await proxyToolCall(name, args);
41
- // Safety net: if registry never loaded and proxy rejected as unknown tool,
42
- // fall back to direct remote call to preserve current behavior
43
- if (!registryLoaded && result.isError) {
44
- const text = result.content?.[0]?.text ?? '';
45
- if (text.includes('Unknown tool')) {
46
- return (await callRemoteTool(name, args));
47
- }
60
+ catch (err) {
61
+ const message = err instanceof Error ? err.message : String(err);
62
+ return {
63
+ content: [{ type: 'text', text: `gramatr hook: tool call failed — ${message}` }],
64
+ isError: true,
65
+ };
48
66
  }
49
- return result;
50
67
  }
51
68
  /**
52
69
  * No-op — session context is persisted to SQLite via setSessionContext in hook-state.ts.
@@ -1 +1 @@
1
- {"version":3,"file":"local-client.js","sourceRoot":"","sources":["../../src/proxy/local-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAuB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,IA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AE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAChE,OAAO,MAAwB,CAAC;IAClC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oCAAoC,OAAO,EAAE,EAAE,CAAC;YAChF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,IAAa;IAC3D,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,UAAkB;IAElB,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * AUTO-GENERATED — do not edit manually.
3
3
  * Source: contracts/methodology/instruction-blocks.yaml
4
4
  * Generator: contracts/generator/generate.ts
5
- * Generated: 2026-04-20T02:16:11.206Z
5
+ * Generated: 2026-04-20T19:51:45.600Z
6
6
  */
7
7
  /** Mandatory contract fields from the v2 intelligence packet */
8
8
  export declare const CONTRACT_RULES = "**Mandatory contract fields \u2014 treat as execution requirements:**\n- `directives.hard_gates` \u2014 non-negotiable behavioral constraints\n- `directives.behavioral_rules` \u2014 algorithm phases, code rules, safety rules\n- `directives.behavioral_directives` \u2014 per-turn instructions from the classifier\n- `process.phase_template` \u2014 effort-gated phase sequence (MUST follow)\n- `process.quality_gate_config` \u2014 Quality Gate verification rules (MUST pass before done)\n- `enrichment.data.reasoning` \u2014 RE + Quality Gate scaffold when present (MUST consume)";
@@ -11,7 +11,7 @@ export declare const MEMORY_RULES = "**Memory:** Use gramatr MCP tools (`search_
11
11
  /** Required metadata fields for key entity types */
12
12
  export declare const REQUIRED_FIELDS = "**Required fields:** task/milestone: status (open|in_progress|blocked|review|done).\nDecision: status + project_id. Session: status + project_id.";
13
13
  /** Mandatory Quality Gate creation before any non-instant work — NO EXCEPTIONS */
14
- export declare const ISC_REQUIREMENT = "**QUALITY GATE REQUIREMENT \u2014 NO EXCEPTIONS:**\nBefore ANY non-instant work, you MUST call TaskCreate with Quality Gate\ncriteria. This is not optional. You do not get to decide \"this is too\nsmall\" or \"this would slow things down.\" Every task gets Quality Gate\ncriteria (minimum 4, 8-12 words each, state not action) plus at least 1\nanti-criterion (ISC-A). After work, TaskUpdate each criterion with\nPASS/FAIL and specific evidence. Skipping this violates a hard gate.";
14
+ export declare const QUALITY_GATE_REQUIREMENT = "**QUALITY GATE REQUIREMENT \u2014 NO EXCEPTIONS:**\nBefore ANY non-instant work, you MUST call TaskCreate with Quality Gate\ncriteria. This is not optional. You do not get to decide \"this is too\nsmall\" or \"this would slow things down.\" Every task gets Quality Gate\ncriteria (minimum 4, 8-12 words each, state not action) plus at least 1\nanti-criterion (QG-A). After work, TaskUpdate each criterion with\nPASS/FAIL and specific evidence. Skipping this violates a hard gate.";
15
15
  /** Mandatory feedback loop for classifier training */
16
16
  export declare const FEEDBACK_RULES = "**Feedback loop (MANDATORY \u2014 trains the classifier flywheel):**\n1. Call `gramatr_classification_feedback` after non-trivial work \u2014 evaluates\n if effort, intent, and skills were classified correctly.\n2. Call `gramatr_save_reflection` in LEARN phase \u2014 captures what worked, what\n didn't, what a smarter AI would do differently.\nSkipping these breaks the training flywheel.";
17
17
  /** Sub-agent composition and audit requirements */
@@ -35,7 +35,7 @@ export declare const PROJECT_RESUMED = "**Resuming project:** When `gramatr_reso
35
35
  /** Instruct the AI to surface token savings and phase progress on every non-trivial response */
36
36
  export declare const SURFACE_VALUE = "**AI value surfacing (MANDATORY for standard+ effort \u2014 skip for instant/fast):**\nAfter each non-trivial response, append a one-line value summary:\nFormat: `gra: ~{tokens_saved_all_time} saved | {phase} phase`\nExample: `gra: ~45.2K saved | VERIFY phase`\nRead tokens_saved_all_time from execution.token_savings.all_time, phase from process.phase_template current step.\nThis line proves the intelligence layer is working \u2014 users must see the value every turn.";
37
37
  /** Show Quality Gate criteria progress after each phase transition */
38
- export declare const ISC_TRANSPARENCY = "**Quality Gate transparency (MANDATORY for standard+ effort \u2014 skip for instant/fast):**\nAfter each phase transition, show criteria progress inline:\nFormat: `QG: {passed}/{total} criteria | {current_phase} -> {next_phase}`\nList each criterion with PASS/FAIL/PENDING status.\nThis keeps the user informed of structured execution progress without requiring\nthem to ask. Transparency builds trust in the methodology.";
38
+ export declare const QUALITY_GATE_TRANSPARENCY = "**Quality Gate transparency (MANDATORY for standard+ effort \u2014 skip for instant/fast):**\nAfter each phase transition, show criteria progress inline:\nFormat: `QG: {passed}/{total} criteria | {current_phase} -> {next_phase}`\nList each criterion with PASS/FAIL/PENDING status.\nThis keeps the user informed of structured execution progress without requiring\nthem to ask. Transparency builds trust in the methodology.";
39
39
  /** When onboarding is incomplete, instruct the agent to capture user identity through conversation */
40
40
  export declare const ONBOARDING_REQUIRED = "**Onboarding required (triggered when onboarding_required: true in v2 packet):**\nThe user has not completed onboarding. You must capture their identity through\nnatural conversation. Do NOT present a form \u2014 weave questions into your response.\nSteps:\n1. Call `gramatr_onboard_user` with `action: 'check'` to see what's missing.\n2. If profile is missing: ask about their role and expertise domains, then call\n `gramatr_onboard_user` with `action: 'capture_profile'`, `role`, and optionally\n `expertise_domains` and `location`.\n3. If voice is missing: ask about their communication preferences, then call\n `gramatr_onboard_user` with `action: 'capture_voice'`, `communication_style`,\n and optionally `tone`.\n4. If craft is missing: ask about their technical skills, then call\n `gramatr_onboard_user` with `action: 'capture_craft'`, `expertise_areas`,\n and optionally `languages` and `frameworks`.\n5. After capturing all three, call `gramatr_onboard_user` with `action: 'check'`\n to confirm `complete: true`.\nDo not block the user's actual request \u2014 answer it AND capture identity data.";
41
41
  //# sourceMappingURL=instruction-blocks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instruction-blocks.d.ts","sourceRoot":"","sources":["../../../src/setup/generated/instruction-blocks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,gEAAgE;AAChE,eAAO,MAAM,cAAc,skBAAmiB,CAAC;AAE/jB,8BAA8B;AAC9B,eAAO,MAAM,YAAY,oJAAoJ,CAAC;AAE9K,oDAAoD;AACpD,eAAO,MAAM,eAAe,sJAAsJ,CAAC;AAEnL,kFAAkF;AAClF,eAAO,MAAM,eAAe,qeAAge,CAAC;AAE7f,sDAAsD;AACtD,eAAO,MAAM,cAAc,+YAAgY,CAAC;AAE5Z,mDAAmD;AACnD,eAAO,MAAM,cAAc,q8BAAm5B,CAAC;AAE/6B,mCAAmC;AACnC,eAAO,MAAM,aAAa,iTAA+P,CAAC;AAE1R,wCAAwC;AACxC,eAAO,MAAM,QAAQ,4HAAuH,CAAC;AAE7I,0CAA0C;AAC1C,eAAO,MAAM,aAAa,4JAA4J,CAAC;AAEvL,mEAAmE;AACnE,eAAO,MAAM,sBAAsB,oXAAoX,CAAC;AAExZ,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB,8VAA8V,CAAC;AAE9X,+CAA+C;AAC/C,eAAO,MAAM,kBAAkB,ikBAA4jB,CAAC;AAE5lB,mDAAmD;AACnD,eAAO,MAAM,WAAW,4WAA4W,CAAC;AAErY,kDAAkD;AAClD,eAAO,MAAM,eAAe,8ZAA8Z,CAAC;AAE3b,gGAAgG;AAChG,eAAO,MAAM,aAAa,4dAAkd,CAAC;AAE7e,sEAAsE;AACtE,eAAO,MAAM,gBAAgB,0aAAqa,CAAC;AAEnc,sGAAsG;AACtG,eAAO,MAAM,mBAAmB,smCAA4lC,CAAC"}
1
+ {"version":3,"file":"instruction-blocks.d.ts","sourceRoot":"","sources":["../../../src/setup/generated/instruction-blocks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,gEAAgE;AAChE,eAAO,MAAM,cAAc,skBAAmiB,CAAC;AAE/jB,8BAA8B;AAC9B,eAAO,MAAM,YAAY,oJAAoJ,CAAC;AAE9K,oDAAoD;AACpD,eAAO,MAAM,eAAe,sJAAsJ,CAAC;AAEnL,kFAAkF;AAClF,eAAO,MAAM,wBAAwB,oeAA+d,CAAC;AAErgB,sDAAsD;AACtD,eAAO,MAAM,cAAc,+YAAgY,CAAC;AAE5Z,mDAAmD;AACnD,eAAO,MAAM,cAAc,q8BAAm5B,CAAC;AAE/6B,mCAAmC;AACnC,eAAO,MAAM,aAAa,iTAA+P,CAAC;AAE1R,wCAAwC;AACxC,eAAO,MAAM,QAAQ,4HAAuH,CAAC;AAE7I,0CAA0C;AAC1C,eAAO,MAAM,aAAa,4JAA4J,CAAC;AAEvL,mEAAmE;AACnE,eAAO,MAAM,sBAAsB,oXAAoX,CAAC;AAExZ,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB,8VAA8V,CAAC;AAE9X,+CAA+C;AAC/C,eAAO,MAAM,kBAAkB,ikBAA4jB,CAAC;AAE5lB,mDAAmD;AACnD,eAAO,MAAM,WAAW,4WAA4W,CAAC;AAErY,kDAAkD;AAClD,eAAO,MAAM,eAAe,8ZAA8Z,CAAC;AAE3b,gGAAgG;AAChG,eAAO,MAAM,aAAa,4dAAkd,CAAC;AAE7e,sEAAsE;AACtE,eAAO,MAAM,yBAAyB,0aAAqa,CAAC;AAE5c,sGAAsG;AACtG,eAAO,MAAM,mBAAmB,smCAA4lC,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * AUTO-GENERATED — do not edit manually.
3
3
  * Source: contracts/methodology/instruction-blocks.yaml
4
4
  * Generator: contracts/generator/generate.ts
5
- * Generated: 2026-04-20T02:16:11.206Z
5
+ * Generated: 2026-04-20T19:51:45.600Z
6
6
  */
7
7
  /** Mandatory contract fields from the v2 intelligence packet */
8
8
  export const CONTRACT_RULES = "**Mandatory contract fields — treat as execution requirements:**\n- `directives.hard_gates` — non-negotiable behavioral constraints\n- `directives.behavioral_rules` — algorithm phases, code rules, safety rules\n- `directives.behavioral_directives` — per-turn instructions from the classifier\n- `process.phase_template` — effort-gated phase sequence (MUST follow)\n- `process.quality_gate_config` — Quality Gate verification rules (MUST pass before done)\n- `enrichment.data.reasoning` — RE + Quality Gate scaffold when present (MUST consume)";
@@ -11,7 +11,7 @@ export const MEMORY_RULES = "**Memory:** Use gramatr MCP tools (`search_semantic
11
11
  /** Required metadata fields for key entity types */
12
12
  export const REQUIRED_FIELDS = "**Required fields:** task/milestone: status (open|in_progress|blocked|review|done).\nDecision: status + project_id. Session: status + project_id.";
13
13
  /** Mandatory Quality Gate creation before any non-instant work — NO EXCEPTIONS */
14
- export const ISC_REQUIREMENT = "**QUALITY GATE REQUIREMENT — NO EXCEPTIONS:**\nBefore ANY non-instant work, you MUST call TaskCreate with Quality Gate\ncriteria. This is not optional. You do not get to decide \"this is too\nsmall\" or \"this would slow things down.\" Every task gets Quality Gate\ncriteria (minimum 4, 8-12 words each, state not action) plus at least 1\nanti-criterion (ISC-A). After work, TaskUpdate each criterion with\nPASS/FAIL and specific evidence. Skipping this violates a hard gate.";
14
+ export const QUALITY_GATE_REQUIREMENT = "**QUALITY GATE REQUIREMENT — NO EXCEPTIONS:**\nBefore ANY non-instant work, you MUST call TaskCreate with Quality Gate\ncriteria. This is not optional. You do not get to decide \"this is too\nsmall\" or \"this would slow things down.\" Every task gets Quality Gate\ncriteria (minimum 4, 8-12 words each, state not action) plus at least 1\nanti-criterion (QG-A). After work, TaskUpdate each criterion with\nPASS/FAIL and specific evidence. Skipping this violates a hard gate.";
15
15
  /** Mandatory feedback loop for classifier training */
16
16
  export const FEEDBACK_RULES = "**Feedback loop (MANDATORY — trains the classifier flywheel):**\n1. Call `gramatr_classification_feedback` after non-trivial work — evaluates\n if effort, intent, and skills were classified correctly.\n2. Call `gramatr_save_reflection` in LEARN phase — captures what worked, what\n didn't, what a smarter AI would do differently.\nSkipping these breaks the training flywheel.";
17
17
  /** Sub-agent composition and audit requirements */
@@ -35,7 +35,7 @@ export const PROJECT_RESUMED = "**Resuming project:** When `gramatr_resolve_proj
35
35
  /** Instruct the AI to surface token savings and phase progress on every non-trivial response */
36
36
  export const SURFACE_VALUE = "**AI value surfacing (MANDATORY for standard+ effort — skip for instant/fast):**\nAfter each non-trivial response, append a one-line value summary:\nFormat: `gra: ~{tokens_saved_all_time} saved | {phase} phase`\nExample: `gra: ~45.2K saved | VERIFY phase`\nRead tokens_saved_all_time from execution.token_savings.all_time, phase from process.phase_template current step.\nThis line proves the intelligence layer is working — users must see the value every turn.";
37
37
  /** Show Quality Gate criteria progress after each phase transition */
38
- export const ISC_TRANSPARENCY = "**Quality Gate transparency (MANDATORY for standard+ effort — skip for instant/fast):**\nAfter each phase transition, show criteria progress inline:\nFormat: `QG: {passed}/{total} criteria | {current_phase} -> {next_phase}`\nList each criterion with PASS/FAIL/PENDING status.\nThis keeps the user informed of structured execution progress without requiring\nthem to ask. Transparency builds trust in the methodology.";
38
+ export const QUALITY_GATE_TRANSPARENCY = "**Quality Gate transparency (MANDATORY for standard+ effort — skip for instant/fast):**\nAfter each phase transition, show criteria progress inline:\nFormat: `QG: {passed}/{total} criteria | {current_phase} -> {next_phase}`\nList each criterion with PASS/FAIL/PENDING status.\nThis keeps the user informed of structured execution progress without requiring\nthem to ask. Transparency builds trust in the methodology.";
39
39
  /** When onboarding is incomplete, instruct the agent to capture user identity through conversation */
40
40
  export const ONBOARDING_REQUIRED = "**Onboarding required (triggered when onboarding_required: true in v2 packet):**\nThe user has not completed onboarding. You must capture their identity through\nnatural conversation. Do NOT present a form — weave questions into your response.\nSteps:\n1. Call `gramatr_onboard_user` with `action: 'check'` to see what's missing.\n2. If profile is missing: ask about their role and expertise domains, then call\n `gramatr_onboard_user` with `action: 'capture_profile'`, `role`, and optionally\n `expertise_domains` and `location`.\n3. If voice is missing: ask about their communication preferences, then call\n `gramatr_onboard_user` with `action: 'capture_voice'`, `communication_style`,\n and optionally `tone`.\n4. If craft is missing: ask about their technical skills, then call\n `gramatr_onboard_user` with `action: 'capture_craft'`, `expertise_areas`,\n and optionally `languages` and `frameworks`.\n5. After capturing all three, call `gramatr_onboard_user` with `action: 'check'`\n to confirm `complete: true`.\nDo not block the user's actual request — answer it AND capture identity data.";
41
41
  //# sourceMappingURL=instruction-blocks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instruction-blocks.js","sourceRoot":"","sources":["../../../src/setup/generated/instruction-blocks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,gEAAgE;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG,giBAAgiB,CAAC;AAE/jB,8BAA8B;AAC9B,MAAM,CAAC,MAAM,YAAY,GAAG,iJAAiJ,CAAC;AAE9K,oDAAoD;AACpD,MAAM,CAAC,MAAM,eAAe,GAAG,mJAAmJ,CAAC;AAEnL,kFAAkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAAG,6dAA6d,CAAC;AAE7f,sDAAsD;AACtD,MAAM,CAAC,MAAM,cAAc,GAAG,6XAA6X,CAAC;AAE5Z,mDAAmD;AACnD,MAAM,CAAC,MAAM,cAAc,GAAG,g5BAAg5B,CAAC;AAE/6B,mCAAmC;AACnC,MAAM,CAAC,MAAM,aAAa,GAAG,4PAA4P,CAAC;AAE1R,wCAAwC;AACxC,MAAM,CAAC,MAAM,QAAQ,GAAG,oHAAoH,CAAC;AAE7I,0CAA0C;AAC1C,MAAM,CAAC,MAAM,aAAa,GAAG,yJAAyJ,CAAC;AAEvL,mEAAmE;AACnE,MAAM,CAAC,MAAM,sBAAsB,GAAG,iXAAiX,CAAC;AAExZ,0FAA0F;AAC1F,MAAM,CAAC,MAAM,kBAAkB,GAAG,2VAA2V,CAAC;AAE9X,+CAA+C;AAC/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,yjBAAyjB,CAAC;AAE5lB,mDAAmD;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG,yWAAyW,CAAC;AAErY,kDAAkD;AAClD,MAAM,CAAC,MAAM,eAAe,GAAG,2ZAA2Z,CAAC;AAE3b,gG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GAAG,2ZAA2Z,CAAC;AAE3b,gGAAgG;AAChG,MAAM,CAAC,MAAM,aAAa,GAAG,+cAA+c,CAAC;AAE7e,sEAAsE;AACtE,MAAM,CAAC,MAAM,yBAAyB,GAAG,kaAAka,CAAC;AAE5c,sGAAsG;AACtG,MAAM,CAAC,MAAM,mBAAmB,GAAG,ylCAAylC,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Generated: 2026-04-20T19:38:13.009Z
3
+ * Source: contracts/platforms/*.yaml (claude_md block)
4
+ *
5
+ * Platform-specific CLAUDE.md guidance markers and intro text.
6
+ * Assembled with instruction blocks in setup/instructions.ts.
7
+ * Do NOT edit manually. Run `pnpm generate:contracts` after editing platform YAMLs.
8
+ */
9
+ export declare const CLAUDECODE_CLAUDE_MD: {
10
+ readonly blockStart: "<!-- GRAMATR-START -->";
11
+ readonly blockEnd: "<!-- GRAMATR-END -->";
12
+ readonly title: "gramatr";
13
+ readonly intro: "You have gramatr installed. Hooks inject a `gmtr.intelligence.contract.v2`\npacket into your context on every prompt.\n\n**Follow the packet.** It contains classification, behavioral directives,\nphase templates, capability audit, quality gates, memory/search results,\nagent suggestions, and enrichment (RE + Quality Gate scaffold).";
14
+ readonly instructionBlocks: readonly ["CONTRACT_RULES", "MEMORY_RULES", "ENTITY_TYPES", "REQUIRED_FIELDS", "FEEDBACK_RULES", "SUBAGENT_RULES", "EFFORT_PHASES", "QUALITY_GATE_REQUIREMENT", "CLASSIFICATION_SUMMARY", "IDENTITY", "DEGRADED_MODE"];
15
+ };
16
+ export declare const CODEX_CLAUDE_MD: {
17
+ readonly blockStart: "<!-- GRAMATR-CODEX-START -->";
18
+ readonly blockEnd: "<!-- GRAMATR-CODEX-END -->";
19
+ readonly title: "gramatr codex guidance";
20
+ readonly intro: "Hooks inject a `gmtr.intelligence.contract.v2` packet on every prompt.\nFollow it as authoritative. Call `gramatr_route_request` when missing.";
21
+ readonly instructionBlocks: readonly ["CONTRACT_RULES", "MEMORY_RULES", "ENTITY_TYPES", "REQUIRED_FIELDS", "FEEDBACK_RULES", "SUBAGENT_RULES", "EFFORT_PHASES", "QUALITY_GATE_REQUIREMENT", "CLASSIFICATION_SUMMARY", "DEGRADED_MODE"];
22
+ };
23
+ export declare const PLATFORM_CLAUDE_MD_MAP: {
24
+ readonly 'claude-code': {
25
+ readonly blockStart: "<!-- GRAMATR-START -->";
26
+ readonly blockEnd: "<!-- GRAMATR-END -->";
27
+ readonly title: "gramatr";
28
+ readonly intro: "You have gramatr installed. Hooks inject a `gmtr.intelligence.contract.v2`\npacket into your context on every prompt.\n\n**Follow the packet.** It contains classification, behavioral directives,\nphase templates, capability audit, quality gates, memory/search results,\nagent suggestions, and enrichment (RE + Quality Gate scaffold).";
29
+ readonly instructionBlocks: readonly ["CONTRACT_RULES", "MEMORY_RULES", "ENTITY_TYPES", "REQUIRED_FIELDS", "FEEDBACK_RULES", "SUBAGENT_RULES", "EFFORT_PHASES", "QUALITY_GATE_REQUIREMENT", "CLASSIFICATION_SUMMARY", "IDENTITY", "DEGRADED_MODE"];
30
+ };
31
+ readonly codex: {
32
+ readonly blockStart: "<!-- GRAMATR-CODEX-START -->";
33
+ readonly blockEnd: "<!-- GRAMATR-CODEX-END -->";
34
+ readonly title: "gramatr codex guidance";
35
+ readonly intro: "Hooks inject a `gmtr.intelligence.contract.v2` packet on every prompt.\nFollow it as authoritative. Call `gramatr_route_request` when missing.";
36
+ readonly instructionBlocks: readonly ["CONTRACT_RULES", "MEMORY_RULES", "ENTITY_TYPES", "REQUIRED_FIELDS", "FEEDBACK_RULES", "SUBAGENT_RULES", "EFFORT_PHASES", "QUALITY_GATE_REQUIREMENT", "CLASSIFICATION_SUMMARY", "DEGRADED_MODE"];
37
+ };
38
+ };
39
+ //# sourceMappingURL=platform-guidance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-guidance.d.ts","sourceRoot":"","sources":["../../../src/setup/generated/platform-guidance.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,oBAAoB;;;;;;CAMvB,CAAC;AAEX,eAAO,MAAM,eAAe;;;;;;CAMlB,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;CAGzB,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Generated: 2026-04-20T19:38:13.009Z
3
+ * Source: contracts/platforms/*.yaml (claude_md block)
4
+ *
5
+ * Platform-specific CLAUDE.md guidance markers and intro text.
6
+ * Assembled with instruction blocks in setup/instructions.ts.
7
+ * Do NOT edit manually. Run `pnpm generate:contracts` after editing platform YAMLs.
8
+ */
9
+ export const CLAUDECODE_CLAUDE_MD = {
10
+ blockStart: "<!-- GRAMATR-START -->",
11
+ blockEnd: "<!-- GRAMATR-END -->",
12
+ title: "gramatr",
13
+ intro: "You have gramatr installed. Hooks inject a `gmtr.intelligence.contract.v2`\npacket into your context on every prompt.\n\n**Follow the packet.** It contains classification, behavioral directives,\nphase templates, capability audit, quality gates, memory/search results,\nagent suggestions, and enrichment (RE + Quality Gate scaffold).",
14
+ instructionBlocks: ['CONTRACT_RULES', 'MEMORY_RULES', 'ENTITY_TYPES', 'REQUIRED_FIELDS', 'FEEDBACK_RULES', 'SUBAGENT_RULES', 'EFFORT_PHASES', 'QUALITY_GATE_REQUIREMENT', 'CLASSIFICATION_SUMMARY', 'IDENTITY', 'DEGRADED_MODE'],
15
+ };
16
+ export const CODEX_CLAUDE_MD = {
17
+ blockStart: "<!-- GRAMATR-CODEX-START -->",
18
+ blockEnd: "<!-- GRAMATR-CODEX-END -->",
19
+ title: "gramatr codex guidance",
20
+ intro: "Hooks inject a `gmtr.intelligence.contract.v2` packet on every prompt.\nFollow it as authoritative. Call `gramatr_route_request` when missing.",
21
+ instructionBlocks: ['CONTRACT_RULES', 'MEMORY_RULES', 'ENTITY_TYPES', 'REQUIRED_FIELDS', 'FEEDBACK_RULES', 'SUBAGENT_RULES', 'EFFORT_PHASES', 'QUALITY_GATE_REQUIREMENT', 'CLASSIFICATION_SUMMARY', 'DEGRADED_MODE'],
22
+ };
23
+ export const PLATFORM_CLAUDE_MD_MAP = {
24
+ 'claude-code': CLAUDECODE_CLAUDE_MD,
25
+ 'codex': CODEX_CLAUDE_MD,
26
+ };
27
+ //# sourceMappingURL=platform-guidance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-guidance.js","sourceRoot":"","sources":["../../../src/setup/generated/platform-guidance.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,UAAU,EAAE,wBAAwB;IACpC,QAAQ,EAAE,sBAAsB;IAChC,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,+UAA+U;IACtV,iBAAiB,EAAE,CAAC,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,UAAU,EAAE,eAAe,CAAU;CACjO,CAAC;AAEX,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,UAAU,EAAE,8BAA8B;IAC1C,QAAQ,EAAE,4BAA4B;IACtC,KAAK,EAAE,wBAAwB;IAC/B,KAAK,EAAE,gJAAgJ;IACvJ,iBAAiB,EAAE,CAAC,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,eAAe,CAAU;CACrN,CAAC;AAEX,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,aAAa,EAAE,oBAAoB;IACnC,OAAO,EAAE,eAAe;CAChB,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * AUTO-GENERATED — do not edit manually.
3
3
  * Source: contracts/platforms/*.yaml
4
4
  * Generator: contracts/generator/generate.ts
5
- * Generated: 2026-04-16T20:37:14.501Z
5
+ * Generated: 2026-04-20T19:38:13.008Z
6
6
  */
7
7
  export interface PlatformHookEntry {
8
8
  hook: string;
@@ -28,17 +28,17 @@ export interface PlatformConfig {
28
28
  mcp_server: PlatformMcpServer;
29
29
  instruction_blocks: string[];
30
30
  }
31
- /** ChatGPT Approved Add-on — ChatGPT official plugin/add-on — sandbox environment, OAuth auth, OpenAPI manifest */
31
+ /** grāmatr for ChatGPT — ChatGPT official plugin/add-on — sandbox environment, OAuth auth, OpenAPI manifest */
32
32
  export declare const CHATGPT_ADDON_HOOKS: PlatformConfig;
33
33
  /** ChatGPT Desktop — ChatGPT Desktop app integration via MCP server config (hookless) */
34
34
  export declare const CHATGPT_DESKTOP_HOOKS: PlatformConfig;
35
- /** ChatGPT Custom GPT — ChatGPT Custom GPT instructions — ~8000 char budget, MCP pre-wired at GPT level, shareable link */
35
+ /** grāmatr — ChatGPT Custom GPT instructions — ~8000 char budget, MCP pre-wired at GPT level, shareable link */
36
36
  export declare const CHATGPT_GPT_HOOKS: PlatformConfig;
37
37
  /** ChatGPT Project — ChatGPT Project instructions — 5000 char budget, MCP connected at project level */
38
38
  export declare const CHATGPT_PROJECT_HOOKS: PlatformConfig;
39
39
  /** ChatGPT Web — ChatGPT Web (chat.openai.com) integration via MCP — hookless, paste into personal prompt or custom GPT */
40
40
  export declare const CHATGPT_WEB_HOOKS: PlatformConfig;
41
- /** Claude Add-on — Claude.ai official MCP add-on — Anthropic partner program, sandbox environment */
41
+ /** grāmatr for Claude — Claude.ai official MCP add-on — Anthropic partner program, sandbox environment */
42
42
  export declare const CLAUDE_ADDON_HOOKS: PlatformConfig;
43
43
  /** Claude Code — Claude Code CLI integration with full hook lifecycle */
44
44
  export declare const CLAUDE_CODE_HOOKS: PlatformConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"platform-hooks.d.ts","sourceRoot":"","sources":["../../../src/setup/generated/platform-hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO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