@defai.digital/ax-cli 2.7.0 → 3.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/.ax-cli/checkpoints/2025-11-20/checkpoint-2dd84869-e62d-46c8-9885-7e45f37f36e2.json +69 -0
- package/.ax-cli/checkpoints/2025-11-20/checkpoint-484dc350-353f-4808-9ed1-ebb3cefdab37.json +24 -0
- package/.ax-cli/checkpoints/2025-11-20/checkpoint-74a18b87-6172-4215-962b-44bb9f46a662.json +69 -0
- package/.ax-cli/checkpoints/2025-11-20/checkpoint-870a5fb9-6e82-4ff2-8ec8-af4c251cc514.json +44 -0
- package/.ax-cli/checkpoints/2025-11-20/checkpoint-93946601-0e83-456c-ba47-def9713124dd.json +24 -0
- package/.ax-cli/checkpoints/metadata.json +62 -0
- package/README.md +87 -11
- package/dist/agent/context-manager.d.ts +2 -2
- package/dist/agent/context-manager.js +37 -15
- package/dist/agent/context-manager.js.map +1 -1
- package/dist/agent/dependency-resolver.d.ts +83 -0
- package/dist/agent/dependency-resolver.js +310 -0
- package/dist/agent/dependency-resolver.js.map +1 -0
- package/dist/agent/llm-agent.d.ts +111 -0
- package/dist/agent/llm-agent.js +625 -3
- package/dist/agent/llm-agent.js.map +1 -1
- package/dist/agent/specialized/analysis-agent.d.ts +11 -0
- package/dist/agent/specialized/analysis-agent.js +33 -0
- package/dist/agent/specialized/analysis-agent.js.map +1 -0
- package/dist/agent/specialized/debug-agent.d.ts +11 -0
- package/dist/agent/specialized/debug-agent.js +33 -0
- package/dist/agent/specialized/debug-agent.js.map +1 -0
- package/dist/agent/specialized/documentation-agent.d.ts +11 -0
- package/dist/agent/specialized/documentation-agent.js +33 -0
- package/dist/agent/specialized/documentation-agent.js.map +1 -0
- package/dist/agent/specialized/index.d.ts +11 -0
- package/dist/agent/specialized/index.js +12 -0
- package/dist/agent/specialized/index.js.map +1 -0
- package/dist/agent/specialized/performance-agent.d.ts +11 -0
- package/dist/agent/specialized/performance-agent.js +33 -0
- package/dist/agent/specialized/performance-agent.js.map +1 -0
- package/dist/agent/specialized/refactoring-agent.d.ts +11 -0
- package/dist/agent/specialized/refactoring-agent.js +33 -0
- package/dist/agent/specialized/refactoring-agent.js.map +1 -0
- package/dist/agent/specialized/testing-agent.d.ts +11 -0
- package/dist/agent/specialized/testing-agent.js +33 -0
- package/dist/agent/specialized/testing-agent.js.map +1 -0
- package/dist/agent/subagent-orchestrator.d.ts +128 -0
- package/dist/agent/subagent-orchestrator.js +388 -0
- package/dist/agent/subagent-orchestrator.js.map +1 -0
- package/dist/agent/subagent-types.d.ts +262 -0
- package/dist/agent/subagent-types.js +152 -0
- package/dist/agent/subagent-types.js.map +1 -0
- package/dist/agent/subagent.d.ts +88 -0
- package/dist/agent/subagent.js +426 -0
- package/dist/agent/subagent.js.map +1 -0
- package/dist/checkpoint/index.d.ts +9 -0
- package/dist/checkpoint/index.js +11 -0
- package/dist/checkpoint/index.js.map +1 -0
- package/dist/checkpoint/manager.d.ts +99 -0
- package/dist/checkpoint/manager.js +281 -0
- package/dist/checkpoint/manager.js.map +1 -0
- package/dist/checkpoint/storage.d.ts +31 -0
- package/dist/checkpoint/storage.js +265 -0
- package/dist/checkpoint/storage.js.map +1 -0
- package/dist/checkpoint/types.d.ts +111 -0
- package/dist/checkpoint/types.js +17 -0
- package/dist/checkpoint/types.js.map +1 -0
- package/dist/commands/cache.js +5 -3
- package/dist/commands/cache.js.map +1 -1
- package/dist/commands/memory.js +21 -16
- package/dist/commands/memory.js.map +1 -1
- package/dist/commands/plan.d.ts +43 -0
- package/dist/commands/plan.js +385 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/rewind.d.ts +19 -0
- package/dist/commands/rewind.js +221 -0
- package/dist/commands/rewind.js.map +1 -0
- package/dist/constants.d.ts +28 -0
- package/dist/constants.js +29 -0
- package/dist/constants.js.map +1 -1
- package/dist/hooks/use-enhanced-input.d.ts +5 -1
- package/dist/hooks/use-enhanced-input.js +23 -10
- package/dist/hooks/use-enhanced-input.js.map +1 -1
- package/dist/hooks/use-input-handler.d.ts +11 -1
- package/dist/hooks/use-input-handler.js +294 -2
- package/dist/hooks/use-input-handler.js.map +1 -1
- package/dist/llm/client.js +2 -1
- package/dist/llm/client.js.map +1 -1
- package/dist/llm/tools.d.ts +5 -0
- package/dist/llm/tools.js +57 -6
- package/dist/llm/tools.js.map +1 -1
- package/dist/mcp/client.d.ts +1 -0
- package/dist/mcp/client.js +30 -8
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/transports.d.ts +0 -1
- package/dist/mcp/transports.js +10 -7
- package/dist/mcp/transports.js.map +1 -1
- package/dist/planner/dependency-resolver.d.ts +72 -0
- package/dist/planner/dependency-resolver.js +272 -0
- package/dist/planner/dependency-resolver.js.map +1 -0
- package/dist/planner/index.d.ts +12 -0
- package/dist/planner/index.js +26 -0
- package/dist/planner/index.js.map +1 -0
- package/dist/planner/plan-generator.d.ts +74 -0
- package/dist/planner/plan-generator.js +244 -0
- package/dist/planner/plan-generator.js.map +1 -0
- package/dist/planner/plan-storage.d.ts +98 -0
- package/dist/planner/plan-storage.js +325 -0
- package/dist/planner/plan-storage.js.map +1 -0
- package/dist/planner/prompts/planning-prompt.d.ts +41 -0
- package/dist/planner/prompts/planning-prompt.js +289 -0
- package/dist/planner/prompts/planning-prompt.js.map +1 -0
- package/dist/planner/task-planner.d.ts +135 -0
- package/dist/planner/task-planner.js +493 -0
- package/dist/planner/task-planner.js.map +1 -0
- package/dist/planner/token-estimator.d.ts +63 -0
- package/dist/planner/token-estimator.js +295 -0
- package/dist/planner/token-estimator.js.map +1 -0
- package/dist/planner/types.d.ts +669 -0
- package/dist/planner/types.js +213 -0
- package/dist/planner/types.js.map +1 -0
- package/dist/schemas/api-schemas.js +4 -0
- package/dist/schemas/api-schemas.js.map +1 -1
- package/dist/schemas/confirmation-schemas.d.ts +5 -0
- package/dist/schemas/confirmation-schemas.js +7 -0
- package/dist/schemas/confirmation-schemas.js.map +1 -1
- package/dist/schemas/index.d.ts +4 -4
- package/dist/tools/bash-output.d.ts +25 -0
- package/dist/tools/bash-output.js +145 -0
- package/dist/tools/bash-output.js.map +1 -0
- package/dist/tools/bash.d.ts +46 -2
- package/dist/tools/bash.js +241 -42
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/search.js +34 -9
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/text-editor.d.ts +16 -0
- package/dist/tools/text-editor.js +37 -2
- package/dist/tools/text-editor.js.map +1 -1
- package/dist/ui/components/chat-history.d.ts +1 -0
- package/dist/ui/components/chat-history.js +125 -41
- package/dist/ui/components/chat-history.js.map +1 -1
- package/dist/ui/components/chat-input.js +10 -3
- package/dist/ui/components/chat-input.js.map +1 -1
- package/dist/ui/components/chat-interface.js +154 -45
- package/dist/ui/components/chat-interface.js.map +1 -1
- package/dist/ui/components/collapsible-tool-result.d.ts +26 -0
- package/dist/ui/components/collapsible-tool-result.js +172 -0
- package/dist/ui/components/collapsible-tool-result.js.map +1 -0
- package/dist/ui/components/command-suggestions.js +2 -1
- package/dist/ui/components/command-suggestions.js.map +1 -1
- package/dist/ui/components/confirmation-dialog.js +25 -36
- package/dist/ui/components/confirmation-dialog.js.map +1 -1
- package/dist/ui/components/index.d.ts +8 -0
- package/dist/ui/components/index.js +9 -0
- package/dist/ui/components/index.js.map +1 -1
- package/dist/ui/components/keyboard-hints.d.ts +35 -0
- package/dist/ui/components/keyboard-hints.js +134 -0
- package/dist/ui/components/keyboard-hints.js.map +1 -0
- package/dist/ui/components/loading-spinner.d.ts +2 -1
- package/dist/ui/components/loading-spinner.js +86 -34
- package/dist/ui/components/loading-spinner.js.map +1 -1
- package/dist/ui/components/phase-progress.d.ts +21 -0
- package/dist/ui/components/phase-progress.js +228 -0
- package/dist/ui/components/phase-progress.js.map +1 -0
- package/dist/ui/components/quick-actions.d.ts +12 -0
- package/dist/ui/components/quick-actions.js +122 -0
- package/dist/ui/components/quick-actions.js.map +1 -0
- package/dist/ui/components/reasoning-display.d.ts +0 -80
- package/dist/ui/components/reasoning-display.js +0 -83
- package/dist/ui/components/reasoning-display.js.map +1 -1
- package/dist/ui/components/status-bar.d.ts +25 -0
- package/dist/ui/components/status-bar.js +125 -0
- package/dist/ui/components/status-bar.js.map +1 -0
- package/dist/ui/components/subagent-monitor.d.ts +29 -0
- package/dist/ui/components/subagent-monitor.js +150 -0
- package/dist/ui/components/subagent-monitor.js.map +1 -0
- package/dist/ui/components/toast-notification.d.ts +123 -0
- package/dist/ui/components/toast-notification.js +143 -0
- package/dist/ui/components/toast-notification.js.map +1 -0
- package/dist/ui/components/welcome-panel.d.ts +10 -0
- package/dist/ui/components/welcome-panel.js +107 -0
- package/dist/ui/components/welcome-panel.js.map +1 -0
- package/dist/utils/background-task-manager.d.ts +95 -0
- package/dist/utils/background-task-manager.js +330 -0
- package/dist/utils/background-task-manager.js.map +1 -0
- package/dist/utils/confirmation-service.js +8 -3
- package/dist/utils/confirmation-service.js.map +1 -1
- package/dist/utils/history-manager.d.ts +1 -0
- package/dist/utils/history-manager.js +40 -5
- package/dist/utils/history-manager.js.map +1 -1
- package/dist/utils/json-utils.d.ts +7 -0
- package/dist/utils/json-utils.js +70 -2
- package/dist/utils/json-utils.js.map +1 -1
- package/dist/utils/message-optimizer.d.ts +1 -0
- package/dist/utils/message-optimizer.js +7 -1
- package/dist/utils/message-optimizer.js.map +1 -1
- package/dist/utils/project-analyzer.js +5 -2
- package/dist/utils/project-analyzer.js.map +1 -1
- package/dist/utils/settings-manager.js +12 -10
- package/dist/utils/settings-manager.js.map +1 -1
- package/dist/utils/text-utils.js +3 -3
- package/dist/utils/text-utils.js.map +1 -1
- package/dist/utils/token-counter.d.ts +5 -0
- package/dist/utils/token-counter.js +18 -3
- package/dist/utils/token-counter.js.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase Progress Component
|
|
3
|
+
*
|
|
4
|
+
* Displays the progress of multi-phase plan execution.
|
|
5
|
+
*/
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { Box, Text } from "ink";
|
|
8
|
+
import { PhaseStatus, RiskLevel, } from "../../planner/types.js";
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Helper Functions
|
|
11
|
+
// ============================================================================
|
|
12
|
+
/**
|
|
13
|
+
* Get icon for phase status
|
|
14
|
+
*/
|
|
15
|
+
function getStatusIcon(status) {
|
|
16
|
+
switch (status) {
|
|
17
|
+
case PhaseStatus.COMPLETED:
|
|
18
|
+
return "✓";
|
|
19
|
+
case PhaseStatus.EXECUTING:
|
|
20
|
+
return "⏳";
|
|
21
|
+
case PhaseStatus.FAILED:
|
|
22
|
+
return "✕";
|
|
23
|
+
case PhaseStatus.SKIPPED:
|
|
24
|
+
return "⊘";
|
|
25
|
+
case PhaseStatus.APPROVED:
|
|
26
|
+
return "◉";
|
|
27
|
+
case PhaseStatus.QUEUED:
|
|
28
|
+
return "◎";
|
|
29
|
+
case PhaseStatus.CANCELLED:
|
|
30
|
+
return "⊗";
|
|
31
|
+
case PhaseStatus.PENDING:
|
|
32
|
+
default:
|
|
33
|
+
return "○";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get color for phase status
|
|
38
|
+
*/
|
|
39
|
+
function getStatusColor(status) {
|
|
40
|
+
switch (status) {
|
|
41
|
+
case PhaseStatus.COMPLETED:
|
|
42
|
+
return "green";
|
|
43
|
+
case PhaseStatus.EXECUTING:
|
|
44
|
+
return "yellow";
|
|
45
|
+
case PhaseStatus.FAILED:
|
|
46
|
+
return "red";
|
|
47
|
+
case PhaseStatus.SKIPPED:
|
|
48
|
+
return "gray";
|
|
49
|
+
case PhaseStatus.APPROVED:
|
|
50
|
+
return "cyan";
|
|
51
|
+
case PhaseStatus.QUEUED:
|
|
52
|
+
return "blue";
|
|
53
|
+
case PhaseStatus.CANCELLED:
|
|
54
|
+
return "red";
|
|
55
|
+
case PhaseStatus.PENDING:
|
|
56
|
+
default:
|
|
57
|
+
return "gray";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get risk indicator
|
|
62
|
+
*/
|
|
63
|
+
function getRiskIndicator(riskLevel) {
|
|
64
|
+
switch (riskLevel) {
|
|
65
|
+
case RiskLevel.HIGH:
|
|
66
|
+
return { icon: "⚠", color: "red" };
|
|
67
|
+
case RiskLevel.MEDIUM:
|
|
68
|
+
return { icon: "△", color: "yellow" };
|
|
69
|
+
case RiskLevel.LOW:
|
|
70
|
+
default:
|
|
71
|
+
return { icon: "", color: "gray" };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Format duration
|
|
76
|
+
*/
|
|
77
|
+
function formatDuration(ms) {
|
|
78
|
+
if (ms < 1000)
|
|
79
|
+
return `${ms}ms`;
|
|
80
|
+
const seconds = Math.floor(ms / 1000);
|
|
81
|
+
if (seconds < 60)
|
|
82
|
+
return `${seconds}s`;
|
|
83
|
+
const minutes = Math.floor(seconds / 60);
|
|
84
|
+
const remainingSeconds = seconds % 60;
|
|
85
|
+
return `${minutes}m ${remainingSeconds}s`;
|
|
86
|
+
}
|
|
87
|
+
// ============================================================================
|
|
88
|
+
// Phase Item Component
|
|
89
|
+
// ============================================================================
|
|
90
|
+
function PhaseItem({ phase, isCurrent, showDetails = false }) {
|
|
91
|
+
const statusIcon = getStatusIcon(phase.status);
|
|
92
|
+
const statusColor = getStatusColor(phase.status);
|
|
93
|
+
const risk = getRiskIndicator(phase.riskLevel);
|
|
94
|
+
return (React.createElement(Box, { flexDirection: "column" },
|
|
95
|
+
React.createElement(Box, null,
|
|
96
|
+
React.createElement(Text, { color: statusColor, bold: isCurrent }, statusIcon),
|
|
97
|
+
React.createElement(Text, { color: isCurrent ? "white" : "gray", bold: isCurrent },
|
|
98
|
+
" ",
|
|
99
|
+
phase.index + 1,
|
|
100
|
+
". ",
|
|
101
|
+
phase.name),
|
|
102
|
+
risk.icon && (React.createElement(Text, { color: risk.color },
|
|
103
|
+
" ",
|
|
104
|
+
risk.icon)),
|
|
105
|
+
phase.duration && (React.createElement(Text, { color: "gray", dimColor: true },
|
|
106
|
+
" ",
|
|
107
|
+
"(",
|
|
108
|
+
formatDuration(phase.duration),
|
|
109
|
+
")"))),
|
|
110
|
+
showDetails && (React.createElement(Box, { flexDirection: "column", paddingLeft: 3 },
|
|
111
|
+
React.createElement(Text, { color: "gray", dimColor: true }, phase.description),
|
|
112
|
+
phase.objectives.length > 0 && (React.createElement(Box, { flexDirection: "column", marginTop: 0 },
|
|
113
|
+
phase.objectives.slice(0, 3).map((obj, i) => (React.createElement(Text, { key: i, color: "gray", dimColor: true },
|
|
114
|
+
"\u2022 ",
|
|
115
|
+
obj))),
|
|
116
|
+
phase.objectives.length > 3 && (React.createElement(Text, { color: "gray", dimColor: true },
|
|
117
|
+
"...and ",
|
|
118
|
+
phase.objectives.length - 3,
|
|
119
|
+
" more")))),
|
|
120
|
+
phase.error && (React.createElement(Text, { color: "red" },
|
|
121
|
+
"Error: ",
|
|
122
|
+
phase.error))))));
|
|
123
|
+
}
|
|
124
|
+
function CompactProgress({ plan }) {
|
|
125
|
+
const total = plan.phases.length;
|
|
126
|
+
const completed = plan.phases.filter((p) => p.status === PhaseStatus.COMPLETED).length;
|
|
127
|
+
const failed = plan.phases.filter((p) => p.status === PhaseStatus.FAILED).length;
|
|
128
|
+
const currentIndex = plan.currentPhaseIndex;
|
|
129
|
+
// Build progress string
|
|
130
|
+
const progress = plan.phases.map((phase, i) => {
|
|
131
|
+
const icon = getStatusIcon(phase.status);
|
|
132
|
+
const color = getStatusColor(phase.status);
|
|
133
|
+
return { icon, color, isCurrent: i === currentIndex };
|
|
134
|
+
});
|
|
135
|
+
return (React.createElement(Box, { flexDirection: "column" },
|
|
136
|
+
React.createElement(Box, null,
|
|
137
|
+
React.createElement(Text, { color: "cyan", bold: true },
|
|
138
|
+
"Phase ",
|
|
139
|
+
currentIndex + 1,
|
|
140
|
+
"/",
|
|
141
|
+
total),
|
|
142
|
+
currentIndex >= 0 && currentIndex < plan.phases.length && (React.createElement(Text, { color: "white" },
|
|
143
|
+
": ",
|
|
144
|
+
plan.phases[currentIndex].name))),
|
|
145
|
+
React.createElement(Box, { marginTop: 0 }, progress.map((p, i) => (React.createElement(Text, { key: i, color: p.color, bold: p.isCurrent },
|
|
146
|
+
p.icon,
|
|
147
|
+
i < progress.length - 1 ? " → " : "")))),
|
|
148
|
+
React.createElement(Box, { marginTop: 0 },
|
|
149
|
+
React.createElement(Text, { color: "gray", dimColor: true },
|
|
150
|
+
completed,
|
|
151
|
+
" completed",
|
|
152
|
+
failed > 0 && React.createElement(Text, { color: "red" },
|
|
153
|
+
", ",
|
|
154
|
+
failed,
|
|
155
|
+
" failed")))));
|
|
156
|
+
}
|
|
157
|
+
// ============================================================================
|
|
158
|
+
// Main Phase Progress Component
|
|
159
|
+
// ============================================================================
|
|
160
|
+
export function PhaseProgress({ plan, showDetails = false, compact = false, }) {
|
|
161
|
+
if (compact) {
|
|
162
|
+
return React.createElement(CompactProgress, { plan: plan });
|
|
163
|
+
}
|
|
164
|
+
return (React.createElement(Box, { flexDirection: "column" },
|
|
165
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
166
|
+
React.createElement(Text, { color: "cyan", bold: true }, "\uD83D\uDCCB Execution Plan"),
|
|
167
|
+
React.createElement(Text, { color: "gray" },
|
|
168
|
+
" ",
|
|
169
|
+
"(",
|
|
170
|
+
plan.phases.length,
|
|
171
|
+
" phases)")),
|
|
172
|
+
React.createElement(Box, { flexDirection: "column" }, plan.phases.map((phase) => (React.createElement(PhaseItem, { key: phase.id, phase: phase, isCurrent: phase.index === plan.currentPhaseIndex, showDetails: showDetails })))),
|
|
173
|
+
plan.estimatedDuration > 0 && (React.createElement(Box, { marginTop: 1 },
|
|
174
|
+
React.createElement(Text, { color: "gray", dimColor: true },
|
|
175
|
+
"Est. ",
|
|
176
|
+
formatDuration(plan.estimatedDuration)),
|
|
177
|
+
plan.actualDuration > 0 && (React.createElement(Text, { color: "gray", dimColor: true },
|
|
178
|
+
" ",
|
|
179
|
+
"\u2022 Actual: ",
|
|
180
|
+
formatDuration(plan.actualDuration)))))));
|
|
181
|
+
}
|
|
182
|
+
export function PlanSummary({ plan }) {
|
|
183
|
+
const hasHighRisk = plan.phases.some((p) => p.riskLevel === RiskLevel.HIGH);
|
|
184
|
+
const parallelPhases = plan.phases.filter((p) => p.canRunInParallel).length;
|
|
185
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", paddingX: 2, paddingY: 1 },
|
|
186
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
187
|
+
React.createElement(Text, { color: "cyan", bold: true }, "\uD83D\uDCCB Execution Plan")),
|
|
188
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
189
|
+
React.createElement(Text, { color: "gray" }, "Request: "),
|
|
190
|
+
React.createElement(Text, { color: "white" },
|
|
191
|
+
plan.originalPrompt.slice(0, 60),
|
|
192
|
+
plan.originalPrompt.length > 60 ? "..." : "")),
|
|
193
|
+
React.createElement(Box, { flexDirection: "column", marginBottom: 1 },
|
|
194
|
+
React.createElement(Text, { color: "yellow", bold: true }, "Phases:"),
|
|
195
|
+
plan.phases.map((phase, i) => {
|
|
196
|
+
const risk = getRiskIndicator(phase.riskLevel);
|
|
197
|
+
return (React.createElement(Box, { key: phase.id, paddingLeft: 2 },
|
|
198
|
+
React.createElement(Text, { color: "gray" },
|
|
199
|
+
i + 1,
|
|
200
|
+
".",
|
|
201
|
+
" "),
|
|
202
|
+
React.createElement(Text, { color: "white" }, phase.name),
|
|
203
|
+
risk.icon && (React.createElement(Text, { color: risk.color },
|
|
204
|
+
" ",
|
|
205
|
+
risk.icon)),
|
|
206
|
+
phase.requiresApproval && (React.createElement(Text, { color: "yellow" }, " (approval required)"))));
|
|
207
|
+
})),
|
|
208
|
+
React.createElement(Box, null,
|
|
209
|
+
React.createElement(Text, { color: "gray" },
|
|
210
|
+
"Est: ~",
|
|
211
|
+
formatDuration(plan.estimatedDuration)),
|
|
212
|
+
React.createElement(Text, { color: "gray" }, " \u2502 "),
|
|
213
|
+
React.createElement(Text, { color: "gray" },
|
|
214
|
+
"Phases: ",
|
|
215
|
+
plan.phases.length),
|
|
216
|
+
parallelPhases > 0 && (React.createElement(React.Fragment, null,
|
|
217
|
+
React.createElement(Text, { color: "gray" }, " \u2502 "),
|
|
218
|
+
React.createElement(Text, { color: "blue" },
|
|
219
|
+
"Parallel: ",
|
|
220
|
+
parallelPhases))),
|
|
221
|
+
hasHighRisk && (React.createElement(React.Fragment, null,
|
|
222
|
+
React.createElement(Text, { color: "gray" }, " \u2502 "),
|
|
223
|
+
React.createElement(Text, { color: "red" }, "\u26A0 High Risk")))),
|
|
224
|
+
React.createElement(Box, { marginTop: 1, borderStyle: "single", borderColor: "gray", paddingX: 1 },
|
|
225
|
+
React.createElement(Text, { color: "gray", dimColor: true }, "[Enter] Execute \u2502 [e] Edit \u2502 [s] Skip phase \u2502 [c] Cancel"))));
|
|
226
|
+
}
|
|
227
|
+
export default PhaseProgress;
|
|
228
|
+
//# sourceMappingURL=phase-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase-progress.js","sourceRoot":"","sources":["../../../src/ui/components/phase-progress.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAGL,WAAW,EACX,SAAS,GACV,MAAM,wBAAwB,CAAC;AAkBhC,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;GAEG;AACH,SAAS,aAAa,CAAC,MAAmB;IACxC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,WAAW,CAAC,SAAS;YACxB,OAAO,GAAG,CAAC;QACb,KAAK,WAAW,CAAC,SAAS;YACxB,OAAO,GAAG,CAAC;Q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,MAAM,eAAW;gBAC7B,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM;;oBAAY,cAAc,CAAQ,CACnD,CACJ;YACA,WAAW,IAAI,CACd;gBACE,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,eAAW;gBAC7B,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK,uBAAmB,CACnC,CACJ,CACG;QAEN,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC,EAAE,WAAW,EAAC,QAAQ,EAAC,WAAW,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC;YACpE,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,oFAEpB,CACH,CACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quick Actions Menu Component (Ctrl+K style command palette)
|
|
3
|
+
* Provides fast access to common commands
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
interface QuickActionsProps {
|
|
7
|
+
isVisible: boolean;
|
|
8
|
+
onSelect: (command: string) => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function QuickActions({ isVisible, onSelect, onClose }: QuickActionsProps): React.JSX.Element | null;
|
|
12
|
+
export default QuickActions;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quick Actions Menu Component (Ctrl+K style command palette)
|
|
3
|
+
* Provides fast access to common commands
|
|
4
|
+
*/
|
|
5
|
+
import React, { useState, useEffect, useMemo } from "react";
|
|
6
|
+
import { Box, Text, useInput } from "ink";
|
|
7
|
+
const QUICK_ACTIONS = [
|
|
8
|
+
// Navigation
|
|
9
|
+
{ command: "/clear", label: "Clear", description: "Clear conversation history", category: "navigation" },
|
|
10
|
+
{ command: "/continue", label: "Continue", description: "Resume incomplete response", category: "navigation" },
|
|
11
|
+
{ command: "/exit", label: "Exit", description: "Exit ax-cli", category: "navigation" },
|
|
12
|
+
// Settings
|
|
13
|
+
{ command: "/init", label: "Init", description: "Initialize project context (CUSTOM.md)", category: "settings" },
|
|
14
|
+
{ command: "/models", label: "Models", description: "List available models", category: "settings" },
|
|
15
|
+
{ command: "/setup", label: "Setup", description: "Configure API keys and settings", category: "settings" },
|
|
16
|
+
// Tools
|
|
17
|
+
{ command: "/tasks", label: "Tasks", description: "List background tasks", category: "tools" },
|
|
18
|
+
{ command: "/usage", label: "Usage", description: "Show API usage statistics", category: "tools" },
|
|
19
|
+
{ command: "/mcp list", label: "MCP List", description: "List connected MCP servers", category: "tools" },
|
|
20
|
+
{ command: "/commit-and-push", label: "Commit", description: "AI commit & push to remote", category: "tools" },
|
|
21
|
+
{ command: "/rewind", label: "Rewind", description: "Rewind to previous checkpoint", category: "tools" },
|
|
22
|
+
{ command: "/checkpoints", label: "Checkpoints", description: "Show checkpoint statistics", category: "tools" },
|
|
23
|
+
// Help
|
|
24
|
+
{ command: "/help", label: "Help", description: "Show all available commands", category: "help" },
|
|
25
|
+
];
|
|
26
|
+
export function QuickActions({ isVisible, onSelect, onClose }) {
|
|
27
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
28
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
29
|
+
// Filter actions based on search query
|
|
30
|
+
const filteredActions = useMemo(() => {
|
|
31
|
+
if (!searchQuery)
|
|
32
|
+
return QUICK_ACTIONS;
|
|
33
|
+
const query = searchQuery.toLowerCase();
|
|
34
|
+
return QUICK_ACTIONS.filter((action) => action.command.toLowerCase().includes(query) ||
|
|
35
|
+
action.label.toLowerCase().includes(query) ||
|
|
36
|
+
action.description.toLowerCase().includes(query));
|
|
37
|
+
}, [searchQuery]);
|
|
38
|
+
// Reset selection when filtered list changes
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
setSelectedIndex(0);
|
|
41
|
+
}, [filteredActions]);
|
|
42
|
+
// Reset state when menu opens
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (isVisible) {
|
|
45
|
+
setSearchQuery("");
|
|
46
|
+
setSelectedIndex(0);
|
|
47
|
+
}
|
|
48
|
+
}, [isVisible]);
|
|
49
|
+
useInput((input, key) => {
|
|
50
|
+
if (!isVisible)
|
|
51
|
+
return;
|
|
52
|
+
if (key.escape) {
|
|
53
|
+
onClose();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (key.return) {
|
|
57
|
+
if (filteredActions.length > 0) {
|
|
58
|
+
onSelect(filteredActions[selectedIndex].command);
|
|
59
|
+
}
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (key.upArrow) {
|
|
63
|
+
setSelectedIndex((prev) => prev > 0 ? prev - 1 : filteredActions.length - 1);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (key.downArrow) {
|
|
67
|
+
setSelectedIndex((prev) => prev < filteredActions.length - 1 ? prev + 1 : 0);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (key.backspace || key.delete) {
|
|
71
|
+
setSearchQuery((prev) => prev.slice(0, -1));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
// Add character to search
|
|
75
|
+
if (input && !key.ctrl && !key.meta) {
|
|
76
|
+
setSearchQuery((prev) => prev + input);
|
|
77
|
+
}
|
|
78
|
+
}, { isActive: isVisible });
|
|
79
|
+
if (!isVisible)
|
|
80
|
+
return null;
|
|
81
|
+
// Group actions by category with pre-calculated indices
|
|
82
|
+
const { groupedActions, actionIndices } = useMemo(() => {
|
|
83
|
+
const groups = {};
|
|
84
|
+
const indices = new Map();
|
|
85
|
+
let idx = 0;
|
|
86
|
+
filteredActions.forEach((action) => {
|
|
87
|
+
if (!groups[action.category]) {
|
|
88
|
+
groups[action.category] = [];
|
|
89
|
+
}
|
|
90
|
+
groups[action.category].push(action);
|
|
91
|
+
indices.set(action.command, idx++);
|
|
92
|
+
});
|
|
93
|
+
return { groupedActions: groups, actionIndices: indices };
|
|
94
|
+
}, [filteredActions]);
|
|
95
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, paddingY: 0, marginTop: 1 },
|
|
96
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
97
|
+
React.createElement(Text, { color: "cyan", bold: true }, "\u2318 Quick Actions"),
|
|
98
|
+
React.createElement(Text, { color: "gray" }, " (type to search)")),
|
|
99
|
+
React.createElement(Box, { borderStyle: "single", borderColor: "gray", paddingX: 1, marginBottom: 1 },
|
|
100
|
+
React.createElement(Text, { color: "cyan" }, "\u276F "),
|
|
101
|
+
React.createElement(Text, null,
|
|
102
|
+
searchQuery,
|
|
103
|
+
React.createElement(Text, { backgroundColor: "white", color: "black" }, " ")),
|
|
104
|
+
!searchQuery && (React.createElement(Text, { color: "gray", dimColor: true }, "Search commands..."))),
|
|
105
|
+
filteredActions.length === 0 ? (React.createElement(Box, null,
|
|
106
|
+
React.createElement(Text, { color: "gray" }, "No matching commands found"))) : (Object.entries(groupedActions).map(([category, actions]) => (React.createElement(Box, { key: category, flexDirection: "column", marginBottom: 1 },
|
|
107
|
+
React.createElement(Box, null,
|
|
108
|
+
React.createElement(Text, { color: "gray", dimColor: true, bold: true }, category.toUpperCase())),
|
|
109
|
+
actions.map((action) => {
|
|
110
|
+
const currentIndex = actionIndices.get(action.command) ?? -1;
|
|
111
|
+
const isSelected = currentIndex === selectedIndex;
|
|
112
|
+
return (React.createElement(Box, { key: action.command, paddingLeft: 1 },
|
|
113
|
+
React.createElement(Text, { color: isSelected ? "black" : "cyan", backgroundColor: isSelected ? "cyan" : undefined }, action.command.padEnd(15)),
|
|
114
|
+
React.createElement(Text, { color: isSelected ? "black" : "gray", backgroundColor: isSelected ? "cyan" : undefined },
|
|
115
|
+
" ",
|
|
116
|
+
action.description)));
|
|
117
|
+
}))))),
|
|
118
|
+
React.createElement(Box, { marginTop: 1 },
|
|
119
|
+
React.createElement(Text, { color: "gray", dimColor: true }, "\u2191\u2193 navigate \u2022 Enter select \u2022 Esc close"))));
|
|
120
|
+
}
|
|
121
|
+
export default QuickActions;
|
|
122
|
+
//# sourceMappingURL=quick-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick-actions.js","sourceRoot":"","sources":["../../../src/ui/components/quick-actions.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAS1C,MAAM,aAAa,GAAkB;IACnC,aAAa;IACb,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,4BAA4B,EAAE,QAAQ,EAAE,YAAY,EAAE;IACxG,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,4BAA4B,EAAE,QAAQ,EAAE,YAAY,EAAE;IAC9G,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE;IAEvF,WAAW;IACX,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,wCAAwC,EAAE,QAAQ,EAAE,UAAU,EAAE;IAChH,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE,QAAQ,EAAE,UAAU,EAAE;IACnG,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,iCAAiC,EAAE,QAAQ,EAAE,UAAU,EAAE;IAE3G,QAAQ;IACR,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,QAAQ,EAAE,OAAO,EAAE;IAC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oBAAC,GAAG;gBACF,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,QAAC,IAAI,UAC7B,QAAQ,CAAC,WAAW,EAAE,CAClB,CACH;YAGL,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;gBACtB,MAAM,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC7D,MAAM,UAAU,GAAG,YAAY,KAAK,aAAa,CAAC;gBAElD,OAAO,CACL,oBAAC,GAAG,IAAC,GAAG,EAAE,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE,CAAC;oBACtC,oBAAC,IAAI,IACH,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EACpC,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,IAE/C,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CACrB;oBACP,oBAAC,IAAI,IACH,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EACpC,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;wBAE/C,GAAG;wBAAE,MAAM,CAAC,WAAW,CACnB,CACH,CACP,CAAC;YACJ,CAAC,CAAC,CACE,CACP,CAAC,CACH;QAGD,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,uEAEpB,CACH,CACF,CACP,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -22,88 +22,8 @@ export interface ReasoningDisplayProps {
|
|
|
22
22
|
* separation from the final answer.
|
|
23
23
|
*
|
|
24
24
|
* Features:
|
|
25
|
-
* - Collapsible/expandable reasoning section
|
|
26
25
|
* - Visual distinction with dimmed styling
|
|
27
26
|
* - Streaming support with indicator
|
|
28
27
|
* - Clear separation from final answer
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```tsx
|
|
32
|
-
* <ReasoningDisplay
|
|
33
|
-
* content="Let me break down this problem step by step..."
|
|
34
|
-
* visible={showReasoning}
|
|
35
|
-
* isStreaming={true}
|
|
36
|
-
* />
|
|
37
|
-
* ```
|
|
38
28
|
*/
|
|
39
29
|
export declare function ReasoningDisplay({ content, visible, isStreaming, }: ReasoningDisplayProps): React.JSX.Element | null;
|
|
40
|
-
/**
|
|
41
|
-
* CollapsibleReasoningDisplay Component
|
|
42
|
-
*
|
|
43
|
-
* Advanced version with collapse/expand functionality.
|
|
44
|
-
* Allows users to toggle visibility of reasoning content.
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```tsx
|
|
48
|
-
* <CollapsibleReasoningDisplay
|
|
49
|
-
* content="Step 1: Analyze the input..."
|
|
50
|
-
* defaultCollapsed={false}
|
|
51
|
-
* />
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
export interface CollapsibleReasoningDisplayProps {
|
|
55
|
-
content: string;
|
|
56
|
-
/**
|
|
57
|
-
* Whether the reasoning is collapsed by default
|
|
58
|
-
* @default false
|
|
59
|
-
*/
|
|
60
|
-
defaultCollapsed?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Whether this is a streaming update
|
|
63
|
-
* @default false
|
|
64
|
-
*/
|
|
65
|
-
isStreaming?: boolean;
|
|
66
|
-
}
|
|
67
|
-
export declare function CollapsibleReasoningDisplay({ content, defaultCollapsed, isStreaming, }: CollapsibleReasoningDisplayProps): React.JSX.Element | null;
|
|
68
|
-
/**
|
|
69
|
-
* ReasoningSection Component
|
|
70
|
-
*
|
|
71
|
-
* Wrapper for multiple reasoning steps or sections.
|
|
72
|
-
* Useful for displaying step-by-step thought processes.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```tsx
|
|
76
|
-
* <ReasoningSection
|
|
77
|
-
* steps={[
|
|
78
|
-
* "Step 1: Understanding the problem...",
|
|
79
|
-
* "Step 2: Analyzing the code...",
|
|
80
|
-
* "Step 3: Proposing a solution..."
|
|
81
|
-
* ]}
|
|
82
|
-
* />
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
export interface ReasoningSectionProps {
|
|
86
|
-
/**
|
|
87
|
-
* Array of reasoning steps
|
|
88
|
-
*/
|
|
89
|
-
steps: string[];
|
|
90
|
-
/**
|
|
91
|
-
* Whether to show step numbers
|
|
92
|
-
* @default true
|
|
93
|
-
*/
|
|
94
|
-
showStepNumbers?: boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Whether this is actively streaming
|
|
97
|
-
* @default false
|
|
98
|
-
*/
|
|
99
|
-
isStreaming?: boolean;
|
|
100
|
-
}
|
|
101
|
-
export declare function ReasoningSection({ steps, showStepNumbers, isStreaming, }: ReasoningSectionProps): React.JSX.Element | null;
|
|
102
|
-
/**
|
|
103
|
-
* Utility function to parse reasoning content into steps
|
|
104
|
-
* Detects common step patterns like "Step 1:", "1.", etc.
|
|
105
|
-
*
|
|
106
|
-
* @param content - Raw reasoning content
|
|
107
|
-
* @returns Array of reasoning steps
|
|
108
|
-
*/
|
|
109
|
-
export declare function parseReasoningSteps(content: string): string[];
|
|
@@ -7,19 +7,9 @@ import { Box, Text } from "ink";
|
|
|
7
7
|
* separation from the final answer.
|
|
8
8
|
*
|
|
9
9
|
* Features:
|
|
10
|
-
* - Collapsible/expandable reasoning section
|
|
11
10
|
* - Visual distinction with dimmed styling
|
|
12
11
|
* - Streaming support with indicator
|
|
13
12
|
* - Clear separation from final answer
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```tsx
|
|
17
|
-
* <ReasoningDisplay
|
|
18
|
-
* content="Let me break down this problem step by step..."
|
|
19
|
-
* visible={showReasoning}
|
|
20
|
-
* isStreaming={true}
|
|
21
|
-
* />
|
|
22
|
-
* ```
|
|
23
13
|
*/
|
|
24
14
|
export function ReasoningDisplay({ content, visible = true, isStreaming = false, }) {
|
|
25
15
|
// Don't render if not visible or no content
|
|
@@ -34,77 +24,4 @@ export function ReasoningDisplay({ content, visible = true, isStreaming = false,
|
|
|
34
24
|
React.createElement(Box, { flexDirection: "column", paddingLeft: 1 },
|
|
35
25
|
React.createElement(Text, { color: "white", dimColor: true, italic: true }, content))));
|
|
36
26
|
}
|
|
37
|
-
export function CollapsibleReasoningDisplay({ content, defaultCollapsed = false, isStreaming = false, }) {
|
|
38
|
-
const [isCollapsed] = React.useState(defaultCollapsed);
|
|
39
|
-
// const setIsCollapsed = ...; // TODO: Implement toggle functionality with user input
|
|
40
|
-
if (!content || content.trim().length === 0) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
// Extract first line as preview
|
|
44
|
-
const lines = content.split("\n");
|
|
45
|
-
const preview = lines[0]?.slice(0, 80) || "";
|
|
46
|
-
const hasMore = content.length > 80 || lines.length > 1;
|
|
47
|
-
return (React.createElement(Box, { flexDirection: "column", marginBottom: 1, paddingLeft: 2, borderStyle: "single", borderColor: "gray" },
|
|
48
|
-
React.createElement(Box, { flexDirection: "row", marginBottom: 0 },
|
|
49
|
-
React.createElement(Text, { color: "cyan", dimColor: true },
|
|
50
|
-
isCollapsed ? "▸" : "▾",
|
|
51
|
-
" \uD83D\uDCAD Thinking",
|
|
52
|
-
isStreaming ? "..." : "",
|
|
53
|
-
hasMore && isCollapsed && (React.createElement(Text, { dimColor: true }, " (click to expand)")))),
|
|
54
|
-
React.createElement(Box, { flexDirection: "column", paddingLeft: 1 }, isCollapsed ? (React.createElement(Text, { color: "white", dimColor: true, italic: true },
|
|
55
|
-
preview,
|
|
56
|
-
hasMore && "...")) : (React.createElement(Text, { color: "white", dimColor: true, italic: true }, content)))));
|
|
57
|
-
}
|
|
58
|
-
export function ReasoningSection({ steps, showStepNumbers = true, isStreaming = false, }) {
|
|
59
|
-
if (!steps || steps.length === 0) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
return (React.createElement(Box, { flexDirection: "column", marginBottom: 1, paddingLeft: 2, borderStyle: "single", borderColor: "gray" },
|
|
63
|
-
React.createElement(Box, { flexDirection: "row", marginBottom: 0 },
|
|
64
|
-
React.createElement(Text, { color: "cyan", dimColor: true },
|
|
65
|
-
"\uD83D\uDCAD Thinking Process",
|
|
66
|
-
isStreaming ? "..." : "")),
|
|
67
|
-
React.createElement(Box, { flexDirection: "column", paddingLeft: 1 }, steps.map((step, index) => (React.createElement(Box, { key: index, flexDirection: "row", marginY: 0 },
|
|
68
|
-
showStepNumbers && (React.createElement(Text, { color: "cyan", dimColor: true },
|
|
69
|
-
index + 1,
|
|
70
|
-
".",
|
|
71
|
-
" ")),
|
|
72
|
-
React.createElement(Text, { color: "white", dimColor: true, italic: true }, step)))))));
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Utility function to parse reasoning content into steps
|
|
76
|
-
* Detects common step patterns like "Step 1:", "1.", etc.
|
|
77
|
-
*
|
|
78
|
-
* @param content - Raw reasoning content
|
|
79
|
-
* @returns Array of reasoning steps
|
|
80
|
-
*/
|
|
81
|
-
export function parseReasoningSteps(content) {
|
|
82
|
-
if (!content || content.trim().length === 0)
|
|
83
|
-
return [];
|
|
84
|
-
// Try to detect step patterns
|
|
85
|
-
const stepPatterns = [
|
|
86
|
-
/^Step \d+:/im,
|
|
87
|
-
/^\d+\./m,
|
|
88
|
-
/^-\s/m,
|
|
89
|
-
/^\*\s/m,
|
|
90
|
-
];
|
|
91
|
-
for (const pattern of stepPatterns) {
|
|
92
|
-
if (pattern.test(content)) {
|
|
93
|
-
// Split by the pattern
|
|
94
|
-
const steps = content
|
|
95
|
-
.split(/(?=^Step \d+:|^\d+\.|^-\s|^\*\s)/m)
|
|
96
|
-
.filter(s => s.trim().length > 0)
|
|
97
|
-
.map(s => s.trim());
|
|
98
|
-
if (steps.length > 1) {
|
|
99
|
-
return steps;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
// If no patterns found, split by paragraphs
|
|
104
|
-
const paragraphs = content
|
|
105
|
-
.split("\n\n")
|
|
106
|
-
.filter(p => p.trim().length > 0)
|
|
107
|
-
.map(p => p.trim());
|
|
108
|
-
return paragraphs.length > 1 ? paragraphs : [content];
|
|
109
|
-
}
|
|
110
27
|
//# sourceMappingURL=reasoning-display.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reasoning-display.js","sourceRoot":"","sources":["../../../src/ui/components/reasoning-display.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAmBhC
|
|
1
|
+
{"version":3,"file":"reasoning-display.js","sourceRoot":"","sources":["../../../src/ui/components/reasoning-display.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAmBhC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,OAAO,EACP,OAAO,GAAG,IAAI,EACd,WAAW,GAAG,KAAK,GACG;IACtB,4CAA4C;IAC5C,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAC,QAAQ,EAAC,WAAW,EAAC,MAAM;QAClG,oBAAC,GAAG,IAAC,aAAa,EAAC,KAAK,EAAC,YAAY,EAAE,CAAC;YACtC,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ;;gBACb,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAC/B,CACH;QACN,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAE,CAAC;YACxC,oBAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,QAAC,MAAM,UAChC,OAAO,CACH,CACH,CACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced Status Bar Component
|
|
3
|
+
* Professional, scannable status display with visual context indicator
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
interface StatusBarProps {
|
|
7
|
+
projectName: string;
|
|
8
|
+
version: string;
|
|
9
|
+
model: string;
|
|
10
|
+
contextPercentage: number;
|
|
11
|
+
showAutoPrune: boolean;
|
|
12
|
+
autoEditEnabled: boolean;
|
|
13
|
+
verboseMode: boolean;
|
|
14
|
+
backgroundMode?: boolean;
|
|
15
|
+
mcpServerCount?: number;
|
|
16
|
+
backgroundTaskCount?: number;
|
|
17
|
+
isProcessing?: boolean;
|
|
18
|
+
processingTime?: number;
|
|
19
|
+
tokenCount?: number;
|
|
20
|
+
flashAutoEdit?: boolean;
|
|
21
|
+
flashVerbose?: boolean;
|
|
22
|
+
flashBackground?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function StatusBar({ projectName, version, model, contextPercentage, showAutoPrune, autoEditEnabled, verboseMode, backgroundMode, mcpServerCount, backgroundTaskCount, isProcessing, tokenCount, flashAutoEdit, flashVerbose, flashBackground, }: StatusBarProps): React.JSX.Element;
|
|
25
|
+
export default StatusBar;
|