@promptbook/legacy-documents 0.105.0-8 → 0.105.0
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/README.md +0 -4
- package/esm/index.es.js +13 -13
- 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 +21 -11
- package/esm/typings/src/_packages/node.index.d.ts +2 -0
- package/esm/typings/src/_packages/openai.index.d.ts +4 -0
- package/esm/typings/src/_packages/types.index.d.ts +32 -2
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +10 -1
- package/esm/typings/src/book-2.0/agent-source/parseTeamCommitment.d.ts +28 -0
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +5 -0
- 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 +33 -1
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +87 -6
- package/esm/typings/src/book-components/Chat/Chat/ChatSoundToggle.d.ts +23 -0
- package/esm/typings/src/book-components/Chat/Chat/ClockIcon.d.ts +9 -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 +13 -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 +34 -6
- package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +8 -0
- package/esm/typings/src/book-components/Chat/utils/createTeamToolNameFromUrl.d.ts +12 -0
- package/esm/typings/src/book-components/Chat/utils/getToolCallChipletText.d.ts +40 -0
- package/esm/typings/src/book-components/Chat/utils/loadAgentProfile.d.ts +69 -0
- package/esm/typings/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +53 -0
- package/esm/typings/src/book-components/Chat/utils/resolveCitationUrl.d.ts +11 -0
- package/esm/typings/src/book-components/Chat/utils/resolveCitationUrl.test.d.ts +1 -0
- package/esm/typings/src/book-components/Chat/utils/toolCallParsing.d.ts +64 -0
- package/esm/typings/src/book-components/icons/EmailIcon.d.ts +15 -0
- package/esm/typings/src/commitments/TEAM/TEAM.d.ts +45 -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 +19 -1
- 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 +48 -0
- package/esm/typings/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +11 -0
- package/esm/typings/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +18 -0
- package/esm/typings/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +46 -0
- package/esm/typings/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.test.d.ts +1 -0
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +5 -0
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts +1 -0
- package/esm/typings/src/commitments/USE_TIME/USE_TIME.d.ts +6 -0
- package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +6 -0
- package/esm/typings/src/commitments/_base/CommitmentDefinition.d.ts +6 -0
- package/esm/typings/src/commitments/_base/formatOptionalInstructionBlock.d.ts +6 -0
- package/esm/typings/src/commitments/_common/commitmentToolFunctions.d.ts +26 -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 +9 -0
- package/esm/typings/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +13 -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 +5 -58
- package/esm/typings/src/config.d.ts +6 -0
- package/esm/typings/src/constants.d.ts +129 -0
- package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -0
- package/esm/typings/src/execution/AvailableModel.d.ts +5 -4
- package/esm/typings/src/execution/PromptResult.d.ts +2 -19
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +1 -1
- package/esm/typings/src/execution/utils/$provideExecutionToolsForNode.d.ts +1 -0
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +15 -1
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +6 -1
- package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +5 -0
- package/esm/typings/src/llm-providers/google/createGoogleExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/openai/OpenAiAgentExecutionTools.d.ts +43 -0
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +4 -2
- package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/createOpenAiAgentExecutionTools.d.ts +11 -0
- package/esm/typings/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +7 -0
- package/esm/typings/src/pipeline/prompt-notation.d.ts +27 -2
- package/esm/typings/src/pipeline/prompt-notation.test.d.ts +1 -1
- 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/search-engines/SearchEngine.d.ts +1 -1
- package/esm/typings/src/search-engines/bing/BingSearchEngine.d.ts +1 -1
- package/esm/typings/src/search-engines/dummy/DummySearchEngine.d.ts +1 -1
- package/esm/typings/src/search-engines/google/GoogleSearchEngine.d.ts +1 -1
- package/esm/typings/src/search-engines/serp/SerpSearchEngine.d.ts +1 -1
- package/esm/typings/src/speech-recognition/OpenAiSpeechRecognition.d.ts +3 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +6 -0
- package/esm/typings/src/types/Prompt.d.ts +12 -0
- package/esm/typings/src/types/ToolCall.d.ts +37 -0
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -2
- package/esm/typings/src/utils/markdown/humanizeAiTextEllipsis.d.ts +1 -1
- package/esm/typings/src/utils/markdown/humanizeAiTextEmdashed.d.ts +1 -1
- package/esm/typings/src/utils/markdown/humanizeAiTextWhitespace.d.ts +1 -1
- package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +1 -3
- package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +1 -2
- package/esm/typings/src/utils/misc/linguisticHash.d.ts +4 -1
- package/esm/typings/src/utils/parameters/templateParameters.d.ts +1 -2
- package/esm/typings/src/version.d.ts +1 -1
- package/esm/typings/src/wizard/wizard.d.ts +1 -4
- package/package.json +2 -2
- package/umd/index.umd.js +13 -13
- package/umd/index.umd.js.map +1 -1
|
@@ -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:
|
|
@@ -35,7 +41,19 @@ export declare class UseBrowserCommitmentDefinition extends BaseCommitmentDefini
|
|
|
35
41
|
* Markdown documentation for USE BROWSER commitment.
|
|
36
42
|
*/
|
|
37
43
|
get documentation(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Gets human-readable titles for tool functions provided by this commitment.
|
|
46
|
+
*/
|
|
47
|
+
getToolTitles(): Record<string_javascript_name, string>;
|
|
38
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>;
|
|
39
57
|
}
|
|
40
58
|
/**
|
|
41
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,48 @@
|
|
|
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
|
+
*
|
|
42
|
+
* Note: [??] This function has implementation both for browser and node, this is the proxied one for browser.
|
|
43
|
+
*/
|
|
44
|
+
getToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
48
|
+
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ToolFunction } from '../../_packages/types.index';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the server-side implementation of the send_email tool for Node.js environments.
|
|
4
|
+
*
|
|
5
|
+
* This uses a lazy require so the core package can still load even if the Agents Server
|
|
6
|
+
* module is unavailable. When the server tool cannot be resolved, a fallback implementation
|
|
7
|
+
* throws a helpful error message.
|
|
8
|
+
*
|
|
9
|
+
* @private internal utility for USE EMAIL commitment
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveSendEmailToolForNode(): ToolFunction;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side safe wrapper for sending emails.
|
|
3
|
+
*
|
|
4
|
+
* This function proxies requests to the Agents Server API endpoint for email queuing,
|
|
5
|
+
* making it safe to use in browser environments.
|
|
6
|
+
*
|
|
7
|
+
* @param args Email payload containing recipients, subject, and body
|
|
8
|
+
* @param agentsServerUrl The base URL of the agents server (defaults to current origin)
|
|
9
|
+
* @returns Result string from the server-side send_email tool
|
|
10
|
+
*
|
|
11
|
+
* @private internal utility for USE EMAIL commitment
|
|
12
|
+
*/
|
|
13
|
+
export declare function sendEmailViaBrowser(args: {
|
|
14
|
+
to: string[];
|
|
15
|
+
cc?: string[];
|
|
16
|
+
subject: string;
|
|
17
|
+
body: string;
|
|
18
|
+
}, agentsServerUrl?: string): Promise<string>;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 IMAGE GENERATOR commitment definition
|
|
7
|
+
*
|
|
8
|
+
* The `USE IMAGE GENERATOR` commitment indicates that the agent should utilize an image generation tool
|
|
9
|
+
* to create images based on text prompts.
|
|
10
|
+
*
|
|
11
|
+
* Example usage in agent source:
|
|
12
|
+
*
|
|
13
|
+
* ```book
|
|
14
|
+
* USE IMAGE GENERATOR
|
|
15
|
+
* USE IMAGE GENERATOR Create realistic images of nature
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
19
|
+
*/
|
|
20
|
+
export declare class UseImageGeneratorCommitmentDefinition extends BaseCommitmentDefinition<'USE IMAGE GENERATOR' | 'USE IMAGE GENERATION' | 'IMAGE GENERATOR' | 'IMAGE GENERATION' | 'USE IMAGE'> {
|
|
21
|
+
constructor(type?: 'USE IMAGE GENERATOR' | 'USE IMAGE GENERATION' | 'IMAGE GENERATOR' | 'IMAGE GENERATION' | 'USE IMAGE');
|
|
22
|
+
/**
|
|
23
|
+
* Short one-line description of USE IMAGE GENERATOR.
|
|
24
|
+
*/
|
|
25
|
+
get description(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Icon for this commitment.
|
|
28
|
+
*/
|
|
29
|
+
get icon(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Markdown documentation for USE IMAGE GENERATOR 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 `generate_image` tool function implementation.
|
|
41
|
+
*/
|
|
42
|
+
getToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
46
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -21,6 +21,7 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
|
21
21
|
*/
|
|
22
22
|
export declare class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition<'USE SEARCH ENGINE'> {
|
|
23
23
|
constructor();
|
|
24
|
+
get requiresContent(): boolean;
|
|
24
25
|
/**
|
|
25
26
|
* Short one-line description of USE SEARCH ENGINE.
|
|
26
27
|
*/
|
|
@@ -34,6 +35,10 @@ export declare class UseSearchEngineCommitmentDefinition extends BaseCommitmentD
|
|
|
34
35
|
*/
|
|
35
36
|
get documentation(): string;
|
|
36
37
|
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
38
|
+
/**
|
|
39
|
+
* Gets human-readable titles for tool functions provided by this commitment.
|
|
40
|
+
*/
|
|
41
|
+
getToolTitles(): Record<string_javascript_name, string>;
|
|
37
42
|
/**
|
|
38
43
|
* Gets the `web_search` tool function implementation.
|
|
39
44
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,12 +11,14 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
|
11
11
|
*
|
|
12
12
|
* ```book
|
|
13
13
|
* USE TIME
|
|
14
|
+
* USE TIME Prefer the user's local timezone.
|
|
14
15
|
* ```
|
|
15
16
|
*
|
|
16
17
|
* @private [🪔] Maybe export the commitments through some package
|
|
17
18
|
*/
|
|
18
19
|
export declare class UseTimeCommitmentDefinition extends BaseCommitmentDefinition<'USE TIME'> {
|
|
19
20
|
constructor();
|
|
21
|
+
get requiresContent(): boolean;
|
|
20
22
|
/**
|
|
21
23
|
* Short one-line description of USE TIME.
|
|
22
24
|
*/
|
|
@@ -30,6 +32,10 @@ export declare class UseTimeCommitmentDefinition extends BaseCommitmentDefinitio
|
|
|
30
32
|
*/
|
|
31
33
|
get documentation(): string;
|
|
32
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>;
|
|
33
39
|
/**
|
|
34
40
|
* Gets the `get_current_time` tool function implementation.
|
|
35
41
|
*/
|
|
@@ -69,4 +69,10 @@ export declare abstract class BaseCommitmentDefinition<TBookCommitment extends s
|
|
|
69
69
|
* When the `applyToAgentModelRequirements` adds tools to the requirements, this method should return the corresponding function definitions.
|
|
70
70
|
*/
|
|
71
71
|
getToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
72
|
+
/**
|
|
73
|
+
* Gets human-readable titles for tool functions provided by this commitment
|
|
74
|
+
*
|
|
75
|
+
* This is used in the UI to show a user-friendly name instead of the technical function name.
|
|
76
|
+
*/
|
|
77
|
+
getToolTitles(): Record<string_javascript_name, string>;
|
|
72
78
|
}
|
|
@@ -58,4 +58,10 @@ export type CommitmentDefinition = {
|
|
|
58
58
|
* When the `applyToAgentModelRequirements` adds tools to the requirements, this method should return the corresponding function definitions.
|
|
59
59
|
*/
|
|
60
60
|
getToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
61
|
+
/**
|
|
62
|
+
* Gets human-readable titles for tool functions provided by this commitment
|
|
63
|
+
*
|
|
64
|
+
* This is used in the UI to show a user-friendly name instead of the technical function name.
|
|
65
|
+
*/
|
|
66
|
+
getToolTitles(): Record<string_javascript_name, string>;
|
|
61
67
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ToolFunction } from '../../_packages/types.index';
|
|
2
|
+
import { string_javascript_name } from '../../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Map of tool functions keyed by function name.
|
|
5
|
+
*
|
|
6
|
+
* @private internal helper for commitment tool registry
|
|
7
|
+
*/
|
|
8
|
+
export type CommitmentToolFunctions = Record<string_javascript_name, ToolFunction>;
|
|
9
|
+
/**
|
|
10
|
+
* Collects tool functions from all commitment definitions.
|
|
11
|
+
*
|
|
12
|
+
* @returns Map of tool function implementations.
|
|
13
|
+
* @private internal helper for commitment tool registry
|
|
14
|
+
*/
|
|
15
|
+
export declare function collectCommitmentToolFunctions(): CommitmentToolFunctions;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a proxy that resolves tool functions on demand.
|
|
18
|
+
*
|
|
19
|
+
* @param getFunctions - Provider of current tool functions.
|
|
20
|
+
* @returns Proxy exposing tool functions as properties.
|
|
21
|
+
* @private internal helper for commitment tool registry
|
|
22
|
+
*/
|
|
23
|
+
export declare function createToolFunctionsProxy(getFunctions: () => CommitmentToolFunctions): CommitmentToolFunctions;
|
|
24
|
+
/**
|
|
25
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
26
|
+
*/
|
|
@@ -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,9 @@
|
|
|
1
|
+
import type { CommitmentToolFunctions } from './commitmentToolFunctions';
|
|
2
|
+
/**
|
|
3
|
+
* Gets all function implementations provided by all commitments
|
|
4
|
+
*
|
|
5
|
+
* Note: This function is intended for browser use, there is also equivalent `getAllCommitmentsToolFunctionsForNode` for server use
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/browser`
|
|
8
|
+
*/
|
|
9
|
+
export declare function getAllCommitmentsToolFunctionsForBrowser(): CommitmentToolFunctions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CommitmentToolFunctions } from './commitmentToolFunctions';
|
|
2
|
+
/**
|
|
3
|
+
* Gets all function implementations provided by all commitments
|
|
4
|
+
*
|
|
5
|
+
* Note: This function is intended for server use, there is also equivalent `getAllCommitmentsToolFunctionsForBrowser` for browser use
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/node`
|
|
8
|
+
*/
|
|
9
|
+
export declare function getAllCommitmentsToolFunctionsForNode(): CommitmentToolFunctions;
|
|
10
|
+
/**
|
|
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
|
|
13
|
+
*/
|
|
@@ -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';
|
|
@@ -31,8 +27,12 @@ import { RuleCommitmentDefinition } from './RULE/RULE';
|
|
|
31
27
|
import { SampleCommitmentDefinition } from './SAMPLE/SAMPLE';
|
|
32
28
|
import { ScenarioCommitmentDefinition } from './SCENARIO/SCENARIO';
|
|
33
29
|
import { StyleCommitmentDefinition } from './STYLE/STYLE';
|
|
30
|
+
import { TeamCommitmentDefinition } from './TEAM/TEAM';
|
|
31
|
+
import { TemplateCommitmentDefinition } from './TEMPLATE/TEMPLATE';
|
|
34
32
|
import { UseCommitmentDefinition } from './USE/USE';
|
|
35
33
|
import { UseBrowserCommitmentDefinition } from './USE_BROWSER/USE_BROWSER';
|
|
34
|
+
import { UseEmailCommitmentDefinition } from './USE_EMAIL/USE_EMAIL';
|
|
35
|
+
import { UseImageGeneratorCommitmentDefinition } from './USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR';
|
|
36
36
|
import { UseMcpCommitmentDefinition } from './USE_MCP/USE_MCP';
|
|
37
37
|
import { UseSearchEngineCommitmentDefinition } from './USE_SEARCH_ENGINE/USE_SEARCH_ENGINE';
|
|
38
38
|
import { UseTimeCommitmentDefinition } from './USE_TIME/USE_TIME';
|
|
@@ -44,60 +44,7 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
|
|
|
44
44
|
*
|
|
45
45
|
* @private Use functions to access commitments instead of this array directly
|
|
46
46
|
*/
|
|
47
|
-
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, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseTimeCommitmentDefinition, UseMcpCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
48
|
-
/**
|
|
49
|
-
* Gets a commitment definition by its type
|
|
50
|
-
* @param type The commitment type to look up
|
|
51
|
-
* @returns The commitment definition or null if not found
|
|
52
|
-
*
|
|
53
|
-
* @public exported from `@promptbook/core`
|
|
54
|
-
*/
|
|
55
|
-
export declare function getCommitmentDefinition(type: BookCommitment): CommitmentDefinition | null;
|
|
56
|
-
/**
|
|
57
|
-
* Gets all available commitment definitions
|
|
58
|
-
* @returns Array of all commitment definitions
|
|
59
|
-
*
|
|
60
|
-
* @public exported from `@promptbook/core`
|
|
61
|
-
*/
|
|
62
|
-
export declare function getAllCommitmentDefinitions(): ReadonlyArray<CommitmentDefinition>;
|
|
63
|
-
/**
|
|
64
|
-
* Gets all available commitment types
|
|
65
|
-
* @returns Array of all commitment types
|
|
66
|
-
*
|
|
67
|
-
* @public exported from `@promptbook/core`
|
|
68
|
-
*/
|
|
69
|
-
export declare function getAllCommitmentTypes(): ReadonlyArray<BookCommitment>;
|
|
70
|
-
/**
|
|
71
|
-
* Checks if a commitment type is supported
|
|
72
|
-
* @param type The commitment type to check
|
|
73
|
-
* @returns True if the commitment type is supported
|
|
74
|
-
*
|
|
75
|
-
* @public exported from `@promptbook/core`
|
|
76
|
-
*/
|
|
77
|
-
export declare function isCommitmentSupported(type: BookCommitment): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Grouped commitment definition
|
|
80
|
-
*
|
|
81
|
-
* @public exported from `@promptbook/core`
|
|
82
|
-
*/
|
|
83
|
-
export type GroupedCommitmentDefinition = {
|
|
84
|
-
primary: CommitmentDefinition;
|
|
85
|
-
aliases: string[];
|
|
86
|
-
};
|
|
87
|
-
/**
|
|
88
|
-
* Gets all commitment definitions grouped by their aliases
|
|
89
|
-
*
|
|
90
|
-
* @returns Array of grouped commitment definitions
|
|
91
|
-
*
|
|
92
|
-
* @public exported from `@promptbook/core`
|
|
93
|
-
*/
|
|
94
|
-
export declare function getGroupedCommitmentDefinitions(): ReadonlyArray<GroupedCommitmentDefinition>;
|
|
95
|
-
/**
|
|
96
|
-
* Gets all function implementations provided by all commitments
|
|
97
|
-
*
|
|
98
|
-
* @public exported from `@promptbook/core`
|
|
99
|
-
*/
|
|
100
|
-
export declare function getAllCommitmentsToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
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">];
|
|
101
48
|
/**
|
|
102
49
|
* TODO: [🧠] Maybe create through standardized $register
|
|
103
50
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -214,6 +214,12 @@ export declare const DEFAULT_INTERMEDIATE_FILES_STRATEGY: IntermediateFilesStrat
|
|
|
214
214
|
* @public exported from `@promptbook/core`
|
|
215
215
|
*/
|
|
216
216
|
export declare const DEFAULT_MAX_PARALLEL_COUNT = 5;
|
|
217
|
+
/**
|
|
218
|
+
* The maximum number of concurrent uploads
|
|
219
|
+
*
|
|
220
|
+
* @public exported from `@promptbook/core`
|
|
221
|
+
*/
|
|
222
|
+
export declare const DEFAULT_MAX_CONCURRENT_UPLOADS = 5;
|
|
217
223
|
/**
|
|
218
224
|
* The maximum depth to which recursion can occur
|
|
219
225
|
*
|