@promptbook/cli 0.112.0-42 → 0.112.0-44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/esm/index.es.js +1485 -171
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-codex-prompts/common/formatUnknownErrorDetails.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/$runGoScript.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/runGoScript/$runGoScriptUntilMarkerIdle.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/runGoScript/$runGoScriptWithOutput.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/runGoScript/PromptRoundArtifacts.d.ts +35 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/buildScriptLogPath.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/runBashScriptWithOutput.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +28 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/withPromptRuntimeLog.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/withTempScript.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/waitForPause.d.ts +21 -1
- package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +2 -2
- package/esm/scripts/run-codex-prompts/prompts/formatPromptAttemptMetadata.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/prompts/markPromptFailed.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +14 -0
- package/esm/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +25 -0
- package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +112 -0
- package/esm/scripts/run-codex-prompts/ui/renderCoderRunUi.d.ts +30 -0
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -1
- package/esm/src/book-2.0/agent-source/TeammateProfileResolver.d.ts +2 -1
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/getTypescriptModule.d.ts +19 -0
- package/esm/src/cli/cli-commands/coder/getTypescriptModule.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/mergeStringRecordJsonFile.test.d.ts +1 -0
- package/esm/src/commitments/PERSONA/PERSONA.d.ts +7 -0
- package/esm/src/llm-providers/agent/Agent.test.d.ts +1 -0
- package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +4 -0
- package/esm/src/llm-providers/agent/AgentOptions.d.ts +8 -0
- package/esm/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +9 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +3 -2
- package/umd/index.umd.js +1487 -174
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-codex-prompts/common/formatUnknownErrorDetails.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/$runGoScript.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/common/runGoScript/$runGoScriptUntilMarkerIdle.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/common/runGoScript/$runGoScriptWithOutput.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/common/runGoScript/PromptRoundArtifacts.d.ts +35 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/buildScriptLogPath.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/runBashScriptWithOutput.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +28 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/withPromptRuntimeLog.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/withTempScript.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/common/waitForPause.d.ts +21 -1
- package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +2 -2
- package/umd/scripts/run-codex-prompts/prompts/formatPromptAttemptMetadata.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/prompts/markPromptDone.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/prompts/markPromptFailed.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +14 -0
- package/umd/scripts/run-codex-prompts/testing/runPromptWithTestFeedback.d.ts +25 -0
- package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +112 -0
- package/umd/scripts/run-codex-prompts/ui/renderCoderRunUi.d.ts +30 -0
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -1
- package/umd/src/book-2.0/agent-source/TeammateProfileResolver.d.ts +2 -1
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/getTypescriptModule.d.ts +19 -0
- package/umd/src/cli/cli-commands/coder/getTypescriptModule.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/mergeStringRecordJsonFile.test.d.ts +1 -0
- package/umd/src/commitments/PERSONA/PERSONA.d.ts +7 -0
- package/umd/src/llm-providers/agent/Agent.test.d.ts +1 -0
- package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +4 -0
- package/umd/src/llm-providers/agent/AgentOptions.d.ts +8 -0
- package/umd/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +9 -0
- package/umd/src/version.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RunGoScriptOptions } from './RunGoScriptOptions';
|
|
2
2
|
/**
|
|
3
|
-
* Creates a temporary script file, runs it, and
|
|
3
|
+
* Creates a temporary script file, runs it, and cleans it up immediately unless a round tracker defers that cleanup.
|
|
4
4
|
*/
|
|
5
5
|
export declare function $runGoScript(options: RunGoScriptOptions): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RunGoScriptUntilMarkerIdleOptions } from './RunGoScriptUntilMarkerIdleOptions';
|
|
2
2
|
/**
|
|
3
|
-
* Creates a temporary script file, runs it, waits for a completion marker and idle time, and
|
|
3
|
+
* Creates a temporary script file, runs it, waits for a completion marker and idle time, and defers cleanup when a round tracker is provided.
|
|
4
4
|
* Returns the captured output for post-processing.
|
|
5
5
|
*/
|
|
6
6
|
export declare function $runGoScriptUntilMarkerIdle(options: RunGoScriptUntilMarkerIdleOptions): Promise<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RunGoScriptOptions } from './RunGoScriptOptions';
|
|
2
2
|
/**
|
|
3
|
-
* Creates a temporary script file, runs it, captures output, and
|
|
3
|
+
* Creates a temporary script file, runs it, captures output, and cleans it up immediately unless a round tracker defers that cleanup.
|
|
4
4
|
*/
|
|
5
5
|
export declare function $runGoScriptWithOutput(options: RunGoScriptOptions): Promise<string>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kind of temporary artifact created during one coder prompt round.
|
|
3
|
+
*/
|
|
4
|
+
export type PromptRoundArtifactKind = 'runner-script' | 'test-script' | 'runtime-log';
|
|
5
|
+
/**
|
|
6
|
+
* Final outcome of one coder prompt round.
|
|
7
|
+
*/
|
|
8
|
+
export type PromptRoundOutcome = 'success' | 'failure';
|
|
9
|
+
/**
|
|
10
|
+
* Tracks temporary prompt-round artifacts and deletes only those not preserved for the final round outcome.
|
|
11
|
+
*/
|
|
12
|
+
export declare class PromptRoundArtifacts {
|
|
13
|
+
private readonly preservedArtifactKindsByOutcome;
|
|
14
|
+
private readonly trackedArtifacts;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new prompt-round artifact tracker.
|
|
17
|
+
*/
|
|
18
|
+
constructor(preservedArtifactKindsByOutcome: Record<PromptRoundOutcome, ReadonlySet<PromptRoundArtifactKind>>);
|
|
19
|
+
/**
|
|
20
|
+
* Registers one temporary artifact for round-final cleanup.
|
|
21
|
+
*/
|
|
22
|
+
track(path: string, kind: PromptRoundArtifactKind): void;
|
|
23
|
+
/**
|
|
24
|
+
* Cleans up all tracked artifacts that should not survive the final round outcome.
|
|
25
|
+
*/
|
|
26
|
+
cleanup(outcome: PromptRoundOutcome): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates the default artifact-retention policy used by `ptbk coder run`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createCoderRunPromptRoundArtifacts(isPreserveLogs: boolean): PromptRoundArtifacts;
|
|
32
|
+
/**
|
|
33
|
+
* Derives the tracked artifact kind from one temporary shell path.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getPromptRoundArtifactKindFromScriptPath(scriptPath: string): PromptRoundArtifactKind;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RunGoScriptOptions } from './RunGoScriptOptions';
|
|
2
|
+
/**
|
|
3
|
+
* Runs one temporary bash script, optionally mirroring its raw input/output into a live runtime log file.
|
|
4
|
+
*/
|
|
5
|
+
export declare function runBashScriptWithOutput(options: RunGoScriptOptions): Promise<string>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment variable read by the shell wrapper to tee live output into the temporary runtime log file.
|
|
3
|
+
*/
|
|
4
|
+
export declare const PTBK_CODER_LOG_FILE_ENV_NAME = "PTBK_CODER_LOG_FILE";
|
|
5
|
+
/**
|
|
6
|
+
* Shapes one bash invocation that optionally mirrors live script output into a temporary log file.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildLoggedBashExecution(scriptPath: string, logPath?: string): {
|
|
9
|
+
args: string[];
|
|
10
|
+
env?: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Appends one execution-start section with the raw script input before the shell begins producing output.
|
|
14
|
+
*/
|
|
15
|
+
export declare function appendScriptExecutionLogStart({ scriptPath, scriptContent, logPath, }: {
|
|
16
|
+
scriptPath: string;
|
|
17
|
+
scriptContent: string;
|
|
18
|
+
logPath?: string;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Appends one execution-finish section after the shell settles.
|
|
22
|
+
*/
|
|
23
|
+
export declare function appendScriptExecutionLogFinish({ scriptPath, logPath, status, details, }: {
|
|
24
|
+
scriptPath: string;
|
|
25
|
+
logPath?: string;
|
|
26
|
+
status: string;
|
|
27
|
+
details?: unknown;
|
|
28
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PromptRoundArtifacts } from './PromptRoundArtifacts';
|
|
2
|
+
/**
|
|
3
|
+
* Runs one prompt-processing round with a dedicated temporary runtime log file and optionally defers cleanup to the round tracker.
|
|
4
|
+
*/
|
|
5
|
+
export declare function withPromptRuntimeLog<T>(scriptPath: string, handler: (logPath: string) => Promise<T>, promptRoundArtifacts?: PromptRoundArtifacts): Promise<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RunGoScriptOptions } from './RunGoScriptOptions';
|
|
2
2
|
/**
|
|
3
|
-
* Creates a temporary script file, runs a handler, and
|
|
3
|
+
* Creates a temporary script file, runs a handler, and either cleans it up immediately or defers cleanup to the round tracker.
|
|
4
4
|
*/
|
|
5
5
|
export declare function withTempScript<T>(options: RunGoScriptOptions, handler: (scriptPath: string) => Promise<T>): Promise<T>;
|
|
@@ -4,5 +4,25 @@
|
|
|
4
4
|
export declare function listenForPause(): void;
|
|
5
5
|
/**
|
|
6
6
|
* If the execution is paused, it will wait until it is resumed.
|
|
7
|
+
*
|
|
8
|
+
* @param options.silent - When `true`, suppresses console output (used when the terminal UI handles display).
|
|
9
|
+
* @param options.onPaused - Callback invoked when entering the PAUSED state.
|
|
10
|
+
* @param options.onResumed - Callback invoked when leaving the PAUSED state.
|
|
7
11
|
*/
|
|
8
|
-
export declare function checkPause(
|
|
12
|
+
export declare function checkPause(options?: {
|
|
13
|
+
silent?: boolean;
|
|
14
|
+
onPaused?: () => void;
|
|
15
|
+
onResumed?: () => void;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the current pause state for external consumers such as the terminal UI.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getPauseState(): 'RUNNING' | 'PAUSING' | 'PAUSED';
|
|
21
|
+
/**
|
|
22
|
+
* Requests a pause from an external controller (e.g. the Ink UI).
|
|
23
|
+
*/
|
|
24
|
+
export declare function requestPause(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Resumes execution from an external controller after a pause.
|
|
27
|
+
*/
|
|
28
|
+
export declare function requestResume(): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Commits staged changes with the provided message using the dedicated coding-agent identity when configured,
|
|
3
|
-
* otherwise falls back to the default Git configuration.
|
|
3
|
+
* otherwise falls back to the default Git configuration. Remote pushing is opt-in via `options.autoPush`.
|
|
4
4
|
*/
|
|
5
5
|
export declare function commitChanges(message: string, options?: {
|
|
6
|
-
|
|
6
|
+
autoPush?: boolean;
|
|
7
7
|
}): Promise<void>;
|
|
@@ -5,4 +5,4 @@ import type { PromptSection } from './types/PromptSection';
|
|
|
5
5
|
/**
|
|
6
6
|
* Marks a prompt section as done and records usage pricing and runner details.
|
|
7
7
|
*/
|
|
8
|
-
export declare function markPromptDone(file: PromptFile, section: PromptSection, usage: Usage, runnerName: string | undefined, modelName: string | undefined, promptExecutionStartedDate: moment.Moment): void;
|
|
8
|
+
export declare function markPromptDone(file: PromptFile, section: PromptSection, usage: Usage, runnerName: string | undefined, modelName: string | undefined, promptExecutionStartedDate: moment.Moment, attemptCount?: number): void;
|
|
@@ -4,4 +4,4 @@ import type { PromptSection } from './types/PromptSection';
|
|
|
4
4
|
/**
|
|
5
5
|
* Marks a prompt section as failed and records runner details.
|
|
6
6
|
*/
|
|
7
|
-
export declare function markPromptFailed(file: PromptFile, section: PromptSection, runnerName: string | undefined, modelName: string | undefined, promptExecutionStartedDate: moment.Moment): void;
|
|
7
|
+
export declare function markPromptFailed(file: PromptFile, section: PromptSection, runnerName: string | undefined, modelName: string | undefined, promptExecutionStartedDate: moment.Moment, attemptCount?: number): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for running one verification command after a coding attempt.
|
|
3
|
+
*/
|
|
4
|
+
type RunPromptTestCommandOptions = {
|
|
5
|
+
command: string;
|
|
6
|
+
projectPath: string;
|
|
7
|
+
scriptPath: string;
|
|
8
|
+
logPath?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Runs the configured verification command inside the project root and returns its output.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runPromptTestCommand(options: RunPromptTestCommandOptions): Promise<string>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PromptRunOptions } from '../runners/types/PromptRunOptions';
|
|
2
|
+
import type { PromptRunResult } from '../runners/types/PromptRunResult';
|
|
3
|
+
import type { PromptRunner } from '../runners/types/PromptRunner';
|
|
4
|
+
import { runPromptTestCommand } from './runPromptTestCommand';
|
|
5
|
+
/**
|
|
6
|
+
* Options for running one prompt with optional verification feedback retries.
|
|
7
|
+
*/
|
|
8
|
+
type RunPromptWithTestFeedbackOptions = PromptRunOptions & {
|
|
9
|
+
runner: PromptRunner;
|
|
10
|
+
promptLabel: string;
|
|
11
|
+
testCommand?: string;
|
|
12
|
+
onAttemptStarted?: (attemptCount: number) => void;
|
|
13
|
+
runPromptTestCommandExecutor?: typeof runPromptTestCommand;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Successful prompt execution result enriched with the number of attempts it took.
|
|
17
|
+
*/
|
|
18
|
+
export type RunPromptWithTestFeedbackResult = PromptRunResult & {
|
|
19
|
+
attemptCount: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Runs one coding prompt and, when configured, verifies it with a shell command that can feed failures back.
|
|
23
|
+
*/
|
|
24
|
+
export declare function runPromptWithTestFeedback(options: RunPromptWithTestFeedbackOptions): Promise<RunPromptWithTestFeedbackResult>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import moment from 'moment';
|
|
4
|
+
import type { PromptStats } from '../prompts/types/PromptStats';
|
|
5
|
+
/**
|
|
6
|
+
* Execution phase of the coder run process.
|
|
7
|
+
*
|
|
8
|
+
* @private internal type of coder run UI
|
|
9
|
+
*/
|
|
10
|
+
export type CoderRunPhase = 'initializing' | 'loading' | 'running' | 'verifying' | 'paused' | 'done' | 'error';
|
|
11
|
+
/**
|
|
12
|
+
* Configuration display data for the coder run UI header.
|
|
13
|
+
*
|
|
14
|
+
* @private internal type of coder run UI
|
|
15
|
+
*/
|
|
16
|
+
export type CoderRunConfig = {
|
|
17
|
+
readonly agentName: string;
|
|
18
|
+
readonly modelName?: string;
|
|
19
|
+
readonly thinkingLevel?: string;
|
|
20
|
+
readonly context?: string;
|
|
21
|
+
readonly priority: number;
|
|
22
|
+
readonly testCommand?: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Computed progress snapshot for the coder run UI.
|
|
26
|
+
*
|
|
27
|
+
* @private internal type of coder run UI
|
|
28
|
+
*/
|
|
29
|
+
export type CoderRunProgressSnapshot = {
|
|
30
|
+
readonly totalPrompts: number;
|
|
31
|
+
readonly sessionDone: number;
|
|
32
|
+
readonly sessionTotal: number;
|
|
33
|
+
readonly percentage: number;
|
|
34
|
+
readonly elapsedText: string;
|
|
35
|
+
readonly estimatedTotalText: string;
|
|
36
|
+
readonly estimatedLabel: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Reactive state manager for the coder run terminal UI.
|
|
40
|
+
*
|
|
41
|
+
* Holds all data the Ink components need and emits `'change'` events
|
|
42
|
+
* whenever any property is updated so the UI can re-render.
|
|
43
|
+
*
|
|
44
|
+
* @private internal utility of coder run UI
|
|
45
|
+
*/
|
|
46
|
+
export declare class CoderRunUiState extends EventEmitter {
|
|
47
|
+
config: CoderRunConfig;
|
|
48
|
+
currentPromptLabel: string;
|
|
49
|
+
currentAttempt: number;
|
|
50
|
+
maxAttempts: number;
|
|
51
|
+
agentOutputLines: string[];
|
|
52
|
+
phase: CoderRunPhase;
|
|
53
|
+
statusMessage: string;
|
|
54
|
+
errors: string[];
|
|
55
|
+
private stats;
|
|
56
|
+
private readonly startTime;
|
|
57
|
+
private initialDone;
|
|
58
|
+
/**
|
|
59
|
+
* Total milliseconds the timer was paused/waiting (excluded from elapsed display).
|
|
60
|
+
*/
|
|
61
|
+
private pausedMs;
|
|
62
|
+
/**
|
|
63
|
+
* Timestamp when the timer was last paused, or `undefined` when running.
|
|
64
|
+
*/
|
|
65
|
+
private pausedSince;
|
|
66
|
+
constructor(startTime: moment.Moment);
|
|
67
|
+
/**
|
|
68
|
+
* Pauses the elapsed timer (e.g. while waiting for user input or paused state).
|
|
69
|
+
*/
|
|
70
|
+
pauseTimer(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Resumes the elapsed timer after a pause.
|
|
73
|
+
*/
|
|
74
|
+
resumeTimer(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Replaces the configuration shown in the UI header.
|
|
77
|
+
*/
|
|
78
|
+
setConfig(config: CoderRunConfig): void;
|
|
79
|
+
/**
|
|
80
|
+
* Feeds new prompt statistics from the main loop so the progress bar updates.
|
|
81
|
+
*/
|
|
82
|
+
updateProgress(stats: PromptStats): void;
|
|
83
|
+
/**
|
|
84
|
+
* Computes a progress snapshot on demand so elapsed time ticks with periodic re-renders.
|
|
85
|
+
*/
|
|
86
|
+
getProgress(): CoderRunProgressSnapshot;
|
|
87
|
+
/**
|
|
88
|
+
* Sets the label of the prompt currently being processed and resets per-prompt state.
|
|
89
|
+
*/
|
|
90
|
+
setCurrentPrompt(label: string): void;
|
|
91
|
+
/**
|
|
92
|
+
* Updates the current retry attempt number.
|
|
93
|
+
*/
|
|
94
|
+
setAttempt(attempt: number): void;
|
|
95
|
+
/**
|
|
96
|
+
* Appends raw agent output text, keeping only the last `MAX_AGENT_OUTPUT_LINES`.
|
|
97
|
+
*/
|
|
98
|
+
addAgentOutput(text: string): void;
|
|
99
|
+
/**
|
|
100
|
+
* Transitions the execution phase shown in the UI.
|
|
101
|
+
*/
|
|
102
|
+
setPhase(phase: CoderRunPhase): void;
|
|
103
|
+
/**
|
|
104
|
+
* Updates the status message line beneath the current prompt label.
|
|
105
|
+
*/
|
|
106
|
+
setStatusMessage(message: string): void;
|
|
107
|
+
/**
|
|
108
|
+
* Appends an error message to the error list shown in the UI.
|
|
109
|
+
*/
|
|
110
|
+
addError(errorMessage: string): void;
|
|
111
|
+
private emitChange;
|
|
112
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import moment from 'moment';
|
|
2
|
+
import { CoderRunUiState } from './CoderRunUiState';
|
|
3
|
+
/**
|
|
4
|
+
* Handle returned by `renderCoderRunUi` that exposes the state and lifecycle controls.
|
|
5
|
+
*
|
|
6
|
+
* @private internal type of coder run UI
|
|
7
|
+
*/
|
|
8
|
+
export type CoderRunUiHandle = {
|
|
9
|
+
/** Reactive state the caller updates throughout execution. */
|
|
10
|
+
readonly state: CoderRunUiState;
|
|
11
|
+
/** Enables console interception so runner output flows into the UI agent-output area. */
|
|
12
|
+
startCapturingAgentOutput(): void;
|
|
13
|
+
/** Disables console interception so normal logging resumes. */
|
|
14
|
+
stopCapturingAgentOutput(): void;
|
|
15
|
+
/** Tears down the UI and restores original console methods. */
|
|
16
|
+
cleanup(): void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Boots the ANSI terminal UI for `ptbk coder run`.
|
|
20
|
+
*
|
|
21
|
+
* The UI reserves a fixed number of terminal lines and repaints them periodically.
|
|
22
|
+
* Between repaints, any console output from runners is captured and fed into the
|
|
23
|
+
* scrolling agent-output area.
|
|
24
|
+
*
|
|
25
|
+
* On non-interactive (non-TTY) terminals the UI is skipped entirely and
|
|
26
|
+
* only the state object is provided.
|
|
27
|
+
*
|
|
28
|
+
* @private internal entry point of coder run UI
|
|
29
|
+
*/
|
|
30
|
+
export declare function renderCoderRunUi(startTime: moment.Moment): CoderRunUiHandle;
|
|
@@ -66,7 +66,8 @@ export type AgentBasicInformation = {
|
|
|
66
66
|
permanentId?: string_agent_permanent_id;
|
|
67
67
|
/**
|
|
68
68
|
* Optional description of the agent
|
|
69
|
-
* This is the
|
|
69
|
+
* This is derived from the last `GOAL` / `GOALS` commitment,
|
|
70
|
+
* falling back to deprecated `PERSONA` / `PERSONAE` for backward compatibility.
|
|
70
71
|
*/
|
|
71
72
|
personaDescription: string | null;
|
|
72
73
|
/**
|
|
@@ -9,7 +9,8 @@ export type TeammateProfile = {
|
|
|
9
9
|
*/
|
|
10
10
|
readonly agentName: string;
|
|
11
11
|
/**
|
|
12
|
-
* Short
|
|
12
|
+
* Short profile text for what the agent does, from the last GOAL commitment
|
|
13
|
+
* or deprecated PERSONA fallback.
|
|
13
14
|
*/
|
|
14
15
|
readonly personaDescription: string | null;
|
|
15
16
|
};
|
|
@@ -745,7 +745,7 @@ export type ChatProps = {
|
|
|
745
745
|
* - `BUBBLE_MODE`: keeps the default bubble appearance for all messages.
|
|
746
746
|
* - `ARTICLE_MODE`: keeps user bubbles while rendering assistant replies as borderless article blocks.
|
|
747
747
|
*
|
|
748
|
-
* @default '
|
|
748
|
+
* @default 'ARTICLE_MODE'
|
|
749
749
|
*/
|
|
750
750
|
readonly CHAT_VISUAL_MODE?: ChatVisualMode;
|
|
751
751
|
/**
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Possible runtime shapes returned when importing the `typescript` package.
|
|
3
|
+
*/
|
|
4
|
+
type ImportedTypescriptModule = typeof import('typescript') | {
|
|
5
|
+
default: typeof import('typescript');
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Loads the TypeScript runtime used for parsing JSONC-style project files.
|
|
9
|
+
*
|
|
10
|
+
* @private internal utility of `coder init`
|
|
11
|
+
*/
|
|
12
|
+
export declare function getTypescriptModule(): Promise<typeof import('typescript')>;
|
|
13
|
+
/**
|
|
14
|
+
* Normalizes CommonJS-via-`default` and direct namespace imports of TypeScript.
|
|
15
|
+
*
|
|
16
|
+
* @private internal utility of `getTypescriptModule`
|
|
17
|
+
*/
|
|
18
|
+
export declare function normalizeImportedTypescriptModule(importedTypescriptModule: ImportedTypescriptModule): typeof import('typescript');
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -29,6 +29,13 @@ export declare class PersonaCommitmentDefinition extends BaseCommitmentDefinitio
|
|
|
29
29
|
* Short one-line description of PERSONA.
|
|
30
30
|
*/
|
|
31
31
|
get description(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Optional UI/docs-only deprecation metadata.
|
|
34
|
+
*/
|
|
35
|
+
get deprecation(): {
|
|
36
|
+
readonly message: "Use `GOAL` for agent profile text and inheritance-safe rewrites.";
|
|
37
|
+
readonly replacedBy: readonly ["GOAL"];
|
|
38
|
+
};
|
|
32
39
|
/**
|
|
33
40
|
* Icon for this commitment.
|
|
34
41
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -44,6 +44,10 @@ export declare class AgentLlmExecutionTools implements LlmExecutionTools {
|
|
|
44
44
|
* Cached parsed agent information
|
|
45
45
|
*/
|
|
46
46
|
private _cachedAgentInfo;
|
|
47
|
+
/**
|
|
48
|
+
* Optional server-precomputed model requirements reused until the source changes.
|
|
49
|
+
*/
|
|
50
|
+
private precomputedModelRequirements;
|
|
47
51
|
/**
|
|
48
52
|
* Creates new AgentLlmExecutionTools
|
|
49
53
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
2
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
3
|
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
3
4
|
import type { ExecutionTools } from '../../execution/ExecutionTools';
|
|
4
5
|
import type { Updatable } from '../../types/Updatable';
|
|
@@ -27,6 +28,13 @@ export type AgentOptions = CommonToolsOptions & {
|
|
|
27
28
|
* The source of the agent
|
|
28
29
|
*/
|
|
29
30
|
agentSource: Updatable<string_book>;
|
|
31
|
+
/**
|
|
32
|
+
* Optional precomputed model requirements reused until `agentSource` changes.
|
|
33
|
+
*
|
|
34
|
+
* This keeps the actual runtime prompt aligned with server-prepared requirements
|
|
35
|
+
* such as compact-reference-resolved `TEAM` tools.
|
|
36
|
+
*/
|
|
37
|
+
precomputedModelRequirements?: AgentModelRequirements;
|
|
30
38
|
/**
|
|
31
39
|
* Teacher agent for self-learning
|
|
32
40
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
2
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
3
|
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
3
4
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
4
5
|
import type { OpenAiAgentKitExecutionTools } from '../openai/OpenAiAgentKitExecutionTools';
|
|
@@ -25,4 +26,12 @@ export type CreateAgentLlmExecutionToolsOptions = CommonToolsOptions & {
|
|
|
25
26
|
* The agent source string that defines the agent's behavior
|
|
26
27
|
*/
|
|
27
28
|
agentSource: string_book;
|
|
29
|
+
/**
|
|
30
|
+
* Optional precomputed model requirements reused until `agentSource` changes.
|
|
31
|
+
*
|
|
32
|
+
* This is useful for runtimes such as Agents Server that already resolved compact
|
|
33
|
+
* references (for example in `TEAM`) and need the executed prompt to stay aligned
|
|
34
|
+
* with the server-prepared tool list.
|
|
35
|
+
*/
|
|
36
|
+
precomputedModelRequirements?: AgentModelRequirements;
|
|
28
37
|
};
|
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.112.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-43`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/cli",
|
|
3
|
-
"version": "0.112.0-
|
|
3
|
+
"version": "0.112.0-44",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -129,7 +129,8 @@
|
|
|
129
129
|
"swagger-ui-express": "5.0.1",
|
|
130
130
|
"type-fest": "4.5.0",
|
|
131
131
|
"userhome": "1.0.1",
|
|
132
|
-
"waitasecond": "1.11.164"
|
|
132
|
+
"waitasecond": "1.11.164",
|
|
133
|
+
"typescript": "5.2.2"
|
|
133
134
|
},
|
|
134
135
|
"bin": {
|
|
135
136
|
"promptbook": "bin/promptbook-cli.js",
|