@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,11 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { request } from '../services/muninn-ipc.js';
|
|
3
3
|
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
+
import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
4
5
|
export const detectIntentConflictsSchema = z.object({
|
|
5
6
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
6
7
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
7
8
|
intentId: z.string().describe('The active intent ID'),
|
|
8
9
|
minScore: z.number().optional().describe('Minimum similarity score threshold (default: 0.5)'),
|
|
10
|
+
...forkFieldsExtensions,
|
|
9
11
|
});
|
|
10
12
|
export async function detectIntentConflicts(input) {
|
|
11
13
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -13,6 +15,7 @@ export async function detectIntentConflicts(input) {
|
|
|
13
15
|
repoOrigin: actualOrigin,
|
|
14
16
|
intentId: input.intentId,
|
|
15
17
|
minScore: input.minScore,
|
|
18
|
+
...extractForkFields(input),
|
|
16
19
|
});
|
|
17
20
|
if (res.error) {
|
|
18
21
|
return {
|
|
@@ -45,21 +48,22 @@ export async function detectIntentConflicts(input) {
|
|
|
45
48
|
}
|
|
46
49
|
export const detectIntentConflictsTool = {
|
|
47
50
|
name: 'detect_intent_conflicts',
|
|
48
|
-
description: `
|
|
51
|
+
description: `Find intents from other team members that potentially conflict with the active intent.
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
When to use:
|
|
54
|
+
- Before committing, to surface overlapping team work so the user can coordinate before merging.
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
Inputs of note:
|
|
57
|
+
- \`intentId\`: the active intent to check against.
|
|
58
|
+
- \`minScore\` (optional): minimum match score to include in results.
|
|
54
59
|
|
|
55
60
|
Returns scored conflict candidates with:
|
|
56
|
-
- score
|
|
57
|
-
- overlappingFiles
|
|
58
|
-
- decisions
|
|
59
|
-
- author
|
|
61
|
+
- \`score\`: how strongly the candidate matches (higher = more likely conflict).
|
|
62
|
+
- \`overlappingFiles\`: files affected by both intents.
|
|
63
|
+
- \`decisions\`: decisions attached to the conflicting intent.
|
|
64
|
+
- \`author\`: who is working on the conflicting intent.
|
|
60
65
|
|
|
61
|
-
The
|
|
62
|
-
to determine if coordination is needed.`,
|
|
66
|
+
The list is informational — review candidates and their decisions to decide whether coordination is needed.`,
|
|
63
67
|
inputSchema: detectIntentConflictsSchema,
|
|
64
68
|
handler: detectIntentConflicts
|
|
65
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-intent-conflicts.js","sourceRoot":"","sources":["../../src/tools/detect-intent-conflicts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"detect-intent-conflicts.js","sourceRoot":"","sources":["../../src/tools/detect-intent-conflicts.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,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6EAA6E,CAAC;IACzH,QAAQ,EAAE,CAAC,CAAC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gB,IAAI,EAAE;QAC1C,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC;YAC9C,UAAU,EAAE,CAAC,CAAC,UAAU,IAAI,EAAE;YAC9B,OAAO,EAAE,CAAC,CAAC,OAAO,IAAI,EAAE;YACxB,SAAS,EAAE,CAAC,CAAC,SAAS,IAAI,EAAE;YAC5B,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;YAClB,YAAY,EAAE,CAAC,CAAC,YAAY,IAAI,EAAE;SACnC,CAAC,CAAC;KACJ,CAAC,CAAC,CAAA;IAEH,OAAO;QACL,YAAY,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC;QAClC,SAAS;QACT,KAAK,EAAE,SAAS,CAAC,MAAM;KACxB,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE;;;;;;;;;;;;;;;4GAe6F;IAC1G,WAAW,EAAE,2BAA2B;IACxC,OAAO,EAAE,qBAAqB;CAC/B,CAAA"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
3
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
4
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
5
|
+
user: z.ZodString;
|
|
6
|
+
forkOrigin: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
platform: "github" | "gitlab";
|
|
9
|
+
user: string;
|
|
10
|
+
forkOrigin: string;
|
|
11
|
+
}, {
|
|
12
|
+
platform: "github" | "gitlab";
|
|
13
|
+
user: string;
|
|
14
|
+
forkOrigin: string;
|
|
15
|
+
}>>;
|
|
16
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
3
17
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
4
18
|
repoPath: z.ZodString;
|
|
5
19
|
intentId: z.ZodString;
|
|
@@ -18,14 +32,16 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
18
32
|
constraint: z.ZodString;
|
|
19
33
|
reason: z.ZodString;
|
|
20
34
|
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
reason: string;
|
|
21
36
|
alternative: string;
|
|
22
37
|
constraint: string;
|
|
23
|
-
reason: string;
|
|
24
38
|
}, {
|
|
39
|
+
reason: string;
|
|
25
40
|
alternative: string;
|
|
26
41
|
constraint: string;
|
|
27
|
-
reason: string;
|
|
28
42
|
}>, "many">>;
|
|
43
|
+
/** Trigger condition / "How to apply" — pass empty string or null to clear. */
|
|
44
|
+
appliesWhen: z.ZodOptional<z.ZodString>;
|
|
29
45
|
}, "strip", z.ZodTypeAny, {
|
|
30
46
|
context?: string | undefined;
|
|
31
47
|
summary?: string | undefined;
|
|
@@ -35,10 +51,11 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
35
51
|
relatedFiles?: string[] | undefined;
|
|
36
52
|
constraintsChecked?: string[] | undefined;
|
|
37
53
|
constraintViolations?: {
|
|
54
|
+
reason: string;
|
|
38
55
|
alternative: string;
|
|
39
56
|
constraint: string;
|
|
40
|
-
reason: string;
|
|
41
57
|
}[] | undefined;
|
|
58
|
+
appliesWhen?: string | undefined;
|
|
42
59
|
}, {
|
|
43
60
|
context?: string | undefined;
|
|
44
61
|
summary?: string | undefined;
|
|
@@ -48,10 +65,11 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
48
65
|
relatedFiles?: string[] | undefined;
|
|
49
66
|
constraintsChecked?: string[] | undefined;
|
|
50
67
|
constraintViolations?: {
|
|
68
|
+
reason: string;
|
|
51
69
|
alternative: string;
|
|
52
70
|
constraint: string;
|
|
53
|
-
reason: string;
|
|
54
71
|
}[] | undefined;
|
|
72
|
+
appliesWhen?: string | undefined;
|
|
55
73
|
}>>;
|
|
56
74
|
}, "strip", z.ZodTypeAny, {
|
|
57
75
|
repoPath: string;
|
|
@@ -59,6 +77,12 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
59
77
|
action: "update" | "delete";
|
|
60
78
|
decisionId: string;
|
|
61
79
|
repoOrigin?: string | undefined;
|
|
80
|
+
forkAuthor?: {
|
|
81
|
+
platform: "github" | "gitlab";
|
|
82
|
+
user: string;
|
|
83
|
+
forkOrigin: string;
|
|
84
|
+
} | undefined;
|
|
85
|
+
workspaceId?: string | undefined;
|
|
62
86
|
updates?: {
|
|
63
87
|
context?: string | undefined;
|
|
64
88
|
summary?: string | undefined;
|
|
@@ -68,10 +92,11 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
68
92
|
relatedFiles?: string[] | undefined;
|
|
69
93
|
constraintsChecked?: string[] | undefined;
|
|
70
94
|
constraintViolations?: {
|
|
95
|
+
reason: string;
|
|
71
96
|
alternative: string;
|
|
72
97
|
constraint: string;
|
|
73
|
-
reason: string;
|
|
74
98
|
}[] | undefined;
|
|
99
|
+
appliesWhen?: string | undefined;
|
|
75
100
|
} | undefined;
|
|
76
101
|
}, {
|
|
77
102
|
repoPath: string;
|
|
@@ -79,6 +104,12 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
79
104
|
action: "update" | "delete";
|
|
80
105
|
decisionId: string;
|
|
81
106
|
repoOrigin?: string | undefined;
|
|
107
|
+
forkAuthor?: {
|
|
108
|
+
platform: "github" | "gitlab";
|
|
109
|
+
user: string;
|
|
110
|
+
forkOrigin: string;
|
|
111
|
+
} | undefined;
|
|
112
|
+
workspaceId?: string | undefined;
|
|
82
113
|
updates?: {
|
|
83
114
|
context?: string | undefined;
|
|
84
115
|
summary?: string | undefined;
|
|
@@ -88,10 +119,11 @@ export declare const editSessionDecisionSchema: z.ZodObject<{
|
|
|
88
119
|
relatedFiles?: string[] | undefined;
|
|
89
120
|
constraintsChecked?: string[] | undefined;
|
|
90
121
|
constraintViolations?: {
|
|
122
|
+
reason: string;
|
|
91
123
|
alternative: string;
|
|
92
124
|
constraint: string;
|
|
93
|
-
reason: string;
|
|
94
125
|
}[] | undefined;
|
|
126
|
+
appliesWhen?: string | undefined;
|
|
95
127
|
} | undefined;
|
|
96
128
|
}>;
|
|
97
129
|
export type EditSessionDecisionInput = z.infer<typeof editSessionDecisionSchema>;
|
|
@@ -103,6 +135,20 @@ export declare const editSessionDecisionTool: {
|
|
|
103
135
|
name: string;
|
|
104
136
|
description: string;
|
|
105
137
|
inputSchema: z.ZodObject<{
|
|
138
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
139
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
140
|
+
user: z.ZodString;
|
|
141
|
+
forkOrigin: z.ZodString;
|
|
142
|
+
}, "strip", z.ZodTypeAny, {
|
|
143
|
+
platform: "github" | "gitlab";
|
|
144
|
+
user: string;
|
|
145
|
+
forkOrigin: string;
|
|
146
|
+
}, {
|
|
147
|
+
platform: "github" | "gitlab";
|
|
148
|
+
user: string;
|
|
149
|
+
forkOrigin: string;
|
|
150
|
+
}>>;
|
|
151
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
106
152
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
107
153
|
repoPath: z.ZodString;
|
|
108
154
|
intentId: z.ZodString;
|
|
@@ -121,14 +167,16 @@ export declare const editSessionDecisionTool: {
|
|
|
121
167
|
constraint: z.ZodString;
|
|
122
168
|
reason: z.ZodString;
|
|
123
169
|
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
reason: string;
|
|
124
171
|
alternative: string;
|
|
125
172
|
constraint: string;
|
|
126
|
-
reason: string;
|
|
127
173
|
}, {
|
|
174
|
+
reason: string;
|
|
128
175
|
alternative: string;
|
|
129
176
|
constraint: string;
|
|
130
|
-
reason: string;
|
|
131
177
|
}>, "many">>;
|
|
178
|
+
/** Trigger condition / "How to apply" — pass empty string or null to clear. */
|
|
179
|
+
appliesWhen: z.ZodOptional<z.ZodString>;
|
|
132
180
|
}, "strip", z.ZodTypeAny, {
|
|
133
181
|
context?: string | undefined;
|
|
134
182
|
summary?: string | undefined;
|
|
@@ -138,10 +186,11 @@ export declare const editSessionDecisionTool: {
|
|
|
138
186
|
relatedFiles?: string[] | undefined;
|
|
139
187
|
constraintsChecked?: string[] | undefined;
|
|
140
188
|
constraintViolations?: {
|
|
189
|
+
reason: string;
|
|
141
190
|
alternative: string;
|
|
142
191
|
constraint: string;
|
|
143
|
-
reason: string;
|
|
144
192
|
}[] | undefined;
|
|
193
|
+
appliesWhen?: string | undefined;
|
|
145
194
|
}, {
|
|
146
195
|
context?: string | undefined;
|
|
147
196
|
summary?: string | undefined;
|
|
@@ -151,10 +200,11 @@ export declare const editSessionDecisionTool: {
|
|
|
151
200
|
relatedFiles?: string[] | undefined;
|
|
152
201
|
constraintsChecked?: string[] | undefined;
|
|
153
202
|
constraintViolations?: {
|
|
203
|
+
reason: string;
|
|
154
204
|
alternative: string;
|
|
155
205
|
constraint: string;
|
|
156
|
-
reason: string;
|
|
157
206
|
}[] | undefined;
|
|
207
|
+
appliesWhen?: string | undefined;
|
|
158
208
|
}>>;
|
|
159
209
|
}, "strip", z.ZodTypeAny, {
|
|
160
210
|
repoPath: string;
|
|
@@ -162,6 +212,12 @@ export declare const editSessionDecisionTool: {
|
|
|
162
212
|
action: "update" | "delete";
|
|
163
213
|
decisionId: string;
|
|
164
214
|
repoOrigin?: string | undefined;
|
|
215
|
+
forkAuthor?: {
|
|
216
|
+
platform: "github" | "gitlab";
|
|
217
|
+
user: string;
|
|
218
|
+
forkOrigin: string;
|
|
219
|
+
} | undefined;
|
|
220
|
+
workspaceId?: string | undefined;
|
|
165
221
|
updates?: {
|
|
166
222
|
context?: string | undefined;
|
|
167
223
|
summary?: string | undefined;
|
|
@@ -171,10 +227,11 @@ export declare const editSessionDecisionTool: {
|
|
|
171
227
|
relatedFiles?: string[] | undefined;
|
|
172
228
|
constraintsChecked?: string[] | undefined;
|
|
173
229
|
constraintViolations?: {
|
|
230
|
+
reason: string;
|
|
174
231
|
alternative: string;
|
|
175
232
|
constraint: string;
|
|
176
|
-
reason: string;
|
|
177
233
|
}[] | undefined;
|
|
234
|
+
appliesWhen?: string | undefined;
|
|
178
235
|
} | undefined;
|
|
179
236
|
}, {
|
|
180
237
|
repoPath: string;
|
|
@@ -182,6 +239,12 @@ export declare const editSessionDecisionTool: {
|
|
|
182
239
|
action: "update" | "delete";
|
|
183
240
|
decisionId: string;
|
|
184
241
|
repoOrigin?: string | undefined;
|
|
242
|
+
forkAuthor?: {
|
|
243
|
+
platform: "github" | "gitlab";
|
|
244
|
+
user: string;
|
|
245
|
+
forkOrigin: string;
|
|
246
|
+
} | undefined;
|
|
247
|
+
workspaceId?: string | undefined;
|
|
185
248
|
updates?: {
|
|
186
249
|
context?: string | undefined;
|
|
187
250
|
summary?: string | undefined;
|
|
@@ -191,10 +254,11 @@ export declare const editSessionDecisionTool: {
|
|
|
191
254
|
relatedFiles?: string[] | undefined;
|
|
192
255
|
constraintsChecked?: string[] | undefined;
|
|
193
256
|
constraintViolations?: {
|
|
257
|
+
reason: string;
|
|
194
258
|
alternative: string;
|
|
195
259
|
constraint: string;
|
|
196
|
-
reason: string;
|
|
197
260
|
}[] | undefined;
|
|
261
|
+
appliesWhen?: string | undefined;
|
|
198
262
|
} | undefined;
|
|
199
263
|
}>;
|
|
200
264
|
handler: typeof editSessionDecision;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { request } from '../services/muninn-ipc.js';
|
|
3
3
|
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
+
import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
4
5
|
const constraintViolationSchema = z.object({
|
|
5
6
|
alternative: z.string(),
|
|
6
7
|
constraint: z.string(),
|
|
@@ -14,7 +15,9 @@ const decisionUpdatesSchema = z.object({
|
|
|
14
15
|
alternatives: z.array(z.string()).optional(),
|
|
15
16
|
relatedFiles: z.array(z.string()).optional(),
|
|
16
17
|
constraintsChecked: z.array(z.string()).optional(),
|
|
17
|
-
constraintViolations: z.array(constraintViolationSchema).optional()
|
|
18
|
+
constraintViolations: z.array(constraintViolationSchema).optional(),
|
|
19
|
+
/** Trigger condition / "How to apply" — pass empty string or null to clear. */
|
|
20
|
+
appliesWhen: z.string().optional()
|
|
18
21
|
});
|
|
19
22
|
export const editSessionDecisionSchema = z.object({
|
|
20
23
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
@@ -22,7 +25,8 @@ export const editSessionDecisionSchema = z.object({
|
|
|
22
25
|
intentId: z.string().describe('The intent ID the decision belongs to'),
|
|
23
26
|
decisionId: z.string().describe('The decision ID to edit or delete'),
|
|
24
27
|
action: z.enum(['update', 'delete']).describe('Action to perform: update modifies the decision, delete removes it'),
|
|
25
|
-
updates: decisionUpdatesSchema.optional().describe('Partial fields to update (only for action=update)')
|
|
28
|
+
updates: decisionUpdatesSchema.optional().describe('Partial fields to update (only for action=update)'),
|
|
29
|
+
...forkFieldsExtensions,
|
|
26
30
|
});
|
|
27
31
|
export async function editSessionDecision(input) {
|
|
28
32
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -32,6 +36,7 @@ export async function editSessionDecision(input) {
|
|
|
32
36
|
decisionId: input.decisionId,
|
|
33
37
|
action: input.action,
|
|
34
38
|
updates: input.updates,
|
|
39
|
+
...extractForkFields(input),
|
|
35
40
|
});
|
|
36
41
|
return { success: res.success !== false };
|
|
37
42
|
}
|
|
@@ -43,6 +48,10 @@ Use this when reviewing decisions before commit:
|
|
|
43
48
|
- action: "update" - Modify the decision fields
|
|
44
49
|
- action: "delete" - Remove the decision entirely
|
|
45
50
|
|
|
51
|
+
Only ephemeral (in-flight) session decisions are editable. Once a decision is
|
|
52
|
+
synced to Kawa Code, it is immutable — refine it instead by recording a new
|
|
53
|
+
decision with \`supersedes: [<id>]\`.
|
|
54
|
+
|
|
46
55
|
This allows users to curate their decision history before it's persisted.`,
|
|
47
56
|
inputSchema: editSessionDecisionSchema,
|
|
48
57
|
handler: editSessionDecision
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-session-decision.js","sourceRoot":"","sources":["../../src/tools/edit-session-decision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"edit-session-decision.js","sourceRoot":"","sources":["../../src/tools/edit-session-decision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE3E,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAA;AAEF,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC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5C,UAAU,EAAE,YAAY;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,GAAG,iBAAiB,CAAC,KAAK,CAAC;KAC5B,CAAC,CAAA;IAEF,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,KAAK,KAAK,EAAE,CAAA;AAC3C,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE;;;;;;;;;;0EAU2D;IACxE,WAAW,EAAE,yBAAyB;IACtC,OAAO,EAAE,mBAAmB;CAC7B,CAAA"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const evolveDecisionsSchema: 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
|
stories: z.ZodArray<z.ZodAny, "many">;
|
|
4
18
|
model: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
5
19
|
repoPath: z.ZodOptional<z.ZodString>;
|
|
@@ -9,10 +23,22 @@ export declare const evolveDecisionsSchema: z.ZodObject<{
|
|
|
9
23
|
stories: any[];
|
|
10
24
|
repoOrigin?: string | undefined;
|
|
11
25
|
repoPath?: string | undefined;
|
|
26
|
+
forkAuthor?: {
|
|
27
|
+
platform: "github" | "gitlab";
|
|
28
|
+
user: string;
|
|
29
|
+
forkOrigin: string;
|
|
30
|
+
} | undefined;
|
|
31
|
+
workspaceId?: string | undefined;
|
|
12
32
|
}, {
|
|
13
33
|
stories: any[];
|
|
14
34
|
repoOrigin?: string | undefined;
|
|
15
35
|
repoPath?: string | undefined;
|
|
36
|
+
forkAuthor?: {
|
|
37
|
+
platform: "github" | "gitlab";
|
|
38
|
+
user: string;
|
|
39
|
+
forkOrigin: string;
|
|
40
|
+
} | undefined;
|
|
41
|
+
workspaceId?: string | undefined;
|
|
16
42
|
model?: string | undefined;
|
|
17
43
|
}>;
|
|
18
44
|
export type EvolveDecisionsInput = z.infer<typeof evolveDecisionsSchema>;
|
|
@@ -25,6 +51,20 @@ export declare const evolveDecisionsTool: {
|
|
|
25
51
|
name: string;
|
|
26
52
|
description: string;
|
|
27
53
|
inputSchema: z.ZodObject<{
|
|
54
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
56
|
+
user: z.ZodString;
|
|
57
|
+
forkOrigin: z.ZodString;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
platform: "github" | "gitlab";
|
|
60
|
+
user: string;
|
|
61
|
+
forkOrigin: string;
|
|
62
|
+
}, {
|
|
63
|
+
platform: "github" | "gitlab";
|
|
64
|
+
user: string;
|
|
65
|
+
forkOrigin: string;
|
|
66
|
+
}>>;
|
|
67
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
28
68
|
stories: z.ZodArray<z.ZodAny, "many">;
|
|
29
69
|
model: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
30
70
|
repoPath: z.ZodOptional<z.ZodString>;
|
|
@@ -34,10 +74,22 @@ export declare const evolveDecisionsTool: {
|
|
|
34
74
|
stories: any[];
|
|
35
75
|
repoOrigin?: string | undefined;
|
|
36
76
|
repoPath?: string | undefined;
|
|
77
|
+
forkAuthor?: {
|
|
78
|
+
platform: "github" | "gitlab";
|
|
79
|
+
user: string;
|
|
80
|
+
forkOrigin: string;
|
|
81
|
+
} | undefined;
|
|
82
|
+
workspaceId?: string | undefined;
|
|
37
83
|
}, {
|
|
38
84
|
stories: any[];
|
|
39
85
|
repoOrigin?: string | undefined;
|
|
40
86
|
repoPath?: string | undefined;
|
|
87
|
+
forkAuthor?: {
|
|
88
|
+
platform: "github" | "gitlab";
|
|
89
|
+
user: string;
|
|
90
|
+
forkOrigin: string;
|
|
91
|
+
} | undefined;
|
|
92
|
+
workspaceId?: string | undefined;
|
|
41
93
|
model?: string | undefined;
|
|
42
94
|
}>;
|
|
43
95
|
handler: typeof evolveDecisions;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { request } from '../services/muninn-ipc.js';
|
|
3
|
+
import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
3
4
|
export const evolveDecisionsSchema = z.object({
|
|
4
5
|
stories: z.array(z.any()).describe('Array of story objects from a previous infer_history run'),
|
|
5
|
-
model: z.string().optional().default('claude-haiku-4-5-20251001').describe('Anthropic model for
|
|
6
|
+
model: z.string().optional().default('claude-haiku-4-5-20251001').describe('Anthropic model used for the curation pass (default: claude-haiku-4-5-20251001).'),
|
|
6
7
|
repoPath: z.string().optional().describe('Local path to the repository root (required for auto-persist after evolution)'),
|
|
7
8
|
repoOrigin: z.string().optional().describe('Git remote origin URL (auto-detected from repoPath if not provided)'),
|
|
9
|
+
...forkFieldsExtensions,
|
|
8
10
|
});
|
|
9
11
|
export async function evolveDecisions(input) {
|
|
10
12
|
const res = await request('inference', 'evolve', {
|
|
@@ -12,6 +14,7 @@ export async function evolveDecisions(input) {
|
|
|
12
14
|
model: input.model,
|
|
13
15
|
repoPath: input.repoPath,
|
|
14
16
|
repoOrigin: input.repoOrigin,
|
|
17
|
+
...extractForkFields(input),
|
|
15
18
|
});
|
|
16
19
|
return {
|
|
17
20
|
started: res.started,
|
|
@@ -20,23 +23,19 @@ export async function evolveDecisions(input) {
|
|
|
20
23
|
}
|
|
21
24
|
export const evolveDecisionsTool = {
|
|
22
25
|
name: 'evolve_decisions',
|
|
23
|
-
description: `
|
|
26
|
+
description: `Curate a set of previously extracted stories so that only the decisions still worth keeping are persisted.
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- supersedes: Later decision replaces earlier (earlier is outdated)
|
|
29
|
-
- reinforces: Later decision confirms earlier still holds
|
|
30
|
-
- contradicts: Later decision reverses earlier
|
|
31
|
-
- specializes: Later decision adds specificity (both remain valid)
|
|
32
|
-
3. **Annotation**: Labels each decision as stable, orphan, evolved, or abandoned
|
|
33
|
-
4. **Curation**: Keeps stable + orphan decisions, drops evolved + abandoned
|
|
28
|
+
When to use:
|
|
29
|
+
- After running \`infer_history\` in story-only mode (rare — \`infer_history\` already chains this step automatically).
|
|
30
|
+
- When you have a pre-existing set of stories you want to re-curate without re-running history extraction.
|
|
34
31
|
|
|
35
|
-
|
|
32
|
+
Inputs:
|
|
33
|
+
- \`stories\`: array of story objects from a previous \`infer_history\` run.
|
|
34
|
+
- \`repoPath\` (optional): when provided, curated results are persisted as intents and decisions for the repo after curation finishes.
|
|
35
|
+
- \`model\` (optional): Anthropic model used for the curation pass.
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
The pipeline runs asynchronously — returns immediately. Uses a cheaper model (haiku) by default since edge classification requires less reasoning than story analysis.`,
|
|
37
|
+
Behavior:
|
|
38
|
+
- Runs asynchronously — returns immediately with a started/pending status while progress is reported separately.`,
|
|
40
39
|
inputSchema: evolveDecisionsSchema,
|
|
41
40
|
handler: evolveDecisions
|
|
42
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evolve-decisions.js","sourceRoot":"","sources":["../../src/tools/evolve-decisions.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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,OAAO;QACpB,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,iFAAiF;KAC1G,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE;;;;;;;;;;;;iHAYkG;IAC/G,WAAW,EAAE,qBAAqB;IAClC,OAAO,EAAE,eAAe;CACzB,CAAA"}
|
|
@@ -1,13 +1,39 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const getIntentChangesSchema: 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 GetIntentChangesInput = z.infer<typeof getIntentChangesSchema>;
|
|
13
39
|
export interface FileChange {
|
|
@@ -36,14 +62,40 @@ export declare const getIntentChangesTool: {
|
|
|
36
62
|
name: string;
|
|
37
63
|
description: string;
|
|
38
64
|
inputSchema: z.ZodObject<{
|
|
65
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
67
|
+
user: z.ZodString;
|
|
68
|
+
forkOrigin: z.ZodString;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
platform: "github" | "gitlab";
|
|
71
|
+
user: string;
|
|
72
|
+
forkOrigin: string;
|
|
73
|
+
}, {
|
|
74
|
+
platform: "github" | "gitlab";
|
|
75
|
+
user: string;
|
|
76
|
+
forkOrigin: string;
|
|
77
|
+
}>>;
|
|
78
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
39
79
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
40
80
|
repoPath: z.ZodString;
|
|
41
81
|
}, "strip", z.ZodTypeAny, {
|
|
42
82
|
repoPath: string;
|
|
43
83
|
repoOrigin?: string | undefined;
|
|
84
|
+
forkAuthor?: {
|
|
85
|
+
platform: "github" | "gitlab";
|
|
86
|
+
user: string;
|
|
87
|
+
forkOrigin: string;
|
|
88
|
+
} | undefined;
|
|
89
|
+
workspaceId?: string | undefined;
|
|
44
90
|
}, {
|
|
45
91
|
repoPath: string;
|
|
46
92
|
repoOrigin?: string | undefined;
|
|
93
|
+
forkAuthor?: {
|
|
94
|
+
platform: "github" | "gitlab";
|
|
95
|
+
user: string;
|
|
96
|
+
forkOrigin: string;
|
|
97
|
+
} | undefined;
|
|
98
|
+
workspaceId?: string | undefined;
|
|
47
99
|
}>;
|
|
48
100
|
handler: typeof getIntentChanges;
|
|
49
101
|
};
|
|
@@ -1,15 +1,18 @@
|
|
|
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 getIntentChangesSchema = 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 getIntentChanges(input) {
|
|
9
11
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
10
12
|
const res = await request('intent', 'get-changes', {
|
|
11
13
|
repoOrigin: actualOrigin,
|
|
12
14
|
repoPath: input.repoPath,
|
|
15
|
+
...extractForkFields(input),
|
|
13
16
|
});
|
|
14
17
|
const modified = (res.changes?.modified || res.modified || []).map((f) => ({
|
|
15
18
|
filePath: f.filePath || f,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-intent-changes.js","sourceRoot":"","sources":["../../src/tools/get-intent-changes.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-intent-changes.js","sourceRoot":"","sources":["../../src/tools/get-intent-changes.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,M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