@phuetz/code-buddy 0.2.0 → 0.4.0

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 (54) hide show
  1. package/dist/agent/execution/agent-executor.js +2 -2
  2. package/dist/agent/execution/agent-executor.js.map +1 -1
  3. package/dist/agent/lessons-tracker.d.ts +10 -0
  4. package/dist/agent/lessons-tracker.js +53 -0
  5. package/dist/agent/lessons-tracker.js.map +1 -1
  6. package/dist/commands/client-dispatcher.js +22 -1
  7. package/dist/commands/client-dispatcher.js.map +1 -1
  8. package/dist/commands/enhanced-command-handler.js +3 -1
  9. package/dist/commands/enhanced-command-handler.js.map +1 -1
  10. package/dist/commands/handlers/index.d.ts +1 -0
  11. package/dist/commands/handlers/index.js +2 -0
  12. package/dist/commands/handlers/index.js.map +1 -1
  13. package/dist/commands/handlers/lessons-handler.d.ts +2 -0
  14. package/dist/commands/handlers/lessons-handler.js +63 -0
  15. package/dist/commands/handlers/lessons-handler.js.map +1 -0
  16. package/dist/commands/handlers/persona-handler.d.ts +11 -0
  17. package/dist/commands/handlers/persona-handler.js +117 -0
  18. package/dist/commands/handlers/persona-handler.js.map +1 -0
  19. package/dist/commands/lessons.js +58 -0
  20. package/dist/commands/lessons.js.map +1 -1
  21. package/dist/commands/slash/builtin-commands.js +27 -0
  22. package/dist/commands/slash/builtin-commands.js.map +1 -1
  23. package/dist/i18n/index.d.ts +5 -1
  24. package/dist/i18n/index.js +377 -5
  25. package/dist/i18n/index.js.map +1 -1
  26. package/dist/index.js +0 -0
  27. package/dist/interpreter/computer/skills.d.ts +4 -0
  28. package/dist/interpreter/computer/skills.js +56 -4
  29. package/dist/interpreter/computer/skills.js.map +1 -1
  30. package/dist/memory/semantic-memory-search.js +6 -4
  31. package/dist/memory/semantic-memory-search.js.map +1 -1
  32. package/dist/observability/run-store.d.ts +10 -1
  33. package/dist/observability/run-store.js +21 -0
  34. package/dist/observability/run-store.js.map +1 -1
  35. package/dist/optimization/cache-breakpoints.d.ts +2 -2
  36. package/dist/personas/persona-manager.d.ts +6 -1
  37. package/dist/personas/persona-manager.js +49 -1
  38. package/dist/personas/persona-manager.js.map +1 -1
  39. package/dist/prompts/system-base.js +8 -18
  40. package/dist/prompts/system-base.js.map +1 -1
  41. package/dist/tools/registry/attention-tools.d.ts +2 -2
  42. package/dist/tools/registry/attention-tools.js +14 -10
  43. package/dist/tools/registry/attention-tools.js.map +1 -1
  44. package/dist/tools/registry/lessons-tools.d.ts +4 -4
  45. package/dist/tools/registry/lessons-tools.js +36 -19
  46. package/dist/tools/registry/lessons-tools.js.map +1 -1
  47. package/dist/tools/registry/tool-aliases.js +16 -10
  48. package/dist/tools/registry/tool-aliases.js.map +1 -1
  49. package/dist/tools/web-search.js +34 -5
  50. package/dist/tools/web-search.js.map +1 -1
  51. package/package.json +1 -1
  52. package/dist/tools/bash.d.ts +0 -128
  53. package/dist/tools/bash.js +0 -973
  54. package/dist/tools/bash.js.map +0 -1
