@promptbook/cli 0.112.0-99 → 0.113.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -44
- package/agents/default/developer.book +24 -0
- package/apps/agents-server/README.md +19 -2
- package/apps/agents-server/env-manual/GITHUB_APP.md +1 -1
- package/apps/agents-server/next.config.ts +41 -1
- package/apps/agents-server/package.json +1 -1
- package/apps/agents-server/playwright.config.ts +3 -0
- package/apps/agents-server/public/promptbook-logo-blue.png +0 -0
- package/apps/agents-server/public/promptbook-logo-white.png +0 -0
- package/apps/agents-server/scripts/prerender-homepage.js +76 -1
- package/apps/agents-server/src/app/AddAgentButton.tsx +0 -5
- package/apps/agents-server/src/app/[agentName]/layout.tsx +1 -0
- package/apps/agents-server/src/app/actions.ts +70 -9
- package/apps/agents-server/src/app/admin/about/page.tsx +1 -1
- package/apps/agents-server/src/app/admin/api-tokens/ApiTokensClient.tsx +4 -1
- package/apps/agents-server/src/app/admin/chat-feedback/ChatFeedbackClient.tsx +3 -0
- package/apps/agents-server/src/app/admin/chat-feedback/ChatFeedbackTable.tsx +13 -8
- package/apps/agents-server/src/app/admin/chat-feedback/page.tsx +2 -4
- package/apps/agents-server/src/app/admin/chat-history/ChatHistoryClient.tsx +3 -0
- package/apps/agents-server/src/app/admin/chat-history/ChatHistoryTable.tsx +13 -8
- package/apps/agents-server/src/app/admin/chat-history/page.tsx +2 -4
- package/apps/agents-server/src/app/admin/cli-access/CliAccessClient.tsx +1 -3
- package/apps/agents-server/src/app/admin/code-runners/CodeRunnersClient.tsx +19 -11
- package/apps/agents-server/src/app/admin/custom-css/CustomCssClient.tsx +4 -0
- package/apps/agents-server/src/app/admin/custom-css/CustomCssEditorPanel.tsx +7 -1
- package/apps/agents-server/src/app/admin/custom-css/CustomCssFilesPanel.tsx +7 -1
- package/apps/agents-server/src/app/admin/custom-js/CustomJsClient.tsx +11 -0
- package/apps/agents-server/src/app/admin/custom-js/CustomJsEditorPanel.tsx +7 -1
- package/apps/agents-server/src/app/admin/custom-js/CustomJsFilesPanel.tsx +7 -1
- package/apps/agents-server/src/app/admin/files/FilesGalleryClient.tsx +4 -0
- package/apps/agents-server/src/app/admin/files/FilesGalleryGrid.tsx +9 -11
- package/apps/agents-server/src/app/admin/files/FilesGalleryTable.tsx +9 -8
- package/apps/agents-server/src/app/admin/image-generator-test/ImageAttachmentsEditor.tsx +30 -9
- package/apps/agents-server/src/app/admin/images/ImagesGalleryClient.tsx +4 -0
- package/apps/agents-server/src/app/admin/images/ImagesGalleryGrid.tsx +16 -11
- package/apps/agents-server/src/app/admin/images/ImagesGalleryTable.tsx +18 -9
- package/apps/agents-server/src/app/admin/limits/LimitsClient.tsx +11 -12
- package/apps/agents-server/src/app/admin/login-methods/shibboleth/page.tsx +355 -0
- package/apps/agents-server/src/app/admin/logs/LogsClient.tsx +9 -3
- package/apps/agents-server/src/app/admin/messages/MessagesClient.tsx +7 -6
- package/apps/agents-server/src/app/admin/metadata/MetadataClient.tsx +671 -45
- package/apps/agents-server/src/app/admin/servers/CreateServerDialog.tsx +22 -1
- package/apps/agents-server/src/app/admin/servers/ServersRegistryTable.tsx +14 -13
- package/apps/agents-server/src/app/admin/servers/useCreateServerWizard.ts +57 -20
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerClient.tsx +4 -2
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +14 -15
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTasksCard.tsx +4 -1
- package/apps/agents-server/src/app/admin/task-manager/useTaskManagerState.ts +6 -9
- package/apps/agents-server/src/app/admin/update/CustomCommitPicker.tsx +258 -0
- package/apps/agents-server/src/app/admin/update/UpdateClient.tsx +627 -137
- package/apps/agents-server/src/app/admin/usage/UsageClient.tsx +4 -2
- package/apps/agents-server/src/app/admin/usage/UsageClientAnalyticsPanels.tsx +6 -4
- package/apps/agents-server/src/app/admin/usage/UsageClientFormatting.ts +6 -12
- package/apps/agents-server/src/app/admin/usage/UsageClientTimelineChart.tsx +7 -4
- package/apps/agents-server/src/app/admin/usage/useUsageClientState.ts +12 -4
- package/apps/agents-server/src/app/admin/users/[userId]/UserDetailClient.tsx +27 -15
- package/apps/agents-server/src/app/agents/[agentName]/ActiveAgentBreadcrumbBinder.tsx +30 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +13 -2
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileChat.tsx +20 -25
- package/apps/agents-server/src/app/agents/[agentName]/_utils.ts +7 -5
- package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +2 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/messages/route.ts +4 -11
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/stream/route.ts +85 -56
- package/apps/agents-server/src/app/agents/[agentName]/book/BookEditorWrapper.tsx +7 -1
- package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorHistory.ts +9 -2
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatHistoryPayloadState.ts +38 -4
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatHistorySyncOperations.ts +4 -1
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatPageLayout.tsx +2 -2
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatSidebarDefault.tsx +19 -13
- package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +30 -16
- package/apps/agents-server/src/app/agents/[agentName]/chat/useAgentChatHistoryClientState.ts +2 -15
- package/apps/agents-server/src/app/agents/[agentName]/chat/useAgentChatHistorySyncEffects.ts +7 -13
- package/apps/agents-server/src/app/agents/[agentName]/chat/useCanonicalAgentChatPanelState.ts +58 -7
- package/apps/agents-server/src/app/agents/[agentName]/history/page.tsx +6 -1
- package/apps/agents-server/src/app/agents/[agentName]/images/default-avatar.png/route.ts +6 -2
- package/apps/agents-server/src/app/agents/[agentName]/integration/CalendarIntegrationSection.tsx +23 -5
- package/apps/agents-server/src/app/agents/[agentName]/layout.tsx +47 -1
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsClient.tsx +4 -2
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsFiltersCard.tsx +9 -4
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableCard.tsx +4 -1
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableRow.tsx +10 -3
- package/apps/agents-server/src/app/api/admin/cli-access/route.ts +27 -123
- package/apps/agents-server/src/app/api/admin/code-runners/authentication/route.ts +33 -125
- package/apps/agents-server/src/app/api/admin/code-runners/route.ts +1 -1
- package/apps/agents-server/src/app/api/admin/servers/route.ts +5 -0
- package/apps/agents-server/src/app/api/admin/update/commits/route.ts +35 -0
- package/apps/agents-server/src/app/api/admin/update/log/route.ts +42 -0
- package/apps/agents-server/src/app/api/admin/update/route.ts +10 -2
- package/apps/agents-server/src/app/api/agent-folders/[folderId]/visibility/route.ts +19 -7
- package/apps/agents-server/src/app/api/agents/[agentName]/route.ts +39 -25
- package/apps/agents-server/src/app/api/agents/export/route.ts +67 -0
- package/apps/agents-server/src/app/api/agents/import/route.ts +168 -0
- package/apps/agents-server/src/app/api/auth/change-password/route.ts +53 -6
- package/apps/agents-server/src/app/api/auth/login/route.ts +17 -16
- package/apps/agents-server/src/app/api/auth/logout/route.ts +2 -10
- package/apps/agents-server/src/app/api/auth/shibboleth/acs/route.ts +112 -0
- package/apps/agents-server/src/app/api/auth/shibboleth/login/route.ts +70 -0
- package/apps/agents-server/src/app/api/auth/shibboleth/metadata/route.ts +15 -0
- package/apps/agents-server/src/app/api/auth/shibboleth/status/route.ts +17 -0
- package/apps/agents-server/src/app/api/chat/citation-label/route.ts +133 -0
- package/apps/agents-server/src/app/api/chat/export/pdf/route.ts +167 -2
- package/apps/agents-server/src/app/api/chat/route.ts +29 -7
- package/apps/agents-server/src/app/api/chat-feedback/export/route.ts +2 -2
- package/apps/agents-server/src/app/api/chat-feedback/route.ts +3 -3
- package/apps/agents-server/src/app/api/chat-history/[id]/route.ts +2 -2
- package/apps/agents-server/src/app/api/chat-history/export/route.ts +2 -2
- package/apps/agents-server/src/app/api/chat-history/route.ts +3 -3
- package/apps/agents-server/src/app/api/chat-streaming/route.ts +29 -0
- package/apps/agents-server/src/app/api/elevenlabs/tts/route.ts +60 -2
- package/apps/agents-server/src/app/api/emails/incoming/sendgrid/route.ts +24 -2
- package/apps/agents-server/src/app/api/federated-agents/route.ts +1 -1
- package/apps/agents-server/src/app/api/health/route.ts +18 -0
- package/apps/agents-server/src/app/api/images/[filename]/route.ts +108 -2
- package/apps/agents-server/src/app/api/internal/agent-runner-limits/route.ts +52 -0
- package/apps/agents-server/src/app/api/internal/user-chat-jobs/run/route.ts +17 -4
- package/apps/agents-server/src/app/api/metadata/export/route.ts +34 -0
- package/apps/agents-server/src/app/api/metadata/import/route.ts +47 -0
- package/apps/agents-server/src/app/api/metadata/route.ts +4 -0
- package/apps/agents-server/src/app/api/openai/v1/audio/transcriptions/route.ts +111 -2
- package/apps/agents-server/src/app/api/page-preview/check/route.ts +49 -0
- package/apps/agents-server/src/app/api/page-preview/screenshot/route.ts +64 -0
- package/apps/agents-server/src/app/api/scrape/route.ts +18 -0
- package/apps/agents-server/src/app/api/team-agent-profile/route.ts +20 -0
- package/apps/agents-server/src/app/api/upload/route.ts +204 -220
- package/apps/agents-server/src/app/api/users/[username]/route.ts +3 -2
- package/apps/agents-server/src/app/api/users/route.ts +8 -7
- package/apps/agents-server/src/app/api/v1/agents/[agentId]/route.ts +17 -8
- package/apps/agents-server/src/app/api/v1/agents/route.ts +2 -0
- package/apps/agents-server/src/app/dashboard/page.tsx +12 -17
- package/apps/agents-server/src/app/docs/[docId]/page.tsx +1 -1
- package/apps/agents-server/src/app/docs/page.tsx +1 -1
- package/apps/agents-server/src/app/globals.css +179 -0
- package/apps/agents-server/src/app/layout.tsx +33 -4
- package/apps/agents-server/src/app/recycle-bin/actions.ts +3 -0
- package/apps/agents-server/src/app/recycle-bin/page.tsx +1 -1
- package/apps/agents-server/src/app/s3/[first]/[second]/[hash]/[filename]/route.ts +52 -0
- package/apps/agents-server/src/app/swagger/SwaggerApiKeysPanel.tsx +4 -1
- package/apps/agents-server/src/app/system/settings/KeybindingsSettingsClient.tsx +13 -7
- package/apps/agents-server/src/app/system/user-memory/UserMemoryClient.tsx +4 -2
- package/apps/agents-server/src/app/system/user-wallet/UserWalletClient.tsx +3 -0
- package/apps/agents-server/src/app/system/user-wallet/UserWalletRecordsTable.tsx +5 -1
- package/apps/agents-server/src/app/system/utilities/mocked-chats/MockedChatsEditorClient.tsx +3 -0
- package/apps/agents-server/src/app/system/utilities/mocked-chats/MockedChatsEditorSidebar.tsx +7 -8
- package/apps/agents-server/src/components/AdminTerminal/AdminTerminalCard.tsx +13 -70
- package/apps/agents-server/src/components/AdminTerminal/AdminXtermTerminal.tsx +330 -0
- package/apps/agents-server/src/components/AdminTerminal/useAdminTerminalSession.ts +45 -5
- package/apps/agents-server/src/components/AgentContextMenu/useAgentContextMenuItems.ts +27 -19
- package/apps/agents-server/src/components/AgentProfile/AgentCapabilityChips.tsx +39 -5
- package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +4 -7
- package/apps/agents-server/src/components/AgentProfile/AgentProfileImage.tsx +8 -2
- package/apps/agents-server/src/components/ApplicationErrorPage/ApplicationErrorPage.tsx +118 -12
- package/apps/agents-server/src/components/DocsToolbar/DocsToolbar.tsx +4 -4
- package/apps/agents-server/src/components/DocumentationContent/DocumentationContent.tsx +9 -9
- package/apps/agents-server/src/components/FileUploadAvailability/FileUploadAvailabilityContext.tsx +50 -0
- package/apps/agents-server/src/components/FileUploadAvailability/FileUploadUnavailableNotice.tsx +45 -0
- package/apps/agents-server/src/components/Footer/Footer.tsx +10 -9
- package/apps/agents-server/src/components/Footer/getCommitFooterEmoji.ts +112 -0
- package/apps/agents-server/src/components/Header/ActiveAgentBreadcrumbContext.tsx +82 -0
- package/apps/agents-server/src/components/Header/Header.tsx +24 -15
- package/apps/agents-server/src/components/Header/HeaderTypes.ts +6 -0
- package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +51 -1
- package/apps/agents-server/src/components/Header/useHeaderActiveAgent.ts +26 -7
- package/apps/agents-server/src/components/Header/useHeaderAgentMenus.tsx +0 -5
- package/apps/agents-server/src/components/Homepage/AgentCard.tsx +7 -1
- package/apps/agents-server/src/components/Homepage/AgentsList.tsx +22 -1
- package/apps/agents-server/src/components/Homepage/AgentsListHeader.tsx +85 -1
- package/apps/agents-server/src/components/Homepage/AgentsListListView.tsx +6 -0
- package/apps/agents-server/src/components/Homepage/AgentsListViewContent.tsx +6 -0
- package/apps/agents-server/src/components/Homepage/Card.tsx +1 -1
- package/apps/agents-server/src/components/Homepage/Section.tsx +3 -1
- package/apps/agents-server/src/components/Homepage/SortableFolderCard.tsx +7 -1
- package/apps/agents-server/src/components/Homepage/hiddenFolders.ts +104 -0
- package/apps/agents-server/src/components/Homepage/useAgentsListImportExportState.ts +525 -0
- package/apps/agents-server/src/components/Homepage/useAgentsListQueryState.ts +35 -0
- package/apps/agents-server/src/components/Homepage/useAgentsListState.ts +38 -4
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +93 -70
- package/apps/agents-server/src/components/LoginForm/LoginForm.tsx +52 -12
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/ManGoNewAgentWizard.tsx +151 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/ManGoOnboardingNavigation.tsx +50 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/BookLanguagePanel.tsx +125 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/DropZone.tsx +83 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/EmailTestRun.tsx +216 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/KnowledgeList.tsx +79 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/Logo.tsx +20 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/MarkdownBookEditor.tsx +154 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/MarkdownPreview.tsx +188 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/RailStepper.tsx +115 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/StepFrame.tsx +47 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/TestChat.tsx +159 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/WizardShell.tsx +114 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/brand/RailArtwork.tsx +60 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/BookStep.tsx +135 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/DoneStep.tsx +215 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/KnowledgeStep.tsx +152 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/TestStep.tsx +262 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/ZadaniStep.tsx +64 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/ui/Badge.tsx +41 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/ui/Banner.tsx +69 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/ui/Button.tsx +77 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/ui/Card.tsx +33 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/ui/Field.tsx +103 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/ui/IconButton.tsx +40 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/ui/Spinner.tsx +14 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/ui/tokens.ts +37 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/config/bookSections.ts +62 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/config/emailScenarios.ts +22 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/config/steps.ts +46 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/index.ts +11 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/lib/cn.ts +4 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/lib/format.ts +9 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/lib/id.ts +11 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/agentEvalService.ts +30 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/agentTestService.ts +69 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/bookService.ts +21 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/createManGoAgentSource.ts +107 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/draftService.ts +45 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/uploadService.ts +27 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/state/OnboardingProvider.tsx +121 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/types.ts +52 -0
- package/apps/agents-server/src/components/NewAgentDialog/NewAgentDialog.tsx +7 -3
- package/apps/agents-server/src/components/NewAgentDialog/NewAgentWizardKnowledgeStep.tsx +6 -0
- package/apps/agents-server/src/components/NewAgentDialog/createNewAgentWizardSource.ts +1 -1
- package/apps/agents-server/src/components/NewAgentDialog/trackNewAgentCreationEvent.ts +1 -1
- package/apps/agents-server/src/components/NewAgentDialog/useNewAgentDialog.tsx +113 -14
- package/apps/agents-server/src/components/NewAgentDialog/useNewAgentWizardKnowledgeState.ts +8 -1
- package/apps/agents-server/src/components/PrintHeader/PrintHeader.tsx +4 -2
- package/apps/agents-server/src/components/Skeleton/ConsolePageLoadingSkeleton.tsx +1 -1
- package/apps/agents-server/src/components/Skeleton/DocumentationRouteLoadingSkeleton.tsx +1 -1
- package/apps/agents-server/src/components/Skeleton/HomepageLoadingSkeleton.tsx +1 -1
- package/apps/agents-server/src/components/UsersList/UsersList.tsx +24 -6
- package/apps/agents-server/src/components/UsersList/useUsersAdmin.ts +2 -7
- package/apps/agents-server/src/constants/defaultAgentAvatarVisual.ts +1 -1
- package/apps/agents-server/src/constants/newAgentWizard.ts +17 -8
- package/apps/agents-server/src/constants/serverLimits.ts +41 -2
- package/apps/agents-server/src/constants/shibbolethAuth.ts +139 -0
- package/apps/agents-server/src/database/$provideClientSql.ts +37 -0
- package/apps/agents-server/src/database/$provideSupabaseForServer.ts +41 -0
- package/apps/agents-server/src/database/customJavascript.ts +62 -1
- package/apps/agents-server/src/database/customStylesheet.ts +60 -1
- package/apps/agents-server/src/database/getMetadata.ts +121 -4
- package/apps/agents-server/src/database/loadAgentsServerEnvFile.ts +29 -0
- package/apps/agents-server/src/database/metadataDefaults.ts +85 -31
- package/apps/agents-server/src/database/migrate.ts +8 -2
- package/apps/agents-server/src/database/migrations/2026-06-0100-shibboleth-auth.sql +136 -0
- package/apps/agents-server/src/database/migrations/2026-06-0200-default-agent-avatar-visual-octopus3d3.sql +16 -0
- package/apps/agents-server/src/database/migrations/2026-06-1300-user-chat-active-read-indexes.sql +7 -0
- package/apps/agents-server/src/database/migrations/2026-06-2200-new-agent-wizard-metadata-key.sql +27 -0
- package/apps/agents-server/src/database/migrations/2026-06-2201-new-agent-wizard-mango-default.sql +11 -0
- package/apps/agents-server/src/database/migrations/2026-06-2600-agent-directory-performance-indexes.sql +14 -0
- package/apps/agents-server/src/database/migrations/2026-06-2700-default-agent-avatar-visual-octopus3d4.sql +16 -0
- package/apps/agents-server/src/database/seedCoreAgents.ts +234 -0
- package/apps/agents-server/src/database/seedDefaultAgents.ts +223 -0
- package/apps/agents-server/src/database/sqlite/$provideLocalSqliteSupabase.ts +234 -41
- package/apps/agents-server/src/generated/reservedPaths.ts +3 -0
- package/apps/agents-server/src/instrumentation-client.ts +28 -0
- package/apps/agents-server/src/instrumentation.ts +19 -0
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +4 -0
- package/apps/agents-server/src/languages/translations/czech.yaml +5 -1
- package/apps/agents-server/src/languages/translations/english.yaml +5 -1
- package/apps/agents-server/src/message-providers/email/sendgrid/verifySendgridInboundParseWebhook.ts +345 -0
- package/apps/agents-server/src/middleware/applyEmbeddingHeader.ts +4 -2
- package/apps/agents-server/src/middleware/contentSecurityPolicy.ts +97 -0
- package/apps/agents-server/src/middleware/resolveAccessControlResponse.ts +3 -2
- package/apps/agents-server/src/middleware/resolveMiddlewareResponse.ts +8 -3
- package/apps/agents-server/src/middleware.ts +15 -32
- package/apps/agents-server/src/search/createDefaultServerSearchProviders/createFederatedAgentsSearchProvider.ts +1 -1
- package/apps/agents-server/src/sentry.edge.config.ts +18 -0
- package/apps/agents-server/src/sentry.server.config.ts +19 -0
- package/apps/agents-server/src/tools/$provideAgentCollectionForServer.ts +2 -9
- package/apps/agents-server/src/tools/$provideCdnForServer.ts +187 -15
- package/apps/agents-server/src/tools/BrowserConnectionProvider.ts +2 -19
- package/apps/agents-server/src/tools/agent_progress.ts +4 -10
- package/apps/agents-server/src/tools/createAgentProgressTools.ts +8 -4
- package/apps/agents-server/src/tools/createChatAttachmentToolFunctions.ts +8 -4
- package/apps/agents-server/src/tools/createServerChromiumLaunchOptions.ts +44 -0
- package/apps/agents-server/src/utils/agentOwnership.ts +54 -5
- package/apps/agents-server/src/utils/agentRouting/resolveAgentRouteTarget.ts +101 -19
- package/apps/agents-server/src/utils/agentVisibility.ts +25 -62
- package/apps/agents-server/src/utils/agentsTransfer/createAgentsExportZipStream.ts +81 -0
- package/apps/agents-server/src/utils/agentsTransfer/importAgentsFromFiles.ts +852 -0
- package/apps/agents-server/src/utils/assertSafeUrl.ts +136 -0
- package/apps/agents-server/src/utils/authenticateUser.ts +112 -4
- package/apps/agents-server/src/utils/authenticationAttemptRateLimit.ts +504 -0
- package/apps/agents-server/src/utils/backup/createBooksBackupZipStream.ts +91 -7
- package/apps/agents-server/src/utils/cdn/classes/DigitalOceanSpaces.ts +48 -4
- package/apps/agents-server/src/utils/cdn/classes/TrackedFilesStorage.ts +6 -5
- package/apps/agents-server/src/utils/cdn/interfaces/IFilesStorage.ts +5 -0
- package/apps/agents-server/src/utils/cdn/utils/getUserFileCdnKey.ts +10 -3
- package/apps/agents-server/src/utils/chat/resolveAgentsServerCitationLabel.ts +130 -0
- package/apps/agents-server/src/utils/chat/resolveCitationSourceLabel.ts +436 -0
- package/apps/agents-server/src/utils/chatExport/renderHtmlToPdfOnServer.ts +66 -17
- package/apps/agents-server/src/utils/chatExport/sanitizeChatPdfExportHtml.ts +193 -0
- package/apps/agents-server/src/utils/codeRunnerConfiguration.ts +1 -1
- package/apps/agents-server/src/utils/createAdminTerminalRouteHandlers.ts +264 -0
- package/apps/agents-server/src/utils/createAgentWithDefaultVisibility.ts +3 -1
- package/apps/agents-server/src/utils/currentUserIdentity.ts +22 -9
- package/apps/agents-server/src/utils/defaultAgents/loadDefaultAgentBooks.ts +145 -0
- package/apps/agents-server/src/utils/errorReporting/agentsServerSentryContext.ts +203 -0
- package/apps/agents-server/src/utils/errorReporting/applicationErrorHandling.ts +45 -0
- package/apps/agents-server/src/utils/errorReporting/refreshApplicationDocument.ts +10 -0
- package/apps/agents-server/src/utils/errorReporting/registerServerErrorSentryLogging.ts +381 -0
- package/apps/agents-server/src/utils/errorReporting/sendApplicationErrorReportToSentry.ts +43 -152
- package/apps/agents-server/src/utils/errorReporting/sentrySdkConfig.ts +237 -0
- package/apps/agents-server/src/utils/errorReporting/sentryStore.ts +187 -0
- package/apps/agents-server/src/utils/externalChatRunner/createExternalAgentRepositoryFiles.ts +2 -2
- package/apps/agents-server/src/utils/externalChatRunner/processExternalUserChatJob.ts +15 -8
- package/apps/agents-server/src/utils/findAgentForCallerWriteAccess.ts +36 -0
- package/apps/agents-server/src/utils/getCurrentUser.ts +2 -1
- package/apps/agents-server/src/utils/getFederatedServers.ts +3 -74
- package/apps/agents-server/src/utils/getUserById.ts +19 -5
- package/apps/agents-server/src/utils/getWellKnownAgentUrl.ts +10 -4
- package/apps/agents-server/src/utils/iframe/checkIfUrlCanBeEmbedded.ts +68 -0
- package/apps/agents-server/src/utils/interactiveTerminalSession.ts +9 -4
- package/apps/agents-server/src/utils/isAdminPasswordEqual.ts +28 -0
- package/apps/agents-server/src/utils/isUserGlobalAdmin.ts +3 -1
- package/apps/agents-server/src/utils/knowledge/createInlineKnowledgeSourceUploader.ts +24 -5
- package/apps/agents-server/src/utils/knowledge/resolveWebsiteKnowledgeSourcesForServer.ts +10 -1
- package/apps/agents-server/src/utils/localChatRunner/LocalUserChatJobMetadata.ts +15 -5
- package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +24 -18
- package/apps/agents-server/src/utils/localization/formatServerLanguageHumanReadableDate.ts +70 -0
- package/apps/agents-server/src/utils/localization/getRequestServerLanguage.ts +32 -0
- package/apps/agents-server/src/utils/metadataConfigurationTransfer.ts +442 -0
- package/apps/agents-server/src/utils/paidApiRequestGuard.ts +241 -0
- package/apps/agents-server/src/utils/publicUser.ts +59 -0
- package/apps/agents-server/src/utils/serverLimits.ts +28 -1
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/bootstrapManagedServer.ts +5 -6
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/normalizeCreateServerInput.ts +6 -0
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerCoreAgents.ts +162 -0
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerDefaultAgents.ts +7 -87
- package/apps/agents-server/src/utils/serverManagement/createManagedServer.ts +5 -0
- package/apps/agents-server/src/utils/session.ts +72 -30
- package/apps/agents-server/src/utils/shareTargetPayloads.ts +37 -66
- package/apps/agents-server/src/utils/shibbolethAuthentication.ts +957 -0
- package/apps/agents-server/src/utils/transpilers/resolveTranspiledTeamExport.ts +10 -10
- package/apps/agents-server/src/utils/upload/createBookEditorUploadHandler.ts +19 -28
- package/apps/agents-server/src/utils/upload/fileUploadAvailability.ts +91 -0
- package/apps/agents-server/src/utils/upload/uploadFileToServer.ts +157 -0
- package/apps/agents-server/src/utils/userChat/createImmediateUserChatAnswerModelRequirements.ts +26 -12
- package/apps/agents-server/src/utils/userChat/createRunUserChatJobExecutionContext.ts +45 -0
- package/apps/agents-server/src/utils/userChat/createRunUserChatJobPersistenceController.ts +17 -11
- package/apps/agents-server/src/utils/userChat/createUserChatDetailPayload.ts +33 -18
- package/apps/agents-server/src/utils/userChat/createUserChatHarnessProgressCard.ts +93 -0
- package/apps/agents-server/src/utils/userChat/createUserChatRunnerProgressCard.ts +57 -0
- package/apps/agents-server/src/utils/userChat/hasPotentiallyPendingAssistantMessages.ts +26 -0
- package/apps/agents-server/src/utils/userChat/listUserChats.ts +117 -6
- package/apps/agents-server/src/utils/userChat/persistUserChatJobProgressCard.ts +40 -0
- package/apps/agents-server/src/utils/userChat/resolveUserChatProgressToolHighlights.ts +100 -0
- package/apps/agents-server/src/utils/userChat/resolveUserChatWorkerInternalToken.ts +63 -9
- package/apps/agents-server/src/utils/userChat/runImmediateUserChatAnswer.ts +1 -1
- package/apps/agents-server/src/utils/userChat/runUserChatJob.ts +30 -0
- package/apps/agents-server/src/utils/userChat/triggerUserChatJobWorker.ts +54 -19
- package/apps/agents-server/src/utils/userChat/userChatMessageLifecycle.ts +69 -1
- package/apps/agents-server/src/utils/userChat/userChatProgressCard.ts +360 -0
- package/apps/agents-server/src/utils/validateApiKey.ts +7 -3
- package/apps/agents-server/src/utils/vpsConfiguration.ts +8 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate.ts +935 -64
- package/esm/apps/agents-server/src/constants/federatedAgentImport.d.ts +42 -0
- package/esm/apps/agents-server/src/constants/serverLimits.d.ts +224 -0
- package/esm/apps/agents-server/src/constants/toolUsageLimits.d.ts +55 -0
- package/esm/index.es.js +24308 -18655
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-chat/executeAgentChatTurn.d.ts +28 -0
- package/esm/scripts/run-agent-chat/runAgentChat.d.ts +5 -0
- package/esm/scripts/run-agent-chat/runAgentExec.d.ts +11 -0
- package/esm/scripts/run-agent-messages/main/AgentMessageFailureTracker.d.ts +27 -0
- package/esm/scripts/run-agent-messages/main/handleAgentWatchError.d.ts +4 -0
- package/esm/scripts/run-agent-messages/main/runAgentMessages.d.ts +1 -0
- package/esm/scripts/run-agent-messages/main/runMultipleAgentMessages.d.ts +1 -0
- package/esm/scripts/run-agent-messages/main/tickAgentMessages.d.ts +1 -0
- package/esm/scripts/run-agent-messages/messages/createAgentRunnerSystemMessage.d.ts +10 -0
- package/esm/scripts/run-agent-messages/messages/moveAgentMessageToFailed.d.ts +17 -0
- package/esm/scripts/run-codex-prompts/common/buildCoderRunProgressSnapshot.d.ts +5 -1
- package/esm/scripts/run-codex-prompts/common/cliProgressDisplay.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/common/coderRunEstimateCache.d.ts +31 -0
- package/esm/scripts/run-codex-prompts/common/parseDuration.d.ts +19 -0
- package/esm/scripts/run-codex-prompts/common/progressFormatting.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/common/resolveAgentSystemMessage.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/common/resolveInlineOrFileText.d.ts +14 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/printLiveScriptChunk.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/common/sleepWithCountdown.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/common/waitForPause.d.ts +12 -0
- package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +3 -1
- package/esm/scripts/run-codex-prompts/main/findUnwrittenPrompts.d.ts +19 -0
- package/esm/scripts/run-codex-prompts/main/runCodexPromptsServer.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/main/runPromptRound.d.ts +5 -3
- package/esm/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +3 -1
- package/esm/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +50 -0
- package/esm/scripts/run-codex-prompts/server/buildCoderServerRunState.d.ts +23 -0
- package/esm/scripts/run-codex-prompts/server/coderServerHtml.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/server/runCoderHttpServer.d.ts +35 -0
- package/esm/scripts/run-codex-prompts/server/updatePromptSection.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +8 -0
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +1 -0
- package/esm/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +5 -1
- package/esm/scripts/run-codex-prompts/ui/renderCoderRunUi.d.ts +1 -0
- package/esm/src/_packages/components.index.d.ts +4 -0
- package/esm/src/_packages/core.index.d.ts +22 -2
- package/esm/src/_packages/node.index.d.ts +40 -0
- package/esm/src/_packages/types.index.d.ts +20 -0
- package/esm/src/avatars/avatarAnimationScheduler.d.ts +4 -0
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/esm/src/avatars/visuals/octopus3d3AvatarVisual.d.ts +7 -0
- package/esm/src/avatars/visuals/octopus3d4AvatarVisual.d.ts +7 -0
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
- package/esm/src/book-2.0/agent-source/agentSourceVisibility.d.ts +97 -0
- package/esm/src/book-2.0/agent-source/agentSourceVisibility.test.d.ts +1 -0
- package/esm/src/book-3.0/BookNodeAgentSource.d.ts +38 -0
- package/esm/src/book-3.0/CliAgent.d.ts +66 -0
- package/esm/src/book-3.0/CliAgent.test.d.ts +1 -0
- package/esm/src/book-3.0/LiteAgent.d.ts +68 -0
- package/esm/src/book-3.0/LiteAgent.test.d.ts +1 -0
- package/esm/src/book-3.0/agentFolderPaths.d.ts +30 -0
- package/esm/src/book-3.0/cliAgentEnv.d.ts +33 -0
- package/esm/src/book-components/BookEditor/BookEditor.d.ts +6 -5
- package/esm/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.d.ts +12 -0
- package/esm/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
- package/esm/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
- package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +2 -0
- package/esm/src/book-components/BookEditor/BookEditorTheme.d.ts +24 -0
- package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +1 -6
- package/esm/src/book-components/BookEditor/useBookEditorMonacoLifecycle.d.ts +1 -4
- package/esm/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +2 -1
- package/esm/src/book-components/Chat/Chat/ChatCitationModal.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +5 -0
- package/esm/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +3 -1
- package/esm/src/book-components/Chat/Chat/CitationIframePreview.d.ts +20 -0
- package/esm/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +2 -0
- package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
- package/esm/src/book-components/Chat/SourceChip/SourceChip.d.ts +6 -1
- package/esm/src/book-components/Chat/hooks/useResolvedCitationLabel.d.ts +12 -0
- package/esm/src/book-components/Chat/types/ChatMessage.d.ts +4 -0
- package/esm/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
- package/esm/src/book-components/Chat/types/CitationLabelResolver.d.ts +8 -0
- package/esm/src/book-components/Chat/utils/citationHelpers.d.ts +9 -0
- package/esm/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.d.ts +14 -0
- package/esm/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.test.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +10 -0
- package/esm/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +4 -0
- package/esm/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
- package/esm/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +1 -1
- package/esm/src/book-components/_common/Modal/Modal.d.ts +1 -1
- package/esm/src/book-components/icons/AboutIcon.d.ts +1 -1
- package/esm/src/book-components/icons/DownloadIcon.d.ts +1 -1
- package/esm/src/book-components/icons/ExitFullscreenIcon.d.ts +1 -1
- package/esm/src/book-components/icons/FullscreenIcon.d.ts +1 -1
- package/esm/src/cli/cli-commands/agent/agentCliOptions.d.ts +38 -0
- package/esm/src/cli/cli-commands/agent/chat.d.ts +10 -0
- package/esm/src/cli/cli-commands/agent/exec.d.ts +10 -0
- package/esm/src/cli/cli-commands/agent/run.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -24
- package/esm/src/cli/cli-commands/agent.d.ts +14 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +23 -1
- package/esm/src/cli/cli-commands/agents-server/run.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +9 -2
- package/esm/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.d.ts +25 -0
- package/esm/src/cli/cli-commands/coder/find-unwritten.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +2 -0
- package/esm/src/cli/cli-commands/coder/server.d.ts +13 -0
- package/esm/src/cli/cli-commands/coder/waitOptions.d.ts +14 -0
- package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +9 -25
- package/esm/src/collection/agent-collection/CreateAgentInput.d.ts +2 -1
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +21 -1
- package/esm/src/commitments/META_VISIBILITY/META_VISIBILITY.d.ts +27 -0
- package/esm/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -1
- package/esm/src/commitments/index.d.ts +2 -1
- package/esm/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
- package/esm/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
- package/esm/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
- package/esm/src/utils/isTimingSafeEqualString.d.ts +25 -0
- package/esm/src/utils/validators/url/isValidAgentUrl.d.ts +5 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +6 -1
- package/servers.ts +1 -16
- package/src/_packages/components.index.ts +4 -0
- package/src/_packages/core.index.ts +22 -2
- package/src/_packages/node.index.ts +40 -0
- package/src/_packages/types.index.ts +20 -0
- package/src/avatars/avatarAnimationScheduler.ts +76 -4
- package/src/avatars/types/AvatarVisualDefinition.ts +2 -0
- package/src/avatars/visuals/avatarVisualRegistry.ts +4 -0
- package/src/avatars/visuals/fractalAvatarVisual.ts +5 -4
- package/src/avatars/visuals/minecraft2AvatarVisual.ts +16 -11
- package/src/avatars/visuals/minecraftAvatarVisual.ts +21 -7
- package/src/avatars/visuals/octopus3d2AvatarVisual.ts +175 -38
- package/src/avatars/visuals/octopus3d3AvatarVisual.ts +1068 -0
- package/src/avatars/visuals/octopus3d4AvatarVisual.ts +1295 -0
- package/src/avatars/visuals/octopus3dAvatarVisual.ts +69 -17
- package/src/book-2.0/agent-source/AgentBasicInformation.ts +2 -0
- package/src/book-2.0/agent-source/agentSourceVisibility.ts +214 -0
- package/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments/augmentAgentModelRequirementsFromSource.ts +18 -2
- package/src/book-2.0/agent-source/parseAgentSource/applyMetaCommitment.ts +17 -0
- package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +1 -0
- package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts +7 -1
- package/src/book-3.0/Book.ts +3 -1
- package/src/book-3.0/BookNodeAgentSource.ts +135 -0
- package/src/book-3.0/CliAgent.ts +252 -0
- package/src/book-3.0/LiteAgent.ts +468 -0
- package/src/book-3.0/agentFolderPaths.ts +38 -0
- package/src/book-3.0/cliAgentEnv.ts +46 -0
- package/src/book-components/BookEditor/BookEditor.module.css +61 -0
- package/src/book-components/BookEditor/BookEditor.tsx +16 -13
- package/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.tsx +72 -0
- package/src/book-components/BookEditor/BookEditorActionbar.tsx +35 -5
- package/src/book-components/BookEditor/BookEditorBrowserConfig.ts +11 -0
- package/src/book-components/BookEditor/BookEditorForClient.tsx +33 -0
- package/src/book-components/BookEditor/BookEditorMonaco.tsx +4 -2
- package/src/book-components/BookEditor/BookEditorMonacoTokenization.ts +89 -27
- package/src/book-components/BookEditor/BookEditorTheme.ts +32 -0
- package/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.ts +11 -0
- package/src/book-components/BookEditor/useBookEditorMonacoLanguage.ts +62 -92
- package/src/book-components/BookEditor/useBookEditorMonacoLifecycle.ts +1 -5
- package/src/book-components/BookEditor/useBookEditorMonacoStyles.ts +3 -2
- package/src/book-components/BookEditor/useBookEditorMonacoUploads.ts +1 -1
- package/src/book-components/Chat/Chat/Chat.module.css +50 -0
- package/src/book-components/Chat/Chat/Chat.tsx +4 -0
- package/src/book-components/Chat/Chat/ChatCitationModal.tsx +19 -5
- package/src/book-components/Chat/Chat/ChatMessageItem.tsx +22 -2
- package/src/book-components/Chat/Chat/ChatMessageList.tsx +6 -0
- package/src/book-components/Chat/Chat/ChatProps.tsx +6 -0
- package/src/book-components/Chat/Chat/ChatToolCallModal.tsx +4 -0
- package/src/book-components/Chat/Chat/ChatToolCallModalContent.tsx +4 -0
- package/src/book-components/Chat/Chat/CitationIframePreview.tsx +78 -0
- package/src/book-components/Chat/Chat/TeamToolCallModalContent.tsx +16 -3
- package/src/book-components/Chat/Chat/createChatMessageToolCallRenderModel.ts +2 -9
- package/src/book-components/Chat/Chat/useChatPostprocessedMessages.ts +13 -2
- package/src/book-components/Chat/MarkdownContent/MarkdownContent.tsx +63 -4
- package/src/book-components/Chat/SourceChip/SourceChip.module.css +8 -0
- package/src/book-components/Chat/SourceChip/SourceChip.tsx +19 -5
- package/src/book-components/Chat/hooks/useResolvedCitationLabel.ts +65 -0
- package/src/book-components/Chat/save/html/htmlSaveFormatDefinition.ts +315 -88
- package/src/book-components/Chat/save/react/reactSaveFormatDefinition.ts +7 -1
- package/src/book-components/Chat/types/ChatMessage.ts +5 -0
- package/src/book-components/Chat/types/ChatParticipant.ts +1 -1
- package/src/book-components/Chat/types/CitationLabelResolver.ts +9 -0
- package/src/book-components/Chat/utils/citationHelpers.ts +90 -2
- package/src/book-components/Chat/utils/createCitationFootnoteRenderModel.ts +3 -0
- package/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.ts +178 -0
- package/src/book-components/Chat/utils/isVisibleChatToolCall.ts +23 -0
- package/src/book-components/Chat/utils/parseCitationsFromContent.ts +6 -0
- package/src/book-components/Chat/utils/renderMarkdown.ts +3 -2
- package/src/book-components/_common/Dropdown/Dropdown.tsx +1 -1
- package/src/book-components/_common/MenuHoisting/MenuHoistingContext.tsx +1 -1
- package/src/book-components/_common/Modal/Modal.tsx +1 -1
- package/src/book-components/icons/AboutIcon.tsx +1 -1
- package/src/book-components/icons/DownloadIcon.tsx +1 -1
- package/src/book-components/icons/ExitFullscreenIcon.tsx +1 -1
- package/src/book-components/icons/FullscreenIcon.tsx +1 -1
- package/src/cli/cli-commands/agent/agentCliOptions.ts +92 -0
- package/src/cli/cli-commands/agent/chat.ts +54 -0
- package/src/cli/cli-commands/agent/exec.ts +60 -0
- package/src/cli/cli-commands/agent-folder/agentProjectPaths.ts +15 -28
- package/src/cli/cli-commands/agent.ts +44 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer.ts +325 -33
- package/src/cli/cli-commands/agents-server/ensureAgentsServerEnvFile.ts +15 -2
- package/src/cli/cli-commands/agents-server/run.ts +103 -31
- package/src/cli/cli-commands/agents-server/startAgentsServer.ts +270 -41
- package/src/cli/cli-commands/agents-server.ts +7 -1
- package/src/cli/cli-commands/coder/ThinkingLevel.ts +3 -1
- package/src/cli/cli-commands/coder/agentCodingFile.ts +1 -1
- package/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.ts +79 -0
- package/src/cli/cli-commands/coder/find-unwritten.ts +58 -0
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +2 -2
- package/src/cli/cli-commands/coder/init.ts +6 -1
- package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +10 -0
- package/src/cli/cli-commands/coder/printInitializationSummary.ts +3 -0
- package/src/cli/cli-commands/coder/run.ts +108 -13
- package/src/cli/cli-commands/coder/server.ts +259 -0
- package/src/cli/cli-commands/coder/waitOptions.ts +24 -0
- package/src/cli/cli-commands/coder.ts +6 -0
- package/src/cli/cli-commands/common/promptRunnerCliOptions.ts +33 -49
- package/src/cli/common/$deprecateCliCommand.ts +10 -1
- package/src/cli/promptbookCli.ts +2 -0
- package/src/collection/agent-collection/CreateAgentInput.ts +10 -5
- package/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.ts +98 -17
- package/src/collection/agent-collection/constructors/agent-collection-in-supabase/createAgentPersistenceRecords.ts +7 -4
- package/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.ts +44 -8
- package/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.ts +2 -2
- package/src/commitments/GOAL/GOAL.ts +7 -2
- package/src/commitments/LANGUAGE/LANGUAGE.ts +7 -2
- package/src/commitments/META_VISIBILITY/META_VISIBILITY.ts +78 -0
- package/src/commitments/TEAM/TEAM.ts +12 -1
- package/src/commitments/USE_PROJECT/createUseProjectToolFunctions.ts +8 -1
- package/src/commitments/_common/teamInternalAgentAccess.ts +14 -8
- package/src/commitments/index.ts +2 -0
- package/src/execution/createPipelineExecutor/getKnowledgeForTask.ts +1 -1
- package/src/formats/csv/CsvFormatParser.ts +4 -4
- package/src/formats/csv/utils/csvParse.ts +2 -2
- package/src/import-plugins/JsonFileImportPlugin.ts +15 -2
- package/src/import-plugins/TextFileImportPlugin.ts +8 -1
- package/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.ts +1 -1
- package/src/llm-providers/_common/register/$provideLlmToolsFromEnv.ts +1 -1
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage.ts +6 -1
- package/src/llm-providers/agent/AgentLlmExecutionTools.ts +2 -2
- package/src/llm-providers/agent/AgentLlmExecutionToolsAgentKitRunner.ts +2 -2
- package/src/llm-providers/agent/AgentLlmExecutionToolsOpenAiAssistantRunner.ts +2 -2
- package/src/llm-providers/anthropic-claude/register-configuration.ts +6 -3
- package/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.ts +3 -1
- package/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.ts +1 -1
- package/src/llm-providers/openai/OpenAiVectorStoreKnowledgeSourcePreparer.ts +1 -1
- package/src/other/templates/getTemplatesPipelineCollection.ts +817 -702
- package/src/scrapers/_common/utils/getScraperIntermediateSource.ts +2 -2
- package/src/scrapers/website/WebsiteScraper.ts +1 -1
- package/src/scrapers/website/utils/createShowdownConverter.ts +2 -2
- package/src/scripting/javascript/JavascriptEvalExecutionTools.ts +1 -1
- package/src/utils/agents/resolveAgentAvatarImageUrl.ts +1 -1
- package/src/utils/chat/chatAttachments/resolveChatAttachmentContent.ts +8 -1
- package/src/utils/isTimingSafeEqualString.ts +43 -0
- package/src/utils/misc/computeHash.ts +2 -2
- package/src/utils/random/$randomToken.ts +2 -2
- package/src/utils/validators/url/isValidAgentUrl.ts +5 -7
- package/src/version.ts +2 -2
- package/src/versions.txt +33 -0
- package/umd/apps/agents-server/src/constants/federatedAgentImport.d.ts +42 -0
- package/umd/apps/agents-server/src/constants/serverLimits.d.ts +224 -0
- package/umd/apps/agents-server/src/constants/toolUsageLimits.d.ts +55 -0
- package/umd/index.umd.js +24336 -18681
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-chat/executeAgentChatTurn.d.ts +28 -0
- package/umd/scripts/run-agent-chat/runAgentChat.d.ts +5 -0
- package/umd/scripts/run-agent-chat/runAgentExec.d.ts +11 -0
- package/umd/scripts/run-agent-messages/main/AgentMessageFailureTracker.d.ts +27 -0
- package/umd/scripts/run-agent-messages/main/handleAgentWatchError.d.ts +4 -0
- package/umd/scripts/run-agent-messages/main/runAgentMessages.d.ts +1 -0
- package/umd/scripts/run-agent-messages/main/runMultipleAgentMessages.d.ts +1 -0
- package/umd/scripts/run-agent-messages/main/tickAgentMessages.d.ts +1 -0
- package/umd/scripts/run-agent-messages/messages/createAgentRunnerSystemMessage.d.ts +10 -0
- package/umd/scripts/run-agent-messages/messages/moveAgentMessageToFailed.d.ts +17 -0
- package/umd/scripts/run-codex-prompts/common/buildCoderRunProgressSnapshot.d.ts +5 -1
- package/umd/scripts/run-codex-prompts/common/cliProgressDisplay.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/common/coderRunEstimateCache.d.ts +31 -0
- package/umd/scripts/run-codex-prompts/common/parseDuration.d.ts +19 -0
- package/umd/scripts/run-codex-prompts/common/progressFormatting.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/common/resolveAgentSystemMessage.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/common/resolveInlineOrFileText.d.ts +14 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/printLiveScriptChunk.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/common/sleepWithCountdown.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/common/waitForPause.d.ts +12 -0
- package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +3 -1
- package/umd/scripts/run-codex-prompts/main/findUnwrittenPrompts.d.ts +19 -0
- package/umd/scripts/run-codex-prompts/main/runCodexPromptsServer.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/main/runPromptRound.d.ts +5 -3
- package/umd/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +3 -1
- package/umd/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +50 -0
- package/umd/scripts/run-codex-prompts/server/buildCoderServerRunState.d.ts +23 -0
- package/umd/scripts/run-codex-prompts/server/coderServerHtml.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/server/runCoderHttpServer.d.ts +35 -0
- package/umd/scripts/run-codex-prompts/server/updatePromptSection.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +8 -0
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +1 -0
- package/umd/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +5 -1
- package/umd/scripts/run-codex-prompts/ui/renderCoderRunUi.d.ts +1 -0
- package/umd/src/_packages/components.index.d.ts +4 -0
- package/umd/src/_packages/core.index.d.ts +22 -2
- package/umd/src/_packages/node.index.d.ts +40 -0
- package/umd/src/_packages/types.index.d.ts +20 -0
- package/umd/src/avatars/avatarAnimationScheduler.d.ts +4 -0
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/umd/src/avatars/visuals/octopus3d3AvatarVisual.d.ts +7 -0
- package/umd/src/avatars/visuals/octopus3d4AvatarVisual.d.ts +7 -0
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
- package/umd/src/book-2.0/agent-source/agentSourceVisibility.d.ts +97 -0
- package/umd/src/book-2.0/agent-source/agentSourceVisibility.test.d.ts +1 -0
- package/umd/src/book-3.0/BookNodeAgentSource.d.ts +38 -0
- package/umd/src/book-3.0/CliAgent.d.ts +66 -0
- package/umd/src/book-3.0/CliAgent.test.d.ts +1 -0
- package/umd/src/book-3.0/LiteAgent.d.ts +68 -0
- package/umd/src/book-3.0/LiteAgent.test.d.ts +1 -0
- package/umd/src/book-3.0/agentFolderPaths.d.ts +30 -0
- package/umd/src/book-3.0/cliAgentEnv.d.ts +33 -0
- package/umd/src/book-components/BookEditor/BookEditor.d.ts +6 -5
- package/umd/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.d.ts +12 -0
- package/umd/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
- package/umd/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
- package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +2 -0
- package/umd/src/book-components/BookEditor/BookEditorTheme.d.ts +24 -0
- package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +1 -6
- package/umd/src/book-components/BookEditor/useBookEditorMonacoLifecycle.d.ts +1 -4
- package/umd/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +2 -1
- package/umd/src/book-components/Chat/Chat/ChatCitationModal.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +5 -0
- package/umd/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +3 -1
- package/umd/src/book-components/Chat/Chat/CitationIframePreview.d.ts +20 -0
- package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +2 -0
- package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
- package/umd/src/book-components/Chat/SourceChip/SourceChip.d.ts +6 -1
- package/umd/src/book-components/Chat/hooks/useResolvedCitationLabel.d.ts +12 -0
- package/umd/src/book-components/Chat/types/ChatMessage.d.ts +4 -0
- package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
- package/umd/src/book-components/Chat/types/CitationLabelResolver.d.ts +8 -0
- package/umd/src/book-components/Chat/utils/citationHelpers.d.ts +9 -0
- package/umd/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.d.ts +14 -0
- package/umd/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +10 -0
- package/umd/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +4 -0
- package/umd/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
- package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +1 -1
- package/umd/src/book-components/_common/Modal/Modal.d.ts +1 -1
- package/umd/src/book-components/icons/AboutIcon.d.ts +1 -1
- package/umd/src/book-components/icons/DownloadIcon.d.ts +1 -1
- package/umd/src/book-components/icons/ExitFullscreenIcon.d.ts +1 -1
- package/umd/src/book-components/icons/FullscreenIcon.d.ts +1 -1
- package/umd/src/cli/cli-commands/agent/agentCliOptions.d.ts +38 -0
- package/umd/src/cli/cli-commands/agent/chat.d.ts +10 -0
- package/umd/src/cli/cli-commands/agent/exec.d.ts +10 -0
- package/umd/src/cli/cli-commands/agent/run.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -24
- package/umd/src/cli/cli-commands/agent.d.ts +14 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +23 -1
- package/umd/src/cli/cli-commands/agents-server/run.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +9 -2
- package/umd/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.d.ts +25 -0
- package/umd/src/cli/cli-commands/coder/find-unwritten.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +2 -0
- package/umd/src/cli/cli-commands/coder/server.d.ts +13 -0
- package/umd/src/cli/cli-commands/coder/waitOptions.d.ts +14 -0
- package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +9 -25
- package/umd/src/collection/agent-collection/CreateAgentInput.d.ts +2 -1
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +21 -1
- package/umd/src/commitments/META_VISIBILITY/META_VISIBILITY.d.ts +27 -0
- package/umd/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -1
- package/umd/src/commitments/index.d.ts +2 -1
- package/umd/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
- package/umd/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
- package/umd/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
- package/umd/src/utils/isTimingSafeEqualString.d.ts +25 -0
- package/umd/src/utils/validators/url/isValidAgentUrl.d.ts +5 -0
- package/umd/src/version.d.ts +1 -1
- package/apps/agents-server/src/app/api/long-streaming/route.ts +0 -23
- package/apps/agents-server/src/message-providers/email/_common/utils/parseEmailAddress.test.ts.todo +0 -108
- package/apps/agents-server/src/message-providers/email/_common/utils/parseEmailAddresses.test.ts.todo +0 -117
- package/apps/agents-server/src/message-providers/email/_common/utils/stringifyEmailAddress.test.ts.todo +0 -119
- package/apps/agents-server/src/message-providers/email/_common/utils/stringifyEmailAddresses.test.ts.todo +0 -74
- package/apps/agents-server/src/utils/defaultFederatedAgents/DefaultFederatedAgentsSyncOptions.ts +0 -9
- package/apps/agents-server/src/utils/defaultFederatedAgents/ensureDefaultFederatedAgentExists.ts +0 -277
- package/apps/agents-server/src/utils/defaultFederatedAgents/fetchCoreOrganizationPayload.ts +0 -39
- package/apps/agents-server/src/utils/defaultFederatedAgents/fetchFederatedAgentBook.ts +0 -43
- package/apps/agents-server/src/utils/defaultFederatedAgents/fetchWithDefaultFederatedAgentTimeout.ts +0 -28
- package/apps/agents-server/src/utils/defaultFederatedAgents/getDefaultFederatedAgentSyncPool.ts +0 -38
- package/apps/agents-server/src/utils/defaultFederatedAgents/loadActiveLocalAgentIdsByNormalizedName.ts +0 -41
- package/apps/agents-server/src/utils/defaultFederatedAgents/loadDefaultFederatedAgentSyncMetadata.ts +0 -76
- package/apps/agents-server/src/utils/defaultFederatedAgents/quoteIdentifier.ts +0 -11
- package/apps/agents-server/src/utils/defaultFederatedAgents/scheduleDefaultFederatedAgentsSync.ts +0 -88
- package/apps/agents-server/src/utils/defaultFederatedAgents/selectDefaultFederatedAgentsFromOrganizationPayload.ts +0 -181
- package/apps/agents-server/src/utils/defaultFederatedAgents/synchronizeDefaultFederatedAgents.ts +0 -77
- package/apps/agents-server/src/utils/shibboleth/createShibbolethAuthenticationLogPayload.ts +0 -173
- package/apps/agents-server/src/utils/shibboleth/writeShibbolethAuthenticationLog.ts +0 -27
- package/apps/agents-server/tests/e2e/authentication-and-navigation.spec.ts.todo +0 -178
- package/src/_packages/browser.index.ts +0 -31
- package/src/_packages/browser.readme.md +0 -43
- package/src/book-2.0/agent-source/parseAgentSourceWithCommitments.test.ts.todo +0 -265
- package/src/book-components/BookEditor/BookEditorMonaco.test.tsx.todo +0 -115
- package/src/book-components/Chat/utils/renderMarkdown.test.ts.tmp +0 -199
- package/src/collection/agent-collection/constructors/agent-collection-in-directory/AgentCollectionInDirectory.test.ts.todo +0 -131
- package/src/commands/_common/parseCommand.test.ts.todo +0 -48
- package/src/commitments/META_LINK/META_LINK.test.ts.todo +0 -75
- package/src/conversion/validation/pipelineStringToJson-errors.test.ts.todo +0 -33
- package/src/dialogs/simple-prompt/SimplePromptInterfaceTools.ts +0 -51
- package/src/executables/browsers/locateSafari.test.ts.tmp +0 -15
- package/src/execution/PromptbookFetch.test-type.ts +0 -14
- package/src/execution/createPipelineExecutor/00-createPipelineExecutor.test.ts.todo +0 -0
- package/src/execution/execution-report/executionReportJsonToString.test.ts.todo +0 -83
- package/src/execution/utils/usageToHuman.test.ts.todo +0 -80
- package/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.ts +0 -76
- package/src/llm-providers/_common/utils/assertUniqueModels.ts +0 -27
- package/src/llm-providers/_multiple/playground/playground.ts +0 -141
- package/src/llm-providers/_multiple/playground/tsconfig.json +0 -19
- package/src/llm-providers/agent/playground/playground.ts +0 -190
- package/src/llm-providers/agent/playground/tsconfig.json +0 -19
- package/src/llm-providers/anthropic-claude/playground/playground.ts +0 -99
- package/src/llm-providers/anthropic-claude/playground/tsconfig.json +0 -19
- package/src/llm-providers/azure-openai/playground/playground.ts +0 -101
- package/src/llm-providers/azure-openai/playground/tsconfig.json +0 -19
- package/src/llm-providers/ollama/playground/playground.ts +0 -120
- package/src/llm-providers/ollama/playground/tsconfig.json +0 -19
- package/src/llm-providers/openai/playground/playground.ts +0 -406
- package/src/llm-providers/openai/playground/tsconfig.json +0 -19
- package/src/llm-providers/remote/playground/playground.ts +0 -144
- package/src/llm-providers/remote/playground/tsconfig.json +0 -19
- package/src/llm-providers/vercel/playground/playground.ts +0 -133
- package/src/llm-providers/vercel/playground/tsconfig.json +0 -19
- package/src/personas/preparePersona.test.ts.todo +0 -126
- package/src/playground/backup/_playground-boilerplate.ts.txt +0 -37
- package/src/playground/backup/playground-agent-os.txt +0 -62
- package/src/playground/backup/playground-brj-app.ts.txt +0 -302
- package/src/playground/backup/playground-browser-playwright.txt +0 -110
- package/src/playground/backup/playground-claude-mcp.txt +0 -43
- package/src/playground/backup/playground-document-conversion.txt +0 -84
- package/src/playground/backup/playground-glob.ts.txt +0 -42
- package/src/playground/backup/playground-mcp-server.txt +0 -1
- package/src/playground/backup/playground-openai-agent-kit.txt +0 -73
- package/src/playground/backup/playground-openai-function-calling.txt +0 -131
- package/src/playground/backup/playground-openai-streaming.ts.txt +0 -68
- package/src/playground/backup/playground-scrape-knowledge.txt +0 -65
- package/src/playground/backup/playground-scraperFetch.ts.txt +0 -44
- package/src/playground/backup/playground-using-openai-compatible-route-on-agents-server.ts.txt +0 -49
- package/src/playground/backup/playground-write-pavolhejny-bio.txt +0 -120
- package/src/playground/permanent/_boilerplate.ts +0 -54
- package/src/playground/permanent/agent-with-browser-playground.ts +0 -92
- package/src/playground/permanent/error-handling-playground.ts +0 -103
- package/src/playground/playground.ts +0 -36
- package/src/playground/tsconfig.json +0 -19
- package/src/scrapers/_boilerplate/BoilerplateScraper.test.ts.todo +0 -73
- package/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.ts +0 -79
- package/src/scrapers/_boilerplate/playground/tsconfig.json +0 -19
- package/src/scrapers/_common/utils/files/blobToDataurl.test.ts.todo +0 -17
- package/src/scrapers/_common/utils/files/dataurlToBlob.test.ts.todo +0 -52
- package/src/scrapers/_common/utils/files/isValidDataurl.test.ts.todo +0 -42
- package/src/scrapers/_common/utils/files/shorten.test.ts.todo +0 -13
- package/src/scrapers/document/playground/document-scraper-playground.ts +0 -80
- package/src/scrapers/document/playground/tsconfig.json +0 -19
- package/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.ts +0 -80
- package/src/scrapers/document-legacy/playground/tsconfig.json +0 -19
- package/src/scrapers/markdown/playground/markdown-scraper-playground.ts +0 -74
- package/src/scrapers/markdown/playground/tsconfig.json +0 -19
- package/src/scrapers/markitdown/MarkitdownScraper.test.ts.todo +0 -132
- package/src/scrapers/markitdown/playground/markitdown-scraper-playground.ts +0 -91
- package/src/scrapers/markitdown/playground/tsconfig.json +0 -19
- package/src/scrapers/pdf/PdfScraper.test.ts.todo +0 -52
- package/src/scrapers/pdf/playground/pdf-scraper-playground.ts +0 -75
- package/src/scrapers/pdf/playground/tsconfig.json +0 -19
- package/src/scrapers/website/playground/tsconfig.json +0 -19
- package/src/scrapers/website/playground/website-scraper-playground.ts +0 -82
- package/src/storage/_common/PromptbookStorage.test-type.ts +0 -14
- package/src/storage/local-storage/getIndexedDbStorage.ts +0 -36
- package/src/storage/local-storage/getLocalStorage.ts +0 -33
- package/src/storage/local-storage/getSessionStorage.ts +0 -33
- package/src/storage/local-storage/utils/IndexedDbStorageOptions.ts +0 -16
- package/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.ts +0 -58
- package/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.ts +0 -45
- package/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.test.ts.todo +0 -35
- package/src/transpilers/openai-sdk/playground/playground.ts +0 -85
- package/src/transpilers/openai-sdk/playground/tmp/chatbot-openaisdk-1.js +0 -194
- package/src/transpilers/openai-sdk/playground/tmp/package.json +0 -3
- package/src/transpilers/openai-sdk/playground/tsconfig.json +0 -18
- package/src/utils/editable/utils/findUsableParameters.test.ts.todo +0 -43
- package/src/utils/editable/utils/stringifyPipelineJson.test.ts.todo +0 -38
- package/src/utils/markdown/prettifyMarkdown.test.ts.tmp +0 -42
- package/src/utils/serialization/serializeToPromptbookJavascript.test.ts.todo +0 -116
|
@@ -65,6 +65,14 @@ type LocalSqliteUpsertOptions = {
|
|
|
65
65
|
readonly onConflict?: string;
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Read index definition for hot SQLite queries.
|
|
70
|
+
*/
|
|
71
|
+
type LocalSqliteReadIndex = {
|
|
72
|
+
readonly name: string;
|
|
73
|
+
readonly columns: ReadonlyArray<string>;
|
|
74
|
+
};
|
|
75
|
+
|
|
68
76
|
/**
|
|
69
77
|
* Columns whose values are persisted as JSON text in local SQLite.
|
|
70
78
|
*/
|
|
@@ -86,19 +94,25 @@ const JSON_COLUMNS_BY_TABLE = new Map<string, ReadonlySet<string>>([
|
|
|
86
94
|
['ShareTargetPayload', new Set(['attachments'])],
|
|
87
95
|
['CalendarConnection', new Set(['scopes'])],
|
|
88
96
|
['CalendarActivity', new Set(['details'])],
|
|
97
|
+
['ShibbolethUserIdentity', new Set(['rawAttributes'])],
|
|
98
|
+
['ShibbolethAuthenticationAttempt', new Set(['rawAttributes'])],
|
|
89
99
|
]);
|
|
90
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Columns that must always be surfaced as strings even when an older SQLite
|
|
103
|
+
* table was created with numeric affinity.
|
|
104
|
+
*/
|
|
105
|
+
const TEXT_COLUMNS_BY_TABLE = new Map<string, ReadonlySet<string>>([['Metadata', new Set(['key', 'value', 'note'])]]);
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Table-specific integer columns whose names would otherwise be ambiguous.
|
|
109
|
+
*/
|
|
110
|
+
const INTEGER_COLUMNS_BY_TABLE = new Map<string, ReadonlySet<string>>([['ServerLimit', new Set(['value'])]]);
|
|
111
|
+
|
|
91
112
|
/**
|
|
92
113
|
* Boolean columns stored as integers by SQLite and restored as booleans.
|
|
93
114
|
*/
|
|
94
|
-
const BOOLEAN_COLUMNS = new Set([
|
|
95
|
-
'isAdmin',
|
|
96
|
-
'isRevoked',
|
|
97
|
-
'isGlobal',
|
|
98
|
-
'isUserScoped',
|
|
99
|
-
'isSuccessful',
|
|
100
|
-
'isChatFocused',
|
|
101
|
-
]);
|
|
115
|
+
const BOOLEAN_COLUMNS = new Set(['isAdmin', 'isRevoked', 'isGlobal', 'isUserScoped', 'isSuccessful', 'isChatFocused']);
|
|
102
116
|
|
|
103
117
|
/**
|
|
104
118
|
* Tables whose primary key is provided as text rather than generated numerically.
|
|
@@ -122,6 +136,7 @@ const UNIQUE_INDEX_COLUMNS_BY_TABLE = new Map<string, ReadonlyArray<ReadonlyArra
|
|
|
122
136
|
['AgentExternals', [['type', 'hash']]],
|
|
123
137
|
['VectorStoreKnowledgeSourceHashes', [['source']]],
|
|
124
138
|
['User', [['username']]],
|
|
139
|
+
['ShibbolethUserIdentity', [['userId'], ['email'], ['nameId']]],
|
|
125
140
|
['UserChatJob', [['chatId', 'clientMessageId']]],
|
|
126
141
|
['LlmCache', [['hash']]],
|
|
127
142
|
['OpenAiAssistantCache', [['agentHash']]],
|
|
@@ -134,6 +149,51 @@ const UNIQUE_INDEX_COLUMNS_BY_TABLE = new Map<string, ReadonlyArray<ReadonlyArra
|
|
|
134
149
|
['UserPushSubscription', [['endpoint']]],
|
|
135
150
|
]);
|
|
136
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Non-unique indexes for frequent standalone VPS reads.
|
|
154
|
+
*/
|
|
155
|
+
const READ_INDEXES_BY_TABLE = new Map<string, ReadonlyArray<LocalSqliteReadIndex>>([
|
|
156
|
+
[
|
|
157
|
+
'Agent',
|
|
158
|
+
[
|
|
159
|
+
{ name: 'agentName_lookup', columns: ['agentName'] },
|
|
160
|
+
{ name: 'active_directory', columns: ['deletedAt', 'sortOrder', 'agentName'] },
|
|
161
|
+
{ name: 'public_active_directory', columns: ['visibility', 'deletedAt', 'sortOrder', 'agentName'] },
|
|
162
|
+
],
|
|
163
|
+
],
|
|
164
|
+
[
|
|
165
|
+
'AgentFolder',
|
|
166
|
+
[{ name: 'active_directory', columns: ['deletedAt', 'parentId', 'sortOrder', 'name'] }],
|
|
167
|
+
],
|
|
168
|
+
[
|
|
169
|
+
'UserChat',
|
|
170
|
+
[
|
|
171
|
+
{ name: 'user_agent_source_createdAt', columns: ['userId', 'agentPermanentId', 'source', 'createdAt'] },
|
|
172
|
+
{ name: 'agent_source_user_createdAt', columns: ['agentPermanentId', 'source', 'userId', 'createdAt'] },
|
|
173
|
+
],
|
|
174
|
+
],
|
|
175
|
+
[
|
|
176
|
+
'UserChatJob',
|
|
177
|
+
[
|
|
178
|
+
{ name: 'ready_queue', columns: ['status', 'cancelRequestedAt', 'queuedAt', 'createdAt'] },
|
|
179
|
+
{ name: 'active_chat_scope', columns: ['chatId', 'userId', 'agentPermanentId', 'status', 'createdAt'] },
|
|
180
|
+
{ name: 'agent_chat_status', columns: ['agentPermanentId', 'chatId', 'status'] },
|
|
181
|
+
{ name: 'running_lease', columns: ['status', 'leaseExpiresAt'] },
|
|
182
|
+
],
|
|
183
|
+
],
|
|
184
|
+
[
|
|
185
|
+
'UserChatTimeout',
|
|
186
|
+
[
|
|
187
|
+
{ name: 'ready_due', columns: ['status', 'cancelRequestedAt', 'pausedAt', 'dueAt', 'createdAt'] },
|
|
188
|
+
{
|
|
189
|
+
name: 'active_chat_scope',
|
|
190
|
+
columns: ['chatId', 'userId', 'agentPermanentId', 'status', 'pausedAt', 'dueAt', 'createdAt'],
|
|
191
|
+
},
|
|
192
|
+
{ name: 'running_lease', columns: ['status', 'leaseExpiresAt'] },
|
|
193
|
+
],
|
|
194
|
+
],
|
|
195
|
+
]);
|
|
196
|
+
|
|
137
197
|
/**
|
|
138
198
|
* Known unique conflict columns used when `.upsert` omits `onConflict`.
|
|
139
199
|
*/
|
|
@@ -158,7 +218,9 @@ export function $provideLocalSqliteSupabase(): SupabaseClient {
|
|
|
158
218
|
return localSqliteSupabase;
|
|
159
219
|
}
|
|
160
220
|
|
|
161
|
-
localSqliteSupabase = new LocalSqliteSupabaseClient(
|
|
221
|
+
localSqliteSupabase = new LocalSqliteSupabaseClient(
|
|
222
|
+
$provideAgentsServerSqliteDatabase(),
|
|
223
|
+
) as unknown as SupabaseClient;
|
|
162
224
|
return localSqliteSupabase;
|
|
163
225
|
}
|
|
164
226
|
|
|
@@ -170,6 +232,20 @@ export function $resetLocalSqliteSupabaseForTests(): void {
|
|
|
170
232
|
localSqliteSupabase = null;
|
|
171
233
|
}
|
|
172
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Ensures read indexes for a table that is queried through direct SQLite SQL.
|
|
237
|
+
*
|
|
238
|
+
* @param tableName - Actual table name, including any server prefix.
|
|
239
|
+
*
|
|
240
|
+
* @private internal SQLite utility of Agents Server
|
|
241
|
+
*/
|
|
242
|
+
export function ensureLocalSqliteTableReadIndexes(tableName: string): void {
|
|
243
|
+
const database = $provideAgentsServerSqliteDatabase();
|
|
244
|
+
const tableBaseName = resolveTableBaseName(tableName);
|
|
245
|
+
|
|
246
|
+
ensureTable(database, tableName, resolveReadIndexColumns(tableBaseName));
|
|
247
|
+
}
|
|
248
|
+
|
|
173
249
|
/**
|
|
174
250
|
* Supabase-shaped client with only the table query surface used by Agents Server.
|
|
175
251
|
*/
|
|
@@ -188,10 +264,7 @@ class LocalSqliteSupabaseClient {
|
|
|
188
264
|
* Supabase-shaped table entry point. Every operation starts a fresh query builder.
|
|
189
265
|
*/
|
|
190
266
|
class LocalSqliteTable {
|
|
191
|
-
public constructor(
|
|
192
|
-
private readonly database: AgentsServerSqliteDatabase,
|
|
193
|
-
private readonly tableName: string,
|
|
194
|
-
) {}
|
|
267
|
+
public constructor(private readonly database: AgentsServerSqliteDatabase, private readonly tableName: string) {}
|
|
195
268
|
|
|
196
269
|
/**
|
|
197
270
|
* Starts a select query.
|
|
@@ -248,10 +321,7 @@ class LocalSqliteQueryBuilder implements PromiseLike<LocalSqliteQueryResult> {
|
|
|
248
321
|
private signal: AbortSignal | null = null;
|
|
249
322
|
private isReturningSelection = false;
|
|
250
323
|
|
|
251
|
-
public constructor(
|
|
252
|
-
private readonly database: AgentsServerSqliteDatabase,
|
|
253
|
-
private readonly tableName: string,
|
|
254
|
-
) {}
|
|
324
|
+
public constructor(private readonly database: AgentsServerSqliteDatabase, private readonly tableName: string) {}
|
|
255
325
|
|
|
256
326
|
/**
|
|
257
327
|
* Configures selected columns or mutation return columns.
|
|
@@ -569,10 +639,16 @@ class LocalSqliteQueryBuilder implements PromiseLike<LocalSqliteQueryResult> {
|
|
|
569
639
|
|
|
570
640
|
if (rowids.length > 0 && updateColumns.length > 0) {
|
|
571
641
|
const assignments = updateColumns.map((column) => `${quoteIdentifier(column)} = ?`).join(', ');
|
|
572
|
-
const values = updateColumns.map((column) =>
|
|
642
|
+
const values = updateColumns.map((column) =>
|
|
643
|
+
serializeValue(this.tableName, column, this.mutationValues[column]),
|
|
644
|
+
);
|
|
573
645
|
const rowidPlaceholders = rowids.map(() => '?').join(', ');
|
|
574
646
|
this.database
|
|
575
|
-
.prepare(
|
|
647
|
+
.prepare(
|
|
648
|
+
`UPDATE ${quoteIdentifier(
|
|
649
|
+
this.tableName,
|
|
650
|
+
)} SET ${assignments} WHERE rowid IN (${rowidPlaceholders})`,
|
|
651
|
+
)
|
|
576
652
|
.run(...values, ...rowids);
|
|
577
653
|
}
|
|
578
654
|
|
|
@@ -591,7 +667,9 @@ class LocalSqliteQueryBuilder implements PromiseLike<LocalSqliteQueryResult> {
|
|
|
591
667
|
const rowids = this.selectMatchingRowids();
|
|
592
668
|
if (rowids.length > 0) {
|
|
593
669
|
const rowidPlaceholders = rowids.map(() => '?').join(', ');
|
|
594
|
-
this.database
|
|
670
|
+
this.database
|
|
671
|
+
.prepare(`DELETE FROM ${quoteIdentifier(this.tableName)} WHERE rowid IN (${rowidPlaceholders})`)
|
|
672
|
+
.run(...rowids);
|
|
595
673
|
}
|
|
596
674
|
|
|
597
675
|
return this.createMutationResponse([]);
|
|
@@ -608,7 +686,10 @@ class LocalSqliteQueryBuilder implements PromiseLike<LocalSqliteQueryResult> {
|
|
|
608
686
|
for (const rawRow of this.mutationRows) {
|
|
609
687
|
const row = withInsertDefaults(tableBaseName, rawRow);
|
|
610
688
|
ensureTable(this.database, this.tableName, [...Object.keys(row), ...conflictColumns]);
|
|
611
|
-
const existingRowid =
|
|
689
|
+
const existingRowid =
|
|
690
|
+
conflictColumns.length > 0
|
|
691
|
+
? findConflictRowid(this.database, this.tableName, row, conflictColumns)
|
|
692
|
+
: null;
|
|
612
693
|
|
|
613
694
|
if (existingRowid !== null) {
|
|
614
695
|
updateRowid(this.database, this.tableName, existingRowid, row);
|
|
@@ -634,7 +715,12 @@ class LocalSqliteQueryBuilder implements PromiseLike<LocalSqliteQueryResult> {
|
|
|
634
715
|
};
|
|
635
716
|
}
|
|
636
717
|
|
|
637
|
-
const data = selectRowsByRowids(
|
|
718
|
+
const data = selectRowsByRowids(
|
|
719
|
+
this.database,
|
|
720
|
+
this.tableName,
|
|
721
|
+
rowids,
|
|
722
|
+
parseSelectedColumns(this.selectedColumns),
|
|
723
|
+
);
|
|
638
724
|
return this.finalizeDataResponse(data, null);
|
|
639
725
|
}
|
|
640
726
|
|
|
@@ -817,19 +903,24 @@ function ensureTable(
|
|
|
817
903
|
const columnsToEnsure = uniqueStrings([...requiredColumns, ...resolveUniqueIndexColumns(tableBaseName)]).filter(
|
|
818
904
|
(column) => column !== '*' && column !== 'id',
|
|
819
905
|
);
|
|
906
|
+
const columnsToEnsureWithIndexes = uniqueStrings([...columnsToEnsure, ...resolveReadIndexColumns(tableBaseName)]);
|
|
820
907
|
|
|
821
|
-
for (const column of
|
|
908
|
+
for (const column of columnsToEnsureWithIndexes) {
|
|
822
909
|
if (existingColumns.has(column)) {
|
|
823
910
|
continue;
|
|
824
911
|
}
|
|
825
912
|
|
|
826
913
|
database.exec(
|
|
827
|
-
`ALTER TABLE ${quoteIdentifier(tableName)} ADD COLUMN ${quoteIdentifier(column)} ${resolveSqliteColumnType(
|
|
914
|
+
`ALTER TABLE ${quoteIdentifier(tableName)} ADD COLUMN ${quoteIdentifier(column)} ${resolveSqliteColumnType(
|
|
915
|
+
tableBaseName,
|
|
916
|
+
column,
|
|
917
|
+
)}`,
|
|
828
918
|
);
|
|
829
919
|
existingColumns.add(column);
|
|
830
920
|
}
|
|
831
921
|
|
|
832
922
|
ensureUniqueIndexes(database, tableName, tableBaseName);
|
|
923
|
+
ensureReadIndexes(database, tableName, tableBaseName);
|
|
833
924
|
}
|
|
834
925
|
|
|
835
926
|
/**
|
|
@@ -841,7 +932,26 @@ function ensureUniqueIndexes(database: AgentsServerSqliteDatabase, tableName: st
|
|
|
841
932
|
for (const columns of uniqueIndexes) {
|
|
842
933
|
const indexName = `idx_${sanitizeSqlIdentifier(tableName)}_${columns.join('_')}_unique`;
|
|
843
934
|
const columnSql = columns.map(quoteIdentifier).join(', ');
|
|
844
|
-
database.exec(
|
|
935
|
+
database.exec(
|
|
936
|
+
`CREATE UNIQUE INDEX IF NOT EXISTS ${quoteIdentifier(indexName)} ON ${quoteIdentifier(
|
|
937
|
+
tableName,
|
|
938
|
+
)} (${columnSql})`,
|
|
939
|
+
);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* Creates known read indexes after required columns exist.
|
|
945
|
+
*/
|
|
946
|
+
function ensureReadIndexes(database: AgentsServerSqliteDatabase, tableName: string, tableBaseName: string): void {
|
|
947
|
+
const readIndexes = READ_INDEXES_BY_TABLE.get(tableBaseName) || [];
|
|
948
|
+
|
|
949
|
+
for (const readIndex of readIndexes) {
|
|
950
|
+
const indexName = `index_${sanitizeSqlIdentifier(tableName)}_${sanitizeSqlIdentifier(readIndex.name)}`;
|
|
951
|
+
const columnSql = readIndex.columns.map(quoteIdentifier).join(', ');
|
|
952
|
+
database.exec(
|
|
953
|
+
`CREATE INDEX IF NOT EXISTS ${quoteIdentifier(indexName)} ON ${quoteIdentifier(tableName)} (${columnSql})`,
|
|
954
|
+
);
|
|
845
955
|
}
|
|
846
956
|
}
|
|
847
957
|
|
|
@@ -861,7 +971,9 @@ function insertRow(
|
|
|
861
971
|
|
|
862
972
|
const placeholders = columns.map(() => '?').join(', ');
|
|
863
973
|
const values = columns.map((column) => serializeValue(tableName, column, row[column]));
|
|
864
|
-
const sql = `INSERT INTO ${quoteIdentifier(tableName)} (${columns
|
|
974
|
+
const sql = `INSERT INTO ${quoteIdentifier(tableName)} (${columns
|
|
975
|
+
.map(quoteIdentifier)
|
|
976
|
+
.join(', ')}) VALUES (${placeholders})`;
|
|
865
977
|
|
|
866
978
|
return database.prepare(sql).run(...values);
|
|
867
979
|
}
|
|
@@ -900,7 +1012,9 @@ function findConflictRowid(
|
|
|
900
1012
|
|
|
901
1013
|
const conditions = conflictColumns.map((column) => `${quoteIdentifier(column)} = ?`).join(' AND ');
|
|
902
1014
|
const values = conflictColumns.map((column) => serializeValue(tableName, column, row[column]));
|
|
903
|
-
const result = database
|
|
1015
|
+
const result = database
|
|
1016
|
+
.prepare(`SELECT rowid FROM ${quoteIdentifier(tableName)} WHERE ${conditions} LIMIT 1`)
|
|
1017
|
+
.get(...values);
|
|
904
1018
|
|
|
905
1019
|
return result ? (result.rowid as number | bigint) : null;
|
|
906
1020
|
}
|
|
@@ -922,7 +1036,9 @@ function selectRowsByRowids(
|
|
|
922
1036
|
const placeholders = rowids.map(() => '?').join(', ');
|
|
923
1037
|
const rows = database
|
|
924
1038
|
.prepare(
|
|
925
|
-
`SELECT ${createSelectExpression(selectedColumns)} FROM ${quoteIdentifier(
|
|
1039
|
+
`SELECT ${createSelectExpression(selectedColumns)} FROM ${quoteIdentifier(
|
|
1040
|
+
tableName,
|
|
1041
|
+
)} WHERE rowid IN (${placeholders})`,
|
|
926
1042
|
)
|
|
927
1043
|
.all(...rowids);
|
|
928
1044
|
|
|
@@ -941,17 +1057,25 @@ function createFilterCondition(
|
|
|
941
1057
|
|
|
942
1058
|
switch (filter.operator) {
|
|
943
1059
|
case 'eq':
|
|
944
|
-
return value === null
|
|
1060
|
+
return value === null
|
|
1061
|
+
? { sql: `${column} IS NULL`, values: [] }
|
|
1062
|
+
: { sql: `${column} = ?`, values: [value] };
|
|
945
1063
|
case 'neq':
|
|
946
1064
|
return value === null
|
|
947
1065
|
? { sql: `${column} IS NOT NULL`, values: [] }
|
|
948
1066
|
: { sql: `${column} <> ?`, values: [value] };
|
|
949
1067
|
case 'is':
|
|
950
|
-
return filter.value === null
|
|
1068
|
+
return filter.value === null
|
|
1069
|
+
? { sql: `${column} IS NULL`, values: [] }
|
|
1070
|
+
: { sql: `${column} IS ?`, values: [value] };
|
|
951
1071
|
case 'not-is':
|
|
952
|
-
return filter.value === null
|
|
1072
|
+
return filter.value === null
|
|
1073
|
+
? { sql: `${column} IS NOT NULL`, values: [] }
|
|
1074
|
+
: { sql: `${column} IS NOT ?`, values: [value] };
|
|
953
1075
|
case 'in': {
|
|
954
|
-
const values = Array.isArray(filter.value)
|
|
1076
|
+
const values = Array.isArray(filter.value)
|
|
1077
|
+
? filter.value.map((item) => serializeValue(tableName, filter.column, item))
|
|
1078
|
+
: [];
|
|
955
1079
|
if (values.length === 0) {
|
|
956
1080
|
return { sql: '0 = 1', values: [] };
|
|
957
1081
|
}
|
|
@@ -1190,6 +1314,30 @@ function withInsertDefaults(tableBaseName: string, row: Record<string, unknown>)
|
|
|
1190
1314
|
case 'User':
|
|
1191
1315
|
result.isAdmin ??= false;
|
|
1192
1316
|
result.profileImageUrl ??= null;
|
|
1317
|
+
result.email ??= null;
|
|
1318
|
+
result.displayName ??= null;
|
|
1319
|
+
result.authenticationProvider ??= 'LOCAL';
|
|
1320
|
+
break;
|
|
1321
|
+
case 'ShibbolethUserIdentity':
|
|
1322
|
+
result.displayName ??= null;
|
|
1323
|
+
result.nameId ??= null;
|
|
1324
|
+
result.nameIdFormat ??= null;
|
|
1325
|
+
result.unstructuredName ??= null;
|
|
1326
|
+
result.eduPersonPrincipalName ??= null;
|
|
1327
|
+
result.rawAttributes ??= null;
|
|
1328
|
+
result.lastLoggedInAt ??= null;
|
|
1329
|
+
result.loginCount ??= 0;
|
|
1330
|
+
break;
|
|
1331
|
+
case 'ShibbolethAuthenticationAttempt':
|
|
1332
|
+
result.userId ??= null;
|
|
1333
|
+
result.email ??= null;
|
|
1334
|
+
result.displayName ??= null;
|
|
1335
|
+
result.nameId ??= null;
|
|
1336
|
+
result.relayState ??= null;
|
|
1337
|
+
result.ip ??= null;
|
|
1338
|
+
result.userAgent ??= null;
|
|
1339
|
+
result.errorMessage ??= null;
|
|
1340
|
+
result.rawAttributes ??= null;
|
|
1193
1341
|
break;
|
|
1194
1342
|
case 'UserChat':
|
|
1195
1343
|
result.messages ??= [];
|
|
@@ -1242,6 +1390,9 @@ function serializeValue(tableName: string, column: string, value: unknown): unkn
|
|
|
1242
1390
|
if (value === null) {
|
|
1243
1391
|
return null;
|
|
1244
1392
|
}
|
|
1393
|
+
if (isTextColumn(tableName, column)) {
|
|
1394
|
+
return String(value);
|
|
1395
|
+
}
|
|
1245
1396
|
if (isJsonColumn(tableName, column)) {
|
|
1246
1397
|
return typeof value === 'string' ? value : JSON.stringify(value);
|
|
1247
1398
|
}
|
|
@@ -1260,6 +1411,8 @@ function deserializeRow(tableName: string, row: Record<string, unknown>): Record
|
|
|
1260
1411
|
for (const [column, value] of Object.entries(row)) {
|
|
1261
1412
|
if (value === null || value === undefined) {
|
|
1262
1413
|
result[column] = null;
|
|
1414
|
+
} else if (isTextColumn(tableName, column)) {
|
|
1415
|
+
result[column] = String(value);
|
|
1263
1416
|
} else if (isJsonColumn(tableName, column) && typeof value === 'string') {
|
|
1264
1417
|
result[column] = parseJsonValue(value);
|
|
1265
1418
|
} else if (BOOLEAN_COLUMNS.has(column)) {
|
|
@@ -1287,16 +1440,50 @@ function parseJsonValue(value: string): unknown {
|
|
|
1287
1440
|
* Resolves whether a column is JSON for a specific table.
|
|
1288
1441
|
*/
|
|
1289
1442
|
function isJsonColumn(tableName: string, column: string): boolean {
|
|
1290
|
-
return
|
|
1443
|
+
return isJsonColumnForTableBaseName(resolveTableBaseName(tableName), column);
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
/**
|
|
1447
|
+
* Resolves whether a column is JSON for a specific table base name.
|
|
1448
|
+
*/
|
|
1449
|
+
function isJsonColumnForTableBaseName(tableBaseName: string, column: string): boolean {
|
|
1450
|
+
return JSON_COLUMNS_BY_TABLE.get(tableBaseName)?.has(column) || false;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* Resolves whether a column should be forced to a string for a specific table.
|
|
1455
|
+
*/
|
|
1456
|
+
function isTextColumn(tableName: string, column: string): boolean {
|
|
1457
|
+
return isTextColumnForTableBaseName(resolveTableBaseName(tableName), column);
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* Resolves whether a column should be forced to a string for a specific table base name.
|
|
1462
|
+
*/
|
|
1463
|
+
function isTextColumnForTableBaseName(tableBaseName: string, column: string): boolean {
|
|
1464
|
+
return TEXT_COLUMNS_BY_TABLE.get(tableBaseName)?.has(column) || false;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
/**
|
|
1468
|
+
* Resolves whether a column is known to be numeric for a specific table base name.
|
|
1469
|
+
*/
|
|
1470
|
+
function isIntegerColumnForTableBaseName(tableBaseName: string, column: string): boolean {
|
|
1471
|
+
return INTEGER_COLUMNS_BY_TABLE.get(tableBaseName)?.has(column) || false;
|
|
1291
1472
|
}
|
|
1292
1473
|
|
|
1293
1474
|
/**
|
|
1294
1475
|
* Resolves SQLite column affinity for dynamically added columns.
|
|
1295
1476
|
*/
|
|
1296
|
-
function resolveSqliteColumnType(column: string): string {
|
|
1477
|
+
function resolveSqliteColumnType(tableBaseName: string, column: string): string {
|
|
1478
|
+
if (isTextColumnForTableBaseName(tableBaseName, column) || isJsonColumnForTableBaseName(tableBaseName, column)) {
|
|
1479
|
+
return 'TEXT';
|
|
1480
|
+
}
|
|
1297
1481
|
if (BOOLEAN_COLUMNS.has(column)) {
|
|
1298
1482
|
return 'INTEGER';
|
|
1299
1483
|
}
|
|
1484
|
+
if (isIntegerColumnForTableBaseName(tableBaseName, column)) {
|
|
1485
|
+
return 'INTEGER';
|
|
1486
|
+
}
|
|
1300
1487
|
if (
|
|
1301
1488
|
column === 'id' ||
|
|
1302
1489
|
column.endsWith('Id') ||
|
|
@@ -1305,8 +1492,7 @@ function resolveSqliteColumnType(column: string): string {
|
|
|
1305
1492
|
column.endsWith('Bytes') ||
|
|
1306
1493
|
column === 'sortOrder' ||
|
|
1307
1494
|
column === 'attemptCount' ||
|
|
1308
|
-
column === 'runCount'
|
|
1309
|
-
column === 'value'
|
|
1495
|
+
column === 'runCount'
|
|
1310
1496
|
) {
|
|
1311
1497
|
return 'INTEGER';
|
|
1312
1498
|
}
|
|
@@ -1339,13 +1525,17 @@ function resolveUniqueIndexColumns(tableBaseName: string): Array<string> {
|
|
|
1339
1525
|
return (UNIQUE_INDEX_COLUMNS_BY_TABLE.get(tableBaseName) || []).flatMap((columns) => [...columns]);
|
|
1340
1526
|
}
|
|
1341
1527
|
|
|
1528
|
+
/**
|
|
1529
|
+
* Resolves columns participating in known read indexes.
|
|
1530
|
+
*/
|
|
1531
|
+
function resolveReadIndexColumns(tableBaseName: string): Array<string> {
|
|
1532
|
+
return (READ_INDEXES_BY_TABLE.get(tableBaseName) || []).flatMap((readIndex) => [...readIndex.columns]);
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1342
1535
|
/**
|
|
1343
1536
|
* Resolves upsert conflict columns.
|
|
1344
1537
|
*/
|
|
1345
|
-
function resolveUpsertConflictColumns(
|
|
1346
|
-
tableBaseName: string,
|
|
1347
|
-
options: LocalSqliteUpsertOptions,
|
|
1348
|
-
): ReadonlyArray<string> {
|
|
1538
|
+
function resolveUpsertConflictColumns(tableBaseName: string, options: LocalSqliteUpsertOptions): ReadonlyArray<string> {
|
|
1349
1539
|
if (options.onConflict) {
|
|
1350
1540
|
return options.onConflict
|
|
1351
1541
|
.split(',')
|
|
@@ -1367,7 +1557,10 @@ function normalizeSqliteError(error: unknown): LocalSqliteError {
|
|
|
1367
1557
|
: undefined;
|
|
1368
1558
|
|
|
1369
1559
|
return {
|
|
1370
|
-
code:
|
|
1560
|
+
code:
|
|
1561
|
+
sqliteCode === 'SQLITE_CONSTRAINT_UNIQUE' || sqliteCode === 'SQLITE_CONSTRAINT_PRIMARYKEY'
|
|
1562
|
+
? '23505'
|
|
1563
|
+
: sqliteCode,
|
|
1371
1564
|
message,
|
|
1372
1565
|
};
|
|
1373
1566
|
}
|
|
@@ -25,9 +25,12 @@ export const RESERVED_PATHS: readonly string[] = [
|
|
|
25
25
|
"manifest.webmanifest",
|
|
26
26
|
"openapi.json",
|
|
27
27
|
"pixel-agents-assets",
|
|
28
|
+
"promptbook-logo-blue.png",
|
|
29
|
+
"promptbook-logo-white.png",
|
|
28
30
|
"recycle-bin",
|
|
29
31
|
"restricted",
|
|
30
32
|
"robots.txt",
|
|
33
|
+
"s3",
|
|
31
34
|
"search",
|
|
32
35
|
"security.txt",
|
|
33
36
|
"sitemap.xml",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as Sentry from '@sentry/nextjs';
|
|
2
|
+
import {
|
|
3
|
+
createSentrySdkTags,
|
|
4
|
+
resolveBrowserSentryDsn,
|
|
5
|
+
resolveSentrySdkEnvironment,
|
|
6
|
+
resolveSentrySdkRelease,
|
|
7
|
+
SENTRY_TRACE_PROPAGATION_TARGETS,
|
|
8
|
+
SENTRY_TRACES_SAMPLE_RATE,
|
|
9
|
+
} from './utils/errorReporting/sentrySdkConfig';
|
|
10
|
+
|
|
11
|
+
Sentry.init({
|
|
12
|
+
dsn: resolveBrowserSentryDsn(),
|
|
13
|
+
tracesSampleRate: SENTRY_TRACES_SAMPLE_RATE,
|
|
14
|
+
environment: resolveSentrySdkEnvironment(),
|
|
15
|
+
release: resolveSentrySdkRelease(),
|
|
16
|
+
integrations: [Sentry.browserTracingIntegration()],
|
|
17
|
+
tracePropagationTargets: SENTRY_TRACE_PROPAGATION_TARGETS,
|
|
18
|
+
initialScope: {
|
|
19
|
+
tags: createSentrySdkTags(),
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Reports app-router navigation spans to Sentry.
|
|
25
|
+
*
|
|
26
|
+
* @private Sentry hook for Next.js client navigation instrumentation
|
|
27
|
+
*/
|
|
28
|
+
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as Sentry from '@sentry/nextjs';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Registers startup hooks for the Agents Server runtime.
|
|
3
5
|
*
|
|
@@ -5,11 +7,21 @@
|
|
|
5
7
|
* @private internal startup hook for Agents Server runtime
|
|
6
8
|
*/
|
|
7
9
|
export async function register(): Promise<void> {
|
|
10
|
+
if (process.env.NEXT_RUNTIME === 'edge') {
|
|
11
|
+
await import('./sentry.edge.config');
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
if (process.env.NEXT_RUNTIME !== 'nodejs') {
|
|
9
16
|
return;
|
|
10
17
|
}
|
|
11
18
|
|
|
12
19
|
try {
|
|
20
|
+
await import('./sentry.server.config');
|
|
21
|
+
|
|
22
|
+
const { registerServerErrorSentryLogging } = await import('./utils/errorReporting/registerServerErrorSentryLogging');
|
|
23
|
+
registerServerErrorSentryLogging();
|
|
24
|
+
|
|
13
25
|
const { registerNodeRuntimeInstrumentation } = await import('./instrumentation-node');
|
|
14
26
|
await registerNodeRuntimeInstrumentation();
|
|
15
27
|
} catch (error) {
|
|
@@ -22,3 +34,10 @@ export async function register(): Promise<void> {
|
|
|
22
34
|
});
|
|
23
35
|
}
|
|
24
36
|
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Reports request errors from the Next.js app router to Sentry.
|
|
40
|
+
*
|
|
41
|
+
* @private Sentry hook for Next.js request instrumentation
|
|
42
|
+
*/
|
|
43
|
+
export const onRequestError = Sentry.captureRequestError;
|
|
@@ -128,6 +128,7 @@ export const SERVER_TRANSLATION_KEYS = [
|
|
|
128
128
|
'header.myAccount',
|
|
129
129
|
'header.superAdmin',
|
|
130
130
|
'header.administration',
|
|
131
|
+
'header.loginMethods',
|
|
131
132
|
'header.monitoringAndUsage',
|
|
132
133
|
'header.integrationsAndKeys',
|
|
133
134
|
'header.developerDebug',
|
|
@@ -168,6 +169,7 @@ export const SERVER_TRANSLATION_KEYS = [
|
|
|
168
169
|
'header.imagesGallery',
|
|
169
170
|
'header.files',
|
|
170
171
|
'header.users',
|
|
172
|
+
'header.shibboleth',
|
|
171
173
|
'header.versionInfo',
|
|
172
174
|
'header.experiments',
|
|
173
175
|
'header.story',
|
|
@@ -198,6 +200,8 @@ export const SERVER_TRANSLATION_KEYS = [
|
|
|
198
200
|
'login.passwordPlaceholder',
|
|
199
201
|
'login.loggingIn',
|
|
200
202
|
'login.loginAction',
|
|
203
|
+
'login.shibbolethLoginAction',
|
|
204
|
+
'login.shibbolethNotConfigured',
|
|
201
205
|
'login.forgottenPassword',
|
|
202
206
|
'login.registerNewUser',
|
|
203
207
|
'login.errorOccurred',
|
|
@@ -122,6 +122,7 @@ header.menuLabel: Nabídka
|
|
|
122
122
|
header.myAccount: Můj účet
|
|
123
123
|
header.superAdmin: Super administrace
|
|
124
124
|
header.administration: Administrace
|
|
125
|
+
header.loginMethods: Metody přihlášení
|
|
125
126
|
header.monitoringAndUsage: Monitoring a využití
|
|
126
127
|
header.integrationsAndKeys: Integrace a klíče
|
|
127
128
|
header.developerDebug: Vývoj a ladění
|
|
@@ -162,6 +163,7 @@ header.errorSimulation: Simulace chyb
|
|
|
162
163
|
header.imagesGallery: Galerie obrázků
|
|
163
164
|
header.files: Soubory
|
|
164
165
|
header.users: Uživatelé
|
|
166
|
+
header.shibboleth: Shibboleth
|
|
165
167
|
header.versionInfo: Informace o verzi
|
|
166
168
|
header.experiments: Experimenty
|
|
167
169
|
header.story: Příběh
|
|
@@ -192,6 +194,8 @@ login.passwordLabel: Heslo
|
|
|
192
194
|
login.passwordPlaceholder: Zadejte heslo
|
|
193
195
|
login.loggingIn: Přihlašuji…
|
|
194
196
|
login.loginAction: Přihlásit se
|
|
197
|
+
login.shibbolethLoginAction: Pokračovat přes Shibboleth
|
|
198
|
+
login.shibbolethNotConfigured: Přihlášení přes Shibboleth je aktivní, ale vyžaduje nastavení správcem.
|
|
195
199
|
login.forgottenPassword: Zapomněli jste heslo?
|
|
196
200
|
login.registerNewUser: Zaregistrovat nového uživatele
|
|
197
201
|
login.errorOccurred: Došlo k chybě
|
|
@@ -376,7 +380,7 @@ footer.logosAndBranding: Loga a vizuální identita
|
|
|
376
380
|
footer.connectSectionTitle: Spojte se s námi
|
|
377
381
|
footer.linksSectionTitle: Odkazy
|
|
378
382
|
footer.allRightsReserved: Všechna práva vyhrazena.
|
|
379
|
-
footer.madeInCzechRepublic: Vytvořeno s
|
|
383
|
+
footer.madeInCzechRepublic: Vytvořeno s {emoji} v České republice.
|
|
380
384
|
footer.engineVersion: Verze jádra Promptbooku
|
|
381
385
|
forbidden.title: 403 Zakázáno
|
|
382
386
|
forbidden.message: Nemáte oprávnění k přístupu na tuto stránku.
|
|
@@ -124,6 +124,7 @@ header.menuLabel: Menu
|
|
|
124
124
|
header.myAccount: My Account
|
|
125
125
|
header.superAdmin: Super Admin
|
|
126
126
|
header.administration: Administration
|
|
127
|
+
header.loginMethods: Login Methods
|
|
127
128
|
header.monitoringAndUsage: Monitoring & Usage
|
|
128
129
|
header.integrationsAndKeys: Integrations & Keys
|
|
129
130
|
header.developerDebug: Developer / Debug
|
|
@@ -164,6 +165,7 @@ header.errorSimulation: Error simulation
|
|
|
164
165
|
header.imagesGallery: Images gallery
|
|
165
166
|
header.files: Files
|
|
166
167
|
header.users: Users
|
|
168
|
+
header.shibboleth: Shibboleth
|
|
167
169
|
header.versionInfo: Version info
|
|
168
170
|
header.experiments: Experiments
|
|
169
171
|
header.story: Story
|
|
@@ -194,6 +196,8 @@ login.passwordLabel: Password
|
|
|
194
196
|
login.passwordPlaceholder: Enter your password
|
|
195
197
|
login.loggingIn: Logging in...
|
|
196
198
|
login.loginAction: Log in
|
|
199
|
+
login.shibbolethLoginAction: Continue with Shibboleth
|
|
200
|
+
login.shibbolethNotConfigured: Shibboleth login is active but needs administrator setup.
|
|
197
201
|
login.forgottenPassword: Forgotten password?
|
|
198
202
|
login.registerNewUser: Register new user
|
|
199
203
|
login.errorOccurred: An error occurred
|
|
@@ -380,7 +384,7 @@ footer.logosAndBranding: Logos & Branding
|
|
|
380
384
|
footer.connectSectionTitle: Connect
|
|
381
385
|
footer.linksSectionTitle: Links
|
|
382
386
|
footer.allRightsReserved: All rights reserved.
|
|
383
|
-
footer.madeInCzechRepublic: Made with
|
|
387
|
+
footer.madeInCzechRepublic: Made with {emoji} in Europe
|
|
384
388
|
footer.engineVersion: Promptbook engine version
|
|
385
389
|
forbidden.title: 403 Forbidden
|
|
386
390
|
forbidden.message: You do not have permission to access this page.
|