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.
- package/.understand-anything/.understandignore +25 -0
- package/.understand-anything/fingerprints.json +14267 -0
- package/.understand-anything/knowledge-graph.json +18128 -0
- package/.understand-anything/meta.json +6 -0
- package/CLAUDE.md +164 -0
- package/LICENSE +21 -0
- package/README.md +195 -0
- package/apps/cli/package.json +21 -0
- package/apps/cli/src/auth-file.ts +18 -0
- package/apps/cli/src/client.ts +37 -0
- package/apps/cli/src/columnize.ts +32 -0
- package/apps/cli/src/commands/agent.ts +574 -0
- package/apps/cli/src/commands/auth.ts +110 -0
- package/apps/cli/src/commands/backup.ts +135 -0
- package/apps/cli/src/commands/completion.ts +155 -0
- package/apps/cli/src/commands/config.ts +95 -0
- package/apps/cli/src/commands/doctor.ts +131 -0
- package/apps/cli/src/commands/group.ts +132 -0
- package/apps/cli/src/commands/inbox.ts +82 -0
- package/apps/cli/src/commands/login.ts +73 -0
- package/apps/cli/src/commands/memory.ts +106 -0
- package/apps/cli/src/commands/profile.ts +259 -0
- package/apps/cli/src/commands/provider.ts +170 -0
- package/apps/cli/src/commands/send.ts +24 -0
- package/apps/cli/src/commands/serve.ts +89 -0
- package/apps/cli/src/commands/skill.ts +120 -0
- package/apps/cli/src/commands/token.ts +148 -0
- package/apps/cli/src/commands/trigger.ts +129 -0
- package/apps/cli/src/commands/uninstall.ts +156 -0
- package/apps/cli/src/index.ts +196 -0
- package/apps/cli/src/paths.ts +12 -0
- package/apps/cli/test/agent.test.ts +213 -0
- package/apps/cli/test/backup.test.ts +95 -0
- package/apps/cli/test/chat.test.ts +539 -0
- package/apps/cli/test/columnize.test.ts +29 -0
- package/apps/cli/test/completion.test.ts +45 -0
- package/apps/cli/test/config-page.test.ts +151 -0
- package/apps/cli/test/group.test.ts +74 -0
- package/apps/cli/test/helpers.ts +70 -0
- package/apps/cli/test/inbox-autodeliver.test.ts +143 -0
- package/apps/cli/test/inbox.test.ts +147 -0
- package/apps/cli/test/memory.test.ts +69 -0
- package/apps/cli/test/profile.test.ts +110 -0
- package/apps/cli/test/send.test.ts +30 -0
- package/apps/cli/test/server-fixture.ts +212 -0
- package/apps/cli/test/session-head.test.ts +45 -0
- package/apps/cli/test/skill.test.ts +128 -0
- package/apps/cli/test/token.test.ts +109 -0
- package/apps/cli/test/trigger.test.ts +245 -0
- package/apps/cli/tsconfig.json +4 -0
- package/apps/daemon/package.json +31 -0
- package/apps/daemon/src/app.ts +41 -0
- package/apps/daemon/src/core/agent/archive.ts +8 -0
- package/apps/daemon/src/core/agent/delete.ts +30 -0
- package/apps/daemon/src/core/agent/resolve.ts +31 -0
- package/apps/daemon/src/core/agent/spawn.ts +95 -0
- package/apps/daemon/src/core/agent/unarchive.ts +11 -0
- package/apps/daemon/src/core/availableModels.ts +58 -0
- package/apps/daemon/src/core/db/client.ts +113 -0
- package/apps/daemon/src/core/db/migrate.ts +41 -0
- package/apps/daemon/src/core/db/migrations/0001_init.sql +179 -0
- package/apps/daemon/src/core/group/delete.ts +21 -0
- package/apps/daemon/src/core/group/register.ts +68 -0
- package/apps/daemon/src/core/index.ts +71 -0
- package/apps/daemon/src/core/paths.ts +56 -0
- package/apps/daemon/src/core/profile/create.ts +78 -0
- package/apps/daemon/src/core/profile/delete.ts +26 -0
- package/apps/daemon/src/core/profile/identity.ts +70 -0
- package/apps/daemon/src/core/profile/load.ts +45 -0
- package/apps/daemon/src/core/profile/seed.ts +74 -0
- package/apps/daemon/src/core/profile/templates.ts +60 -0
- package/apps/daemon/src/core/profile/update.ts +57 -0
- package/apps/daemon/src/core/profile/validate.ts +9 -0
- package/apps/daemon/src/core/repos/agents.ts +202 -0
- package/apps/daemon/src/core/repos/config.ts +78 -0
- package/apps/daemon/src/core/repos/groups.ts +55 -0
- package/apps/daemon/src/core/repos/messages.ts +127 -0
- package/apps/daemon/src/core/repos/profiles.ts +83 -0
- package/apps/daemon/src/core/repos/providerModels.ts +58 -0
- package/apps/daemon/src/core/repos/providerState.ts +37 -0
- package/apps/daemon/src/core/repos/secrets.ts +145 -0
- package/apps/daemon/src/core/repos/skillMeta.ts +49 -0
- package/apps/daemon/src/core/repos/triggers.ts +101 -0
- package/apps/daemon/src/core/repos/webTokens.ts +87 -0
- package/apps/daemon/src/core/secrets.ts +65 -0
- package/apps/daemon/src/core/services.ts +264 -0
- package/apps/daemon/src/core/skills/discover.ts +28 -0
- package/apps/daemon/src/core/skills/import.ts +136 -0
- package/apps/daemon/src/core/skills/parse.ts +52 -0
- package/apps/daemon/src/core/skills/resolve.ts +50 -0
- package/apps/daemon/src/index.ts +45 -0
- package/apps/daemon/src/lib/agent-cancel.ts +48 -0
- package/apps/daemon/src/lib/agent-id.ts +13 -0
- package/apps/daemon/src/lib/agent-turn.ts +56 -0
- package/apps/daemon/src/lib/api-key.ts +56 -0
- package/apps/daemon/src/lib/auth.ts +41 -0
- package/apps/daemon/src/lib/cron.ts +93 -0
- package/apps/daemon/src/lib/ctx.ts +80 -0
- package/apps/daemon/src/lib/messaging-host.ts +34 -0
- package/apps/daemon/src/lib/middleware-auth.ts +52 -0
- package/apps/daemon/src/lib/scheduler.ts +294 -0
- package/apps/daemon/src/routes/agents.ts +772 -0
- package/apps/daemon/src/routes/auth-login.ts +193 -0
- package/apps/daemon/src/routes/config.ts +267 -0
- package/apps/daemon/src/routes/groups.ts +133 -0
- package/apps/daemon/src/routes/messages.ts +29 -0
- package/apps/daemon/src/routes/misc.ts +239 -0
- package/apps/daemon/src/routes/profiles.ts +197 -0
- package/apps/daemon/src/routes/skills.ts +123 -0
- package/apps/daemon/src/routes/triggers.ts +29 -0
- package/apps/daemon/src/runtime/auth/openai-codex.ts +121 -0
- package/apps/daemon/src/runtime/auto-reply/heartbeat.ts +31 -0
- package/apps/daemon/src/runtime/index.ts +77 -0
- package/apps/daemon/src/runtime/memory/files.ts +103 -0
- package/apps/daemon/src/runtime/memory/qmd.ts +152 -0
- package/apps/daemon/src/runtime/memory/types.ts +16 -0
- package/apps/daemon/src/runtime/pi/events.ts +173 -0
- package/apps/daemon/src/runtime/pi/session.ts +536 -0
- package/apps/daemon/src/runtime/pi/tools.ts +85 -0
- package/apps/daemon/src/runtime/providers/catalog.ts +145 -0
- package/apps/daemon/src/runtime/providers/pi-adapter.ts +272 -0
- package/apps/daemon/src/runtime/providers/registry.ts +374 -0
- package/apps/daemon/src/runtime/providers/retry.ts +176 -0
- package/apps/daemon/src/runtime/providers/types.ts +33 -0
- package/apps/daemon/src/runtime/session/prompt.ts +83 -0
- package/apps/daemon/src/runtime/tools/bootstrap.ts +22 -0
- package/apps/daemon/src/runtime/tools/home.ts +114 -0
- package/apps/daemon/src/runtime/tools/memory.ts +81 -0
- package/apps/daemon/src/runtime/tools/messaging.ts +127 -0
- package/apps/daemon/src/runtime/tools/registry.ts +29 -0
- package/apps/daemon/src/runtime/tools/types.ts +13 -0
- package/apps/daemon/src/runtime/tools/web-extract.ts +110 -0
- package/apps/daemon/src/runtime/tools/web-ssrf.ts +245 -0
- package/apps/daemon/src/runtime/tools/web.ts +273 -0
- package/apps/daemon/src/runtime/worker/entry.ts +221 -0
- package/apps/daemon/src/runtime/worker/ipc-protocol.ts +75 -0
- package/apps/daemon/src/runtime/worker/spawn.ts +249 -0
- package/apps/daemon/test/core/agents.test.ts +319 -0
- package/apps/daemon/test/core/available-models.test.ts +63 -0
- package/apps/daemon/test/core/config.test.ts +99 -0
- package/apps/daemon/test/core/groups.test.ts +63 -0
- package/apps/daemon/test/core/helpers.ts +50 -0
- package/apps/daemon/test/core/identity.test.ts +85 -0
- package/apps/daemon/test/core/migrations.test.ts +83 -0
- package/apps/daemon/test/core/profiles.test.ts +182 -0
- package/apps/daemon/test/core/provider-models.test.ts +57 -0
- package/apps/daemon/test/core/provider-state.test.ts +36 -0
- package/apps/daemon/test/core/skill-meta.test.ts +45 -0
- package/apps/daemon/test/core/skills.test.ts +271 -0
- package/apps/daemon/test/core/triggers.test.ts +182 -0
- package/apps/daemon/test/core/web-tokens.test.ts +79 -0
- package/apps/daemon/test/cron.test.ts +90 -0
- package/apps/daemon/test/runtime/heartbeat.test.ts +34 -0
- package/apps/daemon/test/runtime/memory-qmd.test.ts +97 -0
- package/apps/daemon/test/runtime/memory.test.ts +78 -0
- package/apps/daemon/test/runtime/messaging.test.ts +213 -0
- package/apps/daemon/test/runtime/mock-server.ts +65 -0
- package/apps/daemon/test/runtime/openai-codex-auth.test.ts +116 -0
- package/apps/daemon/test/runtime/providers.test.ts +306 -0
- package/apps/daemon/test/runtime/retry.test.ts +191 -0
- package/apps/daemon/test/runtime/session-head.test.ts +90 -0
- package/apps/daemon/test/runtime/tools-home.test.ts +102 -0
- package/apps/daemon/test/runtime/tools-web.test.ts +206 -0
- package/apps/daemon/tsconfig.json +4 -0
- package/apps/mobile/README.md +60 -0
- package/apps/mobile/app/_layout.tsx +58 -0
- package/apps/mobile/app/agents/[id]/chat.tsx +486 -0
- package/apps/mobile/app/agents/[id]/index.tsx +166 -0
- package/apps/mobile/app/agents/index.tsx +212 -0
- package/apps/mobile/app/index.tsx +21 -0
- package/apps/mobile/app/pair.tsx +226 -0
- package/apps/mobile/app/settings.tsx +419 -0
- package/apps/mobile/app.json +49 -0
- package/apps/mobile/assets/adaptive-icon.png +0 -0
- package/apps/mobile/assets/favicon.png +0 -0
- package/apps/mobile/assets/icon.png +0 -0
- package/apps/mobile/assets/splash-icon.png +0 -0
- package/apps/mobile/babel.config.js +6 -0
- package/apps/mobile/metro.config.js +28 -0
- package/apps/mobile/package.json +44 -0
- package/apps/mobile/src/auth.ts +66 -0
- package/apps/mobile/src/pair-url.ts +48 -0
- package/apps/mobile/src/theme-context.tsx +88 -0
- package/apps/mobile/src/theme.ts +135 -0
- package/apps/mobile/test/pair-url.test.ts +46 -0
- package/apps/mobile/tsconfig.json +23 -0
- package/apps/web/components.json +25 -0
- package/apps/web/package.json +39 -0
- package/apps/web/public/baziu.svg +8 -0
- package/apps/web/src/components/AgentTabs.tsx +45 -0
- package/apps/web/src/components/BaziuLogo.tsx +21 -0
- package/apps/web/src/components/ChatPane.tsx +1033 -0
- package/apps/web/src/components/ConfigTabs.tsx +29 -0
- package/apps/web/src/components/CopyButton.tsx +68 -0
- package/apps/web/src/components/CreateGroupDialog.tsx +127 -0
- package/apps/web/src/components/FieldRow.tsx +94 -0
- package/apps/web/src/components/Footer.tsx +10 -0
- package/apps/web/src/components/PawIcon.tsx +15 -0
- package/apps/web/src/components/Sidebar.tsx +287 -0
- package/apps/web/src/components/SpawnDialog.tsx +129 -0
- package/apps/web/src/components/ThemeToggle.tsx +75 -0
- package/apps/web/src/components/TopNav.tsx +34 -0
- package/apps/web/src/components/ui/button.tsx +67 -0
- package/apps/web/src/components/ui/card.tsx +103 -0
- package/apps/web/src/components/ui/checkbox.tsx +31 -0
- package/apps/web/src/components/ui/dialog.tsx +168 -0
- package/apps/web/src/components/ui/input.tsx +19 -0
- package/apps/web/src/components/ui/label.tsx +22 -0
- package/apps/web/src/components/ui/radio-group.tsx +44 -0
- package/apps/web/src/components/ui/select.tsx +192 -0
- package/apps/web/src/components/ui/separator.tsx +26 -0
- package/apps/web/src/components/ui/table.tsx +116 -0
- package/apps/web/src/components/ui/tabs.tsx +88 -0
- package/apps/web/src/components/ui/textarea.tsx +18 -0
- package/apps/web/src/lib/auth.ts +50 -0
- package/apps/web/src/lib/daemon-client.ts +34 -0
- package/apps/web/src/lib/md.ts +45 -0
- package/apps/web/src/lib/utils.ts +6 -0
- package/apps/web/src/lib/wire-constants.ts +27 -0
- package/apps/web/src/routeTree.gen.ts +408 -0
- package/apps/web/src/router.tsx +20 -0
- package/apps/web/src/routes/__root.tsx +123 -0
- package/apps/web/src/routes/agents/$id/inbox.tsx +207 -0
- package/apps/web/src/routes/agents/$id/index.tsx +527 -0
- package/apps/web/src/routes/agents/$id/triggers.tsx +239 -0
- package/apps/web/src/routes/agents/index.tsx +265 -0
- package/apps/web/src/routes/api/$.ts +88 -0
- package/apps/web/src/routes/config/index.tsx +315 -0
- package/apps/web/src/routes/config/services.tsx +49 -0
- package/apps/web/src/routes/config/tokens.tsx +192 -0
- package/apps/web/src/routes/groups/$id/index.tsx +153 -0
- package/apps/web/src/routes/groups/$id/memory.tsx +321 -0
- package/apps/web/src/routes/groups/index.tsx +191 -0
- package/apps/web/src/routes/index.tsx +133 -0
- package/apps/web/src/routes/login.tsx +63 -0
- package/apps/web/src/routes/profiles/$id.tsx +549 -0
- package/apps/web/src/routes/profiles/index.tsx +458 -0
- package/apps/web/src/routes/skills/index.tsx +297 -0
- package/apps/web/src/routes/welcome.tsx +61 -0
- package/apps/web/src/styles.css +449 -0
- package/apps/web/tsconfig.json +25 -0
- package/apps/web/vite.config.ts +25 -0
- package/biome.json +23 -0
- package/docs/agent-engine.md +219 -0
- package/docs/architecture.md +627 -0
- package/docs/backlog/README.md +42 -0
- package/docs/backlog/draft/BAZ-001-a2a-federation-spike.md +125 -0
- package/docs/openclaw-reference.md +210 -0
- package/package.json +38 -0
- package/packages/api-types/package.json +11 -0
- package/packages/api-types/src/entities.ts +146 -0
- package/packages/api-types/src/events.ts +55 -0
- package/packages/api-types/src/index.ts +488 -0
- package/packages/api-types/src/memory.ts +15 -0
- package/packages/client/package.json +13 -0
- package/packages/client/src/index.ts +117 -0
- package/pnpm-workspace.yaml +3 -0
- package/tsconfig.base.json +23 -0
- package/tsconfig.json +11 -0
- package/vitest.config.ts +22 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import type { SkillInfo } from '@bazilion/api-types'
|
|
2
|
+
import { createFileRoute, useRouter } from '@tanstack/react-router'
|
|
3
|
+
import { createServerFn } from '@tanstack/react-start'
|
|
4
|
+
import { type ChangeEvent, type DragEvent, useRef, useState } from 'react'
|
|
5
|
+
import { daemonClient } from '../../lib/daemon-client'
|
|
6
|
+
|
|
7
|
+
const fetchSkills = createServerFn({ method: 'GET' }).handler(() =>
|
|
8
|
+
daemonClient().get<SkillInfo[]>('/api/skills'),
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
export const Route = createFileRoute('/skills/')({
|
|
12
|
+
loader: () => fetchSkills(),
|
|
13
|
+
component: SkillsPage,
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
type Tab = 'openclaw' | 'path' | 'zip'
|
|
17
|
+
|
|
18
|
+
function SkillsPage() {
|
|
19
|
+
const skills = Route.useLoaderData()
|
|
20
|
+
const router = useRouter()
|
|
21
|
+
|
|
22
|
+
async function remove(name: string) {
|
|
23
|
+
if (!confirm(`remove skill "${name}"? this deletes the directory on disk.`)) return
|
|
24
|
+
const res = await fetch(`/api/skills/${encodeURIComponent(name)}`, { method: 'DELETE' })
|
|
25
|
+
if (!res.ok && res.status !== 204) {
|
|
26
|
+
alert(res.statusText)
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
await router.invalidate()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div>
|
|
34
|
+
<h1>skills</h1>
|
|
35
|
+
<ImportCard onImported={() => router.invalidate()} />
|
|
36
|
+
|
|
37
|
+
<table>
|
|
38
|
+
<thead>
|
|
39
|
+
<tr>
|
|
40
|
+
<th>name</th>
|
|
41
|
+
<th>description</th>
|
|
42
|
+
<th>source</th>
|
|
43
|
+
<th />
|
|
44
|
+
</tr>
|
|
45
|
+
</thead>
|
|
46
|
+
<tbody>
|
|
47
|
+
{skills.length === 0 && (
|
|
48
|
+
<tr>
|
|
49
|
+
<td colSpan={4} className="muted">
|
|
50
|
+
no skills installed yet
|
|
51
|
+
</td>
|
|
52
|
+
</tr>
|
|
53
|
+
)}
|
|
54
|
+
{skills.map((s) => (
|
|
55
|
+
<tr key={s.name}>
|
|
56
|
+
<td>
|
|
57
|
+
<code>{s.name}</code>
|
|
58
|
+
</td>
|
|
59
|
+
<td>
|
|
60
|
+
{s.parseError ? (
|
|
61
|
+
<span className="text-[#9B3D3D]">parse error: {s.parseError}</span>
|
|
62
|
+
) : (
|
|
63
|
+
s.description
|
|
64
|
+
)}
|
|
65
|
+
</td>
|
|
66
|
+
<td className="text-[0.78em] text-mocha-light">
|
|
67
|
+
<span className="font-mono">{s.source ?? '(unknown)'}</span>
|
|
68
|
+
{s.importedAt && (
|
|
69
|
+
<div className="font-mono">
|
|
70
|
+
{new Date(s.importedAt).toLocaleDateString()}
|
|
71
|
+
</div>
|
|
72
|
+
)}
|
|
73
|
+
</td>
|
|
74
|
+
<td>
|
|
75
|
+
<button type="button" className="ghost-btn" onClick={() => remove(s.name)}>
|
|
76
|
+
remove
|
|
77
|
+
</button>
|
|
78
|
+
</td>
|
|
79
|
+
</tr>
|
|
80
|
+
))}
|
|
81
|
+
</tbody>
|
|
82
|
+
</table>
|
|
83
|
+
</div>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function ImportCard({ onImported }: { onImported: () => void }) {
|
|
88
|
+
const [tab, setTab] = useState<Tab>('openclaw')
|
|
89
|
+
const [path, setPath] = useState('')
|
|
90
|
+
const [force, setForce] = useState(false)
|
|
91
|
+
const [zipFile, setZipFile] = useState<File | null>(null)
|
|
92
|
+
const [dragOver, setDragOver] = useState(false)
|
|
93
|
+
const [err, setErr] = useState<string | null>(null)
|
|
94
|
+
const [submitting, setSubmitting] = useState(false)
|
|
95
|
+
const fileInput = useRef<HTMLInputElement>(null)
|
|
96
|
+
|
|
97
|
+
async function submit(e: React.FormEvent<HTMLFormElement>) {
|
|
98
|
+
e.preventDefault()
|
|
99
|
+
setErr(null)
|
|
100
|
+
setSubmitting(true)
|
|
101
|
+
try {
|
|
102
|
+
let res: Response
|
|
103
|
+
if (tab === 'zip') {
|
|
104
|
+
if (!zipFile) {
|
|
105
|
+
setErr('choose a .zip file first')
|
|
106
|
+
setSubmitting(false)
|
|
107
|
+
return
|
|
108
|
+
}
|
|
109
|
+
const fd = new FormData()
|
|
110
|
+
fd.set('file', zipFile)
|
|
111
|
+
if (force) fd.set('force', 'true')
|
|
112
|
+
res = await fetch('/api/skills/import', { method: 'POST', body: fd })
|
|
113
|
+
} else {
|
|
114
|
+
let source: string
|
|
115
|
+
if (tab === 'openclaw') {
|
|
116
|
+
source = 'openclaw'
|
|
117
|
+
} else {
|
|
118
|
+
source = path.trim()
|
|
119
|
+
if (!source) {
|
|
120
|
+
setErr('fill in the server path')
|
|
121
|
+
setSubmitting(false)
|
|
122
|
+
return
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
res = await fetch('/api/skills/import', {
|
|
126
|
+
method: 'POST',
|
|
127
|
+
headers: { 'content-type': 'application/json' },
|
|
128
|
+
body: JSON.stringify({ source, force }),
|
|
129
|
+
})
|
|
130
|
+
}
|
|
131
|
+
if (!res.ok) {
|
|
132
|
+
const e2 = (await res.json().catch(() => null)) as { error?: string } | null
|
|
133
|
+
throw new Error(e2?.error ?? `${res.status} ${res.statusText}`)
|
|
134
|
+
}
|
|
135
|
+
setPath('')
|
|
136
|
+
setZipFile(null)
|
|
137
|
+
onImported()
|
|
138
|
+
} catch (e2) {
|
|
139
|
+
setErr((e2 as Error).message)
|
|
140
|
+
} finally {
|
|
141
|
+
setSubmitting(false)
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function onFileChange(e: ChangeEvent<HTMLInputElement>) {
|
|
146
|
+
const f = e.target.files?.[0] ?? null
|
|
147
|
+
setZipFile(f)
|
|
148
|
+
}
|
|
149
|
+
function onDrop(e: DragEvent<HTMLLabelElement>) {
|
|
150
|
+
e.preventDefault()
|
|
151
|
+
setDragOver(false)
|
|
152
|
+
const files = e.dataTransfer?.files
|
|
153
|
+
if (!files || files.length === 0) return
|
|
154
|
+
const f = files[0]
|
|
155
|
+
if (!f) return
|
|
156
|
+
if (!/\.zip$/i.test(f.name)) {
|
|
157
|
+
setErr('only .zip archives are supported')
|
|
158
|
+
return
|
|
159
|
+
}
|
|
160
|
+
setZipFile(f)
|
|
161
|
+
if (fileInput.current) {
|
|
162
|
+
// Sync the underlying input so the label reflects state if anyone reads it.
|
|
163
|
+
const dt = new DataTransfer()
|
|
164
|
+
dt.items.add(f)
|
|
165
|
+
fileInput.current.files = dt.files
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return (
|
|
170
|
+
<section className="card">
|
|
171
|
+
<h3 className="mb-1">import skills</h3>
|
|
172
|
+
<p className="muted mb-3 text-[0.88em]">
|
|
173
|
+
pick a source. Each skill's <code>SKILL.md</code> body is injected into the system
|
|
174
|
+
prompt of any agent it's attached to.
|
|
175
|
+
</p>
|
|
176
|
+
|
|
177
|
+
<div
|
|
178
|
+
role="tablist"
|
|
179
|
+
className="mb-4 inline-flex gap-0 rounded-md border border-frost bg-ivory p-1"
|
|
180
|
+
>
|
|
181
|
+
{[
|
|
182
|
+
{ id: 'openclaw' as const, label: 'OpenClaw' },
|
|
183
|
+
{ id: 'path' as const, label: 'server directory' },
|
|
184
|
+
{ id: 'zip' as const, label: 'upload zip' },
|
|
185
|
+
].map((it) => (
|
|
186
|
+
<button
|
|
187
|
+
key={it.id}
|
|
188
|
+
type="button"
|
|
189
|
+
role="tab"
|
|
190
|
+
aria-selected={tab === it.id}
|
|
191
|
+
onClick={() => {
|
|
192
|
+
setTab(it.id)
|
|
193
|
+
setErr(null)
|
|
194
|
+
}}
|
|
195
|
+
className={`unstyled cursor-pointer rounded-sm border-none bg-transparent px-3 py-1.5 text-[0.88em] font-medium transition-colors ${
|
|
196
|
+
tab === it.id
|
|
197
|
+
? 'bg-snow text-sapphire-deep shadow-baziu-sm'
|
|
198
|
+
: 'text-mocha hover:text-sapphire'
|
|
199
|
+
}`}
|
|
200
|
+
>
|
|
201
|
+
{it.label}
|
|
202
|
+
</button>
|
|
203
|
+
))}
|
|
204
|
+
</div>
|
|
205
|
+
|
|
206
|
+
{err && <div className="err">{err}</div>}
|
|
207
|
+
|
|
208
|
+
<form onSubmit={submit}>
|
|
209
|
+
{tab === 'openclaw' && (
|
|
210
|
+
<p className="text-[0.92em] text-mocha">
|
|
211
|
+
One-click import of every skill found in <code>~/.openclaw/skills</code> on the
|
|
212
|
+
server.
|
|
213
|
+
</p>
|
|
214
|
+
)}
|
|
215
|
+
{tab === 'path' && (
|
|
216
|
+
<>
|
|
217
|
+
<p className="text-[0.92em] text-mocha">
|
|
218
|
+
Import from an absolute path on the server — either a single skill folder
|
|
219
|
+
(contains <code>SKILL.md</code>) or a parent folder holding many skill subfolders.
|
|
220
|
+
</p>
|
|
221
|
+
<label>
|
|
222
|
+
server path
|
|
223
|
+
<input
|
|
224
|
+
value={path}
|
|
225
|
+
onChange={(e) => setPath(e.target.value)}
|
|
226
|
+
placeholder="/home/you/my-skills"
|
|
227
|
+
required
|
|
228
|
+
/>
|
|
229
|
+
</label>
|
|
230
|
+
</>
|
|
231
|
+
)}
|
|
232
|
+
{tab === 'zip' && (
|
|
233
|
+
<>
|
|
234
|
+
<p className="text-[0.92em] text-mocha">
|
|
235
|
+
Upload a <code>.zip</code> archive whose top level contains one folder per skill —
|
|
236
|
+
the folder name becomes the skill name.
|
|
237
|
+
</p>
|
|
238
|
+
<label
|
|
239
|
+
onDragOver={(e) => {
|
|
240
|
+
e.preventDefault()
|
|
241
|
+
setDragOver(true)
|
|
242
|
+
}}
|
|
243
|
+
onDragLeave={() => setDragOver(false)}
|
|
244
|
+
onDrop={onDrop}
|
|
245
|
+
className={`block cursor-pointer rounded-md border-2 border-dashed p-6 text-center transition-colors ${
|
|
246
|
+
dragOver
|
|
247
|
+
? 'border-sapphire bg-sapphire-glow text-sapphire-deep'
|
|
248
|
+
: zipFile
|
|
249
|
+
? 'border-solid border-sapphire-light bg-snow text-chocolate'
|
|
250
|
+
: 'border-frost bg-ivory text-mocha-light hover:border-sapphire hover:bg-sapphire-glow hover:text-sapphire-deep'
|
|
251
|
+
}`}
|
|
252
|
+
>
|
|
253
|
+
<input
|
|
254
|
+
ref={fileInput}
|
|
255
|
+
type="file"
|
|
256
|
+
accept=".zip,application/zip"
|
|
257
|
+
onChange={onFileChange}
|
|
258
|
+
className="absolute h-px w-px overflow-hidden opacity-0"
|
|
259
|
+
/>
|
|
260
|
+
{zipFile ? (
|
|
261
|
+
<span className="block break-all font-mono text-[0.85em] text-sapphire-deep">
|
|
262
|
+
{zipFile.name}
|
|
263
|
+
</span>
|
|
264
|
+
) : (
|
|
265
|
+
<>
|
|
266
|
+
<span className="block text-[0.95em] font-medium text-mocha">
|
|
267
|
+
click to choose a .zip file
|
|
268
|
+
</span>
|
|
269
|
+
<span className="text-[0.82em]">or drag & drop here</span>
|
|
270
|
+
</>
|
|
271
|
+
)}
|
|
272
|
+
</label>
|
|
273
|
+
</>
|
|
274
|
+
)}
|
|
275
|
+
<div className="mt-3 flex flex-wrap items-center gap-3">
|
|
276
|
+
<button type="submit" disabled={submitting}>
|
|
277
|
+
{submitting
|
|
278
|
+
? 'importing…'
|
|
279
|
+
: tab === 'zip'
|
|
280
|
+
? 'upload & import'
|
|
281
|
+
: tab === 'openclaw'
|
|
282
|
+
? 'import from OpenClaw'
|
|
283
|
+
: 'import'}
|
|
284
|
+
</button>
|
|
285
|
+
<label className="m-0 inline-flex cursor-pointer items-center text-[0.88em] text-mocha">
|
|
286
|
+
<input
|
|
287
|
+
type="checkbox"
|
|
288
|
+
checked={force}
|
|
289
|
+
onChange={(e) => setForce(e.target.checked)}
|
|
290
|
+
/>
|
|
291
|
+
overwrite existing
|
|
292
|
+
</label>
|
|
293
|
+
</div>
|
|
294
|
+
</form>
|
|
295
|
+
</section>
|
|
296
|
+
)
|
|
297
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createFileRoute, redirect } from '@tanstack/react-router'
|
|
2
|
+
import { fetchAuthState } from '../lib/auth'
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute('/welcome')({
|
|
5
|
+
beforeLoad: async () => {
|
|
6
|
+
// The root middleware already redirected here when setup wasn't done.
|
|
7
|
+
// If the user lands directly (or completed setup in another tab), bounce
|
|
8
|
+
// to the homepage — no point lingering on the welcome screen.
|
|
9
|
+
const auth = await fetchAuthState()
|
|
10
|
+
if (auth.setupComplete) {
|
|
11
|
+
throw redirect({ to: '/' })
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
component: WelcomePage,
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
function WelcomePage() {
|
|
18
|
+
return (
|
|
19
|
+
<div className="mx-auto max-w-2xl">
|
|
20
|
+
<div className="card">
|
|
21
|
+
<h1>Welcome to bazilion</h1>
|
|
22
|
+
<p className="muted my-3">
|
|
23
|
+
Before you can spawn agents, pick a provider and give it at least one model. Once you
|
|
24
|
+
do, a <code>default</code> profile (and a <code>default</code> group directory) are
|
|
25
|
+
created automatically and the rest of the app unlocks.
|
|
26
|
+
</p>
|
|
27
|
+
<ol className="my-5 space-y-4">
|
|
28
|
+
<Step n={1}>
|
|
29
|
+
<strong>Configure credentials.</strong> Head to the{' '}
|
|
30
|
+
<a href="/config">providers tab</a> and set the API key or local URL for the service
|
|
31
|
+
you want to use (Anthropic, OpenAI, Ollama, LMStudio, …).
|
|
32
|
+
</Step>
|
|
33
|
+
<Step n={2}>
|
|
34
|
+
<strong>Enable the provider + add a model.</strong> Flip the provider's toggle on
|
|
35
|
+
and list at least one concrete model name (e.g. <code>claude-opus-4-6</code> or{' '}
|
|
36
|
+
<code>llama3.2</code>).
|
|
37
|
+
</Step>
|
|
38
|
+
<Step n={3}>
|
|
39
|
+
<strong>Start chatting.</strong> You'll be redirected to the home page
|
|
40
|
+
automatically, where a <code>default</code> profile is waiting for a first spawn.
|
|
41
|
+
</Step>
|
|
42
|
+
</ol>
|
|
43
|
+
<a
|
|
44
|
+
href="/config"
|
|
45
|
+
className="inline-flex items-center gap-2 rounded-md bg-sapphire px-4 py-2 text-[0.92em] font-semibold text-snow no-underline transition-colors hover:bg-sapphire-deep"
|
|
46
|
+
>
|
|
47
|
+
Go to config →
|
|
48
|
+
</a>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function Step({ n, children }: { n: number; children: React.ReactNode }) {
|
|
55
|
+
return (
|
|
56
|
+
<li className="grid grid-cols-[2rem_1fr] gap-3 border-t border-frost pt-3 first:border-t-0 first:pt-0">
|
|
57
|
+
<span className="text-center font-display text-xl text-sapphire">{n}</span>
|
|
58
|
+
<div className="text-[0.92em] leading-relaxed text-mocha">{children}</div>
|
|
59
|
+
</li>
|
|
60
|
+
)
|
|
61
|
+
}
|