Skip to content

Commit e8956b4

Browse files
os-zhuangclaude
andauthored
feat(spec): create seeds for agent / tool / skill / email_template / permission (#2282)
Extends the spec-derived create-shape contract to the AI + integration metadata types. Each gets an authoritative minimal create seed (empirically derived from its schema's required fields, validated by metadata-create-seeds.test.ts): agent (role+instructions), tool (description+parameters), skill (tools), email_template (subject+bodyHtml), permission (objects). They flow to the designer/CLI/API via /meta/types (no further wiring needed). `trigger` has no spec schema and stays unseeded. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 195c7e8 commit e8956b4

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

.changeset/ai-type-create-seeds.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
Add authoritative create seeds for agent / tool / skill / email_template / permission
6+
7+
Extends the spec-derived create-shape contract to the AI and integration metadata types. Each now has an authoritative minimal create seed (validated against its schema), so the Studio designer / CLI / API derive their create defaults from the spec via `/meta/types` — closing the "designer emits a minimal shape the spec rejects → create→save 422" gap for these types too (agent needs `role`+`instructions`, tool needs `description`+`parameters`, skill needs `tools`, email_template needs `subject`+`bodyHtml`, permission needs `objects`). `trigger` has no spec schema and is intentionally not seeded.

packages/spec/src/kernel/metadata-create-seeds.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,38 @@ const BUILTIN_METADATA_CREATE_SEEDS: Partial<Record<MetadataType, unknown>> = {
104104
pluralLabel: 'New Objects',
105105
fields: {},
106106
},
107+
agent: {
108+
name: 'new_agent',
109+
label: 'New Agent',
110+
// role + instructions are required — the agent's persona and behavior.
111+
role: 'A helpful assistant.',
112+
instructions: 'Describe what this agent should do.',
113+
},
114+
tool: {
115+
name: 'new_tool',
116+
label: 'New Tool',
117+
// description + a (possibly empty) parameters record are required.
118+
description: 'Describe what this tool does.',
119+
parameters: {},
120+
},
121+
skill: {
122+
name: 'new_skill',
123+
label: 'New Skill',
124+
// a skill bundles tools; an empty list is a valid starting point.
125+
tools: [],
126+
},
127+
email_template: {
128+
name: 'new_email_template',
129+
label: 'New Email Template',
130+
subject: 'Subject line',
131+
bodyHtml: '<p>Email body</p>',
132+
},
133+
permission: {
134+
name: 'new_permission',
135+
label: 'New Permission',
136+
// a permission set's per-object grant map; empty = no grants yet.
137+
objects: {},
138+
},
107139
};
108140

109141
/**

0 commit comments

Comments
 (0)