@promptbook/node 0.113.0-9 → 0.114.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/esm/index.es.js +463 -117
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +6 -1
- package/esm/scripts/run-agent-messages/messages/buildAgentProjectsPromptSection.d.ts +39 -0
- package/esm/scripts/run-codex-prompts/common/waitUntilWorldTimeDeadline.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/runners/openai-codex/parseCodexLoginMethodFromOutput.d.ts +10 -0
- package/esm/src/_packages/components.index.d.ts +8 -0
- package/esm/src/_packages/core.index.d.ts +4 -0
- package/esm/src/_packages/types.index.d.ts +12 -0
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +7 -0
- package/esm/src/book-2.0/agent-source/parseAgentSource/ParsedAgentProfile.d.ts +1 -1
- package/esm/src/book-2.0/book-language-documentation/BookLanguageDocumentationExample.d.ts +5 -13
- package/esm/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +195 -0
- package/esm/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.d.ts +2 -1
- package/esm/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +43 -1
- package/esm/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.d.ts +10 -0
- package/esm/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.d.ts +10 -0
- package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +33 -0
- package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualDictionary.d.ts +15 -0
- package/esm/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +10 -0
- package/esm/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +30 -0
- package/esm/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.d.ts +2 -1
- package/esm/src/book-2.0/book-language-documentation/toStableAnchorId.d.ts +12 -0
- package/esm/src/book-3.0/AgentMessageRunReport.d.ts +78 -0
- package/esm/src/book-3.0/agentFolderPaths.d.ts +9 -0
- package/esm/src/book-3.0/codexLoginMethod.d.ts +38 -0
- package/esm/src/book-components/BookEditor/BookEditorSyntaxTokenStyles.d.ts +39 -0
- package/esm/src/book-components/BookEditor/createBookSourceHighlightStyles.d.ts +12 -0
- package/esm/src/book-components/BookEditor/highlightBookSourceToHtml.d.ts +20 -0
- package/esm/src/book-components/Chat/Chat/ChatCitationModal.d.ts +5 -0
- package/esm/src/book-components/Chat/Chat/ChatCitationModal.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/ChatFeedbackStar.d.ts +37 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +5 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +13 -0
- package/esm/src/book-components/Chat/Chat/ChatRatingModal.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/CitationIframePreview.d.ts +25 -2
- package/esm/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.d.ts +39 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreviewToolbar.d.ts +71 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewInputEvent.d.ts +72 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.d.ts +64 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.test.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewSessionState.d.ts +14 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewViewport.d.ts +37 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/createPagePreviewSessionId.d.ts +20 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.d.ts +13 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.test.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/resolveChatRatingMessageKey.d.ts +8 -0
- package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +2 -0
- package/esm/src/book-components/Chat/SourceChip/SourceChip.test.d.ts +2 -0
- package/esm/src/book-components/Chat/hooks/useResolvedCitationLabel.test.d.ts +2 -0
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +78 -0
- package/esm/src/book-components/Chat/utils/resolveCitationSourceDisplay.d.ts +149 -0
- package/esm/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +9 -0
- package/esm/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -2
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.d.ts +1 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/add.d.ts +36 -0
- package/esm/src/cli/cli-commands/coder/add.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +24 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/createNonNegativeIntegerOptionParser.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +13 -0
- package/esm/src/cli/cli-commands/common/harness/$installHarness.d.ts +13 -0
- package/esm/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +40 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessDefinition.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +35 -0
- package/esm/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +11 -0
- package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/formatHarnessInstallationWarning.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts +1 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.d.ts +18 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.test.d.ts +1 -0
- package/esm/src/commitments/META/META.d.ts +2 -0
- package/esm/src/commitments/META_THINKING_MESSAGE/META_THINKING_MESSAGE.d.ts +26 -0
- package/esm/src/commitments/index.d.ts +2 -1
- package/esm/src/execution/utils/formatUsagePrice.d.ts +12 -0
- package/esm/src/execution/utils/formatUsagePrice.test.d.ts +1 -0
- package/esm/src/utils/agent-message-runtime/agentMessageRuntimePaths.d.ts +24 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +16 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.test.d.ts +1 -0
- package/esm/src/utils/agents/terminalAgentAvatarVisual.d.ts +104 -0
- package/esm/src/utils/agents/terminalAgentAvatarVisual.test.d.ts +1 -0
- package/esm/src/utils/html/escapeHtml.d.ts +9 -0
- package/esm/src/utils/markdown/shiftMarkdownHeadingLevels.d.ts +15 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +463 -117
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +6 -1
- package/umd/scripts/run-agent-messages/messages/buildAgentProjectsPromptSection.d.ts +39 -0
- package/umd/scripts/run-codex-prompts/common/waitUntilWorldTimeDeadline.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/runners/openai-codex/parseCodexLoginMethodFromOutput.d.ts +10 -0
- package/umd/src/_packages/components.index.d.ts +8 -0
- package/umd/src/_packages/core.index.d.ts +4 -0
- package/umd/src/_packages/types.index.d.ts +12 -0
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +7 -0
- package/umd/src/book-2.0/agent-source/parseAgentSource/ParsedAgentProfile.d.ts +1 -1
- package/umd/src/book-2.0/book-language-documentation/BookLanguageDocumentationExample.d.ts +5 -13
- package/umd/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +195 -0
- package/umd/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.d.ts +2 -1
- package/umd/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +43 -1
- package/umd/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.test.d.ts +1 -0
- package/umd/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.d.ts +10 -0
- package/umd/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.d.ts +10 -0
- package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +33 -0
- package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualDictionary.d.ts +15 -0
- package/umd/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +10 -0
- package/umd/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +30 -0
- package/umd/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.d.ts +2 -1
- package/umd/src/book-2.0/book-language-documentation/toStableAnchorId.d.ts +12 -0
- package/umd/src/book-3.0/AgentMessageRunReport.d.ts +78 -0
- package/umd/src/book-3.0/AgentMessageRunReport.test.d.ts +1 -0
- package/umd/src/book-3.0/agentFolderPaths.d.ts +9 -0
- package/umd/src/book-3.0/codexLoginMethod.d.ts +38 -0
- package/umd/src/book-components/BookEditor/BookEditorSyntaxTokenStyles.d.ts +39 -0
- package/umd/src/book-components/BookEditor/createBookSourceHighlightStyles.d.ts +12 -0
- package/umd/src/book-components/BookEditor/highlightBookSourceToHtml.d.ts +20 -0
- package/umd/src/book-components/Chat/Chat/ChatCitationModal.d.ts +5 -0
- package/umd/src/book-components/Chat/Chat/ChatCitationModal.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/ChatFeedbackStar.d.ts +37 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +5 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +13 -0
- package/umd/src/book-components/Chat/Chat/ChatRatingModal.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/CitationIframePreview.d.ts +25 -2
- package/umd/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.d.ts +39 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreviewToolbar.d.ts +71 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewInputEvent.d.ts +72 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.d.ts +64 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.test.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewSessionState.d.ts +14 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewViewport.d.ts +37 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/createPagePreviewSessionId.d.ts +20 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.d.ts +13 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.test.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/resolveChatRatingMessageKey.d.ts +8 -0
- package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +2 -0
- package/umd/src/book-components/Chat/SourceChip/SourceChip.test.d.ts +2 -0
- package/umd/src/book-components/Chat/hooks/useResolvedCitationLabel.test.d.ts +2 -0
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +78 -0
- package/umd/src/book-components/Chat/utils/resolveCitationSourceDisplay.d.ts +149 -0
- package/umd/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +9 -0
- package/umd/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -2
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.d.ts +1 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/add.d.ts +36 -0
- package/umd/src/cli/cli-commands/coder/add.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +24 -0
- package/umd/src/cli/cli-commands/coder.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/createNonNegativeIntegerOptionParser.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +13 -0
- package/umd/src/cli/cli-commands/common/harness/$installHarness.d.ts +13 -0
- package/umd/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +40 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessDefinition.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +35 -0
- package/umd/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +11 -0
- package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/formatHarnessInstallationWarning.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts +1 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.d.ts +18 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.test.d.ts +1 -0
- package/umd/src/commitments/META/META.d.ts +2 -0
- package/umd/src/commitments/META_THINKING_MESSAGE/META_THINKING_MESSAGE.d.ts +26 -0
- package/umd/src/commitments/index.d.ts +2 -1
- package/umd/src/execution/utils/formatUsagePrice.d.ts +12 -0
- package/umd/src/execution/utils/formatUsagePrice.test.d.ts +1 -0
- package/umd/src/utils/agent-message-runtime/agentMessageRuntimePaths.d.ts +24 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +16 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.test.d.ts +1 -0
- package/umd/src/utils/agents/terminalAgentAvatarVisual.d.ts +104 -0
- package/umd/src/utils/agents/terminalAgentAvatarVisual.test.d.ts +1 -0
- package/umd/src/utils/html/escapeHtml.d.ts +9 -0
- package/umd/src/utils/markdown/shiftMarkdownHeadingLevels.d.ts +15 -0
- package/umd/src/version.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/runGoScript/buildTemporaryPromptScriptPath.d.ts +0 -14
- package/esm/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.d.ts +0 -25
- package/esm/src/book-components/_common/react-utils/escapeHtml.d.ts +0 -6
- package/umd/scripts/run-codex-prompts/common/runGoScript/buildTemporaryPromptScriptPath.d.ts +0 -14
- package/umd/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.d.ts +0 -25
- package/umd/src/book-components/_common/react-utils/escapeHtml.d.ts +0 -6
- /package/esm/src/{executables/browsers/locateInternetExplorer.test.d.ts → book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.test.d.ts} +0 -0
- /package/{umd/src/executables/browsers/locateInternetExplorer.test.d.ts → esm/src/book-3.0/AgentMessageRunReport.test.d.ts} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Viewport of one live page-preview browser session, in CSS pixels.
|
|
3
|
+
*
|
|
4
|
+
* @private type shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
5
|
+
*/
|
|
6
|
+
export type PagePreviewViewport = {
|
|
7
|
+
readonly width: number;
|
|
8
|
+
readonly height: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Smallest viewport accepted for one live page-preview browser session.
|
|
12
|
+
*
|
|
13
|
+
* @private constant shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
14
|
+
*/
|
|
15
|
+
export declare const PAGE_PREVIEW_MIN_VIEWPORT: PagePreviewViewport;
|
|
16
|
+
/**
|
|
17
|
+
* Largest viewport accepted for one live page-preview browser session.
|
|
18
|
+
*
|
|
19
|
+
* @private constant shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
20
|
+
*/
|
|
21
|
+
export declare const PAGE_PREVIEW_MAX_VIEWPORT: PagePreviewViewport;
|
|
22
|
+
/**
|
|
23
|
+
* Viewport used when the client did not measure its preview area yet.
|
|
24
|
+
*
|
|
25
|
+
* @private constant shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
26
|
+
*/
|
|
27
|
+
export declare const PAGE_PREVIEW_DEFAULT_VIEWPORT: PagePreviewViewport;
|
|
28
|
+
/**
|
|
29
|
+
* Clamps one requested page-preview viewport into the supported bounds.
|
|
30
|
+
*
|
|
31
|
+
* @param width - Requested viewport width.
|
|
32
|
+
* @param height - Requested viewport height.
|
|
33
|
+
* @returns Rounded viewport within the supported bounds, or `null` when the values are not finite numbers.
|
|
34
|
+
*
|
|
35
|
+
* @private utility shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
36
|
+
*/
|
|
37
|
+
export declare function clampPagePreviewViewport(width: unknown, height: unknown): PagePreviewViewport | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefix of every live page-preview browser session id.
|
|
3
|
+
*
|
|
4
|
+
* @private constant shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
5
|
+
*/
|
|
6
|
+
export declare const PAGE_PREVIEW_SESSION_ID_PREFIX = "page-preview-";
|
|
7
|
+
/**
|
|
8
|
+
* Pattern accepted for client-created page-preview session identifiers.
|
|
9
|
+
*
|
|
10
|
+
* @private constant shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
11
|
+
*/
|
|
12
|
+
export declare const PAGE_PREVIEW_SESSION_ID_PATTERN: RegExp;
|
|
13
|
+
/**
|
|
14
|
+
* Creates one client-side page-preview browser session id.
|
|
15
|
+
*
|
|
16
|
+
* @returns Session id accepted by the Agents Server page-preview routes.
|
|
17
|
+
*
|
|
18
|
+
* @private utility of `<LiveBrowserPreview/>`
|
|
19
|
+
*/
|
|
20
|
+
export declare function createPagePreviewSessionId(): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PagePreviewInputEvent } from './PagePreviewInputEvent';
|
|
2
|
+
/**
|
|
3
|
+
* Validates and normalizes one untrusted page-preview input payload into a typed input event.
|
|
4
|
+
*
|
|
5
|
+
* Note: This performs only structural validation shared by client and server — the Agents Server
|
|
6
|
+
* additionally re-checks `goto` URLs against private/internal targets before navigating.
|
|
7
|
+
*
|
|
8
|
+
* @param payload - Unknown JSON payload (usually the parsed request body).
|
|
9
|
+
* @returns Normalized input event or `null` when the payload is invalid.
|
|
10
|
+
*
|
|
11
|
+
* @private utility shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
12
|
+
*/
|
|
13
|
+
export declare function normalizePagePreviewInputEvent(payload: unknown): PagePreviewInputEvent | null;
|
package/esm/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { id } from '../../../types/string_token';
|
|
2
|
+
import type { ChatMessage } from '../types/ChatMessage';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the stable key used for local chat feedback state.
|
|
5
|
+
*
|
|
6
|
+
* @private utility of `<Chat/>`
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveChatRatingMessageKey(message: Pick<ChatMessage, 'id' | 'content'>): id;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { string_markdown } from '../../../types/string_markdown';
|
|
3
|
+
import type { MarkdownInlineReference } from '../utils/renderMarkdown';
|
|
3
4
|
/**
|
|
4
5
|
* Props for markdown content.
|
|
5
6
|
*/
|
|
6
7
|
type MarkdownContentProps = {
|
|
7
8
|
content: string_markdown;
|
|
8
9
|
className?: string;
|
|
10
|
+
inlineReferences?: ReadonlyArray<MarkdownInlineReference>;
|
|
9
11
|
onCreateAgent?: (bookContent: string) => void;
|
|
10
12
|
theme?: 'LIGHT' | 'DARK';
|
|
11
13
|
};
|
|
@@ -4,6 +4,84 @@ import type { string_html, string_markdown } from '../../../types/string_markdow
|
|
|
4
4
|
*/
|
|
5
5
|
type RenderMarkdownOptions = {
|
|
6
6
|
readonly citationReferenceClassName?: string;
|
|
7
|
+
readonly inlineReferences?: ReadonlyArray<MarkdownInlineReference>;
|
|
8
|
+
readonly inlineReferenceClassName?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* One inline markdown reference converted from `[[reference]]` into a safe link chip.
|
|
12
|
+
*
|
|
13
|
+
* @public exported from `@promptbook/components`
|
|
14
|
+
*/
|
|
15
|
+
export type MarkdownInlineReference = {
|
|
16
|
+
/**
|
|
17
|
+
* Raw reference text between `[[` and `]]`.
|
|
18
|
+
*/
|
|
19
|
+
readonly reference: string;
|
|
20
|
+
/**
|
|
21
|
+
* Human-readable label rendered inside the link chip.
|
|
22
|
+
*/
|
|
23
|
+
readonly label: string;
|
|
24
|
+
/**
|
|
25
|
+
* Link target for the rendered reference.
|
|
26
|
+
*/
|
|
27
|
+
readonly href: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional hover title for the rendered reference.
|
|
30
|
+
*/
|
|
31
|
+
readonly title?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Optional expandable menu shown when the reference chip is clicked.
|
|
34
|
+
*/
|
|
35
|
+
readonly menu?: MarkdownInlineReferenceMenu;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Status displayed alongside an expandable markdown inline reference.
|
|
39
|
+
*
|
|
40
|
+
* @public exported from `@promptbook/components`
|
|
41
|
+
*/
|
|
42
|
+
export type MarkdownInlineReferenceMenuStatus = {
|
|
43
|
+
/**
|
|
44
|
+
* Accessible text describing the current reference status.
|
|
45
|
+
*/
|
|
46
|
+
readonly label: string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the status should be rendered as active.
|
|
49
|
+
*/
|
|
50
|
+
readonly isActive: boolean;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* One destination in an expandable markdown inline reference menu.
|
|
54
|
+
*
|
|
55
|
+
* @public exported from `@promptbook/components`
|
|
56
|
+
*/
|
|
57
|
+
export type MarkdownInlineReferenceMenuOption = {
|
|
58
|
+
/**
|
|
59
|
+
* Text rendered for the option.
|
|
60
|
+
*/
|
|
61
|
+
readonly label: string;
|
|
62
|
+
/**
|
|
63
|
+
* New-tab destination, or `null` while the option is unavailable.
|
|
64
|
+
*/
|
|
65
|
+
readonly href: string | null;
|
|
66
|
+
/**
|
|
67
|
+
* Optional hover text for the option.
|
|
68
|
+
*/
|
|
69
|
+
readonly title?: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Expandable menu configuration for a markdown inline reference.
|
|
73
|
+
*
|
|
74
|
+
* @public exported from `@promptbook/components`
|
|
75
|
+
*/
|
|
76
|
+
export type MarkdownInlineReferenceMenu = {
|
|
77
|
+
/**
|
|
78
|
+
* Current reference status shown in the chip and menu.
|
|
79
|
+
*/
|
|
80
|
+
readonly status: MarkdownInlineReferenceMenuStatus;
|
|
81
|
+
/**
|
|
82
|
+
* New-tab actions listed in the expanded menu.
|
|
83
|
+
*/
|
|
84
|
+
readonly options: ReadonlyArray<MarkdownInlineReferenceMenuOption>;
|
|
7
85
|
};
|
|
8
86
|
/**
|
|
9
87
|
* Convert markdown content to HTML.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { ParsedCitation } from './parseCitationsFromContent';
|
|
2
|
+
/**
|
|
3
|
+
* Broad source category used by chat citation chips.
|
|
4
|
+
*
|
|
5
|
+
* @private utility type of `<Chat/>` citation rendering
|
|
6
|
+
*/
|
|
7
|
+
export type CitationSourceKind = 'archive' | 'audio' | 'code' | 'document' | 'file' | 'image' | 'json' | 'plain-text' | 'presentation' | 'spreadsheet' | 'table' | 'video' | 'website';
|
|
8
|
+
/**
|
|
9
|
+
* Image subtype when the citation source carries enough information to identify it.
|
|
10
|
+
*
|
|
11
|
+
* @private utility type of `<Chat/>` citation rendering
|
|
12
|
+
*/
|
|
13
|
+
export type CitationImageFormat = 'avif' | 'gif' | 'image' | 'jpeg' | 'png' | 'svg' | 'webp';
|
|
14
|
+
/**
|
|
15
|
+
* Render-ready metadata for one citation source.
|
|
16
|
+
*
|
|
17
|
+
* @private utility type of `<Chat/>` citation rendering
|
|
18
|
+
*/
|
|
19
|
+
export type CitationSourceDisplay = {
|
|
20
|
+
/**
|
|
21
|
+
* Broad source category.
|
|
22
|
+
*/
|
|
23
|
+
readonly kind: CitationSourceKind;
|
|
24
|
+
/**
|
|
25
|
+
* Human-readable fallback label used before optional host metadata resolution.
|
|
26
|
+
*/
|
|
27
|
+
readonly label: string;
|
|
28
|
+
/**
|
|
29
|
+
* Best known HTTP(S) target for previews and URL snippets.
|
|
30
|
+
*/
|
|
31
|
+
readonly targetUrl?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Image URL that can be rendered as a thumbnail.
|
|
34
|
+
*/
|
|
35
|
+
readonly thumbnailUrl?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Lower-cased file extension when one is known.
|
|
38
|
+
*/
|
|
39
|
+
readonly extension?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Image subtype when known.
|
|
42
|
+
*/
|
|
43
|
+
readonly imageFormat?: CitationImageFormat;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Internal source signature before final labels/preview URLs are resolved.
|
|
47
|
+
*
|
|
48
|
+
* @private utility type of `<Chat/>` citation rendering
|
|
49
|
+
*/
|
|
50
|
+
export type CitationSourceSignature = {
|
|
51
|
+
/**
|
|
52
|
+
* Broad source category.
|
|
53
|
+
*/
|
|
54
|
+
readonly kind: CitationSourceKind;
|
|
55
|
+
/**
|
|
56
|
+
* Image subtype when known.
|
|
57
|
+
*/
|
|
58
|
+
readonly imageFormat?: CitationImageFormat;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Resolves render-ready source metadata for one citation.
|
|
62
|
+
*
|
|
63
|
+
* @param citation - Citation metadata from a rendered chat message.
|
|
64
|
+
* @returns Display label, source category, and optional preview URLs.
|
|
65
|
+
*
|
|
66
|
+
* @private utility of `<Chat/>` citation rendering
|
|
67
|
+
*/
|
|
68
|
+
export declare function resolveCitationSourceDisplay(citation: ParsedCitation): CitationSourceDisplay;
|
|
69
|
+
/**
|
|
70
|
+
* Returns whether the provided value is a valid HTTP(S) URL.
|
|
71
|
+
*
|
|
72
|
+
* @param value - Candidate string to inspect.
|
|
73
|
+
* @returns True when the value parses as an HTTP or HTTPS URL.
|
|
74
|
+
*
|
|
75
|
+
* @private utility of `<Chat/>` citation rendering
|
|
76
|
+
*/
|
|
77
|
+
export declare function isCitationSourceUrl(value: string): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Determines whether a citation should be displayed as a text snippet instead of a file/URL.
|
|
80
|
+
*
|
|
81
|
+
* @param citation - Parsed citation metadata.
|
|
82
|
+
* @returns True when the citation looks like inline text instead of a document or URL.
|
|
83
|
+
*
|
|
84
|
+
* @private utility of `<Chat/>` citation rendering
|
|
85
|
+
*/
|
|
86
|
+
export declare function isPlainTextCitationSource(citation: ParsedCitation): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Creates a readable fallback label from a citation source when no title metadata is available.
|
|
89
|
+
*
|
|
90
|
+
* @param source - Raw citation source value.
|
|
91
|
+
* @returns Human-friendly source label.
|
|
92
|
+
*
|
|
93
|
+
* @private utility of `<Chat/>` citation rendering
|
|
94
|
+
*/
|
|
95
|
+
export declare function createReadableCitationSourceDisplayLabel(source: string): string;
|
|
96
|
+
/**
|
|
97
|
+
* Creates a compact host/path label for URL-backed file citations.
|
|
98
|
+
*
|
|
99
|
+
* @param rawUrl - Raw URL value.
|
|
100
|
+
* @returns URL snippet such as `github.com/.../source.json`, or null for invalid URLs.
|
|
101
|
+
*
|
|
102
|
+
* @private utility of `<Chat/>` citation rendering
|
|
103
|
+
*/
|
|
104
|
+
export declare function createCitationUrlSnippet(rawUrl: string): string | null;
|
|
105
|
+
/**
|
|
106
|
+
* Resolves a source signature from a file extension.
|
|
107
|
+
*
|
|
108
|
+
* @param extension - Lower- or mixed-case file extension.
|
|
109
|
+
* @returns Source signature or null for unknown extensions.
|
|
110
|
+
*
|
|
111
|
+
* @private utility of `<Chat/>` citation rendering
|
|
112
|
+
*/
|
|
113
|
+
export declare function resolveCitationSourceSignatureFromFileExtension(extension: string | null | undefined): CitationSourceSignature | null;
|
|
114
|
+
/**
|
|
115
|
+
* Resolves a source signature from an HTTP content type.
|
|
116
|
+
*
|
|
117
|
+
* @param contentType - Raw Content-Type header value.
|
|
118
|
+
* @returns Source signature or null when the content type is not specific enough.
|
|
119
|
+
*
|
|
120
|
+
* @private utility of `<Chat/>` citation rendering
|
|
121
|
+
*/
|
|
122
|
+
export declare function resolveCitationSourceSignatureFromContentType(contentType: string): CitationSourceSignature | null;
|
|
123
|
+
/**
|
|
124
|
+
* Resolves a source signature from decoded source text.
|
|
125
|
+
*
|
|
126
|
+
* @param source - Raw citation source text.
|
|
127
|
+
* @returns Source signature for JSON/binary-like source text, otherwise null.
|
|
128
|
+
*
|
|
129
|
+
* @private utility of `<Chat/>` citation rendering
|
|
130
|
+
*/
|
|
131
|
+
export declare function resolveRawCitationSourceSignature(source: string): CitationSourceSignature | null;
|
|
132
|
+
/**
|
|
133
|
+
* Resolves a source signature from response bytes.
|
|
134
|
+
*
|
|
135
|
+
* @param bytes - Leading response bytes.
|
|
136
|
+
* @returns Source signature for known binary formats, otherwise null.
|
|
137
|
+
*
|
|
138
|
+
* @private utility of `<Chat/>` citation rendering
|
|
139
|
+
*/
|
|
140
|
+
export declare function resolveCitationSourceSignatureFromBytes(bytes: Uint8Array): CitationSourceSignature | null;
|
|
141
|
+
/**
|
|
142
|
+
* Creates a generic fallback label for a source signature.
|
|
143
|
+
*
|
|
144
|
+
* @param signature - Source signature.
|
|
145
|
+
* @returns Human-readable fallback label.
|
|
146
|
+
*
|
|
147
|
+
* @private utility of `<Chat/>` citation rendering
|
|
148
|
+
*/
|
|
149
|
+
export declare function createCitationSourceSignatureFallbackLabel(signature: CitationSourceSignature): string;
|
|
@@ -7,6 +7,15 @@
|
|
|
7
7
|
* @private internal helper for Promptbook chat placeholders
|
|
8
8
|
*/
|
|
9
9
|
export declare function normalizeThinkingMessageVariants(thinkingMessages?: ReadonlyArray<string>): ReadonlyArray<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Parses configured thinking-message variants without applying default fallbacks.
|
|
12
|
+
*
|
|
13
|
+
* @param thinkingMessages Raw thinking-message variants.
|
|
14
|
+
* @returns Trimmed non-empty variants.
|
|
15
|
+
*
|
|
16
|
+
* @private internal helper for Promptbook chat placeholders
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseThinkingMessageVariants(thinkingMessages?: ReadonlyArray<string> | null): ReadonlyArray<string>;
|
|
10
19
|
/**
|
|
11
20
|
* Returns a random delay used between browser-side thinking-message rotations.
|
|
12
21
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AGENT_BOOK_FILE_PATH, AGENT_FAILED_MESSAGES_DIRECTORY_PATH, AGENT_FINISHED_MESSAGES_DIRECTORY_PATH, AGENT_MESSAGES_DIRECTORY_PATH, AGENT_QUEUED_MESSAGES_DIRECTORY_PATH } from '../../../book-3.0/agentFolderPaths';
|
|
2
|
-
export { AGENT_BOOK_FILE_PATH, AGENT_FAILED_MESSAGES_DIRECTORY_PATH, AGENT_FINISHED_MESSAGES_DIRECTORY_PATH, AGENT_MESSAGES_DIRECTORY_PATH, AGENT_QUEUED_MESSAGES_DIRECTORY_PATH, };
|
|
1
|
+
import { AGENT_BOOK_FILE_PATH, AGENT_FAILED_MESSAGES_DIRECTORY_PATH, AGENT_FINISHED_MESSAGES_DIRECTORY_PATH, AGENT_MESSAGES_DIRECTORY_PATH, AGENT_PROJECTS_DIRECTORY_PATH, AGENT_QUEUED_MESSAGES_DIRECTORY_PATH } from '../../../book-3.0/agentFolderPaths';
|
|
2
|
+
export { AGENT_BOOK_FILE_PATH, AGENT_FAILED_MESSAGES_DIRECTORY_PATH, AGENT_FINISHED_MESSAGES_DIRECTORY_PATH, AGENT_MESSAGES_DIRECTORY_PATH, AGENT_PROJECTS_DIRECTORY_PATH, AGENT_QUEUED_MESSAGES_DIRECTORY_PATH, };
|
|
3
3
|
/**
|
|
4
4
|
* Relative path to local knowledge files initialized by `ptbk agent-folder init`.
|
|
5
5
|
*
|
package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { number_port } from '../../../../types/number_positive';
|
|
|
6
6
|
* @private internal type of `startAgentsServer`
|
|
7
7
|
*/
|
|
8
8
|
export type AgentsServerChildEnvironment = NodeJS.ProcessEnv & {
|
|
9
|
+
readonly PTBK_AGENTS_SERVER_URL: string;
|
|
9
10
|
readonly PTBK_AGENTS_SERVER_USER_CHAT_WORKER_TOKEN: string;
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PreparedAgentsServerRuntime } from '../buildAgentsServer';
|
|
1
|
+
import type { PreparedAgentsServerRuntime } from '../buildAgentsServer/PreparedAgentsServerRuntime';
|
|
2
2
|
import type { AgentsServerChildEnvironment } from './AgentsServerChildEnvironment';
|
|
3
3
|
import type { AgentsServerRuntimePaths } from './AgentsServerRuntimePaths';
|
|
4
4
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { WriteStream } from 'fs';
|
|
3
|
-
import {
|
|
3
|
+
import type { AgentsServerSupervisorState } from './AgentsServerSupervisorState';
|
|
4
4
|
/**
|
|
5
5
|
* Persists one child output chunk and forwards readable lines into UI or plain output.
|
|
6
6
|
*
|
|
@@ -3,7 +3,7 @@ import { type ChildProcess } from 'child_process';
|
|
|
3
3
|
import type { AgentsServerChildEnvironment } from './AgentsServerChildEnvironment';
|
|
4
4
|
import type { AgentsServerLogStreams } from './AgentsServerLogStreams';
|
|
5
5
|
import type { AgentsServerRuntimePaths } from './AgentsServerRuntimePaths';
|
|
6
|
-
import {
|
|
6
|
+
import type { AgentsServerSupervisorState } from './AgentsServerSupervisorState';
|
|
7
7
|
import type { StartAgentsServerOptions } from './StartAgentsServerOptions';
|
|
8
8
|
/**
|
|
9
9
|
* Starts the configured Next server mode and wires its logs into the foreground dashboard.
|
package/esm/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { number_port } from '../../../../types/number_positive';
|
|
2
2
|
import type { AgentsServerChildEnvironment } from './AgentsServerChildEnvironment';
|
|
3
3
|
import type { AgentsServerLogStreams } from './AgentsServerLogStreams';
|
|
4
|
-
import {
|
|
4
|
+
import type { AgentsServerSupervisorState } from './AgentsServerSupervisorState';
|
|
5
5
|
/**
|
|
6
6
|
* Starts periodic internal worker calls that queue and reconcile local message-folder jobs.
|
|
7
7
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StartAgentsServerOptions } from './startAgentsServer/StartAgentsServerOptions';
|
|
2
2
|
export { loadAgentsServerProjectEnvironment } from './startAgentsServer/loadAgentsServerProjectEnvironment';
|
|
3
|
-
export type { AgentsServerNextRuntimeMode, StartAgentsServerOptions } from './startAgentsServer/StartAgentsServerOptions';
|
|
3
|
+
export type { AgentsServerNextRuntimeMode, StartAgentsServerOptions, } from './startAgentsServer/StartAgentsServerOptions';
|
|
4
4
|
/**
|
|
5
5
|
* Starts the Agents Server web app and local coding-agent queue workers in the foreground.
|
|
6
6
|
*
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
3
|
+
/**
|
|
4
|
+
* Initializes `coder add` command for Promptbook CLI utilities
|
|
5
|
+
*
|
|
6
|
+
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
7
|
+
*
|
|
8
|
+
* @private internal function of `promptbookCli`
|
|
9
|
+
*/
|
|
10
|
+
export declare function $initializeCoderAddCommand(program: Program): $side_effect;
|
|
11
|
+
/**
|
|
12
|
+
* Result of adding one prompt file with `coder add`.
|
|
13
|
+
*
|
|
14
|
+
* @private internal utility of `coder add` command
|
|
15
|
+
*/
|
|
16
|
+
export type AddCoderPromptResult = {
|
|
17
|
+
/**
|
|
18
|
+
* Project-relative path of the created prompt file.
|
|
19
|
+
*/
|
|
20
|
+
readonly filePath: string;
|
|
21
|
+
/**
|
|
22
|
+
* Emoji tag assigned to the created prompt, for example `[✨🪴]`.
|
|
23
|
+
*/
|
|
24
|
+
readonly emojiTag: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Adds one ready-to-run prompt file containing a single prompt built from the description and template.
|
|
28
|
+
*
|
|
29
|
+
* @private internal utility of `coder add` command
|
|
30
|
+
*/
|
|
31
|
+
export declare function addCoderPrompt({ projectPath, description, priority, templateOption, }: {
|
|
32
|
+
readonly projectPath: string;
|
|
33
|
+
readonly description: string;
|
|
34
|
+
readonly priority: number;
|
|
35
|
+
readonly templateOption?: string;
|
|
36
|
+
}): Promise<AddCoderPromptResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -135,3 +135,27 @@ export declare function resolveCoderPromptTemplate({ projectPath, templateOption
|
|
|
135
135
|
readonly projectPath: string;
|
|
136
136
|
readonly templateOption?: string;
|
|
137
137
|
}): Promise<ResolvedCoderPromptTemplate>;
|
|
138
|
+
/**
|
|
139
|
+
* Builds one prompt section (status line, emoji-tagged title, and body) shared by
|
|
140
|
+
* `coder generate-boilerplates` and `coder add`.
|
|
141
|
+
*
|
|
142
|
+
* @private internal utility of `ptbk coder`
|
|
143
|
+
*/
|
|
144
|
+
export declare function buildCoderPromptSection({ statusLine, emojiTag, title, body, }: {
|
|
145
|
+
/**
|
|
146
|
+
* Checklist status marker of the section, for example `[-]`, `[ ]`, or `[ ] !!`.
|
|
147
|
+
*/
|
|
148
|
+
readonly statusLine: string;
|
|
149
|
+
/**
|
|
150
|
+
* Emoji tag rendered before the title, for example `[✨🪴]`.
|
|
151
|
+
*/
|
|
152
|
+
readonly emojiTag: string;
|
|
153
|
+
/**
|
|
154
|
+
* Single-line title rendered right after the emoji tag.
|
|
155
|
+
*/
|
|
156
|
+
readonly title: string;
|
|
157
|
+
/**
|
|
158
|
+
* Markdown body rendered below the title.
|
|
159
|
+
*/
|
|
160
|
+
readonly body: string;
|
|
161
|
+
}): string;
|
|
@@ -5,6 +5,7 @@ import type { $side_effect } from '../../utils/organization/$side_effect';
|
|
|
5
5
|
*
|
|
6
6
|
* The coder command provides utilities for automated coding:
|
|
7
7
|
* - init: Initialize coder configuration in current project
|
|
8
|
+
* - add: Add one ready-to-run prompt file to the queue
|
|
8
9
|
* - generate-boilerplates: Generate prompt boilerplate files
|
|
9
10
|
* - find-refactor-candidates: Find files that need refactoring
|
|
10
11
|
* - run: Run coding prompts with AI agents
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a Commander argument parser that accepts only non-negative integers.
|
|
3
|
+
*
|
|
4
|
+
* The returned parser is meant to be passed as the coercion callback of `command.option(...)`.
|
|
5
|
+
* It throws a branded `NotAllowed` error with a clear message referencing the given option name
|
|
6
|
+
* when the provided value is not a non-negative integer.
|
|
7
|
+
*
|
|
8
|
+
* @private internal utility of `promptbookCli`
|
|
9
|
+
*/
|
|
10
|
+
export declare function createNonNegativeIntegerOptionParser(optionName: string): (value: string) => number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HarnessInstallationStatus } from './HarnessInstallationStatus';
|
|
2
|
+
/**
|
|
3
|
+
* Reports one detected harness installation status and offers to install or update the harness.
|
|
4
|
+
*
|
|
5
|
+
* Note: `$` is used to indicate that this function is not a pure function - it asks the user and installs npm packages
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `promptbookCli`
|
|
8
|
+
*/
|
|
9
|
+
export declare function $applyHarnessInstallationStatus(status: HarnessInstallationStatus): Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asks the user in the terminal whether the harness should be installed or updated right now.
|
|
3
|
+
*
|
|
4
|
+
* Note: `$` is used to indicate that this function is not a pure function - it reads the answer from stdin
|
|
5
|
+
*
|
|
6
|
+
* @returns `true` when the user confirms, `false` when the user declines or the terminal is not interactive
|
|
7
|
+
* @private internal utility of `promptbookCli`
|
|
8
|
+
*/
|
|
9
|
+
export declare function $askForHarnessInstallationApproval(question: string): Promise<boolean>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
|
+
import type { HarnessInstallationStatus } from './HarnessInstallationStatus';
|
|
3
|
+
/**
|
|
4
|
+
* Detects whether one CLI coding harness is installed globally and whether it is up to date.
|
|
5
|
+
*
|
|
6
|
+
* Note: `$` is used to indicate that this function is not a pure function - it runs the harness command and queries npm
|
|
7
|
+
*
|
|
8
|
+
* @private internal utility of `promptbookCli`
|
|
9
|
+
*/
|
|
10
|
+
export declare function $checkHarnessInstallation(definition: HarnessDefinition): Promise<HarnessInstallationStatus>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PromptRunnerHarnessName } from '../promptRunnerCliOptions';
|
|
2
|
+
/**
|
|
3
|
+
* Checks that every given CLI coding harness is installed globally and up to date and offers to
|
|
4
|
+
* install or update the ones which are not.
|
|
5
|
+
*
|
|
6
|
+
* Harness names which are `undefined`, for example when no `--harness` is selected in a dry run,
|
|
7
|
+
* are ignored so that every call site can pass its raw selection.
|
|
8
|
+
*
|
|
9
|
+
* Note: `$` is used to indicate that this function is not a pure function - it may install npm packages
|
|
10
|
+
*
|
|
11
|
+
* @private internal utility of `promptbookCli`
|
|
12
|
+
*/
|
|
13
|
+
export declare function $ensureHarnessInstallations(harnessNames: ReadonlyArray<PromptRunnerHarnessName | undefined>): Promise<void>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
|
+
/**
|
|
3
|
+
* Installs or updates one CLI coding harness globally through npm.
|
|
4
|
+
*
|
|
5
|
+
* A failed installation is reported but never aborts the running command, because the harness check
|
|
6
|
+
* is only an assistant - the command itself may still work with a manually managed harness.
|
|
7
|
+
*
|
|
8
|
+
* Note: `$` is used to indicate that this function is not a pure function - it installs a global npm package
|
|
9
|
+
*
|
|
10
|
+
* @returns `true` when the harness has been installed, `false` when the installation failed
|
|
11
|
+
* @private internal utility of `promptbookCli`
|
|
12
|
+
*/
|
|
13
|
+
export declare function $installHarness(definition: HarnessDefinition): Promise<boolean>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
|
+
/**
|
|
3
|
+
* Reads the version of the globally installed harness command.
|
|
4
|
+
*
|
|
5
|
+
* Note: `$` is used to indicate that this function is not a pure function - it runs the harness command
|
|
6
|
+
*
|
|
7
|
+
* @returns The installed version or `null` when the harness command is not available globally
|
|
8
|
+
* @private internal utility of `promptbookCli`
|
|
9
|
+
*/
|
|
10
|
+
export declare function $resolveInstalledHarnessVersion(definition: HarnessDefinition): Promise<string | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
|
+
/**
|
|
3
|
+
* Reads the newest version of the harness published to npm.
|
|
4
|
+
*
|
|
5
|
+
* Note: `$` is used to indicate that this function is not a pure function - it queries the npm registry
|
|
6
|
+
*
|
|
7
|
+
* @returns The newest published version or `null` when the registry could not be reached
|
|
8
|
+
* @private internal utility of `promptbookCli`
|
|
9
|
+
*/
|
|
10
|
+
export declare function $resolveLatestHarnessVersion(definition: HarnessDefinition): Promise<string | null>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { PromptRunnerHarnessName } from '../promptRunnerCliOptions';
|
|
2
|
+
/**
|
|
3
|
+
* Static description of one supported CLI coding harness.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `promptbookCli`
|
|
6
|
+
*/
|
|
7
|
+
export type HarnessDefinition = {
|
|
8
|
+
/**
|
|
9
|
+
* Harness identifier used by the `--harness` option.
|
|
10
|
+
*/
|
|
11
|
+
readonly harnessName: PromptRunnerHarnessName;
|
|
12
|
+
/**
|
|
13
|
+
* Human-readable harness name shown in the terminal.
|
|
14
|
+
*/
|
|
15
|
+
readonly label: string;
|
|
16
|
+
/**
|
|
17
|
+
* Globally installed command which runs the harness.
|
|
18
|
+
*/
|
|
19
|
+
readonly commandName: string;
|
|
20
|
+
/**
|
|
21
|
+
* Npm package which installs the harness command globally.
|
|
22
|
+
*/
|
|
23
|
+
readonly npmPackageName: string;
|
|
24
|
+
/**
|
|
25
|
+
* Extra environment variables required by the global npm installation of this harness.
|
|
26
|
+
*/
|
|
27
|
+
readonly npmInstallEnvironment?: Readonly<Record<string, string>>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Single source of truth about how each supported CLI coding harness is installed and detected.
|
|
31
|
+
*
|
|
32
|
+
* @private internal utility of `promptbookCli`
|
|
33
|
+
*/
|
|
34
|
+
export declare const HARNESS_DEFINITIONS: Readonly<Record<PromptRunnerHarnessName, HarnessDefinition>>;
|
|
35
|
+
/**
|
|
36
|
+
* Looks up the definition of one supported CLI coding harness.
|
|
37
|
+
*
|
|
38
|
+
* @private internal utility of `promptbookCli`
|
|
39
|
+
*/
|
|
40
|
+
export declare function getHarnessDefinition(harnessName: PromptRunnerHarnessName): HarnessDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|