@promptbook/core 0.72.0-32 → 0.72.0-34

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.
@@ -4,7 +4,7 @@ import type { string_executable_path } from '../../types/typeAliases';
4
4
  *
5
5
  * @private within the repository
6
6
  */
7
- export declare function locateLibreoffice(): Promise<string_executable_path>;
7
+ export declare function locateLibreoffice(): Promise<string_executable_path | null>;
8
8
  /**
9
9
  * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
10
10
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
@@ -4,7 +4,7 @@ import type { string_executable_path } from '../../types/typeAliases';
4
4
  *
5
5
  * @private within the repository
6
6
  */
7
- export declare function locatePandoc(): Promise<string_executable_path>;
7
+ export declare function locatePandoc(): Promise<string_executable_path | null>;
8
8
  /**
9
9
  * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
10
10
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
@@ -26,7 +26,7 @@ export interface LocateAppOptions {
26
26
  *
27
27
  * @private within the repository
28
28
  */
29
- export declare function locateApp(options: RequireAtLeastOne<LocateAppOptions, 'linuxWhich' | 'windowsSuffix' | 'macOsName'>): Promise<string_executable_path>;
29
+ export declare function locateApp(options: RequireAtLeastOne<LocateAppOptions, 'linuxWhich' | 'windowsSuffix' | 'macOsName'>): Promise<string_executable_path | null>;
30
30
  /**
31
31
  * TODO: [🧠][♿] Maybe export through `@promptbook/node`
32
32
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
@@ -1,11 +1,11 @@
1
- import type { LocateAppOptions } from '../locateApp';
2
1
  import type { string_executable_path } from '../../types/typeAliases';
2
+ import type { LocateAppOptions } from '../locateApp';
3
3
  /**
4
4
  * @@@
5
5
  *
6
6
  * @private within the repository
7
7
  */
8
- export declare function locateAppOnLinux({ appName, linuxWhich, }: Pick<Required<LocateAppOptions>, 'appName' | 'linuxWhich'>): Promise<string_executable_path>;
8
+ export declare function locateAppOnLinux({ appName, linuxWhich, }: Pick<Required<LocateAppOptions>, 'appName' | 'linuxWhich'>): Promise<string_executable_path | null>;
9
9
  /**
10
10
  * TODO: [🧠][♿] Maybe export through `@promptbook/node`
11
11
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
@@ -5,7 +5,7 @@ import type { LocateAppOptions } from '../locateApp';
5
5
  *
6
6
  * @private within the repository
7
7
  */
8
- export declare function locateAppOnMacOs({ appName, macOsName, }: Pick<Required<LocateAppOptions>, 'appName' | 'macOsName'>): Promise<string_executable_path>;
8
+ export declare function locateAppOnMacOs({ appName, macOsName, }: Pick<Required<LocateAppOptions>, 'appName' | 'macOsName'>): Promise<string_executable_path | null>;
9
9
  /**
10
10
  * TODO: [🧠][♿] Maybe export through `@promptbook/node`
11
11
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
@@ -5,7 +5,7 @@ import type { LocateAppOptions } from '../locateApp';
5
5
  *
6
6
  * @private within the repository
7
7
  */
8
- export declare function locateAppOnWindows({ appName, windowsSuffix, }: Pick<Required<LocateAppOptions>, 'appName' | 'windowsSuffix'>): Promise<string_executable_path>;
8
+ export declare function locateAppOnWindows({ appName, windowsSuffix, }: Pick<Required<LocateAppOptions>, 'appName' | 'windowsSuffix'>): Promise<string_executable_path | null>;
9
9
  /**
10
10
  * TODO: [🧠][♿] Maybe export through `@promptbook/node`
11
11
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
@@ -2,9 +2,11 @@ import type { ExecCommandOptions } from './ExecCommandOptions';
2
2
  /**
3
3
  * Run one command in a shell
4
4
  *
5
+ *
5
6
  * Note: There are 2 similar functions in the codebase:
6
7
  * - `$execCommand` which runs a single command
7
8
  * - `$execCommands` which runs multiple commands
9
+ * Note: `$` is used to indicate that this function is not a pure function - it runs a command in a shell
8
10
  *
9
11
  * @public exported from `@promptbook/node`
10
12
  */
