@mnmal-ai/substrate-tui 1.0.0-alpha.9 → 1.0.0-beta.2
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 +23 -1
- package/dist/{app-D0y2D8WL.js → app-h4FA6Urt.js} +1078 -142
- package/dist/bin/substrate-tui.js +4 -4
- package/dist/{deps-WzqsHHiC.js → deps-CMPHUv70.js} +7 -3
- package/dist/{terminal-XfKFiD7r.js → terminal-4hKQ29CS.js} +8 -3
- package/dist/{terminal-CVX2CKWu.js → terminal-BAd8sH3d.js} +1 -1
- package/package.json +10 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as colorDepthEnv } from "../terminal-
|
|
2
|
+
import { t as colorDepthEnv } from "../terminal-4hKQ29CS.js";
|
|
3
3
|
import { basename } from "node:path";
|
|
4
4
|
import { DEFAULT_CAPABILITIES, makeTokenProvider, tokenAudience } from "@mnmal-ai/substrate/client";
|
|
5
5
|
import { trimTrailingSlashes } from "@mnmal-ai/substrate/sdk";
|
|
@@ -51,10 +51,10 @@ async function main() {
|
|
|
51
51
|
}
|
|
52
52
|
Object.assign(process.env, colorDepthEnv(process.env));
|
|
53
53
|
const [{ createTui }, { makeDeps }, { prepareTerminal }, { terminalOptions }] = await Promise.all([
|
|
54
|
-
import("../app-
|
|
55
|
-
import("../deps-
|
|
54
|
+
import("../app-h4FA6Urt.js"),
|
|
55
|
+
import("../deps-CMPHUv70.js"),
|
|
56
56
|
import("@mnmal-ai/surface-core/pure"),
|
|
57
|
-
import("../terminal-
|
|
57
|
+
import("../terminal-BAd8sH3d.js")
|
|
58
58
|
]);
|
|
59
59
|
let deps;
|
|
60
60
|
try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { n as adminIdleMs, r as createAdminSession } from "./session-C1D5Ermr.js";
|
|
3
|
-
import { SubstrateClient, noRedirectFetch, tokenAudience } from "@mnmal-ai/substrate/client";
|
|
3
|
+
import { SubstrateClient, noRedirectFetch, substrateFetch, tokenAudience } from "@mnmal-ai/substrate/client";
|
|
4
4
|
|
|
5
5
|
//#region src/deps.ts
|
|
6
6
|
/** An HTTP failure from `getJson`: `status` is what `NetworkError` and `AuthError` also carry. */
|
|
@@ -13,7 +13,7 @@ var HttpStatusError = class extends Error {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
const sig = (signal) => signal !== void 0 ? { signal } : {};
|
|
16
|
-
function makeDeps(config, fetchImpl =
|
|
16
|
+
function makeDeps(config, fetchImpl = substrateFetch, env = process.env) {
|
|
17
17
|
const token = config.token;
|
|
18
18
|
if (token !== null || [
|
|
19
19
|
"SUBSTRATE_ADMIN_TOKEN",
|
|
@@ -42,6 +42,7 @@ function makeDeps(config, fetchImpl = fetch, env = process.env) {
|
|
|
42
42
|
namespace: config.namespace,
|
|
43
43
|
nl: client.nl,
|
|
44
44
|
federatedSchema: () => client.federatedSchema(),
|
|
45
|
+
query: (frame, signal) => client.query(frame, sig(signal)),
|
|
45
46
|
metrics: (signal) => client.metrics(sig(signal)),
|
|
46
47
|
errors: (signal) => admin.unlocked() ? admin.run(({ client: c }) => c.errors(sig(signal)), { touch: false }) : client.errors(sig(signal)),
|
|
47
48
|
admin,
|
|
@@ -53,7 +54,10 @@ function makeDeps(config, fetchImpl = fetch, env = process.env) {
|
|
|
53
54
|
...env.HOME !== void 0 ? { HOME: env.HOME } : {}
|
|
54
55
|
},
|
|
55
56
|
agentAuthorization: token !== null ? () => `Bearer ${token()}` : null,
|
|
56
|
-
keys: (signal) => client.admin.keys(
|
|
57
|
+
keys: (signal, filter) => client.admin.keys({
|
|
58
|
+
...sig(signal),
|
|
59
|
+
...filter !== void 0 ? { filter } : {}
|
|
60
|
+
}),
|
|
57
61
|
async getJson(path, signal) {
|
|
58
62
|
const headers = { accept: "application/json" };
|
|
59
63
|
if (config.token !== null) headers.authorization = `Bearer ${config.token()}`;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { resolveFullscreen } from "@mnmal-ai/surface-core/pure";
|
|
3
|
+
|
|
2
4
|
//#region src/terminal.ts
|
|
3
5
|
/**
|
|
4
|
-
* How substrate-tui prepares the terminal: a black ground and
|
|
5
|
-
* `
|
|
6
|
+
* How substrate-tui prepares the terminal: a black ground, and full-screen unless
|
|
7
|
+
* `SURFACE_FULLSCREEN=off`, which gives a fresh, bottom-anchored pane instead.
|
|
8
|
+
* `SUBSTRATE_TUI_BACKGROUND` takes `#rrggbb` or `none`; `SUBSTRATE_TUI_CLEAR=0` keeps what was on
|
|
9
|
+
* screen (full-screen never clears: it draws on the alternate screen).
|
|
6
10
|
*/
|
|
7
11
|
function terminalOptions(env) {
|
|
8
12
|
return {
|
|
9
13
|
...env.SUBSTRATE_TUI_BACKGROUND !== void 0 ? { ground: env.SUBSTRATE_TUI_BACKGROUND } : {},
|
|
10
|
-
clear: (env.SUBSTRATE_TUI_CLEAR ?? "").trim() !== "0"
|
|
14
|
+
clear: (env.SUBSTRATE_TUI_CLEAR ?? "").trim() !== "0",
|
|
15
|
+
fullscreen: resolveFullscreen(void 0, env.SURFACE_FULLSCREEN).on
|
|
11
16
|
};
|
|
12
17
|
}
|
|
13
18
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mnmal-ai/substrate-tui",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"description": "Terminal UI for Substrate: ask in natural language, browse the schema, see the service status.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@mnmal-ai/substrate": "1.0.0-
|
|
24
|
-
"@mnmal-ai/substrate-nl": "1.0.0-
|
|
25
|
-
"@mnmal-ai/surface-core": "0.
|
|
26
|
-
"@mnmal-ai/surface-kit": "0.
|
|
27
|
-
"@mnmal-ai/surface-theme": "0.
|
|
28
|
-
"ink": "^
|
|
23
|
+
"@mnmal-ai/substrate": "1.0.0-beta.2",
|
|
24
|
+
"@mnmal-ai/substrate-nl": "1.0.0-beta.2",
|
|
25
|
+
"@mnmal-ai/surface-core": "0.17.1",
|
|
26
|
+
"@mnmal-ai/surface-kit": "0.17.1",
|
|
27
|
+
"@mnmal-ai/surface-theme": "0.17.1",
|
|
28
|
+
"ink": "^8.0.0",
|
|
29
29
|
"react": "^19.3.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@biomejs/biome": "2.6.
|
|
33
|
-
"@mnmal-ai/substrate-config": "1.0.0-
|
|
32
|
+
"@biomejs/biome": "2.6.4",
|
|
33
|
+
"@mnmal-ai/substrate-config": "1.0.0-beta.2",
|
|
34
34
|
"@types/node": "^26.6.4",
|
|
35
35
|
"@types/react": "^19.2.0",
|
|
36
36
|
"ink-testing-library": "^4.0.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"vitest": "^5.0.3"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=26.
|
|
43
|
+
"node": ">=26.13.1"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "tsdown",
|