agent build

This commit is contained in:
2026-08-28 12:21:44 +05:30
parent b6f8655909
commit f7df96c973
138 changed files with 24164 additions and 207 deletions

View File

@@ -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,