@elaraai/e3-ui-cli 1.0.72 → 1.0.73
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 +46 -21
- package/dist/app/assets/{engine-BKZbmXkC-DmcCFcnb.js → engine-Bm-cIDd_-DwUdGcTZ.js} +1 -1
- package/dist/app/assets/{index-BJNWHnRv.js → index-mj-YVVN1.js} +91 -91
- package/dist/app/index.html +1 -1
- package/dist/cli.js +36 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/tui.d.ts +84 -0
- package/dist/commands/tui.d.ts.map +1 -0
- package/dist/commands/tui.js +86 -0
- package/dist/commands/tui.js.map +1 -0
- package/dist/tui/api.d.ts +108 -0
- package/dist/tui/api.d.ts.map +1 -0
- package/dist/tui/api.js +130 -0
- package/dist/tui/api.js.map +1 -0
- package/dist/tui/app.d.ts +23 -0
- package/dist/tui/app.d.ts.map +1 -0
- package/dist/tui/app.js +241 -0
- package/dist/tui/app.js.map +1 -0
- package/dist/tui/controller.d.ts +116 -0
- package/dist/tui/controller.d.ts.map +1 -0
- package/dist/tui/controller.js +620 -0
- package/dist/tui/controller.js.map +1 -0
- package/dist/tui/data/dataflow.d.ts +68 -0
- package/dist/tui/data/dataflow.d.ts.map +1 -0
- package/dist/tui/data/dataflow.js +137 -0
- package/dist/tui/data/dataflow.js.map +1 -0
- package/dist/tui/data/dataset.d.ts +80 -0
- package/dist/tui/data/dataset.d.ts.map +1 -0
- package/dist/tui/data/dataset.js +297 -0
- package/dist/tui/data/dataset.js.map +1 -0
- package/dist/tui/data/edit-buffer.d.ts +74 -0
- package/dist/tui/data/edit-buffer.d.ts.map +1 -0
- package/dist/tui/data/edit-buffer.js +120 -0
- package/dist/tui/data/edit-buffer.js.map +1 -0
- package/dist/tui/data/feeds.d.ts +45 -0
- package/dist/tui/data/feeds.d.ts.map +1 -0
- package/dist/tui/data/feeds.js +318 -0
- package/dist/tui/data/feeds.js.map +1 -0
- package/dist/tui/data/logs.d.ts +68 -0
- package/dist/tui/data/logs.d.ts.map +1 -0
- package/dist/tui/data/logs.js +134 -0
- package/dist/tui/data/logs.js.map +1 -0
- package/dist/tui/input/commands.d.ts +159 -0
- package/dist/tui/input/commands.d.ts.map +1 -0
- package/dist/tui/input/commands.js +259 -0
- package/dist/tui/input/commands.js.map +1 -0
- package/dist/tui/input/completion.d.ts +63 -0
- package/dist/tui/input/completion.d.ts.map +1 -0
- package/dist/tui/input/completion.js +128 -0
- package/dist/tui/input/completion.js.map +1 -0
- package/dist/tui/input/keymap.d.ts +153 -0
- package/dist/tui/input/keymap.d.ts.map +1 -0
- package/dist/tui/input/keymap.js +206 -0
- package/dist/tui/input/keymap.js.map +1 -0
- package/dist/tui/input/mouse.d.ts +52 -0
- package/dist/tui/input/mouse.d.ts.map +1 -0
- package/dist/tui/input/mouse.js +55 -0
- package/dist/tui/input/mouse.js.map +1 -0
- package/dist/tui/lifecycle.d.ts +61 -0
- package/dist/tui/lifecycle.d.ts.map +1 -0
- package/dist/tui/lifecycle.js +99 -0
- package/dist/tui/lifecycle.js.map +1 -0
- package/dist/tui/model/catalogue.d.ts +28 -0
- package/dist/tui/model/catalogue.d.ts.map +1 -0
- package/dist/tui/model/catalogue.js +94 -0
- package/dist/tui/model/catalogue.js.map +1 -0
- package/dist/tui/model/help.d.ts +37 -0
- package/dist/tui/model/help.d.ts.map +1 -0
- package/dist/tui/model/help.js +210 -0
- package/dist/tui/model/help.js.map +1 -0
- package/dist/tui/model/index.d.ts +42 -0
- package/dist/tui/model/index.d.ts.map +1 -0
- package/dist/tui/model/index.js +50 -0
- package/dist/tui/model/index.js.map +1 -0
- package/dist/tui/model/status.d.ts +88 -0
- package/dist/tui/model/status.d.ts.map +1 -0
- package/dist/tui/model/status.js +137 -0
- package/dist/tui/model/status.js.map +1 -0
- package/dist/tui/model/tree.d.ts +112 -0
- package/dist/tui/model/tree.d.ts.map +1 -0
- package/dist/tui/model/tree.js +178 -0
- package/dist/tui/model/tree.js.map +1 -0
- package/dist/tui/model/types.d.ts +21 -0
- package/dist/tui/model/types.d.ts.map +1 -0
- package/dist/tui/model/types.js +46 -0
- package/dist/tui/model/types.js.map +1 -0
- package/dist/tui/render/glyphs.d.ts +122 -0
- package/dist/tui/render/glyphs.d.ts.map +1 -0
- package/dist/tui/render/glyphs.js +122 -0
- package/dist/tui/render/glyphs.js.map +1 -0
- package/dist/tui/render/layout.d.ts +145 -0
- package/dist/tui/render/layout.d.ts.map +1 -0
- package/dist/tui/render/layout.js +209 -0
- package/dist/tui/render/layout.js.map +1 -0
- package/dist/tui/render/text.d.ts +149 -0
- package/dist/tui/render/text.d.ts.map +1 -0
- package/dist/tui/render/text.js +288 -0
- package/dist/tui/render/text.js.map +1 -0
- package/dist/tui/render/theme.d.ts +88 -0
- package/dist/tui/render/theme.d.ts.map +1 -0
- package/dist/tui/render/theme.js +145 -0
- package/dist/tui/render/theme.js.map +1 -0
- package/dist/tui/session.d.ts +78 -0
- package/dist/tui/session.d.ts.map +1 -0
- package/dist/tui/session.js +237 -0
- package/dist/tui/session.js.map +1 -0
- package/dist/tui/state/actions.d.ts +584 -0
- package/dist/tui/state/actions.d.ts.map +1 -0
- package/dist/tui/state/actions.js +62 -0
- package/dist/tui/state/actions.js.map +1 -0
- package/dist/tui/state/persist.d.ts +114 -0
- package/dist/tui/state/persist.d.ts.map +1 -0
- package/dist/tui/state/persist.js +187 -0
- package/dist/tui/state/persist.js.map +1 -0
- package/dist/tui/state/poll.d.ts +99 -0
- package/dist/tui/state/poll.d.ts.map +1 -0
- package/dist/tui/state/poll.js +160 -0
- package/dist/tui/state/poll.js.map +1 -0
- package/dist/tui/state/reducer.d.ts +16 -0
- package/dist/tui/state/reducer.d.ts.map +1 -0
- package/dist/tui/state/reducer.js +363 -0
- package/dist/tui/state/reducer.js.map +1 -0
- package/dist/tui/state/store.d.ts +37 -0
- package/dist/tui/state/store.d.ts.map +1 -0
- package/dist/tui/state/store.js +84 -0
- package/dist/tui/state/store.js.map +1 -0
- package/dist/tui/suspend.d.ts +17 -0
- package/dist/tui/suspend.d.ts.map +1 -0
- package/dist/tui/suspend.js +33 -0
- package/dist/tui/suspend.js.map +1 -0
- package/dist/tui/ui/App.d.ts +41 -0
- package/dist/tui/ui/App.d.ts.map +1 -0
- package/dist/tui/ui/App.js +92 -0
- package/dist/tui/ui/App.js.map +1 -0
- package/dist/tui/ui/frame.d.ts +86 -0
- package/dist/tui/ui/frame.d.ts.map +1 -0
- package/dist/tui/ui/frame.js +42 -0
- package/dist/tui/ui/frame.js.map +1 -0
- package/dist/tui/ui/lines.d.ts +92 -0
- package/dist/tui/ui/lines.d.ts.map +1 -0
- package/dist/tui/ui/lines.js +94 -0
- package/dist/tui/ui/lines.js.map +1 -0
- package/dist/tui/ui/shell/chrome.d.ts +61 -0
- package/dist/tui/ui/shell/chrome.d.ts.map +1 -0
- package/dist/tui/ui/shell/chrome.js +272 -0
- package/dist/tui/ui/shell/chrome.js.map +1 -0
- package/dist/tui/ui/shell/widgets.d.ts +75 -0
- package/dist/tui/ui/shell/widgets.d.ts.map +1 -0
- package/dist/tui/ui/shell/widgets.js +160 -0
- package/dist/tui/ui/shell/widgets.js.map +1 -0
- package/dist/tui/ui/views/about.d.ts +20 -0
- package/dist/tui/ui/views/about.d.ts.map +1 -0
- package/dist/tui/ui/views/about.js +40 -0
- package/dist/tui/ui/views/about.js.map +1 -0
- package/dist/tui/ui/views/all.d.ts +17 -0
- package/dist/tui/ui/views/all.d.ts.map +1 -0
- package/dist/tui/ui/views/all.js +17 -0
- package/dist/tui/ui/views/all.js.map +1 -0
- package/dist/tui/ui/views/dashboard.d.ts +156 -0
- package/dist/tui/ui/views/dashboard.d.ts.map +1 -0
- package/dist/tui/ui/views/dashboard.js +599 -0
- package/dist/tui/ui/views/dashboard.js.map +1 -0
- package/dist/tui/ui/views/help.d.ts +17 -0
- package/dist/tui/ui/views/help.d.ts.map +1 -0
- package/dist/tui/ui/views/help.js +65 -0
- package/dist/tui/ui/views/help.js.map +1 -0
- package/dist/tui/ui/views/index.d.ts +42 -0
- package/dist/tui/ui/views/index.d.ts.map +1 -0
- package/dist/tui/ui/views/index.js +42 -0
- package/dist/tui/ui/views/index.js.map +1 -0
- package/dist/tui/ui/views/input.d.ts +6 -0
- package/dist/tui/ui/views/input.d.ts.map +1 -0
- package/dist/tui/ui/views/input.js +494 -0
- package/dist/tui/ui/views/input.js.map +1 -0
- package/dist/tui/ui/views/launch.d.ts +16 -0
- package/dist/tui/ui/views/launch.d.ts.map +1 -0
- package/dist/tui/ui/views/launch.js +43 -0
- package/dist/tui/ui/views/launch.js.map +1 -0
- package/dist/tui/ui/views/refusal.d.ts +20 -0
- package/dist/tui/ui/views/refusal.d.ts.map +1 -0
- package/dist/tui/ui/views/refusal.js +47 -0
- package/dist/tui/ui/views/refusal.js.map +1 -0
- package/dist/tui/ui/views/repos.d.ts +10 -0
- package/dist/tui/ui/views/repos.d.ts.map +1 -0
- package/dist/tui/ui/views/repos.js +93 -0
- package/dist/tui/ui/views/repos.js.map +1 -0
- package/dist/tui/ui/views/task.d.ts +17 -0
- package/dist/tui/ui/views/task.d.ts.map +1 -0
- package/dist/tui/ui/views/task.js +309 -0
- package/dist/tui/ui/views/task.js.map +1 -0
- package/dist/tui/ui/views/wordmark.d.ts +15 -0
- package/dist/tui/ui/views/wordmark.d.ts.map +1 -0
- package/dist/tui/ui/views/wordmark.js +50 -0
- package/dist/tui/ui/views/wordmark.js.map +1 -0
- package/dist/tui/ui/views/workspaces.d.ts +17 -0
- package/dist/tui/ui/views/workspaces.d.ts.map +1 -0
- package/dist/tui/ui/views/workspaces.js +127 -0
- package/dist/tui/ui/views/workspaces.js.map +1 -0
- package/dist/tui/ui/widgets/leaf-editor.d.ts +58 -0
- package/dist/tui/ui/widgets/leaf-editor.d.ts.map +1 -0
- package/dist/tui/ui/widgets/leaf-editor.js +119 -0
- package/dist/tui/ui/widgets/leaf-editor.js.map +1 -0
- package/dist/tui/ui/widgets/logs.d.ts +99 -0
- package/dist/tui/ui/widgets/logs.d.ts.map +1 -0
- package/dist/tui/ui/widgets/logs.js +291 -0
- package/dist/tui/ui/widgets/logs.js.map +1 -0
- package/dist/tui/ui/widgets/reads.d.ts +62 -0
- package/dist/tui/ui/widgets/reads.d.ts.map +1 -0
- package/dist/tui/ui/widgets/reads.js +122 -0
- package/dist/tui/ui/widgets/reads.js.map +1 -0
- package/dist/tui/ui/widgets/runs.d.ts +51 -0
- package/dist/tui/ui/widgets/runs.d.ts.map +1 -0
- package/dist/tui/ui/widgets/runs.js +86 -0
- package/dist/tui/ui/widgets/runs.js.map +1 -0
- package/dist/tui/ui/widgets/tree.d.ts +149 -0
- package/dist/tui/ui/widgets/tree.d.ts.map +1 -0
- package/dist/tui/ui/widgets/tree.js +584 -0
- package/dist/tui/ui/widgets/tree.js.map +1 -0
- package/package.json +22 -12
package/dist/app/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>e3-ui shot</title>
|
|
7
|
-
<script type="module" crossorigin src="./assets/index-
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-mj-YVVN1.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="./assets/index-CYR-0Grb.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
package/dist/cli.js
CHANGED
|
@@ -3,10 +3,21 @@
|
|
|
3
3
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* e3-ui CLI — render east-ui /
|
|
6
|
+
* e3-ui CLI — browse an e3 repository in the terminal, and render east-ui /
|
|
7
|
+
* e3-ui components to PNG.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* With no subcommand, `e3-ui [repo] [workspace]` opens the full-screen
|
|
10
|
+
* terminal UI over a local repository (an embedded `@elaraai/e3-api-server`)
|
|
11
|
+
* or a remote one (`https://host/repos/<repo>` with the token `e3 auth login`
|
|
12
|
+
* saved; a bare `https://host` opens the repository list):
|
|
13
|
+
*
|
|
14
|
+
* e3-ui $E3_REPO or ".", the last-used workspace
|
|
15
|
+
* e3-ui ./repo main -t forecast open a task on start
|
|
16
|
+
* e3-ui https://host/repos/demo a remote repository
|
|
17
|
+
* e3-ui auth login https://host the same device flow + store as `e3 auth`
|
|
18
|
+
*
|
|
19
|
+
* The screenshot verbs are unchanged — one `shot` verb, three `--from-*`
|
|
20
|
+
* sources (mirroring e3-cli's `--from-zip` / `--from-source`):
|
|
10
21
|
* e3-ui shot --from-source <file.tsx> a TS/TSX component
|
|
11
22
|
* e3-ui shot --from-ir <file.beast2|.json> serialized component IR
|
|
12
23
|
* e3-ui shot --from-task <ws.task> --repo <r> a live e3 task's output (dataflow must have run)
|
|
@@ -15,12 +26,18 @@
|
|
|
15
26
|
* e3-ui install-browser [--with-deps] download the managed headless Chromium
|
|
16
27
|
* e3-ui doctor diagnose the browser setup
|
|
17
28
|
*
|
|
29
|
+
* `--help` / `--version` and the non-TTY refusal never load the terminal UI
|
|
30
|
+
* (Ink is imported lazily by `commands/tui.ts`), so scripts and the release
|
|
31
|
+
* smoke keep an instant, browser-free `e3-ui --version`.
|
|
32
|
+
*
|
|
18
33
|
* @packageDocumentation
|
|
19
34
|
*/
|
|
20
35
|
import { createRequire } from 'node:module';
|
|
21
36
|
import { Command } from 'commander';
|
|
37
|
+
import { createAuthCommand } from '@elaraai/e3-cli/internal';
|
|
22
38
|
import { shotCommand } from './commands/shot.js';
|
|
23
39
|
import { shotsCommand } from './commands/shots.js';
|
|
40
|
+
import { tuiCommand } from './commands/tui.js';
|
|
24
41
|
import { installBrowser, doctor } from './browser.js';
|
|
25
42
|
import { CAPTURE_DEFAULTS as D } from './capture.js';
|
|
26
43
|
const require = createRequire(import.meta.url);
|
|
@@ -28,8 +45,22 @@ const packageJson = require('../package.json');
|
|
|
28
45
|
const program = new Command();
|
|
29
46
|
program
|
|
30
47
|
.name('e3-ui')
|
|
31
|
-
.description('
|
|
32
|
-
.version(packageJson.version)
|
|
48
|
+
.description('Browse an e3 repository in the terminal: workspaces, dataflow, task outputs, logs and editable inputs.')
|
|
49
|
+
.version(packageJson.version)
|
|
50
|
+
// The root action — the terminal UI. Subcommand names win over a
|
|
51
|
+
// positional repo (commander semantics): a repository literally named
|
|
52
|
+
// `shot` is opened as `./shot`.
|
|
53
|
+
.argument('[repo]', 'local path · https://host/repos/<repo> · https://host (repo list) (default: $E3_REPO or ".")')
|
|
54
|
+
.argument('[workspace]', 'workspace to open (default: last used, else the only one, else the list)')
|
|
55
|
+
.option('-t, --task <name>', 'open a task on start')
|
|
56
|
+
.option('-i, --input <name>', 'open an input on start')
|
|
57
|
+
.option('--no-mouse', 'disable mouse reporting')
|
|
58
|
+
.option('--ascii', 'box-drawing off (also E3_UI_ASCII=1) · colour honours NO_COLOR / FORCE_COLOR')
|
|
59
|
+
.action(tuiCommand);
|
|
60
|
+
// `auth` is e3-cli's own command group, mounted unchanged, so the credential
|
|
61
|
+
// store, refresh margin and device flow cannot drift between the two binaries.
|
|
62
|
+
program.addCommand(createAuthCommand()
|
|
63
|
+
.description('login / logout / status / token / whoami — same store as `e3 auth` (~/.e3/credentials.json)'));
|
|
33
64
|
program
|
|
34
65
|
.command('shot')
|
|
35
66
|
.description('Render an east-ui / e3-ui component to a PNG — from a source file, serialized IR, or a live e3 task')
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C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@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* `e3-ui [repo] [workspace]` — the root action: resolve the options, refuse a
|
|
7
|
+
* non-interactive terminal with a pointer to the scriptable `e3` commands,
|
|
8
|
+
* then load the terminal UI.
|
|
9
|
+
*
|
|
10
|
+
* Ink is imported lazily (`await import('../tui/app.js')`) so `--help`,
|
|
11
|
+
* `--version` and the non-TTY refusal never load it: `e3-ui --version` stays
|
|
12
|
+
* instant and TTY-free (the release smoke), and a script that pipes `e3-ui`
|
|
13
|
+
* gets today's help-on-stderr / exit-1 contract instead of a hung screen.
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
/** Options commander hands the root action (camel-cased flags). */
|
|
18
|
+
export interface TuiCommandOptions {
|
|
19
|
+
task?: string;
|
|
20
|
+
input?: string;
|
|
21
|
+
/** `--no-mouse` → false; default true. */
|
|
22
|
+
mouse?: boolean;
|
|
23
|
+
ascii?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** The resolved options the terminal UI starts from. */
|
|
26
|
+
export interface TuiOptions {
|
|
27
|
+
/** The repository argument: a local path, `https://host/repos/<repo>`, or a bare `https://host`. */
|
|
28
|
+
repo: string;
|
|
29
|
+
/** The workspace to open, when given. */
|
|
30
|
+
workspace: string | undefined;
|
|
31
|
+
/** A task to open on start (mutually exclusive with `input`). */
|
|
32
|
+
task: string | undefined;
|
|
33
|
+
/** An input to open on start (mutually exclusive with `task`). */
|
|
34
|
+
input: string | undefined;
|
|
35
|
+
/** Whether mouse reporting is enabled. */
|
|
36
|
+
mouse: boolean;
|
|
37
|
+
/** Whether box-drawing is off (`--ascii` or `E3_UI_ASCII=1`). */
|
|
38
|
+
ascii: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Resolves the root action's arguments and options into {@link TuiOptions}.
|
|
42
|
+
* Pure: the repository defaults to `$E3_REPO`, then `.` (e3-cli's
|
|
43
|
+
* `defaultRepoArg` rule), `--task` and `--input` are mutually exclusive, and
|
|
44
|
+
* `--ascii` is also switched on by `E3_UI_ASCII=1`.
|
|
45
|
+
*
|
|
46
|
+
* @param repo - The `[repo]` positional, if given
|
|
47
|
+
* @param workspace - The `[workspace]` positional, if given
|
|
48
|
+
* @param options - The parsed flags
|
|
49
|
+
* @param env - The environment (`process.env` in production)
|
|
50
|
+
* @returns The resolved options
|
|
51
|
+
* @throws {Error} When both `--task` and `--input` are given
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseTuiArgs(repo: string | undefined, workspace: string | undefined, options: TuiCommandOptions, env: NodeJS.ProcessEnv): TuiOptions;
|
|
54
|
+
/** The stream surface the TTY gate inspects (injectable for tests). */
|
|
55
|
+
export interface TtyStream {
|
|
56
|
+
isTTY?: boolean | undefined;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Whether the terminal UI can run: both stdin and stdout must be TTYs (raw
|
|
60
|
+
* keyboard input and a full-screen frame need a real terminal on both ends).
|
|
61
|
+
*
|
|
62
|
+
* @param stdin - The input stream
|
|
63
|
+
* @param stdout - The output stream
|
|
64
|
+
* @returns `true` when both are TTYs
|
|
65
|
+
*/
|
|
66
|
+
export declare function isInteractive(stdin: TtyStream, stdout: TtyStream): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* The refusal printed (to stderr) when the terminal is not interactive —
|
|
69
|
+
* a pointer to the scriptable `e3` commands instead of a hung screen.
|
|
70
|
+
*
|
|
71
|
+
* @param stdin - The input stream
|
|
72
|
+
* @param stdout - The output stream
|
|
73
|
+
* @returns The two-line message
|
|
74
|
+
*/
|
|
75
|
+
export declare function nonInteractiveMessage(stdin: TtyStream, stdout: TtyStream): string;
|
|
76
|
+
/**
|
|
77
|
+
* Commander action for the root `e3-ui [repo] [workspace]` command.
|
|
78
|
+
*
|
|
79
|
+
* @param repo - The `[repo]` positional
|
|
80
|
+
* @param workspace - The `[workspace]` positional
|
|
81
|
+
* @param options - The parsed flags
|
|
82
|
+
*/
|
|
83
|
+
export declare function tuiCommand(repo: string | undefined, workspace: string | undefined, options: TuiCommandOptions): Promise<void>;
|
|
84
|
+
//# sourceMappingURL=tui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../../src/commands/tui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,mEAAmE;AACnE,MAAM,WAAW,iBAAiB;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wDAAwD;AACxD,MAAM,WAAW,UAAU;IACvB,oGAAoG;IACpG,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,iEAAiE;IACjE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,kEAAkE;IAClE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,0CAA0C;IAC1C,KAAK,EAAE,OAAO,CAAC;IACf,iEAAiE;IACjE,KAAK,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CACxB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,MAAM,CAAC,UAAU,GACvB,UAAU,CAcZ;AAED,uEAAuE;AACvE,MAAM,WAAW,SAAS;IACtB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAE1E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,CAOjF;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBnI"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the root action's arguments and options into {@link TuiOptions}.
|
|
7
|
+
* Pure: the repository defaults to `$E3_REPO`, then `.` (e3-cli's
|
|
8
|
+
* `defaultRepoArg` rule), `--task` and `--input` are mutually exclusive, and
|
|
9
|
+
* `--ascii` is also switched on by `E3_UI_ASCII=1`.
|
|
10
|
+
*
|
|
11
|
+
* @param repo - The `[repo]` positional, if given
|
|
12
|
+
* @param workspace - The `[workspace]` positional, if given
|
|
13
|
+
* @param options - The parsed flags
|
|
14
|
+
* @param env - The environment (`process.env` in production)
|
|
15
|
+
* @returns The resolved options
|
|
16
|
+
* @throws {Error} When both `--task` and `--input` are given
|
|
17
|
+
*/
|
|
18
|
+
export function parseTuiArgs(repo, workspace, options, env) {
|
|
19
|
+
if (options.task !== undefined && options.input !== undefined) {
|
|
20
|
+
throw new Error('--task and --input are mutually exclusive (open one or the other on start)');
|
|
21
|
+
}
|
|
22
|
+
const envRepo = env['E3_REPO'];
|
|
23
|
+
const ascii = options.ascii === true || env['E3_UI_ASCII'] === '1';
|
|
24
|
+
return {
|
|
25
|
+
repo: repo !== undefined && repo.length > 0 ? repo : (envRepo !== undefined && envRepo.length > 0 ? envRepo : '.'),
|
|
26
|
+
workspace: workspace !== undefined && workspace.length > 0 ? workspace : undefined,
|
|
27
|
+
task: options.task,
|
|
28
|
+
input: options.input,
|
|
29
|
+
mouse: options.mouse !== false,
|
|
30
|
+
ascii,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Whether the terminal UI can run: both stdin and stdout must be TTYs (raw
|
|
35
|
+
* keyboard input and a full-screen frame need a real terminal on both ends).
|
|
36
|
+
*
|
|
37
|
+
* @param stdin - The input stream
|
|
38
|
+
* @param stdout - The output stream
|
|
39
|
+
* @returns `true` when both are TTYs
|
|
40
|
+
*/
|
|
41
|
+
export function isInteractive(stdin, stdout) {
|
|
42
|
+
return stdin.isTTY === true && stdout.isTTY === true;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The refusal printed (to stderr) when the terminal is not interactive —
|
|
46
|
+
* a pointer to the scriptable `e3` commands instead of a hung screen.
|
|
47
|
+
*
|
|
48
|
+
* @param stdin - The input stream
|
|
49
|
+
* @param stdout - The output stream
|
|
50
|
+
* @returns The two-line message
|
|
51
|
+
*/
|
|
52
|
+
export function nonInteractiveMessage(stdin, stdout) {
|
|
53
|
+
const why = stdout.isTTY !== true ? 'stdout is not a TTY' : stdin.isTTY !== true ? 'stdin is not a TTY' : 'not a TTY';
|
|
54
|
+
return [
|
|
55
|
+
`e3-ui: interactive terminal required (${why}).`,
|
|
56
|
+
' scripts: e3 workspace status <repo> <ws> · e3 dataset get <repo> <ws.name> -f json',
|
|
57
|
+
' help: e3-ui --help',
|
|
58
|
+
].join('\n');
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Commander action for the root `e3-ui [repo] [workspace]` command.
|
|
62
|
+
*
|
|
63
|
+
* @param repo - The `[repo]` positional
|
|
64
|
+
* @param workspace - The `[workspace]` positional
|
|
65
|
+
* @param options - The parsed flags
|
|
66
|
+
*/
|
|
67
|
+
export async function tuiCommand(repo, workspace, options) {
|
|
68
|
+
let resolved;
|
|
69
|
+
try {
|
|
70
|
+
resolved = parseTuiArgs(repo, workspace, options, process.env);
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
if (!isInteractive(process.stdin, process.stdout)) {
|
|
77
|
+
console.error(nonInteractiveMessage(process.stdin, process.stdout));
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
// Loaded only here: Ink, React and the views never touch `--help`,
|
|
81
|
+
// `--version`, `shot`, or a non-TTY invocation.
|
|
82
|
+
const { runTui } = await import('../tui/app.js');
|
|
83
|
+
const code = await runTui(resolved);
|
|
84
|
+
process.exit(code);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=tui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tui.js","sourceRoot":"","sources":["../../src/commands/tui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwCH;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CACxB,IAAwB,EACxB,SAA6B,EAC7B,OAA0B,EAC1B,GAAsB;IAEtB,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC5D,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IAClG,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,GAAG,CAAC,aAAa,CAAC,KAAK,GAAG,CAAC;IACnE,OAAO;QACH,IAAI,EAAE,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,KAA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AAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,mEAAmE;IACnE,gDAAgD;IAChD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;IACpC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The `Api` seam — the subset of `@elaraai/e3-api-client` the TUI uses,
|
|
7
|
+
* bound to one session (base URL, repository, a per-request token) so the
|
|
8
|
+
* views and feeds never see transport details, and so the frame specs can
|
|
9
|
+
* substitute an in-memory fake (`api.fake.ts`).
|
|
10
|
+
*
|
|
11
|
+
* Transport is always the e3 HTTP API: an embedded `@elaraai/e3-api-server`
|
|
12
|
+
* for local repositories, `getValidToken()` per request for remote ones —
|
|
13
|
+
* paging, key search and byte budgets come from the server, not a second
|
|
14
|
+
* implementation.
|
|
15
|
+
*
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
*/
|
|
18
|
+
import { type DataflowExecutionState, type DataflowOptions, type DatasetFindQuery, type DatasetFindResult, type DatasetPage, type DatasetPageWindow, type DatasetStatusDetail, type ExecutionListItem, type ListEntry, type LogChunk, type LogOptions, type RepositoryStatus, type TaskDetails, type TaskListItem, type WorkspaceInfo, type WorkspaceStatusResult } from '@elaraai/e3-api-client';
|
|
19
|
+
import { type TreePath, type WorkspaceState } from '@elaraai/e3-types';
|
|
20
|
+
/**
|
|
21
|
+
* A dotted dataset path (`.inputs.sales`, `inputs.sales`, `.tasks.forecast.output`)
|
|
22
|
+
* as a `TreePath` (through e3-types' own URL-path parser).
|
|
23
|
+
*
|
|
24
|
+
* @param path - The dotted path (a leading dot is optional)
|
|
25
|
+
* @returns The tree path
|
|
26
|
+
*/
|
|
27
|
+
export declare function treePathOf(path: string): TreePath;
|
|
28
|
+
/**
|
|
29
|
+
* A `TreePath` as the dotted path the status feed uses (`.inputs.sales`).
|
|
30
|
+
*
|
|
31
|
+
* @param path - The tree path
|
|
32
|
+
* @returns The dotted path with a leading dot
|
|
33
|
+
*/
|
|
34
|
+
export declare function dottedPath(path: TreePath): string;
|
|
35
|
+
/** The e3 API the TUI uses, bound to one session. */
|
|
36
|
+
export interface Api {
|
|
37
|
+
/** Repositories on the origin (bare-origin sessions). */
|
|
38
|
+
repoList(): Promise<string[]>;
|
|
39
|
+
/** A repository's object / package / workspace counts. */
|
|
40
|
+
repoStatus(repo: string): Promise<RepositoryStatus>;
|
|
41
|
+
workspaceList(): Promise<WorkspaceInfo[]>;
|
|
42
|
+
/** The deployed state (deployedAt, package hash), or null when not deployed. */
|
|
43
|
+
workspaceGet(ws: string): Promise<WorkspaceState | null>;
|
|
44
|
+
workspaceStatus(ws: string): Promise<WorkspaceStatusResult>;
|
|
45
|
+
taskList(ws: string): Promise<TaskListItem[]>;
|
|
46
|
+
taskGet(ws: string, task: string): Promise<TaskDetails>;
|
|
47
|
+
taskExecutionList(ws: string, task: string): Promise<ExecutionListItem[]>;
|
|
48
|
+
/** Every dataset of the workspace with its type / hash / size. */
|
|
49
|
+
datasetList(ws: string): Promise<ListEntry[]>;
|
|
50
|
+
datasetGetStatus(ws: string, path: TreePath): Promise<DatasetStatusDetail>;
|
|
51
|
+
datasetGet(ws: string, path: TreePath): Promise<{
|
|
52
|
+
data: Uint8Array;
|
|
53
|
+
hash: string;
|
|
54
|
+
size: number;
|
|
55
|
+
}>;
|
|
56
|
+
datasetGetPage(ws: string, path: TreePath, window: DatasetPageWindow): Promise<DatasetPage>;
|
|
57
|
+
datasetFindKey(ws: string, path: TreePath, query: DatasetFindQuery): Promise<DatasetFindResult>;
|
|
58
|
+
datasetSet(ws: string, path: TreePath, data: Uint8Array): Promise<void>;
|
|
59
|
+
dataflowExecuteLaunch(ws: string, options: DataflowOptions): Promise<void>;
|
|
60
|
+
dataflowExecutePoll(ws: string, offset: number): Promise<DataflowExecutionState>;
|
|
61
|
+
dataflowCancel(ws: string): Promise<void>;
|
|
62
|
+
taskLogs(ws: string, task: string, options: LogOptions): Promise<LogChunk>;
|
|
63
|
+
/** The same origin bound to another repository (the repositories view's lazy facts). */
|
|
64
|
+
withRepo(repo: string): Api;
|
|
65
|
+
}
|
|
66
|
+
/** What binds the HTTP client to a session. */
|
|
67
|
+
export interface HttpApiConfig {
|
|
68
|
+
/** The API base URL (without `/api`). */
|
|
69
|
+
apiUrl: string;
|
|
70
|
+
/** The repository id (`default` for a local server); null for a bare origin. */
|
|
71
|
+
repo: string | null;
|
|
72
|
+
/** Resolves the bearer token before each request (null for an unauthenticated local server). */
|
|
73
|
+
token: () => Promise<string | null>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Binds `@elaraai/e3-api-client` to a session.
|
|
77
|
+
*
|
|
78
|
+
* @param config - The session's URL, repository and token source
|
|
79
|
+
* @returns The bound API
|
|
80
|
+
*/
|
|
81
|
+
export declare function createHttpApi(config: HttpApiConfig): Api;
|
|
82
|
+
/**
|
|
83
|
+
* Whether an error is an `ApiError` (duck-typed: the client's class may be
|
|
84
|
+
* a different copy in a linked workspace) carrying `code`.
|
|
85
|
+
*
|
|
86
|
+
* @param err - The error
|
|
87
|
+
* @param code - The code to match
|
|
88
|
+
* @returns `true` on a match
|
|
89
|
+
*/
|
|
90
|
+
export declare function isApiCode(err: unknown, code: string): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* An error as one line for a toast or the log — e3-cli's `formatError`
|
|
93
|
+
* (`Workspace not found: {"workspace":"main"}`), except that details the
|
|
94
|
+
* JSON encoder refuses (a BigInt pid in a lock holder) fall back to the
|
|
95
|
+
* humanized code alone instead of throwing.
|
|
96
|
+
*
|
|
97
|
+
* @param err - The error
|
|
98
|
+
* @returns The line
|
|
99
|
+
*/
|
|
100
|
+
export declare function describeError(err: unknown): string;
|
|
101
|
+
/**
|
|
102
|
+
* The `code` of an `ApiError`, or undefined for any other error.
|
|
103
|
+
*
|
|
104
|
+
* @param err - The error
|
|
105
|
+
* @returns The code
|
|
106
|
+
*/
|
|
107
|
+
export declare function apiCode(err: unknown): string | undefined;
|
|
108
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/tui/api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,EAmBH,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,gBAAgB,EAErB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAqB,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG1F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OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAQlD;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAMxD"}
|
package/dist/tui/api.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The `Api` seam — the subset of `@elaraai/e3-api-client` the TUI uses,
|
|
7
|
+
* bound to one session (base URL, repository, a per-request token) so the
|
|
8
|
+
* views and feeds never see transport details, and so the frame specs can
|
|
9
|
+
* substitute an in-memory fake (`api.fake.ts`).
|
|
10
|
+
*
|
|
11
|
+
* Transport is always the e3 HTTP API: an embedded `@elaraai/e3-api-server`
|
|
12
|
+
* for local repositories, `getValidToken()` per request for remote ones —
|
|
13
|
+
* paging, key search and byte budgets come from the server, not a second
|
|
14
|
+
* implementation.
|
|
15
|
+
*
|
|
16
|
+
* @packageDocumentation
|
|
17
|
+
*/
|
|
18
|
+
import { datasetFindKey, datasetGet, datasetGetPage, datasetGetStatus, datasetListRecursive, datasetSet, dataflowCancel, dataflowExecuteLaunch, dataflowExecutePoll, repoList, repoStatus, taskExecutionList, taskGet, taskList, taskLogs, workspaceGet, workspaceList, workspaceStatus, } from '@elaraai/e3-api-client';
|
|
19
|
+
import { urlPathToTreePath } from '@elaraai/e3-types';
|
|
20
|
+
import { formatError } from '@elaraai/e3-cli/internal';
|
|
21
|
+
/**
|
|
22
|
+
* A dotted dataset path (`.inputs.sales`, `inputs.sales`, `.tasks.forecast.output`)
|
|
23
|
+
* as a `TreePath` (through e3-types' own URL-path parser).
|
|
24
|
+
*
|
|
25
|
+
* @param path - The dotted path (a leading dot is optional)
|
|
26
|
+
* @returns The tree path
|
|
27
|
+
*/
|
|
28
|
+
export function treePathOf(path) {
|
|
29
|
+
return urlPathToTreePath(path.split('.').filter(s => s.length > 0).map(s => encodeURIComponent(s)).join('/'));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A `TreePath` as the dotted path the status feed uses (`.inputs.sales`).
|
|
33
|
+
*
|
|
34
|
+
* @param path - The tree path
|
|
35
|
+
* @returns The dotted path with a leading dot
|
|
36
|
+
*/
|
|
37
|
+
export function dottedPath(path) {
|
|
38
|
+
return path.map(p => `.${p.value}`).join('');
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Binds `@elaraai/e3-api-client` to a session.
|
|
42
|
+
*
|
|
43
|
+
* @param config - The session's URL, repository and token source
|
|
44
|
+
* @returns The bound API
|
|
45
|
+
*/
|
|
46
|
+
export function createHttpApi(config) {
|
|
47
|
+
const { apiUrl } = config;
|
|
48
|
+
const options = async () => ({ token: await config.token() });
|
|
49
|
+
const repo = () => {
|
|
50
|
+
if (config.repo === null)
|
|
51
|
+
throw new Error('no repository is open — /repo <name> binds one');
|
|
52
|
+
return config.repo;
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
repoList: async () => repoList(apiUrl, await options()),
|
|
56
|
+
repoStatus: async (name) => repoStatus(apiUrl, name, await options()),
|
|
57
|
+
workspaceList: async () => workspaceList(apiUrl, repo(), await options()),
|
|
58
|
+
workspaceGet: async (ws) => {
|
|
59
|
+
try {
|
|
60
|
+
return await workspaceGet(apiUrl, repo(), ws, await options());
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
if (isApiCode(err, 'workspace_not_deployed'))
|
|
64
|
+
return null;
|
|
65
|
+
throw err;
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
workspaceStatus: async (ws) => workspaceStatus(apiUrl, repo(), ws, await options()),
|
|
69
|
+
taskList: async (ws) => taskList(apiUrl, repo(), ws, await options()),
|
|
70
|
+
taskGet: async (ws, task) => taskGet(apiUrl, repo(), ws, task, await options()),
|
|
71
|
+
// Every attempt, not only the latest per inputs hash: the Runs tab is a history.
|
|
72
|
+
taskExecutionList: async (ws, task) => taskExecutionList(apiUrl, repo(), ws, task, await options(), { all: true }),
|
|
73
|
+
datasetList: async (ws) => datasetListRecursive(apiUrl, repo(), ws, [], await options()),
|
|
74
|
+
datasetGetStatus: async (ws, path) => datasetGetStatus(apiUrl, repo(), ws, path, await options()),
|
|
75
|
+
datasetGet: async (ws, path) => datasetGet(apiUrl, repo(), ws, path, await options()),
|
|
76
|
+
datasetGetPage: async (ws, path, window) => datasetGetPage(apiUrl, repo(), ws, path, window, await options()),
|
|
77
|
+
datasetFindKey: async (ws, path, query) => datasetFindKey(apiUrl, repo(), ws, path, query, await options()),
|
|
78
|
+
datasetSet: async (ws, path, data) => datasetSet(apiUrl, repo(), ws, path, data, await options()),
|
|
79
|
+
dataflowExecuteLaunch: async (ws, dataflowOptions) => dataflowExecuteLaunch(apiUrl, repo(), ws, dataflowOptions, await options()),
|
|
80
|
+
dataflowExecutePoll: async (ws, offset) => dataflowExecutePoll(apiUrl, repo(), ws, { offset }, await options()),
|
|
81
|
+
dataflowCancel: async (ws) => dataflowCancel(apiUrl, repo(), ws, await options()),
|
|
82
|
+
taskLogs: async (ws, task, logOptions) => taskLogs(apiUrl, repo(), ws, task, logOptions, await options()),
|
|
83
|
+
withRepo: (other) => createHttpApi({ ...config, repo: other }),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Whether an error is an `ApiError` (duck-typed: the client's class may be
|
|
88
|
+
* a different copy in a linked workspace) carrying `code`.
|
|
89
|
+
*
|
|
90
|
+
* @param err - The error
|
|
91
|
+
* @param code - The code to match
|
|
92
|
+
* @returns `true` on a match
|
|
93
|
+
*/
|
|
94
|
+
export function isApiCode(err, code) {
|
|
95
|
+
return typeof err === 'object' && err !== null && err.name === 'ApiError' && err.code === code;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* An error as one line for a toast or the log — e3-cli's `formatError`
|
|
99
|
+
* (`Workspace not found: {"workspace":"main"}`), except that details the
|
|
100
|
+
* JSON encoder refuses (a BigInt pid in a lock holder) fall back to the
|
|
101
|
+
* humanized code alone instead of throwing.
|
|
102
|
+
*
|
|
103
|
+
* @param err - The error
|
|
104
|
+
* @returns The line
|
|
105
|
+
*/
|
|
106
|
+
export function describeError(err) {
|
|
107
|
+
try {
|
|
108
|
+
return formatError(err);
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
const code = apiCode(err);
|
|
112
|
+
if (code !== undefined)
|
|
113
|
+
return code.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase());
|
|
114
|
+
return err instanceof Error ? err.message : String(err);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The `code` of an `ApiError`, or undefined for any other error.
|
|
119
|
+
*
|
|
120
|
+
* @param err - The error
|
|
121
|
+
* @returns The code
|
|
122
|
+
*/
|
|
123
|
+
export function apiCode(err) {
|
|
124
|
+
if (typeof err === 'object' && err !== null && err.name === 'ApiError') {
|
|
125
|
+
const code = err.code;
|
|
126
|
+
return typeof code === 'string' ? code : undefined;
|
|
127
|
+
}
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/tui/api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,EACH,cAAc,EACd,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,aAAa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AAM,UAAU,OAAO,CAAC,GAAY;IAChC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAK,GAA0B,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC7F,MAAM,IAAI,GAAI,GAA0B,CAAC,IAAI,CAAC;QAC9C,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACvD,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import type { TuiOptions } from '../commands/tui.js';
|
|
6
|
+
import { type Controller } from './controller.js';
|
|
7
|
+
import { type Session } from './session.js';
|
|
8
|
+
import './ui/views/all.js';
|
|
9
|
+
/** A running app, for the integration harness. */
|
|
10
|
+
export interface TuiHandle {
|
|
11
|
+
controller: Controller;
|
|
12
|
+
session: () => Session | null;
|
|
13
|
+
/** Resolves with the exit code. */
|
|
14
|
+
done: Promise<number>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Runs the terminal UI and resolves with the process exit code.
|
|
18
|
+
*
|
|
19
|
+
* @param options - The resolved root-action options
|
|
20
|
+
* @returns The exit code
|
|
21
|
+
*/
|
|
22
|
+
export declare function runTui(options: TuiOptions): Promise<number>;
|
|
23
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/tui/app.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAQpE,OAAO,EAA+B,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAGzE,OAAO,mBAAmB,CAAC;AAK3B,kDAAkD;AAClD,MAAM,WAAW,SAAS;IACtB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC;IAC9B,mCAAmC;IACnC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAsB,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAuMjE"}
|