UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

31 lines (30 loc) • 3.13 kB
import { a as EXEC_WAIT_RECIPE } from "./bash-tools.exec-output-CrrdoikE.mjs"; //#region src/agents/bash-tools.descriptions.ts const EXEC_AUTO_REVIEW_GUIDANCE = "An automatic reviewer may deny a command and explain why; if denied, choose a materially safer alternative or ask the user, never work around the denial."; function describeExecTool(e) { const t = e?.hasProcessTool === false ? ["Run shell and wait for completion."] : [ "Run shell now; background continuation supported.", "Completed calls return command output directly. Use process only when exec reports running with a sessionId; output text alone is not a process handle.", `Long run: a command still running at yieldMs returns a handle. When the running result says its exit wakes this conversation, end the turn instead of polling; otherwise process poll collects the result. ${EXEC_WAIT_RECIPE} Output while still running does not start another turn. Background commands can outlive the turn; use process kill when no longer needed. This is not a saved, restartable automation.` ]; const n = [ e?.hasCronTool ? "For continuous monitoring with future alerts, check automations for supported saved watchers. Ordinary background output cannot wake you to report new events." : void 0, ...t, "Omit host/node to use the session's configured host.", e?.hasCronTool ? "A one-time wait in this conversation is one background command; saved, recurring or cross-session follow-ups use automations." : void 0, "TTY CLI/UI/coding agent: pty=true." ].filter(Boolean).join(" "); const r = process.platform !== "win32" ? `${n} Quote arguments containing shell metacharacters, including URL query strings with \`?\` or \`&\`.` : `${n}\nIMPORTANT (Windows): Run executables directly; do NOT wrap commands in \`cmd /c\`, \`powershell -Command\`, \`& \` prefix, or WSL. Use backslash paths (C:\\path), not forward slashes. Use short executable names (e.g. \`node\`, \`python3\`) instead of full paths.`; return e?.autoReview ? `${r} ${EXEC_AUTO_REVIEW_GUIDANCE}` : r; } function describeProcessTool(e) { return [ "Control existing exec: list, poll, log, write, send-keys, submit, paste, kill.", "poll/log: status, output, quiet success, completion without auto-wake, input hints. Others: input/intervention.", "kill requests termination or returns the retained terminal result for an already-finished session. After a termination request, poll until a terminal result confirms exit and cleanup before saying stopped. A running poll is still pending. remove hides the record and cannot confirm cleanup.", "Later process results supersede turn-start snapshots. Control sessions by sessionId; a displayed host PID is not a portable sandbox PID.", e?.hasCronTool ? "No polling as timer/reminder; scheduled follow-up uses automations. On a requested monitoring stop, also stop any ordinary exec sessions you created for that request; stopping a saved automation does not stop them. Preserve unrelated work." : void 0 ].filter(Boolean).join(" "); } //#endregion export { describeExecTool as n, describeProcessTool as r, EXEC_AUTO_REVIEW_GUIDANCE as t };