@promptbook/cli 0.113.0-9 → 0.114.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 +4 -3
- package/apps/agents-server/next.config.ts +2 -0
- package/apps/agents-server/package.json +3 -3
- package/apps/agents-server/playwright.config.ts +7 -2
- package/apps/agents-server/scripts/clearNextGeneratedTypes.js +25 -0
- package/apps/agents-server/scripts/createCloudflareDnsRecordSyncPlan/CloudflareDnsRecordSyncPlan.ts +10 -80
- package/apps/agents-server/scripts/createCloudflareDnsRecordSyncPlan/createCloudflareDnsRecordSyncPlan.ts +1 -1
- package/apps/agents-server/scripts/createCloudflareDnsRecordSyncPlan/describeCloudflareDnsRecordUpdateReasons.ts +1 -1
- package/apps/agents-server/scripts/createCloudflareDnsRecordSyncPlan/resolveDesiredCloudflareDnsRecord.ts +1 -1
- package/apps/agents-server/scripts/createCloudflareDnsRecordSyncPlan/resolveDesiredCloudflareDnsRecords.ts +1 -29
- package/apps/agents-server/scripts/createCloudflareDnsRecordSyncPlan/selectCloudflareRecordForManagedDomain.ts +1 -1
- package/apps/agents-server/scripts/createCloudflareDnsRecordSyncPlan/syncCloudflareDnsRecords.ts +4 -4
- package/apps/agents-server/scripts/createCloudflareDnsRecordSyncPlan/updateManagedCloudflareDnsRecord.ts +26 -0
- package/apps/agents-server/scripts/createCloudflareDnsRecordSyncPlan.ts +1 -1
- package/apps/agents-server/scripts/next-cli.js +16 -0
- package/apps/agents-server/src/app/admin/_components/AdminConfigurationShell.tsx +10 -34
- package/apps/agents-server/src/app/admin/_components/AdminRouteTabs.tsx +72 -0
- package/apps/agents-server/src/app/admin/_components/AdminSortableTableHeaderCell.tsx +80 -0
- package/apps/agents-server/src/app/admin/_components/AdminStorageTabs.tsx +47 -0
- package/apps/agents-server/src/app/admin/_components/S3BrowserPanel.tsx +292 -0
- package/apps/agents-server/src/app/admin/_components/adminTableSorting.ts +266 -0
- package/apps/agents-server/src/app/admin/api-tokens/ApiTokensClient.tsx +57 -7
- package/apps/agents-server/src/app/admin/chat-feedback/ChatFeedbackClient.tsx +1 -1
- package/apps/agents-server/src/app/admin/chat-feedback/ChatFeedbackTable.tsx +23 -22
- package/apps/agents-server/src/app/admin/chat-feedback/useChatFeedbackState.ts +13 -11
- package/apps/agents-server/src/app/admin/chat-history/ChatHistoryChatView.tsx +134 -0
- package/apps/agents-server/src/app/admin/chat-history/ChatHistoryClient.tsx +52 -26
- package/apps/agents-server/src/app/admin/chat-history/ChatHistoryFiltersCard.tsx +53 -1
- package/apps/agents-server/src/app/admin/chat-history/ChatHistoryTable.tsx +88 -69
- package/apps/agents-server/src/app/admin/chat-history/ChatHistoryThreadList.tsx +67 -0
- package/apps/agents-server/src/app/admin/chat-history/page.tsx +17 -2
- package/apps/agents-server/src/app/admin/chat-history/useChatHistoryState.ts +232 -39
- package/apps/agents-server/src/app/admin/core-agents/page.tsx +143 -0
- package/apps/agents-server/src/app/admin/email-server/actions.ts +33 -0
- package/apps/agents-server/src/app/admin/email-server/page.tsx +160 -0
- package/apps/agents-server/src/app/admin/files/FilesGalleryClient.tsx +23 -4
- package/apps/agents-server/src/app/admin/files/FilesGalleryGrid.tsx +126 -58
- package/apps/agents-server/src/app/admin/files/FilesGalleryStatusBadge.tsx +1 -1
- package/apps/agents-server/src/app/admin/files/FilesGalleryTable.tsx +125 -60
- package/apps/agents-server/src/app/admin/files/actions.ts +84 -34
- package/apps/agents-server/src/app/admin/files/filesGalleryLinks.ts +31 -0
- package/apps/agents-server/src/app/admin/files/filesGalleryRows.ts +119 -0
- package/apps/agents-server/src/app/admin/files/filesGalleryTypes.ts +43 -0
- package/apps/agents-server/src/app/admin/files/page.tsx +13 -2
- package/apps/agents-server/src/app/admin/files/useFilesGalleryState.ts +58 -16
- package/apps/agents-server/src/app/admin/images/ImagesGalleryClient.tsx +3 -0
- package/apps/agents-server/src/app/admin/images/ImagesGalleryTable.tsx +56 -6
- package/apps/agents-server/src/app/admin/images/actions.ts +18 -2
- package/apps/agents-server/src/app/admin/images/useImagesGalleryState.ts +57 -16
- package/apps/agents-server/src/app/admin/internal-s3/page.tsx +369 -0
- package/apps/agents-server/src/app/admin/login-methods/shibboleth/ShibbolethSortableTables.tsx +361 -0
- package/apps/agents-server/src/app/admin/login-methods/shibboleth/page.tsx +7 -108
- package/apps/agents-server/src/app/admin/messages/MessagesClient.tsx +69 -5
- package/apps/agents-server/src/app/admin/metadata/MetadataClient.tsx +77 -9
- package/apps/agents-server/src/app/admin/projects/actions.ts +158 -0
- package/apps/agents-server/src/app/admin/projects/agentProjectCustomDomainForm.ts +4 -0
- package/apps/agents-server/src/app/admin/projects/page.tsx +502 -0
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerClient.tsx +36 -11
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerScopeTabs.tsx +74 -0
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +70 -242
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskTargetLink.tsx +57 -0
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskTerminalDialog.tsx +3 -1
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTasksCard.tsx +118 -11
- package/apps/agents-server/src/app/admin/task-manager/[taskId]/TaskManagerTaskDetailClient.tsx +312 -0
- package/apps/agents-server/src/app/admin/task-manager/[taskId]/page.tsx +34 -0
- package/apps/agents-server/src/app/admin/task-manager/adminChatTaskActionDialogs.ts +232 -0
- package/apps/agents-server/src/app/admin/task-manager/taskManagerTaskPresentation.tsx +275 -0
- package/apps/agents-server/src/app/admin/task-manager/useTaskManagerState.ts +111 -114
- package/apps/agents-server/src/app/admin/task-manager-vps/page.tsx +8 -0
- package/apps/agents-server/src/app/admin/usage/UsageClientAnalyticsPanels.tsx +123 -8
- package/apps/agents-server/src/app/admin/users/[userId]/UserActivityTable.tsx +134 -0
- package/apps/agents-server/src/app/admin/users/[userId]/UserDetailClient.tsx +3 -8
- package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +18 -1
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileChat.tsx +17 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileWrapper.tsx +7 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/book/download/route.ts +71 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/messages/route.ts +8 -4
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/route.ts +10 -5
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/resolveUserChatScope.ts +11 -1
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/route.ts +9 -2
- package/apps/agents-server/src/app/agents/[agentName]/book+chat/page.tsx +18 -5
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatHistoryClient.tsx +32 -1
- package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatPanel.tsx +23 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +42 -4
- package/apps/agents-server/src/app/agents/[agentName]/chat/ExternalUserChatAdminActions.tsx +125 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/page.tsx +49 -9
- package/apps/agents-server/src/app/agents/[agentName]/chat/resolveAgentChatDisplayName.ts +27 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/useAgentChatHistoryClientState.ts +12 -1
- package/apps/agents-server/src/app/agents/[agentName]/chat/useAgentChatHistoryOptimisticState.ts +1 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/useCanonicalAgentChatPanelState.ts +4 -10
- package/apps/agents-server/src/app/agents/[agentName]/layout.tsx +9 -1
- package/apps/agents-server/src/app/agents/[agentName]/page.tsx +69 -5
- package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/AgentProjectVscodeKeyboardShortcut.tsx +75 -0
- package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/actions.ts +77 -0
- package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/files/[...filePath]/route.ts +86 -0
- package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/page.tsx +795 -0
- package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/vscode/route.ts +76 -0
- package/apps/agents-server/src/app/agents/[agentName]/projects/page.tsx +91 -0
- package/apps/agents-server/src/app/api/admin/chat-tasks/[taskId]/cancel/route.ts +19 -77
- package/apps/agents-server/src/app/api/admin/chat-tasks/[taskId]/retry/route.ts +22 -4
- package/apps/agents-server/src/app/api/admin/chat-tasks/[taskId]/route.ts +31 -0
- package/apps/agents-server/src/app/api/admin/chat-tasks/[taskId]/terminal/route.ts +25 -16
- package/apps/agents-server/src/app/api/admin/chat-tasks/cancel-all/route.ts +45 -0
- package/apps/agents-server/src/app/api/admin/default-agents/reinstate/route.ts +62 -0
- package/apps/agents-server/src/app/api/admin/dns-records/cloudflare/route.ts +116 -0
- package/apps/agents-server/src/app/api/admin/{code-runners → harness-auth}/authentication/route.ts +17 -17
- package/apps/agents-server/src/app/api/admin/{code-runners → harness-auth}/route.ts +15 -13
- package/apps/agents-server/src/app/api/admin/servers/[serverId]/route.ts +54 -48
- package/apps/agents-server/src/app/api/admin/servers/route.ts +197 -25
- package/apps/agents-server/src/app/api/admin/vps/chat-tasks/cancel-all/route.ts +37 -0
- package/apps/agents-server/src/app/api/admin/vps/chat-tasks/route.ts +26 -0
- package/apps/agents-server/src/app/api/agent-project-runtime-auth/route.ts +32 -0
- package/apps/agents-server/src/app/api/agent-project-vscode-auth/[sessionId]/route.ts +54 -0
- package/apps/agents-server/src/app/api/chat-history/export/route.ts +13 -0
- package/apps/agents-server/src/app/api/chat-history/route.ts +16 -14
- package/apps/agents-server/src/app/api/chat-history/threads/route.ts +68 -0
- package/apps/agents-server/src/app/api/docs/book-language.md/route.ts +11 -3
- package/apps/agents-server/src/app/api/docs/book-language.pdf/route.ts +29 -0
- package/apps/agents-server/src/app/api/docs/book.md/route.ts +11 -3
- package/apps/agents-server/src/app/api/emails/incoming/stalwart/route.ts +85 -0
- package/apps/agents-server/src/app/api/internal/agent-project-runtimes/route.ts +178 -0
- package/apps/agents-server/src/app/api/internal/user-chat-jobs/run/route.ts +7 -18
- package/apps/agents-server/src/app/api/messages/route.ts +24 -2
- package/apps/agents-server/src/app/api/onboarding/book/route.ts +22 -0
- package/apps/agents-server/src/app/api/onboarding/draft/route.ts +23 -0
- package/apps/agents-server/src/app/api/onboarding/evaluate/route.ts +25 -0
- package/apps/agents-server/src/app/api/onboarding/test/route.ts +29 -0
- package/apps/agents-server/src/app/api/page-preview/input/route.ts +22 -133
- package/apps/agents-server/src/app/api/page-preview/state/route.ts +46 -0
- package/apps/agents-server/src/app/api/page-preview/stream/route.ts +24 -0
- package/apps/agents-server/src/app/docs/[docId]/page.tsx +8 -8
- package/apps/agents-server/src/app/docs/page.tsx +7 -3
- package/apps/agents-server/src/app/globals.css +0 -59
- package/apps/agents-server/src/app/layout.tsx +165 -1
- package/apps/agents-server/src/app/page.tsx +23 -1
- package/apps/agents-server/src/app/superadmin/email-server/actions.ts +28 -0
- package/apps/agents-server/src/app/superadmin/email-server/page.tsx +127 -0
- package/apps/agents-server/src/app/superadmin/environment/EnvironmentVariablesClient.tsx +498 -0
- package/apps/agents-server/src/app/{admin → superadmin}/environment/page.tsx +1 -1
- package/apps/agents-server/src/app/{admin/code-runners/CodeRunnersClient.tsx → superadmin/harness-auth/HarnessAuthClient.tsx} +107 -66
- package/apps/agents-server/src/app/superadmin/harness-auth/OpenAiCodexAuthWizard.tsx +208 -0
- package/apps/agents-server/src/app/{admin/code-runners → superadmin/harness-auth}/page.tsx +4 -4
- package/apps/agents-server/src/app/superadmin/internal-s3/page.tsx +53 -0
- package/apps/agents-server/src/app/superadmin/loading.tsx +14 -0
- package/apps/agents-server/src/app/superadmin/resource-monitor/ResourceMonitorSortableTables.tsx +539 -0
- package/apps/agents-server/src/app/superadmin/resource-monitor/actions.ts +25 -0
- package/apps/agents-server/src/app/{admin → superadmin}/resource-monitor/page.tsx +55 -67
- package/apps/agents-server/src/app/superadmin/resource-monitor/resourceMonitorDisplay.ts +13 -0
- package/apps/agents-server/src/app/{admin → superadmin}/servers/ServersClient.tsx +12 -4
- package/apps/agents-server/src/app/{admin → superadmin}/servers/ServersRegistryApi.ts +1 -1
- package/apps/agents-server/src/app/{admin → superadmin}/servers/ServersRegistryDnsTypes.ts +24 -32
- package/apps/agents-server/src/app/{admin → superadmin}/servers/ServersRegistryTable.tsx +291 -89
- package/apps/agents-server/src/app/{admin → superadmin}/servers/useCreateServerWizard.ts +2 -2
- package/apps/agents-server/src/app/{admin → superadmin}/servers/useServersRegistryState.ts +68 -3
- package/apps/agents-server/src/app/superadmin/task-manager/page.tsx +14 -0
- package/apps/agents-server/src/app/{admin → superadmin}/update/AutomaticSelfUpdateConfigurationCard.tsx +9 -12
- package/apps/agents-server/src/app/{admin → superadmin}/update/UpdateJobCard.tsx +16 -2
- package/apps/agents-server/src/app/superadmin/update/updatePageCardClassName.ts +6 -0
- package/apps/agents-server/src/app/system/user-wallet/UserWalletClient.tsx +5 -1
- package/apps/agents-server/src/app/system/user-wallet/UserWalletDraft.ts +9 -1
- package/apps/agents-server/src/app/system/user-wallet/UserWalletRecordFormFields.tsx +13 -0
- package/apps/agents-server/src/app/system/user-wallet/UserWalletRecordValue.tsx +12 -0
- package/apps/agents-server/src/app/system/user-wallet/page.tsx +4 -1
- package/apps/agents-server/src/components/AdminTerminal/AdminTerminalCard.tsx +32 -24
- package/apps/agents-server/src/components/AdminTerminal/useAdminTerminalSession.ts +22 -1
- package/apps/agents-server/src/components/AgentContextMenu/AgentContextMenu.tsx +4 -0
- package/apps/agents-server/src/components/AgentContextMenu/useAgentContextMenuActions.ts +31 -0
- package/apps/agents-server/src/components/AgentContextMenu/useAgentContextMenuItems.ts +28 -0
- package/apps/agents-server/src/components/AgentNaming/legacyAgentTextTranslations.cs.yaml +7 -0
- package/apps/agents-server/src/components/AgentProjectDnsInstructions/AgentProjectDnsInstructions.tsx +182 -0
- package/apps/agents-server/src/components/AgentProjects/AgentProjectDnsWarning.tsx +24 -0
- package/apps/agents-server/src/components/AgentProjects/AgentProjectItem.tsx +190 -0
- package/apps/agents-server/src/components/AgentProjects/AgentProjectReferencesList.tsx +73 -0
- package/apps/agents-server/src/components/AgentProjects/AgentProjectRuntimeStatusBadge.tsx +37 -0
- package/apps/agents-server/src/components/AgentProjects/AgentProjectsBoard.tsx +61 -0
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsApiTokenImportStep.tsx +137 -0
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsCheckStep.tsx +28 -0
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsExcludedRecordsNote.tsx +37 -0
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsManualStep.tsx +75 -0
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsWizard.tsx +88 -0
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsWizardStepNavigation.tsx +53 -0
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsWizardSteps.ts +36 -0
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsZoneFileImportStep.tsx +109 -0
- package/apps/agents-server/src/components/CloudflareDnsWizard/useCloudflareDnsRecordImport.ts +71 -0
- package/apps/agents-server/src/components/CronJobConfiguration/CronJobConfiguration.tsx +834 -0
- package/apps/agents-server/src/components/DefaultAgents/ReinstateBundledAgentsButton.tsx +119 -0
- package/apps/agents-server/src/components/DnsProviderGuides/DnsProviderGuides.tsx +35 -0
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsInstructions.tsx +125 -0
- package/apps/agents-server/src/components/DocsToolbar/DocsToolbar.tsx +284 -25
- package/apps/agents-server/src/components/FileUploadAvailability/FileUploadUnavailableNotice.tsx +1 -1
- package/apps/agents-server/src/components/Footer/Footer.tsx +38 -15
- package/apps/agents-server/src/components/Header/ActiveAgentBreadcrumbContext.tsx +6 -1
- package/apps/agents-server/src/components/Header/Header.tsx +41 -9
- package/apps/agents-server/src/components/Header/HeaderDesktopTopMenuNavigation.tsx +22 -2
- package/apps/agents-server/src/components/Header/HeaderMobileDrawer.tsx +22 -2
- package/apps/agents-server/src/components/Header/HeaderTypes.ts +36 -1
- package/apps/agents-server/src/components/Header/buildActiveAgentViewItems.ts +9 -0
- package/apps/agents-server/src/components/Header/buildDocumentationDropdownItems.tsx +198 -3
- package/apps/agents-server/src/components/Header/buildHeaderMenuItems.ts +9 -1
- package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +296 -50
- package/apps/agents-server/src/components/Header/createAgentViewLabel.tsx +11 -2
- package/apps/agents-server/src/components/Header/resolveActiveAgentNavigation.ts +4 -0
- package/apps/agents-server/src/components/Header/resolveHeaderSystemWarnings.ts +215 -0
- package/apps/agents-server/src/components/Header/useHeaderActiveAgent.ts +25 -3
- package/apps/agents-server/src/components/Header/useHeaderAgentMenus.tsx +5 -1
- package/apps/agents-server/src/components/Homepage/AgentsList.tsx +6 -30
- package/apps/agents-server/src/components/Homepage/AgentsListHeader.tsx +25 -111
- package/apps/agents-server/src/components/Homepage/DefaultAgentsStatusNotice.tsx +121 -0
- package/apps/agents-server/src/components/Homepage/ExternalAgentsSectionClient.tsx +5 -11
- package/apps/agents-server/src/components/Homepage/HomepagePrimarySections.tsx +1 -6
- package/apps/agents-server/src/components/Homepage/agentOrganizationUtils.ts +0 -60
- package/apps/agents-server/src/components/Homepage/normalizeServerUrl.ts +2 -2
- package/apps/agents-server/src/components/Homepage/useAgentsListDerivedState.ts +4 -66
- package/apps/agents-server/src/components/Homepage/useAgentsListNavigationState.ts +18 -29
- package/apps/agents-server/src/components/Homepage/useAgentsListOverlayDetailsState.ts +3 -3
- package/apps/agents-server/src/components/Homepage/useAgentsListQueryState.ts +2 -26
- package/apps/agents-server/src/components/Homepage/useAgentsListState.ts +9 -51
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +52 -1
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/ManGoNewAgentWizard.tsx +8 -2
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/WizardShell.tsx +125 -21
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/agentEvalService.ts +19 -15
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/agentTestService.ts +33 -37
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/bookService.ts +12 -12
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/createManGoAgentSource.ts +6 -1
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/createManGoOpenEditorRequest.ts +23 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/draftService.ts +11 -24
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/postManGoOnboardingJson.ts +104 -0
- package/apps/agents-server/src/components/NewAgentDialog/NewAgentOpenEditorRequest.ts +19 -0
- package/apps/agents-server/src/components/NewAgentDialog/NewAgentWizard.tsx +2 -11
- package/apps/agents-server/src/components/NewAgentDialog/createNewAgentWizardSubmissionActions.ts +2 -4
- package/apps/agents-server/src/components/NewAgentDialog/useNewAgentDialog.tsx +9 -7
- package/apps/agents-server/src/components/Skeleton/HomepageLoadingSkeleton.tsx +1 -18
- package/apps/agents-server/src/components/StalwartSynchronizeButton/StalwartSynchronizeButton.tsx +52 -0
- package/apps/agents-server/src/components/UsersList/CreateUserDialog.tsx +153 -0
- package/apps/agents-server/src/components/UsersList/UsersList.tsx +229 -103
- package/apps/agents-server/src/components/UsersList/generateSecurePassword.ts +50 -0
- package/apps/agents-server/src/components/UsersList/useUserActivity.ts +78 -0
- package/apps/agents-server/src/constants/harnessAuthRoutes.ts +20 -0
- package/apps/agents-server/src/constants/serverLimits.ts +2 -2
- package/apps/agents-server/src/constants/shibbolethAuth.ts +13 -0
- package/apps/agents-server/src/database/$provideDatabaseAdminExecutor.ts +12 -13
- package/apps/agents-server/src/database/createMissingAgentsFromBooks.ts +77 -0
- package/apps/agents-server/src/database/metadataDefaults.ts +2 -2
- package/apps/agents-server/src/database/migrations/2026-07-1400-wallet-browser-profile-record-type.sql +16 -0
- package/apps/agents-server/src/database/migrations/2026-07-1700-chat-history-chat-task-links.sql +10 -0
- package/apps/agents-server/src/database/migrations/2026-07-2500-user-chat-email-source.sql +13 -0
- package/apps/agents-server/src/database/reinstateDefaultAgents.ts +111 -0
- package/apps/agents-server/src/database/schema.ts +9 -3
- package/apps/agents-server/src/database/seedCoreAgents.ts +8 -30
- package/apps/agents-server/src/database/sqlite/$provideAgentsServerSqliteDatabase.ts +48 -16
- package/apps/agents-server/src/database/sqlite/$provideCurrentServerSqliteDatabase.ts +18 -0
- package/apps/agents-server/src/database/sqlite/$provideLocalSqliteSupabase.ts +15 -13
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/LocalSqliteSupabaseClient.ts +15 -3
- package/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteTableSchema.ts +5 -2
- package/apps/agents-server/src/database/sqlite/resolveLocalSqliteTableLocation.ts +104 -0
- package/apps/agents-server/src/database/sqlite/resolveServerSqliteDatabasePath.ts +72 -0
- package/apps/agents-server/src/database/sqlite/standaloneServerRegistryStore.ts +479 -0
- package/apps/agents-server/src/generated/reservedPaths.ts +1 -1
- package/apps/agents-server/src/instrumentation-node.ts +58 -0
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +50 -1
- package/apps/agents-server/src/languages/translations/czech.yaml +53 -4
- package/apps/agents-server/src/languages/translations/english.yaml +52 -3
- package/apps/agents-server/src/message-providers/email/_common/parseInboundEmail.ts +71 -0
- package/apps/agents-server/src/message-providers/email/sendgrid/parseInboundSendgridEmail.ts +2 -42
- package/apps/agents-server/src/message-providers/email/smtp/SmtpMessageProvider.ts +43 -0
- package/apps/agents-server/src/message-providers/email/stalwart/StalwartMessageProvider.ts +74 -0
- package/apps/agents-server/src/message-providers/email/stalwart/StalwartMtaHookPayload.ts +32 -0
- package/apps/agents-server/src/message-providers/email/stalwart/parseInboundStalwartEmail.ts +74 -0
- package/apps/agents-server/src/message-providers/index.ts +9 -0
- package/apps/agents-server/src/middleware.ts +2 -1
- package/apps/agents-server/src/search/createDefaultServerSearchProviders/createConversationsSearchProvider.ts +10 -3
- package/apps/agents-server/src/tools/$provideBrowserForServer.ts +4 -1
- package/apps/agents-server/src/tools/$provideServer.ts +14 -2
- package/apps/agents-server/src/tools/BrowserConnectionProvider.ts +250 -51
- package/apps/agents-server/src/tools/mapRegisteredServerContexts.ts +104 -0
- package/apps/agents-server/src/tools/runBrowserWorkflow.ts +5 -0
- package/apps/agents-server/src/tools/run_browser.ts +8 -0
- package/apps/agents-server/src/tools/serverContextOverride.ts +42 -0
- package/apps/agents-server/src/utils/adminChatTaskLinks.ts +170 -0
- package/apps/agents-server/src/utils/agentAccess.ts +1 -1
- package/apps/agents-server/src/utils/agentBook/createAgentBookDownloadFilename.ts +51 -0
- package/apps/agents-server/src/utils/agentBook/downloadAgentBook.ts +86 -0
- package/apps/agents-server/src/utils/agentBrowserProfile/$provideAgentBrowserProfile.ts +92 -0
- package/apps/agents-server/src/utils/agentBrowserProfile/$provideAgentBrowserProfileForToolArgs.ts +36 -0
- package/apps/agents-server/src/utils/agentBrowserProfile/agentBrowserProfileWalletConstants.ts +9 -0
- package/apps/agents-server/src/utils/agentBrowserProfile/findAgentBrowserProfileWalletRecord.ts +37 -0
- package/apps/agents-server/src/utils/agentBrowserProfile/resolveAgentBrowserProfileDirectory.ts +62 -0
- package/apps/agents-server/src/utils/agentIdentifier.ts +27 -4
- package/apps/agents-server/src/utils/agentOwnership.ts +3 -3
- package/apps/agents-server/src/utils/agentProjects/AgentProjectInfo.ts +153 -0
- package/apps/agents-server/src/utils/agentProjects/AgentProjectReferenceInfo.ts +19 -0
- package/apps/agents-server/src/utils/agentProjects/AgentProjectRuntimeInfo.ts +117 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectAccess.ts +71 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectCodeServerRegistry.ts +808 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectHrefs.ts +147 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeConstants.ts +49 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeDisplay.ts +42 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeDomains.ts +733 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimePaths.ts +102 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimePm2.ts +378 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeRegistry.ts +984 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectsPaths.ts +129 -0
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectDnsRecords.ts +67 -0
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectMarkdownReferences.ts +69 -0
- package/apps/agents-server/src/utils/agentProjects/createStaticAgentProjectServer.ts +275 -0
- package/apps/agents-server/src/utils/agentProjects/findFreeTcpPort.ts +48 -0
- package/apps/agents-server/src/utils/agentProjects/hasAgentProjectDevScript.ts +68 -0
- package/apps/agents-server/src/utils/agentProjects/hasAgentProjects.ts +24 -0
- package/apps/agents-server/src/utils/agentProjects/isMissingPathError.ts +14 -0
- package/apps/agents-server/src/utils/agentProjects/isTcpPortListening.ts +99 -0
- package/apps/agents-server/src/utils/agentProjects/killProcessListeningOnPort.ts +164 -0
- package/apps/agents-server/src/utils/agentProjects/listAgentProjectChatReferences.ts +33 -0
- package/apps/agents-server/src/utils/agentProjects/listAgentProjectDirectoryEntries.ts +188 -0
- package/apps/agents-server/src/utils/agentProjects/listAgentProjectDnsDiagnostics.ts +138 -0
- package/apps/agents-server/src/utils/agentProjects/listAgentProjectFiles.ts +105 -0
- package/apps/agents-server/src/utils/agentProjects/listAgentProjects.ts +41 -0
- package/apps/agents-server/src/utils/agentProjects/listAllAgentProjectSummaries.ts +199 -0
- package/apps/agents-server/src/utils/agentProjects/measureDirectoryUsage.ts +105 -0
- package/apps/agents-server/src/utils/agentProjects/readAgentProjectFile.ts +78 -0
- package/apps/agents-server/src/utils/agentProjects/readAgentProjectReadme.ts +71 -0
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectFileContentType.ts +46 -0
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectInfo.ts +94 -0
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectReadmeProfile.ts +219 -0
- package/apps/agents-server/src/utils/agentProjects/resolveCurrentAgentProjectServerDomain.ts +12 -0
- package/apps/agents-server/src/utils/agentRouting/agentRouteHrefs.ts +14 -0
- package/apps/agents-server/src/utils/agentRouting/resolveAgentRouteTarget.ts +2 -1
- package/apps/agents-server/src/utils/applyPagePreviewBrowserInput.ts +170 -0
- package/apps/agents-server/src/utils/bookLanguageDocumentation/BookLanguageDocumentationAgent.ts +25 -0
- package/apps/agents-server/src/utils/bookLanguageDocumentation/bookLanguageDocumentationExportParameters.ts +9 -0
- package/apps/agents-server/src/utils/bookLanguageDocumentation/createBookLanguageDocumentationMarkdownResponse.ts +88 -7
- package/apps/agents-server/src/utils/bookLanguageDocumentation/createBookLanguageDocumentationPdfResponse.ts +160 -0
- package/apps/agents-server/src/utils/bookLanguageDocumentation/createBookLanguageDocumentationPdfStyles.ts +251 -0
- package/apps/agents-server/src/utils/bookLanguageDocumentation/getBookLanguageDocumentationAgents.ts +60 -0
- package/apps/agents-server/src/utils/bookLanguageDocumentation/groupHtmlHeadingSections.ts +77 -0
- package/apps/agents-server/src/utils/bookLanguageDocumentation/highlightBookCodeBlocksInHtml.ts +68 -0
- package/apps/agents-server/src/utils/buildDomainTablePrefix.ts +24 -0
- package/apps/agents-server/src/utils/cancelAdminChatTaskById.ts +152 -0
- package/apps/agents-server/src/utils/cancelAllActiveAdminChatTasks.ts +199 -0
- package/apps/agents-server/src/utils/chat/createChatHistoryRecorder.ts +32 -13
- package/apps/agents-server/src/utils/chat/resolveCitationSourceLabel.ts +77 -0
- package/apps/agents-server/src/utils/chatExport/renderHtmlToPdfOnServer.ts +3 -84
- package/apps/agents-server/src/utils/chatFeedbackMode.ts +1 -1
- package/apps/agents-server/src/utils/chatHistoryAdmin.ts +44 -0
- package/apps/agents-server/src/utils/chatHistoryMessage.ts +218 -0
- package/apps/agents-server/src/utils/chatTasksAdmin.ts +176 -12
- package/apps/agents-server/src/utils/cloudflare/CloudflareApi.ts +159 -0
- package/apps/agents-server/src/utils/cloudflare/CloudflareDnsBatchApplication.ts +49 -0
- package/apps/agents-server/src/utils/cloudflare/applyCloudflareDnsRecordInstructions.ts +142 -0
- package/apps/agents-server/src/utils/cloudflare/createCloudflareDnsRecord.ts +21 -0
- package/apps/agents-server/src/utils/cloudflare/createCloudflareDnsRecordRequestBody.ts +86 -0
- package/apps/agents-server/src/utils/cloudflare/findBestMatchingCloudflareZoneForDomain.ts +41 -0
- package/apps/agents-server/{scripts/createCloudflareDnsRecordSyncPlan → src/utils/cloudflare}/listAllCloudflareDnsRecords.ts +1 -3
- package/apps/agents-server/{scripts/createCloudflareDnsRecordSyncPlan → src/utils/cloudflare}/listCloudflareZones.ts +1 -3
- package/apps/agents-server/{scripts/createCloudflareDnsRecordSyncPlan → src/utils/cloudflare}/normalizeCloudflareDnsRecordContent.ts +0 -2
- package/apps/agents-server/{scripts/createCloudflareDnsRecordSyncPlan → src/utils/cloudflare}/requestCloudflare.ts +4 -6
- package/apps/agents-server/src/utils/cloudflare/resolveCloudflareDnsRecordApplyAction.ts +157 -0
- package/apps/agents-server/src/utils/cloudflare/updateCloudflareDnsRecord.ts +26 -0
- package/apps/agents-server/src/utils/createPagePreviewBrowserStream.ts +123 -31
- package/apps/agents-server/src/utils/createPagePreviewFramePump.ts +117 -0
- package/apps/agents-server/src/utils/customDomainRouting.ts +3 -1
- package/apps/agents-server/src/utils/defaultAgents/coreAgentExplanations.ts +53 -0
- package/apps/agents-server/src/utils/defaultAgents/resolveDefaultAgentsStatus.ts +249 -0
- package/apps/agents-server/src/utils/dnsProviderGuides.ts +38 -0
- package/apps/agents-server/src/utils/dnsRecords/DnsRecordInstruction.ts +33 -0
- package/apps/agents-server/src/utils/dnsRecords/createDnsZoneFileExport.ts +91 -0
- package/apps/agents-server/src/utils/dnsRecords/resolveDnsRecordBatchPlan.ts +81 -0
- package/apps/agents-server/src/utils/email/EmailUserChatContext.ts +64 -0
- package/apps/agents-server/src/utils/email/agentEmailAddress.ts +115 -0
- package/apps/agents-server/src/utils/email/emailSystemAddresses.ts +15 -0
- package/apps/agents-server/src/utils/email/findOrCreateEmailAdHocUser.ts +94 -0
- package/apps/agents-server/src/utils/email/listAgentEmailIdentities.ts +102 -0
- package/apps/agents-server/src/utils/email/processInboundAgentEmail.ts +375 -0
- package/apps/agents-server/src/utils/email/sendEmailChatReply.ts +155 -0
- package/apps/agents-server/src/utils/email/sendEmailThroughStalwart.ts +39 -0
- package/apps/agents-server/src/utils/externalChatRunner/processExternalUserChatJob.ts +42 -1
- package/apps/agents-server/src/utils/getAdminChatTaskById.ts +72 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/adminChatTaskInjection.ts +326 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskSqlQuery.ts +89 -6
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/compareAdminChatTasks.ts +175 -7
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/getAdminChatTasksViaSupabaseQuery.ts +1 -1
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/loadAdminChatTaskFallbackData.ts +2 -1
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskFallbackRows.ts +2 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskSqlRows.ts +5 -1
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/mapVpsSelfUpdateJobToAdminChatTask.ts +9 -3
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/parseAdminChatTaskQuery.ts +34 -1
- package/apps/agents-server/src/utils/getAdminChatTasksResponse.ts +17 -244
- package/apps/agents-server/src/utils/getPagePreviewBrowserSessionState.ts +41 -0
- package/apps/agents-server/src/utils/getVpsAdminChatTasksResponse.ts +150 -0
- package/apps/agents-server/src/utils/{codeRunnerAuthentication.ts → harnessAuthentication.ts} +72 -56
- package/apps/agents-server/src/utils/harnessConfiguration.ts +232 -0
- package/apps/agents-server/src/utils/internalS3/createInternalS3Client.ts +48 -0
- package/apps/agents-server/src/utils/internalS3/internalS3Types.ts +241 -0
- package/apps/agents-server/src/utils/internalS3/probeInternalS3Health.ts +135 -0
- package/apps/agents-server/src/utils/internalS3/readInternalS3Configuration.ts +51 -0
- package/apps/agents-server/src/utils/internalS3/readInternalS3Directory.ts +385 -0
- package/apps/agents-server/src/utils/internalS3/readInternalS3Snapshot.ts +56 -0
- package/apps/agents-server/src/utils/internalS3/resolveInternalS3ErrorMessage.ts +36 -0
- package/apps/agents-server/src/utils/internalS3/resolveInternalS3Status.ts +86 -0
- package/apps/agents-server/src/utils/localChatRunner/ensureLocalAgentFolder.ts +2 -0
- package/apps/agents-server/src/utils/localChatRunner/persistLocalUserChatJobProgressFromRuntimeLog.ts +136 -0
- package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +42 -0
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentBooks.ts +86 -0
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentRuntime.ts +426 -0
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingApiRequest.ts +100 -0
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingApiResponses.ts +28 -0
- package/apps/agents-server/src/utils/messagesAdmin.ts +20 -0
- package/apps/agents-server/src/utils/mockedChats/$saveMockedChatPresetFromMessages.ts +61 -0
- package/apps/agents-server/src/utils/mockedChats/createMockedChatPresetFromChatMessages.ts +143 -0
- package/apps/agents-server/src/utils/mockedChatsSchema/normalizeMockedChatPreset.ts +3 -2
- package/apps/agents-server/src/utils/pagePreviewBrowserSessions.ts +57 -29
- package/apps/agents-server/src/utils/parsePositiveUserId.ts +20 -0
- package/apps/agents-server/src/utils/pdf/getPromptbookLogoDataUrl.ts +40 -0
- package/apps/agents-server/src/utils/pdf/renderHtmlToPdfOnServer.ts +86 -0
- package/apps/agents-server/src/utils/readRequiredAdminReason.ts +19 -0
- package/apps/agents-server/src/utils/resolveAgentHash.ts +36 -0
- package/apps/agents-server/src/utils/resourceMonitor/readAgentProjectRuntimesResourceUsage.ts +28 -0
- package/apps/agents-server/src/utils/resourceMonitor/readAgentProjectsResourceUsage.ts +49 -0
- package/apps/agents-server/src/utils/resourceMonitor/readServerResourceMonitorSnapshot.ts +7 -1
- package/apps/agents-server/src/utils/resourceMonitor/resourceMonitorTypes.ts +86 -1
- package/apps/agents-server/src/utils/serverManagement/createManagedServer.ts +21 -1
- package/apps/agents-server/src/utils/serverManagement/resolveServersDnsWarningStatus.ts +64 -0
- package/apps/agents-server/src/utils/serverManagement/standaloneVpsServerMetadata.ts +121 -40
- package/apps/agents-server/src/utils/serverRegistry.ts +31 -22
- package/apps/agents-server/src/utils/stalwart/StalwartConfiguration.ts +36 -0
- package/apps/agents-server/src/utils/stalwart/captureStalwartSynchronizationResult.ts +30 -0
- package/apps/agents-server/src/utils/stalwart/createEmailDnsInstructions.ts +69 -0
- package/apps/agents-server/src/utils/stalwart/readStalwartEmailSnapshot.ts +105 -0
- package/apps/agents-server/src/utils/stalwart/resolveStalwartApiUrl.ts +50 -0
- package/apps/agents-server/src/utils/stalwart/stalwartBootstrap.ts +116 -0
- package/apps/agents-server/src/utils/stalwart/stalwartJmapClient.ts +258 -0
- package/apps/agents-server/src/utils/stalwart/stalwartJmapValues.ts +33 -0
- package/apps/agents-server/src/utils/stalwart/stalwartMailBridge.ts +18 -0
- package/apps/agents-server/src/utils/stalwart/synchronizeAllStalwartEmailDomains.ts +28 -0
- package/apps/agents-server/src/utils/stalwart/synchronizeStalwartEmailDomain.ts +143 -0
- package/apps/agents-server/src/utils/standaloneVpsDnsDiagnostics.ts +21 -31
- package/apps/agents-server/src/utils/startPagePreviewScreencast.ts +105 -0
- package/apps/agents-server/src/utils/taskTerminal/resolveAdminTaskTerminalSession.ts +250 -37
- package/apps/agents-server/src/utils/thinkingMessages.ts +20 -2
- package/apps/agents-server/src/utils/userChat/UserChatRecord.ts +16 -0
- package/apps/agents-server/src/utils/userChat/UserChatSource.ts +9 -0
- package/apps/agents-server/src/utils/userChat/appendQueuedUserChatTurn.ts +31 -0
- package/apps/agents-server/src/utils/userChat/createUserChat.ts +2 -1
- package/apps/agents-server/src/utils/userChat/createUserChatDetailPayload.ts +15 -1
- package/apps/agents-server/src/utils/userChat/createUserChatSummary.ts +13 -1
- package/apps/agents-server/src/utils/userChat/expiredRunningUserChatJobDiagnostics.ts +2 -0
- package/apps/agents-server/src/utils/userChat/getUserChat.ts +8 -3
- package/apps/agents-server/src/utils/userChat/isUserChatViewOnly.ts +16 -0
- package/apps/agents-server/src/utils/userChat/listUserChats.ts +39 -11
- package/apps/agents-server/src/utils/userChat/persistUserChatJobTerminalState.ts +38 -0
- package/apps/agents-server/src/utils/userChat/recordUserChatMessageInChatHistory.ts +107 -0
- package/apps/agents-server/src/utils/userChat/resolveUserChatWorkerInternalToken.ts +3 -2
- package/apps/agents-server/src/utils/userChat/runDurableUserChatJobWorkerTick.ts +70 -0
- package/apps/agents-server/src/utils/userChat/userChatJobRunReport.ts +76 -0
- package/apps/agents-server/src/utils/userChat.ts +5 -0
- package/apps/agents-server/src/utils/userChatClient.ts +5 -0
- package/apps/agents-server/src/utils/userWallet/UserWalletRecord.ts +6 -1
- package/apps/agents-server/src/utils/userWallet/normalizeWalletPayload.ts +15 -1
- package/apps/agents-server/src/utils/vpsCertificateScheduler.ts +171 -0
- package/apps/agents-server/src/utils/vpsConfiguration.ts +83 -61
- package/apps/agents-server/src/utils/vpsSelfUpdate/readAgentsServerFooterVersion.ts +335 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/readPersistedVpsSelfUpdateJob.ts +8 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate/startVpsSelfUpdate.ts +1 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateAutomaticConfiguration.ts +1 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateInstalledVersions.ts +1 -1
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateJobHistory.ts +107 -4
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateStateFiles.ts +24 -0
- package/apps/agents-server/src/utils/vpsTask/runWithVpsServerSetupTask.ts +192 -0
- package/apps/agents-server/src/utils/vpsTask/vpsTaskHistory.ts +189 -0
- package/apps/agents-server/src/utils/vpsTask/vpsTaskTypes.ts +67 -0
- package/esm/apps/agents-server/src/constants/serverLimits.d.ts +1 -1
- package/esm/apps/agents-server/src/database/sqlite/$provideAgentsServerSqliteDatabase.d.ts +69 -0
- package/esm/apps/agents-server/src/database/sqlite/localSqliteSupabase/ensureTable.d.ts +7 -0
- package/esm/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteSql.d.ts +30 -0
- package/esm/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteTableSchema.d.ts +76 -0
- package/esm/apps/agents-server/src/database/sqlite/resolveAgentsServerSqliteDatabasePath.d.ts +4 -0
- package/esm/apps/agents-server/src/database/sqlite/resolveServerSqliteDatabasePath.d.ts +28 -0
- package/esm/apps/agents-server/src/database/sqlite/standaloneServerRegistryStore.d.ts +110 -0
- package/esm/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeConstants.d.ts +40 -0
- package/esm/apps/agents-server/src/utils/buildDomainTablePrefix.d.ts +13 -0
- package/esm/apps/agents-server/src/utils/serverRegistry.d.ts +5 -1
- package/esm/index.es.js +4568 -2053
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-messages/main/loadAgentMessageQueueSnapshot.d.ts +1 -1
- package/esm/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +6 -1
- package/esm/scripts/run-agent-messages/messages/buildAgentProjectsPromptSection.d.ts +39 -0
- package/esm/scripts/run-agent-messages/messages/resolveAgentProjectRuntimePromptApi.d.ts +8 -0
- package/esm/scripts/run-agent-messages/messages/resolveAgentProjectsUrlPath.d.ts +12 -0
- package/esm/scripts/run-agent-messages/messages/writeAgentMessageRunReport.d.ts +22 -0
- package/esm/scripts/run-agent-messages/ui/buildAgentRunUiFrame.d.ts +6 -1
- package/esm/scripts/run-codex-prompts/common/buildCoderRunProgressSnapshot.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/cliProgressDisplay.d.ts +4 -2
- package/esm/scripts/run-codex-prompts/common/formatUnknownErrorMessage.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/common/sleepWithCountdown.d.ts +1 -0
- package/esm/scripts/run-codex-prompts/common/waitForPause.d.ts +49 -1
- package/esm/scripts/run-codex-prompts/common/waitUntilWorldTimeDeadline.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +3 -1
- package/esm/scripts/run-codex-prompts/git/gitBranchContext.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/git/gitLongPathsSupport.d.ts +17 -0
- package/esm/scripts/run-codex-prompts/isolation/coderIsolationCheckoutFailureReport.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/isolation/coderIsolationMergeFailureReport.d.ts +17 -0
- package/esm/scripts/run-codex-prompts/isolation/coderIsolationNaming.d.ts +26 -0
- package/esm/scripts/run-codex-prompts/isolation/copyCoderIsolationEnvironment.d.ts +8 -0
- package/esm/scripts/run-codex-prompts/isolation/createCoderIsolationWorktree.d.ts +22 -0
- package/esm/scripts/run-codex-prompts/isolation/markPromptIsolationMergeFailed.d.ts +10 -0
- package/esm/scripts/run-codex-prompts/isolation/mergeCoderIsolationWorktree.d.ts +24 -0
- package/esm/scripts/run-codex-prompts/isolation/removeCoderIsolationWorktree.d.ts +8 -0
- package/esm/scripts/run-codex-prompts/isolation/runIsolatedPromptRound.d.ts +14 -0
- package/esm/scripts/run-codex-prompts/main/runPromptRound.d.ts +9 -3
- package/esm/scripts/run-codex-prompts/prompts/buildPromptSectionSuffix.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/prompts/findNextTodoPrompt.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/prompts/formatRunnerSignature.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/isPromptInPriorityFilter.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/prompts/listPromptsToBeWritten.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/listRunnablePrompts.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/listUpcomingTasks.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +5 -4
- package/esm/scripts/run-codex-prompts/prompts/printPromptsToBeWritten.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/printStats.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/priorityFilter.d.ts +39 -0
- package/esm/scripts/run-codex-prompts/prompts/summarizePrompts.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/writePromptErrorLog.d.ts +3 -1
- package/esm/scripts/run-codex-prompts/runners/openai-codex/parseCodexLoginMethodFromOutput.d.ts +10 -0
- package/esm/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/server/runCoderHttpServer.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +7 -1
- package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +3 -16
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +1 -0
- package/esm/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +18 -1
- package/esm/src/_packages/components.index.d.ts +8 -0
- package/esm/src/_packages/core.index.d.ts +4 -0
- package/esm/src/_packages/types.index.d.ts +12 -0
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +7 -0
- package/esm/src/book-2.0/agent-source/parseAgentSource/ParsedAgentProfile.d.ts +1 -1
- package/esm/src/book-2.0/book-language-documentation/BookLanguageDocumentationExample.d.ts +5 -13
- package/esm/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +195 -0
- package/esm/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.d.ts +2 -1
- package/esm/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +43 -1
- package/esm/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.d.ts +10 -0
- package/esm/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.d.ts +10 -0
- package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +33 -0
- package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualDictionary.d.ts +15 -0
- package/esm/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +10 -0
- package/esm/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +30 -0
- package/esm/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.d.ts +2 -1
- package/esm/src/book-2.0/book-language-documentation/toStableAnchorId.d.ts +12 -0
- package/esm/src/book-3.0/AgentMessageRunReport.d.ts +78 -0
- package/esm/src/book-3.0/agentFolderPaths.d.ts +9 -0
- package/esm/src/book-3.0/codexLoginMethod.d.ts +38 -0
- package/esm/src/book-components/BookEditor/BookEditorSyntaxTokenStyles.d.ts +39 -0
- package/esm/src/book-components/BookEditor/createBookSourceHighlightStyles.d.ts +12 -0
- package/esm/src/book-components/BookEditor/highlightBookSourceToHtml.d.ts +20 -0
- package/esm/src/book-components/Chat/Chat/ChatCitationModal.d.ts +5 -0
- package/esm/src/book-components/Chat/Chat/ChatCitationModal.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/ChatFeedbackStar.d.ts +37 -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/ChatMessageRichContent.d.ts +5 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +13 -0
- package/esm/src/book-components/Chat/Chat/ChatRatingModal.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/CitationIframePreview.d.ts +25 -2
- package/esm/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.d.ts +39 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreviewToolbar.d.ts +71 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewInputEvent.d.ts +72 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.d.ts +64 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.test.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewSessionState.d.ts +14 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewViewport.d.ts +37 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/createPagePreviewSessionId.d.ts +20 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.d.ts +13 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.test.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/resolveChatRatingMessageKey.d.ts +8 -0
- package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +2 -0
- package/esm/src/book-components/Chat/SourceChip/SourceChip.test.d.ts +2 -0
- package/esm/src/book-components/Chat/hooks/useResolvedCitationLabel.test.d.ts +2 -0
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +78 -0
- package/esm/src/book-components/Chat/utils/resolveCitationSourceDisplay.d.ts +149 -0
- package/esm/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +9 -0
- package/esm/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -2
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.d.ts +1 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/add.d.ts +36 -0
- package/esm/src/cli/cli-commands/coder/add.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +24 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/createNonNegativeIntegerOptionParser.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +13 -0
- package/esm/src/cli/cli-commands/common/harness/$installHarness.d.ts +13 -0
- package/esm/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +40 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessDefinition.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +35 -0
- package/esm/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +11 -0
- package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/formatHarnessInstallationWarning.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts +1 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.d.ts +18 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.test.d.ts +1 -0
- package/esm/src/commitments/META/META.d.ts +2 -0
- package/esm/src/commitments/META_THINKING_MESSAGE/META_THINKING_MESSAGE.d.ts +26 -0
- package/esm/src/commitments/index.d.ts +2 -1
- package/esm/src/execution/utils/formatUsagePrice.d.ts +12 -0
- package/esm/src/execution/utils/formatUsagePrice.test.d.ts +1 -0
- package/esm/src/utils/agent-message-runtime/agentMessageRuntimePaths.d.ts +24 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +16 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.test.d.ts +1 -0
- package/esm/src/utils/agents/terminalAgentAvatarVisual.d.ts +104 -0
- package/esm/src/utils/agents/terminalAgentAvatarVisual.test.d.ts +1 -0
- package/esm/src/utils/html/escapeHtml.d.ts +9 -0
- package/esm/src/utils/markdown/shiftMarkdownHeadingLevels.d.ts +15 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -4
- package/src/_packages/components.index.ts +8 -0
- package/src/_packages/core.index.ts +4 -0
- package/src/_packages/types.index.ts +12 -0
- package/src/avatars/Avatar.tsx +13 -2
- package/src/avatars/renderAvatarVisual.ts +13 -2
- package/src/avatars/visuals/asciiOctopusAvatarVisual.ts +6 -1
- package/src/avatars/visuals/octopus2AvatarVisual.ts +5 -1
- package/src/avatars/visuals/octopus3AvatarVisual.ts +8 -1
- package/src/avatars/visuals/octopus3d2AvatarVisual.ts +10 -1
- package/src/avatars/visuals/octopus3d3AvatarVisual.ts +10 -1
- package/src/avatars/visuals/octopus3d4AvatarVisual.ts +10 -1
- package/src/book-2.0/agent-source/AgentBasicInformation.ts +8 -0
- package/src/book-2.0/agent-source/parseAgentSource/ParsedAgentProfile.ts +1 -1
- package/src/book-2.0/agent-source/parseAgentSource/applyMetaCommitment.ts +13 -0
- package/src/book-2.0/agent-source/parseAgentSource/extractParsedAgentProfile.ts +2 -0
- package/src/book-2.0/agent-source/parseAgentSource.ts +1 -0
- package/src/book-2.0/book-language-documentation/BookLanguageDocumentationExample.ts +5 -16
- package/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.ts +219 -0
- package/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.ts +2 -57
- package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +356 -270
- package/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.ts +349 -0
- package/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.ts +346 -0
- package/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.ts +61 -0
- package/src/book-2.0/book-language-documentation/getBookLanguageManualDictionary.ts +39 -0
- package/src/book-2.0/book-language-documentation/getSafeCodeBlock.ts +14 -0
- package/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.ts +110 -0
- package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts +45 -8
- package/src/book-2.0/book-language-documentation/toStableAnchorId.ts +18 -0
- package/src/book-3.0/AgentMessageRunReport.ts +164 -0
- package/src/book-3.0/CliAgent.ts +7 -1
- package/src/book-3.0/agentFolderPaths.ts +10 -0
- package/src/book-3.0/codexLoginMethod.ts +52 -0
- package/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.tsx +4 -1
- package/src/book-components/BookEditor/BookEditorSyntaxTokenStyles.ts +88 -0
- package/src/book-components/BookEditor/createBookSourceHighlightStyles.ts +49 -0
- package/src/book-components/BookEditor/highlightBookSourceToHtml.ts +208 -0
- package/src/book-components/BookEditor/useBookEditorMonacoLanguage.ts +2 -37
- package/src/book-components/BookEditor/useBookEditorMonacoUploads/bookEditorMonacoUploadTypes.ts +1 -6
- package/src/book-components/BookEditor/useBookEditorMonacoUploads/useBookEditorMonacoUploadQueue.ts +11 -1
- package/src/book-components/Chat/Chat/Chat.module.css +201 -27
- package/src/book-components/Chat/Chat/Chat.tsx +4 -0
- package/src/book-components/Chat/Chat/ChatCitationModal.tsx +108 -67
- package/src/book-components/Chat/Chat/ChatFeedbackStar.tsx +103 -0
- package/src/book-components/Chat/Chat/ChatInputArea.tsx +2 -1
- package/src/book-components/Chat/Chat/ChatMessageItem.tsx +24 -25
- package/src/book-components/Chat/Chat/ChatMessageList.tsx +10 -2
- package/src/book-components/Chat/Chat/ChatMessageRichContent.tsx +8 -1
- package/src/book-components/Chat/Chat/ChatProps.tsx +15 -0
- package/src/book-components/Chat/Chat/ChatRatingModal.tsx +8 -39
- package/src/book-components/Chat/Chat/CitationIframePreview.tsx +42 -146
- package/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.tsx +548 -0
- package/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreviewToolbar.tsx +223 -0
- package/src/book-components/Chat/Chat/pagePreview/PagePreviewInputEvent.ts +84 -0
- package/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.ts +149 -0
- package/src/book-components/Chat/Chat/pagePreview/PagePreviewSessionState.ts +14 -0
- package/src/book-components/Chat/Chat/pagePreview/PagePreviewViewport.ts +66 -0
- package/src/book-components/Chat/Chat/pagePreview/createPagePreviewSessionId.ts +51 -0
- package/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.ts +242 -0
- package/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.tsx +5 -1
- package/src/book-components/Chat/Chat/resolveChatRatingMessageKey.ts +11 -0
- package/src/book-components/Chat/Chat/useChatInputAreaComposer.ts +7 -7
- package/src/book-components/Chat/Chat/useChatInputAreaDictation.ts +7 -7
- package/src/book-components/Chat/Chat/useChatToolCallModalState.ts +4 -1
- package/src/book-components/Chat/MarkdownContent/MarkdownContent.module.css +135 -0
- package/src/book-components/Chat/MarkdownContent/MarkdownContent.tsx +6 -2
- package/src/book-components/Chat/SourceChip/SourceChip.module.css +21 -2
- package/src/book-components/Chat/SourceChip/SourceChip.tsx +84 -45
- package/src/book-components/Chat/hooks/useChatRatings.ts +1 -9
- package/src/book-components/Chat/hooks/useResolvedCitationLabel.ts +117 -10
- package/src/book-components/Chat/utils/citationHelpers.ts +11 -165
- package/src/book-components/Chat/utils/getToolCallChipletInfo.ts +5 -1
- package/src/book-components/Chat/utils/messagesToHtml.ts +1 -1
- package/src/book-components/Chat/utils/renderMarkdown.ts +274 -4
- package/src/book-components/Chat/utils/resolveCitationSourceDisplay.ts +1017 -0
- package/src/book-components/Chat/utils/thinkingMessageVariants.ts +16 -6
- package/src/cli/cli-commands/about.ts +1 -1
- package/src/cli/cli-commands/agent/agentCliOptions.ts +5 -2
- package/src/cli/cli-commands/agent-folder/agentProjectPaths.ts +14 -6
- package/src/cli/cli-commands/agent-folder/init.ts +6 -2
- package/src/cli/cli-commands/agent-folder/initializeAgentProjectConfiguration.ts +13 -2
- package/src/cli/cli-commands/agent-folder/printAgentInitializationSummary.ts +11 -2
- package/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerBuildSourceFingerprint.ts +6 -2
- package/src/cli/cli-commands/agents-server/buildAgentsServer/runNextBuild.ts +3 -4
- package/src/cli/cli-commands/agents-server/run.ts +4 -3
- package/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.ts +11 -3
- package/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerRuntimePaths.ts +1 -1
- package/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.ts +1 -1
- package/src/cli/cli-commands/agents-server/startAgentsServer/createInternalRouteErrorMessage.ts +5 -1
- package/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.ts +2 -1
- package/src/cli/cli-commands/agents-server/startAgentsServer/prepareAgentsServerLaunch.ts +4 -6
- package/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.ts +2 -1
- package/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.ts +2 -1
- package/src/cli/cli-commands/agents-server/startAgentsServer.ts +58 -17
- package/src/cli/cli-commands/agents-server.ts +6 -2
- package/src/cli/cli-commands/coder/add.ts +330 -0
- package/src/cli/cli-commands/coder/agentCodingFile.ts +15 -3
- package/src/cli/cli-commands/coder/boilerplateTemplates.ts +40 -0
- package/src/cli/cli-commands/coder/generate-boilerplates.ts +13 -12
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +2 -1
- package/src/cli/cli-commands/coder/init.ts +43 -17
- package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +6 -1
- package/src/cli/cli-commands/coder/run.ts +42 -17
- package/src/cli/cli-commands/coder/server.ts +29 -17
- package/src/cli/cli-commands/coder.ts +4 -0
- package/src/cli/cli-commands/common/createNonNegativeIntegerOptionParser.ts +31 -0
- package/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.ts +48 -0
- package/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.ts +31 -0
- package/src/cli/cli-commands/common/harness/$checkHarnessInstallation.ts +46 -0
- package/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.ts +48 -0
- package/src/cli/cli-commands/common/harness/$installHarness.ts +56 -0
- package/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.ts +29 -0
- package/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.ts +34 -0
- package/src/cli/cli-commands/common/harness/HarnessDefinition.ts +102 -0
- package/src/cli/cli-commands/common/harness/HarnessInstallationStatus.ts +42 -0
- package/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.ts +15 -0
- package/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.ts +28 -0
- package/src/cli/cli-commands/common/harness/formatHarnessInstallationWarning.ts +28 -0
- package/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.ts +39 -0
- package/src/cli/cli-commands/common/promptRunnerCliOptions.ts +8 -3
- package/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.ts +1 -13
- package/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.ts +38 -0
- package/src/commitments/MEMORY/createMemoryToolFunctions.ts +10 -1
- package/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.ts +10 -1
- package/src/commitments/MEMORY/parseMemoryToolArgs.ts +6 -1
- package/src/commitments/META/META.ts +4 -0
- package/src/commitments/META_THINKING_MESSAGE/META_THINKING_MESSAGE.ts +76 -0
- package/src/commitments/USE_BROWSER/USE_BROWSER.ts +1 -0
- package/src/commitments/USE_CALENDAR/createUseCalendarToolFunctions.ts +4 -1
- package/src/commitments/USE_PROJECT/createUseProjectToolFunctions.ts +10 -2
- package/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.ts +11 -1
- package/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.ts +6 -1
- package/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.ts +6 -1
- package/src/commitments/WALLET/createWalletToolFunctions.ts +11 -2
- package/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.ts +6 -1
- package/src/commitments/WALLET/parseWalletToolArgs.ts +10 -1
- package/src/commitments/index.ts +2 -0
- package/src/executables/locateApp.ts +1 -1
- package/src/execution/LlmExecutionTools.ts +6 -1
- package/src/execution/createPipelineExecutor/getReservedParametersForTask.ts +5 -1
- package/src/execution/utils/formatUsagePrice.ts +31 -0
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/createRegisteredLlmToolConfigurationStatusMessage.ts +1 -4
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderAvailableRegisteredLlmTools.ts +1 -4
- package/src/llm-providers/_common/register/$registeredLlmToolsMessage/renderRelevantRegisteredLlmToolsEnvironmentVariables.ts +1 -4
- package/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.ts +6 -1
- package/src/llm-providers/openai/OpenAiCompatibleExecutionTools.ts +6 -1
- package/src/llm-providers/openai/utils/OpenAiCompatibleUnsupportedParameterRetrier.ts +5 -1
- package/src/llm-providers/openai/utils/buildToolInvocationScript.ts +6 -1
- package/src/other/templates/getTemplatesPipelineCollection.ts +1088 -745
- package/src/scrapers/_common/utils/makeKnowledgeSourceHandler.ts +6 -1
- package/src/speech-recognition/OpenAiSpeechRecognition.ts +6 -1
- package/src/transpilers/_common/prepareSdkTranspilerContext.ts +4 -1
- package/src/types/Prompt.ts +7 -1
- package/src/types/string_host.ts +9 -1
- package/src/types/string_pipeline_url.ts +4 -1
- package/src/utils/agent-message-runtime/agentMessageRuntimePaths.ts +66 -0
- package/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.ts +119 -0
- package/src/utils/agents/terminalAgentAvatarVisual.ts +309 -0
- package/src/utils/html/escapeHtml.ts +24 -0
- package/src/utils/markdown/parseMarkdownSection.ts +5 -1
- package/src/utils/markdown/shiftMarkdownHeadingLevels.ts +63 -0
- package/src/utils/random/$randomFullnameWithColor.ts +6 -1
- package/src/version.ts +2 -2
- package/src/versions.txt +7 -0
- package/umd/apps/agents-server/src/constants/serverLimits.d.ts +1 -1
- package/umd/apps/agents-server/src/database/sqlite/$provideAgentsServerSqliteDatabase.d.ts +69 -0
- package/umd/apps/agents-server/src/database/sqlite/localSqliteSupabase/ensureTable.d.ts +7 -0
- package/umd/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteSql.d.ts +30 -0
- package/umd/apps/agents-server/src/database/sqlite/localSqliteSupabase/localSqliteTableSchema.d.ts +76 -0
- package/umd/apps/agents-server/src/database/sqlite/resolveAgentsServerSqliteDatabasePath.d.ts +4 -0
- package/umd/apps/agents-server/src/database/sqlite/resolveServerSqliteDatabasePath.d.ts +28 -0
- package/umd/apps/agents-server/src/database/sqlite/standaloneServerRegistryStore.d.ts +110 -0
- package/umd/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeConstants.d.ts +40 -0
- package/umd/apps/agents-server/src/utils/buildDomainTablePrefix.d.ts +13 -0
- package/umd/apps/agents-server/src/utils/serverRegistry.d.ts +5 -1
- package/umd/index.umd.js +4572 -2057
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-messages/main/loadAgentMessageQueueSnapshot.d.ts +1 -1
- package/umd/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +6 -1
- package/umd/scripts/run-agent-messages/messages/buildAgentProjectsPromptSection.d.ts +39 -0
- package/umd/scripts/run-agent-messages/messages/resolveAgentProjectRuntimePromptApi.d.ts +8 -0
- package/umd/scripts/run-agent-messages/messages/resolveAgentProjectsUrlPath.d.ts +12 -0
- package/umd/scripts/run-agent-messages/messages/writeAgentMessageRunReport.d.ts +22 -0
- package/umd/scripts/run-agent-messages/ui/buildAgentRunUiFrame.d.ts +6 -1
- package/umd/scripts/run-codex-prompts/common/buildCoderRunProgressSnapshot.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/common/cliProgressDisplay.d.ts +4 -2
- package/umd/scripts/run-codex-prompts/common/formatUnknownErrorMessage.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/common/sleepWithCountdown.d.ts +1 -0
- package/umd/scripts/run-codex-prompts/common/waitForPause.d.ts +49 -1
- package/umd/scripts/run-codex-prompts/common/waitUntilWorldTimeDeadline.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +3 -1
- package/umd/scripts/run-codex-prompts/git/gitBranchContext.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/git/gitLongPathsSupport.d.ts +17 -0
- package/umd/scripts/run-codex-prompts/isolation/coderIsolationCheckoutFailureReport.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/isolation/coderIsolationMergeFailureReport.d.ts +17 -0
- package/umd/scripts/run-codex-prompts/isolation/coderIsolationNaming.d.ts +26 -0
- package/umd/scripts/run-codex-prompts/isolation/copyCoderIsolationEnvironment.d.ts +8 -0
- package/umd/scripts/run-codex-prompts/isolation/createCoderIsolationWorktree.d.ts +22 -0
- package/umd/scripts/run-codex-prompts/isolation/markPromptIsolationMergeFailed.d.ts +10 -0
- package/umd/scripts/run-codex-prompts/isolation/mergeCoderIsolationWorktree.d.ts +24 -0
- package/umd/scripts/run-codex-prompts/isolation/removeCoderIsolationWorktree.d.ts +8 -0
- package/umd/scripts/run-codex-prompts/isolation/runIsolatedPromptRound.d.ts +14 -0
- package/umd/scripts/run-codex-prompts/main/runPromptRound.d.ts +9 -3
- package/umd/scripts/run-codex-prompts/prompts/buildPromptSectionSuffix.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/prompts/findNextTodoPrompt.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/formatCoderRunSteps.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/prompts/formatRunnerSignature.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/isPromptInPriorityFilter.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/prompts/listPromptsToBeWritten.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/listRunnablePrompts.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/listUpcomingTasks.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +5 -4
- package/umd/scripts/run-codex-prompts/prompts/printPromptsToBeWritten.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/printStats.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/priorityFilter.d.ts +39 -0
- package/umd/scripts/run-codex-prompts/prompts/summarizePrompts.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/writePromptErrorLog.d.ts +3 -1
- package/umd/scripts/run-codex-prompts/runners/openai-codex/parseCodexLoginMethodFromOutput.d.ts +10 -0
- package/umd/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/server/runCoderHttpServer.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +7 -1
- package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +3 -16
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +1 -0
- package/umd/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +18 -1
- package/umd/src/_packages/components.index.d.ts +8 -0
- package/umd/src/_packages/core.index.d.ts +4 -0
- package/umd/src/_packages/types.index.d.ts +12 -0
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +7 -0
- package/umd/src/book-2.0/agent-source/parseAgentSource/ParsedAgentProfile.d.ts +1 -1
- package/umd/src/book-2.0/book-language-documentation/BookLanguageDocumentationExample.d.ts +5 -13
- package/umd/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +195 -0
- package/umd/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.d.ts +2 -1
- package/umd/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +43 -1
- package/umd/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.test.d.ts +1 -0
- package/umd/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.d.ts +10 -0
- package/umd/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.d.ts +10 -0
- package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +33 -0
- package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualDictionary.d.ts +15 -0
- package/umd/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +10 -0
- package/umd/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +30 -0
- package/umd/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.d.ts +2 -1
- package/umd/src/book-2.0/book-language-documentation/toStableAnchorId.d.ts +12 -0
- package/umd/src/book-3.0/AgentMessageRunReport.d.ts +78 -0
- package/umd/src/book-3.0/AgentMessageRunReport.test.d.ts +1 -0
- package/umd/src/book-3.0/agentFolderPaths.d.ts +9 -0
- package/umd/src/book-3.0/codexLoginMethod.d.ts +38 -0
- package/umd/src/book-components/BookEditor/BookEditorSyntaxTokenStyles.d.ts +39 -0
- package/umd/src/book-components/BookEditor/createBookSourceHighlightStyles.d.ts +12 -0
- package/umd/src/book-components/BookEditor/highlightBookSourceToHtml.d.ts +20 -0
- package/umd/src/book-components/Chat/Chat/ChatCitationModal.d.ts +5 -0
- package/umd/src/book-components/Chat/Chat/ChatCitationModal.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/ChatFeedbackStar.d.ts +37 -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/ChatMessageRichContent.d.ts +5 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +13 -0
- package/umd/src/book-components/Chat/Chat/ChatRatingModal.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/CitationIframePreview.d.ts +25 -2
- package/umd/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.d.ts +39 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreviewToolbar.d.ts +71 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewInputEvent.d.ts +72 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.d.ts +64 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.test.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewSessionState.d.ts +14 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewViewport.d.ts +37 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/createPagePreviewSessionId.d.ts +20 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.d.ts +13 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.test.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/resolveChatRatingMessageKey.d.ts +8 -0
- package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +2 -0
- package/umd/src/book-components/Chat/SourceChip/SourceChip.test.d.ts +2 -0
- package/umd/src/book-components/Chat/hooks/useResolvedCitationLabel.test.d.ts +2 -0
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +78 -0
- package/umd/src/book-components/Chat/utils/resolveCitationSourceDisplay.d.ts +149 -0
- package/umd/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +9 -0
- package/umd/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -2
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.d.ts +1 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/add.d.ts +36 -0
- package/umd/src/cli/cli-commands/coder/add.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +24 -0
- package/umd/src/cli/cli-commands/coder.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/createNonNegativeIntegerOptionParser.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +13 -0
- package/umd/src/cli/cli-commands/common/harness/$installHarness.d.ts +13 -0
- package/umd/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +40 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessDefinition.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +35 -0
- package/umd/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +11 -0
- package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/formatHarnessInstallationWarning.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts +1 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.d.ts +18 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.test.d.ts +1 -0
- package/umd/src/commitments/META/META.d.ts +2 -0
- package/umd/src/commitments/META_THINKING_MESSAGE/META_THINKING_MESSAGE.d.ts +26 -0
- package/umd/src/commitments/index.d.ts +2 -1
- package/umd/src/execution/utils/formatUsagePrice.d.ts +12 -0
- package/umd/src/execution/utils/formatUsagePrice.test.d.ts +1 -0
- package/umd/src/utils/agent-message-runtime/agentMessageRuntimePaths.d.ts +24 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +16 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.test.d.ts +1 -0
- package/umd/src/utils/agents/terminalAgentAvatarVisual.d.ts +104 -0
- package/umd/src/utils/agents/terminalAgentAvatarVisual.test.d.ts +1 -0
- package/umd/src/utils/html/escapeHtml.d.ts +9 -0
- package/umd/src/utils/markdown/shiftMarkdownHeadingLevels.d.ts +15 -0
- package/umd/src/version.d.ts +1 -1
- package/apps/agents-server/scripts/createCloudflareDnsRecordSyncPlan/createCloudflareDnsRecord.ts +0 -34
- package/apps/agents-server/scripts/createCloudflareDnsRecordSyncPlan/updateCloudflareDnsRecord.ts +0 -41
- package/apps/agents-server/src/app/admin/environment/EnvironmentVariablesClient.tsx +0 -259
- package/apps/agents-server/src/app/admin/update/updatePageCardClassName.ts +0 -6
- package/apps/agents-server/src/app/pixel-agents-assets/[...assetPath]/route.ts +0 -148
- package/apps/agents-server/src/components/Homepage/AgentGraphNode.tsx +0 -78
- package/apps/agents-server/src/components/Homepage/AgentsGraph.tsx +0 -30
- package/apps/agents-server/src/components/Homepage/AgentsGraphCanvas.tsx +0 -181
- package/apps/agents-server/src/components/Homepage/AgentsGraphToolbar.tsx +0 -300
- package/apps/agents-server/src/components/Homepage/AgentsListViewContent.tsx +0 -383
- package/apps/agents-server/src/components/Homepage/AgentsMazeOffice.tsx +0 -1011
- package/apps/agents-server/src/components/Homepage/AgentsOffice.tsx +0 -453
- package/apps/agents-server/src/components/Homepage/AgentsOfficeToolbar.tsx +0 -132
- package/apps/agents-server/src/components/Homepage/AgentsPixelOffice.tsx +0 -553
- package/apps/agents-server/src/components/Homepage/FolderGroupNode.tsx +0 -20
- package/apps/agents-server/src/components/Homepage/GraphSummaryPanel.tsx +0 -99
- package/apps/agents-server/src/components/Homepage/OfficeScene.tsx +0 -109
- package/apps/agents-server/src/components/Homepage/OfficeSceneGeometry.tsx +0 -344
- package/apps/agents-server/src/components/Homepage/OfficeSceneRenderAgent.tsx +0 -276
- package/apps/agents-server/src/components/Homepage/OfficeSceneRenderCorridor.tsx +0 -79
- package/apps/agents-server/src/components/Homepage/OfficeSceneRenderDesk.tsx +0 -119
- package/apps/agents-server/src/components/Homepage/OfficeSceneRenderRoom.tsx +0 -576
- package/apps/agents-server/src/components/Homepage/OfficeSceneSurface.tsx +0 -60
- package/apps/agents-server/src/components/Homepage/OfficeTooltip.tsx +0 -124
- package/apps/agents-server/src/components/Homepage/ServerGroupNode.tsx +0 -23
- package/apps/agents-server/src/components/Homepage/buildAgentNodeId.ts +0 -28
- package/apps/agents-server/src/components/Homepage/buildAsciiGraph.ts +0 -45
- package/apps/agents-server/src/components/Homepage/buildCapabilityLinks.ts +0 -45
- package/apps/agents-server/src/components/Homepage/buildFolderOrderLinks.ts +0 -37
- package/apps/agents-server/src/components/Homepage/buildFreeGraphBoxLayout.ts +0 -446
- package/apps/agents-server/src/components/Homepage/buildGraphData.ts +0 -52
- package/apps/agents-server/src/components/Homepage/buildGraphDataTypes.ts +0 -161
- package/apps/agents-server/src/components/Homepage/buildGraphEdges.ts +0 -55
- package/apps/agents-server/src/components/Homepage/buildGraphLayoutNodes.ts +0 -785
- package/apps/agents-server/src/components/Homepage/buildGraphNodes.ts +0 -25
- package/apps/agents-server/src/components/Homepage/buildGraphSummaryInfo.ts +0 -28
- package/apps/agents-server/src/components/Homepage/buildMazeOfficeLayout.ts +0 -728
- package/apps/agents-server/src/components/Homepage/buildOfficeLayout.ts +0 -61
- package/apps/agents-server/src/components/Homepage/buildOfficeLayoutGroups.ts +0 -94
- package/apps/agents-server/src/components/Homepage/buildOfficeLayoutRooms.ts +0 -287
- package/apps/agents-server/src/components/Homepage/buildOfficeLayoutShared.ts +0 -209
- package/apps/agents-server/src/components/Homepage/buildOfficeLayoutTypes.ts +0 -152
- package/apps/agents-server/src/components/Homepage/buildOfficeLayoutVisuals.ts +0 -233
- package/apps/agents-server/src/components/Homepage/buildServerGroups.ts +0 -148
- package/apps/agents-server/src/components/Homepage/collectRelatedNodeIds.ts +0 -22
- package/apps/agents-server/src/components/Homepage/filterGraphData.ts +0 -127
- package/apps/agents-server/src/components/Homepage/homeViewMode.ts +0 -108
- package/apps/agents-server/src/components/Homepage/mazeOfficeAgentSupport.ts +0 -57
- package/apps/agents-server/src/components/Homepage/normalizeTargetAgentUrl.ts +0 -41
- package/apps/agents-server/src/components/Homepage/parseConnectionTypes.ts +0 -24
- package/apps/agents-server/src/components/Homepage/useAgentsGraphCanvasState.ts +0 -270
- package/apps/agents-server/src/components/Homepage/useAgentsGraphDownloadState.ts +0 -214
- package/apps/agents-server/src/components/Homepage/useAgentsGraphQueryState.ts +0 -214
- package/apps/agents-server/src/components/Homepage/useAgentsGraphState.ts +0 -137
- package/apps/agents-server/src/components/Skeleton/GraphLoadingSkeleton.tsx +0 -50
- package/apps/agents-server/src/utils/codeRunnerConfiguration.ts +0 -67
- package/esm/scripts/run-codex-prompts/common/formatUsagePrice.d.ts +0 -10
- package/esm/scripts/run-codex-prompts/prompts/hasSufficientPriority.d.ts +0 -5
- package/esm/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.d.ts +0 -25
- package/esm/src/book-components/_common/react-utils/escapeHtml.d.ts +0 -6
- package/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.ts +0 -54
- package/src/book-components/_common/react-utils/escapeHtml.tsx +0 -8
- package/umd/scripts/run-codex-prompts/common/formatUsagePrice.d.ts +0 -10
- package/umd/scripts/run-codex-prompts/prompts/hasSufficientPriority.d.ts +0 -5
- package/umd/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.d.ts +0 -25
- package/umd/src/book-components/_common/react-utils/escapeHtml.d.ts +0 -6
- /package/apps/agents-server/src/app/{admin → superadmin}/cli-access/CliAccessClient.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/cli-access/page.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/database/DatabaseAdminClient.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/database/DatabaseAdminStudioSurface.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/database/page.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/logs/LogsClient.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/logs/page.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/servers/CreateServerDialog.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/servers/DeleteCurrentServerSection.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/servers/page.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/AdvancedOriginRepositoryPanel.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/CurrentDeploymentCard.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/CustomCommitPicker.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/InstalledVersionsCard.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/PendingCommitsCard.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/TargetEnvironmentCard.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/UpdateClient.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/UpdateDatabaseMigrationsPanel.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/UpdateOverview.ts +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/buildDeploymentTimeBehindLabel.ts +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/formatHumanReadableTimestamp.ts +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/getUpdateJobFailureMessage.ts +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/getUpdateJobSuccessMessage.ts +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/page.tsx +0 -0
- /package/apps/agents-server/src/app/{admin → superadmin}/update/useUpdateClientState.ts +0 -0
- /package/esm/src/{executables/browsers/locateInternetExplorer.test.d.ts → book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.test.d.ts} +0 -0
- /package/{umd/src/executables/browsers/locateInternetExplorer.test.d.ts → esm/src/book-3.0/AgentMessageRunReport.test.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mkdir } from 'fs/promises';
|
|
2
|
-
import { BrowserContext, chromium } from 'playwright';
|
|
2
|
+
import { Browser, BrowserContext, chromium } from 'playwright';
|
|
3
3
|
import { resolvePromptbookTemporaryPath } from '../../../../src/utils/filesystem/promptbookTemporaryPath';
|
|
4
4
|
import { REMOTE_BROWSER_URL } from '../../config';
|
|
5
5
|
import { createServerChromiumLaunchOptions } from './createServerChromiumLaunchOptions';
|
|
@@ -29,6 +29,24 @@ const DEFAULT_BROWSER_USER_DATA_DIR = resolvePromptbookTemporaryPath(
|
|
|
29
29
|
'user-data',
|
|
30
30
|
);
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Cache key used for the shared default browser context without an agent profile.
|
|
34
|
+
*/
|
|
35
|
+
const DEFAULT_BROWSER_PROFILE_KEY = 'default';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Default idle time after which one unused browser context (with no open pages) is closed.
|
|
39
|
+
*
|
|
40
|
+
* The persistent profile directory outlives the closed browser, so closing idle contexts frees
|
|
41
|
+
* server resources without losing any cookies or sessions.
|
|
42
|
+
*/
|
|
43
|
+
const DEFAULT_BROWSER_CONTEXT_IDLE_TIMEOUT_MS = 10 * 60 * 1000;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Interval between idle-context sweeps.
|
|
47
|
+
*/
|
|
48
|
+
const BROWSER_CONTEXT_IDLE_SWEEP_INTERVAL_MS = 60 * 1000;
|
|
49
|
+
|
|
32
50
|
/**
|
|
33
51
|
* Default remote browser connect timeout in milliseconds.
|
|
34
52
|
*/
|
|
@@ -81,6 +99,37 @@ export type BrowserContextRequestOptions = {
|
|
|
81
99
|
* Optional browser run session identifier for structured logs.
|
|
82
100
|
*/
|
|
83
101
|
readonly sessionId?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Optional persistent browser-profile directory (Playwright user data dir) of one agent.
|
|
104
|
+
*
|
|
105
|
+
* When set, the browser context is launched on this profile so cookies, sessions and other
|
|
106
|
+
* browser data persist across sessions. When omitted, the shared default profile is used.
|
|
107
|
+
*/
|
|
108
|
+
readonly browserProfileDirectory?: string | null;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* One cached browser context together with its lifecycle metadata.
|
|
113
|
+
*
|
|
114
|
+
* @private internal type for `BrowserConnectionProvider`
|
|
115
|
+
*/
|
|
116
|
+
type ManagedBrowserContext = {
|
|
117
|
+
/**
|
|
118
|
+
* The cached Playwright browser context.
|
|
119
|
+
*/
|
|
120
|
+
readonly context: BrowserContext;
|
|
121
|
+
/**
|
|
122
|
+
* Remote browser connection owning the context, `null` in local mode.
|
|
123
|
+
*/
|
|
124
|
+
readonly remoteBrowser: Browser | null;
|
|
125
|
+
/**
|
|
126
|
+
* Connection mode used to create the context.
|
|
127
|
+
*/
|
|
128
|
+
readonly mode: BrowserConnectionMode;
|
|
129
|
+
/**
|
|
130
|
+
* Timestamp of the last context acquisition, used by the idle sweep.
|
|
131
|
+
*/
|
|
132
|
+
lastUsedAt: number;
|
|
84
133
|
};
|
|
85
134
|
|
|
86
135
|
/**
|
|
@@ -117,6 +166,10 @@ type BrowserConnectionProviderOptions = {
|
|
|
117
166
|
* Retry jitter ratio.
|
|
118
167
|
*/
|
|
119
168
|
readonly remoteConnectJitterRatio?: number;
|
|
169
|
+
/**
|
|
170
|
+
* Idle time after which one unused browser context (with no open pages) is closed.
|
|
171
|
+
*/
|
|
172
|
+
readonly contextIdleTimeoutMs?: number;
|
|
120
173
|
/**
|
|
121
174
|
* Optional random provider used by retry jitter.
|
|
122
175
|
*/
|
|
@@ -211,14 +264,23 @@ function createAbortError(): Error {
|
|
|
211
264
|
* - Local mode: Launches a persistent Chromium context on the same machine
|
|
212
265
|
* - Remote mode: Connects to a remote Playwright browser via WebSocket
|
|
213
266
|
*
|
|
267
|
+
* Contexts are cached per browser-profile directory so every agent can browse in its own
|
|
268
|
+
* persistent isolated profile. Contexts without open pages are closed after an idle timeout -
|
|
269
|
+
* the profile data on disk stays permanent, only the browser process is released.
|
|
270
|
+
*
|
|
271
|
+
* Note: Remote Playwright browsers do not support persistent user-data profiles, so in remote
|
|
272
|
+
* mode the per-profile contexts are isolated from each other but survive only for one connection.
|
|
273
|
+
*
|
|
214
274
|
* The remote mode is useful for environments like Vercel where running a full browser
|
|
215
275
|
* is not possible due to resource constraints.
|
|
216
276
|
*
|
|
217
277
|
* @private internal utility for Agents Server browser tools
|
|
218
278
|
*/
|
|
219
279
|
export class BrowserConnectionProvider {
|
|
220
|
-
private
|
|
221
|
-
private
|
|
280
|
+
private readonly managedBrowserContexts = new Map<string, ManagedBrowserContext>();
|
|
281
|
+
private readonly pendingBrowserContextCreations = new Map<string, Promise<BrowserContext>>();
|
|
282
|
+
private idleSweepTimer: ReturnType<typeof setInterval> | null = null;
|
|
283
|
+
private readonly contextIdleTimeoutMs: number;
|
|
222
284
|
private readonly isVerbose: boolean;
|
|
223
285
|
private readonly remoteConnectTimeoutMs: number;
|
|
224
286
|
private readonly remoteConnectRetries: number;
|
|
@@ -258,6 +320,9 @@ export class BrowserConnectionProvider {
|
|
|
258
320
|
this.remoteConnectJitterRatio =
|
|
259
321
|
options.remoteConnectJitterRatio ??
|
|
260
322
|
resolveNonNegativeNumberFromEnv('RUN_BROWSER_CONNECT_JITTER_RATIO', DEFAULT_REMOTE_CONNECT_JITTER_RATIO);
|
|
323
|
+
this.contextIdleTimeoutMs =
|
|
324
|
+
options.contextIdleTimeoutMs ??
|
|
325
|
+
resolvePositiveIntFromEnv('RUN_BROWSER_CONTEXT_IDLE_TIMEOUT_MS', DEFAULT_BROWSER_CONTEXT_IDLE_TIMEOUT_MS);
|
|
261
326
|
this.random = options.random ?? Math.random;
|
|
262
327
|
this.sleep = options.sleep;
|
|
263
328
|
}
|
|
@@ -268,6 +333,9 @@ export class BrowserConnectionProvider {
|
|
|
268
333
|
* This method automatically determines whether to use local or remote browser
|
|
269
334
|
* based on the REMOTE_BROWSER_URL environment variable.
|
|
270
335
|
*
|
|
336
|
+
* Contexts are cached per `browserProfileDirectory` so agents with a persistent
|
|
337
|
+
* browser profile never share cookies or sessions with each other.
|
|
338
|
+
*
|
|
271
339
|
* @returns Browser context instance
|
|
272
340
|
*/
|
|
273
341
|
public async getBrowserContext(options: BrowserContextRequestOptions = {}): Promise<BrowserContext> {
|
|
@@ -275,91 +343,218 @@ export class BrowserConnectionProvider {
|
|
|
275
343
|
throw createAbortError();
|
|
276
344
|
}
|
|
277
345
|
|
|
346
|
+
const browserProfileDirectory = options.browserProfileDirectory?.trim() || null;
|
|
347
|
+
const profileKey = browserProfileDirectory ?? DEFAULT_BROWSER_PROFILE_KEY;
|
|
348
|
+
|
|
278
349
|
// Check if we have a cached connection that's still valid
|
|
279
|
-
|
|
280
|
-
|
|
350
|
+
const cachedManagedContext = this.managedBrowserContexts.get(profileKey);
|
|
351
|
+
if (cachedManagedContext && this.isBrowserContextAlive(cachedManagedContext.context)) {
|
|
352
|
+
cachedManagedContext.lastUsedAt = Date.now();
|
|
353
|
+
return cachedManagedContext.context;
|
|
354
|
+
}
|
|
355
|
+
this.managedBrowserContexts.delete(profileKey);
|
|
356
|
+
|
|
357
|
+
// Concurrent requests for the same profile must share one creation - a persistent
|
|
358
|
+
// Chromium profile directory can only be opened by one browser process at a time
|
|
359
|
+
const pendingCreation = this.pendingBrowserContextCreations.get(profileKey);
|
|
360
|
+
if (pendingCreation) {
|
|
361
|
+
return await pendingCreation;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const creation = this.createManagedBrowserContext(profileKey, browserProfileDirectory, options);
|
|
365
|
+
this.pendingBrowserContextCreations.set(profileKey, creation);
|
|
366
|
+
try {
|
|
367
|
+
return await creation;
|
|
368
|
+
} finally {
|
|
369
|
+
this.pendingBrowserContextCreations.delete(profileKey);
|
|
281
370
|
}
|
|
371
|
+
}
|
|
282
372
|
|
|
373
|
+
/**
|
|
374
|
+
* Creates and caches one browser context for the requested profile.
|
|
375
|
+
*
|
|
376
|
+
* @param profileKey - Cache key of the created context.
|
|
377
|
+
* @param browserProfileDirectory - Persistent per-agent profile directory or `null` for the shared default profile.
|
|
378
|
+
* @param options - Runtime request options.
|
|
379
|
+
* @returns Created browser context.
|
|
380
|
+
*/
|
|
381
|
+
private async createManagedBrowserContext(
|
|
382
|
+
profileKey: string,
|
|
383
|
+
browserProfileDirectory: string | null,
|
|
384
|
+
options: BrowserContextRequestOptions,
|
|
385
|
+
): Promise<BrowserContext> {
|
|
283
386
|
// Determine connection mode from configuration
|
|
284
387
|
const mode = this.resolveConnectionMode();
|
|
285
|
-
this.connectionMode = mode;
|
|
286
388
|
|
|
287
389
|
if (this.isVerbose) {
|
|
288
390
|
console.info('[BrowserConnectionProvider] Creating new browser context', {
|
|
289
391
|
mode: mode.type,
|
|
392
|
+
profileKey,
|
|
290
393
|
wsEndpoint: mode.type === 'remote' ? mode.wsEndpoint : undefined,
|
|
291
394
|
});
|
|
292
395
|
}
|
|
293
396
|
|
|
294
397
|
// Create new browser context based on mode
|
|
398
|
+
let managedContext: ManagedBrowserContext;
|
|
295
399
|
if (mode.type === 'local') {
|
|
296
|
-
|
|
400
|
+
managedContext = {
|
|
401
|
+
context: await this.createLocalBrowserContext(browserProfileDirectory),
|
|
402
|
+
remoteBrowser: null,
|
|
403
|
+
mode,
|
|
404
|
+
lastUsedAt: Date.now(),
|
|
405
|
+
};
|
|
297
406
|
} else {
|
|
298
|
-
|
|
407
|
+
const { context, browser } = await this.createRemoteBrowserContext(mode.wsEndpoint, options);
|
|
408
|
+
managedContext = {
|
|
409
|
+
context,
|
|
410
|
+
remoteBrowser: browser,
|
|
411
|
+
mode,
|
|
412
|
+
lastUsedAt: Date.now(),
|
|
413
|
+
};
|
|
299
414
|
}
|
|
300
415
|
|
|
301
|
-
|
|
416
|
+
this.managedBrowserContexts.set(profileKey, managedContext);
|
|
417
|
+
this.ensureIdleSweepTimerIsRunning();
|
|
418
|
+
|
|
419
|
+
return managedContext.context;
|
|
302
420
|
}
|
|
303
421
|
|
|
304
422
|
/**
|
|
305
|
-
* Closes all pages in
|
|
423
|
+
* Closes all pages in all cached browser contexts.
|
|
306
424
|
*
|
|
307
425
|
* This method is useful for cleanup between agent tasks without closing
|
|
308
|
-
* the
|
|
426
|
+
* the browser instances themselves.
|
|
309
427
|
*/
|
|
310
428
|
public async closeAllPages(): Promise<void> {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
429
|
+
for (const managedContext of this.managedBrowserContexts.values()) {
|
|
430
|
+
try {
|
|
431
|
+
const pages = managedContext.context.pages();
|
|
314
432
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
433
|
+
if (this.isVerbose) {
|
|
434
|
+
console.info('[BrowserConnectionProvider] Closing all pages', {
|
|
435
|
+
pageCount: pages.length,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
await Promise.all(
|
|
440
|
+
pages.map((page) =>
|
|
441
|
+
page.close().catch((error) => {
|
|
442
|
+
console.error('[BrowserConnectionProvider] Failed to close page', { error });
|
|
443
|
+
}),
|
|
444
|
+
),
|
|
445
|
+
);
|
|
446
|
+
} catch (error) {
|
|
447
|
+
console.error('[BrowserConnectionProvider] Error closing pages', { error });
|
|
322
448
|
}
|
|
323
|
-
|
|
324
|
-
await Promise.all(
|
|
325
|
-
pages.map((page) =>
|
|
326
|
-
page.close().catch((error) => {
|
|
327
|
-
console.error('[BrowserConnectionProvider] Failed to close page', { error });
|
|
328
|
-
}),
|
|
329
|
-
),
|
|
330
|
-
);
|
|
331
|
-
} catch (error) {
|
|
332
|
-
console.error('[BrowserConnectionProvider] Error closing pages', { error });
|
|
333
449
|
}
|
|
334
450
|
}
|
|
335
451
|
|
|
336
452
|
/**
|
|
337
|
-
* Closes
|
|
453
|
+
* Closes all cached browser contexts and disconnects from remote browsers.
|
|
338
454
|
*
|
|
339
455
|
* This should be called when the browser is no longer needed to free up resources.
|
|
340
|
-
* For local mode, this closes the browser
|
|
341
|
-
* from the remote browser but doesn't shut down
|
|
456
|
+
* For local mode, this closes the browser processes (the persistent profile directories stay
|
|
457
|
+
* on disk). For remote mode, it disconnects from the remote browser but doesn't shut down
|
|
458
|
+
* the remote server.
|
|
342
459
|
*/
|
|
343
460
|
public async close(): Promise<void> {
|
|
344
|
-
|
|
345
|
-
|
|
461
|
+
this.stopIdleSweepTimer();
|
|
462
|
+
|
|
463
|
+
const managedContextEntries = [...this.managedBrowserContexts.entries()];
|
|
464
|
+
this.managedBrowserContexts.clear();
|
|
465
|
+
|
|
466
|
+
for (const [profileKey, managedContext] of managedContextEntries) {
|
|
467
|
+
await this.closeManagedBrowserContext(profileKey, managedContext);
|
|
346
468
|
}
|
|
469
|
+
}
|
|
347
470
|
|
|
471
|
+
/**
|
|
472
|
+
* Closes one cached browser context together with its remote connection when present.
|
|
473
|
+
*
|
|
474
|
+
* @param profileKey - Cache key of the closed context.
|
|
475
|
+
* @param managedContext - Context to close.
|
|
476
|
+
*/
|
|
477
|
+
private async closeManagedBrowserContext(profileKey: string, managedContext: ManagedBrowserContext): Promise<void> {
|
|
348
478
|
try {
|
|
349
479
|
if (this.isVerbose) {
|
|
350
480
|
console.info('[BrowserConnectionProvider] Closing browser context', {
|
|
351
|
-
mode:
|
|
481
|
+
mode: managedContext.mode.type,
|
|
482
|
+
profileKey,
|
|
352
483
|
});
|
|
353
484
|
}
|
|
354
485
|
|
|
355
|
-
await
|
|
356
|
-
this.browserContext = null;
|
|
357
|
-
this.connectionMode = null;
|
|
486
|
+
await managedContext.context.close();
|
|
358
487
|
} catch (error) {
|
|
359
|
-
console.error('[BrowserConnectionProvider] Error closing browser context', { error });
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
488
|
+
console.error('[BrowserConnectionProvider] Error closing browser context', { error, profileKey });
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
if (managedContext.remoteBrowser) {
|
|
492
|
+
try {
|
|
493
|
+
await managedContext.remoteBrowser.close();
|
|
494
|
+
} catch (error) {
|
|
495
|
+
console.error('[BrowserConnectionProvider] Error disconnecting remote browser', { error, profileKey });
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Starts the periodic idle sweep releasing browser contexts that are no longer used.
|
|
502
|
+
*
|
|
503
|
+
* The timer is unreferenced so it never keeps the Node process alive.
|
|
504
|
+
*/
|
|
505
|
+
private ensureIdleSweepTimerIsRunning(): void {
|
|
506
|
+
if (this.idleSweepTimer !== null) {
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
this.idleSweepTimer = setInterval(() => {
|
|
511
|
+
void this.closeIdleBrowserContexts();
|
|
512
|
+
}, BROWSER_CONTEXT_IDLE_SWEEP_INTERVAL_MS);
|
|
513
|
+
(this.idleSweepTimer as { unref?: () => void }).unref?.();
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Stops the periodic idle sweep.
|
|
518
|
+
*/
|
|
519
|
+
private stopIdleSweepTimer(): void {
|
|
520
|
+
if (this.idleSweepTimer !== null) {
|
|
521
|
+
clearInterval(this.idleSweepTimer);
|
|
522
|
+
this.idleSweepTimer = null;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Closes cached browser contexts that have no open pages and were idle beyond the timeout.
|
|
528
|
+
*
|
|
529
|
+
* Persistent profile data stays on disk - only the running browser is released so the server
|
|
530
|
+
* does not keep browsers alive while no agent or user is using them.
|
|
531
|
+
*/
|
|
532
|
+
private async closeIdleBrowserContexts(): Promise<void> {
|
|
533
|
+
const now = Date.now();
|
|
534
|
+
|
|
535
|
+
for (const [profileKey, managedContext] of this.managedBrowserContexts.entries()) {
|
|
536
|
+
if (now - managedContext.lastUsedAt < this.contextIdleTimeoutMs) {
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
let openPageCount = 0;
|
|
541
|
+
try {
|
|
542
|
+
openPageCount = managedContext.context.pages().length;
|
|
543
|
+
} catch {
|
|
544
|
+
openPageCount = 0;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
if (openPageCount > 0) {
|
|
548
|
+
managedContext.lastUsedAt = now;
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
this.managedBrowserContexts.delete(profileKey);
|
|
553
|
+
await this.closeManagedBrowserContext(profileKey, managedContext);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
if (this.managedBrowserContexts.size === 0) {
|
|
557
|
+
this.stopIdleSweepTimer();
|
|
363
558
|
}
|
|
364
559
|
}
|
|
365
560
|
|
|
@@ -399,14 +594,17 @@ export class BrowserConnectionProvider {
|
|
|
399
594
|
/**
|
|
400
595
|
* Creates a local browser context using persistent Chromium.
|
|
401
596
|
*
|
|
597
|
+
* @param browserProfileDirectory - Persistent per-agent profile directory or `null` for the shared default profile.
|
|
402
598
|
* @returns Local browser context
|
|
403
599
|
*/
|
|
404
|
-
private async createLocalBrowserContext(): Promise<BrowserContext> {
|
|
600
|
+
private async createLocalBrowserContext(browserProfileDirectory: string | null): Promise<BrowserContext> {
|
|
405
601
|
if (this.isVerbose) {
|
|
406
|
-
console.info('[BrowserConnectionProvider] Launching local browser context'
|
|
602
|
+
console.info('[BrowserConnectionProvider] Launching local browser context', {
|
|
603
|
+
browserProfileDirectory,
|
|
604
|
+
});
|
|
407
605
|
}
|
|
408
606
|
|
|
409
|
-
const userDataDir = `${DEFAULT_BROWSER_USER_DATA_DIR}/run-browser`;
|
|
607
|
+
const userDataDir = browserProfileDirectory ?? `${DEFAULT_BROWSER_USER_DATA_DIR}/run-browser`;
|
|
410
608
|
await mkdir(userDataDir, { recursive: true });
|
|
411
609
|
|
|
412
610
|
const launchOptions = await createServerChromiumLaunchOptions();
|
|
@@ -418,12 +616,12 @@ export class BrowserConnectionProvider {
|
|
|
418
616
|
* Creates a remote browser context by connecting to a Playwright server.
|
|
419
617
|
*
|
|
420
618
|
* @param wsEndpoint - WebSocket endpoint of the remote Playwright server
|
|
421
|
-
* @returns Remote browser context
|
|
619
|
+
* @returns Remote browser context together with its owning connection
|
|
422
620
|
*/
|
|
423
621
|
private async createRemoteBrowserContext(
|
|
424
622
|
wsEndpoint: string,
|
|
425
623
|
options: BrowserContextRequestOptions,
|
|
426
|
-
): Promise<BrowserContext> {
|
|
624
|
+
): Promise<{ context: BrowserContext; browser: Browser }> {
|
|
427
625
|
const endpointDebug = sanitizeRemoteBrowserEndpoint(wsEndpoint);
|
|
428
626
|
const startedAt = Date.now();
|
|
429
627
|
|
|
@@ -473,7 +671,8 @@ export class BrowserConnectionProvider {
|
|
|
473
671
|
const browser = connectResult.value;
|
|
474
672
|
|
|
475
673
|
// For remote connections, we need to create a new context
|
|
476
|
-
// Note: Remote browsers don't support persistent contexts
|
|
674
|
+
// Note: Remote browsers don't support persistent contexts, so per-agent isolation is
|
|
675
|
+
// provided by separate contexts but the profile data is not persisted remotely
|
|
477
676
|
const context = await browser.newContext();
|
|
478
677
|
REMOTE_BROWSER_CONNECT_METRICS.success++;
|
|
479
678
|
|
|
@@ -492,7 +691,7 @@ export class BrowserConnectionProvider {
|
|
|
492
691
|
console.info('[BrowserConnectionProvider] Successfully connected to remote browser');
|
|
493
692
|
}
|
|
494
693
|
|
|
495
|
-
return context;
|
|
694
|
+
return { context, browser };
|
|
496
695
|
} catch (error) {
|
|
497
696
|
REMOTE_BROWSER_CONNECT_METRICS.failure++;
|
|
498
697
|
const durationMs = Date.now() - startedAt;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createServerPublicUrl,
|
|
3
|
+
listRegisteredServersUsingServiceRole,
|
|
4
|
+
normalizeServerDomain,
|
|
5
|
+
resolveRegisteredServerByHost,
|
|
6
|
+
type ServerRecord,
|
|
7
|
+
} from '../utils/serverRegistry';
|
|
8
|
+
import type { ProvidedServer } from './$provideServer';
|
|
9
|
+
import { runWithServerContextOverride } from './serverContextOverride';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Result of running one callback inside a single registered server's context.
|
|
13
|
+
*
|
|
14
|
+
* @private internal type of Agents Server server-context routing
|
|
15
|
+
*/
|
|
16
|
+
export type ServerContextRun<TResult> = {
|
|
17
|
+
/**
|
|
18
|
+
* Registered server the callback ran for, or `null` when the deployment has no
|
|
19
|
+
* registered servers and the callback ran once in the ambient request context.
|
|
20
|
+
*/
|
|
21
|
+
readonly server: ServerRecord | null;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Value returned by the callback for this server.
|
|
25
|
+
*/
|
|
26
|
+
readonly value: TResult;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Runs one callback once per registered VPS server, each inside that server's routing context.
|
|
31
|
+
*
|
|
32
|
+
* This is the shared VPS-wide iteration primitive: it lets a single detached process
|
|
33
|
+
* (a background worker tick or a superadmin aggregation) touch every server on the VPS
|
|
34
|
+
* without a per-server `host` header. Servers are processed sequentially so per-server
|
|
35
|
+
* work never competes for the same resources at once.
|
|
36
|
+
*
|
|
37
|
+
* When no servers are registered (for example local development or a single-tenant
|
|
38
|
+
* deployment before the registry is populated) the callback runs exactly once in the
|
|
39
|
+
* ambient request context with `server` resolved to `null`.
|
|
40
|
+
*
|
|
41
|
+
* @param callback - Work to run for each server; receives the server it runs for.
|
|
42
|
+
* @returns One run result per server, in registry order.
|
|
43
|
+
*
|
|
44
|
+
* @private internal utility of Agents Server server-context routing
|
|
45
|
+
*/
|
|
46
|
+
export async function mapRegisteredServerContexts<TResult>(
|
|
47
|
+
callback: (server: ServerRecord | null) => Promise<TResult>,
|
|
48
|
+
): Promise<Array<ServerContextRun<TResult>>> {
|
|
49
|
+
const registeredServers = await listRegisteredServersUsingServiceRole();
|
|
50
|
+
|
|
51
|
+
if (registeredServers.length === 0) {
|
|
52
|
+
return [{ server: null, value: await callback(null) }];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const serverRuns: Array<ServerContextRun<TResult>> = [];
|
|
56
|
+
for (const server of registeredServers) {
|
|
57
|
+
const providedServer: ProvidedServer = {
|
|
58
|
+
id: server.id,
|
|
59
|
+
publicUrl: createServerPublicUrl(server.domain),
|
|
60
|
+
tablePrefix: server.tablePrefix,
|
|
61
|
+
};
|
|
62
|
+
const value = await runWithServerContextOverride(providedServer, () => callback(server));
|
|
63
|
+
serverRuns.push({ server, value });
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return serverRuns;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Runs one callback inside the registered server identified by its domain.
|
|
71
|
+
*
|
|
72
|
+
* The helper is used by VPS-wide admin actions after the listing has identified the owning
|
|
73
|
+
* server. Returning `null` for an unknown domain keeps a stale task row from being treated as a
|
|
74
|
+
* task belonging to the ambient request server.
|
|
75
|
+
*
|
|
76
|
+
* @param serverDomain - Domain of the registered server to enter.
|
|
77
|
+
* @param callback - Work to run inside the selected server context.
|
|
78
|
+
* @returns Callback result, or `null` when the server is no longer registered.
|
|
79
|
+
*
|
|
80
|
+
* @private internal utility of Agents Server server-context routing
|
|
81
|
+
*/
|
|
82
|
+
export async function runWithRegisteredServerContext<TResult>(
|
|
83
|
+
serverDomain: string,
|
|
84
|
+
callback: () => Promise<TResult>,
|
|
85
|
+
): Promise<TResult | null> {
|
|
86
|
+
const normalizedServerDomain = normalizeServerDomain(serverDomain);
|
|
87
|
+
if (!normalizedServerDomain) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const registeredServers = await listRegisteredServersUsingServiceRole();
|
|
92
|
+
const server = resolveRegisteredServerByHost(normalizedServerDomain, registeredServers);
|
|
93
|
+
if (!server) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const providedServer: ProvidedServer = {
|
|
98
|
+
id: server.id,
|
|
99
|
+
publicUrl: createServerPublicUrl(server.domain),
|
|
100
|
+
tablePrefix: server.tablePrefix,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return runWithServerContextOverride(providedServer, callback);
|
|
104
|
+
}
|
|
@@ -48,6 +48,10 @@ export const runBrowserWorkflow = {
|
|
|
48
48
|
readonly sessionId: string;
|
|
49
49
|
readonly timeouts: RunBrowserTimeoutConfiguration;
|
|
50
50
|
readonly signal?: AbortSignal;
|
|
51
|
+
/**
|
|
52
|
+
* Persistent per-agent browser-profile directory, `null` for the shared default profile.
|
|
53
|
+
*/
|
|
54
|
+
readonly browserProfileDirectory?: string | null;
|
|
51
55
|
}): Promise<OpenPageWithUrlResult> {
|
|
52
56
|
runBrowserErrorHandling.assertNotAborted(options.signal, options.sessionId);
|
|
53
57
|
|
|
@@ -55,6 +59,7 @@ export const runBrowserWorkflow = {
|
|
|
55
59
|
const browserContext = await $provideBrowserForServer({
|
|
56
60
|
signal: options.signal,
|
|
57
61
|
sessionId: options.sessionId,
|
|
62
|
+
browserProfileDirectory: options.browserProfileDirectory,
|
|
58
63
|
});
|
|
59
64
|
const connectDurationMs = Date.now() - connectStartedAt;
|
|
60
65
|
const page = await browserContext.newPage();
|
|
@@ -2,6 +2,7 @@ import { fetchUrlContent } from '../../../../src/commitments/USE_BROWSER/fetchUr
|
|
|
2
2
|
import { emitToolCallProgressFromToolArgs } from '../../../../src/commitments/_common/toolRuntimeContext';
|
|
3
3
|
import type { string_date_iso8601 } from '../../../../src/types/typeAliases';
|
|
4
4
|
import type { Page } from 'playwright';
|
|
5
|
+
import { $provideAgentBrowserProfileForToolArgs } from '../utils/agentBrowserProfile/$provideAgentBrowserProfileForToolArgs';
|
|
5
6
|
import type { RunBrowserInternalOptions } from './RunBrowserArgs';
|
|
6
7
|
import { runBrowserArtifacts } from './runBrowserArtifacts';
|
|
7
8
|
import { runBrowserConstants } from './runBrowserConstants';
|
|
@@ -90,11 +91,18 @@ export async function run_browser(args: RunBrowserArgs, internalOptions: RunBrow
|
|
|
90
91
|
const normalizedActions = runBrowserWorkflow.normalizeActions(args.actions);
|
|
91
92
|
runBrowserErrorHandling.assertNotAborted(internalOptions.signal, sessionId);
|
|
92
93
|
|
|
94
|
+
// Browse inside the agent's own persistent browser profile so cookies and logged-in
|
|
95
|
+
// sessions survive across chats and server restarts
|
|
96
|
+
const agentBrowserProfile = await $provideAgentBrowserProfileForToolArgs(
|
|
97
|
+
args as Record<string, unknown>,
|
|
98
|
+
);
|
|
99
|
+
|
|
93
100
|
const openedPage = await runBrowserWorkflow.openPageWithUrl({
|
|
94
101
|
url: initialUrl,
|
|
95
102
|
sessionId,
|
|
96
103
|
timeouts: timeoutConfiguration,
|
|
97
104
|
signal: internalOptions.signal,
|
|
105
|
+
browserProfileDirectory: agentBrowserProfile?.directory ?? null,
|
|
98
106
|
});
|
|
99
107
|
page = openedPage.page;
|
|
100
108
|
connectDurationMs = openedPage.connectDurationMs;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import type { ProvidedServer } from './$provideServer';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Async-local storage carrying an explicit server routing context.
|
|
6
|
+
*
|
|
7
|
+
* Detached background workers on a multi-server VPS have no request `host` header to
|
|
8
|
+
* resolve the current server from, so they run per-server work inside an explicit
|
|
9
|
+
* override that `$provideServer` honors.
|
|
10
|
+
*
|
|
11
|
+
* @private internal state of Agents Server server-context routing
|
|
12
|
+
*/
|
|
13
|
+
const serverContextOverrideStorage = new AsyncLocalStorage<ProvidedServer>();
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Runs one callback with an explicit server routing context so every `$provideServer`
|
|
17
|
+
* call inside it resolves to the given server instead of the request-header server.
|
|
18
|
+
*
|
|
19
|
+
* @param server - Server routing context to activate for the callback.
|
|
20
|
+
* @param callback - Work to run inside the overridden server context.
|
|
21
|
+
* @returns Result of the callback.
|
|
22
|
+
*
|
|
23
|
+
* @private internal utility of Agents Server server-context routing
|
|
24
|
+
*/
|
|
25
|
+
export function runWithServerContextOverride<TResult>(
|
|
26
|
+
server: ProvidedServer,
|
|
27
|
+
callback: () => Promise<TResult>,
|
|
28
|
+
): Promise<TResult> {
|
|
29
|
+
return serverContextOverrideStorage.run(server, callback);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Reads the active server routing override, if any background worker set one.
|
|
34
|
+
*
|
|
35
|
+
* @returns Overriding server routing context, or `undefined` when the request-header
|
|
36
|
+
* server should be used.
|
|
37
|
+
*
|
|
38
|
+
* @private internal utility of Agents Server server-context routing
|
|
39
|
+
*/
|
|
40
|
+
export function getServerContextOverride(): ProvidedServer | undefined {
|
|
41
|
+
return serverContextOverrideStorage.getStore();
|
|
42
|
+
}
|