Skip to content

Commit 35455ee

Browse files
committed
fix: native upgrade staged message, v2 harness default, moon spinner
Native installs report staged-for-next-start copy. runShell uses the v2 harness unless the legacy flag is set. MoonLoader uses moon frames when style is moon so AgentDynamicWorkflow can host the moon spinner.
1 parent 1eafc40 commit 35455ee

4 files changed

Lines changed: 19 additions & 5 deletions

File tree

‎apps/pythinker-code/src/cli/run-shell.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { homedir } from 'node:os';
33

44
import {
55
createPythinkerHarness,
6+
createPythinkerHarnessV2,
67
flushDiagnosticLogsSync,
78
log,
89
type PythinkerHarness,
@@ -83,7 +84,12 @@ export async function runShell(
8384
},
8485
sessionStartedProperties: { yolo: opts.yolo, auto: opts.auto, plan: opts.plan, afk: false },
8586
};
86-
const harness = createPythinkerHarness(harnessOptions);
87+
const useLegacy =
88+
process.env['PYTHINKER_CODE_LEGACY_FLAG'] === '1' ||
89+
process.env['PYTHINKER_CODE_LEGACY_FLAG'] === 'true';
90+
const harness = useLegacy
91+
? createPythinkerHarness(harnessOptions)
92+
: createPythinkerHarnessV2(harnessOptions);
8793
startupTrace('harness:created');
8894
log.info('pythinker-code starting', {
8995
version,

‎apps/pythinker-code/src/cli/sub/upgrade.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export async function handleUpgrade(
153153
targetVersion: target.version,
154154
source,
155155
});
156-
deps.stdout.write(renderInstallSuccessMessage(target));
156+
deps.stdout.write(renderInstallSuccessMessage(target, source));
157157
return 0;
158158
} catch (error) {
159159
trackUpgradeEvent(deps.track, 'upgrade_command_failed', {

‎apps/pythinker-code/src/cli/update/preflight.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,13 @@ export function renderManualUpdateMessage(
221221
);
222222
}
223223

224-
export function renderInstallSuccessMessage(target: UpdateTarget): string {
224+
export function renderInstallSuccessMessage(
225+
target: UpdateTarget,
226+
source?: string,
227+
): string {
228+
if (source === 'native') {
229+
return `Pythinker Code ${target.version} is staged; it applies the next time you start the CLI.\n`;
230+
}
225231
return `Updated ${NPM_PACKAGE_NAME} to ${target.version}. Restart the CLI to use the new version.\n`;
226232
}
227233

‎apps/pythinker-code/src/tui/components/chrome/moon-loader.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import type { TUI } from '@pymodel/pi-tui';
44
import {
55
BRAILLE_SPINNER_FRAMES,
66
BRAILLE_SPINNER_INTERVAL_MS,
7+
MOON_SPINNER_FRAMES,
8+
MOON_SPINNER_INTERVAL_MS,
79
formatThinkingSpinnerLabel,
810
} from '#/tui/constant/rendering';
911
import { currentTheme } from '#/tui/theme';
@@ -43,8 +45,8 @@ export class MoonLoader extends Text {
4345
) {
4446
super('', 1, 0);
4547
this.ui = ui;
46-
this.frames = [...BRAILLE_SPINNER_FRAMES];
47-
this.interval = BRAILLE_SPINNER_INTERVAL_MS;
48+
this.frames = style === 'moon' ? [...MOON_SPINNER_FRAMES] : [...BRAILLE_SPINNER_FRAMES];
49+
this.interval = style === 'moon' ? MOON_SPINNER_INTERVAL_MS : BRAILLE_SPINNER_INTERVAL_MS;
4850
this.colorFn = colorFn;
4951
this.useVerbLabels = options?.verbLabels ?? false;
5052
this.label = this.useVerbLabels ? formatThinkingSpinnerLabel() : label;

0 commit comments

Comments
 (0)