@adonis-agora/agent 0.61.0 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +91 -0
- package/README.md +12 -7
- package/dist/configure.d.ts +7 -5
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +7 -5
- package/dist/configure.js.map +1 -1
- package/dist/providers/a2a_provider.d.ts +14 -0
- package/dist/providers/a2a_provider.d.ts.map +1 -0
- package/dist/providers/a2a_provider.js +136 -0
- package/dist/providers/a2a_provider.js.map +1 -0
- package/dist/providers/agent_provider.d.ts.map +1 -1
- package/dist/providers/agent_provider.js +81 -25
- package/dist/providers/agent_provider.js.map +1 -1
- package/dist/providers/mcp_provider.d.ts +3 -0
- package/dist/providers/mcp_provider.d.ts.map +1 -1
- package/dist/providers/mcp_provider.js +147 -62
- package/dist/providers/mcp_provider.js.map +1 -1
- package/dist/src/a2a/auth.d.ts +67 -0
- package/dist/src/a2a/auth.d.ts.map +1 -0
- package/dist/src/a2a/auth.js +47 -0
- package/dist/src/a2a/auth.js.map +1 -0
- package/dist/src/a2a/define_config.d.ts +74 -0
- package/dist/src/a2a/define_config.d.ts.map +1 -0
- package/dist/src/a2a/define_config.js +5 -0
- package/dist/src/a2a/define_config.js.map +1 -0
- package/dist/src/a2a/gate.d.ts +23 -0
- package/dist/src/a2a/gate.d.ts.map +1 -0
- package/dist/src/a2a/gate.js +56 -0
- package/dist/src/a2a/gate.js.map +1 -0
- package/dist/src/a2a/handler.d.ts +65 -0
- package/dist/src/a2a/handler.d.ts.map +1 -0
- package/dist/src/a2a/handler.js +322 -0
- package/dist/src/a2a/handler.js.map +1 -0
- package/dist/src/a2a/index.d.ts +15 -0
- package/dist/src/a2a/index.d.ts.map +1 -0
- package/dist/src/a2a/index.js +9 -0
- package/dist/src/a2a/index.js.map +1 -0
- package/dist/src/a2a/permission-tool.d.ts +17 -0
- package/dist/src/a2a/permission-tool.d.ts.map +1 -0
- package/dist/src/a2a/permission-tool.js +70 -0
- package/dist/src/a2a/permission-tool.js.map +1 -0
- package/dist/src/a2a/protocol.d.ts +100 -0
- package/dist/src/a2a/protocol.d.ts.map +1 -0
- package/dist/src/a2a/protocol.js +106 -0
- package/dist/src/a2a/protocol.js.map +1 -0
- package/dist/src/a2a/runtime.d.ts +6 -0
- package/dist/src/a2a/runtime.d.ts.map +1 -0
- package/dist/src/a2a/runtime.js +13 -0
- package/dist/src/a2a/runtime.js.map +1 -0
- package/dist/src/a2a/server_middleware.d.ts +13 -0
- package/dist/src/a2a/server_middleware.d.ts.map +1 -0
- package/dist/src/a2a/server_middleware.js +18 -0
- package/dist/src/a2a/server_middleware.js.map +1 -0
- package/dist/src/a2a/store.d.ts +79 -0
- package/dist/src/a2a/store.d.ts.map +1 -0
- package/dist/src/a2a/store.js +151 -0
- package/dist/src/a2a/store.js.map +1 -0
- package/dist/src/a2a/turn.d.ts +80 -0
- package/dist/src/a2a/turn.d.ts.map +1 -0
- package/dist/src/a2a/turn.js +211 -0
- package/dist/src/a2a/turn.js.map +1 -0
- package/dist/src/action-proposal-executor.d.ts +3 -0
- package/dist/src/action-proposal-executor.d.ts.map +1 -1
- package/dist/src/action-proposal-executor.js +10 -0
- package/dist/src/action-proposal-executor.js.map +1 -1
- package/dist/src/action-proposal-service.d.ts +7 -2
- package/dist/src/action-proposal-service.d.ts.map +1 -1
- package/dist/src/action-proposal-service.js +21 -16
- package/dist/src/action-proposal-service.js.map +1 -1
- package/dist/src/action-proposal-text.d.ts +42 -3
- package/dist/src/action-proposal-text.d.ts.map +1 -1
- package/dist/src/action-proposal-text.js +80 -12
- package/dist/src/action-proposal-text.js.map +1 -1
- package/dist/src/action-proposal-worker.d.ts +2 -1
- package/dist/src/action-proposal-worker.d.ts.map +1 -1
- package/dist/src/action-proposal-worker.js +9 -2
- package/dist/src/action-proposal-worker.js.map +1 -1
- package/dist/src/actor-resolver.d.ts +12 -4
- package/dist/src/actor-resolver.d.ts.map +1 -1
- package/dist/src/actor-resolver.js +24 -7
- package/dist/src/actor-resolver.js.map +1 -1
- package/dist/src/ag-ui/adapter.d.ts.map +1 -1
- package/dist/src/ag-ui/adapter.js +115 -17
- package/dist/src/ag-ui/adapter.js.map +1 -1
- package/dist/src/ag-ui/core/encoder.d.ts +106 -0
- package/dist/src/ag-ui/core/encoder.d.ts.map +1 -0
- package/dist/src/ag-ui/core/encoder.js +534 -0
- package/dist/src/ag-ui/core/encoder.js.map +1 -0
- package/dist/src/ag-ui/core/index.d.ts +12 -0
- package/dist/src/ag-ui/core/index.d.ts.map +1 -0
- package/dist/src/ag-ui/core/index.js +12 -0
- package/dist/src/ag-ui/core/index.js.map +1 -0
- package/dist/src/ag-ui/core/input.d.ts +92 -0
- package/dist/src/ag-ui/core/input.d.ts.map +1 -0
- package/dist/src/ag-ui/core/input.js +246 -0
- package/dist/src/ag-ui/core/input.js.map +1 -0
- package/dist/src/ag-ui/core/interrupt-id.d.ts +31 -0
- package/dist/src/ag-ui/core/interrupt-id.d.ts.map +1 -0
- package/dist/src/ag-ui/core/interrupt-id.js +48 -0
- package/dist/src/ag-ui/core/interrupt-id.js.map +1 -0
- package/dist/src/ag-ui/{proposal-decision.d.ts → core/proposal-decision.d.ts} +1 -1
- package/dist/src/ag-ui/core/proposal-decision.d.ts.map +1 -0
- package/dist/src/ag-ui/{proposal-decision.js → core/proposal-decision.js} +3 -6
- package/dist/src/ag-ui/core/proposal-decision.js.map +1 -0
- package/dist/src/ag-ui/core/stream.d.ts +49 -0
- package/dist/src/ag-ui/core/stream.d.ts.map +1 -0
- package/dist/src/ag-ui/core/stream.js +90 -0
- package/dist/src/ag-ui/core/stream.js.map +1 -0
- package/dist/src/ag-ui/core/types.d.ts +249 -0
- package/dist/src/ag-ui/core/types.d.ts.map +1 -0
- package/dist/src/ag-ui/core/types.js +35 -0
- package/dist/src/ag-ui/core/types.js.map +1 -0
- package/dist/src/ag-ui/encoder.d.ts +3 -4
- package/dist/src/ag-ui/encoder.d.ts.map +1 -1
- package/dist/src/ag-ui/encoder.js +10 -11
- package/dist/src/ag-ui/encoder.js.map +1 -1
- package/dist/src/ag-ui/frames.d.ts +8 -5
- package/dist/src/ag-ui/frames.d.ts.map +1 -1
- package/dist/src/ag-ui/frames.js +21 -7
- package/dist/src/ag-ui/frames.js.map +1 -1
- package/dist/src/ag-ui/index.d.ts +3 -5
- package/dist/src/ag-ui/index.d.ts.map +1 -1
- package/dist/src/ag-ui/index.js +3 -5
- package/dist/src/ag-ui/index.js.map +1 -1
- package/dist/src/ag-ui/stream.d.ts +3 -4
- package/dist/src/ag-ui/stream.d.ts.map +1 -1
- package/dist/src/ag-ui/stream.js +4 -5
- package/dist/src/ag-ui/stream.js.map +1 -1
- package/dist/src/agent-deps-factory.d.ts +3 -0
- package/dist/src/agent-deps-factory.d.ts.map +1 -1
- package/dist/src/agent-deps-factory.js +3 -0
- package/dist/src/agent-deps-factory.js.map +1 -1
- package/dist/src/agent-deps.d.ts +3 -0
- package/dist/src/agent-deps.d.ts.map +1 -1
- package/dist/src/agent-deps.js.map +1 -1
- package/dist/src/agent-loop.d.ts +4 -3
- package/dist/src/agent-loop.d.ts.map +1 -1
- package/dist/src/agent-loop.js +50 -25
- package/dist/src/agent-loop.js.map +1 -1
- package/dist/src/agent-service.d.ts +46 -4
- package/dist/src/agent-service.d.ts.map +1 -1
- package/dist/src/agent-service.js +87 -11
- package/dist/src/agent-service.js.map +1 -1
- package/dist/src/ai-sdk/ai-sdk-model.js +4 -1
- package/dist/src/ai-sdk/ai-sdk-model.js.map +1 -1
- package/dist/src/ai-tool-ref.d.ts +4 -0
- package/dist/src/ai-tool-ref.d.ts.map +1 -1
- package/dist/src/ai-tool-ref.js +10 -14
- package/dist/src/ai-tool-ref.js.map +1 -1
- package/dist/src/attachment-limits.d.ts +10 -0
- package/dist/src/attachment-limits.d.ts.map +1 -0
- package/dist/src/attachment-limits.js +13 -0
- package/dist/src/attachment-limits.js.map +1 -0
- package/dist/src/channels/adapters/evolution_api.d.ts +49 -0
- package/dist/src/channels/adapters/evolution_api.d.ts.map +1 -0
- package/dist/src/channels/adapters/evolution_api.js +241 -0
- package/dist/src/channels/adapters/evolution_api.js.map +1 -0
- package/dist/src/channels/adapters/telegram.d.ts +34 -0
- package/dist/src/channels/adapters/telegram.d.ts.map +1 -0
- package/dist/src/channels/adapters/telegram.js +196 -0
- package/dist/src/channels/adapters/telegram.js.map +1 -0
- package/dist/src/channels/adapters/whatsapp_cloud.d.ts +31 -0
- package/dist/src/channels/adapters/whatsapp_cloud.d.ts.map +1 -0
- package/dist/src/channels/adapters/whatsapp_cloud.js +177 -0
- package/dist/src/channels/adapters/whatsapp_cloud.js.map +1 -0
- package/dist/src/channels/handler.d.ts +167 -0
- package/dist/src/channels/handler.d.ts.map +1 -0
- package/dist/src/channels/handler.js +569 -0
- package/dist/src/channels/handler.js.map +1 -0
- package/dist/src/channels/http.d.ts +45 -0
- package/dist/src/channels/http.d.ts.map +1 -0
- package/dist/src/channels/http.js +147 -0
- package/dist/src/channels/http.js.map +1 -0
- package/dist/src/channels/index.d.ts +16 -0
- package/dist/src/channels/index.d.ts.map +1 -0
- package/dist/src/channels/index.js +15 -0
- package/dist/src/channels/index.js.map +1 -0
- package/dist/src/channels/markdown.d.ts +12 -0
- package/dist/src/channels/markdown.d.ts.map +1 -0
- package/dist/src/channels/markdown.js +120 -0
- package/dist/src/channels/markdown.js.map +1 -0
- package/dist/src/channels/questions.d.ts +43 -0
- package/dist/src/channels/questions.d.ts.map +1 -0
- package/dist/src/channels/questions.js +90 -0
- package/dist/src/channels/questions.js.map +1 -0
- package/dist/src/channels/split.d.ts +8 -0
- package/dist/src/channels/split.d.ts.map +1 -0
- package/dist/src/channels/split.js +45 -0
- package/dist/src/channels/split.js.map +1 -0
- package/dist/src/channels/store.d.ts +78 -0
- package/dist/src/channels/store.d.ts.map +1 -0
- package/dist/src/channels/store.js +151 -0
- package/dist/src/channels/store.js.map +1 -0
- package/dist/src/channels/types.d.ts +138 -0
- package/dist/src/channels/types.d.ts.map +1 -0
- package/dist/src/channels/types.js +7 -0
- package/dist/src/channels/types.js.map +1 -0
- package/dist/src/chat-queue-service.d.ts.map +1 -1
- package/dist/src/chat-queue-service.js +2 -0
- package/dist/src/chat-queue-service.js.map +1 -1
- package/dist/src/define_config.d.ts +61 -12
- package/dist/src/define_config.d.ts.map +1 -1
- package/dist/src/define_config.js.map +1 -1
- package/dist/src/engine.d.ts +77 -0
- package/dist/src/engine.d.ts.map +1 -0
- package/dist/src/engine.js +27 -0
- package/dist/src/engine.js.map +1 -0
- package/dist/src/genui/builtins.d.ts +73 -3
- package/dist/src/genui/builtins.d.ts.map +1 -1
- package/dist/src/genui/builtins.js +357 -3
- package/dist/src/genui/builtins.js.map +1 -1
- package/dist/src/genui/capabilities.d.ts +24 -0
- package/dist/src/genui/capabilities.d.ts.map +1 -0
- package/dist/src/genui/capabilities.js +81 -0
- package/dist/src/genui/capabilities.js.map +1 -0
- package/dist/src/genui/catalog.d.ts +86 -0
- package/dist/src/genui/catalog.d.ts.map +1 -0
- package/dist/src/genui/catalog.js +96 -0
- package/dist/src/genui/catalog.js.map +1 -0
- package/dist/src/genui/factory.d.ts +7 -14
- package/dist/src/genui/factory.d.ts.map +1 -1
- package/dist/src/genui/factory.js.map +1 -1
- package/dist/src/genui/index.d.ts +4 -12
- package/dist/src/genui/index.d.ts.map +1 -1
- package/dist/src/genui/index.js +5 -18
- package/dist/src/genui/index.js.map +1 -1
- package/dist/src/genui/public.d.ts +9 -0
- package/dist/src/genui/public.d.ts.map +1 -0
- package/dist/src/genui/public.js +9 -0
- package/dist/src/genui/public.js.map +1 -0
- package/dist/src/genui/registry.d.ts +65 -0
- package/dist/src/genui/registry.d.ts.map +1 -0
- package/dist/src/genui/registry.js +151 -0
- package/dist/src/genui/registry.js.map +1 -0
- package/dist/src/genui/schema.d.ts +71 -0
- package/dist/src/genui/schema.d.ts.map +1 -0
- package/dist/src/genui/schema.js +304 -0
- package/dist/src/genui/schema.js.map +1 -0
- package/dist/src/genui/text.d.ts +36 -0
- package/dist/src/genui/text.d.ts.map +1 -0
- package/dist/src/genui/text.js +157 -0
- package/dist/src/genui/text.js.map +1 -0
- package/dist/src/genui/tools.d.ts +92 -0
- package/dist/src/genui/tools.d.ts.map +1 -0
- package/dist/src/genui/tools.js +291 -0
- package/dist/src/genui/tools.js.map +1 -0
- package/dist/src/genui/tree.d.ts +56 -0
- package/dist/src/genui/tree.d.ts.map +1 -0
- package/dist/src/genui/tree.js +188 -0
- package/dist/src/genui/tree.js.map +1 -0
- package/dist/src/index.d.ts +6 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/auth.d.ts +17 -1
- package/dist/src/mcp/auth.d.ts.map +1 -1
- package/dist/src/mcp/auth.js +14 -3
- package/dist/src/mcp/auth.js.map +1 -1
- package/dist/src/mcp/define_config.d.ts +81 -2
- package/dist/src/mcp/define_config.d.ts.map +1 -1
- package/dist/src/mcp/define_config.js.map +1 -1
- package/dist/src/mcp/index.d.ts +1 -1
- package/dist/src/mcp/index.d.ts.map +1 -1
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/mcp/oauth-resource.d.ts +9 -0
- package/dist/src/mcp/oauth-resource.d.ts.map +1 -0
- package/dist/src/mcp/oauth-resource.js +16 -0
- package/dist/src/mcp/oauth-resource.js.map +1 -0
- package/dist/src/mcp/server.d.ts +5 -0
- package/dist/src/mcp/server.d.ts.map +1 -1
- package/dist/src/mcp/server.js +48 -16
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/negotiated-tool-ui.d.ts.map +1 -1
- package/dist/src/negotiated-tool-ui.js +12 -8
- package/dist/src/negotiated-tool-ui.js.map +1 -1
- package/dist/src/opencode/client.d.ts +202 -0
- package/dist/src/opencode/client.d.ts.map +1 -0
- package/dist/src/opencode/client.js +2 -0
- package/dist/src/opencode/client.js.map +1 -0
- package/dist/src/opencode/durable/index.d.ts +33 -0
- package/dist/src/opencode/durable/index.d.ts.map +1 -0
- package/dist/src/opencode/durable/index.js +38 -0
- package/dist/src/opencode/durable/index.js.map +1 -0
- package/dist/src/opencode/durable/runner.d.ts +36 -0
- package/dist/src/opencode/durable/runner.d.ts.map +1 -0
- package/dist/src/opencode/durable/runner.js +88 -0
- package/dist/src/opencode/durable/runner.js.map +1 -0
- package/dist/src/opencode/durable/workflow.d.ts +40 -0
- package/dist/src/opencode/durable/workflow.d.ts.map +1 -0
- package/dist/src/opencode/durable/workflow.js +106 -0
- package/dist/src/opencode/durable/workflow.js.map +1 -0
- package/dist/src/opencode/engine.d.ts +48 -0
- package/dist/src/opencode/engine.d.ts.map +1 -0
- package/dist/src/opencode/engine.js +98 -0
- package/dist/src/opencode/engine.js.map +1 -0
- package/dist/src/opencode/event-hub.d.ts +23 -0
- package/dist/src/opencode/event-hub.d.ts.map +1 -0
- package/dist/src/opencode/event-hub.js +99 -0
- package/dist/src/opencode/event-hub.js.map +1 -0
- package/dist/src/opencode/forms.d.ts +19 -0
- package/dist/src/opencode/forms.d.ts.map +1 -0
- package/dist/src/opencode/forms.js +82 -0
- package/dist/src/opencode/forms.js.map +1 -0
- package/dist/src/opencode/host.d.ts +179 -0
- package/dist/src/opencode/host.d.ts.map +1 -0
- package/dist/src/opencode/host.js +34 -0
- package/dist/src/opencode/host.js.map +1 -0
- package/dist/src/opencode/index.d.ts +15 -0
- package/dist/src/opencode/index.d.ts.map +1 -0
- package/dist/src/opencode/index.js +9 -0
- package/dist/src/opencode/index.js.map +1 -0
- package/dist/src/opencode/log.d.ts +9 -0
- package/dist/src/opencode/log.d.ts.map +1 -0
- package/dist/src/opencode/log.js +15 -0
- package/dist/src/opencode/log.js.map +1 -0
- package/dist/src/opencode/mcp.d.ts +60 -0
- package/dist/src/opencode/mcp.d.ts.map +1 -0
- package/dist/src/opencode/mcp.js +258 -0
- package/dist/src/opencode/mcp.js.map +1 -0
- package/dist/src/opencode/runner.d.ts +40 -0
- package/dist/src/opencode/runner.d.ts.map +1 -0
- package/dist/src/opencode/runner.js +125 -0
- package/dist/src/opencode/runner.js.map +1 -0
- package/dist/src/opencode/turn.d.ts +167 -0
- package/dist/src/opencode/turn.d.ts.map +1 -0
- package/dist/src/opencode/turn.js +761 -0
- package/dist/src/opencode/turn.js.map +1 -0
- package/dist/src/opencode/turns.d.ts +247 -0
- package/dist/src/opencode/turns.d.ts.map +1 -0
- package/dist/src/opencode/turns.js +867 -0
- package/dist/src/opencode/turns.js.map +1 -0
- package/dist/src/personas.d.ts.map +1 -1
- package/dist/src/personas.js +4 -1
- package/dist/src/personas.js.map +1 -1
- package/dist/src/react/ag-ui.d.ts +4 -2
- package/dist/src/react/ag-ui.d.ts.map +1 -1
- package/dist/src/react/ag-ui.js +2 -2
- package/dist/src/react/ag-ui.js.map +1 -1
- package/dist/src/react/client.d.ts +1 -1
- package/dist/src/react/client.d.ts.map +1 -1
- package/dist/src/react/client.js +1 -1
- package/dist/src/react/client.js.map +1 -1
- package/dist/src/react/core/ag-ui-backend.d.ts +109 -0
- package/dist/src/react/core/ag-ui-backend.d.ts.map +1 -0
- package/dist/src/react/core/ag-ui-backend.js +574 -0
- package/dist/src/react/core/ag-ui-backend.js.map +1 -0
- package/dist/src/react/core/agent-chat-transport.d.ts +187 -0
- package/dist/src/react/core/agent-chat-transport.d.ts.map +1 -0
- package/dist/src/react/core/agent-chat-transport.js +817 -0
- package/dist/src/react/core/agent-chat-transport.js.map +1 -0
- package/dist/src/react/core/approvals/countdown.d.ts +22 -0
- package/dist/src/react/core/approvals/countdown.d.ts.map +1 -0
- package/dist/src/react/core/approvals/countdown.js +39 -0
- package/dist/src/react/core/approvals/countdown.js.map +1 -0
- package/dist/src/react/core/approvals/proposals.d.ts +15 -0
- package/dist/src/react/core/approvals/proposals.d.ts.map +1 -0
- package/dist/src/react/core/approvals/proposals.js +82 -0
- package/dist/src/react/core/approvals/proposals.js.map +1 -0
- package/dist/src/react/core/approvals/use-action-proposals.d.ts +10 -0
- package/dist/src/react/core/approvals/use-action-proposals.d.ts.map +1 -0
- package/dist/src/react/core/approvals/use-action-proposals.js +86 -0
- package/dist/src/react/core/approvals/use-action-proposals.js.map +1 -0
- package/dist/src/react/core/attachments/files.d.ts +39 -0
- package/dist/src/react/core/attachments/files.d.ts.map +1 -0
- package/dist/src/react/core/attachments/files.js +89 -0
- package/dist/src/react/core/attachments/files.js.map +1 -0
- package/dist/src/react/core/attachments/use-attachments.d.ts +106 -0
- package/dist/src/react/core/attachments/use-attachments.d.ts.map +1 -0
- package/dist/src/react/core/attachments/use-attachments.js +217 -0
- package/dist/src/react/core/attachments/use-attachments.js.map +1 -0
- package/dist/src/react/core/backend.d.ts +245 -0
- package/dist/src/react/core/backend.d.ts.map +1 -0
- package/dist/src/react/core/backend.js +21 -0
- package/dist/src/react/core/backend.js.map +1 -0
- package/dist/src/react/core/background-runs.d.ts +32 -0
- package/dist/src/react/core/background-runs.d.ts.map +1 -0
- package/dist/src/react/core/background-runs.js +47 -0
- package/dist/src/react/core/background-runs.js.map +1 -0
- package/dist/src/react/core/catalog/use-agents.d.ts +31 -0
- package/dist/src/react/core/catalog/use-agents.d.ts.map +1 -0
- package/dist/src/react/core/catalog/use-agents.js +28 -0
- package/dist/src/react/core/catalog/use-agents.js.map +1 -0
- package/dist/src/react/core/catalog/use-models.d.ts +41 -0
- package/dist/src/react/core/catalog/use-models.d.ts.map +1 -0
- package/dist/src/react/core/catalog/use-models.js +35 -0
- package/dist/src/react/core/catalog/use-models.js.map +1 -0
- package/dist/src/react/core/catalog/use-resource.d.ts +12 -0
- package/dist/src/react/core/catalog/use-resource.d.ts.map +1 -0
- package/dist/src/react/core/catalog/use-resource.js +41 -0
- package/dist/src/react/core/catalog/use-resource.js.map +1 -0
- package/dist/src/react/core/client-wire.d.ts +14 -0
- package/dist/src/react/core/client-wire.d.ts.map +1 -0
- package/dist/src/react/core/client-wire.js +2 -0
- package/dist/src/react/core/client-wire.js.map +1 -0
- package/dist/src/react/core/client.d.ts +222 -0
- package/dist/src/react/core/client.d.ts.map +1 -0
- package/dist/src/react/core/client.js +435 -0
- package/dist/src/react/core/client.js.map +1 -0
- package/dist/src/react/core/components/ambient-ui.d.ts +22 -0
- package/dist/src/react/core/components/ambient-ui.d.ts.map +1 -0
- package/dist/src/react/core/components/ambient-ui.js +30 -0
- package/dist/src/react/core/components/ambient-ui.js.map +1 -0
- package/dist/src/react/core/components/chat-input.d.ts +44 -0
- package/dist/src/react/core/components/chat-input.d.ts.map +1 -0
- package/dist/src/react/core/components/chat-input.js +69 -0
- package/dist/src/react/core/components/chat-input.js.map +1 -0
- package/dist/src/react/core/components/index.d.ts +7 -0
- package/dist/src/react/core/components/index.d.ts.map +1 -0
- package/dist/src/react/core/components/index.js +7 -0
- package/dist/src/react/core/components/index.js.map +1 -0
- package/dist/src/react/core/components/message-item.d.ts +101 -0
- package/dist/src/react/core/components/message-item.d.ts.map +1 -0
- package/dist/src/react/core/components/message-item.js +118 -0
- package/dist/src/react/core/components/message-item.js.map +1 -0
- package/dist/src/react/core/components/message-list.d.ts +85 -0
- package/dist/src/react/core/components/message-list.d.ts.map +1 -0
- package/dist/src/react/core/components/message-list.js +45 -0
- package/dist/src/react/core/components/message-list.js.map +1 -0
- package/dist/src/react/core/components/speech-languages.d.ts +22 -0
- package/dist/src/react/core/components/speech-languages.d.ts.map +1 -0
- package/dist/src/react/core/components/speech-languages.js +38 -0
- package/dist/src/react/core/components/speech-languages.js.map +1 -0
- package/dist/src/react/core/components/use-speech-recognition.d.ts +19 -0
- package/dist/src/react/core/components/use-speech-recognition.d.ts.map +1 -0
- package/dist/src/react/core/components/use-speech-recognition.js +92 -0
- package/dist/src/react/core/components/use-speech-recognition.js.map +1 -0
- package/dist/src/react/core/composer/index.d.ts +4 -0
- package/dist/src/react/core/composer/index.d.ts.map +1 -0
- package/dist/src/react/core/composer/index.js +4 -0
- package/dist/src/react/core/composer/index.js.map +1 -0
- package/dist/src/react/core/composer/model.d.ts +83 -0
- package/dist/src/react/core/composer/model.d.ts.map +1 -0
- package/dist/src/react/core/composer/model.js +53 -0
- package/dist/src/react/core/composer/model.js.map +1 -0
- package/dist/src/react/core/composer/skills-source.d.ts +29 -0
- package/dist/src/react/core/composer/skills-source.d.ts.map +1 -0
- package/dist/src/react/core/composer/skills-source.js +61 -0
- package/dist/src/react/core/composer/skills-source.js.map +1 -0
- package/dist/src/react/core/composer/use-composer-autocomplete.d.ts +78 -0
- package/dist/src/react/core/composer/use-composer-autocomplete.d.ts.map +1 -0
- package/dist/src/react/core/composer/use-composer-autocomplete.js +244 -0
- package/dist/src/react/core/composer/use-composer-autocomplete.js.map +1 -0
- package/dist/src/react/core/config/use-agent-config.d.ts +21 -0
- package/dist/src/react/core/config/use-agent-config.d.ts.map +1 -0
- package/dist/src/react/core/config/use-agent-config.js +57 -0
- package/dist/src/react/core/config/use-agent-config.js.map +1 -0
- package/dist/src/react/core/elicitation/answers.d.ts +22 -0
- package/dist/src/react/core/elicitation/answers.d.ts.map +1 -0
- package/dist/src/react/core/elicitation/answers.js +65 -0
- package/dist/src/react/core/elicitation/answers.js.map +1 -0
- package/dist/src/react/core/feedback/use-message-feedback.d.ts +32 -0
- package/dist/src/react/core/feedback/use-message-feedback.d.ts.map +1 -0
- package/dist/src/react/core/feedback/use-message-feedback.js +106 -0
- package/dist/src/react/core/feedback/use-message-feedback.js.map +1 -0
- package/dist/src/react/core/genui/generative-ui.d.ts +76 -0
- package/dist/src/react/core/genui/generative-ui.d.ts.map +1 -0
- package/dist/src/react/core/genui/generative-ui.js +210 -0
- package/dist/src/react/core/genui/generative-ui.js.map +1 -0
- package/dist/src/react/core/genui/index.d.ts +5 -0
- package/dist/src/react/core/genui/index.d.ts.map +1 -0
- package/dist/src/react/core/genui/index.js +5 -0
- package/dist/src/react/core/genui/index.js.map +1 -0
- package/dist/src/react/core/genui/json-render.d.ts +54 -0
- package/dist/src/react/core/genui/json-render.d.ts.map +1 -0
- package/dist/src/react/core/genui/json-render.js +64 -0
- package/dist/src/react/core/genui/json-render.js.map +1 -0
- package/dist/src/react/core/genui/playwright.d.ts +12 -0
- package/dist/src/react/core/genui/playwright.d.ts.map +1 -0
- package/dist/src/react/core/genui/playwright.js +141 -0
- package/dist/src/react/core/genui/playwright.js.map +1 -0
- package/dist/src/react/core/genui/react-registry.d.ts +22 -0
- package/dist/src/react/core/genui/react-registry.d.ts.map +1 -0
- package/dist/src/react/core/genui/react-registry.js +72 -0
- package/dist/src/react/core/genui/react-registry.js.map +1 -0
- package/dist/src/react/core/genui/server.d.ts +32 -0
- package/dist/src/react/core/genui/server.d.ts.map +1 -0
- package/dist/src/react/core/genui/server.js +66 -0
- package/dist/src/react/core/genui/server.js.map +1 -0
- package/dist/src/react/core/genui/types.d.ts +98 -0
- package/dist/src/react/core/genui/types.d.ts.map +1 -0
- package/dist/src/react/core/genui/types.js +3 -0
- package/dist/src/react/core/genui/types.js.map +1 -0
- package/dist/src/react/core/genui/use-generative-ui.d.ts +42 -0
- package/dist/src/react/core/genui/use-generative-ui.d.ts.map +1 -0
- package/dist/src/react/core/genui/use-generative-ui.js +186 -0
- package/dist/src/react/core/genui/use-generative-ui.js.map +1 -0
- package/dist/src/react/core/http-error.d.ts +33 -0
- package/dist/src/react/core/http-error.d.ts.map +1 -0
- package/dist/src/react/core/http-error.js +47 -0
- package/dist/src/react/core/http-error.js.map +1 -0
- package/dist/src/react/core/index.d.ts +35 -0
- package/dist/src/react/core/index.d.ts.map +1 -0
- package/dist/src/react/core/index.js +34 -0
- package/dist/src/react/core/index.js.map +1 -0
- package/dist/src/react/core/markdown/agent-markdown.d.ts +39 -0
- package/dist/src/react/core/markdown/agent-markdown.d.ts.map +1 -0
- package/dist/src/react/core/markdown/agent-markdown.js +22 -0
- package/dist/src/react/core/markdown/agent-markdown.js.map +1 -0
- package/dist/src/react/core/markdown/index.d.ts +2 -0
- package/dist/src/react/core/markdown/index.d.ts.map +1 -0
- package/dist/src/react/core/markdown/index.js +2 -0
- package/dist/src/react/core/markdown/index.js.map +1 -0
- package/dist/src/react/core/media/index.d.ts +64 -0
- package/dist/src/react/core/media/index.d.ts.map +1 -0
- package/dist/src/react/core/media/index.js +135 -0
- package/dist/src/react/core/media/index.js.map +1 -0
- package/dist/src/react/core/media/tus.d.ts +13 -0
- package/dist/src/react/core/media/tus.d.ts.map +1 -0
- package/dist/src/react/core/media/tus.js +59 -0
- package/dist/src/react/core/media/tus.js.map +1 -0
- package/dist/src/react/core/presentation/phrasing.d.ts +25 -0
- package/dist/src/react/core/presentation/phrasing.d.ts.map +1 -0
- package/dist/src/react/core/presentation/phrasing.js +58 -0
- package/dist/src/react/core/presentation/phrasing.js.map +1 -0
- package/dist/src/react/core/presentation/result-view.d.ts +43 -0
- package/dist/src/react/core/presentation/result-view.d.ts.map +1 -0
- package/dist/src/react/core/presentation/result-view.js +90 -0
- package/dist/src/react/core/presentation/result-view.js.map +1 -0
- package/dist/src/react/core/presentation/tool-activity.d.ts +106 -0
- package/dist/src/react/core/presentation/tool-activity.d.ts.map +1 -0
- package/dist/src/react/core/presentation/tool-activity.js +165 -0
- package/dist/src/react/core/presentation/tool-activity.js.map +1 -0
- package/dist/src/react/core/presentation/use-tool-catalog.d.ts +39 -0
- package/dist/src/react/core/presentation/use-tool-catalog.d.ts.map +1 -0
- package/dist/src/react/core/presentation/use-tool-catalog.js +77 -0
- package/dist/src/react/core/presentation/use-tool-catalog.js.map +1 -0
- package/dist/src/react/core/provider.d.ts +68 -0
- package/dist/src/react/core/provider.d.ts.map +1 -0
- package/dist/src/react/core/provider.js +61 -0
- package/dist/src/react/core/provider.js.map +1 -0
- package/dist/src/react/core/queue/model.d.ts +73 -0
- package/dist/src/react/core/queue/model.d.ts.map +1 -0
- package/dist/src/react/core/queue/model.js +2 -0
- package/dist/src/react/core/queue/model.js.map +1 -0
- package/dist/src/react/core/quota/use-quota.d.ts +35 -0
- package/dist/src/react/core/quota/use-quota.d.ts.map +1 -0
- package/dist/src/react/core/quota/use-quota.js +47 -0
- package/dist/src/react/core/quota/use-quota.js.map +1 -0
- package/dist/src/react/core/reasoning/timing.d.ts +38 -0
- package/dist/src/react/core/reasoning/timing.d.ts.map +1 -0
- package/dist/src/react/core/reasoning/timing.js +73 -0
- package/dist/src/react/core/reasoning/timing.js.map +1 -0
- package/dist/src/react/core/run-errors.d.ts +37 -0
- package/dist/src/react/core/run-errors.d.ts.map +1 -0
- package/dist/src/react/core/run-errors.js +37 -0
- package/dist/src/react/core/run-errors.js.map +1 -0
- package/dist/src/react/core/stored-message-to-ui-message.d.ts +4 -0
- package/dist/src/react/core/stored-message-to-ui-message.d.ts.map +1 -0
- package/dist/src/react/core/stored-message-to-ui-message.js +216 -0
- package/dist/src/react/core/stored-message-to-ui-message.js.map +1 -0
- package/dist/src/react/core/stored-thread-to-ui-messages.d.ts +82 -0
- package/dist/src/react/core/stored-thread-to-ui-messages.d.ts.map +1 -0
- package/dist/src/react/core/stored-thread-to-ui-messages.js +116 -0
- package/dist/src/react/core/stored-thread-to-ui-messages.js.map +1 -0
- package/dist/src/react/core/threads/threads-events.d.ts +22 -0
- package/dist/src/react/core/threads/threads-events.d.ts.map +1 -0
- package/dist/src/react/core/threads/threads-events.js +21 -0
- package/dist/src/react/core/threads/threads-events.js.map +1 -0
- package/dist/src/react/core/threads/use-threads.d.ts +31 -0
- package/dist/src/react/core/threads/use-threads.d.ts.map +1 -0
- package/dist/src/react/core/threads/use-threads.js +81 -0
- package/dist/src/react/core/threads/use-threads.js.map +1 -0
- package/dist/src/react/core/transcript/index.d.ts +4 -0
- package/dist/src/react/core/transcript/index.d.ts.map +1 -0
- package/dist/src/react/core/transcript/index.js +4 -0
- package/dist/src/react/core/transcript/index.js.map +1 -0
- package/dist/src/react/core/transcript/model.d.ts +399 -0
- package/dist/src/react/core/transcript/model.d.ts.map +1 -0
- package/dist/src/react/core/transcript/model.js +725 -0
- package/dist/src/react/core/transcript/model.js.map +1 -0
- package/dist/src/react/core/transcript/use-chat-transcript.d.ts +254 -0
- package/dist/src/react/core/transcript/use-chat-transcript.d.ts.map +1 -0
- package/dist/src/react/core/transcript/use-chat-transcript.js +572 -0
- package/dist/src/react/core/transcript/use-chat-transcript.js.map +1 -0
- package/dist/src/react/core/transcript/use-stick-to-bottom.d.ts +33 -0
- package/dist/src/react/core/transcript/use-stick-to-bottom.d.ts.map +1 -0
- package/dist/src/react/core/transcript/use-stick-to-bottom.js +48 -0
- package/dist/src/react/core/transcript/use-stick-to-bottom.js.map +1 -0
- package/dist/src/react/core/use-agent-chat.d.ts +341 -0
- package/dist/src/react/core/use-agent-chat.d.ts.map +1 -0
- package/dist/src/react/core/use-agent-chat.js +1118 -0
- package/dist/src/react/core/use-agent-chat.js.map +1 -0
- package/dist/src/react/genui/index.d.ts +1 -7
- package/dist/src/react/genui/index.d.ts.map +1 -1
- package/dist/src/react/genui/index.js +1 -7
- package/dist/src/react/genui/index.js.map +1 -1
- package/dist/src/react/genui/json-render.d.ts +1 -5
- package/dist/src/react/genui/json-render.d.ts.map +1 -1
- package/dist/src/react/genui/json-render.js +1 -5
- package/dist/src/react/genui/json-render.js.map +1 -1
- package/dist/src/react/genui/server.d.ts +2 -0
- package/dist/src/react/genui/server.d.ts.map +1 -0
- package/dist/src/react/genui/server.js +2 -0
- package/dist/src/react/genui/server.js.map +1 -0
- package/dist/src/react/genui/server_playwright.d.ts +2 -0
- package/dist/src/react/genui/server_playwright.d.ts.map +1 -0
- package/dist/src/react/genui/server_playwright.js +2 -0
- package/dist/src/react/genui/server_playwright.js.map +1 -0
- package/dist/src/react/index.d.ts +5 -7
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/react/index.js +5 -7
- package/dist/src/react/index.js.map +1 -1
- package/dist/src/react/markdown.d.ts +1 -6
- package/dist/src/react/markdown.d.ts.map +1 -1
- package/dist/src/react/markdown.js +1 -6
- package/dist/src/react/markdown.js.map +1 -1
- package/dist/src/react/media.d.ts +1 -17
- package/dist/src/react/media.d.ts.map +1 -1
- package/dist/src/react/media.js +1 -17
- package/dist/src/react/media.js.map +1 -1
- package/dist/src/refusal.d.ts +3 -0
- package/dist/src/refusal.d.ts.map +1 -0
- package/dist/src/refusal.js +3 -0
- package/dist/src/refusal.js.map +1 -0
- package/dist/src/spi/agent-runner.d.ts +6 -0
- package/dist/src/spi/agent-runner.d.ts.map +1 -1
- package/dist/src/spi/chat-queue.d.ts +4 -1
- package/dist/src/spi/chat-queue.d.ts.map +1 -1
- package/dist/src/spi/chat-queue.js.map +1 -1
- package/dist/src/spi/protocol-adapter.d.ts +3 -3
- package/dist/src/spi/roles-policy.d.ts +7 -0
- package/dist/src/spi/roles-policy.d.ts.map +1 -1
- package/dist/src/spi/tool.d.ts +18 -3
- package/dist/src/spi/tool.d.ts.map +1 -1
- package/dist/src/stores/lucid-schema.d.ts +24 -6
- package/dist/src/stores/lucid-schema.d.ts.map +1 -1
- package/dist/src/stores/lucid-schema.js +49 -6
- package/dist/src/stores/lucid-schema.js.map +1 -1
- package/dist/src/stores/lucid.d.ts +2 -0
- package/dist/src/stores/lucid.d.ts.map +1 -1
- package/dist/src/stores/lucid.js +7 -0
- package/dist/src/stores/lucid.js.map +1 -1
- package/dist/src/testing/chat-queue-store-contract.d.ts.map +1 -1
- package/dist/src/testing/chat-queue-store-contract.js +4 -0
- package/dist/src/testing/chat-queue-store-contract.js.map +1 -1
- package/dist/src/testing/in-memory-store.d.ts.map +1 -1
- package/dist/src/testing/in-memory-store.js +1 -0
- package/dist/src/testing/in-memory-store.js.map +1 -1
- package/dist/src/tool-discovery.d.ts +1 -1
- package/dist/src/tool-discovery.d.ts.map +1 -1
- package/dist/src/tool-discovery.js +5 -1
- package/dist/src/tool-discovery.js.map +1 -1
- package/dist/src/tool-registry.d.ts +3 -0
- package/dist/src/tool-registry.d.ts.map +1 -1
- package/dist/src/tool-registry.js +15 -3
- package/dist/src/tool-registry.js.map +1 -1
- package/dist/src/tool-result-presentation.d.ts +12 -0
- package/dist/src/tool-result-presentation.d.ts.map +1 -0
- package/dist/src/tool-result-presentation.js +44 -0
- package/dist/src/tool-result-presentation.js.map +1 -0
- package/dist/src/types.d.ts +20 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/ui-capabilities.d.ts +1 -8
- package/dist/src/ui-capabilities.d.ts.map +1 -1
- package/dist/src/ui-capabilities.js +3 -24
- package/dist/src/ui-capabilities.js.map +1 -1
- package/package.json +128 -22
- package/skills/agent-governance/SKILL.md +12 -4
- package/skills/agent-personas-agents/SKILL.md +2 -1
- package/skills/agent-setup/SKILL.md +73 -14
- package/skills/agent-testing/SKILL.md +22 -0
- package/skills/agent-tools/SKILL.md +57 -9
- package/dist/src/ag-ui/proposal-decision.d.ts.map +0 -1
- package/dist/src/ag-ui/proposal-decision.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-capabilities.d.ts","sourceRoot":"","sources":["../../src/ui-capabilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui-capabilities.d.ts","sourceRoot":"","sources":["../../src/ui-capabilities.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.keys(value).some((key) => key !== 'components') ||
|
|
5
|
-
!Array.isArray(value.components))
|
|
6
|
-
throw new TypeError('Invalid UI capabilities');
|
|
7
|
-
const seen = new Set();
|
|
8
|
-
const components = value.components.map((component) => {
|
|
9
|
-
if (!record(component) ||
|
|
10
|
-
Object.keys(component).some((key) => key !== 'name' && key !== 'version') ||
|
|
11
|
-
typeof component.name !== 'string' ||
|
|
12
|
-
!COMPONENT_NAME.test(component.name) ||
|
|
13
|
-
!Number.isSafeInteger(component.version) ||
|
|
14
|
-
Number(component.version) <= 0 ||
|
|
15
|
-
seen.has(component.name))
|
|
16
|
-
throw new TypeError('Invalid UI component capability');
|
|
17
|
-
seen.add(component.name);
|
|
18
|
-
return { name: component.name, version: Number(component.version) };
|
|
19
|
-
});
|
|
20
|
-
return { components };
|
|
21
|
-
}
|
|
22
|
-
function record(value) {
|
|
23
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
24
|
-
}
|
|
1
|
+
// Defined with the rest of generative UI (which must stay import-free for browsers) and re-exported
|
|
2
|
+
// here, so the root entry keeps exporting it.
|
|
3
|
+
export { validateUiCapabilities } from './genui/capabilities.js';
|
|
25
4
|
//# sourceMappingURL=ui-capabilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-capabilities.js","sourceRoot":"","sources":["../../src/ui-capabilities.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ui-capabilities.js","sourceRoot":"","sources":["../../src/ui-capabilities.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,8CAA8C;AAC9C,OAAO,EAAuB,sBAAsB,EAAE,MAAM,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonis-agora/agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.63.0",
|
|
4
4
|
"description": "Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"ai-sdk",
|
|
24
24
|
"durable",
|
|
25
25
|
"tanstack-intent",
|
|
26
|
+
"opencode",
|
|
26
27
|
"agora",
|
|
27
28
|
"guardrails"
|
|
28
29
|
],
|
|
@@ -41,6 +42,21 @@
|
|
|
41
42
|
"import": "./dist/src/ai-sdk/index.js",
|
|
42
43
|
"default": "./dist/src/ai-sdk/index.js"
|
|
43
44
|
},
|
|
45
|
+
"./a2a": {
|
|
46
|
+
"types": "./dist/src/a2a/index.d.ts",
|
|
47
|
+
"import": "./dist/src/a2a/index.js",
|
|
48
|
+
"default": "./dist/src/a2a/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./a2a_provider": {
|
|
51
|
+
"types": "./dist/providers/a2a_provider.d.ts",
|
|
52
|
+
"import": "./dist/providers/a2a_provider.js",
|
|
53
|
+
"default": "./dist/providers/a2a_provider.js"
|
|
54
|
+
},
|
|
55
|
+
"./a2a/server_middleware": {
|
|
56
|
+
"types": "./dist/src/a2a/server_middleware.d.ts",
|
|
57
|
+
"import": "./dist/src/a2a/server_middleware.js",
|
|
58
|
+
"default": "./dist/src/a2a/server_middleware.js"
|
|
59
|
+
},
|
|
44
60
|
"./mcp": {
|
|
45
61
|
"types": "./dist/src/mcp/index.d.ts",
|
|
46
62
|
"import": "./dist/src/mcp/index.js",
|
|
@@ -71,11 +87,26 @@
|
|
|
71
87
|
"import": "./dist/src/ag-ui/index.js",
|
|
72
88
|
"default": "./dist/src/ag-ui/index.js"
|
|
73
89
|
},
|
|
90
|
+
"./channels": {
|
|
91
|
+
"types": "./dist/src/channels/index.d.ts",
|
|
92
|
+
"import": "./dist/src/channels/index.js",
|
|
93
|
+
"default": "./dist/src/channels/index.js"
|
|
94
|
+
},
|
|
74
95
|
"./durable": {
|
|
75
96
|
"types": "./dist/src/durable/index.d.ts",
|
|
76
97
|
"import": "./dist/src/durable/index.js",
|
|
77
98
|
"default": "./dist/src/durable/index.js"
|
|
78
99
|
},
|
|
100
|
+
"./opencode": {
|
|
101
|
+
"types": "./dist/src/opencode/index.d.ts",
|
|
102
|
+
"import": "./dist/src/opencode/index.js",
|
|
103
|
+
"default": "./dist/src/opencode/index.js"
|
|
104
|
+
},
|
|
105
|
+
"./opencode/durable": {
|
|
106
|
+
"types": "./dist/src/opencode/durable/index.d.ts",
|
|
107
|
+
"import": "./dist/src/opencode/durable/index.js",
|
|
108
|
+
"default": "./dist/src/opencode/durable/index.js"
|
|
109
|
+
},
|
|
79
110
|
"./authz": {
|
|
80
111
|
"types": "./dist/src/authz/index.d.ts",
|
|
81
112
|
"import": "./dist/src/authz/index.js",
|
|
@@ -180,6 +211,16 @@
|
|
|
180
211
|
"types": "./dist/src/media/index.d.ts",
|
|
181
212
|
"import": "./dist/src/media/index.js",
|
|
182
213
|
"default": "./dist/src/media/index.js"
|
|
214
|
+
},
|
|
215
|
+
"./react/genui/server": {
|
|
216
|
+
"types": "./dist/src/react/genui/server.d.ts",
|
|
217
|
+
"import": "./dist/src/react/genui/server.js",
|
|
218
|
+
"default": "./dist/src/react/genui/server.js"
|
|
219
|
+
},
|
|
220
|
+
"./react/genui/server/playwright": {
|
|
221
|
+
"types": "./dist/src/react/genui/server_playwright.d.ts",
|
|
222
|
+
"import": "./dist/src/react/genui/server_playwright.js",
|
|
223
|
+
"default": "./dist/src/react/genui/server_playwright.js"
|
|
183
224
|
}
|
|
184
225
|
},
|
|
185
226
|
"files": [
|
|
@@ -197,21 +238,34 @@
|
|
|
197
238
|
"peerDependencies": {
|
|
198
239
|
"@adonis-agora/authz": ">=0.4.2 <1.0.0",
|
|
199
240
|
"@adonis-agora/diagnostics": ">=0.1.0 <1.0.0",
|
|
200
|
-
"@adonis-agora/durable": ">=0.
|
|
241
|
+
"@adonis-agora/durable": ">=0.43.3 <1.0.0",
|
|
201
242
|
"@adonis-agora/media": ">=0.18.0 <1.0.0",
|
|
202
243
|
"@adonis-agora/telescope": ">=0.4.0 <1.0.0",
|
|
203
244
|
"@adonisjs/assembler": "^8.4.0",
|
|
204
245
|
"@adonisjs/core": "^7.3.0",
|
|
205
246
|
"@adonisjs/lucid": "^22.4.0",
|
|
206
247
|
"@adonisjs/redis": "^9.2.0 || ^10.0.0 || ^11.0.0",
|
|
207
|
-
"@dudousxd/nestjs-agent-core": ">=0.35.0 <1.0.0",
|
|
208
|
-
"@dudousxd/nestjs-agent-react": ">=0.30.0 <1.0.0",
|
|
209
|
-
"@dudousxd/nestjs-media-client": ">=0.3.0 <1.0.0",
|
|
210
248
|
"@qdrant/js-client-rest": "^1.11.0",
|
|
211
249
|
"ai": "^7.0.0",
|
|
212
250
|
"node-sql-parser": "^5.3.0",
|
|
213
251
|
"react": "^18.0.0 || ^19.0.0",
|
|
214
|
-
"zod": "^4.0.0"
|
|
252
|
+
"zod": "^4.0.0",
|
|
253
|
+
"@ai-sdk/react": "^4.0.0",
|
|
254
|
+
"@json-render/react": ">=0.21.0 <1.0.0",
|
|
255
|
+
"@streamdown/code": "^1.1.1",
|
|
256
|
+
"@streamdown/math": "^1.0.2",
|
|
257
|
+
"@streamdown/mermaid": "^1.0.2",
|
|
258
|
+
"katex": "^0.16.45",
|
|
259
|
+
"prism-react-renderer": "^2.4.1",
|
|
260
|
+
"react-dom": ">=18",
|
|
261
|
+
"react-markdown": "^10.1.0",
|
|
262
|
+
"rehype-katex": "^7.0.1",
|
|
263
|
+
"rehype-sanitize": "^6.0.0",
|
|
264
|
+
"remark-gfm": "^4.0.1",
|
|
265
|
+
"remark-math": "^6.0.0",
|
|
266
|
+
"streamdown": "^2.5.0",
|
|
267
|
+
"unist-util-visit": "^5.1.0",
|
|
268
|
+
"playwright-core": ">=1.48 <2"
|
|
215
269
|
},
|
|
216
270
|
"peerDependenciesMeta": {
|
|
217
271
|
"react": {
|
|
@@ -253,23 +307,62 @@
|
|
|
253
307
|
"zod": {
|
|
254
308
|
"optional": true
|
|
255
309
|
},
|
|
256
|
-
"@
|
|
310
|
+
"@adonis-agora/media": {
|
|
311
|
+
"optional": true
|
|
312
|
+
},
|
|
313
|
+
"@ai-sdk/react": {
|
|
257
314
|
"optional": true
|
|
258
315
|
},
|
|
259
|
-
"@
|
|
316
|
+
"@json-render/react": {
|
|
260
317
|
"optional": true
|
|
261
318
|
},
|
|
262
|
-
"@
|
|
319
|
+
"@streamdown/code": {
|
|
263
320
|
"optional": true
|
|
264
321
|
},
|
|
265
|
-
"@
|
|
322
|
+
"@streamdown/math": {
|
|
323
|
+
"optional": true
|
|
324
|
+
},
|
|
325
|
+
"@streamdown/mermaid": {
|
|
326
|
+
"optional": true
|
|
327
|
+
},
|
|
328
|
+
"katex": {
|
|
329
|
+
"optional": true
|
|
330
|
+
},
|
|
331
|
+
"prism-react-renderer": {
|
|
332
|
+
"optional": true
|
|
333
|
+
},
|
|
334
|
+
"react-dom": {
|
|
335
|
+
"optional": true
|
|
336
|
+
},
|
|
337
|
+
"react-markdown": {
|
|
338
|
+
"optional": true
|
|
339
|
+
},
|
|
340
|
+
"rehype-katex": {
|
|
341
|
+
"optional": true
|
|
342
|
+
},
|
|
343
|
+
"rehype-sanitize": {
|
|
344
|
+
"optional": true
|
|
345
|
+
},
|
|
346
|
+
"remark-gfm": {
|
|
347
|
+
"optional": true
|
|
348
|
+
},
|
|
349
|
+
"remark-math": {
|
|
350
|
+
"optional": true
|
|
351
|
+
},
|
|
352
|
+
"streamdown": {
|
|
353
|
+
"optional": true
|
|
354
|
+
},
|
|
355
|
+
"unist-util-visit": {
|
|
356
|
+
"optional": true
|
|
357
|
+
},
|
|
358
|
+
"playwright-core": {
|
|
266
359
|
"optional": true
|
|
267
360
|
}
|
|
268
361
|
},
|
|
269
362
|
"devDependencies": {
|
|
270
|
-
"@adonis-agora/authz": "0.
|
|
363
|
+
"@adonis-agora/authz": "0.18.0",
|
|
271
364
|
"@adonis-agora/diagnostics": "0.2.10",
|
|
272
|
-
"@adonis-agora/durable": "0.43.
|
|
365
|
+
"@adonis-agora/durable": "0.43.3",
|
|
273
366
|
"@adonis-agora/telescope": "0.21.1",
|
|
274
367
|
"@adonisjs/assembler": "8.5.2",
|
|
275
368
|
"@adonisjs/core": "7.5.2",
|
|
@@ -278,37 +371,50 @@
|
|
|
278
371
|
"@ag-ui/client": "1.0.1",
|
|
279
372
|
"@ag-ui/core": "1.0.1",
|
|
280
373
|
"@ai-sdk/react": "^4.0.125",
|
|
281
|
-
"@
|
|
282
|
-
"@dudousxd/nestjs-agent-react": "0.31.0",
|
|
283
|
-
"@dudousxd/nestjs-media-client": "0.3.0",
|
|
374
|
+
"@opencode/client": "2.0.18",
|
|
284
375
|
"@qdrant/js-client-rest": "1.19.0",
|
|
285
|
-
"@tanstack/intent": "0.
|
|
376
|
+
"@tanstack/intent": "0.5.0",
|
|
286
377
|
"@testcontainers/mysql": "12.2.0",
|
|
287
378
|
"@testcontainers/postgresql": "12.2.0",
|
|
288
379
|
"@testing-library/dom": "10.4.2",
|
|
289
380
|
"@testing-library/react": "16.3.3",
|
|
290
|
-
"@types/node": "26.6.
|
|
381
|
+
"@types/node": "26.6.4",
|
|
291
382
|
"@types/pg": "8.23.1",
|
|
292
383
|
"@types/react": "19.3.0",
|
|
293
384
|
"@types/react-dom": "19.3.0",
|
|
294
385
|
"agent-0-56": "npm:@adonis-agora/agent@0.56.0",
|
|
295
386
|
"agent-0-58": "npm:@adonis-agora/agent@0.58.0",
|
|
296
387
|
"agent-0-59": "npm:@adonis-agora/agent@0.59.0",
|
|
297
|
-
"ai": "7.0.
|
|
388
|
+
"ai": "7.0.122",
|
|
298
389
|
"ajv": "^8.20.0",
|
|
299
390
|
"better-sqlite3": "13.0.3",
|
|
300
391
|
"jsdom": "30.1.1",
|
|
301
392
|
"luxon": "3.7.2",
|
|
302
|
-
"mysql2": "3.24.
|
|
393
|
+
"mysql2": "3.24.5",
|
|
303
394
|
"node-sql-parser": "5.4.0",
|
|
304
|
-
"pg": "8.23.
|
|
395
|
+
"pg": "8.23.1",
|
|
305
396
|
"react": "19.3.0",
|
|
306
397
|
"react-dom": "19.3.0",
|
|
307
398
|
"rxjs": "^7.8.1",
|
|
308
399
|
"testcontainers": "12.2.0",
|
|
309
400
|
"typescript": "7.0.2",
|
|
310
|
-
"vitest": "5.0.
|
|
311
|
-
"zod": "4.6.5"
|
|
401
|
+
"vitest": "5.0.3",
|
|
402
|
+
"zod": "4.6.5",
|
|
403
|
+
"@json-render/core": "0.21.0",
|
|
404
|
+
"@json-render/react": "0.21.0",
|
|
405
|
+
"@streamdown/code": "1.1.1",
|
|
406
|
+
"@streamdown/math": "1.0.3",
|
|
407
|
+
"@streamdown/mermaid": "1.0.3",
|
|
408
|
+
"katex": "0.16.45",
|
|
409
|
+
"playwright-core": "^1.63.0",
|
|
410
|
+
"prism-react-renderer": "2.4.1",
|
|
411
|
+
"react-markdown": "10.1.0",
|
|
412
|
+
"rehype-katex": "7.0.1",
|
|
413
|
+
"rehype-sanitize": "6.0.0",
|
|
414
|
+
"remark-gfm": "4.0.1",
|
|
415
|
+
"remark-math": "6.0.0",
|
|
416
|
+
"streamdown": "2.6.0",
|
|
417
|
+
"unist-util-visit": "5.1.0"
|
|
312
418
|
},
|
|
313
419
|
"engines": {
|
|
314
420
|
"node": ">=20.6.0"
|
|
@@ -74,12 +74,20 @@ export default defineConfig({
|
|
|
74
74
|
})
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
Because the offered-tools filter
|
|
78
|
-
`can
|
|
79
|
-
disagree
|
|
77
|
+
Because the offered-tools filter calls `canOffer(actor, tool)` when the policy defines
|
|
78
|
+
it (else `can`) and the invoke-time re-check always calls `can(actor, tool)`, swapping
|
|
79
|
+
the policy changes both layers together — they disagree only when a policy defines
|
|
80
|
+
`canOffer` to offer what it will not run (A2A step-up).
|
|
81
|
+
|
|
82
|
+
The provider wraps whatever policy you configure with `personalAgentGate`: an actor with
|
|
83
|
+
the `personal_agent` role (A2A personal agents) reaches only tools that declare one of its
|
|
84
|
+
roles — a tool with no `roles` is out of its reach even when open by default — and its
|
|
85
|
+
memory and skill scopes resolve to none. Nothing changes for any other actor.
|
|
80
86
|
|
|
81
87
|
Source: `packages/adonis/docs/governance/authorization.mdx` ("Ability-aware
|
|
82
|
-
authorization"), `packages/adonis/src/authorizer.ts
|
|
88
|
+
authorization"), `packages/adonis/src/authorizer.ts`,
|
|
89
|
+
`packages/adonis/src/a2a/gate.ts` (`personalAgentGate`, `personalAgentScopes`),
|
|
90
|
+
`packages/adonis/docs/a2a.mdx` ("What a personal agent can reach").
|
|
83
91
|
|
|
84
92
|
### Pattern 2 — mount the governance read-model with `governanceAuthorize`
|
|
85
93
|
|
|
@@ -175,7 +175,8 @@ delegatesTo: [{ agent: 'researcher', roles: ['ANALYST', 'ADMIN'] }]
|
|
|
175
175
|
|
|
176
176
|
Mechanism: a delegate tool goes through the SAME gate as every other tool. A bare string
|
|
177
177
|
carries nothing, so under `DefaultToolAuthorizer` it takes `defaultRoles` (open unless
|
|
178
|
-
configured
|
|
178
|
+
configured — except for A2A personal agents, which reach only tools that declare one of
|
|
179
|
+
their roles), and under the authz Bouncer adapter a spec without `ability` is denied
|
|
179
180
|
outright — the edge becomes uncalled for everyone.
|
|
180
181
|
Source: `packages/adonis/docs/authoring/personas-and-agents.mdx` ("Authorizing a
|
|
181
182
|
delegation"), `packages/adonis/src/types.ts` (`DelegateEdge`).
|
|
@@ -21,14 +21,17 @@ sources:
|
|
|
21
21
|
- "DavideCarvalho/adonis-agent:packages/adonis/src/stores/factory.ts"
|
|
22
22
|
- "DavideCarvalho/adonis-agent:packages/adonis/docs/react.mdx"
|
|
23
23
|
- "DavideCarvalho/adonis-agent:packages/adonis/src/react/index.ts"
|
|
24
|
+
- "DavideCarvalho/adonis-agent:packages/adonis/docs/channels.mdx"
|
|
24
25
|
---
|
|
25
26
|
|
|
26
27
|
# Setting up @adonis-agora/agent
|
|
27
28
|
|
|
28
29
|
`@adonis-agora/agent` is a governed AI agent module for AdonisJS: one `defineConfig`
|
|
29
|
-
call in `config/agent.ts` wires a provider-agnostic agent loop
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
call in `config/agent.ts` wires a provider-agnostic agent (the loop by default, or an
|
|
31
|
+
`engine` that runs turns instead), persistence, budgeting,
|
|
32
|
+
and the `/agent/*` HTTP+SSE routes. Either `model` (the loop runs the turns) or
|
|
33
|
+
`engine` (something else does) is required — everything else ships with a default that
|
|
34
|
+
this skill walks through.
|
|
32
35
|
|
|
33
36
|
## Setup
|
|
34
37
|
|
|
@@ -42,8 +45,9 @@ node ace configure @adonis-agora/agent
|
|
|
42
45
|
`configure` registers `@adonis-agora/agent/agent_provider` and
|
|
43
46
|
`@adonis-agora/agent/dashboard_provider` in `adonisrc.ts`, registers the Assembler init
|
|
44
47
|
hook that generates the typed `app/agent_tools` barrel, publishes `config/agent.ts`,
|
|
45
|
-
`config/mcp.ts`, and
|
|
46
|
-
|
|
48
|
+
`config/mcp.ts`, and five migrations: three for the agent tables (the base tables plus two
|
|
49
|
+
forward-only action-proposal upgrades) and two Postgres-only ones (the pgvector RAG chunk
|
|
50
|
+
table and the document-tree tables — delete the ones you don't use). Then add the model peer and write your config:
|
|
47
51
|
|
|
48
52
|
```bash
|
|
49
53
|
pnpm add ai zod @ai-sdk/openai
|
|
@@ -75,9 +79,10 @@ export default defineConfig({
|
|
|
75
79
|
})
|
|
76
80
|
```
|
|
77
81
|
|
|
78
|
-
Run the
|
|
79
|
-
`
|
|
80
|
-
|
|
82
|
+
Run the published migrations for the agent tables (`agent_action_proposal`,
|
|
83
|
+
`agent_thread`, `agent_message`, `agent_tool_call`, `agent_token_usage`,
|
|
84
|
+
`agent_model_pricing`, `agent_run`, `agent_queued_message`, `agent_confirm_token`, plus the
|
|
85
|
+
`agent_stream_frame` buffer and the text channels' `agent_channel_state`):
|
|
81
86
|
|
|
82
87
|
```bash
|
|
83
88
|
node ace migration:run
|
|
@@ -85,8 +90,8 @@ node ace migration:run
|
|
|
85
90
|
|
|
86
91
|
You can skip it: the Lucid store provisions and repairs its own tables as the app starts
|
|
87
92
|
(`autoCreateTables` defaults to true; an ace command or a hand-built store does it on first
|
|
88
|
-
use), so an upgrade that adds a column needs no app migration. The published
|
|
89
|
-
|
|
93
|
+
use), so an upgrade that adds a column needs no app migration. The published migrations
|
|
94
|
+
delegate to the same `createAgentTables` helper, so the two schemas can never drift.
|
|
90
95
|
Only with `autoCreateTables: false` does an upgrade need a migration that calls
|
|
91
96
|
`createAgentTables` again.
|
|
92
97
|
|
|
@@ -179,6 +184,7 @@ export default defineConfig({
|
|
|
179
184
|
|
|
180
185
|
Requires `@adonisjs/redis` installed and configured unless you pass `client:` (a
|
|
181
186
|
bring-your-own `RedisStreamClient`). Pair with `durable: true` for cross-instance resume.
|
|
187
|
+
Under an `engine`, `durable: true` is refused at boot unless the engine is durable itself.
|
|
182
188
|
|
|
183
189
|
No Redis? `tokenSinks.lucid()` keeps the frames in the app's SQL database instead
|
|
184
190
|
(table `agent_stream_frame`, created with the other agent tables). Subscribers poll
|
|
@@ -206,9 +212,9 @@ Source: `packages/adonis/src/stores/factory.ts` (`tokenSinks`),
|
|
|
206
212
|
|
|
207
213
|
### Pattern 4 — a React chat with `@adonis-agora/agent/react`
|
|
208
214
|
|
|
209
|
-
|
|
210
|
-
`@ai-sdk/react` and `ai`
|
|
211
|
-
shield's CSRF token. No
|
|
215
|
+
Agora owns the React layer inside `@adonis-agora/agent/react`. Install the optional
|
|
216
|
+
`react`, `@ai-sdk/react` and `ai` peers for this entry. `AgentProvider` already sends the
|
|
217
|
+
session cookie and shield's CSRF token. No Aviary package or release is required:
|
|
212
218
|
|
|
213
219
|
```tsx
|
|
214
220
|
import { AgentProvider, useAgentChat } from '@adonis-agora/agent/react'
|
|
@@ -260,13 +266,66 @@ token sink any replica serves the resume. The native stream is unchanged.
|
|
|
260
266
|
|
|
261
267
|
Source: `packages/adonis/docs/ag-ui.mdx`, `packages/adonis/src/ag-ui/`.
|
|
262
268
|
|
|
269
|
+
### Pattern 6 — answer on WhatsApp / Telegram with `channels.handle()`
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
// start/routes.ts
|
|
273
|
+
import { channels, evolutionApi } from '@adonis-agora/agent/channels'
|
|
274
|
+
|
|
275
|
+
router.post(
|
|
276
|
+
'/webhooks/whatsapp',
|
|
277
|
+
channels.handle(
|
|
278
|
+
evolutionApi({ url, instance, apiKey, webhookToken }), // or whatsappCloud({…}) / telegram({…})
|
|
279
|
+
{
|
|
280
|
+
actor: (message) => actorForPhone(message.from), // null → not answered
|
|
281
|
+
thread: (actor, message) => threadFor(message.conversation), // null → new thread
|
|
282
|
+
onThreadCreated: (threadId, actor, message) => saveThread(message.conversation, threadId),
|
|
283
|
+
},
|
|
284
|
+
),
|
|
285
|
+
)
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
The handler verifies the webhook (token / HMAC / secret header), dedupes by provider message id,
|
|
289
|
+
answers `200` at once and runs the turn in the background (`await handler.drain()` in tests).
|
|
290
|
+
Replies are text-only (components → `fallbackText`), converted to the channel's markdown and split
|
|
291
|
+
at its length limit. Media is downloaded and attached when `attachments` is configured (else the
|
|
292
|
+
person is told why not). `ask` questions go out as numbered text, one at a time; the next messages
|
|
293
|
+
answer them. State (message ids, questions in progress, relayed outcomes) lives in
|
|
294
|
+
`agent_channel_state` via `lucidChannelStore()` when the agent store is Lucid, else memory —
|
|
295
|
+
`store: redisChannelStore(redis)` otherwise on several replicas. Use
|
|
296
|
+
`actionApprovalMode: 'independent'`: pending proposals go out as Confirm/Cancel buttons (or a text
|
|
297
|
+
instruction in the `actionProposalText` vocabulary), and `actionProposalWorker: { onSettled:
|
|
298
|
+
channels.onSettled }` relays outcomes that settle later. In blocking mode the channel can only say
|
|
299
|
+
the approval must happen in the app. Exclude webhook routes from Shield's CSRF check.
|
|
300
|
+
|
|
301
|
+
Source: `packages/adonis/docs/channels.mdx`, `packages/adonis/src/channels/`.
|
|
302
|
+
|
|
303
|
+
## Component rendering entries
|
|
304
|
+
|
|
305
|
+
Agora owns its catalog (`@adonis-agora/agent/genui`), browser rendering
|
|
306
|
+
(`@adonis-agora/agent/react/genui`), AG-UI adapters and resumable upload client
|
|
307
|
+
(`@adonis-agora/agent/react/media`). Protocol compatibility does not require installing
|
|
308
|
+
Aviary packages.
|
|
309
|
+
|
|
310
|
+
For static HTML, use `createReactComponentRegistry` and `createReactServerRenderer` from
|
|
311
|
+
`@adonis-agora/agent/react/genui/server`; install matching `react` and `react-dom` peers.
|
|
312
|
+
Keep this server entry out of browser bundles: it reads trusted filesystem stylesheets
|
|
313
|
+
and imports ReactDOM's server renderer. HTML does not require a browser or AI SDK.
|
|
314
|
+
PNG/PDF output takes a capture adapter; the optional Playwright implementation lives at
|
|
315
|
+
`@adonis-agora/agent/react/genui/server/playwright` and needs `playwright-core`. A supplied
|
|
316
|
+
browser remains caller-owned. Binary captures are attachments, not durable UI-frame props.
|
|
317
|
+
|
|
318
|
+
Source: `packages/adonis/docs/authoring/component-rendering.mdx`,
|
|
319
|
+
`packages/adonis/docs/react.mdx`.
|
|
320
|
+
|
|
263
321
|
## Common mistakes
|
|
264
322
|
|
|
265
323
|
### MEDIUM — restating history to the AG-UI route and expecting it to be read
|
|
266
324
|
|
|
267
325
|
The route answers the LAST user message of `messages`; the thread's history is the one the server
|
|
268
326
|
stored under `threadId`. Media parts must be inline (`source.type: 'data'`) and need
|
|
269
|
-
`attachments:` configured — a `url` or `file` source is dropped with an `agora.warning`.
|
|
327
|
+
`attachments:` configured — a `url` or a `file` source from another provider is dropped with an `agora.warning`.
|
|
328
|
+
A `file` handle with `provider: 'agora'` naming an upload this agent staged is resolved for the caller instead.
|
|
270
329
|
|
|
271
330
|
Source: `packages/adonis/docs/ag-ui.mdx`.
|
|
272
331
|
|
|
@@ -167,6 +167,28 @@ for await (const frame of sink.subscribe(runId)) {
|
|
|
167
167
|
Source: `packages/adonis/docs/testing.mdx` ("Because the fakes are behavioral twins"
|
|
168
168
|
note), `packages/adonis/src/in-process-sink.ts`.
|
|
169
169
|
|
|
170
|
+
### Pattern 4 — verify presentation, replay and optional rendering locally
|
|
171
|
+
|
|
172
|
+
Use Agora's own entries in tests; do not install or alias Aviary packages. Exercise
|
|
173
|
+
class presentation through discovery, and functional presentation through `defineTool`
|
|
174
|
+
and `ToolRegistry.invoke`. Verify unchanged domain output, authorization and denied
|
|
175
|
+
preflight, completed preflight without execution, ordered emissions, and a throwing
|
|
176
|
+
`present`/sink/reporter without repeating the domain write. A loop test should replay
|
|
177
|
+
its journaled tool result and assert that presentation is not emitted or persisted twice.
|
|
178
|
+
|
|
179
|
+
Test custom schema transformations with distinct `props` and `outputProps` through
|
|
180
|
+
static and request-resolved component/show/tree tools; normalized props must remain
|
|
181
|
+
unchanged in rendering and persisted history. For SSR, import
|
|
182
|
+
`@adonis-agora/agent/react/genui/server`, provide trusted CSS/theme, and use a fake capture
|
|
183
|
+
adapter to inspect every paginated row and escaped HTML without a browser. Real
|
|
184
|
+
PNG/PDF tests can use the optional Playwright entry and a host Chromium executable;
|
|
185
|
+
assert byte signatures and page/context cleanup while retaining the supplied browser.
|
|
186
|
+
Keep binary captures out of persisted component frames.
|
|
187
|
+
|
|
188
|
+
Source: `packages/adonis/test/tool-present.spec.ts`,
|
|
189
|
+
`packages/adonis/test/emit-ui.spec.ts`, `packages/adonis/test/react-server.spec.ts`,
|
|
190
|
+
`packages/adonis/test/react-playwright.browser.spec.ts`.
|
|
191
|
+
|
|
170
192
|
## Common mistakes
|
|
171
193
|
|
|
172
194
|
### MEDIUM — keeping mutable state in a FakeModelProvider script
|
|
@@ -59,7 +59,8 @@ export default class GetWeather extends ReadTool<Input, { tempC: number }> {
|
|
|
59
59
|
}
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Prefer a function? `defineTool(
|
|
62
|
+
Prefer a function? `defineTool({ name, input, execute, present, ... })` or the existing
|
|
63
|
+
`defineTool(options, execute)` returns a branded `{ spec, handler }`
|
|
63
64
|
discovery picks up identically — or pass it straight to `defineConfig({ tools: [...] })`.
|
|
64
65
|
|
|
65
66
|
## Core patterns
|
|
@@ -109,8 +110,9 @@ An action's write and the checkpoint that records it are two writes: a worker th
|
|
|
109
110
|
them re-runs the tool on recovery. Pass `ctx.idempotencyKey` (`<runId>:<toolCallId>`, the same for
|
|
110
111
|
every execution of one call) on as the downstream idempotency key — a provider's
|
|
111
112
|
`Idempotency-Key`, a unique column on the inserted row, the `id` of a workflow the tool starts — so
|
|
112
|
-
the second attempt lands on the first.
|
|
113
|
-
`
|
|
113
|
+
the second attempt lands on the first. Over MCP the server mints one per `tools/call`
|
|
114
|
+
(alongside `toolCallId` and `pageContext: { channel: 'mcp' }`). It is absent on a direct
|
|
115
|
+
`registry.invoke`, so fall back to a key of your own there.
|
|
114
116
|
|
|
115
117
|
Source: `packages/adonis/src/spi/tool.ts` (`AiToolCtx.idempotencyKey`).
|
|
116
118
|
|
|
@@ -177,10 +179,12 @@ Source: `packages/adonis/docs/authoring/tools.mdx` ("Configuring the generator")
|
|
|
177
179
|
|
|
178
180
|
### Pattern 4 — a write reachable over MCP: `defineConfirmedTool`
|
|
179
181
|
|
|
180
|
-
An `action`
|
|
182
|
+
An `action` is off the MCP surface by default (`actions: 'refuse'` in `config/mcp.ts` —
|
|
183
|
+
neither listed nor callable, since there is no approval channel, and Claude.ai/Desktop have no
|
|
181
184
|
elicitation). For a write that must be callable there, put the gate inside the tool: the
|
|
182
185
|
first call previews and returns a signed `confirmToken`; the same arguments plus
|
|
183
|
-
`confirm: true` and the token commit.
|
|
186
|
+
`confirm: true` and the token commit. (`actions: 'execute'` opts out and runs actions when
|
|
187
|
+
called — the MCP client's own confirmation stands in for the loop's approval gate.)
|
|
184
188
|
|
|
185
189
|
```ts
|
|
186
190
|
import { defineConfirmedTool, LucidConfirmTokenStore } from '@adonis-agora/agent'
|
|
@@ -209,6 +213,47 @@ arguments and expires (`ttlMs`, default 15 min).
|
|
|
209
213
|
Source: `packages/adonis/docs/mcp.mdx` ("Writes with a human gate"),
|
|
210
214
|
`packages/adonis/src/confirmed-tool.ts`.
|
|
211
215
|
|
|
216
|
+
### Pattern 5 — present a domain result through the component catalog
|
|
217
|
+
|
|
218
|
+
Keep `execute` returning domain data. An optional `present(output, ctx)` on a class or
|
|
219
|
+
functional handler returns one component presentation, an array, or `undefined`. The
|
|
220
|
+
registry emits presentations through `ctx.emitUi` and preserves the domain result for
|
|
221
|
+
REST/MCP callers. Denied or failed execution does not present; presentation errors do
|
|
222
|
+
not retry a successful write. Methods keep their receiver, including injected services.
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
import { defineTool } from '@adonis-agora/agent'
|
|
226
|
+
import { table } from '@adonis-agora/agent/genui'
|
|
227
|
+
import { z } from 'zod'
|
|
228
|
+
|
|
229
|
+
export const listRecords = defineTool({
|
|
230
|
+
name: 'list_records',
|
|
231
|
+
description: 'List records visible to the current actor.',
|
|
232
|
+
input: z.object({ limit: z.number().int().min(1).max(100) }),
|
|
233
|
+
execute: async ({ limit }, ctx) => recordsFor(ctx.actor, limit),
|
|
234
|
+
present: async (records) => table({
|
|
235
|
+
columns: [{ key: 'name', label: 'Name' }],
|
|
236
|
+
rows: records,
|
|
237
|
+
}),
|
|
238
|
+
})
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
`table` and `chart` present the builtin `DataTable` and `Chart` definitions: put them in the
|
|
242
|
+
genui catalog (`BUILTIN_COMPONENTS` from `@adonis-agora/agent/genui/builtins`, or the two
|
|
243
|
+
definitions) and register app renderers under those names. Builtins carry no visuals.
|
|
244
|
+
Use `createComponent` for custom definitions and one `createComponentRegistry` per app
|
|
245
|
+
or tenant. Input `props` may transform; if the transform changes shape or is not
|
|
246
|
+
idempotent, declare `outputProps` to validate the normalized JSON persisted in frames.
|
|
247
|
+
Do not send renderer functions or image/PDF bytes as props. Set `onPresentationError(error,
|
|
248
|
+
{ toolName, toolCallId, runId, threadId })` in `defineConfig` — it is wired for turns
|
|
249
|
+
and proposal executions (the loop/executor fill in the call, run and thread); omit it
|
|
250
|
+
and the provider logs a warning on the app logger. Inside a tool,
|
|
251
|
+
`ctx.onPresentationError` carries the same details. SSR and capture use optional server entries,
|
|
252
|
+
separate from tool execution and browser chat hooks.
|
|
253
|
+
|
|
254
|
+
Source: `packages/adonis/docs/authoring/component-rendering.mdx`,
|
|
255
|
+
`packages/adonis/src/spi/tool.ts`, `packages/adonis/src/tool-result-presentation.ts`.
|
|
256
|
+
|
|
212
257
|
## Feature flags and per-user gates — `enabled`, `isEnabled()`, `canUse(actor)`
|
|
213
258
|
|
|
214
259
|
```ts
|
|
@@ -232,8 +277,8 @@ Source: `packages/adonis/docs/authoring/tools.mdx`, `packages/adonis/src/tool-fi
|
|
|
232
277
|
### CRITICAL — shipping a privileged tool without `roles`
|
|
233
278
|
|
|
234
279
|
```ts
|
|
235
|
-
// Wrong — no roles → inherits defaultRoles, which is [] (open) by default: every actor
|
|
236
|
-
// an anonymous visitor included, is offered this tool.
|
|
280
|
+
// Wrong — no roles → inherits defaultRoles, which is [] (open) by default: every actor
|
|
281
|
+
// except A2A personal agents, an anonymous visitor included, is offered this tool.
|
|
237
282
|
static tool = { name: 'refund_order', kind: 'action', description: '...', input }
|
|
238
283
|
```
|
|
239
284
|
|
|
@@ -245,10 +290,13 @@ static tool = { name: 'refund_order', kind: 'action', description: '...', input,
|
|
|
245
290
|
Mechanism: `definitionsFor` filters the offered tool list through the role gate BEFORE
|
|
246
291
|
each model turn, and `invoke` re-checks it. A tool with no `roles` takes `defaultRoles`;
|
|
247
292
|
an empty list is no restriction (since 0.46 — before, it denied everyone; `emptyRoles: 'deny'`
|
|
248
|
-
in the config, or `ClosedRolesPolicy`, keeps it closed)
|
|
293
|
+
in the config, or `ClosedRolesPolicy`, keeps it closed) — except for an actor with the
|
|
294
|
+
`personal_agent` role (A2A personal agents): it reaches only tools that declare one of its
|
|
295
|
+
roles, so a tool with no `roles` is out of its reach even when open by default. An `action` still parks on approval — but by default the
|
|
249
296
|
requester approves, so for a public chat that is only a confirmation.
|
|
250
297
|
Source: `packages/adonis/docs/governance/authorization.mdx`,
|
|
251
|
-
`packages/adonis/src/tool-registry.ts` (`DefaultRolesPolicy.can`)
|
|
298
|
+
`packages/adonis/src/tool-registry.ts` (`DefaultRolesPolicy.can`),
|
|
299
|
+
`packages/adonis/src/a2a/gate.ts` (`personalAgentGate`).
|
|
252
300
|
|
|
253
301
|
### HIGH — trusting an id from the model's arguments instead of `ctx.actor`
|
|
254
302
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proposal-decision.d.ts","sourceRoot":"","sources":["../../../src/ag-ui/proposal-decision.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE3F,qGAAqG;AACrG,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,OAAO,CAAC;CAC3B,GAAG,SAAS,EAAE,CAmBd"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proposal-decision.js","sourceRoot":"","sources":["../../../src/ag-ui/proposal-decision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAkB,MAAM,mCAAmC,CAAC;AAE3F,qGAAqG;AACrG,MAAM,UAAU,4BAA4B,CAAC,KAK5C;IACC,MAAM,SAAS,GAAG,GAAG,KAAK,CAAC,KAAK,oBAAoB,CAAC;IACrD,OAAO;QACL;YACE,IAAI,EAAE,aAAa;YACnB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,eAAe,EAAE,sBAAsB;SACxC;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,iCAAiC;YACvC,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE;SAC9E;QACD,EAAE,IAAI,EAAE,oBAAoB,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE;QAC5D,EAAE,IAAI,EAAE,sBAAsB,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;QAC9D,EAAE,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE;QACvC,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE;KACvE,CAAC;AACJ,CAAC"}
|