@promptbook/core 0.112.0-98 → 0.112.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +37 -21
  2. package/esm/index.es.js +1767 -128
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/servers.d.ts +1 -9
  5. package/esm/src/_packages/components.index.d.ts +4 -0
  6. package/esm/src/_packages/core.index.d.ts +0 -2
  7. package/esm/src/_packages/node.index.d.ts +40 -0
  8. package/esm/src/_packages/types.index.d.ts +18 -0
  9. package/esm/src/avatars/avatarAnimationScheduler.d.ts +4 -0
  10. package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
  11. package/esm/src/avatars/visuals/octopus3d3AvatarVisual.d.ts +7 -0
  12. package/esm/src/avatars/visuals/octopus3d4AvatarVisual.d.ts +7 -0
  13. package/esm/src/book-3.0/BookNodeAgentSource.d.ts +38 -0
  14. package/esm/src/book-3.0/CliAgent.d.ts +66 -0
  15. package/esm/src/book-3.0/CliAgent.test.d.ts +1 -0
  16. package/esm/src/book-3.0/LiteAgent.d.ts +68 -0
  17. package/esm/src/book-3.0/LiteAgent.test.d.ts +1 -0
  18. package/esm/src/book-3.0/agentFolderPaths.d.ts +30 -0
  19. package/esm/src/book-3.0/cliAgentEnv.d.ts +33 -0
  20. package/esm/src/book-components/BookEditor/BookEditor.d.ts +6 -5
  21. package/esm/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.d.ts +12 -0
  22. package/esm/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
  23. package/esm/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
  24. package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
  25. package/esm/src/book-components/BookEditor/BookEditorTheme.d.ts +24 -0
  26. package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
  27. package/esm/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +1 -6
  28. package/esm/src/book-components/BookEditor/useBookEditorMonacoLifecycle.d.ts +1 -4
  29. package/esm/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +2 -1
  30. package/esm/src/book-components/Chat/Chat/ChatCitationModal.d.ts +2 -0
  31. package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
  32. package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
  33. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +5 -0
  34. package/esm/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +2 -0
  35. package/esm/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +3 -1
  36. package/esm/src/book-components/Chat/Chat/CitationIframePreview.d.ts +20 -0
  37. package/esm/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +2 -0
  38. package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
  39. package/esm/src/book-components/Chat/SourceChip/SourceChip.d.ts +6 -1
  40. package/esm/src/book-components/Chat/hooks/useResolvedCitationLabel.d.ts +12 -0
  41. package/esm/src/book-components/Chat/types/ChatMessage.d.ts +4 -0
  42. package/esm/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
  43. package/esm/src/book-components/Chat/types/CitationLabelResolver.d.ts +8 -0
  44. package/esm/src/book-components/Chat/utils/citationHelpers.d.ts +9 -0
  45. package/esm/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.d.ts +14 -0
  46. package/esm/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.test.d.ts +1 -0
  47. package/esm/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +10 -0
  48. package/esm/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +4 -0
  49. package/esm/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
  50. package/esm/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +1 -1
  51. package/esm/src/book-components/_common/Modal/Modal.d.ts +1 -1
  52. package/esm/src/book-components/icons/AboutIcon.d.ts +1 -1
  53. package/esm/src/book-components/icons/DownloadIcon.d.ts +1 -1
  54. package/esm/src/book-components/icons/ExitFullscreenIcon.d.ts +1 -1
  55. package/esm/src/book-components/icons/FullscreenIcon.d.ts +1 -1
  56. package/esm/src/cli/cli-commands/agent/agentCliOptions.d.ts +38 -0
  57. package/esm/src/cli/cli-commands/agent/chat.d.ts +10 -0
  58. package/esm/src/cli/cli-commands/agent/exec.d.ts +10 -0
  59. package/esm/src/cli/cli-commands/agent/run.test.d.ts +1 -0
  60. package/esm/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -24
  61. package/esm/src/cli/cli-commands/agent.d.ts +14 -0
  62. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +17 -1
  63. package/esm/src/cli/cli-commands/agents-server/run.d.ts +6 -0
  64. package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +9 -2
  65. package/esm/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
  66. package/esm/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.d.ts +25 -0
  67. package/esm/src/cli/cli-commands/coder/find-unwritten.d.ts +10 -0
  68. package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +2 -0
  69. package/esm/src/cli/cli-commands/coder/server.d.ts +13 -0
  70. package/esm/src/cli/cli-commands/coder/waitOptions.d.ts +14 -0
  71. package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +9 -25
  72. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
  73. package/esm/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -1
  74. package/esm/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
  75. package/esm/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
  76. package/esm/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
  77. package/esm/src/utils/isTimingSafeEqualString.d.ts +25 -0
  78. package/esm/src/utils/validators/url/isValidAgentUrl.d.ts +5 -0
  79. package/esm/src/version.d.ts +1 -1
  80. package/package.json +1 -1
  81. package/umd/index.umd.js +1769 -129
  82. package/umd/index.umd.js.map +1 -1
  83. package/umd/servers.d.ts +1 -9
  84. package/umd/src/_packages/components.index.d.ts +4 -0
  85. package/umd/src/_packages/core.index.d.ts +0 -2
  86. package/umd/src/_packages/node.index.d.ts +40 -0
  87. package/umd/src/_packages/types.index.d.ts +18 -0
  88. package/umd/src/avatars/avatarAnimationScheduler.d.ts +4 -0
  89. package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
  90. package/umd/src/avatars/visuals/octopus3d3AvatarVisual.d.ts +7 -0
  91. package/umd/src/avatars/visuals/octopus3d4AvatarVisual.d.ts +7 -0
  92. package/umd/src/book-3.0/BookNodeAgentSource.d.ts +38 -0
  93. package/umd/src/book-3.0/CliAgent.d.ts +66 -0
  94. package/umd/src/book-3.0/CliAgent.test.d.ts +1 -0
  95. package/umd/src/book-3.0/LiteAgent.d.ts +68 -0
  96. package/umd/src/book-3.0/LiteAgent.test.d.ts +1 -0
  97. package/umd/src/book-3.0/agentFolderPaths.d.ts +30 -0
  98. package/umd/src/book-3.0/cliAgentEnv.d.ts +33 -0
  99. package/umd/src/book-components/BookEditor/BookEditor.d.ts +6 -5
  100. package/umd/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.d.ts +12 -0
  101. package/umd/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
  102. package/umd/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
  103. package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
  104. package/umd/src/book-components/BookEditor/BookEditorTheme.d.ts +24 -0
  105. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
  106. package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +1 -6
  107. package/umd/src/book-components/BookEditor/useBookEditorMonacoLifecycle.d.ts +1 -4
  108. package/umd/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +2 -1
  109. package/umd/src/book-components/Chat/Chat/ChatCitationModal.d.ts +2 -0
  110. package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
  111. package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
  112. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +5 -0
  113. package/umd/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +2 -0
  114. package/umd/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +3 -1
  115. package/umd/src/book-components/Chat/Chat/CitationIframePreview.d.ts +20 -0
  116. package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +2 -0
  117. package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
  118. package/umd/src/book-components/Chat/SourceChip/SourceChip.d.ts +6 -1
  119. package/umd/src/book-components/Chat/hooks/useResolvedCitationLabel.d.ts +12 -0
  120. package/umd/src/book-components/Chat/types/ChatMessage.d.ts +4 -0
  121. package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
  122. package/umd/src/book-components/Chat/types/CitationLabelResolver.d.ts +8 -0
  123. package/umd/src/book-components/Chat/utils/citationHelpers.d.ts +9 -0
  124. package/umd/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.d.ts +14 -0
  125. package/umd/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.test.d.ts +1 -0
  126. package/umd/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +10 -0
  127. package/umd/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +4 -0
  128. package/umd/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
  129. package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +1 -1
  130. package/umd/src/book-components/_common/Modal/Modal.d.ts +1 -1
  131. package/umd/src/book-components/icons/AboutIcon.d.ts +1 -1
  132. package/umd/src/book-components/icons/DownloadIcon.d.ts +1 -1
  133. package/umd/src/book-components/icons/ExitFullscreenIcon.d.ts +1 -1
  134. package/umd/src/book-components/icons/FullscreenIcon.d.ts +1 -1
  135. package/umd/src/cli/cli-commands/agent/agentCliOptions.d.ts +38 -0
  136. package/umd/src/cli/cli-commands/agent/chat.d.ts +10 -0
  137. package/umd/src/cli/cli-commands/agent/exec.d.ts +10 -0
  138. package/umd/src/cli/cli-commands/agent/run.test.d.ts +1 -0
  139. package/umd/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -24
  140. package/umd/src/cli/cli-commands/agent.d.ts +14 -0
  141. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +17 -1
  142. package/umd/src/cli/cli-commands/agents-server/run.d.ts +6 -0
  143. package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +9 -2
  144. package/umd/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
  145. package/umd/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.d.ts +25 -0
  146. package/umd/src/cli/cli-commands/coder/find-unwritten.d.ts +10 -0
  147. package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +2 -0
  148. package/umd/src/cli/cli-commands/coder/server.d.ts +13 -0
  149. package/umd/src/cli/cli-commands/coder/waitOptions.d.ts +14 -0
  150. package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +9 -25
  151. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
  152. package/umd/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -1
  153. package/umd/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
  154. package/umd/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
  155. package/umd/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
  156. package/umd/src/utils/isTimingSafeEqualString.d.ts +25 -0
  157. package/umd/src/utils/validators/url/isValidAgentUrl.d.ts +5 -0
  158. package/umd/src/version.d.ts +1 -1
