@promptbook/node 0.59.0-21 → 0.59.0-23

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 (47) hide show
  1. package/esm/index.es.js +22 -68
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/cli.index.d.ts +2 -2
  4. package/esm/typings/src/_packages/core.index.d.ts +6 -6
  5. package/esm/typings/src/_packages/node.index.d.ts +2 -2
  6. package/esm/typings/src/_packages/types.index.d.ts +2 -1
  7. package/esm/typings/src/cli/actions/hello.d.ts +7 -0
  8. package/esm/typings/src/cli/actions/make.d.ts +7 -0
  9. package/esm/typings/src/cli/actions/prettify.d.ts +7 -0
  10. package/esm/typings/src/{conversion/prettify/prettifyPromptbookStringCli.d.ts → cli/promptbookCli.d.ts} +2 -2
  11. package/esm/typings/src/library/SimplePromptbookLibrary.d.ts +3 -1
  12. package/{umd/typings/src/library/constructors/createPromptbookLibraryFromDirectory.d.ts → esm/typings/src/library/constructors/createLibraryFromDirectory.d.ts} +2 -2
  13. package/esm/typings/src/library/constructors/createLibraryFromJson.d.ts +12 -0
  14. package/{umd/typings/src/library/constructors/createPromptbookLibraryFromPromise.d.ts → esm/typings/src/library/constructors/createLibraryFromPromise.d.ts} +3 -7
  15. package/{umd/typings/src/library/constructors/createPromptbookLibraryFromUrl.d.ts → esm/typings/src/library/constructors/createLibraryFromUrl.d.ts} +2 -2
  16. package/esm/typings/src/library/constructors/{createPromptbookSublibrary.d.ts → createSublibrary.d.ts} +1 -1
  17. package/esm/typings/src/library/libraryToJson.d.ts +8 -0
  18. package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -1
  19. package/package.json +2 -2
  20. package/umd/index.umd.js +22 -68
  21. package/umd/index.umd.js.map +1 -1
  22. package/umd/typings/src/_packages/cli.index.d.ts +2 -2
  23. package/umd/typings/src/_packages/core.index.d.ts +6 -6
  24. package/umd/typings/src/_packages/node.index.d.ts +2 -2
  25. package/umd/typings/src/_packages/types.index.d.ts +2 -1
  26. package/umd/typings/src/cli/actions/hello.d.ts +7 -0
  27. package/umd/typings/src/cli/actions/make.d.ts +7 -0
  28. package/umd/typings/src/cli/actions/prettify.d.ts +7 -0
  29. package/umd/typings/src/{conversion/prettify/prettifyPromptbookStringCli.d.ts → cli/promptbookCli.d.ts} +2 -2
  30. package/umd/typings/src/library/SimplePromptbookLibrary.d.ts +3 -1
  31. package/{esm/typings/src/library/constructors/createPromptbookLibraryFromDirectory.d.ts → umd/typings/src/library/constructors/createLibraryFromDirectory.d.ts} +2 -2
  32. package/umd/typings/src/library/constructors/createLibraryFromJson.d.ts +12 -0
  33. package/{esm/typings/src/library/constructors/createPromptbookLibraryFromPromise.d.ts → umd/typings/src/library/constructors/createLibraryFromPromise.d.ts} +3 -7
  34. package/umd/typings/src/library/constructors/createLibraryFromPromise.test.d.ts +1 -0
  35. package/{esm/typings/src/library/constructors/createPromptbookLibraryFromUrl.d.ts → umd/typings/src/library/constructors/createLibraryFromUrl.d.ts} +2 -2
  36. package/umd/typings/src/library/constructors/{createPromptbookSublibrary.d.ts → createSublibrary.d.ts} +1 -1
  37. package/umd/typings/src/library/libraryToJson.d.ts +8 -0
  38. package/umd/typings/src/library/libraryToJson.test.d.ts +1 -0
  39. package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -1
  40. package/esm/typings/src/library/constructors/createPromptbookLibraryFromSources.d.ts +0 -16
  41. package/umd/typings/src/library/constructors/createPromptbookLibraryFromSources.d.ts +0 -16
  42. /package/esm/typings/src/library/constructors/{createPromptbookLibraryFromDirectory.test.d.ts → createLibraryFromDirectory.test.d.ts} +0 -0
  43. /package/esm/typings/src/library/constructors/{createPromptbookLibraryFromPromise.test.d.ts → createLibraryFromJson.test.d.ts} +0 -0
  44. /package/esm/typings/src/library/constructors/{createPromptbookLibraryFromSources.test.d.ts → createLibraryFromPromise.test.d.ts} +0 -0
  45. /package/{umd/typings/src/library/constructors/createPromptbookLibraryFromDirectory.test.d.ts → esm/typings/src/library/libraryToJson.test.d.ts} +0 -0
  46. /package/umd/typings/src/library/constructors/{createPromptbookLibraryFromPromise.test.d.ts → createLibraryFromDirectory.test.d.ts} +0 -0
  47. /package/umd/typings/src/library/constructors/{createPromptbookLibraryFromSources.test.d.ts → createLibraryFromJson.test.d.ts} +0 -0
