bazilion 0.0.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.
Files changed (260) hide show
  1. package/.understand-anything/.understandignore +25 -0
  2. package/.understand-anything/fingerprints.json +14267 -0
  3. package/.understand-anything/knowledge-graph.json +18128 -0
  4. package/.understand-anything/meta.json +6 -0
  5. package/CLAUDE.md +164 -0
  6. package/LICENSE +21 -0
  7. package/README.md +195 -0
  8. package/apps/cli/package.json +21 -0
  9. package/apps/cli/src/auth-file.ts +18 -0
  10. package/apps/cli/src/client.ts +37 -0
  11. package/apps/cli/src/columnize.ts +32 -0
  12. package/apps/cli/src/commands/agent.ts +574 -0
  13. package/apps/cli/src/commands/auth.ts +110 -0
  14. package/apps/cli/src/commands/backup.ts +135 -0
  15. package/apps/cli/src/commands/completion.ts +155 -0
  16. package/apps/cli/src/commands/config.ts +95 -0
  17. package/apps/cli/src/commands/doctor.ts +131 -0
  18. package/apps/cli/src/commands/group.ts +132 -0
  19. package/apps/cli/src/commands/inbox.ts +82 -0
  20. package/apps/cli/src/commands/login.ts +73 -0
  21. package/apps/cli/src/commands/memory.ts +106 -0
  22. package/apps/cli/src/commands/profile.ts +259 -0
  23. package/apps/cli/src/commands/provider.ts +170 -0
  24. package/apps/cli/src/commands/send.ts +24 -0
  25. package/apps/cli/src/commands/serve.ts +89 -0
  26. package/apps/cli/src/commands/skill.ts +120 -0
  27. package/apps/cli/src/commands/token.ts +148 -0
  28. package/apps/cli/src/commands/trigger.ts +129 -0
  29. package/apps/cli/src/commands/uninstall.ts +156 -0
  30. package/apps/cli/src/index.ts +196 -0
  31. package/apps/cli/src/paths.ts +12 -0
  32. package/apps/cli/test/agent.test.ts +213 -0
  33. package/apps/cli/test/backup.test.ts +95 -0
  34. package/apps/cli/test/chat.test.ts +539 -0
  35. package/apps/cli/test/columnize.test.ts +29 -0
  36. package/apps/cli/test/completion.test.ts +45 -0
  37. package/apps/cli/test/config-page.test.ts +151 -0
  38. package/apps/cli/test/group.test.ts +74 -0
  39. package/apps/cli/test/helpers.ts +70 -0
  40. package/apps/cli/test/inbox-autodeliver.test.ts +143 -0
  41. package/apps/cli/test/inbox.test.ts +147 -0
  42. package/apps/cli/test/memory.test.ts +69 -0
  43. package/apps/cli/test/profile.test.ts +110 -0
  44. package/apps/cli/test/send.test.ts +30 -0
  45. package/apps/cli/test/server-fixture.ts +212 -0
  46. package/apps/cli/test/session-head.test.ts +45 -0
  47. package/apps/cli/test/skill.test.ts +128 -0
  48. package/apps/cli/test/token.test.ts +109 -0
  49. package/apps/cli/test/trigger.test.ts +245 -0
  50. package/apps/cli/tsconfig.json +4 -0
  51. package/apps/daemon/package.json +31 -0
  52. package/apps/daemon/src/app.ts +41 -0
  53. package/apps/daemon/src/core/agent/archive.ts +8 -0
  54. package/apps/daemon/src/core/agent/delete.ts +30 -0
  55. package/apps/daemon/src/core/agent/resolve.ts +31 -0
  56. package/apps/daemon/src/core/agent/spawn.ts +95 -0
  57. package/apps/daemon/src/core/agent/unarchive.ts +11 -0
  58. package/apps/daemon/src/core/availableModels.ts +58 -0
  59. package/apps/daemon/src/core/db/client.ts +113 -0
  60. package/apps/daemon/src/core/db/migrate.ts +41 -0
  61. package/apps/daemon/src/core/db/migrations/0001_init.sql +179 -0
  62. package/apps/daemon/src/core/group/delete.ts +21 -0
  63. package/apps/daemon/src/core/group/register.ts +68 -0
  64. package/apps/daemon/src/core/index.ts +71 -0
  65. package/apps/daemon/src/core/paths.ts +56 -0
  66. package/apps/daemon/src/core/profile/create.ts +78 -0
  67. package/apps/daemon/src/core/profile/delete.ts +26 -0
  68. package/apps/daemon/src/core/profile/identity.ts +70 -0
  69. package/apps/daemon/src/core/profile/load.ts +45 -0
  70. package/apps/daemon/src/core/profile/seed.ts +74 -0
  71. package/apps/daemon/src/core/profile/templates.ts +60 -0
  72. package/apps/daemon/src/core/profile/update.ts +57 -0
  73. package/apps/daemon/src/core/profile/validate.ts +9 -0
  74. package/apps/daemon/src/core/repos/agents.ts +202 -0
  75. package/apps/daemon/src/core/repos/config.ts +78 -0
  76. package/apps/daemon/src/core/repos/groups.ts +55 -0
  77. package/apps/daemon/src/core/repos/messages.ts +127 -0
  78. package/apps/daemon/src/core/repos/profiles.ts +83 -0
  79. package/apps/daemon/src/core/repos/providerModels.ts +58 -0
  80. package/apps/daemon/src/core/repos/providerState.ts +37 -0
  81. package/apps/daemon/src/core/repos/secrets.ts +145 -0
  82. package/apps/daemon/src/core/repos/skillMeta.ts +49 -0
  83. package/apps/daemon/src/core/repos/triggers.ts +101 -0
  84. package/apps/daemon/src/core/repos/webTokens.ts +87 -0
  85. package/apps/daemon/src/core/secrets.ts +65 -0
  86. package/apps/daemon/src/core/services.ts +264 -0
  87. package/apps/daemon/src/core/skills/discover.ts +28 -0
  88. package/apps/daemon/src/core/skills/import.ts +136 -0
  89. package/apps/daemon/src/core/skills/parse.ts +52 -0
  90. package/apps/daemon/src/core/skills/resolve.ts +50 -0
  91. package/apps/daemon/src/index.ts +45 -0
  92. package/apps/daemon/src/lib/agent-cancel.ts +48 -0
  93. package/apps/daemon/src/lib/agent-id.ts +13 -0
  94. package/apps/daemon/src/lib/agent-turn.ts +56 -0
  95. package/apps/daemon/src/lib/api-key.ts +56 -0
  96. package/apps/daemon/src/lib/auth.ts +41 -0
  97. package/apps/daemon/src/lib/cron.ts +93 -0
  98. package/apps/daemon/src/lib/ctx.ts +80 -0
  99. package/apps/daemon/src/lib/messaging-host.ts +34 -0
  100. package/apps/daemon/src/lib/middleware-auth.ts +52 -0
  101. package/apps/daemon/src/lib/scheduler.ts +294 -0
  102. package/apps/daemon/src/routes/agents.ts +772 -0
  103. package/apps/daemon/src/routes/auth-login.ts +193 -0
  104. package/apps/daemon/src/routes/config.ts +267 -0
  105. package/apps/daemon/src/routes/groups.ts +133 -0
  106. package/apps/daemon/src/routes/messages.ts +29 -0
  107. package/apps/daemon/src/routes/misc.ts +239 -0
  108. package/apps/daemon/src/routes/profiles.ts +197 -0
  109. package/apps/daemon/src/routes/skills.ts +123 -0
  110. package/apps/daemon/src/routes/triggers.ts +29 -0
  111. package/apps/daemon/src/runtime/auth/openai-codex.ts +121 -0
  112. package/apps/daemon/src/runtime/auto-reply/heartbeat.ts +31 -0
  113. package/apps/daemon/src/runtime/index.ts +77 -0
  114. package/apps/daemon/src/runtime/memory/files.ts +103 -0
  115. package/apps/daemon/src/runtime/memory/qmd.ts +152 -0
  116. package/apps/daemon/src/runtime/memory/types.ts +16 -0
  117. package/apps/daemon/src/runtime/pi/events.ts +173 -0
  118. package/apps/daemon/src/runtime/pi/session.ts +536 -0
  119. package/apps/daemon/src/runtime/pi/tools.ts +85 -0
  120. package/apps/daemon/src/runtime/providers/catalog.ts +145 -0
  121. package/apps/daemon/src/runtime/providers/pi-adapter.ts +272 -0
  122. package/apps/daemon/src/runtime/providers/registry.ts +374 -0
  123. package/apps/daemon/src/runtime/providers/retry.ts +176 -0
  124. package/apps/daemon/src/runtime/providers/types.ts +33 -0
  125. package/apps/daemon/src/runtime/session/prompt.ts +83 -0
  126. package/apps/daemon/src/runtime/tools/bootstrap.ts +22 -0
  127. package/apps/daemon/src/runtime/tools/home.ts +114 -0
  128. package/apps/daemon/src/runtime/tools/memory.ts +81 -0
  129. package/apps/daemon/src/runtime/tools/messaging.ts +127 -0
  130. package/apps/daemon/src/runtime/tools/registry.ts +29 -0
  131. package/apps/daemon/src/runtime/tools/types.ts +13 -0
  132. package/apps/daemon/src/runtime/tools/web-extract.ts +110 -0
  133. package/apps/daemon/src/runtime/tools/web-ssrf.ts +245 -0
  134. package/apps/daemon/src/runtime/tools/web.ts +273 -0
  135. package/apps/daemon/src/runtime/worker/entry.ts +221 -0
  136. package/apps/daemon/src/runtime/worker/ipc-protocol.ts +75 -0
  137. package/apps/daemon/src/runtime/worker/spawn.ts +249 -0
  138. package/apps/daemon/test/core/agents.test.ts +319 -0
  139. package/apps/daemon/test/core/available-models.test.ts +63 -0
  140. package/apps/daemon/test/core/config.test.ts +99 -0
  141. package/apps/daemon/test/core/groups.test.ts +63 -0
  142. package/apps/daemon/test/core/helpers.ts +50 -0
  143. package/apps/daemon/test/core/identity.test.ts +85 -0
  144. package/apps/daemon/test/core/migrations.test.ts +83 -0
  145. package/apps/daemon/test/core/profiles.test.ts +182 -0
  146. package/apps/daemon/test/core/provider-models.test.ts +57 -0
  147. package/apps/daemon/test/core/provider-state.test.ts +36 -0
  148. package/apps/daemon/test/core/skill-meta.test.ts +45 -0
  149. package/apps/daemon/test/core/skills.test.ts +271 -0
  150. package/apps/daemon/test/core/triggers.test.ts +182 -0
  151. package/apps/daemon/test/core/web-tokens.test.ts +79 -0
  152. package/apps/daemon/test/cron.test.ts +90 -0
  153. package/apps/daemon/test/runtime/heartbeat.test.ts +34 -0
  154. package/apps/daemon/test/runtime/memory-qmd.test.ts +97 -0
  155. package/apps/daemon/test/runtime/memory.test.ts +78 -0
  156. package/apps/daemon/test/runtime/messaging.test.ts +213 -0
  157. package/apps/daemon/test/runtime/mock-server.ts +65 -0
  158. package/apps/daemon/test/runtime/openai-codex-auth.test.ts +116 -0
  159. package/apps/daemon/test/runtime/providers.test.ts +306 -0
  160. package/apps/daemon/test/runtime/retry.test.ts +191 -0
  161. package/apps/daemon/test/runtime/session-head.test.ts +90 -0
  162. package/apps/daemon/test/runtime/tools-home.test.ts +102 -0
  163. package/apps/daemon/test/runtime/tools-web.test.ts +206 -0
  164. package/apps/daemon/tsconfig.json +4 -0
  165. package/apps/mobile/README.md +60 -0
  166. package/apps/mobile/app/_layout.tsx +58 -0
  167. package/apps/mobile/app/agents/[id]/chat.tsx +486 -0
  168. package/apps/mobile/app/agents/[id]/index.tsx +166 -0
  169. package/apps/mobile/app/agents/index.tsx +212 -0
  170. package/apps/mobile/app/index.tsx +21 -0
  171. package/apps/mobile/app/pair.tsx +226 -0
  172. package/apps/mobile/app/settings.tsx +419 -0
  173. package/apps/mobile/app.json +49 -0
  174. package/apps/mobile/assets/adaptive-icon.png +0 -0
  175. package/apps/mobile/assets/favicon.png +0 -0
  176. package/apps/mobile/assets/icon.png +0 -0
  177. package/apps/mobile/assets/splash-icon.png +0 -0
  178. package/apps/mobile/babel.config.js +6 -0
  179. package/apps/mobile/metro.config.js +28 -0
  180. package/apps/mobile/package.json +44 -0
  181. package/apps/mobile/src/auth.ts +66 -0
  182. package/apps/mobile/src/pair-url.ts +48 -0
  183. package/apps/mobile/src/theme-context.tsx +88 -0
  184. package/apps/mobile/src/theme.ts +135 -0
  185. package/apps/mobile/test/pair-url.test.ts +46 -0
  186. package/apps/mobile/tsconfig.json +23 -0
  187. package/apps/web/components.json +25 -0
  188. package/apps/web/package.json +39 -0
  189. package/apps/web/public/baziu.svg +8 -0
  190. package/apps/web/src/components/AgentTabs.tsx +45 -0
  191. package/apps/web/src/components/BaziuLogo.tsx +21 -0
  192. package/apps/web/src/components/ChatPane.tsx +1033 -0
  193. package/apps/web/src/components/ConfigTabs.tsx +29 -0
  194. package/apps/web/src/components/CopyButton.tsx +68 -0
  195. package/apps/web/src/components/CreateGroupDialog.tsx +127 -0
  196. package/apps/web/src/components/FieldRow.tsx +94 -0
  197. package/apps/web/src/components/Footer.tsx +10 -0
  198. package/apps/web/src/components/PawIcon.tsx +15 -0
  199. package/apps/web/src/components/Sidebar.tsx +287 -0
  200. package/apps/web/src/components/SpawnDialog.tsx +129 -0
  201. package/apps/web/src/components/ThemeToggle.tsx +75 -0
  202. package/apps/web/src/components/TopNav.tsx +34 -0
  203. package/apps/web/src/components/ui/button.tsx +67 -0
  204. package/apps/web/src/components/ui/card.tsx +103 -0
  205. package/apps/web/src/components/ui/checkbox.tsx +31 -0
  206. package/apps/web/src/components/ui/dialog.tsx +168 -0
  207. package/apps/web/src/components/ui/input.tsx +19 -0
  208. package/apps/web/src/components/ui/label.tsx +22 -0
  209. package/apps/web/src/components/ui/radio-group.tsx +44 -0
  210. package/apps/web/src/components/ui/select.tsx +192 -0
  211. package/apps/web/src/components/ui/separator.tsx +26 -0
  212. package/apps/web/src/components/ui/table.tsx +116 -0
  213. package/apps/web/src/components/ui/tabs.tsx +88 -0
  214. package/apps/web/src/components/ui/textarea.tsx +18 -0
  215. package/apps/web/src/lib/auth.ts +50 -0
  216. package/apps/web/src/lib/daemon-client.ts +34 -0
  217. package/apps/web/src/lib/md.ts +45 -0
  218. package/apps/web/src/lib/utils.ts +6 -0
  219. package/apps/web/src/lib/wire-constants.ts +27 -0
  220. package/apps/web/src/routeTree.gen.ts +408 -0
  221. package/apps/web/src/router.tsx +20 -0
  222. package/apps/web/src/routes/__root.tsx +123 -0
  223. package/apps/web/src/routes/agents/$id/inbox.tsx +207 -0
  224. package/apps/web/src/routes/agents/$id/index.tsx +527 -0
  225. package/apps/web/src/routes/agents/$id/triggers.tsx +239 -0
  226. package/apps/web/src/routes/agents/index.tsx +265 -0
  227. package/apps/web/src/routes/api/$.ts +88 -0
  228. package/apps/web/src/routes/config/index.tsx +315 -0
  229. package/apps/web/src/routes/config/services.tsx +49 -0
  230. package/apps/web/src/routes/config/tokens.tsx +192 -0
  231. package/apps/web/src/routes/groups/$id/index.tsx +153 -0
  232. package/apps/web/src/routes/groups/$id/memory.tsx +321 -0
  233. package/apps/web/src/routes/groups/index.tsx +191 -0
  234. package/apps/web/src/routes/index.tsx +133 -0
  235. package/apps/web/src/routes/login.tsx +63 -0
  236. package/apps/web/src/routes/profiles/$id.tsx +549 -0
  237. package/apps/web/src/routes/profiles/index.tsx +458 -0
  238. package/apps/web/src/routes/skills/index.tsx +297 -0
  239. package/apps/web/src/routes/welcome.tsx +61 -0
  240. package/apps/web/src/styles.css +449 -0
  241. package/apps/web/tsconfig.json +25 -0
  242. package/apps/web/vite.config.ts +25 -0
  243. package/biome.json +23 -0
  244. package/docs/agent-engine.md +219 -0
  245. package/docs/architecture.md +627 -0
  246. package/docs/backlog/README.md +42 -0
  247. package/docs/backlog/draft/BAZ-001-a2a-federation-spike.md +125 -0
  248. package/docs/openclaw-reference.md +210 -0
  249. package/package.json +38 -0
  250. package/packages/api-types/package.json +11 -0
  251. package/packages/api-types/src/entities.ts +146 -0
  252. package/packages/api-types/src/events.ts +55 -0
  253. package/packages/api-types/src/index.ts +488 -0
  254. package/packages/api-types/src/memory.ts +15 -0
  255. package/packages/client/package.json +13 -0
  256. package/packages/client/src/index.ts +117 -0
  257. package/pnpm-workspace.yaml +3 -0
  258. package/tsconfig.base.json +23 -0
  259. package/tsconfig.json +11 -0
  260. package/vitest.config.ts +22 -0
