@promptbook/wizard 0.102.0-2 → 0.102.0-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/index.es.js CHANGED
@@ -36,7 +36,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
36
36
  * @generated
37
37
  * @see https://github.com/webgptorg/promptbook
38
38
  */
39
- const PROMPTBOOK_ENGINE_VERSION = '0.102.0-2';
39
+ const PROMPTBOOK_ENGINE_VERSION = '0.102.0-3';
40
40
  /**
41
41
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
42
42
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -26,14 +26,14 @@ import { MOCKED_CHAT_DELAY_CONFIGS } from '../book-components/Chat/MockedChat/co
26
26
  import type { MockedChatDelayConfig } from '../book-components/Chat/MockedChat/MockedChat';
27
27
  import type { MockedChatProps } from '../book-components/Chat/MockedChat/MockedChat';
28
28
  import { MockedChat } from '../book-components/Chat/MockedChat/MockedChat';
29
- import type { string_chat_format_name } from '../book-components/Chat/save/savePlugins';
30
- import type { ChatSaveFormatDefinition } from '../book-components/Chat/save/savePlugins';
31
- import { jsonSaveFormatDefinition } from '../book-components/Chat/save/savePlugins';
32
- import { txtSaveFormatDefinition } from '../book-components/Chat/save/savePlugins';
33
- import { mdSaveFormatDefinition } from '../book-components/Chat/save/savePlugins';
34
- import { htmlSaveFormatDefinition } from '../book-components/Chat/save/savePlugins';
35
- import { CHAT_SAVE_FORMATS } from '../book-components/Chat/save/savePlugins';
36
- import { getChatSaveFormatDefinitions } from '../book-components/Chat/save/savePlugins';
29
+ import type { ChatSaveFormatDefinition } from '../book-components/Chat/save/_common/ChatSaveFormatDefinition';
30
+ import { getChatSaveFormatDefinitions } from '../book-components/Chat/save/_common/getChatSaveFormatDefinitions';
31
+ import type { string_chat_format_name } from '../book-components/Chat/save/_common/string_chat_format_name';
32
+ import { htmlSaveFormatDefinition } from '../book-components/Chat/save/html/htmlSaveFormatDefinition';
33
+ import { CHAT_SAVE_FORMATS } from '../book-components/Chat/save/index';
34
+ import { jsonSaveFormatDefinition } from '../book-components/Chat/save/json/jsonSaveFormatDefinition';
35
+ import { mdSaveFormatDefinition } from '../book-components/Chat/save/markdown/mdSaveFormatDefinition';
36
+ import { txtSaveFormatDefinition } from '../book-components/Chat/save/text/txtSaveFormatDefinition';
37
37
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
38
38
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
39
39
  import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
@@ -76,14 +76,14 @@ export { MOCKED_CHAT_DELAY_CONFIGS };
76
76
  export type { MockedChatDelayConfig };
77
77
  export type { MockedChatProps };
78
78
  export { MockedChat };
79
- export type { string_chat_format_name };
80
79
  export type { ChatSaveFormatDefinition };
81
- export { jsonSaveFormatDefinition };
82
- export { txtSaveFormatDefinition };
83
- export { mdSaveFormatDefinition };
80
+ export { getChatSaveFormatDefinitions };
81
+ export type { string_chat_format_name };
84
82
  export { htmlSaveFormatDefinition };
85
83
  export { CHAT_SAVE_FORMATS };
86
- export { getChatSaveFormatDefinitions };
84
+ export { jsonSaveFormatDefinition };
85
+ export { mdSaveFormatDefinition };
86
+ export { txtSaveFormatDefinition };
87
87
  export type { ChatMessage };
88
88
  export type { ChatParticipant };
89
89
  export type { MessageButton };
@@ -16,8 +16,8 @@ import type { SendMessageToLlmChatFunction } from '../book-components/Chat/hooks
16
16
  import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps';
17
17
  import type { MockedChatDelayConfig } from '../book-components/Chat/MockedChat/MockedChat';
18
18
  import type { MockedChatProps } from '../book-components/Chat/MockedChat/MockedChat';
19
- import type { string_chat_format_name } from '../book-components/Chat/save/savePlugins';
20
- import type { ChatSaveFormatDefinition } from '../book-components/Chat/save/savePlugins';
19
+ import type { ChatSaveFormatDefinition } from '../book-components/Chat/save/_common/ChatSaveFormatDefinition';
20
+ import type { string_chat_format_name } from '../book-components/Chat/save/_common/string_chat_format_name';
21
21
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
22
22
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
23
23
  import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
@@ -348,8 +348,8 @@ export type { SendMessageToLlmChatFunction };
348
348
  export type { LlmChatProps };
349
349
  export type { MockedChatDelayConfig };
350
350
  export type { MockedChatProps };
351
- export type { string_chat_format_name };
352
351
  export type { ChatSaveFormatDefinition };
352
+ export type { string_chat_format_name };
353
353
  export type { ChatMessage };
354
354
  export type { ChatParticipant };
355
355
  export type { MessageButton };
@@ -1,4 +1,4 @@
1
- import { string_chat_format_name } from '../save/savePlugins';
1
+ import { string_chat_format_name } from '../save/_common/string_chat_format_name';
2
2
  import type { ChatProps } from './ChatProps';
3
3
  /**
4
4
  * Renders a chat with messages and input for new messages
@@ -1,8 +1,9 @@
1
1
  import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
2
+ import { id } from '../../../types/typeAliases';
2
3
  import type { ChatProps } from '../Chat/ChatProps';
4
+ import type { SendMessageToLlmChatFunction } from '../hooks/useSendMessageToLlmChat';
3
5
  import type { ChatMessage } from '../types/ChatMessage';
4
6
  import type { ChatParticipant } from '../types/ChatParticipant';
5
- import type { SendMessageToLlmChatFunction } from '../hooks/useSendMessageToLlmChat';
6
7
  /**
7
8
  * Props for LlmChat component, derived from ChatProps but with LLM-specific modifications
8
9
  *
@@ -34,4 +35,16 @@ export type LlmChatProps = Omit<ChatProps, 'messages' | 'onMessage' | 'onChange'
34
35
  * When provided, LlmChat will attach its internal handler to it (no React context needed).
35
36
  */
