@spenceriam/impulse 0.15.0 → 0.15.3
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/bin/impulse +95 -0
- package/package.json +17 -51
- package/postinstall.mjs +115 -0
- package/README.md +0 -194
- package/dist/api/client.d.ts +0 -53
- package/dist/api/client.d.ts.map +0 -1
- package/dist/api/client.js +0 -271
- package/dist/api/client.js.map +0 -1
- package/dist/api/index.d.ts +0 -6
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js +0 -7
- package/dist/api/index.js.map +0 -1
- package/dist/api/stream.d.ts +0 -98
- package/dist/api/stream.d.ts.map +0 -1
- package/dist/api/stream.js +0 -202
- package/dist/api/stream.js.map +0 -1
- package/dist/api/types.d.ts +0 -1353
- package/dist/api/types.d.ts.map +0 -1
- package/dist/api/types.js +0 -143
- package/dist/api/types.js.map +0 -1
- package/dist/bash.txt +0 -28
- package/dist/bus/bus.d.ts +0 -21
- package/dist/bus/bus.d.ts.map +0 -1
- package/dist/bus/bus.js +0 -22
- package/dist/bus/bus.js.map +0 -1
- package/dist/bus/events.d.ts +0 -100
- package/dist/bus/events.d.ts.map +0 -1
- package/dist/bus/events.js +0 -45
- package/dist/bus/events.js.map +0 -1
- package/dist/bus/index.d.ts +0 -3
- package/dist/bus/index.d.ts.map +0 -1
- package/dist/bus/index.js +0 -3
- package/dist/bus/index.js.map +0 -1
- package/dist/file-edit.txt +0 -21
- package/dist/file-read.txt +0 -18
- package/dist/file-write.txt +0 -16
- package/dist/glob.txt +0 -19
- package/dist/global.d.ts +0 -8
- package/dist/global.d.ts.map +0 -1
- package/dist/global.js +0 -14
- package/dist/global.js.map +0 -1
- package/dist/grep.txt +0 -20
- package/dist/highlights-eq9cgrbb.scm +0 -604
- package/dist/highlights-ghv9g403.scm +0 -205
- package/dist/highlights-hk7bwhj4.scm +0 -284
- package/dist/highlights-r812a2qc.scm +0 -150
- package/dist/highlights-x6tmsnaa.scm +0 -115
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -62122
- package/dist/index.js.map +0 -1
- package/dist/index.jsx +0 -5
- package/dist/index.jsx.map +0 -1
- package/dist/injections-73j83es3.scm +0 -27
- package/dist/input/at-refs.d.ts +0 -42
- package/dist/input/at-refs.d.ts.map +0 -1
- package/dist/input/at-refs.js +0 -154
- package/dist/input/at-refs.js.map +0 -1
- package/dist/input/history.d.ts +0 -26
- package/dist/input/history.d.ts.map +0 -1
- package/dist/input/history.js +0 -109
- package/dist/input/history.js.map +0 -1
- package/dist/input/index.d.ts +0 -5
- package/dist/input/index.d.ts.map +0 -1
- package/dist/input/index.js +0 -5
- package/dist/input/index.js.map +0 -1
- package/dist/input/paste.d.ts +0 -19
- package/dist/input/paste.d.ts.map +0 -1
- package/dist/input/paste.js +0 -75
- package/dist/input/paste.js.map +0 -1
- package/dist/input/shortcuts.d.ts +0 -6
- package/dist/input/shortcuts.d.ts.map +0 -1
- package/dist/input/shortcuts.js +0 -84
- package/dist/input/shortcuts.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -3
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -3
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/manager.d.ts +0 -51
- package/dist/mcp/manager.d.ts.map +0 -1
- package/dist/mcp/manager.js +0 -158
- package/dist/mcp/manager.js.map +0 -1
- package/dist/mcp/types.d.ts +0 -18
- package/dist/mcp/types.d.ts.map +0 -1
- package/dist/mcp/types.js +0 -5
- package/dist/mcp/types.js.map +0 -1
- package/dist/session/todo.d.ts +0 -24
- package/dist/session/todo.d.ts.map +0 -1
- package/dist/session/todo.js +0 -39
- package/dist/session/todo.js.map +0 -1
- package/dist/storage/index.d.ts +0 -2
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js +0 -2
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/storage.d.ts +0 -13
- package/dist/storage/storage.d.ts.map +0 -1
- package/dist/storage/storage.js +0 -84
- package/dist/storage/storage.js.map +0 -1
- package/dist/task.txt +0 -26
- package/dist/todo-read.txt +0 -14
- package/dist/todo-write.txt +0 -166
- package/dist/tools/bash.d.ts +0 -22
- package/dist/tools/bash.d.ts.map +0 -1
- package/dist/tools/bash.js +0 -70
- package/dist/tools/bash.js.map +0 -1
- package/dist/tools/file-edit.d.ts +0 -22
- package/dist/tools/file-edit.d.ts.map +0 -1
- package/dist/tools/file-edit.js +0 -67
- package/dist/tools/file-edit.js.map +0 -1
- package/dist/tools/file-read.d.ts +0 -19
- package/dist/tools/file-read.d.ts.map +0 -1
- package/dist/tools/file-read.js +0 -70
- package/dist/tools/file-read.js.map +0 -1
- package/dist/tools/file-write.d.ts +0 -16
- package/dist/tools/file-write.d.ts.map +0 -1
- package/dist/tools/file-write.js +0 -45
- package/dist/tools/file-write.js.map +0 -1
- package/dist/tools/glob.d.ts +0 -16
- package/dist/tools/glob.d.ts.map +0 -1
- package/dist/tools/glob.js +0 -45
- package/dist/tools/glob.js.map +0 -1
- package/dist/tools/grep.d.ts +0 -19
- package/dist/tools/grep.d.ts.map +0 -1
- package/dist/tools/grep.js +0 -65
- package/dist/tools/grep.js.map +0 -1
- package/dist/tools/index.d.ts +0 -11
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -11
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/registry.d.ts +0 -22
- package/dist/tools/registry.d.ts.map +0 -1
- package/dist/tools/registry.js +0 -75
- package/dist/tools/registry.js.map +0 -1
- package/dist/tools/task.d.ts +0 -19
- package/dist/tools/task.d.ts.map +0 -1
- package/dist/tools/task.js +0 -51
- package/dist/tools/task.js.map +0 -1
- package/dist/tools/todo-read.d.ts +0 -7
- package/dist/tools/todo-read.d.ts.map +0 -1
- package/dist/tools/todo-read.js +0 -56
- package/dist/tools/todo-read.js.map +0 -1
- package/dist/tools/todo-write.d.ts +0 -38
- package/dist/tools/todo-write.d.ts.map +0 -1
- package/dist/tools/todo-write.js +0 -40
- package/dist/tools/todo-write.js.map +0 -1
- package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/dist/ui/App.d.ts +0 -6
- package/dist/ui/App.d.ts.map +0 -1
- package/dist/ui/App.jsx +0 -37
- package/dist/ui/App.jsx.map +0 -1
- package/dist/ui/components/Autocomplete.d.ts +0 -24
- package/dist/ui/components/Autocomplete.d.ts.map +0 -1
- package/dist/ui/components/Autocomplete.jsx +0 -67
- package/dist/ui/components/Autocomplete.jsx.map +0 -1
- package/dist/ui/components/ChatView.d.ts +0 -14
- package/dist/ui/components/ChatView.d.ts.map +0 -1
- package/dist/ui/components/ChatView.jsx +0 -11
- package/dist/ui/components/ChatView.jsx.map +0 -1
- package/dist/ui/components/InputArea.d.ts +0 -18
- package/dist/ui/components/InputArea.d.ts.map +0 -1
- package/dist/ui/components/InputArea.jsx +0 -35
- package/dist/ui/components/InputArea.jsx.map +0 -1
- package/dist/ui/components/MessageBlock.d.ts +0 -21
- package/dist/ui/components/MessageBlock.d.ts.map +0 -1
- package/dist/ui/components/MessageBlock.jsx +0 -94
- package/dist/ui/components/MessageBlock.jsx.map +0 -1
- package/dist/ui/components/Overlay.d.ts +0 -28
- package/dist/ui/components/Overlay.d.ts.map +0 -1
- package/dist/ui/components/Overlay.jsx +0 -102
- package/dist/ui/components/Overlay.jsx.map +0 -1
- package/dist/ui/components/ProgressBar.d.ts +0 -9
- package/dist/ui/components/ProgressBar.d.ts.map +0 -1
- package/dist/ui/components/ProgressBar.jsx +0 -17
- package/dist/ui/components/ProgressBar.jsx.map +0 -1
- package/dist/ui/components/Sidebar.d.ts +0 -22
- package/dist/ui/components/Sidebar.d.ts.map +0 -1
- package/dist/ui/components/Sidebar.jsx +0 -96
- package/dist/ui/components/Sidebar.jsx.map +0 -1
- package/dist/ui/components/StatusLine.d.ts +0 -6
- package/dist/ui/components/StatusLine.d.ts.map +0 -1
- package/dist/ui/components/StatusLine.jsx +0 -32
- package/dist/ui/components/StatusLine.jsx.map +0 -1
- package/dist/ui/components/ThinkingBlock.d.ts +0 -15
- package/dist/ui/components/ThinkingBlock.d.ts.map +0 -1
- package/dist/ui/components/ThinkingBlock.jsx +0 -33
- package/dist/ui/components/ThinkingBlock.jsx.map +0 -1
- package/dist/ui/components/TodoItem.d.ts +0 -22
- package/dist/ui/components/TodoItem.d.ts.map +0 -1
- package/dist/ui/components/TodoItem.jsx +0 -11
- package/dist/ui/components/TodoItem.jsx.map +0 -1
- package/dist/ui/components/ToolBlock.d.ts +0 -27
- package/dist/ui/components/ToolBlock.d.ts.map +0 -1
- package/dist/ui/components/ToolBlock.jsx +0 -76
- package/dist/ui/components/ToolBlock.jsx.map +0 -1
- package/dist/ui/components/index.d.ts +0 -12
- package/dist/ui/components/index.d.ts.map +0 -1
- package/dist/ui/components/index.js +0 -12
- package/dist/ui/components/index.js.map +0 -1
- package/dist/ui/context/index.d.ts +0 -4
- package/dist/ui/context/index.d.ts.map +0 -1
- package/dist/ui/context/index.js +0 -4
- package/dist/ui/context/index.js.map +0 -1
- package/dist/ui/context/mode.d.ts +0 -24
- package/dist/ui/context/mode.d.ts.map +0 -1
- package/dist/ui/context/mode.jsx +0 -53
- package/dist/ui/context/mode.jsx.map +0 -1
- package/dist/ui/context/session.d.ts +0 -43
- package/dist/ui/context/session.d.ts.map +0 -1
- package/dist/ui/context/session.jsx +0 -63
- package/dist/ui/context/session.jsx.map +0 -1
- package/dist/ui/context/todo.d.ts +0 -32
- package/dist/ui/context/todo.d.ts.map +0 -1
- package/dist/ui/context/todo.jsx +0 -75
- package/dist/ui/context/todo.jsx.map +0 -1
- package/dist/ui/design.d.ts +0 -182
- package/dist/ui/design.d.ts.map +0 -1
- package/dist/ui/design.js +0 -189
- package/dist/ui/design.js.map +0 -1
- package/dist/ui/index.d.ts +0 -4
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js +0 -3
- package/dist/ui/index.js.map +0 -1
- package/dist/util/config.d.ts +0 -22
- package/dist/util/config.d.ts.map +0 -1
- package/dist/util/config.js +0 -55
- package/dist/util/config.js.map +0 -1
- package/dist/util/instructions.d.ts +0 -39
- package/dist/util/instructions.d.ts.map +0 -1
- package/dist/util/instructions.js +0 -96
- package/dist/util/instructions.js.map +0 -1
- package/dist/util/lock.d.ts +0 -18
- package/dist/util/lock.d.ts.map +0 -1
- package/dist/util/lock.js +0 -65
- package/dist/util/lock.js.map +0 -1
- package/dist/util/logger.d.ts +0 -8
- package/dist/util/logger.d.ts.map +0 -1
- package/dist/util/logger.js +0 -81
- package/dist/util/logger.js.map +0 -1
package/dist/ui/design.d.ts
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Design Constants
|
|
3
|
-
* Single source of truth for colors, indicators, and visual elements
|
|
4
|
-
*
|
|
5
|
-
* Design Philosophy: Brutally Minimal
|
|
6
|
-
* - Function over decoration
|
|
7
|
-
* - Raw and honest
|
|
8
|
-
* - Dense and information-forward
|
|
9
|
-
* - High contrast
|
|
10
|
-
* - Monospace precision
|
|
11
|
-
* - No emojis
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Color Palette
|
|
15
|
-
*/
|
|
16
|
-
export declare const Colors: {
|
|
17
|
-
/**
|
|
18
|
-
* Mode-specific colors (used in mode indicators, input borders)
|
|
19
|
-
*/
|
|
20
|
-
readonly mode: {
|
|
21
|
-
readonly AUTO: "#ffffff";
|
|
22
|
-
readonly AGENT: "#5cffff";
|
|
23
|
-
readonly PLANNER: "#b48eff";
|
|
24
|
-
readonly "PLAN-PRD": "#5c8fff";
|
|
25
|
-
readonly DEBUG: "#ffaa5c";
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Status colors (used in tool results, messages)
|
|
29
|
-
*/
|
|
30
|
-
readonly status: {
|
|
31
|
-
readonly success: "#6fca6f";
|
|
32
|
-
readonly warning: "#e6c655";
|
|
33
|
-
readonly error: "#ff6b6b";
|
|
34
|
-
readonly info: "#5c8fff";
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* UI element colors
|
|
38
|
-
*/
|
|
39
|
-
readonly ui: {
|
|
40
|
-
readonly primary: "#5cffff";
|
|
41
|
-
readonly secondary: "#666666";
|
|
42
|
-
readonly text: "#ffffff";
|
|
43
|
-
readonly dim: "#666666";
|
|
44
|
-
readonly background: "#000000";
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Diff colors (used in file changes)
|
|
48
|
-
*/
|
|
49
|
-
readonly diff: {
|
|
50
|
-
readonly addition: "#6fca6f";
|
|
51
|
-
readonly deletion: "#ff6b6b";
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* ASCII Indicators (no emojis)
|
|
56
|
-
*/
|
|
57
|
-
export declare const Indicators: {
|
|
58
|
-
/**
|
|
59
|
-
* Expand/collapse indicators
|
|
60
|
-
*/
|
|
61
|
-
readonly collapsed: "▶";
|
|
62
|
-
readonly expanded: "▼";
|
|
63
|
-
/**
|
|
64
|
-
* Status dot
|
|
65
|
-
*/
|
|
66
|
-
readonly dot: "●";
|
|
67
|
-
/**
|
|
68
|
-
* Todo status indicators
|
|
69
|
-
*/
|
|
70
|
-
readonly todo: {
|
|
71
|
-
readonly pending: "[ ]";
|
|
72
|
-
readonly in_progress: "[>]";
|
|
73
|
-
readonly completed: "[x]";
|
|
74
|
-
readonly cancelled: "[-]";
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Tool result indicators
|
|
78
|
-
*/
|
|
79
|
-
readonly tool: {
|
|
80
|
-
readonly success: "[OK]";
|
|
81
|
-
readonly error: "[FAIL]";
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Progress bar characters
|
|
85
|
-
*/
|
|
86
|
-
readonly progress: {
|
|
87
|
-
readonly filled: "█";
|
|
88
|
-
readonly empty: "░";
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Separators
|
|
92
|
-
*/
|
|
93
|
-
readonly separator: {
|
|
94
|
-
readonly vertical: "│";
|
|
95
|
-
readonly horizontal: "─";
|
|
96
|
-
readonly cross: "┼";
|
|
97
|
-
readonly topLeft: "┌";
|
|
98
|
-
readonly topRight: "┐";
|
|
99
|
-
readonly bottomLeft: "└";
|
|
100
|
-
readonly bottomRight: "┘";
|
|
101
|
-
readonly teeLeft: "├";
|
|
102
|
-
readonly teeRight: "┤";
|
|
103
|
-
readonly teeTop: "┬";
|
|
104
|
-
readonly teeBottom: "┴";
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
/**
|
|
108
|
-
* Layout Constants
|
|
109
|
-
*/
|
|
110
|
-
export declare const Layout: {
|
|
111
|
-
/**
|
|
112
|
-
* Padding values
|
|
113
|
-
*/
|
|
114
|
-
readonly padding: {
|
|
115
|
-
readonly none: 0;
|
|
116
|
-
readonly xs: 1;
|
|
117
|
-
readonly sm: 2;
|
|
118
|
-
readonly md: 4;
|
|
119
|
-
readonly lg: 8;
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* Sidebar width
|
|
123
|
-
*/
|
|
124
|
-
readonly sidebar: {
|
|
125
|
-
readonly width: 40;
|
|
126
|
-
readonly minWidth: 30;
|
|
127
|
-
readonly maxWidth: 60;
|
|
128
|
-
};
|
|
129
|
-
/**
|
|
130
|
-
* Input height
|
|
131
|
-
*/
|
|
132
|
-
readonly input: {
|
|
133
|
-
readonly minHeight: 3;
|
|
134
|
-
readonly maxHeight: 10;
|
|
135
|
-
};
|
|
136
|
-
/**
|
|
137
|
-
* Progress bar width
|
|
138
|
-
*/
|
|
139
|
-
readonly progressBar: {
|
|
140
|
-
readonly width: 10;
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* Animation Timing (milliseconds)
|
|
145
|
-
*/
|
|
146
|
-
export declare const Timing: {
|
|
147
|
-
/**
|
|
148
|
-
* Event batching interval for streaming
|
|
149
|
-
*/
|
|
150
|
-
readonly batchInterval: 16;
|
|
151
|
-
/**
|
|
152
|
-
* Debounce delay for input
|
|
153
|
-
*/
|
|
154
|
-
readonly debounce: 100;
|
|
155
|
-
/**
|
|
156
|
-
* Animation duration
|
|
157
|
-
*/
|
|
158
|
-
readonly animation: 150;
|
|
159
|
-
};
|
|
160
|
-
export type Mode = keyof typeof Colors.mode;
|
|
161
|
-
export type Status = keyof typeof Colors.status;
|
|
162
|
-
export type TodoStatus = keyof typeof Indicators.todo;
|
|
163
|
-
export type ToolStatus = keyof typeof Indicators.tool;
|
|
164
|
-
/**
|
|
165
|
-
* Get mode color by mode name
|
|
166
|
-
*/
|
|
167
|
-
export declare function getModeColor(mode: Mode): string;
|
|
168
|
-
/**
|
|
169
|
-
* Get status color by status name
|
|
170
|
-
*/
|
|
171
|
-
export declare function getStatusColor(status: Status): string;
|
|
172
|
-
/**
|
|
173
|
-
* Get todo indicator by status
|
|
174
|
-
*/
|
|
175
|
-
export declare function getTodoIndicator(status: TodoStatus): string;
|
|
176
|
-
/**
|
|
177
|
-
* Create a progress bar string
|
|
178
|
-
* @param percent - Progress percentage (0-100)
|
|
179
|
-
* @param width - Width in characters (default 10)
|
|
180
|
-
*/
|
|
181
|
-
export declare function createProgressBar(percent: number, width?: number): string;
|
|
182
|
-
//# sourceMappingURL=design.d.ts.map
|
package/dist/ui/design.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"design.d.ts","sourceRoot":"","sources":["../../src/ui/design.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,eAAO,MAAM,MAAM;IACjB;;OAEG;;;;;;;;IASH;;OAEG;;;;;;;IAQH;;OAEG;;;;;;;;IASH;;OAEG;;;;;CAKK,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,UAAU;IACrB;;OAEG;;;IAIH;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;;;;IAMH;;OAEG;;;;;IAMH;;OAEG;;;;;;;;;;;;;;CAcK,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,MAAM;IACjB;;OAEG;;;;;;;;IASH;;OAEG;;;;;;IAOH;;OAEG;;;;;IAMH;;OAEG;;;;CAIK,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,MAAM;IACjB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEK,CAAC;AAGX,MAAM,MAAM,IAAI,GAAG,MAAM,OAAO,MAAM,CAAC,IAAI,CAAC;AAC5C,MAAM,MAAM,MAAM,GAAG,MAAM,OAAO,MAAM,CAAC,MAAM,CAAC;AAChD,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,UAAU,CAAC,IAAI,CAAC;AACtD,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,UAAU,CAAC,IAAI,CAAC;AAEtD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE/C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAiC,GAAG,MAAM,CAMnG"}
|
package/dist/ui/design.js
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Design Constants
|
|
3
|
-
* Single source of truth for colors, indicators, and visual elements
|
|
4
|
-
*
|
|
5
|
-
* Design Philosophy: Brutally Minimal
|
|
6
|
-
* - Function over decoration
|
|
7
|
-
* - Raw and honest
|
|
8
|
-
* - Dense and information-forward
|
|
9
|
-
* - High contrast
|
|
10
|
-
* - Monospace precision
|
|
11
|
-
* - No emojis
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Color Palette
|
|
15
|
-
*/
|
|
16
|
-
export const Colors = {
|
|
17
|
-
/**
|
|
18
|
-
* Mode-specific colors (used in mode indicators, input borders)
|
|
19
|
-
*/
|
|
20
|
-
mode: {
|
|
21
|
-
AUTO: "#ffffff", // White - AI decides
|
|
22
|
-
AGENT: "#5cffff", // Cyan - Full execution
|
|
23
|
-
PLANNER: "#b48eff", // Purple - Research + docs
|
|
24
|
-
"PLAN-PRD": "#5c8fff", // Blue - Quick PRD
|
|
25
|
-
DEBUG: "#ffaa5c", // Orange - Systematic debugging
|
|
26
|
-
},
|
|
27
|
-
/**
|
|
28
|
-
* Status colors (used in tool results, messages)
|
|
29
|
-
*/
|
|
30
|
-
status: {
|
|
31
|
-
success: "#6fca6f", // Green - Operation succeeded
|
|
32
|
-
warning: "#e6c655", // Yellow - Caution/attention
|
|
33
|
-
error: "#ff6b6b", // Red - Operation failed
|
|
34
|
-
info: "#5c8fff", // Blue - Informational
|
|
35
|
-
},
|
|
36
|
-
/**
|
|
37
|
-
* UI element colors
|
|
38
|
-
*/
|
|
39
|
-
ui: {
|
|
40
|
-
primary: "#5cffff", // Cyan - Primary accent
|
|
41
|
-
secondary: "#666666", // Gray - Secondary/muted
|
|
42
|
-
text: "#ffffff", // White - Primary text
|
|
43
|
-
dim: "#666666", // Gray - Dimmed text
|
|
44
|
-
background: "#000000", // Black - Background
|
|
45
|
-
},
|
|
46
|
-
/**
|
|
47
|
-
* Diff colors (used in file changes)
|
|
48
|
-
*/
|
|
49
|
-
diff: {
|
|
50
|
-
addition: "#6fca6f", // Green - Added lines
|
|
51
|
-
deletion: "#ff6b6b", // Red - Removed lines
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* ASCII Indicators (no emojis)
|
|
56
|
-
*/
|
|
57
|
-
export const Indicators = {
|
|
58
|
-
/**
|
|
59
|
-
* Expand/collapse indicators
|
|
60
|
-
*/
|
|
61
|
-
collapsed: "▶",
|
|
62
|
-
expanded: "▼",
|
|
63
|
-
/**
|
|
64
|
-
* Status dot
|
|
65
|
-
*/
|
|
66
|
-
dot: "●",
|
|
67
|
-
/**
|
|
68
|
-
* Todo status indicators
|
|
69
|
-
*/
|
|
70
|
-
todo: {
|
|
71
|
-
pending: "[ ]", // Not started
|
|
72
|
-
in_progress: "[>]", // Currently working
|
|
73
|
-
completed: "[x]", // Done
|
|
74
|
-
cancelled: "[-]", // No longer needed
|
|
75
|
-
},
|
|
76
|
-
/**
|
|
77
|
-
* Tool result indicators
|
|
78
|
-
*/
|
|
79
|
-
tool: {
|
|
80
|
-
success: "[OK]", // Tool succeeded
|
|
81
|
-
error: "[FAIL]", // Tool failed
|
|
82
|
-
},
|
|
83
|
-
/**
|
|
84
|
-
* Progress bar characters
|
|
85
|
-
*/
|
|
86
|
-
progress: {
|
|
87
|
-
filled: "█", // Completed portion
|
|
88
|
-
empty: "░", // Remaining portion
|
|
89
|
-
},
|
|
90
|
-
/**
|
|
91
|
-
* Separators
|
|
92
|
-
*/
|
|
93
|
-
separator: {
|
|
94
|
-
vertical: "│",
|
|
95
|
-
horizontal: "─",
|
|
96
|
-
cross: "┼",
|
|
97
|
-
topLeft: "┌",
|
|
98
|
-
topRight: "┐",
|
|
99
|
-
bottomLeft: "└",
|
|
100
|
-
bottomRight: "┘",
|
|
101
|
-
teeLeft: "├",
|
|
102
|
-
teeRight: "┤",
|
|
103
|
-
teeTop: "┬",
|
|
104
|
-
teeBottom: "┴",
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
/**
|
|
108
|
-
* Layout Constants
|
|
109
|
-
*/
|
|
110
|
-
export const Layout = {
|
|
111
|
-
/**
|
|
112
|
-
* Padding values
|
|
113
|
-
*/
|
|
114
|
-
padding: {
|
|
115
|
-
none: 0,
|
|
116
|
-
xs: 1,
|
|
117
|
-
sm: 2,
|
|
118
|
-
md: 4,
|
|
119
|
-
lg: 8,
|
|
120
|
-
},
|
|
121
|
-
/**
|
|
122
|
-
* Sidebar width
|
|
123
|
-
*/
|
|
124
|
-
sidebar: {
|
|
125
|
-
width: 40,
|
|
126
|
-
minWidth: 30,
|
|
127
|
-
maxWidth: 60,
|
|
128
|
-
},
|
|
129
|
-
/**
|
|
130
|
-
* Input height
|
|
131
|
-
*/
|
|
132
|
-
input: {
|
|
133
|
-
minHeight: 3,
|
|
134
|
-
maxHeight: 10,
|
|
135
|
-
},
|
|
136
|
-
/**
|
|
137
|
-
* Progress bar width
|
|
138
|
-
*/
|
|
139
|
-
progressBar: {
|
|
140
|
-
width: 10,
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* Animation Timing (milliseconds)
|
|
145
|
-
*/
|
|
146
|
-
export const Timing = {
|
|
147
|
-
/**
|
|
148
|
-
* Event batching interval for streaming
|
|
149
|
-
*/
|
|
150
|
-
batchInterval: 16, // ~60fps
|
|
151
|
-
/**
|
|
152
|
-
* Debounce delay for input
|
|
153
|
-
*/
|
|
154
|
-
debounce: 100,
|
|
155
|
-
/**
|
|
156
|
-
* Animation duration
|
|
157
|
-
*/
|
|
158
|
-
animation: 150,
|
|
159
|
-
};
|
|
160
|
-
/**
|
|
161
|
-
* Get mode color by mode name
|
|
162
|
-
*/
|
|
163
|
-
export function getModeColor(mode) {
|
|
164
|
-
return Colors.mode[mode];
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Get status color by status name
|
|
168
|
-
*/
|
|
169
|
-
export function getStatusColor(status) {
|
|
170
|
-
return Colors.status[status];
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Get todo indicator by status
|
|
174
|
-
*/
|
|
175
|
-
export function getTodoIndicator(status) {
|
|
176
|
-
return Indicators.todo[status];
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Create a progress bar string
|
|
180
|
-
* @param percent - Progress percentage (0-100)
|
|
181
|
-
* @param width - Width in characters (default 10)
|
|
182
|
-
*/
|
|
183
|
-
export function createProgressBar(percent, width = Layout.progressBar.width) {
|
|
184
|
-
const clamped = Math.max(0, Math.min(100, percent));
|
|
185
|
-
const filled = Math.round((clamped / 100) * width);
|
|
186
|
-
const empty = width - filled;
|
|
187
|
-
return `[${Indicators.progress.filled.repeat(filled)}${Indicators.progress.empty.repeat(empty)}]`;
|
|
188
|
-
}
|
|
189
|
-
//# sourceMappingURL=design.js.map
|
package/dist/ui/design.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"design.js","sourceRoot":"","sources":["../../src/ui/design.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB;;OAEG;IACH,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS,EAAO,qBAAqB;QAC3C,KAAK,EAAE,SAAS,EAAM,wBAAwB;QAC9C,OAAO,EAAE,SAAS,EAAI,2BAA2B;QACjD,UAAU,EAAE,SAAS,EAAE,mBAAmB;QAC1C,KAAK,EAAE,SAAS,EAAM,gCAAgC;KACvD;IAED;;OAEG;IACH,MAAM,EAAE;QACN,OAAO,EAAE,SAAS,EAAI,8BAA8B;QACpD,OAAO,EAAE,SAAS,EAAI,6BAA6B;QACnD,KAAK,EAAE,SAAS,EAAM,yBAAyB;QAC/C,IAAI,EAAE,SAAS,EAAO,uBAAuB;KAC9C;IAED;;OAEG;IACH,EAAE,EAAE;QACF,OAAO,EAAE,SAAS,EAAI,wBAAwB;QAC9C,SAAS,EAAE,SAAS,EAAE,yBAAyB;QAC/C,IAAI,EAAE,SAAS,EAAO,uBAAuB;QAC7C,GAAG,EAAE,SAAS,EAAQ,qBAAqB;QAC3C,UAAU,EAAE,SAAS,EAAE,qBAAqB;KAC7C;IAED;;OAEG;IACH,IAAI,EAAE;QACJ,QAAQ,EAAE,SAAS,EAAG,sBAAs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DELETED
package/dist/ui/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAE9D,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/ui/index.js
DELETED
package/dist/ui/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/util/config.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
declare const ConfigSchema: z.ZodObject<{
|
|
3
|
-
apiKey: z.ZodString;
|
|
4
|
-
defaultModel: z.ZodDefault<z.ZodString>;
|
|
5
|
-
defaultMode: z.ZodDefault<z.ZodString>;
|
|
6
|
-
thinking: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
apiKey: string;
|
|
9
|
-
defaultModel: string;
|
|
10
|
-
defaultMode: string;
|
|
11
|
-
thinking: boolean;
|
|
12
|
-
}, {
|
|
13
|
-
apiKey: string;
|
|
14
|
-
defaultModel?: string | undefined;
|
|
15
|
-
defaultMode?: string | undefined;
|
|
16
|
-
thinking?: boolean | undefined;
|
|
17
|
-
}>;
|
|
18
|
-
type Config = z.infer<typeof ConfigSchema>;
|
|
19
|
-
export declare function load(): Promise<Config>;
|
|
20
|
-
export declare function save(config: Config): Promise<void>;
|
|
21
|
-
export type { Config };
|
|
22
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/util/config.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;EAKhB,CAAC;AAEH,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAqC3C,wBAAsB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAU5C;AAED,wBAAsB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIxD;AAED,YAAY,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/util/config.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Global } from "../global";
|
|
2
|
-
import fs from "fs/promises";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import z from "zod";
|
|
5
|
-
const ConfigSchema = z.object({
|
|
6
|
-
apiKey: z.string().describe("Z.AI API key for authentication"),
|
|
7
|
-
defaultModel: z.string().default("glm-4.7").describe("Default GLM model to use"),
|
|
8
|
-
defaultMode: z.string().default("AUTO").describe("Default mode: AUTO, AGENT, PLANNER, PLAN-PRD, DEBUG"),
|
|
9
|
-
thinking: z.boolean().default(true).describe("Enable thinking mode"),
|
|
10
|
-
});
|
|
11
|
-
const configPath = path.join(Global.Path.config, "config.json");
|
|
12
|
-
async function loadConfigFile() {
|
|
13
|
-
try {
|
|
14
|
-
const content = await fs.readFile(configPath, "utf-8");
|
|
15
|
-
return JSON.parse(content);
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
if (e.code !== "ENOENT") {
|
|
19
|
-
throw e;
|
|
20
|
-
}
|
|
21
|
-
return {};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
async function loadEnvVars() {
|
|
25
|
-
const env = {};
|
|
26
|
-
if (process.env["GLM_API_KEY"]) {
|
|
27
|
-
env.apiKey = process.env["GLM_API_KEY"];
|
|
28
|
-
}
|
|
29
|
-
return env;
|
|
30
|
-
}
|
|
31
|
-
function applyDefaults(config) {
|
|
32
|
-
return ConfigSchema.parse({
|
|
33
|
-
apiKey: config.apiKey,
|
|
34
|
-
defaultModel: config.defaultModel,
|
|
35
|
-
defaultMode: config.defaultMode,
|
|
36
|
-
thinking: config.thinking,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
let cachedConfig = null;
|
|
40
|
-
export async function load() {
|
|
41
|
-
if (cachedConfig !== null) {
|
|
42
|
-
return cachedConfig;
|
|
43
|
-
}
|
|
44
|
-
const fileConfig = await loadConfigFile();
|
|
45
|
-
const envConfig = await loadEnvVars();
|
|
46
|
-
const merged = { ...fileConfig, ...envConfig };
|
|
47
|
-
cachedConfig = applyDefaults(merged);
|
|
48
|
-
return cachedConfig;
|
|
49
|
-
}
|
|
50
|
-
export async function save(config) {
|
|
51
|
-
await fs.mkdir(Global.Path.config, { recursive: true });
|
|
52
|
-
await fs.writeFile(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
53
|
-
cachedConfig = config;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=config.js.map
|
package/dist/util/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/util/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IA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EAAE,MAAM,CAAC,QAAQ;KAC1B,CAAC,CAAC;AACL,CAAC;AAED,IAAI,YAAY,GAAkB,IAAI,CAAC;AAEvC,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,cAAc,EAAE,CAAC;IAC1C,MAAM,SAAS,GAAG,MAAM,WAAW,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/C,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,MAAc;IACvC,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IACzE,YAAY,GAAG,MAAM,CAAC;AACxB,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Instruction File Discovery
|
|
3
|
-
* Finds and loads project instruction files in priority order
|
|
4
|
-
*/
|
|
5
|
-
declare const INSTRUCTION_FILES: readonly [".glm-cli/instructions.md", "AGENTS.md", "CLAUDE.md", "GEMINI.md", "QWEN.md", "KIMI.md", "COPILOT.md", ".cursorrules", ".windsurfrules"];
|
|
6
|
-
export type InstructionFileName = typeof INSTRUCTION_FILES[number];
|
|
7
|
-
export interface InstructionFile {
|
|
8
|
-
path: string;
|
|
9
|
-
name: InstructionFileName;
|
|
10
|
-
content: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Find the first instruction file in priority order
|
|
14
|
-
* @param dir - Directory to search in (defaults to cwd)
|
|
15
|
-
* @returns Path to found file, or null if none found
|
|
16
|
-
*/
|
|
17
|
-
export declare function findInstructions(dir?: string): Promise<string | null>;
|
|
18
|
-
/**
|
|
19
|
-
* Load instruction file from a directory
|
|
20
|
-
* Results are cached per directory for the session
|
|
21
|
-
* @param dir - Directory to search in (defaults to cwd)
|
|
22
|
-
* @returns InstructionFile or null if none found
|
|
23
|
-
*/
|
|
24
|
-
export declare function loadInstructions(dir?: string): Promise<InstructionFile | null>;
|
|
25
|
-
/**
|
|
26
|
-
* Clear the instruction cache
|
|
27
|
-
* Useful for testing or when files may have changed
|
|
28
|
-
*/
|
|
29
|
-
export declare function clearInstructionCache(): void;
|
|
30
|
-
/**
|
|
31
|
-
* Clear cache for a specific directory
|
|
32
|
-
*/
|
|
33
|
-
export declare function clearInstructionCacheFor(dir: string): void;
|
|
34
|
-
/**
|
|
35
|
-
* Get all supported instruction file names
|
|
36
|
-
*/
|
|
37
|
-
export declare function getInstructionFileNames(): readonly string[];
|
|
38
|
-
export {};
|
|
39
|
-
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/util/instructions.ts"],"names":[],"mappings":"AAGA;;;GAGG;AAGH,QAAA,MAAM,iBAAiB,oJAUb,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAEnE,MAAM,WAAW,eAAe;IAE9B,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,mBAAmB,CAAC;IAE1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAiBD;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWxB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CA2BjC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAG1D;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,SAAS,MAAM,EAAE,CAE3D"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import fs from "fs/promises";
|
|
2
|
-
import path from "path";
|
|
3
|
-
/**
|
|
4
|
-
* Instruction File Discovery
|
|
5
|
-
* Finds and loads project instruction files in priority order
|
|
6
|
-
*/
|
|
7
|
-
// Priority order for instruction files (first found wins)
|
|
8
|
-
const INSTRUCTION_FILES = [
|
|
9
|
-
".glm-cli/instructions.md",
|
|
10
|
-
"AGENTS.md",
|
|
11
|
-
"CLAUDE.md",
|
|
12
|
-
"GEMINI.md",
|
|
13
|
-
"QWEN.md",
|
|
14
|
-
"KIMI.md",
|
|
15
|
-
"COPILOT.md",
|
|
16
|
-
".cursorrules",
|
|
17
|
-
".windsurfrules",
|
|
18
|
-
];
|
|
19
|
-
// Cache for loaded instructions (per directory)
|
|
20
|
-
const cache = new Map();
|
|
21
|
-
/**
|
|
22
|
-
* Check if a file exists
|
|
23
|
-
*/
|
|
24
|
-
async function fileExists(filePath) {
|
|
25
|
-
try {
|
|
26
|
-
await fs.access(filePath);
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Find the first instruction file in priority order
|
|
35
|
-
* @param dir - Directory to search in (defaults to cwd)
|
|
36
|
-
* @returns Path to found file, or null if none found
|
|
37
|
-
*/
|
|
38
|
-
export async function findInstructions(dir = process.cwd()) {
|
|
39
|
-
const absoluteDir = path.resolve(dir);
|
|
40
|
-
for (const filename of INSTRUCTION_FILES) {
|
|
41
|
-
const filePath = path.join(absoluteDir, filename);
|
|
42
|
-
if (await fileExists(filePath)) {
|
|
43
|
-
return filePath;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Load instruction file from a directory
|
|
50
|
-
* Results are cached per directory for the session
|
|
51
|
-
* @param dir - Directory to search in (defaults to cwd)
|
|
52
|
-
* @returns InstructionFile or null if none found
|
|
53
|
-
*/
|
|
54
|
-
export async function loadInstructions(dir = process.cwd()) {
|
|
55
|
-
const absoluteDir = path.resolve(dir);
|
|
56
|
-
// Check cache first
|
|
57
|
-
if (cache.has(absoluteDir)) {
|
|
58
|
-
return cache.get(absoluteDir) ?? null;
|
|
59
|
-
}
|
|
60
|
-
// Find and load
|
|
61
|
-
const filePath = await findInstructions(absoluteDir);
|
|
62
|
-
if (!filePath) {
|
|
63
|
-
cache.set(absoluteDir, null);
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
const content = await fs.readFile(filePath, "utf-8");
|
|
67
|
-
const name = path.relative(absoluteDir, filePath);
|
|
68
|
-
const result = {
|
|
69
|
-
path: filePath,
|
|
70
|
-
name,
|
|
71
|
-
content,
|
|
72
|
-
};
|
|
73
|
-
cache.set(absoluteDir, result);
|
|
74
|
-
return result;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Clear the instruction cache
|
|
78
|
-
* Useful for testing or when files may have changed
|
|
79
|
-
*/
|
|
80
|
-
export function clearInstructionCache() {
|
|
81
|
-
cache.clear();
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Clear cache for a specific directory
|
|
85
|
-
*/
|
|
86
|
-
export function clearInstructionCacheFor(dir) {
|
|
87
|
-
const absoluteDir = path.resolve(dir);
|
|
88
|
-
cache.delete(absoluteDir);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Get all supported instruction file names
|
|
92
|
-
*/
|
|
93
|
-
export function getInstructionFileNames() {
|
|
94
|
-
return INSTRUCTION_FILES;
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=instructions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/util/instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;GAGG;AAEH,0DAA0D;AAC1D,MAAM,iBAAiB,GAAG;IACxB,0BAA0B;IAC1B,WAAW;IACX,WAAW;IACX,WAAW;IACX,SAAS;IACT,SAAS;IACT,YAAY;IACZ,cAAc;IACd,gBAAgB;CACR,CAAC;AAaX,gDAAgD;AAChD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkC,CAAC;AAExD;;GAEG;AACH,KAAK,UAAU,UAAU,CAAC,QAAgB;IACxC,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAc,OAAO,CAAC,GAAG,EAAE;IAE3B,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtC,KAAK,MAAM,QAAQ,IAAI,iBAAiB,EAAE,CAAC;QACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QAClD,IAAI,MAAM,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAc,OAAO,CAAC,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ose](): void;
|
|
3
|
-
}
|
|
4
|
-
interface AsyncDisposable extends Disposable {
|
|
5
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
declare class LockImpl implements AsyncDisposable {
|
|
8
|
-
private readonly lockFile;
|
|
9
|
-
constructor(lockFile: string);
|
|
10
|
-
[Symbol.dispose](): void;
|
|
11
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
export declare namespace Lock {
|
|
14
|
-
const read: (target: string) => Promise<LockImpl>;
|
|
15
|
-
const write: (target: string) => Promise<LockImpl>;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=lock.d.ts.map
|
package/dist/util/lock.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/util/lock.ts"],"names":[],"mappings":"AAKA,UAAU,UAAU;IAClB,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;CAC1B;AAED,UAAU,eAAgB,SAAQ,UAAU;IAC1C,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAOD,cAAM,QAAS,YAAW,eAAe;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAEtB,QAAQ,EAAE,MAAM;IAI5B,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;IAQlB,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAS7C;AAED,yBAAiB,IAAI,CAAC;IAuBb,MAAM,IAAI,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,QAAQ,CAI3D,CAAC;IAEK,MAAM,KAAK,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,QAAQ,CAI5D,CAAC;CACH"}
|