@promptbook/utils 0.52.0-3 → 0.52.0-31

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 (54) 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/llm-execution-tools/remote/startRemoteServer.d.ts +1 -0
  13. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +1 -1
  14. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +4 -17
  15. package/esm/typings/execution/utils/forEachAsync.d.ts +18 -0
  16. package/esm/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +36 -4
  17. package/esm/typings/library/constructors/createPromptbookLibraryFromDirectory.test.d.ts +1 -0
  18. package/esm/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +2 -2
  19. package/esm/typings/library/constructors/createPromptbookLibraryFromPromise.test.d.ts +1 -0
  20. package/esm/typings/library/constructors/createPromptbookLibraryFromSources.test.d.ts +1 -0
  21. package/esm/typings/library/constructors/createPromptbookLibraryFromUrl.d.ts +22 -5
  22. package/esm/typings/library/constructors/justTestFsImport.d.ts +7 -0
  23. package/esm/typings/types/Prompt.d.ts +1 -1
  24. package/esm/typings/types/typeAliases.d.ts +2 -2
  25. package/package.json +2 -4
  26. package/umd/index.umd.js +563 -1608
  27. package/umd/index.umd.js.map +1 -1
  28. package/umd/typings/_packages/core.index.d.ts +15 -6
  29. package/umd/typings/_packages/utils.index.d.ts +5 -8
  30. package/umd/typings/execution/ExecutionTools.d.ts +5 -3
  31. package/umd/typings/execution/plugins/llm-execution-tools/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +0 -1
  32. package/umd/typings/execution/plugins/llm-execution-tools/azure-openai/AzureOpenAiExecutionTools.d.ts +0 -1
  33. package/umd/typings/execution/plugins/llm-execution-tools/langtail/LangtailExecutionTools.d.ts +0 -3
  34. package/umd/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionTools.d.ts +1 -1
  35. package/umd/typings/execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionTools.d.ts +1 -1
  36. package/umd/typings/execution/plugins/llm-execution-tools/remote/startRemoteServer.d.ts +1 -0
  37. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +1 -1
  38. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +4 -17
  39. package/umd/typings/execution/utils/forEachAsync.d.ts +18 -0
  40. package/umd/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +36 -4
  41. package/umd/typings/library/constructors/createPromptbookLibraryFromDirectory.test.d.ts +1 -0
  42. package/umd/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +2 -2
  43. package/umd/typings/library/constructors/createPromptbookLibraryFromPromise.test.d.ts +1 -0
  44. package/umd/typings/library/constructors/createPromptbookLibraryFromSources.test.d.ts +1 -0
  45. package/umd/typings/library/constructors/createPromptbookLibraryFromUrl.d.ts +22 -5
  46. package/umd/typings/library/constructors/justTestFsImport.d.ts +7 -0
  47. package/umd/typings/types/Prompt.d.ts +1 -1
  48. package/umd/typings/types/typeAliases.d.ts +2 -2
  49. package/esm/typings/_packages/wizzard.index.d.ts +0 -5
  50. package/esm/typings/wizzard/Wizzard.d.ts +0 -4
  51. package/esm/typings/wizzard/sample.d.ts +0 -6
  52. package/umd/typings/_packages/wizzard.index.d.ts +0 -5
  53. package/umd/typings/wizzard/Wizzard.d.ts +0 -4
  54. package/umd/typings/wizzard/sample.d.ts +0 -6
@@ -14,11 +14,11 @@ import { PromptbookLibrary } from '../PromptbookLibrary';
14
14
  * Note: The function does NOT return promise it returns the library directly which waits for the sources to be resolved
15
15
  * when error occurs in given promise or factory function, it is thrown during `listPromptbooks` or `getPromptbookByUrl` call
16
16
  *
17
+ * Note: Consider using `createPromptbookLibraryFromDirectory` or `createPromptbookLibraryFromUrl`
17
18
  *
18
19
  * @param promptbookSourcesPromiseOrFactory
19
20
  * @returns PromptbookLibrary
20
- *
21
- * @deprecated Consider using `createPromptbookLibraryFromUrl` or `createPromptbookLibraryFromDirectory`
21
+ * @private Just internal tool for other constructor functions
22
22
  */
23
23
  export declare function createPromptbookLibraryFromPromise(promptbookSourcesPromiseOrFactory: Promise<Array<PromptbookJson | PromptbookString>> | (() => Promise<Array<PromptbookJson | PromptbookString>>)): PromptbookLibrary;
24
24
  /***
@@ -1,13 +1,30 @@
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
  /***
28
+ * TODO: [⚖] Compatible with remote server
12
29
  * TODO: [🍓][🚯] !!! Add to README and samples + maybe make `@promptbook/library` package
13
30
  */
@@ -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-31",
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
  {