chat-js 1.0.0-alpha.2 → 1.0.0-alpha.3
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/README.md +4 -4
- package/dist/index.js +2625 -2666
- package/package.json +8 -3
- package/templates/chat-app/.env.example +2 -8
- package/templates/chat-app/agent/agent.ts +8 -38
- package/templates/chat-app/agent/channels/eve.ts +37 -17
- package/templates/chat-app/agent/hooks/activity.ts +2 -1
- package/templates/chat-app/agent/hooks/billing.ts +11 -8
- package/templates/chat-app/agent/hooks/conversation.ts +2 -2
- package/templates/chat-app/agent/hooks/tool-selection.ts +7 -1
- package/templates/chat-app/agent/instructions/chat.ts +14 -10
- package/templates/chat-app/agent/sandbox.ts +2 -4
- package/templates/chat-app/agent/tools/installed.ts +19 -1
- package/templates/chat-app/app/(chat)/layout.tsx +10 -8
- package/templates/chat-app/app/api/agent-conversations/[id]/route.test.ts +1 -1
- package/templates/chat-app/app/api/agent-conversations/[id]/route.ts +1 -5
- package/templates/chat-app/app/api/agent-conversations/route.test.ts +31 -2
- package/templates/chat-app/app/api/agent-conversations/route.ts +10 -1
- package/templates/chat-app/app/api/agent-workspaces/[id]/route.test.ts +5 -31
- package/templates/chat-app/app/api/agent-workspaces/[id]/route.ts +2 -10
- package/templates/chat-app/app/api/eve/[...path]/route.test.ts +2 -2
- package/templates/chat-app/app/apple-icon.png +0 -0
- package/templates/chat-app/app/favicon.ico +0 -0
- package/templates/chat-app/app/icon.svg +1 -3
- package/templates/chat-app/app/opengraph-image.alt.txt +1 -0
- package/templates/chat-app/app/opengraph-image.png +0 -0
- package/templates/chat-app/chat.config.ts +0 -18
- package/templates/chat-app/chatjs/core/chat/compose.ts +35 -11
- package/templates/chat-app/chatjs/core/chat/contracts.ts +6 -0
- package/templates/chat-app/chatjs/core/installation/contracts.ts +1 -4
- package/templates/chat-app/chatjs/core/session/contracts.ts +19 -4
- package/templates/chat-app/chatjs/generated/composer-tools.ts +5 -12
- package/templates/chat-app/chatjs/generated/installed-chat-ui.ts +11 -5
- package/templates/chat-app/chatjs/generated/installed-config.ts +5 -13
- package/templates/chat-app/chatjs/generated/installed-instrumentation.ts +1 -2
- package/templates/chat-app/chatjs/generated/installed-layout.ts +1 -7
- package/templates/chat-app/chatjs/generated/installed-tools.ts +3 -3
- package/templates/chat-app/chatjs/generated/installed.ts +3 -3
- package/templates/chat-app/chatjs/generated/providers.ts +5 -11
- package/templates/chat-app/chatjs/generated/tool-availability.ts +3 -7
- package/templates/chat-app/chatjs/generated/tool-definitions.ts +3 -4
- package/templates/chat-app/chatjs/generated/tool-requirements.ts +40 -0
- package/templates/chat-app/chatjs/generated/tools.ts +7 -28
- package/templates/chat-app/chatjs/generated/ui.ts +3 -13
- package/templates/chat-app/chatjs/plugins/ai-titles/generate-title.ts +0 -2
- package/templates/chat-app/chatjs/plugins/attachment-uploads/chatjs.json +0 -1
- package/templates/chat-app/chatjs/plugins/guest-chat/session-profile.ts +2 -0
- package/templates/chat-app/chatjs/plugins/guest-chat/signed-out.tsx +70 -34
- package/templates/chat-app/chatjs/plugins/image-viewer/chatjs.json +17 -0
- package/templates/chat-app/chatjs/plugins/image-viewer/client-plugin.ts +9 -0
- package/templates/chat-app/{components → chatjs/plugins/image-viewer}/image-modal.tsx +3 -87
- package/templates/chat-app/chatjs/plugins/image-viewer/viewer-action.tsx +47 -0
- package/templates/chat-app/chatjs/plugins/mcp/composer.tsx +1 -6
- package/templates/chat-app/chatjs/plugins/projects/ui/chat-contributions.tsx +22 -2
- package/templates/chat-app/chatjs/plugins/projects/ui/sidebar-project-item.tsx +48 -33
- package/templates/chat-app/chatjs/plugins/projects/ui/sidebar-projects.tsx +41 -22
- package/templates/chat-app/chatjs/plugins/search/chat.ts +4 -0
- package/templates/chat-app/chatjs/plugins/search/search-chats.tsx +9 -3
- package/templates/chat-app/chatjs/plugins/search/search-hook.ts +5 -6
- package/templates/chat-app/chatjs/plugins/search/search-results-view.tsx +1 -1
- package/templates/chat-app/chatjs/plugins/search/search-text.ts +21 -15
- package/templates/chat-app/chatjs/plugins/search/sidebar-item.tsx +7 -1
- package/templates/chat-app/chatjs/plugins/sharing/ui/share-button.tsx +13 -3
- package/templates/chat-app/chatjs/plugins/sharing/ui/shared-page.tsx +23 -39
- package/templates/chat-app/chatjs/plugins/sharing/ui/transcript-messages.tsx +2 -2
- package/templates/chat-app/chatjs/plugins/spreadsheet-viewer/chatjs.json +18 -0
- package/templates/chat-app/chatjs/plugins/spreadsheet-viewer/client-plugin.ts +9 -0
- package/templates/chat-app/chatjs/plugins/spreadsheet-viewer/load.ts +120 -0
- package/templates/chat-app/chatjs/plugins/spreadsheet-viewer/preview.tsx +72 -0
- package/templates/chat-app/chatjs/plugins/spreadsheet-viewer/viewer-action.tsx +97 -0
- package/templates/chat-app/chatjs/plugins/video-viewer/chatjs.json +16 -0
- package/templates/chat-app/chatjs/plugins/video-viewer/client-plugin.ts +9 -0
- package/templates/chat-app/chatjs/plugins/video-viewer/viewer-action.tsx +64 -0
- package/templates/chat-app/chatjs/tools/_shared/lib/define-tool-renderer.test.ts +16 -22
- package/templates/chat-app/chatjs/tools/attach-workspace-file/attach-conversation-file.ts +34 -0
- package/templates/chat-app/chatjs/tools/attach-workspace-file/attach.ts +106 -0
- package/templates/chat-app/chatjs/tools/attach-workspace-file/chatjs.json +19 -0
- package/templates/chat-app/chatjs/tools/attach-workspace-file/import.ts +71 -0
- package/templates/chat-app/chatjs/tools/attach-workspace-file/renderer.tsx +19 -0
- package/templates/chat-app/chatjs/tools/attach-workspace-file/schemas.ts +51 -0
- package/templates/chat-app/chatjs/tools/attach-workspace-file/tool.ts +62 -0
- package/templates/chat-app/chatjs/tools/deep-research/chatjs.json +18 -4
- package/templates/chat-app/chatjs/tools/deep-research/progress-panel.tsx +2 -31
- package/templates/chat-app/chatjs/tools/deep-research/renderer.tsx +7 -19
- package/templates/chat-app/chatjs/tools/deep-research/schemas.ts +1 -46
- package/templates/chat-app/chatjs/tools/deep-research/task.tsx +0 -41
- package/templates/chat-app/chatjs/tools/deep-research/tasks.tsx +2 -7
- package/templates/chat-app/chatjs/tools/generate-image/chatjs.json +4 -1
- package/templates/chat-app/chatjs/tools/generate-image/image-generation.ts +0 -1
- package/templates/chat-app/chatjs/tools/generate-image/renderer.tsx +39 -51
- package/templates/chat-app/chatjs/tools/generate-video/chatjs.json +4 -1
- package/templates/chat-app/chatjs/tools/generate-video/renderer.tsx +22 -11
- package/templates/chat-app/components/ai-elements/response.tsx +1 -1
- package/templates/chat-app/components/app-sidebar.tsx +26 -86
- package/templates/chat-app/components/artifact-actions.tsx +19 -0
- package/templates/chat-app/components/artifact-download-action.tsx +59 -0
- package/templates/chat-app/components/attachment-card.tsx +15 -9
- package/templates/chat-app/components/chat/chat-account.tsx +189 -0
- package/templates/chat-app/components/{controlled-chat-composer.tsx → chat/chat-composer.tsx} +6 -6
- package/templates/chat-app/components/chat/chat-conversation-screen.tsx +75 -0
- package/templates/chat-app/components/chat/chat-conversation.tsx +35 -0
- package/templates/chat-app/components/chat/chat-header.tsx +52 -0
- package/templates/chat-app/components/chat/chat-message-editor.tsx +24 -0
- package/templates/chat-app/components/chat/chat-navigation.tsx +11 -0
- package/templates/chat-app/components/chat/chat-sidebar.tsx +134 -0
- package/templates/chat-app/components/{eve/eve-messages.tsx → chat/chat-transcript.tsx} +7 -28
- package/templates/chat-app/components/chat/chat-workspace.tsx +19 -0
- package/templates/chat-app/components/chat/connected-chat-sidebar.tsx +8 -0
- package/templates/chat-app/components/chat-header-view.tsx +14 -13
- package/templates/chat-app/components/chat-slots.tsx +13 -3
- package/templates/chat-app/components/composer/active-tool.tsx +3 -1
- package/templates/chat-app/components/composer/composer-menu.tsx +4 -2
- package/templates/chat-app/components/composer/control.ts +4 -1
- package/templates/chat-app/components/composer/prompt-form.tsx +1 -1
- package/templates/chat-app/components/composer/tool-availability.tsx +8 -0
- package/templates/chat-app/components/composer/tool-controls.tsx +17 -50
- package/templates/chat-app/components/composer/tool-display.ts +3 -2
- package/templates/chat-app/components/eve/bash-output.tsx +33 -0
- package/templates/chat-app/components/eve/eve-chat-page.tsx +5 -26
- package/templates/chat-app/components/eve/eve-composer.tsx +11 -8
- package/templates/chat-app/components/eve/eve-conversation.tsx +237 -309
- package/templates/chat-app/components/eve/eve-deletion-provider.tsx +1 -1
- package/templates/chat-app/components/eve/eve-history-list.tsx +7 -3
- package/templates/chat-app/components/eve/eve-message-part.tsx +28 -22
- package/templates/chat-app/components/eve/eve-pending-input.tsx +54 -1
- package/templates/chat-app/components/eve/eve-runtime-provider.tsx +0 -5
- package/templates/chat-app/components/eve/new-conversation-view.tsx +7 -3
- package/templates/chat-app/components/file-artifact-card.tsx +37 -0
- package/templates/chat-app/components/header-actions.tsx +9 -2
- package/templates/chat-app/components/image-actions.tsx +93 -0
- package/templates/chat-app/components/internal-link.tsx +15 -2
- package/templates/chat-app/components/keyboard-shortcuts.tsx +8 -2
- package/templates/chat-app/components/part/tool-activity.tsx +1 -1
- package/templates/chat-app/components/part/tool-data.tsx +1 -1
- package/templates/chat-app/components/sidebar-user-nav.tsx +35 -198
- package/templates/chat-app/components/video-player.tsx +43 -0
- package/templates/chat-app/composer-controls.ts +0 -4
- package/templates/chat-app/docs/guest-sessions.md +1 -1
- package/templates/chat-app/instrumentation.ts +2 -6
- package/templates/chat-app/integrations/chat/models.ts +10 -0
- package/templates/chat-app/integrations/tools/catalog.ts +0 -3
- package/templates/chat-app/lib/ai/app-models.test.ts +13 -1
- package/templates/chat-app/lib/ai/app-models.ts +13 -3
- package/templates/chat-app/lib/ai/tool-context.ts +1 -14
- package/templates/chat-app/lib/ai/tool-renderer-registry.ts +10 -5
- package/templates/chat-app/lib/db/eve-current-copy.ts +13 -95
- package/templates/chat-app/lib/db/eve-deletion.ts +2 -61
- package/templates/chat-app/lib/db/eve-dispatch.ts +64 -18
- package/templates/chat-app/lib/db/eve-file-purge.ts +11 -145
- package/templates/chat-app/lib/db/eve-files.ts +11 -9
- package/templates/chat-app/lib/db/eve-orphaned-files.ts +3 -22
- package/templates/chat-app/lib/db/eve-queries.ts +32 -16
- package/templates/chat-app/lib/db/eve-workspace-deletion.ts +149 -0
- package/templates/chat-app/lib/db/migrate.ts +30 -0
- package/templates/chat-app/lib/db/migrations/0024_abandoned_toxin.sql +67 -0
- package/templates/chat-app/lib/db/migrations/0025_cloudy_thunderbolt.sql +1 -0
- package/templates/chat-app/lib/db/migrations/0026_loving_mesmero.sql +3 -0
- package/templates/chat-app/lib/db/migrations/0027_misty_stephen_strange.sql +1 -0
- package/templates/chat-app/lib/db/migrations/0028_faithful_hannibal_king.sql +12 -0
- package/templates/chat-app/lib/db/migrations/meta/0024_snapshot.json +4119 -0
- package/templates/chat-app/lib/db/migrations/meta/0025_snapshot.json +3988 -0
- package/templates/chat-app/lib/db/migrations/meta/0026_snapshot.json +3686 -0
- package/templates/chat-app/lib/db/migrations/meta/0027_snapshot.json +3596 -0
- package/templates/chat-app/lib/db/migrations/meta/0028_snapshot.json +2554 -0
- package/templates/chat-app/lib/db/migrations/meta/_journal.json +35 -0
- package/templates/chat-app/lib/db/schema.ts +1 -360
- package/templates/chat-app/lib/env-schema.ts +0 -7
- package/templates/chat-app/lib/eve/application-model.ts +56 -0
- package/templates/chat-app/lib/eve/bash-result.ts +22 -0
- package/templates/chat-app/lib/eve/branch-history.test.ts +59 -0
- package/templates/chat-app/lib/eve/branch-history.ts +19 -0
- package/templates/chat-app/lib/eve/channel-files.test.ts +14 -11
- package/templates/chat-app/lib/eve/channel-files.ts +2 -12
- package/templates/chat-app/lib/eve/completed-copy-source.test.ts +81 -17
- package/templates/chat-app/lib/eve/completed-copy-source.ts +2 -6
- package/templates/chat-app/lib/eve/connection-options.ts +7 -7
- package/templates/chat-app/lib/eve/contracts.test.ts +1 -1
- package/templates/chat-app/lib/eve/copy-seed.test.ts +17 -28
- package/templates/chat-app/lib/eve/copy-seed.ts +8 -34
- package/templates/chat-app/lib/eve/copy-transcript.test.ts +143 -47
- package/templates/chat-app/lib/eve/copy-transcript.ts +20 -101
- package/templates/chat-app/lib/eve/create-conversation-operation.test.ts +11 -31
- package/templates/chat-app/lib/eve/create-conversation-operation.ts +0 -10
- package/templates/chat-app/lib/eve/delete-local-conversation.test.ts +12 -20
- package/templates/chat-app/lib/eve/delete-local-conversation.ts +2 -8
- package/templates/chat-app/lib/eve/environment.test.ts +7 -0
- package/templates/chat-app/lib/eve/environment.ts +11 -0
- package/templates/chat-app/lib/eve/execute-conversation-creation.ts +3 -55
- package/templates/chat-app/lib/eve/gateway-auth.test.ts +2 -21
- package/templates/chat-app/lib/eve/gateway-auth.ts +7 -13
- package/templates/chat-app/lib/eve/generated-files.test.ts +1 -1
- package/templates/chat-app/lib/eve/generated-files.ts +2 -2
- package/templates/chat-app/lib/eve/installed-tools.test.ts +16 -9
- package/templates/chat-app/lib/eve/lifecycle/postgres/compatibility.ts +8 -5
- package/templates/chat-app/lib/eve/lifecycle/postgres/eve-payload-purge.ts +6 -2
- package/templates/chat-app/lib/eve/lifecycle/postgres/eve-queue-fence.ts +2 -2
- package/templates/chat-app/lib/eve/lifecycle/postgres/eve-queue-inventory.ts +2 -2
- package/templates/chat-app/lib/eve/lifecycle/postgres/eve-queue-purge.ts +3 -2
- package/templates/chat-app/lib/eve/lifecycle/postgres/eve-resource-fence.ts +2 -8
- package/templates/chat-app/lib/eve/lifecycle/postgres/eve-run-inventory.ts +1 -1
- package/templates/chat-app/lib/eve/lifecycle/postgres/eve-stream-positions.ts +9 -4
- package/templates/chat-app/lib/eve/logical-chat.test.ts +4 -3
- package/templates/chat-app/lib/eve/logical-chat.ts +8 -8
- package/templates/chat-app/lib/eve/message-delivery.test.ts +1 -1
- package/templates/chat-app/lib/eve/message-display.test.ts +5 -5
- package/templates/chat-app/lib/eve/message-display.ts +31 -1
- package/templates/chat-app/lib/eve/message-tool-selection.test.ts +2 -2
- package/templates/chat-app/lib/eve/model-accounting.test.ts +28 -45
- package/templates/chat-app/lib/eve/model-accounting.ts +8 -54
- package/templates/chat-app/lib/eve/purge-files.ts +0 -13
- package/templates/chat-app/lib/eve/purge-local-resources.ts +4 -47
- package/templates/chat-app/lib/eve/readonly-message-types.ts +8 -3
- package/templates/chat-app/lib/eve/reconcile-workspace-turn.ts +2 -37
- package/templates/chat-app/lib/eve/response-group-lineage.test.ts +3 -3
- package/templates/chat-app/lib/eve/retire-session.test.ts +25 -8
- package/templates/chat-app/lib/eve/retire-session.ts +10 -4
- package/templates/chat-app/lib/eve/selected-tools.ts +7 -18
- package/templates/chat-app/lib/eve/server.test.ts +29 -3
- package/templates/chat-app/lib/eve/session-profile.test.ts +12 -9
- package/templates/chat-app/lib/eve/session-profile.ts +7 -4
- package/templates/chat-app/lib/eve/shared-messages.test.ts +3 -4
- package/templates/chat-app/lib/eve/shared-messages.ts +5 -2
- package/templates/chat-app/lib/eve/tool-accounting.test.ts +131 -0
- package/templates/chat-app/lib/eve/tool-accounting.ts +96 -0
- package/templates/chat-app/lib/eve/tool-availability.ts +4 -1
- package/templates/chat-app/lib/eve/tool-configuration.ts +29 -0
- package/templates/chat-app/lib/eve/tool-result.ts +1 -1
- package/templates/chat-app/lib/eve/turn-tools.ts +3 -12
- package/templates/chat-app/lib/eve/usage.test.ts +54 -39
- package/templates/chat-app/lib/eve/usage.ts +9 -1
- package/templates/chat-app/lib/eve/workspace-turn-evidence.test.ts +8 -6
- package/templates/chat-app/lib/eve/workspace-turn-evidence.ts +0 -5
- package/templates/chat-app/lib/required-credentials.test.ts +2 -2
- package/templates/chat-app/lib/tool-readiness.test.ts +69 -0
- package/templates/chat-app/lib/tool-readiness.ts +43 -0
- package/templates/chat-app/logo.svg +1 -1
- package/templates/chat-app/next.config.ts +1 -5
- package/templates/chat-app/oxlint.config.ts +3 -6
- package/templates/chat-app/package.json +4 -16
- package/templates/chat-app/providers/chat-models-provider.tsx +3 -3
- package/templates/chat-app/providers/default-model-provider.tsx +4 -4
- package/templates/chat-app/providers/session-context.ts +24 -0
- package/templates/chat-app/providers/session-provider.tsx +4 -21
- package/templates/chat-app/scripts/agent-status.ts +124 -0
- package/templates/chat-app/scripts/check-env.ts +0 -10
- package/templates/chat-app/scripts/dev-supervisor.mts +3 -30
- package/templates/chat-app/scripts/eve-setup.ts +3 -0
- package/templates/chat-app/tests/helpers/eve-dynamic-context.ts +2 -0
- package/templates/chat-app/tools/platform/research-updates-schema.ts +1 -20
- package/templates/chat-app/trpc/context.tsx +8 -0
- package/templates/chat-app/trpc/react.tsx +3 -4
- package/templates/chat-app/trpc/routers/eve.router.ts +2 -74
- package/templates/chat-app/vendor/workflow-world-postgres-5.1.1.tgz +0 -0
- package/templates/electron/icon.png +0 -0
- package/templates/electron/package.json +2 -1
- package/templates/electron/src/application.test.ts +347 -0
- package/templates/electron/src/application.ts +849 -0
- package/templates/electron/src/lib/auth-cookies.ts +1 -1
- package/templates/electron/src/main.test.ts +175 -0
- package/templates/electron/src/main.ts +5 -745
- package/templates/electron/src/squirrel-startup.ts +61 -0
- package/templates/chat-app/agent/hooks/persistent-sandbox.ts +0 -14
- package/templates/chat-app/app/api/agent-conversation-copies/route.test.ts +0 -190
- package/templates/chat-app/app/api/agent-conversation-copies/route.ts +0 -105
- package/templates/chat-app/chatjs/core/documents/compose-views.ts +0 -12
- package/templates/chat-app/chatjs/core/documents/contracts.ts +0 -91
- package/templates/chat-app/chatjs/core/documents/document-definition.test.ts +0 -60
- package/templates/chat-app/chatjs/core/documents/document-definition.ts +0 -55
- package/templates/chat-app/chatjs/core/documents/ui.ts +0 -67
- package/templates/chat-app/chatjs/generated/code-executor.ts +0 -6
- package/templates/chat-app/chatjs/generated/document-run.ts +0 -12
- package/templates/chat-app/chatjs/generated/document-ui.ts +0 -7
- package/templates/chat-app/chatjs/generated/documents.ts +0 -6
- package/templates/chat-app/chatjs/plugins/langfuse/chatjs.json +0 -14
- package/templates/chat-app/chatjs/plugins/langfuse/credentials.ts +0 -22
- package/templates/chat-app/chatjs/plugins/langfuse/instrumentation.ts +0 -22
- package/templates/chat-app/chatjs/plugins/langfuse/server-plugin.ts +0 -5
- package/templates/chat-app/chatjs/plugins/vercel-analytics/chatjs.json +0 -15
- package/templates/chat-app/chatjs/plugins/vercel-analytics/client-plugin.ts +0 -9
- package/templates/chat-app/chatjs/plugins/vercel-analytics/component.tsx +0 -5
- package/templates/chat-app/chatjs/plugins/vercel-speed-insights/chatjs.json +0 -15
- package/templates/chat-app/chatjs/plugins/vercel-speed-insights/client-plugin.ts +0 -9
- package/templates/chat-app/chatjs/plugins/vercel-speed-insights/component.tsx +0 -4
- package/templates/chat-app/chatjs/providers/sandbox/adapter.ts +0 -232
- package/templates/chat-app/chatjs/providers/sandbox/options.ts +0 -13
- package/templates/chat-app/chatjs/providers/sandbox/persistent.ts +0 -258
- package/templates/chat-app/chatjs/providers/sandbox/provider.ts +0 -27
- package/templates/chat-app/chatjs/providers/sandbox/vercel-sandbox-env.ts +0 -22
- package/templates/chat-app/chatjs/tools/_shared/code-execution/code-execution-chart.tsx +0 -83
- package/templates/chat-app/chatjs/tools/_shared/code-execution/interactive-chart-impl.tsx +0 -290
- package/templates/chat-app/chatjs/tools/_shared/code-execution/interactive-charts.tsx +0 -24
- package/templates/chat-app/chatjs/tools/_shared/code-execution/javascript.ts +0 -222
- package/templates/chat-app/chatjs/tools/_shared/code-execution/python.ts +0 -381
- package/templates/chat-app/chatjs/tools/_shared/code-execution/types.ts +0 -27
- package/templates/chat-app/chatjs/tools/code-documents/assistant-actions.ts +0 -16
- package/templates/chat-app/chatjs/tools/code-documents/chatjs.json +0 -20
- package/templates/chat-app/chatjs/tools/code-documents/configuration-schema.ts +0 -7
- package/templates/chat-app/chatjs/tools/code-documents/definition.ts +0 -9
- package/templates/chat-app/chatjs/tools/code-documents/document.tsx +0 -33
- package/templates/chat-app/chatjs/tools/code-documents/editor.tsx +0 -144
- package/templates/chat-app/chatjs/tools/code-documents/guidelines.ts +0 -15
- package/templates/chat-app/chatjs/tools/code-documents/tool.ts +0 -54
- package/templates/chat-app/chatjs/tools/code-execution/chatjs.json +0 -21
- package/templates/chat-app/chatjs/tools/code-execution/python.test.ts +0 -207
- package/templates/chat-app/chatjs/tools/code-execution/renderer.test.tsx +0 -142
- package/templates/chat-app/chatjs/tools/code-execution/renderer.tsx +0 -68
- package/templates/chat-app/chatjs/tools/code-execution/schemas.ts +0 -23
- package/templates/chat-app/chatjs/tools/code-execution/tool.ts +0 -93
- package/templates/chat-app/chatjs/tools/deep-research/agent.ts +0 -18
- package/templates/chat-app/chatjs/tools/deep-research/availability.ts +0 -23
- package/templates/chat-app/chatjs/tools/deep-research/configuration-schema.ts +0 -36
- package/templates/chat-app/chatjs/tools/deep-research/configuration.ts +0 -22
- package/templates/chat-app/chatjs/tools/deep-research/prompts.ts +0 -280
- package/templates/chat-app/chatjs/tools/deep-research/search-updates.ts +0 -76
- package/templates/chat-app/chatjs/tools/deep-research/steps.ts +0 -92
- package/templates/chat-app/chatjs/tools/delete-document/availability.ts +0 -13
- package/templates/chat-app/chatjs/tools/delete-document/chatjs.json +0 -9
- package/templates/chat-app/chatjs/tools/delete-document/execute.ts +0 -78
- package/templates/chat-app/chatjs/tools/delete-document/schemas.ts +0 -18
- package/templates/chat-app/chatjs/tools/delete-document/tool.ts +0 -49
- package/templates/chat-app/chatjs/tools/get-weather/chatjs.json +0 -14
- package/templates/chat-app/chatjs/tools/get-weather/definition.ts +0 -10
- package/templates/chat-app/chatjs/tools/get-weather/renderer.test.tsx +0 -57
- package/templates/chat-app/chatjs/tools/get-weather/renderer.tsx +0 -290
- package/templates/chat-app/chatjs/tools/get-weather/schemas.ts +0 -51
- package/templates/chat-app/chatjs/tools/get-weather/tool.ts +0 -34
- package/templates/chat-app/chatjs/tools/read-document/chatjs.json +0 -8
- package/templates/chat-app/chatjs/tools/read-document/tool.ts +0 -27
- package/templates/chat-app/chatjs/tools/retrieve-url/chatjs.json +0 -11
- package/templates/chat-app/chatjs/tools/retrieve-url/renderer.tsx +0 -200
- package/templates/chat-app/chatjs/tools/retrieve-url/retrieve-url-env.ts +0 -11
- package/templates/chat-app/chatjs/tools/retrieve-url/schemas.ts +0 -24
- package/templates/chat-app/chatjs/tools/retrieve-url/tool.test.ts +0 -144
- package/templates/chat-app/chatjs/tools/retrieve-url/tool.ts +0 -169
- package/templates/chat-app/chatjs/tools/saved-code-execution/chatjs.json +0 -12
- package/templates/chat-app/chatjs/tools/saved-code-execution/document-runs.ts +0 -31
- package/templates/chat-app/chatjs/tools/saved-code-execution/document.tsx +0 -84
- package/templates/chat-app/chatjs/tools/saved-code-execution/execute.ts +0 -126
- package/templates/chat-app/chatjs/tools/saved-code-execution/renderer.tsx +0 -30
- package/templates/chat-app/chatjs/tools/saved-code-execution/result.tsx +0 -42
- package/templates/chat-app/chatjs/tools/saved-code-execution/schemas.ts +0 -82
- package/templates/chat-app/chatjs/tools/saved-code-execution/tool.ts +0 -12
- package/templates/chat-app/chatjs/tools/sheet-documents/assistant-actions.ts +0 -22
- package/templates/chat-app/chatjs/tools/sheet-documents/chatjs.json +0 -20
- package/templates/chat-app/chatjs/tools/sheet-documents/configuration-schema.ts +0 -10
- package/templates/chat-app/chatjs/tools/sheet-documents/definition.ts +0 -9
- package/templates/chat-app/chatjs/tools/sheet-documents/document.tsx +0 -41
- package/templates/chat-app/chatjs/tools/sheet-documents/editor.tsx +0 -180
- package/templates/chat-app/chatjs/tools/sheet-documents/guidelines.ts +0 -5
- package/templates/chat-app/chatjs/tools/sheet-documents/tool.ts +0 -54
- package/templates/chat-app/chatjs/tools/tavily-search/chatjs.json +0 -19
- package/templates/chat-app/chatjs/tools/tavily-search/renderer.tsx +0 -25
- package/templates/chat-app/chatjs/tools/tavily-search/schemas.ts +0 -39
- package/templates/chat-app/chatjs/tools/tavily-search/tavily-search-env.ts +0 -11
- package/templates/chat-app/chatjs/tools/tavily-search/tool.test.ts +0 -114
- package/templates/chat-app/chatjs/tools/tavily-search/tool.ts +0 -143
- package/templates/chat-app/chatjs/tools/text-documents/assistant-actions.ts +0 -12
- package/templates/chat-app/chatjs/tools/text-documents/chatjs.json +0 -20
- package/templates/chat-app/chatjs/tools/text-documents/comparison.tsx +0 -72
- package/templates/chat-app/chatjs/tools/text-documents/configuration-schema.ts +0 -7
- package/templates/chat-app/chatjs/tools/text-documents/definition.ts +0 -9
- package/templates/chat-app/chatjs/tools/text-documents/diffview.tsx +0 -214
- package/templates/chat-app/chatjs/tools/text-documents/document.tsx +0 -46
- package/templates/chat-app/chatjs/tools/text-documents/editor-config.ts +0 -53
- package/templates/chat-app/chatjs/tools/text-documents/editor.tsx +0 -139
- package/templates/chat-app/chatjs/tools/text-documents/guidelines.ts +0 -7
- package/templates/chat-app/chatjs/tools/text-documents/tool.ts +0 -54
- package/templates/chat-app/chatjs/tools/word-count/chatjs.json +0 -14
- package/templates/chat-app/chatjs/tools/word-count/definition.ts +0 -10
- package/templates/chat-app/chatjs/tools/word-count/renderer.tsx +0 -64
- package/templates/chat-app/chatjs/tools/word-count/schemas.ts +0 -13
- package/templates/chat-app/chatjs/tools/word-count/tool.ts +0 -45
- package/templates/chat-app/components/chat/chat-layout.tsx +0 -129
- package/templates/chat-app/components/chat-sidebar-view.tsx +0 -53
- package/templates/chat-app/components/document-skeleton.tsx +0 -33
- package/templates/chat-app/components/eve/eve-artifact-layout.tsx +0 -722
- package/templates/chat-app/components/eve/eve-copy-button.tsx +0 -165
- package/templates/chat-app/components/eve/eve-document-actions.tsx +0 -124
- package/templates/chat-app/components/eve/eve-document-assistant-actions.tsx +0 -157
- package/templates/chat-app/components/eve/eve-document-body.tsx +0 -29
- package/templates/chat-app/components/eve/eve-document-context.tsx +0 -12
- package/templates/chat-app/components/eve/eve-document-preview.tsx +0 -128
- package/templates/chat-app/components/eve/eve-document-tool.tsx +0 -190
- package/templates/chat-app/components/eve/eve-history.tsx +0 -25
- package/templates/chat-app/components/eve/use-document-draft.ts +0 -281
- package/templates/chat-app/components/favicon-group.tsx +0 -50
- package/templates/chat-app/components/part/document-common.tsx +0 -152
- package/templates/chat-app/components/part/web-search.tsx +0 -75
- package/templates/chat-app/components/sandbox.tsx +0 -43
- package/templates/chat-app/components/source-badge.tsx +0 -50
- package/templates/chat-app/components/sources.tsx +0 -140
- package/templates/chat-app/hooks/use-artifact.tsx +0 -180
- package/templates/chat-app/integrations/documents/definitions.ts +0 -4
- package/templates/chat-app/integrations/documents/run.ts +0 -1
- package/templates/chat-app/integrations/documents/ui.ts +0 -4
- package/templates/chat-app/integrations/providers/sandbox.ts +0 -10
- package/templates/chat-app/integrations/tools/code-executor.ts +0 -1
- package/templates/chat-app/lib/ai/telemetry.ts +0 -4
- package/templates/chat-app/lib/artifacts/artifact-kind.ts +0 -8
- package/templates/chat-app/lib/artifacts/types.ts +0 -19
- package/templates/chat-app/lib/db/eve-code-sandboxes.ts +0 -197
- package/templates/chat-app/lib/db/eve-document-retention.ts +0 -36
- package/templates/chat-app/lib/db/eve-documents.ts +0 -700
- package/templates/chat-app/lib/eve/code-executor.ts +0 -32
- package/templates/chat-app/lib/eve/code-sandbox-name.test.ts +0 -60
- package/templates/chat-app/lib/eve/code-sandbox-name.ts +0 -56
- package/templates/chat-app/lib/eve/code-sandbox-ownership.ts +0 -88
- package/templates/chat-app/lib/eve/copy-input.ts +0 -11
- package/templates/chat-app/lib/eve/create-native-copy.ts +0 -38
- package/templates/chat-app/lib/eve/document-assistant-actions.test.ts +0 -48
- package/templates/chat-app/lib/eve/document-assistant-actions.ts +0 -22
- package/templates/chat-app/lib/eve/document-kind-lifecycle.test.ts +0 -148
- package/templates/chat-app/lib/eve/document-tools.ts +0 -164
- package/templates/chat-app/lib/eve/lifecycle/postgres/eve-sandbox-coverage-proof.ts +0 -140
- package/templates/chat-app/lib/eve/persistent-sandbox-store.ts +0 -621
- package/templates/chat-app/lib/eve/persistent-sandbox.test.ts +0 -209
- package/templates/chat-app/lib/eve/persistent-sandbox.ts +0 -328
- package/templates/chat-app/lib/eve/purge-code-sandboxes.test.ts +0 -125
- package/templates/chat-app/lib/eve/purge-code-sandboxes.ts +0 -83
- package/templates/chat-app/lib/eve/request-copy.test.ts +0 -95
- package/templates/chat-app/lib/eve/request-copy.ts +0 -129
- package/templates/chat-app/lib/eve/research-progress.test.ts +0 -95
- package/templates/chat-app/lib/eve/research-progress.ts +0 -42
- package/templates/chat-app/lib/eve/sandbox-environment.test.ts +0 -49
- package/templates/chat-app/lib/eve/sandbox-environment.ts +0 -29
- package/templates/chat-app/lib/eve/save-copy-operation.ts +0 -33
- package/templates/chat-app/lib/eve/save-document.ts +0 -87
- package/templates/chat-app/lib/eve/verify-local-coverage.ts +0 -84
- package/templates/chat-app/lib/eve/workspace-attachments.ts +0 -173
- package/templates/chat-app/lib/sandbox/runtime.ts +0 -12
- package/templates/chat-app/scripts/persistent-sandbox-cleanup.ts +0 -128
- package/templates/chat-app/scripts/stop-persistent-sandboxes.ts +0 -24
- package/templates/chat-app/tests/artifacts.e2e.ts +0 -7
- package/templates/chat-app/tools/platform/documents/types.ts +0 -11
- package/templates/chat-app/tools/platform/search-presentation.ts +0 -138
- package/templates/chat-app/tools/platform/steps/multi-query-web-search.test.ts +0 -45
- package/templates/chat-app/tools/platform/steps/multi-query-web-search.ts +0 -142
- package/templates/chat-app/tools/platform/steps/search-utils.ts +0 -26
- package/templates/chat-app/vendor/workflow-world-postgres-5.0.0-beta.40.tgz +0 -0
|
@@ -1,73 +1,30 @@
|
|
|
1
|
-
import { purgeEveFamilyDocuments } from "@/lib/db/eve-documents";
|
|
2
1
|
import { prepareEveFamilyDeletion } from "./prepare-deletion";
|
|
3
|
-
import { purgeEveFamilyCodeSandboxes } from "./purge-code-sandboxes";
|
|
4
2
|
import { purgeEveFamilyFiles } from "./purge-files";
|
|
5
|
-
import { cleanupRetiredEveWorkspaces } from "
|
|
6
|
-
import { getPersistentSandboxProvider } from "../sandbox/runtime";
|
|
7
|
-
import {
|
|
8
|
-
manageEveLocalResources,
|
|
9
|
-
verifyLocalEveFamilyCoverage,
|
|
10
|
-
} from "./verify-local-coverage";
|
|
11
|
-
|
|
12
|
-
const NO_CONVERSATIONS = 0;
|
|
13
|
-
|
|
14
|
-
const purgeOwnedLocalSandboxResources = async (
|
|
15
|
-
ownerId: string,
|
|
16
|
-
appRoot: string,
|
|
17
|
-
family: {
|
|
18
|
-
readonly runIds: readonly string[];
|
|
19
|
-
readonly nativeInventories: readonly {
|
|
20
|
-
readonly sessionId: string;
|
|
21
|
-
readonly runIds: readonly string[];
|
|
22
|
-
}[];
|
|
23
|
-
}
|
|
24
|
-
): Promise<void> => {
|
|
25
|
-
const scope = await verifyLocalEveFamilyCoverage(
|
|
26
|
-
ownerId,
|
|
27
|
-
appRoot,
|
|
28
|
-
family.nativeInventories
|
|
29
|
-
);
|
|
30
|
-
for (const session of scope.sessions) {
|
|
31
|
-
// oxlint-disable-next-line eslint/no-await-in-loop -- Confirm every owned resource is absent before allowing family erasure.
|
|
32
|
-
await manageEveLocalResources(ownerId, session, "purge");
|
|
33
|
-
}
|
|
34
|
-
};
|
|
3
|
+
import { cleanupRetiredEveWorkspaces } from "../db/eve-workspace-deletion";
|
|
35
4
|
|
|
36
5
|
const purgeExternalEveFamilyResources = async (
|
|
37
6
|
ownerId: string,
|
|
38
7
|
family: Readonly<{ rootId: string }>
|
|
39
8
|
): Promise<void> => {
|
|
40
|
-
await purgeEveFamilyCodeSandboxes(ownerId, family.rootId);
|
|
41
|
-
await purgeEveFamilyDocuments(ownerId, family.rootId);
|
|
42
9
|
await purgeEveFamilyFiles(ownerId, family.rootId);
|
|
43
10
|
};
|
|
44
11
|
|
|
45
12
|
/**
|
|
46
13
|
* Internal local-provider coordinator. Native history and deleting bindings remain
|
|
47
14
|
* until external tool resources are accounted for and final erasure can proceed.
|
|
48
|
-
* appRoot must be the worker's actual app root, never a request-controlled path.
|
|
49
15
|
* @param {string} ownerId Owner authorizing the local family resource purge.
|
|
50
16
|
* @param {string} conversationId Conversation resolving the retired deletion family.
|
|
51
|
-
* @
|
|
52
|
-
* @returns {ReturnType<typeof prepareEveFamilyDeletion>} The prepared family after external sandbox/document/file stages, or the unchanged absent/empty family result. Unattributed resource evidence or failed cleanup rejects before final native/application erasure.
|
|
17
|
+
* @returns {ReturnType<typeof prepareEveFamilyDeletion>} The prepared family after external sandbox/file stages, or the unchanged absent/empty family result. Unattributed resource evidence or failed cleanup rejects before final native/application erasure.
|
|
53
18
|
*/
|
|
54
19
|
export const purgeLocalEveFamilyResources = async (
|
|
55
20
|
ownerId: string,
|
|
56
|
-
conversationId: string
|
|
57
|
-
appRoot: string
|
|
21
|
+
conversationId: string
|
|
58
22
|
): ReturnType<typeof prepareEveFamilyDeletion> => {
|
|
59
23
|
const family = await prepareEveFamilyDeletion(ownerId, conversationId);
|
|
60
24
|
if (!family) {
|
|
61
25
|
return family;
|
|
62
26
|
}
|
|
63
|
-
|
|
64
|
-
await purgeOwnedLocalSandboxResources(ownerId, appRoot, family);
|
|
65
|
-
}
|
|
66
|
-
await cleanupRetiredEveWorkspaces(
|
|
67
|
-
ownerId,
|
|
68
|
-
family.rootId,
|
|
69
|
-
getPersistentSandboxProvider
|
|
70
|
-
);
|
|
27
|
+
await cleanupRetiredEveWorkspaces(ownerId, family.rootId);
|
|
71
28
|
await purgeExternalEveFamilyResources(ownerId, family);
|
|
72
29
|
return family;
|
|
73
30
|
};
|
|
@@ -4,10 +4,15 @@ import type {
|
|
|
4
4
|
EveMessagePart,
|
|
5
5
|
} from "eve/client";
|
|
6
6
|
import type { EveMessageInput } from "./message-input";
|
|
7
|
-
|
|
8
|
-
type ReadonlyEveMessage = EveMessage
|
|
7
|
+
/** Display enrichment belongs to ChatJS, not the native history contract. */
|
|
8
|
+
type ReadonlyEveMessage = Omit<EveMessage, "metadata"> & {
|
|
9
|
+
readonly metadata?: ReadonlyEveMessageMetadata;
|
|
10
|
+
};
|
|
9
11
|
type ReadonlyEveMessagePart = EveMessagePart;
|
|
10
|
-
type ReadonlyEveMessageMetadata = EveMessageMetadata
|
|
12
|
+
type ReadonlyEveMessageMetadata = EveMessageMetadata & {
|
|
13
|
+
readonly modelId?: string;
|
|
14
|
+
readonly custom?: Readonly<Record<string, unknown>>;
|
|
15
|
+
};
|
|
11
16
|
type ReadonlyEveMessageInput =
|
|
12
17
|
| string
|
|
13
18
|
| readonly Readonly<Exclude<EveMessageInput, string>[number]>[];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { setTimeout as delay } from "node:timers/promises";
|
|
2
1
|
import { Client } from "eve/client";
|
|
3
2
|
import {
|
|
4
3
|
readActiveEveWorkspaceOperation,
|
|
@@ -10,27 +9,6 @@ import {
|
|
|
10
9
|
hasSettledWorkspaceSession,
|
|
11
10
|
} from "./workspace-turn-evidence";
|
|
12
11
|
import type { WorkspaceTurnEvent } from "./workspace-turn-evidence";
|
|
13
|
-
import { z } from "zod";
|
|
14
|
-
|
|
15
|
-
const seededCreation = z.object({ fork: z.looseObject({}) });
|
|
16
|
-
|
|
17
|
-
/** Wait only for known seed initialization; timeout never authorizes another dispatch. */
|
|
18
|
-
const readWorkspaceEvents = async (
|
|
19
|
-
read: () => Promise<readonly WorkspaceTurnEvent[]>,
|
|
20
|
-
signal: AbortSignal,
|
|
21
|
-
waitForSeed: boolean
|
|
22
|
-
): Promise<readonly WorkspaceTurnEvent[]> => {
|
|
23
|
-
let events = await read();
|
|
24
|
-
if (waitForSeed) {
|
|
25
|
-
while (!hasSettledWorkspaceSession(events)) {
|
|
26
|
-
// oxlint-disable-next-line eslint/no-await-in-loop -- Observe initialization of this exact known seed; one deadline bounds all polls.
|
|
27
|
-
await delay(250, undefined, { signal });
|
|
28
|
-
// oxlint-disable-next-line eslint/no-await-in-loop -- Each snapshot follows the previous observation of the same native seed.
|
|
29
|
-
events = await read();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return events;
|
|
33
|
-
};
|
|
34
12
|
|
|
35
13
|
const hasSettledDescendants = async (
|
|
36
14
|
events: readonly WorkspaceTurnEvent[],
|
|
@@ -66,8 +44,7 @@ const hasSettledDescendants = async (
|
|
|
66
44
|
/** Reconcile known receipts only. Failure/absence leaves the durable workspace reservation intact. */
|
|
67
45
|
export const reconcileEveWorkspaceTurn = async (
|
|
68
46
|
ownerId: string,
|
|
69
|
-
conversationId: string
|
|
70
|
-
options: { readonly waitForSeed?: boolean } = {}
|
|
47
|
+
conversationId: string
|
|
71
48
|
): Promise<void> => {
|
|
72
49
|
const active = await readActiveEveWorkspaceOperation(ownerId, conversationId);
|
|
73
50
|
const sessionId = active?.operation.sessionId;
|
|
@@ -89,10 +66,6 @@ export const reconcileEveWorkspaceTurn = async (
|
|
|
89
66
|
},
|
|
90
67
|
});
|
|
91
68
|
const signal = AbortSignal.timeout(15_000);
|
|
92
|
-
const seeded =
|
|
93
|
-
operation.kind === "copy" ||
|
|
94
|
-
(operation.kind === "create" &&
|
|
95
|
-
seededCreation.safeParse(operation.intent).success);
|
|
96
69
|
const read = async (
|
|
97
70
|
nativeSessionId: string
|
|
98
71
|
): Promise<readonly WorkspaceTurnEvent[]> => {
|
|
@@ -103,19 +76,11 @@ export const reconcileEveWorkspaceTurn = async (
|
|
|
103
76
|
};
|
|
104
77
|
let events: readonly WorkspaceTurnEvent[];
|
|
105
78
|
try {
|
|
106
|
-
events = await
|
|
107
|
-
async () => await read(sessionId),
|
|
108
|
-
signal,
|
|
109
|
-
options.waitForSeed === true &&
|
|
110
|
-
operation.conversationId === conversationId &&
|
|
111
|
-
seeded
|
|
112
|
-
);
|
|
79
|
+
events = await read(sessionId);
|
|
113
80
|
if (
|
|
114
81
|
!hasSettledWorkspaceOperation(
|
|
115
82
|
{
|
|
116
|
-
kind: operation.kind,
|
|
117
83
|
deliveryId: operation.deliveryId,
|
|
118
|
-
seeded,
|
|
119
84
|
},
|
|
120
85
|
events
|
|
121
86
|
)
|
|
@@ -90,7 +90,7 @@ describe("response group lineage", () => {
|
|
|
90
90
|
it("maps an imported candidate's response to its local first turn", () => {
|
|
91
91
|
const candidate = row("imported", "operation-a", {
|
|
92
92
|
forkKind: "comparison",
|
|
93
|
-
forkMessageId: "
|
|
93
|
+
forkMessageId: "import:imported:2",
|
|
94
94
|
parentConversationId: "copy",
|
|
95
95
|
});
|
|
96
96
|
const copy = row("copy", "copy-operation");
|
|
@@ -114,12 +114,12 @@ describe("response group lineage", () => {
|
|
|
114
114
|
const copy = row("copy", "copy-operation");
|
|
115
115
|
const candidate = row("imported", "operation-a", {
|
|
116
116
|
forkKind: "comparison",
|
|
117
|
-
forkMessageId: "
|
|
117
|
+
forkMessageId: "import:imported:2",
|
|
118
118
|
parentConversationId: copy.id,
|
|
119
119
|
});
|
|
120
120
|
const prefixRegeneration = row("prefix-regeneration", "retry-prefix", {
|
|
121
121
|
forkKind: "regenerate",
|
|
122
|
-
forkMessageId: "
|
|
122
|
+
forkMessageId: "import:imported:2",
|
|
123
123
|
parentConversationId: candidate.id,
|
|
124
124
|
});
|
|
125
125
|
expect(
|
|
@@ -25,6 +25,7 @@ const mocks = vi.hoisted(() => ({
|
|
|
25
25
|
end: vi.fn(),
|
|
26
26
|
retireMany: vi.fn(),
|
|
27
27
|
snapshot: vi.fn(),
|
|
28
|
+
stream: vi.fn(),
|
|
28
29
|
usage: vi.fn(),
|
|
29
30
|
}));
|
|
30
31
|
vi.mock("../env", () => ({ env: mocks.env }));
|
|
@@ -43,7 +44,11 @@ vi.mock("eve/client", () => ({
|
|
|
43
44
|
mocks.client(options);
|
|
44
45
|
}
|
|
45
46
|
public sessions = {
|
|
46
|
-
attach: () => ({
|
|
47
|
+
attach: () => ({
|
|
48
|
+
end: mocks.end,
|
|
49
|
+
snapshot: mocks.snapshot,
|
|
50
|
+
stream: mocks.stream,
|
|
51
|
+
}),
|
|
47
52
|
};
|
|
48
53
|
},
|
|
49
54
|
}));
|
|
@@ -58,17 +63,22 @@ beforeEach(() => {
|
|
|
58
63
|
supported: true,
|
|
59
64
|
});
|
|
60
65
|
mocks.deleting.mockResolvedValue({ id: "conversation" });
|
|
61
|
-
mocks.end.mockResolvedValue({
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
mocks.end.mockResolvedValue({});
|
|
67
|
+
mocks.stream.mockImplementation(async function* terminalEvents() {
|
|
68
|
+
yield { type: "session.ended" };
|
|
69
|
+
});
|
|
70
|
+
mocks.snapshot.mockResolvedValue({
|
|
71
|
+
session: { streamIndex: 41 },
|
|
72
|
+
events: [{ type: "session.ended" }],
|
|
65
73
|
});
|
|
66
|
-
mocks.snapshot.mockResolvedValue({ events: [{ type: "session.ended" }] });
|
|
67
74
|
mocks.usage.mockResolvedValue(true);
|
|
68
75
|
});
|
|
69
76
|
|
|
70
77
|
it("retires before reading and settling the final snapshot, including retries", async () => {
|
|
71
|
-
mocks.snapshot.mockResolvedValueOnce({
|
|
78
|
+
mocks.snapshot.mockResolvedValueOnce({
|
|
79
|
+
events: [],
|
|
80
|
+
session: { streamIndex: 41 },
|
|
81
|
+
});
|
|
72
82
|
await retireEveSessionForDeletion("owner", "session");
|
|
73
83
|
expect(mocks.client).toHaveBeenCalledWith(
|
|
74
84
|
expect.objectContaining({
|
|
@@ -78,6 +88,9 @@ it("retires before reading and settling the final snapshot, including retries",
|
|
|
78
88
|
expect(mocks.end.mock.invocationCallOrder[0]).toBeLessThan(
|
|
79
89
|
mocks.snapshot.mock.invocationCallOrder[1]
|
|
80
90
|
);
|
|
91
|
+
expect(mocks.stream).toHaveBeenCalledExactlyOnceWith(
|
|
92
|
+
expect.objectContaining({ follow: true, startIndex: 41 })
|
|
93
|
+
);
|
|
81
94
|
const endCalls = mocks.end.mock.calls.length;
|
|
82
95
|
await expect(
|
|
83
96
|
retireEveSessionForDeletion("owner", "session")
|
|
@@ -94,12 +107,16 @@ it("rejects non-deleting or foreign sessions before native access", async () =>
|
|
|
94
107
|
});
|
|
95
108
|
|
|
96
109
|
it("refuses erasure when retirement or cost settlement is incomplete", async () => {
|
|
97
|
-
mocks.snapshot.mockResolvedValue({
|
|
110
|
+
mocks.snapshot.mockResolvedValue({
|
|
111
|
+
session: { streamIndex: 41 },
|
|
112
|
+
events: [{ type: "model.settled" }],
|
|
113
|
+
});
|
|
98
114
|
await expect(retireEveSessionForDeletion("owner", "session")).rejects.toThrow(
|
|
99
115
|
"retirement has not completed"
|
|
100
116
|
);
|
|
101
117
|
expect(mocks.usage).not.toHaveBeenCalled();
|
|
102
118
|
mocks.snapshot.mockResolvedValue({
|
|
119
|
+
session: { streamIndex: 41 },
|
|
103
120
|
events: [{ type: "model.settled" }, { type: "session.ended" }],
|
|
104
121
|
});
|
|
105
122
|
mocks.usage.mockResolvedValueOnce(false);
|
|
@@ -29,11 +29,15 @@ const readRetiredSessionSnapshot = async (
|
|
|
29
29
|
if (current.events.some((event) => event.type === "session.ended")) {
|
|
30
30
|
return current;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
await session.end({
|
|
33
33
|
reason: "Conversation deleted",
|
|
34
34
|
signal: AbortSignal.timeout(SESSION_RETIRE_TIMEOUT_MS),
|
|
35
35
|
});
|
|
36
|
-
|
|
36
|
+
// End acknowledges submission before the terminal event is durable. Follow the
|
|
37
|
+
// session from our snapshot; the pinned client's end-delivery reader does not follow.
|
|
38
|
+
for await (const event of session.stream({
|
|
39
|
+
follow: true,
|
|
40
|
+
startIndex: current.session.streamIndex,
|
|
37
41
|
signal: AbortSignal.timeout(SESSION_RETIRE_TIMEOUT_MS),
|
|
38
42
|
})) {
|
|
39
43
|
if (event.type === "session.ended") {
|
|
@@ -60,8 +64,10 @@ const reconcileRetiredSessionUsage = async (
|
|
|
60
64
|
): Promise<void> => {
|
|
61
65
|
let unresolved = false;
|
|
62
66
|
for (const event of events) {
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
if (
|
|
68
|
+
// oxlint-disable-next-line eslint/no-await-in-loop -- Preserve native event order before erasure.
|
|
69
|
+
!(await ingestEveUsage(ownerId, sessionId, event))
|
|
70
|
+
) {
|
|
65
71
|
unresolved = true;
|
|
66
72
|
}
|
|
67
73
|
}
|
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import { documentDefinitions } from "@/integrations/documents/definitions";
|
|
2
1
|
import type { UiToolName } from "@/lib/ai/types";
|
|
3
2
|
|
|
4
|
-
/** Canvas editing needs Eve's read operation to obtain the current revision.
|
|
5
|
-
* @param {UiToolName | null} selectedTool User-selected tool, or null when no explicit tool restriction is requested.
|
|
6
|
-
* @returns {string[] | null} Selected execution names; canvas tools share their editing family and document operations also include readDocument. Null preserves unrestricted selection.
|
|
7
|
-
*/
|
|
8
3
|
export const selectedEveTools = (
|
|
9
4
|
selectedTool: UiToolName | null
|
|
10
|
-
): string[] | null =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
if (selectedTool.endsWith("Document")) {
|
|
19
|
-
return [selectedTool, "readDocument"];
|
|
20
|
-
}
|
|
21
|
-
return [selectedTool];
|
|
22
|
-
};
|
|
5
|
+
): string[] | null =>
|
|
6
|
+
selectedTool === null || selectedTool === ""
|
|
7
|
+
? null
|
|
8
|
+
: [
|
|
9
|
+
selectedTool,
|
|
10
|
+
...(selectedTool === "deepResearch" ? ["attach_workspace_file"] : []),
|
|
11
|
+
];
|
|
@@ -6,11 +6,11 @@ const URL_ARGUMENT = 0;
|
|
|
6
6
|
const INIT_ARGUMENT = 1;
|
|
7
7
|
|
|
8
8
|
const mocks = vi.hoisted(() => ({
|
|
9
|
+
oidc: vi.fn(() => "invocation-token"),
|
|
9
10
|
env: {
|
|
10
11
|
EVE_GATEWAY_SECRET: "eve-secret",
|
|
11
12
|
EVE_INTERNAL_ORIGIN: "https://preview.example.com",
|
|
12
13
|
VERCEL: "",
|
|
13
|
-
VERCEL_AUTOMATION_BYPASS_SECRET: "deployment-secret",
|
|
14
14
|
VERCEL_BRANCH_URL: "preview.example.com",
|
|
15
15
|
VERCEL_ENV: "",
|
|
16
16
|
VERCEL_URL: "deployment.example.com",
|
|
@@ -18,8 +18,10 @@ const mocks = vi.hoisted(() => ({
|
|
|
18
18
|
},
|
|
19
19
|
}));
|
|
20
20
|
vi.mock("@/lib/env", () => ({ env: mocks.env }));
|
|
21
|
+
vi.mock("@vercel/oidc", () => ({ getVercelOidcTokenSync: mocks.oidc }));
|
|
21
22
|
|
|
22
23
|
beforeEach(() => {
|
|
24
|
+
mocks.oidc.mockReset().mockReturnValue("invocation-token");
|
|
23
25
|
mocks.env.VERCEL = "";
|
|
24
26
|
mocks.env.VERCEL_ENV = "";
|
|
25
27
|
mocks.env.WORKFLOW_POSTGRES_URL = "postgres://localhost/test";
|
|
@@ -29,17 +31,21 @@ afterEach(() => vi.unstubAllGlobals());
|
|
|
29
31
|
|
|
30
32
|
describe("EVE deployment authentication", () => {
|
|
31
33
|
it("authenticates internal requests to this project's protected preview", async () => {
|
|
34
|
+
mocks.env.VERCEL = "1";
|
|
32
35
|
const fetcher = vi.fn<typeof fetch>().mockResolvedValue(new Response());
|
|
33
36
|
vi.stubGlobal("fetch", fetcher);
|
|
34
37
|
await eveRequest("owner", "/eve/chat/v1/operation/operation");
|
|
35
38
|
const headers = new Headers(
|
|
36
39
|
(fetcher.mock.calls[FIRST_CALL][INIT_ARGUMENT] ?? {}).headers
|
|
37
40
|
);
|
|
38
|
-
expect(headers.get("x-vercel-
|
|
41
|
+
expect(headers.get("x-vercel-trusted-oidc-idp-token")).toBe(
|
|
42
|
+
"invocation-token"
|
|
43
|
+
);
|
|
39
44
|
expect(headers.get("authorization")).toBe("Bearer eve-secret");
|
|
40
45
|
expect(headers.get("x-chatjs-owner")).toBe("owner");
|
|
41
46
|
});
|
|
42
47
|
it("does not send the project deployment credential to a separate worker", async () => {
|
|
48
|
+
mocks.env.VERCEL = "1";
|
|
43
49
|
mocks.env.EVE_INTERNAL_ORIGIN = "https://worker.example.com";
|
|
44
50
|
const fetcher = vi.fn<typeof fetch>().mockResolvedValue(new Response());
|
|
45
51
|
vi.stubGlobal("fetch", fetcher);
|
|
@@ -47,7 +53,27 @@ describe("EVE deployment authentication", () => {
|
|
|
47
53
|
const headers = new Headers(
|
|
48
54
|
(fetcher.mock.calls[FIRST_CALL][INIT_ARGUMENT] ?? {}).headers
|
|
49
55
|
);
|
|
50
|
-
expect(headers.has("x-vercel-
|
|
56
|
+
expect(headers.has("x-vercel-trusted-oidc-idp-token")).toBe(false);
|
|
57
|
+
expect(mocks.oidc).not.toHaveBeenCalled();
|
|
58
|
+
});
|
|
59
|
+
it("reads a fresh invocation identity on each request", async () => {
|
|
60
|
+
mocks.env.VERCEL = "1";
|
|
61
|
+
mocks.oidc.mockReturnValueOnce("first").mockReturnValueOnce("second");
|
|
62
|
+
const fetcher = vi.fn<typeof fetch>().mockResolvedValue(new Response());
|
|
63
|
+
vi.stubGlobal("fetch", fetcher);
|
|
64
|
+
await eveRequest("owner", "/eve/chat/v1/health");
|
|
65
|
+
await eveRequest("owner", "/eve/chat/v1/health");
|
|
66
|
+
expect(
|
|
67
|
+
fetcher.mock.calls.map(([, init]) =>
|
|
68
|
+
new Headers(init?.headers).get("x-vercel-trusted-oidc-idp-token")
|
|
69
|
+
)
|
|
70
|
+
).toEqual(["first", "second"]);
|
|
71
|
+
});
|
|
72
|
+
it("keeps local requests independent of Vercel identity", async () => {
|
|
73
|
+
const fetcher = vi.fn<typeof fetch>().mockResolvedValue(new Response());
|
|
74
|
+
vi.stubGlobal("fetch", fetcher);
|
|
75
|
+
await eveRequest("owner", "/eve/chat/v1/health");
|
|
76
|
+
expect(mocks.oidc).not.toHaveBeenCalled();
|
|
51
77
|
});
|
|
52
78
|
});
|
|
53
79
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect, test, vi } from "vitest";
|
|
2
|
-
import {
|
|
2
|
+
import { findSessionProfile } from "./session-profile";
|
|
3
3
|
|
|
4
4
|
const mocks = vi.hoisted(() => ({
|
|
5
5
|
profiles: new Array<{ authenticator: string; instructions: string }>(),
|
|
@@ -8,15 +8,18 @@ vi.mock("@/integrations/chat/session-profiles", () => ({
|
|
|
8
8
|
sessionProfiles: mocks.profiles,
|
|
9
9
|
}));
|
|
10
10
|
|
|
11
|
-
test("
|
|
11
|
+
test("removed application policies reject their persisted sessions without native fallback", () => {
|
|
12
12
|
expect(() =>
|
|
13
|
-
|
|
14
|
-
auth: { initiator: { authenticator: "removed-plugin" } },
|
|
13
|
+
findSessionProfile({
|
|
14
|
+
auth: { initiator: { authenticator: "chatjs-removed-plugin" } },
|
|
15
15
|
})
|
|
16
16
|
).toThrow("not installed");
|
|
17
|
-
expect((
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
expect(findSessionProfile({ auth: { initiator: null } })).toBeUndefined();
|
|
18
|
+
expect(
|
|
19
|
+
findSessionProfile({
|
|
20
|
+
auth: { initiator: { authenticator: "slack-webhook" } },
|
|
21
|
+
})
|
|
22
|
+
).toBeUndefined();
|
|
20
23
|
});
|
|
21
24
|
test("profile selection is pinned to the initiator, not reconnect authentication", () => {
|
|
22
25
|
const profile = { authenticator: "test-profile", instructions: "restricted" };
|
|
@@ -28,7 +31,7 @@ test("profile selection is pinned to the initiator, not reconnect authentication
|
|
|
28
31
|
current: { authenticator: "chatjs-gateway" },
|
|
29
32
|
},
|
|
30
33
|
};
|
|
31
|
-
expect(
|
|
34
|
+
expect(findSessionProfile(session)).toBe(profile);
|
|
32
35
|
} finally {
|
|
33
36
|
mocks.profiles.length = 0;
|
|
34
37
|
}
|
|
@@ -41,7 +44,7 @@ test("ambiguous app-owned session profiles fail closed", () => {
|
|
|
41
44
|
);
|
|
42
45
|
try {
|
|
43
46
|
expect(() =>
|
|
44
|
-
|
|
47
|
+
findSessionProfile({ auth: { initiator: { authenticator: "same" } } })
|
|
45
48
|
).toThrow("Multiple session profiles");
|
|
46
49
|
} finally {
|
|
47
50
|
mocks.profiles.length = 0;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { sessionProfiles } from "@/integrations/chat/session-profiles";
|
|
2
2
|
import type { SessionProfile } from "@/chatjs/core/session/contracts";
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
export const
|
|
4
|
+
/** Optional application policy for a persisted initiator. Native EVE callers need no registration. */
|
|
5
|
+
export const findSessionProfile = (session: {
|
|
6
6
|
readonly auth: {
|
|
7
7
|
readonly initiator: { readonly authenticator?: string } | null;
|
|
8
8
|
};
|
|
9
|
-
}): SessionProfile => {
|
|
9
|
+
}): SessionProfile | undefined => {
|
|
10
10
|
const profiles = sessionProfiles.filter(
|
|
11
11
|
(candidate) =>
|
|
12
12
|
candidate.authenticator === session.auth.initiator?.authenticator
|
|
@@ -15,7 +15,10 @@ export const requireSessionProfile = (session: {
|
|
|
15
15
|
throw new Error("Multiple session profiles use the same authenticator.");
|
|
16
16
|
}
|
|
17
17
|
const profile = profiles.at(0);
|
|
18
|
-
if (
|
|
18
|
+
if (
|
|
19
|
+
!profile &&
|
|
20
|
+
session.auth.initiator?.authenticator?.startsWith("chatjs-") === true
|
|
21
|
+
) {
|
|
19
22
|
throw new Error("This session profile is not installed.");
|
|
20
23
|
}
|
|
21
24
|
return profile;
|
|
@@ -103,8 +103,7 @@ it.each([
|
|
|
103
103
|
expect(json).not.toContain("option-private");
|
|
104
104
|
});
|
|
105
105
|
it.each([
|
|
106
|
-
"
|
|
107
|
-
"webSearch",
|
|
106
|
+
"bash",
|
|
108
107
|
"runCodeDocument",
|
|
109
108
|
"generateVideo",
|
|
110
109
|
"generateImage",
|
|
@@ -256,10 +255,10 @@ it("shares display-safe tool selection only through an exact known delivery", ()
|
|
|
256
255
|
const receipt = {
|
|
257
256
|
kind: "send",
|
|
258
257
|
deliveryId: "known",
|
|
259
|
-
selectedTool: "
|
|
258
|
+
selectedTool: "generateImage",
|
|
260
259
|
} satisfies EveMessageDisplayReceipt;
|
|
261
260
|
expect(sharedEveMessages(input, [receipt])[0]?.metadata).toEqual({
|
|
262
|
-
custom: { chatjs: { selectedTool: "
|
|
261
|
+
custom: { chatjs: { selectedTool: "generateImage" } },
|
|
263
262
|
});
|
|
264
263
|
expect(
|
|
265
264
|
sharedEveMessages(input, [{ ...receipt, deliveryId: "other" }])[0]?.metadata
|
|
@@ -20,8 +20,11 @@ interface SharedEveMessage {
|
|
|
20
20
|
parts: EveMessagePart[];
|
|
21
21
|
role: EveMessage["role"];
|
|
22
22
|
metadata?:
|
|
23
|
-
|
|
|
24
|
-
|
|
23
|
+
| (ReadonlyEveMessageMetadata & {
|
|
24
|
+
custom: ReturnType<typeof eveToolMetadata>;
|
|
25
|
+
modelId?: undefined;
|
|
26
|
+
})
|
|
27
|
+
| (ReadonlyEveMessageMetadata & { modelId: string; custom?: undefined });
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
const sharedModelId = (
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { defineTool } from "eve/tools";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { testToolContext } from "../../tests/helpers/eve-tool-context";
|
|
5
|
+
import { withToolAccounting } from "./tool-accounting";
|
|
6
|
+
import { createToolResult } from "./tool-result";
|
|
7
|
+
|
|
8
|
+
const collect = async <T>(
|
|
9
|
+
result: T | Promise<T> | AsyncIterable<T>
|
|
10
|
+
): Promise<T[]> => {
|
|
11
|
+
const output = await result;
|
|
12
|
+
if (
|
|
13
|
+
typeof output === "object" &&
|
|
14
|
+
output !== null &&
|
|
15
|
+
Symbol.asyncIterator in output
|
|
16
|
+
) {
|
|
17
|
+
return await Array.fromAsync(output);
|
|
18
|
+
}
|
|
19
|
+
return [output];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const approval = () => "user-approval" as const;
|
|
23
|
+
|
|
24
|
+
describe("native tool accounting assembly", () => {
|
|
25
|
+
it("executes once and preserves projections, approvals, labels and end-turn behavior", async () => {
|
|
26
|
+
const execute = vi.fn(({ value }: { value: string }) => ({ text: value }));
|
|
27
|
+
const native = defineTool({
|
|
28
|
+
inputSchema: z.object({ value: z.string() }),
|
|
29
|
+
outputSchema: z.object({ text: z.string() }),
|
|
30
|
+
description: "Example native capability",
|
|
31
|
+
execute,
|
|
32
|
+
approval,
|
|
33
|
+
toModelOutput: (output) => ({ type: "text", value: output.text }),
|
|
34
|
+
endsTurn: (output) => output.text === "done",
|
|
35
|
+
label: {
|
|
36
|
+
start: () => "Working",
|
|
37
|
+
delta: (_input, output) => output.text,
|
|
38
|
+
complete: (_input, output) => output.text,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
const tool = withToolAccounting(native, "none");
|
|
42
|
+
const context = testToolContext();
|
|
43
|
+
const receipt = createToolResult({ text: "done" }, 0);
|
|
44
|
+
expect(await collect(tool.execute({ value: "done" }, context))).toEqual([
|
|
45
|
+
receipt,
|
|
46
|
+
]);
|
|
47
|
+
expect(execute).toHaveBeenCalledExactlyOnceWith({ value: "done" }, context);
|
|
48
|
+
expect(tool.approval).toBe(approval);
|
|
49
|
+
expect(await tool.toModelOutput?.(receipt)).toEqual({
|
|
50
|
+
type: "text",
|
|
51
|
+
value: "done",
|
|
52
|
+
});
|
|
53
|
+
expect(tool.label?.complete?.({ value: "done" }, receipt)).toBe("done");
|
|
54
|
+
expect(tool.label?.delta?.({ value: "done" }, receipt)).toBe("done");
|
|
55
|
+
expect(
|
|
56
|
+
typeof tool.endsTurn === "function" && (await tool.endsTurn(receipt))
|
|
57
|
+
).toBe(true);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("retains native failures and prevents execution after cancellation", async () => {
|
|
61
|
+
const failure = new Error("upstream unavailable");
|
|
62
|
+
const execute = vi.fn((): string => {
|
|
63
|
+
throw failure;
|
|
64
|
+
});
|
|
65
|
+
const tool = withToolAccounting(
|
|
66
|
+
defineTool({
|
|
67
|
+
description: "Failure",
|
|
68
|
+
inputSchema: z.object({}),
|
|
69
|
+
execute,
|
|
70
|
+
}),
|
|
71
|
+
"unknown"
|
|
72
|
+
);
|
|
73
|
+
await expect(collect(tool.execute({}, testToolContext()))).rejects.toBe(
|
|
74
|
+
failure
|
|
75
|
+
);
|
|
76
|
+
const controller = new AbortController();
|
|
77
|
+
controller.abort();
|
|
78
|
+
await expect(
|
|
79
|
+
collect(
|
|
80
|
+
tool.execute({}, testToolContext({ abortSignal: controller.signal }))
|
|
81
|
+
)
|
|
82
|
+
).rejects.toThrow();
|
|
83
|
+
expect(execute).toHaveBeenCalledTimes(1);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it("settles one charge after streaming completes", async () => {
|
|
88
|
+
const native = defineTool({
|
|
89
|
+
description: "Stream",
|
|
90
|
+
inputSchema: z.object({}),
|
|
91
|
+
async *execute() {
|
|
92
|
+
yield { searches: [], updates: [{ status: "running" }] };
|
|
93
|
+
yield { searches: ["source"], updates: [{ status: "completed" }] };
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
const tool = withToolAccounting(native, { costUsd: 0.05 });
|
|
97
|
+
const outputs = await collect(tool.execute({}, testToolContext()));
|
|
98
|
+
expect(outputs.map((output) => output.usage.costUsd)).toEqual([
|
|
99
|
+
undefined,
|
|
100
|
+
undefined,
|
|
101
|
+
0.05,
|
|
102
|
+
]);
|
|
103
|
+
const unknown = withToolAccounting(native, "unknown");
|
|
104
|
+
const unknownOutputs = await collect(unknown.execute({}, testToolContext()));
|
|
105
|
+
expect(unknownOutputs.at(-1)?.usage.costUsd).toBeUndefined();
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("does not settle interrupted streams and closes the native iterator", async () => {
|
|
109
|
+
const controller = new AbortController();
|
|
110
|
+
const closed = vi.fn();
|
|
111
|
+
const native = defineTool({
|
|
112
|
+
description: "Interrupted stream",
|
|
113
|
+
inputSchema: z.object({}),
|
|
114
|
+
async *execute() {
|
|
115
|
+
try {
|
|
116
|
+
yield "working";
|
|
117
|
+
controller.abort();
|
|
118
|
+
yield "done";
|
|
119
|
+
} finally {
|
|
120
|
+
closed();
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
const tool = withToolAccounting(native, { costUsd: 0.05 });
|
|
125
|
+
await expect(
|
|
126
|
+
collect(
|
|
127
|
+
tool.execute({}, testToolContext({ abortSignal: controller.signal }))
|
|
128
|
+
)
|
|
129
|
+
).rejects.toThrow();
|
|
130
|
+
expect(closed).toHaveBeenCalledTimes(1);
|
|
131
|
+
});
|