@gramatr/mcp 0.7.20 → 0.8.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.
Files changed (81) hide show
  1. package/dist/bin/setup.d.ts +2 -1
  2. package/dist/bin/setup.d.ts.map +1 -1
  3. package/dist/bin/setup.js +35 -1
  4. package/dist/bin/setup.js.map +1 -1
  5. package/dist/gramatr +0 -0
  6. package/dist/hooks/agent-gate.d.ts.map +1 -1
  7. package/dist/hooks/agent-gate.js +11 -7
  8. package/dist/hooks/agent-gate.js.map +1 -1
  9. package/dist/hooks/agent-verify.d.ts.map +1 -1
  10. package/dist/hooks/agent-verify.js +2 -1
  11. package/dist/hooks/agent-verify.js.map +1 -1
  12. package/dist/hooks/edit-tracker.d.ts.map +1 -1
  13. package/dist/hooks/edit-tracker.js +2 -1
  14. package/dist/hooks/edit-tracker.js.map +1 -1
  15. package/dist/hooks/generated/hook-timeouts.d.ts +41 -0
  16. package/dist/hooks/generated/hook-timeouts.d.ts.map +1 -0
  17. package/dist/hooks/generated/hook-timeouts.js +41 -0
  18. package/dist/hooks/generated/hook-timeouts.js.map +1 -0
  19. package/dist/hooks/generated/schema-constants.d.ts +46 -0
  20. package/dist/hooks/generated/schema-constants.d.ts.map +1 -1
  21. package/dist/hooks/generated/schema-constants.js +88 -11
  22. package/dist/hooks/generated/schema-constants.js.map +1 -1
  23. package/dist/hooks/git-gate.d.ts.map +1 -1
  24. package/dist/hooks/git-gate.js +14 -13
  25. package/dist/hooks/git-gate.js.map +1 -1
  26. package/dist/hooks/input-validator.d.ts.map +1 -1
  27. package/dist/hooks/input-validator.js +2 -1
  28. package/dist/hooks/input-validator.js.map +1 -1
  29. package/dist/hooks/lib/gramatr-hook-utils.d.ts.map +1 -1
  30. package/dist/hooks/lib/gramatr-hook-utils.js +2 -1
  31. package/dist/hooks/lib/gramatr-hook-utils.js.map +1 -1
  32. package/dist/hooks/lib/hook-state.d.ts +3 -0
  33. package/dist/hooks/lib/hook-state.d.ts.map +1 -1
  34. package/dist/hooks/lib/hook-state.js +14 -3
  35. package/dist/hooks/lib/hook-state.js.map +1 -1
  36. package/dist/hooks/lib/routing.d.ts.map +1 -1
  37. package/dist/hooks/lib/routing.js +8 -7
  38. package/dist/hooks/lib/routing.js.map +1 -1
  39. package/dist/hooks/lib/version-check.d.ts +1 -1
  40. package/dist/hooks/lib/version-check.d.ts.map +1 -1
  41. package/dist/hooks/lib/version-check.js +4 -5
  42. package/dist/hooks/lib/version-check.js.map +1 -1
  43. package/dist/hooks/rating-capture.d.ts.map +1 -1
  44. package/dist/hooks/rating-capture.js +15 -9
  45. package/dist/hooks/rating-capture.js.map +1 -1
  46. package/dist/hooks/session-start.d.ts.map +1 -1
  47. package/dist/hooks/session-start.js +7 -1
  48. package/dist/hooks/session-start.js.map +1 -1
  49. package/dist/hooks/stop.d.ts.map +1 -1
  50. package/dist/hooks/stop.js +1 -1
  51. package/dist/hooks/stop.js.map +1 -1
  52. package/dist/hooks/tool-tracker.d.ts.map +1 -1
  53. package/dist/hooks/tool-tracker.js +2 -1
  54. package/dist/hooks/tool-tracker.js.map +1 -1
  55. package/dist/hooks/user-prompt-submit.d.ts.map +1 -1
  56. package/dist/hooks/user-prompt-submit.js +15 -50
  57. package/dist/hooks/user-prompt-submit.js.map +1 -1
  58. package/dist/proxy/local-client.d.ts +12 -6
  59. package/dist/proxy/local-client.d.ts.map +1 -1
  60. package/dist/proxy/local-client.js +35 -7
  61. package/dist/proxy/local-client.js.map +1 -1
  62. package/dist/setup/examples/gramatr-opencode-plugin.d.ts +45 -0
  63. package/dist/setup/examples/gramatr-opencode-plugin.d.ts.map +1 -0
  64. package/dist/setup/examples/gramatr-opencode-plugin.js +129 -0
  65. package/dist/setup/examples/gramatr-opencode-plugin.js.map +1 -0
  66. package/dist/setup/generated/platform-hooks.d.ts +64 -0
  67. package/dist/setup/generated/platform-hooks.d.ts.map +1 -0
  68. package/dist/setup/generated/platform-hooks.js +526 -0
  69. package/dist/setup/generated/platform-hooks.js.map +1 -0
  70. package/dist/setup/instructions.d.ts +3 -3
  71. package/dist/setup/instructions.d.ts.map +1 -1
  72. package/dist/setup/instructions.js +138 -86
  73. package/dist/setup/instructions.js.map +1 -1
  74. package/dist/setup/integrations.d.ts.map +1 -1
  75. package/dist/setup/integrations.js +31 -42
  76. package/dist/setup/integrations.js.map +1 -1
  77. package/dist/setup/targets.d.ts +3 -0
  78. package/dist/setup/targets.d.ts.map +1 -1
  79. package/dist/setup/targets.js +19 -3
  80. package/dist/setup/targets.js.map +1 -1
  81. package/package.json +1 -1
