spec(v0_10): add copyToClipboard standard local action to catalog, do…#623
spec(v0_10): add copyToClipboard standard local action to catalog, do…#623iamrajhans wants to merge 3 commits intogoogle:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request correctly adds the copyToClipboard standard local action. The schema definition in standard_catalog.json and the corresponding validation tests are well-implemented. I've added a couple of suggestions to improve the consistency of the documentation and evaluation prompts regarding the returnType property of the function call. Making these parts more explicit will improve clarity for developers and reliability of LLM-generated code.
| description: "A button that copies text to clipboard.", | ||
| promptText: `Create a 'createSurface' and 'updateComponents' message. Surface ID 'main'. | ||
| Include a 'Button' labeled "Copy Code". | ||
| The button's action should be a client-side function call to 'copyToClipboard' with the argument 'text': 'SAVE20'.`, |
There was a problem hiding this comment.
The prompt text for the LLM is a bit ambiguous about returnType. Given the subtleties of the schema validation where returnType defaults to "boolean", it would be more robust to explicitly ask the LLM to include "returnType": "void" in the function call. This will lead to more reliable JSON generation.
The button's action should be a client-side function call to 'copyToClipboard' with the argument 'text': 'SAVE20' and a 'returnType' of 'void'.Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
FYI: I added a comment on the issue about this feature. I'm not sure it belongs in the spec, since it could be implemented by a client that needs it. |
Description
This PR adds
copyToClipboardas a standard local client action in the v0.10 catalog so agents can request clipboard-copy behavior in a portable, schema-validated way.What changed:
copyToClipboardfunction definition tospecification/v0_10/json/standard_catalog.json:call: "copyToClipboard"args.text(dynamic string)returnType: "void"$defs.anyFunctionin the same schema.specification/v0_10/docs/a2ui_protocol.md:copyToClipboardspecification/v0_10/test/cases/function_catalog_validation.json:specification/v0_10/eval/src/prompts.tsforcopyToClipboard.Notes:
confirm, based on discussion in the linked issue thread.Fixes #533
Pre-launch Checklist
If you need help, consider asking for advice on the discussion board.