


























1+import { optionalPositiveIntegerSchema } from "openclaw/plugin-sdk/channel-actions";
12import type { AnyAgentTool } from "openclaw/plugin-sdk/plugin-entry";
23import { Type } from "typebox";
34@@ -25,14 +26,12 @@ export const FileFetchToolSchema = Type.Object({
2526path: Type.String({
2627description: "Absolute path to the file on the node. Canonicalized server-side.",
2728}),
28-maxBytes: Type.Optional(
29-Type.Number({
30-description: "Max bytes to fetch. Default 8 MB, hard ceiling 16 MB (single round-trip).",
31-}),
32-),
29+maxBytes: optionalPositiveIntegerSchema({
30+description: "Max bytes to fetch. Default 8 MB, hard ceiling 16 MB (single round-trip).",
31+}),
3332gatewayUrl: Type.Optional(Type.String()),
3433gatewayToken: Type.Optional(Type.String()),
35-timeoutMs: Type.Optional(Type.Number()),
34+timeoutMs: optionalPositiveIntegerSchema(),
3635});
37363837export const FILE_FETCH_TOOL_DESCRIPTOR: FileTransferToolDescriptor = {
@@ -56,14 +55,12 @@ export const DirListToolSchema = Type.Object({
5655"Pagination token from a previous dir_list call. Omit to start from the beginning.",
5756}),
5857),
59-maxEntries: Type.Optional(
60-Type.Number({
61-description: `Max entries per page. Default ${DIR_LIST_DEFAULT_MAX_ENTRIES}, hard ceiling ${DIR_LIST_HARD_MAX_ENTRIES}.`,
62-}),
63-),
58+maxEntries: optionalPositiveIntegerSchema({
59+description: `Max entries per page. Default ${DIR_LIST_DEFAULT_MAX_ENTRIES}, hard ceiling ${DIR_LIST_HARD_MAX_ENTRIES}.`,
60+}),
6461gatewayUrl: Type.Optional(Type.String()),
6562gatewayToken: Type.Optional(Type.String()),
66-timeoutMs: Type.Optional(Type.Number()),
63+timeoutMs: optionalPositiveIntegerSchema(),
6764});
68656966export const DIR_LIST_TOOL_DESCRIPTOR: FileTransferToolDescriptor = {
@@ -81,20 +78,18 @@ export const DirFetchToolSchema = Type.Object({
8178path: Type.String({
8279description: "Absolute path to the directory on the node to fetch. Canonicalized server-side.",
8380}),
84-maxBytes: Type.Optional(
85-Type.Number({
86-description:
87-"Max gzipped tarball bytes to fetch. Default 8 MB, hard ceiling 16 MB (single round-trip).",
88-}),
89-),
81+maxBytes: optionalPositiveIntegerSchema({
82+description:
83+"Max gzipped tarball bytes to fetch. Default 8 MB, hard ceiling 16 MB (single round-trip).",
84+}),
9085includeDotfiles: Type.Optional(
9186Type.Boolean({
9287description: "Reserved for v2; currently always includes dotfiles (v1 quirk in BSD tar).",
9388}),
9489),
9590gatewayUrl: Type.Optional(Type.String()),
9691gatewayToken: Type.Optional(Type.String()),
97-timeoutMs: Type.Optional(Type.Number()),
92+timeoutMs: optionalPositiveIntegerSchema(),
9893});
999410095export const DIR_FETCH_TOOL_DESCRIPTOR: FileTransferToolDescriptor = {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。