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

app

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result = toolcore.Result

type Runtime

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

func NewRuntime

func NewRuntime(cfg config.Config) (*Runtime, error)

func (*Runtime) AgentDockContext

func (r *Runtime) AgentDockContext(ctx context.Context) (Result, error)

func (*Runtime) AgentDockLocalContext added in v0.8.0

func (r *Runtime) AgentDockLocalContext(ctx context.Context) (Result, error)

AgentDockLocalContext 仅供 Nexus Bridge 使用。它不读取 Nexus 统一管理的 Workflow/Recall,避免 fleet 聚合时按节点重复回灌共享上下文。

func (*Runtime) Call

func (r *Runtime) Call(ctx context.Context, name string, args map[string]any) (Result, error)

func (*Runtime) Close

func (r *Runtime) Close() error

func (*Runtime) Config

func (r *Runtime) Config() config.Config

func (*Runtime) RuntimeCapabilities

func (r *Runtime) RuntimeCapabilities(ctx context.Context, refresh bool) (Result, error)

func (*Runtime) RuntimeEvolve added in v0.7.6

func (r *Runtime) RuntimeEvolve(ctx context.Context, args map[string]any) (Result, error)

RuntimeEvolve 给 Nexus Stage 3 复用同一个 EvolutionService;不复制 lifecycle policy。 Stage 3 只有候选提案权:来源由 AgentDock 强制标记,不能借 Runtime API 投票或改生命周期。

func (*Runtime) RuntimeMCPManage

func (r *Runtime) RuntimeMCPManage(ctx context.Context, args map[string]any) (Result, error)

func (*Runtime) RuntimeMCPOAuthCallback added in v0.9.1

func (r *Runtime) RuntimeMCPOAuthCallback(_ context.Context, result oauthclient.CallbackResult) error

func (*Runtime) RuntimeMCPServer

func (r *Runtime) RuntimeMCPServer(ctx context.Context, name string) (Result, error)

func (*Runtime) RuntimeMCPServers

func (r *Runtime) RuntimeMCPServers(ctx context.Context) (Result, error)

func (*Runtime) RuntimePlugin added in v0.9.0

func (r *Runtime) RuntimePlugin(ctx context.Context, name string) (Result, error)

func (*Runtime) RuntimePlugins added in v0.9.0

func (r *Runtime) RuntimePlugins(ctx context.Context) (Result, error)

func (*Runtime) RuntimeSkill

func (r *Runtime) RuntimeSkill(skill string) (Result, error)

func (*Runtime) RuntimeSkillFile

func (r *Runtime) RuntimeSkillFile(skill, relativePath string) (Result, error)

func (*Runtime) RuntimeSkillFiles

func (r *Runtime) RuntimeSkillFiles(skill string) (Result, error)

func (*Runtime) RuntimeSkills

func (r *Runtime) RuntimeSkills() (Result, error)

func (*Runtime) RuntimeStatus

func (r *Runtime) RuntimeStatus() Result

func (*Runtime) RuntimeTask

func (r *Runtime) RuntimeTask(id string) (Result, error)

func (*Runtime) RuntimeTaskDelete

func (r *Runtime) RuntimeTaskDelete(id string) (Result, error)

func (*Runtime) RuntimeTasks

func (r *Runtime) RuntimeTasks(status string, limit int) (Result, error)

func (*Runtime) SetNexusOAuthCallback added in v0.9.1

func (r *Runtime) SetNexusOAuthCallback(publicURL, nodeID string) error

SetNexusOAuthCallback 只接收 Nexus 握手声明的公网 Origin。配对 endpoint 可能是 内网地址或反代内部地址,不能推导成第三方 OAuth Provider 可访问的 redirect URI。

func (*Runtime) ToolDefinition added in v0.8.2

func (r *Runtime) ToolDefinition(name string) (ToolDefinition, bool)

func (*Runtime) ToolDefinitions added in v0.8.2

func (r *Runtime) ToolDefinitions() []ToolDefinition

func (*Runtime) ToolNames

func (r *Runtime) ToolNames() []string

func (*Runtime) Workspace

func (r *Runtime) Workspace() *workspace.Workspace

type ToolAnnotations added in v0.7.0

type ToolAnnotations struct {
	Title           string
	ReadOnlyHint    bool
	DestructiveHint *bool
	IdempotentHint  bool
	OpenWorldHint   *bool
}

type ToolContract added in v0.8.2

type ToolContract struct {
	InputSchema  map[string]any
	OutputSchema map[string]any
}

type ToolContractProvider added in v0.8.2

type ToolContractProvider func(string, config.Config) (ToolContract, bool)

type ToolDefinition

type ToolDefinition struct {
	Name                   string
	Title                  string
	Description            string
	UIBinding              *UIBinding
	FileArgRewritePaths    []string
	FileResultRewritePaths []string
	InputSchema            map[string]any
	OutputSchema           map[string]any
	Annotations            *ToolAnnotations
}

func ToolDefinitions

func ToolDefinitions() []ToolDefinition

ToolDefinitions 返回无外部能力配置时的完整注册表定义,供静态检查与测试使用。

type ToolError

type ToolError = toolcore.ToolError

type ToolHandler

type ToolHandler func(context.Context, *Runtime, map[string]any) (Result, error)

type ToolSpec

type ToolSpec struct {
	Name                   string
	Title                  string
	Description            string
	FileArgRewritePaths    []string
	FileResultRewritePaths []string
	Contract               ToolContractProvider
	Annotations            *ToolAnnotations
	Availability           func(config.Config) bool
	Handler                ToolHandler
}

ToolSpec 是工具公开注册的单一入口:描述、契约所有者、配置开关和 handler 在这里显式绑定。 Schema 字段细节由对应 capability package 或共享 mcpcontract 拥有,app 不再按名字二次寻找 owner。

type UIBinding added in v0.8.0

type UIBinding struct {
	ResourceURI string
	Action      string
	Compact     *UITrigger
}

UIBinding describes when a tool should attach an MCP App resource to its descriptor or result. Full preserves today's behavior. Compact is opt-in per binding so new high-frequency views do not silently enter compact mode.

func (UIBinding) Trigger added in v0.9.1

func (binding UIBinding) Trigger(mode config.MCPAppsMode) (UITrigger, bool)

type UITrigger added in v0.9.1

type UITrigger struct {
	Action string
}

UITrigger describes whether a binding is descriptor-level or scoped to one tool action.

Jump to

Keyboard shortcuts

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