@kawacode/mcp 8.1.3 → 10.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.
- package/CLAUDE.md.example +11 -13
- package/README.md +39 -2
- package/build/kawacode-on-session-end.d.ts +18 -0
- package/build/kawacode-on-session-end.js +53 -0
- package/build/kawacode-on-session-end.js.map +1 -0
- package/build/services/muninn-ipc.d.ts +10 -0
- package/build/services/muninn-ipc.js +14 -1
- package/build/services/muninn-ipc.js.map +1 -1
- package/build/tools/_complete-intent-label.test.d.ts +1 -0
- package/build/tools/_complete-intent-label.test.js +18 -0
- package/build/tools/_complete-intent-label.test.js.map +1 -0
- package/build/tools/_create-intent.test.d.ts +1 -0
- package/build/tools/_create-intent.test.js +211 -0
- package/build/tools/_create-intent.test.js.map +1 -0
- package/build/tools/complete-intent.d.ts +15 -4
- package/build/tools/complete-intent.js +22 -22
- package/build/tools/complete-intent.js.map +1 -1
- package/build/tools/create-intent.d.ts +42 -23
- package/build/tools/create-intent.js +200 -60
- package/build/tools/create-intent.js.map +1 -1
- package/build/tools/get-project-decisions.d.ts +15 -0
- package/build/tools/get-project-decisions.js +19 -15
- package/build/tools/get-project-decisions.js.map +1 -1
- package/build/tools/index.d.ts +13 -7
- package/build/tools/infer-history.d.ts +4 -4
- package/build/tools/list-team-intents.d.ts +4 -4
- package/package.json +2 -1
package/CLAUDE.md.example
CHANGED
|
@@ -62,19 +62,17 @@ For exploration turns, still call `get_relevant_context` to enrich your answer
|
|
|
62
62
|
|
|
63
63
|
## Intent conflicts
|
|
64
64
|
|
|
65
|
-
`create_and_activate_intent`
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
`force: true` only bypasses the conflict-detection block; it does NOT record any relationship. Always reach for supersession first when the new work genuinely replaces the old.
|
|
65
|
+
When a new intent overlaps existing work, **Kawa Code asks the user — you do not decide.** The request is parked and `create_and_activate_intent` reports the outcome in `action`. **A parked overlap is a decision waiting for the user, not an instruction to stop working.**
|
|
66
|
+
|
|
67
|
+
- `created` / `reactivated` — done; the intent is active. Proceed.
|
|
68
|
+
- `pending_approval` — the user has been asked in Kawa Code (Orchestration panel); the intent does not exist yet. Tell them it is waiting, carry on with any work that does not depend on this intent, and call the tool again with the returned `pendingId` (same title, description and `repoPath`) at your next checkpoint. Each call waits up to ~20 seconds for the answer.
|
|
69
|
+
- `awaiting_user` — the tool will stop asking. Do not sit idle: a parked request expires after 24 hours and is dropped when the session ends. Tell the user, continue independent work, and call once more with the `pendingId` after they say they have answered.
|
|
70
|
+
- `declined` — the user said no to this intent. Do not retry it under another title. Edits already on disk are not reverted; tell the user and ask what they want done with them.
|
|
71
|
+
- `expired` / `unknown_pending` — nothing was decided; call again without `pendingId` if the work is still wanted.
|
|
72
|
+
|
|
73
|
+
Work done while a request is parked is still real work, but it is not attributed to the intent — decisions recorded before the intent exists carry no intent id, and `complete_intent` has nothing to complete until it does. So keep moving, but reach the decision before you commit.
|
|
74
|
+
|
|
75
|
+
There is no `force` option and no way to bypass an overlap from the agent's side. The user chooses, in Kawa Code, whether the new work is independent of the existing intent or supersedes it; the lineage is recorded there. Do not name the authors of conflicting intents — you are not given them, and who owns what is shown in Kawa Code.
|
|
78
76
|
|
|
79
77
|
---
|
|
80
78
|
|
package/README.md
CHANGED
|
@@ -117,7 +117,7 @@ Because compiled build directories can't be shared, they multiply — one per wo
|
|
|
117
117
|
|
|
118
118
|
Isolation alone would just give you several agents doing overlapping work in private. Kawa's job is the coordination on top.
|
|
119
119
|
|
|
120
|
-
Each agent session gets its own identity, and intents are tracked **per session** — so several intents can be active on one repository at once, each with its own current focus, without a lock and without agents clobbering each other's context. From there the normal machinery applies across agents exactly as it does across teammates: `get_relevant_context` surfaces what the *other* agents have already decided, `create_and_activate_intent`
|
|
120
|
+
Each agent session gets its own identity, and intents are tracked **per session** — so several intents can be active on one repository at once, each with its own current focus, without a lock and without agents clobbering each other's context. From there the normal machinery applies across agents exactly as it does across teammates: `get_relevant_context` surfaces what the *other* agents have already decided, `create_and_activate_intent` hands the user a decision in Kawa Code when new work overlaps something already in flight, and the Stop hook reports, once per turn, where another agent's live edits intersect yours.
|
|
121
121
|
|
|
122
122
|
The practical result: your agents inherit each other's decisions instead of re-deriving them, and you find out about overlapping work while it's still cheap to redirect — not at merge time.
|
|
123
123
|
|
|
@@ -129,6 +129,43 @@ Kawa can do more than *report* an overlap — `arbiter_resolve` judges each one,
|
|
|
129
129
|
|
|
130
130
|
This is the sharpest practical reason to put agents in worktrees. Run them on a shared checkout and auto-resolution silently never engages; you get the conflict surfaced and nothing else, with no error to tell you a capability was switched off. The guardrail is intentional — Kawa won't rewrite a human's working tree underneath them — but it does mean the setup decides whether half the feature is available.
|
|
131
131
|
|
|
132
|
+
## When an overlap is waiting on you
|
|
133
|
+
|
|
134
|
+
When an agent asks to start work that overlaps an intent already in flight, the agent doesn't get to decide. Kawa Code parks the request and asks **you**, in the **Orchestration panel**: `create_and_activate_intent` returns `pending_approval` with a `pendingId`, and the agent re-checks that id as it goes.
|
|
135
|
+
|
|
136
|
+
**A parked overlap is not a stop.** Nothing in Kawa Code halts an agent mid-task, and nothing is meant to — a refusal that froze the session would strand it for as long as you were away, and by the time you read the card the edits are usually already on disk. So the agent tells you the card is waiting and carries on with whatever doesn't depend on the intent existing. Cancelling behaves the same way: it withholds the intent and *asks* the agent to stop, so the card reports how many turns that session has taken since you cancelled rather than pretending the work was undone.
|
|
137
|
+
|
|
138
|
+
### Can't see the card?
|
|
139
|
+
|
|
140
|
+
Check the panel's **scope** first — this is the usual cause, not expiry. Orchestration reads across repositories by default, but scoped to the current project it lists only cards for the repository you have focused, and the agent that parked the request is often working in a different one. Widen the scope, or focus that repository.
|
|
141
|
+
|
|
142
|
+
### Lapsing after 24 hours — the card waits, the agent doesn't
|
|
143
|
+
|
|
144
|
+
A parked request has a 24-hour window, but the window bounds how long the **agent** waits, not how long you have:
|
|
145
|
+
|
|
146
|
+
| when | the agent | your card |
|
|
147
|
+
|---|---|---|
|
|
148
|
+
| within 24h | re-checks the `pendingId` as it works | in the panel, marked **needs your decision** |
|
|
149
|
+
| after 24h | told the request lapsed, and to ask again | still in the panel, marked **Lapsed** — and still answerable |
|
|
150
|
+
|
|
151
|
+
**Expiry marks a request stale; it does not retire it.** The clock running out records that you were away, not that you refused — so the card keeps its actions, and approving a lapsed request creates the intent exactly as it would have the day before. Only your answer closes a request. A lapsed card stays until you answer it; what ages out is an *answered* one, which only has to survive long enough for the agent's next check.
|
|
152
|
+
|
|
153
|
+
### If your agent asked again
|
|
154
|
+
|
|
155
|
+
The agent is told to re-request when its request lapses, which parks a fresh card. That card **carries over the decisions the session recorded in the meantime** and retires the lapsed one, so you get one card for the work rather than two. The overlaps themselves are detected afresh, so the list reflects the repository as it stands now rather than as it stood a day ago. You can also prompt it yourself:
|
|
156
|
+
|
|
157
|
+
> The intent request lapsed — request it again.
|
|
158
|
+
|
|
159
|
+
Either way your committed code is untouched: the request and the card are coordination state, not your work.
|
|
160
|
+
|
|
161
|
+
### Decisions recorded while you were deciding
|
|
162
|
+
|
|
163
|
+
Your agent doesn't stop, so it usually records reasoning before you ever see the card. Those decisions are saved the moment they're made — they never wait on you — and the card lists them, so you can judge the overlap against what the session actually concluded rather than against its opening title.
|
|
164
|
+
|
|
165
|
+
When you approve, they're attached to the intent that gets created, including the ones recorded after the request lapsed. If you cancel, they stay at the repository level with no intent: you ruled, no intent will exist, and the reasoning is still searchable and still surfaced by `get_relevant_context`. Nothing is discarded either way.
|
|
166
|
+
|
|
167
|
+
The one case that loses attribution is a **different** agent session re-asking for the same work — the worklist follows the session that recorded it. So the habit worth keeping is simply: **answer the card while that session is still around.**
|
|
168
|
+
|
|
132
169
|
## Handing off work to a teammate (no session export)
|
|
133
170
|
|
|
134
171
|
Because the reasoning behind your work — your intents and recorded decisions — lives in Kawa Code rather than in the chat log, a teammate can pick up where you left off from a single prompt. No transcript sharing, no session restore.
|
|
@@ -138,7 +175,7 @@ Because the reasoning behind your work — your intents and recorded decisions
|
|
|
138
175
|
3. **Hand over a one-line prompt,** e.g. `Follow up on intent <intent-id>: <what's left to do>`.
|
|
139
176
|
4. **Your teammate pastes it into a fresh session.** Their agent calls `resume_intent(<id>)` — one call that adopts the intent as their current focus *and* loads its recorded decisions — resuming the thread with full context, even though it never saw your chat.
|
|
140
177
|
|
|
141
|
-
**What transfers:** the intent, its decisions, and (once committed) its code. **What doesn't:** your chat transcript and any session-local state.
|
|
178
|
+
**What transfers:** the intent, its decisions, and (once committed) its code. **What doesn't:** your chat transcript and any session-local state. Your session's current focus and its per-turn bookkeeping are *yours* — your teammate's session starts its own and re-reads the shared record, rather than inheriting judgments you made in the moment. That is what you want: the reasoning carries over, the in-session state does not.
|
|
142
179
|
|
|
143
180
|
**Teams:** to make the handoff seamless, add one line to your shared `CLAUDE.md` so the agent always treats a follow-up prompt as *resuming* the named intent instead of opening a new one:
|
|
144
181
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* kawacode-on-session-end — Claude Code SessionEnd hook.
|
|
4
|
+
*
|
|
5
|
+
* Tells Kawa Code that this Claude Code session is over, so a request it parked
|
|
6
|
+
* for the user's decision (create_and_activate_intent overlap) is not turned
|
|
7
|
+
* into an intent for an agent that is no longer there. ONE IPC:
|
|
8
|
+
* intent:pending-intent-session-ended { aid }. Kawa Code owns what happens next.
|
|
9
|
+
*
|
|
10
|
+
* `aid` is the hook payload's `session_id`: the same id the MCP stamps on every
|
|
11
|
+
* request as `_agentId` (CLAUDE_CODE_SESSION_ID), so it names the same session.
|
|
12
|
+
*
|
|
13
|
+
* Failure discipline: every error path exits 0, as with kawacode-on-stop. The
|
|
14
|
+
* hook runs while Claude Code is shutting down and must never delay or fail it;
|
|
15
|
+
* if Kawa Code is down or the message is lost, the parked request simply
|
|
16
|
+
* expires on its own after 24 hours.
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* kawacode-on-session-end — Claude Code SessionEnd hook.
|
|
4
|
+
*
|
|
5
|
+
* Tells Kawa Code that this Claude Code session is over, so a request it parked
|
|
6
|
+
* for the user's decision (create_and_activate_intent overlap) is not turned
|
|
7
|
+
* into an intent for an agent that is no longer there. ONE IPC:
|
|
8
|
+
* intent:pending-intent-session-ended { aid }. Kawa Code owns what happens next.
|
|
9
|
+
*
|
|
10
|
+
* `aid` is the hook payload's `session_id`: the same id the MCP stamps on every
|
|
11
|
+
* request as `_agentId` (CLAUDE_CODE_SESSION_ID), so it names the same session.
|
|
12
|
+
*
|
|
13
|
+
* Failure discipline: every error path exits 0, as with kawacode-on-stop. The
|
|
14
|
+
* hook runs while Claude Code is shutting down and must never delay or fail it;
|
|
15
|
+
* if Kawa Code is down or the message is lost, the parked request simply
|
|
16
|
+
* expires on its own after 24 hours.
|
|
17
|
+
*/
|
|
18
|
+
import { readFileSync } from 'node:fs';
|
|
19
|
+
import { connectToMuninn, request, disconnect, setQuiet } from './services/muninn-ipc.js';
|
|
20
|
+
// Hook stderr can surface to the user; suppress IPC lifecycle chatter.
|
|
21
|
+
setQuiet(!process.env.KAWA_DEBUG);
|
|
22
|
+
/** SessionEnd runs at shutdown under a short limit, so give up quickly. */
|
|
23
|
+
const SEND_TIMEOUT_MS = 1_000;
|
|
24
|
+
function readStdin() {
|
|
25
|
+
try {
|
|
26
|
+
return readFileSync(0, 'utf8');
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return '';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async function main() {
|
|
33
|
+
let aid;
|
|
34
|
+
try {
|
|
35
|
+
aid = JSON.parse(readStdin()).session_id;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
process.exit(0);
|
|
39
|
+
}
|
|
40
|
+
if (!aid)
|
|
41
|
+
process.exit(0);
|
|
42
|
+
try {
|
|
43
|
+
await connectToMuninn();
|
|
44
|
+
await request('intent', 'pending-intent-session-ended', { aid }, SEND_TIMEOUT_MS);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// Kawa Code is down or slow: nothing to do, the request expires on its own.
|
|
48
|
+
}
|
|
49
|
+
disconnect();
|
|
50
|
+
process.exit(0);
|
|
51
|
+
}
|
|
52
|
+
main().catch(() => process.exit(0));
|
|
53
|
+
//# sourceMappingURL=kawacode-on-session-end.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kawacode-on-session-end.js","sourceRoot":"","sources":["../src/kawacode-on-session-end.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEzF,uEAAuE;AACvE,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;AAEjC,2EAA2E;AAC3E,MAAM,eAAe,GAAG,KAAK,CAAA;AAE7B,SAAS,SAAS;IAChB,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,IAAI,GAAuB,CAAA;IAC3B,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,UAAU,CAAA;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IACD,IAAI,CAAC,GAAG;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAEzB,IAAI,CAAC;QACH,MAAM,eAAe,EAAE,CAAA;QACvB,MAAM,OAAO,CAAC,QAAQ,EAAE,8BAA8B,EAAE,EAAE,GAAG,EAAE,EAAE,eAAe,CAAC,CAAA;IACnF,CAAC;IAAC,MAAM,CAAC;QACP,4EAA4E;IAC9E,CAAC;IACD,UAAU,EAAE,CAAA;IACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -80,6 +80,16 @@ export declare function repoAccessToolOutput(err: RepoAccessError, tool: string)
|
|
|
80
80
|
* pass through unchanged.
|
|
81
81
|
*/
|
|
82
82
|
export declare function routeResponse(msg: any): void;
|
|
83
|
+
/**
|
|
84
|
+
* A request got no answer within its timeout. A class of its own because "Kawa
|
|
85
|
+
* Code is busy" is not the same as "Kawa Code said no": it runs one request at a
|
|
86
|
+
* time, so a call can wait behind another session's slow handler, and a tool that
|
|
87
|
+
* can safely ask again (create_and_activate_intent's wait) needs to tell the two
|
|
88
|
+
* apart without matching on message text.
|
|
89
|
+
*/
|
|
90
|
+
export declare class MuninnTimeoutError extends Error {
|
|
91
|
+
constructor(timeoutMs: number, domain: string, action: string);
|
|
92
|
+
}
|
|
83
93
|
/**
|
|
84
94
|
* Send an IPC request to Muninn and await the correlated response.
|
|
85
95
|
*
|
|
@@ -310,6 +310,19 @@ export function routeResponse(msg) {
|
|
|
310
310
|
pending.resolve(data);
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
+
/**
|
|
314
|
+
* A request got no answer within its timeout. A class of its own because "Kawa
|
|
315
|
+
* Code is busy" is not the same as "Kawa Code said no": it runs one request at a
|
|
316
|
+
* time, so a call can wait behind another session's slow handler, and a tool that
|
|
317
|
+
* can safely ask again (create_and_activate_intent's wait) needs to tell the two
|
|
318
|
+
* apart without matching on message text.
|
|
319
|
+
*/
|
|
320
|
+
export class MuninnTimeoutError extends Error {
|
|
321
|
+
constructor(timeoutMs, domain, action) {
|
|
322
|
+
super(`Muninn request timeout (${timeoutMs / 1000}s): ${domain}:${action}`);
|
|
323
|
+
this.name = 'MuninnTimeoutError';
|
|
324
|
+
}
|
|
325
|
+
}
|
|
313
326
|
/**
|
|
314
327
|
* Send an IPC request to Muninn and await the correlated response.
|
|
315
328
|
*
|
|
@@ -331,7 +344,7 @@ export async function request(domain, action, data = {}, timeoutMs = DEFAULT_REQ
|
|
|
331
344
|
return new Promise((resolve, reject) => {
|
|
332
345
|
const timer = setTimeout(() => {
|
|
333
346
|
pendingRequests.delete(msgId);
|
|
334
|
-
reject(new
|
|
347
|
+
reject(new MuninnTimeoutError(timeoutMs, domain, action));
|
|
335
348
|
}, timeoutMs);
|
|
336
349
|
pendingRequests.set(msgId, { resolve, reject, timer });
|
|
337
350
|
const message = JSON.stringify({
|
|
@@ -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;AAEpG;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,OAAO,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,CAAC,QAAgB;IAC/C,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;IACpD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,eAAe;YAAE,MAAM,GAAG,CAAA;QAC7C,MAAM,IAAI,KAAK,CAAC,kCAAkC,QAAQ,qBAAsB,GAAa,CAAC,OAAO,EAAE,CAAC,CAAA;IAC1G,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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { intentLabel } from './complete-intent.js';
|
|
4
|
+
test('a title Kawa Code sent is quoted', () => {
|
|
5
|
+
assert.deepEqual(intentLabel('Fix the thing', '6ae9'), { name: '"Fix the thing"', ref: 'intent "Fix the thing"' });
|
|
6
|
+
});
|
|
7
|
+
test('without a title the intent is named by its id, never by an invented title', () => {
|
|
8
|
+
for (const missing of [undefined, '', null, 42]) {
|
|
9
|
+
const label = intentLabel(missing, '6ae9');
|
|
10
|
+
assert.equal(label.name, '6ae9');
|
|
11
|
+
assert.equal(label.ref, 'intent 6ae9');
|
|
12
|
+
assert.ok(!label.ref.includes('"Intent"'));
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
test('with neither a title nor an id the message just says "the intent"', () => {
|
|
16
|
+
assert.deepEqual(intentLabel(undefined, ''), { name: '', ref: 'the intent' });
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=_complete-intent-label.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_complete-intent-label.test.js","sourceRoot":"","sources":["../../src/tools/_complete-intent-label.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,MAAM,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAC5C,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,eAAe,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,wBAAwB,EAAE,CAAC,CAAA;AACpH,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,2EAA2E,EAAE,GAAG,EAAE;IACrF,KAAK,MAAM,OAAO,IAAI,CAAC,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAC1C,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAChC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;QACtC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,mEAAmE,EAAE,GAAG,EAAE;IAC7E,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,CAAA;AAC/E,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { MuninnTimeoutError } from '../services/muninn-ipc.js';
|
|
4
|
+
import { createIntentFlow, createAndActivateIntentSchema, WAIT_BUDGET_MS, MAX_STATUS_CALL_MS, } from './create-intent.js';
|
|
5
|
+
const INPUT = {
|
|
6
|
+
repoPath: '/repo',
|
|
7
|
+
title: 'Add X',
|
|
8
|
+
description: 'because',
|
|
9
|
+
templateType: 'feature',
|
|
10
|
+
};
|
|
11
|
+
/** A fake Muninn and a fake clock. `sleep` advances the clock; a reply may also
|
|
12
|
+
* cost time (a busy Kawa Code), which is how the deadline gets tested. */
|
|
13
|
+
function harness(replies, opts = {}) {
|
|
14
|
+
let t = 1_000_000;
|
|
15
|
+
const calls = [];
|
|
16
|
+
let i = 0;
|
|
17
|
+
const deps = {
|
|
18
|
+
now: () => t,
|
|
19
|
+
sleep: async (ms) => { t += ms; },
|
|
20
|
+
resolveOrigin: () => 'github.com:acme/widgets',
|
|
21
|
+
request: async (domain, action, data, timeoutMs) => {
|
|
22
|
+
const call = { domain, action, data, timeoutMs, at: t };
|
|
23
|
+
calls.push(call);
|
|
24
|
+
t += opts.costMs ?? 0;
|
|
25
|
+
const reply = replies[Math.min(i++, replies.length - 1)];
|
|
26
|
+
const out = typeof reply === 'function' ? reply(call) : reply;
|
|
27
|
+
if (out instanceof Error)
|
|
28
|
+
throw out;
|
|
29
|
+
return out;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
return { deps, calls, elapsed: () => t - 1_000_000 };
|
|
33
|
+
}
|
|
34
|
+
const pending = (pollsLeft = 4) => ({ success: true, action: 'pending_approval', pendingId: 'p-1', pollsLeft });
|
|
35
|
+
// --- force is gone -----------------------------------------------------------
|
|
36
|
+
test('force is not part of the schema', () => {
|
|
37
|
+
assert.equal('force' in createAndActivateIntentSchema.shape, false);
|
|
38
|
+
assert.equal('pendingId' in createAndActivateIntentSchema.shape, true);
|
|
39
|
+
});
|
|
40
|
+
test('a call that passes force:true is refused before anything is sent', async () => {
|
|
41
|
+
const h = harness([{}]);
|
|
42
|
+
await assert.rejects(createIntentFlow({ ...INPUT, force: true }, h.deps), /`force` is no longer accepted/);
|
|
43
|
+
assert.equal(h.calls.length, 0);
|
|
44
|
+
});
|
|
45
|
+
test('force:false carries no meaning and is not an error', async () => {
|
|
46
|
+
const h = harness([{ success: true, action: 'created', intent: { id: 'i-1' } }, {}]);
|
|
47
|
+
const r = await createIntentFlow({ ...INPUT, force: false }, h.deps);
|
|
48
|
+
assert.equal(r.action, 'created');
|
|
49
|
+
});
|
|
50
|
+
// --- the first call ----------------------------------------------------------
|
|
51
|
+
test('no overlap: created, then set active under this session', async () => {
|
|
52
|
+
const h = harness([{ success: true, action: 'created', intent: { id: 'i-1' } }, { success: true }]);
|
|
53
|
+
const r = await createIntentFlow(INPUT, h.deps);
|
|
54
|
+
assert.deepEqual([r.success, r.action, r.intentId], [true, 'created', 'i-1']);
|
|
55
|
+
assert.deepEqual(h.calls.map(c => `${c.domain}:${c.action}`), ['intent:create', 'intent:set-active']);
|
|
56
|
+
assert.equal(h.calls[0].data.force, undefined, 'force is never sent');
|
|
57
|
+
assert.equal(h.calls[1].data.intentId, 'i-1');
|
|
58
|
+
});
|
|
59
|
+
test('an existing similar intent of this session is reactivated', async () => {
|
|
60
|
+
const h = harness([{ success: true, action: 'reactivated', intent: { id: 'i-9' } }, {}]);
|
|
61
|
+
const r = await createIntentFlow(INPUT, h.deps);
|
|
62
|
+
assert.equal(r.action, 'reactivated');
|
|
63
|
+
assert.match(r.message, /Reactivated/);
|
|
64
|
+
});
|
|
65
|
+
test('an overlap returns pending_approval at once, without waiting or polling', async () => {
|
|
66
|
+
const h = harness([{ success: true, action: 'pending_approval', pendingId: 'p-1', conflictCount: 2 }]);
|
|
67
|
+
const r = await createIntentFlow(INPUT, h.deps);
|
|
68
|
+
assert.deepEqual([r.success, r.action, r.pendingId, r.intentId], [false, 'pending_approval', 'p-1', '']);
|
|
69
|
+
assert.match(r.message, /overlaps with 2 existing intents/);
|
|
70
|
+
assert.match(r.message, /pendingId="p-1"/);
|
|
71
|
+
assert.equal(h.calls.length, 1, 'no status call yet');
|
|
72
|
+
assert.equal(h.elapsed(), 0, 'and no waiting');
|
|
73
|
+
});
|
|
74
|
+
test('the pending_approval reply carries no conflict titles, authors or ids', async () => {
|
|
75
|
+
// Even if Kawa Code (wrongly) sent the details along, none reach the model.
|
|
76
|
+
const h = harness([{
|
|
77
|
+
success: true, action: 'pending_approval', pendingId: 'p-1', conflictCount: 1,
|
|
78
|
+
conflicts: [{ title: 'SECRET TITLE', author: 'A Display Name', intentId: '6a1de54431fc5095c5645ce5' }],
|
|
79
|
+
}]);
|
|
80
|
+
const text = JSON.stringify(await createIntentFlow(INPUT, h.deps));
|
|
81
|
+
for (const leaked of ['SECRET TITLE', 'A Display Name', '6a1de544', 'author']) {
|
|
82
|
+
assert.equal(text.includes(leaked), false, `leaked ${leaked}`);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
test('an error from Kawa Code is raised so the agent can tell the user how to recover', async () => {
|
|
86
|
+
const h = harness([{ success: false, error: "You're not signed in to Kawa Code." }]);
|
|
87
|
+
await assert.rejects(createIntentFlow(INPUT, h.deps), /not signed in/);
|
|
88
|
+
});
|
|
89
|
+
test('a create that times out is raised, not mistaken for a pending request', async () => {
|
|
90
|
+
const h = harness([new MuninnTimeoutError(30_000, 'intent', 'create')]);
|
|
91
|
+
await assert.rejects(createIntentFlow(INPUT, h.deps), MuninnTimeoutError);
|
|
92
|
+
});
|
|
93
|
+
// --- waiting with a pendingId -----------------------------------------------
|
|
94
|
+
const WITH_ID = { ...INPUT, pendingId: 'p-1' };
|
|
95
|
+
test('the first status call of a tool call counts as a poll; the rest of that call do not', async () => {
|
|
96
|
+
const h = harness([pending(), pending(), pending(), { success: true, action: 'created', intentId: 'i-1' }, {}]);
|
|
97
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
98
|
+
assert.equal(r.action, 'created');
|
|
99
|
+
const status = h.calls.filter(c => c.action === 'pending-intent-status');
|
|
100
|
+
assert.deepEqual(status.map(c => c.data.countPoll), [true, false, false, false]);
|
|
101
|
+
assert.ok(status.every(c => c.data.pendingId === 'p-1' && c.data.repoOrigin === 'github.com:acme/widgets'));
|
|
102
|
+
});
|
|
103
|
+
test('a decision to create sets the intent active under this session', async () => {
|
|
104
|
+
const h = harness([{ success: true, action: 'created', intentId: 'i-1' }, {}]);
|
|
105
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
106
|
+
assert.deepEqual([r.success, r.intentId], [true, 'i-1']);
|
|
107
|
+
assert.deepEqual(h.calls.map(c => c.action), ['pending-intent-status', 'set-active']);
|
|
108
|
+
assert.equal(h.calls[1].data.intentId, 'i-1');
|
|
109
|
+
});
|
|
110
|
+
test('a reactivated decision is reported as reactivated', async () => {
|
|
111
|
+
const h = harness([{ success: true, action: 'reactivated', intentId: 'i-2' }, {}]);
|
|
112
|
+
assert.equal((await createIntentFlow(WITH_ID, h.deps)).action, 'reactivated');
|
|
113
|
+
});
|
|
114
|
+
test('declined forbids a retry under another title instead of ordering a halt', async () => {
|
|
115
|
+
const h = harness([{ success: true, action: 'declined' }]);
|
|
116
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
117
|
+
assert.deepEqual([r.success, r.action], [false, 'declined']);
|
|
118
|
+
assert.match(r.message, /Do not retry it under a different title/);
|
|
119
|
+
// Nothing enforces a halt and the edits are usually already on disk, so the
|
|
120
|
+
// text must not claim otherwise.
|
|
121
|
+
assert.doesNotMatch(r.message, /Stop all work|no further edits/);
|
|
122
|
+
assert.match(r.message, /not reverted/);
|
|
123
|
+
assert.equal(h.calls.length, 1, 'nothing is activated');
|
|
124
|
+
});
|
|
125
|
+
test('expired and unknown_pending say how to start over', async () => {
|
|
126
|
+
for (const action of ['expired', 'unknown_pending']) {
|
|
127
|
+
const h = harness([{ success: true, action }]);
|
|
128
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
129
|
+
assert.equal(r.action, action);
|
|
130
|
+
assert.match(r.message, /WITHOUT pendingId/);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
test('awaiting_user stops the polling, not the work', async () => {
|
|
134
|
+
const h = harness([{ success: true, action: 'awaiting_user', pendingId: 'p-1', pollsLeft: 0 }]);
|
|
135
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
136
|
+
assert.deepEqual([r.action, r.pollsLeft], ['awaiting_user', 0]);
|
|
137
|
+
// A parked request expires at 24 h and is dropped on SessionEnd, so an agent
|
|
138
|
+
// told to wait for it can be waiting on something that never arrives.
|
|
139
|
+
assert.match(r.message, /do not sit idle/i);
|
|
140
|
+
assert.match(r.message, /carry on with any work that does not depend on this intent/);
|
|
141
|
+
assert.doesNotMatch(r.message, /Stop checking/);
|
|
142
|
+
assert.equal(h.elapsed(), 0, 'it returns at once instead of burning 20 s');
|
|
143
|
+
});
|
|
144
|
+
// --- the deadline ------------------------------------------------------------
|
|
145
|
+
test('an unanswered wait ends at the 20 s wall-clock deadline with pending_approval', async () => {
|
|
146
|
+
const h = harness([pending(3)]);
|
|
147
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
148
|
+
assert.equal(r.action, 'pending_approval');
|
|
149
|
+
assert.equal(r.pollsLeft, 3);
|
|
150
|
+
assert.match(r.message, /Checks left on this request: 3/);
|
|
151
|
+
assert.match(r.message, /not an instruction to stop/);
|
|
152
|
+
assert.ok(h.elapsed() <= WAIT_BUDGET_MS, `took ${h.elapsed()} ms`);
|
|
153
|
+
assert.ok(h.elapsed() >= WAIT_BUDGET_MS - 1_000, 'and used the budget');
|
|
154
|
+
const n = h.calls.length;
|
|
155
|
+
assert.ok(n >= 19 && n <= 21, `about one status call a second, got ${n}`);
|
|
156
|
+
});
|
|
157
|
+
test('every status call is bounded by what is left of the budget, never more than 30 s', async () => {
|
|
158
|
+
const h = harness([pending()]);
|
|
159
|
+
await createIntentFlow(WITH_ID, h.deps);
|
|
160
|
+
for (const c of h.calls) {
|
|
161
|
+
const remaining = WAIT_BUDGET_MS - (c.at - 1_000_000);
|
|
162
|
+
assert.ok(c.timeoutMs <= Math.min(remaining, MAX_STATUS_CALL_MS), `call at ${c.at} got ${c.timeoutMs}`);
|
|
163
|
+
assert.ok(c.timeoutMs > 0);
|
|
164
|
+
}
|
|
165
|
+
assert.equal(h.calls[0].timeoutMs, WAIT_BUDGET_MS, 'the first call may use the whole budget');
|
|
166
|
+
});
|
|
167
|
+
test('a status call that times out ends the wait as pending_approval, by the deadline', async () => {
|
|
168
|
+
// Kawa Code is busy with another session's slow handler: the call burns its
|
|
169
|
+
// whole timeout and gets nothing. The tool must still return by the deadline
|
|
170
|
+
// — not 30 s after it — and it is not an error.
|
|
171
|
+
let spent = 0;
|
|
172
|
+
const h = harness([(call) => {
|
|
173
|
+
spent = call.timeoutMs;
|
|
174
|
+
return new MuninnTimeoutError(call.timeoutMs / 1000, 'intent', 'pending-intent-status');
|
|
175
|
+
}], { costMs: 0 });
|
|
176
|
+
// The fake request must also cost its timeout, as a real one would.
|
|
177
|
+
const base = h.deps.request;
|
|
178
|
+
h.deps.request = async (d, a, data, timeoutMs) => {
|
|
179
|
+
try {
|
|
180
|
+
return await base(d, a, data, timeoutMs);
|
|
181
|
+
}
|
|
182
|
+
finally {
|
|
183
|
+
await h.deps.sleep(timeoutMs ?? 0);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
187
|
+
assert.equal(r.action, 'pending_approval');
|
|
188
|
+
assert.equal(spent, WAIT_BUDGET_MS);
|
|
189
|
+
assert.ok(h.elapsed() <= WAIT_BUDGET_MS, `took ${h.elapsed()} ms`);
|
|
190
|
+
});
|
|
191
|
+
test('a slow earlier reply leaves later calls only the time that remains', async () => {
|
|
192
|
+
const h = harness([pending()], { costMs: 4_000 });
|
|
193
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
194
|
+
assert.equal(r.action, 'pending_approval');
|
|
195
|
+
assert.ok(h.elapsed() <= WAIT_BUDGET_MS + 4_000 + 1_000, `took ${h.elapsed()} ms`);
|
|
196
|
+
for (const c of h.calls)
|
|
197
|
+
assert.ok(c.timeoutMs <= MAX_STATUS_CALL_MS);
|
|
198
|
+
});
|
|
199
|
+
test('an error that is not a timeout is raised', async () => {
|
|
200
|
+
const h = harness([new Error('Muninn handler returned success: false with no error message')]);
|
|
201
|
+
await assert.rejects(createIntentFlow(WITH_ID, h.deps), /no error message/);
|
|
202
|
+
});
|
|
203
|
+
test('a reply it does not recognise is raised rather than guessed at', async () => {
|
|
204
|
+
const h = harness([{ success: true, action: 'something-new' }]);
|
|
205
|
+
await assert.rejects(createIntentFlow(WITH_ID, h.deps), /Unexpected reply/);
|
|
206
|
+
});
|
|
207
|
+
test('a decision to create with no intent id is raised', async () => {
|
|
208
|
+
const h = harness([{ success: true, action: 'created' }]);
|
|
209
|
+
await assert.rejects(createIntentFlow(WITH_ID, h.deps), /no intent ID/);
|
|
210
|
+
});
|
|
211
|
+
//# sourceMappingURL=_create-intent.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_create-intent.test.js","sourceRoot":"","sources":["../../src/tools/_create-intent.test.ts"],"names":[],"mappings":"AAA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KAAK,IAAI,EAAE;IAClE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;IACzD,MAAM,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,CAAA;AACzE,CAAC,CAAC,CAAA"}
|
|
@@ -96,10 +96,10 @@ export interface CompleteIntentResponse {
|
|
|
96
96
|
/**
|
|
97
97
|
* Set when success=false to discriminate the failure mode:
|
|
98
98
|
* - "transient-failure" → distiller LLM call or /check-conflicts API errored;
|
|
99
|
-
* `failedStage` and `error` carry diagnostics
|
|
100
|
-
* -
|
|
101
|
-
*
|
|
102
|
-
*
|
|
99
|
+
* `failedStage` and `error` carry diagnostics.
|
|
100
|
+
* - "resolution_required", "completion_locked", … likewise.
|
|
101
|
+
* Passed through as Kawa Code sent it. Its `message` / `error` is folded into
|
|
102
|
+
* `message` below, so this file knows no reason by name.
|
|
103
103
|
*/
|
|
104
104
|
reason?: string;
|
|
105
105
|
failedStage?: string;
|
|
@@ -122,6 +122,17 @@ export interface CompleteIntentResponse {
|
|
|
122
122
|
*/
|
|
123
123
|
collisions?: CompletionCollision[];
|
|
124
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* How a completion message names the intent. Kawa Code sends the title only when it
|
|
127
|
+
* could read the intent (not when the API was down, the id was paired with the wrong
|
|
128
|
+
* repo, or the failure carries none). Never invent one: a made-up title reads like a
|
|
129
|
+
* real one and hides that the lookup failed. Name the intent by its id instead; a
|
|
130
|
+
* response with neither is just "the intent".
|
|
131
|
+
*/
|
|
132
|
+
export declare function intentLabel(title: unknown, intentId: string): {
|
|
133
|
+
name: string;
|
|
134
|
+
ref: string;
|
|
135
|
+
};
|
|
125
136
|
export declare function completeIntent(input: CompleteIntentInput): Promise<CompleteIntentResponse>;
|
|
126
137
|
export declare const completeIntentTool: {
|
|
127
138
|
name: string;
|