@promptbook/cli 0.112.0-99 → 0.112.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 +37 -21
- package/agents/default/developer.book +23 -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 +20 -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 +608 -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/agents/[agentName]/route.ts +33 -9
- 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 +4 -0
- 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/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/AgentsList.tsx +19 -1
- package/apps/agents-server/src/components/Homepage/AgentsListHeader.tsx +44 -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/useAgentsListImportExportState.ts +525 -0
- package/apps/agents-server/src/components/Homepage/useAgentsListState.ts +14 -0
- 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 +22 -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 +236 -0
- package/apps/agents-server/src/database/seedDefaultAgents.ts +225 -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/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/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/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 +22 -7
- 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/processLocalUserChatJob.ts +23 -8
- 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 +26 -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 +8 -88
- 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 +99 -0
- package/apps/agents-server/src/utils/userChat/createUserChatRunnerProgressCard.ts +63 -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 +0 -1
- package/apps/agents-server/src/utils/userChat/userChatProgressCard.ts +366 -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 +816 -59
- package/esm/apps/agents-server/src/constants/federatedAgentImport.d.ts +42 -0
- package/esm/apps/agents-server/src/constants/serverLimits.d.ts +207 -0
- package/esm/apps/agents-server/src/constants/toolUsageLimits.d.ts +55 -0
- package/esm/index.es.js +23985 -18820
- 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/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 +0 -2
- package/esm/src/_packages/node.index.d.ts +40 -0
- package/esm/src/_packages/types.index.d.ts +18 -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-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 +1 -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 +17 -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/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
- package/esm/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -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 +0 -2
- package/src/_packages/node.index.ts +40 -0
- package/src/_packages/types.index.ts +18 -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/createAgentModelRequirementsWithCommitments/augmentAgentModelRequirementsFromSource.ts +18 -2
- 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 +78 -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 +55 -89
- 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 +188 -24
- 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 +250 -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 +78 -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/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.ts +91 -14
- 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/TEAM/TEAM.ts +12 -1
- package/src/commitments/USE_PROJECT/createUseProjectToolFunctions.ts +8 -1
- package/src/commitments/_common/teamInternalAgentAccess.ts +14 -8
- 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 +741 -788
- 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 +32 -0
- package/umd/apps/agents-server/src/constants/federatedAgentImport.d.ts +42 -0
- package/umd/apps/agents-server/src/constants/serverLimits.d.ts +207 -0
- package/umd/apps/agents-server/src/constants/toolUsageLimits.d.ts +55 -0
- package/umd/index.umd.js +23723 -18556
- 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/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 +0 -2
- package/umd/src/_packages/node.index.d.ts +40 -0
- package/umd/src/_packages/types.index.d.ts +18 -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-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 +1 -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 +17 -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/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
- package/umd/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -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
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
The browser package provides browser-specific functionality for Promptbook, including localStorage integration, IndexedDB storage, and browser-compatible scrapers. It enables Promptbook to run efficiently in web browser environments.
|
|
2
|
-
|
|
3
|
-
## 🎯 Purpose and Motivation
|
|
4
|
-
|
|
5
|
-
This package extends Promptbook's core functionality with browser-specific features that are essential for web applications. It provides browser storage APIs, user interface tools, and browser-compatible scrapers that enable full-featured Promptbook applications in web environments.
|
|
6
|
-
|
|
7
|
-
## 🔧 High-Level Functionality
|
|
8
|
-
|
|
9
|
-
The package provides browser-specific integrations and utilities:
|
|
10
|
-
- **Browser Storage**: Integration with localStorage, sessionStorage, and IndexedDB
|
|
11
|
-
- **User Interface Tools**: Simple prompt interface for browser interactions
|
|
12
|
-
- **Browser Scrapers**: Browser-compatible content scrapers
|
|
13
|
-
- **Web Compatibility**: Ensures Promptbook works seamlessly in browser environments
|
|
14
|
-
- **Client-side Caching**: Efficient caching using browser storage APIs
|
|
15
|
-
|
|
16
|
-
## ✨ Key Features
|
|
17
|
-
|
|
18
|
-
- 💾 **Multiple Storage Options** - Support for localStorage, sessionStorage, and IndexedDB
|
|
19
|
-
- 🌐 **Browser-native APIs** - Leverage browser-specific capabilities and storage
|
|
20
|
-
- 🎨 **Simple UI Tools** - Basic interface tools for browser-based interactions
|
|
21
|
-
- 📱 **Cross-browser Compatibility** - Works across modern web browsers
|
|
22
|
-
- 🔒 **Client-side Security** - Secure storage and execution in browser sandbox
|
|
23
|
-
- ⚡ **Performance Optimized** - Efficient storage and caching for web applications
|
|
24
|
-
- 🛠️ **Web Scrapers** - Browser-compatible content scraping capabilities
|
|
25
|
-
|
|
26
|
-
## 📦 Exported Entities
|
|
27
|
-
|
|
28
|
-
### Version Information
|
|
29
|
-
- `BOOK_LANGUAGE_VERSION` - Current book language version
|
|
30
|
-
- `PROMPTBOOK_ENGINE_VERSION` - Current engine version
|
|
31
|
-
|
|
32
|
-
### User Interface Tools
|
|
33
|
-
- `SimplePromptInterfaceTools` - Simple prompt interface for browser interactions
|
|
34
|
-
|
|
35
|
-
### Browser Scrapers
|
|
36
|
-
- `$provideScrapersForBrowser` - Provide browser-compatible knowledge scrapers
|
|
37
|
-
|
|
38
|
-
### Storage APIs
|
|
39
|
-
- `getIndexedDbStorage` - Get IndexedDB storage implementation
|
|
40
|
-
- `getLocalStorage` - Get localStorage storage implementation
|
|
41
|
-
- `getSessionStorage` - Get sessionStorage storage implementation
|
|
42
|
-
|
|
43
|
-
> 💡 This package does not make sense on its own, look at [all promptbook packages](#-packages) or just install all by `npm i ptbk`
|
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
// TODO: Uncomment the test
|
|
2
|
-
|
|
3
|
-
import { describe, expect, it } from '@jest/globals';
|
|
4
|
-
import { spaceTrim } from 'spacetrim';
|
|
5
|
-
import { validateBook } from '../../agent-source/string_book';
|
|
6
|
-
import { parseAgentSourceWithCommitments } from './parseAgentSourceWithCommitments';
|
|
7
|
-
|
|
8
|
-
describe('parseAgentSourceWithCommitments with multiline support', () => {
|
|
9
|
-
it('should parse single-line commitments correctly', () => {
|
|
10
|
-
const agentSource = validateBook(
|
|
11
|
-
spaceTrim(`
|
|
12
|
-
Test Agent
|
|
13
|
-
PERSONA Some persona description
|
|
14
|
-
KNOWLEDGE https://example.com/knowledge.pdf
|
|
15
|
-
`),
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const result = parseAgentSourceWithCommitments(agentSource);
|
|
19
|
-
|
|
20
|
-
expect(result.agentName).toBe('Test Agent');
|
|
21
|
-
expect(result.commitments).toHaveLength(2);
|
|
22
|
-
|
|
23
|
-
expect(result.commitments[0]).toEqual({
|
|
24
|
-
type: 'PERSONA',
|
|
25
|
-
content: 'Some persona description',
|
|
26
|
-
originalLine: 'PERSONA Some persona description',
|
|
27
|
-
lineNumber: 2,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
expect(result.commitments[1]).toEqual({
|
|
31
|
-
type: 'KNOWLEDGE',
|
|
32
|
-
content: 'https://example.com/knowledge.pdf',
|
|
33
|
-
originalLine: 'KNOWLEDGE https://example.com/knowledge.pdf',
|
|
34
|
-
lineNumber: 3,
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('should parse multiline commitments correctly', () => {
|
|
39
|
-
const agentSource = validateBook(
|
|
40
|
-
spaceTrim(`
|
|
41
|
-
Test Agent
|
|
42
|
-
PERSONA Another persona description
|
|
43
|
-
which is continued on the next line
|
|
44
|
-
and also on the next line
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
and also on the next paragraph
|
|
48
|
-
PERSONA New persona description
|
|
49
|
-
KNOWLEDGE Some knowledge description
|
|
50
|
-
|
|
51
|
-
which is continued on the next line
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
PERSONA Yet another persona description
|
|
55
|
-
continued description of the PERSONA
|
|
56
|
-
and continued on the next line because the last keyword PERSONA was not at the start of the line
|
|
57
|
-
`),
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
const result = parseAgentSourceWithCommitments(agentSource);
|
|
61
|
-
|
|
62
|
-
expect(result.agentName).toBe('Test Agent');
|
|
63
|
-
expect(result.commitments).toHaveLength(3);
|
|
64
|
-
|
|
65
|
-
// First multiline PERSONA
|
|
66
|
-
expect(result.commitments[0]).toEqual({
|
|
67
|
-
type: 'PERSONA',
|
|
68
|
-
content: spaceTrim(`
|
|
69
|
-
Another persona description
|
|
70
|
-
which is continued on the next line
|
|
71
|
-
and also on the next line
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
and also on the next paragraph
|
|
75
|
-
`),
|
|
76
|
-
originalLine: 'PERSONA Another persona description',
|
|
77
|
-
lineNumber: 2,
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
// Second PERSONA (single line)
|
|
81
|
-
expect(result.commitments[1]).toEqual({
|
|
82
|
-
type: 'PERSONA',
|
|
83
|
-
content: 'New persona description',
|
|
84
|
-
originalLine: 'PERSONA New persona description',
|
|
85
|
-
lineNumber: 8,
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// KNOWLEDGE with multiline content
|
|
89
|
-
expect(result.commitments[2]).toEqual({
|
|
90
|
-
type: 'KNOWLEDGE',
|
|
91
|
-
content: spaceTrim(`
|
|
92
|
-
Some knowledge description
|
|
93
|
-
|
|
94
|
-
which is continued on the next line
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
PERSONA Yet another persona description
|
|
98
|
-
continued description of the PERSONA
|
|
99
|
-
and continued on the next line because the last keyword PERSONA was not at the start of the line
|
|
100
|
-
`),
|
|
101
|
-
originalLine: 'KNOWLEDGE Some knowledge description',
|
|
102
|
-
lineNumber: 9,
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('should handle the exact example from the requirements', () => {
|
|
107
|
-
const agentSource = validateBook(`Test Agent
|
|
108
|
-
PERSONA Some persona description
|
|
109
|
-
PERSONA Another persona description
|
|
110
|
-
which is continued on the next line
|
|
111
|
-
and also on the next line
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
and also on the next paragraph
|
|
115
|
-
PERSONA New persona description
|
|
116
|
-
KNOWLEDGE https://example.com/knowledge.pdf
|
|
117
|
-
KNOWLEDGE Some knowledge description
|
|
118
|
-
|
|
119
|
-
which is continued on the next line
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
PERSONA Yet another persona description
|
|
123
|
-
continued description of the PERSONA
|
|
124
|
-
and continued on the next line because the last keyword PERSONA was not at the start of the line`);
|
|
125
|
-
|
|
126
|
-
const result = parseAgentSourceWithCommitments(agentSource);
|
|
127
|
-
|
|
128
|
-
expect(result.agentName).toBe('Test Agent');
|
|
129
|
-
expect(result.commitments).toHaveLength(6);
|
|
130
|
-
|
|
131
|
-
// First PERSONA (single line)
|
|
132
|
-
expect(result.commitments[0]).toEqual({
|
|
133
|
-
type: 'PERSONA',
|
|
134
|
-
content: 'Some persona description',
|
|
135
|
-
originalLine: 'PERSONA Some persona description',
|
|
136
|
-
lineNumber: 2,
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
// Second PERSONA (multiline)
|
|
140
|
-
expect(result.commitments[1]).toEqual({
|
|
141
|
-
type: 'PERSONA',
|
|
142
|
-
content: `Another persona description
|
|
143
|
-
which is continued on the next line
|
|
144
|
-
and also on the next line
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
and also on the next paragraph`,
|
|
148
|
-
originalLine: 'PERSONA Another persona description',
|
|
149
|
-
lineNumber: 3,
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
// Third PERSONA (single line)
|
|
153
|
-
expect(result.commitments[2]).toEqual({
|
|
154
|
-
type: 'PERSONA',
|
|
155
|
-
content: 'New persona description',
|
|
156
|
-
originalLine: 'PERSONA New persona description',
|
|
157
|
-
lineNumber: 9,
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
// First KNOWLEDGE (single line)
|
|
161
|
-
expect(result.commitments[3]).toEqual({
|
|
162
|
-
type: 'KNOWLEDGE',
|
|
163
|
-
content: 'https://example.com/knowledge.pdf',
|
|
164
|
-
originalLine: 'KNOWLEDGE https://example.com/knowledge.pdf',
|
|
165
|
-
lineNumber: 10,
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
// Second KNOWLEDGE (multiline)
|
|
169
|
-
expect(result.commitments[4]).toEqual({
|
|
170
|
-
type: 'KNOWLEDGE',
|
|
171
|
-
content: `Some knowledge description
|
|
172
|
-
|
|
173
|
-
which is continued on the next line
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
`,
|
|
177
|
-
originalLine: 'KNOWLEDGE Some knowledge description',
|
|
178
|
-
lineNumber: 11,
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
// Fourth PERSONA (multiline, continues until end)
|
|
182
|
-
expect(result.commitments[5]).toEqual({
|
|
183
|
-
type: 'PERSONA',
|
|
184
|
-
content: `Yet another persona description
|
|
185
|
-
continued description of the PERSONA
|
|
186
|
-
and continued on the next line because the last keyword PERSONA was not at the start of the line`,
|
|
187
|
-
originalLine: 'PERSONA Yet another persona description',
|
|
188
|
-
lineNumber: 15,
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
it('should handle empty lines and preserve spacing in multiline content', () => {
|
|
193
|
-
const agentSource = validateBook(`Test Agent
|
|
194
|
-
PERSONA First persona
|
|
195
|
-
|
|
196
|
-
with empty line above
|
|
197
|
-
PERSONA Second persona`);
|
|
198
|
-
|
|
199
|
-
const result = parseAgentSourceWithCommitments(agentSource);
|
|
200
|
-
|
|
201
|
-
expect(result.commitments).toHaveLength(2);
|
|
202
|
-
|
|
203
|
-
expect(result.commitments[0]).toEqual({
|
|
204
|
-
type: 'PERSONA',
|
|
205
|
-
content: `First persona
|
|
206
|
-
|
|
207
|
-
with empty line above`,
|
|
208
|
-
originalLine: 'PERSONA First persona',
|
|
209
|
-
lineNumber: 2,
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
expect(result.commitments[1]).toEqual({
|
|
213
|
-
type: 'PERSONA',
|
|
214
|
-
content: 'Second persona',
|
|
215
|
-
originalLine: 'PERSONA Second persona',
|
|
216
|
-
lineNumber: 5,
|
|
217
|
-
});
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
it('should handle commitments with no initial content on the same line', () => {
|
|
221
|
-
const agentSource = validateBook(`Test Agent
|
|
222
|
-
PERSONA
|
|
223
|
-
This is the content
|
|
224
|
-
that continues on multiple lines
|
|
225
|
-
KNOWLEDGE
|
|
226
|
-
https://example.com/knowledge.pdf`);
|
|
227
|
-
|
|
228
|
-
const result = parseAgentSourceWithCommitments(agentSource);
|
|
229
|
-
|
|
230
|
-
expect(result.commitments).toHaveLength(2);
|
|
231
|
-
|
|
232
|
-
expect(result.commitments[0]).toEqual({
|
|
233
|
-
type: 'PERSONA',
|
|
234
|
-
content: `This is the content
|
|
235
|
-
that continues on multiple lines`,
|
|
236
|
-
originalLine: 'PERSONA',
|
|
237
|
-
lineNumber: 2,
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
expect(result.commitments[1]).toEqual({
|
|
241
|
-
type: 'KNOWLEDGE',
|
|
242
|
-
content: 'https://example.com/knowledge.pdf',
|
|
243
|
-
originalLine: 'KNOWLEDGE',
|
|
244
|
-
lineNumber: 5,
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
it('should handle non-commitment lines correctly', () => {
|
|
249
|
-
const agentSource = validateBook(`Test Agent
|
|
250
|
-
This is not a commitment
|
|
251
|
-
PERSONA Some persona
|
|
252
|
-
Another line that is not a commitment
|
|
253
|
-
KNOWLEDGE Some knowledge
|
|
254
|
-
Final non-commitment line`);
|
|
255
|
-
|
|
256
|
-
const result = parseAgentSourceWithCommitments(agentSource);
|
|
257
|
-
|
|
258
|
-
expect(result.commitments).toHaveLength(2);
|
|
259
|
-
expect(result.nonCommitmentLines).toEqual([
|
|
260
|
-
'Test Agent',
|
|
261
|
-
'This is not a commitment',
|
|
262
|
-
'Final non-commitment line',
|
|
263
|
-
]);
|
|
264
|
-
});
|
|
265
|
-
});
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/** @jest-environment jsdom */
|
|
2
|
-
|
|
3
|
-
import { describe, expect, it, jest } from '@jest/globals';
|
|
4
|
-
import { render } from '@testing-library/react';
|
|
5
|
-
import { string_book } from '../../book-2.0/agent-source/string_book';
|
|
6
|
-
import { BookEditorMonaco } from './BookEditorMonaco';
|
|
7
|
-
|
|
8
|
-
// Mock the monaco editor
|
|
9
|
-
const mockSetMonarchTokensProvider = jest.fn();
|
|
10
|
-
const mockDispose = jest.fn();
|
|
11
|
-
mockSetMonarchTokensProvider.mockReturnValue({ dispose: mockDispose });
|
|
12
|
-
|
|
13
|
-
jest.mock('@monaco-editor/react', () => ({
|
|
14
|
-
__esModule: true,
|
|
15
|
-
Editor: (props: { [key: string]: unknown }) => <div data-testid="mock-editor">{JSON.stringify(props)}</div>,
|
|
16
|
-
useMonaco: () => ({
|
|
17
|
-
languages: {
|
|
18
|
-
register: jest.fn(),
|
|
19
|
-
setMonarchTokensProvider: mockSetMonarchTokensProvider,
|
|
20
|
-
registerCompletionItemProvider: jest.fn(() => ({ dispose: jest.fn() })),
|
|
21
|
-
},
|
|
22
|
-
editor: {
|
|
23
|
-
defineTheme: jest.fn(),
|
|
24
|
-
setTheme: jest.fn(),
|
|
25
|
-
},
|
|
26
|
-
}),
|
|
27
|
-
}));
|
|
28
|
-
|
|
29
|
-
// Mock other dependencies
|
|
30
|
-
jest.mock('../../book-2.0/commitments', () => ({
|
|
31
|
-
getAllCommitmentDefinitions: () => [{ type: 'ASK' }, { type: 'TELL' }, { type: 'META' }],
|
|
32
|
-
}));
|
|
33
|
-
|
|
34
|
-
jest.mock('../../config', () => ({
|
|
35
|
-
PROMPTBOOK_SYNTAX_COLORS: {
|
|
36
|
-
TITLE: { toHex: () => '#000000' },
|
|
37
|
-
COMMITMENT: { toHex: () => '#000000' },
|
|
38
|
-
PARAMETER: { toHex: () => '#000000' },
|
|
39
|
-
},
|
|
40
|
-
}));
|
|
41
|
-
|
|
42
|
-
describe('BookEditorMonaco', () => {
|
|
43
|
-
it('should use a regex that supports international characters for parameters', () => {
|
|
44
|
-
render(<BookEditorMonaco value={'' as string_book} isReadonly={false} />);
|
|
45
|
-
|
|
46
|
-
expect(mockSetMonarchTokensProvider).toHaveBeenCalled();
|
|
47
|
-
|
|
48
|
-
const monarchTokensProvider = mockSetMonarchTokensProvider!.mock!.calls[0]![1]! as {
|
|
49
|
-
tokenizer: { body: [RegExp, string][] };
|
|
50
|
-
};
|
|
51
|
-
const bookRules = monarchTokensProvider.tokenizer.body;
|
|
52
|
-
|
|
53
|
-
const parameterRule = bookRules.find((rule) => rule[1] === 'parameter');
|
|
54
|
-
expect(parameterRule).toBeDefined();
|
|
55
|
-
|
|
56
|
-
const parameterRegex = parameterRule![0];
|
|
57
|
-
expect(parameterRegex).toBeInstanceOf(RegExp);
|
|
58
|
-
|
|
59
|
-
// Test the regex with various strings
|
|
60
|
-
const textWithParams = 'Tohle je @Slovník a také @мир.';
|
|
61
|
-
const matches = textWithParams.match(new RegExp(parameterRegex.source, 'g'));
|
|
62
|
-
expect(matches).toEqual(['@Slovník', '@мир']);
|
|
63
|
-
|
|
64
|
-
expect('@Slovník'.match(parameterRegex)?.[0]).toBe('@Slovník');
|
|
65
|
-
expect('@мир'.match(parameterRegex)?.[0]).toBe('@мир');
|
|
66
|
-
expect('@parameter123'.match(parameterRegex)?.[0]).toBe('@parameter123');
|
|
67
|
-
expect('@onlyAscii'.match(parameterRegex)?.[0]).toBe('@onlyAscii');
|
|
68
|
-
expect('not a parameter'.match(parameterRegex)).toBeNull();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
describe('BookEditorMonaco padding', () => {
|
|
72
|
-
it('should add 5 empty lines to an empty book', () => {
|
|
73
|
-
const { getByTestId } = render(<BookEditorMonaco value={undefined} isReadonly={false} />);
|
|
74
|
-
const editor = getByTestId('mock-editor');
|
|
75
|
-
const props = JSON.parse(editor.textContent || '{}');
|
|
76
|
-
expect(props.value).toBe('\n\n\n\n\n');
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should add 5 empty lines to a book with no trailing newlines', () => {
|
|
80
|
-
const { getByTestId } = render(<BookEditorMonaco value={'Hello' as string_book} isReadonly={false} />);
|
|
81
|
-
const editor = getByTestId('mock-editor');
|
|
82
|
-
const props = JSON.parse(editor.textContent || '{}');
|
|
83
|
-
expect(props.value).toBe('Hello\n\n\n\n\n');
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
it('should add remaining empty lines to a book with some trailing newlines', () => {
|
|
87
|
-
const { getByTestId } = render(<BookEditorMonaco value={'Hello\n\n' as string_book} isReadonly={false} />);
|
|
88
|
-
const editor = getByTestId('mock-editor');
|
|
89
|
-
const props = JSON.parse(editor.textContent || '{}');
|
|
90
|
-
expect(props.value).toBe('Hello\n\n\n\n\n');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('should not add empty lines to a book with 5 trailing newlines', () => {
|
|
94
|
-
const { getByTestId } = render(
|
|
95
|
-
<BookEditorMonaco value={'Hello\n\n\n\n\n' as string_book} isReadonly={false} />,
|
|
96
|
-
);
|
|
97
|
-
const editor = getByTestId('mock-editor');
|
|
98
|
-
const props = JSON.parse(editor.textContent || '{}');
|
|
99
|
-
expect(props.value).toBe('Hello\n\n\n\n\n');
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it('should not add empty lines to a book with more than 5 trailing newlines', () => {
|
|
103
|
-
const { getByTestId } = render(
|
|
104
|
-
<BookEditorMonaco value={'Hello\n\n\n\n\n\n' as string_book} isReadonly={false} />,
|
|
105
|
-
);
|
|
106
|
-
const editor = getByTestId('mock-editor');
|
|
107
|
-
const props = JSON.parse(editor.textContent || '{}');
|
|
108
|
-
expect(props.value).toBe('Hello\n\n\n\n\n\n');
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* TODO: Make this test working, now it fails because css modules import doesn't work in the test env
|
|
115
|
-
*/
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { isMarkdownContent, renderMarkdown } from './renderMarkdown';
|
|
2
|
-
|
|
3
|
-
describe('renderMarkdown', () => {
|
|
4
|
-
it('should render simple text without markdown', () => {
|
|
5
|
-
const result = renderMarkdown('Hello world');
|
|
6
|
-
expect(result).toBe('<p>Hello world</p>');
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
it('should render bold text', () => {
|
|
10
|
-
const result = renderMarkdown('**bold text**');
|
|
11
|
-
expect(result).toBe('<p><strong>bold text</strong></p>');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('should render italic text', () => {
|
|
15
|
-
const result = renderMarkdown('*italic text*');
|
|
16
|
-
expect(result).toBe('<p><em>italic text</em></p>');
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should render inline code', () => {
|
|
20
|
-
const result = renderMarkdown('`inline code`');
|
|
21
|
-
expect(result).toBe('<p><code>inline code</code></p>');
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('should render code blocks', () => {
|
|
25
|
-
const markdown = '```javascript\nconsole.log("Hello");\n```';
|
|
26
|
-
const result = renderMarkdown(markdown);
|
|
27
|
-
expect(result).toContain('<pre><code class="javascript language-javascript">');
|
|
28
|
-
expect(result).toContain('console.log("Hello");');
|
|
29
|
-
expect(result).toContain('</code></pre>');
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
/*
|
|
33
|
-
TODO: Make these tests pass
|
|
34
|
-
it('should render headers', () => {
|
|
35
|
-
const result = renderMarkdown('# Header 1\n## Header 2');
|
|
36
|
-
expect(result).toContain('<h1 id="chat-header-header1">Header 1</h1>');
|
|
37
|
-
expect(result).toContain('<h2 id="chat-header-header2">Header 2</h2>');
|
|
38
|
-
});
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
it('should render unordered lists', () => {
|
|
42
|
-
const markdown = '- Item 1\n- Item 2\n- Item 3';
|
|
43
|
-
const result = renderMarkdown(markdown);
|
|
44
|
-
expect(result).toContain('<ul>');
|
|
45
|
-
expect(result).toContain('<li>Item 1</li>');
|
|
46
|
-
expect(result).toContain('<li>Item 2</li>');
|
|
47
|
-
expect(result).toContain('<li>Item 3</li>');
|
|
48
|
-
expect(result).toContain('</ul>');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('should render ordered lists', () => {
|
|
52
|
-
const markdown = '1. First item\n2. Second item\n3. Third item';
|
|
53
|
-
const result = renderMarkdown(markdown);
|
|
54
|
-
expect(result).toContain('<ol>');
|
|
55
|
-
expect(result).toContain('<li>First item</li>');
|
|
56
|
-
expect(result).toContain('<li>Second item</li>');
|
|
57
|
-
expect(result).toContain('<li>Third item</li>');
|
|
58
|
-
expect(result).toContain('</ol>');
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
/*
|
|
62
|
-
TODO: Make these tests pass
|
|
63
|
-
it('should render links', () => {
|
|
64
|
-
const result = renderMarkdown('[OpenAI](https://openai.com)');
|
|
65
|
-
expect(result).toContain('<a href="https://openai.com" target="_blank">OpenAI</a>');
|
|
66
|
-
});
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
it('should render blockquotes', () => {
|
|
70
|
-
const result = renderMarkdown('> This is a quote');
|
|
71
|
-
expect(result).toContain('<blockquote');
|
|
72
|
-
expect(result).toContain('<p>This is a quote</p>');
|
|
73
|
-
expect(result).toContain('</blockquote>');
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('should render strikethrough text', () => {
|
|
77
|
-
const result = renderMarkdown('~~strikethrough~~');
|
|
78
|
-
expect(result).toContain('<del>strikethrough</del>');
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it('should render tables', () => {
|
|
82
|
-
const markdown = '| Header 1 | Header 2 |\n|----------|----------|\n| Cell 1 | Cell 2 |';
|
|
83
|
-
const result = renderMarkdown(markdown);
|
|
84
|
-
expect(result).toContain('<table');
|
|
85
|
-
expect(result).toContain('<thead');
|
|
86
|
-
expect(result).toContain('<th>Header 1</th>');
|
|
87
|
-
expect(result).toContain('<th>Header 2</th>');
|
|
88
|
-
expect(result).toContain('<tbody');
|
|
89
|
-
expect(result).toContain('<td>Cell 1</td>');
|
|
90
|
-
expect(result).toContain('<td>Cell 2</td>');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('should handle empty or null input', () => {
|
|
94
|
-
expect(renderMarkdown('')).toBe('');
|
|
95
|
-
expect(renderMarkdown(null as unknown as string)).toBe('');
|
|
96
|
-
expect(renderMarkdown(undefined as unknown as string)).toBe('');
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
/*
|
|
100
|
-
TODO: Make these tests pass
|
|
101
|
-
it('should sanitize dangerous HTML attributes', () => {
|
|
102
|
-
const maliciousMarkdown =
|
|
103
|
-
'<div onclick="alert(\'xss\')" onload="alert(\'xss\')" href="javascript:alert(\'xss\')">Test</div>';
|
|
104
|
-
const result = renderMarkdown(maliciousMarkdown);
|
|
105
|
-
expect(result).not.toContain('onclick');
|
|
106
|
-
expect(result).not.toContain('onload');
|
|
107
|
-
expect(result).not.toContain('javascript:');
|
|
108
|
-
});
|
|
109
|
-
*/
|
|
110
|
-
|
|
111
|
-
it('should handle markdown parsing errors gracefully', () => {
|
|
112
|
-
// Mock console.error to avoid noise in test output
|
|
113
|
-
const consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
|
114
|
-
|
|
115
|
-
// This should not throw an error, but return escaped HTML instead
|
|
116
|
-
const result = renderMarkdown('Some content');
|
|
117
|
-
expect(result).toBeDefined();
|
|
118
|
-
expect(typeof result).toBe('string');
|
|
119
|
-
|
|
120
|
-
consoleSpy.mockRestore();
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
describe('isMarkdownContent', () => {
|
|
125
|
-
it('should detect headers', () => {
|
|
126
|
-
expect(isMarkdownContent('# Header')).toBe(true);
|
|
127
|
-
expect(isMarkdownContent('## Header 2')).toBe(true);
|
|
128
|
-
expect(isMarkdownContent('### Header 3')).toBe(true);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
it('should detect bold text', () => {
|
|
132
|
-
expect(isMarkdownContent('**bold**')).toBe(true);
|
|
133
|
-
expect(isMarkdownContent('Some **bold** text')).toBe(true);
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
it('should detect italic text', () => {
|
|
137
|
-
expect(isMarkdownContent('*italic*')).toBe(true);
|
|
138
|
-
expect(isMarkdownContent('Some *italic* text')).toBe(true);
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
it('should detect inline code', () => {
|
|
142
|
-
expect(isMarkdownContent('`code`')).toBe(true);
|
|
143
|
-
expect(isMarkdownContent('Some `code` here')).toBe(true);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
it('should detect code blocks', () => {
|
|
147
|
-
expect(isMarkdownContent('```\ncode block\n```')).toBe(true);
|
|
148
|
-
expect(isMarkdownContent('```javascript\nconsole.log("test");\n```')).toBe(true);
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
it('should detect lists', () => {
|
|
152
|
-
expect(isMarkdownContent('- Item 1')).toBe(true);
|
|
153
|
-
expect(isMarkdownContent('* Item 1')).toBe(true);
|
|
154
|
-
expect(isMarkdownContent('+ Item 1')).toBe(true);
|
|
155
|
-
expect(isMarkdownContent('1. Item 1')).toBe(true);
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
it('should detect blockquotes', () => {
|
|
159
|
-
expect(isMarkdownContent('> Quote')).toBe(true);
|
|
160
|
-
expect(isMarkdownContent(' > Indented quote')).toBe(true);
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
it('should detect links', () => {
|
|
164
|
-
expect(isMarkdownContent('[Link](https://example.com)')).toBe(true);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
it('should detect images', () => {
|
|
168
|
-
expect(isMarkdownContent('')).toBe(true);
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
it('should detect tables', () => {
|
|
172
|
-
expect(isMarkdownContent('| Header |')).toBe(true);
|
|
173
|
-
expect(isMarkdownContent('| Col1 | Col2 |')).toBe(true);
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
it('should detect strikethrough', () => {
|
|
177
|
-
expect(isMarkdownContent('~~strikethrough~~')).toBe(true);
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
it('should detect horizontal rules', () => {
|
|
181
|
-
expect(isMarkdownContent('---')).toBe(true);
|
|
182
|
-
expect(isMarkdownContent('-----')).toBe(true);
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
it('should return false for plain text', () => {
|
|
186
|
-
expect(isMarkdownContent('Just plain text')).toBe(false);
|
|
187
|
-
expect(isMarkdownContent('No markdown here at all')).toBe(false);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
it('should handle empty or null input', () => {
|
|
191
|
-
expect(isMarkdownContent('')).toBe(false);
|
|
192
|
-
expect(isMarkdownContent(null as unknown as string)).toBe(false);
|
|
193
|
-
expect(isMarkdownContent(undefined as unknown as string)).toBe(false);
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* TODO: Make this test work
|
|
199
|
-
*/
|