tools/

directory
v0.0.0-...-7c75ef6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0

README

pkg/tools

Tool definition and execution: what an agent's tools are, how they are authored and validated, and the substrate they run in. Two spec formats live here — SpiceboxToolspec for CLI invocations and MCPServer for JSON-RPC tool calls — along with the CEL engine both constrain calls with, the sandbox backends tools execute in, and the skills a session materializes.

Package Purpose
adoptkit Metadata-only server-side apply marking a CR-referenced Secret/ConfigMap as operator-adopted. Never reads or writes .data.
catalog Loads a directory of toolkit YAMLs (consumed by oap tools toolspec describe/test), plus a hardcoded MCP-server registry.
cel cel-go wrapper: the two fixed environments (call for toolspec, args for MCP) plus the helper-function registry.
contract The Kind plug-in surface the kind-agnostic oap tools CLI consumes.
exec The Executor seam for running a command inside a sandbox, plus its kubelet and fake transports.
kinds The registered contract.Kind implementations — CLI presentation, one per tool CR.
mcp Everything MCP: OAuth, the session-aware client, the spec format, its validator and renderers.
redact Replaces sensitive values with stable <redacted id="N"/> tokens plus an ID→descriptor map.
sandboxkinds The pluggable sandbox-backend seam (pod, agent-sandbox) and its conformance suite.
skillbundle Content-addressed store for skill-bundle tarballs; in-memory and postgres backends.
skills Skill identity, fetch, parse, validation and materialization for the agentskills.io format.
toolchain The seam for delivering a toolchain payload into a sandbox pod.
toolkitstream Per-toolkit stream parsers turning an interactive tool's stdout into neutral events.
toolspec The CLI-invocation validator: the toolkit and spec formats, the argv parser, CEL, the decision.
websearch Swappable web-search / web-fetch provider used by the identity-setup LLM agent (pkg/platform/identity/setup/llmagent).

Boundary

  • Tool definition and validation (spec formats, parsers, CEL, validators) and the substrate they execute in (sandbox kinds, exec transports, toolchains) belong here.
  • Tools as the agent loop calls them — the tool.Tool interface, dispatch, per-turn wiring, and synthesizers such as pkg/agent/tool/sidecartoolbox — belong in pkg/agent.
  • The shared Decision / Trace / redaction machinery both validators build on is pkg/authz/validator/core; authorization policy is pkg/authz.
  • CRD types are pkg/apis/v1alpha1; the reconcilers that act on them are pkg/controllers.

See the root README.md and AGENTS.md.

Directories

