@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
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../../../../../src/version';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Default Sentry project DSN for Promptbook Agents Server telemetry.
|
|
5
|
+
*
|
|
6
|
+
* @private internal Sentry SDK configuration for Agents Server
|
|
7
|
+
*/
|
|
8
|
+
export const DEFAULT_SENTRY_DSN =
|
|
9
|
+
'https://986f734e9cddaeeec33e2a360f7d0b62@o4508778158030848.ingest.de.sentry.io/4511534509785168';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Sentry organization slug used by build-time SDK tooling.
|
|
13
|
+
*
|
|
14
|
+
* @private internal Sentry SDK configuration for Agents Server
|
|
15
|
+
*/
|
|
16
|
+
export const SENTRY_ORGANIZATION = 'promptbook';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Sentry project slug used by build-time SDK tooling.
|
|
20
|
+
*
|
|
21
|
+
* @private internal Sentry SDK configuration for Agents Server
|
|
22
|
+
*/
|
|
23
|
+
export const SENTRY_PROJECT = 's22';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Performance tracing sample rate requested for the Agents Server.
|
|
27
|
+
*
|
|
28
|
+
* @private internal Sentry SDK configuration for Agents Server
|
|
29
|
+
*/
|
|
30
|
+
export const SENTRY_TRACES_SAMPLE_RATE = 1.0;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Browser-side targets that should receive distributed tracing headers.
|
|
34
|
+
*
|
|
35
|
+
* @private internal Sentry SDK configuration for Agents Server
|
|
36
|
+
*/
|
|
37
|
+
export const SENTRY_TRACE_PROPAGATION_TARGETS: Array<string | RegExp> = [
|
|
38
|
+
'localhost',
|
|
39
|
+
/^\/api\//,
|
|
40
|
+
/^https:\/\/.*\.ptbk\.io\/api\//,
|
|
41
|
+
/^https:\/\/.*\.vercel\.app\/api\//,
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Release name used for Agents Server Sentry events.
|
|
46
|
+
*/
|
|
47
|
+
const AGENTS_SERVER_SENTRY_RELEASE_NAME = 'promptbook-agents-server';
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Fallback text used in Sentry tags when a value is not configured.
|
|
51
|
+
*/
|
|
52
|
+
const UNKNOWN_SENTRY_CONTEXT_VALUE = 'unknown';
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Maximum length kept for Sentry tag values.
|
|
56
|
+
*/
|
|
57
|
+
const MAX_SENTRY_TAG_VALUE_LENGTH = 200;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Resolves the browser-safe Sentry DSN.
|
|
61
|
+
*
|
|
62
|
+
* @returns Browser-safe Sentry DSN.
|
|
63
|
+
*
|
|
64
|
+
* @private internal Sentry SDK configuration for Agents Server
|
|
65
|
+
*/
|
|
66
|
+
export function resolveBrowserSentryDsn(): string {
|
|
67
|
+
return process.env.NEXT_PUBLIC_SENTRY_DSN ?? DEFAULT_SENTRY_DSN;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Resolves the server-side Sentry DSN.
|
|
72
|
+
*
|
|
73
|
+
* @returns Server-side Sentry DSN.
|
|
74
|
+
*
|
|
75
|
+
* @private internal Sentry SDK configuration for Agents Server
|
|
76
|
+
*/
|
|
77
|
+
export function resolveServerSentryDsn(): string {
|
|
78
|
+
return process.env.SENTRY_DSN ?? resolveBrowserSentryDsn();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Resolves the most specific deployment environment name available.
|
|
83
|
+
*
|
|
84
|
+
* @returns Environment name suitable for Sentry.
|
|
85
|
+
*
|
|
86
|
+
* @private internal Sentry SDK configuration for Agents Server
|
|
87
|
+
*/
|
|
88
|
+
export function resolveSentrySdkEnvironment(): string {
|
|
89
|
+
return (
|
|
90
|
+
getFirstNonEmptyString(
|
|
91
|
+
process.env.SENTRY_ENVIRONMENT,
|
|
92
|
+
process.env.NEXT_PUBLIC_VERCEL_TARGET_ENV,
|
|
93
|
+
process.env.VERCEL_TARGET_ENV,
|
|
94
|
+
process.env.NEXT_PUBLIC_VERCEL_ENV,
|
|
95
|
+
process.env.VERCEL_ENV,
|
|
96
|
+
process.env.PROMPTBOOK_REPOSITORY_REF,
|
|
97
|
+
process.env.NODE_ENV,
|
|
98
|
+
) ?? UNKNOWN_SENTRY_CONTEXT_VALUE
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Resolves the current deployment commit hash from common hosting environment variables.
|
|
104
|
+
*
|
|
105
|
+
* @returns Commit hash or null when unavailable.
|
|
106
|
+
*
|
|
107
|
+
* @private internal Sentry SDK configuration for Agents Server
|
|
108
|
+
*/
|
|
109
|
+
export function resolveSentrySdkCommitHash(): string | null {
|
|
110
|
+
return getFirstNonEmptyString(
|
|
111
|
+
process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,
|
|
112
|
+
process.env.VERCEL_GIT_COMMIT_SHA,
|
|
113
|
+
process.env.PROMPTBOOK_COMMIT_SHA,
|
|
114
|
+
process.env.GIT_COMMIT_SHA,
|
|
115
|
+
process.env.COMMIT_SHA,
|
|
116
|
+
process.env.SOURCE_VERSION,
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Resolves the current repository branch or deployment ref.
|
|
122
|
+
*
|
|
123
|
+
* @returns Repository branch/ref or null when unavailable.
|
|
124
|
+
*
|
|
125
|
+
* @private internal Sentry SDK configuration for Agents Server
|
|
126
|
+
*/
|
|
127
|
+
export function resolveSentrySdkRepositoryBranch(): string | null {
|
|
128
|
+
return getFirstNonEmptyString(
|
|
129
|
+
process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF,
|
|
130
|
+
process.env.VERCEL_GIT_COMMIT_REF,
|
|
131
|
+
process.env.PROMPTBOOK_REPOSITORY_REF,
|
|
132
|
+
process.env.GIT_BRANCH,
|
|
133
|
+
process.env.BRANCH_NAME,
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Resolves the Sentry release name for the current Agents Server build.
|
|
139
|
+
*
|
|
140
|
+
* @returns Release identifier suitable for Sentry.
|
|
141
|
+
*
|
|
142
|
+
* @private internal Sentry SDK configuration for Agents Server
|
|
143
|
+
*/
|
|
144
|
+
export function resolveSentrySdkRelease(): string {
|
|
145
|
+
const appPackageVersion = normalizeOptionalString(process.env.npm_package_version) ?? PROMPTBOOK_ENGINE_VERSION;
|
|
146
|
+
const commitHash = resolveSentrySdkCommitHash();
|
|
147
|
+
|
|
148
|
+
if (!commitHash) {
|
|
149
|
+
return `${AGENTS_SERVER_SENTRY_RELEASE_NAME}@${appPackageVersion}`;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return `${AGENTS_SERVER_SENTRY_RELEASE_NAME}@${appPackageVersion}+${commitHash}`;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Creates shared filterable Sentry tags for Agents Server events.
|
|
157
|
+
*
|
|
158
|
+
* @returns Sanitized Sentry tags.
|
|
159
|
+
*
|
|
160
|
+
* @private internal Sentry SDK configuration for Agents Server
|
|
161
|
+
*/
|
|
162
|
+
export function createSentrySdkTags(): Record<string, string> {
|
|
163
|
+
return createSentryTags({
|
|
164
|
+
promptbookEngineVersion: PROMPTBOOK_ENGINE_VERSION,
|
|
165
|
+
bookLanguageVersion: BOOK_LANGUAGE_VERSION,
|
|
166
|
+
appPackageVersion: normalizeOptionalString(process.env.npm_package_version) ?? PROMPTBOOK_ENGINE_VERSION,
|
|
167
|
+
commitHash: resolveSentrySdkCommitHash(),
|
|
168
|
+
repositoryBranch: resolveSentrySdkRepositoryBranch(),
|
|
169
|
+
deploymentEnvironment: resolveSentrySdkEnvironment(),
|
|
170
|
+
vercelEnvironment: getFirstNonEmptyString(process.env.NEXT_PUBLIC_VERCEL_ENV, process.env.VERCEL_ENV),
|
|
171
|
+
targetEnvironment: getFirstNonEmptyString(
|
|
172
|
+
process.env.NEXT_PUBLIC_VERCEL_TARGET_ENV,
|
|
173
|
+
process.env.VERCEL_TARGET_ENV,
|
|
174
|
+
),
|
|
175
|
+
nextRuntime: process.env.NEXT_RUNTIME,
|
|
176
|
+
nodeEnvironment: process.env.NODE_ENV,
|
|
177
|
+
vercelRegion: process.env.VERCEL_REGION,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Creates Sentry tag values, preserving missing values as explicit `unknown` markers.
|
|
183
|
+
*
|
|
184
|
+
* @param values - Raw tag values.
|
|
185
|
+
* @returns Sanitized Sentry tags.
|
|
186
|
+
*/
|
|
187
|
+
function createSentryTags(values: Record<string, string | null | undefined>): Record<string, string> {
|
|
188
|
+
return Object.fromEntries(
|
|
189
|
+
Object.entries(values).map(([key, value]) => [key, sanitizeSentryTagValue(value)]),
|
|
190
|
+
) as Record<string, string>;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Normalizes one value for use as a Sentry tag.
|
|
195
|
+
*
|
|
196
|
+
* @param value - Optional tag value.
|
|
197
|
+
* @returns Non-empty bounded tag value.
|
|
198
|
+
*/
|
|
199
|
+
function sanitizeSentryTagValue(value: string | null | undefined): string {
|
|
200
|
+
const normalizedValue = normalizeOptionalString(value) ?? UNKNOWN_SENTRY_CONTEXT_VALUE;
|
|
201
|
+
|
|
202
|
+
return normalizedValue.replace(/\s+/gu, ' ').slice(0, MAX_SENTRY_TAG_VALUE_LENGTH);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Returns the first non-empty string from a list.
|
|
207
|
+
*
|
|
208
|
+
* @param values - Candidate values in priority order.
|
|
209
|
+
* @returns First trimmed string or null.
|
|
210
|
+
*/
|
|
211
|
+
function getFirstNonEmptyString(...values: Array<string | null | undefined>): string | null {
|
|
212
|
+
for (const value of values) {
|
|
213
|
+
const normalizedValue = normalizeOptionalString(value);
|
|
214
|
+
|
|
215
|
+
if (normalizedValue) {
|
|
216
|
+
return normalizedValue;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Trims one optional environment value.
|
|
225
|
+
*
|
|
226
|
+
* @param value - Raw optional value.
|
|
227
|
+
* @returns Trimmed string or null.
|
|
228
|
+
*/
|
|
229
|
+
function normalizeOptionalString(value: string | null | undefined): string | null {
|
|
230
|
+
if (typeof value !== 'string') {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const normalizedValue = value.trim();
|
|
235
|
+
|
|
236
|
+
return normalizedValue || null;
|
|
237
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sentry protocol version used for store endpoint requests.
|
|
3
|
+
*/
|
|
4
|
+
const SENTRY_PROTOCOL_VERSION = '7';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Endpoint content type used when sending JSON payloads to Sentry.
|
|
8
|
+
*/
|
|
9
|
+
const JSON_CONTENT_TYPE = 'application/json';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Number of milliseconds in one second.
|
|
13
|
+
*/
|
|
14
|
+
const MILLISECONDS_IN_SECOND = 1000;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Minimal Sentry DSN parts needed for store endpoint requests.
|
|
18
|
+
*/
|
|
19
|
+
type SentryDsnParts = {
|
|
20
|
+
/**
|
|
21
|
+
* Store endpoint derived from DSN host/project.
|
|
22
|
+
*/
|
|
23
|
+
storeEndpoint: URL;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Payload shape submitted to the Sentry store endpoint.
|
|
28
|
+
*/
|
|
29
|
+
export type SentryStorePayload = {
|
|
30
|
+
/**
|
|
31
|
+
* Event platform.
|
|
32
|
+
*/
|
|
33
|
+
platform: 'javascript';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Event level.
|
|
37
|
+
*/
|
|
38
|
+
level: 'error';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Logger name visible in Sentry events.
|
|
42
|
+
*/
|
|
43
|
+
logger: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Seconds since UNIX epoch.
|
|
47
|
+
*/
|
|
48
|
+
timestamp: number;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Human readable message.
|
|
52
|
+
*/
|
|
53
|
+
message: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Sentry release identifier.
|
|
57
|
+
*/
|
|
58
|
+
release?: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Deployment environment such as production, preview, or staging.
|
|
62
|
+
*/
|
|
63
|
+
environment?: string;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Server/deployment name.
|
|
67
|
+
*/
|
|
68
|
+
server_name: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Optional diagnostic tags used for filtering.
|
|
72
|
+
*/
|
|
73
|
+
tags?: Record<string, string>;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Optional structured exception details.
|
|
77
|
+
*/
|
|
78
|
+
exception?: {
|
|
79
|
+
/**
|
|
80
|
+
* Individual exception list.
|
|
81
|
+
*/
|
|
82
|
+
values: Array<{
|
|
83
|
+
/**
|
|
84
|
+
* Exception type.
|
|
85
|
+
*/
|
|
86
|
+
type: string;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Exception message.
|
|
90
|
+
*/
|
|
91
|
+
value: string;
|
|
92
|
+
}>;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Optional additional diagnostic payload.
|
|
97
|
+
*/
|
|
98
|
+
extra?: Record<string, unknown>;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Resolves Sentry DSN from environment when configured.
|
|
103
|
+
*
|
|
104
|
+
* @returns Raw DSN string or `null` when telemetry is not configured.
|
|
105
|
+
*/
|
|
106
|
+
export function resolveOptionalSentryDsn(): string | null {
|
|
107
|
+
return process.env.SENTRY_DSN ?? process.env.NEXT_PUBLIC_SENTRY_DSN ?? null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Resolves Sentry DSN from environment.
|
|
112
|
+
*
|
|
113
|
+
* @returns Raw DSN string.
|
|
114
|
+
* @throws Error when DSN is missing.
|
|
115
|
+
*/
|
|
116
|
+
export function resolveRequiredSentryDsn(): string {
|
|
117
|
+
const sentryDsn = resolveOptionalSentryDsn();
|
|
118
|
+
|
|
119
|
+
if (!sentryDsn) {
|
|
120
|
+
throw new Error('Missing Sentry DSN. Configure SENTRY_DSN or NEXT_PUBLIC_SENTRY_DSN.');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return sentryDsn;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Parses a DSN into pieces required for Sentry store API requests.
|
|
128
|
+
*
|
|
129
|
+
* @param sentryDsn - Raw Sentry DSN.
|
|
130
|
+
* @returns Parsed DSN details.
|
|
131
|
+
* @throws Error when DSN format is invalid.
|
|
132
|
+
*/
|
|
133
|
+
function parseSentryDsn(sentryDsn: string): SentryDsnParts {
|
|
134
|
+
const sentryDsnUrl = new URL(sentryDsn);
|
|
135
|
+
const pathSegments = sentryDsnUrl.pathname.split('/').filter(Boolean);
|
|
136
|
+
const projectId = pathSegments.at(-1);
|
|
137
|
+
const pathPrefix = pathSegments.slice(0, -1).join('/');
|
|
138
|
+
|
|
139
|
+
if (!projectId) {
|
|
140
|
+
throw new Error('Invalid Sentry DSN: missing project ID.');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (!sentryDsnUrl.username) {
|
|
144
|
+
throw new Error('Invalid Sentry DSN: missing public key.');
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const basePath = pathPrefix ? `/${pathPrefix}` : '';
|
|
148
|
+
const storeEndpoint = new URL(`${sentryDsnUrl.protocol}//${sentryDsnUrl.host}${basePath}/api/${projectId}/store/`);
|
|
149
|
+
storeEndpoint.searchParams.set('sentry_key', sentryDsnUrl.username);
|
|
150
|
+
storeEndpoint.searchParams.set('sentry_version', SENTRY_PROTOCOL_VERSION);
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
storeEndpoint,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Creates a current Sentry timestamp expressed in seconds.
|
|
159
|
+
*
|
|
160
|
+
* @returns Current event timestamp in seconds.
|
|
161
|
+
*/
|
|
162
|
+
export function createSentryTimestamp(): number {
|
|
163
|
+
return Date.now() / MILLISECONDS_IN_SECOND;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Sends one Sentry store payload.
|
|
168
|
+
*
|
|
169
|
+
* @param payload - Fully constructed Sentry store payload.
|
|
170
|
+
* @param sentryDsn - Raw Sentry DSN used to derive the store endpoint.
|
|
171
|
+
*/
|
|
172
|
+
export async function sendSentryStorePayload(payload: SentryStorePayload, sentryDsn: string): Promise<void> {
|
|
173
|
+
const { storeEndpoint } = parseSentryDsn(sentryDsn);
|
|
174
|
+
|
|
175
|
+
const response = await fetch(storeEndpoint, {
|
|
176
|
+
method: 'POST',
|
|
177
|
+
headers: {
|
|
178
|
+
'Content-Type': JSON_CONTENT_TYPE,
|
|
179
|
+
},
|
|
180
|
+
body: JSON.stringify(payload),
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
if (!response.ok) {
|
|
184
|
+
const responseBody = await response.text();
|
|
185
|
+
throw new Error(`Sentry rejected error report (${response.status}): ${responseBody}`);
|
|
186
|
+
}
|
|
187
|
+
}
|
package/apps/agents-server/src/utils/externalChatRunner/createExternalAgentRepositoryFiles.ts
CHANGED
|
@@ -53,9 +53,9 @@ function createExternalAgentRepositoryPackageJson(): string {
|
|
|
53
53
|
scripts: {
|
|
54
54
|
start: 'npm run agent:run',
|
|
55
55
|
'agent:run':
|
|
56
|
-
'npx ptbk agent-folder run-agent --
|
|
56
|
+
'npx ptbk agent-folder run-agent --harness github-copilot --model gpt-5.4 --thinking-level high --auto-pull --auto-push',
|
|
57
57
|
'agent-local:run':
|
|
58
|
-
'ts-node ../../promptbook/src/cli/test/ptbk.ts agent-folder run-agent --
|
|
58
|
+
'ts-node ../../promptbook/src/cli/test/ptbk.ts agent-folder run-agent --harness github-copilot --model gpt-5.4 --auto-pull --auto-push',
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
null,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Json } from '@/src/database/schema';
|
|
2
|
+
import { parseAgentSource } from '../../../../../src/book-2.0/agent-source/parseAgentSource';
|
|
2
3
|
import { createUserChatJobFailureDetails } from '../userChat/createUserChatJobFailureDetails';
|
|
3
4
|
import { claimNextQueuedUserChatJob } from '../userChat/claimNextQueuedUserChatJob';
|
|
4
5
|
import { finalizeUserChatJob } from '../userChat/finalizeUserChatJob';
|
|
@@ -6,10 +7,14 @@ import { getUserChat } from '../userChat/getUserChat';
|
|
|
6
7
|
import { getUserChatJobById } from '../userChat/getUserChatJobById';
|
|
7
8
|
import { persistUserChatJobTerminalState } from '../userChat/persistUserChatJobTerminalState';
|
|
8
9
|
import { provideUserChatJobTable } from '../userChat/provideUserChatJobTable';
|
|
10
|
+
import { createUserChatRunnerProgressCard } from '../userChat/createUserChatRunnerProgressCard';
|
|
9
11
|
import { updateUserChatAssistantMessage } from '../userChat/updateUserChatAssistantMessage';
|
|
10
12
|
import type { UserChatJobRecord } from '../userChat/UserChatJobRecord';
|
|
11
13
|
import type { UserChatJobRow } from '../userChat/UserChatJobRow';
|
|
12
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
createUserChatRunnerThreadMessages,
|
|
16
|
+
resolvePromptThreadBeforeUserMessage,
|
|
17
|
+
} from '../userChat/userChatMessageLifecycle';
|
|
13
18
|
import {
|
|
14
19
|
EXTERNAL_USER_CHAT_JOB_ANSWER_TIMEOUT_MS,
|
|
15
20
|
EXTERNAL_USER_CHAT_JOB_PROVIDER,
|
|
@@ -148,13 +153,11 @@ async function enqueueExternalUserChatJob(job: UserChatJobRecord): Promise<Proce
|
|
|
148
153
|
return { didMutate: false, outcome: 'waiting' };
|
|
149
154
|
}
|
|
150
155
|
|
|
151
|
-
const threadMessages =
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
content: message.content,
|
|
157
|
-
}));
|
|
156
|
+
const threadMessages = createUserChatRunnerThreadMessages({
|
|
157
|
+
messages: chat.messages,
|
|
158
|
+
userMessageId: job.userMessageId,
|
|
159
|
+
resolveInitialAgentMessage: () => parseAgentSource(agentSourceSnapshot.agentSource).initialMessage,
|
|
160
|
+
});
|
|
158
161
|
|
|
159
162
|
const repository = await ensureExternalAgentRepository(agentSourceSnapshot);
|
|
160
163
|
const queuedAt = new Date().toISOString();
|
|
@@ -186,6 +189,10 @@ async function enqueueExternalUserChatJob(job: UserChatJobRecord): Promise<Proce
|
|
|
186
189
|
isComplete: false,
|
|
187
190
|
lifecycleState: 'running',
|
|
188
191
|
lifecycleError: undefined,
|
|
192
|
+
progressCard: createUserChatRunnerProgressCard({
|
|
193
|
+
runnerKind: 'external',
|
|
194
|
+
phase: 'queued_for_runner',
|
|
195
|
+
}),
|
|
189
196
|
}),
|
|
190
197
|
});
|
|
191
198
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { findAgentByIdentifier, findOwnedAgentByIdentifier, type OwnedAgentRow } from './agentOwnership';
|
|
2
|
+
import { getCurrentUser } from './getCurrentUser';
|
|
3
|
+
import { isUserAdmin } from './isUserAdmin';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Loads one agent for the current caller, enforcing ownership-or-admin write access.
|
|
7
|
+
*
|
|
8
|
+
* Resolution order:
|
|
9
|
+
* 1. Anonymous callers receive `null` so routes can return `403`.
|
|
10
|
+
* 2. Owners are matched via {@link findOwnedAgentByIdentifier} using the authenticated user id.
|
|
11
|
+
* 3. Administrators (resolved via {@link isUserAdmin}) fall through to {@link findAgentByIdentifier} so they can manage any agent — including legacy `ADMIN_PASSWORD` admins that have no database user id.
|
|
12
|
+
*
|
|
13
|
+
* @param identifier - Permanent id or agent name supplied by the route.
|
|
14
|
+
* @returns Matching agent row when the caller owns it or is an administrator, otherwise `null`.
|
|
15
|
+
*
|
|
16
|
+
* @private internal helper of Agents Server route handlers
|
|
17
|
+
*/
|
|
18
|
+
export async function findAgentForCallerWriteAccess(identifier: string): Promise<OwnedAgentRow | null> {
|
|
19
|
+
const [currentUser, isAdmin] = await Promise.all([getCurrentUser(), isUserAdmin()]);
|
|
20
|
+
if (!currentUser) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (typeof currentUser.id === 'number') {
|
|
25
|
+
const ownedAgent = await findOwnedAgentByIdentifier(currentUser.id, identifier);
|
|
26
|
+
if (ownedAgent) {
|
|
27
|
+
return ownedAgent;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!isAdmin) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return findAgentByIdentifier(identifier);
|
|
36
|
+
}
|
|
@@ -3,6 +3,7 @@ import { cache } from 'react';
|
|
|
3
3
|
import { $getTableName } from '../database/$getTableName';
|
|
4
4
|
import { $provideSupabaseForServer } from '../database/$provideSupabaseForServer';
|
|
5
5
|
import type { AgentsServerDatabase } from '../database/schema';
|
|
6
|
+
import { isAdminPasswordEqual } from './isAdminPasswordEqual';
|
|
6
7
|
import { getSession } from './session';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -75,7 +76,7 @@ const getCachedCurrentUser = cache(async (): Promise<UserInfo | null> => {
|
|
|
75
76
|
if (process.env.ADMIN_PASSWORD) {
|
|
76
77
|
const cookieStore = await cookies();
|
|
77
78
|
const adminToken = cookieStore.get('adminToken');
|
|
78
|
-
if (adminToken?.value
|
|
79
|
+
if (adminToken?.value !== undefined && isAdminPasswordEqual(adminToken.value)) {
|
|
79
80
|
return {
|
|
80
81
|
username: 'admin',
|
|
81
82
|
isAdmin: true,
|
|
@@ -1,27 +1,6 @@
|
|
|
1
1
|
import { string_promptbook_server_url } from '@promptbook-local/types';
|
|
2
2
|
import { getMetadataMap } from '../database/getMetadata';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Options that tweak the behavior of `getFederatedServers`.
|
|
6
|
-
*
|
|
7
|
-
* @public exported from `apps/agents-server`
|
|
8
|
-
*/
|
|
9
|
-
export type GetFederatedServersOptions = {
|
|
10
|
-
/**
|
|
11
|
-
* When set, hide the core server from the resulting list if the metadata flag requests it.
|
|
12
|
-
*
|
|
13
|
-
* @private Internal toggle for UI surfaces that should hide the core server.
|
|
14
|
-
*/
|
|
15
|
-
readonly excludeHiddenCoreServer?: boolean;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Metadata key storing the core server URL.
|
|
20
|
-
*
|
|
21
|
-
* @private
|
|
22
|
-
*/
|
|
23
|
-
const CORE_SERVER_METADATA_KEY = 'CORE_SERVER';
|
|
24
|
-
|
|
25
4
|
/**
|
|
26
5
|
* Metadata key storing the comma-separated federated servers list.
|
|
27
6
|
*
|
|
@@ -29,67 +8,17 @@ const CORE_SERVER_METADATA_KEY = 'CORE_SERVER';
|
|
|
29
8
|
*/
|
|
30
9
|
const FEDERATED_SERVERS_METADATA_KEY = 'FEDERATED_SERVERS';
|
|
31
10
|
|
|
32
|
-
/**
|
|
33
|
-
* Metadata key indicating whether the core server should be hidden from UI lists.
|
|
34
|
-
*
|
|
35
|
-
* @private
|
|
36
|
-
*/
|
|
37
|
-
const IS_CORE_SERVER_HIDDEN_METADATA_KEY = 'IS_CORE_SERVER_HIDDEN';
|
|
38
|
-
|
|
39
11
|
/**
|
|
40
12
|
* Reads FEDERATED_SERVERS metadata and returns a normalized list of server URLs.
|
|
41
13
|
*
|
|
42
14
|
* @public exported from `apps/agents-server`
|
|
43
15
|
*/
|
|
44
|
-
export async function getFederatedServers(
|
|
45
|
-
const metadata = await getMetadataMap([
|
|
46
|
-
FEDERATED_SERVERS_METADATA_KEY,
|
|
47
|
-
CORE_SERVER_METADATA_KEY,
|
|
48
|
-
IS_CORE_SERVER_HIDDEN_METADATA_KEY,
|
|
49
|
-
]);
|
|
16
|
+
export async function getFederatedServers(): Promise<string_promptbook_server_url[]> {
|
|
17
|
+
const metadata = await getMetadataMap([FEDERATED_SERVERS_METADATA_KEY]);
|
|
50
18
|
const federatedServersString = metadata[FEDERATED_SERVERS_METADATA_KEY] || '';
|
|
51
|
-
const rawCoreServer = metadata[CORE_SERVER_METADATA_KEY] || '';
|
|
52
|
-
const coreServer = rawCoreServer.trim() as string_promptbook_server_url;
|
|
53
19
|
|
|
54
|
-
|
|
55
|
-
throw new Error('Missing CORE_SERVER metadata value');
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const federatedServers = federatedServersString
|
|
20
|
+
return federatedServersString
|
|
59
21
|
.split(',')
|
|
60
22
|
.map((server) => server.trim())
|
|
61
23
|
.filter((server): server is string_promptbook_server_url => server !== '');
|
|
62
|
-
|
|
63
|
-
const allServers = [coreServer, ...federatedServers];
|
|
64
|
-
if (options?.excludeHiddenCoreServer && isCoreServerHidden(metadata)) {
|
|
65
|
-
const normalizedCoreServer = normalizeServerUrl(coreServer);
|
|
66
|
-
return allServers.filter((server) => normalizeServerUrl(server) !== normalizedCoreServer);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return allServers;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Determines if the metadata flag explicitly hides the core server from UI lists.
|
|
74
|
-
*
|
|
75
|
-
* @param metadata - Metadata map containing IS_CORE_SERVER_HIDDEN value.
|
|
76
|
-
* @returns Whether the core server should be hidden.
|
|
77
|
-
*
|
|
78
|
-
* @private Internal helper for filtering UI-friendly lists.
|
|
79
|
-
*/
|
|
80
|
-
function isCoreServerHidden(metadata: Record<string, string | null>): boolean {
|
|
81
|
-
const rawValue = metadata[IS_CORE_SERVER_HIDDEN_METADATA_KEY] || '';
|
|
82
|
-
return rawValue.trim().toLowerCase() === 'true';
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Normalizes a server URL by trimming trailing slashes for comparison purposes.
|
|
87
|
-
*
|
|
88
|
-
* @param value - Raw server URL.
|
|
89
|
-
* @returns Normalized server URL.
|
|
90
|
-
*
|
|
91
|
-
* @private Internal helper used when filtering hidden servers.
|
|
92
|
-
*/
|
|
93
|
-
function normalizeServerUrl(value: string): string {
|
|
94
|
-
return value.replace(/\/+$/, '');
|
|
95
24
|
}
|
|
@@ -3,21 +3,35 @@ import { $provideSupabaseForServer } from '@/src/database/$provideSupabaseForSer
|
|
|
3
3
|
import type { AgentsServerDatabase } from '@/src/database/schema';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* User row shape needed by durable chat execution.
|
|
7
7
|
*/
|
|
8
|
-
type
|
|
8
|
+
type UserByIdRow = Pick<
|
|
9
|
+
AgentsServerDatabase['public']['Tables']['User']['Row'],
|
|
10
|
+
'id' | 'username' | 'isAdmin' | 'profileImageUrl'
|
|
11
|
+
>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Supabase projection for user fields needed by durable chat execution.
|
|
15
|
+
*/
|
|
16
|
+
const USER_BY_ID_SELECT_COLUMNS = 'id, username, isAdmin, profileImageUrl';
|
|
9
17
|
|
|
10
18
|
/**
|
|
11
19
|
* Loads one user row by database id.
|
|
20
|
+
*
|
|
21
|
+
* @private internal Agents Server user lookup helper
|
|
12
22
|
*/
|
|
13
|
-
export async function getUserById(userId: number): Promise<
|
|
23
|
+
export async function getUserById(userId: number): Promise<UserByIdRow | null> {
|
|
14
24
|
const supabase = $provideSupabaseForServer();
|
|
15
25
|
const tableName = await $getTableName('User');
|
|
16
|
-
const { data, error } = await supabase
|
|
26
|
+
const { data, error } = await supabase
|
|
27
|
+
.from(tableName)
|
|
28
|
+
.select(USER_BY_ID_SELECT_COLUMNS)
|
|
29
|
+
.eq('id', userId)
|
|
30
|
+
.maybeSingle();
|
|
17
31
|
|
|
18
32
|
if (error) {
|
|
19
33
|
throw new Error(`Failed to resolve user "${userId}": ${error.message}`);
|
|
20
34
|
}
|
|
21
35
|
|
|
22
|
-
return (data as
|
|
36
|
+
return (data as UserByIdRow | null) || null;
|
|
23
37
|
}
|