@promptbook/utils 0.103.0-55 → 0.103.0-66
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 +80 -39
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +2 -2
- package/esm/typings/src/_packages/core.index.d.ts +6 -8
- package/esm/typings/src/_packages/types.index.d.ts +7 -1
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -1
- package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +3 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +6 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +5 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +52 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +14 -0
- package/esm/typings/src/book-components/icons/SendIcon.d.ts +3 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.d.ts +4 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.test.d.ts +4 -0
- package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +6 -0
- package/esm/typings/src/commitments/META_FONT/META_FONT.d.ts +42 -0
- package/esm/typings/src/commitments/USE/USE.d.ts +53 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +42 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts +1 -0
- package/esm/typings/src/commitments/{IMPORTANT/IMPORTANT.d.ts → USE_MCP/USE_MCP.d.ts} +16 -5
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +38 -0
- package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +6 -0
- package/esm/typings/src/commitments/index.d.ts +93 -1
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +3 -1
- package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +1 -1
- package/esm/typings/src/playground/playground.d.ts +3 -0
- package/esm/typings/src/types/typeAliases.d.ts +6 -0
- package/esm/typings/src/utils/color/Color.d.ts +9 -1
- package/esm/typings/src/utils/color/css-colors.d.ts +1 -0
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +6 -0
- package/esm/typings/src/utils/random/CzechNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/EnglishNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/NamePool.d.ts +17 -0
- package/esm/typings/src/utils/random/getNamePool.d.ts +10 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +57 -16
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgent.d.ts +0 -29
- package/esm/typings/src/commitments/registry.d.ts +0 -68
- package/esm/typings/src/playground/playground1.d.ts +0 -2
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import type { AgentBasicInformation } from '../../book-2.0/agent-source/AgentBasicInformation';
|
|
3
|
+
import { string_css_class } from '../../types/typeAliases';
|
|
4
|
+
/**
|
|
5
|
+
* @private props of PromptbookAgentIntegration component
|
|
6
|
+
*/
|
|
7
|
+
export type PromptbookAgentIntegrationProps = {
|
|
8
|
+
/**
|
|
9
|
+
* URL of the agent to connect to
|
|
10
|
+
*
|
|
11
|
+
* @example "http://s6.ptbk.io/benjamin-white"
|
|
12
|
+
*/
|
|
13
|
+
readonly agentUrl: string;
|
|
14
|
+
/**
|
|
15
|
+
* Form of the agent integration
|
|
16
|
+
*
|
|
17
|
+
* @default `seamless`
|
|
18
|
+
*
|
|
19
|
+
* - `seamless` Default, current behavior
|
|
20
|
+
* - `book` Show the Agent as a book in BookEditor
|
|
21
|
+
* - `chat` Show the Agent as a chat which is not floating but as AgentChat component
|
|
22
|
+
* - `profile` Show the Agent as a profile using
|
|
23
|
+
*/
|
|
24
|
+
readonly formfactor?: 'seamless' | 'book' | 'chat' | 'profile';
|
|
25
|
+
/**
|
|
26
|
+
* Optional metadata to show before the agent is connected
|
|
27
|
+
* Or to override the agent metadata if the agent does not provide it
|
|
28
|
+
*/
|
|
29
|
+
readonly meta?: Partial<AgentBasicInformation['meta']>;
|
|
30
|
+
/**
|
|
31
|
+
* Callback when the window is opened or closed
|
|
32
|
+
*/
|
|
33
|
+
onOpenChange?(isOpen: boolean): void;
|
|
34
|
+
/**
|
|
35
|
+
* Optional CSS class name which will be added to root element
|
|
36
|
+
*/
|
|
37
|
+
readonly className?: string_css_class;
|
|
38
|
+
/**
|
|
39
|
+
* Optional CSS style which will be added to root element
|
|
40
|
+
*/
|
|
41
|
+
readonly style?: CSSProperties;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Renders a floating agent button that opens a chat window with the remote agent.
|
|
45
|
+
*
|
|
46
|
+
* @public exported from `@promptbook/components`
|
|
47
|
+
*/
|
|
48
|
+
export declare function PromptbookAgentIntegration(props: PromptbookAgentIntegrationProps): import("react/jsx-runtime").JSX.Element | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* TODO: !!! Load the full branding
|
|
51
|
+
* TODO: !!! <promptbook-agent> element
|
|
52
|
+
*/
|
package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PromptbookAgentIntegrationProps } from './PromptbookAgentIntegration';
|
|
2
|
+
type PromptbookAgentSeamlessIntegrationProps = Omit<PromptbookAgentIntegrationProps, 'formfactor'>;
|
|
3
|
+
/**
|
|
4
|
+
* Renders a floating agent button that opens a chat window with the remote agent.
|
|
5
|
+
*
|
|
6
|
+
* @private component of PromptbookAgentIntegration
|
|
7
|
+
*/
|
|
8
|
+
export declare function PromptbookAgentSeamlessIntegration(props: PromptbookAgentSeamlessIntegrationProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
/**
|
|
11
|
+
* TODO: !!!! Use iframe here instead of implementing the chat directly, allow to switch between seamless and iframe mode via `isIframeUsed` prop
|
|
12
|
+
* TODO: !!! Load the full branding
|
|
13
|
+
* TODO: !!! <promptbook-agent> element
|
|
14
|
+
*/
|
|
@@ -16,6 +16,10 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
|
16
16
|
*/
|
|
17
17
|
export declare class ClosedCommitmentDefinition extends BaseCommitmentDefinition<'CLOSED'> {
|
|
18
18
|
constructor();
|
|
19
|
+
/**
|
|
20
|
+
* The `CLOSED` commitment is standalone.
|
|
21
|
+
*/
|
|
22
|
+
get requiresContent(): boolean;
|
|
19
23
|
/**
|
|
20
24
|
* Short one-line description of CLOSED.
|
|
21
25
|
*/
|
|
@@ -14,6 +14,12 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
|
14
14
|
* META COLOR #00ff00
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
|
+
* You can also specify multiple colors separated by comma:
|
|
18
|
+
*
|
|
19
|
+
* ```book
|
|
20
|
+
* META COLOR #ff0000, #00ff00, #0000ff
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
17
23
|
* @private [🪔] Maybe export the commitments through some package
|
|
18
24
|
*/
|
|
19
25
|
export declare class MetaColorCommitmentDefinition extends BaseCommitmentDefinition<'META COLOR'> {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* META FONT commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The META FONT commitment sets the agent's font.
|
|
7
|
+
* This commitment is special because it doesn't affect the system message,
|
|
8
|
+
* but is handled separately in the parsing logic.
|
|
9
|
+
*
|
|
10
|
+
* Example usage in agent source:
|
|
11
|
+
*
|
|
12
|
+
* ```book
|
|
13
|
+
* META FONT Poppins, Arial, sans-serif
|
|
14
|
+
* META FONT Roboto
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
18
|
+
*/
|
|
19
|
+
export declare class MetaFontCommitmentDefinition extends BaseCommitmentDefinition<'META FONT'> {
|
|
20
|
+
constructor();
|
|
21
|
+
/**
|
|
22
|
+
* Short one-line description of META FONT.
|
|
23
|
+
*/
|
|
24
|
+
get description(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Icon for this commitment.
|
|
27
|
+
*/
|
|
28
|
+
get icon(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Markdown documentation for META FONT commitment.
|
|
31
|
+
*/
|
|
32
|
+
get documentation(): string;
|
|
33
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
34
|
+
/**
|
|
35
|
+
* Extracts the font from the content
|
|
36
|
+
* This is used by the parsing logic
|
|
37
|
+
*/
|
|
38
|
+
extractProfileFont(content: string): string | null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
42
|
+
*/
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* USE commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The USE commitment indicates that the agent should utilize specific tools or capabilities
|
|
7
|
+
* to access and interact with external systems when necessary.
|
|
8
|
+
*
|
|
9
|
+
* Supported USE types:
|
|
10
|
+
* - USE BROWSER: Enables the agent to use a web browser tool
|
|
11
|
+
* - USE SEARCH ENGINE (future): Enables search engine access
|
|
12
|
+
* - USE FILE SYSTEM (future): Enables file system operations
|
|
13
|
+
* - USE MCP (future): Enables MCP server connections
|
|
14
|
+
*
|
|
15
|
+
* The content following the USE commitment is ignored (similar to NOTE).
|
|
16
|
+
*
|
|
17
|
+
* Example usage in agent source:
|
|
18
|
+
*
|
|
19
|
+
* ```book
|
|
20
|
+
* USE BROWSER
|
|
21
|
+
* USE SEARCH ENGINE
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
25
|
+
*/
|
|
26
|
+
export declare class UseCommitmentDefinition extends BaseCommitmentDefinition<`USE${string}`> {
|
|
27
|
+
constructor();
|
|
28
|
+
/**
|
|
29
|
+
* Short one-line description of USE commitments.
|
|
30
|
+
*/
|
|
31
|
+
get description(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Icon for this commitment.
|
|
34
|
+
*/
|
|
35
|
+
get icon(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Markdown documentation for USE commitment.
|
|
38
|
+
*/
|
|
39
|
+
get documentation(): string;
|
|
40
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
41
|
+
/**
|
|
42
|
+
* Extracts the tool type from the USE commitment
|
|
43
|
+
* This is used by the parsing logic
|
|
44
|
+
*/
|
|
45
|
+
extractToolType(content: string): string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Checks if this is a known USE type
|
|
48
|
+
*/
|
|
49
|
+
isKnownUseType(useType: string): boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
53
|
+
*/
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* USE BROWSER commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The `USE BROWSER` commitment indicates that the agent should utilize a web browser tool
|
|
7
|
+
* to access and retrieve up-to-date information from the internet when necessary.
|
|
8
|
+
*
|
|
9
|
+
* The content following `USE BROWSER` is ignored (similar to NOTE).
|
|
10
|
+
*
|
|
11
|
+
* Example usage in agent source:
|
|
12
|
+
*
|
|
13
|
+
* ```book
|
|
14
|
+
* USE BROWSER
|
|
15
|
+
* USE BROWSER This will be ignored
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
19
|
+
*/
|
|
20
|
+
export declare class UseBrowserCommitmentDefinition extends BaseCommitmentDefinition<'USE BROWSER'> {
|
|
21
|
+
constructor();
|
|
22
|
+
/**
|
|
23
|
+
* The `USE BROWSER` commitment is standalone.
|
|
24
|
+
*/
|
|
25
|
+
get requiresContent(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Short one-line description of USE BROWSER.
|
|
28
|
+
*/
|
|
29
|
+
get description(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Icon for this commitment.
|
|
32
|
+
*/
|
|
33
|
+
get icon(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Markdown documentation for USE BROWSER commitment.
|
|
36
|
+
*/
|
|
37
|
+
get documentation(): string;
|
|
38
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
42
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* USE MCP commitment definition
|
|
5
5
|
*
|
|
6
|
-
* The
|
|
7
|
-
*
|
|
6
|
+
* The `USE MCP` commitment allows to specify an MCP server URL which the agent will connect to
|
|
7
|
+
* for retrieving additional instructions and actions.
|
|
8
|
+
*
|
|
9
|
+
* The content following `USE MCP` is the URL of the MCP server.
|
|
8
10
|
*
|
|
9
11
|
* Example usage in agent source:
|
|
10
12
|
*
|
|
11
13
|
* ```book
|
|
12
|
-
*
|
|
14
|
+
* USE MCP http://mcp-server-url.com
|
|
13
15
|
* ```
|
|
14
16
|
*
|
|
15
17
|
* @private [🪔] Maybe export the commitments through some package
|
|
16
18
|
*/
|
|
17
|
-
export declare class
|
|
19
|
+
export declare class UseMcpCommitmentDefinition extends BaseCommitmentDefinition<'USE MCP'> {
|
|
18
20
|
constructor();
|
|
21
|
+
/**
|
|
22
|
+
* Short one-line description of USE MCP.
|
|
23
|
+
*/
|
|
19
24
|
get description(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Icon for this commitment.
|
|
27
|
+
*/
|
|
20
28
|
get icon(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Markdown documentation for USE MCP commitment.
|
|
31
|
+
*/
|
|
21
32
|
get documentation(): string;
|
|
22
33
|
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
23
34
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* USE SEARCH ENGINE commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The `USE SEARCH ENGINE` commitment indicates that the agent should utilize a search engine tool
|
|
7
|
+
* to access and retrieve up-to-date information from the internet when necessary.
|
|
8
|
+
*
|
|
9
|
+
* The content following `USE SEARCH ENGINE` is ignored (similar to NOTE).
|
|
10
|
+
*
|
|
11
|
+
* Example usage in agent source:
|
|
12
|
+
*
|
|
13
|
+
* ```book
|
|
14
|
+
* USE SEARCH ENGINE
|
|
15
|
+
* USE SEARCH ENGINE This will be ignored
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
19
|
+
*/
|
|
20
|
+
export declare class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition<'USE SEARCH ENGINE'> {
|
|
21
|
+
constructor();
|
|
22
|
+
/**
|
|
23
|
+
* Short one-line description of USE SEARCH ENGINE.
|
|
24
|
+
*/
|
|
25
|
+
get description(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Icon for this commitment.
|
|
28
|
+
*/
|
|
29
|
+
get icon(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Markdown documentation for USE SEARCH ENGINE commitment.
|
|
32
|
+
*/
|
|
33
|
+
get documentation(): string;
|
|
34
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
38
|
+
*/
|
|
@@ -15,6 +15,12 @@ export declare abstract class BaseCommitmentDefinition<TBookCommitment extends s
|
|
|
15
15
|
* Must be implemented by each concrete commitment.
|
|
16
16
|
*/
|
|
17
17
|
abstract get description(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Whether this commitment requires content.
|
|
20
|
+
* If true, regex will match only if there is content after the commitment keyword.
|
|
21
|
+
* If false, regex will match even if there is no content.
|
|
22
|
+
*/
|
|
23
|
+
get requiresContent(): boolean;
|
|
18
24
|
/**
|
|
19
25
|
* Icon for this commitment.
|
|
20
26
|
* It should be a single emoji.
|
|
@@ -1 +1,93 @@
|
|
|
1
|
-
|
|
1
|
+
import type { BookCommitment } from './_base/BookCommitment';
|
|
2
|
+
import type { CommitmentDefinition } from './_base/CommitmentDefinition';
|
|
3
|
+
import { ActionCommitmentDefinition } from './ACTION/ACTION';
|
|
4
|
+
import { ClosedCommitmentDefinition } from './CLOSED/CLOSED';
|
|
5
|
+
import { ComponentCommitmentDefinition } from './COMPONENT/COMPONENT';
|
|
6
|
+
import { DeleteCommitmentDefinition } from './DELETE/DELETE';
|
|
7
|
+
import { FormatCommitmentDefinition } from './FORMAT/FORMAT';
|
|
8
|
+
import { FromCommitmentDefinition } from './FROM/FROM';
|
|
9
|
+
import { GoalCommitmentDefinition } from './GOAL/GOAL';
|
|
10
|
+
import { KnowledgeCommitmentDefinition } from './KNOWLEDGE/KNOWLEDGE';
|
|
11
|
+
import { LanguageCommitmentDefinition } from './LANGUAGE/LANGUAGE';
|
|
12
|
+
import { MemoryCommitmentDefinition } from './MEMORY/MEMORY';
|
|
13
|
+
import { AgentMessageCommitmentDefinition } from './MESSAGE/AgentMessageCommitmentDefinition';
|
|
14
|
+
import { InitialMessageCommitmentDefinition } from './MESSAGE/InitialMessageCommitmentDefinition';
|
|
15
|
+
import { MessageCommitmentDefinition } from './MESSAGE/MESSAGE';
|
|
16
|
+
import { UserMessageCommitmentDefinition } from './MESSAGE/UserMessageCommitmentDefinition';
|
|
17
|
+
import { MetaCommitmentDefinition } from './META/META';
|
|
18
|
+
import { MetaColorCommitmentDefinition } from './META_COLOR/META_COLOR';
|
|
19
|
+
import { MetaFontCommitmentDefinition } from './META_FONT/META_FONT';
|
|
20
|
+
import { MetaImageCommitmentDefinition } from './META_IMAGE/META_IMAGE';
|
|
21
|
+
import { MetaLinkCommitmentDefinition } from './META_LINK/META_LINK';
|
|
22
|
+
import { ModelCommitmentDefinition } from './MODEL/MODEL';
|
|
23
|
+
import { NoteCommitmentDefinition } from './NOTE/NOTE';
|
|
24
|
+
import { OpenCommitmentDefinition } from './OPEN/OPEN';
|
|
25
|
+
import { PersonaCommitmentDefinition } from './PERSONA/PERSONA';
|
|
26
|
+
import { RuleCommitmentDefinition } from './RULE/RULE';
|
|
27
|
+
import { SampleCommitmentDefinition } from './SAMPLE/SAMPLE';
|
|
28
|
+
import { ScenarioCommitmentDefinition } from './SCENARIO/SCENARIO';
|
|
29
|
+
import { StyleCommitmentDefinition } from './STYLE/STYLE';
|
|
30
|
+
import { UseCommitmentDefinition } from './USE/USE';
|
|
31
|
+
import { UseBrowserCommitmentDefinition } from './USE_BROWSER/USE_BROWSER';
|
|
32
|
+
import { UseMcpCommitmentDefinition } from './USE_MCP/USE_MCP';
|
|
33
|
+
import { UseSearchEngineCommitmentDefinition } from './USE_SEARCH_ENGINE/USE_SEARCH_ENGINE';
|
|
34
|
+
import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplementedCommitmentDefinition';
|
|
35
|
+
/**
|
|
36
|
+
* Registry of all available commitment definitions
|
|
37
|
+
* This array contains instances of all commitment definitions
|
|
38
|
+
* This is the single source of truth for all commitments in the system
|
|
39
|
+
*
|
|
40
|
+
* @private Use functions to access commitments instead of this array directly
|
|
41
|
+
*/
|
|
42
|
+
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, FromCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseMcpCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
43
|
+
/**
|
|
44
|
+
* Gets a commitment definition by its type
|
|
45
|
+
* @param type The commitment type to look up
|
|
46
|
+
* @returns The commitment definition or null if not found
|
|
47
|
+
*
|
|
48
|
+
* @public exported from `@promptbook/core`
|
|
49
|
+
*/
|
|
50
|
+
export declare function getCommitmentDefinition(type: BookCommitment): CommitmentDefinition | null;
|
|
51
|
+
/**
|
|
52
|
+
* Gets all available commitment definitions
|
|
53
|
+
* @returns Array of all commitment definitions
|
|
54
|
+
*
|
|
55
|
+
* @public exported from `@promptbook/core`
|
|
56
|
+
*/
|
|
57
|
+
export declare function getAllCommitmentDefinitions(): ReadonlyArray<CommitmentDefinition>;
|
|
58
|
+
/**
|
|
59
|
+
* Gets all available commitment types
|
|
60
|
+
* @returns Array of all commitment types
|
|
61
|
+
*
|
|
62
|
+
* @public exported from `@promptbook/core`
|
|
63
|
+
*/
|
|
64
|
+
export declare function getAllCommitmentTypes(): ReadonlyArray<BookCommitment>;
|
|
65
|
+
/**
|
|
66
|
+
* Checks if a commitment type is supported
|
|
67
|
+
* @param type The commitment type to check
|
|
68
|
+
* @returns True if the commitment type is supported
|
|
69
|
+
*
|
|
70
|
+
* @public exported from `@promptbook/core`
|
|
71
|
+
*/
|
|
72
|
+
export declare function isCommitmentSupported(type: BookCommitment): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Grouped commitment definition
|
|
75
|
+
*
|
|
76
|
+
* @public exported from `@promptbook/core`
|
|
77
|
+
*/
|
|
78
|
+
export type GroupedCommitmentDefinition = {
|
|
79
|
+
primary: CommitmentDefinition;
|
|
80
|
+
aliases: string[];
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Gets all commitment definitions grouped by their aliases
|
|
84
|
+
*
|
|
85
|
+
* @returns Array of grouped commitment definitions
|
|
86
|
+
*
|
|
87
|
+
* @public exported from `@promptbook/core`
|
|
88
|
+
*/
|
|
89
|
+
export declare function getGroupedCommitmentDefinitions(): ReadonlyArray<GroupedCommitmentDefinition>;
|
|
90
|
+
/**
|
|
91
|
+
* TODO: [🧠] Maybe create through standardized $register
|
|
92
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
93
|
+
*/
|
|
@@ -4,7 +4,7 @@ import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
|
4
4
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
5
5
|
import type { ChatPromptResult } from '../../execution/PromptResult';
|
|
6
6
|
import type { Prompt } from '../../types/Prompt';
|
|
7
|
-
import type { string_agent_hash, string_agent_name, string_agent_url, string_url_image } from '../../types/typeAliases';
|
|
7
|
+
import type { string_agent_hash, string_agent_name, string_agent_url, string_color, string_fonts, string_url_image } from '../../types/typeAliases';
|
|
8
8
|
import { AgentLlmExecutionTools } from './AgentLlmExecutionTools';
|
|
9
9
|
import type { AgentOptions } from './AgentOptions';
|
|
10
10
|
/**
|
|
@@ -48,6 +48,8 @@ export declare class Agent extends AgentLlmExecutionTools implements LlmExecutio
|
|
|
48
48
|
fullname?: string;
|
|
49
49
|
image?: string_url_image;
|
|
50
50
|
link?: string;
|
|
51
|
+
font?: string_fonts;
|
|
52
|
+
color?: string_color;
|
|
51
53
|
title?: string;
|
|
52
54
|
description?: string;
|
|
53
55
|
[key: string]: string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PipelineCollection } from '../../collection/pipeline-collection/
|
|
1
|
+
import type { PipelineCollection } from '../../collection/pipeline-collection/PipelineCollection';
|
|
2
2
|
/**
|
|
3
3
|
* Get pipeline collection for Untitled Promptbook project
|
|
4
4
|
*
|
|
@@ -330,6 +330,12 @@ export type string_css_class = string;
|
|
|
330
330
|
* For example `border`
|
|
331
331
|
*/
|
|
332
332
|
export type string_css_property = string;
|
|
333
|
+
/**
|
|
334
|
+
* Semantic helper
|
|
335
|
+
*
|
|
336
|
+
* For example `"Arial, sans-serif"`
|
|
337
|
+
*/
|
|
338
|
+
export type string_fonts = string;
|
|
333
339
|
/**
|
|
334
340
|
* Semantic helper
|
|
335
341
|
*
|
|
@@ -23,7 +23,15 @@ export declare class Color {
|
|
|
23
23
|
* @param color
|
|
24
24
|
* @returns Color object
|
|
25
25
|
*/
|
|
26
|
-
static from(color: string_color | Color): WithTake<Color>;
|
|
26
|
+
static from(color: string_color | Color, _isSingleValue?: boolean): WithTake<Color>;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a new Color instance from miscellaneous formats
|
|
29
|
+
* It just does not throw error when it fails, it returns PROMPTBOOK_COLOR instead
|
|
30
|
+
*
|
|
31
|
+
* @param color
|
|
32
|
+
* @returns Color object
|
|
33
|
+
*/
|
|
34
|
+
static fromSafe(color: string_color | Color): WithTake<Color>;
|
|
27
35
|
/**
|
|
28
36
|
* Creates a new Color instance from miscellaneous string formats
|
|
29
37
|
*
|
|
@@ -9,6 +9,12 @@ type GenerateBookBoilerplateOptions = PartialDeep<Omit<AgentBasicInformation, 'p
|
|
|
9
9
|
* @default 'Adam'
|
|
10
10
|
*/
|
|
11
11
|
parentAgentName?: string_agent_name_in_book;
|
|
12
|
+
/**
|
|
13
|
+
* Name pool to use for generating agent name
|
|
14
|
+
*
|
|
15
|
+
* @default 'ENGLISH'
|
|
16
|
+
*/
|
|
17
|
+
namePool?: string;
|
|
12
18
|
};
|
|
13
19
|
/**
|
|
14
20
|
* Generates boilerplate for a new agent book
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { string_color, string_person_fullname } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Result of generating a name
|
|
4
|
+
*/
|
|
5
|
+
export type GenerateNameResult = {
|
|
6
|
+
fullname: string_person_fullname;
|
|
7
|
+
color: string_color;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Interface for a name pool
|
|
11
|
+
*/
|
|
12
|
+
export type NamePool = {
|
|
13
|
+
/**
|
|
14
|
+
* Generates a random name
|
|
15
|
+
*/
|
|
16
|
+
generateName(): GenerateNameResult;
|
|
17
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NamePool } from './NamePool';
|
|
2
|
+
/**
|
|
3
|
+
* Gets the name pool based on the language code
|
|
4
|
+
*
|
|
5
|
+
* @param language - The language code (e.g. 'ENGLISH', 'CZECH')
|
|
6
|
+
* @returns The name pool
|
|
7
|
+
*
|
|
8
|
+
* @private [🍇] Maybe expose via some package
|
|
9
|
+
*/
|
|
10
|
+
export declare function getNamePool(language: string): NamePool;
|
|
@@ -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.103.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.103.0-65`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/utils",
|
|
3
|
-
"version": "0.103.0-
|
|
3
|
+
"version": "0.103.0-66",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/webgptorg/promptbook"
|
|
9
|
+
"url": "git+https://github.com/webgptorg/promptbook.git"
|
|
10
10
|
},
|
|
11
11
|
"author": "Pavol Hejný <pavol@ptbk.io> (https://www.pavolhejny.com/)",
|
|
12
12
|
"contributors": [
|