36
37
  readonly sendMessage?: SendMessageToLlmChatFunction;
38
+ /**
39
+ * Name of the USER as participant in the chat
40
+ *
41
+ * @default 'USER'
42
+ */
43
+ readonly userParticipantName?: id;
44
+ /**
45
+ * Name of the LLM as participant in the chat
46
+ *
47
+ * @default 'ASSISTANT'
48
+ */
49
+ readonly llmParticipantName?: id;
37
50
  };
@@ -0,0 +1,13 @@
1
+ import { string_file_extension, string_mime_type } from '../../../../types/typeAliases';
2
+ import type { ChatMessage } from '../../types/ChatMessage';
3
+ /**
4
+ * Plugin contract for chat export formatNames
5
+ * @public exported from `@promptbook/components`
6
+ */
7
+ export type ChatSaveFormatDefinition = {
8
+ formatName: string_file_extension | string_mime_type | string;
9
+ label: string;
10
+ getContent: (messages: ChatMessage[]) => string;
11
+ mimeType: string;
12
+ fileExtension: string;
13
+ };
@@ -0,0 +1,8 @@
1
+ import { ChatSaveFormatDefinition } from './ChatSaveFormatDefinition';
2
+ import { string_chat_format_name } from './string_chat_format_name';
3
+ /**
4
+ * Returns enabled chat save plugins filtered by formatNames (or all when omitted)
5
+ *
6
+ * @public exported from `@promptbook/components`
7
+ */
8
+ export declare function getChatSaveFormatDefinitions(formatNames?: ReadonlyArray<string_chat_format_name>): ReadonlyArray<ChatSaveFormatDefinition>;
@@ -0,0 +1,6 @@
1
+ import { CHAT_SAVE_FORMATS } from '..';
2
+ /**
3
+ * Supported chat export formatNames
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export type string_chat_format_name = typeof CHAT_SAVE_FORMATS[number]['formatName'];
@@ -0,0 +1,12 @@
1
+ /**
2
+ * HTML export plugin
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const htmlSaveFormatDefinition: {
7
+ readonly formatName: "html";
8
+ readonly label: "HTML";
9
+ readonly getContent: (messages: import("../../types/ChatMessage").ChatMessage[]) => string;
10
+ readonly mimeType: "text/html";
11
+ readonly fileExtension: "html";
12
+ };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Registry of all built-in chat save plugins
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const CHAT_SAVE_FORMATS: readonly [{
7
+ readonly formatName: "json";
8
+ readonly label: "JSON (full)";
9
+ readonly getContent: (messages: import("../types/ChatMessage").ChatMessage[]) => string;
10
+ readonly mimeType: "application/json";
11
+ readonly fileExtension: "json";
12
+ }, {
13
+ readonly formatName: "txt";
14
+ readonly label: "Plain Text";
15
+ readonly getContent: (messages: import("../types/ChatMessage").ChatMessage[]) => string;
16
+ readonly mimeType: "text/plain";
17
+ readonly fileExtension: "txt";
18
+ }, {
19
+ readonly formatName: "md";
20
+ readonly label: "Markdown";
21
+ readonly getContent: (messages: import("../types/ChatMessage").ChatMessage[]) => string;
22
+ readonly mimeType: "text/markdown";
23
+ readonly fileExtension: "md";
24
+ }, {
25
+ readonly formatName: "html";
26
+ readonly label: "HTML";
27
+ readonly getContent: (messages: import("../types/ChatMessage").ChatMessage[]) => string;
28
+ readonly mimeType: "text/html";
29
+ readonly fileExtension: "html";
30
+ }];
31
+ /**
32
+ * Note: [💞] Ignore a discrepancy between file name and entity name
33
+ */
@@ -0,0 +1,12 @@
1
+ /**
2
+ * JSON export plugin (full metadata)
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const jsonSaveFormatDefinition: {
7
+ readonly formatName: "json";
8
+ readonly label: "JSON (full)";
9
+ readonly getContent: (messages: import("../../types/ChatMessage").ChatMessage[]) => string;
10
+ readonly mimeType: "application/json";
11
+ readonly fileExtension: "json";
12
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Markdown export plugin
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const mdSaveFormatDefinition: {
7
+ readonly formatName: "md";
8
+ readonly label: "Markdown";
9
+ readonly getContent: (messages: import("../../types/ChatMessage").ChatMessage[]) => string;
10
+ readonly mimeType: "text/markdown";
11
+ readonly fileExtension: "md";
12
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Plain text export plugin (messages only)
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const txtSaveFormatDefinition: {
7
+ readonly formatName: "txt";
8
+ readonly label: "Plain Text";
9
+ readonly getContent: (messages: import("../../types/ChatMessage").ChatMessage[]) => string;
10
+ readonly mimeType: "text/plain";
11
+ readonly fileExtension: "txt";
12
+ };
@@ -1,16 +1,42 @@
1
- import type { string_markdown } from '../../../types/typeAliases';
2
- import type { string_name } from '../../../types/typeAliases';
1
+ import type { id, string_markdown } from '../../../types/typeAliases';
3
2
  /**
4
3
  * A message in the chat
5
4
  *
6
5
  * @public exported from `@promptbook/components`
7
6
  */