package/esm/servers.d.ts CHANGED
@@ -25,15 +25,7 @@ type ServerConfiguration = {
25
25
  url: string_promptbook_server_url;
26
26
  };
27
27
  /**
28
- * Core Promptbook server configuration
29
- *
30
- * Used for "Adam" agent which is built in as default ancestor for new agents and other well known agents
31
- *
32
- * @public exported from `@promptbook/core`
33
- */
34
- export declare const CORE_AGENTS_SERVER: ServerConfiguration;
35
- /**
36
- * Names of well known agents hosted on Core Promptbook server
28
+ * Names of well known agents bundled in the local `.core` folder of every Agents Server
37
29
  *
38
30
  * - `Adam`: The default ancestor agent for new agents
39
31
  * - `Teacher`: Agent that knows book syntax and can help with self-learning
@@ -12,6 +12,7 @@ import type { BookEditorUploadProgressCallback } from '../book-components/BookEd
12
12
  import type { BookEditorUploadOptions } from '../book-components/BookEditor/BookEditor';
13
13
  import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
14
14
  import { BookEditor } from '../book-components/BookEditor/BookEditor';
15
+ import { BookEditorForClient } from '../book-components/BookEditor/BookEditorForClient';
15
16
  import { AgentChat } from '../book-components/Chat/AgentChat/AgentChat';
16
17
  import type { AgentChatProps } from '../book-components/Chat/AgentChat/AgentChatProps';
17
18
  import { Chat } from '../book-components/Chat/Chat/Chat';
@@ -65,6 +66,7 @@ import type { ChatProgressCard } from '../book-components/Chat/types/ChatMessage
65
66
  import type { ChatMessageReplyingTo } from '../book-components/Chat/types/ChatMessage';
66
67
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
67
68
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
69
+ import type { CitationLabelResolver } from '../book-components/Chat/types/CitationLabelResolver';
68
70
  import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
69
71
  import { parseMessageButtons } from '../book-components/Chat/utils/parseMessageButtons';
70
72
  import { ArrowIcon } from '../book-components/icons/ArrowIcon';
@@ -95,6 +97,7 @@ export type { BookEditorUploadProgressCallback };
95
97
  export type { BookEditorUploadOptions };
96
98
  export type { BookEditorProps };
97
99
  export { BookEditor };
100
+ export { BookEditorForClient };
98
101
  export { AgentChat };
99
102
  export type { AgentChatProps };
100
103
  export { Chat };
@@ -148,6 +151,7 @@ export type { ChatProgressCard };
148
151
  export type { ChatMessageReplyingTo };
149
152
  export type { ChatMessage };
150
153
  export type { ChatParticipant };
154
+ export type { CitationLabelResolver };
151
155
  export type { MessageButton };
152
156
  export { parseMessageButtons };
153
157
  export { ArrowIcon };
@@ -221,7 +221,6 @@ import { normalizeChatAttachments } from '../utils/chat/chatAttachments/normaliz
221
221
  import { resolveChatAttachmentContents } from '../utils/chat/chatAttachments/resolveChatAttachmentContents';
222
222
  import { aboutPromptbookInformation } from '../utils/misc/aboutPromptbookInformation';
223
223
  import { $generateBookBoilerplate } from '../utils/random/$generateBookBoilerplate';
224
- import { CORE_AGENTS_SERVER } from '../../servers';
225
224
  import { CORE_AGENTS_SERVER_WELL_KNOWN_AGENT_NAMES } from '../../servers';
226
225
  import { PUBLIC_AGENTS_SERVERS } from '../../servers';
227
226
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
@@ -447,6 +446,5 @@ export { normalizeChatAttachments };
447
446
  export { resolveChatAttachmentContents };
448
447
  export { aboutPromptbookInformation };
449
448
  export { $generateBookBoilerplate };
450
- export { CORE_AGENTS_SERVER };
451
449
  export { CORE_AGENTS_SERVER_WELL_KNOWN_AGENT_NAMES };
452
450
  export { PUBLIC_AGENTS_SERVERS };
@@ -1,4 +1,24 @@
1
1
  import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
+ import { AGENT_BOOK_FILE_PATH } from '../book-3.0/agentFolderPaths';
3
+ import { AGENT_MESSAGES_DIRECTORY_PATH } from '../book-3.0/agentFolderPaths';
4
+ import { AGENT_QUEUED_MESSAGES_DIRECTORY_PATH } from '../book-3.0/agentFolderPaths';
5
+ import { AGENT_FINISHED_MESSAGES_DIRECTORY_PATH } from '../book-3.0/agentFolderPaths';
6
+ import { AGENT_FAILED_MESSAGES_DIRECTORY_PATH } from '../book-3.0/agentFolderPaths';
7
+ import type { BookNodeAgentSource } from '../book-3.0/BookNodeAgentSource';
8
+ import type { BookNodeAgentSourceOptions } from '../book-3.0/BookNodeAgentSource';
9
+ import type { CliAgentHarness } from '../book-3.0/CliAgent';
10
+ import type { CliAgentThinkingLevel } from '../book-3.0/CliAgent';
11
+ import type { CliAgentRunOptions } from '../book-3.0/CliAgent';
12
+ import type { CliAgentOptions } from '../book-3.0/CliAgent';
13
+ import { CliAgent } from '../book-3.0/CliAgent';
14
+ import { CLI_AGENT_HARNESS_NAMES } from '../book-3.0/cliAgentEnv';
15
+ import { CLI_AGENT_THINKING_LEVEL_VALUES } from '../book-3.0/cliAgentEnv';
16
+ import { PTBK_HARNESS_ENV } from '../book-3.0/cliAgentEnv';
17
+ import { PTBK_MODEL_ENV } from '../book-3.0/cliAgentEnv';
18
+ import { PTBK_THINKING_LEVEL_ENV } from '../book-3.0/cliAgentEnv';
19
+ import type { LiteAgentOptions } from '../book-3.0/LiteAgent';
20
+ import type { LiteAgentRunOptions } from '../book-3.0/LiteAgent';
21
+ import { LiteAgent } from '../book-3.0/LiteAgent';
2
22
  import { createPipelineCollectionFromDirectory } from '../collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory';
3
23
  import { getAllCommitmentsToolFunctionsForNode } from '../commitments/_common/getAllCommitmentsToolFunctionsForNode';
4
24
  import { $provideExecutablesForNode } from '../executables/$provideExecutablesForNode';
@@ -12,6 +32,26 @@ import { FileCacheStorage } from '../storage/file-cache-storage/FileCacheStorage
12
32
  import { $execCommand } from '../utils/execCommand/$execCommand';
13
33
  import { $execCommands } from '../utils/execCommand/$execCommands';
14
34
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
35
+ export { AGENT_BOOK_FILE_PATH };
36
+ export { AGENT_MESSAGES_DIRECTORY_PATH };
37
+ export { AGENT_QUEUED_MESSAGES_DIRECTORY_PATH };
38
+ export { AGENT_FINISHED_MESSAGES_DIRECTORY_PATH };
39
+ export { AGENT_FAILED_MESSAGES_DIRECTORY_PATH };
40
+ export type { BookNodeAgentSource };
41
+ export type { BookNodeAgentSourceOptions };
42
+ export type { CliAgentHarness };
43
+ export type { CliAgentThinkingLevel };
44
+ export type { CliAgentRunOptions };
45
+ export type { CliAgentOptions };
46
+ export { CliAgent };
47
+ export { CLI_AGENT_HARNESS_NAMES };
48
+ export { CLI_AGENT_THINKING_LEVEL_VALUES };
49
+ export { PTBK_HARNESS_ENV };
50
+ export { PTBK_MODEL_ENV };
51
+ export { PTBK_THINKING_LEVEL_ENV };
52
+ export type { LiteAgentOptions };
53
+ export type { LiteAgentRunOptions };
54
+ export { LiteAgent };
15
55
  export { createPipelineCollectionFromDirectory };
16
56
  export { getAllCommitmentsToolFunctionsForNode };
17
57
  export { $provideExecutablesForNode };
@@ -4,6 +4,14 @@ import type { AgentBasicInformation } from '../book-2.0/agent-source/AgentBasicI
4
4
  import type { AgentModelRequirements } from '../book-2.0/agent-source/AgentModelRequirements';
5
5
  import type { CreateAgentModelRequirementsOptions } from '../book-2.0/agent-source/CreateAgentModelRequirementsOptions';
6
6
  import type { string_book } from '../book-2.0/agent-source/string_book';
7
+ import type { BookNodeAgentSource } from '../book-3.0/BookNodeAgentSource';
8
+ import type { BookNodeAgentSourceOptions } from '../book-3.0/BookNodeAgentSource';
9
+ import type { CliAgentHarness } from '../book-3.0/CliAgent';
10
+ import type { CliAgentThinkingLevel } from '../book-3.0/CliAgent';
11
+ import type { CliAgentRunOptions } from '../book-3.0/CliAgent';
12
+ import type { CliAgentOptions } from '../book-3.0/CliAgent';
13
+ import type { LiteAgentOptions } from '../book-3.0/LiteAgent';
14
+ import type { LiteAgentRunOptions } from '../book-3.0/LiteAgent';
7
15
  import type { AvatarChipProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChip';
8
16
  import type { AvatarChipFromSourceProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
9
17
  import type { AvatarProfileProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
@@ -47,6 +55,7 @@ import type { ChatProgressCard } from '../book-components/Chat/types/ChatMessage
47
55
  import type { ChatMessageReplyingTo } from '../book-components/Chat/types/ChatMessage';
48
56
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
49
57
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
58
+ import type { CitationLabelResolver } from '../book-components/Chat/types/CitationLabelResolver';
50
59
  import type { ParsedCitation } from '../book-components/Chat/utils/parseCitationsFromContent';
51
60
  import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
52
61
  import type { TeamToolResult } from '../book-components/Chat/utils/toolCallParsing/TeamToolResult';
@@ -437,6 +446,14 @@ export type { AgentBasicInformation };
437
446
  export type { AgentModelRequirements };
438
447
  export type { CreateAgentModelRequirementsOptions };
439
448
  export type { string_book };
449
+ export type { BookNodeAgentSource };
450
+ export type { BookNodeAgentSourceOptions };
451
+ export type { CliAgentHarness };
452
+ export type { CliAgentThinkingLevel };
453
+ export type { CliAgentRunOptions };
454
+ export type { CliAgentOptions };
455
+ export type { LiteAgentOptions };
456
+ export type { LiteAgentRunOptions };
440
457
  export type { AvatarChipProps };
441
458
  export type { AvatarChipFromSourceProps };
442
459
  export type { AvatarProfileProps };
@@ -480,6 +497,7 @@ export type { ChatProgressCard };
480
497
  export type { ChatMessageReplyingTo };
481
498
  export type { ChatMessage };
482
499
  export type { ChatParticipant };
500
+ export type { CitationLabelResolver };
483
501
  export type { ParsedCitation };
484
502
  export type { MessageButton };
485
503
  export type { TeamToolResult };
@@ -7,6 +7,10 @@ type AvatarAnimationListener = (now: number) => void;
7
7
  /**
8
8
  * Registers one avatar animation callback in the shared animation loop.
9
9
  *
10
+ * Each listener is staggered at registration time so it does not fire on the same animation
11
+ * frame as the existing listeners, and the shared loop further caps how many listeners run
12
+ * per frame, keeping the main thread responsive when many avatars are mounted.
13
+ *
10
14
  * @param avatarAnimationListener Frame callback invoked on every animation frame.
11
15
  * @returns Cleanup function that unregisters the callback.
12
16
  *
@@ -7,7 +7,7 @@ import type { AvatarDefinition } from './AvatarDefinition';
7
7
  *
8
8
  * @private shared contract for the avatar rendering system
9
9
  */
