@promptbook/wizard 0.102.0-1 → 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.
Files changed (27) hide show
  1. package/esm/index.es.js +1 -1
  2. package/esm/typings/src/_packages/components.index.d.ts +17 -13
  3. package/esm/typings/src/_packages/types.index.d.ts +5 -3
  4. package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.delete.test.d.ts +1 -0
  5. package/esm/typings/src/book-components/Chat/Chat/Chat.d.ts +1 -1
  6. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +10 -1
  7. package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +14 -1
  8. package/esm/typings/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +13 -0
  9. package/esm/typings/src/book-components/Chat/save/_common/getChatSaveFormatDefinitions.d.ts +8 -0
  10. package/esm/typings/src/book-components/Chat/save/_common/string_chat_format_name.d.ts +6 -0
  11. package/esm/typings/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +12 -0
  12. package/esm/typings/src/book-components/Chat/save/index.d.ts +33 -0
  13. package/esm/typings/src/book-components/Chat/save/json/jsonSaveFormatDefinition.d.ts +12 -0
  14. package/esm/typings/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.d.ts +12 -0
  15. package/esm/typings/src/book-components/Chat/save/text/txtSaveFormatDefinition.d.ts +12 -0
  16. package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +31 -5
  17. package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +3 -3
  18. package/esm/typings/src/book-components/Chat/utils/exportChatHistory.d.ts +3 -0
  19. package/esm/typings/src/book-components/icons/AttachmentIcon.d.ts +11 -0
  20. package/esm/typings/src/book-components/icons/CloseIcon.d.ts +11 -0
  21. package/esm/typings/src/remote-server/ui/ServerApp.d.ts +13 -0
  22. package/esm/typings/src/remote-server/ui/renderServerIndexHtml.d.ts +7 -0
  23. package/esm/typings/src/remote-server/ui/types.d.ts +16 -0
  24. package/esm/typings/src/version.d.ts +1 -1
  25. package/package.json +2 -2
  26. package/umd/index.umd.js +1 -1
  27. package/esm/typings/src/book-components/Chat/save/savePlugins.d.ts +0 -105
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-1';
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';
@@ -41,6 +41,8 @@ import { parseMessageButtons } from '../book-components/Chat/utils/parseMessageB
41
41
  import { renderMarkdown } from '../book-components/Chat/utils/renderMarkdown';
42
42
  import { isMarkdownContent } from '../book-components/Chat/utils/renderMarkdown';
43
43
  import { ArrowIcon } from '../book-components/icons/ArrowIcon';
44
+ import { AttachmentIcon } from '../book-components/icons/AttachmentIcon';
45
+ import { CloseIcon } from '../book-components/icons/CloseIcon';
44
46
  import { PauseIcon } from '../book-components/icons/PauseIcon';
45
47
  import { PlayIcon } from '../book-components/icons/PlayIcon';
46
48
  import { ResetIcon } from '../book-components/icons/ResetIcon';
@@ -74,14 +76,14 @@ export { MOCKED_CHAT_DELAY_CONFIGS };
74
76
  export type { MockedChatDelayConfig };
75
77
  export type { MockedChatProps };
76
78
  export { MockedChat };
77
- export type { string_chat_format_name };
78
79
  export type { ChatSaveFormatDefinition };
79
- export { jsonSaveFormatDefinition };
80
- export { txtSaveFormatDefinition };
81
- export { mdSaveFormatDefinition };
80
+ export { getChatSaveFormatDefinitions };
81
+ export type { string_chat_format_name };
82
82
  export { htmlSaveFormatDefinition };
83
83
  export { CHAT_SAVE_FORMATS };
84
- export { getChatSaveFormatDefinitions };
84
+ export { jsonSaveFormatDefinition };
85
+ export { mdSaveFormatDefinition };
86
+ export { txtSaveFormatDefinition };
85
87
  export type { ChatMessage };
86
88
  export type { ChatParticipant };
87
89
  export type { MessageButton };
@@ -89,6 +91,8 @@ export { parseMessageButtons };
89
91
  export { renderMarkdown };
90
92
  export { isMarkdownContent };
91
93
  export { ArrowIcon };
94
+ export { AttachmentIcon };
95
+ export { CloseIcon };
92
96
  export { PauseIcon };
93
97
  export { PlayIcon };
94
98
  export { ResetIcon };
@@ -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';
@@ -154,6 +154,7 @@ import type { ApplicationRemoteServerOptions } from '../remote-server/types/Remo
154
154
  import type { ApplicationRemoteServerClientOptions } from '../remote-server/types/RemoteServerOptions';
