enhancement
major
minor
defect
critical
major
minor
major
#30149
Let a chat agent run page commands that the page of the chat allows, e.g. open a dialog
Problem
A chat agent of an application cannot open a dialog or a view for the user. The only way from a run into the page is ChatPresentTool (tl-chat): it writes a Presentation of model objects or data onto a channel that a <chat-conversation present="..."> of the window allowed (ChatViewBinding.presentable), inside ChatWindowService.inWindow. <open-dialog>, <show-view> and other view actions run only as the action chain of a command the user clicks. No tool and no Java API runs them for a run.
Example: the agent that sets up projects in the control application tl-factory (TopLogic/tl-factory#24) must not take a token through the chat, because the chat is stored and sent to the model. It has to open the existing form for a git connection for the user, where the token goes into the secret store. Today it can only tell the user where to click.
Proposal
Page commands that the page lets its agent run, deny-by-default:
- <chat-conversation> gets a list <agent-commands>. Each entry has a name, a description for the model and an ordinary action chain (<open-dialog>, <show-view>, ...), executed like the chain of a command, including its executability and access checks.
- A tl-chat tool (group interaction, like present) runs the chain of a given name in the run's window through ChatWindowService.inWindow, as ChatPresentTool.deliver does.
- The tool is offered only while such an element is displayed (Tool.unavailableReason) and lists the names and descriptions of the allowed commands.
- An unknown name, a command not executable now, or a run without a window is refused with a reason for the model.
The page decides what the agent may open, and the chain does the opening. Nothing the page did not list is reachable.
Test
- A <chat-conversation> with one agent command opening a dialog: a run calling the tool opens the dialog in the run's window.
- A name not listed is refused.
- A run whose window does not display the element is refused.
- A command whose executability says no is refused with its reason.