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
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { expect, test } from "vitest";
|
|
2
|
-
import { GetWeatherRenderer } from "./renderer";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { renderToStaticMarkup } from "react-dom/server";
|
|
5
|
-
import type { weatherResult } from "./schemas";
|
|
6
|
-
import type { z } from "zod";
|
|
7
|
-
|
|
8
|
-
type WeatherAtLocation = z.output<typeof weatherResult>;
|
|
9
|
-
|
|
10
|
-
const weather: WeatherAtLocation = {
|
|
11
|
-
current: { interval: 900, temperature_2m: 20, time: "2026-09-08T20:00" },
|
|
12
|
-
current_units: { interval: "seconds", temperature_2m: "°C", time: "iso8601" },
|
|
13
|
-
daily: {
|
|
14
|
-
sunrise: ["2026-09-08T06:00"],
|
|
15
|
-
sunset: ["2026-09-08T19:00"],
|
|
16
|
-
time: ["2026-09-08"],
|
|
17
|
-
},
|
|
18
|
-
daily_units: { sunrise: "iso8601", sunset: "iso8601", time: "iso8601" },
|
|
19
|
-
elevation: 0,
|
|
20
|
-
generationtime_ms: 0,
|
|
21
|
-
hourly: {
|
|
22
|
-
temperature_2m: [10, 11, 12, 13, 14, 15, 16, 17],
|
|
23
|
-
time: Array.from(
|
|
24
|
-
{ length: 8 },
|
|
25
|
-
(_hour, hourIndex) => `2026-09-08T${10 + hourIndex}:00`
|
|
26
|
-
),
|
|
27
|
-
},
|
|
28
|
-
hourly_units: { temperature_2m: "°C", time: "iso8601" },
|
|
29
|
-
latitude: 0,
|
|
30
|
-
longitude: 0,
|
|
31
|
-
timezone: "UTC",
|
|
32
|
-
timezone_abbreviation: "UTC",
|
|
33
|
-
utc_offset_seconds: 0,
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
test.each([
|
|
37
|
-
["2026-09-08T12:00", ["12PM", "1PM", "2PM", "3PM", "4PM", "5PM"]],
|
|
38
|
-
["2026-09-08T20:00", ["12PM", "1PM", "2PM", "3PM", "4PM", "5PM"]],
|
|
39
|
-
])("keeps a complete forecast row at %s", (time, hours: readonly string[]) => {
|
|
40
|
-
const html = renderToStaticMarkup(
|
|
41
|
-
<GetWeatherRenderer
|
|
42
|
-
isReadonly
|
|
43
|
-
messageId="weather-test"
|
|
44
|
-
tool={{
|
|
45
|
-
input: { latitude: 0, longitude: 0 },
|
|
46
|
-
output: { ...weather, current: { ...weather.current, time } },
|
|
47
|
-
state: "output-available",
|
|
48
|
-
toolCallId: "weather-test",
|
|
49
|
-
}}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
for (const hour of hours) {
|
|
53
|
-
expect(html).toContain(`>${hour}</div>`);
|
|
54
|
-
}
|
|
55
|
-
expect(html).not.toContain(">10AM</div>");
|
|
56
|
-
expect(html).not.toContain(">11AM</div>");
|
|
57
|
-
});
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { toolDefinition } from "./definition";
|
|
4
|
-
import { format, isWithinInterval } from "date-fns";
|
|
5
|
-
import type { weatherInput, weatherResult } from "./schemas";
|
|
6
|
-
import React from "react";
|
|
7
|
-
import type { ReadonlyNativeSurface } from "@/lib/readonly-native-surface";
|
|
8
|
-
import type { ToolRendererProps } from "@/chatjs/core/tools/define-renderer";
|
|
9
|
-
import { cn } from "@/lib/utils";
|
|
10
|
-
import { defineToolRenderer } from "@/chatjs/core/tools/define-renderer";
|
|
11
|
-
import { useIsMobile } from "@/hooks/use-mobile";
|
|
12
|
-
import type { z } from "zod";
|
|
13
|
-
|
|
14
|
-
type WeatherAtLocation = z.output<typeof weatherResult>;
|
|
15
|
-
|
|
16
|
-
type GetWeatherRendererTool = ToolRendererProps<
|
|
17
|
-
typeof weatherInput,
|
|
18
|
-
typeof weatherResult
|
|
19
|
-
>["tool"];
|
|
20
|
-
|
|
21
|
-
const SAMPLE = {
|
|
22
|
-
current: { interval: 900, temperature_2m: 29.3, time: "2024-10-07T19:30" },
|
|
23
|
-
current_units: { interval: "seconds", temperature_2m: "°C", time: "iso8601" },
|
|
24
|
-
daily: {
|
|
25
|
-
sunrise: [
|
|
26
|
-
"2024-10-07T07:15",
|
|
27
|
-
"2024-10-08T07:16",
|
|
28
|
-
"2024-10-09T07:17",
|
|
29
|
-
"2024-10-10T07:18",
|
|
30
|
-
"2024-10-11T07:19",
|
|
31
|
-
],
|
|
32
|
-
sunset: [
|
|
33
|
-
"2024-10-07T19:00",
|
|
34
|
-
"2024-10-08T18:58",
|
|
35
|
-
"2024-10-09T18:57",
|
|
36
|
-
"2024-10-10T18:55",
|
|
37
|
-
"2024-10-11T18:54",
|
|
38
|
-
],
|
|
39
|
-
time: [
|
|
40
|
-
"2024-10-07",
|
|
41
|
-
"2024-10-08",
|
|
42
|
-
"2024-10-09",
|
|
43
|
-
"2024-10-10",
|
|
44
|
-
"2024-10-11",
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
daily_units: {
|
|
48
|
-
sunrise: "iso8601",
|
|
49
|
-
sunset: "iso8601",
|
|
50
|
-
time: "iso8601",
|
|
51
|
-
},
|
|
52
|
-
elevation: 18,
|
|
53
|
-
generationtime_ms: Number("0.027894973754882812"),
|
|
54
|
-
hourly: {
|
|
55
|
-
temperature_2m: [
|
|
56
|
-
36.6, 32.8, 29.5, 28.6, 29.2, 28.2, 27.5, 26.6, 26.5, 26, 25, 23.5, 23.9,
|
|
57
|
-
24.2, 22.9, 21, 24, 28.1, 31.4, 33.9, 32.1, 28.9, 26.9, 25.2, 23, 21.1,
|
|
58
|
-
19.6, 18.6, 17.7, 16.8, 16.2, 15.5, 14.9, 14.4, 14.2, 13.7, 13.3, 12.9,
|
|
59
|
-
12.5, 13.5, 15.8, 17.7, 19.6, 21, 21.9, 22.3, 22, 20.7, 18.9, 17.9, 17.3,
|
|
60
|
-
17, 16.7, 16.2, 15.6, 15.2, 15, 15, 15.1, 14.8, 14.8, 14.9, 14.7, 14.8,
|
|
61
|
-
15.3, 16.2, 17.9, 19.6, 20.5, 21.6, 21, 20.7, 19.3, 18.7, 18.4, 17.9,
|
|
62
|
-
17.3, 17, 17, 16.8, 16.4, 16.2, 16, 15.8, 15.7, 15.4, 15.4, 16.1, 16.7,
|
|
63
|
-
17, 18.6, 19, 19.5, 19.4, 18.5, 17.9, 17.5, 16.7, 16.3, 16.1,
|
|
64
|
-
],
|
|
65
|
-
time: [
|
|
66
|
-
"2024-10-07T00:00",
|
|
67
|
-
"2024-10-07T01:00",
|
|
68
|
-
"2024-10-07T02:00",
|
|
69
|
-
"2024-10-07T03:00",
|
|
70
|
-
"2024-10-07T04:00",
|
|
71
|
-
"2024-10-07T05:00",
|
|
72
|
-
"2024-10-07T06:00",
|
|
73
|
-
"2024-10-07T07:00",
|
|
74
|
-
"2024-10-07T08:00",
|
|
75
|
-
"2024-10-07T09:00",
|
|
76
|
-
"2024-10-07T10:00",
|
|
77
|
-
"2024-10-07T11:00",
|
|
78
|
-
"2024-10-07T12:00",
|
|
79
|
-
"2024-10-07T13:00",
|
|
80
|
-
"2024-10-07T14:00",
|
|
81
|
-
"2024-10-07T15:00",
|
|
82
|
-
"2024-10-07T16:00",
|
|
83
|
-
"2024-10-07T17:00",
|
|
84
|
-
"2024-10-07T18:00",
|
|
85
|
-
"2024-10-07T19:00",
|
|
86
|
-
"2024-10-07T20:00",
|
|
87
|
-
"2024-10-07T21:00",
|
|
88
|
-
"2024-10-07T22:00",
|
|
89
|
-
"2024-10-07T23:00",
|
|
90
|
-
"2024-10-08T00:00",
|
|
91
|
-
"2024-10-08T01:00",
|
|
92
|
-
"2024-10-08T02:00",
|
|
93
|
-
"2024-10-08T03:00",
|
|
94
|
-
"2024-10-08T04:00",
|
|
95
|
-
"2024-10-08T05:00",
|
|
96
|
-
"2024-10-08T06:00",
|
|
97
|
-
"2024-10-08T07:00",
|
|
98
|
-
"2024-10-08T08:00",
|
|
99
|
-
"2024-10-08T09:00",
|
|
100
|
-
"2024-10-08T10:00",
|
|
101
|
-
"2024-10-08T11:00",
|
|
102
|
-
"2024-10-08T12:00",
|
|
103
|
-
"2024-10-08T13:00",
|
|
104
|
-
"2024-10-08T14:00",
|
|
105
|
-
"2024-10-08T15:00",
|
|
106
|
-
"2024-10-08T16:00",
|
|
107
|
-
"2024-10-08T17:00",
|
|
108
|
-
"2024-10-08T18:00",
|
|
109
|
-
"2024-10-08T19:00",
|
|
110
|
-
"2024-10-08T20:00",
|
|
111
|
-
"2024-10-08T21:00",
|
|
112
|
-
"2024-10-08T22:00",
|
|
113
|
-
"2024-10-08T23:00",
|
|
114
|
-
"2024-10-09T00:00",
|
|
115
|
-
"2024-10-09T01:00",
|
|
116
|
-
"2024-10-09T02:00",
|
|
117
|
-
"2024-10-09T03:00",
|
|
118
|
-
"2024-10-09T04:00",
|
|
119
|
-
"2024-10-09T05:00",
|
|
120
|
-
"2024-10-09T06:00",
|
|
121
|
-
"2024-10-09T07:00",
|
|
122
|
-
"2024-10-09T08:00",
|
|
123
|
-
"2024-10-09T09:00",
|
|
124
|
-
"2024-10-09T10:00",
|
|
125
|
-
"2024-10-09T11:00",
|
|
126
|
-
"2024-10-09T12:00",
|
|
127
|
-
"2024-10-09T13:00",
|
|
128
|
-
"2024-10-09T14:00",
|
|
129
|
-
"2024-10-09T15:00",
|
|
130
|
-
"2024-10-09T16:00",
|
|
131
|
-
"2024-10-09T17:00",
|
|
132
|
-
"2024-10-09T18:00",
|
|
133
|
-
"2024-10-09T19:00",
|
|
134
|
-
"2024-10-09T20:00",
|
|
135
|
-
"2024-10-09T21:00",
|
|
136
|
-
"2024-10-09T22:00",
|
|
137
|
-
"2024-10-09T23:00",
|
|
138
|
-
"2024-10-10T00:00",
|
|
139
|
-
"2024-10-10T01:00",
|
|
140
|
-
"2024-10-10T02:00",
|
|
141
|
-
"2024-10-10T03:00",
|
|
142
|
-
"2024-10-10T04:00",
|
|
143
|
-
"2024-10-10T05:00",
|
|
144
|
-
"2024-10-10T06:00",
|
|
145
|
-
"2024-10-10T07:00",
|
|
146
|
-
"2024-10-10T08:00",
|
|
147
|
-
"2024-10-10T09:00",
|
|
148
|
-
"2024-10-10T10:00",
|
|
149
|
-
"2024-10-10T11:00",
|
|
150
|
-
"2024-10-10T12:00",
|
|
151
|
-
"2024-10-10T13:00",
|
|
152
|
-
"2024-10-10T14:00",
|
|
153
|
-
"2024-10-10T15:00",
|
|
154
|
-
"2024-10-10T16:00",
|
|
155
|
-
"2024-10-10T17:00",
|
|
156
|
-
"2024-10-10T18:00",
|
|
157
|
-
"2024-10-10T19:00",
|
|
158
|
-
"2024-10-10T20:00",
|
|
159
|
-
"2024-10-10T21:00",
|
|
160
|
-
"2024-10-10T22:00",
|
|
161
|
-
"2024-10-10T23:00",
|
|
162
|
-
"2024-10-11T00:00",
|
|
163
|
-
"2024-10-11T01:00",
|
|
164
|
-
"2024-10-11T02:00",
|
|
165
|
-
"2024-10-11T03:00",
|
|
166
|
-
],
|
|
167
|
-
},
|
|
168
|
-
hourly_units: { temperature_2m: "°C", time: "iso8601" },
|
|
169
|
-
latitude: 37.763283,
|
|
170
|
-
longitude: -122.41286,
|
|
171
|
-
timezone: "GMT",
|
|
172
|
-
timezone_abbreviation: "GMT",
|
|
173
|
-
utc_offset_seconds: 0,
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
const roundUp = (num: number): number => Math.ceil(num);
|
|
177
|
-
|
|
178
|
-
const WeatherCard = ({
|
|
179
|
-
weatherAtLocation,
|
|
180
|
-
}: ReadonlyNativeSurface<{
|
|
181
|
-
weatherAtLocation: WeatherAtLocation;
|
|
182
|
-
}>): React.JSX.Element => {
|
|
183
|
-
const currentHigh = Math.max(
|
|
184
|
-
...weatherAtLocation.hourly.temperature_2m.slice(0, 24)
|
|
185
|
-
);
|
|
186
|
-
const currentLow = Math.min(
|
|
187
|
-
...weatherAtLocation.hourly.temperature_2m.slice(0, 24)
|
|
188
|
-
);
|
|
189
|
-
|
|
190
|
-
const isDay = isWithinInterval(new Date(weatherAtLocation.current.time), {
|
|
191
|
-
end: new Date(weatherAtLocation.daily.sunset[0]),
|
|
192
|
-
start: new Date(weatherAtLocation.daily.sunrise[0]),
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
const isMobile = useIsMobile();
|
|
196
|
-
const hoursToShow = isMobile ? 5 : 6;
|
|
197
|
-
const currentTimeIndex = weatherAtLocation.hourly.time.findIndex(
|
|
198
|
-
(time): boolean =>
|
|
199
|
-
new Date(time) >= new Date(weatherAtLocation.current.time)
|
|
200
|
-
);
|
|
201
|
-
const displayStartIndex =
|
|
202
|
-
currentTimeIndex === -1
|
|
203
|
-
? Math.max(0, weatherAtLocation.hourly.time.length - hoursToShow)
|
|
204
|
-
: currentTimeIndex;
|
|
205
|
-
const displayTimes = weatherAtLocation.hourly.time.slice(
|
|
206
|
-
displayStartIndex,
|
|
207
|
-
displayStartIndex + hoursToShow
|
|
208
|
-
);
|
|
209
|
-
const displayTemperatures = weatherAtLocation.hourly.temperature_2m.slice(
|
|
210
|
-
displayStartIndex,
|
|
211
|
-
displayStartIndex + hoursToShow
|
|
212
|
-
);
|
|
213
|
-
|
|
214
|
-
return (
|
|
215
|
-
<div
|
|
216
|
-
className={cn(
|
|
217
|
-
"skeleton-bg flex max-w-[500px] flex-col gap-4 rounded-2xl p-4",
|
|
218
|
-
{ "bg-blue-400": isDay },
|
|
219
|
-
{ "bg-indigo-900": !isDay }
|
|
220
|
-
)}
|
|
221
|
-
>
|
|
222
|
-
<div className="flex flex-row items-center justify-between">
|
|
223
|
-
<div className="flex flex-row items-center gap-2">
|
|
224
|
-
<div
|
|
225
|
-
className={cn(
|
|
226
|
-
"skeleton-div size-10 rounded-full",
|
|
227
|
-
{ "bg-yellow-300": isDay },
|
|
228
|
-
{ "bg-indigo-100": !isDay }
|
|
229
|
-
)}
|
|
230
|
-
/>
|
|
231
|
-
<div className="text-4xl font-medium text-blue-50">
|
|
232
|
-
{roundUp(weatherAtLocation.current.temperature_2m)}
|
|
233
|
-
{weatherAtLocation.current_units.temperature_2m}
|
|
234
|
-
</div>
|
|
235
|
-
</div>
|
|
236
|
-
|
|
237
|
-
<div className="text-blue-50">{`H:${roundUp(currentHigh)}° L:${roundUp(currentLow)}°`}</div>
|
|
238
|
-
</div>
|
|
239
|
-
|
|
240
|
-
<div className="flex flex-row justify-between">
|
|
241
|
-
{displayTimes.map((time, index) => (
|
|
242
|
-
<div className="flex flex-col items-center gap-1" key={time}>
|
|
243
|
-
<div className="text-xs text-blue-100">
|
|
244
|
-
{format(new Date(time), "ha")}
|
|
245
|
-
</div>
|
|
246
|
-
<div
|
|
247
|
-
className={cn(
|
|
248
|
-
"skeleton-div size-6 rounded-full",
|
|
249
|
-
{ "bg-yellow-300": isDay },
|
|
250
|
-
{ "bg-indigo-200": !isDay }
|
|
251
|
-
)}
|
|
252
|
-
/>
|
|
253
|
-
<div className="text-sm text-blue-50">
|
|
254
|
-
{roundUp(displayTemperatures[index])}
|
|
255
|
-
{weatherAtLocation.hourly_units.temperature_2m}
|
|
256
|
-
</div>
|
|
257
|
-
</div>
|
|
258
|
-
))}
|
|
259
|
-
</div>
|
|
260
|
-
</div>
|
|
261
|
-
);
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
const GetWeatherView = ({
|
|
265
|
-
tool,
|
|
266
|
-
}: ReadonlyNativeSurface<{
|
|
267
|
-
tool: GetWeatherRendererTool;
|
|
268
|
-
messageId: string;
|
|
269
|
-
isReadonly: boolean;
|
|
270
|
-
}>): React.JSX.Element => {
|
|
271
|
-
if (tool.state !== "output-available") {
|
|
272
|
-
return (
|
|
273
|
-
<div className="skeleton" key={tool.toolCallId}>
|
|
274
|
-
<WeatherCard weatherAtLocation={SAMPLE} />
|
|
275
|
-
</div>
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
if (tool.output === undefined) {
|
|
280
|
-
return <WeatherCard weatherAtLocation={SAMPLE} />;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
return <WeatherCard weatherAtLocation={tool.output} />;
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
export const GetWeatherRenderer = defineToolRenderer({
|
|
287
|
-
inputSchema: toolDefinition.inputSchema,
|
|
288
|
-
outputSchema: toolDefinition.outputSchema,
|
|
289
|
-
render: GetWeatherView,
|
|
290
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
const weatherInput = z.object({
|
|
4
|
-
latitude: z.number(),
|
|
5
|
-
longitude: z.number(),
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
const MINIMUM_FORECAST_SAMPLE_COUNT = 1;
|
|
9
|
-
const sunriseSeries = z.array(z.string()).min(MINIMUM_FORECAST_SAMPLE_COUNT);
|
|
10
|
-
const sunsetSeries = z.array(z.string()).min(MINIMUM_FORECAST_SAMPLE_COUNT);
|
|
11
|
-
const hourlyTemperatures = z
|
|
12
|
-
.array(z.number())
|
|
13
|
-
.min(MINIMUM_FORECAST_SAMPLE_COUNT);
|
|
14
|
-
const dailyForecast = z.object({
|
|
15
|
-
sunrise: sunriseSeries,
|
|
16
|
-
sunset: sunsetSeries,
|
|
17
|
-
time: z.array(z.string()),
|
|
18
|
-
});
|
|
19
|
-
const hourlyForecast = z.object({
|
|
20
|
-
temperature_2m: hourlyTemperatures,
|
|
21
|
-
time: z.array(z.string()),
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const weatherResult = z.object({
|
|
25
|
-
current: z.object({
|
|
26
|
-
interval: z.number(),
|
|
27
|
-
temperature_2m: z.number(),
|
|
28
|
-
time: z.iso.datetime({ local: true }),
|
|
29
|
-
}),
|
|
30
|
-
current_units: z.object({
|
|
31
|
-
interval: z.string(),
|
|
32
|
-
temperature_2m: z.string(),
|
|
33
|
-
time: z.string(),
|
|
34
|
-
}),
|
|
35
|
-
daily: dailyForecast,
|
|
36
|
-
daily_units: z.object({
|
|
37
|
-
sunrise: z.string(),
|
|
38
|
-
sunset: z.string(),
|
|
39
|
-
time: z.string(),
|
|
40
|
-
}),
|
|
41
|
-
elevation: z.number(),
|
|
42
|
-
generationtime_ms: z.number(),
|
|
43
|
-
hourly: hourlyForecast,
|
|
44
|
-
hourly_units: z.object({ temperature_2m: z.string(), time: z.string() }),
|
|
45
|
-
latitude: z.number(),
|
|
46
|
-
longitude: z.number(),
|
|
47
|
-
timezone: z.string(),
|
|
48
|
-
timezone_abbreviation: z.string(),
|
|
49
|
-
utc_offset_seconds: z.number(),
|
|
50
|
-
});
|
|
51
|
-
export { weatherInput, weatherResult };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { toolDefinition } from "./definition";
|
|
2
|
-
import type { weatherInput } from "./schemas";
|
|
3
|
-
import { weatherResult } from "./schemas";
|
|
4
|
-
import type { ToolUsage } from "@/lib/eve/tool-usage";
|
|
5
|
-
import { defineTool } from "eve/tools";
|
|
6
|
-
import { executeWithToolUsage } from "@/lib/eve/tool-usage";
|
|
7
|
-
import { toolResultToModelOutput } from "@/lib/eve/tool-model-output";
|
|
8
|
-
import type { z } from "zod";
|
|
9
|
-
|
|
10
|
-
const UNBILLED_TOOL_COST_USD = 0;
|
|
11
|
-
|
|
12
|
-
export const getWeather = defineTool({
|
|
13
|
-
description: toolDefinition.description,
|
|
14
|
-
execute: async (
|
|
15
|
-
{ latitude, longitude }: Readonly<z.infer<typeof weatherInput>>,
|
|
16
|
-
context: Readonly<{ abortSignal: Readonly<AbortSignal> }>
|
|
17
|
-
) =>
|
|
18
|
-
await executeWithToolUsage(
|
|
19
|
-
context,
|
|
20
|
-
async (usage: Readonly<Pick<ToolUsage, "addCostUsd">>) => {
|
|
21
|
-
const response = await fetch(
|
|
22
|
-
`https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}¤t=temperature_2m&hourly=temperature_2m&daily=sunrise,sunset&timezone=auto`,
|
|
23
|
-
{ signal: context.abortSignal }
|
|
24
|
-
);
|
|
25
|
-
if (!response.ok) {
|
|
26
|
-
throw new Error("Weather request failed.");
|
|
27
|
-
}
|
|
28
|
-
usage.addCostUsd(UNBILLED_TOOL_COST_USD);
|
|
29
|
-
return weatherResult.parse(await response.json());
|
|
30
|
-
}
|
|
31
|
-
),
|
|
32
|
-
inputSchema: toolDefinition.inputSchema,
|
|
33
|
-
toModelOutput: toolResultToModelOutput,
|
|
34
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
eveDocumentReadInput,
|
|
3
|
-
eveDocumentReadResult,
|
|
4
|
-
} from "@/chatjs/core/documents/contracts";
|
|
5
|
-
import type { ToolContext } from "eve/tools";
|
|
6
|
-
import { defineTool } from "eve/tools";
|
|
7
|
-
import { executeEveDocumentTool } from "@/lib/eve/document-tools";
|
|
8
|
-
import type { z } from "zod";
|
|
9
|
-
|
|
10
|
-
type ReadonlyReadInput = Readonly<z.infer<typeof eveDocumentReadInput>>;
|
|
11
|
-
|
|
12
|
-
type ReadonlyReadContext = Readonly<
|
|
13
|
-
Pick<ToolContext, "callId" | "session"> & {
|
|
14
|
-
abortSignal: Readonly<AbortSignal>;
|
|
15
|
-
}
|
|
16
|
-
>;
|
|
17
|
-
|
|
18
|
-
export const readDocument = defineTool({
|
|
19
|
-
description:
|
|
20
|
-
"Read the latest document content and revision ID in this conversation before editing it.",
|
|
21
|
-
execute: async (input: ReadonlyReadInput, context: ReadonlyReadContext) =>
|
|
22
|
-
eveDocumentReadResult.parse(
|
|
23
|
-
await executeEveDocumentTool("readDocument", input, context)
|
|
24
|
-
),
|
|
25
|
-
inputSchema: eveDocumentReadInput,
|
|
26
|
-
outputSchema: eveDocumentReadResult,
|
|
27
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"envRequirements": [{ "options": [["FIRECRAWL_API_KEY"]] }],
|
|
3
|
-
"id": "retrieve-url",
|
|
4
|
-
"kind": "tool",
|
|
5
|
-
"requiresTools": [],
|
|
6
|
-
"slot": "retrieveUrl",
|
|
7
|
-
"tools": [
|
|
8
|
-
{ "rendererExport": "RetrieveUrlRenderer", "toolExport": "retrieveUrl" }
|
|
9
|
-
],
|
|
10
|
-
"contractVersion": 1
|
|
11
|
-
}
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { ChevronDown, ExternalLink, Globe, TextIcon } from "lucide-react";
|
|
3
|
-
import { Alert, AlertTitle, AlertDescription } from "@/components/ui/alert";
|
|
4
|
-
import { retrievedInput, retrievedResult } from "./schemas";
|
|
5
|
-
import React from "react";
|
|
6
|
-
import ReactMarkdown from "react-markdown";
|
|
7
|
-
import type { ReadonlyNativeSurface } from "@/lib/readonly-native-surface";
|
|
8
|
-
import type { ToolRendererProps } from "@/chatjs/core/tools/define-renderer";
|
|
9
|
-
import { defineToolRenderer } from "@/chatjs/core/tools/define-renderer";
|
|
10
|
-
|
|
11
|
-
type RetrieveUrlRendererTool = ToolRendererProps<
|
|
12
|
-
typeof retrievedInput,
|
|
13
|
-
typeof retrievedResult
|
|
14
|
-
>["tool"];
|
|
15
|
-
|
|
16
|
-
const LoadingState = (): React.JSX.Element => (
|
|
17
|
-
<div className="border-border bg-card my-4 rounded-xl border p-4">
|
|
18
|
-
<div className="flex items-center gap-4">
|
|
19
|
-
<div className="relative h-10 w-10">
|
|
20
|
-
<div className="bg-primary/10 absolute inset-0 animate-pulse rounded-full" />
|
|
21
|
-
<Globe className="text-primary/70 absolute inset-0 m-auto h-5 w-5" />
|
|
22
|
-
</div>
|
|
23
|
-
<div className="flex-1 space-y-2">
|
|
24
|
-
<div className="bg-muted-foreground/20 h-4 w-36 animate-pulse rounded-md" />
|
|
25
|
-
<div className="space-y-1.5">
|
|
26
|
-
<div className="bg-muted-foreground/15 h-3 w-full animate-pulse rounded-md" />
|
|
27
|
-
<div className="bg-muted-foreground/15 h-3 w-2/3 animate-pulse rounded-md" />
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
const ErrorState = ({
|
|
35
|
-
errorMessage,
|
|
36
|
-
}: Readonly<{ errorMessage: string | undefined }>): React.JSX.Element => (
|
|
37
|
-
<Alert variant="destructive" className="my-4">
|
|
38
|
-
<Globe />
|
|
39
|
-
<AlertTitle>Error retrieving content</AlertTitle>
|
|
40
|
-
<AlertDescription>{errorMessage}</AlertDescription>
|
|
41
|
-
</Alert>
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const getItemProperty = (
|
|
45
|
-
item: unknown,
|
|
46
|
-
property: string,
|
|
47
|
-
defaultValue: string
|
|
48
|
-
): string => {
|
|
49
|
-
if (item !== null && typeof item === "object" && property in item) {
|
|
50
|
-
const value: unknown = Reflect.get(item, property);
|
|
51
|
-
return typeof value === "string" ? value : defaultValue;
|
|
52
|
-
}
|
|
53
|
-
return defaultValue;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const RetrievedContentHeader = ({
|
|
57
|
-
firstItem,
|
|
58
|
-
}: Readonly<{ firstItem: unknown }>): React.JSX.Element => {
|
|
59
|
-
const url = getItemProperty(firstItem, "url", "");
|
|
60
|
-
const title = getItemProperty(firstItem, "title", "Retrieved Content");
|
|
61
|
-
const description = getItemProperty(
|
|
62
|
-
firstItem,
|
|
63
|
-
"description",
|
|
64
|
-
"No description available"
|
|
65
|
-
);
|
|
66
|
-
const language = getItemProperty(firstItem, "language", "Unknown");
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<div className="p-4">
|
|
70
|
-
<div className="flex items-start gap-4">
|
|
71
|
-
<div className="relative h-10 w-10 shrink-0">
|
|
72
|
-
<div className="from-primary/10 absolute inset-0 rounded-lg bg-linear-to-br to-transparent" />
|
|
73
|
-
<Globe className="text-primary/70 absolute inset-0 m-auto h-5 w-5" />
|
|
74
|
-
</div>
|
|
75
|
-
<div className="min-w-0 flex-1 space-y-2">
|
|
76
|
-
<h2 className="text-foreground truncate text-lg font-semibold tracking-tight">
|
|
77
|
-
{title}
|
|
78
|
-
</h2>
|
|
79
|
-
<p className="text-muted-foreground line-clamp-2 text-sm">
|
|
80
|
-
{description}
|
|
81
|
-
</p>
|
|
82
|
-
<div className="flex items-center gap-3">
|
|
83
|
-
<span className="bg-primary/10 text-primary rounded-full px-2.5 py-0.5 text-xs font-medium">
|
|
84
|
-
{language}
|
|
85
|
-
</span>
|
|
86
|
-
<a
|
|
87
|
-
className="text-muted-foreground hover:text-primary inline-flex items-center gap-1.5 text-xs transition-colors"
|
|
88
|
-
href={url || "#"}
|
|
89
|
-
rel="noopener noreferrer"
|
|
90
|
-
target="_blank"
|
|
91
|
-
>
|
|
92
|
-
<ExternalLink className="h-3 w-3" />
|
|
93
|
-
View source
|
|
94
|
-
</a>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const RetrievedContentDetails = ({
|
|
103
|
-
firstItem,
|
|
104
|
-
}: Readonly<{ firstItem: unknown }>): React.JSX.Element => {
|
|
105
|
-
const content = getItemProperty(firstItem, "content", "No content available");
|
|
106
|
-
|
|
107
|
-
return (
|
|
108
|
-
<div className="border-border border-t">
|
|
109
|
-
<details className="group">
|
|
110
|
-
<summary className="text-muted-foreground hover:bg-muted flex w-full cursor-pointer items-center justify-between px-4 py-2 text-sm transition-colors">
|
|
111
|
-
<div className="flex items-center gap-2">
|
|
112
|
-
<TextIcon className="text-muted-foreground h-4 w-4" />
|
|
113
|
-
<span>View content</span>
|
|
114
|
-
</div>
|
|
115
|
-
<ChevronDown className="h-4 w-4 transition-transform duration-200 group-open:rotate-180" />
|
|
116
|
-
</summary>
|
|
117
|
-
<div className="bg-muted/50 max-h-[50vh] overflow-y-auto p-4">
|
|
118
|
-
<div className="prose prose-neutral dark:prose-invert prose-sm max-w-none">
|
|
119
|
-
<ReactMarkdown>{content}</ReactMarkdown>
|
|
120
|
-
</div>
|
|
121
|
-
</div>
|
|
122
|
-
</details>
|
|
123
|
-
</div>
|
|
124
|
-
);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const getFirstItem = (result: unknown): unknown => {
|
|
128
|
-
if (
|
|
129
|
-
result !== null &&
|
|
130
|
-
typeof result === "object" &&
|
|
131
|
-
"results" in result &&
|
|
132
|
-
Array.isArray(result.results)
|
|
133
|
-
) {
|
|
134
|
-
return result.results[0];
|
|
135
|
-
}
|
|
136
|
-
return undefined;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const getErrorMessage = (
|
|
140
|
-
result: unknown,
|
|
141
|
-
firstItem: unknown
|
|
142
|
-
): string | null => {
|
|
143
|
-
const topLevelError =
|
|
144
|
-
result !== null &&
|
|
145
|
-
typeof result === "object" &&
|
|
146
|
-
"error" in result &&
|
|
147
|
-
typeof result.error === "string"
|
|
148
|
-
? result.error
|
|
149
|
-
: undefined;
|
|
150
|
-
const firstItemError =
|
|
151
|
-
firstItem !== null &&
|
|
152
|
-
typeof firstItem === "object" &&
|
|
153
|
-
"error" in firstItem &&
|
|
154
|
-
typeof firstItem.error === "string"
|
|
155
|
-
? firstItem.error
|
|
156
|
-
: undefined;
|
|
157
|
-
|
|
158
|
-
return topLevelError ?? firstItemError ?? null;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
const RetrieveUrlView = ({
|
|
162
|
-
tool,
|
|
163
|
-
}: ReadonlyNativeSurface<{
|
|
164
|
-
tool: RetrieveUrlRendererTool;
|
|
165
|
-
messageId: string;
|
|
166
|
-
isReadonly: boolean;
|
|
167
|
-
}>): React.JSX.Element | null => {
|
|
168
|
-
if (tool.state === "input-available" || tool.state === "input-streaming") {
|
|
169
|
-
return <LoadingState />;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if (tool.state !== "output-available") {
|
|
173
|
-
return null;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
if (tool.output === undefined) {
|
|
177
|
-
return null;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
const { output: result } = tool;
|
|
181
|
-
const firstItem = getFirstItem(result);
|
|
182
|
-
const errorMessage = getErrorMessage(result, firstItem);
|
|
183
|
-
|
|
184
|
-
if (typeof errorMessage === "string" && errorMessage !== "") {
|
|
185
|
-
return <ErrorState errorMessage={errorMessage} />;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
return (
|
|
189
|
-
<div className="border-border bg-card my-4 overflow-hidden rounded-xl border">
|
|
190
|
-
<RetrievedContentHeader firstItem={firstItem} />
|
|
191
|
-
<RetrievedContentDetails firstItem={firstItem} />
|
|
192
|
-
</div>
|
|
193
|
-
);
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
export const RetrieveUrlRenderer = defineToolRenderer({
|
|
197
|
-
inputSchema: retrievedInput,
|
|
198
|
-
outputSchema: retrievedResult,
|
|
199
|
-
render: RetrieveUrlView,
|
|
200
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
const environmentSchema = z.object({
|
|
4
|
-
FIRECRAWL_API_KEY: z.string().optional(),
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
const readToolEnvironment = (
|
|
8
|
-
environment: Readonly<NodeJS.ProcessEnv> = process.env
|
|
9
|
-
) => environmentSchema.parse(environment);
|
|
10
|
-
|
|
11
|
-
export { readToolEnvironment };
|