eve 0.75.1 → 0.76.2
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 +63 -0
- package/dist/src/_virtual/_rolldown/runtime.js +1 -1
- package/dist/src/acp/adapter.js +1 -1
- package/dist/src/channel/channel-address.d.ts +3 -1
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/session-stranded-error.d.ts +25 -0
- package/dist/src/channel/session-stranded-error.js +1 -0
- package/dist/src/channel/session.d.ts +13 -6
- package/dist/src/channel/task-card.js +1 -1
- package/dist/src/channel/tool-eligibility.d.ts +1 -2
- package/dist/src/channel/types.d.ts +29 -1
- package/dist/src/chunks/{use-eve-agent-DK_T88EP.js → use-eve-agent-BtKWTEpm.js} +99 -24
- package/dist/src/chunks/{use-eve-agent-B2Kne9z6.js → use-eve-agent-jI6EsYAu.js} +99 -24
- package/dist/src/cli/commands/registry-project.d.ts +10 -3
- package/dist/src/cli/commands/registry-project.js +2 -2
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/dev/environment.d.ts +0 -6
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/tui/conversation-view.js +1 -1
- package/dist/src/cli/dev/tui/runner.js +3 -3
- package/dist/src/cli/dev/tui/stranded-session.d.ts +9 -0
- package/dist/src/cli/dev/tui/stranded-session.js +1 -0
- package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
- package/dist/src/cli/dev/tui/transcript.js +1 -1
- package/dist/src/client/client-error.d.ts +16 -0
- package/dist/src/client/client-error.js +1 -1
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/index.d.ts +3 -2
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/message-action-parts.d.ts +3 -0
- package/dist/src/client/message-action-parts.js +1 -1
- package/dist/src/client/message-reducer-types.d.ts +6 -1
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/client/open-stream.d.ts +5 -3
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/session-controls.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/transcript-reducer.d.ts +46 -0
- package/dist/src/client/transcript-reducer.js +2 -0
- package/dist/src/compiled/.vendor-stamp.json +3 -2
- package/dist/src/compiled/@eve/catalog/index.js +1 -1
- package/dist/src/compiled/@vercel/queue/index.d.ts +1066 -0
- package/dist/src/compiled/@vercel/queue/index.js +47 -0
- package/dist/src/compiler/connection-ownership.d.ts +6 -0
- package/dist/src/compiler/connection-ownership.js +1 -0
- package/dist/src/compiler/default-tool-policy.d.ts +0 -3
- package/dist/src/compiler/default-tool-policy.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +23 -22
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +9 -6
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-skill.d.ts +5 -0
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +2 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/remote-agent-node.d.ts +2 -1
- package/dist/src/compiler/remote-agent-node.js +1 -1
- package/dist/src/connections/ownership.d.ts +18 -0
- package/dist/src/connections/ownership.js +1 -0
- package/dist/src/context/accessors.d.ts +1 -1
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/build-dynamic-tools.d.ts +3 -9
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-connection-lifecycle.js +1 -1
- package/dist/src/context/dynamic-resolve-context.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -11
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
- package/dist/src/context/keys.d.ts +10 -4
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/memory-tools.js +1 -1
- package/dist/src/context/providers/session.d.ts +1 -0
- package/dist/src/context/providers/session.js +1 -1
- package/dist/src/context/schedule-collection-tools.js +1 -1
- package/dist/src/context/session-context.d.ts +8 -2
- package/dist/src/discover/grammar.d.ts +11 -0
- package/dist/src/discover/grammar.js +1 -1
- package/dist/src/discover/manifest.d.ts +1 -0
- package/dist/src/discover/manifest.js +1 -1
- package/dist/src/discover/skills.d.ts +1 -0
- package/dist/src/discover/skills.js +1 -1
- package/dist/src/dynamic/definition.d.ts +14 -6
- package/dist/src/evals/assertions/collector.d.ts +4 -0
- package/dist/src/evals/assertions/collector.js +1 -1
- package/dist/src/evals/assertions/run.d.ts +2 -3
- package/dist/src/evals/assertions/run.js +2 -2
- package/dist/src/evals/assertions/scoped.js +1 -1
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/match.d.ts +9 -6
- package/dist/src/evals/reported-tool-name.d.ts +9 -0
- package/dist/src/evals/reported-tool-name.js +1 -0
- package/dist/src/evals/runner/derive-run-facts.d.ts +3 -3
- package/dist/src/evals/runner/derive-run-facts.js +1 -1
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.d.ts +11 -0
- package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.js +1 -0
- package/dist/src/evals/runner/reporters/datadog.js +2 -2
- package/dist/src/evals/session.js +2 -2
- package/dist/src/evals/target.d.ts +7 -0
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +19 -2
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.js +2 -2
- package/dist/src/eve-channel/support.d.ts +2 -0
- package/dist/src/eve-channel/support.js +1 -1
- package/dist/src/execution/agent-sessions/remote.js +1 -1
- package/dist/src/execution/agent-sessions/steps.js +1 -1
- package/dist/src/execution/catalog/connection-auth.d.ts +41 -0
- package/dist/src/execution/catalog/connection-auth.js +1 -0
- package/dist/src/execution/catalog/connection-entry.d.ts +16 -0
- package/dist/src/execution/catalog/connection-entry.js +1 -0
- package/dist/src/execution/catalog/listing.d.ts +9 -0
- package/dist/src/execution/catalog/listing.js +3 -0
- package/dist/src/execution/catalog/rank.d.ts +44 -0
- package/dist/src/execution/catalog/rank.js +1 -0
- package/dist/src/execution/catalog/search.d.ts +28 -0
- package/dist/src/execution/catalog/search.js +1 -0
- package/dist/src/execution/catalog/signatures.d.ts +11 -0
- package/dist/src/execution/catalog/signatures.js +1 -0
- package/dist/src/execution/catalog/skills.d.ts +24 -0
- package/dist/src/execution/catalog/skills.js +1 -0
- package/dist/src/execution/catalog/step-catalog.d.ts +51 -0
- package/dist/src/execution/catalog/step-catalog.js +1 -0
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/dynamic-connections.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +15 -0
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/install-workflow-world.d.ts +7 -0
- package/dist/src/execution/install-workflow-world.js +1 -0
- package/dist/src/execution/invoke-tool.js +1 -1
- package/dist/src/execution/legacy-session/authorization.js +1 -1
- package/dist/src/execution/legacy-session/inbox.js +1 -1
- package/dist/src/execution/legacy-session/turn-workflow.js +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/session/active-turn.d.ts +1 -1
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session/handoff-steps.d.ts +11 -0
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/pending-turn-state.js +1 -1
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/timeout-steps.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn.d.ts +5 -5
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/session-event-stream.d.ts +6 -0
- package/dist/src/execution/session-event-stream.js +1 -1
- package/dist/src/execution/session-inbox/address.d.ts +4 -0
- package/dist/src/execution/session-inbox/address.js +1 -1
- package/dist/src/execution/session-inbox/end-stranded-session.d.ts +22 -0
- package/dist/src/execution/session-inbox/end-stranded-session.js +1 -0
- package/dist/src/execution/session-inbox/hook-release.d.ts +4 -0
- package/dist/src/execution/session-inbox/hook-release.js +1 -0
- package/dist/src/execution/session-inbox/owner.d.ts +48 -0
- package/dist/src/execution/session-inbox/owner.js +1 -0
- package/dist/src/execution/session-inbox/resume.d.ts +12 -0
- package/dist/src/execution/session-inbox/resume.js +1 -1
- package/dist/src/execution/session-inbox/runnable-owner.d.ts +13 -0
- package/dist/src/execution/session-inbox/runnable-owner.js +1 -0
- package/dist/src/execution/session-inbox/stranded-replay-guard.d.ts +16 -0
- package/dist/src/execution/session-inbox/stranded-replay-guard.js +1 -0
- package/dist/src/execution/session.js +1 -1
- package/dist/src/execution/skills/instructions.d.ts +20 -10
- package/dist/src/execution/skills/instructions.js +2 -2
- package/dist/src/execution/tasks/calls.d.ts +6 -5
- package/dist/src/execution/tasks/calls.js +1 -1
- package/dist/src/execution/tasks/model-step.d.ts +10 -10
- package/dist/src/execution/tasks/model-step.js +1 -1
- package/dist/src/execution/tasks/render.d.ts +3 -3
- package/dist/src/execution/tasks/render.js +3 -3
- package/dist/src/execution/tasks/session.d.ts +2 -1
- package/dist/src/execution/tasks/table.d.ts +1 -1
- package/dist/src/execution/tasks/tool-entry-point.d.ts +1 -1
- package/dist/src/execution/tool-auth.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/workflow/harness-definition.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +5 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/extensions/code/extension/extension.d.ts +4 -18
- package/dist/src/extensions/code/extension/instructions/github.d.ts +3 -0
- package/dist/src/extensions/code/extension/instructions/github.js +1 -0
- package/dist/src/extensions/code/extension/instructions.md +1 -13
- package/dist/src/extensions/code/extension/lib/diagnostics.d.ts +4 -2
- package/dist/src/extensions/code/extension/lib/diagnostics.js +3 -3
- package/dist/src/extensions/code/extension/lib/github-compat.d.ts +28 -0
- package/dist/src/extensions/code/extension/lib/github-compat.js +1 -0
- package/dist/src/extensions/code/extension/lib/grep-search.d.ts +3 -13
- package/dist/src/extensions/code/extension/lib/grep-search.js +2 -2
- package/dist/src/extensions/code/extension/lib/patch.d.ts +8 -2
- package/dist/src/extensions/code/extension/lib/patch.js +4 -4
- package/dist/src/extensions/code/extension/lib/repository-root.d.ts +3 -4
- package/dist/src/extensions/code/extension/lib/repository-root.js +1 -1
- package/dist/src/extensions/code/extension/lib/sandbox.d.ts +2 -1
- package/dist/src/extensions/code/extension/lib/sandbox.js +1 -1
- package/dist/src/extensions/code/extension/lib/tooling.d.ts +4 -4
- package/dist/src/extensions/code/extension/lib/tooling.js +7 -7
- package/dist/src/extensions/code/extension/lib/workspace-root.d.ts +31 -0
- package/dist/src/extensions/code/extension/lib/workspace-root.js +1 -0
- package/dist/src/extensions/code/extension/skills/pr.d.ts +6 -0
- package/dist/src/extensions/code/extension/skills/pr.js +1 -0
- package/dist/src/extensions/code/extension/tools/apply_patch.d.ts +2 -2
- package/dist/src/extensions/code/extension/tools/apply_patch.js +2 -2
- package/dist/src/extensions/code/extension/tools/gh.d.ts +4 -3
- package/dist/src/extensions/code/extension/tools/gh.js +1 -1
- package/dist/src/extensions/code/extension/tools/grep.js +1 -1
- package/dist/src/extensions/code/tools.d.ts +2 -1
- package/dist/src/extensions/code/tools.js +1 -1
- package/dist/src/extensions/git/extension/extension.d.ts +12 -0
- package/dist/src/extensions/git/extension/extension.js +1 -0
- package/dist/src/extensions/git/extension/instructions/github.d.ts +2 -0
- package/dist/src/extensions/git/extension/instructions/github.js +1 -0
- package/dist/src/extensions/git/extension/lib/gh-tool.d.ts +29 -0
- package/dist/src/extensions/git/extension/lib/gh-tool.js +1 -0
- package/dist/src/extensions/git/extension/lib/github-guidance.d.ts +3 -0
- package/dist/src/extensions/git/extension/lib/github-guidance.js +49 -0
- package/dist/src/extensions/{code → git}/extension/lib/github-shell.d.ts +1 -1
- package/dist/src/extensions/git/extension/lib/github-shell.js +1 -0
- package/dist/src/extensions/git/extension/lib/repository-root.d.ts +5 -0
- package/dist/src/extensions/git/extension/lib/repository-root.js +1 -0
- package/dist/src/extensions/git/extension/lib/sandbox.d.ts +6 -0
- package/dist/src/extensions/git/extension/lib/sandbox.js +1 -0
- package/dist/src/extensions/git/extension/lib/shell.d.ts +1 -0
- package/dist/src/extensions/git/extension/lib/shell.js +1 -0
- package/dist/src/extensions/git/extension/lib/tooling.d.ts +4 -0
- package/dist/src/extensions/git/extension/lib/tooling.js +1 -0
- package/dist/src/extensions/git/extension/skills/pr.d.ts +5 -0
- package/dist/src/extensions/git/extension/skills/pr.js +1 -0
- package/dist/src/extensions/git/extension/tools/gh.d.ts +28 -0
- package/dist/src/extensions/git/extension/tools/gh.js +1 -0
- package/dist/src/extensions/git/tools.d.ts +27 -0
- package/dist/src/extensions/git/tools.js +1 -0
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/action-presentation.d.ts +2 -2
- package/dist/src/harness/action-result-helpers.d.ts +10 -2
- package/dist/src/harness/action-result-helpers.js +1 -1
- package/dist/src/harness/announcements.d.ts +2 -8
- package/dist/src/harness/announcements.js +1 -1
- package/dist/src/harness/compaction/step.js +1 -1
- package/dist/src/harness/coordination.d.ts +11 -11
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/current-messages.d.ts +1 -5
- package/dist/src/harness/current-messages.js +1 -1
- package/dist/src/harness/emission.d.ts +2 -2
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-call.d.ts +48 -0
- package/dist/src/harness/execute-call.js +1 -0
- package/dist/src/harness/execute-tool.d.ts +3 -1
- package/dist/src/harness/final-output.d.ts +2 -6
- package/dist/src/harness/final-output.js +1 -1
- package/dist/src/harness/hitl/approvals.d.ts +5 -0
- package/dist/src/harness/hitl/approvals.js +1 -1
- package/dist/src/harness/hitl/approved-calls.d.ts +3 -2
- package/dist/src/harness/hitl/approved-calls.js +1 -1
- package/dist/src/harness/hitl/candidates.d.ts +13 -2
- package/dist/src/harness/hitl/candidates.js +1 -1
- package/dist/src/harness/hitl/coordinator.d.ts +3 -3
- package/dist/src/harness/hitl/coordinator.js +1 -1
- package/dist/src/harness/hitl/index.d.ts +6 -4
- package/dist/src/harness/hitl/index.js +1 -1
- package/dist/src/harness/hitl/intake.d.ts +3 -3
- package/dist/src/harness/hitl/intake.js +1 -1
- package/dist/src/harness/input-extraction.d.ts +4 -1
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-request-resolution.d.ts +15 -0
- package/dist/src/harness/input-request-resolution.js +1 -1
- package/dist/src/harness/model-call/call.d.ts +4 -6
- package/dist/src/harness/model-call/call.js +1 -1
- package/dist/src/harness/model-call/errors.d.ts +5 -6
- package/dist/src/harness/model-call/errors.js +1 -1
- package/dist/src/harness/model-call/recovery.d.ts +4 -3
- package/dist/src/harness/model-call/request.d.ts +5 -3
- package/dist/src/harness/model-call/request.js +1 -1
- package/dist/src/harness/model-call/response.d.ts +2 -1
- package/dist/src/harness/model-call/response.js +1 -1
- package/dist/src/harness/model-call/run.d.ts +5 -3
- package/dist/src/harness/model-call/run.js +1 -1
- package/dist/src/harness/model-call/tools.d.ts +12 -21
- package/dist/src/harness/model-call/tools.js +1 -1
- package/dist/src/harness/model-profile.d.ts +15 -3
- package/dist/src/harness/model-profile.js +1 -1
- package/dist/src/harness/prompt-cache.d.ts +6 -3
- package/dist/src/harness/prompt-cache.js +1 -1
- package/dist/src/harness/provider-safety.d.ts +2 -1
- package/dist/src/harness/provider-safety.js +1 -1
- package/dist/src/harness/provider-tools.d.ts +7 -6
- package/dist/src/harness/provider-tools.js +1 -1
- package/dist/src/harness/session-machine/commit.js +1 -1
- package/dist/src/harness/session-machine/transitions.d.ts +8 -3
- package/dist/src/harness/session-machine/transitions.js +1 -1
- package/dist/src/harness/step/after-model.js +1 -1
- package/dist/src/harness/step/context.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +4 -6
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-call-input-errors.d.ts +2 -2
- package/dist/src/harness/tool-call-io.d.ts +3 -0
- package/dist/src/harness/tool-call-io.js +1 -1
- package/dist/src/harness/tools.d.ts +22 -19
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/types.d.ts +14 -0
- package/dist/src/instrumentation/lifecycle.d.ts +0 -1
- package/dist/src/instrumentation/native-events.js +1 -1
- package/dist/src/instrumentation/runtime.d.ts +2 -1
- package/dist/src/internal/application/compiled-artifacts.js +4 -4
- package/dist/src/internal/application/package.d.ts +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/stamped-package-version.d.ts +5 -0
- package/dist/src/internal/application/stamped-package-version.js +1 -0
- package/dist/src/internal/authored-definition/core.d.ts +3 -0
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/schedule-collection.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.d.ts +2 -2
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module.d.ts +2 -1
- package/dist/src/internal/authored-module.js +1 -1
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/mcp/skills.js +1 -1
- package/dist/src/internal/model-auth/available-models.js +1 -1
- 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/local-schedules-runtime-plugin.d.ts +5 -0
- package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.js +1 -0
- package/dist/src/internal/nitro/routes/schedule-collection-consumer.d.ts +6 -0
- package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -1
- package/dist/src/internal/schedules/consumer-route.d.ts +2 -0
- package/dist/src/internal/schedules/consumer-route.js +1 -1
- package/dist/src/internal/schedules/dev-environment.d.ts +2 -0
- package/dist/src/internal/schedules/dev-environment.js +1 -0
- package/dist/src/internal/vercel-agent-summary.d.ts +2 -2
- package/dist/src/internal/workflow/development-run-unavailable-error.d.ts +15 -0
- package/dist/src/internal/workflow/development-run-unavailable-error.js +1 -0
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/internal/workflow/vercel-world-defaults.d.ts +1 -1
- package/dist/src/internal/workflow/vercel-world-defaults.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/protocol/catalog-tools.d.ts +12 -0
- package/dist/src/protocol/catalog-tools.js +1 -0
- package/dist/src/protocol/message-version.js +1 -1
- package/dist/src/protocol/message.d.ts +15 -1
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/protocol/remote-agent-protocol.d.ts +2 -0
- package/dist/src/protocol/remote-agent-protocol.js +1 -1
- package/dist/src/protocol/reply-tool.d.ts +2 -0
- package/dist/src/protocol/reply-tool.js +1 -0
- package/dist/src/protocol/runtime-tools.d.ts +6 -0
- package/dist/src/protocol/runtime-tools.js +1 -0
- package/dist/src/protocol/session-projection.js +1 -1
- package/dist/src/protocol/task-tools.d.ts +4 -4
- package/dist/src/protocol/task-tools.js +1 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.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/defaults.js +2 -2
- package/dist/src/public/channels/slack/action-status.d.ts +0 -9
- package/dist/src/public/channels/slack/action-status.js +1 -1
- package/dist/src/public/channels/slack/defaults.js +2 -2
- package/dist/src/public/channels/slack/task-card.d.ts +1 -1
- package/dist/src/public/context/index.d.ts +1 -1
- package/dist/src/public/definitions/callback-context.d.ts +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -0
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/connections/mcp.d.ts +4 -4
- package/dist/src/public/definitions/connections/openapi.d.ts +6 -7
- package/dist/src/public/definitions/remote-agent.d.ts +6 -3
- package/dist/src/public/definitions/workspace-agent.d.ts +6 -3
- package/dist/src/public/experimental/schedules/index.d.ts +1 -1
- package/dist/src/public/models/openai/chatgpt/model.js +1 -1
- package/dist/src/public/models/openai/chatgpt/transport.js +1 -1
- package/dist/src/public/schedules/providers/in-memory.js +1 -1
- package/dist/src/public/schedules/providers/vercel.js +1 -1
- package/dist/src/public/schedules/subscription.d.ts +36 -16
- package/dist/src/public/tanstack/index.d.ts +40 -0
- package/dist/src/public/tanstack/index.js +1 -0
- package/dist/src/public/tools/web-search.d.ts +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +2 -1
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +2 -2
- package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
- package/dist/src/runtime/agent/mock-model-skill-selection.d.ts +2 -0
- package/dist/src/runtime/agent/mock-model-skill-selection.js +2 -2
- package/dist/src/runtime/agent/mock-structured-output.d.ts +1 -1
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/registry.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/connections/tool-result.d.ts +2 -2
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/schedules/collection-client.d.ts +12 -3
- package/dist/src/runtime/schedules/collection-client.js +1 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -2
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +2 -1
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
- package/dist/src/runtime/subagents/registry.d.ts +2 -1
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/tools/registry.d.ts +2 -0
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +3 -3
- package/dist/src/setup/connection-connector.js +1 -2
- package/dist/src/setup/flows/model-login.js +1 -1
- package/dist/src/setup/index.d.ts +1 -1
- package/dist/src/setup/index.js +1 -1
- package/dist/src/setup/integrations/slack/setup.d.ts +23 -3
- package/dist/src/setup/integrations/slack/setup.js +1 -1
- package/dist/src/setup/integrations/web/framework.d.ts +8 -0
- package/dist/src/setup/integrations/web/framework.js +1 -0
- package/dist/src/setup/integrations/web/hosting.d.ts +43 -0
- package/dist/src/setup/integrations/web/hosting.js +15 -0
- package/dist/src/setup/integrations/web/setup.d.ts +6 -10
- package/dist/src/setup/integrations/web/setup.js +23 -17
- package/dist/src/setup/primitives/process-output.d.ts +5 -0
- package/dist/src/setup/primitives/process-output.js +2 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/create/web-template.d.ts +7 -3
- package/dist/src/setup/scaffold/create/web-template.js +40 -3
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/setup/scaffold/update/update-slack-channel.d.ts +17 -0
- package/dist/src/setup/scaffold/update/update-slack-channel.js +1 -1
- package/dist/src/setup/slack-connect-create.d.ts +10 -2
- package/dist/src/setup/slack-connect-create.js +1 -1
- package/dist/src/setup/slack-connect-lifecycle.d.ts +92 -44
- package/dist/src/setup/slack-connect-lifecycle.js +1 -1
- package/dist/src/setup/slack-connect.d.ts +30 -11
- package/dist/src/setup/slack-connect.js +1 -1
- package/dist/src/setup/slack-setup-plan.d.ts +72 -0
- package/dist/src/setup/slack-setup-plan.js +1 -0
- package/dist/src/setup/slackbot.d.ts +75 -35
- package/dist/src/setup/slackbot.js +2 -1
- package/dist/src/setup/vercel-project-framework.js +1 -1
- package/dist/src/shared/action-label.d.ts +10 -0
- package/dist/src/shared/action-label.js +1 -0
- package/dist/src/shared/action-request-name.d.ts +3 -1
- package/dist/src/shared/action-request-name.js +1 -1
- package/dist/src/shared/action-types.d.ts +7 -8
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +36 -3
- package/dist/src/shared/agent-definition.js +1 -1
- package/dist/src/shared/chatgpt-model.d.ts +8 -0
- package/dist/src/shared/chatgpt-model.js +1 -1
- package/dist/src/shared/development-env-files.d.ts +4 -0
- package/dist/src/shared/development-env-files.js +1 -0
- package/dist/src/shared/input.d.ts +0 -1
- package/dist/src/shared/map-with-concurrency.d.ts +2 -0
- package/dist/src/shared/map-with-concurrency.js +1 -0
- package/dist/src/shared/skill-definition.d.ts +6 -0
- package/dist/src/shared/skill-package.d.ts +1 -0
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/web-search.d.ts +15 -2
- package/dist/src/shared/web-search.js +1 -1
- package/dist/src/subagents/callback-route.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tool-stubs/execute.d.ts +0 -3
- package/dist/src/tool-stubs/execute.js +1 -1
- package/dist/src/tool-stubs/rules.js +1 -1
- package/dist/src/tool-stubs/validate-targets.js +1 -1
- package/dist/src/tools/behavior.d.ts +3 -6
- package/dist/src/tools/definition.d.ts +5 -0
- package/dist/src/tools/dynamic.d.ts +5 -2
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tools/provided/task-cancel.d.ts +1 -1
- package/dist/src/tools/provided/task-wait.d.ts +1 -1
- package/dist/src/tools/provided/web-search.d.ts +20 -7
- package/dist/src/tools/provided/web-search.js +1 -1
- package/dist/src/tools/schema.d.ts +5 -0
- package/dist/src/tools/schema.js +1 -1
- package/dist/src/{runtime/connections/tool-signature.d.ts → tools/signature.d.ts} +2 -2
- package/dist/src/tools/workflow-definition.d.ts +1 -1
- package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-runtime-context.d.ts +1 -0
- package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
- package/dist/src/tracing/agent-otel-turn-state.d.ts +6 -0
- package/dist/src/tracing/agent-otel-turn-state.js +1 -0
- package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
- package/dist/src/tracing/agent-trace-context-codec.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +4 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +39 -8
- package/docs/channels/chat-sdk.mdx +1 -1
- package/docs/channels/custom.mdx +26 -0
- package/docs/channels/eve.mdx +8 -5
- package/docs/channels/slack.mdx +32 -82
- package/docs/code-extension.mdx +28 -7
- package/docs/concepts/built-in-tools.md +60 -43
- package/docs/concepts/context-control.md +1 -1
- package/docs/concepts/execution-model-and-durability.mdx +101 -1
- package/docs/concepts/project-structure.mdx +2 -2
- package/docs/concepts/sessions-runs-and-streaming.md +40 -38
- package/docs/connections/mcp.mdx +5 -5
- package/docs/connections/openapi.mdx +1 -1
- package/docs/connections/overview.mdx +4 -2
- package/docs/evals/assertions.mdx +5 -3
- package/docs/evals/reporters.mdx +3 -1
- package/docs/evals/tool-stubs.mdx +3 -1
- package/docs/extensions.md +2 -0
- package/docs/guides/client/messages.mdx +10 -1
- package/docs/guides/deployment/overview.md +2 -2
- package/docs/guides/dev-tui.md +4 -2
- package/docs/guides/dynamic-capabilities.md +14 -4
- package/docs/guides/frontend/meta.json +9 -1
- package/docs/guides/frontend/nextjs.mdx +1 -1
- package/docs/guides/frontend/overview.mdx +10 -9
- package/docs/guides/frontend/tanstack.mdx +201 -0
- package/docs/guides/remote-agents.md +10 -3
- package/docs/guides/session-context.md +1 -0
- package/docs/install-integrations.mdx +1 -1
- package/docs/instructions.mdx +6 -6
- package/docs/reference/cli.md +2 -2
- package/docs/reference/typescript-api.md +4 -4
- package/docs/skills.mdx +19 -4
- package/docs/subagents/index.mdx +5 -3
- package/docs/tools/human-in-the-loop.md +2 -0
- package/docs/tools/overview.mdx +22 -1
- package/docs/tools/tasks-upgrade.md +1 -1
- package/docs/tools/tasks.md +32 -32
- package/docs/tools/workflows.mdx +6 -6
- package/docs/tutorial/ship-it.mdx +1 -1
- package/docs/tutorial/team-playbooks.mdx +2 -2
- package/package.json +28 -6
- package/dist/src/execution/connection-announcement.d.ts +0 -7
- package/dist/src/execution/connection-announcement.js +0 -4
- package/dist/src/execution/tools/connection-approval.d.ts +0 -25
- package/dist/src/execution/tools/connection-approval.js +0 -1
- package/dist/src/execution/tools/connection-search-rank.d.ts +0 -21
- package/dist/src/execution/tools/connection-search-rank.js +0 -1
- package/dist/src/execution/tools/connection-target.d.ts +0 -18
- package/dist/src/execution/tools/connection-target.js +0 -1
- package/dist/src/execution/tools/connection-tools.d.ts +0 -4
- package/dist/src/execution/tools/connection-tools.js +0 -2
- package/dist/src/execution/tools/load-skill.d.ts +0 -10
- package/dist/src/execution/tools/load-skill.js +0 -1
- package/dist/src/extensions/code/extension/lib/github-shell.js +0 -1
- package/dist/src/extensions/code/extension/skills/pr/SKILL.md +0 -53
- package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.d.ts +0 -2
- package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.js +0 -1
- package/dist/src/harness/advertised-tools.d.ts +0 -26
- package/dist/src/harness/advertised-tools.js +0 -1
- package/dist/src/harness/nested-actions.d.ts +0 -23
- package/dist/src/harness/nested-actions.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cli-config.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cred-storage.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.zod.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/types.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/envpath.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errors.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errutils.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/exec.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/fsutils.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/lookup.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/safety.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/auth-errors.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-context.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/index.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/oauth.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-error.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-io.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-util.js +0 -2
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/version.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_queue@0.5.1_@opentelemetry_api@1.9.1/node_modules/@vercel/queue/dist/index.js +0 -36
- package/dist/src/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +0 -1
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +0 -2
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +0 -1
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +0 -1
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +0 -1
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +0 -1
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +0 -1
- package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +0 -1
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +0 -1
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +0 -1
- package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +0 -1
- package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js +0 -1
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js +0 -1
- package/dist/src/node_modules/.pnpm/mixpart@0.0.6/node_modules/mixpart/dist/index.js +0 -7
- package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +0 -1
- package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +0 -1
- package/dist/src/node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +0 -1
- package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +0 -1
- package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +0 -1
- package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +0 -1
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +0 -1
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +0 -1
- package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +0 -2
- package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +0 -1
- package/dist/src/node_modules/.pnpm/xdg-app-paths@5.5.1/node_modules/xdg-app-paths/src/lib/index.js +0 -1
- package/dist/src/node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js +0 -1
- package/dist/src/public/tools/load-skill.d.ts +0 -3
- package/dist/src/public/tools/load-skill.js +0 -1
- package/dist/src/runtime/skills/fragment-context.d.ts +0 -4
- package/dist/src/runtime/skills/fragment-context.js +0 -1
- package/dist/src/tools/framework/connection-tools.d.ts +0 -3
- package/dist/src/tools/framework/connection-tools.js +0 -1
- package/dist/src/tools/provided/load-skill.d.ts +0 -2
- package/dist/src/tools/provided/load-skill.js +0 -1
- /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.d.ts +0 -0
- /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.js +0 -0
- /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.d.ts +0 -0
- /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.js +0 -0
- /package/dist/src/{runtime/connections/tool-signature.js → tools/signature.js} +0 -0
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { GenerateTextOnStepStartCallback, ModelMessage, PrepareStepFunction, ProviderMetadata, StepResult, ToolSet } from "ai";
|
|
2
2
|
import type { TurnPosition } from "#harness/session-machine/view.js";
|
|
3
3
|
import type { ModelProfile } from "#harness/model-profile.js";
|
|
4
|
-
import { type HarnessEmitFn, type HarnessSession, type
|
|
4
|
+
import { type HarnessEmitFn, type HarnessSession, type HarnessToolLookup } from "#harness/types.js";
|
|
5
5
|
/**
|
|
6
|
-
* The subset of `StepResult` that the harness reads after a step completes
|
|
7
|
-
*
|
|
8
|
-
* Used by both the streaming (`onStepEnd` callback) and non-streaming
|
|
9
|
-
* (`generateText` result) code paths.
|
|
6
|
+
* The subset of `StepResult` that the harness reads after a step completes, captured by the
|
|
7
|
+
* `onStepEnd` callback.
|
|
10
8
|
*/
|
|
11
9
|
export type HarnessStepResult = Pick<StepResult<ToolSet>, "content" | "finishReason" | "providerMetadata" | "response" | "text" | "toolCalls" | "toolResults" | "usage"> & {
|
|
12
10
|
readonly invalidInputToolCallIds?: ReadonlySet<string>;
|
|
@@ -95,7 +93,7 @@ export declare function emitStepActions(emitFn: HarnessEmitFn, state: TurnPositi
|
|
|
95
93
|
readonly excludedActionCallIds?: ReadonlySet<string>;
|
|
96
94
|
readonly excludedActionToolNames: ReadonlySet<string>;
|
|
97
95
|
readonly handledInlineToolResultCallIds?: ReadonlySet<string>;
|
|
98
|
-
readonly tools:
|
|
96
|
+
readonly tools: HarnessToolLookup;
|
|
99
97
|
}): Promise<void>;
|
|
100
98
|
export declare function readGatewayGenerationId(providerMetadata: ProviderMetadata | undefined): string | undefined;
|
|
101
99
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{contextStorage}from"#context/container.js";import{AuthKey}from"#context/keys.js";import{createActionResultEvent,createActionsRequestedEvent,createStepCompletedEvent}from"#protocol/message.js";import{
|
|
1
|
+
import{contextStorage}from"#context/container.js";import{AuthKey}from"#context/keys.js";import{createActionResultEvent,createActionsRequestedEvent,createStepCompletedEvent}from"#protocol/message.js";import{isAuthorizationSignal,isPendingAuthorizationToolOutput}from"#harness/authorization.js";import{createRuntimeToolResultFromMessagePart,createRuntimeToolResultFromStepResult,createRuntimeToolResultFromToolError,toActionResult}from"#harness/action-result-helpers.js";import{requireSessionModelReference}from"#harness/types.js";import{resolveCallProviderOptions}from"#harness/provider-safety.js";import{isInvalidToolCall}from"#harness/tool-call-input-errors.js";import{collectActionPresentation,createPresentedRuntimeActionRequestFromToolCall}from"#harness/action-presentation.js";import{normalizeAssistantStepFinishReason}from"#harness/finish-reason.js";import{extractToolApprovalInputRequests}from"#harness/input-extraction.js";import{readToolInterrupt}from"#harness/tool-interrupts.js";import{applyConversationCacheControl,mergeGatewayAutoCaching}from"#harness/prompt-cache.js";function buildStepHooks(e){let t=e.session,n;return{onStepEnd:async e=>{n(e)},onStepStart:async({messages:t})=>{await e.startStep?.(t)},prepareStep:async({messages:n})=>{let{profile:r}=e,i={messages:r.anthropicCache?applyConversationCacheControl(n,r.anthropicCache):n},a=requireSessionModelReference(t),o=resolveCallProviderOptions({auth:e.auth??contextStorage.getStore()?.get(AuthKey)??null,profile:r,providerOptions:a.providerOptions,session:t});return r.gateway?i.providerOptions=mergeGatewayAutoCaching(o):o!==void 0&&(i.providerOptions=o),i},stepResult:new Promise(e=>{n=e})}}async function emitStepActions(e,t,n,r){let i=new Set(n.toolCalls.filter(isProviderExecutedToolCall).map(e=>e.toolCallId)),a=new Set([...r.excludedActionCallIds??[],...i,...extractToolApprovalInputRequests({content:n.content??[],excludedCallIds:r.excludedActionCallIds,tools:r.tools}).map(e=>e.action.callId),...n.toolCalls.filter(isInvalidToolCall).map(e=>e.toolCallId)]),isExcluded=(e,t)=>a.has(e)||r.excludedActionToolNames.has(t),o=n.toolCalls.filter(e=>!isExcluded(e.toolCallId,e.toolName)&&!r.emittedActionCallIds?.has(e.toolCallId)).map(e=>createPresentedRuntimeActionRequestFromToolCall({toolCall:e,tools:r.tools}));o.length>0&&await e(createActionsRequestedEvent({actions:o.map(({action:e})=>e),presentation:collectActionPresentation(o),sequence:t.sequence,stepIndex:t.stepIndex,turnId:t.turnId}));let s=r.handledInlineToolResultCallIds,c=new Map(n.toolResults.map(e=>[e.toolCallId,e.output])),l=new Map(n.toolCalls.map(e=>[e.toolCallId,e.input]));for(let r of reconcileToolResults(n)){if(isExcluded(r.callId,r.toolName)||s?.has(r.callId))continue;let n=c.get(r.callId);shouldSkipAuthorizationActionResult(r.callId,n)||await e(createActionResultEvent({result:toActionResult(r,l.get(r.callId)),sequence:t.sequence,stepIndex:t.stepIndex,turnId:t.turnId}))}await e(createStepCompletedEvent({finishReason:normalizeAssistantStepFinishReason(n.finishReason),providerMetadata:extractStepProviderMetadata(n.providerMetadata),sequence:t.sequence,stepIndex:t.stepIndex,turnId:t.turnId,usage:extractStepUsage({costUsd:extractGatewayCostUsd(n.providerMetadata),usage:n.usage})}))}function isProviderExecutedToolCall(e){return e.providerExecuted===!0}function reconcileToolResults(e){let t=new Map;for(let n of e.toolResults)n.providerExecuted!==!0&&t.set(n.toolCallId,createRuntimeToolResultFromStepResult(n));for(let n of e.content??[])n.type===`tool-error`&&n.providerExecuted!==!0&&(t.has(n.toolCallId)||t.set(n.toolCallId,createRuntimeToolResultFromToolError(n)));let n=new Map(e.toolCalls.map(e=>[e.toolCallId,e.toolName]));for(let r of extractToolResultParts(e.response.messages))r.providerExecuted!==!0&&(t.has(r.toolCallId)||t.set(r.toolCallId,createRuntimeToolResultFromMessagePart(r,n.get(r.toolCallId)??r.toolName)));return[...t.values()]}function shouldSkipAuthorizationActionResult(e,t){if(t!==void 0&&isPendingAuthorizationToolOutput(t))return!0;let n=contextStorage.getStore();if(n===void 0)return!1;let r=readToolInterrupt(n,e);return r!==void 0&&isAuthorizationSignal(r)}function extractToolResultParts(e){let t=[];for(let n of e)if(n.role===`tool`&&Array.isArray(n.content))for(let e of n.content)e.type===`tool-result`&&t.push(e);return t}function extractStepUsage(e){let t={};e.costUsd!==void 0&&(t.costUsd=e.costUsd);let n=e.usage;return n===void 0?Object.keys(t).length>0?t:void 0:(n.inputTokens!==void 0&&(t.inputTokens=n.inputTokens),n.outputTokens!==void 0&&(t.outputTokens=n.outputTokens),n.inputTokenDetails?.cacheReadTokens!==void 0&&(t.cacheReadTokens=n.inputTokenDetails.cacheReadTokens),n.inputTokenDetails?.cacheWriteTokens!==void 0&&(t.cacheWriteTokens=n.inputTokenDetails.cacheWriteTokens),Object.keys(t).length>0?t:void 0)}function extractStepProviderMetadata(e){let t=readGatewayGenerationId(e);return t===void 0?void 0:{gateway:{generationId:t}}}function extractGatewayCostUsd(e){let t=readGatewayMetadata(e)?.cost;if(typeof t==`number`&&Number.isFinite(t))return t;if(typeof t==`string`){let e=Number(t);return Number.isFinite(e)?e:void 0}}function readGatewayGenerationId(e){let t=readGatewayMetadata(e)?.generationId;return typeof t==`string`&&t.length>0?t:void 0}function readGatewayMetadata(e){let t=e?.gateway;return t&&typeof t==`object`&&!Array.isArray(t)?t:void 0}export{buildStepHooks,emitStepActions,readGatewayGenerationId};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToolSet, TypedToolCall, TypedToolError } from "ai";
|
|
2
2
|
import { type RuntimeActionRequestProjection } from "#harness/action-presentation.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { HarnessToolLookup } from "#harness/types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Returns true when the AI SDK marked the tool call `invalid` (typically
|
|
6
6
|
* because the model emitted unparsable JSON or targeted an unknown tool).
|
|
@@ -28,7 +28,7 @@ export declare function resolveProviderToolCallRequest(toolCall: {
|
|
|
28
28
|
readonly input?: unknown;
|
|
29
29
|
readonly toolCallId: string;
|
|
30
30
|
readonly toolName: string;
|
|
31
|
-
}, tools:
|
|
31
|
+
}, tools: HarnessToolLookup): {
|
|
32
32
|
readonly request: RuntimeActionRequestProjection;
|
|
33
33
|
readonly toolError?: undefined;
|
|
34
34
|
} | {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { StandardSchemaV1 } from "#compiled/@standard-schema/spec/index.js";
|
|
1
2
|
import type { HarnessToolDefinition } from "#harness/execute-tool.js";
|
|
2
3
|
import { type ToolModelOutputValue } from "#harness/tool-model-output.js";
|
|
3
4
|
import type { JsonObject } from "#shared/json.js";
|
|
@@ -7,6 +8,8 @@ export type ToolCallInputCheck = {
|
|
|
7
8
|
readonly value: JsonObject;
|
|
8
9
|
} | {
|
|
9
10
|
readonly kind: "invalid";
|
|
11
|
+
/** What is wrong with the input, for a caller that reports it in its own words. */
|
|
12
|
+
readonly issues: readonly StandardSchemaV1.Issue[];
|
|
10
13
|
readonly message: string;
|
|
11
14
|
} | {
|
|
12
15
|
readonly kind: "threw";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{asSchema}from"ai";import{toErrorMessage}from"#shared/errors.js";import{toModelSchema}from"#tools/schema.js";import{
|
|
1
|
+
import{TypeValidationError,asSchema}from"ai";import{isObject}from"#shared/guards.js";import{toErrorMessage}from"#shared/errors.js";import{toModelSchema}from"#tools/schema.js";import{authorizationPendingModelText,isAuthorizationPendingModelOutput}from"#harness/authorization.js";import{resolveToolCallInputObject}from"#harness/coordination.js";import{normalizeToolModelOutput}from"#harness/tool-model-output.js";import{observeToolOutput}from"#tool-stubs/execute.js";async function checkToolCallInput(e,t,n){let r;try{r=resolveToolCallInputObject(t,{callId:n,toolName:e.name})}catch(t){return invalidInput(e.name,t)}let i;try{let t=asSchema(toModelSchema(e.inputSchema,`input`));if(t.validate===void 0)return{kind:`valid`,value:r};i=await t.validate(r)}catch(e){return{error:e,kind:`threw`}}return i.success?{kind:`valid`,value:i.value}:invalidInput(e.name,i.error)}function invalidInput(e,t){return{issues:schemaIssues(t),kind:`invalid`,message:`Invalid input for tool "${e}": ${toErrorMessage(t)}`}}function schemaIssues(e){let t=TypeValidationError.isInstance(e)?e.cause:void 0;return Array.isArray(t)&&t.every(isIssue)?t:[{message:toErrorMessage(e)}]}function isIssue(e){return isObject(e)&&typeof e.message==`string`}async function toolCallModelOutput(e,t,n){return await observeToolOutput(e.name,n===void 0?[]:[{callId:n}],async()=>isAuthorizationPendingModelOutput(t)?{type:`text`,value:authorizationPendingModelText(t.connections)}:e.toModelOutput===void 0?typeof t==`string`?{type:`text`,value:t}:normalizeToolModelOutput({output:{type:`json`,value:t??null},toolCallId:n,toolName:e.name}):normalizeToolModelOutput({output:await e.toModelOutput(t),toolCallId:n,toolName:e.name}))}export{checkToolCallInput,toolCallModelOutput};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type ToolApprovalConfiguration, type ToolSet } from "ai";
|
|
2
2
|
import type { ModelProfile } from "#harness/model-profile.js";
|
|
3
3
|
import type { HarnessToolDefinition } from "#harness/execute-tool.js";
|
|
4
|
-
import type { HarnessToolMap } from "#harness/types.js";
|
|
4
|
+
import type { CallResolver, HarnessToolMap } from "#harness/types.js";
|
|
5
5
|
import type { ToolExecuteOptions } from "#tools/definition.js";
|
|
6
6
|
/**
|
|
7
|
-
* Builds an AI SDK `ToolSet` from unified harness tool definitions
|
|
7
|
+
* Builds an AI SDK `ToolSet` from unified harness tool definitions, described
|
|
8
|
+
* by `describe`. Each call's output is projected by the entry `resolve`
|
|
9
|
+
* resolves it to.
|
|
8
10
|
*
|
|
9
11
|
* Tools without `execute` are surfaced to the model as client-side tools
|
|
10
12
|
* (no server execution).
|
|
@@ -15,29 +17,22 @@ import type { ToolExecuteOptions } from "#tools/definition.js";
|
|
|
15
17
|
* retry call so the request can proceed without it.
|
|
16
18
|
*/
|
|
17
19
|
export declare function buildToolSet(input: {
|
|
18
|
-
readonly
|
|
20
|
+
readonly describe: (definition: HarnessToolDefinition) => string;
|
|
19
21
|
readonly disabledProviderTools?: ReadonlySet<string>;
|
|
22
|
+
readonly resolve: CallResolver;
|
|
20
23
|
readonly tools: HarnessToolMap;
|
|
21
24
|
}): ToolSet;
|
|
22
|
-
/**
|
|
23
|
-
* Builds a ToolSet from an ordered list of harness definitions.
|
|
24
|
-
*
|
|
25
|
-
* The first definition for a name wins, matching the dynamic-tool scope
|
|
26
|
-
* ordering where step tools override turn/session tools.
|
|
27
|
-
*/
|
|
28
|
-
export declare function buildToolSetFromDefinitions(input: {
|
|
29
|
-
readonly approvedTools?: ReadonlySet<string>;
|
|
30
|
-
readonly disabledProviderTools?: ReadonlySet<string>;
|
|
31
|
-
readonly tools: readonly HarnessToolDefinition[];
|
|
32
|
-
}): ToolSet;
|
|
33
25
|
/**
|
|
34
26
|
* Wraps a tool's `execute` so a returned {@link AuthorizationSignal} is
|
|
35
27
|
* stashed out-of-band ({@link stashToolInterrupt}) for the park detector while
|
|
36
28
|
* the AI SDK records an opaque {@link AuthorizationPendingModelOutput} that
|
|
37
29
|
* omits OAuth URLs, user codes, and hook URLs from model-facing history.
|
|
38
|
-
* Returns `undefined` for client-side tools (no `execute`).
|
|
30
|
+
* Returns `undefined` for client-side tools (no `execute`). With `resolve`,
|
|
31
|
+
* output is normalized under the name of the entry each call resolves to, so
|
|
32
|
+
* an error from a call through `execute` names the entry, and a tool stub
|
|
33
|
+
* matches that entry and its input, as it would a direct call.
|
|
39
34
|
*/
|
|
40
|
-
export declare function wrapToolExecute(definition: HarnessToolDefinition): ((input: any, options: ToolExecuteOptions) => Promise<any> | AsyncIterable<any>) | undefined;
|
|
35
|
+
export declare function wrapToolExecute(definition: HarnessToolDefinition, resolve?: CallResolver): ((input: any, options: ToolExecuteOptions) => Promise<any> | AsyncIterable<any>) | undefined;
|
|
41
36
|
/**
|
|
42
37
|
* Builds the AI SDK ToolSet for one harness step.
|
|
43
38
|
*
|
|
@@ -58,11 +53,21 @@ export declare function wrapToolExecute(definition: HarnessToolDefinition): ((in
|
|
|
58
53
|
* a gateway fallback provider has rejected a provider-specific tool.
|
|
59
54
|
*/
|
|
60
55
|
export declare function buildToolSetWithProviderTools(input: {
|
|
61
|
-
readonly
|
|
56
|
+
readonly describe: (definition: HarnessToolDefinition) => string;
|
|
62
57
|
readonly disabledProviderTools?: ReadonlySet<string>;
|
|
63
58
|
readonly profile: ModelProfile;
|
|
59
|
+
readonly resolve: CallResolver;
|
|
64
60
|
readonly tools: HarnessToolMap;
|
|
65
61
|
}): Promise<ToolSet>;
|
|
62
|
+
/**
|
|
63
|
+
* Builds the AI SDK 7 call-level approval policy: each call is approved by the
|
|
64
|
+
* entry it runs, under that entry's name and with its own input.
|
|
65
|
+
*/
|
|
66
|
+
export declare function buildToolApproval(input: {
|
|
67
|
+
readonly abortSignal?: AbortSignal;
|
|
68
|
+
readonly approvedTools: ReadonlySet<string>;
|
|
69
|
+
readonly resolve: CallResolver;
|
|
70
|
+
}): ToolApprovalConfiguration<ToolSet, Record<string, unknown>>;
|
|
66
71
|
/**
|
|
67
72
|
* Re-runs a tool's approval policy for a call a person approved, just before eve runs it, so the
|
|
68
73
|
* policy can still refuse it, as when the connection it was approved against changed.
|
|
@@ -76,5 +81,3 @@ export declare function recheckApprovedCall(definition: HarnessToolDefinition, c
|
|
|
76
81
|
readonly denied: boolean;
|
|
77
82
|
readonly reason?: string;
|
|
78
83
|
}>;
|
|
79
|
-
/** Builds the AI SDK 7 call-level approval policy for an assembled tool set. */
|
|
80
|
-
export declare function buildToolApproval(tools: ToolSet, abortSignal?: AbortSignal): ToolApprovalConfiguration<ToolSet, Record<string, unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{tool}from"ai";import{isObject}from"#shared/guards.js";import{loadContext}from"#context/container.js";import{toModelSchema}from"#tools/schema.js";import{buildCallbackContext}from"#context/build-callback-context.js";import{resolveApprovalPolicy}from"#approval/definition.js";import{isApprovedToolCall,markApprovalRecheck}from"#harness/approval-recheck.js";import{isAuthorizationSignal,modelFacingAuthorizationOutput}from"#harness/authorization.js";import{
|
|
1
|
+
import{tool}from"ai";import{createLogger}from"#internal/logging.js";import{isObject}from"#shared/guards.js";import{loadContext}from"#context/container.js";import{toModelSchema}from"#tools/schema.js";import{buildCallbackContext}from"#context/build-callback-context.js";import{resolveApprovalPolicy}from"#approval/definition.js";import{isApprovedToolCall,markApprovalRecheck}from"#harness/approval-recheck.js";import{isAuthorizationSignal,modelFacingAuthorizationOutput}from"#harness/authorization.js";import{entryModelOutput,stubbedCall}from"#harness/execute-call.js";import{normalizeToolJsonOutput}from"#harness/tool-model-output.js";import{isAsyncIterable}from"#shared/async-iterable.js";import{executeWithToolStub}from"#tool-stubs/execute.js";import{stashToolInterrupt}from"#harness/tool-interrupts.js";import{resolveWebSearchBackend,resolveWebSearchProviderTool}from"#harness/provider-tools.js";import{iterateAsApprover,runAsApprover}from"#harness/hitl/approved-call-callers.js";const log=createLogger(`harness.tools`);function buildToolSet(e){let t={},n=e.disabledProviderTools;for(let r of e.tools.values())n?.has(r.name)||(t[r.name]=tool({description:e.describe(r),execute:wrapToolExecute(r,e.resolve),inputSchema:toModelSchema(r.inputSchema,`input`),strict:!1,outputSchema:toModelSchema(r.outputSchema,`output`),...r.execute!==void 0||r.toModelOutput!==void 0?{toModelOutput:({input:t,output:n,toolCallId:i})=>entryModelOutput(e.resolve({input:t,toolName:r.name})?.definition??r,n,i)}:{}}));return t}function wrapToolExecute(e,t){let n=e.execute;if(n!==void 0)return(r,i)=>{let a={input:r,toolName:e.name},o=t?.(a),s=o?.definition.name??e.name,c=stubbedCall(a,o),run=()=>n(r,i),l;try{l=runAsApprover(i.toolCallId,()=>c===void 0?run():executeWithToolStub(c.toolName,c.input,i,run))}catch(e){return Promise.reject(e)}return isAsyncIterable(l)?normalizeToolExecuteIterable(iterateAsApprover(i.toolCallId,l),s,i):Promise.resolve(l).then(e=>normalizeToolExecuteOutput(e,s,i))}}async function*normalizeToolExecuteIterable(e,t,n){for await(let r of e)yield normalizeToolExecuteOutput(r,t,n)}function normalizeToolExecuteOutput(e,t,n){return isAuthorizationSignal(e)?(stashToolInterrupt(loadContext(),n.toolCallId,e),modelFacingAuthorizationOutput(e)):normalizeToolJsonOutput({boundary:`execute`,output:e,toolCallId:n.toolCallId,toolName:t})}async function buildToolSetWithProviderTools(e){let t=e.disabledProviderTools,n={...buildToolSet(e)};for(let r of e.tools.values()){let i=r.behavior?.handling;if(i?.kind===`provider-tool`&&r.execute===void 0&&!t?.has(r.name)){let t=resolveWebSearchBackend(e.profile,i);t===null?(log.debug(`model has no web search backend; leaving the tool out`,{gateway:e.profile.gateway,modelProvider:e.profile.provider,searchProvider:i.provider,tool:r.name}),delete n[r.name]):n[r.name]=await resolveWebSearchProviderTool(t)}}return n}function buildToolApproval(e){return async({toolCall:t,messages:n})=>{let r=e.resolve(t);if(r!==void 0)return await evaluateApproval(r.definition,{abortSignal:e.abortSignal,approvedTools:e.approvedTools,callId:t.toolCallId,input:r.call.input,recheck:isApprovedToolCall(n,t.toolCallId)})}}async function recheckApprovedCall(e,t){let n=await evaluateApproval(e,{...t,recheck:!0});return n===`denied`?{denied:!0}:typeof n==`object`&&n&&n.type===`denied`?{denied:!0,reason:n.reason}:{denied:!1}}async function evaluateApproval(e,t){if(e.approval===void 0)return;let n={...buildCallbackContext(),abortSignal:t.abortSignal??new AbortController().signal,approvedTools:t.approvedTools??new Set,callId:t.callId,toolInput:isObject(t.input)?t.input:void 0,toolName:e.name},r=await resolveApprovalPolicy(e.approval)(t.recheck?markApprovalRecheck(n):n);return typeof r==`boolean`?r?`user-approval`:`not-applicable`:r}export{buildToolApproval,buildToolSet,buildToolSetWithProviderTools,recheckApprovedCall,wrapToolExecute};
|
|
@@ -221,6 +221,20 @@ export type StepFn = (session: HarnessSession, input?: StepInput) => Promise<Ste
|
|
|
221
221
|
* (via {@link buildToolSet}), approval gates, and compaction hooks.
|
|
222
222
|
*/
|
|
223
223
|
export type HarnessToolMap = ReadonlyMap<string, HarnessToolDefinition>;
|
|
224
|
+
/** Looks up the definition a call runs by its entry name. */
|
|
225
|
+
export type HarnessToolLookup = Pick<HarnessToolMap, "get">;
|
|
226
|
+
/** The parts of a model tool call that name what it runs. */
|
|
227
|
+
export interface ToolCallLike {
|
|
228
|
+
readonly input: unknown;
|
|
229
|
+
readonly toolName: string;
|
|
230
|
+
}
|
|
231
|
+
/** A model tool call as the call to its entry, with the entry it runs. */
|
|
232
|
+
export interface ResolvedCall<T extends ToolCallLike> {
|
|
233
|
+
readonly call: T;
|
|
234
|
+
readonly definition: HarnessToolDefinition;
|
|
235
|
+
}
|
|
236
|
+
/** Resolves a model tool call to the entry it runs, if it reaches one. */
|
|
237
|
+
export type CallResolver = <T extends ToolCallLike>(toolCall: T) => ResolvedCall<T> | undefined;
|
|
224
238
|
/**
|
|
225
239
|
* Callback that writes one event to the event stream.
|
|
226
240
|
*
|
|
@@ -352,7 +352,6 @@ export type InstrumentationToolCallKind = "load-skill" | "remote-agent-call" | "
|
|
|
352
352
|
export interface InstrumentationToolCallStartedEvent {
|
|
353
353
|
/** Durable dispatch metadata, when this call is owned by eve's tool loop. */
|
|
354
354
|
readonly kind?: InstrumentationToolCallKind;
|
|
355
|
-
readonly parentCallId?: string;
|
|
356
355
|
readonly isWorkflowTool?: boolean;
|
|
357
356
|
readonly frameworkTool?: boolean;
|
|
358
357
|
readonly startedAtMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{contextStorage}from"#context/container.js";import{rememberInstrumentationActionScope,rememberInstrumentationInputScope,takeInstrumentationActionScopeForCall,takeInstrumentationInputScope}from"#instrumentation/state.js";import{RuntimeActionSettlementTimesKey}from"#harness/runtime-action-settlement-state.js";import{isRuntimeWorkflowToolAction}from"#shared/action-types.js";import{actionIdempotencyKey,inputIdempotencyKey,sessionIdempotencyKey,toolCallIdempotencyKey,turnIdempotencyKey}from"#instrumentation/lifecycle.js";import{instrumentChannelDelivery}from"#instrumentation/channel-delivery.js";function createInstrumentationHandleEvent(e){if(e.hooks===void 0)return e.handleEvent;if(e.handleEvent===void 0)return;let t=e.handleEvent,n=e.hooks,r=new Set,i=new Set,a=e.turnId;return async(o,s)=>{let c=Date.now();await t(o,s);let l=toLifecycleEvent(o,e,a);if(o.type===`turn.started`&&(a=o.data.turnId),o.type===`turn.cancelled`||o.type===`turn.completed`||o.type===`turn.failed`||o.type===`session.completed`||o.type===`session.failed`){let e=contextStorage.getStore();e!==void 0&&await instrumentChannelDelivery({ctx:e,error:o.type===`turn.failed`||o.type===`session.failed`?Error(o.data.message):void 0,errorCode:o.type===`turn.failed`||o.type===`session.failed`?o.data.code:void 0,hooks:n,includeTurn:o.type===`turn.cancelled`||o.type===`turn.completed`||o.type===`turn.failed`||o.type===`session.failed`,outcome:o.type===`turn.failed`||o.type===`session.failed`?`failed`:o.type===`turn.cancelled`?`cancelled`:`completed`})}l!==void 0&&await n.publish(l),o.type===`actions.requested`?await publishActionStarts(o,e,n,r,c):o.type===`action.result`?await publishActionTerminal(o,e,n):o.type===`input.requested`&&await publishInputStarts(o,e,n,i)}}async function publishInputStarts(e,t,n,r){let i=t.getAttemptScope?.();if(i===void 0)return;let a=n.capturesOutputs??n.capturesContent;for(let o of e.data.requests){let s=inputIdempotencyKey(t.sessionId,e.data.turnId,o.requestId);r.has(s)||(r.add(s),rememberInstrumentationInputScope(s,i),await n.publish(Object.freeze({action:Object.freeze({callId:o.action.callId,name:o.action.toolName}),idempotencyKey:s,kind:o.kind,request:a?Object.freeze({allowFreeform:o.allowFreeform,display:o.display,options:o.options,prompt:o.prompt}):void 0,requestId:o.requestId,scope:i,type:`input.requested`})))}}async function publishInputResolutions(e){let t=e.hooks.capturesInputs??e.hooks.capturesContent;for(let n of e.batch.inputs){let r=inputIdempotencyKey(e.sessionId,e.batch.event.turnId,n.request.requestId),i=takeInstrumentationInputScope(r);i!==void 0&&await e.hooks.publish(Object.freeze({idempotencyKey:r,kind:n.request.kind,outcome:n.outcome,requestId:n.request.requestId,response:!t||n.response===void 0?void 0:Object.freeze({optionId:n.response.optionId,text:n.response.text}),scope:i,type:`input.resolved`}))}}async function publishActionStarts(e,t,n,r,i){let a=t.getAttemptScope?.();if(a===void 0)return;let o=n.capturesInputs??n.capturesContent;for(let s of e.data.actions){let c=isRuntimeWorkflowToolAction(s)||s.kind===`subagent-call`||s.kind===`remote-agent-call`,l=actionIdempotencyKey(t.sessionId,e.data.turnId,s.callId);r.has(l)||(r.add(l),rememberInstrumentationActionScope(l,a,c?{type:`tool.call.started`,callId:s.callId,toolName:actionName(s),frameworkTool:
|
|
1
|
+
import{contextStorage}from"#context/container.js";import{rememberInstrumentationActionScope,rememberInstrumentationInputScope,takeInstrumentationActionScopeForCall,takeInstrumentationInputScope}from"#instrumentation/state.js";import{RuntimeActionSettlementTimesKey}from"#harness/runtime-action-settlement-state.js";import{isRuntimeWorkflowToolAction}from"#shared/action-types.js";import{actionIdempotencyKey,inputIdempotencyKey,sessionIdempotencyKey,toolCallIdempotencyKey,turnIdempotencyKey}from"#instrumentation/lifecycle.js";import{instrumentChannelDelivery}from"#instrumentation/channel-delivery.js";function createInstrumentationHandleEvent(e){if(e.hooks===void 0)return e.handleEvent;if(e.handleEvent===void 0)return;let t=e.handleEvent,n=e.hooks,r=new Set,i=new Set,a=e.turnId;return async(o,s)=>{let c=Date.now();await t(o,s);let l=toLifecycleEvent(o,e,a);if(o.type===`turn.started`&&(a=o.data.turnId),o.type===`turn.cancelled`||o.type===`turn.completed`||o.type===`turn.failed`||o.type===`session.completed`||o.type===`session.failed`){let e=contextStorage.getStore();e!==void 0&&await instrumentChannelDelivery({ctx:e,error:o.type===`turn.failed`||o.type===`session.failed`?Error(o.data.message):void 0,errorCode:o.type===`turn.failed`||o.type===`session.failed`?o.data.code:void 0,hooks:n,includeTurn:o.type===`turn.cancelled`||o.type===`turn.completed`||o.type===`turn.failed`||o.type===`session.failed`,outcome:o.type===`turn.failed`||o.type===`session.failed`?`failed`:o.type===`turn.cancelled`?`cancelled`:`completed`})}l!==void 0&&await n.publish(l),o.type===`actions.requested`?await publishActionStarts(o,e,n,r,c):o.type===`action.result`?await publishActionTerminal(o,e,n):o.type===`input.requested`&&await publishInputStarts(o,e,n,i)}}async function publishInputStarts(e,t,n,r){let i=t.getAttemptScope?.();if(i===void 0)return;let a=n.capturesOutputs??n.capturesContent;for(let o of e.data.requests){let s=inputIdempotencyKey(t.sessionId,e.data.turnId,o.requestId);r.has(s)||(r.add(s),rememberInstrumentationInputScope(s,i),await n.publish(Object.freeze({action:Object.freeze({callId:o.action.callId,name:o.action.toolName}),idempotencyKey:s,kind:o.kind,request:a?Object.freeze({allowFreeform:o.allowFreeform,display:o.display,options:o.options,prompt:o.prompt}):void 0,requestId:o.requestId,scope:i,type:`input.requested`})))}}async function publishInputResolutions(e){let t=e.hooks.capturesInputs??e.hooks.capturesContent;for(let n of e.batch.inputs){let r=inputIdempotencyKey(e.sessionId,e.batch.event.turnId,n.request.requestId),i=takeInstrumentationInputScope(r);i!==void 0&&await e.hooks.publish(Object.freeze({idempotencyKey:r,kind:n.request.kind,outcome:n.outcome,requestId:n.request.requestId,response:!t||n.response===void 0?void 0:Object.freeze({optionId:n.response.optionId,text:n.response.text}),scope:i,type:`input.resolved`}))}}async function publishActionStarts(e,t,n,r,i){let a=t.getAttemptScope?.();if(a===void 0)return;let o=n.capturesInputs??n.capturesContent;for(let s of e.data.actions){let c=isRuntimeWorkflowToolAction(s)||s.kind===`subagent-call`||s.kind===`remote-agent-call`,l=actionIdempotencyKey(t.sessionId,e.data.turnId,s.callId);r.has(l)||(r.add(l),rememberInstrumentationActionScope(l,a,c?{type:`tool.call.started`,callId:s.callId,toolName:actionName(s),frameworkTool:isFrameworkAction(s,t),scope:a,idempotencyKey:toolCallIdempotencyKey(a,s.callId,0),startedAtMs:Date.now(),input:o?s.input:void 0}:void 0),await n.publish(Object.freeze({callId:s.callId,startedAtMs:i,idempotencyKey:l,input:o?s.input:void 0,...c?{isWorkflowTool:!0}:void 0,kind:s.kind===`workflow-tool-call`?`tool-call`:s.kind,toolName:actionName(s),frameworkTool:isFrameworkAction(s,t),scope:a,type:`tool.call.started`})))}}async function publishActionTerminal(e,t,n){let r=takeInstrumentationActionScopeForCall(t.sessionId,e.data.result.callId);if(r===void 0)return;let{idempotencyKey:i,scope:a}=r,o=n.capturesOutputs??n.capturesContent;if(e.data.status===`completed`){await n.publish(Object.freeze({acceptedAtMs:contextStorage.getStore()?.get(RuntimeActionSettlementTimesKey)?.[e.data.result.callId],idempotencyKey:i,outcome:`completed`,output:Object.freeze(o?{output:e.data.result.output,type:`result`}:{type:`result`}),scope:a,type:`tool.call.completed`,usage:actionUsage(e.data.result)}));return}let s=o?e.data.error===void 0?e.data.result.output:Object.assign(Error(e.data.error.message),{code:e.data.error.code}):void 0;await n.publish(Object.freeze({acceptedAtMs:contextStorage.getStore()?.get(RuntimeActionSettlementTimesKey)?.[e.data.result.callId],error:s,errorCode:e.data.error?.code,idempotencyKey:i,outcome:e.data.status,scope:a,type:`tool.call.failed`,usage:actionUsage(e.data.result)}))}function actionUsage(e){if(e.kind!==`subagent-result`||e.origin!==`child`||e.usage===void 0)return;let t={inputTokenDetails:{cacheReadTokens:e.usage.cacheReadTokens,cacheWriteTokens:e.usage.cacheWriteTokens},inputTokens:e.usage.inputTokens,outputTokens:e.usage.outputTokens};return e.usage.costUsd!==void 0&&(t.costUsd=e.usage.costUsd),t}function isFrameworkAction(e,t){return e.kind===`load-skill`||t.isFrameworkTool?.(actionName(e))===!0}function actionName(e){return e.kind===`tool-call`||e.kind===`workflow-tool-call`?e.toolName:e.name}function toLifecycleEvent(e,t,n){switch(e.type){case`session.started`:return{agentName:t.agentName,channelAudience:t.channelAudience,channelKind:t.channelKind,idempotencyKey:sessionIdempotencyKey(t.sessionId),parentLineage:t.parentLineage,parentTraceContext:t.parentTraceContext,rootSessionId:t.rootSessionId??t.sessionId,traceSessionId:t.traceSessionId,scheduleId:t.scheduleId,sessionId:t.sessionId,title:t.title,type:`session.started`};case`session.completed`:case`session.waiting`:return{idempotencyKey:sessionIdempotencyKey(t.sessionId),sessionId:t.sessionId,turnId:n,type:e.type};case`session.failed`:return{error:Error(e.data.message),idempotencyKey:sessionIdempotencyKey(t.sessionId),sessionId:t.sessionId,turnId:n,type:`session.failed`};case`turn.started`:return{idempotencyKey:turnIdempotencyKey(t.sessionId,e.data.turnId),parentLineage:t.parentLineage,parentTraceContext:t.parentTraceContext,rootSessionId:t.rootSessionId??t.sessionId,traceSessionId:t.traceSessionId,sequence:e.data.sequence,sessionId:t.sessionId,turnId:e.data.turnId,type:`turn.started`};case`turn.completed`:case`turn.cancelled`:return{idempotencyKey:turnIdempotencyKey(t.sessionId,e.data.turnId),sessionId:t.sessionId,turnId:e.data.turnId,type:e.type};case`turn.failed`:return{error:Error(e.data.message),idempotencyKey:turnIdempotencyKey(t.sessionId,e.data.turnId),sessionId:t.sessionId,turnId:e.data.turnId,type:`turn.failed`};default:return}}export{createInstrumentationHandleEvent,publishInputResolutions};
|
|
@@ -16,6 +16,7 @@ import { getInstrumentationRuntime, registerInstrumentationRuntime } from "#inst
|
|
|
16
16
|
import { initializeSessionInstrumentation } from "#instrumentation/session-init.js";
|
|
17
17
|
export { getInstrumentationRuntime, registerInstrumentationRuntime };
|
|
18
18
|
export { initializeSessionInstrumentation };
|
|
19
|
+
import type { TASK_CANCEL_TOOL_NAME, TASK_WAIT_TOOL_NAME } from "#protocol/task-tools.js";
|
|
19
20
|
interface InstrumentedStepSession {
|
|
20
21
|
readonly sessionId: string;
|
|
21
22
|
readonly state?: Readonly<Record<string, unknown>>;
|
|
@@ -83,7 +84,7 @@ export interface SessionInstrumentation {
|
|
|
83
84
|
export interface ExecutionInstrumentation {
|
|
84
85
|
readonly instrumentTaskToolCall: (input: {
|
|
85
86
|
readonly callId: string;
|
|
86
|
-
readonly toolName:
|
|
87
|
+
readonly toolName: typeof TASK_WAIT_TOOL_NAME | typeof TASK_CANCEL_TOOL_NAME;
|
|
87
88
|
readonly startedAtMs: number;
|
|
88
89
|
readonly completedAtMs: number;
|
|
89
90
|
readonly input: unknown;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import{copyFile,mkdir,readFile,writeFile}from"node:fs/promises";import{join}from"node:path";import{resolvePackageCompiledFilePath,resolvePackageSourceFilePath}from"#internal/application/package.js";import{buildPackageUserAgent}from"#internal/user-agent.js";import{sandboxPreparedArtifactsManifestSchema}from"#shared/sandbox-prepared-artifacts.js";import{stringifyEsmImportSpecifier}from"#internal/application/import-specifier.js";import{usesParentDevelopmentWorkflowWorld}from"#internal/workflow/development-world-protocol.js";import{prepareAuthoredRuntimeModules}from"#internal/authored-runtime-modules.js";import{readMaterializedAuthoredModuleIndex}from"#internal/materialized-authored-modules.js";import"#internal/instrumentation-layout.js";import{resolveWorkflowWorldImport}from"#internal/workflow/world-target.js";async function writeCompiledArtifactsFiles(e){let t=join(e.outDir,`compiled-artifacts-bootstrap.mjs`),n=join(e.outDir,`compiled-artifacts-module-map.mjs`),r=join(e.outDir,`compiled-artifacts-instrumentation.mjs`),i=join(e.outDir,`compiled-artifacts-workflow-world.mjs`),a=sandboxPreparedArtifactsManifestSchema.parse(JSON.parse(await readFile(e.compileResult.paths.sandboxPreparedArtifactsPath,`utf8`))),o=await prepareAuthoredRuntimeModules({appRoot:e.compileResult.project.appRoot,manifest:e.compileResult.manifest,moduleMapPath:e.compileResult.paths.moduleMapPath});await mkdir(e.outDir,{recursive:!0}),await writeFile(n,o.moduleMapCode),await writeFile(t,createCompiledArtifactsBootstrapSource({compileResult:e.compileResult,installModulePath:resolvePackageSourceFilePath(`src/runtime/loaders/bundled-artifacts.ts`),metadata:e.compileResult.metadata,moduleMapImportPath:n,sandboxPreparedArtifacts:a})),await writeFile(i,createWorkflowWorldPluginSource({compiledArtifactsBootstrapPath:t,configuredWorld:e.compileResult.manifest.config.experimental?.workflow?.world,defaultWorld:e.defaultWorkflowWorld}));let s={authoredWorkflowModules:o.authoredWorkflowModules,bootstrapPath:t,workflowWorldPluginPath:i},c=await writePreparedInstrumentation({instrumentation:o.instrumentation,outDir:e.outDir});return await writeFile(r,createInstrumentationPluginSource({agentName:e.compileResult.manifest.config.name,layout:c})),s.instrumentationPluginPath=r,s.instrumentationLayout=generatedInstrumentationLayout(c),s.instrumentationSourcePaths=instrumentationSourcePathsOf(c),s}async function writePreparedInstrumentation(e){let writeOne=async(t,n)=>{let r=join(e.outDir,`compiled-artifacts-instrumentation-${t}.mjs`);return await writeFile(r,n),r},t={};for(let[n,r]of Object.entries(e.instrumentation.moduleCodeBySlot))t[n]=await writeOne(n,r);return{kind:`directory`,modulePathsBySlot:t}}function instrumentationSourcePathsOf(e){return Object.values(e.modulePathsBySlot)}async function writeDevelopmentCompiledArtifactsFiles(e){let t=join(e.outDir,`compiled-artifacts-bootstrap.mjs`),n=join(e.outDir,`compiled-artifacts-instrumentation.mjs`),r=join(e.outDir,`compiled-artifacts-workflow-world.mjs`),i=await readMaterializedAuthoredModuleIndex(e.runtimeAppRoot);if(i===void 0)throw Error(`Development generation at "${e.runtimeAppRoot}" is not materialized.`);await mkdir(e.outDir,{recursive:!0}),await writeFile(t,createDevelopmentCompiledArtifactsBootstrapSource(e.compileResult.manifest.config.name)),await writeFile(r,createDevelopmentWorkflowWorldPluginSource({compiledArtifactsBootstrapPath:t,configuredWorld:e.compileResult.manifest.config.experimental?.workflow?.world}));let a={authoredWorkflowModules:e.authoredWorkflowModules,bootstrapPath:t,workflowWorldPluginPath:r};if(i.instrumentation!==void 0){let t=await copyMaterializedInstrumentation({instrumentation:i.instrumentation,outDir:e.outDir,runtimeAppRoot:e.runtimeAppRoot});await writeFile(n,createInstrumentationPluginSource({agentName:e.compileResult.manifest.config.name,layout:t})),a.instrumentationPluginPath=n,a.instrumentationLayout=generatedInstrumentationLayout(t),a.instrumentationSourcePaths=instrumentationSourcePathsOf(t)}return a}function generatedInstrumentationLayout(e){return{kind:`directory`,slots:Object.keys(e.modulePathsBySlot)}}async function copyMaterializedInstrumentation(e){let t=join(e.runtimeAppRoot,`.eve`,`compile`),copyOne=async(n,r)=>{let i=join(e.outDir,`compiled-artifacts-instrumentation-${n}.mjs`);return await copyFile(join(t,r),i),i},n={};for(let[t,r]of Object.entries(e.instrumentation.modulePathsBySlot))n[t]=await copyOne(t,r);return{kind:`directory`,modulePathsBySlot:n}}function createDevelopmentCompiledArtifactsBootstrapSource(e){return[`// Generated by eve. Do not edit by hand.`,`import { installEveWorkflowQueueNamespace } from ${stringifyEsmImportSpecifier(resolvePackageSourceFilePath(`src/internal/workflow/queue-namespace.ts`))};`,``,`installEveWorkflowQueueNamespace(${JSON.stringify(e)});`,``,`export default function installDevelopmentCompiledArtifactsPlugin() {}`,``].join(`
|
|
2
2
|
`)}function createCompiledArtifactsBootstrapSource(e){let t=e.compileResult.manifest.config.name;return[`// Generated by eve. Do not edit by hand.`,`import moduleMap from ${stringifyEsmImportSpecifier(e.moduleMapImportPath)};`,`import { installBundledCompiledArtifacts } from ${stringifyEsmImportSpecifier(e.installModulePath)};`,`import { installEveWorkflowQueueNamespace } from ${stringifyEsmImportSpecifier(resolvePackageSourceFilePath(`src/internal/workflow/queue-namespace.ts`))};`,``,`installEveWorkflowQueueNamespace(${JSON.stringify(t)});`,``,`const metadata = ${JSON.stringify(e.metadata,null,2)};`,``,`const manifest = ${JSON.stringify(e.compileResult.manifest,null,2)};`,``,`const sandboxPreparedArtifacts = ${JSON.stringify(e.sandboxPreparedArtifacts,null,2)};`,``,`export { moduleMap };`,``,`export function installCompiledArtifactsBootstrap() {`,` installBundledCompiledArtifacts({`,` manifest,`,` metadata,`,` moduleMap,`,` sandboxPreparedArtifacts,`,` });`,`}`,``,`installCompiledArtifactsBootstrap();`,``,`// Default export satisfies the Nitro plugin contract so this file`,`// can be used directly as a Nitro plugin without a separate wrapper.`,`export default function installCompiledArtifactsPlugin() {`,` // Already installed on import above.`,`}`,``].join(`
|
|
3
|
-
`)}function resolveWorkflowWorldWiring(e){if(e===`@workflow/world-local`){let t=stringifyEsmImportSpecifier(resolvePackageSourceFilePath(`src/internal/workflow/local-world-data-directory.ts`)),n=stringifyEsmImportSpecifier(resolvePackageSourceFilePath(`src/internal/workflow/local-world-delivery-timeouts.ts`));return{moduleImportSpecifier:resolvePackageCompiledFilePath(`src/compiled/${e}/index.js`),extraImportLines:`
|
|
3
|
+
`)}function resolveInstallWorldImportSpecifier(){return resolvePackageSourceFilePath(`src/execution/install-workflow-world.ts`)}function resolveWorkflowWorldWiring(e){if(e===`@workflow/world-local`){let t=stringifyEsmImportSpecifier(resolvePackageSourceFilePath(`src/internal/workflow/local-world-data-directory.ts`)),n=stringifyEsmImportSpecifier(resolvePackageSourceFilePath(`src/internal/workflow/local-world-delivery-timeouts.ts`));return{moduleImportSpecifier:resolvePackageCompiledFilePath(`src/compiled/${e}/index.js`),extraImportLines:`
|
|
4
4
|
import { applyLocalWorkflowWorldDeliveryTimeoutDefaults } from ${n};
|
|
5
5
|
import { resolveLocalWorkflowWorldDataDirectory } from ${t};`.trimStart().split(`
|
|
6
|
-
`),
|
|
6
|
+
`),createWorldSource:`applyLocalWorkflowWorldDeliveryTimeoutDefaults();
|
|
7
7
|
const workflowWorld = await workflowWorldModule.createWorld({
|
|
8
8
|
dataDir: resolveLocalWorkflowWorldDataDirectory(process.cwd()),
|
|
9
9
|
});`}}if(e===`@workflow/world-vercel`){let t=stringifyEsmImportSpecifier(resolvePackageSourceFilePath(`src/internal/workflow/vercel-world-defaults.ts`)),n=resolvePackageCompiledFilePath(`src/compiled/${e}/index.js`),r=`
|
|
10
10
|
const workflowWorld = await workflowWorldModule.createWorld({
|
|
11
11
|
headers: { "User-Agent": ${JSON.stringify(buildPackageUserAgent())} },
|
|
12
12
|
});
|
|
13
|
-
applyVercelWorkflowWorldDefaults(workflowWorld);`.trimStart();return{moduleImportSpecifier:n,extraImportLines:[`import { applyVercelWorkflowWorldDefaults } from ${t};`],
|
|
14
|
-
`)}function createDevelopmentWorkflowWorldPluginSource(e){if(!usesParentDevelopmentWorkflowWorld(e.configuredWorld))return createWorkflowWorldPluginSource({...e,defaultWorld:`local`});let t=
|
|
13
|
+
applyVercelWorkflowWorldDefaults(workflowWorld);`.trimStart();return{moduleImportSpecifier:n,extraImportLines:[`import { applyVercelWorkflowWorldDefaults } from ${t};`],createWorldSource:r}}return{moduleImportSpecifier:e,extraImportLines:[`import { createWorldFromModule } from ${stringifyEsmImportSpecifier(resolvePackageCompiledFilePath(`src/compiled/@workflow/core/runtime.js`))};`],createWorldSource:`const workflowWorld = await createWorldFromModule(workflowWorldModule);`}}function createWorkflowWorldPluginSource(e){let t=e.configuredWorld??e.defaultWorld,n=resolveWorkflowWorldWiring(resolveWorkflowWorldImport(t));return[`// Generated by eve. Do not edit by hand.`,`import ${stringifyEsmImportSpecifier(e.compiledArtifactsBootstrapPath)};`,`import * as workflowWorldModule from ${stringifyEsmImportSpecifier(n.moduleImportSpecifier)};`,...n.extraImportLines,`import { installWorkflowWorld } from ${stringifyEsmImportSpecifier(resolveInstallWorldImportSpecifier())};`,``,n.createWorldSource,`await installWorkflowWorld({ packageName: ${JSON.stringify(e.configuredWorld)}, world: workflowWorld });`,``,`export default function installWorkflowWorldPlugin() {}`,``].join(`
|
|
14
|
+
`)}function createDevelopmentWorkflowWorldPluginSource(e){if(!usesParentDevelopmentWorkflowWorld(e.configuredWorld))return createWorkflowWorldPluginSource({...e,defaultWorld:`local`});let t=resolvePackageSourceFilePath(`src/internal/workflow/development-world-client.ts`);return[`// Generated by eve. Do not edit by hand.`,`import ${stringifyEsmImportSpecifier(e.compiledArtifactsBootstrapPath)};`,`import { createDevelopmentWorkflowWorld } from ${stringifyEsmImportSpecifier(t)};`,`import { installWorkflowWorld } from ${stringifyEsmImportSpecifier(resolveInstallWorldImportSpecifier())};`,``,`await installWorkflowWorld({ world: createDevelopmentWorkflowWorld() });`,``,`export default function installDevelopmentWorkflowWorldPlugin() {}`,``].join(`
|
|
15
15
|
`)}function createInstrumentationPluginSource(e){let t=JSON.stringify(e.agentName),n=resolvePackageSourceFilePath(`src/instrumentation/providers.ts`),r=Object.entries(e.layout.modulePathsBySlot);return[`// Generated by eve. Do not edit by hand.`,...r.map(([e,t],n)=>`import * as provider${n} from ${stringifyEsmImportSpecifier(t)}; // ${e}`),`import { finalizeInstrumentationProviders, registerInstrumentationProvider, seedInstrumentationProviders, shutdownInstrumentationProviders } from ${stringifyEsmImportSpecifier(n)};`,``,`seedInstrumentationProviders();`,``,...r.flatMap(([e],n)=>[`await registerInstrumentationProvider({`,` agentName: ${t},`,` slot: ${JSON.stringify(e)},`,` value: provider${n}.default,`,`});`]),``,`finalizeInstrumentationProviders({ serviceName: ${t} });`,``,`// Default export satisfies the Nitro plugin contract so this file`,`// can be used directly as a Nitro plugin without a separate wrapper.`,`export default function installInstrumentationPlugin(nitroApp) {`,` // The last point a buffered exporter can still reach the network.`,` nitroApp?.hooks?.hook('close', async () => {`,` await shutdownInstrumentationProviders();`,` });`,`}`,``].join(`
|
|
16
16
|
`)}export{createCompiledArtifactsBootstrapSource,createDevelopmentWorkflowWorldPluginSource,createWorkflowWorldPluginSource,writeCompiledArtifactsFiles,writeDevelopmentCompiledArtifactsFiles};
|
|
@@ -36,7 +36,7 @@ export declare function resolvePackageDependencyPath(specifier: string): string;
|
|
|
36
36
|
*/
|
|
37
37
|
export declare function resolvePackageCompiledFilePath(relativeCompiledPath: string): string;
|
|
38
38
|
/**
|
|
39
|
-
* Resolves
|
|
39
|
+
* Resolves eve's package identity from local or build-stamped metadata.
|
|
40
40
|
*/
|
|
41
41
|
export declare function resolveInstalledPackageInfo(): InstalledPackageInfo;
|
|
42
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire}from"node:module";import{existsSync,readFileSync,realpathSync}from"node:fs";import{basename,dirname,join}from"node:path";import{fileURLToPath}from"node:url";import{EVE_PACKAGE_NAME}from"#internal/package-name.js";let cachedPackageInfo,cachedPackageLocation;const
|
|
1
|
+
import{createRequire}from"node:module";import{existsSync,readFileSync,realpathSync}from"node:fs";import{basename,dirname,join}from"node:path";import{fileURLToPath}from"node:url";import{EVE_PACKAGE_NAME}from"#internal/package-name.js";import{readStampedPackageVersion}from"#internal/application/stamped-package-version.js";let cachedPackageInfo,cachedPackageLocation;const WORKFLOW_MODULE_ALIASES={"workflow/errors":`src/compiled/@workflow/errors/index.js`,"workflow/internal/private":`src/compiled/@workflow/core/private.js`};function resolveCurrentModulePath(){return typeof __filename==`string`?__filename:resolveCurrentModulePathFromStack()}function resolveCurrentModulePathFromStack(){let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error().stack?.[0]?.getFileName();if(typeof e!=`string`||e.length===0)throw Error(`Failed to resolve the current module path from the stack trace.`);return e.startsWith(`file:`)?fileURLToPath(e):e}finally{Error.prepareStackTrace=e}}const packageRequire=createRequire(resolveCurrentModulePath());function tryResolveVerifiedPackageRoot(e){try{let t=realpathSync.native(e);return tryReadInstalledPackageInfo(t,EVE_PACKAGE_NAME)===void 0?void 0:dirname(t)}catch{return}}function findNearestVerifiedPackageRoot(e){let t=e;for(;;){let e=tryResolveVerifiedPackageRoot(join(t,`package.json`));if(e!==void 0)return e;let n=dirname(t);if(n===t)return;t=n}}function tryResolveDirectBuildLocation(e){let t=dirname(e);for(;;){if(basename(t)===`dist`){let e=tryResolveVerifiedPackageRoot(join(dirname(t),`package.json`));if(e!==void 0)return{packageBuildRoot:t,packageRoot:e}}let e=dirname(t);if(e===t)return;t=e}}function isSourceCheckout(e){return existsSync(join(e,`src`,`internal`,`application`,`package.ts`))}function findNearestSourceCheckoutRoot(e){let t=e;for(;;){if(isSourceCheckout(t))return t;let e=dirname(t);if(e===t)return;t=e}}function tryCreatePackageLocation(e){if(isSourceCheckout(e))return{packageBuildRoot:null,packageRoot:e};let t=join(e,`dist`);if(existsSync(t))return{packageBuildRoot:t,packageRoot:e}}function resolveSelfPackageJsonPath(e){return createRequire(e).resolve(`${EVE_PACKAGE_NAME}/package.json`)}function resolvePackageLocationFromModulePath(e,t=resolveSelfPackageJsonPath){let n=realpathSync.native(e),r=tryResolveDirectBuildLocation(n);if(r!==void 0)return r;let i=findNearestVerifiedPackageRoot(dirname(n));if(i!==void 0&&isSourceCheckout(i))return{packageBuildRoot:null,packageRoot:i};try{let e=tryResolveVerifiedPackageRoot(t(n)),r=e===void 0?void 0:tryCreatePackageLocation(e);if(r!==void 0)return r}catch{}let a=i===void 0?void 0:tryCreatePackageLocation(i);if(a!==void 0)return a;throw Error(`Failed to resolve the eve package root from "${e}".`)}function resolvePackageLocation(){return cachedPackageLocation??=resolvePackageLocationFromModulePath(resolveCurrentModulePath()),cachedPackageLocation}function resolvePackageBuildRoot(){return resolvePackageLocation().packageBuildRoot}function resolvePackageRoot(){return resolvePackageLocation().packageRoot}function tryResolvePackageRoot(){try{return resolvePackageRoot()}catch{return}}function tryResolveLocalPackageRoot(e){try{let t=realpathSync.native(e),n=tryResolveDirectBuildLocation(t);if(n!==void 0)return n.packageRoot;let r=findNearestSourceCheckoutRoot(dirname(t));return r===void 0?void 0:tryResolveVerifiedPackageRoot(join(r,`package.json`))}catch{return}}function rewriteSourceFilePathForBuild(e){return e.replace(/\.[cm]?tsx?$/,`.js`)}function resolvePackageSourceFilePath(e){let t=resolvePackageBuildRoot();return t===null?join(resolvePackageRoot(),e):join(t,rewriteSourceFilePathForBuild(e))}function resolvePackageSourceDirectoryPath(e){let t=resolvePackageBuildRoot();return join(t===null?resolvePackageRoot():t,e)}function resolvePackageDependencyPath(e){try{return packageRequire.resolve(e)}catch(t){let n=tryResolvePackageRoot(),r=n===void 0||!isSourceCheckout(n)?void 0:resolveSourceCheckoutExport(n,e);if(r!==void 0)return r;throw t}}function resolveSourceCheckoutExport(e,t){if(t!==EVE_PACKAGE_NAME&&!t.startsWith(`${EVE_PACKAGE_NAME}/`))return;let n=t===EVE_PACKAGE_NAME?`.`:`.${t.slice(EVE_PACKAGE_NAME.length)}`;try{let t=JSON.parse(readFileSync(join(e,`package.json`),`utf8`)).exports?.[n],r=typeof t==`string`?t:t?.[`eve-source`]??t?.import??t?.default;if(r===void 0)return;let i=r.replace(/^\.\/dist\/src\//,`src/`).replace(/\.[cm]?js$/u,`.ts`),a=join(e,i);return existsSync(a)?a:void 0}catch{return}}function resolvePackageCompiledFilePath(e){let t=resolvePackageBuildRoot();return t===null?join(resolvePackageRoot(),`.generated`,`compiled`,e.replace(/^src\/compiled\//,``)):join(t,e)}function normalizeInstalledPackageInfo(e){let t=e;if(typeof t.name==`string`&&typeof t.version==`string`)return{name:t.name,version:t.version}}function tryReadInstalledPackageInfo(e,t){let n=normalizeInstalledPackageInfo(JSON.parse(readFileSync(e,`utf8`)));if(n?.name===t)return n}function tryResolveSelfPackageInfo(){try{return tryReadInstalledPackageInfo(packageRequire.resolve(`${EVE_PACKAGE_NAME}/package.json`),EVE_PACKAGE_NAME)}catch{return}}function resolveInstalledPackageInfo(){if(cachedPackageInfo)return cachedPackageInfo;let e=tryResolveLocalPackageRoot(resolveCurrentModulePath()),t=e===void 0?void 0:tryReadInstalledPackageInfo(join(e,`package.json`),EVE_PACKAGE_NAME);if(t)return cachedPackageInfo=t,cachedPackageInfo;let n=readStampedPackageVersion();return n===void 0?(cachedPackageInfo=tryResolveSelfPackageInfo()??{name:EVE_PACKAGE_NAME,version:`0.0.0`},cachedPackageInfo):(cachedPackageInfo={name:EVE_PACKAGE_NAME,version:n},cachedPackageInfo)}function readWorkflowVersionFromManifest(e){let t=e;for(let e of[t.devDependencies,t.dependencies,t.peerDependencies]){let t=e?.[`@workflow/core`];if(typeof t==`string`&&t.trim().length>0)return t}}function resolveExpectedWorkflowVersion(){let e=tryResolvePackageRoot();if(e!==void 0)try{return readWorkflowVersionFromManifest(JSON.parse(readFileSync(join(e,`package.json`),`utf8`)))}catch{}try{return readWorkflowVersionFromManifest(JSON.parse(readFileSync(packageRequire.resolve(`${EVE_PACKAGE_NAME}/package.json`),`utf8`)))}catch{return}}function resolveWorkflowModulePath(e){if(e===`workflow`)return resolvePackageSourceFilePath(`src/internal/workflow/index.ts`);if(e===`workflow/api`||e===`workflow/runtime`)return resolvePackageSourceFilePath(`src/internal/workflow/runtime.ts`);if(e===`workflow/internal/builtins`)return resolvePackageSourceFilePath(`src/internal/workflow/builtins.ts`);let t=WORKFLOW_MODULE_ALIASES[e];return t===void 0?packageRequire.resolve(e):resolvePackageCompiledFilePath(t)}export{resolveExpectedWorkflowVersion,resolveInstalledPackageInfo,resolvePackageCompiledFilePath,resolvePackageDependencyPath,resolvePackageLocationFromModulePath,resolvePackageRoot,resolvePackageSourceDirectoryPath,resolvePackageSourceFilePath,resolveWorkflowModulePath};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const STAMPED_PACKAGE_VERSION=`0.76.2`;function readStampedPackageVersion(){return STAMPED_PACKAGE_VERSION.startsWith(`__`)?void 0:STAMPED_PACKAGE_VERSION}export{readStampedPackageVersion};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AgentDefinition, AgentBuildDefinition } from "#public/definitions/agent.js";
|
|
2
2
|
import type { ScheduleDefinition } from "#public/definitions/schedule.js";
|
|
3
3
|
import type { SkillDefinition } from "#public/definitions/skill.js";
|
|
4
|
+
import { type AgentPromptCacheDefinition } from "#shared/agent-definition.js";
|
|
4
5
|
type NormalizedAgentDefinition = Omit<AgentDefinition, "build"> & {
|
|
5
6
|
build?: {
|
|
6
7
|
externalDependencies?: Readonly<AgentBuildDefinition["externalDependencies"]>;
|
|
@@ -13,6 +14,8 @@ type NormalizedAgentDefinition = Omit<AgentDefinition, "build"> & {
|
|
|
13
14
|
* time from `manifest.agentId` (package name or app-root basename).
|
|
14
15
|
*/
|
|
15
16
|
export declare function normalizeAgentDefinition(value: unknown, message: string): Readonly<NormalizedAgentDefinition>;
|
|
17
|
+
/** Validates an authored `modelOptions.promptCache` value. */
|
|
18
|
+
export declare function normalizeAgentPromptCache(value: unknown, message: string): AgentPromptCacheDefinition;
|
|
16
19
|
/**
|
|
17
20
|
* Normalizes one authored instructions definition into the canonical
|
|
18
21
|
* internal shape.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectPositiveInteger,expectProviderOptions,expectString,getOptionalStringRecordProperty}from"#internal/authored-module.js";import{AGENT_WORKFLOW_RETENTION_VALUES}from"#shared/agent-definition.js";import{isAgentReasoningDefinition}from"#internal/runtime-model.js";import{isDynamicSentinel}from"#dynamic/definition.js";function normalizeAgentDefinition(e,t){let n=expectObjectRecord(e,t);if(expectOnlyKnownKeys(n,[`build`,`compaction`,`defaultTools`,`description`,`experimental`,`limits`,`model`,`modelContextWindowTokens`,`modelOptions`,`reasoning`,`tool`],t),n.model===void 0)throw Error(`${t} The "model" field is required.`);let r={model:normalizeAgentModelDefinition(n.model,t)};if(isDynamicSentinel(r.model)&&(n.modelContextWindowTokens!==void 0||n.modelOptions!==void 0))throw Error(`${t} Dynamic model definitions do not support sibling "modelContextWindowTokens" or "modelOptions" fields. Return those overrides from the resolver selection instead.`);return n.description!==void 0&&(r.description=expectString(n.description,t)),n.defaultTools!==void 0&&(r.defaultTools=expectBoolean(n.defaultTools,t)),n.compaction!==void 0&&(r.compaction=normalizeAgentCompactionDefinition(n.compaction,t)),n.build!==void 0&&(r.build=normalizeAgentBuildDefinition(n.build,t)),n.experimental!==void 0&&(r.experimental=normalizeAgentExperimentalDefinition(n.experimental,t)),n.modelOptions!==void 0&&(r.modelOptions=normalizeAgentModelOptions(n.modelOptions,t)),n.modelContextWindowTokens!==void 0&&(r.modelContextWindowTokens=expectPositiveInteger(n.modelContextWindowTokens,t)),n.reasoning!==void 0&&(r.reasoning=normalizeAgentReasoningDefinition(n.reasoning,t)),n.tool!==void 0&&(r.tool=
|
|
1
|
+
import{expectAgentToolExposure,expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectPositiveInteger,expectProviderOptions,expectString,getOptionalStringRecordProperty}from"#internal/authored-module.js";import{AGENT_WORKFLOW_RETENTION_VALUES,ANTHROPIC_PROMPT_CACHE_TTLS}from"#shared/agent-definition.js";import{isAgentReasoningDefinition}from"#internal/runtime-model.js";import{isDynamicSentinel}from"#dynamic/definition.js";function normalizeAgentDefinition(e,t){let n=expectObjectRecord(e,t);if(expectOnlyKnownKeys(n,[`build`,`compaction`,`defaultTools`,`description`,`experimental`,`limits`,`model`,`modelContextWindowTokens`,`modelOptions`,`reasoning`,`tool`],t),n.model===void 0)throw Error(`${t} The "model" field is required.`);let r={model:normalizeAgentModelDefinition(n.model,t)};if(isDynamicSentinel(r.model)&&(n.modelContextWindowTokens!==void 0||n.modelOptions!==void 0))throw Error(`${t} Dynamic model definitions do not support sibling "modelContextWindowTokens" or "modelOptions" fields. Return those overrides from the resolver selection instead.`);return n.description!==void 0&&(r.description=expectString(n.description,t)),n.defaultTools!==void 0&&(r.defaultTools=expectBoolean(n.defaultTools,t)),n.compaction!==void 0&&(r.compaction=normalizeAgentCompactionDefinition(n.compaction,t)),n.build!==void 0&&(r.build=normalizeAgentBuildDefinition(n.build,t)),n.experimental!==void 0&&(r.experimental=normalizeAgentExperimentalDefinition(n.experimental,t)),n.modelOptions!==void 0&&(r.modelOptions=normalizeAgentModelOptions(n.modelOptions,t)),n.modelContextWindowTokens!==void 0&&(r.modelContextWindowTokens=expectPositiveInteger(n.modelContextWindowTokens,t)),n.reasoning!==void 0&&(r.reasoning=normalizeAgentReasoningDefinition(n.reasoning,t)),n.tool!==void 0&&(r.tool=expectAgentToolExposure(n.tool,t)),n.limits!==void 0&&(r.limits=normalizeAgentLimitsDefinition(n.limits,t)),r}function normalizeAgentReasoningDefinition(e,t){if(!isAgentReasoningDefinition(e))throw Error(t);return e}function normalizeAgentModelDefinition(e,t){if(!isDynamicSentinel(e))return e;let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`events`,`kind`],t);let r=expectObjectRecord(n.events,t),i={};for(let[e,n]of Object.entries(r))i[e]=expectFunction(n,t);return{events:i,kind:n.kind}}function expectPositiveIntegerOrFalse(e,t){return e!==!1&&expectPositiveInteger(e,t)}function expectPositiveNumberOrFalse(e,t){if(e===!1)return!1;if(typeof e!=`number`||!Number.isFinite(e)||e<=0)throw Error(t);return e}function normalizeAgentLimitsDefinition(e,t){let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`maxInputTokensPerSession`,`maxOutputTokensPerSession`,`maxTokenCostUsdPerSession`,`sessionTimeoutMs`],t);let r={};return n.sessionTimeoutMs!==void 0&&(r.sessionTimeoutMs=expectPositiveIntegerOrFalse(n.sessionTimeoutMs,t)),n.maxInputTokensPerSession!==void 0&&(r.maxInputTokensPerSession=expectPositiveIntegerOrFalse(n.maxInputTokensPerSession,t)),n.maxOutputTokensPerSession!==void 0&&(r.maxOutputTokensPerSession=expectPositiveIntegerOrFalse(n.maxOutputTokensPerSession,t)),n.maxTokenCostUsdPerSession!==void 0&&(r.maxTokenCostUsdPerSession=expectPositiveNumberOrFalse(n.maxTokenCostUsdPerSession,t)),r}function normalizeAgentBuildDefinition(e,t){let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`externalDependencies`],t);let r={};if(n.externalDependencies!==void 0){if(!Array.isArray(n.externalDependencies))throw Error(t);r.externalDependencies=Object.freeze(n.externalDependencies.map(e=>expectString(e,t)))}return r}function normalizeAgentWorkflowDefinition(e,t){let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`modelCallsPerStep`,`retention`,`world`],t);let r={};return n.modelCallsPerStep!==void 0&&(r.modelCallsPerStep=expectPositiveInteger(n.modelCallsPerStep,t)),n.retention!==void 0&&(r.retention=normalizeAgentWorkflowRetentionDefinition(n.retention,t)),n.world!==void 0&&(r.world=normalizeAgentWorkflowWorldDefinition(n.world,t)),r}function normalizeAgentWorkflowRetentionDefinition(e,t){let n=AGENT_WORKFLOW_RETENTION_VALUES.find(t=>t===e);if(n===void 0){let e=AGENT_WORKFLOW_RETENTION_VALUES.map(e=>JSON.stringify(e)).join(` or `);throw Error(`${t} "experimental.workflow.retention" must be ${e}.`)}return n}function normalizeAgentWorkflowWorldDefinition(e,t){let n=expectString(e,t);if(n.trim()===``)throw Error(`${t} "experimental.workflow.world" must be a non-empty package name.`);return n}function normalizeAgentExperimentalDefinition(e,t){let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`workflow`],t);let r={};return n.workflow!==void 0&&(r.workflow=normalizeAgentWorkflowDefinition(n.workflow,t)),r}function normalizeAgentModelOptions(e,t){let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`promptCache`,`providerOptions`],t);let r={};return n.providerOptions!==void 0&&(r.providerOptions=expectProviderOptions(n.providerOptions,t)),n.promptCache!==void 0&&(r.promptCache=normalizeAgentPromptCache(n.promptCache,t)),r}function normalizeAgentPromptCache(e,t){let n=expectObjectRecord(e,`${t} "modelOptions.promptCache" must be an object.`);if(expectOnlyKnownKeys(n,[`anthropic`],`${t} In "modelOptions.promptCache":`),n.anthropic===void 0)return{};let r=expectObjectRecord(n.anthropic,`${t} "modelOptions.promptCache.anthropic" must be an object.`);expectOnlyKnownKeys(r,[`ttl`],`${t} In "modelOptions.promptCache.anthropic":`);let i=r.ttl;if(i===void 0)return{anthropic:{}};if(!ANTHROPIC_PROMPT_CACHE_TTLS.includes(i))throw Error(`${t} "modelOptions.promptCache.anthropic.ttl" must be "5m" or "1h"; received ${JSON.stringify(i)}.`);return{anthropic:{ttl:i}}}function normalizeAgentCompactionDefinition(e,t){let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`model`,`modelContextWindowTokens`,`thresholdPercent`],t);let r={};if(n.model!==void 0){if(isDynamicSentinel(n.model))throw Error(`${t} "compaction.model" does not support defineDynamic — provide a static model.`);r.model=n.model}if(n.modelContextWindowTokens!==void 0&&(r.modelContextWindowTokens=expectPositiveInteger(n.modelContextWindowTokens,t)),n.thresholdPercent!==void 0){let e=n.thresholdPercent;if(typeof e!=`number`||!Number.isFinite(e)||e<0||e>1)throw Error(t);r.thresholdPercent=e}return r}function normalizeInstructionsDefinition(e,t){let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`content`,`markdown`,`role`],t);let r=Object.hasOwn(n,`content`),i=Object.hasOwn(n,`markdown`);if(r===i)throw Error(`${t} Provide exactly one of "content" or "markdown".`);if(i){if(Object.hasOwn(n,`role`))throw Error(`${t} The deprecated "markdown" shape does not support "role".`);return{content:expectString(n.markdown,t),role:`system`}}let a=n.role===void 0?`system`:expectString(n.role,t);if(a!==`system`&&a!==`user`)throw Error(`${t} Expected "role" to be one of: system, user.`);return{content:expectString(n.content,t),role:a}}function normalizeSkillDefinition(e,t){let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`deferred`,`description`,`files`,`license`,`markdown`,`metadata`],t);let r={description:expectString(n.description,t),markdown:expectString(n.markdown,t)};n.deferred!==void 0&&(r.deferred=expectBoolean(n.deferred,t));let i=n.license,a=getOptionalStringRecordProperty(n,`metadata`,t);return i!==void 0&&(r.license=expectString(i,t)),a!==void 0&&(r.metadata=a),n.files!==void 0&&(r.files=normalizeSkillFiles(n.files,t)),r}function normalizeSkillFiles(e,t){let n=expectObjectRecord(e,t),r={};for(let[e,i]of Object.entries(n)){if(typeof i==`string`||i instanceof Uint8Array){r[e]=i;continue}throw Error(`${t} Expected skill file "${e}" to be a string or Uint8Array.`)}return r}function normalizeScheduleDefinition(e,t){let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`cron`,`markdown`,`run`],t);let r=expectString(n.cron,t),i=n.markdown!==void 0,a=n.run!==void 0;if(i&&a)throw Error(`${t} Pass either "markdown" (fire-and-forget) or "run" (handler) — not both.`);if(!i&&!a)throw Error(`${t} Must provide either "markdown" (fire-and-forget) or "run" (handler).`);let o={cron:r};return i?o.markdown=expectString(n.markdown,t):o.run=expectFunction(n.run,t),o}export{normalizeAgentDefinition,normalizeAgentPromptCache,normalizeInstructionsDefinition,normalizeScheduleDefinition,normalizeSkillDefinition};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expectObjectRecord,expectOnlyKnownKeys}from"#internal/authored-module.js";import{isScheduleCollectionDefinition}from"#shared/schedule-collection-definition.js";const SCHEDULE_OPERATIONS=[`create`,`get`,`list`,`enable`,`disable`,`invoke`,`delete`],PROVIDER_KEYS=[`kind`,`create`,`list`,`get`,`enable`,`disable`,`invoke`,`delete`],PROVIDER_METHODS=PROVIDER_KEYS.filter(e=>e!==`kind`),DEFINITION_KEYS=[`description`,`provider`,`scope`,`inputSchema`,`preparePayload`,`run`,`auth`,`events`,`tool`,`approval`];function normalizeScheduleCollectionDefinition(e,t){if(!isScheduleCollectionDefinition(e))throw Error(t);let n=expectObjectRecord(e,t);if(expectOnlyKnownKeys(n,DEFINITION_KEYS,t),n.description!==void 0&&(typeof n.description!=`string`||n.description.trim()===``))throw Error(`${t} "description" must be a non-empty string when provided.`);let r=expectObjectRecord(n.inputSchema,`${t} "inputSchema" is required and must be a Standard Schema.`);if(typeof expectObjectRecord(r[`~standard`],`${t} "inputSchema" must be a Standard Schema.`).validate!=`function`)throw Error(`${t} "inputSchema" must supply a Standard Schema validate function.`);if(n.preparePayload!==void 0&&typeof n.preparePayload!=`function`)throw Error(`${t} "preparePayload" must be a function when provided.`);if(typeof n.run!=`function`)throw Error(`${t} "run" is required and must be a function.`);if(n.scope!==void 0&&typeof n.scope!=`function`)throw Error(`${t} "scope" must be a function when provided.`);if(typeof n.auth!=`function`)throw Error(`${t} "auth" is required and must be a function that resolves the schedule creator to execution auth.`);if(n.events!==void 0){let e=expectObjectRecord(n.events,`${t} "events" must be an object.`);expectOnlyKnownKeys(e,[`occurrence.dispatched`,`occurrence.failed`],`${t} "events"`);for(let[n,r]of Object.entries(e))if(r!==void 0&&typeof r!=`function`)throw Error(`${t} "events.${n}" must be a function.`)}let i=expectObjectRecord(n.provider,`${t} "provider" must be an object.`);if(expectOnlyKnownKeys(i,PROVIDER_KEYS,`${t} "provider"`),typeof i.kind!=`string`||i.kind.trim()===``)throw Error(`${t} provider.kind must be a non-empty string.`);for(let e of PROVIDER_METHODS)if(typeof i[e]!=`function`)throw Error(`${t} provider.${e} must be a function.`);if(n.tool!==void 0&&typeof n.tool!=`boolean`)throw Error(`${t} "tool" must be true or false; deferred tools are not supported yet.`);if(n.tool===!1&&n.approval!==void 0)throw Error(`${t} "approval" cannot be configured when tool is false.`);if(n.approval!==void 0){let e=expectObjectRecord(n.approval,`${t} "approval" must be an object.`);expectOnlyKnownKeys(e,SCHEDULE_OPERATIONS,`${t} "approval"`);for(let[n,r]of Object.entries(e))if(typeof r!=`function`&&(typeof r!=`object`||!r||typeof Reflect.get(r,`request`)!=`function`||Reflect.get(r,`response`)!==void 0&&typeof Reflect.get(r,`response`)!=`function`))throw Error(`${t} "approval.${n}" must be an approval policy.`)}return e}export{normalizeScheduleCollectionDefinition};
|
|
1
|
+
import{expectObjectRecord,expectOnlyKnownKeys}from"#internal/authored-module.js";import{isScheduleCollectionDefinition}from"#shared/schedule-collection-definition.js";const SCHEDULE_OPERATIONS=[`create`,`get`,`list`,`update`,`enable`,`disable`,`invoke`,`delete`],PROVIDER_KEYS=[`kind`,`create`,`list`,`get`,`update`,`enable`,`disable`,`invoke`,`delete`],PROVIDER_METHODS=PROVIDER_KEYS.filter(e=>e!==`kind`),DEFINITION_KEYS=[`description`,`provider`,`scope`,`inputSchema`,`preparePayload`,`run`,`auth`,`events`,`tool`,`approval`];function normalizeScheduleCollectionDefinition(e,t){if(!isScheduleCollectionDefinition(e))throw Error(t);let n=expectObjectRecord(e,t);if(expectOnlyKnownKeys(n,DEFINITION_KEYS,t),n.description!==void 0&&(typeof n.description!=`string`||n.description.trim()===``))throw Error(`${t} "description" must be a non-empty string when provided.`);let r=expectObjectRecord(n.inputSchema,`${t} "inputSchema" is required and must be a Standard Schema.`);if(typeof expectObjectRecord(r[`~standard`],`${t} "inputSchema" must be a Standard Schema.`).validate!=`function`)throw Error(`${t} "inputSchema" must supply a Standard Schema validate function.`);if(n.preparePayload!==void 0&&typeof n.preparePayload!=`function`)throw Error(`${t} "preparePayload" must be a function when provided.`);if(typeof n.run!=`function`)throw Error(`${t} "run" is required and must be a function.`);if(n.scope!==void 0&&typeof n.scope!=`function`)throw Error(`${t} "scope" must be a function when provided.`);if(typeof n.auth!=`function`)throw Error(`${t} "auth" is required and must be a function that resolves the schedule creator to execution auth.`);if(n.events!==void 0){let e=expectObjectRecord(n.events,`${t} "events" must be an object.`);expectOnlyKnownKeys(e,[`occurrence.dispatched`,`occurrence.failed`],`${t} "events"`);for(let[n,r]of Object.entries(e))if(r!==void 0&&typeof r!=`function`)throw Error(`${t} "events.${n}" must be a function.`)}let i=expectObjectRecord(n.provider,`${t} "provider" must be an object.`);if(expectOnlyKnownKeys(i,PROVIDER_KEYS,`${t} "provider"`),typeof i.kind!=`string`||i.kind.trim()===``)throw Error(`${t} provider.kind must be a non-empty string.`);for(let e of PROVIDER_METHODS)if(typeof i[e]!=`function`)throw Error(`${t} provider.${e} must be a function.`);if(n.tool!==void 0&&typeof n.tool!=`boolean`)throw Error(`${t} "tool" must be true or false; deferred tools are not supported yet.`);if(n.tool===!1&&n.approval!==void 0)throw Error(`${t} "approval" cannot be configured when tool is false.`);if(n.approval!==void 0){let e=expectObjectRecord(n.approval,`${t} "approval" must be an object.`);expectOnlyKnownKeys(e,SCHEDULE_OPERATIONS,`${t} "approval"`);for(let[n,r]of Object.entries(e))if(typeof r!=`function`&&(typeof r!=`object`||!r||typeof Reflect.get(r,`request`)!=`function`||Reflect.get(r,`response`)!==void 0&&typeof Reflect.get(r,`response`)!=`function`))throw Error(`${t} "approval.${n}" must be an approval policy.`)}return e}export{normalizeScheduleCollectionDefinition};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type WorkflowToolEntryPoint } from "#tools/workflow-definition.js";
|
|
2
2
|
import type { JsonObject } from "#shared/json.js";
|
|
3
|
-
import type
|
|
3
|
+
import { type WebSearchSelection } from "#shared/web-search.js";
|
|
4
4
|
import type { InternalToolDefinition, ToolExecuteFn } from "#tools/definition.js";
|
|
5
5
|
import { type CompiledToolBehavior } from "#tools/behavior.js";
|
|
6
6
|
import { type WorkflowProgramOptions } from "#tools/workflow-program-input.js";
|
|
@@ -41,7 +41,7 @@ type NormalizedToolEntry = {
|
|
|
41
41
|
readonly kind: "disabled";
|
|
42
42
|
} | {
|
|
43
43
|
readonly kind: "web-search-tool";
|
|
44
|
-
readonly
|
|
44
|
+
readonly selection: WebSearchSelection;
|
|
45
45
|
} | {
|
|
46
46
|
readonly kind: "dynamic-tool";
|
|
47
47
|
readonly eventNames: readonly DynamicToolEventName[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject}from"#shared/guards.js";import{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectString}from"#internal/authored-module.js";import{UNSPECIFIED_INPUT_SCHEMA,serializeInputSchema,serializeModelInputSchema,serializeOutputSchema,toInputSchema}from"#tools/schema.js";import{readWorkflowFunctionId}from"#internal/workflow/reference.js";import{assertResolverOnlyDynamicSentinel,isDynamicSentinel}from"#dynamic/definition.js";import{isWorkflowToolDefinition,readWorkflowToolEntryPoints}from"#tools/workflow-definition.js";import{shouldRebindDynamicCallbacks}from"#internal/dynamic-tool-rebind.js";import{isDisabledToolSentinel}from"#tools/definition.js";import{TASK_ID_INPUT,withTaskIdSchema}from"#execution/tasks/task-id-input.js";import{normalizeApproval}from"#internal/authored-definition/approval.js";import{isWebSearchToolDefinition}from"#tools/provided/web-search.js";import{readToolBehavior}from"#tools/behavior.js";import{readWorkflowProgramOptions}from"#tools/workflow-program-input.js";function normalizeToolDefinition(e,t){if(isDynamicSentinel(e))return assertResolverOnlyDynamicSentinel(e,t),{kind:`dynamic-tool`,eventNames:Object.keys(e.events),rebindMissingCallbacks:shouldRebindDynamicCallbacks(e)};if(isDisabledToolSentinel(e))return{kind:`disabled`};if(isWebSearchToolDefinition(e)){let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`kind`,`provider`],t);let r=
|
|
1
|
+
import{isObject}from"#shared/guards.js";import{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectString}from"#internal/authored-module.js";import{UNSPECIFIED_INPUT_SCHEMA,serializeInputSchema,serializeModelInputSchema,serializeOutputSchema,toInputSchema}from"#tools/schema.js";import{WEB_SEARCH_FALLBACK_PROVIDERS,WEB_SEARCH_PROVIDERS}from"#shared/web-search.js";import{readWorkflowFunctionId}from"#internal/workflow/reference.js";import{assertResolverOnlyDynamicSentinel,isDynamicSentinel}from"#dynamic/definition.js";import{isWorkflowToolDefinition,readWorkflowToolEntryPoints}from"#tools/workflow-definition.js";import{shouldRebindDynamicCallbacks}from"#internal/dynamic-tool-rebind.js";import{isDisabledToolSentinel}from"#tools/definition.js";import{TASK_ID_INPUT,withTaskIdSchema}from"#execution/tasks/task-id-input.js";import{normalizeApproval}from"#internal/authored-definition/approval.js";import{isWebSearchToolDefinition}from"#tools/provided/web-search.js";import{readToolBehavior}from"#tools/behavior.js";import{readWorkflowProgramOptions}from"#tools/workflow-program-input.js";function normalizeToolDefinition(e,t){if(isDynamicSentinel(e))return assertResolverOnlyDynamicSentinel(e,t),{kind:`dynamic-tool`,eventNames:Object.keys(e.events),rebindMissingCallbacks:shouldRebindDynamicCallbacks(e)};if(isDisabledToolSentinel(e))return{kind:`disabled`};if(isWebSearchToolDefinition(e)){let n=expectObjectRecord(e,t);if(n.deferred!==void 0)throw Error(`${t} Provider tools can't be deferred: the provider has to see their definition. Remove "deferred".`);expectOnlyKnownKeys(n,[`fallback`,`kind`,`provider`],t);let r=expectOneOf(n.provider,WEB_SEARCH_PROVIDERS,`provider`,t);if(n.fallback===void 0)return{kind:`web-search-tool`,selection:{provider:r}};if(r!==`native`)throw Error(`${t} "fallback" applies only to provider "native"; provider "${r}" serves every AI Gateway model.`);return{kind:`web-search-tool`,selection:{fallback:expectOneOf(n.fallback,WEB_SEARCH_FALLBACK_PROVIDERS,`fallback`,t),provider:r}}}let n=expectObjectRecord(e,t),r=isWorkflowToolDefinition(e)?readCompiledWorkflowEntry(n,t):void 0;if(r===void 0&&readWorkflowFunctionId(n.execute)!==void 0)throw Error(`${t} Workflow executors require defineWorkflowTool() from "eve/tools". Replace defineTool() or the bare tool object with defineWorkflowTool().`);if(r!==void 0&&n.endsTurn!==void 0)throw Error(`${t} "endsTurn" is not supported on defineWorkflowTool(). Workflow tools resume the turn when they finish; use defineTool() for a tool that ends the turn.`);expectOnlyKnownKeys(n,[`availableInSubagents`,`deferred`,`endsTurn`,`label`,`auth`,`description`,`execute`,`inputSchema`,`approval`,`approvalKey`,`outputSchema`,`toModelOutput`,...r===void 0?[]:[r.entryPoint]],t);let i=n.inputSchema===void 0?null:serializeInputSchema(n.inputSchema);r?.entryPoint===`serve`&&assertNoOwnTaskIdInput(i,t);let a=serializeOutputSchema(n.outputSchema),o=readToolBehavior(e),s=readWorkflowProgramOptions(e),c=r!==void 0||n.execute!==void 0;!c&&o?.handling?.kind!==`dispatch`&&expectFunction(n.execute,t);let l={availableInSubagents:n.availableInSubagents===void 0?void 0:expectBoolean(n.availableInSubagents,t),deferred:n.deferred===void 0?void 0:expectBoolean(n.deferred,t),description:expectString(n.description,t),endsTurn:n.endsTurn===void 0||typeof n.endsTurn==`boolean`?n.endsTurn:expectFunction(n.endsTurn,t),hasApproval:n.approval!==void 0,hasExecute:c,hasModelOutputProjection:n.toModelOutput!==void 0,inputSchema:i,modelInputSchema:modelInputSchemaOf(n.inputSchema,r?.entryPoint===`serve`||o?.handling?.kind===`dispatch`)};if(o!==void 0&&(l.behavior=o),s!==void 0&&(l.workflowProgram=s),r===void 0?c&&(l.execute=expectFunction(n.execute,t)):l.workflow=r,a!==void 0&&(l.outputSchema=a),n.label!==void 0){let e=expectObjectRecord(n.label,t);expectOnlyKnownKeys(e,[`start`,`complete`,`delta`],t),expectFunction(e.start,t),e.complete!==void 0&&expectFunction(e.complete,t),e.delta!==void 0&&expectFunction(e.delta,t)}if(n.approval!==void 0&&normalizeApproval(n.approval,t),n.approvalKey!==void 0&&expectFunction(n.approvalKey,t),n.toModelOutput!==void 0&&expectFunction(n.toModelOutput,t),n.auth!==void 0){let e=expectObjectRecord(n.auth,t);expectFunction(e.getToken,t)}return{kind:`tool`,definition:l}}function readCompiledWorkflowEntry(e,t){let[n]=readWorkflowToolEntryPoints(e),r=n===void 0?void 0:readWorkflowFunctionId(e[n]);if(n===void 0||r===void 0)throw Error(`${t} defineWorkflowTool() requires a compiled workflow executor. Start execute, task, or serve with "use workflow" and export defineWorkflowTool() as the default export of a static tool module.`);return{entryPoint:n,workflowId:r}}function modelInputSchemaOf(e,t){let n=toInputSchema(e)??UNSPECIFIED_INPUT_SCHEMA;return serializeModelInputSchema(t?withTaskIdSchema(n):n)}function assertNoOwnTaskIdInput(e,t){let n=e?.properties;if(isObject(n)&&TASK_ID_INPUT in n)throw Error(`${t} inputSchema declares "${TASK_ID_INPUT}", which eve adds to a serve tool's model input to send a call to a running task. Rename the field.`)}function expectOneOf(e,t,n,r){let i=expectString(e,r);if(!t.includes(i))throw Error(`${r} Expected "${n}" to be one of: ${t.join(`, `)}.`);return i}export{normalizeToolDefinition};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ModuleDefinitionExport } from "#public/definitions/source.js";
|
|
2
2
|
import type { ModuleSourceRef } from "#shared/source-ref.js";
|
|
3
|
-
import type { AgentModelOptionsDefinition } from "#shared/agent-definition.js";
|
|
3
|
+
import type { AgentModelOptionsDefinition, AgentToolExposure } from "#shared/agent-definition.js";
|
|
4
4
|
/**
|
|
5
5
|
* Returns the selected authored module export from one namespace.
|
|
6
6
|
*/
|
|
@@ -24,6 +24,7 @@ export declare function expectString(value: unknown, message: string): string;
|
|
|
24
24
|
* Returns the value as a boolean or throws.
|
|
25
25
|
*/
|
|
26
26
|
export declare function expectBoolean(value: unknown, message: string): boolean;
|
|
27
|
+
export declare function expectAgentToolExposure(value: unknown, message: string): AgentToolExposure;
|
|
27
28
|
/**
|
|
28
29
|
* Returns one positive integer or throws.
|
|
29
30
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function getAuthoredModuleExport(e,t){return e[t.exportName??`default`]}async function materializeAuthoredModuleExport(e){return typeof e==`function`?await e():e}function expectObjectRecord(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(t);return e}function expectString(e,t){if(typeof e!=`string`)throw Error(t);return e}function expectBoolean(e,t){if(typeof e!=`boolean`)throw Error(t);return e}function expectPositiveInteger(e,t){if(typeof e!=`number`||!Number.isInteger(e)||e<=0)throw Error(t);return e}function expectFunction(e,t){if(typeof e!=`function`)throw Error(t);return e}function expectProviderOptions(e,t){let n=expectObjectRecord(e,t),r={};for(let[e,i]of Object.entries(n))r[e]=expectObjectRecord(i,t);return r}function expectOnlyKnownKeys(e,t,n){let r=new Set(t);for(let t of Object.keys(e))if(!r.has(t))throw Error(`${n} Unknown key "${t}".`)}function getOptionalStringRecordProperty(e,t,n){let r=e[t];if(r===void 0)return;let i=expectObjectRecord(r,n),a={};for(let[e,t]of Object.entries(i))a[e]=expectString(t,n);return a}export{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectPositiveInteger,expectProviderOptions,expectString,getAuthoredModuleExport,getOptionalStringRecordProperty,materializeAuthoredModuleExport};
|
|
1
|
+
function getAuthoredModuleExport(e,t){return e[t.exportName??`default`]}async function materializeAuthoredModuleExport(e){return typeof e==`function`?await e():e}function expectObjectRecord(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(t);return e}function expectString(e,t){if(typeof e!=`string`)throw Error(t);return e}function expectBoolean(e,t){if(typeof e!=`boolean`)throw Error(t);return e}function expectAgentToolExposure(e,t){return e===`deferred`?e:expectBoolean(e,`${t} Expected "tool" to be true, false, or "deferred".`)}function expectPositiveInteger(e,t){if(typeof e!=`number`||!Number.isInteger(e)||e<=0)throw Error(t);return e}function expectFunction(e,t){if(typeof e!=`function`)throw Error(t);return e}function expectProviderOptions(e,t){let n=expectObjectRecord(e,t),r={};for(let[e,i]of Object.entries(n))r[e]=expectObjectRecord(i,t);return r}function expectOnlyKnownKeys(e,t,n){let r=new Set(t);for(let t of Object.keys(e))if(!r.has(t))throw Error(`${n} Unknown key "${t}".`)}function getOptionalStringRecordProperty(e,t,n){let r=e[t];if(r===void 0)return;let i=expectObjectRecord(r,n),a={};for(let[e,t]of Object.entries(i))a[e]=expectString(t,n);return a}export{expectAgentToolExposure,expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectPositiveInteger,expectProviderOptions,expectString,getAuthoredModuleExport,getOptionalStringRecordProperty,materializeAuthoredModuleExport};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isObject}from"#shared/guards.js";import{normalizeInstructionsDefinition,normalizeScheduleDefinition,normalizeSkillDefinition}from"#internal/authored-definition/core.js";import{hasFrontmatter,parseFrontmatter}from"#internal/helpers/frontmatter.js";import{defineSchedule}from"#public/definitions/schedule.js";import{defineSkill}from"#public/definitions/skill.js";function parseMarkdownDocument(e){if(!hasFrontmatter(e))return{hasFrontmatter:!1,frontmatter:{},markdown:e};let t=parseFrontmatter(e);if(t===void 0)throw Error(`Markdown frontmatter is missing a closing delimiter.`);if(!isObject(t.data))throw Error(`Markdown frontmatter must parse to an object.`);return{hasFrontmatter:!0,frontmatter:t.data,markdown:normalizeFrontmatterMarkdownBody(t.content)}}function lowerInstructionsMarkdown(e){return normalizeInstructionsDefinition({content:e,role:`system`},`Expected authored instructions markdown to match the public eve shape.`)}function lowerScheduleMarkdown(e){let t=parseMarkdownDocument(e);if(!t.hasFrontmatter)throw Error(`Schedule markdown must start with YAML frontmatter declaring "cron".`);if(`run`in t.frontmatter)throw Error('Markdown-form schedules do not support the "run" frontmatter key. Use a TypeScript schedule (`<name>.ts`) to author a handler.');let n={...t.frontmatter,markdown:t.markdown};return defineSchedule(normalizeScheduleDefinition(n,`Expected authored schedule markdown to match the public eve shape.`))}function lowerSkillMarkdown(e,t={}){let n=parseMarkdownDocument(e),r=t.slug;if(r===void 0&&!n.hasFrontmatter)throw Error(`Skill markdown must start with YAML frontmatter.`);let i=n.frontmatter,a=toOptionalString(i.description,`description`),o={description:r===void 0?requireStringFrontmatter(i.description,`description`):a??t.description??deriveFlatSkillDescription(n.markdown,r),markdown:n.markdown};return applyOptionalSkillFrontmatter(o,i),defineSkill(normalizeSkillDefinition(o,`Expected authored skill markdown to match the public eve shape.`))}function normalizeFrontmatterMarkdownBody(e){return e.replace(/^\r?\n/u,``)}function applyOptionalSkillFrontmatter(e,t){let n=toOptionalString(t.license,`license`);n!==void 0&&(e.license=n);let r=toOptionalStringRecord(t.metadata,`metadata`);r!==void 0&&(e.metadata=r)}function toOptionalString(e,t){if(e!=null){if(typeof e!=`string`)throw Error(`Expected "${t}" frontmatter to be a string.`);return e}}function requireStringFrontmatter(e,t){let n=toOptionalString(e,t);if(n===void 0)throw Error(`Missing required "${t}" frontmatter.`);return n}function toOptionalStringRecord(e,t){if(e==null)return;if(!isObject(e))throw Error(`Expected "${t}" frontmatter to be an object.`);let n=Object.entries(e).map(([e,n])=>{if(typeof n!=`string`)throw Error(`Expected "${t}.${e}" frontmatter to be a string.`);return[e,n]});return Object.fromEntries(n)}function deriveFlatSkillDescription(e,t){let n=e.split(/\r?\n/u).map(e=>e.trim()).find(e=>e!==``&&!e.startsWith("```"));return n===void 0?`Instructions for the ${t} skill.`:n.replace(/^[#>*\-\s]+/u,``).trim()||`Instructions for the ${t} skill.`}export{lowerInstructionsMarkdown,lowerScheduleMarkdown,lowerSkillMarkdown};
|
|
1
|
+
import{isObject}from"#shared/guards.js";import{normalizeInstructionsDefinition,normalizeScheduleDefinition,normalizeSkillDefinition}from"#internal/authored-definition/core.js";import{hasFrontmatter,parseFrontmatter}from"#internal/helpers/frontmatter.js";import{defineSchedule}from"#public/definitions/schedule.js";import{defineSkill}from"#public/definitions/skill.js";function parseMarkdownDocument(e){if(!hasFrontmatter(e))return{hasFrontmatter:!1,frontmatter:{},markdown:e};let t=parseFrontmatter(e);if(t===void 0)throw Error(`Markdown frontmatter is missing a closing delimiter.`);if(!isObject(t.data))throw Error(`Markdown frontmatter must parse to an object.`);return{hasFrontmatter:!0,frontmatter:t.data,markdown:normalizeFrontmatterMarkdownBody(t.content)}}function lowerInstructionsMarkdown(e){return normalizeInstructionsDefinition({content:e,role:`system`},`Expected authored instructions markdown to match the public eve shape.`)}function lowerScheduleMarkdown(e){let t=parseMarkdownDocument(e);if(!t.hasFrontmatter)throw Error(`Schedule markdown must start with YAML frontmatter declaring "cron".`);if(`run`in t.frontmatter)throw Error('Markdown-form schedules do not support the "run" frontmatter key. Use a TypeScript schedule (`<name>.ts`) to author a handler.');let n={...t.frontmatter,markdown:t.markdown};return defineSchedule(normalizeScheduleDefinition(n,`Expected authored schedule markdown to match the public eve shape.`))}function lowerSkillMarkdown(e,t={}){let n=parseMarkdownDocument(e),r=t.slug;if(r===void 0&&!n.hasFrontmatter)throw Error(`Skill markdown must start with YAML frontmatter.`);let i=n.frontmatter,a=toOptionalString(i.description,`description`),o={description:r===void 0?requireStringFrontmatter(i.description,`description`):a??t.description??deriveFlatSkillDescription(n.markdown,r),markdown:n.markdown};return applyOptionalSkillFrontmatter(o,i),defineSkill(normalizeSkillDefinition(o,`Expected authored skill markdown to match the public eve shape.`))}function normalizeFrontmatterMarkdownBody(e){return e.replace(/^\r?\n/u,``)}function applyOptionalSkillFrontmatter(e,t){let n=toOptionalString(t.license,`license`);n!==void 0&&(e.license=n);let r=toOptionalStringRecord(t.metadata,`metadata`);r!==void 0&&(e.metadata=r);let i=t.deferred;if(i!=null){if(typeof i!=`boolean`)throw Error(`Expected "deferred" frontmatter to be true or false.`);e.deferred=i}}function toOptionalString(e,t){if(e!=null){if(typeof e!=`string`)throw Error(`Expected "${t}" frontmatter to be a string.`);return e}}function requireStringFrontmatter(e,t){let n=toOptionalString(e,t);if(n===void 0)throw Error(`Missing required "${t}" frontmatter.`);return n}function toOptionalStringRecord(e,t){if(e==null)return;if(!isObject(e))throw Error(`Expected "${t}" frontmatter to be an object.`);let n=Object.entries(e).map(([e,n])=>{if(typeof n!=`string`)throw Error(`Expected "${t}.${e}" frontmatter to be a string.`);return[e,n]});return Object.fromEntries(n)}function deriveFlatSkillDescription(e,t){let n=e.split(/\r?\n/u).map(e=>e.trim()).find(e=>e!==``&&!e.startsWith("```"));return n===void 0?`Instructions for the ${t} skill.`:n.replace(/^[#>*\-\s]+/u,``).trim()||`Instructions for the ${t} skill.`}export{lowerInstructionsMarkdown,lowerScheduleMarkdown,lowerSkillMarkdown};
|