@@ -1,128 +0,0 @@
1
- import { ToolResult } from '../types/index.js';
2
- import { SelfHealingEngine } from '../utils/self-healing.js';
3
- import { Disposable } from '../utils/disposable.js';
4
- /**
5
- * Bash Tool
6
- *
7
- * Executes shell commands with comprehensive security measures:
8
- * - Blocked dangerous patterns (rm -rf /, fork bombs, etc.)
9
- * - Protected paths (~/.ssh, ~/.aws, /etc/shadow, etc.)
10
- * - User confirmation for commands (unless session-approved)
11
- * - Self-healing: automatic error recovery for common failures
12
- * - Process isolation via spawn with process group management
13
- * - Graceful termination with SIGTERM before SIGKILL
14
- *
15
- * Security modes are controlled by SandboxManager configuration.
16
- * Self-healing can be disabled via --no-self-heal flag.
17
- */
18
- export declare class BashTool implements Disposable {
19
- private currentDirectory;
20
- private confirmationService;
21
- private sandboxManager;
22
- private selfHealingEngine;
23
- private selfHealingEnabled;
24
- private runningProcesses;
25
- constructor();
26
- /**
27
- * Clean up resources - kill any running processes
28
- */
29
- dispose(): void;
30
- /**
31
- * Validate command for dangerous patterns
32
- *
33
- * Security checks performed (in order):
34
- * 1. Control characters - blocks terminal manipulation
35
- * 2. ANSI escape sequences - blocks display manipulation
36
- * 3. Shell bypass features - blocks process substitution, here-strings, etc.
37
- * 4. Base command blocklist - blocks known dangerous commands
38
- * 5. Blocked command patterns - blocks known dangerous patterns
39
- * 6. Protected paths - blocks access to sensitive directories
40
- * 7. Sandbox manager validation - additional runtime checks
41
- */
42
- private validateCommand;
43
- /**
44
- * Filter environment variables to only include safe ones
45
- * This prevents credential leakage to child processes
46
- *
47
- * Security measures:
48
- * - Only allowlisted variable names are passed through
49
- * - Values containing shell metacharacters are sanitized
50
- * - Values that look like secrets are excluded
51
- */
52
- private getFilteredEnv;
53
- /**
54
- * Execute a command with streaming output.
55
- * Yields each line of stdout/stderr as it arrives.
56
- * Validates and confirms the command before execution.
57
- */
58
- executeStreaming(command: string, timeout?: number): AsyncGenerator<string, ToolResult, undefined>;
59
- /**
60
- * Execute a command using spawn with process group isolation (safer than exec)
61
- * Inspired by mistral-vibe's robust process handling
62
- */
63
- private executeWithSpawn;
64
- /**
65
- * Execute a shell command
66
- *
67
- * Validates command safety, requests user confirmation, and executes
68
- * via spawn with process isolation. Failed commands trigger self-healing
69
- * attempts if enabled.
70
- *
71
- * Special handling for `cd` commands to update working directory state.
72
- *
73
- * @param command - Shell command to execute
74
- * @param timeout - Maximum execution time in ms (default: 30000)
75
- * @returns Command output or error message; test output is parsed and structured
76
- *
77
- * @example
78
- * // Simple command
79
- * await bash.execute('ls -la');
80
- *
81
- * // With custom timeout (2 minutes)
82
- * await bash.execute('npm install', 120000);
83
- */
84
- execute(command: string, timeout?: number): Promise<ToolResult>;
85
- /**
86
- * Enable or disable self-healing
87
- */
88
- setSelfHealing(enabled: boolean): void;
89
- /**
90
- * Check if self-healing is enabled
91
- */
92
- isSelfHealingEnabled(): boolean;
93
- /**
94
- * Get self-healing engine for configuration
95
- */
96
- getSelfHealingEngine(): SelfHealingEngine;
97
- getCurrentDirectory(): string;
98
- /**
99
- * Escape shell argument to prevent command injection
100
- */
101
- private escapeShellArg;
102
- /**
103
- * List files in a directory (wrapper for `ls -la`)
104
- *
105
- * @param directory - Directory path to list (default: current directory)
106
- * @returns Formatted directory listing or error
107
- */
108
- listFiles(directory?: string): Promise<ToolResult>;
109
- /**
110
- * Find files matching a pattern (wrapper for `find -name -type f`)
111
- *
112
- * @param pattern - Glob pattern to match (e.g., "*.ts", "package.json")
113
- * @param directory - Directory to search in (default: current directory)
114
- * @returns List of matching file paths or error
115
- */
116
- findFiles(pattern: string, directory?: string): Promise<ToolResult>;
117
- /**
118
- * Search for a pattern in files using ripgrep
119
- *
120
- * Uses @vscode/ripgrep for ultra-fast searching. Results are limited
121
- * to 100 matches for performance.
122
- *
123
- * @param pattern - Regex pattern to search for
124
- * @param files - File or directory to search in (default: current directory)
125
- * @returns Matching lines with file paths and line numbers, or error
126
- */
127
- grep(pattern: string, files?: string): Promise<ToolResult>;
128
- }