@promptbook/cli 0.112.0-45 → 0.112.0-46
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 +221 -61
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +3 -1
- package/esm/scripts/run-codex-prompts/ui/coderRunUiRefresh.d.ts +17 -0
- package/esm/scripts/run-codex-prompts/ui/renderCoderRunUi.d.ts +4 -3
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/esm/src/avatars/visuals/avatarVisualRegistry.test.d.ts +1 -0
- package/esm/src/avatars/visuals/fractalAvatarVisual.d.ts +7 -0
- package/esm/src/avatars/visuals/octopus2AvatarVisual.d.ts +7 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +221 -61
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +3 -1
- package/umd/scripts/run-codex-prompts/ui/coderRunUiRefresh.d.ts +17 -0
- package/umd/scripts/run-codex-prompts/ui/renderCoderRunUi.d.ts +4 -3
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/umd/src/avatars/visuals/avatarVisualRegistry.test.d.ts +1 -0
- package/umd/src/avatars/visuals/fractalAvatarVisual.d.ts +7 -0
- package/umd/src/avatars/visuals/octopus2AvatarVisual.d.ts +7 -0
- package/umd/src/version.d.ts +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
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. Remote pushing is opt-in via `options.autoPush
|
|
3
|
+
* otherwise falls back to the default Git configuration. Remote pushing is opt-in via `options.autoPush`,
|
|
4
|
+
* while `options.excludePaths` can keep temporary artifacts out of the created commit.
|
|
4
5
|
*/
|
|
5
6
|
export declare function commitChanges(message: string, options?: {
|
|
6
7
|
autoPush?: boolean;
|
|
8
|
+
excludePaths?: ReadonlyArray<string>;
|
|
7
9
|
}): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CoderRunPauseState } from './buildCoderRunUiFrame';
|
|
2
|
+
import type { CoderRunPhase } from './CoderRunUiState';
|
|
3
|
+
/**
|
|
4
|
+
* Refresh cadence used only while the rich coder UI needs animated updates.
|
|
5
|
+
*
|
|
6
|
+
* @private internal constant of coder run UI
|
|
7
|
+
*/
|
|
8
|
+
export declare const ACTIVE_CODER_RUN_UI_REFRESH_INTERVAL_MS = 1000;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the automatic refresh interval for the current UI state.
|
|
11
|
+
*
|
|
12
|
+
* Waiting, paused, and completed states return `undefined` so the rich UI stays
|
|
13
|
+
* perfectly still until actual state changes arrive.
|
|
14
|
+
*
|
|
15
|
+
* @private internal utility of coder run UI
|
|
16
|
+
*/
|
|
17
|
+
export declare function getCoderRunUiAutoRefreshInterval(phase: CoderRunPhase, pauseState: CoderRunPauseState): number | undefined;
|
|
@@ -20,9 +20,10 @@ export type CoderRunUiHandle = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Boots the ANSI terminal UI for `ptbk coder run`.
|
|
22
22
|
*
|
|
23
|
-
* The UI reserves a fixed number of terminal lines and
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* The UI reserves a fixed number of terminal lines and refreshes them incrementally.
|
|
24
|
+
* While a prompt is actively running, it schedules lightweight timed refreshes for
|
|
25
|
+
* the spinner/progress area; otherwise it redraws only when real state changes arrive.
|
|
26
|
+
* Any console output from runners is captured and fed into the scrolling agent-output area.
|
|
26
27
|
*
|
|
27
28
|
* On non-interactive (non-TTY) terminals the UI is skipped entirely and
|
|
28
29
|
* only the state object is provided.
|
|
@@ -5,7 +5,7 @@ import type { AvatarDefinition } from './AvatarDefinition';
|
|
|
5
5
|
*
|
|
6
6
|
* @private shared contract for the avatar rendering system
|
|
7
7
|
*/
|
|
8
|
-
export type AvatarVisualId = 'pixel-art' | 'octopus' | 'minecraft';
|
|
8
|
+
export type AvatarVisualId = 'pixel-art' | 'octopus' | 'octopus2' | 'minecraft' | 'fractal';
|
|
9
9
|
/**
|
|
10
10
|
* Derived color palette used by avatar visuals.
|
|
11
11
|
*
|
|
@@ -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.112.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-45`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
* @generated
|
|
61
61
|
* @see https://github.com/webgptorg/promptbook
|
|
62
62
|
*/
|
|
63
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
63
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-46';
|
|
64
64
|
/**
|
|
65
65
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
66
66
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -45446,7 +45446,8 @@
|
|
|
45446
45446
|
|
|
45447
45447
|
/**
|
|
45448
45448
|
* Commits staged changes with the provided message using the dedicated coding-agent identity when configured,
|
|
45449
|
-
* otherwise falls back to the default Git configuration. Remote pushing is opt-in via `options.autoPush
|
|
45449
|
+
* otherwise falls back to the default Git configuration. Remote pushing is opt-in via `options.autoPush`,
|
|
45450
|
+
* while `options.excludePaths` can keep temporary artifacts out of the created commit.
|
|
45450
45451
|
*/
|
|
45451
45452
|
async function commitChanges(message, options) {
|
|
45452
45453
|
const projectPath = process.cwd();
|
|
@@ -45456,11 +45457,7 @@
|
|
|
45456
45457
|
try {
|
|
45457
45458
|
const agentEnv = buildAgentGitEnv();
|
|
45458
45459
|
const signingFlag = buildAgentGitSigningFlag();
|
|
45459
|
-
await
|
|
45460
|
-
command: 'git add .',
|
|
45461
|
-
cwd: projectPath,
|
|
45462
|
-
env: agentEnv,
|
|
45463
|
-
});
|
|
45460
|
+
await stageCommitChanges(projectPath, agentEnv, options === null || options === void 0 ? void 0 : options.excludePaths);
|
|
45464
45461
|
await runGitCommand({
|
|
45465
45462
|
command: buildGitCommitCommand(commitMessagePath, signingFlag),
|
|
45466
45463
|
cwd: projectPath,
|
|
@@ -45474,6 +45471,56 @@
|
|
|
45474
45471
|
await promises.unlink(commitMessagePath).catch(() => undefined);
|
|
45475
45472
|
}
|
|
45476
45473
|
}
|
|
45474
|
+
/**
|
|
45475
|
+
* Stages repository changes and optionally unstages temporary files that should not end up inside the commit.
|
|
45476
|
+
*/
|
|
45477
|
+
async function stageCommitChanges(projectPath, agentEnv, excludePaths) {
|
|
45478
|
+
await runGitCommand({
|
|
45479
|
+
command: 'git add .',
|
|
45480
|
+
cwd: projectPath,
|
|
45481
|
+
env: agentEnv,
|
|
45482
|
+
});
|
|
45483
|
+
const excludedGitPaths = normalizeExcludedGitPaths(projectPath, excludePaths);
|
|
45484
|
+
if (excludedGitPaths.length === 0) {
|
|
45485
|
+
return;
|
|
45486
|
+
}
|
|
45487
|
+
await runGitCommand({
|
|
45488
|
+
command: `git reset --quiet HEAD -- ${excludedGitPaths.map(quoteShellPath).join(' ')}`,
|
|
45489
|
+
cwd: projectPath,
|
|
45490
|
+
env: agentEnv,
|
|
45491
|
+
isVerbose: false,
|
|
45492
|
+
});
|
|
45493
|
+
}
|
|
45494
|
+
/**
|
|
45495
|
+
* Converts excluded filesystem paths into unique repository-relative Git paths.
|
|
45496
|
+
*/
|
|
45497
|
+
function normalizeExcludedGitPaths(projectPath, excludePaths) {
|
|
45498
|
+
if (!excludePaths || excludePaths.length === 0) {
|
|
45499
|
+
return [];
|
|
45500
|
+
}
|
|
45501
|
+
return [
|
|
45502
|
+
...new Set(excludePaths
|
|
45503
|
+
.map((excludePath) => normalizeExcludedGitPath(projectPath, excludePath))
|
|
45504
|
+
.filter((gitPath) => Boolean(gitPath))),
|
|
45505
|
+
];
|
|
45506
|
+
}
|
|
45507
|
+
/**
|
|
45508
|
+
* Converts one excluded filesystem path into a Git-friendly repository-relative path.
|
|
45509
|
+
*/
|
|
45510
|
+
function normalizeExcludedGitPath(projectPath, excludePath) {
|
|
45511
|
+
const absoluteExcludePath = path.resolve(projectPath, excludePath);
|
|
45512
|
+
const relativeExcludePath = path.relative(projectPath, absoluteExcludePath).replace(/\\/gu, '/');
|
|
45513
|
+
if (relativeExcludePath === '' || relativeExcludePath === '.' || relativeExcludePath.startsWith('../')) {
|
|
45514
|
+
return undefined;
|
|
45515
|
+
}
|
|
45516
|
+
return relativeExcludePath;
|
|
45517
|
+
}
|
|
45518
|
+
/**
|
|
45519
|
+
* Quotes one Git path for safe shell execution.
|
|
45520
|
+
*/
|
|
45521
|
+
function quoteShellPath(path) {
|
|
45522
|
+
return JSON.stringify(path);
|
|
45523
|
+
}
|
|
45477
45524
|
/**
|
|
45478
45525
|
* Branded error used when pushing committed changes fails.
|
|
45479
45526
|
*/
|
|
@@ -48744,9 +48791,7 @@ bash "$1"
|
|
|
48744
48791
|
...options.detailLines.map((detailLine) => `• ${detailLine}`),
|
|
48745
48792
|
]
|
|
48746
48793
|
: [options.statusMessage, ...options.detailLines.map((detailLine) => `• ${detailLine}`)];
|
|
48747
|
-
const visibleOutputLines = options.agentOutputLines
|
|
48748
|
-
? options.agentOutputLines.slice(-MAX_VISIBLE_OUTPUT_LINES).map((line) => `› ${stripAnsi(line)}`)
|
|
48749
|
-
: ['No live agent output yet.'];
|
|
48794
|
+
const visibleOutputLines = buildVisibleOutputLines(options.agentOutputLines);
|
|
48750
48795
|
const controls = buildControlPills(options.pauseState, options.pendingEnterLabel).join(' ');
|
|
48751
48796
|
const frame = [
|
|
48752
48797
|
...renderBox('Brand', runnerDetails, totalWidth, colors__default["default"].cyan.bold),
|
|
@@ -48760,6 +48805,18 @@ bash "$1"
|
|
|
48760
48805
|
frame.push(...renderBox('Controls', [controls], totalWidth, colors__default["default"].white.bold));
|
|
48761
48806
|
return frame;
|
|
48762
48807
|
}
|
|
48808
|
+
/**
|
|
48809
|
+
* Builds the fixed-height live output section so streaming updates do not keep resizing the frame.
|
|
48810
|
+
*/
|
|
48811
|
+
function buildVisibleOutputLines(agentOutputLines) {
|
|
48812
|
+
const visibleOutputLines = agentOutputLines.length > 0
|
|
48813
|
+
? agentOutputLines.slice(-MAX_VISIBLE_OUTPUT_LINES).map((line) => `› ${stripAnsi(line)}`)
|
|
48814
|
+
: ['No live agent output yet.'];
|
|
48815
|
+
while (visibleOutputLines.length < MAX_VISIBLE_OUTPUT_LINES) {
|
|
48816
|
+
visibleOutputLines.push('');
|
|
48817
|
+
}
|
|
48818
|
+
return visibleOutputLines;
|
|
48819
|
+
}
|
|
48763
48820
|
/**
|
|
48764
48821
|
* Renders a framed box with a colored title and padded body lines.
|
|
48765
48822
|
*/
|
|
@@ -49026,11 +49083,33 @@ bash "$1"
|
|
|
49026
49083
|
}
|
|
49027
49084
|
|
|
49028
49085
|
/**
|
|
49029
|
-
* Refresh
|
|
49086
|
+
* Refresh cadence used only while the rich coder UI needs animated updates.
|
|
49087
|
+
*
|
|
49088
|
+
* @private internal constant of coder run UI
|
|
49089
|
+
*/
|
|
49090
|
+
const ACTIVE_CODER_RUN_UI_REFRESH_INTERVAL_MS = 1000;
|
|
49091
|
+
/**
|
|
49092
|
+
* Phases that still benefit from automatic refreshes because the frame can change
|
|
49093
|
+
* over time even without new runner output.
|
|
49030
49094
|
*
|
|
49031
49095
|
* @private internal constant of coder run UI
|
|
49032
49096
|
*/
|
|
49033
|
-
const
|
|
49097
|
+
const AUTO_REFRESH_PHASES = ['initializing', 'loading', 'running', 'verifying'];
|
|
49098
|
+
/**
|
|
49099
|
+
* Returns the automatic refresh interval for the current UI state.
|
|
49100
|
+
*
|
|
49101
|
+
* Waiting, paused, and completed states return `undefined` so the rich UI stays
|
|
49102
|
+
* perfectly still until actual state changes arrive.
|
|
49103
|
+
*
|
|
49104
|
+
* @private internal utility of coder run UI
|
|
49105
|
+
*/
|
|
49106
|
+
function getCoderRunUiAutoRefreshInterval(phase, pauseState) {
|
|
49107
|
+
if (pauseState !== 'RUNNING') {
|
|
49108
|
+
return undefined;
|
|
49109
|
+
}
|
|
49110
|
+
return AUTO_REFRESH_PHASES.includes(phase) ? ACTIVE_CODER_RUN_UI_REFRESH_INTERVAL_MS : undefined;
|
|
49111
|
+
}
|
|
49112
|
+
|
|
49034
49113
|
/**
|
|
49035
49114
|
* Spinner animation frames.
|
|
49036
49115
|
*
|
|
@@ -49059,9 +49138,10 @@ bash "$1"
|
|
|
49059
49138
|
/**
|
|
49060
49139
|
* Boots the ANSI terminal UI for `ptbk coder run`.
|
|
49061
49140
|
*
|
|
49062
|
-
* The UI reserves a fixed number of terminal lines and
|
|
49063
|
-
*
|
|
49064
|
-
*
|
|
49141
|
+
* The UI reserves a fixed number of terminal lines and refreshes them incrementally.
|
|
49142
|
+
* While a prompt is actively running, it schedules lightweight timed refreshes for
|
|
49143
|
+
* the spinner/progress area; otherwise it redraws only when real state changes arrive.
|
|
49144
|
+
* Any console output from runners is captured and fed into the scrolling agent-output area.
|
|
49065
49145
|
*
|
|
49066
49146
|
* On non-interactive (non-TTY) terminals the UI is skipped entirely and
|
|
49067
49147
|
* only the state object is provided.
|
|
@@ -49111,72 +49191,139 @@ bash "$1"
|
|
|
49111
49191
|
process.stdin.setRawMode(true);
|
|
49112
49192
|
}
|
|
49113
49193
|
let spinnerFrame = 0;
|
|
49114
|
-
let
|
|
49194
|
+
let previousFrameLines = [];
|
|
49115
49195
|
let isRendering = false;
|
|
49116
49196
|
let renderScheduled = false;
|
|
49197
|
+
let autoRefreshTimeout;
|
|
49198
|
+
let isDisposed = false;
|
|
49117
49199
|
/**
|
|
49118
49200
|
* Schedules a render on the next tick if one isn't already pending.
|
|
49119
49201
|
* Prevents overlapping renders that cause cursor desync.
|
|
49120
49202
|
*/
|
|
49121
49203
|
function scheduleRender() {
|
|
49122
|
-
if (renderScheduled) {
|
|
49204
|
+
if (renderScheduled || isDisposed) {
|
|
49123
49205
|
return;
|
|
49124
49206
|
}
|
|
49125
49207
|
renderScheduled = true;
|
|
49126
49208
|
setImmediate(() => {
|
|
49127
49209
|
renderScheduled = false;
|
|
49210
|
+
if (isDisposed) {
|
|
49211
|
+
return;
|
|
49212
|
+
}
|
|
49128
49213
|
render();
|
|
49129
49214
|
});
|
|
49130
49215
|
}
|
|
49131
49216
|
/**
|
|
49132
|
-
*
|
|
49217
|
+
* Re-schedules automatic animation refreshes only while the frame can change by itself.
|
|
49133
49218
|
*/
|
|
49134
|
-
function
|
|
49135
|
-
if (
|
|
49219
|
+
function scheduleAutoRefresh() {
|
|
49220
|
+
if (autoRefreshTimeout) {
|
|
49221
|
+
clearTimeout(autoRefreshTimeout);
|
|
49222
|
+
autoRefreshTimeout = undefined;
|
|
49223
|
+
}
|
|
49224
|
+
const autoRefreshInterval = getCoderRunUiAutoRefreshInterval(state.phase, getPauseState());
|
|
49225
|
+
if (autoRefreshInterval === undefined) {
|
|
49226
|
+
return;
|
|
49227
|
+
}
|
|
49228
|
+
autoRefreshTimeout = setTimeout(() => {
|
|
49229
|
+
autoRefreshTimeout = undefined;
|
|
49230
|
+
scheduleRender();
|
|
49231
|
+
}, autoRefreshInterval);
|
|
49232
|
+
}
|
|
49233
|
+
/**
|
|
49234
|
+
* Moves the cursor relative to the bottom of the current frame and rewrites one line in place.
|
|
49235
|
+
*/
|
|
49236
|
+
function rewriteFrameLine(frameLineCount, lineIndex, line) {
|
|
49237
|
+
const linesUpFromBottom = Math.max(0, frameLineCount - 1 - lineIndex);
|
|
49238
|
+
if (linesUpFromBottom > 0) {
|
|
49239
|
+
process.stdout.write(`\x1b[${linesUpFromBottom}A`);
|
|
49240
|
+
}
|
|
49241
|
+
readline.clearLine(process.stdout, 0);
|
|
49242
|
+
readline.cursorTo(process.stdout, 0);
|
|
49243
|
+
process.stdout.write(line);
|
|
49244
|
+
readline.cursorTo(process.stdout, 0);
|
|
49245
|
+
if (linesUpFromBottom > 0) {
|
|
49246
|
+
process.stdout.write(`\x1b[${linesUpFromBottom}B`);
|
|
49247
|
+
readline.cursorTo(process.stdout, 0);
|
|
49248
|
+
}
|
|
49249
|
+
}
|
|
49250
|
+
/**
|
|
49251
|
+
* Fully rewrites the reserved frame area.
|
|
49252
|
+
*/
|
|
49253
|
+
function renderFullFrame(lines) {
|
|
49254
|
+
var _a;
|
|
49255
|
+
const previousFrameLineCount = previousFrameLines.length;
|
|
49256
|
+
const linesToRewriteCount = Math.max(previousFrameLineCount, lines.length);
|
|
49257
|
+
if (previousFrameLineCount > 1) {
|
|
49258
|
+
process.stdout.write(`\x1b[${previousFrameLineCount - 1}A`);
|
|
49259
|
+
}
|
|
49260
|
+
for (let i = 0; i < linesToRewriteCount; i++) {
|
|
49261
|
+
readline.clearLine(process.stdout, 0);
|
|
49262
|
+
readline.cursorTo(process.stdout, 0);
|
|
49263
|
+
process.stdout.write((_a = lines[i]) !== null && _a !== void 0 ? _a : '');
|
|
49264
|
+
if (i < linesToRewriteCount - 1) {
|
|
49265
|
+
process.stdout.write('\n');
|
|
49266
|
+
}
|
|
49267
|
+
}
|
|
49268
|
+
const clearedTrailingLines = linesToRewriteCount - lines.length;
|
|
49269
|
+
if (clearedTrailingLines > 0) {
|
|
49270
|
+
process.stdout.write(`\x1b[${clearedTrailingLines}A`);
|
|
49271
|
+
}
|
|
49272
|
+
readline.cursorTo(process.stdout, 0);
|
|
49273
|
+
}
|
|
49274
|
+
/**
|
|
49275
|
+
* Updates only the frame rows whose visible content changed.
|
|
49276
|
+
*/
|
|
49277
|
+
function renderChangedLines(lines) {
|
|
49278
|
+
for (let i = 0; i < lines.length; i++) {
|
|
49279
|
+
if (previousFrameLines[i] === lines[i]) {
|
|
49280
|
+
continue;
|
|
49281
|
+
}
|
|
49282
|
+
rewriteFrameLine(lines.length, i, lines[i]);
|
|
49283
|
+
}
|
|
49284
|
+
}
|
|
49285
|
+
/**
|
|
49286
|
+
* Builds the current frame snapshot from the latest state.
|
|
49287
|
+
*/
|
|
49288
|
+
function buildFrameLines() {
|
|
49289
|
+
return buildCoderRunUiFrame({
|
|
49290
|
+
terminalWidth: getTerminalWidth(),
|
|
49291
|
+
spinner: SPINNER_FRAMES[spinnerFrame],
|
|
49292
|
+
pauseState: getPauseState(),
|
|
49293
|
+
config: state.config,
|
|
49294
|
+
phase: state.phase,
|
|
49295
|
+
currentPromptLabel: state.currentPromptLabel,
|
|
49296
|
+
currentAttempt: state.currentAttempt,
|
|
49297
|
+
maxAttempts: state.maxAttempts,
|
|
49298
|
+
statusMessage: state.statusMessage,
|
|
49299
|
+
detailLines: state.detailLines,
|
|
49300
|
+
pendingEnterLabel: state.pendingEnterLabel,
|
|
49301
|
+
agentOutputLines: state.agentOutputLines,
|
|
49302
|
+
errors: state.errors,
|
|
49303
|
+
progress: state.getProgress(),
|
|
49304
|
+
});
|
|
49305
|
+
}
|
|
49306
|
+
/**
|
|
49307
|
+
* Clears previously rendered lines and writes a new frame only where needed.
|
|
49308
|
+
*/
|
|
49309
|
+
function render(options) {
|
|
49310
|
+
if (isRendering || isDisposed) {
|
|
49136
49311
|
return;
|
|
49137
49312
|
}
|
|
49138
49313
|
isRendering = true;
|
|
49139
49314
|
try {
|
|
49140
|
-
const lines =
|
|
49141
|
-
|
|
49142
|
-
|
|
49143
|
-
pauseState: getPauseState(),
|
|
49144
|
-
config: state.config,
|
|
49145
|
-
phase: state.phase,
|
|
49146
|
-
currentPromptLabel: state.currentPromptLabel,
|
|
49147
|
-
currentAttempt: state.currentAttempt,
|
|
49148
|
-
maxAttempts: state.maxAttempts,
|
|
49149
|
-
statusMessage: state.statusMessage,
|
|
49150
|
-
detailLines: state.detailLines,
|
|
49151
|
-
pendingEnterLabel: state.pendingEnterLabel,
|
|
49152
|
-
agentOutputLines: state.agentOutputLines,
|
|
49153
|
-
errors: state.errors,
|
|
49154
|
-
progress: state.getProgress(),
|
|
49155
|
-
});
|
|
49156
|
-
if (previousFrameLineCount > 0) {
|
|
49157
|
-
process.stdout.write(`\x1b[${previousFrameLineCount}A`);
|
|
49158
|
-
}
|
|
49159
|
-
for (let i = 0; i < lines.length; i++) {
|
|
49160
|
-
readline.clearLine(process.stdout, 0);
|
|
49161
|
-
readline.cursorTo(process.stdout, 0);
|
|
49162
|
-
process.stdout.write(lines[i]);
|
|
49163
|
-
if (i < lines.length - 1) {
|
|
49164
|
-
process.stdout.write('\n');
|
|
49165
|
-
}
|
|
49315
|
+
const lines = buildFrameLines();
|
|
49316
|
+
if (previousFrameLines.length === 0 || previousFrameLines.length !== lines.length) {
|
|
49317
|
+
renderFullFrame(lines);
|
|
49166
49318
|
}
|
|
49167
|
-
|
|
49168
|
-
|
|
49169
|
-
process.stdout.write('\n');
|
|
49170
|
-
readline.clearLine(process.stdout, 0);
|
|
49171
|
-
readline.cursorTo(process.stdout, 0);
|
|
49172
|
-
}
|
|
49173
|
-
const overshoot = previousFrameLineCount - lines.length;
|
|
49174
|
-
if (overshoot > 0) {
|
|
49175
|
-
process.stdout.write(`\x1b[${overshoot}A`);
|
|
49176
|
-
}
|
|
49319
|
+
else {
|
|
49320
|
+
renderChangedLines(lines);
|
|
49177
49321
|
}
|
|
49178
|
-
|
|
49322
|
+
previousFrameLines = [...lines];
|
|
49179
49323
|
spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES.length;
|
|
49324
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipAutoRefresh)) {
|
|
49325
|
+
scheduleAutoRefresh();
|
|
49326
|
+
}
|
|
49180
49327
|
}
|
|
49181
49328
|
finally {
|
|
49182
49329
|
isRendering = false;
|
|
@@ -49194,6 +49341,7 @@ bash "$1"
|
|
|
49194
49341
|
else {
|
|
49195
49342
|
requestResume();
|
|
49196
49343
|
}
|
|
49344
|
+
scheduleRender();
|
|
49197
49345
|
return;
|
|
49198
49346
|
}
|
|
49199
49347
|
if ((key.name === 'return' || key.name === 'enter') && pendingEnterResolver) {
|
|
@@ -49204,17 +49352,24 @@ bash "$1"
|
|
|
49204
49352
|
}
|
|
49205
49353
|
};
|
|
49206
49354
|
process.stdin.on('keypress', keypressHandler);
|
|
49355
|
+
process.stdout.on('resize', scheduleRender);
|
|
49207
49356
|
process.stdout.write('\n');
|
|
49208
49357
|
render();
|
|
49209
|
-
const interval = setInterval(scheduleRender, UI_REFRESH_INTERVAL_MS);
|
|
49210
49358
|
state.on('change', scheduleRender);
|
|
49211
49359
|
/**
|
|
49212
49360
|
* Tears down the terminal UI and restores console / stdin state.
|
|
49213
49361
|
*/
|
|
49214
49362
|
function cleanup() {
|
|
49215
|
-
|
|
49363
|
+
if (isDisposed) {
|
|
49364
|
+
return;
|
|
49365
|
+
}
|
|
49366
|
+
if (autoRefreshTimeout) {
|
|
49367
|
+
clearTimeout(autoRefreshTimeout);
|
|
49368
|
+
autoRefreshTimeout = undefined;
|
|
49369
|
+
}
|
|
49216
49370
|
state.off('change', scheduleRender);
|
|
49217
49371
|
process.stdin.off('keypress', keypressHandler);
|
|
49372
|
+
process.stdout.off('resize', scheduleRender);
|
|
49218
49373
|
if (process.stdin.isTTY) {
|
|
49219
49374
|
process.stdin.setRawMode(false);
|
|
49220
49375
|
}
|
|
@@ -49226,8 +49381,9 @@ bash "$1"
|
|
|
49226
49381
|
console.warn = originalConsoleWarn;
|
|
49227
49382
|
console.error = originalConsoleError;
|
|
49228
49383
|
console.log = originalConsoleLog;
|
|
49229
|
-
render();
|
|
49384
|
+
render({ skipAutoRefresh: true });
|
|
49230
49385
|
process.stdout.write('\n');
|
|
49386
|
+
isDisposed = true;
|
|
49231
49387
|
}
|
|
49232
49388
|
return {
|
|
49233
49389
|
state,
|
|
@@ -49574,7 +49730,11 @@ bash "$1"
|
|
|
49574
49730
|
progressDisplay === null || progressDisplay === void 0 ? void 0 : progressDisplay.resumeTimer();
|
|
49575
49731
|
uiHandle === null || uiHandle === void 0 ? void 0 : uiHandle.state.resumeTimer();
|
|
49576
49732
|
}
|
|
49577
|
-
await commitChanges(commitMessage, {
|
|
49733
|
+
await commitChanges(commitMessage, {
|
|
49734
|
+
autoPush: options.autoPush,
|
|
49735
|
+
// Keep the live runtime log out of default commits because it is deleted after a successful round.
|
|
49736
|
+
excludePaths: options.preserveLogs ? undefined : [logPath],
|
|
49737
|
+
});
|
|
49578
49738
|
await runPostPromptAutoMigrationIfEnabled(options);
|
|
49579
49739
|
}
|
|
49580
49740
|
catch (error) {
|