@promptbook/cli 0.52.0-27 → 0.52.0-29

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 CHANGED
@@ -142,7 +142,7 @@ new Function("\n try {\n if (typeof WorkerGlobalScope !== 'undefined'
142
142
  /**
143
143
  * The version of the Promptbook library
144
144
  */
145
- var PROMPTBOOK_VERSION = '0.52.0-26';
145
+ var PROMPTBOOK_VERSION = '0.52.0-28';
146
146
 
147
147
  /**
148
148
  * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
@@ -5,6 +5,7 @@ import { extractVariables } from '../conversion/utils/extractVariables';
5
5
  import { parseNumber } from '../conversion/utils/parseNumber';
6
6
  import { renameParameter } from '../conversion/utils/renameParameter';
7
7
  import { titleToName } from '../conversion/utils/titleToName';
8
+ import { forEachAsync } from '../execution/utils/forEachAsync';
8
9
  import { replaceParameters } from '../execution/utils/replaceParameters';
9
10
  import { CountUtils } from '../utils/expectation-counters';
10
11
  import { countCharacters } from '../utils/expectation-counters/countCharacters';
@@ -46,6 +47,7 @@ import { union } from '../utils/sets/union';
46
47
  import { trimCodeBlock } from '../utils/trimCodeBlock';
47
48
  import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
48
49
  import { unwrapResult } from '../utils/unwrapResult';
50
+ export { forEachAsync };
49
51
  export { extractAllBlocksFromMarkdown, // <- [🌻]
50
52
  extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
51
53
  extractOneBlockFromMarkdown, extractParameters, extractVariables, isValidJsonString, parseNumber, // <- [🌻]
@@ -0,0 +1,18 @@
1
+ import type { Promisable } from 'type-fest';
2
+ type ForEachAsyncOptions = {
3
+ /**
4
+ * Maximum number of tasks running in parallel
5
+ *
6
+ * @default Infinity
7
+ */
8
+ inParallelCount?: number;
9
+ };
10
+ /**
11
+ * Async version of Array.forEach
12
+ *
13
+ * @param array - Array to iterate over
14
+ * @param options - Options for the function
15
+ * @param callbackfunction - Function to call for each item
16
+ */
17
+ export declare function forEachAsync<TItem>(array: Array<TItem>, options: ForEachAsyncOptions, callbackfunction: (value: TItem, index: number, array: Array<TItem>) => Promisable<void>): Promise<void>;
18
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/cli",
3
- "version": "0.52.0-27",
3
+ "version": "0.52.0-29",
4
4
  "description": "Library to supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -52,7 +52,7 @@
52
52
  }
53
53
  ],
54
54
  "peerDependencies": {
55
- "@promptbook/core": "0.52.0-27"
55
+ "@promptbook/core": "0.52.0-29"
56
56
  },
57
57
  "main": "./umd/index.umd.js",
58
58
  "module": "./esm/index.es.js",
package/umd/index.umd.js CHANGED
@@ -146,7 +146,7 @@
146
146
  /**
147
147
  * The version of the Promptbook library
148
148
  */
149
- var PROMPTBOOK_VERSION = '0.52.0-26';
149
+ var PROMPTBOOK_VERSION = '0.52.0-28';
150
150
 
151
151
  /**
152
152
  * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
@@ -5,6 +5,7 @@ import { extractVariables } from '../conversion/utils/extractVariables';
5
5
  import { parseNumber } from '../conversion/utils/parseNumber';
6
6
  import { renameParameter } from '../conversion/utils/renameParameter';
7
7
  import { titleToName } from '../conversion/utils/titleToName';
8
+ import { forEachAsync } from '../execution/utils/forEachAsync';
8
9
  import { replaceParameters } from '../execution/utils/replaceParameters';
9
10
  import { CountUtils } from '../utils/expectation-counters';
10
11
  import { countCharacters } from '../utils/expectation-counters/countCharacters';
@@ -46,6 +47,7 @@ import { union } from '../utils/sets/union';
46
47
  import { trimCodeBlock } from '../utils/trimCodeBlock';
47
48
  import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
48
49
  import { unwrapResult } from '../utils/unwrapResult';
50
+ export { forEachAsync };
49
51
  export { extractAllBlocksFromMarkdown, // <- [🌻]
50
52
  extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
51
53
  extractOneBlockFromMarkdown, extractParameters, extractVariables, isValidJsonString, parseNumber, // <- [🌻]
@@ -0,0 +1,18 @@
1
+ import type { Promisable } from 'type-fest';
2
+ type ForEachAsyncOptions = {
3
+ /**
4
+ * Maximum number of tasks running in parallel
5
+ *
6
+ * @default Infinity
7
+ */
8
+ inParallelCount?: number;
9
+ };
10
+ /**
11
+ * Async version of Array.forEach
12
+ *
13
+ * @param array - Array to iterate over
14
+ * @param options - Options for the function
15
+ * @param callbackfunction - Function to call for each item
16
+ */
17
+ export declare function forEachAsync<TItem>(array: Array<TItem>, options: ForEachAsyncOptions, callbackfunction: (value: TItem, index: number, array: Array<TItem>) => Promisable<void>): Promise<void>;
18
+ export {};