8
7
  export type ChatMessage = {
9
- id: string;
10
- date: Date;
11
- from: string_name;
8
+ /**
9
+ * Unique identifier of the message
10
+ */
11
+ id: id;
12
+ /**
13
+ * Date when the message was created
14
+ */
15
+ date?: Date;
16
+ /**
17
+ * The name of the participant who sent the message
18
+ */
19
+ from: id;
20
+ /**
21
+ * The content of the message with optional markdown formatting
22
+ */
12
23
  content: string_markdown;
24
+ /**
25
+ * Whether the message is complete (for example, if it's still being generated by an AI)
26
+ *
27
+ * @default true
28
+ */
13
29
  isComplete?: boolean;
30
+ /**
31
+ * @@@
32
+ */
14
33
  expectedAnswer?: string;
34
+ /**
35
+ * @@@
36
+ */
15
37
  isVoiceCall?: boolean;
16
38
  };
39
+ /**
40
+ * TODO: Delete `expectedAnswer` from ChatMessage
41
+ * TODO: Rename `date` into `created`+`modified`
42
+ */
@@ -1,4 +1,4 @@
1
- import type { string_color, string_name, string_person_fullname, string_url_image } from '../../../types/typeAliases';
1
+ import type { id, string_color, string_person_fullname, string_url_image } from '../../../types/typeAliases';
2
2
  import { Color } from '../../../utils/color/Color';
3
3
  /**
4
4
  * A participant in the chat
@@ -9,11 +9,11 @@ export type ChatParticipant = {
9
9
  /**
10
10
  * Identifies the participant by their name, same as `message.from`
11
11
  */
12
- name: string_name;
12
+ name: id;
13
13
  /**
14
14
  * Full name of the participant
15
15
  */
16
- fullname: string_person_fullname;
16
+ fullname?: string_person_fullname;
17
17
  /**
18
18
  * Am I the participant? (i.e. is this the user)
19
19
  */
@@ -7,3 +7,6 @@ import type { ExportFormat } from './ExportFormat';
7
7
  * @private utility of `<Chat/>` component
8
8
  */
9
9
  export declare function exportChatHistory(messages: ChatMessage[], format: ExportFormat, headerMarkdown?: string, participants?: ReadonlyArray<ChatParticipant>): Promise<void>;