@@ -3,8 +3,10 @@ import type { ExecCommandOptionsAdvanced } from './ExecCommandOptions';
3
3
  /**
4
4
  * Normalize options for `execCommand` and `execCommands`
5
5
  *
6
+ * Note: `$` is used to indicate that this function behaves differently according to `process.platform`
7
+ *
6
8
  * @private internal utility of `execCommand` and `execCommands`
7
9
  */
8
- export declare function execCommandNormalizeOptions(options: ExecCommandOptions): Pick<ExecCommandOptionsAdvanced, 'command' | 'args' | 'cwd' | 'crashOnError' | 'timeout'> & {
10
+ export declare function $execCommandNormalizeOptions(options: ExecCommandOptions): Pick<ExecCommandOptionsAdvanced, 'command' | 'args' | 'cwd' | 'crashOnError' | 'timeout' | 'isVerbose'> & {
9
11
  humanReadableCommand: string;
10
12
  };
@@ -4,6 +4,7 @@
4
4
  * Note: There are 2 similar functions in the codebase:
5
5
  * - `$execCommand` which runs a single command
6
6
  * - `$execCommands` which runs multiple commands
7
+ * Note: `$` is used to indicate that this function is not a pure function - it runs a commands in a shell
7
8
  *
8
9
  * @public exported from `@promptbook/node`
9
10
  */
@@ -5,15 +5,41 @@ type RequiredAndOptional<TBase, TRequired extends keyof TBase, TOptional extends
5
5
  /**
6
6
  * Simple options for `execCommand`
7
7
  */
8
- export type ExecCommandOptions = string | RequiredAndOptional<ExecCommandOptionsAdvanced, 'command', 'args' | 'cwd' | 'crashOnError' | 'timeout'>;
8
+ export type ExecCommandOptions = string | RequiredAndOptional<ExecCommandOptionsAdvanced, 'command', 'args' | 'cwd' | 'crashOnError' | 'timeout' | 'isVerbose'>;
9
9
  /**
10
10
  * Advanced options for `execCommand`
11
11
  */
12
12
  export type ExecCommandOptionsAdvanced = {
13
+ /**
14
+ * Command to run
15
+ */
13
16
  readonly command: string;
17
+ /**
18
+ * Arguments for the command
19
+ */
14
20
  readonly args: string[];
21
+ /**
22
+ * Current working directory
23
+ *
24
+ * @default process.cwd()
25
+ */
15
26
  readonly cwd: string;
27
+ /**
28
+ * If `true` then the command will throw an error if the return code is not `0`
29
+ */
16
30
  readonly crashOnError: boolean;
31
+ /**
32
+ * Timeout in milliseconds
33
+ */
17
34
  readonly timeout: number;
35
+ /**
36
+ * If `true` then the command and entire CLI output will be logged to the console
37
+ *
38
+ * @default false
39
+ */
40
+ readonly isVerbose?: boolean;
18
41
  };
19
42
  export {};
43
+ /**
44
+ * TODO: [⏳] Make DEFAULT_TIMEOUT_MS as global constant
45
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/core",
3
- "version": "0.72.0-32",
3
+ "version": "0.72.0-34",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
package/umd/index.umd.js CHANGED
@@ -16,7 +16,7 @@
16
16
  /**
17
17
  * The version of the Promptbook library
18
18
  */
19
- var PROMPTBOOK_VERSION = '0.72.0-31';
19
+ var PROMPTBOOK_VERSION = '0.72.0-33';
20
20
  // TODO: [main] !!!! List here all the versions and annotate + put into script
21
21
 
22
22
  /*! *****************************************************************************