@promptbook/wizard 0.101.0-1 β†’ 0.101.0-10

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 (37) hide show
  1. package/esm/index.es.js +1 -1
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/components.index.d.ts +14 -0
  4. package/esm/typings/src/_packages/core.index.d.ts +2 -0
  5. package/esm/typings/src/_packages/types.index.d.ts +6 -0
  6. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +41 -3
  7. package/esm/typings/src/book-2.0/agent-source/parseParameters.d.ts +13 -0
  8. package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +8 -2
  9. package/esm/typings/src/book-2.0/commitments/DELETE/DELETE.d.ts +59 -0
  10. package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +8 -2
  11. package/esm/typings/src/book-2.0/commitments/GOAL/GOAL.d.ts +45 -0
  12. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +1 -1
  13. package/esm/typings/src/book-2.0/commitments/MEMORY/MEMORY.d.ts +46 -0
  14. package/esm/typings/src/book-2.0/commitments/MESSAGE/MESSAGE.d.ts +47 -0
  15. package/esm/typings/src/book-2.0/commitments/META/META.d.ts +62 -0
  16. package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +8 -2
  17. package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +8 -2
  18. package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +8 -2
  19. package/esm/typings/src/book-2.0/commitments/SCENARIO/SCENARIO.d.ts +46 -0
  20. package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +8 -2
  21. package/esm/typings/src/book-2.0/commitments/index.d.ts +7 -3
  22. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/MockedChat.d.ts +46 -0
  23. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/index.d.ts +3 -0
  24. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +10 -0
  25. package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +3 -0
  26. package/esm/typings/src/book-components/Chat/Chat/Chat.d.ts +0 -5
  27. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +28 -2
  28. package/esm/typings/src/book-components/Chat/Chat/constants.d.ts +8 -0
  29. package/esm/typings/src/book-components/icons/ArrowIcon.d.ts +9 -0
  30. package/esm/typings/src/book-components/icons/ResetIcon.d.ts +6 -0
  31. package/esm/typings/src/book-components/icons/SendIcon.d.ts +8 -0
  32. package/esm/typings/src/book-components/icons/TemplateIcon.d.ts +8 -0
  33. package/esm/typings/src/utils/markdown/humanizeAiText.d.ts +1 -0
  34. package/esm/typings/src/version.d.ts +1 -1
  35. package/package.json +2 -2
  36. package/umd/index.umd.js +1 -1
  37. package/umd/index.umd.js.map +1 -1
@@ -0,0 +1,46 @@
1
+ import type { ChatProps } from '../../Chat/Chat/ChatProps';
2
+ /**
3
+ * Delay configuration for the MockedChat component
4
+ *
5
+ * @public exported from `@promptbook/components`
6
+ */
7
+ export type MockedChatDelayConfig = {
8
+ /**
9
+ * Delay before showing the first message (in milliseconds)
10
+ * @default 1000
11
+ */
12
+ beforeFirstMessage?: number;
13
+ /**
14
+ * Emulated thinking time between messages (in milliseconds)
15
+ * @default 2000
16
+ */
17
+ thinkingBetweenMessages?: number;
18
+ /**
19
+ * Wait time after each written word (in milliseconds)
20
+ * @default 100
21
+ */
22
+ waitAfterWord?: number;
23
+ /**
24
+ * Extra delay on top of the word waiting (in milliseconds)
25
+ * @default 50
26
+ */
27
+ extraWordDelay?: number;
28
+ };
29
+ /**
30
+ * Props for MockedChat component
31
+ *
32
+ * @public exported from `@promptbook/components`
33
+ */
34
+ export type MockedChatProps = ChatProps & {
35
+ /**
36
+ * Optional delays configuration for emulating typing behavior
37
+ */
38
+ delayConfig?: MockedChatDelayConfig;
39
+ };
40
+ /**
41
+ * MockedChat component that shows the same chat as Chat but emulates ongoing discussion
42
+ * with realistic typing delays and thinking pauses.
43
+ *
44
+ * @public exported from `@promptbook/components`
45
+ */
46
+ export declare function MockedChat(props: MockedChatProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './AvatarProfile';
2
+ export * from './AvatarProfileFromSource';
3
+ export * from './MockedChat';
@@ -1,5 +1,7 @@
1
1
  import type { CSSProperties } from 'react';
2
+ import type { Promisable } from 'type-fest';
2
3
  import type { string_book } from '../../book-2.0/agent-source/string_book';
4
+ import { string_knowledge_source_content } from '../../types/typeAliases';
3
5
  /**
4
6
  * Props of `BookEditor`
5
7
  *
@@ -27,10 +29,18 @@ export type BookEditorProps = {
27
29
  * Callback function to handle changes in the book content.
28
30
  */
29
31
  onChange?(value: string_book): void;
32
+ /**
33
+ * returns the URL of the uploaded file on CDN or storage
34
+ */
35
+ onFileUpload?(file: File): Promisable<string_knowledge_source_content>;
30
36
  /**
31
37
  * If true, logs verbose debug info to the console and shows additional visual cues
32
38
  */
33
39
  readonly isVerbose?: boolean;
40
+ /**
41
+ * If true, disables border radius making the editor have sharp corners
42
+ */
43
+ readonly isBorderRadiusDisabled?: boolean;
34
44
  };