@@ -1,24 +1,52 @@
1
1
  /**
2
2
  * local-client.ts — Hook-side client for gramatr tool calls.
3
3
  *
4
- * Hooks call gramatr tools directly through the remote API via callRemoteTool.
5
- * The compiled binary owns auth resolution no port-based local HTTP server needed.
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.
6
8
  *
7
9
  * Session context (project_id, interaction_id) is managed locally via SQLite
8
10
  * in hook-state.ts. pushSessionContextToLocal / pullSessionContextFromLocal
9
11
  * are retained as no-ops for call-site compatibility while the port IPC is removed.
10
12
  */
13
+ import { proxyToolCall } from './tool-proxy.js';
14
+ import { loadRemoteTools } from './tool-registry.js';
11
15
  import { callRemoteTool } from './remote-client.js';
12
- /** Always false — port-based local server is no longer used. */
16
+ let registryLoaded = false;
17
+ /** Always true — the proxy pipeline is available in-process. */
13
18
  export function isLocalHooksServerAvailable() {
14
- return false;
19
+ return true;
15
20
  }
16
21
  /**
17
- * Call a gramatr tool via the remote API.
18
- * Auth is resolved by the compiled binary's auth module.
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.
19
27
  */
20
28
  export async function callTool(name, args) {
21
- return callRemoteTool(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
+ }
39
+ }
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
+ }
48
+ }
49
+ return result;
22
50
  }
