@promptbook/cli 0.103.0-9 → 0.104.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 +59 -35
- 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 +72 -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 +67 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +23 -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,27 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
import { $provideAgentCollectionForServer } from '@/src/tools/$provideAgentCollectionForServer';
|
|
4
|
+
import { revalidatePath } from 'next/cache';
|
|
5
|
+
|
|
6
|
+
export async function restoreDeletedAgent(agentName: string) {
|
|
7
|
+
const collection = await $provideAgentCollectionForServer();
|
|
8
|
+
|
|
9
|
+
// Find the latest history item for this agent
|
|
10
|
+
const history = await collection.listAgentHistory(agentName);
|
|
11
|
+
|
|
12
|
+
if (history.length === 0) {
|
|
13
|
+
throw new Error(`No history found for agent ${agentName}`);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const latestVersion = history[0];
|
|
17
|
+
|
|
18
|
+
if (!latestVersion) {
|
|
19
|
+
throw new Error(`No history found for agent ${agentName}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
await collection.restoreAgent(latestVersion.id);
|
|
23
|
+
|
|
24
|
+
revalidatePath('/recycle-bin');
|
|
25
|
+
revalidatePath(`/agents/${agentName}`);
|
|
26
|
+
revalidatePath('/');
|
|
27
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { $provideAgentCollectionForServer } from '@/src/tools/$provideAgentCollectionForServer';
|
|
2
|
+
import { TrashIcon } from 'lucide-react';
|
|
3
|
+
import Link from 'next/link';
|
|
4
|
+
import { RestoreAgentButton } from './RestoreAgentButton';
|
|
5
|
+
|
|
6
|
+
export const metadata = {
|
|
7
|
+
title: 'Recycle Bin',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default async function RecycleBinPage() {
|
|
11
|
+
const collection = await $provideAgentCollectionForServer();
|
|
12
|
+
const deletedAgents = await collection.listDeletedAgents();
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className="container mx-auto p-6 max-w-4xl">
|
|
16
|
+
<header className="flex items-center gap-4 mb-8">
|
|
17
|
+
<div className="bg-red-100 p-3 rounded-full">
|
|
18
|
+
<TrashIcon className="w-8 h-8 text-red-600" />
|
|
19
|
+
</div>
|
|
20
|
+
<div>
|
|
21
|
+
<h1 className="text-3xl font-bold text-gray-900">Recycle Bin</h1>
|
|
22
|
+
<p className="text-gray-600">Restore deleted agents from here.</p>
|
|
23
|
+
</div>
|
|
24
|
+
</header>
|
|
25
|
+
|
|
26
|
+
{deletedAgents.length === 0 ? (
|
|
27
|
+
<div className="text-center py-12 bg-gray-50 rounded-lg border border-dashed border-gray-300">
|
|
28
|
+
<p className="text-gray-500 text-lg">Recycle bin is empty</p>
|
|
29
|
+
<Link href="/" className="text-blue-600 hover:underline mt-2 inline-block">
|
|
30
|
+
Go back to agents
|
|
31
|
+
</Link>
|
|
32
|
+
</div>
|
|
33
|
+
) : (
|
|
34
|
+
<div className="grid gap-4">
|
|
35
|
+
{deletedAgents.map((agentName) => (
|
|
36
|
+
<div
|
|
37
|
+
key={agentName}
|
|
38
|
+
className="bg-white p-4 rounded-lg shadow-sm border border-gray-200 flex items-center justify-between hover:shadow-md transition-shadow"
|
|
39
|
+
>
|
|
40
|
+
<div className="flex items-center gap-3">
|
|
41
|
+
<div className="w-10 h-10 bg-gray-100 rounded-full flex items-center justify-center text-gray-500 font-bold text-lg">
|
|
42
|
+
{agentName.charAt(0).toUpperCase()}
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
<h3 className="font-semibold text-lg text-gray-900">{agentName}</h3>
|
|
46
|
+
<p className="text-sm text-gray-500">Deleted agent</p>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div className="flex gap-2">
|
|
50
|
+
<RestoreAgentButton agentName={agentName} />
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
))}
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ShieldAlert } from 'lucide-react';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
|
|
4
|
+
export default function RestrictedPage() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="flex flex-col items-center justify-center min-h-[calc(100vh-4rem)] p-4 text-center">
|
|
7
|
+
<div className="bg-red-50 p-6 rounded-full mb-6">
|
|
8
|
+
<ShieldAlert className="w-12 h-12 text-red-600" />
|
|
9
|
+
</div>
|
|
10
|
+
<h1 className="text-2xl font-bold text-gray-900 mb-2">Access Restricted</h1>
|
|
11
|
+
<p className="text-gray-600 max-w-md mb-8">
|
|
12
|
+
This server is restricted to authorized users or specific IP addresses.
|
|
13
|
+
Please log in to continue or contact the administrator if you believe this is an error.
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
{/* The Login button in the header is available, so we can just point to it or instruct the user */}
|
|
17
|
+
<div className="p-4 bg-blue-50 text-blue-800 rounded-lg max-w-md text-sm">
|
|
18
|
+
<p>
|
|
19
|
+
<strong>Tip:</strong> Use the <strong>Log in</strong> button in the top right corner to access your account.
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div className="mt-8 flex gap-4">
|
|
24
|
+
<Link
|
|
25
|
+
href="/"
|
|
26
|
+
className="px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-md transition-colors"
|
|
27
|
+
>
|
|
28
|
+
Go Home
|
|
29
|
+
</Link>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Dynamic robots.txt for Agents Server
|
|
2
|
+
|
|
3
|
+
import { generateRobotsTxt } 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 = generateRobotsTxt();
|
|
10
|
+
return new NextResponse(txt, {
|
|
11
|
+
headers: {
|
|
12
|
+
'Content-Type': 'text/plain',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Dynamic security.txt for Agents Server
|
|
2
|
+
|
|
3
|
+
import { generateSecurityTxt } 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 = generateSecurityTxt();
|
|
10
|
+
return new NextResponse(txt, {
|
|
11
|
+
headers: {
|
|
12
|
+
'Content-Type': 'text/plain',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Dynamic sitemap.xml for Agents Server
|
|
2
|
+
|
|
3
|
+
import { NEXT_PUBLIC_SITE_URL } from '@/config';
|
|
4
|
+
import { $provideAgentCollectionForServer } from '@/src/tools/$provideAgentCollectionForServer';
|
|
5
|
+
import { spaceTrim } from '@promptbook-local/utils';
|
|
6
|
+
import { NextResponse } from 'next/server';
|
|
7
|
+
|
|
8
|
+
export const dynamic = 'force-dynamic';
|
|
9
|
+
|
|
10
|
+
export async function GET() {
|
|
11
|
+
const collection = await $provideAgentCollectionForServer();
|
|
12
|
+
|
|
13
|
+
// Assume collection.listAgents() returns an array of agent names
|
|
14
|
+
const agentNames = await collection.listAgents();
|
|
15
|
+
|
|
16
|
+
// Get base URL from environment or config
|
|
17
|
+
const baseUrl = NEXT_PUBLIC_SITE_URL?.href || process.env.PUBLIC_URL || 'https://ptbk.io';
|
|
18
|
+
|
|
19
|
+
const urls = agentNames
|
|
20
|
+
.map(({ agentName }) => `<url><loc>${baseUrl}agents/${encodeURIComponent(agentName)}</loc></url>`)
|
|
21
|
+
.join('\n');
|
|
22
|
+
|
|
23
|
+
const xml = spaceTrim(
|
|
24
|
+
(block) => `
|
|
25
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
26
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
27
|
+
${block(urls)}
|
|
28
|
+
</urlset>
|
|
29
|
+
`,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return new NextResponse(xml, {
|
|
33
|
+
headers: {
|
|
34
|
+
'Content-Type': 'application/xml',
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
In this folder we are testing miscellaneous things related to Promptbook Agents Server
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ImageResponse } from 'next/og';
|
|
2
|
+
|
|
3
|
+
export const runtime = 'edge';
|
|
4
|
+
|
|
5
|
+
export const alt = 'Agent Profile';
|
|
6
|
+
export const size = {
|
|
7
|
+
width: 1200,
|
|
8
|
+
height: 630,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const contentType = 'image/png';
|
|
12
|
+
|
|
13
|
+
export default async function Image() {
|
|
14
|
+
return new ImageResponse(
|
|
15
|
+
(
|
|
16
|
+
<div
|
|
17
|
+
style={{
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flexDirection: 'row',
|
|
20
|
+
width: '100%',
|
|
21
|
+
height: '100%',
|
|
22
|
+
backgroundColor: 'white',
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<h1>Hello</h1>
|
|
26
|
+
</div>
|
|
27
|
+
),
|
|
28
|
+
{
|
|
29
|
+
...size,
|
|
30
|
+
emoji: 'openmoji',
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* TODO: [webpack.cache.PackFileCacheStrategy] Serializing big strings (126kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)
|
|
37
|
+
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { NEXT_PUBLIC_SITE_URL } from '@/config';
|
|
2
|
+
import type { Metadata } from 'next';
|
|
3
|
+
|
|
4
|
+
export const metadata: Metadata = {
|
|
5
|
+
metadataBase: NEXT_PUBLIC_SITE_URL,
|
|
6
|
+
title: 'Test OG Image',
|
|
7
|
+
description: 'Testing og-image',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default function TestPage() {
|
|
11
|
+
return (
|
|
12
|
+
<div className="min-h-screen flex items-center justify-center bg-gray-100">
|
|
13
|
+
<div className="bg-white p-8 rounded-lg shadow-md max-w-md w-full">
|
|
14
|
+
<h1 className="text-3xl font-bold text-red-600 mb-4 text-center">Test page</h1>
|
|
15
|
+
<p className="text-gray-700 mb-6 text-center">Testing og-image</p>
|
|
16
|
+
<p className="text-gray-600 text-sm text-center mt-4">
|
|
17
|
+
View page source or share this URL to see the OG image in action
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { AgentBasicInformation } from '@promptbook-local/types';
|
|
4
|
+
import { RepeatIcon } from 'lucide-react';
|
|
5
|
+
import { useMemo, useState } from 'react';
|
|
6
|
+
import spaceTrim from 'spacetrim';
|
|
7
|
+
import { Color } from '../../../../../src/utils/color/Color';
|
|
8
|
+
import { darken } from '../../../../../src/utils/color/operators/darken';
|
|
9
|
+
import { lighten } from '../../../../../src/utils/color/operators/lighten';
|
|
10
|
+
import { AgentQrCode } from './AgentQrCode';
|
|
11
|
+
import { QrCodeModal } from './QrCodeModal';
|
|
12
|
+
|
|
13
|
+
type AgentProfileProps = {
|
|
14
|
+
/**
|
|
15
|
+
* The agent to display
|
|
16
|
+
*/
|
|
17
|
+
readonly agent: AgentBasicInformation;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* URL of the agent page
|
|
21
|
+
*
|
|
22
|
+
* @default undefined - If not provided, some features like QR code for link might be disabled or use generic link
|
|
23
|
+
*/
|
|
24
|
+
readonly agentUrl?: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Email of the agent
|
|
28
|
+
*/
|
|
29
|
+
readonly agentEmail?: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Content for the menu (top right)
|
|
33
|
+
*
|
|
34
|
+
* @param props.onShowQrCode - Function to open QR code modal
|
|
35
|
+
*/
|
|
36
|
+
readonly renderMenu?: (props: { onShowQrCode: () => void }) => React.ReactNode;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Content for the chat area
|
|
40
|
+
*/
|
|
41
|
+
readonly children?: React.ReactNode;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Content for the secondary actions (links)
|
|
45
|
+
*/
|
|
46
|
+
readonly actions?: React.ReactNode;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* If true, hides the menu and actions for fullscreen/embedded view
|
|
50
|
+
*/
|
|
51
|
+
readonly isHeadless?: boolean;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* CSS class name
|
|
55
|
+
*/
|
|
56
|
+
readonly className?: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export function AgentProfile(props: AgentProfileProps) {
|
|
60
|
+
const {
|
|
61
|
+
agent,
|
|
62
|
+
agentUrl = '',
|
|
63
|
+
agentEmail = '',
|
|
64
|
+
renderMenu,
|
|
65
|
+
children,
|
|
66
|
+
actions,
|
|
67
|
+
isHeadless = false,
|
|
68
|
+
className,
|
|
69
|
+
} = props;
|
|
70
|
+
const { meta, agentName } = agent;
|
|
71
|
+
const fullname = (meta.fullname as string) || agentName || 'Agent';
|
|
72
|
+
const personaDescription = agent.personaDescription || '';
|
|
73
|
+
const imageUrl = (meta.image as string) || null;
|
|
74
|
+
|
|
75
|
+
const [isQrModalOpen, setIsQrModalOpen] = useState(false);
|
|
76
|
+
const [isFlipped, setIsFlipped] = useState(false);
|
|
77
|
+
|
|
78
|
+
// Dynamic Font Loading
|
|
79
|
+
const fontString = meta.font;
|
|
80
|
+
let fontStyle: React.CSSProperties = {};
|
|
81
|
+
|
|
82
|
+
if (fontString) {
|
|
83
|
+
// [🧠] TODO: Properly parse font string to get family name
|
|
84
|
+
const primaryFont = fontString.split(',')[0].trim().replace(/['"]/g, '');
|
|
85
|
+
fontStyle = {
|
|
86
|
+
fontFamily: fontString,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Compute Colors and Background
|
|
91
|
+
const { brandColorHex, brandColorLightHex, brandColorDarkHex, backgroundImage } = useMemo(() => {
|
|
92
|
+
// [🧠] Default color should be imported constant, but for now hardcoded fallback
|
|
93
|
+
const PROMPTBOOK_COLOR_HEX = '#f15b24'; // TODO: Import PROMPTBOOK_COLOR
|
|
94
|
+
const brandColorString = meta.color || PROMPTBOOK_COLOR_HEX;
|
|
95
|
+
|
|
96
|
+
let brandColor;
|
|
97
|
+
try {
|
|
98
|
+
brandColor = Color.fromSafe(brandColorString.split(',')[0].trim());
|
|
99
|
+
} catch {
|
|
100
|
+
brandColor = Color.fromHex(PROMPTBOOK_COLOR_HEX);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const brandColorHex = brandColor.toHex();
|
|
104
|
+
const brandColorLightHex = brandColor.then(lighten(0.2)).toHex();
|
|
105
|
+
const brandColorDarkHex = brandColor.then(darken(0.15)).toHex();
|
|
106
|
+
|
|
107
|
+
// Generate Noisy SVG Background
|
|
108
|
+
const color1 = brandColor;
|
|
109
|
+
// const color2 = brandColors[1] || brandColors[0]!; // Use secondary color if available?
|
|
110
|
+
// For simplicity using primary color for now or derive second one
|
|
111
|
+
const color2 = brandColor;
|
|
112
|
+
|
|
113
|
+
// [🧠] Make colors much lighter for the background
|
|
114
|
+
const color1Light = color1.then(lighten(0.3)).toHex();
|
|
115
|
+
const color1Main = color1.toHex();
|
|
116
|
+
const color1Dark = color1.then(darken(0.3)).toHex();
|
|
117
|
+
|
|
118
|
+
const color2Light = color2.then(lighten(0.3)).toHex();
|
|
119
|
+
const color2Main = color2.toHex();
|
|
120
|
+
const color2Dark = color2.then(darken(0.3)).toHex();
|
|
121
|
+
|
|
122
|
+
const svgContent = spaceTrim(`
|
|
123
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
124
|
+
viewBox="0 0 1920 1080"
|
|
125
|
+
width="1920" height="1080"
|
|
126
|
+
preserveAspectRatio="xMidYMid slice">
|
|
127
|
+
<defs>
|
|
128
|
+
<!-- Bottom-left -->
|
|
129
|
+
<radialGradient id="grad1" cx="0%" cy="100%" r="90%">
|
|
130
|
+
<stop offset="0%" stop-color="${color1Light}" />
|
|
131
|
+
<stop offset="50%" stop-color="${color1Main}" />
|
|
132
|
+
<stop offset="100%" stop-color="${color1Dark}" />
|
|
133
|
+
</radialGradient>
|
|
134
|
+
|
|
135
|
+
<!-- Bottom-right -->
|
|
136
|
+
<radialGradient id="grad2" cx="100%" cy="100%" r="90%">
|
|
137
|
+
<stop offset="0%" stop-color="${color2Light}" />
|
|
138
|
+
<stop offset="50%" stop-color="${color2Main}" />
|
|
139
|
+
<stop offset="100%" stop-color="${color2Dark}" />
|
|
140
|
+
</radialGradient>
|
|
141
|
+
|
|
142
|
+
<!-- White top fade -->
|
|
143
|
+
<linearGradient id="whiteTopGrad" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
144
|
+
<stop offset="0%" stop-color="#ffffff" stop-opacity="1" />
|
|
145
|
+
<stop offset="100%" stop-color="#ffffff" stop-opacity="0.3" />
|
|
146
|
+
</linearGradient>
|
|
147
|
+
|
|
148
|
+
<!-- Strong grain -->
|
|
149
|
+
<filter id="grain" x="-10%" y="-10%" width="120%" height="120%">
|
|
150
|
+
<feTurbulence type="fractalNoise" baseFrequency="3.5" numOctaves="3" seed="8" result="noise" />
|
|
151
|
+
<feComponentTransfer>
|
|
152
|
+
<feFuncR type="linear" slope="3.5" intercept="-1.2" />
|
|
153
|
+
<feFuncG type="linear" slope="3.5" intercept="-1.2" />
|
|
154
|
+
<feFuncB type="linear" slope="3.5" intercept="-1.2" />
|
|
155
|
+
<feFuncA type="table" tableValues="0 0.8" />
|
|
156
|
+
</feComponentTransfer>
|
|
157
|
+
</filter>
|
|
158
|
+
</defs>
|
|
159
|
+
|
|
160
|
+
<!-- White base -->
|
|
161
|
+
<rect width="100%" height="100%" fill="#ffffff" />
|
|
162
|
+
|
|
163
|
+
<!-- Gradients -->
|
|
164
|
+
<rect width="100%" height="100%" fill="url(#grad1)" />
|
|
165
|
+
<rect width="100%" height="100%" fill="url(#grad2)" style="mix-blend-mode:screen; opacity:0.85" />
|
|
166
|
+
|
|
167
|
+
<!-- White fade on top -->
|
|
168
|
+
<rect width="100%" height="100%" fill="url(#whiteTopGrad)" />
|
|
169
|
+
|
|
170
|
+
<!-- Strong visible noise -->
|
|
171
|
+
<rect width="100%" height="100%" filter="url(#grain)"
|
|
172
|
+
style="mix-blend-mode:soft-light; opacity:1.2" />
|
|
173
|
+
</svg>
|
|
174
|
+
`);
|
|
175
|
+
|
|
176
|
+
const backgroundImage = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgContent)}`;
|
|
177
|
+
|
|
178
|
+
return { brandColorHex, brandColorLightHex, brandColorDarkHex, backgroundImage };
|
|
179
|
+
}, [meta.color]);
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<>
|
|
183
|
+
{fontString && (
|
|
184
|
+
<style jsx global>{`
|
|
185
|
+
@import url('https://fonts.googleapis.com/css2?family=${encodeURIComponent(
|
|
186
|
+
fontString.split(',')[0].trim().replace(/['"]/g, ''),
|
|
187
|
+
)}:wght@400;600;700&display=swap');
|
|
188
|
+
`}</style>
|
|
189
|
+
)}
|
|
190
|
+
|
|
191
|
+
{/* Full-screen background with agent color */}
|
|
192
|
+
<div
|
|
193
|
+
className={`w-full flex flex-col items-center justify-center p-6 md:p-12 relative overflow-hidden ${
|
|
194
|
+
isHeadless ? 'min-h-screen' : 'min-h-[calc(100vh-60px)]'
|
|
195
|
+
} ${className || ''}`}
|
|
196
|
+
style={{
|
|
197
|
+
background: `url("${backgroundImage}")`,
|
|
198
|
+
backgroundSize: 'cover',
|
|
199
|
+
backgroundPosition: 'center',
|
|
200
|
+
...fontStyle,
|
|
201
|
+
}}
|
|
202
|
+
>
|
|
203
|
+
{/* Options menu in top right */}
|
|
204
|
+
{!isHeadless && renderMenu && (
|
|
205
|
+
<div className="absolute top-4 right-4 z-[9999]">
|
|
206
|
+
{renderMenu({ onShowQrCode: () => setIsQrModalOpen(true) })}
|
|
207
|
+
</div>
|
|
208
|
+
)}
|
|
209
|
+
|
|
210
|
+
{/* Main profile content */}
|
|
211
|
+
<div className="relative z-10 grid grid-cols-[auto_1fr] gap-x-6 gap-y-4 md:gap-12 max-w-5xl w-full items-start">
|
|
212
|
+
{/* Agent image card (Flippable) */}
|
|
213
|
+
<div
|
|
214
|
+
className="flex-shrink-0 perspective-1000 group row-start-1 col-start-1 md:row-span-3"
|
|
215
|
+
style={{ perspective: '1000px' }}
|
|
216
|
+
>
|
|
217
|
+
<div
|
|
218
|
+
className="relative w-24 md:w-80 transition-all duration-700 transform-style-3d cursor-pointer"
|
|
219
|
+
style={{
|
|
220
|
+
aspectRatio: '1 / 1.618', // Golden Ratio
|
|
221
|
+
transformStyle: 'preserve-3d',
|
|
222
|
+
transform: isFlipped ? 'rotateY(180deg)' : 'rotateY(0deg)',
|
|
223
|
+
}}
|
|
224
|
+
onClick={() => setIsFlipped(!isFlipped)}
|
|
225
|
+
>
|
|
226
|
+
{/* Front of Card (Image) */}
|
|
227
|
+
<div
|
|
228
|
+
className="absolute inset-0 w-full h-full backface-hidden rounded-lg md:rounded-3xl shadow-lg md:shadow-2xl overflow-hidden backdrop-blur-sm"
|
|
229
|
+
style={{
|
|
230
|
+
backfaceVisibility: 'hidden',
|
|
231
|
+
backgroundColor: brandColorDarkHex,
|
|
232
|
+
boxShadow: `0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px ${brandColorLightHex}40`,
|
|
233
|
+
}}
|
|
234
|
+
>
|
|
235
|
+
{imageUrl ? (
|
|
236
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
237
|
+
<img src={imageUrl} alt={fullname} className="w-full h-full object-cover" />
|
|
238
|
+
) : (
|
|
239
|
+
<div
|
|
240
|
+
className="w-full h-full flex items-center justify-center text-3xl md:text-8xl font-bold text-white/80"
|
|
241
|
+
style={{ backgroundColor: brandColorDarkHex }}
|
|
242
|
+
>
|
|
243
|
+
{fullname.charAt(0).toUpperCase()}
|
|
244
|
+
</div>
|
|
245
|
+
)}
|
|
246
|
+
|
|
247
|
+
{/* Flip hint icon */}
|
|
248
|
+
<div className="absolute bottom-2 md:bottom-4 right-2 md:right-4 bg-black/30 p-1 md:p-2 rounded-full text-white/80 backdrop-blur-md opacity-0 group-hover:opacity-100 transition-opacity">
|
|
249
|
+
<RepeatIcon className="w-3 h-3 md:w-5 md:h-5" />
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
{/* Back of Card (QR Code) */}
|
|
254
|
+
<div
|
|
255
|
+
className="absolute inset-0 w-full h-full backface-hidden rounded-lg md:rounded-3xl shadow-lg md:shadow-2xl overflow-hidden backdrop-blur-sm flex flex-col items-center justify-center p-2 md:p-6"
|
|
256
|
+
style={{
|
|
257
|
+
backfaceVisibility: 'hidden',
|
|
258
|
+
transform: 'rotateY(180deg)',
|
|
259
|
+
background: `linear-gradient(135deg, ${brandColorLightHex} 0%, #ffffff 100%)`,
|
|
260
|
+
boxShadow: `0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px ${brandColorLightHex}40`,
|
|
261
|
+
}}
|
|
262
|
+
>
|
|
263
|
+
<div className="transform scale-90 md:scale-100">
|
|
264
|
+
<AgentQrCode
|
|
265
|
+
agentName={agentName}
|
|
266
|
+
agentUrl={agentUrl}
|
|
267
|
+
agentEmail={agentEmail}
|
|
268
|
+
personaDescription={personaDescription}
|
|
269
|
+
meta={meta}
|
|
270
|
+
isJustVcardShown
|
|
271
|
+
/>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
{/* Flip hint icon */}
|
|
275
|
+
<div className="absolute bottom-2 md:bottom-4 right-2 md:right-4 bg-black/10 p-1 md:p-2 rounded-full text-black/50 backdrop-blur-md">
|
|
276
|
+
<RepeatIcon className="w-3 h-3 md:w-5 md:h-5" />
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
|
|
282
|
+
{/* Agent info - Header Area */}
|
|
283
|
+
<div className="row-start-1 col-start-2 flex flex-col justify-center md:justify-start h-full md:h-auto gap-1 md:gap-6">
|
|
284
|
+
{/* Agent name with custom font */}
|
|
285
|
+
<h1
|
|
286
|
+
className="text-2xl md:text-5xl lg:text-6xl font-bold text-gray-900 tracking-tight leading-tight"
|
|
287
|
+
style={{
|
|
288
|
+
textShadow: '0 2px 20px rgba(255, 255, 255, 0.5)',
|
|
289
|
+
}}
|
|
290
|
+
>
|
|
291
|
+
{fullname}
|
|
292
|
+
</h1>
|
|
293
|
+
|
|
294
|
+
{/* Short description */}
|
|
295
|
+
<p className="text-sm md:text-xl text-gray-700 max-w-lg leading-relaxed font-medium line-clamp-3 md:line-clamp-none">
|
|
296
|
+
{personaDescription}
|
|
297
|
+
</p>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
{/* Chat Area */}
|
|
301
|
+
<div className="col-span-2 md:col-span-1 md:col-start-2 w-full mt-2 md:mt-0">
|
|
302
|
+
{children}
|
|
303
|
+
</div>
|
|
304
|
+
|
|
305
|
+
{/* Secondary Actions */}
|
|
306
|
+
{!isHeadless && (
|
|
307
|
+
<div className="col-span-2 md:col-span-1 md:col-start-2 flex flex-wrap justify-center md:justify-start items-center gap-4 md:gap-6 mt-2">
|
|
308
|
+
{actions}
|
|
309
|
+
</div>
|
|
310
|
+
)}
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
{/* Subtle gradient overlay at bottom */}
|
|
314
|
+
<div
|
|
315
|
+
className="absolute bottom-0 left-0 right-0 h-32 pointer-events-none"
|
|
316
|
+
style={{
|
|
317
|
+
background: `linear-gradient(to top, ${brandColorDarkHex}40, transparent)`,
|
|
318
|
+
}}
|
|
319
|
+
/>
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
{/* QR Code Modal */}
|
|
323
|
+
<QrCodeModal
|
|
324
|
+
isOpen={isQrModalOpen}
|
|
325
|
+
onClose={() => setIsQrModalOpen(false)}
|
|
326
|
+
agentName={agentName}
|
|
327
|
+
meta={meta}
|
|
328
|
+
personaDescription={personaDescription}
|
|
329
|
+
agentUrl={agentUrl}
|
|
330
|
+
agentEmail={agentEmail}
|
|
331
|
+
brandColorHex={brandColorHex}
|
|
332
|
+
/>
|
|
333
|
+
</>
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* TODO: !!!! Use 3D badge @see https://vercel.com/blog/building-an-interactive-3d-event-badge-with-react-three-fiber
|
|
339
|
+
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { string_book } from '@promptbook-local/types';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { parseAgentSource } from '../../../../../src/book-2.0/agent-source/parseAgentSource';
|
|
6
|
+
import { AgentProfile } from './AgentProfile';
|
|
7
|
+
|
|
8
|
+
type AgentProfileFromSourceProps = Omit<React.ComponentProps<typeof AgentProfile>, 'agent'> & {
|
|
9
|
+
/**
|
|
10
|
+
* Source code of the agent (book)
|
|
11
|
+
*/
|
|
12
|
+
readonly source: string_book;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function AgentProfileFromSource(props: AgentProfileFromSourceProps) {
|
|
16
|
+
const { source, ...rest } = props;
|
|
17
|
+
|
|
18
|
+
const agent = useMemo(() => {
|
|
19
|
+
return parseAgentSource(source);
|
|
20
|
+
}, [source]);
|
|
21
|
+
|
|
22
|
+
return <AgentProfile agent={agent} {...rest} />;
|
|
23
|
+
}
|