@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infer-history.js","sourceRoot":"","sources":["../../src/tools/infer-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAClE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"infer-history.js","sourceRoot":"","sources":["../../src/tools/infer-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAClE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC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EAAE,kBAAkB;IAC/B,OAAO,EAAE,YAAY;CACtB,CAAA"}
|
|
@@ -3,14 +3,29 @@ export declare const listTeamIntentsSchema: z.ZodObject<{
|
|
|
3
3
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
4
4
|
repoPath: z.ZodString;
|
|
5
5
|
status: z.ZodOptional<z.ZodEnum<["active", "committed", "pushed", "done", "abandoned"]>>;
|
|
6
|
+
author: z.ZodOptional<z.ZodString>;
|
|
7
|
+
since: z.ZodOptional<z.ZodString>;
|
|
8
|
+
until: z.ZodOptional<z.ZodString>;
|
|
9
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
10
|
+
offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
6
11
|
}, "strip", z.ZodTypeAny, {
|
|
7
12
|
repoPath: string;
|
|
13
|
+
limit: number;
|
|
14
|
+
offset: number;
|
|
8
15
|
repoOrigin?: string | undefined;
|
|
9
16
|
status?: "active" | "committed" | "pushed" | "done" | "abandoned" | undefined;
|
|
17
|
+
author?: string | undefined;
|
|
18
|
+
since?: string | undefined;
|
|
19
|
+
until?: string | undefined;
|
|
10
20
|
}, {
|
|
11
21
|
repoPath: string;
|
|
12
22
|
repoOrigin?: string | undefined;
|
|
13
23
|
status?: "active" | "committed" | "pushed" | "done" | "abandoned" | undefined;
|
|
24
|
+
author?: string | undefined;
|
|
25
|
+
since?: string | undefined;
|
|
26
|
+
until?: string | undefined;
|
|
27
|
+
limit?: number | undefined;
|
|
28
|
+
offset?: number | undefined;
|
|
14
29
|
}>;
|
|
15
30
|
export type ListTeamIntentsInput = z.infer<typeof listTeamIntentsSchema>;
|
|
16
31
|
export interface TeamIntent {
|
|
@@ -38,14 +53,29 @@ export declare const listTeamIntentsTool: {
|
|
|
38
53
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
39
54
|
repoPath: z.ZodString;
|
|
40
55
|
status: z.ZodOptional<z.ZodEnum<["active", "committed", "pushed", "done", "abandoned"]>>;
|
|
56
|
+
author: z.ZodOptional<z.ZodString>;
|
|
57
|
+
since: z.ZodOptional<z.ZodString>;
|
|
58
|
+
until: z.ZodOptional<z.ZodString>;
|
|
59
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
60
|
+
offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
41
61
|
}, "strip", z.ZodTypeAny, {
|
|
42
62
|
repoPath: string;
|
|
63
|
+
limit: number;
|
|
64
|
+
offset: number;
|
|
43
65
|
repoOrigin?: string | undefined;
|
|
44
66
|
status?: "active" | "committed" | "pushed" | "done" | "abandoned" | undefined;
|
|
67
|
+
author?: string | undefined;
|
|
68
|
+
since?: string | undefined;
|
|
69
|
+
until?: string | undefined;
|
|
45
70
|
}, {
|
|
46
71
|
repoPath: string;
|
|
47
72
|
repoOrigin?: string | undefined;
|
|
48
73
|
status?: "active" | "committed" | "pushed" | "done" | "abandoned" | undefined;
|
|
74
|
+
author?: string | undefined;
|
|
75
|
+
since?: string | undefined;
|
|
76
|
+
until?: string | undefined;
|
|
77
|
+
limit?: number | undefined;
|
|
78
|
+
offset?: number | undefined;
|
|
49
79
|
}>;
|
|
50
80
|
handler: typeof listTeamIntents;
|
|
51
81
|
};
|
|
@@ -5,7 +5,12 @@ export const listTeamIntentsSchema = 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
7
|
status: z.enum(['active', 'committed', 'pushed', 'done', 'abandoned']).optional()
|
|
8
|
-
.describe('Filter by intent status')
|
|
8
|
+
.describe('Filter by intent status'),
|
|
9
|
+
author: z.string().optional().describe('Filter by author name or ID'),
|
|
10
|
+
since: z.string().optional().describe('Filter intents updated after this ISO8601 date (e.g. "2026-04-01")'),
|
|
11
|
+
until: z.string().optional().describe('Filter intents updated before this ISO8601 date'),
|
|
12
|
+
limit: z.number().optional().default(50).describe('Maximum number of intents to return (default: 50)'),
|
|
13
|
+
offset: z.number().optional().default(0).describe('Number of intents to skip for pagination (default: 0)'),
|
|
9
14
|
});
|
|
10
15
|
export async function listTeamIntents(input) {
|
|
11
16
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -13,8 +18,8 @@ export async function listTeamIntents(input) {
|
|
|
13
18
|
repoOrigin: actualOrigin,
|
|
14
19
|
status: input.status,
|
|
15
20
|
});
|
|
16
|
-
|
|
17
|
-
id: intent.id ||
|
|
21
|
+
let intents = (res.intents || []).map((intent) => ({
|
|
22
|
+
id: intent.id || '',
|
|
18
23
|
title: intent.title || '',
|
|
19
24
|
description: intent.description || '',
|
|
20
25
|
author: intent.author || intent.author_name || intent.authorName || 'Unknown',
|
|
@@ -25,32 +30,50 @@ export async function listTeamIntents(input) {
|
|
|
25
30
|
fileCount: intent.file_count || intent.fileCount || 0,
|
|
26
31
|
updatedAt: intent.updated_at || intent.updatedAt || ''
|
|
27
32
|
}));
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
// Apply filters
|
|
34
|
+
if (input.status) {
|
|
35
|
+
intents = intents.filter(i => i.status === input.status);
|
|
36
|
+
}
|
|
37
|
+
if (input.author) {
|
|
38
|
+
const authorLower = input.author.toLowerCase();
|
|
39
|
+
intents = intents.filter(i => i.author.toLowerCase().includes(authorLower));
|
|
40
|
+
}
|
|
41
|
+
if (input.since) {
|
|
42
|
+
const sinceDate = new Date(input.since);
|
|
43
|
+
if (!isNaN(sinceDate.getTime())) {
|
|
44
|
+
intents = intents.filter(i => new Date(i.updatedAt) >= sinceDate);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (input.until) {
|
|
48
|
+
const untilDate = new Date(input.until);
|
|
49
|
+
if (!isNaN(untilDate.getTime())) {
|
|
50
|
+
intents = intents.filter(i => new Date(i.updatedAt) <= untilDate);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const total = intents.length;
|
|
54
|
+
const offset = input.offset ?? 0;
|
|
55
|
+
const limit = input.limit ?? 50;
|
|
56
|
+
const paginated = intents.slice(offset, offset + limit);
|
|
57
|
+
const activeCount = paginated.filter(i => i.status === 'active').length;
|
|
58
|
+
const summary = total === 0
|
|
34
59
|
? 'No intents found'
|
|
35
|
-
:
|
|
36
|
-
? `${filteredIntents.length} ${input.status} intent(s)`
|
|
37
|
-
: `${filteredIntents.length} intent(s), ${activeCount} active`;
|
|
60
|
+
: `${paginated.length} intent(s) returned (${total} total${offset > 0 ? `, offset ${offset}` : ''}), ${activeCount} active`;
|
|
38
61
|
return {
|
|
39
|
-
intents:
|
|
40
|
-
count:
|
|
62
|
+
intents: paginated,
|
|
63
|
+
count: total,
|
|
41
64
|
summary
|
|
42
65
|
};
|
|
43
66
|
}
|
|
44
67
|
export const listTeamIntentsTool = {
|
|
45
68
|
name: 'list_team_intents',
|
|
46
|
-
description: `List
|
|
69
|
+
description: `List intents from team members for this repository.
|
|
47
70
|
|
|
48
71
|
Use this to:
|
|
49
72
|
- See what your team is working on
|
|
50
73
|
- Check for potential overlapping work before starting a new task
|
|
51
74
|
- Review the status of various features/refactors in progress
|
|
52
75
|
|
|
53
|
-
|
|
76
|
+
Supports filtering by status, author, and date range. Paginated (default: 50 per page).`,
|
|
54
77
|
inputSchema: listTeamIntentsSchema,
|
|
55
78
|
handler: listTeamIntents
|
|
56
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-team-intents.js","sourceRoot":"","sources":["../../src/tools/list-team-intents.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,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C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AAC,CAAA;QACnE,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAA;IAC5B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,CAAC,CAAA;IAChC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAA;IAC/B,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,CAAA;IAEvD,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,MAAM,CAAA;IACvE,MAAM,OAAO,GAAG,KAAK,KAAK,CAAC;QACzB,CAAC,CAAC,kBAAkB;QACpB,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,wBAAwB,KAAK,SAAS,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,WAAW,SAAS,CAAA;IAE7H,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,KAAK;QACZ,OAAO;KACR,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE;;;;;;;wFAOyE;IACtF,WAAW,EAAE,qBAAqB;IAClC,OAAO,EAAE,eAAe;CACzB,CAAA"}
|
package/build/tools/log-work.js
CHANGED
|
@@ -23,7 +23,7 @@ export async function logWork(input) {
|
|
|
23
23
|
}
|
|
24
24
|
export const logWorkTool = {
|
|
25
25
|
name: 'log_work',
|
|
26
|
-
description: '
|
|
26
|
+
description: 'DEPRECATED — trivial changes (typos, one-line fixes, obvious bugs, doc updates, config changes) should skip the intent workflow entirely: just make the change and commit, no intent needed. Do not call this tool. Kept available for backwards compatibility only and will be removed in a future release.',
|
|
27
27
|
inputSchema: logWorkSchema,
|
|
28
28
|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AAC,QAAQ,IAAI,EAAE,CAAA;IAEnC,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO,KAAK,KAAK;QAC9B,QAAQ;QACR,OAAO,EAAE,YAAY,KAAK,CAAC,KAAK,GAAG;KACpC,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,8SAA8S;IAC3T,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE,OAAO;CACjB,CAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const updateIntentSchema: z.ZodObject<{
|
|
3
|
+
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
4
|
+
repoPath: z.ZodString;
|
|
5
|
+
intentId: z.ZodOptional<z.ZodString>;
|
|
6
|
+
title: z.ZodOptional<z.ZodString>;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
9
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
type: z.ZodEnum<["repo", "folder", "files"]>;
|
|
11
|
+
paths: z.ZodArray<z.ZodString, "many">;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
type: "repo" | "files" | "folder";
|
|
14
|
+
paths: string[];
|
|
15
|
+
}, {
|
|
16
|
+
type: "repo" | "files" | "folder";
|
|
17
|
+
paths: string[];
|
|
18
|
+
}>>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
repoPath: string;
|
|
21
|
+
repoOrigin?: string | undefined;
|
|
22
|
+
title?: string | undefined;
|
|
23
|
+
description?: string | undefined;
|
|
24
|
+
constraints?: string[] | undefined;
|
|
25
|
+
intentId?: string | undefined;
|
|
26
|
+
scope?: {
|
|
27
|
+
type: "repo" | "files" | "folder";
|
|
28
|
+
paths: string[];
|
|
29
|
+
} | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
repoPath: string;
|
|
32
|
+
repoOrigin?: string | undefined;
|
|
33
|
+
title?: string | undefined;
|
|
34
|
+
description?: string | undefined;
|
|
35
|
+
constraints?: string[] | undefined;
|
|
36
|
+
intentId?: string | undefined;
|
|
37
|
+
scope?: {
|
|
38
|
+
type: "repo" | "files" | "folder";
|
|
39
|
+
paths: string[];
|
|
40
|
+
} | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
export type UpdateIntentInput = z.infer<typeof updateIntentSchema>;
|
|
43
|
+
export interface UpdateIntentResponse {
|
|
44
|
+
success: boolean;
|
|
45
|
+
intentId: string;
|
|
46
|
+
message: string;
|
|
47
|
+
updatedFields: string[];
|
|
48
|
+
warning?: string;
|
|
49
|
+
}
|
|
50
|
+
export declare function updateIntent(input: UpdateIntentInput): Promise<UpdateIntentResponse>;
|
|
51
|
+
export declare const updateIntentTool: {
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
inputSchema: z.ZodObject<{
|
|
55
|
+
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
56
|
+
repoPath: z.ZodString;
|
|
57
|
+
intentId: z.ZodOptional<z.ZodString>;
|
|
58
|
+
title: z.ZodOptional<z.ZodString>;
|
|
59
|
+
description: z.ZodOptional<z.ZodString>;
|
|
60
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
61
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
type: z.ZodEnum<["repo", "folder", "files"]>;
|
|
63
|
+
paths: z.ZodArray<z.ZodString, "many">;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
type: "repo" | "files" | "folder";
|
|
66
|
+
paths: string[];
|
|
67
|
+
}, {
|
|
68
|
+
type: "repo" | "files" | "folder";
|
|
69
|
+
paths: string[];
|
|
70
|
+
}>>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
repoPath: string;
|
|
73
|
+
repoOrigin?: string | undefined;
|
|
74
|
+
title?: string | undefined;
|
|
75
|
+
description?: string | undefined;
|
|
76
|
+
constraints?: string[] | undefined;
|
|
77
|
+
intentId?: string | undefined;
|
|
78
|
+
scope?: {
|
|
79
|
+
type: "repo" | "files" | "folder";
|
|
80
|
+
paths: string[];
|
|
81
|
+
} | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
repoPath: string;
|
|
84
|
+
repoOrigin?: string | undefined;
|
|
85
|
+
title?: string | undefined;
|
|
86
|
+
description?: string | undefined;
|
|
87
|
+
constraints?: string[] | undefined;
|
|
88
|
+
intentId?: string | undefined;
|
|
89
|
+
scope?: {
|
|
90
|
+
type: "repo" | "files" | "folder";
|
|
91
|
+
paths: string[];
|
|
92
|
+
} | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
handler: typeof updateIntent;
|
|
95
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { request } from '../services/muninn-ipc.js';
|
|
3
|
+
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
+
export const updateIntentSchema = z.object({
|
|
5
|
+
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
6
|
+
repoPath: z.string().describe('Local path to the repository root'),
|
|
7
|
+
intentId: z.string().optional().describe('ID of the intent to update. If omitted, updates the currently active intent.'),
|
|
8
|
+
title: z.string().max(200).optional().describe('Updated title for the intent'),
|
|
9
|
+
description: z.string().max(2000).optional().describe('Updated description for the intent'),
|
|
10
|
+
constraints: z.array(z.string()).optional().describe('Updated constraints for this work'),
|
|
11
|
+
scope: z.object({
|
|
12
|
+
type: z.enum(['repo', 'folder', 'files']),
|
|
13
|
+
paths: z.array(z.string())
|
|
14
|
+
}).optional().describe('Updated scope for the intent'),
|
|
15
|
+
});
|
|
16
|
+
export async function updateIntent(input) {
|
|
17
|
+
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
18
|
+
// Resolve the intent ID: use provided intentId, or look up the active intent
|
|
19
|
+
let intentId = input.intentId;
|
|
20
|
+
if (!intentId) {
|
|
21
|
+
const activeRes = await request('intent', 'get-active', { repoOrigin: actualOrigin });
|
|
22
|
+
intentId = activeRes.intentId || activeRes.intent?.id || '';
|
|
23
|
+
if (!intentId) {
|
|
24
|
+
return {
|
|
25
|
+
success: false,
|
|
26
|
+
intentId: '',
|
|
27
|
+
message: 'No active intent found and no intentId provided. Create an intent first or provide an intentId.',
|
|
28
|
+
updatedFields: [],
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Build the updates object from provided fields
|
|
33
|
+
const updates = {};
|
|
34
|
+
const updatedFields = [];
|
|
35
|
+
if (input.title !== undefined) {
|
|
36
|
+
updates.title = input.title;
|
|
37
|
+
updatedFields.push('title');
|
|
38
|
+
}
|
|
39
|
+
if (input.description !== undefined) {
|
|
40
|
+
updates.description = input.description;
|
|
41
|
+
updatedFields.push('description');
|
|
42
|
+
}
|
|
43
|
+
if (input.constraints !== undefined) {
|
|
44
|
+
updates.constraints = input.constraints;
|
|
45
|
+
updatedFields.push('constraints');
|
|
46
|
+
}
|
|
47
|
+
if (input.scope !== undefined) {
|
|
48
|
+
updates.scope = input.scope;
|
|
49
|
+
updatedFields.push('scope');
|
|
50
|
+
}
|
|
51
|
+
if (updatedFields.length === 0) {
|
|
52
|
+
return {
|
|
53
|
+
success: false,
|
|
54
|
+
intentId,
|
|
55
|
+
message: 'No fields to update. Provide at least one of: title, description, constraints, scope.',
|
|
56
|
+
updatedFields: [],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const res = await request('intent', 'update', {
|
|
60
|
+
id: intentId,
|
|
61
|
+
updates,
|
|
62
|
+
});
|
|
63
|
+
if (res.success === false) {
|
|
64
|
+
return {
|
|
65
|
+
success: false,
|
|
66
|
+
intentId,
|
|
67
|
+
message: res.error || 'Intent update failed',
|
|
68
|
+
updatedFields: [],
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
success: true,
|
|
73
|
+
intentId,
|
|
74
|
+
message: `Intent updated: ${updatedFields.join(', ')}`,
|
|
75
|
+
updatedFields,
|
|
76
|
+
warning: res.warning,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export const updateIntentTool = {
|
|
80
|
+
name: 'update_intent',
|
|
81
|
+
description: `Update an active intent's title, description, scope, or constraints.
|
|
82
|
+
|
|
83
|
+
Use this to reformulate an intent as understanding evolves during work. Intents are
|
|
84
|
+
living documents — they should be updated to reflect what the work actually became,
|
|
85
|
+
not left as the initial guess. Common triggers for reformulation:
|
|
86
|
+
- The real problem turned out to be different from the initial hypothesis
|
|
87
|
+
- Scope expanded or narrowed during investigation
|
|
88
|
+
- The approach changed after discovering constraints
|
|
89
|
+
|
|
90
|
+
If no intentId is provided, the currently active intent is updated.`,
|
|
91
|
+
inputSchema: updateIntentSchema,
|
|
92
|
+
handler: updateIntent
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=update-intent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-intent.js","sourceRoot":"","sources":["../../src/tools/update-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,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,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,8EAA8E,CAAC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YACR,OAAO,EAAE,GAAG,CAAC,KAAK,IAAI,sBAAsB;YAC5C,aAAa,EAAE,EAAE;SAClB,CAAA;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,QAAQ;QACR,OAAO,EAAE,mBAAmB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACtD,aAAa;QACb,OAAO,EAAE,GAAG,CAAC,OAAO;KACrB,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE;;;;;;;;;oEASqD;IAClE,WAAW,EAAE,kBAAkB;IAC/B,OAAO,EAAE,YAAY;CACtB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const assignBlocksSchema: z.ZodObject<{
|
|
3
|
-
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
4
|
-
repoPath: z.ZodString;
|
|
5
|
-
intentId: z.ZodString;
|
|
6
|
-
blocks: z.ZodArray<z.ZodObject<{
|
|
7
|
-
filePath: z.ZodString;
|
|
8
|
-
startLine: z.ZodNumber;
|
|
9
|
-
endLine: z.ZodNumber;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
filePath: string;
|
|
12
|
-
startLine: number;
|
|
13
|
-
endLine: number;
|
|
14
|
-
}, {
|
|
15
|
-
filePath: string;
|
|
16
|
-
startLine: number;
|
|
17
|
-
endLine: number;
|
|
18
|
-
}>, "many">;
|
|
19
|
-
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
repoPath: string;
|
|
21
|
-
intentId: string;
|
|
22
|
-
blocks: {
|
|
23
|
-
filePath: string;
|
|
24
|
-
startLine: number;
|
|
25
|
-
endLine: number;
|
|
26
|
-
}[];
|
|
27
|
-
repoOrigin?: string | undefined;
|
|
28
|
-
}, {
|
|
29
|
-
repoPath: string;
|
|
30
|
-
intentId: string;
|
|
31
|
-
blocks: {
|
|
32
|
-
filePath: string;
|
|
33
|
-
startLine: number;
|
|
34
|
-
endLine: number;
|
|
35
|
-
}[];
|
|
36
|
-
repoOrigin?: string | undefined;
|
|
37
|
-
}>;
|
|
38
|
-
export type AssignBlocksInput = z.infer<typeof assignBlocksSchema>;
|
|
39
|
-
export interface AssignBlocksResponse {
|
|
40
|
-
success: boolean;
|
|
41
|
-
assignedBlocks: number;
|
|
42
|
-
intentId: string;
|
|
43
|
-
intentTitle: string;
|
|
44
|
-
message: string;
|
|
45
|
-
}
|
|
46
|
-
export declare function assignBlocksToIntent(input: AssignBlocksInput): Promise<AssignBlocksResponse>;
|
|
47
|
-
export declare const assignBlocksToIntentTool: {
|
|
48
|
-
name: string;
|
|
49
|
-
description: string;
|
|
50
|
-
inputSchema: z.ZodObject<{
|
|
51
|
-
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
52
|
-
repoPath: z.ZodString;
|
|
53
|
-
intentId: z.ZodString;
|
|
54
|
-
blocks: z.ZodArray<z.ZodObject<{
|
|
55
|
-
filePath: z.ZodString;
|
|
56
|
-
startLine: z.ZodNumber;
|
|
57
|
-
endLine: z.ZodNumber;
|
|
58
|
-
}, "strip", z.ZodTypeAny, {
|
|
59
|
-
filePath: string;
|
|
60
|
-
startLine: number;
|
|
61
|
-
endLine: number;
|
|
62
|
-
}, {
|
|
63
|
-
filePath: string;
|
|
64
|
-
startLine: number;
|
|
65
|
-
endLine: number;
|
|
66
|
-
}>, "many">;
|
|
67
|
-
}, "strip", z.ZodTypeAny, {
|
|
68
|
-
repoPath: string;
|
|
69
|
-
intentId: string;
|
|
70
|
-
blocks: {
|
|
71
|
-
filePath: string;
|
|
72
|
-
startLine: number;
|
|
73
|
-
endLine: number;
|
|
74
|
-
}[];
|
|
75
|
-
repoOrigin?: string | undefined;
|
|
76
|
-
}, {
|
|
77
|
-
repoPath: string;
|
|
78
|
-
intentId: string;
|
|
79
|
-
blocks: {
|
|
80
|
-
filePath: string;
|
|
81
|
-
startLine: number;
|
|
82
|
-
endLine: number;
|
|
83
|
-
}[];
|
|
84
|
-
repoOrigin?: string | undefined;
|
|
85
|
-
}>;
|
|
86
|
-
handler: typeof assignBlocksToIntent;
|
|
87
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { request } from '../services/muninn-ipc.js';
|
|
3
|
-
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
-
export const assignBlocksSchema = z.object({
|
|
5
|
-
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
6
|
-
repoPath: z.string().describe('Local path to the repository root'),
|
|
7
|
-
intentId: z.string().describe('The intent ID to assign blocks to'),
|
|
8
|
-
blocks: z.array(z.object({
|
|
9
|
-
filePath: z.string().describe('Path to the file (relative to repo root)'),
|
|
10
|
-
startLine: z.number().min(1).describe('Start line number (1-based)'),
|
|
11
|
-
endLine: z.number().min(1).describe('End line number (1-based, inclusive)')
|
|
12
|
-
})).describe('Code blocks to assign to the active intent')
|
|
13
|
-
});
|
|
14
|
-
export async function assignBlocksToIntent(input) {
|
|
15
|
-
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
16
|
-
// Delegate all file I/O, encryption, and API sync to Muninn
|
|
17
|
-
const res = await request('intent-block', 'batch-assign', {
|
|
18
|
-
repoOrigin: actualOrigin,
|
|
19
|
-
repoPath: input.repoPath,
|
|
20
|
-
intentId: input.intentId,
|
|
21
|
-
blocks: input.blocks.map(b => ({
|
|
22
|
-
filePath: b.filePath,
|
|
23
|
-
startLine: b.startLine,
|
|
24
|
-
endLine: b.endLine,
|
|
25
|
-
})),
|
|
26
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
success: res.success !== false,
|
|
29
|
-
assignedBlocks: res.count || res.assignedCount || input.blocks.length,
|
|
30
|
-
intentId: res.intentId || '',
|
|
31
|
-
intentTitle: res.intentTitle || 'Active Intent',
|
|
32
|
-
message: `Assigned ${res.count || input.blocks.length} code block(s) to active intent`
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export const assignBlocksToIntentTool = {
|
|
36
|
-
name: 'assign_blocks_to_intent',
|
|
37
|
-
description: `Assign code blocks to the currently active intent.
|
|
38
|
-
|
|
39
|
-
Call this AFTER writing code to track which lines were modified:
|
|
40
|
-
1. For each file you modified, provide the line range
|
|
41
|
-
2. Blocks get assigned to the active intent
|
|
42
|
-
3. This enables tracking, conflict detection, and team visibility
|
|
43
|
-
|
|
44
|
-
Example: After adding a function at lines 50-75 in auth.ts, call with:
|
|
45
|
-
{ blocks: [{ filePath: "src/auth.ts", startLine: 50, endLine: 75 }] }`,
|
|
46
|
-
inputSchema: assignBlocksSchema,
|
|
47
|
-
handler: assignBlocksToIntent
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=assign-blocks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assign-blocks.js","sourceRoot":"","sources":["../../src/tools/assign-blocks.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,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,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,CAAC,mCAAmC,CAAC;IAClE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACvB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,Q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