agent-termo 1.0.0 → 1.0.2

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 (65) hide show
  1. package/README.md +30 -11
  2. package/dist/agents/index.d.ts +5 -0
  3. package/dist/agents/index.d.ts.map +1 -0
  4. package/dist/agents/index.js +86 -0
  5. package/dist/agents/index.js.map +1 -0
  6. package/dist/cli.d.ts +3 -0
  7. package/dist/cli.d.ts.map +1 -0
  8. package/dist/cli.js +97 -164
  9. package/dist/cli.js.map +4 -4
  10. package/dist/diff/index.d.ts +9 -0
  11. package/dist/diff/index.d.ts.map +1 -0
  12. package/dist/diff/index.js +213 -0
  13. package/dist/diff/index.js.map +1 -0
  14. package/dist/llm/client.d.ts +39 -0
  15. package/dist/llm/client.d.ts.map +1 -0
  16. package/dist/llm/client.js +188 -0
  17. package/dist/llm/client.js.map +1 -0
  18. package/dist/llm/models.d.ts +19 -0
  19. package/dist/llm/models.d.ts.map +1 -0
  20. package/dist/llm/models.js +45 -0
  21. package/dist/llm/models.js.map +1 -0
  22. package/dist/llm/tools.d.ts +3 -0
  23. package/dist/llm/tools.d.ts.map +1 -0
  24. package/dist/llm/tools.js +204 -0
  25. package/dist/llm/tools.js.map +1 -0
  26. package/dist/main.d.ts +2 -0
  27. package/dist/main.d.ts.map +1 -0
  28. package/dist/main.js +91 -140
  29. package/dist/main.js.map +4 -4
  30. package/dist/memory/index.d.ts +10 -0
  31. package/dist/memory/index.d.ts.map +1 -0
  32. package/dist/memory/index.js +117 -0
  33. package/dist/memory/index.js.map +1 -0
  34. package/dist/tools/index.d.ts +5 -0
  35. package/dist/tools/index.d.ts.map +1 -0
  36. package/dist/tools/index.js +334 -0
  37. package/dist/tools/index.js.map +1 -0
  38. package/dist/types/index.d.ts +119 -0
  39. package/dist/types/index.d.ts.map +1 -0
  40. package/dist/types/index.js +5 -0
  41. package/dist/types/index.js.map +1 -0
  42. package/dist/ui/index.d.ts +47 -0
  43. package/dist/ui/index.d.ts.map +1 -0
  44. package/dist/ui/index.js +321 -0
  45. package/dist/ui/index.js.map +1 -0
  46. package/dist/ui/screen.d.ts +59 -0
  47. package/dist/ui/screen.d.ts.map +1 -0
  48. package/dist/ui/screen.js +629 -0
  49. package/dist/ui/screen.js.map +1 -0
  50. package/dist/utils/ansi.d.ts +62 -0
  51. package/dist/utils/ansi.d.ts.map +1 -0
  52. package/dist/utils/ansi.js +116 -0
  53. package/dist/utils/ansi.js.map +1 -0
  54. package/dist/utils/config.d.ts +9 -0
  55. package/dist/utils/config.d.ts.map +1 -0
  56. package/dist/utils/config.js +120 -0
  57. package/dist/utils/config.js.map +1 -0
  58. package/package.json +2 -2
  59. package/src/cli.ts +91 -12
  60. package/src/llm/client.ts +24 -0
  61. package/src/llm/models.ts +55 -0
  62. package/src/main.ts +201 -75
  63. package/src/ui/index.ts +256 -389
  64. package/src/ui/screen.ts +698 -0
  65. package/src/utils/config.ts +62 -2
