@kontextmind/kxm 0.7.40 → 0.7.43

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 (177) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +41 -7
  3. package/docs/README.md +5 -3
  4. package/docs/agent-skills.md +1 -1
  5. package/docs/architecture.md +1 -1
  6. package/docs/configuration.md +28 -5
  7. package/docs/{vnext → contracts}/README.md +7 -7
  8. package/docs/{vnext → contracts}/architecture.md +2 -2
  9. package/docs/{vnext → contracts}/migration.md +25 -25
  10. package/docs/{vnext → contracts}/routing.md +2 -2
  11. package/docs/{vnext → contracts}/synchronization.md +1 -1
  12. package/docs/{vnext → contracts}/validation.md +7 -7
  13. package/docs/getting-started.md +1 -1
  14. package/docs/kb/qa-authentik-authentication.md +47 -0
  15. package/docs/kb/qa-extension-install-and-hub-bootstrap.md +68 -0
  16. package/docs/kb/qa-hub-on-a-public-host.md +31 -0
  17. package/docs/kb/qa-sqlite-vs-duckdb.md +18 -0
  18. package/docs/kb/qa-what-the-hub-stores.md +47 -0
  19. package/docs/packages.md +91 -0
  20. package/docs/templates/architecture.md +1 -1
  21. package/docs/test-matrix.md +6 -6
  22. package/docs/tui-components.md +131 -0
  23. package/examples/README.md +2 -2
  24. package/examples/{vnext → project}/.kxm/agents/critic-3.yaml +1 -1
  25. package/examples/{vnext → project}/README.md +4 -4
  26. package/package.json +18 -8
  27. package/packages/core/tui/CHANGELOG.md +19 -0
  28. package/packages/core/tui/LICENSE +21 -0
  29. package/packages/core/tui/README.md +45 -0
  30. package/packages/core/tui/dist/index.js +1439 -0
  31. package/packages/core/tui/src/adapters/pi.ts +73 -0
  32. package/packages/core/tui/src/adapters/terminal.ts +106 -0
  33. package/packages/core/tui/src/exports/index.ts +30 -0
  34. package/packages/core/tui/src/services/registry.ts +274 -0
  35. package/packages/core/tui/src/tui/keys.ts +130 -0
  36. package/packages/core/tui/src/tui/layout.ts +117 -0
  37. package/packages/core/tui/src/tui/panel.ts +435 -0
  38. package/packages/core/tui/src/tui/panelComponent.ts +208 -0
  39. package/packages/core/tui/src/tui/render.ts +309 -0
  40. package/packages/core/tui/src/tui/theme.ts +145 -0
  41. package/packages/core/tui/src/types/surface.ts +407 -0
  42. package/plugins/kxm/.claude-plugin/plugin.json +1 -1
  43. package/plugins/kxm/dist/cli.js +681 -553
  44. package/plugins/kxm/dist/extension.js +18 -18
  45. package/plugins/kxm/dist/mcp-server.js +1 -1
  46. package/plugins/kxm/dist/{vnext-runtime-supervisor.js → runtime-supervisor.js} +553 -553
  47. package/plugins/kxm/dist/runtime.js +608 -608
  48. package/plugins/kxm/dist/server.js +13 -13
  49. package/plugins/kxm/package.json +2 -2
  50. package/plugins/kxm/skills/kxm-project-setup/SKILL.md +2 -2
  51. package/plugins/kxm/skills/kxm-runs/SKILL.md +3 -3
  52. package/plugins/kxm/skills/kxm-session/SKILL.md +1 -1
  53. package/plugins/kxm/skills/kxm-workflow/SKILL.md +1 -1
  54. package/plugins/kxm/src/autocomplete.ts +4 -4
  55. package/plugins/kxm/src/{vnext-bindings.ts → bindings.ts} +48 -48
  56. package/plugins/kxm/src/cli/hub.ts +3 -3
  57. package/plugins/kxm/src/cli/{vnext.ts → project.ts} +106 -106
  58. package/plugins/kxm/src/cli/roles.ts +9 -9
  59. package/plugins/kxm/src/cli/system.ts +2 -2
  60. package/plugins/kxm/src/cli/tasks.ts +8 -8
  61. package/plugins/kxm/src/cli/workflows.ts +8 -8
  62. package/plugins/kxm/src/cli.ts +47 -47
  63. package/plugins/kxm/src/config.ts +69 -14
  64. package/plugins/kxm/src/database.ts +4 -4
  65. package/plugins/kxm/src/{vnext-engine-artifacts.ts → engine-artifacts.ts} +7 -7
  66. package/plugins/kxm/src/{vnext-engine-command.ts → engine-command.ts} +40 -40
  67. package/plugins/kxm/src/{vnext-engine-compile.ts → engine-compile.ts} +64 -64
  68. package/plugins/kxm/src/{vnext-engine-evidence.ts → engine-evidence.ts} +26 -26
  69. package/plugins/kxm/src/{vnext-engine-fold.ts → engine-fold.ts} +99 -99
  70. package/plugins/kxm/src/{vnext-engine-gate-records.ts → engine-gate-records.ts} +105 -105
  71. package/plugins/kxm/src/{vnext-engine-plan.ts → engine-plan.ts} +69 -69
  72. package/plugins/kxm/src/{vnext-engine.ts → engine.ts} +502 -502
  73. package/plugins/kxm/src/gate-hash.ts +10 -0
  74. package/plugins/kxm/src/{vnext-harness.ts → harness.ts} +1 -1
  75. package/plugins/kxm/src/hub.ts +1 -1
  76. package/plugins/kxm/src/init-guide-setup.ts +3 -3
  77. package/plugins/kxm/src/{vnext-init.ts → init.ts} +93 -93
  78. package/plugins/kxm/src/kxm-install-kind.ts +1 -1
  79. package/plugins/kxm/src/kxm-update-config.ts +2 -2
  80. package/plugins/kxm/src/local-snapshot.ts +23 -23
  81. package/plugins/kxm/src/mcp-server.ts +1 -1
  82. package/plugins/kxm/src/{vnext-migrate.ts → migrate.ts} +123 -123
  83. package/plugins/kxm/src/model-inventory.ts +1 -1
  84. package/plugins/kxm/src/{vnext-oneshot-evidence.ts → oneshot-evidence.ts} +2 -2
  85. package/plugins/kxm/src/{vnext-oneshot-process.ts → oneshot-process.ts} +4 -4
  86. package/plugins/kxm/src/{vnext-oneshot-producer.ts → oneshot-producer.ts} +24 -24
  87. package/plugins/kxm/src/{vnext-permission.ts → permission.ts} +86 -86
  88. package/plugins/kxm/src/{vnext-pi-producer.ts → pi-producer.ts} +13 -13
  89. package/plugins/kxm/src/{vnext-config.ts → project-config.ts} +177 -177
  90. package/plugins/kxm/src/{vnext-repair.ts → repair.ts} +159 -159
  91. package/plugins/kxm/src/restricted-yaml.d.mts +3 -3
  92. package/plugins/kxm/src/restricted-yaml.mjs +4 -4
  93. package/plugins/kxm/src/{vnext-runtime-owner.ts → runtime-owner.ts} +35 -35
  94. package/plugins/kxm/src/{vnext-runtime.ts → runtime-service.ts} +136 -136
  95. package/plugins/kxm/src/{vnext-runtime-store.ts → runtime-store.ts} +145 -145
  96. package/plugins/kxm/src/{vnext-runtime-supervisor.ts → runtime-supervisor.ts} +80 -80
  97. package/plugins/kxm/src/runtime.ts +6 -6
  98. package/plugins/kxm/src/session-work.ts +3 -3
  99. package/plugins/kxm/src/studio-layout.ts +6 -6
  100. package/plugins/kxm/src/{vnext-template.ts → template.ts} +33 -33
  101. package/plugins/kxm/src/tui.ts +10 -24
  102. package/schemas/{vnext/README.md → README.md} +3 -3
  103. package/schemas/{vnext/agent.schema.json → agent.schema.json} +1 -1
  104. package/schemas/{vnext/assignment-result.schema.json → assignment-result.schema.json} +1 -1
  105. package/schemas/{vnext/backup-manifest.schema.json → backup-manifest.schema.json} +1 -1
  106. package/schemas/{vnext/candidate.schema.json → candidate.schema.json} +1 -1
  107. package/schemas/{vnext/common.schema.json → common.schema.json} +2 -2
  108. package/schemas/{vnext/context-candidate.schema.json → context-candidate.schema.json} +1 -1
  109. package/schemas/{vnext/context-packet.schema.json → context-packet.schema.json} +1 -1
  110. package/schemas/{vnext/delivery-manifest.schema.json → delivery-manifest.schema.json} +1 -1
  111. package/schemas/{vnext/drive-receipt.schema.json → drive-receipt.schema.json} +2 -2
  112. package/schemas/{vnext/environment.schema.json → environment.schema.json} +1 -1
  113. package/schemas/{vnext/gate-registry.schema.json → gate-registry.schema.json} +1 -1
  114. package/schemas/{vnext/handoff-manifest.schema.json → handoff-manifest.schema.json} +1 -1
  115. package/schemas/{vnext/init-operation.schema.json → init-operation.schema.json} +1 -1
  116. package/schemas/{vnext/local-repository-bindings.schema.json → local-repository-bindings.schema.json} +1 -1
  117. package/schemas/{vnext/memory-record.schema.json → memory-record.schema.json} +1 -1
  118. package/schemas/{vnext/migration-decision.schema.json → migration-decision.schema.json} +1 -1
  119. package/schemas/{vnext/migration-plan.schema.json → migration-plan.schema.json} +1 -1
  120. package/schemas/{vnext/migration-receipt.schema.json → migration-receipt.schema.json} +1 -1
  121. package/schemas/{vnext/model.schema.json → model.schema.json} +1 -1
  122. package/schemas/{vnext/modes.schema.json → modes.schema.json} +1 -1
  123. package/schemas/{vnext/permission-diff.schema.json → permission-diff.schema.json} +1 -1
  124. package/schemas/policy-draft/README.md +2 -2
  125. package/schemas/{vnext/prices.schema.json → prices.schema.json} +1 -1
  126. package/schemas/{vnext/project.schema.json → project.schema.json} +1 -1
  127. package/schemas/{vnext/repository.schema.json → repository.schema.json} +1 -1
  128. package/schemas/{vnext/role.schema.json → role.schema.json} +1 -1
  129. package/schemas/{vnext/run-event.schema.json → run-event.schema.json} +1 -1
  130. package/schemas/{vnext/session-brief.schema.json → session-brief.schema.json} +2 -2
  131. package/schemas/{vnext/sync-event.schema.json → sync-event.schema.json} +1 -1
  132. package/schemas/{vnext/template-provenance.schema.json → template-provenance.schema.json} +1 -1
  133. package/schemas/{vnext/workflow.schema.json → workflow.schema.json} +1 -1
  134. package/scripts/build-package.mjs +59 -0
  135. package/scripts/build-runtime.mjs +3 -2
  136. package/scripts/check-generated.mjs +2 -1
  137. package/scripts/check-versions.mjs +12 -1
  138. package/scripts/docker-install-smoke.mjs +268 -0
  139. package/scripts/emit-codex-artifacts.mjs +1 -1
  140. package/scripts/kxm-bump-version.mjs +53 -3
  141. package/scripts/kxm-runtime-supervisor.mjs +3 -3
  142. package/scripts/package-surfaces.mjs +39 -0
  143. package/plugins/kxm/src/vnext-gate-hash.ts +0 -10
  144. /package/docs/{vnext → contracts}/effects-and-recovery.md +0 -0
  145. /package/docs/{vnext → contracts}/lifecycles.md +0 -0
  146. /package/docs/{vnext → contracts}/terminology.md +0 -0
  147. /package/examples/{vnext → project}/.kxm/agents/coordinator.yaml +0 -0
  148. /package/examples/{vnext → project}/.kxm/agents/critic-1.yaml +0 -0
  149. /package/examples/{vnext → project}/.kxm/agents/critic-2.yaml +0 -0
  150. /package/examples/{vnext → project}/.kxm/agents/implementer.yaml +0 -0
  151. /package/examples/{vnext → project}/.kxm/agents/planner.yaml +0 -0
  152. /package/examples/{vnext → project}/.kxm/agents/reproducer.yaml +0 -0
  153. /package/examples/{vnext → project}/.kxm/agents/reviewer.yaml +0 -0
  154. /package/examples/{vnext → project}/.kxm/gates.yaml +0 -0
  155. /package/examples/{vnext → project}/.kxm/models/critic-claude.yaml +0 -0
  156. /package/examples/{vnext → project}/.kxm/models/critic-gemini.yaml +0 -0
  157. /package/examples/{vnext → project}/.kxm/models/critic-grok.yaml +0 -0
  158. /package/examples/{vnext → project}/.kxm/models/implementation.yaml +0 -0
  159. /package/examples/{vnext → project}/.kxm/models/primary.yaml +0 -0
  160. /package/examples/{vnext → project}/.kxm/prices.yaml +0 -0
  161. /package/examples/{vnext → project}/.kxm/project/env.yaml +0 -0
  162. /package/examples/{vnext → project}/.kxm/project.yaml +0 -0
  163. /package/examples/{vnext → project}/.kxm/repo/repo.yaml +0 -0
  164. /package/examples/{vnext → project}/.kxm/workflows/default.yaml +0 -0
  165. /package/examples/{vnext → project}/.kxm/workflows/fix.yaml +0 -0
  166. /package/examples/{vnext → project}/.kxm/workflows/improve.yaml +0 -0
  167. /package/examples/{vnext → project}/records/assignment-result-recorded.json +0 -0
  168. /package/examples/{vnext → project}/records/assignment-result.json +0 -0
  169. /package/examples/{vnext → project}/records/context-candidate.json +0 -0
  170. /package/examples/{vnext → project}/records/delivery-manifest.json +0 -0
  171. /package/examples/{vnext → project}/records/effect-uncertainty-resolved-sync.json +0 -0
  172. /package/examples/{vnext → project}/records/effect-uncertainty-resolved.json +0 -0
  173. /package/examples/{vnext → project}/records/run-created.json +0 -0
  174. /package/examples/{vnext → project}/records/sync-event.json +0 -0
  175. /package/examples/{vnext → project}/repositories/api/.kxm/repo/env.yaml +0 -0
  176. /package/examples/{vnext → project}/repositories/api/.kxm/repo/repo.yaml +0 -0
  177. /package/examples/{vnext → project}/repositories/web/.kxm/repo/repo.yaml +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontextmind/kxm",
