vg-coder-cli 2.0.44 → 2.0.45

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vg-coder-cli",
3
- "version": "2.0.44",
3
+ "version": "2.0.45",
4
4
  "description": "🚀 CLI tool to analyze projects, concatenate source files, count tokens, and export HTML with syntax highlighting and copy functionality",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -176,6 +176,7 @@
176
176
  .agent-file-list {
177
177
  display: flex;
178
178
  flex-wrap: wrap;
179
+ gap: 8px;
179
180
  }
180
181
 
181
182
  .agent-file-badge {
@@ -185,21 +186,43 @@
185
186
  background: #3f3f46;
186
187
  padding: 4px 8px;
187
188
  border-radius: 4px;
188
- margin-right: 6px;
189
- margin-bottom: 4px;
190
189
  font-size: 11px;
191
190
  color: #e4e4e7;
191
+ max-width: 100%;
192
+ }
193
+
194
+ .agent-file-badge.has-preview {
195
+ padding: 4px;
196
+ gap: 8px;
197
+ }
198
+
199
+ .agent-file-preview {
200
+ width: 40px;
201
+ height: 40px;
202
+ object-fit: cover;
203
+ border-radius: 4px;
204
+ border: 1px solid #52525b;
205
+ flex-shrink: 0;
206
+ }
207
+
208
+ .agent-file-info {
209
+ display: flex;
210
+ flex-direction: column;
211
+ gap: 2px;
212
+ min-width: 0;
213
+ flex: 1;
192
214
  }
193
215
 
194
216
  .agent-file-name {
195
- max-width: 150px;
196
217
  overflow: hidden;
197
218
  text-overflow: ellipsis;
198
219
  white-space: nowrap;
220
+ max-width: 150px;
199
221
  }
200
222
 
201
223
  .agent-file-size {
202
224
  color: #a1a1aa;
225
+ font-size: 10px;
203
226
  }
204
227
 
205
228
  .agent-file-remove {
@@ -208,9 +231,16 @@
208
231
  color: #ef4444;
209
232
  cursor: pointer;
210
233
  font-weight: bold;
211
- padding: 0 2px;
212
- font-size: 14px;
234
+ padding: 0 4px;
235
+ font-size: 16px;
213
236
  line-height: 1;
237
+ flex-shrink: 0;
238
+ transition: all 0.2s;
239
+ }
240
+
241
+ .agent-file-remove:hover {
242
+ color: #dc2626;
243
+ transform: scale(1.2);
214
244
  }
215
245
 
216
246
  /* Textarea */
@@ -159,6 +159,46 @@ function attachEventListeners() {
159
159
  this.style.height = Math.min(this.scrollHeight, 120) + 'px';
160
160
  }
161
161
  });
162
+
163
+ // Paste event - Handle images from clipboard
164
+ input.addEventListener('paste', async (e) => {
165
+ if (isProcessing) return;
166
+
167
+ const items = e.clipboardData?.items;
168
+ if (!items) return;
169
+
170
+ // Check for image items
171
+ const imageItems = Array.from(items).filter(item =>
172
+ item.type.startsWith('image/')
173
+ );
174
+
175
+ if (imageItems.length === 0) return;
176
+
177
+ // Prevent default paste for images
178
+ e.preventDefault();
179
+
180
+ // Process all images
181
+ for (const item of imageItems) {
182
+ const blob = item.getAsFile();
183
+ if (!blob) continue;
184
+
185
+ // Create a File object with a proper name
186
+ const timestamp = Date.now();
187
+ const extension = blob.type.split('/')[1] || 'png';
188
+ const file = new File(
189
+ [blob],
190
+ `pasted-image-${timestamp}.${extension}`,
191
+ { type: blob.type }
192
+ );
193
+
194
+ // Add to selected files
195
+ selectedFiles.push(file);
196
+ console.log('[AgentPanel] Image pasted:', file.name, file.type, `${(file.size/1024).toFixed(1)}KB`);
197
+ }
198
+
199
+ // Update UI to show pasted images
200
+ renderFileList();
201
+ });
162
202
  }
163
203
 
164
204
  // File button
@@ -625,13 +665,21 @@ function renderFileList() {
625
665
  const listContainer = getById('agent-file-list');
626
666
  if (!listContainer) return;
627
667
 
628
- listContainer.innerHTML = selectedFiles.map((file, index) => `
629
- <div class="agent-file-badge">
630
- <span class="agent-file-name">📎 ${file.name}</span>
631
- <span class="agent-file-size">(${(file.size / 1024).toFixed(0)}KB)</span>
632
- <button class="agent-file-remove" onclick="window.removeAgentFile(${index})">×</button>
633
- </div>
634
- `).join('');
668
+ listContainer.innerHTML = selectedFiles.map((file, index) => {
669
+ const isImage = file.type.startsWith('image/');
670
+ const fileUrl = isImage ? URL.createObjectURL(file) : '';
671
+
672
+ return `
673
+ <div class="agent-file-badge ${isImage ? 'has-preview' : ''}">
674
+ ${isImage ? `<img class="agent-file-preview" src="${fileUrl}" alt="${file.name}" />` : '📎'}
675
+ <div class="agent-file-info">
676
+ <span class="agent-file-name">${file.name}</span>
677
+ <span class="agent-file-size">(${(file.size / 1024).toFixed(0)}KB)</span>
678
+ </div>
679
+ <button class="agent-file-remove" onclick="window.removeAgentFile(${index})">×</button>
680
+ </div>
681
+ `;
682
+ }).join('');
635
683
  }
636
684
 
637
685
  /**