Documentation
¶
Index ¶
- Constants
- func ComposerStatistics(statistics *protocol.ConversationStatistics) (json.RawMessage, error)
- func PublicToolResult(result json.RawMessage) json.RawMessage
- func ThemeSnapshot(palette *theme.Palette) json.RawMessage
- type Bundle
- type CallbackRef
- type CardAction
- type CardBindings
- type CardHost
- func (host *CardHost) Close() error
- func (host *CardHost) Components() []NativeComponent
- func (host *CardHost) Login(state string, canOpen, canCancel bool)
- func (host *CardHost) Modules() []HostModule
- func (host *CardHost) Permits(action CardAction) bool
- func (host *CardHost) Refresh(identity string)
- func (host *CardHost) State() CardState
- func (host *CardHost) Target(name string, mode protocol.PluginCardMode) (protocol.PluginCardTarget, bool)
- type CardState
- type ContributionEntry
- type ContributionHooks
- type ContributionKey
- type ElementStyle
- type Host
- func (owner *Host) Close() error
- func (owner *Host) Disconnect() error
- func (owner *Host) Enter()
- func (owner *Host) Modules() ([]HostModule, error)
- func (owner *Host) Native() NativeBinding
- func (owner *Host) Observe(cursor, packageCursor, settled uint64, connected bool)
- func (owner *Host) ObserveSettings(rows []protocol.PluginSummary, connected bool)
- func (owner *Host) ObserveTerminalTools(revision uint64)
- func (owner *Host) RetainSettings() bool
- func (owner *Host) SetUsageSample(sample *UsageSample)
- func (owner *Host) SetVisible(visible bool)
- type HostBinding
- type HostExport
- type HostModule
- type HostOperation
- type Mounted
- func (mounted *Mounted) Close() error
- func (mounted *Mounted) Context() PluginContext
- func (mounted *Mounted) Dispatch(callback CallbackRef, event json.RawMessage) error
- func (mounted *Mounted) Error() error
- func (mounted *Mounted) MemoryBytes() (uint64, bool)
- func (mounted *Mounted) Pending() int
- func (mounted *Mounted) Pump() error
- func (mounted *Mounted) Render(context *ui.Context) (ui.Element, error)
- func (mounted *Mounted) Snapshot() (*NativeElement, error)
- func (mounted *Mounted) Suspend()
- func (mounted *Mounted) Suspended() bool
- type NativeBinding
- func (binding NativeBinding) BindActions(view *ui.Context, region ui.Element, element NativeElement, ...)
- func (binding *NativeBinding) DetailsHeading() func(*ui.Context) error
- func (binding *NativeBinding) DrawingDetails() bool
- func (binding *NativeBinding) EmitHeaderAction(identity string)
- func (binding *NativeBinding) HeaderSnapshot() json.RawMessage
- func (binding *NativeBinding) SetDetailsHeading(draw func(*ui.Context) error)
- func (binding *NativeBinding) Suspended() bool
- func (binding *NativeBinding) TakeDroppedFiles(identity string) ([]string, error)
- func (binding *NativeBinding) WorkspaceLayout() WorkspaceLayout
- type NativeComponent
- type NativeElement
- type PluginContext
- type Registry
- func (registry *Registry) Close() error
- func (registry *Registry) Commands() []ContributionEntry
- func (registry *Registry) Entries(slot protocol.PluginUiSlot) []ContributionEntry
- func (registry *Registry) ForwardStatus(key ContributionKey, kind protocol.PluginUiEventKind, value json.RawMessage) error
- func (registry *Registry) Hooks(reference protocol.PluginReference, ...) (ContributionHooks, error)
- func (registry *Registry) Intent(intent string) (ContributionEntry, bool)
- func (registry *Registry) IntentReady(intent string) (bool, bool)
- func (registry *Registry) Invoke(key ContributionKey, kind protocol.PluginUiEventKind, value json.RawMessage) error
- func (registry *Registry) InvokeIntent(key ContributionKey, value json.RawMessage) error
- func (registry *Registry) Key(reference protocol.PluginReference, id string) (ContributionKey, bool)
- func (registry *Registry) ProviderEntries(scope protocol.PluginUiProviderScope) []ContributionEntry
- func (registry *Registry) Ready(reference protocol.PluginReference) bool
- func (registry *Registry) Revision() uint64
- func (registry *Registry) SetActivity(reference protocol.PluginReference, active, failed bool) error
- func (registry *Registry) SetProviderScopes(reference protocol.PluginReference, scopes []protocol.PluginUiProviderScope) error
- func (registry *Registry) TakeClosed(reference protocol.PluginReference) []string
- type RegistryOptions
- type Runtime
- type RuntimeBindings
- type SshDirectoryCache
- type UsageSample
- type UsageSource
- type WorkspaceLayout
Constants ¶
const CardMaxQrBytes = 2048
Variables ¶
This section is empty.
Functions ¶
func ComposerStatistics ¶
func ComposerStatistics(statistics *protocol.ConversationStatistics) (json.RawMessage, error)
func PublicToolResult ¶
func PublicToolResult(result json.RawMessage) json.RawMessage
PublicToolResult is a tool's result as a script reads it: a Node output takes the scripts' public form, and any other value, or an output scripts may not read in that form, stays as the model received it.
func ThemeSnapshot ¶
func ThemeSnapshot(palette *theme.Palette) json.RawMessage
Types ¶
type Bundle ¶
type Bundle = protocol.PluginDesktopBundle
type CallbackRef ¶
type CardAction ¶
type CardAction struct {
Kind string `json:"kind"`
Target *string `json:"target,omitempty"`
Mode *protocol.PluginCardMode `json:"mode,omitempty"`
}
type CardBindings ¶
type CardBindings struct {
Context context.Context
Summary protocol.PluginCardSummary
Declaration protocol.PluginCardDeclaration
Locale string
Native *NativeBinding
Clock clockwork.Clock
ValidateProps func(json.RawMessage) bool
Status func(context.Context) (protocol.PluginConnectionStatus, error)
Action func(string, CardAction)
Toast func(string, bool)
}
type CardHost ¶
type CardHost struct {
// contains filtered or unexported fields
}
func NewCardHost ¶
func NewCardHost(binding CardBindings) (*CardHost, error)
func (*CardHost) Components ¶
func (host *CardHost) Components() []NativeComponent
func (*CardHost) Modules ¶
func (host *CardHost) Modules() []HostModule
func (*CardHost) Permits ¶
func (host *CardHost) Permits(action CardAction) bool
func (*CardHost) Target ¶
func (host *CardHost) Target(name string, mode protocol.PluginCardMode) (protocol.PluginCardTarget, bool)
type ContributionEntry ¶
type ContributionEntry struct {
Key ContributionKey `json:"key"`
Declaration protocol.PluginUiContribution `json:"declaration"`
State protocol.PluginUiState `json:"state"`
Retry bool `json:"retry"`
}
type ContributionHooks ¶
type ContributionHooks struct {
Publish func(json.RawMessage) error
Close func(string) error
Next func(context.Context) (json.RawMessage, error)
}
type ContributionKey ¶
type ContributionKey struct {
Node protocol.NodeID `json:"node"`
Worktree *protocol.WorktreeID `json:"worktree"`
Session *protocol.SessionID `json:"session"`
Package protocol.PluginReference `json:"package"`
ID string `json:"id"`
Generation uint64 `json:"generation"`
}
type ElementStyle ¶
type ElementStyle struct {
Name string `json:"name"`
Arguments []json.RawMessage `json:"arguments"`
}
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
func NewHost ¶
func NewHost(binding HostBinding) *Host
func (*Host) Disconnect ¶
func (*Host) Modules ¶
func (owner *Host) Modules() ([]HostModule, error)
func (*Host) Native ¶
func (owner *Host) Native() NativeBinding
func (*Host) ObserveSettings ¶
func (owner *Host) ObserveSettings(rows []protocol.PluginSummary, connected bool)
func (*Host) ObserveTerminalTools ¶
func (*Host) RetainSettings ¶
func (*Host) SetUsageSample ¶
func (owner *Host) SetUsageSample(sample *UsageSample)
SetUsageSample has the usage calls answer from sample, or from the Nodes again when it is nil. It wakes the calls that wait for the sources and moves the page's watch over, so an open page draws the other figures.
func (*Host) SetVisible ¶
type HostBinding ¶
type HostBinding struct {
// ExecutionResources keeps a host-owned view on its mounted Node.
ExecutionResources bool
Context context.Context
Client *client.Client
Resources *client.Client
Target protocol.NodeID
Scope protocol.PluginContext
Locale string
Contributions ContributionHooks
Native *NativeBinding
Clock clockwork.Clock
ReadFiles bool
Actions []protocol.PluginAction
UsageSources func() []UsageSource
UsageChanges <-chan struct{}
// UsageSample is the sample the usage calls answer from at first;
// SetUsageSample changes it.
UsageSample *UsageSample
// SshDirectoryCache retains recent SSH directory listings across view
// remounts; its owner clears it on close or disconnect.
SshDirectoryCache *SshDirectoryCache
}
type HostExport ¶
type HostExport struct {
Name string
Sync HostOperation
Async HostOperation
}
type HostModule ¶
type HostModule struct {
Name string
Exports []HostExport
}
type HostOperation ¶
type HostOperation func(context.Context, []json.RawMessage) (json.RawMessage, error)
type Mounted ¶
type Mounted struct {
// contains filtered or unexported fields
}
func (*Mounted) Context ¶
func (mounted *Mounted) Context() PluginContext
func (*Mounted) Dispatch ¶
func (mounted *Mounted) Dispatch(callback CallbackRef, event json.RawMessage) error
func (*Mounted) MemoryBytes ¶
MemoryBytes estimates the JavaScript heap this view retains, including values registered through AddLiveRoots. Shared builtins and the host's Go, native and image resources are outside this approximate JS-only account. Call it on the VM's owner goroutine, between calls. The bool is false if execution is in progress or the measurement was interrupted; a view with no live engine has a complete zero measurement.
func (*Mounted) Snapshot ¶
func (mounted *Mounted) Snapshot() (*NativeElement, error)
type NativeBinding ¶
type NativeBinding struct {
Context context.Context
Post func(func(*ui.Context)) bool
Invalidate func()
Frame func(*ui.Context)
Release func()
PreparedRequest func(context.Context, string) (protocol.Request, error)
Theme func() json.RawMessage
TerminalAppearance func() (protocol.TerminalAppearance, error)
Operations map[string]HostOperation
Components []NativeComponent
ChooseSecretFile func(context.Context, string) ([]byte, string, error)
Header func(json.RawMessage) error
// Details receives what a Workspace supplies to the Shell's right
// sidebar each time it draws, nil when it supplies nothing. Without it
// a Workspace draws its details under its content.
Details func(func(*ui.Context) error)
// column. It is never drawn inside the page, even without this slot.
Navigation func(func(*ui.Context) error)
// Models are the Node's models as the application names them: a
// ModelPopup shows the names, marks and scores of the ones its catalog
// lists. Without it a model shows under its catalog's own identifiers.
Models func() []kit.ModelOption
// OnEmit observes native UI events before they are queued for scripts.
OnEmit func(name string, value any)
// contains filtered or unexported fields
}
func NewNativeBinding ¶
func NewNativeBinding(ctx context.Context) NativeBinding
func (NativeBinding) BindActions ¶
func (binding NativeBinding) BindActions(view *ui.Context, region ui.Element, element NativeElement, emit func(CallbackRef, json.RawMessage))
func (*NativeBinding) DetailsHeading ¶
func (binding *NativeBinding) DetailsHeading() func(*ui.Context) error
DetailsHeading is what the details last drawn gave the sidebar's header.
func (*NativeBinding) DrawingDetails ¶
func (binding *NativeBinding) DrawingDetails() bool
DrawingDetails reports whether the element being drawn is in the details a Workspace gave the Shell's right sidebar.
func (*NativeBinding) EmitHeaderAction ¶
func (binding *NativeBinding) EmitHeaderAction(identity string)
func (*NativeBinding) HeaderSnapshot ¶
func (binding *NativeBinding) HeaderSnapshot() json.RawMessage
func (*NativeBinding) SetDetailsHeading ¶
func (binding *NativeBinding) SetDetailsHeading(draw func(*ui.Context) error)
SetDetailsHeading gives the sidebar's header what the details being drawn would otherwise show as their own first row.
func (*NativeBinding) Suspended ¶
func (binding *NativeBinding) Suspended() bool
func (*NativeBinding) TakeDroppedFiles ¶
func (binding *NativeBinding) TakeDroppedFiles(identity string) ([]string, error)
func (*NativeBinding) WorkspaceLayout ¶
func (binding *NativeBinding) WorkspaceLayout() WorkspaceLayout
type NativeComponent ¶
type NativeComponent struct {
Module string
Export string
Render func(*ui.Context, NativeElement, func(), func(CallbackRef, json.RawMessage)) (ui.Element, error)
}
func NativeComponents ¶
func NativeComponents(binding NativeBinding) ([]NativeComponent, error)
type NativeElement ¶
type NativeElement struct {
ID uint64
Module string
Export string
Text string
Props json.RawMessage
Styles []ElementStyle
Children []*NativeElement
Slots map[string][]*NativeElement
Callbacks map[string]CallbackRef
RenderChild func(*ui.Context, *NativeElement) (ui.Element, error) `json:"-"`
Focus func() bool `json:"-"`
// contains filtered or unexported fields
}
type PluginContext ¶
type PluginContext = protocol.PluginContext
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry(options RegistryOptions) *Registry
func (*Registry) Commands ¶
func (registry *Registry) Commands() []ContributionEntry
func (*Registry) Entries ¶
func (registry *Registry) Entries(slot protocol.PluginUiSlot) []ContributionEntry
func (*Registry) ForwardStatus ¶
func (registry *Registry) ForwardStatus(key ContributionKey, kind protocol.PluginUiEventKind, value json.RawMessage) error
func (*Registry) Hooks ¶
func (registry *Registry) Hooks(reference protocol.PluginReference, declarations []protocol.PluginUiContribution) (ContributionHooks, error)
func (*Registry) Invoke ¶
func (registry *Registry) Invoke(key ContributionKey, kind protocol.PluginUiEventKind, value json.RawMessage) error
func (*Registry) InvokeIntent ¶
func (registry *Registry) InvokeIntent(key ContributionKey, value json.RawMessage) error
func (*Registry) Key ¶
func (registry *Registry) Key(reference protocol.PluginReference, id string) (ContributionKey, bool)
func (*Registry) ProviderEntries ¶
func (registry *Registry) ProviderEntries(scope protocol.PluginUiProviderScope) []ContributionEntry
func (*Registry) Revision ¶
Revision identifies the state observed by contribution projections. Read it before projecting so concurrent changes invalidate the next frame.
func (*Registry) SetActivity ¶
func (registry *Registry) SetActivity(reference protocol.PluginReference, active, failed bool) error
func (*Registry) SetProviderScopes ¶
func (registry *Registry) SetProviderScopes(reference protocol.PluginReference, scopes []protocol.PluginUiProviderScope) error
func (*Registry) TakeClosed ¶
func (registry *Registry) TakeClosed(reference protocol.PluginReference) []string
type RegistryOptions ¶
type RegistryOptions struct {
Node protocol.NodeID
Context protocol.PluginContext
Invalidate func()
}
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime(bindings RuntimeBindings) (*Runtime, error)
type RuntimeBindings ¶
type RuntimeBindings struct {
Modules []HostModule
Components []NativeComponent
Contributions ContributionHooks
Invalidate func()
Post func(func())
BindActions func(*ui.Context, ui.Element, NativeElement, func(CallbackRef, json.RawMessage))
}
type SshDirectoryCache ¶
type SshDirectoryCache struct {
// contains filtered or unexported fields
}
SshDirectoryCache is a bounded, owner-scoped cache of SSH directory listings shared across remounts of a window's SSH plugin view. Entries are evicted by revision, TTL, count, total byte budget, explicit refresh, file mutations, disconnect, and owner close.
func NewSshDirectoryCache ¶
func NewSshDirectoryCache(clock clockwork.Clock) *SshDirectoryCache
func (*SshDirectoryCache) Clear ¶
func (cache *SshDirectoryCache) Clear()
func (*SshDirectoryCache) InvalidateNode ¶
func (cache *SshDirectoryCache) InvalidateNode(node protocol.NodeID)
func (*SshDirectoryCache) InvalidateProfile ¶
func (cache *SshDirectoryCache) InvalidateProfile(node protocol.NodeID, profile string)
func (*SshDirectoryCache) Len ¶
func (cache *SshDirectoryCache) Len() int
type UsageSample ¶
type UsageSample struct {
Report func(protocol.NodeID, protocol.UsageQuery) (protocol.UsageReport, error)
Inventory func() ([]protocol.Project, []protocol.ConversationProvider)
}
UsageSample answers the usage calls from memory in place of the Nodes' ledgers, as the one source this device is. Nothing it answers is read from or written to a Node.
type UsageSource ¶
Source Files
¶
- card.go
- card_components.go
- card_qr.go
- contract.go
- contribution_snapshot.go
- contributions.go
- contributions_bridge.go
- credentials.go
- element_cache.go
- forms.go
- forms_date.go
- host.go
- host_changes.go
- host_connections.go
- host_knowledge.go
- host_models.go
- host_modules.go
- host_requests.go
- host_sdk.go
- host_sessions.go
- host_settings.go
- host_usage.go
- host_values.go
- host_workspace.go
- keyboard.go
- memory.go
- native.go
- native_activity.go
- native_charts.go
- native_components.go
- native_controls.go
- native_data.go
- native_key_context.go
- native_layout.go
- native_menus.go
- native_path.go
- native_shortcuts.go
- native_statistics.go
- native_theme.go
- native_tree.go
- native_ui.go
- render.go
- render_components.go
- render_path.go
- render_styles.go
- runtime.go
- runtime_modules.go
- ssh_cache.go