Documentation
¶
Index ¶
- Constants
- func AllowHeader(path string) string
- func Dispatch(ctx context.Context, runtime Runtime, request Request) (map[string]any, error)
- func MethodAllowed(method, path string) bool
- type DiagnosticsRuntime
- type MCPOAuthRuntime
- type NexusOAuthCallbackRuntime
- type Request
- type ResourceLibraryRuntime
- type Runtime
Constants ¶
View Source
const ResourceLibraryPath = "/internal/runtime/resource-library"
Variables ¶
This section is empty.
Functions ¶
func AllowHeader ¶
func MethodAllowed ¶
MethodAllowed 返回指定 Runtime API 路径允许当前方法与否。 HTTP 入口用它生成 405,其他传输也复用同一份方法契约。
Types ¶
type DiagnosticsRuntime ¶ added in v1.0.0
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
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 ResourceLibraryRuntime ¶ added in v1.1.0
type ResourceLibraryRuntime interface {
RuntimeResourceLibrary(context.Context, string, []byte) (app.Result, error)
}
ResourceLibraryRuntime 是可选能力。旧 Runtime 不实现它时,资源库路由失败关闭, 不能把“未声明”解释成允许远程安装。 参数保持为方法和正文,避免 app 为了实现接口反过来导入 runtimeapi。
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 等传输层都只依赖这份传输无关契约。
Click to show internal directories.
Click to hide internal directories.