repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

feat(ui): smith-ui scaffold, frontend abstraction laws, ui grant

84b6eb16c285c213b42ce67d8a84dddbb7590fde

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (8)

+69 / −6 text lines

Diff layout

.system/RULES.md

Modified

+5 / −2 text lines

5454smith/ shared types, StreamFn, AgentTool, config, errors
5555smith-core/ agent loop, sessions, tools, hooks, compaction, cost, trace, replay
5656smith-ai/ providers, auth, model registry, provider streams, MuxProvider
57smith-ui/ abstract UI vocabulary, semantic intents, degradation defaults
5758smith-tui/ terminal events, widgets, layout primitives, render loop, themes
5859smith-harness/ orchestration, wasm plugin host, plugin system, SDK, event bridge, built-ins, help
5960smith-cli/ binary entry point, CLI, session commands, eval/rpc/replay
6364Allowed deps:
6566- `smith`: none.
66- `smith-core`, `smith-ai`, `smith-tui`: only `smith`.
67- `smith-harness`: `smith`, `smith-core`, `smith-ai`, `smith-tui`.
67- `smith-ui`: only `smith`.
68- `smith-core`, `smith-ai`: only `smith`.
69- `smith-tui`: `smith`, `smith-ui`.
70- `smith-harness`: `smith`, `smith-core`, `smith-ai`, `smith-tui`, `smith-ui`.
6871- `smith-cli`: `smith`, `smith-harness`.
6972- `xtask`: none.

.system/specs/SMH-SPEC-PLUG0001-plugin-system/index.md

Modified

+2 / −1 text lines

163163Design laws:
165- Two layers: a core world every plugin sees, plus granted capability interfaces — HTTP via net-scope, credential exchange via secret-proxy, logging — imported only with matching grants.
165- Two layers: a core world every plugin sees, plus granted capability interfaces — HTTP via net-scope, credential exchange via secret-proxy, logging, and UI intents via the UI grant — imported only with matching grants.
166Grants gate not only ambient reach but also resource and presentation decisions: the plugin manager can load, pool, or skip UI-granted plugins per frontend.
166167- Flat interface set inside one world: `http`, `secrets`, `log`, `stream`, `contrib`; resources carry methods, no prefix hierarchies. Grouping pressure means an interface is too wide.
167168- One world major: `smith:plugin@N`; breaking changes bump the world, additive changes stay inside it. Plugin-published contracts carry their own majors (`owner:name@major`). The host embeds the previous world during a deprecation window.
168169- Deprecations are metadata: `@deprecated` with since and removal versions plus a named replacement; deprecated items stay functional until the next world major; `smith plugin check` fails new builds targeting them.

.system/specs/SMH-SPEC-SPEC0001-smith-specification/index.md

Modified

+8 / −0 text lines

277277Unknown values follow the owning schema's explicit policy.
278278Handler-requested configuration changes are runtime-only; only explicit user commands persist configuration.
280## User interface abstraction
282Interface modes are frontends over one core: terminal today; graphical, web, and mobile remain possible on the same crates.
283Plugins never query which frontend is active.
284They emit semantic UI intents whose unsupported behavior is defined per intent — drop, refuse with an event, or persist — never discovered at runtime.
285Transcript appends are durable session events; presentation is frontend detail.
286Frontend-specific escape hatches, where unavoidable, are manifest-declared capabilities.
280288## Terminal interface
282290Smith uses a fullscreen TUI by default.

Cargo.lock

Modified

+4 / −0 text lines

14471447name = "smith-tui"
14481448version = "0.1.0"
1450[[package]]
1451name = "smith-ui"
1452version = "0.1.0"
14501454[[package]]
14511455name = "socket2"
14521456version = "0.6.5"

Cargo.toml

Modified

+1 / −0 text lines

33 "smith",
44 "smith-core",
55 "smith-ai",
6 "smith-ui",
67 "smith-tui",
78 "smith-harness",
89 "smith-cli",

smith-ui/Cargo.toml

Added
new file mode 100644

+8 / −0 text lines

1[package]
2name = "smith-ui"
3edition.workspace = true
4version.workspace = true
5license.workspace = true
6
7[lib]
8path = "src/lib.rs"

smith-ui/src/lib.rs

Added
new file mode 100644

+13 / −0 text lines

1//! Abstract user-interface vocabulary for Smith.
2//!
3//! Frontends — terminal, graphical, web, mobile, RPC, eval — implement this
4//! vocabulary; nothing here knows about any of them.
5//!
6//! Laws live in `SMH-SPEC-SPEC0001` (User interface abstraction):
7//! plugins never query which frontend is active; they emit semantic UI
8//! intents whose unsupported behavior is defined per intent.
9//! Transcript appends are durable session events; presentation is
10//! frontend detail.
11//!
12//! This crate is scaffold: types arrive with the first frontend that
13//! consumes them under the plan that builds it.

xtask/src/main.rs

Modified

+28 / −3 text lines

4040 "smith",
4141 "smith-core",
4242 "smith-ai",
43 "smith-ui",
4344 "smith-tui",
4445 "smith-harness",
4546 "smith-cli",
460461 denied: &[
461462 "smith-core",
462463 "smith-ai",
464 "smith-ui",
463465 "smith-tui",
464466 "smith-harness",
465467 "smith-cli",
467469 },
468470 DependencyRule {
469471 crate_name: "smith-core",
470 denied: &["smith-ai", "smith-tui", "smith-harness", "smith-cli"],
472 denied: &[
473 "smith-ai",
474 "smith-ui",
475 "smith-tui",
476 "smith-harness",
477 "smith-cli",
478 ],
471479 },
472480 DependencyRule {
473481 crate_name: "smith-ai",
474 denied: &["smith-core", "smith-tui", "smith-harness", "smith-cli"],
482 denied: &[
483 "smith-core",
484 "smith-ui",
485 "smith-tui",
486 "smith-harness",
487 "smith-cli",
488 ],
489 },
490 DependencyRule {
491 crate_name: "smith-ui",
492 denied: &[
493 "smith-core",
494 "smith-ai",
495 "smith-tui",
496 "smith-harness",
497 "smith-cli",
498 ],
475499 },
476500 DependencyRule {
477501 crate_name: "smith-tui",
479503 },
480504 DependencyRule {
481505 crate_name: "smith-cli",
482 denied: &["smith-core", "smith-ai", "smith-tui"],
506 denied: &["smith-core", "smith-ai", "smith-ui", "smith-tui"],
483507 },
484508 DependencyRule {
485509 crate_name: "xtask",
487511 "smith",
488512 "smith-core",
489513 "smith-ai",
514 "smith-ui",
490515 "smith-tui",
491516 "smith-harness",
492517 "smith-cli",