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

runtimeapi

package
v1.0.0-rc.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowHeader

func AllowHeader(path string) string

func Dispatch

func Dispatch(ctx context.Context, runtime Runtime, request Request) (map[string]any, error)

Dispatch 只负责 Runtime API 的路由、参数校验与应用能力调用,不感知 HTTP request/response。

func MethodAllowed

func MethodAllowed(method, path string) bool

MethodAllowed 返回指定 Runtime API 路径允许当前方法与否。 HTTP 入口用它生成 405,其他传输也复用同一份方法契约。

Types

type DiagnosticsRuntime added in v1.0.0

type DiagnosticsRuntime interface {
	RuntimeDiagnostics() app.Result
}

MCPOAuthRuntime 是可选能力:只有支持 Remote MCP OAuth 的 Runtime 才实现。 保持它独立于 Runtime 主接口,避免 callback relay 把所有测试替身和只读调用方一起扩展。 DiagnosticsRuntime 是增量只读能力。保持它独立于 Runtime 主接口, 让旧实现或测试替身能明确返回“不支持”,而不是被迫实现空方法。

type MCPOAuthRuntime added in v0.9.1

type MCPOAuthRuntime interface {
	RuntimeMCPOAuthCallback(context.Context, oauthclient.CallbackResult) error
}

type NexusOAuthCallbackRuntime added in v0.9.1

type NexusOAuthCallbackRuntime interface {
	SetNexusOAuthCallback(publicURL, nodeID string) error
}

NexusOAuthCallbackRuntime 由节点 Bridge 在握手后提供 Nexus 公网 callback origin。

type Request

type Request struct {
	Method string          `json:"method"`
	Path   string          `json:"path"`
	Query  url.Values      `json:"query,omitempty"`
	Body   json.RawMessage `json:"body,omitempty"`
}

Request 是 HTTP 与 Nexus Bridge 共用的 Runtime API 请求表示。

type Runtime

type Runtime interface {
	RuntimeStatus() app.Result
	RuntimeAnalytics() app.Result
	RuntimeOverview() (app.Result, error)
	RuntimeSkills() (app.Result, error)
	RuntimeSkill(skill string) (app.Result, error)
	RuntimeSkillFiles(skill string) (app.Result, error)
	RuntimeSkillFile(skill, path string) (app.Result, error)
	RuntimePlugins(context.Context) (app.Result, error)
	RuntimePlugin(context.Context, string) (app.Result, error)
	RuntimeTasks(status string, limit int) (app.Result, error)
	RuntimeTask(id string) (app.Result, error)
	RuntimeTaskDelete(id string) (app.Result, error)
	RuntimeCapabilities(context.Context, bool) (app.Result, error)
	RuntimeMCPServers(context.Context) (app.Result, error)
	RuntimeMCPServer(context.Context, string) (app.Result, error)
	RuntimeMCPManage(context.Context, map[string]any) (app.Result, error)
	RuntimeEvolve(context.Context, map[string]any) (app.Result, error)
}

Runtime 定义 Runtime API 路由真正需要的应用能力。 HTTP、Nexus Bridge 等传输层都只依赖这份传输无关契约。

Jump to

Keyboard shortcuts

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