khal-os 1.260324.2
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/.env.example +23 -0
- package/.genie/mailbox/cli-sent.jsonl +3 -0
- package/.genie/mailbox/ds1-wave2-engineer-1.json +15 -0
- package/.genie/mailbox/ds1-wave2-engineer-2.json +15 -0
- package/.genie/mailbox/ds1-wave2-engineer-3.json +15 -0
- package/.genie/state/os-observability.json +39 -0
- package/.genie/state/tmux-control-mode-terminal.json +28 -0
- package/.genie/wishes/genieos-one-theme/WISH.md +417 -0
- package/.genie/wishes/workos-prod-rbac/WISH.md +345 -0
- package/.github/workflows/ci.yml +39 -0
- package/.github/workflows/release.yml +78 -0
- package/.github/workflows/version.yml +122 -0
- package/.husky/pre-commit +1 -0
- package/.pnpm-approve-builds.json +1 -0
- package/CLAUDE.md +117 -0
- package/LICENSE +21 -0
- package/README.md +38 -0
- package/biome.json +124 -0
- package/bun.lock +1249 -0
- package/docs/workos-setup.md +116 -0
- package/ecosystem.config.cjs +26 -0
- package/instrumentation.ts +8 -0
- package/knip.json +35 -0
- package/nats.conf +7 -0
- package/next.config.ts +25 -0
- package/package.json +78 -0
- package/packages/dev3000-app/components.ts +12 -0
- package/packages/dev3000-app/manifest.ts +19 -0
- package/packages/dev3000-app/package.json +23 -0
- package/packages/dev3000-app/views/dev3000/Dev3000App.tsx +758 -0
- package/packages/dev3000-app/views/dev3000/ErrorsPanel.tsx +160 -0
- package/packages/dev3000-app/views/dev3000/dev3000-context.tsx +21 -0
- package/packages/dev3000-app/views/dev3000/index.ts +4 -0
- package/packages/dev3000-app/views/dev3000/schema.ts +55 -0
- package/packages/dev3000-app/views/dev3000/service/index.ts +358 -0
- package/packages/dev3000-app/views/dev3000/service/runtime +1 -0
- package/packages/dev3000-app/views/dev3000/subjects.ts +9 -0
- package/packages/dev3000-app/views/dev3000/types.ts +77 -0
- package/packages/files-app/components.ts +12 -0
- package/packages/files-app/manifest.ts +19 -0
- package/packages/files-app/package.json +23 -0
- package/packages/files-app/views/files/ContextMenu.tsx +151 -0
- package/packages/files-app/views/files/DeleteConfirmDialog.tsx +39 -0
- package/packages/files-app/views/files/FileItem.tsx +128 -0
- package/packages/files-app/views/files/FilesApp.tsx +509 -0
- package/packages/files-app/views/files/FilesListView.tsx +201 -0
- package/packages/files-app/views/files/FilesToolbar.tsx +117 -0
- package/packages/files-app/views/files/GridView.tsx +90 -0
- package/packages/files-app/views/files/InlineInput.tsx +131 -0
- package/packages/files-app/views/files/UploadOverlay.tsx +61 -0
- package/packages/files-app/views/files/schema.ts +49 -0
- package/packages/files-app/views/files/service/index.ts +184 -0
- package/packages/files-app/views/files/service/runtime +1 -0
- package/packages/files-app/views/files/use-files.ts +201 -0
- package/packages/files-app/views/files/use-upload.ts +105 -0
- package/packages/genie-app/components.ts +12 -0
- package/packages/genie-app/lib/subjects.ts +87 -0
- package/packages/genie-app/manifest.ts +19 -0
- package/packages/genie-app/package.json +29 -0
- package/packages/genie-app/views/genie/service/agent-lifecycle.ts +136 -0
- package/packages/genie-app/views/genie/service/cli.ts +114 -0
- package/packages/genie-app/views/genie/service/comms.ts +141 -0
- package/packages/genie-app/views/genie/service/directory.ts +167 -0
- package/packages/genie-app/views/genie/service/index.ts +219 -0
- package/packages/genie-app/views/genie/service/system.ts +123 -0
- package/packages/genie-app/views/genie/service/teams.ts +191 -0
- package/packages/genie-app/views/genie/service/terminal-proxy.ts +184 -0
- package/packages/genie-app/views/genie/service/tmux-control.ts +318 -0
- package/packages/genie-app/views/genie/service/wishes.ts +270 -0
- package/packages/genie-app/views/genie/ui/GenieApp.tsx +5 -0
- package/packages/genie-app/views/genie/ui/PaneCard.tsx +307 -0
- package/packages/genie-app/views/genie/ui/Sidebar.tsx +212 -0
- package/packages/genie-app/views/genie/ui/TabBar.tsx +70 -0
- package/packages/genie-app/views/genie/ui/WorkspaceCanvas.tsx +343 -0
- package/packages/genie-app/views/genie/ui/XTermPane.tsx +306 -0
- package/packages/genie-app/views/genie/ui/hooks/useNatsAction.ts +54 -0
- package/packages/genie-app/views/genie/ui/hooks/useNatsRequest.ts +68 -0
- package/packages/genie-app/views/genie/ui/panels/AgentsPanel.tsx +399 -0
- package/packages/genie-app/views/genie/ui/panels/ChatPanel.tsx +351 -0
- package/packages/genie-app/views/genie/ui/panels/SystemPanel.tsx +195 -0
- package/packages/genie-app/views/genie/ui/panels/TeamsPanel.tsx +560 -0
- package/packages/genie-app/views/genie/ui/panels/WishesPanel.tsx +424 -0
- package/packages/nats-viewer-app/components.ts +12 -0
- package/packages/nats-viewer-app/manifest.ts +18 -0
- package/packages/nats-viewer-app/package.json +14 -0
- package/packages/nats-viewer-app/views/nats-viewer/ActiveSubs.tsx +34 -0
- package/packages/nats-viewer-app/views/nats-viewer/MessageLog.tsx +247 -0
- package/packages/nats-viewer-app/views/nats-viewer/NatsViewer.tsx +209 -0
- package/packages/nats-viewer-app/views/nats-viewer/PublishPanel.tsx +111 -0
- package/packages/nats-viewer-app/views/nats-viewer/RequestPanel.tsx +165 -0
- package/packages/nats-viewer-app/views/nats-viewer/Sidebar.tsx +59 -0
- package/packages/nats-viewer-app/views/nats-viewer/SubjectCatalog.tsx +63 -0
- package/packages/nats-viewer-app/views/nats-viewer/SubscribeInput.tsx +59 -0
- package/packages/nats-viewer-app/views/nats-viewer/index.ts +5 -0
- package/packages/nats-viewer-app/views/nats-viewer/nats-viewer-context.tsx +31 -0
- package/packages/nats-viewer-app/views/nats-viewer/types.ts +7 -0
- package/packages/nats-viewer-app/views/nats-viewer/use-message-buffer.ts +55 -0
- package/packages/os-cli/package.json +18 -0
- package/packages/os-cli/src/commands/events.ts +176 -0
- package/packages/os-cli/src/commands/logs.ts +96 -0
- package/packages/os-cli/src/commands/status.ts +53 -0
- package/packages/os-cli/src/commands/traces.ts +115 -0
- package/packages/os-cli/src/index.ts +15 -0
- package/packages/os-cli/src/lib/formatter.ts +123 -0
- package/packages/os-cli/src/lib/nats.ts +16 -0
- package/packages/os-cli/src/lib/trace-tree.ts +144 -0
- package/packages/os-cli/tsconfig.json +12 -0
- package/packages/os-sdk/package.json +27 -0
- package/packages/os-sdk/src/api/handler.ts +67 -0
- package/packages/os-sdk/src/config.ts +68 -0
- package/packages/os-sdk/src/db/factory.test.ts +42 -0
- package/packages/os-sdk/src/db/factory.ts +72 -0
- package/packages/os-sdk/src/db/migrate.ts +140 -0
- package/packages/os-sdk/src/db/provision.ts +44 -0
- package/packages/os-sdk/src/index.ts +36 -0
- package/packages/os-sdk/src/service/console-intercept.ts +60 -0
- package/packages/os-sdk/src/service/logger.ts +88 -0
- package/packages/os-sdk/src/service/o11y-streams.ts +88 -0
- package/packages/os-sdk/src/service/runtime.ts +259 -0
- package/packages/os-sdk/src/service/trace.ts +71 -0
- package/packages/os-sdk/tsconfig.json +16 -0
- package/packages/os-ui/package.json +13 -0
- package/packages/os-ui/src/index.ts +29 -0
- package/packages/os-ui/src/server.ts +4 -0
- package/packages/os-ui/tsconfig.json +19 -0
- package/packages/settings-app/components.ts +12 -0
- package/packages/settings-app/manifest.ts +18 -0
- package/packages/settings-app/package.json +14 -0
- package/packages/settings-app/views/settings/Settings.tsx +492 -0
- package/packages/terminal-app/components.ts +12 -0
- package/packages/terminal-app/manifest.ts +20 -0
- package/packages/terminal-app/package.json +23 -0
- package/packages/terminal-app/views/terminal/schema.ts +82 -0
- package/packages/terminal-app/views/terminal/service/index.ts +133 -0
- package/packages/terminal-app/views/terminal/service/runtime +1 -0
- package/packages/terminal-app/views/terminal/service/session.ts +290 -0
- package/packages/terminal-app/views/terminal/service/shell-hooks/bashrc-hook.sh +21 -0
- package/packages/terminal-app/views/terminal/types.ts +26 -0
- package/packages/terminal-app/views/terminal/ui/MultiTerminalApp.tsx +615 -0
- package/packages/terminal-app/views/terminal/ui/SplitDragHandle.tsx +91 -0
- package/packages/terminal-app/views/terminal/ui/SplitPaneRenderer.tsx +112 -0
- package/packages/terminal-app/views/terminal/ui/TerminalPane.tsx +478 -0
- package/packages/terminal-app/views/terminal/ui/TerminalTabBar.tsx +131 -0
- package/pnpm-workspace.yaml +9 -0
- package/postcss.config.mjs +7 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/icons/code-server.svg +6 -0
- package/public/icons/default.svg +5 -0
- package/public/icons/dusk/1password.svg +1 -0
- package/public/icons/dusk/activity_monitor.svg +1 -0
- package/public/icons/dusk/app_store.svg +1 -0
- package/public/icons/dusk/atom.svg +1 -0
- package/public/icons/dusk/brave.svg +1 -0
- package/public/icons/dusk/calculator.svg +1 -0
- package/public/icons/dusk/calendar.svg +1 -0
- package/public/icons/dusk/chrome.svg +1 -0
- package/public/icons/dusk/chrome2.svg +1 -0
- package/public/icons/dusk/dashboard.svg +13 -0
- package/public/icons/dusk/discord.svg +1 -0
- package/public/icons/dusk/dropbox.svg +1 -0
- package/public/icons/dusk/electron.svg +1 -0
- package/public/icons/dusk/figma.svg +1 -0
- package/public/icons/dusk/finder.svg +1 -0
- package/public/icons/dusk/finder2.svg +1 -0
- package/public/icons/dusk/finder3.svg +1 -0
- package/public/icons/dusk/firefox.svg +1 -0
- package/public/icons/dusk/framer.svg +1 -0
- package/public/icons/dusk/gimp.svg +1 -0
- package/public/icons/dusk/github_desktop.svg +1 -0
- package/public/icons/dusk/hyper.svg +1 -0
- package/public/icons/dusk/hyper3.svg +1 -0
- package/public/icons/dusk/intellij.svg +1 -0
- package/public/icons/dusk/iterm2.svg +1 -0
- package/public/icons/dusk/itunes.svg +1 -0
- package/public/icons/dusk/mail.svg +1 -0
- package/public/icons/dusk/messenger.svg +1 -0
- package/public/icons/dusk/mongodb.svg +1 -0
- package/public/icons/dusk/notes.svg +1 -0
- package/public/icons/dusk/notion.svg +1 -0
- package/public/icons/dusk/obs.svg +1 -0
- package/public/icons/dusk/pages.svg +1 -0
- package/public/icons/dusk/photos.svg +1 -0
- package/public/icons/dusk/postman.svg +1 -0
- package/public/icons/dusk/preview.svg +1 -0
- package/public/icons/dusk/reminders.svg +1 -0
- package/public/icons/dusk/safari.svg +1 -0
- package/public/icons/dusk/sequel_pro.svg +1 -0
- package/public/icons/dusk/sketch.svg +1 -0
- package/public/icons/dusk/skype.svg +1 -0
- package/public/icons/dusk/slack.svg +1 -0
- package/public/icons/dusk/slack2.svg +1 -0
- package/public/icons/dusk/spotify.svg +1 -0
- package/public/icons/dusk/steam.svg +1 -0
- package/public/icons/dusk/system_preferences.svg +1 -0
- package/public/icons/dusk/tableplus.svg +1 -0
- package/public/icons/dusk/teams.svg +1 -0
- package/public/icons/dusk/telegram.svg +1 -0
- package/public/icons/dusk/terminal.svg +1 -0
- package/public/icons/dusk/todoist.svg +1 -0
- package/public/icons/dusk/trash.svg +1 -0
- package/public/icons/dusk/trello.svg +1 -0
- package/public/icons/dusk/vivaldi.svg +1 -0
- package/public/icons/dusk/vlc.svg +1 -0
- package/public/icons/dusk/vscode.svg +1 -0
- package/public/icons/dusk/whatsapp.svg +1 -0
- package/public/icons/dusk/xeyes.svg +1 -0
- package/public/icons/dusk/zoom.svg +1 -0
- package/public/icons/files.svg +5 -0
- package/public/icons/pwa/icon-192.png +0 -0
- package/public/icons/pwa/icon-512.png +0 -0
- package/public/icons/settings.svg +14 -0
- package/public/icons/terminal.svg +5 -0
- package/public/icons/text-editor.svg +7 -0
- package/public/manifest.json +38 -0
- package/public/next.svg +1 -0
- package/public/sw.js +41 -0
- package/public/vercel.svg +1 -0
- package/public/wallpapers/default.svg +10 -0
- package/public/window.svg +1 -0
- package/scripts/generate-pwa-icons.mjs +33 -0
- package/scripts/install-nats.sh +37 -0
- package/sentry.client.config.ts +21 -0
- package/sentry.edge.config.ts +12 -0
- package/sentry.server.config.ts +12 -0
- package/src/app/api/files/download/route.ts +81 -0
- package/src/app/api/files/download-zip/route.ts +102 -0
- package/src/app/api/files/upload/route.ts +58 -0
- package/src/app/api/webhooks/workos/route.ts +98 -0
- package/src/app/auth/callback/route.ts +16 -0
- package/src/app/auth/logout/route.ts +15 -0
- package/src/app/desktop/desktop-shell.tsx +110 -0
- package/src/app/desktop/layout.tsx +8 -0
- package/src/app/desktop/page.tsx +24 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +7 -0
- package/src/app/layout.tsx +64 -0
- package/src/app/offline/page.tsx +83 -0
- package/src/app/page.tsx +5 -0
- package/src/app/standalone/[appId]/page.tsx +28 -0
- package/src/app/standalone/layout.tsx +10 -0
- package/src/components/app-icon.tsx +55 -0
- package/src/components/apps/_echo/schema.ts +14 -0
- package/src/components/apps/_echo/service/index.ts +42 -0
- package/src/components/apps/app-manifest.ts +97 -0
- package/src/components/apps/app-registry.ts +55 -0
- package/src/components/apps/dev3000/Dev3000App.tsx +224 -0
- package/src/components/apps/dev3000/ErrorsPanel.tsx +160 -0
- package/src/components/apps/dev3000/Sidebar.tsx +41 -0
- package/src/components/apps/dev3000/TimelineLog.tsx +173 -0
- package/src/components/apps/dev3000/dev3000-context.tsx +29 -0
- package/src/components/apps/dev3000/index.ts +4 -0
- package/src/components/apps/dev3000/schema.ts +48 -0
- package/src/components/apps/dev3000/service/index.ts +520 -0
- package/src/components/apps/dev3000/service/runtime +1 -0
- package/src/components/apps/dev3000/types.ts +15 -0
- package/src/components/apps/dev3000/use-message-buffer.ts +46 -0
- package/src/components/apps/files/ContextMenu.tsx +151 -0
- package/src/components/apps/files/DeleteConfirmDialog.tsx +78 -0
- package/src/components/apps/files/FileItem.tsx +128 -0
- package/src/components/apps/files/FilesApp.tsx +509 -0
- package/src/components/apps/files/FilesListView.tsx +201 -0
- package/src/components/apps/files/FilesToolbar.tsx +117 -0
- package/src/components/apps/files/GridView.tsx +90 -0
- package/src/components/apps/files/InlineInput.tsx +131 -0
- package/src/components/apps/files/UploadOverlay.tsx +61 -0
- package/src/components/apps/files/schema.ts +49 -0
- package/src/components/apps/files/service/index.ts +227 -0
- package/src/components/apps/files/service/runtime +1 -0
- package/src/components/apps/files/use-files.ts +201 -0
- package/src/components/apps/files/use-upload.ts +105 -0
- package/src/components/apps/nats-viewer/ActiveSubs.tsx +34 -0
- package/src/components/apps/nats-viewer/MessageLog.tsx +247 -0
- package/src/components/apps/nats-viewer/NatsViewer.tsx +209 -0
- package/src/components/apps/nats-viewer/PublishPanel.tsx +113 -0
- package/src/components/apps/nats-viewer/RequestPanel.tsx +167 -0
- package/src/components/apps/nats-viewer/Sidebar.tsx +62 -0
- package/src/components/apps/nats-viewer/SubjectCatalog.tsx +64 -0
- package/src/components/apps/nats-viewer/SubscribeInput.tsx +59 -0
- package/src/components/apps/nats-viewer/index.ts +5 -0
- package/src/components/apps/nats-viewer/nats-viewer-context.tsx +31 -0
- package/src/components/apps/nats-viewer/types.ts +7 -0
- package/src/components/apps/nats-viewer/use-message-buffer.ts +55 -0
- package/src/components/apps/settings/Settings.tsx +492 -0
- package/src/components/apps/terminal/schema.ts +82 -0
- package/src/components/apps/terminal/service/index.ts +189 -0
- package/src/components/apps/terminal/service/runtime +1 -0
- package/src/components/apps/terminal/service/session.ts +296 -0
- package/src/components/apps/terminal/service/shell-hooks/bashrc-hook.sh +21 -0
- package/src/components/apps/terminal/types.ts +26 -0
- package/src/components/apps/terminal/ui/MultiTerminalApp.tsx +617 -0
- package/src/components/apps/terminal/ui/SplitDragHandle.tsx +91 -0
- package/src/components/apps/terminal/ui/SplitPaneRenderer.tsx +112 -0
- package/src/components/apps/terminal/ui/TerminalPane.tsx +476 -0
- package/src/components/apps/terminal/ui/TerminalTabBar.tsx +131 -0
- package/src/components/desktop/AnimatedBackground.tsx +69 -0
- package/src/components/desktop/Desktop.tsx +79 -0
- package/src/components/desktop/DesktopBackground.tsx +16 -0
- package/src/components/desktop/DesktopIcon.tsx +49 -0
- package/src/components/desktop/ShortcutViewer.tsx +136 -0
- package/src/components/desktop/WindowRenderer.tsx +34 -0
- package/src/components/desktop/WindowSwitcher.tsx +42 -0
- package/src/components/notifications/NotificationCenter.tsx +153 -0
- package/src/components/notifications/NotificationToasts.tsx +66 -0
- package/src/components/notifications/OrphanSessionToast.tsx +293 -0
- package/src/components/os-primitives/collapsible-sidebar.tsx +226 -0
- package/src/components/os-primitives/dialog.tsx +76 -0
- package/src/components/os-primitives/empty-state.tsx +43 -0
- package/src/components/os-primitives/index.ts +21 -0
- package/src/components/os-primitives/list-view.tsx +155 -0
- package/src/components/os-primitives/property-panel.tsx +108 -0
- package/src/components/os-primitives/section-header.tsx +19 -0
- package/src/components/os-primitives/sidebar-nav.tsx +110 -0
- package/src/components/os-primitives/split-pane.tsx +146 -0
- package/src/components/os-primitives/status-badge.tsx +10 -0
- package/src/components/os-primitives/status-bar.tsx +100 -0
- package/src/components/os-primitives/toolbar.tsx +152 -0
- package/src/components/taskbar/AppLauncher.tsx +114 -0
- package/src/components/taskbar/RunningApps.tsx +71 -0
- package/src/components/taskbar/SystemTray.tsx +134 -0
- package/src/components/taskbar/Taskbar.tsx +45 -0
- package/src/components/taskbar/UserMenu.tsx +138 -0
- package/src/components/taskbar/WorkspaceSwitcher.tsx +9 -0
- package/src/components/ui/ContextMenu.tsx +130 -0
- package/src/components/ui/badge.tsx +39 -0
- package/src/components/ui/button.tsx +102 -0
- package/src/components/ui/command.tsx +165 -0
- package/src/components/ui/dropdown-menu.tsx +233 -0
- package/src/components/ui/input.tsx +48 -0
- package/src/components/ui/note.tsx +55 -0
- package/src/components/ui/separator.tsx +25 -0
- package/src/components/ui/spinner.tsx +42 -0
- package/src/components/ui/switch.tsx +36 -0
- package/src/components/ui/theme-provider.tsx +24 -0
- package/src/components/ui/theme-switcher.tsx +51 -0
- package/src/components/ui/tooltip.tsx +62 -0
- package/src/components/window/MobileWindowStack.tsx +218 -0
- package/src/components/window/SnapPreview.tsx +37 -0
- package/src/components/window/StandaloneFrame.tsx +170 -0
- package/src/components/window/Window.tsx +423 -0
- package/src/components/window/WindowContent.tsx +14 -0
- package/src/components/window/WindowControlsOverlay.tsx +89 -0
- package/src/components/window/WindowFrame.tsx +124 -0
- package/src/lib/auth/index.ts +27 -0
- package/src/lib/auth/roles.ts +50 -0
- package/src/lib/auth/types.ts +32 -0
- package/src/lib/auth/use-auth.ts +53 -0
- package/src/lib/auth/webhook-handler.ts +87 -0
- package/src/lib/auth/workos.ts +67 -0
- package/src/lib/constants.ts +1 -0
- package/src/lib/desktop/dedup.ts +57 -0
- package/src/lib/desktop/schema.ts +55 -0
- package/src/lib/files/filename-validation.ts +41 -0
- package/src/lib/files/safe-path.ts +49 -0
- package/src/lib/hooks/use-desktop-nats.ts +438 -0
- package/src/lib/hooks/use-is-mobile.ts +23 -0
- package/src/lib/hooks/use-launch-app.ts +79 -0
- package/src/lib/hooks/use-nats-notifications.ts +84 -0
- package/src/lib/hooks/use-nats.ts +60 -0
- package/src/lib/hooks/use-visual-viewport.ts +72 -0
- package/src/lib/icons/resolve-window-icon.ts +10 -0
- package/src/lib/keyboard/defaults.ts +146 -0
- package/src/lib/keyboard/types.ts +52 -0
- package/src/lib/keyboard/use-global-keybinds.ts +231 -0
- package/src/lib/nats-client.ts +255 -0
- package/src/lib/nats.ts +35 -0
- package/src/lib/notifications/schema.ts +12 -0
- package/src/lib/service-loader.ts +171 -0
- package/src/lib/subjects.ts +64 -0
- package/src/lib/utils.ts +6 -0
- package/src/lib/ws-bridge.ts +288 -0
- package/src/lib/ws-protocol.ts +53 -0
- package/src/lib/ws-server.ts +167 -0
- package/src/middleware.ts +57 -0
- package/src/stores/desktop-store.ts +112 -0
- package/src/stores/keybind-store.ts +66 -0
- package/src/stores/notification-store.ts +271 -0
- package/src/stores/theme-store.ts +25 -0
- package/src/stores/window-store.ts +294 -0
- package/src/theme/animations.css +68 -0
- package/src/theme/base.css +123 -0
- package/src/theme/controls.css +35 -0
- package/src/theme/design-tokens.css +276 -0
- package/src/theme/index.css +23 -0
- package/src/theme/menus.css +45 -0
- package/src/theme/status.css +41 -0
- package/src/theme/surfaces.css +94 -0
- package/src/theme/tailwind-map.css +138 -0
- package/src/theme/taskbar.css +25 -0
- package/src/theme/terminal.css +55 -0
- package/src/theme/typography.css +26 -0
- package/src/theme/utilities.css +156 -0
- package/src/theme/window.css +103 -0
- package/src/types/desktop-entry.ts +12 -0
- package/src/types/use-descendants.d.ts +13 -0
- package/src/types/window.ts +28 -0
- package/src/types.d.ts +9 -0
- package/tauri/Cargo.lock +5464 -0
- package/tauri/Cargo.toml +19 -0
- package/tauri/build.rs +3 -0
- package/tauri/capabilities/default.json +36 -0
- package/tauri/icons/128x128.png +0 -0
- package/tauri/icons/128x128@2x.png +0 -0
- package/tauri/icons/32x32.png +0 -0
- package/tauri/icons/icon.png +0 -0
- package/tauri/src/main.rs +396 -0
- package/tauri/tauri.conf.json +23 -0
- package/tsconfig.json +43 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wishes/Work domain — wish lifecycle and work orchestration via NATS.
|
|
3
|
+
*
|
|
4
|
+
* Endpoints:
|
|
5
|
+
* os.genie.wish.list — list all wishes from .genie/wishes/ directories
|
|
6
|
+
* os.genie.wish.status — parse `genie status <slug>` into structured groups
|
|
7
|
+
* os.genie.wish.work — trigger `genie work <ref>` (async, spawns agents)
|
|
8
|
+
* os.genie.wish.done — mark a wish/group done via `genie done <ref>`
|
|
9
|
+
* os.genie.wish.reset — reset a wish/group via `genie reset <ref>`
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { readdirSync, readFileSync, statSync } from 'node:fs';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { SUBJECTS } from '../../../lib/subjects';
|
|
15
|
+
import { runGenie, runGenieAsync } from './cli';
|
|
16
|
+
|
|
17
|
+
/** Shape of a parsed execution group from `genie status` output */
|
|
18
|
+
interface WishGroup {
|
|
19
|
+
group: number | string;
|
|
20
|
+
status: string;
|
|
21
|
+
assignee: string | null;
|
|
22
|
+
started: string | null;
|
|
23
|
+
completed: string | null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Shape of a wish entry from directory scanning */
|
|
27
|
+
interface WishEntry {
|
|
28
|
+
slug: string;
|
|
29
|
+
status: string | null;
|
|
30
|
+
date: string | null;
|
|
31
|
+
summary: string | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Parse `genie status <slug>` text output into structured data.
|
|
36
|
+
*
|
|
37
|
+
* Expected format:
|
|
38
|
+
* Wish: <slug>
|
|
39
|
+
* ──────────
|
|
40
|
+
* GROUP STATUS ASSIGNEE STARTED COMPLETED
|
|
41
|
+
* ─────────────────────────────────────────────────────────
|
|
42
|
+
* 1 ✅ done engineer Mar 19, 16:16 Mar 19, 16:18
|
|
43
|
+
* 2 🔄 in_progress engineer Mar 19, 16:18 -
|
|
44
|
+
* ...
|
|
45
|
+
* Progress: 1/7 done | 5 in progress | 0 ready | 1 blocked
|
|
46
|
+
*/
|
|
47
|
+
function parseStatusOutput(text: string): { groups: WishGroup[]; summary: string } {
|
|
48
|
+
const lines = text.split('\n');
|
|
49
|
+
const groups: WishGroup[] = [];
|
|
50
|
+
let summary = '';
|
|
51
|
+
|
|
52
|
+
for (const line of lines) {
|
|
53
|
+
// Match progress summary line
|
|
54
|
+
if (line.trim().startsWith('Progress:')) {
|
|
55
|
+
summary = line.trim();
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Match group rows — they start with optional spaces, then a number or word like "review"
|
|
60
|
+
// Pattern: group_id status_emoji status_text assignee started completed
|
|
61
|
+
const groupMatch = line.match(
|
|
62
|
+
/^\s+(\S+)\s+(?:[^\s]*\s+)?(done|in_progress|ready|blocked|pending|failed|review)\s+(\S+|-)\s+(.+)$/i
|
|
63
|
+
);
|
|
64
|
+
if (groupMatch) {
|
|
65
|
+
const [, groupId, status, assignee, rest] = groupMatch;
|
|
66
|
+
// Parse the dates — "started completed" or "Mar 19, 16:16 Mar 19, 16:18" or "- -"
|
|
67
|
+
const dateParts = rest.trim().split(/\s{2,}/);
|
|
68
|
+
const started = dateParts[0] === '-' ? null : dateParts[0] || null;
|
|
69
|
+
const completed = dateParts[1] === '-' ? null : dateParts[1] || null;
|
|
70
|
+
|
|
71
|
+
groups.push({
|
|
72
|
+
group: /^\d+$/.test(groupId) ? Number.parseInt(groupId, 10) : groupId,
|
|
73
|
+
status: status.toLowerCase(),
|
|
74
|
+
assignee: assignee === '-' ? null : assignee,
|
|
75
|
+
started,
|
|
76
|
+
completed,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return { groups, summary };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Parse WISH.md frontmatter to extract status, date, summary.
|
|
86
|
+
*/
|
|
87
|
+
function parseWishFrontmatter(content: string): { status: string | null; date: string | null; summary: string | null } {
|
|
88
|
+
let status: string | null = null;
|
|
89
|
+
let date: string | null = null;
|
|
90
|
+
let summary: string | null = null;
|
|
91
|
+
|
|
92
|
+
// Extract from markdown table format: | **Status** | DRAFT |
|
|
93
|
+
const statusMatch = content.match(/\*\*Status\*\*\s*\|\s*(\S+)/);
|
|
94
|
+
if (statusMatch) status = statusMatch[1];
|
|
95
|
+
|
|
96
|
+
const dateMatch = content.match(/\*\*Date\*\*\s*\|\s*(\S+)/);
|
|
97
|
+
if (dateMatch) date = dateMatch[1];
|
|
98
|
+
|
|
99
|
+
// Summary is typically the first paragraph after ## Summary
|
|
100
|
+
const summaryMatch = content.match(/## Summary\s*\n+(.+?)(?:\n\n|\n##)/s);
|
|
101
|
+
if (summaryMatch) summary = summaryMatch[1].trim();
|
|
102
|
+
|
|
103
|
+
return { status, date, summary };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Find all .genie/wishes/ directories — check both the repo working directory and ~/.genie/wishes/.
|
|
108
|
+
*/
|
|
109
|
+
function findWishDirs(): string[] {
|
|
110
|
+
const dirs: string[] = [];
|
|
111
|
+
const homeWishes = join(process.env.HOME || '', '.genie', 'wishes');
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
statSync(homeWishes);
|
|
115
|
+
dirs.push(homeWishes);
|
|
116
|
+
} catch {
|
|
117
|
+
// doesn't exist
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return dirs;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* List all wishes by scanning wish directories.
|
|
125
|
+
*/
|
|
126
|
+
function listWishes(): WishEntry[] {
|
|
127
|
+
const wishes: WishEntry[] = [];
|
|
128
|
+
const seen = new Set<string>();
|
|
129
|
+
|
|
130
|
+
for (const wishDir of findWishDirs()) {
|
|
131
|
+
try {
|
|
132
|
+
const entries = readdirSync(wishDir, { withFileTypes: true });
|
|
133
|
+
for (const entry of entries) {
|
|
134
|
+
if (!entry.isDirectory() || seen.has(entry.name)) continue;
|
|
135
|
+
seen.add(entry.name);
|
|
136
|
+
|
|
137
|
+
const wishMdPath = join(wishDir, entry.name, 'WISH.md');
|
|
138
|
+
try {
|
|
139
|
+
const content = readFileSync(wishMdPath, 'utf-8');
|
|
140
|
+
const frontmatter = parseWishFrontmatter(content);
|
|
141
|
+
wishes.push({
|
|
142
|
+
slug: entry.name,
|
|
143
|
+
status: frontmatter.status,
|
|
144
|
+
date: frontmatter.date,
|
|
145
|
+
summary: frontmatter.summary,
|
|
146
|
+
});
|
|
147
|
+
} catch {
|
|
148
|
+
// WISH.md doesn't exist or can't be read — still list the slug
|
|
149
|
+
wishes.push({ slug: entry.name, status: null, date: null, summary: null });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
} catch {
|
|
153
|
+
// directory doesn't exist or can't be read
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return wishes;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export const wishHandlers = [
|
|
161
|
+
// --- List all wishes ---
|
|
162
|
+
{
|
|
163
|
+
subject: SUBJECTS.wish.list(),
|
|
164
|
+
handler: (msg: { respond: (data: string) => void }) => {
|
|
165
|
+
try {
|
|
166
|
+
const wishes = listWishes();
|
|
167
|
+
msg.respond(JSON.stringify({ wishes }));
|
|
168
|
+
} catch (err) {
|
|
169
|
+
msg.respond(JSON.stringify({ error: String(err) }));
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
// --- Get wish status ---
|
|
175
|
+
{
|
|
176
|
+
subject: SUBJECTS.wish.status(),
|
|
177
|
+
handler: (msg: { data: Uint8Array; json: <T>() => T; respond: (data: string) => void }) => {
|
|
178
|
+
try {
|
|
179
|
+
const req = msg.json<{ slug: string }>();
|
|
180
|
+
if (!req.slug) {
|
|
181
|
+
msg.respond(JSON.stringify({ error: 'slug is required' }));
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const result = runGenie(['status', req.slug], { json: false });
|
|
186
|
+
if (!result.ok) {
|
|
187
|
+
msg.respond(JSON.stringify({ error: result.error }));
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const parsed = parseStatusOutput(result.data as string);
|
|
192
|
+
msg.respond(JSON.stringify(parsed));
|
|
193
|
+
} catch (err) {
|
|
194
|
+
msg.respond(JSON.stringify({ error: String(err) }));
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
// --- Trigger work execution (async — spawns agents) ---
|
|
200
|
+
{
|
|
201
|
+
subject: SUBJECTS.wish.work(),
|
|
202
|
+
handler: async (msg: { data: Uint8Array; json: <T>() => T; respond: (data: string) => void }) => {
|
|
203
|
+
try {
|
|
204
|
+
const req = msg.json<{ ref: string; agent?: string }>();
|
|
205
|
+
if (!req.ref) {
|
|
206
|
+
msg.respond(JSON.stringify({ error: 'ref is required' }));
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const args = ['work', req.ref];
|
|
211
|
+
if (req.agent) args.push(req.agent);
|
|
212
|
+
|
|
213
|
+
const result = await runGenieAsync(args, { json: false, timeout: 120_000 });
|
|
214
|
+
if (!result.ok) {
|
|
215
|
+
msg.respond(JSON.stringify({ ok: false, error: result.error }));
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
msg.respond(JSON.stringify({ ok: true, output: result.data }));
|
|
219
|
+
} catch (err) {
|
|
220
|
+
msg.respond(JSON.stringify({ ok: false, error: String(err) }));
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
// --- Mark wish/group as done ---
|
|
226
|
+
{
|
|
227
|
+
subject: SUBJECTS.wish.done(),
|
|
228
|
+
handler: (msg: { data: Uint8Array; json: <T>() => T; respond: (data: string) => void }) => {
|
|
229
|
+
try {
|
|
230
|
+
const req = msg.json<{ ref: string }>();
|
|
231
|
+
if (!req.ref) {
|
|
232
|
+
msg.respond(JSON.stringify({ error: 'ref is required' }));
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const result = runGenie(['done', req.ref], { json: false });
|
|
237
|
+
if (!result.ok) {
|
|
238
|
+
msg.respond(JSON.stringify({ ok: false, error: result.error }));
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
msg.respond(JSON.stringify({ ok: true }));
|
|
242
|
+
} catch (err) {
|
|
243
|
+
msg.respond(JSON.stringify({ ok: false, error: String(err) }));
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
// --- Reset wish/group ---
|
|
249
|
+
{
|
|
250
|
+
subject: SUBJECTS.wish.reset(),
|
|
251
|
+
handler: (msg: { data: Uint8Array; json: <T>() => T; respond: (data: string) => void }) => {
|
|
252
|
+
try {
|
|
253
|
+
const req = msg.json<{ ref: string }>();
|
|
254
|
+
if (!req.ref) {
|
|
255
|
+
msg.respond(JSON.stringify({ error: 'ref is required' }));
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const result = runGenie(['reset', req.ref], { json: false });
|
|
260
|
+
if (!result.ok) {
|
|
261
|
+
msg.respond(JSON.stringify({ ok: false, error: result.error }));
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
msg.respond(JSON.stringify({ ok: true }));
|
|
265
|
+
} catch (err) {
|
|
266
|
+
msg.respond(JSON.stringify({ ok: false, error: String(err) }));
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
];
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from 'react';
|
|
4
|
+
import { getNatsClient } from '@/lib/nats-client';
|
|
5
|
+
import { SUBJECTS } from '../../../lib/subjects';
|
|
6
|
+
import { XTermPane } from './XTermPane';
|
|
7
|
+
|
|
8
|
+
interface AgentInfo {
|
|
9
|
+
name: string;
|
|
10
|
+
color: string;
|
|
11
|
+
state: string;
|
|
12
|
+
role: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface PaneData {
|
|
16
|
+
id: string;
|
|
17
|
+
windowId: string;
|
|
18
|
+
active: boolean;
|
|
19
|
+
pid: number;
|
|
20
|
+
command: string;
|
|
21
|
+
title: string;
|
|
22
|
+
left: number;
|
|
23
|
+
top: number;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
dead: boolean;
|
|
27
|
+
agent: AgentInfo | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface PaneCardProps {
|
|
31
|
+
pane: PaneData;
|
|
32
|
+
isMaximized: boolean;
|
|
33
|
+
onMaximize: () => void;
|
|
34
|
+
onRestore: () => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const COLOR_MAP: Record<string, string> = {
|
|
38
|
+
red: '#ef4444',
|
|
39
|
+
blue: '#3b82f6',
|
|
40
|
+
green: '#22c55e',
|
|
41
|
+
yellow: '#eab308',
|
|
42
|
+
purple: '#a855f7',
|
|
43
|
+
orange: '#f97316',
|
|
44
|
+
pink: '#ec4899',
|
|
45
|
+
cyan: '#06b6d4',
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const STATE_COLORS: Record<string, string> = {
|
|
49
|
+
working: '#22c55e',
|
|
50
|
+
running: '#22c55e',
|
|
51
|
+
active: '#22c55e',
|
|
52
|
+
spawning: '#eab308',
|
|
53
|
+
starting: '#eab308',
|
|
54
|
+
idle: '#6b7280',
|
|
55
|
+
offline: '#6b7280',
|
|
56
|
+
unknown: '#6b7280',
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
function resolveColor(color: string | undefined): string {
|
|
60
|
+
if (!color) return '#6b7280';
|
|
61
|
+
return COLOR_MAP[color] || color;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function stateColor(state: string | undefined): string {
|
|
65
|
+
if (!state) return '#6b7280';
|
|
66
|
+
return STATE_COLORS[state] || '#6b7280';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function displayName(pane: PaneData): string {
|
|
70
|
+
return pane.agent?.name || pane.title || pane.command;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// --- Kill confirmation mini-dialog (inline above the pane) ---
|
|
74
|
+
|
|
75
|
+
function PaneKillConfirm({
|
|
76
|
+
agentName,
|
|
77
|
+
onConfirm,
|
|
78
|
+
onCancel,
|
|
79
|
+
loading,
|
|
80
|
+
}: {
|
|
81
|
+
agentName: string;
|
|
82
|
+
onConfirm: () => void;
|
|
83
|
+
onCancel: () => void;
|
|
84
|
+
loading: boolean;
|
|
85
|
+
}) {
|
|
86
|
+
return (
|
|
87
|
+
<div className="absolute inset-x-0 top-7 z-10 flex items-center justify-between border-b border-white/10 bg-red-950/80 px-2 py-1.5 backdrop-blur-sm">
|
|
88
|
+
<span className="text-[10px] text-red-300">
|
|
89
|
+
Kill <span className="font-semibold">{agentName}</span>?
|
|
90
|
+
</span>
|
|
91
|
+
<div className="flex gap-1">
|
|
92
|
+
<button
|
|
93
|
+
type="button"
|
|
94
|
+
onClick={onCancel}
|
|
95
|
+
className="rounded px-1.5 py-0.5 text-[10px] text-[var(--os-text-secondary)] hover:bg-white/10"
|
|
96
|
+
>
|
|
97
|
+
No
|
|
98
|
+
</button>
|
|
99
|
+
<button
|
|
100
|
+
type="button"
|
|
101
|
+
onClick={onConfirm}
|
|
102
|
+
disabled={loading}
|
|
103
|
+
className="rounded bg-red-600 px-1.5 py-0.5 text-[10px] text-white hover:bg-red-500 disabled:opacity-50"
|
|
104
|
+
>
|
|
105
|
+
{loading ? '...' : 'Yes'}
|
|
106
|
+
</button>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// --- Agent action helpers ---
|
|
113
|
+
|
|
114
|
+
async function natsAgentAction(subject: string, name: string): Promise<void> {
|
|
115
|
+
const client = getNatsClient();
|
|
116
|
+
const response = (await client.request(subject, { name }, 10000)) as { ok?: boolean; error?: string };
|
|
117
|
+
if (response.error) throw new Error(response.error);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function PaneCard({ pane, isMaximized, onMaximize, onRestore }: PaneCardProps) {
|
|
121
|
+
const color = resolveColor(pane.agent?.color);
|
|
122
|
+
const name = displayName(pane);
|
|
123
|
+
const role = pane.agent?.role;
|
|
124
|
+
const state = pane.agent?.state;
|
|
125
|
+
const hasAgent = pane.agent !== null;
|
|
126
|
+
|
|
127
|
+
const [showKillConfirm, setShowKillConfirm] = useState(false);
|
|
128
|
+
const [actionLoading, setActionLoading] = useState(false);
|
|
129
|
+
|
|
130
|
+
const handleHeaderDoubleClick = useCallback(() => {
|
|
131
|
+
if (isMaximized) {
|
|
132
|
+
onRestore();
|
|
133
|
+
} else {
|
|
134
|
+
onMaximize();
|
|
135
|
+
}
|
|
136
|
+
}, [isMaximized, onMaximize, onRestore]);
|
|
137
|
+
|
|
138
|
+
const handleMaximizeClick = useCallback(
|
|
139
|
+
(e: React.MouseEvent) => {
|
|
140
|
+
e.stopPropagation();
|
|
141
|
+
if (isMaximized) {
|
|
142
|
+
onRestore();
|
|
143
|
+
} else {
|
|
144
|
+
onMaximize();
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
[isMaximized, onMaximize, onRestore]
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
const handleStop = useCallback(
|
|
151
|
+
async (e: React.MouseEvent) => {
|
|
152
|
+
e.stopPropagation();
|
|
153
|
+
if (!pane.agent) return;
|
|
154
|
+
setActionLoading(true);
|
|
155
|
+
try {
|
|
156
|
+
await natsAgentAction(SUBJECTS.agent.stop(), pane.agent.name);
|
|
157
|
+
} catch {
|
|
158
|
+
// best-effort — agent may already be stopped
|
|
159
|
+
} finally {
|
|
160
|
+
setActionLoading(false);
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
[pane.agent]
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
const handleKillClick = useCallback((e: React.MouseEvent) => {
|
|
167
|
+
e.stopPropagation();
|
|
168
|
+
setShowKillConfirm(true);
|
|
169
|
+
}, []);
|
|
170
|
+
|
|
171
|
+
const handleKillConfirm = useCallback(async () => {
|
|
172
|
+
if (!pane.agent) return;
|
|
173
|
+
setActionLoading(true);
|
|
174
|
+
try {
|
|
175
|
+
await natsAgentAction(SUBJECTS.agent.kill(), pane.agent.name);
|
|
176
|
+
} catch {
|
|
177
|
+
// best-effort
|
|
178
|
+
} finally {
|
|
179
|
+
setActionLoading(false);
|
|
180
|
+
setShowKillConfirm(false);
|
|
181
|
+
}
|
|
182
|
+
}, [pane.agent]);
|
|
183
|
+
|
|
184
|
+
const wrapperClass = isMaximized
|
|
185
|
+
? 'fixed inset-0 z-50 flex flex-col bg-black/95'
|
|
186
|
+
: 'relative flex h-full flex-col overflow-hidden rounded border border-white/10 bg-black/40 shadow-lg';
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<div className={wrapperClass}>
|
|
190
|
+
{/* Header bar — compact ~28px */}
|
|
191
|
+
<div
|
|
192
|
+
className="pane-card-header group flex shrink-0 cursor-grab items-center gap-1.5 border-b border-white/10 px-2 active:cursor-grabbing"
|
|
193
|
+
style={{ height: '28px' }}
|
|
194
|
+
onDoubleClick={handleHeaderDoubleClick}
|
|
195
|
+
>
|
|
196
|
+
{/* Color dot */}
|
|
197
|
+
<div className="h-2 w-2 shrink-0 rounded-full" style={{ backgroundColor: color }} />
|
|
198
|
+
|
|
199
|
+
{/* Agent name */}
|
|
200
|
+
<span className="min-w-0 flex-1 truncate text-[11px] font-medium text-[var(--os-text-primary)]">{name}</span>
|
|
201
|
+
|
|
202
|
+
{/* Role badge */}
|
|
203
|
+
{role && (
|
|
204
|
+
<span className="shrink-0 rounded-full bg-white/10 px-1.5 py-0.5 text-[9px] leading-none text-[var(--os-text-secondary)]">
|
|
205
|
+
{role}
|
|
206
|
+
</span>
|
|
207
|
+
)}
|
|
208
|
+
|
|
209
|
+
{/* Dead badge */}
|
|
210
|
+
{pane.dead && <span className="shrink-0 rounded bg-red-500/20 px-1 py-0.5 text-[9px] text-red-400">dead</span>}
|
|
211
|
+
|
|
212
|
+
{/* State indicator dot */}
|
|
213
|
+
{state && !pane.dead && (
|
|
214
|
+
<div
|
|
215
|
+
className="h-1.5 w-1.5 shrink-0 rounded-full"
|
|
216
|
+
style={{ backgroundColor: stateColor(state) }}
|
|
217
|
+
title={state}
|
|
218
|
+
/>
|
|
219
|
+
)}
|
|
220
|
+
|
|
221
|
+
{/* Agent action buttons — only for agent panes, visible on hover */}
|
|
222
|
+
{hasAgent && !pane.dead && (
|
|
223
|
+
<div className="flex shrink-0 items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity">
|
|
224
|
+
{/* Stop (pause icon) */}
|
|
225
|
+
<button
|
|
226
|
+
type="button"
|
|
227
|
+
onClick={handleStop}
|
|
228
|
+
disabled={actionLoading}
|
|
229
|
+
className="shrink-0 rounded p-0.5 text-[var(--os-text-secondary)] hover:bg-yellow-500/20 hover:text-yellow-400 disabled:opacity-50"
|
|
230
|
+
title="Stop agent"
|
|
231
|
+
>
|
|
232
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" strokeWidth="1.2">
|
|
233
|
+
<title>Stop</title>
|
|
234
|
+
<rect x="2" y="2" width="3" height="8" rx="0.5" />
|
|
235
|
+
<rect x="7" y="2" width="3" height="8" rx="0.5" />
|
|
236
|
+
</svg>
|
|
237
|
+
</button>
|
|
238
|
+
|
|
239
|
+
{/* Kill (x icon) */}
|
|
240
|
+
<button
|
|
241
|
+
type="button"
|
|
242
|
+
onClick={handleKillClick}
|
|
243
|
+
disabled={actionLoading}
|
|
244
|
+
className="shrink-0 rounded p-0.5 text-[var(--os-text-secondary)] hover:bg-red-500/20 hover:text-red-400 disabled:opacity-50"
|
|
245
|
+
title="Kill agent"
|
|
246
|
+
>
|
|
247
|
+
<svg
|
|
248
|
+
width="12"
|
|
249
|
+
height="12"
|
|
250
|
+
viewBox="0 0 12 12"
|
|
251
|
+
fill="none"
|
|
252
|
+
stroke="currentColor"
|
|
253
|
+
strokeWidth="1.2"
|
|
254
|
+
strokeLinecap="round"
|
|
255
|
+
>
|
|
256
|
+
<title>Kill</title>
|
|
257
|
+
<path d="M3 3l6 6M9 3l-6 6" />
|
|
258
|
+
</svg>
|
|
259
|
+
</button>
|
|
260
|
+
</div>
|
|
261
|
+
)}
|
|
262
|
+
|
|
263
|
+
{/* Maximize/Restore button */}
|
|
264
|
+
<button
|
|
265
|
+
type="button"
|
|
266
|
+
onClick={handleMaximizeClick}
|
|
267
|
+
className="shrink-0 rounded p-0.5 text-[var(--os-text-secondary)] hover:bg-white/10 hover:text-[var(--os-text-primary)]"
|
|
268
|
+
title={isMaximized ? 'Restore' : 'Maximize'}
|
|
269
|
+
>
|
|
270
|
+
{isMaximized ? (
|
|
271
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none">
|
|
272
|
+
<title>Restore</title>
|
|
273
|
+
<rect x="0.5" y="2.5" width="7" height="7" rx="1" stroke="currentColor" strokeWidth="1" />
|
|
274
|
+
<path
|
|
275
|
+
d="M4 2.5V1.5C4 0.948 4.448 0.5 5 0.5H10.5C11.052 0.5 11.5 0.948 11.5 1.5V7C11.5 7.552 11.052 8 10.5 8H9.5"
|
|
276
|
+
stroke="currentColor"
|
|
277
|
+
strokeWidth="1"
|
|
278
|
+
/>
|
|
279
|
+
</svg>
|
|
280
|
+
) : (
|
|
281
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none">
|
|
282
|
+
<title>Maximize</title>
|
|
283
|
+
<rect x="0.5" y="0.5" width="11" height="11" rx="1" stroke="currentColor" strokeWidth="1" />
|
|
284
|
+
</svg>
|
|
285
|
+
)}
|
|
286
|
+
</button>
|
|
287
|
+
</div>
|
|
288
|
+
|
|
289
|
+
{/* Kill confirmation bar */}
|
|
290
|
+
{showKillConfirm && pane.agent && (
|
|
291
|
+
<PaneKillConfirm
|
|
292
|
+
agentName={pane.agent.name}
|
|
293
|
+
onConfirm={handleKillConfirm}
|
|
294
|
+
onCancel={() => setShowKillConfirm(false)}
|
|
295
|
+
loading={actionLoading}
|
|
296
|
+
/>
|
|
297
|
+
)}
|
|
298
|
+
|
|
299
|
+
{/* Terminal body */}
|
|
300
|
+
<div className="min-h-0 flex-1 overflow-hidden">
|
|
301
|
+
<XTermPane tmuxPaneId={pane.id} />
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export type { AgentInfo, PaneData as PaneCardData };
|