eve 0.44.4 → 0.45.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 +30 -0
- package/README.md +13 -12
- package/dist/src/acp/adapter.d.ts +1 -1
- package/dist/src/approval/definition.d.ts +84 -0
- package/dist/src/approval/definition.js +1 -0
- package/dist/src/{runtime/governance → channel}/auth/http-basic.d.ts +1 -1
- package/dist/src/{runtime/governance → channel}/auth/jwt-ecdsa.d.ts +1 -1
- package/dist/src/channel/auth/jwt-ecdsa.js +1 -0
- package/dist/src/{runtime/governance → channel}/auth/jwt-hmac.d.ts +1 -1
- package/dist/src/channel/auth/jwt-hmac.js +1 -0
- package/dist/src/{runtime/governance → channel}/auth/oidc.d.ts +1 -1
- package/dist/src/channel/auth/oidc.js +1 -0
- package/dist/src/{runtime/governance → channel}/auth/token-claims.d.ts +1 -1
- package/dist/src/{runtime/governance → channel}/auth/types.d.ts +1 -1
- package/dist/src/{runtime/governance → channel}/auth/vercel-oidc-project.d.ts +1 -1
- package/dist/src/channel/channel-operations.d.ts +1 -1
- package/dist/src/channel/channel-operations.js +1 -1
- package/dist/src/channel/instrumentation.d.ts +1 -0
- package/dist/src/channel/instrumentation.js +1 -1
- package/dist/src/channel/resolve-text.d.ts +1 -1
- package/dist/src/channel/routes.d.ts +1 -1
- package/dist/src/channel/session.d.ts +1 -1
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +2 -2
- package/dist/src/chunks/{use-eve-agent-BJwaMe5k.js → use-eve-agent-C46Kan_I.js} +385 -106
- package/dist/src/chunks/{use-eve-agent-BtsOXv3s.js → use-eve-agent-OtHRoxIS.js} +385 -106
- package/dist/src/cli/banner.js +1 -1
- package/dist/src/cli/commands/agent-instructions.js +2 -2
- package/dist/src/cli/commands/channel-add-conflicts.js +1 -1
- package/dist/src/cli/commands/extension-build.js +1 -1
- package/dist/src/cli/commands/extension-init.js +1 -1
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/trace.js +1 -1
- package/dist/src/cli/dev/tui/remote-auth.js +1 -1
- package/dist/src/cli/dev/tui/setup-selection-input.d.ts +3 -1
- package/dist/src/cli/dev/tui/setup-selection-input.js +2 -2
- package/dist/src/cli/dev/tui/terminal-renderer.js +2 -2
- package/dist/src/cli/dev/tui/traces/trace-conversation.d.ts +1 -1
- package/dist/src/cli/dev/tui/traces/trace-conversation.js +1 -1
- package/dist/src/cli/dev/tui/traces/trace-viewer-state.js +1 -1
- package/dist/src/cli/invoke/result.d.ts +1 -1
- package/dist/src/cli/ui/live-row.js +1 -1
- package/dist/src/cli/ui/output.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +1757 -302
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/eve-agent-store.d.ts +6 -5
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/health-response-error.d.ts +5 -0
- package/dist/src/client/health-response-error.js +1 -0
- package/dist/src/client/health-schema.d.ts +7 -0
- package/dist/src/client/health-schema.js +1 -0
- package/dist/src/client/index.d.ts +6 -3
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/message-action-parts.d.ts +2 -2
- package/dist/src/client/message-reducer-types.d.ts +1 -1
- package/dist/src/client/reducer.d.ts +1 -1
- package/dist/src/client/session-utils.d.ts +1 -1
- package/dist/src/client/session.d.ts +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +3 -7
- package/dist/src/compiler/artifacts.d.ts +37 -11
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/channel-route-plan.d.ts +10 -0
- package/dist/src/compiler/channel-route-plan.js +1 -0
- package/dist/src/compiler/compile-agent.d.ts +2 -2
- package/dist/src/compiler/compile-agent.js +2 -2
- package/dist/src/compiler/compile-from-memory.d.ts +13 -52
- package/dist/src/compiler/compile-from-memory.js +1 -1
- package/dist/src/compiler/diagnostics.d.ts +38 -0
- package/dist/src/compiler/diagnostics.js +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +14 -11
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/load-binding-namespace.d.ts +9 -0
- package/dist/src/compiler/load-binding-namespace.js +1 -0
- package/dist/src/compiler/manifest.d.ts +172 -51
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/module-map.d.ts +12 -30
- package/dist/src/compiler/module-map.js +3 -3
- package/dist/src/compiler/node-source-state.d.ts +24 -0
- package/dist/src/compiler/node-source-state.js +1 -0
- package/dist/src/compiler/normalize-agent-config.d.ts +5 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-channel.d.ts +8 -2
- package/dist/src/compiler/normalize-channel.js +1 -1
- package/dist/src/compiler/normalize-connection.d.ts +1 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-helpers.d.ts +13 -4
- package/dist/src/compiler/normalize-helpers.js +1 -1
- package/dist/src/compiler/normalize-hook.d.ts +4 -11
- package/dist/src/compiler/normalize-hook.js +1 -1
- package/dist/src/compiler/normalize-instructions.d.ts +3 -3
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.d.ts +29 -0
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -0
- package/dist/src/compiler/normalize-manifest.d.ts +8 -4
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-sandbox.d.ts +1 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/normalize-schedule.d.ts +2 -2
- package/dist/src/compiler/normalize-schedule.js +1 -1
- package/dist/src/compiler/normalize-skill.d.ts +2 -2
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +21 -39
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.d.ts +2 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/project-sources.d.ts +71 -0
- package/dist/src/compiler/project-sources.js +1 -0
- package/dist/src/compiler/remote-agent-node.d.ts +8 -0
- package/dist/src/compiler/remote-agent-node.js +1 -1
- package/dist/src/compiler/source-graph.d.ts +153 -0
- package/dist/src/compiler/source-graph.js +1 -0
- package/dist/src/compiler/validate-artifact.d.ts +17 -0
- package/dist/src/compiler/validate-artifact.js +1 -0
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/connections/errors.d.ts +125 -0
- package/dist/src/connections/errors.js +1 -0
- package/dist/src/context/build-base-tool-context.d.ts +2 -2
- package/dist/src/context/build-callback-context.d.ts +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-instruction-lifecycle.js +1 -1
- package/dist/src/context/dynamic-resolve-context.d.ts +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.d.ts +0 -2
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.d.ts +2 -2
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/key-names.d.ts +12 -0
- package/dist/src/context/key-names.js +1 -0
- package/dist/src/context/keys.d.ts +8 -1
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/providers/connection-key.d.ts +1 -1
- package/dist/src/context/providers/connection.d.ts +1 -1
- package/dist/src/context/session-context.d.ts +32 -0
- package/dist/src/discover/discover-agent.d.ts +0 -13
- package/dist/src/discover/discover-agent.js +1 -1
- package/dist/src/discover/discover-subagent.js +1 -1
- package/dist/src/discover/extensions.d.ts +0 -6
- package/dist/src/discover/extensions.js +1 -1
- package/dist/src/discover/manifest.d.ts +4 -1
- package/dist/src/discover/manifest.js +1 -1
- package/dist/src/dynamic/definition.d.ts +117 -0
- package/dist/src/dynamic/definition.js +1 -0
- package/dist/src/evals/autoevals-client.js +1 -1
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/match.d.ts +1 -1
- package/dist/src/evals/runner/reporters/console.js +1 -1
- package/dist/src/evals/session.d.ts +1 -1
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +1 -1
- package/dist/src/eve-channel/index.d.ts +12 -0
- package/dist/src/eve-channel/index.js +1 -0
- package/dist/src/eve-channel/request.d.ts +49 -0
- package/dist/src/eve-channel/request.js +3 -0
- package/dist/src/eve-channel/support.d.ts +34 -0
- package/dist/src/eve-channel/support.js +1 -0
- package/dist/src/eve-channel/types.d.ts +128 -0
- package/dist/src/eve-channel/types.js +1 -0
- package/dist/src/execution/agent-handle-dispatch.d.ts +1 -1
- package/dist/src/execution/agent-handle-dispatch.js +1 -1
- package/dist/src/execution/authorization-callback-match.d.ts +1 -1
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/compaction.js +1 -1
- package/dist/src/execution/connection-auth-tool-result.d.ts +1 -1
- package/dist/src/{runtime → execution}/connections/callback-route.d.ts +2 -20
- package/dist/src/execution/connections/callback-route.js +1 -0
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/delegated-parent-notification.d.ts +2 -2
- package/dist/src/execution/delegated-parent-notification.js +1 -1
- package/dist/src/execution/delegated-parent-result.d.ts +1 -1
- package/dist/src/execution/delegated-parent-result.js +1 -1
- package/dist/src/execution/delegation-tool.d.ts +1 -1
- package/dist/src/execution/delegation-tool.js +1 -1
- package/dist/src/execution/dispatch-action-failures.d.ts +1 -1
- package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +1 -2
- package/dist/src/execution/dispatch-runtime-actions-shared.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.d.ts +1 -1
- package/dist/src/execution/durable-session-migrations/turn-workflow.d.ts +1 -1
- package/dist/src/execution/durable-session-store.js +1 -1
- package/dist/src/execution/effective-output-schema.d.ts +2 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +6 -0
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/forward-turn-cancellation-step.js +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/remote-agent-dispatch.d.ts +10 -8
- package/dist/src/execution/remote-agent-dispatch.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/{bash-tool.d.ts → bash.d.ts} +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-credentials.js +1 -1
- package/dist/src/execution/sandbox/glob-tool.js +1 -1
- package/dist/src/execution/sandbox/grep-tool.js +1 -1
- package/dist/src/execution/sandbox/{read-file-tool.d.ts → read-file.d.ts} +2 -2
- package/dist/src/execution/sandbox/{read-file-tool.js → read-file.js} +1 -1
- package/dist/src/execution/sandbox/{write-file-tool.d.ts → write-file.d.ts} +2 -2
- package/dist/src/execution/sandbox/write-file.js +1 -0
- package/dist/src/execution/session-callback-route.d.ts +2 -0
- package/dist/src/execution/session-callback-route.js +1 -0
- package/dist/src/execution/session-callback-step.js +1 -1
- package/dist/src/execution/session-timeout-steps.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/subagent-adapter.js +1 -1
- package/dist/src/execution/subagent-hitl-proxy.d.ts +1 -1
- package/dist/src/execution/subagent-invocation.d.ts +0 -3
- package/dist/src/execution/subagent-invocation.js +1 -1
- package/dist/src/execution/subagent-start-local.d.ts +1 -2
- package/dist/src/execution/subagent-start-local.js +1 -1
- package/dist/src/execution/subagent-start-remote.d.ts +1 -2
- package/dist/src/execution/subagent-start-remote.js +1 -1
- package/dist/src/execution/subagent-tool.d.ts +4 -8
- package/dist/src/execution/subagent-tool.js +1 -1
- package/dist/src/execution/subagent-usage-span.d.ts +1 -1
- package/dist/src/execution/task-input-response-route.d.ts +2 -0
- package/dist/src/execution/task-input-response-route.js +1 -0
- package/dist/src/execution/tasks/child/instructions.js +1 -1
- package/dist/src/execution/tasks/child/update.d.ts +1 -1
- package/dist/src/execution/tasks/child/update.js +1 -1
- package/dist/src/execution/tasks/parent/continuation-dispatch.d.ts +1 -1
- package/dist/src/execution/tasks/parent/control-shared.d.ts +1 -1
- package/dist/src/execution/tasks/parent/delegate.d.ts +2 -2
- package/dist/src/execution/tasks/parent/delegate.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch-task-step.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch.d.ts +3 -1
- package/dist/src/execution/tasks/parent/dispatch.js +1 -1
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/terminate-child-sessions-step.d.ts +4 -5
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/tool-auth.d.ts +5 -6
- package/dist/src/execution/tool-auth.js +1 -1
- package/dist/src/execution/tools/connection-search.d.ts +1 -0
- package/dist/src/execution/tools/connection-search.js +2 -0
- package/dist/src/{runtime/framework-tools → execution/tools}/file-state.d.ts +2 -2
- package/dist/src/execution/tools/load-skill.d.ts +6 -0
- package/dist/src/execution/tools/load-skill.js +1 -0
- package/dist/src/{runtime/framework-tools → execution/tools}/subagent/local.d.ts +7 -7
- package/dist/src/execution/tools/subagent/local.js +1 -0
- package/dist/src/{runtime/framework-tools → execution/tools}/subagent/remote.d.ts +5 -5
- package/dist/src/execution/tools/subagent/remote.js +1 -0
- package/dist/src/execution/tools/tasks.d.ts +18 -0
- package/dist/src/execution/tools/tasks.js +1 -0
- package/dist/src/{runtime/framework-tools → execution/tools}/todo.d.ts +0 -2
- package/dist/src/{runtime/framework-tools → execution/tools}/todo.js +1 -2
- package/dist/src/execution/turn-control-protocol.js +1 -1
- package/dist/src/execution/web-fetch/request.js +1 -1
- package/dist/src/execution/wire/session-inbox-resume.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.v1.js +1 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/execution/workflow-trace-context.js +1 -1
- package/dist/src/framework/host-inventory.d.ts +8 -0
- package/dist/src/framework/host-inventory.js +1 -0
- package/dist/src/framework/sources/modules/agent.d.ts +4 -0
- package/dist/src/framework/sources/modules/agent.js +1 -0
- package/dist/src/framework/sources/modules/eve-channel.d.ts +1 -0
- package/dist/src/framework/sources/modules/eve-channel.js +1 -0
- package/dist/src/framework/sources/modules/home-channel.d.ts +2 -0
- package/dist/src/framework/sources/modules/home-channel.js +1 -0
- package/dist/src/framework/sources/modules/sandbox.d.ts +2 -0
- package/dist/src/framework/sources/modules/sandbox.js +1 -0
- package/dist/src/framework/sources/registry.d.ts +5 -0
- package/dist/src/framework/sources/registry.js +1 -0
- package/dist/src/harness/action-result-helpers.d.ts +1 -1
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/authorization.d.ts +3 -3
- package/dist/src/harness/background-tools.d.ts +2 -2
- package/dist/src/harness/channel-delivery-instrumentation.js +1 -1
- package/dist/src/harness/compaction.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +3 -3
- package/dist/src/{runtime/framework-tools → harness}/final-output.d.ts +1 -1
- package/dist/src/harness/final-output.js +1 -0
- package/dist/src/harness/handles/query.d.ts +1 -1
- package/dist/src/harness/handles/store.d.ts +8 -0
- package/dist/src/harness/handles/store.js +1 -1
- package/dist/src/harness/hitl/approval-input-requests.d.ts +1 -1
- package/dist/src/harness/hitl/approval-prompt.d.ts +1 -1
- package/dist/src/harness/hitl/pending-input-resolution.d.ts +2 -2
- package/dist/src/harness/hitl/question-input-requests.d.ts +1 -1
- package/dist/src/harness/input-extraction.d.ts +1 -1
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-request-class.d.ts +1 -1
- package/dist/src/harness/input-request-resolution.d.ts +1 -1
- package/dist/src/harness/input-requests.d.ts +2 -2
- package/dist/src/harness/instrumentation/lifecycle.d.ts +3 -0
- package/dist/src/harness/instrumentation/providers.js +1 -1
- package/dist/src/harness/instrumentation/runtime.d.ts +2 -1
- package/dist/src/harness/pending-input-batches.d.ts +1 -1
- package/dist/src/harness/prepare-trace-context.d.ts +3 -0
- package/dist/src/harness/prepare-trace-context.js +1 -1
- package/dist/src/harness/provider-safety.d.ts +7 -0
- package/dist/src/harness/provider-safety.js +1 -0
- package/dist/src/{runtime/framework-tools/web-search.d.ts → harness/provider-tool-schemas.d.ts} +1 -9
- package/dist/src/harness/provider-tool-schemas.js +1 -0
- package/dist/src/harness/provider-tools.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +1 -1
- package/dist/src/harness/request-input-tool.d.ts +4 -0
- package/dist/src/harness/request-input-tool.js +1 -0
- package/dist/src/harness/runtime-actions.d.ts +1 -1
- package/dist/src/harness/session-limit-continuation.d.ts +1 -1
- package/dist/src/harness/step-hooks.d.ts +2 -0
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/stream-actions.d.ts +1 -1
- package/dist/src/harness/subagent-depth.d.ts +1 -1
- package/dist/src/harness/tool-call-action.d.ts +1 -1
- package/dist/src/harness/tool-call-input-errors.d.ts +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tool-model-output.d.ts +1 -1
- package/dist/src/harness/tools.d.ts +1 -1
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/types.d.ts +3 -9
- package/dist/src/harness/workflow-runtime-action-state.d.ts +1 -1
- package/dist/src/harness/workflow-subagent-limit.d.ts +1 -1
- package/dist/src/instrumentation/provider.d.ts +117 -0
- package/dist/src/instrumentation/provider.js +1 -0
- package/dist/src/internal/application/compiled-artifacts.js +5 -4
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/approval.d.ts +1 -1
- package/dist/src/internal/authored-definition/connection.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +6 -3
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-definition/source-identity.d.ts +17 -0
- package/dist/src/internal/authored-definition/source-identity.js +1 -0
- package/dist/src/internal/authored-module-map-loader.d.ts +1 -5
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/invocation/agent-invocation.d.ts +2 -2
- package/dist/src/internal/invocation/workflow-execution.d.ts +1 -1
- package/dist/src/internal/invocation/workflow-execution.js +1 -1
- package/dist/src/internal/materialized-authored-modules.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/host/application-route-registry.d.ts +2 -41
- package/dist/src/internal/nitro/host/application-route-registry.js +1 -1
- package/dist/src/internal/nitro/host/build-extension.js +1 -1
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +3 -4
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/extension-capability-requirements.d.ts +2 -0
- package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/start-production-server.js +3 -3
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +9 -215
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.d.ts +2 -13
- package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.js +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/internal/nitro/routes/channel-route-context.d.ts +5 -0
- package/dist/src/internal/nitro/routes/channel-route-context.js +1 -1
- package/dist/src/internal/nitro/routes/index.d.ts +0 -9
- package/dist/src/internal/nitro/routes/index.js +1 -1
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/internal/nitro/routes/runtime-stack.d.ts +5 -5
- package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
- package/dist/src/internal/programmatic-source-loader.d.ts +1 -0
- package/dist/src/internal/programmatic-source-loader.js +1 -0
- package/dist/src/internal/runtime-registry.d.ts +3 -4
- package/dist/src/protocol/message.d.ts +3 -3
- package/dist/src/protocol/routes.d.ts +2 -0
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/public/agents/auth.d.ts +10 -6
- package/dist/src/public/agents/auth.js +1 -1
- package/dist/src/public/channels/auth.d.ts +1 -1
- package/dist/src/public/channels/auth.js +1 -1
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/discord/hitl.d.ts +1 -1
- package/dist/src/public/channels/discord/hitl.js +1 -1
- package/dist/src/public/channels/discord/inbound.d.ts +1 -0
- package/dist/src/public/channels/discord/inbound.js +1 -1
- package/dist/src/public/channels/eve.d.ts +1 -139
- package/dist/src/public/channels/eve.js +1 -3
- package/dist/src/public/channels/github/dispatch.d.ts +5 -0
- package/dist/src/public/channels/github/dispatch.js +1 -1
- package/dist/src/public/channels/github/githubChannel.js +1 -1
- package/dist/src/public/channels/github/inbound.d.ts +2 -0
- package/dist/src/public/channels/github/inbound.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/index.js +1 -1
- package/dist/src/public/channels/linear/hitl.d.ts +1 -1
- package/dist/src/public/channels/linear/inbound.js +1 -1
- package/dist/src/public/channels/mcp.js +1 -1
- package/dist/src/public/channels/slack/action-status.d.ts +1 -1
- package/dist/src/public/channels/slack/hitl.d.ts +1 -1
- package/dist/src/public/channels/slack/hitl.js +1 -1
- package/dist/src/public/channels/slack/inbound.d.ts +9 -0
- package/dist/src/public/channels/slack/inbound.js +1 -1
- package/dist/src/public/channels/slack/interactions.js +1 -1
- package/dist/src/public/channels/slack/model-context.d.ts +3 -1
- package/dist/src/public/channels/slack/model-context.js +2 -2
- package/dist/src/public/channels/slack/session-operations.d.ts +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +1 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/hitl.d.ts +1 -1
- package/dist/src/public/channels/teams/hitl.js +1 -1
- package/dist/src/public/channels/teams/inbound.d.ts +2 -0
- package/dist/src/public/channels/teams/inbound.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/teams/verify.js +1 -1
- package/dist/src/public/channels/telegram/api.d.ts +15 -0
- package/dist/src/public/channels/telegram/api.js +2 -2
- package/dist/src/public/channels/telegram/authorization-callback.d.ts +10 -0
- package/dist/src/public/channels/telegram/authorization-callback.js +1 -0
- package/dist/src/public/channels/telegram/authorization.d.ts +19 -0
- package/dist/src/public/channels/telegram/authorization.js +3 -0
- package/dist/src/public/channels/telegram/defaults.d.ts +1 -0
- package/dist/src/public/channels/telegram/defaults.js +3 -3
- package/dist/src/public/channels/telegram/hitl.d.ts +1 -1
- package/dist/src/public/channels/telegram/hitl.js +1 -1
- package/dist/src/public/channels/telegram/inbound.d.ts +1 -0
- package/dist/src/public/channels/telegram/inbound.js +1 -1
- package/dist/src/public/channels/telegram/index.d.ts +1 -1
- package/dist/src/public/channels/telegram/index.js +1 -1
- package/dist/src/public/channels/telegram/state.d.ts +6 -0
- package/dist/src/public/channels/telegram/state.js +1 -0
- package/dist/src/public/channels/telegram/telegramChannel.d.ts +11 -0
- package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
- package/dist/src/public/connections/errors.d.ts +1 -125
- package/dist/src/public/connections/errors.js +1 -1
- package/dist/src/public/connections/index.d.ts +2 -2
- package/dist/src/public/connections/index.js +1 -1
- package/dist/src/public/definitions/agent.d.ts +1 -1
- package/dist/src/public/definitions/agent.js +1 -1
- package/dist/src/public/definitions/approval.d.ts +2 -84
- package/dist/src/public/definitions/approval.js +1 -1
- package/dist/src/public/definitions/callback-context.d.ts +1 -32
- package/dist/src/public/definitions/connections/mcp.d.ts +1 -1
- package/dist/src/public/definitions/connections/mcp.js +1 -1
- package/dist/src/public/definitions/connections/openapi.d.ts +1 -1
- package/dist/src/public/definitions/connections/openapi.js +1 -1
- package/dist/src/public/definitions/connections/protocol.d.ts +1 -1
- package/dist/src/public/definitions/instructions.d.ts +2 -2
- package/dist/src/public/definitions/instructions.js +1 -1
- package/dist/src/public/definitions/skill.js +1 -1
- package/dist/src/public/index.d.ts +1 -1
- package/dist/src/public/instructions/index.d.ts +1 -1
- package/dist/src/public/instrumentation/provider.d.ts +1 -117
- package/dist/src/public/instrumentation/provider.js +1 -1
- package/dist/src/public/models/openai/chatgpt/auth.js +1 -1
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/nuxt/dev-server.js +1 -1
- package/dist/src/public/sandbox/backends/default.d.ts +1 -49
- package/dist/src/public/sandbox/backends/default.js +1 -1
- package/dist/src/public/sandbox/backends/docker.d.ts +1 -14
- package/dist/src/public/sandbox/backends/docker.js +1 -1
- package/dist/src/public/sandbox/backends/just-bash.d.ts +1 -17
- package/dist/src/public/sandbox/backends/just-bash.js +1 -1
- package/dist/src/public/sandbox/backends/microsandbox.d.ts +1 -17
- package/dist/src/public/sandbox/backends/microsandbox.js +1 -1
- package/dist/src/public/sandbox/backends/vercel.d.ts +1 -30
- package/dist/src/public/sandbox/backends/vercel.js +1 -1
- package/dist/src/public/skills/index.d.ts +3 -3
- package/dist/src/public/skills/index.js +1 -1
- package/dist/src/public/sveltekit/dev-server.js +1 -1
- package/dist/src/public/tools/approval/index.d.ts +2 -2
- package/dist/src/public/tools/approval/index.js +1 -1
- package/dist/src/public/tools/bash.d.ts +3 -0
- package/dist/src/public/tools/bash.js +1 -0
- package/dist/src/public/tools/glob.d.ts +3 -0
- package/dist/src/public/tools/glob.js +1 -0
- package/dist/src/public/tools/grep.d.ts +3 -0
- package/dist/src/public/tools/grep.js +1 -0
- package/dist/src/public/tools/index.d.ts +6 -11
- package/dist/src/public/tools/index.js +1 -1
- package/dist/src/public/tools/load-skill.d.ts +3 -0
- package/dist/src/public/tools/load-skill.js +1 -0
- package/dist/src/public/tools/read-file.d.ts +3 -0
- package/dist/src/public/tools/read-file.js +1 -0
- package/dist/src/public/{tool-result-narrowing.d.ts → tools/result.d.ts} +2 -28
- package/dist/src/public/tools/result.js +1 -0
- package/dist/src/public/tools/sleep.d.ts +1 -0
- package/dist/src/public/tools/sleep.js +1 -0
- package/dist/src/public/tools/todo.d.ts +3 -0
- package/dist/src/public/tools/todo.js +1 -0
- package/dist/src/public/tools/web-fetch.d.ts +3 -0
- package/dist/src/public/tools/web-fetch.js +1 -0
- package/dist/src/public/tools/web-search.d.ts +3 -36
- package/dist/src/public/tools/web-search.js +1 -1
- package/dist/src/public/tools/workflow.d.ts +4 -0
- package/dist/src/public/tools/workflow.js +1 -0
- package/dist/src/public/tools/write-file.d.ts +3 -0
- package/dist/src/public/tools/write-file.js +1 -0
- package/dist/src/public/types/json.d.ts +1 -28
- package/dist/src/react/use-eve-agent.d.ts +1 -0
- package/dist/src/react/use-eve-agent.js +1 -1
- package/dist/src/runtime/actions/keys.d.ts +1 -1
- package/dist/src/runtime/actions/results.d.ts +1 -1
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/connections/authorization-tokens.d.ts +1 -1
- package/dist/src/runtime/connections/mcp-client.d.ts +1 -1
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/openapi-client.d.ts +1 -1
- package/dist/src/runtime/connections/openapi-client.js +1 -1
- package/dist/src/runtime/connections/principal.d.ts +1 -1
- package/dist/src/runtime/connections/principal.js +1 -1
- package/dist/src/runtime/connections/registry-types.d.ts +11 -0
- package/dist/src/runtime/connections/registry.d.ts +3 -2
- package/dist/src/runtime/connections/resolve-authorization.d.ts +2 -2
- package/dist/src/runtime/connections/resolve-authorization.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.d.ts +2 -2
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/loaders/compile-metadata.js +1 -1
- package/dist/src/runtime/loaders/manifest.js +1 -1
- package/dist/src/runtime/prompt/compose.d.ts +0 -6
- package/dist/src/runtime/prompt/compose.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-connection.js +1 -1
- package/dist/src/runtime/resolve-dynamic-tool.js +1 -1
- package/dist/src/runtime/resolve-tool.d.ts +2 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/sandbox/keys.js +1 -1
- package/dist/src/runtime/sandbox/registry.d.ts +4 -20
- package/dist/src/runtime/sandbox/registry.js +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
- package/dist/src/runtime/sessions/runtime-context-keys.js +1 -1
- package/dist/src/runtime/sessions/turn.d.ts +3 -1
- package/dist/src/runtime/skills/sandbox-access.d.ts +1 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
- package/dist/src/runtime/subagents/registry.d.ts +0 -27
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +11 -27
- package/dist/src/sandbox/backends/default.d.ts +49 -0
- package/dist/src/sandbox/backends/default.js +1 -0
- package/dist/src/sandbox/backends/docker.d.ts +14 -0
- package/dist/src/sandbox/backends/docker.js +1 -0
- package/dist/src/sandbox/backends/just-bash.d.ts +17 -0
- package/dist/src/sandbox/backends/just-bash.js +1 -0
- package/dist/src/sandbox/backends/microsandbox.d.ts +17 -0
- package/dist/src/sandbox/backends/microsandbox.js +1 -0
- package/dist/src/sandbox/backends/vercel.d.ts +30 -0
- package/dist/src/sandbox/backends/vercel.js +1 -0
- package/dist/src/services/dev-client/runtime-artifacts.d.ts +2 -0
- package/dist/src/services/dev-client/runtime-artifacts.js +1 -1
- package/dist/src/services/dev-client.d.ts +1 -1
- package/dist/src/setup/channel-add-conflicts.js +1 -1
- package/dist/src/setup/cli/select-component.js +1 -1
- package/dist/src/setup/flows/link.js +1 -1
- package/dist/src/setup/flows/model-source-change.js +1 -1
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/registry.js +1 -1
- package/dist/src/setup/integrations/runner.js +1 -1
- package/dist/src/setup/prompter.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/scaffold/create/web-template.d.ts +8 -8
- package/dist/src/setup/scaffold/create/web-template.js +336 -120
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/setup/scaffold/update/connections.js +1 -1
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/{runtime/actions/types.d.ts → shared/action-types.d.ts} +12 -12
- package/dist/src/{runtime/actions/types.js → shared/action-types.js} +1 -1
- package/dist/src/shared/agent-definition.d.ts +3 -10
- package/dist/src/shared/agent-definition.js +1 -1
- package/dist/src/{runtime/connections/types.d.ts → shared/connection-types.d.ts} +3 -13
- package/dist/src/{runtime/input/types.d.ts → shared/input.d.ts} +1 -1
- package/dist/src/shared/input.js +1 -0
- package/dist/src/shared/instructions-definition.d.ts +2 -0
- package/dist/src/shared/instructions-definition.js +1 -1
- package/dist/src/shared/objects.d.ts +5 -0
- package/dist/src/shared/objects.js +1 -0
- package/dist/src/shared/sandbox-definition.d.ts +1 -1
- package/dist/src/shared/skill-definition.d.ts +2 -0
- package/dist/src/shared/skill-definition.js +1 -1
- package/dist/src/{execution/skills/types.d.ts → shared/skill-types.d.ts} +1 -1
- package/dist/src/shared/skill-types.js +1 -0
- package/dist/src/{runtime/connections → shared}/validate-authorization.d.ts +1 -1
- package/dist/src/shared/vercel-project.d.ts +1 -0
- package/dist/src/shared/vercel-project.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.d.ts +8 -4
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/json.d.ts +4 -89
- package/dist/src/tasks/json.js +1 -1
- package/dist/src/tasks/session-index.d.ts +1 -1
- package/dist/src/tasks/task-id.d.ts +0 -1
- package/dist/src/tasks/task-id.js +1 -1
- package/dist/src/tasks/types.d.ts +1 -1
- package/dist/src/tasks/types.js +1 -1
- package/dist/src/{public/tools/approval/approval-helpers.d.ts → tools/approval/policies.d.ts} +1 -1
- package/dist/src/tools/approval/policies.js +1 -0
- package/dist/src/tools/auth.d.ts +35 -0
- package/dist/src/tools/auth.js +1 -0
- package/dist/src/{public/definitions/tool.d.ts → tools/definition.d.ts} +42 -138
- package/dist/src/tools/definition.js +1 -0
- package/dist/src/{shared/durable-dynamic-tool-callbacks.d.ts → tools/durable-callbacks.d.ts} +1 -1
- package/dist/src/tools/durable-callbacks.js +1 -0
- package/dist/src/tools/dynamic.d.ts +68 -0
- package/dist/src/tools/dynamic.js +1 -0
- package/dist/src/tools/framework/agent-contract.d.ts +8 -0
- package/dist/src/tools/framework/agent-contract.js +1 -0
- package/dist/src/tools/framework/agent.d.ts +17 -0
- package/dist/src/tools/framework/agent.js +1 -0
- package/dist/src/tools/framework/ask-question.d.ts +50 -0
- package/dist/src/tools/framework/ask-question.js +1 -0
- package/dist/src/tools/framework/connection-search.d.ts +3 -0
- package/dist/src/tools/framework/connection-search.js +1 -0
- package/dist/src/tools/framework/task-cancel.d.ts +29 -0
- package/dist/src/tools/framework/task-cancel.js +1 -0
- package/dist/src/tools/framework/task-contract.d.ts +167 -0
- package/dist/src/tools/framework/task-contract.js +1 -0
- package/dist/src/tools/framework/task-update.d.ts +9 -0
- package/dist/src/tools/framework/task-update.js +1 -0
- package/dist/src/{public/tools/output-builders.d.ts → tools/model-output.d.ts} +41 -1
- package/dist/src/tools/provided/bash.d.ts +29 -0
- package/dist/src/tools/provided/bash.js +1 -0
- package/dist/src/tools/provided/glob.d.ts +26 -0
- package/dist/src/tools/provided/glob.js +2 -0
- package/dist/src/{runtime/framework-tools → tools/provided}/grep.d.ts +10 -10
- package/dist/src/tools/provided/grep.js +2 -0
- package/dist/src/tools/provided/load-skill.d.ts +2 -0
- package/dist/src/tools/provided/load-skill.js +1 -0
- package/dist/src/tools/provided/read-file.d.ts +27 -0
- package/dist/src/tools/provided/read-file.js +2 -0
- package/dist/src/{public/tools/sleep/index.d.ts → tools/provided/sleep.d.ts} +3 -3
- package/dist/src/tools/provided/sleep.js +1 -0
- package/dist/src/tools/provided/todo.d.ts +8 -0
- package/dist/src/tools/provided/todo.js +2 -0
- package/dist/src/{runtime/framework-tools → tools/provided}/web-fetch.d.ts +5 -2
- package/dist/src/tools/provided/web-fetch.js +2 -0
- package/dist/src/tools/provided/web-search.d.ts +39 -0
- package/dist/src/tools/provided/web-search.js +1 -0
- package/dist/src/tools/provided/write-file.d.ts +23 -0
- package/dist/src/tools/provided/write-file.js +2 -0
- package/dist/src/tools/workflow.d.ts +37 -0
- package/dist/src/tools/workflow.js +1 -0
- package/dist/src/tracing/agent-action-instrumentation.js +1 -1
- package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
- package/dist/src/tracing/agent-channel-delivery-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-session-context.d.ts +1 -1
- package/dist/src/tracing/agent-otel-session-context.js +1 -1
- package/dist/src/tracing/agent-span-id-generator.d.ts +1 -0
- package/dist/src/tracing/agent-span-id-generator.js +1 -1
- package/dist/src/tracing/agent-trace-context-store.d.ts +1 -1
- package/dist/src/tracing/agent-trace-context-store.js +1 -1
- package/dist/src/tracing/agent-trace-span-processor.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +2 -6
- package/dist/src/tracing/agent-trace-state.js +1 -1
- package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/local-trace-reader.d.ts +1 -3
- package/dist/src/tracing/local-trace-reader.js +1 -1
- package/dist/src/tracing/otel-declaration.d.ts +1 -2
- package/dist/src/tracing/otel-registration.js +1 -1
- package/dist/src/tracing/sampled-trace.d.ts +10 -2
- package/dist/src/tracing/sampled-trace.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.d.ts +8 -4
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +16 -4
- package/docs/channels/chat-sdk.mdx +1 -1
- package/docs/channels/discord.mdx +5 -1
- package/docs/channels/eve.mdx +19 -3
- package/docs/channels/github.mdx +2 -0
- package/docs/channels/linear.mdx +1 -1
- package/docs/channels/overview.mdx +1 -1
- package/docs/channels/slack.mdx +2 -0
- package/docs/channels/teams.mdx +1 -1
- package/docs/channels/telegram.mdx +2 -0
- package/docs/concepts/built-in-tools.md +30 -21
- package/docs/concepts/sessions-runs-and-streaming.md +3 -1
- package/docs/connections/overview.mdx +1 -1
- package/docs/extensions.md +2 -2
- package/docs/getting-started.mdx +9 -9
- package/docs/guides/auth-and-route-protection.md +3 -3
- package/docs/guides/client/output-schema.mdx +2 -2
- package/docs/guides/client/overview.mdx +4 -2
- package/docs/guides/frontend/nuxt.mdx +4 -3
- package/docs/guides/frontend/overview.mdx +21 -18
- package/docs/guides/frontend/sveltekit.mdx +4 -3
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +5 -4
- package/docs/guides/frontend/use-eve-agent-vue.mdx +5 -4
- package/docs/guides/instrumentation.md +1 -0
- package/docs/guides/remote-agents.md +37 -18
- package/docs/patterns/multi-tenant-approvals.md +1 -1
- package/docs/reference/cli.md +2 -4
- package/docs/reference/typescript-api.md +35 -31
- package/docs/sandbox.mdx +1 -1
- package/docs/subagents/index.mdx +11 -28
- package/docs/tools/human-in-the-loop.md +43 -2
- package/docs/tools/overview.mdx +1 -1
- package/package.json +58 -8
- package/dist/src/compiler/normalize-extension.d.ts +0 -80
- package/dist/src/compiler/normalize-extension.js +0 -1
- package/dist/src/execution/sandbox/write-file-tool.js +0 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.d.ts +0 -9
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +0 -1
- package/dist/src/internal/nitro/routes/health.d.ts +0 -14
- package/dist/src/internal/nitro/routes/health.js +0 -1
- package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +0 -1
- package/dist/src/public/definitions/tool.js +0 -1
- package/dist/src/public/tool-result-narrowing.js +0 -1
- package/dist/src/public/tools/approval/approval-helpers.js +0 -1
- package/dist/src/public/tools/defaults.d.ts +0 -46
- package/dist/src/public/tools/defaults.js +0 -1
- package/dist/src/public/tools/define-bash-tool.d.ts +0 -21
- package/dist/src/public/tools/define-bash-tool.js +0 -1
- package/dist/src/public/tools/define-glob-tool.d.ts +0 -22
- package/dist/src/public/tools/define-glob-tool.js +0 -1
- package/dist/src/public/tools/define-grep-tool.d.ts +0 -22
- package/dist/src/public/tools/define-grep-tool.js +0 -1
- package/dist/src/public/tools/define-read-file-tool.d.ts +0 -21
- package/dist/src/public/tools/define-read-file-tool.js +0 -1
- package/dist/src/public/tools/define-write-file-tool.d.ts +0 -22
- package/dist/src/public/tools/define-write-file-tool.js +0 -1
- package/dist/src/public/tools/internal.d.ts +0 -13
- package/dist/src/public/tools/internal.js +0 -1
- package/dist/src/public/tools/sleep/index.js +0 -1
- package/dist/src/runtime/connections/callback-route.js +0 -1
- package/dist/src/runtime/framework-channels/index.d.ts +0 -6
- package/dist/src/runtime/framework-channels/index.js +0 -1
- package/dist/src/runtime/framework-tools/agent.d.ts +0 -29
- package/dist/src/runtime/framework-tools/agent.js +0 -1
- package/dist/src/runtime/framework-tools/ask-question.d.ts +0 -35
- package/dist/src/runtime/framework-tools/ask-question.js +0 -1
- package/dist/src/runtime/framework-tools/bash.d.ts +0 -24
- package/dist/src/runtime/framework-tools/bash.js +0 -1
- package/dist/src/runtime/framework-tools/connection-search-dynamic.d.ts +0 -19
- package/dist/src/runtime/framework-tools/connection-search-dynamic.js +0 -2
- package/dist/src/runtime/framework-tools/final-output.js +0 -1
- package/dist/src/runtime/framework-tools/glob.d.ts +0 -26
- package/dist/src/runtime/framework-tools/glob.js +0 -2
- package/dist/src/runtime/framework-tools/grep.js +0 -2
- package/dist/src/runtime/framework-tools/index.d.ts +0 -39
- package/dist/src/runtime/framework-tools/index.js +0 -1
- package/dist/src/runtime/framework-tools/read-file.d.ts +0 -27
- package/dist/src/runtime/framework-tools/read-file.js +0 -2
- package/dist/src/runtime/framework-tools/skill.d.ts +0 -12
- package/dist/src/runtime/framework-tools/skill.js +0 -1
- package/dist/src/runtime/framework-tools/subagent/local.js +0 -1
- package/dist/src/runtime/framework-tools/subagent/remote.js +0 -1
- package/dist/src/runtime/framework-tools/tasks.d.ts +0 -91
- package/dist/src/runtime/framework-tools/tasks.js +0 -1
- package/dist/src/runtime/framework-tools/web-fetch.js +0 -2
- package/dist/src/runtime/framework-tools/web-search.js +0 -1
- package/dist/src/runtime/framework-tools/write-file.d.ts +0 -23
- package/dist/src/runtime/framework-tools/write-file.js +0 -2
- package/dist/src/runtime/governance/auth/jwt-ecdsa.js +0 -1
- package/dist/src/runtime/governance/auth/jwt-hmac.js +0 -1
- package/dist/src/runtime/governance/auth/oidc.js +0 -1
- package/dist/src/runtime/input/types.js +0 -1
- package/dist/src/runtime/session-callback-route.d.ts +0 -6
- package/dist/src/runtime/session-callback-route.js +0 -1
- package/dist/src/runtime/task-input-response-route.d.ts +0 -5
- package/dist/src/runtime/task-input-response-route.js +0 -1
- package/dist/src/shared/durable-dynamic-tool-callbacks.js +0 -1
- package/dist/src/shared/dynamic-tool-definition.d.ts +0 -154
- package/dist/src/shared/dynamic-tool-definition.js +0 -1
- package/dist/src/shared/eve-server-health.d.ts +0 -5
- package/dist/src/shared/eve-server-health.js +0 -1
- package/dist/src/shared/tool-definition.d.ts +0 -89
- /package/dist/src/{runtime/governance → channel}/auth/http-basic.js +0 -0
- /package/dist/src/{runtime/governance → channel}/auth/token-claims.js +0 -0
- /package/dist/src/{runtime/governance → channel}/auth/types.js +0 -0
- /package/dist/src/{runtime/governance → channel}/auth/vercel-oidc-project.js +0 -0
- /package/dist/src/{runtime/governance/network → channel}/ip-allow-list.d.ts +0 -0
- /package/dist/src/{runtime/governance/network → channel}/ip-allow-list.js +0 -0
- /package/dist/src/{execution/skills/types.js → context/session-context.js} +0 -0
- /package/dist/src/execution/sandbox/{bash-tool.js → bash.js} +0 -0
- /package/dist/src/{runtime/framework-tools → execution/tools}/file-state.js +0 -0
- /package/dist/src/{runtime/framework-tools → execution/tools}/sleep.d.ts +0 -0
- /package/dist/src/{runtime/framework-tools → execution/tools}/sleep.js +0 -0
- /package/dist/src/execution/web-fetch/{tool.d.ts → execute.d.ts} +0 -0
- /package/dist/src/execution/web-fetch/{tool.js → execute.js} +0 -0
- /package/dist/src/{shared/tool-definition.js → runtime/connections/registry-types.js} +0 -0
- /package/dist/src/{runtime/connections/types.js → shared/connection-types.js} +0 -0
- /package/dist/src/{runtime/sessions/auth.d.ts → shared/session-auth.d.ts} +0 -0
- /package/dist/src/{runtime/sessions/auth.js → shared/session-auth.js} +0 -0
- /package/dist/src/{runtime/connections → shared}/validate-authorization.js +0 -0
- /package/dist/src/{public/tools/output-builders.js → tools/model-output.js} +0 -0
- /package/dist/src/{shared/tool-schema.d.ts → tools/schema.d.ts} +0 -0
- /package/dist/src/{shared/tool-schema.js → tools/schema.js} +0 -0
- /package/dist/src/{shared/tool-task.d.ts → tools/task.d.ts} +0 -0
- /package/dist/src/{shared/tool-task.js → tools/task.js} +0 -0
|
@@ -1,39 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* Recursive: each subagent may itself declare further subagents, which
|
|
23
|
-
* are compiled depth-first via the injected `compileAgentNodeManifest`
|
|
24
|
-
* callback.
|
|
25
|
-
*/
|
|
26
|
-
export declare function compileSubagentGraph(input: {
|
|
27
|
-
readonly appRoot: string;
|
|
28
|
-
readonly compileAgentNodeManifest: CompileAgentNodeManifestFn;
|
|
29
|
-
readonly compileAgentResources: CompileAgentResourcesFn;
|
|
30
|
-
readonly context: ManifestCompileContext;
|
|
31
|
-
readonly externalDependencies?: readonly string[];
|
|
32
|
-
readonly parentAgentRoot: string;
|
|
33
|
-
readonly parentNodeId: string;
|
|
34
|
-
readonly subagents: readonly LocalSubagentSourceRef[];
|
|
35
|
-
}): Promise<{
|
|
36
|
-
readonly edges: readonly CompiledSubagentEdge[];
|
|
37
|
-
readonly nodes: readonly CompiledSubagentNode[];
|
|
38
|
-
readonly remoteAgents: readonly CompiledRemoteAgentNode[];
|
|
39
|
-
}>;
|
|
1
|
+
import type { JsonObject } from "#shared/json.js";
|
|
2
|
+
import { type DynamicToolEventName } from "#dynamic/definition.js";
|
|
3
|
+
import type { LocalSubagentSourceRef } from "#discover/manifest.js";
|
|
4
|
+
export type NormalizedSubagentConfig = {
|
|
5
|
+
readonly kind: "local";
|
|
6
|
+
readonly definition: unknown;
|
|
7
|
+
} | {
|
|
8
|
+
readonly build?: {
|
|
9
|
+
readonly externalDependencies?: readonly string[];
|
|
10
|
+
};
|
|
11
|
+
readonly eventNames: readonly DynamicToolEventName[];
|
|
12
|
+
readonly kind: "dynamic";
|
|
13
|
+
} | {
|
|
14
|
+
readonly description: string;
|
|
15
|
+
readonly kind: "remote";
|
|
16
|
+
readonly outputSchema?: JsonObject;
|
|
17
|
+
readonly path: string;
|
|
18
|
+
readonly url?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function normalizeSubagentConfig(value: unknown, message: string): NormalizedSubagentConfig;
|
|
21
|
+
export declare function assertRemoteAgentDefinitionHasNoLocalPackageEntries(source: LocalSubagentSourceRef): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectString}from"#internal/authored-module.js";import{EVE_SESSION_ROUTE_PATH}from"#protocol/routes.js";import{
|
|
1
|
+
import{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectString}from"#internal/authored-module.js";import{EVE_SESSION_ROUTE_PATH}from"#protocol/routes.js";import{serializeOutputSchema}from"#tools/schema.js";import{isDynamicSentinel}from"#dynamic/definition.js";const ALLOWED_DYNAMIC_SUBAGENT_EVENTS=new Set([`session.started`,`turn.started`]);function normalizeSubagentConfig(s,c){if(isDynamicSentinel(s)){let e=expectObjectRecord(s,c);expectOnlyKnownKeys(e,[`build`,`events`,`kind`],c);let r=expectObjectRecord(e.events,c),i=[];for(let[e,n]of Object.entries(r)){if(!ALLOWED_DYNAMIC_SUBAGENT_EVENTS.has(e))throw Error(`${c} Dynamic subagents support only "session.started" and "turn.started" handlers.`);expectFunction(n,c),i.push(e)}let a=e.build===void 0?void 0:normalizeDynamicSubagentBuild(e.build,c);return a===void 0?{eventNames:i,kind:`dynamic`}:{build:a,eventNames:i,kind:`dynamic`}}if(typeof s==`object`&&s&&s.kind===`remote`){let t=expectObjectRecord(s,c);expectOnlyKnownKeys(t,[`auth`,`description`,`forwardPrincipal`,`headers`,`kind`,`outputSchema`,`path`,`url`],c),t.forwardPrincipal!==void 0&&expectBoolean(t.forwardPrincipal,`${c} Expected "forwardPrincipal" to be a boolean.`);let o=serializeOutputSchema(t.outputSchema);return{description:expectString(t.description,c),kind:`remote`,outputSchema:o,path:t.path===void 0?EVE_SESSION_ROUTE_PATH:expectString(t.path,c),url:typeof t.url==`function`?void 0:expectString(t.url,c)}}return{definition:s,kind:`local`}}function assertRemoteAgentDefinitionHasNoLocalPackageEntries(e){let t=e.manifest,n=[t.connections.length>0?`connections/`:void 0,t.hooks.length>0?`hooks/`:void 0,t.instructions.length>0?`instructions`:void 0,t.lib.length>0?`lib/`:void 0,t.sandbox===null?void 0:`sandbox/`,t.sandboxWorkspaces.length>0?`sandbox/workspace/`:void 0,t.schedules.length>0?`schedules/`:void 0,t.skills.length>0?`skills/`:void 0,t.subagents.length>0?`subagents/`:void 0,t.tools.length>0?`tools/`:void 0].filter(e=>e!==void 0);if(n.length>0)throw Error(`Remote subagent definition "${e.logicalPath}" cannot include local package entries. Remove unsupported entries: ${n.join(`, `)}.`)}function normalizeDynamicSubagentBuild(e,t){let i=expectObjectRecord(e,t);if(expectOnlyKnownKeys(i,[`externalDependencies`],t),i.externalDependencies===void 0)return{};if(!Array.isArray(i.externalDependencies))throw Error(t);return{externalDependencies:i.externalDependencies.map(e=>expectString(e,t))}}export{assertRemoteAgentDefinitionHasNoLocalPackageEntries,normalizeSubagentConfig};
|
|
@@ -18,6 +18,7 @@ export type CompiledToolEntry = {
|
|
|
18
18
|
readonly kind: "workflow-tool";
|
|
19
19
|
readonly maxSubagents?: number;
|
|
20
20
|
} | {
|
|
21
|
+
readonly definition: CompiledToolDefinition;
|
|
21
22
|
readonly kind: "web-search-tool";
|
|
22
23
|
readonly provider: "exa" | "parallel";
|
|
23
24
|
} | {
|
|
@@ -36,4 +37,4 @@ export type CompiledToolEntry = {
|
|
|
36
37
|
* directories into a slug-safe single segment. Authored `name` fields
|
|
37
38
|
* are rejected by the normalizer.
|
|
38
39
|
*/
|
|
39
|
-
export declare function compileToolEntry(
|
|
40
|
+
export declare function compileToolEntry(_agentRoot: string, source: ToolSourceRef, options: ModuleBackedDefinitionLoadOptions): Promise<CompiledToolEntry>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{stripLogicalPathExtension}from"#discover/filesystem.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{normalizeToolDefinition}from"#internal/authored-definition/schema-backed.js";async function compileToolEntry(e,t,n
|
|
1
|
+
import{stripLogicalPathExtension}from"#discover/filesystem.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{normalizeToolDefinition}from"#internal/authored-definition/schema-backed.js";async function compileToolEntry(e,t,n){let r=normalizeToolDefinition(await loadModuleBackedDefinition({binding:n.binding,kind:`tool`,loadNamespace:n.loadNamespace,source:t}),`Expected the tool export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public eve shape.`),i=stripLogicalPathExtension(t.logicalPath).replace(/^tools\//,``).replaceAll(`/`,`-`);if(r.kind===`disabled`)return{kind:`disabled`,name:i};if(r.kind===`workflow-tool`)return{kind:`workflow-tool`,maxSubagents:r.maxSubagents};if(r.kind===`web-search-tool`){if(i!==`web_search`)throw Error(`The webSearch() definition must be exported from "tools/web_search.ts", not "${t.logicalPath}".`);return{definition:{description:`Search the web for real-time information. Use this to find up-to-date information about current events, recent developments, or topics that may have changed since the knowledge cutoff.`,exportName:t.exportName,hasExecute:!1,hasModelOutputProjection:!1,inputSchema:null,logicalPath:t.logicalPath,name:i,sourceId:t.sourceId,sourceKind:`module`,requiresApproval:!1},kind:`web-search-tool`,provider:r.provider}}return r.kind===`dynamic-tool`?{kind:`dynamic-tool`,definition:{eventNames:[...r.eventNames],exportName:t.exportName,logicalPath:t.logicalPath,slug:i,sourceId:t.sourceId,sourceKind:`module`}}:{kind:`tool`,definition:{description:r.definition.description,execution:r.definition.execution,exportName:t.exportName,hasExecute:!0,hasModelOutputProjection:r.definition.hasModelOutputProjection,inputSchema:r.definition.inputSchema??null,logicalPath:t.logicalPath,name:i,outputSchema:r.definition.outputSchema,requiresApproval:r.definition.hasApproval,sourceId:t.sourceId,sourceKind:`module`}}}export{compileToolEntry};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { AgentSourceManifest, ConnectionSourceRef, InstructionsSourceRef, LocalSubagentSourceRef, ResolvedExtensionMount, ScheduleSourceRef, SkillSourceRef } from "#discover/manifest.js";
|
|
2
|
+
import type { ModuleSourceRef } from "#shared/source-ref.js";
|
|
3
|
+
import type { AgentModuleCandidate, AgentResourceCandidate, AgentSourceCandidate, AgentSourceLayer, AgentSourceOwner } from "#compiler/source-graph.js";
|
|
4
|
+
export type ProjectedModuleSource = {
|
|
5
|
+
readonly candidate: AgentModuleCandidate;
|
|
6
|
+
readonly kind: "connection";
|
|
7
|
+
readonly source: ConnectionSourceRef;
|
|
8
|
+
} | {
|
|
9
|
+
readonly candidate: AgentModuleCandidate;
|
|
10
|
+
readonly kind: "channel" | "config" | "extension" | "hook" | "instructions" | "instrumentation" | "sandbox" | "schedule" | "skill" | "tool";
|
|
11
|
+
readonly source: ModuleSourceRef;
|
|
12
|
+
};
|
|
13
|
+
export type ProjectedResourceSource = {
|
|
14
|
+
readonly candidate: AgentResourceCandidate;
|
|
15
|
+
readonly kind: "instructions";
|
|
16
|
+
readonly source: InstructionsSourceRef;
|
|
17
|
+
} | {
|
|
18
|
+
readonly candidate: AgentResourceCandidate;
|
|
19
|
+
readonly kind: "schedule";
|
|
20
|
+
readonly source: ScheduleSourceRef;
|
|
21
|
+
} | {
|
|
22
|
+
readonly candidate: AgentResourceCandidate;
|
|
23
|
+
readonly kind: "skill";
|
|
24
|
+
readonly source: SkillSourceRef;
|
|
25
|
+
};
|
|
26
|
+
export type ProjectedSource = ProjectedModuleSource | ProjectedResourceSource;
|
|
27
|
+
export interface ProjectedSubagentSource {
|
|
28
|
+
readonly candidate: AgentResourceCandidate;
|
|
29
|
+
readonly extensionScope?: {
|
|
30
|
+
readonly namespace: string;
|
|
31
|
+
readonly sourceRoot: string;
|
|
32
|
+
};
|
|
33
|
+
readonly owner: AgentSourceOwner;
|
|
34
|
+
readonly source: LocalSubagentSourceRef;
|
|
35
|
+
}
|
|
36
|
+
export interface ProjectedAgentSources {
|
|
37
|
+
readonly candidates: readonly AgentSourceCandidate[];
|
|
38
|
+
readonly resources: readonly ProjectedResourceSource[];
|
|
39
|
+
readonly subagents: readonly ProjectedSubagentSource[];
|
|
40
|
+
}
|
|
41
|
+
export declare function projectAgentSources(input: {
|
|
42
|
+
readonly externalDependencies: readonly string[];
|
|
43
|
+
readonly extensionScope?: {
|
|
44
|
+
readonly namespace: string;
|
|
45
|
+
readonly sourceRoot: string;
|
|
46
|
+
};
|
|
47
|
+
readonly layer?: AgentSourceLayer;
|
|
48
|
+
readonly manifest: AgentSourceManifest;
|
|
49
|
+
readonly nodeId: string;
|
|
50
|
+
readonly owner?: AgentSourceOwner;
|
|
51
|
+
}): ProjectedAgentSources;
|
|
52
|
+
export declare function projectSelectedSources(input: {
|
|
53
|
+
readonly candidates: Iterable<AgentSourceCandidate>;
|
|
54
|
+
readonly resources: readonly ProjectedResourceSource[];
|
|
55
|
+
}): readonly ProjectedSource[];
|
|
56
|
+
export declare function createFilesystemModuleCandidate(input: {
|
|
57
|
+
readonly externalDependencies: readonly string[];
|
|
58
|
+
readonly extension?: ResolvedExtensionMount;
|
|
59
|
+
readonly extensionScope?: {
|
|
60
|
+
readonly namespace: string;
|
|
61
|
+
readonly sourceRoot: string;
|
|
62
|
+
};
|
|
63
|
+
readonly layer: AgentSourceLayer;
|
|
64
|
+
readonly logicalPath: string;
|
|
65
|
+
readonly nodeId: string;
|
|
66
|
+
readonly owner: AgentSourceOwner;
|
|
67
|
+
readonly source: ModuleSourceRef;
|
|
68
|
+
readonly sourceId?: string;
|
|
69
|
+
readonly sourceRoot: string;
|
|
70
|
+
}): AgentModuleCandidate;
|
|
71
|
+
export declare function qualifyExtensionLogicalPath(logicalPath: string, namespace: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{join}from"node:path";import{stripLogicalPathExtension}from"#discover/filesystem.js";import{canonicalSourceSlot}from"#compiler/source-graph.js";const MODULE_KIND_BY_SLOT_ROOT={agent:`config`,channels:`channel`,extensions:`extension`,hooks:`hook`,instructions:`instructions`,instrumentation:`instrumentation`,sandbox:`sandbox`,schedules:`schedule`,skills:`skill`,tools:`tool`};function projectAgentSources(e){let t=e.owner??{kind:`application`},n=[],r=[],i=[];projectManifest({externalDependencies:e.externalDependencies,candidates:n,extensionScope:e.extensionScope,layer:e.layer??`application`,manifest:e.manifest,nodeId:e.nodeId,owner:t,resources:r,subagents:i});for(let t of[...e.manifest.resolvedExtensions].sort((e,t)=>e.namespace.localeCompare(t.namespace))){let a={kind:`extension`,namespace:t.namespace,packageName:t.packageName};projectManifest({externalDependencies:mergeDependencies(e.externalDependencies,t.externalDependencies),candidates:n,extension:t,layer:`extension-package`,manifest:t.manifest,nodeId:e.nodeId,owner:a,resources:r,sourceIdPrefix:`ext:${t.namespace}:`,subagents:i}),t.overrides!==void 0&&projectManifest({externalDependencies:e.externalDependencies,candidates:n,extension:t,layer:`extension-override`,manifest:t.overrides,nodeId:e.nodeId,owner:{kind:`application`},resources:r,sourceIdPrefix:`ext-override:${t.namespace}:`,subagents:i})}return{candidates:n,resources:r,subagents:i}}function projectSelectedSources(e){let t=new Map(e.resources.map(e=>[e.candidate.sourceId,e])),n=[];for(let r of e.candidates)if(isModuleCandidate(r))n.push(projectModuleCandidate(r));else{let e=t.get(r.sourceId);e!==void 0&&n.push(e)}return n}function createFilesystemModuleCandidate(t){return{backing:{externalDependencies:[...t.externalDependencies],...t.owner.kind===`extension`&&(t.extension!==void 0||t.extensionScope!==void 0)?{extensionScope:{namespace:t.extension?.namespace??t.extensionScope.namespace,sourceRoot:t.extension?.sourceRoot??t.extensionScope.sourceRoot}}:{},kind:`filesystem`,sourcePath:join(t.sourceRoot,t.source.logicalPath)},exportName:t.source.exportName,form:`direct`,layer:t.layer,logicalPath:t.logicalPath,nodeId:t.nodeId,owner:t.owner,sourceId:t.sourceId??t.source.sourceId}}function projectManifest(t){let qualify=e=>t.extension===void 0?e:qualifyExtensionLogicalPath(e,t.extension.namespace),sourceId=e=>`${t.sourceIdPrefix??``}${e}`,pushModule=(e,n)=>{let r=n??qualify(e.logicalPath),i=createFilesystemModuleCandidate({externalDependencies:t.externalDependencies,extension:t.extension,extensionScope:t.extensionScope,layer:t.layer,logicalPath:r,nodeId:t.nodeId,owner:t.owner,source:e,sourceId:sourceId(e.sourceId),sourceRoot:t.manifest.agentRoot});t.candidates.push(i)},pushResource=(n,r)=>{let i=qualify(r.logicalPath),a={...r,...r.sourceKind===`skill-package`?{name:t.extension===void 0?r.name:`${t.extension.namespace}__${r.name}`}:{},logicalPath:i,sourceId:sourceId(r.sourceId)},o={backing:{kind:`resource`,sourcePath:r.sourceKind===`skill-package`?r.skillFilePath:join(t.manifest.agentRoot,r.logicalPath)},form:`direct`,layer:t.layer,logicalPath:i,nodeId:t.nodeId,owner:t.owner,sourceId:a.sourceId};t.candidates.push(o),t.resources.push({candidate:o,kind:n,source:a})};if(t.extension===void 0&&t.manifest.configModule!==void 0){let e=t.manifest.configModule.logicalPath;pushModule(t.manifest.configModule,canonicalSourceSlot(e)===`agent`?void 0:`agent.ts`)}if(t.manifest.instrumentation!==void 0&&pushModule(t.manifest.instrumentation),t.extension===void 0)for(let e of t.manifest.extensions)pushModule(e);for(let e of t.manifest.channels)pushModule(e);for(let e of t.manifest.connections)pushModule(e);for(let e of t.manifest.hooks)pushModule(e);t.manifest.sandbox!==null&&pushModule(t.manifest.sandbox);for(let e of t.manifest.tools)pushModule(e);for(let e of t.manifest.instructions)e.sourceKind===`module`?pushModule(e):pushResource(`instructions`,e);for(let e of t.manifest.schedules)e.sourceKind===`module`?pushModule(e):pushResource(`schedule`,e);for(let e of t.manifest.skills)e.sourceKind===`module`?pushModule(e):pushResource(`skill`,e);for(let e of t.manifest.subagents){let n=t.extension===void 0?e.subagentId:`${t.extension.namespace}__${e.subagentId}`,r=t.extension===void 0?e.logicalPath:qualifyExtensionLogicalPath(e.logicalPath,t.extension.namespace),i={...e,logicalPath:r,sourceId:sourceId(e.sourceId),subagentId:n},a={backing:{kind:`resource`,sourcePath:e.entryPath},form:`direct`,layer:t.layer,logicalPath:r,nodeId:t.nodeId,owner:t.owner,sourceId:i.sourceId};t.candidates.push(a),t.subagents.push({candidate:a,...t.extension===void 0&&t.extensionScope===void 0?{}:{extensionScope:t.extension===void 0?t.extensionScope:{namespace:t.extension.namespace,sourceRoot:t.extension.sourceRoot}},owner:t.owner,source:i})}}function projectModuleCandidate(e){let t={exportName:e.exportName,logicalPath:e.logicalPath,sourceId:e.sourceId,sourceKind:`module`},i=canonicalSourceSlot(e.logicalPath);if(i.startsWith(`connections/`))return{candidate:e,kind:`connection`,source:{...t,connectionName:deriveConnectionName(e.logicalPath)}};let a=MODULE_KIND_BY_SLOT_ROOT[i.split(`/`,1)[0]];if(a===void 0)throw Error(`Agent module source slot "${e.logicalPath}" is not compiled yet.`);return{candidate:e,kind:a,source:t}}function isModuleCandidate(e){return e.backing.kind!==`resource`}function qualifyExtensionLogicalPath(e,t){let n=e.split(`/`);if(n.length<2)return e;let r=n[0];return r===`sandbox`||r===`extensions`||r===`lib`?e:(n[1]=`${t}__${n[1]}`,n.join(`/`))}function deriveConnectionName(e){let n=stripLogicalPathExtension(e).replace(/^connections\//,``);return n.endsWith(`/connection`)?n.slice(0,-11):n}function mergeDependencies(...e){return[...new Set(e.flat())]}export{createFilesystemModuleCandidate,projectAgentSources,projectSelectedSources,qualifyExtensionLogicalPath};
|
|
@@ -2,6 +2,7 @@ import { z } from "#compiled/zod/index.js";
|
|
|
2
2
|
import type { JsonObject } from "#shared/json.js";
|
|
3
3
|
import type { Node } from "#shared/node.js";
|
|
4
4
|
import type { ModuleSourceRef } from "#shared/source-ref.js";
|
|
5
|
+
import type { AgentSourceOwner, CompiledModuleBinding } from "#compiler/source-graph.js";
|
|
5
6
|
export interface CompiledDynamicSubagentDefinition extends Readonly<ModuleSourceRef> {
|
|
6
7
|
readonly build?: {
|
|
7
8
|
readonly externalDependencies?: readonly string[];
|
|
@@ -15,8 +16,15 @@ export interface CompiledDynamicSubagentDefinition extends Readonly<ModuleSource
|
|
|
15
16
|
*/
|
|
16
17
|
export type CompiledRemoteAgentNode = Readonly<ModuleSourceRef & Node & {
|
|
17
18
|
description: string;
|
|
19
|
+
backing: {
|
|
20
|
+
readonly kind: "resource";
|
|
21
|
+
readonly sourcePath: string;
|
|
22
|
+
};
|
|
23
|
+
binding: CompiledModuleBinding;
|
|
18
24
|
entryPath: string;
|
|
19
25
|
name: string;
|
|
26
|
+
owner: AgentSourceOwner;
|
|
27
|
+
parentNodeId: string;
|
|
20
28
|
outputSchema?: JsonObject;
|
|
21
29
|
path: string;
|
|
22
30
|
rootPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{jsonObjectSchema}from"#shared/json-schemas.js";const compiledRemoteAgentNodeSchema=z.object({description:z.string(),entryPath:z.string(),exportName:z.string().optional(),logicalPath:z.string(),name:z.string(),nodeId:z.string(),outputSchema:jsonObjectSchema.optional(),path:z.string(),rootPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),url:z.string().optional()}).strict();export{compiledRemoteAgentNodeSchema};
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{jsonObjectSchema}from"#shared/json-schemas.js";const compiledRemoteAgentNodeSchema=z.object({backing:z.object({kind:z.literal(`resource`),sourcePath:z.string()}).strict(),binding:z.object({backing:z.discriminatedUnion(`kind`,[z.object({externalDependencies:z.array(z.string()).readonly(),extensionScope:z.object({namespace:z.string(),sourceRoot:z.string()}).strict().optional(),kind:z.literal(`filesystem`),sourcePath:z.string()}).strict(),z.object({kind:z.literal(`programmatic`),moduleId:z.string(),registryId:z.string(),revision:z.string(),semanticRevision:z.string().optional()}).strict()]),logicalPath:z.string(),owner:z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string(),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),namespace:z.string(),packageName:z.string()}).strict()])}).strict(),description:z.string(),entryPath:z.string(),exportName:z.string().optional(),logicalPath:z.string(),name:z.string(),nodeId:z.string(),owner:z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string(),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),namespace:z.string(),packageName:z.string()}).strict()]),parentNodeId:z.string(),outputSchema:jsonObjectSchema.optional(),path:z.string(),rootPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),url:z.string().optional()}).strict();export{compiledRemoteAgentNodeSchema};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { type JsonObject } from "#shared/json.js";
|
|
2
|
+
export type ProgrammaticModuleNamespace = Readonly<Record<string, unknown>>;
|
|
3
|
+
export interface ProgrammaticModuleLoadContext {
|
|
4
|
+
readonly dependencies: Readonly<Record<string, ProgrammaticModuleNamespace>>;
|
|
5
|
+
readonly parameters: JsonObject;
|
|
6
|
+
}
|
|
7
|
+
export interface ProgrammaticAgentModule {
|
|
8
|
+
readonly exportName?: string;
|
|
9
|
+
readonly loadNamespace: (context: ProgrammaticModuleLoadContext) => Promise<ProgrammaticModuleNamespace>;
|
|
10
|
+
readonly logicalPath: string;
|
|
11
|
+
readonly semanticRevision?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ProgrammaticAgentSource {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly modules: readonly ProgrammaticAgentModule[];
|
|
16
|
+
readonly revision: string;
|
|
17
|
+
}
|
|
18
|
+
export interface AgentSourceRegistration {
|
|
19
|
+
readonly applyTo: "root" | "all-local-nodes";
|
|
20
|
+
readonly source: ProgrammaticAgentSource;
|
|
21
|
+
}
|
|
22
|
+
export interface AgentSourceRegistryOptions {
|
|
23
|
+
readonly templates?: readonly ProgrammaticAgentSource[];
|
|
24
|
+
}
|
|
25
|
+
export interface RegisteredProgrammaticTemplate {
|
|
26
|
+
readonly module: ProgrammaticAgentModule;
|
|
27
|
+
readonly source: ProgrammaticAgentSource;
|
|
28
|
+
}
|
|
29
|
+
export interface AgentSourceRegistry {
|
|
30
|
+
readonly registrations: readonly AgentSourceRegistration[];
|
|
31
|
+
readonly sources: ReadonlyMap<string, ProgrammaticAgentSource>;
|
|
32
|
+
readonly templates: ReadonlyMap<string, RegisteredProgrammaticTemplate>;
|
|
33
|
+
}
|
|
34
|
+
export type AgentSourceOwner = {
|
|
35
|
+
readonly kind: "application";
|
|
36
|
+
} | {
|
|
37
|
+
readonly feature: string;
|
|
38
|
+
readonly kind: "framework";
|
|
39
|
+
} | {
|
|
40
|
+
readonly kind: "extension";
|
|
41
|
+
readonly namespace: string;
|
|
42
|
+
readonly packageName: string;
|
|
43
|
+
};
|
|
44
|
+
export type AgentSourceLayer = "framework-default" | "extension-package" | "extension-override" | "application";
|
|
45
|
+
export type AgentSourceForm = "derived" | "direct";
|
|
46
|
+
export type AgentModuleBacking = {
|
|
47
|
+
readonly externalDependencies: readonly string[];
|
|
48
|
+
readonly extensionScope?: {
|
|
49
|
+
readonly namespace: string;
|
|
50
|
+
readonly sourceRoot: string;
|
|
51
|
+
};
|
|
52
|
+
readonly kind: "filesystem";
|
|
53
|
+
readonly sourcePath: string;
|
|
54
|
+
} | {
|
|
55
|
+
readonly dependencies?: Readonly<Record<string, string>>;
|
|
56
|
+
readonly kind: "programmatic";
|
|
57
|
+
readonly moduleId: string;
|
|
58
|
+
readonly parameters?: JsonObject;
|
|
59
|
+
readonly registryId: string;
|
|
60
|
+
readonly revision: string;
|
|
61
|
+
readonly semanticRevision?: string;
|
|
62
|
+
};
|
|
63
|
+
export type AgentSourceBacking = AgentModuleBacking | {
|
|
64
|
+
readonly kind: "resource";
|
|
65
|
+
readonly sourcePath: string;
|
|
66
|
+
};
|
|
67
|
+
export interface AgentModuleCandidate {
|
|
68
|
+
readonly backing: AgentModuleBacking;
|
|
69
|
+
readonly exportName?: string;
|
|
70
|
+
readonly form: AgentSourceForm;
|
|
71
|
+
readonly layer: AgentSourceLayer;
|
|
72
|
+
readonly logicalPath: string;
|
|
73
|
+
readonly nodeId: string;
|
|
74
|
+
readonly owner: AgentSourceOwner;
|
|
75
|
+
readonly sourceId: string;
|
|
76
|
+
}
|
|
77
|
+
export interface CompiledModuleBinding {
|
|
78
|
+
readonly backing: AgentModuleBacking;
|
|
79
|
+
readonly logicalPath: string;
|
|
80
|
+
readonly owner: AgentSourceOwner;
|
|
81
|
+
}
|
|
82
|
+
export interface AgentSourceDescriptor {
|
|
83
|
+
readonly backing: AgentSourceBacking;
|
|
84
|
+
readonly form: AgentSourceForm;
|
|
85
|
+
readonly layer: AgentSourceLayer;
|
|
86
|
+
readonly logicalPath: string;
|
|
87
|
+
readonly owner: AgentSourceOwner;
|
|
88
|
+
readonly sourceId: string;
|
|
89
|
+
}
|
|
90
|
+
export interface AgentResourceCandidate {
|
|
91
|
+
readonly backing: Extract<AgentSourceBacking, {
|
|
92
|
+
readonly kind: "resource";
|
|
93
|
+
}>;
|
|
94
|
+
readonly form: AgentSourceForm;
|
|
95
|
+
readonly layer: AgentSourceLayer;
|
|
96
|
+
readonly logicalPath: string;
|
|
97
|
+
readonly nodeId: string;
|
|
98
|
+
readonly owner: AgentSourceOwner;
|
|
99
|
+
readonly sourceId: string;
|
|
100
|
+
}
|
|
101
|
+
export type AgentSourceCandidate = AgentModuleCandidate | AgentResourceCandidate;
|
|
102
|
+
export type AgentSourceCompositionEntry = {
|
|
103
|
+
readonly kind: "shadowed";
|
|
104
|
+
readonly source: AgentSourceDescriptor;
|
|
105
|
+
readonly winnerSourceId: string;
|
|
106
|
+
} | {
|
|
107
|
+
readonly kind: "disabled";
|
|
108
|
+
readonly source: AgentSourceDescriptor;
|
|
109
|
+
};
|
|
110
|
+
export interface AgentSourceComposition {
|
|
111
|
+
readonly entries: readonly AgentSourceCompositionEntry[];
|
|
112
|
+
}
|
|
113
|
+
export interface ComposedAgentModuleCandidates {
|
|
114
|
+
readonly composition: AgentSourceComposition;
|
|
115
|
+
readonly selected: ReadonlyMap<string, AgentSourceCandidate>;
|
|
116
|
+
}
|
|
117
|
+
export declare function defineProgrammaticAgentSource(input: ProgrammaticAgentSource): ProgrammaticAgentSource;
|
|
118
|
+
export declare function createAgentSourceRegistry(registrations: readonly AgentSourceRegistration[], options?: AgentSourceRegistryOptions): AgentSourceRegistry;
|
|
119
|
+
export declare function createProgrammaticModuleCandidates(input: {
|
|
120
|
+
readonly layer: AgentSourceLayer;
|
|
121
|
+
readonly nodeId: string;
|
|
122
|
+
readonly owner: AgentSourceOwner;
|
|
123
|
+
readonly registration: AgentSourceRegistration;
|
|
124
|
+
}): readonly AgentModuleCandidate[];
|
|
125
|
+
export declare function instantiateProgrammaticTemplate(input: {
|
|
126
|
+
readonly anchor: AgentModuleCandidate;
|
|
127
|
+
readonly dependencies: Readonly<Record<string, AgentModuleCandidate>>;
|
|
128
|
+
readonly logicalPath: string;
|
|
129
|
+
readonly owner: AgentSourceOwner;
|
|
130
|
+
readonly parameters?: JsonObject;
|
|
131
|
+
readonly template: RegisteredProgrammaticTemplate;
|
|
132
|
+
}): AgentModuleCandidate;
|
|
133
|
+
export declare function composeAgentModuleCandidates(candidates: readonly AgentSourceCandidate[]): ComposedAgentModuleCandidates;
|
|
134
|
+
export declare function disableComposedCandidate(input: {
|
|
135
|
+
readonly candidate: AgentSourceCandidate;
|
|
136
|
+
readonly composed: ComposedAgentModuleCandidates;
|
|
137
|
+
}): ComposedAgentModuleCandidates;
|
|
138
|
+
export declare function createCompiledModuleBinding(candidate: AgentModuleCandidate): CompiledModuleBinding;
|
|
139
|
+
export declare function loadProgrammaticModuleNamespace(input: {
|
|
140
|
+
readonly backing: Extract<AgentModuleBacking, {
|
|
141
|
+
readonly kind: "programmatic";
|
|
142
|
+
}>;
|
|
143
|
+
readonly dependencyNamespaces?: Readonly<Record<string, ProgrammaticModuleNamespace>>;
|
|
144
|
+
readonly registries: readonly AgentSourceRegistry[];
|
|
145
|
+
}): Promise<ProgrammaticModuleNamespace>;
|
|
146
|
+
export declare function canonicalModuleSlot(logicalPath: string): string;
|
|
147
|
+
/**
|
|
148
|
+
* Canonical composition slot for one logical path. Module extensions, folder
|
|
149
|
+
* forms, and skill packages collapse onto the same authored primitive identity.
|
|
150
|
+
*/
|
|
151
|
+
export declare function canonicalSourceSlot(logicalPath: string): string;
|
|
152
|
+
export declare function validateProgrammaticLogicalPath(input: string): string;
|
|
153
|
+
export declare function describeAgentSourceCandidate(candidate: AgentSourceCandidate): AgentSourceDescriptor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isAbsolute,posix}from"node:path";import{getSupportedModuleBaseName,normalizeLogicalPath,stripLogicalPathExtension}from"#discover/filesystem.js";import{parseJsonObject}from"#shared/json.js";var ImmutableProgrammaticSourceMap=class{#e;constructor(e){this.#e=new Map(e),Object.freeze(this)}get size(){return this.#e.size}get[Symbol.toStringTag](){return`ImmutableProgrammaticSourceMap`}[Symbol.iterator](){return this.#e[Symbol.iterator]()}entries(){return this.#e.entries()}forEach(e,t){this.#e.forEach((n,r)=>e.call(t,n,r,this))}get(e){return this.#e.get(e)}has(e){return this.#e.has(e)}keys(){return this.#e.keys()}values(){return this.#e.values()}};const LAYER_PRECEDENCE={"framework-default":0,"extension-package":1,"extension-override":2,application:3},FORM_PRECEDENCE={derived:0,direct:1},registeredProgrammaticTemplates=new WeakSet;function defineProgrammaticAgentSource(e){let t=expectNonEmpty(e.id,`Programmatic agent source id`),n=expectNonEmpty(e.revision,`Programmatic agent source "${t}" revision`),r=new Set,i=e.modules.map(e=>{let n=validateProgrammaticLogicalPath(e.logicalPath);if(r.has(n))throw Error(`Programmatic agent source "${t}" declares "${n}" more than once.`);r.add(n);let i=e.semanticRevision===void 0?void 0:expectNonEmpty(e.semanticRevision,`Programmatic module "${t}:${n}" semanticRevision`);return Object.freeze({exportName:e.exportName,loadNamespace:e.loadNamespace,logicalPath:n,semanticRevision:i})});return Object.freeze({id:t,modules:Object.freeze(i),revision:n})}function createAgentSourceRegistry(e,t={}){let n=new Map,r=new Map,addSource=e=>{let t=defineProgrammaticAgentSource(e);if(n.has(t.id))throw Error(`Programmatic agent source id "${t.id}" is registered more than once.`);return n.set(t.id,t),t},i=e.map(e=>{let t=addSource(e.source);return Object.freeze({applyTo:e.applyTo,source:t})});for(let e of t.templates??[]){let t=addSource(e);if(t.modules.length!==1)throw Error(`Programmatic template source "${t.id}" must register exactly one module.`);let n=Object.freeze({module:t.modules[0],source:t});registeredProgrammaticTemplates.add(n),r.set(t.id,n)}return Object.freeze({registrations:Object.freeze(i),sources:new ImmutableProgrammaticSourceMap(n),templates:new ImmutableProgrammaticSourceMap(r)})}function createProgrammaticModuleCandidates(e){return e.registration.source.modules.map(t=>{let n=`${e.registration.source.id}:${t.logicalPath}`;return Object.freeze({backing:Object.freeze({kind:`programmatic`,moduleId:t.logicalPath,registryId:e.registration.source.id,revision:e.registration.source.revision,semanticRevision:t.semanticRevision}),exportName:t.exportName,form:`direct`,layer:e.layer,logicalPath:t.logicalPath,nodeId:e.nodeId,owner:e.owner,sourceId:n})})}function instantiateProgrammaticTemplate(e){if(!registeredProgrammaticTemplates.has(e.template))throw Error(`Derived programmatic modules require a registered template.`);let t=validateProgrammaticLogicalPath(e.logicalPath),n=expectNonEmpty(e.anchor.sourceId,`Derived programmatic module anchor source id`),r=`${e.template.source.id}:${t}:from:${n}`;if(!Object.values(e.dependencies).some(e=>e.sourceId===n))throw Error(`Derived programmatic module "${r}" must include its anchor source as a dependency.`);let i=Object.freeze(Object.fromEntries(Object.entries(e.dependencies).sort(([e],[t])=>e.localeCompare(t)).map(([t,n])=>{if(expectNonEmpty(t,`Derived programmatic module dependency alias`),n.nodeId!==e.anchor.nodeId)throw Error(`Derived programmatic module "${r}" cannot depend on source "${n.sourceId}" from another node.`);return[t,n.sourceId]}))),o=Object.freeze(parseJsonObject(e.parameters??{}));return Object.freeze({backing:Object.freeze({dependencies:i,kind:`programmatic`,moduleId:e.template.module.logicalPath,parameters:o,registryId:e.template.source.id,revision:e.template.source.revision,semanticRevision:e.template.module.semanticRevision}),exportName:e.template.module.exportName,form:`derived`,layer:e.anchor.layer,logicalPath:t,nodeId:e.anchor.nodeId,owner:e.owner,sourceId:r})}function composeAgentModuleCandidates(e){let t=new Map,n=new Set;for(let r of e){if(n.has(r.sourceId))throw Error(`Agent source id "${r.sourceId}" is declared more than once in node "${r.nodeId}".`);n.add(r.sourceId);let e=canonicalSourceSlot(r.logicalPath),i=t.get(e)??[];i.push(r),t.set(e,i)}let r=new Map,i=[];for(let[e,n]of[...t].sort(([e],[t])=>e.localeCompare(t))){let t=new Set;for(let r of n){let n=`${r.layer}:${r.form}`;if(t.has(n))throw Error(`Agent source slot "${e}" has more than one ${r.layer} ${r.form} candidate.`);t.add(n)}let a=[...n].sort((e,t)=>LAYER_PRECEDENCE[t.layer]-LAYER_PRECEDENCE[e.layer]||FORM_PRECEDENCE[t.form]-FORM_PRECEDENCE[e.form]),c=a[0];r.set(e,c);for(let e of a.slice(1))i.push({kind:`shadowed`,source:describeAgentSourceCandidate(e),winnerSourceId:c.sourceId})}return validateSelectedCandidateDependencies(r),{composition:{entries:Object.freeze(i)},selected:r}}function disableComposedCandidate(e){let t=canonicalSourceSlot(e.candidate.logicalPath),n=new Map(e.composed.selected);if(n.get(t)?.sourceId!==e.candidate.sourceId)throw Error(`Only the selected source for "${t}" can disable that slot.`);if(!e.composed.composition.entries.some(t=>t.kind===`shadowed`&&t.winnerSourceId===e.candidate.sourceId))throw Error(`Source "${e.candidate.logicalPath}" disables a slot with no lower-precedence source.`);return n.delete(t),{composition:{entries:Object.freeze([...e.composed.composition.entries,{kind:`disabled`,source:describeAgentSourceCandidate(e.candidate)}])},selected:n}}function createCompiledModuleBinding(e){return Object.freeze({backing:e.backing,logicalPath:e.logicalPath,owner:e.owner})}async function loadProgrammaticModuleNamespace(e){let t=e.registries.map(t=>t.sources.get(e.backing.registryId)).filter(e=>e!==void 0);if(t.length!==1)throw Error(`Expected exactly one registered programmatic source "${e.backing.registryId}", found ${t.length}.`);let n=t[0];if(n.revision!==e.backing.revision)throw Error(`Programmatic source "${n.id}" revision mismatch: artifact requires "${e.backing.revision}", registry provides "${n.revision}".`);let r=n.modules.find(t=>t.logicalPath===e.backing.moduleId);if(r===void 0)throw Error(`Programmatic source "${n.id}" does not register module "${e.backing.moduleId}".`);if(r.semanticRevision!==e.backing.semanticRevision)throw Error(`Programmatic module "${n.id}:${r.logicalPath}" semantic revision does not match the compiled binding.`);let i=Object.fromEntries(Object.entries(e.backing.dependencies??{}).map(([t,i])=>{let a=e.dependencyNamespaces?.[t];if(a===void 0)throw Error(`Programmatic module "${n.id}:${r.logicalPath}" requires unresolved binding "${i}" as dependency "${t}".`);return[t,a]})),a=await r.loadNamespace({dependencies:Object.freeze(i),parameters:Object.freeze(e.backing.parameters??{})});if(typeof a!=`object`||!a)throw Error(`Programmatic module "${n.id}:${r.logicalPath}" loader must return a module namespace object.`);return a}function canonicalModuleSlot(e){return validateProgrammaticLogicalPath(e),canonicalSourceSlot(e)}function canonicalSourceSlot(e){let n=normalizeLogicalPath(e);if(n.length===0||n===`.`||n.startsWith(`../`)||n.includes(`/../`)||posix.normalize(n)!==n)throw Error(`Agent source logical path "${e}" is invalid.`);let a=stripLogicalPathExtension(n),o=a.match(/^connections\/([^/]+)\/connection$/);if(o!==null)return`connections/${o[1]}`;if(a===`sandbox/sandbox`)return`sandbox`;let s=a.match(/^skills\/([^/]+)\/SKILL$/);return s===null?a:`skills/${s[1]}`}function validateProgrammaticLogicalPath(a){if(a.length===0||isAbsolute(a)||a.includes(`\\`))throw Error(`Programmatic module logical path "${a}" must be a relative POSIX path.`);let o=normalizeLogicalPath(a);if(o===`.`||o.startsWith(`../`)||o.includes(`/../`)||posix.normalize(o)!==o)throw Error(`Programmatic module logical path "${a}" may not traverse directories.`);let s=o.split(`/`),c=s.at(-1);if(getSupportedModuleBaseName(c)===null)throw Error(`Programmatic module logical path "${a}" must use a supported JavaScript or TypeScript extension.`);let l=s[0],u=stripLogicalPathExtension(o);if(!(s.length===1&&[`agent`,`sandbox`,`instrumentation`].includes(u)||l===`sandbox`&&s.length===2&&getSupportedModuleBaseName(c)===`sandbox`||[`channels`,`connections`,`hooks`,`instructions`,`schedules`,`skills`,`tools`].includes(l)&&s.length>=2))throw Error(`Programmatic module logical path "${a}" does not select an eve module slot.`);return o}function describeAgentSourceCandidate(e){return Object.freeze({backing:e.backing,form:e.form,layer:e.layer,logicalPath:e.logicalPath,owner:e.owner,sourceId:e.sourceId})}function validateSelectedCandidateDependencies(e){let t=new Set([...e.values()].map(e=>e.sourceId));for(let n of e.values())if(n.backing.kind===`programmatic`){for(let e of Object.values(n.backing.dependencies??{}))if(!t.has(e))throw Error(`Derived programmatic source "${n.sourceId}" depends on unselected source "${e}".`)}}function expectNonEmpty(e,t){if(e.trim().length===0)throw Error(`${t} must be non-empty.`);return e}export{canonicalModuleSlot,canonicalSourceSlot,composeAgentModuleCandidates,createAgentSourceRegistry,createCompiledModuleBinding,createProgrammaticModuleCandidates,defineProgrammaticAgentSource,describeAgentSourceCandidate,disableComposedCandidate,instantiateProgrammaticTemplate,loadProgrammaticModuleNamespace,validateProgrammaticLogicalPath};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CompiledAgentManifest, CompiledAgentNodeManifest, CompiledAgentResources } from "#compiler/manifest.js";
|
|
2
|
+
import type { CompiledModuleMap } from "#compiler/module-map.js";
|
|
3
|
+
type CompiledNode = CompiledAgentNodeManifest | CompiledAgentResources;
|
|
4
|
+
/** Validates invariants that cannot be expressed by the serialized Zod shape. */
|
|
5
|
+
export declare function validateCompiledAgentManifest(manifest: CompiledAgentManifest): void;
|
|
6
|
+
/** Validates exact module-map parity with the manifest's required binding tables. */
|
|
7
|
+
export declare function validateCompiledModuleMap(manifest: CompiledAgentManifest, moduleMap: CompiledModuleMap): void;
|
|
8
|
+
/** Validates one node's bindings, composition, and route-plan integrity. */
|
|
9
|
+
export declare function validateCompiledAgentResources(node: CompiledNode, options?: {
|
|
10
|
+
readonly additionalModuleSources?: readonly {
|
|
11
|
+
readonly logicalPath: string;
|
|
12
|
+
readonly sourceId: string;
|
|
13
|
+
}[];
|
|
14
|
+
readonly activeResourceSourceIds?: readonly string[];
|
|
15
|
+
readonly allowUnknownResourceWinners?: boolean;
|
|
16
|
+
}): void;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{collectModuleBindingsForManifest}from"#compiler/module-map.js";import{HOST_HTTP_INVENTORY}from"#framework/host-inventory.js";function validateCompiledAgentManifest(t){let n=new Map([[ROOT_COMPILED_AGENT_NODE_ID,t]]);for(let e of t.subagents)n.has(e.nodeId)&&fail(`subagent node id "${e.nodeId}" is duplicated`),n.set(e.nodeId,e.agent),validateSubagentRecord(e);validateSubagentTree(t,n),validateCompiledAgentResources(t,{activeResourceSourceIds:t.subagents.filter(t=>t.parentNodeId===ROOT_COMPILED_AGENT_NODE_ID).map(e=>e.sourceId)});for(let e of t.subagents)validateCompiledAgentResources(e.agent,{additionalModuleSources:e.configResolver===void 0?[]:[e.configResolver],activeResourceSourceIds:t.subagents.filter(t=>t.parentNodeId===e.nodeId).map(e=>e.sourceId)});for(let[e,r]of n)validateUniqueIdentities([...r.tools.map(e=>({identity:e.name,kind:`tool`})),...r.remoteAgents.map(e=>({identity:e.name,kind:`remote agent`})),...t.subagents.filter(t=>t.parentNodeId===e).map(e=>({identity:e.name,kind:`local agent`}))],`tool and subagent public name`)}function validateSubagentTree(t,n){let r=new Map(t.subagents.map(e=>[e.nodeId,e.parentNodeId]));for(let i of t.subagents){n.has(i.parentNodeId)||fail(`subagent node "${i.nodeId}" has missing parent "${i.parentNodeId}"`);let t=new Set,a=i.nodeId;for(;a!==ROOT_COMPILED_AGENT_NODE_ID;){t.has(a)&&fail(`subagent graph contains a cycle at node "${a}"`),t.add(a);let e=r.get(a);e===void 0&&fail(`subagent node "${i.nodeId}" is not reachable from the root`),a=e}}}function validateCompiledModuleMap(e,n){let r=new Map([[`__root__`,new Set(collectModuleBindingsForManifest(e).map(e=>e.sourceId))],...e.subagents.map(e=>[e.nodeId,new Set(collectModuleBindingsForManifest(e.agent).map(e=>e.sourceId))])]),i=Object.keys(n.nodes);(i.length!==r.size||i.some(e=>!r.has(e)))&&fail(`compiled module map node set does not match the manifest`);for(let[e,t]of r){let r=n.nodes[e];r===void 0&&fail(`compiled module map node "${e}" is missing`);let i=Object.keys(r.modules);(i.length!==t.size||i.some(e=>!t.has(e)))&&fail(`compiled module map sources for node "${e}" do not match its bindings`)}}function validateCompiledAgentResources(e,t={}){validateUniqueIdentities(e.tools.map(e=>({identity:e.name,kind:`tool`})),`tool name`),validateUniqueIdentities(e.dynamicTools.map(e=>({identity:e.slug,kind:`dynamic tool`})),`dynamic tool slug`),validateUniqueIdentities(e.skills.map(e=>({identity:e.name,kind:`skill`})),`skill name`),validateUniqueIdentities(e.dynamicSkills.map(e=>({identity:e.slug,kind:`dynamic skill`})),`dynamic skill slug`),validateUniqueIdentities(e.instructions.map(e=>({identity:e.name,kind:`instructions`})),`instructions name`),validateUniqueIdentities(e.dynamicInstructions.map(e=>({identity:e.slug,kind:`dynamic instructions`})),`dynamic instructions slug`),validateUniqueIdentities(e.connections.map(e=>({identity:e.connectionName,kind:`connection`})),`connection name`),validateUniqueIdentities(e.hooks.map(e=>({identity:e.slug,kind:`hook`})),`hook slug`),validateUniqueIdentities(e.schedules.map(e=>({identity:e.name,kind:`schedule`})),`schedule name`);let n=collectReferencedModuleSources(e);for(let e of t.additionalModuleSources??[])n.set(e.sourceId,{logicalPath:e.logicalPath});for(let[t,r]of n){let n=e.bindings[t];n===void 0&&fail(`module source "${t}" has no compiled binding`),validateBinding(t,r.logicalPath,n)}for(let t of Object.keys(e.bindings))n.has(t)||fail(`compiled binding "${t}" is not referenced by its node manifest`);validateProgrammaticBindingDependencies(e.bindings);let r=new Set([...n.keys(),...collectActiveResourceSourceIds(e),...e.remoteAgents.map(e=>e.sourceId),...t.activeResourceSourceIds??[]]),i=new Set;for(let n of e.sourceComposition.entries){if(n.kind===`disabled`){i.has(n.source.sourceId)&&fail(`disabled composition source "${n.source.sourceId}" is duplicated`),i.add(n.source.sourceId),e.bindings[n.source.sourceId]!==void 0&&fail(`disabled source "${n.source.sourceId}" retains an active binding`);continue}!r.has(n.winnerSourceId)&&!i.has(n.winnerSourceId)&&!e.sourceComposition.entries.some(e=>e.kind===`disabled`&&e.source.sourceId===n.winnerSourceId)&&t.allowUnknownResourceWinners!==!0&&fail(`shadowed source "${n.source.sourceId}" has dangling winner "${n.winnerSourceId}"`)}validateChannelRoutePlan(e);for(let t of e.remoteAgents)validateBinding(t.sourceId,t.logicalPath,t.binding),t.parentNodeId.length===0&&fail(`remote agent "${t.sourceId}" has no parent`)}function validateSubagentRecord(e){if((e.backing.kind!==`resource`||e.backing.sourcePath.length===0)&&fail(`subagent "${e.nodeId}" has no physical resource backing`),e.parentNodeId.length===0&&fail(`subagent "${e.nodeId}" has no parent`),e.configResolver!==void 0){let t=e.agent.bindings[e.configResolver.sourceId];t===void 0&&fail(`dynamic subagent "${e.nodeId}" config resolver has no binding`),validateBinding(e.configResolver.sourceId,e.configResolver.logicalPath,t)}}function validateBinding(e,t,n){n.logicalPath!==t&&fail(`compiled binding "${e}" targets "${n.logicalPath}", not "${t}"`),n.owner.kind===`extension`&&n.backing.kind===`filesystem`&&n.backing.extensionScope===void 0&&fail(`extension-owned filesystem binding "${e}" has no extension scope`)}function validateProgrammaticBindingDependencies(e){let t=new Set,n=new Set,visit=r=>{if(n.has(r))return;t.has(r)&&fail(`programmatic binding dependency cycle includes "${r}"`);let i=e[r];if(i===void 0&&fail(`programmatic binding dependency "${r}" is missing`),t.add(r),i.backing.kind===`programmatic`)for(let[t,n]of Object.entries(i.backing.dependencies??{}))t.trim().length===0&&fail(`programmatic binding "${r}" has an empty dependency alias`),e[n]===void 0&&fail(`programmatic binding "${r}" depends on missing binding "${n}"`),visit(n);t.delete(r),n.add(r)};for(let t of Object.keys(e))visit(t)}function collectReferencedModuleSources(e){let t=new Map,add=e=>{let n=t.get(e.sourceId);n!==void 0&&n.logicalPath!==e.logicalPath&&fail(`module source "${e.sourceId}" is referenced with two logical paths`),t.set(e.sourceId,{logicalPath:e.logicalPath})};`config`in e&&(add(e.config.source),e.config.model?.source!==void 0&&add(e.config.model.source),e.config.dynamicModel!==void 0&&add(e.config.dynamicModel));for(let t of e.channelRoutes.effective)add(t);for(let t of e.channelRoutes.shadowed)t.source.backing.kind!==`resource`&&add(t.source);for(let t of e.connections)add(t);for(let t of e.tools)add(t);for(let t of e.dynamicInstructions)add(t);for(let t of e.dynamicSkills)add(t);for(let t of e.dynamicTools)add(t);for(let t of e.hooks)add(t);for(let t of e.instructions)t.sourceKind===`module`&&add(t);e.instrumentation!==void 0&&add(e.instrumentation),e.workflowTool!==void 0&&add(e.workflowTool);for(let t of e.skills)t.sourceKind===`module`&&add(t);for(let t of e.schedules)t.sourceKind===`module`&&add(t);add(e.sandbox);for(let t of e.extensionMounts)add({logicalPath:t.mountLogicalPath,sourceId:t.mountSourceId});return t}function collectActiveResourceSourceIds(e){return[...e.instructions.filter(e=>e.sourceKind!==`module`).map(e=>e.sourceId),...e.skills.filter(e=>e.sourceKind!==`module`).map(e=>e.sourceId),...e.schedules.filter(e=>e.sourceKind!==`module`).map(e=>e.sourceId),...e.sandboxWorkspaces.map(e=>e.sourceId)]}function validateChannelRoutePlan(e){let t=new Set,r=new Set;for(let i of e.channelRoutes.effective){let a=routeIdentity(i);t.has(a)&&fail(`effective channel route "${a}" is duplicated`),t.add(a),r.add(i.sourceId),e.bindings[i.sourceId]===void 0&&fail(`effective channel route source "${i.sourceId}" has no binding`),HOST_HTTP_INVENTORY.find(e=>methodsOverlap(i.method,e.method)&&patternsOverlap(i.urlPath,e.path))!==void 0&&fail(`effective route ${i.method} ${i.urlPath} overlaps reserved host route`)}for(let t of e.channelRoutes.shadowed)r.has(t.winnerSourceId)||fail(`shadowed channel route has dangling winner "${t.winnerSourceId}"`);let i=new Set;for(let t of e.channelRoutes.preflight){let n=normalizePattern(t.urlPath);i.has(n)&&fail(`generated preflight "${n}" is duplicated`),i.add(n),t.sourceIds.length===0&&fail(`generated preflight "${n}" has no causes`);for(let r of t.sourceIds)e.channelRoutes.effective.find(e=>e.sourceId===r&&e.cors!==void 0&&e.method!==`WEBSOCKET`&&patternsOverlap(e.urlPath,t.urlPath))===void 0&&fail(`generated preflight "${n}" has invalid cause "${r}"`)}}function routeIdentity(e){return`${e.method} ${normalizePattern(e.urlPath)}`}function normalizePattern(e){return splitPath(e).map(e=>isParameter(e)?`:`:e).join(`/`)}function patternsOverlap(e,t){let n=splitPath(e),r=splitPath(t);return n.length===r.length&&n.every((e,t)=>e===r[t]||isParameter(e)||isParameter(r[t]))}function splitPath(e){return e.replace(/^\/+|\/+$/g,``).split(`/`)}function isParameter(e){return e.startsWith(`:`)||/^\[[^\]]+\]$/.test(e)}function methodsOverlap(e,t){return e===`ALL`||t===`ALL`||e===t}function validateUniqueIdentities(e,t){let n=new Map;for(let r of e){let e=n.get(r.identity);e!==void 0&&fail(`${t} "${r.identity}" is shared by ${e} and ${r.kind}`),n.set(r.identity,r.kind)}}function fail(e){throw Error(`Invalid compiled eve artifact: ${e}.`)}export{validateCompiledAgentManifest,validateCompiledAgentResources,validateCompiledModuleMap};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHash}from"node:crypto";import{cp,mkdir,readFile,readdir,rm}from"node:fs/promises";import{join,posix}from"node:path";import{normalizeLogicalPath}from"#discover/filesystem.js";import{ROOT_COMPILED_AGENT_NODE_ID,deriveResourceRootEntries}from"#compiler/manifest.js";import{normalizeSkillPackage,writeSkillPackageDirectory}from"#shared/skill-package.js";const RESOURCES_DIRECTORY=`workspace-resources`;async function materializeWorkspaceResources(e){let t=join(e.compileDirectoryPath,RESOURCES_DIRECTORY);await rm(t,{force:!0,recursive:!0});let n=await materializeNode({nodeId:ROOT_COMPILED_AGENT_NODE_ID,resourcesRoot:t,manifest:e.manifest}),r=await Promise.all(e.manifest.subagents.map(async e=>e.configResolver===void 0?{...e,agent:await materializeNode({nodeId:e.nodeId,resourcesRoot:t,manifest:e.agent})}:{...e,agent:await materializeNode({nodeId:e.nodeId,resourcesRoot:t,manifest:e.agent}),configResolver:e.configResolver}));return{...n,kind:e.manifest.kind,extensionMounts:e.manifest.extensionMounts,
|
|
1
|
+
import{createHash}from"node:crypto";import{cp,mkdir,readFile,readdir,rm}from"node:fs/promises";import{join,posix}from"node:path";import{normalizeLogicalPath}from"#discover/filesystem.js";import{ROOT_COMPILED_AGENT_NODE_ID,deriveResourceRootEntries}from"#compiler/manifest.js";import{normalizeSkillPackage,writeSkillPackageDirectory}from"#shared/skill-package.js";const RESOURCES_DIRECTORY=`workspace-resources`;async function materializeWorkspaceResources(e){let t=join(e.compileDirectoryPath,RESOURCES_DIRECTORY);await rm(t,{force:!0,recursive:!0});let n=await materializeNode({nodeId:ROOT_COMPILED_AGENT_NODE_ID,resourcesRoot:t,manifest:e.manifest}),r=await Promise.all(e.manifest.subagents.map(async e=>e.configResolver===void 0?{...e,agent:await materializeNode({nodeId:e.nodeId,resourcesRoot:t,manifest:e.agent})}:{...e,agent:await materializeNode({nodeId:e.nodeId,resourcesRoot:t,manifest:e.agent}),configResolver:e.configResolver}));return{...n,kind:e.manifest.kind,extensionMounts:e.manifest.extensionMounts,subagents:r,version:e.manifest.version}}function createResourceRoot(e,t,n){return{contentHash:n,logicalPath:normalizeLogicalPath(join(RESOURCES_DIRECTORY,t)),rootEntries:deriveResourceRootEntries({sandboxWorkspaces:e.sandboxWorkspaces,skills:e.skills})}}async function materializeNode(e){let t=join(e.resourcesRoot,e.nodeId);await mkdir(t,{recursive:!0});let r=join(t,`workspace`);for(let t of e.manifest.sandboxWorkspaces)await copyDirectoryContents({sourcePath:t.sourcePath,targetPath:r});for(let n of e.manifest.skills)await materializeSkill({nodeRoot:t,skill:n});let i=await hashWorkspaceResourceRoot(t);return{...e.manifest,skills:e.manifest.skills.map(stripSkillPackageFiles),workspaceResourceRoot:createResourceRoot(e.manifest,e.nodeId,i)}}async function materializeSkill(e){let n=join(e.nodeRoot,`skills`,e.skill.name);if(e.skill.sourceKind===`skill-package`){await cp(e.skill.rootPath,n,{recursive:!0});return}await writeSkillPackageDirectory({rootPath:e.nodeRoot,skill:normalizeSkillPackage(e.skill)})}function stripSkillPackageFiles(e){let{files:t,...n}=e;return n}async function copyDirectoryContents(e){let r=await readdir(e.sourcePath,{withFileTypes:!0});await mkdir(e.targetPath,{recursive:!0});for(let n of r)!n.isDirectory()&&!n.isFile()||await cp(join(e.sourcePath,n.name),join(e.targetPath,n.name),{recursive:!0})}async function hashWorkspaceResourceRoot(t){let n=await listWorkspaceResourceFiles({logicalDirectoryPath:`.`,sourceDirectoryPath:t});if(n.sort((e,t)=>e.logicalPath.localeCompare(t.logicalPath)),n.length===0)return;let i=createHash(`sha256`);i.update(`eve-workspace-resource-root-v1\0`);for(let e of n){let t=await readFile(e.sourcePath);i.update(e.logicalPath),i.update(`\0`),i.update(String(t.byteLength)),i.update(`\0`),i.update(t),i.update(`\0`)}return i.digest(`hex`)}async function listWorkspaceResourceFiles(e){let t=[],n=await readdir(e.sourceDirectoryPath,{withFileTypes:!0});for(let r of n){if(!r.isDirectory()&&!r.isFile())continue;let n=join(e.sourceDirectoryPath,r.name),i=posix.join(e.logicalDirectoryPath,r.name);if(r.isDirectory()){t.push(...await listWorkspaceResourceFiles({logicalDirectoryPath:i,sourceDirectoryPath:n}));continue}t.push({logicalPath:i,sourcePath:n})}return t}export{materializeWorkspaceResources};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed error classes for the connection authorization lifecycle.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* User-facing authorization challenge payload.
|
|
6
|
+
*/
|
|
7
|
+
export interface ConnectionAuthorizationChallenge {
|
|
8
|
+
/**
|
|
9
|
+
* Optional URL the user should visit to complete authorization.
|
|
10
|
+
* Serves as the redirect target, the verification URL in device
|
|
11
|
+
* code flow, or the source for a QR code.
|
|
12
|
+
*/
|
|
13
|
+
readonly url?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional short code to display alongside `url` (device code flow).
|
|
16
|
+
*/
|
|
17
|
+
readonly userCode?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional ISO timestamp at which the authorization opportunity
|
|
20
|
+
* expires. When provided, the runtime clamps the authorization deadline to
|
|
21
|
+
* `min(configured_timeout, expiresAt)` so the turn cannot outlive
|
|
22
|
+
* the challenge.
|
|
23
|
+
*/
|
|
24
|
+
readonly expiresAt?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Optional human-readable call to action. When no `url` is
|
|
27
|
+
* available (e.g. CIBA, push-to-approve), this is what the channel
|
|
28
|
+
* should show as the primary affordance.
|
|
29
|
+
*/
|
|
30
|
+
readonly instructions?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Optional human-readable provider name for sign-in UI (e.g.
|
|
33
|
+
* `"Salesforce"`). Presentation-only: identity (the authorization
|
|
34
|
+
* scope, token cache keys, callback URLs) stays the path-derived
|
|
35
|
+
* name. Channels fall back to title-casing the scope name when
|
|
36
|
+
* absent.
|
|
37
|
+
*/
|
|
38
|
+
readonly displayName?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Options accepted by {@link ConnectionAuthorizationRequiredError}.
|
|
42
|
+
*/
|
|
43
|
+
export interface ConnectionAuthorizationRequiredErrorOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Override for the default `Error.message`. Defaults to
|
|
46
|
+
* `Connection "{name}" requires authorization.` when omitted.
|
|
47
|
+
*/
|
|
48
|
+
readonly message?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Options accepted by {@link ConnectionAuthorizationFailedError}.
|
|
52
|
+
*/
|
|
53
|
+
export interface ConnectionAuthorizationFailedErrorOptions {
|
|
54
|
+
/**
|
|
55
|
+
* Override for the default `Error.message`. Defaults to
|
|
56
|
+
* `Connection "{name}" authorization failed.` when omitted.
|
|
57
|
+
*/
|
|
58
|
+
readonly message?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Stable machine-readable code describing why authorization failed.
|
|
61
|
+
*
|
|
62
|
+
* The runtime surfaces this code on the `authorization.completed`
|
|
63
|
+
* stream event and on the failed tool result the model sees. Use a
|
|
64
|
+
* short kebab- or snake-cased string (e.g. `"access_denied"`,
|
|
65
|
+
* `"invalid_grant"`).
|
|
66
|
+
*
|
|
67
|
+
* The runtime also emits a few reason codes itself, independently
|
|
68
|
+
* of authored throws:
|
|
69
|
+
*
|
|
70
|
+
* - `"principal_required"`: a `principalType: "user"` connection
|
|
71
|
+
* was invoked without an authenticated user principal. Terminal.
|
|
72
|
+
* - `"app_not_installed"`: an authored `getToken` for a
|
|
73
|
+
* `principalType: "app"` connection signalled the agent's own
|
|
74
|
+
* credentials are missing. Terminal.
|
|
75
|
+
*/
|
|
76
|
+
readonly reason?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Controls whether the runtime re-prompts the user after this
|
|
79
|
+
* failure.
|
|
80
|
+
*
|
|
81
|
+
* Defaults to `true`; set `false` for terminal cases such as user
|
|
82
|
+
* denial (`reason: "access_denied"`).
|
|
83
|
+
*/
|
|
84
|
+
readonly retryable?: boolean;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Thrown from a connection's `getToken` when no valid credential is
|
|
88
|
+
* available and authorization must be completed before the connection
|
|
89
|
+
* can be used. Covers both interactive OAuth (the runtime emits
|
|
90
|
+
* `authorization.required` and suspends the turn on a webhook) and
|
|
91
|
+
* non-interactive / out-of-band flows such as static API keys (the
|
|
92
|
+
* runtime emits `authorization.required` without suspending).
|
|
93
|
+
*/
|
|
94
|
+
export declare class ConnectionAuthorizationRequiredError extends Error {
|
|
95
|
+
readonly connectionName: string;
|
|
96
|
+
constructor(connectionName: string, options?: ConnectionAuthorizationRequiredErrorOptions);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Thrown when a connection's authorization fails.
|
|
100
|
+
*
|
|
101
|
+
* Retryable by default; pass `retryable: false` for terminal failures
|
|
102
|
+
* where starting a fresh authorization flow would be wrong.
|
|
103
|
+
*/
|
|
104
|
+
export declare class ConnectionAuthorizationFailedError extends Error {
|
|
105
|
+
readonly connectionName: string;
|
|
106
|
+
readonly reason?: string;
|
|
107
|
+
readonly retryable: boolean;
|
|
108
|
+
constructor(connectionName: string, options?: ConnectionAuthorizationFailedErrorOptions);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Type guard for {@link ConnectionAuthorizationRequiredError}.
|
|
112
|
+
*
|
|
113
|
+
* Uses `err.name` rather than `instanceof` because user code and
|
|
114
|
+
* framework internals can end up with different class identities
|
|
115
|
+
* after bundling (dual-instance hazard in Nitro output).
|
|
116
|
+
*/
|
|
117
|
+
export declare function isConnectionAuthorizationRequiredError(err: unknown): err is ConnectionAuthorizationRequiredError;
|
|
118
|
+
/**
|
|
119
|
+
* Type guard for {@link ConnectionAuthorizationFailedError}.
|
|
120
|
+
*
|
|
121
|
+
* Uses `err.name` rather than `instanceof` because user code and
|
|
122
|
+
* framework internals can end up with different class identities
|
|
123
|
+
* after bundling (dual-instance hazard in Nitro output).
|
|
124
|
+
*/
|
|
125
|
+
export declare function isConnectionAuthorizationFailedError(err: unknown): err is ConnectionAuthorizationFailedError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ConnectionAuthorizationRequiredError=class extends Error{connectionName;constructor(e,t){super(t?.message??`Connection "${e}" requires authorization.`),this.name=`ConnectionAuthorizationRequiredError`,this.connectionName=e}},ConnectionAuthorizationFailedError=class extends Error{connectionName;reason;retryable;constructor(e,t){super(t?.message??`Connection "${e}" authorization failed.`),this.name=`ConnectionAuthorizationFailedError`,this.connectionName=e,this.reason=t?.reason,this.retryable=t?.retryable??!0}};function isConnectionAuthorizationRequiredError(e){return e instanceof Error&&e.name===`ConnectionAuthorizationRequiredError`}function isConnectionAuthorizationFailedError(e){return e instanceof Error&&e.name===`ConnectionAuthorizationFailedError`}export{ConnectionAuthorizationFailedError,ConnectionAuthorizationRequiredError,isConnectionAuthorizationFailedError,isConnectionAuthorizationRequiredError};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SessionContext } from "#
|
|
2
|
-
import type { ToolExecuteOptions } from "#
|
|
1
|
+
import type { SessionContext } from "#context/session-context.js";
|
|
2
|
+
import type { ToolExecuteOptions } from "#tools/definition.js";
|
|
3
3
|
/** Base context shared by tool executors. */
|
|
4
4
|
export type BaseToolContext = SessionContext & {
|
|
5
5
|
readonly abortSignal: AbortSignal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{SessionDynamicToolMetadataKey,StepDynamicToolMetadataKey,TurnDynamicToolMetadataKey}from"#context/keys.js";import{toInputSchema,toOutputSchema}from"#
|
|
1
|
+
import{createLogger}from"#internal/logging.js";import{SessionDynamicToolMetadataKey,StepDynamicToolMetadataKey,TurnDynamicToolMetadataKey}from"#context/keys.js";import{toInputSchema,toOutputSchema}from"#tools/schema.js";import{createToolExecuteWithAuth}from"#execution/tool-auth.js";import{callDurableDynamicCallback,lookupDurableDynamicCallback}from"#tools/durable-callbacks.js";const log=createLogger(`dynamic-tools`);function missingCallbackError(e,t){return Error(`Dynamic tool "${e.name}" cannot replay its ${t} callback because it is not registered in this process. The tool was removed or renamed since this call was parked, or its resolver did not run. Restore the tool definition or start a new session.`)}function buildReplayedApproval(e){let t=e.callbacks.approvalRequest;if(t===void 0)return;let n=lookupDurableDynamicCallback(e.name,`approvalRequest`),r=n===void 0?async()=>(log.error(missingCallbackError(e,`approvalRequest`).message),`user-approval`):async e=>await callDurableDynamicCallback(n,t.closure,e),i=e.callbacks.approvalResponse;if(i===void 0)return r;let a=lookupDurableDynamicCallback(e.name,`approvalResponse`);return{request:r,response:a===void 0?async()=>{let t=missingCallbackError(e,`approvalResponse`);return log.error(t.message),{reason:t.message,status:`rejected`}}:async e=>await callDurableDynamicCallback(a,i.closure,e)}}function replayDynamicTools(e){return e.map(e=>{let t=e.callbacks.execute,n=lookupDurableDynamicCallback(e.name,`execute`),r=e.callbacks.toModelOutput,s=r===void 0?void 0:lookupDurableDynamicCallback(e.name,`toModelOutput`);return{description:e.description,execute:createToolExecuteWithAuth({scope:e.name,execute:(r,i)=>{if(n===void 0)throw missingCallbackError(e,`execute`);return callDurableDynamicCallback(n,t.closure,r,i)}}),inputSchema:toInputSchema(e.inputSchema),name:e.name,approval:buildReplayedApproval(e),outputSchema:toOutputSchema(e.outputSchema),...r===void 0?{}:{toModelOutput:t=>{if(s===void 0)throw missingCallbackError(e,`toModelOutput`);return callDurableDynamicCallback(s,r.closure,t)}}}})}function buildResponseAuthorizationTools(e){let t=new Map;for(let n of e.context===void 0?[]:buildDynamicTools(e.context))t.has(n.name)||t.set(n.name,n);for(let[n,r]of e.authoredTools)t.has(n)||t.set(n,r);return t}function buildDynamicTools(e){let i=replayDynamicTools(e.get(StepDynamicToolMetadataKey)??[]),a=replayDynamicTools(e.get(TurnDynamicToolMetadataKey)??[]),o=replayDynamicTools(e.get(SessionDynamicToolMetadataKey)??[]);return[...i,...a,...o]}export{buildDynamicTools,buildResponseAuthorizationTools,replayDynamicTools};
|