155
155
  import type { LoginRequest } from '../remote-server/types/RemoteServerOptions';
156
156
  import type { LoginResponse } from '../remote-server/types/RemoteServerOptions';
157
+ import type { ServerInfo } from '../remote-server/ui/types';
157
158
  import type { Converter } from '../scrapers/_common/Converter';
158
159
  import type { ScraperAndConverterMetadata } from '../scrapers/_common/register/ScraperAndConverterMetadata';
159
160
  import type { ScraperConstructor } from '../scrapers/_common/register/ScraperConstructor';
@@ -347,8 +348,8 @@ export type { SendMessageToLlmChatFunction };
347
348
  export type { LlmChatProps };
348
349
  export type { MockedChatDelayConfig };
349
350
  export type { MockedChatProps };
350
- export type { string_chat_format_name };
351
351
  export type { ChatSaveFormatDefinition };
352
+ export type { string_chat_format_name };
352
353
  export type { ChatMessage };
353
354
  export type { ChatParticipant };
354
355
  export type { MessageButton };
@@ -485,6 +486,7 @@ export type { ApplicationRemoteServerOptions };
485
486
  export type { ApplicationRemoteServerClientOptions };
486
487
  export type { LoginRequest };
487
488
  export type { LoginResponse };
489
+ export type { ServerInfo };
488
490
  export type { Converter };
489
491
  export type { ScraperAndConverterMetadata };
490
492
  export type { ScraperConstructor };
@@ -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
@@ -145,7 +145,16 @@ export type ChatProps = {
145
145
  expectedAnswer: string | null;
146
146
  url: string;
147
147
  }): Promisable<void>;
148
+ /**
149
+ * Optional callback for handling file uploads
150
+ * When provided, enables file upload functionality via drag-and-drop and file button
151
+ * The callback should process the file and return text content to be inserted into the message
152
+ *
153
+ * @param file - The uploaded file
154
+ * @returns Promise or string with the text content to insert into the chat message
155
+ */
156
+ onFileUpload?(file: File): Promisable<string>;
148
157
  };
149
158
  /**
150
159
  * TODO: [☁️] Export component prop types only to `@promptbook/components` (not `@promptbook/types`)
151
- */
160
+ */
@@ -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
+ */
@@ -0,0 +1,11 @@
1
+ type AttachmentIconProps = {
2
+ size?: number;
3
+ color?: string;
4
+ };
5
+ /**
6
+ * @@@
7
+ *
8
+ * @public exported from `@promptbook/components`
9
+ */
10
+ export declare function AttachmentIcon({ size, color }: AttachmentIconProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ type CloseIconProps = {
2
+ size?: number;
3
+ color?: string;
4
+ };
5
+ /**
6
+ * @@@
7
+ *
8
+ * @public exported from `@promptbook/components`
9
+ */
10
+ export declare function CloseIcon({ size, color }: CloseIconProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { ServerInfo } from './types';
2
+ /**
3
+ * @@@
4
+ *
5
+ * @private internal utility of Remote Server
6
+ */
7
+ export declare function HtmlDoc({ info }: {
8
+ info: ServerInfo;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ /**
11
+ * Add Note: [💞] Ignore a discrepancy between file name and entity name
12
+ * <- TODO: !!! Maybe split into multiple files
13
+ */
@@ -0,0 +1,7 @@
1
+ import type { ServerInfo } from './types';
2
+ /**
3
+ * Render full HTML for the server index using React SSR without requiring TSX/JSX compiler flags.
4
+ *
5
+ * @private internal utility of Remote Server
6
+ */
7
+ export declare function renderServerIndexHtml(info: ServerInfo): string;
@@ -0,0 +1,16 @@
1
+ export type ServerInfo = {
2
+ bookLanguageVersion: string;
3
+ promptbookEngineVersion: string;
4
+ nodeVersion: string;
5
+ port: number | string | undefined;
6
+ startupDate: string;
7
+ isAnonymousModeAllowed: boolean;
8
+ isApplicationModeAllowed: boolean;
9
+ pipelines: ReadonlyArray<string>;
10
+ runningExecutions: number;
11
+ paths: ReadonlyArray<string>;
12
+ };
13
+ /**
14
+ * Add Note: [💞] Ignore a discrepancy between file name and entity name
15
+ * <- TODO: !!! Maybe split into multiple files
16
+ */
@@ -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-0`).
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-1",
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-1"
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-1';
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
- */