@kawacode/mcp 6.9.5 → 7.0.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 +23 -0
- package/README.md +88 -1
- package/build/index.js +20 -15
- 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 -631
- package/build/tools/index.js +2 -9
- 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 +0 -52
- package/build/tools/pre-edit-acknowledge.js +0 -2
- package/build/tools/pre-edit-acknowledge.js.map +1 -1
- package/build/tools/pre-edit-decision-check.d.ts +0 -52
- package/build/tools/pre-edit-decision-check.js +0 -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 recordDecisionSchema: 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
|
intentId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -75,12 +61,6 @@ export declare const recordDecisionSchema: z.ZodObject<{
|
|
|
75
61
|
rationale: string;
|
|
76
62
|
source: "user" | "agent" | "extractor" | "infer_history";
|
|
77
63
|
repoOrigin?: string | undefined;
|
|
78
|
-
forkAuthor?: {
|
|
79
|
-
platform: "github" | "gitlab";
|
|
80
|
-
user: string;
|
|
81
|
-
forkOrigin: string;
|
|
82
|
-
} | undefined;
|
|
83
|
-
workspaceId?: string | undefined;
|
|
84
64
|
context?: string | undefined;
|
|
85
65
|
alternatives?: string[] | undefined;
|
|
86
66
|
consequences?: string | undefined;
|
|
@@ -111,12 +91,6 @@ export declare const recordDecisionSchema: z.ZodObject<{
|
|
|
111
91
|
summary: string;
|
|
112
92
|
rationale: string;
|
|
113
93
|
repoOrigin?: string | undefined;
|
|
114
|
-
forkAuthor?: {
|
|
115
|
-
platform: "github" | "gitlab";
|
|
116
|
-
user: string;
|
|
117
|
-
forkOrigin: string;
|
|
118
|
-
} | undefined;
|
|
119
|
-
workspaceId?: string | undefined;
|
|
120
94
|
context?: string | undefined;
|
|
121
95
|
intentId?: string | undefined;
|
|
122
96
|
alternatives?: string[] | undefined;
|
|
@@ -148,6 +122,8 @@ export type RecordDecisionInput = z.infer<typeof recordDecisionSchema>;
|
|
|
148
122
|
export interface RecordDecisionResponse {
|
|
149
123
|
recorded: boolean;
|
|
150
124
|
decisionId: string;
|
|
125
|
+
/** The summary as stored, so the caller can name the decision it recorded. */
|
|
126
|
+
summary?: string;
|
|
151
127
|
error?: string;
|
|
152
128
|
}
|
|
153
129
|
export declare function recordDecision(input: RecordDecisionInput): Promise<RecordDecisionResponse>;
|
|
@@ -155,20 +131,6 @@ export declare const recordDecisionTool: {
|
|
|
155
131
|
name: string;
|
|
156
132
|
description: string;
|
|
157
133
|
inputSchema: z.ZodObject<{
|
|
158
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
159
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
160
|
-
user: z.ZodString;
|
|
161
|
-
forkOrigin: z.ZodString;
|
|
162
|
-
}, "strip", z.ZodTypeAny, {
|
|
163
|
-
platform: "github" | "gitlab";
|
|
164
|
-
user: string;
|
|
165
|
-
forkOrigin: string;
|
|
166
|
-
}, {
|
|
167
|
-
platform: "github" | "gitlab";
|
|
168
|
-
user: string;
|
|
169
|
-
forkOrigin: string;
|
|
170
|
-
}>>;
|
|
171
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
172
134
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
173
135
|
repoPath: z.ZodString;
|
|
174
136
|
intentId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -230,12 +192,6 @@ export declare const recordDecisionTool: {
|
|
|
230
192
|
rationale: string;
|
|
231
193
|
source: "user" | "agent" | "extractor" | "infer_history";
|
|
232
194
|
repoOrigin?: string | undefined;
|
|
233
|
-
forkAuthor?: {
|
|
234
|
-
platform: "github" | "gitlab";
|
|
235
|
-
user: string;
|
|
236
|
-
forkOrigin: string;
|
|
237
|
-
} | undefined;
|
|
238
|
-
workspaceId?: string | undefined;
|
|
239
195
|
context?: string | undefined;
|
|
240
196
|
alternatives?: string[] | undefined;
|
|
241
197
|
consequences?: string | undefined;
|
|
@@ -266,12 +222,6 @@ export declare const recordDecisionTool: {
|
|
|
266
222
|
summary: string;
|
|
267
223
|
rationale: string;
|
|
268
224
|
repoOrigin?: string | undefined;
|
|
269
|
-
forkAuthor?: {
|
|
270
|
-
platform: "github" | "gitlab";
|
|
271
|
-
user: string;
|
|
272
|
-
forkOrigin: string;
|
|
273
|
-
} | undefined;
|
|
274
|
-
workspaceId?: string | undefined;
|
|
275
225
|
context?: string | undefined;
|
|
276
226
|
intentId?: string | undefined;
|
|
277
227
|
alternatives?: string[] | 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
|
const constraintViolationSchema = z.object({
|
|
6
5
|
alternative: z.string().describe('The alternative that was rejected'),
|
|
7
6
|
constraint: z.string().describe('The constraint ID that was violated (e.g., "zero-knowledge")'),
|
|
@@ -20,7 +19,7 @@ export const recordDecisionSchema = z.object({
|
|
|
20
19
|
consequences: z.string().optional().describe('Downstream implications of this decision'),
|
|
21
20
|
symptom: z.string().optional().describe('Observable symptom that indicates this decision is relevant (e.g., error messages, runtime panics, unexpected behavior). Useful for discovery and constraint decisions.'),
|
|
22
21
|
relatedFiles: z.array(z.string()).optional().describe('File paths affected by this decision'),
|
|
23
|
-
supersedes: z.array(z.string()).optional().describe('Decision IDs that this one replaces. When a later decision supersedes an earlier one, pass the earlier decisionId(s) here so the evolve pipeline can track the lineage.'),
|
|
22
|
+
supersedes: z.array(z.string()).optional().describe('Decision IDs that this one replaces. When a later decision supersedes an earlier one, pass the earlier decisionId(s) here so the evolve pipeline can track the lineage. Pass FULL decision IDs (36-char UUIDs) — a truncated 8-char prefix is rejected, because resolving it back would mean guessing which decision you meant. If you only have a prefix (e.g. read from a doc), look it up with get_decision_detail first and use the id it returns.'),
|
|
24
23
|
constraintsChecked: z.array(z.string()).optional().describe('Which architectural constraints were verified before this decision'),
|
|
25
24
|
constraintViolations: z.array(constraintViolationSchema).optional()
|
|
26
25
|
.describe('Alternatives that were rejected due to constraint violations'),
|
|
@@ -43,7 +42,6 @@ export const recordDecisionSchema = z.object({
|
|
|
43
42
|
baselineSha: z.string().optional().describe('The cSHA baseline the ranges are expressed in.'),
|
|
44
43
|
}).optional()
|
|
45
44
|
.describe('Layer C audit — set ONLY when this decision records how you resolved a completion-time code collision (i.e. after complete_intent returned resolution_required). Links the decision to the live peer you yielded to or overrode.'),
|
|
46
|
-
...forkFieldsExtensions,
|
|
47
45
|
});
|
|
48
46
|
export async function recordDecision(input) {
|
|
49
47
|
const origin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -67,7 +65,6 @@ export async function recordDecision(input) {
|
|
|
67
65
|
appliesWhen: input.appliesWhen,
|
|
68
66
|
surface: input.surface,
|
|
69
67
|
resolvedCollision: input.resolvedCollision,
|
|
70
|
-
...extractForkFields(input),
|
|
71
68
|
});
|
|
72
69
|
// A persisted decision ALWAYS has an id. Anything else — an explicit
|
|
73
70
|
// failure, or a response that merely omits `decisionId` — means nothing was
|
|
@@ -77,6 +74,7 @@ export async function recordDecision(input) {
|
|
|
77
74
|
// `{recorded: true, decisionId: ''}` and the caller silently lost the
|
|
78
75
|
// decision. Capture failures must be loud, never inferred from absence.
|
|
79
76
|
const decisionId = typeof res.decisionId === 'string' ? res.decisionId : '';
|
|
77
|
+
const summary = typeof res.summary === 'string' ? res.summary : input.summary;
|
|
80
78
|
if (res.success === false || !decisionId) {
|
|
81
79
|
return {
|
|
82
80
|
recorded: false,
|
|
@@ -85,7 +83,10 @@ export async function recordDecision(input) {
|
|
|
85
83
|
'The decision was NOT saved (Kawa Code returned no decision id). Nothing has been persisted — re-send this decision, and if it fails again report the failure rather than assuming it was captured.',
|
|
86
84
|
};
|
|
87
85
|
}
|
|
88
|
-
|
|
86
|
+
// Echo the summary back beside the id so the caller can name what it just
|
|
87
|
+
// recorded — "«summary» (id)" — instead of printing a bare id. Costs nothing:
|
|
88
|
+
// the value was supplied by this same call.
|
|
89
|
+
return { recorded: true, decisionId, summary };
|
|
89
90
|
}
|
|
90
91
|
export const recordDecisionTool = {
|
|
91
92
|
name: 'record_decision',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-decision.js","sourceRoot":"","sources":["../../src/tools/record-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":"record-decision.js","sourceRoot":"","sources":["../../src/tools/record-decision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAA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,EAAE,KAAK;YACf,UAAU,EAAE,EAAE;YACd,KAAK,EACH,GAAG,CAAC,KAAK;gBACT,oMAAoM;SACvM,CAAA;IACH,CAAC;IAED,0EAA0E;IAC1E,8EAA8E;IAC9E,4CAA4C;IAC5C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,CAAA;AAChD,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;;;;;;;;;;;;;;;yGAe0F;IACvG,WAAW,EAAE,oBAAoB;IACjC,OAAO,EAAE,cAAc;CACxB,CAAA"}
|
|
@@ -13,20 +13,6 @@ import { type ProjectDecision } from './get-project-decisions.js';
|
|
|
13
13
|
* the full project list, but that's an optimization, not a requirement.
|
|
14
14
|
*/
|
|
15
15
|
export declare const resumeIntentSchema: z.ZodObject<{
|
|
16
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
17
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
18
|
-
user: z.ZodString;
|
|
19
|
-
forkOrigin: z.ZodString;
|
|
20
|
-
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
platform: "github" | "gitlab";
|
|
22
|
-
user: string;
|
|
23
|
-
forkOrigin: string;
|
|
24
|
-
}, {
|
|
25
|
-
platform: "github" | "gitlab";
|
|
26
|
-
user: string;
|
|
27
|
-
forkOrigin: string;
|
|
28
|
-
}>>;
|
|
29
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
30
16
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
31
17
|
repoPath: z.ZodString;
|
|
32
18
|
intentId: z.ZodString;
|
|
@@ -34,22 +20,10 @@ export declare const resumeIntentSchema: z.ZodObject<{
|
|
|
34
20
|
repoPath: string;
|
|
35
21
|
intentId: string;
|
|
36
22
|
repoOrigin?: string | undefined;
|
|
37
|
-
forkAuthor?: {
|
|
38
|
-
platform: "github" | "gitlab";
|
|
39
|
-
user: string;
|
|
40
|
-
forkOrigin: string;
|
|
41
|
-
} | undefined;
|
|
42
|
-
workspaceId?: string | undefined;
|
|
43
23
|
}, {
|
|
44
24
|
repoPath: string;
|
|
45
25
|
intentId: string;
|
|
46
26
|
repoOrigin?: string | undefined;
|
|
47
|
-
forkAuthor?: {
|
|
48
|
-
platform: "github" | "gitlab";
|
|
49
|
-
user: string;
|
|
50
|
-
forkOrigin: string;
|
|
51
|
-
} | undefined;
|
|
52
|
-
workspaceId?: string | undefined;
|
|
53
27
|
}>;
|
|
54
28
|
export type ResumeIntentInput = z.infer<typeof resumeIntentSchema>;
|
|
55
29
|
export interface ResumeIntentResponse {
|
|
@@ -71,20 +45,6 @@ export declare const resumeIntentTool: {
|
|
|
71
45
|
name: string;
|
|
72
46
|
description: string;
|
|
73
47
|
inputSchema: z.ZodObject<{
|
|
74
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
75
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
76
|
-
user: z.ZodString;
|
|
77
|
-
forkOrigin: z.ZodString;
|
|
78
|
-
}, "strip", z.ZodTypeAny, {
|
|
79
|
-
platform: "github" | "gitlab";
|
|
80
|
-
user: string;
|
|
81
|
-
forkOrigin: string;
|
|
82
|
-
}, {
|
|
83
|
-
platform: "github" | "gitlab";
|
|
84
|
-
user: string;
|
|
85
|
-
forkOrigin: string;
|
|
86
|
-
}>>;
|
|
87
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
88
48
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
89
49
|
repoPath: z.ZodString;
|
|
90
50
|
intentId: z.ZodString;
|
|
@@ -92,22 +52,10 @@ export declare const resumeIntentTool: {
|
|
|
92
52
|
repoPath: string;
|
|
93
53
|
intentId: string;
|
|
94
54
|
repoOrigin?: string | undefined;
|
|
95
|
-
forkAuthor?: {
|
|
96
|
-
platform: "github" | "gitlab";
|
|
97
|
-
user: string;
|
|
98
|
-
forkOrigin: string;
|
|
99
|
-
} | undefined;
|
|
100
|
-
workspaceId?: string | undefined;
|
|
101
55
|
}, {
|
|
102
56
|
repoPath: string;
|
|
103
57
|
intentId: string;
|
|
104
58
|
repoOrigin?: string | undefined;
|
|
105
|
-
forkAuthor?: {
|
|
106
|
-
platform: "github" | "gitlab";
|
|
107
|
-
user: string;
|
|
108
|
-
forkOrigin: string;
|
|
109
|
-
} | undefined;
|
|
110
|
-
workspaceId?: string | undefined;
|
|
111
59
|
}>;
|
|
112
60
|
handler: typeof resumeIntent;
|
|
113
61
|
};
|
|
@@ -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 { activateIntent } from './activate-intent.js';
|
|
6
5
|
import { getProjectDecisions } from './get-project-decisions.js';
|
|
7
6
|
/**
|
|
@@ -20,13 +19,12 @@ export const resumeIntentSchema = z.object({
|
|
|
20
19
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
21
20
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
22
21
|
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
22
|
});
|
|
25
23
|
export async function resumeIntent(input) {
|
|
26
24
|
// Resolve the origin once and pass it down, so the three sub-calls don't each
|
|
27
25
|
// re-shell out to git.
|
|
28
26
|
const origin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
29
|
-
const base = { repoOrigin: origin, repoPath: input.repoPath
|
|
27
|
+
const base = { repoOrigin: origin, repoPath: input.repoPath };
|
|
30
28
|
// 1. Adopt the intent as THIS session's current focus (multi-active — never
|
|
31
29
|
// displaces another session's current). Fail loud if it can't be activated.
|
|
32
30
|
const activated = await activateIntent({ ...base, intentId: input.intentId });
|
|
@@ -82,7 +80,11 @@ export async function resumeIntent(input) {
|
|
|
82
80
|
count: decisions.length,
|
|
83
81
|
message: intent
|
|
84
82
|
? `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
|
-
|
|
83
|
+
// No title to lead with — `intent:get` returned nothing. Print the id in
|
|
84
|
+
// FULL: an intent id is a Mongo ObjectId whose leading bytes are a
|
|
85
|
+
// creation timestamp, so a truncated one does not resolve to a single
|
|
86
|
+
// intent and would leave the reader with nothing they can look up.
|
|
87
|
+
: `Resumed intent ${input.intentId} — ${decisions.length} recorded decision(s) loaded.`,
|
|
86
88
|
};
|
|
87
89
|
}
|
|
88
90
|
export const resumeIntentTool = {
|
|
@@ -1 +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,
|
|
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,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAwB,MAAM,4BAA4B,CAAA;AAEtF;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,UAAU,EAAE,CAAC,CAAC,MAAM,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,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,yEAAyE;YACzE,mEAAmE;YACnE,sEAAsE;YACtE,mEAAmE;YACnE,CAAC,CAAC,kBAAkB,KAAK,CAAC,QAAQ,MAAM,SAAS,CAAC,MAAM,+BAA+B;KAC1F,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"}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const updateIntentSchema: 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
|
intentId: z.ZodOptional<z.ZodString>;
|
|
@@ -33,12 +19,6 @@ export declare const updateIntentSchema: z.ZodObject<{
|
|
|
33
19
|
}, "strip", z.ZodTypeAny, {
|
|
34
20
|
repoPath: string;
|
|
35
21
|
repoOrigin?: string | undefined;
|
|
36
|
-
forkAuthor?: {
|
|
37
|
-
platform: "github" | "gitlab";
|
|
38
|
-
user: string;
|
|
39
|
-
forkOrigin: string;
|
|
40
|
-
} | undefined;
|
|
41
|
-
workspaceId?: string | undefined;
|
|
42
22
|
title?: string | undefined;
|
|
43
23
|
description?: string | undefined;
|
|
44
24
|
constraints?: string[] | undefined;
|
|
@@ -50,12 +30,6 @@ export declare const updateIntentSchema: z.ZodObject<{
|
|
|
50
30
|
}, {
|
|
51
31
|
repoPath: string;
|
|
52
32
|
repoOrigin?: string | undefined;
|
|
53
|
-
forkAuthor?: {
|
|
54
|
-
platform: "github" | "gitlab";
|
|
55
|
-
user: string;
|
|
56
|
-
forkOrigin: string;
|
|
57
|
-
} | undefined;
|
|
58
|
-
workspaceId?: string | undefined;
|
|
59
33
|
title?: string | undefined;
|
|
60
34
|
description?: string | undefined;
|
|
61
35
|
constraints?: string[] | undefined;
|
|
@@ -78,20 +52,6 @@ export declare const updateIntentTool: {
|
|
|
78
52
|
name: string;
|
|
79
53
|
description: string;
|
|
80
54
|
inputSchema: z.ZodObject<{
|
|
81
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
82
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
83
|
-
user: z.ZodString;
|
|
84
|
-
forkOrigin: z.ZodString;
|
|
85
|
-
}, "strip", z.ZodTypeAny, {
|
|
86
|
-
platform: "github" | "gitlab";
|
|
87
|
-
user: string;
|
|
88
|
-
forkOrigin: string;
|
|
89
|
-
}, {
|
|
90
|
-
platform: "github" | "gitlab";
|
|
91
|
-
user: string;
|
|
92
|
-
forkOrigin: string;
|
|
93
|
-
}>>;
|
|
94
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
95
55
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
96
56
|
repoPath: z.ZodString;
|
|
97
57
|
intentId: z.ZodOptional<z.ZodString>;
|
|
@@ -111,12 +71,6 @@ export declare const updateIntentTool: {
|
|
|
111
71
|
}, "strip", z.ZodTypeAny, {
|
|
112
72
|
repoPath: string;
|
|
113
73
|
repoOrigin?: string | undefined;
|
|
114
|
-
forkAuthor?: {
|
|
115
|
-
platform: "github" | "gitlab";
|
|
116
|
-
user: string;
|
|
117
|
-
forkOrigin: string;
|
|
118
|
-
} | undefined;
|
|
119
|
-
workspaceId?: string | undefined;
|
|
120
74
|
title?: string | undefined;
|
|
121
75
|
description?: string | undefined;
|
|
122
76
|
constraints?: string[] | undefined;
|
|
@@ -128,12 +82,6 @@ export declare const updateIntentTool: {
|
|
|
128
82
|
}, {
|
|
129
83
|
repoPath: 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
|
title?: string | undefined;
|
|
138
86
|
description?: string | undefined;
|
|
139
87
|
constraints?: string[] | 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
|
export const updateIntentSchema = 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'),
|
|
@@ -13,15 +12,13 @@ export const updateIntentSchema = z.object({
|
|
|
13
12
|
type: z.enum(['repo', 'folder', 'files']),
|
|
14
13
|
paths: z.array(z.string())
|
|
15
14
|
}).optional().describe('Updated scope for the intent'),
|
|
16
|
-
...forkFieldsExtensions,
|
|
17
15
|
});
|
|
18
16
|
export async function updateIntent(input) {
|
|
19
17
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
20
|
-
const forkFields = extractForkFields(input);
|
|
21
18
|
// Resolve the intent ID: use provided intentId, or look up the active intent
|
|
22
19
|
let intentId = input.intentId;
|
|
23
20
|
if (!intentId) {
|
|
24
|
-
const activeRes = await request('intent', 'get-active', { repoOrigin: actualOrigin
|
|
21
|
+
const activeRes = await request('intent', 'get-active', { repoOrigin: actualOrigin });
|
|
25
22
|
intentId = activeRes.intentId || activeRes.intent?.id || '';
|
|
26
23
|
if (!intentId) {
|
|
27
24
|
return {
|
|
@@ -63,7 +60,6 @@ export async function updateIntent(input) {
|
|
|
63
60
|
id: intentId,
|
|
64
61
|
repoOrigin: actualOrigin,
|
|
65
62
|
updates,
|
|
66
|
-
...forkFields,
|
|
67
63
|
});
|
|
68
64
|
if (res.success === false) {
|
|
69
65
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-intent.js","sourceRoot":"","sources":["../../src/tools/update-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;
|
|
1
|
+
{"version":3,"file":"update-intent.js","sourceRoot":"","sources":["../../src/tools/update-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;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6EAA6E,CAAC;IACzH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CA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YAAY;QACxB,OAAO;KACR,CAAC,CAAA;IAEF,IAAI,GAAG,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QAC1B,OAAO;YACL,OAAO,EAAE,KAAK;YACd,QAAQ;YACR,OAAO,EAAE,GAAG,CAAC,KAAK,IAAI,sBAAsB;YAC5C,aAAa,EAAE,EAAE;SAClB,CAAA;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,QAAQ;QACR,OAAO,EAAE,mBAAmB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACtD,aAAa;QACb,OAAO,EAAE,GAAG,CAAC,OAAO;KACrB,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE;;;;;;;;;oEASqD;IAClE,WAAW,EAAE,kBAAkB;IAC/B,OAAO,EAAE,YAAY;CACtB,CAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity references — the shapes that carry a human-readable label alongside
|
|
3
|
+
* an id, so no tool response hands the model an id it cannot name.
|
|
4
|
+
*
|
|
5
|
+
* Workstream 1 of `kawa.dev-doc/DECISION_LINKING.md`. Before this, every
|
|
6
|
+
* reference reaching a human was a bare 8-char hex prefix:
|
|
7
|
+
*
|
|
8
|
+
* 7a7d1a36 supersedes 2cc444ec, which superseded 97c701e7
|
|
9
|
+
*
|
|
10
|
+
* Three ids, zero information. Naming a single ancestor cost an extra
|
|
11
|
+
* `get_decision_detail` round trip *per ancestor*, so it never happened.
|
|
12
|
+
* Kawa Code resolves the labels now and hands them over pre-joined.
|
|
13
|
+
*
|
|
14
|
+
* These refs carry **identity only** — never rationale, context or
|
|
15
|
+
* consequences. That is deliberate: recall payloads are kept lean, and a
|
|
16
|
+
* summary is bounded (~100 chars) and *is* the identity of the thing. If one of
|
|
17
|
+
* these ever grows a `rationale` field, that is the regression.
|
|
18
|
+
*/
|
|
19
|
+
/** A decision, named. */
|
|
20
|
+
export interface DecisionRef {
|
|
21
|
+
id: string;
|
|
22
|
+
summary: string;
|
|
23
|
+
type: string;
|
|
24
|
+
/**
|
|
25
|
+
* Distance along a supersession chain: 1 is a direct ancestor, 2 is what
|
|
26
|
+
* *that* one superseded, and so on.
|
|
27
|
+
*
|
|
28
|
+
* Present because order alone is ambiguous once a `supersedes` array is wider
|
|
29
|
+
* than one — without it there is no way to tell "A supersedes B and C" from
|
|
30
|
+
* "A supersedes B, which superseded C".
|
|
31
|
+
*/
|
|
32
|
+
depth?: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* An intent, named.
|
|
36
|
+
*
|
|
37
|
+
* `id` is always the **full 24-character** ObjectId, never a prefix. Intent ids
|
|
38
|
+
* are Mongo ObjectIds whose leading 4 bytes are a Unix timestamp, so two
|
|
39
|
+
* intents created by the same process in the same second share their first 18
|
|
40
|
+
* hex characters. A truncated intent id is not merely collision-prone — it is
|
|
41
|
+
* not resolvable to a single intent at all. Decision ids are UUIDs and do not
|
|
42
|
+
* have this problem; an 8-char decision prefix is unambiguous.
|
|
43
|
+
*/
|
|
44
|
+
export interface IntentRef {
|
|
45
|
+
id: string;
|
|
46
|
+
title: string;
|
|
47
|
+
status: string;
|
|
48
|
+
}
|
|
49
|
+
/** Shape Kawa Code returns for a resolved reference. Tolerant of an absent label. */
|
|
50
|
+
type RawRef = Record<string, unknown> | null | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Normalize one decision ref off an IPC payload.
|
|
53
|
+
*
|
|
54
|
+
* Returns `null` rather than a half-built ref when there is no id or summary —
|
|
55
|
+
* an unlabelled reference is not a ref, and callers fall back to the bare id,
|
|
56
|
+
* which is exactly the pre-W1 behaviour. Label resolution is fail-soft end to
|
|
57
|
+
* end: an unresolvable ancestor must never turn a working response into an error.
|
|
58
|
+
*/
|
|
59
|
+
export declare function toDecisionRef(raw: RawRef): DecisionRef | null;
|
|
60
|
+
/** Normalize one intent ref off an IPC payload. Same fail-soft contract. */
|
|
61
|
+
export declare function toIntentRef(raw: RawRef): IntentRef | null;
|
|
62
|
+
export declare function toDecisionRefs(raw: unknown): DecisionRef[];
|
|
63
|
+
export declare function toIntentRefs(raw: unknown): IntentRef[];
|
|
64
|
+
/**
|
|
65
|
+
* How to name an entity in a message.
|
|
66
|
+
*
|
|
67
|
+
* Leads with the label and keeps the id in parentheses, per the prose
|
|
68
|
+
* convention in LLM_RULES.md. Falls back to the bare id when nothing resolved,
|
|
69
|
+
* which is the whole point of the fail-soft contract above.
|
|
70
|
+
*/
|
|
71
|
+
export declare function nameDecision(ref: DecisionRef | null, fallbackId: string): string;
|
|
72
|
+
export declare function nameIntent(ref: IntentRef | null, fallbackId: string): string;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity references — the shapes that carry a human-readable label alongside
|
|
3
|
+
* an id, so no tool response hands the model an id it cannot name.
|
|
4
|
+
*
|
|
5
|
+
* Workstream 1 of `kawa.dev-doc/DECISION_LINKING.md`. Before this, every
|
|
6
|
+
* reference reaching a human was a bare 8-char hex prefix:
|
|
7
|
+
*
|
|
8
|
+
* 7a7d1a36 supersedes 2cc444ec, which superseded 97c701e7
|
|
9
|
+
*
|
|
10
|
+
* Three ids, zero information. Naming a single ancestor cost an extra
|
|
11
|
+
* `get_decision_detail` round trip *per ancestor*, so it never happened.
|
|
12
|
+
* Kawa Code resolves the labels now and hands them over pre-joined.
|
|
13
|
+
*
|
|
14
|
+
* These refs carry **identity only** — never rationale, context or
|
|
15
|
+
* consequences. That is deliberate: recall payloads are kept lean, and a
|
|
16
|
+
* summary is bounded (~100 chars) and *is* the identity of the thing. If one of
|
|
17
|
+
* these ever grows a `rationale` field, that is the regression.
|
|
18
|
+
*/
|
|
19
|
+
function str(value) {
|
|
20
|
+
return typeof value === 'string' ? value : '';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Normalize one decision ref off an IPC payload.
|
|
24
|
+
*
|
|
25
|
+
* Returns `null` rather than a half-built ref when there is no id or summary —
|
|
26
|
+
* an unlabelled reference is not a ref, and callers fall back to the bare id,
|
|
27
|
+
* which is exactly the pre-W1 behaviour. Label resolution is fail-soft end to
|
|
28
|
+
* end: an unresolvable ancestor must never turn a working response into an error.
|
|
29
|
+
*/
|
|
30
|
+
export function toDecisionRef(raw) {
|
|
31
|
+
if (!raw)
|
|
32
|
+
return null;
|
|
33
|
+
const id = str(raw.id) || str(raw.decisionId);
|
|
34
|
+
const summary = str(raw.summary);
|
|
35
|
+
if (!id || !summary)
|
|
36
|
+
return null;
|
|
37
|
+
const depth = typeof raw.depth === 'number' ? raw.depth : undefined;
|
|
38
|
+
return { id, summary, type: str(raw.type) || str(raw.decisionType), depth };
|
|
39
|
+
}
|
|
40
|
+
/** Normalize one intent ref off an IPC payload. Same fail-soft contract. */
|
|
41
|
+
export function toIntentRef(raw) {
|
|
42
|
+
if (!raw)
|
|
43
|
+
return null;
|
|
44
|
+
const id = str(raw.id) || str(raw.intentId);
|
|
45
|
+
const title = str(raw.title);
|
|
46
|
+
if (!id || !title)
|
|
47
|
+
return null;
|
|
48
|
+
return { id, title, status: str(raw.status) };
|
|
49
|
+
}
|
|
50
|
+
export function toDecisionRefs(raw) {
|
|
51
|
+
if (!Array.isArray(raw))
|
|
52
|
+
return [];
|
|
53
|
+
return raw.map(toDecisionRef).filter((r) => r !== null);
|
|
54
|
+
}
|
|
55
|
+
export function toIntentRefs(raw) {
|
|
56
|
+
if (!Array.isArray(raw))
|
|
57
|
+
return [];
|
|
58
|
+
return raw.map(toIntentRef).filter((r) => r !== null);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* How to name an entity in a message.
|
|
62
|
+
*
|
|
63
|
+
* Leads with the label and keeps the id in parentheses, per the prose
|
|
64
|
+
* convention in LLM_RULES.md. Falls back to the bare id when nothing resolved,
|
|
65
|
+
* which is the whole point of the fail-soft contract above.
|
|
66
|
+
*/
|
|
67
|
+
export function nameDecision(ref, fallbackId) {
|
|
68
|
+
return ref ? `"${ref.summary}" (${ref.id})` : fallbackId;
|
|
69
|
+
}
|
|
70
|
+
export function nameIntent(ref, fallbackId) {
|
|
71
|
+
return ref ? `"${ref.title}" (${ref.id})` : fallbackId;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=refs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.js","sourceRoot":"","sources":["../../src/types/refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAqCH,SAAS,GAAG,CAAC,KAAc;IACzB,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AAC/C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAA;IACrB,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IAC7C,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAChC,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;IACnE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,CAAA;AAC7E,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAA;I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AA;AACxD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kawacode/mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
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": {
|