@kawacode/mcp 5.1.1 → 5.2.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 +101 -36
- package/README.md +3 -1
- package/build/index.js +24 -5
- package/build/index.js.map +1 -1
- package/build/prompts/intent-first-workflow.js +7 -8
- package/build/prompts/intent-first-workflow.js.map +1 -1
- package/build/resources/active-intent.js +2 -2
- package/build/resources/active-intent.js.map +1 -1
- package/build/services/muninn-ipc.d.ts +2 -0
- package/build/services/muninn-ipc.js +34 -4
- package/build/services/muninn-ipc.js.map +1 -1
- package/build/tools/activate-intent.d.ts +40 -0
- package/build/tools/activate-intent.js +52 -0
- package/build/tools/activate-intent.js.map +1 -0
- package/build/tools/check-active-intent.d.ts +0 -1
- package/build/tools/check-active-intent.js +3 -4
- package/build/tools/check-active-intent.js.map +1 -1
- package/build/tools/complete-intent.d.ts +18 -6
- package/build/tools/complete-intent.js +31 -2
- package/build/tools/complete-intent.js.map +1 -1
- package/build/tools/create-intent.d.ts +23 -1
- package/build/tools/create-intent.js +58 -5
- package/build/tools/create-intent.js.map +1 -1
- package/build/tools/detect-intent-conflicts.d.ts +22 -322
- package/build/tools/detect-intent-conflicts.js +35 -60
- package/build/tools/detect-intent-conflicts.js.map +1 -1
- package/build/tools/edit-session-decision.d.ts +4 -4
- package/build/tools/get-intents-for-file.js +1 -1
- package/build/tools/get-intents-for-file.js.map +1 -1
- package/build/tools/get-intents-for-lines.js +1 -1
- package/build/tools/get-intents-for-lines.js.map +1 -1
- package/build/tools/get-project-decisions.d.ts +1 -0
- package/build/tools/get-project-decisions.js +3 -2
- package/build/tools/get-project-decisions.js.map +1 -1
- package/build/tools/get-relevant-context.d.ts +1 -0
- package/build/tools/get-relevant-context.js +2 -1
- package/build/tools/get-relevant-context.js.map +1 -1
- package/build/tools/get-session-decisions.d.ts +1 -0
- package/build/tools/get-session-decisions.js +1 -0
- package/build/tools/get-session-decisions.js.map +1 -1
- package/build/tools/index.d.ts +51 -198
- package/build/tools/index.js +3 -3
- package/build/tools/index.js.map +1 -1
- package/build/tools/infer-history.d.ts +11 -10
- package/build/tools/infer-history.js +45 -26
- package/build/tools/infer-history.js.map +1 -1
- package/build/tools/list-team-intents.d.ts +30 -0
- package/build/tools/list-team-intents.js +39 -16
- package/build/tools/list-team-intents.js.map +1 -1
- package/build/tools/log-work.js +1 -1
- package/build/tools/log-work.js.map +1 -1
- package/build/tools/update-intent.d.ts +95 -0
- package/build/tools/update-intent.js +94 -0
- package/build/tools/update-intent.js.map +1 -0
- package/package.json +1 -1
- package/build/tools/assign-blocks.d.ts +0 -87
- package/build/tools/assign-blocks.js +0 -49
- package/build/tools/assign-blocks.js.map +0 -1
|
@@ -2,18 +2,24 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const completeIntentSchema: z.ZodObject<{
|
|
3
3
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
4
4
|
repoPath: z.ZodString;
|
|
5
|
+
intentId: z.ZodOptional<z.ZodString>;
|
|
5
6
|
commitSha: z.ZodOptional<z.ZodString>;
|
|
6
|
-
status: z.ZodDefault<z.ZodEnum<["committed", "pushed", "done", "abandoned"]>>;
|
|
7
|
+
status: z.ZodDefault<z.ZodEnum<["committed", "pushed", "done", "abandoned", "superseded"]>>;
|
|
8
|
+
supersededBy: z.ZodOptional<z.ZodString>;
|
|
7
9
|
}, "strip", z.ZodTypeAny, {
|
|
8
10
|
repoPath: string;
|
|
9
|
-
status: "committed" | "pushed" | "done" | "abandoned";
|
|
11
|
+
status: "committed" | "pushed" | "done" | "abandoned" | "superseded";
|
|
10
12
|
repoOrigin?: string | undefined;
|
|
13
|
+
intentId?: string | undefined;
|
|
11
14
|
commitSha?: string | undefined;
|
|
15
|
+
supersededBy?: string | undefined;
|
|
12
16
|
}, {
|
|
13
17
|
repoPath: string;
|
|
14
18
|
repoOrigin?: string | undefined;
|
|
15
|
-
status?: "committed" | "pushed" | "done" | "abandoned" | undefined;
|
|
19
|
+
status?: "committed" | "pushed" | "done" | "abandoned" | "superseded" | undefined;
|
|
20
|
+
intentId?: string | undefined;
|
|
16
21
|
commitSha?: string | undefined;
|
|
22
|
+
supersededBy?: string | undefined;
|
|
17
23
|
}>;
|
|
18
24
|
export type CompleteIntentInput = z.infer<typeof completeIntentSchema>;
|
|
19
25
|
export interface CompleteIntentResponse {
|
|
@@ -31,18 +37,24 @@ export declare const completeIntentTool: {
|
|
|
31
37
|
inputSchema: z.ZodObject<{
|
|
32
38
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
33
39
|
repoPath: z.ZodString;
|
|
40
|
+
intentId: z.ZodOptional<z.ZodString>;
|
|
34
41
|
commitSha: z.ZodOptional<z.ZodString>;
|
|
35
|
-
status: z.ZodDefault<z.ZodEnum<["committed", "pushed", "done", "abandoned"]>>;
|
|
42
|
+
status: z.ZodDefault<z.ZodEnum<["committed", "pushed", "done", "abandoned", "superseded"]>>;
|
|
43
|
+
supersededBy: z.ZodOptional<z.ZodString>;
|
|
36
44
|
}, "strip", z.ZodTypeAny, {
|
|
37
45
|
repoPath: string;
|
|
38
|
-
status: "committed" | "pushed" | "done" | "abandoned";
|
|
46
|
+
status: "committed" | "pushed" | "done" | "abandoned" | "superseded";
|
|
39
47
|
repoOrigin?: string | undefined;
|
|
48
|
+
intentId?: string | undefined;
|
|
40
49
|
commitSha?: string | undefined;
|
|
50
|
+
supersededBy?: string | undefined;
|
|
41
51
|
}, {
|
|
42
52
|
repoPath: string;
|
|
43
53
|
repoOrigin?: string | undefined;
|
|
44
|
-
status?: "committed" | "pushed" | "done" | "abandoned" | undefined;
|
|
54
|
+
status?: "committed" | "pushed" | "done" | "abandoned" | "superseded" | undefined;
|
|
55
|
+
intentId?: string | undefined;
|
|
45
56
|
commitSha?: string | undefined;
|
|
57
|
+
supersededBy?: string | undefined;
|
|
46
58
|
}>;
|
|
47
59
|
handler: typeof completeIntent;
|
|
48
60
|
};
|
|
@@ -4,16 +4,45 @@ import { resolveOrigin } from './resolve-origin.js';
|
|
|
4
4
|
export const completeIntentSchema = z.object({
|
|
5
5
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
6
6
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
7
|
+
intentId: z.string().optional().describe('Expected intent ID to complete. If provided, the tool verifies this matches the active intent and rejects if mismatched (prevents race conditions with concurrent sessions).'),
|
|
7
8
|
commitSha: z.string().optional().describe('The git commit SHA to associate with this intent (if already committed)'),
|
|
8
|
-
status: z.enum(['committed', 'pushed', 'done', 'abandoned']).default('committed')
|
|
9
|
-
.describe('The new status for the intent. Use "committed" after git commit, "done" when work is complete, "abandoned" to discard.')
|
|
9
|
+
status: z.enum(['committed', 'pushed', 'done', 'abandoned', 'superseded']).default('committed')
|
|
10
|
+
.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.'),
|
|
11
|
+
supersededBy: z.string().optional().describe('Intent ID that supersedes this one. Required when status is "superseded".')
|
|
10
12
|
});
|
|
11
13
|
export async function completeIntent(input) {
|
|
12
14
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
15
|
+
// If intentId provided, verify it matches the active intent before completing
|
|
16
|
+
if (input.intentId) {
|
|
17
|
+
const activeRes = await request('intent', 'get-active', { repoOrigin: actualOrigin });
|
|
18
|
+
const activeId = activeRes.intentId || activeRes.intent?.id || '';
|
|
19
|
+
if (!activeId) {
|
|
20
|
+
return {
|
|
21
|
+
success: false,
|
|
22
|
+
intentId: input.intentId,
|
|
23
|
+
previousStatus: 'unknown',
|
|
24
|
+
newStatus: input.status,
|
|
25
|
+
commitSha: input.commitSha,
|
|
26
|
+
message: `No active intent found. Expected intent ${input.intentId.substring(0, 8)} but nothing is active.`
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
if (activeId !== input.intentId) {
|
|
30
|
+
const activeTitle = activeRes.intent?.title || 'unknown';
|
|
31
|
+
return {
|
|
32
|
+
success: false,
|
|
33
|
+
intentId: input.intentId,
|
|
34
|
+
previousStatus: 'unknown',
|
|
35
|
+
newStatus: input.status,
|
|
36
|
+
commitSha: input.commitSha,
|
|
37
|
+
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.`
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
13
41
|
const res = await request('intent', 'complete', {
|
|
14
42
|
repoOrigin: actualOrigin,
|
|
15
43
|
status: input.status,
|
|
16
44
|
commitSha: input.commitSha,
|
|
45
|
+
supersededBy: input.supersededBy,
|
|
17
46
|
});
|
|
18
47
|
const intentId = res.intentId || '';
|
|
19
48
|
const intentTitle = res.intentTitle || 'Intent';
|
|
@@ -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,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yEAAyE,CAAC;IACpH,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;
|
|
1
|
+
{"version":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AAA;IACnC,MAAM,WAAW,GAAG,GAAG,CAAC,WAAW,IAAI,QAAQ,CAAA;IAC/C,MAAM,cAAc,GAAG,GAAG,CAAC,cAAc,IAAI,QAAQ,CAAA;IAErD,MAAM,cAAc,GAA2B;QAC7C,SAAS,EAAE,WAAW,WAAW,uBAAuB;QACxD,MAAM,EAAE,WAAW,WAAW,oBAAoB;QAClD,IAAI,EAAE,WAAW,WAAW,kBAAkB;QAC9C,SAAS,EAAE,WAAW,WAAW,aAAa;KAC/C,CAAA;IAED,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO,KAAK,KAAK;QAC9B,QAAQ;QACR,cAAc;QACd,SAAS,EAAE,KAAK,CAAC,MAAM;QACvB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;KACjH,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;;;;;;;;;;;qDAWsC;IACnD,WAAW,EAAE,oBAAoB;IACjC,OAAO,EAAE,cAAc;CACxB,CAAA"}
|
|
@@ -6,11 +6,13 @@ 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
|
+
force: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
9
10
|
}, "strip", z.ZodTypeAny, {
|
|
10
11
|
repoPath: string;
|
|
11
12
|
title: string;
|
|
12
13
|
description: string;
|
|
13
14
|
templateType: "feature" | "refactor" | "exploration";
|
|
15
|
+
force: boolean;
|
|
14
16
|
repoOrigin?: string | undefined;
|
|
15
17
|
constraints?: string[] | undefined;
|
|
16
18
|
}, {
|
|
@@ -20,13 +22,29 @@ export declare const createAndActivateIntentSchema: z.ZodObject<{
|
|
|
20
22
|
repoOrigin?: string | undefined;
|
|
21
23
|
templateType?: "feature" | "refactor" | "exploration" | undefined;
|
|
22
24
|
constraints?: string[] | undefined;
|
|
25
|
+
force?: boolean | undefined;
|
|
23
26
|
}>;
|
|
24
27
|
export type CreateIntentInput = z.infer<typeof createAndActivateIntentSchema>;
|
|
28
|
+
interface ConflictInfo {
|
|
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
|
+
}
|
|
25
42
|
export interface CreateIntentResponse {
|
|
26
43
|
success: boolean;
|
|
27
44
|
intentId: string;
|
|
28
|
-
|
|
45
|
+
action: 'created' | 'reactivated' | 'conflict';
|
|
29
46
|
message: string;
|
|
47
|
+
conflicts?: ConflictInfo[];
|
|
30
48
|
}
|
|
31
49
|
export declare function createAndActivateIntent(input: CreateIntentInput): Promise<CreateIntentResponse>;
|
|
32
50
|
export declare const createAndActivateIntentTool: {
|
|
@@ -39,11 +57,13 @@ export declare const createAndActivateIntentTool: {
|
|
|
39
57
|
description: z.ZodString;
|
|
40
58
|
templateType: z.ZodDefault<z.ZodEnum<["feature", "refactor", "exploration"]>>;
|
|
41
59
|
constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
60
|
+
force: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
42
61
|
}, "strip", z.ZodTypeAny, {
|
|
43
62
|
repoPath: string;
|
|
44
63
|
title: string;
|
|
45
64
|
description: string;
|
|
46
65
|
templateType: "feature" | "refactor" | "exploration";
|
|
66
|
+
force: boolean;
|
|
47
67
|
repoOrigin?: string | undefined;
|
|
48
68
|
constraints?: string[] | undefined;
|
|
49
69
|
}, {
|
|
@@ -53,6 +73,8 @@ export declare const createAndActivateIntentTool: {
|
|
|
53
73
|
repoOrigin?: string | undefined;
|
|
54
74
|
templateType?: "feature" | "refactor" | "exploration" | undefined;
|
|
55
75
|
constraints?: string[] | undefined;
|
|
76
|
+
force?: boolean | undefined;
|
|
56
77
|
}>;
|
|
57
78
|
handler: typeof createAndActivateIntent;
|
|
58
79
|
};
|
|
80
|
+
export {};
|
|
@@ -7,11 +7,15 @@ export const createAndActivateIntentSchema = z.object({
|
|
|
7
7
|
title: z.string().max(200).describe('Short, descriptive title for the intent'),
|
|
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
|
-
constraints: z.array(z.string()).optional().describe('Requirements or constraints for this work')
|
|
10
|
+
constraints: z.array(z.string()).optional().describe('Requirements or constraints for this work'),
|
|
11
|
+
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.'),
|
|
11
12
|
});
|
|
12
13
|
export async function createAndActivateIntent(input) {
|
|
13
14
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
14
|
-
// Step 1: Create the intent
|
|
15
|
+
// Step 1: Create (or find-and-reactivate) the intent.
|
|
16
|
+
// The Muninn handler proxies to API POST /intents/find-or-create which
|
|
17
|
+
// dedups by embedding similarity (≥ 0.85) and runs automatic conflict
|
|
18
|
+
// detection against all other intents for the repo.
|
|
15
19
|
const createRes = await request('intent', 'create', {
|
|
16
20
|
repoOrigin: actualOrigin,
|
|
17
21
|
title: input.title,
|
|
@@ -19,18 +23,63 @@ export async function createAndActivateIntent(input) {
|
|
|
19
23
|
templateType: input.templateType,
|
|
20
24
|
constraints: input.constraints || [],
|
|
21
25
|
scope: { type: 'repo', paths: [] },
|
|
26
|
+
force: input.force || false,
|
|
22
27
|
});
|
|
28
|
+
// Handle conflict detection — API returned 409 with conflict data.
|
|
29
|
+
// Return the conflicts to the caller (Claude Code) so it can present
|
|
30
|
+
// them to the user and optionally retry with force=true.
|
|
31
|
+
if (createRes.conflict === true && createRes.conflicts) {
|
|
32
|
+
const conflicts = createRes.conflicts;
|
|
33
|
+
const highCount = conflicts.filter((c) => c.severity === 'high').length;
|
|
34
|
+
const mediumCount = conflicts.filter((c) => c.severity === 'medium').length;
|
|
35
|
+
const lines = [
|
|
36
|
+
`Found ${conflicts.length} potential conflict(s) with existing intents:`,
|
|
37
|
+
'',
|
|
38
|
+
];
|
|
39
|
+
for (const c of conflicts) {
|
|
40
|
+
const badge = c.severity === 'high' ? '[HIGH]' : c.severity === 'medium' ? '[MEDIUM]' : '[LOW]';
|
|
41
|
+
lines.push(`${badge} "${c.title}" by ${c.author} (${c.status}, ${c.staleness})`);
|
|
42
|
+
if (c.overlappingFiles.length > 0) {
|
|
43
|
+
lines.push(` Files: ${c.overlappingFiles.join(', ')}`);
|
|
44
|
+
}
|
|
45
|
+
if (c.oppositionDetected) {
|
|
46
|
+
lines.push(` Semantic opposition: ${c.oppositionDetail}`);
|
|
47
|
+
}
|
|
48
|
+
lines.push(` Similarity: ${(c.similarityScore * 100).toFixed(0)}%`);
|
|
49
|
+
lines.push('');
|
|
50
|
+
}
|
|
51
|
+
lines.push('To proceed anyway, call create_and_activate_intent again with force=true.');
|
|
52
|
+
return {
|
|
53
|
+
success: false,
|
|
54
|
+
intentId: '',
|
|
55
|
+
action: 'conflict',
|
|
56
|
+
message: lines.join('\n'),
|
|
57
|
+
conflicts,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
// Propagate Muninn-side errors (e.g. not signed in, API unreachable) to the AI
|
|
61
|
+
// so it can tell the user how to recover instead of silently proceeding.
|
|
62
|
+
if (createRes.success === false) {
|
|
63
|
+
throw new Error(createRes.error || 'Intent creation failed');
|
|
64
|
+
}
|
|
23
65
|
const intentId = createRes.intent?.id || createRes.intentId || '';
|
|
66
|
+
if (!intentId) {
|
|
67
|
+
throw new Error('Intent creation succeeded but no intent ID was returned');
|
|
68
|
+
}
|
|
69
|
+
const action = createRes.action === 'reactivated' ? 'reactivated' : 'created';
|
|
24
70
|
// Step 2: Set it as active
|
|
25
71
|
await request('intent', 'set-active', {
|
|
26
72
|
repoOrigin: actualOrigin,
|
|
27
73
|
intentId,
|
|
28
74
|
});
|
|
75
|
+
const message = action === 'reactivated'
|
|
76
|
+
? `Reactivated existing similar intent: "${input.title}" — resuming previous work instead of creating a duplicate.`
|
|
77
|
+
: `Created and activated intent: "${input.title}"`;
|
|
29
78
|
return {
|
|
30
79
|
success: true,
|
|
31
80
|
intentId,
|
|
32
|
-
|
|
33
|
-
message
|
|
81
|
+
action,
|
|
82
|
+
message,
|
|
34
83
|
};
|
|
35
84
|
}
|
|
36
85
|
export const createAndActivateIntentTool = {
|
|
@@ -42,7 +91,11 @@ Call this when check_active_intent returns no active intent. Before calling:
|
|
|
42
91
|
2. Ask the user to confirm the intent details (title, description, type)
|
|
43
92
|
3. Then call this tool with the confirmed details
|
|
44
93
|
|
|
45
|
-
This ensures all AI-generated code gets properly tracked and attributed
|
|
94
|
+
This ensures all AI-generated code gets properly tracked and attributed.
|
|
95
|
+
|
|
96
|
+
If the tool returns conflicts (action="conflict"), present the conflict
|
|
97
|
+
details to the user and ask whether to proceed. If yes, retry with
|
|
98
|
+
force=true to bypass conflict detection.`,
|
|
46
99
|
inputSchema: createAndActivateIntentSchema,
|
|
47
100
|
handler: createAndActivateIntent
|
|
48
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-intent.js","sourceRoot":"","sources":["../../src/tools/create-intent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D;QACnH,CAAC,CAAC,kCAAkC,KAAK,CAAC,KAAK,GAAG,CAAA;IAEpD,OAAO;QACL,OAAO,EAAE,IAAI;QACb,QAAQ;QACR,MAAM;QACN,OAAO;KACR,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE;;;;;;;;;;;yCAW0B;IACvC,WAAW,EAAE,6BAA6B;IAC1C,OAAO,EAAE,uBAAuB;CACjC,CAAA"}
|
|
@@ -3,194 +3,39 @@ export declare const detectIntentConflictsSchema: z.ZodObject<{
|
|
|
3
3
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
4
4
|
repoPath: z.ZodString;
|
|
5
5
|
intentId: z.ZodString;
|
|
6
|
-
|
|
7
|
-
decision: z.ZodObject<{
|
|
8
|
-
id: z.ZodString;
|
|
9
|
-
timestamp: z.ZodString;
|
|
10
|
-
type: z.ZodString;
|
|
11
|
-
summary: z.ZodString;
|
|
12
|
-
rationale: z.ZodString;
|
|
13
|
-
context: z.ZodOptional<z.ZodString>;
|
|
14
|
-
alternatives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15
|
-
consequences: z.ZodOptional<z.ZodString>;
|
|
16
|
-
relatedFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
17
|
-
constraintsChecked: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
-
constraintViolations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
19
|
-
alternative: z.ZodString;
|
|
20
|
-
constraint: z.ZodString;
|
|
21
|
-
reason: z.ZodString;
|
|
22
|
-
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
alternative: string;
|
|
24
|
-
constraint: string;
|
|
25
|
-
reason: string;
|
|
26
|
-
}, {
|
|
27
|
-
alternative: string;
|
|
28
|
-
constraint: string;
|
|
29
|
-
reason: string;
|
|
30
|
-
}>, "many">>;
|
|
31
|
-
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
id: string;
|
|
33
|
-
type: string;
|
|
34
|
-
summary: string;
|
|
35
|
-
rationale: string;
|
|
36
|
-
timestamp: string;
|
|
37
|
-
context?: string | undefined;
|
|
38
|
-
alternatives?: string[] | undefined;
|
|
39
|
-
consequences?: string | undefined;
|
|
40
|
-
relatedFiles?: string[] | undefined;
|
|
41
|
-
constraintsChecked?: string[] | undefined;
|
|
42
|
-
constraintViolations?: {
|
|
43
|
-
alternative: string;
|
|
44
|
-
constraint: string;
|
|
45
|
-
reason: string;
|
|
46
|
-
}[] | undefined;
|
|
47
|
-
}, {
|
|
48
|
-
id: string;
|
|
49
|
-
type: string;
|
|
50
|
-
summary: string;
|
|
51
|
-
rationale: string;
|
|
52
|
-
timestamp: string;
|
|
53
|
-
context?: string | undefined;
|
|
54
|
-
alternatives?: string[] | undefined;
|
|
55
|
-
consequences?: string | undefined;
|
|
56
|
-
relatedFiles?: string[] | undefined;
|
|
57
|
-
constraintsChecked?: string[] | undefined;
|
|
58
|
-
constraintViolations?: {
|
|
59
|
-
alternative: string;
|
|
60
|
-
constraint: string;
|
|
61
|
-
reason: string;
|
|
62
|
-
}[] | undefined;
|
|
63
|
-
}>;
|
|
64
|
-
intentId: z.ZodString;
|
|
65
|
-
authorId: z.ZodString;
|
|
66
|
-
authorName: z.ZodString;
|
|
67
|
-
}, "strip", z.ZodTypeAny, {
|
|
68
|
-
decision: {
|
|
69
|
-
id: string;
|
|
70
|
-
type: string;
|
|
71
|
-
summary: string;
|
|
72
|
-
rationale: string;
|
|
73
|
-
timestamp: string;
|
|
74
|
-
context?: string | undefined;
|
|
75
|
-
alternatives?: string[] | undefined;
|
|
76
|
-
consequences?: string | undefined;
|
|
77
|
-
relatedFiles?: string[] | undefined;
|
|
78
|
-
constraintsChecked?: string[] | undefined;
|
|
79
|
-
constraintViolations?: {
|
|
80
|
-
alternative: string;
|
|
81
|
-
constraint: string;
|
|
82
|
-
reason: string;
|
|
83
|
-
}[] | undefined;
|
|
84
|
-
};
|
|
85
|
-
intentId: string;
|
|
86
|
-
authorId: string;
|
|
87
|
-
authorName: string;
|
|
88
|
-
}, {
|
|
89
|
-
decision: {
|
|
90
|
-
id: string;
|
|
91
|
-
type: string;
|
|
92
|
-
summary: string;
|
|
93
|
-
rationale: string;
|
|
94
|
-
timestamp: string;
|
|
95
|
-
context?: string | undefined;
|
|
96
|
-
alternatives?: string[] | undefined;
|
|
97
|
-
consequences?: string | undefined;
|
|
98
|
-
relatedFiles?: string[] | undefined;
|
|
99
|
-
constraintsChecked?: string[] | undefined;
|
|
100
|
-
constraintViolations?: {
|
|
101
|
-
alternative: string;
|
|
102
|
-
constraint: string;
|
|
103
|
-
reason: string;
|
|
104
|
-
}[] | undefined;
|
|
105
|
-
};
|
|
106
|
-
intentId: string;
|
|
107
|
-
authorId: string;
|
|
108
|
-
authorName: string;
|
|
109
|
-
}>, "many">;
|
|
6
|
+
minScore: z.ZodOptional<z.ZodNumber>;
|
|
110
7
|
}, "strip", z.ZodTypeAny, {
|
|
111
8
|
repoPath: string;
|
|
112
9
|
intentId: string;
|
|
113
|
-
teamDecisions: {
|
|
114
|
-
decision: {
|
|
115
|
-
id: string;
|
|
116
|
-
type: string;
|
|
117
|
-
summary: string;
|
|
118
|
-
rationale: string;
|
|
119
|
-
timestamp: string;
|
|
120
|
-
context?: string | undefined;
|
|
121
|
-
alternatives?: string[] | undefined;
|
|
122
|
-
consequences?: string | undefined;
|
|
123
|
-
relatedFiles?: string[] | undefined;
|
|
124
|
-
constraintsChecked?: string[] | undefined;
|
|
125
|
-
constraintViolations?: {
|
|
126
|
-
alternative: string;
|
|
127
|
-
constraint: string;
|
|
128
|
-
reason: string;
|
|
129
|
-
}[] | undefined;
|
|
130
|
-
};
|
|
131
|
-
intentId: string;
|
|
132
|
-
authorId: string;
|
|
133
|
-
authorName: string;
|
|
134
|
-
}[];
|
|
135
10
|
repoOrigin?: string | undefined;
|
|
11
|
+
minScore?: number | undefined;
|
|
136
12
|
}, {
|
|
137
13
|
repoPath: string;
|
|
138
14
|
intentId: string;
|
|
139
|
-
teamDecisions: {
|
|
140
|
-
decision: {
|
|
141
|
-
id: string;
|
|
142
|
-
type: string;
|
|
143
|
-
summary: string;
|
|
144
|
-
rationale: string;
|
|
145
|
-
timestamp: string;
|
|
146
|
-
context?: string | undefined;
|
|
147
|
-
alternatives?: string[] | undefined;
|
|
148
|
-
consequences?: string | undefined;
|
|
149
|
-
relatedFiles?: string[] | undefined;
|
|
150
|
-
constraintsChecked?: string[] | undefined;
|
|
151
|
-
constraintViolations?: {
|
|
152
|
-
alternative: string;
|
|
153
|
-
constraint: string;
|
|
154
|
-
reason: string;
|
|
155
|
-
}[] | undefined;
|
|
156
|
-
};
|
|
157
|
-
intentId: string;
|
|
158
|
-
authorId: string;
|
|
159
|
-
authorName: string;
|
|
160
|
-
}[];
|
|
161
15
|
repoOrigin?: string | undefined;
|
|
16
|
+
minScore?: number | undefined;
|
|
162
17
|
}>;
|
|
163
18
|
export type DetectIntentConflictsInput = z.infer<typeof detectIntentConflictsSchema>;
|
|
164
|
-
export interface
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
19
|
+
export interface ConflictCandidate {
|
|
20
|
+
intentId: string;
|
|
21
|
+
title: string;
|
|
22
|
+
description: string;
|
|
23
|
+
author: string;
|
|
24
|
+
authorId: string;
|
|
25
|
+
score: number;
|
|
169
26
|
overlappingFiles: string[];
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
context?: string;
|
|
178
|
-
alternatives?: string[];
|
|
179
|
-
consequences?: string;
|
|
180
|
-
relatedFiles?: string[];
|
|
181
|
-
constraintsChecked?: string[];
|
|
182
|
-
constraintViolations?: Array<{
|
|
183
|
-
alternative: string;
|
|
184
|
-
constraint: string;
|
|
185
|
-
reason: string;
|
|
186
|
-
}>;
|
|
27
|
+
decisions: {
|
|
28
|
+
decisionId: string;
|
|
29
|
+
summary: string;
|
|
30
|
+
rationale: string;
|
|
31
|
+
type: string;
|
|
32
|
+
relatedFiles: string[];
|
|
33
|
+
}[];
|
|
187
34
|
}
|
|
188
35
|
export interface DetectIntentConflictsResponse {
|
|
189
36
|
hasConflicts: boolean;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
conflicts: ConflictInfo[];
|
|
193
|
-
overlappingFiles: string[];
|
|
37
|
+
conflicts: ConflictCandidate[];
|
|
38
|
+
count: number;
|
|
194
39
|
}
|
|
195
40
|
export declare function detectIntentConflicts(input: DetectIntentConflictsInput): Promise<DetectIntentConflictsResponse>;
|
|
196
41
|
export declare const detectIntentConflictsTool: {
|
|
@@ -200,162 +45,17 @@ export declare const detectIntentConflictsTool: {
|
|
|
200
45
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
201
46
|
repoPath: z.ZodString;
|
|
202
47
|
intentId: z.ZodString;
|
|
203
|
-
|
|
204
|
-
decision: z.ZodObject<{
|
|
205
|
-
id: z.ZodString;
|
|
206
|
-
timestamp: z.ZodString;
|
|
207
|
-
type: z.ZodString;
|
|
208
|
-
summary: z.ZodString;
|
|
209
|
-
rationale: z.ZodString;
|
|
210
|
-
context: z.ZodOptional<z.ZodString>;
|
|
211
|
-
alternatives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
212
|
-
consequences: z.ZodOptional<z.ZodString>;
|
|
213
|
-
relatedFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
214
|
-
constraintsChecked: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
215
|
-
constraintViolations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
216
|
-
alternative: z.ZodString;
|
|
217
|
-
constraint: z.ZodString;
|
|
218
|
-
reason: z.ZodString;
|
|
219
|
-
}, "strip", z.ZodTypeAny, {
|
|
220
|
-
alternative: string;
|
|
221
|
-
constraint: string;
|
|
222
|
-
reason: string;
|
|
223
|
-
}, {
|
|
224
|
-
alternative: string;
|
|
225
|
-
constraint: string;
|
|
226
|
-
reason: string;
|
|
227
|
-
}>, "many">>;
|
|
228
|
-
}, "strip", z.ZodTypeAny, {
|
|
229
|
-
id: string;
|
|
230
|
-
type: string;
|
|
231
|
-
summary: string;
|
|
232
|
-
rationale: string;
|
|
233
|
-
timestamp: string;
|
|
234
|
-
context?: string | undefined;
|
|
235
|
-
alternatives?: string[] | undefined;
|
|
236
|
-
consequences?: string | undefined;
|
|
237
|
-
relatedFiles?: string[] | undefined;
|
|
238
|
-
constraintsChecked?: string[] | undefined;
|
|
239
|
-
constraintViolations?: {
|
|
240
|
-
alternative: string;
|
|
241
|
-
constraint: string;
|
|
242
|
-
reason: string;
|
|
243
|
-
}[] | undefined;
|
|
244
|
-
}, {
|
|
245
|
-
id: string;
|
|
246
|
-
type: string;
|
|
247
|
-
summary: string;
|
|
248
|
-
rationale: string;
|
|
249
|
-
timestamp: string;
|
|
250
|
-
context?: string | undefined;
|
|
251
|
-
alternatives?: string[] | undefined;
|
|
252
|
-
consequences?: string | undefined;
|
|
253
|
-
relatedFiles?: string[] | undefined;
|
|
254
|
-
constraintsChecked?: string[] | undefined;
|
|
255
|
-
constraintViolations?: {
|
|
256
|
-
alternative: string;
|
|
257
|
-
constraint: string;
|
|
258
|
-
reason: string;
|
|
259
|
-
}[] | undefined;
|
|
260
|
-
}>;
|
|
261
|
-
intentId: z.ZodString;
|
|
262
|
-
authorId: z.ZodString;
|
|
263
|
-
authorName: z.ZodString;
|
|
264
|
-
}, "strip", z.ZodTypeAny, {
|
|
265
|
-
decision: {
|
|
266
|
-
id: string;
|
|
267
|
-
type: string;
|
|
268
|
-
summary: string;
|
|
269
|
-
rationale: string;
|
|
270
|
-
timestamp: string;
|
|
271
|
-
context?: string | undefined;
|
|
272
|
-
alternatives?: string[] | undefined;
|
|
273
|
-
consequences?: string | undefined;
|
|
274
|
-
relatedFiles?: string[] | undefined;
|
|
275
|
-
constraintsChecked?: string[] | undefined;
|
|
276
|
-
constraintViolations?: {
|
|
277
|
-
alternative: string;
|
|
278
|
-
constraint: string;
|
|
279
|
-
reason: string;
|
|
280
|
-
}[] | undefined;
|
|
281
|
-
};
|
|
282
|
-
intentId: string;
|
|
283
|
-
authorId: string;
|
|
284
|
-
authorName: string;
|
|
285
|
-
}, {
|
|
286
|
-
decision: {
|
|
287
|
-
id: string;
|
|
288
|
-
type: string;
|
|
289
|
-
summary: string;
|
|
290
|
-
rationale: string;
|
|
291
|
-
timestamp: string;
|
|
292
|
-
context?: string | undefined;
|
|
293
|
-
alternatives?: string[] | undefined;
|
|
294
|
-
consequences?: string | undefined;
|
|
295
|
-
relatedFiles?: string[] | undefined;
|
|
296
|
-
constraintsChecked?: string[] | undefined;
|
|
297
|
-
constraintViolations?: {
|
|
298
|
-
alternative: string;
|
|
299
|
-
constraint: string;
|
|
300
|
-
reason: string;
|
|
301
|
-
}[] | undefined;
|
|
302
|
-
};
|
|
303
|
-
intentId: string;
|
|
304
|
-
authorId: string;
|
|
305
|
-
authorName: string;
|
|
306
|
-
}>, "many">;
|
|
48
|
+
minScore: z.ZodOptional<z.ZodNumber>;
|
|
307
49
|
}, "strip", z.ZodTypeAny, {
|
|
308
50
|
repoPath: string;
|
|
309
51
|
intentId: string;
|
|
310
|
-
teamDecisions: {
|
|
311
|
-
decision: {
|
|
312
|
-
id: string;
|
|
313
|
-
type: string;
|
|
314
|
-
summary: string;
|
|
315
|
-
rationale: string;
|
|
316
|
-
timestamp: string;
|
|
317
|
-
context?: string | undefined;
|
|
318
|
-
alternatives?: string[] | undefined;
|
|
319
|
-
consequences?: string | undefined;
|
|
320
|
-
relatedFiles?: string[] | undefined;
|
|
321
|
-
constraintsChecked?: string[] | undefined;
|
|
322
|
-
constraintViolations?: {
|
|
323
|
-
alternative: string;
|
|
324
|
-
constraint: string;
|
|
325
|
-
reason: string;
|
|
326
|
-
}[] | undefined;
|
|
327
|
-
};
|
|
328
|
-
intentId: string;
|
|
329
|
-
authorId: string;
|
|
330
|
-
authorName: string;
|
|
331
|
-
}[];
|
|
332
52
|
repoOrigin?: string | undefined;
|
|
53
|
+
minScore?: number | undefined;
|
|
333
54
|
}, {
|
|
334
55
|
repoPath: string;
|
|
335
56
|
intentId: string;
|
|
336
|
-
teamDecisions: {
|
|
337
|
-
decision: {
|
|
338
|
-
id: string;
|
|
339
|
-
type: string;
|
|
340
|
-
summary: string;
|
|
341
|
-
rationale: string;
|
|
342
|
-
timestamp: string;
|
|
343
|
-
context?: string | undefined;
|
|
344
|
-
alternatives?: string[] | undefined;
|
|
345
|
-
consequences?: string | undefined;
|
|
346
|
-
relatedFiles?: string[] | undefined;
|
|
347
|
-
constraintsChecked?: string[] | undefined;
|
|
348
|
-
constraintViolations?: {
|
|
349
|
-
alternative: string;
|
|
350
|
-
constraint: string;
|
|
351
|
-
reason: string;
|
|
352
|
-
}[] | undefined;
|
|
353
|
-
};
|
|
354
|
-
intentId: string;
|
|
355
|
-
authorId: string;
|
|
356
|
-
authorName: string;
|
|
357
|
-
}[];
|
|
358
57
|
repoOrigin?: string | undefined;
|
|
58
|
+
minScore?: number | undefined;
|
|
359
59
|
}>;
|
|
360
60
|
handler: typeof detectIntentConflicts;
|
|
361
61
|
};
|