You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit da7d55a
Browse filesBrowse the repository at this point in the historyBrowse files
serde_json::from_value(view).context("invalid view (see the node list in the tool description)")
187
+
// Tool errors are shown with `{}`, which drops `.context` causes, so the
188
+
// serde reason goes in the message itself. Without it the agent can only
189
+
// guess which node or field is wrong.
190
+
serde_json::from_value(view).map_err(|error| {
191
+
anyhow!("invalid view: {error} (see the node list in the tool description)")
192
+
})
188
193
}
189
194
190
195
#[async_trait]
@@ -196,7 +201,7 @@ impl Tool for AppletTool {
196
201
fndescription(&self) -> &str{
197
202
"Show interactive native UI (an applet) in Jcode Desktop. By default the card replaces this tool call in the transcript. \
198
203
View is a tree of nodes, each {\"type\":...}. Layout: stack{direction:vertical|horizontal,gap,padding,align,children}, grid{min_column_width,children}, scroll{max_height,children}, card{title,children} (don't nest), tabs{bind,tabs:[{id,label,children}]}, spacer, divider. \
Spacing tokens none|xs|sm|md|lg|xl; tones default|dim|accent|success|warning|danger. Inputs/toggles/selects/tabs bind to keys in `state`. \
202
207
Actions are {action,args}. Custom names come back to you as an `[applet action]` message with the current state (or as this tool's output with wait=true). \
0 commit comments