@geohar/unbien-cli 0.1.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.
Files changed (50) hide show
  1. package/README.md +72 -0
  2. package/dist/client.d.ts +89 -0
  3. package/dist/client.js +210 -0
  4. package/dist/client.js.map +1 -0
  5. package/dist/commands.d.ts +59 -0
  6. package/dist/commands.js +273 -0
  7. package/dist/commands.js.map +1 -0
  8. package/dist/connect.d.ts +2 -0
  9. package/dist/connect.js +475 -0
  10. package/dist/connect.js.map +1 -0
  11. package/dist/identity.d.ts +2 -0
  12. package/dist/identity.js +30 -0
  13. package/dist/identity.js.map +1 -0
  14. package/dist/invite.d.ts +10 -0
  15. package/dist/invite.js +28 -0
  16. package/dist/invite.js.map +1 -0
  17. package/dist/main.d.ts +3 -0
  18. package/dist/main.js +20 -0
  19. package/dist/main.js.map +1 -0
  20. package/dist/panels.d.ts +40 -0
  21. package/dist/panels.js +155 -0
  22. package/dist/panels.js.map +1 -0
  23. package/dist/picker.d.ts +6 -0
  24. package/dist/picker.js +95 -0
  25. package/dist/picker.js.map +1 -0
  26. package/dist/plan.d.ts +30 -0
  27. package/dist/plan.js +132 -0
  28. package/dist/plan.js.map +1 -0
  29. package/dist/reduce.d.ts +45 -0
  30. package/dist/reduce.js +123 -0
  31. package/dist/reduce.js.map +1 -0
  32. package/dist/render.d.ts +13 -0
  33. package/dist/render.js +91 -0
  34. package/dist/render.js.map +1 -0
  35. package/dist/replay.d.ts +2 -0
  36. package/dist/replay.js +57 -0
  37. package/dist/replay.js.map +1 -0
  38. package/dist/settings.d.ts +27 -0
  39. package/dist/settings.js +31 -0
  40. package/dist/settings.js.map +1 -0
  41. package/dist/store.d.ts +13 -0
  42. package/dist/store.js +20 -0
  43. package/dist/store.js.map +1 -0
  44. package/dist/theme.d.ts +7 -0
  45. package/dist/theme.js +110 -0
  46. package/dist/theme.js.map +1 -0
  47. package/dist/tui.d.ts +78 -0
  48. package/dist/tui.js +265 -0
  49. package/dist/tui.js.map +1 -0
  50. package/package.json +58 -0
