@promptbook/javascript 0.102.0-5 → 0.102.0-6

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 (98) hide show
  1. package/esm/index.es.js +54 -54
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/books/index.d.ts +81 -0
  4. package/esm/typings/src/_packages/components.index.d.ts +2 -0
  5. package/esm/typings/src/_packages/markdown-utils.index.d.ts +4 -0
  6. package/esm/typings/src/_packages/types.index.d.ts +8 -6
  7. package/esm/typings/src/_packages/utils.index.d.ts +12 -14
  8. package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +1 -1
  9. package/esm/typings/src/book-2.0/utils/generateGravatarUrl.d.ts +1 -1
  10. package/esm/typings/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +1 -1
  11. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +1 -1
  12. package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +1 -1
  13. package/esm/typings/src/book-components/Chat/Chat/Chat.d.ts +1 -5
  14. package/esm/typings/src/book-components/Chat/Chat/ChatMessageItem.d.ts +27 -0
  15. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +13 -6
  16. package/esm/typings/src/book-components/Chat/Chat/constants.d.ts +7 -0
  17. package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +1 -1
  18. package/esm/typings/src/book-components/Chat/MockedChat/MockedChat.d.ts +1 -1
  19. package/esm/typings/src/book-components/Chat/MockedChat/constants.d.ts +1 -1
  20. package/esm/typings/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +1 -1
  21. package/esm/typings/src/book-components/Chat/save/_common/getChatSaveFormatDefinitions.d.ts +2 -2
  22. package/esm/typings/src/book-components/Chat/save/_common/string_chat_format_name.d.ts +1 -1
  23. package/esm/typings/src/execution/LlmExecutionToolsConstructor.d.ts +1 -1
  24. package/esm/typings/src/execution/execution-report/countWorkingDuration.d.ts +1 -1
  25. package/esm/typings/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +1 -1
  26. package/esm/typings/src/llm-providers/_common/register/$llmToolsRegister.d.ts +1 -1
  27. package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +1 -2
  28. package/esm/typings/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +1 -1
  29. package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +1 -1
  30. package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -1
  31. package/esm/typings/src/llm-providers/agent/register-configuration.d.ts +1 -1
  32. package/esm/typings/src/llm-providers/agent/register-constructor.d.ts +1 -1
  33. package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +1 -1
  34. package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +1 -1
  35. package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +1 -1
  36. package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +1 -1
  37. package/esm/typings/src/llm-providers/deepseek/register-configuration.d.ts +1 -1
  38. package/esm/typings/src/llm-providers/deepseek/register-constructor.d.ts +1 -1
  39. package/esm/typings/src/llm-providers/google/register-configuration.d.ts +1 -1
  40. package/esm/typings/src/llm-providers/google/register-constructor.d.ts +1 -1
  41. package/esm/typings/src/llm-providers/ollama/register-configuration.d.ts +1 -1
  42. package/esm/typings/src/llm-providers/ollama/register-constructor.d.ts +1 -1
  43. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -3
  44. package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +4 -0
  45. package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +1 -1
  46. package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +1 -1
  47. package/esm/typings/src/scrapers/_boilerplate/register-constructor.d.ts +1 -1
  48. package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -1
  49. package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +1 -1
  50. package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +1 -1
  51. package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +2 -4
  52. package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +1 -1
  53. package/esm/typings/src/scrapers/document/register-constructor.d.ts +1 -1
  54. package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -1
  55. package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +1 -1
  56. package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -1
  57. package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +1 -1
  58. package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -1
  59. package/esm/typings/src/scrapers/markitdown/register-constructor.d.ts +1 -1
  60. package/esm/typings/src/scrapers/markitdown/register-metadata.d.ts +1 -1
  61. package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +1 -1
  62. package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +1 -1
  63. package/esm/typings/src/scrapers/website/register-constructor.d.ts +1 -1
  64. package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -1
  65. package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +6 -6
  66. package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +1 -1
  67. package/esm/typings/src/utils/markdown/humanizeAiText.d.ts +1 -1
  68. package/esm/typings/src/utils/markdown/humanizeAiTextEllipsis.d.ts +1 -1
  69. package/esm/typings/src/utils/markdown/humanizeAiTextEmdashed.d.ts +1 -1
  70. package/esm/typings/src/utils/markdown/humanizeAiTextQuotes.d.ts +1 -1
  71. package/esm/typings/src/utils/markdown/humanizeAiTextWhitespace.d.ts +1 -1
  72. package/esm/typings/src/utils/markdown/promptbookifyAiText.d.ts +1 -1
  73. package/esm/typings/src/utils/{trimCodeBlock.d.ts → markdown/trimCodeBlock.d.ts} +1 -1
  74. package/esm/typings/src/utils/{trimEndOfCodeBlock.d.ts → markdown/trimEndOfCodeBlock.d.ts} +1 -1
  75. package/esm/typings/src/utils/{$Register.d.ts → misc/$Register.d.ts} +2 -2
  76. package/esm/typings/src/utils/{$getCurrentDate.d.ts → misc/$getCurrentDate.d.ts} +1 -1
  77. package/esm/typings/src/utils/{arrayableToArray.d.ts → misc/arrayableToArray.d.ts} +1 -1
  78. package/esm/typings/src/utils/misc/debounce.d.ts +5 -0
  79. package/esm/typings/src/utils/{emojis.d.ts → misc/emojis.d.ts} +1 -1
  80. package/esm/typings/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +20 -0
  81. package/esm/typings/src/version.d.ts +1 -1
  82. package/package.json +2 -2
  83. package/umd/index.umd.js +54 -54
  84. package/umd/index.umd.js.map +1 -1
  85. package/esm/typings/src/book-components/BookEditor/injectCssModuleIntoShadowRoot.d.ts +0 -11
  86. package/esm/typings/src/book-components/BookEditor/utils.d.ts +0 -8
  87. /package/esm/typings/src/utils/{trimCodeBlock.test.d.ts → markdown/trimCodeBlock.test.d.ts} +0 -0
  88. /package/esm/typings/src/utils/{trimEndOfCodeBlock.test.d.ts → markdown/trimEndOfCodeBlock.test.d.ts} +0 -0
  89. /package/esm/typings/src/utils/{FromtoItems.d.ts → misc/FromtoItems.d.ts} +0 -0
  90. /package/esm/typings/src/utils/{arrayableToArray.test.d.ts → misc/arrayableToArray.test.d.ts} +0 -0
  91. /package/esm/typings/src/utils/{parseNumber.d.ts → misc/parseNumber.d.ts} +0 -0
  92. /package/esm/typings/src/utils/{parseNumber.test.d.ts → misc/parseNumber.test.d.ts} +0 -0
  93. /package/esm/typings/src/utils/{removeEmojis.d.ts → normalization/removeEmojis.d.ts} +0 -0
  94. /package/esm/typings/src/utils/{removeEmojis.test.d.ts → normalization/removeEmojis.test.d.ts} +0 -0
  95. /package/esm/typings/src/utils/{removeQuotes.d.ts → normalization/removeQuotes.d.ts} +0 -0
  96. /package/esm/typings/src/utils/{removeQuotes.test.d.ts → normalization/removeQuotes.test.d.ts} +0 -0
  97. /package/esm/typings/src/utils/{unwrapResult.d.ts → normalization/unwrapResult.d.ts} +0 -0
  98. /package/esm/typings/src/utils/{unwrapResult.test.d.ts → normalization/unwrapResult.test.d.ts} +0 -0
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import type { id } from '../../../types/typeAliases';
3
+ import type { ChatMessage } from '../types/ChatMessage';
4
+ import type { ChatParticipant } from '../types/ChatParticipant';
5
+ import type { ChatProps } from './ChatProps';
6
+ /**
7
+ * Props for the `ChatMessageItem` component
8
+ *
9
+ * @private props for internal subcomponent
10
+ */
11
+ type ChatMessageItemProps = Pick<ChatProps, 'onMessage' | 'participants'> & {
12
+ message: ChatMessage;
13
+ participant: ChatParticipant | undefined;
14
+ isLastMessage: boolean;
15
+ setExpandedMessageId: (value: id | null) => void;
16
+ isExpanded: boolean;
17
+ currentRating: number;
18
+ handleRating: (message: ChatMessage, rating: number) => void;
19
+ mode: 'LIGHT' | 'DARK';
20
+ };
21
+ /**
22
+ * Renders a single chat message item with avatar, content, buttons, and rating.
23
+ *
24
+ * @private internal subcomponent of `<Chat>` component
25
+ */
26
+ export declare const ChatMessageItem: import("react").MemoExoticComponent<({ message, participant, participants, isLastMessage, onMessage, setExpandedMessageId, isExpanded, currentRating, handleRating, mode, }: ChatMessageItemProps) => import("react/jsx-runtime").JSX.Element>;
27
+ export {};
@@ -1,5 +1,6 @@
1
1
  import type { CSSProperties, ReactNode } from 'react';
