mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-04-30 08:42:42 +08:00
- Delete monolithic registry.ts (−1185 lines) - Add tools/definitions/ with 12 individual tool files + index.ts, each using AgentTool interface and TypeBox schemas - Add tools/utils/ with shared helpers (format.ts, schemas.ts, time-params.ts) - Rewrite tools/index.ts to provide getAllTools() factory - Clean up tools/types.ts, keep only ToolContext and OwnerInfo - Use i18n keys for tool descriptions, preserve Chinese as comments
24 lines
1.2 KiB
TypeScript
24 lines
1.2 KiB
TypeScript
/**
|
|
* 共享 TypeBox Schema 片段
|
|
* 多个工具复用的时间参数 schema
|
|
*/
|
|
|
|
import { Type } from '@mariozechner/pi-ai'
|
|
|
|
export const timeParamProperties = {
|
|
year: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.year' })),
|
|
month: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.month' })),
|
|
day: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.day' })),
|
|
hour: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.hour' })),
|
|
start_time: Type.Optional(Type.String({ description: 'ai.tools._shared.params.start_time' })),
|
|
end_time: Type.Optional(Type.String({ description: 'ai.tools._shared.params.end_time' })),
|
|
}
|
|
|
|
export const timeParamPropertiesNoHour = {
|
|
year: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.year' })),
|
|
month: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.month' })),
|
|
day: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.day' })),
|
|
start_time: Type.Optional(Type.String({ description: 'ai.tools._shared.params.start_time' })),
|
|
end_time: Type.Optional(Type.String({ description: 'ai.tools._shared.params.end_time' })),
|
|
}
|