@allbluecn/web-app 0.12.0 → 0.12.2
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/package.json +85 -45
- package/public/devframe-docks/ai-chat-iframe.html +17 -0
- package/public/devframe-docks/session-iframe.html +17 -0
- package/public/fonts/Trap-font/Trap-Black.otf +0 -0
- package/public/fonts/Trap-font/Trap-Bold.otf +0 -0
- package/public/fonts/Trap-font/Trap-ExtraBold.otf +0 -0
- package/public/fonts/Trap-font/Trap-Light.otf +0 -0
- package/public/fonts/Trap-font/Trap-Medium.otf +0 -0
- package/public/fonts/Trap-font/Trap-Regular.otf +0 -0
- package/public/fonts/Trap-font/Trap-SemiBold.otf +0 -0
- package/public/fonts/buttersans-Rounded.otf +0 -0
- package/public/fonts/fonts.css +67 -0
- package/public/logo/allblue-logo-bold-dark.svg +11 -0
- package/public/logo/allblue-logo-bold-light.svg +11 -0
- package/public/logo/allblue-logo-dark.svg +13 -4
- package/public/logo/allblue-logo-light.svg +13 -4
- package/public/logo/allblue-logo-text-dark.svg +22 -0
- package/public/logo/allblue-logo-text-light.svg +22 -0
- package/public/logo/allblue-text-dark.svg +17 -0
- package/public/logo/allblue-text-light.svg +17 -0
- package/src/__tests__/security/ai/agui-body-validation.test.ts +96 -0
- package/src/__tests__/security/ai/destructive-tool-approval.test.ts +107 -0
- package/src/__tests__/security/ai/prompt-injection.test.ts +30 -17
- package/src/__tests__/security/ai/sandbox-network.test.ts +83 -0
- package/src/__tests__/security/ai/sandbox-snapshots.test.ts +92 -0
- package/src/__tests__/security/ai/sandbox-tool-bridge.test.ts +108 -0
- package/src/__tests__/security/ai/search-injection.test.ts +76 -0
- package/src/__tests__/security/ai/session-id-idor.test.ts +85 -0
- package/src/__tests__/setup.ts +16 -0
- package/src/components/agents/agent-bindings-tab.tsx +174 -0
- package/src/components/agents/agent-card.tsx +3 -7
- package/src/components/agents/agent-form-dialog.tsx +35 -13
- package/src/components/agents/agent-selector.tsx +1 -1
- package/src/components/agents/agents-page.tsx +33 -4
- package/src/components/agents/schemas/agent-form.ts +1 -1
- package/src/components/agents/skill-form-dialog.tsx +1 -1
- package/src/components/agents/slash-skill-menu.tsx +23 -16
- package/src/components/agents/use-agent-handlers.ts +1 -1
- package/src/components/ai/__tests__/ai-prompt-input-attach.test.tsx +115 -0
- package/src/components/ai/__tests__/global-sidebar.test.tsx +115 -0
- package/src/components/ai/__tests__/prompt-input-actions.test.tsx +72 -0
- package/src/components/ai/ai-chat-prompt.tsx +53 -21
- package/src/components/{chat → ai}/ai-prompt-input/components/action-buttons.tsx +80 -42
- package/src/components/{chat → ai}/ai-prompt-input/components/agent-mode-select.tsx +1 -1
- package/src/components/{chat → ai}/ai-prompt-input/components/kb-context-selector.tsx +3 -7
- package/src/components/{chat → ai}/ai-prompt-input/components/model-select.tsx +1 -1
- package/src/components/{chat → ai}/ai-prompt-input/components/page-user-context-selector.tsx +3 -7
- package/src/components/ai/ai-prompt-input/image-filter.ts +22 -0
- package/src/components/{chat → ai}/ai-prompt-input/index.tsx +203 -26
- package/src/components/ai/global-harness-sidebar.tsx +385 -0
- package/src/components/ai/tool-cards/-shared.tsx +150 -0
- package/src/components/ai/tool-cards/fallback-tool-card.tsx +144 -0
- package/src/components/{chat/ai-message/types.ts → ai/tool-cards/index.ts} +3 -8
- package/src/components/ai/tool-cards/knowledge-search-card.tsx +184 -0
- package/src/components/ai/tool-cards/web-search-card.tsx +177 -0
- package/src/components/ai/tool-parts/tool-call-part.tsx +95 -0
- package/src/components/ai/tool-parts/tool-result-part.tsx +95 -0
- package/src/components/ai/turn-folded-bar.tsx +75 -0
- package/src/components/anyhub/anyhub-app-card.tsx +3 -5
- package/src/components/anyhub/anyhub-install-dialog.tsx +1 -1
- package/src/components/anyhub/anyhub-marketplace-view.tsx +1 -1
- package/src/components/anyhub/anyhub-permission-panel.tsx +1 -1
- package/src/components/anyhub/anyhub-top-nav.tsx +9 -21
- package/src/components/billing/__tests__/seats-manager.test.tsx +1 -1
- package/src/components/billing/__tests__/use-resource.test.tsx +3 -0
- package/src/components/billing/checkout-redirect.ts +1 -1
- package/src/components/billing/login-prompt-dialog.tsx +1 -1
- package/src/components/billing/seats-manager.tsx +2 -4
- package/src/components/billing/subscription-provider.tsx +3 -0
- package/src/components/changelog/changelog-page.tsx +21 -8
- package/src/components/error/global-error-boundary.tsx +2 -4
- package/src/components/forms/app-combobox.tsx +2 -6
- package/src/components/forms/app-date-picker.tsx +2 -6
- package/src/components/forms/hooks/use-form-submit.ts +1 -1
- package/src/components/harness/__tests__/attachment-policy.test.ts +34 -0
- package/src/components/harness/__tests__/composer-prefill.test.ts +114 -0
- package/src/components/harness/__tests__/composer-send.test.tsx +53 -0
- package/src/components/harness/__tests__/dock-registry.test.ts +21 -0
- package/src/components/harness/__tests__/fuzzy.test.ts +17 -0
- package/src/components/harness/__tests__/gallery-behavior.test.tsx +171 -0
- package/src/components/harness/__tests__/harness-workbench-mount.test.ts +47 -0
- package/src/components/harness/__tests__/media-route.test.tsx +52 -0
- package/src/components/harness/__tests__/mention-resolvers.test.ts +41 -0
- package/src/components/harness/__tests__/message-actions.test.tsx +199 -0
- package/src/components/harness/__tests__/resource-uri.test.ts +53 -0
- package/src/components/harness/__tests__/submit-machine.test.ts +61 -0
- package/src/components/harness/__tests__/turn-group.test.ts +124 -0
- package/src/components/harness/__tests__/use-track-columns.test.ts +27 -0
- package/src/components/harness/agent-preset-picker.tsx +104 -0
- package/src/components/{chat → harness}/ai-chat-history/components/conversation-group.tsx +3 -0
- package/src/components/{chat → harness}/ai-chat-history/components/conversation-item.tsx +21 -7
- package/src/components/{chat → harness}/ai-chat-history/index.tsx +2 -0
- package/src/components/{chat → harness}/ai-chat-history/types.ts +2 -0
- package/src/components/harness/chat-ui.tsx +192 -0
- package/src/components/harness/code/changeset-panel.tsx +112 -0
- package/src/components/harness/code/code-workspace-sidebar.tsx +138 -0
- package/src/components/harness/code/file-tree.tsx +241 -0
- package/src/components/harness/code/preview-panel.tsx +169 -0
- package/src/components/harness/code/terminal-panel.tsx +90 -0
- package/src/components/harness/code/workspace-context.tsx +50 -0
- package/src/components/harness/code/workspace-picker.tsx +229 -0
- package/src/components/harness/composer/attachments/attachment-policy.ts +17 -0
- package/src/components/harness/composer/attachments/attachment-tray.tsx +72 -0
- package/src/components/harness/composer/attachments/use-attachments.ts +108 -0
- package/src/components/harness/composer/composer-editor.tsx +136 -0
- package/src/components/harness/composer/context-meter.tsx +106 -0
- package/src/components/harness/composer/fuzzy.ts +21 -0
- package/src/components/harness/composer/harness-composer.tsx +385 -0
- package/src/components/harness/composer/mention/mention-resolvers.ts +35 -0
- package/src/components/harness/composer/mention/mention-suggestion-menu.tsx +202 -0
- package/src/components/harness/composer/mention/use-mention-sources.ts +43 -0
- package/src/components/harness/composer/model-select.tsx +76 -0
- package/src/components/harness/composer/submit-machine.ts +38 -0
- package/src/components/harness/composer/use-composer-submit.ts +81 -0
- package/src/components/harness/composer/use-drafts.ts +25 -0
- package/src/components/harness/dock/dock-panel-container.tsx +110 -0
- package/src/components/harness/dock/dock-registry.ts +58 -0
- package/src/components/harness/dock/resource-preview.tsx +274 -0
- package/src/components/harness/dock/resource-uri.ts +44 -0
- package/src/components/harness/gallery/gallery-card.tsx +63 -0
- package/src/components/harness/gallery/gallery-grid.tsx +169 -0
- package/src/components/harness/gallery/gallery-types.ts +40 -0
- package/src/components/harness/gallery/lightbox-viewer.tsx +73 -0
- package/src/components/harness/gallery/types.ts +51 -0
- package/src/components/{devtools/index.ts → harness/harness-chat-contexts.ts} +5 -3
- package/src/components/harness/harness-chat-slots.ts +256 -0
- package/src/components/harness/harness-layout.tsx +258 -0
- package/src/components/harness/harness-message.tsx +207 -0
- package/src/components/harness/harness-workbench-mount.ts +30 -0
- package/src/components/harness/harness-workbench-page.tsx +467 -0
- package/src/components/harness/image-lightbox.tsx +51 -0
- package/src/components/harness/interrupt-approval.tsx +179 -0
- package/src/components/{chat/ai-message/components → harness}/message-actions.tsx +4 -8
- package/src/components/harness/plan-approval-card.tsx +101 -0
- package/src/components/harness/plugin-define-approval.tsx +125 -0
- package/src/components/harness/plugin-mention-menu.tsx +126 -0
- package/src/components/harness/plugin-panel.tsx +205 -0
- package/src/components/harness/queue-bar.tsx +78 -0
- package/src/components/harness/queue-item.tsx +69 -0
- package/src/components/harness/sandbox-file-change-card.tsx +135 -0
- package/src/components/harness/todo-panel.tsx +90 -0
- package/src/components/harness/transcript-width-handle.tsx +73 -0
- package/src/components/harness/turn-group.tsx +103 -0
- package/src/components/harness/turn-navigator.tsx +70 -0
- package/src/components/harness/turn-usage-pill.tsx +61 -0
- package/src/components/harness/use-todo-projection.ts +57 -0
- package/src/components/harness/workbench/use-track-columns.ts +69 -0
- package/src/components/harness/workbench/workbench-shell.tsx +102 -0
- package/src/components/hextaui/ai-chat-history.tsx +752 -0
- package/src/components/hextaui/ai-citations.tsx +579 -0
- package/src/components/hextaui/ai-error-handler.tsx +108 -0
- package/src/components/hextaui/ai-file-upload.tsx +575 -0
- package/src/components/hextaui/ai-message.tsx +639 -0
- package/src/components/hextaui/ai-prompt-input.tsx +782 -0
- package/src/components/hextaui/ai-suggested-prompts.tsx +586 -0
- package/src/components/hextaui/ai-thinking.tsx +291 -0
- package/src/components/hextaui/ai-usage-quota.tsx +501 -0
- package/src/components/hextaui/command-menu.tsx +0 -2
- package/src/components/iteration/auto-schedule-dialog.tsx +1 -1
- package/src/components/iteration/create-iteration-dialog.tsx +1 -1
- package/src/components/iteration/iteration-editor.tsx +3 -5
- package/src/components/knowledge/editor/doc-header.tsx +2 -4
- package/src/components/knowledge/editor/knowledge-doc-editor.tsx +32 -2
- package/src/components/knowledge/kb-filter-popover.tsx +2 -4
- package/src/components/knowledge/knowledge-toolbar.tsx +44 -27
- package/src/components/knowledge/knowledge-tree-item.tsx +12 -18
- package/src/components/knowledge/knowledge-tree.tsx +7 -7
- package/src/components/knowledge-public/bookmark-card.tsx +5 -11
- package/src/components/knowledge-public/bookmark-form-dialog.tsx +2 -2
- package/src/components/knowledge-public/knowledge-form-dialog.tsx +3 -3
- package/src/components/knowledge-public/legal-compliance-editor.tsx +3 -5
- package/src/components/knowledge-public/sharers-avatar-group.tsx +3 -7
- package/src/components/layout/sidebar-03/__tests__/user-menu-anonymous.test.tsx +1 -1
- package/src/components/layout/sidebar-03/app-sidebar.tsx +22 -10
- package/src/components/layout/sidebar-03/nav-anyhub.tsx +7 -21
- package/src/components/layout/sidebar-03/nav-knowledge.tsx +14 -40
- package/src/components/layout/sidebar-03/nav-main.tsx +11 -26
- package/src/components/layout/sidebar-03/nav-notifications.tsx +3 -7
- package/src/components/layout/sidebar-03/nav-secondary.tsx +11 -27
- package/src/components/layout/sidebar-03/nav-workspace.tsx +8 -32
- package/src/components/layout/sidebar-03/team-switcher.tsx +3 -7
- package/src/components/layout/sidebar-03/user-menu.tsx +3 -5
- package/src/components/notifications/settings-notifications.tsx +1 -1
- package/src/components/notifications/team-notifications.tsx +3 -7
- package/src/components/project/create-project-dialog.tsx +1 -1
- package/src/components/project/invite-member-dialog.tsx +1 -1
- package/src/components/project/project-member-manager.tsx +3 -5
- package/src/components/settings/ai/byok-section.tsx +162 -0
- package/src/components/settings/ai/create-custom-model-dialog.tsx +1 -1
- package/src/components/settings/ai/create-custom-provider-dialog.tsx +1 -1
- package/src/components/settings/ai/model-manager.tsx +1 -1
- package/src/components/settings/ai/provider-card.tsx +2 -2
- package/src/components/settings/ai/provider-detail-form.tsx +4 -6
- package/src/components/settings/ai/source/model-source-picker.tsx +99 -0
- package/src/components/settings/language-selector.tsx +2 -2
- package/src/components/settings/personal-team/account/account-client.tsx +1 -1
- package/src/components/settings/personal-team/account/avatar/notion-avatar-editor.tsx +12 -26
- package/src/components/settings/personal-team/account/settings-profile.tsx +1 -1
- package/src/components/settings/personal-team/team/team-client.tsx +1 -1
- package/src/components/settings/personal-team/team/team-invitations.tsx +19 -34
- package/src/components/settings/personal-team/team/team-member-list.tsx +5 -10
- package/src/components/shadcn-space/blocks/faq-01/faq.tsx +1 -1
- package/src/components/shadcn-space/blocks/hero-01/header.tsx +20 -3
- package/src/components/shared-kit/__tests__/ask-ai-entry-button.test.tsx +103 -0
- package/src/components/shared-kit/ask-ai-entry-button.tsx +80 -0
- package/src/components/shared-kit/data-viz/contribution-graph-tooltip.tsx +1 -1
- package/src/components/shared-kit/dialogs/name-confirm-dialog.tsx +4 -8
- package/src/components/shared-kit/i18n/language-switcher.tsx +2 -4
- package/src/components/shared-kit/icons/lucide-icon-picker/index.tsx +15 -13
- package/src/components/shared-kit/index.ts +1 -0
- package/src/components/shared-kit/navigation/nav-float-button.tsx +8 -16
- package/src/components/shared-kit/theme/theme-surface.tsx +1 -3
- package/src/components/shared-kit/timezone/timezone-select.tsx +3 -7
- package/src/components/story/ai/handlers/more-popover.tsx +3 -7
- package/src/components/story/ai/handlers/stream-text.ts +1 -1
- package/src/components/story/ai/prototype-dialog.tsx +1 -1
- package/src/components/story/ai/split-dialog.tsx +1 -1
- package/src/components/story/ai/story-ai-panel.tsx +5 -7
- package/src/components/story/ai/story-ai-preview-list.tsx +2 -2
- package/src/components/story/ai/story-ai-toolbar.tsx +6 -12
- package/src/components/story/create-story-dialog.tsx +3 -7
- package/src/components/story/detail/__tests__/associated-attachments-panel.test.tsx +1 -1
- package/src/components/story/detail/comment-input.tsx +1 -1
- package/src/components/story/detail/comment-item.tsx +3 -5
- package/src/components/story/detail/emoji-picker.tsx +1 -1
- package/src/components/story/detail/story-detail-body.tsx +9 -19
- package/src/components/story/detail/story-detail-toolbar/associated-attachments-panel.tsx +42 -63
- package/src/components/story/detail/story-detail-toolbar/categories.tsx +3 -7
- package/src/components/story/detail/story-detail-toolbar/children.tsx +13 -30
- package/src/components/story/detail/story-detail-toolbar/dependency-panel.tsx +8 -19
- package/src/components/story/detail/story-detail-toolbar.tsx +1 -1
- package/src/components/story/display/__tests__/display-dropdown.test.tsx +1 -1
- package/src/components/story/display/display-dropdown.tsx +3 -9
- package/src/components/story/filters/add-filter-dropdown.tsx +3 -3
- package/src/components/story/filters/filter-condition.tsx +3 -7
- package/src/components/story/filters/filter-toggle.tsx +3 -3
- package/src/components/story/filters/filter-value-input.tsx +4 -8
- package/src/components/story/inline-editors/__tests__/labels-editor.test.tsx +1 -1
- package/src/components/story/inline-editors/assignee-editor.tsx +4 -8
- package/src/components/story/inline-editors/dependency-type-select.tsx +26 -26
- package/src/components/story/inline-editors/inline-trigger.tsx +3 -9
- package/src/components/story/inline-editors/labels-editor.tsx +4 -6
- package/src/components/story/inline-editors/priority-editor.tsx +4 -8
- package/src/components/story/inline-editors/state-editor.tsx +4 -8
- package/src/components/story/inline-editors/story-select-dialog.tsx +12 -23
- package/src/components/story/peek-panel.tsx +1 -1
- package/src/components/story/relations/__tests__/attachment-manage-dialog.test.tsx +3 -3
- package/src/components/story/relations/__tests__/knowledge-select-dialog.test.tsx +5 -8
- package/src/components/story/relations/__tests__/link-manage-dialog.test.tsx +1 -1
- package/src/components/story/relations/attachment-manage-dialog.tsx +1 -1
- package/src/components/story/relations/knowledge-select-dialog.tsx +3 -2
- package/src/components/story/relations/link-manage-dialog.tsx +1 -1
- package/src/components/story/relations/story-ref-row.tsx +9 -19
- package/src/components/story/search-popover.tsx +15 -13
- package/src/components/story/story-list-view.tsx +1 -1
- package/src/components/story/story-panel-header.tsx +65 -35
- package/src/components/story/story-toolbar.tsx +4 -8
- package/src/components/story/transfer-story-popover.tsx +18 -14
- package/src/components/story/views/calendar-view.tsx +4 -8
- package/src/components/story/views/create-view-dialog.tsx +3 -7
- package/src/components/story/views/kanban-board.tsx +1 -1
- package/src/components/story/views/story-list/__tests__/batch-toolbar.test.tsx +3 -3
- package/src/components/story/views/story-list/batch-preview-dialog.tsx +12 -23
- package/src/components/story/views/story-list/batch-toolbar.tsx +7 -10
- package/src/components/story/views/story-list/group.tsx +2 -1
- package/src/components/story/views/story-list/index.tsx +1 -1
- package/src/components/story/views/story-list/row.tsx +1 -1
- package/src/components/story/views/timeline-view.tsx +1 -1
- package/src/components/story/views/view-list-section.tsx +3 -7
- package/src/components/story/views/view-selector-button.tsx +2 -4
- package/src/components/story/views/view-switcher.tsx +3 -7
- package/src/components/tiptap/extension/ai-extension.ts +21 -25
- package/src/components/tiptap/extension/ai-suggestion-mark.ts +45 -0
- package/src/components/tiptap/lib/advanced-utils.ts +0 -2
- package/src/components/tiptap/lib/utils/selection.ts +17 -0
- package/src/components/tiptap/mindmap/mind-map.tsx +26 -50
- package/src/components/tiptap/node/annotation-node/annotation-node-view.tsx +1 -1
- package/src/components/tiptap/notion-like/notion-like-editor-header.tsx +3 -7
- package/src/components/tiptap/notion-like/notion-like-editor.tsx +2 -0
- package/src/components/tiptap/ui/ai-ask-button/use-ai-ask.ts +5 -0
- package/src/components/tiptap/ui/ai-menu/ai-menu-actions/ai-menu-actions.tsx +1 -2
- package/src/components/tiptap/ui/ai-menu/ai-menu.tsx +94 -57
- package/src/components/tiptap/ui/drag-context-menu/drag-context-menu.tsx +2 -2
- package/src/components/ui/accordion.tsx +10 -37
- package/src/components/ui/alert-dialog.tsx +29 -60
- package/src/components/ui/alert.tsx +3 -21
- package/src/components/ui/avatar.tsx +5 -28
- package/src/components/ui/badge.tsx +19 -34
- package/src/components/ui/breadcrumb.tsx +20 -35
- package/src/components/ui/button-group.tsx +24 -37
- package/src/components/ui/button.tsx +14 -41
- package/src/components/ui/calendar.tsx +3 -19
- package/src/components/ui/card.tsx +5 -23
- package/src/components/ui/checkbox.tsx +8 -30
- package/src/components/ui/collapsible.tsx +6 -37
- package/src/components/ui/command.tsx +6 -20
- package/src/components/ui/context-menu.tsx +87 -97
- package/src/components/ui/dialog.tsx +31 -59
- package/src/components/ui/dropdown-menu.tsx +118 -139
- package/src/components/ui/empty.tsx +5 -23
- package/src/components/ui/field.tsx +8 -27
- package/src/components/ui/hover-card.tsx +30 -41
- package/src/components/ui/input-group.tsx +13 -26
- package/src/components/ui/input.tsx +4 -21
- package/src/components/ui/item.tsx +22 -34
- package/src/components/ui/kbd.tsx +13 -20
- package/src/components/ui/label.tsx +3 -25
- package/src/components/ui/marker.tsx +70 -0
- package/src/components/ui/message-scroller.tsx +131 -0
- package/src/components/ui/message.tsx +91 -0
- package/src/components/ui/navigation-menu.tsx +42 -56
- package/src/components/ui/popover.tsx +30 -47
- package/src/components/ui/progress.tsx +65 -33
- package/src/components/ui/questionnaire.tsx +322 -0
- package/src/components/ui/radio-group.tsx +12 -33
- package/src/components/ui/resizable.tsx +2 -22
- package/src/components/ui/scroll-area.tsx +8 -24
- package/src/components/ui/select.tsx +68 -77
- package/src/components/ui/separator.tsx +5 -26
- package/src/components/ui/sheet.tsx +29 -58
- package/src/components/ui/sidebar.tsx +143 -130
- package/src/components/ui/skeleton.tsx +1 -18
- package/src/components/ui/spinner.tsx +2 -20
- package/src/components/ui/switch.tsx +6 -23
- package/src/components/ui/table.tsx +1 -21
- package/src/components/ui/tabs.tsx +15 -42
- package/src/components/ui/textarea.tsx +2 -20
- package/src/components/ui/toast.tsx +282 -0
- package/src/components/ui/toggle.tsx +9 -31
- package/src/components/ui/tooltip.tsx +35 -42
- package/src/components/workspace/__tests__/kb/workspace-kb-card.test.tsx +4 -2
- package/src/components/workspace/__tests__/members/workspace-members-manager.test.tsx +1 -1
- package/src/components/workspace/dialogs/create-workspace-dialog.tsx +2 -4
- package/src/components/workspace/dialogs/delete-workspace-options.tsx +1 -1
- package/src/components/workspace/header/workspace-header.tsx +6 -12
- package/src/components/workspace/kb/workspace-kb-card.tsx +16 -38
- package/src/components/workspace/kb/workspace-kb-manage-dialog.tsx +1 -1
- package/src/components/workspace/kb/workspace-quick-doc-dialog.tsx +5 -7
- package/src/components/workspace/members/workspace-members-manager.tsx +4 -6
- package/src/config/sidebar-routes.tsx +5 -5
- package/src/devframe-docks/ai-chat-iframe.tsx +29 -0
- package/src/devframe-docks/session-iframe.tsx +86 -0
- package/src/hooks/use-commands.ts +1 -1
- package/src/hooks/use-mobile.ts +0 -17
- package/src/hooks/use-notifications.ts +1 -1
- package/src/lib/__tests__/annotation-prompt.test.ts +74 -0
- package/src/lib/__tests__/provider-router.test.ts +1 -1
- package/src/lib/__tests__/rag.test.ts +7 -3
- package/src/lib/ai/__tests__/chat-handoff.test.ts +19 -0
- package/src/lib/ai/__tests__/story-prompt.test.ts +42 -15
- package/src/lib/ai/byok.ts +32 -0
- package/src/lib/{chat-handoff.ts → ai/chat-handoff.ts} +48 -24
- package/src/lib/ai/story-ai-stream.ts +0 -1
- package/src/lib/ai/use-code-mode-readiness.ts +32 -0
- package/src/{components → lib}/ai/use-knowledge-bases.ts +2 -2
- package/src/lib/ai/use-search-capability.ts +78 -0
- package/src/{components → lib}/ai/use-selected-model.ts +1 -1
- package/src/lib/auth/auth.config.ts +44 -6
- package/src/lib/changelog/sdk-versions.ts +6 -6
- package/src/lib/commands/__tests__/registry.test.ts +1 -1
- package/src/lib/commands/registry.ts +2 -1
- package/src/lib/crypto/__tests__/base64.test.ts +78 -0
- package/src/lib/crypto/base64.ts +63 -0
- package/src/lib/fsap.ts +61 -0
- package/src/lib/optimistic/use-optimistic-mutation.ts +1 -1
- package/src/lib/plugin-runtime/bridge.ts +51 -0
- package/src/lib/plugin-runtime/plugin-client-tools.ts +115 -0
- package/src/lib/plugin-runtime/plugin-client.ts +161 -0
- package/src/lib/plugin-runtime/worker-realm-source.ts +172 -0
- package/src/lib/plugin-runtime/worker-realm.ts +225 -0
- package/src/lib/rag.ts +6 -4
- package/src/lib/router-context.ts +1 -0
- package/src/lib/session.ts +1 -0
- package/src/lib/utils.ts +1 -23
- package/src/lib/vector-store/__tests__/vector-store.test.ts +51 -2
- package/src/lib/vector-store/pg-vector-store.ts +6 -0
- package/src/lib/vector-store/sqlite-vec-store.ts +29 -12
- package/src/lib/vector-store/types.ts +1 -1
- package/src/paraglide/messages/_index.js +3728 -54071
- package/src/paraglide/messages/agents_agentform_setdefault2.js +30 -0
- package/src/paraglide/messages/agents_agentform_setdefaulthint3.js +30 -0
- package/src/paraglide/messages/agents_askai_advice1.js +30 -0
- package/src/paraglide/messages/agents_askai_advice_prompt1.js +30 -0
- package/src/paraglide/messages/agents_askai_skills1.js +30 -0
- package/src/paraglide/messages/agents_askai_skills_prompt1.js +30 -0
- package/src/paraglide/messages/agents_bindings_defaulttag1.js +30 -0
- package/src/paraglide/messages/agents_bindings_desc.js +29 -0
- package/src/paraglide/messages/agents_bindings_failed.js +29 -0
- package/src/paraglide/messages/agents_bindings_followdefault1.js +30 -0
- package/src/paraglide/messages/agents_bindings_loading.js +29 -0
- package/src/paraglide/messages/agents_bindings_noagents1.js +30 -0
- package/src/paraglide/messages/agents_bindings_saved.js +29 -0
- package/src/paraglide/messages/agents_bindings_title.js +29 -0
- package/src/paraglide/messages/agents_bindings_unbound.js +29 -0
- package/src/paraglide/messages/agents_page_tabs_bindings.js +29 -0
- package/src/paraglide/messages/agents_skills_menuhint1.js +30 -0
- package/src/paraglide/messages/apps_askai_checkup1.js +30 -0
- package/src/paraglide/messages/apps_askai_checkup_prompt1.js +30 -0
- package/src/paraglide/messages/apps_askai_integration1.js +30 -0
- package/src/paraglide/messages/apps_askai_integration_prompt1.js +30 -0
- package/src/paraglide/messages/chat_actions_codemode1.js +30 -0
- package/src/paraglide/messages/chat_actions_codemodeunavailable2.js +30 -0
- package/src/paraglide/messages/chat_actions_disablecodemode2.js +30 -0
- package/src/paraglide/messages/chat_actions_enablecodemode2.js +30 -0
- package/src/paraglide/messages/chat_actions_fork.js +29 -0
- package/src/paraglide/messages/chat_actions_moreactions1.js +30 -0
- package/src/paraglide/messages/chat_actions_stop.js +29 -0
- package/src/paraglide/messages/chat_actions_stopmessage1.js +30 -0
- package/src/paraglide/messages/chat_code_changeset.js +29 -0
- package/src/paraglide/messages/chat_code_clearterminal1.js +30 -0
- package/src/paraglide/messages/chat_code_filedetail1.js +30 -0
- package/src/paraglide/messages/chat_code_files.js +29 -0
- package/src/paraglide/messages/chat_code_loadingfiles1.js +30 -0
- package/src/paraglide/messages/chat_code_nochanges1.js +30 -0
- package/src/paraglide/messages/chat_code_nofiles1.js +30 -0
- package/src/paraglide/messages/chat_code_noterminal1.js +30 -0
- package/src/paraglide/messages/chat_code_preview.js +29 -0
- package/src/paraglide/messages/chat_code_previewempty1.js +30 -0
- package/src/paraglide/messages/chat_code_terminal.js +29 -0
- package/src/paraglide/messages/chat_code_terminalhelp1.js +30 -0
- package/src/paraglide/messages/chat_code_uploaderror1.js +30 -0
- package/src/paraglide/messages/chat_code_uploadsuccess1.js +30 -0
- package/src/paraglide/messages/chat_fork_at_message.js +29 -0
- package/src/paraglide/messages/chat_globalchat_draftrestored2.js +30 -0
- package/src/paraglide/messages/chat_globalchat_openinharness3.js +30 -0
- package/src/paraglide/messages/chat_prompt_input.js +29 -0
- package/src/paraglide/messages/chat_sandbox_created.js +29 -0
- package/src/paraglide/messages/chat_sandbox_filechanged1.js +30 -0
- package/src/paraglide/messages/chat_sandbox_filecreated1.js +30 -0
- package/src/paraglide/messages/chat_sandbox_filedeleted1.js +30 -0
- package/src/paraglide/messages/chat_sandbox_morechanges1.js +30 -0
- package/src/paraglide/messages/chat_sandbox_nodiff1.js +30 -0
- package/src/paraglide/messages/chat_sandbox_resumed.js +29 -0
- package/src/paraglide/messages/chat_searchunavailable1.js +30 -0
- package/src/paraglide/messages/chat_toolcall_error1.js +30 -0
- package/src/paraglide/messages/chat_toolcall_pending1.js +30 -0
- package/src/paraglide/messages/chat_toolcall_ready1.js +30 -0
- package/src/paraglide/messages/chat_toolresult_error1.js +30 -0
- package/src/paraglide/messages/chat_toolresult_running1.js +30 -0
- package/src/paraglide/messages/chat_toolresult_success1.js +30 -0
- package/src/paraglide/messages/chat_workspace_branch.js +29 -0
- package/src/paraglide/messages/chat_workspace_connectgithub1.js +30 -0
- package/src/paraglide/messages/chat_workspace_fsapunavailable1.js +30 -0
- package/src/paraglide/messages/chat_workspace_github.js +29 -0
- package/src/paraglide/messages/chat_workspace_githubconnect1.js +30 -0
- package/src/paraglide/messages/chat_workspace_local.js +29 -0
- package/src/paraglide/messages/chat_workspace_localhint1.js +30 -0
- package/src/paraglide/messages/chat_workspace_private.js +29 -0
- package/src/paraglide/messages/chat_workspace_selectbranch1.js +30 -0
- package/src/paraglide/messages/chat_workspace_selectfolder1.js +30 -0
- package/src/paraglide/messages/chat_workspace_selectfoldererror2.js +30 -0
- package/src/paraglide/messages/chat_workspace_selectrepo1.js +30 -0
- package/src/paraglide/messages/common_button_remove.js +29 -0
- package/src/paraglide/messages/common_changelog_sdkgroups_allblue_sdk1.js +3 -3
- package/src/paraglide/messages/common_changelog_sdkgroups_core_sdk1.js +2 -2
- package/src/paraglide/messages/common_changelog_sdkgroups_tanstack_sdk1.js +2 -2
- package/src/paraglide/messages/common_changelog_title.js +2 -2
- package/src/paraglide/messages/common_command_searchplaceholder1.js +2 -2
- package/src/paraglide/messages/common_nav_harness.js +29 -0
- package/src/paraglide/messages/composer_attach_button.js +29 -0
- package/src/paraglide/messages/composer_attach_imagesonly1.js +30 -0
- package/src/paraglide/messages/composer_attach_remove.js +29 -0
- package/src/paraglide/messages/dashboard_askai_overview1.js +30 -0
- package/src/paraglide/messages/dashboard_askai_overview_prompt1.js +30 -0
- package/src/paraglide/messages/dashboard_askai_todo1.js +30 -0
- package/src/paraglide/messages/dashboard_askai_todo_prompt1.js +30 -0
- package/src/paraglide/messages/editor_ai_image_not_supported.js +30 -0
- package/src/paraglide/messages/editor_ai_request_failed.js +30 -0
- package/src/paraglide/messages/gallery_attachfailed1.js +30 -0
- package/src/paraglide/messages/gallery_attachsuccess1.js +30 -0
- package/src/paraglide/messages/gallery_attachto1.js +30 -0
- package/src/paraglide/messages/gallery_attachtokb2.js +30 -0
- package/src/paraglide/messages/gallery_attachtoprd2.js +30 -0
- package/src/paraglide/messages/gallery_attachtostory2.js +30 -0
- package/src/paraglide/messages/gallery_bytes.js +29 -0
- package/src/paraglide/messages/gallery_close.js +29 -0
- package/src/paraglide/messages/gallery_copyerror1.js +30 -0
- package/src/paraglide/messages/gallery_copyprompt1.js +30 -0
- package/src/paraglide/messages/gallery_created.js +29 -0
- package/src/paraglide/messages/gallery_createvariant1.js +30 -0
- package/src/paraglide/messages/gallery_failed.js +29 -0
- package/src/paraglide/messages/gallery_image.js +29 -0
- package/src/paraglide/messages/gallery_linked.js +29 -0
- package/src/paraglide/messages/gallery_loaderror1.js +30 -0
- package/src/paraglide/messages/gallery_loading.js +29 -0
- package/src/paraglide/messages/gallery_loadmore1.js +30 -0
- package/src/paraglide/messages/gallery_model.js +29 -0
- package/src/paraglide/messages/gallery_next.js +29 -0
- package/src/paraglide/messages/gallery_noitems1.js +30 -0
- package/src/paraglide/messages/gallery_pickconfirm1.js +30 -0
- package/src/paraglide/messages/gallery_pickempty1.js +30 -0
- package/src/paraglide/messages/gallery_pickkb1.js +30 -0
- package/src/paraglide/messages/gallery_pickoptionsfailed2.js +30 -0
- package/src/paraglide/messages/gallery_pickprd1.js +30 -0
- package/src/paraglide/messages/gallery_pickstory1.js +30 -0
- package/src/paraglide/messages/gallery_preview.js +29 -0
- package/src/paraglide/messages/gallery_previewitem1.js +30 -0
- package/src/paraglide/messages/gallery_previous.js +29 -0
- package/src/paraglide/messages/gallery_prompt.js +29 -0
- package/src/paraglide/messages/gallery_prototype.js +29 -0
- package/src/paraglide/messages/gallery_provider.js +29 -0
- package/src/paraglide/messages/gallery_retry.js +29 -0
- package/src/paraglide/messages/gallery_size.js +29 -0
- package/src/paraglide/messages/gallery_speech.js +29 -0
- package/src/paraglide/messages/gallery_title.js +29 -0
- package/src/paraglide/messages/gallery_transcription.js +29 -0
- package/src/paraglide/messages/gallery_unsupported.js +29 -0
- package/src/paraglide/messages/gallery_varianterror1.js +30 -0
- package/src/paraglide/messages/gallery_video.js +29 -0
- package/src/paraglide/messages/harness_agent_default.js +29 -0
- package/src/paraglide/messages/harness_agent_mode.js +29 -0
- package/src/paraglide/messages/harness_approval_approveall1.js +30 -0
- package/src/paraglide/messages/harness_approval_cancelreject1.js +30 -0
- package/src/paraglide/messages/harness_approval_confirmreject1.js +30 -0
- package/src/paraglide/messages/harness_approval_rejectall1.js +30 -0
- package/src/paraglide/messages/harness_approval_rejectreason1.js +30 -0
- package/src/paraglide/messages/harness_approval_rejectreasonplaceholder2.js +30 -0
- package/src/paraglide/messages/harness_askai_cat_advice1.js +30 -0
- package/src/paraglide/messages/harness_askai_cat_analysis1.js +30 -0
- package/src/paraglide/messages/harness_askai_cat_general1.js +30 -0
- package/src/paraglide/messages/harness_askai_cat_skills1.js +30 -0
- package/src/paraglide/messages/harness_attach_file.js +29 -0
- package/src/paraglide/messages/harness_composer_arialabel1.js +30 -0
- package/src/paraglide/messages/harness_composer_pendingapproval1.js +30 -0
- package/src/paraglide/messages/harness_composer_placeholder.js +29 -0
- package/src/paraglide/messages/harness_composer_placeholderdefault1.js +30 -0
- package/src/paraglide/messages/harness_composer_placeholdernokey2.js +30 -0
- package/src/paraglide/messages/harness_composer_placeholderplan1.js +30 -0
- package/src/paraglide/messages/harness_composer_placeholderqueue1.js +30 -0
- package/src/paraglide/messages/harness_composer_placeholdersandboxreadonly2.js +30 -0
- package/src/paraglide/messages/harness_composer_queuelabel1.js +30 -0
- package/src/paraglide/messages/harness_composer_send.js +29 -0
- package/src/paraglide/messages/harness_composer_steerlabel1.js +30 -0
- package/src/paraglide/messages/harness_context_add.js +29 -0
- package/src/paraglide/messages/harness_context_meter_hint.js +29 -0
- package/src/paraglide/messages/harness_context_meter_label.js +29 -0
- package/src/paraglide/messages/harness_context_pages.js +29 -0
- package/src/paraglide/messages/harness_context_selected.js +29 -0
- package/src/paraglide/messages/harness_context_users.js +29 -0
- package/src/paraglide/messages/harness_conversation_fork.js +29 -0
- package/src/paraglide/messages/harness_conversation_pending.js +29 -0
- package/src/paraglide/messages/harness_dock_codeworkspace1.js +30 -0
- package/src/paraglide/messages/harness_dock_docnotfound2.js +30 -0
- package/src/paraglide/messages/harness_dock_fileempty1.js +30 -0
- package/src/paraglide/messages/harness_dock_loadingdoc1.js +30 -0
- package/src/paraglide/messages/harness_dock_loadingfile1.js +30 -0
- package/src/paraglide/messages/harness_dock_placeholder.js +29 -0
- package/src/paraglide/messages/harness_dock_plugin.js +29 -0
- package/src/paraglide/messages/harness_dock_prdnotfound2.js +30 -0
- package/src/paraglide/messages/harness_dock_storyempty1.js +30 -0
- package/src/paraglide/messages/harness_dock_storynotfound2.js +30 -0
- package/src/paraglide/messages/harness_dock_todo.js +29 -0
- package/src/paraglide/messages/harness_dock_unknownresource1.js +30 -0
- package/src/paraglide/messages/harness_media_code.js +29 -0
- package/src/paraglide/messages/harness_media_nocode1.js +30 -0
- package/src/paraglide/messages/harness_media_nospec1.js +30 -0
- package/src/paraglide/messages/harness_media_pro.js +29 -0
- package/src/paraglide/messages/harness_media_spec.js +29 -0
- package/src/paraglide/messages/harness_mention_kb_doc.js +29 -0
- package/src/paraglide/messages/harness_mention_prd.js +29 -0
- package/src/paraglide/messages/harness_model_select_default.js +29 -0
- package/src/paraglide/messages/harness_model_select_nomodels1.js +30 -0
- package/src/paraglide/messages/harness_plan_approve.js +29 -0
- package/src/paraglide/messages/harness_plan_feedbackplaceholder1.js +30 -0
- package/src/paraglide/messages/harness_plan_reject.js +29 -0
- package/src/paraglide/messages/harness_plan_title.js +29 -0
- package/src/paraglide/messages/harness_plugin_defineapprovaltitle2.js +30 -0
- package/src/paraglide/messages/harness_plugin_empty.js +29 -0
- package/src/paraglide/messages/harness_plugin_mentionempty1.js +30 -0
- package/src/paraglide/messages/harness_plugin_mentionnomatch2.js +30 -0
- package/src/paraglide/messages/harness_plugin_mentiontitle1.js +30 -0
- package/src/paraglide/messages/harness_plugin_paneltitle1.js +30 -0
- package/src/paraglide/messages/harness_plugin_status_defined.js +29 -0
- package/src/paraglide/messages/harness_plugin_status_error.js +29 -0
- package/src/paraglide/messages/harness_plugin_status_running.js +29 -0
- package/src/paraglide/messages/harness_plugin_status_stopped.js +29 -0
- package/src/paraglide/messages/harness_plugin_version.js +29 -0
- package/src/paraglide/messages/harness_queue_cancel.js +29 -0
- package/src/paraglide/messages/harness_queue_title.js +29 -0
- package/src/paraglide/messages/harness_queuedmultimedia1.js +30 -0
- package/src/paraglide/messages/harness_sandbox_full.js +29 -0
- package/src/paraglide/messages/harness_sandbox_pro.js +29 -0
- package/src/paraglide/messages/harness_sandbox_readonly.js +29 -0
- package/src/paraglide/messages/harness_sandbox_workspacewrite1.js +30 -0
- package/src/paraglide/messages/harness_spec_generatefailed1.js +30 -0
- package/src/paraglide/messages/harness_spec_needthread1.js +30 -0
- package/src/paraglide/messages/harness_steerhint1.js +30 -0
- package/src/paraglide/messages/harness_thinking_disable.js +29 -0
- package/src/paraglide/messages/harness_thinking_enable.js +29 -0
- package/src/paraglide/messages/harness_thinking_toggle.js +29 -0
- package/src/paraglide/messages/harness_todo_empty.js +29 -0
- package/src/paraglide/messages/harness_todo_paneltitle1.js +30 -0
- package/src/paraglide/messages/harness_tool_input.js +29 -0
- package/src/paraglide/messages/harness_tool_knowledgesearch1.js +30 -0
- package/src/paraglide/messages/harness_tool_output.js +29 -0
- package/src/paraglide/messages/harness_tool_resultcount1.js +30 -0
- package/src/paraglide/messages/harness_tool_websearch1.js +30 -0
- package/src/paraglide/messages/harness_turn_collapse.js +29 -0
- package/src/paraglide/messages/harness_turn_collapsearia1.js +30 -0
- package/src/paraglide/messages/harness_turn_expandaria1.js +30 -0
- package/src/paraglide/messages/harness_turn_navigator_label.js +29 -0
- package/src/paraglide/messages/harness_turn_replies.js +29 -0
- package/src/paraglide/messages/harness_turn_streaming.js +29 -0
- package/src/paraglide/messages/harness_turn_thoughtmoment1.js +30 -0
- package/src/paraglide/messages/harness_turn_thoughtmoment_aria1.js +30 -0
- package/src/paraglide/messages/harness_turn_tools.js +29 -0
- package/src/paraglide/messages/harness_turn_usage_label.js +29 -0
- package/src/paraglide/messages/harness_web_search_disable.js +29 -0
- package/src/paraglide/messages/harness_web_search_enable.js +29 -0
- package/src/paraglide/messages/harness_web_search_label.js +29 -0
- package/src/paraglide/messages/harness_web_search_toggle.js +29 -0
- package/src/paraglide/messages/knowledge_askai_button1.js +30 -0
- package/src/paraglide/messages/knowledge_askai_cat_all1.js +30 -0
- package/src/paraglide/messages/knowledge_askai_cat_graph1.js +30 -0
- package/src/paraglide/messages/knowledge_askai_cat_search1.js +30 -0
- package/src/paraglide/messages/knowledge_askai_cat_summary1.js +30 -0
- package/src/paraglide/messages/knowledge_askai_graph1.js +30 -0
- package/src/paraglide/messages/knowledge_askai_search1.js +30 -0
- package/src/paraglide/messages/knowledge_askai_summarize1.js +30 -0
- package/src/paraglide/messages/prd_askai_analyze1.js +30 -0
- package/src/paraglide/messages/prd_askai_button1.js +30 -0
- package/src/paraglide/messages/prd_askai_cat_all1.js +30 -0
- package/src/paraglide/messages/prd_askai_cat_analysis1.js +30 -0
- package/src/paraglide/messages/prd_askai_cat_design1.js +30 -0
- package/src/paraglide/messages/prd_askai_cat_extraction1.js +30 -0
- package/src/paraglide/messages/prd_askai_extract1.js +30 -0
- package/src/paraglide/messages/prd_askai_prototype1.js +30 -0
- package/src/paraglide/messages/settings_ai_byokdelete1.js +30 -0
- package/src/paraglide/messages/settings_ai_byokdescription1.js +30 -0
- package/src/paraglide/messages/settings_ai_byokhidekey2.js +30 -0
- package/src/paraglide/messages/settings_ai_byokhint1.js +30 -0
- package/src/paraglide/messages/settings_ai_byokplaceholder1.js +30 -0
- package/src/paraglide/messages/settings_ai_byoksave1.js +30 -0
- package/src/paraglide/messages/settings_ai_byokshowkey2.js +30 -0
- package/src/paraglide/messages/settings_ai_byokstateempty2.js +30 -0
- package/src/paraglide/messages/settings_ai_byokstatelocked2.js +30 -0
- package/src/paraglide/messages/settings_ai_byokstateset2.js +30 -0
- package/src/paraglide/messages/settings_ai_byoktitle1.js +30 -0
- package/src/paraglide/messages/settings_ai_hosted_desc.js +29 -0
- package/src/paraglide/messages/settings_ai_hosted_empty.js +29 -0
- package/src/paraglide/messages/settings_ai_hosted_quota.js +29 -0
- package/src/paraglide/messages/settings_ai_hosted_title.js +29 -0
- package/src/paraglide/messages/settings_ai_source_byok_desc.js +29 -0
- package/src/paraglide/messages/settings_ai_source_byok_tagmulti1.js +30 -0
- package/src/paraglide/messages/settings_ai_source_byok_tagurl1.js +30 -0
- package/src/paraglide/messages/settings_ai_source_byok_title.js +29 -0
- package/src/paraglide/messages/settings_ai_source_continue.js +29 -0
- package/src/paraglide/messages/settings_ai_source_current.js +29 -0
- package/src/paraglide/messages/settings_ai_source_hosted_desc.js +29 -0
- package/src/paraglide/messages/settings_ai_source_hosted_tagbilling1.js +30 -0
- package/src/paraglide/messages/settings_ai_source_hosted_tagnokey2.js +30 -0
- package/src/paraglide/messages/settings_ai_source_hosted_title.js +29 -0
- package/src/paraglide/messages/settings_ai_source_local_desc.js +29 -0
- package/src/paraglide/messages/settings_ai_source_local_needdesktop1.js +30 -0
- package/src/paraglide/messages/settings_ai_source_local_tagbyok1.js +30 -0
- package/src/paraglide/messages/settings_ai_source_local_taglocal1.js +30 -0
- package/src/paraglide/messages/settings_ai_source_local_title.js +29 -0
- package/src/paraglide/messages/settings_ai_source_title.js +29 -0
- package/src/paraglide/messages/story_askai_analyze1.js +30 -0
- package/src/paraglide/messages/story_askai_cat_all1.js +30 -0
- package/src/paraglide/messages/story_askai_cat_analysis1.js +30 -0
- package/src/paraglide/messages/story_askai_cat_refine1.js +30 -0
- package/src/paraglide/messages/story_askai_cat_test1.js +30 -0
- package/src/paraglide/messages/story_askai_refine1.js +30 -0
- package/src/paraglide/messages/story_askai_test1.js +30 -0
- package/src/paraglide/messages/story_panel_askai1.js +30 -0
- package/src/paraglide/messages/workspaces_askai_overview1.js +30 -0
- package/src/paraglide/messages/workspaces_askai_overview_prompt1.js +30 -0
- package/src/paraglide/messages/workspaces_askai_seats1.js +30 -0
- package/src/paraglide/messages/workspaces_askai_seats_prompt1.js +30 -0
- package/src/plugins/core/inspiration/ui.tsx +2 -4
- package/src/plugins/core/prd/components/agent-input.tsx +5 -11
- package/src/plugins/core/prd/components/component-editor/content-section.tsx +1 -1
- package/src/plugins/core/prd/components/component-editor/style-fields.tsx +1 -1
- package/src/plugins/core/prd/components/dialog/prd-detail-client.tsx +3 -7
- package/src/plugins/core/prd/components/page-version-panel.tsx +23 -43
- package/src/plugins/core/prd/components/page-version-tree.tsx +6 -14
- package/src/plugins/core/prd/components/prd-agent-panel.tsx +3 -5
- package/src/plugins/core/prd/components/prd-comment-review-panel.tsx +2 -4
- package/src/plugins/core/prd/components/prd-doc-panel.tsx +6 -14
- package/src/plugins/core/prd/components/prd-editor-layout.tsx +1 -1
- package/src/plugins/core/prd/components/prd-left-sidebar.tsx +5 -11
- package/src/plugins/core/prd/components/prd-navigation.tsx +41 -11
- package/src/plugins/core/prd/components/prd-prototype-panel.tsx +9 -21
- package/src/plugins/core/prd/components/prd-right-sidebar.tsx +7 -15
- package/src/plugins/core/prd/components/prd-share-panel/components/single-version-share-card.tsx +13 -27
- package/src/plugins/core/prd/components/prd-share-panel.tsx +8 -14
- package/src/plugins/core/prd/components/prd-tree-page-tab.tsx +9 -21
- package/src/plugins/core/prd/components/share/share-comment-panel.tsx +1 -1
- package/src/plugins/core/prd/components/share/share-nav-bar.tsx +3 -7
- package/src/plugins/core/prd/components/share/share-password-gate.tsx +1 -1
- package/src/plugins/core/prd/components/share/share-review-panel.tsx +1 -1
- package/src/plugins/core/prd/lib/ai/annotation-prompt.ts +9 -14
- package/src/plugins/core/prd/pages/prd-detail-page.tsx +2 -6
- package/src/plugins/core/prd/prd-nav.tsx +4 -8
- package/src/plugins/core/prd/serverFns/ai/fill-annotation.ts +2 -2
- package/src/plugins/core/prd/serverFns/ai/generate-prototype.ts +12 -64
- package/src/{server/serverFns/ai/detect.ts → plugins/core/prd/serverFns/ai/hosted-models.ts} +10 -13
- package/src/plugins/core/prd/serverFns/ai/source-mode.ts +51 -0
- package/src/plugins/core/server/api-key-cipher.ts +6 -4
- package/src/plugins/core/tags/nav-tag.tsx +9 -24
- package/src/plugins/core/tags/tag-manager.tsx +1 -1
- package/src/plugins/core/tags/tag-selector.tsx +3 -7
- package/src/providers/index.tsx +1 -1
- package/src/routeTree.gen.ts +293 -54
- package/src/routes/__desktop/onboarding/route.lazy.tsx +1 -1
- package/src/routes/__root.tsx +4 -8
- package/src/routes/__tests__/-edition-routing.test.tsx +6 -4
- package/src/routes/__tests__/route-tree-structure.test.ts +10 -1
- package/src/routes/_login/changelog/confirm/route.lazy.tsx +10 -10
- package/src/routes/_login/email-unsubscribe/route.lazy.tsx +11 -11
- package/src/routes/_login/forgot-password/route.lazy.tsx +1 -1
- package/src/routes/_login/login/route.lazy.tsx +1 -1
- package/src/routes/_login/register/route.lazy.tsx +1 -1
- package/src/routes/_login/reset-password/route.lazy.tsx +1 -1
- package/src/routes/_login/verify-email/route.lazy.tsx +6 -6
- package/src/routes/_nav/apps/anyhub/$id/route.lazy.tsx +54 -0
- package/src/routes/_nav/apps/anyhub/$id/route.tsx +1 -8
- package/src/routes/_nav/apps/anyhub/route.tsx +29 -3
- package/src/routes/_nav/chat.$threadId.tsx +24 -0
- package/src/routes/_nav/chat.tsx +31 -0
- package/src/routes/_nav/dashboard/route.lazy.tsx +18 -1
- package/src/routes/_nav/harness/$threadId.lazy.tsx +28 -0
- package/src/routes/_nav/{chat → harness}/$threadId.tsx +2 -7
- package/src/routes/_nav/harness/gallery/route.lazy.tsx +33 -0
- package/src/{components/chat/ai-message.tsx → routes/_nav/harness/gallery/route.tsx} +3 -2
- package/src/routes/_nav/harness/route.lazy.tsx +28 -0
- package/src/routes/_nav/{chat → harness}/route.tsx +1 -1
- package/src/routes/_nav/knowledge/bookmarks/$id.lazy.tsx +2 -2
- package/src/routes/_nav/knowledge/bookmarks/index.lazy.tsx +1 -1
- package/src/routes/_nav/knowledge/compliance/$id.lazy.tsx +14 -30
- package/src/routes/_nav/knowledge/dictionaries/$id.lazy.tsx +1 -1
- package/src/routes/_nav/knowledge/index.lazy.tsx +2 -8
- package/src/routes/_nav/knowledge/laws/$id.lazy.tsx +14 -30
- package/src/routes/_nav/projects/$projectId/$storyId/route.lazy.tsx +3 -5
- package/src/routes/_nav/projects/$projectId/index.lazy.tsx +8 -18
- package/src/routes/_nav/projects/$projectId/iterations/$iterationId/route.lazy.tsx +4 -8
- package/src/routes/_nav/projects/$projectId/settings/route.lazy.tsx +4 -6
- package/src/routes/_nav/route.lazy.tsx +10 -2
- package/src/routes/_nav/route.tsx +3 -8
- package/src/routes/_nav/settings/ai/$providerId/route.tsx +3 -16
- package/src/routes/_nav/settings/ai/hosted/route.lazy.tsx +55 -0
- package/src/routes/_nav/settings/ai/hosted/route.tsx +26 -0
- package/src/routes/_nav/settings/ai/index/route.lazy.tsx +59 -25
- package/src/routes/_nav/settings/ai/{$providerId → providers/$providerId}/route.lazy.tsx +1 -1
- package/src/routes/_nav/settings/ai/providers/$providerId/route.tsx +37 -0
- package/src/routes/_nav/settings/ai/providers/index/route.lazy.tsx +43 -0
- package/src/routes/_nav/settings/ai/route.tsx +6 -3
- package/src/routes/_nav/settings/billing/route.lazy.tsx +1 -1
- package/src/routes/_nav/settings/design/route.lazy.tsx +3 -5
- package/src/routes/_nav/settings/general/route.lazy.tsx +1 -1
- package/src/routes/_nav/settings/privacy/route.lazy.tsx +3 -5
- package/src/routes/_nav/settings/route.tsx +2 -6
- package/src/routes/_nav/workspaces/$workspaceId/activities/route.lazy.tsx +3 -5
- package/src/routes/_nav/workspaces/$workspaceId/settings/route.lazy.tsx +4 -6
- package/src/routes/_nav/workspaces/index.lazy.tsx +34 -17
- package/src/routes/api/chat.ts +42 -22
- package/src/routes/api/cron/ai-run-reaper.ts +80 -0
- package/src/routes/api/devframe/__tests__/auth-trace.test.ts +18 -0
- package/src/routes/api/devframe/__tests__/bundle-stats.test.ts +18 -0
- package/src/routes/api/devframe/__tests__/entitlements.test.ts +20 -0
- package/src/routes/api/devframe/__tests__/hydration-probe.test.ts +16 -0
- package/src/routes/api/devframe/auth-trace.ts +39 -0
- package/src/routes/api/devframe/bundle-stats.ts +73 -0
- package/src/routes/api/devframe/entitlements.ts +19 -0
- package/src/routes/api/devframe/hydration-probe.ts +30 -0
- package/src/routes/invite/$token/route.lazy.tsx +1 -1
- package/src/routes/server.ai-stream.ts +34 -19
- package/src/routes/share/compliance/$id/route.lazy.tsx +4 -6
- package/src/routes/share/law/$id/route.lazy.tsx +4 -6
- package/src/server/__tests__/agent-client-graph.test.ts +2 -2
- package/src/server/__tests__/chat-agent-resolve.test.ts +1 -1
- package/src/server/__tests__/chat-conversations.test.ts +5 -0
- package/src/server/__tests__/entitlements.test.ts +99 -1
- package/src/server/__tests__/resource-registry.test.ts +12 -2
- package/src/server/__tests__/resources.agents.test.ts +2 -1
- package/src/server/__tests__/resources.license.test.ts +2 -1
- package/src/server/__tests__/resources.test.ts +2 -1
- package/src/server/__tests__/sandbox-entitlement.test.ts +169 -0
- package/src/server/ai-gateway/__tests__/adapter-temperature.test.ts +104 -0
- package/src/server/ai-gateway/__tests__/agent-runtime.test.ts +334 -0
- package/src/server/ai-gateway/__tests__/chat-handler-prompt-key.test.ts +244 -0
- package/src/server/ai-gateway/__tests__/chat-prompt-key-drift.test.ts +96 -0
- package/src/server/ai-gateway/__tests__/chat-stream-builder-code-mode.test.ts +215 -0
- package/src/server/ai-gateway/__tests__/chat-stream-builder-memory.test.ts +179 -0
- package/src/server/ai-gateway/__tests__/chat-stream-builder-sandbox.test.ts +211 -0
- package/src/server/ai-gateway/__tests__/chat-stream-builder-skills.test.ts +126 -0
- package/src/server/ai-gateway/__tests__/code-mode-integration-smoke.test.ts +178 -0
- package/src/server/ai-gateway/__tests__/code-mode-stack.test.ts +390 -0
- package/src/server/ai-gateway/__tests__/compaction.test.ts +509 -0
- package/src/server/ai-gateway/__tests__/conformance.test.ts +45 -13
- package/src/server/ai-gateway/__tests__/env-key.test.ts +175 -0
- package/src/server/ai-gateway/__tests__/interrupt-store.test.ts +19 -4
- package/src/server/ai-gateway/__tests__/kb-context-guard.test.ts +24 -16
- package/src/server/ai-gateway/__tests__/knowledge-search-fence.test.ts +7 -0
- package/src/server/ai-gateway/__tests__/label-suggest.test.ts +22 -5
- package/src/server/ai-gateway/__tests__/message-store.test.ts +14 -9
- package/src/server/ai-gateway/__tests__/pgvector-memory-adapter.test.ts +422 -0
- package/src/server/ai-gateway/__tests__/plugin-lifecycle.test.ts +57 -0
- package/src/server/ai-gateway/__tests__/prompt-builtin.test.ts +273 -0
- package/src/server/ai-gateway/__tests__/prompt-registry.test.ts +549 -0
- package/src/server/ai-gateway/__tests__/prompt-vars-contract.test.ts +146 -0
- package/src/server/ai-gateway/__tests__/provider-adapter.test.ts +164 -0
- package/src/server/ai-gateway/__tests__/run-store-durable.test.ts +151 -0
- package/src/server/ai-gateway/__tests__/run-store.test.ts +90 -0
- package/src/server/ai-gateway/__tests__/runtime.test.ts +1 -1
- package/src/server/ai-gateway/__tests__/skills-source.test.ts +306 -0
- package/src/server/ai-gateway/__tests__/snippets.test.ts +328 -0
- package/src/server/ai-gateway/__tests__/source-mode.test.ts +77 -0
- package/src/server/ai-gateway/__tests__/story-prompt.test.ts +75 -11
- package/src/server/ai-gateway/__tests__/todo-plan-tools.test.ts +435 -0
- package/src/server/ai-gateway/__tests__/tool-registry.test.ts +182 -0
- package/src/server/ai-gateway/__tests__/tools-select.test.ts +32 -6
- package/src/server/ai-gateway/__tests__/unified-router.test.ts +107 -1
- package/src/server/ai-gateway/__tests__/usage-log.test.ts +192 -0
- package/src/server/ai-gateway/__tests__/vm-driver.test.ts +193 -0
- package/src/server/ai-gateway/adapter.ts +60 -3
- package/src/server/ai-gateway/byok.ts +144 -0
- package/src/server/ai-gateway/chat-handler.ts +275 -45
- package/src/server/ai-gateway/chat-stream-builder.ts +177 -14
- package/src/server/ai-gateway/code-mode/index.ts +236 -0
- package/src/server/ai-gateway/code-mode/sandbox.ts +213 -0
- package/src/server/ai-gateway/code-mode/snippets.ts +235 -0
- package/src/server/ai-gateway/code-mode/vm-driver.ts +197 -0
- package/src/server/ai-gateway/connectivity-check.ts +3 -1
- package/src/server/ai-gateway/durability/__tests__/pg-stream.test.ts +343 -0
- package/src/server/ai-gateway/durability/__tests__/reaper-drive.test.ts +154 -0
- package/src/server/ai-gateway/durability/__tests__/reaper-lazy.test.ts +145 -0
- package/src/server/ai-gateway/durability/__tests__/reaper-real-db.test.ts +315 -0
- package/src/server/ai-gateway/durability/__tests__/reaper.test.ts +227 -0
- package/src/server/ai-gateway/durability/pg-stream.ts +355 -0
- package/src/server/ai-gateway/durability/reaper-driver.ts +80 -0
- package/src/server/ai-gateway/durability/reaper-lazy.ts +97 -0
- package/src/server/ai-gateway/durability/reaper.ts +130 -0
- package/src/server/ai-gateway/embedding.ts +8 -4
- package/src/server/ai-gateway/env-key.ts +33 -0
- package/src/server/ai-gateway/index.ts +52 -2
- package/src/server/ai-gateway/kb-context-guard.ts +7 -7
- package/src/server/ai-gateway/knowledge-index-core.ts +14 -0
- package/src/server/ai-gateway/label-suggest.ts +23 -18
- package/src/server/ai-gateway/locks/__tests__/pg-lock.test.ts +133 -0
- package/src/server/ai-gateway/locks/pg-lock.ts +111 -0
- package/src/server/ai-gateway/media/__tests__/generation.spec.ts +52 -0
- package/src/server/ai-gateway/media/__tests__/index.test.ts +116 -0
- package/src/server/ai-gateway/media/__tests__/prototype-schema.spec.ts +36 -0
- package/src/server/ai-gateway/media/adapters.ts +128 -0
- package/src/server/ai-gateway/media/index.ts +231 -0
- package/src/server/ai-gateway/media/prototype-schema.ts +75 -0
- package/src/server/ai-gateway/media/recorder.ts +73 -0
- package/src/server/ai-gateway/memory/index.ts +76 -0
- package/src/server/ai-gateway/memory/pgvector-adapter.ts +243 -0
- package/src/server/ai-gateway/memory/scope.ts +54 -0
- package/src/server/ai-gateway/middlewares/compaction.ts +232 -0
- package/src/server/ai-gateway/middlewares/index.ts +11 -1
- package/src/server/ai-gateway/middlewares/logger.ts +4 -4
- package/src/server/ai-gateway/middlewares/plan-approval.ts +125 -0
- package/src/server/ai-gateway/middlewares/rate-limit.ts +4 -4
- package/src/server/ai-gateway/middlewares/tool-budget.ts +50 -0
- package/src/server/ai-gateway/middlewares/usage-log.ts +158 -0
- package/src/server/ai-gateway/model-fetch.ts +4 -2
- package/src/server/ai-gateway/persistence/index.ts +4 -2
- package/src/server/ai-gateway/persistence/interrupt-store.ts +78 -16
- package/src/server/ai-gateway/persistence/message-store.ts +35 -36
- package/src/server/ai-gateway/persistence/metadata-store.ts +62 -0
- package/src/server/ai-gateway/persistence/run-store.ts +67 -21
- package/src/server/ai-gateway/ports.ts +3 -1
- package/src/server/ai-gateway/prompts/builtin.ts +327 -0
- package/src/server/ai-gateway/prompts/definitions.ts +36 -0
- package/src/server/ai-gateway/prompts/index.ts +41 -0
- package/src/server/ai-gateway/prompts/registry.ts +248 -0
- package/src/server/ai-gateway/prompts/seed.ts +54 -0
- package/src/server/ai-gateway/prompts/types.ts +40 -0
- package/src/server/ai-gateway/rerank.ts +2 -1
- package/src/server/ai-gateway/runs/agent-runtime.ts +176 -0
- package/src/server/ai-gateway/runs/biz-keys.ts +54 -0
- package/src/server/{serverFns/agents → ai-gateway/runs}/resolve-overrides.ts +2 -8
- package/src/server/ai-gateway/sandbox/__tests__/harness-sandbox.test.ts +170 -0
- package/src/server/ai-gateway/sandbox/__tests__/instance-store.test.ts +130 -0
- package/src/server/ai-gateway/sandbox/__tests__/local-process.test.ts +316 -0
- package/src/server/ai-gateway/sandbox/__tests__/policy.test.ts +157 -0
- package/src/server/ai-gateway/sandbox/__tests__/provider.test.ts +102 -0
- package/src/server/ai-gateway/sandbox/__tests__/tool-bridge.test.ts +112 -0
- package/src/server/ai-gateway/sandbox/entitlement.ts +51 -0
- package/src/server/ai-gateway/sandbox/harness-sandbox.ts +345 -0
- package/src/server/ai-gateway/sandbox/instance-store.ts +91 -0
- package/src/server/ai-gateway/sandbox/local-process.ts +329 -0
- package/src/server/ai-gateway/sandbox/policy-levels.ts +3 -0
- package/src/server/ai-gateway/sandbox/policy.ts +267 -0
- package/src/server/ai-gateway/sandbox/provider.ts +128 -0
- package/src/server/ai-gateway/sandbox/tool-bridge.ts +78 -0
- package/src/server/ai-gateway/skills/builtin/competitive-analysis/SKILL.md +40 -0
- package/src/server/ai-gateway/skills/builtin/competitive-analysis/references/matrix-template.md +37 -0
- package/src/server/ai-gateway/skills/builtin/naming-advisor/SKILL.md +43 -0
- package/src/server/ai-gateway/skills/builtin/prd-review/SKILL.md +29 -0
- package/src/server/ai-gateway/skills/builtin/prd-review/references/review-checklist.md +46 -0
- package/src/server/ai-gateway/skills/builtin-source.ts +115 -0
- package/src/server/ai-gateway/skills/governance.ts +87 -0
- package/src/server/ai-gateway/skills/index.ts +137 -0
- package/src/server/ai-gateway/skills/user-source.ts +109 -0
- package/src/server/ai-gateway/source-mode.ts +62 -0
- package/src/server/ai-gateway/story-handler.ts +27 -21
- package/src/server/ai-gateway/story-prompt.ts +16 -25
- package/src/server/ai-gateway/tools/create-pr.ts +296 -0
- package/src/server/ai-gateway/tools/delegate-task.ts +91 -0
- package/src/server/ai-gateway/tools/delete-project.ts +3 -0
- package/src/server/ai-gateway/tools/index.ts +15 -0
- package/src/server/ai-gateway/tools/keys.ts +42 -0
- package/src/server/ai-gateway/tools/plan-submit.ts +113 -0
- package/src/server/ai-gateway/tools/plugin-lifecycle-defs.ts +122 -0
- package/src/server/ai-gateway/tools/plugin-lifecycle-server.ts +160 -0
- package/src/server/ai-gateway/tools/plugin-tools.ts +57 -0
- package/src/server/ai-gateway/tools/projection-namespace.ts +28 -0
- package/src/server/ai-gateway/tools/registry.ts +101 -0
- package/src/server/ai-gateway/tools/select.ts +70 -11
- package/src/server/ai-gateway/tools/server.ts +4 -2
- package/src/server/ai-gateway/tools/todo-write.ts +78 -0
- package/src/server/ai-gateway/types.ts +16 -0
- package/src/server/ai-gateway/unified-router.ts +99 -9
- package/src/server/ai-ports.ts +7 -3
- package/src/server/entitlements-token.ts +3 -15
- package/src/server/entitlements.ts +9 -0
- package/src/server/middlewares/security-headers.ts +60 -40
- package/src/server/resources.ts +54 -0
- package/src/server/serverFns/__tests__/ai-hosted-models.test.ts +68 -0
- package/src/server/serverFns/__tests__/ai-source-mode.test.ts +119 -0
- package/src/server/serverFns/__tests__/harness-plugins.test.ts +140 -0
- package/src/server/serverFns/__tests__/knowledge-index.test.ts +42 -4
- package/src/server/serverFns/__tests__/knowledge-search.test.ts +262 -0
- package/src/server/serverFns/activity.ts +1 -1
- package/src/server/serverFns/agents/agent-crud.ts +8 -1
- package/src/server/serverFns/agents/bindings.ts +113 -0
- package/src/server/serverFns/agents/skill-crud.ts +5 -1
- package/src/server/serverFns/ai/code-mode-readiness.ts +23 -0
- package/src/server/serverFns/ai/hosted-models.ts +1 -0
- package/src/server/serverFns/ai/search-capability.ts +23 -0
- package/src/server/serverFns/ai/source-mode.ts +1 -0
- package/src/server/serverFns/anyhub/app.ts +3 -1
- package/src/server/serverFns/anyhub/index.ts +3 -1
- package/src/server/serverFns/anyhub/install.ts +1 -1
- package/src/server/serverFns/anyhub/proxy.ts +1 -1
- package/src/server/serverFns/auth/email-verification.ts +3 -1
- package/src/server/serverFns/auth/forgot-password.ts +1 -1
- package/src/server/serverFns/auth/register.ts +2 -1
- package/src/server/serverFns/auth/reset-password.ts +2 -1
- package/src/server/serverFns/auth/setup.ts +1 -1
- package/src/server/serverFns/billing.ts +8 -1
- package/src/server/serverFns/changelog/fetch.ts +1 -1
- package/src/server/serverFns/changelog/subscribe.ts +2 -1
- package/src/server/serverFns/chat/conversations.ts +78 -1
- package/src/server/serverFns/chat/list-messages.ts +1 -1
- package/src/server/serverFns/design/settings.ts +3 -1
- package/src/server/serverFns/design.ts +4 -1
- package/src/server/serverFns/email-unsubscribe.ts +1 -1
- package/src/server/serverFns/harness/__tests__/attach-guards.spec.ts +45 -0
- package/src/server/serverFns/harness/__tests__/attach-prototype.spec.ts +69 -0
- package/src/server/serverFns/harness/__tests__/attach-to-kb.spec.ts +86 -0
- package/src/server/serverFns/harness/__tests__/attach-to-story.spec.ts +90 -0
- package/src/server/serverFns/harness/__tests__/cancel-run.test.ts +146 -0
- package/src/server/serverFns/harness/__tests__/gallery.spec.ts +126 -0
- package/src/server/serverFns/harness/__tests__/media-prototype.spec.ts +67 -0
- package/src/server/serverFns/harness/__tests__/media.spec.ts +43 -0
- package/src/server/serverFns/harness/__tests__/sandbox-policy.test.ts +199 -0
- package/src/server/serverFns/harness/__tests__/workspace-files.test.ts +224 -0
- package/src/server/serverFns/harness/attach-guards.ts +31 -0
- package/src/server/serverFns/harness/attach-prototype.ts +63 -0
- package/src/server/serverFns/harness/attach-to-kb.ts +80 -0
- package/src/server/serverFns/harness/attach-to-story.ts +74 -0
- package/src/server/serverFns/harness/cancel-run.ts +89 -0
- package/src/server/serverFns/{ai/execute.ts → harness/extract-attachment.ts} +19 -15
- package/src/server/serverFns/harness/gallery.ts +213 -0
- package/src/server/serverFns/harness/github-workspace.ts +202 -0
- package/src/server/serverFns/harness/media.ts +300 -0
- package/src/server/serverFns/harness/sandbox-policy.ts +88 -0
- package/src/server/serverFns/harness/search-mention-candidates.ts +53 -0
- package/src/server/serverFns/harness/workspace-files.ts +136 -0
- package/src/server/serverFns/iteration/__tests__/iteration-stories.test.ts +11 -1
- package/src/server/serverFns/iteration/__tests__/iteration-transfer.test.ts +11 -1
- package/src/server/serverFns/iteration/auto-schedule-internal.ts +3 -1
- package/src/server/serverFns/iteration/iteration-auto-schedule.ts +2 -1
- package/src/server/serverFns/iteration/iteration-burndown.ts +1 -1
- package/src/server/serverFns/iteration/iteration-crud.ts +8 -1
- package/src/server/serverFns/iteration/iteration-stories.ts +4 -1
- package/src/server/serverFns/iteration/transfer-internal.ts +1 -1
- package/src/server/serverFns/kb-doc-search.ts +2 -1
- package/src/server/serverFns/knowledge-index-utils.ts +26 -5
- package/src/server/serverFns/knowledge-index.ts +8 -4
- package/src/server/serverFns/knowledge-public/bookmarks/categories.ts +3 -1
- package/src/server/serverFns/knowledge-public/bookmarks/create.ts +1 -1
- package/src/server/serverFns/knowledge-public/bookmarks/delete.ts +1 -1
- package/src/server/serverFns/knowledge-public/bookmarks/detail.ts +1 -1
- package/src/server/serverFns/knowledge-public/bookmarks/favorite.ts +1 -1
- package/src/server/serverFns/knowledge-public/bookmarks/list.ts +1 -1
- package/src/server/serverFns/knowledge-public/bookmarks/share.ts +1 -1
- package/src/server/serverFns/knowledge-public/bookmarks/unshare.ts +1 -1
- package/src/server/serverFns/knowledge-public/bookmarks/update.ts +1 -1
- package/src/server/serverFns/knowledge-public/compliance/create.ts +1 -1
- package/src/server/serverFns/knowledge-public/compliance/delete.ts +1 -1
- package/src/server/serverFns/knowledge-public/compliance/detail.ts +1 -1
- package/src/server/serverFns/knowledge-public/compliance/list.ts +1 -1
- package/src/server/serverFns/knowledge-public/compliance/public.ts +1 -1
- package/src/server/serverFns/knowledge-public/compliance/share.ts +1 -1
- package/src/server/serverFns/knowledge-public/compliance/unshare.ts +1 -1
- package/src/server/serverFns/knowledge-public/compliance/update.ts +1 -1
- package/src/server/serverFns/knowledge-public/dictionary/create.ts +1 -1
- package/src/server/serverFns/knowledge-public/dictionary/delete.ts +1 -1
- package/src/server/serverFns/knowledge-public/dictionary/detail.ts +1 -1
- package/src/server/serverFns/knowledge-public/dictionary/list.ts +1 -1
- package/src/server/serverFns/knowledge-public/dictionary/share.ts +1 -1
- package/src/server/serverFns/knowledge-public/dictionary/unshare.ts +1 -1
- package/src/server/serverFns/knowledge-public/dictionary/update.ts +1 -1
- package/src/server/serverFns/knowledge-public/entity-tags.ts +1 -1
- package/src/server/serverFns/knowledge-public/favorite.ts +2 -1
- package/src/server/serverFns/knowledge-public/legal/create.ts +1 -1
- package/src/server/serverFns/knowledge-public/legal/delete.ts +1 -1
- package/src/server/serverFns/knowledge-public/legal/detail.ts +1 -1
- package/src/server/serverFns/knowledge-public/legal/list.ts +1 -1
- package/src/server/serverFns/knowledge-public/legal/public.ts +1 -1
- package/src/server/serverFns/knowledge-public/legal/share.ts +1 -1
- package/src/server/serverFns/knowledge-public/legal/unshare.ts +1 -1
- package/src/server/serverFns/knowledge-public/legal/update.ts +1 -1
- package/src/server/serverFns/knowledge.ts +56 -9
- package/src/server/serverFns/notifications.ts +8 -1
- package/src/server/serverFns/plugins/harness-plugins.ts +233 -0
- package/src/server/serverFns/plugins/plugin-precheck.ts +82 -0
- package/src/server/serverFns/project/module-overview.ts +2 -1
- package/src/server/serverFns/project.ts +19 -1
- package/src/server/serverFns/settings/account-team.ts +1 -1
- package/src/server/serverFns/share/version.ts +1 -1
- package/src/server/serverFns/sso.ts +1 -1
- package/src/server/serverFns/story/__tests__/label-suggest-fn.test.ts +43 -21
- package/src/server/serverFns/story/kb-general.ts +2 -2
- package/src/server/serverFns/story/story-assoc.ts +14 -3
- package/src/server/serverFns/story/story-attachments.ts +2 -1
- package/src/server/serverFns/story/story-children.ts +1 -1
- package/src/server/serverFns/story/story-comments.ts +4 -1
- package/src/server/serverFns/story/story-crud/activities.ts +1 -1
- package/src/server/serverFns/story/story-crud/archive.ts +2 -1
- package/src/server/serverFns/story/story-crud/bulk.ts +4 -1
- package/src/server/serverFns/story/story-crud/detail.ts +2 -1
- package/src/server/serverFns/story/story-crud/label-suggest-core.ts +15 -6
- package/src/server/serverFns/story/story-crud/label-upsert.ts +1 -1
- package/src/server/serverFns/story/story-crud/labels.ts +3 -1
- package/src/server/serverFns/story/story-crud.ts +6 -1
- package/src/server/serverFns/story/story-dependencies.ts +4 -1
- package/src/server/serverFns/story/story-groups.ts +4 -1
- package/src/server/serverFns/story/story-links.ts +4 -1
- package/src/server/serverFns/story/story-reactions.ts +4 -1
- package/src/server/serverFns/story/story-search.ts +2 -1
- package/src/server/serverFns/story/story-transfer.ts +7 -2
- package/src/server/serverFns/story/story-tree.ts +5 -1
- package/src/server/serverFns/story/types.ts +2 -1
- package/src/server/serverFns/story-display-options.ts +3 -1
- package/src/server/serverFns/story-view.ts +5 -1
- package/src/server/serverFns/team.ts +19 -1
- package/src/server/serverFns/translation.ts +7 -7
- package/src/server/serverFns/user/avatar.ts +1 -1
- package/src/server/serverFns/user/settings.ts +1 -1
- package/src/server/serverFns/user/update-locale.ts +1 -1
- package/src/server/serverFns/web-search.ts +20 -4
- package/src/server/serverFns/workspace-kb.ts +9 -1
- package/src/server/serverFns/workspace.ts +16 -1
- package/src/start.ts +4 -0
- package/src/styles/globals.css +124 -84
- package/vite.shared.ts +23 -1
- package/src/components/ai/global-chat-panel.tsx +0 -137
- package/src/components/chat/__tests__/ai-conversation.test.tsx +0 -79
- package/src/components/chat/ai-conversation.tsx +0 -332
- package/src/components/chat/ai-message/hooks/use-streaming-text.ts +0 -73
- package/src/components/chat/ai-message/index.tsx +0 -128
- package/src/components/chat/chat-thread-page.tsx +0 -164
- package/src/components/chat/interrupt-approval.tsx +0 -120
- package/src/components/devtools/ai-chat-panel.tsx +0 -54
- package/src/components/devtools/devtools-panel.tsx +0 -100
- package/src/components/devtools/session-panel.tsx +0 -102
- package/src/components/ui/sonner.tsx +0 -37
- package/src/paraglide/messages/chat_systemprompt1.js +0 -30
- package/src/paraglide/messages/common_nav_chat.js +0 -29
- package/src/paraglide/messages/en.js +0 -17242
- package/src/paraglide/messages/zh.js +0 -17240
- package/src/routes/_nav/agents/route.tsx +0 -12
- package/src/routes/_nav/chat/route.lazy.tsx +0 -427
- /package/src/components/{chat → ai}/ai-prompt-input/components/context-badge.tsx +0 -0
- /package/src/components/{chat → ai}/ai-prompt-input/constants.tsx +0 -0
- /package/src/components/{chat → ai}/ai-prompt-input/types.ts +0 -0
- /package/src/components/{chat → ai}/ai-prompt-input.tsx +0 -0
- /package/src/components/{chat → harness}/ai-chat-history/components/conversation-header.tsx +0 -0
- /package/src/components/{chat → harness}/ai-chat-history/components/conversation-search.tsx +0 -0
- /package/src/components/{chat → harness}/ai-chat-history/components/empty-state.tsx +0 -0
- /package/src/components/{chat → harness}/ai-chat-history/utils/group-conversations.ts +0 -0
- /package/src/components/{chat → harness}/ai-chat-history.tsx +0 -0
- /package/src/components/{chat → harness}/ai-citations/components/citation-item.tsx +0 -0
- /package/src/components/{chat → harness}/ai-citations/components/citations-list.tsx +0 -0
- /package/src/components/{chat → harness}/ai-citations/components/inline-citation.tsx +0 -0
- /package/src/components/{chat → harness}/ai-citations/components/source-components.tsx +0 -0
- /package/src/components/{chat → harness}/ai-citations/index.tsx +0 -0
- /package/src/components/{chat → harness}/ai-citations/types.ts +0 -0
- /package/src/components/{chat → harness}/ai-citations/utils.ts +0 -0
- /package/src/components/{chat → harness}/ai-citations.tsx +0 -0
- /package/src/components/{chat → harness}/ai-message/components/code-block.tsx +0 -0
- /package/src/components/{chat → harness}/ai-message/components/markdown-content.tsx +0 -0
- /package/src/components/{chat → harness}/ai-message/components/streaming-indicator.tsx +0 -0
- /package/src/components/{chat → harness}/ai-message/utils/dom-utils.ts +0 -0
- /package/src/components/{chat → harness}/ai-thinking.tsx +0 -0
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
import { createServerFn } from "@tanstack/react-start";
|
|
19
19
|
import { getRequest } from "@tanstack/react-start/server";
|
|
20
20
|
import { z } from "zod";
|
|
21
|
-
import { prisma } from "@allbluecn/database";
|
|
22
21
|
import { requireAuth } from "@/server/auth-helpers";
|
|
23
22
|
import { ACTIVITY_SELECT, toActivityItem } from "./types";
|
|
24
23
|
export const addLinkFn = createServerFn({ method: "POST" })
|
|
25
24
|
.validator(z.object({ storyId: z.string(), url: z.string().url(), title: z.string().optional(), description: z.string().optional() }))
|
|
26
25
|
.handler(async ({ data }) => {
|
|
26
|
+
const { prisma } = await import('@allbluecn/database')
|
|
27
27
|
const request = getRequest();
|
|
28
28
|
const session = await requireAuth(request);
|
|
29
29
|
const userId = session.user!.id!;
|
|
@@ -53,6 +53,7 @@ export const addLinkFn = createServerFn({ method: "POST" })
|
|
|
53
53
|
export const updateLinkFn = createServerFn({ method: "POST" })
|
|
54
54
|
.validator(z.object({ linkId: z.string(), url: z.string().url().optional(), title: z.string().optional(), description: z.string().optional() }))
|
|
55
55
|
.handler(async ({ data }) => {
|
|
56
|
+
const { prisma } = await import('@allbluecn/database')
|
|
56
57
|
const request = getRequest();
|
|
57
58
|
const session = await requireAuth(request);
|
|
58
59
|
const userId = session.user!.id!;
|
|
@@ -82,6 +83,7 @@ export const updateLinkFn = createServerFn({ method: "POST" })
|
|
|
82
83
|
export const removeLinkFn = createServerFn({ method: "POST" })
|
|
83
84
|
.validator(z.object({ linkId: z.string() }))
|
|
84
85
|
.handler(async ({ data }) => {
|
|
86
|
+
const { prisma } = await import('@allbluecn/database')
|
|
85
87
|
const request = getRequest();
|
|
86
88
|
const session = await requireAuth(request);
|
|
87
89
|
const userId = session.user!.id!;
|
|
@@ -109,6 +111,7 @@ export const removeLinkFn = createServerFn({ method: "POST" })
|
|
|
109
111
|
export const getLinksFn = createServerFn({ method: "GET" })
|
|
110
112
|
.validator(z.object({ storyId: z.string() }))
|
|
111
113
|
.handler(async ({ data }) => {
|
|
114
|
+
const { prisma } = await import('@allbluecn/database')
|
|
112
115
|
const request = getRequest();
|
|
113
116
|
const session = await requireAuth(request);
|
|
114
117
|
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
import { createServerFn } from "@tanstack/react-start";
|
|
19
19
|
import { getRequest } from "@tanstack/react-start/server";
|
|
20
20
|
import { z } from "zod";
|
|
21
|
-
import { prisma } from "@allbluecn/database";
|
|
22
21
|
import { requireAuth } from "@/server/auth-helpers";
|
|
23
22
|
import { aggregateReactions } from "./types";
|
|
24
23
|
|
|
25
24
|
export const listStoryReactionsFn = createServerFn({ method: "GET" })
|
|
26
25
|
.validator(z.object({ storyId: z.string() }))
|
|
27
26
|
.handler(async ({ data }) => {
|
|
27
|
+
const { prisma } = await import('@allbluecn/database')
|
|
28
28
|
const request = getRequest();
|
|
29
29
|
const session = await requireAuth(request);
|
|
30
30
|
const userId = session.user!.id!;
|
|
@@ -40,6 +40,7 @@ export const listStoryReactionsFn = createServerFn({ method: "GET" })
|
|
|
40
40
|
export const addStoryReactionFn = createServerFn({ method: "POST" })
|
|
41
41
|
.validator(z.object({ storyId: z.string(), emoji: z.string().min(1) }))
|
|
42
42
|
.handler(async ({ data }) => {
|
|
43
|
+
const { prisma } = await import('@allbluecn/database')
|
|
43
44
|
const request = getRequest();
|
|
44
45
|
const session = await requireAuth(request);
|
|
45
46
|
const userId = session.user!.id!;
|
|
@@ -71,6 +72,7 @@ export const addStoryReactionFn = createServerFn({ method: "POST" })
|
|
|
71
72
|
export const toggleStoryReactionFn = createServerFn({ method: "POST" })
|
|
72
73
|
.validator(z.object({ storyId: z.string(), emoji: z.string().min(1) }))
|
|
73
74
|
.handler(async ({ data }) => {
|
|
75
|
+
const { prisma } = await import('@allbluecn/database')
|
|
74
76
|
const request = getRequest();
|
|
75
77
|
const session = await requireAuth(request);
|
|
76
78
|
const userId = session.user!.id!;
|
|
@@ -104,6 +106,7 @@ export const toggleStoryReactionFn = createServerFn({ method: "POST" })
|
|
|
104
106
|
export const toggleCommentReactionFn = createServerFn({ method: "POST" })
|
|
105
107
|
.validator(z.object({ commentId: z.string(), emoji: z.string().min(1) }))
|
|
106
108
|
.handler(async ({ data }) => {
|
|
109
|
+
const { prisma } = await import('@allbluecn/database')
|
|
107
110
|
const request = getRequest();
|
|
108
111
|
const session = await requireAuth(request);
|
|
109
112
|
const userId = session.user!.id!;
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
import { createServerFn } from "@tanstack/react-start";
|
|
19
19
|
import { getRequest } from "@tanstack/react-start/server";
|
|
20
20
|
import { z } from "zod";
|
|
21
|
-
import { prisma } from "@allbluecn/database";
|
|
22
21
|
import { requireAuth } from "@/server/auth-helpers";
|
|
23
22
|
import { ensureBuiltinIndependentProject } from "@/server/builtin-project";
|
|
24
23
|
|
|
25
24
|
export const searchStoriesFn = createServerFn({ method: "GET" })
|
|
26
25
|
.validator(z.object({ query: z.string(), excludeIds: z.array(z.string()).optional() }))
|
|
27
26
|
.handler(async ({ data }) => {
|
|
27
|
+
const { prisma } = await import('@allbluecn/database')
|
|
28
28
|
const request = getRequest();
|
|
29
29
|
const session = await requireAuth(request);
|
|
30
30
|
const userId = session.user!.id!;
|
|
@@ -62,6 +62,7 @@ const reorderStoriesSchema = z.object({
|
|
|
62
62
|
export const reorderStoriesFn = createServerFn({ method: "POST" })
|
|
63
63
|
.validator(reorderStoriesSchema)
|
|
64
64
|
.handler(async ({ data }) => {
|
|
65
|
+
const { prisma } = await import('@allbluecn/database')
|
|
65
66
|
const request = getRequest();
|
|
66
67
|
await requireAuth(request);
|
|
67
68
|
|
|
@@ -19,14 +19,14 @@ import { createServerFn } from "@tanstack/react-start";
|
|
|
19
19
|
import { getRequest } from "@tanstack/react-start/server";
|
|
20
20
|
import { z } from "zod";
|
|
21
21
|
import type { Prisma } from "@allbluecn/database";
|
|
22
|
-
import { prisma } from "@allbluecn/database";
|
|
23
22
|
import { requireAuth } from "@/server/auth-helpers";
|
|
24
23
|
import { BUILTIN_INDEPENDENT_DISPLAY_ID } from "@/lib/builtin-project";
|
|
25
24
|
import { STORY_LIST_SELECT, castStoryUsers, castUserBrief, USER_BRIEF_SELECT, checkDescendant } from "./types";
|
|
26
25
|
|
|
27
|
-
type StoryTx = Parameters<Parameters<typeof prisma.$transaction>[0]>[0];
|
|
26
|
+
type StoryTx = Parameters<Parameters<typeof import("@allbluecn/database").prisma.$transaction>[0]>[0];
|
|
28
27
|
|
|
29
28
|
async function collectDescendantIds(storyId: string): Promise<Set<string>> {
|
|
29
|
+
const { prisma } = await import("@allbluecn/database");
|
|
30
30
|
const ids = new Set<string>();
|
|
31
31
|
async function dfs(id: string) {
|
|
32
32
|
const children = await prisma.story.findMany({
|
|
@@ -45,6 +45,7 @@ async function collectDescendantIds(storyId: string): Promise<Set<string>> {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
async function collectAncestorIds(storyId: string): Promise<Set<string>> {
|
|
48
|
+
const { prisma } = await import("@allbluecn/database");
|
|
48
49
|
const ids = new Set<string>();
|
|
49
50
|
async function dfs(id: string) {
|
|
50
51
|
const story = await prisma.story.findUnique({
|
|
@@ -98,6 +99,7 @@ async function runTransferWithIdentifierRetry<T>(
|
|
|
98
99
|
const MAX_RETRIES = 5;
|
|
99
100
|
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|
|
100
101
|
try {
|
|
102
|
+
const { prisma } = await import("@allbluecn/database");
|
|
101
103
|
return await prisma.$transaction(handler);
|
|
102
104
|
} catch (e: unknown) {
|
|
103
105
|
const isUniqueViolation =
|
|
@@ -121,6 +123,7 @@ const transferToProjectSchema = z.object({
|
|
|
121
123
|
export const transferStoryToProjectFn = createServerFn({ method: "POST" })
|
|
122
124
|
.validator(transferToProjectSchema)
|
|
123
125
|
.handler(async ({ data }) => {
|
|
126
|
+
const { prisma } = await import('@allbluecn/database')
|
|
124
127
|
const request = getRequest();
|
|
125
128
|
const session = await requireAuth(request);
|
|
126
129
|
const userId = session.user!.id!;
|
|
@@ -203,6 +206,7 @@ const transferAsChildSchema = z.object({
|
|
|
203
206
|
export const transferStoryAsChildFn = createServerFn({ method: "POST" })
|
|
204
207
|
.validator(transferAsChildSchema)
|
|
205
208
|
.handler(async ({ data }) => {
|
|
209
|
+
const { prisma } = await import('@allbluecn/database')
|
|
206
210
|
const request = getRequest();
|
|
207
211
|
const session = await requireAuth(request);
|
|
208
212
|
const userId = session.user!.id!;
|
|
@@ -357,6 +361,7 @@ const listProjectStoriesSchema = z.object({
|
|
|
357
361
|
export const listProjectStoriesFn = createServerFn({ method: "GET" })
|
|
358
362
|
.validator(listProjectStoriesSchema)
|
|
359
363
|
.handler(async ({ data }) => {
|
|
364
|
+
const { prisma } = await import('@allbluecn/database')
|
|
360
365
|
const request = getRequest();
|
|
361
366
|
await requireAuth(request);
|
|
362
367
|
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
import { createServerFn } from "@tanstack/react-start";
|
|
19
19
|
import { getRequest } from "@tanstack/react-start/server";
|
|
20
20
|
import { z } from "zod";
|
|
21
|
-
import { prisma } from "@allbluecn/database";
|
|
22
21
|
import { requireAuth } from "@/server/auth-helpers";
|
|
23
22
|
import { buildStoryTree, checkDescendant } from "./types";
|
|
24
23
|
|
|
25
24
|
export const getStoryTreeFn = createServerFn({ method: "GET" })
|
|
26
25
|
.validator(z.object({ rootId: z.string().optional() }))
|
|
27
26
|
.handler(async ({ data }) => {
|
|
27
|
+
const { prisma } = await import('@allbluecn/database')
|
|
28
28
|
const request = getRequest();
|
|
29
29
|
await requireAuth(request);
|
|
30
30
|
|
|
@@ -53,6 +53,7 @@ export const getStoryTreeFn = createServerFn({ method: "GET" })
|
|
|
53
53
|
export const addChildFn = createServerFn({ method: "POST" })
|
|
54
54
|
.validator(z.object({ parentId: z.string(), childId: z.string() }))
|
|
55
55
|
.handler(async ({ data }) => {
|
|
56
|
+
const { prisma } = await import('@allbluecn/database')
|
|
56
57
|
const request = getRequest();
|
|
57
58
|
const session = await requireAuth(request);
|
|
58
59
|
const userId = session.user!.id!;
|
|
@@ -106,6 +107,7 @@ export const addChildFn = createServerFn({ method: "POST" })
|
|
|
106
107
|
export const removeChildFn = createServerFn({ method: "POST" })
|
|
107
108
|
.validator(z.object({ childId: z.string() }))
|
|
108
109
|
.handler(async ({ data }) => {
|
|
110
|
+
const { prisma } = await import('@allbluecn/database')
|
|
109
111
|
const request = getRequest();
|
|
110
112
|
await requireAuth(request);
|
|
111
113
|
|
|
@@ -120,6 +122,7 @@ export const removeChildFn = createServerFn({ method: "POST" })
|
|
|
120
122
|
export const moveChildFn = createServerFn({ method: "POST" })
|
|
121
123
|
.validator(z.object({ childId: z.string(), newParentId: z.string() }))
|
|
122
124
|
.handler(async ({ data }) => {
|
|
125
|
+
const { prisma } = await import('@allbluecn/database')
|
|
123
126
|
const request = getRequest();
|
|
124
127
|
await requireAuth(request);
|
|
125
128
|
|
|
@@ -139,6 +142,7 @@ export const moveChildFn = createServerFn({ method: "POST" })
|
|
|
139
142
|
export const getChildrenCountFn = createServerFn({ method: "GET" })
|
|
140
143
|
.validator(z.object({ parentId: z.string() }))
|
|
141
144
|
.handler(async ({ data }) => {
|
|
145
|
+
const { prisma } = await import('@allbluecn/database')
|
|
142
146
|
const request = getRequest();
|
|
143
147
|
await requireAuth(request);
|
|
144
148
|
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
// You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import type { Prisma } from "@allbluecn/database";
|
|
19
|
+
import { prisma } from "@allbluecn/database";
|
|
19
20
|
import type { AvatarConfig } from "@allbluecn/kernel";
|
|
20
21
|
import type { StoryState, StoryPriority } from "@/components/story/constants";
|
|
21
22
|
import type {
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
import { createServerFn } from "@tanstack/react-start"
|
|
20
20
|
import { getRequest } from "@tanstack/react-start/server"
|
|
21
21
|
import { z } from "zod"
|
|
22
|
-
import { prisma, type Prisma } from "@allbluecn/database"
|
|
23
22
|
import { requireAuth } from "@/server/auth-helpers"
|
|
24
23
|
import { requireFeature } from "@/server/entitlements"
|
|
25
24
|
import { isProEdition } from "@/server/pro-services"
|
|
25
|
+
import type { Prisma } from "@allbluecn/database";
|
|
26
26
|
import {
|
|
27
27
|
DEFAULT_DISPLAY_OPTIONS,
|
|
28
28
|
GROUP_KEYS,
|
|
@@ -113,6 +113,7 @@ export const displayOptionsSchema = z.object({
|
|
|
113
113
|
/** 获取当前用户持久化的 Display Options(非法/缺失字段已回退默认值) */
|
|
114
114
|
export const getStoryDisplayOptionsFn = createServerFn({ method: "GET" }).handler(
|
|
115
115
|
async () => {
|
|
116
|
+
const { prisma } = await import('@allbluecn/database')
|
|
116
117
|
const request = getRequest()
|
|
117
118
|
const session = await requireAuth(request)
|
|
118
119
|
const userId = session.user!.id!
|
|
@@ -144,6 +145,7 @@ export const getStoryDisplayOptionsFn = createServerFn({ method: "GET" }).handle
|
|
|
144
145
|
export const updateStoryDisplayOptionsFn = createServerFn({ method: "POST" })
|
|
145
146
|
.validator(displayOptionsSchema)
|
|
146
147
|
.handler(async ({ data }) => {
|
|
148
|
+
const { prisma } = await import('@allbluecn/database')
|
|
147
149
|
const request = getRequest()
|
|
148
150
|
const session = await requireAuth(request)
|
|
149
151
|
const userId = session.user!.id!
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
import { createServerFn } from "@tanstack/react-start";
|
|
19
19
|
import { getRequest } from "@tanstack/react-start/server";
|
|
20
20
|
import { z } from "zod";
|
|
21
|
-
import { prisma, Prisma } from "@allbluecn/database";
|
|
22
21
|
import { requireAuth } from "@/server/auth-helpers";
|
|
23
22
|
import { toSavedView, type SavedView } from "@/components/story/views/view-types";
|
|
24
23
|
import type { FilterCondition } from "@/components/story/filters/filter-types";
|
|
25
24
|
import type { DisplayOptions } from "@/components/story/display/types";
|
|
25
|
+
import type { Prisma } from "@allbluecn/database";
|
|
26
26
|
|
|
27
27
|
function toJson<T>(value: T): Prisma.InputJsonValue {
|
|
28
28
|
return value as unknown as Prisma.InputJsonValue;
|
|
@@ -43,6 +43,7 @@ const SELECT = {
|
|
|
43
43
|
} satisfies Prisma.StoryFilterViewDefaultArgs["select"];
|
|
44
44
|
|
|
45
45
|
export const listStoryViewsFn = createServerFn({ method: "GET" }).handler(async () => {
|
|
46
|
+
const { prisma } = await import('@allbluecn/database')
|
|
46
47
|
const request = getRequest();
|
|
47
48
|
const session = await requireAuth(request);
|
|
48
49
|
const userId = session.user!.id!;
|
|
@@ -73,6 +74,7 @@ const createSchema = z.object({
|
|
|
73
74
|
export const createStoryViewFn = createServerFn({ method: "POST" })
|
|
74
75
|
.validator(createSchema)
|
|
75
76
|
.handler(async ({ data }) => {
|
|
77
|
+
const { prisma } = await import('@allbluecn/database')
|
|
76
78
|
const request = getRequest();
|
|
77
79
|
const session = await requireAuth(request);
|
|
78
80
|
const userId = session.user!.id!;
|
|
@@ -104,6 +106,7 @@ const updateSchema = z.object({
|
|
|
104
106
|
export const updateStoryViewFn = createServerFn({ method: "POST" })
|
|
105
107
|
.validator(updateSchema)
|
|
106
108
|
.handler(async ({ data }) => {
|
|
109
|
+
const { prisma } = await import('@allbluecn/database')
|
|
107
110
|
const request = getRequest();
|
|
108
111
|
const session = await requireAuth(request);
|
|
109
112
|
const userId = session.user!.id!;
|
|
@@ -128,6 +131,7 @@ const deleteSchema = z.object({ id: z.string() });
|
|
|
128
131
|
export const deleteStoryViewFn = createServerFn({ method: "POST" })
|
|
129
132
|
.validator(deleteSchema)
|
|
130
133
|
.handler(async ({ data }) => {
|
|
134
|
+
const { prisma } = await import('@allbluecn/database')
|
|
131
135
|
const request = getRequest();
|
|
132
136
|
const session = await requireAuth(request);
|
|
133
137
|
const userId = session.user!.id!;
|
|
@@ -2,7 +2,6 @@ import { createServerFn } from '@tanstack/react-start'
|
|
|
2
2
|
import { getRequest } from '@tanstack/react-start/server'
|
|
3
3
|
import crypto from 'node:crypto'
|
|
4
4
|
import { z } from 'zod'
|
|
5
|
-
import { prisma } from '@allbluecn/database'
|
|
6
5
|
import { requireAuth } from '@/server/auth-helpers'
|
|
7
6
|
import { requireTeamSeats } from '@/server/resources'
|
|
8
7
|
import { auditLog } from '@/server/audit'
|
|
@@ -30,6 +29,7 @@ const createInvitationSchema = z.object({
|
|
|
30
29
|
export const createTeamInvitationFn = createServerFn({ method: 'POST' })
|
|
31
30
|
.validator(createInvitationSchema)
|
|
32
31
|
.handler(async ({ data }) => {
|
|
32
|
+
const { prisma } = await import('@allbluecn/database')
|
|
33
33
|
const request = getRequest()
|
|
34
34
|
const session = await requireAuth(request)
|
|
35
35
|
const ownerId = session.user!.id!
|
|
@@ -126,6 +126,7 @@ export const createTeamInvitationFn = createServerFn({ method: 'POST' })
|
|
|
126
126
|
})
|
|
127
127
|
|
|
128
128
|
export const listTeamInvitationsFn = createServerFn({ method: 'GET' }).handler(async () => {
|
|
129
|
+
const { prisma } = await import('@allbluecn/database')
|
|
129
130
|
try {
|
|
130
131
|
const request = getRequest()
|
|
131
132
|
const session = await requireAuth(request)
|
|
@@ -184,6 +185,7 @@ const revokeSchema = z.object({ invitationId: z.string() })
|
|
|
184
185
|
export const clearExpiredInvitationsFn = createServerFn({ method: 'POST' })
|
|
185
186
|
.validator(z.object({}))
|
|
186
187
|
.handler(async () => {
|
|
188
|
+
const { prisma } = await import('@allbluecn/database')
|
|
187
189
|
const request = getRequest()
|
|
188
190
|
const session = await requireAuth(request)
|
|
189
191
|
const ownerId = session.user!.id!
|
|
@@ -204,6 +206,7 @@ export const clearExpiredInvitationsFn = createServerFn({ method: 'POST' })
|
|
|
204
206
|
export const revokeTeamInvitationFn = createServerFn({ method: 'POST' })
|
|
205
207
|
.validator(revokeSchema)
|
|
206
208
|
.handler(async ({ data }) => {
|
|
209
|
+
const { prisma } = await import('@allbluecn/database')
|
|
207
210
|
const request = getRequest()
|
|
208
211
|
const session = await requireAuth(request)
|
|
209
212
|
const ownerId = session.user!.id!
|
|
@@ -233,6 +236,7 @@ export const revokeTeamInvitationFn = createServerFn({ method: 'POST' })
|
|
|
233
236
|
export const resendTeamInvitationFn = createServerFn({ method: 'POST' })
|
|
234
237
|
.validator(revokeSchema)
|
|
235
238
|
.handler(async ({ data }) => {
|
|
239
|
+
const { prisma } = await import('@allbluecn/database')
|
|
236
240
|
const request = getRequest()
|
|
237
241
|
const session = await requireAuth(request)
|
|
238
242
|
const ownerId = session.user!.id!
|
|
@@ -276,6 +280,7 @@ export const resendTeamInvitationFn = createServerFn({ method: 'POST' })
|
|
|
276
280
|
export const refreshTeamInvitationLinkFn = createServerFn({ method: 'POST' })
|
|
277
281
|
.validator(z.object({ expiresInDays: z.number().int().min(1).max(365).optional() }))
|
|
278
282
|
.handler(async ({ data }) => {
|
|
283
|
+
const { prisma } = await import('@allbluecn/database')
|
|
279
284
|
const request = getRequest()
|
|
280
285
|
const session = await requireAuth(request)
|
|
281
286
|
const ownerId = session.user!.id!
|
|
@@ -325,6 +330,7 @@ export const refreshTeamInvitationLinkFn = createServerFn({ method: 'POST' })
|
|
|
325
330
|
// ---------- 成员管理 ----------
|
|
326
331
|
|
|
327
332
|
export const listTeamMembersFn = createServerFn({ method: 'GET' }).handler(async () => {
|
|
333
|
+
const { prisma } = await import('@allbluecn/database')
|
|
328
334
|
const request = getRequest()
|
|
329
335
|
const session = await requireAuth(request)
|
|
330
336
|
const ownerId = session.user!.id!
|
|
@@ -370,6 +376,7 @@ const removeMemberSchema = z.object({ membershipId: z.string() })
|
|
|
370
376
|
export const removeTeamMemberFn = createServerFn({ method: 'POST' })
|
|
371
377
|
.validator(removeMemberSchema)
|
|
372
378
|
.handler(async ({ data }) => {
|
|
379
|
+
const { prisma } = await import('@allbluecn/database')
|
|
373
380
|
const request = getRequest()
|
|
374
381
|
const session = await requireAuth(request)
|
|
375
382
|
const ownerId = session.user!.id!
|
|
@@ -391,6 +398,7 @@ export const removeTeamMemberFn = createServerFn({ method: 'POST' })
|
|
|
391
398
|
})
|
|
392
399
|
|
|
393
400
|
export const leaveTeamFn = createServerFn({ method: 'POST' }).validator(z.object({})).handler(async () => {
|
|
401
|
+
const { prisma } = await import('@allbluecn/database')
|
|
394
402
|
const request = getRequest()
|
|
395
403
|
const session = await requireAuth(request)
|
|
396
404
|
const userId = session.user!.id!
|
|
@@ -420,6 +428,7 @@ const approveJoinRequestSchema = z.object({
|
|
|
420
428
|
export const approveTeamJoinRequestFn = createServerFn({ method: 'POST' })
|
|
421
429
|
.validator(approveJoinRequestSchema)
|
|
422
430
|
.handler(async ({ data }) => {
|
|
431
|
+
const { prisma } = await import('@allbluecn/database')
|
|
423
432
|
const request = getRequest()
|
|
424
433
|
const session = await requireAuth(request)
|
|
425
434
|
const ownerId = session.user!.id!
|
|
@@ -485,6 +494,7 @@ export const approveTeamJoinRequestFn = createServerFn({ method: 'POST' })
|
|
|
485
494
|
export const rejectTeamJoinRequestFn = createServerFn({ method: 'POST' })
|
|
486
495
|
.validator(joinRequestSchema)
|
|
487
496
|
.handler(async ({ data }) => {
|
|
497
|
+
const { prisma } = await import('@allbluecn/database')
|
|
488
498
|
const request = getRequest()
|
|
489
499
|
const session = await requireAuth(request)
|
|
490
500
|
const ownerId = session.user!.id!
|
|
@@ -512,6 +522,7 @@ export const rejectTeamJoinRequestFn = createServerFn({ method: 'POST' })
|
|
|
512
522
|
export const deleteTeamInvitationFn = createServerFn({ method: 'POST' })
|
|
513
523
|
.validator(revokeSchema)
|
|
514
524
|
.handler(async ({ data }) => {
|
|
525
|
+
const { prisma } = await import('@allbluecn/database')
|
|
515
526
|
const request = getRequest()
|
|
516
527
|
const session = await requireAuth(request)
|
|
517
528
|
const ownerId = session.user!.id!
|
|
@@ -537,6 +548,7 @@ export const deleteTeamInvitationFn = createServerFn({ method: 'POST' })
|
|
|
537
548
|
export const deleteTeamJoinRequestFn = createServerFn({ method: 'POST' })
|
|
538
549
|
.validator(joinRequestSchema)
|
|
539
550
|
.handler(async ({ data }) => {
|
|
551
|
+
const { prisma } = await import('@allbluecn/database')
|
|
540
552
|
const request = getRequest()
|
|
541
553
|
const session = await requireAuth(request)
|
|
542
554
|
const ownerId = session.user!.id!
|
|
@@ -558,6 +570,7 @@ export const deleteTeamJoinRequestFn = createServerFn({ method: 'POST' })
|
|
|
558
570
|
})
|
|
559
571
|
|
|
560
572
|
export const listTeamUsersFn = createServerFn({ method: 'GET' }).handler(async () => {
|
|
573
|
+
const { prisma } = await import('@allbluecn/database')
|
|
561
574
|
const request = getRequest()
|
|
562
575
|
const session = await requireAuth(request)
|
|
563
576
|
const userId = session.user!.id!
|
|
@@ -585,6 +598,7 @@ const tokenSchema = z.object({
|
|
|
585
598
|
export const getTeamInvitationByTokenFn = createServerFn({ method: 'GET' })
|
|
586
599
|
.validator(tokenSchema)
|
|
587
600
|
.handler(async ({ data }) => {
|
|
601
|
+
const { prisma } = await import('@allbluecn/database')
|
|
588
602
|
const inv = await prisma.teamInvitation.findUnique({
|
|
589
603
|
where: { token: data.token },
|
|
590
604
|
select: { status: true, expiresAt: true, seatType: true, channel: true, email: true, id: true, ownerId: true, owner: { select: OWNER_SELECT }, acceptedBy: true, applicantEmail: true },
|
|
@@ -661,6 +675,7 @@ export const getTeamInvitationByTokenFn = createServerFn({ method: 'GET' })
|
|
|
661
675
|
export const checkInviteEmailRegisteredFn = createServerFn({ method: 'POST' })
|
|
662
676
|
.validator(z.object({ email: z.string().email() }))
|
|
663
677
|
.handler(async ({ data }) => {
|
|
678
|
+
const { prisma } = await import('@allbluecn/database')
|
|
664
679
|
const user = await prisma.user.findUnique({
|
|
665
680
|
where: { email: data.email.toLowerCase() },
|
|
666
681
|
select: { id: true },
|
|
@@ -671,6 +686,7 @@ export const checkInviteEmailRegisteredFn = createServerFn({ method: 'POST' })
|
|
|
671
686
|
export const applyTeamInvitationFn = createServerFn({ method: 'POST' })
|
|
672
687
|
.validator(z.object({ token: z.string(), email: z.string().email() }))
|
|
673
688
|
.handler(async ({ data }) => {
|
|
689
|
+
const { prisma } = await import('@allbluecn/database')
|
|
674
690
|
const inv = await prisma.teamInvitation.findUnique({
|
|
675
691
|
where: { token: data.token },
|
|
676
692
|
include: { owner: { select: { id: true, email: true } } },
|
|
@@ -753,6 +769,7 @@ export const applyTeamInvitationFn = createServerFn({ method: 'POST' })
|
|
|
753
769
|
export const acceptTeamInvitationFn = createServerFn({ method: 'POST' })
|
|
754
770
|
.validator(tokenSchema)
|
|
755
771
|
.handler(async ({ data }) => {
|
|
772
|
+
const { prisma } = await import('@allbluecn/database')
|
|
756
773
|
const request = getRequest()
|
|
757
774
|
const session = await requireAuth(request)
|
|
758
775
|
const userId = session.user!.id!
|
|
@@ -820,6 +837,7 @@ const approveSchema = z.object({
|
|
|
820
837
|
export const approveTeamInvitationFn = createServerFn({ method: 'POST' })
|
|
821
838
|
.validator(approveSchema)
|
|
822
839
|
.handler(async ({ data }) => {
|
|
840
|
+
const { prisma } = await import('@allbluecn/database')
|
|
823
841
|
const request = getRequest()
|
|
824
842
|
const session = await requireAuth(request)
|
|
825
843
|
const ownerId = session.user!.id!
|
|
@@ -19,7 +19,8 @@ import { createServerFn } from '@tanstack/react-start'
|
|
|
19
19
|
import { getRequest } from '@tanstack/react-start/server'
|
|
20
20
|
import { z } from 'zod'
|
|
21
21
|
import { requireAuth } from '@/server/auth-helpers'
|
|
22
|
-
import { hasAiKey
|
|
22
|
+
import { hasAiKey } from "@/server/ai-gateway/adapter"
|
|
23
|
+
import { runChatAsAgent } from "@/server/ai-gateway/runs/agent-runtime"
|
|
23
24
|
|
|
24
25
|
const schema = z.object({
|
|
25
26
|
text: z.string().min(1).max(5000),
|
|
@@ -35,15 +36,14 @@ export const translateFn = createServerFn({ method: 'POST' })
|
|
|
35
36
|
const userId = session.user!.id!
|
|
36
37
|
if (!(await hasAiKey(userId))) throw new Error('AI 未配置')
|
|
37
38
|
|
|
38
|
-
const translated = await
|
|
39
|
+
const translated = await runChatAsAgent(
|
|
40
|
+
'translation.run',
|
|
39
41
|
[{ role: 'user', content: data.text }],
|
|
40
42
|
{
|
|
41
|
-
systemPrompts: [
|
|
42
|
-
`Translate from ${data.from} to ${data.to}. Output only the translation, no explanations, no quotes, no markdown.`,
|
|
43
|
-
],
|
|
44
|
-
modelOptions: { temperature: 0.3 },
|
|
45
43
|
userId,
|
|
46
|
-
|
|
44
|
+
temperature: 0.3,
|
|
45
|
+
promptVars: { from: data.from, to: data.to },
|
|
46
|
+
},
|
|
47
47
|
)
|
|
48
48
|
|
|
49
49
|
return { translated: translated.trim() }
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
import { createServerFn } from '@tanstack/react-start'
|
|
19
19
|
import { getRequest } from '@tanstack/react-start/server'
|
|
20
20
|
import { z } from 'zod'
|
|
21
|
-
import { prisma } from '@allbluecn/database'
|
|
22
21
|
import { requireAuth } from '@/server/auth-helpers'
|
|
23
22
|
|
|
24
23
|
const schema = z.object({
|
|
@@ -30,6 +29,7 @@ const schema = z.object({
|
|
|
30
29
|
export const updateAvatarFn = createServerFn({ method: 'POST' })
|
|
31
30
|
.validator(schema)
|
|
32
31
|
.handler(async ({ data }) => {
|
|
32
|
+
const { prisma } = await import('@allbluecn/database')
|
|
33
33
|
const request = getRequest()
|
|
34
34
|
const session = await requireAuth(request)
|
|
35
35
|
const user = await prisma.user.update({
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
import { createServerFn } from '@tanstack/react-start'
|
|
19
19
|
import { getRequest } from '@tanstack/react-start/server'
|
|
20
20
|
import { z } from 'zod'
|
|
21
|
-
import { prisma } from '@allbluecn/database'
|
|
22
21
|
import { requireAuth } from '@/server/auth-helpers'
|
|
23
22
|
|
|
24
23
|
const updateTimezoneSchema = z.object({
|
|
@@ -28,6 +27,7 @@ const updateTimezoneSchema = z.object({
|
|
|
28
27
|
export const updateUserTimezoneFn = createServerFn({ method: 'POST' })
|
|
29
28
|
.validator(updateTimezoneSchema)
|
|
30
29
|
.handler(async ({ data }) => {
|
|
30
|
+
const { prisma } = await import('@allbluecn/database')
|
|
31
31
|
const request = getRequest()
|
|
32
32
|
const session = await requireAuth(request)
|
|
33
33
|
await prisma.user.update({
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
2
|
import { createServerFn } from '@tanstack/react-start'
|
|
3
3
|
import { z } from 'zod'
|
|
4
|
-
import { prisma } from '@allbluecn/database'
|
|
5
4
|
import { requireAuth } from '@/server/auth-helpers'
|
|
6
5
|
import { getRequest } from '@tanstack/react-start/server'
|
|
7
6
|
|
|
8
7
|
export const updateLocaleFn = createServerFn({ method: 'POST' })
|
|
9
8
|
.validator(z.object({ locale: z.enum(['zh', 'en']) }))
|
|
10
9
|
.handler(async ({ data }) => {
|
|
10
|
+
const { prisma } = await import('@allbluecn/database')
|
|
11
11
|
const request = getRequest()
|
|
12
12
|
const session = await requireAuth(request)
|
|
13
13
|
await prisma.user.update({
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
// You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
|
|
18
|
-
const SEARXNG_BASE_URL = process.env.SEARXNG_BASE_URL || "http://localhost:8080"
|
|
19
|
-
|
|
20
18
|
export type SearchResult = {
|
|
21
19
|
title: string
|
|
22
20
|
url: string
|
|
@@ -31,8 +29,26 @@ export type SearchResponse = {
|
|
|
31
29
|
suggestions: string[]
|
|
32
30
|
}
|
|
33
31
|
|
|
32
|
+
/**
|
|
33
|
+
* SearXNG 未配置时快速失败,避免每次时间敏感搜索白等超时。
|
|
34
|
+
* Vercel 生产默认未部署 SearXNG,靠原生 provider 搜索兜底。
|
|
35
|
+
*/
|
|
36
|
+
export function isSearxngEnabled(): boolean {
|
|
37
|
+
return Boolean(process.env.SEARXNG_BASE_URL)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class SearxngDisabledError extends Error {
|
|
41
|
+
constructor() {
|
|
42
|
+
super("SearXNG not configured")
|
|
43
|
+
this.name = "SearxngDisabledError"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
34
47
|
export async function searchWeb(query: string, limit = 8): Promise<SearchResponse> {
|
|
35
|
-
const
|
|
48
|
+
const baseUrl = process.env.SEARXNG_BASE_URL
|
|
49
|
+
if (!baseUrl) throw new SearxngDisabledError()
|
|
50
|
+
|
|
51
|
+
const url = new URL(`${baseUrl}/search`)
|
|
36
52
|
url.searchParams.set("format", "json")
|
|
37
53
|
url.searchParams.set("q", query)
|
|
38
54
|
url.searchParams.set("language", "zh-CN")
|
|
@@ -40,7 +56,7 @@ export async function searchWeb(query: string, limit = 8): Promise<SearchRespons
|
|
|
40
56
|
url.searchParams.set("pageno", "1")
|
|
41
57
|
|
|
42
58
|
const res = await fetch(url.toString(), {
|
|
43
|
-
signal: AbortSignal.timeout(
|
|
59
|
+
signal: AbortSignal.timeout(8000),
|
|
44
60
|
headers: { Accept: "application/json" },
|
|
45
61
|
})
|
|
46
62
|
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
import { z } from "zod";
|
|
21
21
|
import { createServerFn } from "@tanstack/react-start";
|
|
22
22
|
import { getRequest } from "@tanstack/react-start/server";
|
|
23
|
-
import { prisma } from "@allbluecn/database";
|
|
24
23
|
import { requireAuth } from "@/server/auth-helpers";
|
|
25
24
|
import { GENERAL_GROUP_TABLES, GENERAL_GROUPS, type GeneralGroup } from "./story/kb-general";
|
|
26
25
|
import type { QuickDocRow, WorkspaceKbCardData, QuickDocItem } from "./workspace-kb-utils";
|
|
@@ -35,6 +34,7 @@ import { quickDocItemSchema, quickDocItemKey, QUICK_DOC_COLUMNS } from "./worksp
|
|
|
35
34
|
|
|
36
35
|
/** owner 或 active 成员可访问 */
|
|
37
36
|
async function requireWorkspaceMember(workspaceId: string, userId: string) {
|
|
37
|
+
const { prisma } = await import("@allbluecn/database");
|
|
38
38
|
const ws = await prisma.workspace.findUnique({
|
|
39
39
|
where: { id: workspaceId },
|
|
40
40
|
select: { ownerId: true, members: { where: { userId, status: "active" }, select: { id: true } } },
|
|
@@ -46,6 +46,7 @@ async function requireWorkspaceMember(workspaceId: string, userId: string) {
|
|
|
46
46
|
export const getWorkspaceKbCardFn = createServerFn({ method: "GET" })
|
|
47
47
|
.validator(z.object({ workspaceId: z.string() }))
|
|
48
48
|
.handler(async ({ data }): Promise<WorkspaceKbCardData> => {
|
|
49
|
+
const { prisma } = await import('@allbluecn/database')
|
|
49
50
|
const request = getRequest();
|
|
50
51
|
const session = await requireAuth(request);
|
|
51
52
|
const userId = session.user!.id!;
|
|
@@ -134,6 +135,7 @@ export const getWorkspaceKbCardFn = createServerFn({ method: "GET" })
|
|
|
134
135
|
export const listWorkspaceAvailableKbsFn = createServerFn({ method: "GET" })
|
|
135
136
|
.validator(z.object({ workspaceId: z.string() }))
|
|
136
137
|
.handler(async ({ data }) => {
|
|
138
|
+
const { prisma } = await import('@allbluecn/database')
|
|
137
139
|
const request = getRequest();
|
|
138
140
|
const session = await requireAuth(request);
|
|
139
141
|
const userId = session.user!.id!;
|
|
@@ -159,6 +161,7 @@ export const listWorkspaceAvailableKbsFn = createServerFn({ method: "GET" })
|
|
|
159
161
|
export const setWorkspaceKbsFn = createServerFn({ method: "POST" })
|
|
160
162
|
.validator(z.object({ workspaceId: z.string(), kbIds: z.array(z.string()) }))
|
|
161
163
|
.handler(async ({ data }) => {
|
|
164
|
+
const { prisma } = await import('@allbluecn/database')
|
|
162
165
|
const request = getRequest();
|
|
163
166
|
const session = await requireAuth(request);
|
|
164
167
|
await requireWorkspaceMember(data.workspaceId, session.user!.id!);
|
|
@@ -196,6 +199,7 @@ export const searchQuickDocCandidatesFn = createServerFn({ method: "GET" })
|
|
|
196
199
|
}),
|
|
197
200
|
)
|
|
198
201
|
.handler(async ({ data }) => {
|
|
202
|
+
const { prisma } = await import('@allbluecn/database')
|
|
199
203
|
const request = getRequest();
|
|
200
204
|
const session = await requireAuth(request);
|
|
201
205
|
const userId = session.user!.id!;
|
|
@@ -240,6 +244,7 @@ export const searchQuickDocCandidatesFn = createServerFn({ method: "GET" })
|
|
|
240
244
|
export const addQuickDocsFn = createServerFn({ method: "POST" })
|
|
241
245
|
.validator(z.object({ workspaceId: z.string(), items: z.array(quickDocItemSchema).min(1) }))
|
|
242
246
|
.handler(async ({ data }) => {
|
|
247
|
+
const { prisma } = await import('@allbluecn/database')
|
|
243
248
|
const request = getRequest();
|
|
244
249
|
const session = await requireAuth(request);
|
|
245
250
|
const userId = session.user!.id!;
|
|
@@ -337,6 +342,7 @@ export const renameQuickDocFn = createServerFn({ method: "POST" })
|
|
|
337
342
|
}),
|
|
338
343
|
)
|
|
339
344
|
.handler(async ({ data }) => {
|
|
345
|
+
const { prisma } = await import('@allbluecn/database')
|
|
340
346
|
const request = getRequest();
|
|
341
347
|
const session = await requireAuth(request);
|
|
342
348
|
const row = await prisma.workspaceQuickDoc.findUnique({
|
|
@@ -358,6 +364,7 @@ export const renameQuickDocFn = createServerFn({ method: "POST" })
|
|
|
358
364
|
export const removeQuickDocFn = createServerFn({ method: "POST" })
|
|
359
365
|
.validator(z.object({ quickDocId: z.string() }))
|
|
360
366
|
.handler(async ({ data }) => {
|
|
367
|
+
const { prisma } = await import('@allbluecn/database')
|
|
361
368
|
const request = getRequest();
|
|
362
369
|
const session = await requireAuth(request);
|
|
363
370
|
const row = await prisma.workspaceQuickDoc.findUnique({
|
|
@@ -380,6 +387,7 @@ export const reorderQuickDocsFn = createServerFn({ method: "POST" })
|
|
|
380
387
|
}),
|
|
381
388
|
)
|
|
382
389
|
.handler(async ({ data }) => {
|
|
390
|
+
const { prisma } = await import('@allbluecn/database')
|
|
383
391
|
const request = getRequest();
|
|
384
392
|
const session = await requireAuth(request);
|
|
385
393
|
await requireWorkspaceMember(data.workspaceId, session.user!.id!);
|