@kawacode/mcp 6.1.5 → 6.6.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.
Files changed (63) hide show
  1. package/CLAUDE.md.example +2 -0
  2. package/build/index.js +13 -1
  3. package/build/index.js.map +1 -1
  4. package/build/kawacode-on-pre-edit.d.ts +5 -0
  5. package/build/kawacode-on-pre-edit.js +45 -6
  6. package/build/kawacode-on-pre-edit.js.map +1 -1
  7. package/build/kawacode-on-stop.d.ts +49 -23
  8. package/build/kawacode-on-stop.js +233 -38
  9. package/build/kawacode-on-stop.js.map +1 -1
  10. package/build/services/muninn-ipc.d.ts +19 -1
  11. package/build/services/muninn-ipc.js +20 -2
  12. package/build/services/muninn-ipc.js.map +1 -1
  13. package/build/stop/uncompleted-commit.d.ts +45 -0
  14. package/build/stop/uncompleted-commit.js +117 -0
  15. package/build/stop/uncompleted-commit.js.map +1 -0
  16. package/build/stop/uncompleted-commit.test.d.ts +1 -0
  17. package/build/stop/uncompleted-commit.test.js +105 -0
  18. package/build/stop/uncompleted-commit.test.js.map +1 -0
  19. package/build/tools/activate-intent.d.ts +1 -14
  20. package/build/tools/activate-intent.js +17 -56
  21. package/build/tools/activate-intent.js.map +1 -1
  22. package/build/tools/arbiter-apply.d.ts +132 -0
  23. package/build/tools/arbiter-apply.js +59 -0
  24. package/build/tools/arbiter-apply.js.map +1 -0
  25. package/build/tools/arbiter-resolve.d.ts +132 -0
  26. package/build/tools/arbiter-resolve.js +58 -0
  27. package/build/tools/arbiter-resolve.js.map +1 -0
  28. package/build/tools/check-active-intent.d.ts +21 -12
  29. package/build/tools/check-active-intent.js +26 -13
  30. package/build/tools/check-active-intent.js.map +1 -1
  31. package/build/tools/complete-intent.d.ts +29 -0
  32. package/build/tools/complete-intent.js +26 -28
  33. package/build/tools/complete-intent.js.map +1 -1
  34. package/build/tools/create-intent.d.ts +1 -21
  35. package/build/tools/create-intent.js +18 -106
  36. package/build/tools/create-intent.js.map +1 -1
  37. package/build/tools/get-decision-detail.d.ts +109 -0
  38. package/build/tools/get-decision-detail.js +57 -0
  39. package/build/tools/get-decision-detail.js.map +1 -0
  40. package/build/tools/get-project-decisions.d.ts +0 -4
  41. package/build/tools/get-project-decisions.js +4 -6
  42. package/build/tools/get-project-decisions.js.map +1 -1
  43. package/build/tools/get-relevant-context.d.ts +0 -1
  44. package/build/tools/get-relevant-context.js +4 -2
  45. package/build/tools/get-relevant-context.js.map +1 -1
  46. package/build/tools/get-resolution-context.d.ts +154 -0
  47. package/build/tools/get-resolution-context.js +78 -0
  48. package/build/tools/get-resolution-context.js.map +1 -0
  49. package/build/tools/get-session-decisions.d.ts +0 -5
  50. package/build/tools/get-session-decisions.js +5 -5
  51. package/build/tools/get-session-decisions.js.map +1 -1
  52. package/build/tools/index.d.ts +210 -7
  53. package/build/tools/index.js +13 -3
  54. package/build/tools/index.js.map +1 -1
  55. package/build/tools/list-team-intents.d.ts +6 -6
  56. package/build/tools/list-team-intents.js +2 -2
  57. package/build/tools/list-team-intents.js.map +1 -1
  58. package/build/tools/pre-edit-decision-check.js +2 -0
  59. package/build/tools/pre-edit-decision-check.js.map +1 -1
  60. package/build/tools/record-decision.d.ts +76 -0
  61. package/build/tools/record-decision.js +10 -0
  62. package/build/tools/record-decision.js.map +1 -1
  63. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"get-relevant-context.js","sourceRoot":"","sources":["../../src/tools/get-relevant-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE3E,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,UAAU,EAAE,CAAC,CAAC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,EAAE,CAAC;YACxG,IAAI,EAAE,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,aAAa,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE;YACvD,OAAO,EAAE,CAAC,CAAC,OAAO,IAAI,EAAE;YACxB,4EAA4E;YAC5E,2EAA2E;YAC3E,sEAAsE;YACtE,YAAY,EAAE,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,aAAa,IAAI,EAAE;YACrD,aAAa,EAAE,CAAC,CAAC,CAAC,oBAAoB,IAAI,CAAC,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC;YACnF,KAAK,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC;YACnB,WAAW,EAAE,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,EAAE,IAAI,SAAS;SAClE,CAAC,CAAC;QAEH,OAAO,EAAE;YACP,oBAAoB,EAAE,GAAG,CAAC,OAAO,EAAE,YAAY,IAAI,CAAC;YACpD,sBAAsB,EAAE,GAAG,CAAC,OAAO,EAAE,cAAc,IAAI,CAAC;YACxD,eAAe,EAAE,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM;YAC3C,iBAAiB,EAAE,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM;SAChD;KACF,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE;;;;;;;;;;;;;;;;;;wFAkByE;IACtF,WAAW,EAAE,wBAAwB;IACrC,OAAO,EAAE,kBAAkB;CAC5B,CAAA"}
