@promptbook/wizard 0.101.0 → 0.102.0-1

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.
@@ -7,9 +7,6 @@ import type { AvatarProfileProps } from '../book-components/AvatarProfile/Avatar
7
7
  import { AvatarProfile } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
8
8
  import type { AvatarProfileFromSourceProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
9
9
  import { AvatarProfileFromSource } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
10
- import type { MockedChatDelayConfig } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
11
- import type { MockedChatProps } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
12
- import { MockedChat } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
13
10
  import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
14
11
  import { BookEditor } from '../book-components/BookEditor/BookEditor';
15
12
  import { DEFAULT_BOOK_FONT_CLASS } from '../book-components/BookEditor/config';
@@ -20,6 +17,23 @@ import type { SendMessageToLlmChatFunction } from '../book-components/Chat/hooks
20
17
  import { useSendMessageToLlmChat } from '../book-components/Chat/hooks/useSendMessageToLlmChat';
21
18
  import { LlmChat } from '../book-components/Chat/LlmChat/LlmChat';
22
19
  import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps';
20
+ import { NORMAL_FLOW } from '../book-components/Chat/MockedChat/constants';
21
+ import { FAST_FLOW } from '../book-components/Chat/MockedChat/constants';
22
+ import { SLOW_FLOW } from '../book-components/Chat/MockedChat/constants';
23
+ import { BLOCKY_FLOW } from '../book-components/Chat/MockedChat/constants';
24
+ import { RANDOM_FLOW } from '../book-components/Chat/MockedChat/constants';
25
+ import { MOCKED_CHAT_DELAY_CONFIGS } from '../book-components/Chat/MockedChat/constants';
26
+ import type { MockedChatDelayConfig } from '../book-components/Chat/MockedChat/MockedChat';
27
+ import type { MockedChatProps } from '../book-components/Chat/MockedChat/MockedChat';
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';
23
37
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
24
38
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
25
39
  import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
@@ -41,9 +55,6 @@ export type { AvatarProfileProps };
41
55
  export { AvatarProfile };
42
56
  export type { AvatarProfileFromSourceProps };
43
57
  export { AvatarProfileFromSource };
44
- export type { MockedChatDelayConfig };
45
- export type { MockedChatProps };
46
- export { MockedChat };
47
58
  export type { BookEditorProps };
48
59
  export { BookEditor };
49
60
  export { DEFAULT_BOOK_FONT_CLASS };
@@ -54,6 +65,23 @@ export type { SendMessageToLlmChatFunction };
54
65
  export { useSendMessageToLlmChat };
55
66
  export { LlmChat };
56
67
  export type { LlmChatProps };
68
+ export { NORMAL_FLOW };
69
+ export { FAST_FLOW };
70
+ export { SLOW_FLOW };
71
+ export { BLOCKY_FLOW };
72
+ export { RANDOM_FLOW };
73
+ export { MOCKED_CHAT_DELAY_CONFIGS };
74
+ export type { MockedChatDelayConfig };
75
+ export type { MockedChatProps };
76
+ export { MockedChat };
77
+ export type { string_chat_format_name };
78
+ export type { ChatSaveFormatDefinition };
79
+ export { jsonSaveFormatDefinition };
80
+ export { txtSaveFormatDefinition };
81
+ export { mdSaveFormatDefinition };
82
+ export { htmlSaveFormatDefinition };
83
+ export { CHAT_SAVE_FORMATS };
84
+ export { getChatSaveFormatDefinitions };
57
85
  export type { ChatMessage };
58
86
  export type { ChatParticipant };
59
87
  export type { MessageButton };
@@ -9,13 +9,15 @@ import type { AvatarChipProps } from '../book-components/AvatarProfile/AvatarChi
9
9
  import type { AvatarChipFromSourceProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
10
10
  import type { AvatarProfileProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
11
11
  import type { AvatarProfileFromSourceProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
12
- import type { MockedChatDelayConfig } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
13
- import type { MockedChatProps } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
14
12
  import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
15
13
  import type { ChatProps } from '../book-components/Chat/Chat/ChatProps';
16
14
  import type { ChatAutoScrollConfig } from '../book-components/Chat/hooks/useChatAutoScroll';
17
15
  import type { SendMessageToLlmChatFunction } from '../book-components/Chat/hooks/useSendMessageToLlmChat';
18
16
  import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps';
17
+ import type { MockedChatDelayConfig } from '../book-components/Chat/MockedChat/MockedChat';
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
21
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
20
22
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
21
23
  import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
@@ -338,13 +340,15 @@ export type { AvatarChipProps };
338
340
  export type { AvatarChipFromSourceProps };
339
341
  export type { AvatarProfileProps };
340
342
  export type { AvatarProfileFromSourceProps };
341
- export type { MockedChatDelayConfig };
342
- export type { MockedChatProps };
343
343
  export type { BookEditorProps };
344
344
  export type { ChatProps };
345
345
  export type { ChatAutoScrollConfig };
346
346
  export type { SendMessageToLlmChatFunction };
347
347
  export type { LlmChatProps };
348
+ export type { MockedChatDelayConfig };
349
+ export type { MockedChatProps };
350
+ export type { string_chat_format_name };
351
+ export type { ChatSaveFormatDefinition };
348
352
  export type { ChatMessage };
349
353
  export type { ChatParticipant };
350
354
  export type { MessageButton };
@@ -1,3 +1,4 @@
1
+ import { string_chat_format_name } from '../save/savePlugins';
1
2
  import type { ChatProps } from './ChatProps';
2
3
  /**
3
4
  * Renders a chat with messages and input for new messages
@@ -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?: string_chat_format_name[];
18
+ isSaveButtonEnabled?: boolean;
19
+ }): import("react/jsx-runtime").JSX.Element;
@@ -6,25 +6,42 @@ import type { ChatProps } from '../../Chat/Chat/ChatProps';
6
6
  */
7
7
  export type MockedChatDelayConfig = {
8
8
  /**
9
- * Delay before showing the first message (in milliseconds)
9
+ * Delay before showing the first message (ms)
10
10
  * @default 1000
11
11
  */
12
- beforeFirstMessage?: number;
12
+ beforeFirstMessage?: number | [number, number];
13
13
  /**
14
- * Emulated thinking time between messages (in milliseconds)
14
+ * Emulated thinking time between messages (ms)
15
+ * Can be a fixed number or [min, max] for random range.
15
16
  * @default 2000
16
17
  */
17
- thinkingBetweenMessages?: number;
18
+ thinkingBetweenMessages?: number | [number, number];
18
19
  /**
19
- * Wait time after each written word (in milliseconds)
20
+ * Wait time after each written word (ms)
21
+ * Can be a fixed number or [min, max] for random range.
20
22
  * @default 100
21
23
  */
22
- waitAfterWord?: number;
24
+ waitAfterWord?: number | [number, number];
23
25
  /**
24
- * Extra delay on top of the word waiting (in milliseconds)
26
+ * Extra delay on top of the word waiting (ms)
27
+ * Can be a fixed number or [min, max] for random range.
25
28
  * @default 50
26
29
  */
27
- extraWordDelay?: number;
30
+ extraWordDelay?: number | [number, number];
31
+ /**
32
+ * Chance (0-1) that a longer pause occurs before a message (e.g. agent switch)
33
+ * @default 0.2
34
+ */
35
+ longPauseChance?: number;
36
+ /**
37
+ * Range for long pause duration (ms), [min, max]
38
+ * @default [1200, 3500]
39
+ */
40
+ longPauseDuration?: [number, number];
41
+ /**
42
+ * If true, disables typing effect and shows full message at once (BLOCKY_FLOW)
43
+ */
44
+ blocky?: boolean;
28
45
  };
29
46
  /**
30
47
  * Props for MockedChat component
@@ -0,0 +1,42 @@
1
+ import { MockedChatDelayConfig } from './MockedChat';
2
+ /**
3
+ * Normal flow of messages in the `MockedChat` component
4
+ *
5
+ * @public exported from `@promptbook/components`
6
+ */
7
+ export declare const NORMAL_FLOW: MockedChatDelayConfig;
8
+ /**
9
+ * Fast flow of messages in the `MockedChat` component
10
+ *
11
+ * @public exported from `@promptbook/components`
12
+ */
13
+ export declare const FAST_FLOW: MockedChatDelayConfig;
14
+ /**
15
+ * Slow flow of messages in the `MockedChat` component
16
+ *
17
+ * @public exported from `@promptbook/components`
18
+ */
19
+ export declare const SLOW_FLOW: MockedChatDelayConfig;
20
+ /**
21
+ * Blocky flow of messages in the `MockedChat` component
22
+ *
23
+ * Messages appear in blocks rather than word-by-word
24
+ *
25
+ * @public exported from `@promptbook/components`
26
+ */
27
+ export declare const BLOCKY_FLOW: MockedChatDelayConfig;
28
+ /**
29
+ * Random flow of messages in the `MockedChat` component
30
+ *
31
+ * @public exported from `@promptbook/components`
32
+ */
33
+ export declare const RANDOM_FLOW: MockedChatDelayConfig;
34
+ /**
35
+ * All predefined delay configurations for the `MockedChat` component
36
+ *
37
+ * @public exported from `@promptbook/components`
38
+ */
39
+ export declare const MOCKED_CHAT_DELAY_CONFIGS: Record<string, MockedChatDelayConfig>;
40
+ /**
41
+ * Note: [💞] Ignore a discrepancy between file name and entity name
42
+ */
@@ -0,0 +1,105 @@
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
+ */
@@ -31,6 +31,12 @@ export type RemoteServerOptions<TCustomOptions> = CommonToolsOptions & {
31
31
  * @property {number} port The port number the server will listen on.
32
32
  */
33
33
  readonly port: number;
34
+ /**
35
+ * Enable rich UI (React + Tailwind) at `/` path.
36
+ * Default: true
37
+ * If false, server will respond with markdown as before.
38
+ */
39
+ readonly isRichUi?: boolean;
34
40
  /**
35
41
  * Creates execution tools the client
36
42
  *
@@ -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.102.0-0`).
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.101.0",
3
+ "version": "0.102.0-1",
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.101.0"
98
+ "@promptbook/core": "0.102.0-1"
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.101.0';
51
+ const PROMPTBOOK_ENGINE_VERSION = '0.102.0-1';
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