@mnmal-ai/surface-core 0.14.6 → 0.16.0
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/dist/app.d.ts +10 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/fullscreen.d.ts +19 -0
- package/dist/fullscreen.d.ts.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +341 -175
- package/dist/keys.d.ts +7 -0
- package/dist/keys.d.ts.map +1 -1
- package/dist/module.d.ts +5 -2
- package/dist/module.d.ts.map +1 -1
- package/dist/{overlay-DQUbfIKu.js → overlay-By-Ewn3S.js} +97 -6
- package/dist/pure.d.ts +2 -1
- package/dist/pure.d.ts.map +1 -1
- package/dist/pure.js +2 -2
- package/dist/terminal.d.ts +22 -2
- package/dist/terminal.d.ts.map +1 -1
- package/dist/transcript.d.ts +3 -1
- package/dist/transcript.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/app.d.ts
CHANGED
|
@@ -82,6 +82,13 @@ export interface AppOptions {
|
|
|
82
82
|
* unchanged.
|
|
83
83
|
*/
|
|
84
84
|
readonly anchored?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Full-screen: the app runs in the terminal's alternate screen, the transcript scrolls in a
|
|
87
|
+
* viewport (PgUp / PgDn, End jumps back to the bottom while scrolled up) and the input, band and
|
|
88
|
+
* status row stay pinned. Default true. `SURFACE_FULLSCREEN=on|off` overrides it. Ignored off a
|
|
89
|
+
* TTY. `anchored` applies only when this is off.
|
|
90
|
+
*/
|
|
91
|
+
readonly fullscreen?: boolean;
|
|
85
92
|
/**
|
|
86
93
|
* How `run()` prepares the terminal before the first frame (ground, pane wipe, bottom anchor).
|
|
87
94
|
* Options here pass through to `prepareTerminal`, over an `anchor` that follows `anchored`.
|
|
@@ -125,11 +132,13 @@ interface AppProps {
|
|
|
125
132
|
readonly rows?: number;
|
|
126
133
|
}
|
|
127
134
|
/** What `run()` prepares the terminal with, or `null` when the host has prepared it already. */
|
|
128
|
-
export declare function runTerminalOptions(opts: Pick<AppOptions, 'anchored' | 'terminal'
|
|
135
|
+
export declare function runTerminalOptions(opts: Pick<AppOptions, 'anchored' | 'terminal'>, fullscreen: boolean): PrepareTerminalOptions | null;
|
|
129
136
|
export declare function createApp(opts: AppOptions): {
|
|
130
137
|
registry: Registry;
|
|
131
138
|
App: (props: AppProps) => ReactElement;
|
|
132
139
|
run(): Promise<void>;
|
|
140
|
+
/** Full-screen as resolved from the option and `SURFACE_FULLSCREEN`, before the TTY check. */
|
|
141
|
+
fullscreen: boolean;
|
|
133
142
|
};
|
|
134
143
|
export {};
|
|
135
144
|
//# sourceMappingURL=app.d.ts.map
|
package/dist/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAQ,MAAM,yBAAyB,CAAC;AAa3D,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAQ,MAAM,yBAAyB,CAAC;AAa3D,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAuB7D,OAAO,KAAK,EAGV,KAAK,EAIL,SAAS,EAGV,MAAM,aAAa,CAAC;AAerB,OAAO,EAGL,KAAK,sBAAsB,EAK5B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,QAAQ,EAOb,KAAK,MAAM,IAAI,OAAO,EAGtB,KAAK,SA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AAE,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAEjG;AAED,qGAAqG;AACrG,UAAU,QAAQ;IAChB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,gGAAgG;AAChG,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC,EAC/C,UAAU,EAAE,OAAO,GAClB,sBAAsB,GAAG,IAAI,CAO/B;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG;IAC3C,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,YAAY,CAAC;IACvC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,8FAA8F;IAC9F,UAAU,EAAE,OAAO,CAAC;CACrB,CAyvCA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Whether full-screen is on: `SURFACE_FULLSCREEN` (`on` / `off`) over the app's option over on. */
|
|
2
|
+
export declare function resolveFullscreen(option: boolean | undefined, env: string | undefined): {
|
|
3
|
+
readonly on: boolean;
|
|
4
|
+
readonly invalid: string | null;
|
|
5
|
+
};
|
|
6
|
+
/** Where the viewport is: following the bottom (`held: null`), or held with this top row. */
|
|
7
|
+
export interface Scroll {
|
|
8
|
+
readonly held: number | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const FOLLOWING: Scroll;
|
|
11
|
+
/** The first content row shown. A held top past the end (the terminal grew) is clamped. */
|
|
12
|
+
export declare function viewTop(s: Scroll, content: number, viewport: number): number;
|
|
13
|
+
/** Content rows below the viewport. */
|
|
14
|
+
export declare function linesBelow(s: Scroll, content: number, viewport: number): number;
|
|
15
|
+
/** Scrolls by `delta` rows (negative is up). Reaching the bottom follows again. */
|
|
16
|
+
export declare function scrollBy(s: Scroll, delta: number, content: number, viewport: number): Scroll;
|
|
17
|
+
/** A PgUp/PgDn step: a viewport less one row of overlap, never under one. */
|
|
18
|
+
export declare function pageStep(viewport: number): number;
|
|
19
|
+
//# sourceMappingURL=fullscreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fullscreen.d.ts","sourceRoot":"","sources":["../src/fullscreen.ts"],"names":[],"mappings":"AAEA,oGAAoG;AACpG,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB;IAAE,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAM3D;AAED,6FAA6F;AAC7F,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,SAAS,EAAE,MAAuB,CAAC;AAIhD,2FAA2F;AAC3F,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED,uCAAuC;AACvC,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/E;AAED,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAI5F;AAED,6EAA6E;AAC7E,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { applySuggestion, mergeCompletions } from './complete.js';
|
|
|
4
4
|
export { assertComposes, CompositionError, composeModules, RESERVED_GLOBAL_KEYS, type Registry } from './compose.js';
|
|
5
5
|
export { atEnd, type Draft, type EditKeys, EMPTY_DRAFT, editKey, insertChunk, maskDraft, pasteToLine, wordLeft, wordRight } from './editor.js';
|
|
6
6
|
export { CTRL_C_WINDOW_MS, ctrlC } from './exit-chord.js';
|
|
7
|
+
export { FOLLOWING, linesBelow, pageStep, resolveFullscreen, type Scroll, scrollBy, viewTop } from './fullscreen.js';
|
|
7
8
|
export { EMPTY_HISTORY, HISTORY_MAX, type HistoryState, mayWalk, remember, settle, walk } from './history.js';
|
|
8
9
|
export { normaliseKeySpec } from './key-spec.js';
|
|
9
10
|
export { type KeyState, keySpecOf, type Route, resolveKey } from './keys.js';
|
|
@@ -12,6 +13,6 @@ export { type Overlay, panelOf, setPanel } from './overlay.js';
|
|
|
12
13
|
export { clampSelection, commandUsage, completeDraft, enterRuns, MENU_NAME_WIDTH, menuWindow, moveSelection, type PaletteRow, paletteMatches, paletteQuery, paletteRows, parseCommandLine } from './palette.js';
|
|
13
14
|
export { type InputRoute, routeInput } from './route-input.js';
|
|
14
15
|
export { sanitise } from './sanitise.js';
|
|
15
|
-
export { anchorPadding, CLEAR_PANE, DEFAULT_GROUND, groundSequence, type LiveMeasure, liveShrink, type PrepareTerminalOptions, prepareSequence, prepareTerminal, RESET_GROUND, reflowSequence, type TerminalOut, type TerminalProcess } from './terminal.js';
|
|
16
|
+
export { anchorPadding, CLEAR_PANE, DEFAULT_GROUND, groundSequence, type LiveMeasure, liveShrink, type PrepareTerminalOptions, prepareSequence, prepareTerminal, RESET_GROUND, reflowSequence, type TerminalOut, type TerminalProcess, WHEEL_ARROWS_OFF, WHEEL_ARROWS_ON } from './terminal.js';
|
|
16
17
|
export { type AnswerEntry, type AppEntry, type AskEntry, addGap, answerEntry, arriveTurn, commitEntry, type Entry, emptyTranscript, type Flight, type GapEntry, heldAsks, markedFlights, type NoteEntry, sendTurn, type Transcript } from './transcript.js';
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,SAAS,EACT,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,KAAK,QAAQ,EACd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,EACL,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,WAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACT,WAAW,EACX,QAAQ,EACR,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EACL,aAAa,EACb,WAAW,EACX,KAAK,YAAY,EACjB,OAAO,EACP,QAAQ,EACR,MAAM,EACN,IAAI,EACL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAE,SAAS,EAAE,KAAK,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,IAAI,EACT,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,UA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OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACT,eAAe,EACf,UAAU,EACV,aAAa,EACb,KAAK,UAAU,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,aAAa,EACb,UAAU,EACV,cAAc,EACd,cAAc,EACd,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,sBAAsB,EAC3B,eAAe,EACf,eAAe,EACf,YAAY,EACZ,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,gBAAgB,EAChB,eAAe,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,MAAM,EACN,WAAW,EACX,UAAU,EACV,WAAW,EACX,KAAK,KAAK,EACV,eAAe,EACf,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,QAAQ,EACR,aAAa,EACb,KAAK,SAAS,EACd,QAAQ,EACR,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as viewTop, A as clampSelection, B as keySpecOf, C as prepareTerminal, D as routeInput, E as sanitise, F as moveSelection, G as remember, H as EMPTY_HISTORY, I as paletteMatches, J as FOLLOWING, K as settle, L as paletteQuery, M as completeDraft, N as enterRuns, O as unavailableReason, P as menuWindow, Q as scrollBy, R as paletteRows, S as prepareSequence, T as reprintStart, U as HISTORY_MAX, V as resolveKey, W as mayWalk, X as pageStep, Y as linesBelow, Z as resolveFullscreen, _ as WHEEL_ARROWS_OFF, _t as applySuggestion, a as answerEntry, at as graphemeAt, b as groundSequence, c as dropGaps, ct as pasteToLine, d as markedFlights, dt as applyInput, et as CTRL_C_WINDOW_MS, f as sendTurn, ft as CompositionError, g as RESET_GROUND, gt as normaliseKeySpec, h as REPRINT_LINES, ht as composeModules, i as addGap, it as editKey, j as commandUsage, k as MENU_NAME_WIDTH, l as emptyTranscript, lt as wordLeft, m as DEFAULT_GROUND, mt as assertComposes, n as setPanel, nt as EMPTY_DRAFT, o as arriveTurn, ot as insertChunk, p as CLEAR_PANE, pt as RESERVED_GLOBAL_KEYS, q as walk, r as defineModule, rt as atEnd, s as commitEntry, st as maskDraft, t as panelOf, tt as ctrlC, u as heldAsks, ut as wordRight, v as WHEEL_ARROWS_ON, vt as mergeCompletions, w as reflowSequence, x as liveShrink, y as anchorPadding, z as parseCommandLine } from "./overlay-By-Ewn3S.js";
|
|
2
2
|
import { spinnerFrame } from "@mnmal-ai/surface-kit";
|
|
3
3
|
import { Box, Static, Text, measureElement, render, useApp, useInput, usePaste, useStdout } from "ink";
|
|
4
4
|
import { Component, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -37,6 +37,19 @@ function Safe(props) {
|
|
|
37
37
|
children: /* @__PURE__ */ jsx(Run, { render: props.render })
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
+
/** A committed entry as `Static` prints it, recording its height for the next re-lay's budget. */
|
|
41
|
+
function Printed(props) {
|
|
42
|
+
const ref = useRef(null);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (ref.current !== null) props.heights.set(props.id, measureElement(ref.current).height);
|
|
45
|
+
});
|
|
46
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
47
|
+
ref,
|
|
48
|
+
paddingX: props.paddingX,
|
|
49
|
+
flexDirection: "column",
|
|
50
|
+
children: props.children
|
|
51
|
+
});
|
|
52
|
+
}
|
|
40
53
|
const ERROR_KIND = "core.error";
|
|
41
54
|
const CANCELLED_KIND = "core.cancelled";
|
|
42
55
|
const TOAST_MS = 3e3;
|
|
@@ -104,11 +117,12 @@ function defaultPanelRows(terminalRows, opts) {
|
|
|
104
117
|
return Math.max(3, terminalRows - SHELL_ROWS - (opts?.band === true ? BAND_ROWS : 0));
|
|
105
118
|
}
|
|
106
119
|
/** What `run()` prepares the terminal with, or `null` when the host has prepared it already. */
|
|
107
|
-
function runTerminalOptions(opts) {
|
|
120
|
+
function runTerminalOptions(opts, fullscreen) {
|
|
108
121
|
if (opts.terminal === false) return null;
|
|
109
122
|
return {
|
|
110
123
|
anchor: opts.anchored === true,
|
|
111
|
-
...opts.terminal
|
|
124
|
+
...opts.terminal,
|
|
125
|
+
...fullscreen ? { fullscreen } : {}
|
|
112
126
|
};
|
|
113
127
|
}
|
|
114
128
|
function createApp(opts) {
|
|
@@ -127,18 +141,32 @@ function createApp(opts) {
|
|
|
127
141
|
const presenceModule = registry.presence?.module ?? "";
|
|
128
142
|
const panelRows = opts.panelRows ?? ((r) => defaultPanelRows(r, { band }));
|
|
129
143
|
const anchored = opts.anchored === true;
|
|
144
|
+
const fs = resolveFullscreen(opts.fullscreen, process.env.SURFACE_FULLSCREEN);
|
|
130
145
|
function App({ columns, rows }) {
|
|
131
146
|
const { exit } = useApp();
|
|
132
|
-
const
|
|
147
|
+
const stdout = useStdout().stdout;
|
|
148
|
+
const full = fs.on && stdout.isTTY === true;
|
|
149
|
+
const relays = anchored && !full;
|
|
133
150
|
const [term, setTerm] = useState(() => ({
|
|
134
151
|
columns: stdout.columns ?? 120,
|
|
135
152
|
rows: stdout.rows ?? 30
|
|
136
153
|
}));
|
|
154
|
+
const [transcript, setTranscript] = useState(() => emptyTranscript());
|
|
155
|
+
const transcriptRef = useRef(transcript);
|
|
156
|
+
const putTranscript = useCallback((fn) => {
|
|
157
|
+
transcriptRef.current = fn(transcriptRef.current);
|
|
158
|
+
setTranscript(transcriptRef.current);
|
|
159
|
+
}, []);
|
|
137
160
|
const [epoch, setEpoch] = useState(0);
|
|
161
|
+
const heights = useRef(/* @__PURE__ */ new Map());
|
|
162
|
+
const [reprintFrom, setReprintFrom] = useState(0);
|
|
138
163
|
const relayout = useCallback(() => {
|
|
139
164
|
if (stdout.isTTY) stdout.write(reflowSequence(stdout.rows));
|
|
165
|
+
putTranscript(dropGaps);
|
|
166
|
+
const kept = transcriptRef.current.committed;
|
|
167
|
+
setReprintFrom(reprintStart(kept.map((e) => heights.current.get(e.key) ?? 1), REPRINT_LINES));
|
|
140
168
|
setEpoch((e) => e + 1);
|
|
141
|
-
}, [stdout]);
|
|
169
|
+
}, [stdout, putTranscript]);
|
|
142
170
|
useEffect(() => {
|
|
143
171
|
const laidOut = {
|
|
144
172
|
columns: stdout.columns ?? 120,
|
|
@@ -150,7 +178,7 @@ function createApp(opts) {
|
|
|
150
178
|
columns: stdout.columns ?? 120,
|
|
151
179
|
rows: stdout.rows ?? 30
|
|
152
180
|
});
|
|
153
|
-
if (!
|
|
181
|
+
if (!relays) return;
|
|
154
182
|
clearTimeout(timer);
|
|
155
183
|
timer = setTimeout(() => {
|
|
156
184
|
const now = {
|
|
@@ -169,7 +197,11 @@ function createApp(opts) {
|
|
|
169
197
|
clearTimeout(timer);
|
|
170
198
|
stdout.off("resize", onResize);
|
|
171
199
|
};
|
|
172
|
-
}, [
|
|
200
|
+
}, [
|
|
201
|
+
stdout,
|
|
202
|
+
relayout,
|
|
203
|
+
relays
|
|
204
|
+
]);
|
|
173
205
|
const width = Math.max(1, (columns ?? term.columns) - 2 * gutter);
|
|
174
206
|
const height = rows ?? term.rows;
|
|
175
207
|
const showRail = registry.rail.length > 0 && width >= railMin;
|
|
@@ -183,12 +215,6 @@ function createApp(opts) {
|
|
|
183
215
|
};
|
|
184
216
|
const sizeRef = useRef(panelSize);
|
|
185
217
|
sizeRef.current = panelSize;
|
|
186
|
-
const [transcript, setTranscript] = useState(() => emptyTranscript());
|
|
187
|
-
const transcriptRef = useRef(transcript);
|
|
188
|
-
const putTranscript = useCallback((fn) => {
|
|
189
|
-
transcriptRef.current = fn(transcriptRef.current);
|
|
190
|
-
setTranscript(transcriptRef.current);
|
|
191
|
-
}, []);
|
|
192
218
|
const [live, setLive] = useState(/* @__PURE__ */ new Map());
|
|
193
219
|
const [draft, setDraft] = useState(EMPTY_DRAFT);
|
|
194
220
|
const [, setHistory] = useState(EMPTY_HISTORY);
|
|
@@ -220,6 +246,12 @@ function createApp(opts) {
|
|
|
220
246
|
armedRef.current = a;
|
|
221
247
|
setArmed(a);
|
|
222
248
|
}, []);
|
|
249
|
+
const [scroll, setScroll] = useState(FOLLOWING);
|
|
250
|
+
const scrollRef = useRef(FOLLOWING);
|
|
251
|
+
const putScroll = useCallback((next) => {
|
|
252
|
+
scrollRef.current = next;
|
|
253
|
+
setScroll(next);
|
|
254
|
+
}, []);
|
|
223
255
|
const defOf = useCallback((o) => o ? registry.panels.get(`${o.module}/${o.panel}`)?.def : void 0, []);
|
|
224
256
|
const putHistory = useCallback((h) => {
|
|
225
257
|
historyRef.current = h;
|
|
@@ -420,6 +452,7 @@ function createApp(opts) {
|
|
|
420
452
|
}
|
|
421
453
|
}, [ctxFor, putTranscript]);
|
|
422
454
|
const handleLine = useCallback((line, sent) => {
|
|
455
|
+
putScroll(FOLLOWING);
|
|
423
456
|
const text = line.trim();
|
|
424
457
|
const open = overlayRef.current;
|
|
425
458
|
const owner = open ? registry.panels.get(`${open.module}/${open.panel}`)?.def : void 0;
|
|
@@ -441,7 +474,7 @@ function createApp(opts) {
|
|
|
441
474
|
return;
|
|
442
475
|
}
|
|
443
476
|
if (text === "") return;
|
|
444
|
-
if (sent === void 0) putHistory(remember(historyRef.current, text));
|
|
477
|
+
if (sent === void 0 || sent.remember === true) putHistory(remember(historyRef.current, text));
|
|
445
478
|
const route = routeInput(text, registry, opts.defaultTurn);
|
|
446
479
|
if (route.kind === "command") Promise.resolve().then(() => route.spec.run(route.args, ctxFor(route.module))).catch((err) => print(`/${route.spec.name} failed: ${err instanceof Error ? err.message : String(err)}`, "error"));
|
|
447
480
|
else if (route.kind === "unknown-command") print(`unknown command /${route.name}`, "warn");
|
|
@@ -454,13 +487,43 @@ function createApp(opts) {
|
|
|
454
487
|
putHistory,
|
|
455
488
|
runTurn,
|
|
456
489
|
guard,
|
|
457
|
-
putOverlay
|
|
490
|
+
putOverlay,
|
|
491
|
+
putScroll
|
|
458
492
|
]);
|
|
459
493
|
handleLineRef.current = handleLine;
|
|
494
|
+
const viewportRef = useRef(null);
|
|
495
|
+
const flightsRef = useRef(null);
|
|
496
|
+
const [measured, setMeasured] = useState({
|
|
497
|
+
content: 0,
|
|
498
|
+
viewport: 1
|
|
499
|
+
});
|
|
500
|
+
const measuredRef = useRef(measured);
|
|
501
|
+
const contentRows = useCallback(() => {
|
|
502
|
+
let rows = 0;
|
|
503
|
+
for (const e of transcriptRef.current.committed) rows += heights.current.get(e.key) ?? 1;
|
|
504
|
+
return rows + (flightsRef.current === null ? 0 : measureElement(flightsRef.current).height);
|
|
505
|
+
}, []);
|
|
506
|
+
const viewportRows = useCallback(() => viewportRef.current === null ? measuredRef.current.viewport : Math.max(1, measureElement(viewportRef.current).height), []);
|
|
507
|
+
useEffect(() => {
|
|
508
|
+
if (!full || viewportRef.current === null) return;
|
|
509
|
+
const now = {
|
|
510
|
+
content: contentRows(),
|
|
511
|
+
viewport: viewportRows()
|
|
512
|
+
};
|
|
513
|
+
const held = scrollRef.current.held;
|
|
514
|
+
if (held !== null && held >= Math.max(0, now.content - now.viewport)) putScroll(FOLLOWING);
|
|
515
|
+
const was = measuredRef.current;
|
|
516
|
+
if (now.content === was.content && now.viewport === was.viewport) return;
|
|
517
|
+
measuredRef.current = now;
|
|
518
|
+
setMeasured(now);
|
|
519
|
+
});
|
|
520
|
+
useEffect(() => {
|
|
521
|
+
if (fs.invalid !== null) print(`SURFACE_FULLSCREEN=${fs.invalid} ignored: use on or off`, "warn");
|
|
522
|
+
}, [print]);
|
|
460
523
|
const liveRef = useRef(null);
|
|
461
524
|
const lastLive = useRef(null);
|
|
462
525
|
useEffect(() => {
|
|
463
|
-
if (!
|
|
526
|
+
if (!relays || liveRef.current === null) return;
|
|
464
527
|
const now = {
|
|
465
528
|
height: measureElement(liveRef.current).height,
|
|
466
529
|
committed: transcript.committed.filter((e) => e.kind !== "gap").length,
|
|
@@ -473,9 +536,13 @@ function createApp(opts) {
|
|
|
473
536
|
const panelOpen = overlay !== null || menu !== null;
|
|
474
537
|
const wasPanelOpen = useRef(panelOpen);
|
|
475
538
|
useEffect(() => {
|
|
476
|
-
if (
|
|
539
|
+
if (relays && wasPanelOpen.current && !panelOpen) relayout();
|
|
477
540
|
wasPanelOpen.current = panelOpen;
|
|
478
|
-
}, [
|
|
541
|
+
}, [
|
|
542
|
+
panelOpen,
|
|
543
|
+
relayout,
|
|
544
|
+
relays
|
|
545
|
+
]);
|
|
479
546
|
const [pendingLine, setPendingLine] = useState(null);
|
|
480
547
|
useEffect(() => {
|
|
481
548
|
if (pendingLine === null) return;
|
|
@@ -483,7 +550,7 @@ function createApp(opts) {
|
|
|
483
550
|
handleLine(pendingLine);
|
|
484
551
|
}, [pendingLine, handleLine]);
|
|
485
552
|
const sendAfterClose = (line) => {
|
|
486
|
-
if (
|
|
553
|
+
if (relays) setPendingLine(line);
|
|
487
554
|
else handleLine(line);
|
|
488
555
|
};
|
|
489
556
|
const putDraft = useCallback((d) => {
|
|
@@ -562,7 +629,8 @@ function createApp(opts) {
|
|
|
562
629
|
} : null,
|
|
563
630
|
menu: menu?.kind ?? null,
|
|
564
631
|
draftEmpty: draft.text === "",
|
|
565
|
-
armed: armedOn !== null && overlay?.module === armedOn.module && overlay.panel === armedOn.panel && draft.text === armedOn.key ? armedOn.key : null
|
|
632
|
+
armed: armedOn !== null && overlay?.module === armedOn.module && overlay.panel === armedOn.panel && draft.text === armedOn.key ? armedOn.key : null,
|
|
633
|
+
...full ? { viewport: scrollRef.current.held === null ? "following" : "held" } : {}
|
|
566
634
|
};
|
|
567
635
|
const route = resolveKey(state, key, registry);
|
|
568
636
|
switch (route.kind) {
|
|
@@ -713,6 +781,13 @@ function createApp(opts) {
|
|
|
713
781
|
putDraft(atEnd(step.text));
|
|
714
782
|
return;
|
|
715
783
|
}
|
|
784
|
+
case "scroll": {
|
|
785
|
+
const content = contentRows();
|
|
786
|
+
const viewport = viewportRows();
|
|
787
|
+
const step = route.act === "page-up" ? -pageStep(viewport) : pageStep(viewport);
|
|
788
|
+
putScroll(route.act === "bottom" ? FOLLOWING : scrollBy(scrollRef.current, step, content, viewport));
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
716
791
|
case "submit": {
|
|
717
792
|
putArmed(null);
|
|
718
793
|
const line = draft.text;
|
|
@@ -917,13 +992,244 @@ function createApp(opts) {
|
|
|
917
992
|
}
|
|
918
993
|
return /* @__PURE__ */ jsx(Text, { children: "\n".repeat(Math.max(0, e.lines - 1)) }, e.key);
|
|
919
994
|
};
|
|
995
|
+
const printed = reprintFrom === 0 ? transcript.committed : [{
|
|
996
|
+
key: `trimmed:${epoch}`,
|
|
997
|
+
kind: "note",
|
|
998
|
+
text: `… ${reprintFrom} earlier ${reprintFrom === 1 ? "entry" : "entries"} not reprinted`,
|
|
999
|
+
tone: "dim"
|
|
1000
|
+
}, ...transcript.committed.slice(reprintFrom)];
|
|
1001
|
+
const flightRows = /* @__PURE__ */ jsxs(Fragment, { children: [markedFlights(transcript).map((f) => /* @__PURE__ */ jsx(Box, { children: waiting(f, false) }, `marked:${f.id}`)), heldAsks(transcript).map((f) => /* @__PURE__ */ jsxs(Box, {
|
|
1002
|
+
flexDirection: "column",
|
|
1003
|
+
children: [askView ? /* @__PURE__ */ jsx(Safe, {
|
|
1004
|
+
module: "app",
|
|
1005
|
+
theme,
|
|
1006
|
+
render: () => askView({
|
|
1007
|
+
entry: f,
|
|
1008
|
+
held: true,
|
|
1009
|
+
theme,
|
|
1010
|
+
size: { columns: width }
|
|
1011
|
+
})
|
|
1012
|
+
}) : /* @__PURE__ */ jsxs(Text, {
|
|
1013
|
+
color: theme.color.accent,
|
|
1014
|
+
children: [
|
|
1015
|
+
theme.glyph.prompt,
|
|
1016
|
+
" ",
|
|
1017
|
+
sanitise(f.question)
|
|
1018
|
+
]
|
|
1019
|
+
}), waiting(f, true)]
|
|
1020
|
+
}, f.id))] });
|
|
1021
|
+
const overlayRows = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1022
|
+
panel && overlay ? /* @__PURE__ */ jsx(Box, {
|
|
1023
|
+
backgroundColor: theme.color.raised,
|
|
1024
|
+
paddingX: PANEL_PAD_X,
|
|
1025
|
+
paddingY: PANEL_PAD_Y,
|
|
1026
|
+
flexDirection: "column",
|
|
1027
|
+
children: /* @__PURE__ */ jsx(Safe, {
|
|
1028
|
+
module: overlay.module,
|
|
1029
|
+
theme,
|
|
1030
|
+
render: () => panel.view({
|
|
1031
|
+
state: overlay.state,
|
|
1032
|
+
theme,
|
|
1033
|
+
size: panelSize,
|
|
1034
|
+
...armed !== null && armed.module === overlay.module && armed.panel === overlay.panel && draft.text === armed.key ? { armed: {
|
|
1035
|
+
key: armed.key,
|
|
1036
|
+
label: armed.label
|
|
1037
|
+
} } : {}
|
|
1038
|
+
})
|
|
1039
|
+
}, `${overlay.module}/${overlay.panel}`)
|
|
1040
|
+
}) : null,
|
|
1041
|
+
menu?.kind === "palette" ? /* @__PURE__ */ jsx(MenuList, {
|
|
1042
|
+
theme,
|
|
1043
|
+
rows: paletteItems.map((c) => ({
|
|
1044
|
+
key: c.name,
|
|
1045
|
+
name: commandUsage(c),
|
|
1046
|
+
detail: c.summary
|
|
1047
|
+
})),
|
|
1048
|
+
selected: menu.selected,
|
|
1049
|
+
height: menuRows,
|
|
1050
|
+
empty: `no command matches ${draft.text}`,
|
|
1051
|
+
hint: "tab complete · enter run · esc close"
|
|
1052
|
+
}) : null,
|
|
1053
|
+
menu?.kind === "completion" ? /* @__PURE__ */ jsx(MenuList, {
|
|
1054
|
+
theme,
|
|
1055
|
+
rows: menu.items.map((s) => ({
|
|
1056
|
+
key: s.insert,
|
|
1057
|
+
name: s.label,
|
|
1058
|
+
detail: s.detail ?? ""
|
|
1059
|
+
})),
|
|
1060
|
+
selected: menu.selected,
|
|
1061
|
+
height: menuRows,
|
|
1062
|
+
empty: "no completions",
|
|
1063
|
+
hint: "tab complete · esc close"
|
|
1064
|
+
}) : null
|
|
1065
|
+
] });
|
|
1066
|
+
const pinnedRows = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1067
|
+
band ? /* @__PURE__ */ jsxs(Box, {
|
|
1068
|
+
borderStyle: "bold",
|
|
1069
|
+
borderTop: false,
|
|
1070
|
+
borderRight: false,
|
|
1071
|
+
borderBottom: false,
|
|
1072
|
+
borderColor: theme.color.edge,
|
|
1073
|
+
backgroundColor: theme.color.surfaceAlt,
|
|
1074
|
+
paddingX: 1,
|
|
1075
|
+
paddingY: 1,
|
|
1076
|
+
flexDirection: "column",
|
|
1077
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
1078
|
+
shownDraft.text.slice(0, shownDraft.cursor),
|
|
1079
|
+
under === "" ? /* @__PURE__ */ jsx(Text, {
|
|
1080
|
+
color: theme.color.cursor,
|
|
1081
|
+
children: "█"
|
|
1082
|
+
}) : /* @__PURE__ */ jsx(Text, {
|
|
1083
|
+
inverse: true,
|
|
1084
|
+
children: under
|
|
1085
|
+
}),
|
|
1086
|
+
under === "" ? "" : shownDraft.text.slice(shownDraft.cursor + under.length)
|
|
1087
|
+
] }), /* @__PURE__ */ jsxs(Box, {
|
|
1088
|
+
marginTop: 1,
|
|
1089
|
+
children: [
|
|
1090
|
+
presence ? /* @__PURE__ */ jsx(Box, {
|
|
1091
|
+
flexShrink: 0,
|
|
1092
|
+
children: /* @__PURE__ */ jsxs(Text, {
|
|
1093
|
+
bold: true,
|
|
1094
|
+
children: [sanitise(presence.name), " "]
|
|
1095
|
+
})
|
|
1096
|
+
}) : null,
|
|
1097
|
+
/* @__PURE__ */ jsx(Box, {
|
|
1098
|
+
flexGrow: 1,
|
|
1099
|
+
minWidth: 0,
|
|
1100
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
1101
|
+
color: theme.color.dim,
|
|
1102
|
+
wrap: "truncate",
|
|
1103
|
+
children: presence?.view ? /* @__PURE__ */ jsx(Safe, {
|
|
1104
|
+
module: presenceModule,
|
|
1105
|
+
theme,
|
|
1106
|
+
render: () => presence.view?.({ theme })
|
|
1107
|
+
}) : null
|
|
1108
|
+
})
|
|
1109
|
+
}),
|
|
1110
|
+
/* @__PURE__ */ jsx(Box, {
|
|
1111
|
+
flexShrink: 0,
|
|
1112
|
+
paddingLeft: notice === null ? 0 : 2,
|
|
1113
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
1114
|
+
color: theme.color.warn,
|
|
1115
|
+
children: notice ?? " "
|
|
1116
|
+
})
|
|
1117
|
+
})
|
|
1118
|
+
]
|
|
1119
|
+
})]
|
|
1120
|
+
}) : /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsxs(Text, {
|
|
1121
|
+
color: theme.color.accent,
|
|
1122
|
+
children: [theme.glyph.prompt, " "]
|
|
1123
|
+
}), shownDraft.text] }),
|
|
1124
|
+
toast ? /* @__PURE__ */ jsx(Text, {
|
|
1125
|
+
color: theme.color[toast.tone],
|
|
1126
|
+
children: toast.text
|
|
1127
|
+
}) : null,
|
|
1128
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
1129
|
+
...band ? { marginTop: 1 } : {},
|
|
1130
|
+
children: [registry.status.map((s) => /* @__PURE__ */ jsx(Box, {
|
|
1131
|
+
marginRight: 2,
|
|
1132
|
+
children: /* @__PURE__ */ jsx(Safe, {
|
|
1133
|
+
module: s.module,
|
|
1134
|
+
theme,
|
|
1135
|
+
render: () => s.item.view({ theme })
|
|
1136
|
+
})
|
|
1137
|
+
}, `${s.module}:${s.item.id}`)), [...status.entries()].map(([k, v]) => /* @__PURE__ */ jsxs(Text, {
|
|
1138
|
+
color: theme.color[v.tone],
|
|
1139
|
+
children: [v.text, " "]
|
|
1140
|
+
}, k))]
|
|
1141
|
+
})
|
|
1142
|
+
] });
|
|
1143
|
+
const railColumn = /* @__PURE__ */ jsx(Fragment, { children: showRail ? /* @__PURE__ */ jsx(Box, {
|
|
1144
|
+
flexDirection: "column",
|
|
1145
|
+
width: 32,
|
|
1146
|
+
marginLeft: 1,
|
|
1147
|
+
children: registry.rail.map((r) => /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Safe, {
|
|
1148
|
+
module: r.module,
|
|
1149
|
+
theme,
|
|
1150
|
+
render: () => r.item.view({ theme })
|
|
1151
|
+
}) }, `${r.module}:${r.item.id}`))
|
|
1152
|
+
}) : null });
|
|
1153
|
+
if (full) {
|
|
1154
|
+
const { content, viewport } = measured;
|
|
1155
|
+
const top = viewTop(scroll, content, viewport);
|
|
1156
|
+
const below = linesBelow(scroll, content, viewport);
|
|
1157
|
+
const lo = top - viewport;
|
|
1158
|
+
const hi = top + 2 * viewport;
|
|
1159
|
+
const shown = [];
|
|
1160
|
+
let at = 0;
|
|
1161
|
+
let skipped = null;
|
|
1162
|
+
for (const e of transcript.committed) {
|
|
1163
|
+
const h = heights.current.get(e.key);
|
|
1164
|
+
const rows = h ?? 1;
|
|
1165
|
+
if (at + rows > lo && at < hi || h === void 0) {
|
|
1166
|
+
if (skipped === null) skipped = at;
|
|
1167
|
+
shown.push(e);
|
|
1168
|
+
}
|
|
1169
|
+
at += rows;
|
|
1170
|
+
}
|
|
1171
|
+
const rowsAbove = skipped ?? at;
|
|
1172
|
+
const markerText = `↓ ${below} lines below · End to jump back`;
|
|
1173
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
1174
|
+
flexDirection: "row",
|
|
1175
|
+
height,
|
|
1176
|
+
paddingX: gutter,
|
|
1177
|
+
children: [/* @__PURE__ */ jsxs(Box, {
|
|
1178
|
+
flexDirection: "column",
|
|
1179
|
+
flexGrow: 1,
|
|
1180
|
+
children: [/* @__PURE__ */ jsxs(Box, {
|
|
1181
|
+
ref: viewportRef,
|
|
1182
|
+
flexDirection: "column",
|
|
1183
|
+
flexGrow: 1,
|
|
1184
|
+
flexShrink: 1,
|
|
1185
|
+
minHeight: 1,
|
|
1186
|
+
overflow: "hidden",
|
|
1187
|
+
children: [/* @__PURE__ */ jsxs(Box, {
|
|
1188
|
+
flexDirection: "column",
|
|
1189
|
+
flexShrink: 0,
|
|
1190
|
+
marginTop: -(top - rowsAbove),
|
|
1191
|
+
children: [shown.map((e) => /* @__PURE__ */ jsx(Printed, {
|
|
1192
|
+
id: e.key,
|
|
1193
|
+
heights: heights.current,
|
|
1194
|
+
paddingX: 0,
|
|
1195
|
+
children: committed(e)
|
|
1196
|
+
}, e.key)), /* @__PURE__ */ jsx(Box, {
|
|
1197
|
+
ref: flightsRef,
|
|
1198
|
+
flexDirection: "column",
|
|
1199
|
+
flexShrink: 0,
|
|
1200
|
+
children: flightRows
|
|
1201
|
+
})]
|
|
1202
|
+
}), panelOpen ? /* @__PURE__ */ jsx(Box, {
|
|
1203
|
+
position: "absolute",
|
|
1204
|
+
bottom: 0,
|
|
1205
|
+
width: "100%",
|
|
1206
|
+
flexDirection: "column",
|
|
1207
|
+
children: overlayRows
|
|
1208
|
+
}) : below > 0 ? /* @__PURE__ */ jsx(Box, {
|
|
1209
|
+
position: "absolute",
|
|
1210
|
+
bottom: 0,
|
|
1211
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
1212
|
+
color: theme.color.dim,
|
|
1213
|
+
wrap: "truncate",
|
|
1214
|
+
children: markerText.padEnd(panelOuter.columns)
|
|
1215
|
+
})
|
|
1216
|
+
}) : null]
|
|
1217
|
+
}), /* @__PURE__ */ jsx(Box, {
|
|
1218
|
+
flexDirection: "column",
|
|
1219
|
+
flexShrink: 0,
|
|
1220
|
+
children: pinnedRows
|
|
1221
|
+
})]
|
|
1222
|
+
}), railColumn]
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
920
1225
|
return /* @__PURE__ */ jsxs(Box, {
|
|
921
1226
|
flexDirection: "column",
|
|
922
1227
|
children: [/* @__PURE__ */ jsx(Static, {
|
|
923
|
-
items:
|
|
924
|
-
children: (e) => /* @__PURE__ */ jsx(
|
|
1228
|
+
items: printed,
|
|
1229
|
+
children: (e) => /* @__PURE__ */ jsx(Printed, {
|
|
1230
|
+
id: e.key,
|
|
1231
|
+
heights: heights.current,
|
|
925
1232
|
paddingX: gutter,
|
|
926
|
-
flexDirection: "column",
|
|
927
1233
|
children: committed(e)
|
|
928
1234
|
}, e.key)
|
|
929
1235
|
}, `static:${epoch}`), /* @__PURE__ */ jsxs(Box, {
|
|
@@ -934,170 +1240,30 @@ function createApp(opts) {
|
|
|
934
1240
|
flexDirection: "column",
|
|
935
1241
|
flexGrow: 1,
|
|
936
1242
|
children: [
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
children: [askView ? /* @__PURE__ */ jsx(Safe, {
|
|
941
|
-
module: "app",
|
|
942
|
-
theme,
|
|
943
|
-
render: () => askView({
|
|
944
|
-
entry: f,
|
|
945
|
-
held: true,
|
|
946
|
-
theme,
|
|
947
|
-
size: { columns: width }
|
|
948
|
-
})
|
|
949
|
-
}) : /* @__PURE__ */ jsxs(Text, {
|
|
950
|
-
color: theme.color.accent,
|
|
951
|
-
children: [
|
|
952
|
-
theme.glyph.prompt,
|
|
953
|
-
" ",
|
|
954
|
-
sanitise(f.question)
|
|
955
|
-
]
|
|
956
|
-
}), waiting(f, true)]
|
|
957
|
-
}, f.id)),
|
|
958
|
-
panel && overlay ? /* @__PURE__ */ jsx(Box, {
|
|
959
|
-
backgroundColor: theme.color.raised,
|
|
960
|
-
paddingX: PANEL_PAD_X,
|
|
961
|
-
paddingY: PANEL_PAD_Y,
|
|
962
|
-
flexDirection: "column",
|
|
963
|
-
children: /* @__PURE__ */ jsx(Safe, {
|
|
964
|
-
module: overlay.module,
|
|
965
|
-
theme,
|
|
966
|
-
render: () => panel.view({
|
|
967
|
-
state: overlay.state,
|
|
968
|
-
theme,
|
|
969
|
-
size: panelSize,
|
|
970
|
-
...armed !== null && armed.module === overlay.module && armed.panel === overlay.panel && draft.text === armed.key ? { armed: {
|
|
971
|
-
key: armed.key,
|
|
972
|
-
label: armed.label
|
|
973
|
-
} } : {}
|
|
974
|
-
})
|
|
975
|
-
}, `${overlay.module}/${overlay.panel}`)
|
|
976
|
-
}) : null,
|
|
977
|
-
menu?.kind === "palette" ? /* @__PURE__ */ jsx(MenuList, {
|
|
978
|
-
theme,
|
|
979
|
-
rows: paletteItems.map((c) => ({
|
|
980
|
-
key: c.name,
|
|
981
|
-
name: commandUsage(c),
|
|
982
|
-
detail: c.summary
|
|
983
|
-
})),
|
|
984
|
-
selected: menu.selected,
|
|
985
|
-
height: menuRows,
|
|
986
|
-
empty: `no command matches ${draft.text}`,
|
|
987
|
-
hint: "tab complete · enter run · esc close"
|
|
988
|
-
}) : null,
|
|
989
|
-
menu?.kind === "completion" ? /* @__PURE__ */ jsx(MenuList, {
|
|
990
|
-
theme,
|
|
991
|
-
rows: menu.items.map((s) => ({
|
|
992
|
-
key: s.insert,
|
|
993
|
-
name: s.label,
|
|
994
|
-
detail: s.detail ?? ""
|
|
995
|
-
})),
|
|
996
|
-
selected: menu.selected,
|
|
997
|
-
height: menuRows,
|
|
998
|
-
empty: "no completions",
|
|
999
|
-
hint: "tab complete · esc close"
|
|
1000
|
-
}) : null,
|
|
1001
|
-
band ? /* @__PURE__ */ jsxs(Box, {
|
|
1002
|
-
borderStyle: "bold",
|
|
1003
|
-
borderTop: false,
|
|
1004
|
-
borderRight: false,
|
|
1005
|
-
borderBottom: false,
|
|
1006
|
-
borderColor: theme.color.edge,
|
|
1007
|
-
backgroundColor: theme.color.surfaceAlt,
|
|
1008
|
-
paddingX: 1,
|
|
1009
|
-
paddingY: 1,
|
|
1010
|
-
flexDirection: "column",
|
|
1011
|
-
children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
1012
|
-
shownDraft.text.slice(0, shownDraft.cursor),
|
|
1013
|
-
under === "" ? /* @__PURE__ */ jsx(Text, {
|
|
1014
|
-
color: theme.color.cursor,
|
|
1015
|
-
children: "█"
|
|
1016
|
-
}) : /* @__PURE__ */ jsx(Text, {
|
|
1017
|
-
inverse: true,
|
|
1018
|
-
children: under
|
|
1019
|
-
}),
|
|
1020
|
-
under === "" ? "" : shownDraft.text.slice(shownDraft.cursor + under.length)
|
|
1021
|
-
] }), /* @__PURE__ */ jsxs(Box, {
|
|
1022
|
-
marginTop: 1,
|
|
1023
|
-
children: [
|
|
1024
|
-
presence ? /* @__PURE__ */ jsx(Box, {
|
|
1025
|
-
flexShrink: 0,
|
|
1026
|
-
children: /* @__PURE__ */ jsxs(Text, {
|
|
1027
|
-
bold: true,
|
|
1028
|
-
children: [sanitise(presence.name), " "]
|
|
1029
|
-
})
|
|
1030
|
-
}) : null,
|
|
1031
|
-
/* @__PURE__ */ jsx(Box, {
|
|
1032
|
-
flexGrow: 1,
|
|
1033
|
-
minWidth: 0,
|
|
1034
|
-
children: /* @__PURE__ */ jsx(Text, {
|
|
1035
|
-
color: theme.color.dim,
|
|
1036
|
-
wrap: "truncate",
|
|
1037
|
-
children: presence?.view ? /* @__PURE__ */ jsx(Safe, {
|
|
1038
|
-
module: presenceModule,
|
|
1039
|
-
theme,
|
|
1040
|
-
render: () => presence.view?.({ theme })
|
|
1041
|
-
}) : null
|
|
1042
|
-
})
|
|
1043
|
-
}),
|
|
1044
|
-
/* @__PURE__ */ jsx(Box, {
|
|
1045
|
-
flexShrink: 0,
|
|
1046
|
-
paddingLeft: notice === null ? 0 : 2,
|
|
1047
|
-
children: /* @__PURE__ */ jsx(Text, {
|
|
1048
|
-
color: theme.color.warn,
|
|
1049
|
-
children: notice ?? " "
|
|
1050
|
-
})
|
|
1051
|
-
})
|
|
1052
|
-
]
|
|
1053
|
-
})]
|
|
1054
|
-
}) : /* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsxs(Text, {
|
|
1055
|
-
color: theme.color.accent,
|
|
1056
|
-
children: [theme.glyph.prompt, " "]
|
|
1057
|
-
}), shownDraft.text] }),
|
|
1058
|
-
toast ? /* @__PURE__ */ jsx(Text, {
|
|
1059
|
-
color: theme.color[toast.tone],
|
|
1060
|
-
children: toast.text
|
|
1061
|
-
}) : null,
|
|
1062
|
-
/* @__PURE__ */ jsxs(Box, {
|
|
1063
|
-
...band ? { marginTop: 1 } : {},
|
|
1064
|
-
children: [registry.status.map((s) => /* @__PURE__ */ jsx(Box, {
|
|
1065
|
-
marginRight: 2,
|
|
1066
|
-
children: /* @__PURE__ */ jsx(Safe, {
|
|
1067
|
-
module: s.module,
|
|
1068
|
-
theme,
|
|
1069
|
-
render: () => s.item.view({ theme })
|
|
1070
|
-
})
|
|
1071
|
-
}, `${s.module}:${s.item.id}`)), [...status.entries()].map(([k, v]) => /* @__PURE__ */ jsxs(Text, {
|
|
1072
|
-
color: theme.color[v.tone],
|
|
1073
|
-
children: [v.text, " "]
|
|
1074
|
-
}, k))]
|
|
1075
|
-
})
|
|
1243
|
+
flightRows,
|
|
1244
|
+
overlayRows,
|
|
1245
|
+
pinnedRows
|
|
1076
1246
|
]
|
|
1077
|
-
}),
|
|
1078
|
-
flexDirection: "column",
|
|
1079
|
-
width: 32,
|
|
1080
|
-
marginLeft: 1,
|
|
1081
|
-
children: registry.rail.map((r) => /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Safe, {
|
|
1082
|
-
module: r.module,
|
|
1083
|
-
theme,
|
|
1084
|
-
render: () => r.item.view({ theme })
|
|
1085
|
-
}) }, `${r.module}:${r.item.id}`))
|
|
1086
|
-
}) : null]
|
|
1247
|
+
}), railColumn]
|
|
1087
1248
|
})]
|
|
1088
1249
|
});
|
|
1089
1250
|
}
|
|
1090
1251
|
return {
|
|
1091
1252
|
registry,
|
|
1092
1253
|
App,
|
|
1254
|
+
fullscreen: fs.on,
|
|
1093
1255
|
async run() {
|
|
1094
|
-
const
|
|
1256
|
+
const full = fs.on && process.stdout.isTTY === true;
|
|
1257
|
+
const prepare = runTerminalOptions(opts, full);
|
|
1095
1258
|
const restore = prepare === null ? () => {} : prepareTerminal(process.stdout, prepare);
|
|
1096
|
-
await render(/* @__PURE__ */ jsx(App, {}), {
|
|
1259
|
+
await render(/* @__PURE__ */ jsx(App, {}), {
|
|
1260
|
+
exitOnCtrlC: false,
|
|
1261
|
+
alternateScreen: full
|
|
1262
|
+
}).waitUntilExit();
|
|
1097
1263
|
restore();
|
|
1098
1264
|
}
|
|
1099
1265
|
};
|
|
1100
1266
|
}
|
|
1101
1267
|
|
|
1102
1268
|
//#endregion
|
|
1103
|
-
export { CLEAR_PANE, CTRL_C_WINDOW_MS, CompositionError, DEFAULT_GROUND, EMPTY_DRAFT, EMPTY_HISTORY, HISTORY_MAX, MENU_NAME_WIDTH, RESERVED_GLOBAL_KEYS, RESET_GROUND, addGap, anchorPadding, answerEntry, applyInput, applySuggestion, arriveTurn, assertComposes, atEnd, clampSelection, commandUsage, commitEntry, completeDraft, composeModules, createApp, ctrlC, defaultPanelRows, defineModule, editKey, emptyTranscript, enterRuns, groundSequence, heldAsks, insertChunk, keySpecOf, liveShrink, markedFlights, maskDraft, mayWalk, menuWindow, mergeCompletions, moveSelection, normaliseKeySpec, paletteMatches, paletteQuery, paletteRows, panelOf, parseCommandLine, pasteToLine, prepareSequence, prepareTerminal, reflowSequence, remember, resolveKey, routeInput, sanitise, sendTurn, setPanel, settle, walk, wordLeft, wordRight };
|
|
1269
|
+
export { CLEAR_PANE, CTRL_C_WINDOW_MS, CompositionError, DEFAULT_GROUND, EMPTY_DRAFT, EMPTY_HISTORY, FOLLOWING, HISTORY_MAX, MENU_NAME_WIDTH, RESERVED_GLOBAL_KEYS, RESET_GROUND, WHEEL_ARROWS_OFF, WHEEL_ARROWS_ON, addGap, anchorPadding, answerEntry, applyInput, applySuggestion, arriveTurn, assertComposes, atEnd, clampSelection, commandUsage, commitEntry, completeDraft, composeModules, createApp, ctrlC, defaultPanelRows, defineModule, editKey, emptyTranscript, enterRuns, groundSequence, heldAsks, insertChunk, keySpecOf, linesBelow, liveShrink, markedFlights, maskDraft, mayWalk, menuWindow, mergeCompletions, moveSelection, normaliseKeySpec, pageStep, paletteMatches, paletteQuery, paletteRows, panelOf, parseCommandLine, pasteToLine, prepareSequence, prepareTerminal, reflowSequence, remember, resolveFullscreen, resolveKey, routeInput, sanitise, scrollBy, sendTurn, setPanel, settle, viewTop, walk, wordLeft, wordRight };
|
package/dist/keys.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export interface KeyState {
|
|
|
10
10
|
readonly draftEmpty: boolean;
|
|
11
11
|
/** The focused panel's armed confirm key, set only while the draft is exactly it. */
|
|
12
12
|
readonly armed?: string | null;
|
|
13
|
+
/** Full-screen's transcript viewport: following the bottom, or held. Absent inline. */
|
|
14
|
+
readonly viewport?: 'following' | 'held';
|
|
13
15
|
}
|
|
14
16
|
export type Route = {
|
|
15
17
|
readonly kind: 'exit-chord';
|
|
@@ -40,6 +42,11 @@ export type Route = {
|
|
|
40
42
|
readonly key: KeySpec;
|
|
41
43
|
} | {
|
|
42
44
|
readonly kind: 'cancel-turn';
|
|
45
|
+
}
|
|
46
|
+
/** Full-screen: move the transcript viewport. */
|
|
47
|
+
| {
|
|
48
|
+
readonly kind: 'scroll';
|
|
49
|
+
readonly act: 'page-up' | 'page-down' | 'bottom';
|
|
43
50
|
} | {
|
|
44
51
|
readonly kind: 'history';
|
|
45
52
|
readonly dir: 'up' | 'down';
|
package/dist/keys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,IAAI,CAiBhD;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;Q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8FAA8F;AAC9F,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,CAsE/E"}
|
package/dist/module.d.ts
CHANGED
|
@@ -77,6 +77,9 @@ export interface SubmitOptions {
|
|
|
77
77
|
readonly emphasis?: string;
|
|
78
78
|
/** Whatever the app's turn handler needs; the core never reads it. */
|
|
79
79
|
readonly context?: unknown;
|
|
80
|
+
/** Put the line in the input history, as if typed: for a line the operator typed into a panel
|
|
81
|
+
* that the module forwards. */
|
|
82
|
+
readonly remember?: boolean;
|
|
80
83
|
}
|
|
81
84
|
/** A turn as its handler receives it. */
|
|
82
85
|
export interface TurnContext {
|
|
@@ -114,8 +117,8 @@ export interface ModuleCtx<P> {
|
|
|
114
117
|
transcript(): Transcript<Reply>;
|
|
115
118
|
/**
|
|
116
119
|
* A line sent as if typed, and routed as one: a /command runs, anything else is a turn. It stays
|
|
117
|
-
* out of the history, which holds only what the operator typed
|
|
118
|
-
* `TurnContext`.
|
|
120
|
+
* out of the history, which holds only what the operator typed, unless `opts.remember` says it
|
|
121
|
+
* was. `opts` reach the turn as its `TurnContext`.
|
|
119
122
|
*/
|
|
120
123
|
submit(text: string, opts?: SubmitOptions): void;
|
|
121
124
|
/** The panel budget now, as a panel's view is given it: for acts that page, and for commands
|
package/dist/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,mEAAmE;AACnE,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ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AAW,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;IACzE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAID,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACpF,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAClB,SAAS,CAAC,CAAC,CAAC,CAKd"}
|
|
@@ -448,6 +448,47 @@ function ctrlC(armedAt, now, windowMs = CTRL_C_WINDOW_MS) {
|
|
|
448
448
|
return armedAt !== null && now - armedAt <= windowMs ? "exit" : "arm";
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region src/fullscreen.ts
|
|
453
|
+
/** Whether full-screen is on: `SURFACE_FULLSCREEN` (`on` / `off`) over the app's option over on. */
|
|
454
|
+
function resolveFullscreen(option, env) {
|
|
455
|
+
const fallback = option ?? true;
|
|
456
|
+
const v = env?.trim().toLowerCase() ?? "";
|
|
457
|
+
if (v === "on") return {
|
|
458
|
+
on: true,
|
|
459
|
+
invalid: null
|
|
460
|
+
};
|
|
461
|
+
if (v === "off") return {
|
|
462
|
+
on: false,
|
|
463
|
+
invalid: null
|
|
464
|
+
};
|
|
465
|
+
return {
|
|
466
|
+
on: fallback,
|
|
467
|
+
invalid: v === "" ? null : env ?? null
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
const FOLLOWING = { held: null };
|
|
471
|
+
const bottomTop = (content, viewport) => Math.max(0, content - viewport);
|
|
472
|
+
/** The first content row shown. A held top past the end (the terminal grew) is clamped. */
|
|
473
|
+
function viewTop(s, content, viewport) {
|
|
474
|
+
const bottom = bottomTop(content, viewport);
|
|
475
|
+
return s.held === null ? bottom : Math.min(Math.max(0, s.held), bottom);
|
|
476
|
+
}
|
|
477
|
+
/** Content rows below the viewport. */
|
|
478
|
+
function linesBelow(s, content, viewport) {
|
|
479
|
+
return bottomTop(content, viewport) - viewTop(s, content, viewport);
|
|
480
|
+
}
|
|
481
|
+
/** Scrolls by `delta` rows (negative is up). Reaching the bottom follows again. */
|
|
482
|
+
function scrollBy(s, delta, content, viewport) {
|
|
483
|
+
const bottom = bottomTop(content, viewport);
|
|
484
|
+
const top = Math.min(Math.max(0, viewTop(s, content, viewport) + delta), bottom);
|
|
485
|
+
return top >= bottom ? FOLLOWING : { held: top };
|
|
486
|
+
}
|
|
487
|
+
/** A PgUp/PgDn step: a viewport less one row of overlap, never under one. */
|
|
488
|
+
function pageStep(viewport) {
|
|
489
|
+
return Math.max(1, viewport - 1);
|
|
490
|
+
}
|
|
491
|
+
|
|
451
492
|
//#endregion
|
|
452
493
|
//#region src/history.ts
|
|
453
494
|
/**
|
|
@@ -623,6 +664,20 @@ function resolveKey(state, key, registry) {
|
|
|
623
664
|
module: global.module,
|
|
624
665
|
key: spec
|
|
625
666
|
};
|
|
667
|
+
if (state.viewport !== void 0 && state.overlay === null) {
|
|
668
|
+
if (spec === "pageup") return {
|
|
669
|
+
kind: "scroll",
|
|
670
|
+
act: "page-up"
|
|
671
|
+
};
|
|
672
|
+
if (spec === "pagedown") return {
|
|
673
|
+
kind: "scroll",
|
|
674
|
+
act: "page-down"
|
|
675
|
+
};
|
|
676
|
+
if (spec === "end" && state.viewport === "held") return {
|
|
677
|
+
kind: "scroll",
|
|
678
|
+
act: "bottom"
|
|
679
|
+
};
|
|
680
|
+
}
|
|
626
681
|
if (spec === "escape") return state.draftEmpty ? { kind: "cancel-turn" } : { kind: "ignore" };
|
|
627
682
|
if (spec === "up") return {
|
|
628
683
|
kind: "history",
|
|
@@ -845,13 +900,40 @@ function liveShrink(prev, now) {
|
|
|
845
900
|
if (prev === null || now.committed !== prev.committed || now.epoch !== prev.epoch) return 0;
|
|
846
901
|
return Math.max(0, prev.height - now.height);
|
|
847
902
|
}
|
|
903
|
+
/**
|
|
904
|
+
* The most lines a re-lay reprints. Printing blocks input for every line (about 0.17 ms each in
|
|
905
|
+
* Ink's output step), so a re-lay of a long transcript keeps only its newest entries.
|
|
906
|
+
*/
|
|
907
|
+
const REPRINT_LINES = 1e3;
|
|
908
|
+
/**
|
|
909
|
+
* Where a re-lay starts reprinting, given each committed entry's height: the newest entries that
|
|
910
|
+
* fit `budget` lines, and always the newest one, however tall.
|
|
911
|
+
*/
|
|
912
|
+
function reprintStart(heights, budget) {
|
|
913
|
+
let lines = 0;
|
|
914
|
+
for (let i = heights.length - 1; i >= 0; i--) {
|
|
915
|
+
lines += heights[i] ?? 1;
|
|
916
|
+
if (lines > budget) return Math.min(i + 1, heights.length - 1);
|
|
917
|
+
}
|
|
918
|
+
return 0;
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* DEC private mode 1007 ("alternate scroll"): off, a terminal stops turning the mouse wheel into
|
|
922
|
+
* Up/Down in the alternate screen, which would walk input history. No mouse reporting is enabled,
|
|
923
|
+
* so drag-select stays the terminal's.
|
|
924
|
+
*/
|
|
925
|
+
const WHEEL_ARROWS_OFF = "\x1B[?1007l";
|
|
926
|
+
/** Restores 1007. shortcut: assumes it was on (most terminals' default; xterm's is off); query it with DECRQM if that bites. */
|
|
927
|
+
const WHEEL_ARROWS_ON = "\x1B[?1007h";
|
|
848
928
|
/** The bytes {@link prepareTerminal} writes, in order. */
|
|
849
929
|
function prepareSequence(rows, opts = {}) {
|
|
850
|
-
|
|
930
|
+
const ground = groundSequence(opts.ground) ?? "";
|
|
931
|
+
if (opts.fullscreen === true) return ground + WHEEL_ARROWS_OFF;
|
|
932
|
+
return ground + (opts.clear === false ? "" : CLEAR_PANE) + (opts.anchor === false ? "" : anchorPadding(rows));
|
|
851
933
|
}
|
|
852
934
|
/**
|
|
853
|
-
* Ground, clear and anchor the terminal before `render
|
|
854
|
-
* terminal's background back. It is also registered on `exit`, and SIGHUP / SIGTERM / SIGINT exit
|
|
935
|
+
* Ground, clear and anchor the terminal before `render` (in full-screen: ground and the wheel).
|
|
936
|
+
* Returns a restore function that puts the terminal's background and wheel back. It is also registered on `exit`, and SIGHUP / SIGTERM / SIGINT exit
|
|
855
937
|
* through it, since their default action kills the process with no `exit` event (under Ink's raw
|
|
856
938
|
* mode ctrl+c is input, so SIGINT only arrives from outside: `kill -INT`, a supervisor, tmux).
|
|
857
939
|
* A terminal left black is worse than any rendering bug. A no-op off a TTY.
|
|
@@ -859,12 +941,13 @@ function prepareSequence(rows, opts = {}) {
|
|
|
859
941
|
function prepareTerminal(out, opts = {}, proc = process) {
|
|
860
942
|
if (out.isTTY !== true) return () => {};
|
|
861
943
|
out.write(prepareSequence(out.rows, opts));
|
|
862
|
-
|
|
944
|
+
const back = (groundSequence(opts.ground) === null ? "" : RESET_GROUND) + (opts.fullscreen === true ? WHEEL_ARROWS_ON : "");
|
|
945
|
+
if (back === "") return () => {};
|
|
863
946
|
let restored = false;
|
|
864
947
|
const restore = () => {
|
|
865
948
|
if (restored) return;
|
|
866
949
|
restored = true;
|
|
867
|
-
out.write(
|
|
950
|
+
out.write(back);
|
|
868
951
|
};
|
|
869
952
|
proc.once("exit", restore);
|
|
870
953
|
proc.once("SIGHUP", () => proc.exit(129));
|
|
@@ -968,6 +1051,14 @@ function addGap(t, lines, epoch) {
|
|
|
968
1051
|
epoch
|
|
969
1052
|
});
|
|
970
1053
|
}
|
|
1054
|
+
/** The transcript without its gaps: for a re-lay, which prints everything again from scratch. */
|
|
1055
|
+
function dropGaps(t) {
|
|
1056
|
+
if (!t.committed.some((e) => e.kind === "gap")) return t;
|
|
1057
|
+
return {
|
|
1058
|
+
...t,
|
|
1059
|
+
committed: t.committed.filter((e) => e.kind !== "gap")
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
971
1062
|
|
|
972
1063
|
//#endregion
|
|
973
1064
|
//#region src/module.ts
|
|
@@ -1008,4 +1099,4 @@ function setPanel(o, kind, next) {
|
|
|
1008
1099
|
}
|
|
1009
1100
|
|
|
1010
1101
|
//#endregion
|
|
1011
|
-
export {
|
|
1102
|
+
export { viewTop as $, clampSelection as A, keySpecOf as B, prepareTerminal as C, routeInput as D, sanitise as E, moveSelection as F, remember as G, EMPTY_HISTORY as H, paletteMatches as I, FOLLOWING as J, settle as K, paletteQuery as L, completeDraft as M, enterRuns as N, unavailableReason as O, menuWindow as P, scrollBy as Q, paletteRows as R, prepareSequence as S, reprintStart as T, HISTORY_MAX as U, resolveKey as V, mayWalk as W, pageStep as X, linesBelow as Y, resolveFullscreen as Z, WHEEL_ARROWS_OFF as _, applySuggestion as _t, answerEntry as a, graphemeAt as at, groundSequence as b, dropGaps as c, pasteToLine as ct, markedFlights as d, applyInput as dt, CTRL_C_WINDOW_MS as et, sendTurn as f, CompositionError as ft, RESET_GROUND as g, normaliseKeySpec as gt, REPRINT_LINES as h, composeModules as ht, addGap as i, editKey as it, commandUsage as j, MENU_NAME_WIDTH as k, emptyTranscript as l, wordLeft as lt, DEFAULT_GROUND as m, assertComposes as mt, setPanel as n, EMPTY_DRAFT as nt, arriveTurn as o, insertChunk as ot, CLEAR_PANE as p, RESERVED_GLOBAL_KEYS as pt, walk as q, defineModule as r, atEnd as rt, commitEntry as s, maskDraft as st, panelOf as t, ctrlC as tt, heldAsks as u, wordRight as ut, WHEEL_ARROWS_ON as v, mergeCompletions as vt, reflowSequence as w, liveShrink as x, anchorPadding as y, parseCommandLine as z };
|
package/dist/pure.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { applySuggestion, mergeCompletions } from './complete.js';
|
|
|
3
3
|
export { assertComposes, CompositionError, composeModules, RESERVED_GLOBAL_KEYS, type Registry } from './compose.js';
|
|
4
4
|
export { atEnd, type Draft, type EditKeys, EMPTY_DRAFT, editKey, insertChunk, maskDraft, pasteToLine, wordLeft, wordRight } from './editor.js';
|
|
5
5
|
export { CTRL_C_WINDOW_MS, ctrlC } from './exit-chord.js';
|
|
6
|
+
export { FOLLOWING, linesBelow, pageStep, resolveFullscreen, type Scroll, scrollBy, viewTop } from './fullscreen.js';
|
|
6
7
|
export { EMPTY_HISTORY, HISTORY_MAX, type HistoryState, mayWalk, remember, settle, walk } from './history.js';
|
|
7
8
|
export { normaliseKeySpec } from './key-spec.js';
|
|
8
9
|
export { type KeyState, keySpecOf, type Route, resolveKey } from './keys.js';
|
|
@@ -11,6 +12,6 @@ export { type Overlay, panelOf, setPanel } from './overlay.js';
|
|
|
11
12
|
export { clampSelection, commandUsage, completeDraft, enterRuns, MENU_NAME_WIDTH, menuWindow, moveSelection, type PaletteRow, paletteMatches, paletteQuery, paletteRows, parseCommandLine } from './palette.js';
|
|
12
13
|
export { type InputRoute, routeInput } from './route-input.js';
|
|
13
14
|
export { sanitise } from './sanitise.js';
|
|
14
|
-
export { anchorPadding, CLEAR_PANE, DEFAULT_GROUND, groundSequence, type LiveMeasure, liveShrink, type PrepareTerminalOptions, prepareSequence, prepareTerminal, RESET_GROUND, reflowSequence, type TerminalOut, type TerminalProcess } from './terminal.js';
|
|
15
|
+
export { anchorPadding, CLEAR_PANE, DEFAULT_GROUND, groundSequence, type LiveMeasure, liveShrink, type PrepareTerminalOptions, prepareSequence, prepareTerminal, RESET_GROUND, reflowSequence, type TerminalOut, type TerminalProcess, WHEEL_ARROWS_OFF, WHEEL_ARROWS_ON } from './terminal.js';
|
|
15
16
|
export { type AnswerEntry, type AppEntry, type AskEntry, addGap, answerEntry, arriveTurn, commitEntry, type Entry, emptyTranscript, type Flight, type GapEntry, heldAsks, markedFlights, type NoteEntry, sendTurn, type Transcript } from './transcript.js';
|
|
16
17
|
//# sourceMappingURL=pure.d.ts.map
|
package/dist/pure.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pure.d.ts","sourceRoot":"","sources":["../src/pure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE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AChB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,MAAM,EACN,WAAW,EACX,UAAU,EACV,WAAW,EACX,KAAK,KAAK,EACV,eAAe,EACf,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,QAAQ,EACR,aAAa,EACb,KAAK,SAAS,EACd,QAAQ,EACR,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC"}
|
package/dist/pure.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as viewTop, A as clampSelection, B as keySpecOf, C as prepareTerminal, D as routeInput, E as sanitise, F as moveSelection, G as remember, H as EMPTY_HISTORY, I as paletteMatches, J as FOLLOWING, K as settle, L as paletteQuery, M as completeDraft, N as enterRuns, P as menuWindow, Q as scrollBy, R as paletteRows, S as prepareSequence, U as HISTORY_MAX, V as resolveKey, W as mayWalk, X as pageStep, Y as linesBelow, Z as resolveFullscreen, _ as WHEEL_ARROWS_OFF, _t as applySuggestion, a as answerEntry, b as groundSequence, ct as pasteToLine, d as markedFlights, dt as applyInput, et as CTRL_C_WINDOW_MS, f as sendTurn, ft as CompositionError, g as RESET_GROUND, gt as normaliseKeySpec, ht as composeModules, i as addGap, it as editKey, j as commandUsage, k as MENU_NAME_WIDTH, l as emptyTranscript, lt as wordLeft, m as DEFAULT_GROUND, mt as assertComposes, n as setPanel, nt as EMPTY_DRAFT, o as arriveTurn, ot as insertChunk, p as CLEAR_PANE, pt as RESERVED_GLOBAL_KEYS, q as walk, r as defineModule, rt as atEnd, s as commitEntry, st as maskDraft, t as panelOf, tt as ctrlC, u as heldAsks, ut as wordRight, v as WHEEL_ARROWS_ON, vt as mergeCompletions, w as reflowSequence, x as liveShrink, y as anchorPadding, z as parseCommandLine } from "./overlay-By-Ewn3S.js";
|
|
2
2
|
|
|
3
|
-
export { CLEAR_PANE, CTRL_C_WINDOW_MS, CompositionError, DEFAULT_GROUND, EMPTY_DRAFT, EMPTY_HISTORY, HISTORY_MAX, MENU_NAME_WIDTH, RESERVED_GLOBAL_KEYS, RESET_GROUND, addGap, anchorPadding, answerEntry, applyInput, applySuggestion, arriveTurn, assertComposes, atEnd, clampSelection, commandUsage, commitEntry, completeDraft, composeModules, ctrlC, defineModule, editKey, emptyTranscript, enterRuns, groundSequence, heldAsks, insertChunk, keySpecOf, liveShrink, markedFlights, maskDraft, mayWalk, menuWindow, mergeCompletions, moveSelection, normaliseKeySpec, paletteMatches, paletteQuery, paletteRows, panelOf, parseCommandLine, pasteToLine, prepareSequence, prepareTerminal, reflowSequence, remember, resolveKey, routeInput, sanitise, sendTurn, setPanel, settle, walk, wordLeft, wordRight };
|
|
3
|
+
export { CLEAR_PANE, CTRL_C_WINDOW_MS, CompositionError, DEFAULT_GROUND, EMPTY_DRAFT, EMPTY_HISTORY, FOLLOWING, HISTORY_MAX, MENU_NAME_WIDTH, RESERVED_GLOBAL_KEYS, RESET_GROUND, WHEEL_ARROWS_OFF, WHEEL_ARROWS_ON, addGap, anchorPadding, answerEntry, applyInput, applySuggestion, arriveTurn, assertComposes, atEnd, clampSelection, commandUsage, commitEntry, completeDraft, composeModules, ctrlC, defineModule, editKey, emptyTranscript, enterRuns, groundSequence, heldAsks, insertChunk, keySpecOf, linesBelow, liveShrink, markedFlights, maskDraft, mayWalk, menuWindow, mergeCompletions, moveSelection, normaliseKeySpec, pageStep, paletteMatches, paletteQuery, paletteRows, panelOf, parseCommandLine, pasteToLine, prepareSequence, prepareTerminal, reflowSequence, remember, resolveFullscreen, resolveKey, routeInput, sanitise, scrollBy, sendTurn, setPanel, settle, viewTop, walk, wordLeft, wordRight };
|
package/dist/terminal.d.ts
CHANGED
|
@@ -38,6 +38,24 @@ export interface LiveMeasure {
|
|
|
38
38
|
* on its own).
|
|
39
39
|
*/
|
|
40
40
|
export declare function liveShrink(prev: LiveMeasure | null, now: LiveMeasure): number;
|
|
41
|
+
/**
|
|
42
|
+
* The most lines a re-lay reprints. Printing blocks input for every line (about 0.17 ms each in
|
|
43
|
+
* Ink's output step), so a re-lay of a long transcript keeps only its newest entries.
|
|
44
|
+
*/
|
|
45
|
+
export declare const REPRINT_LINES = 1000;
|
|
46
|
+
/**
|
|
47
|
+
* Where a re-lay starts reprinting, given each committed entry's height: the newest entries that
|
|
48
|
+
* fit `budget` lines, and always the newest one, however tall.
|
|
49
|
+
*/
|
|
50
|
+
export declare function reprintStart(heights: readonly number[], budget: number): number;
|
|
51
|
+
/**
|
|
52
|
+
* DEC private mode 1007 ("alternate scroll"): off, a terminal stops turning the mouse wheel into
|
|
53
|
+
* Up/Down in the alternate screen, which would walk input history. No mouse reporting is enabled,
|
|
54
|
+
* so drag-select stays the terminal's.
|
|
55
|
+
*/
|
|
56
|
+
export declare const WHEEL_ARROWS_OFF = "\u001B[?1007l";
|
|
57
|
+
/** Restores 1007. shortcut: assumes it was on (most terminals' default; xterm's is off); query it with DECRQM if that bites. */
|
|
58
|
+
export declare const WHEEL_ARROWS_ON = "\u001B[?1007h";
|
|
41
59
|
export interface PrepareTerminalOptions {
|
|
42
60
|
/** `#rrggbb`, or `none` to leave the background alone. Default {@link DEFAULT_GROUND}. */
|
|
43
61
|
readonly ground?: string | undefined;
|
|
@@ -45,6 +63,8 @@ export interface PrepareTerminalOptions {
|
|
|
45
63
|
readonly clear?: boolean;
|
|
46
64
|
/** Bottom-anchor the input. Default true. */
|
|
47
65
|
readonly anchor?: boolean;
|
|
66
|
+
/** Full-screen: turn the wheel's arrow keys off (restored on exit), and never clear or anchor. */
|
|
67
|
+
readonly fullscreen?: boolean;
|
|
48
68
|
}
|
|
49
69
|
export interface TerminalOut {
|
|
50
70
|
readonly isTTY?: boolean;
|
|
@@ -60,8 +80,8 @@ export interface TerminalProcess {
|
|
|
60
80
|
exit(code: number): never;
|
|
61
81
|
}
|
|
62
82
|
/**
|
|
63
|
-
* Ground, clear and anchor the terminal before `render
|
|
64
|
-
* terminal's background back. It is also registered on `exit`, and SIGHUP / SIGTERM / SIGINT exit
|
|
83
|
+
* Ground, clear and anchor the terminal before `render` (in full-screen: ground and the wheel).
|
|
84
|
+
* Returns a restore function that puts the terminal's background and wheel back. It is also registered on `exit`, and SIGHUP / SIGTERM / SIGINT exit
|
|
65
85
|
* through it, since their default action kills the process with no `exit` event (under Ink's raw
|
|
66
86
|
* mode ctrl+c is input, so SIGINT only arrives from outside: `kill -INT`, a supervisor, tmux).
|
|
67
87
|
* A terminal left black is worse than any rendering bug. A no-op off a TTY.
|
package/dist/terminal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../src/terminal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../src/terminal.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAKxE;AAED,6DAA6D;AAC7D,eAAO,MAAM,YAAY,qBAAiB,CAAC;AAE3C,wEAAwE;AACxE,eAAO,MAAM,UAAU,+BAAyB,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAG9D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAE/D;AAED,oGAAoG;AACpG,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,EAAE,GAAG,EAAE,WAAW,GAAG,M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GAAG,EAAE,WAAW,EAChB,IAAI,GAAE,sBAA2B,EACjC,IAAI,GAAE,eAAyB,GAC9B,MAAM,IAAI,CAkBZ"}
|
package/dist/transcript.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export interface Flight {
|
|
|
44
44
|
readonly emphasis?: string;
|
|
45
45
|
}
|
|
46
46
|
export interface Transcript<R, X extends AppEntry = never> {
|
|
47
|
-
/** Append-only: exactly what Static requires. */
|
|
47
|
+
/** Append-only between re-lays: exactly what Static requires. A re-lay drops the gaps. */
|
|
48
48
|
readonly committed: readonly Entry<R, X>[];
|
|
49
49
|
/** Unanswered turns, in send order. */
|
|
50
50
|
readonly flights: readonly Flight[];
|
|
@@ -60,4 +60,6 @@ export declare function commitEntry<R, X extends AppEntry>(t: Transcript<R, X>,
|
|
|
60
60
|
/** The last answer printed, or the one carrying mark `n`. */
|
|
61
61
|
export declare function answerEntry<R, X extends AppEntry>(t: Transcript<R, X>, mark: number | null): AnswerEntry<R> | null;
|
|
62
62
|
export declare function addGap<R, X extends AppEntry>(t: Transcript<R, X>, lines: number, epoch: number): Transcript<R, X>;
|
|
63
|
+
/** The transcript without its gaps: for a re-lay, which prints everything again from scratch. */
|
|
64
|
+
export declare function dropGaps<R, X extends AppEntry>(t: Transcript<R, X>): Transcript<R, X>;
|
|
63
65
|
//# sourceMappingURL=transcript.d.ts.map
|
package/dist/transcript.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../src/transcript.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI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AAM,CAAC,CAAC,EAAE,CAAC,SAAS,QAAQ,EAC1C,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,EACnB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAGlB;AAED,iGAAiG;AACjG,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,QAAQ,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAGrF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mnmal-ai/surface-core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Pluggable terminal UI base on Ink
|
|
3
|
+
"version": "0.16.0",
|
|
4
|
+
"description": "Pluggable terminal UI base on Ink 8 + React 19: module registry, createApp, the turn engine and the shell.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@mnmal-ai/surface-kit": "0.
|
|
27
|
-
"@mnmal-ai/surface-theme": "0.
|
|
26
|
+
"@mnmal-ai/surface-kit": "0.16.0",
|
|
27
|
+
"@mnmal-ai/surface-theme": "0.16.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"ink": "^
|
|
30
|
+
"ink": "^8.0.0",
|
|
31
31
|
"react": "^19.3.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@mnmal-ai/substrate-config": "1.0.0-alpha.0",
|
|
35
35
|
"@types/node": "^26.6.4",
|
|
36
36
|
"@types/react": "^19.2.0",
|
|
37
|
-
"ink": "^
|
|
37
|
+
"ink": "^8.0.0",
|
|
38
38
|
"ink-testing-library": "^4.0.0",
|
|
39
39
|
"react": "^19.3.0",
|
|
40
40
|
"tsdown": "^0.23.0",
|