@@ -0,0 +1,12 @@
1
+ import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
+ import { SimplePromptbookLibrary } from '../SimplePromptbookLibrary';
3
+ /**
4
+ * Creates PromptbookLibrary from array of PromptbookJson or PromptbookString
5
+ *
6
+ * Note: Functions `libraryToJson` and `createLibraryFromJson` are complementary
7
+ * Note: During the construction syntax and logic of all sources are validated
8
+ *
9
+ * @param promptbookSources
10
+ * @returns PromptbookLibrary
11
+ */
12
+ export declare function createLibraryFromJson(...promptbooks: Array<PromptbookJson>): Promise<SimplePromptbookLibrary>;
@@ -1,5 +1,4 @@
1
1
  import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
- import type { PromptbookString } from '../../types/PromptbookString';
3
2
  import type { PromptbookLibrary } from '../PromptbookLibrary';
4
3
  /**
5
4
  * Constructs Promptbook from async sources
@@ -8,19 +7,16 @@ import type { PromptbookLibrary } from '../PromptbookLibrary';
8
7
  * - Factory function that returns Promise of array of PromptbookJson or PromptbookString
9
8
  *
10
9
  * Note: This is useful as internal tool for other constructor functions like
11
- * `createPromptbookLibraryFromUrl` or `createPromptbookLibraryFromDirectory`
10
+ * `createLibraryFromUrl` or `createLibraryFromDirectory`
12
11
  * Consider using those functions instead of this one
13
12
  *
14
13
  * Note: The function does NOT return promise it returns the library directly which waits for the sources to be resolved
15
14
  * when error occurs in given promise or factory function, it is thrown during `listPromptbooks` or `getPromptbookByUrl` call
16
15
  *
17
- * Note: Consider using `createPromptbookLibraryFromDirectory` or `createPromptbookLibraryFromUrl`
16
+ * Note: Consider using `createLibraryFromDirectory` or `createLibraryFromUrl`
18
17
  *
19
18
  * @param promptbookSourcesPromiseOrFactory
20
19
  * @returns PromptbookLibrary
21
20
  * @deprecated Do not use, it will became internal tool for other constructor functions
22
21
  */
23
- export declare function createPromptbookLibraryFromPromise(promptbookSourcesPromiseOrFactory: Promise<Array<PromptbookJson | PromptbookString>> | (() => Promise<Array<PromptbookJson | PromptbookString>>)): PromptbookLibrary;
24
- /**
25
- * TODO: !!!! [🧠] Library precompilation and do not mix markdown and json promptbooks
26
- */
22
+ export declare function createLibraryFromPromise(promptbookSourcesPromiseOrFactory: Promise<Array<PromptbookJson>> | (() => Promise<Array<PromptbookJson>>)): PromptbookLibrary;
@@ -1,7 +1,7 @@
1
1
  import type { string_url } from '../../types/typeAliases';
2
2
  import type { PromptbookLibrary } from '../PromptbookLibrary';
3
3
  /**
4
- * Options for `createPromptbookLibraryFromDirectory` function
4
+ * Options for `createLibraryFromDirectory` function
5
5
  */
