Documentation
¶
Overview ¶
Package builtin is the registry of upstream's built-in extensions that PiG implements natively: the `builtin:<name>` extension paths of codemode and tool-search (docs/specs/builtin-codemode-tool-search.md).
Ports packages/coding-agent/src/extensions/index.ts (builtInExtensions).
Index ¶
Constants ¶
const PathPrefix = "builtin:"
PathPrefix starts the path of a built-in extension, as in `builtin:codemode`.
Ports packages/coding-agent/src/core/source-info.ts (BUILTIN_PATH_PREFIX).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodemodeOptions ¶
CodemodeOptions configures the codemode extension.
type Extension ¶
type Extension struct {
// Name is the part of the path after PathPrefix.
Name string
// Replaceable leaves the extension out when another extension registers a tool, command or flag it registers.
Replaceable bool
// Factory builds the extension: the Go counterpart of the factory that is the module's default export.
Factory func() (extension.Extension, error)
}
Extension is one built-in extension.
type Options ¶
type Options struct {
// Codemode configures the codemode extension (unused when built with the `nocodemode` tag).
Codemode CodemodeOptions
// Mcp configures the MCP extension (unused when built with the `pig_strip_mcp` tag).
Mcp McpOptions
}
Options configures the built-in extensions that need the session's settings or a cache location.
func (*Options) ConfigureCodemode ¶
ConfigureCodemode sets the sandbox's compilation cache directory and the settings source the tool reads on every use.
func (*Options) ConfigureMcp ¶
func (o *Options) ConfigureMcp(agentDir, configDirName string, openURL func(url string), copyToClipboard ...func(text string) error)
ConfigureMcp sets where the MCP extension reads `mcp.json` and keeps its credentials and log (the agent directory and the per-project configuration directory name), how it opens an OAuth authorization URL, and, when given, how it copies one.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package codemode is the built-in `codemode` extension: the tool that lets the model write JavaScript that calls other tools.
|
Package codemode is the built-in `codemode` extension: the tool that lets the model write JavaScript that calls other tools. |
|
Package toolsearch is the built-in `tool_search` extension: tool discovery with a BM25 ranker over tool metadata, shared by `searchTools()` in codemode scripts and the optional `tool_search` tool.
|
Package toolsearch is the built-in `tool_search` extension: tool discovery with a BM25 ranker over tool metadata, shared by `searchTools()` in codemode scripts and the optional `tool_search` tool. |