vg-coder-cli 2.0.33 → 2.0.35

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.
@@ -18,122 +18,79 @@
18
18
 
19
19
  <!-- MAIN DASHBOARD INTERFACE -->
20
20
  <div class="split-layout">
21
- <div class="left-panel">
22
- <div class="container">
23
- <div class="header">
24
- <div class="header-top-row">
25
- <div class="header-left-group">
26
- <span class="status" id="status" style="font-size: 14px;">●</span>
27
- <div class="project-switcher">
28
- <select id="project-selector" class="project-selector" onchange="window.switchProject(this.value)" title="Switch Project">
29
- <option value="">Loading...</option>
30
- </select>
31
- <span class="project-count" id="project-count">1 project</span>
32
- </div>
33
- </div>
34
- <div class="header-actions">
35
- <button class="stop-server-btn" id="stop-server-btn" onclick="window.stopServer()" title="Stop Server">🛑</button>
36
- <button class="theme-toggle" id="theme-toggle" title="Toggle Dark Mode">
37
- <span id="theme-icon">🌙</span>
38
- </button>
39
- </div>
40
- </div>
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
- <!-- Saved Commands -->
48
- <div class="endpoint-card saved-commands-panel">
49
- <div class="saved-commands-header">
50
- <div class="saved-commands-title"><span class="command-icon-header">💾</span><span>Saved Commands</span></div>
51
- <div class="saved-commands-actions">
52
- <button class="btn-new-terminal" onclick="createNewTerminal()" title="New Terminal">🖥️</button>
53
- <button class="btn-add-command" onclick="openAddCommandModal()" title="Add Command">➕</button>
54
- </div>
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="saved-commands-content" id="saved-commands-content">
57
- <div id="commands-list" class="commands-list"></div>
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
- <div class="system-prompt-card">
65
- <div class="system-prompt-header" onclick="toggleSystemPrompt()">
66
- <div class="header-title-group">
67
- <button class="btn-icon-head" onclick="copySystemPromptFromHeader(event)" title="Copy System Prompt">📋</button>
68
- <h2>System Prompt</h2>
69
- </div>
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="system-prompt-content" id="system-prompt-content">
73
- <div class="prompt-text" id="prompt-text"></div>
74
- <button class="btn btn-copy" onclick="copySystemPrompt(event)">
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
- <div class="endpoints">
82
- <div class="endpoint-card">
83
- <div class="endpoint-header">
84
- <div class="endpoint-title-group"><span class="method post">POST</span><span class="endpoint-path">/execute</span></div>
85
- </div>
86
- <div class="form-group">
87
- <textarea id="execute-bash" placeholder="mkdir -p src/test&#10;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
- <div class="endpoint-card">
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 style="height: 50px;"></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">
@@ -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',
@@ -11,6 +11,7 @@ export const EVENT_TYPES = {
11
11
  TERMINAL_NEW: 'vg:terminal-new',
12
12
  TERMINAL_EXECUTE: 'vg:terminal-execute',
13
13
  FEATURE_TOGGLE: 'vg:feature-toggle',
14
+ COPY_PROMPT: 'vg:copy-prompt',
14
15
  };
15
16
 
16
17
  /**
@@ -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
+ }