@promptbook/utils 0.52.0-3 → 0.52.0-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.
Files changed (52) hide show
  1. package/README.md +1 -3
  2. package/esm/index.es.js +559 -1597
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/_packages/core.index.d.ts +15 -6
  5. package/esm/typings/_packages/utils.index.d.ts +5 -8
  6. package/esm/typings/execution/ExecutionTools.d.ts +5 -3
  7. package/esm/typings/execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +0 -1
  8. package/esm/typings/execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionTools.d.ts +0 -1
  9. package/esm/typings/execution/plugins/llm-execution-tools/langtail/LangtailExecutionTools.d.ts +0 -3
  10. package/esm/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionTools.d.ts +1 -1
  11. package/esm/typings/execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionTools.d.ts +1 -1
  12. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +1 -1
  13. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +4 -17
  14. package/esm/typings/execution/utils/forEachAsync.d.ts +18 -0
  15. package/esm/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +36 -4
  16. package/esm/typings/library/constructors/createPromptbookLibraryFromDirectory.test.d.ts +1 -0
  17. package/esm/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +2 -2
  18. package/esm/typings/library/constructors/createPromptbookLibraryFromPromise.test.d.ts +1 -0
  19. package/esm/typings/library/constructors/createPromptbookLibraryFromSources.test.d.ts +1 -0
  20. package/esm/typings/library/constructors/createPromptbookLibraryFromUrl.d.ts +21 -5
  21. package/esm/typings/library/constructors/justTestFsImport.d.ts +7 -0
  22. package/esm/typings/types/Prompt.d.ts +1 -1
  23. package/esm/typings/types/typeAliases.d.ts +2 -2
  24. package/package.json +2 -4
  25. package/umd/index.umd.js +563 -1608
  26. package/umd/index.umd.js.map +1 -1
  27. package/umd/typings/_packages/core.index.d.ts +15 -6
  28. package/umd/typings/_packages/utils.index.d.ts +5 -8
  29. package/umd/typings/execution/ExecutionTools.d.ts +5 -3
  30. package/umd/typings/execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +0 -1
  31. package/umd/typings/execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionTools.d.ts +0 -1
  32. package/umd/typings/execution/plugins/llm-execution-tools/langtail/LangtailExecutionTools.d.ts +0 -3
  33. package/umd/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionTools.d.ts +1 -1
  34. package/umd/typings/execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionTools.d.ts +1 -1
  35. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +1 -1
  36. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +4 -17
  37. package/umd/typings/execution/utils/forEachAsync.d.ts +18 -0
  38. package/umd/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +36 -4
  39. package/umd/typings/library/constructors/createPromptbookLibraryFromDirectory.test.d.ts +1 -0
  40. package/umd/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +2 -2
  41. package/umd/typings/library/constructors/createPromptbookLibraryFromPromise.test.d.ts +1 -0
  42. package/umd/typings/library/constructors/createPromptbookLibraryFromSources.test.d.ts +1 -0
  43. package/umd/typings/library/constructors/createPromptbookLibraryFromUrl.d.ts +21 -5
  44. package/umd/typings/library/constructors/justTestFsImport.d.ts +7 -0
  45. package/umd/typings/types/Prompt.d.ts +1 -1
  46. package/umd/typings/types/typeAliases.d.ts +2 -2
  47. package/esm/typings/_packages/wizzard.index.d.ts +0 -5
  48. package/esm/typings/wizzard/Wizzard.d.ts +0 -4
  49. package/esm/typings/wizzard/sample.d.ts +0 -6
  50. package/umd/typings/_packages/wizzard.index.d.ts +0 -5
  51. package/umd/typings/wizzard/Wizzard.d.ts +0 -4
  52. package/umd/typings/wizzard/sample.d.ts +0 -6
@@ -1,13 +1,29 @@
1
+ import { string_url } from '../../types/typeAliases';
1
2
  import { PromptbookLibrary } from '../PromptbookLibrary';
3
+ /**
4
+ * Options for `createPromptbookLibraryFromDirectory` function
5
+ */
6
+ type CreatePromptbookLibraryFromUrlyOptions = {
7
+ /**
8
+ * If true, the library creation outputs information about each file it reads
9
+ *
10
+ * @default false
11
+ */
12
+ isVerbose?: boolean;
13
+ /**
14
+ * If true, directory will be scanned only when needed not during the construction
15
+ *
16
+ * @default false
17
+ */
18
+ isLazyLoaded?: boolean;
19
+ };
2
20
  /**
3
21
  * Constructs Promptbook from remote Promptbase URL
4
- *
5
- * Note: The function does NOT return promise it returns the library directly which dynamically loads promptbooks when needed
6
- * SO during the construction syntax and logic sources IS NOT validated
7
- *
22
+
8
23
  * @returns PromptbookLibrary
9
24
  */
10
- export declare function createPromptbookLibraryFromUrl(): PromptbookLibrary;
25
+ export declare function createPromptbookLibraryFromUrl(url: string_url | URL, options: CreatePromptbookLibraryFromUrlyOptions): Promise<PromptbookLibrary>;
26
+ export {};
11
27
  /***
12
28
  * TODO: [🍓][🚯] !!! Add to README and samples + maybe make `@promptbook/library` package
13
29
  */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Just testing imports and compatibility
3
+ */
4
+ export declare function justTestFsImport(): Promise<void>;
5
+ /**
6
+ * TODO: !!! Remove this file
7
+ */
@@ -39,7 +39,7 @@ export type Prompt = {
39
39
  /**
40
40
  * Unique identifier of the promptbook with specific template name as hash
41
41
  *
42
- * @example https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15#keywords
42
+ * @example https://promptbook.webgpt.com/cs/write-website-content.ptbk.md#keywords
43
43
  */
44
44
  readonly promptbookUrl: string_promptbook_url_with_hashtemplate;
45
45
  /**
@@ -179,13 +179,13 @@ export type string_url = string;
179
179
  /**
180
180
  * Semantic helper
181
181
  *
182
- * For example `"https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15"`
182
+ * For example `"https://promptbook.webgpt.com/cs/write-website-content.ptbk.md"`
183
183
  */
184
184
  export type string_promptbook_url = string;
185
185
  /**
186
186
  * Semantic helper
187
187
  *
188
- * For example `"https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15#keywords"`
188
+ * For example `"https://promptbook.webgpt.com/cs/write-website-content.ptbk.md#keywords"`
189
189
  */
190
190
  export type string_promptbook_url_with_hashtemplate = string;
191
191
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/utils",
3
- "version": "0.52.0-3",
3
+ "version": "0.52.0-30",
4
4
  "description": "Library to supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -34,9 +34,7 @@
34
34
  },
35
35
  "homepage": "https://www.npmjs.com/package/@promptbook/core",
36
36
  "dependencies": {
37
- "moment": "2.30.1",
38
- "prettier": "2.8.1",
39
- "spacetrim": "0.11.25"
37
+ "spacetrim": "0.11.27"
40
38
  },
41
39
  "funding": [
42
40
  {