@promptbook/remote-server 0.103.0-47 → 0.103.0-49
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 +35 -9
- package/esm/index.es.js.map +1 -1
- package/esm/typings/servers.d.ts +1 -0
- package/esm/typings/src/_packages/core.index.d.ts +6 -0
- package/esm/typings/src/_packages/types.index.d.ts +4 -0
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +17 -3
- package/esm/typings/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +2 -1
- package/esm/typings/src/book-2.0/agent-source/computeAgentHash.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/computeAgentHash.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/createDefaultAgentName.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/normalizeAgentName.d.ts +9 -0
- package/esm/typings/src/book-2.0/agent-source/normalizeAgentName.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +1 -1
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +14 -8
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +10 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +57 -32
- package/esm/typings/src/commitments/MESSAGE/InitialMessageCommitmentDefinition.d.ts +28 -0
- package/esm/typings/src/commitments/index.d.ts +2 -1
- package/esm/typings/src/config.d.ts +1 -0
- package/esm/typings/src/errors/DatabaseError.d.ts +2 -2
- package/esm/typings/src/errors/WrappedError.d.ts +2 -2
- package/esm/typings/src/execution/ExecutionTask.d.ts +2 -2
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +6 -1
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/utils/assertUniqueModels.d.ts +12 -0
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +17 -4
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +10 -1
- package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +6 -2
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +30 -4
- package/esm/typings/src/llm-providers/openai/openai-models.test.d.ts +4 -0
- package/esm/typings/src/remote-server/startAgentServer.d.ts +2 -2
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +1 -2
- package/esm/typings/src/transpilers/openai-sdk/register.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +6 -0
- package/esm/typings/src/utils/color/Color.d.ts +7 -0
- package/esm/typings/src/utils/color/Color.test.d.ts +1 -0
- package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -2
- package/esm/typings/src/utils/misc/computeHash.d.ts +11 -0
- package/esm/typings/src/utils/misc/computeHash.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +3 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -0
- package/esm/typings/src/utils/normalization/titleToName.d.ts +2 -0
- package/esm/typings/src/utils/organization/$sideEffect.d.ts +2 -2
- package/esm/typings/src/utils/organization/$side_effect.d.ts +2 -2
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +2 -2
- package/esm/typings/src/utils/organization/keepUnused.d.ts +2 -2
- package/esm/typings/src/utils/organization/preserve.d.ts +3 -3
- package/esm/typings/src/utils/organization/really_any.d.ts +7 -0
- package/esm/typings/src/utils/serialization/asSerializable.d.ts +2 -2
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +35 -9
- package/umd/index.umd.js.map +1 -1
|
@@ -5,12 +5,12 @@ import type { RemoteAgentOptions } from './RemoteAgentOptions';
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents one AI Agent
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Note: [🦖] There are several different things in Promptbook:
|
|
9
9
|
* - `Agent` - which represents an AI Agent with its source, memories, actions, etc. Agent is a higher-level abstraction which is internally using:
|
|
10
|
-
* !!!! `RemoteAgent`
|
|
11
10
|
* - `LlmExecutionTools` - which wraps one or more LLM models and provides an interface to execute them
|
|
12
11
|
* - `AgentLlmExecutionTools` - which is a specific implementation of `LlmExecutionTools` that wraps another LlmExecutionTools and applies agent-specific system prompts and requirements
|
|
13
12
|
* - `OpenAiAssistantExecutionTools` - which is a specific implementation of `LlmExecutionTools` for OpenAI models with assistant capabilities, recommended for usage in `Agent` or `AgentLlmExecutionTools`
|
|
13
|
+
* - `RemoteAgent` - which is an `Agent` that connects to a Promptbook Agents Server
|
|
14
14
|
*
|
|
15
15
|
* @public exported from `@promptbook/core`
|
|
16
16
|
*/
|
|
@@ -25,6 +25,10 @@ export declare class RemoteAgent extends Agent {
|
|
|
25
25
|
* Calls the agent on agents remote server
|
|
26
26
|
*/
|
|
27
27
|
callChatModel(prompt: Prompt): Promise<ChatPromptResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Calls the agent on agents remote server with streaming
|
|
30
|
+
*/
|
|
31
|
+
callChatModelStream(prompt: Prompt, onProgress: (chunk: ChatPromptResult) => void): Promise<ChatPromptResult>;
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* TODO: [🧠][😰]Agent is not working with the parameters, should it be?
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
2
2
|
import type { ChatPromptResult } from '../../execution/PromptResult';
|
|
3
3
|
import type { Prompt } from '../../types/Prompt';
|
|
4
|
-
import type { string_markdown, string_markdown_text, string_title } from '../../types/typeAliases';
|
|
4
|
+
import type { string_markdown, string_markdown_text, string_title, string_token } from '../../types/typeAliases';
|
|
5
5
|
import type { OpenAiAssistantExecutionToolsOptions } from './OpenAiAssistantExecutionToolsOptions';
|
|
6
6
|
import { OpenAiExecutionTools } from './OpenAiExecutionTools';
|
|
7
7
|
/**
|
|
@@ -9,16 +9,17 @@ import { OpenAiExecutionTools } from './OpenAiExecutionTools';
|
|
|
9
9
|
*
|
|
10
10
|
* This is useful for calling OpenAI API with a single assistant, for more wide usage use `OpenAiExecutionTools`.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* Note: [🦖] There are several different things in Promptbook:
|
|
13
13
|
* - `Agent` - which represents an AI Agent with its source, memories, actions, etc. Agent is a higher-level abstraction which is internally using:
|
|
14
14
|
* - `LlmExecutionTools` - which wraps one or more LLM models and provides an interface to execute them
|
|
15
15
|
* - `AgentLlmExecutionTools` - which is a specific implementation of `LlmExecutionTools` that wraps another LlmExecutionTools and applies agent-specific system prompts and requirements
|
|
16
16
|
* - `OpenAiAssistantExecutionTools` - which is a specific implementation of `LlmExecutionTools` for OpenAI models with assistant capabilities, recommended for usage in `Agent` or `AgentLlmExecutionTools`
|
|
17
|
+
* - `RemoteAgent` - which is an `Agent` that connects to a Promptbook Agents Server
|
|
17
18
|
*
|
|
18
19
|
* @public exported from `@promptbook/openai`
|
|
19
20
|
*/
|
|
20
21
|
export declare class OpenAiAssistantExecutionTools extends OpenAiExecutionTools implements LlmExecutionTools {
|
|
21
|
-
|
|
22
|
+
readonly assistantId: string_token;
|
|
22
23
|
private readonly isCreatingNewAssistantsAllowed;
|
|
23
24
|
/**
|
|
24
25
|
* Creates OpenAI Execution Tools.
|
|
@@ -32,7 +33,14 @@ export declare class OpenAiAssistantExecutionTools extends OpenAiExecutionTools
|
|
|
32
33
|
* Calls OpenAI API to use a chat model.
|
|
33
34
|
*/
|
|
34
35
|
callChatModel(prompt: Pick<Prompt, 'content' | 'parameters' | 'modelRequirements' | 'format'>): Promise<ChatPromptResult>;
|
|
35
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Calls OpenAI API to use a chat model with streaming.
|
|
38
|
+
*/
|
|
39
|
+
callChatModelStream(prompt: Pick<Prompt, 'content' | 'parameters' | 'modelRequirements' | 'format'>, onProgress: (chunk: ChatPromptResult) => void): Promise<ChatPromptResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Get an existing assistant tool wrapper
|
|
42
|
+
*/
|
|
43
|
+
getAssistant(assistantId: string_token): OpenAiAssistantExecutionTools;
|
|
36
44
|
createNewAssistant(options: {
|
|
37
45
|
/**
|
|
38
46
|
* Name of the new assistant
|
|
@@ -47,6 +55,24 @@ export declare class OpenAiAssistantExecutionTools extends OpenAiExecutionTools
|
|
|
47
55
|
*/
|
|
48
56
|
readonly knowledgeSources?: ReadonlyArray<string>;
|
|
49
57
|
}): Promise<OpenAiAssistantExecutionTools>;
|
|
58
|
+
updateAssistant(options: {
|
|
59
|
+
/**
|
|
60
|
+
* ID of the assistant to update
|
|
61
|
+
*/
|
|
62
|
+
readonly assistantId: string_token;
|
|
63
|
+
/**
|
|
64
|
+
* Name of the assistant
|
|
65
|
+
*/
|
|
66
|
+
readonly name?: string_title;
|
|
67
|
+
/**
|
|
68
|
+
* Instructions for the assistant
|
|
69
|
+
*/
|
|
70
|
+
readonly instructions?: string_markdown;
|
|
71
|
+
/**
|
|
72
|
+
* Optional list of knowledge source links (URLs or file paths) to attach to the assistant via vector store
|
|
73
|
+
*/
|
|
74
|
+
readonly knowledgeSources?: ReadonlyArray<string>;
|
|
75
|
+
}): Promise<OpenAiAssistantExecutionTools>;
|
|
50
76
|
/**
|
|
51
77
|
* Discriminant for type guards
|
|
52
78
|
*/
|
|
@@ -9,7 +9,7 @@ type AgentsServerOptions = {
|
|
|
9
9
|
port: number_port;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* [🐱🚀]
|
|
13
13
|
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
14
14
|
*
|
|
15
15
|
* You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
|
|
@@ -17,7 +17,7 @@ type AgentsServerOptions = {
|
|
|
17
17
|
*
|
|
18
18
|
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
19
19
|
* @public exported from `@promptbook/remote-server`
|
|
20
|
-
* <- TODO:
|
|
20
|
+
* <- TODO: [🐱🚀] Change to `@promptbook/agent-server`
|
|
21
21
|
*/
|
|
22
22
|
export declare function startAgentServer(options: AgentsServerOptions): Promise<TODO_any>;
|
|
23
23
|
export {};
|
|
@@ -11,8 +11,7 @@ import type { RemoteServerOptions } from './types/RemoteServerOptions';
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function startRemoteServer<TCustomOptions = undefined>(options: RemoteServerOptions<TCustomOptions>): RemoteServer;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
* TODO: !!!! Allow to chat with agents directly via remote server
|
|
14
|
+
|
|
16
15
|
* TODO: [🕋] Use here `aboutPromptbookInformation`
|
|
17
16
|
* TODO: [🌡] Add CORS and security - probably via `helmet`
|
|
18
17
|
* TODO: Split this file into multiple functions - handler for each request
|
|
@@ -7,7 +7,7 @@ import type { Registration } from '../../utils/misc/$Register';
|
|
|
7
7
|
* @public exported from `@promptbook/wizard`
|
|
8
8
|
* @public exported from `@promptbook/cli`
|
|
9
9
|
*
|
|
10
|
-
* TODO:
|
|
10
|
+
* TODO: [🧠] Which package should export this?
|
|
11
11
|
*/
|
|
12
12
|
export declare const _OpenAiSdkTranspilerRegistration: Registration;
|
|
13
13
|
/**
|
|
@@ -148,6 +148,12 @@ export type string_agent_name = string;
|
|
|
148
148
|
* For example `"My AI Assistant"`
|
|
149
149
|
*/
|
|
150
150
|
export type string_agent_name_in_book = string;
|
|
151
|
+
/**
|
|
152
|
+
* Semantic helper
|
|
153
|
+
*
|
|
154
|
+
* For example `"b126926439c5fcb83609888a11283723c1ef137c0ad599a77a1be81812bd221d"`
|
|
155
|
+
*/
|
|
156
|
+
export type string_agent_hash = string_sha256;
|
|
151
157
|
/**
|
|
152
158
|
* Unstructured description of the persona
|
|
153
159
|
*
|
|
@@ -59,6 +59,13 @@ export declare class Color {
|
|
|
59
59
|
* @returns Color object
|
|
60
60
|
*/
|
|
61
61
|
private static fromHex3;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a new Color instance from color in hex format with 4 digits (with alpha channel)
|
|
64
|
+
*
|
|
65
|
+
* @param color in hex for example `09df`
|
|
66
|
+
* @returns Color object
|
|
67
|
+
*/
|
|
68
|
+
private static fromHex4;
|
|
62
69
|
/**
|
|
63
70
|
* Creates a new Color instance from color in hex format with 6 color digits (without alpha channel)
|
|
64
71
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { chococake } from '../organization/really_any';
|
|
2
2
|
/**
|
|
3
3
|
* Safely retrieves the global scope object (window in browser, global in Node.js)
|
|
4
4
|
* regardless of the JavaScript environment in which the code is running
|
|
@@ -7,4 +7,4 @@ import type { really_any } from '../organization/really_any';
|
|
|
7
7
|
*
|
|
8
8
|
* @private internal function of `$Register`
|
|
9
9
|
*/
|
|
10
|
-
export declare function $getGlobalScope():
|
|
10
|
+
export declare function $getGlobalScope(): chococake;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { string_sha256 } from '../../types/typeAliases';
|
|
2
|
+
import { really_unknown } from '../organization/really_unknown';
|
|
3
|
+
/**
|
|
4
|
+
* Computes SHA-256 hash of the given object
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/utils`
|
|
7
|
+
*/
|
|
8
|
+
export declare function computeHash(value: really_unknown): string_sha256;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: [🥬][🥬] Use this ACRY
|
|
11
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,6 +9,8 @@ export type string_kebab_case = string;
|
|
|
9
9
|
/**
|
|
10
10
|
* Converts a given text to kebab-case format.
|
|
11
11
|
*
|
|
12
|
+
* Note: [🔂] This function is idempotent.
|
|
13
|
+
*
|
|
12
14
|
* @param text The text to be converted.
|
|
13
15
|
* @returns The kebab-case formatted string.
|
|
14
16
|
* @example 'hello-world'
|
|
@@ -9,6 +9,8 @@ export type string_camelCase = string;
|
|
|
9
9
|
/**
|
|
10
10
|
* Normalizes a given text to camelCase format.
|
|
11
11
|
*
|
|
12
|
+
* Note: [🔂] This function is idempotent.
|
|
13
|
+
*
|
|
12
14
|
* @param text The text to be normalized.
|
|
13
15
|
* @param _isFirstLetterCapital Whether the first letter should be capitalized.
|
|
14
16
|
* @returns The camelCase formatted string.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts a title string into a normalized name.
|
|
3
3
|
*
|
|
4
|
+
* Note: [🔂] This function is idempotent.
|
|
5
|
+
*
|
|
4
6
|
* @param value The title string to be converted to a name.
|
|
5
7
|
* @returns A normalized name derived from the input title.
|
|
6
8
|
* @example 'Hello World!' -> 'hello-world'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { chococake } from './really_any';
|
|
2
2
|
/**
|
|
3
3
|
* Just says that the variable is not used directlys but should be kept because the existence of the variable is important
|
|
4
4
|
*
|
|
@@ -6,4 +6,4 @@ import type { really_any } from './really_any';
|
|
|
6
6
|
* @returns void
|
|
7
7
|
* @private within the repository
|
|
8
8
|
*/
|
|
9
|
-
export declare function $sideEffect(...sideEffectSubjects: ReadonlyArray<
|
|
9
|
+
export declare function $sideEffect(...sideEffectSubjects: ReadonlyArray<chococake>): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { chococake } from './really_any';
|
|
2
2
|
/**
|
|
3
3
|
* Organizational helper to mark a function that produces side effects
|
|
4
4
|
*
|
|
5
5
|
* @private within the repository
|
|
6
6
|
*/
|
|
7
|
-
export type $side_effect = void |
|
|
7
|
+
export type $side_effect = void | chococake;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { chococake } from './really_any';
|
|
2
2
|
/**
|
|
3
3
|
* Just marks a place of place where should be something implemented
|
|
4
4
|
* No side effects.
|
|
@@ -9,4 +9,4 @@ import type { really_any } from './really_any';
|
|
|
9
9
|
* @returns void
|
|
10
10
|
* @private within the repository
|
|
11
11
|
*/
|
|
12
|
-
export declare function TODO_USE(...value: ReadonlyArray<
|
|
12
|
+
export declare function TODO_USE(...value: ReadonlyArray<chococake>): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { chococake } from './really_any';
|
|
2
2
|
/**
|
|
3
3
|
* Just says that the variable is not used but should be kept
|
|
4
4
|
* No side effects.
|
|
@@ -13,4 +13,4 @@ import type { really_any } from './really_any';
|
|
|
13
13
|
* @returns void
|
|
14
14
|
* @private within the repository
|
|
15
15
|
*/
|
|
16
|
-
export declare function keepUnused<TTypeToKeep1 =
|
|
16
|
+
export declare function keepUnused<TTypeToKeep1 = chococake, TTypeToKeep2 = chococake, TTypeToKeep3 = chococake>(...valuesToKeep: ReadonlyArray<chococake>): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { chococake } from './really_any';
|
|
2
2
|
/**
|
|
3
3
|
* Does nothing, but preserves the function in the bundle
|
|
4
4
|
* Compiler is tricked into thinking the function is used
|
|
@@ -7,7 +7,7 @@ import type { really_any } from './really_any';
|
|
|
7
7
|
* @returns nothing
|
|
8
8
|
* @private within the repository
|
|
9
9
|
*/
|
|
10
|
-
export declare function $preserve(...value: Array<
|
|
10
|
+
export declare function $preserve(...value: Array<chococake>): void;
|
|
11
11
|
/**
|
|
12
12
|
* DO NOT USE THIS FUNCTION
|
|
13
13
|
* Only purpose of this function is to trick the compiler and javascript engine
|
|
@@ -15,7 +15,7 @@ export declare function $preserve(...value: Array<really_any>): void;
|
|
|
15
15
|
*
|
|
16
16
|
* @private internal for `preserve`
|
|
17
17
|
*/
|
|
18
|
-
export declare function __DO_NOT_USE_getPreserved(): Array<
|
|
18
|
+
export declare function __DO_NOT_USE_getPreserved(): Array<chococake>;
|
|
19
19
|
/**
|
|
20
20
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21
21
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { chococake } from '../organization/really_any';
|
|
2
2
|
/**
|
|
3
3
|
* Function `asSerializable` will convert values which are not serializable to serializable values
|
|
4
4
|
* It walks deeply through the object and converts all values
|
|
@@ -12,4 +12,4 @@ import type { really_any } from '../organization/really_any';
|
|
|
12
12
|
*
|
|
13
13
|
* @private Internal helper function
|
|
14
14
|
*/
|
|
15
|
-
export declare function asSerializable(value:
|
|
15
|
+
export declare function asSerializable(value: chococake): chococake;
|
|
@@ -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-48`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-server",
|
|
3
|
-
"version": "0.103.0-
|
|
3
|
+
"version": "0.103.0-49",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"module": "./esm/index.es.js",
|
|
96
96
|
"typings": "./esm/typings/src/_packages/remote-server.index.d.ts",
|
|
97
97
|
"peerDependencies": {
|
|
98
|
-
"@promptbook/core": "0.103.0-
|
|
98
|
+
"@promptbook/core": "0.103.0-49"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
101
|
"colors": "^1.4.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
* @generated
|
|
48
48
|
* @see https://github.com/webgptorg/promptbook
|
|
49
49
|
*/
|
|
50
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
50
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-49';
|
|
51
51
|
/**
|
|
52
52
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
53
53
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -383,6 +383,9 @@
|
|
|
383
383
|
if (hex.length === 3) {
|
|
384
384
|
return Color.fromHex3(hex);
|
|
385
385
|
}
|
|
386
|
+
if (hex.length === 4) {
|
|
387
|
+
return Color.fromHex4(hex);
|
|
388
|
+
}
|
|
386
389
|
if (hex.length === 6) {
|
|
387
390
|
return Color.fromHex6(hex);
|
|
388
391
|
}
|
|
@@ -403,6 +406,19 @@
|
|
|
403
406
|
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
404
407
|
return take(new Color(r, g, b));
|
|
405
408
|
}
|
|
409
|
+
/**
|
|
410
|
+
* Creates a new Color instance from color in hex format with 4 digits (with alpha channel)
|
|
411
|
+
*
|
|
412
|
+
* @param color in hex for example `09df`
|
|
413
|
+
* @returns Color object
|
|
414
|
+
*/
|
|
415
|
+
static fromHex4(hex) {
|
|
416
|
+
const r = parseInt(hex.substr(0, 1), 16) * 16;
|
|
417
|
+
const g = parseInt(hex.substr(1, 1), 16) * 16;
|
|
418
|
+
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
419
|
+
const a = parseInt(hex.substr(3, 1), 16) * 16;
|
|
420
|
+
return take(new Color(r, g, b, a));
|
|
421
|
+
}
|
|
406
422
|
/**
|
|
407
423
|
* Creates a new Color instance from color in hex format with 6 color digits (without alpha channel)
|
|
408
424
|
*
|
|
@@ -593,7 +609,8 @@
|
|
|
593
609
|
* @returns true if the value is a valid hex color string (e.g., `#009edd`, `#fff`, etc.)
|
|
594
610
|
*/
|
|
595
611
|
static isHexColorString(value) {
|
|
596
|
-
return typeof value === 'string' &&
|
|
612
|
+
return (typeof value === 'string' &&
|
|
613
|
+
/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(value));
|
|
597
614
|
}
|
|
598
615
|
/**
|
|
599
616
|
* Creates new Color object
|
|
@@ -928,6 +945,7 @@
|
|
|
928
945
|
({
|
|
929
946
|
TITLE: Color.fromHex('#244EA8'),
|
|
930
947
|
LINE: Color.fromHex('#eeeeee'),
|
|
948
|
+
SEPARATOR: Color.fromHex('#cccccc'),
|
|
931
949
|
COMMITMENT: Color.fromHex('#DA0F78'),
|
|
932
950
|
PARAMETER: Color.fromHex('#8e44ad'),
|
|
933
951
|
});
|
|
@@ -1299,7 +1317,7 @@
|
|
|
1299
1317
|
*/
|
|
1300
1318
|
|
|
1301
1319
|
/**
|
|
1302
|
-
*
|
|
1320
|
+
* [🐱🚀]
|
|
1303
1321
|
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
1304
1322
|
*
|
|
1305
1323
|
* You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
|
|
@@ -1307,11 +1325,11 @@
|
|
|
1307
1325
|
*
|
|
1308
1326
|
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
1309
1327
|
* @public exported from `@promptbook/remote-server`
|
|
1310
|
-
* <- TODO:
|
|
1328
|
+
* <- TODO: [🐱🚀] Change to `@promptbook/agent-server`
|
|
1311
1329
|
*/
|
|
1312
1330
|
async function startAgentServer(options) {
|
|
1313
1331
|
const { port = 4440 } = options;
|
|
1314
|
-
// TODO:
|
|
1332
|
+
// TODO: [🐱🚀] [🌕]
|
|
1315
1333
|
const agentsServerRoot = path.join(__dirname, '../apps/agents-server');
|
|
1316
1334
|
console.trace(`!!! Starting agents server on port ${port}...`);
|
|
1317
1335
|
console.log(`!!! cwd`, process.cwd());
|
|
@@ -1548,7 +1566,7 @@
|
|
|
1548
1566
|
}
|
|
1549
1567
|
}
|
|
1550
1568
|
/**
|
|
1551
|
-
* TODO:
|
|
1569
|
+
* TODO: [🐱🚀] Explain that NotFoundError ([🐱🚀] and other specific errors) has priority over DatabaseError in some contexts
|
|
1552
1570
|
*/
|
|
1553
1571
|
|
|
1554
1572
|
/**
|
|
@@ -2236,7 +2254,7 @@
|
|
|
2236
2254
|
TODO: [🧠] Is there a better implementation?
|
|
2237
2255
|
> const propertyNames = Object.getOwnPropertyNames(objectValue);
|
|
2238
2256
|
> for (const propertyName of propertyNames) {
|
|
2239
|
-
> const value = (objectValue as
|
|
2257
|
+
> const value = (objectValue as chococake)[propertyName];
|
|
2240
2258
|
> if (value && typeof value === 'object') {
|
|
2241
2259
|
> deepClone(value);
|
|
2242
2260
|
> }
|
|
@@ -4608,6 +4626,8 @@
|
|
|
4608
4626
|
/**
|
|
4609
4627
|
* Converts a given text to kebab-case format.
|
|
4610
4628
|
*
|
|
4629
|
+
* Note: [🔂] This function is idempotent.
|
|
4630
|
+
*
|
|
4611
4631
|
* @param text The text to be converted.
|
|
4612
4632
|
* @returns The kebab-case formatted string.
|
|
4613
4633
|
* @example 'hello-world'
|
|
@@ -4763,6 +4783,8 @@
|
|
|
4763
4783
|
/**
|
|
4764
4784
|
* Converts a title string into a normalized name.
|
|
4765
4785
|
*
|
|
4786
|
+
* Note: [🔂] This function is idempotent.
|
|
4787
|
+
*
|
|
4766
4788
|
* @param value The title string to be converted to a name.
|
|
4767
4789
|
* @returns A normalized name derived from the input title.
|
|
4768
4790
|
* @example 'Hello World!' -> 'hello-world'
|
|
@@ -7865,6 +7887,8 @@
|
|
|
7865
7887
|
/**
|
|
7866
7888
|
* Normalizes a given text to camelCase format.
|
|
7867
7889
|
*
|
|
7890
|
+
* Note: [🔂] This function is idempotent.
|
|
7891
|
+
*
|
|
7868
7892
|
* @param text The text to be normalized.
|
|
7869
7893
|
* @param _isFirstLetterCapital Whether the first letter should be capitalized.
|
|
7870
7894
|
* @returns The camelCase formatted string.
|
|
@@ -7991,6 +8015,9 @@
|
|
|
7991
8015
|
}
|
|
7992
8016
|
|
|
7993
8017
|
/**
|
|
8018
|
+
* Normalizes a given text to PascalCase format.
|
|
8019
|
+
*
|
|
8020
|
+
* Note: [🔂] This function is idempotent.
|
|
7994
8021
|
*
|
|
7995
8022
|
* @param text @public exported from `@promptbook/utils`
|
|
7996
8023
|
* @returns
|
|
@@ -9640,8 +9667,7 @@
|
|
|
9640
9667
|
};
|
|
9641
9668
|
}
|
|
9642
9669
|
/**
|
|
9643
|
-
|
|
9644
|
-
* TODO: !!!! Allow to chat with agents directly via remote server
|
|
9670
|
+
|
|
9645
9671
|
* TODO: [🕋] Use here `aboutPromptbookInformation`
|
|
9646
9672
|
* TODO: [🌡] Add CORS and security - probably via `helmet`
|
|
9647
9673
|
* TODO: Split this file into multiple functions - handler for each request
|