fecode-cli 1.1.2 → 1.2.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.
Files changed (85) hide show
  1. package/README.md +101 -10
  2. package/dist/error-D4a-8BXd.js +56 -0
  3. package/dist/index.js +9770 -4513
  4. package/dist/node.browser-2EgZAKSy.js +46 -0
  5. package/dist/node.browser-B5Gur0wd.js +46 -0
  6. package/dist/node.browser-BSlAsiSV.js +46 -0
  7. package/dist/node.browser-BraUi2yf.js +9 -0
  8. package/dist/node.browser-CdVAMgSg.js +46 -0
  9. package/dist/src-CSWdjU4j.js +31870 -0
  10. package/dist/src-DY3OmBmT.js +33646 -0
  11. package/dist/src-DcYf8vsK.js +31880 -0
  12. package/dist/src-DkWmcv2Q.js +33647 -0
  13. package/package.json +5 -2
  14. package/skills/accessibility/SKILL.md +98 -98
  15. package/skills/css/SKILL.md +90 -90
  16. package/skills/frontend-debugging/SKILL.md +201 -201
  17. package/skills/frontend-design/SKILL.md +358 -358
  18. package/skills/frontend-performance/SKILL.md +89 -89
  19. package/skills/frontend-testing/SKILL.md +87 -87
  20. package/skills/nextjs/SKILL.md +75 -75
  21. package/skills/react/SKILL.md +213 -213
  22. package/skills/responsive-design/SKILL.md +190 -190
  23. package/skills/svelte/SKILL.md +86 -86
  24. package/skills/tailwind/SKILL.md +74 -74
  25. package/skills/ui-review/SKILL.md +245 -245
  26. package/skills/vue/SKILL.md +72 -72
  27. package/dist/App.d.ts +0 -33
  28. package/dist/App.js +0 -2224
  29. package/dist/approvalResolver.d.ts +0 -12
  30. package/dist/approvalResolver.js +0 -112
  31. package/dist/commands.d.ts +0 -11
  32. package/dist/commands.js +0 -33
  33. package/dist/index.d.ts +0 -3
  34. package/dist/ui/AppShell.d.ts +0 -14
  35. package/dist/ui/AppShell.js +0 -25
  36. package/dist/ui/ApprovalPrompt.d.ts +0 -31
  37. package/dist/ui/ApprovalPrompt.js +0 -55
  38. package/dist/ui/BlockedView.d.ts +0 -13
  39. package/dist/ui/BlockedView.js +0 -7
  40. package/dist/ui/CommandPalette.d.ts +0 -8
  41. package/dist/ui/CommandPalette.js +0 -18
  42. package/dist/ui/CurrentStepView.d.ts +0 -16
  43. package/dist/ui/CurrentStepView.js +0 -28
  44. package/dist/ui/DiagnosticsView.d.ts +0 -45
  45. package/dist/ui/DiagnosticsView.js +0 -23
  46. package/dist/ui/ExecutionTimeline.d.ts +0 -15
  47. package/dist/ui/ExecutionTimeline.js +0 -51
  48. package/dist/ui/ExecutionView.d.ts +0 -42
  49. package/dist/ui/ExecutionView.js +0 -20
  50. package/dist/ui/Header.d.ts +0 -15
  51. package/dist/ui/Header.js +0 -47
  52. package/dist/ui/HelpView.d.ts +0 -3
  53. package/dist/ui/HelpView.js +0 -35
  54. package/dist/ui/MessageBubble.d.ts +0 -9
  55. package/dist/ui/MessageBubble.js +0 -58
  56. package/dist/ui/PlanStep.d.ts +0 -16
  57. package/dist/ui/PlanStep.js +0 -71
  58. package/dist/ui/PlanView.d.ts +0 -26
  59. package/dist/ui/PlanView.js +0 -24
  60. package/dist/ui/ProgressBar.d.ts +0 -10
  61. package/dist/ui/ProgressBar.js +0 -14
  62. package/dist/ui/RecoveryView.d.ts +0 -20
  63. package/dist/ui/RecoveryView.js +0 -19
  64. package/dist/ui/ReplanView.d.ts +0 -16
  65. package/dist/ui/ReplanView.js +0 -21
  66. package/dist/ui/ResumeView.d.ts +0 -15
  67. package/dist/ui/ResumeView.js +0 -25
  68. package/dist/ui/RiskNotice.d.ts +0 -10
  69. package/dist/ui/RiskNotice.js +0 -21
  70. package/dist/ui/RunHistoryView.d.ts +0 -15
  71. package/dist/ui/RunHistoryView.js +0 -39
  72. package/dist/ui/StatusBar.d.ts +0 -16
  73. package/dist/ui/StatusBar.js +0 -104
  74. package/dist/ui/TaskInput.d.ts +0 -15
  75. package/dist/ui/TaskInput.js +0 -8
  76. package/dist/ui/ThinkingBlock.d.ts +0 -8
  77. package/dist/ui/ThinkingBlock.js +0 -13
  78. package/dist/ui/ThinkingIndicator.d.ts +0 -7
  79. package/dist/ui/ThinkingIndicator.js +0 -20
  80. package/dist/ui/TurnView.d.ts +0 -13
  81. package/dist/ui/TurnView.js +0 -11
  82. package/dist/ui/WorkspaceStatus.d.ts +0 -20
  83. package/dist/ui/WorkspaceStatus.js +0 -23
  84. package/dist/ui/index.d.ts +0 -26
  85. package/dist/ui/index.js +0 -26
