@promptbook/fake-llm 0.112.0-71 → 0.112.0-73
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/esm/index.es.js +1 -1
- package/esm/src/book-3.0/Book.d.ts +6 -0
- package/esm/src/book-components/Chat/save/_common/chatExportRendering.d.ts +28 -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 +1 -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 +4 -4
- package/esm/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.d.ts +1 -1
- 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 +3 -2
- package/esm/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +2 -2
- 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/getToolCallChipletInfo.test.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +26 -0
- package/esm/src/cli/cli-commands/agent/agentRunCliOptions.d.ts +14 -2
- package/esm/src/cli/cli-commands/agent/initializeAgentRunnerCommand.d.ts +2 -0
- package/esm/src/cli/cli-commands/common/handleActionErrors.d.ts +9 -4
- package/esm/src/cli/cli-commands/run/prepareRunCommandResources.d.ts +20 -0
- package/esm/src/cli/cli-commands/run/resolveRunInputParameters.d.ts +12 -0
- package/esm/src/cli/cli-commands/run/runCommandAction.d.ts +21 -0
- package/esm/src/cli/cli-commands/run/runPipelineExecution.d.ts +14 -0
- package/esm/src/cli/cli-commands/run.d.ts +1 -1
- package/esm/src/conversion/parsePipeline/applyPipelineHead.d.ts +8 -0
- package/esm/src/conversion/parsePipeline/createInitialPipelineJson.d.ts +8 -0
- package/esm/src/conversion/parsePipeline/createUniqueSectionNameResolver.d.ts +14 -0
- package/esm/src/conversion/parsePipeline/defineParameter.d.ts +8 -0
- package/esm/src/conversion/parsePipeline/extractPipelineDescription.d.ts +6 -0
- package/esm/src/conversion/parsePipeline/finalizeParsedPipeline.d.ts +8 -0
- package/esm/src/conversion/parsePipeline/getPipelineIdentification.d.ts +7 -0
- package/esm/src/conversion/parsePipeline/parsePreparedPipelineSections.d.ts +18 -0
- package/esm/src/conversion/parsePipeline/preparePipelineString.d.ts +8 -0
- package/esm/src/conversion/parsePipeline/processPipelineSection.d.ts +9 -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/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 +1 -1
- package/umd/src/book-3.0/Book.d.ts +6 -0
- package/umd/src/book-components/Chat/save/_common/chatExportRendering.d.ts +28 -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 +1 -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 +4 -4
- package/umd/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.d.ts +1 -1
- 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 +3 -2
- package/umd/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +2 -2
- 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/getToolCallChipletInfo.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +26 -0
- package/umd/src/cli/cli-commands/agent/agentRunCliOptions.d.ts +14 -2
- package/umd/src/cli/cli-commands/agent/initializeAgentRunnerCommand.d.ts +2 -0
- package/umd/src/cli/cli-commands/common/handleActionErrors.d.ts +9 -4
- package/umd/src/cli/cli-commands/run/prepareRunCommandResources.d.ts +20 -0
- package/umd/src/cli/cli-commands/run/resolveRunInputParameters.d.ts +12 -0
- package/umd/src/cli/cli-commands/run/runCommandAction.d.ts +21 -0
- package/umd/src/cli/cli-commands/run/runPipelineExecution.d.ts +14 -0
- package/umd/src/cli/cli-commands/run.d.ts +1 -1
- package/umd/src/conversion/parsePipeline/applyPipelineHead.d.ts +8 -0
- package/umd/src/conversion/parsePipeline/createInitialPipelineJson.d.ts +8 -0
- package/umd/src/conversion/parsePipeline/createUniqueSectionNameResolver.d.ts +14 -0
- package/umd/src/conversion/parsePipeline/defineParameter.d.ts +8 -0
- package/umd/src/conversion/parsePipeline/extractPipelineDescription.d.ts +6 -0
- package/umd/src/conversion/parsePipeline/finalizeParsedPipeline.d.ts +8 -0
- package/umd/src/conversion/parsePipeline/getPipelineIdentification.d.ts +7 -0
- package/umd/src/conversion/parsePipeline/parsePreparedPipelineSections.d.ts +18 -0
- package/umd/src/conversion/parsePipeline/preparePipelineString.d.ts +8 -0
- package/umd/src/conversion/parsePipeline/processPipelineSection.d.ts +9 -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/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/index.es.js
CHANGED
|
@@ -20,7 +20,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
20
20
|
* @generated
|
|
21
21
|
* @see https://github.com/webgptorg/promptbook
|
|
22
22
|
*/
|
|
23
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
23
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-73';
|
|
24
24
|
/**
|
|
25
25
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
26
26
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -24,6 +24,12 @@ export declare class Book {
|
|
|
24
24
|
private constructor();
|
|
25
25
|
stringify(): string_book;
|
|
26
26
|
getMessages(): ReadonlyArray<ChatMessage>;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the newest parsed chat message written by the given sender.
|
|
29
|
+
*
|
|
30
|
+
* @public exported from `@promptbook/core`
|
|
31
|
+
*/
|
|
32
|
+
getLatestMessageBySender(sender: string): ChatMessage | null;
|
|
27
33
|
}
|
|
28
34
|
type Commitment = {
|
|
29
35
|
type: string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ChatParticipant } from '../../types/ChatParticipant';
|
|
2
|
+
/**
|
|
3
|
+
* Minimal participant visuals needed by chat exports.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of chat save format definitions
|
|
6
|
+
*/
|
|
7
|
+
export type ChatExportParticipantVisuals = {
|
|
8
|
+
readonly displayName: string;
|
|
9
|
+
readonly accentColor: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Formats exported timestamps into a compact human-readable label.
|
|
13
|
+
*
|
|
14
|
+
* @private internal utility of chat save format definitions
|
|
15
|
+
*/
|
|
16
|
+
export declare function formatChatExportTimestamp(value?: string | Date): string;
|
|
17
|
+
/**
|
|
18
|
+
* Builds a participant lookup indexed by both raw and upper-cased names.
|
|
19
|
+
*
|
|
20
|
+
* @private internal utility of chat save format definitions
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildChatExportParticipantMap(participants: ReadonlyArray<ChatParticipant>): ReadonlyMap<string, ChatParticipant>;
|
|
23
|
+
/**
|
|
24
|
+
* Resolves the display label and accent color for one message sender.
|
|
25
|
+
*
|
|
26
|
+
* @private internal utility of chat save format definitions
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveChatExportParticipantVisuals(participants: ReadonlyMap<string, ChatParticipant>, sender: string): ChatExportParticipantVisuals;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Promptbook branding metadata embedded into standalone chat exports.
|
|
3
|
+
*/
|
|
4
|
+
type PromptbookExportBranding = {
|
|
5
|
+
readonly productName: string;
|
|
6
|
+
readonly creatorTool: string;
|
|
7
|
+
readonly metadataSummary: string;
|
|
8
|
+
readonly keywords: ReadonlyArray<string>;
|
|
9
|
+
readonly commentLines: ReadonlyArray<string>;
|
|
10
|
+
readonly detailLines: ReadonlyArray<string>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Builds shared Promptbook export branding for standalone save formats.
|
|
14
|
+
*
|
|
15
|
+
* @private internal utility of chat save format definitions
|
|
16
|
+
*/
|
|
17
|
+
export declare function getPromptbookExportBranding(): PromptbookExportBranding;
|
|
18
|
+
export {};
|
|
@@ -7,7 +7,7 @@ import type { ChatParticipant } from '../../types/ChatParticipant';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const htmlSaveFormatDefinition: {
|
|
9
9
|
readonly formatName: "html";
|
|
10
|
-
readonly label: "
|
|
10
|
+
readonly label: "HTML";
|
|
11
11
|
readonly getContent: ({ title, messages, participants }: {
|
|
12
12
|
readonly title: string;
|
|
13
13
|
readonly messages: readonly ChatMessage[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,7 +26,7 @@ export declare const CHAT_SAVE_FORMATS: readonly [{
|
|
|
26
26
|
}, {
|
|
27
27
|
readonly formatName: "md";
|
|
28
28
|
readonly label: "Markdown";
|
|
29
|
-
readonly getContent: ({ messages }: {
|
|
29
|
+
readonly getContent: ({ messages, participants }: {
|
|
30
30
|
readonly title: string;
|
|
31
31
|
readonly messages: readonly import("../types/ChatMessage").ChatMessage[];
|
|
32
32
|
readonly participants: readonly import("../types/ChatParticipant").ChatParticipant[];
|
|
@@ -35,7 +35,7 @@ export declare const CHAT_SAVE_FORMATS: readonly [{
|
|
|
35
35
|
readonly fileExtension: "md";
|
|
36
36
|
}, {
|
|
37
37
|
readonly formatName: "html";
|
|
38
|
-
readonly label: "
|
|
38
|
+
readonly label: "HTML";
|
|
39
39
|
readonly getContent: ({ title, messages, participants }: {
|
|
40
40
|
readonly title: string;
|
|
41
41
|
readonly messages: readonly import("../types/ChatMessage").ChatMessage[];
|
|
@@ -55,8 +55,8 @@ export declare const CHAT_SAVE_FORMATS: readonly [{
|
|
|
55
55
|
readonly fileExtension: "jsx";
|
|
56
56
|
}, {
|
|
57
57
|
readonly formatName: "pdf";
|
|
58
|
-
readonly label: "
|
|
59
|
-
readonly getContent: ({ messages, participants }: {
|
|
58
|
+
readonly label: "PDF";
|
|
59
|
+
readonly getContent: ({ title, messages, participants }: {
|
|
60
60
|
readonly title: string;
|
|
61
61
|
readonly messages: readonly import("../types/ChatMessage").ChatMessage[];
|
|
62
62
|
readonly participants: readonly import("../types/ChatParticipant").ChatParticipant[];
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export declare const mdSaveFormatDefinition: {
|
|
7
7
|
readonly formatName: "md";
|
|
8
8
|
readonly label: "Markdown";
|
|
9
|
-
readonly getContent: ({ messages }: {
|
|
9
|
+
readonly getContent: ({ messages, participants }: {
|
|
10
10
|
readonly title: string;
|
|
11
11
|
readonly messages: readonly import("../../types/ChatMessage").ChatMessage[];
|
|
12
12
|
readonly participants: readonly import("../../types/ChatParticipant").ChatParticipant[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { ChatMessage } from '../../types/ChatMessage';
|
|
2
2
|
import type { ChatParticipant } from '../../types/ChatParticipant';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Builds a polished PDF representation of the provided chat.
|
|
5
5
|
*
|
|
6
|
+
* @param title - Title used in the PDF heading and metadata.
|
|
6
7
|
* @param messages - Messages that should be included in the PDF export.
|
|
7
8
|
* @param participants - Optional participant metadata to resolve sender names.
|
|
8
9
|
* @returns Binary data for the generated PDF file.
|
|
9
10
|
*
|
|
10
11
|
* @private Internal helper used by `pdfSaveFormatDefinition`.
|
|
11
12
|
*/
|
|
12
|
-
export declare function buildChatPdf(messages: ReadonlyArray<ChatMessage>, participants?: ReadonlyArray<ChatParticipant>): Uint8Array;
|
|
13
|
+
export declare function buildChatPdf(title: string, messages: ReadonlyArray<ChatMessage>, participants?: ReadonlyArray<ChatParticipant>): Uint8Array;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const pdfSaveFormatDefinition: {
|
|
7
7
|
readonly formatName: "pdf";
|
|
8
|
-
readonly label: "
|
|
9
|
-
readonly getContent: ({ messages, participants }: {
|
|
8
|
+
readonly label: "PDF";
|
|
9
|
+
readonly getContent: ({ title, messages, participants }: {
|
|
10
10
|
readonly title: string;
|
|
11
11
|
readonly messages: readonly import("../../types/ChatMessage").ChatMessage[];
|
|
12
12
|
readonly participants: readonly import("../../types/ChatParticipant").ChatParticipant[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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,10 +4,22 @@ import type { NormalizedPromptRunnerCliOptions, PromptRunnerCliOptions } from '.
|
|
|
4
4
|
*
|
|
5
5
|
* @private internal utility of `ptbk agent`
|
|
6
6
|
*/
|
|
7
|
-
export type AgentRunCliOptions = PromptRunnerCliOptions
|
|
7
|
+
export type AgentRunCliOptions = PromptRunnerCliOptions & {
|
|
8
|
+
readonly autoClone?: boolean;
|
|
9
|
+
readonly ignore?: string | readonly string[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Normalized options passed from `ptbk agent` CLI commands to the message runner.
|
|
13
|
+
*
|
|
14
|
+
* @private internal utility of `ptbk agent`
|
|
15
|
+
*/
|
|
16
|
+
export type NormalizedAgentRunCliOptions = NormalizedPromptRunnerCliOptions & {
|
|
17
|
+
readonly autoClone: boolean;
|
|
18
|
+
readonly ignorePatterns: readonly string[];
|
|
19
|
+
};
|
|
8
20
|
/**
|
|
9
21
|
* Converts Commander options into the `scripts/run-agent-messages` option shape.
|
|
10
22
|
*
|
|
11
23
|
* @private internal utility of `ptbk agent`
|
|
12
24
|
*/
|
|
13
|
-
export declare function createAgentRunOptionsFromCliOptions(cliOptions: AgentRunCliOptions):
|
|
25
|
+
export declare function createAgentRunOptionsFromCliOptions(cliOptions: AgentRunCliOptions): NormalizedAgentRunCliOptions;
|
|
@@ -11,6 +11,8 @@ type InitializeAgentRunnerCommandOptions = {
|
|
|
11
11
|
readonly aliases?: ReadonlyArray<string>;
|
|
12
12
|
readonly summary: string;
|
|
13
13
|
readonly featureLines: ReadonlyArray<string>;
|
|
14
|
+
readonly isExitingOnSuccess?: boolean;
|
|
15
|
+
readonly configureCommand?: (command: Program) => void;
|
|
14
16
|
readonly loadExecutor: () => Promise<(runOptions: ReturnType<typeof createAgentRunOptionsFromCliOptions>) => Promise<unknown>>;
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
@@ -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,20 @@
|
|
|
1
|
+
import type { PipelineExecutor } from '../../../execution/PipelineExecutor';
|
|
2
|
+
import type { PipelineJson } from '../../../pipeline/PipelineJson/PipelineJson';
|
|
3
|
+
import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeOptions';
|
|
4
|
+
import type { RunCommandCliOptions } from './runCommandAction';
|
|
5
|
+
/**
|
|
6
|
+
* Prepares the tools, pipeline, and executor required to run one `ptbk run` invocation.
|
|
7
|
+
*
|
|
8
|
+
* @private internal utility of `$initializeRunCommand`
|
|
9
|
+
*/
|
|
10
|
+
export declare function prepareRunCommandResources(options: {
|
|
11
|
+
readonly pipelineSource?: string;
|
|
12
|
+
readonly cliOptions: RunCommandCliOptions;
|
|
13
|
+
readonly prepareAndScrapeOptions: Pick<PrepareAndScrapeOptions, 'isVerbose'> & {
|
|
14
|
+
readonly isCacheReloaded: boolean;
|
|
15
|
+
};
|
|
16
|
+
readonly logStage: (stage: string) => void;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
readonly pipeline: PipelineJson;
|
|
19
|
+
readonly pipelineExecutor: PipelineExecutor;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PipelineJson } from '../../../pipeline/PipelineJson/PipelineJson';
|
|
2
|
+
import type { string_parameter_name, string_parameter_value } from '../../../types/string_name';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves all missing input parameters while keeping the current interactive and non-interactive behavior.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `$initializeRunCommand`
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveRunInputParameters(options: {
|
|
9
|
+
readonly pipeline: PipelineJson;
|
|
10
|
+
readonly inputParameters: Record<string_parameter_name, string_parameter_value>;
|
|
11
|
+
readonly isInteractive: boolean;
|
|
12
|
+
}): Promise<Record<string_parameter_name, string_parameter_value>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI options consumed by the `run` command action.
|
|
3
|
+
*
|
|
4
|
+
* @private internal utility of `$initializeRunCommand`
|
|
5
|
+
*/
|
|
6
|
+
export type RunCommandCliOptions = {
|
|
7
|
+
readonly reload: boolean;
|
|
8
|
+
readonly interactive: boolean;
|
|
9
|
+
readonly formfactor: boolean;
|
|
10
|
+
readonly json?: string;
|
|
11
|
+
readonly verbose: boolean;
|
|
12
|
+
readonly saveReport?: string;
|
|
13
|
+
readonly provider: string;
|
|
14
|
+
readonly remoteServerUrl: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Runs the whole `ptbk run` flow as a top-down orchestration of focused steps.
|
|
18
|
+
*
|
|
19
|
+
* @private internal utility of `$initializeRunCommand`
|
|
20
|
+
*/
|
|
21
|
+
export declare function runCommandAction(pipelineSource: string | undefined, cliOptions: RunCommandCliOptions): Promise<void | never>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PipelineExecutor } from '../../../execution/PipelineExecutor';
|
|
2
|
+
import type { string_parameter_name, string_parameter_value } from '../../../types/string_name';
|
|
3
|
+
/**
|
|
4
|
+
* Executes the pipeline, persists any requested report, and prints the final CLI output.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `$initializeRunCommand`
|
|
7
|
+
*/
|
|
8
|
+
export declare function runPipelineExecution(options: {
|
|
9
|
+
readonly pipelineExecutor: PipelineExecutor;
|
|
10
|
+
readonly inputParameters: Record<string_parameter_name, string_parameter_value>;
|
|
11
|
+
readonly isVerbose: boolean;
|
|
12
|
+
readonly json?: string;
|
|
13
|
+
readonly saveReport?: string;
|
|
14
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
|
|
2
|
+
import type { MarkdownSection } from '../../utils/markdown/parseMarkdownSection';
|
|
3
|
+
/**
|
|
4
|
+
* Applies the pipeline head title, description, and head-level commands.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `parsePipeline`
|
|
7
|
+
*/
|
|
8
|
+
export declare function applyPipelineHead(pipelineHead: MarkdownSection, $pipelineJson: $PipelineJson): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
|
|
2
|
+
import type { PipelineString } from '../../pipeline/PipelineString';
|
|
3
|
+
/**
|
|
4
|
+
* Creates the mutable pipeline JSON structure used throughout parsing.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `parsePipeline`
|
|
7
|
+
*/
|
|
8
|
+
export declare function createInitialPipelineJson(pipelineString: PipelineString): $PipelineJson;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { string_name } from '../../types/string_name';
|
|
2
|
+
import type { MarkdownSection } from '../../utils/markdown/parseMarkdownSection';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a unique task name for one parsed markdown section title.
|
|
5
|
+
*
|
|
6
|
+
* @private internal type of `parsePipeline`
|
|
7
|
+
*/
|
|
8
|
+
export type UniqueSectionNameResolver = (title: string) => string_name;
|
|
9
|
+
/**
|
|
10
|
+
* Creates stable unique task names for duplicate section titles.
|
|
11
|
+
*
|
|
12
|
+
* @private internal utility of `parsePipeline`
|
|
13
|
+
*/
|
|
14
|
+
export declare function createUniqueSectionNameResolver(pipelineSections: ReadonlyArray<MarkdownSection>): UniqueSectionNameResolver;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ParameterCommand } from '../../commands/PARAMETER/ParameterCommand';
|
|
2
|
+
import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
|
|
3
|
+
/**
|
|
4
|
+
* Merges one parameter declaration into the mutable pipeline parameter list.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `parsePipeline`
|
|
7
|
+
*/
|
|
8
|
+
export declare function defineParameter($pipelineJson: $PipelineJson, parameterCommand: Omit<ParameterCommand, 'type'>): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
|
|
2
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
3
|
+
/**
|
|
4
|
+
* Applies postprocessing and exports the parsed pipeline JSON.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `parsePipeline`
|
|
7
|
+
*/
|
|
8
|
+
export declare function finalizeParsedPipeline($pipelineJson: $PipelineJson): PipelineJson;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a short file/url identification block for parse errors.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `parsePipeline`
|
|
6
|
+
*/
|
|
7
|
+
export declare function getPipelineIdentification($pipelineJson: $PipelineJson): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
|
|
2
|
+
import type { MarkdownSection } from '../../utils/markdown/parseMarkdownSection';
|
|
3
|
+
import type { PipelineString } from '../../pipeline/PipelineString';
|
|
4
|
+
/**
|
|
5
|
+
* Parsed markdown structure split into the pipeline head and task sections.
|
|
6
|
+
*
|
|
7
|
+
* @private internal type of `parsePipeline`
|
|
8
|
+
*/
|
|
9
|
+
export type ParsedPipelineSections = {
|
|
10
|
+
readonly pipelineHead: MarkdownSection;
|
|
11
|
+
readonly pipelineSections: ReadonlyArray<MarkdownSection>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Splits the prepared markdown into the pipeline head and task sections.
|
|
15
|
+
*
|
|
16
|
+
* @private internal utility of `parsePipeline`
|
|
17
|
+
*/
|
|
18
|
+
export declare function parsePreparedPipelineSections(pipelineString: PipelineString, $pipelineJson: $PipelineJson): ParsedPipelineSections;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
|
|
2
|
+
import type { PipelineString } from '../../pipeline/PipelineString';
|
|
3
|
+
/**
|
|
4
|
+
* Removes shebang/comments and normalizes markdown into a parseable pipeline form.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `parsePipeline`
|
|
7
|
+
*/
|
|
8
|
+
export declare function preparePipelineString(pipelineString: PipelineString, $pipelineJson: $PipelineJson): PipelineString;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
|
|
2
|
+
import type { MarkdownSection } from '../../utils/markdown/parseMarkdownSection';
|
|
3
|
+
import type { UniqueSectionNameResolver } from './createUniqueSectionNameResolver';
|
|
4
|
+
/**
|
|
5
|
+
* Parses, applies, and persists one h2 task section.
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `parsePipeline`
|
|
8
|
+
*/
|
|
9
|
+
export declare function processPipelineSection(pipelineSection: MarkdownSection, $pipelineJson: $PipelineJson, getUniqueSectionName: UniqueSectionNameResolver): void;
|
|
@@ -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;
|