-
Notifications
You must be signed in to change notification settings - Fork 558
feat(agent): build skills (#4918) #4930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
60b1074
feat(frontend): agent client-tool round-trip (#4920)
mmabrouk 4fdb038
feat(playground): default-agent-config build kit (#4917)
mmabrouk 66e5cce
fix(playground): read build-kit overlay from simple-applications resp…
mmabrouk e434925
fix(playground): build-kit embeds carry @ag.selector so they resolve …
mmabrouk 1e10d0d
fix(agent): type build-kit overlay, harden overlay build, embed displ…
mmabrouk c575cd7
feat(agent): agent-skills catalog (#4918)
mmabrouk b7c6154
fix(agent): show skill display name, not slug, for committed embeds
mmabrouk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| """Read-only overlays attached to application inspect/fetch responses.""" | ||
|
|
||
| from typing import Any, Dict, List, Optional | ||
|
|
||
| from agenta.sdk.agents.adapters.agenta_builtins import GETTING_STARTED_WITH_AGENTA_SLUG | ||
| from agenta.sdk.agents.platform.op_catalog import PLATFORM_OPS | ||
|
|
||
| from oss.src.core.workflows.static_catalog import ( | ||
| STATIC_SLUG_PREFIX, | ||
| StaticWorkflowCatalog, | ||
| _STATIC_WORKFLOWS, | ||
| ) | ||
|
|
||
|
|
||
| def _workflow_embed( | ||
| slug: str, | ||
| *, | ||
| name: Optional[str], | ||
| selector_path: str, | ||
| ) -> Dict[str, Any]: | ||
| # The selector is load-bearing: without it the embed resolves to the whole revision.data | ||
| # (``{uri, parameters: {skill|tool: ...}}``), which neither the SDK skill parser nor the tool | ||
| # coercer accepts. ``parameters.skill`` / ``parameters.tool`` extracts the flat inline value | ||
| # the agent template expects (see test_skill_template_catalog canonical embed shape). | ||
| embed: Dict[str, Any] = { | ||
| "@ag.embed": { | ||
| "@ag.references": {"workflow": {"slug": slug}}, | ||
| "@ag.selector": {"path": selector_path}, | ||
| } | ||
| } | ||
| # The display name rides alongside the embed so the playground shows the workflow's name, not | ||
| # the raw ``__ag__*`` slug. Resolution replaces the whole entry, so this sibling is discarded | ||
| # before the tool/skill parser ever sees it. | ||
| if name: | ||
| embed["name"] = name | ||
| return embed | ||
|
|
||
|
|
||
| def _reserved_static_tool_embeds( | ||
| catalog: StaticWorkflowCatalog, | ||
| ) -> List[Dict[str, Any]]: | ||
| """Tool embeds for the reserved static workflows that are tools (not skills). | ||
|
|
||
| Only confirmed non-skill static workflows with a resolvable revision are included; a missing | ||
| revision or missing flags is skipped so an invalid tool embed can't leak into the playground. | ||
| """ | ||
| embeds: List[Dict[str, Any]] = [] | ||
| for slug in _STATIC_WORKFLOWS: | ||
| if not slug.startswith(STATIC_SLUG_PREFIX): | ||
| continue | ||
| revision = catalog.retrieve_revision(slug=slug) | ||
| if not revision or not revision.flags or revision.flags.is_skill: | ||
| continue | ||
| embeds.append( | ||
| _workflow_embed( | ||
| slug, | ||
| name=revision.name, | ||
| selector_path="parameters.tool", | ||
| ) | ||
| ) | ||
| return embeds | ||
|
|
||
|
|
||
| def build_agent_template_overlay() -> Dict[str, Any]: | ||
| """Build the playground-only agent-template overlay from platform-owned sources.""" | ||
|
|
||
| catalog = StaticWorkflowCatalog() | ||
|
|
||
| skills: List[Dict[str, Any]] = [] | ||
| authoring_skill = catalog.retrieve_revision(slug=GETTING_STARTED_WITH_AGENTA_SLUG) | ||
| if authoring_skill: | ||
| skills.append( | ||
| _workflow_embed( | ||
| GETTING_STARTED_WITH_AGENTA_SLUG, | ||
| name=authoring_skill.name, | ||
| selector_path="parameters.skill", | ||
| ) | ||
| ) | ||
|
|
||
| return { | ||
| "tools": [ | ||
| *[{"type": "platform", "op": op_name} for op_name in PLATFORM_OPS], | ||
| *_reserved_static_tool_embeds(catalog), | ||
| ], | ||
| "skills": skills, | ||
| "sandbox": { | ||
| "permissions": { | ||
| "write_files": "allow", | ||
| "execute_code": "allow", | ||
| } | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Gate these static entries until the trigger/tool surface exists.
These slugs become live as soon as they land in
_STATIC_WORKFLOWS, but the paired skill content still directs the model into follow-up-only tool calls. In particular,build-your-first-approutes users toset-up-triggers, and that skill assumesfind_triggers,create_schedule,create_subscription,test_subscription, andlist_deliveriesalready exist. Shipping the catalog entries now turns those dead ends into runtime behavior for reserved__ag__*slugs. Keep them out of the static catalog until the tools land, or gate resolution behind availability.