@promptbook/cli 0.103.0-8 → 0.103.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 +59 -39
- package/apps/agents-server/README.md +3 -0
- package/apps/agents-server/TODO.txt +7 -0
- package/apps/agents-server/config.ts +130 -0
- package/apps/agents-server/next.config.ts +45 -0
- package/apps/agents-server/package-lock.json +27 -0
- package/apps/agents-server/package.json +12 -0
- package/apps/agents-server/postcss.config.mjs +8 -0
- package/apps/agents-server/public/.gitkeep +0 -0
- package/apps/agents-server/public/favicon.ico +0 -0
- package/apps/agents-server/public/fonts/OpenMoji-black-glyf.woff2 +0 -0
- package/apps/agents-server/public/fonts/download-font.js +22 -0
- package/apps/agents-server/public/logo-blue-white-256.png +0 -0
- package/apps/agents-server/public/sw.js +16 -0
- package/apps/agents-server/src/app/AddAgentButton.tsx +41 -0
- package/apps/agents-server/src/app/[agentName]/[...rest]/page.tsx +11 -0
- package/apps/agents-server/src/app/[agentName]/page.tsx +1 -0
- package/apps/agents-server/src/app/actions.ts +53 -0
- package/apps/agents-server/src/app/admin/api-tokens/ApiTokensClient.tsx +186 -0
- package/apps/agents-server/src/app/admin/api-tokens/page.tsx +13 -0
- package/apps/agents-server/src/app/admin/chat-feedback/ChatFeedbackClient.tsx +614 -0
- package/apps/agents-server/src/app/admin/chat-feedback/page.tsx +22 -0
- package/apps/agents-server/src/app/admin/chat-history/ChatHistoryClient.tsx +634 -0
- package/apps/agents-server/src/app/admin/chat-history/page.tsx +21 -0
- package/apps/agents-server/src/app/admin/metadata/MetadataClient.tsx +477 -0
- package/apps/agents-server/src/app/admin/metadata/page.tsx +13 -0
- package/apps/agents-server/src/app/admin/models/page.tsx +22 -0
- package/apps/agents-server/src/app/admin/users/[userId]/UserDetailClient.tsx +131 -0
- package/apps/agents-server/src/app/admin/users/[userId]/page.tsx +21 -0
- package/apps/agents-server/src/app/admin/users/page.tsx +18 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +78 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentOptionsMenu.tsx +314 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileChat.tsx +91 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileWrapper.tsx +48 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentUrlCopy.tsx +40 -0
- package/apps/agents-server/src/app/agents/[agentName]/ClearAgentChatFeedbackButton.tsx +63 -0
- package/apps/agents-server/src/app/agents/[agentName]/ClearAgentChatHistoryButton.tsx +63 -0
- package/apps/agents-server/src/app/agents/[agentName]/CloneAgentButton.tsx +41 -0
- package/apps/agents-server/src/app/agents/[agentName]/CopyField.tsx +44 -0
- package/apps/agents-server/src/app/agents/[agentName]/InstallPwaButton.tsx +74 -0
- package/apps/agents-server/src/app/agents/[agentName]/ServiceWorkerRegister.tsx +24 -0
- package/apps/agents-server/src/app/agents/[agentName]/TODO.txt +1 -0
- package/apps/agents-server/src/app/agents/[agentName]/_utils.ts +19 -0
- package/apps/agents-server/src/app/agents/[agentName]/agentLinks.tsx +80 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/agents/route.ts +67 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +88 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/book/test.http +37 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/chat/route.ts +174 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/feedback/route.ts +54 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/mcp/route.ts +203 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/modelRequirements/TODO.txt +1 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/modelRequirements/route.ts +55 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/modelRequirements/systemMessage/route.ts +47 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/openai/chat/completions/route.ts +10 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/openai/models/route.ts +93 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/openai/v1/chat/completions/route.ts +10 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/openai/v1/models/route.ts +93 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/openrouter/chat/completions/route.ts +10 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/profile/route.ts +76 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/voice/route.ts +181 -0
- package/apps/agents-server/src/app/agents/[agentName]/book/BookEditorWrapper.tsx +139 -0
- package/apps/agents-server/src/app/agents/[agentName]/book/page.tsx +35 -0
- package/apps/agents-server/src/app/agents/[agentName]/book+chat/AgentBookAndChat.tsx +75 -0
- package/apps/agents-server/src/app/agents/[agentName]/book+chat/AgentBookAndChatComponent.tsx.todo +160 -0
- package/apps/agents-server/src/app/agents/[agentName]/book+chat/page.tsx +32 -0
- package/apps/agents-server/src/app/agents/[agentName]/book+chat/page.tsx.todo +21 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatWrapper.tsx +68 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/page.tsx +33 -0
- package/apps/agents-server/src/app/agents/[agentName]/generateAgentMetadata.ts +46 -0
- package/apps/agents-server/src/app/agents/[agentName]/history/RestoreVersionButton.tsx +46 -0
- package/apps/agents-server/src/app/agents/[agentName]/history/actions.ts +12 -0
- package/apps/agents-server/src/app/agents/[agentName]/history/page.tsx +62 -0
- package/apps/agents-server/src/app/agents/[agentName]/images/icon-256.png/route.tsx +80 -0
- package/apps/agents-server/src/app/agents/[agentName]/images/screenshot-fullhd.png/route.tsx +92 -0
- package/apps/agents-server/src/app/agents/[agentName]/images/screenshot-phone.png/route.tsx +92 -0
- package/apps/agents-server/src/app/agents/[agentName]/integration/SdkCodeTabs.tsx +31 -0
- package/apps/agents-server/src/app/agents/[agentName]/integration/page.tsx +302 -0
- package/apps/agents-server/src/app/agents/[agentName]/layout.tsx +41 -0
- package/apps/agents-server/src/app/agents/[agentName]/links/page.tsx +182 -0
- package/apps/agents-server/src/app/agents/[agentName]/opengraph-image.tsx +102 -0
- package/apps/agents-server/src/app/agents/[agentName]/page.tsx +106 -0
- package/apps/agents-server/src/app/agents/[agentName]/website-integration/page.tsx +70 -0
- package/apps/agents-server/src/app/agents/page.tsx +11 -0
- package/apps/agents-server/src/app/api/agents/[agentName]/clone/route.ts +47 -0
- package/apps/agents-server/src/app/api/agents/[agentName]/route.ts +19 -0
- package/apps/agents-server/src/app/api/agents/route.ts +43 -0
- package/apps/agents-server/src/app/api/api-tokens/route.ts +76 -0
- package/apps/agents-server/src/app/api/auth/change-password/route.ts +75 -0
- package/apps/agents-server/src/app/api/auth/login/route.ts +27 -0
- package/apps/agents-server/src/app/api/auth/logout/route.ts +7 -0
- package/apps/agents-server/src/app/api/chat/route.ts +32 -0
- package/apps/agents-server/src/app/api/chat-feedback/[id]/route.ts +38 -0
- package/apps/agents-server/src/app/api/chat-feedback/export/route.ts +55 -0
- package/apps/agents-server/src/app/api/chat-feedback/route.ts +157 -0
- package/apps/agents-server/src/app/api/chat-history/[id]/route.ts +37 -0
- package/apps/agents-server/src/app/api/chat-history/export/route.ts +55 -0
- package/apps/agents-server/src/app/api/chat-history/route.ts +147 -0
- package/apps/agents-server/src/app/api/chat-streaming/route.ts +48 -0
- package/apps/agents-server/src/app/api/embed.js/route.ts +93 -0
- package/apps/agents-server/src/app/api/federated-agents/route.ts +17 -0
- package/apps/agents-server/src/app/api/long-running-task/route.ts +7 -0
- package/apps/agents-server/src/app/api/long-streaming/route.ts +20 -0
- package/apps/agents-server/src/app/api/metadata/route.ts +116 -0
- package/apps/agents-server/src/app/api/openai/v1/chat/completions/route.ts +6 -0
- package/apps/agents-server/src/app/api/openai/v1/models/route.ts +65 -0
- package/apps/agents-server/src/app/api/upload/route.ts +83 -0
- package/apps/agents-server/src/app/api/users/[username]/route.ts +75 -0
- package/apps/agents-server/src/app/api/users/route.ts +71 -0
- package/apps/agents-server/src/app/docs/[docId]/page.tsx +43 -0
- package/apps/agents-server/src/app/docs/page.tsx +59 -0
- package/apps/agents-server/src/app/embed/page.tsx +24 -0
- package/apps/agents-server/src/app/globals.css +276 -0
- package/apps/agents-server/src/app/humans.txt/route.ts +15 -0
- package/apps/agents-server/src/app/layout.tsx +139 -0
- package/apps/agents-server/src/app/manifest.ts +114 -0
- package/apps/agents-server/src/app/not-found.tsx +5 -0
- package/apps/agents-server/src/app/page.tsx +96 -0
- package/apps/agents-server/src/app/recycle-bin/RestoreAgentButton.tsx +40 -0
- package/apps/agents-server/src/app/recycle-bin/actions.ts +27 -0
- package/apps/agents-server/src/app/recycle-bin/page.tsx +58 -0
- package/apps/agents-server/src/app/restricted/page.tsx +33 -0
- package/apps/agents-server/src/app/robots.txt/route.ts +15 -0
- package/apps/agents-server/src/app/security.txt/route.ts +15 -0
- package/apps/agents-server/src/app/sitemap.xml/route.ts +37 -0
- package/apps/agents-server/src/app/test/og-image/README.md +1 -0
- package/apps/agents-server/src/app/test/og-image/opengraph-image.tsx +37 -0
- package/apps/agents-server/src/app/test/og-image/page.tsx +22 -0
- package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +339 -0
- package/apps/agents-server/src/components/AgentProfile/AgentProfileFromSource.tsx +23 -0
- package/apps/agents-server/src/components/AgentProfile/AgentQrCode.tsx +62 -0
- package/apps/agents-server/src/components/AgentProfile/QrCodeModal.tsx +90 -0
- package/apps/agents-server/src/components/Auth/AuthControls.tsx +123 -0
- package/apps/agents-server/src/components/ChangePasswordDialog/ChangePasswordDialog.tsx +41 -0
- package/apps/agents-server/src/components/ChangePasswordForm/ChangePasswordForm.tsx +159 -0
- package/apps/agents-server/src/components/DocumentationContent/DocumentationContent.tsx +88 -0
- package/apps/agents-server/src/components/ErrorPage/ErrorPage.tsx +33 -0
- package/apps/agents-server/src/components/Footer/Footer.tsx +175 -0
- package/apps/agents-server/src/components/ForbiddenPage/ForbiddenPage.tsx +15 -0
- package/apps/agents-server/src/components/Header/Header.tsx +668 -0
- package/apps/agents-server/src/components/Homepage/AgentCard.tsx +60 -0
- package/apps/agents-server/src/components/Homepage/AgentsList.tsx +58 -0
- package/apps/agents-server/src/components/Homepage/Card.tsx +18 -0
- package/apps/agents-server/src/components/Homepage/ExternalAgentsSection.tsx +21 -0
- package/apps/agents-server/src/components/Homepage/ExternalAgentsSectionClient.tsx +183 -0
- package/apps/agents-server/src/components/Homepage/ModelCard.tsx +29 -0
- package/apps/agents-server/src/components/Homepage/ModelsSection.tsx +75 -0
- package/apps/agents-server/src/components/Homepage/Section.tsx +17 -0
- package/apps/agents-server/src/components/Homepage/TechInfoCard.tsx +20 -0
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +57 -0
- package/apps/agents-server/src/components/LoginDialog/LoginDialog.tsx +41 -0
- package/apps/agents-server/src/components/LoginForm/LoginForm.tsx +109 -0
- package/apps/agents-server/src/components/NotFoundPage/NotFoundPage.tsx +17 -0
- package/apps/agents-server/src/components/OpenMojiIcon/OpenMojiIcon.tsx +20 -0
- package/apps/agents-server/src/components/Portal/Portal.tsx +38 -0
- package/apps/agents-server/src/components/PrintButton/PrintButton.tsx +18 -0
- package/apps/agents-server/src/components/PrintHeader/PrintHeader.tsx +18 -0
- package/apps/agents-server/src/components/UsersList/UsersList.tsx +141 -0
- package/apps/agents-server/src/components/UsersList/useUsersAdmin.ts +139 -0
- package/apps/agents-server/src/components/VercelDeploymentCard/VercelDeploymentCard.tsx +55 -0
- package/apps/agents-server/src/components/_utils/generateMetaTxt.ts +28 -0
- package/apps/agents-server/src/components/_utils/headlessParam.tsx +36 -0
- package/apps/agents-server/src/database/$getTableName.ts +18 -0
- package/apps/agents-server/src/database/$provideSupabase.ts +29 -0
- package/apps/agents-server/src/database/$provideSupabaseForBrowser.ts +41 -0
- package/apps/agents-server/src/database/$provideSupabaseForServer.ts +48 -0
- package/apps/agents-server/src/database/$provideSupabaseForWorker.ts +43 -0
- package/apps/agents-server/src/database/getMetadata.ts +31 -0
- package/apps/agents-server/src/database/metadataDefaults.ts +75 -0
- package/apps/agents-server/src/database/migrate.ts +131 -0
- package/apps/agents-server/src/database/migrations/2025-11-0001-initial-schema.sql +163 -0
- package/apps/agents-server/src/database/migrations/2025-11-0002-metadata-table.sql +16 -0
- package/apps/agents-server/src/database/migrations/2025-12-0010-llm-cache.sql +12 -0
- package/apps/agents-server/src/database/migrations/2025-12-0060-api-tokens.sql +13 -0
- package/apps/agents-server/src/database/migrations/2025-12-0070-chat-history-source.sql +2 -0
- package/apps/agents-server/src/database/schema.ts +308 -0
- package/apps/agents-server/src/deamons/longRunningTask.ts +37 -0
- package/apps/agents-server/src/middleware.ts +305 -0
- package/apps/agents-server/src/tools/$provideAgentCollectionForServer.ts +54 -0
- package/apps/agents-server/src/tools/$provideCdnForServer.ts +36 -0
- package/apps/agents-server/src/tools/$provideExecutionToolsForServer.ts +117 -0
- package/apps/agents-server/src/tools/$provideOpenAiAssistantExecutionToolsForServer.ts +35 -0
- package/apps/agents-server/src/tools/$provideServer.ts +39 -0
- package/apps/agents-server/src/utils/auth.ts +33 -0
- package/apps/agents-server/src/utils/authenticateUser.ts +42 -0
- package/apps/agents-server/src/utils/cache/SupabaseCacheStorage.ts +55 -0
- package/apps/agents-server/src/utils/cdn/classes/DigitalOceanSpaces.ts +119 -0
- package/apps/agents-server/src/utils/cdn/classes/VercelBlobStorage.ts +64 -0
- package/apps/agents-server/src/utils/cdn/interfaces/IFilesStorage.ts +32 -0
- package/apps/agents-server/src/utils/cdn/interfaces/IStorage.ts +14 -0
- package/apps/agents-server/src/utils/cdn/utils/getUserFileCdnKey.ts +28 -0
- package/apps/agents-server/src/utils/cdn/utils/nameToSubfolderPath.ts +9 -0
- package/apps/agents-server/src/utils/cdn/utils/nextRequestToNodeRequest.ts +27 -0
- package/apps/agents-server/src/utils/chatFeedbackAdmin.ts +96 -0
- package/apps/agents-server/src/utils/chatHistoryAdmin.ts +96 -0
- package/apps/agents-server/src/utils/convertToCsv.ts +31 -0
- package/apps/agents-server/src/utils/getCurrentUser.ts +32 -0
- package/apps/agents-server/src/utils/getEffectiveFederatedServers.ts +22 -0
- package/apps/agents-server/src/utils/getFederatedAgents.ts +89 -0
- package/apps/agents-server/src/utils/getFederatedServersFromMetadata.ts +10 -0
- package/apps/agents-server/src/utils/getVisibleCommitmentDefinitions.ts +12 -0
- package/apps/agents-server/src/utils/handleChatCompletion.ts +355 -0
- package/apps/agents-server/src/utils/isIpAllowed.ts +101 -0
- package/apps/agents-server/src/utils/isUserAdmin.ts +31 -0
- package/apps/agents-server/src/utils/resolveInheritedAgentSource.ts +100 -0
- package/apps/agents-server/src/utils/session.ts +50 -0
- package/apps/agents-server/src/utils/validateApiKey.ts +128 -0
- package/apps/agents-server/src/utils/validators/validateMimeType.ts +24 -0
- package/apps/agents-server/tailwind.config.ts +26 -0
- package/apps/agents-server/tsconfig.json +29 -0
- package/apps/agents-server/vercel.json +7 -0
- package/esm/index.es.js +5406 -443
- package/esm/index.es.js.map +1 -1
- package/esm/typings/books/index.d.ts +0 -81
- package/esm/typings/servers.d.ts +9 -7
- package/esm/typings/src/_packages/browser.index.d.ts +6 -0
- package/esm/typings/src/_packages/cli.index.d.ts +4 -0
- package/esm/typings/src/_packages/components.index.d.ts +22 -8
- package/esm/typings/src/_packages/core.index.d.ts +58 -18
- package/esm/typings/src/_packages/node.index.d.ts +2 -2
- package/esm/typings/src/_packages/remote-server.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +70 -8
- package/esm/typings/src/_packages/utils.index.d.ts +6 -0
- package/esm/typings/src/_packages/wizard.index.d.ts +4 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +20 -5
- package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +17 -1
- package/esm/typings/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +3 -2
- package/esm/typings/src/book-2.0/agent-source/computeAgentHash.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +3 -3
- package/esm/typings/src/book-2.0/agent-source/createDefaultAgentName.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/normalizeAgentName.d.ts +9 -0
- package/esm/typings/src/book-2.0/agent-source/padBook.d.ts +18 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +1 -1
- package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +3 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +6 -1
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +85 -14
- package/esm/typings/src/book-components/BookEditor/BookEditorActionbar.d.ts +18 -0
- package/esm/typings/src/book-components/BookEditor/BookEditorMonaco.d.ts +5 -0
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +17 -0
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +13 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +16 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +5 -0
- package/esm/typings/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +15 -0
- package/esm/typings/src/book-components/Chat/MockedChat/MockedChat.d.ts +5 -0
- package/esm/typings/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +1 -0
- package/esm/typings/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +4 -0
- package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +52 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +14 -0
- package/esm/typings/src/book-components/Qr/BrandedQrCode.d.ts +18 -0
- package/esm/typings/src/book-components/Qr/GenericQrCode.d.ts +10 -0
- package/esm/typings/src/book-components/Qr/PromptbookQrCode.d.ts +18 -0
- package/esm/typings/src/book-components/Qr/useQrCode.d.ts +15 -0
- package/esm/typings/src/book-components/_common/Dropdown/Dropdown.d.ts +15 -0
- package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +12 -0
- package/esm/typings/src/book-components/_common/Modal/Modal.d.ts +2 -2
- package/esm/typings/src/book-components/_common/Tooltip/Tooltip.d.ts +47 -0
- package/esm/typings/src/book-components/icons/AboutIcon.d.ts +9 -0
- package/esm/typings/src/book-components/icons/CameraIcon.d.ts +11 -0
- package/esm/typings/src/book-components/icons/CloseIcon.d.ts +4 -8
- package/esm/typings/src/book-components/icons/DownloadIcon.d.ts +9 -0
- package/esm/typings/src/book-components/icons/ExitFullscreenIcon.d.ts +7 -0
- package/esm/typings/src/book-components/icons/FullscreenIcon.d.ts +7 -0
- package/esm/typings/src/book-components/icons/MenuIcon.d.ts +12 -0
- package/esm/typings/src/book-components/icons/MicIcon.d.ts +8 -0
- package/esm/typings/src/book-components/icons/SendIcon.d.ts +3 -0
- package/esm/typings/src/cli/cli-commands/_boilerplate.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/about.d.ts +3 -1
- package/esm/typings/src/cli/cli-commands/hello.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/list-models.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/login.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/make.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/run.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/{start-server.d.ts → start-agents-server.d.ts} +3 -2
- package/esm/typings/src/cli/cli-commands/start-pipelines-server.d.ts +15 -0
- package/esm/typings/src/cli/cli-commands/test-command.d.ts +2 -1
- package/esm/typings/src/cli/common/$addGlobalOptionsToCommand.d.ts +2 -1
- package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +12 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +75 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +10 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +154 -0
- package/esm/typings/src/collection/{PipelineCollection.d.ts → pipeline-collection/PipelineCollection.d.ts} +7 -3
- package/esm/typings/src/collection/{SimplePipelineCollection.d.ts → pipeline-collection/SimplePipelineCollection.d.ts} +5 -5
- package/esm/typings/src/collection/{constructors/createCollectionFromDirectory.d.ts → pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts} +8 -11
- package/esm/typings/src/collection/pipeline-collection/constructors/createPipelineCollectionFromJson.d.ts +13 -0
- package/esm/typings/src/collection/{constructors/createCollectionFromPromise.d.ts → pipeline-collection/constructors/createPipelineCollectionFromPromise.d.ts} +6 -5
- package/esm/typings/src/collection/pipeline-collection/constructors/createPipelineCollectionFromPromise.test.d.ts +1 -0
- package/esm/typings/src/collection/{constructors/createCollectionFromUrl.d.ts → pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts} +3 -3
- package/esm/typings/src/collection/{constructors/createSubcollection.d.ts → pipeline-collection/constructors/createPipelineSubcollection.d.ts} +3 -3
- package/esm/typings/src/collection/pipeline-collection/pipelineCollectionToJson.d.ts +13 -0
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +4 -5
- package/esm/typings/src/{book-2.0/commitments → commitments}/ACTION/ACTION.d.ts +5 -1
- package/esm/typings/src/commitments/CLOSED/CLOSED.d.ts +39 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.test.d.ts +4 -0
- package/esm/typings/src/commitments/COMPONENT/COMPONENT.d.ts +28 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/DELETE/DELETE.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/FORMAT/FORMAT.d.ts +5 -1
- package/esm/typings/src/commitments/FROM/FROM.d.ts +34 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/GOAL/GOAL.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/KNOWLEDGE/KNOWLEDGE.d.ts +5 -5
- package/esm/typings/src/commitments/LANGUAGE/LANGUAGE.d.ts +35 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/MEMORY/MEMORY.d.ts +5 -1
- package/esm/typings/src/commitments/MESSAGE/AgentMessageCommitmentDefinition.d.ts +32 -0
- package/esm/typings/src/commitments/MESSAGE/InitialMessageCommitmentDefinition.d.ts +32 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/MESSAGE/MESSAGE.d.ts +5 -1
- package/esm/typings/src/commitments/MESSAGE/UserMessageCommitmentDefinition.d.ts +32 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/META/META.d.ts +5 -1
- package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +48 -0
- package/esm/typings/src/commitments/META_FONT/META_FONT.d.ts +42 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/META_IMAGE/META_IMAGE.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/META_LINK/META_LINK.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/MODEL/MODEL.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/NOTE/NOTE.d.ts +5 -1
- package/esm/typings/src/commitments/OPEN/OPEN.d.ts +35 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/PERSONA/PERSONA.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/RULE/RULE.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/SAMPLE/SAMPLE.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/SCENARIO/SCENARIO.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/STYLE/STYLE.d.ts +5 -1
- package/esm/typings/src/commitments/USE/USE.d.ts +53 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +42 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts +1 -0
- package/esm/typings/src/commitments/USE_MCP/USE_MCP.d.ts +37 -0
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +38 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BaseCommitmentDefinition.d.ts +14 -2
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/CommitmentDefinition.d.ts +6 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/NotYetImplementedCommitmentDefinition.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/createEmptyAgentModelRequirements.d.ts +1 -1
- package/esm/typings/src/commitments/index.d.ts +93 -0
- package/esm/typings/src/config.d.ts +24 -3
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +2 -0
- package/esm/typings/src/errors/0-index.d.ts +6 -0
- package/esm/typings/src/errors/DatabaseError.d.ts +12 -0
- package/esm/typings/src/errors/NotAllowed.d.ts +9 -0
- package/esm/typings/src/errors/WrappedError.d.ts +2 -2
- package/esm/typings/src/execution/AvailableModel.d.ts +1 -0
- package/esm/typings/src/execution/Executables.d.ts +3 -0
- package/esm/typings/src/execution/ExecutionTask.d.ts +12 -3
- package/esm/typings/src/execution/ExecutionTools.d.ts +5 -0
- package/esm/typings/src/execution/FilesystemTools.d.ts +1 -1
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +26 -2
- package/esm/typings/src/execution/PromptResult.d.ts +7 -1
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +5 -0
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +5 -0
- package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +5 -0
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +5 -0
- package/esm/typings/src/execution/utils/usage-constants.d.ts +4 -124
- package/esm/typings/src/execution/utils/validatePromptResult.d.ts +2 -0
- package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +2 -1
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +2 -1
- package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/assertUniqueModels.d.ts +12 -0
- package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +72 -0
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +26 -4
- package/esm/typings/src/llm-providers/agent/AgentOptions.d.ts +19 -0
- package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +17 -0
- package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +50 -0
- package/esm/typings/src/llm-providers/agent/RemoteAgentOptions.d.ts +11 -0
- package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +1 -19
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/ollama/OllamaExecutionTools.d.ts +4 -0
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +60 -2
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionToolsOptions.d.ts +7 -1
- package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +13 -1
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +4 -0
- package/esm/typings/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +6 -6
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.test.d.ts +4 -0
- package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +1 -1
- package/esm/typings/src/pipeline/validatePipelineString.d.ts +2 -0
- package/esm/typings/src/playground/permanent/_boilerplate.d.ts +5 -0
- package/esm/typings/src/playground/permanent/agent-with-browser-playground.d.ts +5 -0
- package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +1 -0
- package/esm/typings/src/remote-server/startAgentServer.d.ts +26 -0
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +4 -1
- package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +3 -8
- package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/markitdown/createMarkitdownScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/markitdown/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -9
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +1 -0
- package/esm/typings/src/storage/env-storage/$EnvStorage.d.ts +2 -1
- package/esm/typings/src/transpilers/_common/BookTranspiler.d.ts +33 -0
- package/esm/typings/src/transpilers/_common/BookTranspilerOptions.d.ts +18 -0
- package/esm/typings/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +15 -0
- package/esm/typings/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +16 -0
- package/esm/typings/src/transpilers/formatted-book-in-markdown/register.d.ts +15 -0
- package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.d.ts +16 -0
- package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.test.d.ts +1 -0
- package/esm/typings/src/transpilers/openai-sdk/playground/playground.d.ts +5 -0
- package/esm/typings/src/transpilers/openai-sdk/register.d.ts +15 -0
- package/esm/typings/src/types/LlmCall.d.ts +20 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +13 -1
- package/esm/typings/src/types/ModelVariant.d.ts +1 -1
- package/esm/typings/src/types/Prompt.d.ts +13 -1
- package/esm/typings/src/types/Updatable.d.ts +19 -0
- package/esm/typings/src/types/typeAliases.d.ts +38 -2
- package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
- package/esm/typings/src/utils/color/Color.d.ts +16 -1
- package/esm/typings/src/utils/color/Color.test.d.ts +1 -0
- package/esm/typings/src/utils/color/css-colors.d.ts +1 -0
- package/esm/typings/src/utils/color/internal-utils/checkChannelValue.d.ts +0 -3
- package/esm/typings/src/utils/color/operators/darken.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/grayscale.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/lighten.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/saturate.d.ts +1 -1
- package/esm/typings/src/utils/environment/$detectRuntimeEnvironment.d.ts +16 -0
- package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -2
- package/esm/typings/src/utils/execCommand/$execCommand.d.ts +2 -1
- package/esm/typings/src/utils/execCommand/$execCommands.d.ts +2 -1
- package/esm/typings/src/utils/files/$induceBookDownload.d.ts +13 -0
- package/esm/typings/src/utils/files/$induceFileDownload.d.ts +13 -0
- package/esm/typings/src/utils/files/ObjectUrl.d.ts +46 -0
- package/esm/typings/src/utils/files/listAllFiles.d.ts +2 -3
- package/esm/typings/src/utils/misc/aboutPromptbookInformation.d.ts +27 -0
- package/esm/typings/src/utils/misc/computeHash.d.ts +11 -0
- package/esm/typings/src/utils/misc/computeHash.test.d.ts +1 -0
- package/esm/typings/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +1 -0
- package/esm/typings/src/utils/misc/xAboutPromptbookInformation.d.ts +13 -0
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -0
- package/esm/typings/src/utils/normalization/normalizeMessageText.d.ts +9 -0
- package/esm/typings/src/utils/normalization/normalizeMessageText.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +3 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -0
- package/esm/typings/src/utils/normalization/titleToName.d.ts +2 -0
- package/esm/typings/src/utils/organization/$sideEffect.d.ts +2 -2
- package/esm/typings/src/utils/organization/$side_effect.d.ts +7 -0
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +2 -2
- package/esm/typings/src/utils/organization/keepUnused.d.ts +2 -2
- package/esm/typings/src/utils/organization/preserve.d.ts +3 -3
- package/esm/typings/src/utils/organization/really_any.d.ts +7 -0
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +31 -0
- package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +9 -0
- package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +13 -0
- package/esm/typings/src/utils/random/$randomItem.d.ts +9 -0
- package/esm/typings/src/utils/random/$randomSeed.d.ts +3 -0
- package/esm/typings/src/utils/random/$randomToken.d.ts +2 -0
- package/esm/typings/src/utils/random/CzechNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/EnglishNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/NamePool.d.ts +17 -0
- package/esm/typings/src/utils/random/getNamePool.d.ts +10 -0
- package/esm/typings/src/utils/serialization/$deepFreeze.d.ts +2 -1
- package/esm/typings/src/utils/serialization/asSerializable.d.ts +2 -2
- package/esm/typings/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -2
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +2 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/esm/typings/src/wizard/$getCompiledBook.d.ts +1 -2
- package/package.json +16 -16
- package/umd/index.umd.js +5382 -417
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/book-2.0/commitments/index.d.ts +0 -60
- package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +0 -5
- package/esm/typings/src/book-components/BookEditor/BookEditorWrapper.d.ts +0 -9
- package/esm/typings/src/book-components/BookEditor/config.d.ts +0 -10
- package/esm/typings/src/book-components/Chat/utils/renderMarkdown.d.ts +0 -21
- package/esm/typings/src/collection/collectionToJson.d.ts +0 -13
- package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +0 -13
- /package/esm/typings/src/{book-components/Chat/utils/renderMarkdown.test.d.ts → book-2.0/agent-source/computeAgentHash.test.d.ts} +0 -0
- /package/esm/typings/src/{collection/constructors/createCollectionFromDirectory.test.d.ts → book-2.0/agent-source/normalizeAgentName.test.d.ts} +0 -0
- /package/esm/typings/src/{collection/constructors/createCollectionFromJson.test.d.ts → book-components/Chat/AgentChat/AgentChat.test.d.ts} +0 -0
- /package/esm/typings/src/collection/{constructors/createCollectionFromPromise.test.d.ts → pipeline-collection/constructors/createPipelineCollectionFromDirectory.test.d.ts} +0 -0
- /package/esm/typings/src/{commands/_common/parseCommand.test.d.ts → collection/pipeline-collection/constructors/createPipelineCollectionFromJson.test.d.ts} +0 -0
- /package/esm/typings/src/collection/{collectionToJson.test.d.ts → pipeline-collection/pipelineCollectionToJson.test.d.ts} +0 -0
- /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BookCommitment.d.ts +0 -0
- /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/ParsedCommitment.d.ts +0 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
@import 'tailwindcss/base';
|
|
2
|
+
@import 'tailwindcss/components';
|
|
3
|
+
@import 'tailwindcss/utilities';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* OpenMoji black and white CSS
|
|
7
|
+
*
|
|
8
|
+
* https://github.com/hfg-gmuend/openmoji/blob/master/font/OpenMoji-black-glyf/openmoji.css
|
|
9
|
+
*/
|
|
10
|
+
@font-face {
|
|
11
|
+
font-family: 'OpenMojiBlack';
|
|
12
|
+
src: url('/fonts/OpenMoji-black-glyf.woff2') format('woff2');
|
|
13
|
+
unicode-range: U+23, U+2A, U+2D, U+30-39, U+A9, U+AE, U+200D, U+203C, U+2049, U+20E3, U+2117, U+2120, U+2122,
|
|
14
|
+
U+2139, U+2194-2199, U+21A9, U+21AA, U+229C, U+231A, U+231B, U+2328, U+23CF, U+23E9-23F3, U+23F8-23FE, U+24C2,
|
|
15
|
+
U+25A1, U+25AA-25AE, U+25B6, U+25C0, U+25C9, U+25D0, U+25D1, U+25E7-25EA, U+25ED, U+25EE, U+25FB-25FE,
|
|
16
|
+
U+2600-2605, U+260E, U+2611, U+2614, U+2615, U+2618, U+261D, U+2620, U+2622, U+2623, U+2626, U+262A, U+262E,
|
|
17
|
+
U+262F, U+2638-263A, U+2640, U+2642, U+2648-2653, U+265F, U+2660, U+2663, U+2665, U+2666, U+2668, U+267B,
|
|
18
|
+
U+267E, U+267F, U+2691-2697, U+2699, U+269B, U+269C, U+26A0, U+26A1, U+26A7, U+26AA, U+26AB, U+26B0, U+26B1,
|
|
19
|
+
U+26BD, U+26BE, U+26C4, U+26C5, U+26C8, U+26CE, U+26CF, U+26D1, U+26D3, U+26D4, U+26E9, U+26EA, U+26F0-26F5,
|
|
20
|
+
U+26F7-26FA, U+26FD, U+2702, U+2705, U+2708-270D, U+270F, U+2712, U+2714, U+2716, U+271D, U+2721, U+2728,
|
|
21
|
+
U+2733, U+2734, U+2744, U+2747, U+274C, U+274E, U+2753-2755, U+2757, U+2763, U+2764, U+2795-2797, U+27A1,
|
|
22
|
+
U+27B0, U+27BF, U+2934, U+2935, U+2B05-2B07, U+2B0C, U+2B0D, U+2B1B, U+2B1C, U+2B1F-2B24, U+2B2E, U+2B2F,
|
|
23
|
+
U+2B50, U+2B55, U+2B58, U+2B8F, U+2BBA-2BBC, U+2BC3, U+2BC4, U+2BEA, U+2BEB, U+3030, U+303D, U+3297, U+3299,
|
|
24
|
+
U+E000-E009, U+E010, U+E011, U+E040-E06D, U+E080-E0B4, U+E0C0-E0CC, U+E0FF-E10D, U+E140-E14A, U+E150-E157,
|
|
25
|
+
U+E181-E189, U+E1C0-E1C4, U+E1C6-E1D9, U+E200-E216, U+E240-E269, U+E280-E283, U+E2C0-E2C4, U+E2C6-E2DA,
|
|
26
|
+
U+E300-E303, U+E305-E30F, U+E312-E316, U+E318-E322, U+E324-E329, U+E32B, U+E340-E348, U+E380, U+E381, U+F000,
|
|
27
|
+
U+F77A, U+F8FF, U+FE0F, U+1F004, U+1F0CF, U+1F10D-1F10F, U+1F12F, U+1F16D-1F171, U+1F17E, U+1F17F, U+1F18E,
|
|
28
|
+
U+1F191-1F19A, U+1F1E6-1F1FF, U+1F201, U+1F202, U+1F21A, U+1F22F, U+1F232-1F23A, U+1F250, U+1F251,
|
|
29
|
+
U+1F260-1F265, U+1F300-1F321, U+1F324-1F393, U+1F396, U+1F397, U+1F399-1F39B, U+1F39E-1F3F0, U+1F3F3-1F3F5,
|
|
30
|
+
U+1F3F7-1F4FD, U+1F4FF-1F53D, U+1F549-1F54E, U+1F550-1F567, U+1F56F, U+1F570, U+1F573-1F57A, U+1F587,
|
|
31
|
+
U+1F58A-1F58D, U+1F590, U+1F595, U+1F596, U+1F5A4, U+1F5A5, U+1F5A8, U+1F5B1, U+1F5B2, U+1F5BC, U+1F5C2-1F5C4,
|
|
32
|
+
U+1F5D1-1F5D3, U+1F5DC-1F5DE, U+1F5E1, U+1F5E3, U+1F5E8, U+1F5EF, U+1F5F3, U+1F5FA-1F64F, U+1F680-1F6C5,
|
|
33
|
+
U+1F6CB-1F6D2, U+1F6D5-1F6D7, U+1F6DC-1F6E5, U+1F6E9, U+1F6EB, U+1F6EC, U+1F6F0, U+1F6F3-1F6FC, U+1F7E0-1F7EB,
|
|
34
|
+
U+1F7F0, U+1F90C-1F93A, U+1F93C-1F945, U+1F947-1F9FF, U+1FA70-1FA7C, U+1FA80-1FA88, U+1FA90-1FABD,
|
|
35
|
+
U+1FABF-1FAC5, U+1FACE-1FADB, U+1FAE0-1FAE8, U+1FAF0-1FAF8, U+1FBC5-1FBC9, U+E0061-E0067, U+E0069,
|
|
36
|
+
U+E006C-E0079, U+E007F;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:root {
|
|
40
|
+
--background: #ffffff;
|
|
41
|
+
--foreground: #171717;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media (prefers-color-scheme: dark) {
|
|
45
|
+
:root {
|
|
46
|
+
--background: #0a0a0a;
|
|
47
|
+
--foreground: #ededed;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body {
|
|
52
|
+
background: var(--background);
|
|
53
|
+
color: var(--foreground);
|
|
54
|
+
font-family: var(--font-barlow-condensed), 'OpenMojiBlack', Arial, Helvetica, sans-serif;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Poppins font for agent names and headings */
|
|
58
|
+
.font-poppins {
|
|
59
|
+
font-family: var(--font-poppins), 'Poppins', system-ui, -apple-system, sans-serif;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Custom utilities */
|
|
63
|
+
.line-clamp-2 {
|
|
64
|
+
display: -webkit-box;
|
|
65
|
+
-webkit-line-clamp: 2;
|
|
66
|
+
line-clamp: 2;
|
|
67
|
+
-webkit-box-orient: vertical;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.line-clamp-3 {
|
|
72
|
+
display: -webkit-box;
|
|
73
|
+
-webkit-line-clamp: 3;
|
|
74
|
+
line-clamp: 3;
|
|
75
|
+
-webkit-box-orient: vertical;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Mermaid diagram styling */
|
|
80
|
+
.mermaid-container {
|
|
81
|
+
display: flex;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
align-items: center;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.mermaid-container svg {
|
|
87
|
+
max-width: 100%;
|
|
88
|
+
height: auto;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Code block styling */
|
|
92
|
+
pre code {
|
|
93
|
+
font-family: var(--font-mono), 'Courier New', monospace;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Smooth transitions */
|
|
97
|
+
* {
|
|
98
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow,
|
|
99
|
+
transform, filter, backdrop-filter;
|
|
100
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
101
|
+
transition-duration: 150ms;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Focus styles */
|
|
105
|
+
button:focus-visible,
|
|
106
|
+
a:focus-visible,
|
|
107
|
+
input:focus-visible,
|
|
108
|
+
textarea:focus-visible {
|
|
109
|
+
outline: 2px solid #3b82f6;
|
|
110
|
+
outline-offset: 2px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Custom scrollbar */
|
|
114
|
+
::-webkit-scrollbar {
|
|
115
|
+
width: 8px;
|
|
116
|
+
height: 8px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
::-webkit-scrollbar-track {
|
|
120
|
+
background: #f1f5f9;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
::-webkit-scrollbar-thumb {
|
|
124
|
+
background: #cbd5e1;
|
|
125
|
+
border-radius: 4px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
::-webkit-scrollbar-thumb:hover {
|
|
129
|
+
background: #94a3b8;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Loading animation */
|
|
133
|
+
@keyframes spin {
|
|
134
|
+
to {
|
|
135
|
+
transform: rotate(360deg);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.animate-spin {
|
|
140
|
+
animation: spin 1s linear infinite;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Tailwind CSS animation utilities */
|
|
144
|
+
@keyframes fade-in {
|
|
145
|
+
from {
|
|
146
|
+
opacity: 0;
|
|
147
|
+
}
|
|
148
|
+
to {
|
|
149
|
+
opacity: 1;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@keyframes slide-in-from-top-2 {
|
|
154
|
+
from {
|
|
155
|
+
transform: translateY(-0.5rem);
|
|
156
|
+
}
|
|
157
|
+
to {
|
|
158
|
+
transform: translateY(0);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@keyframes zoom-in-95 {
|
|
163
|
+
from {
|
|
164
|
+
opacity: 0;
|
|
165
|
+
transform: scale(0.95);
|
|
166
|
+
}
|
|
167
|
+
to {
|
|
168
|
+
opacity: 1;
|
|
169
|
+
transform: scale(1);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.animate-in {
|
|
174
|
+
animation-duration: 200ms;
|
|
175
|
+
animation-fill-mode: both;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.fade-in {
|
|
179
|
+
animation-name: fade-in;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.slide-in-from-top-2 {
|
|
183
|
+
animation-name: slide-in-from-top-2;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.zoom-in-95 {
|
|
187
|
+
animation-name: zoom-in-95;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* Gradient backgrounds */
|
|
191
|
+
.bg-gradient-to-br {
|
|
192
|
+
background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* Component preview container */
|
|
196
|
+
.component-preview {
|
|
197
|
+
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
|
|
198
|
+
border: 1px solid #e2e8f0;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* Print styles */
|
|
202
|
+
@media print {
|
|
203
|
+
@page {
|
|
204
|
+
margin: 2cm;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* Hide UI elements */
|
|
208
|
+
header,
|
|
209
|
+
footer,
|
|
210
|
+
nav,
|
|
211
|
+
aside,
|
|
212
|
+
button:not(.print:block),
|
|
213
|
+
.no-print,
|
|
214
|
+
[role="complementary"],
|
|
215
|
+
#portal-root {
|
|
216
|
+
display: none !important;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* Reset layout */
|
|
220
|
+
body,
|
|
221
|
+
main {
|
|
222
|
+
padding: 0 !important;
|
|
223
|
+
margin: 0 !important;
|
|
224
|
+
background: white !important;
|
|
225
|
+
min-height: auto !important;
|
|
226
|
+
width: 100% !important;
|
|
227
|
+
color: black !important;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* Remove shadows and backgrounds for clean print */
|
|
231
|
+
* {
|
|
232
|
+
box-shadow: none !important;
|
|
233
|
+
text-shadow: none !important;
|
|
234
|
+
background-color: transparent !important;
|
|
235
|
+
background-image: none !important;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* Ensure text visibility */
|
|
239
|
+
h1, h2, h3, h4, h5, h6, p, li, span, div {
|
|
240
|
+
color: black !important;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* Links */
|
|
244
|
+
a {
|
|
245
|
+
text-decoration: underline;
|
|
246
|
+
color: black !important;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/* Preserve borders */
|
|
250
|
+
.border, .border-b, .border-t, .border-l, .border-r {
|
|
251
|
+
border-color: #ddd !important;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* Page break control */
|
|
255
|
+
h1, h2 {
|
|
256
|
+
break-after: avoid;
|
|
257
|
+
page-break-after: avoid;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
p, li, pre, code {
|
|
261
|
+
break-inside: avoid;
|
|
262
|
+
page-break-inside: avoid;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* Specific component overrides */
|
|
266
|
+
.card, .bg-white {
|
|
267
|
+
border: none !important;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* Code blocks */
|
|
271
|
+
pre, code {
|
|
272
|
+
background-color: #f5f5f5 !important;
|
|
273
|
+
border: 1px solid #ddd !important;
|
|
274
|
+
white-space: pre-wrap !important;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Dynamic humans.txt for Agents Server
|
|
2
|
+
|
|
3
|
+
import { generateHumansTxt } from '@/src/components/_utils/generateMetaTxt';
|
|
4
|
+
import { NextResponse } from 'next/server';
|
|
5
|
+
|
|
6
|
+
export const dynamic = 'force-dynamic';
|
|
7
|
+
|
|
8
|
+
export async function GET() {
|
|
9
|
+
const txt = generateHumansTxt();
|
|
10
|
+
return new NextResponse(txt, {
|
|
11
|
+
headers: {
|
|
12
|
+
'Content-Type': 'text/plain',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import faviconLogoImage from '@/public/favicon.ico';
|
|
2
|
+
import { LayoutWrapper } from '@/src/components/LayoutWrapper/LayoutWrapper';
|
|
3
|
+
import type { Metadata } from 'next';
|
|
4
|
+
import { Barlow_Condensed, Poppins } from 'next/font/google';
|
|
5
|
+
import { getMetadata } from '../database/getMetadata';
|
|
6
|
+
import { $provideAgentCollectionForServer } from '../tools/$provideAgentCollectionForServer';
|
|
7
|
+
import { $provideServer } from '../tools/$provideServer';
|
|
8
|
+
import { getCurrentUser } from '../utils/getCurrentUser';
|
|
9
|
+
import { isUserAdmin } from '../utils/isUserAdmin';
|
|
10
|
+
import { getFederatedServersFromMetadata } from '../utils/getFederatedServersFromMetadata';
|
|
11
|
+
import './globals.css';
|
|
12
|
+
|
|
13
|
+
const barlowCondensed = Barlow_Condensed({
|
|
14
|
+
subsets: ['latin'],
|
|
15
|
+
weight: ['300', '400', '500', '600', '700'],
|
|
16
|
+
variable: '--font-barlow-condensed',
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const poppins = Poppins({
|
|
20
|
+
subsets: ['latin'],
|
|
21
|
+
weight: ['400', '500', '600', '700', '800'],
|
|
22
|
+
variable: '--font-poppins',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export async function generateMetadata(): Promise<Metadata> {
|
|
26
|
+
const { publicUrl } = await $provideServer();
|
|
27
|
+
const serverName = (await getMetadata('SERVER_NAME')) || 'Promptbook Agents Server';
|
|
28
|
+
const serverDescription = (await getMetadata('SERVER_DESCRIPTION')) || 'Agents server powered by Promptbook';
|
|
29
|
+
const serverFaviconUrl = (await getMetadata('SERVER_FAVICON_URL')) || faviconLogoImage.src;
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
title: serverName,
|
|
33
|
+
description: serverDescription,
|
|
34
|
+
// TODO: keywords: ['@@@'],
|
|
35
|
+
authors: [{ name: 'Promptbook Team' }],
|
|
36
|
+
icons: {
|
|
37
|
+
icon: serverFaviconUrl,
|
|
38
|
+
shortcut: serverFaviconUrl,
|
|
39
|
+
apple: serverFaviconUrl,
|
|
40
|
+
},
|
|
41
|
+
openGraph: {
|
|
42
|
+
title: serverName,
|
|
43
|
+
description: serverDescription,
|
|
44
|
+
type: 'website',
|
|
45
|
+
images: [
|
|
46
|
+
/*
|
|
47
|
+
TODO:
|
|
48
|
+
{
|
|
49
|
+
url: 'https://www.ptbk.io/design',
|
|
50
|
+
width: 1200,
|
|
51
|
+
height: 630,
|
|
52
|
+
alt: 'Promptbook agents server',
|
|
53
|
+
},
|
|
54
|
+
*/
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
twitter: {
|
|
58
|
+
card: 'summary_large_image',
|
|
59
|
+
title: serverName,
|
|
60
|
+
description: serverDescription,
|
|
61
|
+
// TODO: images: ['https://www.ptbk.io/design'],
|
|
62
|
+
},
|
|
63
|
+
metadataBase: publicUrl,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default async function RootLayout({
|
|
68
|
+
children,
|
|
69
|
+
}: Readonly<{
|
|
70
|
+
children: React.ReactNode;
|
|
71
|
+
}>) {
|
|
72
|
+
const isAdmin = await isUserAdmin();
|
|
73
|
+
const currentUser = await getCurrentUser();
|
|
74
|
+
const serverName = (await getMetadata('SERVER_NAME')) || 'Promptbook Agents Server';
|
|
75
|
+
const serverLogoUrl = (await getMetadata('SERVER_LOGO_URL')) || null;
|
|
76
|
+
const isFooterShown = ((await getMetadata('IS_FOOTER_SHOWN')) || 'true') === 'true';
|
|
77
|
+
|
|
78
|
+
let footerLinks = [];
|
|
79
|
+
try {
|
|
80
|
+
const footerLinksString = (await getMetadata('FOOTER_LINKS')) || '[]';
|
|
81
|
+
footerLinks = JSON.parse(footerLinksString);
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error('Failed to parse FOOTER_LINKS', error);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Fetch federated servers and add to footerLinks
|
|
87
|
+
let federatedServers: Array<{ url: string; title: string; logoUrl: string | null }> = [];
|
|
88
|
+
try {
|
|
89
|
+
const federatedServersRaw = await getFederatedServersFromMetadata();
|
|
90
|
+
federatedServers = await Promise.all(
|
|
91
|
+
federatedServersRaw.map(async (url: string) => {
|
|
92
|
+
let logoUrl: string | null = null;
|
|
93
|
+
try {
|
|
94
|
+
// Try to fetch logo from metadata endpoint if available
|
|
95
|
+
const res = await fetch(`${url}/api/metadata`);
|
|
96
|
+
if (res.ok) {
|
|
97
|
+
const meta = await res.json();
|
|
98
|
+
logoUrl = meta.SERVER_LOGO_URL || null;
|
|
99
|
+
}
|
|
100
|
+
} catch {
|
|
101
|
+
logoUrl = null;
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
title: `Federated: ${new URL(url).hostname}`,
|
|
105
|
+
url,
|
|
106
|
+
logoUrl,
|
|
107
|
+
};
|
|
108
|
+
})
|
|
109
|
+
);
|
|
110
|
+
footerLinks = [...footerLinks, ...federatedServers];
|
|
111
|
+
} catch (error) {
|
|
112
|
+
console.error('Failed to fetch federated servers for footer', error);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const collection = await $provideAgentCollectionForServer();
|
|
116
|
+
const agents = await collection.listAgents();
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<html lang="en">
|
|
120
|
+
{/* Note: Icon is set via metadata to allow agent-page specific icons to override it */}
|
|
121
|
+
<body className={`${barlowCondensed.variable} ${poppins.variable} antialiased bg-white text-gray-900`}>
|
|
122
|
+
<LayoutWrapper
|
|
123
|
+
isAdmin={isAdmin}
|
|
124
|
+
currentUser={currentUser}
|
|
125
|
+
serverName={serverName}
|
|
126
|
+
serverLogoUrl={serverLogoUrl}
|
|
127
|
+
agents={JSON.parse(JSON.stringify(agents))}
|
|
128
|
+
isFooterShown={isFooterShown}
|
|
129
|
+
footerLinks={footerLinks}
|
|
130
|
+
federatedServers={federatedServers}
|
|
131
|
+
>
|
|
132
|
+
{children}
|
|
133
|
+
</LayoutWrapper>
|
|
134
|
+
{/* Global portal root for modals/popups */}
|
|
135
|
+
<div id="portal-root" />
|
|
136
|
+
</body>
|
|
137
|
+
</html>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { PROMPTBOOK_COLOR } from '@promptbook-local/core';
|
|
2
|
+
import { MetadataRoute } from 'next';
|
|
3
|
+
import { headers } from 'next/headers';
|
|
4
|
+
import { Color } from '../../../../src/utils/color/Color';
|
|
5
|
+
import { getMetadata } from '../database/getMetadata';
|
|
6
|
+
import { $provideServer } from '../tools/$provideServer';
|
|
7
|
+
import { getAgentProfile } from './agents/[agentName]/_utils';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Manifest for PWA Progressive Web App
|
|
11
|
+
*/
|
|
12
|
+
export default async function manifest(): Promise<MetadataRoute.Manifest> {
|
|
13
|
+
const { publicUrl } = await $provideServer();
|
|
14
|
+
const serverName = (await getMetadata('SERVER_NAME')) || 'Promptbook Agents Server';
|
|
15
|
+
const serverDescription = (await getMetadata('SERVER_DESCRIPTION')) || 'Agents server powered by Promptbook';
|
|
16
|
+
|
|
17
|
+
const referer = (await headers()).get('referer') || '';
|
|
18
|
+
const isAgentManifest = referer.includes('/agents/');
|
|
19
|
+
|
|
20
|
+
if (!isAgentManifest) {
|
|
21
|
+
return {
|
|
22
|
+
name: serverName,
|
|
23
|
+
short_name: serverName,
|
|
24
|
+
description: serverDescription,
|
|
25
|
+
start_url: publicUrl.href + '?utm_source=pwa&utm_medium=install&utm_campaign=agents_server_app',
|
|
26
|
+
display_override: ['fullscreen', 'minimal-ui'],
|
|
27
|
+
display: 'standalone',
|
|
28
|
+
background_color: PROMPTBOOK_COLOR.toHex(),
|
|
29
|
+
theme_color: PROMPTBOOK_COLOR.toHex(),
|
|
30
|
+
icons: [
|
|
31
|
+
// TODO: Create icons for the server homepage
|
|
32
|
+
],
|
|
33
|
+
scope: publicUrl.href,
|
|
34
|
+
} satisfies MetadataRoute.Manifest;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const agentName = decodeURIComponent(referer.split('/agents/')[1]?.split('/')[0]);
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
const agentProfile = await getAgentProfile(agentName);
|
|
41
|
+
|
|
42
|
+
const name = agentProfile.meta.fullname || agentProfile.agentName;
|
|
43
|
+
const short_name = agentProfile.agentName;
|
|
44
|
+
const description = agentProfile.meta.description || agentProfile.personaDescription || `Agent ${name}`;
|
|
45
|
+
|
|
46
|
+
// Extract brand color from meta
|
|
47
|
+
const brandColor = Color.fromSafe(agentProfile.meta.color || PROMPTBOOK_COLOR);
|
|
48
|
+
const theme_color = brandColor.toHex();
|
|
49
|
+
const background_color = '#ffffff';
|
|
50
|
+
|
|
51
|
+
const agentUrl = `${publicUrl.href}agents/${encodeURIComponent(agentName)}`;
|
|
52
|
+
|
|
53
|
+
const icons: MetadataRoute.Manifest['icons'] = [
|
|
54
|
+
{
|
|
55
|
+
src: `${agentUrl}/images/icon-256.png`,
|
|
56
|
+
sizes: '256x256',
|
|
57
|
+
type: 'image/png',
|
|
58
|
+
purpose: 'any',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
src: `${agentUrl}/images/icon-256.png`,
|
|
62
|
+
sizes: '256x256',
|
|
63
|
+
type: 'image/png',
|
|
64
|
+
purpose: 'maskable',
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
const screenshots: MetadataRoute.Manifest['screenshots'] = [
|
|
69
|
+
{
|
|
70
|
+
src: `${agentUrl}/images/screenshot-fullhd.png`,
|
|
71
|
+
sizes: '1920x1080',
|
|
72
|
+
type: 'image/png',
|
|
73
|
+
form_factor: 'wide',
|
|
74
|
+
label: 'Full HD Screenshot',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
src: `${agentUrl}/images/screenshot-phone.png`,
|
|
78
|
+
sizes: '1080x1920',
|
|
79
|
+
type: 'image/png',
|
|
80
|
+
form_factor: 'narrow',
|
|
81
|
+
label: 'Phone Screenshot',
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
id: agentUrl,
|
|
87
|
+
name,
|
|
88
|
+
short_name,
|
|
89
|
+
description,
|
|
90
|
+
start_url: `${agentUrl}?headless&utm_source=pwa&utm_medium=install&utm_campaign=agent_app`,
|
|
91
|
+
scope: agentUrl,
|
|
92
|
+
display_override: ['fullscreen', 'minimal-ui'],
|
|
93
|
+
display: 'standalone',
|
|
94
|
+
background_color,
|
|
95
|
+
theme_color,
|
|
96
|
+
icons,
|
|
97
|
+
screenshots,
|
|
98
|
+
} satisfies MetadataRoute.Manifest;
|
|
99
|
+
} catch (error) {
|
|
100
|
+
console.warn(`Failed to generate manifest for agent ${agentName}`, error);
|
|
101
|
+
return {
|
|
102
|
+
name: agentName,
|
|
103
|
+
short_name: agentName,
|
|
104
|
+
start_url: `${publicUrl.href}agents/${encodeURIComponent(
|
|
105
|
+
agentName,
|
|
106
|
+
)}?headless&utm_source=pwa&utm_medium=install&utm_campaign=agent_app`,
|
|
107
|
+
display_override: ['fullscreen', 'minimal-ui'],
|
|
108
|
+
display: 'standalone',
|
|
109
|
+
background_color: '#ffffff',
|
|
110
|
+
theme_color: PROMPTBOOK_COLOR.toHex(),
|
|
111
|
+
icons: [],
|
|
112
|
+
} satisfies MetadataRoute.Manifest;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
import { getSingleLlmExecutionTools } from '@promptbook-local/core';
|
|
4
|
+
import moment from 'moment';
|
|
5
|
+
import { headers } from 'next/headers';
|
|
6
|
+
import { AboutPromptbookInformation } from '../../../../src/utils/misc/xAboutPromptbookInformation';
|
|
7
|
+
import { $sideEffect } from '../../../../src/utils/organization/$sideEffect';
|
|
8
|
+
import { AgentsList } from '../components/Homepage/AgentsList';
|
|
9
|
+
import { ExternalAgentsSectionClient } from '../components/Homepage/ExternalAgentsSectionClient';
|
|
10
|
+
import { ModelsSection } from '../components/Homepage/ModelsSection';
|
|
11
|
+
import { Section } from '../components/Homepage/Section';
|
|
12
|
+
import { TechInfoCard } from '../components/Homepage/TechInfoCard';
|
|
13
|
+
import { UsersList } from '../components/UsersList/UsersList';
|
|
14
|
+
import VercelDeploymentCard from '../components/VercelDeploymentCard/VercelDeploymentCard';
|
|
15
|
+
import { getLongRunningTask } from '../deamons/longRunningTask';
|
|
16
|
+
import { $provideAgentCollectionForServer } from '../tools/$provideAgentCollectionForServer';
|
|
17
|
+
import { $provideExecutionToolsForServer } from '../tools/$provideExecutionToolsForServer';
|
|
18
|
+
import { $provideServer } from '../tools/$provideServer';
|
|
19
|
+
import { isUserAdmin } from '../utils/isUserAdmin';
|
|
20
|
+
|
|
21
|
+
// Add calendar formats that include seconds
|
|
22
|
+
const calendarWithSeconds = {
|
|
23
|
+
sameDay: '[Today at] LTS',
|
|
24
|
+
nextDay: '[Tomorrow at] LTS',
|
|
25
|
+
nextWeek: 'dddd [at] LTS',
|
|
26
|
+
lastDay: '[Yesterday at] LTS',
|
|
27
|
+
lastWeek: '[Last] dddd [at] LTS',
|
|
28
|
+
sameElse: 'L [at] LTS',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default async function HomePage() {
|
|
32
|
+
$sideEffect(/* Note: [🐶] This will ensure dynamic rendering of page and avoid Next.js pre-render */ headers());
|
|
33
|
+
|
|
34
|
+
const isAdmin = await isUserAdmin(); /* <- TODO: [👹] Here should be user permissions */
|
|
35
|
+
|
|
36
|
+
const collection = await $provideAgentCollectionForServer();
|
|
37
|
+
const agents = await collection.listAgents();
|
|
38
|
+
|
|
39
|
+
const longRunningTask = getLongRunningTask();
|
|
40
|
+
|
|
41
|
+
const executionTools = await $provideExecutionToolsForServer();
|
|
42
|
+
const models = await getSingleLlmExecutionTools(executionTools.llm).listModels();
|
|
43
|
+
|
|
44
|
+
const host = (await headers()).get('host') || 'unknown';
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div className="min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50">
|
|
48
|
+
<div className="container mx-auto px-4 py-16">
|
|
49
|
+
<AgentsList agents={[...agents]} isAdmin={isAdmin} />
|
|
50
|
+
|
|
51
|
+
<ExternalAgentsSectionClient />
|
|
52
|
+
|
|
53
|
+
{isAdmin && <UsersList allowCreate={false} />}
|
|
54
|
+
|
|
55
|
+
{isAdmin && (
|
|
56
|
+
<ModelsSection models={models} maxVisible={11} showViewAllLink />
|
|
57
|
+
)}
|
|
58
|
+
|
|
59
|
+
{isAdmin && (
|
|
60
|
+
<>
|
|
61
|
+
{/* Note: Shown in <AboutPromptbookInformation />: <h2 className="text-3xl text-gray-900 mt-16 mb-4">About Promptbook</h2> */}
|
|
62
|
+
<AboutPromptbookInformation />
|
|
63
|
+
</>
|
|
64
|
+
)}
|
|
65
|
+
|
|
66
|
+
{isAdmin && (
|
|
67
|
+
<Section title="Technical Information">
|
|
68
|
+
<TechInfoCard title={`Long running task ${longRunningTask.taskId}`}>
|
|
69
|
+
<p className="text-gray-600">Tick: {longRunningTask.tick}</p>
|
|
70
|
+
<p className="text-gray-600">
|
|
71
|
+
Created At: {moment(longRunningTask.createdAt).calendar(undefined, calendarWithSeconds)}
|
|
72
|
+
</p>
|
|
73
|
+
<p className="text-gray-600">
|
|
74
|
+
Updated At: {moment(longRunningTask.updatedAt).calendar(undefined, calendarWithSeconds)}
|
|
75
|
+
</p>
|
|
76
|
+
</TechInfoCard>
|
|
77
|
+
|
|
78
|
+
<VercelDeploymentCard />
|
|
79
|
+
|
|
80
|
+
<TechInfoCard title="HTTP Information">
|
|
81
|
+
<p className="text-gray-600">Host: {host}</p>
|
|
82
|
+
</TechInfoCard>
|
|
83
|
+
|
|
84
|
+
<TechInfoCard title="Server">
|
|
85
|
+
<pre>{JSON.stringify(await $provideServer(), null, 2)}</pre>
|
|
86
|
+
</TechInfoCard>
|
|
87
|
+
</Section>
|
|
88
|
+
)}
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* TODO: [🕋] Use here `AboutPromptbookInformation`
|
|
96
|
+
*/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { RefreshCcwIcon } from 'lucide-react';
|
|
4
|
+
import { useRouter } from 'next/navigation';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { restoreDeletedAgent } from './actions';
|
|
7
|
+
|
|
8
|
+
type RestoreAgentButtonProps = {
|
|
9
|
+
agentName: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function RestoreAgentButton({ agentName }: RestoreAgentButtonProps) {
|
|
13
|
+
const router = useRouter();
|
|
14
|
+
const [isRestoring, setIsRestoring] = useState(false);
|
|
15
|
+
|
|
16
|
+
const handleRestore = async () => {
|
|
17
|
+
try {
|
|
18
|
+
setIsRestoring(true);
|
|
19
|
+
await restoreDeletedAgent(agentName);
|
|
20
|
+
router.refresh();
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.error('Failed to restore agent:', error);
|
|
23
|
+
alert('Failed to restore agent');
|
|
24
|
+
} finally {
|
|
25
|
+
setIsRestoring(false);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<button
|
|
31
|
+
onClick={handleRestore}
|
|
32
|
+
disabled={isRestoring}
|
|
33
|
+
className="flex items-center gap-2 px-3 py-2 bg-white border border-gray-300 rounded hover:bg-gray-50 text-gray-700 disabled:opacity-50"
|
|
34
|
+
title="Restore agent"
|
|
35
|
+
>
|
|
36
|
+
<RefreshCcwIcon className={`w-4 h-4 ${isRestoring ? 'animate-spin' : ''}`} />
|
|
37
|
+
{isRestoring ? 'Restoring...' : 'Restore'}
|
|
38
|
+
</button>
|
|
39
|
+
);
|
|
40
|
+
}
|