@promptbook/wizard 0.101.0-4 β 0.101.0-7
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 +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +6 -0
- package/esm/typings/src/_packages/types.index.d.ts +4 -0
- package/esm/typings/src/book-2.0/commitments/DELETE/DELETE.d.ts +59 -0
- package/esm/typings/src/book-2.0/commitments/GOAL/GOAL.d.ts +39 -0
- package/esm/typings/src/book-2.0/commitments/MEMORY/MEMORY.d.ts +40 -0
- package/esm/typings/src/book-2.0/commitments/MESSAGE/MESSAGE.d.ts +41 -0
- package/esm/typings/src/book-2.0/commitments/META/META.d.ts +62 -0
- package/esm/typings/src/book-2.0/commitments/SCENARIO/SCENARIO.d.ts +40 -0
- package/esm/typings/src/book-2.0/commitments/index.d.ts +7 -3
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/MockedChat.d.ts +46 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/index.d.ts +3 -0
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +10 -0
- package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +3 -0
- package/esm/typings/src/utils/markdown/humanizeAiText.d.ts +1 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
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.101.0-
|
39
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.101.0-7';
|
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
|
@@ -7,6 +7,9 @@ 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';
|
10
13
|
import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
|
11
14
|
import { BookEditor } from '../book-components/BookEditor/BookEditor';
|
12
15
|
import { DEFAULT_BOOK_FONT_CLASS } from '../book-components/BookEditor/config';
|
@@ -31,6 +34,9 @@ export type { AvatarProfileProps };
|
|
31
34
|
export { AvatarProfile };
|
32
35
|
export type { AvatarProfileFromSourceProps };
|
33
36
|
export { AvatarProfileFromSource };
|
37
|
+
export type { MockedChatDelayConfig };
|
38
|
+
export type { MockedChatProps };
|
39
|
+
export { MockedChat };
|
34
40
|
export type { BookEditorProps };
|
35
41
|
export { BookEditor };
|
36
42
|
export { DEFAULT_BOOK_FONT_CLASS };
|
@@ -8,6 +8,8 @@ import type { AvatarChipProps } from '../book-components/AvatarProfile/AvatarChi
|
|
8
8
|
import type { AvatarChipFromSourceProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
|
9
9
|
import type { AvatarProfileProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
|
10
10
|
import type { AvatarProfileFromSourceProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
|
11
|
+
import type { MockedChatDelayConfig } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
|
12
|
+
import type { MockedChatProps } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
|
11
13
|
import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
|
12
14
|
import type { ChatProps } from '../book-components/Chat/Chat/ChatProps';
|
13
15
|
import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps';
|
@@ -330,6 +332,8 @@ export type { AvatarChipProps };
|
|
330
332
|
export type { AvatarChipFromSourceProps };
|
331
333
|
export type { AvatarProfileProps };
|
332
334
|
export type { AvatarProfileFromSourceProps };
|
335
|
+
export type { MockedChatDelayConfig };
|
336
|
+
export type { MockedChatProps };
|
333
337
|
export type { BookEditorProps };
|
334
338
|
export type { ChatProps };
|
335
339
|
export type { LlmChatProps };
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
3
|
+
/**
|
4
|
+
* DELETE commitment definition
|
5
|
+
*
|
6
|
+
* The DELETE commitment (and its aliases CANCEL, DISCARD, REMOVE) is used to
|
7
|
+
* remove or disregard certain information or context. This can be useful for
|
8
|
+
* overriding previous commitments or removing unwanted behaviors.
|
9
|
+
*
|
10
|
+
* Example usage in agent source:
|
11
|
+
*
|
12
|
+
* ```book
|
13
|
+
* DELETE Previous formatting requirements
|
14
|
+
* CANCEL All emotional responses
|
15
|
+
* DISCARD Technical jargon explanations
|
16
|
+
* REMOVE Casual conversational style
|
17
|
+
* ```
|
18
|
+
*
|
19
|
+
* @private [πͺ] Maybe export the commitments through some package
|
20
|
+
*/
|
21
|
+
export declare class DeleteCommitmentDefinition extends BaseCommitmentDefinition<'DELETE' | 'CANCEL' | 'DISCARD' | 'REMOVE'> {
|
22
|
+
constructor(type: 'DELETE' | 'CANCEL' | 'DISCARD' | 'REMOVE');
|
23
|
+
/**
|
24
|
+
* Short one-line description of DELETE/CANCEL/DISCARD/REMOVE.
|
25
|
+
*/
|
26
|
+
get description(): string;
|
27
|
+
/**
|
28
|
+
* Markdown documentation for DELETE commitment.
|
29
|
+
*/
|
30
|
+
get documentation(): string;
|
31
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
32
|
+
}
|
33
|
+
/**
|
34
|
+
* Singleton instances of the DELETE commitment definitions with aliases
|
35
|
+
*
|
36
|
+
* @private [πͺ] Maybe export the commitments through some package
|
37
|
+
*/
|
38
|
+
export declare const DeleteCommitment: DeleteCommitmentDefinition;
|
39
|
+
/**
|
40
|
+
* Singleton instances of the DELETE commitment definitions with aliases
|
41
|
+
*
|
42
|
+
* @private [πͺ] Maybe export the commitments through some package
|
43
|
+
*/
|
44
|
+
export declare const CancelCommitment: DeleteCommitmentDefinition;
|
45
|
+
/**
|
46
|
+
* Singleton instances of the DELETE commitment definitions with aliases
|
47
|
+
*
|
48
|
+
* @private [πͺ] Maybe export the commitments through some package
|
49
|
+
*/
|
50
|
+
export declare const DiscardCommitment: DeleteCommitmentDefinition;
|
51
|
+
/**
|
52
|
+
* Singleton instances of the DELETE commitment definitions with aliases
|
53
|
+
*
|
54
|
+
* @private [πͺ] Maybe export the commitments through some package
|
55
|
+
*/
|
56
|
+
export declare const RemoveCommitment: DeleteCommitmentDefinition;
|
57
|
+
/**
|
58
|
+
* Note: [π] Ignore a discrepancy between file name and entity name
|
59
|
+
*/
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
3
|
+
/**
|
4
|
+
* GOAL commitment definition
|
5
|
+
*
|
6
|
+
* The GOAL commitment defines the main goal which should be achieved by the AI assistant.
|
7
|
+
* There can be multiple goals. Later goals are more important than earlier goals.
|
8
|
+
*
|
9
|
+
* Example usage in agent source:
|
10
|
+
*
|
11
|
+
* ```book
|
12
|
+
* GOAL Help users understand complex technical concepts
|
13
|
+
* GOAL Provide accurate and up-to-date information
|
14
|
+
* GOAL Always prioritize user safety and ethical guidelines
|
15
|
+
* ```
|
16
|
+
*
|
17
|
+
* @private [πͺ] Maybe export the commitments through some package
|
18
|
+
*/
|
19
|
+
export declare class GoalCommitmentDefinition extends BaseCommitmentDefinition<'GOAL'> {
|
20
|
+
constructor();
|
21
|
+
/**
|
22
|
+
* Short one-line description of GOAL.
|
23
|
+
*/
|
24
|
+
get description(): string;
|
25
|
+
/**
|
26
|
+
* Markdown documentation for GOAL commitment.
|
27
|
+
*/
|
28
|
+
get documentation(): string;
|
29
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* Singleton instance of the GOAL commitment definition
|
33
|
+
*
|
34
|
+
* @private [πͺ] Maybe export the commitments through some package
|
35
|
+
*/
|
36
|
+
export declare const GoalCommitment: GoalCommitmentDefinition;
|
37
|
+
/**
|
38
|
+
* Note: [π] Ignore a discrepancy between file name and entity name
|
39
|
+
*/
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
3
|
+
/**
|
4
|
+
* MEMORY commitment definition
|
5
|
+
*
|
6
|
+
* The MEMORY commitment is similar to KNOWLEDGE but has a focus on remembering past
|
7
|
+
* interactions and user preferences. It helps the agent maintain context about the
|
8
|
+
* user's history, preferences, and previous conversations.
|
9
|
+
*
|
10
|
+
* Example usage in agent source:
|
11
|
+
*
|
12
|
+
* ```book
|
13
|
+
* MEMORY User prefers detailed technical explanations
|
14
|
+
* MEMORY Previously worked on React projects
|
15
|
+
* MEMORY Timezone: UTC-5 (Eastern Time)
|
16
|
+
* ```
|
17
|
+
*
|
18
|
+
* @private [πͺ] Maybe export the commitments through some package
|
19
|
+
*/
|
20
|
+
export declare class MemoryCommitmentDefinition extends BaseCommitmentDefinition<'MEMORY'> {
|
21
|
+
constructor();
|
22
|
+
/**
|
23
|
+
* Short one-line description of MEMORY.
|
24
|
+
*/
|
25
|
+
get description(): string;
|
26
|
+
/**
|
27
|
+
* Markdown documentation for MEMORY commitment.
|
28
|
+
*/
|
29
|
+
get documentation(): string;
|
30
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
31
|
+
}
|
32
|
+
/**
|
33
|
+
* Singleton instance of the MEMORY commitment definition
|
34
|
+
*
|
35
|
+
* @private [πͺ] Maybe export the commitments through some package
|
36
|
+
*/
|
37
|
+
export declare const MemoryCommitment: MemoryCommitmentDefinition;
|
38
|
+
/**
|
39
|
+
* Note: [π] Ignore a discrepancy between file name and entity name
|
40
|
+
*/
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
3
|
+
/**
|
4
|
+
* MESSAGE commitment definition
|
5
|
+
*
|
6
|
+
* The MESSAGE commitment contains 1:1 text of the message which AI assistant already
|
7
|
+
* sent during the conversation. Later messages are later in the conversation.
|
8
|
+
* It is similar to EXAMPLE but it is not example, it is the real message which
|
9
|
+
* AI assistant already sent.
|
10
|
+
*
|
11
|
+
* Example usage in agent source:
|
12
|
+
*
|
13
|
+
* ```book
|
14
|
+
* MESSAGE Hello! How can I help you today?
|
15
|
+
* MESSAGE I understand you're looking for information about our services.
|
16
|
+
* MESSAGE Based on your requirements, I'd recommend our premium package.
|
17
|
+
* ```
|
18
|
+
*
|
19
|
+
* @private [πͺ] Maybe export the commitments through some package
|
20
|
+
*/
|
21
|
+
export declare class MessageCommitmentDefinition extends BaseCommitmentDefinition<'MESSAGE'> {
|
22
|
+
constructor();
|
23
|
+
/**
|
24
|
+
* Short one-line description of MESSAGE.
|
25
|
+
*/
|
26
|
+
get description(): string;
|
27
|
+
/**
|
28
|
+
* Markdown documentation for MESSAGE commitment.
|
29
|
+
*/
|
30
|
+
get documentation(): string;
|
31
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
32
|
+
}
|
33
|
+
/**
|
34
|
+
* Singleton instance of the MESSAGE commitment definition
|
35
|
+
*
|
36
|
+
* @private [πͺ] Maybe export the commitments through some package
|
37
|
+
*/
|
38
|
+
export declare const MessageCommitment: MessageCommitmentDefinition;
|
39
|
+
/**
|
40
|
+
* Note: [π] Ignore a discrepancy between file name and entity name
|
41
|
+
*/
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
3
|
+
/**
|
4
|
+
* META commitment definition
|
5
|
+
*
|
6
|
+
* The META commitment handles all meta-information about the agent such as:
|
7
|
+
* - META IMAGE: Sets the agent's avatar/profile image URL
|
8
|
+
* - META LINK: Provides profile/source links for the person the agent models
|
9
|
+
* - META TITLE: Sets the agent's display title
|
10
|
+
* - META DESCRIPTION: Sets the agent's description
|
11
|
+
* - META [ANYTHING]: Any other meta information in uppercase format
|
12
|
+
*
|
13
|
+
* These commitments are special because they don't affect the system message,
|
14
|
+
* but are handled separately in the parsing logic for profile display.
|
15
|
+
*
|
16
|
+
* Example usage in agent source:
|
17
|
+
*
|
18
|
+
* ```book
|
19
|
+
* META IMAGE https://example.com/avatar.jpg
|
20
|
+
* META LINK https://twitter.com/username
|
21
|
+
* META TITLE Professional Assistant
|
22
|
+
* META DESCRIPTION An AI assistant specialized in business tasks
|
23
|
+
* META AUTHOR John Doe
|
24
|
+
* META VERSION 1.0
|
25
|
+
* ```
|
26
|
+
*
|
27
|
+
* @private [πͺ] Maybe export the commitments through some package
|
28
|
+
*/
|
29
|
+
export declare class MetaCommitmentDefinition extends BaseCommitmentDefinition<`META${string}`> {
|
30
|
+
constructor();
|
31
|
+
/**
|
32
|
+
* Short one-line description of META commitments.
|
33
|
+
*/
|
34
|
+
get description(): string;
|
35
|
+
/**
|
36
|
+
* Markdown documentation for META commitment.
|
37
|
+
*/
|
38
|
+
get documentation(): string;
|
39
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
40
|
+
/**
|
41
|
+
* Extracts meta information from the content based on the meta type
|
42
|
+
* This is used by the parsing logic
|
43
|
+
*/
|
44
|
+
extractMetaValue(metaType: string, content: string): string | null;
|
45
|
+
/**
|
46
|
+
* Validates if the provided content is a valid URL (for IMAGE and LINK types)
|
47
|
+
*/
|
48
|
+
isValidUrl(content: string): boolean;
|
49
|
+
/**
|
50
|
+
* Checks if this is a known meta type
|
51
|
+
*/
|
52
|
+
isKnownMetaType(metaType: string): boolean;
|
53
|
+
}
|
54
|
+
/**
|
55
|
+
* Singleton instance of the META commitment definition
|
56
|
+
*
|
57
|
+
* @private [πͺ] Maybe export the commitments through some package
|
58
|
+
*/
|
59
|
+
export declare const MetaCommitment: MetaCommitmentDefinition;
|
60
|
+
/**
|
61
|
+
* Note: [π] Ignore a discrepancy between file name and entity name
|
62
|
+
*/
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
3
|
+
/**
|
4
|
+
* SCENARIO commitment definition
|
5
|
+
*
|
6
|
+
* The SCENARIO commitment defines a specific situation or context in which the AI
|
7
|
+
* assistant should operate. It helps to set the scene for the AI's responses.
|
8
|
+
* Later scenarios are more important than earlier scenarios.
|
9
|
+
*
|
10
|
+
* Example usage in agent source:
|
11
|
+
*
|
12
|
+
* ```book
|
13
|
+
* SCENARIO You are in a customer service call center during peak hours
|
14
|
+
* SCENARIO The customer is frustrated and has been on hold for 20 minutes
|
15
|
+
* SCENARIO This is the customer's third call about the same issue
|
16
|
+
* ```
|
17
|
+
*
|
18
|
+
* @private [πͺ] Maybe export the commitments through some package
|
19
|
+
*/
|
20
|
+
export declare class ScenarioCommitmentDefinition extends BaseCommitmentDefinition<'SCENARIO'> {
|
21
|
+
constructor();
|
22
|
+
/**
|
23
|
+
* Short one-line description of SCENARIO.
|
24
|
+
*/
|
25
|
+
get description(): string;
|
26
|
+
/**
|
27
|
+
* Markdown documentation for SCENARIO commitment.
|
28
|
+
*/
|
29
|
+
get documentation(): string;
|
30
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
31
|
+
}
|
32
|
+
/**
|
33
|
+
* Singleton instance of the SCENARIO commitment definition
|
34
|
+
*
|
35
|
+
* @private [πͺ] Maybe export the commitments through some package
|
36
|
+
*/
|
37
|
+
export declare const ScenarioCommitment: ScenarioCommitmentDefinition;
|
38
|
+
/**
|
39
|
+
* Note: [π] Ignore a discrepancy between file name and entity name
|
40
|
+
*/
|
@@ -1,15 +1,19 @@
|
|
1
1
|
import type { BookCommitment } from './_base/BookCommitment';
|
2
2
|
import type { CommitmentDefinition } from './_base/CommitmentDefinition';
|
3
3
|
import { ActionCommitmentDefinition } from './ACTION/ACTION';
|
4
|
+
import { DeleteCommitmentDefinition } from './DELETE/DELETE';
|
4
5
|
import { FormatCommitmentDefinition } from './FORMAT/FORMAT';
|
6
|
+
import { GoalCommitmentDefinition } from './GOAL/GOAL';
|
5
7
|
import { KnowledgeCommitmentDefinition } from './KNOWLEDGE/KNOWLEDGE';
|
6
|
-
import {
|
7
|
-
import {
|
8
|
+
import { MemoryCommitmentDefinition } from './MEMORY/MEMORY';
|
9
|
+
import { MessageCommitmentDefinition } from './MESSAGE/MESSAGE';
|
10
|
+
import { MetaCommitmentDefinition } from './META/META';
|
8
11
|
import { ModelCommitmentDefinition } from './MODEL/MODEL';
|
9
12
|
import { NoteCommitmentDefinition } from './NOTE/NOTE';
|
10
13
|
import { PersonaCommitmentDefinition } from './PERSONA/PERSONA';
|
11
14
|
import { RuleCommitmentDefinition } from './RULE/RULE';
|
12
15
|
import { SampleCommitmentDefinition } from './SAMPLE/SAMPLE';
|
16
|
+
import { ScenarioCommitmentDefinition } from './SCENARIO/SCENARIO';
|
13
17
|
import { StyleCommitmentDefinition } from './STYLE/STYLE';
|
14
18
|
import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplementedCommitmentDefinition';
|
15
19
|
/**
|
@@ -19,7 +23,7 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
|
|
19
23
|
*
|
20
24
|
* @private Use functions to access commitments instead of this array directly
|
21
25
|
*/
|
22
|
-
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition,
|
26
|
+
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"SCENARIOS">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"GOALS">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
23
27
|
/**
|
24
28
|
* Gets a commitment definition by its type
|
25
29
|
* @param type The commitment type to look up
|
@@ -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;
|
@@ -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 />`
|
@@ -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-
|
18
|
+
* It follows semantic versioning (e.g., `0.101.0-6`).
|
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.101.0-7",
|
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.101.0-7"
|
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.101.0-7';
|
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
|