@kawacode/mcp 5.2.0 → 6.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 +1 -1
- package/README.md +54 -198
- package/build/index.js +10 -1
- package/build/index.js.map +1 -1
- package/build/kawacode-on-pre-edit.d.ts +27 -0
- package/build/kawacode-on-pre-edit.js +205 -0
- package/build/kawacode-on-pre-edit.js.map +1 -0
- package/build/kawacode-on-stop.d.ts +29 -0
- package/build/kawacode-on-stop.js +84 -0
- package/build/kawacode-on-stop.js.map +1 -0
- package/build/prompts/intent-first-workflow.js +2 -2
- package/build/services/muninn-ipc.d.ts +10 -5
- package/build/services/muninn-ipc.js +13 -8
- package/build/services/muninn-ipc.js.map +1 -1
- package/build/tools/_fork-fields.d.ts +84 -0
- package/build/tools/_fork-fields.js +65 -0
- package/build/tools/_fork-fields.js.map +1 -0
- package/build/tools/activate-intent.d.ts +66 -0
- package/build/tools/activate-intent.js +59 -3
- package/build/tools/activate-intent.js.map +1 -1
- package/build/tools/check-active-intent.d.ts +64 -0
- package/build/tools/check-active-intent.js +16 -2
- package/build/tools/check-active-intent.js.map +1 -1
- package/build/tools/complete-intent.d.ts +115 -4
- package/build/tools/complete-intent.js +130 -11
- package/build/tools/complete-intent.js.map +1 -1
- package/build/tools/create-intent.d.ts +73 -1
- package/build/tools/create-intent.js +105 -7
- package/build/tools/create-intent.js.map +1 -1
- package/build/tools/detect-intent-conflicts.d.ts +52 -0
- package/build/tools/detect-intent-conflicts.js +14 -10
- package/build/tools/detect-intent-conflicts.js.map +1 -1
- package/build/tools/edit-session-decision.d.ts +64 -12
- package/build/tools/edit-session-decision.js +4 -1
- package/build/tools/edit-session-decision.js.map +1 -1
- package/build/tools/evolve-decisions.d.ts +52 -0
- package/build/tools/evolve-decisions.js +14 -15
- package/build/tools/evolve-decisions.js.map +1 -1
- package/build/tools/get-intent-changes.d.ts +52 -0
- package/build/tools/get-intent-changes.js +4 -1
- package/build/tools/get-intent-changes.js.map +1 -1
- package/build/tools/get-intents-for-file.d.ts +52 -0
- package/build/tools/get-intents-for-file.js +4 -1
- package/build/tools/get-intents-for-file.js.map +1 -1
- package/build/tools/get-intents-for-lines.d.ts +52 -0
- package/build/tools/get-intents-for-lines.js +4 -1
- package/build/tools/get-intents-for-lines.js.map +1 -1
- package/build/tools/get-project-decisions.d.ts +52 -0
- package/build/tools/get-project-decisions.js +4 -1
- package/build/tools/get-project-decisions.js.map +1 -1
- package/build/tools/get-relevant-context.d.ts +52 -0
- package/build/tools/get-relevant-context.js +18 -24
- package/build/tools/get-relevant-context.js.map +1 -1
- package/build/tools/get-session-decisions.d.ts +52 -0
- package/build/tools/get-session-decisions.js +4 -1
- package/build/tools/get-session-decisions.js.map +1 -1
- package/build/tools/index.d.ts +620 -18
- package/build/tools/index.js +12 -3
- package/build/tools/index.js.map +1 -1
- package/build/tools/infer-history.d.ts +6 -0
- package/build/tools/infer-history.js +33 -16
- package/build/tools/infer-history.js.map +1 -1
- package/build/tools/list-team-intents.d.ts +58 -6
- package/build/tools/list-team-intents.js +5 -2
- package/build/tools/list-team-intents.js.map +1 -1
- package/build/tools/log-work.d.ts +52 -0
- package/build/tools/log-work.js +4 -1
- package/build/tools/log-work.js.map +1 -1
- package/build/tools/pre-edit-acknowledge.d.ts +92 -0
- package/build/tools/pre-edit-acknowledge.js +48 -0
- package/build/tools/pre-edit-acknowledge.js.map +1 -0
- package/build/tools/pre-edit-decision-check.d.ts +141 -0
- package/build/tools/pre-edit-decision-check.js +77 -0
- package/build/tools/pre-edit-decision-check.js.map +1 -0
- package/build/tools/record-decision.d.ts +88 -12
- package/build/tools/record-decision.js +15 -1
- package/build/tools/record-decision.js.map +1 -1
- package/build/tools/update-intent.d.ts +60 -8
- package/build/tools/update-intent.js +6 -1
- package/build/tools/update-intent.js.map +1 -1
- package/package.json +6 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { request } from '../services/muninn-ipc.js';
|
|
3
3
|
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
+
import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
4
5
|
export const createAndActivateIntentSchema = z.object({
|
|
5
6
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
6
7
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
@@ -9,13 +10,12 @@ export const createAndActivateIntentSchema = z.object({
|
|
|
9
10
|
templateType: z.enum(['feature', 'refactor', 'exploration']).default('feature').describe('Type of work'),
|
|
10
11
|
constraints: z.array(z.string()).optional().describe('Requirements or constraints for this work'),
|
|
11
12
|
force: z.boolean().optional().default(false).describe('Bypass conflict detection. Set to true after the user has reviewed detected conflicts and chosen to proceed anyway.'),
|
|
13
|
+
...forkFieldsExtensions,
|
|
12
14
|
});
|
|
13
15
|
export async function createAndActivateIntent(input) {
|
|
14
16
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
15
|
-
// Step 1: Create
|
|
16
|
-
//
|
|
17
|
-
// dedups by embedding similarity (≥ 0.85) and runs automatic conflict
|
|
18
|
-
// detection against all other intents for the repo.
|
|
17
|
+
// Step 1: Create the intent. If a sufficiently similar one already exists, the
|
|
18
|
+
// server may reactivate it instead of creating a duplicate.
|
|
19
19
|
const createRes = await request('intent', 'create', {
|
|
20
20
|
repoOrigin: actualOrigin,
|
|
21
21
|
title: input.title,
|
|
@@ -24,7 +24,14 @@ export async function createAndActivateIntent(input) {
|
|
|
24
24
|
constraints: input.constraints || [],
|
|
25
25
|
scope: { type: 'repo', paths: [] },
|
|
26
26
|
force: input.force || false,
|
|
27
|
+
...extractForkFields(input),
|
|
27
28
|
});
|
|
29
|
+
// Pending-intent soft lock — surfaced before any API write per PRD §6.3.
|
|
30
|
+
// The agent's job is to ask the user to dispose of the pending one before
|
|
31
|
+
// proceeding. force=true bypasses this for autonomous runs.
|
|
32
|
+
if (createRes.pendingIntentBlocking) {
|
|
33
|
+
return buildPendingBlockedResponse(createRes.pendingIntentBlocking);
|
|
34
|
+
}
|
|
28
35
|
// Handle conflict detection — API returned 409 with conflict data.
|
|
29
36
|
// Return the conflicts to the caller (Claude Code) so it can present
|
|
30
37
|
// them to the user and optionally retry with force=true.
|
|
@@ -67,11 +74,38 @@ export async function createAndActivateIntent(input) {
|
|
|
67
74
|
throw new Error('Intent creation succeeded but no intent ID was returned');
|
|
68
75
|
}
|
|
69
76
|
const action = createRes.action === 'reactivated' ? 'reactivated' : 'created';
|
|
70
|
-
// Step 2: Set it as active
|
|
71
|
-
|
|
77
|
+
// Step 2: Set it as active.
|
|
78
|
+
// The per-repo lock may reject this step even though the intent itself was created —
|
|
79
|
+
// forward force to Muninn and surface the lock conflict separately from the
|
|
80
|
+
// content-similarity conflict that createRes handles above.
|
|
81
|
+
const setRes = await request('intent', 'set-active', {
|
|
72
82
|
repoOrigin: actualOrigin,
|
|
73
83
|
intentId,
|
|
84
|
+
force: input.force || false,
|
|
85
|
+
...extractForkFields(input),
|
|
74
86
|
});
|
|
87
|
+
// The set-active step has its own pending-intent soft-lock check (the lock
|
|
88
|
+
// holder may have transitioned to pending between steps 1 and 2, or the
|
|
89
|
+
// pre-check on create may have been skipped because the active intent was
|
|
90
|
+
// not the lock holder). Surface the same shaped response.
|
|
91
|
+
if (setRes.pendingIntentBlocking) {
|
|
92
|
+
return buildPendingBlockedResponse(setRes.pendingIntentBlocking, intentId);
|
|
93
|
+
}
|
|
94
|
+
if (setRes.conflict === true && setRes.conflictType === 'active_intent_lock') {
|
|
95
|
+
const lockConflict = await buildLockConflictDetails(actualOrigin, setRes.existingIntentId);
|
|
96
|
+
const idShort = setRes.existingIntentId.substring(0, 8);
|
|
97
|
+
const who = lockConflict.author ? ` by ${lockConflict.author}` : '';
|
|
98
|
+
const titlePart = lockConflict.title ? ` "${lockConflict.title}"` : '';
|
|
99
|
+
return {
|
|
100
|
+
success: false,
|
|
101
|
+
intentId,
|
|
102
|
+
action: 'lock_conflict',
|
|
103
|
+
lockConflict,
|
|
104
|
+
message: `Intent "${input.title}" was ${action} (id: ${intentId.substring(0, 8)}), but could not be activated: ` +
|
|
105
|
+
`repo already owns intent ${idShort}${titlePart}${who}. ` +
|
|
106
|
+
`Retry with force=true to take over, complete_intent on ${idShort} first, or abandon this new intent.`,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
75
109
|
const message = action === 'reactivated'
|
|
76
110
|
? `Reactivated existing similar intent: "${input.title}" — resuming previous work instead of creating a duplicate.`
|
|
77
111
|
: `Created and activated intent: "${input.title}"`;
|
|
@@ -82,6 +116,49 @@ export async function createAndActivateIntent(input) {
|
|
|
82
116
|
message,
|
|
83
117
|
};
|
|
84
118
|
}
|
|
119
|
+
function buildPendingBlockedResponse(blocker, intentId = '') {
|
|
120
|
+
const pendingIntent = {
|
|
121
|
+
intentId: blocker.intentId || '',
|
|
122
|
+
title: blocker.title || undefined,
|
|
123
|
+
pendingReason: blocker.pendingReason || undefined,
|
|
124
|
+
lastActivityAt: blocker.lastActivityAt || undefined,
|
|
125
|
+
distilledDecisionCount: typeof blocker.distilledDecisionCount === 'number'
|
|
126
|
+
? blocker.distilledDecisionCount
|
|
127
|
+
: undefined,
|
|
128
|
+
};
|
|
129
|
+
const idShort = pendingIntent.intentId ? pendingIntent.intentId.substring(0, 8) : 'pending';
|
|
130
|
+
const titlePart = pendingIntent.title ? ` "${pendingIntent.title}"` : '';
|
|
131
|
+
const reasonPart = pendingIntent.pendingReason ? ` (reason: ${pendingIntent.pendingReason})` : '';
|
|
132
|
+
return {
|
|
133
|
+
success: false,
|
|
134
|
+
intentId,
|
|
135
|
+
action: 'pending_blocked',
|
|
136
|
+
pendingIntent,
|
|
137
|
+
message: `Pending intent ${idShort}${titlePart}${reasonPart} exists on this repo. ` +
|
|
138
|
+
`Ask the user how to proceed: ` +
|
|
139
|
+
`(A) abandon it via complete_intent(intentId="${pendingIntent.intentId}", status="abandoned"), ` +
|
|
140
|
+
`(C) complete and finalize it via complete_intent(intentId="${pendingIntent.intentId}", status="committed"), ` +
|
|
141
|
+
`then retry. To proceed without prompting, retry with force=true.`,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
async function buildLockConflictDetails(repoOrigin, existingIntentId) {
|
|
145
|
+
try {
|
|
146
|
+
const res = await request('intent', 'get-active', { repoOrigin });
|
|
147
|
+
const intent = res.intent;
|
|
148
|
+
if (intent && intent.id === existingIntentId) {
|
|
149
|
+
return {
|
|
150
|
+
existingIntentId,
|
|
151
|
+
title: intent.title,
|
|
152
|
+
createdBy: intent.createdBy,
|
|
153
|
+
author: intent.authorInfo?.name || intent.author,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
// Fall through to ID-only response
|
|
159
|
+
}
|
|
160
|
+
return { existingIntentId };
|
|
161
|
+
}
|
|
85
162
|
export const createAndActivateIntentTool = {
|
|
86
163
|
name: 'create_and_activate_intent',
|
|
87
164
|
description: `Create a new intent from the user's request and mark it as active.
|
|
@@ -95,7 +172,28 @@ This ensures all AI-generated code gets properly tracked and attributed.
|
|
|
95
172
|
|
|
96
173
|
If the tool returns conflicts (action="conflict"), present the conflict
|
|
97
174
|
details to the user and ask whether to proceed. If yes, retry with
|
|
98
|
-
force=true to bypass conflict detection
|
|
175
|
+
force=true to bypass conflict detection.
|
|
176
|
+
|
|
177
|
+
Three distinct block types exist:
|
|
178
|
+
|
|
179
|
+
- action="conflict": content-similarity conflict from intent creation (another
|
|
180
|
+
team member's intent overlaps semantically or in files). Bypassed by
|
|
181
|
+
force=true after the user reviews and chooses to proceed.
|
|
182
|
+
|
|
183
|
+
- action="lock_conflict": per-repo active-intent lock — another session on this
|
|
184
|
+
repo already owns the active intent slot. The new intent was still created
|
|
185
|
+
and can be activated later; or call complete_intent on the existing one first.
|
|
186
|
+
Bypassed by force=true (takes over the active slot).
|
|
187
|
+
|
|
188
|
+
- action="pending_blocked": a "pending" intent exists on this repo (auto-finalized
|
|
189
|
+
by the orphan-recovery sweeper, or blocked by conflicts at completion). Surface
|
|
190
|
+
the pendingIntent details to the user and ask how to dispose of it before
|
|
191
|
+
starting new work:
|
|
192
|
+
(A) Abandon it: call complete_intent(intentId=..., status="abandoned").
|
|
193
|
+
(C) Complete and finalize: call complete_intent(intentId=..., status="committed").
|
|
194
|
+
After the user decides and the pending intent is disposed, retry create_and_activate_intent.
|
|
195
|
+
In autonomous (non-interactive) sessions, retry with force=true to proceed
|
|
196
|
+
without prompting — the pending intent stays pending.`,
|
|
99
197
|
inputSchema: createAndActivateIntentSchema,
|
|
100
198
|
handler: createAndActivateIntent
|
|
101
199
|
};
|
|
@@ -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;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,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,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,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,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UAAkB,EAAE,gBAAwB;IAClF,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,CAAC,CAAA;QACjE,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;QACzB,IAAI,MAAM,IAAI,MAAM,CAAC,EAAE,KAAK,gBAAgB,EAAE,CAAC;YAC7C,OAAO;gBACL,gBAAgB;gBAChB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,IAAI,MAAM,CAAC,MAAM;aACjD,CAAA;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,mCAAmC;IACrC,CAAC;IACD,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAC7B,CAAC;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wDAgCyC;IACtD,WAAW,EAAE,6BAA6B;IAC1C,OAAO,EAAE,uBAAuB;CACjC,CAAA"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const detectIntentConflictsSchema: z.ZodObject<{
|
|
3
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
4
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
5
|
+
user: z.ZodString;
|
|
6
|
+
forkOrigin: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
platform: "github" | "gitlab";
|
|
9
|
+
user: string;
|
|
10
|
+
forkOrigin: string;
|
|
11
|
+
}, {
|
|
12
|
+
platform: "github" | "gitlab";
|
|
13
|
+
user: string;
|
|
14
|
+
forkOrigin: string;
|
|
15
|
+
}>>;
|
|
16
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
3
17
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
4
18
|
repoPath: z.ZodString;
|
|
5
19
|
intentId: z.ZodString;
|
|
@@ -8,11 +22,23 @@ export declare const detectIntentConflictsSchema: z.ZodObject<{
|
|
|
8
22
|
repoPath: string;
|
|
9
23
|
intentId: string;
|
|
10
24
|
repoOrigin?: string | undefined;
|
|
25
|
+
forkAuthor?: {
|
|
26
|
+
platform: "github" | "gitlab";
|
|
27
|
+
user: string;
|
|
28
|
+
forkOrigin: string;
|
|
29
|
+
} | undefined;
|
|
30
|
+
workspaceId?: string | undefined;
|
|
11
31
|
minScore?: number | undefined;
|
|
12
32
|
}, {
|
|
13
33
|
repoPath: string;
|
|
14
34
|
intentId: string;
|
|
15
35
|
repoOrigin?: string | undefined;
|
|
36
|
+
forkAuthor?: {
|
|
37
|
+
platform: "github" | "gitlab";
|
|
38
|
+
user: string;
|
|
39
|
+
forkOrigin: string;
|
|
40
|
+
} | undefined;
|
|
41
|
+
workspaceId?: string | undefined;
|
|
16
42
|
minScore?: number | undefined;
|
|
17
43
|
}>;
|
|
18
44
|
export type DetectIntentConflictsInput = z.infer<typeof detectIntentConflictsSchema>;
|
|
@@ -42,6 +68,20 @@ export declare const detectIntentConflictsTool: {
|
|
|
42
68
|
name: string;
|
|
43
69
|
description: string;
|
|
44
70
|
inputSchema: z.ZodObject<{
|
|
71
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
73
|
+
user: z.ZodString;
|
|
74
|
+
forkOrigin: z.ZodString;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
platform: "github" | "gitlab";
|
|
77
|
+
user: string;
|
|
78
|
+
forkOrigin: string;
|
|
79
|
+
}, {
|
|
80
|
+
platform: "github" | "gitlab";
|
|
81
|
+
user: string;
|
|
82
|
+
forkOrigin: string;
|
|
83
|
+
}>>;
|
|
84
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
45
85
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
46
86
|
repoPath: z.ZodString;
|
|
47
87
|
intentId: z.ZodString;
|
|
@@ -50,11 +90,23 @@ export declare const detectIntentConflictsTool: {
|
|
|
50
90
|
repoPath: string;
|
|
51
91
|
intentId: string;
|
|
52
92
|
repoOrigin?: string | undefined;
|
|
93
|
+
forkAuthor?: {
|
|
94
|
+
platform: "github" | "gitlab";
|
|
95
|
+
user: string;
|
|
96
|
+
forkOrigin: string;
|
|
97
|
+
} | undefined;
|
|
98
|
+
workspaceId?: string | undefined;
|
|
53
99
|
minScore?: number | undefined;
|
|
54
100
|
}, {
|
|
55
101
|
repoPath: string;
|
|
56
102
|
intentId: string;
|
|
57
103
|
repoOrigin?: string | undefined;
|
|
104
|
+
forkAuthor?: {
|
|
105
|
+
platform: "github" | "gitlab";
|
|
106
|
+
user: string;
|
|
107
|
+
forkOrigin: string;
|
|
108
|
+
} | undefined;
|
|
109
|
+
workspaceId?: string | undefined;
|
|
58
110
|
minScore?: number | undefined;
|
|
59
111
|
}>;
|
|
60
112
|
handler: typeof detectIntentConflicts;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { request } from '../services/muninn-ipc.js';
|
|
3
3
|
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
+
import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
4
5
|
export const detectIntentConflictsSchema = z.object({
|
|
5
6
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
6
7
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
7
8
|
intentId: z.string().describe('The active intent ID'),
|
|
8
9
|
minScore: z.number().optional().describe('Minimum similarity score threshold (default: 0.5)'),
|
|
10
|
+
...forkFieldsExtensions,
|
|
9
11
|
});
|
|
10
12
|
export async function detectIntentConflicts(input) {
|
|
11
13
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -13,6 +15,7 @@ export async function detectIntentConflicts(input) {
|
|
|
13
15
|
repoOrigin: actualOrigin,
|
|
14
16
|
intentId: input.intentId,
|
|
15
17
|
minScore: input.minScore,
|
|
18
|
+
...extractForkFields(input),
|
|
16
19
|
});
|
|
17
20
|
if (res.error) {
|
|
18
21
|
return {
|
|
@@ -45,21 +48,22 @@ export async function detectIntentConflicts(input) {
|
|
|
45
48
|
}
|
|
46
49
|
export const detectIntentConflictsTool = {
|
|
47
50
|
name: 'detect_intent_conflicts',
|
|
48
|
-
description: `
|
|
51
|
+
description: `Find intents from other team members that potentially conflict with the active intent.
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
When to use:
|
|
54
|
+
- Before committing, to surface overlapping team work so the user can coordinate before merging.
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
Inputs of note:
|
|
57
|
+
- \`intentId\`: the active intent to check against.
|
|
58
|
+
- \`minScore\` (optional): minimum match score to include in results.
|
|
54
59
|
|
|
55
60
|
Returns scored conflict candidates with:
|
|
56
|
-
- score
|
|
57
|
-
- overlappingFiles
|
|
58
|
-
- decisions
|
|
59
|
-
- author
|
|
61
|
+
- \`score\`: how strongly the candidate matches (higher = more likely conflict).
|
|
62
|
+
- \`overlappingFiles\`: files affected by both intents.
|
|
63
|
+
- \`decisions\`: decisions attached to the conflicting intent.
|
|
64
|
+
- \`author\`: who is working on the conflicting intent.
|
|
60
65
|
|
|
61
|
-
The
|
|
62
|
-
to determine if coordination is needed.`,
|
|
66
|
+
The list is informational — review candidates and their decisions to decide whether coordination is needed.`,
|
|
63
67
|
inputSchema: detectIntentConflictsSchema,
|
|
64
68
|
handler: detectIntentConflicts
|
|
65
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-intent-conflicts.js","sourceRoot":"","sources":["../../src/tools/detect-intent-conflicts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE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IAC/B,WAAW,EAAE;;;;;;;;;;;;;;;4GAe6F;IAC1G,WAAW,EAAE,2BAA2B;IACxC,OAAO,EAAE,qBAAqB;CAC/B,CAAA"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
3
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
4
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
5
|
+
user: z.ZodString;
|
|
6
|
+
forkOrigin: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
platform: "github" | "gitlab";
|
|
9
|
+
user: string;
|
|
10
|
+
forkOrigin: string;
|
|
11
|
+
}, {
|
|
12
|
+
platform: "github" | "gitlab";
|
|
13
|
+
user: string;
|
|
14
|
+
forkOrigin: string;
|
|
15
|
+
}>>;
|
|
16
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
3
17
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
4
18
|
repoPath: z.ZodString;
|
|
5
19
|
intentId: z.ZodString;
|
|
@@ -18,13 +32,13 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
18
32
|
constraint: z.ZodString;
|
|
19
33
|
reason: z.ZodString;
|
|
20
34
|
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
reason: string;
|
|
21
36
|
alternative: string;
|
|
22
37
|
constraint: string;
|
|
23
|
-
reason: string;
|
|
24
38
|
}, {
|
|
39
|
+
reason: string;
|
|
25
40
|
alternative: string;
|
|
26
41
|
constraint: string;
|
|
27
|
-
reason: string;
|
|
28
42
|
}>, "many">>;
|
|
29
43
|
}, "strip", z.ZodTypeAny, {
|
|
30
44
|
context?: string | undefined;
|
|
@@ -35,9 +49,9 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
35
49
|
relatedFiles?: string[] | undefined;
|
|
36
50
|
constraintsChecked?: string[] | undefined;
|
|
37
51
|
constraintViolations?: {
|
|
52
|
+
reason: string;
|
|
38
53
|
alternative: string;
|
|
39
54
|
constraint: string;
|
|
40
|
-
reason: string;
|
|
41
55
|
}[] | undefined;
|
|
42
56
|
}, {
|
|
43
57
|
context?: string | undefined;
|
|
@@ -48,9 +62,9 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
48
62
|
relatedFiles?: string[] | undefined;
|
|
49
63
|
constraintsChecked?: string[] | undefined;
|
|
50
64
|
constraintViolations?: {
|
|
65
|
+
reason: string;
|
|
51
66
|
alternative: string;
|
|
52
67
|
constraint: string;
|
|
53
|
-
reason: string;
|
|
54
68
|
}[] | undefined;
|
|
55
69
|
}>>;
|
|
56
70
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -59,6 +73,12 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
59
73
|
action: "update" | "delete";
|
|
60
74
|
decisionId: string;
|
|
61
75
|
repoOrigin?: string | undefined;
|
|
76
|
+
forkAuthor?: {
|
|
77
|
+
platform: "github" | "gitlab";
|
|
78
|
+
user: string;
|
|
79
|
+
forkOrigin: string;
|
|
80
|
+
} | undefined;
|
|
81
|
+
workspaceId?: string | undefined;
|
|
62
82
|
updates?: {
|
|
63
83
|
context?: string | undefined;
|
|
64
84
|
summary?: string | undefined;
|
|
@@ -68,9 +88,9 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
68
88
|
relatedFiles?: string[] | undefined;
|
|
69
89
|
constraintsChecked?: string[] | undefined;
|
|
70
90
|
constraintViolations?: {
|
|
91
|
+
reason: string;
|
|
71
92
|
alternative: string;
|
|
72
93
|
constraint: string;
|
|
73
|
-
reason: string;
|
|
74
94
|
}[] | undefined;
|
|
75
95
|
} | undefined;
|
|
76
96
|
}, {
|
|
@@ -79,6 +99,12 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
79
99
|
action: "update" | "delete";
|
|
80
100
|
decisionId: string;
|
|
81
101
|
repoOrigin?: string | undefined;
|
|
102
|
+
forkAuthor?: {
|
|
103
|
+
platform: "github" | "gitlab";
|
|
104
|
+
user: string;
|
|
105
|
+
forkOrigin: string;
|
|
106
|
+
} | undefined;
|
|
107
|
+
workspaceId?: string | undefined;
|
|
82
108
|
updates?: {
|
|
83
109
|
context?: string | undefined;
|
|
84
110
|
summary?: string | undefined;
|
|
@@ -88,9 +114,9 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
88
114
|
relatedFiles?: string[] | undefined;
|
|
89
115
|
constraintsChecked?: string[] | undefined;
|
|
90
116
|
constraintViolations?: {
|
|
117
|
+
reason: string;
|
|
91
118
|
alternative: string;
|
|
92
119
|
constraint: string;
|
|
93
|
-
reason: string;
|
|
94
120
|
}[] | undefined;
|
|
95
121
|
} | undefined;
|
|
96
122
|
}>;
|
|
@@ -103,6 +129,20 @@ export declare const editSessionDecisionTool: {
|
|
|
103
129
|
name: string;
|
|
104
130
|
description: string;
|
|
105
131
|
inputSchema: z.ZodObject<{
|
|
132
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
134
|
+
user: z.ZodString;
|
|
135
|
+
forkOrigin: z.ZodString;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
platform: "github" | "gitlab";
|
|
138
|
+
user: string;
|
|
139
|
+
forkOrigin: string;
|
|
140
|
+
}, {
|
|
141
|
+
platform: "github" | "gitlab";
|
|
142
|
+
user: string;
|
|
143
|
+
forkOrigin: string;
|
|
144
|
+
}>>;
|
|
145
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
106
146
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
107
147
|
repoPath: z.ZodString;
|
|
108
148
|
intentId: z.ZodString;
|
|
@@ -121,13 +161,13 @@ export declare const editSessionDecisionTool: {
|
|
|
121
161
|
constraint: z.ZodString;
|
|
122
162
|
reason: z.ZodString;
|
|
123
163
|
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
reason: string;
|
|
124
165
|
alternative: string;
|
|
125
166
|
constraint: string;
|
|
126
|
-
reason: string;
|
|
127
167
|
}, {
|
|
168
|
+
reason: string;
|
|
128
169
|
alternative: string;
|
|
129
170
|
constraint: string;
|
|
130
|
-
reason: string;
|
|
131
171
|
}>, "many">>;
|
|
132
172
|
}, "strip", z.ZodTypeAny, {
|
|
133
173
|
context?: string | undefined;
|
|
@@ -138,9 +178,9 @@ export declare const editSessionDecisionTool: {
|
|
|
138
178
|
relatedFiles?: string[] | undefined;
|
|
139
179
|
constraintsChecked?: string[] | undefined;
|
|
140
180
|
constraintViolations?: {
|
|
181
|
+
reason: string;
|
|
141
182
|
alternative: string;
|
|
142
183
|
constraint: string;
|
|
143
|
-
reason: string;
|
|
144
184
|
}[] | undefined;
|
|
145
185
|
}, {
|
|
146
186
|
context?: string | undefined;
|
|
@@ -151,9 +191,9 @@ export declare const editSessionDecisionTool: {
|
|
|
151
191
|
relatedFiles?: string[] | undefined;
|
|
152
192
|
constraintsChecked?: string[] | undefined;
|
|
153
193
|
constraintViolations?: {
|
|
194
|
+
reason: string;
|
|
154
195
|
alternative: string;
|
|
155
196
|
constraint: string;
|
|
156
|
-
reason: string;
|
|
157
197
|
}[] | undefined;
|
|
158
198
|
}>>;
|
|
159
199
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -162,6 +202,12 @@ export declare const editSessionDecisionTool: {
|
|
|
162
202
|
action: "update" | "delete";
|
|
163
203
|
decisionId: string;
|
|
164
204
|
repoOrigin?: string | undefined;
|
|
205
|
+
forkAuthor?: {
|
|
206
|
+
platform: "github" | "gitlab";
|
|
207
|
+
user: string;
|
|
208
|
+
forkOrigin: string;
|
|
209
|
+
} | undefined;
|
|
210
|
+
workspaceId?: string | undefined;
|
|
165
211
|
updates?: {
|
|
166
212
|
context?: string | undefined;
|
|
167
213
|
summary?: string | undefined;
|
|
@@ -171,9 +217,9 @@ export declare const editSessionDecisionTool: {
|
|
|
171
217
|
relatedFiles?: string[] | undefined;
|
|
172
218
|
constraintsChecked?: string[] | undefined;
|
|
173
219
|
constraintViolations?: {
|
|
220
|
+
reason: string;
|
|
174
221
|
alternative: string;
|
|
175
222
|
constraint: string;
|
|
176
|
-
reason: string;
|
|
177
223
|
}[] | undefined;
|
|
178
224
|
} | undefined;
|
|
179
225
|
}, {
|
|
@@ -182,6 +228,12 @@ export declare const editSessionDecisionTool: {
|
|
|
182
228
|
action: "update" | "delete";
|
|
183
229
|
decisionId: string;
|
|
184
230
|
repoOrigin?: string | undefined;
|
|
231
|
+
forkAuthor?: {
|
|
232
|
+
platform: "github" | "gitlab";
|
|
233
|
+
user: string;
|
|
234
|
+
forkOrigin: string;
|
|
235
|
+
} | undefined;
|
|
236
|
+
workspaceId?: string | undefined;
|
|
185
237
|
updates?: {
|
|
186
238
|
context?: string | undefined;
|
|
187
239
|
summary?: string | undefined;
|
|
@@ -191,9 +243,9 @@ export declare const editSessionDecisionTool: {
|
|
|
191
243
|
relatedFiles?: string[] | undefined;
|
|
192
244
|
constraintsChecked?: string[] | undefined;
|
|
193
245
|
constraintViolations?: {
|
|
246
|
+
reason: string;
|
|
194
247
|
alternative: string;
|
|
195
248
|
constraint: string;
|
|
196
|
-
reason: string;
|
|
197
249
|
}[] | undefined;
|
|
198
250
|
} | undefined;
|
|
199
251
|
}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { request } from '../services/muninn-ipc.js';
|
|
3
3
|
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
+
import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
4
5
|
const constraintViolationSchema = z.object({
|
|
5
6
|
alternative: z.string(),
|
|
6
7
|
constraint: z.string(),
|
|
@@ -22,7 +23,8 @@ export const editSessionDecisionSchema = z.object({
|
|
|
22
23
|
intentId: z.string().describe('The intent ID the decision belongs to'),
|
|
23
24
|
decisionId: z.string().describe('The decision ID to edit or delete'),
|
|
24
25
|
action: z.enum(['update', 'delete']).describe('Action to perform: update modifies the decision, delete removes it'),
|
|
25
|
-
updates: decisionUpdatesSchema.optional().describe('Partial fields to update (only for action=update)')
|
|
26
|
+
updates: decisionUpdatesSchema.optional().describe('Partial fields to update (only for action=update)'),
|
|
27
|
+
...forkFieldsExtensions,
|
|
26
28
|
});
|
|
27
29
|
export async function editSessionDecision(input) {
|
|
28
30
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -32,6 +34,7 @@ export async function editSessionDecision(input) {
|
|
|
32
34
|
decisionId: input.decisionId,
|
|
33
35
|
action: input.action,
|
|
34
36
|
updates: input.updates,
|
|
37
|
+
...extractForkFields(input),
|
|
35
38
|
});
|
|
36
39
|
return { success: res.success !== false };
|
|
37
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-session-decision.js","sourceRoot":"","sources":["../../src/tools/edit-session-decision.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;
|
|
1
|
+
{"version":3,"file":"edit-session-decision.js","sourceRoot":"","sources":["../../src/tools/edit-session-decision.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,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACn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