@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,5 @@
|
|
|
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>;
|
|
17
3
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
18
4
|
repoPath: z.ZodString;
|
|
19
5
|
prompt: z.ZodString;
|
|
@@ -28,23 +14,11 @@ export declare const getRelevantContextSchema: z.ZodObject<{
|
|
|
28
14
|
maxDecisions: number;
|
|
29
15
|
minRelevance: number;
|
|
30
16
|
repoOrigin?: string | undefined;
|
|
31
|
-
forkAuthor?: {
|
|
32
|
-
platform: "github" | "gitlab";
|
|
33
|
-
user: string;
|
|
34
|
-
forkOrigin: string;
|
|
35
|
-
} | undefined;
|
|
36
|
-
workspaceId?: string | undefined;
|
|
37
17
|
activeFiles?: string[] | undefined;
|
|
38
18
|
}, {
|
|
39
19
|
repoPath: string;
|
|
40
20
|
prompt: string;
|
|
41
21
|
repoOrigin?: string | undefined;
|
|
42
|
-
forkAuthor?: {
|
|
43
|
-
platform: "github" | "gitlab";
|
|
44
|
-
user: string;
|
|
45
|
-
forkOrigin: string;
|
|
46
|
-
} | undefined;
|
|
47
|
-
workspaceId?: string | undefined;
|
|
48
22
|
activeFiles?: string[] | undefined;
|
|
49
23
|
maxIntents?: number | undefined;
|
|
50
24
|
maxDecisions?: number | undefined;
|
|
@@ -89,20 +63,6 @@ export declare const getRelevantContextTool: {
|
|
|
89
63
|
name: string;
|
|
90
64
|
description: string;
|
|
91
65
|
inputSchema: z.ZodObject<{
|
|
92
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
93
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
94
|
-
user: z.ZodString;
|
|
95
|
-
forkOrigin: z.ZodString;
|
|
96
|
-
}, "strip", z.ZodTypeAny, {
|
|
97
|
-
platform: "github" | "gitlab";
|
|
98
|
-
user: string;
|
|
99
|
-
forkOrigin: string;
|
|
100
|
-
}, {
|
|
101
|
-
platform: "github" | "gitlab";
|
|
102
|
-
user: string;
|
|
103
|
-
forkOrigin: string;
|
|
104
|
-
}>>;
|
|
105
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
106
66
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
107
67
|
repoPath: z.ZodString;
|
|
108
68
|
prompt: z.ZodString;
|
|
@@ -117,23 +77,11 @@ export declare const getRelevantContextTool: {
|
|
|
117
77
|
maxDecisions: number;
|
|
118
78
|
minRelevance: number;
|
|
119
79
|
repoOrigin?: string | undefined;
|
|
120
|
-
forkAuthor?: {
|
|
121
|
-
platform: "github" | "gitlab";
|
|
122
|
-
user: string;
|
|
123
|
-
forkOrigin: string;
|
|
124
|
-
} | undefined;
|
|
125
|
-
workspaceId?: string | undefined;
|
|
126
80
|
activeFiles?: string[] | undefined;
|
|
127
81
|
}, {
|
|
128
82
|
repoPath: string;
|
|
129
83
|
prompt: string;
|
|
130
84
|
repoOrigin?: string | undefined;
|
|
131
|
-
forkAuthor?: {
|
|
132
|
-
platform: "github" | "gitlab";
|
|
133
|
-
user: string;
|
|
134
|
-
forkOrigin: string;
|
|
135
|
-
} | undefined;
|
|
136
|
-
workspaceId?: string | undefined;
|
|
137
85
|
activeFiles?: string[] | undefined;
|
|
138
86
|
maxIntents?: number | undefined;
|
|
139
87
|
maxDecisions?: number | undefined;
|
|
@@ -1,7 +1,6 @@
|
|
|
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
|
import { emitInjection, estimateTokens } from '../telemetry.js';
|
|
6
5
|
export const getRelevantContextSchema = z.object({
|
|
7
6
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
@@ -11,7 +10,6 @@ export const getRelevantContextSchema = z.object({
|
|
|
11
10
|
maxIntents: z.number().optional().default(10).describe('Maximum number of intents to return'),
|
|
12
11
|
maxDecisions: z.number().optional().default(10).describe('Maximum number of decisions to return'),
|
|
13
12
|
minRelevance: z.number().optional().default(0.3).describe('Minimum relevance score (0-1)'),
|
|
14
|
-
...forkFieldsExtensions,
|
|
15
13
|
});
|
|
16
14
|
const EMPTY_RESPONSE = (origin, path) => ({
|
|
17
15
|
projectOrigin: origin,
|
|
@@ -36,7 +34,6 @@ export async function getRelevantContext(input) {
|
|
|
36
34
|
maxIntents: input.maxIntents,
|
|
37
35
|
maxDecisions: input.maxDecisions,
|
|
38
36
|
minScore: input.minRelevance,
|
|
39
|
-
...extractForkFields(input),
|
|
40
37
|
});
|
|
41
38
|
}
|
|
42
39
|
catch (err) {
|
|
@@ -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;AACnD,OAAO,EAAE,
|
|
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,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAE/D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,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,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;IAC5E,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oDAAoD,CAAC;IAC1G,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAA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AAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;KACvE,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAA;AACjB,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"}
|
|
@@ -19,20 +19,6 @@ import { z } from 'zod';
|
|
|
19
19
|
* validates input, resolves the origin, and forwards the request.
|
|
20
20
|
*/
|
|
21
21
|
export declare const getResolutionContextSchema: z.ZodObject<{
|
|
22
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
23
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
24
|
-
user: z.ZodString;
|
|
25
|
-
forkOrigin: z.ZodString;
|
|
26
|
-
}, "strip", z.ZodTypeAny, {
|
|
27
|
-
platform: "github" | "gitlab";
|
|
28
|
-
user: string;
|
|
29
|
-
forkOrigin: string;
|
|
30
|
-
}, {
|
|
31
|
-
platform: "github" | "gitlab";
|
|
32
|
-
user: string;
|
|
33
|
-
forkOrigin: string;
|
|
34
|
-
}>>;
|
|
35
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
36
22
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
37
23
|
repoPath: z.ZodString;
|
|
38
24
|
peerUid: z.ZodString;
|
|
@@ -45,12 +31,6 @@ export declare const getResolutionContextSchema: z.ZodObject<{
|
|
|
45
31
|
peerUid: string;
|
|
46
32
|
ranges: number[][];
|
|
47
33
|
repoOrigin?: string | undefined;
|
|
48
|
-
forkAuthor?: {
|
|
49
|
-
platform: "github" | "gitlab";
|
|
50
|
-
user: string;
|
|
51
|
-
forkOrigin: string;
|
|
52
|
-
} | undefined;
|
|
53
|
-
workspaceId?: string | undefined;
|
|
54
34
|
intentId?: string | undefined;
|
|
55
35
|
}, {
|
|
56
36
|
repoPath: string;
|
|
@@ -58,12 +38,6 @@ export declare const getResolutionContextSchema: z.ZodObject<{
|
|
|
58
38
|
peerUid: string;
|
|
59
39
|
ranges: number[][];
|
|
60
40
|
repoOrigin?: string | undefined;
|
|
61
|
-
forkAuthor?: {
|
|
62
|
-
platform: "github" | "gitlab";
|
|
63
|
-
user: string;
|
|
64
|
-
forkOrigin: string;
|
|
65
|
-
} | undefined;
|
|
66
|
-
workspaceId?: string | undefined;
|
|
67
41
|
intentId?: string | undefined;
|
|
68
42
|
}>;
|
|
69
43
|
export type GetResolutionContextInput = z.infer<typeof getResolutionContextSchema>;
|
|
@@ -103,20 +77,6 @@ export declare const getResolutionContextTool: {
|
|
|
103
77
|
name: string;
|
|
104
78
|
description: string;
|
|
105
79
|
inputSchema: z.ZodObject<{
|
|
106
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
107
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
108
|
-
user: z.ZodString;
|
|
109
|
-
forkOrigin: z.ZodString;
|
|
110
|
-
}, "strip", z.ZodTypeAny, {
|
|
111
|
-
platform: "github" | "gitlab";
|
|
112
|
-
user: string;
|
|
113
|
-
forkOrigin: string;
|
|
114
|
-
}, {
|
|
115
|
-
platform: "github" | "gitlab";
|
|
116
|
-
user: string;
|
|
117
|
-
forkOrigin: string;
|
|
118
|
-
}>>;
|
|
119
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
120
80
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
121
81
|
repoPath: z.ZodString;
|
|
122
82
|
peerUid: z.ZodString;
|
|
@@ -129,12 +89,6 @@ export declare const getResolutionContextTool: {
|
|
|
129
89
|
peerUid: string;
|
|
130
90
|
ranges: number[][];
|
|
131
91
|
repoOrigin?: string | undefined;
|
|
132
|
-
forkAuthor?: {
|
|
133
|
-
platform: "github" | "gitlab";
|
|
134
|
-
user: string;
|
|
135
|
-
forkOrigin: string;
|
|
136
|
-
} | undefined;
|
|
137
|
-
workspaceId?: string | undefined;
|
|
138
92
|
intentId?: string | undefined;
|
|
139
93
|
}, {
|
|
140
94
|
repoPath: string;
|
|
@@ -142,12 +96,6 @@ export declare const getResolutionContextTool: {
|
|
|
142
96
|
peerUid: string;
|
|
143
97
|
ranges: number[][];
|
|
144
98
|
repoOrigin?: string | undefined;
|
|
145
|
-
forkAuthor?: {
|
|
146
|
-
platform: "github" | "gitlab";
|
|
147
|
-
user: string;
|
|
148
|
-
forkOrigin: string;
|
|
149
|
-
} | undefined;
|
|
150
|
-
workspaceId?: string | undefined;
|
|
151
99
|
intentId?: string | undefined;
|
|
152
100
|
}>;
|
|
153
101
|
handler: typeof getResolutionContext;
|
|
@@ -1,7 +1,6 @@
|
|
|
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
|
/**
|
|
6
5
|
* Thin proxy to Muninn's `pre-edit-check:resolution-context` handler (Layer C,
|
|
7
6
|
* Phase 2 — proactive pre-edit conflict resolution).
|
|
@@ -42,11 +41,9 @@ export const getResolutionContextSchema = z.object({
|
|
|
42
41
|
.string()
|
|
43
42
|
.optional()
|
|
44
43
|
.describe('Active intent ID (advisory). Auto-detected by Kawa Code when omitted.'),
|
|
45
|
-
...forkFieldsExtensions,
|
|
46
44
|
});
|
|
47
45
|
export async function getResolutionContext(input) {
|
|
48
46
|
const repoOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
49
|
-
const forkFields = extractForkFields(input);
|
|
50
47
|
const res = await request('pre-edit-check', 'resolution-context', {
|
|
51
48
|
repoOrigin,
|
|
52
49
|
repoPath: input.repoPath,
|
|
@@ -54,7 +51,6 @@ export async function getResolutionContext(input) {
|
|
|
54
51
|
filePath: input.filePath,
|
|
55
52
|
ranges: input.ranges,
|
|
56
53
|
intentId: input.intentId,
|
|
57
|
-
...forkFields,
|
|
58
54
|
});
|
|
59
55
|
return res;
|
|
60
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-resolution-context.js","sourceRoot":"","sources":["../../src/tools/get-resolution-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-resolution-context.js","sourceRoot":"","sources":["../../src/tools/get-resolution-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;AAEnD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,6EAA6E,CAAC;IAC1F,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,CAAC,mCAAmC,CAAC;IAChD,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,CAAC,uGAAuG,CAAC;IACpH,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,CAAC,sDAAsD,CAAC;IACnE,MAAM,EAAE,CAAC;SACN,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;SAC1B,QAAQ,CAAC,uFAAuF,CAAC;IACpG,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,uEAAuE,CAAC;CACrF,CAAC,CAAA;AAkCF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,KAAgC;IAEhC,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IAElE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,gBAAgB,EAAE,oBAAoB,EAAE;QAChE,UAAU;QACV,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CAAA;IAEF,OAAO,GAAmC,CAAA;AAC5C,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE;;;;;;;;;;;4FAW6E;IAC1F,WAAW,EAAE,0BAA0B;IACvC,OAAO,EAAE,oBAAoB;CAC9B,CAAA"}
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { IntentRef } from '../types/refs.js';
|
|
2
3
|
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>;
|
|
17
4
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
18
5
|
repoPath: z.ZodString;
|
|
19
6
|
intentId: z.ZodString;
|
|
@@ -21,22 +8,10 @@ export declare const getSessionDecisionsSchema: z.ZodObject<{
|
|
|
21
8
|
repoPath: string;
|
|
22
9
|
intentId: 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
|
intentId: 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 GetSessionDecisionsInput = z.infer<typeof getSessionDecisionsSchema>;
|
|
42
17
|
export interface ConstraintViolation {
|
|
@@ -56,7 +31,15 @@ export interface DecisionPoint {
|
|
|
56
31
|
}
|
|
57
32
|
export interface GetSessionDecisionsResponse {
|
|
58
33
|
intentId: string;
|
|
59
|
-
|
|
34
|
+
/**
|
|
35
|
+
* The intent these decisions belong to, named.
|
|
36
|
+
*
|
|
37
|
+
* Every decision here shares one parent — the caller named it — so this is a
|
|
38
|
+
* single ref, not one per row. Resolved cache-only by Kawa Code, so it is
|
|
39
|
+
* absent on a cold cache rather than costing a round trip to label an intent
|
|
40
|
+
* the caller already identified.
|
|
41
|
+
*/
|
|
42
|
+
intent?: IntentRef;
|
|
60
43
|
decisions: DecisionPoint[];
|
|
61
44
|
count: number;
|
|
62
45
|
}
|
|
@@ -65,20 +48,6 @@ export declare const getSessionDecisionsTool: {
|
|
|
65
48
|
name: string;
|
|
66
49
|
description: string;
|
|
67
50
|
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>;
|
|
82
51
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
83
52
|
repoPath: z.ZodString;
|
|
84
53
|
intentId: z.ZodString;
|
|
@@ -86,22 +55,10 @@ export declare const getSessionDecisionsTool: {
|
|
|
86
55
|
repoPath: string;
|
|
87
56
|
intentId: string;
|
|
88
57
|
repoOrigin?: string | undefined;
|
|
89
|
-
forkAuthor?: {
|
|
90
|
-
platform: "github" | "gitlab";
|
|
91
|
-
user: string;
|
|
92
|
-
forkOrigin: string;
|
|
93
|
-
} | undefined;
|
|
94
|
-
workspaceId?: string | undefined;
|
|
95
58
|
}, {
|
|
96
59
|
repoPath: string;
|
|
97
60
|
intentId: string;
|
|
98
61
|
repoOrigin?: string | undefined;
|
|
99
|
-
forkAuthor?: {
|
|
100
|
-
platform: "github" | "gitlab";
|
|
101
|
-
user: string;
|
|
102
|
-
forkOrigin: string;
|
|
103
|
-
} | undefined;
|
|
104
|
-
workspaceId?: string | undefined;
|
|
105
62
|
}>;
|
|
106
63
|
handler: typeof getSessionDecisions;
|
|
107
64
|
};
|
|
@@ -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 { toIntentRef } from '../types/refs.js';
|
|
5
5
|
export const getSessionDecisionsSchema = 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
|
intentId: z.string().describe('The intent ID to get decisions for'),
|
|
9
|
-
...forkFieldsExtensions,
|
|
10
9
|
});
|
|
11
10
|
export async function getSessionDecisions(input) {
|
|
12
11
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
13
12
|
const res = await request('decision', 'list', {
|
|
14
13
|
repoOrigin: actualOrigin,
|
|
15
14
|
intentId: input.intentId,
|
|
16
|
-
...extractForkFields(input),
|
|
17
15
|
});
|
|
18
16
|
const decisions = (res.decisions || []).map((d) => ({
|
|
19
17
|
id: d.decision_id || d.decisionId || d._id || d.id || '',
|
|
@@ -31,7 +29,7 @@ export async function getSessionDecisions(input) {
|
|
|
31
29
|
}));
|
|
32
30
|
return {
|
|
33
31
|
intentId: input.intentId,
|
|
34
|
-
|
|
32
|
+
intent: toIntentRef(res?.intent) ?? undefined,
|
|
35
33
|
decisions,
|
|
36
34
|
count: decisions.length
|
|
37
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-session-decisions.js","sourceRoot":"","sources":["../../src/tools/get-session-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,
|
|
1
|
+
{"version":3,"file":"get-session-decisions.js","sourceRoot":"","sources":["../../src/tools/get-session-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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