@@ -0,0 +1,204 @@
1
+ // =============================================================================
2
+ // Tool Definitions (OpenAI function calling schema)
3
+ // These are matched to the actual tools implemented in src/tools/
4
+ // =============================================================================
5
+ export const TOOL_DEFINITIONS = [
6
+ // ── File Operations ──────────────────────────────────────────────────────────
7
+ {
8
+ name: 'file:read',
9
+ description: 'Read the complete contents of a file. Use for examining existing code, config, or documentation.',
10
+ parameters: {
11
+ type: 'object',
12
+ properties: {
13
+ path: {
14
+ type: 'string',
15
+ description: 'File path (absolute or relative to project root)',
16
+ },
17
+ limit: {
18
+ type: 'number',
19
+ description: 'Maximum number of lines to read (0 = all)',
20
+ default: 0,
21
+ },
22
+ offset: {
23
+ type: 'number',
24
+ description: 'Line offset to start reading from (0 = start)',
25
+ default: 0,
26
+ },
27
+ },
28
+ required: ['path'],
29
+ },
30
+ },
31
+ {
32
+ name: 'file:write',
33
+ description: 'Write or overwrite a complete file. Use this to create new files or replace existing ones entirely.',
34
+ parameters: {
35
+ type: 'object',
36
+ properties: {
37
+ path: {
38
+ type: 'string',
39
+ description: 'File path to write (relative to project root)',
40
+ },
41
+ content: {
42
+ type: 'string',
43
+ description: 'Complete file content to write',
44
+ },
45
+ },
46
+ required: ['path', 'content'],
47
+ },
48
+ },
49
+ {
50
+ name: 'file:edit',
51
+ description: 'Edit an existing file by replacing an exact section. The old_string must appear verbatim in the file.',
52
+ parameters: {
53
+ type: 'object',
54
+ properties: {
55
+ path: {
56
+ type: 'string',
57
+ description: 'File to edit',
58
+ },
59
+ old_string: {
60
+ type: 'string',
61
+ description: 'Exact text to find and replace (must be unique in file)',
62
+ },
63
+ new_string: {
64
+ type: 'string',
65
+ description: 'Replacement text',
66
+ },
67
+ },
68
+ required: ['path', 'old_string', 'new_string'],
69
+ },
70
+ },
71
+ {
72
+ name: 'file:glob',
73
+ description: 'Find all files matching a glob pattern. Use to discover project structure.',
74
+ parameters: {
75
+ type: 'object',
76
+ properties: {
77
+ pattern: {
78
+ type: 'string',
79
+ description: 'Glob pattern (e.g. "src/**/*.ts", "**/*.json")',
80
+ },
81
+ cwd: {
82
+ type: 'string',
83
+ description: 'Root directory to search in (defaults to project root)',
84
+ },
85
+ },
86
+ required: ['pattern'],
87
+ },
88
+ },
89
+ {
90
+ name: 'grep',
91
+ description: 'Search for text or regex patterns inside files. Use to find function definitions, imports, etc.',
92
+ parameters: {
93
+ type: 'object',
94
+ properties: {
95
+ pattern: {
96
+ type: 'string',
97
+ description: 'Text or regex pattern to search for',
98
+ },
99
+ path: {
100
+ type: 'string',
101
+ description: 'File or directory to search in',
102
+ },
103
+ glob: {
104
+ type: 'string',
105
+ description: 'Only search files matching this glob pattern',
106
+ },
107
+ case_sensitive: {
108
+ type: 'boolean',
109
+ description: 'Case sensitive search (default true)',
110
+ default: true,
111
+ },
112
+ },
113
+ required: ['pattern', 'path'],
114
+ },
115
+ },
116
+ // ── Bash ───────────────────────────────────────────────────────────────────
117
+ {
118
+ name: 'bash:execute',
119
+ description: 'Execute a shell command and return its stdout/stderr output. Destructive commands (rm, dd) require user confirmation.',
120
+ parameters: {
121
+ type: 'object',
122
+ properties: {
123
+ command: {
124
+ type: 'string',
125
+ description: 'Shell command to execute',
126
+ },
127
+ cwd: {
128
+ type: 'string',
129
+ description: 'Working directory (defaults to project root)',
130
+ },
131
+ timeout: {
132
+ type: 'number',
133
+ description: 'Timeout in milliseconds (default 300000)',
134
+ default: 300000,
135
+ },
136
+ },
137
+ required: ['command'],
138
+ },
139
+ },
140
+ // ── Git ────────────────────────────────────────────────────────────────────
141
+ {
142
+ name: 'git:status',
143
+ description: 'Show the git working tree status (modified, staged, untracked files).',
144
+ parameters: {
145
+ type: 'object',
146
+ properties: {
147
+ cwd: {
148
+ type: 'string',
149
+ description: 'Repository root (default: project root)',
150
+ },
151
+ },
152
+ },
153
+ },
154
+ {
155
+ name: 'git:commit',
156
+ description: 'Stage and commit all changes with a conventional commit message.',
157
+ parameters: {
158
+ type: 'object',
159
+ properties: {
160
+ message: {
161
+ type: 'string',
162
+ description: 'Conventional commit message (e.g. "feat: add login page")',
163
+ },
164
+ cwd: {
165
+ type: 'string',
166
+ description: 'Repository root (default: project root)',
167
+ },
168
+ },
169
+ required: ['message'],
170
+ },
171
+ },
172
+ {
173
+ name: 'git:push',
174
+ description: 'Push the current branch to the remote repository.',
175
+ parameters: {
176
+ type: 'object',
177
+ properties: {
178
+ cwd: {
179
+ type: 'string',
180
+ description: 'Repository root (default: project root)',
181
+ },
182
+ },
183
+ },
184
+ },
185
+ {
186
+ name: 'git:log',
187
+ description: 'Show recent git commit history.',
188
+ parameters: {
189
+ type: 'object',
190
+ properties: {
191
+ cwd: {
192
+ type: 'string',
193
+ description: 'Repository root (default: project root)',
194
+ },
195
+ limit: {
196
+ type: 'number',
197
+ description: 'Number of commits to show (default: 20)',
198
+ default: 20,
199
+ },
200
+ },
201
+ },
202
+ },
203
+ ];
204
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/llm/tools.ts"],"names":[],"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@@
1
+ export declare function runRepl(projectRoot?: string): Promise<void>;
2
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAqRA,wBAAsB,OAAO,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4LjE"}