bazilion 0.0.0 → 0.1.1

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 (265) hide show
  1. package/README.md +53 -152
  2. package/dist/cli.js +2730 -0
  3. package/dist/cli.js.map +1 -0
  4. package/dist/daemon.js +6460 -0
  5. package/dist/daemon.js.map +1 -0
  6. package/dist/worker.js +2176 -0
  7. package/dist/worker.js.map +1 -0
  8. package/package.json +57 -28
  9. package/.understand-anything/.understandignore +0 -25
  10. package/.understand-anything/fingerprints.json +0 -14267
  11. package/.understand-anything/knowledge-graph.json +0 -18128
  12. package/.understand-anything/meta.json +0 -6
  13. package/CLAUDE.md +0 -164
  14. package/apps/cli/package.json +0 -21
  15. package/apps/cli/src/auth-file.ts +0 -18
  16. package/apps/cli/src/client.ts +0 -37
  17. package/apps/cli/src/columnize.ts +0 -32
  18. package/apps/cli/src/commands/agent.ts +0 -574
  19. package/apps/cli/src/commands/auth.ts +0 -110
  20. package/apps/cli/src/commands/backup.ts +0 -135
  21. package/apps/cli/src/commands/completion.ts +0 -155
  22. package/apps/cli/src/commands/config.ts +0 -95
  23. package/apps/cli/src/commands/doctor.ts +0 -131
  24. package/apps/cli/src/commands/group.ts +0 -132
  25. package/apps/cli/src/commands/inbox.ts +0 -82
  26. package/apps/cli/src/commands/login.ts +0 -73
  27. package/apps/cli/src/commands/memory.ts +0 -106
  28. package/apps/cli/src/commands/profile.ts +0 -259
  29. package/apps/cli/src/commands/provider.ts +0 -170
  30. package/apps/cli/src/commands/send.ts +0 -24
  31. package/apps/cli/src/commands/serve.ts +0 -89
  32. package/apps/cli/src/commands/skill.ts +0 -120
  33. package/apps/cli/src/commands/token.ts +0 -148
  34. package/apps/cli/src/commands/trigger.ts +0 -129
  35. package/apps/cli/src/commands/uninstall.ts +0 -156
  36. package/apps/cli/src/index.ts +0 -196
  37. package/apps/cli/src/paths.ts +0 -12
  38. package/apps/cli/test/agent.test.ts +0 -213
  39. package/apps/cli/test/backup.test.ts +0 -95
  40. package/apps/cli/test/chat.test.ts +0 -539
  41. package/apps/cli/test/columnize.test.ts +0 -29
  42. package/apps/cli/test/completion.test.ts +0 -45
  43. package/apps/cli/test/config-page.test.ts +0 -151
  44. package/apps/cli/test/group.test.ts +0 -74
  45. package/apps/cli/test/helpers.ts +0 -70
  46. package/apps/cli/test/inbox-autodeliver.test.ts +0 -143
  47. package/apps/cli/test/inbox.test.ts +0 -147
  48. package/apps/cli/test/memory.test.ts +0 -69
  49. package/apps/cli/test/profile.test.ts +0 -110
  50. package/apps/cli/test/send.test.ts +0 -30
  51. package/apps/cli/test/server-fixture.ts +0 -212
  52. package/apps/cli/test/session-head.test.ts +0 -45
  53. package/apps/cli/test/skill.test.ts +0 -128
  54. package/apps/cli/test/token.test.ts +0 -109
  55. package/apps/cli/test/trigger.test.ts +0 -245
  56. package/apps/cli/tsconfig.json +0 -4
  57. package/apps/daemon/package.json +0 -31
  58. package/apps/daemon/src/app.ts +0 -41
  59. package/apps/daemon/src/core/agent/archive.ts +0 -8
  60. package/apps/daemon/src/core/agent/delete.ts +0 -30
  61. package/apps/daemon/src/core/agent/resolve.ts +0 -31
  62. package/apps/daemon/src/core/agent/spawn.ts +0 -95
  63. package/apps/daemon/src/core/agent/unarchive.ts +0 -11
  64. package/apps/daemon/src/core/availableModels.ts +0 -58
  65. package/apps/daemon/src/core/db/client.ts +0 -113
  66. package/apps/daemon/src/core/db/migrate.ts +0 -41
  67. package/apps/daemon/src/core/db/migrations/0001_init.sql +0 -179
  68. package/apps/daemon/src/core/group/delete.ts +0 -21
  69. package/apps/daemon/src/core/group/register.ts +0 -68
  70. package/apps/daemon/src/core/index.ts +0 -71
  71. package/apps/daemon/src/core/paths.ts +0 -56
  72. package/apps/daemon/src/core/profile/create.ts +0 -78
  73. package/apps/daemon/src/core/profile/delete.ts +0 -26
  74. package/apps/daemon/src/core/profile/identity.ts +0 -70
  75. package/apps/daemon/src/core/profile/load.ts +0 -45
  76. package/apps/daemon/src/core/profile/seed.ts +0 -74
  77. package/apps/daemon/src/core/profile/templates.ts +0 -60
  78. package/apps/daemon/src/core/profile/update.ts +0 -57
  79. package/apps/daemon/src/core/profile/validate.ts +0 -9
  80. package/apps/daemon/src/core/repos/agents.ts +0 -202
  81. package/apps/daemon/src/core/repos/config.ts +0 -78
  82. package/apps/daemon/src/core/repos/groups.ts +0 -55
  83. package/apps/daemon/src/core/repos/messages.ts +0 -127
  84. package/apps/daemon/src/core/repos/profiles.ts +0 -83
  85. package/apps/daemon/src/core/repos/providerModels.ts +0 -58
  86. package/apps/daemon/src/core/repos/providerState.ts +0 -37
  87. package/apps/daemon/src/core/repos/secrets.ts +0 -145
  88. package/apps/daemon/src/core/repos/skillMeta.ts +0 -49
  89. package/apps/daemon/src/core/repos/triggers.ts +0 -101
  90. package/apps/daemon/src/core/repos/webTokens.ts +0 -87
  91. package/apps/daemon/src/core/secrets.ts +0 -65
  92. package/apps/daemon/src/core/services.ts +0 -264
  93. package/apps/daemon/src/core/skills/discover.ts +0 -28
  94. package/apps/daemon/src/core/skills/import.ts +0 -136
  95. package/apps/daemon/src/core/skills/parse.ts +0 -52
  96. package/apps/daemon/src/core/skills/resolve.ts +0 -50
  97. package/apps/daemon/src/index.ts +0 -45
  98. package/apps/daemon/src/lib/agent-cancel.ts +0 -48
  99. package/apps/daemon/src/lib/agent-id.ts +0 -13
  100. package/apps/daemon/src/lib/agent-turn.ts +0 -56
  101. package/apps/daemon/src/lib/api-key.ts +0 -56
  102. package/apps/daemon/src/lib/auth.ts +0 -41
  103. package/apps/daemon/src/lib/cron.ts +0 -93
  104. package/apps/daemon/src/lib/ctx.ts +0 -80
  105. package/apps/daemon/src/lib/messaging-host.ts +0 -34
  106. package/apps/daemon/src/lib/middleware-auth.ts +0 -52
  107. package/apps/daemon/src/lib/scheduler.ts +0 -294
  108. package/apps/daemon/src/routes/agents.ts +0 -772
  109. package/apps/daemon/src/routes/auth-login.ts +0 -193
  110. package/apps/daemon/src/routes/config.ts +0 -267
  111. package/apps/daemon/src/routes/groups.ts +0 -133
  112. package/apps/daemon/src/routes/messages.ts +0 -29
  113. package/apps/daemon/src/routes/misc.ts +0 -239
  114. package/apps/daemon/src/routes/profiles.ts +0 -197
  115. package/apps/daemon/src/routes/skills.ts +0 -123
  116. package/apps/daemon/src/routes/triggers.ts +0 -29
  117. package/apps/daemon/src/runtime/auth/openai-codex.ts +0 -121
  118. package/apps/daemon/src/runtime/auto-reply/heartbeat.ts +0 -31
  119. package/apps/daemon/src/runtime/index.ts +0 -77
  120. package/apps/daemon/src/runtime/memory/files.ts +0 -103
  121. package/apps/daemon/src/runtime/memory/qmd.ts +0 -152
  122. package/apps/daemon/src/runtime/memory/types.ts +0 -16
  123. package/apps/daemon/src/runtime/pi/events.ts +0 -173
  124. package/apps/daemon/src/runtime/pi/session.ts +0 -536
  125. package/apps/daemon/src/runtime/pi/tools.ts +0 -85
  126. package/apps/daemon/src/runtime/providers/catalog.ts +0 -145
  127. package/apps/daemon/src/runtime/providers/pi-adapter.ts +0 -272
  128. package/apps/daemon/src/runtime/providers/registry.ts +0 -374
  129. package/apps/daemon/src/runtime/providers/retry.ts +0 -176
  130. package/apps/daemon/src/runtime/providers/types.ts +0 -33
  131. package/apps/daemon/src/runtime/session/prompt.ts +0 -83
  132. package/apps/daemon/src/runtime/tools/bootstrap.ts +0 -22
  133. package/apps/daemon/src/runtime/tools/home.ts +0 -114
  134. package/apps/daemon/src/runtime/tools/memory.ts +0 -81
  135. package/apps/daemon/src/runtime/tools/messaging.ts +0 -127
  136. package/apps/daemon/src/runtime/tools/registry.ts +0 -29
  137. package/apps/daemon/src/runtime/tools/types.ts +0 -13
  138. package/apps/daemon/src/runtime/tools/web-extract.ts +0 -110
  139. package/apps/daemon/src/runtime/tools/web-ssrf.ts +0 -245
  140. package/apps/daemon/src/runtime/tools/web.ts +0 -273
  141. package/apps/daemon/src/runtime/worker/entry.ts +0 -221
  142. package/apps/daemon/src/runtime/worker/ipc-protocol.ts +0 -75
  143. package/apps/daemon/src/runtime/worker/spawn.ts +0 -249
  144. package/apps/daemon/test/core/agents.test.ts +0 -319
  145. package/apps/daemon/test/core/available-models.test.ts +0 -63
  146. package/apps/daemon/test/core/config.test.ts +0 -99
  147. package/apps/daemon/test/core/groups.test.ts +0 -63
  148. package/apps/daemon/test/core/helpers.ts +0 -50
  149. package/apps/daemon/test/core/identity.test.ts +0 -85
  150. package/apps/daemon/test/core/migrations.test.ts +0 -83
  151. package/apps/daemon/test/core/profiles.test.ts +0 -182
  152. package/apps/daemon/test/core/provider-models.test.ts +0 -57
  153. package/apps/daemon/test/core/provider-state.test.ts +0 -36
  154. package/apps/daemon/test/core/skill-meta.test.ts +0 -45
  155. package/apps/daemon/test/core/skills.test.ts +0 -271
  156. package/apps/daemon/test/core/triggers.test.ts +0 -182
  157. package/apps/daemon/test/core/web-tokens.test.ts +0 -79
  158. package/apps/daemon/test/cron.test.ts +0 -90
  159. package/apps/daemon/test/runtime/heartbeat.test.ts +0 -34
  160. package/apps/daemon/test/runtime/memory-qmd.test.ts +0 -97
  161. package/apps/daemon/test/runtime/memory.test.ts +0 -78
  162. package/apps/daemon/test/runtime/messaging.test.ts +0 -213
  163. package/apps/daemon/test/runtime/mock-server.ts +0 -65
  164. package/apps/daemon/test/runtime/openai-codex-auth.test.ts +0 -116
  165. package/apps/daemon/test/runtime/providers.test.ts +0 -306
  166. package/apps/daemon/test/runtime/retry.test.ts +0 -191
  167. package/apps/daemon/test/runtime/session-head.test.ts +0 -90
  168. package/apps/daemon/test/runtime/tools-home.test.ts +0 -102
  169. package/apps/daemon/test/runtime/tools-web.test.ts +0 -206
  170. package/apps/daemon/tsconfig.json +0 -4
  171. package/apps/mobile/README.md +0 -60
  172. package/apps/mobile/app/_layout.tsx +0 -58
  173. package/apps/mobile/app/agents/[id]/chat.tsx +0 -486
  174. package/apps/mobile/app/agents/[id]/index.tsx +0 -166
  175. package/apps/mobile/app/agents/index.tsx +0 -212
  176. package/apps/mobile/app/index.tsx +0 -21
  177. package/apps/mobile/app/pair.tsx +0 -226
  178. package/apps/mobile/app/settings.tsx +0 -419
  179. package/apps/mobile/app.json +0 -49
  180. package/apps/mobile/assets/adaptive-icon.png +0 -0
  181. package/apps/mobile/assets/favicon.png +0 -0
  182. package/apps/mobile/assets/icon.png +0 -0
  183. package/apps/mobile/assets/splash-icon.png +0 -0
  184. package/apps/mobile/babel.config.js +0 -6
  185. package/apps/mobile/metro.config.js +0 -28
  186. package/apps/mobile/package.json +0 -44
  187. package/apps/mobile/src/auth.ts +0 -66
  188. package/apps/mobile/src/pair-url.ts +0 -48
  189. package/apps/mobile/src/theme-context.tsx +0 -88
  190. package/apps/mobile/src/theme.ts +0 -135
  191. package/apps/mobile/test/pair-url.test.ts +0 -46
  192. package/apps/mobile/tsconfig.json +0 -23
  193. package/apps/web/components.json +0 -25
  194. package/apps/web/package.json +0 -39
  195. package/apps/web/public/baziu.svg +0 -8
  196. package/apps/web/src/components/AgentTabs.tsx +0 -45
  197. package/apps/web/src/components/BaziuLogo.tsx +0 -21
  198. package/apps/web/src/components/ChatPane.tsx +0 -1033
  199. package/apps/web/src/components/ConfigTabs.tsx +0 -29
  200. package/apps/web/src/components/CopyButton.tsx +0 -68
  201. package/apps/web/src/components/CreateGroupDialog.tsx +0 -127
  202. package/apps/web/src/components/FieldRow.tsx +0 -94
  203. package/apps/web/src/components/Footer.tsx +0 -10
  204. package/apps/web/src/components/PawIcon.tsx +0 -15
  205. package/apps/web/src/components/Sidebar.tsx +0 -287
  206. package/apps/web/src/components/SpawnDialog.tsx +0 -129
  207. package/apps/web/src/components/ThemeToggle.tsx +0 -75
  208. package/apps/web/src/components/TopNav.tsx +0 -34
  209. package/apps/web/src/components/ui/button.tsx +0 -67
  210. package/apps/web/src/components/ui/card.tsx +0 -103
  211. package/apps/web/src/components/ui/checkbox.tsx +0 -31
  212. package/apps/web/src/components/ui/dialog.tsx +0 -168
  213. package/apps/web/src/components/ui/input.tsx +0 -19
  214. package/apps/web/src/components/ui/label.tsx +0 -22
  215. package/apps/web/src/components/ui/radio-group.tsx +0 -44
  216. package/apps/web/src/components/ui/select.tsx +0 -192
  217. package/apps/web/src/components/ui/separator.tsx +0 -26
  218. package/apps/web/src/components/ui/table.tsx +0 -116
  219. package/apps/web/src/components/ui/tabs.tsx +0 -88
  220. package/apps/web/src/components/ui/textarea.tsx +0 -18
  221. package/apps/web/src/lib/auth.ts +0 -50
  222. package/apps/web/src/lib/daemon-client.ts +0 -34
  223. package/apps/web/src/lib/md.ts +0 -45
  224. package/apps/web/src/lib/utils.ts +0 -6
  225. package/apps/web/src/lib/wire-constants.ts +0 -27
  226. package/apps/web/src/routeTree.gen.ts +0 -408
  227. package/apps/web/src/router.tsx +0 -20
  228. package/apps/web/src/routes/__root.tsx +0 -123
  229. package/apps/web/src/routes/agents/$id/inbox.tsx +0 -207
  230. package/apps/web/src/routes/agents/$id/index.tsx +0 -527
  231. package/apps/web/src/routes/agents/$id/triggers.tsx +0 -239
  232. package/apps/web/src/routes/agents/index.tsx +0 -265
  233. package/apps/web/src/routes/api/$.ts +0 -88
  234. package/apps/web/src/routes/config/index.tsx +0 -315
  235. package/apps/web/src/routes/config/services.tsx +0 -49
  236. package/apps/web/src/routes/config/tokens.tsx +0 -192
  237. package/apps/web/src/routes/groups/$id/index.tsx +0 -153
  238. package/apps/web/src/routes/groups/$id/memory.tsx +0 -321
  239. package/apps/web/src/routes/groups/index.tsx +0 -191
  240. package/apps/web/src/routes/index.tsx +0 -133
  241. package/apps/web/src/routes/login.tsx +0 -63
  242. package/apps/web/src/routes/profiles/$id.tsx +0 -549
  243. package/apps/web/src/routes/profiles/index.tsx +0 -458
  244. package/apps/web/src/routes/skills/index.tsx +0 -297
  245. package/apps/web/src/routes/welcome.tsx +0 -61
  246. package/apps/web/src/styles.css +0 -449
  247. package/apps/web/tsconfig.json +0 -25
  248. package/apps/web/vite.config.ts +0 -25
  249. package/biome.json +0 -23
  250. package/docs/agent-engine.md +0 -219
  251. package/docs/architecture.md +0 -627
  252. package/docs/backlog/README.md +0 -42
  253. package/docs/backlog/draft/BAZ-001-a2a-federation-spike.md +0 -125
  254. package/docs/openclaw-reference.md +0 -210
  255. package/packages/api-types/package.json +0 -11
  256. package/packages/api-types/src/entities.ts +0 -146
  257. package/packages/api-types/src/events.ts +0 -55
  258. package/packages/api-types/src/index.ts +0 -488
  259. package/packages/api-types/src/memory.ts +0 -15
  260. package/packages/client/package.json +0 -13
  261. package/packages/client/src/index.ts +0 -117
  262. package/pnpm-workspace.yaml +0 -3
  263. package/tsconfig.base.json +0 -23
  264. package/tsconfig.json +0 -11
  265. package/vitest.config.ts +0 -22
