Help us shape the future of Go! Take the 2026 Go Developer Survey

nexusbridge

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(agentDockHome string, identity Identity) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(identity Identity, node NodeAPI, runtime runtimeapi.Runtime, artifacts publicartifacts.Store, state *ConnectionState) *Client

func (*Client) Run

func (c *Client) Run(ctx context.Context)

type ConnectionState

type ConnectionState struct {
	// contains filtered or unexported fields
}

ConnectionState 只记录当前节点桥接是否已完成 NexusDock 握手。 配置是否存在由启动配置判断,避免把“已配对”和“已连接”混成同一个状态。

func (*ConnectionState) Connected

func (s *ConnectionState) Connected() bool

func (*ConnectionState) SetConnected

func (s *ConnectionState) SetConnected(connected bool)

type Identity

type Identity struct {
	Version     int    `json:"version"`
	Endpoint    string `json:"endpoint"`
	NodeID      string `json:"node_id"`
	DeviceID    string `json:"device_id"`
	DeviceToken string `json:"device_token"`
}

func Load

func Load(agentDockHome string) (Identity, error)

func Pair

func Pair(ctx context.Context, agentDockHome string, options PairOptions) (Identity, error)

type NodeAPI added in v0.8.2

type NodeAPI interface {
	ToolNames() []string
	ToolDescriptors() []map[string]any
	UIResources() []protocol.UIResourceCapability
	ToolContractHash() string
	AgentDockLocalContext(context.Context) (map[string]any, error)
	Invoke(context.Context, string, map[string]any) (map[string]any, error)
	ReadAppResource(string) (map[string]any, error)
}

NodeAPI 由 Nexus Bridge 消费方定义,只包含握手和远程 operation 真正需要的节点能力。

type PairOptions

type PairOptions struct {
	Endpoint string
	Code     string
	Name     string
}

type Status

type Status struct {
	Paired            bool   `json:"paired"`
	Endpoint          string `json:"endpoint,omitempty"`
	NodeID            string `json:"node_id,omitempty"`
	DeviceID          string `json:"device_id,omitempty"`
	DeviceTokenStored bool   `json:"device_token_stored"`
}

Status 是控制面板可安全展示的配对状态,不暴露 Device Token 本身。

func ReadStatus

func ReadStatus(agentDockHome string) (Status, error)

Jump to

Keyboard shortcuts

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