vg-coder-cli 2.0.34 → 2.0.36
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 +1 -0
- package/dist/vg-coder-bundle.js +3 -3
- package/package.json +1 -2
- package/src/server/api-server.js +130 -0
- package/src/server/views/css/commands-panel.css +75 -0
- package/src/server/views/css/editor.css +1 -1
- package/src/server/views/css/git-panel.css +361 -0
- package/src/server/views/css/git-view.css +1 -77
- package/src/server/views/css/project-panel.css +242 -0
- package/src/server/views/css/shortcuts-help.css +165 -0
- package/src/server/views/css/tool-window.css +267 -0
- package/src/server/views/dashboard.css +1 -1
- package/src/server/views/dashboard.html +78 -102
- package/src/server/views/js/api.js +26 -0
- package/src/server/views/js/event-protocol.js +1 -0
- package/src/server/views/js/features/bubble-features/copy-prompt-feature.js +14 -0
- package/src/server/views/js/features/bubble-features/index.js +6 -1
- package/src/server/views/js/features/commands-panel.js +63 -0
- package/src/server/views/js/features/git-panel.js +481 -0
- package/src/server/views/js/features/git-view.js +79 -307
- package/src/server/views/js/features/keyboard-shortcuts.js +333 -0
- package/src/server/views/js/features/project-panel.js +452 -0
- package/src/server/views/js/features/resize.js +7 -10
- package/src/server/views/js/features/terminal.js +74 -1
- package/src/server/views/js/features/tool-window.js +154 -0
- package/src/server/views/js/handlers.js +32 -5
- package/src/server/views/js/main.js +17 -31
|
@@ -18,122 +18,79 @@
|
|
|
18
18
|
|
|
19
19
|
<!-- MAIN DASHBOARD INTERFACE -->
|
|
20
20
|
<div class="split-layout">
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<div class="header-bottom-row">
|
|
42
|
-
<div class="project-meta" id="project-meta">...</div>
|
|
43
|
-
<div id="project-name" style="display: none;"></div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
21
|
+
|
|
22
|
+
<!-- TOOL WINDOW BAR (IDE-Style Sidebar) -->
|
|
23
|
+
<div id="tool-window-bar" class="tool-window-bar">
|
|
24
|
+
<button class="tool-window-icon" data-panel="project" data-tooltip="Project" title="Project">
|
|
25
|
+
📁
|
|
26
|
+
</button>
|
|
27
|
+
<button class="tool-window-icon" data-panel="git" data-tooltip="Git" title="Git">
|
|
28
|
+
🔀
|
|
29
|
+
</button>
|
|
30
|
+
<button class="tool-window-icon" data-panel="commands" data-tooltip="Commands" title="Saved Commands">
|
|
31
|
+
⚡
|
|
32
|
+
</button>
|
|
33
|
+
|
|
34
|
+
<!-- Action Buttons at bottom -->
|
|
35
|
+
<div class="tool-window-spacer"></div>
|
|
36
|
+
<button class="tool-window-action-btn" id="stop-server-btn" onclick="window.stopServer()" title="Stop Server">🛑</button>
|
|
37
|
+
<button class="tool-window-action-btn" id="theme-toggle" title="Toggle Dark Mode">
|
|
38
|
+
<span id="theme-icon">🌙</span>
|
|
39
|
+
</button>
|
|
40
|
+
</div>
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</
|
|
42
|
+
<!-- TOOL PANEL CONTAINER (Expandable Panels) -->
|
|
43
|
+
<div id="tool-panel-container" class="tool-panel-container">
|
|
44
|
+
<!-- Project Panel -->
|
|
45
|
+
<div id="tool-panel-project" class="tool-panel">
|
|
46
|
+
<div class="tool-panel-header">
|
|
47
|
+
<div class="tool-panel-title">
|
|
48
|
+
<span>📁</span>
|
|
49
|
+
<span>Project</span>
|
|
55
50
|
</div>
|
|
56
|
-
<div class="
|
|
57
|
-
<
|
|
58
|
-
<div class="empty-state" id="commands-empty-state" style="display: none;">
|
|
59
|
-
<p style="color: #888; text-align: center; padding: 15px 10px; font-size: 12px; margin: 0;">Click ➕ to add a command</p>
|
|
60
|
-
</div>
|
|
51
|
+
<div class="tool-panel-actions">
|
|
52
|
+
<button class="tool-panel-action-btn" onclick="window.closeToolPanels()" title="Close">✕</button>
|
|
61
53
|
</div>
|
|
62
54
|
</div>
|
|
55
|
+
<div id="project-panel-content" class="tool-panel-content">
|
|
56
|
+
<!-- Project tree will be rendered here by project-panel.js -->
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</
|
|
70
|
-
<span class="toggle-icon" id="toggle-icon">▼</span>
|
|
60
|
+
<!-- Git Panel -->
|
|
61
|
+
<div id="tool-panel-git" class="tool-panel">
|
|
62
|
+
<div class="tool-panel-header">
|
|
63
|
+
<div class="tool-panel-title">
|
|
64
|
+
<span>🔀</span>
|
|
65
|
+
<span>Git</span>
|
|
71
66
|
</div>
|
|
72
|
-
<div class="
|
|
73
|
-
<
|
|
74
|
-
<button class="btn
|
|
75
|
-
<span id="copy-icon">📋</span>
|
|
76
|
-
<span id="copy-text">Copy System Prompt</span>
|
|
77
|
-
</button>
|
|
67
|
+
<div class="tool-panel-actions">
|
|
68
|
+
<button class="tool-panel-action-btn" id="git-panel-refresh-btn" title="Refresh">🔄</button>
|
|
69
|
+
<button class="tool-panel-action-btn" onclick="window.closeToolPanels()" title="Close">✕</button>
|
|
78
70
|
</div>
|
|
79
71
|
</div>
|
|
72
|
+
<div id="git-panel-content" class="tool-panel-content">
|
|
73
|
+
<!-- Git view will be rendered here by git-panel.js -->
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
80
76
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
<
|
|
87
|
-
<textarea id="execute-bash" placeholder="mkdir -p src/test echo 'Hello' > src/test/hello.txt"></textarea>
|
|
88
|
-
</div>
|
|
89
|
-
<div class="btn-group">
|
|
90
|
-
<button class="btn" onclick="testExecute(event)"><span>▶️</span> Run</button>
|
|
91
|
-
<button class="btn" onclick="executeFromClipboard(event)"><span>📋</span> Paste & Run</button>
|
|
92
|
-
</div>
|
|
93
|
-
<div class="response" id="execute-response"></div>
|
|
94
|
-
</div>
|
|
95
|
-
|
|
96
|
-
<div class="endpoint-card">
|
|
97
|
-
<div class="endpoint-header">
|
|
98
|
-
<div class="endpoint-title-group">
|
|
99
|
-
<span class="method get" style="background: var(--ios-blue); color: white;">GET</span>
|
|
100
|
-
<span class="endpoint-path">/structure</span>
|
|
101
|
-
</div>
|
|
102
|
-
<button class="btn-icon-head" onclick="copySelectedStructure(event)" title="Copy Selected">📋</button>
|
|
103
|
-
</div>
|
|
104
|
-
<div class="form-group">
|
|
105
|
-
<input type="text" id="structure-path" value="." placeholder="Project path">
|
|
106
|
-
</div>
|
|
107
|
-
<div class="btn-group">
|
|
108
|
-
<button class="btn" onclick="testStructure(event)"><span>🌳</span> View</button>
|
|
109
|
-
</div>
|
|
110
|
-
<div class="tree-container" id="structure-tree" style="display: none;">
|
|
111
|
-
<div class="tree-header"><span>Tree</span><span class="tree-total-tokens" id="total-tokens-badge">0 tokens</span></div>
|
|
112
|
-
<div class="tree-content" id="tree-content"></div>
|
|
113
|
-
</div>
|
|
114
|
-
<div class="response" id="structure-response" style="display: none;"></div>
|
|
77
|
+
<!-- Commands Panel -->
|
|
78
|
+
<div id="tool-panel-commands" class="tool-panel">
|
|
79
|
+
<div class="tool-panel-header">
|
|
80
|
+
<div class="tool-panel-title">
|
|
81
|
+
<span>⚡</span>
|
|
82
|
+
<span>Commands</span>
|
|
115
83
|
</div>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
<div class="endpoint-header">
|
|
119
|
-
<div class="endpoint-title-group"><span class="method post">POST</span><span class="endpoint-path">/analyze</span></div>
|
|
120
|
-
<button class="btn-icon-head" onclick="testAnalyze(event)" title="Download Project Source">📥</button>
|
|
121
|
-
</div>
|
|
122
|
-
<div class="form-group">
|
|
123
|
-
<input type="text" id="analyze-path" value="." placeholder="Project path (e.g. .)">
|
|
124
|
-
</div>
|
|
125
|
-
<div class="btn-group">
|
|
126
|
-
<button class="btn btn-copy" onclick="copyAnalyzeResult(event)">
|
|
127
|
-
<span id="analyze-copy-icon">📋</span>
|
|
128
|
-
<span id="analyze-copy-text">Copy Text</span>
|
|
129
|
-
</button>
|
|
130
|
-
</div>
|
|
131
|
-
<div class="response" id="analyze-response"></div>
|
|
84
|
+
<div class="tool-panel-actions">
|
|
85
|
+
<button class="tool-panel-action-btn" onclick="window.closeToolPanels()" title="Close">✕</button>
|
|
132
86
|
</div>
|
|
133
87
|
</div>
|
|
134
|
-
<div
|
|
88
|
+
<div id="commands-panel-content" class="tool-panel-content">
|
|
89
|
+
<!-- Content will be rendered by commands-panel.js -->
|
|
90
|
+
</div>
|
|
135
91
|
</div>
|
|
136
92
|
</div>
|
|
93
|
+
|
|
137
94
|
<div id="resize-handler" class="resize-handler"></div>
|
|
138
95
|
|
|
139
96
|
<div class="right-panel">
|
|
@@ -173,6 +130,25 @@
|
|
|
173
130
|
</div>
|
|
174
131
|
</div>
|
|
175
132
|
|
|
133
|
+
<!-- Keyboard Shortcuts Help Overlay -->
|
|
134
|
+
<div id="shortcuts-help" class="vg-shortcuts-help">
|
|
135
|
+
<div class="vg-shortcuts-panel">
|
|
136
|
+
<div class="vg-shortcuts-header">
|
|
137
|
+
<div class="vg-shortcuts-title">
|
|
138
|
+
<span>⌨️</span>
|
|
139
|
+
<span>Keyboard Shortcuts</span>
|
|
140
|
+
</div>
|
|
141
|
+
<button class="vg-shortcuts-close" onclick="window.toggleShortcutsHelp()">×</button>
|
|
142
|
+
</div>
|
|
143
|
+
<div id="shortcuts-list" class="vg-shortcuts-list">
|
|
144
|
+
<!-- Shortcuts will be rendered dynamically by keyboard-shortcuts.js -->
|
|
145
|
+
</div>
|
|
146
|
+
<div class="vg-shortcuts-footer">
|
|
147
|
+
Press <kbd class="vg-shortcut-key">Cmd</kbd> + <kbd class="vg-shortcut-key">/</kbd> to toggle this help
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
176
152
|
<!-- Scripts injected via Gulp -->
|
|
177
153
|
</body>
|
|
178
154
|
</html>
|
|
@@ -98,6 +98,19 @@ export async function commitChanges(message) {
|
|
|
98
98
|
return true;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
export async function gitPush(remote = 'origin', branch = null) {
|
|
102
|
+
const res = await fetch(`${API_BASE}/api/git/push`, {
|
|
103
|
+
method: 'POST',
|
|
104
|
+
headers: { 'Content-Type': 'application/json' },
|
|
105
|
+
body: JSON.stringify({ remote, branch })
|
|
106
|
+
});
|
|
107
|
+
if (!res.ok) {
|
|
108
|
+
const data = await res.json();
|
|
109
|
+
throw new Error(data.error || 'Push failed');
|
|
110
|
+
}
|
|
111
|
+
return await res.json();
|
|
112
|
+
}
|
|
113
|
+
|
|
101
114
|
export async function saveTreeState(excludedPaths) {
|
|
102
115
|
const res = await fetch(`${API_BASE}/api/tree-state/save`, {
|
|
103
116
|
method: 'POST',
|
|
@@ -131,3 +144,16 @@ export async function copyToClipboard(text) {
|
|
|
131
144
|
export async function readFromClipboard() {
|
|
132
145
|
return await navigator.clipboard.readText();
|
|
133
146
|
}
|
|
147
|
+
|
|
148
|
+
export async function countTokens(text) {
|
|
149
|
+
const res = await fetch(`${API_BASE}/api/count-tokens`, {
|
|
150
|
+
method: 'POST',
|
|
151
|
+
headers: { 'Content-Type': 'application/json' },
|
|
152
|
+
body: JSON.stringify({ text })
|
|
153
|
+
});
|
|
154
|
+
if (!res.ok) {
|
|
155
|
+
throw new Error('Failed to count tokens');
|
|
156
|
+
}
|
|
157
|
+
const data = await res.json();
|
|
158
|
+
return data.tokens || 0;
|
|
159
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EVENT_TYPES } from '../../event-protocol.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Copy System Prompt Feature
|
|
5
|
+
* Copies the system prompt to clipboard
|
|
6
|
+
*/
|
|
7
|
+
export const CopyPromptFeature = {
|
|
8
|
+
id: 'copy-prompt',
|
|
9
|
+
label: '📋 Copy System Prompt',
|
|
10
|
+
tooltip: 'Copy System Prompt',
|
|
11
|
+
eventType: EVENT_TYPES.COPY_PROMPT,
|
|
12
|
+
enabled: true,
|
|
13
|
+
order: 30,
|
|
14
|
+
};
|
|
@@ -117,9 +117,14 @@ export class FeatureRegistry {
|
|
|
117
117
|
// Create singleton registry
|
|
118
118
|
export const featureRegistry = new FeatureRegistry();
|
|
119
119
|
|
|
120
|
+
// Import features
|
|
121
|
+
import { CopyPromptFeature } from './copy-prompt-feature.js';
|
|
122
|
+
|
|
120
123
|
// Register built-in features
|
|
121
124
|
featureRegistry.register(PasteRunFeature);
|
|
122
125
|
featureRegistry.register(TerminalFeature);
|
|
126
|
+
featureRegistry.register(CopyPromptFeature);
|
|
123
127
|
|
|
124
128
|
// Export for external registration
|
|
125
|
-
export { PasteRunFeature, TerminalFeature };
|
|
129
|
+
export { PasteRunFeature, TerminalFeature, CopyPromptFeature };
|
|
130
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { getById } from '../utils.js';
|
|
2
|
+
|
|
3
|
+
let isInitialized = false;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Initialize Commands Panel
|
|
7
|
+
*/
|
|
8
|
+
export function initCommandsPanel() {
|
|
9
|
+
if (isInitialized) return;
|
|
10
|
+
|
|
11
|
+
console.log('[CommandsPanel] Initializing...');
|
|
12
|
+
|
|
13
|
+
// Render panel content
|
|
14
|
+
renderCommandsPanel();
|
|
15
|
+
|
|
16
|
+
isInitialized = true;
|
|
17
|
+
console.log('[CommandsPanel] Initialized successfully');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Render Commands Panel structure
|
|
22
|
+
*/
|
|
23
|
+
function renderCommandsPanel() {
|
|
24
|
+
const container = getById('commands-panel-content');
|
|
25
|
+
if (!container) {
|
|
26
|
+
console.error('[CommandsPanel] Container not found');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Render the same structure as old saved-commands
|
|
31
|
+
container.innerHTML = `
|
|
32
|
+
<div class="commands-panel-header">
|
|
33
|
+
<button class="commands-panel-btn" onclick="createNewTerminal()" title="New Terminal">
|
|
34
|
+
🖥️ New Terminal
|
|
35
|
+
</button>
|
|
36
|
+
<button class="commands-panel-btn" onclick="openAddCommandModal()" title="Add Command">
|
|
37
|
+
➕ Add Command
|
|
38
|
+
</button>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="saved-commands-content">
|
|
41
|
+
<div id="commands-list" class="commands-list"></div>
|
|
42
|
+
<div class="commands-empty-state" id="commands-empty-state" style="display: none;">
|
|
43
|
+
<p style="color: #888; text-align: center; padding: 15px 10px; font-size: 12px; margin: 0;">Click ➕ to add a command</p>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
// Load saved commands after rendering
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
if (window.loadSavedCommands) {
|
|
51
|
+
window.loadSavedCommands();
|
|
52
|
+
}
|
|
53
|
+
}, 100);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Refresh commands list
|
|
58
|
+
*/
|
|
59
|
+
export function refreshCommandsList() {
|
|
60
|
+
if (window.loadSavedCommands) {
|
|
61
|
+
window.loadSavedCommands();
|
|
62
|
+
}
|
|
63
|
+
}
|