@adonis-agora/agent 0.60.1 → 0.62.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 +96 -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 +9 -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 +195 -11
- 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-approval.d.ts +26 -0
- package/dist/src/action-proposal-approval.d.ts.map +1 -0
- package/dist/src/action-proposal-approval.js +28 -0
- package/dist/src/action-proposal-approval.js.map +1 -0
- package/dist/src/action-proposal-discovery.d.ts +9 -0
- package/dist/src/action-proposal-discovery.d.ts.map +1 -0
- package/dist/src/action-proposal-discovery.js +20 -0
- package/dist/src/action-proposal-discovery.js.map +1 -0
- package/dist/src/action-proposal-executor.d.ts +40 -0
- package/dist/src/action-proposal-executor.d.ts.map +1 -0
- package/dist/src/action-proposal-executor.js +80 -0
- package/dist/src/action-proposal-executor.js.map +1 -0
- package/dist/src/action-proposal-outcome.d.ts +12 -0
- package/dist/src/action-proposal-outcome.d.ts.map +1 -0
- package/dist/src/action-proposal-outcome.js +86 -0
- package/dist/src/action-proposal-outcome.js.map +1 -0
- package/dist/src/action-proposal-preparation.d.ts +20 -0
- package/dist/src/action-proposal-preparation.d.ts.map +1 -0
- package/dist/src/action-proposal-preparation.js +27 -0
- package/dist/src/action-proposal-preparation.js.map +1 -0
- package/dist/src/action-proposal-receipt.d.ts +12 -0
- package/dist/src/action-proposal-receipt.d.ts.map +1 -0
- package/dist/src/action-proposal-receipt.js +4 -0
- package/dist/src/action-proposal-receipt.js.map +1 -0
- package/dist/src/action-proposal-runtime.d.ts +9 -0
- package/dist/src/action-proposal-runtime.d.ts.map +1 -0
- package/dist/src/action-proposal-runtime.js +34 -0
- package/dist/src/action-proposal-runtime.js.map +1 -0
- package/dist/src/action-proposal-service.d.ts +47 -0
- package/dist/src/action-proposal-service.d.ts.map +1 -0
- package/dist/src/action-proposal-service.js +136 -0
- package/dist/src/action-proposal-service.js.map +1 -0
- package/dist/src/action-proposal-text.d.ts +72 -0
- package/dist/src/action-proposal-text.d.ts.map +1 -0
- package/dist/src/action-proposal-text.js +119 -0
- package/dist/src/action-proposal-text.js.map +1 -0
- package/dist/src/action-proposal-transitions.d.ts +20 -0
- package/dist/src/action-proposal-transitions.d.ts.map +1 -0
- package/dist/src/action-proposal-transitions.js +311 -0
- package/dist/src/action-proposal-transitions.js.map +1 -0
- package/dist/src/action-proposal-worker.d.ts +32 -0
- package/dist/src/action-proposal-worker.d.ts.map +1 -0
- package/dist/src/action-proposal-worker.js +140 -0
- package/dist/src/action-proposal-worker.js.map +1 -0
- package/dist/src/ag-ui/adapter.d.ts.map +1 -1
- package/dist/src/ag-ui/adapter.js +106 -1
- package/dist/src/ag-ui/adapter.js.map +1 -1
- package/dist/src/ag-ui/core/encoder.d.ts +105 -0
- package/dist/src/ag-ui/core/encoder.d.ts.map +1 -0
- package/dist/src/ag-ui/core/encoder.js +523 -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 +74 -0
- package/dist/src/ag-ui/core/input.d.ts.map +1 -0
- package/dist/src/ag-ui/core/input.js +228 -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/core/proposal-decision.d.ts +9 -0
- package/dist/src/ag-ui/core/proposal-decision.d.ts.map +1 -0
- package/dist/src/ag-ui/core/proposal-decision.js +20 -0
- package/dist/src/ag-ui/core/proposal-decision.js.map +1 -0
- package/dist/src/ag-ui/core/stream.d.ts +27 -0
- package/dist/src/ag-ui/core/stream.d.ts.map +1 -0
- package/dist/src/ag-ui/core/stream.js +68 -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 +4 -5
- package/dist/src/ag-ui/frames.d.ts.map +1 -1
- package/dist/src/ag-ui/frames.js +9 -4
- 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 +8 -0
- package/dist/src/agent-deps-factory.d.ts.map +1 -1
- package/dist/src/agent-deps-factory.js +12 -0
- package/dist/src/agent-deps-factory.js.map +1 -1
- package/dist/src/agent-deps.d.ts +7 -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 +8 -3
- package/dist/src/agent-loop.d.ts.map +1 -1
- package/dist/src/agent-loop.js +398 -63
- package/dist/src/agent-loop.js.map +1 -1
- package/dist/src/agent-service.d.ts +52 -2
- package/dist/src/agent-service.d.ts.map +1 -1
- package/dist/src/agent-service.js +62 -2
- 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 +6 -1
- package/dist/src/ai-tool-ref.d.ts.map +1 -1
- package/dist/src/ai-tool-ref.js +32 -16
- package/dist/src/ai-tool-ref.js.map +1 -1
- package/dist/src/chat-queue-service.d.ts.map +1 -1
- package/dist/src/chat-queue-service.js +4 -0
- package/dist/src/chat-queue-service.js.map +1 -1
- package/dist/src/client/chat-client.d.ts +12 -0
- package/dist/src/client/chat-client.d.ts.map +1 -1
- package/dist/src/client/chat-client.js +69 -1
- package/dist/src/client/chat-client.js.map +1 -1
- package/dist/src/client/sse.d.ts +15 -0
- package/dist/src/client/sse.d.ts.map +1 -1
- package/dist/src/client/sse.js +45 -0
- package/dist/src/client/sse.js.map +1 -1
- package/dist/src/define_config.d.ts +70 -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 +298 -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 +77 -0
- package/dist/src/genui/catalog.d.ts.map +1 -0
- package/dist/src/genui/catalog.js +88 -0
- package/dist/src/genui/catalog.js.map +1 -0
- package/dist/src/genui/factory.d.ts +8 -8
- package/dist/src/genui/factory.d.ts.map +1 -1
- package/dist/src/genui/factory.js +3 -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 +6 -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 +35 -0
- package/dist/src/genui/text.d.ts.map +1 -0
- package/dist/src/genui/text.js +156 -0
- package/dist/src/genui/text.js.map +1 -0
- package/dist/src/genui/tools.d.ts +91 -0
- package/dist/src/genui/tools.d.ts.map +1 -0
- package/dist/src/genui/tools.js +292 -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 +21 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +19 -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 +10 -0
- package/dist/src/negotiated-tool-ui.d.ts.map +1 -0
- package/dist/src/negotiated-tool-ui.js +57 -0
- package/dist/src/negotiated-tool-ui.js.map +1 -0
- 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 +245 -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 +85 -0
- package/dist/src/react/core/ag-ui-backend.d.ts.map +1 -0
- package/dist/src/react/core/ag-ui-backend.js +409 -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 +796 -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 +234 -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/action-proposal-outcome-store.d.ts +43 -0
- package/dist/src/spi/action-proposal-outcome-store.d.ts.map +1 -0
- package/dist/src/spi/action-proposal-outcome-store.js +2 -0
- package/dist/src/spi/action-proposal-outcome-store.js.map +1 -0
- package/dist/src/spi/action-proposal-store.d.ts +152 -0
- package/dist/src/spi/action-proposal-store.d.ts.map +1 -0
- package/dist/src/spi/action-proposal-store.js +2 -0
- package/dist/src/spi/action-proposal-store.js.map +1 -0
- package/dist/src/spi/action-proposal-worker-store.d.ts +17 -0
- package/dist/src/spi/action-proposal-worker-store.d.ts.map +1 -0
- package/dist/src/spi/action-proposal-worker-store.js +2 -0
- package/dist/src/spi/action-proposal-worker-store.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/agent-store.d.ts +5 -0
- package/dist/src/spi/agent-store.d.ts.map +1 -1
- package/dist/src/spi/agent-store.js.map +1 -1
- package/dist/src/spi/approval-policy.d.ts +3 -0
- package/dist/src/spi/approval-policy.d.ts.map +1 -1
- package/dist/src/spi/approval-policy.js +8 -1
- package/dist/src/spi/approval-policy.js.map +1 -1
- package/dist/src/spi/background-actor-resolver.d.ts +9 -0
- package/dist/src/spi/background-actor-resolver.d.ts.map +1 -0
- package/dist/src/spi/background-actor-resolver.js +2 -0
- package/dist/src/spi/background-actor-resolver.js.map +1 -0
- package/dist/src/spi/chat-queue.d.ts +7 -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/token-stream-sink.d.ts +9 -0
- package/dist/src/spi/token-stream-sink.d.ts.map +1 -1
- package/dist/src/spi/token-stream-sink.js.map +1 -1
- package/dist/src/spi/tool.d.ts +40 -3
- package/dist/src/spi/tool.d.ts.map +1 -1
- package/dist/src/sse.d.ts.map +1 -1
- package/dist/src/sse.js +6 -0
- package/dist/src/sse.js.map +1 -1
- package/dist/src/stores/lucid-action-proposal-store.d.ts +55 -0
- package/dist/src/stores/lucid-action-proposal-store.d.ts.map +1 -0
- package/dist/src/stores/lucid-action-proposal-store.js +465 -0
- package/dist/src/stores/lucid-action-proposal-store.js.map +1 -0
- package/dist/src/stores/lucid-schema.d.ts +8 -6
- package/dist/src/stores/lucid-schema.d.ts.map +1 -1
- package/dist/src/stores/lucid-schema.js +61 -6
- package/dist/src/stores/lucid-schema.js.map +1 -1
- package/dist/src/stores/lucid.d.ts +4 -2
- package/dist/src/stores/lucid.d.ts.map +1 -1
- package/dist/src/stores/lucid.js +46 -14
- package/dist/src/stores/lucid.js.map +1 -1
- package/dist/src/stores/sqlite-transactions.d.ts +8 -0
- package/dist/src/stores/sqlite-transactions.d.ts.map +1 -0
- package/dist/src/stores/sqlite-transactions.js +24 -0
- package/dist/src/stores/sqlite-transactions.js.map +1 -0
- package/dist/src/stream-events.d.ts +4 -0
- package/dist/src/stream-events.d.ts.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-action-proposal-store.d.ts +32 -0
- package/dist/src/testing/in-memory-action-proposal-store.d.ts.map +1 -0
- package/dist/src/testing/in-memory-action-proposal-store.js +159 -0
- package/dist/src/testing/in-memory-action-proposal-store.js.map +1 -0
- package/dist/src/testing/in-memory-store.d.ts +9 -1
- package/dist/src/testing/in-memory-store.d.ts.map +1 -1
- package/dist/src/testing/in-memory-store.js +80 -1
- package/dist/src/testing/in-memory-store.js.map +1 -1
- package/dist/src/testing/index.d.ts +1 -0
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +1 -0
- package/dist/src/testing/index.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 +12 -1
- package/dist/src/tool-discovery.js.map +1 -1
- package/dist/src/tool-registry.d.ts +28 -1
- package/dist/src/tool-registry.d.ts.map +1 -1
- package/dist/src/tool-registry.js +85 -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/tool-retry.d.ts +0 -11
- package/dist/src/tool-retry.d.ts.map +1 -1
- package/dist/src/tool-retry.js +5 -1
- package/dist/src/tool-retry.js.map +1 -1
- package/dist/src/tool-ui.d.ts +4 -1
- package/dist/src/tool-ui.d.ts.map +1 -1
- package/dist/src/tool-ui.js +32 -4
- package/dist/src/tool-ui.js.map +1 -1
- package/dist/src/types.d.ts +48 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/ui-capabilities.d.ts +2 -0
- package/dist/src/ui-capabilities.d.ts.map +1 -0
- package/dist/src/ui-capabilities.js +4 -0
- package/dist/src/ui-capabilities.js.map +1 -0
- package/dist/stubs/database/migrations/add_action_proposal_discovery.stub +24 -0
- package/dist/stubs/database/migrations/add_action_proposal_runtime.stub +19 -0
- package/dist/stubs/database/migrations/create_agent_tables.stub +3 -3
- package/package.json +123 -22
- package/skills/agent-governance/SKILL.md +12 -4
- package/skills/agent-personas-agents/SKILL.md +2 -1
- package/skills/agent-setup/SKILL.md +36 -13
- package/skills/agent-testing/SKILL.md +22 -0
- package/skills/agent-tools/SKILL.md +54 -9
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { canonicalActionProposalJson, snapshotActionProposal, } from './action-proposal-transitions.js';
|
|
1
2
|
import { filterToolsByRole, personaFilterTools } from './personas.js';
|
|
2
3
|
import { canActorUseTool, filterToolsByCanUse, filterToolsByEnabled, isToolEnabled, } from './tool-filters.js';
|
|
4
|
+
import { presentToolResult } from './tool-result-presentation.js';
|
|
3
5
|
import { createNoopEmitUi } from './tool-ui.js';
|
|
4
6
|
/** Thrown when an actor invokes a tool their role is not allowed. */
|
|
5
7
|
export class ToolForbiddenError extends Error {
|
|
@@ -47,6 +49,36 @@ export class ToolInputInvalidError extends Error {
|
|
|
47
49
|
this.name = 'ToolInputInvalidError';
|
|
48
50
|
}
|
|
49
51
|
}
|
|
52
|
+
export class ToolPreflightDeniedError extends Error {
|
|
53
|
+
toolName;
|
|
54
|
+
reason;
|
|
55
|
+
constructor(toolName, reason) {
|
|
56
|
+
super(reason);
|
|
57
|
+
this.toolName = toolName;
|
|
58
|
+
this.reason = reason;
|
|
59
|
+
this.name = 'ToolPreflightDeniedError';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** Trusted preparation or a fresh schema parse changed the approved JSON input. */
|
|
63
|
+
export class ToolInputDriftError extends Error {
|
|
64
|
+
toolName;
|
|
65
|
+
constructor(toolName) {
|
|
66
|
+
super(`Tool "${toolName}" input differs from its trusted snapshot`);
|
|
67
|
+
this.toolName = toolName;
|
|
68
|
+
this.name = 'ToolInputDriftError';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function assertTrustedInput(name, value, approved) {
|
|
72
|
+
try {
|
|
73
|
+
if (canonicalActionProposalJson(value) === canonicalActionProposalJson(approved))
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// A non-JSON value cannot match a trusted JSON snapshot, including an explicitly undefined
|
|
78
|
+
// approvedInput. Ordinary invocations never serialize the schema's parsed value.
|
|
79
|
+
}
|
|
80
|
+
throw new ToolInputDriftError(name);
|
|
81
|
+
}
|
|
50
82
|
/**
|
|
51
83
|
* Holds every registered tool and gates invocation.
|
|
52
84
|
*
|
|
@@ -73,6 +105,15 @@ export class ToolRegistry {
|
|
|
73
105
|
has(name) {
|
|
74
106
|
return this.entries.has(name);
|
|
75
107
|
}
|
|
108
|
+
hasPresentation(name) {
|
|
109
|
+
return this.entries.get(name)?.handler.present !== undefined;
|
|
110
|
+
}
|
|
111
|
+
/** Used by a journaled already-completed preflight; never executes the domain handler. */
|
|
112
|
+
async presentResult(name, output, ctx) {
|
|
113
|
+
const entry = this.entries.get(name);
|
|
114
|
+
if (entry !== undefined)
|
|
115
|
+
await presentToolResult(name, entry.handler, output, ctx);
|
|
116
|
+
}
|
|
76
117
|
spec(name) {
|
|
77
118
|
return this.entries.get(name)?.spec;
|
|
78
119
|
}
|
|
@@ -91,9 +132,11 @@ export class ToolRegistry {
|
|
|
91
132
|
*/
|
|
92
133
|
async definitionsFor(actor, policy, allowedTools, scope = {}) {
|
|
93
134
|
const visible = await this.visibleEntries(actor, policy, allowedTools);
|
|
94
|
-
|
|
135
|
+
const definitions = await Promise.all(visible.map(async ({ spec, handler }) => {
|
|
95
136
|
// After every gate: a tool this actor cannot reach is never asked to describe itself.
|
|
96
137
|
const override = handler.describe === undefined ? undefined : await handler.describe({ actor, ...scope });
|
|
138
|
+
if (override?.available === false)
|
|
139
|
+
return null;
|
|
97
140
|
return {
|
|
98
141
|
name: spec.name,
|
|
99
142
|
kind: spec.kind,
|
|
@@ -101,6 +144,7 @@ export class ToolRegistry {
|
|
|
101
144
|
inputSchema: override?.inputSchema ?? spec.inputSchema,
|
|
102
145
|
};
|
|
103
146
|
}));
|
|
147
|
+
return definitions.filter((definition) => definition !== null);
|
|
104
148
|
}
|
|
105
149
|
/**
|
|
106
150
|
* The specs {@link definitionsFor} offers the model, whole — the same four gates (allow-list,
|
|
@@ -125,7 +169,7 @@ export class ToolRegistry {
|
|
|
125
169
|
* again) and re-parses the input. With `options.allowedTools` (the turn's persona allow-list) a
|
|
126
170
|
* tool off that list is refused last, the same way the offer narrowed it.
|
|
127
171
|
*/
|
|
128
|
-
async
|
|
172
|
+
async validated(name, input, ctx, policy, options = {}) {
|
|
129
173
|
const entry = this.entries.get(name);
|
|
130
174
|
if (entry === undefined) {
|
|
131
175
|
throw new ToolNotFoundError(name);
|
|
@@ -151,7 +195,45 @@ export class ToolRegistry {
|
|
|
151
195
|
// `emitUi` is part of the context's contract; a caller without a conversation (a test, a script,
|
|
152
196
|
// a JavaScript host) gets the no-op rather than a tool that crashes calling it.
|
|
153
197
|
const withEmit = typeof ctx.emitUi === 'function' ? ctx : { ...ctx, emitUi: createNoopEmitUi(ctx.requestId) };
|
|
154
|
-
return entry
|
|
198
|
+
return { entry, value: validation.value, ctx: withEmit };
|
|
199
|
+
}
|
|
200
|
+
async prepare(name, input, ctx, policy, options = {}) {
|
|
201
|
+
return (await this.prepareValidated(name, input, ctx, policy, options)).preflight;
|
|
202
|
+
}
|
|
203
|
+
/** Expose the single schema parse; snapshotInput opts proposal callers into immutable JSON. */
|
|
204
|
+
async prepareValidated(name, input, ctx, policy, options = {}) {
|
|
205
|
+
const { entry, value, ctx: withEmit } = await this.validated(name, input, ctx, policy, options);
|
|
206
|
+
const normalized = options.snapshotInput === true ? snapshotActionProposal(value) : value;
|
|
207
|
+
const hookInput = options.snapshotInput === true ? snapshotActionProposal(normalized) : value;
|
|
208
|
+
const preflight = (entry.spec.kind === 'action'
|
|
209
|
+
? await entry.handler.preflight?.(hookInput, withEmit, { phase: 'prepare' })
|
|
210
|
+
: undefined) ?? { status: 'ready' };
|
|
211
|
+
// A hook can retain its input or mutate nested values after an await. Only the isolated
|
|
212
|
+
// normalized snapshot can be approved; reject mutation before exposing its confirmation.
|
|
213
|
+
if (options.snapshotInput === true)
|
|
214
|
+
assertTrustedInput(name, hookInput, normalized);
|
|
215
|
+
return { input: normalized, preflight };
|
|
216
|
+
}
|
|
217
|
+
async invoke(name, input, ctx, policy, options = {}) {
|
|
218
|
+
const { entry, value, ctx: withEmit } = await this.validated(name, input, ctx, policy, options);
|
|
219
|
+
const trusted = Object.hasOwn(options, 'approvedInput');
|
|
220
|
+
if (trusted)
|
|
221
|
+
assertTrustedInput(name, value, options.approvedInput);
|
|
222
|
+
const executionInput = trusted ? snapshotActionProposal(value) : value;
|
|
223
|
+
const hookInput = trusted ? snapshotActionProposal(executionInput) : value;
|
|
224
|
+
const result = entry.spec.kind === 'action'
|
|
225
|
+
? await entry.handler.preflight?.(hookInput, withEmit, { phase: 'execute' })
|
|
226
|
+
: undefined;
|
|
227
|
+
// The hook receives its own snapshot, so retained references cannot alter later execution.
|
|
228
|
+
if (trusted)
|
|
229
|
+
assertTrustedInput(name, hookInput, executionInput);
|
|
230
|
+
if (result?.status === 'denied')
|
|
231
|
+
throw new ToolPreflightDeniedError(name, result.reason);
|
|
232
|
+
const output = result?.status === 'completed'
|
|
233
|
+
? result.output
|
|
234
|
+
: await entry.handler.execute(executionInput, withEmit);
|
|
235
|
+
await presentToolResult(name, entry.handler, output, withEmit);
|
|
236
|
+
return output;
|
|
155
237
|
}
|
|
156
238
|
}
|
|
157
239
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-registry.js","sourceRoot":"","sources":["../../src/tool-registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGtE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,qEAAqE;AACrE,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACf,QAAQ;IAApC,YAA4B,QAAgB;QAC1C,KAAK,CAAC,SAAS,QAAQ,gCAAgC,CAAC,CAAC;wBAD/B,QAAQ;QAElC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACd,QAAQ;IAApC,YAA4B,QAAgB;QAC1C,KAAK,CAAC,SAAS,QAAQ,kCAAkC,CAAC,CAAC;wBADjC,QAAQ;QAElC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AAED,+DAA+D;AAC/D,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACd,QAAQ;IAApC,YAA4B,QAAgB;QAC1C,KAAK,CAAC,SAAS,QAAQ,qBAAqB,CAAC,CAAC;wBADpB,QAAQ;QAElC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AAED,uEAAuE;AACvE,MAAM,OAA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,MAAM,CAAC;IAChB,CAAC;CACF;AAuBD;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IAIV,YAAY;IAHd,UAAU,CAAa;IAExC,YACmB,YAAY,GAAa,EAAE,EAC5C,OAAO,GAAuB,EAAE;4BADf,YAAY;QAG7B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC;IAClD,CAAC;IAED,GAAG,CAAC,KAAY,EAAE,IAAc;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,YAAY,CAAC;QAChD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC;QAC7D,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;CACF;AAaD;;;;;GAKG;AACH,MAAM,OAAO,iBAAkB,SAAQ,kBAAkB;IACvD,YAAY,YAAY,GAAa,EAAE;QACrC,KAAK,CAAC,YAAY,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AiToolCtx, ToolHandler } from './spi/tool.js';
|
|
2
|
+
/** JSON-only component output, structurally shared with the optional GenUI core. */
|
|
3
|
+
export interface ComponentPresentation<P extends object = Record<string, unknown>> {
|
|
4
|
+
component: string;
|
|
5
|
+
props: P;
|
|
6
|
+
version: number;
|
|
7
|
+
fallbackText: string;
|
|
8
|
+
}
|
|
9
|
+
export type ToolResultPresentation = ComponentPresentation<object> | readonly ComponentPresentation<object>[] | undefined;
|
|
10
|
+
/** Presentation must never turn a completed domain write into a retryable tool failure. */
|
|
11
|
+
export declare function presentToolResult(toolName: string, handler: ToolHandler, output: unknown, ctx: AiToolCtx): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=tool-result-presentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-result-presentation.d.ts","sourceRoot":"","sources":["../../src/tool-result-presentation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5D,oFAAoF;AACpF,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/E,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,sBAAsB,GAC9B,qBAAqB,CAAC,MAAM,CAAC,GAC7B,SAAS,qBAAqB,CAAC,MAAM,CAAC,EAAE,GACxC,SAAS,CAAC;AAkBd,2FAA2F;AAC3F,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,OAAO,EACf,GAAG,EAAE,SAAS,GACb,OAAO,CAAC,IAAI,CAAC,CAuBf"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { snapshotActionProposal } from './action-proposal-transitions.js';
|
|
2
|
+
function snapshot(value) {
|
|
3
|
+
if (!value ||
|
|
4
|
+
typeof value.component !== 'string' ||
|
|
5
|
+
!/^[A-Za-z][A-Za-z0-9]{0,63}$/.test(value.component) ||
|
|
6
|
+
!Number.isSafeInteger(value.version) ||
|
|
7
|
+
value.version < 1 ||
|
|
8
|
+
typeof value.fallbackText !== 'string' ||
|
|
9
|
+
typeof value.props !== 'object' ||
|
|
10
|
+
value.props === null ||
|
|
11
|
+
Array.isArray(value.props))
|
|
12
|
+
throw new TypeError('Invalid tool component presentation');
|
|
13
|
+
return snapshotActionProposal(value);
|
|
14
|
+
}
|
|
15
|
+
/** Presentation must never turn a completed domain write into a retryable tool failure. */
|
|
16
|
+
export async function presentToolResult(toolName, handler, output, ctx) {
|
|
17
|
+
if (handler.present === undefined)
|
|
18
|
+
return;
|
|
19
|
+
try {
|
|
20
|
+
const result = await handler.present(output, ctx);
|
|
21
|
+
if (result === undefined)
|
|
22
|
+
return;
|
|
23
|
+
const presentations = (Array.isArray(result) ? result : [result]).map(snapshot);
|
|
24
|
+
for (const item of presentations) {
|
|
25
|
+
await ctx.emitUi(item.component, item.props, {
|
|
26
|
+
version: item.version,
|
|
27
|
+
fallbackText: item.fallbackText,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
try {
|
|
33
|
+
if (ctx.onPresentationError !== undefined) {
|
|
34
|
+
await ctx.onPresentationError(error, { toolName });
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// A broken reporter must not cause the successful action to run again either.
|
|
40
|
+
}
|
|
41
|
+
console.warn('[agent] Tool presentation failed after successful execution', { toolName });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=tool-result-presentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-result-presentation.js","sourceRoot":"","sources":["../../src/tool-result-presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAgB1E,SAAS,QAAQ,CAAC,KAAoC;IACpD,IACE,CAAC,KAAK;QACN,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ;QACnC,CAAC,6BAA6B,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QACpD,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC;QACpC,KAAK,CAAC,OAAO,GAAG,CAAC;QACjB,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ;QACtC,OAAO,KAAK,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,CAAC,6DAA6D,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC"}
|
package/dist/src/tool-retry.d.ts
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transient tool-error classification + the retry loop that wraps a tool's own invocation. A
|
|
3
|
-
* classified-transient error (a DB deadlock, a lock-wait timeout, a serialization failure) means the
|
|
4
|
-
* server rolled the tool's work back — retrying THAT class is safe, unlike a tool's general business
|
|
5
|
-
* failure, which stays a one-shot outcome (no durable step retries: a tool may not be idempotent).
|
|
6
|
-
*
|
|
7
|
-
* `runAgentLoop` wraps `registry.invoke(...)` with {@link invokeWithTransientRetry} INSIDE the
|
|
8
|
-
* `tool:<call.id>` step body — so under durable replay the whole step is memoized on its successful
|
|
9
|
-
* result and a retry never becomes a new checkpoint; history still shows exactly one step per tool
|
|
10
|
-
* call and side effects run once.
|
|
11
|
-
*/
|
|
12
1
|
/**
|
|
13
2
|
* Default transient-tool-error classifier: true for a recognized MySQL/Postgres/SQLite
|
|
14
3
|
* lock-contention shape (by driver `code`/`errno`/`sqlState`, or a matching message), checked on the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-retry.d.ts","sourceRoot":"","sources":["../../src/tool-retry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-retry.d.ts","sourceRoot":"","sources":["../../src/tool-retry.ts"],"names":[],"mappings":"AAwCA;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAY5D;AAED,+FAA+F;AAC/F,eAAO,MAAM,qCAAqC,IAAI,CAAC;AACvD,kFAAkF;AAClF,eAAO,MAAM,uCAAuC,MAAM,CAAC;AAE3D,2FAA2F;AAC3F,MAAM,WAAW,yBAAyB;IACxC,yGAAyG;IACzG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uFAAuF;IACvF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACxC;AAED,kGAAkG;AAClG,MAAM,MAAM,yBAAyB,GAAG,yBAAyB,GAAG,KAAK,CAAC;AAE1E,MAAM,WAAW,+BAA+B;IAC9C;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IACjD;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAQD;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAAC,CAAC,EAC9C,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,EAAE,yBAAyB,EAClC,OAAO,CAAC,EAAE,+BAA+B,GACxC,OAAO,CAAC,CAAC,CAAC,CA4BZ"}
|
package/dist/src/tool-retry.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ToolPreflightDeniedError } from './tool-registry.js';
|
|
1
2
|
/**
|
|
2
3
|
* Transient tool-error classification + the retry loop that wraps a tool's own invocation. A
|
|
3
4
|
* classified-transient error (a DB deadlock, a lock-wait timeout, a serialization failure) means the
|
|
@@ -39,6 +40,8 @@ function hasTransientShape(error) {
|
|
|
39
40
|
* with none of these markers — any other business failure — is `false`.
|
|
40
41
|
*/
|
|
41
42
|
export function isTransientToolError(error) {
|
|
43
|
+
if (error instanceof ToolPreflightDeniedError)
|
|
44
|
+
return false;
|
|
42
45
|
if (hasTransientShape(error)) {
|
|
43
46
|
return true;
|
|
44
47
|
}
|
|
@@ -79,7 +82,8 @@ export async function invokeWithTransientRetry(fn, setting, options) {
|
|
|
79
82
|
return await fn();
|
|
80
83
|
}
|
|
81
84
|
catch (error) {
|
|
82
|
-
if (
|
|
85
|
+
if (error instanceof ToolPreflightDeniedError ||
|
|
86
|
+
options?.isControlFlowError?.(error) === true) {
|
|
83
87
|
throw error;
|
|
84
88
|
}
|
|
85
89
|
const attemptsRemain = attempt < attempts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-retry.js","sourceRoot":"","sources":["../../src/tool-retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,6FAA6F;AAC7F,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,IAAI,KAAK,CAAC,CAAC,CAAE,KAA2B,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7E,MAAM,KAAK,GAAG,OAAO,IAAI,KAAK,CAAC,CAAC,CAAE,KAA4B,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IACjF,MAAM,QAAQ,GAAG,UAAU,IAAI,KAAK,CAAC,CAAC,CAAE,KAA+B,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7F,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACvE,OAAO,IAAI,CAAC,CAAC,8DAA8D;IAC7E,CAAC;IACD,IAAI,IAAI,KAAK,kBAAkB,IAAI,IAAI,KAAK,sBAAsB,EAAE,CAAC;QACnE,OAAO,IAAI,CAAC,CAAC,4BAA4B;IAC3C,CAAC;IACD,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,OAAO,IAAI,QAAQ,KAAK,OAAO,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzF,OAAO,IAAI,CAAC,CAAC,+DAA+D;IAC9E,CAAC;IACD,IAAI,IAAI,KAAK,aAAa,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,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,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,EAAoB,EACpB,OAAkC,EAClC,OAAyC;IAEzC,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QACtB,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;IACD,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,qCAAqC,CAAC;IAC3E,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,uCAAuC,CAAC;IAC/E,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,oBAAoB,CAAC;IAE1D,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,SAAS,CAAC;QACR,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IACE,KAAK,YAAY,wBAAwB;gBACzC,OAAO,EAAE,kBAAkB,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,EAC7C,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;YACD,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,CAAC;YAC1C,IAAI,CAAC,cAAc,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBACxC,MAAM,KAAK,CAAC;YACd,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YACnC,MAAM,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,CAAC;YACjC,OAAO,IAAI,CAAC,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/src/tool-ui.d.ts
CHANGED
|
@@ -5,11 +5,12 @@ import type { AgentUiComponent } from './stream-events.js';
|
|
|
5
5
|
* What a tool step returns: the output alone when the tool pushed nothing (the bytes a run journaled
|
|
6
6
|
* before `emitUi` existed), else an envelope carrying the pushes with it.
|
|
7
7
|
*/
|
|
8
|
-
export declare function wrapToolStepOutput(output: unknown, ui: readonly AgentUiComponent[]): unknown;
|
|
8
|
+
export declare function wrapToolStepOutput(output: unknown, ui: readonly AgentUiComponent[], text?: string): unknown;
|
|
9
9
|
/** Read a tool step's result back — an envelope, or a bare output recorded without one. */
|
|
10
10
|
export declare function unwrapToolStepOutput(raw: unknown): {
|
|
11
11
|
output: unknown;
|
|
12
12
|
ui: AgentUiComponent[];
|
|
13
|
+
text?: string;
|
|
13
14
|
};
|
|
14
15
|
export type EmitUi = AiToolCtx['emitUi'];
|
|
15
16
|
/**
|
|
@@ -32,4 +33,6 @@ export interface UiCollector {
|
|
|
32
33
|
export declare function createUiCollector(toolCallId: string, writer?: SinkWriter): UiCollector;
|
|
33
34
|
/** Merge component lists: first-seen order, last props per id. */
|
|
34
35
|
export declare function mergeUi(...lists: readonly (readonly AgentUiComponent[] | undefined)[]): AgentUiComponent[];
|
|
36
|
+
/** Preserve JSON snapshots, but make unsafe UTF-16 safe for human-text SQL columns. */
|
|
37
|
+
export declare function escapeUnsafeToolUiText(text: string): string;
|
|
35
38
|
//# sourceMappingURL=tool-ui.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-ui.d.ts","sourceRoot":"","sources":["../../src/tool-ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-ui.d.ts","sourceRoot":"","sources":["../../src/tool-ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAiB3D;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,EACf,EAAE,EAAE,SAAS,gBAAgB,EAAE,EAC/B,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAeT;AAED,2FAA2F;AAC3F,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG;IAClD,MAAM,EAAE,OAAO,CAAC;IAChB,EAAE,EAAE,gBAAgB,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAcA;AAED,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEzC;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,SAAS,GAAG,MAAM,CAUvD;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,UAAU,IAAI,gBAAgB,EAAE,CAAC;IACjC,uFAAuF;IACvF,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,WAAW,CAsDtF;AAED,kEAAkE;AAClE,wBAAgB,OAAO,CACrB,GAAG,KAAK,EAAE,SAAS,CAAC,SAAS,gBAAgB,EAAE,GAAG,SAAS,CAAC,EAAE,GAC7D,gBAAgB,EAAE,CAQpB;AAED,uFAAuF;AACvF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO3D"}
|
package/dist/src/tool-ui.js
CHANGED
|
@@ -8,11 +8,19 @@ const TOOL_STEP_UI = '@@adonis-agent/tool-step-ui';
|
|
|
8
8
|
* What a tool step returns: the output alone when the tool pushed nothing (the bytes a run journaled
|
|
9
9
|
* before `emitUi` existed), else an envelope carrying the pushes with it.
|
|
10
10
|
*/
|
|
11
|
-
export function wrapToolStepOutput(output, ui) {
|
|
12
|
-
|
|
11
|
+
export function wrapToolStepOutput(output, ui, text) {
|
|
12
|
+
const reservedOutput = typeof output === 'object' &&
|
|
13
|
+
output !== null &&
|
|
14
|
+
(TOOL_STEP_UI in output || '@@adonis-agent/tool-preflight-denied' in output);
|
|
15
|
+
if (ui.length === 0 && !text && !reservedOutput) {
|
|
13
16
|
return output;
|
|
14
17
|
}
|
|
15
|
-
const wrapped = {
|
|
18
|
+
const wrapped = {
|
|
19
|
+
[TOOL_STEP_UI]: 1,
|
|
20
|
+
output,
|
|
21
|
+
ui: [...ui],
|
|
22
|
+
...(text ? { text } : {}),
|
|
23
|
+
};
|
|
16
24
|
return wrapped;
|
|
17
25
|
}
|
|
18
26
|
/** Read a tool step's result back — an envelope, or a bare output recorded without one. */
|
|
@@ -21,7 +29,11 @@ export function unwrapToolStepOutput(raw) {
|
|
|
21
29
|
raw !== null &&
|
|
22
30
|
raw[TOOL_STEP_UI] === 1) {
|
|
23
31
|
const wrapped = raw;
|
|
24
|
-
return {
|
|
32
|
+
return {
|
|
33
|
+
output: wrapped.output,
|
|
34
|
+
ui: Array.isArray(wrapped.ui) ? wrapped.ui : [],
|
|
35
|
+
...(wrapped.text ? { text: wrapped.text } : {}),
|
|
36
|
+
};
|
|
25
37
|
}
|
|
26
38
|
return { output: raw, ui: [] };
|
|
27
39
|
}
|
|
@@ -67,6 +79,12 @@ export function createUiCollector(toolCallId, writer) {
|
|
|
67
79
|
props: JSON.parse(JSON.stringify(props)),
|
|
68
80
|
...(options.version !== undefined ? { version: options.version } : {}),
|
|
69
81
|
toolCallId,
|
|
82
|
+
...(options.fallbackText !== undefined ? { fallbackText: options.fallbackText } : {}),
|
|
83
|
+
...(options.componentVersions !== undefined
|
|
84
|
+
? {
|
|
85
|
+
componentVersions: JSON.parse(JSON.stringify(options.componentVersions)),
|
|
86
|
+
}
|
|
87
|
+
: {}),
|
|
70
88
|
};
|
|
71
89
|
pushed.set(id, entry);
|
|
72
90
|
await writer?.write({
|
|
@@ -76,6 +94,10 @@ export function createUiCollector(toolCallId, writer) {
|
|
|
76
94
|
id,
|
|
77
95
|
toolCallId,
|
|
78
96
|
...(entry.version !== undefined ? { version: entry.version } : {}),
|
|
97
|
+
...(entry.fallbackText !== undefined ? { fallbackText: entry.fallbackText } : {}),
|
|
98
|
+
...(entry.componentVersions !== undefined
|
|
99
|
+
? { componentVersions: entry.componentVersions }
|
|
100
|
+
: {}),
|
|
79
101
|
});
|
|
80
102
|
return { id };
|
|
81
103
|
};
|
|
@@ -97,4 +119,10 @@ export function mergeUi(...lists) {
|
|
|
97
119
|
}
|
|
98
120
|
return [...merged.values()];
|
|
99
121
|
}
|
|
122
|
+
/** Preserve JSON snapshots, but make unsafe UTF-16 safe for human-text SQL columns. */
|
|
123
|
+
export function escapeUnsafeToolUiText(text) {
|
|
124
|
+
return text
|
|
125
|
+
.replaceAll('\u0000', '\\u0000')
|
|
126
|
+
.replace(/[\uD800-\uDFFF]/gu, (unit) => `\\u${unit.charCodeAt(0).toString(16).padStart(4, '0')}`);
|
|
127
|
+
}
|
|
100
128
|
//# sourceMappingURL=tool-ui.js.map
|
package/dist/src/tool-ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-ui.js","sourceRoot":"","sources":["../../src/tool-ui.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,MAAM,YAAY,GAAG,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-ui.js","sourceRoot":"","sources":["../../src/tool-ui.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,MAAM,YAAY,GAAG,6BAA6B,CAAC;AASnD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAe,EACf,EAA+B,EAC/B,IAAa;IAEb,MAAM,cAAc,GAClB,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,KAAK,IAAI;QACf,CAAC,YAAY,IAAI,MAAM,IAAI,sCAAsC,IAAI,MAAM,CAAC,CAAC;IAC/E,IAAI,EAAE,CAAC,MAAM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F,CAAC;AACJ,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,OAAO,CACrB,GAAG,KAA2D;IAE9D,MAAM,MAAM,GAAG,IAAI,GAAG,EAA4B,CAAC;IACnD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,MAAM,SAAS,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;YACnC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9B,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,sBAAsB,CAAC,IAAY;IACjD,OAAO,IAAI;SACR,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;SAC/B,OAAO,CACN,mBAAmB,EACnB,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CACnE,CAAC;AACN,CAAC"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
|
+
import type { ClaimedActionApproval } from './action-proposal-approval.js';
|
|
2
3
|
import type { AgentIntake } from './elicitation.js';
|
|
4
|
+
import type { ActionProposalOutcome } from './spi/action-proposal-outcome-store.js';
|
|
3
5
|
import type { ActorResolver } from './spi/actor-resolver.js';
|
|
4
6
|
import type { ChatQueueState } from './spi/chat-queue.js';
|
|
7
|
+
import type { ToolPreflightResult } from './spi/tool.js';
|
|
5
8
|
import type { AgentUiComponent } from './stream-events.js';
|
|
6
|
-
import type { ToolPresentation } from './tool-presentation.js';
|
|
9
|
+
import type { ToolConfirmation, ToolPresentation } from './tool-presentation.js';
|
|
10
|
+
import type { UiCapabilities } from './ui-capabilities.js';
|
|
7
11
|
/** Who is driving the turn. Roles + tenant come from the host app (nestjs-context/authz). */
|
|
8
12
|
export interface Actor {
|
|
9
13
|
id: string;
|
|
@@ -38,6 +42,7 @@ export interface ToolSpec {
|
|
|
38
42
|
* to the model; served to clients by `GET <path>/tools`.
|
|
39
43
|
*/
|
|
40
44
|
presentation?: ToolPresentation;
|
|
45
|
+
replacementKey?: string | ((input: unknown, ctx: import('./spi/tool.js').AiToolCtx) => string | undefined | Promise<string | undefined>);
|
|
41
46
|
/**
|
|
42
47
|
* Input schema as a [Standard Schema](https://standardschema.dev) — validation-agnostic, so
|
|
43
48
|
* Zod, Valibot, or ArkType all work. The loop validates input via `~standard.validate` before
|
|
@@ -93,6 +98,18 @@ export interface ToolDefinition {
|
|
|
93
98
|
}
|
|
94
99
|
/** A tool call the model asked for during a turn. */
|
|
95
100
|
export interface ToolCallRequest {
|
|
101
|
+
actionApproval?: ClaimedActionApproval;
|
|
102
|
+
prepared?: {
|
|
103
|
+
preparationInput: unknown;
|
|
104
|
+
input: unknown;
|
|
105
|
+
preflight: ToolPreflightResult;
|
|
106
|
+
replacementKey?: string;
|
|
107
|
+
};
|
|
108
|
+
/** Trusted domain preparation stamped by the runtime into the model checkpoint, never supplied by the model. */
|
|
109
|
+
preflight?: ToolPreflightResult | {
|
|
110
|
+
status: 'failed';
|
|
111
|
+
error: string;
|
|
112
|
+
};
|
|
96
113
|
id: string;
|
|
97
114
|
name: string;
|
|
98
115
|
input: unknown;
|
|
@@ -104,6 +121,11 @@ export interface ToolCallRequest {
|
|
|
104
121
|
* (defensively treated as `read` wherever a definite value is required).
|
|
105
122
|
*/
|
|
106
123
|
kind?: ToolKind;
|
|
124
|
+
/**
|
|
125
|
+
* The call this one ran inside — an inner call of a code-mode tool an engine reported (see
|
|
126
|
+
* `AgentEngine`). Absent for a call the model made itself, which is every call the loop records.
|
|
127
|
+
*/
|
|
128
|
+
parentId?: string;
|
|
107
129
|
}
|
|
108
130
|
/** Result of running a tool. */
|
|
109
131
|
export interface ToolResult {
|
|
@@ -238,6 +260,7 @@ export interface PromptContext {
|
|
|
238
260
|
actor: Actor;
|
|
239
261
|
persona?: Persona;
|
|
240
262
|
pageContext?: PageContext;
|
|
263
|
+
uiCapabilities?: UiCapabilities;
|
|
241
264
|
basePrompt: string;
|
|
242
265
|
}
|
|
243
266
|
/**
|
|
@@ -313,6 +336,13 @@ export interface AgentCatalogEntry {
|
|
|
313
336
|
/** The persona a send runs under when it names none. Omitted when the agent has no default. */
|
|
314
337
|
defaultPersona?: string;
|
|
315
338
|
}
|
|
339
|
+
/**
|
|
340
|
+
* What the HOST knows about a send that the library does not model — see
|
|
341
|
+
* {@link AgentRunInput.hostContext}. Plain JSON.
|
|
342
|
+
*/
|
|
343
|
+
export type AgentHostContext = {
|
|
344
|
+
readonly [key: string]: unknown;
|
|
345
|
+
};
|
|
316
346
|
/** Everything needed to run one agent turn. */
|
|
317
347
|
export interface AgentRunInput {
|
|
318
348
|
threadId: string;
|
|
@@ -331,6 +361,7 @@ export interface AgentRunInput {
|
|
|
331
361
|
*/
|
|
332
362
|
persona?: string | Persona;
|
|
333
363
|
pageContext?: PageContext;
|
|
364
|
+
uiCapabilities?: UiCapabilities;
|
|
334
365
|
/**
|
|
335
366
|
* Answer the thread's last user message again instead of appending {@link userText} (ignored):
|
|
336
367
|
* the loop drops every message after that user message — the answer being replaced — and runs
|
|
@@ -374,6 +405,14 @@ export interface AgentRunInput {
|
|
|
374
405
|
* ancestor sink to forward into), so nothing else tells it apart from a top-level turn.
|
|
375
406
|
*/
|
|
376
407
|
deliverTo?: DetachedDelivery;
|
|
408
|
+
/**
|
|
409
|
+
* What the HOST knows about this turn that the library does not model — where it came from, where
|
|
410
|
+
* its answer goes, on whose behalf (e.g. `{ source: 'slack', delivery: { channel, ts } }`). Plain
|
|
411
|
+
* JSON: it travels through the queue and the durable journal untouched, and reaches the runner's
|
|
412
|
+
* hooks (an engine's host callbacks) as it was sent. Never shown to the model or to clients, and
|
|
413
|
+
* never inherited by a delegated run.
|
|
414
|
+
*/
|
|
415
|
+
hostContext?: AgentHostContext;
|
|
377
416
|
}
|
|
378
417
|
/**
|
|
379
418
|
* Where a detached sub-agent run posts its answer: the thread that delegated it, and the `agent`-kind
|
|
@@ -521,6 +560,7 @@ export interface ThreadSummary {
|
|
|
521
560
|
activeRunId?: string | null;
|
|
522
561
|
}
|
|
523
562
|
export interface StoredMessage {
|
|
563
|
+
actionProposalOutcome?: ActionProposalOutcome;
|
|
524
564
|
id: string;
|
|
525
565
|
role: MessageRole;
|
|
526
566
|
content: string;
|
|
@@ -588,6 +628,12 @@ export interface MessageFeedback {
|
|
|
588
628
|
export type ToolCallApprovalStatus = 'pending' | 'approved' | 'rejected' | 'expired';
|
|
589
629
|
/** The persisted approval metadata of one action tool call. See {@link StoredMessage.approvals}. */
|
|
590
630
|
export interface ToolCallApproval {
|
|
631
|
+
proposalId?: string;
|
|
632
|
+
target?: {
|
|
633
|
+
kind: 'proposal';
|
|
634
|
+
proposalId: string;
|
|
635
|
+
};
|
|
636
|
+
confirmation?: ToolConfirmation;
|
|
591
637
|
toolCallId: string;
|
|
592
638
|
/** Who may decide: `'requester'` (the thread's own actor) or a role name. */
|
|
593
639
|
approver: string;
|
|
@@ -611,7 +657,7 @@ export interface ThreadDetail extends ThreadSummary {
|
|
|
611
657
|
*/
|
|
612
658
|
queue?: ChatQueueState;
|
|
613
659
|
}
|
|
614
|
-
export type ToolCallStatus = 'auto_executed' | 'pending_approval' | 'executed' | 'rejected' | 'failed'
|
|
660
|
+
export type ToolCallStatus = 'proposed' | 'auto_executed' | 'pending_approval' | 'executed' | 'rejected' | 'failed'
|
|
615
661
|
/** An approval request lapsed before anyone decided; the tool never ran. */
|
|
616
662
|
| 'expired';
|
|
617
663
|
/** The attachment rules in force — what the upload route enforces (`GET <path>/config`). */
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","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A8E;IAC9E,KAAK,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IAC7B,oEAAoE;IACpE,QAAQ,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|