10
- export type AvatarVisualId = 'pixel-art' | 'octopus' | 'octopus2' | 'octopus3' | 'octopus3d' | 'octopus3d2' | 'ascii-octopus' | 'minecraft' | 'minecraft2' | 'fractal' | 'orb';
10
+ export type AvatarVisualId = 'pixel-art' | 'octopus' | 'octopus2' | 'octopus3' | 'octopus3d' | 'octopus3d2' | 'octopus3d3' | 'octopus3d4' | 'ascii-octopus' | 'minecraft' | 'minecraft2' | 'fractal' | 'orb';
11
11
  /**
12
12
  * Derived color palette used by avatar visuals.
13
13
  *
@@ -0,0 +1,7 @@
1
+ import type { AvatarVisualDefinition } from '../types/AvatarVisualDefinition';
2
+ /**
3
+ * Octopus 3D 3 avatar visual.
4
+ *
5
+ * @private built-in avatar visual
6
+ */
7
+ export declare const octopus3d3AvatarVisual: AvatarVisualDefinition;
@@ -0,0 +1,7 @@
1
+ import type { AvatarVisualDefinition } from '../types/AvatarVisualDefinition';
2
+ /**
3
+ * Octopus 3D 4 avatar visual.
4
+ *
5
+ * @private built-in avatar visual
6
+ */
7
+ export declare const octopus3d4AvatarVisual: AvatarVisualDefinition;
@@ -0,0 +1,38 @@
1
+ import type { string_book } from '../book-2.0/agent-source/string_book';
2
+ import { Book } from './Book';
3
+ /**
4
+ * Book source value accepted by Node-backed Book agents.
5
+ *
6
+ * @public exported from `@promptbook/node`
7
+ */
8
+ export type BookNodeAgentSource = Book | string_book;
9
+ /**
10
+ * Common source options shared by Node-backed Book agents.
11
+ *
12
+ * Provide either `agentPath` or `book`.
13
+ *
14
+ * @public exported from `@promptbook/node`
15
+ */
16
+ export type BookNodeAgentSourceOptions = {
17
+ readonly agentPath?: string;
18
+ readonly book?: string | BookNodeAgentSource;
19
+ readonly currentWorkingDirectory?: string;
20
+ };
21
+ /**
22
+ * Normalized source snapshot used internally by Node-backed Book agents.
23
+ *
24
+ * @private internal utility of `CliAgent` and `LiteAgent`
25
+ */
26
+ export type ResolvedBookNodeAgentSource = {
27
+ readonly agentName: string;
28
+ readonly agentPath: string | null;
29
+ readonly agentSource: string_book;
30
+ readonly currentWorkingDirectory: string;
31
+ readonly sourceDirectoryPath: string;
32
+ };
33
+ /**
34
+ * Resolves shared Node-backed Book source options into one normalized source snapshot.
35
+ *
36
+ * @private internal utility of `CliAgent` and `LiteAgent`
37
+ */
38
+ export declare function resolveBookNodeAgentSource(options: BookNodeAgentSourceOptions): Promise<ResolvedBookNodeAgentSource>;
@@ -0,0 +1,66 @@
1
+ import type { BookNodeAgentSourceOptions } from './BookNodeAgentSource';
2
+ import { CLI_AGENT_HARNESS_NAMES, CLI_AGENT_THINKING_LEVEL_VALUES } from './cliAgentEnv';
3
+ /**
4
+ * CLI harness names supported by `ptbk agent exec`.
5
+ *
6
+ * @public exported from `@promptbook/node`
7
+ */
8
+ export type CliAgentHarness = (typeof CLI_AGENT_HARNESS_NAMES)[number];
9
+ /**
10
+ * Thinking levels supported by CLI coding harnesses.
11
+ *
12
+ * @public exported from `@promptbook/node`
13
+ */
14
+ export type CliAgentThinkingLevel = (typeof CLI_AGENT_THINKING_LEVEL_VALUES)[number];
15
+ /**
16
+ * Per-run CLI options exposed by `CliAgent`.
17
+ *
18
+ * `noUi` defaults to `true` so command output stays suitable for JavaScript callers.
19
+ *
20
+ * @public exported from `@promptbook/node`
21
+ */
22
+ export type CliAgentRunOptions = {
23
+ readonly allowCredits?: boolean;
24
+ readonly context?: string;
25
+ readonly harness?: CliAgentHarness;
26
+ readonly isVerbose?: boolean;
27
+ readonly model?: string;
28
+ readonly noUi?: boolean;
29
+ readonly thinkingLevel?: CliAgentThinkingLevel;
30
+ };
31
+ /**
32
+ * Constructor options for `CliAgent`.
33
+ *
34
+ * @public exported from `@promptbook/node`
35
+ */
36
+ export type CliAgentOptions = BookNodeAgentSourceOptions & CliAgentRunOptions;
37
+ /**
38
+ * Lightweight JavaScript wrapper around the Promptbook agent execution pipeline.
39
+ *
40
+ * It uses the same harnesses and execution path as `ptbk agent exec`, running the runner
41
+ * in-process instead of spawning a separate CLI process.
42
+ *
43
+ * When no `harness` is provided in the constructor or per-run options, `CliAgent` falls back
44
+ * to the `PTBK_HARNESS` environment variable, mirroring `ptbk agent exec` behavior.
45
+ *
46
+ * @public exported from `@promptbook/node`
47
+ */
48
+ export declare class CliAgent {
49
+ private readonly options;
50
+ private temporaryAgentPath;
51
+ constructor(options: CliAgentOptions);
52
+ /**
53
+ * Runs one non-interactive agent turn through the selected harness.
54
+ *
55
+ * @param message - User message sent to the agent.
56
+ * @param options - Optional per-run overrides.
57
+ * @returns Final agent answer.
58
+ */
59
+ run(message: string, options?: CliAgentRunOptions): Promise<string>;
60
+ /**
61
+ * Resolves the agent path passed to the runner, materializing one temporary `.book` file when needed.
62
+ *
63
+ * @private internal utility of `CliAgent`
64
+ */
65
+ private resolveExecutableAgentPath;
66
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,68 @@
1
+ import type { CreateAgentModelRequirementsOptions } from '../book-2.0/agent-source/CreateAgentModelRequirementsOptions';
2
+ import type { ScriptExecutionTools } from '../execution/ScriptExecutionTools';
3
+ import type { string_model_name } from '../types/string_model_name';
4
+ import type { BookNodeAgentSourceOptions } from './BookNodeAgentSource';
5
+ /**
6
+ * Options for constructing one `LiteAgent`.
7
+ *
8
+ * `LiteAgent` is intentionally smaller than the CLI harnesses. It runs the Book through the
9
+ * OpenAI Agents SDK directly, while keeping Promptbook tool definitions and hosted knowledge
10
+ * whenever those features fit inside the lighter runtime.
11
+ *
12
+ * @public exported from `@promptbook/node`
13
+ */
14
+ export type LiteAgentOptions = BookNodeAgentSourceOptions & {
15
+ readonly apiKey?: string;
16
+ readonly baseURL?: string;
17
+ readonly createAgentModelRequirementsOptions?: CreateAgentModelRequirementsOptions;
18
+ readonly isVerbose?: boolean;
19
+ readonly maxRequestsPerMinute?: number;
20
+ readonly modelName?: string_model_name;
21
+ readonly organization?: string;
22
+ readonly project?: string;
23
+ readonly scriptExecutionTools?: ScriptExecutionTools | ReadonlyArray<ScriptExecutionTools>;
24
+ readonly userId?: string;
25
+ };
26
+ /**
27
+ * Per-run options for `LiteAgent`.
28
+ *
29
+ * @public exported from `@promptbook/node`
30
+ */
31
+ export type LiteAgentRunOptions = {
32
+ readonly context?: string;
33
+ readonly signal?: AbortSignal;
34
+ };
35
+ /**
36
+ * Lightweight Node.js wrapper around the OpenAI Agents SDK for Promptbook Books.
37
+ *
38
+ * This path is intentionally simpler than `ptbk agent exec`: it prepares one SDK agent in-process
39
+ * and reuses it across calls, which keeps JavaScript integration small while still honoring the
40
+ * compiled Promptbook system message, prompt suffix, tools, and hosted knowledge when supported.
41
+ *
42
+ * @public exported from `@promptbook/node`
43
+ */
44
+ export declare class LiteAgent {
45
+ private readonly options;
46
+ private preparedAgentPromise;
47
+ constructor(options: LiteAgentOptions);
48
+ /**
49
+ * Runs one user message through the prepared OpenAI Agents SDK agent.
50
+ *
51
+ * @param message - User message sent to the agent.
52
+ * @param options - Optional context and cancellation signal.
53
+ * @returns Final text returned by the SDK agent.
54
+ */
55
+ run(message: string, options?: LiteAgentRunOptions): Promise<string>;
56
+ /**
57
+ * Lazily prepares and caches the underlying OpenAI Agents SDK runtime.
58
+ *
59
+ * @private internal utility of `LiteAgent`
60
+ */
61
+ private prepareAgent;
62
+ /**
63
+ * Builds the in-process OpenAI Agents SDK runtime from the Book source.
64
+ *
65
+ * @private internal utility of `LiteAgent`
66
+ */
67
+ private createPreparedAgent;
68
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Relative path to the local agent source used by the agent folder convention.
3
+ *
4
+ * @public exported from `@promptbook/node`
5
+ */
6
+ export declare const AGENT_BOOK_FILE_PATH = "agent.book";
7
+ /**
8
+ * Relative path to the message queue root used by the agent folder convention.
9
+ *
10
+ * @public exported from `@promptbook/node`
11
+ */
12
+ export declare const AGENT_MESSAGES_DIRECTORY_PATH = "messages";
13
+ /**
14
+ * Relative path to queued user messages consumed by the agent runner.
15
+ *
16
+ * @public exported from `@promptbook/node`
17
+ */
18
+ export declare const AGENT_QUEUED_MESSAGES_DIRECTORY_PATH: string;
19
+ /**
20
+ * Relative path to answered messages written by the agent runner.
21
+ *
22
+ * @public exported from `@promptbook/node`
23
+ */
24
+ export declare const AGENT_FINISHED_MESSAGES_DIRECTORY_PATH: string;
25
+ /**
26
+ * Relative path to messages that the agent runner stopped retrying.
27
+ *
28
+ * @public exported from `@promptbook/node`
29
+ */
30
+ export declare const AGENT_FAILED_MESSAGES_DIRECTORY_PATH: string;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * All CLI harness names supported by `CliAgent` and `ptbk agent exec`.
3
+ *
4
+ * @public exported from `@promptbook/node`
5
+ */
6
+ export declare const CLI_AGENT_HARNESS_NAMES: readonly ["openai-codex", "github-copilot", "cline", "claude-code", "opencode", "gemini"];
7
+ /**
8
+ * All supported thinking-level values for CLI coding-agent runners.
9
+ *
10
+ * @public exported from `@promptbook/node`
11
+ */
12
+ export declare const CLI_AGENT_THINKING_LEVEL_VALUES: readonly ["low", "medium", "high", "xhigh", "max"];
13
+ /**
14
+ * Environment variable used as the default runner identifier when `--harness` is omitted or not set in `CliAgent`.
15
+ *
16
+ * Set this to one of the harness names (`openai-codex`, `github-copilot`, `cline`, `claude-code`, `opencode`, `gemini`)
17
+ * so that `CliAgent` and `ptbk agent exec` can run without an explicit `harness` option.
18
+ *
19
+ * @public exported from `@promptbook/node`
20
+ */
21
+ export declare const PTBK_HARNESS_ENV = "PTBK_HARNESS";
22
+ /**
23
+ * Environment variable used as the default runner model when `--model` is omitted or not set in `CliAgent`.
24
+ *
25
+ * @public exported from `@promptbook/node`
26
+ */
27
+ export declare const PTBK_MODEL_ENV = "PTBK_MODEL";
28
+ /**
29
+ * Environment variable used as the default thinking level when `--thinking-level` is omitted or not set in `CliAgent`.
30
+ *
31
+ * @public exported from `@promptbook/node`
32
+ */
33
+ export declare const PTBK_THINKING_LEVEL_ENV = "PTBK_THINKING_LEVEL";
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from 'react';
1
+ import { type CSSProperties } from 'react';
2
2
  import type { Promisable } from 'type-fest';
3
3
  import type { string_book } from '../../book-2.0/agent-source/string_book';
4
4
  import type { number_percent } from '../../types/number_percent';
@@ -6,6 +6,7 @@ import type { number_positive } from '../../types/number_positive';
6
6
  import type { string_knowledge_source_content } from '../../types/string_knowledge_source_content';
7
7
  import type { string_css_value } from '../../types/string_markdown';
8
8
  import type { HoistedMenuItem } from '../_common/MenuHoisting/MenuHoistingContext';
9
+ import type { BookEditorTheme } from './BookEditorTheme';
9
10
  /**
10
11
  * Monaco diagnostic shown inside `BookEditor`.
11
12
  *
@@ -94,14 +95,14 @@ export type BookEditorProps = {
94
95
  */
95
96
  readonly style?: CSSProperties;
96
97
  /**
97
- * Resolved visual theme used for the editor wrapper and Monaco instance.
98
+ * Resolved host application theme.
98
99
  *
99
- * Host applications should pass the final light/dark theme instead of relying on
100
- * browser media-query inference inside `<BookEditor/>`.
100
+ * `<BookEditor/>` accepts this for integration compatibility, but the notebook
101
+ * editor itself is intentionally rendered as light paper in every app theme.
101
102
  *
102
103
  * @default 'LIGHT'
103
104
  */
104
- readonly theme?: 'LIGHT' | 'DARK';
105
+ readonly theme?: BookEditorTheme;
105
106
  /**
106
107
  * Height of the `BookEditor` component
107
108
  *
@@ -0,0 +1,12 @@
1
+ import type { AboutPromptbookInformationOptions } from '../../utils/misc/aboutPromptbookInformation';
2
+ /**
3
+ * Browser-safe Promptbook information used by `BookEditor`.
4
+ *
5
+ * The shared `AboutPromptbookInformation` component renders markdown through the
6
+ * chat markdown pipeline, which has a server-side JSDOM sanitizer path. Keeping
7
+ * this component plain JSX prevents BookEditor from pulling JSDOM into client
8
+ * bundles.
9
+ *
10
+ * @private Internal component used by `BookEditorActionbar`
11
+ */
12
+ export declare function BookEditorAboutPromptbookInformation(props?: AboutPromptbookInformationOptions): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { NAME, CLAIM, PROMPTBOOK_LEGAL_ENTITY, IS_COST_PREVENTED, DEFAULT_IS_VERBOSE, DEFAULT_MAX_CONCURRENT_UPLOADS, PROMPTBOOK_SYNTAX_COLORS, } from '../../config';
2
+ export { PUBLIC_AGENTS_SERVERS } from '../../../servers';
@@ -0,0 +1,7 @@
1
+ import type { BookEditorProps } from './BookEditor';
2
+ /**
3
+ * Renders a book editor
4
+ *
5
+ * @public exported from `@promptbook/components`
6
+ */
7
+ export declare function BookEditorForClient(props: BookEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -15,6 +15,7 @@ type AgentReferenceMatch = {
15
15
  * @private function of BookEditorMonaco
16
16
  */
17
17
  export declare const BookEditorMonacoTokenization: {
18
+ DYNAMIC_COMMITMENT_REGEX: RegExp;
18
19
  AGENT_URL_REFERENCE_REGEX: RegExp;
19
20
  AGENT_REFERENCE_TOKEN_REGEX: RegExp;
20
21
  AGENT_REFERENCE_BRACED_REGEX: RegExp;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Visual theme accepted by `<BookEditor/>` integrations.
3
+ *
4
+ * @private internal type of `BookEditor`
5
+ */
6
+ export type BookEditorTheme = 'LIGHT' | 'DARK';
7
+ /**
8
+ * Theme used for the actual notebook editor surface.
9
+ *
10
+ * The host application can still pass its resolved app theme, but book sources
11
+ * are intentionally rendered as light paper in both light and dark app modes.
12
+ *
13
+ * @private internal constant of `BookEditor`
14
+ */
15
+ export declare const BOOK_EDITOR_RENDER_THEME = "LIGHT";
16
+ /**
17
+ * Resolves an app-level theme into the visual theme used by `<BookEditor/>`.
18
+ *
19
+ * @param hostTheme - Resolved theme from the embedding application.
20
+ * @returns Light theme used by the Book editor surface.
21
+ *
22
+ * @private internal utility of `BookEditor`
23
+ */
24
+ export declare function resolveBookEditorRenderTheme(hostTheme?: BookEditorTheme): BookEditorTheme;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Browser-compatible stub for `createDeprecatedCommitmentDiagnostics`.
3
+ *
4
+ * In the browser build the full Node.js implementation is not available,
5
+ * so this stub always returns an empty array to keep the editor functional.
6
+ *
7
+ * @private internal utility of `BookEditorMonaco`
8
+ */
9
+ export declare function createDeprecatedCommitmentDiagnostics(_agentSource?: string): [];
@@ -1,14 +1,9 @@
1
1
  import type { editor } from 'monaco-editor';
2
+ import type { BookEditorTheme } from './BookEditorTheme';
2
3
  /**
3
4
  * Type describing monaco editor.
4
5
  */
5
6
  type MonacoEditor = typeof import('monaco-editor');
6
- /**
7
- * Resolved visual theme supported by the Book editor.
8
- *
9
- * @private function of BookEditorMonaco
10
- */
11
- type BookEditorTheme = 'LIGHT' | 'DARK';
12
7
  /**
13
8
  * Props for use book editor monaco language.
14
9
  */
@@ -1,12 +1,9 @@
1
1
  import type { editor } from 'monaco-editor';
2
+ import type { BookEditorTheme } from './BookEditorTheme';
2
3
  /**
3
4
  * Type describing monaco editor.
4
5
  */
5
6
  type MonacoEditor = typeof import('monaco-editor');
6
- /**
7
- * Resolved visual theme supported by the Book editor.
8
- */
9
- type BookEditorTheme = 'LIGHT' | 'DARK';
10
7
  /**
11
8
  * Props for use book editor monaco lifecycle.
12
9
  */
@@ -1,3 +1,4 @@
1
+ import type { BookEditorTheme } from './BookEditorTheme';
1
2
  /**
2
3
  * Props for use book editor monaco styles.
3
4
  */
@@ -7,7 +8,7 @@ type UseBookEditorMonacoStylesProps = {
7
8
  readonly scaledContentPaddingLeft: number;
8
9
  readonly scaledVerticalLineLeft: number;
9
10
  readonly zoomLevel: number;
10
- readonly theme: 'LIGHT' | 'DARK';
11
+ readonly theme: BookEditorTheme;
11
12
  };
12
13
  /**
13
14
  * Injects notebook-inspired styling that is unique per `BookEditorMonaco` instance.
@@ -1,4 +1,5 @@
1
1
  import type { ChatParticipant } from '../types/ChatParticipant';
2
+ import type { CitationLabelResolver } from '../types/CitationLabelResolver';
2
3
  import type { ParsedCitation } from '../utils/parseCitationsFromContent';
3
4
  import type { ChatSoundSystem } from './ChatProps';
4
5
  /**
@@ -10,6 +11,7 @@ export type ChatCitationModalProps = {
10
11
  isOpen: boolean;
11
12
  citation: ParsedCitation | null;
12
13
  participants: ReadonlyArray<ChatParticipant>;
14
+ resolveCitationLabel?: CitationLabelResolver;
13
15
  soundSystem?: ChatSoundSystem;
14
16
  onClose: () => void;
15
17
  };
@@ -38,6 +38,10 @@ type ChatMessageItemProps = Pick<ChatProps, 'onMessage' | 'onActionButton' | 'on
38
38
  * Optional localized labels used by timestamp metadata.
39
39
  */
40
40
  timingTranslations?: ChatProps['timingTranslations'];
41
+ /**
42
+ * Optional resolver for turning technical citation sources into page/document titles.
43
+ */
44
+ resolveCitationLabel?: ChatProps['resolveCitationLabel'];
41
45
  /**
42
46
  * Optional moment locale used to format message timestamps.
43
47
  */
@@ -32,6 +32,10 @@ export type ChatMessageListProps = {
32
32
  * Optional localized labels used by timestamp metadata.
33
33
  */
34
34
  timingTranslations?: ChatProps['timingTranslations'];
35
+ /**
36
+ * Optional resolver for turning technical citation sources into page/document titles.
37
+ */
38
+ resolveCitationLabel?: ChatProps['resolveCitationLabel'];
35
39
  /**
36
40
  * Optional moment locale used to format message timestamps.
37
41
  */