openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
43 lines (42 loc) • 2.85 kB
JavaScript
import { o as optionalStringEnum } from "./typebox-DCO1JbMn.js";
import { Type } from "typebox";
/** Parameters accepted by the exec tool. */
const execSchema = Type.Object({
command: Type.String({ description: "Shell command to execute" }),
workdir: Type.Optional(Type.String({ description: "Working directory (defaults to cwd)" })),
env: Type.Optional(Type.Record(Type.String(), Type.String())),
yieldMs: Type.Optional(Type.Number({ description: "Milliseconds to wait before backgrounding (default 10000)" })),
background: Type.Optional(Type.Boolean({ description: "Run in background immediately" })),
timeout: Type.Optional(Type.Number({ description: "Timeout in seconds (optional, kills process on expiry)" })),
pty: Type.Optional(Type.Boolean({ description: "Run in a pseudo-terminal (PTY) when available (TTY-required CLIs, coding agents)" })),
elevated: Type.Optional(Type.Boolean({ description: "Run on the host with elevated permissions (if allowed)" })),
host: optionalStringEnum([
"auto",
"sandbox",
"gateway",
"node"
], { description: "Exec host/target (auto|sandbox|gateway|node)." }),
security: Type.Optional(Type.String({ description: "Ignored for normal calls; exec security is set by tools.exec.security and host approvals." })),
ask: Type.Optional(Type.String({ description: "Baseline ask comes from tools.exec.ask and host approvals; channel-origin calls ignore per-call ask when effective host ask is off." })),
node: Type.Optional(Type.String({ description: "Node id/name for host=node." }))
});
/** Parameters accepted by the process-control tool. */
const processSchema = Type.Object({
action: Type.String({ description: "Process action (list|poll|log|write|send-keys|submit|paste|kill|clear|remove)" }),
sessionId: Type.Optional(Type.String({ description: "Session id for actions other than list" })),
data: Type.Optional(Type.String({ description: "Data to write for write" })),
keys: Type.Optional(Type.Array(Type.String(), { description: "Key tokens to send for send-keys" })),
hex: Type.Optional(Type.Array(Type.String(), { description: "Hex bytes to send for send-keys" })),
literal: Type.Optional(Type.String({ description: "Literal string for send-keys" })),
text: Type.Optional(Type.String({ description: "Text to paste for paste" })),
bracketed: Type.Optional(Type.Boolean({ description: "Wrap paste in bracketed mode" })),
eof: Type.Optional(Type.Boolean({ description: "Close stdin after write" })),
offset: Type.Optional(Type.Number({ description: "Log offset" })),
limit: Type.Optional(Type.Number({ description: "Log length" })),
timeout: Type.Optional(Type.Number({
description: "For poll: wait up to this many milliseconds before returning; max 30000 ms, higher values are clamped to 30000",
minimum: 0
}))
});
//#endregion
export { processSchema as n, execSchema as t };