[v1.0][spec/docs] a2ui_custom_functions.md is unlinked from docs/public/ and its getScreenResolution example omits allowedCallers, failing with INVALID_FUNCTION_CALL
Summary
There are two issues with specification/v1_0/docs/a2ui_custom_functions.md:
- Unpublished in
docs/public/:specification/v1_0/docs/a2ui_custom_functions.mdis a dedicated v1.0 custom functions guide, but it is neither copied intodocs/public/nor linked frommkdocs.ymlor any page underdocs/public/. - Broken
getScreenResolutionExample (Spec Self-Contradiction):- In
specification/v1_0/docs/a2ui_protocol.md(lines 333–346),getScreenResolutionis used as the canonical example of an agent calling a client function viacallRendererFunction:{ "version": "v1.0", "callRendererFunction": { "surfaceId": "main-content", "functionCallId": "req-001", "callFunction": { "@call": "getScreenResolution", "catalogId": "https://example.com/a2ui/custom-catalog/v1" } } } - However, in
specification/v1_0/docs/a2ui_custom_functions.md(lines 78–83), the catalog definition forgetScreenResolutionomitsallowedCallers:"getScreenResolution": { "description": "Returns the current screen width and height in pixels.", "returnType": "object", "properties": { "type": "object", "properties": {}, "additionalProperties": false } } - Because
allowedCallersdefaults to"rendererOnly"(specification/v1_0/json/catalog_definition.jsonline 82, andRpcHandler.checkExecutionPermissionsintypescript/core/web_core/src/v1_0/rpc/rpc-handler.tslines 522–525:const allowedCallers = funcImpl.allowedCallers ?? 'rendererOnly'; if (allowedCallers === 'rendererOnly') throw new A2uiRpcError(RpcErrorCode.INVALID_FUNCTION_CALL, ...)), callinggetScreenResolutionviacallRendererFunctionalways fails at runtime withINVALID_FUNCTION_CALL!
- In
Affected Component / Files
- Repository commit:
e9dbcc3(main) - File path(s):
specification/v1_0/docs/a2ui_custom_functions.md(lines 72–97)specification/v1_0/docs/a2ui_protocol.md(lines 322–346)specification/v1_0/json/catalog_definition.json(lines 79–87)typescript/core/web_core/src/v1_0/rpc/rpc-handler.ts(lines 518–531)
Steps to Reproduce / Evidence
- Define
getScreenResolutionexactly as shown inspecification/v1_0/docs/a2ui_custom_functions.md(lines 78–83, withoutallowedCallers). - Send the
callRendererFunctionmessage fromspecification/v1_0/docs/a2ui_protocol.md(lines 333–346) intoMessageProcessor.processMessages(). RpcHandler.checkExecutionPermissions()defaultsallowedCallersto'rendererOnly'and rejects the call with:{ "version": "v1.0", "rendererFunctionResponse": { "functionCallId": "req-001", "error": { "code": "INVALID_FUNCTION_CALL", "message": "Function 'getScreenResolution' is restricted to 'rendererOnly' and cannot be called by the agent." } } }
Expected Behavior
specification/v1_0/docs/a2ui_custom_functions.mdshould include"allowedCallers": "rendererOrAgent"(or"agentOnly") ongetScreenResolutionand explain howallowedCallersgovernscallRendererFunctionvs UI bindings.- The guide should be published/linked in
docs/public/guides/(mkdocs.yml).
Actual Behavior
Following the official specification examples verbatim causes getScreenResolution to be rejected with INVALID_FUNCTION_CALL.
Suggested Fix
- Add
"allowedCallers": "rendererOrAgent"togetScreenResolutioninspecification/v1_0/docs/a2ui_custom_functions.md(line 80). - Surface
a2ui_custom_functions.mdindocs/public/guides/and link it inmkdocs.yml.
Confirmed in specification/v1_0/docs/a2ui_custom_functions.md (lines 48-67): the getScreenResolution catalog schema omits "allowedCallers": "rendererOrAgent", causing the callRendererFunction example in a2ui_protocol.md (lines 333-346) to be rejected with INVALID_FUNCTION_CALL under the default "rendererOnly" boundary. Also confirmed a2ui_custom_functions.md is not included in docs/scripts/convert_docs.py / mkdocs.yaml. Marking as P1.
Closing this as resolved on the new documentation site (https://a2ui.org/):
- The
getScreenResolutionexample inspecification/v1_0/docs/a2ui_custom_functions.mdnow includes"allowedCallers": "rendererOrAgent"and explainsINVALID_FUNCTION_CALL. - Custom functions,
allowedCallers,requiresUserActivation, andcallRendererFunctionare now documented ona2ui.org:
(Feel free to reopen if I missed anything!)