3
- "version": "0.7.40",
3
+ "version": "0.7.43",
4
4
  "description": "KXM local-first multi-agent orchestration and operator dashboard",
5
5
  "type": "module",
6
6
  "author": "KontextMind",
@@ -32,14 +32,14 @@
32
32
  "example": "node --disable-warning=ExperimentalWarning --experimental-strip-types examples/roundtrip.ts",
33
33
  "build:mcp": "esbuild plugins/kxm/src/mcp-server.ts --bundle --platform=node --format=esm --target=node22 --alias:@modelcontextprotocol/sdk/server/index.js=./node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js --alias:@modelcontextprotocol/sdk/server/stdio.js=./node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js --alias:@modelcontextprotocol/sdk/types.js=./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js --outfile=plugins/kxm/dist/mcp-server.js --banner:js=\"#!/usr/bin/env node\"",
34
34
  "build:runtime": "node scripts/build-runtime.mjs",
35
- "build": "npm run build:mcp && npm run build:runtime",
35
+ "build": "npm run build:mcp && npm run build:runtime && npm run build:packages",
36
36
  "check:generated": "npm run build && node scripts/check-generated.mjs",
37
37
  "test:core": "npm run build && node --disable-warning=ExperimentalWarning --experimental-strip-types --test --test-concurrency=4 test/core/*.test.ts",
