@promptbook/types 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.
package/README.md CHANGED
@@ -77,15 +77,15 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
77
77
 
78
78
 
79
79
 
80
- If you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 2, or whatever, it doesn't matter how you integrate it. Whether it's calling a REST API directly, using the SDK, hardcoding the prompt into the source code, or importing a text file, the process remains the same.
80
+ If you have a simple, single prompt for ChatGPT, GPT-4, Anthropic Claude, Google Gemini, Llama 3, or whatever, it doesn't matter how you integrate it. Whether it's calling a REST API directly, using the SDK, hardcoding the prompt into the source code, or importing a text file, the process remains the same.
81
81
 
82
- But often you will struggle with the limitations of LLMs, such as hallucinations, off-topic responses, poor quality output, language drift, word repetition repetition repetition repetition or misuse, lack of context, or just plain w𝒆𝐢rd responses. When this happens, you generally have three options:
82
+ But often you will struggle with the **limitations of LLMs**, such as **hallucinations, off-topic responses, poor quality output, language and prompt drift, word repetition repetition repetition repetition or misuse, lack of context, or just plain w𝒆𝐢rd responses**. When this happens, you generally have three options:
83
83
 
84
84
  1. **Fine-tune** the model to your specifications or even train your own.
85
85
  2. **Prompt-engineer** the prompt to the best shape you can achieve.
86
86
  3. Orchestrate **multiple prompts** in a [pipeline](https://github.com/webgptorg/promptbook/discussions/64) to get the best result.
87
87
 
88
- In all of these situations, but especially in 3., the Promptbook library can make your life easier.
88
+ In all of these situations, but especially in 3., the **✨ Promptbook can make your life waaaaaaaaaay easier**.
89
89
 
90
90
  - [**Separates concerns**](https://github.com/webgptorg/promptbook/discussions/32) between prompt-engineer and programmer, between code files and prompt files, and between prompts and their execution logic.
91
91
  - Establishes a [**common format `.ptbk.md`**](https://github.com/webgptorg/promptbook/discussions/85) that can be used to describe your prompt business logic without having to write code or deal with the technicalities of LLMs.
@@ -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/types",
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,
@@ -50,6 +50,6 @@
50
50
  ],
51
51
  "typings": "./esm/typings/src/_packages/types.index.d.ts",
52
52
  "peerDependencies": {
53
- "@promptbook/core": "0.72.0-32"
53
+ "@promptbook/core": "0.72.0-34"
54
54
  }
55
55
  }