@kawacode/mcp 5.2.0 → 6.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 +1 -1
- package/README.md +54 -198
- package/build/index.js +10 -1
- package/build/index.js.map +1 -1
- package/build/kawacode-on-pre-edit.d.ts +27 -0
- package/build/kawacode-on-pre-edit.js +205 -0
- package/build/kawacode-on-pre-edit.js.map +1 -0
- package/build/kawacode-on-stop.d.ts +29 -0
- package/build/kawacode-on-stop.js +84 -0
- package/build/kawacode-on-stop.js.map +1 -0
- package/build/prompts/intent-first-workflow.js +2 -2
- package/build/services/muninn-ipc.d.ts +10 -5
- package/build/services/muninn-ipc.js +13 -8
- package/build/services/muninn-ipc.js.map +1 -1
- package/build/tools/_fork-fields.d.ts +84 -0
- package/build/tools/_fork-fields.js +65 -0
- package/build/tools/_fork-fields.js.map +1 -0
- package/build/tools/activate-intent.d.ts +66 -0
- package/build/tools/activate-intent.js +59 -3
- package/build/tools/activate-intent.js.map +1 -1
- package/build/tools/check-active-intent.d.ts +64 -0
- package/build/tools/check-active-intent.js +16 -2
- package/build/tools/check-active-intent.js.map +1 -1
- package/build/tools/complete-intent.d.ts +115 -4
- package/build/tools/complete-intent.js +130 -11
- package/build/tools/complete-intent.js.map +1 -1
- package/build/tools/create-intent.d.ts +73 -1
- package/build/tools/create-intent.js +105 -7
- package/build/tools/create-intent.js.map +1 -1
- package/build/tools/detect-intent-conflicts.d.ts +52 -0
- package/build/tools/detect-intent-conflicts.js +14 -10
- package/build/tools/detect-intent-conflicts.js.map +1 -1
- package/build/tools/edit-session-decision.d.ts +64 -12
- package/build/tools/edit-session-decision.js +4 -1
- package/build/tools/edit-session-decision.js.map +1 -1
- package/build/tools/evolve-decisions.d.ts +52 -0
- package/build/tools/evolve-decisions.js +14 -15
- package/build/tools/evolve-decisions.js.map +1 -1
- package/build/tools/get-intent-changes.d.ts +52 -0
- package/build/tools/get-intent-changes.js +4 -1
- package/build/tools/get-intent-changes.js.map +1 -1
- package/build/tools/get-intents-for-file.d.ts +52 -0
- package/build/tools/get-intents-for-file.js +4 -1
- package/build/tools/get-intents-for-file.js.map +1 -1
- package/build/tools/get-intents-for-lines.d.ts +52 -0
- package/build/tools/get-intents-for-lines.js +4 -1
- package/build/tools/get-intents-for-lines.js.map +1 -1
- package/build/tools/get-project-decisions.d.ts +52 -0
- package/build/tools/get-project-decisions.js +4 -1
- package/build/tools/get-project-decisions.js.map +1 -1
- package/build/tools/get-relevant-context.d.ts +52 -0
- package/build/tools/get-relevant-context.js +18 -24
- package/build/tools/get-relevant-context.js.map +1 -1
- package/build/tools/get-session-decisions.d.ts +52 -0
- package/build/tools/get-session-decisions.js +4 -1
- package/build/tools/get-session-decisions.js.map +1 -1
- package/build/tools/index.d.ts +620 -18
- package/build/tools/index.js +12 -3
- package/build/tools/index.js.map +1 -1
- package/build/tools/infer-history.d.ts +6 -0
- package/build/tools/infer-history.js +33 -16
- package/build/tools/infer-history.js.map +1 -1
- package/build/tools/list-team-intents.d.ts +58 -6
- package/build/tools/list-team-intents.js +5 -2
- package/build/tools/list-team-intents.js.map +1 -1
- package/build/tools/log-work.d.ts +52 -0
- package/build/tools/log-work.js +4 -1
- package/build/tools/log-work.js.map +1 -1
- package/build/tools/pre-edit-acknowledge.d.ts +92 -0
- package/build/tools/pre-edit-acknowledge.js +48 -0
- package/build/tools/pre-edit-acknowledge.js.map +1 -0
- package/build/tools/pre-edit-decision-check.d.ts +141 -0
- package/build/tools/pre-edit-decision-check.js +77 -0
- package/build/tools/pre-edit-decision-check.js.map +1 -0
- package/build/tools/record-decision.d.ts +88 -12
- package/build/tools/record-decision.js +15 -1
- package/build/tools/record-decision.js.map +1 -1
- package/build/tools/update-intent.d.ts +60 -8
- package/build/tools/update-intent.js +6 -1
- package/build/tools/update-intent.js.map +1 -1
- package/package.json +6 -3
package/build/tools/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { getIntentsForLinesTool, getIntentsForLines, getIntentsForLinesSchema }
|
|
|
7
7
|
import { listTeamIntentsTool, listTeamIntents, listTeamIntentsSchema } from './list-team-intents.js';
|
|
8
8
|
import { getIntentChangesTool, getIntentChanges, getIntentChangesSchema } from './get-intent-changes.js';
|
|
9
9
|
import { completeIntentTool, completeIntent, completeIntentSchema } from './complete-intent.js';
|
|
10
|
+
import { updateIntentTool, updateIntent, updateIntentSchema } from './update-intent.js';
|
|
10
11
|
import { logWorkTool, logWork, logWorkSchema } from './log-work.js';
|
|
11
12
|
import { recordDecisionTool, recordDecision, recordDecisionSchema } from './record-decision.js';
|
|
12
13
|
import { getSessionDecisionsTool, getSessionDecisions, getSessionDecisionsSchema } from './get-session-decisions.js';
|
|
@@ -15,12 +16,14 @@ import { editSessionDecisionTool, editSessionDecision, editSessionDecisionSchema
|
|
|
15
16
|
import { detectIntentConflictsTool, detectIntentConflicts, detectIntentConflictsSchema } from './detect-intent-conflicts.js';
|
|
16
17
|
import { inferHistoryTool, inferHistory, inferHistorySchema } from './infer-history.js';
|
|
17
18
|
import { evolveDecisionsTool, evolveDecisions, evolveDecisionsSchema } from './evolve-decisions.js';
|
|
19
|
+
import { preEditDecisionCheckTool, preEditDecisionCheck, preEditDecisionCheckSchema } from './pre-edit-decision-check.js';
|
|
20
|
+
import { preEditAcknowledgeTool, preEditAcknowledge, preEditAcknowledgeSchema } from './pre-edit-acknowledge.js';
|
|
18
21
|
// Re-export everything
|
|
19
22
|
export {
|
|
20
23
|
// Relevance-based context (call per request)
|
|
21
24
|
getRelevantContextTool, getRelevantContext, getRelevantContextSchema,
|
|
22
25
|
// Intent tools
|
|
23
|
-
checkActiveIntentTool, checkActiveIntent, checkActiveIntentSchema, createAndActivateIntentTool, createAndActivateIntent, createAndActivateIntentSchema, activateIntentTool, activateIntent, activateIntentSchema, getIntentsForFileTool, getIntentsForFile, getIntentsForFileSchema, getIntentsForLinesTool, getIntentsForLines, getIntentsForLinesSchema, listTeamIntentsTool, listTeamIntents, listTeamIntentsSchema, getIntentChangesTool, getIntentChanges, getIntentChangesSchema, completeIntentTool, completeIntent, completeIntentSchema,
|
|
26
|
+
checkActiveIntentTool, checkActiveIntent, checkActiveIntentSchema, createAndActivateIntentTool, createAndActivateIntent, createAndActivateIntentSchema, activateIntentTool, activateIntent, activateIntentSchema, getIntentsForFileTool, getIntentsForFile, getIntentsForFileSchema, getIntentsForLinesTool, getIntentsForLines, getIntentsForLinesSchema, listTeamIntentsTool, listTeamIntents, listTeamIntentsSchema, getIntentChangesTool, getIntentChanges, getIntentChangesSchema, completeIntentTool, completeIntent, completeIntentSchema, updateIntentTool, updateIntent, updateIntentSchema,
|
|
24
27
|
// Lightweight logging
|
|
25
28
|
logWorkTool, logWork, logWorkSchema,
|
|
26
29
|
// Decision recording tools
|
|
@@ -28,7 +31,9 @@ recordDecisionTool, recordDecision, recordDecisionSchema, getSessionDecisionsToo
|
|
|
28
31
|
// Conflict detection
|
|
29
32
|
detectIntentConflictsTool, detectIntentConflicts, detectIntentConflictsSchema,
|
|
30
33
|
// Inference pipeline tools
|
|
31
|
-
inferHistoryTool, inferHistory, inferHistorySchema, evolveDecisionsTool, evolveDecisions, evolveDecisionsSchema
|
|
34
|
+
inferHistoryTool, inferHistory, inferHistorySchema, evolveDecisionsTool, evolveDecisions, evolveDecisionsSchema,
|
|
35
|
+
// Pre-edit decision check
|
|
36
|
+
preEditDecisionCheckTool, preEditDecisionCheck, preEditDecisionCheckSchema, preEditAcknowledgeTool, preEditAcknowledge, preEditAcknowledgeSchema };
|
|
32
37
|
export const allTools = [
|
|
33
38
|
// Relevance-based context - CALL PER REQUEST
|
|
34
39
|
getRelevantContextTool,
|
|
@@ -41,6 +46,7 @@ export const allTools = [
|
|
|
41
46
|
listTeamIntentsTool,
|
|
42
47
|
getIntentChangesTool,
|
|
43
48
|
completeIntentTool,
|
|
49
|
+
updateIntentTool,
|
|
44
50
|
// Lightweight logging
|
|
45
51
|
logWorkTool,
|
|
46
52
|
// Decision recording tools
|
|
@@ -52,6 +58,9 @@ export const allTools = [
|
|
|
52
58
|
detectIntentConflictsTool,
|
|
53
59
|
// Inference pipeline tools
|
|
54
60
|
inferHistoryTool,
|
|
55
|
-
evolveDecisionsTool
|
|
61
|
+
evolveDecisionsTool,
|
|
62
|
+
// Pre-edit decision check
|
|
63
|
+
preEditDecisionCheckTool,
|
|
64
|
+
preEditAcknowledgeTool
|
|
56
65
|
];
|
|
57
66
|
//# sourceMappingURL=index.js.map
|
package/build/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAC5G,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAChH,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAA;AACxH,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC/F,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAC7G,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACjH,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AACpG,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AACxG,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC/F,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,kBAAkB,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
2
|
export declare const inferHistorySchema: z.ZodObject<{
|
|
3
3
|
repoPath: z.ZodString;
|
|
4
4
|
commits: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
commitRange: z.ZodOptional<z.ZodString>;
|
|
5
6
|
contextIssues: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
6
7
|
model: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
7
8
|
maxStories: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -15,9 +16,11 @@ export declare const inferHistorySchema: z.ZodObject<{
|
|
|
15
16
|
allowCommitSplitting: boolean;
|
|
16
17
|
estimateOnly: boolean;
|
|
17
18
|
commits?: number | undefined;
|
|
19
|
+
commitRange?: string | undefined;
|
|
18
20
|
}, {
|
|
19
21
|
repoPath: string;
|
|
20
22
|
commits?: number | undefined;
|
|
23
|
+
commitRange?: string | undefined;
|
|
21
24
|
contextIssues?: boolean | undefined;
|
|
22
25
|
model?: string | undefined;
|
|
23
26
|
maxStories?: number | undefined;
|
|
@@ -56,6 +59,7 @@ export declare const inferHistoryTool: {
|
|
|
56
59
|
inputSchema: z.ZodObject<{
|
|
57
60
|
repoPath: z.ZodString;
|
|
58
61
|
commits: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
commitRange: z.ZodOptional<z.ZodString>;
|
|
59
63
|
contextIssues: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
60
64
|
model: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
61
65
|
maxStories: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -69,9 +73,11 @@ export declare const inferHistoryTool: {
|
|
|
69
73
|
allowCommitSplitting: boolean;
|
|
70
74
|
estimateOnly: boolean;
|
|
71
75
|
commits?: number | undefined;
|
|
76
|
+
commitRange?: string | undefined;
|
|
72
77
|
}, {
|
|
73
78
|
repoPath: string;
|
|
74
79
|
commits?: number | undefined;
|
|
80
|
+
commitRange?: string | undefined;
|
|
75
81
|
contextIssues?: boolean | undefined;
|
|
76
82
|
model?: string | undefined;
|
|
77
83
|
maxStories?: number | undefined;
|
|
@@ -2,10 +2,11 @@ import { z } from 'zod';
|
|
|
2
2
|
import { request } from '../services/muninn-ipc.js';
|
|
3
3
|
export const inferHistorySchema = z.object({
|
|
4
4
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
5
|
-
commits: z.number().optional().describe('Number of recent commits to analyze. If omitted, the server resumes from the last commit infer_history processed for this repo (or falls back to 50 on first run).'),
|
|
5
|
+
commits: z.number().optional().describe('Number of recent commits to analyze. If omitted, the server resumes from the last commit infer_history processed for this repo (or falls back to 50 on first run). Mutually exclusive with `commitRange`.'),
|
|
6
|
+
commitRange: z.string().optional().describe('Optional git revspec to process a specific commit range instead of the N most recent (e.g. "sha1..sha2", "branch1..branch2", "sha1^!" for a single commit). Useful for recovering from dropped batches or targeted backfills. Mutually exclusive with `commits`.'),
|
|
6
7
|
contextIssues: z.boolean().optional().default(false).describe('Include context issues from commit date range (requires gh/glab CLI)'),
|
|
7
8
|
model: z.string().optional().default('claude-sonnet-4-20250514').describe('Anthropic model to use (default: claude-sonnet-4-20250514)'),
|
|
8
|
-
maxStories: z.number().optional().default(0).describe('Maximum stories to analyze in
|
|
9
|
+
maxStories: z.number().optional().default(0).describe('Maximum number of stories to analyze in this run (0 = unlimited).'),
|
|
9
10
|
allowCommitSplitting: z.boolean().optional().default(false).describe('Allow splitting a single commit into multiple stories when it contains unrelated changes (recommended for repos with messy commit history)'),
|
|
10
11
|
estimateOnly: z.boolean().optional().default(true).describe('If true (default), only estimate token cost without running the pipeline. Set to false to run the full pipeline.'),
|
|
11
12
|
});
|
|
@@ -27,6 +28,11 @@ function describeAutoMode(am) {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
export async function inferHistory(input) {
|
|
31
|
+
// commits and commitRange are mutually exclusive. Catch in the MCP layer so
|
|
32
|
+
// the user gets a clear error instead of an opaque muninn-side rejection.
|
|
33
|
+
if (input.commits !== undefined && input.commitRange !== undefined) {
|
|
34
|
+
throw new Error('infer_history: `commits` and `commitRange` are mutually exclusive — set only one.');
|
|
35
|
+
}
|
|
30
36
|
// Only forward `commits` when the caller explicitly provided one, so the
|
|
31
37
|
// server can fall back to last_inferred_sha tracking otherwise.
|
|
32
38
|
const inferencePayload = {
|
|
@@ -36,8 +42,14 @@ export async function inferHistory(input) {
|
|
|
36
42
|
};
|
|
37
43
|
if (input.commits !== undefined)
|
|
38
44
|
inferencePayload.commits = input.commits;
|
|
45
|
+
if (input.commitRange !== undefined)
|
|
46
|
+
inferencePayload.commitRange = input.commitRange;
|
|
39
47
|
if (input.estimateOnly) {
|
|
40
|
-
|
|
48
|
+
// Walking git history on deep repos (e.g., zed at 37k commits) exceeds
|
|
49
|
+
// the 30s default. Estimate is synchronous — no async-start response —
|
|
50
|
+
// so the caller blocks until the server returns.
|
|
51
|
+
const ESTIMATE_TIMEOUT_MS = 180_000;
|
|
52
|
+
const res = await request('inference', 'estimate', inferencePayload, ESTIMATE_TIMEOUT_MS);
|
|
41
53
|
let forgeWarning = '';
|
|
42
54
|
if (!res.forge_cli_available) {
|
|
43
55
|
const forge = res.forge ?? 'Unknown';
|
|
@@ -70,6 +82,8 @@ export async function inferHistory(input) {
|
|
|
70
82
|
};
|
|
71
83
|
if (input.commits !== undefined)
|
|
72
84
|
runPayload.commits = input.commits;
|
|
85
|
+
if (input.commitRange !== undefined)
|
|
86
|
+
runPayload.commitRange = input.commitRange;
|
|
73
87
|
const res = await request('inference', 'run', runPayload);
|
|
74
88
|
const autoModeNote = res.autoMode ? describeAutoMode(res.autoMode) : '';
|
|
75
89
|
return {
|
|
@@ -80,22 +94,25 @@ export async function inferHistory(input) {
|
|
|
80
94
|
}
|
|
81
95
|
export const inferHistoryTool = {
|
|
82
96
|
name: 'infer_history',
|
|
83
|
-
description: `Analyze git commit history
|
|
84
|
-
|
|
85
|
-
Runs the full pipeline automatically: infer → evolve → persist.
|
|
86
|
-
|
|
87
|
-
1. **Pass 1**: Groups commits into coherent development stories with value hints
|
|
88
|
-
2. **Pass 2**: Deep analysis of each story to extract architectural decisions
|
|
89
|
-
3. **Evolution**: Curates decisions by finding relationships (supersedes, reinforces, contradicts, specializes)
|
|
90
|
-
4. **Persist**: Stores curated stories as intents with decisions (auto-syncs to cloud)
|
|
91
|
-
|
|
92
|
-
Use \`estimateOnly: true\` first to preview token cost before running the full pipeline.
|
|
97
|
+
description: `Analyze a repository's git commit history and produce structured development knowledge (intents and decisions) for the repo.
|
|
93
98
|
|
|
94
|
-
|
|
99
|
+
When to use:
|
|
100
|
+
- To bootstrap a repository that has no recorded intents/decisions yet.
|
|
101
|
+
- To extend coverage for new commits since the last run (resumes automatically when no \`commits\` value is provided).
|
|
95
102
|
|
|
96
|
-
|
|
103
|
+
Inputs of note:
|
|
104
|
+
- \`estimateOnly\` (default true): returns a token/cost estimate without running. Call with \`estimateOnly: true\` first to preview cost, then re-call with \`estimateOnly: false\` to run.
|
|
105
|
+
- \`commits\` (optional): how many recent commits to analyze. Omit to resume from where the last run stopped (or fall back to a sensible default on first run).
|
|
106
|
+
- \`commitRange\` (optional): git revspec selecting a specific window — \`"sha1..sha2"\`, \`"branch1..branch2"\`, \`"sha1^!"\` for a single commit. Mutually exclusive with \`commits\`. Useful for recovering from dropped batches or backfilling specific PRs / branches without re-running the full history.
|
|
107
|
+
- \`contextIssues\`: include PR/MR descriptions and issue discussions when an authenticated forge CLI (\`gh\` or \`glab\`) is available; auto-skipped otherwise.
|
|
108
|
+
- \`allowCommitSplitting\`: enable when commit history is messy and a single commit may cover unrelated changes.
|
|
109
|
+
- \`model\`, \`maxStories\`: Anthropic model and per-run cap.
|
|
97
110
|
|
|
98
|
-
|
|
111
|
+
Behavior:
|
|
112
|
+
- A run is asynchronous — returns immediately with a started/pending status; progress is reported separately.
|
|
113
|
+
- Results are persisted as intents and decisions for the repo on completion.
|
|
114
|
+
- If interrupted, re-running resumes from where it left off.
|
|
115
|
+
- GitHub and GitLab are supported; the forge is detected from the remote origin.`,
|
|
99
116
|
inputSchema: inferHistorySchema,
|
|
100
117
|
handler: inferHistory
|
|
101
118
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infer-history.js","sourceRoot":"","sources":["../../src/tools/infer-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAClE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"infer-history.js","sourceRoot":"","sources":["../../src/tools/infer-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAClE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2MAA2M,CAAC;IACpP,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kQAAkQ,CAAC;IAC/S,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,sEAAsE,CAAC;IACrI,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC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Q;QACtB,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,IAAI,iFAAiF,CAAC,GAAG,YAAY;KAC3H,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE;;;;;;;;;;;;;;;;;;iFAkBkE;IAC/E,WAAW,EAAE,kBAAkB;IAC/B,OAAO,EAAE,YAAY;CACtB,CAAA"}
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const listTeamIntentsSchema: 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>;
|
|
3
17
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
4
18
|
repoPath: z.ZodString;
|
|
5
|
-
status: z.ZodOptional<z.ZodEnum<["active", "committed", "pushed", "done", "abandoned"]>>;
|
|
19
|
+
status: z.ZodOptional<z.ZodEnum<["active", "pending", "committed", "pushed", "done", "abandoned"]>>;
|
|
6
20
|
author: z.ZodOptional<z.ZodString>;
|
|
7
21
|
since: z.ZodOptional<z.ZodString>;
|
|
8
22
|
until: z.ZodOptional<z.ZodString>;
|
|
@@ -12,15 +26,27 @@ export declare const listTeamIntentsSchema: z.ZodObject<{
|
|
|
12
26
|
repoPath: string;
|
|
13
27
|
limit: number;
|
|
14
28
|
offset: number;
|
|
29
|
+
status?: "pending" | "active" | "committed" | "pushed" | "done" | "abandoned" | undefined;
|
|
15
30
|
repoOrigin?: string | undefined;
|
|
16
|
-
|
|
31
|
+
forkAuthor?: {
|
|
32
|
+
platform: "github" | "gitlab";
|
|
33
|
+
user: string;
|
|
34
|
+
forkOrigin: string;
|
|
35
|
+
} | undefined;
|
|
36
|
+
workspaceId?: string | undefined;
|
|
17
37
|
author?: string | undefined;
|
|
18
38
|
since?: string | undefined;
|
|
19
39
|
until?: string | undefined;
|
|
20
40
|
}, {
|
|
21
41
|
repoPath: string;
|
|
42
|
+
status?: "pending" | "active" | "committed" | "pushed" | "done" | "abandoned" | undefined;
|
|
22
43
|
repoOrigin?: string | undefined;
|
|
23
|
-
|
|
44
|
+
forkAuthor?: {
|
|
45
|
+
platform: "github" | "gitlab";
|
|
46
|
+
user: string;
|
|
47
|
+
forkOrigin: string;
|
|
48
|
+
} | undefined;
|
|
49
|
+
workspaceId?: string | undefined;
|
|
24
50
|
author?: string | undefined;
|
|
25
51
|
since?: string | undefined;
|
|
26
52
|
until?: string | undefined;
|
|
@@ -50,9 +76,23 @@ export declare const listTeamIntentsTool: {
|
|
|
50
76
|
name: string;
|
|
51
77
|
description: string;
|
|
52
78
|
inputSchema: z.ZodObject<{
|
|
79
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
81
|
+
user: z.ZodString;
|
|
82
|
+
forkOrigin: z.ZodString;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
platform: "github" | "gitlab";
|
|
85
|
+
user: string;
|
|
86
|
+
forkOrigin: string;
|
|
87
|
+
}, {
|
|
88
|
+
platform: "github" | "gitlab";
|
|
89
|
+
user: string;
|
|
90
|
+
forkOrigin: string;
|
|
91
|
+
}>>;
|
|
92
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
53
93
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
54
94
|
repoPath: z.ZodString;
|
|
55
|
-
status: z.ZodOptional<z.ZodEnum<["active", "committed", "pushed", "done", "abandoned"]>>;
|
|
95
|
+
status: z.ZodOptional<z.ZodEnum<["active", "pending", "committed", "pushed", "done", "abandoned"]>>;
|
|
56
96
|
author: z.ZodOptional<z.ZodString>;
|
|
57
97
|
since: z.ZodOptional<z.ZodString>;
|
|
58
98
|
until: z.ZodOptional<z.ZodString>;
|
|
@@ -62,15 +102,27 @@ export declare const listTeamIntentsTool: {
|
|
|
62
102
|
repoPath: string;
|
|
63
103
|
limit: number;
|
|
64
104
|
offset: number;
|
|
105
|
+
status?: "pending" | "active" | "committed" | "pushed" | "done" | "abandoned" | undefined;
|
|
65
106
|
repoOrigin?: string | undefined;
|
|
66
|
-
|
|
107
|
+
forkAuthor?: {
|
|
108
|
+
platform: "github" | "gitlab";
|
|
109
|
+
user: string;
|
|
110
|
+
forkOrigin: string;
|
|
111
|
+
} | undefined;
|
|
112
|
+
workspaceId?: string | undefined;
|
|
67
113
|
author?: string | undefined;
|
|
68
114
|
since?: string | undefined;
|
|
69
115
|
until?: string | undefined;
|
|
70
116
|
}, {
|
|
71
117
|
repoPath: string;
|
|
118
|
+
status?: "pending" | "active" | "committed" | "pushed" | "done" | "abandoned" | undefined;
|
|
72
119
|
repoOrigin?: string | undefined;
|
|
73
|
-
|
|
120
|
+
forkAuthor?: {
|
|
121
|
+
platform: "github" | "gitlab";
|
|
122
|
+
user: string;
|
|
123
|
+
forkOrigin: string;
|
|
124
|
+
} | undefined;
|
|
125
|
+
workspaceId?: string | undefined;
|
|
74
126
|
author?: string | undefined;
|
|
75
127
|
since?: string | undefined;
|
|
76
128
|
until?: string | undefined;
|
|
@@ -1,22 +1,25 @@
|
|
|
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';
|
|
4
5
|
export const listTeamIntentsSchema = z.object({
|
|
5
6
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
6
7
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
7
|
-
status: z.enum(['active', 'committed', 'pushed', 'done', 'abandoned']).optional()
|
|
8
|
-
.describe('Filter by intent status'),
|
|
8
|
+
status: z.enum(['active', 'pending', 'committed', 'pushed', 'done', 'abandoned']).optional()
|
|
9
|
+
.describe('Filter by intent status. "pending" surfaces intents auto-finalized by the sweeper or blocked at completion by conflicts — these are resumable via activate_intent.'),
|
|
9
10
|
author: z.string().optional().describe('Filter by author name or ID'),
|
|
10
11
|
since: z.string().optional().describe('Filter intents updated after this ISO8601 date (e.g. "2026-04-01")'),
|
|
11
12
|
until: z.string().optional().describe('Filter intents updated before this ISO8601 date'),
|
|
12
13
|
limit: z.number().optional().default(50).describe('Maximum number of intents to return (default: 50)'),
|
|
13
14
|
offset: z.number().optional().default(0).describe('Number of intents to skip for pagination (default: 0)'),
|
|
15
|
+
...forkFieldsExtensions,
|
|
14
16
|
});
|
|
15
17
|
export async function listTeamIntents(input) {
|
|
16
18
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
17
19
|
const res = await request('intent', 'list', {
|
|
18
20
|
repoOrigin: actualOrigin,
|
|
19
21
|
status: input.status,
|
|
22
|
+
...extractForkFields(input),
|
|
20
23
|
});
|
|
21
24
|
let intents = (res.intents || []).map((intent) => ({
|
|
22
25
|
id: intent.id || '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-team-intents.js","sourceRoot":"","sources":["../../src/tools/list-team-intents.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":"list-team-intents.js","sourceRoot":"","sources":["../../src/tools/list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E,MAAM,GAAG,KAAK,CAAC,CAAA;IAEvD,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,MAAM,CAAA;IACvE,MAAM,OAAO,GAAG,KAAK,KAAK,CAAC;QACzB,CAAC,CAAC,kBAAkB;QACpB,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,wBAAwB,KAAK,SAAS,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,WAAW,SAAS,CAAA;IAE7H,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,KAAK;QACZ,OAAO;KACR,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE;;;;;;;wFAOyE;IACtF,WAAW,EAAE,qBAAqB;IAClC,OAAO,EAAE,eAAe;CACzB,CAAA"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const logWorkSchema: 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>;
|
|
3
17
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
4
18
|
repoPath: z.ZodString;
|
|
5
19
|
title: z.ZodString;
|
|
@@ -8,11 +22,23 @@ export declare const logWorkSchema: z.ZodObject<{
|
|
|
8
22
|
repoPath: string;
|
|
9
23
|
title: string;
|
|
10
24
|
repoOrigin?: string | undefined;
|
|
25
|
+
forkAuthor?: {
|
|
26
|
+
platform: "github" | "gitlab";
|
|
27
|
+
user: string;
|
|
28
|
+
forkOrigin: string;
|
|
29
|
+
} | undefined;
|
|
30
|
+
workspaceId?: string | undefined;
|
|
11
31
|
files?: string[] | undefined;
|
|
12
32
|
}, {
|
|
13
33
|
repoPath: string;
|
|
14
34
|
title: string;
|
|
15
35
|
repoOrigin?: string | undefined;
|
|
36
|
+
forkAuthor?: {
|
|
37
|
+
platform: "github" | "gitlab";
|
|
38
|
+
user: string;
|
|
39
|
+
forkOrigin: string;
|
|
40
|
+
} | undefined;
|
|
41
|
+
workspaceId?: string | undefined;
|
|
16
42
|
files?: string[] | undefined;
|
|
17
43
|
}>;
|
|
18
44
|
export type LogWorkInput = z.infer<typeof logWorkSchema>;
|
|
@@ -26,6 +52,20 @@ export declare const logWorkTool: {
|
|
|
26
52
|
name: string;
|
|
27
53
|
description: string;
|
|
28
54
|
inputSchema: z.ZodObject<{
|
|
55
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
57
|
+
user: z.ZodString;
|
|
58
|
+
forkOrigin: z.ZodString;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
platform: "github" | "gitlab";
|
|
61
|
+
user: string;
|
|
62
|
+
forkOrigin: string;
|
|
63
|
+
}, {
|
|
64
|
+
platform: "github" | "gitlab";
|
|
65
|
+
user: string;
|
|
66
|
+
forkOrigin: string;
|
|
67
|
+
}>>;
|
|
68
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
29
69
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
30
70
|
repoPath: z.ZodString;
|
|
31
71
|
title: z.ZodString;
|
|
@@ -34,11 +74,23 @@ export declare const logWorkTool: {
|
|
|
34
74
|
repoPath: string;
|
|
35
75
|
title: string;
|
|
36
76
|
repoOrigin?: string | undefined;
|
|
77
|
+
forkAuthor?: {
|
|
78
|
+
platform: "github" | "gitlab";
|
|
79
|
+
user: string;
|
|
80
|
+
forkOrigin: string;
|
|
81
|
+
} | undefined;
|
|
82
|
+
workspaceId?: string | undefined;
|
|
37
83
|
files?: string[] | undefined;
|
|
38
84
|
}, {
|
|
39
85
|
repoPath: string;
|
|
40
86
|
title: string;
|
|
41
87
|
repoOrigin?: string | undefined;
|
|
88
|
+
forkAuthor?: {
|
|
89
|
+
platform: "github" | "gitlab";
|
|
90
|
+
user: string;
|
|
91
|
+
forkOrigin: string;
|
|
92
|
+
} | undefined;
|
|
93
|
+
workspaceId?: string | undefined;
|
|
42
94
|
files?: string[] | undefined;
|
|
43
95
|
}>;
|
|
44
96
|
handler: typeof logWork;
|
package/build/tools/log-work.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
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';
|
|
4
5
|
export const logWorkSchema = z.object({
|
|
5
6
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
6
7
|
repoPath: z.string().describe('Local path to repository root'),
|
|
7
8
|
title: z.string().max(200).describe('Short description of the work done'),
|
|
8
|
-
files: z.array(z.string()).optional().describe('File paths modified (relative to repo root)')
|
|
9
|
+
files: z.array(z.string()).optional().describe('File paths modified (relative to repo root)'),
|
|
10
|
+
...forkFieldsExtensions,
|
|
9
11
|
});
|
|
10
12
|
export async function logWork(input) {
|
|
11
13
|
const origin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -13,6 +15,7 @@ export async function logWork(input) {
|
|
|
13
15
|
repoOrigin: origin,
|
|
14
16
|
title: input.title,
|
|
15
17
|
files: input.files || [],
|
|
18
|
+
...extractForkFields(input),
|
|
16
19
|
});
|
|
17
20
|
const intentId = res.intentId || '';
|
|
18
21
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-work.js","sourceRoot":"","sources":["../../src/tools/log-work.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":"log-work.js","sourceRoot":"","sources":["../../src/tools/log-work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE3E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6EAA6E,CAAC;IACzH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAC9D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IACzE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;IAC7F,GAAG,oBAAoB;CACxB,CAAC,CAAA;AAUF,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,KAAmB;IAC/C,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IAE9D,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,UAAU,EAAE;QAC9C,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE;QACxB,GAAG,iBAAiB,CAAC,KAAK,CAAC;KAC5B,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAA;IAEnC,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO,KAAK,KAAK;QAC9B,QAAQ;QACR,OAAO,EAAE,YAAY,KAAK,CAAC,KAAK,GAAG;KACpC,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,8SAA8S;IAC3T,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE,OAAO;CACjB,CAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Thin proxy to Muninn's `pre-edit-cache:add` handler.
|
|
4
|
+
*
|
|
5
|
+
* Pre-thinning, this tool wrapped a local cache.ts module that itself
|
|
6
|
+
* called the same Muninn IPC. Phase 3 of the kawa.mcp → kawa.muninn
|
|
7
|
+
* migration drops the wrapper. Telemetry now lives in Muninn too —
|
|
8
|
+
* the `pre-edit-cache:add` handler emits its own override event.
|
|
9
|
+
*/
|
|
10
|
+
export declare const preEditAcknowledgeSchema: z.ZodObject<{
|
|
11
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
12
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
13
|
+
user: z.ZodString;
|
|
14
|
+
forkOrigin: z.ZodString;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
platform: "github" | "gitlab";
|
|
17
|
+
user: string;
|
|
18
|
+
forkOrigin: string;
|
|
19
|
+
}, {
|
|
20
|
+
platform: "github" | "gitlab";
|
|
21
|
+
user: string;
|
|
22
|
+
forkOrigin: string;
|
|
23
|
+
}>>;
|
|
24
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
25
|
+
decisionIds: z.ZodArray<z.ZodString, "many">;
|
|
26
|
+
sessionToken: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
decisionIds: string[];
|
|
29
|
+
forkAuthor?: {
|
|
30
|
+
platform: "github" | "gitlab";
|
|
31
|
+
user: string;
|
|
32
|
+
forkOrigin: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
workspaceId?: string | undefined;
|
|
35
|
+
sessionToken?: string | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
decisionIds: string[];
|
|
38
|
+
forkAuthor?: {
|
|
39
|
+
platform: "github" | "gitlab";
|
|
40
|
+
user: string;
|
|
41
|
+
forkOrigin: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
workspaceId?: string | undefined;
|
|
44
|
+
sessionToken?: string | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
export type PreEditAcknowledgeInput = z.infer<typeof preEditAcknowledgeSchema>;
|
|
47
|
+
export interface PreEditAcknowledgeResponse {
|
|
48
|
+
acknowledged: number;
|
|
49
|
+
cacheSize: number;
|
|
50
|
+
}
|
|
51
|
+
export declare function preEditAcknowledge(input: PreEditAcknowledgeInput): Promise<PreEditAcknowledgeResponse>;
|
|
52
|
+
export declare const preEditAcknowledgeTool: {
|
|
53
|
+
name: string;
|
|
54
|
+
description: string;
|
|
55
|
+
inputSchema: z.ZodObject<{
|
|
56
|
+
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
58
|
+
user: z.ZodString;
|
|
59
|
+
forkOrigin: z.ZodString;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
platform: "github" | "gitlab";
|
|
62
|
+
user: string;
|
|
63
|
+
forkOrigin: string;
|
|
64
|
+
}, {
|
|
65
|
+
platform: "github" | "gitlab";
|
|
66
|
+
user: string;
|
|
67
|
+
forkOrigin: string;
|
|
68
|
+
}>>;
|
|
69
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
decisionIds: z.ZodArray<z.ZodString, "many">;
|
|
71
|
+
sessionToken: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
decisionIds: string[];
|
|
74
|
+
forkAuthor?: {
|
|
75
|
+
platform: "github" | "gitlab";
|
|
76
|
+
user: string;
|
|
77
|
+
forkOrigin: string;
|
|
78
|
+
} | undefined;
|
|
79
|
+
workspaceId?: string | undefined;
|
|
80
|
+
sessionToken?: string | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
decisionIds: string[];
|
|
83
|
+
forkAuthor?: {
|
|
84
|
+
platform: "github" | "gitlab";
|
|
85
|
+
user: string;
|
|
86
|
+
forkOrigin: string;
|
|
87
|
+
} | undefined;
|
|
88
|
+
workspaceId?: string | undefined;
|
|
89
|
+
sessionToken?: string | undefined;
|
|
90
|
+
}>;
|
|
91
|
+
handler: typeof preEditAcknowledge;
|
|
92
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { request, SESSION_ID } from '../services/muninn-ipc.js';
|
|
3
|
+
import { forkFieldsExtensions } from './_fork-fields.js';
|
|
4
|
+
/**
|
|
5
|
+
* Thin proxy to Muninn's `pre-edit-cache:add` handler.
|
|
6
|
+
*
|
|
7
|
+
* Pre-thinning, this tool wrapped a local cache.ts module that itself
|
|
8
|
+
* called the same Muninn IPC. Phase 3 of the kawa.mcp → kawa.muninn
|
|
9
|
+
* migration drops the wrapper. Telemetry now lives in Muninn too —
|
|
10
|
+
* the `pre-edit-cache:add` handler emits its own override event.
|
|
11
|
+
*/
|
|
12
|
+
export const preEditAcknowledgeSchema = z.object({
|
|
13
|
+
decisionIds: z
|
|
14
|
+
.array(z.string().min(1))
|
|
15
|
+
.min(1)
|
|
16
|
+
.describe('Decision IDs to acknowledge (mark as overridden for the rest of this session)'),
|
|
17
|
+
sessionToken: z
|
|
18
|
+
.string()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Session scope for the force-override cache. Should match the sessionToken passed to pre_edit_decision_check. Defaults to the MCP server\'s SESSION_ID.'),
|
|
21
|
+
...forkFieldsExtensions,
|
|
22
|
+
});
|
|
23
|
+
export async function preEditAcknowledge(input) {
|
|
24
|
+
const sessionToken = input.sessionToken ?? SESSION_ID;
|
|
25
|
+
const res = await request('pre-edit-cache', 'add', {
|
|
26
|
+
sessionToken,
|
|
27
|
+
decisionIds: input.decisionIds,
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
acknowledged: typeof res?.added === 'number' ? res.added : 0,
|
|
31
|
+
cacheSize: typeof res?.total === 'number' ? res.total : 0,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export const preEditAcknowledgeTool = {
|
|
35
|
+
name: 'pre_edit_acknowledge',
|
|
36
|
+
description: `Mark decisions as consciously overridden for the rest of this session.
|
|
37
|
+
|
|
38
|
+
Phase 3's PreToolUse hook calls this when the agent passes \`force: true\` on an Edit tool call to bypass a pre_edit_decision_check block. Adds the surfaced decision IDs to an in-memory session cache; subsequent pre_edit_decision_check fires filter those IDs out so the same block doesn't re-fire.
|
|
39
|
+
|
|
40
|
+
The cache resets when the MCP server process exits (= the agent session ends). For persistent override across sessions, record a fork decision via \`record_decision(type: "fork", supersedes: [<id>])\` instead.
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
- acknowledged: number of newly-added IDs (existing IDs are deduped silently)
|
|
44
|
+
- cacheSize: total IDs currently in the session override cache`,
|
|
45
|
+
inputSchema: preEditAcknowledgeSchema,
|
|
46
|
+
handler: preEditAcknowled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