@triedotdev/mcp 1.0.125 → 1.0.126
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/dist/{chunk-BNVH2LY7.js → chunk-KCVXTYHO.js} +144 -53
- package/dist/chunk-KCVXTYHO.js.map +1 -0
- package/dist/cli/yolo-daemon.js +1 -1
- package/dist/codebase-index-ECJYAEZJ.js +197 -0
- package/dist/codebase-index-ECJYAEZJ.js.map +1 -0
- package/dist/goal-validator-4RA64F37.js +259 -0
- package/dist/goal-validator-4RA64F37.js.map +1 -0
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-BNVH2LY7.js.map +0 -1
- package/dist/goal-validator-CKFKJ46J.js +0 -188
- package/dist/goal-validator-CKFKJ46J.js.map +0 -1
|
@@ -294,7 +294,7 @@ import { render } from "ink";
|
|
|
294
294
|
import React11 from "react";
|
|
295
295
|
|
|
296
296
|
// src/cli/dashboard/App.tsx
|
|
297
|
-
import { useState as
|
|
297
|
+
import { useState as useState3, useEffect as useEffect5, useCallback as useCallback7, useRef as useRef2 } from "react";
|
|
298
298
|
import { Box as Box14, useInput as useInput10, useApp } from "ink";
|
|
299
299
|
|
|
300
300
|
// src/cli/dashboard/state.tsx
|
|
@@ -667,6 +667,8 @@ function dashboardReducer(state, action) {
|
|
|
667
667
|
timestamp: Date.now()
|
|
668
668
|
};
|
|
669
669
|
if (action.toolCalls && action.toolCalls.length > 0) msg.toolCalls = action.toolCalls;
|
|
670
|
+
if (action.pendingFix) msg.pendingFix = action.pendingFix;
|
|
671
|
+
if (action.pendingFixes && action.pendingFixes.length > 0) msg.pendingFixes = action.pendingFixes;
|
|
670
672
|
return {
|
|
671
673
|
...state,
|
|
672
674
|
chatState: {
|
|
@@ -1884,8 +1886,8 @@ function GoalsView() {
|
|
|
1884
1886
|
const goal = goalsPanel.goals.find((g) => g.id === goalId);
|
|
1885
1887
|
if (!goal) return;
|
|
1886
1888
|
dispatch({ type: "ADD_ACTIVITY", message: `Checking goal: ${goal.description.slice(0, 30)}...` });
|
|
1887
|
-
dispatch({ type: "SHOW_NOTIFICATION", message: `Scanning files for
|
|
1888
|
-
const { checkFilesForGoalViolations } = await import("./goal-validator-
|
|
1889
|
+
dispatch({ type: "SHOW_NOTIFICATION", message: `Scanning files... This may take a moment for large codebases`, severity: "info", autoHideMs: 5e3 });
|
|
1890
|
+
const { checkFilesForGoalViolations } = await import("./goal-validator-4RA64F37.js");
|
|
1889
1891
|
const violations = await checkFilesForGoalViolations([goal], workDir);
|
|
1890
1892
|
if (violations.length === 0) {
|
|
1891
1893
|
dispatch({ type: "SHOW_NOTIFICATION", message: `\u2713 No violations found for: ${goal.description.slice(0, 40)}`, severity: "info", autoHideMs: 5e3 });
|
|
@@ -2435,7 +2437,7 @@ function RawLogView() {
|
|
|
2435
2437
|
}
|
|
2436
2438
|
|
|
2437
2439
|
// src/cli/dashboard/views/ChatView.tsx
|
|
2438
|
-
import { useCallback as useCallback5, useRef, useEffect as useEffect3 } from "react";
|
|
2440
|
+
import { useCallback as useCallback5, useRef, useEffect as useEffect3, useState as useState2 } from "react";
|
|
2439
2441
|
import { Box as Box12, Text as Text12, useInput as useInput8 } from "ink";
|
|
2440
2442
|
|
|
2441
2443
|
// src/tools/tell.ts
|
|
@@ -5247,7 +5249,7 @@ ${truncated}`;
|
|
|
5247
5249
|
case "trie_scan_for_goal_violations": {
|
|
5248
5250
|
const goalId = input.goalId ? String(input.goalId).trim() : void 0;
|
|
5249
5251
|
try {
|
|
5250
|
-
const { checkFilesForGoalViolations, getActiveGoals } = await import("./goal-validator-
|
|
5252
|
+
const { checkFilesForGoalViolations, getActiveGoals } = await import("./goal-validator-4RA64F37.js");
|
|
5251
5253
|
const agentState = getGuardianState(directory);
|
|
5252
5254
|
await agentState.load();
|
|
5253
5255
|
const allGoals = await getActiveGoals(directory);
|
|
@@ -5286,6 +5288,7 @@ ${truncated}`;
|
|
|
5286
5288
|
|
|
5287
5289
|
// src/cli/dashboard/views/ChatView.tsx
|
|
5288
5290
|
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5291
|
+
var VISIBLE_MESSAGES = 8;
|
|
5289
5292
|
async function buildContext(workDir, dashboardState) {
|
|
5290
5293
|
const parts = [];
|
|
5291
5294
|
if (dashboardState?.agentInsights) {
|
|
@@ -5424,6 +5427,21 @@ function ChatView() {
|
|
|
5424
5427
|
const { chatState } = state;
|
|
5425
5428
|
const { messages, inputBuffer, loading, currentSessionId, currentSessionTitle } = chatState;
|
|
5426
5429
|
const loadingRef = useRef(false);
|
|
5430
|
+
const [cursorVisible, setCursorVisible] = useState2(true);
|
|
5431
|
+
const [scrollOffset, setScrollOffset] = useState2(0);
|
|
5432
|
+
useEffect3(() => {
|
|
5433
|
+
if (loading) {
|
|
5434
|
+
setCursorVisible(true);
|
|
5435
|
+
return;
|
|
5436
|
+
}
|
|
5437
|
+
const interval = setInterval(() => {
|
|
5438
|
+
setCursorVisible((v) => !v);
|
|
5439
|
+
}, 500);
|
|
5440
|
+
return () => clearInterval(interval);
|
|
5441
|
+
}, [loading]);
|
|
5442
|
+
useEffect3(() => {
|
|
5443
|
+
setScrollOffset(0);
|
|
5444
|
+
}, [messages.length]);
|
|
5427
5445
|
useEffect3(() => {
|
|
5428
5446
|
if (messages.length === 0) return;
|
|
5429
5447
|
const saveChat = async () => {
|
|
@@ -5454,47 +5472,82 @@ function ChatView() {
|
|
|
5454
5472
|
dispatch({ type: "SET_CHAT_LOADING", loading: true });
|
|
5455
5473
|
try {
|
|
5456
5474
|
const workDir = getWorkingDirectory(void 0, true);
|
|
5475
|
+
const response = question.trim().toLowerCase();
|
|
5476
|
+
const isYesToAll = response === "yes to all" || response === "y to all" || response === "yes all";
|
|
5477
|
+
const isYes = response === "yes" || response === "y";
|
|
5478
|
+
const isNo = response === "no" || response === "n";
|
|
5479
|
+
const collectPendingFixes = () => {
|
|
5480
|
+
const fixes = [];
|
|
5481
|
+
const recentAssistantMessages = messages.filter((m) => m.role === "assistant").slice(-5);
|
|
5482
|
+
for (const msg of recentAssistantMessages) {
|
|
5483
|
+
if (msg.pendingFixes && msg.pendingFixes.length > 0) {
|
|
5484
|
+
fixes.push(...msg.pendingFixes);
|
|
5485
|
+
} else if (msg.pendingFix) {
|
|
5486
|
+
fixes.push(msg.pendingFix);
|
|
5487
|
+
}
|
|
5488
|
+
}
|
|
5489
|
+
return fixes;
|
|
5490
|
+
};
|
|
5491
|
+
const allPendingFixes = collectPendingFixes();
|
|
5457
5492
|
const lastAssistantMessage = messages.filter((m) => m.role === "assistant").pop();
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
if (
|
|
5493
|
+
const lastFixes = lastAssistantMessage?.pendingFixes || (lastAssistantMessage?.pendingFix ? [lastAssistantMessage.pendingFix] : []);
|
|
5494
|
+
if (allPendingFixes.length > 0 && (isYes || isYesToAll || isNo)) {
|
|
5495
|
+
if (isNo) {
|
|
5496
|
+
dispatch({
|
|
5497
|
+
type: "ADD_CHAT_MESSAGE",
|
|
5498
|
+
role: "assistant",
|
|
5499
|
+
content: "Fix cancelled. Let me know if you need anything else!"
|
|
5500
|
+
});
|
|
5501
|
+
dispatch({ type: "SET_CHAT_LOADING", loading: false });
|
|
5502
|
+
loadingRef.current = false;
|
|
5503
|
+
return;
|
|
5504
|
+
}
|
|
5505
|
+
const fixesToApply = isYesToAll ? allPendingFixes : lastFixes;
|
|
5506
|
+
if (fixesToApply.length > 0) {
|
|
5461
5507
|
const { spawnClaudeCodeFix } = await import("./terminal-spawn-P5M5PHAV.js");
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5508
|
+
const results = [];
|
|
5509
|
+
const errors = [];
|
|
5510
|
+
for (const fix of fixesToApply) {
|
|
5511
|
+
try {
|
|
5512
|
+
await spawnClaudeCodeFix({
|
|
5513
|
+
...fix,
|
|
5514
|
+
cwd: fix.directory
|
|
5515
|
+
});
|
|
5516
|
+
results.push(`"${fix.file}"`);
|
|
5517
|
+
} catch (error) {
|
|
5518
|
+
errors.push(`${fix.file}: ${error instanceof Error ? error.message : "unknown error"}`);
|
|
5519
|
+
}
|
|
5520
|
+
}
|
|
5521
|
+
let message = "";
|
|
5522
|
+
if (results.length > 0) {
|
|
5523
|
+
if (results.length === 1 && fixesToApply[0]) {
|
|
5524
|
+
const fix = fixesToApply[0];
|
|
5525
|
+
message = `Spawned Claude Code in a new terminal to fix ${results[0]}.
|
|
5471
5526
|
|
|
5472
5527
|
Claude Code will:
|
|
5473
5528
|
1. Review the file
|
|
5474
|
-
2. Understand the goal: "${
|
|
5475
|
-
3. Fix the violation: "${
|
|
5529
|
+
2. Understand the goal: "${fix.goal}"
|
|
5530
|
+
3. Fix the violation: "${fix.violation}"
|
|
5476
5531
|
4. Preserve all functionality
|
|
5477
5532
|
|
|
5478
|
-
Check the new terminal window to see the fix in progress
|
|
5479
|
-
}
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
return;
|
|
5533
|
+
Check the new terminal window to see the fix in progress.`;
|
|
5534
|
+
} else {
|
|
5535
|
+
message = `Spawned Claude Code to fix ${results.length} files:
|
|
5536
|
+
${results.map((r) => `- ${r}`).join("\n")}
|
|
5537
|
+
|
|
5538
|
+
Check the new terminal windows to see the fixes in progress.`;
|
|
5539
|
+
}
|
|
5540
|
+
}
|
|
5541
|
+
if (errors.length > 0) {
|
|
5542
|
+
message += `
|
|
5543
|
+
|
|
5544
|
+
Failed to spawn fixes for:
|
|
5545
|
+
${errors.map((e) => `- ${e}`).join("\n")}`;
|
|
5492
5546
|
}
|
|
5493
|
-
} else if (response === "no" || response === "n") {
|
|
5494
5547
|
dispatch({
|
|
5495
5548
|
type: "ADD_CHAT_MESSAGE",
|
|
5496
5549
|
role: "assistant",
|
|
5497
|
-
content:
|
|
5550
|
+
content: message
|
|
5498
5551
|
});
|
|
5499
5552
|
dispatch({ type: "SET_CHAT_LOADING", loading: false });
|
|
5500
5553
|
loadingRef.current = false;
|
|
@@ -5524,15 +5577,28 @@ ${contextBlock}`;
|
|
|
5524
5577
|
role: "assistant",
|
|
5525
5578
|
content: result.content
|
|
5526
5579
|
};
|
|
5527
|
-
const
|
|
5528
|
-
|
|
5580
|
+
const pendingFixRegex = /\[PENDING_FIX:(.+?)\]/g;
|
|
5581
|
+
const pendingFixes = [];
|
|
5582
|
+
let match;
|
|
5583
|
+
while ((match = pendingFixRegex.exec(result.content)) !== null) {
|
|
5529
5584
|
try {
|
|
5530
|
-
const
|
|
5531
|
-
|
|
5532
|
-
|
|
5585
|
+
const jsonStr = match[1];
|
|
5586
|
+
if (jsonStr) {
|
|
5587
|
+
const fixData = JSON.parse(jsonStr);
|
|
5588
|
+
pendingFixes.push(fixData);
|
|
5589
|
+
}
|
|
5533
5590
|
} catch {
|
|
5534
5591
|
}
|
|
5535
5592
|
}
|
|
5593
|
+
if (pendingFixes.length > 0) {
|
|
5594
|
+
action.content = result.content.replace(/\[PENDING_FIX:.+?\]/g, "").trim();
|
|
5595
|
+
const firstFix = pendingFixes[0];
|
|
5596
|
+
if (pendingFixes.length === 1 && firstFix) {
|
|
5597
|
+
action.pendingFix = firstFix;
|
|
5598
|
+
} else {
|
|
5599
|
+
action.pendingFixes = pendingFixes;
|
|
5600
|
+
}
|
|
5601
|
+
}
|
|
5536
5602
|
if (result.toolCalls && result.toolCalls.length > 0) {
|
|
5537
5603
|
action.toolCalls = result.toolCalls;
|
|
5538
5604
|
const toolNames = new Set(result.toolCalls.map((tc) => tc.name));
|
|
@@ -5586,6 +5652,14 @@ ${contextBlock}`;
|
|
|
5586
5652
|
}, [dispatch, messages, state]);
|
|
5587
5653
|
useInput8((input, key) => {
|
|
5588
5654
|
if (loading) return;
|
|
5655
|
+
if (key.upArrow) {
|
|
5656
|
+
const maxScroll = Math.max(0, messages.length - VISIBLE_MESSAGES);
|
|
5657
|
+
setScrollOffset((prev) => Math.min(prev + 1, maxScroll));
|
|
5658
|
+
return;
|
|
5659
|
+
} else if (key.downArrow) {
|
|
5660
|
+
setScrollOffset((prev) => Math.max(prev - 1, 0));
|
|
5661
|
+
return;
|
|
5662
|
+
}
|
|
5589
5663
|
if (key.return && inputBuffer.trim().length > 0) {
|
|
5590
5664
|
void sendMessage(inputBuffer.trim());
|
|
5591
5665
|
} else if (key.escape) {
|
|
@@ -5602,18 +5676,34 @@ ${contextBlock}`;
|
|
|
5602
5676
|
/* @__PURE__ */ jsx13(Text12, { dimColor: true, children: " AI is not available. Press s to open settings and add your Anthropic API key." })
|
|
5603
5677
|
] });
|
|
5604
5678
|
}
|
|
5605
|
-
|
|
5606
|
-
|
|
5679
|
+
const visibleMessages = (() => {
|
|
5680
|
+
if (messages.length <= VISIBLE_MESSAGES) return messages;
|
|
5681
|
+
const endIdx = messages.length - scrollOffset;
|
|
5682
|
+
const startIdx = Math.max(0, endIdx - VISIBLE_MESSAGES);
|
|
5683
|
+
return messages.slice(startIdx, endIdx);
|
|
5684
|
+
})();
|
|
5685
|
+
const canScrollUp = scrollOffset < messages.length - VISIBLE_MESSAGES;
|
|
5686
|
+
const canScrollDown = scrollOffset > 0;
|
|
5687
|
+
const cursor = cursorVisible ? "|" : " ";
|
|
5688
|
+
return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", paddingX: 1, flexGrow: 1, flexShrink: 1, children: [
|
|
5689
|
+
/* @__PURE__ */ jsx13(Box12, { flexShrink: 0, children: /* @__PURE__ */ jsxs12(Text12, { children: [
|
|
5607
5690
|
/* @__PURE__ */ jsx13(Text12, { bold: true, children: "Chat" }),
|
|
5608
5691
|
currentSessionTitle && /* @__PURE__ */ jsxs12(Text12, { dimColor: true, children: [
|
|
5609
5692
|
" ",
|
|
5610
5693
|
currentSessionTitle
|
|
5611
5694
|
] }),
|
|
5612
|
-
/* @__PURE__ */ jsx13(Text12, { dimColor: true, children: " (h for history)" })
|
|
5613
|
-
|
|
5614
|
-
|
|
5695
|
+
/* @__PURE__ */ jsx13(Text12, { dimColor: true, children: " (h for history)" }),
|
|
5696
|
+
messages.length > VISIBLE_MESSAGES && /* @__PURE__ */ jsxs12(Text12, { dimColor: true, children: [
|
|
5697
|
+
" [",
|
|
5698
|
+
canScrollUp ? "\u2191" : " ",
|
|
5699
|
+
canScrollDown ? "\u2193" : " ",
|
|
5700
|
+
"]"
|
|
5701
|
+
] })
|
|
5702
|
+
] }) }),
|
|
5703
|
+
/* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", flexGrow: 1, flexShrink: 1, overflow: "hidden", marginTop: 1, marginBottom: 1, children: [
|
|
5615
5704
|
messages.length === 0 && !loading && /* @__PURE__ */ jsx13(Text12, { dimColor: true, children: " Ask about your codebase, decisions, patterns, or risks." }),
|
|
5616
|
-
|
|
5705
|
+
canScrollUp && /* @__PURE__ */ jsx13(Text12, { dimColor: true, children: " \u2191 more messages above" }),
|
|
5706
|
+
visibleMessages.map((msg, idx) => /* @__PURE__ */ jsx13(Box12, { flexDirection: "column", marginTop: idx === 0 ? 0 : 1, children: msg.role === "user" ? /* @__PURE__ */ jsxs12(Text12, { children: [
|
|
5617
5707
|
" ",
|
|
5618
5708
|
/* @__PURE__ */ jsx13(Text12, { bold: true, color: "green", children: "You:" }),
|
|
5619
5709
|
" ",
|
|
@@ -5634,11 +5724,12 @@ ${contextBlock}`;
|
|
|
5634
5724
|
line
|
|
5635
5725
|
] }, li))
|
|
5636
5726
|
] }) }, idx)),
|
|
5727
|
+
canScrollDown && /* @__PURE__ */ jsx13(Text12, { dimColor: true, children: " \u2193 more messages below" }),
|
|
5637
5728
|
loading && /* @__PURE__ */ jsx13(Text12, { dimColor: true, children: " Thinking..." })
|
|
5638
5729
|
] }),
|
|
5639
|
-
/* @__PURE__ */ jsx13(Box12, { borderStyle: "single", borderColor: "green", paddingX: 1, flexShrink: 0, children: /* @__PURE__ */ jsxs12(Text12, { children: [
|
|
5640
|
-
|
|
5641
|
-
/* @__PURE__ */ jsx13(Text12, {
|
|
5730
|
+
/* @__PURE__ */ jsx13(Box12, { borderStyle: "single", borderColor: "green", paddingX: 1, flexShrink: 0, flexGrow: 0, children: /* @__PURE__ */ jsxs12(Text12, { children: [
|
|
5731
|
+
/* @__PURE__ */ jsx13(Text12, { bold: true, color: "green", children: cursor }),
|
|
5732
|
+
inputBuffer || /* @__PURE__ */ jsx13(Text12, { dimColor: true, children: "Ask a question..." })
|
|
5642
5733
|
] }) })
|
|
5643
5734
|
] });
|
|
5644
5735
|
}
|
|
@@ -5903,7 +5994,7 @@ ${content}
|
|
|
5903
5994
|
fixedContent = fixedContent.replace(/^```\w*\n?/, "").replace(/\n?```$/, "");
|
|
5904
5995
|
}
|
|
5905
5996
|
await writeFile(fullPath, fixedContent, "utf-8");
|
|
5906
|
-
const { recordGoalViolationFixed, getActiveGoals } = await import("./goal-validator-
|
|
5997
|
+
const { recordGoalViolationFixed, getActiveGoals } = await import("./goal-validator-4RA64F37.js");
|
|
5907
5998
|
const goals = await getActiveGoals(projectPath);
|
|
5908
5999
|
const matchedGoal = goals.find((g) => g.description === fix.goalDescription);
|
|
5909
6000
|
if (matchedGoal) {
|
|
@@ -5919,8 +6010,8 @@ ${content}
|
|
|
5919
6010
|
function DashboardApp({ onReady }) {
|
|
5920
6011
|
const { state, dispatch } = useDashboard();
|
|
5921
6012
|
const { exit } = useApp();
|
|
5922
|
-
const [showConfig, setShowConfig] =
|
|
5923
|
-
const [showHelp, setShowHelp] =
|
|
6013
|
+
const [showConfig, setShowConfig] = useState3(false);
|
|
6014
|
+
const [showHelp, setShowHelp] = useState3(false);
|
|
5924
6015
|
const dispatchRef = useRef2(dispatch);
|
|
5925
6016
|
dispatchRef.current = dispatch;
|
|
5926
6017
|
const stateRef = useRef2(state);
|
|
@@ -6265,4 +6356,4 @@ export {
|
|
|
6265
6356
|
handleCheckpointTool,
|
|
6266
6357
|
InteractiveDashboard
|
|
6267
6358
|
};
|
|
6268
|
-
//# sourceMappingURL=chunk-
|
|
6359
|
+
//# sourceMappingURL=chunk-KCVXTYHO.js.map
|