Path Synopsis
Package adoptkit marks CR-referenced Secrets/ConfigMaps as adopted by the operator — a metadata-only server-side-apply of the adoption label + a per-owner ownership annotation.
Package adoptkit marks CR-referenced Secrets/ConfigMaps as adopted by the operator — a metadata-only server-side-apply of the adoption label + a per-owner ownership annotation.
Package apiadapter is the declarative HTTP-API adapter: a config describing a REST API's operations, and an executor that performs one of them.
Package apiadapter is the declarative HTTP-API adapter: a config describing a REST API's operations, and an executor that performs one of them.
Package catalog loads a directory of toolkit YAML files and exposes them both as in-memory Toolkit structs and as compact summaries for LLM prompts.
Package catalog loads a directory of toolkit YAML files and exposes them both as in-memory Toolkit structs and as compact summaries for LLM prompts.
Package cel wraps the cel-go runtime with a fixed variable schema and helper function library.
Package cel wraps the cel-go runtime with a fixed variable schema and helper function library.
Package contract defines the kind plug-in surface that the unified `oap tools` CLI consumes.
Package contract defines the kind plug-in surface that the unified `oap tools` CLI consumes.
Package exec wraps client-go's remote command executor behind an interface so controllers can be tested with an in-process fake.
Package exec wraps client-go's remote command executor behind an interface so controllers can be tested with an in-process fake.
fake
Package fake provides an in-process fake for exec.Executor, used by controller and e2e tests.
Package fake provides an in-process fake for exec.Executor, used by controller and e2e tests.
remote
Package remote implements exec.Executor against the Kubernetes API server via the pods/exec subresource.
Package remote implements exec.Executor against the Kubernetes API server via the pods/exec subresource.
kinds
mcp
Package mcp registers the MCPServer Kind with the global tools-kind registry.
Package mcp registers the MCPServer Kind with the global tools-kind registry.
registry
Package registry holds the global tool-kind registry.
Package registry holds the global tool-kind registry.
sandbox
Package sandbox registers the SpiceboxToolspec Kind with the global tools-kind registry.
Package sandbox registers the SpiceboxToolspec Kind with the global tools-kind registry.
sidecartoolbox
Package sidecartoolbox registers the SidecarToolbox Kind with the global tools-kind registry.
Package sidecartoolbox registers the SidecarToolbox Kind with the global tools-kind registry.
mcp
oauth
Package oauth implements OAuth 2.0 + PKCE (RFC 7636) helpers for MCP server authentication.
Package oauth implements OAuth 2.0 + PKCE (RFC 7636) helpers for MCP server authentication.
probe
Package probe is the Streamable-HTTP MCP client used by the runner (sidecar + MCPServer tool synthesis and dispatch), the operator controllers (MCPServer / SidecarToolbox reachability), and the oap CLI.
Package probe is the Streamable-HTTP MCP client used by the runner (sidecar + MCPServer tool synthesis and dispatch), the operator controllers (MCPServer / SidecarToolbox reachability), and the oap CLI.
render
Package render produces plain-language descriptions of one MCP tool's effective contract.
Package render produces plain-language descriptions of one MCP tool's effective contract.
testing
Package testing provides an httptest-backed fake MCP server for probe, dispatch, controller, and CLI tests.
Package testing provides an httptest-backed fake MCP server for probe, dispatch, controller, and CLI tests.
trust
Package trust renders SEP-1913 trust annotation snapshots in a compact human-readable form.
Package trust renders SEP-1913 trust annotation snapshots in a compact human-readable form.
validator
Package validator orchestrates per-tool-call validation of MCP server invocations against an MCPServer spec, producing a Decision that mirrors the shape of pkg/tools/toolspec/validator.Decision.
Package validator orchestrates per-tool-call validation of MCP server invocations against an MCPServer spec, producing a Decision that mirrors the shape of pkg/tools/toolspec/validator.Decision.
Package redact replaces sensitive values with stable IDs and emits an ID→descriptor map.
Package redact replaces sensitive values with stable IDs and emits an ID→descriptor map.
Package sandboxkinds is the pluggability seam for sandbox backends: the substrate a SpiceboxSession's tools actually execute in.
Package sandboxkinds is the pluggability seam for sandbox backends: the substrate a SpiceboxSession's tools actually execute in.
agentsandbox
Package agentsandbox implements the agent-sandbox (sigs.k8s.io) backend: a Sandbox custom resource whose lifecycle a third-party controller owns.
Package agentsandbox implements the agent-sandbox (sigs.k8s.io) backend: a Sandbox custom resource whose lifecycle a third-party controller owns.
conformance
Package conformance holds the assertions every sandbox backend must satisfy.
Package conformance holds the assertions every sandbox backend must satisfy.
internal/shapecheck
Package shapecheck is a test-support sandbox backend modelling a provider OUTSIDE the cluster: an opaque ID handle, no Kubernetes client, no pod, a native file API and native snapshots.
Package shapecheck is a test-support sandbox backend modelling a provider OUTSIDE the cluster: an opaque ID handle, no Kubernetes client, no pod, a native file API and native snapshots.
pod
Package pod implements the built-in sandbox backend: a corev1.Pod built by pkg/platform/podspec.
Package pod implements the built-in sandbox backend: a corev1.Pod built by pkg/platform/podspec.
registry
Package registry is the process-wide sandbox-kind registry.
Package registry is the process-wide sandbox-kind registry.
Package skillbundle is the content-addressed store for skill bundles (the gzipped tar of a skill directory: SKILL.md + scripts/ + assets/ + ...).
Package skillbundle is the content-addressed store for skill bundles (the gzipped tar of a skill directory: SKILL.md + scripts/ + assets/ + ...).
memory
Package memory is the in-memory skillbundle.Store backend.
Package memory is the in-memory skillbundle.Store backend.
postgres
Package postgres is the durable postgres skillbundle.Store backend.
Package postgres is the durable postgres skillbundle.Store backend.
skills
canonical
Package canonical parses and manipulates canonical skill names.
Package canonical parses and manipulates canonical skill names.
materialize
Package materialize answers whether a Skill/ClusterSkill's non-local canonical name is actually backed by the SkillSource/ClusterSkillSource that produces it.
Package materialize answers whether a Skill/ClusterSkill's non-local canonical name is actually backed by the SkillSource/ClusterSkillSource that produces it.
pluginlayout
Package pluginlayout is the on-disk contract for the plugin a staged skill was discovered inside.
Package pluginlayout is the on-disk contract for the plugin a staged skill was discovered inside.
skillfetch
Package skillfetch abstracts cloning a git repo at a ref and returning its files + the resolved commit SHA.
Package skillfetch abstracts cloning a git repo at a ref and returning its files + the resolved commit SHA.
skillmd
Package skillmd parses a SKILL.md document: a YAML frontmatter block fenced by "---" lines, followed by the Markdown body.
Package skillmd parses a SKILL.md document: a YAML frontmatter block fenced by "---" lines, followed by the Markdown body.
validate
Package validate enforces the agentskills.io frontmatter constraints plus the project's forward-compat rules (no XML tags, no reserved provider words), and cross-checks the frontmatter name against the canonical skill directory.
Package validate enforces the agentskills.io frontmatter constraints plus the project's forward-compat rules (no XML tags, no reserved provider words), and cross-checks the frontmatter name against the canonical skill directory.
Package toolchain defines the pluggable seam by which a resolved toolchain payload is delivered into a sandbox pod.
Package toolchain defines the pluggable seam by which a resolved toolchain payload is delivered into a sandbox pod.
claude
Package claude holds launcher-side logic specific to the "claude" toolchain (Claude Code, the inner coding agent running inside the sandbox).
Package claude holds launcher-side logic specific to the "claude" toolchain (Claude Code, the inner coding agent running inside the sandbox).
kinds/image
Package image delivers a toolchain payload by running the toolchain's own OCI image as an init container that copies the payload into a shared emptyDir, which the sandbox container then mounts read-only.
Package image delivers a toolchain payload by running the toolchain's own OCI image as an init container that copies the payload into a shared emptyDir, which the sandbox container then mounts read-only.
kinds/registry
Package registry is the process-local registry of toolchain delivery Kinds.
Package registry is the process-local registry of toolchain delivery Kinds.
resolve
Package resolve turns a class's toolchain names into self-contained, frozen mounts.
Package resolve turns a class's toolchain names into self-contained, frozen mounts.
Package toolkitstream defines the per-toolkit stream-parser plug-in surface.
Package toolkitstream defines the per-toolkit stream-parser plug-in surface.
registry
Package registry holds the global parser-factory registry.
Package registry holds the global parser-factory registry.
Package toolspec is the root of the tool-invocation validator.
Package toolspec is the root of the tool-invocation validator.
effect
Package effect models a subcommand's declared side-effects and resolves templated effect strings.
Package effect models a subcommand's declared side-effects and resolves templated effect strings.
llm
Package llm defines the Provider interface and shared request/response types.
Package llm defines the Provider interface and shared request/response types.
llm/fake
Package fake provides a fixture-driven Provider for tests.
Package fake provides a fixture-driven Provider for tests.
llm/promptlib
Package promptlib holds the prompt-building and JSON-response parsing helpers behind the toolspec llm.Provider.
Package promptlib holds the prompt-building and JSON-response parsing helpers behind the toolspec llm.Provider.
parser
Package parser contains the declarative argv parser and the builtin-parser registry.
Package parser contains the declarative argv parser and the builtin-parser registry.
parser/builtin
Package builtin is the registry for named in-tree parsers.
Package builtin is the registry for named in-tree parsers.
registry
Package registry resolves toolkit references for the operator.
Package registry resolves toolkit references for the operator.
render
Package render produces plain-language descriptions of ToolSpecs.
Package render produces plain-language descriptions of ToolSpecs.
spec
Package spec defines the ToolSpec type and its YAML loader.
Package spec defines the ToolSpec type and its YAML loader.
toolkit
Package toolkit defines the Toolkit type and its YAML loader.
Package toolkit defines the Toolkit type and its YAML loader.
validator
Package validator orchestrates parse → structured checks → CEL into a Decision.
Package validator orchestrates parse → structured checks → CEL into a Decision.
Package websearch provides a swappable, client-dispatched interface for web-search and web-fetch capabilities the gen agent uses to discover CLI tools and MCP servers.
Package websearch provides a swappable, client-dispatched interface for web-search and web-fetch capabilities the gen agent uses to discover CLI tools and MCP servers.
bravesearch
Package bravesearch implements websearch.Backend against the Brave Search API (api.search.brave.com/res/v1/web/search): a documented HTTP API, authenticated by a single subscription-token header, whose terms permit programmatic (non-browser) access — the three properties this package's backend was chosen for.
Package bravesearch implements websearch.Backend against the Brave Search API (api.search.brave.com/res/v1/web/search): a documented HTTP API, authenticated by a single subscription-token header, whose terms permit programmatic (non-browser) access — the three properties this package's backend was chosen for.
registry
Package registry is the process-wide web-search-backend registry.
Package registry is the process-wide web-search-backend registry.
export.go: storeDraft, the sidecar half of the tuple-authorized draft-export route (Task 6, pkg/web/workshopdraftsrv).
export.go: storeDraft, the sidecar half of the tuple-authorized draft-export route (Task 6, pkg/web/workshopdraftsrv).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL