@promptbook/google 0.112.0-72 → 0.112.0-79
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 +9 -9
- package/esm/index.es.js +310 -204
- package/esm/index.es.js.map +1 -1
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/esm/src/avatars/visuals/octopus3d2AvatarVisual.d.ts +7 -0
- package/esm/src/avatars/visuals/octopus3dAvatarVisualShared.d.ts +37 -0
- package/esm/src/book-components/Chat/save/_common/chatExportRendering.d.ts +75 -0
- package/esm/src/book-components/Chat/save/_common/getPromptbookExportBranding.d.ts +18 -0
- package/esm/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +13 -1
- package/esm/src/book-components/Chat/save/html/htmlSaveFormatDefinition.test.d.ts +1 -0
- package/esm/src/book-components/Chat/save/index.d.ts +5 -5
- package/esm/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.d.ts +5 -3
- package/esm/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.test.d.ts +1 -0
- package/esm/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +4 -3
- package/esm/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +3 -3
- package/esm/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.test.d.ts +1 -0
- package/esm/src/book-components/Chat/save/react/reactSaveFormatDefinition.test.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +26 -0
- package/esm/src/cli/cli-commands/agent/agentProjectPaths.d.ts +8 -8
- package/esm/src/cli/cli-commands/agent/agentRunCliOptions.d.ts +2 -0
- package/esm/src/cli/cli-commands/agent/initializeAgentRunnerCommand.d.ts +1 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +56 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/agents-server/ensureAgentsServerEnvFile.d.ts +7 -0
- package/esm/src/cli/cli-commands/agents-server/ensureAgentsServerGitignoreFile.d.ts +7 -0
- package/esm/src/cli/cli-commands/agents-server/init.d.ts +9 -0
- package/esm/src/cli/cli-commands/agents-server/init.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/agents-server/initializeAgentsServerProjectConfiguration.d.ts +17 -0
- package/esm/src/cli/cli-commands/agents-server/printAgentsServerInitializationSummary.d.ts +7 -0
- package/esm/src/cli/cli-commands/agents-server/run.d.ts +14 -0
- package/esm/src/cli/cli-commands/agents-server/run.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +23 -0
- package/esm/src/cli/cli-commands/agents-server.d.ts +8 -0
- package/esm/src/cli/cli-commands/common/handleActionErrors.d.ts +9 -4
- package/esm/src/cli/cli-commands/common/projectInitialization.d.ts +65 -0
- package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +44 -0
- package/esm/src/cli/common/$deprecateCliCommand.d.ts +8 -0
- package/esm/src/cli/common/$deprecateCliCommand.test.d.ts +1 -0
- package/esm/src/conversion/pipelineJsonToString/appendMarkdownBlock.d.ts +7 -0
- package/esm/src/conversion/pipelineJsonToString/createPipelineCommands.d.ts +7 -0
- package/esm/src/conversion/pipelineJsonToString/createPipelineIntroduction.d.ts +8 -0
- package/esm/src/conversion/pipelineJsonToString/createTaskSerialization.d.ts +23 -0
- package/esm/src/conversion/pipelineJsonToString/stringifyCommands.d.ts +7 -0
- package/esm/src/conversion/pipelineJsonToString/stringifyTask.d.ts +8 -0
- package/esm/src/conversion/pipelineJsonToString.test.d.ts +1 -0
- package/esm/src/execution/createPipelineExecutor/executeSingleAttempt.d.ts +31 -0
- package/esm/src/execution/createPipelineExecutor/handleAttemptFailure.d.ts +40 -0
- package/esm/src/execution/createPipelineExecutor/reportPromptExecution.d.ts +34 -0
- package/esm/src/execution/resolveTaskTldr.d.ts +32 -0
- package/esm/src/execution/resolveTaskTldr.test.d.ts +1 -0
- package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +22 -63
- package/esm/src/llm-providers/agent/AgentLlmExecutionToolsAgentKitRunner.d.ts +51 -0
- package/esm/src/llm-providers/agent/AgentLlmExecutionToolsOpenAiAssistantRunner.d.ts +43 -0
- package/esm/src/llm-providers/agent/AgentLlmExecutionToolsPromptPreparer.d.ts +41 -0
- package/esm/src/llm-providers/agent/emitAgentLlmExecutionToolsAssistantPreparationProgress.d.ts +26 -0
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +16 -93
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsInputBuilder.d.ts +41 -0
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOutputTypeMapper.d.ts +56 -0
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +99 -0
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +24 -120
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsProgressReporter.d.ts +62 -0
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsPromptBuilder.d.ts +29 -0
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +63 -0
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +89 -0
- package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +9 -28
- package/esm/src/llm-providers/openai/OpenAiCompatibleModelCatalog.d.ts +31 -0
- package/esm/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +57 -0
- package/esm/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +29 -0
- package/esm/src/llm-providers/openai/OpenAiVectorStoreFileBatchHandler.d.ts +51 -0
- package/esm/src/llm-providers/openai/OpenAiVectorStoreFileBatchPoller.d.ts +75 -0
- package/esm/src/llm-providers/openai/OpenAiVectorStoreHandler.d.ts +1 -98
- package/esm/src/llm-providers/openai/OpenAiVectorStoreKnowledgeSourcePreparer.d.ts +44 -0
- package/esm/src/llm-providers/openai/utils/OpenAiCompatibleChatProgressReporter.d.ts +86 -0
- package/esm/src/llm-providers/openai/utils/OpenAiCompatibleChatPromptBuilder.d.ts +57 -0
- package/esm/src/llm-providers/openai/utils/OpenAiCompatibleChatToolCaller.d.ts +57 -0
- package/esm/src/remote-server/startRemoteServer/RemoteServerRuntime.d.ts +14 -0
- package/esm/src/remote-server/startRemoteServer/SocketResponse.d.ts +9 -0
- package/esm/src/remote-server/startRemoteServer/StartRemoteServerConfiguration.d.ts +18 -0
- package/esm/src/remote-server/startRemoteServer/createRemoteServerExpressApp.d.ts +7 -0
- package/esm/src/remote-server/startRemoteServer/createRemoteServerHandle.d.ts +11 -0
- package/esm/src/remote-server/startRemoteServer/createSocketServer.d.ts +9 -0
- package/esm/src/remote-server/startRemoteServer/getExecutionToolsFromIdentification.d.ts +12 -0
- package/esm/src/remote-server/startRemoteServer/registerBookRoutes.d.ts +7 -0
- package/esm/src/remote-server/startRemoteServer/registerExecutionRoutes.d.ts +7 -0
- package/esm/src/remote-server/startRemoteServer/registerListModelsSocketHandler.d.ts +8 -0
- package/esm/src/remote-server/startRemoteServer/registerLoginRoute.d.ts +7 -0
- package/esm/src/remote-server/startRemoteServer/registerNotFoundRoute.d.ts +7 -0
- package/esm/src/remote-server/startRemoteServer/registerOpenAiCompatibleChatCompletionsRoute.d.ts +7 -0
- package/esm/src/remote-server/startRemoteServer/registerOpenApiRoutes.d.ts +7 -0
- package/esm/src/remote-server/startRemoteServer/registerPreparePipelineSocketHandler.d.ts +8 -0
- package/esm/src/remote-server/startRemoteServer/registerPromptSocketHandler.d.ts +8 -0
- package/esm/src/remote-server/startRemoteServer/registerRemoteServerHttpRoutes.d.ts +7 -0
- package/esm/src/remote-server/startRemoteServer/registerRemoteServerSocketHandlers.d.ts +8 -0
- package/esm/src/remote-server/startRemoteServer/registerServerIndexRoute.d.ts +7 -0
- package/esm/src/remote-server/startRemoteServer/resolveStartRemoteServerConfiguration.d.ts +8 -0
- package/esm/src/remote-server/startRemoteServer/respondToSocketRequest.d.ts +8 -0
- package/esm/src/remote-server/startRemoteServer/startListening.d.ts +9 -0
- package/esm/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +14 -1
- package/esm/src/utils/color/Color.d.ts +4 -44
- package/esm/src/utils/color/ColorValue.d.ts +55 -0
- package/esm/src/utils/color/isHexColorString.d.ts +10 -0
- package/esm/src/utils/color/parseColorString.d.ts +11 -0
- package/esm/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -0
- package/esm/src/utils/serialization/serializeToPromptbookJavascript.test.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +310 -204
- package/umd/index.umd.js.map +1 -1
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/umd/src/avatars/visuals/octopus3d2AvatarVisual.d.ts +7 -0
- package/umd/src/avatars/visuals/octopus3dAvatarVisualShared.d.ts +37 -0
- package/umd/src/book-components/Chat/save/_common/chatExportRendering.d.ts +75 -0
- package/umd/src/book-components/Chat/save/_common/getPromptbookExportBranding.d.ts +18 -0
- package/umd/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +13 -1
- package/umd/src/book-components/Chat/save/html/htmlSaveFormatDefinition.test.d.ts +1 -0
- package/umd/src/book-components/Chat/save/index.d.ts +5 -5
- package/umd/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.d.ts +5 -3
- package/umd/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.test.d.ts +1 -0
- package/umd/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +4 -3
- package/umd/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +3 -3
- package/umd/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.test.d.ts +1 -0
- package/umd/src/book-components/Chat/save/react/reactSaveFormatDefinition.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +26 -0
- package/umd/src/cli/cli-commands/agent/agentProjectPaths.d.ts +8 -8
- package/umd/src/cli/cli-commands/agent/agentRunCliOptions.d.ts +2 -0
- package/umd/src/cli/cli-commands/agent/initializeAgentRunnerCommand.d.ts +1 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +56 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/agents-server/ensureAgentsServerEnvFile.d.ts +7 -0
- package/umd/src/cli/cli-commands/agents-server/ensureAgentsServerGitignoreFile.d.ts +7 -0
- package/umd/src/cli/cli-commands/agents-server/init.d.ts +9 -0
- package/umd/src/cli/cli-commands/agents-server/init.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/agents-server/initializeAgentsServerProjectConfiguration.d.ts +17 -0
- package/umd/src/cli/cli-commands/agents-server/printAgentsServerInitializationSummary.d.ts +7 -0
- package/umd/src/cli/cli-commands/agents-server/run.d.ts +14 -0
- package/umd/src/cli/cli-commands/agents-server/run.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +23 -0
- package/umd/src/cli/cli-commands/agents-server.d.ts +8 -0
- package/umd/src/cli/cli-commands/common/handleActionErrors.d.ts +9 -4
- package/umd/src/cli/cli-commands/common/projectInitialization.d.ts +65 -0
- package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +44 -0
- package/umd/src/cli/common/$deprecateCliCommand.d.ts +8 -0
- package/umd/src/cli/common/$deprecateCliCommand.test.d.ts +1 -0
- package/umd/src/conversion/pipelineJsonToString/appendMarkdownBlock.d.ts +7 -0
- package/umd/src/conversion/pipelineJsonToString/createPipelineCommands.d.ts +7 -0
- package/umd/src/conversion/pipelineJsonToString/createPipelineIntroduction.d.ts +8 -0
- package/umd/src/conversion/pipelineJsonToString/createTaskSerialization.d.ts +23 -0
- package/umd/src/conversion/pipelineJsonToString/stringifyCommands.d.ts +7 -0
- package/umd/src/conversion/pipelineJsonToString/stringifyTask.d.ts +8 -0
- package/umd/src/conversion/pipelineJsonToString.test.d.ts +1 -0
- package/umd/src/execution/createPipelineExecutor/executeSingleAttempt.d.ts +31 -0
- package/umd/src/execution/createPipelineExecutor/handleAttemptFailure.d.ts +40 -0
- package/umd/src/execution/createPipelineExecutor/reportPromptExecution.d.ts +34 -0
- package/umd/src/execution/resolveTaskTldr.d.ts +32 -0
- package/umd/src/execution/resolveTaskTldr.test.d.ts +1 -0
- package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +22 -63
- package/umd/src/llm-providers/agent/AgentLlmExecutionToolsAgentKitRunner.d.ts +51 -0
- package/umd/src/llm-providers/agent/AgentLlmExecutionToolsOpenAiAssistantRunner.d.ts +43 -0
- package/umd/src/llm-providers/agent/AgentLlmExecutionToolsPromptPreparer.d.ts +41 -0
- package/umd/src/llm-providers/agent/emitAgentLlmExecutionToolsAssistantPreparationProgress.d.ts +26 -0
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +16 -93
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsInputBuilder.d.ts +41 -0
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOutputTypeMapper.d.ts +56 -0
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +99 -0
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +24 -120
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsProgressReporter.d.ts +62 -0
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsPromptBuilder.d.ts +29 -0
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +63 -0
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +89 -0
- package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +9 -28
- package/umd/src/llm-providers/openai/OpenAiCompatibleModelCatalog.d.ts +31 -0
- package/umd/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +57 -0
- package/umd/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +29 -0
- package/umd/src/llm-providers/openai/OpenAiVectorStoreFileBatchHandler.d.ts +51 -0
- package/umd/src/llm-providers/openai/OpenAiVectorStoreFileBatchPoller.d.ts +75 -0
- package/umd/src/llm-providers/openai/OpenAiVectorStoreHandler.d.ts +1 -98
- package/umd/src/llm-providers/openai/OpenAiVectorStoreKnowledgeSourcePreparer.d.ts +44 -0
- package/umd/src/llm-providers/openai/utils/OpenAiCompatibleChatProgressReporter.d.ts +86 -0
- package/umd/src/llm-providers/openai/utils/OpenAiCompatibleChatPromptBuilder.d.ts +57 -0
- package/umd/src/llm-providers/openai/utils/OpenAiCompatibleChatToolCaller.d.ts +57 -0
- package/umd/src/remote-server/startRemoteServer/RemoteServerRuntime.d.ts +14 -0
- package/umd/src/remote-server/startRemoteServer/SocketResponse.d.ts +9 -0
- package/umd/src/remote-server/startRemoteServer/StartRemoteServerConfiguration.d.ts +18 -0
- package/umd/src/remote-server/startRemoteServer/createRemoteServerExpressApp.d.ts +7 -0
- package/umd/src/remote-server/startRemoteServer/createRemoteServerHandle.d.ts +11 -0
- package/umd/src/remote-server/startRemoteServer/createSocketServer.d.ts +9 -0
- package/umd/src/remote-server/startRemoteServer/getExecutionToolsFromIdentification.d.ts +12 -0
- package/umd/src/remote-server/startRemoteServer/registerBookRoutes.d.ts +7 -0
- package/umd/src/remote-server/startRemoteServer/registerExecutionRoutes.d.ts +7 -0
- package/umd/src/remote-server/startRemoteServer/registerListModelsSocketHandler.d.ts +8 -0
- package/umd/src/remote-server/startRemoteServer/registerLoginRoute.d.ts +7 -0
- package/umd/src/remote-server/startRemoteServer/registerNotFoundRoute.d.ts +7 -0
- package/umd/src/remote-server/startRemoteServer/registerOpenAiCompatibleChatCompletionsRoute.d.ts +7 -0
- package/umd/src/remote-server/startRemoteServer/registerOpenApiRoutes.d.ts +7 -0
- package/umd/src/remote-server/startRemoteServer/registerPreparePipelineSocketHandler.d.ts +8 -0
- package/umd/src/remote-server/startRemoteServer/registerPromptSocketHandler.d.ts +8 -0
- package/umd/src/remote-server/startRemoteServer/registerRemoteServerHttpRoutes.d.ts +7 -0
- package/umd/src/remote-server/startRemoteServer/registerRemoteServerSocketHandlers.d.ts +8 -0
- package/umd/src/remote-server/startRemoteServer/registerServerIndexRoute.d.ts +7 -0
- package/umd/src/remote-server/startRemoteServer/resolveStartRemoteServerConfiguration.d.ts +8 -0
- package/umd/src/remote-server/startRemoteServer/respondToSocketRequest.d.ts +8 -0
- package/umd/src/remote-server/startRemoteServer/startListening.d.ts +9 -0
- package/umd/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +14 -1
- package/umd/src/utils/color/Color.d.ts +4 -44
- package/umd/src/utils/color/ColorValue.d.ts +55 -0
- package/umd/src/utils/color/isHexColorString.d.ts +10 -0
- package/umd/src/utils/color/parseColorString.d.ts +11 -0
- package/umd/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -0
- package/umd/src/utils/serialization/serializeToPromptbookJavascript.test.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/appendBlock.d.ts +0 -6
- package/esm/src/cli/cli-commands/coder/readTextFileIfExists.d.ts +0 -6
- package/umd/src/cli/cli-commands/coder/appendBlock.d.ts +0 -6
- package/umd/src/cli/cli-commands/coder/readTextFileIfExists.d.ts +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { string_html, string_markdown } from '../../../types/string_markdown';
|
|
2
|
+
/**
|
|
3
|
+
* Options for markdown rendering.
|
|
4
|
+
*/
|
|
5
|
+
type RenderMarkdownOptions = {
|
|
6
|
+
readonly citationReferenceClassName?: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Convert markdown content to HTML.
|
|
10
|
+
*
|
|
11
|
+
* @param markdown - The markdown content to convert.
|
|
12
|
+
* @returns HTML string ready for rendering.
|
|
13
|
+
*
|
|
14
|
+
* @private internal utility of chat components and exports
|
|
15
|
+
*/
|
|
16
|
+
export declare function renderMarkdown(markdown: string_markdown, options?: RenderMarkdownOptions): string_html;
|
|
17
|
+
/**
|
|
18
|
+
* Detects whether text appears to contain markdown syntax.
|
|
19
|
+
*
|
|
20
|
+
* @param markdown - The text to inspect.
|
|
21
|
+
* @returns Whether the text contains known markdown markers.
|
|
22
|
+
*
|
|
23
|
+
* @private internal utility of chat components and exports
|
|
24
|
+
*/
|
|
25
|
+
export declare function isMarkdownContent(markdown: string_markdown): boolean;
|
|
26
|
+
export {};
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
* @private internal utility of `ptbk agent`
|
|
5
5
|
*/
|
|
6
6
|
export declare const AGENT_BOOK_FILE_PATH = "agent.book";
|
|
7
|
+
/**
|
|
8
|
+
* Relative path to local knowledge files initialized by `ptbk agent init`.
|
|
9
|
+
*
|
|
10
|
+
* @private internal utility of `ptbk agent`
|
|
11
|
+
*/
|
|
12
|
+
export declare const AGENT_KNOWLEDGE_DIRECTORY_PATH = "knowledge";
|
|
7
13
|
/**
|
|
8
14
|
* Relative path to the message queue root initialized by `ptbk agent init`.
|
|
9
15
|
*
|
|
@@ -23,19 +29,13 @@ export declare const AGENT_QUEUED_MESSAGES_DIRECTORY_PATH: string;
|
|
|
23
29
|
*/
|
|
24
30
|
export declare const AGENT_FINISHED_MESSAGES_DIRECTORY_PATH: string;
|
|
25
31
|
/**
|
|
26
|
-
* Relative path to local
|
|
27
|
-
*
|
|
28
|
-
* @private internal utility of `ptbk agent`
|
|
29
|
-
*/
|
|
30
|
-
export declare const AGENT_KNOWLEDGE_DIRECTORY_PATH = "knowledge";
|
|
31
|
-
/**
|
|
32
|
-
* Relative path to local agent documentation initialized by `ptbk agent init`.
|
|
32
|
+
* Relative path to generated local agent documentation initialized by `ptbk agent init`.
|
|
33
33
|
*
|
|
34
34
|
* @private internal utility of `ptbk agent`
|
|
35
35
|
*/
|
|
36
36
|
export declare const AGENT_DOCS_DIRECTORY_PATH = "docs";
|
|
37
37
|
/**
|
|
38
|
-
* Relative path to the local Book language manual
|
|
38
|
+
* Relative path to the local Book language manual initialized by `ptbk agent init`.
|
|
39
39
|
*
|
|
40
40
|
* @private internal utility of `ptbk agent`
|
|
41
41
|
*/
|
|
@@ -6,6 +6,7 @@ import type { NormalizedPromptRunnerCliOptions, PromptRunnerCliOptions } from '.
|
|
|
6
6
|
*/
|
|
7
7
|
export type AgentRunCliOptions = PromptRunnerCliOptions & {
|
|
8
8
|
readonly autoClone?: boolean;
|
|
9
|
+
readonly ignore?: string | readonly string[];
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
12
|
* Normalized options passed from `ptbk agent` CLI commands to the message runner.
|
|
@@ -14,6 +15,7 @@ export type AgentRunCliOptions = PromptRunnerCliOptions & {
|
|
|
14
15
|
*/
|
|
15
16
|
export type NormalizedAgentRunCliOptions = NormalizedPromptRunnerCliOptions & {
|
|
16
17
|
readonly autoClone: boolean;
|
|
18
|
+
readonly ignorePatterns: readonly string[];
|
|
17
19
|
};
|
|
18
20
|
/**
|
|
19
21
|
* Converts Commander options into the `scripts/run-agent-messages` option shape.
|
|
@@ -11,6 +11,7 @@ type InitializeAgentRunnerCommandOptions = {
|
|
|
11
11
|
readonly aliases?: ReadonlyArray<string>;
|
|
12
12
|
readonly summary: string;
|
|
13
13
|
readonly featureLines: ReadonlyArray<string>;
|
|
14
|
+
readonly executionMode: 'once' | 'watch';
|
|
14
15
|
readonly configureCommand?: (command: Program) => void;
|
|
15
16
|
readonly loadExecutor: () => Promise<(runOptions: ReturnType<typeof createAgentRunOptionsFromCliOptions>) => Promise<unknown>>;
|
|
16
17
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* Inputs controlling one cached Agents Server production build.
|
|
4
|
+
*
|
|
5
|
+
* @private internal type of `ptbk agents-server`
|
|
6
|
+
*/
|
|
7
|
+
type EnsureAgentsServerBuildOptions = {
|
|
8
|
+
readonly appPath?: string;
|
|
9
|
+
readonly environment?: NodeJS.ProcessEnv;
|
|
10
|
+
readonly isBuildForced?: boolean;
|
|
11
|
+
readonly onBuildEvent?: (event: string) => void;
|
|
12
|
+
readonly onBuildOutput?: (chunk: string) => void;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Paths needed after the Agents Server production build is ready.
|
|
16
|
+
*
|
|
17
|
+
* @private internal type of `ptbk agents-server`
|
|
18
|
+
*/
|
|
19
|
+
export type AgentsServerBuildArtifacts = {
|
|
20
|
+
readonly appPath: string;
|
|
21
|
+
readonly nextCliPath: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Input paths required to validate or update the cached Agents Server build.
|
|
25
|
+
*
|
|
26
|
+
* @private internal type of `ptbk agents-server`
|
|
27
|
+
*/
|
|
28
|
+
type AgentsServerBuildCacheOptions = {
|
|
29
|
+
readonly appPath: string;
|
|
30
|
+
readonly environment?: NodeJS.ProcessEnv;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Ensures that the local Agents Server production build exists and matches its source fingerprint.
|
|
34
|
+
*
|
|
35
|
+
* @private internal utility of `ptbk agents-server`
|
|
36
|
+
*/
|
|
37
|
+
export declare function ensureAgentsServerBuild(options?: EnsureAgentsServerBuildOptions): Promise<AgentsServerBuildArtifacts>;
|
|
38
|
+
/**
|
|
39
|
+
* Returns true when the production build marker and source fingerprint still match.
|
|
40
|
+
*
|
|
41
|
+
* @private internal utility of `ptbk agents-server`
|
|
42
|
+
*/
|
|
43
|
+
export declare function isAgentsServerBuildCacheCurrent(options: AgentsServerBuildCacheOptions): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Persists the source fingerprint for the just-created production build.
|
|
46
|
+
*
|
|
47
|
+
* @private internal utility of `ptbk agents-server`
|
|
48
|
+
*/
|
|
49
|
+
export declare function writeAgentsServerBuildCache(options: AgentsServerBuildCacheOptions): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Finds the Agents Server app in a source checkout or generated CLI package.
|
|
52
|
+
*
|
|
53
|
+
* @private internal utility of `ptbk agents-server`
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveAgentsServerAppPath(): Promise<string>;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type EnsureProjectEnvFileResult } from '../common/projectInitialization';
|
|
2
|
+
/**
|
|
3
|
+
* Ensures `.env` contains all required Agents Server configuration entries.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `ptbk agents-server init`
|
|
6
|
+
*/
|
|
7
|
+
export declare function ensureAgentsServerEnvFile(projectPath: string): Promise<EnsureProjectEnvFileResult>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ProjectInitializationStatus } from '../common/projectInitialization';
|
|
2
|
+
/**
|
|
3
|
+
* Ensures `.gitignore` excludes local Agents Server runtime artifacts.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `ptbk agents-server init`
|
|
6
|
+
*/
|
|
7
|
+
export declare function ensureAgentsServerGitignoreFile(projectPath: string): Promise<ProjectInitializationStatus>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
3
|
+
export { initializeAgentsServerProjectConfiguration } from './initializeAgentsServerProjectConfiguration';
|
|
4
|
+
/**
|
|
5
|
+
* Initializes `agents-server init` command for Promptbook CLI utilities.
|
|
6
|
+
*
|
|
7
|
+
* @private internal function of `promptbookCli`
|
|
8
|
+
*/
|
|
9
|
+
export declare function $initializeAgentsServerInitCommand(program: Program): $side_effect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/umd/src/cli/cli-commands/agents-server/initializeAgentsServerProjectConfiguration.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProjectInitializationStatus } from '../common/projectInitialization';
|
|
2
|
+
/**
|
|
3
|
+
* Result summary returned after Agents Server configuration initialization.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `ptbk agents-server init`
|
|
6
|
+
*/
|
|
7
|
+
export type AgentsServerInitializationSummary = {
|
|
8
|
+
readonly envFileStatus: ProjectInitializationStatus;
|
|
9
|
+
readonly gitignoreFileStatus: ProjectInitializationStatus;
|
|
10
|
+
readonly initializedEnvVariableNames: ReadonlyArray<string>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Creates or updates local Agents Server configuration files in the current project.
|
|
14
|
+
*
|
|
15
|
+
* @private internal utility of `ptbk agents-server init`
|
|
16
|
+
*/
|
|
17
|
+
export declare function initializeAgentsServerProjectConfiguration(projectPath: string): Promise<AgentsServerInitializationSummary>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AgentsServerInitializationSummary } from './initializeAgentsServerProjectConfiguration';
|
|
2
|
+
/**
|
|
3
|
+
* Prints a readable summary of local Agents Server configuration initialization.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `ptbk agents-server init`
|
|
6
|
+
*/
|
|
7
|
+
export declare function printAgentsServerInitializationSummary(summary: AgentsServerInitializationSummary): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
3
|
+
/**
|
|
4
|
+
* Initializes `agents-server start` command for Promptbook CLI utilities.
|
|
5
|
+
*
|
|
6
|
+
* @private internal function of `promptbookCli`
|
|
7
|
+
*/
|
|
8
|
+
export declare function $initializeAgentsServerStartCommand(program: Program): $side_effect;
|
|
9
|
+
/**
|
|
10
|
+
* Initializes `agents-server build` command for Promptbook CLI utilities.
|
|
11
|
+
*
|
|
12
|
+
* @private internal function of `promptbookCli`
|
|
13
|
+
*/
|
|
14
|
+
export declare function $initializeAgentsServerBuildCommand(program: Program): $side_effect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ThinkingLevel } from '../coder/ThinkingLevel';
|
|
2
|
+
import type { PromptRunnerAgentName } from '../common/promptRunnerCliOptions';
|
|
3
|
+
import type { number_port } from '../../../types/number_positive';
|
|
4
|
+
/**
|
|
5
|
+
* Options required to start the foreground Agents Server service group.
|
|
6
|
+
*
|
|
7
|
+
* @private internal type of `ptbk agents-server`
|
|
8
|
+
*/
|
|
9
|
+
export type StartAgentsServerOptions = {
|
|
10
|
+
readonly port: number_port;
|
|
11
|
+
readonly agentName: PromptRunnerAgentName;
|
|
12
|
+
readonly model?: string;
|
|
13
|
+
readonly noUi: boolean;
|
|
14
|
+
readonly thinkingLevel?: ThinkingLevel;
|
|
15
|
+
readonly allowCredits: boolean;
|
|
16
|
+
readonly isBuildForced: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Starts the Agents Server web app and local coding-agent queue workers in the foreground.
|
|
20
|
+
*
|
|
21
|
+
* @private internal utility of `ptbk agents-server`
|
|
22
|
+
*/
|
|
23
|
+
export declare function startAgentsServer(options: StartAgentsServerOptions): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
import type { $side_effect } from '../../utils/organization/$side_effect';
|
|
3
|
+
/**
|
|
4
|
+
* Initializes `agents-server` command with subcommands for Promptbook CLI utilities.
|
|
5
|
+
*
|
|
6
|
+
* @private internal function of `promptbookCli`
|
|
7
|
+
*/
|
|
8
|
+
export declare function $initializeAgentsServerCommand(program: Program): $side_effect;
|
|
@@ -4,12 +4,17 @@ import type { Command as Program } from 'commander';
|
|
|
4
4
|
*/
|
|
5
5
|
type actionCallbackFunction = Parameters<Program['action']>[0];
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Options controlling CLI process-exit behavior after one command action finishes.
|
|
8
8
|
*
|
|
9
|
-
* @
|
|
10
|
-
|
|
9
|
+
* @private internal helper type for CLI commands
|
|
10
|
+
*/
|
|
11
|
+
type HandleActionErrorsOptions = {
|
|
12
|
+
readonly isExitingOnSuccess?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Wraps action to handle error console logging and exit process with error code.
|
|
11
16
|
*
|
|
12
17
|
* @private internal helper function for CLI commands
|
|
13
18
|
*/
|
|
14
|
-
export declare function handleActionErrors(action: actionCallbackFunction): actionCallbackFunction;
|
|
19
|
+
export declare function handleActionErrors(action: actionCallbackFunction, options?: HandleActionErrorsOptions): actionCallbackFunction;
|
|
15
20
|
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File status returned by project configuration bootstrapping helpers.
|
|
3
|
+
*
|
|
4
|
+
* @private internal utility of Promptbook CLI project initialization
|
|
5
|
+
*/
|
|
6
|
+
export type ProjectInitializationStatus = 'created' | 'updated' | 'unchanged';
|
|
7
|
+
/**
|
|
8
|
+
* Minimal environment variable descriptor used for additive `.env` initialization.
|
|
9
|
+
*
|
|
10
|
+
* @private internal utility of Promptbook CLI project initialization
|
|
11
|
+
*/
|
|
12
|
+
export type ProjectEnvVariableDefinition = {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Result of one additive `.env` initialization attempt.
|
|
17
|
+
*
|
|
18
|
+
* @private internal utility of Promptbook CLI project initialization
|
|
19
|
+
*/
|
|
20
|
+
export type EnsureProjectEnvFileResult = {
|
|
21
|
+
readonly envFileStatus: ProjectInitializationStatus;
|
|
22
|
+
readonly initializedEnvVariableNames: ReadonlyArray<string>;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Options required to append missing variables into a project `.env`.
|
|
26
|
+
*/
|
|
27
|
+
type EnsureProjectEnvFileOptions<TEnvVariable extends ProjectEnvVariableDefinition> = {
|
|
28
|
+
readonly projectPath: string;
|
|
29
|
+
readonly emptyFileContent: string;
|
|
30
|
+
readonly envVariables: ReadonlyArray<TEnvVariable>;
|
|
31
|
+
readonly buildMissingEnvVariablesBlock: (envVariables: ReadonlyArray<TEnvVariable>) => string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Options required to append missing rules into a project `.gitignore`.
|
|
35
|
+
*/
|
|
36
|
+
type EnsureProjectGitignoreFileOptions = {
|
|
37
|
+
readonly projectPath: string;
|
|
38
|
+
readonly blockHeader: string;
|
|
39
|
+
readonly rules: ReadonlyArray<string>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Ensures `.env` exists and appends only still-missing variable definitions.
|
|
43
|
+
*
|
|
44
|
+
* @private internal utility of Promptbook CLI project initialization
|
|
45
|
+
*/
|
|
46
|
+
export declare function ensureProjectEnvFile<TEnvVariable extends ProjectEnvVariableDefinition>({ projectPath, emptyFileContent, envVariables, buildMissingEnvVariablesBlock, }: EnsureProjectEnvFileOptions<TEnvVariable>): Promise<EnsureProjectEnvFileResult>;
|
|
47
|
+
/**
|
|
48
|
+
* Ensures `.gitignore` contains all required project initialization rules.
|
|
49
|
+
*
|
|
50
|
+
* @private internal utility of Promptbook CLI project initialization
|
|
51
|
+
*/
|
|
52
|
+
export declare function ensureProjectGitignoreFile({ projectPath, blockHeader, rules, }: EnsureProjectGitignoreFileOptions): Promise<ProjectInitializationStatus>;
|
|
53
|
+
/**
|
|
54
|
+
* Reads one text file when it exists, otherwise returns `undefined`.
|
|
55
|
+
*
|
|
56
|
+
* @private internal utility of Promptbook CLI project initialization
|
|
57
|
+
*/
|
|
58
|
+
export declare function readTextFileIfExists(path: string): Promise<string | undefined>;
|
|
59
|
+
/**
|
|
60
|
+
* Appends one text block to existing file content while preserving readable newlines.
|
|
61
|
+
*
|
|
62
|
+
* @private internal utility of Promptbook CLI project initialization
|
|
63
|
+
*/
|
|
64
|
+
export declare function appendBlock(currentContent: string, blockToAppend: string): string;
|
|
65
|
+
export {};
|
|
@@ -6,6 +6,24 @@ import type { ThinkingLevel } from '../coder/ThinkingLevel';
|
|
|
6
6
|
* @private internal utility of `promptbookCli`
|
|
7
7
|
*/
|
|
8
8
|
export declare const PROMPT_RUNNER_AGENT_NAMES: readonly ["openai-codex", "github-copilot", "cline", "claude-code", "opencode", "gemini"];
|
|
9
|
+
/**
|
|
10
|
+
* Environment variable used as the default runner identifier when `--agent` is omitted.
|
|
11
|
+
*
|
|
12
|
+
* @private internal utility of `promptbookCli`
|
|
13
|
+
*/
|
|
14
|
+
export declare const PTBK_AGENT_ENV = "PTBK_AGENT";
|
|
15
|
+
/**
|
|
16
|
+
* Environment variable used as the default runner model when `--model` is omitted.
|
|
17
|
+
*
|
|
18
|
+
* @private internal utility of `promptbookCli`
|
|
19
|
+
*/
|
|
20
|
+
export declare const PTBK_MODEL_ENV = "PTBK_MODEL";
|
|
21
|
+
/**
|
|
22
|
+
* Environment variable used as the default runner thinking level when `--thinking-level` is omitted.
|
|
23
|
+
*
|
|
24
|
+
* @private internal utility of `promptbookCli`
|
|
25
|
+
*/
|
|
26
|
+
export declare const PTBK_THINKING_LEVEL_ENV = "PTBK_THINKING_LEVEL";
|
|
9
27
|
/**
|
|
10
28
|
* Runner identifier supported by Promptbook CLI agent orchestration commands.
|
|
11
29
|
*
|
|
@@ -29,6 +47,12 @@ export type PromptRunnerCliOptions = {
|
|
|
29
47
|
readonly autoPush: boolean;
|
|
30
48
|
readonly autoPull: boolean;
|
|
31
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* Commander option bag for runner selection plus terminal/runtime switches shared with server orchestration.
|
|
52
|
+
*
|
|
53
|
+
* @private internal utility of `promptbookCli`
|
|
54
|
+
*/
|
|
55
|
+
export type PromptRunnerSelectionCliOptions = Pick<PromptRunnerCliOptions, 'agent' | 'model' | 'ui' | 'thinkingLevel' | 'allowCredits'>;
|
|
32
56
|
/**
|
|
33
57
|
* Normalized runner options used by runner-backed CLI commands.
|
|
34
58
|
*
|
|
@@ -46,6 +70,12 @@ export type NormalizedPromptRunnerCliOptions = {
|
|
|
46
70
|
readonly autoPush: boolean;
|
|
47
71
|
readonly autoPull: boolean;
|
|
48
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Normalized runner selection plus terminal/runtime switches shared with server orchestration.
|
|
75
|
+
*
|
|
76
|
+
* @private internal utility of `promptbookCli`
|
|
77
|
+
*/
|
|
78
|
+
export type NormalizedPromptRunnerSelectionCliOptions = Pick<NormalizedPromptRunnerCliOptions, 'agentName' | 'model' | 'noUi' | 'thinkingLevel' | 'allowCredits'>;
|
|
49
79
|
/**
|
|
50
80
|
* Description block shared by runner-backed CLI commands.
|
|
51
81
|
*
|
|
@@ -70,6 +100,12 @@ export declare const PROMPT_RUNNER_MODEL_OPTION_DESCRIPTION: string;
|
|
|
70
100
|
* @private internal utility of `promptbookCli`
|
|
71
101
|
*/
|
|
72
102
|
export declare function addPromptRunnerSelectionOptions(command: Program): void;
|
|
103
|
+
/**
|
|
104
|
+
* Registers shared runner terminal/runtime flags on a command.
|
|
105
|
+
*
|
|
106
|
+
* @private internal utility of `promptbookCli`
|
|
107
|
+
*/
|
|
108
|
+
export declare function addPromptRunnerRuntimeOptions(command: Program): void;
|
|
73
109
|
/**
|
|
74
110
|
* Registers shared runner execution flags on a command.
|
|
75
111
|
*
|
|
@@ -84,3 +120,11 @@ export declare function addPromptRunnerExecutionOptions(command: Program): void;
|
|
|
84
120
|
export declare function normalizePromptRunnerCliOptions(cliOptions: PromptRunnerCliOptions, options: {
|
|
85
121
|
readonly isAgentRequired: boolean;
|
|
86
122
|
}): NormalizedPromptRunnerCliOptions;
|
|
123
|
+
/**
|
|
124
|
+
* Converts Commander runner selection/runtime flags into the normalized runner shape.
|
|
125
|
+
*
|
|
126
|
+
* @private internal utility of `promptbookCli`
|
|
127
|
+
*/
|
|
128
|
+
export declare function normalizePromptRunnerSelectionCliOptions(cliOptions: PromptRunnerSelectionCliOptions, options: {
|
|
129
|
+
readonly isAgentRequired: boolean;
|
|
130
|
+
}): NormalizedPromptRunnerSelectionCliOptions;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import type { $side_effect } from '../../utils/organization/$side_effect';
|
|
3
|
+
/**
|
|
4
|
+
* Marks one CLI command as deprecated while keeping it available for existing callers.
|
|
5
|
+
*
|
|
6
|
+
* @private utility of CLI
|
|
7
|
+
*/
|
|
8
|
+
export declare function $deprecateCliCommand(command: Command, deprecationMessage: string): $side_effect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { string_markdown } from '../../types/string_markdown';
|
|
2
|
+
/**
|
|
3
|
+
* Appends one markdown block to an existing markdown document.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `pipelineJsonToString`
|
|
6
|
+
*/
|
|
7
|
+
export declare function appendMarkdownBlock(pipelineString: string_markdown, markdownBlock: string_markdown): string_markdown;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
2
|
+
/**
|
|
3
|
+
* Collects pipeline-level commands in the existing serialization order.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `pipelineJsonToString`
|
|
6
|
+
*/
|
|
7
|
+
export declare function createPipelineCommands(pipelineJson: PipelineJson): Array<string>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
2
|
+
import type { string_markdown } from '../../types/string_markdown';
|
|
3
|
+
/**
|
|
4
|
+
* Creates the initial markdown heading and description of a pipeline.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `pipelineJsonToString`
|
|
7
|
+
*/
|
|
8
|
+
export declare function createPipelineIntroduction(pipelineJson: PipelineJson): string_markdown;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
2
|
+
/**
|
|
3
|
+
* Code fence language used when stringifying a pipeline task.
|
|
4
|
+
*
|
|
5
|
+
* @private internal type of `createTaskSerialization`
|
|
6
|
+
*/
|
|
7
|
+
type PipelineTaskContentLanguage = 'markdown' | 'text' | 'javascript' | 'typescript' | 'python' | '';
|
|
8
|
+
/**
|
|
9
|
+
* All derived serialization details needed to render one task section.
|
|
10
|
+
*
|
|
11
|
+
* @private internal type of `createTaskSerialization`
|
|
12
|
+
*/
|
|
13
|
+
type TaskSerialization = {
|
|
14
|
+
readonly commands: Array<string>;
|
|
15
|
+
readonly contentLanguage: PipelineTaskContentLanguage;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Collects all task-specific serialization details.
|
|
19
|
+
*
|
|
20
|
+
* @private internal utility of `pipelineJsonToString`
|
|
21
|
+
*/
|
|
22
|
+
export declare function createTaskSerialization(task: TaskJson): TaskSerialization;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { string_markdown } from '../../types/string_markdown';
|
|
2
|
+
/**
|
|
3
|
+
* Renders commands as markdown bullet items.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `pipelineJsonToString`
|
|
6
|
+
*/
|
|
7
|
+
export declare function stringifyCommands(commands: ReadonlyArray<string>): string_markdown;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
2
|
+
import type { string_markdown } from '../../types/string_markdown';
|
|
3
|
+
/**
|
|
4
|
+
* Stringifies one task section of the pipeline.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `pipelineJsonToString`
|
|
7
|
+
*/
|
|
8
|
+
export declare function stringifyTask(task: TaskJson): string_markdown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { string_parameter_name } from '../../types/string_name';
|
|
2
|
+
import type { LlmExecutionTools } from '../LlmExecutionTools';
|
|
3
|
+
import type { $OngoingTaskResult } from './$OngoingTaskResult';
|
|
4
|
+
import type { ExecuteAttemptsOptions } from './40-executeAttempts';
|
|
5
|
+
/**
|
|
6
|
+
* Executes one loop iteration, from joker resolution or task execution through validation.
|
|
7
|
+
*
|
|
8
|
+
* @private function of `executeAttempts`
|
|
9
|
+
*/
|
|
10
|
+
export declare function executeSingleAttempt(options: {
|
|
11
|
+
/**
|
|
12
|
+
* Metadata describing the current loop iteration.
|
|
13
|
+
*/
|
|
14
|
+
readonly attempt: {
|
|
15
|
+
readonly attemptIndex: number;
|
|
16
|
+
readonly isJokerAttempt: boolean;
|
|
17
|
+
readonly jokerParameterName?: string_parameter_name;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Immutable executor options shared across all attempts.
|
|
21
|
+
*/
|
|
22
|
+
readonly options: ExecuteAttemptsOptions;
|
|
23
|
+
/**
|
|
24
|
+
* Narrowed LLM execution tools for prompt tasks.
|
|
25
|
+
*/
|
|
26
|
+
readonly llmTools: LlmExecutionTools;
|
|
27
|
+
/**
|
|
28
|
+
* Mutable per-task state accumulated across attempts.
|
|
29
|
+
*/
|
|
30
|
+
readonly $ongoingTaskResult: $OngoingTaskResult;
|
|
31
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { PartialDeep, Promisable } from 'type-fest';
|
|
2
|
+
import { ExpectError } from '../../errors/ExpectError';
|
|
3
|
+
import type { PipelineExecutorResult } from '../PipelineExecutorResult';
|
|
4
|
+
import type { $OngoingTaskResult } from './$OngoingTaskResult';
|
|
5
|
+
/**
|
|
6
|
+
* Stores one failed attempt, reports the expectation error, and throws the aggregated retry error after the final
|
|
7
|
+
* regular attempt.
|
|
8
|
+
*
|
|
9
|
+
* @private function of `executeAttempts`
|
|
10
|
+
*/
|
|
11
|
+
export declare function handleAttemptFailure(options: {
|
|
12
|
+
/**
|
|
13
|
+
* Expectation error raised by the current attempt.
|
|
14
|
+
*/
|
|
15
|
+
readonly error: ExpectError;
|
|
16
|
+
/**
|
|
17
|
+
* Zero-based attempt index for the current execution loop.
|
|
18
|
+
*/
|
|
19
|
+
readonly attemptIndex: number;
|
|
20
|
+
/**
|
|
21
|
+
* Maximum number of attempts for the current task type.
|
|
22
|
+
*/
|
|
23
|
+
readonly maxAttempts: number;
|
|
24
|
+
/**
|
|
25
|
+
* Maximum number of model execution attempts for prompt tasks.
|
|
26
|
+
*/
|
|
27
|
+
readonly maxExecutionAttempts: number;
|
|
28
|
+
/**
|
|
29
|
+
* Callback invoked with partial progress updates.
|
|
30
|
+
*/
|
|
31
|
+
onProgress(newOngoingResult: PartialDeep<PipelineExecutorResult>): Promisable<void>;
|
|
32
|
+
/**
|
|
33
|
+
* String identifier for the pipeline, used for error reporting.
|
|
34
|
+
*/
|
|
35
|
+
readonly pipelineIdentification: string;
|
|
36
|
+
/**
|
|
37
|
+
* Mutable per-task execution state.
|
|
38
|
+
*/
|
|
39
|
+
readonly $ongoingTaskResult: $OngoingTaskResult;
|
|
40
|
+
}): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Promisable, ReadonlyDeep, WritableDeep } from 'type-fest';
|
|
2
|
+
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
3
|
+
import type { LlmCall } from '../../types/LlmCall';
|
|
4
|
+
import type { ExecutionReportJson } from '../execution-report/ExecutionReportJson';
|
|
5
|
+
import type { $OngoingTaskResult } from './$OngoingTaskResult';
|
|
6
|
+
/**
|
|
7
|
+
* Appends the prompt execution report for prompt-task attempts.
|
|
8
|
+
*
|
|
9
|
+
* @private function of `executeAttempts`
|
|
10
|
+
*/
|
|
11
|
+
export declare function reportPromptExecution(options: {
|
|
12
|
+
/**
|
|
13
|
+
* Metadata describing the current loop iteration.
|
|
14
|
+
*/
|
|
15
|
+
readonly attempt: {
|
|
16
|
+
readonly isJokerAttempt: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Task currently being executed.
|
|
20
|
+
*/
|
|
21
|
+
readonly task: ReadonlyDeep<TaskJson>;
|
|
22
|
+
/**
|
|
23
|
+
* Mutable execution report object to append prompt execution data to.
|
|
24
|
+
*/
|
|
25
|
+
readonly $executionReport: WritableDeep<ExecutionReportJson>;
|
|
26
|
+
/**
|
|
27
|
+
* Optional callback invoked with each LLM call.
|
|
28
|
+
*/
|
|
29
|
+
logLlmCall?(llmCall: LlmCall): Promisable<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Mutable per-task execution state.
|
|
32
|
+
*/
|
|
33
|
+
readonly $ongoingTaskResult: $OngoingTaskResult;
|
|
34
|
+
}): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { number_percent } from '../types/number_percent';
|
|
2
|
+
import type { chococake } from '../utils/organization/really_any';
|
|
3
|
+
import type { task_status } from './ExecutionTask';
|
|
4
|
+
/**
|
|
5
|
+
* Shared type for task TLDR information.
|
|
6
|
+
*
|
|
7
|
+
* @private internal type of `ExecutionTask`
|
|
8
|
+
*/
|
|
9
|
+
type TaskTldrInfo = {
|
|
10
|
+
readonly percent: number_percent;
|
|
11
|
+
readonly message: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Snapshot of the mutable task state needed to resolve the fallback TLDR.
|
|
15
|
+
*
|
|
16
|
+
* @private internal type of `ExecutionTask`
|
|
17
|
+
*/
|
|
18
|
+
type ResolveTaskTldrOptions = {
|
|
19
|
+
readonly customTldr: TaskTldrInfo | null;
|
|
20
|
+
readonly currentValue: chococake;
|
|
21
|
+
readonly status: task_status;
|
|
22
|
+
readonly createdAt: Date;
|
|
23
|
+
readonly errors: ReadonlyArray<Error>;
|
|
24
|
+
readonly warnings: ReadonlyArray<Error>;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Resolves the short task summary shown in the UI.
|
|
28
|
+
*
|
|
29
|
+
* @private internal helper function of `ExecutionTask`
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveTaskTldr(options: ResolveTaskTldrOptions): TaskTldrInfo;
|
|
32
|
+
export {};
|