Repository navigation
feat(core): agent bridge at @once-ui-system/core/agent, with data-agent-* marks - #608
Closed
lorant-one wants to merge 3 commits into
Closed
lorant-one wants to merge 3 commits into
lorant-one wants to merge 3 commits into
Conversation
createAgent() gives snapshot, act and query over every mounted control and
page section. Steps run through each control's own change path inside
withChangeSource("agent"), so onXChange callbacks hear the source and can
cancel; a canceled or ignored set is reported as declined. An allow callback
decides each step. agentTools describes the tools as JSON Schema and
registerTools() offers them over WebMCP with a required allow.
Input, Textarea, Select, Checkbox, Switch, RadioGroup, Slider,
SegmentedControl, Tabs, Button and ThemeProvider register themselves.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtyAjxtXFsms7HWCd1w
hidden keeps a control or region out of the bridge; secret redacts its values, choices and changes while still letting an agent write it; confirm puts the mark's text on the entry and on the allow request, and refuses the step when the app gave no allow. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyAjxtXFsms7HWCd1w
This was referenced Nov 25, 2026
Slider and Textarea grow by their agent adapters; ./agent is new. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtyAjxtXFsms7HWCd1w
Member
Author
|
The Compare check flagged a single shot: I couldn't reproduce it. I built the docs locally from this branch and from its base ( I've re-run the visual workflow once. If it still fails, I'll pull the artifact and dig into the image itself. Generated by Claude Code |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requested by Lorant · project thread
This PR covers steps 2 and 3 of the agent-operable controls plan. It is stacked on #607 (change details) and targets that PR's branch. Once #607 merges, retarget it to
preview.What
A new
@once-ui-system/core/agententry exportscreateAgent(), which gives you:snapshot(): every mounted control and page section, with its accessible name, its state and the actions it takes right now. Refs look likec3ands1. The list is capped at 100 entries, and password values come back redacted.act({ steps }): several changes in one call. Each step runs through the control's own change path insidewithChangeSource("agent"), soonXChangeseesdetails.source === "agent"and can callcancel(). A refused set is reported as an error. A step can name its control by ref or label, and a choice by its label or its value.query(): a list's choices, 50 at a time, or the controls that match a text.allow: an option that decides each step.agentToolsdescribes the three tools as JSON Schema.registerTools()offers them through WebMCP (document.modelContext) where the browser supports it, and it requires anallow.These controls register themselves: Input, Textarea, Select, Checkbox, Switch, RadioGroup, Slider (single thumb), SegmentedControl, Tabs, Button and ThemeProvider (as the theme). A composite control such as Select speaks for its inner field through
AgentOwnedContext.Marks (step 3)
Each mark applies to the element that carries it and to everything inside it.
data-agent-hidden: the control or region is left out of the bridge entirely.data-agent-secret: an agent can write the field but can't read it. Values, choices and changes come back as[redacted].data-agent-confirm="Deletes the project": the entry and theallowrequest both carryconfirm, so the app can ask a person first. If the app set noallow, the step is refused.Checks
agent-bridge.test.tsxhas 9 tests. One of them changes every setting on a settings page in a singleactcall.tscis clean, and the lint gate is at its baseline of 112.Follow-ups
🤖 Generated with Claude Code
https://claude.ai/code/session_016gNJtyAjxtXFsms7HWCd1w