@sagmans/dsh-tui 0.2.0 → 0.3.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/README.md +126 -21
- package/lib/agent/model.d.ts +26 -0
- package/lib/agent/model.d.ts.map +1 -1
- package/lib/agent/model.js +41 -0
- package/lib/agent/model.js.map +1 -1
- package/lib/agent/status.d.ts +10 -0
- package/lib/agent/status.d.ts.map +1 -1
- package/lib/agent/status.js +2 -0
- package/lib/agent/status.js.map +1 -1
- package/lib/cards.d.ts +1 -1
- package/lib/cards.d.ts.map +1 -1
- package/lib/cards.js +4 -3
- package/lib/cards.js.map +1 -1
- package/lib/gates.d.ts +145 -2
- package/lib/gates.d.ts.map +1 -1
- package/lib/gates.js +335 -40
- package/lib/gates.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +383 -102
- package/lib/index.js.map +1 -1
- package/lib/input/actions.d.ts +136 -0
- package/lib/input/actions.d.ts.map +1 -0
- package/lib/input/actions.js +740 -0
- package/lib/input/actions.js.map +1 -0
- package/lib/input/keymap-settings.d.ts +21 -0
- package/lib/input/keymap-settings.d.ts.map +1 -0
- package/lib/input/keymap-settings.js +28 -0
- package/lib/input/keymap-settings.js.map +1 -0
- package/lib/input/keymap.d.ts +91 -0
- package/lib/input/keymap.d.ts.map +1 -0
- package/lib/input/keymap.js +170 -0
- package/lib/input/keymap.js.map +1 -0
- package/lib/input/match.d.ts +10 -0
- package/lib/input/match.d.ts.map +1 -0
- package/lib/input/match.js +83 -0
- package/lib/input/match.js.map +1 -0
- package/lib/input/submission.d.ts +6 -1
- package/lib/input/submission.d.ts.map +1 -1
- package/lib/input/submission.js +6 -2
- package/lib/input/submission.js.map +1 -1
- package/lib/input.d.ts +17 -0
- package/lib/input.d.ts.map +1 -0
- package/lib/input.js +27 -0
- package/lib/input.js.map +1 -0
- package/lib/keys-command.d.ts +16 -0
- package/lib/keys-command.d.ts.map +1 -0
- package/lib/keys-command.js +60 -0
- package/lib/keys-command.js.map +1 -0
- package/lib/queue.d.ts +6 -0
- package/lib/queue.d.ts.map +1 -0
- package/lib/queue.js +68 -0
- package/lib/queue.js.map +1 -0
- package/lib/settings-notice.d.ts +19 -0
- package/lib/settings-notice.d.ts.map +1 -0
- package/lib/settings-notice.js +30 -0
- package/lib/settings-notice.js.map +1 -0
- package/lib/theme-settings.d.ts +43 -8
- package/lib/theme-settings.d.ts.map +1 -1
- package/lib/theme-settings.js +66 -3
- package/lib/theme-settings.js.map +1 -1
- package/lib/theme-tokens.d.ts +4 -4
- package/lib/theme-tokens.d.ts.map +1 -1
- package/lib/theme-tokens.js +31 -5
- package/lib/theme-tokens.js.map +1 -1
- package/lib/ui/editor.d.ts +18 -1
- package/lib/ui/editor.d.ts.map +1 -1
- package/lib/ui/editor.js +80 -19
- package/lib/ui/editor.js.map +1 -1
- package/lib/ui/frame.d.ts +54 -0
- package/lib/ui/frame.d.ts.map +1 -0
- package/lib/ui/frame.js +79 -0
- package/lib/ui/frame.js.map +1 -0
- package/lib/ui/gate-input.d.ts +20 -0
- package/lib/ui/gate-input.d.ts.map +1 -0
- package/lib/ui/gate-input.js +96 -0
- package/lib/ui/gate-input.js.map +1 -0
- package/lib/ui/markdown.d.ts +11 -2
- package/lib/ui/markdown.d.ts.map +1 -1
- package/lib/ui/markdown.js +25 -6
- package/lib/ui/markdown.js.map +1 -1
- package/lib/ui/mermaid.d.ts +44 -0
- package/lib/ui/mermaid.d.ts.map +1 -0
- package/lib/ui/mermaid.js +178 -0
- package/lib/ui/mermaid.js.map +1 -0
- package/lib/ui/picker.d.ts +30 -8
- package/lib/ui/picker.d.ts.map +1 -1
- package/lib/ui/picker.js +63 -23
- package/lib/ui/picker.js.map +1 -1
- package/lib/ui/prompt.d.ts +30 -0
- package/lib/ui/prompt.d.ts.map +1 -0
- package/lib/ui/prompt.js +45 -0
- package/lib/ui/prompt.js.map +1 -0
- package/lib/ui/queue.d.ts +24 -0
- package/lib/ui/queue.d.ts.map +1 -0
- package/lib/ui/queue.js +57 -0
- package/lib/ui/queue.js.map +1 -0
- package/lib/ui/status.d.ts +4 -0
- package/lib/ui/status.d.ts.map +1 -1
- package/lib/ui/status.js +8 -0
- package/lib/ui/status.js.map +1 -1
- package/lib/ui/view.d.ts +22 -2
- package/lib/ui/view.d.ts.map +1 -1
- package/lib/ui/view.js +84 -24
- package/lib/ui/view.js.map +1 -1
- package/lib/work.d.ts +48 -0
- package/lib/work.d.ts.map +1 -1
- package/lib/work.js +44 -0
- package/lib/work.js.map +1 -1
- package/package.json +3 -2
package/lib/ui/picker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picker.js","sourceRoot":"","sources":["../../src/ui/picker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"picker.js","sourceRoot":"","sources":["../../src/ui/picker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAe,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAqC,MAAM,mBAAmB,CAAA;AACxG,OAAO,EAAE,cAAc,EAAsB,MAAM,qBAAqB,CAAA;AA4BxE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAA;AAa/B,MAAM,SAAS,GAAG,MAAM,CAAA;AACxB,MAAM,OAAO,GAAG,EAAE,GAAG,SAAS,CAAA;AAC9B,MAAM,MAAM,GAAG,EAAE,GAAG,OAAO,CAAA;AAE3B,0EAA0E;AAC1E,MAAM,UAAU,WAAW,CAAC,SAAiB,EAAE,GAAW;IACxD,MAAM,OA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,WAAW,QAAQ,CAAC,IAAI,EAAE,EAAE,gBAAgB,CAAC,YAAY,QAAQ,CAAC,IAAI,EAAE,EAAE,eAAe,CAAC,0BAA0B;SAClL,EACD,IAAI,CACL,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Component } from '@earendil-works/pi-tui';
|
|
2
|
+
import type { BoxedEditor } from './editor.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The prompt bar, and the question that borrows it.
|
|
5
|
+
*
|
|
6
|
+
* A question is answered in the reader's own editor, because that is the one
|
|
7
|
+
* with everything they expect of it — completion, history, undo, and the keys
|
|
8
|
+
* their terminal sends — so the question takes the bar rather than a copy of it.
|
|
9
|
+
* The bar hides while the question is open, and the prompt nobody has sent yet
|
|
10
|
+
* is held aside and put back afterwards.
|
|
11
|
+
*/
|
|
12
|
+
export declare class PromptBar implements Component {
|
|
13
|
+
private readonly editor;
|
|
14
|
+
private borrowed;
|
|
15
|
+
private held;
|
|
16
|
+
constructor(editor: BoxedEditor);
|
|
17
|
+
/**
|
|
18
|
+
* Borrow the editor for a gate that collects answers in it.
|
|
19
|
+
*
|
|
20
|
+
* The builder runs after the prompt is held aside, because a gate empties the
|
|
21
|
+
* editor for its first answer as it is built, and a prompt is not an answer.
|
|
22
|
+
*/
|
|
23
|
+
borrow<T>(build: () => T): T;
|
|
24
|
+
/** Give the editor back, with the prompt that was in it. */
|
|
25
|
+
giveBack(): void;
|
|
26
|
+
/** The rows the bar occupies, which a borrowing question leaves empty. */
|
|
27
|
+
render(width: number): string[];
|
|
28
|
+
invalidate(): void;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/ui/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;;;;;;GAQG;AACH,qBAAa,SAAU,YAAW,SAAS;IAI7B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,IAAI,CAAK;gBAEY,MAAM,EAAE,WAAW;IAEhD;;;;;OAKG;IACH,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC;IAO5B,4DAA4D;IAC5D,QAAQ,IAAI,IAAI;IAOhB,0EAA0E;IAC1E,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAI/B,UAAU,IAAI,IAAI;CAGnB"}
|
package/lib/ui/prompt.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The prompt bar, and the question that borrows it.
|
|
3
|
+
*
|
|
4
|
+
* A question is answered in the reader's own editor, because that is the one
|
|
5
|
+
* with everything they expect of it — completion, history, undo, and the keys
|
|
6
|
+
* their terminal sends — so the question takes the bar rather than a copy of it.
|
|
7
|
+
* The bar hides while the question is open, and the prompt nobody has sent yet
|
|
8
|
+
* is held aside and put back afterwards.
|
|
9
|
+
*/
|
|
10
|
+
export class PromptBar {
|
|
11
|
+
editor;
|
|
12
|
+
borrowed = false;
|
|
13
|
+
held = '';
|
|
14
|
+
constructor(editor) {
|
|
15
|
+
this.editor = editor;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Borrow the editor for a gate that collects answers in it.
|
|
19
|
+
*
|
|
20
|
+
* The builder runs after the prompt is held aside, because a gate empties the
|
|
21
|
+
* editor for its first answer as it is built, and a prompt is not an answer.
|
|
22
|
+
*/
|
|
23
|
+
borrow(build) {
|
|
24
|
+
this.held = this.editor.getExpandedText();
|
|
25
|
+
this.editor.setText('');
|
|
26
|
+
this.borrowed = true;
|
|
27
|
+
return build();
|
|
28
|
+
}
|
|
29
|
+
/** Give the editor back, with the prompt that was in it. */
|
|
30
|
+
giveBack() {
|
|
31
|
+
if (!this.borrowed)
|
|
32
|
+
return;
|
|
33
|
+
this.borrowed = false;
|
|
34
|
+
this.editor.setText(this.held);
|
|
35
|
+
this.held = '';
|
|
36
|
+
}
|
|
37
|
+
/** The rows the bar occupies, which a borrowing question leaves empty. */
|
|
38
|
+
render(width) {
|
|
39
|
+
return this.borrowed ? [] : this.editor.render(width);
|
|
40
|
+
}
|
|
41
|
+
invalidate() {
|
|
42
|
+
this.editor.invalidate();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/ui/prompt.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,MAAM,OAAO,SAAS;IAIS;IAHrB,QAAQ,GAAG,KAAK,CAAA;IAChB,IAAI,GAAG,EAAE,CAAA;IAEjB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD;;;;;OAKG;IACH,MAAM,CAAI,KAAc;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAA;QACzC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;QACpB,OAAO,KAAK,EAAE,CAAA;IAChB,CAAC;IAED,4DAA4D;IAC5D,QAAQ;QACN,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAM;QAC1B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAA;QACrB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC9B,IAAI,CAAC,IAAI,GAAG,EAAE,CAAA;IAChB,CAAC;IAED,0EAA0E;IAC1E,MAAM,CAAC,KAAa;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACvD,CAAC;IAED,UAAU;QACR,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAA;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Component } from '@earendil-works/pi-tui';
|
|
2
|
+
import type { TuiTheme } from '../theme.ts';
|
|
3
|
+
/** Queued prompts the bar draws; everything older becomes one count above them. */
|
|
4
|
+
export declare const QUEUE_LIMIT = 3;
|
|
5
|
+
/** Text rows one queued prompt keeps before its own count takes over. */
|
|
6
|
+
export declare const QUEUE_TEXT_ROWS = 3;
|
|
7
|
+
/**
|
|
8
|
+
* The prompts the agent has not taken yet, drawn above the editor.
|
|
9
|
+
*
|
|
10
|
+
* The rows take the editor's own frame because that is what they are: input the
|
|
11
|
+
* reader already submitted, waiting for the agent to reach it. Only the face
|
|
12
|
+
* differs — faint and italic — so a reader can tell at a glance that the text is
|
|
13
|
+
* waiting rather than being typed.
|
|
14
|
+
*/
|
|
15
|
+
export declare class QueueBar implements Component {
|
|
16
|
+
private readonly prompts;
|
|
17
|
+
private readonly theme;
|
|
18
|
+
constructor(prompts: () => readonly string[], theme: TuiTheme);
|
|
19
|
+
invalidate(): void;
|
|
20
|
+
/** One queued prompt as the editor bar's own box, drawn in the queued face. */
|
|
21
|
+
private box;
|
|
22
|
+
render(width: number): string[];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/ui/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,mFAAmF;AACnF,eAAO,MAAM,WAAW,IAAI,CAAA;AAC5B,yEAAyE;AACzE,eAAO,MAAM,eAAe,IAAI,CAAA;AAEhC;;;;;;;GAOG;AACH,qBAAa,QAAS,YAAW,SAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBADL,OAAO,EAAE,MAAM,SAAS,MAAM,EAAE,EAChC,KAAK,EAAE,QAAQ;IAGlC,UAAU,IAAI,IAAI;IAIlB,+EAA+E;IAC/E,OAAO,CAAC,GAAG;IAUX,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;CAkBhC"}
|
package/lib/ui/queue.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { canFrame, frameText } from "./frame.js";
|
|
2
|
+
/** Queued prompts the bar draws; everything older becomes one count above them. */
|
|
3
|
+
export const QUEUE_LIMIT = 3;
|
|
4
|
+
/** Text rows one queued prompt keeps before its own count takes over. */
|
|
5
|
+
export const QUEUE_TEXT_ROWS = 3;
|
|
6
|
+
/**
|
|
7
|
+
* The prompts the agent has not taken yet, drawn above the editor.
|
|
8
|
+
*
|
|
9
|
+
* The rows take the editor's own frame because that is what they are: input the
|
|
10
|
+
* reader already submitted, waiting for the agent to reach it. Only the face
|
|
11
|
+
* differs — faint and italic — so a reader can tell at a glance that the text is
|
|
12
|
+
* waiting rather than being typed.
|
|
13
|
+
*/
|
|
14
|
+
export class QueueBar {
|
|
15
|
+
prompts;
|
|
16
|
+
theme;
|
|
17
|
+
constructor(prompts, theme) {
|
|
18
|
+
this.prompts = prompts;
|
|
19
|
+
this.theme = theme;
|
|
20
|
+
}
|
|
21
|
+
invalidate() {
|
|
22
|
+
// Nothing is cached: the prompts are read fresh on every frame.
|
|
23
|
+
}
|
|
24
|
+
/** One queued prompt as the editor bar's own box, drawn in the queued face. */
|
|
25
|
+
box(text, width, framed) {
|
|
26
|
+
// A prompt can be longer than the screen; the reader needs to see that it is
|
|
27
|
+
// waiting, not to re-read all of it, so the first rows stand for the whole.
|
|
28
|
+
return frameText(text, width, {
|
|
29
|
+
text: line => this.theme.style('editor.queued', line),
|
|
30
|
+
border: rule => this.theme.editor.borderColor(rule),
|
|
31
|
+
framed,
|
|
32
|
+
}, QUEUE_TEXT_ROWS);
|
|
33
|
+
}
|
|
34
|
+
render(width) {
|
|
35
|
+
if (width <= 0)
|
|
36
|
+
return [];
|
|
37
|
+
const prompts = this.prompts();
|
|
38
|
+
if (prompts.length === 0)
|
|
39
|
+
return [];
|
|
40
|
+
// Hiding the face hides the rows: a frame around text the reader cannot read
|
|
41
|
+
// would look like an empty prompt waiting to be typed into.
|
|
42
|
+
if (!this.theme.visible('editor.queued'))
|
|
43
|
+
return [];
|
|
44
|
+
const framed = canFrame(width, this.theme.visible('editor.border'));
|
|
45
|
+
const shown = prompts.slice(-QUEUE_LIMIT);
|
|
46
|
+
const lines = [];
|
|
47
|
+
// The reader typed the newest prompt last, so that is the row that must stay
|
|
48
|
+
// on screen; the ones dropped here are the ones a claim is about to take.
|
|
49
|
+
if (shown.length < prompts.length) {
|
|
50
|
+
lines.push(this.theme.style('editor.queued.more', this.theme.cut(`… ${prompts.length - shown.length} queued earlier`, width, '…')));
|
|
51
|
+
}
|
|
52
|
+
for (const prompt of shown)
|
|
53
|
+
lines.push(...this.box(prompt, width, framed));
|
|
54
|
+
return lines;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/ui/queue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEhD,mFAAmF;AACnF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAA;AAC5B,yEAAyE;AACzE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAA;AAEhC;;;;;;;GAOG;AACH,MAAM,OAAO,QA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CAAC,KAAK,CAAC,KAAK,CAAC,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,iBAAiB,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;QACrI,CAAC;QACD,KAAK,MAAM,MAAM,IAAI,KAAK;YAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;QAC1E,OAAO,KAAK,CAAA;IACd,CAAC;CACF"}
|
package/lib/ui/status.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import { type Component } from '@earendil-works/pi-tui';
|
|
|
2
2
|
import type { TuiTheme } from '../theme.ts';
|
|
3
3
|
/** Everything the footer states, gathered by the surface around it. */
|
|
4
4
|
export interface StatusFacts {
|
|
5
|
+
/** The chord waiting for its second key, when one is armed. */
|
|
6
|
+
readonly chord: string | undefined;
|
|
7
|
+
/** How the reader returns to the session this terminal drives, when another is on screen. */
|
|
8
|
+
readonly back: string | undefined;
|
|
5
9
|
readonly activity: 'idle' | 'working';
|
|
6
10
|
/** How long the running turn has been running, when one is. */
|
|
7
11
|
readonly elapsedMs: number | undefined;
|
package/lib/ui/status.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/ui/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAgB,MAAM,wBAAwB,CAAA;AAIrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,QAAQ,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M,CA4CvF;AAsCD,yDAAyD;AACzD,qBAAa,SAAU,YAAW,SAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBADL,KAAK,EAAE,MAAM,WAAW,EACxB,KAAK,EAAE,QAAQ;IAGlC,UAAU,IAAI,IAAI;IAIlB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;CAGhC"}
|
package/lib/ui/status.js
CHANGED
|
@@ -55,6 +55,14 @@ export function formatStatus(facts, width, theme) {
|
|
|
55
55
|
return;
|
|
56
56
|
segments.push({ token, text: displayText(text), join });
|
|
57
57
|
};
|
|
58
|
+
// An armed chord is transient and needs the reader's eye now, so it leads the
|
|
59
|
+
// row: a row cut to width loses its tail, never what is about to happen.
|
|
60
|
+
if (facts.chord !== undefined && facts.chord !== '')
|
|
61
|
+
push('status.prefix', facts.chord);
|
|
62
|
+
// The way back is the other thing the reader may need at once: a transcript of
|
|
63
|
+
// a session they are not driving is exactly when they need it.
|
|
64
|
+
if (facts.back !== undefined && facts.back !== '')
|
|
65
|
+
push('status.back', facts.back);
|
|
58
66
|
if (facts.activity === 'working') {
|
|
59
67
|
push('status.activity.working', `${WORKING_MARK} working`);
|
|
60
68
|
// Elapsed carries its own token so it can be toned apart from the activity,
|
package/lib/ui/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/ui/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/ui/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,WAA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AM,CAAC,KAAa;QAClB,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAC1E,CAAC;CACF"}
|
package/lib/ui/view.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Component } from '@earendil-works/pi-tui';
|
|
2
|
-
import type
|
|
2
|
+
import { type Keymap } from '../input/actions.ts';
|
|
3
|
+
import { type GateCard } from '../gates.ts';
|
|
3
4
|
import type { TranscriptEntry, TranscriptModel } from '../transcript.ts';
|
|
4
5
|
import type { TuiTheme } from '../theme.ts';
|
|
5
6
|
import type { MarkdownRenderer } from './markdown.ts';
|
|
@@ -36,6 +37,14 @@ export interface TranscriptViewOptions {
|
|
|
36
37
|
readonly picker?: () => PickerCard | undefined;
|
|
37
38
|
/** Injectable so a test can see that a repaint reused the rows it had. */
|
|
38
39
|
readonly rows?: RowCache<TranscriptEntry>;
|
|
40
|
+
/**
|
|
41
|
+
* The keys in force, read live.
|
|
42
|
+
*
|
|
43
|
+
* A hint that names a key is a promise about what a press does, so it has to
|
|
44
|
+
* be drawn from the same table the press is matched against — including after
|
|
45
|
+
* a settings edit moved the key.
|
|
46
|
+
*/
|
|
47
|
+
readonly keys?: () => Keymap;
|
|
39
48
|
}
|
|
40
49
|
export declare class TranscriptView implements Component {
|
|
41
50
|
private readonly model;
|
|
@@ -66,6 +75,9 @@ export declare class TranscriptView implements Component {
|
|
|
66
75
|
private pushStyledWrapped;
|
|
67
76
|
/** Render assistant text as markdown: the model writes structure, the reader reads it. */
|
|
68
77
|
private pushMarkdown;
|
|
78
|
+
/** The live map, or the shipped one for a caller that did not lend one. */
|
|
79
|
+
private keymap;
|
|
80
|
+
private reasoningFoldHint;
|
|
69
81
|
private pushReasoning;
|
|
70
82
|
private pushCard;
|
|
71
83
|
/**
|
|
@@ -90,7 +102,15 @@ export declare class TranscriptView implements Component {
|
|
|
90
102
|
private renderStats;
|
|
91
103
|
private pushPicker;
|
|
92
104
|
private pushGate;
|
|
93
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* One row a reader can choose: the cursor, the box, the number, the label.
|
|
107
|
+
*
|
|
108
|
+
* The row wraps under the label it belongs to rather than at the screen edge,
|
|
109
|
+
* because the label and its description together are what tells two rows
|
|
110
|
+
* apart, and a mark on a continuation line reads as another row.
|
|
111
|
+
*/
|
|
112
|
+
private pushGateRow;
|
|
113
|
+
/** The rows one transcript entry becomes; `live` marks the entry the turn is still writing. */
|
|
94
114
|
private renderEntry;
|
|
95
115
|
/** The mark and the space that introduce an element, empty when it has none. */
|
|
96
116
|
private elementLead;
|
package/lib/ui/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/ui/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAkC,MAAM,wBAAwB,CAAA;AAEvF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/ui/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAkC,MAAM,wBAAwB,CAAA;AAEvF,OAAO,EAA2B,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE9D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,QAAQ,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AIrF,UAAU,IAAI,IAAI;IAMlB,8EAA8E;IAC9E,OAAO,CAAC,WAAW;IAenB;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IASzB,0FAA0F;IAC1F,OAAO,CAAC,YAAY;IAcpB,2EAA2E;IAC3E,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,aAAa;IAsBrB,OAAO,CAAC,QAAQ;IAuDhB;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;IAoBpB;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;IAUlB,mFAAmF;IACnF,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,UAAU;IAiClB,OAAO,CAAC,QAAQ;IAkDhB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAYnB,+FAA+F;IAC/F,OAAO,CAAC,WAAW;IAgCnB,gFAAgF;IAChF,OAAO,CAAC,WAAW;IAKnB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;CAiChC"}
|
package/lib/ui/view.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { visibleWidth, wrapTextWithAnsi } from '@earendil-works/pi-tui';
|
|
2
2
|
import { cardDetailRows, shellFoldHint, shellRetentionHint } from "../cards.js";
|
|
3
|
+
import { defaultKeymap, hintKeys } from "../input/actions.js";
|
|
4
|
+
import { CUSTOM_ROW_NUMBER } from "../gates.js";
|
|
3
5
|
import { displayText } from "../text.js";
|
|
4
6
|
import { CARD_ROW_TOKEN } from "../theme-tokens.js";
|
|
7
|
+
import { canFrame, frameText } from "./frame.js";
|
|
5
8
|
import { RowCache } from "./rows.js";
|
|
6
9
|
const DETAIL_INDENT = ' ';
|
|
7
10
|
const OPTION_INDENT = ' ';
|
|
@@ -19,8 +22,9 @@ const FALLBACK_ROW_TOKEN = 'tool.detail';
|
|
|
19
22
|
const NO_CURSOR = ' ';
|
|
20
23
|
/** The words an opened card uses when retention, not the fold, dropped rows. */
|
|
21
24
|
const CARD_HINT_RETAINED = 'more lines not shown';
|
|
22
|
-
/**
|
|
23
|
-
const
|
|
25
|
+
/** What a hint names when the reader has unbound the key it would advertise. */
|
|
26
|
+
const REASONING_FOLD_FALLBACK = 'shift+tab';
|
|
27
|
+
const CARD_OPEN_FALLBACK = 'ctrl+o';
|
|
24
28
|
/** What separates a card's header from its measured facts, and the facts from each other. */
|
|
25
29
|
const STAT_LEAD = ' ';
|
|
26
30
|
const STAT_SEPARATOR = ' · ';
|
|
@@ -99,8 +103,8 @@ export class TranscriptView {
|
|
|
99
103
|
});
|
|
100
104
|
}
|
|
101
105
|
/** Render assistant text as markdown: the model writes structure, the reader reads it. */
|
|
102
|
-
pushMarkdown(lines, text, width) {
|
|
103
|
-
const rendered = this.markdown.render(displayText(text), Math.max(1, width));
|
|
106
|
+
pushMarkdown(lines, text, width, live) {
|
|
107
|
+
const rendered = this.markdown.render(displayText(text), Math.max(1, width), live);
|
|
104
108
|
rendered.forEach(line => {
|
|
105
109
|
// The renderer pads to its width for background styling we do not use.
|
|
106
110
|
const trimmed = line.replace(/[ \t]+$/u, '');
|
|
@@ -112,6 +116,13 @@ export class TranscriptView {
|
|
|
112
116
|
lines.push(this.theme.cut(trimmed, width, '…'));
|
|
113
117
|
});
|
|
114
118
|
}
|
|
119
|
+
/** The live map, or the shipped one for a caller that did not lend one. */
|
|
120
|
+
keymap() {
|
|
121
|
+
return this.options.keys?.() ?? defaultKeymap();
|
|
122
|
+
}
|
|
123
|
+
reasoningFoldHint() {
|
|
124
|
+
return hintKeys(this.keymap(), 'surface.reasoning') || REASONING_FOLD_FALLBACK;
|
|
125
|
+
}
|
|
115
126
|
pushReasoning(lines, entry, width) {
|
|
116
127
|
if (!this.theme.visible('transcript.reasoning.summary'))
|
|
117
128
|
return;
|
|
@@ -122,7 +133,7 @@ export class TranscriptView {
|
|
|
122
133
|
// rides the row rather than a line of its own, so naming the hidden body
|
|
123
134
|
// costs no vertical space.
|
|
124
135
|
const suffix = !this.viewState.expandReasoning && entry.body !== '' && this.theme.visible('transcript.reasoning.hint')
|
|
125
|
-
? ` (${
|
|
136
|
+
? ` (${this.reasoningFoldHint()})`
|
|
126
137
|
: '';
|
|
127
138
|
// The key is kept whole: the summary is the part that gives up room.
|
|
128
139
|
const room = Math.max(1, width - visibleWidth(suffix));
|
|
@@ -187,7 +198,9 @@ export class TranscriptView {
|
|
|
187
198
|
// card is bounded by its preview window, an opened one by retention, so the
|
|
188
199
|
// opened hint promises no more than memory kept.
|
|
189
200
|
const hint = card.kind === 'terminal'
|
|
190
|
-
? preview.expanded
|
|
201
|
+
? preview.expanded
|
|
202
|
+
? shellRetentionHint(hidden)
|
|
203
|
+
: shellFoldHint(hidden, hintKeys(this.keymap(), 'surface.toolDetail') || CARD_OPEN_FALLBACK)
|
|
191
204
|
: preview.expanded ? `${hidden} ${CARD_HINT_RETAINED}` : undefined;
|
|
192
205
|
if (hint === undefined)
|
|
193
206
|
return;
|
|
@@ -287,7 +300,9 @@ export class TranscriptView {
|
|
|
287
300
|
if (this.theme.visible('gate.title')) {
|
|
288
301
|
const glyphToken = gate.kind === 'approval' ? 'gate.glyphApproval' : 'gate.glyphQuestion';
|
|
289
302
|
const glyph = this.theme.glyph(glyphToken) || (gate.kind === 'approval' ? APPROVAL_MARK : QUESTION_MARK);
|
|
290
|
-
|
|
303
|
+
// The question is the thing being decided, so it wraps rather than being
|
|
304
|
+
// cut: a reader cannot answer a sentence they were not shown.
|
|
305
|
+
this.pushWrapped(lines, gate.title, width, `${glyph} `, text => this.theme.style('gate.title', text));
|
|
291
306
|
}
|
|
292
307
|
if (this.theme.visible('gate.detail')) {
|
|
293
308
|
for (const detail of gate.detail) {
|
|
@@ -295,23 +310,62 @@ export class TranscriptView {
|
|
|
295
310
|
}
|
|
296
311
|
}
|
|
297
312
|
gate.options.forEach((option, position) => {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
? `${cursor} ${box} ${position + 1}. ${label}`
|
|
306
|
-
: `${cursor} ${box} ${position + 1}. ${label} — ${displayText(option.description)}`;
|
|
307
|
-
lines.push(this.theme.style(token, this.theme.cut(`${OPTION_INDENT}${text}`, width, '')));
|
|
313
|
+
this.pushGateRow(lines, width, {
|
|
314
|
+
number: gate.optionOffset + position + 1,
|
|
315
|
+
label: option.label,
|
|
316
|
+
description: option.description,
|
|
317
|
+
current: option.current,
|
|
318
|
+
selected: option.selected,
|
|
319
|
+
});
|
|
308
320
|
});
|
|
321
|
+
// The free-text row is drawn under the window rather than inside it: it is
|
|
322
|
+
// the one row that must never scroll out of reach, and the window's own
|
|
323
|
+
// numbering is left running 1..n above it.
|
|
324
|
+
if (gate.custom !== undefined) {
|
|
325
|
+
this.pushGateRow(lines, width, {
|
|
326
|
+
number: CUSTOM_ROW_NUMBER,
|
|
327
|
+
label: gate.custom.label,
|
|
328
|
+
description: gate.custom.description,
|
|
329
|
+
current: gate.custom.current,
|
|
330
|
+
selected: gate.custom.selected,
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
// The answer belongs to the row it fills: the free-text row, or the question
|
|
334
|
+
// itself when typing is the only way to answer it. The rows come from the
|
|
335
|
+
// surface's own editor, so they are placed rather than restyled — it draws
|
|
336
|
+
// its frame, its padding, and its cursor for the width it is given.
|
|
337
|
+
if (gate.answerInput !== undefined) {
|
|
338
|
+
const room = Math.max(1, width - visibleWidth(OPTION_INDENT));
|
|
339
|
+
for (const row of gate.answerInput.render(room))
|
|
340
|
+
lines.push(`${OPTION_INDENT}${row}`);
|
|
341
|
+
}
|
|
342
|
+
// The keys are how the gate is answered at all, so they wrap rather than
|
|
343
|
+
// lose their tail at a narrow edge.
|
|
309
344
|
if (this.theme.visible('gate.hint')) {
|
|
310
|
-
|
|
345
|
+
this.pushWrapped(lines, gate.hint, width, OPTION_INDENT, text => this.theme.style('gate.hint', text));
|
|
311
346
|
}
|
|
312
347
|
}
|
|
313
|
-
/**
|
|
314
|
-
|
|
348
|
+
/**
|
|
349
|
+
* One row a reader can choose: the cursor, the box, the number, the label.
|
|
350
|
+
*
|
|
351
|
+
* The row wraps under the label it belongs to rather than at the screen edge,
|
|
352
|
+
* because the label and its description together are what tells two rows
|
|
353
|
+
* apart, and a mark on a continuation line reads as another row.
|
|
354
|
+
*/
|
|
355
|
+
pushGateRow(lines, width, row) {
|
|
356
|
+
const token = row.current ? 'gate.optionCurrent' : 'gate.option';
|
|
357
|
+
if (!this.theme.visible(token))
|
|
358
|
+
return;
|
|
359
|
+
const cursor = row.current ? this.theme.glyph('gate.cursor') || CURSOR_MARK : NO_CURSOR;
|
|
360
|
+
const box = row.selected ? CHECKBOX_ON : CHECKBOX_OFF;
|
|
361
|
+
const lead = `${OPTION_INDENT}${cursor} ${box} ${row.number}. `;
|
|
362
|
+
const text = row.description === undefined ? row.label : `${row.label} — ${row.description}`;
|
|
363
|
+
// The text reaches pushWrapped unescaped: it escapes once, and escaping a
|
|
364
|
+
// second time would show the reader the escape instead of the character.
|
|
365
|
+
this.pushWrapped(lines, text, width, lead, body => this.theme.style(token, body));
|
|
366
|
+
}
|
|
367
|
+
/** The rows one transcript entry becomes; `live` marks the entry the turn is still writing. */
|
|
368
|
+
renderEntry(entry, lines, width, live) {
|
|
315
369
|
switch (entry.kind) {
|
|
316
370
|
case 'tool':
|
|
317
371
|
this.pushCard(lines, entry.card, width);
|
|
@@ -320,12 +374,18 @@ export class TranscriptView {
|
|
|
320
374
|
this.pushReasoning(lines, entry, width);
|
|
321
375
|
return;
|
|
322
376
|
case 'assistant':
|
|
323
|
-
this.pushMarkdown(lines, entry.text, width);
|
|
377
|
+
this.pushMarkdown(lines, entry.text, width, live);
|
|
324
378
|
return;
|
|
325
379
|
case 'user':
|
|
326
380
|
if (!this.theme.visible('transcript.user'))
|
|
327
381
|
return;
|
|
328
|
-
|
|
382
|
+
// A prompt is boxed wherever it is read, so the row it left in the queue
|
|
383
|
+
// and the row it becomes here are recognisably the same object.
|
|
384
|
+
lines.push(...frameText(entry.text, width, {
|
|
385
|
+
text: text => this.theme.style('transcript.user', text),
|
|
386
|
+
border: rule => this.theme.editor.borderColor(rule),
|
|
387
|
+
framed: canFrame(width, this.theme.visible('editor.border')),
|
|
388
|
+
}));
|
|
329
389
|
return;
|
|
330
390
|
case 'notice':
|
|
331
391
|
if (!this.theme.visible('transcript.notice'))
|
|
@@ -359,7 +419,7 @@ export class TranscriptView {
|
|
|
359
419
|
// The in-flight rows change on every frame, so caching them would only
|
|
360
420
|
// fill the cache with objects nobody will ask for again.
|
|
361
421
|
if (index >= settled) {
|
|
362
|
-
this.renderEntry(entry, lines, width);
|
|
422
|
+
this.renderEntry(entry, lines, width, true);
|
|
363
423
|
continue;
|
|
364
424
|
}
|
|
365
425
|
const cached = this.rows.lookup(entry, tag);
|
|
@@ -368,7 +428,7 @@ export class TranscriptView {
|
|
|
368
428
|
continue;
|
|
369
429
|
}
|
|
370
430
|
const rendered = [];
|
|
371
|
-
this.renderEntry(entry, rendered, width);
|
|
431
|
+
this.renderEntry(entry, rendered, width, false);
|
|
372
432
|
this.rows.store(entry, tag, rendered);
|
|
373
433
|
lines.push(...rendered);
|
|
374
434
|
}
|