@promptbook/wizard 0.100.0-6 → 0.100.0-61

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 (129) hide show
  1. package/README.md +2 -8
  2. package/esm/index.es.js +651 -150
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/color.index.d.ts +50 -0
  5. package/esm/typings/src/_packages/components.index.d.ts +36 -0
  6. package/esm/typings/src/_packages/core.index.d.ts +30 -0
  7. package/esm/typings/src/_packages/types.index.d.ts +38 -0
  8. package/esm/typings/src/book-2.0/agent-source/parseAgentSource.d.ts +30 -0
  9. package/esm/typings/src/book-2.0/agent-source/parseAgentSource.test.d.ts +1 -0
  10. package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +26 -0
  11. package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +38 -0
  12. package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +39 -0
  13. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +45 -0
  14. package/esm/typings/src/book-2.0/commitments/META_IMAGE/META_IMAGE.d.ts +44 -0
  15. package/esm/typings/src/book-2.0/commitments/META_LINK/META_LINK.d.ts +56 -0
  16. package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +39 -0
  17. package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +49 -0
  18. package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +46 -0
  19. package/esm/typings/src/book-2.0/commitments/RULE/RULE.d.ts +44 -0
  20. package/esm/typings/src/book-2.0/commitments/SAMPLE/SAMPLE.d.ts +44 -0
  21. package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +38 -0
  22. package/esm/typings/src/book-2.0/commitments/_base/BaseCommitmentDefinition.d.ts +52 -0
  23. package/esm/typings/src/book-2.0/commitments/_base/BookCommitment.d.ts +5 -0
  24. package/esm/typings/src/book-2.0/commitments/_base/CommitmentDefinition.d.ts +48 -0
  25. package/esm/typings/src/book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition.d.ts +22 -0
  26. package/esm/typings/src/book-2.0/commitments/_base/createEmptyAgentModelRequirements.d.ts +19 -0
  27. package/esm/typings/src/book-2.0/commitments/_misc/AgentModelRequirements.d.ts +37 -0
  28. package/esm/typings/src/book-2.0/commitments/_misc/AgentSourceParseResult.d.ts +18 -0
  29. package/esm/typings/src/book-2.0/commitments/_misc/ParsedCommitment.d.ts +22 -0
  30. package/esm/typings/src/book-2.0/commitments/_misc/createAgentModelRequirements.d.ts +62 -0
  31. package/esm/typings/src/book-2.0/commitments/_misc/createAgentModelRequirementsWithCommitments.d.ts +36 -0
  32. package/esm/typings/src/book-2.0/commitments/_misc/createCommitmentRegex.d.ts +20 -0
  33. package/esm/typings/src/book-2.0/commitments/_misc/parseAgentSourceWithCommitments.d.ts +24 -0
  34. package/esm/typings/src/book-2.0/commitments/_misc/removeCommentsFromSystemMessage.d.ts +11 -0
  35. package/esm/typings/src/book-2.0/commitments/index.d.ts +56 -0
  36. package/esm/typings/src/book-2.0/utils/profileImageUtils.d.ts +39 -0
  37. package/esm/typings/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +35 -0
  38. package/esm/typings/src/book-components/AvatarProfile/AvatarChip/AvatarChipFromSource.d.ts +21 -0
  39. package/esm/typings/src/book-components/AvatarProfile/AvatarChip/index.d.ts +2 -0
  40. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +26 -0
  41. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource.d.ts +19 -0
  42. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +35 -0
  43. package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +15 -0
  44. package/esm/typings/src/book-components/BookEditor/config.d.ts +10 -0
  45. package/esm/typings/src/book-components/BookEditor/injectCssModuleIntoShadowRoot.d.ts +11 -0
  46. package/esm/typings/src/book-components/Chat/Chat/Chat.d.ts +20 -0
  47. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +110 -0
  48. package/esm/typings/src/book-components/Chat/LlmChat/LlmChat.d.ts +14 -0
  49. package/esm/typings/src/book-components/Chat/LlmChat/LlmChat.test.d.ts +1 -0
  50. package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +24 -0
  51. package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +16 -0
  52. package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +32 -0
  53. package/esm/typings/src/book-components/Chat/utils/ChatPersistence.d.ts +25 -0
  54. package/esm/typings/src/book-components/Chat/utils/ExportFormat.d.ts +4 -0
  55. package/esm/typings/src/book-components/Chat/utils/addUtmParamsToUrl.d.ts +7 -0
  56. package/esm/typings/src/book-components/Chat/utils/createShortLinkForChat.d.ts +7 -0
  57. package/esm/typings/src/book-components/Chat/utils/downloadFile.d.ts +6 -0
  58. package/esm/typings/src/book-components/Chat/utils/exportChatHistory.d.ts +9 -0
  59. package/esm/typings/src/book-components/Chat/utils/generatePdfContent.d.ts +8 -0
  60. package/esm/typings/src/book-components/Chat/utils/generateQrDataUrl.d.ts +7 -0
  61. package/esm/typings/src/book-components/Chat/utils/getPromptbookBranding.d.ts +6 -0
  62. package/esm/typings/src/book-components/Chat/utils/messagesToHtml.d.ts +8 -0
  63. package/esm/typings/src/book-components/Chat/utils/messagesToJson.d.ts +7 -0
  64. package/esm/typings/src/book-components/Chat/utils/messagesToMarkdown.d.ts +8 -0
  65. package/esm/typings/src/book-components/Chat/utils/messagesToText.d.ts +8 -0
  66. package/esm/typings/src/book-components/_common/react-utils/classNames.d.ts +7 -0
  67. package/esm/typings/src/book-components/_common/react-utils/collectCssTextsForClass.d.ts +7 -0
  68. package/esm/typings/src/book-components/_common/react-utils/escapeHtml.d.ts +6 -0
  69. package/esm/typings/src/book-components/_common/react-utils/escapeRegex.d.ts +6 -0
  70. package/esm/typings/src/config.d.ts +19 -0
  71. package/esm/typings/src/execution/AvailableModel.d.ts +4 -0
  72. package/esm/typings/src/execution/ExecutionTask.d.ts +27 -1
  73. package/esm/typings/src/execution/LlmExecutionTools.d.ts +8 -0
  74. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +6 -1
  75. package/esm/typings/src/llm-providers/_common/filterModels.d.ts +0 -3
  76. package/esm/typings/src/llm-providers/_common/profiles/llmProviderProfiles.d.ts +81 -0
  77. package/esm/typings/src/llm-providers/_common/profiles/test/llmProviderProfiles.test.d.ts +1 -0
  78. package/esm/typings/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +5 -0
  79. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +5 -5
  80. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  81. package/esm/typings/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
  82. package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
  83. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +5 -0
  84. package/esm/typings/src/llm-providers/ollama/ollama-models.d.ts +1 -1
  85. package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +8 -0
  86. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +5 -0
  87. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  88. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +5 -0
  89. package/esm/typings/src/pipeline/book-notation.d.ts +2 -1
  90. package/esm/typings/src/playground/permanent/error-handling-playground.d.ts +5 -0
  91. package/esm/typings/src/types/ModelRequirements.d.ts +0 -2
  92. package/esm/typings/src/types/typeAliases.d.ts +6 -0
  93. package/esm/typings/src/utils/color/$randomColor.d.ts +11 -0
  94. package/esm/typings/src/utils/color/Color.d.ts +180 -0
  95. package/esm/typings/src/utils/color/css-colors.d.ts +159 -0
  96. package/esm/typings/src/utils/color/internal-utils/checkChannelValue.d.ts +14 -0
  97. package/esm/typings/src/utils/color/internal-utils/hslToRgb.d.ts +17 -0
  98. package/esm/typings/src/utils/color/internal-utils/rgbToHsl.d.ts +17 -0
  99. package/esm/typings/src/utils/color/operators/ColorTransformer.d.ts +5 -0
  100. package/esm/typings/src/utils/color/operators/darken.d.ts +9 -0
  101. package/esm/typings/src/utils/color/operators/furthest.d.ts +16 -0
  102. package/esm/typings/src/utils/color/operators/grayscale.d.ts +9 -0
  103. package/esm/typings/src/utils/color/operators/lighten.d.ts +12 -0
  104. package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +11 -0
  105. package/esm/typings/src/utils/color/operators/nearest.d.ts +10 -0
  106. package/esm/typings/src/utils/color/operators/negative.d.ts +7 -0
  107. package/esm/typings/src/utils/color/operators/negativeLightness.d.ts +7 -0
  108. package/esm/typings/src/utils/color/operators/withAlpha.d.ts +9 -0
  109. package/esm/typings/src/utils/color/utils/areColorsEqual.d.ts +14 -0
  110. package/esm/typings/src/utils/color/utils/colorDistance.d.ts +21 -0
  111. package/esm/typings/src/utils/color/utils/colorHue.d.ts +11 -0
  112. package/esm/typings/src/utils/color/utils/colorHueDistance.d.ts +11 -0
  113. package/esm/typings/src/utils/color/utils/colorHueDistance.test.d.ts +1 -0
  114. package/esm/typings/src/utils/color/utils/colorLuminance.d.ts +9 -0
  115. package/esm/typings/src/utils/color/utils/colorSatulightion.d.ts +7 -0
  116. package/esm/typings/src/utils/color/utils/colorSaturation.d.ts +9 -0
  117. package/esm/typings/src/utils/color/utils/colorToDataUrl.d.ts +10 -0
  118. package/esm/typings/src/utils/color/utils/mixColors.d.ts +11 -0
  119. package/esm/typings/src/utils/organization/preserve.d.ts +21 -0
  120. package/esm/typings/src/utils/take/classes/TakeChain.d.ts +11 -0
  121. package/esm/typings/src/utils/take/interfaces/ITakeChain.d.ts +12 -0
  122. package/esm/typings/src/utils/take/interfaces/Takeable.d.ts +7 -0
  123. package/esm/typings/src/utils/take/take.d.ts +12 -0
  124. package/esm/typings/src/utils/take/take.test.d.ts +1 -0
  125. package/esm/typings/src/version.d.ts +1 -1
  126. package/package.json +2 -3
  127. package/umd/index.umd.js +655 -154
  128. package/umd/index.umd.js.map +1 -1
  129. package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +0 -14
