@kawacode/mcp 6.9.5 → 8.0.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 +23 -0
- package/README.md +93 -32
- package/build/index.js +20 -21
- package/build/index.js.map +1 -1
- package/build/prompts/intent-first-workflow.js +1 -2
- package/build/prompts/intent-first-workflow.js.map +1 -1
- package/build/tools/_mangled-args.d.ts +63 -0
- package/build/tools/_mangled-args.js +116 -0
- package/build/tools/_mangled-args.js.map +1 -0
- package/build/tools/_mangled-args.test.js +110 -0
- package/build/tools/_mangled-args.test.js.map +1 -0
- package/build/tools/activate-intent.d.ts +5 -52
- package/build/tools/activate-intent.js +14 -7
- package/build/tools/activate-intent.js.map +1 -1
- package/build/tools/arbiter-apply.d.ts +0 -52
- package/build/tools/arbiter-apply.js +0 -3
- package/build/tools/arbiter-apply.js.map +1 -1
- package/build/tools/arbiter-resolve.d.ts +0 -52
- package/build/tools/arbiter-resolve.js +0 -3
- package/build/tools/arbiter-resolve.js.map +1 -1
- package/build/tools/check-active-intent.d.ts +0 -52
- package/build/tools/check-active-intent.js +2 -24
- package/build/tools/check-active-intent.js.map +1 -1
- package/build/tools/complete-intent.d.ts +4 -56
- package/build/tools/complete-intent.js +15 -44
- package/build/tools/complete-intent.js.map +1 -1
- package/build/tools/create-intent.d.ts +0 -52
- package/build/tools/create-intent.js +0 -4
- package/build/tools/create-intent.js.map +1 -1
- package/build/tools/detect-intent-conflicts.d.ts +0 -52
- package/build/tools/detect-intent-conflicts.js +0 -3
- package/build/tools/detect-intent-conflicts.js.map +1 -1
- package/build/tools/edit-session-decision.d.ts +0 -52
- package/build/tools/edit-session-decision.js +0 -3
- package/build/tools/edit-session-decision.js.map +1 -1
- package/build/tools/get-decision-detail.d.ts +19 -55
- package/build/tools/get-decision-detail.js +12 -7
- package/build/tools/get-decision-detail.js.map +1 -1
- package/build/tools/get-intents-for-file.d.ts +35 -53
- package/build/tools/get-intents-for-file.js +61 -26
- package/build/tools/get-intents-for-file.js.map +1 -1
- package/build/tools/get-project-decisions.d.ts +0 -52
- package/build/tools/get-project-decisions.js +0 -3
- package/build/tools/get-project-decisions.js.map +1 -1
- package/build/tools/get-relevant-context.d.ts +0 -52
- package/build/tools/get-relevant-context.js +0 -3
- package/build/tools/get-relevant-context.js.map +1 -1
- package/build/tools/get-resolution-context.d.ts +0 -52
- package/build/tools/get-resolution-context.js +0 -4
- package/build/tools/get-resolution-context.js.map +1 -1
- package/build/tools/get-session-decisions.d.ts +10 -53
- package/build/tools/get-session-decisions.js +2 -4
- package/build/tools/get-session-decisions.js.map +1 -1
- package/build/tools/index.d.ts +11 -679
- package/build/tools/index.js +6 -15
- package/build/tools/index.js.map +1 -1
- package/build/tools/infer-history.js +4 -19
- package/build/tools/infer-history.js.map +1 -1
- package/build/tools/list-team-intents.d.ts +4 -56
- package/build/tools/list-team-intents.js +0 -3
- package/build/tools/list-team-intents.js.map +1 -1
- package/build/tools/log-work.d.ts +0 -52
- package/build/tools/log-work.js +0 -3
- package/build/tools/log-work.js.map +1 -1
- package/build/tools/pre-edit-acknowledge.d.ts +14 -52
- package/build/tools/pre-edit-acknowledge.js +14 -2
- package/build/tools/pre-edit-acknowledge.js.map +1 -1
- package/build/tools/pre-edit-decision-check.d.ts +14 -52
- package/build/tools/pre-edit-decision-check.js +14 -4
- package/build/tools/pre-edit-decision-check.js.map +1 -1
- package/build/tools/record-decision.d.ts +2 -52
- package/build/tools/record-decision.js +6 -5
- package/build/tools/record-decision.js.map +1 -1
- package/build/tools/resume-intent.d.ts +0 -52
- package/build/tools/resume-intent.js +6 -4
- package/build/tools/resume-intent.js.map +1 -1
- package/build/tools/update-intent.d.ts +0 -52
- package/build/tools/update-intent.js +1 -5
- package/build/tools/update-intent.js.map +1 -1
- package/build/types/refs.d.ts +73 -0
- package/build/types/refs.js +73 -0
- package/build/types/refs.js.map +1 -0
- package/package.json +1 -1
- package/build/tools/_fork-fields.d.ts +0 -84
- package/build/tools/_fork-fields.js +0 -65
- package/build/tools/_fork-fields.js.map +0 -1
- package/build/tools/_salvage-mangled-args.d.ts +0 -38
- package/build/tools/_salvage-mangled-args.js +0 -87
- package/build/tools/_salvage-mangled-args.js.map +0 -1
- package/build/tools/_salvage-mangled-args.test.js +0 -73
- package/build/tools/_salvage-mangled-args.test.js.map +0 -1
- package/build/tools/evolve-decisions.d.ts +0 -90
- package/build/tools/evolve-decisions.js +0 -40
- package/build/tools/evolve-decisions.js.map +0 -1
- package/build/tools/get-intents-for-lines.d.ts +0 -123
- package/build/tools/get-intents-for-lines.js +0 -67
- package/build/tools/get-intents-for-lines.js.map +0 -1
- package/build/tools/update-features.d.ts +0 -31
- package/build/tools/update-features.js +0 -51
- package/build/tools/update-features.js.map +0 -1
- /package/build/tools/{_salvage-mangled-args.test.d.ts → _mangled-args.test.d.ts} +0 -0
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { DecisionRef, IntentRef } from '../types/refs.js';
|
|
2
3
|
export declare const getDecisionDetailSchema: 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>;
|
|
17
4
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
18
5
|
repoPath: z.ZodString;
|
|
19
6
|
decisionId: z.ZodString;
|
|
@@ -21,28 +8,22 @@ export declare const getDecisionDetailSchema: z.ZodObject<{
|
|
|
21
8
|
repoPath: string;
|
|
22
9
|
decisionId: string;
|
|
23
10
|
repoOrigin?: string | undefined;
|
|
24
|
-
forkAuthor?: {
|
|
25
|
-
platform: "github" | "gitlab";
|
|
26
|
-
user: string;
|
|
27
|
-
forkOrigin: string;
|
|
28
|
-
} | undefined;
|
|
29
|
-
workspaceId?: string | undefined;
|
|
30
11
|
}, {
|
|
31
12
|
repoPath: string;
|
|
32
13
|
decisionId: string;
|
|
33
14
|
repoOrigin?: string | undefined;
|
|
34
|
-
forkAuthor?: {
|
|
35
|
-
platform: "github" | "gitlab";
|
|
36
|
-
user: string;
|
|
37
|
-
forkOrigin: string;
|
|
38
|
-
} | undefined;
|
|
39
|
-
workspaceId?: string | undefined;
|
|
40
15
|
}>;
|
|
41
16
|
export type GetDecisionDetailInput = z.infer<typeof getDecisionDetailSchema>;
|
|
42
17
|
export interface DecisionDetail {
|
|
43
18
|
decisionId: string;
|
|
44
|
-
|
|
45
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The intents that produced this decision, named.
|
|
21
|
+
*
|
|
22
|
+
* Replaces the former bare `intentId` / `intentIds[]`. Those were unanswerable
|
|
23
|
+
* as shipped — "which intent produced this?" cost a round trip per id, so it
|
|
24
|
+
* was never asked. Kawa Code resolves them now.
|
|
25
|
+
*/
|
|
26
|
+
intents: IntentRef[];
|
|
46
27
|
type: string;
|
|
47
28
|
summary: string;
|
|
48
29
|
rationale: string;
|
|
@@ -53,7 +34,16 @@ export interface DecisionDetail {
|
|
|
53
34
|
appliesWhen?: string | null;
|
|
54
35
|
surface?: string[] | null;
|
|
55
36
|
relatedFiles: string[];
|
|
56
|
-
|
|
37
|
+
/**
|
|
38
|
+
* The supersession chain, nearest first, each entry named and depth-stamped.
|
|
39
|
+
*
|
|
40
|
+
* Replaces the former bare `supersedes: string[]` — the reported symptom that
|
|
41
|
+
* made "7a7d1a36 supersedes 2cc444ec" the best sentence anyone could write.
|
|
42
|
+
* Empty on ~99.7% of decisions; only 28 of 8,465 carry any supersession.
|
|
43
|
+
*/
|
|
44
|
+
supersededDecisions: DecisionRef[];
|
|
45
|
+
/** Ancestors past the depth/width cap, unresolved. A floor, not a total. */
|
|
46
|
+
supersededOlderCount: number;
|
|
57
47
|
constraintsChecked: string[];
|
|
58
48
|
constraintViolations: any[];
|
|
59
49
|
timestamp?: string;
|
|
@@ -68,20 +58,6 @@ export declare const getDecisionDetailTool: {
|
|
|
68
58
|
name: string;
|
|
69
59
|
description: string;
|
|
70
60
|
inputSchema: z.ZodObject<{
|
|
71
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
72
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
73
|
-
user: z.ZodString;
|
|
74
|
-
forkOrigin: z.ZodString;
|
|
75
|
-
}, "strip", z.ZodTypeAny, {
|
|
76
|
-
platform: "github" | "gitlab";
|
|
77
|
-
user: string;
|
|
78
|
-
forkOrigin: string;
|
|
79
|
-
}, {
|
|
80
|
-
platform: "github" | "gitlab";
|
|
81
|
-
user: string;
|
|
82
|
-
forkOrigin: string;
|
|
83
|
-
}>>;
|
|
84
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
85
61
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
86
62
|
repoPath: z.ZodString;
|
|
87
63
|
decisionId: z.ZodString;
|
|
@@ -89,22 +65,10 @@ export declare const getDecisionDetailTool: {
|
|
|
89
65
|
repoPath: string;
|
|
90
66
|
decisionId: string;
|
|
91
67
|
repoOrigin?: string | undefined;
|
|
92
|
-
forkAuthor?: {
|
|
93
|
-
platform: "github" | "gitlab";
|
|
94
|
-
user: string;
|
|
95
|
-
forkOrigin: string;
|
|
96
|
-
} | undefined;
|
|
97
|
-
workspaceId?: string | undefined;
|
|
98
68
|
}, {
|
|
99
69
|
repoPath: string;
|
|
100
70
|
decisionId: string;
|
|
101
71
|
repoOrigin?: string | undefined;
|
|
102
|
-
forkAuthor?: {
|
|
103
|
-
platform: "github" | "gitlab";
|
|
104
|
-
user: string;
|
|
105
|
-
forkOrigin: string;
|
|
106
|
-
} | undefined;
|
|
107
|
-
workspaceId?: string | undefined;
|
|
108
72
|
}>;
|
|
109
73
|
handler: typeof getDecisionDetail;
|
|
110
74
|
};
|
|
@@ -1,19 +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 {
|
|
4
|
+
import { toDecisionRefs, toIntentRefs } from '../types/refs.js';
|
|
5
5
|
export const getDecisionDetailSchema = z.object({
|
|
6
6
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
7
7
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
8
8
|
decisionId: z.string().describe('The decision ID to expand (from a recall result, e.g. get_relevant_context)'),
|
|
9
|
-
...forkFieldsExtensions,
|
|
10
9
|
});
|
|
11
10
|
export async function getDecisionDetail(input) {
|
|
12
11
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
13
12
|
const res = await request('decision', 'detail', {
|
|
14
13
|
repoOrigin: actualOrigin,
|
|
15
14
|
decisionId: input.decisionId,
|
|
16
|
-
...extractForkFields(input),
|
|
17
15
|
});
|
|
18
16
|
const d = res?.decision;
|
|
19
17
|
if (!d) {
|
|
@@ -23,8 +21,12 @@ export async function getDecisionDetail(input) {
|
|
|
23
21
|
found: true,
|
|
24
22
|
decision: {
|
|
25
23
|
decisionId: d.decisionId || d.decision_id || d._id || d.id || '',
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
// Resolved by Kawa Code, which holds the API client and the label cache.
|
|
25
|
+
// Fail-soft by construction: an id that did not resolve is simply absent
|
|
26
|
+
// from these arrays, never an error.
|
|
27
|
+
intents: toIntentRefs(res?.intents),
|
|
28
|
+
supersededDecisions: toDecisionRefs(res?.supersededDecisions),
|
|
29
|
+
supersededOlderCount: typeof res?.supersededOlderCount === 'number' ? res.supersededOlderCount : 0,
|
|
28
30
|
type: d.decisionType || d.decision_type || d.type || '',
|
|
29
31
|
summary: d.summary || '',
|
|
30
32
|
rationale: d.rationale || '',
|
|
@@ -35,7 +37,6 @@ export async function getDecisionDetail(input) {
|
|
|
35
37
|
appliesWhen: d.appliesWhen ?? d.applies_when ?? d.aw ?? null,
|
|
36
38
|
surface: d.surface ?? d.sf ?? null,
|
|
37
39
|
relatedFiles: d.relatedFiles || d.related_files || [],
|
|
38
|
-
supersedes: d.supersedes || [],
|
|
39
40
|
constraintsChecked: d.constraintsChecked || d.constraints_checked || [],
|
|
40
41
|
constraintViolations: d.constraintViolations || d.constraint_violations || [],
|
|
41
42
|
timestamp: d.timestamp || d.createdAt || d.created_at,
|
|
@@ -51,7 +52,11 @@ Recall surfaces (get_relevant_context, get_project_decisions, get_session_decisi
|
|
|
51
52
|
Inputs:
|
|
52
53
|
- \`decisionId\`: the decision to expand (the \`id\` / \`decisionId\` from a recall result).
|
|
53
54
|
|
|
54
|
-
Returns the decision's \`rationale\`, \`context\`, \`consequences\`, \`alternatives\`, \`symptom\`, \`appliesWhen\`, \`surface\`, and related metadata. \`found: false\` when the id is unknown in this repo
|
|
55
|
+
Returns the decision's \`rationale\`, \`context\`, \`consequences\`, \`alternatives\`, \`symptom\`, \`appliesWhen\`, \`surface\`, and related metadata. \`found: false\` when the id is unknown in this repo.
|
|
56
|
+
|
|
57
|
+
References come pre-resolved, so describe them by name and never by ID alone:
|
|
58
|
+
- \`supersededDecisions\` — the supersession chain, nearest first. Each carries \`summary\` and a \`depth\` (1 = directly superseded by this decision, 2 = what *that* one superseded). Use \`depth\` to render the chain correctly: with two entries at depth 1 this decision replaced both, whereas depth 1 then 2 is a lineage. \`supersededOlderCount\` > 0 means older ancestors exist beyond the cap — say "+N older".
|
|
59
|
+
- \`intents\` — the intent(s) that produced this decision, with titles.`,
|
|
55
60
|
inputSchema: getDecisionDetailSchema,
|
|
56
61
|
handler: getDecisionDetail
|
|
57
62
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-decision-detail.js","sourceRoot":"","sources":["../../src/tools/get-decision-detail.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,
|
|
1
|
+
{"version":3,"file":"get-decision-detail.js","sourceRoot":"","sources":["../../src/tools/get-decision-detail.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,EAA0B,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,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,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6EAA6E,CAAC;CAC/G,CAAC,CAAA;AA6CF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAA6B;IACnE,MAAM,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IACpE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE;QAC9C,UAAU,EAAE,YAAY;QACxB,UAAU,EAAE,KAAK,CAAC,UAAU;KAC7B,CAAC,CAAA;IAEF,MAAM,CAAC,GAAG,GAAG,EAAE,QAAQ,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AkB,IAAI,CAAC,CAAC,mBAAmB,IAAI,EAAE;YACvE,oBAAoB,EAAE,CAAC,CAAC,oBAAoB,IAAI,CAAC,CAAC,qBAAqB,IAAI,EAAE;YAC7E,SAAS,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,UAAU;SACtD;KACF,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE;;;;;;;;;;;wEAWyD;IACtE,WAAW,EAAE,uBAAuB;IACpC,OAAO,EAAE,iBAAiB;CAC3B,CAAA"}
|
|
@@ -1,42 +1,29 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Merged from the former `get_intents_for_file` + `get_intents_for_lines` pair.
|
|
4
|
+
* Both forwarded to the same `intent-block` domain and differed only in whether
|
|
5
|
+
* a line range narrowed the query, so they cost two tool schemas in every
|
|
6
|
+
* session to express one question. Passing `startLine`/`endLine` selects the
|
|
7
|
+
* range-scoped `get-for-lines` action; omitting them uses `get-for-file`.
|
|
8
|
+
*/
|
|
2
9
|
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>;
|
|
17
10
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
18
11
|
repoPath: z.ZodString;
|
|
19
12
|
filePath: z.ZodString;
|
|
13
|
+
startLine: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
endLine: z.ZodOptional<z.ZodNumber>;
|
|
20
15
|
}, "strip", z.ZodTypeAny, {
|
|
21
16
|
repoPath: string;
|
|
22
17
|
filePath: string;
|
|
23
18
|
repoOrigin?: string | undefined;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
user: string;
|
|
27
|
-
forkOrigin: string;
|
|
28
|
-
} | undefined;
|
|
29
|
-
workspaceId?: string | undefined;
|
|
19
|
+
startLine?: number | undefined;
|
|
20
|
+
endLine?: number | undefined;
|
|
30
21
|
}, {
|
|
31
22
|
repoPath: string;
|
|
32
23
|
filePath: string;
|
|
33
24
|
repoOrigin?: string | undefined;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
user: string;
|
|
37
|
-
forkOrigin: string;
|
|
38
|
-
} | undefined;
|
|
39
|
-
workspaceId?: string | undefined;
|
|
25
|
+
startLine?: number | undefined;
|
|
26
|
+
endLine?: number | undefined;
|
|
40
27
|
}>;
|
|
41
28
|
export type GetIntentsForFileInput = z.infer<typeof getIntentsForFileSchema>;
|
|
42
29
|
export interface FileIntentBlock {
|
|
@@ -46,6 +33,13 @@ export interface FileIntentBlock {
|
|
|
46
33
|
contentSnippet: string;
|
|
47
34
|
intentIds: string[];
|
|
48
35
|
}
|
|
36
|
+
/** Present only when a line range was queried. */
|
|
37
|
+
export interface OverlappingLines {
|
|
38
|
+
blockStartLine: number;
|
|
39
|
+
blockEndLine: number;
|
|
40
|
+
overlapStart: number;
|
|
41
|
+
overlapEnd: number;
|
|
42
|
+
}
|
|
49
43
|
export interface FileIntentInfo {
|
|
50
44
|
intentId: string;
|
|
51
45
|
title: string;
|
|
@@ -54,56 +48,44 @@ export interface FileIntentInfo {
|
|
|
54
48
|
description: string;
|
|
55
49
|
branch: string;
|
|
56
50
|
forkedFrom?: string;
|
|
57
|
-
|
|
51
|
+
/** Whole-file mode only. */
|
|
52
|
+
blocks?: FileIntentBlock[];
|
|
53
|
+
/** Range mode only. */
|
|
54
|
+
overlappingLines?: OverlappingLines;
|
|
58
55
|
}
|
|
59
56
|
export interface GetIntentsForFileResponse {
|
|
60
57
|
filePath: string;
|
|
58
|
+
queryRange?: {
|
|
59
|
+
startLine: number;
|
|
60
|
+
endLine: number;
|
|
61
|
+
};
|
|
61
62
|
intents: FileIntentInfo[];
|
|
62
63
|
hasConflicts: boolean;
|
|
63
64
|
summary: string;
|
|
65
|
+
warning?: string;
|
|
64
66
|
}
|
|
65
67
|
export declare function getIntentsForFile(input: GetIntentsForFileInput): Promise<GetIntentsForFileResponse>;
|
|
66
68
|
export declare const getIntentsForFileTool: {
|
|
67
69
|
name: string;
|
|
68
70
|
description: string;
|
|
69
71
|
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>;
|
|
84
72
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
85
73
|
repoPath: z.ZodString;
|
|
86
74
|
filePath: z.ZodString;
|
|
75
|
+
startLine: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
endLine: z.ZodOptional<z.ZodNumber>;
|
|
87
77
|
}, "strip", z.ZodTypeAny, {
|
|
88
78
|
repoPath: string;
|
|
89
79
|
filePath: string;
|
|
90
80
|
repoOrigin?: string | undefined;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
user: string;
|
|
94
|
-
forkOrigin: string;
|
|
95
|
-
} | undefined;
|
|
96
|
-
workspaceId?: string | undefined;
|
|
81
|
+
startLine?: number | undefined;
|
|
82
|
+
endLine?: number | undefined;
|
|
97
83
|
}, {
|
|
98
84
|
repoPath: string;
|
|
99
85
|
filePath: string;
|
|
100
86
|
repoOrigin?: string | undefined;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
user: string;
|
|
104
|
-
forkOrigin: string;
|
|
105
|
-
} | undefined;
|
|
106
|
-
workspaceId?: string | undefined;
|
|
87
|
+
startLine?: number | undefined;
|
|
88
|
+
endLine?: number | undefined;
|
|
107
89
|
}>;
|
|
108
90
|
handler: typeof getIntentsForFile;
|
|
109
91
|
};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { request } from '../services/muninn-ipc.js';
|
|
3
3
|
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Merged from the former `get_intents_for_file` + `get_intents_for_lines` pair.
|
|
6
|
+
* Both forwarded to the same `intent-block` domain and differed only in whether
|
|
7
|
+
* a line range narrowed the query, so they cost two tool schemas in every
|
|
8
|
+
* session to express one question. Passing `startLine`/`endLine` selects the
|
|
9
|
+
* range-scoped `get-for-lines` action; omitting them uses `get-for-file`.
|
|
10
|
+
*/
|
|
5
11
|
export const getIntentsForFileSchema = z.object({
|
|
6
12
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
7
13
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
8
14
|
filePath: z.string().describe('Path to the file (relative to repo root)'),
|
|
9
|
-
|
|
15
|
+
startLine: z.number().min(1).optional().describe('Start line (1-based). Provide with endLine to narrow to a range.'),
|
|
16
|
+
endLine: z.number().min(1).optional().describe('End line (1-based, inclusive). Provide with startLine to narrow to a range.'),
|
|
10
17
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
repoOrigin: actualOrigin,
|
|
15
|
-
filePath: input.filePath,
|
|
16
|
-
...extractForkFields(input),
|
|
17
|
-
});
|
|
18
|
-
const intents = (res.intents || []).map((intent) => ({
|
|
18
|
+
/** Fields both modes share; Muninn's two actions use differing key casings. */
|
|
19
|
+
function baseIntent(intent) {
|
|
20
|
+
return {
|
|
19
21
|
intentId: intent.intentId || intent.id || '',
|
|
20
22
|
title: intent.title || 'Unknown Intent',
|
|
21
23
|
author: intent.author || intent.author_name || intent.authorName,
|
|
@@ -23,38 +25,71 @@ export async function getIntentsForFile(input) {
|
|
|
23
25
|
description: intent.description || '',
|
|
24
26
|
branch: intent.branch || '',
|
|
25
27
|
forkedFrom: intent.forked_from || intent.forkedFrom,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export async function getIntentsForFile(input) {
|
|
31
|
+
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
32
|
+
const ranged = input.startLine !== undefined && input.endLine !== undefined;
|
|
33
|
+
const res = await request('intent-block', ranged ? 'get-for-lines' : 'get-for-file', {
|
|
34
|
+
repoOrigin: actualOrigin,
|
|
35
|
+
filePath: input.filePath,
|
|
36
|
+
...(ranged ? { startLine: input.startLine, endLine: input.endLine } : {}),
|
|
37
|
+
});
|
|
38
|
+
const rows = res.intents || [];
|
|
39
|
+
if (ranged) {
|
|
40
|
+
const intents = rows.map((intent) => ({
|
|
41
|
+
...baseIntent(intent),
|
|
42
|
+
overlappingLines: {
|
|
43
|
+
blockStartLine: intent.block_start_line || intent.overlappingLines?.blockStartLine || 0,
|
|
44
|
+
blockEndLine: intent.block_end_line || intent.overlappingLines?.blockEndLine || 0,
|
|
45
|
+
overlapStart: intent.overlap_start || intent.overlappingLines?.overlapStart || 0,
|
|
46
|
+
overlapEnd: intent.overlap_end || intent.overlappingLines?.overlapEnd || 0,
|
|
47
|
+
},
|
|
48
|
+
}));
|
|
49
|
+
const active = intents.filter(i => i.status === 'active');
|
|
50
|
+
const authors = [...new Set(active.map(i => i.author).filter(Boolean))];
|
|
51
|
+
const warning = active.length > 0
|
|
52
|
+
? `Lines ${input.startLine}-${input.endLine} overlap with active work by: ${authors.join(', ') || 'team members'}`
|
|
53
|
+
: undefined;
|
|
54
|
+
return {
|
|
55
|
+
filePath: input.filePath,
|
|
56
|
+
queryRange: { startLine: input.startLine, endLine: input.endLine },
|
|
57
|
+
intents,
|
|
58
|
+
hasConflicts: intents.length > 0,
|
|
59
|
+
summary: intents.length === 0
|
|
60
|
+
? `No intents overlap lines ${input.startLine}-${input.endLine}`
|
|
61
|
+
: `${intents.length} intent(s) overlap lines ${input.startLine}-${input.endLine}`,
|
|
62
|
+
warning,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const intents = rows.map((intent) => ({
|
|
66
|
+
...baseIntent(intent),
|
|
26
67
|
blocks: (intent.blocks || []).map((b, i) => ({
|
|
27
68
|
id: b.id || `block-${i}`,
|
|
28
69
|
startLine: b.start_line || b.startLine || 0,
|
|
29
70
|
endLine: b.end_line || b.endLine || 0,
|
|
30
71
|
contentSnippet: b.content_snippet || b.contentSnippet || '',
|
|
31
|
-
intentIds: b.intent_ids || b.intentIds || [intent.intent_id || intent.intentId || intent.id || '']
|
|
32
|
-
}))
|
|
72
|
+
intentIds: b.intent_ids || b.intentIds || [intent.intent_id || intent.intentId || intent.id || ''],
|
|
73
|
+
})),
|
|
33
74
|
}));
|
|
34
75
|
const hasConflicts = intents.length > 1;
|
|
35
|
-
const summary = intents.length === 0
|
|
36
|
-
? 'No intents found for this file'
|
|
37
|
-
: intents.length === 1
|
|
38
|
-
? `1 intent: "${intents[0].title}" (${intents[0].status})`
|
|
39
|
-
: `${intents.length} intents affecting this file${hasConflicts ? ' - potential conflicts' : ''}`;
|
|
40
76
|
return {
|
|
41
77
|
filePath: input.filePath,
|
|
42
78
|
intents,
|
|
43
79
|
hasConflicts,
|
|
44
|
-
summary
|
|
80
|
+
summary: intents.length === 0
|
|
81
|
+
? 'No intents found for this file'
|
|
82
|
+
: intents.length === 1
|
|
83
|
+
? `1 intent: "${intents[0].title}" (${intents[0].status})`
|
|
84
|
+
: `${intents.length} intents affecting this file${hasConflicts ? ' - potential conflicts' : ''}`,
|
|
45
85
|
};
|
|
46
86
|
}
|
|
47
87
|
export const getIntentsForFileTool = {
|
|
48
88
|
name: 'get_intents_for_file',
|
|
49
|
-
description: `
|
|
50
|
-
|
|
51
|
-
Use this before modifying a file to:
|
|
52
|
-
- See what work is already in progress
|
|
53
|
-
- Identify potential conflicts with team members
|
|
54
|
-
- Understand the context of existing code changes
|
|
89
|
+
description: `Intents with code blocks in a file, so you can see in-progress work and team conflicts before editing.
|
|
55
90
|
|
|
56
|
-
|
|
91
|
+
Pass startLine + endLine to narrow to a range; the result then reports the exact overlap and warns when it hits a teammate's active intent.`,
|
|
57
92
|
inputSchema: getIntentsForFileSchema,
|
|
58
|
-
handler: getIntentsForFile
|
|
93
|
+
handler: getIntentsForFile,
|
|
59
94
|
};
|
|
60
95
|
//# sourceMappingURL=get-intents-for-file.js.map
|
|
@@ -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;AAEnD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,UAAU,EAAE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C3D,SAAS,EAAE,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC;SACnG,CAAC,CAAC;KACJ,CAAC,CAAC,CAAA;IAEH,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAA;IAEvC,OAAO;QACL,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,OAAO;QACP,YAAY;QACZ,OAAO,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC;YAC3B,CAAC,CAAC,gCAAgC;YAClC,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;gBACpB,CAAC,CAAC,cAAc,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG;gBAC1D,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,+BAA+B,YAAY,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,EAAE;KACrG,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE;;4IAE6H;IAC1I,WAAW,EAAE,uBAAuB;IACpC,OAAO,EAAE,iBAAiB;CAC3B,CAAA"}
|
|
@@ -1,39 +1,13 @@
|
|
|
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>;
|
|
17
3
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
18
4
|
repoPath: z.ZodString;
|
|
19
5
|
}, "strip", z.ZodTypeAny, {
|
|
20
6
|
repoPath: string;
|
|
21
7
|
repoOrigin?: string | undefined;
|
|
22
|
-
forkAuthor?: {
|
|
23
|
-
platform: "github" | "gitlab";
|
|
24
|
-
user: string;
|
|
25
|
-
forkOrigin: string;
|
|
26
|
-
} | undefined;
|
|
27
|
-
workspaceId?: string | undefined;
|
|
28
8
|
}, {
|
|
29
9
|
repoPath: string;
|
|
30
10
|
repoOrigin?: string | undefined;
|
|
31
|
-
forkAuthor?: {
|
|
32
|
-
platform: "github" | "gitlab";
|
|
33
|
-
user: string;
|
|
34
|
-
forkOrigin: string;
|
|
35
|
-
} | undefined;
|
|
36
|
-
workspaceId?: string | undefined;
|
|
37
11
|
}>;
|
|
38
12
|
export type GetProjectDecisionsInput = z.infer<typeof getProjectDecisionsSchema>;
|
|
39
13
|
export interface ConstraintViolation {
|
|
@@ -61,40 +35,14 @@ export declare const getProjectDecisionsTool: {
|
|
|
61
35
|
name: string;
|
|
62
36
|
description: string;
|
|
63
37
|
inputSchema: z.ZodObject<{
|
|
64
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
65
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
66
|
-
user: z.ZodString;
|
|
67
|
-
forkOrigin: z.ZodString;
|
|
68
|
-
}, "strip", z.ZodTypeAny, {
|
|
69
|
-
platform: "github" | "gitlab";
|
|
70
|
-
user: string;
|
|
71
|
-
forkOrigin: string;
|
|
72
|
-
}, {
|
|
73
|
-
platform: "github" | "gitlab";
|
|
74
|
-
user: string;
|
|
75
|
-
forkOrigin: string;
|
|
76
|
-
}>>;
|
|
77
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
78
38
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
79
39
|
repoPath: z.ZodString;
|
|
80
40
|
}, "strip", z.ZodTypeAny, {
|
|
81
41
|
repoPath: string;
|
|
82
42
|
repoOrigin?: string | undefined;
|
|
83
|
-
forkAuthor?: {
|
|
84
|
-
platform: "github" | "gitlab";
|
|
85
|
-
user: string;
|
|
86
|
-
forkOrigin: string;
|
|
87
|
-
} | undefined;
|
|
88
|
-
workspaceId?: string | undefined;
|
|
89
43
|
}, {
|
|
90
44
|
repoPath: string;
|
|
91
45
|
repoOrigin?: string | undefined;
|
|
92
|
-
forkAuthor?: {
|
|
93
|
-
platform: "github" | "gitlab";
|
|
94
|
-
user: string;
|
|
95
|
-
forkOrigin: string;
|
|
96
|
-
} | undefined;
|
|
97
|
-
workspaceId?: string | undefined;
|
|
98
46
|
}>;
|
|
99
47
|
handler: typeof getProjectDecisions;
|
|
100
48
|
};
|
|
@@ -1,17 +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';
|
|
5
4
|
export const getProjectDecisionsSchema = z.object({
|
|
6
5
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
7
6
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
8
|
-
...forkFieldsExtensions,
|
|
9
7
|
});
|
|
10
8
|
export async function getProjectDecisions(input) {
|
|
11
9
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
12
10
|
const res = await request('decision', 'project-list', {
|
|
13
11
|
repoOrigin: actualOrigin,
|
|
14
|
-
...extractForkFields(input),
|
|
15
12
|
});
|
|
16
13
|
const decisions = (res.decisions || []).map((d) => ({
|
|
17
14
|
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;AAEnD,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;CACnE,CAAC,CAAA;AA2BF,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;KACzB,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,CAAC,SAAS,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,UAAU,EAAE,C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