@nastechai/agent 0.16.0
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 +104 -0
- package/package.json +60 -0
- package/public/banner.png +0 -0
- package/public/cbanner.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/fonts-terminal/JetBrainsMono-Bold.woff2 +0 -0
- package/public/fonts-terminal/JetBrainsMono-Italic.woff2 +0 -0
- package/public/fonts-terminal/JetBrainsMono-Regular.woff2 +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# NasTech Agent — Web UI
|
|
2
|
+
|
|
3
|
+
Browser-based dashboard for managing NasTech Agent configuration, API keys, and monitoring active sessions.
|
|
4
|
+
|
|
5
|
+
## Stack
|
|
6
|
+
|
|
7
|
+
- **Vite** + **React 19** + **TypeScript**
|
|
8
|
+
- **Tailwind CSS v4** with custom dark theme
|
|
9
|
+
- **shadcn/ui**-style components (hand-rolled, no CLI dependency)
|
|
10
|
+
|
|
11
|
+
## Development
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Start the backend API server
|
|
15
|
+
cd ../
|
|
16
|
+
python -m nastech_cli.main web --no-open
|
|
17
|
+
|
|
18
|
+
# In another terminal, start the Vite dev server (with HMR + API proxy)
|
|
19
|
+
cd web/
|
|
20
|
+
npm install
|
|
21
|
+
npm run dev
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Open the **Vite URL** printed in the terminal (usually `http://localhost:5173`). That is the live-reload UI.
|
|
25
|
+
|
|
26
|
+
`nastech dashboard` on port 9119 serves the **built** bundle from `nastech_cli/web_dist/`, not the Vite dev server — changes in `web/src/` will not appear there until you run `npm run build` and restart the dashboard (or use `web --no-open` + Vite as above).
|
|
27
|
+
|
|
28
|
+
The Vite dev server proxies `/api` requests to `http://127.0.0.1:9119` (the FastAPI backend).
|
|
29
|
+
|
|
30
|
+
## Build
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm run build
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This outputs to `../nastech_cli/web_dist/`, which the FastAPI server serves as a static SPA. The built assets are included in the Python package via `pyproject.toml` package-data.
|
|
37
|
+
|
|
38
|
+
## Structure
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
src/
|
|
42
|
+
├── components/ui/ # Reusable UI primitives (Card, Badge, Button, Input, etc.)
|
|
43
|
+
├── lib/
|
|
44
|
+
│ ├── api.ts # API client — typed fetch wrappers for all backend endpoints
|
|
45
|
+
│ └── utils.ts # cn() helper for Tailwind class merging
|
|
46
|
+
├── pages/
|
|
47
|
+
│ ├── StatusPage # Agent status, active/recent sessions
|
|
48
|
+
│ ├── ConfigPage # Dynamic config editor (reads schema from backend)
|
|
49
|
+
│ └── EnvPage # API key management with save/clear
|
|
50
|
+
├── App.tsx # Main layout and navigation
|
|
51
|
+
├── main.tsx # React entry point
|
|
52
|
+
└── index.css # Tailwind imports and theme variables
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Typography & contrast rules
|
|
56
|
+
|
|
57
|
+
Read before adding or editing UI styles. These rules keep the dashboard legible across all built-in themes and stop drift back into the patterns the design system was just refactored out of.
|
|
58
|
+
|
|
59
|
+
### Text size floor
|
|
60
|
+
|
|
61
|
+
- **Minimum body size: `text-xs` (12px / 0.75rem).** Do not use arbitrary `text-[0.6rem]`, `text-[0.65rem]`, `text-[9px]`, `text-[10px]`, or `text-[11px]` on copy, hints, labels, counts, or badges. Use the standard scale: `text-xs`, `text-sm`, `text-base`.
|
|
62
|
+
- Smaller sizes are only acceptable on **decorative overlays** (chart stripes, empty-state icons) — never on text the user is meant to read.
|
|
63
|
+
|
|
64
|
+
### Opacity floor on text
|
|
65
|
+
|
|
66
|
+
- **Never apply opacity below 0.7 to text.** No `opacity-30`, `opacity-50`, `opacity-60` on `<span>`s, `<p>`s, labels, etc.
|
|
67
|
+
- **Do not stack opacity tokens.** Patterns like `text-muted-foreground/60`, `text-midground/70`, `text-foreground/50` create unpredictable WCAG failures because the parent token already has alpha.
|
|
68
|
+
- Use the **semantic text tokens** from `@nastech-ai/ui`'s `globals.css`:
|
|
69
|
+
- `text-text-primary` — default body text.
|
|
70
|
+
- `text-text-secondary` — subtitles, meta, inactive nav.
|
|
71
|
+
- `text-text-tertiary` — small chrome labels, counts, footnotes.
|
|
72
|
+
- `text-text-disabled` — disabled states.
|
|
73
|
+
- `text-text-on-accent` — text on filled accent surfaces.
|
|
74
|
+
|
|
75
|
+
### Brand uppercase via `text-display`, not raw `uppercase`
|
|
76
|
+
|
|
77
|
+
- The dashboard preserves the Nous brand uppercase aesthetic, but it is **opt-in per element, not global**.
|
|
78
|
+
- Apply uppercase via the DS utility `text-display` on **brand chrome only** — page titles, nav section headings, badges, brand wordmark. DS components (`Button`, `Badge`, `Tabs`, `Segmented`, etc.) already self-apply `text-display`.
|
|
79
|
+
- **Do not introduce new `uppercase`** (the literal Tailwind class) in `nastech-agent/web/src`. Prefer `text-display` for new brand chrome. Legacy `uppercase` call sites (e.g. `components/ui/label.tsx`, `card.tsx`) remain until migrated.
|
|
80
|
+
- The app shell no longer forces uppercase globally, so blanket `normal-case` opt-outs are unnecessary. Use `normal-case` only where a DS component applies `text-display` but the label should stay sentence case — e.g. dynamic user content (model slugs, theme names) **or** fixed UI copy that is not brand chrome (EnvPage “not configured” toggle, sidebar “New chat”).
|
|
81
|
+
|
|
82
|
+
### Fonts
|
|
83
|
+
|
|
84
|
+
Typography is **opt-in per surface**, not global on layout shells — the app shell and page header keep their original theme/expanded fonts; Mondwest applies only where explicitly set.
|
|
85
|
+
|
|
86
|
+
| Tier | Classes | Use for |
|
|
87
|
+
|------|---------|---------|
|
|
88
|
+
| Brand chrome | `font-mondwest text-display` (or `themedChrome`) | Sidebar nav, card section headers (`CardTitle`), Segmented filter buttons, filter panel headings |
|
|
89
|
+
| Themed body | `font-mondwest normal-case` (or `themedBody`) | Card content (`Card`, `CardDescription`), session/platform rows, analytics tables — **scoped to the component** |
|
|
90
|
+
| Page chrome | `font-expanded` | Page header h1 (`PageHeaderProvider`) — sentence case, not `text-display` |
|
|
91
|
+
| Wordmark | `Typography` + size/tracking only | Sidebar/mobile “NasTech Agent” — mixed case, no Mondwest, no `text-display` |
|
|
92
|
+
| Technical | `font-mono-ui` / `font-mono` / `font-courier` | Model slugs, env keys, schedules, YAML, repo URLs |
|
|
93
|
+
|
|
94
|
+
- Do **not** put `themedBody` or `themedFont` on `<main>`, `App`, or other layout wrappers — it overrides component-scoped styles.
|
|
95
|
+
- **`Card`** applies `themedBody`; **`CardTitle`** uses `text-display` (uppercase chrome); **`CardDescription`** uses `themedBody`.
|
|
96
|
+
- **`NouiTypography`** defaults to `font-sans` unless a font prop is passed.
|
|
97
|
+
- Do **not** use raw `font-sans` or `font-display` (theme sans variable) on new dashboard UI — prefer Mondwest tiers above where brand-appropriate.
|
|
98
|
+
|
|
99
|
+
### Color tokens
|
|
100
|
+
|
|
101
|
+
- Prefer **semantic tokens** (`text-text-*`, `bg-card`, `border-border`, `text-foreground`, `text-destructive`, `text-success`, `text-warning`) over raw layer references (`text-midground`, `text-foreground`).
|
|
102
|
+
- `text-muted-foreground` is now wired to `--color-text-secondary`, so existing call sites stay correct, but new code should prefer the semantic name.
|
|
103
|
+
- When you genuinely need a non-token color (icon de-emphasis on a chart, terminal foreground via inline style), keep alpha at `≥ 0.7` for any text.
|
|
104
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nastechai/agent",
|
|
3
|
+
"version": "0.16.0",
|
|
4
|
+
"description": "NasTech-Agent: The self-improving AI agent — creates skills from experience, improves them during use, and runs anywhere",
|
|
5
|
+
"homepage": "https://github.com/nastech-ai/NasTech-Agent",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/nastech-ai/NasTech-Agent.git",
|
|
9
|
+
"directory": "web"
|
|
10
|
+
},
|
|
11
|
+
"bugs": "https://github.com/nastech-ai/NasTech-Agent/issues",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "NasTech",
|
|
15
|
+
"email": "dev@nastech.ai"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"ai",
|
|
19
|
+
"agent",
|
|
20
|
+
"self-improving",
|
|
21
|
+
"skills",
|
|
22
|
+
"autonomous",
|
|
23
|
+
"automation",
|
|
24
|
+
"nastech"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"public"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"dev": "vite",
|
|
35
|
+
"build": "vite build",
|
|
36
|
+
"preview": "vite preview",
|
|
37
|
+
"type-check": "tsc --noEmit",
|
|
38
|
+
"lint": "eslint src",
|
|
39
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\""
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"react": "^18.2.0",
|
|
43
|
+
"react-dom": "^18.2.0",
|
|
44
|
+
"@assistant-ui/react": "^0.1.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"typescript": "^5.3.3",
|
|
48
|
+
"vite": "^5.0.0",
|
|
49
|
+
"@vitejs/plugin-react": "^4.2.0",
|
|
50
|
+
"eslint": "^8.55.0",
|
|
51
|
+
"prettier": "^3.1.0"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=18.0.0",
|
|
55
|
+
"npm": ">=9.0.0"
|
|
56
|
+
},
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|