@promptbook/cli 0.104.0-8 → 0.104.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 +0 -4
- package/esm/index.es.js +261 -131
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +0 -6
- package/esm/typings/src/_packages/core.index.d.ts +8 -6
- package/esm/typings/src/_packages/types.index.d.ts +8 -0
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +24 -0
- package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +12 -2
- package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirements.tools.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.closed.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/save/_common/string_chat_format_name.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +6 -3
- package/esm/typings/src/book-components/_common/Dropdown/Dropdown.d.ts +5 -1
- package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +5 -1
- package/esm/typings/src/book-components/icons/AboutIcon.d.ts +5 -1
- package/esm/typings/src/book-components/icons/AttachmentIcon.d.ts +6 -2
- package/esm/typings/src/book-components/icons/CameraIcon.d.ts +6 -2
- package/esm/typings/src/book-components/icons/DownloadIcon.d.ts +5 -1
- package/esm/typings/src/book-components/icons/MenuIcon.d.ts +5 -1
- package/esm/typings/src/book-components/icons/SaveIcon.d.ts +6 -2
- package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +1 -1
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +18 -12
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +6 -3
- package/esm/typings/src/commands/_common/types/Command.d.ts +1 -1
- package/esm/typings/src/commitments/META/META_DESCRIPTION.d.ts +41 -0
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +2 -2
- package/esm/typings/src/commitments/_base/BookCommitment.d.ts +1 -1
- package/esm/typings/src/config.d.ts +8 -1
- package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +8 -4
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +1 -1
- package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +12 -8
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +7 -1
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/utils/mapToolsToOpenAi.d.ts +8 -0
- package/esm/typings/src/remote-server/ui/ServerApp.d.ts +5 -1
- package/esm/typings/src/scrapers/_common/utils/promptbookFetch.test.d.ts +1 -0
- package/esm/typings/src/search-engines/SearchEngine.d.ts +9 -0
- package/esm/typings/src/search-engines/SearchResult.d.ts +18 -0
- package/esm/typings/src/search-engines/bing/BingSearchEngine.d.ts +15 -0
- package/esm/typings/src/search-engines/dummy/DummySearchEngine.d.ts +15 -0
- package/esm/typings/src/types/LlmToolDefinition.d.ts +20 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +13 -0
- package/esm/typings/src/types/typeAliasEmoji.d.ts +2 -2
- package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +7 -2
- package/esm/typings/src/utils/random/$randomItem.d.ts +1 -1
- package/esm/typings/src/utils/random/$randomSeed.d.ts +1 -1
- package/esm/typings/src/utils/validators/url/isValidAgentUrl.d.ts +16 -0
- package/esm/typings/src/utils/validators/url/isValidAgentUrl.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +2 -1
- package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +4 -3
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +261 -131
- package/umd/index.umd.js.map +1 -1
- package/apps/agents-server/README.md +0 -3
- package/apps/agents-server/TODO.txt +0 -7
- package/apps/agents-server/config.ts +0 -128
- package/apps/agents-server/next.config.ts +0 -45
- package/apps/agents-server/package.json +0 -16
- package/apps/agents-server/postcss.config.mjs +0 -8
- 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/OpenMoji-color-cbdt.woff2 +0 -0
- package/apps/agents-server/public/logo-blue-white-256.png +0 -0
- package/apps/agents-server/public/sw.js +0 -16
- package/apps/agents-server/public/swagger.json +0 -115
- package/apps/agents-server/scripts/generate-reserved-paths/generate-reserved-paths.ts +0 -54
- package/apps/agents-server/scripts/generate-reserved-paths/tsconfig.json +0 -19
- package/apps/agents-server/src/app/AddAgentButton.tsx +0 -41
- package/apps/agents-server/src/app/[agentName]/[...rest]/page.tsx +0 -11
- package/apps/agents-server/src/app/[agentName]/page.tsx +0 -1
- package/apps/agents-server/src/app/actions.ts +0 -65
- package/apps/agents-server/src/app/admin/api-tokens/ApiTokensClient.tsx +0 -186
- package/apps/agents-server/src/app/admin/api-tokens/page.tsx +0 -13
- package/apps/agents-server/src/app/admin/browser-test/BrowserTestClient.tsx +0 -85
- package/apps/agents-server/src/app/admin/browser-test/page.tsx +0 -13
- package/apps/agents-server/src/app/admin/chat-feedback/ChatFeedbackClient.tsx +0 -561
- package/apps/agents-server/src/app/admin/chat-feedback/page.tsx +0 -22
- package/apps/agents-server/src/app/admin/chat-history/ChatHistoryClient.tsx +0 -591
- package/apps/agents-server/src/app/admin/chat-history/page.tsx +0 -21
- package/apps/agents-server/src/app/admin/messages/MessagesClient.tsx +0 -294
- package/apps/agents-server/src/app/admin/messages/page.tsx +0 -13
- package/apps/agents-server/src/app/admin/messages/send-email/SendEmailClient.tsx +0 -104
- package/apps/agents-server/src/app/admin/messages/send-email/actions.ts +0 -35
- package/apps/agents-server/src/app/admin/messages/send-email/page.tsx +0 -13
- package/apps/agents-server/src/app/admin/metadata/MetadataClient.tsx +0 -481
- package/apps/agents-server/src/app/admin/metadata/page.tsx +0 -13
- package/apps/agents-server/src/app/admin/models/page.tsx +0 -22
- package/apps/agents-server/src/app/admin/users/[userId]/UserDetailClient.tsx +0 -131
- package/apps/agents-server/src/app/admin/users/[userId]/page.tsx +0 -21
- package/apps/agents-server/src/app/admin/users/page.tsx +0 -18
- package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +0 -92
- package/apps/agents-server/src/app/agents/[agentName]/AgentOptionsMenu.tsx +0 -356
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileChat.tsx +0 -134
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileWrapper.tsx +0 -90
- package/apps/agents-server/src/app/agents/[agentName]/AgentUrlCopy.tsx +0 -40
- package/apps/agents-server/src/app/agents/[agentName]/ClearAgentChatFeedbackButton.tsx +0 -63
- package/apps/agents-server/src/app/agents/[agentName]/ClearAgentChatHistoryButton.tsx +0 -63
- package/apps/agents-server/src/app/agents/[agentName]/CloneAgentButton.tsx +0 -41
- package/apps/agents-server/src/app/agents/[agentName]/CopyField.tsx +0 -44
- package/apps/agents-server/src/app/agents/[agentName]/InstallPwaButton.tsx +0 -74
- package/apps/agents-server/src/app/agents/[agentName]/ServiceWorkerRegister.tsx +0 -24
- package/apps/agents-server/src/app/agents/[agentName]/TODO.txt +0 -1
- package/apps/agents-server/src/app/agents/[agentName]/_utils.ts +0 -38
- package/apps/agents-server/src/app/agents/[agentName]/agentLinks.tsx +0 -80
- package/apps/agents-server/src/app/agents/[agentName]/api/agents/route.ts +0 -58
- package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +0 -88
- package/apps/agents-server/src/app/agents/[agentName]/api/book/test.http +0 -37
- package/apps/agents-server/src/app/agents/[agentName]/api/chat/route.ts +0 -194
- package/apps/agents-server/src/app/agents/[agentName]/api/feedback/route.ts +0 -54
- package/apps/agents-server/src/app/agents/[agentName]/api/mcp/route.ts +0 -198
- package/apps/agents-server/src/app/agents/[agentName]/api/modelRequirements/TODO.txt +0 -1
- package/apps/agents-server/src/app/agents/[agentName]/api/modelRequirements/route.ts +0 -55
- package/apps/agents-server/src/app/agents/[agentName]/api/modelRequirements/systemMessage/route.ts +0 -47
- package/apps/agents-server/src/app/agents/[agentName]/api/openai/chat/completions/route.ts +0 -10
- package/apps/agents-server/src/app/agents/[agentName]/api/openai/models/route.ts +0 -93
- package/apps/agents-server/src/app/agents/[agentName]/api/openai/v1/chat/completions/route.ts +0 -10
- package/apps/agents-server/src/app/agents/[agentName]/api/openai/v1/models/route.ts +0 -93
- package/apps/agents-server/src/app/agents/[agentName]/api/openrouter/chat/completions/route.ts +0 -10
- package/apps/agents-server/src/app/agents/[agentName]/api/profile/route.ts +0 -80
- package/apps/agents-server/src/app/agents/[agentName]/api/voice/route.ts +0 -184
- package/apps/agents-server/src/app/agents/[agentName]/book/BookEditorWrapper.tsx +0 -143
- package/apps/agents-server/src/app/agents/[agentName]/book/page.tsx +0 -48
- package/apps/agents-server/src/app/agents/[agentName]/book+chat/AgentBookAndChat.tsx +0 -75
- package/apps/agents-server/src/app/agents/[agentName]/book+chat/AgentBookAndChatComponent.tsx.todo +0 -160
- package/apps/agents-server/src/app/agents/[agentName]/book+chat/page.tsx +0 -45
- package/apps/agents-server/src/app/agents/[agentName]/book+chat/page.tsx.todo +0 -21
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatWrapper.tsx +0 -68
- package/apps/agents-server/src/app/agents/[agentName]/chat/page.tsx +0 -45
- package/apps/agents-server/src/app/agents/[agentName]/code/api/route.ts +0 -68
- package/apps/agents-server/src/app/agents/[agentName]/code/page.tsx +0 -223
- package/apps/agents-server/src/app/agents/[agentName]/generateAgentMetadata.ts +0 -51
- package/apps/agents-server/src/app/agents/[agentName]/history/RestoreVersionButton.tsx +0 -46
- package/apps/agents-server/src/app/agents/[agentName]/history/actions.ts +0 -12
- package/apps/agents-server/src/app/agents/[agentName]/history/page.tsx +0 -62
- package/apps/agents-server/src/app/agents/[agentName]/images/default-avatar.png/getAgentDefaultAvatarPrompt.ts +0 -31
- package/apps/agents-server/src/app/agents/[agentName]/images/default-avatar.png/route.ts +0 -157
- package/apps/agents-server/src/app/agents/[agentName]/images/icon-256.png/route.tsx +0 -92
- package/apps/agents-server/src/app/agents/[agentName]/images/page.tsx +0 -200
- package/apps/agents-server/src/app/agents/[agentName]/images/screenshot-fullhd.png/route.tsx +0 -93
- package/apps/agents-server/src/app/agents/[agentName]/images/screenshot-phone.png/route.tsx +0 -93
- package/apps/agents-server/src/app/agents/[agentName]/integration/SdkCodeTabs.tsx +0 -31
- package/apps/agents-server/src/app/agents/[agentName]/integration/WebsiteIntegrationTabs.tsx +0 -26
- package/apps/agents-server/src/app/agents/[agentName]/integration/page.tsx +0 -326
- package/apps/agents-server/src/app/agents/[agentName]/layout.tsx +0 -41
- package/apps/agents-server/src/app/agents/[agentName]/links/page.tsx +0 -189
- package/apps/agents-server/src/app/agents/[agentName]/opengraph-image.tsx +0 -111
- package/apps/agents-server/src/app/agents/[agentName]/page.tsx +0 -114
- package/apps/agents-server/src/app/agents/[agentName]/system-message/page.tsx +0 -100
- package/apps/agents-server/src/app/agents/[agentName]/website-integration/page.tsx +0 -89
- package/apps/agents-server/src/app/agents/page.tsx +0 -11
- package/apps/agents-server/src/app/api/admin-email/route.ts +0 -12
- package/apps/agents-server/src/app/api/agents/[agentName]/clone/route.ts +0 -45
- package/apps/agents-server/src/app/api/agents/[agentName]/restore/route.ts +0 -19
- package/apps/agents-server/src/app/api/agents/[agentName]/route.ts +0 -60
- package/apps/agents-server/src/app/api/agents/route.ts +0 -68
- package/apps/agents-server/src/app/api/api-tokens/route.ts +0 -75
- package/apps/agents-server/src/app/api/auth/change-password/route.ts +0 -75
- package/apps/agents-server/src/app/api/auth/login/route.ts +0 -27
- package/apps/agents-server/src/app/api/auth/logout/route.ts +0 -7
- package/apps/agents-server/src/app/api/browser-test/screenshot/route.ts +0 -30
- package/apps/agents-server/src/app/api/chat/route.ts +0 -32
- package/apps/agents-server/src/app/api/chat-feedback/[id]/route.ts +0 -38
- package/apps/agents-server/src/app/api/chat-feedback/export/route.ts +0 -55
- package/apps/agents-server/src/app/api/chat-feedback/route.ts +0 -157
- package/apps/agents-server/src/app/api/chat-history/[id]/route.ts +0 -37
- package/apps/agents-server/src/app/api/chat-history/export/route.ts +0 -55
- package/apps/agents-server/src/app/api/chat-history/route.ts +0 -147
- package/apps/agents-server/src/app/api/chat-streaming/route.ts +0 -48
- package/apps/agents-server/src/app/api/docs/book.md/route.ts +0 -61
- package/apps/agents-server/src/app/api/emails/incoming/sendgrid/route.ts +0 -48
- package/apps/agents-server/src/app/api/embed.js/route.ts +0 -113
- package/apps/agents-server/src/app/api/federated-agents/route.ts +0 -29
- package/apps/agents-server/src/app/api/images/[filename]/route.ts +0 -107
- package/apps/agents-server/src/app/api/long-running-task/route.ts +0 -7
- package/apps/agents-server/src/app/api/long-streaming/route.ts +0 -20
- package/apps/agents-server/src/app/api/messages/route.ts +0 -102
- package/apps/agents-server/src/app/api/metadata/route.ts +0 -115
- package/apps/agents-server/src/app/api/openai/v1/chat/completions/route.ts +0 -6
- package/apps/agents-server/src/app/api/openai/v1/models/route.ts +0 -65
- package/apps/agents-server/src/app/api/upload/route.ts +0 -166
- package/apps/agents-server/src/app/api/users/[username]/route.ts +0 -75
- package/apps/agents-server/src/app/api/users/route.ts +0 -71
- package/apps/agents-server/src/app/docs/[docId]/page.tsx +0 -42
- package/apps/agents-server/src/app/docs/page.tsx +0 -59
- package/apps/agents-server/src/app/embed/layout.tsx +0 -31
- package/apps/agents-server/src/app/embed/page.tsx +0 -37
- package/apps/agents-server/src/app/globals.css +0 -383
- package/apps/agents-server/src/app/humans.txt/route.ts +0 -15
- package/apps/agents-server/src/app/layout.tsx +0 -144
- package/apps/agents-server/src/app/manifest.ts +0 -114
- package/apps/agents-server/src/app/not-found.tsx +0 -5
- package/apps/agents-server/src/app/page.tsx +0 -144
- package/apps/agents-server/src/app/recycle-bin/RestoreAgentButton.tsx +0 -40
- package/apps/agents-server/src/app/recycle-bin/actions.ts +0 -33
- package/apps/agents-server/src/app/recycle-bin/page.tsx +0 -44
- package/apps/agents-server/src/app/restricted/page.tsx +0 -33
- package/apps/agents-server/src/app/robots.txt/route.ts +0 -15
- package/apps/agents-server/src/app/security.txt/route.ts +0 -15
- package/apps/agents-server/src/app/sitemap.xml/route.ts +0 -39
- package/apps/agents-server/src/app/swagger/page.tsx +0 -14
- package/apps/agents-server/src/app/test/og-image/README.md +0 -1
- package/apps/agents-server/src/app/test/og-image/opengraph-image.tsx +0 -37
- package/apps/agents-server/src/app/test/og-image/page.tsx +0 -22
- package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +0 -267
- package/apps/agents-server/src/components/AgentProfile/AgentProfileFromSource.tsx +0 -23
- package/apps/agents-server/src/components/AgentProfile/AgentQrCode.tsx +0 -62
- package/apps/agents-server/src/components/AgentProfile/QrCodeModal.tsx +0 -89
- package/apps/agents-server/src/components/AgentProfile/useAgentBackground.ts +0 -97
- package/apps/agents-server/src/components/Auth/AuthControls.tsx +0 -124
- package/apps/agents-server/src/components/ChangePasswordDialog/ChangePasswordDialog.tsx +0 -41
- package/apps/agents-server/src/components/ChangePasswordForm/ChangePasswordForm.tsx +0 -159
- package/apps/agents-server/src/components/DeletedAgentBanner.tsx +0 -26
- package/apps/agents-server/src/components/DocsToolbar/DocsToolbar.tsx +0 -38
- package/apps/agents-server/src/components/DocumentationContent/DocumentationContent.tsx +0 -90
- package/apps/agents-server/src/components/ErrorPage/ErrorPage.tsx +0 -33
- package/apps/agents-server/src/components/Footer/Footer.tsx +0 -175
- package/apps/agents-server/src/components/ForbiddenPage/ForbiddenPage.tsx +0 -15
- package/apps/agents-server/src/components/ForgottenPasswordDialog/ForgottenPasswordDialog.tsx +0 -61
- package/apps/agents-server/src/components/Header/Header.tsx +0 -742
- package/apps/agents-server/src/components/Homepage/AgentCard.tsx +0 -182
- package/apps/agents-server/src/components/Homepage/AgentsList.tsx +0 -136
- package/apps/agents-server/src/components/Homepage/Card.tsx +0 -18
- package/apps/agents-server/src/components/Homepage/DeletedAgentsList.tsx +0 -66
- package/apps/agents-server/src/components/Homepage/ExternalAgentsSection.tsx +0 -30
- package/apps/agents-server/src/components/Homepage/ExternalAgentsSectionClient.tsx +0 -192
- package/apps/agents-server/src/components/Homepage/ModelCard.tsx +0 -29
- package/apps/agents-server/src/components/Homepage/ModelsSection.tsx +0 -75
- package/apps/agents-server/src/components/Homepage/Section.tsx +0 -17
- package/apps/agents-server/src/components/Homepage/TechInfoCard.tsx +0 -20
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +0 -58
- package/apps/agents-server/src/components/LoginDialog/LoginDialog.tsx +0 -41
- package/apps/agents-server/src/components/LoginForm/LoginForm.tsx +0 -158
- package/apps/agents-server/src/components/NotFoundPage/NotFoundPage.tsx +0 -22
- package/apps/agents-server/src/components/OpenMojiIcon/OpenMojiIcon.tsx +0 -29
- package/apps/agents-server/src/components/Portal/Portal.tsx +0 -38
- package/apps/agents-server/src/components/PrintHeader/PrintHeader.tsx +0 -18
- package/apps/agents-server/src/components/RegisterUserDialog/RegisterUserDialog.tsx +0 -61
- package/apps/agents-server/src/components/UsersList/UsersList.tsx +0 -141
- package/apps/agents-server/src/components/UsersList/useUsersAdmin.ts +0 -139
- package/apps/agents-server/src/components/VercelDeploymentCard/VercelDeploymentCard.tsx +0 -57
- package/apps/agents-server/src/components/_utils/generateMetaTxt.ts +0 -30
- package/apps/agents-server/src/components/_utils/headlessParam.tsx +0 -40
- package/apps/agents-server/src/database/$getTableName.ts +0 -18
- package/apps/agents-server/src/database/$provideSupabase.ts +0 -29
- package/apps/agents-server/src/database/$provideSupabaseForBrowser.ts +0 -41
- package/apps/agents-server/src/database/$provideSupabaseForServer.ts +0 -48
- package/apps/agents-server/src/database/$provideSupabaseForWorker.ts +0 -43
- package/apps/agents-server/src/database/getMetadata.ts +0 -31
- package/apps/agents-server/src/database/metadataDefaults.ts +0 -93
- package/apps/agents-server/src/database/migrate.ts +0 -164
- package/apps/agents-server/src/database/migrations/2025-11-0001-initial-schema.sql +0 -161
- package/apps/agents-server/src/database/migrations/2025-11-0002-metadata-table.sql +0 -14
- package/apps/agents-server/src/database/migrations/2025-12-0010-llm-cache.sql +0 -12
- package/apps/agents-server/src/database/migrations/2025-12-0060-api-tokens.sql +0 -13
- package/apps/agents-server/src/database/migrations/2025-12-0070-chat-history-source.sql +0 -2
- package/apps/agents-server/src/database/migrations/2025-12-0240-agent-public-id.sql +0 -3
- package/apps/agents-server/src/database/migrations/2025-12-0360-agent-deleted-at.sql +0 -1
- package/apps/agents-server/src/database/migrations/2025-12-0370-image-table.sql +0 -19
- package/apps/agents-server/src/database/migrations/2025-12-0380-agent-visibility.sql +0 -1
- package/apps/agents-server/src/database/migrations/2025-12-0390-upload-tracking.sql +0 -20
- package/apps/agents-server/src/database/migrations/2025-12-0401-file-upload-status.sql +0 -13
- package/apps/agents-server/src/database/migrations/2025-12-0402-message-table.sql +0 -42
- package/apps/agents-server/src/database/migrations/2025-12-0640-openai-assistant-cache.sql +0 -12
- package/apps/agents-server/src/database/schema.ts +0 -508
- package/apps/agents-server/src/deamons/longRunningTask.ts +0 -37
- package/apps/agents-server/src/generated/reservedPaths.ts +0 -32
- package/apps/agents-server/src/message-providers/email/_common/Email.ts +0 -73
- package/apps/agents-server/src/message-providers/email/_common/utils/TODO.txt +0 -1
- package/apps/agents-server/src/message-providers/email/_common/utils/parseEmailAddress.test.ts.todo +0 -108
- package/apps/agents-server/src/message-providers/email/_common/utils/parseEmailAddress.ts +0 -62
- package/apps/agents-server/src/message-providers/email/_common/utils/parseEmailAddresses.test.ts.todo +0 -117
- package/apps/agents-server/src/message-providers/email/_common/utils/parseEmailAddresses.ts +0 -19
- package/apps/agents-server/src/message-providers/email/_common/utils/stringifyEmailAddress.test.ts.todo +0 -119
- package/apps/agents-server/src/message-providers/email/_common/utils/stringifyEmailAddress.ts +0 -19
- package/apps/agents-server/src/message-providers/email/_common/utils/stringifyEmailAddresses.test.ts.todo +0 -74
- package/apps/agents-server/src/message-providers/email/_common/utils/stringifyEmailAddresses.ts +0 -14
- package/apps/agents-server/src/message-providers/email/sendgrid/SendgridMessageProvider.ts +0 -44
- package/apps/agents-server/src/message-providers/email/sendgrid/parseInboundSendgridEmail.ts +0 -49
- package/apps/agents-server/src/message-providers/email/zeptomail/ZeptomailMessageProvider.ts +0 -51
- package/apps/agents-server/src/message-providers/index.ts +0 -13
- package/apps/agents-server/src/message-providers/interfaces/MessageProvider.ts +0 -11
- package/apps/agents-server/src/middleware.ts +0 -301
- package/apps/agents-server/src/tools/$provideAgentCollectionForServer.ts +0 -54
- package/apps/agents-server/src/tools/$provideBrowserForServer.ts +0 -29
- package/apps/agents-server/src/tools/$provideCdnForServer.ts +0 -41
- package/apps/agents-server/src/tools/$provideExecutionToolsForServer.ts +0 -117
- package/apps/agents-server/src/tools/$provideOpenAiAssistantExecutionToolsForServer.ts +0 -35
- package/apps/agents-server/src/tools/$provideServer.ts +0 -39
- package/apps/agents-server/src/utils/auth.ts +0 -133
- package/apps/agents-server/src/utils/authenticateUser.ts +0 -42
- package/apps/agents-server/src/utils/cache/SupabaseCacheStorage.ts +0 -55
- package/apps/agents-server/src/utils/cdn/classes/DigitalOceanSpaces.ts +0 -119
- package/apps/agents-server/src/utils/cdn/classes/TrackedFilesStorage.ts +0 -57
- package/apps/agents-server/src/utils/cdn/classes/VercelBlobStorage.ts +0 -68
- package/apps/agents-server/src/utils/cdn/interfaces/IFilesStorage.ts +0 -50
- package/apps/agents-server/src/utils/cdn/interfaces/IStorage.ts +0 -14
- package/apps/agents-server/src/utils/cdn/utils/getUserFileCdnKey.ts +0 -28
- package/apps/agents-server/src/utils/cdn/utils/nameToSubfolderPath.ts +0 -9
- package/apps/agents-server/src/utils/cdn/utils/nextRequestToNodeRequest.ts +0 -27
- package/apps/agents-server/src/utils/chatFeedbackAdmin.ts +0 -96
- package/apps/agents-server/src/utils/chatHistoryAdmin.ts +0 -96
- package/apps/agents-server/src/utils/content/extractBodyContentFromHtml.ts +0 -19
- package/apps/agents-server/src/utils/convertToCsv.ts +0 -31
- package/apps/agents-server/src/utils/getCurrentUser.ts +0 -32
- package/apps/agents-server/src/utils/getEffectiveFederatedServers.ts +0 -22
- package/apps/agents-server/src/utils/getFederatedAgents.ts +0 -89
- package/apps/agents-server/src/utils/getFederatedServersFromMetadata.ts +0 -10
- package/apps/agents-server/src/utils/getUserIdFromRequest.ts +0 -35
- package/apps/agents-server/src/utils/getVisibleCommitmentDefinitions.ts +0 -12
- package/apps/agents-server/src/utils/handleChatCompletion.ts +0 -415
- package/apps/agents-server/src/utils/isIpAllowed.ts +0 -101
- package/apps/agents-server/src/utils/isUserAdmin.ts +0 -31
- package/apps/agents-server/src/utils/messages/sendMessage.ts +0 -91
- package/apps/agents-server/src/utils/messagesAdmin.ts +0 -72
- package/apps/agents-server/src/utils/normalization/filenameToPrompt.test.ts +0 -36
- package/apps/agents-server/src/utils/normalization/filenameToPrompt.ts +0 -25
- package/apps/agents-server/src/utils/resolveInheritedAgentSource.ts +0 -100
- package/apps/agents-server/src/utils/session.ts +0 -50
- package/apps/agents-server/src/utils/validateApiKey.ts +0 -124
- package/apps/agents-server/src/utils/validators/validateMimeType.ts +0 -24
- package/apps/agents-server/tailwind.config.ts +0 -26
- package/apps/agents-server/tsconfig.json +0 -29
- package/apps/agents-server/vercel.json +0 -7
- package/esm/typings/servers.d.ts +0 -50
|
@@ -1,144 +0,0 @@
|
|
|
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 { $getTableName } from '../database/$getTableName';
|
|
16
|
-
import { $provideSupabaseForServer } from '../database/$provideSupabaseForServer';
|
|
17
|
-
import { getLongRunningTask } from '../deamons/longRunningTask';
|
|
18
|
-
import { $provideAgentCollectionForServer } from '../tools/$provideAgentCollectionForServer';
|
|
19
|
-
import { $provideExecutionToolsForServer } from '../tools/$provideExecutionToolsForServer';
|
|
20
|
-
import { $provideServer } from '../tools/$provideServer';
|
|
21
|
-
import { getCurrentUser } from '../utils/getCurrentUser';
|
|
22
|
-
import { isUserAdmin } from '../utils/isUserAdmin';
|
|
23
|
-
|
|
24
|
-
// Add calendar formats that include seconds
|
|
25
|
-
const calendarWithSeconds = {
|
|
26
|
-
sameDay: '[Today at] LTS',
|
|
27
|
-
nextDay: '[Tomorrow at] LTS',
|
|
28
|
-
nextWeek: 'dddd [at] LTS',
|
|
29
|
-
lastDay: '[Yesterday at] LTS',
|
|
30
|
-
lastWeek: '[Last] dddd [at] LTS',
|
|
31
|
-
sameElse: 'L [at] LTS',
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default async function HomePage() {
|
|
35
|
-
$sideEffect(/* Note: [🐶] This will ensure dynamic rendering of page and avoid Next.js pre-render */ headers());
|
|
36
|
-
|
|
37
|
-
const { publicUrl } = await $provideServer();
|
|
38
|
-
|
|
39
|
-
const currentUser = await getCurrentUser();
|
|
40
|
-
const isAdmin = await isUserAdmin(); /* <- TODO: [👹] Here should be user permissions */
|
|
41
|
-
|
|
42
|
-
const collection = await $provideAgentCollectionForServer();
|
|
43
|
-
const allAgents = await collection.listAgents();
|
|
44
|
-
|
|
45
|
-
// Filter agents based on visibility and user authentication
|
|
46
|
-
const supabase = $provideSupabaseForServer();
|
|
47
|
-
// const { tablePrefix } = await $provideServer();
|
|
48
|
-
|
|
49
|
-
// Get visibility for all agents
|
|
50
|
-
const visibilityResult = await supabase
|
|
51
|
-
.from(await $getTableName(`Agent`))
|
|
52
|
-
.select('agentName, visibility')
|
|
53
|
-
.is('deletedAt', null);
|
|
54
|
-
|
|
55
|
-
let agents: typeof allAgents;
|
|
56
|
-
if (visibilityResult.error) {
|
|
57
|
-
console.error('Error fetching agent visibility:', visibilityResult.error);
|
|
58
|
-
// Fallback to showing all agents if visibility fetch fails
|
|
59
|
-
agents = allAgents;
|
|
60
|
-
} else {
|
|
61
|
-
const visibilityMap = new Map(
|
|
62
|
-
visibilityResult.data.map((item: { agentName: string; visibility: 'PUBLIC' | 'PRIVATE' }) => [
|
|
63
|
-
item.agentName,
|
|
64
|
-
item.visibility,
|
|
65
|
-
]),
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
// Filter agents based on user authentication and visibility
|
|
69
|
-
agents = allAgents
|
|
70
|
-
.filter((agent) => {
|
|
71
|
-
const visibility = visibilityMap.get(agent.agentName);
|
|
72
|
-
if (!visibility) return false; // If no visibility info, hide the agent
|
|
73
|
-
|
|
74
|
-
// Admins can see all agents
|
|
75
|
-
if (currentUser?.isAdmin) return true;
|
|
76
|
-
|
|
77
|
-
// Authenticated users can see PUBLIC and PRIVATE agents
|
|
78
|
-
if (currentUser) return true;
|
|
79
|
-
|
|
80
|
-
// Unauthenticated users can only see PUBLIC agents
|
|
81
|
-
return visibility === 'PUBLIC';
|
|
82
|
-
})
|
|
83
|
-
.map((agent) => ({
|
|
84
|
-
...agent,
|
|
85
|
-
visibility: visibilityMap.get(agent.agentName) as 'PUBLIC' | 'PRIVATE',
|
|
86
|
-
}));
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const longRunningTask = getLongRunningTask();
|
|
90
|
-
|
|
91
|
-
const executionTools = await $provideExecutionToolsForServer();
|
|
92
|
-
const models = await getSingleLlmExecutionTools(executionTools.llm).listModels();
|
|
93
|
-
|
|
94
|
-
const host = (await headers()).get('host') || 'unknown';
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<div className="min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50">
|
|
98
|
-
<div className="container mx-auto px-4 py-16">
|
|
99
|
-
<AgentsList agents={[...agents]} isAdmin={isAdmin} publicUrl={publicUrl} />
|
|
100
|
-
|
|
101
|
-
<ExternalAgentsSectionClient publicUrl={publicUrl} />
|
|
102
|
-
|
|
103
|
-
{isAdmin && <UsersList allowCreate={false} />}
|
|
104
|
-
|
|
105
|
-
{isAdmin && <ModelsSection models={models} maxVisible={11} showViewAllLink />}
|
|
106
|
-
|
|
107
|
-
{isAdmin && (
|
|
108
|
-
<>
|
|
109
|
-
{/* Note: Shown in <AboutPromptbookInformation />: <h2 className="text-3xl text-gray-900 mt-16 mb-4">About Promptbook</h2> */}
|
|
110
|
-
<AboutPromptbookInformation />
|
|
111
|
-
</>
|
|
112
|
-
)}
|
|
113
|
-
|
|
114
|
-
{isAdmin && (
|
|
115
|
-
<Section title="Technical Information">
|
|
116
|
-
<TechInfoCard title={`Long running task ${longRunningTask.taskId}`}>
|
|
117
|
-
<p className="text-gray-600">Tick: {longRunningTask.tick}</p>
|
|
118
|
-
<p className="text-gray-600">
|
|
119
|
-
Created At: {moment(longRunningTask.createdAt).calendar(undefined, calendarWithSeconds)}
|
|
120
|
-
</p>
|
|
121
|
-
<p className="text-gray-600">
|
|
122
|
-
Updated At: {moment(longRunningTask.updatedAt).calendar(undefined, calendarWithSeconds)}
|
|
123
|
-
</p>
|
|
124
|
-
</TechInfoCard>
|
|
125
|
-
|
|
126
|
-
<VercelDeploymentCard />
|
|
127
|
-
|
|
128
|
-
<TechInfoCard title="HTTP Information">
|
|
129
|
-
<p className="text-gray-600">Host: {host}</p>
|
|
130
|
-
</TechInfoCard>
|
|
131
|
-
|
|
132
|
-
<TechInfoCard title="Server">
|
|
133
|
-
<pre>{JSON.stringify(await $provideServer(), null, 2)}</pre>
|
|
134
|
-
</TechInfoCard>
|
|
135
|
-
</Section>
|
|
136
|
-
)}
|
|
137
|
-
</div>
|
|
138
|
-
</div>
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* TODO: [🕋] Use here `AboutPromptbookInformation`
|
|
144
|
-
*/
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
|
|
3
|
-
import { $provideAgentCollectionForServer } from '@/src/tools/$provideAgentCollectionForServer';
|
|
4
|
-
import { revalidatePath } from 'next/cache';
|
|
5
|
-
import { isUserAdmin } from '../../utils/isUserAdmin';
|
|
6
|
-
|
|
7
|
-
export async function restoreDeletedAgent(agentName: string) {
|
|
8
|
-
if (!(await isUserAdmin())) {
|
|
9
|
-
throw new Error('You are not authorized to restore agents');
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const collection = await $provideAgentCollectionForServer();
|
|
13
|
-
|
|
14
|
-
await collection.restoreAgent(agentName);
|
|
15
|
-
|
|
16
|
-
revalidatePath('/recycle-bin');
|
|
17
|
-
revalidatePath(`/agents/${agentName}`);
|
|
18
|
-
revalidatePath('/');
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function deleteAgent(agentName: string) {
|
|
22
|
-
if (!(await isUserAdmin())) {
|
|
23
|
-
throw new Error('You are not authorized to delete agents');
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const collection = await $provideAgentCollectionForServer();
|
|
27
|
-
|
|
28
|
-
await collection.deleteAgent(agentName);
|
|
29
|
-
|
|
30
|
-
revalidatePath('/recycle-bin');
|
|
31
|
-
revalidatePath(`/agents/${agentName}`);
|
|
32
|
-
revalidatePath('/');
|
|
33
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { $provideAgentCollectionForServer } from '@/src/tools/$provideAgentCollectionForServer';
|
|
2
|
-
import { $provideServer } from '@/src/tools/$provideServer';
|
|
3
|
-
import { TrashIcon } from 'lucide-react';
|
|
4
|
-
import Link from 'next/link';
|
|
5
|
-
import { DeletedAgentsList } from '../../components/Homepage/DeletedAgentsList';
|
|
6
|
-
import { isUserAdmin } from '../../utils/isUserAdmin';
|
|
7
|
-
|
|
8
|
-
export const metadata = {
|
|
9
|
-
title: 'Recycle Bin',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default async function RecycleBinPage() {
|
|
13
|
-
const { publicUrl } = await $provideServer();
|
|
14
|
-
const collection = await $provideAgentCollectionForServer();
|
|
15
|
-
const deletedAgents = await collection.listDeletedAgents();
|
|
16
|
-
const isAdmin = await isUserAdmin();
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div className="min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50">
|
|
20
|
-
<div className="container mx-auto px-4 py-16">
|
|
21
|
-
<header className="flex items-center gap-4 mb-8">
|
|
22
|
-
<div className="bg-red-100 p-3 rounded-full">
|
|
23
|
-
<TrashIcon className="w-8 h-8 text-red-600" />
|
|
24
|
-
</div>
|
|
25
|
-
<div>
|
|
26
|
-
<h1 className="text-3xl font-bold text-gray-900">Recycle Bin</h1>
|
|
27
|
-
<p className="text-gray-600">Restore deleted agents from here.</p>
|
|
28
|
-
</div>
|
|
29
|
-
</header>
|
|
30
|
-
|
|
31
|
-
{deletedAgents.length === 0 ? (
|
|
32
|
-
<div className="text-center py-12 bg-gray-50 rounded-lg border border-dashed border-gray-300">
|
|
33
|
-
<p className="text-gray-500 text-lg">Recycle bin is empty</p>
|
|
34
|
-
<Link href="/" className="text-blue-600 hover:underline mt-2 inline-block">
|
|
35
|
-
Go back to agents
|
|
36
|
-
</Link>
|
|
37
|
-
</div>
|
|
38
|
-
) : (
|
|
39
|
-
<DeletedAgentsList agents={deletedAgents} isAdmin={isAdmin} publicUrl={publicUrl} />
|
|
40
|
-
)}
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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 = await generateRobotsTxt();
|
|
10
|
-
return new NextResponse(txt, {
|
|
11
|
-
headers: {
|
|
12
|
-
'Content-Type': 'text/plain',
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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 = await generateSecurityTxt();
|
|
10
|
-
return new NextResponse(txt, {
|
|
11
|
-
headers: {
|
|
12
|
-
'Content-Type': 'text/plain',
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Dynamic sitemap.xml for Agents Server
|
|
2
|
-
|
|
3
|
-
import { $provideAgentCollectionForServer } from '@/src/tools/$provideAgentCollectionForServer';
|
|
4
|
-
import { $provideServer } from '@/src/tools/$provideServer';
|
|
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 { publicUrl } = await $provideServer();
|
|
12
|
-
|
|
13
|
-
const collection = await $provideAgentCollectionForServer();
|
|
14
|
-
|
|
15
|
-
// Assume collection.listAgents() returns an array of agent names
|
|
16
|
-
const agents = await collection.listAgents();
|
|
17
|
-
|
|
18
|
-
const urls = agents
|
|
19
|
-
.map(
|
|
20
|
-
({ permanentId, agentName }) =>
|
|
21
|
-
`<url><loc>${publicUrl.href}agents/${encodeURIComponent(permanentId || agentName)}</loc></url>`,
|
|
22
|
-
)
|
|
23
|
-
.join('\n');
|
|
24
|
-
|
|
25
|
-
const xml = spaceTrim(
|
|
26
|
-
(block) => `
|
|
27
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
28
|
-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
29
|
-
${block(urls)}
|
|
30
|
-
</urlset>
|
|
31
|
-
`,
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
return new NextResponse(xml, {
|
|
35
|
-
headers: {
|
|
36
|
-
'Content-Type': 'application/xml',
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import dynamic from 'next/dynamic';
|
|
4
|
-
import 'swagger-ui-react/swagger-ui.css';
|
|
5
|
-
|
|
6
|
-
const SwaggerUI = dynamic(() => import('swagger-ui-react'), { ssr: false });
|
|
7
|
-
|
|
8
|
-
export default function SwaggerPage() {
|
|
9
|
-
return (
|
|
10
|
-
<div className="swagger-container bg-white min-h-screen">
|
|
11
|
-
<SwaggerUI url="/swagger.json" />
|
|
12
|
-
</div>
|
|
13
|
-
);
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
In this folder we are testing miscellaneous things related to Promptbook Agents Server
|
|
@@ -1,37 +0,0 @@
|
|
|
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
|
-
*/
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
}
|