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
|
@@ -3,27 +3,20 @@ import type { SessionStreamEvent } from "eve/client";
|
|
|
3
3
|
|
|
4
4
|
import { useEveDeliveryReceipt } from "./use-eve-delivery-receipt";
|
|
5
5
|
|
|
6
|
-
import { ParallelResponseModelPicker } from "@/components/parallel-responses/model-picker";
|
|
7
6
|
import { ChatSuggestions, MessageResponses } from "@/components/chat-slots";
|
|
7
|
+
import { ParallelResponseModelPicker } from "@/components/parallel-responses/model-picker";
|
|
8
8
|
|
|
9
9
|
import { withTaskCleanup } from "@/components/task-cleanup";
|
|
10
10
|
|
|
11
11
|
import { hasText } from "@/components/text-value";
|
|
12
12
|
|
|
13
13
|
import type { useEveAgent } from "eve/react";
|
|
14
|
-
import React, { useState } from "react";
|
|
15
14
|
import type { JSX as ReactJSX, ReactNode } from "react";
|
|
15
|
+
import React, { useState } from "react";
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
MessageScroller,
|
|
19
|
-
MessageScrollerButton,
|
|
20
|
-
MessageScrollerContent,
|
|
21
|
-
MessageScrollerItem,
|
|
22
|
-
MessageScrollerProvider,
|
|
23
|
-
MessageScrollerViewport,
|
|
24
|
-
} from "@/components/ui/message-scroller";
|
|
25
17
|
import { AttachmentList } from "@/components/attachment-list";
|
|
26
18
|
import { Button } from "@/components/ui/button";
|
|
19
|
+
import { MessageScrollerItem } from "@/components/ui/message-scroller";
|
|
27
20
|
import type { SelectedModelValue, UiToolName } from "@/lib/ai/types";
|
|
28
21
|
import {
|
|
29
22
|
expandSelectedModelValue,
|
|
@@ -31,10 +24,10 @@ import {
|
|
|
31
24
|
} from "@/lib/ai/types";
|
|
32
25
|
import { isEveAdmissionBusy } from "@/lib/eve/admission-retry";
|
|
33
26
|
import { isEveCommandRejection } from "@/lib/eve/command-rejection";
|
|
34
|
-
import { draftMessage, restoreDraft } from "@/lib/eve/draft";
|
|
35
27
|
import type { DraftAttachment } from "@/lib/eve/draft";
|
|
36
|
-
import {
|
|
28
|
+
import { draftMessage, restoreDraft } from "@/lib/eve/draft";
|
|
37
29
|
import type { LogicalChat, LogicalChatSnapshot } from "@/lib/eve/logical-chat";
|
|
30
|
+
import { logicalResponseSlots } from "@/lib/eve/logical-response-slots";
|
|
38
31
|
import type { ActivePendingEveMessage } from "@/lib/eve/message-delivery";
|
|
39
32
|
import { EVE_MESSAGE_OPERATION_HEADER } from "@/lib/eve/message-delivery";
|
|
40
33
|
import type { ReadonlyEveMessage } from "@/lib/eve/readonly-message-types";
|
|
@@ -45,19 +38,18 @@ import {
|
|
|
45
38
|
useModelChange,
|
|
46
39
|
} from "@/providers/default-model-provider";
|
|
47
40
|
|
|
48
|
-
import {
|
|
41
|
+
import { ChatConversationScreen } from "../chat/chat-conversation-screen";
|
|
42
|
+
import { ChatMessageEditor } from "../chat/chat-message-editor";
|
|
49
43
|
import { EveChatError } from "./eve-chat-error";
|
|
50
44
|
import { EveComposer } from "./eve-composer";
|
|
51
45
|
import { EveForkRecovery } from "./eve-fork-recovery";
|
|
52
46
|
import { EveInitialMessage } from "./eve-initial-message";
|
|
53
47
|
import { useLogicalChat } from "./eve-logical-context";
|
|
54
48
|
import { EveLogicalVersions } from "./eve-logical-navigation";
|
|
55
|
-
import { EveMessages } from "./eve-messages";
|
|
56
49
|
import {
|
|
57
50
|
EveOptimisticResponseGroup,
|
|
58
51
|
shouldAppendEveOptimisticResponseGroup,
|
|
59
52
|
} from "./eve-optimistic-response-group";
|
|
60
|
-
import { EveThinkingMessage } from "./eve-thinking-message";
|
|
61
53
|
import { useEveAttachments } from "./use-eve-attachments";
|
|
62
54
|
import { useEveComposerDraft } from "./use-eve-composer-draft";
|
|
63
55
|
import { useEveFork } from "./use-eve-fork";
|
|
@@ -262,42 +254,35 @@ const EveConversationEditor = ({
|
|
|
262
254
|
const handleEditDraft = fork.setDraft;
|
|
263
255
|
const handleEditToolChange = fork.setSelectedTool;
|
|
264
256
|
return (
|
|
265
|
-
<
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
Boolean(
|
|
279
|
-
fork.
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
/>
|
|
295
|
-
{fork.error && (
|
|
296
|
-
<p className="text-destructive text-sm" role="alert">
|
|
297
|
-
{fork.error}
|
|
298
|
-
</p>
|
|
299
|
-
)}
|
|
300
|
-
</div>
|
|
257
|
+
<ChatMessageEditor
|
|
258
|
+
error={fork.error}
|
|
259
|
+
composer={
|
|
260
|
+
<EveComposer
|
|
261
|
+
autoFocus
|
|
262
|
+
status={fork.busy ? "submitted" : "ready"}
|
|
263
|
+
disabled={
|
|
264
|
+
busy ||
|
|
265
|
+
commandPending ||
|
|
266
|
+
hasApproval ||
|
|
267
|
+
Boolean(pendingMessage) ||
|
|
268
|
+
fork.locked
|
|
269
|
+
}
|
|
270
|
+
readOnly={Boolean(fork.pending)}
|
|
271
|
+
draft={fork.draft}
|
|
272
|
+
capabilities={{
|
|
273
|
+
files: fork.files,
|
|
274
|
+
selectedTool: fork.selectedTool,
|
|
275
|
+
onToolChange: handleEditToolChange,
|
|
276
|
+
}}
|
|
277
|
+
modelIds={expandSelectedModelValue(fork.modelSelection.value)}
|
|
278
|
+
modelPicker={
|
|
279
|
+
<ParallelResponseModelPicker modelSelection={fork.modelSelection} />
|
|
280
|
+
}
|
|
281
|
+
onDraftChange={handleEditDraft}
|
|
282
|
+
onSubmit={onSubmit}
|
|
283
|
+
/>
|
|
284
|
+
}
|
|
285
|
+
/>
|
|
301
286
|
);
|
|
302
287
|
};
|
|
303
288
|
|
|
@@ -388,7 +373,6 @@ const EveDeliveryRecovery = ({
|
|
|
388
373
|
const conversationActionLocks = ({
|
|
389
374
|
busy,
|
|
390
375
|
commandPending,
|
|
391
|
-
cancelPending,
|
|
392
376
|
hasApproval,
|
|
393
377
|
pendingMessage,
|
|
394
378
|
fork,
|
|
@@ -397,20 +381,12 @@ const conversationActionLocks = ({
|
|
|
397
381
|
}: {
|
|
398
382
|
readonly busy: boolean;
|
|
399
383
|
readonly commandPending: boolean;
|
|
400
|
-
readonly cancelPending: boolean;
|
|
401
384
|
readonly hasApproval: boolean;
|
|
402
385
|
readonly pendingMessage: ReturnType<typeof useEveMessageDelivery>["pending"];
|
|
403
386
|
readonly fork: ReturnType<typeof useConversationInput>["fork"];
|
|
404
387
|
readonly snapshotError: string | undefined;
|
|
405
388
|
readonly editingMessageId: string | undefined;
|
|
406
389
|
}) => ({
|
|
407
|
-
document:
|
|
408
|
-
busy ||
|
|
409
|
-
commandPending ||
|
|
410
|
-
cancelPending ||
|
|
411
|
-
hasApproval ||
|
|
412
|
-
Boolean(pendingMessage) ||
|
|
413
|
-
fork.locked,
|
|
414
390
|
transcript:
|
|
415
391
|
busy ||
|
|
416
392
|
commandPending ||
|
|
@@ -729,7 +705,6 @@ const EveConversation = ({
|
|
|
729
705
|
const actionLocks = conversationActionLocks({
|
|
730
706
|
busy,
|
|
731
707
|
commandPending,
|
|
732
|
-
cancelPending,
|
|
733
708
|
hasApproval,
|
|
734
709
|
pendingMessage,
|
|
735
710
|
fork,
|
|
@@ -737,258 +712,211 @@ const EveConversation = ({
|
|
|
737
712
|
editingMessageId,
|
|
738
713
|
});
|
|
739
714
|
return (
|
|
740
|
-
<
|
|
741
|
-
replaying={agent.status === "resuming"}
|
|
742
|
-
onStopExecution={cancelExecution}
|
|
743
|
-
logicalChatId={controller.chatId}
|
|
744
|
-
getExecutionMessages={(id) => snapshot.agents.get(id)?.messages ?? []}
|
|
745
|
-
isExecutionBusy={(id) => {
|
|
746
|
-
const status = snapshot.agents.get(id)?.status;
|
|
747
|
-
return isExecutionBusy(status);
|
|
748
|
-
}}
|
|
715
|
+
<ChatConversationScreen
|
|
749
716
|
conversationId={conversationId}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
717
|
+
header={header}
|
|
718
|
+
transcript={{
|
|
719
|
+
actionsDisabled: actionLocks.transcript,
|
|
720
|
+
conversationId,
|
|
721
|
+
disabled: busy || commandPending,
|
|
722
|
+
inputDisabled: isAnswerDisabled(agent.status, commandPending),
|
|
723
|
+
isReadonly: false,
|
|
724
|
+
messages,
|
|
725
|
+
editor: hasText(editingMessageId)
|
|
726
|
+
? {
|
|
727
|
+
content: (
|
|
728
|
+
<EveConversationEditor
|
|
729
|
+
fork={fork}
|
|
730
|
+
busy={busy}
|
|
731
|
+
commandPending={commandPending}
|
|
732
|
+
hasApproval={hasApproval}
|
|
733
|
+
pendingMessage={pendingMessage}
|
|
734
|
+
onSubmit={() => {
|
|
735
|
+
const completion = handleEditSubmit();
|
|
736
|
+
startEventAction(async () => {
|
|
737
|
+
await completion;
|
|
738
|
+
});
|
|
739
|
+
}}
|
|
740
|
+
/>
|
|
741
|
+
),
|
|
742
|
+
disabled: fork.busy || Boolean(fork.pending),
|
|
743
|
+
messageId: editingMessageId,
|
|
744
|
+
onCancel: fork.cancelEdit,
|
|
745
|
+
}
|
|
746
|
+
: undefined,
|
|
747
|
+
modelForMessage,
|
|
748
|
+
renderVersions: (message): React.JSX.Element => (
|
|
749
|
+
<EveLogicalVersions
|
|
750
|
+
conversationId={conversationId}
|
|
751
|
+
messageId={message.id}
|
|
752
|
+
disabled={actionLocks.navigation}
|
|
753
|
+
/>
|
|
754
|
+
),
|
|
755
|
+
renderResponses: (message): React.JSX.Element => (
|
|
756
|
+
<MessageResponses
|
|
757
|
+
conversationId={conversationId}
|
|
758
|
+
messageId={message.id}
|
|
759
|
+
disabled={actionLocks.navigation}
|
|
760
|
+
/>
|
|
761
|
+
),
|
|
762
|
+
messageKey: (message) =>
|
|
763
|
+
controller.logicalId(conversationId, message.id) ??
|
|
764
|
+
`${sessionId}:${message.id}`,
|
|
765
|
+
onEdit: (message) => {
|
|
766
|
+
const following = messages.slice(messages.indexOf(message) + 1);
|
|
767
|
+
const nextUser = following.findIndex(
|
|
768
|
+
(candidate) => candidate.role === "user"
|
|
769
|
+
);
|
|
770
|
+
const response = following
|
|
771
|
+
.slice(0, nextUser === -1 ? following.length : nextUser)
|
|
772
|
+
.find((candidate) => candidate.role === "assistant");
|
|
773
|
+
const logicalId = controller.logicalId(conversationId, message.id);
|
|
774
|
+
const group = hasText(logicalId)
|
|
775
|
+
? logicalResponseSlots(snapshot, logicalId)
|
|
776
|
+
: undefined;
|
|
777
|
+
const groupModels: Record<string, number> = {};
|
|
778
|
+
for (const slot of group?.slots ?? []) {
|
|
779
|
+
groupModels[slot.modelId] = (groupModels[slot.modelId] ?? 0) + 1;
|
|
780
|
+
}
|
|
781
|
+
const completion = fork.begin(message, undefined, {
|
|
782
|
+
events: agent.events,
|
|
783
|
+
modelSelection: group ? groupModels : undefined,
|
|
784
|
+
response:
|
|
785
|
+
response && hasText(modelForMessage(response))
|
|
786
|
+
? response
|
|
787
|
+
: undefined,
|
|
788
|
+
});
|
|
789
|
+
startEventAction(async () => {
|
|
790
|
+
await completion;
|
|
791
|
+
});
|
|
792
|
+
},
|
|
793
|
+
onRegenerate: (message, response) => {
|
|
794
|
+
void fork.begin(message, {
|
|
795
|
+
events: agent.events,
|
|
796
|
+
response,
|
|
797
|
+
});
|
|
798
|
+
},
|
|
799
|
+
suggestions: (
|
|
800
|
+
<ChatSuggestions
|
|
801
|
+
sessionId={sessionId}
|
|
802
|
+
conversationId={conversationId}
|
|
803
|
+
events={agent.events}
|
|
804
|
+
lastMessage={lastMessage}
|
|
805
|
+
disabled={actionLocks.transcript}
|
|
806
|
+
onSelect={(suggestion) => {
|
|
807
|
+
void run(async () => {
|
|
808
|
+
await (modelIds.length > 1
|
|
809
|
+
? fork.compare(
|
|
810
|
+
draftMessage(suggestion, []),
|
|
811
|
+
modelIds,
|
|
812
|
+
composerDraft.selectedTool ?? undefined,
|
|
813
|
+
false
|
|
814
|
+
)
|
|
815
|
+
: submitMessage(
|
|
816
|
+
suggestion,
|
|
817
|
+
[],
|
|
818
|
+
modelIds[0],
|
|
819
|
+
false,
|
|
820
|
+
composerDraft.selectedTool ?? undefined
|
|
821
|
+
));
|
|
822
|
+
});
|
|
823
|
+
}}
|
|
824
|
+
/>
|
|
825
|
+
),
|
|
826
|
+
respond: (response) => {
|
|
827
|
+
startEventAction(async () => {
|
|
828
|
+
await run(async () => {
|
|
829
|
+
await send(async () => {
|
|
830
|
+
await agent.respond([response]);
|
|
831
|
+
});
|
|
832
|
+
});
|
|
833
|
+
});
|
|
834
|
+
},
|
|
756
835
|
}}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
fork={fork}
|
|
792
|
-
busy={busy}
|
|
793
|
-
commandPending={commandPending}
|
|
794
|
-
hasApproval={hasApproval}
|
|
795
|
-
pendingMessage={pendingMessage}
|
|
796
|
-
onSubmit={() => {
|
|
797
|
-
const completion = handleEditSubmit();
|
|
798
|
-
startEventAction(async () => {
|
|
799
|
-
await completion;
|
|
800
|
-
});
|
|
801
|
-
}}
|
|
802
|
-
/>
|
|
803
|
-
),
|
|
804
|
-
disabled: fork.busy || Boolean(fork.pending),
|
|
805
|
-
messageId: editingMessageId,
|
|
806
|
-
onCancel: fork.cancelEdit,
|
|
807
|
-
}
|
|
808
|
-
: undefined
|
|
809
|
-
}
|
|
810
|
-
modelForMessage={modelForMessage}
|
|
811
|
-
renderVersions={(message): React.JSX.Element => (
|
|
812
|
-
<EveLogicalVersions
|
|
813
|
-
conversationId={conversationId}
|
|
814
|
-
messageId={message.id}
|
|
815
|
-
disabled={actionLocks.navigation}
|
|
816
|
-
/>
|
|
817
|
-
)}
|
|
818
|
-
renderResponses={(message): React.JSX.Element => (
|
|
819
|
-
<MessageResponses
|
|
820
|
-
conversationId={conversationId}
|
|
821
|
-
messageId={message.id}
|
|
822
|
-
disabled={actionLocks.navigation}
|
|
823
|
-
/>
|
|
824
|
-
)}
|
|
825
|
-
messageKey={(message) =>
|
|
826
|
-
controller.logicalId(conversationId, message.id) ??
|
|
827
|
-
`${sessionId}:${message.id}`
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
onEdit={(message) => {
|
|
831
|
-
const following = messages.slice(
|
|
832
|
-
messages.indexOf(message) + 1
|
|
833
|
-
);
|
|
834
|
-
const nextUser = following.findIndex(
|
|
835
|
-
(candidate) => candidate.role === "user"
|
|
836
|
-
);
|
|
837
|
-
const response = following
|
|
838
|
-
.slice(0, nextUser === -1 ? following.length : nextUser)
|
|
839
|
-
.find((candidate) => candidate.role === "assistant");
|
|
840
|
-
const logicalId = controller.logicalId(
|
|
841
|
-
conversationId,
|
|
842
|
-
message.id
|
|
843
|
-
);
|
|
844
|
-
const group = hasText(logicalId)
|
|
845
|
-
? logicalResponseSlots(snapshot, logicalId)
|
|
846
|
-
: undefined;
|
|
847
|
-
const groupModels: Record<string, number> = {};
|
|
848
|
-
for (const slot of group?.slots ?? []) {
|
|
849
|
-
groupModels[slot.modelId] =
|
|
850
|
-
(groupModels[slot.modelId] ?? 0) + 1;
|
|
851
|
-
}
|
|
852
|
-
const completion = fork.begin(message, undefined, {
|
|
853
|
-
events: agent.events,
|
|
854
|
-
modelSelection: group ? groupModels : undefined,
|
|
855
|
-
response:
|
|
856
|
-
response && hasText(modelForMessage(response))
|
|
857
|
-
? response
|
|
858
|
-
: undefined,
|
|
859
|
-
});
|
|
860
|
-
startEventAction(async () => {
|
|
861
|
-
await completion;
|
|
862
|
-
});
|
|
863
|
-
}}
|
|
864
|
-
|
|
865
|
-
onRegenerate={(message, response) => {
|
|
866
|
-
void fork.begin(message, {
|
|
867
|
-
events: agent.events,
|
|
868
|
-
response,
|
|
869
|
-
});
|
|
870
|
-
}}
|
|
871
|
-
|
|
872
|
-
suggestions={
|
|
873
|
-
<ChatSuggestions
|
|
874
|
-
sessionId={sessionId}
|
|
875
|
-
conversationId={conversationId}
|
|
876
|
-
events={agent.events}
|
|
877
|
-
lastMessage={lastMessage}
|
|
878
|
-
disabled={actionLocks.transcript}
|
|
879
|
-
onSelect={(suggestion) => {
|
|
880
|
-
void run(async () => {
|
|
881
|
-
await (modelIds.length > 1
|
|
882
|
-
? fork.compare(
|
|
883
|
-
draftMessage(suggestion, []),
|
|
884
|
-
modelIds,
|
|
885
|
-
composerDraft.selectedTool ?? undefined,
|
|
886
|
-
false
|
|
887
|
-
)
|
|
888
|
-
: submitMessage(
|
|
889
|
-
suggestion,
|
|
890
|
-
[],
|
|
891
|
-
modelIds[0],
|
|
892
|
-
false,
|
|
893
|
-
composerDraft.selectedTool ?? undefined
|
|
894
|
-
));
|
|
895
|
-
});
|
|
896
|
-
}}
|
|
897
|
-
/>
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
respond={(response) => {
|
|
901
|
-
startEventAction(async () => {
|
|
902
|
-
await run(async () => {
|
|
903
|
-
await send(async () => {
|
|
904
|
-
await agent.respond([response]);
|
|
905
|
-
});
|
|
906
|
-
});
|
|
907
|
-
});
|
|
908
|
-
}}
|
|
909
|
-
/>
|
|
910
|
-
<EveThinkingMessage
|
|
911
|
-
messages={messages}
|
|
912
|
-
status={composerStatus(agent.status)}
|
|
913
|
-
/>
|
|
914
|
-
{comparison &&
|
|
915
|
-
shouldAppendEveOptimisticResponseGroup(comparison) && (
|
|
916
|
-
<MessageScrollerItem
|
|
917
|
-
messageId={`comparison:${comparison.operationId}`}
|
|
918
|
-
scrollAnchor
|
|
919
|
-
>
|
|
920
|
-
<EveOptimisticResponseGroup operation={comparison} />
|
|
921
|
-
</MessageScrollerItem>
|
|
922
|
-
)}
|
|
923
|
-
</MessageScrollerContent>
|
|
924
|
-
</MessageScrollerViewport>
|
|
925
|
-
<MessageScrollerButton />
|
|
926
|
-
</MessageScroller>
|
|
927
|
-
</MessageScrollerProvider>
|
|
928
|
-
<div className="mx-auto w-full max-w-3xl space-y-3 p-4">
|
|
929
|
-
<EveForkRecovery
|
|
930
|
-
fork={fork}
|
|
931
|
-
showError={!hasText(editingMessageId)}
|
|
932
|
-
/>
|
|
933
|
-
<p aria-live="polite" className="sr-only">
|
|
934
|
-
{statusLabel}
|
|
935
|
-
</p>
|
|
936
|
-
{[snapshot.error, displayedError, composerDraft.error]
|
|
937
|
-
.filter(hasText)
|
|
938
|
-
.map((message): React.JSX.Element => (
|
|
939
|
-
<EveChatError key={message} message={message} />
|
|
940
|
-
))}
|
|
941
|
-
{pendingMessage && !commandPending && (
|
|
942
|
-
<EveDeliveryRecovery
|
|
943
|
-
pendingMessage={pendingMessage}
|
|
944
|
-
delivery={delivery}
|
|
945
|
-
composerDraft={composerDraft}
|
|
946
|
-
files={files}
|
|
947
|
-
run={run}
|
|
948
|
-
sendPendingMessage={sendPendingMessage}
|
|
949
|
-
setCommandFailure={setCommandFailure}
|
|
950
|
-
/>
|
|
951
|
-
)}
|
|
952
|
-
<EveConversationComposer
|
|
953
|
-
input={input}
|
|
836
|
+
status={composerStatus(agent.status)}
|
|
837
|
+
leading={
|
|
838
|
+
initialMessage !== undefined &&
|
|
839
|
+
initialMessage !== "" &&
|
|
840
|
+
messages.length === 0 && (
|
|
841
|
+
<MessageScrollerItem messageId="initial-message" scrollAnchor>
|
|
842
|
+
<EveInitialMessage message={initialMessage} />
|
|
843
|
+
</MessageScrollerItem>
|
|
844
|
+
)
|
|
845
|
+
}
|
|
846
|
+
trailing={
|
|
847
|
+
comparison &&
|
|
848
|
+
shouldAppendEveOptimisticResponseGroup(comparison) && (
|
|
849
|
+
<MessageScrollerItem
|
|
850
|
+
messageId={`comparison:${comparison.operationId}`}
|
|
851
|
+
scrollAnchor
|
|
852
|
+
>
|
|
853
|
+
<EveOptimisticResponseGroup operation={comparison} />
|
|
854
|
+
</MessageScrollerItem>
|
|
855
|
+
)
|
|
856
|
+
}
|
|
857
|
+
notices={
|
|
858
|
+
<>
|
|
859
|
+
<EveForkRecovery fork={fork} showError={!hasText(editingMessageId)} />
|
|
860
|
+
<p aria-live="polite" className="sr-only">
|
|
861
|
+
{statusLabel}
|
|
862
|
+
</p>
|
|
863
|
+
{[snapshot.error, displayedError, composerDraft.error]
|
|
864
|
+
.filter(hasText)
|
|
865
|
+
.map((message): React.JSX.Element => (
|
|
866
|
+
<EveChatError key={message} message={message} />
|
|
867
|
+
))}
|
|
868
|
+
{pendingMessage && !commandPending && (
|
|
869
|
+
<EveDeliveryRecovery
|
|
954
870
|
pendingMessage={pendingMessage}
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
commandFailure={commandFailure}
|
|
962
|
-
agentError={agent.error}
|
|
963
|
-
onStop={() => {
|
|
964
|
-
startEventAction(cancel);
|
|
965
|
-
}}
|
|
966
|
-
|
|
967
|
-
onSubmit={() => {
|
|
968
|
-
void run(async () => {
|
|
969
|
-
await (modelIds.length > 1
|
|
970
|
-
? fork.compare(
|
|
971
|
-
draftMessage(draft, files.attachments),
|
|
972
|
-
modelIds,
|
|
973
|
-
composerDraft.selectedTool ?? undefined
|
|
974
|
-
)
|
|
975
|
-
: submitMessage(
|
|
976
|
-
draft,
|
|
977
|
-
files.attachments,
|
|
978
|
-
modelIds[0],
|
|
979
|
-
true,
|
|
980
|
-
composerDraft.selectedTool ?? undefined
|
|
981
|
-
));
|
|
982
|
-
});
|
|
983
|
-
}}
|
|
984
|
-
onReconnect={() => {
|
|
985
|
-
void run(agent.resume);
|
|
986
|
-
}}
|
|
871
|
+
delivery={delivery}
|
|
872
|
+
composerDraft={composerDraft}
|
|
873
|
+
files={files}
|
|
874
|
+
run={run}
|
|
875
|
+
sendPendingMessage={sendPendingMessage}
|
|
876
|
+
setCommandFailure={setCommandFailure}
|
|
987
877
|
/>
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
878
|
+
)}
|
|
879
|
+
</>
|
|
880
|
+
}
|
|
881
|
+
composer={
|
|
882
|
+
<EveConversationComposer
|
|
883
|
+
input={input}
|
|
884
|
+
pendingMessage={pendingMessage}
|
|
885
|
+
status={agent.status}
|
|
886
|
+
busy={busy}
|
|
887
|
+
commandPending={commandPending}
|
|
888
|
+
cancelPending={cancelPending}
|
|
889
|
+
hasApproval={hasApproval}
|
|
890
|
+
displayedError={displayedError}
|
|
891
|
+
commandFailure={commandFailure}
|
|
892
|
+
agentError={agent.error}
|
|
893
|
+
onStop={() => {
|
|
894
|
+
startEventAction(cancel);
|
|
895
|
+
}}
|
|
896
|
+
|
|
897
|
+
onSubmit={() => {
|
|
898
|
+
void run(async () => {
|
|
899
|
+
await (modelIds.length > 1
|
|
900
|
+
? fork.compare(
|
|
901
|
+
draftMessage(draft, files.attachments),
|
|
902
|
+
modelIds,
|
|
903
|
+
composerDraft.selectedTool ?? undefined
|
|
904
|
+
)
|
|
905
|
+
: submitMessage(
|
|
906
|
+
draft,
|
|
907
|
+
files.attachments,
|
|
908
|
+
modelIds[0],
|
|
909
|
+
true,
|
|
910
|
+
composerDraft.selectedTool ?? undefined
|
|
911
|
+
));
|
|
912
|
+
});
|
|
913
|
+
}}
|
|
914
|
+
onReconnect={() => {
|
|
915
|
+
void run(agent.resume);
|
|
916
|
+
}}
|
|
917
|
+
/>
|
|
918
|
+
}
|
|
919
|
+
/>
|
|
992
920
|
);
|
|
993
921
|
};
|
|
994
922
|
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from "@tanstack/react-query";
|
|
10
10
|
import { isToday, isYesterday, subMonths, subWeeks } from "date-fns";
|
|
11
11
|
import { usePathname } from "next/navigation";
|
|
12
|
+
import { useChatNavigation } from "../chat/chat-navigation";
|
|
12
13
|
import type { JSX as ReactJSX } from "react";
|
|
13
14
|
import React, { useEffect, useRef } from "react";
|
|
14
15
|
|
|
@@ -75,7 +76,7 @@ export const EveHistoryList = ({
|
|
|
75
76
|
>,
|
|
76
77
|
index: number
|
|
77
78
|
) => Exclude<React.ReactNode, Promise<unknown>>;
|
|
78
|
-
readonly initialPage
|
|
79
|
+
readonly initialPage?: Awaited<ReturnType<typeof listEveConversations>>;
|
|
79
80
|
}): ReactJSX.Element => {
|
|
80
81
|
const trpc = useTRPC();
|
|
81
82
|
const openDeletion = useEveDeletion();
|
|
@@ -92,7 +93,9 @@ export const EveHistoryList = ({
|
|
|
92
93
|
readonly updatedAt: string;
|
|
93
94
|
} | null;
|
|
94
95
|
}) => page.nextCursor,
|
|
95
|
-
initialData:
|
|
96
|
+
initialData: initialPage
|
|
97
|
+
? { pageParams: [null], pages: [initialPage] }
|
|
98
|
+
: undefined,
|
|
96
99
|
}
|
|
97
100
|
)
|
|
98
101
|
);
|
|
@@ -105,7 +108,8 @@ export const EveHistoryList = ({
|
|
|
105
108
|
) => page.items
|
|
106
109
|
) ?? [];
|
|
107
110
|
const pathname = usePathname();
|
|
108
|
-
const
|
|
111
|
+
const navigation = useChatNavigation();
|
|
112
|
+
const route = parseChatIdFromPathname(navigation?.pathname ?? pathname);
|
|
109
113
|
const routeId = route.id;
|
|
110
114
|
const selectedIdentity = useQuery(
|
|
111
115
|
trpc.eve.get.queryOptions(
|