@ww_nero/mini-cli 1.0.67 → 1.0.68

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.
@@ -9,7 +9,7 @@ const getCurrentDate = () => {
9
9
  const toolSystemPrompt = `<current_date>${getCurrentDate()}</current_date>
10
10
 
11
11
  <basic_rules>
12
- * 需要调用\`write_todos\`工具,来创建和更新待办事项的进度。
12
+ * 需要调用\`todos\`工具,来创建和更新待办事项的进度。
13
13
  * 除代码内容外,应使用简体中文作为默认语言。
14
14
  </basic_rules>`;
15
15
 
package/src/tools/bash.js CHANGED
@@ -208,7 +208,7 @@ const createBashToolSchema = (context = {}) => {
208
208
  return {
209
209
  type: 'function',
210
210
  function: {
211
- name: 'execute_bash',
211
+ name: 'bash',
212
212
  description: descriptionParts.join(' '),
213
213
  parameters: {
214
214
  type: 'object',
@@ -235,7 +235,7 @@ const createBashToolSchema = (context = {}) => {
235
235
  };
236
236
 
237
237
  module.exports = {
238
- name: 'execute_bash',
238
+ name: 'bash',
239
239
  schema: createBashToolSchema,
240
240
  handler: executeCommand
241
241
  };
package/src/tools/read.js CHANGED
@@ -22,7 +22,7 @@ const readFile = async ({ filePath } = {}, context = {}) => {
22
22
  const schema = {
23
23
  type: 'function',
24
24
  function: {
25
- name: 'read_file',
25
+ name: 'read',
26
26
  description: '读取指定相对路径的文本类文件完整内容,不支持二进制文件',
27
27
  parameters: {
28
28
  type: 'object',
@@ -38,7 +38,7 @@ const schema = {
38
38
  };
39
39
 
40
40
  module.exports = {
41
- name: 'read_file',
41
+ name: 'read',
42
42
  schema,
43
43
  handler: readFile
44
44
  };
@@ -105,7 +105,7 @@ const replaceInFile = async ({ filePath, search, replace } = {}, context = {}) =
105
105
  const schema = {
106
106
  type: 'function',
107
107
  function: {
108
- name: 'search_and_replace',
108
+ name: 'replace',
109
109
  description: '在文件中搜索并替换指定的代码片段(简单字符串匹配,非正则)',
110
110
  parameters: {
111
111
  type: 'object',
@@ -129,7 +129,7 @@ const schema = {
129
129
  };
130
130
 
131
131
  module.exports = {
132
- name: 'search_and_replace',
132
+ name: 'replace',
133
133
  schema,
134
134
  handler: replaceInFile
135
135
  };
@@ -53,7 +53,7 @@ const writeTodos = async ({ todos } = {}) => {
53
53
  const schema = {
54
54
  type: 'function',
55
55
  function: {
56
- name: 'write_todos',
56
+ name: 'todos',
57
57
  description: '更新任务列表(创建、修改、完成)',
58
58
  parameters: {
59
59
  type: 'object',
@@ -83,7 +83,7 @@ const schema = {
83
83
  const getLastTodos = () => lastTodos;
84
84
 
85
85
  module.exports = {
86
- name: 'write_todos',
86
+ name: 'todos',
87
87
  schema,
88
88
  handler: writeTodos,
89
89
  getLastTodos
@@ -26,7 +26,7 @@ const writeFile = async ({ filePath, content } = {}, context = {}) => {
26
26
  const schema = {
27
27
  type: 'function',
28
28
  function: {
29
- name: 'write_file',
29
+ name: 'write',
30
30
  description: '向文件写入完整内容(不存在则创建)',
31
31
  parameters: {
32
32
  type: 'object',
@@ -46,7 +46,7 @@ const schema = {
46
46
  };
47
47
 
48
48
  module.exports = {
49
- name: 'write_file',
49
+ name: 'write',
50
50
  schema,
51
51
  handler: writeFile
52
52
  };
@@ -33,19 +33,19 @@ const formatHeader = (name, args, options = {}) => {
33
33
  const statusTag = options.statusTag || '';
34
34
  const extraMeta = Array.isArray(options.extraMeta) ? options.extraMeta : [];
35
35
  const labelBase = `${chalk.yellow('🔧')} ${chalk.yellow(name)}`;
36
- const writeTag = name === 'write_file' ? formatWriteLineCountTag(args) : '';
36
+ const writeTag = name === 'write' ? formatWriteLineCountTag(args) : '';
37
37
  const labelWithWriteInfo = `${labelBase}${writeTag}`;
38
38
  const label = statusTag ? `${labelWithWriteInfo}${statusTag}` : labelWithWriteInfo;
39
39
  const metaParts = [...extraMeta];
40
40
 
41
- if (name === 'execute_bash') {
41
+ if (name === 'bash') {
42
42
  if (args.command) metaParts.push(`command="${truncateText(args.command)}"`);
43
43
  if (args.workingDirectory && args.workingDirectory !== '.') {
44
44
  metaParts.push(`dir=${args.workingDirectory}`);
45
45
  }
46
- } else if (['read_file', 'write_file', 'search_and_replace'].includes(name)) {
46
+ } else if (['read', 'write', 'replace'].includes(name)) {
47
47
  if (args.filePath) metaParts.push(args.filePath);
48
- } else if (name === 'write_todos') {
48
+ } else if (name === 'todos') {
49
49
  const count = Array.isArray(args.todos) ? args.todos.length : 0;
50
50
  metaParts.push(`${count} items`);
51
51
  } else if (name === 'convert') {