feat(web): land Artifact serve/endpoint path and retire compose golds
Wire data_source into Document render, register Endpoint handlers via run_artifact, restore marqdo-blog as an Artifact site, and replace old compose_* web golds with ADR 0007 fixtures and docs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
67bac1bf02
commit
ff252fd469
86 files changed
+952
-4499
No files matched your search
@@ -49,3 +49,25 @@ func CallLibPath(path string, args map[string]any) (any, error) {
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
|
||||
// RunArtifact loads and runs a Document/Endpoint `.mq.md` (ADR 0007).
|
||||
// Request fields are passed as Metadata Binding overlays (`arg` / `--bind`).
|
||||
func RunArtifact(path string, args map[string]any) (any, error) {
|
||||
payload := map[string]any{"path": path}
|
||||
if len(args) > 0 {
|
||||
payload["args"] = args
|
||||
}
|
||||
raw, err := json.Marshal(payload)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out, err := Query("run_artifact", string(raw))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var v any
|
||||
if err := json.Unmarshal([]byte(out), &v); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
Reference in new issue
Block a user