@@ -0,0 +1,159 @@
1
+ /**
2
+ * 🎨 List of all 140 color names which are supported by CSS
3
+ *
4
+ * @public exported from `@promptbook/color`
5
+ */
6
+ export declare const CSS_COLORS: {
7
+ readonly transparent: "rgba(0,0,0,0)";
8
+ readonly aliceblue: "#f0f8ff";
9
+ readonly antiquewhite: "#faebd7";
10
+ readonly aqua: "#00ffff";
11
+ readonly aquamarine: "#7fffd4";
12
+ readonly azure: "#f0ffff";
13
+ readonly beige: "#f5f5dc";
14
+ readonly bisque: "#ffe4c4";
15
+ readonly black: "#000000";
16
+ readonly blanchedalmond: "#ffebcd";
17
+ readonly blue: "#0000ff";
18
+ readonly blueviolet: "#8a2be2";
19
+ readonly brown: "#a52a2a";
20
+ readonly burlywood: "#deb887";
21
+ readonly cadetblue: "#5f9ea0";
22
+ readonly chartreuse: "#7fff00";
23
+ readonly chocolate: "#d2691e";
24
+ readonly coral: "#ff7f50";
25
+ readonly cornflowerblue: "#6495ed";
26
+ readonly cornsilk: "#fff8dc";
27
+ readonly crimson: "#dc143c";
28
+ readonly cyan: "#00ffff";
29
+ readonly darkblue: "#00008b";
30
+ readonly darkcyan: "#008b8b";
31
+ readonly darkgoldenrod: "#b8860b";
32
+ readonly darkgray: "#a9a9a9";
33
+ readonly darkgrey: "#a9a9a9";
34
+ readonly darkgreen: "#006400";
35
+ readonly darkkhaki: "#bdb76b";
36
+ readonly darkmagenta: "#8b008b";
37
+ readonly darkolivegreen: "#556b2f";
38
+ readonly darkorange: "#ff8c00";
39
+ readonly darkorchid: "#9932cc";
40
+ readonly darkred: "#8b0000";
41
+ readonly darksalmon: "#e9967a";
42
+ readonly darkseagreen: "#8fbc8f";
43
+ readonly darkslateblue: "#483d8b";
44
+ readonly darkslategray: "#2f4f4f";
45
+ readonly darkslategrey: "#2f4f4f";
46
+ readonly darkturquoise: "#00ced1";
47
+ readonly darkviolet: "#9400d3";
48
+ readonly deeppink: "#ff1493";
49
+ readonly deepskyblue: "#00bfff";
50
+ readonly dimgray: "#696969";
51
+ readonly dimgrey: "#696969";
52
+ readonly dodgerblue: "#1e90ff";
53
+ readonly firebrick: "#b22222";
54
+ readonly floralwhite: "#fffaf0";
55
+ readonly forestgreen: "#228b22";
56
+ readonly fuchsia: "#ff00ff";
57
+ readonly gainsboro: "#dcdcdc";
58
+ readonly ghostwhite: "#f8f8ff";
59
+ readonly gold: "#ffd700";
60
+ readonly goldenrod: "#daa520";
61
+ readonly gray: "#808080";
62
+ readonly grey: "#808080";
63
+ readonly green: "#008000";
64
+ readonly greenyellow: "#adff2f";
65
+ readonly honeydew: "#f0fff0";
66
+ readonly hotpink: "#ff69b4";
67
+ readonly indianred: "#cd5c5c";
68
+ readonly indigo: "#4b0082";
69
+ readonly ivory: "#fffff0";
70
+ readonly khaki: "#f0e68c";
71
+ readonly lavender: "#e6e6fa";
72
+ readonly lavenderblush: "#fff0f5";
73
+ readonly lawngreen: "#7cfc00";
74
+ readonly lemonchiffon: "#fffacd";
75
+ readonly lightblue: "#add8e6";
76
+ readonly lightcoral: "#f08080";
77
+ readonly lightcyan: "#e0ffff";
78
+ readonly lightgoldenrodyellow: "#fafad2";
79
+ readonly lightgray: "#d3d3d3";
80
+ readonly lightgrey: "#d3d3d3";
81
+ readonly lightgreen: "#90ee90";
82
+ readonly lightpink: "#ffb6c1";
83
+ readonly lightsalmon: "#ffa07a";
84
+ readonly lightseagreen: "#20b2aa";
85
+ readonly lightskyblue: "#87cefa";
86
+ readonly lightslategray: "#778899";
87
+ readonly lightslategrey: "#778899";
88
+ readonly lightsteelblue: "#b0c4de";
89
+ readonly lightyellow: "#ffffe0";
90
+ readonly lime: "#00ff00";
91
+ readonly limegreen: "#32cd32";
92
+ readonly linen: "#faf0e6";
93
+ readonly magenta: "#ff00ff";
94
+ readonly maroon: "#800000";
95
+ readonly mediumaquamarine: "#66cdaa";
96
+ readonly mediumblue: "#0000cd";
97
+ readonly mediumorchid: "#ba55d3";
98
+ readonly mediumpurple: "#9370db";
99
+ readonly mediumseagreen: "#3cb371";
100
+ readonly mediumslateblue: "#7b68ee";
101
+ readonly mediumspringgreen: "#00fa9a";
102
+ readonly mediumturquoise: "#48d1cc";
103
+ readonly mediumvioletred: "#c71585";
104
+ readonly midnightblue: "#191970";
105
+ readonly mintcream: "#f5fffa";
106
+ readonly mistyrose: "#ffe4e1";
107
+ readonly moccasin: "#ffe4b5";
108
+ readonly navajowhite: "#ffdead";
109
+ readonly navy: "#000080";
110
+ readonly oldlace: "#fdf5e6";
111
+ readonly olive: "#808000";
112
+ readonly olivedrab: "#6b8e23";
113
+ readonly orange: "#ffa500";
114
+ readonly orangered: "#ff4500";
115
+ readonly orchid: "#da70d6";
116
+ readonly palegoldenrod: "#eee8aa";
117
+ readonly palegreen: "#98fb98";
118
+ readonly paleturquoise: "#afeeee";
119
+ readonly palevioletred: "#db7093";
120
+ readonly papayawhip: "#ffefd5";
121
+ readonly peachpuff: "#ffdab9";
122
+ readonly peru: "#cd853f";
123
+ readonly pink: "#ffc0cb";
124
+ readonly plum: "#dda0dd";
125
+ readonly powderblue: "#b0e0e6";
126
+ readonly purple: "#800080";
127
+ readonly rebeccapurple: "#663399";
128
+ readonly red: "#ff0000";
129
+ readonly rosybrown: "#bc8f8f";
130
+ readonly royalblue: "#4169e1";
131
+ readonly saddlebrown: "#8b4513";
132
+ readonly salmon: "#fa8072";
133
+ readonly sandybrown: "#f4a460";
134
+ readonly seagreen: "#2e8b57";
135
+ readonly seashell: "#fff5ee";
136
+ readonly sienna: "#a0522d";
137
+ readonly silver: "#c0c0c0";
138
+ readonly skyblue: "#87ceeb";
139
+ readonly slateblue: "#6a5acd";
140
+ readonly slategray: "#708090";
141
+ readonly slategrey: "#708090";
142
+ readonly snow: "#fffafa";
143
+ readonly springgreen: "#00ff7f";
144
+ readonly steelblue: "#4682b4";
145
+ readonly tan: "#d2b48c";
146
+ readonly teal: "#008080";
147
+ readonly thistle: "#d8bfd8";
148
+ readonly tomato: "#ff6347";
149
+ readonly turquoise: "#40e0d0";
150
+ readonly violet: "#ee82ee";
151
+ readonly wheat: "#f5deb3";
152
+ readonly white: "#ffffff";
153
+ readonly whitesmoke: "#f5f5f5";
154
+ readonly yellow: "#ffff00";
155
+ readonly yellowgreen: "#9acd32";
156
+ };
157
+ /**
158
+ * Note: [💞] Ignore a discrepancy between file name and entity name
159
+ */
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Validates that a channel value is a valid number within the range of 0 to 255.
3
+ * Throws an error if the value is not valid.
4
+ *
5
+ * @param channelName - The name of the channel being validated.
6
+ * @param value - The value of the channel to validate.
7
+ * @throws Will throw an error if the value is not a valid channel number.
8
+ *
9
+ * @private util of `@promptbook/color`
10
+ */
11
+ export declare function checkChannelValue(channelName: string, value: number): asserts value is number;
12
+ /**
13
+ * TODO: [🧠][🚓] Is/which combination it better to use asserts/check, validate or is utility function?
14
+ */
@@ -0,0 +1,17 @@
1
+ import type { number_integer } from '../../../types/typeAliases';
2
+ import type { number_percent } from '../../../types/typeAliases';
3
+ import type { number_positive } from '../../../types/typeAliases';
4
+ /**
5
+ * Converts HSL values to RGB values
6
+ *
7
+ * @param hue [0-1]
8
+ * @param saturation [0-1]
9
+ * @param lightness [0-1]
10
+ * @returns [red, green, blue] [0-255]
11
+ *
12
+ * @private util of `@promptbook/color`
13
+ */
14
+ export declare function hslToRgb(hue: number_percent, saturation: number_percent, lightness: number_percent): readonly [number_positive & number_integer, number_positive & number_integer, number_positive & number_integer];
15
+ /**
16
+ * TODO: Properly name all used internal variables
17
+ */
@@ -0,0 +1,17 @@
1
+ import type { number_integer } from '../../../types/typeAliases';
2
+ import type { number_percent } from '../../../types/typeAliases';
3
+ import type { number_positive } from '../../../types/typeAliases';
4
+ /**
5
+ * Converts RGB values to HSL values
6
+ *
7
+ * @param red [0-255]
8
+ * @param green [0-255]
9
+ * @param blue [0-255]
10
+ * @returns [hue, saturation, lightness] [0-1]
11
+ *
12
+ * @private util of `@promptbook/color`
13
+ */
14
+ export declare function rgbToHsl(red: number_positive & number_integer, green: number_positive & number_integer, blue: number_positive & number_integer): readonly [number_percent, number_percent, number_percent];
15
+ /**
16
+ * TODO: Properly name all used internal variables
17
+ */
@@ -0,0 +1,5 @@
1
+ import { Color } from '../Color';
2
+ /**
3
+ * @public exported from `@promptbook/color`
4
+ */
5
+ export type ColorTransformer = (color: Color) => Color;
@@ -0,0 +1,9 @@
1
+ import type { ColorTransformer } from './ColorTransformer';
2
+ /**
3
+ * Makes color transformer which darker the given color
4
+ *
5
+ * @param amount from 0 to 1
6
+ *
7
+ * @public exported from `@promptbook/color`
8
+ */
9
+ export declare function darken(amount: number): ColorTransformer;
@@ -0,0 +1,16 @@
1
+ import { Color } from '../Color';
2
+ import type { ColorTransformer } from './ColorTransformer';
3
+ /**
4
+ * Makes color transformer which finds the furthest color from the given list
5
+ *
6
+ * @param colors array of colors to choose from
7
+ *
8
+ * @public exported from `@promptbook/color`
9
+ */
10
+ export declare function furthest(...colors: Color[]): ColorTransformer;
11
+ /**
12
+ * Makes color transformer which finds the best text color (black or white) for the given background color
13
+ *
14
+ * @public exported from `@promptbook/color`
15
+ */
16
+ export declare const textColor: ColorTransformer;
@@ -0,0 +1,9 @@
1
+ import type { ColorTransformer } from './ColorTransformer';
2
+ /**
3
+ * Makes color transformer which returns a grayscale version of the color
4
+ *
5
+ * @param amount from 0 to 1
6
+ *
7
+ * @public exported from `@promptbook/color`
8
+ */
9
+ export declare function grayscale(amount: number): ColorTransformer;
@@ -0,0 +1,12 @@
1
+ import type { ColorTransformer } from './ColorTransformer';
2
+ /**
3
+ * Makes color transformer which lighten the given color
4
+ *
5
+ * @param amount from 0 to 1
6
+ *
7
+ * @public exported from `@promptbook/color`
8
+ */
9
+ export declare function lighten(amount: number): ColorTransformer;
10
+ /**
11
+ * TODO: Maybe implement by mix+hsl
12
+ */
@@ -0,0 +1,11 @@
1
+ import { Color } from '../Color';
2
+ import type { ColorTransformer } from './ColorTransformer';
3
+ /**
4
+ * Makes color transformer which returns a mix of two colors based on a ratio
5
+ *
6
+ * @param ratio the ratio of the first color to the second color, from 0 to 1
7
+ * @param additionalColor the second color to mix with the first color
8
+ *
9
+ * @public exported from `@promptbook/color`
10
+ */
11
+ export declare function mixWithColor(ratio: number, additionalColor: Color): ColorTransformer;
@@ -0,0 +1,10 @@
1
+ import { Color } from '../Color';
2
+ import type { ColorTransformer } from './ColorTransformer';
3
+ /**
4
+ * Makes color transformer which finds the nearest color from the given list
5
+ *
6
+ * @param colors array of colors to choose from
7
+ *
8
+ * @public exported from `@promptbook/color`
9
+ */
10
+ export declare function nearest(...colors: Color[]): ColorTransformer;
@@ -0,0 +1,7 @@
1
+ import { Color } from '../Color';
2
+ /**
3
+ * Color transformer which returns the negative color
4
+ *
5
+ * @public exported from `@promptbook/color`
6
+ */
7
+ export declare function negative(color: Color): Color;
@@ -0,0 +1,7 @@
1
+ import { Color } from '../Color';
2
+ /**
3
+ * Color transformer which returns the negative color but preserves hue and saturation
4
+ *
5
+ * @public exported from `@promptbook/color`
6
+ */
7
+ export declare function negativeLightness(color: Color): Color;
@@ -0,0 +1,9 @@
1
+ import type { ColorTransformer } from './ColorTransformer';
2
+ /**
3
+ * Makes color transformer which sets alpha channel to given color
4
+ *
5
+ * @param alpha number from 0 (transparent) to 1 (opaque)
6
+ *
7
+ * @public exported from `@promptbook/color`
8
+ */
9
+ export declare function withAlpha(alpha: number): ColorTransformer;
@@ -0,0 +1,14 @@
1
+ import { Color } from '../Color';
2
+ /**
3
+ * Compares two colors to determine if they are equal based on their RGB values.
4
+ *
5
+ * @param color1 - The first color to compare.
6
+ * @param color2 - The second color to compare.
7
+ * @returns {boolean} True if the colors are equal, false otherwise.
8
+ *
9
+ * @public exported from `@promptbook/color`
10
+ */
11
+ export declare function areColorsEqual(color1: Color, color2: Color): boolean;
12
+ /**
13
+ * TODO: [🥎] Implement for N colors
14
+ */
@@ -0,0 +1,21 @@
1
+ import { Color } from '../Color';
2
+ /**
3
+ * Calculates distance between two colors
4
+ *
5
+ * @param color1 first color
6
+ * @param color2 second color
7
+ *
8
+ * Note: This function is inefficient. Use colorDistanceSquared instead if possible.
9
+ *
10
+ * @public exported from `@promptbook/color`
11
+ */
12
+ export declare function colorDistance(color1: Color, color2: Color): number;
13
+ /**
14
+ * Calculates distance between two colors without square root
15
+ *
16
+ * @param color1 first color
17
+ * @param color2 second color
18
+ *
19
+ * @public exported from `@promptbook/color`
20
+ */
21
+ export declare function colorDistanceSquared(color1: Color, color2: Color): number;
@@ -0,0 +1,11 @@
1
+ import { Color } from '../Color';
2
+ /**
3
+ * Calculates hue of the color
4
+ *
5
+ * @returns hue in degrees <0-360)
6
+ *
7
+ * @see https://en.wikipedia.org/wiki/HSL_and_HSV#Hue_and_chroma
8
+ *
9
+ * @public exported from `@promptbook/color`
10
+ */
11
+ export declare function colorHue(color: Color): number;
@@ -0,0 +1,11 @@
1
+ import { Color } from '../Color';
2
+ /**
3
+ * Calculates hue distance of two colors
4
+ *
5
+ * @returns hue distance in degrees <0-180)
6
+ *
7
+ * @see https://en.wikipedia.org/wiki/HSL_and_HSV#Hue_and_chroma
8
+ *
9
+ * @public exported from `@promptbook/color`
10
+ */
11
+ export declare function colorHueDistance(color1: Color, color2: Color): number;
@@ -0,0 +1,9 @@
1
+ import { Color } from '../Color';
2
+ /**
3
+ * Calculates luminance of the color
4
+ *
5
+ * @see https://en.wikipedia.org/wiki/Relative_luminance
6
+ *
7
+ * @public exported from `@promptbook/color`
8
+ */
9
+ export declare function colorLuminance(color: Color): number;
@@ -0,0 +1,7 @@
1
+ import { Color } from '../Color';
2
+ /**
3
+ * Calculates saturation*luminance of the color
4
+ *
5
+ * @public exported from `@promptbook/color`
6
+ */
7
+ export declare function colorSatulightion(color: Color): number;
@@ -0,0 +1,9 @@
1
+ import { Color } from "../Color";
2
+ /**
3
+ * Calculates saturation of the color
4
+ *
5
+ * @see https://en.wikipedia.org/wiki/HSL_and_HSV#Saturation
6
+ *
7
+ * @public exported from `@promptbook/color`
8
+ */
9
+ export declare function colorSaturation(color: Color): number;
@@ -0,0 +1,10 @@
1
+ import { Color } from '../Color';
2
+ /**
3
+ * Makes data url from color
4
+ *
5
+ * @public exported from `@promptbook/color`
6
+ */
7
+ export declare function colorToDataUrl(color: Color): string;
8
+ /**
9
+ * TODO: Make as functions NOT const
10
+ */
@@ -0,0 +1,11 @@
1
+ import type { WithTake } from '../../take/interfaces/ITakeChain';
2
+ import { Color } from '../Color';
3
+ /**
4
+ * Mixes an array of colors and returns the average color
5
+ *
6
+ * @param {...Color} colors - The array of colors to be mixed.
7
+ * @returns {WithTake<Color>} - The mixed color.
8
+ *
9
+ * @public exported from `@promptbook/color`
10
+ */
11
+ export declare function mixColors(...colors: Array<Color>): WithTake<Color>;
@@ -0,0 +1,21 @@
1
+ import type { really_any } from './really_any';
2
+ /**
3
+ * Does nothing, but preserves the function in the bundle
4
+ * Compiler is tricked into thinking the function is used
5
+ *
6
+ * @param value any function to preserve
7
+ * @returns nothing
8
+ * @private within the repository
9
+ */
10
+ export declare function $preserve(...value: Array<really_any>): void;
11
+ /**
12
+ * DO NOT USE THIS FUNCTION
13
+ * Only purpose of this function is to trick the compiler and javascript engine
14
+ * that `_preserved` array can be used in the future and should not be garbage collected
15
+ *
16
+ * @private internal for `preserve`
17
+ */
18
+ export declare function __DO_NOT_USE_getPreserved(): Array<really_any>;
19
+ /**
20
+ * Note: [💞] Ignore a discrepancy between file name and entity name
21
+ */
@@ -0,0 +1,11 @@
1
+ import type { ITakeChain } from '../interfaces/ITakeChain';
2
+ import type { Takeable } from '../interfaces/Takeable';
3
+ /**
4
+ * @private util of `@promptbook/color`
5
+ * @de
6
+ */
7
+ export declare class TakeChain<TValue extends Takeable> implements ITakeChain<TValue> {
8
+ value: TValue;
9
+ constructor(value: TValue);
10
+ then<TResultValue extends Takeable>(callback: (oldValue: TValue) => TResultValue): TResultValue & ITakeChain<TResultValue>;
11
+ }
@@ -0,0 +1,12 @@
1
+ import type { Takeable } from './Takeable';
2
+ /**
3
+ * Represents any value with take chain functionality
4
+ *
5
+ * @private util of `@promptbook/color`
6
+ * @deprecated [🤡] Use some better functional library instead of `TakeChain`
7
+ */
8
+ export type WithTake<TValue extends Takeable> = TValue & ITakeChain<TValue>;
9
+ export interface ITakeChain<TValue extends Takeable> {
10
+ readonly value: TValue;
11
+ then<TResultValue extends Takeable>(callback: (value: TValue) => TResultValue): WithTake<TResultValue>;
12
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Represents a type that can be chained in take pipe
3
+ *
4
+ * @private util of `@promptbook/color`
5
+ * @deprecated [🤡] Use some better functional library instead of `TakeChain`
6
+ */
7
+ export type Takeable = Exclude<object, null>;
@@ -0,0 +1,12 @@
1
+ import type { WithTake } from './interfaces/ITakeChain';
2
+ import type { Takeable } from './interfaces/Takeable';
3
+ /**
4
+ * A function that takes an initial value and returns a proxy object with chainable methods.
5
+ *
6
+ * @param {*} initialValue - The initial value.
7
+ * @returns {Proxy<WithTake<TValue>>} - A proxy object with a `take` method.
8
+ *
9
+ * @private util of `@promptbook/color`
10
+ * @deprecated [🤡] Use some better functional library instead of `TakeChain`
11
+ */
12
+ export declare function take<TValue extends Takeable>(initialValue: TValue): WithTake<TValue>;
@@ -0,0 +1 @@
1
+ export {};
@@ -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.100.0-5`).
18
+ * It follows semantic versioning (e.g., `0.100.0-55`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/wizard",
3
- "version": "0.100.0-6",
3
+ "version": "0.100.0-61",
4
4
  "description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
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/wizard.index.d.ts",
97
97
  "peerDependencies": {
98
- "@promptbook/core": "0.100.0-6"
98
+ "@promptbook/core": "0.100.0-61"
99
99
  },
100
100
  "dependencies": {
101
101
  "@ai-sdk/deepseek": "0.1.6",
@@ -113,7 +113,6 @@
113
113
  "markitdown-ts": "0.0.4",
114
114
  "openai": "4.63.0",
115
115
  "papaparse": "5.4.1",
116
- "prettier": "2.8.1",
117
116
  "rxjs": "7.8.1",
118
117
  "showdown": "2.1.0",
119
118
  "socket.io-client": "4.7.2",