deepseek-coder-agent-cli 1.0.27 → 1.0.29

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.
Files changed (40) hide show
  1. package/dist/contracts/agent-schemas.json +14 -0
  2. package/dist/core/hitl.d.ts.map +1 -1
  3. package/dist/core/hitl.js +52 -8
  4. package/dist/core/hitl.js.map +1 -1
  5. package/dist/core/modelDiscovery.d.ts.map +1 -1
  6. package/dist/core/modelDiscovery.js +23 -0
  7. package/dist/core/modelDiscovery.js.map +1 -1
  8. package/dist/core/shutdown.d.ts +34 -0
  9. package/dist/core/shutdown.d.ts.map +1 -0
  10. package/dist/core/shutdown.js +172 -0
  11. package/dist/core/shutdown.js.map +1 -0
  12. package/dist/headless/interactiveShell.d.ts.map +1 -1
  13. package/dist/headless/interactiveShell.js +11 -3
  14. package/dist/headless/interactiveShell.js.map +1 -1
  15. package/dist/headless/quickMode.d.ts.map +1 -1
  16. package/dist/headless/quickMode.js +3 -0
  17. package/dist/headless/quickMode.js.map +1 -1
  18. package/dist/plugins/providers/anthropic/index.d.ts +9 -0
  19. package/dist/plugins/providers/anthropic/index.d.ts.map +1 -0
  20. package/dist/plugins/providers/anthropic/index.js +48 -0
  21. package/dist/plugins/providers/anthropic/index.js.map +1 -0
  22. package/dist/plugins/providers/index.d.ts.map +1 -1
  23. package/dist/plugins/providers/index.js +7 -1
  24. package/dist/plugins/providers/index.js.map +1 -1
  25. package/dist/plugins/providers/openai/index.d.ts +10 -0
  26. package/dist/plugins/providers/openai/index.d.ts.map +1 -0
  27. package/dist/plugins/providers/openai/index.js +47 -0
  28. package/dist/plugins/providers/openai/index.js.map +1 -0
  29. package/dist/plugins/providers/xai/index.d.ts +10 -0
  30. package/dist/plugins/providers/xai/index.d.ts.map +1 -0
  31. package/dist/plugins/providers/xai/index.js +47 -0
  32. package/dist/plugins/providers/xai/index.js.map +1 -0
  33. package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -1
  34. package/dist/providers/openaiChatCompletionsProvider.js +3 -0
  35. package/dist/providers/openaiChatCompletionsProvider.js.map +1 -1
  36. package/dist/ui/UnifiedUIRenderer.d.ts +3 -6
  37. package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
  38. package/dist/ui/UnifiedUIRenderer.js +58 -7
  39. package/dist/ui/UnifiedUIRenderer.js.map +1 -1
  40. package/package.json +1 -1
@@ -3221,16 +3221,67 @@ export class UnifiedUIRenderer extends EventEmitter {
3221
3221
  return theme.info(summary);
3222
3222
  }
3223
3223
  /**
3224
- * Format edit result with enhanced inline diff preview
3225
- * Shows: Updated (filename) - removed X, added Y chars
3226
- * ├─┐
3227
- * │ - old content...
3228
- * │ + new content...
3229
- * └─
3224
+ * Format edit result with inline diff preview
3225
+ * The edit tool already outputs formatted diffs, so we detect and pass through
3226
+ * or format from old_string/new_string if that format is used
3230
3227
  */
3231
3228
  formatEditResultWithDiff(content) {
3232
- const lines = [];
3233
3229
  const indent = ' ';
3230
+ // Check if content is already formatted by the edit tool (has ⏺ Update or ⏺ Create prefix)
3231
+ // The edit tool outputs: ⏺ Update(path)\n ⎿ Updated path with X additions\n [diff lines]
3232
+ if (content.match(/^⏺\s*(Update|Create)\s*\(/)) {
3233
+ // Already formatted - extract and display the diff portion
3234
+ const lines = content.split('\n');
3235
+ const result = [];
3236
+ // Extract file info from first line: ⏺ Update(filepath)
3237
+ const headerMatch = lines[0]?.match(/^⏺\s*(Update|Create)\s*\(([^)]+)\)/);
3238
+ const action = headerMatch?.[1] || 'Edit';
3239
+ const filePath = headerMatch?.[2] || 'file';
3240
+ const fileName = filePath.split('/').pop() || filePath;
3241
+ // Find diff lines (lines with + or - prefix that are colored)
3242
+ const diffLines = lines.filter(line => line.includes('\x1b[1;32m') || // green (additions)
3243
+ line.includes('\x1b[1;31m') || // red (removals)
3244
+ line.match(/^\s+\d+\s*[+-]/) // line number followed by +/-
3245
+ );
3246
+ // Extract summary from second line if present
3247
+ const summaryLine = lines[1];
3248
+ const summaryMatch = summaryLine?.match(/Updated.*?with\s+(.+)/i) ||
3249
+ summaryLine?.match(/Created.*?with\s+(.+)/i);
3250
+ const summary = summaryMatch?.[1] || '';
3251
+ // Build compact display with actual diff preview
3252
+ result.push(`${indent}${theme.ui.muted('⎿')} ${theme.success('✓')} ${theme.success(action)} ${theme.file?.path ? theme.file.path(fileName) : theme.warning(fileName)}${summary ? theme.ui.muted(` (${summary})`) : ''}`);
3253
+ // Show up to 4 diff lines
3254
+ const maxDiffLines = 4;
3255
+ const diffPreview = diffLines.slice(0, maxDiffLines);
3256
+ if (diffPreview.length > 0) {
3257
+ for (const line of diffPreview) {
3258
+ // The line already has ANSI colors, just add proper indent
3259
+ const trimmed = line.trim();
3260
+ if (trimmed) {
3261
+ result.push(`${indent}${theme.ui.muted('│')} ${trimmed}`);
3262
+ }
3263
+ }
3264
+ if (diffLines.length > maxDiffLines) {
3265
+ result.push(`${indent}${theme.ui.muted('│')} ${theme.ui.muted(`... +${diffLines.length - maxDiffLines} more`)}`);
3266
+ }
3267
+ }
3268
+ // Store for expansion
3269
+ this.collapsedToolResults.push({
3270
+ toolName: 'edit',
3271
+ content,
3272
+ summary: `${action} ${fileName}`,
3273
+ timestamp: Date.now(),
3274
+ metadata: { filePath }
3275
+ });
3276
+ if (this.collapsedToolResults.length > this.maxCollapsedResults) {
3277
+ this.collapsedToolResults.shift();
3278
+ }
3279
+ const hasMore = lines.length > 6 || diffLines.length > maxDiffLines;
3280
+ const expandHint = hasMore ? ` ${theme.ui.muted('(ctrl+o to expand)')}` : '';
3281
+ return result.join('\n') + expandHint + '\n';
3282
+ }
3283
+ // Fallback: try to parse old_string/new_string format (legacy or raw API format)
3284
+ const lines = [];
3234
3285
  // Extract file path from content with better regex
3235
3286
  const filePathMatch = content.match(/(?:file[_\s]*path|path):\s*"([^"]+)"/i) ||
3236
3287
  content.match(/updated.*?([\/\w.\-]+\.\w+)/i) ||