@promptbook/javascript 0.114.0-10 → 0.114.0-12
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/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -0
- package/esm/src/book-2.0/agent-source/ParsedUnknownCommitment.d.ts +26 -0
- package/esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.unknown.test.d.ts +1 -0
- package/esm/src/book-2.0/agent-source/getBookCommitmentLineType.d.ts +19 -0
- package/esm/src/book-2.0/agent-source/parseAgentSourceWithCommitments.unknown.test.d.ts +1 -0
- package/esm/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.d.ts +28 -0
- package/esm/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +3 -3
- package/esm/src/cli/cli-commands/common/harness/$checkHarnessInstallation.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -3
- package/esm/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +3 -2
- package/esm/src/cli/cli-commands/common/harnessUpdateCliOptions.d.ts +29 -0
- package/esm/src/cli/cli-commands/common/harnessUpdateCliOptions.test.d.ts +1 -0
- package/esm/src/executables/platforms/locateAppOnWindows.d.ts +1 -1
- package/esm/src/executables/platforms/locateAppOnWindows.test.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
- package/umd/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -0
- package/umd/src/book-2.0/agent-source/ParsedUnknownCommitment.d.ts +26 -0
- package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.unknown.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/getBookCommitmentLineType.d.ts +19 -0
- package/umd/src/book-2.0/agent-source/parseAgentSourceWithCommitments.unknown.test.d.ts +1 -0
- package/umd/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.d.ts +28 -0
- package/umd/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +3 -3
- package/umd/src/cli/cli-commands/common/harness/$checkHarnessInstallation.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -3
- package/umd/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +3 -2
- package/umd/src/cli/cli-commands/common/harnessUpdateCliOptions.d.ts +29 -0
- package/umd/src/cli/cli-commands/common/harnessUpdateCliOptions.test.d.ts +1 -0
- package/umd/src/executables/platforms/locateAppOnWindows.d.ts +1 -1
- package/umd/src/executables/platforms/locateAppOnWindows.test.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
package/esm/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
17
17
|
* @generated
|
|
18
18
|
* @see https://github.com/webgptorg/promptbook
|
|
19
19
|
*/
|
|
20
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
20
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-12';
|
|
21
21
|
/**
|
|
22
22
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
23
23
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ParsedCommitment } from '../../commitments/_base/ParsedCommitment';
|
|
2
2
|
import type { string_agent_name } from '../../types/string_agent_name';
|
|
3
|
+
import type { ParsedUnknownCommitment } from './ParsedUnknownCommitment';
|
|
3
4
|
/**
|
|
4
5
|
* Result of parsing agent source for commitments
|
|
5
6
|
*
|
|
@@ -18,6 +19,10 @@ export type AgentSourceParseResult = {
|
|
|
18
19
|
* All parsed commitments
|
|
19
20
|
*/
|
|
20
21
|
commitments: ParsedCommitment[];
|
|
22
|
+
/**
|
|
23
|
+
* Uppercase commitment blocks whose types are not registered by Promptbook.
|
|
24
|
+
*/
|
|
25
|
+
unknownCommitments: ParsedUnknownCommitment[];
|
|
21
26
|
/**
|
|
22
27
|
* Lines that are not commitments (for system message)
|
|
23
28
|
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An uppercase Book commitment block whose keyword is not registered by Promptbook.
|
|
3
|
+
*
|
|
4
|
+
* Unknown commitments are retained as system-message context instead of being applied
|
|
5
|
+
* as executable commitments.
|
|
6
|
+
*
|
|
7
|
+
* @private internal type of `parseAgentSourceWithCommitments`
|
|
8
|
+
*/
|
|
9
|
+
export type ParsedUnknownCommitment = {
|
|
10
|
+
/**
|
|
11
|
+
* Uppercase unknown commitment type, for example `FOO` or `BAR BZZ`.
|
|
12
|
+
*/
|
|
13
|
+
readonly type: string;
|
|
14
|
+
/**
|
|
15
|
+
* Original first line, retained for precise editor diagnostics.
|
|
16
|
+
*/
|
|
17
|
+
readonly originalLine: string;
|
|
18
|
+
/**
|
|
19
|
+
* Line number in the agent source (1-based).
|
|
20
|
+
*/
|
|
21
|
+
readonly lineNumber: number;
|
|
22
|
+
/**
|
|
23
|
+
* Complete unknown commitment block, including its keyword and continuation lines.
|
|
24
|
+
*/
|
|
25
|
+
readonly source: string;
|
|
26
|
+
};
|
package/esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.unknown.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates the regex used to recognize the uppercase commitment type at the beginning of a Book line.
|
|
3
|
+
*
|
|
4
|
+
* A fresh regular expression keeps Monaco tokenizer state isolated from parser calls.
|
|
5
|
+
*
|
|
6
|
+
* @returns Regular expression matching one Book commitment-like line.
|
|
7
|
+
*
|
|
8
|
+
* @private internal utility of Book parsing and `<BookEditor/>`
|
|
9
|
+
*/
|
|
10
|
+
export declare function createBookCommitmentLineTypeRegex(): RegExp;
|
|
11
|
+
/**
|
|
12
|
+
* Extracts the uppercase commitment type from a Book line, including types not registered by Promptbook.
|
|
13
|
+
*
|
|
14
|
+
* @param line - One raw Book source line.
|
|
15
|
+
* @returns Matched commitment type or `null` when the line does not begin with commitment syntax.
|
|
16
|
+
*
|
|
17
|
+
* @private internal utility of Book parsing and `<BookEditor/>`
|
|
18
|
+
*/
|
|
19
|
+
export declare function getBookCommitmentLineType(line: string): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
2
|
+
/**
|
|
3
|
+
* Monaco diagnostic shown when a Book source uses an uppercase commitment not registered by Promptbook.
|
|
4
|
+
*
|
|
5
|
+
* @private internal type of `BookEditorMonaco`
|
|
6
|
+
*/
|
|
7
|
+
type UnknownCommitmentDiagnostic = {
|
|
8
|
+
readonly startLineNumber: number;
|
|
9
|
+
readonly startColumn: number;
|
|
10
|
+
readonly endLineNumber: number;
|
|
11
|
+
readonly endColumn: number;
|
|
12
|
+
readonly message: string;
|
|
13
|
+
readonly source: string;
|
|
14
|
+
readonly severity: 'error';
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Creates Book editor diagnostics for uppercase commitments not registered by Promptbook.
|
|
18
|
+
*
|
|
19
|
+
* Unknown commitment blocks remain valid extra context in the generated system message,
|
|
20
|
+
* but the editor marks their keywords so authors can spot likely typos immediately.
|
|
21
|
+
*
|
|
22
|
+
* @param agentSource - Current editor content.
|
|
23
|
+
* @returns Error markers for all unknown commitment keywords.
|
|
24
|
+
*
|
|
25
|
+
* @private internal utility of `BookEditorMonaco`
|
|
26
|
+
*/
|
|
27
|
+
export declare function createUnknownCommitmentDiagnostics(agentSource?: string_book): ReadonlyArray<UnknownCommitmentDiagnostic>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
2
|
import type { HarnessInstallationStatus } from './HarnessInstallationStatus';
|
|
3
3
|
/**
|
|
4
|
-
* Detects whether one CLI coding harness is installed globally and whether it is up to date.
|
|
4
|
+
* Detects whether one CLI coding harness is installed globally and, when enabled, whether it is up to date.
|
|
5
5
|
*
|
|
6
|
-
* Note: `$` is used to indicate that this function is not a pure function - it runs the harness command and
|
|
6
|
+
* Note: `$` is used to indicate that this function is not a pure function - it runs the harness command and may query npm
|
|
7
7
|
*
|
|
8
8
|
* @private internal utility of `promptbookCli`
|
|
9
9
|
*/
|
|
10
|
-
export declare function $checkHarnessInstallation(definition: HarnessDefinition): Promise<HarnessInstallationStatus>;
|
|
10
|
+
export declare function $checkHarnessInstallation(definition: HarnessDefinition, isHarnessUpdateCheckEnabled?: boolean): Promise<HarnessInstallationStatus>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PromptRunnerHarnessName } from '../promptRunnerCliOptions';
|
|
2
2
|
/**
|
|
3
|
-
* Checks that every given CLI coding harness is installed globally and up to date
|
|
4
|
-
* install
|
|
3
|
+
* Checks that every given CLI coding harness is installed globally and, when enabled, up to date.
|
|
4
|
+
* Offers to install missing harnesses and update outdated ones.
|
|
5
5
|
*
|
|
6
6
|
* Harness names which are `undefined`, for example when no `--harness` is selected in a dry run,
|
|
7
7
|
* are ignored so that every call site can pass its raw selection.
|
|
@@ -10,4 +10,4 @@ import type { PromptRunnerHarnessName } from '../promptRunnerCliOptions';
|
|
|
10
10
|
*
|
|
11
11
|
* @private internal utility of `promptbookCli`
|
|
12
12
|
*/
|
|
13
|
-
export declare function $ensureHarnessInstallations(harnessNames: ReadonlyArray<PromptRunnerHarnessName | undefined
|
|
13
|
+
export declare function $ensureHarnessInstallations(harnessNames: ReadonlyArray<PromptRunnerHarnessName | undefined>, isHarnessUpdateCheckEnabled?: boolean): Promise<void>;
|
|
@@ -5,11 +5,12 @@ import type { HarnessDefinition } from './HarnessDefinition';
|
|
|
5
5
|
* - `up-to-date` the newest published version is installed
|
|
6
6
|
* - `outdated` an older version is installed
|
|
7
7
|
* - `not-installed` the harness command is not available globally
|
|
8
|
+
* - `installed` the harness is installed and automatic update checking was disabled
|
|
8
9
|
* - `unknown` the harness is installed but the newest published version could not be resolved, for example when offline
|
|
9
10
|
*
|
|
10
11
|
* @private internal utility of `promptbookCli`
|
|
11
12
|
*/
|
|
12
|
-
export type HarnessInstallationState = 'up-to-date' | 'outdated' | 'not-installed' | 'unknown';
|
|
13
|
+
export type HarnessInstallationState = 'up-to-date' | 'outdated' | 'not-installed' | 'installed' | 'unknown';
|
|
13
14
|
/**
|
|
14
15
|
* Installation state of one CLI coding harness on the current machine.
|
|
15
16
|
*
|
|
@@ -21,7 +22,7 @@ export type HarnessInstallationStatus = {
|
|
|
21
22
|
*/
|
|
22
23
|
readonly definition: HarnessDefinition;
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
+
* Installation state, including whether the newest published version was checked.
|
|
25
26
|
*/
|
|
26
27
|
readonly installationState: HarnessInstallationState;
|
|
27
28
|
/**
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Commander option bag for opting out of automatic coding-harness update checks.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `promptbookCli`
|
|
6
|
+
*/
|
|
7
|
+
export type HarnessUpdateCliOptions = {
|
|
8
|
+
readonly harnessUpdate: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Normalized automatic coding-harness update-check option.
|
|
12
|
+
*
|
|
13
|
+
* @private internal utility of `promptbookCli`
|
|
14
|
+
*/
|
|
15
|
+
export type NormalizedHarnessUpdateCliOptions = {
|
|
16
|
+
readonly isHarnessUpdateCheckEnabled: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Registers the shared `--no-harness-update` option on a `ptbk coder` command that uses a coding harness.
|
|
20
|
+
*
|
|
21
|
+
* @private internal utility of `promptbookCli`
|
|
22
|
+
*/
|
|
23
|
+
export declare function addHarnessUpdateOption(command: Program): void;
|
|
24
|
+
/**
|
|
25
|
+
* Converts the Commander harness-update flag into the normalized harness-check option.
|
|
26
|
+
*
|
|
27
|
+
* @private internal utility of `promptbookCli`
|
|
28
|
+
*/
|
|
29
|
+
export declare function normalizeHarnessUpdateCliOptions(cliOptions: HarnessUpdateCliOptions): NormalizedHarnessUpdateCliOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { string_executable_path } from '../../types/string_filename';
|
|
2
2
|
import type { LocateAppOptions } from '../locateApp';
|
|
3
3
|
/**
|
|
4
|
-
* Attempts to locate the specified application on a Windows system by searching common installation directories.
|
|
4
|
+
* Attempts to locate the specified application on a Windows system by searching PATH and common installation directories.
|
|
5
5
|
* Returns the path to the executable if found, or null otherwise.
|
|
6
6
|
*
|
|
7
7
|
* @private within the repository
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
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-10`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/javascript",
|
|
3
|
-
"version": "0.114.0-
|
|
3
|
+
"version": "0.114.0-12",
|
|
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,
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"types": "./esm/src/_packages/javascript.index.d.ts",
|
|
99
99
|
"typings": "./esm/src/_packages/javascript.index.d.ts",
|
|
100
100
|
"peerDependencies": {
|
|
101
|
-
"@promptbook/core": "0.114.0-
|
|
101
|
+
"@promptbook/core": "0.114.0-12"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
104
|
"crypto-js": "4.2.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* @generated
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
26
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-12';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ParsedCommitment } from '../../commitments/_base/ParsedCommitment';
|
|
2
2
|
import type { string_agent_name } from '../../types/string_agent_name';
|
|
3
|
+
import type { ParsedUnknownCommitment } from './ParsedUnknownCommitment';
|
|
3
4
|
/**
|
|
4
5
|
* Result of parsing agent source for commitments
|
|
5
6
|
*
|
|
@@ -18,6 +19,10 @@ export type AgentSourceParseResult = {
|
|
|
18
19
|
* All parsed commitments
|
|
19
20
|
*/
|
|
20
21
|
commitments: ParsedCommitment[];
|
|
22
|
+
/**
|
|
23
|
+
* Uppercase commitment blocks whose types are not registered by Promptbook.
|
|
24
|
+
*/
|
|
25
|
+
unknownCommitments: ParsedUnknownCommitment[];
|
|
21
26
|
/**
|
|
22
27
|
* Lines that are not commitments (for system message)
|
|
23
28
|
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An uppercase Book commitment block whose keyword is not registered by Promptbook.
|
|
3
|
+
*
|
|
4
|
+
* Unknown commitments are retained as system-message context instead of being applied
|
|
5
|
+
* as executable commitments.
|
|
6
|
+
*
|
|
7
|
+
* @private internal type of `parseAgentSourceWithCommitments`
|
|
8
|
+
*/
|
|
9
|
+
export type ParsedUnknownCommitment = {
|
|
10
|
+
/**
|
|
11
|
+
* Uppercase unknown commitment type, for example `FOO` or `BAR BZZ`.
|
|
12
|
+
*/
|
|
13
|
+
readonly type: string;
|
|
14
|
+
/**
|
|
15
|
+
* Original first line, retained for precise editor diagnostics.
|
|
16
|
+
*/
|
|
17
|
+
readonly originalLine: string;
|
|
18
|
+
/**
|
|
19
|
+
* Line number in the agent source (1-based).
|
|
20
|
+
*/
|
|
21
|
+
readonly lineNumber: number;
|
|
22
|
+
/**
|
|
23
|
+
* Complete unknown commitment block, including its keyword and continuation lines.
|
|
24
|
+
*/
|
|
25
|
+
readonly source: string;
|
|
26
|
+
};
|
package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.unknown.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates the regex used to recognize the uppercase commitment type at the beginning of a Book line.
|
|
3
|
+
*
|
|
4
|
+
* A fresh regular expression keeps Monaco tokenizer state isolated from parser calls.
|
|
5
|
+
*
|
|
6
|
+
* @returns Regular expression matching one Book commitment-like line.
|
|
7
|
+
*
|
|
8
|
+
* @private internal utility of Book parsing and `<BookEditor/>`
|
|
9
|
+
*/
|
|
10
|
+
export declare function createBookCommitmentLineTypeRegex(): RegExp;
|
|
11
|
+
/**
|
|
12
|
+
* Extracts the uppercase commitment type from a Book line, including types not registered by Promptbook.
|
|
13
|
+
*
|
|
14
|
+
* @param line - One raw Book source line.
|
|
15
|
+
* @returns Matched commitment type or `null` when the line does not begin with commitment syntax.
|
|
16
|
+
*
|
|
17
|
+
* @private internal utility of Book parsing and `<BookEditor/>`
|
|
18
|
+
*/
|
|
19
|
+
export declare function getBookCommitmentLineType(line: string): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
2
|
+
/**
|
|
3
|
+
* Monaco diagnostic shown when a Book source uses an uppercase commitment not registered by Promptbook.
|
|
4
|
+
*
|
|
5
|
+
* @private internal type of `BookEditorMonaco`
|
|
6
|
+
*/
|
|
7
|
+
type UnknownCommitmentDiagnostic = {
|
|
8
|
+
readonly startLineNumber: number;
|
|
9
|
+
readonly startColumn: number;
|
|
10
|
+
readonly endLineNumber: number;
|
|
11
|
+
readonly endColumn: number;
|
|
12
|
+
readonly message: string;
|
|
13
|
+
readonly source: string;
|
|
14
|
+
readonly severity: 'error';
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Creates Book editor diagnostics for uppercase commitments not registered by Promptbook.
|
|
18
|
+
*
|
|
19
|
+
* Unknown commitment blocks remain valid extra context in the generated system message,
|
|
20
|
+
* but the editor marks their keywords so authors can spot likely typos immediately.
|
|
21
|
+
*
|
|
22
|
+
* @param agentSource - Current editor content.
|
|
23
|
+
* @returns Error markers for all unknown commitment keywords.
|
|
24
|
+
*
|
|
25
|
+
* @private internal utility of `BookEditorMonaco`
|
|
26
|
+
*/
|
|
27
|
+
export declare function createUnknownCommitmentDiagnostics(agentSource?: string_book): ReadonlyArray<UnknownCommitmentDiagnostic>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
2
|
import type { HarnessInstallationStatus } from './HarnessInstallationStatus';
|
|
3
3
|
/**
|
|
4
|
-
* Detects whether one CLI coding harness is installed globally and whether it is up to date.
|
|
4
|
+
* Detects whether one CLI coding harness is installed globally and, when enabled, whether it is up to date.
|
|
5
5
|
*
|
|
6
|
-
* Note: `$` is used to indicate that this function is not a pure function - it runs the harness command and
|
|
6
|
+
* Note: `$` is used to indicate that this function is not a pure function - it runs the harness command and may query npm
|
|
7
7
|
*
|
|
8
8
|
* @private internal utility of `promptbookCli`
|
|
9
9
|
*/
|
|
10
|
-
export declare function $checkHarnessInstallation(definition: HarnessDefinition): Promise<HarnessInstallationStatus>;
|
|
10
|
+
export declare function $checkHarnessInstallation(definition: HarnessDefinition, isHarnessUpdateCheckEnabled?: boolean): Promise<HarnessInstallationStatus>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PromptRunnerHarnessName } from '../promptRunnerCliOptions';
|
|
2
2
|
/**
|
|
3
|
-
* Checks that every given CLI coding harness is installed globally and up to date
|
|
4
|
-
* install
|
|
3
|
+
* Checks that every given CLI coding harness is installed globally and, when enabled, up to date.
|
|
4
|
+
* Offers to install missing harnesses and update outdated ones.
|
|
5
5
|
*
|
|
6
6
|
* Harness names which are `undefined`, for example when no `--harness` is selected in a dry run,
|
|
7
7
|
* are ignored so that every call site can pass its raw selection.
|
|
@@ -10,4 +10,4 @@ import type { PromptRunnerHarnessName } from '../promptRunnerCliOptions';
|
|
|
10
10
|
*
|
|
11
11
|
* @private internal utility of `promptbookCli`
|
|
12
12
|
*/
|
|
13
|
-
export declare function $ensureHarnessInstallations(harnessNames: ReadonlyArray<PromptRunnerHarnessName | undefined
|
|
13
|
+
export declare function $ensureHarnessInstallations(harnessNames: ReadonlyArray<PromptRunnerHarnessName | undefined>, isHarnessUpdateCheckEnabled?: boolean): Promise<void>;
|
|
@@ -5,11 +5,12 @@ import type { HarnessDefinition } from './HarnessDefinition';
|
|
|
5
5
|
* - `up-to-date` the newest published version is installed
|
|
6
6
|
* - `outdated` an older version is installed
|
|
7
7
|
* - `not-installed` the harness command is not available globally
|
|
8
|
+
* - `installed` the harness is installed and automatic update checking was disabled
|
|
8
9
|
* - `unknown` the harness is installed but the newest published version could not be resolved, for example when offline
|
|
9
10
|
*
|
|
10
11
|
* @private internal utility of `promptbookCli`
|
|
11
12
|
*/
|
|
12
|
-
export type HarnessInstallationState = 'up-to-date' | 'outdated' | 'not-installed' | 'unknown';
|
|
13
|
+
export type HarnessInstallationState = 'up-to-date' | 'outdated' | 'not-installed' | 'installed' | 'unknown';
|
|
13
14
|
/**
|
|
14
15
|
* Installation state of one CLI coding harness on the current machine.
|
|
15
16
|
*
|
|
@@ -21,7 +22,7 @@ export type HarnessInstallationStatus = {
|
|
|
21
22
|
*/
|
|
22
23
|
readonly definition: HarnessDefinition;
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
+
* Installation state, including whether the newest published version was checked.
|
|
25
26
|
*/
|
|
26
27
|
readonly installationState: HarnessInstallationState;
|
|
27
28
|
/**
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Commander option bag for opting out of automatic coding-harness update checks.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `promptbookCli`
|
|
6
|
+
*/
|
|
7
|
+
export type HarnessUpdateCliOptions = {
|
|
8
|
+
readonly harnessUpdate: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Normalized automatic coding-harness update-check option.
|
|
12
|
+
*
|
|
13
|
+
* @private internal utility of `promptbookCli`
|
|
14
|
+
*/
|
|
15
|
+
export type NormalizedHarnessUpdateCliOptions = {
|
|
16
|
+
readonly isHarnessUpdateCheckEnabled: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Registers the shared `--no-harness-update` option on a `ptbk coder` command that uses a coding harness.
|
|
20
|
+
*
|
|
21
|
+
* @private internal utility of `promptbookCli`
|
|
22
|
+
*/
|
|
23
|
+
export declare function addHarnessUpdateOption(command: Program): void;
|
|
24
|
+
/**
|
|
25
|
+
* Converts the Commander harness-update flag into the normalized harness-check option.
|
|
26
|
+
*
|
|
27
|
+
* @private internal utility of `promptbookCli`
|
|
28
|
+
*/
|
|
29
|
+
export declare function normalizeHarnessUpdateCliOptions(cliOptions: HarnessUpdateCliOptions): NormalizedHarnessUpdateCliOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { string_executable_path } from '../../types/string_filename';
|
|
2
2
|
import type { LocateAppOptions } from '../locateApp';
|
|
3
3
|
/**
|
|
4
|
-
* Attempts to locate the specified application on a Windows system by searching common installation directories.
|
|
4
|
+
* Attempts to locate the specified application on a Windows system by searching PATH and common installation directories.
|
|
5
5
|
* Returns the path to the executable if found, or null otherwise.
|
|
6
6
|
*
|
|
7
7
|
* @private within the repository
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
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-10`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|