fecode-cli 1.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.
Files changed (74) hide show
  1. package/dist/App.d.ts +33 -0
  2. package/dist/App.js +2224 -0
  3. package/dist/approvalResolver.d.ts +12 -0
  4. package/dist/approvalResolver.js +112 -0
  5. package/dist/commands.d.ts +11 -0
  6. package/dist/commands.js +33 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.js +15175 -0
  9. package/dist/ui/AppShell.d.ts +14 -0
  10. package/dist/ui/AppShell.js +25 -0
  11. package/dist/ui/ApprovalPrompt.d.ts +31 -0
  12. package/dist/ui/ApprovalPrompt.js +55 -0
  13. package/dist/ui/BlockedView.d.ts +13 -0
  14. package/dist/ui/BlockedView.js +7 -0
  15. package/dist/ui/CommandPalette.d.ts +8 -0
  16. package/dist/ui/CommandPalette.js +18 -0
  17. package/dist/ui/CurrentStepView.d.ts +16 -0
  18. package/dist/ui/CurrentStepView.js +28 -0
  19. package/dist/ui/DiagnosticsView.d.ts +45 -0
  20. package/dist/ui/DiagnosticsView.js +23 -0
  21. package/dist/ui/ExecutionTimeline.d.ts +15 -0
  22. package/dist/ui/ExecutionTimeline.js +51 -0
  23. package/dist/ui/ExecutionView.d.ts +42 -0
  24. package/dist/ui/ExecutionView.js +20 -0
  25. package/dist/ui/Header.d.ts +15 -0
  26. package/dist/ui/Header.js +47 -0
  27. package/dist/ui/HelpView.d.ts +3 -0
  28. package/dist/ui/HelpView.js +35 -0
  29. package/dist/ui/MessageBubble.d.ts +9 -0
  30. package/dist/ui/MessageBubble.js +58 -0
  31. package/dist/ui/PlanStep.d.ts +16 -0
  32. package/dist/ui/PlanStep.js +71 -0
  33. package/dist/ui/PlanView.d.ts +26 -0
  34. package/dist/ui/PlanView.js +24 -0
  35. package/dist/ui/ProgressBar.d.ts +10 -0
  36. package/dist/ui/ProgressBar.js +14 -0
  37. package/dist/ui/RecoveryView.d.ts +20 -0
  38. package/dist/ui/RecoveryView.js +19 -0
  39. package/dist/ui/ReplanView.d.ts +16 -0
  40. package/dist/ui/ReplanView.js +21 -0
  41. package/dist/ui/ResumeView.d.ts +15 -0
  42. package/dist/ui/ResumeView.js +25 -0
  43. package/dist/ui/RiskNotice.d.ts +10 -0
  44. package/dist/ui/RiskNotice.js +21 -0
  45. package/dist/ui/RunHistoryView.d.ts +15 -0
  46. package/dist/ui/RunHistoryView.js +39 -0
  47. package/dist/ui/StatusBar.d.ts +16 -0
  48. package/dist/ui/StatusBar.js +104 -0
  49. package/dist/ui/TaskInput.d.ts +15 -0
  50. package/dist/ui/TaskInput.js +8 -0
  51. package/dist/ui/ThinkingBlock.d.ts +8 -0
  52. package/dist/ui/ThinkingBlock.js +13 -0
  53. package/dist/ui/ThinkingIndicator.d.ts +7 -0
  54. package/dist/ui/ThinkingIndicator.js +20 -0
  55. package/dist/ui/TurnView.d.ts +13 -0
  56. package/dist/ui/TurnView.js +11 -0
  57. package/dist/ui/WorkspaceStatus.d.ts +20 -0
  58. package/dist/ui/WorkspaceStatus.js +23 -0
  59. package/dist/ui/index.d.ts +26 -0
  60. package/dist/ui/index.js +26 -0
  61. package/package.json +42 -0
  62. package/skills/accessibility/SKILL.md +98 -0
  63. package/skills/css/SKILL.md +90 -0
  64. package/skills/frontend-debugging/SKILL.md +201 -0
  65. package/skills/frontend-design/SKILL.md +358 -0
  66. package/skills/frontend-performance/SKILL.md +89 -0
  67. package/skills/frontend-testing/SKILL.md +87 -0
  68. package/skills/nextjs/SKILL.md +75 -0
  69. package/skills/react/SKILL.md +213 -0
  70. package/skills/responsive-design/SKILL.md +190 -0
  71. package/skills/svelte/SKILL.md +86 -0
  72. package/skills/tailwind/SKILL.md +74 -0
  73. package/skills/ui-review/SKILL.md +245 -0
  74. package/skills/vue/SKILL.md +72 -0
@@ -0,0 +1,12 @@
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
@@ -0,0 +1,112 @@
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
@@ -0,0 +1,11 @@
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
@@ -0,0 +1,33 @@
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
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map