Skip to content

Conversation

@iamrajhans
Copy link
Contributor

Description

This PR adds copyToClipboard as 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:

  • Added copyToClipboard function definition to specification/v0_10/json/standard_catalog.json:
    • call: "copyToClipboard"
    • args.text (dynamic string)
    • returnType: "void"
  • Added it to $defs.anyFunction in the same schema.
  • Updated protocol docs in specification/v0_10/docs/a2ui_protocol.md:
    • Added a local action example using copyToClipboard
    • Added it to the standard functions table
  • Added validation coverage in specification/v0_10/test/cases/function_catalog_validation.json:
    • valid call case
    • invalid args type
    • invalid return type
    • invalid text type
  • Added an eval prompt case in specification/v0_10/eval/src/prompts.ts for copyToClipboard.

Notes:

  • This PR intentionally does not add 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'.`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

add some common client actions to standard catalog

1 participant