@kawacode/mcp 8.1.2 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md.example +9 -13
- package/README.md +1 -1
- 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/_create-intent.test.d.ts +1 -0
- package/build/tools/_create-intent.test.js +202 -0
- package/build/tools/_create-intent.test.js.map +1 -0
- package/build/tools/complete-intent.d.ts +5 -2
- package/build/tools/complete-intent.js +13 -17
- package/build/tools/complete-intent.js.map +1 -1
- package/build/tools/create-intent.d.ts +42 -23
- package/build/tools/create-intent.js +181 -60
- package/build/tools/create-intent.js.map +1 -1
- package/build/tools/index.d.ts +5 -5
- package/build/tools/infer-history.d.ts +4 -4
- package/package.json +2 -1
package/CLAUDE.md.example
CHANGED
|
@@ -62,19 +62,15 @@ 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
|
-
- The lineage is durably recorded and queryable from either side.
|
|
75
|
-
4. **For independent overlap**, just retry `create_and_activate_intent` with `force: true`. Bypassed conflict IDs are recorded for audit, but no formal relationship is stored — the two intents remain unrelated in lineage walks.
|
|
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.** `create_and_activate_intent` reports the outcome in `action`:
|
|
66
|
+
|
|
67
|
+
- `created` / `reactivated` — done; the intent is active. Proceed.
|
|
68
|
+
- `pending_approval` — the user has been asked in Kawa Code (Orchestration panel). Tell them it is waiting for them, then call the tool again with the returned `pendingId` (same title, description and `repoPath`). Each call waits up to ~20 seconds for the answer.
|
|
69
|
+
- `awaiting_user` — stop calling. Tell the user the decision is waiting in Kawa Code, and call once more with the `pendingId` only after they say they have answered.
|
|
70
|
+
- `declined` — the user said no. **Stop all work on this task** and tell them.
|
|
71
|
+
- `expired` / `unknown_pending` — nothing was decided; call again without `pendingId` if the work is still wanted.
|
|
72
|
+
|
|
73
|
+
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
74
|
|
|
79
75
|
---
|
|
80
76
|
|
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 pre-edit check fires on reasoning any of them recorded.
|
|
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
|
|
|
@@ -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":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AAe,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,202 @@
|
|
|
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 tells the agent to stop all work', 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, /Stop all work/);
|
|
119
|
+
assert.equal(h.calls.length, 1, 'nothing is activated');
|
|
120
|
+
});
|
|
121
|
+
test('expired and unknown_pending say how to start over', async () => {
|
|
122
|
+
for (const action of ['expired', 'unknown_pending']) {
|
|
123
|
+
const h = harness([{ success: true, action }]);
|
|
124
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
125
|
+
assert.equal(r.action, action);
|
|
126
|
+
assert.match(r.message, /WITHOUT pendingId/);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
test('awaiting_user tells the agent to stop polling and wait for the user', async () => {
|
|
130
|
+
const h = harness([{ success: true, action: 'awaiting_user', pendingId: 'p-1', pollsLeft: 0 }]);
|
|
131
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
132
|
+
assert.deepEqual([r.action, r.pollsLeft], ['awaiting_user', 0]);
|
|
133
|
+
assert.match(r.message, /Stop checking/);
|
|
134
|
+
assert.equal(h.elapsed(), 0, 'it returns at once instead of burning 20 s');
|
|
135
|
+
});
|
|
136
|
+
// --- the deadline ------------------------------------------------------------
|
|
137
|
+
test('an unanswered wait ends at the 20 s wall-clock deadline with pending_approval', async () => {
|
|
138
|
+
const h = harness([pending(3)]);
|
|
139
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
140
|
+
assert.equal(r.action, 'pending_approval');
|
|
141
|
+
assert.equal(r.pollsLeft, 3);
|
|
142
|
+
assert.match(r.message, /Checks left before you must stop and wait: 3/);
|
|
143
|
+
assert.ok(h.elapsed() <= WAIT_BUDGET_MS, `took ${h.elapsed()} ms`);
|
|
144
|
+
assert.ok(h.elapsed() >= WAIT_BUDGET_MS - 1_000, 'and used the budget');
|
|
145
|
+
const n = h.calls.length;
|
|
146
|
+
assert.ok(n >= 19 && n <= 21, `about one status call a second, got ${n}`);
|
|
147
|
+
});
|
|
148
|
+
test('every status call is bounded by what is left of the budget, never more than 30 s', async () => {
|
|
149
|
+
const h = harness([pending()]);
|
|
150
|
+
await createIntentFlow(WITH_ID, h.deps);
|
|
151
|
+
for (const c of h.calls) {
|
|
152
|
+
const remaining = WAIT_BUDGET_MS - (c.at - 1_000_000);
|
|
153
|
+
assert.ok(c.timeoutMs <= Math.min(remaining, MAX_STATUS_CALL_MS), `call at ${c.at} got ${c.timeoutMs}`);
|
|
154
|
+
assert.ok(c.timeoutMs > 0);
|
|
155
|
+
}
|
|
156
|
+
assert.equal(h.calls[0].timeoutMs, WAIT_BUDGET_MS, 'the first call may use the whole budget');
|
|
157
|
+
});
|
|
158
|
+
test('a status call that times out ends the wait as pending_approval, by the deadline', async () => {
|
|
159
|
+
// Kawa Code is busy with another session's slow handler: the call burns its
|
|
160
|
+
// whole timeout and gets nothing. The tool must still return by the deadline
|
|
161
|
+
// — not 30 s after it — and it is not an error.
|
|
162
|
+
let spent = 0;
|
|
163
|
+
const h = harness([(call) => {
|
|
164
|
+
spent = call.timeoutMs;
|
|
165
|
+
return new MuninnTimeoutError(call.timeoutMs / 1000, 'intent', 'pending-intent-status');
|
|
166
|
+
}], { costMs: 0 });
|
|
167
|
+
// The fake request must also cost its timeout, as a real one would.
|
|
168
|
+
const base = h.deps.request;
|
|
169
|
+
h.deps.request = async (d, a, data, timeoutMs) => {
|
|
170
|
+
try {
|
|
171
|
+
return await base(d, a, data, timeoutMs);
|
|
172
|
+
}
|
|
173
|
+
finally {
|
|
174
|
+
await h.deps.sleep(timeoutMs ?? 0);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
178
|
+
assert.equal(r.action, 'pending_approval');
|
|
179
|
+
assert.equal(spent, WAIT_BUDGET_MS);
|
|
180
|
+
assert.ok(h.elapsed() <= WAIT_BUDGET_MS, `took ${h.elapsed()} ms`);
|
|
181
|
+
});
|
|
182
|
+
test('a slow earlier reply leaves later calls only the time that remains', async () => {
|
|
183
|
+
const h = harness([pending()], { costMs: 4_000 });
|
|
184
|
+
const r = await createIntentFlow(WITH_ID, h.deps);
|
|
185
|
+
assert.equal(r.action, 'pending_approval');
|
|
186
|
+
assert.ok(h.elapsed() <= WAIT_BUDGET_MS + 4_000 + 1_000, `took ${h.elapsed()} ms`);
|
|
187
|
+
for (const c of h.calls)
|
|
188
|
+
assert.ok(c.timeoutMs <= MAX_STATUS_CALL_MS);
|
|
189
|
+
});
|
|
190
|
+
test('an error that is not a timeout is raised', async () => {
|
|
191
|
+
const h = harness([new Error('Muninn handler returned success: false with no error message')]);
|
|
192
|
+
await assert.rejects(createIntentFlow(WITH_ID, h.deps), /no error message/);
|
|
193
|
+
});
|
|
194
|
+
test('a reply it does not recognise is raised rather than guessed at', async () => {
|
|
195
|
+
const h = harness([{ success: true, action: 'something-new' }]);
|
|
196
|
+
await assert.rejects(createIntentFlow(WITH_ID, h.deps), /Unexpected reply/);
|
|
197
|
+
});
|
|
198
|
+
test('a decision to create with no intent id is raised', async () => {
|
|
199
|
+
const h = harness([{ success: true, action: 'created' }]);
|
|
200
|
+
await assert.rejects(createIntentFlow(WITH_ID, h.deps), /no intent ID/);
|
|
201
|
+
});
|
|
202
|
+
//# 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":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,MAAM,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,cAAc,EACd,kBAAkB,GAGnB,MAAM,oBAAoB,CAAA;AAE3B,MAAM,KAAK,GAAsB;IAC/B,QAAQ,EAAE,OAAO;IACjB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,SAAS;IACtB,YAAY,EAAE,SAAS;CACxB,CAAA;AAID;2EAC2E;AAC3E,SAAS,OAAO,CAAC,OAA2C,EAAE,OAA4B,EAAE;IAC1F,IAAI,CAAC,GAAG,SAAS,CAAA;IACjB,MAAM,KAAK,GAAW,EAAE,C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AI,EAAE;IAChF,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC,CAAA;IAC/D,MAAM,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC,CAAA;AAC7E,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,kDAAkD,EAAE,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,9 +96,12 @@ 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
|
|
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.
|
|
100
103
|
*/
|
|
101
|
-
reason?:
|
|
104
|
+
reason?: string;
|
|
102
105
|
failedStage?: string;
|
|
103
106
|
error?: string;
|
|
104
107
|
/**
|
|
@@ -56,31 +56,25 @@ export async function completeIntent(input) {
|
|
|
56
56
|
const success = res.success !== false && !!intentId;
|
|
57
57
|
const deferredConflicts = Array.isArray(res.deferredConflicts) ? res.deferredConflicts : [];
|
|
58
58
|
const committedDecisionCount = typeof res.committedDecisionCount === 'number' ? res.committedDecisionCount : undefined;
|
|
59
|
-
const reason = res.reason === '
|
|
59
|
+
const reason = typeof res.reason === 'string' ? res.reason : undefined;
|
|
60
60
|
const apiSyncDeferred = res.apiSyncDeferred === true;
|
|
61
61
|
const completionCollisions = Array.isArray(res.collisions) ? res.collisions : [];
|
|
62
62
|
// Branch on the outcome shape — pick the message that tells the agent exactly
|
|
63
63
|
// what to surface to the user.
|
|
64
64
|
let newStatus;
|
|
65
65
|
let message;
|
|
66
|
-
if (!success
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
message =
|
|
73
|
-
`Could not complete intent "${intentTitle}" — transient failure${stage}${errPart}. ` +
|
|
74
|
-
`The ephemerals were preserved. Wait for the underlying issue to clear, then retry complete_intent. ` +
|
|
75
|
-
`If retrying repeatedly fails, the user can abandon the intent (complete_intent(status="abandoned")).`;
|
|
76
|
-
}
|
|
77
|
-
else if (!success) {
|
|
78
|
-
// Catch-all for legacy / unexpected error shapes, plus the anomalous
|
|
79
|
-
// "no failure declared AND no intentId" case. In the latter nothing ran,
|
|
80
|
-
// so do NOT echo the requested status as though it had landed.
|
|
66
|
+
if (!success) {
|
|
67
|
+
// Every failure shape (transient-failure, resolution_required,
|
|
68
|
+
// completion_locked, legacy errors), plus the anomalous "no failure
|
|
69
|
+
// declared AND no intentId" case. In the latter nothing ran, so do NOT echo
|
|
70
|
+
// the requested status as though it had landed. Kawa Code owns the wording
|
|
71
|
+
// of what to do next: relay its `message` (else `error`) verbatim.
|
|
81
72
|
newStatus = res.newStatus || res.status || (intentId ? input.status : 'active');
|
|
73
|
+
const guidance = typeof res.message === 'string' && res.message
|
|
74
|
+
? res.message
|
|
75
|
+
: typeof res.error === 'string' ? res.error : '';
|
|
82
76
|
message = intentId
|
|
83
|
-
? `Failed to complete intent "${intentTitle}"
|
|
77
|
+
? `Failed to complete intent "${intentTitle}".${guidance ? ` ${guidance}` : ''}`
|
|
84
78
|
: `Could not complete intent "${intentTitle}" — Kawa Code returned no intent id, so NOTHING was completed: the status was not changed, no code blocks were captured, and no decisions were distilled. Do NOT report this as committed. Retry complete_intent; if it fails again, surface the failure to the user rather than assuming the intent closed.`;
|
|
85
79
|
}
|
|
86
80
|
else {
|
|
@@ -149,6 +143,8 @@ You MUST inspect the response:
|
|
|
149
143
|
|
|
150
144
|
- success === false && reason === "transient-failure" — the intent stays active and nothing was lost. Report failedStage plus the error; retry once the cause clears, or abandon if it persists.
|
|
151
145
|
|
|
146
|
+
- success === false with any other reason (e.g. "resolution_required", "completion_locked") — the intent stays active and nothing was written. \`message\` carries Kawa Code's instructions for the next step; follow them rather than retrying blindly.
|
|
147
|
+
|
|
152
148
|
Autonomous sessions: deferredConflicts is not a blocking state — log and continue.`,
|
|
153
149
|
inputSchema: completeIntentSchema,
|
|
154
150
|
handler: completeIntent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complete-intent.js","sourceRoot":"","sources":["../../src/tools/complete-intent.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,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,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,EAAE,CAAC,QAAQ,CAAC,2VAA2V,CAAC;IACrY,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yEAAyE,CAAC;IACpH,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAA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CAAC,CAAC,SAAS;QAClF,qBAAqB,EAAE,OAAO,GAAG,CAAC,qBAAqB,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS;QAC5G,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,UAAU,EAAE,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS;KAC/E,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;;;;;;;;;;;;mFAYoE;IACjF,WAAW,EAAE,oBAAoB;IACjC,OAAO,EAAE,cAAc;CACxB,CAAA"}
|
|
@@ -6,15 +6,15 @@ export declare const createAndActivateIntentSchema: z.ZodObject<{
|
|
|
6
6
|
description: z.ZodString;
|
|
7
7
|
templateType: z.ZodDefault<z.ZodEnum<["feature", "refactor", "exploration"]>>;
|
|
8
8
|
constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
9
|
-
|
|
9
|
+
pendingId: z.ZodOptional<z.ZodString>;
|
|
10
10
|
}, "strip", z.ZodTypeAny, {
|
|
11
11
|
repoPath: string;
|
|
12
12
|
title: string;
|
|
13
13
|
description: string;
|
|
14
14
|
templateType: "feature" | "refactor" | "exploration";
|
|
15
|
-
force: boolean;
|
|
16
15
|
repoOrigin?: string | undefined;
|
|
17
16
|
constraints?: string[] | undefined;
|
|
17
|
+
pendingId?: string | undefined;
|
|
18
18
|
}, {
|
|
19
19
|
repoPath: string;
|
|
20
20
|
title: string;
|
|
@@ -22,31 +22,51 @@ export declare const createAndActivateIntentSchema: z.ZodObject<{
|
|
|
22
22
|
repoOrigin?: string | undefined;
|
|
23
23
|
templateType?: "feature" | "refactor" | "exploration" | undefined;
|
|
24
24
|
constraints?: string[] | undefined;
|
|
25
|
-
|
|
25
|
+
pendingId?: string | undefined;
|
|
26
26
|
}>;
|
|
27
27
|
export type CreateIntentInput = z.infer<typeof createAndActivateIntentSchema>;
|
|
28
|
-
|
|
29
|
-
intentId: string;
|
|
30
|
-
title: string;
|
|
31
|
-
author: string;
|
|
32
|
-
status: string;
|
|
33
|
-
createdBy: string;
|
|
34
|
-
staleness: 'fresh' | 'aging' | 'likely_stale';
|
|
35
|
-
severity: 'high' | 'medium' | 'low';
|
|
36
|
-
overlapType: string;
|
|
37
|
-
overlappingFiles: string[];
|
|
38
|
-
similarityScore: number;
|
|
39
|
-
oppositionDetected: boolean;
|
|
40
|
-
oppositionDetail: string | null;
|
|
41
|
-
}
|
|
28
|
+
export type CreateIntentAction = 'created' | 'reactivated' | 'pending_approval' | 'awaiting_user' | 'declined' | 'expired' | 'unknown_pending';
|
|
42
29
|
export interface CreateIntentResponse {
|
|
43
30
|
success: boolean;
|
|
44
31
|
intentId: string;
|
|
45
|
-
action:
|
|
32
|
+
action: CreateIntentAction;
|
|
33
|
+
/** Present while the request is parked in Kawa Code. */
|
|
34
|
+
pendingId?: string;
|
|
35
|
+
/** How many more times the user's decision may be checked before waiting for them. */
|
|
36
|
+
pollsLeft?: number;
|
|
46
37
|
message: string;
|
|
47
|
-
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* How long one tool call waits for the user's decision. A WALL-CLOCK budget, not a
|
|
41
|
+
* count of status calls: each status call is bounded by what is left of it, so the
|
|
42
|
+
* deadline holds even when Kawa Code is busy. 20 s sits well inside every Claude
|
|
43
|
+
* Code tool-call limit (hours; auto-background at 2 min) and inside the 30 s IPC
|
|
44
|
+
* default.
|
|
45
|
+
*/
|
|
46
|
+
export declare const WAIT_BUDGET_MS = 20000;
|
|
47
|
+
/** Pause between status calls. */
|
|
48
|
+
export declare const POLL_INTERVAL_MS = 1000;
|
|
49
|
+
/** The IPC default; a status call never gets more than this. */
|
|
50
|
+
export declare const MAX_STATUS_CALL_MS = 30000;
|
|
51
|
+
/** Below this, another status call cannot usefully finish: stop and report. */
|
|
52
|
+
export declare const MIN_STATUS_CALL_MS = 250;
|
|
53
|
+
/** The side effects, injected so the loop is testable without Muninn or a clock. */
|
|
54
|
+
export interface CreateIntentDeps {
|
|
55
|
+
request: (domain: string, action: string, data?: any, timeoutMs?: number) => Promise<any>;
|
|
56
|
+
now: () => number;
|
|
57
|
+
sleep: (ms: number) => Promise<void>;
|
|
58
|
+
resolveOrigin: (repoOrigin: string | undefined, repoPath: string) => string;
|
|
48
59
|
}
|
|
49
60
|
export declare function createAndActivateIntent(input: CreateIntentInput): Promise<CreateIntentResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* Forward the request to Kawa Code and relay the outcome. No state, no cache: the
|
|
63
|
+
* parked request, the owner's answer and the poll cap all live in Kawa Code.
|
|
64
|
+
*
|
|
65
|
+
* Deliberately a plain forward-and-wait. The wait is here, not in Kawa Code,
|
|
66
|
+
* because Kawa Code runs one request at a time: a handler that waited would stall
|
|
67
|
+
* every other session's calls.
|
|
68
|
+
*/
|
|
69
|
+
export declare function createIntentFlow(input: CreateIntentInput, deps: CreateIntentDeps): Promise<CreateIntentResponse>;
|
|
50
70
|
export declare const createAndActivateIntentTool: {
|
|
51
71
|
name: string;
|
|
52
72
|
description: string;
|
|
@@ -57,15 +77,15 @@ export declare const createAndActivateIntentTool: {
|
|
|
57
77
|
description: z.ZodString;
|
|
58
78
|
templateType: z.ZodDefault<z.ZodEnum<["feature", "refactor", "exploration"]>>;
|
|
59
79
|
constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
60
|
-
|
|
80
|
+
pendingId: z.ZodOptional<z.ZodString>;
|
|
61
81
|
}, "strip", z.ZodTypeAny, {
|
|
62
82
|
repoPath: string;
|
|
63
83
|
title: string;
|
|
64
84
|
description: string;
|
|
65
85
|
templateType: "feature" | "refactor" | "exploration";
|
|
66
|
-
force: boolean;
|
|
67
86
|
repoOrigin?: string | undefined;
|
|
68
87
|
constraints?: string[] | undefined;
|
|
88
|
+
pendingId?: string | undefined;
|
|
69
89
|
}, {
|
|
70
90
|
repoPath: string;
|
|
71
91
|
title: string;
|
|
@@ -73,8 +93,7 @@ export declare const createAndActivateIntentTool: {
|
|
|
73
93
|
repoOrigin?: string | undefined;
|
|
74
94
|
templateType?: "feature" | "refactor" | "exploration" | undefined;
|
|
75
95
|
constraints?: string[] | undefined;
|
|
76
|
-
|
|
96
|
+
pendingId?: string | undefined;
|
|
77
97
|
}>;
|
|
78
98
|
handler: typeof createAndActivateIntent;
|
|
79
99
|
};
|
|
80
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { request } from '../services/muninn-ipc.js';
|
|
2
|
+
import { request, MuninnTimeoutError } from '../services/muninn-ipc.js';
|
|
3
3
|
import { resolveOrigin } from './resolve-origin.js';
|
|
4
4
|
export const createAndActivateIntentSchema = z.object({
|
|
5
5
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
@@ -8,52 +8,69 @@ export const createAndActivateIntentSchema = z.object({
|
|
|
8
8
|
description: z.string().max(2000).describe('What this intent accomplishes'),
|
|
9
9
|
templateType: z.enum(['feature', 'refactor', 'exploration']).default('feature').describe('Type of work'),
|
|
10
10
|
constraints: z.array(z.string()).optional().describe('Requirements or constraints for this work'),
|
|
11
|
-
|
|
11
|
+
pendingId: z.string().optional().describe('Only after a pending_approval response: the pendingId it returned. Asks whether the user has decided. Pass the same title, description and repoPath as before.'),
|
|
12
12
|
});
|
|
13
|
+
/**
|
|
14
|
+
* How long one tool call waits for the user's decision. A WALL-CLOCK budget, not a
|
|
15
|
+
* count of status calls: each status call is bounded by what is left of it, so the
|
|
16
|
+
* deadline holds even when Kawa Code is busy. 20 s sits well inside every Claude
|
|
17
|
+
* Code tool-call limit (hours; auto-background at 2 min) and inside the 30 s IPC
|
|
18
|
+
* default.
|
|
19
|
+
*/
|
|
20
|
+
export const WAIT_BUDGET_MS = 20_000;
|
|
21
|
+
/** Pause between status calls. */
|
|
22
|
+
export const POLL_INTERVAL_MS = 1_000;
|
|
23
|
+
/** The IPC default; a status call never gets more than this. */
|
|
24
|
+
export const MAX_STATUS_CALL_MS = 30_000;
|
|
25
|
+
/** Below this, another status call cannot usefully finish: stop and report. */
|
|
26
|
+
export const MIN_STATUS_CALL_MS = 250;
|
|
27
|
+
const liveDeps = {
|
|
28
|
+
request,
|
|
29
|
+
now: () => Date.now(),
|
|
30
|
+
sleep: ms => new Promise(resolve => setTimeout(resolve, ms)),
|
|
31
|
+
resolveOrigin,
|
|
32
|
+
};
|
|
13
33
|
export async function createAndActivateIntent(input) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
34
|
+
return createIntentFlow(input, liveDeps);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Forward the request to Kawa Code and relay the outcome. No state, no cache: the
|
|
38
|
+
* parked request, the owner's answer and the poll cap all live in Kawa Code.
|
|
39
|
+
*
|
|
40
|
+
* Deliberately a plain forward-and-wait. The wait is here, not in Kawa Code,
|
|
41
|
+
* because Kawa Code runs one request at a time: a handler that waited would stall
|
|
42
|
+
* every other session's calls.
|
|
43
|
+
*/
|
|
44
|
+
export async function createIntentFlow(input, deps) {
|
|
45
|
+
// `force` is gone (hard cut). Only the owner, in Kawa Code, can decide to
|
|
46
|
+
// proceed past an overlap. A client holding a stale schema must be told, not
|
|
47
|
+
// silently ignored: it believes it asked to bypass the check.
|
|
48
|
+
if (input.force === true) {
|
|
49
|
+
throw new Error('`force` is no longer accepted. If the new intent overlaps existing work, Kawa Code asks the user to decide; ' +
|
|
50
|
+
'call create_and_activate_intent again without `force`.');
|
|
51
|
+
}
|
|
52
|
+
const origin = deps.resolveOrigin(input.repoOrigin, input.repoPath);
|
|
53
|
+
if (input.pendingId) {
|
|
54
|
+
return waitForDecision(origin, input.pendingId, deps);
|
|
55
|
+
}
|
|
56
|
+
// Create. If a sufficiently similar intent created by THIS session already
|
|
57
|
+
// exists, the server may reactivate it instead of creating a duplicate; two
|
|
58
|
+
// sessions' near-duplicates are surfaced as an overlap, not merged.
|
|
59
|
+
const createRes = await deps.request('intent', 'create', {
|
|
60
|
+
repoOrigin: origin,
|
|
21
61
|
title: input.title,
|
|
22
62
|
description: input.description,
|
|
23
63
|
templateType: input.templateType,
|
|
24
64
|
constraints: input.constraints || [],
|
|
25
65
|
scope: { type: 'repo', paths: [] },
|
|
26
|
-
force: input.force || false,
|
|
27
66
|
});
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
'',
|
|
36
|
-
];
|
|
37
|
-
for (const c of conflicts) {
|
|
38
|
-
const badge = c.severity === 'high' ? '[HIGH]' : c.severity === 'medium' ? '[MEDIUM]' : '[LOW]';
|
|
39
|
-
lines.push(`${badge} "${c.title}" by ${c.author} (${c.status}, ${c.staleness})`);
|
|
40
|
-
if (c.overlappingFiles.length > 0) {
|
|
41
|
-
lines.push(` Files: ${c.overlappingFiles.join(', ')}`);
|
|
42
|
-
}
|
|
43
|
-
if (c.oppositionDetected) {
|
|
44
|
-
lines.push(` Semantic opposition: ${c.oppositionDetail}`);
|
|
45
|
-
}
|
|
46
|
-
lines.push(` Similarity: ${(c.similarityScore * 100).toFixed(0)}%`);
|
|
47
|
-
lines.push('');
|
|
48
|
-
}
|
|
49
|
-
lines.push('To proceed anyway, call create_and_activate_intent again with force=true.');
|
|
50
|
-
return {
|
|
51
|
-
success: false,
|
|
52
|
-
intentId: '',
|
|
53
|
-
action: 'conflict',
|
|
54
|
-
message: lines.join('\n'),
|
|
55
|
-
conflicts,
|
|
56
|
-
};
|
|
67
|
+
// Overlap: Kawa Code parked the request for the user. NOTHING about the
|
|
68
|
+
// overlapping intents is relayed here beyond a count — the API fills each one's
|
|
69
|
+
// `author` with a display name, and the card in Kawa Code is where the user
|
|
70
|
+
// reads the detail.
|
|
71
|
+
if (createRes.action === 'pending_approval') {
|
|
72
|
+
const count = typeof createRes.conflictCount === 'number' ? createRes.conflictCount : 0;
|
|
73
|
+
return pendingApproval(createRes.pendingId, undefined, count);
|
|
57
74
|
}
|
|
58
75
|
// Propagate Muninn-side errors (e.g. not signed in, API unreachable) to the AI
|
|
59
76
|
// so it can tell the user how to recover instead of silently proceeding.
|
|
@@ -64,24 +81,118 @@ export async function createAndActivateIntent(input) {
|
|
|
64
81
|
if (!intentId) {
|
|
65
82
|
throw new Error('Intent creation succeeded but no intent ID was returned');
|
|
66
83
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
return activate(origin, intentId, createRes.action === 'reactivated' ? 'reactivated' : 'created', input.title, deps);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Ask Kawa Code whether the user has decided, for up to [`WAIT_BUDGET_MS`].
|
|
88
|
+
*
|
|
89
|
+
* Only the FIRST status call of a tool call carries `countPoll`: the loop makes
|
|
90
|
+
* ~20 of them per call, and the cap on polling counts tool calls.
|
|
91
|
+
*/
|
|
92
|
+
async function waitForDecision(origin, pendingId, deps) {
|
|
93
|
+
const deadline = deps.now() + WAIT_BUDGET_MS;
|
|
94
|
+
let countPoll = true;
|
|
95
|
+
let pollsLeft;
|
|
96
|
+
for (;;) {
|
|
97
|
+
const remaining = deadline - deps.now();
|
|
98
|
+
if (remaining < MIN_STATUS_CALL_MS)
|
|
99
|
+
break;
|
|
100
|
+
let res;
|
|
101
|
+
try {
|
|
102
|
+
res = await deps.request('intent', 'pending-intent-status', { repoOrigin: origin, pendingId, countPoll }, Math.min(remaining, MAX_STATUS_CALL_MS));
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
// Kawa Code runs one request at a time, so a status call can sit behind
|
|
106
|
+
// another session's slow handler (a distillation can run for minutes).
|
|
107
|
+
// That is not a failure: the user has not decided, and the agent's next
|
|
108
|
+
// step is the same as for any other pending reply — call again.
|
|
109
|
+
if (err instanceof MuninnTimeoutError)
|
|
110
|
+
break;
|
|
111
|
+
throw err;
|
|
112
|
+
}
|
|
113
|
+
countPoll = false;
|
|
114
|
+
switch (res?.action) {
|
|
115
|
+
case 'created':
|
|
116
|
+
case 'reactivated': {
|
|
117
|
+
const intentId = res.intentId || res.intent?.id || '';
|
|
118
|
+
if (!intentId)
|
|
119
|
+
throw new Error('The decision was recorded but Kawa Code returned no intent ID');
|
|
120
|
+
return activate(origin, intentId, res.action, undefined, deps);
|
|
121
|
+
}
|
|
122
|
+
case 'declined':
|
|
123
|
+
return {
|
|
124
|
+
success: false,
|
|
125
|
+
intentId: '',
|
|
126
|
+
action: 'declined',
|
|
127
|
+
message: 'The user declined this intent. It was NOT created. Stop all work on this task now — ' +
|
|
128
|
+
'make no further edits or commits — and tell the user you have stopped.',
|
|
129
|
+
};
|
|
130
|
+
case 'expired':
|
|
131
|
+
return {
|
|
132
|
+
success: false,
|
|
133
|
+
intentId: '',
|
|
134
|
+
action: 'expired',
|
|
135
|
+
message: 'The request went unanswered for 24 hours and expired. Nothing was created and nothing was decided. ' +
|
|
136
|
+
'If the user still wants this work, call create_and_activate_intent again WITHOUT pendingId.',
|
|
137
|
+
};
|
|
138
|
+
case 'unknown_pending':
|
|
139
|
+
return {
|
|
140
|
+
success: false,
|
|
141
|
+
intentId: '',
|
|
142
|
+
action: 'unknown_pending',
|
|
143
|
+
message: 'Kawa Code has no pending request with that pendingId (it may have been cleaned up). ' +
|
|
144
|
+
'Call create_and_activate_intent again WITHOUT pendingId to start over.',
|
|
145
|
+
};
|
|
146
|
+
case 'awaiting_user':
|
|
147
|
+
return {
|
|
148
|
+
success: false,
|
|
149
|
+
intentId: '',
|
|
150
|
+
action: 'awaiting_user',
|
|
151
|
+
pendingId,
|
|
152
|
+
pollsLeft: 0,
|
|
153
|
+
message: 'Stop checking. The decision is waiting for the user in Kawa Code (Orchestration panel). ' +
|
|
154
|
+
'Tell the user, and do not call this tool again until they say they have answered; ' +
|
|
155
|
+
'then call it once more with the same pendingId.',
|
|
156
|
+
};
|
|
157
|
+
case 'pending_approval':
|
|
158
|
+
pollsLeft = typeof res.pollsLeft === 'number' ? res.pollsLeft : pollsLeft;
|
|
159
|
+
break;
|
|
160
|
+
default:
|
|
161
|
+
throw new Error(`Unexpected reply from Kawa Code while waiting for the user's decision: ${JSON.stringify(res)}`);
|
|
162
|
+
}
|
|
163
|
+
const left = deadline - deps.now();
|
|
164
|
+
if (left < MIN_STATUS_CALL_MS)
|
|
165
|
+
break;
|
|
166
|
+
await deps.sleep(Math.min(POLL_INTERVAL_MS, left));
|
|
167
|
+
}
|
|
168
|
+
return pendingApproval(pendingId, pollsLeft);
|
|
169
|
+
}
|
|
170
|
+
function pendingApproval(pendingId, pollsLeft, conflictCount) {
|
|
171
|
+
const overlap = conflictCount && conflictCount > 0
|
|
172
|
+
? `This intent overlaps with ${conflictCount} existing intent${conflictCount === 1 ? '' : 's'}. `
|
|
173
|
+
: '';
|
|
174
|
+
const left = pollsLeft === undefined ? '' : ` Checks left before you must stop and wait: ${pollsLeft}.`;
|
|
78
175
|
return {
|
|
79
|
-
success:
|
|
80
|
-
intentId,
|
|
81
|
-
action,
|
|
82
|
-
|
|
176
|
+
success: false,
|
|
177
|
+
intentId: '',
|
|
178
|
+
action: 'pending_approval',
|
|
179
|
+
pendingId,
|
|
180
|
+
pollsLeft,
|
|
181
|
+
message: `${overlap}The user decides in Kawa Code (Orchestration panel); the intent has NOT been created. ` +
|
|
182
|
+
`Tell the user it is waiting for them, then call create_and_activate_intent again with pendingId="${pendingId}" ` +
|
|
183
|
+
`and the same title, description and repoPath.${left}`,
|
|
83
184
|
};
|
|
84
185
|
}
|
|
186
|
+
/** Set the new intent as THIS session's current focus. Under the multi-active
|
|
187
|
+
* model (no lock) this never conflicts: it only moves this session's pointer. */
|
|
188
|
+
async function activate(origin, intentId, action, title, deps) {
|
|
189
|
+
await deps.request('intent', 'set-active', { repoOrigin: origin, intentId });
|
|
190
|
+
const named = title ? ` "${title}"` : '';
|
|
191
|
+
const message = action === 'reactivated'
|
|
192
|
+
? `Reactivated existing similar intent${named} — resuming previous work instead of creating a duplicate.`
|
|
193
|
+
: `Created and activated intent${named}`;
|
|
194
|
+
return { success: true, intentId, action, message };
|
|
195
|
+
}
|
|
85
196
|
export const createAndActivateIntentTool = {
|
|
86
197
|
name: 'create_and_activate_intent',
|
|
87
198
|
description: `Create a new intent from the user's request and mark it as active for THIS session.
|
|
@@ -95,13 +206,23 @@ This ensures all AI-generated code gets properly tracked and attributed.
|
|
|
95
206
|
|
|
96
207
|
Multi-active model: many intents can be active on a repo at once (one per
|
|
97
208
|
session/teammate). Creating + activating one only sets YOUR session's current
|
|
98
|
-
focus — it never blocks or displaces another session's active intent
|
|
99
|
-
|
|
209
|
+
focus — it never blocks or displaces another session's active intent.
|
|
210
|
+
|
|
211
|
+
If the new intent overlaps existing work, YOU do not decide what happens: Kawa
|
|
212
|
+
Code asks the user, and this tool reports the outcome. Act on "action":
|
|
213
|
+
- "created" / "reactivated": done; the intent is active. Proceed.
|
|
214
|
+
- "pending_approval": the user has been asked in Kawa Code. Tell them it is waiting
|
|
215
|
+
for them, then call this tool again with the returned pendingId (same title,
|
|
216
|
+
description and repoPath). Each call waits up to ~20 seconds for the answer.
|
|
217
|
+
- "awaiting_user": stop calling. Tell the user the decision is waiting in Kawa Code
|
|
218
|
+
and call once more with the pendingId only after they say they have answered.
|
|
219
|
+
- "declined": the user said no. Stop all work on this task and tell them.
|
|
220
|
+
- "expired" / "unknown_pending": nothing was decided; call again without pendingId
|
|
221
|
+
if the work is still wanted.
|
|
222
|
+
Never try to bypass an overlap; there is no force option.
|
|
100
223
|
|
|
101
|
-
If
|
|
102
|
-
|
|
103
|
-
details to the user and ask whether to proceed. If yes, retry with force=true to
|
|
104
|
-
bypass conflict detection.`,
|
|
224
|
+
If this tool call itself times out (before any pendingId was returned), call it
|
|
225
|
+
once more with the same arguments — it will not create a duplicate request.`,
|
|
105
226
|
inputSchema: createAndActivateIntentSchema,
|
|
106
227
|
handler: createAndActivateIntent
|
|
107
228
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-intent.js","sourceRoot":"","sources":["../../src/tools/create-intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"create-intent.js","sourceRoot":"","sources":["../../src/tools/create-intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,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,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAC9E,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAC3E,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC;IACxG,WAAW,EAAE,CAAC,CAA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AAE,OAAO,EAAE,CAAA;AACrD,CAAC;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;4EA2B6D;IAC1E,WAAW,EAAE,6BAA6B;IAC1C,OAAO,EAAE,uBAAuB;CACjC,CAAA"}
|
package/build/tools/index.d.ts
CHANGED
|
@@ -72,15 +72,15 @@ export declare const allTools: ({
|
|
|
72
72
|
description: import("zod").ZodString;
|
|
73
73
|
templateType: import("zod").ZodDefault<import("zod").ZodEnum<["feature", "refactor", "exploration"]>>;
|
|
74
74
|
constraints: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
75
|
-
|
|
75
|
+
pendingId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
76
76
|
}, "strip", import("zod").ZodTypeAny, {
|
|
77
77
|
repoPath: string;
|
|
78
78
|
title: string;
|
|
79
79
|
description: string;
|
|
80
80
|
templateType: "feature" | "refactor" | "exploration";
|
|
81
|
-
force: boolean;
|
|
82
81
|
repoOrigin?: string | undefined;
|
|
83
82
|
constraints?: string[] | undefined;
|
|
83
|
+
pendingId?: string | undefined;
|
|
84
84
|
}, {
|
|
85
85
|
repoPath: string;
|
|
86
86
|
title: string;
|
|
@@ -88,7 +88,7 @@ export declare const allTools: ({
|
|
|
88
88
|
repoOrigin?: string | undefined;
|
|
89
89
|
templateType?: "feature" | "refactor" | "exploration" | undefined;
|
|
90
90
|
constraints?: string[] | undefined;
|
|
91
|
-
|
|
91
|
+
pendingId?: string | undefined;
|
|
92
92
|
}>;
|
|
93
93
|
handler: typeof createAndActivateIntent;
|
|
94
94
|
} | {
|
|
@@ -588,17 +588,16 @@ export declare const allTools: ({
|
|
|
588
588
|
force: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
|
589
589
|
}, "strip", import("zod").ZodTypeAny, {
|
|
590
590
|
repoPath: string;
|
|
591
|
-
force: boolean;
|
|
592
591
|
contextIssues: boolean;
|
|
593
592
|
model: string;
|
|
594
593
|
maxStories: number;
|
|
595
594
|
allowCommitSplitting: boolean;
|
|
596
595
|
estimateOnly: boolean;
|
|
596
|
+
force: boolean;
|
|
597
597
|
commits?: number | undefined;
|
|
598
598
|
commitRange?: string | undefined;
|
|
599
599
|
}, {
|
|
600
600
|
repoPath: string;
|
|
601
|
-
force?: boolean | undefined;
|
|
602
601
|
commits?: number | undefined;
|
|
603
602
|
commitRange?: string | undefined;
|
|
604
603
|
contextIssues?: boolean | undefined;
|
|
@@ -606,6 +605,7 @@ export declare const allTools: ({
|
|
|
606
605
|
maxStories?: number | undefined;
|
|
607
606
|
allowCommitSplitting?: boolean | undefined;
|
|
608
607
|
estimateOnly?: boolean | undefined;
|
|
608
|
+
force?: boolean | undefined;
|
|
609
609
|
}>;
|
|
610
610
|
handler: typeof inferHistory;
|
|
611
611
|
} | {
|
|
@@ -11,17 +11,16 @@ export declare const inferHistorySchema: z.ZodObject<{
|
|
|
11
11
|
force: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
13
|
repoPath: string;
|
|
14
|
-
force: boolean;
|
|
15
14
|
contextIssues: boolean;
|
|
16
15
|
model: string;
|
|
17
16
|
maxStories: number;
|
|
18
17
|
allowCommitSplitting: boolean;
|
|
19
18
|
estimateOnly: boolean;
|
|
19
|
+
force: boolean;
|
|
20
20
|
commits?: number | undefined;
|
|
21
21
|
commitRange?: string | undefined;
|
|
22
22
|
}, {
|
|
23
23
|
repoPath: string;
|
|
24
|
-
force?: boolean | undefined;
|
|
25
24
|
commits?: number | undefined;
|
|
26
25
|
commitRange?: string | undefined;
|
|
27
26
|
contextIssues?: boolean | undefined;
|
|
@@ -29,6 +28,7 @@ export declare const inferHistorySchema: z.ZodObject<{
|
|
|
29
28
|
maxStories?: number | undefined;
|
|
30
29
|
allowCommitSplitting?: boolean | undefined;
|
|
31
30
|
estimateOnly?: boolean | undefined;
|
|
31
|
+
force?: boolean | undefined;
|
|
32
32
|
}>;
|
|
33
33
|
export type InferHistoryInput = z.infer<typeof inferHistorySchema>;
|
|
34
34
|
export type AutoMode = 'first-run' | 'resume' | 'head-equals-last' | 'fallback-rewritten' | 'fallback-no-remote' | 'fallback-error';
|
|
@@ -81,17 +81,16 @@ export declare const inferHistoryTool: {
|
|
|
81
81
|
force: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
82
82
|
}, "strip", z.ZodTypeAny, {
|
|
83
83
|
repoPath: string;
|
|
84
|
-
force: boolean;
|
|
85
84
|
contextIssues: boolean;
|
|
86
85
|
model: string;
|
|
87
86
|
maxStories: number;
|
|
88
87
|
allowCommitSplitting: boolean;
|
|
89
88
|
estimateOnly: boolean;
|
|
89
|
+
force: boolean;
|
|
90
90
|
commits?: number | undefined;
|
|
91
91
|
commitRange?: string | undefined;
|
|
92
92
|
}, {
|
|
93
93
|
repoPath: string;
|
|
94
|
-
force?: boolean | undefined;
|
|
95
94
|
commits?: number | undefined;
|
|
96
95
|
commitRange?: string | undefined;
|
|
97
96
|
contextIssues?: boolean | undefined;
|
|
@@ -99,6 +98,7 @@ export declare const inferHistoryTool: {
|
|
|
99
98
|
maxStories?: number | undefined;
|
|
100
99
|
allowCommitSplitting?: boolean | undefined;
|
|
101
100
|
estimateOnly?: boolean | undefined;
|
|
101
|
+
force?: boolean | undefined;
|
|
102
102
|
}>;
|
|
103
103
|
handler: typeof inferHistory;
|
|
104
104
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kawacode/mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "Team-aware memory for Claude Code, Cursor, and other AI coding assistants — intent tracking, decision history, real-time team conflict detection.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"mcp": "build/index.js",
|
|
8
8
|
"kawacode-mcp": "build/index.js",
|
|
9
9
|
"kawacode-on-stop": "build/kawacode-on-stop.js",
|
|
10
|
+
"kawacode-on-session-end": "build/kawacode-on-session-end.js",
|
|
10
11
|
"kawacode-on-pre-edit": "build/kawacode-on-pre-edit.js"
|
|
11
12
|
},
|
|
12
13
|
"type": "module",
|