@promptbook/browser 0.103.0-54 → 0.103.0-55
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 +770 -181
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +8 -6
- package/esm/typings/src/_packages/types.index.d.ts +1 -1
- package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +4 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.d.ts +35 -0
- package/esm/typings/src/commitments/COMPONENT/COMPONENT.d.ts +28 -0
- package/esm/typings/src/commitments/FROM/FROM.d.ts +34 -0
- package/esm/typings/src/commitments/IMPORTANT/IMPORTANT.d.ts +26 -0
- package/esm/typings/src/commitments/LANGUAGE/LANGUAGE.d.ts +35 -0
- package/esm/typings/src/commitments/OPEN/OPEN.d.ts +35 -0
- package/esm/typings/src/commitments/index.d.ts +1 -82
- package/esm/typings/src/commitments/registry.d.ts +68 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +3 -3
- package/umd/index.umd.js +770 -181
- package/umd/index.umd.js.map +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* FROM commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The FROM commitment tells the agent that its `agentSource` is inherited from another agent.
|
|
7
|
+
*
|
|
8
|
+
* Example usage in agent source:
|
|
9
|
+
*
|
|
10
|
+
* ```book
|
|
11
|
+
* FROM https://s6.ptbk.io/benjamin-white
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
15
|
+
*/
|
|
16
|
+
export declare class FromCommitmentDefinition extends BaseCommitmentDefinition<'FROM'> {
|
|
17
|
+
constructor(type?: 'FROM');
|
|
18
|
+
/**
|
|
19
|
+
* Short one-line description of FROM.
|
|
20
|
+
*/
|
|
21
|
+
get description(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Icon for this commitment.
|
|
24
|
+
*/
|
|
25
|
+
get icon(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Markdown documentation for FROM commitment.
|
|
28
|
+
*/
|
|
29
|
+
get documentation(): string;
|
|
30
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
34
|
+
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* IMPORTANT co-commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The IMPORTANT co-commitment modifies another commitment to emphasize its importance.
|
|
7
|
+
* It is typically used with RULE to mark it as critical.
|
|
8
|
+
*
|
|
9
|
+
* Example usage in agent source:
|
|
10
|
+
*
|
|
11
|
+
* ```book
|
|
12
|
+
* IMPORTANT RULE Never provide medical advice
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
16
|
+
*/
|
|
17
|
+
export declare class ImportantCommitmentDefinition extends BaseCommitmentDefinition<'IMPORTANT'> {
|
|
18
|
+
constructor();
|
|
19
|
+
get description(): string;
|
|
20
|
+
get icon(): string;
|
|
21
|
+
get documentation(): string;
|
|
22
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
26
|
+
*/
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* LANGUAGE commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The LANGUAGE/LANGUAGES commitment specifies the language(s) the agent should use in its responses.
|
|
7
|
+
*
|
|
8
|
+
* Example usage in agent source:
|
|
9
|
+
*
|
|
10
|
+
* ```book
|
|
11
|
+
* LANGUAGE English
|
|
12
|
+
* LANGUAGE French, English and Czech
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
16
|
+
*/
|
|
17
|
+
export declare class LanguageCommitmentDefinition extends BaseCommitmentDefinition<'LANGUAGE' | 'LANGUAGES'> {
|
|
18
|
+
constructor(type?: 'LANGUAGE' | 'LANGUAGES');
|
|
19
|
+
/**
|
|
20
|
+
* Short one-line description of LANGUAGE/LANGUAGES.
|
|
21
|
+
*/
|
|
22
|
+
get description(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Icon for this commitment.
|
|
25
|
+
*/
|
|
26
|
+
get icon(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Markdown documentation for LANGUAGE/LANGUAGES commitment.
|
|
29
|
+
*/
|
|
30
|
+
get documentation(): string;
|
|
31
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
35
|
+
*/
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* OPEN commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The OPEN commitment specifies that the agent can be modified by conversation.
|
|
7
|
+
* This is the default behavior.
|
|
8
|
+
*
|
|
9
|
+
* Example usage in agent source:
|
|
10
|
+
*
|
|
11
|
+
* ```book
|
|
12
|
+
* OPEN
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
16
|
+
*/
|
|
17
|
+
export declare class OpenCommitmentDefinition extends BaseCommitmentDefinition<'OPEN'> {
|
|
18
|
+
constructor();
|
|
19
|
+
/**
|
|
20
|
+
* Short one-line description of OPEN.
|
|
21
|
+
*/
|
|
22
|
+
get description(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Icon for this commitment.
|
|
25
|
+
*/
|
|
26
|
+
get icon(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Markdown documentation for OPEN commitment.
|
|
29
|
+
*/
|
|
30
|
+
get documentation(): string;
|
|
31
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, _content: string): AgentModelRequirements;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
35
|
+
*/
|
|
@@ -1,82 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { CommitmentDefinition } from './_base/CommitmentDefinition';
|
|
3
|
-
import { ActionCommitmentDefinition } from './ACTION/ACTION';
|
|
4
|
-
import { DeleteCommitmentDefinition } from './DELETE/DELETE';
|
|
5
|
-
import { FormatCommitmentDefinition } from './FORMAT/FORMAT';
|
|
6
|
-
import { GoalCommitmentDefinition } from './GOAL/GOAL';
|
|
7
|
-
import { KnowledgeCommitmentDefinition } from './KNOWLEDGE/KNOWLEDGE';
|
|
8
|
-
import { MemoryCommitmentDefinition } from './MEMORY/MEMORY';
|
|
9
|
-
import { AgentMessageCommitmentDefinition } from './MESSAGE/AgentMessageCommitmentDefinition';
|
|
10
|
-
import { InitialMessageCommitmentDefinition } from './MESSAGE/InitialMessageCommitmentDefinition';
|
|
11
|
-
import { MessageCommitmentDefinition } from './MESSAGE/MESSAGE';
|
|
12
|
-
import { UserMessageCommitmentDefinition } from './MESSAGE/UserMessageCommitmentDefinition';
|
|
13
|
-
import { MetaCommitmentDefinition } from './META/META';
|
|
14
|
-
import { MetaColorCommitmentDefinition } from './META_COLOR/META_COLOR';
|
|
15
|
-
import { MetaImageCommitmentDefinition } from './META_IMAGE/META_IMAGE';
|
|
16
|
-
import { ModelCommitmentDefinition } from './MODEL/MODEL';
|
|
17
|
-
import { NoteCommitmentDefinition } from './NOTE/NOTE';
|
|
18
|
-
import { PersonaCommitmentDefinition } from './PERSONA/PERSONA';
|
|
19
|
-
import { RuleCommitmentDefinition } from './RULE/RULE';
|
|
20
|
-
import { SampleCommitmentDefinition } from './SAMPLE/SAMPLE';
|
|
21
|
-
import { ScenarioCommitmentDefinition } from './SCENARIO/SCENARIO';
|
|
22
|
-
import { StyleCommitmentDefinition } from './STYLE/STYLE';
|
|
23
|
-
import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplementedCommitmentDefinition';
|
|
24
|
-
/**
|
|
25
|
-
* Registry of all available commitment definitions
|
|
26
|
-
* This array contains instances of all commitment definitions
|
|
27
|
-
* This is the single source of truth for all commitments in the system
|
|
28
|
-
*
|
|
29
|
-
* @private Use functions to access commitments instead of this array directly
|
|
30
|
-
*/
|
|
31
|
-
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
32
|
-
/**
|
|
33
|
-
* Gets a commitment definition by its type
|
|
34
|
-
* @param type The commitment type to look up
|
|
35
|
-
* @returns The commitment definition or null if not found
|
|
36
|
-
*
|
|
37
|
-
* @public exported from `@promptbook/core`
|
|
38
|
-
*/
|
|
39
|
-
export declare function getCommitmentDefinition(type: BookCommitment): CommitmentDefinition | null;
|
|
40
|
-
/**
|
|
41
|
-
* Gets all available commitment definitions
|
|
42
|
-
* @returns Array of all commitment definitions
|
|
43
|
-
*
|
|
44
|
-
* @public exported from `@promptbook/core`
|
|
45
|
-
*/
|
|
46
|
-
export declare function getAllCommitmentDefinitions(): ReadonlyArray<CommitmentDefinition>;
|
|
47
|
-
/**
|
|
48
|
-
* Gets all available commitment types
|
|
49
|
-
* @returns Array of all commitment types
|
|
50
|
-
*
|
|
51
|
-
* @public exported from `@promptbook/core`
|
|
52
|
-
*/
|
|
53
|
-
export declare function getAllCommitmentTypes(): ReadonlyArray<BookCommitment>;
|
|
54
|
-
/**
|
|
55
|
-
* Checks if a commitment type is supported
|
|
56
|
-
* @param type The commitment type to check
|
|
57
|
-
* @returns True if the commitment type is supported
|
|
58
|
-
*
|
|
59
|
-
* @public exported from `@promptbook/core`
|
|
60
|
-
*/
|
|
61
|
-
export declare function isCommitmentSupported(type: BookCommitment): boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Grouped commitment definition
|
|
64
|
-
*
|
|
65
|
-
* @public exported from `@promptbook/core`
|
|
66
|
-
*/
|
|
67
|
-
export type GroupedCommitmentDefinition = {
|
|
68
|
-
primary: CommitmentDefinition;
|
|
69
|
-
aliases: string[];
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Gets all commitment definitions grouped by their aliases
|
|
73
|
-
*
|
|
74
|
-
* @returns Array of grouped commitment definitions
|
|
75
|
-
*
|
|
76
|
-
* @public exported from `@promptbook/core`
|
|
77
|
-
*/
|
|
78
|
-
export declare function getGroupedCommitmentDefinitions(): ReadonlyArray<GroupedCommitmentDefinition>;
|
|
79
|
-
/**
|
|
80
|
-
* TODO: [🧠] Maybe create through standardized $register
|
|
81
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
82
|
-
*/
|
|
1
|
+
export * from './registry';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { BookCommitment } from './_base/BookCommitment';
|
|
2
|
+
import type { CommitmentDefinition } from './_base/CommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* Registry of all available commitment definitions
|
|
5
|
+
* This array contains instances of all commitment definitions
|
|
6
|
+
* This is the single source of truth for all commitments in the system
|
|
7
|
+
*
|
|
8
|
+
* @private Use functions to access commitments instead of this array directly
|
|
9
|
+
*/
|
|
10
|
+
export declare const COMMITMENT_REGISTRY: CommitmentDefinition[];
|
|
11
|
+
/**
|
|
12
|
+
* Registers a new commitment definition
|
|
13
|
+
* @param definition The commitment definition to register
|
|
14
|
+
*
|
|
15
|
+
* @public exported from `@promptbook/core`
|
|
16
|
+
*/
|
|
17
|
+
export declare function registerCommitment(definition: CommitmentDefinition): void;
|
|
18
|
+
/**
|
|
19
|
+
* Gets a commitment definition by its type
|
|
20
|
+
* @param type The commitment type to look up
|
|
21
|
+
* @returns The commitment definition or null if not found
|
|
22
|
+
*
|
|
23
|
+
* @public exported from `@promptbook/core`
|
|
24
|
+
*/
|
|
25
|
+
export declare function getCommitmentDefinition(type: BookCommitment): CommitmentDefinition | null;
|
|
26
|
+
/**
|
|
27
|
+
* Gets all available commitment definitions
|
|
28
|
+
* @returns Array of all commitment definitions
|
|
29
|
+
*
|
|
30
|
+
* @public exported from `@promptbook/core`
|
|
31
|
+
*/
|
|
32
|
+
export declare function getAllCommitmentDefinitions(): ReadonlyArray<CommitmentDefinition>;
|
|
33
|
+
/**
|
|
34
|
+
* Gets all available commitment types
|
|
35
|
+
* @returns Array of all commitment types
|
|
36
|
+
*
|
|
37
|
+
* @public exported from `@promptbook/core`
|
|
38
|
+
*/
|
|
39
|
+
export declare function getAllCommitmentTypes(): ReadonlyArray<BookCommitment>;
|
|
40
|
+
/**
|
|
41
|
+
* Checks if a commitment type is supported
|
|
42
|
+
* @param type The commitment type to check
|
|
43
|
+
* @returns True if the commitment type is supported
|
|
44
|
+
*
|
|
45
|
+
* @public exported from `@promptbook/core`
|
|
46
|
+
*/
|
|
47
|
+
export declare function isCommitmentSupported(type: BookCommitment): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Grouped commitment definition
|
|
50
|
+
*
|
|
51
|
+
* @public exported from `@promptbook/core`
|
|
52
|
+
*/
|
|
53
|
+
export type GroupedCommitmentDefinition = {
|
|
54
|
+
primary: CommitmentDefinition;
|
|
55
|
+
aliases: string[];
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Gets all commitment definitions grouped by their aliases
|
|
59
|
+
*
|
|
60
|
+
* @returns Array of grouped commitment definitions
|
|
61
|
+
*
|
|
62
|
+
* @public exported from `@promptbook/core`
|
|
63
|
+
*/
|
|
64
|
+
export declare function getGroupedCommitmentDefinitions(): ReadonlyArray<GroupedCommitmentDefinition>;
|
|
65
|
+
/**
|
|
66
|
+
* TODO: !!!! Proofread this file
|
|
67
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
68
|
+
*/
|
|
@@ -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-54`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/browser",
|
|
3
|
-
"version": "0.103.0-
|
|
3
|
+
"version": "0.103.0-55",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -87,14 +87,14 @@
|
|
|
87
87
|
},
|
|
88
88
|
"homepage": "https://ptbk.io/",
|
|
89
89
|
"engines": {
|
|
90
|
-
"node": ">=
|
|
90
|
+
"node": ">=18.18.0",
|
|
91
91
|
"npm": ">=8.0.0"
|
|
92
92
|
},
|
|
93
93
|
"main": "./umd/index.umd.js",
|
|
94
94
|
"module": "./esm/index.es.js",
|
|
95
95
|
"typings": "./esm/typings/src/_packages/browser.index.d.ts",
|
|
96
96
|
"peerDependencies": {
|
|
97
|
-
"@promptbook/core": "0.103.0-
|
|
97
|
+
"@promptbook/core": "0.103.0-55"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"crypto": "1.0.1",
|