@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_mangled-args.test.js","sourceRoot":"","sources":["../../src/tools/_mangled-args.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,MAAM,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE5E,MAAM,MAAM,GAAG;IACb,SAAS;IACT,WAAW;IACX,cAAc;IACd,SAAS;IACT,aAAa;IACb,cAAc;IACd,cAAc;IACd,YAAY;CACb,CAAA;AAED,IAAI,CAAC,wEAAwE,EAAE,GAAG,EAAE;IAClF,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,kBAAkB,CACpD;QACE,YAAY,EAAE,sFAAsF;KACrG,EACD,MAAM,CACP,CAAA;IAED,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAA;IAC1D,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,oBA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iBAAiB,CAAC,CAAA;IACxC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,mCAAmC,CAAC,CAAA;IAC1D,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAA;AAC/C,CAAC,CAAC,CAAA"}
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { IntentRef } from '../types/refs.js';
|
|
2
3
|
export declare const activateIntentSchema: 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 activateIntentSchema: 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 ActivateIntentInput = z.infer<typeof activateIntentSchema>;
|
|
42
17
|
export interface ActivateIntentResponse {
|
|
@@ -44,6 +19,10 @@ export interface ActivateIntentResponse {
|
|
|
44
19
|
intentId: string;
|
|
45
20
|
action?: 'activated' | 'already_active';
|
|
46
21
|
previousActiveId?: string;
|
|
22
|
+
/** The now-current intent, named. Absent when Kawa Code could not resolve it. */
|
|
23
|
+
activeIntent?: IntentRef;
|
|
24
|
+
/** The intent this replaced, named. Absent when there was none, or it did not resolve. */
|
|
25
|
+
previousActive?: IntentRef;
|
|
47
26
|
/** True when activation was refused because the intent is frozen (stale beyond the freeze window). */
|
|
48
27
|
frozen?: boolean;
|
|
49
28
|
error?: string;
|
|
@@ -54,20 +33,6 @@ export declare const activateIntentTool: {
|
|
|
54
33
|
name: string;
|
|
55
34
|
description: string;
|
|
56
35
|
inputSchema: z.ZodObject<{
|
|
57
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
58
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
59
|
-
user: z.ZodString;
|
|
60
|
-
forkOrigin: z.ZodString;
|
|
61
|
-
}, "strip", z.ZodTypeAny, {
|
|
62
|
-
platform: "github" | "gitlab";
|
|
63
|
-
user: string;
|
|
64
|
-
forkOrigin: string;
|
|
65
|
-
}, {
|
|
66
|
-
platform: "github" | "gitlab";
|
|
67
|
-
user: string;
|
|
68
|
-
forkOrigin: string;
|
|
69
|
-
}>>;
|
|
70
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
71
36
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
72
37
|
repoPath: z.ZodString;
|
|
73
38
|
intentId: z.ZodString;
|
|
@@ -75,22 +40,10 @@ export declare const activateIntentTool: {
|
|
|
75
40
|
repoPath: string;
|
|
76
41
|
intentId: string;
|
|
77
42
|
repoOrigin?: string | undefined;
|
|
78
|
-
forkAuthor?: {
|
|
79
|
-
platform: "github" | "gitlab";
|
|
80
|
-
user: string;
|
|
81
|
-
forkOrigin: string;
|
|
82
|
-
} | undefined;
|
|
83
|
-
workspaceId?: string | undefined;
|
|
84
43
|
}, {
|
|
85
44
|
repoPath: string;
|
|
86
45
|
intentId: string;
|
|
87
46
|
repoOrigin?: string | undefined;
|
|
88
|
-
forkAuthor?: {
|
|
89
|
-
platform: "github" | "gitlab";
|
|
90
|
-
user: string;
|
|
91
|
-
forkOrigin: string;
|
|
92
|
-
} | undefined;
|
|
93
|
-
workspaceId?: string | undefined;
|
|
94
47
|
}>;
|
|
95
48
|
handler: typeof activateIntent;
|
|
96
49
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
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 { nameIntent, toIntentRef } from '../types/refs.js';
|
|
5
5
|
export const activateIntentSchema = 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 cloud ID (preferred) or local UUID of the existing intent to activate.'),
|
|
9
|
-
...forkFieldsExtensions,
|
|
10
9
|
});
|
|
11
10
|
export async function activateIntent(input) {
|
|
12
11
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -19,7 +18,10 @@ export async function activateIntent(input) {
|
|
|
19
18
|
intentId: input.intentId,
|
|
20
19
|
action: 'already_active',
|
|
21
20
|
previousActiveId,
|
|
22
|
-
|
|
21
|
+
// Intent ids are NEVER truncated: they are Mongo ObjectIds whose leading
|
|
22
|
+
// bytes are a timestamp, so a prefix does not identify a single intent.
|
|
23
|
+
// Here there is no title to lead with, so the full id is the answer.
|
|
24
|
+
message: `Intent ${input.intentId} is already your current intent`,
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
27
|
// Move THIS session's `current` pointer to the target intent. Under the
|
|
@@ -28,7 +30,6 @@ export async function activateIntent(input) {
|
|
|
28
30
|
const res = await request('intent', 'set-active', {
|
|
29
31
|
repoOrigin: actualOrigin,
|
|
30
32
|
intentId: input.intentId,
|
|
31
|
-
...extractForkFields(input),
|
|
32
33
|
});
|
|
33
34
|
// A failed set-active must not be reported as an activation. The main case is
|
|
34
35
|
// the freeze gate: reactivating an intent stale beyond the freeze window is
|
|
@@ -39,17 +40,23 @@ export async function activateIntent(input) {
|
|
|
39
40
|
intentId: input.intentId,
|
|
40
41
|
frozen: res.frozen === true,
|
|
41
42
|
error: res.error || 'Could not activate this intent.',
|
|
42
|
-
message: res.error || `Could not activate intent ${input.intentId
|
|
43
|
+
message: res.error || `Could not activate intent ${input.intentId}.`,
|
|
43
44
|
};
|
|
44
45
|
}
|
|
46
|
+
// Kawa Code resolves both ends of the switch, so the message can name them.
|
|
47
|
+
const activeIntent = toIntentRef(res?.activeIntent);
|
|
48
|
+
const previousActive = toIntentRef(res?.previousActive);
|
|
49
|
+
const activeName = nameIntent(activeIntent, input.intentId);
|
|
45
50
|
return {
|
|
46
51
|
success: true,
|
|
47
52
|
intentId: input.intentId,
|
|
48
53
|
action: 'activated',
|
|
49
54
|
previousActiveId: previousActiveId || undefined,
|
|
55
|
+
activeIntent: activeIntent ?? undefined,
|
|
56
|
+
previousActive: previousActive ?? undefined,
|
|
50
57
|
message: previousActiveId
|
|
51
|
-
? `Switched current intent to ${
|
|
52
|
-
: `Activated intent ${
|
|
58
|
+
? `Switched current intent to ${activeName} (was: ${nameIntent(previousActive, previousActiveId)})`
|
|
59
|
+
: `Activated intent ${activeName}`,
|
|
53
60
|
};
|
|
54
61
|
}
|
|
55
62
|
export const activateIntentTool = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activate-intent.js","sourceRoot":"","sources":["../../src/tools/activate-intent.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S;QAC3C,OAAO,EAAE,gBAAgB;YACvB,CAAC,CAAC,8BAA8B,UAAU,UAAU,UAAU,CAAC,cAAc,EAAE,gBAAgB,CAAC,GAAG;YACnG,CAAC,CAAC,oBAAoB,UAAU,EAAE;KACrC,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;uBAoBQ;IACrB,WAAW,EAAE,oBAAoB;IACjC,OAAO,EAAE,cAAc;CACxB,CAAA"}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const arbiterApplySchema: 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
|
repoPath: z.ZodString;
|
|
18
4
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
19
5
|
intentId: z.ZodOptional<z.ZodString>;
|
|
@@ -38,12 +24,6 @@ export declare const arbiterApplySchema: z.ZodObject<{
|
|
|
38
24
|
ranges: number[][];
|
|
39
25
|
}[];
|
|
40
26
|
repoOrigin?: string | undefined;
|
|
41
|
-
forkAuthor?: {
|
|
42
|
-
platform: "github" | "gitlab";
|
|
43
|
-
user: string;
|
|
44
|
-
forkOrigin: string;
|
|
45
|
-
} | undefined;
|
|
46
|
-
workspaceId?: string | undefined;
|
|
47
27
|
intentId?: string | undefined;
|
|
48
28
|
}, {
|
|
49
29
|
repoPath: string;
|
|
@@ -53,12 +33,6 @@ export declare const arbiterApplySchema: z.ZodObject<{
|
|
|
53
33
|
ranges: number[][];
|
|
54
34
|
}[];
|
|
55
35
|
repoOrigin?: string | undefined;
|
|
56
|
-
forkAuthor?: {
|
|
57
|
-
platform: "github" | "gitlab";
|
|
58
|
-
user: string;
|
|
59
|
-
forkOrigin: string;
|
|
60
|
-
} | undefined;
|
|
61
|
-
workspaceId?: string | undefined;
|
|
62
36
|
intentId?: string | undefined;
|
|
63
37
|
}>;
|
|
64
38
|
export type ArbiterApplyInput = z.infer<typeof arbiterApplySchema>;
|
|
@@ -67,20 +41,6 @@ export declare const arbiterApplyTool: {
|
|
|
67
41
|
name: string;
|
|
68
42
|
description: string;
|
|
69
43
|
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
44
|
repoPath: z.ZodString;
|
|
85
45
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
86
46
|
intentId: z.ZodOptional<z.ZodString>;
|
|
@@ -105,12 +65,6 @@ export declare const arbiterApplyTool: {
|
|
|
105
65
|
ranges: number[][];
|
|
106
66
|
}[];
|
|
107
67
|
repoOrigin?: string | undefined;
|
|
108
|
-
forkAuthor?: {
|
|
109
|
-
platform: "github" | "gitlab";
|
|
110
|
-
user: string;
|
|
111
|
-
forkOrigin: string;
|
|
112
|
-
} | undefined;
|
|
113
|
-
workspaceId?: string | undefined;
|
|
114
68
|
intentId?: string | undefined;
|
|
115
69
|
}, {
|
|
116
70
|
repoPath: string;
|
|
@@ -120,12 +74,6 @@ export declare const arbiterApplyTool: {
|
|
|
120
74
|
ranges: number[][];
|
|
121
75
|
}[];
|
|
122
76
|
repoOrigin?: string | undefined;
|
|
123
|
-
forkAuthor?: {
|
|
124
|
-
platform: "github" | "gitlab";
|
|
125
|
-
user: string;
|
|
126
|
-
forkOrigin: string;
|
|
127
|
-
} | undefined;
|
|
128
|
-
workspaceId?: string | undefined;
|
|
129
77
|
intentId?: string | undefined;
|
|
130
78
|
}>;
|
|
131
79
|
handler: typeof arbiterApply;
|
|
@@ -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
|
* arbiter_apply — thin forwarder to Muninn `arbiter:apply` (Arbiter v2).
|
|
7
6
|
* Judges → adversarially verifies → auto-applies only the trivial tier, and ONLY
|
|
@@ -30,7 +29,6 @@ export const arbiterApplySchema = z.object({
|
|
|
30
29
|
overlaps: z
|
|
31
30
|
.array(overlapSchema)
|
|
32
31
|
.describe('The overlaps to resolve — each { peerUid, filePath, ranges } from the Stop collision report.'),
|
|
33
|
-
...forkFieldsExtensions,
|
|
34
32
|
});
|
|
35
33
|
export async function arbiterApply(input) {
|
|
36
34
|
const repoOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -39,7 +37,6 @@ export async function arbiterApply(input) {
|
|
|
39
37
|
repoPath: input.repoPath,
|
|
40
38
|
intentId: input.intentId,
|
|
41
39
|
overlaps: input.overlaps,
|
|
42
|
-
...extractForkFields(input),
|
|
43
40
|
});
|
|
44
41
|
return res;
|
|
45
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arbiter-apply.js","sourceRoot":"","sources":["../../src/tools/arbiter-apply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"arbiter-apply.js","sourceRoot":"","sources":["../../src/tools/arbiter-apply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,CAAC,iFAAiF,CAAC;IAC9F,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IAC7E,MAAM,EAAE,CAAC;SACN,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;SAC1B,QAAQ,CAAC,4EAA4E,CAAC;CAC1F,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAClE,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,6EAA6E,CAAC;IAC1F,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,iFAAiF,CAAC;IAC9F,QAAQ,EAAE,CAAC;SACR,KAAK,CAAC,aAAa,CAAC;SACpB,QAAQ,CAAC,8FAA8F,CAAC;CAC5G,CAAC,CAAA;AAIF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,KAAwB;IACzD,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IAClE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE;QAC5C,UAAU;QACV,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,uGAAuG;QACvG,yGAAyG;QACzG,uGAAuG;QACvG,uGAAuG;QACvG,yGAAyG;QACzG,0GAA0G;QAC1G,0GAA0G;QAC1G,qCAAqC;IACvC,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 arbiterResolveSchema: 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
|
repoPath: z.ZodString;
|
|
18
4
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
19
5
|
intentId: z.ZodOptional<z.ZodString>;
|
|
@@ -38,12 +24,6 @@ export declare const arbiterResolveSchema: z.ZodObject<{
|
|
|
38
24
|
ranges: number[][];
|
|
39
25
|
}[];
|
|
40
26
|
repoOrigin?: string | undefined;
|
|
41
|
-
forkAuthor?: {
|
|
42
|
-
platform: "github" | "gitlab";
|
|
43
|
-
user: string;
|
|
44
|
-
forkOrigin: string;
|
|
45
|
-
} | undefined;
|
|
46
|
-
workspaceId?: string | undefined;
|
|
47
27
|
intentId?: string | undefined;
|
|
48
28
|
}, {
|
|
49
29
|
repoPath: string;
|
|
@@ -53,12 +33,6 @@ export declare const arbiterResolveSchema: z.ZodObject<{
|
|
|
53
33
|
ranges: number[][];
|
|
54
34
|
}[];
|
|
55
35
|
repoOrigin?: string | undefined;
|
|
56
|
-
forkAuthor?: {
|
|
57
|
-
platform: "github" | "gitlab";
|
|
58
|
-
user: string;
|
|
59
|
-
forkOrigin: string;
|
|
60
|
-
} | undefined;
|
|
61
|
-
workspaceId?: string | undefined;
|
|
62
36
|
intentId?: string | undefined;
|
|
63
37
|
}>;
|
|
64
38
|
export type ArbiterResolveInput = z.infer<typeof arbiterResolveSchema>;
|
|
@@ -67,20 +41,6 @@ export declare const arbiterResolveTool: {
|
|
|
67
41
|
name: string;
|
|
68
42
|
description: string;
|
|
69
43
|
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
44
|
repoPath: z.ZodString;
|
|
85
45
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
86
46
|
intentId: z.ZodOptional<z.ZodString>;
|
|
@@ -105,12 +65,6 @@ export declare const arbiterResolveTool: {
|
|
|
105
65
|
ranges: number[][];
|
|
106
66
|
}[];
|
|
107
67
|
repoOrigin?: string | undefined;
|
|
108
|
-
forkAuthor?: {
|
|
109
|
-
platform: "github" | "gitlab";
|
|
110
|
-
user: string;
|
|
111
|
-
forkOrigin: string;
|
|
112
|
-
} | undefined;
|
|
113
|
-
workspaceId?: string | undefined;
|
|
114
68
|
intentId?: string | undefined;
|
|
115
69
|
}, {
|
|
116
70
|
repoPath: string;
|
|
@@ -120,12 +74,6 @@ export declare const arbiterResolveTool: {
|
|
|
120
74
|
ranges: number[][];
|
|
121
75
|
}[];
|
|
122
76
|
repoOrigin?: string | undefined;
|
|
123
|
-
forkAuthor?: {
|
|
124
|
-
platform: "github" | "gitlab";
|
|
125
|
-
user: string;
|
|
126
|
-
forkOrigin: string;
|
|
127
|
-
} | undefined;
|
|
128
|
-
workspaceId?: string | undefined;
|
|
129
77
|
intentId?: string | undefined;
|
|
130
78
|
}>;
|
|
131
79
|
handler: typeof arbiterResolve;
|
|
@@ -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
|
* arbiter_resolve — thin forwarder to Muninn `arbiter:resolve` (Arbiter v2).
|
|
7
6
|
* Suggest-only: judges live code overlaps with peers and returns verdicts; never
|
|
@@ -30,7 +29,6 @@ export const arbiterResolveSchema = z.object({
|
|
|
30
29
|
overlaps: z
|
|
31
30
|
.array(overlapSchema)
|
|
32
31
|
.describe('The overlaps to judge — each { peerUid, filePath, ranges } from the Stop collision report.'),
|
|
33
|
-
...forkFieldsExtensions,
|
|
34
32
|
});
|
|
35
33
|
export async function arbiterResolve(input) {
|
|
36
34
|
const repoOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -39,7 +37,6 @@ export async function arbiterResolve(input) {
|
|
|
39
37
|
repoPath: input.repoPath,
|
|
40
38
|
intentId: input.intentId,
|
|
41
39
|
overlaps: input.overlaps,
|
|
42
|
-
...extractForkFields(input),
|
|
43
40
|
});
|
|
44
41
|
return res;
|
|
45
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arbiter-resolve.js","sourceRoot":"","sources":["../../src/tools/arbiter-resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"arbiter-resolve.js","sourceRoot":"","sources":["../../src/tools/arbiter-resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,CAAC,iFAAiF,CAAC;IAC9F,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IAC7E,MAAM,EAAE,CAAC;SACN,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;SAC1B,QAAQ,CAAC,4EAA4E,CAAC;CAC1F,CAAC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odEnum<["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 CheckActiveIntentInput = z.infer<typeof checkActiveIntentSchema>;
|
|
39
13
|
export interface IntentBlock {
|
|
@@ -83,40 +57,14 @@ export declare const checkActiveIntentTool: {
|
|
|
83
57
|
name: string;
|
|
84
58
|
description: string;
|
|
85
59
|
inputSchema: z.ZodObject<{
|
|
86
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
87
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
88
|
-
user: z.ZodString;
|
|
89
|
-
forkOrigin: z.ZodString;
|
|
90
|
-
}, "strip", z.ZodTypeAny, {
|
|
91
|
-
platform: "github" | "gitlab";
|
|
92
|
-
user: string;
|
|
93
|
-
forkOrigin: string;
|
|
94
|
-
}, {
|
|
95
|
-
platform: "github" | "gitlab";
|
|
96
|
-
user: string;
|
|
97
|
-
forkOrigin: string;
|
|
98
|
-
}>>;
|
|
99
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
100
60
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
101
61
|
repoPath: z.ZodString;
|
|
102
62
|
}, "strip", z.ZodTypeAny, {
|
|
103
63
|
repoPath: string;
|
|
104
64
|
repoOrigin?: string | undefined;
|
|
105
|
-
forkAuthor?: {
|
|
106
|
-
platform: "github" | "gitlab";
|
|
107
|
-
user: string;
|
|
108
|
-
forkOrigin: string;
|
|
109
|
-
} | undefined;
|
|
110
|
-
workspaceId?: string | undefined;
|
|
111
65
|
}, {
|
|
112
66
|
repoPath: string;
|
|
113
67
|
repoOrigin?: string | undefined;
|
|
114
|
-
forkAuthor?: {
|
|
115
|
-
platform: "github" | "gitlab";
|
|
116
|
-
user: string;
|
|
117
|
-
forkOrigin: string;
|
|
118
|
-
} | undefined;
|
|
119
|
-
workspaceId?: string | undefined;
|
|
120
68
|
}>;
|
|
121
69
|
handler: typeof checkActiveIntent;
|
|
122
70
|
};
|
|
@@ -1,18 +1,15 @@
|
|
|
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 checkActiveIntentSchema = z.object({
|
|
7
6
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
8
7
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
9
|
-
...forkFieldsExtensions,
|
|
10
8
|
});
|
|
11
9
|
export async function checkActiveIntent(input) {
|
|
12
10
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
13
11
|
const res = await request('intent', 'get-active', {
|
|
14
12
|
repoOrigin: actualOrigin,
|
|
15
|
-
...extractForkFields(input),
|
|
16
13
|
});
|
|
17
14
|
// Muninn returns { hasActiveIntent, intentId, intent, activeIntents }.
|
|
18
15
|
// The active set is present regardless of whether THIS session has a current.
|
|
@@ -60,28 +57,9 @@ export async function checkActiveIntent(input) {
|
|
|
60
57
|
}
|
|
61
58
|
export const checkActiveIntentTool = {
|
|
62
59
|
name: 'check_active_intent',
|
|
63
|
-
description: `REQUIRED
|
|
60
|
+
description: `REQUIRED before writing any code. Returns this session's current intent; if there is none, confirm the details with the user and call create_and_activate_intent.
|
|
64
61
|
|
|
65
|
-
|
|
66
|
-
set. If not, ask the user to confirm intent details and then call
|
|
67
|
-
create_and_activate_intent.
|
|
68
|
-
|
|
69
|
-
Multi-active model: the active intent is PER SESSION. Many intents can be active
|
|
70
|
-
on a repo at once — your current is independent of other sessions'/teammates'.
|
|
71
|
-
The response also includes \`activeIntents\`: the repo's full active set (every
|
|
72
|
-
session's current intent, with id/title/status/createdBy/author) for awareness
|
|
73
|
-
and orchestration. \`hasActiveIntent\` reflects only YOUR session; \`activeIntents\`
|
|
74
|
-
may be non-empty even when you have no current.
|
|
75
|
-
|
|
76
|
-
An active intent tracks what the user is working on, enabling:
|
|
77
|
-
- Better code context for AI-generated changes
|
|
78
|
-
- Conflict detection with team members
|
|
79
|
-
- Automatic assignment of code blocks to the intent
|
|
80
|
-
|
|
81
|
-
Status semantics:
|
|
82
|
-
- "active" — normal, in-progress. A stale intent simply stays "active"; the
|
|
83
|
-
sweeper preserves its work without any status transition.
|
|
84
|
-
- terminal states — committed / pushed / done / abandoned / superseded.`,
|
|
62
|
+
Intents are active PER SESSION — many can be active on one repo at once. hasActiveIntent reflects only YOUR session, while activeIntents lists every session's current intent (yours and teammates') and may be non-empty when you have none. A stale intent stays "active"; terminal states are committed / pushed / done / abandoned / superseded.`,
|
|
85
63
|
inputSchema: checkActiveIntentSchema,
|
|
86
64
|
handler: checkActiveIntent
|
|
87
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-active-intent.js","sourceRoot":"","sources":["../../src/tools/check-active-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":"check-active-intent.js","sourceRoot":"","sources":["../../src/tools/check-active-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,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAE/D,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;CACnE,CAAC,CAAA;AAiDF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAA6B;IACnE,MAAM,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IAEpE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE;QAChD,UAAU,EAAE,YAAY;KACzB,CAAC,CAAA;IAEF,uEAAuE;IACvE,8EAA8E;IAC9E,MAAM,aAAa,GAA0B,KAAK,CA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