package/dist/tui.js ADDED
@@ -0,0 +1,265 @@
1
+ /**
2
+ * The interactive shell: pi's TUI main-screen root, its editor for the prompt
3
+ * box, and a footer. Transcript lines are printed into scrollback above the
4
+ * dynamic region, which is how pi's own regular (non-fullscreen) mode works.
5
+ */
6
+ import { getSelectListTheme } from "@earendil-works/pi-coding-agent";
7
+ import { Editor, Loader, matchesKey, ProcessTerminal, SelectList, Text, TuiMainScreen, } from "@earendil-works/pi-tui";
8
+ const THEME_KEY = Symbol.for("@earendil-works/pi-coding-agent:theme");
9
+ /**
10
+ * Holds transcript lines that are ALREADY rendered to width by pi's components.
11
+ * `Text` would word-wrap them again and mangle the ANSI, so emit them verbatim.
12
+ */
13
+ class Lines {
14
+ lines = [];
15
+ append(lines) {
16
+ this.lines.push(...lines);
17
+ }
18
+ reset(lines) {
19
+ this.lines = [...lines];
20
+ }
21
+ get length() {
22
+ return this.lines.length;
23
+ }
24
+ invalidate() {
25
+ // Nothing cached: the lines are already final.
26
+ }
27
+ render() {
28
+ return this.lines;
29
+ }
30
+ }
31
+ /** The active theme instance, which pi shares through a global symbol. */
32
+ function activeTheme() {
33
+ return globalThis[THEME_KEY];
34
+ }
35
+ function editorTheme() {
36
+ const theme = activeTheme();
37
+ return {
38
+ borderColor: (s) => theme.fg("border", s),
39
+ selectList: getSelectListTheme(),
40
+ };
41
+ }
42
+ export class Shell {
43
+ onQuit;
44
+ tui = new TuiMainScreen(new ProcessTerminal());
45
+ editor;
46
+ footer;
47
+ working;
48
+ isWorking = false;
49
+ quitting = false;
50
+ /** In-flight assistant turn, shown above the editor until it settles. */
51
+ live = new Lines();
52
+ transcript = new Lines();
53
+ /** Persistent panel widgets, pinned above the composer like pi's own. */
54
+ widgets = new Lines();
55
+ /**
56
+ * Command output (/tree, /plan, …) lives BELOW the transcript: `draw()`
57
+ * replaces the transcript wholesale on every frame, which would otherwise
58
+ * erase anything a command had printed.
59
+ */
60
+ notes = new Lines();
61
+ status;
62
+ /** A modal chooser owns input while open, so the editor must not also see it. */
63
+ overlay = null;
64
+ constructor(status, onSubmit, onQuit = () => process.exit(0)) {
65
+ this.onQuit = onQuit;
66
+ this.status = status;
67
+ this.editor = new Editor(this.tui, editorTheme(), { paddingX: 1 });
68
+ this.editor.onSubmit = (text) => {
69
+ const trimmed = text.trim();
70
+ this.editor.setText("");
71
+ if (trimmed)
72
+ onSubmit(trimmed);
73
+ };
74
+ this.footer = new Text(this.renderFooter());
75
+ const theme = activeTheme();
76
+ this.working = new Loader(this.tui, (s) => theme.fg("accent", s), (s) => theme.fg("muted", s), "");
77
+ this.tui.addChild(this.transcript);
78
+ this.tui.addChild(this.notes);
79
+ this.tui.addChild(this.live);
80
+ this.tui.addChild(this.widgets);
81
+ this.tui.addChild(this.working);
82
+ this.tui.addChild(this.editor);
83
+ this.tui.addChild(this.footer);
84
+ this.tui.setFocus(this.editor);
85
+ }
86
+ start() {
87
+ // The picker hands stdin back paused; the terminal needs it flowing.
88
+ process.stdin.resume();
89
+ this.tui.start();
90
+ // Ctrl-C / Ctrl-D must always exit. The editor consumes ordinary keys, so
91
+ // without this the shell has no way out and the process looks wedged.
92
+ // Match through pi's key parser, NOT raw bytes: ProcessTerminal pushes the
93
+ // Kitty keyboard protocol, so Ctrl-C arrives as CSI-u (`\x1b[99;5u`) and a
94
+ // `data === "\x03"` test silently never fires.
95
+ this.tui.addInputListener((data) => {
96
+ const isCancel = matchesKey(data, "ctrl+c");
97
+ if (!isCancel && !matchesKey(data, "ctrl+d"))
98
+ return undefined;
99
+ if (isCancel && this.overlay)
100
+ return undefined; // the list cancels itself
101
+ this.quit();
102
+ return { consume: true };
103
+ });
104
+ process.on("SIGINT", () => this.quit());
105
+ }
106
+ /**
107
+ * Terminal reset is pi's job, not ours: `tui.stop()` → `ProcessTerminal.stop()`
108
+ * disables bracketed paste and the Kitty keyboard protocol, drops its stdin
109
+ * handlers, and restores raw mode to what it WAS — pausing stdin first, which
110
+ * its own comment marks as the fix for a Ctrl-D race that can close the parent
111
+ * shell over SSH. Doing any of that by hand here re-broke that ordering.
112
+ *
113
+ * We add only what pi can't know about: our socket, and a watchdog so a throw
114
+ * in teardown can't leave the process stranded.
115
+ */
116
+ quit() {
117
+ if (this.quitting)
118
+ return;
119
+ this.quitting = true;
120
+ try {
121
+ this.working.stop();
122
+ this.tui.stop();
123
+ }
124
+ catch {
125
+ /* fall through to the watchdog rather than stranding the process */
126
+ }
127
+ const watchdog = setTimeout(() => process.exit(130), 250);
128
+ watchdog.unref();
129
+ this.onQuit();
130
+ }
131
+ /**
132
+ * The in-flight turn is REWRITTEN on every delta, so it can't be appended to
133
+ * the transcript. It renders in its own region and is cleared the moment the
134
+ * settled message takes its place — same component, so no visible reflow.
135
+ */
136
+ setLive(lines) {
137
+ this.live.reset(lines.length > 0 ? ["", ...lines] : []);
138
+ this.tui.requestRender();
139
+ }
140
+ stop() {
141
+ this.working.stop();
142
+ this.tui.stop();
143
+ }
144
+ setStatus(patch) {
145
+ this.status = { ...this.status, ...patch };
146
+ // The spinner animates only while the agent is working; leaving it running
147
+ // costs a repaint every frame for no information.
148
+ const working = this.status.working === true;
149
+ if (working !== this.isWorking) {
150
+ this.isWorking = working;
151
+ if (working) {
152
+ this.working.start();
153
+ }
154
+ else {
155
+ this.working.stop();
156
+ }
157
+ }
158
+ this.working.setMessage(working ? (this.status.activity ?? "working") : "");
159
+ this.footer.setText(this.renderFooter());
160
+ this.tui.requestRender();
161
+ }
162
+ /**
163
+ * Transcript must live INSIDE the TUI: a full repaint emits `\x1b[3J`, which
164
+ * clears the scrollback buffer, so anything written straight to stdout is
165
+ * erased the moment the shell next redraws.
166
+ */
167
+ print(lines) {
168
+ if (lines.length === 0)
169
+ return;
170
+ this.notes.append(lines);
171
+ this.tui.requestRender();
172
+ }
173
+ /** Drop command output (it is scratch, not conversation). */
174
+ clearNotes() {
175
+ this.notes.reset([]);
176
+ this.tui.requestRender();
177
+ }
178
+ /** Replace the pinned panel widgets (plan / subagents). */
179
+ setWidgets(lines) {
180
+ this.widgets.reset(lines.length > 0 ? ["", ...lines] : []);
181
+ this.tui.requestRender();
182
+ }
183
+ /** Replace the whole transcript (history replay re-reduces from scratch). */
184
+ setTranscript(lines) {
185
+ this.transcript.reset(lines);
186
+ this.tui.requestRender();
187
+ }
188
+ /**
189
+ * A chooser whose rows carry ACTIONS: a single keypress both picks the row
190
+ * and says what to do with it. Filtering is off here on purpose — the letter
191
+ * keys are the shortcuts, and a filter would swallow them.
192
+ */
193
+ chooseAction(title, items, hint, keys) {
194
+ if (items.length === 0)
195
+ return Promise.resolve(null);
196
+ return new Promise((resolve) => {
197
+ const list = new SelectList(items, 12, getSelectListTheme());
198
+ const heading = new Text(` ${title}\n ${hint}`);
199
+ const finish = (result) => {
200
+ this.tui.removeChild(list);
201
+ this.tui.removeChild(heading);
202
+ this.overlay = null;
203
+ this.tui.removeInputListener(onKey);
204
+ this.tui.setFocus(this.editor);
205
+ this.tui.requestRender();
206
+ resolve(result);
207
+ };
208
+ const onKey = (data) => {
209
+ if (!this.overlay)
210
+ return undefined;
211
+ if (keys.includes(data)) {
212
+ const item = list.getSelectedItem();
213
+ if (item)
214
+ finish({ item, action: data });
215
+ return { consume: true };
216
+ }
217
+ return undefined;
218
+ };
219
+ list.onSelect = (item) => finish({ item, action: keys[0] ?? "" });
220
+ list.onCancel = () => finish(null);
221
+ this.overlay = list;
222
+ this.tui.addChild(heading);
223
+ this.tui.addChild(list);
224
+ this.tui.addInputListener(onKey);
225
+ this.tui.setFocus(list);
226
+ this.tui.requestRender();
227
+ });
228
+ }
229
+ /** A highlighted chooser layered over the editor; resolves to the pick. */
230
+ choose(title, items) {
231
+ if (items.length === 0)
232
+ return Promise.resolve(null);
233
+ return new Promise((resolve) => {
234
+ const list = new SelectList(items, 12, getSelectListTheme());
235
+ const heading = new Text(` ${title}`);
236
+ const finish = (picked) => {
237
+ this.tui.removeChild(list);
238
+ this.tui.removeChild(heading);
239
+ this.overlay = null;
240
+ this.tui.setFocus(this.editor);
241
+ this.tui.requestRender();
242
+ resolve(picked);
243
+ };
244
+ list.onSelect = finish;
245
+ list.onCancel = () => finish(null);
246
+ this.overlay = list;
247
+ this.tui.addChild(heading);
248
+ this.tui.addChild(list);
249
+ this.tui.setFocus(list);
250
+ this.tui.requestRender();
251
+ });
252
+ }
253
+ get hasOverlay() {
254
+ return this.overlay !== null;
255
+ }
256
+ renderFooter() {
257
+ const theme = activeTheme();
258
+ const parts = [this.status.session, this.status.cwd];
259
+ if (this.status.model)
260
+ parts.push(this.status.model);
261
+ parts.push(this.status.working ? "working…" : "idle");
262
+ return theme.fg("muted", ` ${parts.join(" · ")}`);
263
+ }
264
+ }
265
+ //# sourceMappingURL=tui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tui.js","sourceRoot":"","sources":["../src/tui.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,kBAAkB,EAAc,MAAM,iCAAiC,CAAA;AAChF,OAAO,EACL,MAAM,EACN,MAAM,EACN,UAAU,EACV,eAAe,EACf,UAAU,EACV,IAAI,EACJ,aAAa,GAId,MAAM,wBAAwB,CAAA;AAE/B,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAA;AAErE;;;GAGG;AACH,MAAM,KAAK;IACD,KAAK,GAAa,EAAE,CAAA;IAE5B,MAAM,CAAC,KAAwB;QAC7B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAA;IAC3B,CAAC;IAED,KAAK,CAAC,KAAwB;QAC5B,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;IACzB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAA;IAC1B,CAAC;IAED,UAAU;QACR,+CAA+C;IACjD,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CA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;QAC1B,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,OAAO,KAAK,IAAI,CAAA;IAC9B,CAAC;IAEO,YAAY;QAClB,MAAM,KAAK,GAAG,WAAW,EAAE,CAAA;QAC3B,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACpD,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QACpD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QACrD,OAAO,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IACtD,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@geohar/unbien-cli",
3
+ "version": "0.1.0",
4
+ "description": "unbien \u2014 a terminal client for remote Pi coding-agent sessions. Attach over an un-bien relay and render the transcript with pi's own TUI components: markdown, syntax highlighting, native tool cards, and your pi theme.",
5
+ "type": "module",
6
+ "bin": {
7
+ "unbien": "dist/main.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc -p tsconfig.build.json",
11
+ "typecheck": "tsc --noEmit",
12
+ "cli": "tsx src/main.ts",
13
+ "replay": "tsx src/main.ts replay",
14
+ "connect": "tsx src/main.ts connect",
15
+ "test": "vitest run"
16
+ },
17
+ "keywords": [
18
+ "pi",
19
+ "un-bien",
20
+ "unbien",
21
+ "cli",
22
+ "tui",
23
+ "coding-agent",
24
+ "remote",
25
+ "relay",
26
+ "terminal",
27
+ "agent-mesh"
28
+ ],
29
+ "author": "George Harker <georgeharker@gmail.com>",
30
+ "license": "MIT",
31
+ "homepage": "https://docs.georgeharker.com/un-bien",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/georgeharker/un-bien.git",
35
+ "directory": "unbien-cli"
36
+ },
37
+ "bugs": {
38
+ "url": "https://github.com/georgeharker/un-bien/issues"
39
+ },
40
+ "engines": {
41
+ "node": ">=20.0.0"
42
+ },
43
+ "devDependencies": {
44
+ "@types/node": "^25.8.0",
45
+ "tsx": "^4.22.0",
46
+ "typescript": "^6.0.3",
47
+ "vitest": "^4.1.6"
48
+ },
49
+ "dependencies": {
50
+ "@geohar/un-bien": "workspace:*",
51
+ "@earendil-works/pi-coding-agent": ">=0.84.3",
52
+ "@earendil-works/pi-tui": "^0.84.4"
53
+ },
54
+ "files": [
55
+ "dist",
56
+ "README.md"
57
+ ]
58
+ }