@compilr-dev/agents 0.3.16 → 0.3.18

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.
@@ -19,8 +19,8 @@ const DEFAULT_MAX_CONTENT_SIZE = 100 * 1024;
19
19
  export const readFileTool = defineTool({
20
20
  name: 'read_file',
21
21
  readonly: true,
22
- description: 'Read the contents of a file. Returns the file content as text. ' +
23
- 'Use maxLines and startLine to read specific portions of large files.',
22
+ // Original: 'Read the contents of a file. Returns the file content as text. Use maxLines and startLine to read specific portions of large files.'
23
+ description: 'Read file contents. Use maxLines/startLine for large files.',
24
24
  inputSchema: {
25
25
  type: 'object',
26
26
  properties: {
@@ -30,7 +30,8 @@ export const readFileTool = defineTool({
30
30
  },
31
31
  encoding: {
32
32
  type: 'string',
33
- description: 'File encoding (default: utf-8)',
33
+ description: 'File encoding',
34
+ default: 'utf-8',
34
35
  },
35
36
  maxLines: {
36
37
  type: 'number',
@@ -139,30 +140,8 @@ export function createReadFileTool(options) {
139
140
  return defineTool({
140
141
  name: 'read_file',
141
142
  readonly: true,
142
- description: 'Read the contents of a file. Returns the file content as text. ' +
143
- 'Use maxLines and startLine to read specific portions of large files.',
144
- inputSchema: {
145
- type: 'object',
146
- properties: {
147
- path: {
148
- type: 'string',
149
- description: 'Absolute or relative path to the file',
150
- },
151
- encoding: {
152
- type: 'string',
153
- description: 'File encoding (default: utf-8)',
154
- },
155
- maxLines: {
156
- type: 'number',
157
- description: 'Maximum number of lines to read',
158
- },
159
- startLine: {
160
- type: 'number',
161
- description: 'Line number to start reading from (1-indexed)',
162
- },
163
- },
164
- required: ['path'],
165
- },
143
+ description: readFileTool.definition.description,
144
+ inputSchema: readFileTool.definition.inputSchema,
166
145
  execute: async (input) => {
167
146
  const { baseDir, allowedExtensions, maxFileSize, maxContentSize, truncateIfLarge } = options ?? {};
168
147
  let filePath = input.path;
@@ -12,9 +12,8 @@ export function createRecallResultTool(options) {
12
12
  const { store, onEvent } = options;
13
13
  return defineTool({
14
14
  name: 'recall_full_result',
15
- description: 'Retrieve the full output of a previously delegated tool result. ' +
16
- 'Use when a summary is insufficient and you need the complete data. ' +
17
- 'Results expire after 10 minutes.',
15
+ // Original: 'Retrieve the full output of a previously delegated tool result. Use when a summary is insufficient and you need the complete data. Results expire after 10 minutes.'
16
+ description: 'Retrieve full output of a delegated tool result. Results expire after 10 minutes.',
18
17
  inputSchema: {
19
18
  type: 'object',
20
19
  properties: {
@@ -15,11 +15,8 @@ import { defineTool, createSuccessResult } from '../define.js';
15
15
  */
16
16
  export const suggestTool = defineTool({
17
17
  name: 'suggest',
18
- description: 'Suggest a next action for the user. The suggestion appears as ghost text in the input prompt. ' +
19
- 'Use this after completing a task to guide the user toward a logical next step. ' +
20
- 'Good suggestions are actionable, specific, and follow naturally from what you just did. ' +
21
- 'Examples: "run npm test to verify the fix", "review the changes in src/index.ts", ' +
22
- '"commit the changes with git commit". Only suggest when there is a clear, helpful next step.',
18
+ // Original: 'Suggest a next action for the user. The suggestion appears as ghost text in the input prompt. Use this after completing a task to guide the user toward a logical next step. Good suggestions are actionable, specific, and follow naturally from what you just did. Examples: "run npm test to verify the fix", "review the changes in src/index.ts", "commit the changes with git commit". Only suggest when there is a clear, helpful next step.'
19
+ description: 'Suggest a next action as ghost text in the input prompt. Use after completing a task.',
23
20
  inputSchema: {
24
21
  type: 'object',
25
22
  properties: {
@@ -61,25 +58,8 @@ export function createSuggestTool(options = {}) {
61
58
  const { onSuggest } = options;
62
59
  return defineTool({
63
60
  name: 'suggest',
64
- description: 'Suggest a next action for the user. The suggestion appears as ghost text in the input prompt. ' +
65
- 'Use this after completing a task to guide the user toward a logical next step. ' +
66
- 'Good suggestions are actionable, specific, and follow naturally from what you just did. ' +
67
- 'Examples: "run npm test to verify the fix", "review the changes in src/index.ts", ' +
68
- '"commit the changes with git commit". Only suggest when there is a clear, helpful next step.',
69
- inputSchema: {
70
- type: 'object',
71
- properties: {
72
- action: {
73
- type: 'string',
74
- description: 'The suggested action or command for the user to take next',
75
- },
76
- reason: {
77
- type: 'string',
78
- description: 'Brief explanation of why this action is suggested (optional)',
79
- },
80
- },
81
- required: ['action'],
82
- },
61
+ description: suggestTool.definition.description,
62
+ inputSchema: suggestTool.definition.inputSchema,
83
63
  execute: (input) => {
84
64
  // Emit the suggest event if handler is configured
85
65
  if (onSuggest) {
@@ -158,10 +158,9 @@ const defaultStore = new TodoStore();
158
158
  */
159
159
  export const todoWriteTool = defineTool({
160
160
  name: 'todo_write',
161
- description: 'Update the SESSION todo list (shown in CLI footer). These are ephemeral tasks for the current session only - ' +
162
- 'NOT persistent backlog items. For persistent project backlog, use workitem_* tools. ' +
163
- 'Provide the complete list to replace current todos. ' +
164
- 'Use blockedBy to declare task dependencies (1-based positions in the array).',
161
+ // Original: 'Update the SESSION todo list (shown in CLI footer). These are ephemeral tasks for the current session only - NOT persistent backlog items. For persistent project backlog, use workitem_* tools. Provide the complete list to replace current todos. Use blockedBy to declare task dependencies (1-based positions in the array).'
162
+ description: 'Replace the session todo list (ephemeral, shown in footer). ' +
163
+ 'For persistent backlog, use workitem_* tools.',
165
164
  inputSchema: {
166
165
  type: 'object',
167
166
  properties: {
@@ -229,8 +228,8 @@ export const todoWriteTool = defineTool({
229
228
  export const todoReadTool = defineTool({
230
229
  name: 'todo_read',
231
230
  readonly: true,
232
- description: 'Get the SESSION todo list (shown in CLI footer). These are ephemeral session tasks - ' +
233
- 'for persistent project backlog, use workitem_query. Optionally filter by status or owner.',
231
+ // Original: 'Get the SESSION todo list (shown in CLI footer). These are ephemeral session tasks - for persistent project backlog, use workitem_query. Optionally filter by status or owner.'
232
+ description: 'Get the session todo list. For persistent backlog, use workitem_query.',
234
233
  inputSchema: {
235
234
  type: 'object',
236
235
  properties: {
@@ -241,7 +240,8 @@ export const todoReadTool = defineTool({
241
240
  },
242
241
  includeCompleted: {
243
242
  type: 'boolean',
244
- description: 'Include completed tasks (default: true)',
243
+ description: 'Include completed tasks',
244
+ default: true,
245
245
  },
246
246
  owner: {
247
247
  type: 'string',
@@ -291,9 +291,7 @@ export function createTodoTools(store) {
291
291
  const todoStore = store ?? new TodoStore();
292
292
  const todoWrite = defineTool({
293
293
  name: 'todo_write',
294
- description: 'Update the SESSION todo list (shown in CLI footer). These are ephemeral tasks for the current session only - ' +
295
- 'NOT persistent backlog items. For persistent project backlog, use workitem_* tools. ' +
296
- 'Use blockedBy to declare task dependencies (1-based positions in the array).',
294
+ description: todoWriteTool.definition.description,
297
295
  inputSchema: {
298
296
  type: 'object',
299
297
  properties: {
@@ -342,8 +340,7 @@ export function createTodoTools(store) {
342
340
  const todoRead = defineTool({
343
341
  name: 'todo_read',
344
342
  readonly: true,
345
- description: 'Get the SESSION todo list (shown in CLI footer). These are ephemeral session tasks - ' +
346
- 'for persistent project backlog, use workitem_query.',
343
+ description: todoReadTool.definition.description,
347
344
  inputSchema: {
348
345
  type: 'object',
349
346
  properties: {
@@ -395,7 +392,8 @@ export function createTodoTools(store) {
395
392
  });
396
393
  const todoClaim = defineTool({
397
394
  name: 'todo_claim',
398
- description: 'Claim an unassigned SESSION todo (from CLI footer). For persistent backlog items, use workitem_claim.',
395
+ // Original: 'Claim an unassigned SESSION todo (from CLI footer). For persistent backlog items, use workitem_claim.'
396
+ description: 'Claim an unassigned session todo. For persistent items, use workitem_claim.',
399
397
  inputSchema: {
400
398
  type: 'object',
401
399
  properties: {
@@ -436,8 +434,8 @@ export function createTodoTools(store) {
436
434
  });
437
435
  const todoHandoff = defineTool({
438
436
  name: 'todo_handoff',
439
- description: 'Hand off a SESSION todo (from CLI footer) to another agent. ' +
440
- 'For persistent backlog items, use workitem_handoff.',
437
+ // Original: 'Hand off a SESSION todo (from CLI footer) to another agent. For persistent backlog items, use workitem_handoff.'
438
+ description: 'Hand off a session todo to another agent. For persistent items, use workitem_handoff.',
441
439
  inputSchema: {
442
440
  type: 'object',
443
441
  properties: {
@@ -18,9 +18,8 @@ const DEFAULT_MAX_SIZE = 100 * 1024;
18
18
  export const webFetchTool = defineTool({
19
19
  name: 'web_fetch',
20
20
  readonly: true,
21
- description: 'Fetch content from a URL. Returns the page content as text. ' +
22
- 'Use for retrieving documentation, API responses, or web pages. ' +
23
- 'HTTP URLs are automatically upgraded to HTTPS.',
21
+ // Original: 'Fetch content from a URL. Returns the page content as text. Use for retrieving documentation, API responses, or web pages. HTTP URLs are automatically upgraded to HTTPS.'
22
+ description: 'Fetch content from a URL and return as text.',
24
23
  inputSchema: {
25
24
  type: 'object',
26
25
  properties: {
@@ -35,11 +34,13 @@ export const webFetchTool = defineTool({
35
34
  },
36
35
  timeout: {
37
36
  type: 'number',
38
- description: 'Request timeout in milliseconds (default: 30000)',
37
+ description: 'Request timeout in milliseconds',
38
+ default: 30000,
39
39
  },
40
40
  maxSize: {
41
41
  type: 'number',
42
- description: 'Maximum content size to return in bytes (default: 102400)',
42
+ description: 'Maximum content size to return in bytes',
43
+ default: 102400,
43
44
  },
44
45
  },
45
46
  required: ['url'],
@@ -170,9 +171,7 @@ export function createWebFetchTool(options) {
170
171
  return defineTool({
171
172
  name: 'web_fetch',
172
173
  readonly: true,
173
- description: 'Fetch content from a URL. Returns the page content as text. ' +
174
- 'Use for retrieving documentation, API responses, or web pages. ' +
175
- 'HTTP URLs are automatically upgraded to HTTPS.',
174
+ description: webFetchTool.definition.description,
176
175
  inputSchema: {
177
176
  type: 'object',
178
177
  properties: {
@@ -187,11 +186,13 @@ export function createWebFetchTool(options) {
187
186
  },
188
187
  timeout: {
189
188
  type: 'number',
190
- description: `Request timeout in milliseconds (default: ${String(defaultTimeout)})`,
189
+ description: 'Request timeout in milliseconds',
190
+ default: defaultTimeout,
191
191
  },
192
192
  maxSize: {
193
193
  type: 'number',
194
- description: `Maximum content size to return in bytes (default: ${String(defaultMaxSize)})`,
194
+ description: 'Maximum content size to return in bytes',
195
+ default: defaultMaxSize,
195
196
  },
196
197
  },
197
198
  required: ['url'],
@@ -10,8 +10,8 @@ import { isNodeError, isExtensionAllowed } from './utils.js';
10
10
  */
11
11
  export const writeFileTool = defineTool({
12
12
  name: 'write_file',
13
- description: 'Write content to a file. Creates the file if it does not exist. ' +
14
- 'Use append: true to add to existing content instead of overwriting.',
13
+ // Original: 'Write content to a file. Creates the file if it does not exist. Use append: true to add to existing content instead of overwriting.'
14
+ description: 'Write content to a file, creating it if needed.',
15
15
  inputSchema: {
16
16
  type: 'object',
17
17
  properties: {
@@ -25,15 +25,18 @@ export const writeFileTool = defineTool({
25
25
  },
26
26
  encoding: {
27
27
  type: 'string',
28
- description: 'File encoding (default: utf-8)',
28
+ description: 'File encoding',
29
+ default: 'utf-8',
29
30
  },
30
31
  createDirs: {
31
32
  type: 'boolean',
32
- description: 'Create parent directories if needed (default: true)',
33
+ description: 'Create parent directories if needed',
34
+ default: true,
33
35
  },
34
36
  append: {
35
37
  type: 'boolean',
36
- description: 'Append to file instead of overwriting (default: false)',
38
+ description: 'Append to file instead of overwriting',
39
+ default: false,
37
40
  },
38
41
  },
39
42
  required: ['path', 'content'],
@@ -86,34 +89,8 @@ async function executeWriteFile(input) {
86
89
  export function createWriteFileTool(options) {
87
90
  return defineTool({
88
91
  name: 'write_file',
89
- description: 'Write content to a file. Creates the file if it does not exist. ' +
90
- 'Use append: true to add to existing content instead of overwriting.',
91
- inputSchema: {
92
- type: 'object',
93
- properties: {
94
- path: {
95
- type: 'string',
96
- description: 'Absolute or relative path to the file',
97
- },
98
- content: {
99
- type: 'string',
100
- description: 'Content to write to the file',
101
- },
102
- encoding: {
103
- type: 'string',
104
- description: 'File encoding (default: utf-8)',
105
- },
106
- createDirs: {
107
- type: 'boolean',
108
- description: 'Create parent directories if needed (default: true)',
109
- },
110
- append: {
111
- type: 'boolean',
112
- description: 'Append to file instead of overwriting (default: false)',
113
- },
114
- },
115
- required: ['path', 'content'],
116
- },
92
+ description: writeFileTool.definition.description,
93
+ inputSchema: writeFileTool.definition.inputSchema,
117
94
  execute: async (input) => {
118
95
  const { baseDir, allowedExtensions, maxContentSize = 10 * 1024 * 1024, blockedPaths = [], } = options ?? {};
119
96
  let filePath = input.path;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/agents",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "description": "Lightweight multi-LLM agent library for building CLI AI assistants",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -43,7 +43,7 @@
43
43
  "anthropic"
44
44
  ],
45
45
  "author": "Carmelo Scozzola",
46
- "license": "MIT",
46
+ "license": "FSL-1.1-MIT",
47
47
  "bugs": {
48
48
  "url": "https://github.com/compilr-dev/agents/issues"
49
49
  },