@kawacode/mcp 5.0.2 → 5.1.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 (33) hide show
  1. package/README.md +52 -62
  2. package/build/services/muninn-ipc.d.ts +1 -1
  3. package/build/services/muninn-ipc.js +1 -1
  4. package/build/tools/evolve-decisions.d.ts +0 -6
  5. package/build/tools/evolve-decisions.js +1 -3
  6. package/build/tools/evolve-decisions.js.map +1 -1
  7. package/build/tools/get-session-decisions.d.ts +1 -0
  8. package/build/tools/get-session-decisions.js.map +1 -1
  9. package/build/tools/index.d.ts +3 -6
  10. package/build/tools/infer-history.d.ts +2 -6
  11. package/build/tools/infer-history.js +26 -12
  12. package/build/tools/infer-history.js.map +1 -1
  13. package/build/tools/record-decision.d.ts +6 -0
  14. package/build/tools/record-decision.js +2 -0
  15. package/build/tools/record-decision.js.map +1 -1
  16. package/build/tools/resolve-origin.js +1 -0
  17. package/build/tools/resolve-origin.js.map +1 -1
  18. package/package.json +1 -1
  19. package/build/services/active-intent-store.d.ts +0 -36
  20. package/build/services/active-intent-store.js +0 -45
  21. package/build/services/active-intent-store.js.map +0 -1
  22. package/build/services/kawa-api.d.ts +0 -131
  23. package/build/services/kawa-api.js +0 -239
  24. package/build/services/kawa-api.js.map +0 -1
  25. package/build/services/repo-encryption.d.ts +0 -46
  26. package/build/services/repo-encryption.js +0 -92
  27. package/build/services/repo-encryption.js.map +0 -1
  28. package/build/services/storage-decryption.d.ts +0 -52
  29. package/build/services/storage-decryption.js +0 -162
  30. package/build/services/storage-decryption.js.map +0 -1
  31. package/build/tools/get-project-context.d.ts +0 -82
  32. package/build/tools/get-project-context.js +0 -73
  33. package/build/tools/get-project-context.js.map +0 -1
package/README.md CHANGED
@@ -24,28 +24,12 @@ This MCP server enables AI coding assistants to understand what you're working o
24
24
  - **Decision recording**: Track architectural decisions and trade-offs with constraint validation
25
25
  - **Code block assignment**: Associate code changes with intents for better commit history
26
26
 
27
- ## Usage
28
-
29
- The MCP server works together with Kawa Code, AI code generators such as Cursor, Claude Code,
30
- and the Kawa Code extensions.
31
-
32
- ## Key Features
33
-
34
- - **Context Persistence**: Never lose track of what you were working on across AI sessions
35
- - **Smart Context Retrieval**: Relevance-based context loading - only fetch what's needed for the current task
36
- - **Zero-Knowledge Encryption**: Code blocks encrypted client-side before cloud sync, API cannot decrypt
37
- - **Team Conflict Detection**: Know when teammates are working on the same files/lines
38
- - **Decision Tracking**: Record architectural decisions with constraint validation and conflict detection
39
- - **Commit Integration**: Link all code changes to intent context for better git history
40
- - **Cross-Platform**: Works with Claude Code and Cursor AI via MCP protocol
41
-
42
27
  ## Prerequisites
43
28
 
44
29
  ### Required
45
30
 
46
31
  - **Node.js >= 18.0.0** — runtime for the MCP server
