@notrico/pi-fold 3.0.3 → 3.0.5
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/CHANGELOG.md +11 -0
- package/README.md +3 -3
- package/docs/renderer-reference.md +4 -0
- package/index.ts +2 -0
- package/package.json +1 -1
- package/scripts/preview.mjs +4 -3
- package/scripts/test.mjs +1 -0
- package/src/fullscreen-overlays.ts +30 -0
- package/src/inspection.ts +9 -3
- package/src/modern-native-tools.ts +2 -1
- package/src/modern-prompts-adapter.ts +2 -1
- package/src/modern-skill-prompts.ts +2 -1
- package/src/modern-subagent-messages.ts +2 -1
- package/src/modern-subagent-spacing.ts +2 -1
- package/src/modern-thinking-adapter.ts +2 -1
- package/src/modern-tool-images.ts +2 -1
- package/src/modern-workflows.ts +2 -1
- package/src/runtime-compatibility.ts +17 -0
- package/src/work-strip.ts +2 -1
- package/tests/action-group-preview.test.mjs +1 -1
- package/tests/fullscreen-overlays.test.mjs +168 -0
- package/tests/ordinary-prompts.test.mjs +1 -1
- package/tests/permission-presentation.test.mjs +1 -0
- package/tests/preview-example.test.mjs +2 -2
- package/tests/runtime-compatibility.test.mjs +23 -0
- package/tests/work-strip-hierarchy.test.mjs +1 -1
- package/tests/work-strip-preview.test.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Release notes
|
|
2
2
|
|
|
3
|
+
## 3.0.5 — Pi 1.4 compatibility
|
|
4
|
+
|
|
5
|
+
- Enable the verified renderer adapters on Pi 1.4.0. Retain Pi 1.3.0 support and checks for unfamiliar component layouts.
|
|
6
|
+
- Report unsupported Pi versions at startup and in `/fold` instead of showing “on” while native rendering remains active.
|
|
7
|
+
- Run the native preview against the selected core package, including installations separate from the extension dependency snapshot.
|
|
8
|
+
|
|
9
|
+
## 3.0.4 — Fullscreen overlays
|
|
10
|
+
|
|
11
|
+
- Temporarily hide inline Kitty images while an overlay is visible in Pi 1.3.0 fullscreen mode. This keeps panel borders and text readable. Restore the images when the last overlay closes or hides, including with folding off.
|
|
12
|
+
- Remove padded shell prompt markers from fullscreen display output so they cannot erase overlay rows. Preserve the original transcript and prompt-navigation metadata.
|
|
13
|
+
|
|
3
14
|
## 3.0.3 — Approval layout
|
|
4
15
|
|
|
5
16
|
- Match approval dialogs to the quieter prompt layout: add spacing around the content and choices, mute keyboard hints, and fill only the selected choice. Keep approval decisions and Details controls unchanged.
|
package/README.md
CHANGED
|
@@ -12,10 +12,10 @@ Replies without tool or subagent activity skip the work strip.
|
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
|
-
Tested with **Pi 1.3.0
|
|
15
|
+
Tested with **Pi 1.3.0 and 1.4.0**, and **Node.js 22.19.0 or later**. Other Pi versions show a compatibility warning and use native rendering.
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
|
-
pi install npm:@notrico/pi-fold@3.0.
|
|
18
|
+
pi install npm:@notrico/pi-fold@3.0.5
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Restart Pi, or run `/reload` when the session and its background work are idle.
|
|
@@ -66,7 +66,7 @@ Run `npm test`, `npm run preview:work`, or `npm run benchmark`. See the [rendere
|
|
|
66
66
|
## Uninstall
|
|
67
67
|
|
|
68
68
|
```sh
|
|
69
|
-
pi remove npm:@notrico/pi-fold@3.0.
|
|
69
|
+
pi remove npm:@notrico/pi-fold@3.0.5
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
[MIT license](LICENSE) · [Report an issue](https://github.com/rrrrrrrrrricoxi/pi-fold/issues)
|
|
@@ -109,4 +109,8 @@ The renderer respects Pi's show-images setting and terminal capability detection
|
|
|
109
109
|
|
|
110
110
|
Compact mode off preserves native image display and sizing. The image adapter is gated to Pi 1.3.0 and restores the native component's options after each compact paint. It does not alter image data, terminal settings, tmux settings, or saved transcripts.
|
|
111
111
|
|
|
112
|
+
In Pi 1.3.0 fullscreen mode, visible overlays temporarily hide inline Kitty images. This works around native image placements covering overlay text and breaking borders. Images return from the native cache when the last overlay closes or hides. The compatibility fix also runs with `/fold off`; it preserves image row heights and does not change image settings or overlay packages such as BTW. Other runtimes and image protocols retain native behavior.
|
|
113
|
+
|
|
114
|
+
The fullscreen adapter also removes shell prompt-zone markers (`OSC 133 A/B/C`) from display rows after layout padding. Pi's native cleanup misses these padded markers, which can make the terminal hide overlay text and border rows. Source rows and prompt-navigation metadata retain their markers. Regular terminal mode and other Pi versions keep native behavior.
|
|
115
|
+
|
|
112
116
|
To inspect mixed bash/codemode groups in the isolated fixture, run `node scripts/preview-actions.mjs`. The final work section includes both bash-led and codemode-led groups and a separate nested-error card. No tools or model run.
|
package/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { registerUnsupportedRuntime } from './src/runtime-compatibility.ts';
|
|
1
2
|
import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
2
3
|
import { clearDisplayLineCache } from './src/display-card.ts';
|
|
3
4
|
import { createDisplayMode } from './src/display-mode.ts';
|
|
@@ -13,6 +14,7 @@ import { registerWorkStrip } from './src/work-strip.ts';
|
|
|
13
14
|
import { registerFoldCommand } from './src/fold-command.ts';
|
|
14
15
|
|
|
15
16
|
export default function piFold(pi: ExtensionAPI): void {
|
|
17
|
+
if (registerUnsupportedRuntime(pi)) return;
|
|
16
18
|
clearDisplayLineCache();
|
|
17
19
|
const mode = createDisplayMode();
|
|
18
20
|
const disposers: Array<() => void> = [];
|
package/package.json
CHANGED
package/scripts/preview.mjs
CHANGED
|
@@ -10,7 +10,8 @@ const source = fileURLToPath(new URL('../', import.meta.url));
|
|
|
10
10
|
export async function createPreview() {
|
|
11
11
|
const hostHome = os.homedir();
|
|
12
12
|
const runtimePath = path.resolve(process.env.PI_RUNTIME || path.join(hostHome, '.local/state/pi-config/current/runtime'));
|
|
13
|
-
const
|
|
13
|
+
const agentRoot = path.resolve(process.env.PI_INSTALL_ROOT || path.join(runtimePath, 'node_modules/@earendil-works/pi-coding-agent'));
|
|
14
|
+
const tuiPath = createRequire(path.join(agentRoot, 'package.json')).resolve('@earendil-works/pi-tui');
|
|
14
15
|
const promptJump = process.env.PI_PROMPT_JUMP_PATH ? path.resolve(process.env.PI_PROMPT_JUMP_PATH) : undefined;
|
|
15
16
|
const questionCandidates = process.env.PI_QUESTIONS_PATH ? [path.resolve(process.env.PI_QUESTIONS_PATH)] : [
|
|
16
17
|
path.join(hostHome, '.local/state/pi-config/current/packages/pi-questions/index.ts'),
|
|
@@ -42,7 +43,7 @@ export async function createPreview() {
|
|
|
42
43
|
setEnv('HOME', temporary); setEnv('PI_CODING_AGENT_DIR', agentDir); setEnv('PI_OFFLINE', '1');
|
|
43
44
|
for (const key of Object.keys(process.env)) if (/(?:API_KEY|ACCESS_TOKEN|AUTH_TOKEN)$/.test(key)) setEnv(key, undefined);
|
|
44
45
|
globalThis.fetch = async () => { throw new Error('Network disabled in renderer preview'); };
|
|
45
|
-
const core = await import(pathToFileURL(path.join(
|
|
46
|
+
const core = await import(pathToFileURL(path.join(agentRoot, 'dist/index.js')).href);
|
|
46
47
|
const template = 'This is an invented long prompt template used only to inspect display behavior. Review the recorded examples, expand the tool groups, and compare native display. No commands should run and no services should be contacted.';
|
|
47
48
|
await fs.mkdir(path.join(agentDir, 'prompts'));
|
|
48
49
|
await fs.writeFile(path.join(agentDir, 'prompts/fixture.md'), `---\ndescription: Inspect synthetic tool, question, and skill display examples.\n---\n${template}`);
|
|
@@ -220,7 +221,7 @@ export async function createPreview() {
|
|
|
220
221
|
runtime = await core.createAgentSessionRuntime(factory, { cwd, agentDir, sessionManager: manager });
|
|
221
222
|
const diagnostics = runtime.services.resourceLoader.getExtensions().errors;
|
|
222
223
|
if (runtime.diagnostics.some(item => item.type === 'error') || diagnostics.length) throw new Error(JSON.stringify([...runtime.diagnostics, ...diagnostics]));
|
|
223
|
-
return { core, runtime, manager, temporary, agentDir, cwd, runtimePath, tuiPath, questionsPath, eventBus, cleanup };
|
|
224
|
+
return { core, runtime, manager, temporary, agentDir, cwd, runtimePath, agentRoot, tuiPath, questionsPath, eventBus, cleanup };
|
|
224
225
|
} catch (error) { await cleanup(); throw error; }
|
|
225
226
|
}
|
|
226
227
|
|
package/scripts/test.mjs
CHANGED
|
@@ -13,6 +13,7 @@ required.push('display-cache-lifecycle.test.mjs');
|
|
|
13
13
|
required.push('fold-command.test.mjs', 'fold-shortcut.test.mjs');
|
|
14
14
|
required.push('mixed-thinking.test.mjs', 'work-strip.test.mjs', 'work-strip-subagents.test.mjs', 'work-strip-preview.test.mjs', 'work-strip-spacing.test.mjs');
|
|
15
15
|
required.push('mixed-action-groups.test.mjs', 'action-group-preview.test.mjs');
|
|
16
|
+
required.push('fullscreen-overlays.test.mjs', 'runtime-compatibility.test.mjs');
|
|
16
17
|
for (const name of required) {
|
|
17
18
|
if (!fs.existsSync(path.join(directory, name))) throw new Error(`Missing required regression suite: ${name}`);
|
|
18
19
|
const result = spawnSync(process.execPath, [path.join(directory, name)], { cwd: directory, env: process.env, stdio: 'inherit' });
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { supportsPiVersion } from './runtime-compatibility.ts';
|
|
2
|
+
import { VERSION } from '@earendil-works/pi-coding-agent';
|
|
3
|
+
import { TuiAltScreen } from '@earendil-works/pi-tui';
|
|
4
|
+
import { chainNativeMethod } from './native-method-chain.ts';
|
|
5
|
+
|
|
6
|
+
const promptZones = /\x1b\]133;[ABC](?:\x07|\x1b\\)/g;
|
|
7
|
+
|
|
8
|
+
/** Pi 1.3 fullscreen output retains prompt markers after layout padding and
|
|
9
|
+
* skips overlay composition on image anchors. Strip display-only zone markers;
|
|
10
|
+
* suppress Kitty anchors while an overlay is visible so native placement cleanup
|
|
11
|
+
* and restoration work. Keep source rows, layout metadata, and settings intact.
|
|
12
|
+
*/
|
|
13
|
+
export function installFullscreenOverlayGuard(tui: any, version = VERSION): () => void {
|
|
14
|
+
if (!supportsPiVersion(version) || !['regular', 'fullscreen'].includes(tui?.mode) || typeof tui.compositeOverlays !== 'function'
|
|
15
|
+
|| typeof tui.hasOverlay !== 'function') return () => {};
|
|
16
|
+
if (tui.mode === 'fullscreen' && typeof tui.prepareKittyScreen !== 'function') return () => {};
|
|
17
|
+
// Extension UI handles are proxies with unstable method identities. Their
|
|
18
|
+
// prototype is native; chain there and limit this guard to the captured terminal.
|
|
19
|
+
// A regular-mode session can switch renderers without recreating its widgets.
|
|
20
|
+
const proto = tui.mode === 'regular' ? TuiAltScreen.prototype as any : Object.getPrototypeOf(tui), terminal = tui.terminal;
|
|
21
|
+
if (!terminal || typeof proto?.compositeOverlays !== 'function' || typeof proto.prepareKittyScreen !== 'function') return () => {};
|
|
22
|
+
const detach = chainNativeMethod(proto, 'compositeOverlays', function(this: any, native, lines: string[], ...args: any[]) {
|
|
23
|
+
if (this.terminal !== terminal || this.mode !== 'fullscreen') return native.call(this, lines, ...args);
|
|
24
|
+
// ponytail: Pi 1.3 fullscreen only; remove when native composition is fixed.
|
|
25
|
+
const hideImages = this.imageProtocol === 'kitty' && this.hasOverlay();
|
|
26
|
+
const base = lines.map(line => hideImages && line.includes('\x1b_G') ? '' : line.replace(promptZones, ''));
|
|
27
|
+
return native.call(this, base, ...args);
|
|
28
|
+
});
|
|
29
|
+
return () => { detach(); tui.requestRender?.(); };
|
|
30
|
+
}
|
package/src/inspection.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { supportsPiVersion } from './runtime-compatibility.ts';
|
|
1
2
|
import type { DisplayMode } from './display-mode.ts';
|
|
2
3
|
import { VERSION, type ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
3
4
|
import { Container, ScrollView, isViewportTUI, type Component } from '@earendil-works/pi-tui';
|
|
4
5
|
import { projectedChildren } from './work-strip-view.ts';
|
|
6
|
+
import { installFullscreenOverlayGuard } from './fullscreen-overlays.ts';
|
|
5
7
|
|
|
6
8
|
type Choice = { id: string; kind: string; label: string; focus(): void };
|
|
7
9
|
type Target = (component: Component) => boolean;
|
|
@@ -9,7 +11,7 @@ const children = (component: any): Component[] => [...(Array.isArray(component?.
|
|
|
9
11
|
|
|
10
12
|
/** Pi 1.3 viewport seam. Read the mounted tree; never replace its layout/root. */
|
|
11
13
|
export function revealInspection(tui: any, target: Target, version = VERSION): boolean {
|
|
12
|
-
if (version
|
|
14
|
+
if (!supportsPiVersion(version) || !tui || !isViewportTUI(tui) || typeof tui.getMountedRoots !== 'function') return false;
|
|
13
15
|
const scrolls: ScrollView[] = [], seen = new Set<Component>();
|
|
14
16
|
const find = (component: Component) => {
|
|
15
17
|
if (seen.has(component)) return; seen.add(component);
|
|
@@ -46,14 +48,18 @@ export function revealInspection(tui: any, target: Target, version = VERSION): b
|
|
|
46
48
|
/** Native picker plus visible focus status. No model tools, transcript or editor mutation. */
|
|
47
49
|
export function registerInspection(pi: ExtensionAPI, mode: DisplayMode): () => void {
|
|
48
50
|
let ui: any, tui: any, disposed = false;
|
|
51
|
+
let restoreFullscreenOverlays: (() => void) | undefined;
|
|
49
52
|
let revealTimer: ReturnType<typeof setTimeout> | undefined;
|
|
50
53
|
const clearStatus = () => { if (revealTimer) clearTimeout(revealTimer); revealTimer = undefined; ui?.setStatus?.('compact-inspection', undefined); };
|
|
51
|
-
const clear = () => { clearStatus(); ui?.setWidget?.('compact-inspection-host', undefined); ui = undefined; tui = undefined; };
|
|
54
|
+
const clear = () => { clearStatus(); restoreFullscreenOverlays?.(); restoreFullscreenOverlays = undefined; ui?.setWidget?.('compact-inspection-host', undefined); ui = undefined; tui = undefined; };
|
|
52
55
|
const subscriptions = [
|
|
53
56
|
pi.on('session_start', (_event, ctx) => {
|
|
54
57
|
clear(); if (disposed || !ctx.hasUI) return; ui = ctx.ui;
|
|
55
58
|
// This zero-row widget only obtains the supported TUI handle. It owns no root.
|
|
56
|
-
ui.setWidget?.('compact-inspection-host', (host: any) => {
|
|
59
|
+
ui.setWidget?.('compact-inspection-host', (host: any) => {
|
|
60
|
+
tui = host; restoreFullscreenOverlays?.(); restoreFullscreenOverlays = installFullscreenOverlayGuard(host);
|
|
61
|
+
return { render: () => [], invalidate() {} };
|
|
62
|
+
});
|
|
57
63
|
}),
|
|
58
64
|
pi.on('session_before_switch', clear), pi.on('session_shutdown', clear),
|
|
59
65
|
pi.on('ui_prompt_start', clearStatus), pi.on('session_tree', clearStatus), pi.on('session_compact', clearStatus), mode.onChange(clearStatus),
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { supportsPiVersion } from './runtime-compatibility.ts';
|
|
1
2
|
import { VERSION, keyHint, type ToolRenderers } from "@earendil-works/pi-coding-agent";
|
|
2
3
|
import { Box, Container, Text, stripTerminalSequences, type Component } from "@earendil-works/pi-tui";
|
|
3
4
|
|
|
4
5
|
type Context = Parameters<NonNullable<ToolRenderers["renderCall"]>>[2];
|
|
5
6
|
/** Native private-state knowledge is confined here. Unsupported Pi versions keep stock rendering. */
|
|
6
|
-
export const nativeToolsSupported = VERSION
|
|
7
|
+
export const nativeToolsSupported = supportsPiVersion(VERSION);
|
|
7
8
|
export const nativeToolContextSupported = (context: Context) => !!context && typeof context.toolCallId === "string" && typeof context.invalidate === "function" && !!context.state && typeof context.state === "object" && typeof context.cwd === "string" && typeof context.expanded === "boolean" && typeof context.executionStarted === "boolean" && typeof context.isPartial === "boolean";
|
|
8
9
|
export function nativeTextFallback(result: any, theme?: any, options = { expanded: true }): Text {
|
|
9
10
|
const text = (Array.isArray(result?.content) ? result.content : []).filter((block: any) => block?.type === "text").map((block: any) => String(block.text ?? "")).join("\n");
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { supportsPiVersion } from './runtime-compatibility.ts';
|
|
1
2
|
import { UserMessageComponent, VERSION } from "@earendil-works/pi-coding-agent";
|
|
2
3
|
import { Markdown } from "@earendil-works/pi-tui";
|
|
3
4
|
|
|
@@ -13,7 +14,7 @@ export function installModernPromptAdapter(hooks: {
|
|
|
13
14
|
fallback?(component: any): void;
|
|
14
15
|
}, version = VERSION): (() => void) | undefined {
|
|
15
16
|
const proto = UserMessageComponent.prototype as any;
|
|
16
|
-
if (version
|
|
17
|
+
if (!supportsPiVersion(version) || typeof proto.render !== "function" || typeof proto.rebuild !== "function") return;
|
|
17
18
|
const owner = Symbol.for("compact-renderer:prompt-adapter:v1");
|
|
18
19
|
proto[owner]?.();
|
|
19
20
|
const render = proto.render, mouse = proto.handleMouse;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { supportsPiVersion } from './runtime-compatibility.ts';
|
|
1
2
|
import type { DisplayMode } from './display-mode.ts';
|
|
2
3
|
import { InteractiveMode, SkillInvocationMessageComponent, UserMessageComponent, VERSION, type ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
3
4
|
import { Container, Markdown, MouseRegion, Spacer, Text, matchesKey, stripTerminalSequences, visibleWidth } from '@earendil-works/pi-tui';
|
|
@@ -14,7 +15,7 @@ export function registerModernSkillPrompts(pi: ExtensionAPI, mode: DisplayMode,
|
|
|
14
15
|
const owner = Symbol.for('compact-renderer:skill-prompts:v1'), shared = globalThis as any;
|
|
15
16
|
shared[owner]?.();
|
|
16
17
|
const proto = InteractiveMode.prototype as any;
|
|
17
|
-
if (version
|
|
18
|
+
if (!supportsPiVersion(version) || typeof proto.addMessageToChat !== 'function' || typeof SkillInvocationMessageComponent.prototype.setExpanded !== 'function') return () => {};
|
|
18
19
|
const cards = new Map<any, Card>(), users = new WeakMap<any, Card>();
|
|
19
20
|
let active = false, disposed = false, ctx: any, host: any, input: (() => void) | undefined, selected: Card | undefined, rendering: Card | undefined;
|
|
20
21
|
const redraw = () => host?.ui?.requestRender?.();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { supportsPiVersion } from './runtime-compatibility.ts';
|
|
1
2
|
import type { DisplayMode } from './display-mode.ts';
|
|
2
3
|
import { ExtensionRunner, VERSION, type ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
3
4
|
import { matchesKey, truncateToWidth } from '@earendil-works/pi-tui';
|
|
@@ -56,7 +57,7 @@ export function subagentMessageSummary(source: any, entry = false): Summary | un
|
|
|
56
57
|
* Registering another message renderer cannot delegate through Pi's first-match registry. */
|
|
57
58
|
export function installSubagentMessageAdapter(wrap: (native: any, entry: boolean) => any, version = VERSION): (() => void) | undefined {
|
|
58
59
|
const proto = ExtensionRunner.prototype as any;
|
|
59
|
-
if (version
|
|
60
|
+
if (!supportsPiVersion(version) || !['getMessageRenderer', 'getEntryRenderer'].every(k => typeof proto[k] === 'function')) return;
|
|
60
61
|
const owner = Symbol.for('compact-renderer:subagent-message-adapter:v1');
|
|
61
62
|
proto[owner]?.();
|
|
62
63
|
const message = proto.getMessageRenderer, entry = proto.getEntryRenderer;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { supportsPiVersion } from './runtime-compatibility.ts';
|
|
1
2
|
import { CustomMessageComponent, VERSION } from '@earendil-works/pi-coding-agent';
|
|
2
3
|
import { Container } from '@earendil-works/pi-tui';
|
|
3
4
|
|
|
@@ -9,7 +10,7 @@ const hidden = Symbol.for('compact-renderer:subagent-hidden:v1');
|
|
|
9
10
|
* seam avoids importing private modules or replacing the transcript container. */
|
|
10
11
|
export function installSubagentSpacingAdapter(version = VERSION): (() => void) | undefined {
|
|
11
12
|
const proto = Container.prototype as any;
|
|
12
|
-
if (version
|
|
13
|
+
if (!supportsPiVersion(version) || typeof proto.render !== 'function') return;
|
|
13
14
|
const owner = Symbol.for('compact-renderer:subagent-spacing:v1');
|
|
14
15
|
proto[owner]?.();
|
|
15
16
|
const original = proto.render;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { supportsPiVersion } from './runtime-compatibility.ts';
|
|
1
2
|
import { AssistantMessageComponent, VERSION } from "@earendil-works/pi-coding-agent";
|
|
2
3
|
import { Markdown, MouseRegion, Spacer, Text } from "@earendil-works/pi-tui";
|
|
3
4
|
import { chainNativeMethod } from "./native-method-chain.ts";
|
|
@@ -49,7 +50,7 @@ export function installModernThinkingAdapter(hooks: {
|
|
|
49
50
|
clear(): void;
|
|
50
51
|
}, version = VERSION): (() => void) | undefined {
|
|
51
52
|
const proto = AssistantMessageComponent.prototype as any;
|
|
52
|
-
if (version
|
|
53
|
+
if (!supportsPiVersion(version) || !["updateContent", "render", "setHideThinkingBlock"].every(key => typeof proto[key] === "function")) return;
|
|
53
54
|
const owner = Symbol.for("compact-renderer:thinking-adapter:v1");
|
|
54
55
|
proto[owner]?.();
|
|
55
56
|
let disposed = false;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { supportsPiVersion } from './runtime-compatibility.ts';
|
|
1
2
|
import { ToolExecutionComponent, VERSION } from "@earendil-works/pi-coding-agent";
|
|
2
3
|
import { getCapabilities, Image, imageFallback, truncateToWidth } from "@earendil-works/pi-tui";
|
|
3
4
|
import { chainNativeMethod } from "./native-method-chain.ts";
|
|
@@ -10,7 +11,7 @@ export type ToolImageView = { open: boolean; count: number; bodyIndent: number;
|
|
|
10
11
|
* objects during render only; never change image sources, settings or ownership. */
|
|
11
12
|
export function installModernToolImages(version = VERSION): (() => void) | undefined {
|
|
12
13
|
const proto = ToolExecutionComponent.prototype as any;
|
|
13
|
-
if (version
|
|
14
|
+
if (!supportsPiVersion(version) || typeof proto.render !== "function" || typeof proto.updateDisplay !== "function") return;
|
|
14
15
|
const owner = Symbol.for("compact-renderer:tool-image-adapter:v1");
|
|
15
16
|
proto[owner]?.();
|
|
16
17
|
let disposed = false;
|
package/src/modern-workflows.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { supportsPiVersion } from './runtime-compatibility.ts';
|
|
1
2
|
import type { DisplayMode } from './display-mode.ts';
|
|
2
3
|
import { AssistantMessageComponent, VERSION, type ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
3
4
|
import { Container, Markdown, MouseRegion, Spacer, Text, matchesKey, truncateToWidth } from '@earendil-works/pi-tui';
|
|
@@ -107,7 +108,7 @@ export function registerModernWorkflows(pi: ExtensionAPI, mode: DisplayMode, ver
|
|
|
107
108
|
const owner = Symbol.for('compact-renderer:workflow-registration:v1'), shared = globalThis as any;
|
|
108
109
|
shared[owner]?.();
|
|
109
110
|
const proto = AssistantMessageComponent.prototype as any;
|
|
110
|
-
if (version
|
|
111
|
+
if (!supportsPiVersion(version) || typeof proto.render !== 'function' || typeof proto.updateContent !== 'function') return () => {};
|
|
111
112
|
const cards = new Map<any, Card>();
|
|
112
113
|
let active = false, disposed = false, selected: WorkflowPane | undefined, uiTheme: any, nextCard = 0;
|
|
113
114
|
let input: (() => void) | undefined, redraw: (() => void) | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VERSION, type ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
|
|
3
|
+
// Exact versions verified by the native rendering suites. Shape checks still
|
|
4
|
+
// protect each private adapter; a new core version needs its own verification.
|
|
5
|
+
export const supportedPiVersions = ['1.3.0', '1.4.0'] as const;
|
|
6
|
+
export const supportsPiVersion = (version: string) => supportedPiVersions.some(supported => supported === version);
|
|
7
|
+
|
|
8
|
+
export function registerUnsupportedRuntime(pi: ExtensionAPI, version = VERSION): boolean {
|
|
9
|
+
if (supportsPiVersion(version)) return false;
|
|
10
|
+
const message = `Pi Fold is unavailable on Pi ${version}. Supported versions: ${supportedPiVersions.join(', ')}. Native display remains active. Update Pi Fold for support.`;
|
|
11
|
+
pi.registerCommand('fold', {
|
|
12
|
+
description: 'Show Pi Fold compatibility status',
|
|
13
|
+
async handler(_args, ctx) { ctx.ui.notify(message, 'warning'); },
|
|
14
|
+
});
|
|
15
|
+
pi.on('session_start', (_event, ctx) => { if (ctx.hasUI) ctx.ui.notify(message, 'warning'); });
|
|
16
|
+
return true;
|
|
17
|
+
}
|
package/src/work-strip.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { supportsPiVersion } from './runtime-compatibility.ts';
|
|
1
2
|
import type { DisplayMode } from './display-mode.ts';
|
|
2
3
|
import { AssistantMessageComponent, CustomMessageComponent, InteractiveMode, SkillInvocationMessageComponent, ToolExecutionComponent, UserMessageComponent, VERSION, type ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
3
4
|
import { Container, Spacer, matchesKey } from '@earendil-works/pi-tui';
|
|
@@ -69,7 +70,7 @@ export function registerWorkStrip(pi: ExtensionAPI, mode: DisplayMode, version =
|
|
|
69
70
|
const owner = Symbol.for('compact-renderer:work-registration:v1'), shared = globalThis as any;
|
|
70
71
|
shared[owner]?.();
|
|
71
72
|
const proto = InteractiveMode.prototype as any;
|
|
72
|
-
if (version
|
|
73
|
+
if (!supportsPiVersion(version) || !['addMessageToChat', 'handleEvent', 'renderSessionItems'].every(k => typeof proto[k] === 'function')) return { dispose() {}, setExpanded: () => false, isShortcutEnabled: () => false, setShortcutEnabled() {} };
|
|
73
74
|
let disposed = false, ctx: any, host: any, attached: any, detachChat: (() => void) | undefined;
|
|
74
75
|
let turns = new Map<any, Turn>(), sources = new WeakMap<any, any>(), hooks = new Map<any, ToolPane>();
|
|
75
76
|
let selected: WorkStripHeader | ToolPane | undefined, input: (() => void) | undefined, timer: ReturnType<typeof setTimeout> | undefined;
|
|
@@ -5,7 +5,7 @@ import { createWorkStripPreview } from '../scripts/preview-work-strip.mjs';
|
|
|
5
5
|
|
|
6
6
|
const preview = await createWorkStripPreview({ actionGroups: true });
|
|
7
7
|
const { core, runtime, manager } = preview;
|
|
8
|
-
const { theme, initTheme } = await import(pathToFileURL(path.join(preview.
|
|
8
|
+
const { theme, initTheme } = await import(pathToFileURL(path.join(preview.agentRoot, 'dist/modes/interactive/theme/theme.js')));
|
|
9
9
|
initTheme('dark', false);
|
|
10
10
|
const plain = value => value.replace(/\x1b\][^\x07]*(?:\x07|\x1b\\)|\x1b\[[0-?]*[ -/]*[@-~]/g, '');
|
|
11
11
|
const errors = [];
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { pathToFileURL } from 'node:url';
|
|
4
|
+
import { loadAgent, loadSource, tui, tuiRoot } from './test-runtime.mjs';
|
|
5
|
+
|
|
6
|
+
const { installFullscreenOverlayGuard } = await loadSource('fullscreen-overlays.ts');
|
|
7
|
+
const { encodeKitty, registerKittyImageMetadata, isImageLine } = await import(
|
|
8
|
+
pathToFileURL(path.join(tuiRoot, 'dist/terminal-image.js')).href
|
|
9
|
+
);
|
|
10
|
+
const deletion = '\x1b_Ga=d,d=a,q=2\x1b\\';
|
|
11
|
+
const { createInteractiveTuiReference } = await loadAgent('modes/interactive/tui-renderer.js');
|
|
12
|
+
let nextImageId = 742;
|
|
13
|
+
|
|
14
|
+
function fixture() {
|
|
15
|
+
const output = [];
|
|
16
|
+
const terminal = { columns: 40, rows: 12, write: text => output.push(text), hideCursor() {} };
|
|
17
|
+
const screen = new tui.TuiAltScreen(terminal, false);
|
|
18
|
+
screen.requestRender = () => {};
|
|
19
|
+
screen.altScreenActive = true;
|
|
20
|
+
screen.imageProtocol = 'kitty';
|
|
21
|
+
const imageId = nextImageId++;
|
|
22
|
+
registerKittyImageMetadata({ imageId, columns: 28, rows: 6, widthPx: 280, heightPx: 120 });
|
|
23
|
+
const image = encodeKitty('c3ludGhldGlj', { columns: 28, rows: 6, imageId, moveCursor: false });
|
|
24
|
+
const lines = ['first row', 'second row', image, '', '', '', '', '', 'last row', '', '', ''];
|
|
25
|
+
screen.addChild({ render: () => lines, invalidate() {} });
|
|
26
|
+
const paint = () => { output.length = 0; screen.doRender(); return output.join(''); };
|
|
27
|
+
const open = () => screen.showOverlay({
|
|
28
|
+
render: () => Array.from({ length: 6 }, () => `│${' '.repeat(18)}│`), invalidate() {},
|
|
29
|
+
}, { width: 20, row: 2, col: 5 });
|
|
30
|
+
return { screen, lines, paint, open };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Reproduce the native failure: the anchor row bypasses text compositing, and
|
|
34
|
+
// the unchanged Kitty placement remains over subsequent overlay rows.
|
|
35
|
+
const stock = fixture();
|
|
36
|
+
stock.paint(); stock.open();
|
|
37
|
+
assert.ok(!stock.paint().includes(deletion), 'stock does not remove the unchanged image placement');
|
|
38
|
+
assert.ok(isImageLine(stock.screen.getScreenLines()[2]), 'stock retains the image anchor inside the overlay');
|
|
39
|
+
assert.ok(!stock.screen.getScreenLines()[2].includes('│'), 'stock loses the anchor-row border');
|
|
40
|
+
|
|
41
|
+
const guarded = fixture();
|
|
42
|
+
guarded.paint();
|
|
43
|
+
const original = guarded.screen.compositeOverlays;
|
|
44
|
+
const initialFrame = guarded.screen.getScreenLines();
|
|
45
|
+
const recordedLines = guarded.lines.slice();
|
|
46
|
+
const cleanup = installFullscreenOverlayGuard(guarded.screen);
|
|
47
|
+
assert.equal(typeof cleanup, 'function', 'the supported native runtime installs a disposable guard');
|
|
48
|
+
try {
|
|
49
|
+
assert.ok(!guarded.paint().includes(deletion), 'no visible overlay leaves image placements intact');
|
|
50
|
+
assert.deepEqual(guarded.screen.getScreenLines(), initialFrame, 'no overlay preserves the native frame');
|
|
51
|
+
const unrelated = fixture(); unrelated.open(); unrelated.paint();
|
|
52
|
+
assert.ok(isImageLine(unrelated.screen.getScreenLines()[2]), 'another terminal keeps its native image behavior');
|
|
53
|
+
const overlay = guarded.open();
|
|
54
|
+
const opened = guarded.paint();
|
|
55
|
+
assert.ok(opened.includes(deletion), 'opening an overlay deletes existing Kitty placements');
|
|
56
|
+
assert.ok(!guarded.screen.getScreenLines().some(isImageLine), 'overlay frame contains no underlying image anchors');
|
|
57
|
+
for (const line of guarded.screen.getScreenLines().slice(2, 8)) {
|
|
58
|
+
assert.equal((line.match(/│/g) || []).length, 2, 'both borders survive on every covered row');
|
|
59
|
+
}
|
|
60
|
+
assert.deepEqual(guarded.lines, recordedLines, 'suppression does not mutate the underlying image rows');
|
|
61
|
+
|
|
62
|
+
overlay.setHidden(true);
|
|
63
|
+
const hidden = guarded.paint();
|
|
64
|
+
assert.match(hidden, /\x1b_Ga=p,q=2,/, 'hiding the last overlay restores the cached image placement');
|
|
65
|
+
assert.doesNotMatch(hidden, /\x1b_Ga=T,/, 'restoring a hidden overlay does not upload the image again');
|
|
66
|
+
assert.ok(guarded.screen.getScreenLines().some(isImageLine));
|
|
67
|
+
overlay.setHidden(false);
|
|
68
|
+
assert.ok(guarded.paint().includes(deletion), 'showing the overlay removes its underlying image again');
|
|
69
|
+
overlay.hide();
|
|
70
|
+
const closed = guarded.paint();
|
|
71
|
+
assert.match(closed, /\x1b_Ga=p,q=2,/, 'closing the last overlay restores the cached image placement');
|
|
72
|
+
assert.doesNotMatch(closed, /\x1b_Ga=T,/, 'closing does not upload image data again');
|
|
73
|
+
assert.deepEqual(guarded.screen.getScreenLines(), initialFrame, 'closing restores the original native frame');
|
|
74
|
+
|
|
75
|
+
cleanup(); cleanup();
|
|
76
|
+
assert.equal(guarded.screen.compositeOverlays, original, 'cleanup restores native compositing');
|
|
77
|
+
guarded.open(); guarded.paint();
|
|
78
|
+
assert.ok(isImageLine(guarded.screen.getScreenLines()[2]), 'cleanup returns image handling to native behavior');
|
|
79
|
+
} finally { cleanup(); }
|
|
80
|
+
|
|
81
|
+
// Widget factories receive the stable native Proxy rather than the renderer.
|
|
82
|
+
// Its method reads return fresh forwarding functions, which must not prevent cleanup.
|
|
83
|
+
const proxied = fixture();
|
|
84
|
+
proxied.paint();
|
|
85
|
+
const proxyOriginal = proxied.screen.compositeOverlays;
|
|
86
|
+
const proxyCleanup = installFullscreenOverlayGuard(createInteractiveTuiReference(() => proxied.screen));
|
|
87
|
+
try {
|
|
88
|
+
proxied.open();
|
|
89
|
+
assert.ok(proxied.paint().includes(deletion), 'the real native forwarding Proxy installs the guard on its renderer');
|
|
90
|
+
assert.ok(!proxied.screen.getScreenLines().some(isImageLine));
|
|
91
|
+
} finally { proxyCleanup(); }
|
|
92
|
+
assert.equal(proxied.screen.compositeOverlays, proxyOriginal, 'Proxy cleanup restores the actual renderer method');
|
|
93
|
+
proxied.paint();
|
|
94
|
+
assert.ok(proxied.screen.getScreenLines().some(isImageLine), 'Proxy cleanup restores native image handling');
|
|
95
|
+
|
|
96
|
+
for (const protocol of [null, 'iterm2']) {
|
|
97
|
+
const fallback = fixture();
|
|
98
|
+
fallback.screen.imageProtocol = protocol;
|
|
99
|
+
const dispose = installFullscreenOverlayGuard(fallback.screen);
|
|
100
|
+
try {
|
|
101
|
+
fallback.open(); fallback.paint();
|
|
102
|
+
assert.ok(isImageLine(fallback.screen.getScreenLines()[2]), 'other protocols preserve native compositing');
|
|
103
|
+
} finally { dispose?.(); }
|
|
104
|
+
}
|
|
105
|
+
for (const overrides of [
|
|
106
|
+
{ mode: 'unknown' },
|
|
107
|
+
{ prepareKittyScreen: undefined }, { hasOverlay: undefined }, { compositeOverlays: undefined },
|
|
108
|
+
]) {
|
|
109
|
+
const { screen } = fixture();
|
|
110
|
+
Object.assign(screen, overrides);
|
|
111
|
+
const before = screen.compositeOverlays;
|
|
112
|
+
const dispose = installFullscreenOverlayGuard(screen);
|
|
113
|
+
assert.equal(screen.compositeOverlays, before, 'unsupported native seams are unchanged');
|
|
114
|
+
dispose?.();
|
|
115
|
+
}
|
|
116
|
+
const future = fixture().screen;
|
|
117
|
+
const futureOriginal = future.compositeOverlays;
|
|
118
|
+
installFullscreenOverlayGuard(future, 'future')?.();
|
|
119
|
+
assert.equal(future.compositeOverlays, futureOriginal, 'an unknown native version remains unchanged');
|
|
120
|
+
|
|
121
|
+
const switched = fixture();
|
|
122
|
+
const regular = new tui.TuiMainScreen(switched.screen.terminal, false);
|
|
123
|
+
regular.requestRender = () => {};
|
|
124
|
+
let active = regular;
|
|
125
|
+
const switchProxy = createInteractiveTuiReference(() => active);
|
|
126
|
+
const regularOriginal = regular.compositeOverlays;
|
|
127
|
+
const switchedOriginal = switched.screen.compositeOverlays;
|
|
128
|
+
const cleanupSwitch = installFullscreenOverlayGuard(switchProxy);
|
|
129
|
+
try {
|
|
130
|
+
const row = [' \x1b]133;A\x07retained source'];
|
|
131
|
+
assert.equal(regular.compositeOverlays, regularOriginal, 'regular-mode native rendering is unchanged');
|
|
132
|
+
assert.match(switchProxy.compositeOverlays(row, 40, 12)[0], /\x1b\]133;/);
|
|
133
|
+
active = switched.screen;
|
|
134
|
+
assert.doesNotMatch(switchProxy.compositeOverlays(row, 40, 12)[0], /\x1b\]133;/, 'switching to fullscreen activates the guard without a widget rebuild');
|
|
135
|
+
active = regular;
|
|
136
|
+
assert.match(switchProxy.compositeOverlays(row, 40, 12)[0], /\x1b\]133;/, 'switching back retains regular-mode prompt markers');
|
|
137
|
+
} finally { cleanupSwitch(); }
|
|
138
|
+
assert.equal(switched.screen.compositeOverlays, switchedOriginal, 'cleanup detaches even after switching back to regular mode');
|
|
139
|
+
|
|
140
|
+
// Fullscreen Pi strips zone markers only at column zero. Layout padding leaves
|
|
141
|
+
// A/B/C in actual terminal writes, where they can erase complete overlay rows.
|
|
142
|
+
const zones = fixture();
|
|
143
|
+
zones.screen.imageProtocol = null;
|
|
144
|
+
const zoneRows = [
|
|
145
|
+
' \x1b]133;A\x07',
|
|
146
|
+
' \x1b[32m\x1b]133;B\x07\x1b]133;C\x07answer\x1b[0m',
|
|
147
|
+
' \x1b]133;A\x1b\\padding',
|
|
148
|
+
' before\x1b]133;B\x1b\\\x1b]133;C\x1b\\after',
|
|
149
|
+
];
|
|
150
|
+
zones.lines.splice(2, 4, ...zoneRows);
|
|
151
|
+
const zonesOverlay = zones.open();
|
|
152
|
+
const stockZones = zones.paint();
|
|
153
|
+
assert.match(stockZones, /\x1b\]133;[ABC]/, 'padded zone markers survive stock fullscreen output');
|
|
154
|
+
const beforeZones = zones.lines.slice();
|
|
155
|
+
const clearZones = installFullscreenOverlayGuard(zones.screen);
|
|
156
|
+
try {
|
|
157
|
+
assert.doesNotMatch(zones.paint(), /\x1b\]133;[ABC]/, 'terminal writes contain no padded prompt markers');
|
|
158
|
+
assert.ok(zones.screen.getScreenLines().slice(2, 6).every(line => (line.match(/│/g) || []).length === 2), 'marker rows retain both overlay borders');
|
|
159
|
+
assert.deepEqual(zones.lines, beforeZones, 'source rows and native prompt-navigation markers remain intact');
|
|
160
|
+
zonesOverlay.hide();
|
|
161
|
+
assert.doesNotMatch(zones.paint(), /\x1b\]133;[ABC]/, 'fullscreen output also removes markers with no overlay');
|
|
162
|
+
const source = [' \x1b]133;A\x07\x1b]8;;https://example.com\x07label\x1b]8;;\x07\x1b]133;D;0\x07'];
|
|
163
|
+
const nativeRow = zones.screen.compositeOverlays(source, 40, 12)[0];
|
|
164
|
+
assert.match(nativeRow, /\x1b\]8;;https:\/\/example.com\x07label/, 'hyperlink controls remain intact');
|
|
165
|
+
assert.match(nativeRow, /\x1b\]133;D;0\x07/, 'only the native fullscreen A/B/C marker family is removed');
|
|
166
|
+
} finally { clearZones(); }
|
|
167
|
+
assert.match(zones.paint(), /\x1b\]133;[ABC]/, 'cleanup restores native marker handling');
|
|
168
|
+
console.log('Fullscreen overlays: image lifecycle, prompt zones, native Proxy cleanup and fallback passed');
|
|
@@ -5,7 +5,7 @@ const { registerModernPrompts } = await loadSource('./modern-prompts.ts');
|
|
|
5
5
|
const { createDisplayMode } = await loadSource('./display-mode.ts');
|
|
6
6
|
const { SkillInvocationMessageComponent } = await loadAgent('modes/interactive/components/skill-invocation-message.js');
|
|
7
7
|
const { UserMessageComponent, VERSION } = core;
|
|
8
|
-
assert.
|
|
8
|
+
assert.ok(['1.3.0', '1.4.0'].includes(VERSION), 'prompt seam uses a verified native runtime');
|
|
9
9
|
const nativeRender = UserMessageComponent.prototype.render;
|
|
10
10
|
const listeners = new Map(), bus = new Map(), terminal = new Set(), transformers = [];
|
|
11
11
|
const subscribe = (map, event, fn) => {
|
|
@@ -222,6 +222,7 @@ fullscreen.addChild(editorContainer);
|
|
|
222
222
|
const nativeUI = Object.assign(Object.create(InteractiveMode.prototype), {
|
|
223
223
|
ui: fullscreen, editor, editorContainer, keybindings: nativeKeys,
|
|
224
224
|
extensionTerminalInputSubscriptions: new Set(),
|
|
225
|
+
extensionDialogs: [], programStatus: { setBlocked() {} },
|
|
225
226
|
});
|
|
226
227
|
const pipeline = fixture();
|
|
227
228
|
const disposePipeline = registerPermissionPresentation(pipeline.pi, pipeline.mode);
|
|
@@ -6,8 +6,8 @@ import { createPreview } from '../scripts/preview.mjs';
|
|
|
6
6
|
|
|
7
7
|
const hostHome = process.env.HOME, hostFetch = globalThis.fetch;
|
|
8
8
|
const preview = await createPreview();
|
|
9
|
-
const { core, runtime, manager, temporary, runtimePath, cwd } = preview;
|
|
10
|
-
const load = file => import(pathToFileURL(path.join(
|
|
9
|
+
const { core, runtime, manager, temporary, runtimePath, agentRoot, cwd } = preview;
|
|
10
|
+
const load = file => import(pathToFileURL(path.join(agentRoot, 'dist', file)).href);
|
|
11
11
|
const { initTheme, theme } = await load('modes/interactive/theme/theme.js');
|
|
12
12
|
const { codemodeRenderers } = await load('extensions/codemode/renderer.js');
|
|
13
13
|
const { Text } = await import(pathToFileURL(preview.tuiPath).href);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { core, loadSource } from './test-runtime.mjs';
|
|
3
|
+
const { supportsPiVersion, registerUnsupportedRuntime } = await loadSource('runtime-compatibility.ts');
|
|
4
|
+
for (const version of ['1.3.0', '1.4.0']) assert.equal(supportsPiVersion(version), true);
|
|
5
|
+
for (const version of ['1.2.0', '1.4.1', '1.5.0', '1.4.0-beta.1', '']) {
|
|
6
|
+
const commands = new Map(), events = new Map(), notices = [];
|
|
7
|
+
const pi = { registerCommand: (name, command) => commands.set(name, command), on: (name, handler) => events.set(name, handler) };
|
|
8
|
+
assert.equal(registerUnsupportedRuntime(pi, version), true);
|
|
9
|
+
const ctx = { hasUI: true, ui: { notify: (message, tone) => notices.push({ message, tone }) } };
|
|
10
|
+
events.get('session_start')({}, ctx);
|
|
11
|
+
for (const choice of ['on', 'status', 'toggle', 'collapse', '']) await commands.get('fold').handler(choice, ctx);
|
|
12
|
+
assert.equal(notices.length, 6);
|
|
13
|
+
for (const notice of notices) {
|
|
14
|
+
assert.match(notice.message, /Pi Fold is unavailable/);
|
|
15
|
+
assert.match(notice.message, /Native display remains active/);
|
|
16
|
+
assert.equal(notice.tone, 'warning');
|
|
17
|
+
assert.doesNotMatch(notice.message, /Pi Fold on/);
|
|
18
|
+
}
|
|
19
|
+
events.get('session_start')({}, { hasUI: false });
|
|
20
|
+
assert.equal(notices.length, 6, 'headless startup does not require a UI');
|
|
21
|
+
}
|
|
22
|
+
assert.equal(registerUnsupportedRuntime({}, core.VERSION), false, 'verified runtime proceeds to normal renderer registration');
|
|
23
|
+
console.log(`Pi ${core.VERSION}: explicit compatibility and unsupported-mode reporting passed`);
|
|
@@ -5,7 +5,7 @@ const { registerWorkStrip } = await loadSource('./work-strip.ts');
|
|
|
5
5
|
const { registerFoldCommand } = await loadSource('./fold-command.ts');
|
|
6
6
|
const { createDisplayMode } = await loadSource('./display-mode.ts');
|
|
7
7
|
const { projectedChildren, workEvidenceType, recordedWorkEvidence } = await loadSource('./work-strip-view.ts');
|
|
8
|
-
assert.
|
|
8
|
+
assert.ok(['1.3.0', '1.4.0'].includes(core.VERSION), 'hierarchy integration runs against a verified native runtime');
|
|
9
9
|
|
|
10
10
|
function fixture() {
|
|
11
11
|
const hooks = new Map(), bus = new Map(), commands = new Map(), shortcuts = new Map(), inputs = new Set(), notices = [];
|
|
@@ -5,7 +5,7 @@ import {createWorkStripPreview} from '../scripts/preview-work-strip.mjs';
|
|
|
5
5
|
const preview=await createWorkStripPreview({stepMs:20});
|
|
6
6
|
const {core,runtime,manager}=preview;
|
|
7
7
|
const {visibleWidth}=await import(pathToFileURL(preview.tuiPath));
|
|
8
|
-
const {theme,initTheme}=await import(pathToFileURL(path.join(preview.
|
|
8
|
+
const {theme,initTheme}=await import(pathToFileURL(path.join(preview.agentRoot,'dist/modes/interactive/theme/theme.js')));
|
|
9
9
|
initTheme('dark',false);
|
|
10
10
|
const strip=s=>s.replace(/\x1b\][^\x07]*(?:\x07|\x1b\\)|\x1b\[[0-?]*[ -/]*[@-~]/g,'');
|
|
11
11
|
const errors=[];
|