@compilr-dev/cli 0.4.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/README.md +110 -0
- package/dist/agent.d.ts +62 -0
- package/dist/agent.js +317 -0
- package/dist/agents/registry.d.ts +66 -0
- package/dist/agents/registry.js +238 -0
- package/dist/agents/types.d.ts +40 -0
- package/dist/agents/types.js +94 -0
- package/dist/commands/custom-registry.d.ts +69 -0
- package/dist/commands/custom-registry.js +246 -0
- package/dist/commands/index.d.ts +7 -0
- package/dist/commands/index.js +7 -0
- package/dist/commands/types.d.ts +31 -0
- package/dist/commands/types.js +26 -0
- package/dist/commands.d.ts +63 -0
- package/dist/commands.js +324 -0
- package/dist/db/index.d.ts +42 -0
- package/dist/db/index.js +146 -0
- package/dist/db/repositories/document-repository.d.ts +63 -0
- package/dist/db/repositories/document-repository.js +184 -0
- package/dist/db/repositories/index.d.ts +9 -0
- package/dist/db/repositories/index.js +6 -0
- package/dist/db/repositories/project-repository.d.ts +132 -0
- package/dist/db/repositories/project-repository.js +337 -0
- package/dist/db/repositories/work-item-repository.d.ts +115 -0
- package/dist/db/repositories/work-item-repository.js +389 -0
- package/dist/db/schema.d.ts +83 -0
- package/dist/db/schema.js +143 -0
- package/dist/debug.d.ts +8 -0
- package/dist/debug.js +48 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +348 -0
- package/dist/index.old.d.ts +7 -0
- package/dist/index.old.js +1014 -0
- package/dist/repl.d.ts +121 -0
- package/dist/repl.js +1878 -0
- package/dist/settings/index.d.ts +80 -0
- package/dist/settings/index.js +195 -0
- package/dist/shared-handlers.d.ts +63 -0
- package/dist/shared-handlers.js +57 -0
- package/dist/slash-autocomplete.d.ts +41 -0
- package/dist/slash-autocomplete.js +638 -0
- package/dist/state.d.ts +75 -0
- package/dist/state.js +130 -0
- package/dist/tabbed-menu.d.ts +11 -0
- package/dist/tabbed-menu.js +328 -0
- package/dist/templates/backlog-md.d.ts +7 -0
- package/dist/templates/backlog-md.js +94 -0
- package/dist/templates/claude-md.d.ts +7 -0
- package/dist/templates/claude-md.js +189 -0
- package/dist/templates/coding-standards.d.ts +7 -0
- package/dist/templates/coding-standards.js +299 -0
- package/dist/templates/compilr-md.d.ts +7 -0
- package/dist/templates/compilr-md.js +189 -0
- package/dist/templates/config-json.d.ts +38 -0
- package/dist/templates/config-json.js +39 -0
- package/dist/templates/gitignore.d.ts +7 -0
- package/dist/templates/gitignore.js +85 -0
- package/dist/templates/index.d.ts +19 -0
- package/dist/templates/index.js +302 -0
- package/dist/templates/package-json.d.ts +7 -0
- package/dist/templates/package-json.js +111 -0
- package/dist/templates/readme-md.d.ts +7 -0
- package/dist/templates/readme-md.js +161 -0
- package/dist/templates/tsconfig.d.ts +7 -0
- package/dist/templates/tsconfig.js +61 -0
- package/dist/templates/types.d.ts +33 -0
- package/dist/templates/types.js +24 -0
- package/dist/test-autocomplete.d.ts +7 -0
- package/dist/test-autocomplete.js +85 -0
- package/dist/test-tabbed-menu.d.ts +7 -0
- package/dist/test-tabbed-menu.js +25 -0
- package/dist/themes/colors.d.ts +49 -0
- package/dist/themes/colors.js +135 -0
- package/dist/themes/index.d.ts +23 -0
- package/dist/themes/index.js +24 -0
- package/dist/themes/registry.d.ts +60 -0
- package/dist/themes/registry.js +195 -0
- package/dist/themes/types.d.ts +82 -0
- package/dist/themes/types.js +7 -0
- package/dist/tool-selector.d.ts +71 -0
- package/dist/tool-selector.js +184 -0
- package/dist/tools/ask-user-simple.d.ts +19 -0
- package/dist/tools/ask-user-simple.js +86 -0
- package/dist/tools/ask-user.d.ts +32 -0
- package/dist/tools/ask-user.js +113 -0
- package/dist/tools/backlog.d.ts +53 -0
- package/dist/tools/backlog.js +709 -0
- package/dist/tools.d.ts +15 -0
- package/dist/tools.js +121 -0
- package/dist/ui/agents-overlay.d.ts +12 -0
- package/dist/ui/agents-overlay.js +501 -0
- package/dist/ui/arch-type-overlay.d.ts +20 -0
- package/dist/ui/arch-type-overlay.js +229 -0
- package/dist/ui/ask-user-overlay.d.ts +26 -0
- package/dist/ui/ask-user-overlay.js +647 -0
- package/dist/ui/ask-user-simple-overlay.d.ts +25 -0
- package/dist/ui/ask-user-simple-overlay.js +242 -0
- package/dist/ui/backlog-overlay.d.ts +17 -0
- package/dist/ui/backlog-overlay.js +786 -0
- package/dist/ui/commands-overlay.d.ts +11 -0
- package/dist/ui/commands-overlay.js +410 -0
- package/dist/ui/config-overlay.d.ts +34 -0
- package/dist/ui/config-overlay.js +977 -0
- package/dist/ui/conversation.d.ts +82 -0
- package/dist/ui/conversation.js +508 -0
- package/dist/ui/diff.d.ts +38 -0
- package/dist/ui/diff.js +182 -0
- package/dist/ui/ephemeral.d.ts +111 -0
- package/dist/ui/ephemeral.js +413 -0
- package/dist/ui/file-autocomplete.d.ts +45 -0
- package/dist/ui/file-autocomplete.js +237 -0
- package/dist/ui/footer.d.ts +153 -0
- package/dist/ui/footer.js +422 -0
- package/dist/ui/index.d.ts +12 -0
- package/dist/ui/index.js +15 -0
- package/dist/ui/init-overlay.d.ts +24 -0
- package/dist/ui/init-overlay.js +525 -0
- package/dist/ui/input-prompt-v2.d.ts +179 -0
- package/dist/ui/input-prompt-v2.js +991 -0
- package/dist/ui/input-prompt.d.ts +97 -0
- package/dist/ui/input-prompt.js +800 -0
- package/dist/ui/iteration-limit-overlay.d.ts +21 -0
- package/dist/ui/iteration-limit-overlay.js +150 -0
- package/dist/ui/keys-overlay.d.ts +14 -0
- package/dist/ui/keys-overlay.js +181 -0
- package/dist/ui/model-warning-overlay.d.ts +30 -0
- package/dist/ui/model-warning-overlay.js +171 -0
- package/dist/ui/overlay-controller.d.ts +25 -0
- package/dist/ui/overlay-controller.js +35 -0
- package/dist/ui/overlays.d.ts +47 -0
- package/dist/ui/overlays.js +627 -0
- package/dist/ui/permission-overlay.d.ts +16 -0
- package/dist/ui/permission-overlay.js +494 -0
- package/dist/ui/terminal.d.ts +117 -0
- package/dist/ui/terminal.js +237 -0
- package/dist/ui/todo-zone.d.ts +112 -0
- package/dist/ui/todo-zone.js +353 -0
- package/dist/ui/tools-overlay.d.ts +26 -0
- package/dist/ui/tools-overlay.js +278 -0
- package/dist/ui/tutorial-overlay.d.ts +10 -0
- package/dist/ui/tutorial-overlay.js +936 -0
- package/dist/ui/types.d.ts +103 -0
- package/dist/ui/types.js +33 -0
- package/dist/utils/credentials.d.ts +55 -0
- package/dist/utils/credentials.js +268 -0
- package/dist/utils/model-tiers.d.ts +37 -0
- package/dist/utils/model-tiers.js +118 -0
- package/dist/utils/project-memory.d.ts +47 -0
- package/dist/utils/project-memory.js +117 -0
- package/dist/utils/project-status.d.ts +56 -0
- package/dist/utils/project-status.js +237 -0
- package/package.json +66 -0
package/dist/repl.d.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* REPL (Read-Eval-Print Loop)
|
|
3
|
+
*
|
|
4
|
+
* Main orchestration for the interactive agent session.
|
|
5
|
+
* Coordinates between input, agent execution, and output.
|
|
6
|
+
*
|
|
7
|
+
* Uses event-driven architecture with Footer component for:
|
|
8
|
+
* - Persistent todo list while agent runs
|
|
9
|
+
* - Persistent input prompt (always visible)
|
|
10
|
+
* - Input queueing during agent execution
|
|
11
|
+
* - Esc to cancel running agent
|
|
12
|
+
*/
|
|
13
|
+
import type { Agent } from '@compilr-dev/agents';
|
|
14
|
+
import type { AgentMode } from './ui/types.js';
|
|
15
|
+
export interface REPLOptions {
|
|
16
|
+
agent: Agent;
|
|
17
|
+
model: string;
|
|
18
|
+
provider?: string;
|
|
19
|
+
version?: string;
|
|
20
|
+
showFiltering?: boolean;
|
|
21
|
+
/** Callback when mode changes (to sync with external state) */
|
|
22
|
+
onModeChange?: (mode: AgentMode) => void;
|
|
23
|
+
/** Callback when footer is ready (provides pause/resume/setSuggestion functions) */
|
|
24
|
+
onFooterReady?: (pause: () => void, resume: () => void, setSuggestion: (action: string | null) => void) => void;
|
|
25
|
+
/** Callback when agent finishes (for applying deferred actions like suggestions) */
|
|
26
|
+
onAgentFinish?: () => void;
|
|
27
|
+
}
|
|
28
|
+
export declare class REPL {
|
|
29
|
+
private readonly agent;
|
|
30
|
+
private readonly model;
|
|
31
|
+
private currentModel;
|
|
32
|
+
private readonly provider;
|
|
33
|
+
private readonly version;
|
|
34
|
+
private readonly showFiltering;
|
|
35
|
+
private readonly onModeChange?;
|
|
36
|
+
private readonly onAgentFinish?;
|
|
37
|
+
private readonly startTime;
|
|
38
|
+
private readonly state;
|
|
39
|
+
private readonly footer;
|
|
40
|
+
private sessionInputTokens;
|
|
41
|
+
private sessionOutputTokens;
|
|
42
|
+
private sessionRequests;
|
|
43
|
+
private isRunning;
|
|
44
|
+
private agentRunning;
|
|
45
|
+
private abortController;
|
|
46
|
+
private exitResolve;
|
|
47
|
+
constructor(options: REPLOptions);
|
|
48
|
+
/**
|
|
49
|
+
* Set up Footer event handlers
|
|
50
|
+
*/
|
|
51
|
+
private setupEventHandlers;
|
|
52
|
+
/**
|
|
53
|
+
* Cycle through agent modes (normal -> auto-accept -> plan -> normal)
|
|
54
|
+
*/
|
|
55
|
+
private cycleMode;
|
|
56
|
+
/**
|
|
57
|
+
* Start the REPL (event-driven)
|
|
58
|
+
*/
|
|
59
|
+
run(): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Wait for REPL exit
|
|
62
|
+
*/
|
|
63
|
+
private waitForExit;
|
|
64
|
+
/**
|
|
65
|
+
* Get current model
|
|
66
|
+
*/
|
|
67
|
+
getCurrentModel(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Get current provider
|
|
70
|
+
*/
|
|
71
|
+
getProvider(): string;
|
|
72
|
+
/**
|
|
73
|
+
* Set model for hot-switching (within same provider)
|
|
74
|
+
*/
|
|
75
|
+
setModel(model: string): void;
|
|
76
|
+
/**
|
|
77
|
+
* Set the agent mode programmatically (e.g., from permission handler)
|
|
78
|
+
*/
|
|
79
|
+
setMode(mode: AgentMode): void;
|
|
80
|
+
/**
|
|
81
|
+
* Stop the REPL
|
|
82
|
+
*/
|
|
83
|
+
stop(): void;
|
|
84
|
+
/**
|
|
85
|
+
* Handle submitted input (processes message and queued inputs)
|
|
86
|
+
*/
|
|
87
|
+
private handleSubmit;
|
|
88
|
+
/**
|
|
89
|
+
* Handle slash command
|
|
90
|
+
* Returns false if REPL should exit
|
|
91
|
+
*/
|
|
92
|
+
private handleCommand;
|
|
93
|
+
/**
|
|
94
|
+
* Handle /scaffold command (shared between /scaffold and /build scaffold)
|
|
95
|
+
*/
|
|
96
|
+
private handleScaffoldCommand;
|
|
97
|
+
/**
|
|
98
|
+
* Strip '@' prefix from @path mentions before sending to agent
|
|
99
|
+
* The '@' is UI syntax for path autocomplete, not part of the actual path
|
|
100
|
+
* Only strips @ when it's at start of a word (not in middle like email@domain.com)
|
|
101
|
+
*/
|
|
102
|
+
private stripAtMentions;
|
|
103
|
+
/**
|
|
104
|
+
* Process a message to the agent
|
|
105
|
+
* @param input - The full message to send to the agent
|
|
106
|
+
* @param options - Optional settings
|
|
107
|
+
* @param options.displayMessage - What to show the user (defaults to input)
|
|
108
|
+
* @param options.skipPlanModeCheck - Skip plan mode handling (for /design, /refine)
|
|
109
|
+
*/
|
|
110
|
+
private processMessage;
|
|
111
|
+
private handleCompact;
|
|
112
|
+
private showTools;
|
|
113
|
+
private showTokens;
|
|
114
|
+
private showContext;
|
|
115
|
+
private showStatus;
|
|
116
|
+
private renderProgressBar;
|
|
117
|
+
private showTodos;
|
|
118
|
+
private handleExport;
|
|
119
|
+
private formatConversationAsMarkdown;
|
|
120
|
+
private copyToClipboard;
|
|
121
|
+
}
|