@mnmal-ai/substrate-tui 1.0.0-beta.6 → 1.0.0-beta.8

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 CHANGED
@@ -9,7 +9,7 @@ Without an admin identity it is read-only.
9
9
  - Free text is a natural-language question, answered by `substrate-nl` (streamed). Tab completes types, fields and values.
10
10
  - `/ns <namespace>` switches the namespace that questions, completion and the status row use. The schema browser always lists every namespace.
11
11
  - `/frame` shows the Substrate frame behind the last answer.
12
- - `/asof <date-time>` reads relative phrases ("yesterday", "past 2 days") as of that moment, for the questions that follow. It must be ISO-8601 with an offset, e.g. `2026-10-24T23:59:59-05:00`. `/asof off` returns to the server clock, and `/asof` alone shows which is in use. `/frame` shows the clock the server read the last question against.
12
+ - `/asof <date-time>` reads relative phrases ("yesterday", "past 2 days") as of that moment, for the questions that follow. It must be ISO-8601 with an offset, in years 1000 to 9998, e.g. `2026-10-24T23:59:59-05:00`. `/asof off` returns to the server clock, and `/asof` alone shows which is in use. `/frame` shows the clock the server read the last question against.
13
13
  - `/schema [namespace] [type]` opens the schema browser: namespaces, then types, then fields.
14
14
  - `/dash` shows service, traffic and engine metrics, live while open.
15
15
  - `/doctor` runs live checks against this deployment.
@@ -729,6 +729,7 @@ const COLS = {
729
729
  };
730
730
  const titleWidth = (columns) => Math.max(COLS.minTitle, columns - (COLS.id + COLS.status + COLS.project + COLS.gaps));
731
731
  const FN_LABEL = {
732
+ count: "count",
732
733
  avg: "average",
733
734
  sum: "total",
734
735
  min: "min",
@@ -832,7 +833,8 @@ const rows = ({ data, theme, size }) => {
832
833
  }, `d${i}`));
833
834
  const agg = o.aggregate;
834
835
  if (agg !== void 0) {
835
- const head = `${Object.hasOwn(FN_LABEL, agg.fn) ? FN_LABEL[agg.fn] : str(agg.fn)} ${str(agg.field)}`;
836
+ const fnLabel = Object.hasOwn(FN_LABEL, agg.fn) ? FN_LABEL[agg.fn] : str(agg.fn);
837
+ const head = agg.fn === "count" ? fnLabel : `${fnLabel} ${str(agg.field)}`;
836
838
  const errs = errorLines(o.errors).map((l, i) => /* @__PURE__ */ jsx(Text, {
837
839
  color: theme.color.error,
838
840
  children: ` ${l}`
@@ -1245,8 +1247,8 @@ function explain(err, endpoint) {
1245
1247
  if (e.status === 401 || e.status === 403) return `not authorised (${e.status}) — check SUBSTRATE_AGENT_KEY_ID / SUBSTRATE_AGENT_KEY_PATH`;
1246
1248
  return e.message ?? String(err);
1247
1249
  }
1248
- /** What the server accepts for `asOf`: a date-time with an explicit offset. */
1249
- const ISO_WITH_OFFSET = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/;
1250
+ /** What the server accepts for `asOf`: a date-time with an explicit offset, in years 1000 to 9998. */
1251
+ const ISO_WITH_OFFSET = /^(?!9999)[1-9]\d{3}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/;
1250
1252
  /**
1251
1253
  * The ask module. A plain list of rows goes to `pager`, whose module the app must also register;
1252
1254
  * the default is for an app that registers it from here, as the tests do.
@@ -1350,7 +1352,7 @@ function askModule(deps, pager = listPager()) {
1350
1352
  asOf = void 0;
1351
1353
  return ctx.print("asOf → server clock");
1352
1354
  }
1353
- if (!ISO_WITH_OFFSET.test(v) || Number.isNaN(Date.parse(v))) return ctx.print("asOf needs an ISO-8601 date-time with an offset, e.g. 2026-10-24T23:59:59-05:00");
1355
+ if (!ISO_WITH_OFFSET.test(v) || Number.isNaN(Date.parse(v))) return ctx.print("asOf needs an ISO-8601 date-time with an offset, in years 1000 to 9998, e.g. 2026-10-24T23:59:59-05:00");
1354
1356
  asOf = v;
1355
1357
  ctx.print(`asOf → ${asOf}`);
1356
1358
  }
@@ -51,7 +51,7 @@ 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-DmFXZmFW.js"),
54
+ import("../app-BOYs_nbd.js"),
55
55
  import("../deps-CMPHUv70.js"),
56
56
  import("@mnmal-ai/surface-core/pure"),
57
57
  import("../terminal-BAd8sH3d.js")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mnmal-ai/substrate-tui",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.8",
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,8 +20,8 @@
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@mnmal-ai/substrate": "1.0.0-beta.6",
24
- "@mnmal-ai/substrate-nl": "1.0.0-beta.6",
23
+ "@mnmal-ai/substrate": "1.0.0-beta.8",
24
+ "@mnmal-ai/substrate-nl": "1.0.0-beta.8",
25
25
  "@mnmal-ai/surface-core": "0.17.1",
26
26
  "@mnmal-ai/surface-kit": "0.17.1",
27
27
  "@mnmal-ai/surface-theme": "0.17.1",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@biomejs/biome": "2.6.4",
33
- "@mnmal-ai/substrate-config": "1.0.0-beta.6",
33
+ "@mnmal-ai/substrate-config": "1.0.0-beta.8",
34
34
  "@types/node": "^26.6.4",
35
35
  "@types/react": "^19.2.0",
36
36
  "ink-testing-library": "^4.0.0",