@promptbook/node 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 +31 -4
- 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 +31 -4
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -28,7 +28,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
28
28
|
* @generated
|
|
29
29
|
* @see https://github.com/webgptorg/promptbook
|
|
30
30
|
*/
|
|
31
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
31
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-49';
|
|
32
32
|
/**
|
|
33
33
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
34
34
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -364,6 +364,9 @@ class Color {
|
|
|
364
364
|
if (hex.length === 3) {
|
|
365
365
|
return Color.fromHex3(hex);
|
|
366
366
|
}
|
|
367
|
+
if (hex.length === 4) {
|
|
368
|
+
return Color.fromHex4(hex);
|
|
369
|
+
}
|
|
367
370
|
if (hex.length === 6) {
|
|
368
371
|
return Color.fromHex6(hex);
|
|
369
372
|
}
|
|
@@ -384,6 +387,19 @@ class Color {
|
|
|
384
387
|
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
385
388
|
return take(new Color(r, g, b));
|
|
386
389
|
}
|
|
390
|
+
/**
|
|
391
|
+
* Creates a new Color instance from color in hex format with 4 digits (with alpha channel)
|
|
392
|
+
*
|
|
393
|
+
* @param color in hex for example `09df`
|
|
394
|
+
* @returns Color object
|
|
395
|
+
*/
|
|
396
|
+
static fromHex4(hex) {
|
|
397
|
+
const r = parseInt(hex.substr(0, 1), 16) * 16;
|
|
398
|
+
const g = parseInt(hex.substr(1, 1), 16) * 16;
|
|
399
|
+
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
400
|
+
const a = parseInt(hex.substr(3, 1), 16) * 16;
|
|
401
|
+
return take(new Color(r, g, b, a));
|
|
402
|
+
}
|
|
387
403
|
/**
|
|
388
404
|
* Creates a new Color instance from color in hex format with 6 color digits (without alpha channel)
|
|
389
405
|
*
|
|
@@ -574,7 +590,8 @@ class Color {
|
|
|
574
590
|
* @returns true if the value is a valid hex color string (e.g., `#009edd`, `#fff`, etc.)
|
|
575
591
|
*/
|
|
576
592
|
static isHexColorString(value) {
|
|
577
|
-
return typeof value === 'string' &&
|
|
593
|
+
return (typeof value === 'string' &&
|
|
594
|
+
/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(value));
|
|
578
595
|
}
|
|
579
596
|
/**
|
|
580
597
|
* Creates new Color object
|
|
@@ -901,6 +918,7 @@ const PROMPTBOOK_COLOR = Color.fromHex('#79EAFD');
|
|
|
901
918
|
({
|
|
902
919
|
TITLE: Color.fromHex('#244EA8'),
|
|
903
920
|
LINE: Color.fromHex('#eeeeee'),
|
|
921
|
+
SEPARATOR: Color.fromHex('#cccccc'),
|
|
904
922
|
COMMITMENT: Color.fromHex('#DA0F78'),
|
|
905
923
|
PARAMETER: Color.fromHex('#8e44ad'),
|
|
906
924
|
});
|
|
@@ -1453,7 +1471,7 @@ function deepClone(objectValue) {
|
|
|
1453
1471
|
TODO: [🧠] Is there a better implementation?
|
|
1454
1472
|
> const propertyNames = Object.getOwnPropertyNames(objectValue);
|
|
1455
1473
|
> for (const propertyName of propertyNames) {
|
|
1456
|
-
> const value = (objectValue as
|
|
1474
|
+
> const value = (objectValue as chococake)[propertyName];
|
|
1457
1475
|
> if (value && typeof value === 'object') {
|
|
1458
1476
|
> deepClone(value);
|
|
1459
1477
|
> }
|
|
@@ -2628,7 +2646,7 @@ class DatabaseError extends Error {
|
|
|
2628
2646
|
}
|
|
2629
2647
|
}
|
|
2630
2648
|
/**
|
|
2631
|
-
* TODO:
|
|
2649
|
+
* TODO: [🐱🚀] Explain that NotFoundError ([🐱🚀] and other specific errors) has priority over DatabaseError in some contexts
|
|
2632
2650
|
*/
|
|
2633
2651
|
|
|
2634
2652
|
/**
|
|
@@ -6450,6 +6468,8 @@ function $registeredScrapersMessage(availableScrapers) {
|
|
|
6450
6468
|
/**
|
|
6451
6469
|
* Converts a given text to kebab-case format.
|
|
6452
6470
|
*
|
|
6471
|
+
* Note: [🔂] This function is idempotent.
|
|
6472
|
+
*
|
|
6453
6473
|
* @param text The text to be converted.
|
|
6454
6474
|
* @returns The kebab-case formatted string.
|
|
6455
6475
|
* @example 'hello-world'
|
|
@@ -6605,6 +6625,8 @@ function removeEmojis(text) {
|
|
|
6605
6625
|
/**
|
|
6606
6626
|
* Converts a title string into a normalized name.
|
|
6607
6627
|
*
|
|
6628
|
+
* Note: [🔂] This function is idempotent.
|
|
6629
|
+
*
|
|
6608
6630
|
* @param value The title string to be converted to a name.
|
|
6609
6631
|
* @returns A normalized name derived from the input title.
|
|
6610
6632
|
* @example 'Hello World!' -> 'hello-world'
|
|
@@ -7887,6 +7909,8 @@ const expectCommandParser = {
|
|
|
7887
7909
|
/**
|
|
7888
7910
|
* Normalizes a given text to camelCase format.
|
|
7889
7911
|
*
|
|
7912
|
+
* Note: [🔂] This function is idempotent.
|
|
7913
|
+
*
|
|
7890
7914
|
* @param text The text to be normalized.
|
|
7891
7915
|
* @param _isFirstLetterCapital Whether the first letter should be capitalized.
|
|
7892
7916
|
* @returns The camelCase formatted string.
|
|
@@ -11666,6 +11690,9 @@ function nameToUriParts(name) {
|
|
|
11666
11690
|
}
|
|
11667
11691
|
|
|
11668
11692
|
/**
|
|
11693
|
+
* Normalizes a given text to PascalCase format.
|
|
11694
|
+
*
|
|
11695
|
+
* Note: [🔂] This function is idempotent.
|
|
11669
11696
|
*
|
|
11670
11697
|
* @param text @public exported from `@promptbook/utils`
|
|
11671
11698
|
* @returns
|