@@ -1,12 +0,0 @@
1
- import type { ApprovalDecision, ApprovalRequest, ApprovalResolver } from "@fecode/models";
2
- export declare function formatApprovalRequest(request: ApprovalRequest): string;
3
- export declare function formatApprovalArguments(args: unknown, maxStringLength?: number): string;
4
- export declare class InteractiveApprovalResolver implements ApprovalResolver {
5
- onRequest?: (request: ApprovalRequest) => void;
6
- pendingRequest?: ApprovalRequest;
7
- private pendingResolver?;
8
- resolve(request: ApprovalRequest): Promise<ApprovalDecision>;
9
- submitDecision(input: string | boolean | ApprovalDecision): void;
10
- cancelPending(reason?: string): void;
11
- }
12
- //# sourceMappingURL=approvalResolver.d.ts.map
@@ -1,112 +0,0 @@
1
- import { ChangeReviewFormatter } from "@fecode/agent";
2
- export function formatApprovalRequest(request) {
3
- if (request.changeReview) {
4
- return ChangeReviewFormatter.format(request.changeReview);
5
- }
6
- if (request.toolName === "execute_command") {
7
- const args = request.arguments;
8
- const cmd = args?.command || "";
9
- return `⚠ FeCode wants to run a command\n\nCommand:\n ${cmd}\n`;
10
- }
11
- return formatApprovalArguments(request.arguments);
12
- }
13
- export function formatApprovalArguments(args, maxStringLength = 80) {
14
- if (args === null || args === undefined) {
15
- return "{}";
16
- }
17
- if (typeof args !== "object") {
18
- const str = String(args);
19
- return str.length > maxStringLength
20
- ? str.slice(0, maxStringLength) + "..."
21
- : str;
22
- }
23
- const rec = args;
24
- if (typeof rec.diff === "string" && rec.diff) {
25
- const pathStr = typeof rec.path === "string" ? rec.path : "";
26
- const lines = rec.diff.split("\n");
27
- let displayDiff = rec.diff;
28
- if (lines.length > 30) {
29
- const half = 15;
30
- const top = lines.slice(0, half);
31
- const bottom = lines.slice(lines.length - half);
32
- const omitted = lines.length - 30;
33
- displayDiff = [...top, `... (${omitted} lines omitted) ...`, ...bottom].join("\n");
34
- }
35
- return `${pathStr ? `File:\n ${pathStr}\n\n` : ""}Changes:\n${displayDiff}`;
36
- }
37
- const entries = [];
38
- for (const [key, value] of Object.entries(rec)) {
39
- if (typeof value === "string") {
40
- const displayVal = value.length > maxStringLength
41
- ? value.slice(0, maxStringLength) + "..."
42
- : value;
43
- entries.push(`${key}: ${displayVal}`);
44
- }
45
- else {
46
- const jsonStr = JSON.stringify(value) ?? "undefined";
47
- const displayVal = jsonStr.length > maxStringLength
48
- ? jsonStr.slice(0, maxStringLength) + "..."
49
- : jsonStr;
50
- entries.push(`${key}: ${displayVal}`);
51
- }
52
- }
53
- return entries.length > 0 ? entries.join("\n") : "{}";
54
- }
55
- export class InteractiveApprovalResolver {
56
- onRequest;
57
- pendingRequest;
58
- pendingResolver;
59
- async resolve(request) {
60
- if (this.pendingResolver) {
61
- this.cancelPending("Superseded by new approval request.");
62
- }
63
- this.pendingRequest = request;
64
- return new Promise((res) => {
65
- this.pendingResolver = res;
66
- if (this.onRequest) {
67
- this.onRequest(request);
68
- }
69
- });
70
- }
71
- submitDecision(input) {
72
- if (!this.pendingResolver) {
73
- return;
74
- }
75
- const resolve = this.pendingResolver;
76
- this.pendingResolver = undefined;
77
- this.pendingRequest = undefined;
78
- if (typeof input === "boolean") {
79
- resolve(input
80
- ? { approved: true }
81
- : { approved: false, reason: "Tool execution was denied by the user." });
82
- return;
83
- }
84
- if (typeof input === "object" && input !== null) {
85
- resolve(input);
86
- return;
87
- }
88
- const normalized = typeof input === "string" ? input.trim().toLowerCase() : "";
89
- if (normalized === "y" || normalized === "yes") {
90
- resolve({ approved: true });
91
- }
92
- else {
93
- resolve({
94
- approved: false,
95
- reason: "Tool execution was denied by the user."
96
- });
97
- }
98
- }
99
- cancelPending(reason = "Approval request was cancelled.") {
100
- if (!this.pendingResolver) {
101
- return;
102
- }
103
- const resolve = this.pendingResolver;
104
- this.pendingResolver = undefined;
105
- this.pendingRequest = undefined;
106
- resolve({
107
- approved: false,
108
- reason
109
- });
110
- }
111
- }
112
- //# sourceMappingURL=approvalResolver.js.map
@@ -1,11 +0,0 @@
1
- export interface CommandDef {
2
- command: string;
3
- description: string;
4
- }
5
- export declare const COMMANDS: CommandDef[];
6
- /**
7
- * Returns commands whose command string starts with `prefix`.
8
- * `prefix` should include the leading `/` e.g. "/he"
9
- */
10
- export declare function filterCommands(prefix: string): CommandDef[];
11
- //# sourceMappingURL=commands.d.ts.map
package/dist/commands.js DELETED
@@ -1,33 +0,0 @@
1
- export const COMMANDS = [
2
- { command: "/help", description: "Show available commands & keyboard shortcuts" },
3
- { command: "/status", description: "Show current session, model, and project context" },
4
- { command: "/plan", description: "Display current active task plan (or /plan <runId>)" },
5
- { command: "/runs", description: "List recent durable historical runs" },
6
- { command: "/run", description: "Inspect specific historical run by ID (/run <id>)" },
7
- { command: "/resume", description: "Prepare and resume task from previous run (/resume <id>)" },
8
- { command: "/replan", description: "Request replanning for current task (or /replan <runId>)" },
9
- { command: "/debug", description: "Show diagnostics summary for current run" },
10
- { command: "/diagnostics", description: "Show complete diagnostic telemetry" },
11
- { command: "/history", description: "Show completed tasks in current session" },
12
- { command: "/tasks", description: "List session task summaries" },
13
- { command: "/task", description: "View task details by index (/task <index>)" },
14
- { command: "/git", description: "Inspect git repository status and branch" },
15
- { command: "/checkpoints", description: "List available rollback checkpoints" },
16
- { command: "/checkpoint", description: "Create a new manual checkpoint" },
17
- { command: "/recover", description: "Inspect or initiate checkpoint recovery" },
18
- { command: "/sessions", description: "List saved CLI sessions" },
19
- { command: "/delete-session", description: "Delete a specific saved session (/delete-session <id>)" },
20
- { command: "/clear", description: "Clear current terminal conversation history" },
21
- { command: "/exit", description: "Persist session and exit FeCode" }
22
- ];
23
- /**
24
- * Returns commands whose command string starts with `prefix`.
25
- * `prefix` should include the leading `/` e.g. "/he"
26
- */
27
- export function filterCommands(prefix) {
28
- if (!prefix || !prefix.trim().startsWith("/"))
29
- return [];
30
- const lower = prefix.trim().toLowerCase();
31
- return COMMANDS.filter((c) => c.command.toLowerCase().startsWith(lower));
32
- }
33
- //# sourceMappingURL=commands.js.map
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- export type TerminalLayoutMode = "wide" | "medium" | "narrow" | "very_narrow";
3
- export declare function getTerminalLayout(columns?: number): TerminalLayoutMode;
4
- export declare function truncateText(str: string, maxLength: number): string;
5
- export interface AppShellProps {
6
- header?: React.ReactNode;
7
- children?: React.ReactNode;
8
- sidebar?: React.ReactNode;
9
- modal?: React.ReactNode;
10
- footer?: React.ReactNode;
11
- columns?: number;
12
- }
13
- export declare const AppShell: React.FC<AppShellProps>;
14
- //# sourceMappingURL=AppShell.d.ts.map
@@ -1,25 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, useStdout } from "ink";
3
- export function getTerminalLayout(columns = 80) {
4
- if (columns >= 100)
5
- return "wide";
6
- if (columns >= 70)
7
- return "medium";
8
- if (columns >= 50)
9
- return "narrow";
10
- return "very_narrow";
11
- }
12
- export function truncateText(str, maxLength) {
13
- if (!str)
14
- return "";
15
- if (str.length <= maxLength)
16
- return str;
17
- return str.slice(0, Math.max(0, maxLength - 3)) + "...";
18
- }
19
- export const AppShell = ({ header, children, sidebar, modal, footer, columns: explicitColumns }) => {
20
- const { stdout } = useStdout();
21
- const columns = explicitColumns ?? stdout?.columns ?? 80;
22
- const layout = getTerminalLayout(columns);
23
- return (_jsxs(Box, { flexDirection: "column", padding: 0, width: "100%", children: [header, sidebar && layout === "wide" ? (_jsxs(Box, { flexDirection: "row", width: "100%", children: [_jsx(Box, { width: "65%", flexDirection: "column", paddingRight: 1, children: children }), _jsx(Box, { width: "35%", flexDirection: "column", paddingLeft: 1, children: sidebar })] })) : (_jsxs(Box, { flexDirection: "column", width: "100%", children: [children, sidebar && _jsx(Box, { flexDirection: "column", marginTop: 1, children: sidebar })] })), modal, footer] }));
24
- };
25
- //# sourceMappingURL=AppShell.js.map
@@ -1,31 +0,0 @@
1
- import React from "react";
2
- export interface ChangeReviewItem {
3
- path: string;
4
- operation?: string;
5
- additions?: number;
6
- deletions?: number;
7
- diff?: string;
8
- }
9
- export interface ApprovalPromptProps {
10
- approvalType?: "plan" | "step_checkpoint" | "tool_permission" | "recovery" | "continuation" | "replan" | string;
11
- title?: string;
12
- stepTitle?: string;
13
- stepOrder?: number;
14
- totalSteps?: number;
15
- toolName?: string;
16
- reason?: string;
17
- riskLevel?: string;
18
- affectedTargets?: string[];
19
- checkpointId?: string;
20
- diff?: string;
21
- changeReview?: {
22
- files?: ChangeReviewItem[];
23
- totalAddedLines?: number;
24
- totalRemovedLines?: number;
25
- };
26
- value: string;
27
- onChange: (val: string) => void;
28
- onSubmit: (val: string) => void;
29
- }
30
- export declare const ApprovalPrompt: React.FC<ApprovalPromptProps>;
31
- //# sourceMappingURL=ApprovalPrompt.d.ts.map
@@ -1,55 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import TextInput from "ink-text-input";
4
- export const ApprovalPrompt = ({ approvalType = "tool_permission", title, stepTitle, stepOrder, totalSteps, toolName, reason, riskLevel = "elevated", affectedTargets = [], checkpointId, diff, changeReview, value, onChange, onSubmit }) => {
5
- const isFileEdit = toolName === "edit_file" ||
6
- toolName === "write_file" ||
7
- (changeReview?.files && changeReview.files.length > 0);
8
- const getHeaderTitle = () => {
9
- if (title)
10
- return title;
11
- if (isFileEdit)
12
- return "⚠ FeCode wants to modify a file";
13
- switch (approvalType) {
14
- case "plan":
15
- return "⚠ PLAN APPROVAL REQUIRED";
16
- case "step_checkpoint":
17
- return "⚠ STEP CHECKPOINT APPROVAL REQUIRED";
18
- case "recovery":
19
- return "⚠ RECOVERY APPROVAL REQUIRED";
20
- case "continuation":
21
- return "⚠ CONTINUATION APPROVAL REQUIRED";
22
- case "replan":
23
- return "⚠ REPLAN APPROVAL REQUIRED";
24
- case "tool_permission":
25
- default:
26
- return "⚠ FeCode wants to use a tool";
27
- }
28
- };
29
- const getRiskColor = (risk) => {
30
- switch (risk.toLowerCase()) {
31
- case "critical":
32
- return "red";
33
- case "elevated":
34
- case "high":
35
- return "yellow";
36
- case "low":
37
- return "green";
38
- case "normal":
39
- default:
40
- return "cyan";
41
- }
42
- };
43
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "double", borderColor: "yellow", paddingX: 1, marginY: 1, children: [_jsx(Box, { marginBottom: 0, children: _jsx(Text, { bold: true, color: "yellow", children: getHeaderTitle() }) }), stepTitle && (_jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Step: " }), _jsx(Text, { bold: true, color: "white", children: stepOrder !== undefined && totalSteps !== undefined
44
- ? `[${stepOrder}/${totalSteps}] ${stepTitle}`
45
- : stepTitle })] })), _jsxs(Box, { marginTop: 0, justifyContent: "space-between", children: [_jsxs(Box, { children: [_jsx(Text, { color: "gray", children: "Risk: " }), _jsx(Text, { bold: true, color: getRiskColor(riskLevel), children: riskLevel.toUpperCase() })] }), _jsxs(Box, { children: [_jsx(Text, { color: "gray", children: "Checkpoint: " }), _jsx(Text, { color: checkpointId || riskLevel.toLowerCase() === "elevated" || riskLevel.toLowerCase() === "critical" ? "yellow" : "gray", children: checkpointId ? `REQUIRED (${checkpointId.slice(0, 18)})` : "REQUIRED" })] })] }), toolName && (_jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Tool: " }), _jsx(Text, { bold: true, color: "magenta", children: toolName })] })), reason && (_jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Reason: " }), _jsx(Text, { color: "white", children: reason })] })), affectedTargets.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Files / Resources:" }), affectedTargets.map((t, i) => (_jsxs(Text, { color: "cyan", children: [" ", "\u2022 ", t] }, `target-${i}`)))] })), changeReview && changeReview.files && changeReview.files.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { bold: true, color: "gray", children: "Change Review:" }), changeReview.files.map((cf, idx) => (_jsxs(Box, { flexDirection: "column", marginLeft: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: "white", children: cf.path }), cf.additions !== undefined && cf.deletions !== undefined && (_jsxs(Text, { color: "gray", children: [" ", "Change: +", cf.additions, " -", cf.deletions] }))] }), cf.diff && (_jsxs(Box, { borderStyle: "single", borderColor: "gray", paddingX: 1, marginY: 0, flexDirection: "column", children: [cf.diff.split("\n").slice(0, 15).map((line, lIdx) => {
46
- const isAdd = line.startsWith("+") && !line.startsWith("+++");
47
- const isDel = line.startsWith("-") && !line.startsWith("---");
48
- return (_jsx(Text, { color: isAdd ? "green" : isDel ? "red" : "gray", children: line }, `diff-${lIdx}`));
49
- }), cf.diff.split("\n").length > 15 && (_jsxs(Text, { color: "gray", children: ["... (", cf.diff.split("\n").length - 15, " lines omitted)"] }))] }))] }, `cf-${idx}`)))] })), diff && !changeReview && (_jsx(Box, { borderStyle: "single", borderColor: "gray", paddingX: 1, marginY: 1, flexDirection: "column", children: diff.split("\n").slice(0, 15).map((line, lIdx) => {
50
- const isAdd = line.startsWith("+") && !line.startsWith("+++");
51
- const isDel = line.startsWith("-") && !line.startsWith("---");
52
- return (_jsx(Text, { color: isAdd ? "green" : isDel ? "red" : "gray", children: line }, `diff-raw-${lIdx}`));
53
- }) })), _jsxs(Box, { marginTop: 1, children: [_jsxs(Text, { color: "yellow", bold: true, children: ["Allow? [y/N]:", " "] }), _jsx(TextInput, { value: value, onChange: onChange, onSubmit: onSubmit, placeholder: "n" })] })] }));
54
- };
55
- //# sourceMappingURL=ApprovalPrompt.js.map
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- export interface BlockedViewProps {
3
- planId?: string;
4
- stepInfo?: string;
5
- reason?: string;
6
- affectedSteps?: string[];
7
- isReconciliation?: boolean;
8
- value: string;
9
- onChange: (val: string) => void;
10
- onSubmit: (val: string) => void;
11
- }
12
- export declare const BlockedView: React.FC<BlockedViewProps>;
13
- //# sourceMappingURL=BlockedView.d.ts.map
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import TextInput from "ink-text-input";
4
- export const BlockedView = ({ planId, stepInfo, reason = "Workspace changed since approval.", affectedSteps = [], isReconciliation = false, value, onChange, onSubmit }) => {
5
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "double", borderColor: "red", paddingX: 1, marginY: 1, children: [_jsx(Box, { marginBottom: 0, children: _jsx(Text, { bold: true, color: "red", children: "\u26A0 PLAN EXECUTION BLOCKED" }) }), planId && (_jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Plan: " }), _jsx(Text, { color: "white", bold: true, children: planId })] })), stepInfo && (_jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Step: " }), _jsx(Text, { color: "white", children: stepInfo })] })), _jsxs(Box, { marginTop: 0, flexDirection: "column", children: [_jsx(Text, { color: "gray", children: "Reason:" }), _jsx(Text, { color: "red", children: reason })] }), affectedSteps.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Affected steps:" }), affectedSteps.map((s, i) => (_jsxs(Text, { color: "white", children: [" ", "\u2022 ", s] }, `aff-${i}`)))] })), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "gray", children: "What action would you like to take?" }), isReconciliation ? (_jsxs(Box, { flexDirection: "row", marginY: 0, children: [_jsx(Text, { bold: true, color: "yellow", children: "[r]" }), _jsx(Text, { color: "white", children: " Recover from checkpoint " }), _jsx(Text, { bold: true, color: "cyan", children: "[p]" }), _jsx(Text, { color: "white", children: " Replan " }), _jsx(Text, { bold: true, color: "gray", children: "[x]" }), _jsx(Text, { color: "white", children: " Cancel (Default)" })] })) : (_jsxs(Box, { flexDirection: "row", marginY: 0, children: [_jsx(Text, { bold: true, color: "green", children: "[c]" }), _jsx(Text, { color: "white", children: " Continue " }), _jsx(Text, { bold: true, color: "cyan", children: "[r]" }), _jsx(Text, { color: "white", children: " Replan " }), _jsx(Text, { bold: true, color: "gray", children: "[x]" }), _jsx(Text, { color: "white", children: " Cancel (Default)" })] }))] }), _jsxs(Box, { marginTop: 0, children: [_jsxs(Text, { color: "yellow", bold: true, children: ["Choice [x]:", " "] }), _jsx(TextInput, { value: value, onChange: onChange, onSubmit: onSubmit, placeholder: "x" })] })] }));
6
- };
7
- //# sourceMappingURL=BlockedView.js.map
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import type { CommandDef } from "../commands.js";
3
- export interface CommandPaletteProps {
4
- suggestions: CommandDef[];
5
- selectedIndex: number;
6
- }
7
- export declare const CommandPalette: React.FC<CommandPaletteProps>;
8
- //# sourceMappingURL=CommandPalette.d.ts.map
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- const MAX_VISIBLE = 8;
4
- export const CommandPalette = ({ suggestions, selectedIndex }) => {
5
- if (suggestions.length === 0)
6
- return null;
7
- const clampedIndex = Math.max(0, Math.min(selectedIndex, suggestions.length - 1));
8
- const startIndex = clampedIndex >= MAX_VISIBLE
9
- ? Math.min(clampedIndex - MAX_VISIBLE + 1, Math.max(0, suggestions.length - MAX_VISIBLE))
10
- : 0;
11
- const visible = suggestions.slice(startIndex, startIndex + MAX_VISIBLE);
12
- const remaining = suggestions.length - (startIndex + visible.length);
13
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, marginBottom: 0, children: [visible.map((cmd, idx) => {
14
- const isSelected = startIndex + idx === clampedIndex;
15
- return (_jsxs(Box, { children: [_jsx(Text, { color: "cyan", bold: true, children: isSelected ? "› " : " " }), _jsx(Box, { width: 16, children: _jsx(Text, { color: isSelected ? "whiteBright" : "white", bold: isSelected, children: cmd.command }) }), _jsx(Text, { color: "gray", children: cmd.description })] }, cmd.command));
16
- }), remaining > 0 && (_jsx(Box, { children: _jsxs(Text, { color: "gray", dimColor: true, children: [" \u2026", remaining, " more"] }) }))] }));
17
- };
18
- //# sourceMappingURL=CommandPalette.js.map
@@ -1,16 +0,0 @@
1
- import React from "react";
2
- export interface CurrentStepViewProps {
3
- stepOrder?: number;
4
- totalSteps?: number;
5
- title?: string;
6
- objective?: string;
7
- riskLevel?: string;
8
- checkpointRequired?: boolean;
9
- verificationRequired?: boolean;
10
- toolName?: string;
11
- target?: string;
12
- command?: string;
13
- durationMs?: number;
14
- }
15
- export declare const CurrentStepView: React.FC<CurrentStepViewProps>;
16
- //# sourceMappingURL=CurrentStepView.d.ts.map
@@ -1,28 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- export const CurrentStepView = ({ stepOrder, totalSteps, title, objective, riskLevel = "normal", checkpointRequired = false, verificationRequired = false, toolName, target, command, durationMs }) => {
4
- if (!title && !toolName && !command) {
5
- return null;
6
- }
7
- const getRiskColor = (risk) => {
8
- switch (risk.toLowerCase()) {
9
- case "critical":
10
- return "red";
11
- case "elevated":
12
- case "high":
13
- return "yellow";
14
- case "low":
15
- return "green";
16
- case "normal":
17
- default:
18
- return "cyan";
19
- }
20
- };
21
- const stepPrefix = stepOrder !== undefined && totalSteps !== undefined
22
- ? `Step ${stepOrder}/${totalSteps}:`
23
- : "Current Operation:";
24
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", paddingX: 1, marginY: 0, children: [_jsxs(Box, { justifyContent: "space-between", children: [_jsx(Box, { children: _jsxs(Text, { children: [_jsxs(Text, { bold: true, color: "cyan", children: ["\u25B6 ", stepPrefix, " "] }), _jsx(Text, { bold: true, color: "white", children: title || toolName || command })] }) }), _jsxs(Box, { children: [_jsx(Text, { color: "gray", children: "Risk: " }), _jsx(Text, { bold: true, color: getRiskColor(riskLevel), children: riskLevel.toUpperCase() })] })] }), objective && (_jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Goal: " }), _jsx(Text, { color: "white", children: objective })] })), _jsxs(Box, { marginTop: 0, flexWrap: "wrap", children: [toolName && (_jsxs(Box, { marginRight: 2, children: [_jsx(Text, { color: "gray", children: "Tool: " }), _jsx(Text, { bold: true, color: "magenta", children: toolName })] })), target && (_jsxs(Box, { marginRight: 2, children: [_jsx(Text, { color: "gray", children: "Target: " }), _jsx(Text, { color: "cyan", children: target })] })), command && (_jsxs(Box, { marginRight: 2, children: [_jsx(Text, { color: "gray", children: "Command: " }), _jsx(Text, { color: "yellow", children: command })] })), checkpointRequired && (_jsx(Box, { marginRight: 2, children: _jsx(Text, { color: "yellow", children: "[Checkpoint Required]" }) })), verificationRequired && (_jsx(Box, { marginRight: 2, children: _jsx(Text, { color: "cyan", children: "[Verification Required]" }) })), durationMs !== undefined && durationMs > 0 && (_jsx(Box, { children: _jsxs(Text, { color: "gray", children: ["Elapsed:", " ", durationMs >= 1000
25
- ? `${(durationMs / 1000).toFixed(1)}s`
26
- : `${durationMs}ms`] }) }))] })] }));
27
- };
28
- //# sourceMappingURL=CurrentStepView.js.map
@@ -1,45 +0,0 @@
1
- import React from "react";
2
- export interface DiagnosticsViewProps {
3
- summary?: {
4
- runId: string;
5
- startedAt: number;
6
- completedAt?: number;
7
- durationMs?: number;
8
- finalStatus?: string;
9
- cwd?: string;
10
- userRequestSummary?: string;
11
- activeSkills?: string[];
12
- initialRiskLevel?: string;
13
- riskReasons?: string[];
14
- requiresCheckpoint?: boolean;
15
- requiresExplicitApproval?: boolean;
16
- verificationAttempts?: number;
17
- maxVerificationAttempts?: number;
18
- recoveryAttempts?: number;
19
- maxRecoveryAttempts?: number;
20
- totalPlanSteps?: number;
21
- completedPlanSteps?: number;
22
- tools?: Array<{
23
- toolName: string;
24
- count?: number;
25
- calls?: number;
26
- }>;
27
- commands?: Array<{
28
- command: string;
29
- exitCode?: number | null;
30
- }>;
31
- files?: {
32
- modified?: string[];
33
- created?: string[];
34
- deleted?: string[];
35
- };
36
- lifecycleTransitions?: Array<{
37
- from: string;
38
- to: string;
39
- reason: string;
40
- }>;
41
- };
42
- formattedOutput?: string;
43
- }
44
- export declare const DiagnosticsView: React.FC<DiagnosticsViewProps>;
45
- //# sourceMappingURL=DiagnosticsView.d.ts.map
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- export const DiagnosticsView = ({ summary, formattedOutput }) => {
4
- if (formattedOutput) {
5
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "magenta", paddingX: 1, marginY: 1, children: [_jsx(Box, { marginBottom: 0, children: _jsx(Text, { bold: true, color: "magenta", children: "Diagnostics & Debug Info" }) }), _jsx(Text, { color: "white", children: formattedOutput })] }));
6
- }
7
- if (!summary) {
8
- return (_jsx(Box, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, marginY: 1, children: _jsx(Text, { color: "gray", children: "No diagnostic information available for current run." }) }));
9
- }
10
- const duration = summary.durationMs !== undefined
11
- ? summary.durationMs
12
- : summary.completedAt && summary.startedAt
13
- ? summary.completedAt - summary.startedAt
14
- : undefined;
15
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "magenta", paddingX: 1, marginY: 1, children: [_jsxs(Box, { marginBottom: 0, children: [_jsx(Text, { bold: true, color: "magenta", children: "Diagnostics: " }), _jsxs(Text, { bold: true, color: "white", children: ["Run: ", summary.runId] })] }), _jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Status: " }), _jsx(Text, { bold: true, color: summary.finalStatus === "completed"
16
- ? "green"
17
- : summary.finalStatus === "failed"
18
- ? "red"
19
- : "yellow", children: summary.finalStatus || "running" }), duration !== undefined && (_jsxs(Text, { color: "gray", children: [" | Duration: ", Math.max(0, Math.round(duration / 1000)), "s"] }))] }), summary.totalPlanSteps !== undefined && (_jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Plan Steps: " }), _jsxs(Text, { color: "white", children: [summary.completedPlanSteps ?? 0, "/", summary.totalPlanSteps, " completed"] })] })), summary.userRequestSummary && (_jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Request: " }), _jsx(Text, { color: "white", children: summary.userRequestSummary
20
- .replace(/(?:sk-|key-|AIza)[a-zA-Z0-9_-]{8,}/g, "[REDACTED]")
21
- .replace(/(?:api[_-]?key|secret|token)[\s:=]+([a-zA-Z0-9_.-]+)/gi, "[REDACTED]") })] })), summary.initialRiskLevel && (_jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Initial Risk: " }), _jsx(Text, { color: "yellow", children: summary.initialRiskLevel.toUpperCase() })] })), summary.activeSkills && summary.activeSkills.length > 0 && (_jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Active Skills: " }), _jsx(Text, { color: "cyan", children: summary.activeSkills.join(", ") })] })), summary.verificationAttempts !== undefined && (_jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Verification Attempts: " }), _jsxs(Text, { color: "white", children: [summary.verificationAttempts, "/", summary.maxVerificationAttempts || 3] })] })), summary.recoveryAttempts !== undefined && (_jsxs(Box, { marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Recovery Attempts: " }), _jsxs(Text, { color: "white", children: [summary.recoveryAttempts, "/", summary.maxRecoveryAttempts || 1] })] })), summary.tools && summary.tools.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Tool Invocations:" }), summary.tools.map((t, idx) => (_jsxs(Text, { color: "white", children: [" ", "\u2022 ", t.toolName, " (", t.count || t.calls || 1, ")"] }, `diag-tool-${idx}`)))] })), summary.files && (_jsxs(Box, { flexDirection: "column", marginTop: 0, children: [_jsx(Text, { color: "gray", children: "File Operations:" }), summary.files.modified && summary.files.modified.length > 0 && (_jsxs(Text, { color: "white", children: [" ", "\u2022 Modified: ", summary.files.modified.join(", ")] })), summary.files.created && summary.files.created.length > 0 && (_jsxs(Text, { color: "white", children: [" ", "\u2022 Created: ", summary.files.created.join(", ")] })), summary.files.deleted && summary.files.deleted.length > 0 && (_jsxs(Text, { color: "white", children: [" ", "\u2022 Deleted: ", summary.files.deleted.join(", ")] }))] }))] }));
22
- };
23
- //# sourceMappingURL=DiagnosticsView.js.map
@@ -1,15 +0,0 @@
1
- import React from "react";
2
- export interface TimelineItemData {
3
- id: string;
4
- type: string;
5
- timestamp: number;
6
- title: string;
7
- description?: string;
8
- status?: string;
9
- }
10
- export interface ExecutionTimelineProps {
11
- items?: TimelineItemData[];
12
- maxItems?: number;
13
- }
14
- export declare const ExecutionTimeline: React.FC<ExecutionTimelineProps>;
15
- //# sourceMappingURL=ExecutionTimeline.d.ts.map
@@ -1,51 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- export const ExecutionTimeline = ({ items = [], maxItems = 8 }) => {
4
- if (items.length === 0) {
5
- return null;
6
- }
7
- // Keep history bounded to avoid terminal buffer overflow
8
- const recentItems = items.slice(-maxItems);
9
- const formatTimestamp = (ts) => {
10
- const d = new Date(ts);
11
- const h = String(d.getHours()).padStart(2, "0");
12
- const m = String(d.getMinutes()).padStart(2, "0");
13
- const s = String(d.getSeconds()).padStart(2, "0");
14
- return `${h}:${m}:${s}`;
15
- };
16
- const getStatusIcon = (type, status) => {
17
- if (type === "tool_call" || type === "tool") {
18
- return _jsx(Text, { color: "magenta", children: "\u2699" });
19
- }
20
- if (type === "verification") {
21
- return _jsx(Text, { color: "cyan", children: "\u25CC" });
22
- }
23
- if (type === "approval") {
24
- return _jsx(Text, { color: "yellow", children: "\u26A0" });
25
- }
26
- if (type === "run_event") {
27
- return _jsx(Text, { color: "blue", children: "\u25C9" });
28
- }
29
- switch (status?.toLowerCase()) {
30
- case "completed":
31
- case "approved":
32
- return _jsx(Text, { color: "green", children: "\u2713" });
33
- case "running":
34
- case "in_progress":
35
- case "pending":
36
- return _jsx(Text, { color: "yellow", children: "\u25B8" });
37
- case "failed":
38
- case "rejected":
39
- return _jsx(Text, { color: "red", children: "\u2717" });
40
- case "skipped":
41
- case "cancelled":
42
- return _jsx(Text, { color: "gray", children: "\u2298" });
43
- case "blocked":
44
- return _jsx(Text, { color: "red", children: "\u26A0" });
45
- default:
46
- return _jsx(Text, { color: "gray", children: "\u2022" });
47
- }
48
- };
49
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, marginY: 1, children: [_jsx(Box, { marginBottom: 0, children: _jsxs(Text, { bold: true, color: "gray", children: ["Timeline (last ", recentItems.length, " events)"] }) }), recentItems.map((item) => (_jsxs(Box, { children: [_jsxs(Text, { color: "gray", children: [formatTimestamp(item.timestamp), " "] }), getStatusIcon(item.type, item.status), _jsx(Text, { color: "gray", children: " " }), _jsx(Text, { color: "white", children: item.title }), item.description && (_jsxs(Text, { color: "gray", children: [" \u2014 ", item.description] }))] }, item.id || `tl-${item.timestamp}`)))] }));
50
- };
51
- //# sourceMappingURL=ExecutionTimeline.js.map
@@ -1,42 +0,0 @@
1
- import React from "react";
2
- import { type PlanStepItem } from "./PlanView.js";
3
- export interface ExecutionViewProps {
4
- runId?: string;
5
- status?: string;
6
- userRequest?: string;
7
- activePlan?: {
8
- planId?: string;
9
- objective?: string;
10
- summary?: string;
11
- status?: string;
12
- riskLevel?: string;
13
- steps?: PlanStepItem[];
14
- completedStepsCount?: number;
15
- totalStepsCount?: number;
16
- };
17
- activeTool?: {
18
- toolName: string;
19
- target?: string;
20
- callId?: string;
21
- };
22
- activeVerification?: {
23
- command: string;
24
- attempt?: number;
25
- };
26
- activeRecovery?: {
27
- strategy: string;
28
- recoveryId?: string;
29
- };
30
- streamedOutput?: string;
31
- completionSummary?: {
32
- status?: string;
33
- completedFiles?: string[];
34
- verifiedCommands?: string[];
35
- completedRequirements?: string[];
36
- remainingRequirements?: string[];
37
- blockedReason?: string;
38
- };
39
- error?: string;
40
- }
41
- export declare const ExecutionView: React.FC<ExecutionViewProps>;
42
- //# sourceMappingURL=ExecutionView.d.ts.map
@@ -1,20 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import { PlanView } from "./PlanView.js";
4
- export const ExecutionView = ({ runId, status = "idle", userRequest, activePlan, activeTool, activeVerification, activeRecovery, streamedOutput, completionSummary, error }) => {
5
- return (_jsxs(Box, { flexDirection: "column", marginY: 0, children: [runId && (_jsxs(Box, { marginBottom: 0, children: [_jsx(Text, { color: "gray", children: "Run: " }), _jsx(Text, { color: "white", bold: true, children: runId }), _jsx(Text, { color: "gray", children: " | Status: " }), _jsx(Text, { bold: true, color: status === "executing"
6
- ? "green"
7
- : status === "completed"
8
- ? "green"
9
- : status === "failed"
10
- ? "red"
11
- : status === "blocked"
12
- ? "red"
13
- : "cyan", children: status.toUpperCase() })] })), userRequest && (_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: "gray", children: "Task: " }), _jsx(Text, { color: "white", children: userRequest })] })), activePlan && activePlan.steps && activePlan.steps.length > 0 && (_jsx(PlanView, { planId: activePlan.planId, objective: activePlan.objective, summary: activePlan.summary, status: activePlan.status, riskLevel: activePlan.riskLevel, steps: activePlan.steps, completedCount: activePlan.completedStepsCount, totalCount: activePlan.totalStepsCount })), activeTool && (_jsxs(Box, { borderStyle: "single", borderColor: "magenta", paddingX: 1, marginY: 0, flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, color: "magenta", children: "Tool: " }), _jsx(Text, { bold: true, color: "white", children: activeTool.toolName })] }), activeTool.target && (_jsxs(Box, { children: [_jsx(Text, { color: "gray", children: "Target: " }), _jsx(Text, { color: "cyan", children: activeTool.target })] }))] })), activeVerification && (_jsx(Box, { borderStyle: "single", borderColor: "cyan", paddingX: 1, marginY: 0, flexDirection: "column", children: _jsxs(Box, { children: [_jsx(Text, { bold: true, color: "cyan", children: "Verification: " }), _jsx(Text, { bold: true, color: "white", children: activeVerification.command }), activeVerification.attempt !== undefined && (_jsxs(Text, { color: "gray", children: [" (Attempt ", activeVerification.attempt, ")"] }))] }) })), activeRecovery && (_jsx(Box, { borderStyle: "single", borderColor: "yellow", paddingX: 1, marginY: 0, flexDirection: "column", children: _jsxs(Box, { children: [_jsx(Text, { bold: true, color: "yellow", children: "Recovery: " }), _jsx(Text, { bold: true, color: "white", children: activeRecovery.strategy }), activeRecovery.recoveryId && (_jsxs(Text, { color: "gray", children: [" (", activeRecovery.recoveryId, ")"] }))] }) })), streamedOutput && (_jsx(Box, { borderStyle: "single", borderColor: "gray", paddingX: 1, marginY: 1, flexDirection: "column", children: _jsx(Text, { color: "white", children: streamedOutput }) })), completionSummary && (_jsxs(Box, { borderStyle: "single", borderColor: completionSummary.status === "completed" ? "green" : "red", paddingX: 1, marginY: 1, flexDirection: "column", children: [_jsx(Box, { children: _jsx(Text, { bold: true, color: completionSummary.status === "completed" ? "green" : "red", children: completionSummary.status === "completed"
14
- ? "✓ Task completed"
15
- : "⚠ Task blocked" }) }), completionSummary.completedFiles &&
16
- completionSummary.completedFiles.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Changed:" }), completionSummary.completedFiles.map((f, i) => (_jsxs(Text, { color: "white", children: [" ", "\u2022 ", f] }, `cf-${i}`)))] })), completionSummary.verifiedCommands &&
17
- completionSummary.verifiedCommands.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 0, children: [_jsx(Text, { color: "gray", children: "Verified:" }), completionSummary.verifiedCommands.map((c, i) => (_jsxs(Text, { color: "white", children: [" ", "\u2022 ", c] }, `vc-${i}`)))] })), completionSummary.blockedReason && (_jsx(Box, { marginTop: 0, children: _jsxs(Text, { color: "red", children: ["Reason: ", completionSummary.blockedReason] }) })), completionSummary.remainingRequirements &&
18
- completionSummary.remainingRequirements.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 0, children: [_jsx(Text, { color: "yellow", children: "Remaining:" }), completionSummary.remainingRequirements.map((r, i) => (_jsxs(Text, { color: "white", children: [" ", "\u2022 ", r] }, `rr-${i}`)))] }))] })), error && (_jsx(Box, { borderStyle: "single", borderColor: "red", paddingX: 1, marginY: 1, flexDirection: "column", children: _jsxs(Text, { bold: true, color: "red", children: ["\u2717 Error: ", error] }) }))] }));
19
- };
20
- //# sourceMappingURL=ExecutionView.js.map