@promptbook/remote-client 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.
Files changed (55) hide show
  1. package/esm/index.es.js +28 -4
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/servers.d.ts +1 -0
  4. package/esm/typings/src/_packages/core.index.d.ts +6 -0
  5. package/esm/typings/src/_packages/types.index.d.ts +4 -0
  6. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  7. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +17 -3
  8. package/esm/typings/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +2 -1
  9. package/esm/typings/src/book-2.0/agent-source/computeAgentHash.d.ts +8 -0
  10. package/esm/typings/src/book-2.0/agent-source/computeAgentHash.test.d.ts +1 -0
  11. package/esm/typings/src/book-2.0/agent-source/createDefaultAgentName.d.ts +8 -0
  12. package/esm/typings/src/book-2.0/agent-source/normalizeAgentName.d.ts +9 -0
  13. package/esm/typings/src/book-2.0/agent-source/normalizeAgentName.test.d.ts +1 -0
  14. package/esm/typings/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +1 -1
  15. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +14 -8
  16. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +10 -0
  17. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +57 -32
  18. package/esm/typings/src/commitments/MESSAGE/InitialMessageCommitmentDefinition.d.ts +28 -0
  19. package/esm/typings/src/commitments/index.d.ts +2 -1
  20. package/esm/typings/src/config.d.ts +1 -0
  21. package/esm/typings/src/errors/DatabaseError.d.ts +2 -2
  22. package/esm/typings/src/errors/WrappedError.d.ts +2 -2
  23. package/esm/typings/src/execution/ExecutionTask.d.ts +2 -2
  24. package/esm/typings/src/execution/LlmExecutionTools.d.ts +6 -1
  25. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +2 -2
  26. package/esm/typings/src/llm-providers/_common/utils/assertUniqueModels.d.ts +12 -0
  27. package/esm/typings/src/llm-providers/agent/Agent.d.ts +17 -4
  28. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +10 -1
  29. package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +6 -2
  30. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +30 -4
  31. package/esm/typings/src/llm-providers/openai/openai-models.test.d.ts +4 -0
  32. package/esm/typings/src/remote-server/startAgentServer.d.ts +2 -2
  33. package/esm/typings/src/remote-server/startRemoteServer.d.ts +1 -2
  34. package/esm/typings/src/transpilers/openai-sdk/register.d.ts +1 -1
  35. package/esm/typings/src/types/typeAliases.d.ts +6 -0
  36. package/esm/typings/src/utils/color/Color.d.ts +7 -0
  37. package/esm/typings/src/utils/color/Color.test.d.ts +1 -0
  38. package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -2
  39. package/esm/typings/src/utils/misc/computeHash.d.ts +11 -0
  40. package/esm/typings/src/utils/misc/computeHash.test.d.ts +1 -0
  41. package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -0
  42. package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +3 -0
  43. package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -0
  44. package/esm/typings/src/utils/normalization/titleToName.d.ts +2 -0
  45. package/esm/typings/src/utils/organization/$sideEffect.d.ts +2 -2
  46. package/esm/typings/src/utils/organization/$side_effect.d.ts +2 -2
  47. package/esm/typings/src/utils/organization/TODO_USE.d.ts +2 -2
  48. package/esm/typings/src/utils/organization/keepUnused.d.ts +2 -2
  49. package/esm/typings/src/utils/organization/preserve.d.ts +3 -3
  50. package/esm/typings/src/utils/organization/really_any.d.ts +7 -0
  51. package/esm/typings/src/utils/serialization/asSerializable.d.ts +2 -2
  52. package/esm/typings/src/version.d.ts +1 -1
  53. package/package.json +2 -2
  54. package/umd/index.umd.js +28 -4
  55. package/umd/index.umd.js.map +1 -1
package/esm/index.es.js CHANGED
@@ -20,7 +20,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
20
20
  * @generated
21
21
  * @see https://github.com/webgptorg/promptbook
22
22
  */
23
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-47';
23
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-49';
24
24
  /**
25
25
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
26
26
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -95,7 +95,7 @@ class DatabaseError extends Error {
95
95
  }
96
96
  }
97
97
  /**
98
- * TODO: !!!! Explain that NotFoundError (!!! and other specific errors) has priority over DatabaseError in some contexts
98
+ * TODO: [🐱‍🚀] Explain that NotFoundError ([🐱‍🚀] and other specific errors) has priority over DatabaseError in some contexts
99
99
  */
