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,208 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
AccountMenuTrigger,
|
|
5
|
-
AccountMenuContent,
|
|
6
|
-
} from "@/components/sidebar-menus";
|
|
7
|
-
import { MenuLink } from "@/components/navigation-links";
|
|
8
|
-
import {
|
|
9
|
-
ChevronsUpDown,
|
|
10
|
-
LogIn,
|
|
11
|
-
LogOut,
|
|
12
|
-
Moon,
|
|
13
|
-
Settings,
|
|
14
|
-
Sun,
|
|
15
|
-
} from "lucide-react";
|
|
16
|
-
import React from "react";
|
|
17
|
-
|
|
18
|
-
import type { JSX as ReactJSX } from "react";
|
|
19
|
-
|
|
2
|
+
import { useTransition } from "react";
|
|
20
3
|
import { useRouter } from "next/navigation";
|
|
21
|
-
|
|
22
4
|
import { useTheme } from "next-themes";
|
|
23
5
|
import { toast } from "sonner";
|
|
24
|
-
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
import {
|
|
28
|
-
DropdownMenu,
|
|
29
|
-
DropdownMenuGroup,
|
|
30
|
-
DropdownMenuItem,
|
|
31
|
-
DropdownMenuLabel,
|
|
32
|
-
DropdownMenuSeparator,
|
|
33
|
-
} from "@/components/ui/dropdown-menu";
|
|
34
|
-
import {
|
|
35
|
-
SidebarMenu,
|
|
36
|
-
SidebarMenuButton,
|
|
37
|
-
SidebarMenuItem,
|
|
38
|
-
useSidebar,
|
|
39
|
-
} from "@/components/ui/sidebar";
|
|
40
|
-
import { AccountSummary } from "@/components/chat-slots";
|
|
41
|
-
|
|
6
|
+
import { ChatAccount } from "./chat/chat-account";
|
|
7
|
+
import { useSession } from "@/providers/session-provider";
|
|
42
8
|
import authClient from "@/lib/auth-client";
|
|
43
|
-
|
|
44
|
-
import { cn } from "@/lib/utils";
|
|
45
9
|
import { signOutWithPlugin } from "@/integrations/auth/sign-out";
|
|
46
|
-
|
|
47
10
|
import { signOutAndNavigate } from "@/lib/sign-out";
|
|
48
11
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
export const SidebarUserNav = (): ReactJSX.Element => {
|
|
54
|
-
const [, startEventAction] = React.useTransition();
|
|
55
|
-
const { data: session, isPending } = useSession();
|
|
56
|
-
const { setTheme, resolvedTheme } = useTheme();
|
|
12
|
+
export const useAccountControl = () => {
|
|
13
|
+
const [, startEventAction] = useTransition();
|
|
14
|
+
const { data, isPending } = useSession();
|
|
15
|
+
const { resolvedTheme, setTheme } = useTheme();
|
|
57
16
|
const router = useRouter();
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<SidebarMenu>
|
|
85
|
-
<SidebarMenuItem>
|
|
86
|
-
<SidebarMenuButton
|
|
87
|
-
onClick={() => {
|
|
88
|
-
router.push("/login");
|
|
89
|
-
}}
|
|
90
|
-
>
|
|
91
|
-
<LogIn className="size-4" />
|
|
92
|
-
<span>Sign in</span>
|
|
93
|
-
</SidebarMenuButton>
|
|
94
|
-
</SidebarMenuItem>
|
|
95
|
-
</SidebarMenu>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const displayName = user.name || user.email || "User";
|
|
100
|
-
const userInitials = displayName.slice(0, USER_INITIALS_LENGTH).toUpperCase();
|
|
101
|
-
const { image: userImage } = user;
|
|
102
|
-
const avatarImageSrc =
|
|
103
|
-
typeof userImage === "string" && userImage !== ""
|
|
104
|
-
? userImage
|
|
105
|
-
: `https://avatar.vercel.sh/${user.email}`;
|
|
106
|
-
|
|
107
|
-
return (
|
|
108
|
-
<SidebarMenu>
|
|
109
|
-
<SidebarMenuItem>
|
|
110
|
-
<DropdownMenu>
|
|
111
|
-
<AccountMenuTrigger collapsed={isDesktopCollapsed}>
|
|
112
|
-
<Avatar
|
|
113
|
-
className={cn(
|
|
114
|
-
"size-8 rounded-lg",
|
|
115
|
-
isDesktopCollapsed && "size-6"
|
|
116
|
-
)}
|
|
117
|
-
>
|
|
118
|
-
<AvatarImage alt={displayName} src={avatarImageSrc} />
|
|
119
|
-
<AvatarFallback className="rounded-lg">
|
|
120
|
-
{userInitials}
|
|
121
|
-
</AvatarFallback>
|
|
122
|
-
</Avatar>
|
|
123
|
-
<div
|
|
124
|
-
className={cn(
|
|
125
|
-
"grid flex-1 text-left text-sm leading-tight",
|
|
126
|
-
isDesktopCollapsed && "hidden"
|
|
127
|
-
)}
|
|
128
|
-
>
|
|
129
|
-
<span className="truncate font-medium">
|
|
130
|
-
{user.name || user.email}
|
|
131
|
-
</span>
|
|
132
|
-
<AccountSummary />
|
|
133
|
-
</div>
|
|
134
|
-
<ChevronsUpDown
|
|
135
|
-
className={cn("ml-auto size-4", isDesktopCollapsed && "hidden")}
|
|
136
|
-
/>
|
|
137
|
-
</AccountMenuTrigger>
|
|
138
|
-
<AccountMenuContent side={isMobile ? "bottom" : "right"}>
|
|
139
|
-
<DropdownMenuGroup>
|
|
140
|
-
<DropdownMenuLabel className="p-0 font-normal">
|
|
141
|
-
<div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
|
|
142
|
-
<Avatar className="h-8 w-8 rounded-lg">
|
|
143
|
-
<AvatarImage alt={displayName} src={avatarImageSrc} />
|
|
144
|
-
<AvatarFallback className="rounded-lg">
|
|
145
|
-
{userInitials}
|
|
146
|
-
</AvatarFallback>
|
|
147
|
-
</Avatar>
|
|
148
|
-
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
149
|
-
<span className="truncate font-semibold">
|
|
150
|
-
{user.name || user.email}
|
|
151
|
-
</span>
|
|
152
|
-
<span className="truncate text-xs">{user.email}</span>
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
155
|
-
</DropdownMenuLabel>
|
|
156
|
-
</DropdownMenuGroup>
|
|
157
|
-
<DropdownMenuSeparator />
|
|
158
|
-
<DropdownMenuGroup>
|
|
159
|
-
<MenuLink href="/settings">
|
|
160
|
-
<Settings className="mr-2 size-4" />
|
|
161
|
-
Settings
|
|
162
|
-
</MenuLink>
|
|
163
|
-
<DropdownMenuItem
|
|
164
|
-
onClick={() => {
|
|
165
|
-
setTheme(resolvedTheme === "light" ? "dark" : "light");
|
|
166
|
-
}}
|
|
167
|
-
>
|
|
168
|
-
{resolvedTheme === "light" ? (
|
|
169
|
-
<Moon className="mr-2 size-4" />
|
|
170
|
-
) : (
|
|
171
|
-
<Sun className="mr-2 size-4" />
|
|
172
|
-
)}
|
|
173
|
-
Toggle Theme
|
|
174
|
-
</DropdownMenuItem>
|
|
175
|
-
</DropdownMenuGroup>
|
|
176
|
-
<DropdownMenuSeparator />
|
|
177
|
-
<DropdownMenuGroup>
|
|
178
|
-
<DropdownMenuItem
|
|
179
|
-
onClick={() => {
|
|
180
|
-
startEventAction(async () => {
|
|
181
|
-
await signOutAndNavigate({
|
|
182
|
-
navigate: () => {
|
|
183
|
-
globalThis.location.href = "/";
|
|
184
|
-
},
|
|
185
|
-
onFailure: () => {
|
|
186
|
-
toast.error("Unable to sign out. Try again.");
|
|
187
|
-
},
|
|
188
|
-
signOut: async () => {
|
|
189
|
-
if (!(await signOutWithPlugin())) {
|
|
190
|
-
await authClient.signOut({
|
|
191
|
-
fetchOptions: { throw: true },
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
}}
|
|
198
|
-
>
|
|
199
|
-
<LogOut className="mr-2 size-4" />
|
|
200
|
-
Log out
|
|
201
|
-
</DropdownMenuItem>
|
|
202
|
-
</DropdownMenuGroup>
|
|
203
|
-
</AccountMenuContent>
|
|
204
|
-
</DropdownMenu>
|
|
205
|
-
</SidebarMenuItem>
|
|
206
|
-
</SidebarMenu>
|
|
207
|
-
);
|
|
17
|
+
return {
|
|
18
|
+
user: data?.user,
|
|
19
|
+
isPending,
|
|
20
|
+
theme: resolvedTheme,
|
|
21
|
+
onThemeChange: setTheme,
|
|
22
|
+
onSignIn: () => {
|
|
23
|
+
router.push("/login");
|
|
24
|
+
},
|
|
25
|
+
onSignOut: () => {
|
|
26
|
+
startEventAction(async () => {
|
|
27
|
+
await signOutAndNavigate({
|
|
28
|
+
navigate: () => {
|
|
29
|
+
globalThis.location.href = "/";
|
|
30
|
+
},
|
|
31
|
+
onFailure: () => {
|
|
32
|
+
toast.error("Unable to sign out. Try again.");
|
|
33
|
+
},
|
|
34
|
+
signOut: async () => {
|
|
35
|
+
if (!(await signOutWithPlugin())) {
|
|
36
|
+
await authClient.signOut({ fetchOptions: { throw: true } });
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
};
|
|
208
43
|
};
|
|
44
|
+
|
|
45
|
+
export const SidebarUserNav = () => <ChatAccount {...useAccountControl()} />;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { VideoOff } from "lucide-react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import type { Ref } from "react";
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
|
|
8
|
+
export const VideoPlayer = ({
|
|
9
|
+
src,
|
|
10
|
+
name,
|
|
11
|
+
className,
|
|
12
|
+
ref,
|
|
13
|
+
}: {
|
|
14
|
+
readonly src: string;
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly className?: string;
|
|
17
|
+
readonly ref?: Ref<HTMLVideoElement>;
|
|
18
|
+
}) => {
|
|
19
|
+
const [failedSource, setFailedSource] = useState<string>();
|
|
20
|
+
if (failedSource === src) {
|
|
21
|
+
return (
|
|
22
|
+
<output className="bg-muted/30 text-muted-foreground flex min-h-48 w-full flex-col items-center justify-center gap-2">
|
|
23
|
+
<VideoOff className="size-8" />
|
|
24
|
+
<span>Video unavailable</span>
|
|
25
|
+
</output>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
return (
|
|
29
|
+
// oxlint-disable-next-line jsx-a11y/media-has-caption -- Generated video results do not supply a caption track.
|
|
30
|
+
<video
|
|
31
|
+
ref={ref}
|
|
32
|
+
aria-label={name}
|
|
33
|
+
className={cn("max-h-[70vh] w-full bg-black object-contain", className)}
|
|
34
|
+
controls
|
|
35
|
+
playsInline
|
|
36
|
+
preload="metadata"
|
|
37
|
+
src={src}
|
|
38
|
+
onError={() => {
|
|
39
|
+
setFailedSource(src);
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
CanvasControl,
|
|
3
2
|
ImageControl,
|
|
4
3
|
ResearchControl,
|
|
5
|
-
SearchControl,
|
|
6
4
|
VideoControl,
|
|
7
5
|
} from "@/components/composer/tool-controls";
|
|
8
6
|
import type { ComposerControl } from "@/components/composer/control";
|
|
9
7
|
|
|
10
8
|
export const composerControls: ComposerControl[] = [
|
|
11
|
-
{ Component: CanvasControl, id: "canvas" },
|
|
12
|
-
{ Component: SearchControl, id: "web-search" },
|
|
13
9
|
{ Component: ResearchControl, id: "deep-research" },
|
|
14
10
|
{ Component: ImageControl, id: "image" },
|
|
15
11
|
{ Component: VideoControl, id: "video" },
|
|
@@ -4,7 +4,7 @@ Registered and guest chats use one EVE agent and one worker. Both enter through
|
|
|
4
4
|
|
|
5
5
|
Guest sessions request EVE native retention `0` on every backend. The installed instrumentation policy excludes guest input/output trace capture, which EVE uses to select zero retention; registered-user policy remains unchanged. Scheduled cleanup ends the session and completes the local credential policy. Guest admission and cleanup do not require the PostgreSQL purge lifecycle.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
PostgreSQL World 5.1.1 implements zero-retention payload clearing when a run finishes. Vercel enforces its own retention policy. Native retention leaves run metadata, provider logs, and previously exported traces. ChatJS cleanup reports session retirement rather than verifying payload erasure.
|
|
8
8
|
|
|
9
9
|
Guests keep the existing chat presentation at `/`. They get one inexpensive text model (`openai/gpt-5-nano`), with the picker locked. No tools, uploads, connectors, account APIs or account data are accessible. Server-owned policy enforces usage and rate limits plus bounded input and output. Registered authentication, billing, durable history and recovery keep their existing behavior.
|
|
10
10
|
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { config } from "@/lib/config";
|
|
2
1
|
import { instrumentation } from "@/integrations/instrumentation";
|
|
3
2
|
|
|
4
3
|
export const register = async (): Promise<void> => {
|
|
5
|
-
// Start every installed registration even if another one fails
|
|
4
|
+
// Start every installed registration even if another one fails.
|
|
6
5
|
await Promise.all(
|
|
7
6
|
instrumentation.map(async (registration) => {
|
|
8
|
-
await registration(
|
|
9
|
-
appPrefix: config.appPrefix,
|
|
10
|
-
runtime: process.env.NEXT_RUNTIME,
|
|
11
|
-
});
|
|
7
|
+
await registration();
|
|
12
8
|
})
|
|
13
9
|
);
|
|
14
10
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { config } from "@/lib/config";
|
|
2
|
+
|
|
3
|
+
/** Application model picker choices. Native EVE agents configure their own model. */
|
|
4
|
+
export const webModels: {
|
|
5
|
+
readonly model?: string;
|
|
6
|
+
readonly allowedModels: readonly string[];
|
|
7
|
+
} = {
|
|
8
|
+
model: config.ai.workflows.chat,
|
|
9
|
+
allowedModels: [],
|
|
10
|
+
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { toolDefinitions } from "./definitions";
|
|
2
|
-
import { documentDefinitions } from "../documents/definitions";
|
|
3
2
|
import { installedToolNames as installedToolNamesInput } from "@/chatjs/generated/installed-tools";
|
|
4
3
|
|
|
5
4
|
export const installedToolNames: ReadonlySet<string> = new Set([
|
|
6
5
|
...installedToolNamesInput,
|
|
7
6
|
...toolDefinitions.map((definition) => definition.name),
|
|
8
7
|
]);
|
|
9
|
-
export const installedDocumentKinds: ReadonlySet<string> =
|
|
10
|
-
documentDefinitions.kinds;
|
|
@@ -11,6 +11,7 @@ vi.mock("next/cache", () => ({
|
|
|
11
11
|
vi.mock("@/lib/config", () => ({
|
|
12
12
|
config: {
|
|
13
13
|
ai: {
|
|
14
|
+
workflows: { chat: "openai/gpt-5-mini" },
|
|
14
15
|
curatedDefaults: ["openai/gpt-5-mini"],
|
|
15
16
|
disabledModels: ["fixture/disabled"],
|
|
16
17
|
gateway: "vercel",
|
|
@@ -18,6 +19,16 @@ vi.mock("@/lib/config", () => ({
|
|
|
18
19
|
},
|
|
19
20
|
},
|
|
20
21
|
}));
|
|
22
|
+
vi.mock("@/integrations/chat/models", () => ({
|
|
23
|
+
webModels: {
|
|
24
|
+
allowedModels: [
|
|
25
|
+
"openai/gpt-5-mini-reasoning",
|
|
26
|
+
"fixture/known",
|
|
27
|
+
"fixture/new",
|
|
28
|
+
"fixture/last",
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
}));
|
|
21
32
|
vi.mock("./models.generated", () => ({
|
|
22
33
|
generatedForGateway: "vercel",
|
|
23
34
|
models: [{ id: "openai/gpt-5-mini" }, { id: "fixture/known" }],
|
|
@@ -80,12 +91,13 @@ test("chat catalogs preserve reasoning variants, disabled filtering, and provide
|
|
|
80
91
|
)
|
|
81
92
|
).toMatchObject({ reasoning: true });
|
|
82
93
|
});
|
|
83
|
-
test("readonly catalogs enable
|
|
94
|
+
test("readonly catalogs enable configured alternatives alongside curated defaults", async () => {
|
|
84
95
|
const models = Object.freeze(await fetchChatModels());
|
|
85
96
|
const enabled = getDefaultEnabledModels(models);
|
|
86
97
|
expect([...enabled]).toEqual([
|
|
87
98
|
"openai/gpt-5-mini",
|
|
88
99
|
"openai/gpt-5-mini-reasoning",
|
|
100
|
+
"fixture/known",
|
|
89
101
|
"fixture/new",
|
|
90
102
|
"fixture/last",
|
|
91
103
|
]);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { webModels } from "@/integrations/chat/models";
|
|
1
2
|
import {
|
|
2
3
|
generatedForGateway,
|
|
3
4
|
models as generatedModels,
|
|
@@ -66,8 +67,13 @@ const buildChatModels = (
|
|
|
66
67
|
): AppModelDefinition[] =>
|
|
67
68
|
appModels
|
|
68
69
|
.filter(
|
|
69
|
-
(model: {
|
|
70
|
-
|
|
70
|
+
(model: {
|
|
71
|
+
readonly id: string;
|
|
72
|
+
readonly output: { readonly text: boolean };
|
|
73
|
+
}) =>
|
|
74
|
+
model.output.text &&
|
|
75
|
+
(model.id === (webModels.model ?? config.ai.workflows.chat) ||
|
|
76
|
+
webModels.allowedModels.includes(model.id))
|
|
71
77
|
)
|
|
72
78
|
.toSorted(
|
|
73
79
|
(
|
|
@@ -130,7 +136,11 @@ const getDefaultEnabledModels = (
|
|
|
130
136
|
readonly apiModelId: string;
|
|
131
137
|
}[]
|
|
132
138
|
): Set<AppModelId> => {
|
|
133
|
-
const enabled = new Set<AppModelId>(
|
|
139
|
+
const enabled = new Set<AppModelId>([
|
|
140
|
+
...config.ai.curatedDefaults,
|
|
141
|
+
webModels.model ?? config.ai.workflows.chat,
|
|
142
|
+
...webModels.allowedModels,
|
|
143
|
+
]);
|
|
134
144
|
|
|
135
145
|
// If a curated default has a -reasoning variant, enable it too
|
|
136
146
|
for (const model of appModels) {
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import type { ImageModel, LanguageModel } from "ai";
|
|
2
2
|
import type { AppModelId } from "@/lib/ai/app-model-id";
|
|
3
3
|
import type { Experimental_VideoModelV4 } from "@ai-sdk/provider";
|
|
4
|
-
import type { ReadonlyNativeSurface } from "@/lib/readonly-native-surface";
|
|
5
|
-
import type { ResearchUpdate } from "@/tools/platform/research-updates-schema";
|
|
6
|
-
|
|
7
|
-
/** Progress events understood by installed search tools without depending on ChatMessage. */
|
|
8
|
-
interface ToolProgressWriter {
|
|
9
|
-
write: (
|
|
10
|
-
part: Readonly<{
|
|
11
|
-
data: ReadonlyNativeSurface<ResearchUpdate>;
|
|
12
|
-
id?: string;
|
|
13
|
-
type: "data-researchUpdate";
|
|
14
|
-
}>
|
|
15
|
-
) => void;
|
|
16
|
-
}
|
|
17
4
|
|
|
18
5
|
interface ToolModelProvider {
|
|
19
6
|
createImageModel: (modelId: string) => ImageModel;
|
|
@@ -25,4 +12,4 @@ interface ToolModelProvider {
|
|
|
25
12
|
output: { image: boolean; video: boolean };
|
|
26
13
|
}>;
|
|
27
14
|
}
|
|
28
|
-
export type { ToolModelProvider
|
|
15
|
+
export type { ToolModelProvider };
|
|
@@ -6,11 +6,16 @@ import { ui } from "@/integrations/tools/ui";
|
|
|
6
6
|
|
|
7
7
|
// Execution types constrain registration names only. Each view's payload types
|
|
8
8
|
// come from its shared schemas through defineToolRenderer.
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
type ToolNames<Execution, Workflows> = Extract<
|
|
10
|
+
keyof Execution | keyof Workflows,
|
|
11
|
+
string
|
|
12
|
+
>;
|
|
13
|
+
type RenderersFor<Names extends string> = [Names] extends [never]
|
|
14
|
+
? Record<string, never>
|
|
15
|
+
: Partial<Record<`tool-${Names}`, ValidatedToolRenderer>>;
|
|
16
|
+
type ToolRendererRegistry = RenderersFor<
|
|
17
|
+
ToolNames<typeof tools, WorkflowTools>
|
|
18
|
+
>;
|
|
14
19
|
|
|
15
20
|
const toolRendererRegistry: Readonly<
|
|
16
21
|
Partial<Record<string, ValidatedToolRenderer>>
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { reconcileEveWorkspaceTurn } from "@/lib/eve/reconcile-workspace-turn";
|
|
2
2
|
import { EveWorkspaceBusyError, lockEveWorkspace } from "./eve-workspace-turns";
|
|
3
|
-
import { getEveDocumentHistory } from "./eve-documents";
|
|
4
|
-
import { eveCopyResources } from "@/lib/eve/copy-transcript";
|
|
5
3
|
import { isNonEmptyString } from "@/lib/is-non-empty-string";
|
|
6
4
|
import { and, eq, inArray, sql } from "drizzle-orm";
|
|
7
5
|
import { db } from "./client";
|
|
8
|
-
import {
|
|
9
|
-
eveConversation,
|
|
10
|
-
eveDispatch,
|
|
11
|
-
eveDocumentHead,
|
|
12
|
-
eveDocumentRevision,
|
|
13
|
-
eveFileReference,
|
|
14
|
-
} from "./schema";
|
|
6
|
+
import { eveConversation, eveDispatch, eveFileReference } from "./schema";
|
|
15
7
|
import { getEveMessageDisplayReceipts } from "./eve-dispatch";
|
|
16
8
|
import { readCompletedEveCopyTranscript } from "@/lib/eve/completed-copy-source";
|
|
17
9
|
import { parseEveCopySeed } from "@/lib/eve/copy-seed";
|
|
@@ -85,9 +77,6 @@ export const initializeEveCurrentCopy = async (
|
|
|
85
77
|
) {
|
|
86
78
|
throw new Error("Source conversation not found.");
|
|
87
79
|
}
|
|
88
|
-
await tx.execute(
|
|
89
|
-
sql`select pg_advisory_xact_lock(hashtextextended(${`eve-document:${source.id}`}, 0))`
|
|
90
|
-
);
|
|
91
80
|
const dispatches = await tx
|
|
92
81
|
.select()
|
|
93
82
|
.from(eveDispatch)
|
|
@@ -109,68 +98,6 @@ export const initializeEveCurrentCopy = async (
|
|
|
109
98
|
receipts,
|
|
110
99
|
target.forkMessageId ?? undefined
|
|
111
100
|
);
|
|
112
|
-
const heads = await tx
|
|
113
|
-
.select()
|
|
114
|
-
.from(eveDocumentHead)
|
|
115
|
-
.where(
|
|
116
|
-
and(
|
|
117
|
-
eq(eveDocumentHead.conversationId, source.id),
|
|
118
|
-
eq(eveDocumentHead.ownerId, ownerId)
|
|
119
|
-
)
|
|
120
|
-
);
|
|
121
|
-
const selectedHeads: (typeof eveDocumentHead.$inferInsert)[] = [];
|
|
122
|
-
const selectedFileKeys = new Set(projection.resources.fileKeys);
|
|
123
|
-
for (const head of heads) {
|
|
124
|
-
if (
|
|
125
|
-
target.forkMessageId !== null &&
|
|
126
|
-
!projection.resources.documentIds.includes(head.documentId)
|
|
127
|
-
) {
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
// oxlint-disable-next-line eslint/no-await-in-loop -- Capture each document's authorized ancestry while its source document fence is held.
|
|
131
|
-
const history = await getEveDocumentHistory(
|
|
132
|
-
ownerId,
|
|
133
|
-
source.id,
|
|
134
|
-
head.documentId,
|
|
135
|
-
tx
|
|
136
|
-
);
|
|
137
|
-
const selected =
|
|
138
|
-
target.forkMessageId === null
|
|
139
|
-
? history.at(-1)
|
|
140
|
-
: history.findLast((revision) =>
|
|
141
|
-
projection.resources.revisionIds.includes(revision.id)
|
|
142
|
-
);
|
|
143
|
-
if (selected === undefined) {
|
|
144
|
-
throw new Error("Selected document revision is unavailable.");
|
|
145
|
-
}
|
|
146
|
-
selectedHeads.push({ ...head, conversationId, revisionId: selected.id });
|
|
147
|
-
const ancestry = history.slice(
|
|
148
|
-
0,
|
|
149
|
-
history.findIndex((revision) => revision.id === selected.id) + 1
|
|
150
|
-
);
|
|
151
|
-
// oxlint-disable-next-line eslint/no-await-in-loop -- Retain files only from the revisions this captured head authorizes.
|
|
152
|
-
const revisions = await tx
|
|
153
|
-
.select()
|
|
154
|
-
.from(eveDocumentRevision)
|
|
155
|
-
.where(
|
|
156
|
-
and(
|
|
157
|
-
eq(eveDocumentRevision.ownerId, ownerId),
|
|
158
|
-
eq(eveDocumentRevision.documentId, head.documentId),
|
|
159
|
-
inArray(
|
|
160
|
-
eveDocumentRevision.id,
|
|
161
|
-
ancestry.map((revision) => revision.id)
|
|
162
|
-
)
|
|
163
|
-
)
|
|
164
|
-
);
|
|
165
|
-
for (const revision of revisions) {
|
|
166
|
-
for (const key of eveCopyResources(revision).fileKeys) {
|
|
167
|
-
selectedFileKeys.add(key);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
if (selectedHeads.length) {
|
|
172
|
-
await tx.insert(eveDocumentHead).values(selectedHeads);
|
|
173
|
-
}
|
|
174
101
|
const files = await tx
|
|
175
102
|
.select()
|
|
176
103
|
.from(eveFileReference)
|
|
@@ -178,7 +105,7 @@ export const initializeEveCurrentCopy = async (
|
|
|
178
105
|
and(
|
|
179
106
|
eq(eveFileReference.conversationId, source.id),
|
|
180
107
|
eq(eveFileReference.ownerId, ownerId),
|
|
181
|
-
inArray(eveFileReference.key,
|
|
108
|
+
inArray(eveFileReference.key, projection.resources.fileKeys)
|
|
182
109
|
)
|
|
183
110
|
);
|
|
184
111
|
if (files.length) {
|
|
@@ -187,26 +114,15 @@ export const initializeEveCurrentCopy = async (
|
|
|
187
114
|
.values(files.map((file) => ({ ...file, conversationId })))
|
|
188
115
|
.onConflictDoNothing();
|
|
189
116
|
}
|
|
190
|
-
const { resolveWorkspaceSeedAttachments } =
|
|
191
|
-
await import("@/lib/eve/workspace-attachments");
|
|
192
117
|
await tx
|
|
193
118
|
.update(eveConversation)
|
|
194
|
-
.set({
|
|
195
|
-
initialSeed: await resolveWorkspaceSeedAttachments({
|
|
196
|
-
ownerId,
|
|
197
|
-
workspaceId: target.workspaceId,
|
|
198
|
-
seed: parseEveCopySeed({
|
|
199
|
-
...projection.seed,
|
|
200
|
-
attachments: "channel",
|
|
201
|
-
}),
|
|
202
|
-
}),
|
|
203
|
-
})
|
|
119
|
+
.set({ initialSeed: parseEveCopySeed(projection.seed) })
|
|
204
120
|
.where(eq(eveConversation.id, conversationId));
|
|
205
121
|
});
|
|
206
122
|
};
|
|
207
123
|
|
|
208
|
-
/** Only accepted server reservations can supply trusted
|
|
209
|
-
export const
|
|
124
|
+
/** Only accepted server reservations can supply trusted branch history. */
|
|
125
|
+
export const resolveEveBranchHistory = async (
|
|
210
126
|
ownerId: string,
|
|
211
127
|
reservationId: string
|
|
212
128
|
) => {
|
|
@@ -219,12 +135,14 @@ export const resolveEveCurrentCopySeed = async (
|
|
|
219
135
|
eq(eveConversation.ownerId, ownerId)
|
|
220
136
|
)
|
|
221
137
|
);
|
|
222
|
-
if (
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
138
|
+
if (row === undefined || !["creating", "uncertain"].includes(row.state)) {
|
|
139
|
+
throw new Error("Branch initialization is unavailable.");
|
|
140
|
+
}
|
|
141
|
+
if (row.parentConversationId === null) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
if (row.initialSeed === null) {
|
|
145
|
+
throw new Error("Branch history was not captured.");
|
|
228
146
|
}
|
|
229
147
|
return parseEveCopySeed(row.initialSeed);
|
|
230
148
|
};
|