@kawacode/mcp 6.9.3 → 6.9.5
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/README.md +17 -1
- package/build/index.js +4 -4
- package/build/index.js.map +1 -1
- package/build/prompts/intent-first-workflow.js +5 -6
- package/build/prompts/intent-first-workflow.js.map +1 -1
- package/build/services/muninn-ipc.js +6 -2
- package/build/services/muninn-ipc.js.map +1 -1
- package/build/tools/activate-intent.d.ts +3 -0
- package/build/tools/activate-intent.js +13 -1
- package/build/tools/activate-intent.js.map +1 -1
- package/build/tools/complete-intent.d.ts +4 -4
- package/build/tools/edit-session-decision.d.ts +12 -12
- package/build/tools/evolve-decisions.d.ts +0 -6
- package/build/tools/evolve-decisions.js +2 -4
- package/build/tools/evolve-decisions.js.map +1 -1
- package/build/tools/index.d.ts +90 -90
- package/build/tools/index.js +3 -3
- package/build/tools/index.js.map +1 -1
- package/build/tools/infer-history.js +3 -2
- package/build/tools/infer-history.js.map +1 -1
- package/build/tools/list-team-intents.d.ts +4 -4
- package/build/tools/record-decision.d.ts +12 -12
- package/build/tools/{get-intent-changes.d.ts → resume-intent.d.ts} +32 -20
- package/build/tools/resume-intent.js +102 -0
- package/build/tools/resume-intent.js.map +1 -0
- package/package.json +1 -1
- package/build/tools/get-intent-changes.js +0 -61
- package/build/tools/get-intent-changes.js.map +0 -1
|
@@ -32,13 +32,13 @@ export declare const recordDecisionSchema: z.ZodObject<{
|
|
|
32
32
|
constraint: z.ZodString;
|
|
33
33
|
reason: z.ZodString;
|
|
34
34
|
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
constraint: string;
|
|
35
36
|
reason: string;
|
|
36
37
|
alternative: string;
|
|
37
|
-
constraint: string;
|
|
38
38
|
}, {
|
|
39
|
+
constraint: string;
|
|
39
40
|
reason: string;
|
|
40
41
|
alternative: string;
|
|
41
|
-
constraint: string;
|
|
42
42
|
}>, "many">>;
|
|
43
43
|
source: z.ZodDefault<z.ZodOptional<z.ZodEnum<["user", "agent", "extractor", "infer_history"]>>>;
|
|
44
44
|
confidence: z.ZodOptional<z.ZodEnum<["high", "medium", "low"]>>;
|
|
@@ -68,7 +68,7 @@ export declare const recordDecisionSchema: z.ZodObject<{
|
|
|
68
68
|
baselineSha?: string | undefined;
|
|
69
69
|
}>>;
|
|
70
70
|
}, "strip", z.ZodTypeAny, {
|
|
71
|
-
type: "
|
|
71
|
+
type: "fork" | "abandoned" | "discovery" | "constraint" | "tradeoff" | "dependency";
|
|
72
72
|
repoPath: string;
|
|
73
73
|
summary: string;
|
|
74
74
|
intentId: string;
|
|
@@ -89,9 +89,9 @@ export declare const recordDecisionSchema: z.ZodObject<{
|
|
|
89
89
|
supersedes?: string[] | undefined;
|
|
90
90
|
constraintsChecked?: string[] | undefined;
|
|
91
91
|
constraintViolations?: {
|
|
92
|
+
constraint: string;
|
|
92
93
|
reason: string;
|
|
93
94
|
alternative: string;
|
|
94
|
-
constraint: string;
|
|
95
95
|
}[] | undefined;
|
|
96
96
|
confidence?: "high" | "medium" | "low" | undefined;
|
|
97
97
|
sourceThoughtIds?: string[] | undefined;
|
|
@@ -106,7 +106,7 @@ export declare const recordDecisionSchema: z.ZodObject<{
|
|
|
106
106
|
baselineSha?: string | undefined;
|
|
107
107
|
} | undefined;
|
|
108
108
|
}, {
|
|
109
|
-
type: "
|
|
109
|
+
type: "fork" | "abandoned" | "discovery" | "constraint" | "tradeoff" | "dependency";
|
|
110
110
|
repoPath: string;
|
|
111
111
|
summary: string;
|
|
112
112
|
rationale: string;
|
|
@@ -126,9 +126,9 @@ export declare const recordDecisionSchema: z.ZodObject<{
|
|
|
126
126
|
supersedes?: string[] | undefined;
|
|
127
127
|
constraintsChecked?: string[] | undefined;
|
|
128
128
|
constraintViolations?: {
|
|
129
|
+
constraint: string;
|
|
129
130
|
reason: string;
|
|
130
131
|
alternative: string;
|
|
131
|
-
constraint: string;
|
|
132
132
|
}[] | undefined;
|
|
133
133
|
source?: "user" | "agent" | "extractor" | "infer_history" | undefined;
|
|
134
134
|
confidence?: "high" | "medium" | "low" | undefined;
|
|
@@ -187,13 +187,13 @@ export declare const recordDecisionTool: {
|
|
|
187
187
|
constraint: z.ZodString;
|
|
188
188
|
reason: z.ZodString;
|
|
189
189
|
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
constraint: string;
|
|
190
191
|
reason: string;
|
|
191
192
|
alternative: string;
|
|
192
|
-
constraint: string;
|
|
193
193
|
}, {
|
|
194
|
+
constraint: string;
|
|
194
195
|
reason: string;
|
|
195
196
|
alternative: string;
|
|
196
|
-
constraint: string;
|
|
197
197
|
}>, "many">>;
|
|
198
198
|
source: z.ZodDefault<z.ZodOptional<z.ZodEnum<["user", "agent", "extractor", "infer_history"]>>>;
|
|
199
199
|
confidence: z.ZodOptional<z.ZodEnum<["high", "medium", "low"]>>;
|
|
@@ -223,7 +223,7 @@ export declare const recordDecisionTool: {
|
|
|
223
223
|
baselineSha?: string | undefined;
|
|
224
224
|
}>>;
|
|
225
225
|
}, "strip", z.ZodTypeAny, {
|
|
226
|
-
type: "
|
|
226
|
+
type: "fork" | "abandoned" | "discovery" | "constraint" | "tradeoff" | "dependency";
|
|
227
227
|
repoPath: string;
|
|
228
228
|
summary: string;
|
|
229
229
|
intentId: string;
|
|
@@ -244,9 +244,9 @@ export declare const recordDecisionTool: {
|
|
|
244
244
|
supersedes?: string[] | undefined;
|
|
245
245
|
constraintsChecked?: string[] | undefined;
|
|
246
246
|
constraintViolations?: {
|
|
247
|
+
constraint: string;
|
|
247
248
|
reason: string;
|
|
248
249
|
alternative: string;
|
|
249
|
-
constraint: string;
|
|
250
250
|
}[] | undefined;
|
|
251
251
|
confidence?: "high" | "medium" | "low" | undefined;
|
|
252
252
|
sourceThoughtIds?: string[] | undefined;
|
|
@@ -261,7 +261,7 @@ export declare const recordDecisionTool: {
|
|
|
261
261
|
baselineSha?: string | undefined;
|
|
262
262
|
} | undefined;
|
|
263
263
|
}, {
|
|
264
|
-
type: "
|
|
264
|
+
type: "fork" | "abandoned" | "discovery" | "constraint" | "tradeoff" | "dependency";
|
|
265
265
|
repoPath: string;
|
|
266
266
|
summary: string;
|
|
267
267
|
rationale: string;
|
|
@@ -281,9 +281,9 @@ export declare const recordDecisionTool: {
|
|
|
281
281
|
supersedes?: string[] | undefined;
|
|
282
282
|
constraintsChecked?: string[] | undefined;
|
|
283
283
|
constraintViolations?: {
|
|
284
|
+
constraint: string;
|
|
284
285
|
reason: string;
|
|
285
286
|
alternative: string;
|
|
286
|
-
constraint: string;
|
|
287
287
|
}[] | undefined;
|
|
288
288
|
source?: "user" | "agent" | "extractor" | "infer_history" | undefined;
|
|
289
289
|
confidence?: "high" | "medium" | "low" | undefined;
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
2
|
+
import { type ProjectDecision } from './get-project-decisions.js';
|
|
3
|
+
/**
|
|
4
|
+
* One-call intent hydration for cross-developer handoff.
|
|
5
|
+
*
|
|
6
|
+
* Composes three EXISTING Muninn IPC actions — nothing new is added to the
|
|
7
|
+
* daemon, so this works against any daemon version (backwards compatible):
|
|
8
|
+
* 1. intent:set-active (via activate_intent) → adopt the intent as current
|
|
9
|
+
* 2. intent:get → the intent's title/description/status by id
|
|
10
|
+
* 3. decision:project-list (via get_project_decisions) → its decisions, lean
|
|
11
|
+
*
|
|
12
|
+
* A future Muninn `decision:by-intent` filter would let step 3 avoid pulling
|
|
13
|
+
* the full project list, but that's an optimization, not a requirement.
|
|
14
|
+
*/
|
|
15
|
+
export declare const resumeIntentSchema: z.ZodObject<{
|
|
3
16
|
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
4
17
|
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
5
18
|
user: z.ZodString;
|
|
@@ -16,8 +29,10 @@ export declare const getIntentChangesSchema: z.ZodObject<{
|
|
|
16
29
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
17
30
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
18
31
|
repoPath: z.ZodString;
|
|
32
|
+
intentId: z.ZodString;
|
|
19
33
|
}, "strip", z.ZodTypeAny, {
|
|
20
34
|
repoPath: string;
|
|
35
|
+
intentId: string;
|
|
21
36
|
repoOrigin?: string | undefined;
|
|
22
37
|
forkAuthor?: {
|
|
23
38
|
platform: "github" | "gitlab";
|
|
@@ -27,6 +42,7 @@ export declare const getIntentChangesSchema: z.ZodObject<{
|
|
|
27
42
|
workspaceId?: string | undefined;
|
|
28
43
|
}, {
|
|
29
44
|
repoPath: string;
|
|
45
|
+
intentId: string;
|
|
30
46
|
repoOrigin?: string | undefined;
|
|
31
47
|
forkAuthor?: {
|
|
32
48
|
platform: "github" | "gitlab";
|
|
@@ -35,30 +51,23 @@ export declare const getIntentChangesSchema: z.ZodObject<{
|
|
|
35
51
|
} | undefined;
|
|
36
52
|
workspaceId?: string | undefined;
|
|
37
53
|
}>;
|
|
38
|
-
export type
|
|
39
|
-
export interface
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
export interface IntentChangesResponse {
|
|
45
|
-
hasActiveIntent: boolean;
|
|
54
|
+
export type ResumeIntentInput = z.infer<typeof resumeIntentSchema>;
|
|
55
|
+
export interface ResumeIntentResponse {
|
|
56
|
+
resumed: boolean;
|
|
57
|
+
intentId: string;
|
|
58
|
+
/** True when the resume was refused because the intent is frozen (stale beyond the freeze window). */
|
|
59
|
+
frozen?: boolean;
|
|
46
60
|
intent?: {
|
|
47
|
-
id: string;
|
|
48
61
|
title: string;
|
|
49
62
|
description: string;
|
|
50
63
|
status: string;
|
|
51
|
-
createdAt?: string;
|
|
52
|
-
};
|
|
53
|
-
changes: {
|
|
54
|
-
modified: FileChange[];
|
|
55
|
-
untracked: string[];
|
|
56
|
-
totalFiles: number;
|
|
57
64
|
};
|
|
58
|
-
|
|
65
|
+
decisions: ProjectDecision[];
|
|
66
|
+
count: number;
|
|
67
|
+
message: string;
|
|
59
68
|
}
|
|
60
|
-
export declare function
|
|
61
|
-
export declare const
|
|
69
|
+
export declare function resumeIntent(input: ResumeIntentInput): Promise<ResumeIntentResponse>;
|
|
70
|
+
export declare const resumeIntentTool: {
|
|
62
71
|
name: string;
|
|
63
72
|
description: string;
|
|
64
73
|
inputSchema: z.ZodObject<{
|
|
@@ -78,8 +87,10 @@ export declare const getIntentChangesTool: {
|
|
|
78
87
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
79
88
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
80
89
|
repoPath: z.ZodString;
|
|
90
|
+
intentId: z.ZodString;
|
|
81
91
|
}, "strip", z.ZodTypeAny, {
|
|
82
92
|
repoPath: string;
|
|
93
|
+
intentId: string;
|
|
83
94
|
repoOrigin?: string | undefined;
|
|
84
95
|
forkAuthor?: {
|
|
85
96
|
platform: "github" | "gitlab";
|
|
@@ -89,6 +100,7 @@ export declare const getIntentChangesTool: {
|
|
|
89
100
|
workspaceId?: string | undefined;
|
|
90
101
|
}, {
|
|
91
102
|
repoPath: string;
|
|
103
|
+
intentId: string;
|
|
92
104
|
repoOrigin?: string | undefined;
|
|
93
105
|
forkAuthor?: {
|
|
94
106
|
platform: "github" | "gitlab";
|
|
@@ -97,5 +109,5 @@ export declare const getIntentChangesTool: {
|
|
|
97
109
|
} | undefined;
|
|
98
110
|
workspaceId?: string | undefined;
|
|
99
111
|
}>;
|
|
100
|
-
handler: typeof
|
|
112
|
+
handler: typeof resumeIntent;
|
|
101
113
|
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { request } from '../services/muninn-ipc.js';
|
|
3
|
+
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
+
import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
5
|
+
import { activateIntent } from './activate-intent.js';
|
|
6
|
+
import { getProjectDecisions } from './get-project-decisions.js';
|
|
7
|
+
/**
|
|
8
|
+
* One-call intent hydration for cross-developer handoff.
|
|
9
|
+
*
|
|
10
|
+
* Composes three EXISTING Muninn IPC actions — nothing new is added to the
|
|
11
|
+
* daemon, so this works against any daemon version (backwards compatible):
|
|
12
|
+
* 1. intent:set-active (via activate_intent) → adopt the intent as current
|
|
13
|
+
* 2. intent:get → the intent's title/description/status by id
|
|
14
|
+
* 3. decision:project-list (via get_project_decisions) → its decisions, lean
|
|
15
|
+
*
|
|
16
|
+
* A future Muninn `decision:by-intent` filter would let step 3 avoid pulling
|
|
17
|
+
* the full project list, but that's an optimization, not a requirement.
|
|
18
|
+
*/
|
|
19
|
+
export const resumeIntentSchema = z.object({
|
|
20
|
+
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
21
|
+
repoPath: z.string().describe('Local path to the repository root'),
|
|
22
|
+
intentId: z.string().describe('The cloud ID (preferred) or local UUID of the intent to resume — e.g. the id from a "follow up on intent <id>" handoff.'),
|
|
23
|
+
...forkFieldsExtensions,
|
|
24
|
+
});
|
|
25
|
+
export async function resumeIntent(input) {
|
|
26
|
+
// Resolve the origin once and pass it down, so the three sub-calls don't each
|
|
27
|
+
// re-shell out to git.
|
|
28
|
+
const origin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
29
|
+
const base = { repoOrigin: origin, repoPath: input.repoPath, ...extractForkFields(input) };
|
|
30
|
+
// 1. Adopt the intent as THIS session's current focus (multi-active — never
|
|
31
|
+
// displaces another session's current). Fail loud if it can't be activated.
|
|
32
|
+
const activated = await activateIntent({ ...base, intentId: input.intentId });
|
|
33
|
+
if (!activated.success || !activated.intentId) {
|
|
34
|
+
// Frozen intents (stale beyond the freeze window) can no longer be resumed —
|
|
35
|
+
// surface that distinctly so the agent starts a new intent instead of retrying.
|
|
36
|
+
if (activated.frozen) {
|
|
37
|
+
return {
|
|
38
|
+
resumed: false,
|
|
39
|
+
intentId: input.intentId,
|
|
40
|
+
frozen: true,
|
|
41
|
+
decisions: [],
|
|
42
|
+
count: 0,
|
|
43
|
+
message: `Intent ${input.intentId} is frozen (inactive too long) and can no longer be resumed. Start a new intent for the follow-up work — or take it over if you need ownership.`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
resumed: false,
|
|
48
|
+
intentId: input.intentId,
|
|
49
|
+
decisions: [],
|
|
50
|
+
count: 0,
|
|
51
|
+
message: activated.error
|
|
52
|
+
? `Could not resume intent ${input.intentId}: ${activated.error}`
|
|
53
|
+
: `Could not resume intent ${input.intentId}: activation failed. Verify the id (cloud id or local UUID) and that the intent exists in this repo.`,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
// 2 + 3. Hydrate the intent's metadata (by id) and its decisions in parallel.
|
|
57
|
+
const [intentRes, project] = await Promise.all([
|
|
58
|
+
request('intent', 'get', { repoOrigin: origin, id: input.intentId }),
|
|
59
|
+
getProjectDecisions(base),
|
|
60
|
+
]);
|
|
61
|
+
const raw = intentRes?.intent;
|
|
62
|
+
const resolvedId = raw?.id || raw?._id || '';
|
|
63
|
+
// Match decisions on every id form we know for this intent — the handoff
|
|
64
|
+
// prompt may carry the cloud id while stored decisions carry a local id (or
|
|
65
|
+
// vice versa), so union the passed id, the activated id, and the resolved one.
|
|
66
|
+
const targetIds = new Set([input.intentId, activated.intentId]);
|
|
67
|
+
if (resolvedId)
|
|
68
|
+
targetIds.add(resolvedId);
|
|
69
|
+
const decisions = project.decisions.filter(d => targetIds.has(d.intentId) || d.intentIds.some(id => targetIds.has(id)));
|
|
70
|
+
const intent = raw
|
|
71
|
+
? {
|
|
72
|
+
title: raw.title || '',
|
|
73
|
+
description: raw.description || '',
|
|
74
|
+
status: raw.status || 'active',
|
|
75
|
+
}
|
|
76
|
+
: undefined;
|
|
77
|
+
return {
|
|
78
|
+
resumed: true,
|
|
79
|
+
intentId: input.intentId,
|
|
80
|
+
intent,
|
|
81
|
+
decisions,
|
|
82
|
+
count: decisions.length,
|
|
83
|
+
message: intent
|
|
84
|
+
? `Resumed "${intent.title}" (${intent.status}) — ${decisions.length} recorded decision(s) loaded. Call get_decision_detail(id) for the full rationale on any of them.`
|
|
85
|
+
: `Resumed intent ${input.intentId.substring(0, 8)} — ${decisions.length} recorded decision(s) loaded.`,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export const resumeIntentTool = {
|
|
89
|
+
name: 'resume_intent',
|
|
90
|
+
description: `Resume an existing intent by ID in one call — activate it AND load its recorded decisions.
|
|
91
|
+
|
|
92
|
+
Use this to pick up a handoff. When a prompt says "follow up on intent <id>" (or you otherwise want to continue a specific existing intent), call resume_intent(<id>) instead of creating a new one. It:
|
|
93
|
+
- activates the intent as THIS session's current focus (multi-active — never displaces a teammate's active intent), and
|
|
94
|
+
- returns the intent's title/description/status plus its recorded decisions (summary-only; call get_decision_detail(id) for full rationale on any one).
|
|
95
|
+
|
|
96
|
+
This is the fast path for cross-developer handoff without a session or transcript export: the reasoning lives in Kawa Code, so a teammate resumes the thread from just the intent id. For the code itself, the intent's owner should have committed or pushed first (a prompt carries reasoning, not an uncommitted working tree).
|
|
97
|
+
|
|
98
|
+
Returns { resumed, intentId, intent?, decisions[], count, message }. resumed=false with a message when the id can't be activated.`,
|
|
99
|
+
inputSchema: resumeIntentSchema,
|
|
100
|
+
handler: resumeIntent,
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=resume-intent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resume-intent.js","sourceRoot":"","sources":["../../src/tools/resume-intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,mBAAmB,E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,CAAC;YACE,KAAK,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE;YACtB,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,EAAE;YAClC,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,QAAQ;SAC/B;QACH,CAAC,CAAC,SAAS,CAAA;IAEb,OAAO;QACL,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,MAAM;QACN,SAAS;QACT,KAAK,EAAE,SAAS,CAAC,MAAM;QACvB,OAAO,EAAE,MAAM;YACb,CAAC,CAAC,YAAY,MAAM,CAAC,KAAK,MAAM,MAAM,CAAC,MAAM,OAAO,SAAS,CAAC,MAAM,mGAAmG;YACvK,CAAC,CAAC,kBAAkB,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,SAAS,CAAC,MAAM,+BAA+B;KAC1G,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE;;;;;;;;kIAQmH;IAChI,WAAW,EAAE,kBAAkB;IAC/B,OAAO,EAAE,YAAY;CACtB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kawacode/mcp",
|
|
3
|
-
"version": "6.9.
|
|
3
|
+
"version": "6.9.5",
|
|
4
4
|
"description": "Team-aware memory for Claude Code, Cursor, and other AI coding assistants — intent tracking, decision history, real-time team conflict detection.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { request } from '../services/muninn-ipc.js';
|
|
3
|
-
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
-
import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
5
|
-
export const getIntentChangesSchema = z.object({
|
|
6
|
-
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
7
|
-
repoPath: z.string().describe('Local path to the repository root'),
|
|
8
|
-
...forkFieldsExtensions,
|
|
9
|
-
});
|
|
10
|
-
export async function getIntentChanges(input) {
|
|
11
|
-
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
12
|
-
const res = await request('intent', 'get-changes', {
|
|
13
|
-
repoOrigin: actualOrigin,
|
|
14
|
-
repoPath: input.repoPath,
|
|
15
|
-
...extractForkFields(input),
|
|
16
|
-
});
|
|
17
|
-
const modified = (res.changes?.modified || res.modified || []).map((f) => ({
|
|
18
|
-
filePath: f.filePath || f,
|
|
19
|
-
status: f.status || 'modified',
|
|
20
|
-
staged: f.staged || false,
|
|
21
|
-
}));
|
|
22
|
-
const untracked = res.changes?.untracked || res.untracked || [];
|
|
23
|
-
const warnings = res.warnings || [];
|
|
24
|
-
const hasActiveIntent = res.hasActiveIntent !== undefined
|
|
25
|
-
? res.hasActiveIntent
|
|
26
|
-
: !!res.intent;
|
|
27
|
-
if (!hasActiveIntent && (modified.length > 0 || untracked.length > 0)) {
|
|
28
|
-
warnings.push('Changes detected but no active intent. Consider creating an intent first.');
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
hasActiveIntent,
|
|
32
|
-
intent: res.intent ? {
|
|
33
|
-
id: res.intent.id || res.intent._id || '',
|
|
34
|
-
title: res.intent.title || '',
|
|
35
|
-
description: res.intent.description || '',
|
|
36
|
-
status: res.intent.status || 'active',
|
|
37
|
-
createdAt: res.intent.created_at || res.intent.createdAt
|
|
38
|
-
} : undefined,
|
|
39
|
-
changes: {
|
|
40
|
-
modified,
|
|
41
|
-
untracked,
|
|
42
|
-
totalFiles: modified.length + untracked.length
|
|
43
|
-
},
|
|
44
|
-
warnings
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export const getIntentChangesTool = {
|
|
48
|
-
name: 'get_intent_changes',
|
|
49
|
-
description: `Get uncommitted changes in the repository along with the active intent info.
|
|
50
|
-
|
|
51
|
-
Use this tool before prompting the user about committing to show:
|
|
52
|
-
- The active intent title and description
|
|
53
|
-
- Number of modified, added, and untracked files
|
|
54
|
-
- Any warnings (e.g., pre-existing changes from before intent activation)
|
|
55
|
-
|
|
56
|
-
This helps you construct an informative commit prompt like:
|
|
57
|
-
"You have uncommitted work on '[intent title]' (N files changed)..."`,
|
|
58
|
-
inputSchema: getIntentChangesSchema,
|
|
59
|
-
handler: getIntentChanges
|
|
60
|
-
};
|
|
61
|
-
//# sourceMappingURL=get-intent-changes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,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;AA2BF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAA4B;IACjE,MAAM,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IAEpE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,aAAa,EAAE;QACjD,UAAU,EAAE,YAAY;QACxB,QAAQ,EAAE,KAAK,C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