@promptbook/markdown-utils 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 +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 +1 -1
- package/umd/index.umd.js +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
package/esm/index.es.js
CHANGED
|
@@ -22,7 +22,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
22
22
|
* @generated
|
|
23
23
|
* @see https://github.com/webgptorg/promptbook
|
|
24
24
|
*/
|
|
25
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
25
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-27';
|
|
26
26
|
/**
|
|
27
27
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
28
28
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -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
package/umd/index.umd.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* @generated
|
|
26
26
|
* @see https://github.com/webgptorg/promptbook
|
|
27
27
|
*/
|
|
28
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
28
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-27';
|
|
29
29
|
/**
|
|
30
30
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
31
31
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -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/umd/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/umd/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/umd/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/umd/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
|
*/
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
|
-
/**
|
|
3
|
-
* Installs or updates one CLI coding harness globally through npm.
|
|
4
|
-
*
|
|
5
|
-
* A failed installation is reported but never aborts the running command, because the harness check
|
|
6
|
-
* is only an assistant - the command itself may still work with a manually managed harness.
|
|
7
|
-
*
|
|
8
|
-
* Note: `$` is used to indicate that this function is not a pure function - it installs a global npm package
|
|
9
|
-
*
|
|
10
|
-
* @returns `true` when the harness has been installed, `false` when the installation failed
|
|
11
|
-
* @private internal utility of `promptbookCli`
|
|
12
|
-
*/
|
|
13
|
-
export declare function $installHarness(definition: HarnessDefinition): Promise<boolean>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
|
-
/**
|
|
3
|
-
* Installs or updates one CLI coding harness globally through npm.
|
|
4
|
-
*
|
|
5
|
-
* A failed installation is reported but never aborts the running command, because the harness check
|
|
6
|
-
* is only an assistant - the command itself may still work with a manually managed harness.
|
|
7
|
-
*
|
|
8
|
-
* Note: `$` is used to indicate that this function is not a pure function - it installs a global npm package
|
|
9
|
-
*
|
|
10
|
-
* @returns `true` when the harness has been installed, `false` when the installation failed
|
|
11
|
-
* @private internal utility of `promptbookCli`
|
|
12
|
-
*/
|
|
13
|
-
export declare function $installHarness(definition: HarnessDefinition): Promise<boolean>;
|