ispbills-icli 8.6.3 → 8.6.4
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/commands.js +1 -0
- package/src/tui/app.js +2 -2
- package/src/tui/components.js +3 -3
- package/src/tui/composer.js +6 -2
package/package.json
CHANGED
package/src/commands.js
CHANGED
|
@@ -129,6 +129,7 @@ export const SLASH_COMMANDS = [
|
|
|
129
129
|
{ cmd: '/logout', hint: '', desc: 'Log out and clear credentials', group: 'Help', local: true },
|
|
130
130
|
{ cmd: '/help', hint: '', desc: 'Show help', group: 'Help', local: true },
|
|
131
131
|
{ cmd: '/exit', hint: '', desc: 'Exit iCli', group: 'Help', local: true },
|
|
132
|
+
{ cmd: '/quit', hint: '', desc: 'Alias for /exit', group: 'Help', local: true },
|
|
132
133
|
];
|
|
133
134
|
|
|
134
135
|
export function slashCompleter(line) {
|
package/src/tui/app.js
CHANGED
|
@@ -761,7 +761,7 @@ export function App({ cfg, display = {}, onExternal, onExit, initialQuestion, sh
|
|
|
761
761
|
if (q.startsWith('!')) { runShellCommand(q.slice(1)); return; }
|
|
762
762
|
if (q === '?') { push({ type: 'help', text: 'help' }); return; }
|
|
763
763
|
|
|
764
|
-
if (q === '/exit' || q === 'exit' || q === 'quit') { doExit(); return; }
|
|
764
|
+
if (q === '/exit' || q === '/quit' || q === 'exit' || q === 'quit') { doExit(); return; }
|
|
765
765
|
if (q === '/clear') { clearAll(); return; }
|
|
766
766
|
if (q === '/new') {
|
|
767
767
|
sessionIdRef.current = Date.now().toString(36);
|
|
@@ -1892,7 +1892,7 @@ export function App({ cfg, display = {}, onExternal, onExit, initialQuestion, sh
|
|
|
1892
1892
|
|
|
1893
1893
|
<${Box} flexDirection="column">
|
|
1894
1894
|
${choice
|
|
1895
|
-
? html`<${Choice} ...${choice} />`
|
|
1895
|
+
? html`<${Choice} ...${choice} cols=${cols} />`
|
|
1896
1896
|
: sessionPicker
|
|
1897
1897
|
? html`<${SessionPicker} sessions=${sessionPicker.sessions} sel=${sessionPicker.sel} sort=${sessionPicker.sort} cols=${cols} />`
|
|
1898
1898
|
: html`<${Composer}
|
package/src/tui/components.js
CHANGED
|
@@ -529,16 +529,16 @@ export function Thinking({ label = 'Working', startedAt }) {
|
|
|
529
529
|
<//>`;
|
|
530
530
|
}
|
|
531
531
|
|
|
532
|
-
export function Choice({ title, note, options = [], sel = 0, allowText = false, text = '', focusText = false, isToolApproval = false }) {
|
|
532
|
+
export function Choice({ title, note, options = [], sel = 0, allowText = false, text = '', focusText = false, isToolApproval = false, cols = 80 }) {
|
|
533
533
|
// §13: tool approval uses exact spec format with Sep-style header
|
|
534
534
|
if (isToolApproval) {
|
|
535
535
|
return html`
|
|
536
536
|
<${Box} flexDirection="column" marginTop=${1}>
|
|
537
|
-
<${Sep} cols=${
|
|
537
|
+
<${Sep} cols=${cols} />
|
|
538
538
|
<${Box} paddingX=${2} marginTop=${1}>
|
|
539
539
|
<${Text} color=${C.accent} bold>⚙ Tool request<//>
|
|
540
540
|
<//>
|
|
541
|
-
<${Sep} cols=${
|
|
541
|
+
<${Sep} cols=${cols} />
|
|
542
542
|
${note ? html`<${Box} paddingX=${2} marginTop=${1}><${Text} color=${C.muted}>${note}<//><//>` : null}
|
|
543
543
|
<${Box} flexDirection="column" marginTop=${1} paddingX=${2}>
|
|
544
544
|
${options.map((o, i) => {
|
package/src/tui/composer.js
CHANGED
|
@@ -357,7 +357,11 @@ export function Composer({
|
|
|
357
357
|
return;
|
|
358
358
|
}
|
|
359
359
|
if (key.ctrl && input === 's') { submit(value, { preserve: true }); return; }
|
|
360
|
-
if (key.ctrl && input === 'f') {
|
|
360
|
+
if (key.ctrl && input === 'f') {
|
|
361
|
+
// §18: Ctrl+F = cursor forward one char when input non-empty; §17: open search when empty
|
|
362
|
+
if (value.length === 0) { onSearch?.(); return; }
|
|
363
|
+
setCursor((c) => Math.min(value.length, c + 1)); return;
|
|
364
|
+
}
|
|
361
365
|
if (key.shift && enter) {
|
|
362
366
|
snapshot('type');
|
|
363
367
|
setValue((v) => insertAt(v, cursor, '\n'));
|
|
@@ -418,7 +422,7 @@ export function Composer({
|
|
|
418
422
|
return;
|
|
419
423
|
}
|
|
420
424
|
if (key.home || (key.ctrl && input === 'a')) { setCursor(0); return; }
|
|
421
|
-
if (key.end || (key.ctrl && input === 'e' && value.indexOf('\n') === -1)) { setCursor(value.length); return; }
|
|
425
|
+
if (key.end || (key.ctrl && input === 'e' && value.indexOf('\n') === -1 && value.length > 0)) { setCursor(value.length); return; }
|
|
422
426
|
if (key.ctrl && key.home) { setCursor(0); return; }
|
|
423
427
|
if (key.ctrl && key.end) { setCursor(value.length); return; }
|
|
424
428
|
if (key.meta && key.leftArrow) { setCursor(wordLeft(value, cursor)); return; }
|