@@ -0,0 +1,408 @@
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // noinspection JSUnusedGlobalSymbols
6
+
7
+ // This file was automatically generated by TanStack Router.
8
+ // You should NOT make any changes in this file as it will be overwritten.
9
+ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
10
+
11
+ import { Route as rootRouteImport } from './routes/__root'
12
+ import { Route as WelcomeRouteImport } from './routes/welcome'
13
+ import { Route as LoginRouteImport } from './routes/login'
14
+ import { Route as IndexRouteImport } from './routes/index'
15
+ import { Route as SkillsIndexRouteImport } from './routes/skills/index'
16
+ import { Route as ProfilesIndexRouteImport } from './routes/profiles/index'
17
+ import { Route as GroupsIndexRouteImport } from './routes/groups/index'
18
+ import { Route as ConfigIndexRouteImport } from './routes/config/index'
19
+ import { Route as AgentsIndexRouteImport } from './routes/agents/index'
20
+ import { Route as ProfilesIdRouteImport } from './routes/profiles/$id'
21
+ import { Route as ConfigTokensRouteImport } from './routes/config/tokens'
22
+ import { Route as ConfigServicesRouteImport } from './routes/config/services'
23
+ import { Route as ApiSplatRouteImport } from './routes/api/$'
24
+ import { Route as GroupsIdIndexRouteImport } from './routes/groups/$id/index'
25
+ import { Route as AgentsIdIndexRouteImport } from './routes/agents/$id/index'
26
+ import { Route as GroupsIdMemoryRouteImport } from './routes/groups/$id/memory'
27
+ import { Route as AgentsIdTriggersRouteImport } from './routes/agents/$id/triggers'
28
+ import { Route as AgentsIdInboxRouteImport } from './routes/agents/$id/inbox'
29
+
30
+ const WelcomeRoute = WelcomeRouteImport.update({
31
+ id: '/welcome',
32
+ path: '/welcome',
33
+ getParentRoute: () => rootRouteImport,
34
+ } as any)
35
+ const LoginRoute = LoginRouteImport.update({
36
+ id: '/login',
37
+ path: '/login',
38
+ getParentRoute: () => rootRouteImport,
39
+ } as any)
40
+ const IndexRoute = IndexRouteImport.update({
41
+ id: '/',
42
+ path: '/',
43
+ getParentRoute: () => rootRouteImport,
44
+ } as any)
45
+ const SkillsIndexRoute = SkillsIndexRouteImport.update({
46
+ id: '/skills/',
47
+ path: '/skills/',
48
+ getParentRoute: () => rootRouteImport,
49
+ } as any)
50
+ const ProfilesIndexRoute = ProfilesIndexRouteImport.update({
51
+ id: '/profiles/',
52
+ path: '/profiles/',
53
+ getParentRoute: () => rootRouteImport,
54
+ } as any)
55
+ const GroupsIndexRoute = GroupsIndexRouteImport.update({
56
+ id: '/groups/',
57
+ path: '/groups/',
58
+ getParentRoute: () => rootRouteImport,
59
+ } as any)
60
+ const ConfigIndexRoute = ConfigIndexRouteImport.update({
61
+ id: '/config/',
62
+ path: '/config/',
63
+ getParentRoute: () => rootRouteImport,
64
+ } as any)
65
+ const AgentsIndexRoute = AgentsIndexRouteImport.update({
66
+ id: '/agents/',
67
+ path: '/agents/',
68
+ getParentRoute: () => rootRouteImport,
69
+ } as any)
70
+ const ProfilesIdRoute = ProfilesIdRouteImport.update({
71
+ id: '/profiles/$id',
72
+ path: '/profiles/$id',
73
+ getParentRoute: () => rootRouteImport,
74
+ } as any)
75
+ const ConfigTokensRoute = ConfigTokensRouteImport.update({
76
+ id: '/config/tokens',
77
+ path: '/config/tokens',
78
+ getParentRoute: () => rootRouteImport,
79
+ } as any)
80
+ const ConfigServicesRoute = ConfigServicesRouteImport.update({
81
+ id: '/config/services',
82
+ path: '/config/services',
83
+ getParentRoute: () => rootRouteImport,
84
+ } as any)
85
+ const ApiSplatRoute = ApiSplatRouteImport.update({
86
+ id: '/api/$',
87
+ path: '/api/$',
88
+ getParentRoute: () => rootRouteImport,
89
+ } as any)
90
+ const GroupsIdIndexRoute = GroupsIdIndexRouteImport.update({
91
+ id: '/groups/$id/',
92
+ path: '/groups/$id/',
93
+ getParentRoute: () => rootRouteImport,
94
+ } as any)
95
+ const AgentsIdIndexRoute = AgentsIdIndexRouteImport.update({
96
+ id: '/agents/$id/',
97
+ path: '/agents/$id/',
98
+ getParentRoute: () => rootRouteImport,
99
+ } as any)
100
+ const GroupsIdMemoryRoute = GroupsIdMemoryRouteImport.update({
101
+ id: '/groups/$id/memory',
102
+ path: '/groups/$id/memory',
103
+ getParentRoute: () => rootRouteImport,
104
+ } as any)
105
+ const AgentsIdTriggersRoute = AgentsIdTriggersRouteImport.update({
106
+ id: '/agents/$id/triggers',
107
+ path: '/agents/$id/triggers',
108
+ getParentRoute: () => rootRouteImport,
109
+ } as any)
110
+ const AgentsIdInboxRoute = AgentsIdInboxRouteImport.update({
111
+ id: '/agents/$id/inbox',
112
+ path: '/agents/$id/inbox',
113
+ getParentRoute: () => rootRouteImport,
114
+ } as any)
115
+
116
+ export interface FileRoutesByFullPath {
117
+ '/': typeof IndexRoute
118
+ '/login': typeof LoginRoute
119
+ '/welcome': typeof WelcomeRoute
120
+ '/api/$': typeof ApiSplatRoute
121
+ '/config/services': typeof ConfigServicesRoute
122
+ '/config/tokens': typeof ConfigTokensRoute
123
+ '/profiles/$id': typeof ProfilesIdRoute
124
+ '/agents/': typeof AgentsIndexRoute
125
+ '/config/': typeof ConfigIndexRoute
126
+ '/groups/': typeof GroupsIndexRoute
127
+ '/profiles/': typeof ProfilesIndexRoute
128
+ '/skills/': typeof SkillsIndexRoute
129
+ '/agents/$id/inbox': typeof AgentsIdInboxRoute
130
+ '/agents/$id/triggers': typeof AgentsIdTriggersRoute
131
+ '/groups/$id/memory': typeof GroupsIdMemoryRoute
132
+ '/agents/$id/': typeof AgentsIdIndexRoute
133
+ '/groups/$id/': typeof GroupsIdIndexRoute
134
+ }
135
+ export interface FileRoutesByTo {
136
+ '/': typeof IndexRoute
137
+ '/login': typeof LoginRoute
138
+ '/welcome': typeof WelcomeRoute
139
+ '/api/$': typeof ApiSplatRoute
140
+ '/config/services': typeof ConfigServicesRoute
141
+ '/config/tokens': typeof ConfigTokensRoute
142
+ '/profiles/$id': typeof ProfilesIdRoute
143
+ '/agents': typeof AgentsIndexRoute
144
+ '/config': typeof ConfigIndexRoute
145
+ '/groups': typeof GroupsIndexRoute
146
+ '/profiles': typeof ProfilesIndexRoute
147
+ '/skills': typeof SkillsIndexRoute
148
+ '/agents/$id/inbox': typeof AgentsIdInboxRoute
149
+ '/agents/$id/triggers': typeof AgentsIdTriggersRoute
150
+ '/groups/$id/memory': typeof GroupsIdMemoryRoute
151
+ '/agents/$id': typeof AgentsIdIndexRoute
152
+ '/groups/$id': typeof GroupsIdIndexRoute
153
+ }
154
+ export interface FileRoutesById {
155
+ __root__: typeof rootRouteImport
156
+ '/': typeof IndexRoute
157
+ '/login': typeof LoginRoute
158
+ '/welcome': typeof WelcomeRoute
159
+ '/api/$': typeof ApiSplatRoute
160
+ '/config/services': typeof ConfigServicesRoute
161
+ '/config/tokens': typeof ConfigTokensRoute
162
+ '/profiles/$id': typeof ProfilesIdRoute
163
+ '/agents/': typeof AgentsIndexRoute
164
+ '/config/': typeof ConfigIndexRoute
165
+ '/groups/': typeof GroupsIndexRoute
166
+ '/profiles/': typeof ProfilesIndexRoute
167
+ '/skills/': typeof SkillsIndexRoute
168
+ '/agents/$id/inbox': typeof AgentsIdInboxRoute
169
+ '/agents/$id/triggers': typeof AgentsIdTriggersRoute
170
+ '/groups/$id/memory': typeof GroupsIdMemoryRoute
171
+ '/agents/$id/': typeof AgentsIdIndexRoute
172
+ '/groups/$id/': typeof GroupsIdIndexRoute
173
+ }
174
+ export interface FileRouteTypes {
175
+ fileRoutesByFullPath: FileRoutesByFullPath
176
+ fullPaths:
177
+ | '/'
178
+ | '/login'
179
+ | '/welcome'
180
+ | '/api/$'
181
+ | '/config/services'
182
+ | '/config/tokens'
183
+ | '/profiles/$id'
184
+ | '/agents/'
185
+ | '/config/'
186
+ | '/groups/'
187
+ | '/profiles/'
188
+ | '/skills/'
189
+ | '/agents/$id/inbox'
190
+ | '/agents/$id/triggers'
191
+ | '/groups/$id/memory'
192
+ | '/agents/$id/'
193
+ | '/groups/$id/'
194
+ fileRoutesByTo: FileRoutesByTo
195
+ to:
196
+ | '/'
197
+ | '/login'
198
+ | '/welcome'
199
+ | '/api/$'
200
+ | '/config/services'
201
+ | '/config/tokens'
202
+ | '/profiles/$id'
203
+ | '/agents'
204
+ | '/config'
205
+ | '/groups'
206
+ | '/profiles'
207
+ | '/skills'
208
+ | '/agents/$id/inbox'
209
+ | '/agents/$id/triggers'
210
+ | '/groups/$id/memory'
211
+ | '/agents/$id'
212
+ | '/groups/$id'
213
+ id:
214
+ | '__root__'
215
+ | '/'
216
+ | '/login'
217
+ | '/welcome'
218
+ | '/api/$'
219
+ | '/config/services'
220
+ | '/config/tokens'
221
+ | '/profiles/$id'
222
+ | '/agents/'
223
+ | '/config/'
224
+ | '/groups/'
225
+ | '/profiles/'
226
+ | '/skills/'
227
+ | '/agents/$id/inbox'
228
+ | '/agents/$id/triggers'
229
+ | '/groups/$id/memory'
230
+ | '/agents/$id/'
231
+ | '/groups/$id/'
232
+ fileRoutesById: FileRoutesById
233
+ }
234
+ export interface RootRouteChildren {
235
+ IndexRoute: typeof IndexRoute
236
+ LoginRoute: typeof LoginRoute
237
+ WelcomeRoute: typeof WelcomeRoute
238
+ ApiSplatRoute: typeof ApiSplatRoute
239
+ ConfigServicesRoute: typeof ConfigServicesRoute
240
+ ConfigTokensRoute: typeof ConfigTokensRoute
241
+ ProfilesIdRoute: typeof ProfilesIdRoute
242
+ AgentsIndexRoute: typeof AgentsIndexRoute
243
+ ConfigIndexRoute: typeof ConfigIndexRoute
244
+ GroupsIndexRoute: typeof GroupsIndexRoute
245
+ ProfilesIndexRoute: typeof ProfilesIndexRoute
246
+ SkillsIndexRoute: typeof SkillsIndexRoute
247
+ AgentsIdInboxRoute: typeof AgentsIdInboxRoute
248
+ AgentsIdTriggersRoute: typeof AgentsIdTriggersRoute
249
+ GroupsIdMemoryRoute: typeof GroupsIdMemoryRoute
250
+ AgentsIdIndexRoute: typeof AgentsIdIndexRoute
251
+ GroupsIdIndexRoute: typeof GroupsIdIndexRoute
252
+ }
253
+
254
+ declare module '@tanstack/react-router' {
255
+ interface FileRoutesByPath {
256
+ '/welcome': {
257
+ id: '/welcome'
258
+ path: '/welcome'
259
+ fullPath: '/welcome'
260
+ preLoaderRoute: typeof WelcomeRouteImport
261
+ parentRoute: typeof rootRouteImport
262
+ }
263
+ '/login': {
264
+ id: '/login'
265
+ path: '/login'
266
+ fullPath: '/login'
267
+ preLoaderRoute: typeof LoginRouteImport
268
+ parentRoute: typeof rootRouteImport
269
+ }
270
+ '/': {
271
+ id: '/'
272
+ path: '/'
273
+ fullPath: '/'
274
+ preLoaderRoute: typeof IndexRouteImport
275
+ parentRoute: typeof rootRouteImport
276
+ }
277
+ '/skills/': {
278
+ id: '/skills/'
279
+ path: '/skills'
280
+ fullPath: '/skills/'
281
+ preLoaderRoute: typeof SkillsIndexRouteImport
282
+ parentRoute: typeof rootRouteImport
283
+ }
284
+ '/profiles/': {
285
+ id: '/profiles/'
286
+ path: '/profiles'
287
+ fullPath: '/profiles/'
288
+ preLoaderRoute: typeof ProfilesIndexRouteImport
289
+ parentRoute: typeof rootRouteImport
290
+ }
291
+ '/groups/': {
292
+ id: '/groups/'
293
+ path: '/groups'
294
+ fullPath: '/groups/'
295
+ preLoaderRoute: typeof GroupsIndexRouteImport
296
+ parentRoute: typeof rootRouteImport
297
+ }
298
+ '/config/': {
299
+ id: '/config/'
300
+ path: '/config'
301
+ fullPath: '/config/'
302
+ preLoaderRoute: typeof ConfigIndexRouteImport
303
+ parentRoute: typeof rootRouteImport
304
+ }
305
+ '/agents/': {
306
+ id: '/agents/'
307
+ path: '/agents'
308
+ fullPath: '/agents/'
309
+ preLoaderRoute: typeof AgentsIndexRouteImport
310
+ parentRoute: typeof rootRouteImport
311
+ }
312
+ '/profiles/$id': {
313
+ id: '/profiles/$id'
314
+ path: '/profiles/$id'
315
+ fullPath: '/profiles/$id'
316
+ preLoaderRoute: typeof ProfilesIdRouteImport
317
+ parentRoute: typeof rootRouteImport
318
+ }
319
+ '/config/tokens': {
320
+ id: '/config/tokens'
321
+ path: '/config/tokens'
322
+ fullPath: '/config/tokens'
323
+ preLoaderRoute: typeof ConfigTokensRouteImport
324
+ parentRoute: typeof rootRouteImport
325
+ }
326
+ '/config/services': {
327
+ id: '/config/services'
328
+ path: '/config/services'
329
+ fullPath: '/config/services'
330
+ preLoaderRoute: typeof ConfigServicesRouteImport
331
+ parentRoute: typeof rootRouteImport
332
+ }
333
+ '/api/$': {
334
+ id: '/api/$'
335
+ path: '/api/$'
336
+ fullPath: '/api/$'
337
+ preLoaderRoute: typeof ApiSplatRouteImport
338
+ parentRoute: typeof rootRouteImport
339
+ }
340
+ '/groups/$id/': {
341
+ id: '/groups/$id/'
342
+ path: '/groups/$id'
343
+ fullPath: '/groups/$id/'
344
+ preLoaderRoute: typeof GroupsIdIndexRouteImport
345
+ parentRoute: typeof rootRouteImport
346
+ }
347
+ '/agents/$id/': {
348
+ id: '/agents/$id/'
349
+ path: '/agents/$id'
350
+ fullPath: '/agents/$id/'
351
+ preLoaderRoute: typeof AgentsIdIndexRouteImport
352
+ parentRoute: typeof rootRouteImport
353
+ }
354
+ '/groups/$id/memory': {
355
+ id: '/groups/$id/memory'
356
+ path: '/groups/$id/memory'
357
+ fullPath: '/groups/$id/memory'
358
+ preLoaderRoute: typeof GroupsIdMemoryRouteImport
359
+ parentRoute: typeof rootRouteImport
360
+ }
361
+ '/agents/$id/triggers': {
362
+ id: '/agents/$id/triggers'
363
+ path: '/agents/$id/triggers'
364
+ fullPath: '/agents/$id/triggers'
365
+ preLoaderRoute: typeof AgentsIdTriggersRouteImport
366
+ parentRoute: typeof rootRouteImport
367
+ }
368
+ '/agents/$id/inbox': {
369
+ id: '/agents/$id/inbox'
370
+ path: '/agents/$id/inbox'
371
+ fullPath: '/agents/$id/inbox'
372
+ preLoaderRoute: typeof AgentsIdInboxRouteImport
373
+ parentRoute: typeof rootRouteImport
374
+ }
375
+ }
376
+ }
377
+
378
+ const rootRouteChildren: RootRouteChildren = {
379
+ IndexRoute: IndexRoute,
380
+ LoginRoute: LoginRoute,
381
+ WelcomeRoute: WelcomeRoute,
382
+ ApiSplatRoute: ApiSplatRoute,
383
+ ConfigServicesRoute: ConfigServicesRoute,
384
+ ConfigTokensRoute: ConfigTokensRoute,
385
+ ProfilesIdRoute: ProfilesIdRoute,
386
+ AgentsIndexRoute: AgentsIndexRoute,
387
+ ConfigIndexRoute: ConfigIndexRoute,
388
+ GroupsIndexRoute: GroupsIndexRoute,
389
+ ProfilesIndexRoute: ProfilesIndexRoute,
390
+ SkillsIndexRoute: SkillsIndexRoute,
391
+ AgentsIdInboxRoute: AgentsIdInboxRoute,
392
+ AgentsIdTriggersRoute: AgentsIdTriggersRoute,
393
+ GroupsIdMemoryRoute: GroupsIdMemoryRoute,
394
+ AgentsIdIndexRoute: AgentsIdIndexRoute,
395
+ GroupsIdIndexRoute: GroupsIdIndexRoute,
396
+ }
397
+ export const routeTree = rootRouteImport
398
+ ._addFileChildren(rootRouteChildren)
399
+ ._addFileTypes<FileRouteTypes>()
400
+
401
+ import type { getRouter } from './router.tsx'
402
+ import type { createStart } from '@tanstack/react-start'
403
+ declare module '@tanstack/react-start' {
404
+ interface Register {
405
+ ssr: true
406
+ router: Awaited<ReturnType<typeof getRouter>>
407
+ }
408
+ }
@@ -0,0 +1,20 @@
1
+ import { createRouter as createTanStackRouter } from '@tanstack/react-router'
2
+ import { routeTree } from './routeTree.gen'
3
+
4
+ // TanStack Start v1 calls `getRouter` from the resolved router entry. Older
5
+ // docs/examples use `createRouter`; newer runtime requires the `getRouter`
6
+ // alias too. Export both so we're forward-compat with any plugin version
7
+ // shift, and keep typed `Register` for full router intellisense.
8
+ export function getRouter() {
9
+ return createTanStackRouter({
10
+ routeTree,
11
+ scrollRestoration: true,
12
+ defaultPreload: 'intent',
13
+ })
14
+ }
15
+
16
+ declare module '@tanstack/react-router' {
17
+ interface Register {
18
+ router: ReturnType<typeof getRouter>
19
+ }
20
+ }
@@ -0,0 +1,123 @@
1
+ import {
2
+ HeadContent,
3
+ Link,
4
+ Outlet,
5
+ Scripts,
6
+ createRootRoute,
7
+ redirect,
8
+ useRouterState,
9
+ } from '@tanstack/react-router'
10
+ import { Footer } from '../components/Footer'
11
+ import { TopNav } from '../components/TopNav'
12
+ import { PUBLIC_PATHS, fetchAuthState, isSetupOpen } from '../lib/auth'
13
+ import appCss from '../styles.css?url'
14
+
15
+ // Sync, runs in <head> before paint. Reads 'baziu-theme' from localStorage
16
+ // ('system' | 'light' | 'dark'; default 'system'), resolves against the OS
17
+ // preference, and toggles `.dark` on <html> so the dark CSS variables in
18
+ // styles.css apply during the first paint. ThemeToggle reads/writes the
19
+ // same key. Wrapped in try/catch so a denied localStorage (private mode,
20
+ // disabled storage) just falls through to light.
21
+ const THEME_INIT_SCRIPT = `(function(){try{var t=localStorage.getItem('baziu-theme');var sd=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches;var d=t==='dark'||((t===null||t==='system')&&sd);document.documentElement.classList.toggle('dark',d);}catch(e){}})();`
22
+
23
+ export const Route = createRootRoute({
24
+ beforeLoad: async ({ location }) => {
25
+ const path = location.pathname
26
+ // Login form lives here, no auth required.
27
+ if (PUBLIC_PATHS.has(path)) return
28
+ // /api/* short-circuits via the catch-all proxy + daemon's own auth.
29
+ if (path.startsWith('/api/')) return
30
+
31
+ const auth = await fetchAuthState()
32
+ if (!auth.authed) {
33
+ throw redirect({ to: '/login', search: {} })
34
+ }
35
+ if (!isSetupOpen(path) && !auth.setupComplete) {
36
+ throw redirect({ to: '/welcome' })
37
+ }
38
+ },
39
+ head: () => ({
40
+ meta: [
41
+ { charSet: 'utf-8' },
42
+ { name: 'viewport', content: 'width=device-width, initial-scale=1' },
43
+ { title: 'bazilion' },
44
+ ],
45
+ links: [
46
+ { rel: 'icon', type: 'image/svg+xml', href: '/baziu.svg' },
47
+ { rel: 'preconnect', href: 'https://fonts.googleapis.com' },
48
+ { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossOrigin: '' },
49
+ {
50
+ rel: 'stylesheet',
51
+ href: 'https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..700&family=JetBrains+Mono:wght@400;500&display=swap',
52
+ },
53
+ { rel: 'stylesheet', href: appCss },
54
+ ],
55
+ }),
56
+ component: RootComponent,
57
+ notFoundComponent: NotFound,
58
+ })
59
+
60
+ function NotFound() {
61
+ const pathname = useRouterState({ select: (s) => s.location.pathname })
62
+ return (
63
+ <div className="mx-auto max-w-2xl">
64
+ <div className="card">
65
+ <h1>Not found</h1>
66
+ <p className="muted my-3">
67
+ Nothing lives at <code>{pathname}</code>.
68
+ </p>
69
+ <Link to="/">Back to home</Link>
70
+ </div>
71
+ </div>
72
+ )
73
+ }
74
+
75
+ function RootComponent() {
76
+ const pathname = useRouterState({ select: (s) => s.location.pathname })
77
+ const isLogin = pathname === '/login'
78
+ // Home is full-height (chat fills the viewport) and hides the footer.
79
+ // Everything else gets the standard 1100px-shell + footer.
80
+ const isHome = pathname === '/'
81
+
82
+ return (
83
+ // On home, lock html + body to the viewport so only the chat panel + sidebar
84
+ // scroll internally. Otherwise the global `html { overflow-y: scroll }` rule
85
+ // (which keeps a stable scrollbar gutter on content pages) lets the whole
86
+ // page scroll when chat content overflows.
87
+ // suppressHydrationWarning: the THEME_INIT_SCRIPT below adds/removes the
88
+ // `dark` class on <html> before React hydrates, which would otherwise
89
+ // trip a hydration mismatch.
90
+ <html
91
+ lang="en"
92
+ className={isHome ? 'h-dvh overflow-hidden' : ''}
93
+ suppressHydrationWarning
94
+ >
95
+ <head>
96
+ {/* Runs before paint to apply the user's theme choice without FOUC. */}
97
+ <script dangerouslySetInnerHTML={{ __html: THEME_INIT_SCRIPT }} />
98
+ <HeadContent />
99
+ </head>
100
+ <body className={isHome ? 'h-dvh overflow-hidden' : ''}>
101
+ {isLogin ? (
102
+ <Outlet />
103
+ ) : isHome ? (
104
+ <div className="flex h-dvh flex-col px-6">
105
+ <TopNav />
106
+ <main className="min-h-0 flex-1 overflow-hidden">
107
+ <Outlet />
108
+ </main>
109
+ </div>
110
+ ) : (
111
+ <div className="flex min-h-dvh flex-col px-6 pb-12">
112
+ <TopNav />
113
+ <main className="mt-8 flex-1">
114
+ <Outlet />
115
+ </main>
116
+ <Footer />
117
+ </div>
118
+ )}
119
+ <Scripts />
120
+ </body>
121
+ </html>
122
+ )
123
+ }