chat-js 1.0.0-alpha.2 → 1.0.0-alpha.4
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 +6 -4
- package/dist/index.js +2627 -2667
- package/package.json +10 -4
- 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
|
@@ -4,7 +4,7 @@ import { hasText, nonEmptyText } from "@/components/text-value";
|
|
|
4
4
|
|
|
5
5
|
import { useEveAgent } from "eve/react";
|
|
6
6
|
import React, { useEffect, useRef, useState } from "react";
|
|
7
|
-
import type { JSX as ReactJSX } from "react";
|
|
7
|
+
import type { JSX as ReactJSX, ReactNode } from "react";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
|
|
10
10
|
import {
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
MessageScrollerButton,
|
|
16
16
|
} from "@/components/ui/message-scroller";
|
|
17
17
|
import { ChatHeaderView } from "@/components/chat-header-view";
|
|
18
|
-
import {
|
|
18
|
+
import { ChatConversation } from "@/components/chat/chat-conversation";
|
|
19
19
|
import { ChatWelcomeView } from "@/components/chat/chat-welcome-view";
|
|
20
20
|
import { Button } from "@/components/ui/button";
|
|
21
21
|
import type { ReadonlyEveMessage } from "@/lib/eve/readonly-message-types";
|
|
@@ -23,7 +23,7 @@ import { GUEST_POLICY } from "./guest-policy";
|
|
|
23
23
|
|
|
24
24
|
import { EveModelPicker } from "@/components/eve/eve-model-picker";
|
|
25
25
|
import { EveComposer } from "@/components/eve/eve-composer";
|
|
26
|
-
import {
|
|
26
|
+
import { ChatTranscript } from "@/components/chat/chat-transcript";
|
|
27
27
|
|
|
28
28
|
const bindingSchema = z.object({
|
|
29
29
|
credential: z.string(),
|
|
@@ -92,7 +92,7 @@ const GuestConversationView = ({
|
|
|
92
92
|
<MessageScroller className="min-h-0 flex-1">
|
|
93
93
|
<MessageScrollerViewport>
|
|
94
94
|
<MessageScrollerContent className="mx-auto w-full max-w-3xl p-4">
|
|
95
|
-
<
|
|
95
|
+
<ChatTranscript
|
|
96
96
|
messages={messages}
|
|
97
97
|
isReadonly={false}
|
|
98
98
|
disabled={busy}
|
|
@@ -259,6 +259,50 @@ const GuestConversation = ({
|
|
|
259
259
|
);
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
+
const GuestChatLayout = ({
|
|
263
|
+
children,
|
|
264
|
+
}: {
|
|
265
|
+
readonly children: ReactNode;
|
|
266
|
+
}): ReactJSX.Element => (
|
|
267
|
+
<ChatConversation className="bg-background @container h-dvh max-h-dvh w-full min-w-0">
|
|
268
|
+
<ChatHeaderView breadcrumb={null} className="h-(--header-height)" />
|
|
269
|
+
{children}
|
|
270
|
+
</ChatConversation>
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
const GuestWelcomeView = ({
|
|
274
|
+
modelId,
|
|
275
|
+
busy,
|
|
276
|
+
error,
|
|
277
|
+
draft,
|
|
278
|
+
onDraftChange,
|
|
279
|
+
onSend,
|
|
280
|
+
}: {
|
|
281
|
+
readonly modelId: string;
|
|
282
|
+
readonly busy: boolean;
|
|
283
|
+
readonly error?: string;
|
|
284
|
+
readonly draft: string;
|
|
285
|
+
readonly onDraftChange: (draft: string) => void;
|
|
286
|
+
readonly onSend: () => void;
|
|
287
|
+
}): ReactJSX.Element => (
|
|
288
|
+
<ChatWelcomeView>
|
|
289
|
+
{hasText(error) && (
|
|
290
|
+
<p role="alert" className="text-destructive mb-3 text-sm">
|
|
291
|
+
{error}
|
|
292
|
+
</p>
|
|
293
|
+
)}
|
|
294
|
+
<EveComposer
|
|
295
|
+
autoFocus
|
|
296
|
+
modelPicker={<EveModelPicker disabled modelId={modelId} />}
|
|
297
|
+
status={busy ? "submitted" : "ready"}
|
|
298
|
+
disabled={busy || !modelId}
|
|
299
|
+
draft={draft}
|
|
300
|
+
onDraftChange={onDraftChange}
|
|
301
|
+
onSubmit={onSend}
|
|
302
|
+
/>
|
|
303
|
+
</ChatWelcomeView>
|
|
304
|
+
);
|
|
305
|
+
|
|
262
306
|
/** No URL, cookie, storage, or persisted application identity owns this chat. */
|
|
263
307
|
const GuestChatScreen = (): ReactJSX.Element => {
|
|
264
308
|
const [binding, setBinding] = useState<Binding>();
|
|
@@ -328,36 +372,28 @@ const GuestChatScreen = (): ReactJSX.Element => {
|
|
|
328
372
|
};
|
|
329
373
|
}, [binding]);
|
|
330
374
|
return (
|
|
331
|
-
<
|
|
332
|
-
|
|
333
|
-
<
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
status={busy ? "submitted" : "ready"}
|
|
348
|
-
disabled={busy || !modelId}
|
|
349
|
-
draft={draft}
|
|
350
|
-
onDraftChange={setDraft}
|
|
351
|
-
onSubmit={() => {
|
|
352
|
-
void submit();
|
|
353
|
-
}}
|
|
354
|
-
/>
|
|
355
|
-
</ChatWelcomeView>
|
|
356
|
-
)}
|
|
357
|
-
</section>
|
|
358
|
-
</ChatLayoutMain>
|
|
359
|
-
</ChatLayout>
|
|
375
|
+
<GuestChatLayout>
|
|
376
|
+
{binding ? (
|
|
377
|
+
<GuestConversation binding={binding} key={binding.sessionId} />
|
|
378
|
+
) : (
|
|
379
|
+
<GuestWelcomeView
|
|
380
|
+
modelId={modelId}
|
|
381
|
+
busy={busy}
|
|
382
|
+
error={commandError}
|
|
383
|
+
draft={draft}
|
|
384
|
+
onDraftChange={setDraft}
|
|
385
|
+
onSend={() => {
|
|
386
|
+
void submit();
|
|
387
|
+
}}
|
|
388
|
+
/>
|
|
389
|
+
)}
|
|
390
|
+
</GuestChatLayout>
|
|
360
391
|
);
|
|
361
392
|
};
|
|
362
393
|
|
|
363
|
-
export {
|
|
394
|
+
export {
|
|
395
|
+
GuestChatScreen,
|
|
396
|
+
GuestChatLayout,
|
|
397
|
+
GuestWelcomeView,
|
|
398
|
+
GuestConversationView,
|
|
399
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "image-viewer",
|
|
3
|
+
"kind": "plugin",
|
|
4
|
+
"files": [
|
|
5
|
+
"chatjs/plugins/image-viewer/client-plugin.ts",
|
|
6
|
+
"chatjs/plugins/image-viewer/viewer-action.tsx",
|
|
7
|
+
"chatjs/plugins/image-viewer/image-modal.tsx"
|
|
8
|
+
],
|
|
9
|
+
"client": {
|
|
10
|
+
"export": "imageViewerClient",
|
|
11
|
+
"composerControls": [],
|
|
12
|
+
"settingsItems": [],
|
|
13
|
+
"chat": true
|
|
14
|
+
},
|
|
15
|
+
"contractVersion": 2,
|
|
16
|
+
"uiBase": "base"
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { definePlugin, slot } from "@/chatjs/core/ui/slots";
|
|
3
|
+
import { ArtifactViewerActions } from "@/components/artifact-actions";
|
|
4
|
+
import { ImageViewerAction } from "./viewer-action";
|
|
5
|
+
|
|
6
|
+
export const imageViewerClient = definePlugin({
|
|
7
|
+
id: "image-viewer",
|
|
8
|
+
slots: [slot(ArtifactViewerActions, ImageViewerAction)],
|
|
9
|
+
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { ImageOffIcon, XIcon } from "lucide-react";
|
|
4
4
|
import Image from "next/image";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import type { JSX as ReactJSX } from "react";
|
|
7
|
-
import { toast } from "sonner";
|
|
8
7
|
|
|
9
|
-
import {
|
|
8
|
+
import { ImageActions } from "@/components/image-actions";
|
|
10
9
|
|
|
11
10
|
import {
|
|
12
11
|
Dialog,
|
|
@@ -16,8 +15,6 @@ import {
|
|
|
16
15
|
DialogTitle,
|
|
17
16
|
} from "@/components/ui/dialog";
|
|
18
17
|
|
|
19
|
-
import { cn } from "@/lib/utils";
|
|
20
|
-
|
|
21
18
|
import { useImageLoadError } from "@/hooks/use-image-load-error";
|
|
22
19
|
|
|
23
20
|
interface ImageModalProps {
|
|
@@ -28,87 +25,6 @@ interface ImageModalProps {
|
|
|
28
25
|
readonly showActions?: boolean;
|
|
29
26
|
}
|
|
30
27
|
|
|
31
|
-
const handleCopyImage = async (
|
|
32
|
-
event: Readonly<Pick<React.MouseEvent, "stopPropagation">>,
|
|
33
|
-
imageUrl: string | undefined
|
|
34
|
-
): Promise<void> => {
|
|
35
|
-
event.stopPropagation();
|
|
36
|
-
if (!(typeof imageUrl === "string" && imageUrl !== "")) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
try {
|
|
41
|
-
const response = await fetch(imageUrl);
|
|
42
|
-
const blob = await response.blob();
|
|
43
|
-
await navigator.clipboard.write([new ClipboardItem({ [blob.type]: blob })]);
|
|
44
|
-
toast.success("Copied image to clipboard!");
|
|
45
|
-
} catch {
|
|
46
|
-
toast.error("Failed to copy image to clipboard");
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const handleDownload = async (
|
|
51
|
-
event: Readonly<Pick<React.MouseEvent, "stopPropagation">>,
|
|
52
|
-
imageUrl: string | undefined
|
|
53
|
-
): Promise<void> => {
|
|
54
|
-
event.stopPropagation();
|
|
55
|
-
if (!(typeof imageUrl === "string" && imageUrl !== "")) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
const response = await fetch(imageUrl);
|
|
61
|
-
const blob = await response.blob();
|
|
62
|
-
const url = URL.createObjectURL(blob);
|
|
63
|
-
const downloadLink = document.createElement("a");
|
|
64
|
-
downloadLink.href = url;
|
|
65
|
-
downloadLink.download = `image-${Date.now()}.png`;
|
|
66
|
-
document.body.append(downloadLink);
|
|
67
|
-
downloadLink.click();
|
|
68
|
-
downloadLink.remove();
|
|
69
|
-
URL.revokeObjectURL(url);
|
|
70
|
-
} catch {
|
|
71
|
-
toast.error("Failed to download image");
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const ImageActions = ({
|
|
76
|
-
className,
|
|
77
|
-
imageUrl,
|
|
78
|
-
}: {
|
|
79
|
-
readonly className?: string;
|
|
80
|
-
readonly imageUrl: string | undefined;
|
|
81
|
-
}): React.JSX.Element => (
|
|
82
|
-
<div className={cn("flex items-center gap-1", className)}>
|
|
83
|
-
<Button
|
|
84
|
-
className="bg-black/50 text-white hover:bg-black/70 hover:text-white"
|
|
85
|
-
|
|
86
|
-
onClick={(event: Readonly<Pick<React.MouseEvent, "stopPropagation">>) => {
|
|
87
|
-
void handleCopyImage(event, imageUrl);
|
|
88
|
-
}}
|
|
89
|
-
size="icon-sm"
|
|
90
|
-
title="Copy image"
|
|
91
|
-
variant="ghost"
|
|
92
|
-
>
|
|
93
|
-
<CopyIcon size={16} />
|
|
94
|
-
<span className="sr-only">Copy image</span>
|
|
95
|
-
</Button>
|
|
96
|
-
<Button
|
|
97
|
-
className="bg-black/50 text-white hover:bg-black/70 hover:text-white"
|
|
98
|
-
|
|
99
|
-
onClick={(event: Readonly<Pick<React.MouseEvent, "stopPropagation">>) => {
|
|
100
|
-
void handleDownload(event, imageUrl);
|
|
101
|
-
}}
|
|
102
|
-
size="icon-sm"
|
|
103
|
-
title="Download image"
|
|
104
|
-
variant="ghost"
|
|
105
|
-
>
|
|
106
|
-
<DownloadIcon size={16} />
|
|
107
|
-
<span className="sr-only">Download image</span>
|
|
108
|
-
</Button>
|
|
109
|
-
</div>
|
|
110
|
-
);
|
|
111
|
-
|
|
112
28
|
const ImageModal = ({
|
|
113
29
|
isOpen,
|
|
114
30
|
onClose,
|
|
@@ -177,4 +93,4 @@ const ImageModal = ({
|
|
|
177
93
|
</Dialog>
|
|
178
94
|
);
|
|
179
95
|
};
|
|
180
|
-
export {
|
|
96
|
+
export { ImageModal };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ExpandIcon } from "lucide-react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import type { ArtifactReference } from "@/components/artifact-actions";
|
|
6
|
+
import { Button } from "@/components/ui/button";
|
|
7
|
+
import { ImageModal } from "./image-modal";
|
|
8
|
+
|
|
9
|
+
export const ImageViewerAction = ({
|
|
10
|
+
artifact,
|
|
11
|
+
onOpen,
|
|
12
|
+
}: {
|
|
13
|
+
readonly artifact: ArtifactReference;
|
|
14
|
+
readonly onOpen?: () => void;
|
|
15
|
+
}) => {
|
|
16
|
+
const [open, setOpen] = useState(false);
|
|
17
|
+
if (!artifact.mediaType.startsWith("image/")) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<Button
|
|
23
|
+
aria-label="Open image"
|
|
24
|
+
title="Open image"
|
|
25
|
+
size="icon-sm"
|
|
26
|
+
variant="ghost"
|
|
27
|
+
className="bg-black/50 text-white hover:bg-black/70 hover:text-white"
|
|
28
|
+
onClick={() => {
|
|
29
|
+
onOpen?.();
|
|
30
|
+
setOpen(true);
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
<ExpandIcon size={16} />
|
|
34
|
+
</Button>
|
|
35
|
+
{open && (
|
|
36
|
+
<ImageModal
|
|
37
|
+
imageName={artifact.name}
|
|
38
|
+
imageUrl={artifact.url}
|
|
39
|
+
isOpen
|
|
40
|
+
onClose={() => {
|
|
41
|
+
setOpen(false);
|
|
42
|
+
}}
|
|
43
|
+
/>
|
|
44
|
+
)}
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
DropdownMenuSubTrigger,
|
|
18
18
|
} from "@/components/ui/dropdown-menu";
|
|
19
19
|
import type { ReadonlyNativeSurface } from "@/lib/readonly-native-surface";
|
|
20
|
-
import { installedPlugins } from "@/integrations/plugin-catalog";
|
|
21
20
|
import { useSession } from "@/providers/session-provider";
|
|
22
21
|
import { useTRPC } from "@/trpc/react";
|
|
23
22
|
|
|
@@ -36,7 +35,7 @@ const ConnectorsControl = ({
|
|
|
36
35
|
isError,
|
|
37
36
|
} = useQuery({
|
|
38
37
|
...trpc.mcp.listConnected.queryOptions(),
|
|
39
|
-
enabled:
|
|
38
|
+
enabled: isAuthenticated,
|
|
40
39
|
});
|
|
41
40
|
|
|
42
41
|
const queryKey = trpc.mcp.listConnected.queryKey();
|
|
@@ -81,9 +80,6 @@ const ConnectorsControl = ({
|
|
|
81
80
|
},
|
|
82
81
|
})
|
|
83
82
|
);
|
|
84
|
-
if (!installedPlugins.has("mcp")) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
83
|
let status: string | undefined;
|
|
88
84
|
if (!isAuthenticated) {
|
|
89
85
|
status = "Sign in to use connectors";
|
|
@@ -139,5 +135,4 @@ const ConnectorsControl = ({
|
|
|
139
135
|
);
|
|
140
136
|
};
|
|
141
137
|
|
|
142
|
-
ConnectorsControl.isAvailable = (): boolean => installedPlugins.has("mcp");
|
|
143
138
|
export { ConnectorsControl };
|
|
@@ -23,13 +23,25 @@ import { getProjectColorName, getProjectIconName } from "../project-icons";
|
|
|
23
23
|
|
|
24
24
|
import { EveMoveProjectDialog } from "./eve-move-project-dialog";
|
|
25
25
|
|
|
26
|
-
export const ProjectsSidebar = (
|
|
26
|
+
export const ProjectsSidebar = ({
|
|
27
|
+
conversationId,
|
|
28
|
+
allowManagement = true,
|
|
29
|
+
onProjectSelect,
|
|
30
|
+
}: {
|
|
31
|
+
readonly conversationId?: string;
|
|
32
|
+
readonly allowManagement?: boolean;
|
|
33
|
+
readonly onProjectSelect?: (id: string) => void;
|
|
34
|
+
}): React.JSX.Element | null => {
|
|
27
35
|
const { data: session } = useSession();
|
|
28
36
|
return session?.user ? (
|
|
29
37
|
<SidebarGroup className="group-data-[collapsible=icon]:hidden">
|
|
30
38
|
<SidebarGroupLabel>Projects</SidebarGroupLabel>
|
|
31
39
|
<SidebarMenu>
|
|
32
|
-
<SidebarProjects
|
|
40
|
+
<SidebarProjects
|
|
41
|
+
conversationId={conversationId}
|
|
42
|
+
allowManagement={allowManagement}
|
|
43
|
+
onProjectSelect={onProjectSelect}
|
|
44
|
+
/>
|
|
33
45
|
</SidebarMenu>
|
|
34
46
|
</SidebarGroup>
|
|
35
47
|
) : null;
|
|
@@ -67,8 +79,10 @@ export const ProjectChatActions = ({
|
|
|
67
79
|
|
|
68
80
|
export const ProjectBreadcrumb = ({
|
|
69
81
|
chatId,
|
|
82
|
+
onProjectSelect,
|
|
70
83
|
}: {
|
|
71
84
|
readonly chatId: string;
|
|
85
|
+
readonly onProjectSelect?: (id: string) => void;
|
|
72
86
|
}): React.JSX.Element | null => {
|
|
73
87
|
const { data: session } = useSession();
|
|
74
88
|
const trpc = useTRPC();
|
|
@@ -88,6 +102,12 @@ export const ProjectBreadcrumb = ({
|
|
|
88
102
|
aria-label={project.name}
|
|
89
103
|
title={project.name}
|
|
90
104
|
href={`/project/${project.id}`}
|
|
105
|
+
onClick={(event) => {
|
|
106
|
+
if (onProjectSelect) {
|
|
107
|
+
event.preventDefault();
|
|
108
|
+
onProjectSelect(project.id);
|
|
109
|
+
}
|
|
110
|
+
}}
|
|
91
111
|
>
|
|
92
112
|
<ProjectIcon
|
|
93
113
|
icon={getProjectIconName(project.icon)}
|
|
@@ -31,9 +31,13 @@ export const SidebarProjectItem = ({
|
|
|
31
31
|
project,
|
|
32
32
|
isActive,
|
|
33
33
|
setOpenMobile,
|
|
34
|
+
allowManagement = true,
|
|
35
|
+
onSelect,
|
|
34
36
|
}: {
|
|
35
37
|
readonly project: ReadonlyNativeSurface<Project>;
|
|
36
38
|
readonly isActive: boolean;
|
|
39
|
+
readonly allowManagement?: boolean;
|
|
40
|
+
readonly onSelect?: (id: string) => void;
|
|
37
41
|
readonly setOpenMobile: (open: boolean) => void;
|
|
38
42
|
}): ReactJSX.Element => {
|
|
39
43
|
const [showEditDialog, setShowEditDialog] = useState(false);
|
|
@@ -62,6 +66,13 @@ export const SidebarProjectItem = ({
|
|
|
62
66
|
className="cursor-pointer"
|
|
63
67
|
isActive={isActive}
|
|
64
68
|
href={projectHref}
|
|
69
|
+
onClick={(event) => {
|
|
70
|
+
if (onSelect) {
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
onSelect(project.id);
|
|
73
|
+
setOpenMobile(false);
|
|
74
|
+
}
|
|
75
|
+
}}
|
|
65
76
|
onNavigate={() => {
|
|
66
77
|
setOpenMobile(false);
|
|
67
78
|
}}
|
|
@@ -71,41 +82,45 @@ export const SidebarProjectItem = ({
|
|
|
71
82
|
<span>{project.name}</span>
|
|
72
83
|
</SidebarLink>
|
|
73
84
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
{allowManagement && (
|
|
86
|
+
<>
|
|
87
|
+
<DropdownMenu modal>
|
|
88
|
+
<SidebarActionMenu showOnHover={!isActive}>
|
|
89
|
+
<MoreHorizontal size={16} />
|
|
90
|
+
<span className="sr-only">More</span>
|
|
91
|
+
</SidebarActionMenu>
|
|
92
|
+
<DropdownMenuContent align="end" side="bottom">
|
|
93
|
+
<DropdownMenuGroup>
|
|
94
|
+
<ProjectMenuItems
|
|
95
|
+
onDelete={() => {
|
|
96
|
+
setShowDeleteDialog(true);
|
|
97
|
+
}}
|
|
98
|
+
onRename={() => {
|
|
99
|
+
setShowEditDialog(true);
|
|
100
|
+
}}
|
|
101
|
+
/>
|
|
102
|
+
</DropdownMenuGroup>
|
|
103
|
+
</DropdownMenuContent>
|
|
104
|
+
</DropdownMenu>
|
|
92
105
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
106
|
+
<ProjectDetailsDialog
|
|
107
|
+
initialColor={color}
|
|
108
|
+
initialIcon={icon}
|
|
109
|
+
initialName={project.name}
|
|
110
|
+
isLoading={isPending}
|
|
111
|
+
mode="edit"
|
|
112
|
+
onOpenChange={setShowEditDialog}
|
|
113
|
+
onSubmit={handleRename}
|
|
114
|
+
open={showEditDialog}
|
|
115
|
+
/>
|
|
103
116
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
117
|
+
<DeleteProjectDialog
|
|
118
|
+
deleteId={project.id}
|
|
119
|
+
setShowDeleteDialog={setShowDeleteDialog}
|
|
120
|
+
showDeleteDialog={showDeleteDialog}
|
|
121
|
+
/>
|
|
122
|
+
</>
|
|
123
|
+
)}
|
|
109
124
|
</SidebarMenuItem>
|
|
110
125
|
);
|
|
111
126
|
};
|
|
@@ -24,7 +24,15 @@ import type { ReadonlyNativeSurface } from "@/lib/readonly-native-surface";
|
|
|
24
24
|
import { parseChatIdFromPathname } from "@/providers/parse-chat-id-from-pathname";
|
|
25
25
|
import { useTRPC } from "@/trpc/react";
|
|
26
26
|
|
|
27
|
-
export const SidebarProjects = (
|
|
27
|
+
export const SidebarProjects = ({
|
|
28
|
+
conversationId,
|
|
29
|
+
allowManagement = true,
|
|
30
|
+
onProjectSelect,
|
|
31
|
+
}: {
|
|
32
|
+
readonly conversationId?: string;
|
|
33
|
+
readonly allowManagement?: boolean;
|
|
34
|
+
readonly onProjectSelect?: (id: string) => void;
|
|
35
|
+
}): ReactJSX.Element => {
|
|
28
36
|
const pathname = usePathname();
|
|
29
37
|
const router = useRouter();
|
|
30
38
|
const trpc = useTRPC();
|
|
@@ -36,10 +44,11 @@ export const SidebarProjects = (): ReactJSX.Element => {
|
|
|
36
44
|
const [newProjectDialogOpen, setNewProjectDialogOpen] = useState(false);
|
|
37
45
|
|
|
38
46
|
const route = parseChatIdFromPathname(pathname);
|
|
47
|
+
const activeConversationId = conversationId ?? route.id;
|
|
39
48
|
const membership = useQuery(
|
|
40
49
|
trpc.project.forChat.queryOptions(
|
|
41
|
-
{ id:
|
|
42
|
-
{ enabled: Boolean(
|
|
50
|
+
{ id: activeConversationId ?? "" },
|
|
51
|
+
{ enabled: Boolean(activeConversationId) }
|
|
43
52
|
)
|
|
44
53
|
);
|
|
45
54
|
const currentProjectId =
|
|
@@ -54,7 +63,11 @@ export const SidebarProjects = (): ReactJSX.Element => {
|
|
|
54
63
|
});
|
|
55
64
|
setNewProjectDialogOpen(false);
|
|
56
65
|
setOpenMobile(false);
|
|
57
|
-
|
|
66
|
+
if (onProjectSelect) {
|
|
67
|
+
onProjectSelect(data.id);
|
|
68
|
+
} else {
|
|
69
|
+
router.push(`/project/${data.id}`);
|
|
70
|
+
}
|
|
58
71
|
},
|
|
59
72
|
})
|
|
60
73
|
);
|
|
@@ -70,17 +83,19 @@ export const SidebarProjects = (): ReactJSX.Element => {
|
|
|
70
83
|
};
|
|
71
84
|
return (
|
|
72
85
|
<>
|
|
73
|
-
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
{allowManagement && (
|
|
87
|
+
<SidebarMenuItem>
|
|
88
|
+
<SidebarMenuButton
|
|
89
|
+
className="cursor-pointer"
|
|
90
|
+
onClick={() => {
|
|
91
|
+
setNewProjectDialogOpen(true);
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
<FolderPlus className="size-4" />
|
|
95
|
+
<span>New project</span>
|
|
96
|
+
</SidebarMenuButton>
|
|
97
|
+
</SidebarMenuItem>
|
|
98
|
+
)}
|
|
84
99
|
{!isLoading &&
|
|
85
100
|
projects?.map(
|
|
86
101
|
(
|
|
@@ -89,6 +104,8 @@ export const SidebarProjects = (): ReactJSX.Element => {
|
|
|
89
104
|
const isActive = currentProjectId === project.id;
|
|
90
105
|
return (
|
|
91
106
|
<SidebarProjectItem
|
|
107
|
+
allowManagement={allowManagement}
|
|
108
|
+
onSelect={onProjectSelect}
|
|
92
109
|
isActive={isActive}
|
|
93
110
|
key={project.id}
|
|
94
111
|
project={project}
|
|
@@ -98,13 +115,15 @@ export const SidebarProjects = (): ReactJSX.Element => {
|
|
|
98
115
|
}
|
|
99
116
|
)}
|
|
100
117
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
118
|
+
{allowManagement && (
|
|
119
|
+
<ProjectDetailsDialog
|
|
120
|
+
isLoading={createProjectMutation.isPending}
|
|
121
|
+
mode="create"
|
|
122
|
+
onOpenChange={setNewProjectDialogOpen}
|
|
123
|
+
onSubmit={handleCreateProject}
|
|
124
|
+
open={newProjectDialogOpen}
|
|
125
|
+
/>
|
|
126
|
+
)}
|
|
108
127
|
</>
|
|
109
128
|
);
|
|
110
129
|
};
|
|
@@ -3,6 +3,10 @@ import type { ChatServerIntegration } from "@/chatjs/core/chat/contracts";
|
|
|
3
3
|
import { eveSearchText } from "./search-schema";
|
|
4
4
|
|
|
5
5
|
export const searchChat = {
|
|
6
|
+
afterBranch: async ({ ownerId, conversationId, sessionId }) => {
|
|
7
|
+
const { backfillEveSearchConversation } = await import("./search-backfill");
|
|
8
|
+
await backfillEveSearchConversation(ownerId, conversationId, sessionId);
|
|
9
|
+
},
|
|
6
10
|
onDeleteConversations: async (tx, { conversationIds }) => {
|
|
7
11
|
if (conversationIds.length === 0) {
|
|
8
12
|
return;
|
|
@@ -174,8 +174,10 @@ const serverShortcut = (): string => "Ctrl+K";
|
|
|
174
174
|
|
|
175
175
|
export const EveSearchChats = ({
|
|
176
176
|
ownerId,
|
|
177
|
+
onChatSelect,
|
|
177
178
|
}: {
|
|
178
179
|
readonly ownerId?: string;
|
|
180
|
+
readonly onChatSelect?: (id: string) => void;
|
|
179
181
|
}): ReactJSX.Element => {
|
|
180
182
|
const shortcut = useSyncExternalStore(
|
|
181
183
|
subscribePlatform,
|
|
@@ -196,9 +198,9 @@ export const EveSearchChats = ({
|
|
|
196
198
|
setOpen((value) => !value);
|
|
197
199
|
}
|
|
198
200
|
};
|
|
199
|
-
document.addEventListener("keydown", down);
|
|
201
|
+
document.addEventListener("keydown", down, true);
|
|
200
202
|
return (): void => {
|
|
201
|
-
document.removeEventListener("keydown", down);
|
|
203
|
+
document.removeEventListener("keydown", down, true);
|
|
202
204
|
};
|
|
203
205
|
}, []);
|
|
204
206
|
return (
|
|
@@ -240,7 +242,11 @@ export const EveSearchChats = ({
|
|
|
240
242
|
onSelect={(id) => {
|
|
241
243
|
setOpen(false);
|
|
242
244
|
setOpenMobile(false);
|
|
243
|
-
|
|
245
|
+
if (onChatSelect) {
|
|
246
|
+
onChatSelect(id);
|
|
247
|
+
} else {
|
|
248
|
+
router.push(`/chat/${id}`);
|
|
249
|
+
}
|
|
244
250
|
}}
|
|
245
251
|
/>
|
|
246
252
|
)}
|