@promptbook/node 0.101.0 → 0.102.0-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.
@@ -26,6 +26,14 @@ import type { MessageButton } from '../book-components/Chat/utils/parseMessageBu
26
26
  import { parseMessageButtons } from '../book-components/Chat/utils/parseMessageButtons';
27
27
  import { renderMarkdown } from '../book-components/Chat/utils/renderMarkdown';
28
28
  import { isMarkdownContent } from '../book-components/Chat/utils/renderMarkdown';
29
+ import type { ChatSaveFormat } from '../book-components/Chat/utils/savePlugins';
30
+ import type { ChatSavePlugin } from '../book-components/Chat/utils/savePlugins';
31
+ import { jsonSavePlugin } from '../book-components/Chat/utils/savePlugins';
32
+ import { txtSavePlugin } from '../book-components/Chat/utils/savePlugins';
33
+ import { mdSavePlugin } from '../book-components/Chat/utils/savePlugins';
34
+ import { htmlSavePlugin } from '../book-components/Chat/utils/savePlugins';
35
+ import { chatSavePlugins } from '../book-components/Chat/utils/savePlugins';
36
+ import { getChatSavePlugins } from '../book-components/Chat/utils/savePlugins';
29
37
  import { ArrowIcon } from '../book-components/icons/ArrowIcon';
30
38
  import { PauseIcon } from '../book-components/icons/PauseIcon';
31
39
  import { PlayIcon } from '../book-components/icons/PlayIcon';
@@ -60,6 +68,14 @@ export type { MessageButton };
60
68
  export { parseMessageButtons };
61
69
  export { renderMarkdown };
62
70
  export { isMarkdownContent };
71
+ export type { ChatSaveFormat };
72
+ export type { ChatSavePlugin };
73
+ export { jsonSavePlugin };
74
+ export { txtSavePlugin };
75
+ export { mdSavePlugin };
76
+ export { htmlSavePlugin };
77
+ export { chatSavePlugins };
78
+ export { getChatSavePlugins };
63
79
  export { ArrowIcon };
64
80
  export { PauseIcon };
65
81
  export { PlayIcon };
@@ -19,6 +19,8 @@ import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps'
19
19
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
20
20
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
21
21
  import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
22
+ import type { ChatSaveFormat } from '../book-components/Chat/utils/savePlugins';
23
+ import type { ChatSavePlugin } from '../book-components/Chat/utils/savePlugins';
22
24
  import type { PipelineCollection } from '../collection/PipelineCollection';
23
25
  import type { Command } from '../commands/_common/types/Command';
24
26
  import type { CommandParser } from '../commands/_common/types/CommandParser';
@@ -348,6 +350,8 @@ export type { LlmChatProps };
348
350
  export type { ChatMessage };
349
351
  export type { ChatParticipant };
350
352
  export type { MessageButton };
353
+ export type { ChatSaveFormat };
354
+ export type { ChatSavePlugin };
351
355
  export type { PipelineCollection };
352
356
  export type { Command };
353
357
  export type { CommandParser };
@@ -1,4 +1,5 @@
1
1
  import type { ChatProps } from './ChatProps';
2
+ import { ChatSaveFormat } from '../utils/savePlugins';
2
3
  /**
3
4
  * Renders a chat with messages and input for new messages
4
5
  *
@@ -12,4 +13,7 @@ import type { ChatProps } from './ChatProps';
12
13
  *
13
14
  * @public exported from `@promptbook/components`
14
15
  */
15
- export declare function Chat(props: ChatProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function Chat(props: ChatProps & {
17
+ saveFormats?: ChatSaveFormat[];
18
+ isSaveButtonEnabled?: boolean;
19
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,55 @@
1
+ import type { ChatMessage } from '../types/ChatMessage';
2
+ /**
3
+ * Supported chat export formats
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export type ChatSaveFormat = 'json' | 'txt' | 'md' | 'html';
7
+ /**
8
+ * Plugin contract for chat export formats
9
+ * @public exported from `@promptbook/components`
10
+ */
11
+ export type ChatSavePlugin = {
12
+ format: ChatSaveFormat;
13
+ label: string;
14
+ getContent: (messages: ChatMessage[]) => string;
15
+ mimeType: string;
16
+ fileExtension: string;
17
+ };
18
+ /**
19
+ * JSON export plugin (full metadata)
20
+ *
21
+ * @public exported from `@promptbook/components`
22
+ */
23
+ export declare const jsonSavePlugin: ChatSavePlugin;
24
+ /**
25
+ * Plain text export plugin (messages only)
26
+ *
27
+ * @public exported from `@promptbook/components`
28
+ */
29
+ export declare const txtSavePlugin: ChatSavePlugin;
30
+ /**
31
+ * Markdown export plugin (formatted)
32
+ *
33
+ * @public exported from `@promptbook/components`
34
+ */
35
+ export declare const mdSavePlugin: ChatSavePlugin;
36
+ /**
37
+ * HTML export plugin (formatted)
38
+ * @public exported from `@promptbook/components`
39
+ */
40
+ export declare const htmlSavePlugin: ChatSavePlugin;
41
+ /**
42
+ * Registry of all built-in chat save plugins
43
+ *
44
+ * @public exported from `@promptbook/components`
45
+ */
46
+ export declare const chatSavePlugins: ChatSavePlugin[];
47
+ /**
48
+ * Returns enabled chat save plugins filtered by formats (or all when omitted)
49
+ *
50
+ * @public exported from `@promptbook/components`
51
+ */
52
+ export declare function getChatSavePlugins(formats?: ChatSaveFormat[]): ChatSavePlugin[];
53
+ /**
54
+ * Note: [💞] Ignore a discrepancy between file name and entity name
55
+ */
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.101.0-21`).
18
+ * It follows semantic versioning (e.g., `0.101.0`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/node",
3
- "version": "0.101.0",
3
+ "version": "0.102.0-0",
4
4
  "description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -93,7 +93,7 @@
93
93
  "module": "./esm/index.es.js",
94
94
  "typings": "./esm/typings/src/_packages/node.index.d.ts",
95
95
  "peerDependencies": {
96
- "@promptbook/core": "0.101.0"
96
+ "@promptbook/core": "0.102.0-0"
97
97
  },
98
98
  "dependencies": {
99
99
  "colors": "1.4.0",
package/umd/index.umd.js CHANGED
@@ -45,7 +45,7 @@
45
45
  * @generated
46
46
  * @see https://github.com/webgptorg/promptbook
47
47
  */
48
- const PROMPTBOOK_ENGINE_VERSION = '0.101.0';
48
+ const PROMPTBOOK_ENGINE_VERSION = '0.102.0-0';
49
49
  /**
50
50
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
51
51
  * Note: [💞] Ignore a discrepancy between file name and entity name