35
45
  /**
36
46
  * Renders a book editor
@@ -1,3 +1,4 @@
1
+ import { Promisable } from 'type-fest';
1
2
  import type { string_book } from '../../book-2.0/agent-source/string_book';
2
3
  /**
3
4
  * @private util of `<BookEditor />`
@@ -7,7 +8,9 @@ export type BookEditorInnerProps = {
7
8
  fontClassName?: string;
8
9
  value?: string_book;
9
10
  onChange?(value: string_book): void;
11
+ onFileUpload?(file: File): Promisable<string>;
10
12
  isVerbose?: boolean;
13
+ isBorderRadiusDisabled?: boolean;
11
14
  };
12
15
  /**
13
16
  * @private util of `<BookEditor />`
@@ -1,9 +1,4 @@
1
1
  import type { ChatProps } from './ChatProps';
2
- /**
3
- * @deprecated use `isComplete` instead
4
- * @private util of `<Chat />`
5
- */
6
- export declare const LOADING_INTERACTIVE_IMAGE = "Loading...";
7
2
  /**
8
3
  * Renders a chat with messages and input for new messages
9
4
  *
@@ -23,10 +23,16 @@ export type ChatProps = {
23
23
  * Called when user sends a message
24
24
  *
25
25
  * Note: You must handle the message yourself and add it to the `messages` array
26
+ *
27
+ * - When set, the send textarea and button will be shown
28
+ * - When undefined, the chat has no input and is read-only showing only the messages
26
29
  */
27
- onMessage(messageContent: string): Promisable<void>;
30
+ onMessage?(messageContent: string): Promisable<void>;
28
31
  /**
29
- * Optional callback, when set, button for resetting chat will be shown
32
+ * Optional callback
33
+ *
34
+ * - When set, button for resetting chat will be shown
35
+ * - When undefined, no reset button will be shown
30
36
  */
31
37
  onReset?(): Promisable<void>;
32
38
  /**
@@ -113,4 +119,24 @@ export type ChatProps = {
113
119
  * Keys should match ChatMessage.from values (e.g., 'USER', 'AGENT_{id}', etc.)
114
120
  */
115
121
  readonly participants?: ReadonlyArray<ChatParticipant>;
122
+ /**
123
+ * Optional callback for handling user feedback on messages
124
+ * When provided, star rating buttons (1-5 stars) will be displayed next to each message
125
+ *
126
+ * @param feedback - Object containing the feedback data
127
+ * @param feedback.message - The message being rated
128
+ * @param feedback.rating - Star rating from 1 to 5
129
+ * @param feedback.textRating - Optional text feedback/note from user
130
+ * @param feedback.chatThread - Complete chat thread as string
131
+ * @param feedback.expectedAnswer - Optional expected answer provided by user
132
+ * @param feedback.url - Current page URL where feedback was given
133
+ */
134
+ onFeedback?(feedback: {
135
+ message: ChatMessage;
136
+ rating: number;
137
+ textRating: string;
138
+ chatThread: string;
139
+ expectedAnswer: string | null;
140
+ url: string;
141
+ }): Promisable<void>;
116
142
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @deprecated use `isComplete` instead
3
+ * @private util of `<Chat />`
4
+ */
5
+ export declare const LOADING_INTERACTIVE_IMAGE = "Loading...";
6
+ /**
7
+ * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
8
+ */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Shows simple arrow icon pointing up or down
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const ArrowIcon: ({ direction, size }: {
7
+ direction: string;
8
+ size: number;
9
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Shows simple reset icon
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const ResetIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Shows simple send icon
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const SendIcon: ({ size }: {
7
+ size: number;
8
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Shows simple template icon
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const TemplateIcon: ({ size }: {
7
+ size: number;
8
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -9,5 +9,6 @@ import { string_markdown } from '../../types/typeAliases';
9
9
  */
10
10
  export declare function humanizeAiText(aiText: string_markdown): string_markdown;
11
11
  /**
12
+ * TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
12
13
  * TODO: [πŸ…ΎοΈ] !!! Use this across the project where AI text is involved
13
14
  */
@@ -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-0`).
18
+ * It follows semantic versioning (e.g., `0.101.0-9`).
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-1",
3
+ "version": "0.101.0-10",
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-1"
98
+ "@promptbook/core": "0.101.0-10"
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-1';
51
+ const PROMPTBOOK_ENGINE_VERSION = '0.101.0-10';
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