extbridge

package
v0.83.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 3 Imported by: 0

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

func BaseContext(ctx context.Context, kitInstance *kit.Kit) extensions.Context

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

SpawnSubagent runs a subagent in-process via the Kit SDK and translates the result/events back into the extension-facing types. The returned handle is always nil — the SDK path runs synchronously and does not expose a separate process handle. Callers that need non-blocking behaviour should run this in their own 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.

Jump to

Keyboard shortcuts

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