6
6
  type CreatePromptbookLibraryFromUrlyOptions = {
7
7
  /**
@@ -22,7 +22,7 @@ type CreatePromptbookLibraryFromUrlyOptions = {
22
22
 
23
23
  * @returns PromptbookLibrary
24
24
  */
25
- export declare function createPromptbookLibraryFromUrl(url: string_url | URL, options: CreatePromptbookLibraryFromUrlyOptions): Promise<PromptbookLibrary>;
25
+ export declare function createLibraryFromUrl(url: string_url | URL, options: CreatePromptbookLibraryFromUrlyOptions): Promise<PromptbookLibrary>;
26
26
  export {};
27
27
  /**
28
28
  * TODO: !!!! [🧠] Library precompilation and do not mix markdown and json promptbooks
@@ -9,4 +9,4 @@ import type { PromptbookLibrary } from '../PromptbookLibrary';
9
9
  * @param promptbookSources
10
10
  * @returns PromptbookLibrary
11
11
  */
12
- export declare function createPromptbookSublibrary(library: PromptbookLibrary, predicate: (url: string_promptbook_url) => boolean): PromptbookLibrary;
12
+ export declare function createSublibrary(library: PromptbookLibrary, predicate: (url: string_promptbook_url) => boolean): PromptbookLibrary;
@@ -0,0 +1,8 @@
1
+ import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
2
+ import type { PromptbookLibrary } from './PromptbookLibrary';
3
+ /**
4
+ * Converts PromptbookLibrary to serialized JSON
5
+ *
6
+ * Note: Functions `libraryToJson` and `createLibraryFromJson` are complementary
7
+ */
8
+ export declare function libraryToJson(library: PromptbookLibrary): Promise<Array<PromptbookJson>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -10,7 +10,7 @@ import type { RemoteServerOptions } from './interfaces/RemoteServerOptions';
10
10
  */
11
11
  export declare function startRemoteServer(options: RemoteServerOptions): IDestroyable;
12
12
  /**
13
- * TODO: [⚖] Expose the library to be able to connect to same library via createPromptbookLibraryFromUrl
13
+ * TODO: [⚖] Expose the library to be able to connect to same library via createLibraryFromUrl
14
14
  * TODO: Handle progress - support streaming
15
15
  * TODO: [🤹‍♂️] Do not hang up immediately but wait until client closes OR timeout
16
16
  * TODO: [🤹‍♂️] Timeout on chat to free up resources
@@ -1,16 +0,0 @@
1
- import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
- import type { PromptbookString } from '../../types/PromptbookString';
3
- import { SimplePromptbookLibrary } from '../SimplePromptbookLibrary';
4
- /**
5
- * Creates PromptbookLibrary from array of PromptbookJson or PromptbookString
6
- *
7
- * Note: You can combine `PromptbookString` (`.ptbk.md`) with `PromptbookJson` BUT it is not recommended
8
- * Note: During the construction syntax and logic of all sources are validated
9
- *
10
- * @param promptbookSources
11
- * @returns PromptbookLibrary
12
- */
13
- export declare function createPromptbookLibraryFromSources(...promptbookSources: Array<PromptbookJson | PromptbookString>): Promise<SimplePromptbookLibrary>;
14
- /**
15
- * TODO: !!!! [🧠] Library precompilation and do not mix markdown and json promptbooks
16
- */
@@ -1,16 +0,0 @@
1
- import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
- import type { PromptbookString } from '../../types/PromptbookString';
3
- import { SimplePromptbookLibrary } from '../SimplePromptbookLibrary';
4
- /**
5
- * Creates PromptbookLibrary from array of PromptbookJson or PromptbookString
6
- *
7
- * Note: You can combine `PromptbookString` (`.ptbk.md`) with `PromptbookJson` BUT it is not recommended
8
- * Note: During the construction syntax and logic of all sources are validated
9
- *
10
- * @param promptbookSources
11
- * @returns PromptbookLibrary
12
- */
13
- export declare function createPromptbookLibraryFromSources(...promptbookSources: Array<PromptbookJson | PromptbookString>): Promise<SimplePromptbookLibrary>;
14
- /**
15
- * TODO: !!!! [🧠] Library precompilation and do not mix markdown and json promptbooks
16
- */