Skip to main content

Crate scv_tools

Crate scv_tools 

Source
Expand description

SCV’s bounded, workspace-aware built-in tools.

builtin_registry builds a session’s tools: files (read, read_skill, write), the shell (bash), the web (web_fetch, web_search), delegation to other agent CLIs and to a nested SCV (agent, with background jobs), and chat_attach for chat sessions. delegation records every delegated process so SCV can list, stop, and clean them up.

The source is laid out by what a tool does:

  • builtin/: tools that run inside SCV (fs, skill, shell, web, chat_attach).
  • delegate/: the agent tool that hands a turn to another agent, named as its argument, on one of three backends: one CLI process per turn (native), a long-lived Agent Client Protocol server (acp), or a nested SCV (scv); the adapters table, background jobs, conversation handles, run records (delegation), the agents’ own credential files (stores), and how a run’s output and progress are read.
  • process: spawning a child in its own process group and always finishing the whole group.
  • registry, config, and args: assembling a session’s tools, their settings, and the argument helpers they share.

Modules§

adapters
The native agent CLIs SCV can delegate to, one descriptor each.
agent_choice
What lets the model choose between delegated agents: the agent tool lists each agent with its product, what that harness offers, what it takes, and the user’s own use_for note, and, when a call fails because the agent is missing, signed out, or its provider returned an error, names the other agents to call instead.
agent_options
The model and effort values an agent’s ACP server offers, as SCV last saw them.
background
Background delegations: an agent call with background: true returns a job handle at once while the agent keeps working; agent_status and agent_wait observe the job, agent_cancel stops it, and the session is told when it finishes so the server can report it in a turn of its own.
chat_attach
chat_attach: send a file with a chat session’s reply.
chat_history
chat_history and chat_keep: the chat log of the conversation a chat session answers (see scv_client::history).
conversation
Multi-turn conversations with delegated agents.
delegation
What SCV started, so it can list, stop, and clean up delegated agents.
stores
Credentials for the native agents SCV delegates to, always inside SCV’s private agent homes: importing a user’s own Codex or Grok setup, and the API-key and endpoint stores SCV writes in an agent CLI’s native format.
web
Web tools: web_fetch and the configured-backend web_search.

Structs§

AcpAgentLaunch
An agent’s Agent Client Protocol server, resolved from its adapter-table entry and [agents.<name>] transport.
AgentAdapterConfig
DelegationContext
The registry and parent session that delegated runs are recorded under.
ToolsConfig
Limits and shared state for one session’s tools.

Enums§

Reach
How SCV reaches an agent, decided from its adapter settings and what is installed; the agent tool and scv agents check decide the same way.
Skill
Where a skill’s text comes from.

Constants§

AGENT_EFFORTS
Effort values the agent tool’s schema always lists; an ACP agent’s own values are added to them.

Functions§

apply_agent_environment
Give a native agent command its adapter environment: remove every inherited credential, endpoint, and state-location variable any adapter declares, then set environment (such as the relocated config home).
builtin_registry
The tools a session offers: the built-in ones, then, when an installed agent is offered below the delegation depth limit, the agent tool, able to run in the background, and the job tools (agent_wait, agent_status, agent_cancel).
call_agent
Make one agent call to name from cwd, as a session’s agent tool makes it, for scv agents check. The call runs in the foreground and may take timeout; when interrupted completes first, it is cancelled. The agent’s model list decides, not a saved one. The run is recorded under delegation, like a session’s, and this returns only once the agent’s process group is gone. The result is the tool’s JSON result, or SCV’s own error when the call was refused or nothing could run.
offered_agents
The agents a session’s agent tool offers, sorted: the values its schema lists. Empty when the session offers none.
reach
How SCV would reach the agent adapter configures.
valid_effort
Whether value can be passed as an effort: 1-32 ASCII letters, digits, -, or _, starting with a letter or digit so it never reads as a flag. Which values an agent supports is the agent’s to check, since its levels change with its releases.
valid_model_name
Model names are passed as one argument, so only reject values that could read as a flag, name an @file argument, or carry unexpected characters.

Type Aliases§

SkillMap
A session’s skills by name.