38
38
  "test:simulations": "npm run build && node --disable-warning=ExperimentalWarning --experimental-strip-types --test --test-concurrency=4 test/simulations/*.test.ts",
39
39
  "test:complete": "npm run build && node --disable-warning=ExperimentalWarning --experimental-strip-types --test --test-concurrency=4 test/core/*.test.ts test/simulations/*.test.ts",
40
- "test": "npm run test:core",
41
- "test:coverage:core": "npm run build && node --disable-warning=ExperimentalWarning --experimental-strip-types --test --test-concurrency=4 --experimental-test-coverage --test-coverage-lines=91 --test-coverage-branches=80 --test-coverage-functions=92 --test-coverage-include=plugins/kxm/src/**/*.ts --test-coverage-exclude=plugins/kxm/src/server.ts --test-coverage-exclude=plugins/kxm/src/mcp-server.ts --test-coverage-exclude=plugins/kxm/src/vnext-runtime-supervisor.ts test/core/*.test.ts",
42
- "test:coverage:complete": "npm run build && node --disable-warning=ExperimentalWarning --experimental-strip-types --test --test-concurrency=4 --experimental-test-coverage --test-coverage-lines=93 --test-coverage-branches=80 --test-coverage-functions=93 --test-coverage-include=plugins/kxm/src/**/*.ts --test-coverage-exclude=plugins/kxm/src/server.ts --test-coverage-exclude=plugins/kxm/src/mcp-server.ts --test-coverage-exclude=plugins/kxm/src/vnext-runtime-supervisor.ts test/core/*.test.ts test/simulations/*.test.ts",
40
+ "test": "npm run build && node --disable-warning=ExperimentalWarning --experimental-strip-types --test --test-concurrency=4 test/core/*.test.ts packages/core/*/tests/unit/*.test.ts",
41
+ "test:coverage:core": "npm run build && node --disable-warning=ExperimentalWarning --experimental-strip-types --test --test-concurrency=4 --experimental-test-coverage --test-coverage-lines=91 --test-coverage-branches=80 --test-coverage-functions=92 --test-coverage-include=plugins/kxm/src/**/*.ts --test-coverage-exclude=plugins/kxm/src/server.ts --test-coverage-exclude=plugins/kxm/src/mcp-server.ts --test-coverage-exclude=plugins/kxm/src/runtime-supervisor.ts --test-coverage-include=packages/core/*/src/**/*.ts test/core/*.test.ts packages/core/*/tests/unit/*.test.ts",
42
+ "test:coverage:complete": "npm run build && node --disable-warning=ExperimentalWarning --experimental-strip-types --test --test-concurrency=4 --experimental-test-coverage --test-coverage-lines=93 --test-coverage-branches=80 --test-coverage-functions=93 --test-coverage-include=plugins/kxm/src/**/*.ts --test-coverage-exclude=plugins/kxm/src/server.ts --test-coverage-exclude=plugins/kxm/src/mcp-server.ts --test-coverage-exclude=plugins/kxm/src/runtime-supervisor.ts --test-coverage-include=packages/core/*/src/**/*.ts test/core/*.test.ts test/simulations/*.test.ts packages/core/*/tests/unit/*.test.ts",
43
43
  "test:coverage": "npm run test:coverage:core",