47
- - **[Kawa Code](https://codeawareness.com/product) desktop app running** — kawa.mcp is a thin MCP-to-IPC adapter; all git operations, storage, and API communication happen in Kawa Code
48
- - **Active Kawa Code account** — for cloud sync and team features
32
+ - **[Kawa Code](https://kawacode.ai) desktop app running** — kawa.mcp is a thin MCP-to-IPC adapter; all git operations, storage, and API communication happen in Kawa Code
49
33
 
50
34
  ### Optional (for history inference)
51
35
 
@@ -54,63 +38,27 @@ and the Kawa Code extensions.
54
38
 
55
39
  ## Installation
56
40
 
57
- ```bash
58
- # Clone the repository (if not already cloned)
59
- cd /path/to/kawa.mcp
60
-
61
- # Install dependencies
62
- npm install
63
-
64
- # Build the TypeScript source
65
- npm run build
66
- ```
67
-
68
- ## Quick Start
69
-
70
- 1. **Start Kawa Code**: Launch the Kawa Code desktop app and log in
71
- 2. **Configure MCP**: Add kawa.mcp to your AI assistant's MCP configuration (see Configuration section)
72
- 3. **Restart AI**: Restart Claude Code or Cursor to load the MCP server
73
- 4. **Test connection**: The server will try to connect to Kawa Code on startup
74
- 5. **Start coding**: Use `check_active_intent` to begin tracking your work
75
-
76
- ## Setting Up CLAUDE.md
77
-
78
- For Claude Code to use the MCP tools effectively, your project needs a `CLAUDE.md` file that tells Claude *when* to call the tools and provides your repository coordinates.
79
-
80
- Copy the example template into your project root and fill in the placeholders:
41
+ Add the MCP server to Claude Code (available across all your projects):
81
42
 
82
43
  ```bash
83
- cp /path/to/kawa.mcp/CLAUDE.md.example /path/to/your-project/CLAUDE.md
44
+ claude mcp add kawa-intents --scope user -- npx -y @kawacode/mcp
84
45
  ```
85
46
 
86
- Or just merge the example with your own content.
87
- See [`CLAUDE.md.example`](./CLAUDE.md.example) for the full template with optional sections for monorepos, code style, and architecture.
88
-
89
- ## Configuration
90
-
91
- ### Claude Code
92
-
93
- Create a `.mcp.json` file in your project root (recommended for teams — commit it to git):
47
+ Or for a single project, create a `.mcp.json` file in your project root (recommended for teams — commit it to git):
94
48
 
95
49
  ```json
96
50
  {
97
51
  "mcpServers": {
98
52
  "kawa-intents": {
99
53
  "type": "stdio",
100
- "command": "node",
101
- "args": ["/absolute/path/to/kawa.mcp/build/index.js"]
54
+ "command": "npx",
55
+ "args": ["-y", "@kawacode/mcp"]
102
56
  }
103
57
  }
104
58
  }
105
59
  ```
106
60
 
107
- Or add it at user level (available across all your projects):
108
-
109
- ```bash
110
- claude mcp add --transport stdio kawa-intents --scope user -- node /absolute/path/to/kawa.mcp/build/index.js
111
- ```
112
-
113
- ### Cursor AI
61
+ #### Cursor AI setup
114
62
 
115
63
  Add to your Cursor MCP configuration (`~/.cursor/mcp.json`):
116
64
 
@@ -118,14 +66,56 @@ Add to your Cursor MCP configuration (`~/.cursor/mcp.json`):
118
66
  {
119
67
  "mcpServers": {
120
68
  "kawa-intents": {
121
- "command": "node",
122
- "args": ["/absolute/path/to/kawa.mcp/build/index.js"]
69
+ "command": "npx",
70
+ "args": ["-y", "@kawacode/mcp"]
123
71
  }
124
72
  }
125
73
  }
126
74
  ```
127
75
 
128
- **Important:** Use absolute paths, not relative paths or `~` shortcuts.
76
+ ## Quick Start
77
+
78
+ 1. **Start Kawa Code**: Launch the Kawa Code desktop app and log in
79
+ 2. **Install MCP**: Run `claude mcp add kawa-intents --scope user -- npx -y @kawacode/mcp`
80
+ 3. **Restart AI**: Restart Claude Code or Cursor to load the MCP server
81
+ 4. **Test connection**: The server will try to connect to Kawa Code on startup
82
+ 5. **Start coding**: You'll start seeing `check_active_intent` at the start of your work with Claude Code
83
+
84
+ ## Setting Up CLAUDE.md
85
+
86
+ #### Quick prompt to tell Claude Code to set up everything:
87
+
88
+ ```
89
+ Read the CLAUDE.md.example file from the @kawacode/mcp package and create a CLAUDE.md in this project's root. Fill in the repoOrigin and repoPath with the actual values from this repository's git config. Fill in the Project Overview with a brief description of this project.
90
+ ```
91
+
92
+ After this, you can start working using your usual workflow. Kawa Code will automatically start improving your LLM's code generation quality.
93
+
94
+ To benefit from Kawa Code's intent-driven development immediately, tell Claude Code to infer code decisions from your git history:
95
+
96
+ ```
97
+ Please run the infer history tool on tier 5, with a maximum 3000 commit history.
98
+ ```
99
+
100
+ This can take a while, depending on how many commits you asked it to analyze. You'll see a progress bar in Kawa Code application.
101
+ Once this is done, you can open the project in Kawa Code (or you can use one of Kawa Code extensions for Visual Studio Code, emacs, or vim) to see the intents at every step in the code evolution.
102
+ Kawa Code will now select the relevant intents and micro-decisions made to speed up code generation, issue troubleshooting, bug fixing etc.
103
+ This relevant context will also help generating a more correct solution to your prompt request.
104
+
105
+ ## Usage
106
+
107
+ The MCP server works together with Kawa Code, AI code generators such as Cursor, Claude Code,
108
+ and the Kawa Code extensions.
109
+
110
+ ## Key Features
111
+
112
+ - **Context Persistence**: Never lose track of what you were working on across AI sessions
113
+ - **Smart Context Retrieval**: Relevance-based context loading - only fetch what's needed for the current task
114
+ - **Zero-Knowledge Encryption**: Code blocks encrypted client-side before cloud sync, API cannot decrypt
115
+ - **Team Conflict Detection**: Know when teammates are working on the same files/lines
116
+ - **Decision Tracking**: Record architectural decisions with constraint validation and conflict detection
117
+ - **Commit Integration**: Link all code changes to intent context for better git history
118
+ - **Cross-Platform**: Works with Claude Code and Cursor AI via MCP protocol
129
119
 
130
120
  ## Available Tools
131
121
 
@@ -29,7 +29,7 @@ export declare function request(domain: string, action: string, data?: any): Pro
29
29
  * Ensure a repository path is registered with Muninn as a project.
30
30
  *
31
31
  * Sends `code:add` with the folder path so Muninn activates the project,
32
- * sets up git state, and pulls intents/decisions/lessons from the API.
32
+ * sets up git state, and pulls intents/decisions from the API.
33
33
  * Always sends the request — Muninn's AddHandler is idempotent and
34
34
  * returns the existing project if already added.
35
35
  * Errors are logged but not thrown — repo registration is best-effort.
@@ -233,7 +233,7 @@ export async function request(domain, action, data = {}) {
233
233
  * Ensure a repository path is registered with Muninn as a project.
234
234
  *
235
235
  * Sends `code:add` with the folder path so Muninn activates the project,
236
- * sets up git state, and pulls intents/decisions/lessons from the API.
236
+ * sets up git state, and pulls intents/decisions from the API.
237
237
  * Always sends the request — Muninn's AddHandler is idempotent and
238
238
  * returns the existing project if already added.
239
239
  * Errors are logged but not thrown — repo registration is best-effort.
@@ -1,18 +1,15 @@
1
1
  import { z } from 'zod';
2
2
  export declare const evolveDecisionsSchema: z.ZodObject<{
3
3
  stories: z.ZodArray<z.ZodAny, "many">;
4
- apiKey: z.ZodString;
5
4
  model: z.ZodDefault<z.ZodOptional<z.ZodString>>;
6
5
  repoPath: z.ZodOptional<z.ZodString>;
7
6
  repoOrigin: z.ZodOptional<z.ZodString>;
8
7
  }, "strip", z.ZodTypeAny, {
9
- apiKey: string;
10
8
  model: string;
11
9
  stories: any[];
12
10
  repoOrigin?: string | undefined;
13
11
  repoPath?: string | undefined;
14
12
  }, {
15
- apiKey: string;
16
13
  stories: any[];
17
14
  repoOrigin?: string | undefined;
18
15
  repoPath?: string | undefined;
@@ -29,18 +26,15 @@ export declare const evolveDecisionsTool: {
29
26
  description: string;
30
27
  inputSchema: z.ZodObject<{
31
28
  stories: z.ZodArray<z.ZodAny, "many">;
32
- apiKey: z.ZodString;
33
29
  model: z.ZodDefault<z.ZodOptional<z.ZodString>>;
34
30
  repoPath: z.ZodOptional<z.ZodString>;
35
31
  repoOrigin: z.ZodOptional<z.ZodString>;
36
32
  }, "strip", z.ZodTypeAny, {
37
- apiKey: string;
38
33
  model: string;
39
34
  stories: any[];
40
35
  repoOrigin?: string | undefined;
41
36
  repoPath?: string | undefined;
42
37
  }, {
43
- apiKey: string;
44
38
  stories: any[];
45
39
  repoOrigin?: string | undefined;
46
40
  repoPath?: string | undefined;
@@ -2,7 +2,6 @@ import { z } from 'zod';
2
2
  import { request } from '../services/muninn-ipc.js';
3
3
  export const evolveDecisionsSchema = z.object({
4
4
  stories: z.array(z.any()).describe('Array of story objects from a previous infer_history run'),
5
- apiKey: z.string().describe('Anthropic API key for LLM calls (customer\'s own key)'),
6
5
  model: z.string().optional().default('claude-haiku-4-5-20251001').describe('Anthropic model for edge classification (default: claude-haiku-4-5-20251001, cheaper model recommended)'),
7
6
  repoPath: z.string().optional().describe('Local path to the repository root (required for auto-persist after evolution)'),
8
7
  repoOrigin: z.string().optional().describe('Git remote origin URL (auto-detected from repoPath if not provided)'),
@@ -10,7 +9,6 @@ export const evolveDecisionsSchema = z.object({
10
9
  export async function evolveDecisions(input) {
11
10
  const res = await request('inference', 'evolve', {
12
11
  stories: input.stories,
13
- apiKey: input.apiKey,
14
12
  model: input.model,
15
13
  repoPath: input.repoPath,
16
14
  repoOrigin: input.repoOrigin,
@@ -36,7 +34,7 @@ This analyzes how decisions relate across stories over time:
36
34
 
37
35
  Note: \`infer_history\` already chains evolve + persist automatically. Use this tool only if you want to run evolution separately on a pre-existing set of stories.
38
36
 
39
- If \`repoPath\` is provided, curated stories are automatically persisted as intents with decisions and lessons after evolution completes.
37
+ If \`repoPath\` is provided, curated stories are automatically persisted as intents with decisions after evolution completes.
40
38
 
41
39
  The pipeline runs asynchronously — returns immediately. Uses a cheaper model (haiku) by default since edge classification requires less reasoning than story analysis.`,
42
40
  inputSchema: evolveDecisionsSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"evolve-decisions.js","sourceRoot":"","sources":["../../src/tools/evolve-decisions.ts"],"names":[],"mappings":"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WAAW,EAAE;;;;;;;;;;;;;;;;uKAgBwJ;IACrK,WAAW,EAAE,qBAAqB;IAClC,OAAO,EAAE,eAAe;CACzB,CAAA"}
@@ -27,6 +27,7 @@ export interface DecisionPoint {
27
27
  context?: string;
28
28
  alternatives: string[];
29
29
  consequences?: string;
30
+ symptom?: string;
30
31
  relatedFiles: string[];
31
32
  constraintsChecked: string[];
32
33
  constraintViolations: ConstraintViolation[];
@@ -1 +1 @@
1
- {"version":3,"file":"get-session-decisions.js","sourceRoot":"","sources":["../../src/tools/get-session-decisions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6EAA6E,CAAC;IACzH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAClE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;CACpE,CAAC,CAAA;AA8BF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,KAA+B;IACvE,MAAM,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IACpE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE;QAC5C,UAAU,EAAE,YAAY;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CAAA;IAEF,MAAM,SAAS,GAAoB,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,E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5B,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,YAAY,EAAE,CAAC,CAAC,YAAY,IAAI,EAAE;QAClC,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,YAAY,EAAE,CAAC,CAAC,aAAa,IAAI,CAAC,CAAC,YAAY,IAAI,EAAE;QACrD,kBAAkB,EAAE,CAAC,CAAC,mBAAmB,IAAI,CAAC,CAAC,kBAAkB,IAAI,EAAE;QACvE,oBAAoB,EAAE,CAAC,CAAC,qBAAqB,IAAI,CAAC,CAAC,oBAAoB,IAAI,EAAE;KAC9E,CAAC,CAAC,CAAA;IAEH,OAAO;QACL,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,SAAS;QACT,KAAK,EAAE,SAAS,CAAC,MAAM;KACxB,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE;;;;;;;;sCAQuB;IACpC,WAAW,EAAE,yBAAyB;IACtC,OAAO,EAAE,mBAAmB;CAC7B,CAAA"}
@@ -249,6 +249,7 @@ export declare const allTools: ({
249
249
  context: import("zod").ZodOptional<import("zod").ZodString>;
250
250
  alternatives: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
251
251
  consequences: import("zod").ZodOptional<import("zod").ZodString>;
252
+ symptom: import("zod").ZodOptional<import("zod").ZodString>;
252
253
  relatedFiles: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
253
254
  constraintsChecked: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
254
255
  constraintViolations: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
@@ -274,6 +275,7 @@ export declare const allTools: ({
274
275
  context?: string | undefined;
275
276
  alternatives?: string[] | undefined;
276
277
  consequences?: string | undefined;
278
+ symptom?: string | undefined;
277
279
  relatedFiles?: string[] | undefined;
278
280
  constraintsChecked?: string[] | undefined;
279
281
  constraintViolations?: {
@@ -291,6 +293,7 @@ export declare const allTools: ({
291
293
  intentId?: string | undefined;
292
294
  alternatives?: string[] | undefined;
293
295
  consequences?: string | undefined;
296
+ symptom?: string | undefined;
294
297
  relatedFiles?: string[] | undefined;
295
298
  constraintsChecked?: string[] | undefined;
296
299
  constraintViolations?: {
@@ -600,7 +603,6 @@ export declare const allTools: ({
600
603
  description: string;
601
604
  inputSchema: import("zod").ZodObject<{
602
605
  repoPath: import("zod").ZodString;
603
- apiKey: import("zod").ZodString;
604
606
  commits: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
605
607
  tier: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
606
608
  contextIssues: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
@@ -610,7 +612,6 @@ export declare const allTools: ({
610
612
  estimateOnly: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
611
613
  }, "strip", import("zod").ZodTypeAny, {
612
614
  repoPath: string;
613
- apiKey: string;
614
615
  commits: number;
615
616
  tier: number;
616
617
  contextIssues: boolean;
@@ -620,7 +621,6 @@ export declare const allTools: ({
620
621
  estimateOnly: boolean;
621
622
  }, {
622
623
  repoPath: string;
623
- apiKey: string;
624
624
  commits?: number | undefined;
625
625
  tier?: number | undefined;
626
626
  contextIssues?: boolean | undefined;
@@ -635,18 +635,15 @@ export declare const allTools: ({
635
635
  description: string;
636
636
  inputSchema: import("zod").ZodObject<{
637
637
  stories: import("zod").ZodArray<import("zod").ZodAny, "many">;
638
- apiKey: import("zod").ZodString;
639
638
  model: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
640
639
  repoPath: import("zod").ZodOptional<import("zod").ZodString>;
641
640
  repoOrigin: import("zod").ZodOptional<import("zod").ZodString>;
642
641
  }, "strip", import("zod").ZodTypeAny, {
643
- apiKey: string;
644
642
  model: string;
645
643
  stories: any[];
646
644
  repoOrigin?: string | undefined;
647
645
  repoPath?: string | undefined;
648
646
  }, {
649
- apiKey: string;
650
647
  stories: any[];
651
648
  repoOrigin?: string | undefined;
652
649
  repoPath?: string | undefined;
@@ -1,7 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const inferHistorySchema: z.ZodObject<{
3
3
  repoPath: z.ZodString;
4
- apiKey: z.ZodString;
5
4
  commits: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
6
5
  tier: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7
6
  contextIssues: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -11,7 +10,6 @@ export declare const inferHistorySchema: z.ZodObject<{
11
10
  estimateOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
12
11
  }, "strip", z.ZodTypeAny, {
13
12
  repoPath: string;
14
- apiKey: string;
15
13
  commits: number;
16
14
  tier: number;
17
15
  contextIssues: boolean;
@@ -21,7 +19,6 @@ export declare const inferHistorySchema: z.ZodObject<{
21
19
  estimateOnly: boolean;
22
20
  }, {
23
21
  repoPath: string;
24
- apiKey: string;
25
22
  commits?: number | undefined;
26
23
  tier?: number | undefined;
27
24
  contextIssues?: boolean | undefined;
@@ -43,6 +40,8 @@ export interface InferHistoryResponse {
43
40
  est_stories: number;
44
41
  cost_usd: number;
45
42
  };
43
+ forge?: string;
44
+ forge_cli_available?: boolean;
46
45
  commit_count?: number;
47
46
  message: string;
48
47
  }
@@ -52,7 +51,6 @@ export declare const inferHistoryTool: {
52
51
  description: string;
53
52
  inputSchema: z.ZodObject<{
54
53
  repoPath: z.ZodString;
55
- apiKey: z.ZodString;
56
54
  commits: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
57
55
  tier: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
58
56
  contextIssues: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -62,7 +60,6 @@ export declare const inferHistoryTool: {
62
60
  estimateOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
63
61
  }, "strip", z.ZodTypeAny, {
64
62
  repoPath: string;
65
- apiKey: string;
66
63
  commits: number;
67
64
  tier: number;
68
65
  contextIssues: boolean;
@@ -72,7 +69,6 @@ export declare const inferHistoryTool: {
72
69
  estimateOnly: boolean;
73
70
  }, {
74
71
  repoPath: string;
75
- apiKey: string;
76
72
  commits?: number | undefined;
77
73
  tier?: number | undefined;
78
74
  contextIssues?: boolean | undefined;
@@ -2,34 +2,46 @@ import { z } from 'zod';
2
2
  import { request } from '../services/muninn-ipc.js';
3
3
  export const inferHistorySchema = z.object({
4
4
  repoPath: z.string().describe('Local path to the repository root'),
5
- apiKey: z.string().describe('Anthropic API key for LLM calls (customer\'s own key)'),
6
5
  commits: z.number().optional().default(50).describe('Number of recent commits to analyze (default: 50)'),
7
- tier: z.number().optional().default(4).describe('Enrichment tier 1-5: 1=git log, 2=+PR descriptions, 3=+revert diffs, 4=+issue discussions, 5=+full diffs (default: 4)'),
6
+ tier: z.number().optional().default(5).describe('Enrichment tier 1-5: 1=git log, 2=+PR/MR descriptions (needs gh/glab), 3=+revert diffs, 4=+issue discussions (needs gh/glab), 5=+full diffs (default: 5)'),
8
7
  contextIssues: z.boolean().optional().default(false).describe('Include context issues from commit date range (Tier 4 only)'),
9
8
  model: z.string().optional().default('claude-sonnet-4-20250514').describe('Anthropic model to use (default: claude-sonnet-4-20250514)'),
10
9
  maxStories: z.number().optional().default(0).describe('Maximum stories to analyze in Pass 2 (0 = unlimited)'),
11
10
  allowCommitSplitting: z.boolean().optional().default(false).describe('Allow splitting a single commit into multiple stories when it contains unrelated changes (recommended for repos with messy commit history)'),
12
- estimateOnly: z.boolean().optional().default(false).describe('If true, only estimate token cost without running the pipeline'),
11
+ estimateOnly: z.boolean().optional().default(true).describe('If true (default), only estimate token cost without running the pipeline. Set to false to run the full pipeline.'),
13
12
  });
14
13
  export async function inferHistory(input) {
15
14
  if (input.estimateOnly) {
16
15
  const res = await request('inference', 'estimate', {
17
16
  repoPath: input.repoPath,
18
- apiKey: input.apiKey,
19
17
  commits: input.commits,
20
18
  tier: input.tier,
21
19
  contextIssues: input.contextIssues,
22
20
  model: input.model,
23
21
  });
22
+ let forgeWarning = '';
23
+ if (input.tier >= 2 && !res.forge_cli_available) {
24
+ const forge = res.forge ?? 'Unknown';
25
+ if (forge === 'Unknown') {
26
+ forgeWarning = '\n⚠ Unrecognized git hosting platform. Tiers 2 (PR/MR descriptions) and 4 (issue discussions) will be skipped.';
27
+ }
28
+ else if (forge === 'GitHub') {
29
+ forgeWarning = '\n⚠ GitHub CLI (gh) not found or not authenticated. Tiers 2 and 4 will be skipped. Run `gh auth login` to include PR and issue context.';
30
+ }
31
+ else if (forge === 'GitLab') {
32
+ forgeWarning = '\n⚠ GitLab CLI (glab) not found or not authenticated. Tiers 2 and 4 will be skipped. Run `glab auth login` to include MR and issue context.';
33
+ }
34
+ }
24
35
  return {
25
36
  estimate: res.estimate,
37
+ forge: res.forge,
38
+ forge_cli_available: res.forge_cli_available,
26
39
  commit_count: res.commit_count,
27
- message: `Estimated cost: $${res.estimate?.cost_usd ?? '?'} for ~${res.estimate?.est_stories ?? '?'} stories from ${res.commit_count ?? '?'} commits`
40
+ message: `Estimated cost: $${res.estimate?.cost_usd ?? '?'} for ~${res.estimate?.est_stories ?? '?'} stories from ${res.commit_count ?? '?'} commits${forgeWarning}`
28
41
  };
29
42
  }
30
43
  const res = await request('inference', 'run', {
31
44
  repoPath: input.repoPath,
32
- apiKey: input.apiKey,
33
45
  commits: input.commits,
34
46
  tier: input.tier,
35
47
  contextIssues: input.contextIssues,
@@ -44,14 +56,14 @@ export async function inferHistory(input) {
44
56
  }
45
57
  export const inferHistoryTool = {
46
58
  name: 'infer_history',
47
- description: `Analyze git commit history to extract structured development knowledge (intents, decisions, lessons).
59
+ description: `Analyze git commit history to extract structured development knowledge (intents and decisions).
48
60
 
49
61
  Runs the full pipeline automatically: infer → evolve → persist.
50
62
 
51
63
  1. **Pass 1**: Groups commits into coherent development stories with value hints
52
- 2. **Pass 2**: Deep analysis of each story to extract architectural decisions and lessons
64
+ 2. **Pass 2**: Deep analysis of each story to extract architectural decisions
53
65
  3. **Evolution**: Curates decisions by finding relationships (supersedes, reinforces, contradicts, specializes)
54
- 4. **Persist**: Stores curated stories as intents with decisions and lessons (auto-syncs to cloud)
66
+ 4. **Persist**: Stores curated stories as intents with decisions (auto-syncs to cloud)
55
67
 
56
68
  Use \`estimateOnly: true\` first to preview token cost before running the full pipeline.
57
69
 
@@ -59,10 +71,12 @@ The pipeline supports checkpointing — if interrupted, re-running resumes from
59
71
 
60
72
  Enrichment tiers control how much context is gathered:
61
73
  - Tier 1: Git log only (fastest, cheapest)
62
- - Tier 2: + PR descriptions and review comments
74
+ - Tier 2: + PR/MR descriptions and review comments (requires forge CLI: gh or glab)
63
75
  - Tier 3: + Diffs for revert commits
64
- - Tier 4: + GitHub issue discussions with decision-level content (recommended)
65
- - Tier 5: + Full diffs and code annotation extraction (most expensive)`,
76
+ - Tier 4: + Issue discussions with decision-level content (requires forge CLI)
77
+ - Tier 5: + Full diffs and code annotation extraction (most expensive)
78
+
79
+ Supports GitHub (gh CLI) and GitLab (glab CLI). Forge is auto-detected from the remote origin.`,
66
80
  inputSchema: inferHistorySchema,
67
81
  handler: inferHistory
68
82
  };
@@ -1 +1 @@
1
- {"version":3,"file":"infer-history.js","sourceRoot":"","sources":["../../src/tools/infer-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAClE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IACpF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ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oB;KACjD,CAAC,CAAA;IAEF,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,iFAAiF;KAC1G,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;+FAoBgF;IAC7F,WAAW,EAAE,kBAAkB;IAC/B,OAAO,EAAE,YAAY;CACtB,CAAA"}
@@ -9,6 +9,7 @@ export declare const recordDecisionSchema: z.ZodObject<{
9
9
  context: z.ZodOptional<z.ZodString>;
10
10
  alternatives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
11
11
  consequences: z.ZodOptional<z.ZodString>;
12
+ symptom: z.ZodOptional<z.ZodString>;
12
13
  relatedFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
14
  constraintsChecked: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
14
15
  constraintViolations: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -34,6 +35,7 @@ export declare const recordDecisionSchema: z.ZodObject<{
34
35
  context?: string | undefined;
35
36
  alternatives?: string[] | undefined;
36
37
  consequences?: string | undefined;
38
+ symptom?: string | undefined;
37
39
  relatedFiles?: string[] | undefined;
38
40
  constraintsChecked?: string[] | undefined;
39
41
  constraintViolations?: {
@@ -51,6 +53,7 @@ export declare const recordDecisionSchema: z.ZodObject<{
51
53
  intentId?: string | undefined;
52
54
  alternatives?: string[] | undefined;
53
55
  consequences?: string | undefined;
56
+ symptom?: string | undefined;
54
57
  relatedFiles?: string[] | undefined;
55
58
  constraintsChecked?: string[] | undefined;
56
59
  constraintViolations?: {
@@ -78,6 +81,7 @@ export declare const recordDecisionTool: {
78
81
  context: z.ZodOptional<z.ZodString>;
79
82
  alternatives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
80
83
  consequences: z.ZodOptional<z.ZodString>;
84
+ symptom: z.ZodOptional<z.ZodString>;
81
85
  relatedFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
82
86
  constraintsChecked: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
83
87
  constraintViolations: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -103,6 +107,7 @@ export declare const recordDecisionTool: {
103
107
  context?: string | undefined;
104
108
  alternatives?: string[] | undefined;
105
109
  consequences?: string | undefined;
110
+ symptom?: string | undefined;
106
111
  relatedFiles?: string[] | undefined;
107
112
  constraintsChecked?: string[] | undefined;
108
113
  constraintViolations?: {
@@ -120,6 +125,7 @@ export declare const recordDecisionTool: {
120
125
  intentId?: string | undefined;
121
126
  alternatives?: string[] | undefined;
122
127
  consequences?: string | undefined;
128
+ symptom?: string | undefined;
123
129
  relatedFiles?: string[] | undefined;
124
130
  constraintsChecked?: string[] | undefined;
125
131
  constraintViolations?: {
@@ -17,6 +17,7 @@ export const recordDecisionSchema = z.object({
17
17
  context: z.string().optional().describe('What we were trying to accomplish when this decision was made'),
18
18
  alternatives: z.array(z.string()).optional().describe('Other options that were considered'),
19
19
  consequences: z.string().optional().describe('Downstream implications of this decision'),
20
+ symptom: z.string().optional().describe('Observable symptom that indicates this decision is relevant (e.g., error messages, runtime panics, unexpected behavior). Useful for discovery and constraint decisions.'),
20
21
  relatedFiles: z.array(z.string()).optional().describe('File paths affected by this decision'),
21
22
  constraintsChecked: z.array(z.string()).optional().describe('Which architectural constraints were verified before this decision'),
22
23
  constraintViolations: z.array(constraintViolationSchema).optional()
@@ -33,6 +34,7 @@ export async function recordDecision(input) {
33
34
  context: input.context,
34
35
  alternatives: input.alternatives || [],
35
36
  consequences: input.consequences,
37
+ symptom: input.symptom,
36
38
  relatedFiles: input.relatedFiles || [],
37
39
  constraintsChecked: input.constraintsChecked || [],
38
40
  constraintViolations: input.constraintViolations || [],
@@ -1 +1 @@
1
- {"version":3,"file":"record-decision.js","sourceRoot":"","sources":["../../src/tools/record-decision.ts"],"names":[],"mappings":"A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K,CAAC,QAAQ,CAAC,CAAA;IAC9D,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE;QAC9C,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE;QAC9B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,YAAY,EAAE,KAAK,CAAC,YAAY,IAAI,EAAE;QACtC,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,YAAY,EAAE,KAAK,CAAC,YAAY,IAAI,EAAE;QACtC,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,IAAI,EAAE;QAClD,oBAAoB,EAAE,KAAK,CAAC,oBAAoB,IAAI,EAAE;KACvD,CAAC,CAAA;IAEF,OAAO;QACL,QAAQ,EAAE,GAAG,CAAC,OAAO,KAAK,KAAK;QAC/B,UAAU,EAAE,GAAG,CAAC,UAAU,IAAI,EAAE;KACjC,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;;;;;;;;;;;;;;;yGAe0F;IACvG,WAAW,EAAE,oBAAoB;IACjC,OAAO,EAAE,cAAc;CACxB,CAAA"}
@@ -18,6 +18,7 @@ export function resolveOrigin(repoOrigin, repoPath) {
18
18
  cwd: repoPath,
19
19
  encoding: 'utf-8',
20
20
  timeout: 5000,
21
+ windowsHide: true,
21
22
  }).trim();
22
23
  if (origin)
23
24
  return origin;
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-origin.js","sourceRoot":"","sources":["../../src/tools/resolve-origin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,UAA8B,EAAE,QAAiB;IAC7E,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,QAAQ,CAAC,oCAAoC,EAAE;gBAC5D,GAAG,EAAE,QAAQ;gBACb,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE,IAAI;aACd,CAAC,CAAC,IAAI,EAAE,CAAA;YACT,IAAI,MAAM;gBAAE,OAAO,MAAM,CAAA;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,sCAAsC;QACxC,CAAC;IACH,CAAC;IACD,IAAI,UAAU;QAAE,OAAO,UAAU,CAAA;IACjC,MAAM,IAAI,KAAK,CACb,uHAAuH,CACxH,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"resolve-origin.js","sourceRoot":"","sources":["../../src/tools/resolve-origin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,UAA8B,EAAE,QAAiB;IAC7E,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,QAAQ,CAAC,oCAAoC,EAAE;gBAC5D,GAAG,EAAE,QAAQ;gBACb,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE,IAAI;gBACb,WAAW,EAAE,IAAI;aAClB,CAAC,CAAC,IAAI,EAAE,CAAA;YACT,IAAI,MAAM;gBAAE,OAAO,MAAM,CAAA;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,sCAAsC;QACxC,CAAC;IACH,CAAC;IACD,IAAI,UAAU;QAAE,OAAO,UAAU,CAAA;IACjC,MAAM,IAAI,KAAK,CACb,uHAAuH,CACxH,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kawacode/mcp",
3
- "version": "5.0.2",
3
+ "version": "5.1.1",
4
4
  "description": "MCP server for Kawa Code intent integration with Claude Code and Cursor AI",
5
5
  "main": "build/index.js",
6
6
  "bin": {
@@ -1,36 +0,0 @@
1
- /**
2
- * In-memory active intent tracking.
3
- *
4
- * Simple Map keyed by normalized origin. Replaces Muninn's per-repo
5
- * active intent tracking. State lives only for the MCP server lifetime.
6
- */
7
- import type { Intent } from './kawa-api.js';
8
- export interface ActiveIntent {
9
- id: string;
10
- title: string;
11
- description: string;
12
- templateType: string;
13
- status: string;
14
- constraints: string[];
15
- blocks: Array<{
16
- filePath: string;
17
- startLine: number;
18
- endLine: number;
19
- contentSnippet?: string;
20
- }>;
21
- branch?: string;
22
- forkedFrom?: string;
23
- createdAt?: string;
24
- }
25
- declare class ActiveIntentStore {
26
- private store;
27
- get(origin: string): ActiveIntent | null;
28
- set(origin: string, intent: ActiveIntent): void;
29
- clear(origin: string): void;
30
- /** Return all active intents as [origin, intent] pairs */
31
- getAll(): Array<[string, ActiveIntent]>;
32
- /** Convert an API Intent to the ActiveIntent shape and store it */
33
- setFromApiIntent(origin: string, apiIntent: Intent, cloudId: string): void;
34
- }
35
- export declare const activeIntentStore: ActiveIntentStore;
36
- export {};