@polderlabs/bizar 3.23.0 → 4.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/README.md +72 -2
- package/bizar-dash/.bizar/activity.log +3 -0
- package/bizar-dash/.bizar/graph/.graphify_analysis.json +1540 -0
- package/bizar-dash/.bizar/graph/.graphify_labels.json +1 -0
- package/bizar-dash/.bizar/graph/GRAPH_REPORT.md +404 -0
- package/bizar-dash/.bizar/graph/cache/ast/v0.8.46/0661b816358db84dfdb7f10443db8a61152fd20b3fee950caf8fbf32920a1790.json +1 -0
- package/bizar-dash/.bizar/graph/cache/ast/v0.8.46/16da06d774142a6e5d74829ad982531286a6193ef798de8f593db029e123ec32.json +1 -0
- package/bizar-dash/.bizar/graph/cache/ast/v0.8.46/27e5697c01254c69c64c5a33896669073b40afb5ba88375102ae77fa5404136d.json +1 -0
- package/bizar-dash/.bizar/graph/cache/ast/v0.8.46/532997898027254aa4c0932243dc71d2f55888181232b65974961934997dc85b.json +1 -0
- package/bizar-dash/.bizar/graph/cache/ast/v0.8.46/84e3451a64c7f99f0cd6a88b0748d7426780486f53ab4935b7476b28c08f8293.json +1 -0
- package/bizar-dash/.bizar/graph/cache/ast/v0.8.46/88e5ea5f3e78fa69353fe9e6a8d1a05391d54605e25600cb125531eb5a6432ff.json +1 -0
- package/bizar-dash/.bizar/graph/cache/stat-index.json +1 -0
- package/bizar-dash/.bizar/graph/graph.html +307 -0
- package/bizar-dash/.bizar/graph/graph.json +40267 -0
- package/bizar-dash/.bizar/graph/manifest.json +762 -0
- package/bizar-dash/.graphifyignore +40 -0
- package/bizar-dash/.obsidian/README.md +14 -0
- package/bizar-dash/.obsidian/daily/2026-06-25.md +9 -0
- package/bizar-dash/.obsidian/vault.json +7 -0
- package/bizar-dash/.od-skills/web-prototype-e1429c1737/SKILL.md +103 -0
- package/bizar-dash/.od-skills/web-prototype-e1429c1737/assets/template.html +338 -0
- package/bizar-dash/.od-skills/web-prototype-e1429c1737/example.html +81 -0
- package/bizar-dash/.od-skills/web-prototype-e1429c1737/open-design.json +172 -0
- package/bizar-dash/.od-skills/web-prototype-e1429c1737/references/checklist.md +44 -0
- package/bizar-dash/.od-skills/web-prototype-e1429c1737/references/layouts.md +247 -0
- package/bizar-dash/CHANGELOG.md +474 -0
- package/bizar-dash/DESIGN.md +136 -0
- package/bizar-dash/dist/assets/main-B3RgW6FS.js +331 -0
- package/bizar-dash/dist/assets/main-B3RgW6FS.js.map +1 -0
- package/bizar-dash/dist/assets/main-DlJ8wgLR.css +1 -0
- package/bizar-dash/dist/assets/mobile-CsZQAswA.css +1 -0
- package/bizar-dash/dist/assets/mobile-DbxIw8BG.js +2 -0
- package/bizar-dash/dist/assets/mobile-DbxIw8BG.js.map +1 -0
- package/bizar-dash/dist/assets/mobile-Dvq2d53Y.js +354 -0
- package/bizar-dash/dist/assets/mobile-Dvq2d53Y.js.map +1 -0
- package/bizar-dash/dist/index.html +40 -0
- package/bizar-dash/dist/mobile.html +22 -0
- package/bizar-dash/plans/debug-plan/comments.json +1 -0
- package/bizar-dash/plans/debug-plan/meta.json +10 -0
- package/bizar-dash/plans/debug-plan/plan.json +174 -0
- package/bizar-dash/scripts/smoke-bg-retry.mjs +246 -0
- package/bizar-dash/src/cli/dashboard-ports.mjs +488 -0
- package/bizar-dash/src/cli.mjs +522 -0
- package/bizar-dash/src/server/activity-log.mjs +174 -0
- package/bizar-dash/src/server/agents-store.mjs +465 -0
- package/bizar-dash/src/server/api.mjs +138 -0
- package/bizar-dash/src/server/artifact-template.html +810 -0
- package/bizar-dash/src/server/artifacts-store.mjs +733 -0
- package/bizar-dash/src/server/auth.mjs +381 -0
- package/bizar-dash/src/server/background-store.mjs +447 -0
- package/bizar-dash/src/server/bg-poller.mjs +305 -0
- package/bizar-dash/src/server/bg-retry.mjs +574 -0
- package/bizar-dash/src/server/browser.mjs +40 -0
- package/bizar-dash/src/server/diagnostics-store.mjs +148 -0
- package/bizar-dash/src/server/dialog-poller.mjs +105 -0
- package/bizar-dash/src/server/dialog-store.mjs +177 -0
- package/bizar-dash/src/server/glyphs/mdx-compiler.mjs +583 -0
- package/bizar-dash/src/server/lib/path-safe.mjs +283 -0
- package/bizar-dash/src/server/memory-git.mjs +249 -0
- package/bizar-dash/src/server/memory-schema.mjs +145 -0
- package/bizar-dash/src/server/memory-secrets.mjs +84 -0
- package/bizar-dash/src/server/memory-store.mjs +424 -0
- package/bizar-dash/src/server/mod-security.mjs +398 -0
- package/bizar-dash/src/server/mods-loader.mjs +1067 -0
- package/bizar-dash/src/server/notifications-store.mjs +243 -0
- package/bizar-dash/src/server/obsidian-store.mjs +318 -0
- package/bizar-dash/src/server/opencode-runner.mjs +279 -0
- package/bizar-dash/src/server/pair-store.mjs +138 -0
- package/bizar-dash/src/server/projects-store.mjs +364 -0
- package/bizar-dash/src/server/providers-store.mjs +789 -0
- package/bizar-dash/src/server/routes/_shared.mjs +415 -0
- package/bizar-dash/src/server/routes/activity.mjs +110 -0
- package/bizar-dash/src/server/routes/agents.mjs +134 -0
- package/bizar-dash/src/server/routes/artifacts.mjs +279 -0
- package/bizar-dash/src/server/routes/auth.mjs +69 -0
- package/bizar-dash/src/server/routes/background.mjs +165 -0
- package/bizar-dash/src/server/routes/chat.mjs +485 -0
- package/bizar-dash/src/server/routes/config.mjs +129 -0
- package/bizar-dash/src/server/routes/diagnostics.mjs +50 -0
- package/bizar-dash/src/server/routes/dialogs.mjs +86 -0
- package/bizar-dash/src/server/routes/fs.mjs +429 -0
- package/bizar-dash/src/server/routes/history.mjs +78 -0
- package/bizar-dash/src/server/routes/memory.mjs +499 -0
- package/bizar-dash/src/server/routes/misc.mjs +89 -0
- package/bizar-dash/src/server/routes/mods.mjs +359 -0
- package/bizar-dash/src/server/routes/notifications.mjs +54 -0
- package/bizar-dash/src/server/routes/obsidian.mjs +239 -0
- package/bizar-dash/src/server/routes/opencode-sessions.mjs +55 -0
- package/bizar-dash/src/server/routes/overview.mjs +91 -0
- package/bizar-dash/src/server/routes/pair.mjs +67 -0
- package/bizar-dash/src/server/routes/projects.mjs +175 -0
- package/bizar-dash/src/server/routes/providers.mjs +47 -0
- package/bizar-dash/src/server/routes/schedules.mjs +104 -0
- package/bizar-dash/src/server/routes/settings.mjs +51 -0
- package/bizar-dash/src/server/routes/skills.mjs +76 -0
- package/bizar-dash/src/server/routes/tasks.mjs +468 -0
- package/bizar-dash/src/server/routes/themes.mjs +51 -0
- package/bizar-dash/src/server/routes-v2/auth.mjs +59 -0
- package/bizar-dash/src/server/routes-v2/events.mjs +107 -0
- package/bizar-dash/src/server/routes-v2/health.mjs +21 -0
- package/bizar-dash/src/server/routes-v2/index.mjs +90 -0
- package/bizar-dash/src/server/routes-v2/sessions.mjs +111 -0
- package/bizar-dash/src/server/schedules-runner.mjs +369 -0
- package/bizar-dash/src/server/schedules-store.mjs +268 -0
- package/bizar-dash/src/server/search-store.mjs +220 -0
- package/bizar-dash/src/server/serve-info.mjs +684 -0
- package/bizar-dash/src/server/server.mjs +796 -0
- package/bizar-dash/src/server/settings-store.mjs +45 -0
- package/bizar-dash/src/server/skills-store.mjs +300 -0
- package/bizar-dash/src/server/state.mjs +437 -0
- package/bizar-dash/src/server/tailscale-store.mjs +113 -0
- package/bizar-dash/src/server/task-delegator.mjs +824 -0
- package/bizar-dash/src/server/tasks-store.mjs +508 -0
- package/bizar-dash/src/server/tui.mjs +923 -0
- package/bizar-dash/src/server/update-store.mjs +168 -0
- package/bizar-dash/src/server/v2-auth-file.mjs +99 -0
- package/bizar-dash/src/server/v2-event-bus.mjs +128 -0
- package/bizar-dash/src/server/watcher.mjs +81 -0
- package/bizar-dash/src/server/yaml.mjs +238 -0
- package/bizar-dash/src/web/App.tsx +718 -0
- package/bizar-dash/src/web/MobileApp.tsx +408 -0
- package/bizar-dash/src/web/components/ArtifactCreateDialog.tsx +95 -0
- package/bizar-dash/src/web/components/ArtifactListDialog.tsx +55 -0
- package/bizar-dash/src/web/components/ArtifactViewer.tsx +143 -0
- package/bizar-dash/src/web/components/AuditDialog.tsx +79 -0
- package/bizar-dash/src/web/components/BgStatusBadge.tsx +32 -0
- package/bizar-dash/src/web/components/Button.tsx +56 -0
- package/bizar-dash/src/web/components/CanvasContextMenu.tsx +68 -0
- package/bizar-dash/src/web/components/Card.tsx +40 -0
- package/bizar-dash/src/web/components/CollapsibleSection.tsx +72 -0
- package/bizar-dash/src/web/components/CommandDialog.tsx +66 -0
- package/bizar-dash/src/web/components/EmptyState.tsx +30 -0
- package/bizar-dash/src/web/components/FileBrowser.tsx +633 -0
- package/bizar-dash/src/web/components/HelpDialog.tsx +55 -0
- package/bizar-dash/src/web/components/KillConfirmDialog.tsx +88 -0
- package/bizar-dash/src/web/components/Modal.tsx +215 -0
- package/bizar-dash/src/web/components/Notifications.tsx +241 -0
- package/bizar-dash/src/web/components/SearchModal.tsx +224 -0
- package/bizar-dash/src/web/components/Sidebar.tsx +66 -0
- package/bizar-dash/src/web/components/Spinner.tsx +19 -0
- package/bizar-dash/src/web/components/StatusBadge.tsx +25 -0
- package/bizar-dash/src/web/components/Tag.tsx +28 -0
- package/bizar-dash/src/web/components/Toast.tsx +150 -0
- package/bizar-dash/src/web/components/Topbar.tsx +368 -0
- package/bizar-dash/src/web/components/VisualPlanDialog.tsx +58 -0
- package/bizar-dash/src/web/components/chat/AgentChip.tsx +68 -0
- package/bizar-dash/src/web/components/chat/ChatBubble.tsx +60 -0
- package/bizar-dash/src/web/components/chat/ChatThread.tsx +88 -0
- package/bizar-dash/src/web/components/chat/ChatTopBar.tsx +50 -0
- package/bizar-dash/src/web/components/chat/Composer.tsx +164 -0
- package/bizar-dash/src/web/components/chat/ConfirmModal.tsx +54 -0
- package/bizar-dash/src/web/components/chat/EmptyState.tsx +21 -0
- package/bizar-dash/src/web/components/chat/FirstRunGreeting.tsx +18 -0
- package/bizar-dash/src/web/components/chat/FloatingComposer.tsx +32 -0
- package/bizar-dash/src/web/components/chat/InfoPanel.tsx +119 -0
- package/bizar-dash/src/web/components/chat/LoadingSkeleton.tsx +19 -0
- package/bizar-dash/src/web/components/chat/MessageBubble.tsx +60 -0
- package/bizar-dash/src/web/components/chat/SessionList.tsx +153 -0
- package/bizar-dash/src/web/components/chat/StreamingIndicator.tsx +9 -0
- package/bizar-dash/src/web/components/chat/SuggestionCards.tsx +55 -0
- package/bizar-dash/src/web/components/chat/WelcomeScreen.tsx +36 -0
- package/bizar-dash/src/web/components/chat/index.ts +20 -0
- package/bizar-dash/src/web/components/chat/useAutoGrowTextarea.ts +18 -0
- package/bizar-dash/src/web/components/chat/useChat.ts +219 -0
- package/bizar-dash/src/web/components/chat/useSlashCommands.ts +47 -0
- package/bizar-dash/src/web/index.html +37 -0
- package/bizar-dash/src/web/lib/api.ts +193 -0
- package/bizar-dash/src/web/lib/markdown.tsx +59 -0
- package/bizar-dash/src/web/lib/types.ts +668 -0
- package/bizar-dash/src/web/lib/utils.ts +114 -0
- package/bizar-dash/src/web/lib/ws.ts +176 -0
- package/bizar-dash/src/web/main.tsx +34 -0
- package/bizar-dash/src/web/mobile/MobileApp.tsx +278 -0
- package/bizar-dash/src/web/mobile/MobileBottomNav.tsx +38 -0
- package/bizar-dash/src/web/mobile/MobileTopbar.tsx +115 -0
- package/bizar-dash/src/web/mobile/components/MobileBottomSheet.tsx +182 -0
- package/bizar-dash/src/web/mobile/components/MobileListItem.tsx +64 -0
- package/bizar-dash/src/web/mobile/components/MobileModal.tsx +123 -0
- package/bizar-dash/src/web/mobile/views/MobileActivity.tsx +273 -0
- package/bizar-dash/src/web/mobile/views/MobileAgents.tsx +374 -0
- package/bizar-dash/src/web/mobile/views/MobileArtifactCanvas.tsx +439 -0
- package/bizar-dash/src/web/mobile/views/MobileArtifacts.tsx +143 -0
- package/bizar-dash/src/web/mobile/views/MobileChat.tsx +180 -0
- package/bizar-dash/src/web/mobile/views/MobileConfig.tsx +175 -0
- package/bizar-dash/src/web/mobile/views/MobileHistory.tsx +191 -0
- package/bizar-dash/src/web/mobile/views/MobileMods.tsx +149 -0
- package/bizar-dash/src/web/mobile/views/MobileMore.tsx +121 -0
- package/bizar-dash/src/web/mobile/views/MobileNotifications.tsx +137 -0
- package/bizar-dash/src/web/mobile/views/MobilePlans.tsx +26 -0
- package/bizar-dash/src/web/mobile/views/MobileSchedules.tsx +685 -0
- package/bizar-dash/src/web/mobile/views/MobileSearchModal.tsx +172 -0
- package/bizar-dash/src/web/mobile/views/MobileSettings.tsx +388 -0
- package/bizar-dash/src/web/mobile/views/MobileSkills.tsx +153 -0
- package/bizar-dash/src/web/mobile/views/MobileTasks.tsx +564 -0
- package/bizar-dash/src/web/mobile.html +20 -0
- package/bizar-dash/src/web/mobile.tsx +13 -0
- package/bizar-dash/src/web/styles/chat.css +198 -0
- package/bizar-dash/src/web/styles/glyphs.css +960 -0
- package/bizar-dash/src/web/styles/main.css +8855 -0
- package/bizar-dash/src/web/styles/mobile-chat.css +5 -0
- package/bizar-dash/src/web/styles/mobile.css +1960 -0
- package/bizar-dash/src/web/views/Activity.tsx +1203 -0
- package/bizar-dash/src/web/views/Agents.tsx +701 -0
- package/bizar-dash/src/web/views/Artifacts.tsx +1480 -0
- package/bizar-dash/src/web/views/BackgroundAgents.tsx +450 -0
- package/bizar-dash/src/web/views/Chat.tsx +190 -0
- package/bizar-dash/src/web/views/Config.tsx +1603 -0
- package/bizar-dash/src/web/views/History.tsx +335 -0
- package/bizar-dash/src/web/views/ModView.tsx +207 -0
- package/bizar-dash/src/web/views/Mods.tsx +693 -0
- package/bizar-dash/src/web/views/Overview.tsx +812 -0
- package/bizar-dash/src/web/views/Providers.tsx +302 -0
- package/bizar-dash/src/web/views/Schedules.tsx +802 -0
- package/bizar-dash/src/web/views/Settings.tsx +1787 -0
- package/bizar-dash/src/web/views/Skills.tsx +431 -0
- package/bizar-dash/src/web/views/Tasks.tsx +1523 -0
- package/bizar-dash/src/web/views/glyphs/GlyphRenderer.tsx +613 -0
- package/bizar-dash/src/web/views/glyphs/components.tsx +1098 -0
- package/bizar-dash/templates/mod/FORMAT.md +76 -0
- package/bizar-dash/templates/mod/hello-mod/README.md +19 -0
- package/bizar-dash/templates/mod/hello-mod/agents/greeter.md +8 -0
- package/bizar-dash/templates/mod/hello-mod/commands/hello.md +6 -0
- package/bizar-dash/templates/mod/hello-mod/mod.json +20 -0
- package/bizar-dash/templates/mod/hello-mod/routes/ping.mjs +9 -0
- package/bizar-dash/templates/mod/hello-mod/views/HelloView.tsx +10 -0
- package/bizar-dash/tests/dashboard-ports.test.mjs +138 -0
- package/bizar-dash/tests/graphify-mod-spawn.node.test.mjs +90 -0
- package/bizar-dash/tests/memory-git.test.mjs +138 -0
- package/bizar-dash/tests/memory-schema.test.mjs +198 -0
- package/bizar-dash/tests/memory-secrets.test.mjs +121 -0
- package/bizar-dash/tests/memory-store.test.mjs +390 -0
- package/bizar-dash/tests/memory-sync.test.mjs +141 -0
- package/bizar-dash/tests/mod-instructions.node.test.mjs +188 -0
- package/bizar-dash/tests/mod-security.test.mjs +273 -0
- package/bizar-dash/tests/mod-upgrade.node.test.mjs +357 -0
- package/bizar-dash/tests/no-agent-browser.node.test.mjs +98 -0
- package/bizar-dash/tests/obsidian-back-compat.test.mjs +199 -0
- package/bizar-dash/tests/opencode-runner.test.mjs +172 -0
- package/bizar-dash/tests/path-safe.test.mjs +108 -0
- package/bizar-dash/tests/providers-store-backup-keys.node.test.mjs +333 -0
- package/bizar-dash/tests/smoke-v2.mjs +212 -0
- package/bizar-dash/tests/strip-thinking.test.mjs +175 -0
- package/bizar-dash/tests/submit-feedback.test.mjs +353 -0
- package/bizar-dash/tests/tmux-wrap.test.mjs +145 -0
- package/bizar-dash/tests/yaml.test.mjs +128 -0
- package/bizar-dash/tsconfig.json +23 -0
- package/bizar-dash/vite.config.ts +27 -0
- package/cli/atomic.mjs +73 -0
- package/cli/bin.mjs +43 -46
- package/cli/copy.mjs +3 -0
- package/cli/dev-link.mjs +17 -1
- package/cli/init.mjs +135 -1
- package/cli/install.mjs +10 -23
- package/cli/memory-constants.mjs +59 -0
- package/cli/memory.mjs +757 -0
- package/cli/service.mjs +5 -6
- package/config/skills/obsidian/SKILL.md +213 -65
- package/install.sh +48 -18
- package/package.json +49 -14
- package/packages/sdk/LICENSE +21 -0
- package/packages/sdk/README.md +80 -0
- package/packages/sdk/src/client.ts +183 -0
- package/packages/sdk/src/errors.ts +120 -0
- package/packages/sdk/src/events.ts +153 -0
- package/packages/sdk/src/index.ts +63 -0
- package/packages/sdk/src/types.ts +176 -0
- package/packages/sdk/src/version.ts +4 -0
- package/packages/sdk/tests/client.test.ts +217 -0
- package/packages/sdk/tests/errors.test.ts +108 -0
- package/packages/sdk/tests/events.test.ts +139 -0
- package/packages/sdk/tests/fixtures/fetch-mock.ts +152 -0
- package/packages/sdk/tests/fixtures/sse-mock.ts +30 -0
- package/packages/sdk/tsconfig.json +25 -0
- package/packages/sdk/vitest.config.ts +9 -0
- package/plugins/bizar/LICENSE +21 -0
- package/plugins/bizar/README.md +448 -0
- package/plugins/bizar/dist/index.js +29901 -0
- package/plugins/bizar/index.ts +1484 -0
- package/plugins/bizar/scripts/check-forbidden-imports.sh +33 -0
- package/plugins/bizar/src/background-state.ts +551 -0
- package/plugins/bizar/src/background.ts +1250 -0
- package/plugins/bizar/src/commands-impl.ts +464 -0
- package/plugins/bizar/src/commands.ts +1127 -0
- package/plugins/bizar/src/dashboard-client.ts +233 -0
- package/plugins/bizar/src/event-stream.ts +606 -0
- package/plugins/bizar/src/fingerprint.ts +120 -0
- package/plugins/bizar/src/handoff.ts +79 -0
- package/plugins/bizar/src/http-client.ts +467 -0
- package/plugins/bizar/src/key-rotation.ts +218 -0
- package/plugins/bizar/src/logger.ts +144 -0
- package/plugins/bizar/src/loop.ts +176 -0
- package/plugins/bizar/src/opencode-runner.ts +390 -0
- package/plugins/bizar/src/options.ts +421 -0
- package/plugins/bizar/src/plan-fs.ts +323 -0
- package/plugins/bizar/src/reasoning-clean.ts +454 -0
- package/plugins/bizar/src/report.ts +178 -0
- package/plugins/bizar/src/research-prompt.ts +35 -0
- package/plugins/bizar/src/serve-info.ts +228 -0
- package/plugins/bizar/src/serve.ts +496 -0
- package/plugins/bizar/src/settings.ts +349 -0
- package/plugins/bizar/src/state.ts +298 -0
- package/plugins/bizar/src/tools/bg-collect.ts +104 -0
- package/plugins/bizar/src/tools/bg-get-comments.ts +239 -0
- package/plugins/bizar/src/tools/bg-kill.ts +87 -0
- package/plugins/bizar/src/tools/bg-spawn.ts +401 -0
- package/plugins/bizar/src/tools/bg-status.ts +99 -0
- package/plugins/bizar/src/tools/plan-action.ts +767 -0
- package/plugins/bizar/src/tools/read-glyph-feedback.ts +170 -0
- package/plugins/bizar/src/tools/wait-for-feedback.ts +402 -0
- package/plugins/bizar/tests/attach-handler-bug.test.ts +169 -0
- package/plugins/bizar/tests/background-state.test.ts +277 -0
- package/plugins/bizar/tests/background.test.ts +402 -0
- package/plugins/bizar/tests/block.test.ts +195 -0
- package/plugins/bizar/tests/canonical-key-order.test.ts +75 -0
- package/plugins/bizar/tests/commands-impl.test.ts +442 -0
- package/plugins/bizar/tests/commands.test.ts +548 -0
- package/plugins/bizar/tests/config.test.ts +122 -0
- package/plugins/bizar/tests/dashboard-client.test.ts +159 -0
- package/plugins/bizar/tests/dispose.test.ts +336 -0
- package/plugins/bizar/tests/event-stream.test.ts +409 -0
- package/plugins/bizar/tests/event.test.ts +262 -0
- package/plugins/bizar/tests/fingerprint.test.ts +162 -0
- package/plugins/bizar/tests/http-client.test.ts +404 -0
- package/plugins/bizar/tests/init-helpers.test.ts +203 -0
- package/plugins/bizar/tests/integration/slash-command.test.ts +348 -0
- package/plugins/bizar/tests/integration/tool-routing.test.ts +314 -0
- package/plugins/bizar/tests/key-rotation.test.ts +396 -0
- package/plugins/bizar/tests/loop.test.ts +397 -0
- package/plugins/bizar/tests/options.test.ts +276 -0
- package/plugins/bizar/tests/reasoning-clean.test.ts +422 -0
- package/plugins/bizar/tests/serve.test.ts +339 -0
- package/plugins/bizar/tests/settings.test.ts +351 -0
- package/plugins/bizar/tests/stall-think.test.ts +750 -0
- package/plugins/bizar/tests/state.test.ts +276 -0
- package/plugins/bizar/tests/tools/bg-collect.test.ts +337 -0
- package/plugins/bizar/tests/tools/bg-get-comments.test.ts +485 -0
- package/plugins/bizar/tests/tools/bg-kill.test.ts +235 -0
- package/plugins/bizar/tests/tools/bg-spawn-delegation.test.ts +147 -0
- package/plugins/bizar/tests/tools/bg-spawn.test.ts +311 -0
- package/plugins/bizar/tests/tools/bg-status.test.ts +217 -0
- package/plugins/bizar/tests/tools/opencode-runner.test.ts +115 -0
- package/plugins/bizar/tests/tools/plan-action.test.ts +599 -0
- package/plugins/bizar/tests/tools/read-glyph-feedback.test.ts +253 -0
- package/plugins/bizar/tests/tools/wait-for-feedback.test.ts +390 -0
- package/plugins/bizar/tests/update-deadlock.test.ts +145 -0
- package/plugins/bizar/tsconfig.json +29 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
// src/mobile/views/MobileActivity.tsx — enhanced activity with filters, event detail, and snapshot submit hero.
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { RefreshCw, Bot, Activity as ActivityIcon, Pause, Play, Send } from 'lucide-react';
|
|
4
|
+
import { api } from '../../lib/api';
|
|
5
|
+
import { formatRelative } from '../../lib/utils';
|
|
6
|
+
import type { ActivityItem, Snapshot } from '../../lib/types';
|
|
7
|
+
import { MobileBottomSheet } from '../components/MobileBottomSheet';
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
snapshot: Snapshot;
|
|
11
|
+
onRefresh: () => Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const EVENT_KINDS = ['all', 'tasks', 'agents', 'bg', 'artifacts', 'mods'] as const;
|
|
15
|
+
type EventKind = typeof EVENT_KINDS[number];
|
|
16
|
+
|
|
17
|
+
const KIND_LABELS: Record<string, string> = {
|
|
18
|
+
all: 'All',
|
|
19
|
+
tasks: 'Tasks',
|
|
20
|
+
agents: 'Agents',
|
|
21
|
+
bg: 'Background',
|
|
22
|
+
artifacts: 'Plans',
|
|
23
|
+
mods: 'Mods',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function MobileActivity({ snapshot, onRefresh }: Props) {
|
|
27
|
+
const [events, setEvents] = useState<ActivityItem[]>(snapshot.overview?.recentActivity || []);
|
|
28
|
+
const [loading, setLoading] = useState(true);
|
|
29
|
+
const [filter, setFilter] = useState<EventKind>('all');
|
|
30
|
+
const [paused, setPaused] = useState(false);
|
|
31
|
+
const [detail, setDetail] = useState<ActivityItem | null>(null);
|
|
32
|
+
const [submitText, setSubmitText] = useState('');
|
|
33
|
+
const [submitting, setSubmitting] = useState(false);
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (snapshot.overview?.recentActivity) {
|
|
37
|
+
setEvents(snapshot.overview.recentActivity);
|
|
38
|
+
setLoading(false);
|
|
39
|
+
} else {
|
|
40
|
+
loadEvents();
|
|
41
|
+
}
|
|
42
|
+
}, [snapshot.overview]);
|
|
43
|
+
|
|
44
|
+
const loadEvents = async () => {
|
|
45
|
+
try {
|
|
46
|
+
const data = await api.get<Snapshot>('/snapshot');
|
|
47
|
+
setEvents(data.overview?.recentActivity || []);
|
|
48
|
+
} catch {
|
|
49
|
+
// best-effort
|
|
50
|
+
} finally {
|
|
51
|
+
setLoading(false);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const filtered = filter === 'all' ? events : events.filter((e) => {
|
|
56
|
+
if (filter === 'tasks') return e.kind?.startsWith('task');
|
|
57
|
+
if (filter === 'agents') return e.kind?.startsWith('agent');
|
|
58
|
+
if (filter === 'bg') return e.kind?.includes('bg') || e.kind?.includes('schedule');
|
|
59
|
+
if (filter === 'artifacts') return e.kind?.includes('artifacts');
|
|
60
|
+
if (filter === 'mods') return e.kind?.includes('mod');
|
|
61
|
+
return true;
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const agents = snapshot.agents || [];
|
|
65
|
+
const tasks = snapshot.tasks || [];
|
|
66
|
+
const activeTasks = tasks.filter((t) => t.status === 'doing' || t.status === 'queued');
|
|
67
|
+
const doneTasks = tasks.filter((t) => t.status === 'done');
|
|
68
|
+
|
|
69
|
+
const handleSubmit = async () => {
|
|
70
|
+
if (!submitText.trim() || submitting) return;
|
|
71
|
+
setSubmitting(true);
|
|
72
|
+
try {
|
|
73
|
+
await api.post('/chat', { message: submitText.trim(), agent: 'odin' });
|
|
74
|
+
setSubmitText('');
|
|
75
|
+
await onRefresh().catch(() => undefined);
|
|
76
|
+
await loadEvents();
|
|
77
|
+
} catch {
|
|
78
|
+
// best-effort
|
|
79
|
+
} finally {
|
|
80
|
+
setSubmitting(false);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const handleRefresh = async () => {
|
|
85
|
+
await onRefresh().catch(() => undefined);
|
|
86
|
+
await loadEvents();
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<div className="mobile-view">
|
|
91
|
+
{/* Snapshot Submit Hero */}
|
|
92
|
+
<div className="mobile-submit-hero">
|
|
93
|
+
<textarea
|
|
94
|
+
className="mobile-submit-input"
|
|
95
|
+
placeholder="What needs to be done? Describe a task, bug, or refactor for Odin to artifacts…"
|
|
96
|
+
value={submitText}
|
|
97
|
+
onChange={(e) => setSubmitText(e.target.value)}
|
|
98
|
+
rows={2}
|
|
99
|
+
/>
|
|
100
|
+
<div className="mobile-submit-actions">
|
|
101
|
+
<div className="mobile-submit-chips">
|
|
102
|
+
{['Implement feature', 'Fix bug', 'Refactor', 'Investigate', 'Write tests'].map((chip) => (
|
|
103
|
+
<button
|
|
104
|
+
key={chip}
|
|
105
|
+
type="button"
|
|
106
|
+
className="mobile-submit-chip"
|
|
107
|
+
onClick={() => setSubmitText((cur) => cur ? `${cur} ${chip}` : chip)}
|
|
108
|
+
>
|
|
109
|
+
{chip}
|
|
110
|
+
</button>
|
|
111
|
+
))}
|
|
112
|
+
</div>
|
|
113
|
+
<button
|
|
114
|
+
type="button"
|
|
115
|
+
className="mobile-btn"
|
|
116
|
+
disabled={!submitText.trim() || submitting}
|
|
117
|
+
onClick={handleSubmit}
|
|
118
|
+
>
|
|
119
|
+
<Send size={14} /> Submit to Odin
|
|
120
|
+
</button>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
{/* Quick stats */}
|
|
125
|
+
<div className="mobile-stats">
|
|
126
|
+
<div className="mobile-stat">
|
|
127
|
+
<div className="mobile-stat-value">{agents.length}</div>
|
|
128
|
+
<div className="mobile-stat-label">Agents</div>
|
|
129
|
+
</div>
|
|
130
|
+
<div className="mobile-stat">
|
|
131
|
+
<div className="mobile-stat-value">{activeTasks.length}</div>
|
|
132
|
+
<div className="mobile-stat-label">Active</div>
|
|
133
|
+
</div>
|
|
134
|
+
<div className="mobile-stat">
|
|
135
|
+
<div className="mobile-stat-value">{doneTasks.length}</div>
|
|
136
|
+
<div className="mobile-stat-label">Done</div>
|
|
137
|
+
</div>
|
|
138
|
+
<div className="mobile-stat">
|
|
139
|
+
<div className="mobile-stat-value">{snapshot.artifacts.length || 0}</div>
|
|
140
|
+
<div className="mobile-stat-label">Plans</div>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
{loading && events.length === 0 && (
|
|
145
|
+
<div className="mobile-loading mobile-loading-inline">
|
|
146
|
+
<p>Loading activity…</p>
|
|
147
|
+
</div>
|
|
148
|
+
)}
|
|
149
|
+
|
|
150
|
+
{/* Filter chips */}
|
|
151
|
+
<div className="mobile-activity-header">
|
|
152
|
+
<h3 className="mobile-section-title" style={{ margin: 0 }}>Recent Activity</h3>
|
|
153
|
+
<div style={{ display: 'flex', gap: 4 }}>
|
|
154
|
+
<button
|
|
155
|
+
type="button"
|
|
156
|
+
className="mobile-icon-btn"
|
|
157
|
+
onClick={() => setPaused((v) => !v)}
|
|
158
|
+
aria-label={paused ? 'Resume' : 'Pause'}
|
|
159
|
+
>
|
|
160
|
+
{paused ? <Play size={14} /> : <Pause size={14} />}
|
|
161
|
+
</button>
|
|
162
|
+
<button type="button" className="mobile-icon-btn" onClick={handleRefresh} aria-label="Refresh">
|
|
163
|
+
<RefreshCw size={14} />
|
|
164
|
+
</button>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<div className="mobile-search-scopes">
|
|
169
|
+
{EVENT_KINDS.map((k) => (
|
|
170
|
+
<button
|
|
171
|
+
key={k}
|
|
172
|
+
type="button"
|
|
173
|
+
className={`mobile-scope-chip ${filter === k ? 'active' : ''}`}
|
|
174
|
+
onClick={() => setFilter(k)}
|
|
175
|
+
>
|
|
176
|
+
{KIND_LABELS[k]}
|
|
177
|
+
</button>
|
|
178
|
+
))}
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
{/* Active agents */}
|
|
182
|
+
{agents.length > 0 && (
|
|
183
|
+
<section className="mobile-section">
|
|
184
|
+
<h3 className="mobile-section-title"><Bot size={14} /> Agents</h3>
|
|
185
|
+
<div className="mobile-card-list">
|
|
186
|
+
{agents.slice(0, 6).map((a) => (
|
|
187
|
+
<div key={a.name} className="mobile-agent-card">
|
|
188
|
+
<div className="mobile-agent-dot" data-status={a.status || 'idle'} />
|
|
189
|
+
<div className="mobile-agent-info">
|
|
190
|
+
<span className="mobile-agent-name">{a.name}</span>
|
|
191
|
+
<span className="mobile-agent-meta">{a.status || 'idle'}</span>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
))}
|
|
195
|
+
</div>
|
|
196
|
+
</section>
|
|
197
|
+
)}
|
|
198
|
+
|
|
199
|
+
{/* Event feed */}
|
|
200
|
+
{!paused && filtered.length > 0 && (
|
|
201
|
+
<section className="mobile-section">
|
|
202
|
+
<div className="mobile-card-list">
|
|
203
|
+
{filtered.slice(0, 30).map((e, i) => (
|
|
204
|
+
<button
|
|
205
|
+
key={`${e.ts}-${e.kind}-${i}`}
|
|
206
|
+
type="button"
|
|
207
|
+
className="mobile-event-item"
|
|
208
|
+
onClick={() => setDetail(e)}
|
|
209
|
+
>
|
|
210
|
+
<span className="mobile-event-kind" data-kind={e.kind}>{KIND_LABELS[e.kind as keyof typeof KIND_LABELS] || e.kind}</span>
|
|
211
|
+
<span className="mobile-event-msg">
|
|
212
|
+
{renderEventMessage(e)}
|
|
213
|
+
</span>
|
|
214
|
+
<span className="mobile-event-time">{formatRelative(e.ts)}</span>
|
|
215
|
+
</button>
|
|
216
|
+
))}
|
|
217
|
+
</div>
|
|
218
|
+
</section>
|
|
219
|
+
)}
|
|
220
|
+
|
|
221
|
+
{!paused && filtered.length === 0 && events.length > 0 && (
|
|
222
|
+
<div className="mobile-empty">
|
|
223
|
+
<ActivityIcon size={40} />
|
|
224
|
+
<p>No matching activity.</p>
|
|
225
|
+
<p className="muted">Try a different filter.</p>
|
|
226
|
+
</div>
|
|
227
|
+
)}
|
|
228
|
+
|
|
229
|
+
{/* Event detail sheet */}
|
|
230
|
+
{detail && (
|
|
231
|
+
<MobileBottomSheet
|
|
232
|
+
open={true}
|
|
233
|
+
onClose={() => setDetail(null)}
|
|
234
|
+
title={KIND_LABELS[detail.kind as keyof typeof KIND_LABELS] || detail.kind}
|
|
235
|
+
>
|
|
236
|
+
<div className="mobile-agent-detail-meta">
|
|
237
|
+
<div className="mobile-task-detail-row"><span>Kind</span><span>{detail.kind}</span></div>
|
|
238
|
+
<div className="mobile-task-detail-row"><span>Time</span><span>{new Date(detail.ts).toLocaleString()}</span></div>
|
|
239
|
+
{Object.entries(detail)
|
|
240
|
+
.filter(([k]) => !['ts', 'kind'].includes(k))
|
|
241
|
+
.map(([k, v]) => (
|
|
242
|
+
<div key={k} className="mobile-task-detail-row">
|
|
243
|
+
<span>{k}</span>
|
|
244
|
+
<span style={{ fontSize: 12, maxWidth: 200, wordBreak: 'break-all' }}>
|
|
245
|
+
{typeof v === 'object' ? JSON.stringify(v) : String(v)}
|
|
246
|
+
</span>
|
|
247
|
+
</div>
|
|
248
|
+
))}
|
|
249
|
+
</div>
|
|
250
|
+
</MobileBottomSheet>
|
|
251
|
+
)}
|
|
252
|
+
|
|
253
|
+
{/* Empty state */}
|
|
254
|
+
{agents.length === 0 && activeTasks.length === 0 && (
|
|
255
|
+
<div className="mobile-empty">
|
|
256
|
+
<ActivityIcon size={40} />
|
|
257
|
+
<p>No activity yet.</p>
|
|
258
|
+
<p className="muted">Start a task or chat to see things here.</p>
|
|
259
|
+
</div>
|
|
260
|
+
)}
|
|
261
|
+
</div>
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function renderEventMessage(e: ActivityItem): string {
|
|
266
|
+
const k = e.kind || '';
|
|
267
|
+
if (k.includes('task')) return `Task: ${e.title || e.id || 'updated'}`;
|
|
268
|
+
if (k.includes('agent')) return `Agent: ${e.name || 'status changed'}`;
|
|
269
|
+
if (k.includes('artifacts')) return `Plan: ${e.slug || 'changed'}`;
|
|
270
|
+
if (k.includes('mod')) return `Mod: ${e.name || 'changed'}`;
|
|
271
|
+
if (k.includes('schedule')) return `Schedule: ${e.name || 'triggered'}`;
|
|
272
|
+
return JSON.stringify(e).slice(0, 80);
|
|
273
|
+
}
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
// src/mobile/views/MobileAgents.tsx — agents list with detail bottom sheet.
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Bot, Plus, RefreshCw, Play, Trash2, RotateCw } from 'lucide-react';
|
|
4
|
+
import { api } from '../../lib/api';
|
|
5
|
+
import { formatRelative } from '../../lib/utils';
|
|
6
|
+
import type { Agent, Snapshot } from '../../lib/types';
|
|
7
|
+
import { MobileBottomSheet } from '../components/MobileBottomSheet';
|
|
8
|
+
import { MobileModal } from '../components/MobileModal';
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
snapshot: Snapshot;
|
|
12
|
+
onBack: () => void;
|
|
13
|
+
onOpenAgent: (name: string) => void;
|
|
14
|
+
selectedAgent?: string;
|
|
15
|
+
onRefresh?: () => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const CATEGORIES = ['reasoning', 'code', 'design', 'planning', 'gitops', 'analysis'];
|
|
19
|
+
|
|
20
|
+
const CATEGORY_COLORS: Record<string, string> = {
|
|
21
|
+
reasoning: 'var(--accent)',
|
|
22
|
+
code: 'var(--info)',
|
|
23
|
+
design: 'var(--success)',
|
|
24
|
+
planning: 'var(--warning)',
|
|
25
|
+
gitops: 'var(--error)',
|
|
26
|
+
analysis: 'var(--text-dim)',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function MobileAgents({ snapshot, onBack, onOpenAgent, selectedAgent, onRefresh }: Props) {
|
|
30
|
+
const [agents, setAgents] = useState<Agent[]>(snapshot.agents || []);
|
|
31
|
+
const [loading, setLoading] = useState(!snapshot.agents);
|
|
32
|
+
const [categoryFilter, setCategoryFilter] = useState('');
|
|
33
|
+
const [search, setSearch] = useState('');
|
|
34
|
+
const [detailAgent, setDetailAgent] = useState<Agent | null>(null);
|
|
35
|
+
const [newOpen, setNewOpen] = useState(false);
|
|
36
|
+
const [invokePrompt, setInvokePrompt] = useState('');
|
|
37
|
+
const [invokeOpen, setInvokeOpen] = useState(false);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (selectedAgent) {
|
|
41
|
+
const a = agents.find((ag) => ag.name === selectedAgent);
|
|
42
|
+
if (a) setDetailAgent(a);
|
|
43
|
+
}
|
|
44
|
+
}, [selectedAgent, agents]);
|
|
45
|
+
|
|
46
|
+
const reload = async () => {
|
|
47
|
+
try {
|
|
48
|
+
const data = await api.get<{ agents: Agent[] }>('/agents');
|
|
49
|
+
setAgents(data.agents || []);
|
|
50
|
+
} catch {
|
|
51
|
+
// best-effort
|
|
52
|
+
} finally {
|
|
53
|
+
setLoading(false);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const filtered = agents.filter((a) => {
|
|
58
|
+
if (categoryFilter && a.category !== categoryFilter) return false;
|
|
59
|
+
if (search) {
|
|
60
|
+
const q = search.toLowerCase();
|
|
61
|
+
if (!a.name.toLowerCase().includes(q) && !(a.description || '').toLowerCase().includes(q)) return false;
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const invokeAgent = async (name: string, prompt: string) => {
|
|
67
|
+
try {
|
|
68
|
+
await api.post(`/agents/${encodeURIComponent(name)}/invoke`, { prompt });
|
|
69
|
+
setInvokeOpen(false);
|
|
70
|
+
setInvokePrompt('');
|
|
71
|
+
} catch {
|
|
72
|
+
// best-effort
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const restartAgent = async (name: string) => {
|
|
77
|
+
try {
|
|
78
|
+
await api.post(`/agents/${encodeURIComponent(name)}/restart`);
|
|
79
|
+
await reload();
|
|
80
|
+
} catch {
|
|
81
|
+
// best-effort
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const deleteAgent = async (name: string) => {
|
|
86
|
+
if (!confirm(`Delete agent "${name}"?`)) return;
|
|
87
|
+
try {
|
|
88
|
+
await api.del(`/agents/${encodeURIComponent(name)}`);
|
|
89
|
+
setAgents((cur) => cur.filter((a) => a.name !== name));
|
|
90
|
+
setDetailAgent(null);
|
|
91
|
+
onRefresh?.();
|
|
92
|
+
} catch {
|
|
93
|
+
// best-effort
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const createAgent = async (data: {
|
|
98
|
+
name: string; description: string; model: string; mode: string;
|
|
99
|
+
color: string; tools: string[]; tags: string[]; category: string; prompt: string;
|
|
100
|
+
}) => {
|
|
101
|
+
try {
|
|
102
|
+
const created = await api.post<Agent>('/agents', data);
|
|
103
|
+
setAgents((cur) => [...cur, created]);
|
|
104
|
+
setNewOpen(false);
|
|
105
|
+
onRefresh?.();
|
|
106
|
+
} catch {
|
|
107
|
+
// best-effort
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<div className="mobile-view">
|
|
113
|
+
{/* Toolbar */}
|
|
114
|
+
<div className="mobile-tasks-toolbar">
|
|
115
|
+
<input
|
|
116
|
+
className="mobile-search-input"
|
|
117
|
+
type="text"
|
|
118
|
+
placeholder="Search agents…"
|
|
119
|
+
value={search}
|
|
120
|
+
onChange={(e) => setSearch(e.target.value)}
|
|
121
|
+
style={{ flex: 1 }}
|
|
122
|
+
/>
|
|
123
|
+
<button type="button" className="mobile-icon-btn" onClick={() => reload()} aria-label="Refresh">
|
|
124
|
+
<RefreshCw size={16} />
|
|
125
|
+
</button>
|
|
126
|
+
<button type="button" className="mobile-icon-btn" onClick={() => setNewOpen(true)} aria-label="New agent">
|
|
127
|
+
<Plus size={16} />
|
|
128
|
+
</button>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
{/* Category filter */}
|
|
132
|
+
<div className="mobile-search-scopes">
|
|
133
|
+
<button
|
|
134
|
+
type="button"
|
|
135
|
+
className={`mobile-scope-chip ${!categoryFilter ? 'active' : ''}`}
|
|
136
|
+
onClick={() => setCategoryFilter('')}
|
|
137
|
+
>
|
|
138
|
+
All
|
|
139
|
+
</button>
|
|
140
|
+
{CATEGORIES.map((c) => (
|
|
141
|
+
<button
|
|
142
|
+
key={c}
|
|
143
|
+
type="button"
|
|
144
|
+
className={`mobile-scope-chip ${categoryFilter === c ? 'active' : ''}`}
|
|
145
|
+
onClick={() => setCategoryFilter(c)}
|
|
146
|
+
>
|
|
147
|
+
{c}
|
|
148
|
+
</button>
|
|
149
|
+
))}
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
{loading ? (
|
|
153
|
+
<div className="mobile-loading"><p>Loading…</p></div>
|
|
154
|
+
) : filtered.length === 0 ? (
|
|
155
|
+
<div className="mobile-empty">
|
|
156
|
+
<Bot size={40} />
|
|
157
|
+
<p>No agents found.</p>
|
|
158
|
+
</div>
|
|
159
|
+
) : (
|
|
160
|
+
<div className="mobile-card-list">
|
|
161
|
+
{filtered.map((a) => (
|
|
162
|
+
<button
|
|
163
|
+
key={a.name}
|
|
164
|
+
type="button"
|
|
165
|
+
className="mobile-list-item mobile-list-item-interactive"
|
|
166
|
+
onClick={() => { setDetailAgent(a); onOpenAgent(a.name); }}
|
|
167
|
+
>
|
|
168
|
+
<div className="mobile-agent-dot" data-status={a.status || 'idle'} />
|
|
169
|
+
<div className="mobile-list-content">
|
|
170
|
+
<span className="mobile-list-title">{a.name}</span>
|
|
171
|
+
<span className="mobile-list-meta">{a.model || a.mode || '—'}</span>
|
|
172
|
+
</div>
|
|
173
|
+
{a.category && (
|
|
174
|
+
<span
|
|
175
|
+
className="mobile-list-badge"
|
|
176
|
+
style={{ color: CATEGORY_COLORS[a.category] || 'var(--text-dim)' }}
|
|
177
|
+
>
|
|
178
|
+
{a.category}
|
|
179
|
+
</span>
|
|
180
|
+
)}
|
|
181
|
+
<span className="mobile-list-badge" data-status={a.status || 'idle'}>
|
|
182
|
+
{a.status || 'idle'}
|
|
183
|
+
</span>
|
|
184
|
+
</button>
|
|
185
|
+
))}
|
|
186
|
+
</div>
|
|
187
|
+
)}
|
|
188
|
+
|
|
189
|
+
{/* Agent detail sheet */}
|
|
190
|
+
{detailAgent && (
|
|
191
|
+
<MobileBottomSheet
|
|
192
|
+
open={true}
|
|
193
|
+
onClose={() => setDetailAgent(null)}
|
|
194
|
+
title={detailAgent.name}
|
|
195
|
+
actions={
|
|
196
|
+
<div className="mobile-task-detail-actions">
|
|
197
|
+
<button
|
|
198
|
+
type="button"
|
|
199
|
+
className="mobile-btn"
|
|
200
|
+
onClick={() => { setInvokePrompt(''); setInvokeOpen(true); }}
|
|
201
|
+
>
|
|
202
|
+
<Play size={14} /> Invoke
|
|
203
|
+
</button>
|
|
204
|
+
{(detailAgent.isStuck || detailAgent.status === 'error' || detailAgent.status === 'working') && (
|
|
205
|
+
<button
|
|
206
|
+
type="button"
|
|
207
|
+
className="mobile-btn mobile-btn-secondary"
|
|
208
|
+
onClick={() => restartAgent(detailAgent.name)}
|
|
209
|
+
>
|
|
210
|
+
<RotateCw size={14} /> Restart
|
|
211
|
+
</button>
|
|
212
|
+
)}
|
|
213
|
+
<button
|
|
214
|
+
type="button"
|
|
215
|
+
className="mobile-btn mobile-btn-danger"
|
|
216
|
+
onClick={() => deleteAgent(detailAgent.name)}
|
|
217
|
+
>
|
|
218
|
+
<Trash2 size={14} />
|
|
219
|
+
</button>
|
|
220
|
+
</div>
|
|
221
|
+
}
|
|
222
|
+
>
|
|
223
|
+
<div className="mobile-agent-detail">
|
|
224
|
+
<div className="mobile-agent-detail-status">
|
|
225
|
+
<span className="mobile-agent-dot" data-status={detailAgent.status || 'idle'} />
|
|
226
|
+
<span className="mobile-agent-detail-status-text">{detailAgent.status || 'idle'}</span>
|
|
227
|
+
{detailAgent.category && (
|
|
228
|
+
<span
|
|
229
|
+
className="mobile-list-badge"
|
|
230
|
+
style={{ color: CATEGORY_COLORS[detailAgent.category] }}
|
|
231
|
+
>
|
|
232
|
+
{detailAgent.category}
|
|
233
|
+
</span>
|
|
234
|
+
)}
|
|
235
|
+
</div>
|
|
236
|
+
<p className="mobile-agent-detail-desc">{detailAgent.description || 'No description.'}</p>
|
|
237
|
+
<div className="mobile-agent-detail-meta">
|
|
238
|
+
<div className="mobile-task-detail-row">
|
|
239
|
+
<span>Model</span>
|
|
240
|
+
<span className="mono">{detailAgent.model || '—'}</span>
|
|
241
|
+
</div>
|
|
242
|
+
<div className="mobile-task-detail-row">
|
|
243
|
+
<span>Mode</span>
|
|
244
|
+
<span>{detailAgent.mode || 'subagent'}</span>
|
|
245
|
+
</div>
|
|
246
|
+
<div className="mobile-task-detail-row">
|
|
247
|
+
<span>Path</span>
|
|
248
|
+
<span className="mono" style={{ fontSize: 11 }}>{detailAgent.path}</span>
|
|
249
|
+
</div>
|
|
250
|
+
{detailAgent.lastError && (
|
|
251
|
+
<div className="mobile-task-detail-row" style={{ color: 'var(--error)' }}>
|
|
252
|
+
<span>Last error</span>
|
|
253
|
+
<span>{detailAgent.lastError.message}</span>
|
|
254
|
+
</div>
|
|
255
|
+
)}
|
|
256
|
+
{detailAgent.tasksTotal != null && detailAgent.tasksTotal > 0 && (
|
|
257
|
+
<div className="mobile-task-detail-row">
|
|
258
|
+
<span>Success rate</span>
|
|
259
|
+
<span>{Math.round((detailAgent.successRate || 0) * 100)}%</span>
|
|
260
|
+
</div>
|
|
261
|
+
)}
|
|
262
|
+
<div className="mobile-task-detail-row">
|
|
263
|
+
<span>Last modified</span>
|
|
264
|
+
<span>{formatRelative(detailAgent.mtime)}</span>
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
</MobileBottomSheet>
|
|
269
|
+
)}
|
|
270
|
+
|
|
271
|
+
{/* Invoke modal */}
|
|
272
|
+
<MobileModal open={invokeOpen} onClose={() => setInvokeOpen(false)} title={`Invoke ${detailAgent?.name}`} actions={
|
|
273
|
+
<button
|
|
274
|
+
type="button"
|
|
275
|
+
className="mobile-btn"
|
|
276
|
+
style={{ width: '100%' }}
|
|
277
|
+
disabled={!invokePrompt.trim()}
|
|
278
|
+
onClick={() => { if (detailAgent) invokeAgent(detailAgent.name, invokePrompt.trim()); }}
|
|
279
|
+
>
|
|
280
|
+
<Play size={14} /> Invoke
|
|
281
|
+
</button>
|
|
282
|
+
}>
|
|
283
|
+
<p className="muted" style={{ marginBottom: 12 }}>
|
|
284
|
+
Model: <span className="mono">{detailAgent?.model || '—'}</span>
|
|
285
|
+
</p>
|
|
286
|
+
<textarea
|
|
287
|
+
className="mobile-input"
|
|
288
|
+
rows={5}
|
|
289
|
+
placeholder="What should this agent do?"
|
|
290
|
+
value={invokePrompt}
|
|
291
|
+
onChange={(e) => setInvokePrompt(e.target.value)}
|
|
292
|
+
autoFocus
|
|
293
|
+
/>
|
|
294
|
+
</MobileModal>
|
|
295
|
+
|
|
296
|
+
{/* New agent modal */}
|
|
297
|
+
<NewAgentModal
|
|
298
|
+
open={newOpen}
|
|
299
|
+
onClose={() => setNewOpen(false)}
|
|
300
|
+
onCreate={createAgent}
|
|
301
|
+
/>
|
|
302
|
+
</div>
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function NewAgentModal({ open, onClose, onCreate }: {
|
|
307
|
+
open: boolean;
|
|
308
|
+
onClose: () => void;
|
|
309
|
+
onCreate: (data: {
|
|
310
|
+
name: string; description: string; model: string; mode: string;
|
|
311
|
+
color: string; tools: string[]; tags: string[]; category: string; prompt: string;
|
|
312
|
+
}) => void;
|
|
313
|
+
}) {
|
|
314
|
+
const [name, setName] = useState('');
|
|
315
|
+
const [description, setDescription] = useState('');
|
|
316
|
+
const [model, setModel] = useState('');
|
|
317
|
+
const [mode, setMode] = useState('subagent');
|
|
318
|
+
const [color, setColor] = useState('#8b5cf6');
|
|
319
|
+
const [category, setCategory] = useState('');
|
|
320
|
+
const [tags, setTags] = useState('');
|
|
321
|
+
const [prompt, setPrompt] = useState('');
|
|
322
|
+
|
|
323
|
+
const handleSubmit = (e: React.FormEvent) => {
|
|
324
|
+
e.preventDefault();
|
|
325
|
+
if (!name.trim()) return;
|
|
326
|
+
onCreate({
|
|
327
|
+
name: name.trim(),
|
|
328
|
+
description: description.trim(),
|
|
329
|
+
model,
|
|
330
|
+
mode,
|
|
331
|
+
color,
|
|
332
|
+
tools: [],
|
|
333
|
+
tags: tags.split(',').map((t) => t.trim()).filter(Boolean),
|
|
334
|
+
category,
|
|
335
|
+
prompt,
|
|
336
|
+
});
|
|
337
|
+
setName('');
|
|
338
|
+
setDescription('');
|
|
339
|
+
setModel('');
|
|
340
|
+
setMode('subagent');
|
|
341
|
+
setColor('#8b5cf6');
|
|
342
|
+
setCategory('');
|
|
343
|
+
setTags('');
|
|
344
|
+
setPrompt('');
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
return (
|
|
348
|
+
<MobileModal open={open} onClose={onClose} title="New Agent" actions={
|
|
349
|
+
<button type="submit" form="new-agent-form" className="mobile-btn" style={{ width: '100%' }}>
|
|
350
|
+
<Plus size={14} /> Create
|
|
351
|
+
</button>
|
|
352
|
+
}>
|
|
353
|
+
<form id="new-agent-form" onSubmit={handleSubmit} className="mobile-task-form">
|
|
354
|
+
<label className="mobile-field-label">Name *</label>
|
|
355
|
+
<input className="mobile-input" type="text" placeholder="my-agent" pattern="[a-z0-9][a-z0-9-]{0,63}"
|
|
356
|
+
value={name} onChange={(e) => setName(e.target.value)} autoFocus required />
|
|
357
|
+
<label className="mobile-field-label">Description</label>
|
|
358
|
+
<input className="mobile-input" type="text" placeholder="What does this agent do?"
|
|
359
|
+
value={description} onChange={(e) => setDescription(e.target.value)} />
|
|
360
|
+
<label className="mobile-field-label">Model</label>
|
|
361
|
+
<input className="mobile-input" type="text" placeholder="(provider default)"
|
|
362
|
+
value={model} onChange={(e) => setModel(e.target.value)} />
|
|
363
|
+
<label className="mobile-field-label">Category</label>
|
|
364
|
+
<select className="mobile-input" value={category} onChange={(e) => setCategory(e.target.value)}>
|
|
365
|
+
<option value="">None</option>
|
|
366
|
+
{CATEGORIES.map((c) => <option key={c} value={c}>{c}</option>)}
|
|
367
|
+
</select>
|
|
368
|
+
<label className="mobile-field-label">Tags (comma-separated)</label>
|
|
369
|
+
<input className="mobile-input" type="text" placeholder="tag1, tag2"
|
|
370
|
+
value={tags} onChange={(e) => setTags(e.target.value)} />
|
|
371
|
+
</form>
|
|
372
|
+
</MobileModal>
|
|
373
|
+
);
|
|
374
|
+
}
|