@kawacode/mcp 5.1.1 → 5.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md.example +101 -36
- package/README.md +3 -1
- package/build/index.js +24 -5
- package/build/index.js.map +1 -1
- package/build/prompts/intent-first-workflow.js +7 -8
- package/build/prompts/intent-first-workflow.js.map +1 -1
- package/build/resources/active-intent.js +2 -2
- package/build/resources/active-intent.js.map +1 -1
- package/build/services/muninn-ipc.d.ts +12 -5
- package/build/services/muninn-ipc.js +47 -12
- package/build/services/muninn-ipc.js.map +1 -1
- package/build/tools/activate-intent.d.ts +40 -0
- package/build/tools/activate-intent.js +52 -0
- package/build/tools/activate-intent.js.map +1 -0
- package/build/tools/check-active-intent.d.ts +0 -1
- package/build/tools/check-active-intent.js +3 -4
- package/build/tools/check-active-intent.js.map +1 -1
- package/build/tools/complete-intent.d.ts +18 -6
- package/build/tools/complete-intent.js +31 -2
- package/build/tools/complete-intent.js.map +1 -1
- package/build/tools/create-intent.d.ts +23 -1
- package/build/tools/create-intent.js +58 -5
- package/build/tools/create-intent.js.map +1 -1
- package/build/tools/detect-intent-conflicts.d.ts +22 -322
- package/build/tools/detect-intent-conflicts.js +35 -60
- package/build/tools/detect-intent-conflicts.js.map +1 -1
- package/build/tools/edit-session-decision.d.ts +4 -4
- package/build/tools/get-intents-for-file.js +1 -1
- package/build/tools/get-intents-for-file.js.map +1 -1
- package/build/tools/get-intents-for-lines.js +1 -1
- package/build/tools/get-intents-for-lines.js.map +1 -1
- package/build/tools/get-project-decisions.d.ts +1 -0
- package/build/tools/get-project-decisions.js +3 -2
- package/build/tools/get-project-decisions.js.map +1 -1
- package/build/tools/get-relevant-context.d.ts +1 -0
- package/build/tools/get-relevant-context.js +2 -1
- package/build/tools/get-relevant-context.js.map +1 -1
- package/build/tools/get-session-decisions.d.ts +1 -0
- package/build/tools/get-session-decisions.js +1 -0
- package/build/tools/get-session-decisions.js.map +1 -1
- package/build/tools/index.d.ts +51 -198
- package/build/tools/index.js +3 -3
- package/build/tools/index.js.map +1 -1
- package/build/tools/infer-history.d.ts +11 -10
- package/build/tools/infer-history.js +49 -26
- package/build/tools/infer-history.js.map +1 -1
- package/build/tools/list-team-intents.d.ts +30 -0
- package/build/tools/list-team-intents.js +39 -16
- package/build/tools/list-team-intents.js.map +1 -1
- package/build/tools/log-work.js +1 -1
- package/build/tools/log-work.js.map +1 -1
- package/build/tools/update-intent.d.ts +95 -0
- package/build/tools/update-intent.js +94 -0
- package/build/tools/update-intent.js.map +1 -0
- package/package.json +1 -1
- package/build/tools/assign-blocks.d.ts +0 -87
- package/build/tools/assign-blocks.js +0 -49
- package/build/tools/assign-blocks.js.map +0 -1
package/CLAUDE.md.example
CHANGED
|
@@ -1,40 +1,100 @@
|
|
|
1
1
|
# CLAUDE.md
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Project Overview
|
|
3
|
+
Guidance for Claude Code when working in this repository.
|
|
6
4
|
|
|
7
5
|
<!-- Replace with a 1-2 sentence description of your project -->
|
|
8
6
|
[Your project name] is a [brief description of what it does].
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Workflow — run on every non-trivial turn
|
|
11
|
+
|
|
12
|
+
1. **Check active intent** — `check_active_intent` (kawa-intents MCP). Resume if one exists.
|
|
13
|
+
2. **Get relevant context** — `get_relevant_context` with a task description. Past decisions and related intents inform the approach.
|
|
14
|
+
3. **Now** explore code, read files, plan.
|
|
15
|
+
4. **Create an intent** when the conversation transitions to actual code changes (see "When to create an intent" below).
|
|
16
|
+
5. **Before commit** — `record_decision` for significant decisions (see "Recording decisions" below).
|
|
17
|
+
6. **After commit** — `complete_intent` with the commit SHA and `status: "committed"`. This also triggers auto-capture of code blocks from the diff.
|
|
18
|
+
|
|
19
|
+
Skip the entire workflow for trivial one-liners (typos, obvious bugs) — just make the change.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## When to create an intent — vs skip
|
|
24
|
+
|
|
25
|
+
**Create** an intent for:
|
|
26
|
+
- Explicit change requests ("fix this bug", "add feature X", "refactor Y")
|
|
27
|
+
- User-approved proposals you're about to implement
|
|
28
|
+
- Any turn where you will modify files
|
|
29
|
+
|
|
30
|
+
**Skip** the intent workflow for:
|
|
31
|
+
- Questions ("how does X work?", "why was this done this way?")
|
|
32
|
+
- Investigation ("look at the auth flow", "find where X is called")
|
|
33
|
+
- Architecture / design discussion with no concrete action item
|
|
34
|
+
- Trivial pass-through changes (e.g., just forwarding a new field through a helper)
|
|
35
|
+
|
|
36
|
+
For exploration turns, still call `get_relevant_context` to enrich your answer — just don't create an intent.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Intent conflicts
|
|
41
|
+
|
|
42
|
+
`create_and_activate_intent` auto-detects conflicts. When the tool returns `action: "conflict"`:
|
|
43
|
+
|
|
44
|
+
1. Present each conflict to the user — severity, the conflicting intent's title/author, nature of the overlap.
|
|
45
|
+
2. Ask: "These conflicts were detected. Should I proceed anyway?"
|
|
46
|
+
3. On approval, retry `create_and_activate_intent` with `force: true`. Bypassed conflict IDs are recorded for audit.
|
|
47
|
+
|
|
48
|
+
---
|
|
11
49
|
|
|
12
|
-
|
|
50
|
+
## Intent reformulation
|
|
13
51
|
|
|
14
|
-
|
|
15
|
-
2. **Get relevant context**: Call `get_relevant_context` with a description of the task to find past decisions and related intents that may inform your approach
|
|
16
|
-
3. **Then explore code**: Now read files, search the codebase, and analyze the problem
|
|
52
|
+
Intents are living documents, not upfront contracts. When the work reveals that the original title, description, or scope has drifted, call `update_intent` to fix it. **Do not ask the user for permission** — reformulation is expected. An intent may be updated many times before commit.
|
|
17
53
|
|
|
18
|
-
|
|
54
|
+
---
|
|
19
55
|
|
|
20
|
-
|
|
56
|
+
## Recording decisions — apply a high bar
|
|
21
57
|
|
|
22
|
-
|
|
23
|
-
- Chose between meaningful alternatives (type: `fork`) — e.g., serde alias vs fixing all reconstruction sites
|
|
24
|
-
- Discovered non-obvious behavior that will recur or affect future work (type: `discovery`) — e.g., UI progress tracking requires completion events per phase
|
|
25
|
-
- Identified a hard constraint that future work must respect (type: `constraint`) — e.g., checkpoint cleanup must wait for persistence
|
|
26
|
-
- Made an explicit trade-off with lasting impact (type: `tradeoff`) — e.g., precision vs simplicity in rate limiting
|
|
27
|
-
- Tried and rejected an approach that looked reasonable (type: `abandoned`)
|
|
28
|
-
- Selected a library or dependency after comparing alternatives (type: `dependency`) — e.g., chose `reqwest` over `hyper` for HTTP
|
|
58
|
+
A decision is worth recording **only if** a future developer (or Claude in a future session) would genuinely benefit — i.e., it would change how they approach the same area of code.
|
|
29
59
|
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
60
|
+
**Record when**:
|
|
61
|
+
- `fork` — chose between meaningful alternatives (e.g., serde alias vs. fixing all reconstruction sites)
|
|
62
|
+
- `discovery` — non-obvious behavior that will recur (e.g., UI progress tracking requires per-phase completion events)
|
|
63
|
+
- `constraint` — hard requirement future work must respect (e.g., checkpoint cleanup must wait for persistence)
|
|
64
|
+
- `tradeoff` — explicit trade-off with lasting impact (e.g., precision vs. simplicity in rate limiting)
|
|
65
|
+
- `abandoned` — tried and rejected an approach that looked reasonable
|
|
66
|
+
- `dependency` — selected a library after comparing alternatives (e.g., `reqwest` over `hyper` for HTTP)
|
|
67
|
+
|
|
68
|
+
**Do NOT record**:
|
|
69
|
+
- Routine refactors, obvious bug fixes, version bumps, formatting
|
|
70
|
+
- Session-only debugging artifacts (stray `test.only`, `console.log` removals)
|
|
71
|
+
- Lessons that are obvious in hindsight or clear from the diff
|
|
72
|
+
- One-off typos, copy-paste errors, trivial config mistakes
|
|
35
73
|
- Decisions with no meaningful alternatives considered
|
|
36
74
|
|
|
37
|
-
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Committing pre-existing changes
|
|
78
|
+
|
|
79
|
+
When uncommitted changes exist that weren't made under an active intent:
|
|
80
|
+
|
|
81
|
+
1. Read the diffs.
|
|
82
|
+
2. Group changes by semantic purpose.
|
|
83
|
+
3. Call `get_relevant_context` to find existing intents that accurately match each group.
|
|
84
|
+
4. Commit each group under its matched intent (create a new intent only if no accurate match exists).
|
|
85
|
+
5. Present the grouping plan to the user before committing.
|
|
86
|
+
|
|
87
|
+
Trivial standalone changes (typos, formatting) can be committed without an intent.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Code blocks are auto-captured on commit
|
|
92
|
+
|
|
93
|
+
When `complete_intent` runs with a `commitSha`, the diff is read, line ranges are extracted per modified file, an AST-based semantic anchor is computed per range (for robust re-anchoring after rebases), and the blocks are sent to the API in the same PATCH that updates the intent status. **There is no manual "assign blocks" step.**
|
|
94
|
+
|
|
95
|
+
Implication: an intent completed without a `commitSha` will have an empty `blocks` array. For `abandoned` intents that's fine. For `committed` / `pushed` / `done`, **always pass the commit SHA** so auto-capture runs.
|
|
96
|
+
|
|
97
|
+
---
|
|
38
98
|
|
|
39
99
|
## Repository Origin and Path
|
|
40
100
|
|
|
@@ -46,11 +106,11 @@ Use these values for ALL MCP tool calls:
|
|
|
46
106
|
|
|
47
107
|
**Important**: `repoPath` must point to the directory containing the `.git` folder.
|
|
48
108
|
|
|
49
|
-
<!--
|
|
109
|
+
<!-- =========================================================
|
|
50
110
|
EVERYTHING BELOW IS OPTIONAL — add what's useful for your project
|
|
51
|
-
|
|
111
|
+
========================================================= -->
|
|
52
112
|
|
|
53
|
-
<!-- OPTIONAL:
|
|
113
|
+
<!-- OPTIONAL: monorepo / multi-project workspaces. Replace the
|
|
54
114
|
single repoOrigin/repoPath above with a table:
|
|
55
115
|
|
|
56
116
|
### Repository Origins and Paths
|
|
@@ -61,20 +121,25 @@ Each sub-project has its own `.git` directory. When calling MCP tools, use the *
|
|
|
61
121
|
|-------------|-----------------------------------------|----------------------------------|
|
|
62
122
|
| my-api | `git@github.com:my-org/my-api.git` | `/path/to/workspace/my-api` |
|
|
63
123
|
| my-frontend | `git@github.com:my-org/my-frontend.git` | `/path/to/workspace/my-frontend` |
|
|
124
|
+
|
|
125
|
+
Cross-repo workflow:
|
|
126
|
+
1. Create an intent in each affected repo at the start — not retroactively
|
|
127
|
+
2. Record decisions in the repo they affect
|
|
128
|
+
3. Skip the intent workflow for repos with trivial pass-through changes
|
|
129
|
+
4. Check `check_active_intent` per repo before modifying it
|
|
64
130
|
-->
|
|
65
131
|
|
|
66
|
-
<!-- OPTIONAL:
|
|
67
|
-
Examples of what to include:
|
|
132
|
+
<!-- OPTIONAL: Project-specific sections.
|
|
68
133
|
|
|
69
|
-
##
|
|
70
|
-
|
|
134
|
+
## Global constraints
|
|
135
|
+
Rules that apply to every change (e.g., DB name, no fallback code paths, required approval patterns).
|
|
71
136
|
|
|
72
|
-
##
|
|
73
|
-
|
|
137
|
+
## Development Commands
|
|
138
|
+
How to run tests, lint, build.
|
|
74
139
|
|
|
75
|
-
##
|
|
76
|
-
-
|
|
140
|
+
## Gotchas
|
|
141
|
+
Non-obvious pitfalls Claude will hit.
|
|
77
142
|
|
|
78
|
-
##
|
|
79
|
-
|
|
143
|
+
## Reference
|
|
144
|
+
Link to a sibling ARCHITECTURE.md for IPC schemas, data models, etc. Keep this file behavior-focused.
|
|
80
145
|
-->
|
package/README.md
CHANGED
|
@@ -94,9 +94,11 @@ After this, you can start working using your usual workflow. Kawa Code will auto
|
|
|
94
94
|
To benefit from Kawa Code's intent-driven development immediately, tell Claude Code to infer code decisions from your git history:
|
|
95
95
|
|
|
96
96
|
```
|
|
97
|
-
Please run
|
|
97
|
+
Please run infer_history with max 3000 commits.
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
+
Tier 5 (the default) extracts the most context. Tiers are cumulative — each includes all data from lower tiers. Tiers 2 and 4 add PR/issue context from GitHub/GitLab and require the `gh` or `glab` CLI; they're automatically skipped if unavailable.
|
|
101
|
+
|
|
100
102
|
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
103
|
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
104
|
Kawa Code will now select the relevant intents and micro-decisions made to speed up code generation, issue troubleshooting, bug fixing etc.
|
package/build/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ErrorCode, McpError } from '@modelcontextprotocol/sdk/types.js';
|
|
5
5
|
import { connectToMuninn, ensureRepo } from './services/muninn-ipc.js';
|
|
6
|
-
import { allTools, getRelevantContext, checkActiveIntent, createAndActivateIntent, getIntentsForFile, getIntentsForLines,
|
|
6
|
+
import { allTools, getRelevantContext, checkActiveIntent, createAndActivateIntent, activateIntent, getIntentsForFile, getIntentsForLines, listTeamIntents, getIntentChanges, completeIntent, logWork, recordDecision, getSessionDecisions, getProjectDecisions, editSessionDecision, detectIntentConflicts, inferHistory, evolveDecisions } from './tools/index.js';
|
|
7
7
|
import { prompts } from './prompts/intent-first-workflow.js';
|
|
8
8
|
import { resources, readActiveIntentResource } from './resources/active-intent.js';
|
|
9
9
|
// Create MCP server
|
|
@@ -58,15 +58,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
58
58
|
case 'create_and_activate_intent':
|
|
59
59
|
result = await createAndActivateIntent(args);
|
|
60
60
|
break;
|
|
61
|
+
case 'activate_intent':
|
|
62
|
+
result = await activateIntent(args);
|
|
63
|
+
break;
|
|
61
64
|
case 'get_intents_for_file':
|
|
62
65
|
result = await getIntentsForFile(args);
|
|
63
66
|
break;
|
|
64
67
|
case 'get_intents_for_lines':
|
|
65
68
|
result = await getIntentsForLines(args);
|
|
66
69
|
break;
|
|
67
|
-
case 'assign_blocks_to_intent':
|
|
68
|
-
result = await assignBlocksToIntent(args);
|
|
69
|
-
break;
|
|
70
70
|
case 'list_team_intents':
|
|
71
71
|
result = await listTeamIntents(args);
|
|
72
72
|
break;
|
|
@@ -113,8 +113,27 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
catch (error) {
|
|
116
|
+
// Surface IPC / handler failures as structured tool output instead of an
|
|
117
|
+
// McpError stack trace. The AI sees the friendly error message and can
|
|
118
|
+
// decide how to recover (retry, fall back, ask user, etc.).
|
|
119
|
+
// Errors that are not IPC-related (e.g. unknown tool name) are still
|
|
120
|
+
// raised as McpError below.
|
|
121
|
+
if (error instanceof McpError)
|
|
122
|
+
throw error;
|
|
116
123
|
const message = error instanceof Error ? error.message : 'Tool execution failed';
|
|
117
|
-
|
|
124
|
+
return {
|
|
125
|
+
content: [
|
|
126
|
+
{
|
|
127
|
+
type: 'text',
|
|
128
|
+
text: JSON.stringify({
|
|
129
|
+
success: false,
|
|
130
|
+
error: message,
|
|
131
|
+
tool: name,
|
|
132
|
+
}, null, 2),
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
isError: true,
|
|
136
|
+
};
|
|
118
137
|
}
|
|
119
138
|
});
|
|
120
139
|
// Handle prompt listing
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,SAAS,EACT,QAAQ,EACT,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAEtE,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,SAAS,EACT,QAAQ,EACT,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAEtE,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,eAAe,EAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,OAAO,EAA6B,MAAM,oCAAoC,CAAA;AACvF,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AAElF,oBAAoB;AACpB,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;IACE,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;CACjB,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,EAAE;QACX,SAAS,EAAE,EAAE;KACd;CACF,CACF,CAAA;AAED,sBAAsB;AACtB,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAA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. Match your workflow to the t
|
|
|
27
27
|
| When | Action | Tool |
|
|
28
28
|
|------|--------|------|
|
|
29
29
|
| **Before coding** | Check for active intent (resume if exists) | \`check_active_intent\` |
|
|
30
|
-
| **After edits** | Log what was done | \`log_work\`
|
|
30
|
+
| **After edits** | Log what was done | \`log_work\` |
|
|
31
31
|
|
|
32
32
|
**Full workflow** — Multi-file features, unfamiliar code areas, architectural decisions, cross-cutting changes, or work that may overlap with teammates. Use the complete lifecycle:
|
|
33
33
|
|
|
@@ -35,8 +35,9 @@ Before using MCP tools, assess the task complexity. Match your workflow to the t
|
|
|
35
35
|
|------|--------|------|
|
|
36
36
|
| **After exploring request** | Get relevant context (with discovered files) | \`get_relevant_context\` |
|
|
37
37
|
| **Before coding** | Check/create intent | \`check_active_intent\`, \`create_and_activate_intent\` |
|
|
38
|
-
| **
|
|
39
|
-
|
|
38
|
+
| **On "done"/"commit"/"worked"/etc.** | Verify diff → Git commit → Complete | \`get_intent_changes\`, \`complete_intent\` |
|
|
39
|
+
|
|
40
|
+
> **Note**: Code blocks are attached to the intent automatically when you call \`complete_intent\` with a commit SHA. Muninn reads the commit diff, computes semantic anchors for each modified range, and sends the encrypted blocks to the API in the same call that updates the intent status. There is no manual "assign blocks" step.
|
|
40
41
|
|
|
41
42
|
**Trigger phrases for commit flow**: "this worked", "let's commit", "done", "close this", "ship it", "looks good"
|
|
42
43
|
|
|
@@ -109,8 +110,7 @@ When the user chooses to commit (or explicitly requests it):
|
|
|
109
110
|
|
|
110
111
|
Include these in the intent record? [Yes] [Edit] [Skip]
|
|
111
112
|
\`\`\`
|
|
112
|
-
5. **
|
|
113
|
-
6. **Git operations**:
|
|
113
|
+
5. **Git operations**:
|
|
114
114
|
\`\`\`bash
|
|
115
115
|
git add <files>
|
|
116
116
|
git commit -m "<intent title>
|
|
@@ -124,8 +124,8 @@ When the user chooses to commit (or explicitly requests it):
|
|
|
124
124
|
Intent-ID: <intent-id>
|
|
125
125
|
Co-Authored-By: Claude <noreply@anthropic.com>"
|
|
126
126
|
\`\`\`
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
6. **Complete intent**: Call \`complete_intent\` with the commit SHA and status='committed'. Muninn will auto-capture the modified code blocks from the commit diff, compute semantic anchors, and send them together with the status update in one API call.
|
|
128
|
+
7. **Report**: Tell the user the commit SHA and that the intent is complete
|
|
129
129
|
|
|
130
130
|
- If user had a new request that triggered the commit, proceed to create a new intent for it
|
|
131
131
|
- If user explicitly said "we're done", the workflow ends
|
|
@@ -184,7 +184,6 @@ For each group:
|
|
|
184
184
|
| \`create_and_activate_intent\` | When no active intent and user requests code changes |
|
|
185
185
|
| \`get_intents_for_file\` | Before modifying files (check for team conflicts) |
|
|
186
186
|
| \`get_intents_for_lines\` | Before modifying specific line ranges |
|
|
187
|
-
| \`assign_blocks_to_intent\` | After writing code, before committing |
|
|
188
187
|
| \`get_intent_changes\` | Before prompting about commit (to show change summary) |
|
|
189
188
|
| \`complete_intent\` | After successful git commit, or to abandon |
|
|
190
189
|
| \`list_team_intents\` | To see what teammates are working on |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-first-workflow.js","sourceRoot":"","sources":["../../src/prompts/intent-first-workflow.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,4HAA4H;IACzI,SAAS,EAAE;QACT;YACE,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,SAAS,EAAE,CAAC,IAAoC,EAAE,EAAE;QAClD,MAAM,WAAW,GAAG,IAAI,EAAE,gBAAgB;YACxC,CAAC,CAAC,yBAAyB,IAAI,CAAC,gBAAgB,EAAE;YAClD,CAAC,CAAC,EAAE,CAAA;QAEN,OAAO,qCAAqC,WAAW
|
|
1
|
+
{"version":3,"file":"intent-first-workflow.js","sourceRoot":"","sources":["../../src/prompts/intent-first-workflow.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,4HAA4H;IACzI,SAAS,EAAE;QACT;YACE,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,SAAS,EAAE,CAAC,IAAoC,EAAE,EAAE;QAClD,MAAM,WAAW,GAAG,IAAI,EAAE,gBAAgB;YACxC,CAAC,CAAC,yBAAyB,IAAI,CAAC,gBAAgB,EAAE;YAClD,CAAC,CAAC,EAAE,CAAA;QAEN,OAAO,qCAAqC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4FAwLiC,CAAA;IAC1F,CAAC;CACF,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,yBAAyB,CAAC,CAAA"}
|
|
@@ -16,8 +16,8 @@ export async function readActiveIntentResource(repoOrigin) {
|
|
|
16
16
|
const res = await request('intent', 'get-active', {
|
|
17
17
|
repoOrigin: repoOrigin || '',
|
|
18
18
|
});
|
|
19
|
-
// Muninn returns {
|
|
20
|
-
const intent = res.
|
|
19
|
+
// Muninn returns { hasActiveIntent, intentId, intent }
|
|
20
|
+
const intent = res.intent;
|
|
21
21
|
if (!intent) {
|
|
22
22
|
return JSON.stringify({
|
|
23
23
|
hasActiveIntent: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active-intent.js","sourceRoot":"","sources":["../../src/resources/active-intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAShE,M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M,GAAG,GAAG,CAAC,MAAM,CAAA;QACzB,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,SAAS,CAAC;gBACpB,eAAe,EAAE,KAAK;gBACtB,UAAU,EAAE,UAAU,IAAI,SAAS;gBACnC,IAAI,EAAE,UAAU;oBACd,CAAC,CAAC,SAAS;oBACX,CAAC,CAAC,+DAA+D;aACpE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;QACb,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,eAAe,EAAE,IAAI;YACrB,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,UAAU;YAC3C,MAAM,EAAE;gBACN,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE;gBACnB,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE;gBACzB,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,EAAE;gBACrC,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,SAAS;gBAC9C,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,QAAQ;gBACjC,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,EAAE;gBACrC,UAAU,EAAE,CAAC;aACd;SACF,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,eAAe,EAAE,KAAK;YACtB,IAAI,EAAE,2CAA2C;SAClD,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IACb,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,oBAAoB,CAAC,CAAA"}
|
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
* Modeled after kawa.i18n/src/ipc/muninn-socket.ts but simplified:
|
|
8
8
|
* - No UI bundle or manifest (MCP has no UI)
|
|
9
9
|
* - Request/response correlation via _msgId
|
|
10
|
-
* - 30s timeout per request
|
|
10
|
+
* - 30s default timeout per request, overridable per call
|
|
11
11
|
*/
|
|
12
|
+
/** Stable session ID for this MCP process. Identifies this agent in intent attribution. */
|
|
13
|
+
export declare const SESSION_ID: string;
|
|
12
14
|
/**
|
|
13
15
|
* Connect to Muninn's Huginn IPC socket.
|
|
14
16
|
*
|
|
@@ -19,12 +21,17 @@ export declare function connectToMuninn(socketPath?: string): Promise<void>;
|
|
|
19
21
|
/**
|
|
20
22
|
* Send an IPC request to Muninn and await the correlated response.
|
|
21
23
|
*
|
|
22
|
-
* @param domain
|
|
23
|
-
* @param action
|
|
24
|
-
* @param data
|
|
24
|
+
* @param domain - Handler domain (e.g., 'intent', 'decision')
|
|
25
|
+
* @param action - Handler action (e.g., 'create', 'get-active')
|
|
26
|
+
* @param data - Request payload
|
|
27
|
+
* @param timeoutMs - Per-call timeout override. Defaults to 30s, which is the
|
|
28
|
+
* right fast-fail ceiling for synchronous handlers. A few
|
|
29
|
+
* synchronous endpoints (e.g., inference:estimate on deep
|
|
30
|
+
* repos) legitimately run longer — callers raise it
|
|
31
|
+
* explicitly rather than relaxing the global default.
|
|
25
32
|
* @returns The response data from Muninn
|
|
26
33
|
*/
|
|
27
|
-
export declare function request(domain: string, action: string, data?: any): Promise<any>;
|
|
34
|
+
export declare function request(domain: string, action: string, data?: any, timeoutMs?: number): Promise<any>;
|
|
28
35
|
/**
|
|
29
36
|
* Ensure a repository path is registered with Muninn as a project.
|
|
30
37
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Modeled after kawa.i18n/src/ipc/muninn-socket.ts but simplified:
|
|
8
8
|
* - No UI bundle or manifest (MCP has no UI)
|
|
9
9
|
* - Request/response correlation via _msgId
|
|
10
|
-
* - 30s timeout per request
|
|
10
|
+
* - 30s default timeout per request, overridable per call
|
|
11
11
|
*/
|
|
12
12
|
import * as net from 'net';
|
|
13
13
|
import * as fs from 'fs';
|
|
@@ -16,7 +16,9 @@ import * as os from 'os';
|
|
|
16
16
|
import * as crypto from 'crypto';
|
|
17
17
|
const EXTENSION_ID = 'mcp';
|
|
18
18
|
const EXTENSION_DOMAINS = ['intent', 'intent-block', 'decision', 'claude-code', 'code', 'inference'];
|
|
19
|
-
|
|
19
|
+
/** Stable session ID for this MCP process. Identifies this agent in intent attribution. */
|
|
20
|
+
export const SESSION_ID = `mcp-${crypto.randomBytes(4).toString('hex')}`;
|
|
21
|
+
const DEFAULT_REQUEST_TIMEOUT_MS = 30_000;
|
|
20
22
|
const HANDSHAKE_TIMEOUT_MS = 10_000;
|
|
21
23
|
/**
|
|
22
24
|
* Muninn's Tauri bundle identifier.
|
|
@@ -184,7 +186,22 @@ function connectClientPipe(pipePath, resolve, reject) {
|
|
|
184
186
|
cleanup();
|
|
185
187
|
});
|
|
186
188
|
}
|
|
187
|
-
/** Route an inbound response message to its waiting pendingRequest entry.
|
|
189
|
+
/** Route an inbound response message to its waiting pendingRequest entry.
|
|
190
|
+
*
|
|
191
|
+
* Failure propagation has two layers:
|
|
192
|
+
* 1. Envelope-level: `msg.err` is set when the IPC dispatch itself failed
|
|
193
|
+
* (unknown domain, malformed message, etc.). Reject directly.
|
|
194
|
+
* 2. Application-level: Muninn handlers wrap their own failures INSIDE
|
|
195
|
+
* `msg.data` as `{ success: false, error: "..." }`. Without this check,
|
|
196
|
+
* tools silently received the failure object as a successful resolve and
|
|
197
|
+
* had to remember to inspect it themselves — which several built tools
|
|
198
|
+
* did not, leading to fake `success: true, intentId: ""` responses.
|
|
199
|
+
*
|
|
200
|
+
* Strict equality (`=== false`) is intentional. Async-start responses such as
|
|
201
|
+
* `{ started: true, message: "..." }` (inference run/evolve) and estimate
|
|
202
|
+
* responses (`{ estimate: {...} }`) carry no `success` field at all and must
|
|
203
|
+
* pass through unchanged.
|
|
204
|
+
*/
|
|
188
205
|
function routeResponse(msg) {
|
|
189
206
|
const msgId = msg._msgId;
|
|
190
207
|
if (msgId && pendingRequests.has(msgId)) {
|
|
@@ -193,21 +210,39 @@ function routeResponse(msg) {
|
|
|
193
210
|
clearTimeout(pending.timer);
|
|
194
211
|
if (msg.err) {
|
|
195
212
|
pending.reject(new Error(msg.err));
|
|
213
|
+
return;
|
|
196
214
|
}
|
|
197
|
-
|
|
198
|
-
|
|
215
|
+
const data = msg.data || {};
|
|
216
|
+
if (data.success === false) {
|
|
217
|
+
// Conflict responses carry structured `conflicts` data that the calling
|
|
218
|
+
// tool must present to the user — not a dispatch failure. Let them pass.
|
|
219
|
+
if (data.conflict === true) {
|
|
220
|
+
pending.resolve(data);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const errorMsg = typeof data.error === 'string' && data.error.length > 0
|
|
224
|
+
? data.error
|
|
225
|
+
: 'Muninn handler returned success: false with no error message';
|
|
226
|
+
pending.reject(new Error(errorMsg));
|
|
227
|
+
return;
|
|
199
228
|
}
|
|
229
|
+
pending.resolve(data);
|
|
200
230
|
}
|
|
201
231
|
}
|
|
202
232
|
/**
|
|
203
233
|
* Send an IPC request to Muninn and await the correlated response.
|
|
204
234
|
*
|
|
205
|
-
* @param domain
|
|
206
|
-
* @param action
|
|
207
|
-
* @param data
|
|
235
|
+
* @param domain - Handler domain (e.g., 'intent', 'decision')
|
|
236
|
+
* @param action - Handler action (e.g., 'create', 'get-active')
|
|
237
|
+
* @param data - Request payload
|
|
238
|
+
* @param timeoutMs - Per-call timeout override. Defaults to 30s, which is the
|
|
239
|
+
* right fast-fail ceiling for synchronous handlers. A few
|
|
240
|
+
* synchronous endpoints (e.g., inference:estimate on deep
|
|
241
|
+
* repos) legitimately run longer — callers raise it
|
|
242
|
+
* explicitly rather than relaxing the global default.
|
|
208
243
|
* @returns The response data from Muninn
|
|
209
244
|
*/
|
|
210
|
-
export async function request(domain, action, data = {}) {
|
|
245
|
+
export async function request(domain, action, data = {}, timeoutMs = DEFAULT_REQUEST_TIMEOUT_MS) {
|
|
211
246
|
if (!socket || !connected) {
|
|
212
247
|
await connectToMuninn();
|
|
213
248
|
}
|
|
@@ -215,15 +250,15 @@ export async function request(domain, action, data = {}) {
|
|
|
215
250
|
return new Promise((resolve, reject) => {
|
|
216
251
|
const timer = setTimeout(() => {
|
|
217
252
|
pendingRequests.delete(msgId);
|
|
218
|
-
reject(new Error(`Muninn request timeout (${
|
|
219
|
-
},
|
|
253
|
+
reject(new Error(`Muninn request timeout (${timeoutMs / 1000}s): ${domain}:${action}`));
|
|
254
|
+
}, timeoutMs);
|
|
220
255
|
pendingRequests.set(msgId, { resolve, reject, timer });
|
|
221
256
|
const message = JSON.stringify({
|
|
222
257
|
flow: 'req',
|
|
223
258
|
domain,
|
|
224
259
|
action,
|
|
225
260
|
caw: cawId,
|
|
226
|
-
data,
|
|
261
|
+
data: { ...data, _agentId: SESSION_ID },
|
|
227
262
|
_msgId: msgId,
|
|
228
263
|
});
|
|
229
264
|
socket.write(message + '\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"muninn-ipc.js","sourceRoot":"","sources":["../../src/services/muninn-ipc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,MAAM,YAAY,GAAG,KAAK,CAAA;AAC1B,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"muninn-ipc.js","sourceRoot":"","sources":["../../src/services/muninn-ipc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,O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AqC,QAAQ,KAAM,GAAa,CAAC,OAAO,EAAE,CAAC,CAAA;IAC3F,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,OAAO,EAAE,CAAA;IAClB,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC;AAED,SAAS,OAAO;IACd,SAAS,GAAG,KAAK,CAAA;IACjB,MAAM,GAAG,IAAI,CAAA;IACb,iBAAiB,GAAG,IAAI,CAAA;IAExB,8BAA8B;IAC9B,KAAK,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,eAAe,EAAE,CAAC;QAC5C,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAC3B,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAA;IACvD,CAAC;IACD,eAAe,CAAC,KAAK,EAAE,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const activateIntentSchema: z.ZodObject<{
|
|
3
|
+
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
4
|
+
repoPath: z.ZodString;
|
|
5
|
+
intentId: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
repoPath: string;
|
|
8
|
+
intentId: string;
|
|
9
|
+
repoOrigin?: string | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
repoPath: string;
|
|
12
|
+
intentId: string;
|
|
13
|
+
repoOrigin?: string | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export type ActivateIntentInput = z.infer<typeof activateIntentSchema>;
|
|
16
|
+
export interface ActivateIntentResponse {
|
|
17
|
+
success: boolean;
|
|
18
|
+
intentId: string;
|
|
19
|
+
previousActiveId?: string;
|
|
20
|
+
message: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function activateIntent(input: ActivateIntentInput): Promise<ActivateIntentResponse>;
|
|
23
|
+
export declare const activateIntentTool: {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
inputSchema: z.ZodObject<{
|
|
27
|
+
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
28
|
+
repoPath: z.ZodString;
|
|
29
|
+
intentId: z.ZodString;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
repoPath: string;
|
|
32
|
+
intentId: string;
|
|
33
|
+
repoOrigin?: string | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
repoPath: string;
|
|
36
|
+
intentId: string;
|
|
37
|
+
repoOrigin?: string | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
handler: typeof activateIntent;
|
|
40
|
+
};
|