@@ -1,129 +0,0 @@
1
- // Spawn an agent from a profile, with name + group fields. POSTs to
2
- // /api/agents (proxied to daemon) and navigates to ?agent=<newId>.
3
-
4
- import type { Agent, Group } from '@bazilion/api-types'
5
- import { useNavigate } from '@tanstack/react-router'
6
- import { useState } from 'react'
7
- import { DEFAULT_GROUP_ID } from '../lib/wire-constants'
8
-
9
- interface Props {
10
- profileId: string
11
- groupHint?: string
12
- groups: Group[]
13
- onClose: () => void
14
- }
15
-
16
- export function SpawnDialog({ profileId, groupHint, groups, onClose }: Props) {
17
- const navigate = useNavigate()
18
- const [name, setName] = useState('')
19
- const [groupId, setGroupId] = useState(groupHint ?? DEFAULT_GROUP_ID)
20
- const [busy, setBusy] = useState(false)
21
- const [err, setErr] = useState<string | null>(null)
22
-
23
- async function submit(e: React.FormEvent) {
24
- e.preventDefault()
25
- setErr(null)
26
- setBusy(true)
27
- try {
28
- const body: Record<string, string> = { profile: profileId }
29
- if (name.trim()) body.name = name.trim()
30
- if (groupId) body.groupId = groupId
31
- const res = await fetch('/api/agents', {
32
- method: 'POST',
33
- headers: { 'content-type': 'application/json' },
34
- body: JSON.stringify(body),
35
- })
36
- if (!res.ok) {
37
- const e = (await res.json().catch(() => ({}))) as { error?: string }
38
- throw new Error(e.error ?? `${res.status} ${res.statusText}`)
39
- }
40
- const created = (await res.json()) as Agent
41
- onClose()
42
- await navigate({ to: '/', search: { agent: created.id } })
43
- } catch (e) {
44
- setErr((e as Error).message)
45
- setBusy(false)
46
- }
47
- }
48
-
49
- return (
50
- <Backdrop onClose={onClose}>
51
- <form
52
- onSubmit={submit}
53
- className="w-full max-w-md rounded-2xl border bg-card p-6 shadow-lg"
54
- onClick={(e) => e.stopPropagation()}
55
- >
56
- <h3 className="font-serif text-xl text-foreground mb-1">Spawn a new agent</h3>
57
- <p className="text-sm text-muted-foreground mb-4">
58
- Profile: <code className="font-mono">{profileId}</code>
59
- </p>
60
- <label className="block text-sm text-foreground mb-3">
61
- Agent name{' '}
62
- <span className="text-muted-foreground font-normal">
63
- (optional — defaults to the profile's name)
64
- </span>
65
- <input
66
- type="text"
67
- value={name}
68
- onChange={(e) => setName(e.target.value)}
69
- // biome-ignore lint/a11y/noAutofocus: dialog convention
70
- autoFocus
71
- autoComplete="off"
72
- className="mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30"
73
- />
74
- </label>
75
- <label className="block text-sm text-foreground mb-3">
76
- Group
77
- <select
78
- value={groupId}
79
- onChange={(e) => setGroupId(e.target.value)}
80
- className="mt-1 block w-full rounded-md border bg-background px-3 py-2 outline-none focus:ring-2 focus:ring-ring/30"
81
- >
82
- {groups.map((g) => (
83
- <option key={g.id} value={g.id}>
84
- {g.name}
85
- {g.id === DEFAULT_GROUP_ID ? ' (default)' : ''}
86
- </option>
87
- ))}
88
- </select>
89
- </label>
90
- {err && <p className="mt-2 text-sm text-rose-700">{err}</p>}
91
- <div className="mt-5 flex justify-end gap-2">
92
- <button
93
- type="button"
94
- onClick={onClose}
95
- className="rounded-md border px-3 py-2 text-sm text-foreground hover:bg-accent"
96
- >
97
- Cancel
98
- </button>
99
- <button
100
- type="submit"
101
- disabled={busy}
102
- className="rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50"
103
- >
104
- {busy ? 'Creating…' : 'Create'}
105
- </button>
106
- </div>
107
- </form>
108
- </Backdrop>
109
- )
110
- }
111
-
112
- function Backdrop({
113
- children,
114
- onClose,
115
- }: {
116
- children: React.ReactNode
117
- onClose: () => void
118
- }) {
119
- return (
120
- // biome-ignore lint/a11y/useKeyWithClickEvents: ESC is handled by browsers via dialog convention; backdrop click is purely augmentative.
121
- // biome-ignore lint/a11y/noStaticElementInteractions: ditto
122
- <div
123
- onClick={onClose}
124
- className="fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-[1px]"
125
- >
126
- {children}
127
- </div>
128
- )
129
- }
@@ -1,75 +0,0 @@
1
- // Tri-state theme toggle: system → light → dark → system.
2
- // Persists to localStorage key 'baziu-theme' (same key the pre-hydration
3
- // script in __root.tsx reads on first paint). When the choice is 'system',
4
- // we also re-resolve against prefers-color-scheme on every OS-level change.
5
-
6
- import { Monitor, Moon, Sun } from 'lucide-react'
7
- import { useEffect, useState } from 'react'
8
-
9
- type Mode = 'system' | 'light' | 'dark'
10
- const STORAGE_KEY = 'baziu-theme'
11
-
12
- const ICONS: Record<Mode, typeof Sun> = {
13
- system: Monitor,
14
- light: Sun,
15
- dark: Moon,
16
- }
17
-
18
- const NEXT: Record<Mode, Mode> = {
19
- system: 'light',
20
- light: 'dark',
21
- dark: 'system',
22
- }
23
-
24
- function readMode(): Mode {
25
- if (typeof window === 'undefined') return 'system'
26
- const v = window.localStorage.getItem(STORAGE_KEY)
27
- return v === 'light' || v === 'dark' || v === 'system' ? v : 'system'
28
- }
29
-
30
- function applyMode(mode: Mode): void {
31
- const sysDark = window.matchMedia('(prefers-color-scheme: dark)').matches
32
- const dark = mode === 'dark' || (mode === 'system' && sysDark)
33
- document.documentElement.classList.toggle('dark', dark)
34
- }
35
-
36
- export function ThemeToggle() {
37
- // Start with 'system' so SSR + first client render agree; the pre-hydration
38
- // script has already applied the actual class to <html>, and the useEffect
39
- // below syncs state from localStorage immediately after mount.
40
- const [mode, setMode] = useState<Mode>('system')
41
-
42
- useEffect(() => {
43
- setMode(readMode())
44
- }, [])
45
-
46
- // Track OS-level changes while in 'system' mode.
47
- useEffect(() => {
48
- if (mode !== 'system') return
49
- const mq = window.matchMedia('(prefers-color-scheme: dark)')
50
- const onChange = () => applyMode('system')
51
- mq.addEventListener('change', onChange)
52
- return () => mq.removeEventListener('change', onChange)
53
- }, [mode])
54
-
55
- const cycle = () => {
56
- const next = NEXT[mode]
57
- setMode(next)
58
- window.localStorage.setItem(STORAGE_KEY, next)
59
- applyMode(next)
60
- }
61
-
62
- const Icon = ICONS[mode]
63
- const label = `Theme: ${mode}`
64
- return (
65
- <button
66
- type="button"
67
- onClick={cycle}
68
- className="unstyled rounded-md p-1.5 text-mocha transition-colors hover:bg-sapphire-glow hover:text-sapphire"
69
- title={label}
70
- aria-label={label}
71
- >
72
- <Icon className="h-4 w-4" />
73
- </button>
74
- )
75
- }
@@ -1,34 +0,0 @@
1
- import { Link } from '@tanstack/react-router'
2
- import { BaziuLogo } from './BaziuLogo'
3
- import { ThemeToggle } from './ThemeToggle'
4
-
5
- const NAV_LINKS = [
6
- { to: '/profiles', label: 'profiles' },
7
- { to: '/agents', label: 'agents' },
8
- { to: '/groups', label: 'groups' },
9
- { to: '/skills', label: 'skills' },
10
- { to: '/config', label: 'config' },
11
- ] as const
12
-
13
- export function TopNav() {
14
- return (
15
- <nav className="flex flex-wrap items-center gap-y-1 gap-x-1 border-b border-frost py-5">
16
- <Link to="/" className="logo group mr-6 flex items-center gap-[0.45rem] text-charcoal">
17
- <BaziuLogo className="logo-paw h-[28px] w-[28px] transition-transform duration-300 group-hover:rotate-[-8deg] group-hover:scale-[1.08]" />
18
- <span className="font-display text-[1.35rem] tracking-[-0.02em]">bazilion</span>
19
- </Link>
20
- {NAV_LINKS.map((link) => (
21
- <Link
22
- key={link.to}
23
- to={link.to}
24
- className="rounded-sm px-3 py-1.5 text-[0.92em] font-medium text-mocha transition-colors hover:bg-sapphire-glow hover:text-sapphire"
25
- >
26
- {link.label}
27
- </Link>
28
- ))}
29
- <div className="ml-auto">
30
- <ThemeToggle />
31
- </div>
32
- </nav>
33
- )
34
- }
@@ -1,67 +0,0 @@
1
- import * as React from "react"
2
- import { cva, type VariantProps } from "class-variance-authority"
3
- import { Slot } from "radix-ui"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const buttonVariants = cva(
8
- "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
9
- {
10
- variants: {
11
- variant: {
12
- default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
13
- outline:
14
- "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
15
- secondary:
16
- "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
17
- ghost:
18
- "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
19
- destructive:
20
- "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
21
- link: "text-primary underline-offset-4 hover:underline",
22
- },
23
- size: {
24
- default:
25
- "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
26
- xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
27
- sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
28
- lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
29
- icon: "size-8",
30
- "icon-xs":
31
- "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
32
- "icon-sm":
33
- "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
34
- "icon-lg": "size-9",
35
- },
36
- },
37
- defaultVariants: {
38
- variant: "default",
39
- size: "default",
40
- },
41
- }
42
- )
43
-
44
- function Button({
45
- className,
46
- variant = "default",
47
- size = "default",
48
- asChild = false,
49
- ...props
50
- }: React.ComponentProps<"button"> &
51
- VariantProps<typeof buttonVariants> & {
52
- asChild?: boolean
53
- }) {
54
- const Comp = asChild ? Slot.Root : "button"
55
-
56
- return (
57
- <Comp
58
- data-slot="button"
59
- data-variant={variant}
60
- data-size={size}
61
- className={cn(buttonVariants({ variant, size, className }))}
62
- {...props}
63
- />
64
- )
65
- }
66
-
67
- export { Button, buttonVariants }
@@ -1,103 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "@/lib/utils"
4
-
5
- function Card({
6
- className,
7
- size = "default",
8
- ...props
9
- }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
10
- return (
11
- <div
12
- data-slot="card"
13
- data-size={size}
14
- className={cn(
15
- "group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
16
- className
17
- )}
18
- {...props}
19
- />
20
- )
21
- }
22
-
23
- function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
24
- return (
25
- <div
26
- data-slot="card-header"
27
- className={cn(
28
- "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",
29
- className
30
- )}
31
- {...props}
32
- />
33
- )
34
- }
35
-
36
- function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
37
- return (
38
- <div
39
- data-slot="card-title"
40
- className={cn(
41
- "font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",
42
- className
43
- )}
44
- {...props}
45
- />
46
- )
47
- }
48
-
49
- function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
50
- return (
51
- <div
52
- data-slot="card-description"
53
- className={cn("text-sm text-muted-foreground", className)}
54
- {...props}
55
- />
56
- )
57
- }
58
-
59
- function CardAction({ className, ...props }: React.ComponentProps<"div">) {
60
- return (
61
- <div
62
- data-slot="card-action"
63
- className={cn(
64
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
65
- className
66
- )}
67
- {...props}
68
- />
69
- )
70
- }
71
-
72
- function CardContent({ className, ...props }: React.ComponentProps<"div">) {
73
- return (
74
- <div
75
- data-slot="card-content"
76
- className={cn("px-4 group-data-[size=sm]/card:px-3", className)}
77
- {...props}
78
- />
79
- )
80
- }
81
-
82
- function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
83
- return (
84
- <div
85
- data-slot="card-footer"
86
- className={cn(
87
- "flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3",
88
- className
89
- )}
90
- {...props}
91
- />
92
- )
93
- }
94
-
95
- export {
96
- Card,
97
- CardHeader,
98
- CardFooter,
99
- CardTitle,
100
- CardAction,
101
- CardDescription,
102
- CardContent,
103
- }
@@ -1,31 +0,0 @@
1
- import * as React from "react"
2
- import { Checkbox as CheckboxPrimitive } from "radix-ui"
3
-
4
- import { cn } from "@/lib/utils"
5
- import { CheckIcon } from "lucide-react"
6
-
7
- function Checkbox({
8
- className,
9
- ...props
10
- }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
11
- return (
12
- <CheckboxPrimitive.Root
13
- data-slot="checkbox"
14
- className={cn(
15
- "peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
16
- className
17
- )}
18
- {...props}
19
- >
20
- <CheckboxPrimitive.Indicator
21
- data-slot="checkbox-indicator"
22
- className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
23
- >
24
- <CheckIcon
25
- />
26
- </CheckboxPrimitive.Indicator>
27
- </CheckboxPrimitive.Root>
28
- )
29
- }
30
-
31
- export { Checkbox }
@@ -1,168 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Dialog as DialogPrimitive } from "radix-ui"
5
-
6
- import { cn } from "@/lib/utils"
7
- import { Button } from "@/components/ui/button"
8
- import { XIcon } from "lucide-react"
9
-
10
- function Dialog({
11
- ...props
12
- }: React.ComponentProps<typeof DialogPrimitive.Root>) {
13
- return <DialogPrimitive.Root data-slot="dialog" {...props} />
14
- }
15
-
16
- function DialogTrigger({
17
- ...props
18
- }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
19
- return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
20
- }
21
-
22
- function DialogPortal({
23
- ...props
24
- }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
25
- return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
26
- }
27
-
28
- function DialogClose({
29
- ...props
30
- }: React.ComponentProps<typeof DialogPrimitive.Close>) {
31
- return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
32
- }
33
-
34
- function DialogOverlay({
35
- className,
36
- ...props
37
- }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
38
- return (
39
- <DialogPrimitive.Overlay
40
- data-slot="dialog-overlay"
41
- className={cn(
42
- "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
43
- className
44
- )}
45
- {...props}
46
- />
47
- )
48
- }
49
-
50
- function DialogContent({
51
- className,
52
- children,
53
- showCloseButton = true,
54
- ...props
55
- }: React.ComponentProps<typeof DialogPrimitive.Content> & {
56
- showCloseButton?: boolean
57
- }) {
58
- return (
59
- <DialogPortal>
60
- <DialogOverlay />
61
- <DialogPrimitive.Content
62
- data-slot="dialog-content"
63
- className={cn(
64
- "fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
65
- className
66
- )}
67
- {...props}
68
- >
69
- {children}
70
- {showCloseButton && (
71
- <DialogPrimitive.Close data-slot="dialog-close" asChild>
72
- <Button
73
- variant="ghost"
74
- className="absolute top-2 right-2"
75
- size="icon-sm"
76
- >
77
- <XIcon
78
- />
79
- <span className="sr-only">Close</span>
80
- </Button>
81
- </DialogPrimitive.Close>
82
- )}
83
- </DialogPrimitive.Content>
84
- </DialogPortal>
85
- )
86
- }
87
-
88
- function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
89
- return (
90
- <div
91
- data-slot="dialog-header"
92
- className={cn("flex flex-col gap-2", className)}
93
- {...props}
94
- />
95
- )
96
- }
97
-
98
- function DialogFooter({
99
- className,
100
- showCloseButton = false,
101
- children,
102
- ...props
103
- }: React.ComponentProps<"div"> & {
104
- showCloseButton?: boolean
105
- }) {
106
- return (
107
- <div
108
- data-slot="dialog-footer"
109
- className={cn(
110
- "-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",
111
- className
112
- )}
113
- {...props}
114
- >
115
- {children}
116
- {showCloseButton && (
117
- <DialogPrimitive.Close asChild>
118
- <Button variant="outline">Close</Button>
119
- </DialogPrimitive.Close>
120
- )}
121
- </div>
122
- )
123
- }
124
-
125
- function DialogTitle({
126
- className,
127
- ...props
128
- }: React.ComponentProps<typeof DialogPrimitive.Title>) {
129
- return (
130
- <DialogPrimitive.Title
131
- data-slot="dialog-title"
132
- className={cn(
133
- "font-heading text-base leading-none font-medium",
134
- className
135
- )}
136
- {...props}
137
- />
138
- )
139
- }
140
-
141
- function DialogDescription({
142
- className,
143
- ...props
144
- }: React.ComponentProps<typeof DialogPrimitive.Description>) {
145
- return (
146
- <DialogPrimitive.Description
147
- data-slot="dialog-description"
148
- className={cn(
149
- "text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
150
- className
151
- )}
152
- {...props}
153
- />
154
- )
155
- }
156
-
157
- export {
158
- Dialog,
159
- DialogClose,
160
- DialogContent,
161
- DialogDescription,
162
- DialogFooter,
163
- DialogHeader,
164
- DialogOverlay,
165
- DialogPortal,
166
- DialogTitle,
167
- DialogTrigger,
168
- }
@@ -1,19 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "@/lib/utils"
4
-
5
- function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
- return (
7
- <input
8
- type={type}
9
- data-slot="input"
10
- className={cn(
11
- "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
12
- className
13
- )}
14
- {...props}
15
- />
16
- )
17
- }
18
-
19
- export { Input }
@@ -1,22 +0,0 @@
1
- import * as React from "react"
2
- import { Label as LabelPrimitive } from "radix-ui"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- function Label({
7
- className,
8
- ...props
9
- }: React.ComponentProps<typeof LabelPrimitive.Root>) {
10
- return (
11
- <LabelPrimitive.Root
12
- data-slot="label"
13
- className={cn(
14
- "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
15
- className
16
- )}
17
- {...props}
18
- />
19
- )
20
- }
21
-
22
- export { Label }