@promptbook/openai 0.103.0-50 → 0.103.0-52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.es.js +1 -1
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +2 -2
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +6 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgent.d.ts +10 -1
- package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +38 -0
- package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +2 -1
- package/esm/typings/src/commitments/index.d.ts +3 -1
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +1 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
package/esm/index.es.js
CHANGED
|
@@ -19,7 +19,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
19
19
|
* @generated
|
|
20
20
|
* @see https://github.com/webgptorg/promptbook
|
|
21
21
|
*/
|
|
22
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
22
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-52';
|
|
23
23
|
/**
|
|
24
24
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
25
25
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -7,7 +7,7 @@ import type { BookCommitment } from '../../commitments/_base/BookCommitment';
|
|
|
7
7
|
*
|
|
8
8
|
* @private - TODO: [🧠] Maybe should be public?
|
|
9
9
|
*/
|
|
10
|
-
export declare function createCommitmentRegex(commitment: BookCommitment): RegExp;
|
|
10
|
+
export declare function createCommitmentRegex(commitment: BookCommitment, aliases?: BookCommitment[]): RegExp;
|
|
11
11
|
/**
|
|
12
12
|
* Generates a regex pattern to match a specific commitment type
|
|
13
13
|
*
|
|
@@ -17,4 +17,4 @@ export declare function createCommitmentRegex(commitment: BookCommitment): RegEx
|
|
|
17
17
|
*
|
|
18
18
|
* @private
|
|
19
19
|
*/
|
|
20
|
-
export declare function createCommitmentTypeRegex(commitment: BookCommitment): RegExp;
|
|
20
|
+
export declare function createCommitmentTypeRegex(commitment: BookCommitment, aliases?: BookCommitment[]): RegExp;
|
|
@@ -77,6 +77,12 @@ export type ChatProps = {
|
|
|
77
77
|
* adding feature–specific controls (e.g. Pause / Resume in MockedChat).
|
|
78
78
|
*/
|
|
79
79
|
readonly extraActions?: ReactNode;
|
|
80
|
+
/**
|
|
81
|
+
* Optional container to render the actions into (using React Portal).
|
|
82
|
+
* If provided, the actions toolbar will be rendered inside this element
|
|
83
|
+
* instead of its default position within the chat.
|
|
84
|
+
*/
|
|
85
|
+
readonly actionsContainer?: HTMLElement | null;
|
|
80
86
|
/**
|
|
81
87
|
* Optional CSS class name which will be added to root <div/> element
|
|
82
88
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import type { AgentBasicInformation } from '../../book-2.0/agent-source/AgentBasicInformation';
|
|
2
2
|
type PromptbookAgentProps = {
|
|
3
3
|
/**
|
|
4
4
|
* URL of the agent to connect to
|
|
@@ -6,6 +6,15 @@ type PromptbookAgentProps = {
|
|
|
6
6
|
* @example "http://s6.ptbk.io/benjamin-white"
|
|
7
7
|
*/
|
|
8
8
|
agentUrl: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional metadata to show before the agent is connected
|
|
11
|
+
* Or to override the agent metadata if the agent does not provide it
|
|
12
|
+
*/
|
|
13
|
+
meta?: Partial<AgentBasicInformation['meta']>;
|
|
14
|
+
/**
|
|
15
|
+
* Callback when the window is opened or closed
|
|
16
|
+
*/
|
|
17
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
9
18
|
};
|
|
10
19
|
/**
|
|
11
20
|
* Renders a floating agent button that opens a chat window with the remote agent.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* META COLOR commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The META COLOR commitment sets the agent's accent color.
|
|
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 COLOR #ff0000
|
|
14
|
+
* META COLOR #00ff00
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
18
|
+
*/
|
|
19
|
+
export declare class MetaColorCommitmentDefinition extends BaseCommitmentDefinition<'META COLOR'> {
|
|
20
|
+
constructor();
|
|
21
|
+
/**
|
|
22
|
+
* Short one-line description of META COLOR.
|
|
23
|
+
*/
|
|
24
|
+
get description(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Markdown documentation for META COLOR commitment.
|
|
27
|
+
*/
|
|
28
|
+
get documentation(): string;
|
|
29
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
30
|
+
/**
|
|
31
|
+
* Extracts the profile color from the content
|
|
32
|
+
* This is used by the parsing logic
|
|
33
|
+
*/
|
|
34
|
+
extractProfileColor(content: string): string | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
38
|
+
*/
|
|
@@ -8,7 +8,8 @@ import type { CommitmentDefinition } from './CommitmentDefinition';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare abstract class BaseCommitmentDefinition<TBookCommitment extends string> implements CommitmentDefinition {
|
|
10
10
|
readonly type: TBookCommitment;
|
|
11
|
-
|
|
11
|
+
readonly aliases: string[];
|
|
12
|
+
constructor(type: TBookCommitment, aliases?: string[]);
|
|
12
13
|
/**
|
|
13
14
|
* Short one-line markdown description; concise, may use inline **markdown**.
|
|
14
15
|
* Must be implemented by each concrete commitment.
|
|
@@ -9,6 +9,8 @@ import { MemoryCommitmentDefinition } from './MEMORY/MEMORY';
|
|
|
9
9
|
import { InitialMessageCommitmentDefinition } from './MESSAGE/InitialMessageCommitmentDefinition';
|
|
10
10
|
import { MessageCommitmentDefinition } from './MESSAGE/MESSAGE';
|
|
11
11
|
import { MetaCommitmentDefinition } from './META/META';
|
|
12
|
+
import { MetaColorCommitmentDefinition } from './META_COLOR/META_COLOR';
|
|
13
|
+
import { MetaImageCommitmentDefinition } from './META_IMAGE/META_IMAGE';
|
|
12
14
|
import { ModelCommitmentDefinition } from './MODEL/MODEL';
|
|
13
15
|
import { NoteCommitmentDefinition } from './NOTE/NOTE';
|
|
14
16
|
import { PersonaCommitmentDefinition } from './PERSONA/PERSONA';
|
|
@@ -24,7 +26,7 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
|
|
|
24
26
|
*
|
|
25
27
|
* @private Use functions to access commitments instead of this array directly
|
|
26
28
|
*/
|
|
27
|
-
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
29
|
+
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, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
28
30
|
/**
|
|
29
31
|
* Gets a commitment definition by its type
|
|
30
32
|
* @param type The commitment type to look up
|
|
@@ -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-51`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/openai",
|
|
3
|
-
"version": "0.103.0-
|
|
3
|
+
"version": "0.103.0-52",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"module": "./esm/index.es.js",
|
|
103
103
|
"typings": "./esm/typings/src/_packages/openai.index.d.ts",
|
|
104
104
|
"peerDependencies": {
|
|
105
|
-
"@promptbook/core": "0.103.0-
|
|
105
|
+
"@promptbook/core": "0.103.0-52"
|
|
106
106
|
},
|
|
107
107
|
"dependencies": {
|
|
108
108
|
"bottleneck": "2.19.5",
|
package/umd/index.umd.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* @generated
|
|
26
26
|
* @see https://github.com/webgptorg/promptbook
|
|
27
27
|
*/
|
|
28
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
28
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-52';
|
|
29
29
|
/**
|
|
30
30
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
31
31
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|