44
44
  "typecheck": "tsc --noEmit",
45
45
  "lint:docs": "markdownlint-cli2",
@@ -49,7 +49,10 @@
49
49
  "validate:claude": "claude plugin validate . --strict && claude plugin validate plugins/kxm --strict",
50
50
  "validate:ci": "npm run test:coverage && npm run check && npm pack --dry-run",
51
51
  "validate:pr": "npm run test:core && npm run check && npm run check:generated",
52
- "validate": "npm run validate:ci && npm run validate:claude"
52
+ "validate": "npm run validate:ci && npm run validate:claude",
53
+ "test:packages": "npx nx run-many -t test --output-style=static",
54
+ "check:packages": "npx nx run-many -t build,test:coverage,typecheck --output-style=static",
55
+ "build:packages": "npx nx run-many -t build --output-style=stream"
53
56
  },
54
57
  "bin": {
55
58
  "kxm": "./scripts/kxm.mjs"
@@ -60,7 +63,8 @@
60
63
  "./client": "./plugins/kxm/dist/client.js",
61
64
  "./extension": "./plugins/kxm/dist/extension.js",
62
65
  "./mcp": "./plugins/kxm/dist/mcp-server.js",
63
- "./package.json": "./package.json"
66
+ "./package.json": "./package.json",
67
+ "./tui": "./packages/core/tui/dist/index.js"
64
68
  },