23
51
  /**
24
52
  * 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;;;;;;;;;GASG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,gEAAgE;AAChE,MAAM,UAAU,2BAA2B;IACzC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,IAAY,EACZ,IAA6B;IAE7B,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACpC,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"}
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;AAC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ps OpenCode's plugin lifecycle events to gramatr hook logic.
5
+ * OpenCode uses a plugin-based architecture instead of hooks.json files.
6
+ *
7
+ * Install: Place this file in your OpenCode plugins directory or reference
8
+ * it in your opencode.json config.
9
+ *
10
+ * This is a scaffold with TODO comments — not a full implementation.
11
+ * Each event handler shows which gramatr hook logic to invoke.
12
+ */
13
+ interface OpenCodePluginContext {
14
+ sessionId: string;
15
+ projectDir: string;
16
+ config: Record<string, unknown>;
17
+ }
18
+ interface OpenCodeToolCall {
19
+ name: string;
20
+ input: Record<string, unknown>;
21
+ output?: unknown;
22
+ }
23
+ interface OpenCodePlugin {
24
+ name: string;
25
+ version: string;
26
+ description: string;
27
+ 'session.created'?: (ctx: OpenCodePluginContext) => Promise<void>;
28
+ 'session.updated'?: (ctx: OpenCodePluginContext) => Promise<void>;
29
+ 'session.idle'?: (ctx: OpenCodePluginContext) => Promise<void>;
30
+ 'tool.execute.before'?: (ctx: OpenCodePluginContext, tool: OpenCodeToolCall) => Promise<OpenCodeToolCall>;
31
+ 'tool.execute.after'?: (ctx: OpenCodePluginContext, tool: OpenCodeToolCall) => Promise<void>;
32
+ }
33
+ /**
34
+ * gramatr plugin for OpenCode.
35
+ *
36
+ * Event mapping:
37
+ * session.created -> gramatr session-start (restore session context + handoff)
38
+ * tool.execute.before -> gramatr agent-gate + input-validator (pre-tool checks)
39
+ * tool.execute.after -> gramatr tool-tracker (post-tool telemetry)
40
+ * session.idle -> gramatr stop (classification feedback on idle)
41
+ * session.updated -> gramatr session-end (persist session state)
42
+ */
43
+ declare const gramatrPlugin: OpenCodePlugin;
44
+ export default gramatrPlugin;
45
+ //# sourceMappingURL=gramatr-opencode-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gramatr-opencode-plugin.d.ts","sourceRoot":"","sources":["../../../src/setup/examples/gramatr-opencode-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,UAAU,qBAAqB;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IAEpB,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,qBAAqB,EAAE,IAAI,EAAE,gBAAgB,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC1G,oBAAoB,CAAC,EAAE,CAAC,GAAG,EAAE,qBAAqB,EAAE,IAAI,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9F;AAED;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,EAAE,cAgHpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * gramatr OpenCode Plugin Scaffold
3
+ *
4
+ * Maps OpenCode's plugin lifecycle events to gramatr hook logic.
5
+ * OpenCode uses a plugin-based architecture instead of hooks.json files.
6
+ *
7
+ * Install: Place this file in your OpenCode plugins directory or reference
8
+ * it in your opencode.json config.
9
+ *
10
+ * This is a scaffold with TODO comments — not a full implementation.
11
+ * Each event handler shows which gramatr hook logic to invoke.
12
+ */
13
+ /**
14
+ * gramatr plugin for OpenCode.
15
+ *
16
+ * Event mapping:
17
+ * session.created -> gramatr session-start (restore session context + handoff)
18
+ * tool.execute.before -> gramatr agent-gate + input-validator (pre-tool checks)
19
+ * tool.execute.after -> gramatr tool-tracker (post-tool telemetry)
20
+ * session.idle -> gramatr stop (classification feedback on idle)
21
+ * session.updated -> gramatr session-end (persist session state)
22
+ */
23
+ const gramatrPlugin = {
24
+ name: 'gramatr',
25
+ version: '0.1.0',
26
+ description: 'gramatr intelligence layer for OpenCode — session, routing, and tool lifecycle',
27
+ /**
28
+ * session.created — Initialize gramatr session context.
29
+ *
30
+ * Equivalent to the SessionStart hook in Claude Code / Codex / Gemini.
31
+ * Calls gramatr_session_start to restore session context and load handoff.
32
+ */
33
+ 'session.created': async (ctx) => {
34
+ // TODO: Call gramatr session-start hook logic
35
+ // - Load or create a gramatr session for ctx.sessionId
36
+ // - Restore handoff state from previous sessions
37
+ // - Inject the v2 intelligence packet into the session context
38
+ //
39
+ // Example using the gramatr binary:
40
+ // execSync(`~/.gramatr/bin/gramatr hook session-start --opencode`, {
41
+ // env: { ...process.env, GRAMATR_SESSION_ID: ctx.sessionId },
42
+ // });
43
+ void ctx;
44
+ },
45
+ /**
46
+ * tool.execute.before — Pre-tool validation gate.
47
+ *
48
+ * Equivalent to PreToolUse hooks (agent-gate, input-validator) in Claude Code.
49
+ * Validates tool inputs and enforces safety constraints before execution.
50
+ */
51
+ 'tool.execute.before': async (ctx, tool) => {
52
+ // TODO: Call gramatr agent-gate logic
53
+ // - Check if the tool call is allowed by hard_gates
54
+ // - Validate tool inputs against schema constraints
55
+ //
56
+ // TODO: Call gramatr input-validator logic
57
+ // - Sanitize inputs (strip secrets, validate paths)
58
+ // - Enforce user isolation rules
59
+ //
60
+ // Example:
61
+ // const result = execSync(
62
+ // `~/.gramatr/bin/gramatr hook input-validator --opencode`,
63
+ // { input: JSON.stringify({ tool_name: tool.name, tool_input: tool.input }) },
64
+ // );
65
+ // const validated = JSON.parse(result.toString());
66
+ // if (validated.blocked) throw new Error(validated.reason);
67
+ void ctx;
68
+ return tool;
69
+ },
70
+ /**
71
+ * tool.execute.after — Post-tool telemetry tracking.
72
+ *
73
+ * Equivalent to PostToolUse (tool-tracker) in Claude Code.
74
+ * Records tool execution metadata for the intelligence flywheel.
75
+ */
76
+ 'tool.execute.after': async (ctx, tool) => {
77
+ // TODO: Call gramatr tool-tracker logic
78
+ // - Record tool name, execution time, result summary
79
+ // - Feed execution data into the pattern learner
80
+ // - Update session state with tool usage
81
+ //
82
+ // Example:
83
+ // execSync(`~/.gramatr/bin/gramatr hook tool-tracker --opencode`, {
84
+ // input: JSON.stringify({
85
+ // tool_name: tool.name,
86
+ // tool_input: tool.input,
87
+ // tool_output: tool.output,
88
+ // }),
89
+ // });
90
+ void ctx;
91
+ void tool;
92
+ },
93
+ /**
94
+ * session.idle — Submit classification feedback on idle.
95
+ *
96
+ * Equivalent to the Stop hook in Claude Code / Codex.
97
+ * Submits classification feedback to train the classifier flywheel.
98
+ */
99
+ 'session.idle': async (ctx) => {
100
+ // TODO: Call gramatr stop hook logic
101
+ // - Submit gramatr_classification_feedback for the current session
102
+ // - Evaluate if effort, intent, and skills were classified correctly
103
+ //
104
+ // Example:
105
+ // execSync(`~/.gramatr/bin/gramatr hook stop --opencode`, {
106
+ // env: { ...process.env, GRAMATR_SESSION_ID: ctx.sessionId },
107
+ // });
108
+ void ctx;
109
+ },
110
+ /**
111
+ * session.updated — Persist session state on update.
112
+ *
113
+ * Equivalent to SessionEnd hook in Claude Code.
114
+ * Saves session state and handoff for continuity across sessions.
115
+ */
116
+ 'session.updated': async (ctx) => {
117
+ // TODO: Call gramatr session-end hook logic
118
+ // - Persist current session state
119
+ // - Save handoff summary for next session resumption
120
+ //
121
+ // Example:
122
+ // execSync(`~/.gramatr/bin/gramatr hook session-end --opencode`, {
123
+ // env: { ...process.env, GRAMATR_SESSION_ID: ctx.sessionId },
124
+ // });
125
+ void ctx;
126
+ },
127
+ };
128
+ export default gramatrPlugin;
129
+ //# sourceMappingURL=gramatr-opencode-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gramatr-opencode-plugin.js","sourceRoot":"","sources":["../../../src/setup/examples/gramatr-opencode-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA6BH;;;;;;;;;GASG;AACH,MAAM,aAAa,GAAmB;IACpC,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gFAAgF;IAE7F;;;;;OAKG;IACH,iBAAiB,EAAE,KAAK,EAAE,GAA0B,EAAiB,EAAE;QACrE,8CAA8C;QAC9C,uDAAuD;QACvD,iDAAiD;QACjD,+DAA+D;QAC/D,EAAE;QACF,oCAAoC;QACpC,uEAAuE;QACvE,kEAAkE;QAClE,QAAQ;QACR,KAAK,GAAG,CAAC;IACX,CAAC;IAED;;;;;OAKG;IACH,qBAAqB,EAAE,KAAK,EAC1B,GAA0B,EAC1B,IAAsB,EACK,EAAE;QAC7B,sCAAsC;QACtC,oDAAoD;QACpD,oDAAoD;QACpD,EAAE;QACF,2CAA2C;QAC3C,oDAAoD;QACpD,iCAAiC;QACjC,EAAE;QACF,WAAW;QACX,6BAA6B;QAC7B,gEAAgE;QAChE,mFAAmF;QACnF,OAAO;QACP,qDAAqD;QACrD,8DAA8D;QAC9D,KAAK,GAAG,CAAC;QACT,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,oBAAoB,EAAE,KAAK,EAAE,GAA0B,EAAE,IAAsB,EAAiB,EAAE;QAChG,wCAAwC;QACxC,qDAAqD;QACrD,iDAAiD;QACjD,yCAAyC;QACzC,EAAE;QACF,WAAW;QACX,sEAAsE;QACtE,8BAA8B;QAC9B,8BAA8B;QAC9B,gCAAgC;QAChC,kCAAkC;QAClC,UAAU;QACV,QAAQ;QACR,KAAK,GAAG,CAAC;QACT,KAAK,IAAI,CAAC;IACZ,CAAC;IAED;;;;;OAKG;IACH,cAAc,EAAE,KAAK,EAAE,GAA0B,EAAiB,EAAE;QAClE,qCAAqC;QACrC,mEAAmE;QACnE,qEAAqE;QACrE,EAAE;QACF,WAAW;QACX,8DAA8D;QAC9D,kEAAkE;QAClE,QAAQ;QACR,KAAK,GAAG,CAAC;IACX,CAAC;IAED;;;;;OAKG;IACH,iBAAiB,EAAE,KAAK,EAAE,GAA0B,EAAiB,EAAE;QACrE,4CAA4C;QAC5C,kCAAkC;QAClC,qDAAqD;QACrD,EAAE;QACF,WAAW;QACX,qEAAqE;QACrE,kEAAkE;QAClE,QAAQ;QACR,KAAK,GAAG,CAAC;IACX,CAAC;CACF,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * AUTO-GENERATED — do not edit manually.
3
+ * Source: contracts/platforms/*.yaml
4
+ * Generator: contracts/generator/generate.ts
5
+ * Generated: 2026-04-15T04:10:43.912Z
6
+ */
7
+ export interface PlatformHookEntry {
8
+ hook: string;
9
+ matcher?: string;
10
+ name?: string;
11
+ statusMessage?: string;
12
+ timeout?: number;
13
+ description?: string;
14
+ }
15
+ export interface PlatformMcpServer {
16
+ command: string;
17
+ timeout?: number;
18
+ env?: Record<string, string>;
19
+ }
20
+ export interface PlatformConfig {
21
+ name: string;
22
+ display_name: string;
23
+ description: string;
24
+ client_flag: string;
25
+ config_file: string;
26
+ hooks: Record<string, PlatformHookEntry[]>;
27
+ mcp_server: PlatformMcpServer;
28
+ instruction_blocks: string[];
29
+ }
30
+ /** ChatGPT Approved Add-on — ChatGPT official plugin/add-on — sandbox environment, OAuth auth, OpenAPI manifest */
31
+ export declare const CHATGPT_ADDON_HOOKS: PlatformConfig;
32
+ /** ChatGPT Desktop — ChatGPT Desktop app integration via MCP server config (hookless) */
33
+ export declare const CHATGPT_DESKTOP_HOOKS: PlatformConfig;
34
+ /** ChatGPT Custom GPT — ChatGPT Custom GPT instructions — ~8000 char budget, MCP pre-wired at GPT level, shareable link */
35
+ export declare const CHATGPT_GPT_HOOKS: PlatformConfig;
36
+ /** ChatGPT Project — ChatGPT Project instructions — 5000 char budget, MCP connected at project level */
37
+ export declare const CHATGPT_PROJECT_HOOKS: PlatformConfig;
38
+ /** ChatGPT Web — ChatGPT Web (chat.openai.com) integration via MCP — hookless, paste into personal prompt or custom GPT */
39
+ export declare const CHATGPT_WEB_HOOKS: PlatformConfig;
40
+ /** Claude Add-on — Claude.ai official MCP add-on — Anthropic partner program, sandbox environment */
41
+ export declare const CLAUDE_ADDON_HOOKS: PlatformConfig;
42
+ /** Claude Code — Claude Code CLI integration with full hook lifecycle */
43
+ export declare const CLAUDE_CODE_HOOKS: PlatformConfig;
44
+ /** Claude Desktop — Claude Desktop app integration via MCP server config (hookless) */
45
+ export declare const CLAUDE_DESKTOP_HOOKS: PlatformConfig;
46
+ /** Claude Project — Claude.ai Project instructions — larger budget than personal, MCP connected at project level */
47
+ export declare const CLAUDE_PROJECT_HOOKS: PlatformConfig;
48
+ /** Claude Web — Claude Web (claude.ai) integration via MCP — hookless, paste instructions into personal prompt */
49
+ export declare const CLAUDE_WEB_HOOKS: PlatformConfig;
50
+ /** Codex — OpenAI Codex CLI integration with session and prompt hooks */
51
+ export declare const CODEX_HOOKS: PlatformConfig;
52
+ /** Cursor — Cursor IDE integration via MCP server config (hookless, uses route_request) */
53
+ export declare const CURSOR_HOOKS: PlatformConfig;
54
+ /** Gemini CLI — Gemini CLI integration via extension manifest and hooks */
55
+ export declare const GEMINI_CLI_HOOKS: PlatformConfig;
56
+ /** OpenCode — OpenCode plugin-based integration (no hooks file, uses plugin architecture) */
57
+ export declare const OPENCODE_HOOKS: PlatformConfig;
58
+ /** VS Code — VS Code integration with Copilot/Continue via MCP server config (hookless) */
59
+ export declare const VSCODE_HOOKS: PlatformConfig;
60
+ /** Windsurf — Windsurf IDE integration via MCP server config (hookless) */
61
+ export declare const WINDSURF_HOOKS: PlatformConfig;
62
+ /** All platform configs keyed by platform name */
63
+ export declare const PLATFORM_HOOKS: Record<string, PlatformConfig>;
64
+ //# sourceMappingURL=platform-hooks.d.ts.map
@@ -0,0 +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,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC3C,UAAU,EAAE,iBAAiB,CAAC;IAC9B,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,mHAAmH;AACnH,eAAO,MAAM,mBAAmB,EAAE,cAwBxB,CAAC;AAEX,yFAAyF;AACzF,eAAO,MAAM,qBAAqB,EAAE,cAsB1B,CAAC;AAEX,2HAA2H;AAC3H,eAAO,MAAM,iBAAiB,EAAE,cAuBtB,CAAC;AAEX,wGAAwG;AACxG,eAAO,MAAM,qBAAqB,EAAE,cAsB1B,CAAC;AAEX,2HAA2H;AAC3H,eAAO,MAAM,iBAAiB,EAAE,cAkBtB,CAAC;AAEX,qGAAqG;AACr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