hgoblet 0.2.1__tar.gz

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.
hgoblet-0.2.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 tderk
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ include README.md
2
+ include LICENSE
3
+ recursive-include tests *.py
4
+ recursive-include src/hgoblet py.typed
hgoblet-0.2.1/PKG-INFO ADDED
@@ -0,0 +1,444 @@
1
+ Metadata-Version: 2.4
2
+ Name: hgoblet
3
+ Version: 0.2.1
4
+ Summary: hgoblet // one line-only terminal for installed MProcs-family suites (Fumuda-XY, MProcs, Nanuska-GP)
5
+ Author-email: tderk <usvu.tech@gmail.com>
6
+ License-Expression: MIT
7
+ Keywords: mprocs,fumuda-xy,nanuska-gp,terminal,launcher,switchboard,tui,curses
8
+ Classifier: Environment :: Console
9
+ Classifier: Environment :: Console :: Curses
10
+ Classifier: Intended Audience :: End Users/Desktop
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Topic :: Terminals
13
+ Classifier: Topic :: Utilities
14
+ Requires-Python: >=3.8
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Provides-Extra: dev
18
+ Requires-Dist: pytest>=7; extra == "dev"
19
+ Requires-Dist: build; extra == "dev"
20
+ Requires-Dist: twine; extra == "dev"
21
+ Dynamic: license-file
22
+
23
+ # hgoblet
24
+
25
+ **hgoblet** is one line-oriented shell for the MProcs family. It runs the
26
+ shared LPRO terminals inline, switches between the three suites without
27
+ leaving the prompt, and keeps one global username across all of them.
28
+
29
+ It finds every installed copy of:
30
+
31
+ | suite | inline alias | language |
32
+ | --- | --- | --- |
33
+ | **Fumuda-XY** | `fxy` *(default)* | Japanese |
34
+ | **MProcs** | `mp` | original / English |
35
+ | **Nanuska-GP** | `ngp` | Russian |
36
+
37
+ The nine shared LPRO terminals run directly inside the prompt:
38
+
39
+ `mdcci` · `neonbunny` · `jade-dojo` · `bumerang` · `alokate` ·
40
+ `monk-rpg` · `morning-bell` · `destiny` · `vanilla`
41
+
42
+ The upstream full-screen terminals — `gwf`, `polyhistor`, `flu0`, and
43
+ `jade-wire` — are not line-portable. They remain available explicitly with
44
+ `--tui`; they are never opened implicitly.
45
+
46
+ The default is **Jade Dojo** (`Dojical`), not the upstream Morning Bell
47
+ default. Use `hgoblet fn morning-bell` (or type `morning-bell`) when you
48
+ actually want `morn`.
49
+
50
+ ```text
51
+ kredt@minios:~$ hgoblet
52
+ スタ ( zeta ) $ print time
53
+ 時刻: 2026-11-03 10:17:55.934541
54
+
55
+ スタ ( zeta ) $ mp
56
+ ст ( zeta ) $ print time
57
+ Time: 2026-11-03 10:17:55.934541
58
+
59
+ ст ( zeta ) $ exit
60
+ kredt@minios:~$
61
+ ```
62
+
63
+ All three suites share the same command language, so selecting a suite and a
64
+ function from one prompt is enough:
65
+
66
+ ```bash
67
+ hgoblet # directly enter Jade Dojo line terminal
68
+ hgoblet shell # open hgoblet's command prompt
69
+ hgoblet line mdcci # enter Medicci Archive inline
70
+ hgoblet fn morning-bell # enter Morning Bell inline
71
+ hgoblet fn flu0 --tui # explicit upstream full-screen app
72
+ hgoblet run --tui # explicit upstream full-screen launcher
73
+ ```
74
+
75
+ ## Jade Dojo is the default
76
+
77
+ The upstream MProcs launchers start on **Morning Bell** (`morn`). hgoblet
78
+ deliberately starts on **Jade Dojo** (`Dojical`) instead.
79
+
80
+ Use `hgoblet fn morning-bell` (or type `morning-bell` in the prompt) when you
81
+ actually want `morn`.
82
+
83
+ ## Install
84
+
85
+ ```bash
86
+ cd BDCS/hgoblet
87
+ python3 -m pip install .
88
+ # or, on a PEP 668 managed system:
89
+ python3 -m pip install --break-system-packages .
90
+ # or isolated:
91
+ pipx install .
92
+ ```
93
+
94
+ This installs three commands:
95
+
96
+ - `hgoblet` — the line-only terminal (directly opens the active suite's default)
97
+ - `hgo` — the same entry point
98
+ - `mp` — a friendly short command for MProcs (see below)
99
+
100
+ Requirements: Python 3.8+. A curses-capable terminal is only required for
101
+ `hgoblet tui` and the explicitly opted-in full-screen apps. No runtime
102
+ dependencies.
103
+
104
+ ## Quick start
105
+
106
+ ```bash
107
+ hgoblet # directly open the line-only default terminal
108
+ hgoblet shell # open hgoblet's own command prompt
109
+ hgoblet tui # open the upstream full-screen switchboard
110
+ hgoblet detect # list every installation found
111
+ hgoblet status # active suite + installation summary
112
+ hgoblet shift # rotate fumuda -> mprocs -> nanuska -> fumuda
113
+ hgoblet use ngp # make Nanuska-GP active
114
+ hgoblet line # enter line-only Jade Dojo
115
+ hgoblet line mdcci # enter Medicci Archive inline
116
+ hgoblet run # same as `hgoblet line` (Jade Dojo)
117
+ hgoblet run --tui # open the upstream full-screen launcher
118
+ hgoblet functions --all # list line-supported and upstream-only functions
119
+ hgoblet fn polyhistor # line-error: upstream-only; add --tui to open it
120
+ hgoblet user snowtiger # set the username used by every suite
121
+ ```
122
+
123
+ Command-specific examples:
124
+
125
+ ```bash
126
+ hgoblet which mprocs # /usr/bin/MProcs (or the real path)
127
+ hgoblet which --plan # show hgoblet's launch plans
128
+ hgoblet run nanuska -- -u zeta # raw-style invocation; records --user
129
+ hgoblet run mprocs --raw # run MProcs bare
130
+ hgoblet run --tui # upstream launcher, Jade Dojo selected
131
+ hgoblet fn --suite fxy mdcci # enter Fumuda-XY on Medicci Archive
132
+ hgoblet fn --suite ngp flu0 --tui # open upstream FLU0 explicitly
133
+ hgoblet functions nanuska --json # machine-readable function list
134
+ hgoblet functions --all --json # every suite, line availability included
135
+ hgoblet status --json # machine-readable detection result
136
+ ```
137
+
138
+ ## Commands
139
+
140
+ | command | what it does |
141
+ | --- | --- |
142
+ | `hgoblet` | directly open the line-only default terminal; show status when not interactive |
143
+ | `hgoblet shell` / `terminal` / `repl` / `basic` | open hgoblet's own command prompt |
144
+ | `hgoblet line [function]` / `inline` | enter the line-only runtime for Jade Dojo or one function |
145
+ | `hgoblet tui` / `hub` | open the upstream switchboard TUI explicitly |
146
+ | `hgoblet detect` / `list` / `scan` | find installations (all copies, not just the best one) |
147
+ | `hgoblet status` | active suite, username, and one line per suite |
148
+ | `hgoblet user [name]` / `username` | show or set the global terminal username |
149
+ | `hgoblet use <suite>` | save the active suite (`fumuda`, `mprocs`, `nanuska`, or an alias) |
150
+ | `hgoblet shift [next\|prev\|suite]` | rotate or switch the active suite |
151
+ | `hgoblet which [suite]` | print terminal, focus, enter and line plans; `--plan` included |
152
+ | `hgoblet functions [suite]` / `fns` | list functions and line availability; `--all` shows every suite |
153
+ | `hgoblet fn [function]` / `focus` | enter a function inline; upstream-only functions require `--tui` |
154
+ | `hgoblet run [suite]` | enter the line-only default terminal; `--tui` opens upstream launcher |
155
+ | `hgoblet version` | print the hgoblet version |
156
+
157
+ `--enter` remains available on `run` and `fn` for compatibility with the
158
+ upstream plans. Upstream full-screen behavior is always explicit: use `--tui`.
159
+ `--raw` runs the bare suite and cannot be combined with `--tui`.
160
+
161
+ Global JSON is available on `detect`, `status`, `shift`, `which`,
162
+ `functions`, and `user`. `--print` on `run`/`fn` shows the command without
163
+ executing it.
164
+
165
+ ## Upstream TUI keys (explicit opt-in)
166
+
167
+ These keys apply only to `hgoblet tui`, `hgoblet run --tui`, and
168
+ `hgoblet fn <function> --tui`.
169
+
170
+ | key | action |
171
+ | --- | --- |
172
+ | `↑` / `↓` | move in the focused pane |
173
+ | `Tab`, `←`, `→` | switch between the suites and functions panes |
174
+ | `Enter` | on a function: enter it directly; on a suite: open its launcher |
175
+ | `e` | enter the selected suite's default terminal (Jade Dojo) |
176
+ | `s` | shift to the next installed suite |
177
+ | `u` | make the highlighted suite active |
178
+ | `r` | rescan the machine |
179
+ | `d` | details for the highlighted suite/function |
180
+ | `?` / `h` | help |
181
+ | `q` | quit |
182
+
183
+ `Esc` closes an overlay. The footer always shows the most useful keys.
184
+
185
+ ## The line-only terminal
186
+
187
+ A bare `hgoblet` execs the active suite's line-only default terminal
188
+ directly. It does not print an hgoblet banner, launch a menu, or open a
189
+ full-screen application implicitly. The suite's own prompt is all you see:
190
+
191
+ ```text
192
+ st ( zeta ) $
193
+ ```
194
+
195
+ The active suite is intentionally not printed next to the prompt. Type `exit`
196
+ to return to your OS shell.
197
+
198
+ Use `hgoblet shell` when you want hgoblet's own meta-command prompt. It
199
+ provides the same switch and utility commands:
200
+
201
+ ```text
202
+ st ( zeta ) $ fxy # make Fumuda-XY active
203
+ st ( zeta ) $ mp # make MProcs active
204
+ st ( zeta ) $ ngp # make Nanuska-GP active
205
+ st ( zeta ) $ mdcci # enter Medicci Archive inline
206
+ st ( zeta ) $ fxy mdcci # select Fumuda-XY and enter Medicci inline
207
+ st ( zeta ) $ mp mdcci # select MProcs and enter Medicci inline
208
+ st ( zeta ) $ ngp functions
209
+ st ( zeta ) $ enter # enter Jade Dojo inline
210
+ st ( zeta ) $ all # list functions for all suites
211
+ st ( zeta ) $ status
212
+ st ( zeta ) $ user polar
213
+ st ( zeta ) $ ! ls -la
214
+ st ( zeta ) $ exit
215
+ ```
216
+
217
+ ### Function registry
218
+
219
+ `functions` shows the active suite. `functions all` (or `all`) shows every
220
+ installed suite and marks each function as `line` or `tui`:
221
+
222
+ ```text
223
+ Fumuda-XY // v10.12.1
224
+ line 1 mdcci
225
+ line 2 neonbunny
226
+ ...
227
+ tui f flu0
228
+ ```
229
+
230
+ Line functions are:
231
+
232
+ `mdcci`, `neonbunny`, `jade-dojo`, `bumerang`, `alokate`, `monk-rpg`,
233
+ `morning-bell`, `destiny`, `vanilla`.
234
+
235
+ `gwf`, `polyhistor`, `flu0`, and `jade-wire` remain upstream full-screen
236
+ terminals. Type `fn flu0 --tui` or `hgoblet fn flu0 --tui` to open one
237
+ explicitly.
238
+
239
+ The three suites expose the same command language, so an installed function is
240
+ available everywhere:
241
+
242
+ ```text
243
+ fxy mdcci mp mdcci ngp mdcci
244
+ fxy morning-bell mp morning-bell ngp morning-bell
245
+ ```
246
+
247
+ Useful commands:
248
+
249
+ | command | action |
250
+ | --- | --- |
251
+ | `fumuda-xy` / `fumuda` / `fxy` | make Fumuda-XY active |
252
+ | `mprocs` / `mp` | make MProcs active |
253
+ | `nanuska-gp` / `nanuska` / `ngp` | make Nanuska-GP active |
254
+ | `fxy FUNCTION` / `mp FUNCTION` / `ngp FUNCTION` | select a suite and enter inline |
255
+ | `fxy functions` | list Fumuda-XY's functions |
256
+ | `enter [suite]` / `run [suite]` | enter the suite's line-only Jade Dojo |
257
+ | `fn [function]` / `focus` | enter a line-supported function inline |
258
+ | `functions [filter]` / `fns` | list the active suite; `functions all` lists all suites |
259
+ | `all` | shorthand for `functions all` |
260
+ | `tui [suite]` / `menu [suite]` | explicitly open the upstream full-screen launcher |
261
+ | `status` / `st` | active suite, username, and installations |
262
+ | `suites` / `list` / `ls` | list suites and inline aliases |
263
+ | `which [suite]` | show raw, focus, enter and line plans |
264
+ | `detect` / `scan` / `refresh` | rescan the machine |
265
+ | `shift [next\|prev]` | rotate the active suite |
266
+ | `use <suite>` | another way to switch the active suite |
267
+ | `user [name]` / `username` | show or set the global username |
268
+ | `cd <dir>` / `pwd` | change directory |
269
+ | `! <command>` | run a shell command |
270
+ | `help` / `?` | show help |
271
+ | `exit` / `quit` / `q` | leave hgoblet's prompt (or the direct terminal) |
272
+
273
+ `switch` is deliberately left to the suites themselves (their recording /
274
+ passive-terminal switch). In hgoblet's prompt and inside a line terminal,
275
+ switch suites with the aliases above.
276
+
277
+ ### One username everywhere
278
+
279
+ The username is global. Setting it in one place changes it for hgoblet and for
280
+ every suite launched afterwards:
281
+
282
+ ```bash
283
+ hgoblet user snowtiger
284
+ ```
285
+
286
+ Inside the basic terminal, `user snowtiger` does the same. Inside a suite,
287
+ `user snowtiger` or `username snowtiger` is recorded back to hgoblet, so the
288
+ next suite prompt and the basic terminal prompt both show `snowtiger`. The
289
+ value is stored in hgoblet's config and passed to each suite through
290
+ `HGOBLET_USERNAME`. An explicit `-u` / `--user` flag on `hgoblet run`,
291
+ `hgoblet fn`, or `mp` also updates the global username. `--raw` still runs
292
+ the bare command without hgoblet's in-terminal alias hook, but an explicit
293
+ `--user` value is recorded globally.
294
+
295
+ `change username <name>` is also accepted. hgoblet normalizes it before
296
+ handing it to the suite because upstream's multi-word parser otherwise reads
297
+ the literal word `username` as the new name.
298
+
299
+ ## Switching from inside a terminal
300
+
301
+ Once a suite's line runtime was opened through hgoblet (`line`, `run`,
302
+ `fn`, `mp`, or a suite-prefixed function), type one of these aliases at its
303
+ prompt and press Enter:
304
+
305
+ ```text
306
+ fumuda-xy fumuda fxy -> Fumuda-XY (Japanese)
307
+ mprocs mp -> MProcs (English)
308
+ nanuska-gp nanuska ngp -> Nanuska-GP (Russian)
309
+ ```
310
+
311
+ The current suite exits and the target suite starts **inside the same terminal
312
+ window**, in the same function. No `[hgoblet]` banner or switch notification is
313
+ printed. The active suite and the current username are recorded in the config.
314
+ Localized aliases such as `FXY`, `MProcs`, `NGP` and `нгп` work too.
315
+
316
+ hgoblet does **not** take over the suite's own `switch` command: that remains
317
+ the upstream recording/passive-terminal switch. Switching suites uses the
318
+ suite aliases above instead. The alias hook only exists in terminals launched
319
+ by hgoblet; `--raw` deliberately runs the bare command without it. The
320
+ upstream full-screen terminals are opened only when you pass `--tui`.
321
+
322
+ ## How detection works
323
+
324
+ hgoblet does not import a suite into its own process. It:
325
+
326
+ 1. scans `$PATH`, `~/.local/bin`, `~/bin`, `/usr/local/bin`, `/usr/bin`,
327
+ `/bin`, Homebrew's bin, common pipx venv bins, and any directory in
328
+ `HGOBLET_SCAN_PATH`;
329
+ 2. looks for each suite's short and long console names (`fxy`, `Fumuda-XY`,
330
+ `mp`, `mprocs`, `ngp`, `nanuska-gp`, localized aliases, …);
331
+ 3. reads the Python interpreter from the command's shebang and asks **that**
332
+ interpreter for the distribution version and package location;
333
+ 4. falls back to `python -m <package>` when a suite is importable in the
334
+ current interpreter but has no console script;
335
+ 5. ignores commands that merely share a name but cannot prove they belong to
336
+ the suite.
337
+
338
+ Long aliases are shown as aliases, for example `mp>MProcs` when only the
339
+ capitalized MProcs script exists. Multiple installations of the same suite are
340
+ kept and ranked: short command first, then `$PATH` order.
341
+
342
+ ## How the line runtime works
343
+
344
+ The nine shared LPRO terminals are launched through a small line bootstrap:
345
+
346
+ ```text
347
+ $XDG_CACHE_HOME/hgoblet/line_bootstrap.py (usually ~/.cache/hgoblet/)
348
+ ```
349
+
350
+ The bootstrap:
351
+
352
+ - imports the suite's `lpro` / `lpro_s` command engines;
353
+ - starts with the global username from hgoblet's config;
354
+ - uses the same `st ( user ) $` prompt in every suite;
355
+ - runs the command language directly, without a curses launcher;
356
+ - sets the upstream `morn` swap only for `morning-bell`;
357
+ - intercepts `exit` to return to hgoblet;
358
+ - intercepts suite aliases to switch the active suite inline;
359
+ - records `user`, `username`, and `change username` back to hgoblet.
360
+
361
+ `gwf`, `polyhistor`, `flu0`, and `jade-wire` are not line-portable upstream
362
+ terminals. `--tui` writes a separate bootstrap:
363
+
364
+ ```text
365
+ $XDG_CACHE_HOME/hgoblet/focus_bootstrap.py
366
+ ```
367
+
368
+ That bootstrap imports the selected suite's own TUI and patches `_default_index`,
369
+ `_main_loop`, and `_make_input` to open or focus one upstream wrapper.
370
+
371
+ Function names are canonical across suites (`mdcci`, `jade-dojo`,
372
+ `polyhistor`, `flu0`, `jade-wire`, …), while the labels and descriptions come
373
+ from the installed suite, so a Japanese Fumuda-XY and a Russian Nanuska-GP
374
+ are both readable.
375
+
376
+ ## The `mp` shim
377
+
378
+ `mp` is installed by hgoblet because MProcs' own console script is the
379
+ capitalized `MProcs` on many systems. It is deliberately simple:
380
+
381
+ - interactive, no arguments: find MProcs, skipping hgoblet's own `mp` script,
382
+ and open its line-only Jade Dojo terminal;
383
+ - `mp --tui`: explicitly open the upstream full-screen launcher;
384
+ - with other arguments or without a TTY: run MProcs normally, e.g.
385
+ `mp --version`, `mp --list`, `mp --user zeta`; an explicit `--user`
386
+ also updates the global username;
387
+ - if MProcs cannot be found: print the install hint and exit 127.
388
+
389
+ The detector ignores console scripts that contain `hgoblet.cli`, so the shim
390
+ can never select and exec itself.
391
+
392
+ ## Config
393
+
394
+ The active suite, global username, and recent handoffs are stored in:
395
+
396
+ ```text
397
+ $HGOBLET_CONFIG
398
+ or $XDG_CONFIG_HOME/hgoblet/config.json
399
+ or ~/.config/hgoblet/config.json
400
+ ```
401
+
402
+ Example:
403
+
404
+ ```json
405
+ {
406
+ "active": "fumuda",
407
+ "username": "zeta",
408
+ "history": [
409
+ {"suite": "nanuska", "function": "polyhistor"},
410
+ {"suite": "fumuda"}
411
+ ],
412
+ "version": 1
413
+ }
414
+ ```
415
+
416
+ A missing or corrupt config falls back to `fumuda` and the username `zeta`.
417
+ Writes are atomic.
418
+
419
+ ## Development
420
+
421
+ ```bash
422
+ cd BDCS/hgoblet
423
+ PYTHONPATH=src python3 -m unittest discover -s tests -v
424
+ python3 -m build
425
+ ```
426
+
427
+ Layout:
428
+
429
+ ```text
430
+ src/hgoblet/
431
+ ├── catalog.py # the three suites, aliases, default
432
+ ├── model.py # Installation / Discovery / Function / LaunchPlan
433
+ ├── detect.py # PATH, pipx and interpreter probing
434
+ ├── functions.py # canonical function table + localized probe
435
+ ├── launch.py # terminal / focus / line plans and bootstraps
436
+ ├── config.py # active suite, global username, history
437
+ ├── shell.py # line-only inline terminal and command registry
438
+ ├── tui.py # upstream switchboard TUI (explicit opt-in)
439
+ └── cli.py # argparse commands
440
+ ```
441
+
442
+ ## License
443
+
444
+ MIT. See `LICENSE`.