10
+ /**
11
+ * TODO: !!!! Delete this parallel chat history export
12
+ */
@@ -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.102.0-1`).
18
+ * It follows semantic versioning (e.g., `0.102.0-2`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/wizard",
3
- "version": "0.102.0-2",
3
+ "version": "0.102.0-3",
4
4
  "description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -95,7 +95,7 @@
95
95
  "module": "./esm/index.es.js",
96
96
  "typings": "./esm/typings/src/_packages/wizard.index.d.ts",
97
97
  "peerDependencies": {
98
- "@promptbook/core": "0.102.0-2"
98
+ "@promptbook/core": "0.102.0-3"
99
99
  },
100
100
  "dependencies": {
101
101
  "@ai-sdk/deepseek": "0.1.6",
package/umd/index.umd.js CHANGED
@@ -48,7 +48,7 @@
48
48
  * @generated
49
49
  * @see https://github.com/webgptorg/promptbook
50
50
  */
51
- const PROMPTBOOK_ENGINE_VERSION = '0.102.0-2';
51
+ const PROMPTBOOK_ENGINE_VERSION = '0.102.0-3';
52
52
  /**
53
53
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
54
54
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1,105 +0,0 @@
1
- import { string_file_extension, string_mime_type } from '../../../types/typeAliases';
2
- import type { ChatMessage } from '../types/ChatMessage';
3
- /**
4
- * Supported chat export formatNames
5
- * @public exported from `@promptbook/components`
6
- */
7
- export type string_chat_format_name = typeof CHAT_SAVE_FORMATS[number]['formatName'];
8
- /**
9
- * Plugin contract for chat export formatNames
10
- * @public exported from `@promptbook/components`
11
- */
12
- export type ChatSaveFormatDefinition = {
13
- formatName: string_file_extension | string_mime_type | string;
14
- label: string;
15
- getContent: (messages: ChatMessage[]) => string;
16
- mimeType: string;
17
- fileExtension: string;
18
- };
19
- /**
20
- * JSON export plugin (full metadata)
21
- *
22
- * @public exported from `@promptbook/components`
23
- */
24
- export declare const jsonSaveFormatDefinition: {
25
- readonly formatName: "json";
26
- readonly label: "JSON (full)";
27
- readonly getContent: (messages: ChatMessage[]) => string;
28
- readonly mimeType: "application/json";
29
- readonly fileExtension: "json";
30
- };
31
- /**
32
- * Plain text export plugin (messages only)
33
- *
34
- * @public exported from `@promptbook/components`
35
- */
36
- export declare const txtSaveFormatDefinition: {
37
- readonly formatName: "txt";
38
- readonly label: "Plain Text";
39
- readonly getContent: (messages: ChatMessage[]) => string;
40
- readonly mimeType: "text/plain";
41
- readonly fileExtension: "txt";
42
- };
43
- /**
44
- * Markdown export plugin
45
- *
46
- * @public exported from `@promptbook/components`
47
- */
48
- export declare const mdSaveFormatDefinition: {
49
- readonly formatName: "md";
50
- readonly label: "Markdown";
51
- readonly getContent: (messages: ChatMessage[]) => string;
52
- readonly mimeType: "text/markdown";
53
- readonly fileExtension: "md";
54
- };
55
- /**
56
- * HTML export plugin
57
- *
58
- * @public exported from `@promptbook/components`
59
- */
60
- export declare const htmlSaveFormatDefinition: {
61
- readonly formatName: "html";
62
- readonly label: "HTML";
63
- readonly getContent: (messages: ChatMessage[]) => string;
64
- readonly mimeType: "text/html";
65
- readonly fileExtension: "html";
66
- };
67
- /**
68
- * Registry of all built-in chat save plugins
69
- *
70
- * @public exported from `@promptbook/components`
71
- */
72
- export declare const CHAT_SAVE_FORMATS: readonly [{
73
- readonly formatName: "json";
74
- readonly label: "JSON (full)";
75
- readonly getContent: (messages: ChatMessage[]) => string;
76
- readonly mimeType: "application/json";
77
- readonly fileExtension: "json";
78
- }, {
79
- readonly formatName: "txt";
80
- readonly label: "Plain Text";
81
- readonly getContent: (messages: ChatMessage[]) => string;
82
- readonly mimeType: "text/plain";
83
- readonly fileExtension: "txt";
84
- }, {
85
- readonly formatName: "md";
86
- readonly label: "Markdown";
87
- readonly getContent: (messages: ChatMessage[]) => string;
88
- readonly mimeType: "text/markdown";
89
- readonly fileExtension: "md";
90
- }, {
91
- readonly formatName: "html";
92
- readonly label: "HTML";
93
- readonly getContent: (messages: ChatMessage[]) => string;
94
- readonly mimeType: "text/html";
95
- readonly fileExtension: "html";
96
- }];
97
- /**
98
- * Returns enabled chat save plugins filtered by formatNames (or all when omitted)
99
- *
100
- * @public exported from `@promptbook/components`
101
- */
102
- export declare function getChatSaveFormatDefinitions(formatNames?: ReadonlyArray<string_chat_format_name>): ReadonlyArray<ChatSaveFormatDefinition>;
103
- /**
104
- * Note: [💞] Ignore a discrepancy between file name and entity name
105
- */