Documentation
¶
Overview ¶
Package extbridge wires the public Kit SDK to the internal extensions package. It exists so that cmd/ and internal/acpserver/ don't both reimplement the same SDK→extension event/subagent conversions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseContext ¶ added in v0.75.1
BaseContext returns an extensions.Context populated with the headless, TUI-independent delegation fields: data access, state, options, model/tool management, completions, subagents, tree navigation, skills, template parsing, and model resolution.
Callers overlay their UI-specific fields (print routes, widgets, prompts, editor, TUI-aware SetModel/ReloadExtensions, etc.) on the returned value: cmd/extension_context.go for the interactive TUI and internal/acpserver/session.go for headless ACP mode. Keeping the shared half here means a new data-access Context field only has to be wired once.
ctx is used for subagent spawns; pass a long-lived context (not a per-request one) so later spawns aren't cancelled prematurely.
func SDKEventToSubagentEvent ¶
func SDKEventToSubagentEvent(e kit.Event) extensions.SubagentEvent
SDKEventToSubagentEvent converts an SDK kit.Event into the extension-facing extensions.SubagentEvent. Returns a zero-value event (Type=="") for events that don't map to anything useful — callers should drop those.
func SpawnSubagent ¶
func SpawnSubagent(ctx context.Context, k *kit.Kit, cfg extensions.SubagentConfig) (*extensions.SubagentHandle, *extensions.SubagentResult, error)
SpawnSubagent runs a subagent in-process via the Kit SDK and translates the result/events back into the extension-facing types.
When cfg.Blocking is true, the call waits for completion and returns (nil, result, err); cfg.OnComplete (if set) is invoked before returning. When cfg.Blocking is false (default), the subagent runs in a background goroutine and the call returns immediately with (handle, nil, nil). The handle supports Wait/Done/Kill; cfg.OnComplete and cfg.OnEvent are invoked asynchronously from the subagent's goroutine.
This function consolidates the previously-duplicated wiring in cmd/root.go (interactive + runtime contexts) and internal/acpserver/session.go.
Types ¶
This section is empty.