Skip to main content

Module builtin

Module builtin 

Source

Structsยง

BuiltinSpec
Static metadata for the builtin ops. Used by main.rs to declare them against atlas at startup so pilot can discover them like any other provider.
CmdArgs ๐Ÿ”’
JSON arguments for executing a shell command through the builtin.
DocArgs ๐Ÿ”’
JSON arguments selecting whose registered capability documentation to read.
ListArgs ๐Ÿ”’
JSON arguments for listing entries in a workspace directory.
PatchArgs ๐Ÿ”’
JSON arguments for replacing the first matching text in a workspace file.
ReadArgs ๐Ÿ”’
JSON arguments for reading a text file within the workspace.
WriteArgs ๐Ÿ”’
JSON arguments for creating or overwriting a text file within the workspace.

Constantsยง

BUILTINS
COMMAND_TIMEOUT ๐Ÿ”’
Command execution timeout.
MAX_COMMAND_LEN ๐Ÿ”’
Maximum command length to prevent abuse.

Functionsยง

command_result ๐Ÿ”’
Inline both streams when together they fit the inline limit (deleting the files); otherwise keep the non-empty files and describe them. A storage failure is always reported, because the files are then incomplete.
execute
One in-process builtin (no network, runs in executorโ€™s own process). call.contract_idโ€™s last segment names the operation โ€” e.g. robonix/system/executor/builtin/read_file โ†’ read_file.
format_command_output ๐Ÿ”’
Stdout, then stderr, then the exit code, which search commands need: grep and rg exit 1 for no match and higher for errors.
list_dir ๐Ÿ”’
patch_file ๐Ÿ”’
read_capability_doc ๐Ÿ”’
Apply the read_capability_doc builtin: fetch a providerโ€™s registered CAPABILITY.md content from atlas and return it as markdown text.
read_file ๐Ÿ”’
render_provider_doc ๐Ÿ”’
Everything atlas knows that helps a caller use provider: its CAPABILITY.md when it registered one, followed by the full description of each capability the provider offers.
run ๐Ÿ”’
run_command ๐Ÿ”’
run_command_in ๐Ÿ”’
Run a shell command with stdout and stderr copied to files, so Executor holds almost none of its output in memory. Short output is read back inline; long output stays on disk and is described for searching.
safe_resolve ๐Ÿ”’
Resolve a user-supplied path and ensure it stays within the workspace root. Returns the canonical path on success, or an error if the path escapes the allowed directory (path traversal).
safe_resolve_in ๐Ÿ”’
safe_resolve against an explicit root. Tests call this directly: the workspace root comes from a process-wide environment variable, and setting it from parallel tests leaks one testโ€™s root into anotherโ€™s file ops.
spool ๐Ÿ”’
Copy a command stream to its file. A failed write, such as a full temporary directory, is returned and the rest is drained, so storing output never blocks or breaks the command.
terminate_command_group ๐Ÿ”’
workspace_root ๐Ÿ”’
Workspace root for file operations. All file paths are resolved relative to this directory, and path traversal beyond it is rejected.
write_file ๐Ÿ”’
ๆต™ICPๅค‡2023005800ๅท-2 ๆต™ๅ…ฌ็ฝ‘ๅฎ‰ๅค‡33010902005384ๅท