@promptbook/remote-client 0.112.0-72 → 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.
Files changed (159) hide show
  1. package/esm/index.es.js +1 -1
  2. package/esm/src/book-components/Chat/save/_common/chatExportRendering.d.ts +28 -0
  3. package/esm/src/book-components/Chat/save/_common/getPromptbookExportBranding.d.ts +18 -0
  4. package/esm/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +1 -1
  5. package/esm/src/book-components/Chat/save/html/htmlSaveFormatDefinition.test.d.ts +1 -0
  6. package/esm/src/book-components/Chat/save/index.d.ts +4 -4
  7. package/esm/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.d.ts +1 -1
  8. package/esm/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.test.d.ts +1 -0
  9. package/esm/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +3 -2
  10. package/esm/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +2 -2
  11. package/esm/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.test.d.ts +1 -0
  12. package/esm/src/book-components/Chat/save/react/reactSaveFormatDefinition.test.d.ts +1 -0
  13. package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +26 -0
  14. package/esm/src/cli/cli-commands/agent/agentRunCliOptions.d.ts +2 -0
  15. package/esm/src/cli/cli-commands/agent/initializeAgentRunnerCommand.d.ts +1 -0
  16. package/esm/src/cli/cli-commands/common/handleActionErrors.d.ts +9 -4
  17. package/esm/src/conversion/pipelineJsonToString/appendMarkdownBlock.d.ts +7 -0
  18. package/esm/src/conversion/pipelineJsonToString/createPipelineCommands.d.ts +7 -0
  19. package/esm/src/conversion/pipelineJsonToString/createPipelineIntroduction.d.ts +8 -0
  20. package/esm/src/conversion/pipelineJsonToString/createTaskSerialization.d.ts +23 -0
  21. package/esm/src/conversion/pipelineJsonToString/stringifyCommands.d.ts +7 -0
  22. package/esm/src/conversion/pipelineJsonToString/stringifyTask.d.ts +8 -0
  23. package/esm/src/conversion/pipelineJsonToString.test.d.ts +1 -0
  24. package/esm/src/execution/createPipelineExecutor/executeSingleAttempt.d.ts +31 -0
  25. package/esm/src/execution/createPipelineExecutor/handleAttemptFailure.d.ts +40 -0
  26. package/esm/src/execution/createPipelineExecutor/reportPromptExecution.d.ts +34 -0
  27. package/esm/src/execution/resolveTaskTldr.d.ts +32 -0
  28. package/esm/src/execution/resolveTaskTldr.test.d.ts +1 -0
  29. package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +22 -63
  30. package/esm/src/llm-providers/agent/AgentLlmExecutionToolsAgentKitRunner.d.ts +51 -0
  31. package/esm/src/llm-providers/agent/AgentLlmExecutionToolsOpenAiAssistantRunner.d.ts +43 -0
  32. package/esm/src/llm-providers/agent/AgentLlmExecutionToolsPromptPreparer.d.ts +41 -0
  33. package/esm/src/llm-providers/agent/emitAgentLlmExecutionToolsAssistantPreparationProgress.d.ts +26 -0
  34. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +16 -93
  35. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsInputBuilder.d.ts +41 -0
  36. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOutputTypeMapper.d.ts +56 -0
  37. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +99 -0
  38. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +24 -120
  39. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsProgressReporter.d.ts +62 -0
  40. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsPromptBuilder.d.ts +29 -0
  41. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +63 -0
  42. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +89 -0
  43. package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +9 -28
  44. package/esm/src/llm-providers/openai/OpenAiCompatibleModelCatalog.d.ts +31 -0
  45. package/esm/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +57 -0
  46. package/esm/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +29 -0
  47. package/esm/src/llm-providers/openai/OpenAiVectorStoreFileBatchHandler.d.ts +51 -0
  48. package/esm/src/llm-providers/openai/OpenAiVectorStoreFileBatchPoller.d.ts +75 -0
  49. package/esm/src/llm-providers/openai/OpenAiVectorStoreHandler.d.ts +1 -98
  50. package/esm/src/llm-providers/openai/OpenAiVectorStoreKnowledgeSourcePreparer.d.ts +44 -0
  51. package/esm/src/llm-providers/openai/utils/OpenAiCompatibleChatProgressReporter.d.ts +86 -0
  52. package/esm/src/llm-providers/openai/utils/OpenAiCompatibleChatPromptBuilder.d.ts +57 -0
  53. package/esm/src/llm-providers/openai/utils/OpenAiCompatibleChatToolCaller.d.ts +57 -0
  54. package/esm/src/remote-server/startRemoteServer/RemoteServerRuntime.d.ts +14 -0
  55. package/esm/src/remote-server/startRemoteServer/SocketResponse.d.ts +9 -0
  56. package/esm/src/remote-server/startRemoteServer/StartRemoteServerConfiguration.d.ts +18 -0
  57. package/esm/src/remote-server/startRemoteServer/createRemoteServerExpressApp.d.ts +7 -0
  58. package/esm/src/remote-server/startRemoteServer/createRemoteServerHandle.d.ts +11 -0
  59. package/esm/src/remote-server/startRemoteServer/createSocketServer.d.ts +9 -0
  60. package/esm/src/remote-server/startRemoteServer/getExecutionToolsFromIdentification.d.ts +12 -0
  61. package/esm/src/remote-server/startRemoteServer/registerBookRoutes.d.ts +7 -0
  62. package/esm/src/remote-server/startRemoteServer/registerExecutionRoutes.d.ts +7 -0
  63. package/esm/src/remote-server/startRemoteServer/registerListModelsSocketHandler.d.ts +8 -0
  64. package/esm/src/remote-server/startRemoteServer/registerLoginRoute.d.ts +7 -0
  65. package/esm/src/remote-server/startRemoteServer/registerNotFoundRoute.d.ts +7 -0
  66. package/esm/src/remote-server/startRemoteServer/registerOpenAiCompatibleChatCompletionsRoute.d.ts +7 -0
  67. package/esm/src/remote-server/startRemoteServer/registerOpenApiRoutes.d.ts +7 -0
  68. package/esm/src/remote-server/startRemoteServer/registerPreparePipelineSocketHandler.d.ts +8 -0
  69. package/esm/src/remote-server/startRemoteServer/registerPromptSocketHandler.d.ts +8 -0
  70. package/esm/src/remote-server/startRemoteServer/registerRemoteServerHttpRoutes.d.ts +7 -0
  71. package/esm/src/remote-server/startRemoteServer/registerRemoteServerSocketHandlers.d.ts +8 -0
  72. package/esm/src/remote-server/startRemoteServer/registerServerIndexRoute.d.ts +7 -0
  73. package/esm/src/remote-server/startRemoteServer/resolveStartRemoteServerConfiguration.d.ts +8 -0
  74. package/esm/src/remote-server/startRemoteServer/respondToSocketRequest.d.ts +8 -0
  75. package/esm/src/remote-server/startRemoteServer/startListening.d.ts +9 -0
  76. package/esm/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +14 -1
  77. package/esm/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -0
  78. package/esm/src/utils/serialization/serializeToPromptbookJavascript.test.d.ts +1 -0
  79. package/esm/src/version.d.ts +1 -1
  80. package/package.json +2 -2
  81. package/umd/index.umd.js +1 -1
  82. package/umd/src/book-components/Chat/save/_common/chatExportRendering.d.ts +28 -0
  83. package/umd/src/book-components/Chat/save/_common/getPromptbookExportBranding.d.ts +18 -0
  84. package/umd/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +1 -1
  85. package/umd/src/book-components/Chat/save/html/htmlSaveFormatDefinition.test.d.ts +1 -0
  86. package/umd/src/book-components/Chat/save/index.d.ts +4 -4
  87. package/umd/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.d.ts +1 -1
  88. package/umd/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.test.d.ts +1 -0
  89. package/umd/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +3 -2
  90. package/umd/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +2 -2
  91. package/umd/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.test.d.ts +1 -0
  92. package/umd/src/book-components/Chat/save/react/reactSaveFormatDefinition.test.d.ts +1 -0
  93. package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +26 -0
  94. package/umd/src/cli/cli-commands/agent/agentRunCliOptions.d.ts +2 -0
  95. package/umd/src/cli/cli-commands/agent/initializeAgentRunnerCommand.d.ts +1 -0
  96. package/umd/src/cli/cli-commands/common/handleActionErrors.d.ts +9 -4
  97. package/umd/src/conversion/pipelineJsonToString/appendMarkdownBlock.d.ts +7 -0
  98. package/umd/src/conversion/pipelineJsonToString/createPipelineCommands.d.ts +7 -0
  99. package/umd/src/conversion/pipelineJsonToString/createPipelineIntroduction.d.ts +8 -0
  100. package/umd/src/conversion/pipelineJsonToString/createTaskSerialization.d.ts +23 -0
  101. package/umd/src/conversion/pipelineJsonToString/stringifyCommands.d.ts +7 -0
  102. package/umd/src/conversion/pipelineJsonToString/stringifyTask.d.ts +8 -0
  103. package/umd/src/conversion/pipelineJsonToString.test.d.ts +1 -0
  104. package/umd/src/execution/createPipelineExecutor/executeSingleAttempt.d.ts +31 -0
  105. package/umd/src/execution/createPipelineExecutor/handleAttemptFailure.d.ts +40 -0
  106. package/umd/src/execution/createPipelineExecutor/reportPromptExecution.d.ts +34 -0
  107. package/umd/src/execution/resolveTaskTldr.d.ts +32 -0
  108. package/umd/src/execution/resolveTaskTldr.test.d.ts +1 -0
  109. package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +22 -63
  110. package/umd/src/llm-providers/agent/AgentLlmExecutionToolsAgentKitRunner.d.ts +51 -0
  111. package/umd/src/llm-providers/agent/AgentLlmExecutionToolsOpenAiAssistantRunner.d.ts +43 -0
  112. package/umd/src/llm-providers/agent/AgentLlmExecutionToolsPromptPreparer.d.ts +41 -0
  113. package/umd/src/llm-providers/agent/emitAgentLlmExecutionToolsAssistantPreparationProgress.d.ts +26 -0
  114. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +16 -93
  115. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsInputBuilder.d.ts +41 -0
  116. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOutputTypeMapper.d.ts +56 -0
  117. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +99 -0
  118. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +24 -120
  119. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsProgressReporter.d.ts +62 -0
  120. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsPromptBuilder.d.ts +29 -0
  121. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +63 -0
  122. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +89 -0
  123. package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +9 -28
  124. package/umd/src/llm-providers/openai/OpenAiCompatibleModelCatalog.d.ts +31 -0
  125. package/umd/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +57 -0
  126. package/umd/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +29 -0
  127. package/umd/src/llm-providers/openai/OpenAiVectorStoreFileBatchHandler.d.ts +51 -0
  128. package/umd/src/llm-providers/openai/OpenAiVectorStoreFileBatchPoller.d.ts +75 -0
  129. package/umd/src/llm-providers/openai/OpenAiVectorStoreHandler.d.ts +1 -98
  130. package/umd/src/llm-providers/openai/OpenAiVectorStoreKnowledgeSourcePreparer.d.ts +44 -0
  131. package/umd/src/llm-providers/openai/utils/OpenAiCompatibleChatProgressReporter.d.ts +86 -0
  132. package/umd/src/llm-providers/openai/utils/OpenAiCompatibleChatPromptBuilder.d.ts +57 -0
  133. package/umd/src/llm-providers/openai/utils/OpenAiCompatibleChatToolCaller.d.ts +57 -0
  134. package/umd/src/remote-server/startRemoteServer/RemoteServerRuntime.d.ts +14 -0
  135. package/umd/src/remote-server/startRemoteServer/SocketResponse.d.ts +9 -0
  136. package/umd/src/remote-server/startRemoteServer/StartRemoteServerConfiguration.d.ts +18 -0
  137. package/umd/src/remote-server/startRemoteServer/createRemoteServerExpressApp.d.ts +7 -0
  138. package/umd/src/remote-server/startRemoteServer/createRemoteServerHandle.d.ts +11 -0
  139. package/umd/src/remote-server/startRemoteServer/createSocketServer.d.ts +9 -0
  140. package/umd/src/remote-server/startRemoteServer/getExecutionToolsFromIdentification.d.ts +12 -0
  141. package/umd/src/remote-server/startRemoteServer/registerBookRoutes.d.ts +7 -0
  142. package/umd/src/remote-server/startRemoteServer/registerExecutionRoutes.d.ts +7 -0
  143. package/umd/src/remote-server/startRemoteServer/registerListModelsSocketHandler.d.ts +8 -0
  144. package/umd/src/remote-server/startRemoteServer/registerLoginRoute.d.ts +7 -0
  145. package/umd/src/remote-server/startRemoteServer/registerNotFoundRoute.d.ts +7 -0
  146. package/umd/src/remote-server/startRemoteServer/registerOpenAiCompatibleChatCompletionsRoute.d.ts +7 -0
  147. package/umd/src/remote-server/startRemoteServer/registerOpenApiRoutes.d.ts +7 -0
  148. package/umd/src/remote-server/startRemoteServer/registerPreparePipelineSocketHandler.d.ts +8 -0
  149. package/umd/src/remote-server/startRemoteServer/registerPromptSocketHandler.d.ts +8 -0
  150. package/umd/src/remote-server/startRemoteServer/registerRemoteServerHttpRoutes.d.ts +7 -0
  151. package/umd/src/remote-server/startRemoteServer/registerRemoteServerSocketHandlers.d.ts +8 -0
  152. package/umd/src/remote-server/startRemoteServer/registerServerIndexRoute.d.ts +7 -0
  153. package/umd/src/remote-server/startRemoteServer/resolveStartRemoteServerConfiguration.d.ts +8 -0
  154. package/umd/src/remote-server/startRemoteServer/respondToSocketRequest.d.ts +8 -0
  155. package/umd/src/remote-server/startRemoteServer/startListening.d.ts +9 -0
  156. package/umd/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +14 -1
  157. package/umd/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -0
  158. package/umd/src/utils/serialization/serializeToPromptbookJavascript.test.d.ts +1 -0
  159. 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-72';
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
@@ -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: "Html";
10
+ readonly label: "HTML";
11
11
  readonly getContent: ({ title, messages, participants }: {
12
12
  readonly title: string;
13
13
  readonly messages: readonly ChatMessage[];
@@ -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: "Html";
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: "Pdf";
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[];
@@ -1,12 +1,13 @@
1
1
  import type { ChatMessage } from '../../types/ChatMessage';
2
2
  import type { ChatParticipant } from '../../types/ChatParticipant';
3
3
  /**
4
- * Creates a minimal PDF representation of the provided chat.
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: "Pdf";
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,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 {};
@@ -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 isExitingOnSuccess?: boolean;
14
15
  readonly configureCommand?: (command: Program) => void;
15
16
  readonly loadExecutor: () => Promise<(runOptions: ReturnType<typeof createAgentRunOptionsFromCliOptions>) => Promise<unknown>>;
16
17
  };
@@ -4,12 +4,17 @@ import type { Command as Program } from 'commander';
4
4
  */
5
5
  type actionCallbackFunction = Parameters<Program['action']>[0];
6
6
  /**
7
- * Wraps action to handle error console logging and exit process with error code
7
+ * Options controlling CLI process-exit behavior after one command action finishes.
8
8
  *
9
- * @param action Action to be wrapped in error handling
10
- * @returns Wrapped action
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,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 {};
@@ -0,0 +1 @@
1
+ export {};
@@ -27,50 +27,49 @@ import type { CreateAgentLlmExecutionToolsOptions } from './CreateAgentLlmExecut
27
27
  export declare class AgentLlmExecutionTools implements LlmExecutionTools {
28
28
  protected readonly options: CreateAgentLlmExecutionToolsOptions;
29
29
  /**
30
- * Cached AgentKit agents to avoid rebuilding identical instances.
30
+ * Cached model requirements to avoid re-parsing the agent source.
31
31
  */
32
- private static agentKitAgentCache;
32
+ private _cachedModelRequirements;
33
33
  /**
34
- * Cache of OpenAI assistants to avoid creating duplicates
34
+ * Cached parsed agent information.
35
35
  */
36
- private static assistantCache;
36
+ private _cachedAgentInfo;
37
37
  /**
38
- * Cache of OpenAI vector stores to avoid creating duplicates
38
+ * Optional server-precomputed model requirements reused until the source changes.
39
39
  */
40
- private static vectorStoreCache;
40
+ private precomputedModelRequirements;
41
41
  /**
42
- * Cached model requirements to avoid re-parsing the agent source
42
+ * Dedicated prompt preparation facade used before backend dispatch.
43
43
  */
44
- private _cachedModelRequirements;
44
+ private readonly promptPreparer;
45
45
  /**
46
- * Cached parsed agent information
46
+ * Dedicated OpenAI AgentKit runner used when the wrapped tools support AgentKit preparation.
47
47
  */
48
- private _cachedAgentInfo;
48
+ private readonly agentKitRunner;
49
49
  /**
50
- * Optional server-precomputed model requirements reused until the source changes.
50
+ * Dedicated OpenAI Assistant runner used when the wrapped tools use Assistants.
51
51
  */
52
- private precomputedModelRequirements;
52
+ private readonly openAiAssistantRunner;
53
53
  /**
54
- * Creates new AgentLlmExecutionTools
54
+ * Creates new AgentLlmExecutionTools.
55
55
  *
56
- * @param llmTools The underlying LLM execution tools to wrap
57
- * @param agentSource The agent source string that defines the agent's behavior
56
+ * @param options - The underlying LLM tools and agent source configuration.
58
57
  */
59
58
  constructor(options: CreateAgentLlmExecutionToolsOptions);
60
59
  /**
61
- * Updates the agent source and clears the cache
60
+ * Updates the agent source and clears the cache.
62
61
  *
63
- * @param agentSource The new agent source string
62
+ * @param agentSource - The new agent source string.
64
63
  */
65
64
  protected updateAgentSource(agentSource: string_book): void;
66
65
  /**
67
- * Get cached or parse agent information
66
+ * Returns cached or parsed agent information.
68
67
  */
69
68
  private getAgentInfo;
70
69
  /**
71
- * Get cached or create agent model requirements
70
+ * Returns cached or compiled agent model requirements.
72
71
  *
73
- * Note: [🐤] This is names `getModelRequirements` *(not `getAgentModelRequirements`)* because in future these two will be united
72
+ * Note: [🐤] This is named `getModelRequirements` *(not `getAgentModelRequirements`)* because in future these two will be united.
74
73
  */
75
74
  getModelRequirements(): Promise<AgentModelRequirements>;
76
75
  get title(): string_title & string_markdown_text;
@@ -78,62 +77,22 @@ export declare class AgentLlmExecutionTools implements LlmExecutionTools {
78
77
  get profile(): ChatParticipant | undefined;
79
78
  checkConfiguration(): Promisable<void>;
80
79
  /**
81
- * Returns a virtual model name representing the agent behavior
80
+ * Returns a virtual model name representing the agent behavior.
82
81
  */
83
82
  get modelName(): string_model_name;
84
83
  listModels(): Promisable<ReadonlyArray<AvailableModel>>;
85
84
  /**
86
- * Calls the chat model with agent-specific system prompt and requirements
85
+ * Calls the chat model with agent-specific system prompt and requirements.
87
86
  */
88
87
  callChatModel(prompt: Prompt): Promise<ChatPromptResult>;
89
88
  /**
90
- * Calls the chat model with agent-specific system prompt and requirements with streaming
89
+ * Calls the chat model with agent-specific system prompt and requirements with streaming.
91
90
  */
92
91
  callChatModelStream(prompt: Prompt, onProgress: (chunk: ChatPromptResult) => void, options?: CallChatModelStreamOptions): Promise<ChatPromptResult>;
93
- /**
94
- * Ensures the agent wrapper only processes chat prompts.
95
- */
96
- private requireChatPrompt;
97
- /**
98
- * Resolves agent requirements, attachments, and runtime overrides into one forwarded chat prompt.
99
- */
100
- private prepareChatPrompt;
101
- /**
102
- * Removes bookkeeping-only properties from compiled agent requirements before forwarding them.
103
- */
104
- private getSanitizedAgentModelRequirements;
105
92
  /**
106
93
  * Dispatches one prepared agent prompt to the correct underlying LLM backend.
107
94
  */
108
95
  private callPreparedChatModelStream;
109
- /**
110
- * Runs one prepared prompt through the OpenAI AgentKit backend.
111
- */
112
- private callOpenAiAgentKitChatModelStream;
113
- /**
114
- * Resolves the AgentKit cache state for the current prompt, including external and in-memory caches.
115
- */
116
- private resolveAgentKitCacheState;
117
- /**
118
- * Returns a prepared AgentKit agent, creating one only when the cache could not satisfy the request.
119
- */
120
- private getOrPrepareAgentKitAgent;
121
- /**
122
- * Stores freshly prepared AgentKit resources back into the in-memory caches when caching is allowed.
123
- */
124
- private storeAgentKitCache;
125
- /**
126
- * Runs one prepared prompt through the deprecated OpenAI Assistant backend.
127
- */
128
- private callOpenAiAssistantChatModelStream;
129
- /**
130
- * Returns an assistant instance matching the current agent requirements, reusing caches when possible.
131
- */
132
- private getOrPrepareOpenAiAssistant;
133
- /**
134
- * Stores one assistant id in the shared assistant cache for this agent title.
135
- */
136
- private storeAssistantCache;
137
96
  /**
138
97
  * Runs one prepared prompt through generic LLM tools that do not need special assistant preparation.
139
98
  */
@@ -0,0 +1,51 @@
1
+ import type { CallChatModelStreamOptions } from '../../execution/LlmExecutionTools';
2
+ import type { ChatPromptResult, CommonPromptResult } from '../../execution/PromptResult';
3
+ import type { Prompt } from '../../types/Prompt';
4
+ import type { string_model_name } from '../../types/string_model_name';
5
+ import type { string_title } from '../../types/string_title';
6
+ import { OpenAiAgentKitExecutionTools } from '../openai/OpenAiAgentKitExecutionTools';
7
+ import type { AgentLlmExecutionToolsPromptPreparer } from './AgentLlmExecutionToolsPromptPreparer';
8
+ /**
9
+ * Handles OpenAI AgentKit-backed executions for `AgentLlmExecutionTools`.
10
+ *
11
+ * @private internal utility of `AgentLlmExecutionTools`
12
+ */
13
+ export declare class AgentLlmExecutionToolsAgentKitRunner {
14
+ private readonly context;
15
+ /**
16
+ * Cached AgentKit agents to avoid rebuilding identical instances.
17
+ */
18
+ private static agentKitAgentCache;
19
+ /**
20
+ * Cache of OpenAI vector stores to avoid creating duplicates.
21
+ */
22
+ private static vectorStoreCache;
23
+ constructor(context: {
24
+ readonly getTitle: () => string_title;
25
+ readonly getModelName: () => string_model_name;
26
+ readonly isVerbose?: boolean;
27
+ readonly assistantPreparationMode?: 'internal' | 'external';
28
+ });
29
+ /**
30
+ * Runs one prepared prompt through the OpenAI AgentKit backend.
31
+ */
32
+ callChatModelStream(options: {
33
+ readonly llmTools: OpenAiAgentKitExecutionTools;
34
+ readonly originalPrompt: Prompt;
35
+ readonly preparedChatPrompt: Awaited<ReturnType<AgentLlmExecutionToolsPromptPreparer['prepareChatPrompt']>>;
36
+ readonly onProgress: (chunk: ChatPromptResult) => void;
37
+ readonly streamOptions?: CallChatModelStreamOptions;
38
+ }): Promise<CommonPromptResult>;
39
+ /**
40
+ * Resolves the AgentKit cache state for the current prompt, including external and in-memory caches.
41
+ */
42
+ private resolveAgentKitCacheState;
43
+ /**
44
+ * Returns a prepared AgentKit agent, creating one only when the cache could not satisfy the request.
45
+ */
46
+ private getOrPrepareAgentKitAgent;
47
+ /**
48
+ * Stores freshly prepared AgentKit resources back into the in-memory caches when caching is allowed.
49
+ */
50
+ private storeAgentKitCache;
51
+ }