@promptbook/remote-server 0.86.10 → 0.86.30

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.
@@ -178,6 +178,7 @@ import type { string_css } from '../types/typeAliases';
178
178
  import type { string_svg } from '../types/typeAliases';
179
179
  import type { string_script } from '../types/typeAliases';
180
180
  import type { string_javascript } from '../types/typeAliases';
181
+ import type { string_typescript } from '../types/typeAliases';
181
182
  import type { string_json } from '../types/typeAliases';
182
183
  import type { string_css_class } from '../types/typeAliases';
183
184
  import type { string_css_property } from '../types/typeAliases';
@@ -459,6 +460,7 @@ export type { string_css };
459
460
  export type { string_svg };
460
461
  export type { string_script };
461
462
  export type { string_javascript };
463
+ export type { string_typescript };
462
464
  export type { string_json };
463
465
  export type { string_css_class };
464
466
  export type { string_css_property };
@@ -2,7 +2,6 @@ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { VALUE_STRINGS } from '../config';
3
3
  import { SMALL_NUMBER } from '../config';
4
4
  import { renderPromptbookMermaid } from '../conversion/prettify/renderPipelineMermaidOptions';
5
- import { extractVariablesFromScript } from '../conversion/utils/extractVariablesFromScript';
6
5
  import { deserializeError } from '../errors/utils/deserializeError';
7
6
  import { serializeError } from '../errors/utils/serializeError';
8
7
  import { forEachAsync } from '../execution/utils/forEachAsync';
@@ -84,7 +83,6 @@ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
84
83
  export { VALUE_STRINGS };
85
84
  export { SMALL_NUMBER };
86
85
  export { renderPromptbookMermaid };
87
- export { extractVariablesFromScript };
88
86
  export { deserializeError };
89
87
  export { serializeError };
90
88
  export { forEachAsync };
@@ -7,15 +7,15 @@ import type { ErrorJson } from '../errors/utils/ErrorJson';
7
7
  */
8
8
  export type AbstractTaskResult = {
9
9
  /**
10
- * Whether the execution was successful, details are aviable in `executionReport`
10
+ * Whether the execution was successful, details are available in `executionReport`
11
11
  */
12
12
  readonly isSuccessful: boolean;
13
13
  /**
14
- * Errors that occured during the execution, details are aviable in `executionReport`
14
+ * Errors that occured during the execution, details are available in `executionReport`
15
15
  */
16
16
  readonly errors: ReadonlyDeep<ReadonlyArray<ErrorJson>>;
17
17
  /**
18
- * Warnings that occured during the execution, details are aviable in `executionReport`
18
+ * Warnings that occured during the execution, details are available in `executionReport`
19
19
  */
20
20
  readonly warnings: ReadonlyDeep<ReadonlyArray<ErrorJson>>;
21
21
  };
