@kawacode/mcp 6.1.5 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md.example +13 -0
- package/build/index.js +13 -1
- package/build/index.js.map +1 -1
- package/build/kawacode-on-pre-edit.d.ts +5 -0
- package/build/kawacode-on-pre-edit.js +73 -9
- package/build/kawacode-on-pre-edit.js.map +1 -1
- package/build/kawacode-on-stop.d.ts +49 -23
- package/build/kawacode-on-stop.js +288 -38
- package/build/kawacode-on-stop.js.map +1 -1
- package/build/services/muninn-ipc.d.ts +19 -1
- package/build/services/muninn-ipc.js +20 -2
- package/build/services/muninn-ipc.js.map +1 -1
- package/build/stop/uncompleted-commit.d.ts +63 -0
- package/build/stop/uncompleted-commit.js +188 -0
- package/build/stop/uncompleted-commit.js.map +1 -0
- package/build/stop/uncompleted-commit.test.d.ts +1 -0
- package/build/stop/uncompleted-commit.test.js +135 -0
- package/build/stop/uncompleted-commit.test.js.map +1 -0
- package/build/telemetry.d.ts +54 -0
- package/build/telemetry.js +84 -0
- package/build/telemetry.js.map +1 -0
- package/build/tools/activate-intent.d.ts +1 -14
- package/build/tools/activate-intent.js +17 -56
- package/build/tools/activate-intent.js.map +1 -1
- package/build/tools/arbiter-apply.d.ts +132 -0
- package/build/tools/arbiter-apply.js +59 -0
- package/build/tools/arbiter-apply.js.map +1 -0
- package/build/tools/arbiter-resolve.d.ts +132 -0
- package/build/tools/arbiter-resolve.js +58 -0
- package/build/tools/arbiter-resolve.js.map +1 -0
- package/build/tools/check-active-intent.d.ts +21 -12
- package/build/tools/check-active-intent.js +54 -27
- package/build/tools/check-active-intent.js.map +1 -1
- package/build/tools/complete-intent.d.ts +43 -10
- package/build/tools/complete-intent.js +51 -84
- package/build/tools/complete-intent.js.map +1 -1
- package/build/tools/create-intent.d.ts +1 -21
- package/build/tools/create-intent.js +18 -106
- package/build/tools/create-intent.js.map +1 -1
- package/build/tools/get-decision-detail.d.ts +109 -0
- package/build/tools/get-decision-detail.js +57 -0
- package/build/tools/get-decision-detail.js.map +1 -0
- package/build/tools/get-project-decisions.d.ts +0 -4
- package/build/tools/get-project-decisions.js +4 -6
- package/build/tools/get-project-decisions.js.map +1 -1
- package/build/tools/get-relevant-context.d.ts +0 -1
- package/build/tools/get-relevant-context.js +18 -3
- package/build/tools/get-relevant-context.js.map +1 -1
- package/build/tools/get-resolution-context.d.ts +154 -0
- package/build/tools/get-resolution-context.js +78 -0
- package/build/tools/get-resolution-context.js.map +1 -0
- package/build/tools/get-session-decisions.d.ts +0 -5
- package/build/tools/get-session-decisions.js +5 -5
- package/build/tools/get-session-decisions.js.map +1 -1
- package/build/tools/index.d.ts +216 -7
- package/build/tools/index.js +13 -3
- package/build/tools/index.js.map +1 -1
- package/build/tools/list-team-intents.d.ts +6 -6
- package/build/tools/list-team-intents.js +2 -2
- package/build/tools/list-team-intents.js.map +1 -1
- package/build/tools/pre-edit-acknowledge.d.ts +12 -0
- package/build/tools/pre-edit-acknowledge.js +21 -0
- package/build/tools/pre-edit-acknowledge.js.map +1 -1
- package/build/tools/pre-edit-decision-check.js +2 -0
- package/build/tools/pre-edit-decision-check.js.map +1 -1
- package/build/tools/record-decision.d.ts +76 -0
- package/build/tools/record-decision.js +10 -0
- package/build/tools/record-decision.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { request } from '../services/muninn-ipc.js';
|
|
3
3
|
import { resolveOrigin } from './resolve-origin.js';
|
|
4
4
|
import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
5
|
+
import { emitInjection, estimateTokens } from '../telemetry.js';
|
|
5
6
|
export const checkActiveIntentSchema = z.object({
|
|
6
7
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
7
8
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
@@ -13,33 +14,64 @@ export async function checkActiveIntent(input) {
|
|
|
13
14
|
repoOrigin: actualOrigin,
|
|
14
15
|
...extractForkFields(input),
|
|
15
16
|
});
|
|
16
|
-
// Muninn returns { hasActiveIntent, intentId, intent }
|
|
17
|
+
// Muninn returns { hasActiveIntent, intentId, intent, activeIntents }.
|
|
18
|
+
// The active set is present regardless of whether THIS session has a current.
|
|
19
|
+
const activeIntents = Array.isArray(res.activeIntents)
|
|
20
|
+
? res.activeIntents.map((it) => ({
|
|
21
|
+
id: it.id || it._id || '',
|
|
22
|
+
title: it.title || '',
|
|
23
|
+
status: it.status || 'active',
|
|
24
|
+
createdBy: it.createdBy || undefined,
|
|
25
|
+
author: it.authorInfo?.name || it.author || undefined,
|
|
26
|
+
}))
|
|
27
|
+
: [];
|
|
17
28
|
const intent = res.intent;
|
|
29
|
+
let response;
|
|
18
30
|
if (!intent) {
|
|
19
|
-
|
|
31
|
+
response = { hasActiveIntent: false, activeIntents };
|
|
20
32
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
else {
|
|
34
|
+
response = {
|
|
35
|
+
hasActiveIntent: true,
|
|
36
|
+
activeIntents,
|
|
37
|
+
intent: {
|
|
38
|
+
id: intent.id || res.intentId || '',
|
|
39
|
+
title: intent.title || '',
|
|
40
|
+
description: intent.description || '',
|
|
41
|
+
templateType: (intent.templateType || 'feature'),
|
|
42
|
+
constraints: intent.constraints || [],
|
|
43
|
+
status: intent.status || 'active',
|
|
44
|
+
branch: intent.branch || '',
|
|
45
|
+
forkedFrom: intent.forkedFrom,
|
|
46
|
+
blocks: [] // Blocks are tracked separately by intent-block service
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// Track-B injection telemetry (VALUE_METRICS Phase 2): size the serialized
|
|
51
|
+
// result (≈ chars/4); itemCount = active-set size + 1 if this session has a
|
|
52
|
+
// current intent. Fire-and-forget — never blocks the tool result.
|
|
53
|
+
void emitInjection({
|
|
54
|
+
type: 'check_active',
|
|
55
|
+
tokensEst: estimateTokens(JSON.stringify(response)),
|
|
56
|
+
itemCount: activeIntents.length + (intent ? 1 : 0),
|
|
57
|
+
repoOrigin: actualOrigin,
|
|
58
|
+
});
|
|
59
|
+
return response;
|
|
36
60
|
}
|
|
37
61
|
export const checkActiveIntentTool = {
|
|
38
62
|
name: 'check_active_intent',
|
|
39
63
|
description: `REQUIRED: Call this tool BEFORE writing any code.
|
|
40
64
|
|
|
41
|
-
Returns
|
|
42
|
-
|
|
65
|
+
Returns THIS session's current intent (\`intent\` / \`hasActiveIntent\`) if one is
|
|
66
|
+
set. If not, ask the user to confirm intent details and then call
|
|
67
|
+
create_and_activate_intent.
|
|
68
|
+
|
|
69
|
+
Multi-active model: the active intent is PER SESSION. Many intents can be active
|
|
70
|
+
on a repo at once — your current is independent of other sessions'/teammates'.
|
|
71
|
+
The response also includes \`activeIntents\`: the repo's full active set (every
|
|
72
|
+
session's current intent, with id/title/status/createdBy/author) for awareness
|
|
73
|
+
and orchestration. \`hasActiveIntent\` reflects only YOUR session; \`activeIntents\`
|
|
74
|
+
may be non-empty even when you have no current.
|
|
43
75
|
|
|
44
76
|
An active intent tracks what the user is working on, enabling:
|
|
45
77
|
- Better code context for AI-generated changes
|
|
@@ -47,14 +79,9 @@ An active intent tracks what the user is working on, enabling:
|
|
|
47
79
|
- Automatic assignment of code blocks to the intent
|
|
48
80
|
|
|
49
81
|
Status semantics:
|
|
50
|
-
- "active" — normal, in-progress.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
prompt the user to resume the work (activate_intent) or finalize it
|
|
54
|
-
(complete_intent) before starting new unrelated work. Inspect "pendingReason"
|
|
55
|
-
to tell the user WHY the intent went pending — "sweeper-auto-finalize"
|
|
56
|
-
(24h idle) or "sweeper-blocked-conflicts" (decisions contradicted standards
|
|
57
|
-
on the auto-finalize attempt).`,
|
|
82
|
+
- "active" — normal, in-progress. A stale intent simply stays "active"; the
|
|
83
|
+
sweeper preserves its work without any status transition.
|
|
84
|
+
- terminal states — committed / pushed / done / abandoned / superseded.`,
|
|
58
85
|
inputSchema: checkActiveIntentSchema,
|
|
59
86
|
handler: checkActiveIntent
|
|
60
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-active-intent.js","sourceRoot":"","sources":["../../src/tools/check-active-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;AACnD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"check-active-intent.js","sourceRoot":"","sources":["../../src/tools/check-active-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;AACnD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC3E,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAE/D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,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,GAAG,oBAAoB;CACxB,CAAC,CAAA;AAiDF,MAAM,CAAC,KAAK,UAAU,iB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AAW,IAAI,EAAE;gBACrC,YAAY,EAAE,CAAC,MAAM,CAAC,YAAY,IAAI,SAAS,CAA2C;gBAC1F,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,EAAE;gBACrC,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,QAAQ;gBACjC,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;gBAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,MAAM,EAAE,EAAE,CAAC,wDAAwD;aACpE;SACF,CAAA;IACH,CAAC;IAED,2EAA2E;IAC3E,4EAA4E;IAC5E,kEAAkE;IAClE,KAAK,aAAa,CAAC;QACjB,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QACnD,SAAS,EAAE,aAAa,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,UAAU,EAAE,YAAY;KACzB,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;wEAqByD;IACtE,WAAW,EAAE,uBAAuB;IACpC,OAAO,EAAE,iBAAiB;CAC3B,CAAA"}
|
|
@@ -20,6 +20,7 @@ export declare const completeIntentSchema: z.ZodObject<{
|
|
|
20
20
|
commitSha: z.ZodOptional<z.ZodString>;
|
|
21
21
|
status: z.ZodDefault<z.ZodEnum<["committed", "pushed", "done", "abandoned", "superseded"]>>;
|
|
22
22
|
supersededBy: z.ZodOptional<z.ZodString>;
|
|
23
|
+
humanApproved: z.ZodOptional<z.ZodBoolean>;
|
|
23
24
|
}, "strip", z.ZodTypeAny, {
|
|
24
25
|
status: "committed" | "pushed" | "done" | "abandoned" | "superseded";
|
|
25
26
|
repoPath: string;
|
|
@@ -33,6 +34,7 @@ export declare const completeIntentSchema: z.ZodObject<{
|
|
|
33
34
|
intentId?: string | undefined;
|
|
34
35
|
commitSha?: string | undefined;
|
|
35
36
|
supersededBy?: string | undefined;
|
|
37
|
+
humanApproved?: boolean | undefined;
|
|
36
38
|
}, {
|
|
37
39
|
repoPath: string;
|
|
38
40
|
status?: "committed" | "pushed" | "done" | "abandoned" | "superseded" | undefined;
|
|
@@ -46,14 +48,20 @@ export declare const completeIntentSchema: z.ZodObject<{
|
|
|
46
48
|
intentId?: string | undefined;
|
|
47
49
|
commitSha?: string | undefined;
|
|
48
50
|
supersededBy?: string | undefined;
|
|
51
|
+
humanApproved?: boolean | undefined;
|
|
49
52
|
}>;
|
|
50
53
|
export type CompleteIntentInput = z.infer<typeof completeIntentSchema>;
|
|
51
54
|
/**
|
|
52
55
|
* One contradiction between a distilled proposed decision and an existing
|
|
53
56
|
* standard decision in the repo. Surfaced when distillation produces decisions
|
|
54
|
-
* that conflict with previously-recorded ones
|
|
57
|
+
* that conflict with previously-recorded ones. Since COMPLETION_CONFLICT_DECOUPLE.md
|
|
58
|
+
* these no longer block completion — the commit (status + blocks) already landed;
|
|
59
|
+
* each conflicting decision is *parked* for an async disposition in the
|
|
60
|
+
* Orchestration panel (supersede / keep-both / reject).
|
|
55
61
|
*/
|
|
56
62
|
export interface ConflictMatch {
|
|
63
|
+
/** Stable distillation id of the proposed decision; the panel keys the disposition on it. */
|
|
64
|
+
proposedDecisionId?: string;
|
|
57
65
|
proposedDecisionSummary: string;
|
|
58
66
|
proposedDecisionRationale: string;
|
|
59
67
|
conflictsWith: {
|
|
@@ -65,6 +73,22 @@ export interface ConflictMatch {
|
|
|
65
73
|
sharedConcern?: string;
|
|
66
74
|
description?: string;
|
|
67
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* A live collaborator (HAI: teammate or AI agent) whose published in-progress
|
|
78
|
+
* diff overlaps the work just completed, grouped by HAI across all files
|
|
79
|
+
* (Layer C completion-time collision query). Advisory awareness only — it does
|
|
80
|
+
* not block completion; the overlap is exact (both sides are in the shared
|
|
81
|
+
* baseline / cSHA line-space).
|
|
82
|
+
*/
|
|
83
|
+
export interface CompletionCollision {
|
|
84
|
+
uid: string;
|
|
85
|
+
isAgent: boolean;
|
|
86
|
+
label: string;
|
|
87
|
+
files: {
|
|
88
|
+
fpath: string;
|
|
89
|
+
ranges: number[][];
|
|
90
|
+
}[];
|
|
91
|
+
}
|
|
68
92
|
export interface CompleteIntentResponse {
|
|
69
93
|
success: boolean;
|
|
70
94
|
intentId: string;
|
|
@@ -88,20 +112,19 @@ export interface CompleteIntentResponse {
|
|
|
88
112
|
*/
|
|
89
113
|
committedDecisionCount?: number;
|
|
90
114
|
/**
|
|
91
|
-
* Non-empty when
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
115
|
+
* Non-empty when distillation produced decisions that contradict existing
|
|
116
|
+
* standards. Since COMPLETION_CONFLICT_DECOUPLE.md the completion still
|
|
117
|
+
* SUCCEEDED (success=true, status flipped, blocks captured) — these decisions
|
|
118
|
+
* are *deferred*: parked for an async disposition in the Orchestration panel
|
|
119
|
+
* (supersede / keep-both / reject). There is nothing to retry.
|
|
96
120
|
*/
|
|
97
|
-
|
|
121
|
+
deferredConflicts?: ConflictMatch[];
|
|
98
122
|
/**
|
|
99
|
-
* Set when success=false to discriminate
|
|
100
|
-
* - "conflicts" → see `conflicts[]`
|
|
123
|
+
* Set when success=false to discriminate the failure mode:
|
|
101
124
|
* - "transient-failure" → distiller LLM call or /check-conflicts API errored;
|
|
102
125
|
* `failedStage` and `error` carry diagnostics, the user retries.
|
|
103
126
|
*/
|
|
104
|
-
reason?: '
|
|
127
|
+
reason?: 'transient-failure';
|
|
105
128
|
failedStage?: string;
|
|
106
129
|
error?: string;
|
|
107
130
|
/**
|
|
@@ -114,6 +137,13 @@ export interface CompleteIntentResponse {
|
|
|
114
137
|
deferredStages?: string[];
|
|
115
138
|
deferredDecisionCount?: number;
|
|
116
139
|
deferredError?: string;
|
|
140
|
+
/**
|
|
141
|
+
* Layer C completion-time collision query: live HAIs whose published diffs
|
|
142
|
+
* overlap the work just completed (grouped by HAI). Present only on a
|
|
143
|
+
* successful completion when at least one overlap exists. Advisory — surface
|
|
144
|
+
* it to the user as a coordination heads-up; it does not affect success.
|
|
145
|
+
*/
|
|
146
|
+
collisions?: CompletionCollision[];
|
|
117
147
|
}
|
|
118
148
|
export declare function completeIntent(input: CompleteIntentInput): Promise<CompleteIntentResponse>;
|
|
119
149
|
export declare const completeIntentTool: {
|
|
@@ -140,6 +170,7 @@ export declare const completeIntentTool: {
|
|
|
140
170
|
commitSha: z.ZodOptional<z.ZodString>;
|
|
141
171
|
status: z.ZodDefault<z.ZodEnum<["committed", "pushed", "done", "abandoned", "superseded"]>>;
|
|
142
172
|
supersededBy: z.ZodOptional<z.ZodString>;
|
|
173
|
+
humanApproved: z.ZodOptional<z.ZodBoolean>;
|
|
143
174
|
}, "strip", z.ZodTypeAny, {
|
|
144
175
|
status: "committed" | "pushed" | "done" | "abandoned" | "superseded";
|
|
145
176
|
repoPath: string;
|
|
@@ -153,6 +184,7 @@ export declare const completeIntentTool: {
|
|
|
153
184
|
intentId?: string | undefined;
|
|
154
185
|
commitSha?: string | undefined;
|
|
155
186
|
supersededBy?: string | undefined;
|
|
187
|
+
humanApproved?: boolean | undefined;
|
|
156
188
|
}, {
|
|
157
189
|
repoPath: string;
|
|
158
190
|
status?: "committed" | "pushed" | "done" | "abandoned" | "superseded" | undefined;
|
|
@@ -166,6 +198,7 @@ export declare const completeIntentTool: {
|
|
|
166
198
|
intentId?: string | undefined;
|
|
167
199
|
commitSha?: string | undefined;
|
|
168
200
|
supersededBy?: string | undefined;
|
|
201
|
+
humanApproved?: boolean | undefined;
|
|
169
202
|
}>;
|
|
170
203
|
handler: typeof completeIntent;
|
|
171
204
|
};
|
|
@@ -5,41 +5,23 @@ import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
|
5
5
|
export const completeIntentSchema = z.object({
|
|
6
6
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
7
7
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
8
|
-
intentId: z.string().optional().describe('
|
|
8
|
+
intentId: z.string().optional().describe('Target intent to complete/abandon. When omitted, completes THIS session\'s current intent. When provided, targets that specific intent directly — this is how you force-close an intent that is not your current one (e.g. another session\'s). Completing an intent created by ANOTHER team member additionally requires humanApproved=true (see below).'),
|
|
9
9
|
commitSha: z.string().optional().describe('The git commit SHA to associate with this intent (if already committed)'),
|
|
10
10
|
status: z.enum(['committed', 'pushed', 'done', 'abandoned', 'superseded']).default('committed')
|
|
11
11
|
.describe('The new status for the intent. Use "committed" after git commit, "done" when work is complete, "abandoned" to discard, "superseded" when another intent replaces this one.'),
|
|
12
12
|
supersededBy: z.string().optional().describe('Intent ID that supersedes this one. Required when status is "superseded".'),
|
|
13
|
+
humanApproved: z.boolean().optional().describe('Set to true ONLY when the human has explicitly confirmed closing an intent created by ANOTHER team member. Required for that cross-author case; ignored for your own intents. NEVER set this on your own initiative — always ask the user first and only set it after they approve.'),
|
|
13
14
|
...forkFieldsExtensions,
|
|
14
15
|
});
|
|
15
16
|
export async function completeIntent(input) {
|
|
16
17
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
intentId: input.intentId,
|
|
25
|
-
previousStatus: 'unknown',
|
|
26
|
-
newStatus: input.status,
|
|
27
|
-
commitSha: input.commitSha,
|
|
28
|
-
message: `No active intent found. Expected intent ${input.intentId.substring(0, 8)} but nothing is active.`
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
if (activeId !== input.intentId) {
|
|
32
|
-
const activeTitle = activeRes.intent?.title || 'unknown';
|
|
33
|
-
return {
|
|
34
|
-
success: false,
|
|
35
|
-
intentId: input.intentId,
|
|
36
|
-
previousStatus: 'unknown',
|
|
37
|
-
newStatus: input.status,
|
|
38
|
-
commitSha: input.commitSha,
|
|
39
|
-
message: `Intent mismatch: expected ${input.intentId.substring(0, 8)} but active intent is "${activeTitle}" (${activeId.substring(0, 8)}). Another session may have changed the active intent.`
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
18
|
+
// Multi-active model (IMPLEMENTATION_PLAN_MULTI_ACTIVE_INTENTS.md §7): `intentId`
|
|
19
|
+
// is a TARGET, forwarded to Muninn directly. When omitted, Muninn completes this
|
|
20
|
+
// session's current pointer; when provided, it targets that specific intent
|
|
21
|
+
// (force-close). There is no per-repo single "active" intent to verify against
|
|
22
|
+
// anymore, so the old get-active match-or-reject guard is gone. The same-user vs
|
|
23
|
+
// cross-user authorization (and the humanApproved requirement for closing a
|
|
24
|
+
// teammate's intent) is hard-enforced API-side.
|
|
43
25
|
// Muninn's v2 distillation pipeline (Sonnet distill + per-pair Haiku conflict
|
|
44
26
|
// judge + recall embeddings) can run well past the 30s default — measured
|
|
45
27
|
// 51s for superseded on an M3 (see kawa.muninn intent.rs). Override the
|
|
@@ -49,53 +31,27 @@ export async function completeIntent(input) {
|
|
|
49
31
|
const COMPLETE_TIMEOUT_MS = 180_000;
|
|
50
32
|
const res = await request('intent', 'complete', {
|
|
51
33
|
repoOrigin: actualOrigin,
|
|
34
|
+
intentId: input.intentId,
|
|
52
35
|
status: input.status,
|
|
53
36
|
commitSha: input.commitSha,
|
|
54
37
|
supersededBy: input.supersededBy,
|
|
38
|
+
humanApproved: input.humanApproved,
|
|
55
39
|
...extractForkFields(input),
|
|
56
40
|
}, COMPLETE_TIMEOUT_MS);
|
|
57
41
|
const intentId = res.intentId || '';
|
|
58
42
|
const intentTitle = res.intentTitle || 'Intent';
|
|
59
43
|
const previousStatus = res.previousStatus || 'active';
|
|
60
44
|
const success = res.success !== false;
|
|
61
|
-
const
|
|
45
|
+
const deferredConflicts = Array.isArray(res.deferredConflicts) ? res.deferredConflicts : [];
|
|
62
46
|
const committedDecisionCount = typeof res.committedDecisionCount === 'number' ? res.committedDecisionCount : undefined;
|
|
63
|
-
const reason = res.reason === '
|
|
47
|
+
const reason = res.reason === 'transient-failure' ? res.reason : undefined;
|
|
64
48
|
const apiSyncDeferred = res.apiSyncDeferred === true;
|
|
65
|
-
|
|
66
|
-
//
|
|
49
|
+
const completionCollisions = Array.isArray(res.collisions) ? res.collisions : [];
|
|
50
|
+
// Branch on the outcome shape — pick the message that tells the agent exactly
|
|
51
|
+
// what to surface to the user.
|
|
67
52
|
let newStatus;
|
|
68
53
|
let message;
|
|
69
|
-
if (!success && reason === '
|
|
70
|
-
// PRD §5.2 step 5b — distilled decisions contradicted standards. No write,
|
|
71
|
-
// no transition, bucket preserved. The agent's job is to surface each
|
|
72
|
-
// conflict to the user and ask how to resolve.
|
|
73
|
-
newStatus = res.status || 'active';
|
|
74
|
-
const lines = [
|
|
75
|
-
`Cannot complete: ${conflicts.length} conflict(s) between proposed decisions and existing standards.`,
|
|
76
|
-
'',
|
|
77
|
-
'For each conflict below, surface BOTH sides side-by-side to the user and ask how to resolve.',
|
|
78
|
-
'Common resolution paths:',
|
|
79
|
-
' (A) Record a superseding decision: record_decision(type="fork", supersedes=["<existing-decision-id>"], rationale=...). Then retry complete_intent.',
|
|
80
|
-
' (B) Abandon the intent: complete_intent(status="abandoned"). Decisions are soft-deleted but recoverable via activate_intent.',
|
|
81
|
-
' (C) Keep the intent active and continue working.',
|
|
82
|
-
'',
|
|
83
|
-
'DO NOT silently retry — every retry runs the distiller again and produces the same conflicts.',
|
|
84
|
-
'',
|
|
85
|
-
];
|
|
86
|
-
conflicts.forEach((c, i) => {
|
|
87
|
-
lines.push(`[${i + 1}] Proposed: ${c.proposedDecisionSummary}`);
|
|
88
|
-
const cw = c.conflictsWith || {};
|
|
89
|
-
const author = cw.author ? ` by ${cw.author}` : '';
|
|
90
|
-
const intentPart = cw.intentTitle ? ` (intent: "${cw.intentTitle}")` : '';
|
|
91
|
-
lines.push(` Conflicts with: ${cw.summary || cw.decisionId || '(unknown)'}${intentPart}${author}`);
|
|
92
|
-
if (c.description)
|
|
93
|
-
lines.push(` ${c.description}`);
|
|
94
|
-
lines.push('');
|
|
95
|
-
});
|
|
96
|
-
message = lines.join('\n');
|
|
97
|
-
}
|
|
98
|
-
else if (!success && reason === 'transient-failure') {
|
|
54
|
+
if (!success && reason === 'transient-failure') {
|
|
99
55
|
// Distiller LLM error or /check-conflicts API error. Bucket re-populated,
|
|
100
56
|
// intent stays active. User decides whether to wait + retry or abandon.
|
|
101
57
|
newStatus = res.status || 'active';
|
|
@@ -130,7 +86,21 @@ export async function completeIntent(input) {
|
|
|
130
86
|
const deferredPart = apiSyncDeferred
|
|
131
87
|
? ` — API sync deferred (${(res.deferredStages || []).join(', ')}); will retry on the next sync tick`
|
|
132
88
|
: '';
|
|
133
|
-
|
|
89
|
+
// Layer C: a live HAI's in-progress diff overlaps the work just completed.
|
|
90
|
+
// Advisory coordination heads-up appended to the success message.
|
|
91
|
+
const collisionPart = completionCollisions.length > 0
|
|
92
|
+
? ` — heads-up: ${completionCollisions.length} live collaborator(s) overlap this work: ` +
|
|
93
|
+
completionCollisions
|
|
94
|
+
.map(c => `${c.label}${c.isAgent ? ' (agent)' : ''} on ${c.files.map(f => f.fpath).join(', ')}`)
|
|
95
|
+
.join('; ')
|
|
96
|
+
: '';
|
|
97
|
+
// COMPLETION_CONFLICT_DECOUPLE.md: distilled decisions that conflicted with
|
|
98
|
+
// standards did NOT block the completion — they're parked for a disposition
|
|
99
|
+
// in the Orchestration panel. Surface the count; there is nothing to retry.
|
|
100
|
+
const deferredConflictPart = deferredConflicts.length > 0
|
|
101
|
+
? ` — ${deferredConflicts.length} distilled decision(s) need a disposition in the Orchestration panel (supersede / keep-both / reject)`
|
|
102
|
+
: '';
|
|
103
|
+
message = statusMsg + shaPart + distilledPart + deferredPart + collisionPart + deferredConflictPart;
|
|
134
104
|
}
|
|
135
105
|
return {
|
|
136
106
|
success,
|
|
@@ -140,7 +110,7 @@ export async function completeIntent(input) {
|
|
|
140
110
|
commitSha: input.commitSha,
|
|
141
111
|
message,
|
|
142
112
|
committedDecisionCount,
|
|
143
|
-
|
|
113
|
+
deferredConflicts: deferredConflicts.length > 0 ? deferredConflicts : undefined,
|
|
144
114
|
reason,
|
|
145
115
|
failedStage: res.failedStage,
|
|
146
116
|
error: res.error,
|
|
@@ -148,6 +118,7 @@ export async function completeIntent(input) {
|
|
|
148
118
|
deferredStages: Array.isArray(res.deferredStages) ? res.deferredStages : undefined,
|
|
149
119
|
deferredDecisionCount: typeof res.deferredDecisionCount === 'number' ? res.deferredDecisionCount : undefined,
|
|
150
120
|
deferredError: res.deferredError,
|
|
121
|
+
collisions: completionCollisions.length > 0 ? completionCollisions : undefined,
|
|
151
122
|
};
|
|
152
123
|
}
|
|
153
124
|
export const completeIntentTool = {
|
|
@@ -165,7 +136,7 @@ Status values:
|
|
|
165
136
|
- "done": Work is fully complete
|
|
166
137
|
- "abandoned": Work was discarded without committing
|
|
167
138
|
|
|
168
|
-
REQUIRED: Inspect the response after calling this tool.
|
|
139
|
+
REQUIRED: Inspect the response after calling this tool. Three outcomes:
|
|
169
140
|
|
|
170
141
|
1. response.success === true:
|
|
171
142
|
The task is complete. Briefly acknowledge the commit and — if
|
|
@@ -175,33 +146,29 @@ REQUIRED: Inspect the response after calling this tool. Four outcomes:
|
|
|
175
146
|
get_intent_decisions / get_relevant_context if the user wants details.
|
|
176
147
|
If response.apiSyncDeferred === true, also mention that the API sync was
|
|
177
148
|
deferred; the queued writes will replay on the next sync tick.
|
|
149
|
+
If response.collisions is non-empty, a live collaborator's (HAI's)
|
|
150
|
+
in-progress edits overlap the work you just completed — surface it as a
|
|
151
|
+
coordination heads-up (who, and which files), naming response.collisions[].label
|
|
152
|
+
and the files. It's advisory, not a failure; the completion still succeeded.
|
|
153
|
+
If response.deferredConflicts is non-empty, the distillation produced N
|
|
154
|
+
decisions that conflict with existing standards — the completion STILL
|
|
155
|
+
SUCCEEDED (the commit landed: status flipped, code blocks captured). Those
|
|
156
|
+
decisions are deferred: parked for a disposition in the Orchestration panel,
|
|
157
|
+
where the user picks per decision: supersede the standard, keep both (records
|
|
158
|
+
a "contradicts" edge for a deliberate divergence / false positive), or reject
|
|
159
|
+
the distilled decision. Tell the user "N decision(s) need a disposition in
|
|
160
|
+
the panel." There is NOTHING to retry — do NOT re-run complete_intent.
|
|
178
161
|
|
|
179
|
-
2. response.success === false AND response.
|
|
180
|
-
The distillation produced decisions that contradict existing standards in
|
|
181
|
-
this repo. Status stays "active" and NO decisions were written.
|
|
182
|
-
Surface EACH conflict to the user with the proposed decision and the
|
|
183
|
-
conflicting standard decision side-by-side. Then ask the user how to
|
|
184
|
-
resolve. Common options to suggest:
|
|
185
|
-
(A) Record a superseding decision via record_decision(type="fork",
|
|
186
|
-
supersedes=["<existing-decision-id>"], rationale=...). Then retry
|
|
187
|
-
complete_intent — the distiller may now find the new superseding
|
|
188
|
-
decision in recall and the conflict resolves.
|
|
189
|
-
(B) Abandon the intent: complete_intent(status="abandoned"). Decisions
|
|
190
|
-
are soft-deleted but recoverable via activate_intent if the user
|
|
191
|
-
changes their mind.
|
|
192
|
-
(C) Keep the intent active and continue working.
|
|
193
|
-
DO NOT silently retry — every retry runs the distiller (and the per-pair
|
|
194
|
-
judge) again. Wait for the user's decision.
|
|
195
|
-
|
|
196
|
-
3. response.success === false AND response.reason === "transient-failure":
|
|
162
|
+
2. response.success === false AND response.reason === "transient-failure":
|
|
197
163
|
The distiller LLM call or the conflict-check API call errored. The
|
|
198
164
|
ephemerals are preserved (the bucket is intact), and the intent stays
|
|
199
165
|
"active". Tell the user the failure stage (response.failedStage) and the
|
|
200
166
|
underlying error, then suggest retrying once the issue clears, or
|
|
201
167
|
abandoning if the failure persists.
|
|
202
168
|
|
|
203
|
-
|
|
204
|
-
|
|
169
|
+
3. In a non-interactive (autonomous) session: if response.deferredConflicts is
|
|
170
|
+
non-empty, log it at INFO and continue — the commit already landed and the
|
|
171
|
+
decisions await disposition in the panel. There is no blocking state.`,
|
|
205
172
|
inputSchema: completeIntentSchema,
|
|
206
173
|
handler: completeIntent
|
|
207
174
|
};
|
|
@@ -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;AACnD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE3E,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,
|
|
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;AACnD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ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BAAiB,CAAC,CAAC,CAAC,SAAS;QAC/E,MAAM;QACN,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QACnD,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yEA6C0D;IACvE,WAAW,EAAE,oBAAoB;IACjC,OAAO,EAAE,cAAc;CACxB,CAAA"}
|
|
@@ -65,32 +65,12 @@ interface ConflictInfo {
|
|
|
65
65
|
oppositionDetected: boolean;
|
|
66
66
|
oppositionDetail: string | null;
|
|
67
67
|
}
|
|
68
|
-
export interface ActiveIntentLockConflict {
|
|
69
|
-
existingIntentId: string;
|
|
70
|
-
title?: string;
|
|
71
|
-
createdBy?: string;
|
|
72
|
-
author?: string;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Soft-lock surfaced when a `pending` intent blocks creating a new one on
|
|
76
|
-
* the same repo. PRD_AGENT_COORDINATION_LAYER_02 §6.3 — the agent must prompt
|
|
77
|
-
* the user to abandon-or-finalize the pending one before proceeding.
|
|
78
|
-
*/
|
|
79
|
-
export interface PendingIntentBlocking {
|
|
80
|
-
intentId: string;
|
|
81
|
-
title?: string;
|
|
82
|
-
pendingReason?: string;
|
|
83
|
-
lastActivityAt?: string;
|
|
84
|
-
distilledDecisionCount?: number;
|
|
85
|
-
}
|
|
86
68
|
export interface CreateIntentResponse {
|
|
87
69
|
success: boolean;
|
|
88
70
|
intentId: string;
|
|
89
|
-
action: 'created' | 'reactivated' | 'conflict'
|
|
71
|
+
action: 'created' | 'reactivated' | 'conflict';
|
|
90
72
|
message: string;
|
|
91
73
|
conflicts?: ConflictInfo[];
|
|
92
|
-
lockConflict?: ActiveIntentLockConflict;
|
|
93
|
-
pendingIntent?: PendingIntentBlocking;
|
|
94
74
|
}
|
|
95
75
|
export declare function createAndActivateIntent(input: CreateIntentInput): Promise<CreateIntentResponse>;
|
|
96
76
|
export declare const createAndActivateIntentTool: {
|