ispbills-icli 8.6.9 → 8.6.10
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/package.json +1 -1
- package/src/tui/app.js +8 -9
- package/src/tui/components.js +0 -6
- package/src/tui/composer.js +0 -2
package/package.json
CHANGED
package/src/tui/app.js
CHANGED
|
@@ -243,15 +243,15 @@ function itemHeight(it, cols = 80) {
|
|
|
243
243
|
const w = Math.max(1, cols - 4); // paddingX + body inset
|
|
244
244
|
switch (it.type) {
|
|
245
245
|
case 'user':
|
|
246
|
-
return
|
|
246
|
+
return 2 + wrappedLines(it.text, w); // marginTop + speaker + body
|
|
247
247
|
case 'assistant':
|
|
248
|
-
return
|
|
248
|
+
return 2 + wrappedLines(it.text, Math.min(w, 96));
|
|
249
249
|
case 'shell':
|
|
250
|
-
return
|
|
250
|
+
return 3 + wrappedLines(it.output || '(no output)', w) + 1;
|
|
251
251
|
case 'plan':
|
|
252
|
-
return
|
|
252
|
+
return 3 + (it.reply?.steps?.length || 0);
|
|
253
253
|
case 'connect':
|
|
254
|
-
return
|
|
254
|
+
return 4;
|
|
255
255
|
case 'activity':
|
|
256
256
|
return 1 + (it.status?.length || 0);
|
|
257
257
|
case 'notice':
|
|
@@ -295,7 +295,7 @@ function liveAreaHeight(live, cols = 80, showReasoning = false) {
|
|
|
295
295
|
if (!live) return 0;
|
|
296
296
|
const w = Math.max(1, cols - 4);
|
|
297
297
|
let h = 2; // thinking line + margin
|
|
298
|
-
if (live.text) h +=
|
|
298
|
+
if (live.text) h += 2 + wrappedLines(live.text, Math.min(w, 96));
|
|
299
299
|
if (live.reasoning) h += showReasoning ? 2 + wrappedLines(live.reasoning, w) : 1;
|
|
300
300
|
if (live.reply?.steps) h += 3 + live.reply.steps.length;
|
|
301
301
|
if (live.status?.length) h += 1 + live.status.length;
|
|
@@ -377,9 +377,8 @@ export function App({ cfg, display = {}, onExternal, onExit, initialQuestion, sh
|
|
|
377
377
|
const { cols, rows } = useTerminalSize();
|
|
378
378
|
const colsRef = useRef(cols);
|
|
379
379
|
useEffect(() => { colsRef.current = cols; }, [cols]);
|
|
380
|
-
// Fixed-height viewport: total rows minus chrome (tabbar
|
|
381
|
-
|
|
382
|
-
const viewportRows = Math.max(3, rows - 6);
|
|
380
|
+
// Fixed-height viewport: total rows minus chrome (tabbar=1, composer=2, footer=1, buffer=3).
|
|
381
|
+
const viewportRows = Math.max(3, rows - 7);
|
|
383
382
|
const scrollPage = Math.max(4, viewportRows - 2);
|
|
384
383
|
|
|
385
384
|
const [items, setItems] = useState(() => renderConversationItems(initialMessages, cols));
|
package/src/tui/components.js
CHANGED
|
@@ -247,7 +247,6 @@ function Sep({ cols = 80 }) {
|
|
|
247
247
|
export function UserMessage({ text, cols = 80, ts }) {
|
|
248
248
|
return html`
|
|
249
249
|
<${Box} flexDirection="column" marginTop=${1}>
|
|
250
|
-
<${Sep} cols=${cols} />
|
|
251
250
|
<${SpeakerLine} label="You" color=${C.brand} cols=${cols} ts=${ts} />
|
|
252
251
|
<${Box} paddingX=${1}>
|
|
253
252
|
<${Text}>${withMentions(text)}<//>
|
|
@@ -283,7 +282,6 @@ export function AssistantMessage({ text, cols = 80, ts, label = `${glyphs.ring}
|
|
|
283
282
|
const bodyWidth = Math.min(cols, 100);
|
|
284
283
|
return html`
|
|
285
284
|
<${Box} flexDirection="column" marginTop=${1}>
|
|
286
|
-
<${Sep} cols=${cols} />
|
|
287
285
|
<${SpeakerLine} label=${label} color="white" glyphColor=${C.accent} cols=${cols} />
|
|
288
286
|
<${Box} paddingX=${1} flexDirection="column" width=${bodyWidth}>
|
|
289
287
|
${streaming ? html`<${StreamingText} text=${text} />` : html`<${Markdown} content=${text} />`}
|
|
@@ -294,7 +292,6 @@ export function AssistantMessage({ text, cols = 80, ts, label = `${glyphs.ring}
|
|
|
294
292
|
export function ShellOutput({ command, output, cols = 80, ts, code = 0 }) {
|
|
295
293
|
return html`
|
|
296
294
|
<${Box} flexDirection="column" marginTop=${1}>
|
|
297
|
-
<${Sep} cols=${cols} />
|
|
298
295
|
<${SpeakerLine}
|
|
299
296
|
label="⌘ Shell"
|
|
300
297
|
color=${code === 0 ? C.warning : C.error}
|
|
@@ -429,7 +426,6 @@ export function Notice({ text, color = C.gray }) {
|
|
|
429
426
|
export function LabeledNotice({ label, text, color = C.gray, cols = 80, ts, bodyColor = C.white }) {
|
|
430
427
|
return html`
|
|
431
428
|
<${Box} flexDirection="column" marginTop=${1}>
|
|
432
|
-
<${Sep} cols=${cols} />
|
|
433
429
|
<${SpeakerLine} label=${label} color=${color} cols=${cols} ts=${ts} />
|
|
434
430
|
<${Box} paddingX=${1}>
|
|
435
431
|
<${Text} color=${bodyColor}>${text}<//>
|
|
@@ -543,11 +539,9 @@ export function Choice({ title, note, options = [], sel = 0, allowText = false,
|
|
|
543
539
|
if (isToolApproval) {
|
|
544
540
|
return html`
|
|
545
541
|
<${Box} flexDirection="column" marginTop=${1}>
|
|
546
|
-
<${Sep} cols=${cols} />
|
|
547
542
|
<${Box} paddingX=${2} marginTop=${1}>
|
|
548
543
|
<${Text} color=${C.accent} bold>⚙ Tool request<//>
|
|
549
544
|
<//>
|
|
550
|
-
<${Sep} cols=${cols} />
|
|
551
545
|
${note ? html`<${Box} paddingX=${2} marginTop=${1}><${Text} color=${C.muted}>${note}<//><//>` : null}
|
|
552
546
|
<${Box} flexDirection="column" marginTop=${1} paddingX=${2}>
|
|
553
547
|
${options.map((o, i) => {
|