2
2
  import type { Promisable } from 'type-fest';
3
+ import type { string_chat_format_name } from '../save/_common/string_chat_format_name';
3
4
  import type { ChatMessage } from '../types/ChatMessage';
4
5
  import type { ChatParticipant } from '../types/ChatParticipant';
5
6
  /**
@@ -91,12 +92,6 @@ export type ChatProps = {
91
92
  onAssistantVoiceResponse?: (content: string, isVoiceCall: boolean) => void;
92
93
  onVoiceCallStateChange?: (isVoiceCalling: boolean) => void;
93
94
  };
94
- /**
95
- * Indicates whether a the text is AI-generated and should be humanized
96
- *
97
- * @default true
98
- */
99
- readonly isAiTextHumanized?: boolean;
100
95
  /**
101
96
  * Indicates whether a voice call is currently active
102
97
  */
@@ -109,12 +104,24 @@ export type ChatProps = {
109
104
  * Whether the save button is enabled and shown
110
105
  */
111
106
  readonly isSaveButtonEnabled?: boolean;
107
+ /**
108
+ * List of formats in which the chat can be saved/exported
109
+ *
110
+ * @default * All supported formats (see `string_chat_format_name` type)
111
+ */
112
+ readonly saveFormats?: Array<string_chat_format_name>;
112
113
  /**
113
114
  * Is the writing textarea automatically focused?
114
115
  *
115
116
  * @default true on Desktop false on mobile (to prevent mobile keyboard from popping up)
116
117
  */
117
118
  readonly isFocusedOnLoad?: boolean;
119
+ /**
120
+ * Indicates whether the text shown in chat should be post-processed by removing AI artifacts and making it more "human-like" and "promptbook-like"
121
+ *
122
+ * @default true
123
+ */
124
+ readonly isAiTextHumanizedAndPromptbookified?: boolean;
118
125
  /**
119
126
  * Optional markdown header to include at the top of exported files.
120
127
  * Example: "## Discussion Topic\n\nSome topic here"
@@ -3,6 +3,13 @@
3
3
  * @private util of `<Chat />`
4
4
  */
5
5
  export declare const LOADING_INTERACTIVE_IMAGE = "Loading...";
6
+ /**
7
+ * [🚉] Avatar dimensions constant to prevent layout jumps and maintain DRY principle
8
+ *
9
+ * @deprecated use `isComplete` instead
10
+ * @private util of `<Chat />`
11
+ */
12
+ export declare const AVATAR_SIZE = 40;
6
13
  /**
7
14
  * Note: [💞] Ignore a discrepancy between file name and entity name
8
15
  */
@@ -1,5 +1,5 @@
1
1
  import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
2
- import { id } from '../../../types/typeAliases';
2
+ import type { id } from '../../../types/typeAliases';
3
3
  import type { ChatProps } from '../Chat/ChatProps';
4
4
  import type { SendMessageToLlmChatFunction } from '../hooks/useSendMessageToLlmChat';
5
5
  import type { ChatMessage } from '../types/ChatMessage';
@@ -1,4 +1,4 @@
1
- import type { ChatProps } from '../../Chat/Chat/ChatProps';
1
+ import type { ChatProps } from '../Chat/ChatProps';
2
2
  /**
3
3
  * Delay configuration for the MockedChat component
4
4
  *
@@ -1,4 +1,4 @@
1
- import { MockedChatDelayConfig } from './MockedChat';
1
+ import type { MockedChatDelayConfig } from './MockedChat';
2
2
  /**
3
3
  * Normal flow of messages in the `MockedChat` component
4
4
  *
@@ -1,4 +1,4 @@
1
- import { string_file_extension, string_mime_type } from '../../../../types/typeAliases';
1
+ import type { string_file_extension, string_mime_type } from '../../../../types/typeAliases';
2
2
  import type { ChatMessage } from '../../types/ChatMessage';
3
3
  /**
4
4
  * Plugin contract for chat export formatNames
@@ -1,5 +1,5 @@
1
- import { ChatSaveFormatDefinition } from './ChatSaveFormatDefinition';
2
- import { string_chat_format_name } from './string_chat_format_name';
1
+ import type { ChatSaveFormatDefinition } from './ChatSaveFormatDefinition';
2
+ import type { string_chat_format_name } from './string_chat_format_name';
3
3
  /**
4
4
  * Returns enabled chat save plugins filtered by formatNames (or all when omitted)
5
5
  *
@@ -1,4 +1,4 @@
1
- import { CHAT_SAVE_FORMATS } from '..';
1
+ import { CHAT_SAVE_FORMATS } from '../index';
2
2
  /**
3
3
  * Supported chat export formatNames
4
4
  * @public exported from `@promptbook/components`
@@ -1,4 +1,4 @@
1
- import type { Registered } from '../utils/$Register';
1
+ import type { Registered } from '../utils/misc/$Register';
2
2
  import type { TODO_any } from '../utils/organization/TODO_any';
3
3
  import type { LlmExecutionTools } from './LlmExecutionTools';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import type { FromtoItems } from '../../utils/FromtoItems';
1
+ import type { FromtoItems } from '../../utils/misc/FromtoItems';
2
2
  /**
3
3
  * Count the duration of working time
4
4
  *
@@ -1,4 +1,4 @@
1
- import { $Register } from '../../../utils/$Register';
1
+ import { $Register } from '../../../utils/misc/$Register';
2
2
  import type { LlmToolsMetadata } from './LlmToolsMetadata';
3
3
  /**
4
4
  * Register for LLM tools metadata.
@@ -1,5 +1,5 @@
1
1
  import type { LlmExecutionToolsConstructor } from '../../../execution/LlmExecutionToolsConstructor';
2
- import { $Register } from '../../../utils/$Register';
2
+ import { $Register } from '../../../utils/misc/$Register';
3
3
  /**
4
4
  * Register for LLM tools.
5
5
  *
@@ -1,5 +1,4 @@
1
- import type { string_filename } from '../../../types/typeAliases';
2
- import type { string_markdown } from '../../../types/typeAliases';
1
+ import type { string_filename, string_markdown } from '../../../types/typeAliases';
3
2
  /**
4
3
  * Pass the `.env` file which was used to configure LLM tools
5
4
  *
@@ -1,5 +1,5 @@
1
1
  import type { string_title } from '../../../types/typeAliases';
2
- import type { Registered } from '../../../utils/$Register';
2
+ import type { Registered } from '../../../utils/misc/$Register';
3
3
  import type { LlmToolsOptions } from './LlmToolsOptions';
4
4
  /**
5
5
  * Configuration definition for LLM execution tools, containing provider-specific settings
@@ -1,6 +1,6 @@
1
1
  import { MODEL_ORDERS, MODEL_TRUST_LEVELS } from '../../../constants';
2
2
  import type { string_name, string_title } from '../../../types/typeAliases';
3
- import type { Registered } from '../../../utils/$Register';
3
+ import type { Registered } from '../../../utils/misc/$Register';
4
4
  import type { string_SCREAMING_CASE } from '../../../utils/normalization/normalizeTo_SCREAMING_CASE';
5
5
  import type { LlmToolsConfiguration } from './LlmToolsConfiguration';
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
2
- import { string_markdown_text, string_title } from '../../types/typeAliases';
2
+ import type { string_markdown_text, string_title } from '../../types/typeAliases';
3
3
  import { MultipleLlmExecutionTools } from './MultipleLlmExecutionTools';
4
4
  /**
5
5
  * Joins multiple LLM Execution Tools into one
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @public exported from `@promptbook/core`
5
5
  */
6
- export declare const _AgentMetadata: import("../../utils/$Register").Registration;
6
+ export declare const _AgentMetadata: import("../../_packages/types.index").Registration;
7
7
  /**
8
8
  * TODO: [🧠] Consider adding a special trust level for AgentLlmExecutionTools
9
9
  * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of Agent LLM provider
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of LLM provider metadata
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of LLM provider
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of LLM provider metadata
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of LLM provider
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of LLM provider metadata
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of LLM provider
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of LLM provider metadata
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of LLM provider
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of LLM provider metadata
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of LLM provider
4
4
  *
@@ -1,9 +1,7 @@
1
1
  import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
2
2
  import type { ChatPromptResult } from '../../execution/PromptResult';
3
3
  import type { Prompt } from '../../types/Prompt';
4
- import type { string_markdown } from '../../types/typeAliases';
5
- import type { string_markdown_text } from '../../types/typeAliases';
6
- import type { string_title } from '../../types/typeAliases';
4
+ import type { string_markdown, string_markdown_text, string_title } from '../../types/typeAliases';
7
5
  import type { OpenAiAssistantExecutionToolsOptions } from './OpenAiAssistantExecutionToolsOptions';
8
6
  import { OpenAiExecutionTools } from './OpenAiExecutionTools';
9
7
  /**
@@ -26,6 +26,10 @@ export declare abstract class OpenAiCompatibleExecutionTools implements LlmExecu
26
26
  * Tracks models and parameters that have already been retried to prevent infinite loops
27
27
  */
28
28
  private retriedUnsupportedParameters;
29
+ /**
30
+ * Tracks the history of attempts for error reporting
31
+ */
32
+ private attemptHistory;
29
33
  /**
30
34
  * Creates OpenAI compatible Execution Tools.
31
35
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of LLM provider metadata
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of LLM provider
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of known scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Metadata of the scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import { $Register } from '../../../utils/$Register';
1
+ import { $Register } from '../../../utils/misc/$Register';
2
2
  import type { ScraperAndConverterMetadata } from './ScraperAndConverterMetadata';
3
3
  /**
4
4
  * Global registry for storing metadata about all available scrapers and converters.
@@ -1,4 +1,4 @@
1
- import { $Register } from '../../../utils/$Register';
1
+ import { $Register } from '../../../utils/misc/$Register';
2
2
  import type { ScraperConstructor } from './ScraperConstructor';
3
3
  /**
4
4
  * Registry for all available scrapers in the system.
@@ -1,8 +1,6 @@
1
1
  import type { Executables } from '../../../execution/Executables';
2
- import type { string_mime_type } from '../../../types/typeAliases';
3
- import type { string_promptbook_documentation_url } from '../../../types/typeAliases';
4
- import type { string_title } from '../../../types/typeAliases';
5
- import type { Registered } from '../../../utils/$Register';
2
+ import type { string_mime_type, string_promptbook_documentation_url, string_title } from '../../../types/typeAliases';
3
+ import type { Registered } from '../../../utils/misc/$Register';
6
4
  /**
7
5
  * Metadata interface for scrapers and converters in the system.
8
6
  * Contains information about the capabilities and requirements of a scraper or converter.
@@ -1,6 +1,6 @@
1
1
  import type { ExecutionTools } from '../../../execution/ExecutionTools';
2
2
  import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeOptions';
3
- import type { Registered } from '../../../utils/$Register';
3
+ import type { Registered } from '../../../utils/misc/$Register';
4
4
  import type { Scraper } from '../Scraper';
5
5
  import type { ScraperAndConverterMetadata } from './ScraperAndConverterMetadata';
6
6
  /**
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of known scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Metadata of the scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of known scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Metadata of the scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of known scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Metadata of the scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of known scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Metadata of the scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of known scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Metadata of the scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Registration of known scraper
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Registration } from '../../utils/$Register';
1
+ import type { Registration } from '../../utils/misc/$Register';
2
2
  /**
3
3
  * Metadata of the scraper
4
4
  *
@@ -1,22 +1,22 @@
1
1
  import spaceTrim from 'spacetrim';
2
2
  import { extractBlock } from '../../postprocessing/utils/extractBlock';
3
3
  import { prettifyMarkdown } from '../../utils/markdown/prettifyMarkdown';
4
+ import { trimCodeBlock } from '../../utils/markdown/trimCodeBlock';
5
+ import { trimEndOfCodeBlock } from '../../utils/markdown/trimEndOfCodeBlock';
4
6
  import { capitalize } from '../../utils/normalization/capitalize';
5
7
  import { decapitalize } from '../../utils/normalization/decapitalize';
6
8
  import { nameToUriPart } from '../../utils/normalization/nameToUriPart';
7
9
  import { nameToUriParts } from '../../utils/normalization/nameToUriParts';
8
10
  import { normalizeToKebabCase } from '../../utils/normalization/normalize-to-kebab-case';
11
+ import { normalizeTo_camelCase } from '../../utils/normalization/normalizeTo_camelCase';
9
12
  import { normalizeTo_PascalCase } from '../../utils/normalization/normalizeTo_PascalCase';
10
13
  import { normalizeTo_SCREAMING_CASE } from '../../utils/normalization/normalizeTo_SCREAMING_CASE';
11
- import { normalizeTo_camelCase } from '../../utils/normalization/normalizeTo_camelCase';
12
14
  import { normalizeTo_snake_case } from '../../utils/normalization/normalizeTo_snake_case';
13
15
  import { normalizeWhitespaces } from '../../utils/normalization/normalizeWhitespaces';
14
16
  import { removeDiacritics } from '../../utils/normalization/removeDiacritics';
15
- import { removeEmojis } from '../../utils/removeEmojis';
16
- import { removeQuotes } from '../../utils/removeQuotes';
17
- import { trimCodeBlock } from '../../utils/trimCodeBlock';
18
- import { trimEndOfCodeBlock } from '../../utils/trimEndOfCodeBlock';
19
- import { unwrapResult } from '../../utils/unwrapResult';
17
+ import { removeEmojis } from '../../utils/normalization/removeEmojis';
18
+ import { removeQuotes } from '../../utils/normalization/removeQuotes';
19
+ import { unwrapResult } from '../../utils/normalization/unwrapResult';
20
20
  /**
21
21
  * Collection of utility functions that can be used for post-processing model outputs.
22
22
  * These functions help transform, extract, or format the raw model responses.
@@ -1,5 +1,5 @@
1
1
  import type { string_markdown } from '../../types/typeAliases';
2
- import type { FromtoItems } from '../FromtoItems';
2
+ import type { FromtoItems } from '../misc/FromtoItems';
3
3
  /**
4
4
  * Options for `CreateMarkdownChartOptions`
5
5
  */
@@ -1,4 +1,4 @@
1
- import { string_markdown } from '../../types/typeAliases';
1
+ import type { string_markdown } from '../../types/typeAliases';
2
2
  /**
3
3
  * Function `humanizeAiText` will remove traces of AI text generation artifacts
4
4
  *
@@ -1,4 +1,4 @@
1
- import { string_markdown } from '../../types/typeAliases';
1
+ import type { string_markdown } from '../../types/typeAliases';
2
2
  /**
3
3
  * Change ellipsis character to three dots `…` -> `...`
4
4
  *
@@ -1,4 +1,4 @@
1
- import { string_markdown } from '../../types/typeAliases';
1
+ import type { string_markdown } from '../../types/typeAliases';
2
2
  /**
3
3
  * Change em-dashes to regular dashes `—` -> `-`
4
4
  *
@@ -1,4 +1,4 @@
1
- import { string_markdown } from '../../types/typeAliases';
1
+ import type { string_markdown } from '../../types/typeAliases';
2
2
  /**
3
3
  * Change smart quotes to regular quotes
4
4
  *
@@ -1,4 +1,4 @@
1
- import { string_markdown } from '../../types/typeAliases';
1
+ import type { string_markdown } from '../../types/typeAliases';
2
2
  /**
3
3
  * Change unprintable hard spaces to regular spaces
4
4
  *
@@ -1,4 +1,4 @@
1
- import { string_markdown } from '../../types/typeAliases';
1
+ import type { string_markdown } from '../../types/typeAliases';
2
2
  /**
3
3
  * Function `promptbookifyAiText` will slightly modify the text so we know it was processed by Promptbook
4
4
  *
@@ -5,6 +5,6 @@
5
5
  * Note: This is useful for post-processing of the result of the chat LLM model
6
6
  * when the model wraps the result in the (markdown) code block.
7
7
  *
8
- * @public exported from `@promptbook/utils`
8
+ * @public exported from `@promptbook/markdown-utils`
9
9
  */
10
10
  export declare function trimCodeBlock(value: string): string;
@@ -4,6 +4,6 @@
4
4
  * Note: This is useful for post-processing of the result of the completion LLM model
5
5
  * if you want to start code block in the prompt but you don't want to end it in the result.
6
6
  *
7
- * @public exported from `@promptbook/utils`
7
+ * @public exported from `@promptbook/markdown-utils`
8
8
  */
9
9
  export declare function trimEndOfCodeBlock(value: string): string;
@@ -1,6 +1,6 @@
1
1
  import { type IDestroyable } from 'destroyable';
2
- import type { string_name } from '../types/typeAliases';
3
- import type { TODO_string } from './organization/TODO_string';
2
+ import type { string_name } from '../../types/typeAliases';
3
+ import type { TODO_string } from '../organization/TODO_string';
4
4
  /**
5
5
  * Represents an entity in a global registry.
6
6
  * Contains identifying information about the package and class.
@@ -1,4 +1,4 @@
1
- import type { string_date_iso8601 } from '../types/typeAliases';
1
+ import type { string_date_iso8601 } from '../../types/typeAliases';
2
2
  /**
3
3
  * Simple wrapper `new Date().toISOString()`
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { Arrayable } from '../types/Arrayable';
1
+ import type { Arrayable } from '../../types/Arrayable';
2
2
  /**
3
3
  * Takes an item or an array of items and returns an array of items
4
4
  *
@@ -0,0 +1,5 @@
1
+ import type { TODO_any } from '../organization/TODO_any';
2
+ /**
3
+ * @public exported from `@promptbook/utils`
4
+ */
5
+ export declare function debounce<T extends (...args: TODO_any[]) => void>(fn: T, delay: number): (...args: Parameters<T>) => void;
@@ -1,4 +1,4 @@
1
- import type { string_char_emoji } from '../types/typeAliasEmoji';
1
+ import type { string_char_emoji } from '../../types/typeAliasEmoji';
2
2
  /**
3
3
  * All possible emoji chars like "🍆", "🍡", "🍤"...
4
4
  * Note: this will be needed to update annually - now updated at 2022-01-19