Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyBashFilter(command, rawOutput string, exit int) (string, int)
- func AuthorizeMCPServer(ctx context.Context, srv MCPServer, prompter MCPAuthPrompter) error
- func CollapseBlankLines(s string) string
- func ExpandBraces(s string) []string
- func ExpandMCPString(s string) string
- func ExtractBaseCommand(command string) string
- func FlattenNullableTypes(v any)
- func ForgetMCPServerAuth(serverURL string) error
- func GlobMatch(pattern, rel string) bool
- func GrepRun(ctx context.Context, rgPath string, p GrepParams, root string) (string, string)
- func HTMLToText(src string) string
- func IsCoreTool(name string) bool
- func IsTrivialCommand(command string) bool
- func LoadDotMCPJSON(cwd string) map[string]MCPServerConfig
- func LoadMCPOAuthToken(path string) (*oauth2.Token, error)
- func LooksBinary(head []byte) bool
- func MCPOAuthTokenPath(serverURL string) (string, error)
- func MCPResultText(res *mcp.CallToolResult) string
- func MCPServerAuthorized(serverURL string) bool
- func MCPToolAllowed(c MCPServerConfig, tool string) bool
- func MaybeSpill(r *BashResult, command, raw string)
- func PluginContentsMCPCount(c plugin.Contents) int
- func PluginMCPServers(cwd string) []pluginMCPServer
- func PublishItem(ctx context.Context, cwd string, m plugin.Marketplace, target PublishTarget, ...) (plugin.PublishResult, plugin.Publication, error)
- func PullItem(cwd, kind, name string) (plugin.Publication, error)
- func RecordSavings(baseCommand string, rawTokens, savedTokens int) error
- func ResolveAgentShell(lookPath func(string) (string, error), getenv func(string) string) string
- func RunAskPassHelper() error
- func SafeShellCommand(command string) bool
- func SaveMCPOAuthToken(path string, tok *oauth2.Token) error
- func SavingsPath() (string, error)
- func SpillDir() string
- func SpillRaw(command, raw string) (path string, lines int, err error)
- func TruncateLine(s string) string
- func TruncateMiddle(s string) string
- func UnwrapInvokeToolCall(input map[string]any) (string, map[string]any)
- func ValidateSudoCommand(command string) error
- func WorkflowProviderWarnings(cfg config.Config, w workflow.Def, fallbackProvider string) []string
- type AgentCreateInput
- type AgentCreateOutput
- type AgentDeleteInput
- type AgentDeleteOutput
- type AgentEditInput
- type AgentEditOutput
- type AskOption
- type AskOutput
- type AskParams
- type AskQuestion
- type AskResult
- type BashParams
- type BashResult
- type BraveResult
- type BridgeResult
- type CommandSavings
- type EditParams
- type EditResult
- type EndTurnParams
- type EndTurnResult
- type EndTurnSignal
- type ExtensionItemView
- type FetchParams
- type FetchResult
- type FileTracker
- type FinalizedPlanParams
- type FinalizedPlanResult
- type FinishWorkflowData
- type FinishWorkflowParams
- type FinishWorkflowResult
- type GlobParams
- type GlobResult
- type GrepMatch
- type GrepParams
- type GrepResult
- type ImageInjectionHook
- type ImageSink
- type InvokeToolParams
- type Job
- type JobKillParams
- type JobKillResult
- type JobManager
- type JobOutputParams
- type JobOutputResult
- type LoadMemoryResult
- type LsParams
- type LsResult
- type MCPAuthPrompter
- type MCPManager
- func (m *MCPManager) Attach(ctx context.Context, srv MCPServer) error
- func (m *MCPManager) AttachAll(ctx context.Context, servers []MCPServer)
- func (m *MCPManager) Close()
- func (m *MCPManager) Detach(name string)
- func (m *MCPManager) Reconcile(ctx context.Context, desired []MCPServer)
- func (m *MCPManager) Statuses() []MCPStatus
- func (m *MCPManager) Tools() []Tool
- func (m *MCPManager) Toolsets() []tool.Toolset
- type MCPOAuthCallback
- type MCPOAuthHandler
- type MCPServer
- type MCPServerConfig
- type MCPServerOrigin
- type MCPServerStatusKind
- type MCPStatus
- type MarketplaceAddInput
- type MarketplaceAddOutput
- type MarketplaceListInput
- type MarketplaceListOutput
- type MarketplacePluginView
- type MarketplaceSearchInput
- type MarketplaceSearchOutput
- type MarketplaceView
- type MemoryAdjustResult
- type MemoryAwareTool
- func (m *MemoryAwareTool) Declaration() *genai.FunctionDeclaration
- func (m *MemoryAwareTool) Description() string
- func (m *MemoryAwareTool) Info() ToolInfo
- func (m *MemoryAwareTool) IsLongRunning() bool
- func (m *MemoryAwareTool) Name() string
- func (m *MemoryAwareTool) ProcessRequest(ctx agent.Context, req *model.LLMRequest) error
- func (m *MemoryAwareTool) Run(ctx agent.Context, args any) (map[string]any, error)
- type MemoryForgetResult
- type MemoryIndexResult
- type MemoryRecallHook
- type NamedMCPServer
- type PendingImage
- type PersistingTokenSource
- type PluginInstallInput
- type PluginInstallOutput
- type PluginUninstallInput
- type PluginUninstallOutput
- type PluginView
- type PublishTarget
- type PublishedView
- type ReadParams
- type ReadResult
- type RenderDesignResult
- type ResolvedMCPServer
- type SaveArtifactParams
- type SaveArtifactResult
- type SearchToolsEntry
- type SearchToolsParams
- type SearchToolsResult
- type ShellHandle
- type ShellResult
- type SkillCreateInput
- type SkillCreateOutput
- type SkillDeleteInput
- type SkillDeleteOutput
- type SkillEditInput
- type SkillEditOutput
- type SkillGetInput
- type SkillGetOutput
- type SkillListInput
- type SkillListOutput
- type SkillPublishInput
- type SkillPublishOutput
- type SkillPullInput
- type SkillPullOutput
- type SudoIPCServer
- type TodoEntry
- type TodosParams
- type TodosResult
- type TokenSavings
- type Tool
- func AskUserQuestionTool(env *ToolEnv) Tool
- func BashTool(env *ToolEnv) Tool
- func BuildCoreTools(args engine.ToolFactoryArgs, attachWebSearch bool) []Tool
- func BuildSubagentTools(args engine.ToolFactoryArgs, attachWebSearch bool) []Tool
- func CoreTools(env *ToolEnv, registry func() []Tool, attachWebSearch bool) []Tool
- func EditTool(env *ToolEnv) Tool
- func EndTurnTool(env *ToolEnv) Tool
- func ExtensionTools(env *ToolEnv) []Tool
- func FetchTool(env *ToolEnv) Tool
- func FinalizedPlanTool(env *ToolEnv) Tool
- func FinishWorkflowTool(env *ToolEnv) Tool
- func GlobTool(env *ToolEnv) Tool
- func GrepTool(env *ToolEnv) Tool
- func InvokeToolTool(registry func() []Tool, isCore func(string) bool, env *ToolEnv) Tool
- func JobKillTool(env *ToolEnv) Tool
- func JobOutputTool(env *ToolEnv) Tool
- func LoadMemoryTool(cwd string) Tool
- func LsTool(env *ToolEnv) Tool
- func MemoryDemoteTool() Tool
- func MemoryForgetTool(...) Tool
- func MemoryIndexTool(cwd string, ...) Tool
- func MemoryReinforceTool() Tool
- func MemoryTools(cwd string, ...) []Tool
- func NativeBridgeTool[In, Out any](name, description string, ...) Tool
- func NewTypedTool[T, R any](name, description string, handler func(ctx agent.Context, params T) (R, error)) Tool
- func ReadTool(env *ToolEnv) Tool
- func RenderDesignTool(sink *ImageSink) Tool
- func SaveArtifactTool() Tool
- func SearchToolsTool(registry func() []Tool) Tool
- func TodosTool(env *ToolEnv) Tool
- func WebSearchTool(env *ToolEnv) Tool
- func WorkflowStepTools(env *ToolEnv, isFinal bool) []Tool
- func WorkflowTools(env *ToolEnv) []Tool
- func WrapFileToolsWithMemory(tools []Tool, cwd string) []Tool
- func WriteTool(env *ToolEnv) Tool
- type ToolEnv
- type ToolInfo
- type ToolResponse
- type WebSearchParams
- type WebSearchResult
- type WorkflowCopyInput
- type WorkflowCopyOutput
- type WorkflowCreateInput
- type WorkflowCreateOutput
- type WorkflowDefView
- type WorkflowDeleteInput
- type WorkflowDeleteOutput
- type WorkflowEditInput
- type WorkflowEditOutput
- type WorkflowGetInput
- type WorkflowGetOutput
- type WorkflowInnerListStepView
- type WorkflowInnerStepView
- type WorkflowListInput
- type WorkflowListItem
- type WorkflowListOutput
- type WorkflowListStepView
- type WorkflowStepView
- type WriteParams
- type WriteResult
Constants ¶
const ( BashDefaultTimeout = 120 * time.Second BashMaxTimeout = 600 * time.Second BashRawCap = 4 * MaxToolOutput )
const ( MaxToolOutput = 30_000 MaxLineLength = 2_000 MaxReadLines = 2_000 MaxReadBytes = 200_000 MaxSearchHits = 100 MaxListEntries = 1_000 ToolPhraseFieldDoc = "one short human-readable phrase (under 10 words) telling the user what this call is doing" )
const ( SkillListToolDescription = `` /* 540-byte string literal not displayed */ SkillGetToolDescription = `` /* 224-byte string literal not displayed */ SkillCreateToolDescription = `` /* 945-byte string literal not displayed */ SkillEditToolDescription = `` /* 292-byte string literal not displayed */ SkillDeleteToolDescription = `` /* 210-byte string literal not displayed */ AgentCreateToolDescription = `` /* 404-byte string literal not displayed */ AgentEditToolDescription = `` /* 205-byte string literal not displayed */ AgentDeleteToolDescription = `Delete a user- or project-scope agent definition. Plugin agents cannot be deleted here — uninstall the plugin.` MarketplaceListToolDescription = `` /* 215-byte string literal not displayed */ MarketplaceSearchToolDescription = `` /* 507-byte string literal not displayed */ MarketplaceAddToolDescription = `` /* 318-byte string literal not displayed */ PluginInstallToolDescription = `` /* 338-byte string literal not displayed */ PluginUninstallToolDescription = `Disable and remove an installed plugin in the given scope ('user' default, or 'project').` SkillPublishToolDescription = `` /* 812-byte string literal not displayed */ SkillPullToolDescription = `` /* 268-byte string literal not displayed */ )
const ( MCPConnectTimeout = 15 * time.Second MCPPingTimeout = 5 * time.Second )
const ( MCPServerTypeStdio = "stdio" MCPServerTypeHTTP = "http" MCPServerTypeSSE = "sse" )
const ( FetchMaxBytes = 100_000 FetchDefaultTimeout = 30 * time.Second FetchMaxTimeout = 120 * time.Second BraveSearchEndpoint = "https://api.search.brave.com/res/v1/web/search" BraveSearchDefaultN = 8 BraveSearchMaxResults = 20 BraveSearchTimeout = 20 * time.Second WebSearchNoKeyNotice = `` /* 373-byte string literal not displayed */ )
const ( WorkflowListToolDescription = `` /* 846-byte string literal not displayed */ WorkflowGetToolDescription = `` /* 323-byte string literal not displayed */ WorkflowCreateToolDescription = `` /* 740-byte string literal not displayed */ WorkflowEditToolDescription = `` /* 300-byte string literal not displayed */ WorkflowDeleteToolDescription = `Delete a workflow. When the name exists in multiple scopes you must pass scope to pick which copy to delete.` WorkflowCopyToolDescription = `` /* 361-byte string literal not displayed */ )
const AskToolDescription = `` /* 3568-byte string literal not displayed */
const BashToolDescription = `` /* 926-byte string literal not displayed */
const EditToolDescription = `` /* 285-byte string literal not displayed */
const EndTurnToolDescription = `` /* 1053-byte string literal not displayed */
const FetchToolDescription = `` /* 204-byte string literal not displayed */
const GlobToolDescription = `` /* 209-byte string literal not displayed */
const GrepToolDescription = `` /* 280-byte string literal not displayed */
const InvokeToolDescription = `` /* 387-byte string literal not displayed */
const JobKillToolDescription = `Kill a background job started with bash run_in_background. The job's whole process group receives SIGKILL.`
const JobOutputToolDescription = `` /* 135-byte string literal not displayed */
const LsToolDescription = `List a directory as a tree. Directories end with /. Use depth to limit recursion; output is capped at 1000 entries.`
const MCPOAuthFlowTimeout = 3 * time.Minute
const MaxGrepLineChars = 500
const ReadToolDescription = `` /* 364-byte string literal not displayed */
const SearchToolsDescription = `` /* 837-byte string literal not displayed */
const SpillDirEnv = "ASK_SPILL_DIR"
SpillDirEnv overrides the spill directory (tests, sandboxes).
const SpillPruneAge = 7 * 24 * time.Hour
SpillPruneAge is how long spilled files live before the next spill opportunistically deletes them.
const SpillThreshold = 30 * 1024
SpillThreshold is the raw-output size past which a lossy filter result spills the untouched bytes to a file for recovery.
const TodosToolDescription = `` /* 775-byte string literal not displayed */
const WebSearchToolDescription = `` /* 256-byte string literal not displayed */
const WorkflowHeadlessAskNotice = `` /* 268-byte string literal not displayed */
const WriteToolDescription = `` /* 168-byte string literal not displayed */
Variables ¶
var ( NewTextResponse = engine.NewTextResponse NewTextErrorResponse = engine.NewTextErrorResponse ExtractToolInfo = engine.ExtractToolInfo RunADKTool = engine.RunADKTool )
var BraveSearchClient = &http.Client{}
BraveSearchClient is swappable in tests.
var ErrMCPInteractiveAuthRequired = errors.New("mcp: interactive OAuth authorization required")
ErrMCPInteractiveAuthRequired is returned by a non-interactive handler's Authorize when a server demands OAuth. Startup (background) connections use it to mark a server "needs auth" instead of opening a browser and blocking.
var FetchClient = &http.Client{}
FetchClient is swappable in tests.
var ImageExts = map[string]bool{ ".png": true, ".jpg": true, ".jpeg": true, ".gif": true, ".webp": true, ".bmp": true, ".ico": true, ".tiff": true, }
ImageExts are rejected by tools because text-only models cannot process raw images.
var MCPOAuthOpenBrowser = func(authURL string) error { return exec.Command("xdg-open", authURL).Start() }
var MCPTransportFor = func(srv MCPServer, oauth *MCPOAuthHandler) (mcp.Transport, error) { switch srv.Cfg.EffectiveType() { case MCPServerTypeStdio: cmd := exec.Command(srv.Cfg.Command, srv.Cfg.Args...) cmd.Env = os.Environ() for k, v := range srv.Cfg.Env { cmd.Env = append(cmd.Env, k+"="+v) } return &mcp.CommandTransport{Command: cmd}, nil case MCPServerTypeSSE: httpClient := &http.Client{} var base http.RoundTripper = http.DefaultTransport if len(srv.Cfg.Headers) > 0 { base = headerRoundTripper{base: base, headers: srv.Cfg.Headers} } if oauth != nil { base = &oauthRoundTripper{base: base, handler: oauth} } httpClient.Transport = base return &mcp.SSEClientTransport{Endpoint: srv.Cfg.URL, HTTPClient: httpClient}, nil default: httpClient := &http.Client{} if len(srv.Cfg.Headers) > 0 { httpClient.Transport = headerRoundTripper{headers: srv.Cfg.Headers} } t := &mcp.StreamableClientTransport{ Endpoint: srv.Cfg.URL, HTTPClient: httpClient, } if oauth != nil { t.OAuthHandler = oauth } return t, nil } }
MCPTransportFor builds the wire transport for one server.
var RgPath, _ = exec.LookPath("rg")
var RunShell = RunShellProcess
RunShell is the swappable execution hook for shell commands.
Functions ¶
func ApplyBashFilter ¶
ApplyBashFilter compresses command output to save tokens. It dispatches through the command-aware semantic filter registry (pkg/tools/filters) and falls back to the universal squeeze/dedup/cap pipeline for anything unmodeled. exit steers verbosity: a successful run may collapse to a summary while a failing run keeps its detail.
func AuthorizeMCPServer ¶
func AuthorizeMCPServer(ctx context.Context, srv MCPServer, prompter MCPAuthPrompter) error
AuthorizeMCPServer runs the interactive OAuth flow for one server by making a single connection that forces the 401 -> discovery -> DCR -> browser -> token-exchange path, then persisting the token. Used by the Ctrl+S browser's "authorize" action; it does not require a live session.
func CollapseBlankLines ¶
CollapseBlankLines trims trailing spaces and squeezes consecutive blank lines.
func ExpandBraces ¶
ExpandBraces expands one level of {a,b,c} alternation.
func ExpandMCPString ¶
ExpandMCPString expands ${VAR} and ${VAR:-default} against the environment.
func ExtractBaseCommand ¶
ExtractBaseCommand returns the savings-ledger key for a command: its primary program plus, for subcommand-style tools, the subcommand ("go test", "git diff", "kubectl get"). It delegates to filters.LedgerKey so the ledger's keys and the filter registry always agree on what "the command" is — global flags (`git --no-pager diff`) and pipelines (`go test ./... | tail`) resolve to the same key the filter dispatches on.
func FlattenNullableTypes ¶
func FlattenNullableTypes(v any)
FlattenNullableTypes drops "null" from type arrays in json schema maps for backward compatibility.
func ForgetMCPServerAuth ¶
ForgetMCPServerAuth deletes the stored OAuth token for serverURL (sign out).
func HTMLToText ¶
HTMLToText reduces an HTML document to readable text.
func IsCoreTool ¶
IsCoreTool reports whether a tool name belongs to the core toolset.
func IsTrivialCommand ¶ added in v1.2.0
IsTrivialCommand reports whether a command is not a meaningful token- savings opportunity — its primary program is a pager, text transformer, or a tiny builtin (cat, grep, head, cd, echo, …), or there is no command at all. The bash tool skips these when recording savings so the ledger reflects real build/test/tooling commands rather than file reads and shell plumbing. It delegates to filters.IsTrivial.
func LoadDotMCPJSON ¶
func LoadDotMCPJSON(cwd string) map[string]MCPServerConfig
LoadDotMCPJSON reads the project-root `.mcp.json`.
func LoadMCPOAuthToken ¶
LoadMCPOAuthToken reads the stored access/refresh token for path.
func LooksBinary ¶
LooksBinary detects binary files via NUL bytes in the header.
func MCPOAuthTokenPath ¶
func MCPResultText ¶
func MCPResultText(res *mcp.CallToolResult) string
func MCPServerAuthorized ¶
MCPServerAuthorized reports whether a valid (unexpired) OAuth token is stored on disk for serverURL.
func MCPToolAllowed ¶
func MCPToolAllowed(c MCPServerConfig, tool string) bool
MCPToolAllowed applies the per-server enable/disable filters.
func MaybeSpill ¶
func MaybeSpill(r *BashResult, command, raw string)
MaybeSpill records the recovery path on a BashResult when its visible Output dropped bytes the raw output had.
func PluginContentsMCPCount ¶
PluginContentsMCPCount reports how many MCP servers a plugin's resolved contents declare across bundled files and inline objects. Used for the install summary so an MCP-only plugin doesn't look like it installed nothing.
func PluginMCPServers ¶
func PluginMCPServers(cwd string) []pluginMCPServer
PluginMCPServers returns the MCP servers declared by every enabled plugin (plugin-root .mcp.json, mcps/*.json, and inline manifest/entry `mcpServers` objects), with ${CLAUDE_PLUGIN_ROOT} expanded to each plugin's installed directory. Later plugins win on a name clash; ordering is by plugin ref then server name for determinism.
func PublishItem ¶
func PublishItem(ctx context.Context, cwd string, m plugin.Marketplace, target PublishTarget, pluginName, description, version, message string, noPush bool) (plugin.PublishResult, plugin.Publication, error)
PublishItem publishes a local item and records (or updates) its publication link. Shared by skill_publish and the browser.
func PullItem ¶
func PullItem(cwd, kind, name string) (plugin.Publication, error)
PullItem replaces a local item with its published copy.
func RecordSavings ¶
RecordSavings increments the run count plus the raw and saved token counts for a base command under a file lock. rawTokens is the untouched output's estimate, savedTokens the reduction; the percentage saved is derived from the two. A zero saving is still recorded — a real command that compressed to nothing this run is a coverage data point, so the overlay reflects every modeled command, not only the ones that won. Callers gate out trivial/pager commands (see IsTrivialCommand) before recording, and clamp keeps a defensive negative from underflowing the totals.
func ResolveAgentShell ¶ added in v1.9.0
ResolveAgentShell picks the shell for the agent bash tool, preferring bash, then zsh, then the user's $SHELL, then /bin/sh. lookPath and getenv are injected so the preference order is testable without depending on the host's PATH or environment.
func RunAskPassHelper ¶
func RunAskPassHelper() error
RunAskPassHelper connects to the IPC server and reads the password.
func SafeShellCommand ¶
SafeShellCommand reports whether command may run without an approval prompt.
func SaveMCPOAuthToken ¶
SaveMCPOAuthToken persists an access/refresh token (no client registration).
func SavingsPath ¶
SavingsPath returns the token-savings ledger path (~/.config/ask/savings.json).
func SpillDir ¶
func SpillDir() string
SpillDir returns where oversized raw outputs spill: $ASK_SPILL_DIR, else $TMPDIR/ask-spill.
func SpillRaw ¶
SpillRaw writes raw output to a uniquely-named file in SpillDir and returns the path plus line count. This is the recovery path for lossy filtering: the model pages the untouched bytes back through the read tool's offset/limit continuation.
func TruncateLine ¶
TruncateLine truncates a single line at MaxLineLength.
func TruncateMiddle ¶
TruncateMiddle truncates a long string keeping head and tail.
func UnwrapInvokeToolCall ¶
UnwrapInvokeToolCall maps an invoke_tool call to the inner tool for transcript display.
func ValidateSudoCommand ¶
ValidateSudoCommand checks if command invokes sudo and verifies that -A or --askpass is passed as its first argument.
Types ¶
type AgentCreateInput ¶
type AgentCreateInput struct {
Name string `json:"name" jsonschema:"kebab-case agent name"`
Description string `json:"description" jsonschema:"when to delegate to this agent"`
Prompt string `json:"prompt" jsonschema:"the agent's system prompt"`
Scope string `json:"scope,omitempty" jsonschema:"'project' (default) or 'user'"`
Tools []string `json:"tools,omitempty" jsonschema:"tool allow-list; '*' for the coding core"`
Provider string `json:"provider,omitempty" jsonschema:"pin an in-process provider id"`
Model string `json:"model,omitempty" jsonschema:"pin a model id"`
}
type AgentCreateOutput ¶
type AgentCreateOutput struct {
Agent ExtensionItemView `json:"agent"`
}
func AgentCreateCore ¶
func AgentCreateCore(cwd string, in AgentCreateInput) (*mcp.CallToolResult, AgentCreateOutput, error)
type AgentDeleteInput ¶
type AgentDeleteOutput ¶
type AgentDeleteOutput struct {
Deleted bool `json:"deleted"`
}
func AgentDeleteCore ¶
func AgentDeleteCore(cwd string, in AgentDeleteInput) (*mcp.CallToolResult, AgentDeleteOutput, error)
type AgentEditInput ¶
type AgentEditInput struct {
Name string `json:"name" jsonschema:"existing agent name"`
Scope string `json:"scope,omitempty" jsonschema:"'user' or 'project' when the name is ambiguous"`
Description *string `json:"description,omitempty"`
Prompt *string `json:"prompt,omitempty" jsonschema:"replaces the system prompt"`
Tools *[]string `json:"tools,omitempty"`
Provider *string `json:"provider,omitempty" jsonschema:"empty string clears the pin"`
Model *string `json:"model,omitempty" jsonschema:"empty string clears the pin"`
}
type AgentEditOutput ¶
type AgentEditOutput struct {
Agent ExtensionItemView `json:"agent"`
}
func AgentEditCore ¶
func AgentEditCore(cwd string, in AgentEditInput) (*mcp.CallToolResult, AgentEditOutput, error)
type AskOutput ¶
type AskOutput struct {
Answers []engine.QuestionAnswer `json:"answers"`
}
type AskParams ¶
type AskParams struct {
Questions []AskQuestion `json:"questions" jsonschema:"one or more questions to ask the user together in a tabbed modal"`
Description string `json:"description" jsonschema:"one short human-readable phrase (under 10 words) telling the user what is being asked"`
}
type AskQuestion ¶
type AskQuestion struct {
Kind string `json:"kind" jsonschema:"one of pick_one, pick_many, pick_diagram"`
Prompt string `json:"prompt" jsonschema:"the question shown to the user"`
Options []AskOption `json:"options" jsonschema:"list of options for the user to choose from"`
AllowCustom bool `json:"allow_custom,omitempty" jsonschema:"append an Enter-your-own free-text option (pick_one and pick_many only)"`
}
type AskResult ¶
type AskResult struct {
Answers []engine.QuestionAnswer `json:"answers,omitempty" jsonschema:"one entry per question asked"`
Notice string `json:"notice,omitempty" jsonschema:"why no answers were collected"`
Cancelled bool `json:"cancelled,omitempty"`
Headless bool `json:"headless,omitempty" jsonschema:"true when no human was available to answer"`
}
AskUserQuestionTool returns the interactive ask_user_question tool. AskResult is the ask_user_question tool's response.
type BashParams ¶
type BashParams struct {
Command string `json:"command" jsonschema:"the shell command to execute"`
Description string `json:"description" jsonschema:"one short human-readable phrase (under 10 words) telling the user what this command does"`
Timeout int `json:"timeout,omitempty" jsonschema:"max seconds to wait before the command is killed (default 120, max 600)"`
RunInBackground bool `json:"run_in_background,omitempty" jsonschema:"start the command as a background job and return its job id immediately"`
DisableTokenSavings bool `` /* 163-byte string literal not displayed */
}
type BashResult ¶
type BashResult struct {
Output string `json:"output,omitempty" jsonschema:"combined stdout and stderr"`
ExitCode int `json:"exit_code" jsonschema:"process exit code"`
JobID string `json:"job_id,omitempty" jsonschema:"set when the command was started in the background"`
TimedOut bool `json:"timed_out,omitempty" jsonschema:"true when the command was killed for exceeding its timeout"`
Cancelled bool `json:"cancelled,omitempty" jsonschema:"true when the command was cancelled"`
Truncated bool `json:"truncated,omitempty" jsonschema:"true when output exceeded the in-memory cap"`
RawPath string `` /* 179-byte string literal not displayed */
RawLines int `json:"raw_lines,omitempty" jsonschema:"line count of the raw_path file"`
}
BashResult is the bash tool's response.
type BraveResult ¶
type BraveResult struct {
Title string `json:"title"`
URL string `json:"url"`
Description string `json:"description"`
}
BraveResult represents one search result item.
func BraveSearch ¶
BraveSearch performs a Brave Web Search query.
type BridgeResult ¶
type BridgeResult[Out any] struct { Content string `json:"content,omitempty" jsonschema:"text form of the tool result"` Data Out `json:"data,omitempty" jsonschema:"the tool's structured output"` }
BridgeResult is the typed response of a bridge tool: the handler's own output struct, plus the text form of the MCP result it wraps.
type CommandSavings ¶
type EditParams ¶
type EditParams struct {
FilePath string `json:"file_path" jsonschema:"absolute or cwd-relative path of the file to edit"`
OldString string `json:"old_string" jsonschema:"the exact text to replace; empty creates a new file with new_string as its content"`
NewString string `json:"new_string" jsonschema:"the replacement text"`
ReplaceAll bool `json:"replace_all,omitempty" jsonschema:"replace every occurrence of old_string instead of requiring uniqueness"`
Description string `json:"description" jsonschema:"one short human-readable phrase (under 10 words) telling the user what this call is doing"`
}
type EditResult ¶
type EditResult struct {
Path string `json:"path,omitempty" jsonschema:"absolute path edited"`
Created bool `json:"created,omitempty" jsonschema:"true when the edit created the file"`
Replacements int `json:"replacements,omitempty" jsonschema:"number of occurrences replaced"`
Notice string `json:"notice,omitempty" jsonschema:"guidance the caller must act on before retrying"`
}
EditResult is the edit tool's response.
type EndTurnParams ¶
type EndTurnResult ¶
type EndTurnResult struct {
Recorded bool `json:"recorded,omitempty"`
Note string `json:"note,omitempty" jsonschema:"guidance about what happens next"`
}
EndTurnTool registers the workflow step summary and loop decision. EndTurnResult is the end_turn tool's response.
type EndTurnSignal ¶
EndTurnSignal carries loop decision data emitted by the end_turn tool.
type ExtensionItemView ¶
type ExtensionItemView struct {
Kind string `json:"kind" jsonschema:"'skill', 'agent', or 'workflow'"`
Name string `json:"name" jsonschema:"invocation name; plugin items are 'plugin:name'"`
Description string `json:"description,omitempty"`
Origin string `json:"origin" jsonschema:"'user', 'project', or 'plugin <name@marketplace>'"`
Scope string `json:"scope" jsonschema:"'user', 'project', or 'plugin'"`
Plugin string `json:"plugin,omitempty" jsonschema:"name@marketplace for plugin items"`
Path string `json:"path,omitempty"`
SlashCommand string `json:"slash_command,omitempty" jsonschema:"how the user invokes the skill"`
UserInvocable *bool `json:"user_invocable,omitempty"`
ModelInvocable *bool `json:"model_invocable,omitempty" jsonschema:"false when disable-model-invocation is set"`
Provider string `json:"provider,omitempty" jsonschema:"agents: pinned provider"`
Model string `json:"model,omitempty" jsonschema:"agents: pinned model"`
Tools []string `json:"tools,omitempty" jsonschema:"agents: tool allow-list"`
Steps []string `json:"steps,omitempty" jsonschema:"workflows: 'name (provider/model)' per step"`
Warnings []string `json:"warnings,omitempty" jsonschema:"workflows: steps whose provider is not configured"`
Published *PublishedView `json:"published,omitempty" jsonschema:"set when this local item was published to a marketplace"`
}
type FetchParams ¶
type FetchParams struct {
URL string `json:"url" jsonschema:"the http(s) URL to fetch"`
Timeout int `json:"timeout,omitempty" jsonschema:"max seconds to wait (default 30, max 120)"`
Description string `json:"description" jsonschema:"one short human-readable phrase (under 10 words) telling the user what this call is doing"`
}
type FetchResult ¶
type FetchResult struct {
URL string `json:"url,omitempty"`
Status int `json:"status,omitempty" jsonschema:"HTTP status code"`
ContentType string `json:"content_type,omitempty"`
Body string `json:"body,omitempty" jsonschema:"extracted text of the page"`
Truncated bool `json:"truncated,omitempty" jsonschema:"true when the body exceeded the fetch cap"`
}
FetchTool returns the native fetch tool. FetchResult is the fetch tool's response.
type FileTracker ¶
type FileTracker struct {
// contains filtered or unexported fields
}
FileTracker tracks when files were last read to enforce read-before-modify rules.
func NewFileTracker ¶
func NewFileTracker() *FileTracker
func (*FileTracker) RecordRead ¶
func (t *FileTracker) RecordRead(path string)
type FinalizedPlanParams ¶
type FinalizedPlanResult ¶
type FinalizedPlanResult struct {
Outcome string `json:"outcome,omitempty" jsonschema:"what the user decided and what to do next"`
Approved bool `json:"approved,omitempty"`
Workflow string `json:"workflow,omitempty" jsonschema:"name of the workflow that ran, when one did"`
}
FinalizedPlanTool presents a finalized plan for confirmation or workflow dispatch. FinalizedPlanResult is the finalized_plan tool's response.
type FinishWorkflowData ¶
FinishWorkflowData carries the final outcome data emitted by the finish_workflow tool.
type FinishWorkflowParams ¶
type FinishWorkflowResult ¶
type FinishWorkflowResult struct {
Recorded bool `json:"recorded,omitempty"`
Next string `json:"next,omitempty" jsonschema:"what the caller must do next"`
}
FinishWorkflowTool records final workflow artifacts and outcome description. FinishWorkflowResult is the finish_workflow tool's response.
type GlobParams ¶
type GlobParams struct {
Pattern string `json:"pattern" jsonschema:"glob pattern matched against paths relative to the search directory"`
Path string `json:"path,omitempty" jsonschema:"directory to search (default: working directory)"`
Description string `json:"description" jsonschema:"one short human-readable phrase (under 10 words) telling the user what this call is doing"`
}
type GlobResult ¶
type GlobResult struct {
Listing string `json:"listing,omitempty" jsonschema:"matching file paths, one per line"`
Matches int `json:"matches,omitempty" jsonschema:"number of files matched"`
Truncated bool `json:"truncated,omitempty" jsonschema:"true when more files matched than were listed"`
}
GlobTool returns the native glob tool. GlobResult is the glob tool's response.
type GrepParams ¶
type GrepParams struct {
Pattern string `json:"pattern" jsonschema:"regular expression to search for (exact string when literal_text is set)"`
Path string `json:"path,omitempty" jsonschema:"directory or file to search (default: working directory)"`
Include string `json:"include,omitempty" jsonschema:"only search files matching this glob, e.g. *.go or *.{ts,tsx}"`
LiteralText bool `json:"literal_text,omitempty" jsonschema:"treat pattern as a literal string instead of a regexp"`
Description string `json:"description" jsonschema:"one short human-readable phrase (under 10 words) telling the user what this call is doing"`
}
type GrepResult ¶
type GrepResult struct {
Listing string `json:"listing,omitempty" jsonschema:"matching lines, prefixed with file and line number"`
}
GrepTool returns the native grep tool. GrepResult is the grep tool's response.
type ImageInjectionHook ¶ added in v1.10.0
type ImageInjectionHook struct {
// contains filtered or unexported fields
}
ImageInjectionHook is a request processor, not a callable tool: before each model call it drains the session's ImageSink and appends any pending images as user content parts so the model can see them. It registers no function declaration, so it stays invisible to the model — the same technique MemoryRecallHook uses to run per request without becoming a tool the model can call. supportsImages gates injection: when the model has no vision the images are dropped (the producing tool's text result stands in for them).
func NewImageInjectionHook ¶ added in v1.10.0
func NewImageInjectionHook(sink *ImageSink, supportsImages func() bool) *ImageInjectionHook
NewImageInjectionHook builds the injection hook over a shared sink.
func (*ImageInjectionHook) Description ¶ added in v1.10.0
func (h *ImageInjectionHook) Description() string
func (*ImageInjectionHook) IsLongRunning ¶ added in v1.10.0
func (h *ImageInjectionHook) IsLongRunning() bool
func (*ImageInjectionHook) Name ¶ added in v1.10.0
func (h *ImageInjectionHook) Name() string
func (*ImageInjectionHook) ProcessRequest ¶ added in v1.10.0
func (h *ImageInjectionHook) ProcessRequest(ctx agent.Context, req *model.LLMRequest) error
ProcessRequest implements ADK's request processor.
type ImageSink ¶ added in v1.10.0
type ImageSink struct {
// contains filtered or unexported fields
}
ImageSink collects images produced by tools so a request processor can feed them to the model as inline image parts. A tool result is text/JSON on every provider (ADK puts it in FunctionResponse.Response and OpenRouter in a string tool message), so bytes returned from a tool never reach the model as an image. The only cross-provider path is an InlineData part in a user content, which is exactly what pasted images use. The sink is the shared handoff between the tool that renders an image and the hook that injects it.
func NewImageSink ¶ added in v1.10.0
func NewImageSink() *ImageSink
NewImageSink creates an empty per-session image sink.
func (*ImageSink) Add ¶ added in v1.10.0
func (s *ImageSink) Add(img PendingImage)
Add queues an image for injection. A nil sink or empty image is ignored.
func (*ImageSink) Drain ¶ added in v1.10.0
func (s *ImageSink) Drain() []PendingImage
Drain returns and clears the queued images.
type InvokeToolParams ¶
type Job ¶
type Job struct {
ID string
Command string
Mu sync.Mutex
Buf strings.Builder
Truncated bool
Done bool
Result ShellResult
DisableSavings bool
SavingsRecorded bool
Kill func()
DoneCh chan struct{}
}
Job represents one background shell command.
func (*Job) AppendOutput ¶
func (*Job) Finish ¶
func (j *Job) Finish(r ShellResult)
type JobKillParams ¶
type JobKillResult ¶
type JobKillResult struct {
JobID string `json:"job_id,omitempty"`
Killed bool `json:"killed,omitempty"`
ExitCode int `json:"exit_code,omitempty"`
}
JobKillResult is the job_kill tool's response.
type JobManager ¶
type JobManager struct {
// contains filtered or unexported fields
}
JobManager tracks background execution jobs.
func NewJobManager ¶
func NewJobManager() *JobManager
func (*JobManager) Add ¶
func (m *JobManager) Add(command string, disableSavings bool, kill func()) *Job
func (*JobManager) Get ¶
func (m *JobManager) Get(id string) *Job
func (*JobManager) KillAll ¶
func (m *JobManager) KillAll()
type JobOutputParams ¶
type JobOutputParams struct {
JobID string `json:"job_id" jsonschema:"the job id returned when the background command started"`
Wait bool `json:"wait,omitempty" jsonschema:"block until the job finishes (30s cap) before returning output"`
Description string `json:"description" jsonschema:"one short human-readable phrase (under 10 words) telling the user what this call is doing"`
}
type JobOutputResult ¶
type JobOutputResult struct {
JobID string `json:"job_id,omitempty"`
Command string `json:"command,omitempty"`
Status string `json:"status,omitempty" jsonschema:"running or exited"`
Output string `json:"output,omitempty"`
RawPath string `` /* 164-byte string literal not displayed */
RawLines int `json:"raw_lines,omitempty" jsonschema:"line count of the raw_path file"`
}
JobOutputResult is the job_output tool's response.
type LoadMemoryResult ¶
type LoadMemoryResult struct {
Memories string `json:"memories,omitempty" jsonschema:"matching concepts, #id [kind · topic] title with bodies"`
Count int `json:"count,omitempty"`
Topic string `json:"topic,omitempty" jsonschema:"the topic the matches share"`
}
LoadMemoryResult is the load_memory tool's response.
type LsParams ¶
type LsParams struct {
Path string `json:"path,omitempty" jsonschema:"directory to list (default: working directory)"`
Depth int `json:"depth,omitempty" jsonschema:"maximum directory depth to descend (0 = unlimited)"`
Description string `json:"description" jsonschema:"one short human-readable phrase (under 10 words) telling the user what this call is doing"`
}
type LsResult ¶
type LsResult struct {
Listing string `json:"listing,omitempty" jsonschema:"directory tree"`
}
LsTool returns the native ls tool. LsResult is the ls tool's response.
type MCPAuthPrompter ¶
MCPAuthPrompter presents an authorization URL to the user during an interactive OAuth flow and returns the browser's redirect URL (the callback URL the authorization server redirected to, carrying ?code=…&state=…) or a bare authorization code, pasted back at the terminal. It is how ask completes OAuth over SSH, where the loopback redirect on the ask host is unreachable from the browser on the user's machine: the user copies the auth URL, approves in a local browser, and pastes the redirected URL back.
The prompter blocks until the user submits a value or cancels. Returning a non-nil error (e.g. the user pressed Esc) cancels the flow. Implementations must honor ctx: when the loopback callback resolves first, the flow cancels ctx to dismiss the prompt.
type MCPManager ¶
type MCPManager struct {
// contains filtered or unexported fields
}
MCPManager owns all MCP server attachments for a session.
func NewMCPManager ¶
func NewMCPManager(tabID int, imagesOK func() bool, imageSink *ImageSink, onToolsChanged, onStatusChanged func(), interaction engine.InteractionHandler) *MCPManager
NewMCPManager creates a new MCPManager. onStatusChanged fires whenever a server's connection/auth state changes (nil is allowed).
func (*MCPManager) Attach ¶
func (m *MCPManager) Attach(ctx context.Context, srv MCPServer) error
Attach connects a single server. A server that needs interactive OAuth is tracked as needs-auth (not a hard failure); other failures are tracked as errors; success is tracked as connected.
func (*MCPManager) AttachAll ¶
func (m *MCPManager) AttachAll(ctx context.Context, servers []MCPServer)
AttachAll connects all servers concurrently.
func (*MCPManager) Detach ¶
func (m *MCPManager) Detach(name string)
Detach closes and removes the connection (and tracked state) for a server by name. No-op if absent.
func (*MCPManager) Reconcile ¶
func (m *MCPManager) Reconcile(ctx context.Context, desired []MCPServer)
Reconcile brings the live connection set in line with the desired servers: attaches any that are new, detaches any no longer desired, and reattaches one whose config changed. Called when the browser toggles a server or an authorization completes.
func (*MCPManager) Statuses ¶
func (m *MCPManager) Statuses() []MCPStatus
Statuses returns a snapshot of every tracked server's live state.
func (*MCPManager) Tools ¶
func (m *MCPManager) Tools() []Tool
Tools returns the snapshot of all current tools across all connected servers.
func (*MCPManager) Toolsets ¶
func (m *MCPManager) Toolsets() []tool.Toolset
Toolsets returns all active ADK mcptoolset.Toolset instances.
type MCPOAuthCallback ¶
type MCPOAuthCallback struct {
URL string
// contains filtered or unexported fields
}
MCPOAuthCallback is the eager loopback receiver used directly by tests and as a simple one-shot capture. The handler uses a lazy variant so auto-attaching to many servers never holds a listener per server.
func NewMCPOAuthCallback ¶
func NewMCPOAuthCallback() (*MCPOAuthCallback, error)
func (*MCPOAuthCallback) Close ¶
func (cb *MCPOAuthCallback) Close()
func (*MCPOAuthCallback) Fetch ¶
func (cb *MCPOAuthCallback) Fetch(ctx context.Context, args *auth.AuthorizationArgs) (*auth.AuthorizationResult, error)
type MCPOAuthHandler ¶
type MCPOAuthHandler struct {
// contains filtered or unexported fields
}
MCPOAuthHandler implements auth.OAuthHandler for an http/sse MCP server: SDK authorization-code + PKCE + dynamic client registration, with the resolved client registration and token persisted for headless refresh. A non-interactive handler (startup) returns ErrMCPInteractiveAuthRequired on a 401 instead of opening a browser, so a missing token surfaces as a needs-auth state; the user triggers the interactive flow explicitly.
func NewMCPOAuthHandler ¶
func NewMCPOAuthHandler(serverURL string, interactive bool, prompter MCPAuthPrompter) (*MCPOAuthHandler, error)
NewMCPOAuthHandler builds an OAuth handler for an http/sse MCP server. interactive=false makes Authorize return ErrMCPInteractiveAuthRequired instead of opening a browser. A saved token (with its client registration) is restored so refreshes and restarts stay headless. prompter, when non-nil, drives the interactive copy-link / paste-redirect UX; pass nil for the non-interactive startup path.
func (*MCPOAuthHandler) Close ¶
func (h *MCPOAuthHandler) Close()
func (*MCPOAuthHandler) TokenSource ¶
func (h *MCPOAuthHandler) TokenSource(ctx context.Context) (oauth2.TokenSource, error)
type MCPServer ¶
type MCPServer struct {
Name string
Cfg MCPServerConfig
Skip map[string]bool
}
MCPServer describes one MCP server to attach.
func (MCPServer) ConnectTimeout ¶
type MCPServerConfig ¶
type MCPServerConfig struct {
Type string `json:"type,omitempty"`
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
URL string `json:"url,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
OAuth bool `json:"oauth,omitempty"`
Disabled bool `json:"disabled,omitempty"`
TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
EnabledTools []string `json:"enabledTools,omitempty"`
DisabledTools []string `json:"disabledTools,omitempty"`
}
MCPServerConfig describes one user-configured MCP server.
func (MCPServerConfig) EffectiveType ¶
func (c MCPServerConfig) EffectiveType() string
EffectiveType resolves type inference for MCP server config.
func (MCPServerConfig) Expanded ¶
func (c MCPServerConfig) Expanded() MCPServerConfig
Expanded returns a copy with every string field env-expanded.
type MCPServerOrigin ¶
type MCPServerOrigin int
MCPServerOrigin identifies where an MCP server was configured.
const ( MCPOriginPlugin MCPServerOrigin = iota // a plugin's .mcp.json / mcps/ MCPOriginProjectFile // the project-root .mcp.json MCPOriginUser // user config mcpServers MCPOriginProject // per-project config mcpServers )
func (MCPServerOrigin) String ¶
func (o MCPServerOrigin) String() string
type MCPServerStatusKind ¶
type MCPServerStatusKind int
MCPServerStatusKind is a server's live connection/auth state in a session.
const ( MCPStatusConnected MCPServerStatusKind = iota MCPStatusNeedsAuth MCPStatusError )
type MCPStatus ¶
type MCPStatus struct {
Name string
Kind MCPServerStatusKind
Detail string // error text when Kind == MCPStatusError
}
MCPStatus is a snapshot of one server's live state in a session.
type MarketplaceAddInput ¶
type MarketplaceAddOutput ¶
type MarketplaceAddOutput struct {
Marketplace MarketplaceView `json:"marketplace"`
}
func MarketplaceAddCore ¶
func MarketplaceAddCore(ctx context.Context, cwd string, in MarketplaceAddInput) (*mcp.CallToolResult, MarketplaceAddOutput, error)
type MarketplaceListInput ¶
type MarketplaceListInput struct{}
type MarketplaceListOutput ¶
type MarketplaceListOutput struct {
Marketplaces []MarketplaceView `json:"marketplaces"`
}
func MarketplaceListCore ¶
func MarketplaceListCore(cwd string, _ MarketplaceListInput) (*mcp.CallToolResult, MarketplaceListOutput, error)
type MarketplacePluginView ¶
type MarketplacePluginView struct {
Ref string `json:"ref" jsonschema:"name@marketplace — pass to plugin_install"`
Description string `json:"description,omitempty"`
Version string `json:"version,omitempty"`
Category string `json:"category,omitempty"`
Source string `json:"source,omitempty"`
Skills []string `json:"skills,omitempty" jsonschema:"skill paths the catalog lists"`
Installed bool `json:"installed"`
}
func MarketplaceSearch ¶
func MarketplaceSearch(cwd, query, onlyMarketplace string) []MarketplacePluginView
MarketplaceSearch is the search behind marketplace_search and the browser's marketplace lens.
type MarketplaceSearchInput ¶
type MarketplaceSearchOutput ¶
type MarketplaceSearchOutput struct {
Matches []MarketplacePluginView `json:"matches"`
}
func MarketplaceSearchCore ¶
func MarketplaceSearchCore(cwd string, in MarketplaceSearchInput) (*mcp.CallToolResult, MarketplaceSearchOutput, error)
type MarketplaceView ¶
type MarketplaceView struct {
Name string `json:"name"`
Scope string `json:"scope" jsonschema:"'user' or 'project'"`
Source string `json:"source"`
Fetched bool `json:"fetched" jsonschema:"catalog available on this machine"`
Writable bool `json:"writable" jsonschema:"skill_publish can land plugins here"`
Plugins int `json:"plugins"`
Error string `json:"error,omitempty"`
}
type MemoryAdjustResult ¶
type MemoryAdjustResult struct {
Applied bool `json:"applied"`
Weight float64 `json:"weight,omitempty"`
Note string `json:"note,omitempty"`
}
MemoryAdjustResult is the memory_reinforce / memory_demote response.
type MemoryAwareTool ¶
MemoryAwareTool decorates a file tool (read / edit / write) so the tool output carries relevant memory recall context for the touched file path.
func (*MemoryAwareTool) Declaration ¶
func (m *MemoryAwareTool) Declaration() *genai.FunctionDeclaration
func (*MemoryAwareTool) Description ¶
func (m *MemoryAwareTool) Description() string
func (*MemoryAwareTool) Info ¶
func (m *MemoryAwareTool) Info() ToolInfo
func (*MemoryAwareTool) IsLongRunning ¶
func (m *MemoryAwareTool) IsLongRunning() bool
func (*MemoryAwareTool) Name ¶
func (m *MemoryAwareTool) Name() string
func (*MemoryAwareTool) ProcessRequest ¶
func (m *MemoryAwareTool) ProcessRequest(ctx agent.Context, req *model.LLMRequest) error
type MemoryForgetResult ¶
type MemoryForgetResult struct {
Forgotten bool `json:"forgotten,omitempty"`
}
MemoryForgetResult is the memory_forget response.
type MemoryIndexResult ¶
type MemoryIndexResult struct {
Indexed bool `json:"indexed,omitempty"`
ID int64 `json:"id,omitempty"`
}
MemoryIndexResult is the memory_index tool's response.
type MemoryRecallHook ¶
type MemoryRecallHook struct {
// contains filtered or unexported fields
}
MemoryRecallHook is the per-request recall: it embeds the turn's user text, recalls concepts in the project and global scopes, and appends the block to the turn's user message. The block is computed once per invocation so every request of the turn carries the same text.
func PreloadMemoryTool ¶
func PreloadMemoryTool(cwd string, topic func() string, onTopic func(string)) *MemoryRecallHook
PreloadMemoryTool builds the recall hook. topic supplies the tab's current topic (nil means none); onTopic receives the topic each turn's hits imply (nil to ignore).
func (*MemoryRecallHook) Block ¶
func (h *MemoryRecallHook) Block() string
Block returns the block computed for the current invocation.
func (*MemoryRecallHook) Description ¶
func (h *MemoryRecallHook) Description() string
func (*MemoryRecallHook) IsLongRunning ¶
func (h *MemoryRecallHook) IsLongRunning() bool
func (*MemoryRecallHook) Name ¶
func (h *MemoryRecallHook) Name() string
func (*MemoryRecallHook) ProcessRequest ¶
func (h *MemoryRecallHook) ProcessRequest(ctx agent.Context, req *model.LLMRequest) error
ProcessRequest implements ADK's request processor: it runs before every model call and never becomes a function declaration.
type NamedMCPServer ¶
type NamedMCPServer struct {
Name string
Config MCPServerConfig
}
NamedMCPServer pairs a server name with its resolved config.
func ResolveMCPServers ¶
func ResolveMCPServers(cfg config.Config, cwd string) []NamedMCPServer
ResolveMCPServers returns the servers that should actually be attached to a session: effective-enabled, env-expanded, and non-empty (a command or a URL). Disabled servers are dropped.
type PendingImage ¶ added in v1.10.0
PendingImage is an image produced by a tool during a turn, waiting to be handed to the model before the next model call.
type PersistingTokenSource ¶
type PersistingTokenSource struct {
// contains filtered or unexported fields
}
PersistingTokenSource wraps a token source and writes the token to disk on change. Retained for callers/tests that persist a plain access/refresh token without a captured client registration.
type PluginInstallInput ¶
type PluginInstallOutput ¶
type PluginInstallOutput struct {
Plugin PluginView `json:"plugin"`
}
func PluginInstallCore ¶
func PluginInstallCore(ctx context.Context, cwd string, in PluginInstallInput) (*mcp.CallToolResult, PluginInstallOutput, error)
type PluginUninstallInput ¶
type PluginUninstallOutput ¶
type PluginUninstallOutput struct {
Removed bool `json:"removed"`
}
func PluginUninstallCore ¶
func PluginUninstallCore(cwd string, in PluginUninstallInput) (*mcp.CallToolResult, PluginUninstallOutput, error)
type PluginView ¶
type PluginView struct {
Ref string `json:"ref" jsonschema:"name@marketplace"`
Description string `json:"description,omitempty"`
Version string `json:"version,omitempty"`
Scopes []string `json:"scopes" jsonschema:"where it is enabled: user and/or project"`
Missing bool `json:"missing,omitempty" jsonschema:"enabled by the project file but not fetched on this machine"`
Skills []string `json:"skills,omitempty"`
Agents []string `json:"agents,omitempty"`
Workflows []string `json:"workflows,omitempty"`
}
type PublishTarget ¶
type PublishTarget struct {
Req plugin.PublishRequest
Kind string
Name string
Scope string
LocalPath string
LocalHash string
File string
// contains filtered or unexported fields
}
PublishTarget is a local skill, agent, or workflow resolved for publishing: the publish request plus what the publication link needs.
func PublishTargetFor ¶
func PublishTargetFor(cwd, kind, name string) (PublishTarget, error)
PublishTargetFor resolves a local item. Shared by skill_publish, skill_pull, the sync status, and the browser.
func (*PublishTarget) Prepare ¶
func (t *PublishTarget) Prepare() (func(), error)
Prepare materializes anything the publish request needs and returns the cleanup to run after publishing.
type PublishedView ¶
type PublishedView struct {
Marketplace string `json:"marketplace"`
Plugin string `json:"plugin" jsonschema:"name@marketplace"`
Version string `json:"version,omitempty"`
Status string `` /* 149-byte string literal not displayed */
}
PublishedView is the link between a local item and its plugin.
type ReadParams ¶
type ReadParams struct {
FilePath string `json:"file_path" jsonschema:"absolute or cwd-relative path of the file to read"`
Offset int `json:"offset,omitempty" jsonschema:"1-based line number to start reading from (default 1)"`
Limit int `json:"limit,omitempty" jsonschema:"maximum number of lines to return (default 2000)"`
Description string `json:"description" jsonschema:"one short human-readable phrase (under 10 words) telling the user what this call is doing"`
}
type ReadResult ¶
type ReadResult struct {
Content string `json:"content,omitempty" jsonschema:"file content, each line prefixed with its 1-based line number"`
Lines int `json:"lines,omitempty" jsonschema:"number of lines returned"`
NextOffset int `json:"next_offset,omitempty" jsonschema:"offset to pass on the next call when the file was cut short"`
Truncated bool `json:"truncated,omitempty" jsonschema:"true when the file has more content than was returned"`
}
ReadResult is the read tool's response.
type RenderDesignResult ¶ added in v1.10.0
type RenderDesignResult struct {
Content string `json:"content"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
}
RenderDesignResult is the render_design tool's response. The rendered image is fed to the model out of band via the ImageSink; this text reports the dimensions and anything the engine could not render.
type ResolvedMCPServer ¶
type ResolvedMCPServer struct {
Name string
Config MCPServerConfig
Origin MCPServerOrigin
Plugin string // set when Origin == MCPOriginPlugin
Disabled bool
}
ResolvedMCPServer is one MCP server with provenance and effective state. Config is the stored (un-expanded) config; call Config.Expanded() before connecting. Disabled is the effective state after applying overrides.
func ListMCPServers ¶
func ListMCPServers(cfg config.Config, cwd string) []ResolvedMCPServer
ListMCPServers returns every configured MCP server from all sources (enabled plugins, project .mcp.json, user config, per-project config) with provenance and the effective enabled/disabled state, INCLUDING disabled ones. Precedence on a name clash (low -> high): plugin, project .mcp.json, user config, per-project config. This is the single source of truth for both the browser and the session attach path.
type SaveArtifactParams ¶
type SaveArtifactParams struct {
Name string `json:"name" jsonschema:"artifact name, e.g. plan.md — later steps load it by this name"`
Content string `json:"content" jsonschema:"the artifact's text content"`
Description string `json:"description" jsonschema:"one short human-readable phrase (under 10 words) telling the user what this call is doing"`
}
SaveArtifactParams is the save_artifact tool's input.
type SaveArtifactResult ¶
type SaveArtifactResult struct {
Name string `json:"name,omitempty"`
Version int64 `json:"version,omitempty" jsonschema:"the saved version number"`
}
SaveArtifactResult is the save_artifact tool's response.
type SearchToolsEntry ¶
type SearchToolsParams ¶
type SearchToolsResult ¶
type SearchToolsResult struct {
Matches []SearchToolsEntry `json:"matches,omitempty" jsonschema:"registry tools matching the query, with their full input schema"`
Available []string `json:"available,omitempty" jsonschema:"every registry tool name, returned when nothing matched"`
Notice string `json:"notice,omitempty"`
}
SearchToolsTool builds the search_tools core tool. SearchToolsResult is the search_tools tool's response.
type ShellHandle ¶
type ShellHandle struct {
Output <-chan string
Done <-chan ShellResult
Kill func()
}
ShellHandle represents a running shell command.
func RunShellProcess ¶
func RunShellProcess(dir, command string, extraEnv ...string) (*ShellHandle, error)
RunShellProcess forks the resolved agent shell (see agentShell) with -c <command> in its own process group.
type ShellResult ¶
ShellResult is the terminal state of a shell invocation.
type SkillCreateInput ¶
type SkillCreateInput struct {
Name string `json:"name" jsonschema:"kebab-case skill name"`
Description string `json:"description" jsonschema:"the trigger: when the skill applies and what it does"`
Body string `json:"body" jsonschema:"instruction markdown the model follows"`
Scope string `json:"scope,omitempty" jsonschema:"'project' (default) or 'user'"`
UserInvocable *bool `json:"user_invocable,omitempty" jsonschema:"false hides the /name slash command"`
DisableModelInvocation *bool `json:"disable_model_invocation,omitempty" jsonschema:"true keeps the skill out of the model's trigger list"`
}
type SkillCreateOutput ¶
type SkillCreateOutput struct {
Skill ExtensionItemView `json:"skill"`
}
func SkillCreateCore ¶
func SkillCreateCore(cwd string, in SkillCreateInput) (*mcp.CallToolResult, SkillCreateOutput, error)
type SkillDeleteInput ¶
type SkillDeleteOutput ¶
type SkillDeleteOutput struct {
Deleted bool `json:"deleted"`
}
func SkillDeleteCore ¶
func SkillDeleteCore(cwd string, in SkillDeleteInput) (*mcp.CallToolResult, SkillDeleteOutput, error)
type SkillEditInput ¶
type SkillEditInput struct {
Name string `json:"name" jsonschema:"existing skill name"`
Scope string `json:"scope,omitempty" jsonschema:"'user' or 'project' when the name is ambiguous"`
Description *string `json:"description,omitempty"`
Body *string `json:"body,omitempty" jsonschema:"replaces the whole instruction markdown"`
UserInvocable *bool `json:"user_invocable,omitempty"`
DisableModelInvocation *bool `json:"disable_model_invocation,omitempty"`
}
type SkillEditOutput ¶
type SkillEditOutput struct {
Skill ExtensionItemView `json:"skill"`
}
func SkillEditCore ¶
func SkillEditCore(cwd string, in SkillEditInput) (*mcp.CallToolResult, SkillEditOutput, error)
type SkillGetInput ¶
type SkillGetOutput ¶
type SkillGetOutput struct {
Item ExtensionItemView `json:"item"`
Body string `json:"body" jsonschema:"the full instruction markdown (skills) or system prompt (agents)"`
}
func SkillGetCore ¶
func SkillGetCore(cwd string, in SkillGetInput) (*mcp.CallToolResult, SkillGetOutput, error)
type SkillListInput ¶
type SkillListInput struct {
Kind string `json:"kind,omitempty" jsonschema:"optional filter: 'skill', 'agent', or 'workflow'"`
}
type SkillListOutput ¶
type SkillListOutput struct {
Items []ExtensionItemView `json:"items"`
Plugins []PluginView `json:"plugins,omitempty"`
}
func SkillListCore ¶
func SkillListCore(cwd string, in SkillListInput) (*mcp.CallToolResult, SkillListOutput, error)
type SkillPublishInput ¶
type SkillPublishInput struct {
Name string `json:"name" jsonschema:"skill, agent, or workflow name"`
Kind string `json:"kind,omitempty" jsonschema:"'skill' (default), 'agent', or 'workflow'"`
Marketplace string `json:"marketplace" jsonschema:"registered, writable marketplace name"`
PluginName string `json:"plugin_name,omitempty" jsonschema:"plugin to publish into (defaults to the item name)"`
Description string `json:"description,omitempty" jsonschema:"plugin description shown in the catalog"`
Version string `json:"version,omitempty" jsonschema:"plugin version (default 1.0.0, or the existing one)"`
Message string `json:"message,omitempty" jsonschema:"git commit message"`
NoPush bool `json:"no_push,omitempty" jsonschema:"commit without pushing (git-backed marketplaces push by default)"`
}
type SkillPublishOutput ¶
type SkillPublishOutput struct {
PluginDir string `json:"plugin_dir"`
Version string `json:"version,omitempty"`
Committed bool `json:"committed"`
Pushed bool `json:"pushed"`
Note string `json:"note,omitempty"`
}
func SkillPublishCore ¶
func SkillPublishCore(ctx context.Context, cwd string, in SkillPublishInput) (*mcp.CallToolResult, SkillPublishOutput, error)
type SkillPullInput ¶
type SkillPullOutput ¶
type SkillPullOutput struct {
Item ExtensionItemView `json:"item"`
}
func SkillPullCore ¶
func SkillPullCore(cwd string, in SkillPullInput) (*mcp.CallToolResult, SkillPullOutput, error)
type SudoIPCServer ¶
type SudoIPCServer struct {
SocketPath string
Token string
Interaction engine.InteractionHandler
// contains filtered or unexported fields
}
func EnsureSudoIPCServer ¶
func EnsureSudoIPCServer(interaction engine.InteractionHandler) *SudoIPCServer
EnsureSudoIPCServer creates or returns the singleton SudoIPCServer.
func (*SudoIPCServer) Close ¶
func (s *SudoIPCServer) Close()
type TodoEntry ¶
type TodoEntry struct {
Content string `json:"content" jsonschema:"imperative description of the task"`
Status string `json:"status" jsonschema:"current state of the task (pending, in_progress, completed)"`
ActiveForm string `json:"active_form,omitempty" jsonschema:"present-continuous label shown while the task is in_progress"`
}
type TodosParams ¶
type TodosResult ¶
type TodosResult struct {
Applied bool `json:"applied,omitempty" jsonschema:"true when the list was accepted"`
Total int `json:"total,omitempty" jsonschema:"number of todos in the list"`
Completed int `json:"completed,omitempty" jsonschema:"number of completed todos"`
Nudge string `json:"nudge,omitempty" jsonschema:"reminder about when to call todos again"`
Notice string `json:"notice,omitempty" jsonschema:"guidance the caller must act on before retrying"`
}
TodosResult is the todos tool's response.
type TokenSavings ¶
type TokenSavings struct {
TotalRawTokens int `json:"totalRawTokens"`
TotalSavedTokens int `json:"totalSavedTokens"`
ByCommand map[string]CommandSavings `json:"byCommand"`
}
func LoadSavings ¶
func LoadSavings() (TokenSavings, error)
LoadSavings reads the recorded token savings. A missing ledger is a zero-value result, not an error; malformed content is an error so a caller never mistakes corruption for zero gains.
type Tool ¶
func AskUserQuestionTool ¶
func BuildCoreTools ¶
func BuildCoreTools(args engine.ToolFactoryArgs, attachWebSearch bool) []Tool
BuildCoreTools constructs standard core wire tools for the provided engine arguments.
func BuildSubagentTools ¶
func BuildSubagentTools(args engine.ToolFactoryArgs, attachWebSearch bool) []Tool
BuildSubagentTools constructs the centralized toolset configured for an isolated subagent session.
func EndTurnTool ¶
func ExtensionTools ¶
ExtensionTools returns the registry tools that manage skills, agents, plugins, and marketplaces.
func FinalizedPlanTool ¶
func FinishWorkflowTool ¶
func InvokeToolTool ¶
InvokeToolTool builds the invoke_tool core tool.
func JobKillTool ¶
JobKillTool returns the native job_kill tool.
func JobOutputTool ¶
JobOutputTool returns the native job_output tool.
func LoadMemoryTool ¶
LoadMemoryTool returns the on-demand recall tool: a query searches the project and global scopes, an id fetches one concept's full body.
func MemoryDemoteTool ¶
func MemoryDemoteTool() Tool
MemoryDemoteTool lowers a concept that misled the model.
func MemoryForgetTool ¶
func MemoryForgetTool(approvalDenied func(ctx context.Context, name string, params map[string]any) string) Tool
MemoryForgetTool hard-deletes a concept; approval-gated.
func MemoryIndexTool ¶
func MemoryIndexTool(cwd string, approvalDenied func(ctx context.Context, name string, params map[string]any) string) Tool
MemoryIndexTool returns the tool for storing a concept explicitly.
func MemoryReinforceTool ¶
func MemoryReinforceTool() Tool
MemoryReinforceTool bumps a concept the model found useful.
func MemoryTools ¶
func MemoryTools(cwd string, approvalDenied func(ctx context.Context, name string, params map[string]any) string) []Tool
MemoryTools is the registry set: explicit store, reinforce, demote, forget.
func NativeBridgeTool ¶
func NativeBridgeTool[In, Out any](name, description string, run func(ctx context.Context, in In) (*mcp.CallToolResult, Out, error), ) Tool
NativeBridgeTool adapts an MCP handler core to an ADK Tool.
func NewTypedTool ¶
func NewTypedTool[T, R any](name, description string, handler func(ctx agent.Context, params T) (R, error)) Tool
NewTypedTool creates a native ADK tool from typed request and response structs. ADK infers BOTH schemas from T and R — functiontool.New calls resolvedSchema[TArgs] and resolvedSchema[TResults] — so the tool declaration carries a real output schema instead of an empty one.
Handlers report failure by returning a Go error, not by setting a flag on the result. That is also what ADK's OnToolErrorCallback keys on.
func RenderDesignTool ¶ added in v1.10.0
RenderDesignTool renders HTML+CSS to a PNG the model can inspect. The image is queued on the shared sink so the ImageInjectionHook can hand it to the model before the next model call; the tool's own text result names the dimensions and lists whatever the compact engine ignored.
func SaveArtifactTool ¶
func SaveArtifactTool() Tool
SaveArtifactTool lets a workflow step hand structured data to a later step. The artifact lives in the run's ArtifactService, which spans the whole graph because the graph runs as one runner invocation, so a step saves plan.md and a downstream step reads it back with load_artifacts.
ADK ships load_artifacts but no save tool; this is the missing half.
func SearchToolsTool ¶
func WebSearchTool ¶
func WorkflowStepTools ¶
WorkflowStepTools returns the position-dependent tools every workflow step needs: save_artifact and load_artifacts on every step so steps can pass data forward, plus finish_workflow on the final step only, which reports the run's outcome and created artifacts (PR links, tickets) to the user.
func WorkflowTools ¶
WorkflowTools returns the workflow core tools.
func WrapFileToolsWithMemory ¶
WrapFileToolsWithMemory decorates read, edit, and write tools with memory recall.
type ToolEnv ¶
type ToolEnv struct {
Cwd string
TabID int
SkipPermissions bool
PlanningMode bool
IsSubagent bool
SubagentID string
Emit engine.EventListener
Interaction engine.InteractionHandler
Files *FileTracker
Jobs *JobManager
// Custom approval function if overriding standard interaction handler.
Approve func(ctx context.Context, toolName string, input map[string]any) (bool, error)
// SupportsImages reports whether the active model can see images. It
// gates feeding tool-rendered images (render_design, MCP image results,
// read of an image file) back to the model as image parts. Nil means
// unknown (treated as capable, so the images are still attached).
SupportsImages func() bool
// ImageSink is the per-session handoff for images a tool produces (a
// render, an MCP image result) or opens (read of an image file). The
// ImageInjectionHook drains it before each model call and feeds the
// images to the model as inline image parts.
ImageSink *ImageSink
PendingEndTurn *EndTurnSignal
PendingFinishData *FinishWorkflowData
// WorkflowRunner runs a workflow definition when selected in finalized_plan.
WorkflowRunner func(ctx context.Context, tabID int, def workflow.Def, src any) (string, error)
}
ToolEnv is the per-session execution environment shared by all harness tools.
func NewSubagentToolEnv ¶
NewSubagentToolEnv constructs an isolated ToolEnv for a subagent execution.
func NewToolEnv ¶
func NewToolEnv(cwd string, tabID int, skipPermissions bool, emit engine.EventListener, interaction engine.InteractionHandler) *ToolEnv
NewToolEnv constructs a ToolEnv for a session.
func (*ToolEnv) ApprovalDenied ¶
func (env *ToolEnv) ApprovalDenied(ctx context.Context, toolName string, input map[string]any) string
ApprovalDenied checks permission before a mutating tool runs. It returns the message to put in the tool result's Error field, or "" when the call is allowed.
func (*ToolEnv) CheckReadBeforeMutate ¶
CheckReadBeforeMutate enforces read-before-edit semantics on existing files.
func (*ToolEnv) EmitFileDiff ¶
EmitFileDiff computes a unified diff and publishes a ToolDiffEvent.
type ToolResponse ¶
type ToolResponse = engine.ToolResponse
Aliases to engine types
func RunToolWithJSON ¶
RunToolWithJSON executes a Tool by parsing a JSON arguments string.
type WebSearchParams ¶
type WebSearchParams struct {
Query string `json:"query" jsonschema:"the search query"`
Count int `json:"count,omitempty" jsonschema:"max number of results to return (default 8, max 20)"`
Description string `json:"description" jsonschema:"one short human-readable phrase (under 10 words) telling the user what this call is doing"`
}
type WebSearchResult ¶
type WebSearchResult struct {
Query string `json:"query,omitempty"`
Results string `json:"results,omitempty" jsonschema:"formatted search results"`
Count int `json:"count,omitempty" jsonschema:"number of results returned"`
Notice string `json:"notice,omitempty" jsonschema:"set when search is not configured"`
}
WebSearchTool returns the Brave-backed web_search tool. WebSearchResult is the web_search tool's response.
type WorkflowCopyInput ¶
type WorkflowCopyInput struct {
Name string `json:"name" jsonschema:"workflow name to copy"`
Scope string `json:"scope,omitempty" jsonschema:"scope holding source"`
To string `json:"to" jsonschema:"destination scope: 'user', 'repo', or 'global'"`
NewName string `json:"new_name,omitempty" jsonschema:"optional name for the copy"`
}
type WorkflowCopyOutput ¶
type WorkflowCopyOutput struct {
Workflow WorkflowDefView `json:"workflow"`
}
func WorkflowCopyCore ¶
func WorkflowCopyCore(cwd string, in WorkflowCopyInput) (*mcp.CallToolResult, WorkflowCopyOutput, error)
type WorkflowCreateInput ¶
type WorkflowCreateInput struct {
Name string `json:"name" jsonschema:"new workflow name"`
Scope string `json:"scope,omitempty" jsonschema:"'user', 'repo', or 'global'"`
Description string `json:"description,omitempty" jsonschema:"what this workflow is for"`
Steps []WorkflowStepView `json:"steps,omitempty" jsonschema:"steps to create"`
}
type WorkflowCreateOutput ¶
type WorkflowCreateOutput struct {
Workflow WorkflowDefView `json:"workflow"`
}
func WorkflowCreateCore ¶
func WorkflowCreateCore(cwd string, in WorkflowCreateInput) (*mcp.CallToolResult, WorkflowCreateOutput, error)
type WorkflowDefView ¶
type WorkflowDefView struct {
Name string `json:"name"`
Scope string `json:"scope"`
Plugin string `json:"plugin,omitempty"`
Description string `json:"description,omitempty"`
Steps []WorkflowStepView `json:"steps"`
}
type WorkflowDeleteInput ¶
type WorkflowDeleteOutput ¶
type WorkflowDeleteOutput struct {
Deleted bool `json:"deleted"`
}
func WorkflowDeleteCore ¶
func WorkflowDeleteCore(cwd string, in WorkflowDeleteInput) (*mcp.CallToolResult, WorkflowDeleteOutput, error)
type WorkflowEditInput ¶
type WorkflowEditInput struct {
Name string `json:"name" jsonschema:"existing workflow name"`
Scope string `json:"scope,omitempty" jsonschema:"scope holding the workflow"`
NewName string `json:"new_name,omitempty" jsonschema:"optional new name"`
Description *string `json:"description,omitempty" jsonschema:"if provided, replaces description"`
Steps *[]WorkflowStepView `json:"steps,omitempty" jsonschema:"if provided, replaces steps"`
}
type WorkflowEditOutput ¶
type WorkflowEditOutput struct {
Workflow WorkflowDefView `json:"workflow"`
}
func WorkflowEditCore ¶
func WorkflowEditCore(cwd string, in WorkflowEditInput) (*mcp.CallToolResult, WorkflowEditOutput, error)
type WorkflowGetInput ¶
type WorkflowGetOutput ¶
type WorkflowGetOutput struct {
Workflow WorkflowDefView `json:"workflow"`
}
func WorkflowGetCore ¶
func WorkflowGetCore(cwd string, in WorkflowGetInput) (*mcp.CallToolResult, WorkflowGetOutput, error)
type WorkflowInnerStepView ¶
type WorkflowInnerStepView struct {
Name string `json:"name" jsonschema:"step name"`
Provider string `json:"provider" jsonschema:"provider id from ask's provider registry"`
Model string `json:"model,omitempty" jsonschema:"model id (empty = provider default)"`
Prompt string `json:"prompt,omitempty" jsonschema:"user-authored prompt for this step"`
}
type WorkflowListInput ¶
type WorkflowListInput struct{}
type WorkflowListItem ¶
type WorkflowListItem struct {
Name string `json:"name" jsonschema:"workflow name"`
Scope string `json:"scope" jsonschema:"where the workflow is stored: 'user', 'repo', 'global', or 'plugin' (read-only)"`
Plugin string `json:"plugin,omitempty" jsonschema:"name@marketplace for plugin workflows"`
Description string `json:"description,omitempty" jsonschema:"the author's statement of what this workflow is for and when to use it"`
Steps []WorkflowListStepView `json:"steps" jsonschema:"steps in execution order"`
}
type WorkflowListOutput ¶
type WorkflowListOutput struct {
Workflows []WorkflowListItem `json:"workflows"`
}
func WorkflowListCore ¶
func WorkflowListCore(cwd string, in WorkflowListInput) (*mcp.CallToolResult, WorkflowListOutput, error)
type WorkflowListStepView ¶
type WorkflowListStepView struct {
Name string `json:"name" jsonschema:"step name"`
Kind string `json:"kind,omitempty" jsonschema:"empty for an agent step; 'loop' for a loop container"`
Provider string `json:"provider,omitempty" jsonschema:"provider id from ask's provider registry; agent steps only"`
Model string `json:"model,omitempty" jsonschema:"model id (empty = provider default)"`
Steps []WorkflowInnerListStepView `json:"steps,omitempty" jsonschema:"inner steps run each iteration; loop steps only"`
MaxIterations int `json:"maxIterations,omitempty" jsonschema:"iteration cap; loop steps only (0 = default)"`
}
type WorkflowStepView ¶
type WorkflowStepView struct {
Name string `json:"name" jsonschema:"step name"`
Kind string `json:"kind,omitempty" jsonschema:"empty for an agent step; 'loop' for a loop container"`
Provider string `json:"provider,omitempty" jsonschema:"provider id"`
Model string `json:"model,omitempty" jsonschema:"model id"`
Prompt string `json:"prompt,omitempty" jsonschema:"user-authored prompt"`
Steps []WorkflowInnerStepView `json:"steps,omitempty" jsonschema:"inner agent steps"`
MaxIterations int `json:"maxIterations,omitempty" jsonschema:"iteration cap"`
ExitCondition string `json:"exitCondition,omitempty" jsonschema:"free-text goal"`
}
type WriteParams ¶
type WriteParams struct {
FilePath string `json:"file_path" jsonschema:"absolute or cwd-relative path of the file to write"`
Content string `json:"content" jsonschema:"the full new content of the file"`
Description string `json:"description" jsonschema:"one short human-readable phrase (under 10 words) telling the user what this call is doing"`
}
type WriteResult ¶
type WriteResult struct {
Path string `json:"path,omitempty" jsonschema:"absolute path written"`
Created bool `json:"created,omitempty" jsonschema:"true when the file did not exist before"`
Bytes int `json:"bytes,omitempty" jsonschema:"size of the file after the write"`
NoChange bool `json:"no_change,omitempty" jsonschema:"true when the file already had exactly this content"`
Notice string `json:"notice,omitempty" jsonschema:"guidance the caller must act on before retrying"`
}
WriteResult is the write tool's response.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package filters compresses shell-command output before it reaches the model, RTK-style: an ordered set of command-aware semantic filters over a universal fallback.
|
Package filters compresses shell-command output before it reaches the model, RTK-style: an ordered set of command-aware semantic filters over a universal fallback. |