@kawacode/mcp 5.2.2 → 6.1.1
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 +11 -3
- 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 +201 -0
- package/build/kawacode-on-pre-edit.js.map +1 -0
- package/build/kawacode-on-stop.d.ts +33 -0
- package/build/kawacode-on-stop.js +88 -0
- package/build/kawacode-on-stop.js.map +1 -0
- package/build/pre-edit/path-resolve.d.ts +32 -0
- package/build/pre-edit/path-resolve.js +52 -0
- package/build/pre-edit/path-resolve.js.map +1 -0
- package/build/pre-edit/path-resolve.test.d.ts +1 -0
- package/build/pre-edit/path-resolve.test.js +105 -0
- package/build/pre-edit/path-resolve.test.js.map +1 -0
- package/build/prompts/intent-first-workflow.js +2 -2
- package/build/services/muninn-ipc.js +11 -3
- 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 +138 -12
- 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 +76 -12
- package/build/tools/edit-session-decision.js +11 -2
- 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 +54 -0
- package/build/tools/get-relevant-context.js +19 -24
- package/build/tools/get-relevant-context.js.map +1 -1
- package/build/tools/get-session-decisions.d.ts +53 -0
- package/build/tools/get-session-decisions.js +6 -2
- package/build/tools/get-session-decisions.js.map +1 -1
- package/build/tools/index.d.ts +628 -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 +28 -15
- 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 +94 -12
- package/build/tools/record-decision.js +18 -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,5 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const getIntentsForFileSchema: 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
|
filePath: z.ZodString;
|
|
@@ -7,10 +21,22 @@ export declare const getIntentsForFileSchema: z.ZodObject<{
|
|
|
7
21
|
repoPath: string;
|
|
8
22
|
filePath: string;
|
|
9
23
|
repoOrigin?: string | undefined;
|
|
24
|
+
forkAuthor?: {
|
|
25
|
+
platform: "github" | "gitlab";
|
|
26
|
+
user: string;
|
|
27
|
+
forkOrigin: string;
|
|
28
|
+
} | undefined;
|
|
29
|
+
workspaceId?: string | undefined;
|
|
10
30
|
}, {
|
|
11
31
|
repoPath: string;
|
|
12
32
|
filePath: string;
|
|
13
33
|
repoOrigin?: string | undefined;
|
|
34
|
+
forkAuthor?: {
|
|
35
|
+
platform: "github" | "gitlab";
|
|
36
|
+
user: string;
|
|
37
|
+
forkOrigin: string;
|
|
38
|
+
} | undefined;
|
|
39
|
+
workspaceId?: string | undefined;
|
|
14
40
|
}>;
|
|
15
41
|
export type GetIntentsForFileInput = z.infer<typeof getIntentsForFileSchema>;
|
|
16
42
|
export interface FileIntentBlock {
|
|
@@ -41,6 +67,20 @@ export declare const getIntentsForFileTool: {
|
|
|
41
67
|
name: string;
|
|
42
68
|
description: string;
|
|
43
69
|
inputSchema: z.ZodObject<{
|
|
70
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
71
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
72
|
+
user: z.ZodString;
|
|
73
|
+
forkOrigin: z.ZodString;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
platform: "github" | "gitlab";
|
|
76
|
+
user: string;
|
|
77
|
+
forkOrigin: string;
|
|
78
|
+
}, {
|
|
79
|
+
platform: "github" | "gitlab";
|
|
80
|
+
user: string;
|
|
81
|
+
forkOrigin: string;
|
|
82
|
+
}>>;
|
|
83
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
44
84
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
45
85
|
repoPath: z.ZodString;
|
|
46
86
|
filePath: z.ZodString;
|
|
@@ -48,10 +88,22 @@ export declare const getIntentsForFileTool: {
|
|
|
48
88
|
repoPath: string;
|
|
49
89
|
filePath: string;
|
|
50
90
|
repoOrigin?: string | undefined;
|
|
91
|
+
forkAuthor?: {
|
|
92
|
+
platform: "github" | "gitlab";
|
|
93
|
+
user: string;
|
|
94
|
+
forkOrigin: string;
|
|
95
|
+
} | undefined;
|
|
96
|
+
workspaceId?: string | undefined;
|
|
51
97
|
}, {
|
|
52
98
|
repoPath: string;
|
|
53
99
|
filePath: string;
|
|
54
100
|
repoOrigin?: string | undefined;
|
|
101
|
+
forkAuthor?: {
|
|
102
|
+
platform: "github" | "gitlab";
|
|
103
|
+
user: string;
|
|
104
|
+
forkOrigin: string;
|
|
105
|
+
} | undefined;
|
|
106
|
+
workspaceId?: string | undefined;
|
|
55
107
|
}>;
|
|
56
108
|
handler: typeof getIntentsForFile;
|
|
57
109
|
};
|
|
@@ -1,16 +1,19 @@
|
|
|
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 getIntentsForFileSchema = 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
|
-
filePath: z.string().describe('Path to the file (relative to repo root)')
|
|
8
|
+
filePath: z.string().describe('Path to the file (relative to repo root)'),
|
|
9
|
+
...forkFieldsExtensions,
|
|
8
10
|
});
|
|
9
11
|
export async function getIntentsForFile(input) {
|
|
10
12
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
11
13
|
const res = await request('intent-block', 'get-for-file', {
|
|
12
14
|
repoOrigin: actualOrigin,
|
|
13
15
|
filePath: input.filePath,
|
|
16
|
+
...extractForkFields(input),
|
|
14
17
|
});
|
|
15
18
|
const intents = (res.intents || []).map((intent) => ({
|
|
16
19
|
intentId: intent.intentId || intent.id || '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-intents-for-file.js","sourceRoot":"","sources":["../../src/tools/get-intents-for-file.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":"get-intents-for-file.js","sourceRoot":"","sources":["../../src/tools/get-intents-for-file.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,OAA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EAAE,sBAAsB;IAC5B,WAAW,EAAE;;;;;;;2EAO4D;IACzE,WAAW,EAAE,uBAAuB;IACpC,OAAO,EAAE,iBAAiB;CAC3B,CAAA"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const getIntentsForLinesSchema: 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
|
filePath: z.ZodString;
|
|
@@ -11,12 +25,24 @@ export declare const getIntentsForLinesSchema: z.ZodObject<{
|
|
|
11
25
|
startLine: number;
|
|
12
26
|
endLine: number;
|
|
13
27
|
repoOrigin?: string | undefined;
|
|
28
|
+
forkAuthor?: {
|
|
29
|
+
platform: "github" | "gitlab";
|
|
30
|
+
user: string;
|
|
31
|
+
forkOrigin: string;
|
|
32
|
+
} | undefined;
|
|
33
|
+
workspaceId?: string | undefined;
|
|
14
34
|
}, {
|
|
15
35
|
repoPath: string;
|
|
16
36
|
filePath: string;
|
|
17
37
|
startLine: number;
|
|
18
38
|
endLine: number;
|
|
19
39
|
repoOrigin?: string | undefined;
|
|
40
|
+
forkAuthor?: {
|
|
41
|
+
platform: "github" | "gitlab";
|
|
42
|
+
user: string;
|
|
43
|
+
forkOrigin: string;
|
|
44
|
+
} | undefined;
|
|
45
|
+
workspaceId?: string | undefined;
|
|
20
46
|
}>;
|
|
21
47
|
export type GetIntentsForLinesInput = z.infer<typeof getIntentsForLinesSchema>;
|
|
22
48
|
export interface LineRangeIntent {
|
|
@@ -49,6 +75,20 @@ export declare const getIntentsForLinesTool: {
|
|
|
49
75
|
name: string;
|
|
50
76
|
description: string;
|
|
51
77
|
inputSchema: z.ZodObject<{
|
|
78
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
79
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
80
|
+
user: z.ZodString;
|
|
81
|
+
forkOrigin: z.ZodString;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
platform: "github" | "gitlab";
|
|
84
|
+
user: string;
|
|
85
|
+
forkOrigin: string;
|
|
86
|
+
}, {
|
|
87
|
+
platform: "github" | "gitlab";
|
|
88
|
+
user: string;
|
|
89
|
+
forkOrigin: string;
|
|
90
|
+
}>>;
|
|
91
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
52
92
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
53
93
|
repoPath: z.ZodString;
|
|
54
94
|
filePath: z.ZodString;
|
|
@@ -60,12 +100,24 @@ export declare const getIntentsForLinesTool: {
|
|
|
60
100
|
startLine: number;
|
|
61
101
|
endLine: number;
|
|
62
102
|
repoOrigin?: string | undefined;
|
|
103
|
+
forkAuthor?: {
|
|
104
|
+
platform: "github" | "gitlab";
|
|
105
|
+
user: string;
|
|
106
|
+
forkOrigin: string;
|
|
107
|
+
} | undefined;
|
|
108
|
+
workspaceId?: string | undefined;
|
|
63
109
|
}, {
|
|
64
110
|
repoPath: string;
|
|
65
111
|
filePath: string;
|
|
66
112
|
startLine: number;
|
|
67
113
|
endLine: number;
|
|
68
114
|
repoOrigin?: string | undefined;
|
|
115
|
+
forkAuthor?: {
|
|
116
|
+
platform: "github" | "gitlab";
|
|
117
|
+
user: string;
|
|
118
|
+
forkOrigin: string;
|
|
119
|
+
} | undefined;
|
|
120
|
+
workspaceId?: string | undefined;
|
|
69
121
|
}>;
|
|
70
122
|
handler: typeof getIntentsForLines;
|
|
71
123
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
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 getIntentsForLinesSchema = 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
|
filePath: z.string().describe('Path to the file (relative to repo root)'),
|
|
8
9
|
startLine: z.number().min(1).describe('Start line number (1-based)'),
|
|
9
|
-
endLine: z.number().min(1).describe('End line number (1-based, inclusive)')
|
|
10
|
+
endLine: z.number().min(1).describe('End line number (1-based, inclusive)'),
|
|
11
|
+
...forkFieldsExtensions,
|
|
10
12
|
});
|
|
11
13
|
export async function getIntentsForLines(input) {
|
|
12
14
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -15,6 +17,7 @@ export async function getIntentsForLines(input) {
|
|
|
15
17
|
filePath: input.filePath,
|
|
16
18
|
startLine: input.startLine,
|
|
17
19
|
endLine: input.endLine,
|
|
20
|
+
...extractForkFields(input),
|
|
18
21
|
});
|
|
19
22
|
const overlappingIntents = (res.intents || []).map((intent) => ({
|
|
20
23
|
intentId: intent.intentId || intent.id || '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-intents-for-lines.js","sourceRoot":"","sources":["../../src/tools/get-intents-for-lines.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;
|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AAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;YAC9E,OAAO,GAAG,SAAS,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,OAAO,iCAAiC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,cAAc,EAAE,CAAA;QAC5H,CAAC;IACH,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,UAAU,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;QAClE,OAAO,EAAE,kBAAkB;QAC3B,UAAU;QACV,OAAO;KACR,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE;;;;;;;gFAOiE;IAC9E,WAAW,EAAE,wBAAwB;IACrC,OAAO,EAAE,kBAAkB;CAC5B,CAAA"}
|
|
@@ -1,13 +1,39 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const getProjectDecisionsSchema: 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
|
}, "strip", z.ZodTypeAny, {
|
|
6
20
|
repoPath: string;
|
|
7
21
|
repoOrigin?: string | undefined;
|
|
22
|
+
forkAuthor?: {
|
|
23
|
+
platform: "github" | "gitlab";
|
|
24
|
+
user: string;
|
|
25
|
+
forkOrigin: string;
|
|
26
|
+
} | undefined;
|
|
27
|
+
workspaceId?: string | undefined;
|
|
8
28
|
}, {
|
|
9
29
|
repoPath: string;
|
|
10
30
|
repoOrigin?: string | undefined;
|
|
31
|
+
forkAuthor?: {
|
|
32
|
+
platform: "github" | "gitlab";
|
|
33
|
+
user: string;
|
|
34
|
+
forkOrigin: string;
|
|
35
|
+
} | undefined;
|
|
36
|
+
workspaceId?: string | undefined;
|
|
11
37
|
}>;
|
|
12
38
|
export type GetProjectDecisionsInput = z.infer<typeof getProjectDecisionsSchema>;
|
|
13
39
|
export interface ConstraintViolation {
|
|
@@ -39,14 +65,40 @@ export declare const getProjectDecisionsTool: {
|
|
|
39
65
|
name: string;
|
|
40
66
|
description: string;
|
|
41
67
|
inputSchema: z.ZodObject<{
|
|
68
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
69
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
70
|
+
user: z.ZodString;
|
|
71
|
+
forkOrigin: z.ZodString;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
platform: "github" | "gitlab";
|
|
74
|
+
user: string;
|
|
75
|
+
forkOrigin: string;
|
|
76
|
+
}, {
|
|
77
|
+
platform: "github" | "gitlab";
|
|
78
|
+
user: string;
|
|
79
|
+
forkOrigin: string;
|
|
80
|
+
}>>;
|
|
81
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
42
82
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
43
83
|
repoPath: z.ZodString;
|
|
44
84
|
}, "strip", z.ZodTypeAny, {
|
|
45
85
|
repoPath: string;
|
|
46
86
|
repoOrigin?: string | undefined;
|
|
87
|
+
forkAuthor?: {
|
|
88
|
+
platform: "github" | "gitlab";
|
|
89
|
+
user: string;
|
|
90
|
+
forkOrigin: string;
|
|
91
|
+
} | undefined;
|
|
92
|
+
workspaceId?: string | undefined;
|
|
47
93
|
}, {
|
|
48
94
|
repoPath: string;
|
|
49
95
|
repoOrigin?: string | undefined;
|
|
96
|
+
forkAuthor?: {
|
|
97
|
+
platform: "github" | "gitlab";
|
|
98
|
+
user: string;
|
|
99
|
+
forkOrigin: string;
|
|
100
|
+
} | undefined;
|
|
101
|
+
workspaceId?: string | undefined;
|
|
50
102
|
}>;
|
|
51
103
|
handler: typeof getProjectDecisions;
|
|
52
104
|
};
|
|
@@ -1,14 +1,17 @@
|
|
|
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 getProjectDecisionsSchema = z.object({
|
|
5
6
|
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
|
+
repoPath: z.string().describe('Local path to the repository root'),
|
|
8
|
+
...forkFieldsExtensions,
|
|
7
9
|
});
|
|
8
10
|
export async function getProjectDecisions(input) {
|
|
9
11
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
10
12
|
const res = await request('decision', 'project-list', {
|
|
11
13
|
repoOrigin: actualOrigin,
|
|
14
|
+
...extractForkFields(input),
|
|
12
15
|
});
|
|
13
16
|
const decisions = (res.decisions || []).map((d) => ({
|
|
14
17
|
intentId: d.intent_id || d.intentId || d.intent_ids?.[0] || d.intentIds?.[0] || '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-project-decisions.js","sourceRoot":"","sources":["../../src/tools/get-project-decisions.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":"get-project-decisions.js","sourceRoot":"","sources":["../../src/tools/get-project-decisions.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,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6EAA6E,CAAC;IACzH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAClE,GAAG,oBAAoB;CACxB,CAAC,CAAA;AA+BF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,KAA+B;IACvE,MAAM,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IACpE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,cAAc,EAAE;QACpD,UAAU,EAAE,YAAY;QACxB,GAAG,iBAAiB,CAAC,KAAK,CAAC;KAC5B,CAAC,CAAA;IAEF,MAAM,SAAS,GAAsB,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC;QAC1E,QAAQ,EAAE,CAAC,C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CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE;;;;;;;;;;;;;;;;;;sEAkBuD;IACpE,WAAW,EAAE,yBAAyB;IACtC,OAAO,EAAE,mBAAmB;CAC7B,CAAA"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const getRelevantContextSchema: 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
|
prompt: z.ZodString;
|
|
@@ -14,11 +28,23 @@ export declare const getRelevantContextSchema: z.ZodObject<{
|
|
|
14
28
|
maxDecisions: number;
|
|
15
29
|
minRelevance: number;
|
|
16
30
|
repoOrigin?: string | undefined;
|
|
31
|
+
forkAuthor?: {
|
|
32
|
+
platform: "github" | "gitlab";
|
|
33
|
+
user: string;
|
|
34
|
+
forkOrigin: string;
|
|
35
|
+
} | undefined;
|
|
36
|
+
workspaceId?: string | undefined;
|
|
17
37
|
activeFiles?: string[] | undefined;
|
|
18
38
|
}, {
|
|
19
39
|
repoPath: string;
|
|
20
40
|
prompt: string;
|
|
21
41
|
repoOrigin?: string | undefined;
|
|
42
|
+
forkAuthor?: {
|
|
43
|
+
platform: "github" | "gitlab";
|
|
44
|
+
user: string;
|
|
45
|
+
forkOrigin: string;
|
|
46
|
+
} | undefined;
|
|
47
|
+
workspaceId?: string | undefined;
|
|
22
48
|
activeFiles?: string[] | undefined;
|
|
23
49
|
maxIntents?: number | undefined;
|
|
24
50
|
maxDecisions?: number | undefined;
|
|
@@ -43,6 +69,8 @@ export interface ScoredDecision {
|
|
|
43
69
|
relatedFiles: string[];
|
|
44
70
|
hasViolations: boolean;
|
|
45
71
|
score: number;
|
|
72
|
+
/** Trigger condition / "How to apply". Present only when the original decision was strong-signal enough to carry one. */
|
|
73
|
+
appliesWhen?: string;
|
|
46
74
|
}
|
|
47
75
|
export interface GetRelevantContextResponse {
|
|
48
76
|
projectOrigin: string;
|
|
@@ -62,6 +90,20 @@ export declare const getRelevantContextTool: {
|
|
|
62
90
|
name: string;
|
|
63
91
|
description: string;
|
|
64
92
|
inputSchema: z.ZodObject<{
|
|
93
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
94
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
95
|
+
user: z.ZodString;
|
|
96
|
+
forkOrigin: z.ZodString;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
platform: "github" | "gitlab";
|
|
99
|
+
user: string;
|
|
100
|
+
forkOrigin: string;
|
|
101
|
+
}, {
|
|
102
|
+
platform: "github" | "gitlab";
|
|
103
|
+
user: string;
|
|
104
|
+
forkOrigin: string;
|
|
105
|
+
}>>;
|
|
106
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
65
107
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
66
108
|
repoPath: z.ZodString;
|
|
67
109
|
prompt: z.ZodString;
|
|
@@ -76,11 +118,23 @@ export declare const getRelevantContextTool: {
|
|
|
76
118
|
maxDecisions: number;
|
|
77
119
|
minRelevance: number;
|
|
78
120
|
repoOrigin?: string | undefined;
|
|
121
|
+
forkAuthor?: {
|
|
122
|
+
platform: "github" | "gitlab";
|
|
123
|
+
user: string;
|
|
124
|
+
forkOrigin: string;
|
|
125
|
+
} | undefined;
|
|
126
|
+
workspaceId?: string | undefined;
|
|
79
127
|
activeFiles?: string[] | undefined;
|
|
80
128
|
}, {
|
|
81
129
|
repoPath: string;
|
|
82
130
|
prompt: string;
|
|
83
131
|
repoOrigin?: string | undefined;
|
|
132
|
+
forkAuthor?: {
|
|
133
|
+
platform: "github" | "gitlab";
|
|
134
|
+
user: string;
|
|
135
|
+
forkOrigin: string;
|
|
136
|
+
} | undefined;
|
|
137
|
+
workspaceId?: string | undefined;
|
|
84
138
|
activeFiles?: string[] | undefined;
|
|
85
139
|
maxIntents?: number | undefined;
|
|
86
140
|
maxDecisions?: number | undefined;
|
|
@@ -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 getRelevantContextSchema = 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'),
|
|
@@ -8,7 +9,8 @@ export const getRelevantContextSchema = z.object({
|
|
|
8
9
|
activeFiles: z.array(z.string()).optional().describe('Files currently being discussed or recently opened'),
|
|
9
10
|
maxIntents: z.number().optional().default(10).describe('Maximum number of intents to return'),
|
|
10
11
|
maxDecisions: z.number().optional().default(10).describe('Maximum number of decisions to return'),
|
|
11
|
-
minRelevance: z.number().optional().default(0.3).describe('Minimum relevance score (0-1)')
|
|
12
|
+
minRelevance: z.number().optional().default(0.3).describe('Minimum relevance score (0-1)'),
|
|
13
|
+
...forkFieldsExtensions,
|
|
12
14
|
});
|
|
13
15
|
const EMPTY_RESPONSE = (origin, path) => ({
|
|
14
16
|
projectOrigin: origin,
|
|
@@ -33,6 +35,7 @@ export async function getRelevantContext(input) {
|
|
|
33
35
|
maxIntents: input.maxIntents,
|
|
34
36
|
maxDecisions: input.maxDecisions,
|
|
35
37
|
minScore: input.minRelevance,
|
|
38
|
+
...extractForkFields(input),
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
41
|
catch (err) {
|
|
@@ -60,6 +63,7 @@ export async function getRelevantContext(input) {
|
|
|
60
63
|
relatedFiles: d.relatedFiles || d.related_files || [],
|
|
61
64
|
hasViolations: (d.constraintViolations || d.constraint_violations || []).length > 0,
|
|
62
65
|
score: d.score || 0,
|
|
66
|
+
appliesWhen: d.appliesWhen || d.applies_when || d.aw || undefined,
|
|
63
67
|
})),
|
|
64
68
|
summary: {
|
|
65
69
|
totalIntentsSearched: res.summary?.totalIntents || 0,
|
|
@@ -71,34 +75,25 @@ export async function getRelevantContext(input) {
|
|
|
71
75
|
}
|
|
72
76
|
export const getRelevantContextTool = {
|
|
73
77
|
name: 'get_relevant_context',
|
|
74
|
-
description: `Find
|
|
78
|
+
description: `Find past intents and decisions relevant to the current user request.
|
|
75
79
|
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
When to use:
|
|
81
|
+
- After you have done a quick initial exploration of the user's request and know which files are involved. Calling earlier with only a vague prompt gives weak results.
|
|
82
|
+
- To pull task-specific context instead of dumping all recent activity — preferred for large projects.
|
|
78
83
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
The tool:
|
|
84
|
-
1. Sends your prompt to the API for semantic embedding
|
|
85
|
-
2. Computes cosine similarity against stored embeddings for all intents and decisions
|
|
86
|
-
3. Uses \`activeFiles\` to boost items with matching file paths
|
|
87
|
-
4. Returns only the most relevant items above the minimum score threshold
|
|
88
|
-
|
|
89
|
-
**Recommended workflow:**
|
|
90
|
-
1. \`check_active_intent\` at SESSION START (resume existing work)
|
|
91
|
-
2. Explore the user's request (read files, understand scope)
|
|
92
|
-
3. \`get_relevant_context\` with prompt + activeFiles (task-specific context)
|
|
84
|
+
Inputs of note:
|
|
85
|
+
- \`prompt\`: the user request, in their words or your paraphrase.
|
|
86
|
+
- \`activeFiles\` (recommended): files you have identified as relevant to the request. Significantly improves relevance.
|
|
87
|
+
- \`maxIntents\`, \`maxDecisions\`, \`minRelevance\`: result-shaping caps and threshold.
|
|
93
88
|
|
|
94
89
|
Returns:
|
|
95
|
-
-
|
|
96
|
-
-
|
|
90
|
+
- \`relevantIntents\`: past work units (intents) related to the task, scored by relevance.
|
|
91
|
+
- \`relevantDecisions\`: prior decisions related to the task — both intent-scoped and repo-scoped.
|
|
97
92
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
Recommended sequence:
|
|
94
|
+
1. \`check_active_intent\` at session start to resume any existing work.
|
|
95
|
+
2. Briefly explore the user's request to identify involved files.
|
|
96
|
+
3. \`get_relevant_context\` with the prompt and \`activeFiles\` to inform the approach.`,
|
|
102
97
|
inputSchema: getRelevantContextSchema,
|
|
103
98
|
handler: getRelevantContext
|
|
104
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-relevant-context.js","sourceRoot":"","sources":["../../src/tools/get-relevant-context.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":"get-relevant-context.js","sourceRoot":"","sources":["../../src/tools/get-relevant-context.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,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,UAA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eAAe,EAAE,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM;YAC3C,iBAAiB,EAAE,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM;SAChD;KACF,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE;;;;;;;;;;;;;;;;;;wFAkByE;IACtF,WAAW,EAAE,wBAAwB;IACrC,OAAO,EAAE,kBAAkB;CAC5B,CAAA"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const getSessionDecisionsSchema: 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;
|
|
@@ -7,10 +21,22 @@ export declare const getSessionDecisionsSchema: z.ZodObject<{
|
|
|
7
21
|
repoPath: string;
|
|
8
22
|
intentId: string;
|
|
9
23
|
repoOrigin?: string | undefined;
|
|
24
|
+
forkAuthor?: {
|
|
25
|
+
platform: "github" | "gitlab";
|
|
26
|
+
user: string;
|
|
27
|
+
forkOrigin: string;
|
|
28
|
+
} | undefined;
|
|
29
|
+
workspaceId?: string | undefined;
|
|
10
30
|
}, {
|
|
11
31
|
repoPath: string;
|
|
12
32
|
intentId: string;
|
|
13
33
|
repoOrigin?: string | undefined;
|
|
34
|
+
forkAuthor?: {
|
|
35
|
+
platform: "github" | "gitlab";
|
|
36
|
+
user: string;
|
|
37
|
+
forkOrigin: string;
|
|
38
|
+
} | undefined;
|
|
39
|
+
workspaceId?: string | undefined;
|
|
14
40
|
}>;
|
|
15
41
|
export type GetSessionDecisionsInput = z.infer<typeof getSessionDecisionsSchema>;
|
|
16
42
|
export interface ConstraintViolation {
|
|
@@ -31,6 +57,7 @@ export interface DecisionPoint {
|
|
|
31
57
|
relatedFiles: string[];
|
|
32
58
|
constraintsChecked: string[];
|
|
33
59
|
constraintViolations: ConstraintViolation[];
|
|
60
|
+
appliesWhen?: string;
|
|
34
61
|
}
|
|
35
62
|
export interface GetSessionDecisionsResponse {
|
|
36
63
|
intentId: string;
|
|
@@ -43,6 +70,20 @@ export declare const getSessionDecisionsTool: {
|
|
|
43
70
|
name: string;
|
|
44
71
|
description: string;
|
|
45
72
|
inputSchema: z.ZodObject<{
|
|
73
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
75
|
+
user: z.ZodString;
|
|
76
|
+
forkOrigin: z.ZodString;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
platform: "github" | "gitlab";
|
|
79
|
+
user: string;
|
|
80
|
+
forkOrigin: string;
|
|
81
|
+
}, {
|
|
82
|
+
platform: "github" | "gitlab";
|
|
83
|
+
user: string;
|
|
84
|
+
forkOrigin: string;
|
|
85
|
+
}>>;
|
|
86
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
46
87
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
47
88
|
repoPath: z.ZodString;
|
|
48
89
|
intentId: z.ZodString;
|
|
@@ -50,10 +91,22 @@ export declare const getSessionDecisionsTool: {
|
|
|
50
91
|
repoPath: string;
|
|
51
92
|
intentId: string;
|
|
52
93
|
repoOrigin?: string | undefined;
|
|
94
|
+
forkAuthor?: {
|
|
95
|
+
platform: "github" | "gitlab";
|
|
96
|
+
user: string;
|
|
97
|
+
forkOrigin: string;
|
|
98
|
+
} | undefined;
|
|
99
|
+
workspaceId?: string | undefined;
|
|
53
100
|
}, {
|
|
54
101
|
repoPath: string;
|
|
55
102
|
intentId: string;
|
|
56
103
|
repoOrigin?: string | undefined;
|
|
104
|
+
forkAuthor?: {
|
|
105
|
+
platform: "github" | "gitlab";
|
|
106
|
+
user: string;
|
|
107
|
+
forkOrigin: string;
|
|
108
|
+
} | undefined;
|
|
109
|
+
workspaceId?: string | undefined;
|
|
57
110
|
}>;
|
|
58
111
|
handler: typeof getSessionDecisions;
|
|
59
112
|
};
|