feat(tools): Phase T.1-T.4 complete - manifest system, registry, implementations, runtime, collaboration, scheduler
This commit is contained in:
88
backend/app/tools/manifests/file_operator.yaml
Normal file
88
backend/app/tools/manifests/file_operator.yaml
Normal file
@@ -0,0 +1,88 @@
|
||||
manifest_version: "1.0.0"
|
||||
name: file_operator
|
||||
display_name: 文件操作器
|
||||
description: 强大的文件系统操作工具,支持读写、搜索、下载等功能
|
||||
author: Jarvis
|
||||
version: "1.0.0"
|
||||
|
||||
type: sync
|
||||
runtime: python
|
||||
entry: tools/implementations/file_operator.py
|
||||
timeout: 30000
|
||||
|
||||
config_schema:
|
||||
allowed_directories:
|
||||
type: string
|
||||
description: 允许操作的目录列表,逗号分隔
|
||||
default: ""
|
||||
max_file_size:
|
||||
type: integer
|
||||
description: 最大文件大小(字节)
|
||||
default: 10485760
|
||||
|
||||
commands:
|
||||
- name: read_file
|
||||
description: |
|
||||
读取指定路径文件的内容。支持 PDF、DOCX、XLSX 等格式自动解析。
|
||||
参数:
|
||||
- filePath (必需): 文件绝对路径
|
||||
- encoding (可选): 编码格式,默认 utf8
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
filePath:
|
||||
type: string
|
||||
description: 文件绝对路径
|
||||
encoding:
|
||||
type: string
|
||||
default: utf8
|
||||
required: [filePath]
|
||||
|
||||
- name: write_file
|
||||
description: |
|
||||
将内容写入文件。如果文件存在,自动创建新文件避免覆盖。
|
||||
参数:
|
||||
- filePath (必需): 文件绝对路径
|
||||
- content (必需): 文件内容
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
filePath:
|
||||
type: string
|
||||
content:
|
||||
type: string
|
||||
required: [filePath, content]
|
||||
|
||||
- name: list_directory
|
||||
description: |
|
||||
列出目录内容。
|
||||
参数:
|
||||
- directoryPath (必需): 目录绝对路径
|
||||
- showHidden (可选): 是否显示隐藏文件
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
directoryPath:
|
||||
type: string
|
||||
showHidden:
|
||||
type: boolean
|
||||
default: false
|
||||
required: [directoryPath]
|
||||
|
||||
- name: search_files
|
||||
description: |
|
||||
递归搜索匹配模式的文件。
|
||||
参数:
|
||||
- searchPath (必需): 搜索起始目录
|
||||
- pattern (必需): 文件模式,如 *.txt
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
searchPath:
|
||||
type: string
|
||||
pattern:
|
||||
type: string
|
||||
required: [searchPath, pattern]
|
||||
|
||||
tags: [file, system, essential]
|
||||
enabled: true
|
||||
90
backend/app/tools/manifests/task_manager.yaml
Normal file
90
backend/app/tools/manifests/task_manager.yaml
Normal file
@@ -0,0 +1,90 @@
|
||||
manifest_version: "1.0.0"
|
||||
name: task_manager
|
||||
display_name: 任务管理
|
||||
description: 任务创建、查询、更新和状态管理
|
||||
author: Jarvis
|
||||
version: "1.0.0"
|
||||
|
||||
type: sync
|
||||
runtime: python
|
||||
entry: tools/implementations/task_manager.py
|
||||
timeout: 10000
|
||||
|
||||
config_schema: {}
|
||||
|
||||
commands:
|
||||
- name: create_task
|
||||
description: |
|
||||
创建新任务。
|
||||
参数:
|
||||
- name (必需): 任务名称
|
||||
- description (必需): 任务描述
|
||||
- scheduled_at (可选): 计划执行时间 (ISO 格式)
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
scheduled_at:
|
||||
type: string
|
||||
format: date-time
|
||||
required: [name, description]
|
||||
|
||||
- name: list_tasks
|
||||
description: |
|
||||
列出任务。
|
||||
参数:
|
||||
- status (可选): 按状态筛选 (pending/running/completed/failed)
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum: [pending, running, completed, failed]
|
||||
|
||||
- name: get_task
|
||||
description: |
|
||||
获取任务详情。
|
||||
参数:
|
||||
- task_id (必需): 任务 ID
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
task_id:
|
||||
type: string
|
||||
required: [task_id]
|
||||
|
||||
- name: complete_task
|
||||
description: |
|
||||
标记任务完成。
|
||||
参数:
|
||||
- task_id (必需): 任务 ID
|
||||
- result (必需): 执行结果
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
task_id:
|
||||
type: string
|
||||
result:
|
||||
type: object
|
||||
required: [task_id, result]
|
||||
|
||||
- name: fail_task
|
||||
description: |
|
||||
标记任务失败。
|
||||
参数:
|
||||
- task_id (必需): 任务 ID
|
||||
- error (必需): 错误信息
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
task_id:
|
||||
type: string
|
||||
error:
|
||||
type: string
|
||||
required: [task_id, error]
|
||||
|
||||
tags: [task, management]
|
||||
enabled: true
|
||||
55
backend/app/tools/manifests/web_fetch.yaml
Normal file
55
backend/app/tools/manifests/web_fetch.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
manifest_version: "1.0.0"
|
||||
name: web_fetch
|
||||
display_name: 网页抓取
|
||||
description: 网页内容抓取工具,支持 HTML 解析、截图等功能
|
||||
author: Jarvis
|
||||
version: "1.0.0"
|
||||
|
||||
type: sync
|
||||
runtime: python
|
||||
entry: tools/implementations/web_fetch.py
|
||||
timeout: 30000
|
||||
|
||||
config_schema:
|
||||
timeout:
|
||||
type: integer
|
||||
description: 请求超时时间(秒)
|
||||
default: 30
|
||||
user_agent:
|
||||
type: string
|
||||
description: User-Agent 字符串
|
||||
default: "Mozilla/5.0 (compatible; Jarvis/1.0)"
|
||||
|
||||
commands:
|
||||
- name: fetch
|
||||
description: |
|
||||
抓取网页内容。
|
||||
参数:
|
||||
- url (必需): 网页 URL
|
||||
- include_images (可选): 是否包含图片列表
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
format: uri
|
||||
include_images:
|
||||
type: boolean
|
||||
default: true
|
||||
required: [url]
|
||||
|
||||
- name: screenshot
|
||||
description: |
|
||||
截取网页截图。
|
||||
参数:
|
||||
- url (必需): 网页 URL
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
format: uri
|
||||
required: [url]
|
||||
|
||||
tags: [web, fetch, scraping]
|
||||
enabled: true
|
||||
63
backend/app/tools/manifests/web_search.yaml
Normal file
63
backend/app/tools/manifests/web_search.yaml
Normal file
@@ -0,0 +1,63 @@
|
||||
manifest_version: "1.0.0"
|
||||
name: web_search
|
||||
display_name: 联网搜索
|
||||
description: 语义级并发搜索引擎,支持多源搜索和结果聚合
|
||||
author: Jarvis
|
||||
version: "1.0.0"
|
||||
|
||||
type: sync
|
||||
runtime: python
|
||||
entry: tools/implementations/web_search.py
|
||||
timeout: 60000
|
||||
|
||||
config_schema:
|
||||
api_key:
|
||||
type: string
|
||||
description: 搜索引擎 API 密钥
|
||||
required: true
|
||||
max_results:
|
||||
type: integer
|
||||
description: 最大返回结果数
|
||||
default: 10
|
||||
|
||||
commands:
|
||||
- name: search
|
||||
description: |
|
||||
执行语义级搜索。
|
||||
参数:
|
||||
- query (必需): 搜索关键词
|
||||
- max_results (可选): 最大结果数
|
||||
- sources (可选): 搜索源列表
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
query:
|
||||
type: string
|
||||
max_results:
|
||||
type: integer
|
||||
default: 10
|
||||
sources:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
required: [query]
|
||||
|
||||
- name: deep_search
|
||||
description: |
|
||||
深度搜索,带摘要生成。
|
||||
参数:
|
||||
- query (必需): 研究主题
|
||||
- keywords (必需): 关键词列表
|
||||
parameters:
|
||||
type: object
|
||||
properties:
|
||||
query:
|
||||
type: string
|
||||
keywords:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
required: [query, keywords]
|
||||
|
||||
tags: [search, web, research]
|
||||
enabled: true
|
||||
Reference in New Issue
Block a user