@promptbook/editable 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 +25 -3
- 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 +25 -3
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
17
17
|
* @generated
|
|
18
18
|
* @see https://github.com/webgptorg/promptbook
|
|
19
19
|
*/
|
|
20
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
20
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-49';
|
|
21
21
|
/**
|
|
22
22
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
23
23
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -353,6 +353,9 @@ class Color {
|
|
|
353
353
|
if (hex.length === 3) {
|
|
354
354
|
return Color.fromHex3(hex);
|
|
355
355
|
}
|
|
356
|
+
if (hex.length === 4) {
|
|
357
|
+
return Color.fromHex4(hex);
|
|
358
|
+
}
|
|
356
359
|
if (hex.length === 6) {
|
|
357
360
|
return Color.fromHex6(hex);
|
|
358
361
|
}
|
|
@@ -373,6 +376,19 @@ class Color {
|
|
|
373
376
|
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
374
377
|
return take(new Color(r, g, b));
|
|
375
378
|
}
|
|
379
|
+
/**
|
|
380
|
+
* Creates a new Color instance from color in hex format with 4 digits (with alpha channel)
|
|
381
|
+
*
|
|
382
|
+
* @param color in hex for example `09df`
|
|
383
|
+
* @returns Color object
|
|
384
|
+
*/
|
|
385
|
+
static fromHex4(hex) {
|
|
386
|
+
const r = parseInt(hex.substr(0, 1), 16) * 16;
|
|
387
|
+
const g = parseInt(hex.substr(1, 1), 16) * 16;
|
|
388
|
+
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
389
|
+
const a = parseInt(hex.substr(3, 1), 16) * 16;
|
|
390
|
+
return take(new Color(r, g, b, a));
|
|
391
|
+
}
|
|
376
392
|
/**
|
|
377
393
|
* Creates a new Color instance from color in hex format with 6 color digits (without alpha channel)
|
|
378
394
|
*
|
|
@@ -563,7 +579,8 @@ class Color {
|
|
|
563
579
|
* @returns true if the value is a valid hex color string (e.g., `#009edd`, `#fff`, etc.)
|
|
564
580
|
*/
|
|
565
581
|
static isHexColorString(value) {
|
|
566
|
-
return typeof value === 'string' &&
|
|
582
|
+
return (typeof value === 'string' &&
|
|
583
|
+
/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(value));
|
|
567
584
|
}
|
|
568
585
|
/**
|
|
569
586
|
* Creates new Color object
|
|
@@ -890,6 +907,7 @@ const PROMPTBOOK_COLOR = Color.fromHex('#79EAFD');
|
|
|
890
907
|
({
|
|
891
908
|
TITLE: Color.fromHex('#244EA8'),
|
|
892
909
|
LINE: Color.fromHex('#eeeeee'),
|
|
910
|
+
SEPARATOR: Color.fromHex('#cccccc'),
|
|
893
911
|
COMMITMENT: Color.fromHex('#DA0F78'),
|
|
894
912
|
PARAMETER: Color.fromHex('#8e44ad'),
|
|
895
913
|
});
|
|
@@ -2142,7 +2160,7 @@ function deepClone(objectValue) {
|
|
|
2142
2160
|
TODO: [🧠] Is there a better implementation?
|
|
2143
2161
|
> const propertyNames = Object.getOwnPropertyNames(objectValue);
|
|
2144
2162
|
> for (const propertyName of propertyNames) {
|
|
2145
|
-
> const value = (objectValue as
|
|
2163
|
+
> const value = (objectValue as chococake)[propertyName];
|
|
2146
2164
|
> if (value && typeof value === 'object') {
|
|
2147
2165
|
> deepClone(value);
|
|
2148
2166
|
> }
|
|
@@ -2221,6 +2239,8 @@ const RESERVED_PARAMETER_NAMES = exportJson({
|
|
|
2221
2239
|
/**
|
|
2222
2240
|
* Normalizes a given text to camelCase format.
|
|
2223
2241
|
*
|
|
2242
|
+
* Note: [🔂] This function is idempotent.
|
|
2243
|
+
*
|
|
2224
2244
|
* @param text The text to be normalized.
|
|
2225
2245
|
* @param _isFirstLetterCapital Whether the first letter should be capitalized.
|
|
2226
2246
|
* @returns The camelCase formatted string.
|
|
@@ -3418,6 +3438,8 @@ function isValidUrl(url) {
|
|
|
3418
3438
|
/**
|
|
3419
3439
|
* Converts a given text to kebab-case format.
|
|
3420
3440
|
*
|
|
3441
|
+
* Note: [🔂] This function is idempotent.
|
|
3442
|
+
*
|
|
3421
3443
|
* @param text The text to be converted.
|
|
3422
3444
|
* @returns The kebab-case formatted string.
|
|
3423
3445
|
* @example 'hello-world'
|