@@ -0,0 +1,154 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Thin proxy to Muninn's `pre-edit-check:resolution-context` handler (Layer C,
4
+ * Phase 2 — proactive pre-edit conflict resolution).
5
+ *
6
+ * Two-call protocol:
7
+ * 1. DETECT (cheap, once per turn) — the Stop hook surfaces a live-HAI
8
+ * collision report (per-peer `uid` + overlapping file ranges) when a peer
9
+ * is editing the same lines this turn. (Detection was relocated off the
10
+ * per-edit pre_edit_decision_check to the Stop hook —
11
+ * COLLISION_SURFACE_RELOCATION.md.)
12
+ * 2. RESOLVE (expensive, opt-in) — for a peer surfaced in that report, call
13
+ * THIS tool with their `uid` + ranges. Muninn decrypts the peer's
14
+ * overlapping diff (it holds the repo key; the API only stores ciphertext)
15
+ * and returns it + the file's recorded decisions + a guardrail policy, so
16
+ * you can adapt.
17
+ *
18
+ * All assembly + the encryption boundary live in Muninn. This tool only
19
+ * validates input, resolves the origin, and forwards the request.
20
+ */
21
+ export declare const getResolutionContextSchema: z.ZodObject<{
22
+ forkAuthor: z.ZodOptional<z.ZodObject<{
23
+ platform: z.ZodEnum<["github", "gitlab"]>;
24
+ user: z.ZodString;
25
+ forkOrigin: z.ZodString;
26
+ }, "strip", z.ZodTypeAny, {
27
+ platform: "github" | "gitlab";
28
+ user: string;
29
+ forkOrigin: string;
30
+ }, {
31
+ platform: "github" | "gitlab";
32
+ user: string;
33
+ forkOrigin: string;
34
+ }>>;
35
+ workspaceId: z.ZodOptional<z.ZodString>;
36
+ repoOrigin: z.ZodOptional<z.ZodString>;
37
+ repoPath: z.ZodString;
38
+ peerUid: z.ZodString;
39
+ filePath: z.ZodString;
40
+ ranges: z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">;
41
+ intentId: z.ZodOptional<z.ZodString>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ repoPath: string;
44
+ filePath: string;
45
+ peerUid: string;
46
+ ranges: number[][];
47
+ repoOrigin?: string | undefined;
48
+ forkAuthor?: {
49
+ platform: "github" | "gitlab";
50
+ user: string;
51
+ forkOrigin: string;
52
+ } | undefined;
53
+ workspaceId?: string | undefined;
54
+ intentId?: string | undefined;
55
+ }, {
56
+ repoPath: string;
57
+ filePath: string;
58
+ peerUid: string;
59
+ ranges: number[][];
60
+ repoOrigin?: string | undefined;
61
+ forkAuthor?: {
62
+ platform: "github" | "gitlab";
63
+ user: string;
64
+ forkOrigin: string;
65
+ } | undefined;
66
+ workspaceId?: string | undefined;
67
+ intentId?: string | undefined;
68
+ }>;
69
+ export type GetResolutionContextInput = z.infer<typeof getResolutionContextSchema>;
70
+ export interface ResolutionRangeSnippet {
71
+ range: number[];
72
+ lines: string[];
73
+ }
74
+ export interface ResolutionGuardrail {
75
+ triggerConfidence: number;
76
+ rule_committed: string;
77
+ reversibility: string;
78
+ mustRecord: string;
79
+ weidner: string;
80
+ }
81
+ export interface GetResolutionContextResponse {
82
+ peer: {
83
+ uid: string;
84
+ label: string;
85
+ sha?: string;
86
+ };
87
+ filePath: string;
88
+ ranges: number[][];
89
+ baselineSha?: string;
90
+ /** True when the peer's live diff for this file was found and decrypted. */
91
+ peerDiffAvailable: boolean;
92
+ /** The peer's reconstructed code at each overlapping range. */
93
+ peerSnippet: ResolutionRangeSnippet[];
94
+ /** File-scoped recorded decisions (region context; not peer-uid filtered). */
95
+ decisions: any[];
96
+ /** Deferred until an intents-by-file endpoint exists (see `note`). */
97
+ peerIntents: any[];
98
+ note?: string;
99
+ guardrail: ResolutionGuardrail;
100
+ }
101
+ export declare function getResolutionContext(input: GetResolutionContextInput): Promise<GetResolutionContextResponse>;
102
+ export declare const getResolutionContextTool: {
103
+ name: string;
104
+ description: string;
105
+ inputSchema: z.ZodObject<{
106
+ forkAuthor: z.ZodOptional<z.ZodObject<{
107
+ platform: z.ZodEnum<["github", "gitlab"]>;
108
+ user: z.ZodString;
109
+ forkOrigin: z.ZodString;
110
+ }, "strip", z.ZodTypeAny, {
111
+ platform: "github" | "gitlab";
112
+ user: string;
113
+ forkOrigin: string;
114
+ }, {
115
+ platform: "github" | "gitlab";
116
+ user: string;
117
+ forkOrigin: string;
118
+ }>>;
119
+ workspaceId: z.ZodOptional<z.ZodString>;
120
+ repoOrigin: z.ZodOptional<z.ZodString>;
121
+ repoPath: z.ZodString;
122
+ peerUid: z.ZodString;
123
+ filePath: z.ZodString;
124
+ ranges: z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">;
125
+ intentId: z.ZodOptional<z.ZodString>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ repoPath: string;
128
+ filePath: string;
129
+ peerUid: string;
130
+ ranges: number[][];
131
+ repoOrigin?: string | undefined;
132
+ forkAuthor?: {
133
+ platform: "github" | "gitlab";
134
+ user: string;
135
+ forkOrigin: string;
136
+ } | undefined;
137
+ workspaceId?: string | undefined;
138
+ intentId?: string | undefined;
139
+ }, {
140
+ repoPath: string;
141
+ filePath: string;
142
+ peerUid: string;
143
+ ranges: number[][];
144
+ repoOrigin?: string | undefined;
145
+ forkAuthor?: {
146
+ platform: "github" | "gitlab";
147
+ user: string;
148
+ forkOrigin: string;
149
+ } | undefined;
150
+ workspaceId?: string | undefined;
151
+ intentId?: string | undefined;
152
+ }>;
153
+ handler: typeof getResolutionContext;
154
+ };
@@ -0,0 +1,78 @@
1
+ import { z } from 'zod';
2
+ import { request } from '../services/muninn-ipc.js';
3
+ import { resolveOrigin } from './resolve-origin.js';
4
+ import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
5
+ /**
6
+ * Thin proxy to Muninn's `pre-edit-check:resolution-context` handler (Layer C,
7
+ * Phase 2 — proactive pre-edit conflict resolution).
8
+ *
9
+ * Two-call protocol:
10
+ * 1. DETECT (cheap, once per turn) — the Stop hook surfaces a live-HAI
11
+ * collision report (per-peer `uid` + overlapping file ranges) when a peer
12
+ * is editing the same lines this turn. (Detection was relocated off the
13
+ * per-edit pre_edit_decision_check to the Stop hook —
14
+ * COLLISION_SURFACE_RELOCATION.md.)
15
+ * 2. RESOLVE (expensive, opt-in) — for a peer surfaced in that report, call
16
+ * THIS tool with their `uid` + ranges. Muninn decrypts the peer's
17
+ * overlapping diff (it holds the repo key; the API only stores ciphertext)
18
+ * and returns it + the file's recorded decisions + a guardrail policy, so
19
+ * you can adapt.
20
+ *
21
+ * All assembly + the encryption boundary live in Muninn. This tool only
22
+ * validates input, resolves the origin, and forwards the request.
23
+ */
24
+ export const getResolutionContextSchema = z.object({
25
+ repoOrigin: z
26
+ .string()
27
+ .optional()
28
+ .describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
29
+ repoPath: z
30
+ .string()
31
+ .describe('Local path to the repository root'),
32
+ peerUid: z
33
+ .string()
34
+ .describe('The peer HAI whose live edits overlap — the `uid` of a collision from the Stop hook collision report.'),
35
+ filePath: z
36
+ .string()
37
+ .describe('Path to the file being edited (relative to repoPath)'),
38
+ ranges: z
39
+ .array(z.array(z.number()))
40
+ .describe('Overlapping [start, end] line ranges (from the collision) to fetch the peer code for.'),
41
+ intentId: z
42
+ .string()
43
+ .optional()
44
+ .describe('Active intent ID (advisory). Auto-detected by Kawa Code when omitted.'),
45
+ ...forkFieldsExtensions,
46
+ });
47
+ export async function getResolutionContext(input) {
48
+ const repoOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
49
+ const forkFields = extractForkFields(input);
50
+ const res = await request('pre-edit-check', 'resolution-context', {
51
+ repoOrigin,
52
+ repoPath: input.repoPath,
53
+ peerUid: input.peerUid,
54
+ filePath: input.filePath,
55
+ ranges: input.ranges,
56
+ intentId: input.intentId,
57
+ ...forkFields,
58
+ });
59
+ return res;
60
+ }
61
+ export const getResolutionContextTool = {
62
+ name: 'get_resolution_context',
63
+ description: `Resolve a live code collision with a peer BEFORE you write (Layer C resolution handoff).
64
+
65
+ Call this when the Stop hook's collision report (or complete_intent's resolution_required gate) surfaced a live peer (a teammate or AI agent editing the same lines). Pass that collision's uid as peerUid and its overlapping ranges. You get back:
66
+ - peerSnippet — the peer's actual (decrypted) code at the overlapping lines, so you can see what they wrote.
67
+ - decisions — recorded reasoning attached to this file (region context).
68
+ - guardrail — the policy you must follow when resolving:
69
+ • Never overwrite a peer's COMMITTED work — yield or merge. Only override an uncommitted live diff, and only with a recorded rationale.
70
+ • Your resolution is an ordinary git edit (revert/diff is the undo) — stay in your own working tree; build no bespoke undo.
71
+ • Before completing, record_decision(type=fork|tradeoff, …) explaining how you resolved (and supersedes the peer's decision if you overrode it).
72
+ • Choose or synthesize ONE coherent result — never blindly interleave both diffs.
73
+
74
+ This is advisory and proactive (no lock). Use it to adapt your edit and avoid the conflict.`,
75
+ inputSchema: getResolutionContextSchema,
76
+ handler: getResolutionContext,
77
+ };
78
+ //# sourceMappingURL=get-resolution-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-resolution-context.js","sourceRoot":"","sources":["../../src/tools/get-resolution-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE3E;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,6EAA6E,CAAC;IAC1F,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,CAAC,mCAAmC,CAAC;IAChD,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,CAAC,uGAAuG,CAAC;IACpH,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,CAAC,sDAAsD,CAAC;IACnE,MAAM,EAAE,CAAC;SACN,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;SAC1B,QAAQ,CAAC,uFAAuF,CAAC;IACpG,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,uEAAuE,CAAC;IACpF,GAAG,oBAAoB;CACxB,CAAC,CAAA;AAkCF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,KAAgC;IAEhC,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IAClE,MAAM,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAA;IAE3C,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,gBAAgB,EAAE,oBAAoB,EAAE;QAChE,UAAU;QACV,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,GAAG,UAAU;KACd,CAAC,CAAA;IAEF,OAAO,GAAmC,CAAA;AAC5C,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE;;;;;;;;;;;4FAW6E;IAC1F,WAAW,EAAE,0BAA0B;IACvC,OAAO,EAAE,oBAAoB;CAC9B,CAAA"}
@@ -49,11 +49,6 @@ export interface DecisionPoint {
49
49
  timestamp: string;
50
50
  type: 'fork' | 'abandoned' | 'discovery' | 'constraint' | 'tradeoff' | 'dependency';
51
51
  summary: string;
52
- rationale: string;
53
- context?: string;
54
- alternatives: string[];
55
- consequences?: string;
56
- symptom?: string;
57
52
  relatedFiles: string[];
58
53
  constraintsChecked: string[];
59
54
  constraintViolations: ConstraintViolation[];
@@ -20,10 +20,10 @@ export async function getSessionDecisions(input) {
20
20
  timestamp: d.timestamp || d.created_at || d.createdAt || '',
21
21
  type: d.decision_type || d.decisionType || d.type,
22
22
  summary: d.summary || '',
23
- rationale: d.rationale || '',
24
- context: d.context,
25
- alternatives: d.alternatives || [],
26
- consequences: d.consequences,
23
+ // Lean payload (INTENT_INTELLIGENCE.md §5.8): unbounded free-text fields
24
+ // (rationale/context/consequences/alternatives/symptom) are dropped from this
25
+ // recall surface. Fetch them on demand via get_decision_detail(decisionId).
26
+ // appliesWhen is retained — it is short, high-signal, and excluded from embeddings.
27
27
  relatedFiles: d.related_files || d.relatedFiles || [],
28
28
  constraintsChecked: d.constraints_checked || d.constraintsChecked || [],
29
29
  constraintViolations: d.constraint_violations || d.constraintViolations || [],
@@ -45,7 +45,7 @@ Decisions are presented for user review and can be edited or removed before bein
45
45
 
46
46
  Returns:
47
47
  - intentId: The intent these decisions belong to
48
- - decisions: Array of decision points with full details
48
+ - decisions: Array of decision points (summary-only — call get_decision_detail(decisionId) for full rationale/context/consequences/alternatives)
49
49
  - count: Number of decisions recorded`,
50
50
  inputSchema: getSessionDecisionsSchema,
51
51
  handler: getSessionDecisions
@@ -1 +1 @@
1
- {"version":3,"file":"get-session-decisions.js","sourceRoot":"","sources":["../../src/tools/get-session-decisions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE3E,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6EAA6E,CAAC;IACzH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAClE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IACnE,GAAG,oBAAoB;CACxB,CAAC,CAAA;AAiCF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,KAA+B;IACvE,MAAM,YAAY,GAAG,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AW,EAAE;;;;;;;;sCAQuB;IACpC,WAAW,EAAE,yBAAyB;IACtC,OAAO,EAAE,mBAAmB;CAC7B,CAAA"}
@@ -12,6 +12,7 @@ import { logWorkTool, logWork, logWorkSchema } from './log-work.js';
12
12
  import { recordDecisionTool, recordDecision, recordDecisionSchema } from './record-decision.js';
13
13
  import { getSessionDecisionsTool, getSessionDecisions, getSessionDecisionsSchema } from './get-session-decisions.js';
14
14
  import { getProjectDecisionsTool, getProjectDecisions, getProjectDecisionsSchema } from './get-project-decisions.js';
15
+ import { getDecisionDetailTool, getDecisionDetail, getDecisionDetailSchema } from './get-decision-detail.js';
15
16
  import { editSessionDecisionTool, editSessionDecision, editSessionDecisionSchema } from './edit-session-decision.js';
16
17
  import { detectIntentConflictsTool, detectIntentConflicts, detectIntentConflictsSchema } from './detect-intent-conflicts.js';
17
18
  import { inferHistoryTool, inferHistory, inferHistorySchema } from './infer-history.js';
@@ -19,7 +20,10 @@ import { evolveDecisionsTool, evolveDecisions, evolveDecisionsSchema } from './e
19
20
  import { updateFeaturesTool, updateFeatures, updateFeaturesSchema } from './update-features.js';
20
21
  import { preEditDecisionCheckTool, preEditDecisionCheck, preEditDecisionCheckSchema } from './pre-edit-decision-check.js';
21
22
  import { preEditAcknowledgeTool, preEditAcknowledge, preEditAcknowledgeSchema } from './pre-edit-acknowledge.js';
22
- export { getRelevantContextTool, getRelevantContext, getRelevantContextSchema, 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, logWorkTool, logWork, logWorkSchema, recordDecisionTool, recordDecision, recordDecisionSchema, getSessionDecisionsTool, getSessionDecisions, getSessionDecisionsSchema, getProjectDecisionsTool, getProjectDecisions, getProjectDecisionsSchema, editSessionDecisionTool, editSessionDecision, editSessionDecisionSchema, detectIntentConflictsTool, detectIntentConflicts, detectIntentConflictsSchema, inferHistoryTool, inferHistory, inferHistorySchema, evolveDecisionsTool, evolveDecisions, evolveDecisionsSchema, updateFeaturesTool, updateFeatures, updateFeaturesSchema, preEditDecisionCheckTool, preEditDecisionCheck, preEditDecisionCheckSchema, preEditAcknowledgeTool, preEditAcknowledge, preEditAcknowledgeSchema };
23
+ import { getResolutionContextTool, getResolutionContext, getResolutionContextSchema } from './get-resolution-context.js';
24
+ import { arbiterResolveTool, arbiterResolve, arbiterResolveSchema } from './arbiter-resolve.js';
25
+ import { arbiterApplyTool, arbiterApply, arbiterApplySchema } from './arbiter-apply.js';
26
+ export { getRelevantContextTool, getRelevantContext, getRelevantContextSchema, 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, logWorkTool, logWork, logWorkSchema, recordDecisionTool, recordDecision, recordDecisionSchema, getSessionDecisionsTool, getSessionDecisions, getSessionDecisionsSchema, getProjectDecisionsTool, getProjectDecisions, getProjectDecisionsSchema, getDecisionDetailTool, getDecisionDetail, getDecisionDetailSchema, editSessionDecisionTool, editSessionDecision, editSessionDecisionSchema, detectIntentConflictsTool, detectIntentConflicts, detectIntentConflictsSchema, inferHistoryTool, inferHistory, inferHistorySchema, evolveDecisionsTool, evolveDecisions, evolveDecisionsSchema, updateFeaturesTool, updateFeatures, updateFeaturesSchema, preEditDecisionCheckTool, preEditDecisionCheck, preEditDecisionCheckSchema, preEditAcknowledgeTool, preEditAcknowledge, preEditAcknowledgeSchema, getResolutionContextTool, getResolutionContext, getResolutionContextSchema, arbiterResolveTool, arbiterResolve, arbiterResolveSchema, arbiterApplyTool, arbiterApply, arbiterApplySchema };
23
27
  export declare const allTools: ({
24
28
  name: string;
25
29
  description: string;
@@ -191,10 +195,8 @@ export declare const allTools: ({
191
195
  repoOrigin: import("zod").ZodOptional<import("zod").ZodString>;
192
196
  repoPath: import("zod").ZodString;
193
197
  intentId: import("zod").ZodString;
194
- force: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
195
198
  }, "strip", import("zod").ZodTypeAny, {
196
199
  repoPath: string;
197
- force: boolean;
198
200
  intentId: string;
199
201
  repoOrigin?: string | undefined;
200
202
  forkAuthor?: {
@@ -213,7 +215,6 @@ export declare const allTools: ({
213
215
  forkOrigin: string;
214
216
  } | undefined;
215
217
  workspaceId?: string | undefined;
216
- force?: boolean | undefined;
217
218
  }>;
218
219
  handler: typeof activateIntent;
219
220
  } | {
@@ -328,7 +329,7 @@ export declare const allTools: ({
328
329
  workspaceId: import("zod").ZodOptional<import("zod").ZodString>;
329
330
  repoOrigin: import("zod").ZodOptional<import("zod").ZodString>;
330
331
  repoPath: import("zod").ZodString;
331
- status: import("zod").ZodOptional<import("zod").ZodEnum<["active", "pending", "committed", "pushed", "done", "abandoned"]>>;
332
+ status: import("zod").ZodOptional<import("zod").ZodEnum<["active", "committed", "pushed", "done", "abandoned"]>>;
332
333
  author: import("zod").ZodOptional<import("zod").ZodString>;
333
334
  since: import("zod").ZodOptional<import("zod").ZodString>;
334
335
  until: import("zod").ZodOptional<import("zod").ZodString>;
@@ -338,7 +339,7 @@ export declare const allTools: ({
338
339
  repoPath: string;
339
340
  limit: number;
340
341
  offset: number;
341
- status?: "pending" | "active" | "committed" | "pushed" | "done" | "abandoned" | undefined;
342
+ status?: "active" | "committed" | "pushed" | "done" | "abandoned" | undefined;
342
343
  repoOrigin?: string | undefined;
343
344
  forkAuthor?: {
344
345
  platform: "github" | "gitlab";
@@ -351,7 +352,7 @@ export declare const allTools: ({
351
352
  until?: string | undefined;
352
353
  }, {
353
354
  repoPath: string;
354
- status?: "pending" | "active" | "committed" | "pushed" | "done" | "abandoned" | undefined;
355
+ status?: "active" | "committed" | "pushed" | "done" | "abandoned" | undefined;
355
356
  repoOrigin?: string | undefined;
356
357
  forkAuthor?: {
357
358
  platform: "github" | "gitlab";
@@ -430,6 +431,7 @@ export declare const allTools: ({
430
431
  commitSha: import("zod").ZodOptional<import("zod").ZodString>;
431
432
  status: import("zod").ZodDefault<import("zod").ZodEnum<["committed", "pushed", "done", "abandoned", "superseded"]>>;
432
433
  supersededBy: import("zod").ZodOptional<import("zod").ZodString>;
434
+ humanApproved: import("zod").ZodOptional<import("zod").ZodBoolean>;
433
435
  }, "strip", import("zod").ZodTypeAny, {
434
436
  status: "committed" | "pushed" | "done" | "abandoned" | "superseded";
435
437
  repoPath: string;
@@ -443,6 +445,7 @@ export declare const allTools: ({
443
445
  intentId?: string | undefined;
444
446
  commitSha?: string | undefined;
445
447
  supersededBy?: string | undefined;
448
+ humanApproved?: boolean | undefined;
446
449
  }, {
447
450
  repoPath: string;
448
451
  status?: "committed" | "pushed" | "done" | "abandoned" | "superseded" | undefined;
@@ -456,6 +459,7 @@ export declare const allTools: ({
456
459
  intentId?: string | undefined;
457
460
  commitSha?: string | undefined;
458
461
  supersededBy?: string | undefined;
462
+ humanApproved?: boolean | undefined;
459
463
  }>;
460
464
  handler: typeof completeIntent;
461
465
  } | {
@@ -622,6 +626,28 @@ export declare const allTools: ({
622
626
  confidence: import("zod").ZodOptional<import("zod").ZodEnum<["high", "medium", "low"]>>;
623
627
  sourceThoughtIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
624
628
  appliesWhen: import("zod").ZodOptional<import("zod").ZodString>;
629
+ resolvedCollision: import("zod").ZodOptional<import("zod").ZodObject<{
630
+ peerUid: import("zod").ZodString;
631
+ peerLabel: import("zod").ZodOptional<import("zod").ZodString>;
632
+ filePath: import("zod").ZodString;
633
+ ranges: import("zod").ZodArray<import("zod").ZodArray<import("zod").ZodNumber, "many">, "many">;
634
+ peerIntentId: import("zod").ZodOptional<import("zod").ZodString>;
635
+ baselineSha: import("zod").ZodOptional<import("zod").ZodString>;
636
+ }, "strip", import("zod").ZodTypeAny, {
637
+ filePath: string;
638
+ peerUid: string;
639
+ ranges: number[][];
640
+ peerLabel?: string | undefined;
641
+ peerIntentId?: string | undefined;
642
+ baselineSha?: string | undefined;
643
+ }, {
644
+ filePath: string;
645
+ peerUid: string;
646
+ ranges: number[][];
647
+ peerLabel?: string | undefined;
648
+ peerIntentId?: string | undefined;
649
+ baselineSha?: string | undefined;
650
+ }>>;
625
651
  }, "strip", import("zod").ZodTypeAny, {
626
652
  type: "abandoned" | "constraint" | "fork" | "discovery" | "tradeoff" | "dependency";
627
653
  repoPath: string;
@@ -651,6 +677,14 @@ export declare const allTools: ({
651
677
  confidence?: "high" | "medium" | "low" | undefined;
652
678
  sourceThoughtIds?: string[] | undefined;
653
679
  appliesWhen?: string | undefined;
680
+ resolvedCollision?: {
681
+ filePath: string;
682
+ peerUid: string;
683
+ ranges: number[][];
684
+ peerLabel?: string | undefined;
685
+ peerIntentId?: string | undefined;
686
+ baselineSha?: string | undefined;
687
+ } | undefined;
654
688
  }, {
655
689
  type: "abandoned" | "constraint" | "fork" | "discovery" | "tradeoff" | "dependency";
656
690
  repoPath: string;
@@ -680,6 +714,14 @@ export declare const allTools: ({
680
714
  confidence?: "high" | "medium" | "low" | undefined;
681
715
  sourceThoughtIds?: string[] | undefined;
682
716
  appliesWhen?: string | undefined;
717
+ resolvedCollision?: {
718
+ filePath: string;
719
+ peerUid: string;
720
+ ranges: number[][];
721
+ peerLabel?: string | undefined;
722
+ peerIntentId?: string | undefined;
723
+ baselineSha?: string | undefined;
724
+ } | undefined;
683
725
  }>;
684
726
  handler: typeof recordDecision;
685
727
  } | {
@@ -765,6 +807,49 @@ export declare const allTools: ({
765
807
  workspaceId?: string | undefined;
766
808
  }>;
767
809
  handler: typeof getProjectDecisions;
810
+ } | {
811
+ name: string;
812
+ description: string;
813
+ inputSchema: import("zod").ZodObject<{
814
+ forkAuthor: import("zod").ZodOptional<import("zod").ZodObject<{
815
+ platform: import("zod").ZodEnum<["github", "gitlab"]>;
816
+ user: import("zod").ZodString;
817
+ forkOrigin: import("zod").ZodString;
818
+ }, "strip", import("zod").ZodTypeAny, {
819
+ platform: "github" | "gitlab";
820
+ user: string;
821
+ forkOrigin: string;
822
+ }, {
823
+ platform: "github" | "gitlab";
824
+ user: string;
825
+ forkOrigin: string;
826
+ }>>;
827
+ workspaceId: import("zod").ZodOptional<import("zod").ZodString>;
828
+ repoOrigin: import("zod").ZodOptional<import("zod").ZodString>;
829
+ repoPath: import("zod").ZodString;
830
+ decisionId: import("zod").ZodString;
831
+ }, "strip", import("zod").ZodTypeAny, {
832
+ repoPath: string;
833
+ decisionId: string;
834
+ repoOrigin?: string | undefined;
835
+ forkAuthor?: {
836
+ platform: "github" | "gitlab";
837
+ user: string;
838
+ forkOrigin: string;
839
+ } | undefined;
840
+ workspaceId?: string | undefined;
841
+ }, {
842
+ repoPath: string;
843
+ decisionId: string;
844
+ repoOrigin?: string | undefined;
845
+ forkAuthor?: {
846
+ platform: "github" | "gitlab";
847
+ user: string;
848
+ forkOrigin: string;
849
+ } | undefined;
850
+ workspaceId?: string | undefined;
851
+ }>;
852
+ handler: typeof getDecisionDetail;
768
853
  } | {
769
854
  name: string;
770
855
  description: string;
@@ -1128,4 +1213,122 @@ export declare const allTools: ({
1128
1213
  sessionToken?: string | undefined;
1129
1214
  }>;
1130
1215
  handler: typeof preEditAcknowledge;
1216
+ } | {
1217
+ name: string;
1218
+ description: string;
1219
+ inputSchema: import("zod").ZodObject<{
1220
+ forkAuthor: import("zod").ZodOptional<import("zod").ZodObject<{
1221
+ platform: import("zod").ZodEnum<["github", "gitlab"]>;
1222
+ user: import("zod").ZodString;
1223
+ forkOrigin: import("zod").ZodString;
1224
+ }, "strip", import("zod").ZodTypeAny, {
1225
+ platform: "github" | "gitlab";
1226
+ user: string;
1227
+ forkOrigin: string;
1228
+ }, {
1229
+ platform: "github" | "gitlab";
1230
+ user: string;
1231
+ forkOrigin: string;
1232
+ }>>;
1233
+ workspaceId: import("zod").ZodOptional<import("zod").ZodString>;
1234
+ repoOrigin: import("zod").ZodOptional<import("zod").ZodString>;
1235
+ repoPath: import("zod").ZodString;
1236
+ peerUid: import("zod").ZodString;
1237
+ filePath: import("zod").ZodString;
1238
+ ranges: import("zod").ZodArray<import("zod").ZodArray<import("zod").ZodNumber, "many">, "many">;
1239
+ intentId: import("zod").ZodOptional<import("zod").ZodString>;
1240
+ }, "strip", import("zod").ZodTypeAny, {
1241
+ repoPath: string;
1242
+ filePath: string;
1243
+ peerUid: string;
1244
+ ranges: number[][];
1245
+ repoOrigin?: string | undefined;
1246
+ forkAuthor?: {
1247
+ platform: "github" | "gitlab";
1248
+ user: string;
1249
+ forkOrigin: string;
1250
+ } | undefined;
1251
+ workspaceId?: string | undefined;
1252
+ intentId?: string | undefined;
1253
+ }, {
1254
+ repoPath: string;
1255
+ filePath: string;
1256
+ peerUid: string;
1257
+ ranges: number[][];
1258
+ repoOrigin?: string | undefined;
1259
+ forkAuthor?: {
1260
+ platform: "github" | "gitlab";
1261
+ user: string;
1262
+ forkOrigin: string;
1263
+ } | undefined;
1264
+ workspaceId?: string | undefined;
1265
+ intentId?: string | undefined;
1266
+ }>;
1267
+ handler: typeof getResolutionContext;
1268
+ } | {
1269
+ name: string;
1270
+ description: string;
1271
+ inputSchema: import("zod").ZodObject<{
1272
+ forkAuthor: import("zod").ZodOptional<import("zod").ZodObject<{
1273
+ platform: import("zod").ZodEnum<["github", "gitlab"]>;
1274
+ user: import("zod").ZodString;
1275
+ forkOrigin: import("zod").ZodString;
1276
+ }, "strip", import("zod").ZodTypeAny, {
1277
+ platform: "github" | "gitlab";
1278
+ user: string;
1279
+ forkOrigin: string;
1280
+ }, {
1281
+ platform: "github" | "gitlab";
1282
+ user: string;
1283
+ forkOrigin: string;
1284
+ }>>;
1285
+ workspaceId: import("zod").ZodOptional<import("zod").ZodString>;
1286
+ repoPath: import("zod").ZodString;
1287
+ repoOrigin: import("zod").ZodOptional<import("zod").ZodString>;
1288
+ intentId: import("zod").ZodOptional<import("zod").ZodString>;
1289
+ overlaps: import("zod").ZodArray<import("zod").ZodObject<{
1290
+ peerUid: import("zod").ZodString;
1291
+ filePath: import("zod").ZodString;
1292
+ ranges: import("zod").ZodArray<import("zod").ZodArray<import("zod").ZodNumber, "many">, "many">;
1293
+ }, "strip", import("zod").ZodTypeAny, {
1294
+ filePath: string;
1295
+ peerUid: string;
1296
+ ranges: number[][];
1297
+ }, {
1298
+ filePath: string;
1299
+ peerUid: string;
1300
+ ranges: number[][];
1301
+ }>, "many">;
1302
+ }, "strip", import("zod").ZodTypeAny, {
1303
+ repoPath: string;
1304
+ overlaps: {
1305
+ filePath: string;
1306
+ peerUid: string;
1307
+ ranges: number[][];
1308
+ }[];
1309
+ repoOrigin?: string | undefined;
1310
+ forkAuthor?: {
1311
+ platform: "github" | "gitlab";
1312
+ user: string;
1313
+ forkOrigin: string;
1314
+ } | undefined;
1315
+ workspaceId?: string | undefined;
1316
+ intentId?: string | undefined;
1317
+ }, {
1318
+ repoPath: string;
1319
+ overlaps: {
1320
+ filePath: string;
1321
+ peerUid: string;
1322
+ ranges: number[][];
1323
+ }[];
1324
+ repoOrigin?: string | undefined;
1325
+ forkAuthor?: {
1326
+ platform: "github" | "gitlab";
1327
+ user: string;
1328
+ forkOrigin: string;
1329
+ } | undefined;
1330
+ workspaceId?: string | undefined;
1331
+ intentId?: string | undefined;
1332
+ }>;
1333
+ handler: typeof arbiterResolve;
1131
1334
  })[];