65
69
  "pi": {
66
70
  "extensions": [
@@ -96,6 +100,7 @@
96
100
  "commander": "15.0.0",
97
101
  "esbuild": "0.28.2",
98
102
  "markdownlint-cli2": "0.23.2",
103
+ "nx": "23.2.1",
99
104
  "tsx": "^4.23.13",
100
105
  "typebox": "1.3.30",
101
106
  "typescript": "7.0.2"
@@ -116,6 +121,8 @@
116
121
  "plugins/kxm/package.json",
117
122
  "plugins/kxm/README.md",
118
123
  "plugins/kxm/dist",
124
+ "packages/core/tui/dist",
125
+ "packages/core/tui/src",
119
126
  "plugins/kxm/skills",
120
127
  "plugins/kxm/src",
121
128
  "scripts",
@@ -127,5 +134,8 @@
127
134
  "LICENSE",
128
135
  "SECURITY.md"
129
136
  ],
130
- "license": "MIT"
137
+ "license": "MIT",
138
+ "workspaces": [
139
+ "packages/core/*"
140
+ ]
131
141
  }
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@kontextmind/tui` are documented here. The repository
4
+ keeps one version across every package, checked by `npm run check:versions`.
5
+
6
+ ## 0.7.1
7
+
8
+ ### Added
9
+
10
+ - Surface contract `kxm.tui-contract.v1`: sections, fields, selectable choices
11
+ with `ready|available|blocked` status, owner actions, steps, progress, an
12
+ output tail, and bounded validation that refuses an oversized or malformed
13
+ published surface.
14
+ - Pure panel reducer that emits effects without writing, plus a plain-text
15
+ renderer, a Pi `Component` adapter, a standalone terminal adapter, and a
16
+ `ctx.ui.custom` adapter.
17
+ - Contribution registry: owners publish sections and handle their own writes; a
18
+ failed write returns as the old value plus the owner's reason.
19
+ - CLI palette shared with `kxm dash`, so one colour cannot mean two things.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KontextMind
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,45 @@
1
+ # @kontextmind/tui
2
+
3
+ Reusable KXM terminal components: one declarative surface model, one renderer,
4
+ one input decoder, one contribution registry, and thin host adapters.
5
+
6
+ `kxm dash` and every configuration surface draw from here so a field looks,
7
+ keys, and fails the same way across the product. Guide:
8
+ [`docs/tui-components.md`](../../../docs/tui-components.md).
9
+
10
+ ## Layout
11
+
12
+ ```text
13
+ src/
14
+ types/ surface contract and its validation; imports nothing outside itself
15
+ tui/ pure controls: keys, layout, theme, panel reducer, renderer, component
16
+ services/ the contribution registry that routes every write to its owner
17
+ adapters/ host bindings: a standalone terminal session and the Pi TUI
18
+ exports/ the public surface; anything unexported may be reshaped
19
+ tests/
20
+ unit/ one file per layer
21
+ helpers/ the reference surface fixture
22
+ ```
23
+
24
+ `src/` may import `@earendil-works/pi-tui` and nothing else external. No
25
+ `node:fs`, no hub, no SQLite: a control that reads disk cannot be rendered in a
26
+ test, and every control here is. The layer rules are enforced by
27
+ `test/core/package-layers.test.ts`, not by memory.
28
+
29
+ ## Tasks
30
+
31
+ | Command | What it does |
32
+ |---|---|
33
+ | `bun run build` | Bundle `src/exports/index.ts` to `dist/index.js` |
34
+ | `bun run test` | Run the unit tests under Node |
35
+ | `bun run test:coverage` | Same, with the coverage floor |
36
+ | `bun run typecheck` | `tsc --noEmit` for this package |
37
+
38
+ From the repository root: `npx nx run tui:<target>` or
39
+ `npx nx run-many -t build,test`.
40
+
41
+ ## Boundary
42
+
43
+ This package renders and routes. It does not own configuration, admit a writer,
44
+ or decide that work is green. Owners publish sections and perform their own
45
+ writes, so the panel can never become a second source of truth.