@promptbook/fake-llm 0.105.0-20 → 0.105.0-23
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 +121 -4731
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/browser.index.d.ts +2 -0
- package/esm/typings/src/_packages/components.index.d.ts +20 -0
- package/esm/typings/src/_packages/core.index.d.ts +9 -13
- package/esm/typings/src/_packages/node.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +24 -2
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/AgentChip/AgentChip.d.ts +67 -0
- package/esm/typings/src/book-components/Chat/AgentChip/index.d.ts +2 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatMessageItem.d.ts +15 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +68 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatSoundToggle.d.ts +23 -0
- package/esm/typings/src/book-components/Chat/LlmChat/FriendlyErrorMessage.d.ts +20 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +8 -0
- package/esm/typings/src/book-components/Chat/SourceChip/SourceChip.d.ts +35 -0
- package/esm/typings/src/book-components/Chat/SourceChip/index.d.ts +2 -0
- package/esm/typings/src/book-components/Chat/effects/ChatEffectsSystem.d.ts +14 -0
- package/esm/typings/src/book-components/Chat/effects/components/ConfettiEffect.d.ts +18 -0
- package/esm/typings/src/book-components/Chat/effects/components/HeartsEffect.d.ts +18 -0
- package/esm/typings/src/book-components/Chat/effects/configs/defaultEffectConfigs.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/effects/index.d.ts +18 -0
- package/esm/typings/src/book-components/Chat/effects/types/ChatEffect.d.ts +20 -0
- package/esm/typings/src/book-components/Chat/effects/types/ChatEffectConfig.d.ts +21 -0
- package/esm/typings/src/book-components/Chat/effects/types/ChatEffectType.d.ts +6 -0
- package/esm/typings/src/book-components/Chat/effects/types/ChatEffectsSystemProps.d.ts +32 -0
- package/esm/typings/src/book-components/Chat/effects/utils/detectEffects.d.ts +12 -0
- package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +21 -0
- package/esm/typings/src/book-components/Chat/utils/getToolCallChipletText.d.ts +21 -0
- package/esm/typings/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +53 -0
- package/esm/typings/src/commitments/TEMPLATE/TEMPLATE.d.ts +44 -0
- package/esm/typings/src/commitments/TEMPLATE/TEMPLATE.test.d.ts +1 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +16 -2
- package/esm/typings/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +22 -0
- package/esm/typings/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +13 -0
- package/esm/typings/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +47 -0
- package/esm/typings/src/commitments/_common/getAllCommitmentDefinitions.d.ts +8 -0
- package/esm/typings/src/commitments/_common/getAllCommitmentTypes.d.ts +8 -0
- package/esm/typings/src/commitments/_common/getAllCommitmentsToolFunctionsForBrowser.d.ts +10 -0
- package/esm/typings/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +14 -0
- package/esm/typings/src/commitments/_common/getAllCommitmentsToolTitles.d.ts +7 -0
- package/esm/typings/src/commitments/_common/getCommitmentDefinition.d.ts +10 -0
- package/esm/typings/src/commitments/_common/getGroupedCommitmentDefinitions.d.ts +17 -0
- package/esm/typings/src/commitments/_common/isCommitmentSupported.d.ts +9 -0
- package/esm/typings/src/commitments/index.d.ts +3 -64
- package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -0
- package/esm/typings/src/execution/utils/$provideExecutionToolsForNode.d.ts +1 -0
- package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +1 -0
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -0
- package/esm/typings/src/scrapers/_common/register/$provideScriptingForNode.d.ts +1 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/esm/typings/src/wizard/wizard.d.ts +1 -4
- package/package.json +2 -4
- package/umd/index.umd.js +123 -4734
- package/umd/index.umd.js.map +1 -1
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import type { ToolCall } from '../../../types/ToolCall';
|
|
2
|
+
import type { AgentChipData } from '../AgentChip';
|
|
2
3
|
/**
|
|
3
4
|
* Utility to format tool call information for user-friendly display.
|
|
4
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* Tool call chiplet information including agent data for team tools
|
|
8
|
+
*/
|
|
9
|
+
export type ToolCallChipletInfo = {
|
|
10
|
+
/**
|
|
11
|
+
* Display text for the chiplet
|
|
12
|
+
*/
|
|
13
|
+
text: string;
|
|
14
|
+
/**
|
|
15
|
+
* Agent data for team tools (if applicable)
|
|
16
|
+
*/
|
|
17
|
+
agentData?: AgentChipData;
|
|
18
|
+
};
|
|
5
19
|
/**
|
|
6
20
|
* Technical to user-friendly tool names and emojis
|
|
7
21
|
*
|
|
@@ -14,6 +28,13 @@ export declare const TOOL_TITLES: Record<string, {
|
|
|
14
28
|
/**
|
|
15
29
|
* Gets the user-friendly text for a tool call chiplet.
|
|
16
30
|
*
|
|
31
|
+
* @deprecated Use getToolCallChipletInfo instead which returns both text and agent data
|
|
17
32
|
* @private [🧠] Maybe public?
|
|
18
33
|
*/
|
|
19
34
|
export declare function getToolCallChipletText(toolCall: ToolCall): string;
|
|
35
|
+
/**
|
|
36
|
+
* Gets the chiplet information including text and agent data (for team tools).
|
|
37
|
+
*
|
|
38
|
+
* @private [🧠] Maybe public?
|
|
39
|
+
*/
|
|
40
|
+
export declare function getToolCallChipletInfo(toolCall: ToolCall): ToolCallChipletInfo;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ChatMessage } from '../types/ChatMessage';
|
|
2
|
+
/**
|
|
3
|
+
* Type representing a parsed citation from RAG sources
|
|
4
|
+
*/
|
|
5
|
+
export type ParsedCitation = {
|
|
6
|
+
/**
|
|
7
|
+
* The unique identifier for the citation (e.g., "5:13")
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* The source document name (e.g., "document.pdf")
|
|
12
|
+
*/
|
|
13
|
+
source: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional URL to the source document
|
|
16
|
+
*/
|
|
17
|
+
url?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional preview/excerpt from the source
|
|
20
|
+
*/
|
|
21
|
+
excerpt?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Parses OpenAI Assistant-style citations from message content
|
|
25
|
+
* Matches patterns like: 【5:13†document.pdf】
|
|
26
|
+
*
|
|
27
|
+
* @param content - The markdown content that may contain citations
|
|
28
|
+
* @returns Array of parsed citations
|
|
29
|
+
*
|
|
30
|
+
* @private utility for internal use
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseCitationsFromContent(content: string): ParsedCitation[];
|
|
33
|
+
/**
|
|
34
|
+
* Removes citation markers from content and returns clean text
|
|
35
|
+
*
|
|
36
|
+
* @param content - The markdown content with citations
|
|
37
|
+
* @returns Content with citation markers removed
|
|
38
|
+
*
|
|
39
|
+
* @private utility for internal use
|
|
40
|
+
*/
|
|
41
|
+
export declare function stripCitationsFromContent(content: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Extracts citations from a chat message if not already present
|
|
44
|
+
*
|
|
45
|
+
* @param message - The chat message to extract citations from
|
|
46
|
+
* @returns The message with citations array populated
|
|
47
|
+
*
|
|
48
|
+
* @private utility for internal use
|
|
49
|
+
*/
|
|
50
|
+
export declare function extractCitationsFromMessage(message: ChatMessage): ChatMessage;
|
|
51
|
+
/**
|
|
52
|
+
* TODO: Maybe spread into multiple files
|
|
53
|
+
*/
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* TEMPLATE commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The TEMPLATE commitment enforces a specific response structure or template
|
|
7
|
+
* that the agent must follow when generating responses. This helps ensure
|
|
8
|
+
* consistent message formatting across all agent interactions.
|
|
9
|
+
*
|
|
10
|
+
* Example usage in agent source:
|
|
11
|
+
*
|
|
12
|
+
* ```book
|
|
13
|
+
* TEMPLATE Always structure your response with: 1) Summary, 2) Details, 3) Next steps
|
|
14
|
+
* TEMPLATE Use the following format: **Question:** [user question] | **Answer:** [your answer]
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* When used without content, it enables template mode which instructs the agent
|
|
18
|
+
* to follow any template patterns defined in other commitments or context.
|
|
19
|
+
*
|
|
20
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
21
|
+
*/
|
|
22
|
+
export declare class TemplateCommitmentDefinition extends BaseCommitmentDefinition<'TEMPLATE' | 'TEMPLATES'> {
|
|
23
|
+
constructor(type?: 'TEMPLATE' | 'TEMPLATES');
|
|
24
|
+
/**
|
|
25
|
+
* Short one-line description of TEMPLATE.
|
|
26
|
+
*/
|
|
27
|
+
get description(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Icon for this commitment.
|
|
30
|
+
*/
|
|
31
|
+
get icon(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Markdown documentation for TEMPLATE commitment.
|
|
34
|
+
*/
|
|
35
|
+
get documentation(): string;
|
|
36
|
+
/**
|
|
37
|
+
* TEMPLATE can be used with or without content.
|
|
38
|
+
*/
|
|
39
|
+
get requiresContent(): boolean;
|
|
40
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
44
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
import { string_javascript_name } from '../../_packages/types.index';
|
|
1
2
|
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
3
|
+
import { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
2
4
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
5
|
/**
|
|
4
6
|
* USE BROWSER commitment definition
|
|
5
7
|
*
|
|
6
|
-
* The `USE BROWSER` commitment indicates that the agent should utilize
|
|
8
|
+
* The `USE BROWSER` commitment indicates that the agent should utilize browser tools
|
|
7
9
|
* to access and retrieve up-to-date information from the internet when necessary.
|
|
8
10
|
*
|
|
11
|
+
* This commitment provides two levels of browser access:
|
|
12
|
+
* 1. One-shot URL fetching: Simple function to fetch and scrape URL content
|
|
13
|
+
* 2. Running browser: For complex tasks like scrolling, clicking, etc. (prepared but not active yet)
|
|
14
|
+
*
|
|
9
15
|
* The content following `USE BROWSER` is ignored (similar to NOTE).
|
|
10
16
|
*
|
|
11
17
|
* Example usage in agent source:
|
|
@@ -38,8 +44,16 @@ export declare class UseBrowserCommitmentDefinition extends BaseCommitmentDefini
|
|
|
38
44
|
/**
|
|
39
45
|
* Gets human-readable titles for tool functions provided by this commitment.
|
|
40
46
|
*/
|
|
41
|
-
getToolTitles(): Record<
|
|
47
|
+
getToolTitles(): Record<string_javascript_name, string>;
|
|
42
48
|
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
49
|
+
/**
|
|
50
|
+
* Gets the browser tool function implementations.
|
|
51
|
+
*
|
|
52
|
+
* This method automatically detects the environment and uses:
|
|
53
|
+
* - Server-side: Direct scraping via fetchUrlContent (Node.js)
|
|
54
|
+
* - Browser: Proxy through Agents Server API via fetchUrlContentViaBrowser
|
|
55
|
+
*/
|
|
56
|
+
getToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
43
57
|
}
|
|
44
58
|
/**
|
|
45
59
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetches and scrapes content from a URL (SERVER-SIDE ONLY)
|
|
3
|
+
*
|
|
4
|
+
* This function:
|
|
5
|
+
* 1. Fetches the URL content using promptbookFetch
|
|
6
|
+
* 2. Determines the content type (HTML, PDF, etc.)
|
|
7
|
+
* 3. Uses the appropriate scraper to convert to markdown
|
|
8
|
+
* 4. Returns the scraped markdown content
|
|
9
|
+
*
|
|
10
|
+
* @param url The URL to fetch and scrape
|
|
11
|
+
* @returns Markdown content from the URL
|
|
12
|
+
*
|
|
13
|
+
* @private internal utility for USE BROWSER commitment
|
|
14
|
+
*
|
|
15
|
+
* WARNING: This function should NOT be used directly in browser environments.
|
|
16
|
+
* For browser environments, use fetchUrlContentViaBrowser which proxies through
|
|
17
|
+
* the Agents Server API endpoint at /api/scrape
|
|
18
|
+
*/
|
|
19
|
+
export declare function fetchUrlContent(url: string): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
22
|
+
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side safe wrapper for fetching URL content
|
|
3
|
+
*
|
|
4
|
+
* This function proxies requests to the Agents Server API endpoint for scraping,
|
|
5
|
+
* making it safe to use in browser environments.
|
|
6
|
+
*
|
|
7
|
+
* @param url The URL to fetch and scrape
|
|
8
|
+
* @param agentsServerUrl The base URL of the agents server (defaults to current origin)
|
|
9
|
+
* @returns Markdown content from the URL
|
|
10
|
+
*
|
|
11
|
+
* @private internal utility for USE BROWSER commitment
|
|
12
|
+
*/
|
|
13
|
+
export declare function fetchUrlContentViaBrowser(url: string, agentsServerUrl?: string): Promise<string>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { string_javascript_name } from '../../_packages/types.index';
|
|
2
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
3
|
+
import { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
4
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
5
|
+
/**
|
|
6
|
+
* USE EMAIL commitment definition
|
|
7
|
+
*
|
|
8
|
+
* The `USE EMAIL` commitment enables the agent to send emails.
|
|
9
|
+
*
|
|
10
|
+
* Example usage in agent source:
|
|
11
|
+
*
|
|
12
|
+
* ```book
|
|
13
|
+
* USE EMAIL
|
|
14
|
+
* USE EMAIL Write always formal and polite emails, always greet.
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
18
|
+
*/
|
|
19
|
+
export declare class UseEmailCommitmentDefinition extends BaseCommitmentDefinition<'USE EMAIL'> {
|
|
20
|
+
constructor();
|
|
21
|
+
get requiresContent(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Short one-line description of USE EMAIL.
|
|
24
|
+
*/
|
|
25
|
+
get description(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Icon for this commitment.
|
|
28
|
+
*/
|
|
29
|
+
get icon(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Markdown documentation for USE EMAIL commitment.
|
|
32
|
+
*/
|
|
33
|
+
get documentation(): string;
|
|
34
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
35
|
+
/**
|
|
36
|
+
* Gets human-readable titles for tool functions provided by this commitment.
|
|
37
|
+
*/
|
|
38
|
+
getToolTitles(): Record<string_javascript_name, string>;
|
|
39
|
+
/**
|
|
40
|
+
* Gets the `send_email` tool function implementation.
|
|
41
|
+
* Note: This is a placeholder - the actual implementation is provided by the agent server.
|
|
42
|
+
*/
|
|
43
|
+
getToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
47
|
+
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommitmentDefinition } from '../_base/CommitmentDefinition';
|
|
2
|
+
/**
|
|
3
|
+
* Gets all available commitment definitions
|
|
4
|
+
* @returns Array of all commitment definitions
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/core`
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAllCommitmentDefinitions(): ReadonlyArray<CommitmentDefinition>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BookCommitment } from '../_base/BookCommitment';
|
|
2
|
+
/**
|
|
3
|
+
* Gets all available commitment types
|
|
4
|
+
* @returns Array of all commitment types
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/core`
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAllCommitmentTypes(): ReadonlyArray<BookCommitment>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ToolFunction } from '../../_packages/types.index';
|
|
2
|
+
import { string_javascript_name } from '../../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Gets all function implementations provided by all commitments
|
|
5
|
+
*
|
|
6
|
+
* Note: This function is intended for browser use, there is also equivalent `getAllCommitmentsToolFunctionsForNode` for server use
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/browser`
|
|
9
|
+
*/
|
|
10
|
+
export declare function getAllCommitmentsToolFunctionsForBrowser(): Record<string_javascript_name, ToolFunction>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ToolFunction } from '../../_packages/types.index';
|
|
2
|
+
import { string_javascript_name } from '../../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Gets all function implementations provided by all commitments
|
|
5
|
+
*
|
|
6
|
+
* Note: This function is intended for server use, there is also equivalent `getAllCommitmentsToolFunctionsForBrowser` for browser use
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/node`
|
|
9
|
+
*/
|
|
10
|
+
export declare function getAllCommitmentsToolFunctionsForNode(): Record<string_javascript_name, ToolFunction>;
|
|
11
|
+
/**
|
|
12
|
+
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
13
|
+
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
14
|
+
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { string_javascript_name } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Gets all tool titles provided by all commitments
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
6
|
+
*/
|
|
7
|
+
export declare function getAllCommitmentsToolTitles(): Record<string_javascript_name, string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BookCommitment } from '../_base/BookCommitment';
|
|
2
|
+
import type { CommitmentDefinition } from '../_base/CommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* Gets a commitment definition by its type
|
|
5
|
+
* @param type The commitment type to look up
|
|
6
|
+
* @returns The commitment definition or null if not found
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/core`
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCommitmentDefinition(type: BookCommitment): CommitmentDefinition | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CommitmentDefinition } from '../_base/CommitmentDefinition';
|
|
2
|
+
/**
|
|
3
|
+
* Grouped commitment definition
|
|
4
|
+
*/
|
|
5
|
+
type GroupedCommitmentDefinition = {
|
|
6
|
+
primary: CommitmentDefinition;
|
|
7
|
+
aliases: string[];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Gets all commitment definitions grouped by their aliases
|
|
11
|
+
*
|
|
12
|
+
* @returns Array of grouped commitment definitions
|
|
13
|
+
*
|
|
14
|
+
* @public exported from `@promptbook/core`
|
|
15
|
+
*/
|
|
16
|
+
export declare function getGroupedCommitmentDefinitions(): ReadonlyArray<GroupedCommitmentDefinition>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BookCommitment } from '../_base/BookCommitment';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a commitment type is supported
|
|
4
|
+
* @param type The commitment type to check
|
|
5
|
+
* @returns True if the commitment type is supported
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/core`
|
|
8
|
+
*/
|
|
9
|
+
export declare function isCommitmentSupported(type: BookCommitment): boolean;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { BookCommitment } from './_base/BookCommitment';
|
|
2
|
-
import type { CommitmentDefinition } from './_base/CommitmentDefinition';
|
|
3
|
-
import { ToolFunction } from '../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
4
|
-
import { string_javascript_name } from '../types/typeAliases';
|
|
5
1
|
import { ActionCommitmentDefinition } from './ACTION/ACTION';
|
|
6
2
|
import { ClosedCommitmentDefinition } from './CLOSED/CLOSED';
|
|
7
3
|
import { ComponentCommitmentDefinition } from './COMPONENT/COMPONENT';
|
|
@@ -32,8 +28,10 @@ import { SampleCommitmentDefinition } from './SAMPLE/SAMPLE';
|
|
|
32
28
|
import { ScenarioCommitmentDefinition } from './SCENARIO/SCENARIO';
|
|
33
29
|
import { StyleCommitmentDefinition } from './STYLE/STYLE';
|
|
34
30
|
import { TeamCommitmentDefinition } from './TEAM/TEAM';
|
|
31
|
+
import { TemplateCommitmentDefinition } from './TEMPLATE/TEMPLATE';
|
|
35
32
|
import { UseCommitmentDefinition } from './USE/USE';
|
|
36
33
|
import { UseBrowserCommitmentDefinition } from './USE_BROWSER/USE_BROWSER';
|
|
34
|
+
import { UseEmailCommitmentDefinition } from './USE_EMAIL/USE_EMAIL';
|
|
37
35
|
import { UseImageGeneratorCommitmentDefinition } from './USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR';
|
|
38
36
|
import { UseMcpCommitmentDefinition } from './USE_MCP/USE_MCP';
|
|
39
37
|
import { UseSearchEngineCommitmentDefinition } from './USE_SEARCH_ENGINE/USE_SEARCH_ENGINE';
|
|
@@ -46,66 +44,7 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
|
|
|
46
44
|
*
|
|
47
45
|
* @private Use functions to access commitments instead of this array directly
|
|
48
46
|
*/
|
|
49
|
-
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseTimeCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
50
|
-
/**
|
|
51
|
-
* Gets a commitment definition by its type
|
|
52
|
-
* @param type The commitment type to look up
|
|
53
|
-
* @returns The commitment definition or null if not found
|
|
54
|
-
*
|
|
55
|
-
* @public exported from `@promptbook/core`
|
|
56
|
-
*/
|
|
57
|
-
export declare function getCommitmentDefinition(type: BookCommitment): CommitmentDefinition | null;
|
|
58
|
-
/**
|
|
59
|
-
* Gets all available commitment definitions
|
|
60
|
-
* @returns Array of all commitment definitions
|
|
61
|
-
*
|
|
62
|
-
* @public exported from `@promptbook/core`
|
|
63
|
-
*/
|
|
64
|
-
export declare function getAllCommitmentDefinitions(): ReadonlyArray<CommitmentDefinition>;
|
|
65
|
-
/**
|
|
66
|
-
* Gets all available commitment types
|
|
67
|
-
* @returns Array of all commitment types
|
|
68
|
-
*
|
|
69
|
-
* @public exported from `@promptbook/core`
|
|
70
|
-
*/
|
|
71
|
-
export declare function getAllCommitmentTypes(): ReadonlyArray<BookCommitment>;
|
|
72
|
-
/**
|
|
73
|
-
* Checks if a commitment type is supported
|
|
74
|
-
* @param type The commitment type to check
|
|
75
|
-
* @returns True if the commitment type is supported
|
|
76
|
-
*
|
|
77
|
-
* @public exported from `@promptbook/core`
|
|
78
|
-
*/
|
|
79
|
-
export declare function isCommitmentSupported(type: BookCommitment): boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Grouped commitment definition
|
|
82
|
-
*
|
|
83
|
-
* @public exported from `@promptbook/core`
|
|
84
|
-
*/
|
|
85
|
-
export type GroupedCommitmentDefinition = {
|
|
86
|
-
primary: CommitmentDefinition;
|
|
87
|
-
aliases: string[];
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* Gets all commitment definitions grouped by their aliases
|
|
91
|
-
*
|
|
92
|
-
* @returns Array of grouped commitment definitions
|
|
93
|
-
*
|
|
94
|
-
* @public exported from `@promptbook/core`
|
|
95
|
-
*/
|
|
96
|
-
export declare function getGroupedCommitmentDefinitions(): ReadonlyArray<GroupedCommitmentDefinition>;
|
|
97
|
-
/**
|
|
98
|
-
* Gets all function implementations provided by all commitments
|
|
99
|
-
*
|
|
100
|
-
* @public exported from `@promptbook/core`
|
|
101
|
-
*/
|
|
102
|
-
export declare function getAllCommitmentsToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
103
|
-
/**
|
|
104
|
-
* Gets all tool titles provided by all commitments
|
|
105
|
-
*
|
|
106
|
-
* @public exported from `@promptbook/core`
|
|
107
|
-
*/
|
|
108
|
-
export declare function getAllCommitmentsToolTitles(): Record<string_javascript_name, string>;
|
|
47
|
+
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, TemplateCommitmentDefinition, TemplateCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseTimeCommitmentDefinition, UseEmailCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
109
48
|
/**
|
|
110
49
|
* TODO: [🧠] Maybe create through standardized $register
|
|
111
50
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -9,4 +9,5 @@ export declare function $provideExecutablesForNode(options?: PrepareAndScrapeOpt
|
|
|
9
9
|
/**
|
|
10
10
|
* TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
|
|
11
11
|
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
12
|
+
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
12
13
|
*/
|
|
@@ -10,4 +10,5 @@ import type { ExecutionTools } from '../ExecutionTools';
|
|
|
10
10
|
export declare function $provideExecutionToolsForNode(options?: PrepareAndScrapeOptions): Promise<ExecutionTools>;
|
|
11
11
|
/**
|
|
12
12
|
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
13
|
+
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
13
14
|
*/
|
|
@@ -9,4 +9,5 @@ import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeO
|
|
|
9
9
|
export declare function $provideFilesystemForNode(options?: Pick<PrepareAndScrapeOptions, 'isVerbose'>): FilesystemTools;
|
|
10
10
|
/**
|
|
11
11
|
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
12
|
+
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
12
13
|
*/
|
|
@@ -10,4 +10,5 @@ import type { Scraper } from '../Scraper';
|
|
|
10
10
|
export declare function $provideScrapersForNode(tools: Pick<ExecutionTools, 'fs' | 'llm' | 'executables'>, options?: PrepareAndScrapeOptions): Promise<ReadonlyArray<Scraper>>;
|
|
11
11
|
/**
|
|
12
12
|
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
13
|
+
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
13
14
|
*/
|
|
@@ -8,4 +8,5 @@ import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeO
|
|
|
8
8
|
export declare function $provideScriptingForNode(options?: PrepareAndScrapeOptions): Promise<ReadonlyArray<ScriptExecutionTools>>;
|
|
9
9
|
/**
|
|
10
10
|
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
11
|
+
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
11
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.105.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.105.0-22`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
|
@@ -2,10 +2,7 @@ import type { ExecutionTools } from '../execution/ExecutionTools';
|
|
|
2
2
|
import type { PipelineExecutorResult } from '../execution/PipelineExecutorResult';
|
|
3
3
|
import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
|
|
4
4
|
import type { PipelineString } from '../pipeline/PipelineString';
|
|
5
|
-
import type { InputParameters } from '../types/typeAliases';
|
|
6
|
-
import type { string_filename } from '../types/typeAliases';
|
|
7
|
-
import type { string_parameter_value } from '../types/typeAliases';
|
|
8
|
-
import type { string_pipeline_url } from '../types/typeAliases';
|
|
5
|
+
import type { InputParameters, string_filename, string_parameter_value, string_pipeline_url } from '../types/typeAliases';
|
|
9
6
|
/**
|
|
10
7
|
* Options for wizard methods
|
|
11
8
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/fake-llm",
|
|
3
|
-
"version": "0.105.0-
|
|
3
|
+
"version": "0.105.0-23",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -96,13 +96,11 @@
|
|
|
96
96
|
"module": "./esm/index.es.js",
|
|
97
97
|
"typings": "./esm/typings/src/_packages/fake-llm.index.d.ts",
|
|
98
98
|
"peerDependencies": {
|
|
99
|
-
"@promptbook/core": "0.105.0-
|
|
99
|
+
"@promptbook/core": "0.105.0-23"
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
102
|
"crypto": "1.0.1",
|
|
103
|
-
"crypto-js": "4.2.0",
|
|
104
103
|
"lorem-ipsum": "2.0.8",
|
|
105
|
-
"moment": "2.30.1",
|
|
106
104
|
"spacetrim": "0.11.60",
|
|
107
105
|
"waitasecond": "1.11.160"
|
|
108
106
|
}
|