agent build
This commit is contained in:
@@ -85,8 +85,24 @@ type Agent struct {
|
||||
Trigger string `json:"trigger"`
|
||||
WebSearch bool `json:"webSearch"`
|
||||
|
||||
Skills []string `json:"skills"`
|
||||
Subagents []string `json:"subagents"`
|
||||
Skills []string `json:"skills"`
|
||||
Subagents []string `json:"subagents"`
|
||||
|
||||
// Tools this agent may call, by registry name.
|
||||
//
|
||||
// Backend-only: the frontend's agent editor has no field for it, and its
|
||||
// parser ignores an unknown frontmatter key, so a spec carrying `tools:`
|
||||
// still loads in both places. §3 says an unknown tool name fails validation
|
||||
// at PUBLISH; nothing published here yet does that check, and the runtime
|
||||
// records and drops an unknown name rather than failing the run.
|
||||
Tools []string `json:"tools"`
|
||||
|
||||
// Sources are the knowledge corpora this agent may retrieve from.
|
||||
//
|
||||
// `sources:` and not `knowledge:`, which §3 would call it — see the note on
|
||||
// runtime.Agent.KnowledgeSources. The Knowledge field below is the shipped
|
||||
// product's meaning of the word (an author's notes) and got there first.
|
||||
Sources []string `json:"sources"`
|
||||
Starters []Starter `json:"starters"`
|
||||
Knowledge []Knowledge `json:"knowledge"`
|
||||
Permissions Permissions `json:"permissions"`
|
||||
@@ -437,6 +453,8 @@ func ParseAgent(raw string, opts Options) (*Agent, error) {
|
||||
// From here the order follows the object literal normalizeAgent returns.
|
||||
pages := normalizePages(data["pages"], &errs)
|
||||
skills := uniqueStrings(data["skills"], "skills", "a skill id", &errs)
|
||||
toolNames := uniqueStrings(data["tools"], "tools", "a tool name", &errs)
|
||||
sources := uniqueStrings(data["sources"], "sources", "a knowledge source", &errs)
|
||||
permissions := normalizePermissions(data["permissions"], &errs)
|
||||
|
||||
instructions, _ := sectionSource(doc.Body, "Instructions")
|
||||
@@ -452,6 +470,8 @@ func ParseAgent(raw string, opts Options) (*Agent, error) {
|
||||
Trigger: jsTrimmed(data["trigger"]),
|
||||
WebSearch: data["webSearch"] == true || data["web_search"] == true,
|
||||
Skills: skills,
|
||||
Tools: toolNames,
|
||||
Sources: sources,
|
||||
Subagents: subagents,
|
||||
Starters: starters,
|
||||
Knowledge: knowledge,
|
||||
|
||||
Reference in New Issue
Block a user