@larkup/workspace-app 0.0.0-stage → 0.2.0
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/LICENSE +176 -0
- package/README.md +4 -2
- package/assets/github.svg +3 -0
- package/assets/icons/Confluence.png +0 -0
- package/assets/icons/Instagram.png +0 -0
- package/assets/icons/Northflank.png +0 -0
- package/assets/icons/Salesforce.png +0 -0
- package/assets/icons/agentskills.png +0 -0
- package/assets/icons/airtable.png +0 -0
- package/assets/icons/asana.png +0 -0
- package/assets/icons/ashby.png +0 -0
- package/assets/icons/audio.png +0 -0
- package/assets/icons/aws-kendra.png +0 -0
- package/assets/icons/aws.svg +38 -0
- package/assets/icons/azure-ai-search.png +0 -0
- package/assets/icons/azure.svg +1 -0
- package/assets/icons/bigquery.png +0 -0
- package/assets/icons/bing.png +0 -0
- package/assets/icons/bitbucket.png +0 -0
- package/assets/icons/brave.png +0 -0
- package/assets/icons/browserbase.png +0 -0
- package/assets/icons/calendly.png +0 -0
- package/assets/icons/chroma.png +0 -0
- package/assets/icons/cloudflare.png +0 -0
- package/assets/icons/cohere.svg +30 -0
- package/assets/icons/databricks.png +0 -0
- package/assets/icons/daytonaio.png +0 -0
- package/assets/icons/daytonaio2.png +0 -0
- package/assets/icons/deepgram.png +0 -0
- package/assets/icons/deepl.png +0 -0
- package/assets/icons/digital-ocean.webp +0 -0
- package/assets/icons/discord.png +0 -0
- package/assets/icons/e2b-2.png +0 -0
- package/assets/icons/e2b.png +0 -0
- package/assets/icons/elevenlabs.png +0 -0
- package/assets/icons/email.png +0 -0
- package/assets/icons/exa.png +0 -0
- package/assets/icons/excel.png +0 -0
- package/assets/icons/fal.png +0 -0
- package/assets/icons/firecrawl.png +0 -0
- package/assets/icons/firecrawl2.png +0 -0
- package/assets/icons/flyio.jpeg +0 -0
- package/assets/icons/gcp.svg +1 -0
- package/assets/icons/gemini.svg +1 -0
- package/assets/icons/gmail.png +0 -0
- package/assets/icons/google-analytics.png +0 -0
- package/assets/icons/google-calender.png +0 -0
- package/assets/icons/google-docs.png +0 -0
- package/assets/icons/google-drive.png +0 -0
- package/assets/icons/google-maps.png +0 -0
- package/assets/icons/google-meet.png +0 -0
- package/assets/icons/google-sheets.png +0 -0
- package/assets/icons/google-slides.png +0 -0
- package/assets/icons/google-tasks.png +0 -0
- package/assets/icons/google.png +0 -0
- package/assets/icons/grok.png +0 -0
- package/assets/icons/hubspot.png +0 -0
- package/assets/icons/image.png +0 -0
- package/assets/icons/jina.svg +1 -0
- package/assets/icons/jira.png +0 -0
- package/assets/icons/lancedb2.png +0 -0
- package/assets/icons/linear.png +0 -0
- package/assets/icons/linux.png +0 -0
- package/assets/icons/looker.png +0 -0
- package/assets/icons/luma.png +0 -0
- package/assets/icons/mac.png +0 -0
- package/assets/icons/markdown.png +0 -0
- package/assets/icons/mcp.png +0 -0
- package/assets/icons/mcp.svg +1 -0
- package/assets/icons/messenger.svg +1 -0
- package/assets/icons/microsoft-intra.png +0 -0
- package/assets/icons/microsoft-onenote.png +0 -0
- package/assets/icons/microsoft-planner.png +0 -0
- package/assets/icons/microsoft-teams.png +0 -0
- package/assets/icons/miro.png +0 -0
- package/assets/icons/mistral.svg +469 -0
- package/assets/icons/modal.png +0 -0
- package/assets/icons/ngrok.png +0 -0
- package/assets/icons/nomic.png +0 -0
- package/assets/icons/onedrive.png +0 -0
- package/assets/icons/openai.svg +1 -0
- package/assets/icons/outlook-calendar.png +0 -0
- package/assets/icons/outlook-email.png +0 -0
- package/assets/icons/outlook.png +0 -0
- package/assets/icons/pdf.png +0 -0
- package/assets/icons/personio.png +0 -0
- package/assets/icons/pgvector2.png +0 -0
- package/assets/icons/phone.png +0 -0
- package/assets/icons/pinecone.png +0 -0
- package/assets/icons/pipedrive.png +0 -0
- package/assets/icons/power-pi.png +0 -0
- package/assets/icons/pylon.png +0 -0
- package/assets/icons/python.png +0 -0
- package/assets/icons/qdrant.svg +35 -0
- package/assets/icons/revai.png +0 -0
- package/assets/icons/revai.svg +1 -0
- package/assets/icons/sap.png +0 -0
- package/assets/icons/serpapi.svg +34 -0
- package/assets/icons/serper.png +0 -0
- package/assets/icons/servicenow.png +0 -0
- package/assets/icons/sharepoint.png +0 -0
- package/assets/icons/slack.png +0 -0
- package/assets/icons/snowflake.png +0 -0
- package/assets/icons/statistia.png +0 -0
- package/assets/icons/stripe.png +0 -0
- package/assets/icons/supabase.png +0 -0
- package/assets/icons/tableau.png +0 -0
- package/assets/icons/tavily.png +0 -0
- package/assets/icons/telegram.png +0 -0
- package/assets/icons/typescript.png +0 -0
- package/assets/icons/vercel copy.svg +1 -0
- package/assets/icons/vercel.svg +1 -0
- package/assets/icons/vertex-ai.png +0 -0
- package/assets/icons/video.png +0 -0
- package/assets/icons/voyage-light.png +0 -0
- package/assets/icons/weaviate.webp +0 -0
- package/assets/icons/webcontainers.svg +11 -0
- package/assets/icons/webhook.png +0 -0
- package/assets/icons/whatsapp copy.png +0 -0
- package/assets/icons/whatsapp.png +0 -0
- package/assets/icons/windows.png +0 -0
- package/assets/icons/word.png +0 -0
- package/assets/icons/zendesk.png +0 -0
- package/assets/icons/zoom.png +0 -0
- package/assets/notion-white.png +0 -0
- package/assets/notion.png +0 -0
- package/dist-types/asset-server.d.ts +3 -0
- package/dist-types/asset-server.d.ts.map +1 -0
- package/dist-types/components/alerts/generic-alert.d.ts +15 -0
- package/dist-types/components/alerts/generic-alert.d.ts.map +1 -0
- package/dist-types/components/chat/canvas/doc-editor-provider.d.ts +62 -0
- package/dist-types/components/chat/canvas/doc-editor-provider.d.ts.map +1 -0
- package/dist-types/components/chat/canvas/document-canvas.d.ts +7 -0
- package/dist-types/components/chat/canvas/document-canvas.d.ts.map +1 -0
- package/dist-types/components/chat/canvas/document-field.d.ts +13 -0
- package/dist-types/components/chat/canvas/document-field.d.ts.map +1 -0
- package/dist-types/components/chat/canvas/document-viewer.d.ts +2 -0
- package/dist-types/components/chat/canvas/document-viewer.d.ts.map +1 -0
- package/dist-types/components/chat/canvas/file-attachment-button.d.ts +9 -0
- package/dist-types/components/chat/canvas/file-attachment-button.d.ts.map +1 -0
- package/dist-types/components/chat/chat-workspace.d.ts +4 -0
- package/dist-types/components/chat/chat-workspace.d.ts.map +1 -0
- package/dist-types/components/chat/message-actions.d.ts +11 -0
- package/dist-types/components/chat/message-actions.d.ts.map +1 -0
- package/dist-types/components/chat/message-item.d.ts +20 -0
- package/dist-types/components/chat/message-item.d.ts.map +1 -0
- package/dist-types/components/chat/message-queue.d.ts +15 -0
- package/dist-types/components/chat/message-queue.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-chart.d.ts +6 -0
- package/dist-types/components/chat/tools/chat-chart.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-citations.d.ts +32 -0
- package/dist-types/components/chat/tools/chat-citations.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-data-table.d.ts +14 -0
- package/dist-types/components/chat/tools/chat-data-table.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-file-export.d.ts +5 -0
- package/dist-types/components/chat/tools/chat-file-export.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-media-preview.d.ts +35 -0
- package/dist-types/components/chat/tools/chat-media-preview.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-sandbox-result.d.ts +17 -0
- package/dist-types/components/chat/tools/chat-sandbox-result.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-signature-request.d.ts +13 -0
- package/dist-types/components/chat/tools/chat-signature-request.d.ts.map +1 -0
- package/dist-types/components/chat/tools/chat-tabs.d.ts +17 -0
- package/dist-types/components/chat/tools/chat-tabs.d.ts.map +1 -0
- package/dist-types/components/chat/tools/corpus-data-result.d.ts +36 -0
- package/dist-types/components/chat/tools/corpus-data-result.d.ts.map +1 -0
- package/dist-types/components/chat/tools/knowledge-base-result.d.ts +14 -0
- package/dist-types/components/chat/tools/knowledge-base-result.d.ts.map +1 -0
- package/dist-types/components/chat/tools/visual-placement-modal.d.ts +23 -0
- package/dist-types/components/chat/tools/visual-placement-modal.d.ts.map +1 -0
- package/dist-types/components/configure/custom-model-modal.d.ts +13 -0
- package/dist-types/components/configure/custom-model-modal.d.ts.map +1 -0
- package/dist-types/components/configure/store-fields.d.ts +11 -0
- package/dist-types/components/configure/store-fields.d.ts.map +1 -0
- package/dist-types/components/data/corpus-panel.d.ts +12 -0
- package/dist-types/components/data/corpus-panel.d.ts.map +1 -0
- package/dist-types/components/data/data-entry-mode-switch.d.ts +13 -0
- package/dist-types/components/data/data-entry-mode-switch.d.ts.map +1 -0
- package/dist-types/components/data/data-primary-action.d.ts +7 -0
- package/dist-types/components/data/data-primary-action.d.ts.map +1 -0
- package/dist-types/components/data/data-workspace.d.ts +6 -0
- package/dist-types/components/data/data-workspace.d.ts.map +1 -0
- package/dist-types/components/data/groups-panel.d.ts +5 -0
- package/dist-types/components/data/groups-panel.d.ts.map +1 -0
- package/dist-types/components/data/integration-resources-panel.d.ts +9 -0
- package/dist-types/components/data/integration-resources-panel.d.ts.map +1 -0
- package/dist-types/components/data/integrations-panel.d.ts +5 -0
- package/dist-types/components/data/integrations-panel.d.ts.map +1 -0
- package/dist-types/components/data/jobs-panel.d.ts +6 -0
- package/dist-types/components/data/jobs-panel.d.ts.map +1 -0
- package/dist-types/components/data/jobs-tracking-button.d.ts +2 -0
- package/dist-types/components/data/jobs-tracking-button.d.ts.map +1 -0
- package/dist-types/components/data/live-media-progress.d.ts +9 -0
- package/dist-types/components/data/live-media-progress.d.ts.map +1 -0
- package/dist-types/components/data/media-indexing-jobs-panel.d.ts +34 -0
- package/dist-types/components/data/media-indexing-jobs-panel.d.ts.map +1 -0
- package/dist-types/components/data/media-panel.d.ts +58 -0
- package/dist-types/components/data/media-panel.d.ts.map +1 -0
- package/dist-types/components/data/notion-panel.d.ts +6 -0
- package/dist-types/components/data/notion-panel.d.ts.map +1 -0
- package/dist-types/components/data/paste-panel.d.ts +7 -0
- package/dist-types/components/data/paste-panel.d.ts.map +1 -0
- package/dist-types/components/data/project-data-page.d.ts +3 -0
- package/dist-types/components/data/project-data-page.d.ts.map +1 -0
- package/dist-types/components/data/scrape-panel.d.ts +9 -0
- package/dist-types/components/data/scrape-panel.d.ts.map +1 -0
- package/dist-types/components/data/tabular-preview.d.ts +10 -0
- package/dist-types/components/data/tabular-preview.d.ts.map +1 -0
- package/dist-types/components/data/tool-indexing-dialog.d.ts +54 -0
- package/dist-types/components/data/tool-indexing-dialog.d.ts.map +1 -0
- package/dist-types/components/data/upload-panel.d.ts +7 -0
- package/dist-types/components/data/upload-panel.d.ts.map +1 -0
- package/dist-types/components/data/web-crawler-status.d.ts +3 -0
- package/dist-types/components/data/web-crawler-status.d.ts.map +1 -0
- package/dist-types/components/projects/project-form-dialog.d.ts +10 -0
- package/dist-types/components/projects/project-form-dialog.d.ts.map +1 -0
- package/dist-types/components/projects/project-provider.d.ts +34 -0
- package/dist-types/components/projects/project-provider.d.ts.map +1 -0
- package/dist-types/components/settings/general/agent-customization-section.d.ts +2 -0
- package/dist-types/components/settings/general/agent-customization-section.d.ts.map +1 -0
- package/dist-types/components/settings/general/mcp-connections-section.d.ts +2 -0
- package/dist-types/components/settings/general/mcp-connections-section.d.ts.map +1 -0
- package/dist-types/components/settings/general/model-combobox.d.ts +24 -0
- package/dist-types/components/settings/general/model-combobox.d.ts.map +1 -0
- package/dist-types/components/settings/general/models-section.d.ts +2 -0
- package/dist-types/components/settings/general/models-section.d.ts.map +1 -0
- package/dist-types/components/settings/general/sandbox-section.d.ts +7 -0
- package/dist-types/components/settings/general/sandbox-section.d.ts.map +1 -0
- package/dist-types/components/settings/general/search-scraping-section.d.ts +2 -0
- package/dist-types/components/settings/general/search-scraping-section.d.ts.map +1 -0
- package/dist-types/components/settings/general/storage-indexing-section.d.ts +2 -0
- package/dist-types/components/settings/general/storage-indexing-section.d.ts.map +1 -0
- package/dist-types/components/ui/alert-dialog.d.ts +19 -0
- package/dist-types/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist-types/components/ui/alert.d.ts +11 -0
- package/dist-types/components/ui/alert.d.ts.map +1 -0
- package/dist-types/components/ui/badge.d.ts +8 -0
- package/dist-types/components/ui/badge.d.ts.map +1 -0
- package/dist-types/components/ui/card.d.ts +2 -0
- package/dist-types/components/ui/card.d.ts.map +1 -0
- package/dist-types/components/ui/checkbox.d.ts +4 -0
- package/dist-types/components/ui/checkbox.d.ts.map +1 -0
- package/dist-types/components/ui/collapsible.d.ts +6 -0
- package/dist-types/components/ui/collapsible.d.ts.map +1 -0
- package/dist-types/components/ui/command.d.ts +20 -0
- package/dist-types/components/ui/command.d.ts.map +1 -0
- package/dist-types/components/ui/dialog.d.ts +18 -0
- package/dist-types/components/ui/dialog.d.ts.map +1 -0
- package/dist-types/components/ui/dropdown-menu.d.ts +30 -0
- package/dist-types/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist-types/components/ui/input-group.d.ts +19 -0
- package/dist-types/components/ui/input-group.d.ts.map +1 -0
- package/dist-types/components/ui/input.d.ts +4 -0
- package/dist-types/components/ui/input.d.ts.map +1 -0
- package/dist-types/components/ui/line-tabs.d.ts +15 -0
- package/dist-types/components/ui/line-tabs.d.ts.map +1 -0
- package/dist-types/components/ui/popover.d.ts +10 -0
- package/dist-types/components/ui/popover.d.ts.map +1 -0
- package/dist-types/components/ui/progress.d.ts +8 -0
- package/dist-types/components/ui/progress.d.ts.map +1 -0
- package/dist-types/components/ui/scroll-area.d.ts +6 -0
- package/dist-types/components/ui/scroll-area.d.ts.map +1 -0
- package/dist-types/components/ui/sheet.d.ts +15 -0
- package/dist-types/components/ui/sheet.d.ts.map +1 -0
- package/dist-types/components/ui/slider.d.ts +4 -0
- package/dist-types/components/ui/slider.d.ts.map +1 -0
- package/dist-types/components/ui/switch.d.ts +6 -0
- package/dist-types/components/ui/switch.d.ts.map +1 -0
- package/dist-types/components/ui/table.d.ts +2 -0
- package/dist-types/components/ui/table.d.ts.map +1 -0
- package/dist-types/components/ui/tabs.d.ts +11 -0
- package/dist-types/components/ui/tabs.d.ts.map +1 -0
- package/dist-types/components/ui/textarea.d.ts +2 -0
- package/dist-types/components/ui/textarea.d.ts.map +1 -0
- package/dist-types/components/ui/tooltip.d.ts +7 -0
- package/dist-types/components/ui/tooltip.d.ts.map +1 -0
- package/dist-types/hooks/use-copy-to-clipboard.d.ts +5 -0
- package/dist-types/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist-types/hooks/use-integration-auth.d.ts +10 -0
- package/dist-types/hooks/use-integration-auth.d.ts.map +1 -0
- package/dist-types/hooks/use-live-media-progress.d.ts +14 -0
- package/dist-types/hooks/use-live-media-progress.d.ts.map +1 -0
- package/dist-types/hooks/use-notion-auth.d.ts +9 -0
- package/dist-types/hooks/use-notion-auth.d.ts.map +1 -0
- package/dist-types/host.d.ts +20 -0
- package/dist-types/host.d.ts.map +1 -0
- package/dist-types/lib/browser-cache.d.ts +7 -0
- package/dist-types/lib/browser-cache.d.ts.map +1 -0
- package/dist-types/lib/chat/chart-config.d.ts +2 -0
- package/dist-types/lib/chat/chart-config.d.ts.map +1 -0
- package/dist-types/lib/chat/data-export.d.ts +2 -0
- package/dist-types/lib/chat/data-export.d.ts.map +1 -0
- package/dist-types/lib/chat/live-tool-progress.d.ts +44 -0
- package/dist-types/lib/chat/live-tool-progress.d.ts.map +1 -0
- package/dist-types/lib/chat/message-feedback.d.ts +2 -0
- package/dist-types/lib/chat/message-feedback.d.ts.map +1 -0
- package/dist-types/lib/chat/table-presentation.d.ts +2 -0
- package/dist-types/lib/chat/table-presentation.d.ts.map +1 -0
- package/dist-types/lib/chat/tool-output.d.ts +3 -0
- package/dist-types/lib/chat/tool-output.d.ts.map +1 -0
- package/dist-types/lib/chat-supporting-clip.d.ts +11 -0
- package/dist-types/lib/chat-supporting-clip.d.ts.map +1 -0
- package/dist-types/lib/constants/stores.d.ts +6 -0
- package/dist-types/lib/constants/stores.d.ts.map +1 -0
- package/dist-types/lib/constants/tools.d.ts +27 -0
- package/dist-types/lib/constants/tools.d.ts.map +1 -0
- package/dist-types/lib/error-formatter.d.ts +2 -0
- package/dist-types/lib/error-formatter.d.ts.map +1 -0
- package/dist-types/lib/jobs-client.d.ts +7 -0
- package/dist-types/lib/jobs-client.d.ts.map +1 -0
- package/dist-types/lib/media/pdf.d.ts +6 -0
- package/dist-types/lib/media/pdf.d.ts.map +1 -0
- package/dist-types/lib/media/progress.d.ts +61 -0
- package/dist-types/lib/media/progress.d.ts.map +1 -0
- package/dist-types/lib/media/source-selection.d.ts +10 -0
- package/dist-types/lib/media/source-selection.d.ts.map +1 -0
- package/dist-types/lib/media/tool-indexing-estimate.d.ts +13 -0
- package/dist-types/lib/media/tool-indexing-estimate.d.ts.map +1 -0
- package/dist-types/lib/media/video-intelligence-capacity.d.ts +2 -0
- package/dist-types/lib/media/video-intelligence-capacity.d.ts.map +1 -0
- package/dist-types/lib/media/video-runtime-scope.d.ts +2 -0
- package/dist-types/lib/media/video-runtime-scope.d.ts.map +1 -0
- package/dist-types/lib/shared/error-formatter.d.ts +2 -0
- package/dist-types/lib/shared/error-formatter.d.ts.map +1 -0
- package/dist-types/lib/utils.d.ts +3 -0
- package/dist-types/lib/utils.d.ts.map +1 -0
- package/dist-types/storage.d.ts +5 -0
- package/dist-types/storage.d.ts.map +1 -0
- package/dist-types/store/chat-store.d.ts +19 -0
- package/dist-types/store/chat-store.d.ts.map +1 -0
- package/dist-types/store/scrape-store.d.ts +42 -0
- package/dist-types/store/scrape-store.d.ts.map +1 -0
- package/package.json +579 -3
- package/scripts/build-assets.mjs +12 -0
- package/src/asset-data.json +1 -0
- package/src/asset-server.ts +19 -0
- package/src/components/alerts/generic-alert.tsx +76 -0
- package/src/components/chat/canvas/doc-editor-provider.tsx +338 -0
- package/src/components/chat/canvas/document-canvas.tsx +98 -0
- package/src/components/chat/canvas/document-field.tsx +167 -0
- package/src/components/chat/canvas/document-viewer.tsx +446 -0
- package/src/components/chat/canvas/file-attachment-button.tsx +88 -0
- package/src/components/chat/chat-workspace.tsx +1552 -0
- package/src/components/chat/message-actions.tsx +96 -0
- package/src/components/chat/message-item.tsx +1398 -0
- package/src/components/chat/message-queue.tsx +86 -0
- package/src/components/chat/tools/chat-chart.tsx +558 -0
- package/src/components/chat/tools/chat-citations.tsx +152 -0
- package/src/components/chat/tools/chat-data-table.tsx +373 -0
- package/src/components/chat/tools/chat-file-export.tsx +49 -0
- package/src/components/chat/tools/chat-media-preview.tsx +466 -0
- package/src/components/chat/tools/chat-sandbox-result.tsx +130 -0
- package/src/components/chat/tools/chat-signature-request.tsx +810 -0
- package/src/components/chat/tools/chat-tabs.tsx +59 -0
- package/src/components/chat/tools/corpus-data-result.tsx +194 -0
- package/src/components/chat/tools/knowledge-base-result.tsx +345 -0
- package/src/components/chat/tools/visual-placement-modal.tsx +308 -0
- package/src/components/configure/custom-model-modal.tsx +209 -0
- package/src/components/configure/store-fields.tsx +129 -0
- package/src/components/data/corpus-panel.tsx +1223 -0
- package/src/components/data/data-entry-mode-switch.tsx +53 -0
- package/src/components/data/data-primary-action.ts +6 -0
- package/src/components/data/data-workspace.tsx +623 -0
- package/src/components/data/groups-panel.tsx +530 -0
- package/src/components/data/integration-resources-panel.tsx +282 -0
- package/src/components/data/integrations-panel.tsx +392 -0
- package/src/components/data/jobs-panel.tsx +490 -0
- package/src/components/data/jobs-tracking-button.tsx +224 -0
- package/src/components/data/live-media-progress.tsx +79 -0
- package/src/components/data/media-indexing-jobs-panel.tsx +190 -0
- package/src/components/data/media-panel.tsx +2905 -0
- package/src/components/data/notion-panel.tsx +408 -0
- package/src/components/data/paste-panel.tsx +82 -0
- package/src/components/data/project-data-page.tsx +55 -0
- package/src/components/data/scrape-panel.tsx +1290 -0
- package/src/components/data/tabular-preview.tsx +205 -0
- package/src/components/data/tool-indexing-dialog.tsx +210 -0
- package/src/components/data/upload-panel.tsx +1313 -0
- package/src/components/data/web-crawler-status.tsx +132 -0
- package/src/components/projects/project-form-dialog.tsx +97 -0
- package/src/components/projects/project-provider.tsx +143 -0
- package/src/components/settings/general/agent-customization-section.tsx +620 -0
- package/src/components/settings/general/mcp-connections-section.tsx +907 -0
- package/src/components/settings/general/model-combobox.tsx +235 -0
- package/src/components/settings/general/models-section.tsx +909 -0
- package/src/components/settings/general/sandbox-section.tsx +394 -0
- package/src/components/settings/general/search-scraping-section.tsx +757 -0
- package/src/components/settings/general/storage-indexing-section.tsx +394 -0
- package/src/components/ui/alert-dialog.tsx +162 -0
- package/src/components/ui/alert.tsx +69 -0
- package/src/components/ui/badge.tsx +49 -0
- package/src/components/ui/card.tsx +9 -0
- package/src/components/ui/checkbox.tsx +28 -0
- package/src/components/ui/collapsible.tsx +17 -0
- package/src/components/ui/command.tsx +175 -0
- package/src/components/ui/dialog.tsx +138 -0
- package/src/components/ui/dropdown-menu.tsx +267 -0
- package/src/components/ui/input-group.tsx +146 -0
- package/src/components/ui/input.tsx +19 -0
- package/src/components/ui/line-tabs.tsx +49 -0
- package/src/components/ui/popover.tsx +77 -0
- package/src/components/ui/progress.tsx +66 -0
- package/src/components/ui/scroll-area.tsx +51 -0
- package/src/components/ui/sheet.tsx +125 -0
- package/src/components/ui/slider.tsx +52 -0
- package/src/components/ui/switch.tsx +32 -0
- package/src/components/ui/table.tsx +10 -0
- package/src/components/ui/tabs.tsx +77 -0
- package/src/components/ui/textarea.tsx +1 -0
- package/src/components/ui/tooltip.tsx +54 -0
- package/src/hooks/use-copy-to-clipboard.ts +25 -0
- package/src/hooks/use-integration-auth.ts +39 -0
- package/src/hooks/use-live-media-progress.ts +71 -0
- package/src/hooks/use-notion-auth.ts +66 -0
- package/src/host.ts +55 -0
- package/src/lib/browser-cache.ts +17 -0
- package/src/lib/chat/chart-config.ts +1 -0
- package/src/lib/chat/data-export.ts +1 -0
- package/src/lib/chat/live-tool-progress.ts +69 -0
- package/src/lib/chat/message-feedback.ts +1 -0
- package/src/lib/chat/table-presentation.ts +1 -0
- package/src/lib/chat/tool-output.ts +14 -0
- package/src/lib/chat-supporting-clip.ts +16 -0
- package/src/lib/constants/stores.ts +12 -0
- package/src/lib/constants/tools.ts +178 -0
- package/src/lib/error-formatter.ts +30 -0
- package/src/lib/jobs-client.ts +27 -0
- package/src/lib/media/pdf.ts +57 -0
- package/src/lib/media/progress.ts +209 -0
- package/src/lib/media/source-selection.ts +47 -0
- package/src/lib/media/tool-indexing-estimate.ts +39 -0
- package/src/lib/media/video-intelligence-capacity.ts +1 -0
- package/src/lib/media/video-runtime-scope.ts +1 -0
- package/src/lib/shared/error-formatter.ts +1 -0
- package/src/lib/utils.ts +6 -0
- package/src/source.css +1 -0
- package/src/storage.ts +16 -0
- package/src/store/chat-store.ts +19 -0
- package/src/store/scrape-store.ts +76 -0
- package/src/styles.d.ts +1 -0
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { workspaceUrl, workspaceFetch as fetch } from '../../host';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { toast } from 'sonner';
|
|
6
|
+
import {
|
|
7
|
+
CheckCircle2,
|
|
8
|
+
CircleDashed,
|
|
9
|
+
Loader2,
|
|
10
|
+
Octagon,
|
|
11
|
+
TriangleAlert,
|
|
12
|
+
Trash2,
|
|
13
|
+
ChevronLeft,
|
|
14
|
+
ChevronRight,
|
|
15
|
+
AlertTriangle,
|
|
16
|
+
Copy,
|
|
17
|
+
Square,
|
|
18
|
+
Briefcase,
|
|
19
|
+
} from 'lucide-react';
|
|
20
|
+
import type { CrawlJob, CrawlJobStatus } from '@larkup/core/types';
|
|
21
|
+
import { Badge } from '../ui/badge';
|
|
22
|
+
import { Button } from '@larkup/workspace-ui/button';
|
|
23
|
+
import { Checkbox } from '../ui/checkbox';
|
|
24
|
+
import {
|
|
25
|
+
Dialog,
|
|
26
|
+
DialogContent,
|
|
27
|
+
DialogDescription,
|
|
28
|
+
DialogFooter,
|
|
29
|
+
DialogHeader,
|
|
30
|
+
DialogTitle,
|
|
31
|
+
} from '../ui/dialog';
|
|
32
|
+
import { cn } from '../../lib/utils';
|
|
33
|
+
|
|
34
|
+
const PAGE_SIZE = 8;
|
|
35
|
+
|
|
36
|
+
const STATUS: Record<
|
|
37
|
+
CrawlJobStatus,
|
|
38
|
+
{
|
|
39
|
+
label: string;
|
|
40
|
+
icon: typeof Loader2;
|
|
41
|
+
className: string;
|
|
42
|
+
badgeVariant: string;
|
|
43
|
+
}
|
|
44
|
+
> = {
|
|
45
|
+
queued: {
|
|
46
|
+
label: 'Queued',
|
|
47
|
+
icon: CircleDashed,
|
|
48
|
+
className: 'text-orange-500 border-orange-500/30 bg-orange-500/10',
|
|
49
|
+
badgeVariant: 'outline',
|
|
50
|
+
},
|
|
51
|
+
running: {
|
|
52
|
+
label: 'Running',
|
|
53
|
+
icon: Loader2,
|
|
54
|
+
className: 'text-orange-500 border-orange-500/30 bg-orange-500/10',
|
|
55
|
+
badgeVariant: 'outline',
|
|
56
|
+
},
|
|
57
|
+
completed: {
|
|
58
|
+
label: 'Completed',
|
|
59
|
+
icon: CheckCircle2,
|
|
60
|
+
className: 'text-green-600 border-green-600/50 bg-green-600/10',
|
|
61
|
+
badgeVariant: 'outline',
|
|
62
|
+
},
|
|
63
|
+
failed: {
|
|
64
|
+
label: 'Failed',
|
|
65
|
+
icon: TriangleAlert,
|
|
66
|
+
className: 'text-destructive border-destructive/30 bg-destructive/10',
|
|
67
|
+
badgeVariant: 'outline',
|
|
68
|
+
},
|
|
69
|
+
cancelled: {
|
|
70
|
+
label: 'Cancelled',
|
|
71
|
+
icon: Octagon,
|
|
72
|
+
className: 'text-muted-foreground border-muted-foreground/30 bg-muted/30',
|
|
73
|
+
badgeVariant: 'outline',
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
function progressFor(job: CrawlJob): number {
|
|
78
|
+
const domainTargets = job.targets.filter((t) => t.scope === 'domain').length;
|
|
79
|
+
const denom = domainTargets > 0 ? domainTargets * job.pageLimit : job.targets.length;
|
|
80
|
+
if (denom === 0) return 0;
|
|
81
|
+
if (job.status === 'completed') return 100;
|
|
82
|
+
return Math.min(99, Math.round((job.pagesCrawled / denom) * 100));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function JobsPanel({ jobs, onChanged }: { jobs: CrawlJob[]; onChanged: () => void }) {
|
|
86
|
+
const [page, setPage] = useState(0);
|
|
87
|
+
const [selected, setSelected] = useState<Set<string>>(new Set());
|
|
88
|
+
const [confirmDelete, setConfirmDelete] = useState<{
|
|
89
|
+
ids: string[];
|
|
90
|
+
label: string;
|
|
91
|
+
} | null>(null);
|
|
92
|
+
const [deleting, setDeleting] = useState(false);
|
|
93
|
+
|
|
94
|
+
const [confirmCancel, setConfirmCancel] = useState<{
|
|
95
|
+
id: string;
|
|
96
|
+
label: string;
|
|
97
|
+
} | null>(null);
|
|
98
|
+
const [cancelling, setCancelling] = useState(false);
|
|
99
|
+
|
|
100
|
+
const totalPages = Math.max(1, Math.ceil(jobs.length / PAGE_SIZE));
|
|
101
|
+
const safePage = Math.min(page, totalPages - 1);
|
|
102
|
+
const pageJobs = jobs.slice(safePage * PAGE_SIZE, (safePage + 1) * PAGE_SIZE);
|
|
103
|
+
|
|
104
|
+
const allPageSelected = pageJobs.length > 0 && pageJobs.every((j) => selected.has(j.id));
|
|
105
|
+
const somePageSelected = pageJobs.some((j) => selected.has(j.id));
|
|
106
|
+
|
|
107
|
+
function toggleAll() {
|
|
108
|
+
const next = new Set(selected);
|
|
109
|
+
if (allPageSelected) {
|
|
110
|
+
pageJobs.forEach((j) => next.delete(j.id));
|
|
111
|
+
} else {
|
|
112
|
+
pageJobs.forEach((j) => next.add(j.id));
|
|
113
|
+
}
|
|
114
|
+
setSelected(next);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function toggleOne(id: string) {
|
|
118
|
+
const next = new Set(selected);
|
|
119
|
+
next.has(id) ? next.delete(id) : next.add(id);
|
|
120
|
+
setSelected(next);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async function copyFailedUrls(urls: string) {
|
|
124
|
+
try {
|
|
125
|
+
if (navigator.clipboard?.writeText) {
|
|
126
|
+
await navigator.clipboard.writeText(urls);
|
|
127
|
+
} else {
|
|
128
|
+
const textarea = document.createElement('textarea');
|
|
129
|
+
textarea.value = urls;
|
|
130
|
+
textarea.style.position = 'fixed';
|
|
131
|
+
textarea.style.opacity = '0';
|
|
132
|
+
document.body.appendChild(textarea);
|
|
133
|
+
textarea.select();
|
|
134
|
+
const copied = document.execCommand('copy');
|
|
135
|
+
textarea.remove();
|
|
136
|
+
if (!copied) throw new Error('The browser denied clipboard access.');
|
|
137
|
+
}
|
|
138
|
+
toast.success('Copied failed URLs to clipboard');
|
|
139
|
+
} catch {
|
|
140
|
+
toast.error('Could not copy URLs. Select them manually and try again.');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
async function executeCancel(id: string) {
|
|
145
|
+
setCancelling(true);
|
|
146
|
+
try {
|
|
147
|
+
await fetch(workspaceUrl(`/api/jobs/${id}`), { method: 'DELETE' });
|
|
148
|
+
toast.message('Job cancelled');
|
|
149
|
+
onChanged();
|
|
150
|
+
} finally {
|
|
151
|
+
setCancelling(false);
|
|
152
|
+
setConfirmCancel(null);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function requestCancel(id: string) {
|
|
157
|
+
const label = `"${jobs.find((j) => j.id === id)?.keywords ?? id}"`;
|
|
158
|
+
setConfirmCancel({ id, label });
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
async function executeDelete(ids: string[]) {
|
|
162
|
+
setDeleting(true);
|
|
163
|
+
try {
|
|
164
|
+
await Promise.all(
|
|
165
|
+
ids.map((id) => fetch(workspaceUrl(`/api/jobs/${id}?remove=1`), { method: 'DELETE' })),
|
|
166
|
+
);
|
|
167
|
+
setSelected((prev) => {
|
|
168
|
+
const next = new Set(prev);
|
|
169
|
+
ids.forEach((id) => next.delete(id));
|
|
170
|
+
return next;
|
|
171
|
+
});
|
|
172
|
+
toast.success(ids.length === 1 ? 'Job removed' : `${ids.length} jobs removed`);
|
|
173
|
+
onChanged();
|
|
174
|
+
} finally {
|
|
175
|
+
setDeleting(false);
|
|
176
|
+
setConfirmDelete(null);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function requestDelete(ids: string[]) {
|
|
181
|
+
const label =
|
|
182
|
+
ids.length === 1
|
|
183
|
+
? `"${jobs.find((j) => j.id === ids[0])?.keywords ?? ids[0]}"`
|
|
184
|
+
: `${ids.length} selected jobs`;
|
|
185
|
+
setConfirmDelete({ ids, label });
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (jobs.length === 0) {
|
|
189
|
+
return (
|
|
190
|
+
<div className="flex flex-col items-center justify-center rounded-lg py-10 text-center">
|
|
191
|
+
<div className="bg-background p-1 mb-2 border border-border rounded-md">
|
|
192
|
+
<Briefcase className="size-5" />
|
|
193
|
+
</div>
|
|
194
|
+
<p className="text-sm text-muted-foreground">No current running jobs yet.</p>
|
|
195
|
+
<p className="mt-1 text-xs text-muted-foreground/60">
|
|
196
|
+
Start a web scrape to see its progress here. Cron tasks are coming soon.
|
|
197
|
+
</p>
|
|
198
|
+
</div>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const selectedArray = Array.from(selected);
|
|
203
|
+
const removableSelected = selectedArray.filter((id) => {
|
|
204
|
+
const j = jobs.find((j) => j.id === id);
|
|
205
|
+
return j && j.status !== 'running' && j.status !== 'queued';
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<>
|
|
210
|
+
{/* Bulk action bar */}
|
|
211
|
+
{selected.size > 0 && (
|
|
212
|
+
<div className="mb-2 flex items-center justify-between rounded-md bg-muted/40 px-3 py-1.5">
|
|
213
|
+
<span className="text-xs text-muted-foreground">{selected.size} selected</span>
|
|
214
|
+
<Button
|
|
215
|
+
size="sm"
|
|
216
|
+
variant="ghost"
|
|
217
|
+
className="h-6 gap-1.5 text-xs text-destructive hover:text-destructive"
|
|
218
|
+
disabled={removableSelected.length === 0}
|
|
219
|
+
onClick={() => requestDelete(removableSelected)}
|
|
220
|
+
>
|
|
221
|
+
<Trash2 className="size-3" />
|
|
222
|
+
Delete ({removableSelected.length})
|
|
223
|
+
</Button>
|
|
224
|
+
</div>
|
|
225
|
+
)}
|
|
226
|
+
|
|
227
|
+
{/* Table */}
|
|
228
|
+
<div className="w-full overflow-auto">
|
|
229
|
+
<table className="w-full text-xs">
|
|
230
|
+
<thead>
|
|
231
|
+
<tr className="border-b border-border">
|
|
232
|
+
<th className="pb-2 pl-1 pr-2 text-left">
|
|
233
|
+
<Checkbox
|
|
234
|
+
checked={allPageSelected}
|
|
235
|
+
onCheckedChange={toggleAll}
|
|
236
|
+
aria-label="Select all on page"
|
|
237
|
+
className="size-3.5"
|
|
238
|
+
/>
|
|
239
|
+
</th>
|
|
240
|
+
<th className="pb-2 pr-3 text-left font-medium text-muted-foreground">
|
|
241
|
+
Title / Keywords
|
|
242
|
+
</th>
|
|
243
|
+
<th className="pb-2 pr-3 text-right font-medium text-muted-foreground whitespace-nowrap">
|
|
244
|
+
Pages
|
|
245
|
+
</th>
|
|
246
|
+
<th className="pb-2 pr-3 text-left font-medium text-muted-foreground">Status</th>
|
|
247
|
+
<th className="pb-2 text-right font-medium text-muted-foreground" />
|
|
248
|
+
</tr>
|
|
249
|
+
</thead>
|
|
250
|
+
<tbody>
|
|
251
|
+
{pageJobs.map((job) => {
|
|
252
|
+
const s = STATUS[job.status];
|
|
253
|
+
const Icon = s.icon;
|
|
254
|
+
const active = job.status === 'running' || job.status === 'queued';
|
|
255
|
+
const pct = progressFor(job);
|
|
256
|
+
|
|
257
|
+
const domainTargets = job.targets.filter((t) => t.scope === 'domain').length;
|
|
258
|
+
const denom = domainTargets > 0 ? domainTargets * job.pageLimit : job.targets.length;
|
|
259
|
+
const pagesLabel = active
|
|
260
|
+
? `${job.pagesCrawled} / ${denom}`
|
|
261
|
+
: `${job.pagesCrawled} page${job.pagesCrawled === 1 ? '' : 's'} collected`;
|
|
262
|
+
|
|
263
|
+
return (
|
|
264
|
+
<tr
|
|
265
|
+
key={job.id}
|
|
266
|
+
className={cn(
|
|
267
|
+
'border-b border-border/50 transition-colors last:border-0',
|
|
268
|
+
selected.has(job.id) && 'bg-muted/30',
|
|
269
|
+
)}
|
|
270
|
+
>
|
|
271
|
+
{/* Checkbox */}
|
|
272
|
+
<td className="py-2 pl-1 pr-2">
|
|
273
|
+
<Checkbox
|
|
274
|
+
checked={selected.has(job.id)}
|
|
275
|
+
onCheckedChange={() => toggleOne(job.id)}
|
|
276
|
+
aria-label={`Select job ${job.keywords}`}
|
|
277
|
+
className="size-3.5"
|
|
278
|
+
/>
|
|
279
|
+
</td>
|
|
280
|
+
|
|
281
|
+
{/* Title */}
|
|
282
|
+
<td className="py-2 pr-3 max-w-36">
|
|
283
|
+
<p className="truncate font-medium text-foreground leading-tight">
|
|
284
|
+
{job.keywords}
|
|
285
|
+
</p>
|
|
286
|
+
<p className="text-muted-foreground/70 text-[10px]">
|
|
287
|
+
{job.targets.length} target
|
|
288
|
+
{job.targets.length === 1 ? '' : 's'}
|
|
289
|
+
</p>
|
|
290
|
+
</td>
|
|
291
|
+
|
|
292
|
+
{/* Pages crawled + progress */}
|
|
293
|
+
<td className="py-2 pr-3 text-right tabular-nums">
|
|
294
|
+
<span className="text-green-700">{pagesLabel}</span>
|
|
295
|
+
{active && (
|
|
296
|
+
<div className="mt-1 h-0.5 w-full rounded-full bg-muted overflow-hidden">
|
|
297
|
+
<div
|
|
298
|
+
className="h-full rounded-full bg-green-600 transition-all"
|
|
299
|
+
style={{ width: `${pct}%` }}
|
|
300
|
+
/>
|
|
301
|
+
</div>
|
|
302
|
+
)}
|
|
303
|
+
</td>
|
|
304
|
+
|
|
305
|
+
{/* Status badge */}
|
|
306
|
+
<td className="py-2 pr-3 align-top">
|
|
307
|
+
<div className="flex flex-col gap-1 items-start">
|
|
308
|
+
<Badge
|
|
309
|
+
variant="outline"
|
|
310
|
+
className={cn(
|
|
311
|
+
s.className,
|
|
312
|
+
'gap-1 px-1.5 py-0.5 font-mono text-[10px] whitespace-nowrap',
|
|
313
|
+
)}
|
|
314
|
+
>
|
|
315
|
+
<Icon
|
|
316
|
+
className={cn(
|
|
317
|
+
'size-2.5 shrink-0',
|
|
318
|
+
job.status === 'running' && 'animate-spin',
|
|
319
|
+
)}
|
|
320
|
+
/>
|
|
321
|
+
{s.label}
|
|
322
|
+
</Badge>
|
|
323
|
+
{job.status === 'failed' && (
|
|
324
|
+
<span
|
|
325
|
+
className="text-[10px] text-destructive max-w-35 truncate"
|
|
326
|
+
title={
|
|
327
|
+
job.error || job.targets.find((t) => t.error)?.error || 'Unknown error'
|
|
328
|
+
}
|
|
329
|
+
>
|
|
330
|
+
{job.error || job.targets.find((t) => t.error)?.error || 'Unknown error'}
|
|
331
|
+
</span>
|
|
332
|
+
)}
|
|
333
|
+
</div>
|
|
334
|
+
</td>
|
|
335
|
+
|
|
336
|
+
{/* Action */}
|
|
337
|
+
<td className="py-2 text-right">
|
|
338
|
+
<div className="flex items-center justify-end gap-1">
|
|
339
|
+
{job.targets.some((t) => t.status === 'failed') && (
|
|
340
|
+
<button
|
|
341
|
+
onClick={() => {
|
|
342
|
+
const failedUrls = job.targets
|
|
343
|
+
.filter((t) => t.status === 'failed')
|
|
344
|
+
.map((t) => t.url)
|
|
345
|
+
.join('\n');
|
|
346
|
+
void copyFailedUrls(failedUrls);
|
|
347
|
+
}}
|
|
348
|
+
className="rounded p-1 text-muted-foreground hover:text-foreground transition-colors"
|
|
349
|
+
title="Copy failed URLs"
|
|
350
|
+
>
|
|
351
|
+
<Copy className="size-3" />
|
|
352
|
+
</button>
|
|
353
|
+
)}
|
|
354
|
+
{active ? (
|
|
355
|
+
<button
|
|
356
|
+
onClick={() => requestCancel(job.id)}
|
|
357
|
+
className="cursor-pointer rounded-xl p-1 text-muted-foreground hover:text-foreground transition-colors"
|
|
358
|
+
title="Cancel job"
|
|
359
|
+
>
|
|
360
|
+
<Square className="size-3.5 text-orange-400" />
|
|
361
|
+
</button>
|
|
362
|
+
) : (
|
|
363
|
+
<button
|
|
364
|
+
onClick={() => requestDelete([job.id])}
|
|
365
|
+
className="rounded p-1 text-muted-foreground hover:text-destructive transition-colors"
|
|
366
|
+
title="Remove job"
|
|
367
|
+
>
|
|
368
|
+
<Trash2 className="size-3" />
|
|
369
|
+
</button>
|
|
370
|
+
)}
|
|
371
|
+
</div>
|
|
372
|
+
</td>
|
|
373
|
+
</tr>
|
|
374
|
+
);
|
|
375
|
+
})}
|
|
376
|
+
</tbody>
|
|
377
|
+
</table>
|
|
378
|
+
</div>
|
|
379
|
+
|
|
380
|
+
{/* Pagination */}
|
|
381
|
+
{totalPages > 1 && (
|
|
382
|
+
<div className="mt-3 flex items-center justify-between text-xs text-muted-foreground">
|
|
383
|
+
<span>
|
|
384
|
+
{safePage * PAGE_SIZE + 1}–{Math.min((safePage + 1) * PAGE_SIZE, jobs.length)} of{' '}
|
|
385
|
+
{jobs.length}
|
|
386
|
+
</span>
|
|
387
|
+
<div className="flex items-center gap-1">
|
|
388
|
+
<button
|
|
389
|
+
disabled={safePage === 0}
|
|
390
|
+
onClick={() => setPage((p) => Math.max(0, p - 1))}
|
|
391
|
+
className="rounded p-1 hover:bg-muted disabled:opacity-40 transition-colors"
|
|
392
|
+
>
|
|
393
|
+
<ChevronLeft className="size-3.5" />
|
|
394
|
+
</button>
|
|
395
|
+
<span className="tabular-nums">
|
|
396
|
+
{safePage + 1} / {totalPages}
|
|
397
|
+
</span>
|
|
398
|
+
<button
|
|
399
|
+
disabled={safePage >= totalPages - 1}
|
|
400
|
+
onClick={() => setPage((p) => Math.min(totalPages - 1, p + 1))}
|
|
401
|
+
className="rounded p-1 hover:bg-muted disabled:opacity-40 transition-colors"
|
|
402
|
+
>
|
|
403
|
+
<ChevronRight className="size-3.5" />
|
|
404
|
+
</button>
|
|
405
|
+
</div>
|
|
406
|
+
</div>
|
|
407
|
+
)}
|
|
408
|
+
|
|
409
|
+
{/* Confirm delete dialog */}
|
|
410
|
+
<Dialog open={!!confirmDelete} onOpenChange={(open) => !open && setConfirmDelete(null)}>
|
|
411
|
+
<DialogContent className="max-w-sm">
|
|
412
|
+
<DialogHeader>
|
|
413
|
+
<DialogTitle className="flex items-center gap-2">
|
|
414
|
+
<AlertTriangle className="size-4 text-destructive" />
|
|
415
|
+
Confirm deletion
|
|
416
|
+
</DialogTitle>
|
|
417
|
+
<DialogDescription>
|
|
418
|
+
Are you sure you want to remove{' '}
|
|
419
|
+
<span className="font-medium text-foreground">{confirmDelete?.label}</span>? This
|
|
420
|
+
action cannot be undone.
|
|
421
|
+
</DialogDescription>
|
|
422
|
+
</DialogHeader>
|
|
423
|
+
<DialogFooter className="gap-2 sm:gap-0">
|
|
424
|
+
<Button
|
|
425
|
+
variant="outline"
|
|
426
|
+
size="sm"
|
|
427
|
+
onClick={() => setConfirmDelete(null)}
|
|
428
|
+
disabled={deleting}
|
|
429
|
+
>
|
|
430
|
+
Cancel
|
|
431
|
+
</Button>
|
|
432
|
+
<Button
|
|
433
|
+
variant="destructive"
|
|
434
|
+
size="sm"
|
|
435
|
+
disabled={deleting}
|
|
436
|
+
onClick={() => confirmDelete && executeDelete(confirmDelete.ids)}
|
|
437
|
+
>
|
|
438
|
+
{deleting ? (
|
|
439
|
+
<Loader2 className="size-3 animate-spin" />
|
|
440
|
+
) : (
|
|
441
|
+
<Trash2 className="size-3" />
|
|
442
|
+
)}
|
|
443
|
+
Delete
|
|
444
|
+
</Button>
|
|
445
|
+
</DialogFooter>
|
|
446
|
+
</DialogContent>
|
|
447
|
+
</Dialog>
|
|
448
|
+
|
|
449
|
+
{/* Confirm cancel dialog */}
|
|
450
|
+
<Dialog open={!!confirmCancel} onOpenChange={(open) => !open && setConfirmCancel(null)}>
|
|
451
|
+
<DialogContent className="max-w-lg">
|
|
452
|
+
<DialogHeader>
|
|
453
|
+
<DialogTitle className="flex items-center gap-2">
|
|
454
|
+
<AlertTriangle className="size-4 text-orange-500" />
|
|
455
|
+
Confirm cancellation
|
|
456
|
+
</DialogTitle>
|
|
457
|
+
<DialogDescription>
|
|
458
|
+
Are you sure you want to cancel the job{' '}
|
|
459
|
+
<span className="font-medium text-foreground">{confirmCancel?.label}</span>?
|
|
460
|
+
In-progress pages will be discarded.
|
|
461
|
+
</DialogDescription>
|
|
462
|
+
</DialogHeader>
|
|
463
|
+
<DialogFooter className="gap-2">
|
|
464
|
+
<Button
|
|
465
|
+
variant="outline"
|
|
466
|
+
size="sm"
|
|
467
|
+
onClick={() => setConfirmCancel(null)}
|
|
468
|
+
disabled={cancelling}
|
|
469
|
+
>
|
|
470
|
+
Go Back
|
|
471
|
+
</Button>
|
|
472
|
+
<Button
|
|
473
|
+
variant="default"
|
|
474
|
+
size="sm"
|
|
475
|
+
disabled={cancelling}
|
|
476
|
+
onClick={() => confirmCancel && executeCancel(confirmCancel.id)}
|
|
477
|
+
>
|
|
478
|
+
{cancelling ? (
|
|
479
|
+
<Loader2 className="size-3 animate-spin" />
|
|
480
|
+
) : (
|
|
481
|
+
<Octagon className="size-3" />
|
|
482
|
+
)}
|
|
483
|
+
Cancel Job
|
|
484
|
+
</Button>
|
|
485
|
+
</DialogFooter>
|
|
486
|
+
</DialogContent>
|
|
487
|
+
</Dialog>
|
|
488
|
+
</>
|
|
489
|
+
);
|
|
490
|
+
}
|