@promptbook/node 0.114.0-25 → 0.114.0-27
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/esm/index.es.js +23 -9
- package/esm/index.es.js.map +1 -1
- package/esm/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/harness/$resolveHarnessCommandPath.d.ts +14 -0
- package/esm/src/cli/cli-commands/common/harness/$resolveHarnessInstallationOrigin.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/$runHarnessInstallationCommand.d.ts +43 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +26 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessInstallationOrigin.d.ts +36 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +5 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessUpdatePlan.d.ts +23 -0
- package/esm/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +4 -1
- package/esm/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.d.ts +8 -0
- package/esm/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.d.ts +31 -0
- package/esm/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/npm/$resolveNpmGlobalPrefixPath.d.ts +9 -0
- package/esm/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +14 -7
- package/esm/src/commitments/index.d.ts +1 -1
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +23 -9
- package/umd/index.umd.js.map +1 -1
- package/umd/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/harness/$resolveHarnessCommandPath.d.ts +14 -0
- package/umd/src/cli/cli-commands/common/harness/$resolveHarnessInstallationOrigin.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/$runHarnessInstallationCommand.d.ts +43 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +26 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessInstallationOrigin.d.ts +36 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +5 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessUpdatePlan.d.ts +23 -0
- package/umd/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +4 -1
- package/umd/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.d.ts +8 -0
- package/umd/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.d.ts +31 -0
- package/umd/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/npm/$resolveNpmGlobalPrefixPath.d.ts +9 -0
- package/umd/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +14 -7
- package/umd/src/commitments/index.d.ts +1 -1
- package/umd/src/version.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/harness/$installHarness.d.ts +0 -13
- package/umd/src/cli/cli-commands/common/harness/$installHarness.d.ts +0 -13
|
@@ -2,7 +2,7 @@ import type { HarnessInstallationStatus } from './HarnessInstallationStatus';
|
|
|
2
2
|
/**
|
|
3
3
|
* Reports one detected harness installation status and offers to install or update the harness.
|
|
4
4
|
*
|
|
5
|
-
* Note: `$` is used to indicate that this function is not a pure function - it asks the user and installs
|
|
5
|
+
* Note: `$` is used to indicate that this function is not a pure function - it asks the user and installs software
|
|
6
6
|
*
|
|
7
7
|
* @private internal utility of `promptbookCli`
|
|
8
8
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
|
+
/**
|
|
3
|
+
* Finds out which file is really executed when the harness command runs.
|
|
4
|
+
*
|
|
5
|
+
* The lookup deliberately uses the very same `PATH` which runs the harness, so it reports the copy of the
|
|
6
|
+
* harness which Promptbook itself would use. Symbolic links are followed, because installers like the
|
|
7
|
+
* standalone OpenAI Codex installer only link their package into a directory on `PATH`.
|
|
8
|
+
*
|
|
9
|
+
* Note: `$` is used to indicate that this function is not a pure function - it runs a command in a shell
|
|
10
|
+
*
|
|
11
|
+
* @returns Resolved path of the harness command or `null` when the command is not available
|
|
12
|
+
* @private internal utility of `promptbookCli`
|
|
13
|
+
*/
|
|
14
|
+
export declare function $resolveHarnessCommandPath(definition: HarnessDefinition): Promise<string | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
|
+
import type { HarnessInstallationOrigin } from './HarnessInstallationOrigin';
|
|
3
|
+
/**
|
|
4
|
+
* Finds out where one CLI coding harness is really installed and which tool manages it.
|
|
5
|
+
*
|
|
6
|
+
* Note: `$` is used to indicate that this function is not a pure function - it runs shell commands
|
|
7
|
+
*
|
|
8
|
+
* @private internal utility of `promptbookCli`
|
|
9
|
+
*/
|
|
10
|
+
export declare function $resolveHarnessInstallationOrigin(definition: HarnessDefinition): Promise<HarnessInstallationOrigin>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
|
+
/**
|
|
3
|
+
* What one harness installation command does with the harness.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `promptbookCli`
|
|
6
|
+
*/
|
|
7
|
+
export type HarnessInstallationOperation = 'install' | 'update';
|
|
8
|
+
/**
|
|
9
|
+
* Options of one command which installs or updates a CLI coding harness.
|
|
10
|
+
*
|
|
11
|
+
* @private internal utility of `$runHarnessInstallationCommand`
|
|
12
|
+
*/
|
|
13
|
+
type HarnessInstallationCommandOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* Harness which is installed or updated.
|
|
16
|
+
*/
|
|
17
|
+
readonly definition: HarnessDefinition;
|
|
18
|
+
/**
|
|
19
|
+
* What the command does with the harness.
|
|
20
|
+
*/
|
|
21
|
+
readonly operation: HarnessInstallationOperation;
|
|
22
|
+
/**
|
|
23
|
+
* Shell command which does it.
|
|
24
|
+
*/
|
|
25
|
+
readonly command: string;
|
|
26
|
+
/**
|
|
27
|
+
* Extra environment variables required by the command.
|
|
28
|
+
*/
|
|
29
|
+
readonly environment?: Readonly<Record<string, string>>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Runs one command which installs or updates a CLI coding harness.
|
|
33
|
+
*
|
|
34
|
+
* A failed installation is reported but never aborts the running command, because the harness check
|
|
35
|
+
* is only an assistant - the command itself may still work with a manually managed harness.
|
|
36
|
+
*
|
|
37
|
+
* Note: `$` is used to indicate that this function is not a pure function - it installs software
|
|
38
|
+
*
|
|
39
|
+
* @returns `true` when the command succeeded, `false` when it failed
|
|
40
|
+
* @private internal utility of `promptbookCli`
|
|
41
|
+
*/
|
|
42
|
+
export declare function $runHarnessInstallationCommand(options: HarnessInstallationCommandOptions): Promise<boolean>;
|
|
43
|
+
export {};
|
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
import type { PromptRunnerHarnessName } from '../promptRunnerCliOptions';
|
|
2
|
+
/**
|
|
3
|
+
* Description of a standalone *(self-managed)* installation of one CLI coding harness.
|
|
4
|
+
*
|
|
5
|
+
* Some harnesses are also distributed by their own installer which puts the harness outside of npm and
|
|
6
|
+
* updates it in place. Such an installation must never be updated with `npm install -g`, because that
|
|
7
|
+
* installs a second copy of the harness instead of updating the one which is really used.
|
|
8
|
+
*
|
|
9
|
+
* @private internal utility of `promptbookCli`
|
|
10
|
+
*/
|
|
11
|
+
export type HarnessStandaloneInstallation = {
|
|
12
|
+
/**
|
|
13
|
+
* Directory names which appear in the resolved path of a standalone installation of the harness,
|
|
14
|
+
* for example `.codex` in `~/.codex/packages/standalone/current/bin/codex`.
|
|
15
|
+
*/
|
|
16
|
+
readonly directoryNames: ReadonlyArray<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Command which updates the standalone installation in place.
|
|
19
|
+
*/
|
|
20
|
+
readonly updateCommand: string;
|
|
21
|
+
};
|
|
2
22
|
/**
|
|
3
23
|
* Static description of one supported CLI coding harness.
|
|
4
24
|
*
|
|
@@ -25,6 +45,12 @@ export type HarnessDefinition = {
|
|
|
25
45
|
* Extra environment variables required by the global npm installation of this harness.
|
|
26
46
|
*/
|
|
27
47
|
readonly npmInstallEnvironment?: Readonly<Record<string, string>>;
|
|
48
|
+
/**
|
|
49
|
+
* How a standalone installation of this harness is recognized and updated.
|
|
50
|
+
*
|
|
51
|
+
* Harnesses which are distributed only through npm leave this undefined.
|
|
52
|
+
*/
|
|
53
|
+
readonly standaloneInstallation?: HarnessStandaloneInstallation;
|
|
28
54
|
};
|
|
29
55
|
/**
|
|
30
56
|
* Single source of truth about how each supported CLI coding harness is installed and detected.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Way in which the globally available harness command got onto the current machine.
|
|
3
|
+
*
|
|
4
|
+
* - `npm-global` the command comes from a global npm installation, so `npm install -g` really updates it
|
|
5
|
+
* - `standalone` the command was installed by the own installer of the harness and updates itself in place
|
|
6
|
+
* - `homebrew` the command is managed by Homebrew, so only `brew` may update it
|
|
7
|
+
* - `unknown` the command lives somewhere else or could not be located at all
|
|
8
|
+
*
|
|
9
|
+
* @private internal utility of `promptbookCli`
|
|
10
|
+
*/
|
|
11
|
+
export type HarnessInstallationMethod = 'npm-global' | 'standalone' | 'homebrew' | 'unknown';
|
|
12
|
+
/**
|
|
13
|
+
* Place where the harness command really lives together with the way it was installed there.
|
|
14
|
+
*
|
|
15
|
+
* Knowing the origin is what keeps an update from installing a **second** copy of a harness which is
|
|
16
|
+
* managed outside of npm, for example the standalone installation of OpenAI Codex.
|
|
17
|
+
*
|
|
18
|
+
* @private internal utility of `promptbookCli`
|
|
19
|
+
*/
|
|
20
|
+
export type HarnessInstallationOrigin = {
|
|
21
|
+
/**
|
|
22
|
+
* Resolved path of the harness command with every symbolic link followed
|
|
23
|
+
* or `null` when the command could not be located.
|
|
24
|
+
*/
|
|
25
|
+
readonly commandPath: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Way in which the harness command was installed.
|
|
28
|
+
*/
|
|
29
|
+
readonly installationMethod: HarnessInstallationMethod;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Origin used when the harness command was not looked up at all, for example when the update check is disabled.
|
|
33
|
+
*
|
|
34
|
+
* @private internal utility of `promptbookCli`
|
|
35
|
+
*/
|
|
36
|
+
export declare const UNKNOWN_HARNESS_INSTALLATION_ORIGIN: HarnessInstallationOrigin;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
|
+
import type { HarnessInstallationOrigin } from './HarnessInstallationOrigin';
|
|
2
3
|
/**
|
|
3
4
|
* Result of comparing the globally installed harness version with the newest published one.
|
|
4
5
|
*
|
|
@@ -33,4 +34,8 @@ export type HarnessInstallationStatus = {
|
|
|
33
34
|
* Newest version published to npm or `null` when it could not be resolved.
|
|
34
35
|
*/
|
|
35
36
|
readonly latestVersion: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* Place where the harness command lives together with the way it was installed there.
|
|
39
|
+
*/
|
|
40
|
+
readonly installationOrigin: HarnessInstallationOrigin;
|
|
36
41
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How an outdated CLI coding harness can be brought up to date where it is really installed.
|
|
3
|
+
*
|
|
4
|
+
* @private internal utility of `promptbookCli`
|
|
5
|
+
*/
|
|
6
|
+
export type HarnessUpdatePlan = {
|
|
7
|
+
/**
|
|
8
|
+
* Command which updates the harness in place
|
|
9
|
+
* or `null` when the installation is not understood well enough to name one.
|
|
10
|
+
*/
|
|
11
|
+
readonly command: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Whether Promptbook may run the command itself instead of only printing it.
|
|
14
|
+
*
|
|
15
|
+
* Only installations which Promptbook can update without any side effect are updated automatically,
|
|
16
|
+
* everything else is left to the user together with the instructions.
|
|
17
|
+
*/
|
|
18
|
+
readonly isRunnableByPromptbook: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Extra environment variables required by the update command.
|
|
21
|
+
*/
|
|
22
|
+
readonly environment?: Readonly<Record<string, string>>;
|
|
23
|
+
};
|
|
@@ -2,9 +2,12 @@ import type { HarnessDefinition } from './HarnessDefinition';
|
|
|
2
2
|
/**
|
|
3
3
|
* Builds the shell command which installs or updates one CLI coding harness globally.
|
|
4
4
|
*
|
|
5
|
-
* The very same command is executed by `$
|
|
5
|
+
* The very same command is executed by `$runHarnessInstallationCommand` and printed as the manual fallback,
|
|
6
6
|
* so the user always sees exactly what Promptbook would run.
|
|
7
7
|
*
|
|
8
|
+
* Note: This command installs the harness through npm, so it may only update a harness which npm really owns,
|
|
9
|
+
* see `resolveHarnessUpdatePlan`.
|
|
10
|
+
*
|
|
8
11
|
* @private internal utility of `promptbookCli`
|
|
9
12
|
*/
|
|
10
13
|
export declare function buildHarnessInstallCommand(definition: HarnessDefinition): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HarnessInstallationStatus } from './HarnessInstallationStatus';
|
|
2
|
+
import type { HarnessUpdatePlan } from './HarnessUpdatePlan';
|
|
3
|
+
/**
|
|
4
|
+
* Formats the instruction shown when an outdated harness must be updated by the user.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `promptbookCli`
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatHarnessManualUpdateInstruction(status: HarnessInstallationStatus, updatePlan: HarnessUpdatePlan): string;
|
package/esm/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
|
+
import type { HarnessInstallationMethod } from './HarnessInstallationOrigin';
|
|
3
|
+
/**
|
|
4
|
+
* Options describing where the harness command was found.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `resolveHarnessInstallationMethodFromPaths`
|
|
7
|
+
*/
|
|
8
|
+
type HarnessInstallationPaths = {
|
|
9
|
+
/**
|
|
10
|
+
* Harness whose command was located.
|
|
11
|
+
*/
|
|
12
|
+
readonly definition: HarnessDefinition;
|
|
13
|
+
/**
|
|
14
|
+
* Resolved path of the harness command with every symbolic link followed.
|
|
15
|
+
*/
|
|
16
|
+
readonly commandPath: string;
|
|
17
|
+
/**
|
|
18
|
+
* Root directory of global npm installations or `null` when npm could not be asked for it.
|
|
19
|
+
*/
|
|
20
|
+
readonly npmGlobalPrefixPath: string | null;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Decides how a harness command was installed from the place where it really lives.
|
|
24
|
+
*
|
|
25
|
+
* Only a command which npm owns may be updated with `npm install -g`, every other command has to be
|
|
26
|
+
* updated where it is installed, otherwise the update silently adds a second copy of the harness.
|
|
27
|
+
*
|
|
28
|
+
* @private internal utility of `promptbookCli`
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveHarnessInstallationMethodFromPaths(paths: HarnessInstallationPaths): HarnessInstallationMethod;
|
|
31
|
+
export {};
|
package/esm/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
|
+
import type { HarnessInstallationMethod } from './HarnessInstallationOrigin';
|
|
3
|
+
import type { HarnessUpdatePlan } from './HarnessUpdatePlan';
|
|
4
|
+
/**
|
|
5
|
+
* Decides how one outdated CLI coding harness should be updated.
|
|
6
|
+
*
|
|
7
|
+
* The plan follows the way the harness was installed, because `npm install -g` updates only a harness
|
|
8
|
+
* which npm owns and installs a **second** copy of every other one.
|
|
9
|
+
*
|
|
10
|
+
* @private internal utility of `promptbookCli`
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveHarnessUpdatePlan(definition: HarnessDefinition, installationMethod: HarnessInstallationMethod): HarnessUpdatePlan;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads the root directory under which npm installs global packages.
|
|
3
|
+
*
|
|
4
|
+
* Note: `$` is used to indicate that this function is not a pure function - it runs npm
|
|
5
|
+
*
|
|
6
|
+
* @returns The global npm prefix or `null` when npm could not be asked for it
|
|
7
|
+
* @private internal utility of `promptbookCli`
|
|
8
|
+
*/
|
|
9
|
+
export declare function $resolveNpmGlobalPrefixPath(): Promise<string | null>;
|
|
@@ -3,23 +3,30 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
|
3
3
|
/**
|
|
4
4
|
* `WRITING RULES` commitment definition.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* rather than task-solving behavior.
|
|
6
|
+
* The `WRITING RULES`/`WRITING RULE` commitment adds constraints that apply strictly to writing style
|
|
7
|
+
* and presentation rather than task-solving behavior.
|
|
8
|
+
*
|
|
9
|
+
* Example usage in agent source:
|
|
10
|
+
*
|
|
11
|
+
* ```book
|
|
12
|
+
* WRITING RULES Keep every response under 120 words
|
|
13
|
+
* WRITING RULE Always end the message with an emoji
|
|
14
|
+
* ```
|
|
8
15
|
*
|
|
9
16
|
* @private [🪔] Maybe export the commitments through some package
|
|
10
17
|
*/
|
|
11
|
-
export declare class WritingRulesCommitmentDefinition extends BaseCommitmentDefinition<'WRITING RULES'> {
|
|
12
|
-
constructor();
|
|
18
|
+
export declare class WritingRulesCommitmentDefinition extends BaseCommitmentDefinition<'WRITING RULES' | 'WRITING RULE'> {
|
|
19
|
+
constructor(type?: 'WRITING RULES' | 'WRITING RULE');
|
|
13
20
|
/**
|
|
14
|
-
* Short one-line description of `WRITING RULES`.
|
|
21
|
+
* Short one-line description of `WRITING RULES`/`WRITING RULE`.
|
|
15
22
|
*/
|
|
16
23
|
get description(): string;
|
|
17
24
|
/**
|
|
18
|
-
* Icon for `WRITING RULES`.
|
|
25
|
+
* Icon for `WRITING RULES`/`WRITING RULE`.
|
|
19
26
|
*/
|
|
20
27
|
get icon(): string;
|
|
21
28
|
/**
|
|
22
|
-
* Markdown documentation for `WRITING RULES
|
|
29
|
+
* Markdown documentation for `WRITING RULES`/`WRITING RULE` commitment.
|
|
23
30
|
*/
|
|
24
31
|
get documentation(): string;
|
|
25
32
|
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
@@ -55,4 +55,4 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
|
|
|
55
55
|
*
|
|
56
56
|
* @private Use functions to access commitments instead of this array directly
|
|
57
57
|
*/
|
|
58
|
-
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, WritingSampleCommitmentDefinition, WritingRulesCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, TemplateCommitmentDefinition, TemplateCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, MetaAvatarCommitmentDefinition, MetaAvatarCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaDomainCommitmentDefinition, MetaDescriptionCommitmentDefinition, MetaDisclaimerCommitmentDefinition, MetaFullnameCommitmentDefinition, MetaIdCommitmentDefinition, MetaInputPlaceholderCommitmentDefinition, MetaThinkingMessageCommitmentDefinition, MetaVisibilityCommitmentDefinition, MetaVoiceCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, InternalMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageSuffixCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseUserLocationCommitmentDefinition, UseCalendarCommitmentDefinition, UsePopupCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UsePrivacyCommitmentDefinition, UseProjectCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
58
|
+
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, WritingSampleCommitmentDefinition, WritingRulesCommitmentDefinition, WritingRulesCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, TemplateCommitmentDefinition, TemplateCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, MetaAvatarCommitmentDefinition, MetaAvatarCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaDomainCommitmentDefinition, MetaDescriptionCommitmentDefinition, MetaDisclaimerCommitmentDefinition, MetaFullnameCommitmentDefinition, MetaIdCommitmentDefinition, MetaInputPlaceholderCommitmentDefinition, MetaThinkingMessageCommitmentDefinition, MetaVisibilityCommitmentDefinition, MetaVoiceCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, InternalMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageSuffixCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseUserLocationCommitmentDefinition, UseCalendarCommitmentDefinition, UsePopupCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UsePrivacyCommitmentDefinition, UseProjectCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
package/esm/src/version.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
|
|
|
15
15
|
export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
|
|
16
16
|
/**
|
|
17
17
|
* Represents the version string of the Promptbook engine.
|
|
18
|
-
* It follows semantic versioning (e.g., `0.114.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.114.0-26`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/node",
|
|
3
|
-
"version": "0.114.0-
|
|
3
|
+
"version": "0.114.0-27",
|
|
4
4
|
"description": "Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"types": "./esm/src/_packages/node.index.d.ts",
|
|
98
98
|
"typings": "./esm/src/_packages/node.index.d.ts",
|
|
99
99
|
"peerDependencies": {
|
|
100
|
-
"@promptbook/core": "0.114.0-
|
|
100
|
+
"@promptbook/core": "0.114.0-27"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
103
|
"@openai/agents": "0.4.15",
|
package/umd/index.umd.js
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
* @generated
|
|
48
48
|
* @see https://github.com/webgptorg/promptbook
|
|
49
49
|
*/
|
|
50
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
50
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-27';
|
|
51
51
|
/**
|
|
52
52
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
53
53
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1804,6 +1804,11 @@
|
|
|
1804
1804
|
label: 'OpenAI Codex',
|
|
1805
1805
|
commandName: 'codex',
|
|
1806
1806
|
npmPackageName: '@openai/codex',
|
|
1807
|
+
// Note: The official standalone installer keeps its package in `~/.codex` and links it onto the `PATH`
|
|
1808
|
+
standaloneInstallation: {
|
|
1809
|
+
directoryNames: ['.codex'],
|
|
1810
|
+
updateCommand: 'codex update',
|
|
1811
|
+
},
|
|
1807
1812
|
},
|
|
1808
1813
|
'github-copilot': {
|
|
1809
1814
|
harnessName: 'github-copilot',
|
|
@@ -27948,29 +27953,36 @@
|
|
|
27948
27953
|
/**
|
|
27949
27954
|
* `WRITING RULES` commitment definition.
|
|
27950
27955
|
*
|
|
27951
|
-
*
|
|
27952
|
-
* rather than task-solving behavior.
|
|
27956
|
+
* The `WRITING RULES`/`WRITING RULE` commitment adds constraints that apply strictly to writing style
|
|
27957
|
+
* and presentation rather than task-solving behavior.
|
|
27958
|
+
*
|
|
27959
|
+
* Example usage in agent source:
|
|
27960
|
+
*
|
|
27961
|
+
* ```book
|
|
27962
|
+
* WRITING RULES Keep every response under 120 words
|
|
27963
|
+
* WRITING RULE Always end the message with an emoji
|
|
27964
|
+
* ```
|
|
27953
27965
|
*
|
|
27954
27966
|
* @private [🪔] Maybe export the commitments through some package
|
|
27955
27967
|
*/
|
|
27956
27968
|
class WritingRulesCommitmentDefinition extends BaseCommitmentDefinition {
|
|
27957
|
-
constructor() {
|
|
27958
|
-
super(
|
|
27969
|
+
constructor(type = 'WRITING RULES') {
|
|
27970
|
+
super(type);
|
|
27959
27971
|
}
|
|
27960
27972
|
/**
|
|
27961
|
-
* Short one-line description of `WRITING RULES`.
|
|
27973
|
+
* Short one-line description of `WRITING RULES`/`WRITING RULE`.
|
|
27962
27974
|
*/
|
|
27963
27975
|
get description() {
|
|
27964
27976
|
return 'Add writing-only constraints such as tone, length, formatting, or emoji usage.';
|
|
27965
27977
|
}
|
|
27966
27978
|
/**
|
|
27967
|
-
* Icon for `WRITING RULES`.
|
|
27979
|
+
* Icon for `WRITING RULES`/`WRITING RULE`.
|
|
27968
27980
|
*/
|
|
27969
27981
|
get icon() {
|
|
27970
27982
|
return '📝';
|
|
27971
27983
|
}
|
|
27972
27984
|
/**
|
|
27973
|
-
* Markdown documentation for `WRITING RULES
|
|
27985
|
+
* Markdown documentation for `WRITING RULES`/`WRITING RULE` commitment.
|
|
27974
27986
|
*/
|
|
27975
27987
|
get documentation() {
|
|
27976
27988
|
return _spaceTrim.spaceTrim(`
|
|
@@ -27980,6 +27992,7 @@
|
|
|
27980
27992
|
|
|
27981
27993
|
## Key aspects
|
|
27982
27994
|
|
|
27995
|
+
- All writing rules are treated equally regardless of singular/plural form.
|
|
27983
27996
|
- Use it for writing-only constraints such as tone, formatting, length, emoji usage, punctuation, or reading level.
|
|
27984
27997
|
- Do **not** use it for problem-solving behavior, policy, tool usage, or decision-making logic. Use \`RULE\` for that.
|
|
27985
27998
|
- Newer writing-rules blocks override conflicting earlier writing-rules blocks.
|
|
@@ -28178,7 +28191,8 @@
|
|
|
28178
28191
|
new LanguageCommitmentDefinition('LANGUAGE'),
|
|
28179
28192
|
new LanguageCommitmentDefinition('LANGUAGES'),
|
|
28180
28193
|
new WritingSampleCommitmentDefinition(),
|
|
28181
|
-
new WritingRulesCommitmentDefinition(),
|
|
28194
|
+
new WritingRulesCommitmentDefinition('WRITING RULES'),
|
|
28195
|
+
new WritingRulesCommitmentDefinition('WRITING RULE'),
|
|
28182
28196
|
new SampleCommitmentDefinition('SAMPLE'),
|
|
28183
28197
|
new SampleCommitmentDefinition('EXAMPLE'),
|
|
28184
28198
|
new FormatCommitmentDefinition('FORMAT'),
|