@promptbook/cli 0.112.0-103 → 0.112.0-105
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/apps/agents-server/src/app/AddAgentButton.tsx +0 -5
- package/apps/agents-server/src/app/actions.ts +50 -0
- package/apps/agents-server/src/app/admin/image-generator-test/ImageAttachmentsEditor.tsx +19 -3
- package/apps/agents-server/src/app/admin/limits/LimitsClient.tsx +11 -12
- package/apps/agents-server/src/app/admin/metadata/MetadataClient.tsx +34 -2
- package/apps/agents-server/src/app/admin/servers/CreateServerDialog.tsx +6 -1
- package/apps/agents-server/src/app/admin/servers/useCreateServerWizard.ts +13 -1
- package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +11 -2
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileChat.tsx +14 -5
- package/apps/agents-server/src/app/agents/[agentName]/book/BookEditorWrapper.tsx +7 -1
- package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +11 -1
- package/apps/agents-server/src/app/agents/[agentName]/images/default-avatar.png/route.ts +6 -2
- package/apps/agents-server/src/app/api/health/route.ts +18 -0
- package/apps/agents-server/src/app/api/images/[filename]/route.ts +6 -2
- package/apps/agents-server/src/app/api/internal/agent-runner-limits/route.ts +51 -0
- package/apps/agents-server/src/app/api/upload/route.ts +48 -12
- package/apps/agents-server/src/app/layout.tsx +13 -0
- package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +1 -4
- package/apps/agents-server/src/components/FileUploadAvailability/FileUploadAvailabilityContext.tsx +50 -0
- package/apps/agents-server/src/components/FileUploadAvailability/FileUploadUnavailableNotice.tsx +45 -0
- package/apps/agents-server/src/components/Header/Header.tsx +0 -11
- package/apps/agents-server/src/components/Header/useHeaderAgentMenus.tsx +0 -5
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +85 -76
- package/apps/agents-server/src/components/NewAgentDialog/NewAgentDialog.tsx +7 -3
- package/apps/agents-server/src/components/NewAgentDialog/NewAgentWizardKnowledgeStep.tsx +6 -0
- package/apps/agents-server/src/components/NewAgentDialog/useNewAgentDialog.tsx +39 -16
- package/apps/agents-server/src/components/NewAgentDialog/useNewAgentWizardKnowledgeState.ts +8 -1
- package/apps/agents-server/src/constants/defaultAgentAvatarVisual.ts +1 -1
- package/apps/agents-server/src/constants/serverLimits.ts +22 -2
- package/apps/agents-server/src/database/migrations/2026-06-0200-default-agent-avatar-visual-octopus3d3.sql +16 -0
- package/apps/agents-server/src/database/seedDefaultAgents.ts +218 -0
- package/apps/agents-server/src/middleware.ts +2 -1
- package/apps/agents-server/src/tools/$provideCdnForServer.ts +114 -9
- package/apps/agents-server/src/utils/agentRouting/resolveAgentRouteTarget.ts +27 -4
- package/apps/agents-server/src/utils/defaultAgents/loadDefaultAgentBooks.ts +103 -0
- package/apps/agents-server/src/utils/knowledge/createInlineKnowledgeSourceUploader.ts +24 -5
- package/apps/agents-server/src/utils/serverLimits.ts +26 -1
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerDefaultAgents.ts +1 -85
- package/apps/agents-server/src/utils/shareTargetPayloads.ts +20 -2
- package/apps/agents-server/src/utils/upload/fileUploadAvailability.ts +91 -0
- package/apps/agents-server/src/utils/upload/uploadFileToServer.ts +46 -2
- package/esm/apps/agents-server/src/constants/federatedAgentImport.d.ts +42 -0
- package/esm/apps/agents-server/src/constants/serverLimits.d.ts +207 -0
- package/esm/apps/agents-server/src/constants/toolUsageLimits.d.ts +55 -0
- package/esm/index.es.js +1109 -35
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-messages/main/AgentMessageFailureTracker.d.ts +27 -0
- package/esm/scripts/run-agent-messages/main/handleAgentWatchError.d.ts +4 -0
- package/esm/scripts/run-agent-messages/main/runAgentMessages.d.ts +1 -0
- package/esm/scripts/run-agent-messages/messages/moveAgentMessageToFailed.d.ts +17 -0
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/esm/src/avatars/visuals/octopus3d3AvatarVisual.d.ts +7 -0
- package/esm/src/book-components/BookEditor/BookEditor.d.ts +5 -4
- package/esm/src/book-components/BookEditor/BookEditorTheme.d.ts +24 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +1 -6
- package/esm/src/book-components/BookEditor/useBookEditorMonacoLifecycle.d.ts +1 -4
- package/esm/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +2 -1
- package/esm/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +6 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/avatars/types/AvatarVisualDefinition.ts +1 -0
- package/src/avatars/visuals/avatarVisualRegistry.ts +2 -0
- package/src/avatars/visuals/octopus3d3AvatarVisual.ts +902 -0
- package/src/book-components/BookEditor/BookEditor.tsx +10 -7
- package/src/book-components/BookEditor/BookEditorMonaco.tsx +3 -1
- package/src/book-components/BookEditor/BookEditorTheme.ts +32 -0
- package/src/book-components/BookEditor/useBookEditorMonacoLanguage.ts +12 -15
- package/src/book-components/BookEditor/useBookEditorMonacoLifecycle.ts +1 -5
- package/src/book-components/BookEditor/useBookEditorMonacoStyles.ts +2 -1
- package/src/cli/cli-commands/agent-folder/agentProjectPaths.ts +7 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer.ts +109 -9
- package/src/cli/cli-commands/agents-server/startAgentsServer.ts +132 -4
- package/src/other/templates/getTemplatesPipelineCollection.ts +690 -747
- package/src/utils/agents/resolveAgentAvatarImageUrl.ts +1 -1
- package/src/version.ts +2 -2
- package/src/versions.txt +2 -1
- package/umd/apps/agents-server/src/constants/federatedAgentImport.d.ts +42 -0
- package/umd/apps/agents-server/src/constants/serverLimits.d.ts +207 -0
- package/umd/apps/agents-server/src/constants/toolUsageLimits.d.ts +55 -0
- package/umd/index.umd.js +1109 -35
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-messages/main/AgentMessageFailureTracker.d.ts +27 -0
- package/umd/scripts/run-agent-messages/main/handleAgentWatchError.d.ts +4 -0
- package/umd/scripts/run-agent-messages/main/runAgentMessages.d.ts +1 -0
- package/umd/scripts/run-agent-messages/messages/moveAgentMessageToFailed.d.ts +17 -0
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/umd/src/avatars/visuals/octopus3d3AvatarVisual.d.ts +7 -0
- package/umd/src/book-components/BookEditor/BookEditor.d.ts +5 -4
- package/umd/src/book-components/BookEditor/BookEditorTheme.d.ts +24 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +1 -6
- package/umd/src/book-components/BookEditor/useBookEditorMonacoLifecycle.d.ts +1 -4
- package/umd/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +2 -1
- package/umd/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +6 -0
- package/umd/src/version.d.ts +1 -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/parseEmailAddresses.test.ts.todo +0 -117
- package/apps/agents-server/src/message-providers/email/_common/utils/stringifyEmailAddress.test.ts.todo +0 -119
- package/apps/agents-server/src/message-providers/email/_common/utils/stringifyEmailAddresses.test.ts.todo +0 -74
- package/apps/agents-server/tests/e2e/authentication-and-navigation.spec.ts.todo +0 -178
- package/src/_packages/browser.index.ts +0 -31
- package/src/_packages/browser.readme.md +0 -43
- package/src/book-2.0/agent-source/parseAgentSourceWithCommitments.test.ts.todo +0 -265
- package/src/book-components/BookEditor/BookEditorMonaco.test.tsx.todo +0 -115
- package/src/book-components/Chat/utils/renderMarkdown.test.ts.tmp +0 -199
- package/src/collection/agent-collection/constructors/agent-collection-in-directory/AgentCollectionInDirectory.test.ts.todo +0 -131
- package/src/commands/_common/parseCommand.test.ts.todo +0 -48
- package/src/commitments/META_LINK/META_LINK.test.ts.todo +0 -75
- package/src/conversion/validation/pipelineStringToJson-errors.test.ts.todo +0 -33
- package/src/dialogs/simple-prompt/SimplePromptInterfaceTools.ts +0 -51
- package/src/executables/browsers/locateSafari.test.ts.tmp +0 -15
- package/src/execution/PromptbookFetch.test-type.ts +0 -14
- package/src/execution/createPipelineExecutor/00-createPipelineExecutor.test.ts.todo +0 -0
- package/src/execution/execution-report/executionReportJsonToString.test.ts.todo +0 -83
- package/src/execution/utils/usageToHuman.test.ts.todo +0 -80
- package/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.ts +0 -76
- package/src/llm-providers/_common/utils/assertUniqueModels.ts +0 -27
- package/src/llm-providers/_multiple/playground/playground.ts +0 -141
- package/src/llm-providers/_multiple/playground/tsconfig.json +0 -19
- package/src/llm-providers/agent/playground/playground.ts +0 -190
- package/src/llm-providers/agent/playground/tsconfig.json +0 -19
- package/src/llm-providers/anthropic-claude/playground/playground.ts +0 -99
- package/src/llm-providers/anthropic-claude/playground/tsconfig.json +0 -19
- package/src/llm-providers/azure-openai/playground/playground.ts +0 -101
- package/src/llm-providers/azure-openai/playground/tsconfig.json +0 -19
- package/src/llm-providers/ollama/playground/playground.ts +0 -120
- package/src/llm-providers/ollama/playground/tsconfig.json +0 -19
- package/src/llm-providers/openai/playground/playground.ts +0 -406
- package/src/llm-providers/openai/playground/tsconfig.json +0 -19
- package/src/llm-providers/remote/playground/playground.ts +0 -144
- package/src/llm-providers/remote/playground/tsconfig.json +0 -19
- package/src/llm-providers/vercel/playground/playground.ts +0 -133
- package/src/llm-providers/vercel/playground/tsconfig.json +0 -19
- package/src/personas/preparePersona.test.ts.todo +0 -126
- package/src/playground/backup/_playground-boilerplate.ts.txt +0 -37
- package/src/playground/backup/playground-agent-os.txt +0 -62
- package/src/playground/backup/playground-brj-app.ts.txt +0 -302
- package/src/playground/backup/playground-browser-playwright.txt +0 -110
- package/src/playground/backup/playground-claude-mcp.txt +0 -43
- package/src/playground/backup/playground-document-conversion.txt +0 -84
- package/src/playground/backup/playground-glob.ts.txt +0 -42
- package/src/playground/backup/playground-mcp-server.txt +0 -1
- package/src/playground/backup/playground-openai-agent-kit.txt +0 -73
- package/src/playground/backup/playground-openai-function-calling.txt +0 -131
- package/src/playground/backup/playground-openai-streaming.ts.txt +0 -68
- package/src/playground/backup/playground-scrape-knowledge.txt +0 -65
- package/src/playground/backup/playground-scraperFetch.ts.txt +0 -44
- package/src/playground/backup/playground-using-openai-compatible-route-on-agents-server.ts.txt +0 -49
- package/src/playground/backup/playground-write-pavolhejny-bio.txt +0 -120
- package/src/playground/permanent/_boilerplate.ts +0 -54
- package/src/playground/permanent/agent-with-browser-playground.ts +0 -92
- package/src/playground/permanent/error-handling-playground.ts +0 -103
- package/src/playground/playground.ts +0 -36
- package/src/playground/tsconfig.json +0 -19
- package/src/scrapers/_boilerplate/BoilerplateScraper.test.ts.todo +0 -73
- package/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.ts +0 -79
- package/src/scrapers/_boilerplate/playground/tsconfig.json +0 -19
- package/src/scrapers/_common/utils/files/blobToDataurl.test.ts.todo +0 -17
- package/src/scrapers/_common/utils/files/dataurlToBlob.test.ts.todo +0 -52
- package/src/scrapers/_common/utils/files/isValidDataurl.test.ts.todo +0 -42
- package/src/scrapers/_common/utils/files/shorten.test.ts.todo +0 -13
- package/src/scrapers/document/playground/document-scraper-playground.ts +0 -80
- package/src/scrapers/document/playground/tsconfig.json +0 -19
- package/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.ts +0 -80
- package/src/scrapers/document-legacy/playground/tsconfig.json +0 -19
- package/src/scrapers/markdown/playground/markdown-scraper-playground.ts +0 -74
- package/src/scrapers/markdown/playground/tsconfig.json +0 -19
- package/src/scrapers/markitdown/MarkitdownScraper.test.ts.todo +0 -132
- package/src/scrapers/markitdown/playground/markitdown-scraper-playground.ts +0 -91
- package/src/scrapers/markitdown/playground/tsconfig.json +0 -19
- package/src/scrapers/pdf/PdfScraper.test.ts.todo +0 -52
- package/src/scrapers/pdf/playground/pdf-scraper-playground.ts +0 -75
- package/src/scrapers/pdf/playground/tsconfig.json +0 -19
- package/src/scrapers/website/playground/tsconfig.json +0 -19
- package/src/scrapers/website/playground/website-scraper-playground.ts +0 -82
- package/src/storage/_common/PromptbookStorage.test-type.ts +0 -14
- package/src/storage/local-storage/getIndexedDbStorage.ts +0 -36
- package/src/storage/local-storage/getLocalStorage.ts +0 -33
- package/src/storage/local-storage/getSessionStorage.ts +0 -33
- package/src/storage/local-storage/utils/IndexedDbStorageOptions.ts +0 -16
- package/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.ts +0 -58
- package/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.ts +0 -45
- package/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.test.ts.todo +0 -35
- package/src/transpilers/openai-sdk/playground/playground.ts +0 -85
- package/src/transpilers/openai-sdk/playground/tmp/chatbot-openaisdk-1.js +0 -194
- package/src/transpilers/openai-sdk/playground/tmp/package.json +0 -3
- package/src/transpilers/openai-sdk/playground/tsconfig.json +0 -18
- package/src/utils/editable/utils/findUsableParameters.test.ts.todo +0 -43
- package/src/utils/editable/utils/stringifyPipelineJson.test.ts.todo +0 -38
- package/src/utils/markdown/prettifyMarkdown.test.ts.tmp +0 -42
- package/src/utils/serialization/serializeToPromptbookJavascript.test.ts.todo +0 -116
|
@@ -6,6 +6,8 @@ import { useCallback, useState } from 'react';
|
|
|
6
6
|
import { BookEditor } from '../../../../../src/book-components/BookEditor/BookEditor';
|
|
7
7
|
import { bookEditorUploadHandler } from '../../utils/upload/createBookEditorUploadHandler';
|
|
8
8
|
import { useAgentNaming } from '../AgentNaming/AgentNamingContext';
|
|
9
|
+
import { FileUploadUnavailableNotice } from '../FileUploadAvailability/FileUploadUnavailableNotice';
|
|
10
|
+
import { useFileUploadAvailability } from '../FileUploadAvailability/FileUploadAvailabilityContext';
|
|
9
11
|
import { Dialog } from '../Portal/Dialog';
|
|
10
12
|
import { useServerLanguage } from '../ServerLanguage/ServerLanguageProvider';
|
|
11
13
|
import { usePromptbookTheme } from '../ThemeMode/usePromptbookTheme';
|
|
@@ -29,6 +31,7 @@ export function NewAgentDialog(props: NewAgentDialogProps) {
|
|
|
29
31
|
const [isCreating, setIsCreating] = useState(false);
|
|
30
32
|
const { formatText } = useAgentNaming();
|
|
31
33
|
const { t } = useServerLanguage();
|
|
34
|
+
const fileUploadAvailability = useFileUploadAvailability();
|
|
32
35
|
const { promptbookTheme } = usePromptbookTheme();
|
|
33
36
|
const { requestClose } = useDirtyModalGuard({
|
|
34
37
|
hasUnsavedChanges: agentSource !== initialAgentSource,
|
|
@@ -79,9 +82,10 @@ export function NewAgentDialog(props: NewAgentDialogProps) {
|
|
|
79
82
|
</div>
|
|
80
83
|
|
|
81
84
|
<div
|
|
82
|
-
className="relative flex-1 overflow-hidden bg-slate-50/60 p-4 dark:bg-slate-950/55" /* [✨🧬] onDragEnter={() => setIsInteracted(true)} */
|
|
85
|
+
className="relative flex flex-1 flex-col overflow-hidden bg-slate-50/60 p-4 dark:bg-slate-950/55" /* [✨🧬] onDragEnter={() => setIsInteracted(true)} */
|
|
83
86
|
>
|
|
84
|
-
<
|
|
87
|
+
{!fileUploadAvailability.isUploadAvailable && <FileUploadUnavailableNotice className="mb-3" />}
|
|
88
|
+
<div className="min-h-0 flex-1 overflow-hidden rounded-2xl border border-slate-200/80 shadow-inner dark:border-slate-800/80">
|
|
85
89
|
<BookEditor
|
|
86
90
|
className="h-full w-full"
|
|
87
91
|
agentSource={agentSource}
|
|
@@ -92,7 +96,7 @@ export function NewAgentDialog(props: NewAgentDialogProps) {
|
|
|
92
96
|
height="100%"
|
|
93
97
|
isBorderRadiusDisabled
|
|
94
98
|
isVerbose={false}
|
|
95
|
-
onFileUpload={bookEditorUploadHandler}
|
|
99
|
+
onFileUpload={fileUploadAvailability.isUploadAvailable ? bookEditorUploadHandler : undefined}
|
|
96
100
|
theme={promptbookTheme}
|
|
97
101
|
/>
|
|
98
102
|
</div>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Upload } from 'lucide-react';
|
|
2
2
|
import type { ChangeEvent, Dispatch, KeyboardEvent, RefObject, SetStateAction } from 'react';
|
|
3
|
+
import { FileUploadUnavailableNotice } from '../FileUploadAvailability/FileUploadUnavailableNotice';
|
|
4
|
+
import { useFileUploadAvailability } from '../FileUploadAvailability/FileUploadAvailabilityContext';
|
|
3
5
|
import { NewAgentWizardClassNames } from './NewAgentWizardClassNames';
|
|
4
6
|
import type { NewAgentWizardState } from './NewAgentWizardState';
|
|
5
7
|
import type { NewAgentWizardTranslate } from './NewAgentWizardTranslate';
|
|
@@ -58,6 +60,7 @@ type NewAgentWizardKnowledgeStepProps = {
|
|
|
58
60
|
* @private internal component of <NewAgentWizard/>.
|
|
59
61
|
*/
|
|
60
62
|
export function NewAgentWizardKnowledgeStep(props: NewAgentWizardKnowledgeStepProps) {
|
|
63
|
+
const fileUploadAvailability = useFileUploadAvailability();
|
|
61
64
|
const {
|
|
62
65
|
state,
|
|
63
66
|
setState,
|
|
@@ -80,18 +83,21 @@ export function NewAgentWizardKnowledgeStep(props: NewAgentWizardKnowledgeStepPr
|
|
|
80
83
|
<button
|
|
81
84
|
type="button"
|
|
82
85
|
onClick={() => fileInputRef.current?.click()}
|
|
86
|
+
disabled={!fileUploadAvailability.isUploadAvailable}
|
|
83
87
|
className={NewAgentWizardClassNames.primaryButton}
|
|
84
88
|
>
|
|
85
89
|
<Upload className="h-4 w-4" />
|
|
86
90
|
{t('agentCreation.wizard.uploadAction')}
|
|
87
91
|
</button>
|
|
88
92
|
</div>
|
|
93
|
+
{!fileUploadAvailability.isUploadAvailable && <FileUploadUnavailableNotice className="mt-3" />}
|
|
89
94
|
<input
|
|
90
95
|
ref={fileInputRef}
|
|
91
96
|
type="file"
|
|
92
97
|
multiple
|
|
93
98
|
className="hidden"
|
|
94
99
|
onChange={handleKnowledgeFileSelection}
|
|
100
|
+
disabled={!fileUploadAvailability.isUploadAvailable}
|
|
95
101
|
/>
|
|
96
102
|
</div>
|
|
97
103
|
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
import type { string_book } from '@promptbook-local/types';
|
|
4
4
|
import type { ReactElement } from 'react';
|
|
5
5
|
import { useCallback, useState } from 'react';
|
|
6
|
+
import { appendHeadlessParam, useIsHeadless } from '../_utils/headlessParam';
|
|
6
7
|
import type { AgentVisibility } from '../../utils/agentVisibility';
|
|
8
|
+
import { buildFreshAgentChatHref } from '../../utils/agentRouting/agentRouteHrefs';
|
|
7
9
|
import {
|
|
8
10
|
$createAgentFromBookAction,
|
|
9
11
|
$generateAgentBoilerplateAction,
|
|
@@ -51,9 +53,9 @@ type CreatedAgentPayload = {
|
|
|
51
53
|
*/
|
|
52
54
|
type UseNewAgentDialogOptions = {
|
|
53
55
|
/**
|
|
54
|
-
*
|
|
56
|
+
* Optional callback invoked after the new agent payload is prepared and before navigation starts.
|
|
55
57
|
*/
|
|
56
|
-
readonly onCreated
|
|
58
|
+
readonly onCreated?: (agent: CreatedAgentPayload) => Promise<void> | void;
|
|
57
59
|
/**
|
|
58
60
|
* Optional callback invoked when creating an agent fails.
|
|
59
61
|
*/
|
|
@@ -120,11 +122,27 @@ function extractAgentNameFromBoilerplate(boilerplate: string_book): string {
|
|
|
120
122
|
);
|
|
121
123
|
}
|
|
122
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Creates the navigation payload returned after one agent is persisted.
|
|
127
|
+
*
|
|
128
|
+
* @param agentName - Persisted display name of the agent.
|
|
129
|
+
* @param permanentId - Canonical immutable identifier of the agent.
|
|
130
|
+
* @returns Shared created-agent payload used by all creation surfaces.
|
|
131
|
+
*/
|
|
132
|
+
function createCreatedAgentPayload(agentName: string, permanentId: string): CreatedAgentPayload {
|
|
133
|
+
return {
|
|
134
|
+
agentName,
|
|
135
|
+
permanentId,
|
|
136
|
+
targetPath: buildFreshAgentChatHref(permanentId),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
123
140
|
/**
|
|
124
141
|
* Provides a shared "create new agent" workflow with boilerplate loading and a book-editing dialog.
|
|
125
142
|
*/
|
|
126
143
|
export function useNewAgentDialog(options: UseNewAgentDialogOptions): UseNewAgentDialogResult {
|
|
127
144
|
const { onCreated, onCreateFailed, onPrepareFailed } = options;
|
|
145
|
+
const isHeadless = useIsHeadless();
|
|
128
146
|
const [isPreparingDialog, setIsPreparingDialog] = useState(false);
|
|
129
147
|
const [dialogState, setDialogState] = useState<NewAgentDialogState | null>(null);
|
|
130
148
|
|
|
@@ -132,6 +150,21 @@ export function useNewAgentDialog(options: UseNewAgentDialogOptions): UseNewAgen
|
|
|
132
150
|
setDialogState(null);
|
|
133
151
|
}, []);
|
|
134
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Finalizes one successful creation by hard-navigating to the new chat route.
|
|
155
|
+
*
|
|
156
|
+
* The App Router can transiently keep the just-created dynamic route in a stale not-found
|
|
157
|
+
* state, so new-agent creation intentionally uses a full navigation once the route is ready.
|
|
158
|
+
*/
|
|
159
|
+
const handleCreatedAgent = useCallback(
|
|
160
|
+
async (agent: CreatedAgentPayload) => {
|
|
161
|
+
await onCreated?.(agent);
|
|
162
|
+
setDialogState(null);
|
|
163
|
+
window.location.assign(appendHeadlessParam(agent.targetPath, isHeadless));
|
|
164
|
+
},
|
|
165
|
+
[isHeadless, onCreated],
|
|
166
|
+
);
|
|
167
|
+
|
|
135
168
|
const openNewAgentDialog = useCallback(
|
|
136
169
|
async (openOptions?: OpenNewAgentDialogOptions) => {
|
|
137
170
|
setIsPreparingDialog(true);
|
|
@@ -200,17 +233,12 @@ export function useNewAgentDialog(options: UseNewAgentDialogOptions): UseNewAgen
|
|
|
200
233
|
surface: 'editor',
|
|
201
234
|
folderId: dialogState.targetFolderId,
|
|
202
235
|
});
|
|
203
|
-
await
|
|
204
|
-
agentName,
|
|
205
|
-
permanentId,
|
|
206
|
-
targetPath: `/agents/${encodeURIComponent(permanentId)}`,
|
|
207
|
-
});
|
|
208
|
-
setDialogState(null);
|
|
236
|
+
await handleCreatedAgent(createCreatedAgentPayload(agentName, permanentId));
|
|
209
237
|
} catch (error) {
|
|
210
238
|
await onCreateFailed?.(error);
|
|
211
239
|
}
|
|
212
240
|
},
|
|
213
|
-
[dialogState,
|
|
241
|
+
[dialogState, handleCreatedAgent, onCreateFailed],
|
|
214
242
|
);
|
|
215
243
|
|
|
216
244
|
const handleCreateFromWizard = useCallback(
|
|
@@ -232,17 +260,12 @@ export function useNewAgentDialog(options: UseNewAgentDialogOptions): UseNewAgen
|
|
|
232
260
|
knowledgeCount: request.knowledgeCount,
|
|
233
261
|
});
|
|
234
262
|
|
|
235
|
-
await
|
|
236
|
-
agentName,
|
|
237
|
-
permanentId,
|
|
238
|
-
targetPath: `/agents/${encodeURIComponent(permanentId)}`,
|
|
239
|
-
});
|
|
240
|
-
setDialogState(null);
|
|
263
|
+
await handleCreatedAgent(createCreatedAgentPayload(agentName, permanentId));
|
|
241
264
|
} catch (error) {
|
|
242
265
|
await onCreateFailed?.(error);
|
|
243
266
|
}
|
|
244
267
|
},
|
|
245
|
-
[dialogState,
|
|
268
|
+
[dialogState, handleCreatedAgent, onCreateFailed],
|
|
246
269
|
);
|
|
247
270
|
|
|
248
271
|
const handleOpenEditorFromWizard = useCallback((request: NewAgentWizardOpenEditorRequest) => {
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
type KeyboardEvent,
|
|
10
10
|
type SetStateAction,
|
|
11
11
|
} from 'react';
|
|
12
|
+
import { useFileUploadAvailability } from '../FileUploadAvailability/FileUploadAvailabilityContext';
|
|
12
13
|
import { simplifyKnowledgeLabel } from '../../utils/knowledge/simplifyKnowledgeLabel';
|
|
13
14
|
import { bookEditorUploadHandler } from '../../utils/upload/createBookEditorUploadHandler';
|
|
14
15
|
import {
|
|
@@ -144,6 +145,7 @@ function updateKnowledgeItem(
|
|
|
144
145
|
*/
|
|
145
146
|
export function useNewAgentWizardKnowledgeState(options: UseNewAgentWizardKnowledgeStateOptions) {
|
|
146
147
|
const { state, setState, setStep, knowledgeStepIndex, t } = options;
|
|
148
|
+
const fileUploadAvailability = useFileUploadAvailability();
|
|
147
149
|
const fileInputRef = useRef<HTMLInputElement | null>(null);
|
|
148
150
|
const dragDepthRef = useRef(0);
|
|
149
151
|
const [knowledgeFeedback, setKnowledgeFeedback] = useState<string | null>(null);
|
|
@@ -160,6 +162,11 @@ export function useNewAgentWizardKnowledgeState(options: UseNewAgentWizardKnowle
|
|
|
160
162
|
return;
|
|
161
163
|
}
|
|
162
164
|
|
|
165
|
+
if (!fileUploadAvailability.isUploadAvailable) {
|
|
166
|
+
setKnowledgeFeedback(fileUploadAvailability.message || t('agentCreation.wizard.uploadFailed'));
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
163
170
|
setKnowledgeFeedback(null);
|
|
164
171
|
|
|
165
172
|
for (const file of files) {
|
|
@@ -297,7 +304,7 @@ export function useNewAgentWizardKnowledgeState(options: UseNewAgentWizardKnowle
|
|
|
297
304
|
}
|
|
298
305
|
|
|
299
306
|
event.preventDefault();
|
|
300
|
-
event.dataTransfer.dropEffect = 'copy';
|
|
307
|
+
event.dataTransfer.dropEffect = fileUploadAvailability.isUploadAvailable ? 'copy' : 'none';
|
|
301
308
|
setIsDragOverDialog(true);
|
|
302
309
|
}
|
|
303
310
|
|
|
@@ -53,7 +53,7 @@ export const DEFAULT_AGENT_AVATAR_VISUAL_METADATA_VALUES = DEFAULT_AGENT_AVATAR_
|
|
|
53
53
|
export const DEFAULT_AGENT_AVATAR_VISUAL_METADATA_VALUE =
|
|
54
54
|
DEFAULT_AGENT_AVATAR_VISUAL_METADATA_OPTIONS.find(
|
|
55
55
|
({ visualId }) => visualId === SHARED_DEFAULT_AGENT_AVATAR_VISUAL_ID,
|
|
56
|
-
)?.metadataValue || '
|
|
56
|
+
)?.metadataValue || 'OCTOPUS3D3';
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Resolves one raw metadata value to a supported built-in avatar visual id.
|
|
@@ -32,6 +32,13 @@ export const DEFAULT_SPAWN_AGENT_RATE_LIMIT_MAX = 5;
|
|
|
32
32
|
*/
|
|
33
33
|
export const DEFAULT_SPAWN_AGENT_RATE_LIMIT_WINDOW_MS = 10 * 60 * 1000;
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Default maximum number of failed local runner attempts before a queued message is moved to `messages/failed`.
|
|
37
|
+
*
|
|
38
|
+
* @private shared Agents Server constant
|
|
39
|
+
*/
|
|
40
|
+
export const DEFAULT_LOCAL_AGENT_RUNNER_MAX_FAILED_ATTEMPTS = 3;
|
|
41
|
+
|
|
35
42
|
/**
|
|
36
43
|
* Stable keys used by the dedicated server-limits table.
|
|
37
44
|
*
|
|
@@ -45,6 +52,7 @@ export const SERVER_LIMIT_KEYS = {
|
|
|
45
52
|
SPAWN_AGENT_MAX_DEPTH: 'SPAWN_AGENT_MAX_DEPTH',
|
|
46
53
|
SPAWN_AGENT_RATE_LIMIT_MAX: 'SPAWN_AGENT_RATE_LIMIT_MAX',
|
|
47
54
|
SPAWN_AGENT_RATE_LIMIT_WINDOW_MS: 'SPAWN_AGENT_RATE_LIMIT_WINDOW_MS',
|
|
55
|
+
LOCAL_AGENT_RUNNER_MAX_FAILED_ATTEMPTS: 'LOCAL_AGENT_RUNNER_MAX_FAILED_ATTEMPTS',
|
|
48
56
|
} as const;
|
|
49
57
|
|
|
50
58
|
/**
|
|
@@ -68,7 +76,7 @@ export type ServerLimitUnit = 'count' | 'MB' | 'ms';
|
|
|
68
76
|
*/
|
|
69
77
|
export type ServerLimitDefinition = {
|
|
70
78
|
readonly key: ServerLimitKey;
|
|
71
|
-
readonly category: 'Timeout tools' | 'Files' | 'Federation' | 'Agent spawning';
|
|
79
|
+
readonly category: 'Timeout tools' | 'Files' | 'Federation' | 'Agent spawning' | 'Local agent runner';
|
|
72
80
|
readonly title: string;
|
|
73
81
|
readonly description: string;
|
|
74
82
|
readonly unit: ServerLimitUnit;
|
|
@@ -143,7 +151,8 @@ export const SERVER_LIMIT_DEFINITIONS = [
|
|
|
143
151
|
key: SERVER_LIMIT_KEYS.SPAWN_AGENT_RATE_LIMIT_MAX,
|
|
144
152
|
category: 'Agent spawning',
|
|
145
153
|
title: 'Max spawned agents per window',
|
|
146
|
-
description:
|
|
154
|
+
description:
|
|
155
|
+
'Limits how many persistent agents one actor can create through `spawn_agent` inside one rate-limit window.',
|
|
147
156
|
unit: 'count',
|
|
148
157
|
defaultValue: DEFAULT_SPAWN_AGENT_RATE_LIMIT_MAX,
|
|
149
158
|
minimumValue: 1,
|
|
@@ -161,6 +170,17 @@ export const SERVER_LIMIT_DEFINITIONS = [
|
|
|
161
170
|
step: 1_000,
|
|
162
171
|
legacyMetadataKeys: [],
|
|
163
172
|
},
|
|
173
|
+
{
|
|
174
|
+
key: SERVER_LIMIT_KEYS.LOCAL_AGENT_RUNNER_MAX_FAILED_ATTEMPTS,
|
|
175
|
+
category: 'Local agent runner',
|
|
176
|
+
title: 'Max failed message attempts',
|
|
177
|
+
description: 'Stops the local coding-agent watcher from retrying the same queued chat message forever.',
|
|
178
|
+
unit: 'count',
|
|
179
|
+
defaultValue: DEFAULT_LOCAL_AGENT_RUNNER_MAX_FAILED_ATTEMPTS,
|
|
180
|
+
minimumValue: 1,
|
|
181
|
+
step: 1,
|
|
182
|
+
legacyMetadataKeys: [],
|
|
183
|
+
},
|
|
164
184
|
] satisfies ReadonlyArray<ServerLimitDefinition>;
|
|
165
185
|
|
|
166
186
|
/**
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
INSERT INTO "prefix_Metadata" ("key", "value", "note", "createdAt", "updatedAt")
|
|
2
|
+
SELECT 'DEFAULT_AGENT_AVATAR_VISUAL',
|
|
3
|
+
'OCTOPUS3D3',
|
|
4
|
+
'Default built-in avatar visual used for agents without `META IMAGE` or `META AVATAR`. Allowed values: PIXEL_ART, OCTOPUS, OCTOPUS2, OCTOPUS3, OCTOPUS3D, OCTOPUS3D2, OCTOPUS3D3, ASCII_OCTOPUS, MINECRAFT, MINECRAFT2, FRACTAL, ORB.',
|
|
5
|
+
NOW(),
|
|
6
|
+
NOW()
|
|
7
|
+
WHERE NOT EXISTS (SELECT 1 FROM "prefix_Metadata" WHERE "key" = 'DEFAULT_AGENT_AVATAR_VISUAL');
|
|
8
|
+
|
|
9
|
+
UPDATE "prefix_Metadata"
|
|
10
|
+
SET "value" = CASE
|
|
11
|
+
WHEN UPPER(COALESCE("value", '')) = 'OCTOPUS3' THEN 'OCTOPUS3D3'
|
|
12
|
+
ELSE "value"
|
|
13
|
+
END,
|
|
14
|
+
"note" = 'Default built-in avatar visual used for agents without `META IMAGE` or `META AVATAR`. Allowed values: PIXEL_ART, OCTOPUS, OCTOPUS2, OCTOPUS3, OCTOPUS3D, OCTOPUS3D2, OCTOPUS3D3, ASCII_OCTOPUS, MINECRAFT, MINECRAFT2, FRACTAL, ORB.',
|
|
15
|
+
"updatedAt" = NOW()
|
|
16
|
+
WHERE "key" = 'DEFAULT_AGENT_AVATAR_VISUAL';
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import * as dotenv from 'dotenv';
|
|
2
|
+
import type { SupabaseClient } from '@supabase/supabase-js';
|
|
3
|
+
import { AgentCollectionInSupabase } from '../../../../src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase';
|
|
4
|
+
import type { AgentsDatabaseSchema } from '../../../../src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema';
|
|
5
|
+
import { $provideSupabaseForServer } from './$provideSupabaseForServer';
|
|
6
|
+
import { DEFAULT_AGENT_VISIBILITY } from '../utils/agentVisibility';
|
|
7
|
+
import { loadDefaultAgentBooks } from '../utils/defaultAgents/loadDefaultAgentBooks';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Environment variable pointing to the installed Agents Server `.env` file.
|
|
11
|
+
*
|
|
12
|
+
* @private utility of standalone default-agent seeding
|
|
13
|
+
*/
|
|
14
|
+
const AGENTS_SERVER_ENV_FILE_ENV_NAME = 'PTBK_AGENTS_SERVER_ENV_FILE';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Environment variable with an explicit default-agent source directory.
|
|
18
|
+
*
|
|
19
|
+
* @private utility of standalone default-agent seeding
|
|
20
|
+
*/
|
|
21
|
+
const DEFAULT_AGENTS_DIRECTORY_ENV_NAME = 'PTBK_DEFAULT_AGENTS_DIR';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Environment variable carrying the current Agents Server table prefix.
|
|
25
|
+
*
|
|
26
|
+
* @private utility of standalone default-agent seeding
|
|
27
|
+
*/
|
|
28
|
+
const SUPABASE_TABLE_PREFIX_ENV_NAME = 'SUPABASE_TABLE_PREFIX';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Logger surface used by the default-agent seeder.
|
|
32
|
+
*
|
|
33
|
+
* @private utility of standalone default-agent seeding
|
|
34
|
+
*/
|
|
35
|
+
type SeedDefaultAgentsLogger = Pick<Console, 'error' | 'info' | 'warn'>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Options for installing bundled default agents into the current Agents Server database.
|
|
39
|
+
*
|
|
40
|
+
* @private utility of standalone default-agent seeding
|
|
41
|
+
*/
|
|
42
|
+
export type SeedDefaultAgentsOptions = {
|
|
43
|
+
/**
|
|
44
|
+
* Optional explicit directory containing default `*.book` files.
|
|
45
|
+
*/
|
|
46
|
+
readonly defaultAgentDirectory?: string | null;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Optional table prefix for the server namespace being seeded.
|
|
50
|
+
*/
|
|
51
|
+
readonly tablePrefix?: string | null;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Optional logger for installer output.
|
|
55
|
+
*/
|
|
56
|
+
readonly logger?: SeedDefaultAgentsLogger;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Result of one default-agent seed attempt.
|
|
61
|
+
*
|
|
62
|
+
* @private utility of standalone default-agent seeding
|
|
63
|
+
*/
|
|
64
|
+
export type SeedDefaultAgentsResult = {
|
|
65
|
+
/**
|
|
66
|
+
* Number of agents already present before seeding, including soft-deleted agents.
|
|
67
|
+
*/
|
|
68
|
+
readonly existingAgentCount: number;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Number of bundled default books found.
|
|
72
|
+
*/
|
|
73
|
+
readonly sourceCount: number;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Number of default agents created.
|
|
77
|
+
*/
|
|
78
|
+
readonly createdCount: number;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Names of agents created during this run.
|
|
82
|
+
*/
|
|
83
|
+
readonly createdAgentNames: ReadonlyArray<string>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Reason no agents were created.
|
|
87
|
+
*/
|
|
88
|
+
readonly skippedReason: 'existing-agents' | 'no-default-books' | null;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Installs bundled default agents when the current server has no agents yet.
|
|
93
|
+
*
|
|
94
|
+
* @param options - Optional seed controls.
|
|
95
|
+
* @returns Seed summary.
|
|
96
|
+
*
|
|
97
|
+
* @private utility of standalone default-agent seeding
|
|
98
|
+
*/
|
|
99
|
+
export async function seedDefaultAgents(options: SeedDefaultAgentsOptions = {}): Promise<SeedDefaultAgentsResult> {
|
|
100
|
+
const logger = options.logger ?? console;
|
|
101
|
+
const tablePrefix = options.tablePrefix ?? process.env[SUPABASE_TABLE_PREFIX_ENV_NAME] ?? '';
|
|
102
|
+
const collection = new AgentCollectionInSupabase(resolveAgentsDatabaseSupabaseClient(), { tablePrefix });
|
|
103
|
+
const existingAgentCount = await countExistingAgents(collection);
|
|
104
|
+
|
|
105
|
+
if (existingAgentCount > 0) {
|
|
106
|
+
logger.info(
|
|
107
|
+
`Skipping default agents because the server already has ${existingAgentCount} agent${
|
|
108
|
+
existingAgentCount === 1 ? '' : 's'
|
|
109
|
+
}.`,
|
|
110
|
+
);
|
|
111
|
+
return {
|
|
112
|
+
existingAgentCount,
|
|
113
|
+
sourceCount: 0,
|
|
114
|
+
createdCount: 0,
|
|
115
|
+
createdAgentNames: [],
|
|
116
|
+
skippedReason: 'existing-agents',
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const defaultAgentBooks = await loadDefaultAgentBooks({
|
|
121
|
+
defaultAgentDirectory: options.defaultAgentDirectory ?? process.env[DEFAULT_AGENTS_DIRECTORY_ENV_NAME],
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
if (defaultAgentBooks.length === 0) {
|
|
125
|
+
logger.warn('Skipping default agents because no bundled *.book files were found.');
|
|
126
|
+
return {
|
|
127
|
+
existingAgentCount,
|
|
128
|
+
sourceCount: 0,
|
|
129
|
+
createdCount: 0,
|
|
130
|
+
createdAgentNames: [],
|
|
131
|
+
skippedReason: 'no-default-books',
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const createdAgentNames: Array<string> = [];
|
|
136
|
+
|
|
137
|
+
for (const [index, defaultAgentBook] of defaultAgentBooks.entries()) {
|
|
138
|
+
const createdAgent = await collection.createAgent(defaultAgentBook, {
|
|
139
|
+
sortOrder: index,
|
|
140
|
+
visibility: DEFAULT_AGENT_VISIBILITY,
|
|
141
|
+
});
|
|
142
|
+
createdAgentNames.push(createdAgent.agentName);
|
|
143
|
+
logger.info(`Created default agent: ${createdAgent.agentName}`);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
existingAgentCount,
|
|
148
|
+
sourceCount: defaultAgentBooks.length,
|
|
149
|
+
createdCount: createdAgentNames.length,
|
|
150
|
+
createdAgentNames,
|
|
151
|
+
skippedReason: null,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Counts active and soft-deleted agents so repeated installer runs do not recreate defaults.
|
|
157
|
+
*
|
|
158
|
+
* @param collection - Agent collection bound to the current table prefix.
|
|
159
|
+
* @returns Number of existing active and deleted agents.
|
|
160
|
+
*
|
|
161
|
+
* @private utility of standalone default-agent seeding
|
|
162
|
+
*/
|
|
163
|
+
async function countExistingAgents(collection: AgentCollectionInSupabase): Promise<number> {
|
|
164
|
+
const activeAgents = await collection.listAgents();
|
|
165
|
+
const deletedAgents = await collection.listDeletedAgents();
|
|
166
|
+
|
|
167
|
+
return activeAgents.length + deletedAgents.length;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Resolves the Supabase-shaped client for the Agent collection subset.
|
|
172
|
+
*
|
|
173
|
+
* @returns Supabase client typed for agent collection persistence.
|
|
174
|
+
*
|
|
175
|
+
* @private utility of standalone default-agent seeding
|
|
176
|
+
*/
|
|
177
|
+
function resolveAgentsDatabaseSupabaseClient(): SupabaseClient<AgentsDatabaseSchema> {
|
|
178
|
+
return $provideSupabaseForServer() as unknown as SupabaseClient<AgentsDatabaseSchema>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Loads the installed Agents Server environment before seeding.
|
|
183
|
+
*
|
|
184
|
+
* @private utility of standalone default-agent seeding
|
|
185
|
+
*/
|
|
186
|
+
function loadSeedDefaultAgentsEnvironment(): void {
|
|
187
|
+
const explicitEnvFilePath = process.env[AGENTS_SERVER_ENV_FILE_ENV_NAME]?.trim();
|
|
188
|
+
if (explicitEnvFilePath) {
|
|
189
|
+
const explicitLoadResult = dotenv.config({ path: explicitEnvFilePath });
|
|
190
|
+
if (!explicitLoadResult.error) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
dotenv.config();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Runs the standalone default-agent seed command.
|
|
200
|
+
*
|
|
201
|
+
* @private utility of standalone default-agent seeding
|
|
202
|
+
*/
|
|
203
|
+
async function runSeedDefaultAgentsCommand(): Promise<void> {
|
|
204
|
+
loadSeedDefaultAgentsEnvironment();
|
|
205
|
+
const result = await seedDefaultAgents();
|
|
206
|
+
|
|
207
|
+
if (result.createdCount > 0) {
|
|
208
|
+
console.info(`Installed ${result.createdCount} default agent${result.createdCount === 1 ? '' : 's'}.`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (require.main === module) {
|
|
213
|
+
runSeedDefaultAgentsCommand().catch((error) => {
|
|
214
|
+
console.error('Failed to install default agents:');
|
|
215
|
+
console.error(error instanceof Error ? error.message : error);
|
|
216
|
+
process.exit(1);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
@@ -53,8 +53,9 @@ export const config = {
|
|
|
53
53
|
* - favicon.ico (favicon file)
|
|
54
54
|
* - robots.txt (should not block on middleware DB lookups)
|
|
55
55
|
* - public folder
|
|
56
|
+
* - api/health (standalone VPS readiness probe)
|
|
56
57
|
* - api/internal (worker/cron routes are authorized separately)
|
|
57
58
|
*/
|
|
58
|
-
'/((?!_next/static|_next/image|favicon.ico|logo-|fonts/|robots.txt|api/internal).*)',
|
|
59
|
+
'/((?!_next/static|_next/image|favicon.ico|logo-|fonts/|robots.txt|api/health|api/internal).*)',
|
|
59
60
|
],
|
|
60
61
|
};
|