@promptbook/core 0.89.0-5 → 0.89.0-7
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 +45 -12
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +8 -4
- package/esm/typings/src/_packages/remote-client.index.d.ts +0 -2
- package/esm/typings/src/cli/common/$addGlobalOptionsToCommand.d.ts +7 -0
- package/esm/typings/src/cli/common/$provideLlmToolsForCli.d.ts +15 -0
- package/esm/typings/src/config.d.ts +15 -8
- package/esm/typings/src/errors/0-index.d.ts +3 -0
- package/esm/typings/src/errors/AuthenticationError.d.ts +9 -0
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizzardOrCli.d.ts +34 -1
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +1 -1
- package/esm/typings/src/remote-server/types/RemoteClientOptions.d.ts +2 -10
- package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +30 -2
- package/package.json +1 -1
- package/umd/index.umd.js +48 -13
- package/umd/index.umd.js.map +1 -1
|
@@ -25,9 +25,10 @@ import { DEFAULT_BOOKS_DIRNAME } from '../config';
|
|
|
25
25
|
import { DEFAULT_DOWNLOAD_CACHE_DIRNAME } from '../config';
|
|
26
26
|
import { DEFAULT_EXECUTION_CACHE_DIRNAME } from '../config';
|
|
27
27
|
import { DEFAULT_SCRAPE_CACHE_DIRNAME } from '../config';
|
|
28
|
+
import { CLI_APP_ID } from '../config';
|
|
29
|
+
import { PLAYGROUND_APP_ID } from '../config';
|
|
28
30
|
import { DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME } from '../config';
|
|
29
|
-
import {
|
|
30
|
-
import { DEFAULT_REMOTE_URL_PATH } from '../config';
|
|
31
|
+
import { DEFAULT_REMOTE_SERVER_URL } from '../config';
|
|
31
32
|
import { DEFAULT_CSV_SETTINGS } from '../config';
|
|
32
33
|
import { DEFAULT_IS_VERBOSE } from '../config';
|
|
33
34
|
import { SET_IS_VERBOSE } from '../config';
|
|
@@ -46,6 +47,7 @@ import type { CallbackInterfaceToolsOptions } from '../dialogs/callback/Callback
|
|
|
46
47
|
import { BoilerplateError } from '../errors/0-BoilerplateError';
|
|
47
48
|
import { PROMPTBOOK_ERRORS } from '../errors/0-index';
|
|
48
49
|
import { AbstractFormatError } from '../errors/AbstractFormatError';
|
|
50
|
+
import { AuthenticationError } from '../errors/AuthenticationError';
|
|
49
51
|
import { CollectionError } from '../errors/CollectionError';
|
|
50
52
|
import { EnvironmentMismatchError } from '../errors/EnvironmentMismatchError';
|
|
51
53
|
import { ExpectError } from '../errors/ExpectError';
|
|
@@ -157,9 +159,10 @@ export { DEFAULT_BOOKS_DIRNAME };
|
|
|
157
159
|
export { DEFAULT_DOWNLOAD_CACHE_DIRNAME };
|
|
158
160
|
export { DEFAULT_EXECUTION_CACHE_DIRNAME };
|
|
159
161
|
export { DEFAULT_SCRAPE_CACHE_DIRNAME };
|
|
162
|
+
export { CLI_APP_ID };
|
|
163
|
+
export { PLAYGROUND_APP_ID };
|
|
160
164
|
export { DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME };
|
|
161
|
-
export {
|
|
162
|
-
export { DEFAULT_REMOTE_URL_PATH };
|
|
165
|
+
export { DEFAULT_REMOTE_SERVER_URL };
|
|
163
166
|
export { DEFAULT_CSV_SETTINGS };
|
|
164
167
|
export { DEFAULT_IS_VERBOSE };
|
|
165
168
|
export { SET_IS_VERBOSE };
|
|
@@ -178,6 +181,7 @@ export type { CallbackInterfaceToolsOptions };
|
|
|
178
181
|
export { BoilerplateError };
|
|
179
182
|
export { PROMPTBOOK_ERRORS };
|
|
180
183
|
export { AbstractFormatError };
|
|
184
|
+
export { AuthenticationError };
|
|
181
185
|
export { CollectionError };
|
|
182
186
|
export { EnvironmentMismatchError };
|
|
183
187
|
export { ExpectError };
|
|
@@ -6,7 +6,6 @@ import type { PromptbookServer_Identification } from '../remote-server/socket-ty
|
|
|
6
6
|
import type { PromptbookServer_ApplicationIdentification } from '../remote-server/socket-types/_subtypes/PromptbookServer_Identification';
|
|
7
7
|
import type { PromptbookServer_AnonymousIdentification } from '../remote-server/socket-types/_subtypes/PromptbookServer_Identification';
|
|
8
8
|
import type { RemoteClientOptions } from '../remote-server/types/RemoteClientOptions';
|
|
9
|
-
import type { RemoteServerOptions } from '../remote-server/types/RemoteServerOptions';
|
|
10
9
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
11
10
|
export { compilePipelineOnRemoteServer };
|
|
12
11
|
export { RemoteLlmExecutionTools };
|
|
@@ -15,4 +14,3 @@ export type { PromptbookServer_Identification };
|
|
|
15
14
|
export type { PromptbookServer_ApplicationIdentification };
|
|
16
15
|
export type { PromptbookServer_AnonymousIdentification };
|
|
17
16
|
export type { RemoteClientOptions };
|
|
18
|
-
export type { RemoteServerOptions };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Note: `$` is used to indicate that this function is not a pure function - it registers an option in the CLI
|
|
4
|
+
*
|
|
5
|
+
* @private utility of CLI
|
|
6
|
+
*/
|
|
7
|
+
export declare function $addGlobalOptionsToCommand(command: Command): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CacheLlmToolsOptions } from '../../llm-providers/_common/utils/cache/CacheLlmToolsOptions';
|
|
2
|
+
import type { string_url } from '../../types/typeAliases';
|
|
3
|
+
type ProvideLlmToolsForCliOptions = Pick<CacheLlmToolsOptions, 'isCacheReloaded'> & {
|
|
4
|
+
cliOptions: {
|
|
5
|
+
verbose: boolean;
|
|
6
|
+
interactive: boolean;
|
|
7
|
+
provider: 'BYOK' | 'BRING_YOUR_OWN_KEYS' | 'REMOTE_SERVER' | 'RS' | string;
|
|
8
|
+
remoteServerUrl: string_url;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @private utility of CLI
|
|
13
|
+
*/
|
|
14
|
+
export declare function $provideLlmToolsForCli(options: ProvideLlmToolsForCliOptions): Promise<import("../../_packages/types.index").LlmExecutionToolsWithTotalUsage>;
|
|
15
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CsvSettings } from './formats/csv/CsvSettings';
|
|
2
2
|
import type { IntermediateFilesStrategy } from './types/IntermediateFilesStrategy';
|
|
3
|
+
import type { string_app_id } from './types/typeAliases';
|
|
3
4
|
import type { string_email } from './types/typeAliases';
|
|
4
5
|
import type { string_name } from './types/typeAliases';
|
|
5
6
|
import type { string_url_image } from './types/typeAliases';
|
|
@@ -208,6 +209,18 @@ export declare const DEFAULT_EXECUTION_CACHE_DIRNAME = "./.promptbook/execution-
|
|
|
208
209
|
* @public exported from `@promptbook/core`
|
|
209
210
|
*/
|
|
210
211
|
export declare const DEFAULT_SCRAPE_CACHE_DIRNAME = "./.promptbook/scrape-cache";
|
|
212
|
+
/**
|
|
213
|
+
* Id of application for the CLI when using remote server
|
|
214
|
+
*
|
|
215
|
+
* @public exported from `@promptbook/core`
|
|
216
|
+
*/
|
|
217
|
+
export declare const CLI_APP_ID: string_app_id;
|
|
218
|
+
/**
|
|
219
|
+
* Id of application for the playground
|
|
220
|
+
*
|
|
221
|
+
* @public exported from `@promptbook/core`
|
|
222
|
+
*/
|
|
223
|
+
export declare const PLAYGROUND_APP_ID: string_app_id;
|
|
211
224
|
/**
|
|
212
225
|
* The name of the builded pipeline collection made by CLI `ptbk make` and for lookup in `createCollectionFromDirectory`
|
|
213
226
|
*
|
|
@@ -228,13 +241,7 @@ export declare const MOMENT_ARG_THRESHOLDS: {
|
|
|
228
241
|
*
|
|
229
242
|
* @public exported from `@promptbook/core`
|
|
230
243
|
*/
|
|
231
|
-
export declare const
|
|
232
|
-
/**
|
|
233
|
-
* @@@
|
|
234
|
-
*
|
|
235
|
-
* @public exported from `@promptbook/core`
|
|
236
|
-
*/
|
|
237
|
-
export declare const DEFAULT_REMOTE_URL_PATH = "/promptbook/socket.io";
|
|
244
|
+
export declare const DEFAULT_REMOTE_SERVER_URL = "https://api.pavolhejny.com/promptbook";
|
|
238
245
|
/**
|
|
239
246
|
* @@@
|
|
240
247
|
*
|
|
@@ -281,5 +288,5 @@ export declare const IS_PIPELINE_LOGIC_VALIDATED: boolean;
|
|
|
281
288
|
export declare const IS_COST_PREVENTED: boolean;
|
|
282
289
|
/**
|
|
283
290
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
284
|
-
* TODO: [🧠][🧜♂️] Maybe join
|
|
291
|
+
* TODO: [🧠][🧜♂️] Maybe join remoteServerUrl and path into single value
|
|
285
292
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CsvFormatError } from '../formats/csv/CsvFormatError';
|
|
2
2
|
import { AbstractFormatError } from './AbstractFormatError';
|
|
3
|
+
import { AuthenticationError } from './AuthenticationError';
|
|
3
4
|
import { CollectionError } from './CollectionError';
|
|
4
5
|
import { EnvironmentMismatchError } from './EnvironmentMismatchError';
|
|
5
6
|
import { ExpectError } from './ExpectError';
|
|
@@ -49,6 +50,7 @@ export declare const COMMON_JAVASCRIPT_ERRORS: {
|
|
|
49
50
|
readonly TypeError: TypeErrorConstructor;
|
|
50
51
|
readonly URIError: URIErrorConstructor;
|
|
51
52
|
readonly AggregateError: AggregateErrorConstructor;
|
|
53
|
+
readonly AuthenticationError: typeof AuthenticationError;
|
|
52
54
|
};
|
|
53
55
|
/**
|
|
54
56
|
* Index of all errors
|
|
@@ -64,6 +66,7 @@ export declare const ALL_ERRORS: {
|
|
|
64
66
|
readonly TypeError: TypeErrorConstructor;
|
|
65
67
|
readonly URIError: URIErrorConstructor;
|
|
66
68
|
readonly AggregateError: AggregateErrorConstructor;
|
|
69
|
+
readonly AuthenticationError: typeof AuthenticationError;
|
|
67
70
|
readonly AbstractFormatError: typeof AbstractFormatError;
|
|
68
71
|
readonly CsvFormatError: typeof CsvFormatError;
|
|
69
72
|
readonly CollectionError: typeof CollectionError;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthenticationError is thrown from login function which is dependency of remote server
|
|
3
|
+
*
|
|
4
|
+
* @public exported from `@promptbook/core`
|
|
5
|
+
*/
|
|
6
|
+
export declare class AuthenticationError extends Error {
|
|
7
|
+
readonly name = "AuthenticationError";
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
}
|
|
@@ -1,11 +1,44 @@
|
|
|
1
|
+
import { Promisable } from 'type-fest';
|
|
2
|
+
import type { PromptbookServer_Identification } from '../../../remote-server/socket-types/_subtypes/PromptbookServer_Identification';
|
|
3
|
+
import type { really_any } from '../../../utils/organization/really_any';
|
|
4
|
+
import type { string_app_id } from '../../../types/typeAliases';
|
|
5
|
+
import type { string_url } from '../../../types/typeAliases';
|
|
1
6
|
import type { CacheLlmToolsOptions } from '../utils/cache/CacheLlmToolsOptions';
|
|
2
7
|
import type { LlmExecutionToolsWithTotalUsage } from '../utils/count-total-usage/LlmExecutionToolsWithTotalUsage';
|
|
8
|
+
type ProvideLlmToolsForWizzardOrCliOptions = Pick<CacheLlmToolsOptions, 'isCacheReloaded'> & ({
|
|
9
|
+
/**
|
|
10
|
+
* Use local keys and execute LLMs directly
|
|
11
|
+
*/
|
|
12
|
+
readonly strategy: 'BRING_YOUR_OWN_KEYS';
|
|
13
|
+
} | {
|
|
14
|
+
/**
|
|
15
|
+
* Do not use local keys but login to Promptbook server and execute LLMs there
|
|
16
|
+
*/
|
|
17
|
+
readonly strategy: 'REMOTE_SERVER';
|
|
18
|
+
/**
|
|
19
|
+
* URL of the remote server
|
|
20
|
+
*
|
|
21
|
+
* @default `DEFAULT_REMOTE_SERVER_URL`
|
|
22
|
+
*/
|
|
23
|
+
readonly remoteServerUrl?: string_url;
|
|
24
|
+
/**
|
|
25
|
+
* Identifier of the application which will be passed to the remote server identification
|
|
26
|
+
*
|
|
27
|
+
* Note: This can be some id or some semantic name like "email-agent"
|
|
28
|
+
*/
|
|
29
|
+
readonly appId: string_app_id;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
loginPrompt(): Promisable<PromptbookServer_Identification<really_any>>;
|
|
34
|
+
});
|
|
3
35
|
/**
|
|
4
36
|
* Returns LLM tools for CLI
|
|
5
37
|
*
|
|
6
38
|
* @private within the repository - for CLI utils
|
|
7
39
|
*/
|
|
8
|
-
export declare function $provideLlmToolsForWizzardOrCli(options?:
|
|
40
|
+
export declare function $provideLlmToolsForWizzardOrCli(options?: ProvideLlmToolsForWizzardOrCliOptions): Promise<LlmExecutionToolsWithTotalUsage>;
|
|
41
|
+
export {};
|
|
9
42
|
/**
|
|
10
43
|
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
11
44
|
* TODO: [👷♂️] @@@ Manual about construction of llmTools
|
package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export type AnthropicClaudeExecutionToolsDirectOptions = CommonToolsOptions & Cl
|
|
|
25
25
|
*/
|
|
26
26
|
export type AnthropicClaudeExecutionToolsProxiedOptions = CommonToolsOptions & ClientOptions & {
|
|
27
27
|
isProxied: true;
|
|
28
|
-
} & Pick<RemoteClientOptions<undefined>, '
|
|
28
|
+
} & Pick<RemoteClientOptions<undefined>, 'remoteServerUrl'>;
|
|
29
29
|
/**
|
|
30
30
|
* TODO: [🧠][🤺] Pass `userId`
|
|
31
31
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
2
2
|
import type { string_base_url } from '../../types/typeAliases';
|
|
3
|
-
import type { string_uri } from '../../types/typeAliases';
|
|
4
3
|
import type { PromptbookServer_Identification } from '../socket-types/_subtypes/PromptbookServer_Identification';
|
|
5
4
|
/**
|
|
6
5
|
* Options for `RemoteLlmExecutionTools`
|
|
@@ -12,14 +11,7 @@ export type RemoteClientOptions<TCustomOptions> = CommonToolsOptions & {
|
|
|
12
11
|
* URL of the remote server
|
|
13
12
|
* On this server will be connected to the socket.io server
|
|
14
13
|
*/
|
|
15
|
-
readonly
|
|
16
|
-
/**
|
|
17
|
-
* Path for the Socket.io server to listen
|
|
18
|
-
*
|
|
19
|
-
* @default '/socket.io'
|
|
20
|
-
* @example '/promptbook/socket.io'
|
|
21
|
-
*/
|
|
22
|
-
readonly path: string_uri;
|
|
14
|
+
readonly remoteServerUrl: string_base_url;
|
|
23
15
|
/**
|
|
24
16
|
* Identification of client for Socket.io remote server
|
|
25
17
|
*/
|
|
@@ -28,5 +20,5 @@ export type RemoteClientOptions<TCustomOptions> = CommonToolsOptions & {
|
|
|
28
20
|
/**
|
|
29
21
|
* TODO: Pass more options from Socket.io to `RemoteClientOptions` (like `transports`)
|
|
30
22
|
* TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
|
|
31
|
-
* TODO: [🧠][🧜♂️] Maybe join
|
|
23
|
+
* TODO: [🧠][🧜♂️] Maybe join remoteServerUrl and path into single value
|
|
32
24
|
*/
|
|
@@ -3,8 +3,11 @@ import type { PipelineCollection } from '../../collection/PipelineCollection';
|
|
|
3
3
|
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
4
4
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
5
5
|
import type { string_app_id } from '../../types/typeAliases';
|
|
6
|
+
import type { string_email } from '../../types/typeAliases';
|
|
7
|
+
import type { string_password } from '../../types/typeAliases';
|
|
6
8
|
import type { string_uri } from '../../types/typeAliases';
|
|
7
9
|
import type { string_user_id } from '../../types/typeAliases';
|
|
10
|
+
import type { PromptbookServer_Identification } from '../socket-types/_subtypes/PromptbookServer_Identification';
|
|
8
11
|
/**
|
|
9
12
|
* @@@
|
|
10
13
|
*
|
|
@@ -16,7 +19,6 @@ import type { string_user_id } from '../../types/typeAliases';
|
|
|
16
19
|
*
|
|
17
20
|
* You can enable both modes at the same time.
|
|
18
21
|
*
|
|
19
|
-
* @public exported from `@promptbook/remote-client`
|
|
20
22
|
* @public exported from `@promptbook/remote-server`
|
|
21
23
|
*/
|
|
22
24
|
export type RemoteServerOptions<TCustomOptions> = CommonToolsOptions & {
|
|
@@ -32,7 +34,7 @@ export type RemoteServerOptions<TCustomOptions> = CommonToolsOptions & {
|
|
|
32
34
|
* @default '/'
|
|
33
35
|
* @example '/api/promptbook/'
|
|
34
36
|
*/
|
|
35
|
-
readonly rootPath
|
|
37
|
+
readonly rootPath?: string_uri;
|
|
36
38
|
} & (AnonymousRemoteServerOptions | ApplicationRemoteServerOptions<TCustomOptions> | (AnonymousRemoteServerOptions & ApplicationRemoteServerOptions<TCustomOptions>));
|
|
37
39
|
export type AnonymousRemoteServerOptions = {
|
|
38
40
|
/**
|
|
@@ -51,6 +53,32 @@ export type ApplicationRemoteServerOptions<TCustomOptions> = {
|
|
|
51
53
|
* This is used to check validity of the prompt to prevent misuse
|
|
52
54
|
*/
|
|
53
55
|
readonly collection: PipelineCollection;
|
|
56
|
+
/**
|
|
57
|
+
* User tries to login to the server, this function will be called verify the user and return the identification or throw an error
|
|
58
|
+
*
|
|
59
|
+
*
|
|
60
|
+
* Note: In most cases, you will return `PromptbookServer_ApplicationIdentification`
|
|
61
|
+
* `PromptbookServer_AnonymousIdentification` is useful only in scenarios when user stores its own api keys on the application server and
|
|
62
|
+
* server acts only as a api key provider
|
|
63
|
+
*
|
|
64
|
+
* @throws `AuthenticationError` if the user is not allowed to login for example because of invalid credentials
|
|
65
|
+
*/
|
|
66
|
+
login(credentials: {
|
|
67
|
+
/**
|
|
68
|
+
* Identifier of the application you are using
|
|
69
|
+
*
|
|
70
|
+
* Note: This is usefull when you use Promptbook remote server for multiple apps/frontends, if its used just for single app, use here just "app" or "your-app-name"
|
|
71
|
+
*/
|
|
72
|
+
readonly appId: string_app_id | null;
|
|
73
|
+
/**
|
|
74
|
+
* Username (for example email) of the user
|
|
75
|
+
*/
|
|
76
|
+
readonly username: string_email | string;
|
|
77
|
+
/**
|
|
78
|
+
* Password of the user
|
|
79
|
+
*/
|
|
80
|
+
readonly password: string_password;
|
|
81
|
+
}): Promise<PromptbookServer_Identification<TCustomOptions>>;
|
|
54
82
|
/**
|
|
55
83
|
* Creates llm execution tools for each client
|
|
56
84
|
*/
|
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* @generated
|
|
28
28
|
* @see https://github.com/webgptorg/promptbook
|
|
29
29
|
*/
|
|
30
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.89.0-
|
|
30
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.89.0-7';
|
|
31
31
|
/**
|
|
32
32
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
33
33
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -572,6 +572,7 @@
|
|
|
572
572
|
*/
|
|
573
573
|
const DEFAULT_BOOKS_DIRNAME = './books';
|
|
574
574
|
// <- TODO: [🕝] Make also `BOOKS_DIRNAME_ALTERNATIVES`
|
|
575
|
+
// TODO: !!!!!! Just .promptbook dir, hardocode others
|
|
575
576
|
/**
|
|
576
577
|
* Where to store the temporary downloads
|
|
577
578
|
*
|
|
@@ -596,6 +597,27 @@
|
|
|
596
597
|
* @public exported from `@promptbook/core`
|
|
597
598
|
*/
|
|
598
599
|
const DEFAULT_SCRAPE_CACHE_DIRNAME = './.promptbook/scrape-cache';
|
|
600
|
+
/**
|
|
601
|
+
* Id of application for the CLI when using remote server
|
|
602
|
+
*
|
|
603
|
+
* @public exported from `@promptbook/core`
|
|
604
|
+
*/
|
|
605
|
+
const CLI_APP_ID = 'cli';
|
|
606
|
+
/**
|
|
607
|
+
* Id of application for the playground
|
|
608
|
+
*
|
|
609
|
+
* @public exported from `@promptbook/core`
|
|
610
|
+
*/
|
|
611
|
+
const PLAYGROUND_APP_ID = 'playground';
|
|
612
|
+
/*
|
|
613
|
+
TODO: [🌃]
|
|
614
|
+
/**
|
|
615
|
+
* Id of application for the wizzard when using remote server
|
|
616
|
+
*
|
|
617
|
+
* @public exported from `@promptbook/core`
|
|
618
|
+
* /
|
|
619
|
+
ex-port const WIZZARD_APP_ID: string_app_id = 'wizzard';
|
|
620
|
+
*/
|
|
599
621
|
/**
|
|
600
622
|
* The name of the builded pipeline collection made by CLI `ptbk make` and for lookup in `createCollectionFromDirectory`
|
|
601
623
|
*
|
|
@@ -616,13 +638,7 @@
|
|
|
616
638
|
*
|
|
617
639
|
* @public exported from `@promptbook/core`
|
|
618
640
|
*/
|
|
619
|
-
const
|
|
620
|
-
/**
|
|
621
|
-
* @@@
|
|
622
|
-
*
|
|
623
|
-
* @public exported from `@promptbook/core`
|
|
624
|
-
*/
|
|
625
|
-
const DEFAULT_REMOTE_URL_PATH = '/promptbook/socket.io';
|
|
641
|
+
const DEFAULT_REMOTE_SERVER_URL = 'https://api.pavolhejny.com/promptbook';
|
|
626
642
|
// <- TODO: [🧜♂️]
|
|
627
643
|
/**
|
|
628
644
|
* @@@
|
|
@@ -674,7 +690,7 @@
|
|
|
674
690
|
true);
|
|
675
691
|
/**
|
|
676
692
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
677
|
-
* TODO: [🧠][🧜♂️] Maybe join
|
|
693
|
+
* TODO: [🧠][🧜♂️] Maybe join remoteServerUrl and path into single value
|
|
678
694
|
*/
|
|
679
695
|
|
|
680
696
|
/**
|
|
@@ -1893,6 +1909,19 @@
|
|
|
1893
1909
|
}
|
|
1894
1910
|
}
|
|
1895
1911
|
|
|
1912
|
+
/**
|
|
1913
|
+
* AuthenticationError is thrown from login function which is dependency of remote server
|
|
1914
|
+
*
|
|
1915
|
+
* @public exported from `@promptbook/core`
|
|
1916
|
+
*/
|
|
1917
|
+
class AuthenticationError extends Error {
|
|
1918
|
+
constructor(message) {
|
|
1919
|
+
super(message);
|
|
1920
|
+
this.name = 'AuthenticationError';
|
|
1921
|
+
Object.setPrototypeOf(this, AuthenticationError.prototype);
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1896
1925
|
/**
|
|
1897
1926
|
* This error indicates that the pipeline collection cannot be propperly loaded
|
|
1898
1927
|
*
|
|
@@ -2021,6 +2050,7 @@
|
|
|
2021
2050
|
TypeError,
|
|
2022
2051
|
URIError,
|
|
2023
2052
|
AggregateError,
|
|
2053
|
+
AuthenticationError,
|
|
2024
2054
|
/*
|
|
2025
2055
|
Note: Not widely supported
|
|
2026
2056
|
> InternalError,
|
|
@@ -2220,6 +2250,10 @@
|
|
|
2220
2250
|
|
|
2221
2251
|
Cannot serialize error with name "${name}"
|
|
2222
2252
|
|
|
2253
|
+
Authors of Promptbook probably forgot to add this error into the list of errors:
|
|
2254
|
+
https://github.com/webgptorg/promptbook/blob/main/src/errors/0-index.ts
|
|
2255
|
+
|
|
2256
|
+
|
|
2223
2257
|
${block(stack || message)}
|
|
2224
2258
|
|
|
2225
2259
|
`));
|
|
@@ -10167,8 +10201,7 @@
|
|
|
10167
10201
|
options: {
|
|
10168
10202
|
apiKey: 'sk-ant-api03-',
|
|
10169
10203
|
isProxied: true,
|
|
10170
|
-
|
|
10171
|
-
path: DEFAULT_REMOTE_URL_PATH,
|
|
10204
|
+
remoteServerUrl: DEFAULT_REMOTE_SERVER_URL,
|
|
10172
10205
|
},
|
|
10173
10206
|
};
|
|
10174
10207
|
},
|
|
@@ -10870,11 +10903,13 @@
|
|
|
10870
10903
|
exports.ADMIN_EMAIL = ADMIN_EMAIL;
|
|
10871
10904
|
exports.ADMIN_GITHUB_NAME = ADMIN_GITHUB_NAME;
|
|
10872
10905
|
exports.AbstractFormatError = AbstractFormatError;
|
|
10906
|
+
exports.AuthenticationError = AuthenticationError;
|
|
10873
10907
|
exports.BOOK_LANGUAGE_VERSION = BOOK_LANGUAGE_VERSION;
|
|
10874
10908
|
exports.BlackholeStorage = BlackholeStorage;
|
|
10875
10909
|
exports.BoilerplateError = BoilerplateError;
|
|
10876
10910
|
exports.BoilerplateFormfactorDefinition = BoilerplateFormfactorDefinition;
|
|
10877
10911
|
exports.CLAIM = CLAIM;
|
|
10912
|
+
exports.CLI_APP_ID = CLI_APP_ID;
|
|
10878
10913
|
exports.CallbackInterfaceTools = CallbackInterfaceTools;
|
|
10879
10914
|
exports.ChatbotFormfactorDefinition = ChatbotFormfactorDefinition;
|
|
10880
10915
|
exports.CollectionError = CollectionError;
|
|
@@ -10896,8 +10931,7 @@
|
|
|
10896
10931
|
exports.DEFAULT_MAX_PARALLEL_COUNT = DEFAULT_MAX_PARALLEL_COUNT;
|
|
10897
10932
|
exports.DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME = DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME;
|
|
10898
10933
|
exports.DEFAULT_PROMPT_TASK_TITLE = DEFAULT_PROMPT_TASK_TITLE;
|
|
10899
|
-
exports.
|
|
10900
|
-
exports.DEFAULT_REMOTE_URL_PATH = DEFAULT_REMOTE_URL_PATH;
|
|
10934
|
+
exports.DEFAULT_REMOTE_SERVER_URL = DEFAULT_REMOTE_SERVER_URL;
|
|
10901
10935
|
exports.DEFAULT_SCRAPE_CACHE_DIRNAME = DEFAULT_SCRAPE_CACHE_DIRNAME;
|
|
10902
10936
|
exports.DEFAULT_TASK_TITLE = DEFAULT_TASK_TITLE;
|
|
10903
10937
|
exports.EXPECTATION_UNITS = EXPECTATION_UNITS;
|
|
@@ -10925,6 +10959,7 @@
|
|
|
10925
10959
|
exports.NotFoundError = NotFoundError;
|
|
10926
10960
|
exports.NotYetImplementedError = NotYetImplementedError;
|
|
10927
10961
|
exports.ORDER_OF_PIPELINE_JSON = ORDER_OF_PIPELINE_JSON;
|
|
10962
|
+
exports.PLAYGROUND_APP_ID = PLAYGROUND_APP_ID;
|
|
10928
10963
|
exports.PROMPTBOOK_ENGINE_VERSION = PROMPTBOOK_ENGINE_VERSION;
|
|
10929
10964
|
exports.PROMPTBOOK_ERRORS = PROMPTBOOK_ERRORS;
|
|
10930
10965
|
exports.ParseError = ParseError;
|