Files
Agent-System-Dev/examples/downstream-rdm/plugin.go
T
weichen 93ac63fb3d Compose immutable dependency sources and preserve branch transitions
Why:
Replace repeated submodule source pointers with consumer-owned language versions and fixed application sources, keeping independent repository edits and existing branches intact.

Evidence:
SELF task receipts contain startup/sync evidence, real Go and npm consumption, Native overlay/unlink, safe transition/ref preservation, credential boundary and historical build regressions. Exact committed full composition and RDM checks follow this checkpoint; formal acceptance and GATE CI remain pending.

Impact:
Add isolated build/test composition, source provenance and safe owner refresh, adapt governance and service build callers, remove replaced index links while retaining original Git metadata, and adopt reusable dependency standards.

Refs:
Documents approved dependency-workspace r1/R1-R15 and U1-U7 implementation plan; feature/dependency-workspace task card.
2026-10-13 17:18:07 +00:00

51 lines
1.4 KiB
Go

package rdm
import (
"context"
"encoding/json"
"git-ssh.u1680832.nyat.app/weichen/Agent-System-Backend.git/pkg/extension"
)
func init() {
extension.RegisterCompiled(extension.InProc{
ID: "rdm",
Register: register,
})
}
// register 登记下游扩展:技能 + 进程内命令处理器(EXT-1 最小集示范)。
func register(reg extension.Registry) error {
if err := reg.AddSkill("rdm-note", "# 研发记忆\n\n下游切片技能,不修改基座。\n"); err != nil {
return err
}
return reg.AddCommandHandler(json.RawMessage(`{
"id": "rdm.ping",
"title": "连通性自检",
"description": "读工件元数据 + 写审计,验证 EXT-1 owner 作用域宿主句柄",
"paramsSchema": {"type": "object", "properties": {"artifactId": {"type": "string"}}}
}`), rdmPing)
}
// rdmPing 经 owner 作用域宿主句柄:可选读工件元数据 → 写审计 → 返回回执。
// 处理器自身不持有任何 owner 凭证,一切能力经 h 取用。
func rdmPing(ctx context.Context, h extension.Host, req extension.Request) (any, error) {
artifact := ""
if id, _ := req.Params["artifactId"].(string); id != "" {
a, err := h.ArtifactGet(id)
if err != nil {
return nil, err
}
artifact = a.Name
}
if err := h.Audit("rdm.ping", req.ID, "{}"); err != nil {
return nil, err
}
return map[string]any{
"pong": true,
"owner": h.Owner(),
"plugin": h.PluginID(),
"artifact": artifact,
}, nil
}