100
100
 
101
101
  /**
@@ -641,6 +641,9 @@ class Color {
641
641
  if (hex.length === 3) {
642
642
  return Color.fromHex3(hex);
643
643
  }
644
+ if (hex.length === 4) {
645
+ return Color.fromHex4(hex);
646
+ }
644
647
  if (hex.length === 6) {
645
648
  return Color.fromHex6(hex);
646
649
  }
@@ -661,6 +664,19 @@ class Color {
661
664
  const b = parseInt(hex.substr(2, 1), 16) * 16;
662
665
  return take(new Color(r, g, b));
663
666
  }
667
+ /**
668
+ * Creates a new Color instance from color in hex format with 4 digits (with alpha channel)
669
+ *
670
+ * @param color in hex for example `09df`
671
+ * @returns Color object
672
+ */
673
+ static fromHex4(hex) {
674
+ const r = parseInt(hex.substr(0, 1), 16) * 16;
675
+ const g = parseInt(hex.substr(1, 1), 16) * 16;
676
+ const b = parseInt(hex.substr(2, 1), 16) * 16;
677
+ const a = parseInt(hex.substr(3, 1), 16) * 16;
678
+ return take(new Color(r, g, b, a));
679
+ }
664
680
  /**
665
681
  * Creates a new Color instance from color in hex format with 6 color digits (without alpha channel)
666
682
  *
@@ -851,7 +867,8 @@ class Color {
851
867
  * @returns true if the value is a valid hex color string (e.g., `#009edd`, `#fff`, etc.)
852
868
  */
853
869
  static isHexColorString(value) {
854
- return typeof value === 'string' && /^#(?:[0-9a-fA-F]{3}){1,2}$/.test(value);
870
+ return (typeof value === 'string' &&
871
+ /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(value));
855
872
  }
856
873
  /**
857
874
  * Creates new Color object
@@ -1178,6 +1195,7 @@ const PROMPTBOOK_COLOR = Color.fromHex('#79EAFD');
1178
1195
  ({
1179
1196
  TITLE: Color.fromHex('#244EA8'),
1180
1197
  LINE: Color.fromHex('#eeeeee'),
1198
+ SEPARATOR: Color.fromHex('#cccccc'),
1181
1199
  COMMITMENT: Color.fromHex('#DA0F78'),
1182
1200
  PARAMETER: Color.fromHex('#8e44ad'),
1183
1201
  });
@@ -1910,6 +1928,8 @@ function removeDiacritics(input) {
1910
1928
  /**
1911
1929
  * Converts a given text to kebab-case format.
1912
1930
  *
1931
+ * Note: [🔂] This function is idempotent.
1932
+ *
1913
1933
  * @param text The text to be converted.
1914
1934
  * @returns The kebab-case formatted string.
1915
1935
  * @example 'hello-world'
@@ -3292,7 +3312,7 @@ function deepClone(objectValue) {
3292
3312
  TODO: [🧠] Is there a better implementation?
3293
3313
  > const propertyNames = Object.getOwnPropertyNames(objectValue);
3294
3314
  > for (const propertyName of propertyNames) {
3295
- > const value = (objectValue as really_any)[propertyName];
3315
+ > const value = (objectValue as chococake)[propertyName];
3296
3316
  > if (value && typeof value === 'object') {
3297
3317
  > deepClone(value);
3298
3318
  > }
@@ -3385,6 +3405,8 @@ const RESERVED_PARAMETER_NAMES = exportJson({
3385
3405
  /**
3386
3406
  * Normalizes a given text to camelCase format.
3387
3407
  *
3408
+ * Note: [🔂] This function is idempotent.
3409
+ *
3388
3410
  * @param text The text to be normalized.
3389
3411
  * @param _isFirstLetterCapital Whether the first letter should be capitalized.
3390
3412
  * @returns The camelCase formatted string.
@@ -5925,6 +5947,8 @@ function flattenMarkdown(markdown) {
5925
5947
  /**
5926
5948
  * Converts a title string into a normalized name.
5927
5949
  *
5950
+ * Note: [🔂] This function is idempotent.
5951
+ *
5928
5952
  * @param value The title string to be converted to a name.
5929
5953
  * @returns A normalized name derived from the input title.
5930
5954
  * @example 'Hello World!' -> 'hello-world'