@@ -17,7 +17,7 @@ export type PipelineExecutorResult = AbstractTaskResult & {
17
17
  */
18
18
  readonly outputParameters: Readonly<Parameters>;
19
19
  /**
20
- * Added usage of whole execution, detailed usage is aviable in `executionReport`
20
+ * Added usage of whole execution, detailed usage is available in `executionReport`
21
21
  */
22
22
  readonly usage: ReadonlyDeep<PromptResultUsage>;
23
23
  /**
@@ -1,11 +1,21 @@
1
1
  import type { string_markdown } from '../../types/typeAliases';
2
2
  import type { PromptResultUsage } from '../PromptResultUsage';
3
+ import type { UncertainNumber } from '../UncertainNumber';
4
+ /**
5
+ * Minimal usage information required to calculate worktime
6
+ */
7
+ type PartialPromptResultUsage = Partial<PromptResultUsage> & {
8
+ price: UncertainNumber;
9
+ input: Pick<PromptResultUsage['input'], 'wordsCount'>;
10
+ output: Pick<PromptResultUsage['output'], 'wordsCount' | 'charactersCount'>;
11
+ };
3
12
  /**
4
13
  * Function `usageToHuman` will take usage and convert it to human readable report
5
14
  *
6
15
  * @public exported from `@promptbook/core`
7
16
  */
8
- export declare function usageToHuman(usage: PromptResultUsage): string_markdown;
17
+ export declare function usageToHuman(usage: PartialPromptResultUsage): string_markdown;
18
+ export {};
9
19
  /**
10
20
  * TODO: [🍓][🧞‍♂️] Use "$1" not "1 USD"
11
21
  * TODO: [🍓][🧞‍♂️] Use markdown formatting like "Cost approximately **$1**"
@@ -1,5 +1,12 @@
1
1
  import type { PromptResultUsage } from '../PromptResultUsage';
2
2
  import type { UncertainNumber } from '../UncertainNumber';
3
+ /**
4
+ * Minimal usage information required to calculate worktime
5
+ */
6
+ type PartialPromptResultUsage = Pick<PromptResultUsage, 'input' | 'output'> & {
7
+ input: Pick<PromptResultUsage['input'], 'wordsCount'>;
8
+ output: Pick<PromptResultUsage['output'], 'wordsCount'>;
9
+ };
3
10
  /**
4
11
  * Function usageToWorktime will take usage and estimate saved worktime in hours of reading / writing
5
12
  *
@@ -9,4 +16,5 @@ import type { UncertainNumber } from '../UncertainNumber';
9
16
  *
10
17
  * @public exported from `@promptbook/core`
11
18
  */
12
- export declare function usageToWorktime(usage: PromptResultUsage): UncertainNumber;
19
+ export declare function usageToWorktime(usage: PartialPromptResultUsage): UncertainNumber;
20
+ export {};
@@ -64,7 +64,7 @@ export type FormatDefinition<TValue extends TPartialValue, TPartialValue extends
64
64
  * TODO: [♏] Add some prepare hook to modify prompt according to the format
65
65
  * TODO: [🍓]`name` and `aliases` should be UPPERCASE only and interpreted as case-insensitive (via normalization)
66
66
  * TODO: [🍓][👨‍⚖️] Compute TPartialValue dynamically - PartialString<TValue>
67
- * TODO: [🍓][🧠] Should execution tools be aviable to heal, canBeValid and isValid?
67
+ * TODO: [🍓][🧠] Should execution tools be available to heal, canBeValid and isValid?
68
68
  * TODO: [🍓][🧠] llm Provider Bindings
69
69
  * TODO: [🍓][🔼] Export via some package
70
70
  */
@@ -10,7 +10,7 @@ import type { FormatDefinition } from '../_common/FormatDefinition';
10
10
  export declare const TextFormatDefinition: FormatDefinition<string, string, TODO_any, TODO_any>;
11
11
  /**
12
12
  * TODO: [1] Make type for XML Text and Schema
13
- * TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages aviable as subvalues
13
+ * TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
14
14
  * TODO: [🍓] In `TextFormatDefinition` implement simple `isValid`
15
15
  * TODO: [🍓] In `TextFormatDefinition` implement partial `canBeValid`
16
16
  * TODO: [🍓] In `TextFormatDefinition` implement `heal
@@ -57,7 +57,7 @@ export declare class MultipleLlmExecutionTools implements LlmExecutionTools {
57
57
  callCommonModel(prompt: Prompt): Promise<PromptResult>;
58
58
  }
59
59
  /**
60
- * TODO: [🧠][🎛] Aggregating multiple models - have result not only from one first aviable model BUT all of them
60
+ * TODO: [🧠][🎛] Aggregating multiple models - have result not only from one first available model BUT all of them
61
61
  * TODO: [🏖] If no llmTools have for example not defined `callCompletionModel` this will still return object with defined `callCompletionModel` which just throws `PipelineExecutionError`, make it undefined instead
62
62
  * Look how `countTotalUsage` (and `cacheLlmTools`) implements it
63
63
  */
@@ -272,6 +272,12 @@ export type string_script = string;
272
272
  * For example `console.info("Hello World!")`
273
273
  */
274
274
  export type string_javascript = string;
275
+ /**
276
+ * Semantic helper
277
+ *
278
+ * For example `console.info("Hello World!" as string)`
279
+ */
280
+ export type string_typescript = string;
275
281
  /**
276
282
  * Semantic helper for JSON strings
277
283
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/remote-server",
3
- "version": "0.86.10",
3
+ "version": "0.86.30",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -47,7 +47,7 @@
47
47
  "module": "./esm/index.es.js",
48
48
  "typings": "./esm/typings/src/_packages/remote-server.index.d.ts",
49
49
  "peerDependencies": {
50
- "@promptbook/core": "0.86.10"
50
+ "@promptbook/core": "0.86.30"
51
51
  },
52
52
  "dependencies": {
53
53
  "colors": "1.4.0",