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,424 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from 'react';
|
|
4
|
+
import { SUBJECTS } from '../../../../lib/subjects';
|
|
5
|
+
import { useNatsAction } from '../hooks/useNatsAction';
|
|
6
|
+
import { useNatsRequest } from '../hooks/useNatsRequest';
|
|
7
|
+
|
|
8
|
+
// --- Types matching service/wishes.ts responses ---
|
|
9
|
+
|
|
10
|
+
interface WishEntry {
|
|
11
|
+
slug: string;
|
|
12
|
+
status: string | null;
|
|
13
|
+
date: string | null;
|
|
14
|
+
summary: string | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface WishListResponse {
|
|
18
|
+
wishes: WishEntry[];
|
|
19
|
+
error?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface WishGroup {
|
|
23
|
+
group: number | string;
|
|
24
|
+
status: string;
|
|
25
|
+
assignee: string | null;
|
|
26
|
+
started: string | null;
|
|
27
|
+
completed: string | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface WishStatusResponse {
|
|
31
|
+
groups: WishGroup[];
|
|
32
|
+
summary: string;
|
|
33
|
+
error?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface ActionResponse {
|
|
37
|
+
ok?: boolean;
|
|
38
|
+
error?: string;
|
|
39
|
+
output?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// --- Status badge config ---
|
|
43
|
+
|
|
44
|
+
const STATUS_BADGE: Record<string, { bg: string; text: string }> = {
|
|
45
|
+
draft: { bg: 'bg-gray-500/20', text: 'text-gray-400' },
|
|
46
|
+
ready: { bg: 'bg-blue-500/20', text: 'text-blue-400' },
|
|
47
|
+
ship: { bg: 'bg-green-500/20', text: 'text-green-400' },
|
|
48
|
+
shipped: { bg: 'bg-green-500/20', text: 'text-green-400' },
|
|
49
|
+
in_progress: { bg: 'bg-yellow-500/20', text: 'text-yellow-400' },
|
|
50
|
+
blocked: { bg: 'bg-red-500/20', text: 'text-red-400' },
|
|
51
|
+
done: { bg: 'bg-green-500/20', text: 'text-green-400' },
|
|
52
|
+
failed: { bg: 'bg-red-500/20', text: 'text-red-400' },
|
|
53
|
+
pending: { bg: 'bg-gray-500/20', text: 'text-gray-400' },
|
|
54
|
+
review: { bg: 'bg-purple-500/20', text: 'text-purple-400' },
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
function getStatusBadge(status: string | null) {
|
|
58
|
+
const key = (status ?? 'draft').toLowerCase();
|
|
59
|
+
return STATUS_BADGE[key] ?? STATUS_BADGE.draft;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// --- Progress bar helpers ---
|
|
63
|
+
|
|
64
|
+
const STATUS_TO_BUCKET: Record<string, string> = {
|
|
65
|
+
done: 'done',
|
|
66
|
+
in_progress: 'in_progress',
|
|
67
|
+
ready: 'ready',
|
|
68
|
+
pending: 'ready',
|
|
69
|
+
blocked: 'blocked',
|
|
70
|
+
failed: 'blocked',
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const PROGRESS_SEGMENTS = [
|
|
74
|
+
{ key: 'done', barClass: 'bg-green-500', labelClass: 'text-green-400', label: 'done' },
|
|
75
|
+
{ key: 'in_progress', barClass: 'bg-yellow-500', labelClass: 'text-yellow-400', label: 'in progress' },
|
|
76
|
+
{ key: 'ready', barClass: 'bg-blue-500', labelClass: 'text-blue-400', label: 'ready' },
|
|
77
|
+
{ key: 'blocked', barClass: 'bg-red-500', labelClass: 'text-red-400', label: 'blocked' },
|
|
78
|
+
{ key: 'other', barClass: 'bg-gray-500', labelClass: 'text-gray-400', label: 'other' },
|
|
79
|
+
] as const;
|
|
80
|
+
|
|
81
|
+
function countByBucket(groups: WishGroup[]): Record<string, number> {
|
|
82
|
+
const counts: Record<string, number> = { done: 0, in_progress: 0, ready: 0, blocked: 0, other: 0 };
|
|
83
|
+
for (const g of groups) {
|
|
84
|
+
const bucket = STATUS_TO_BUCKET[g.status.toLowerCase()] ?? 'other';
|
|
85
|
+
counts[bucket]++;
|
|
86
|
+
}
|
|
87
|
+
return counts;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// --- Progress bar component ---
|
|
91
|
+
|
|
92
|
+
function GroupProgressBar({ groups }: { groups: WishGroup[] }) {
|
|
93
|
+
const total = groups.length;
|
|
94
|
+
if (total === 0) return null;
|
|
95
|
+
|
|
96
|
+
const counts = countByBucket(groups);
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<div className="flex flex-col gap-1">
|
|
100
|
+
<div className="flex h-2 rounded-full overflow-hidden bg-white/5">
|
|
101
|
+
{PROGRESS_SEGMENTS.map(
|
|
102
|
+
(seg) =>
|
|
103
|
+
counts[seg.key] > 0 && (
|
|
104
|
+
<div
|
|
105
|
+
key={seg.key}
|
|
106
|
+
className={`${seg.barClass} transition-all`}
|
|
107
|
+
style={{ width: `${(counts[seg.key] / total) * 100}%` }}
|
|
108
|
+
/>
|
|
109
|
+
)
|
|
110
|
+
)}
|
|
111
|
+
</div>
|
|
112
|
+
<div className="flex gap-2 text-[10px] text-[var(--os-text-secondary)]">
|
|
113
|
+
{PROGRESS_SEGMENTS.map(
|
|
114
|
+
(seg) =>
|
|
115
|
+
counts[seg.key] > 0 && (
|
|
116
|
+
<span key={seg.key} className={seg.labelClass}>
|
|
117
|
+
{counts[seg.key]} {seg.label}
|
|
118
|
+
</span>
|
|
119
|
+
)
|
|
120
|
+
)}
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// --- Group row component ---
|
|
127
|
+
|
|
128
|
+
function GroupRow({
|
|
129
|
+
group,
|
|
130
|
+
wishSlug,
|
|
131
|
+
onDone,
|
|
132
|
+
onReset,
|
|
133
|
+
actionLoading,
|
|
134
|
+
}: {
|
|
135
|
+
group: WishGroup;
|
|
136
|
+
wishSlug: string;
|
|
137
|
+
onDone: (ref: string) => void;
|
|
138
|
+
onReset: (ref: string) => void;
|
|
139
|
+
actionLoading: boolean;
|
|
140
|
+
}) {
|
|
141
|
+
const badge = getStatusBadge(group.status);
|
|
142
|
+
const ref = `${wishSlug}#${group.group}`;
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<div className="flex items-center gap-2 py-1.5 px-2 rounded hover:bg-white/5 group/row">
|
|
146
|
+
<span className="text-xs font-mono text-[var(--os-text-secondary)] w-8 shrink-0">#{String(group.group)}</span>
|
|
147
|
+
<span className={`text-[10px] px-1.5 py-0.5 rounded ${badge.bg} ${badge.text} shrink-0`}>{group.status}</span>
|
|
148
|
+
<span className="text-xs text-[var(--os-text-secondary)] truncate flex-1">{group.assignee ?? '—'}</span>
|
|
149
|
+
{group.started && (
|
|
150
|
+
<span className="text-[10px] text-[var(--os-text-secondary)] shrink-0 hidden sm:inline">{group.started}</span>
|
|
151
|
+
)}
|
|
152
|
+
<div className="flex gap-1 opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0">
|
|
153
|
+
{group.status !== 'done' && (
|
|
154
|
+
<button
|
|
155
|
+
type="button"
|
|
156
|
+
onClick={() => onDone(ref)}
|
|
157
|
+
disabled={actionLoading}
|
|
158
|
+
className="rounded px-1.5 py-0.5 text-[10px] bg-green-500/20 text-green-400 hover:bg-green-500/30 disabled:opacity-50"
|
|
159
|
+
>
|
|
160
|
+
Done
|
|
161
|
+
</button>
|
|
162
|
+
)}
|
|
163
|
+
<button
|
|
164
|
+
type="button"
|
|
165
|
+
onClick={() => onReset(ref)}
|
|
166
|
+
disabled={actionLoading}
|
|
167
|
+
className="rounded px-1.5 py-0.5 text-[10px] bg-white/10 text-[var(--os-text-secondary)] hover:bg-white/20 disabled:opacity-50"
|
|
168
|
+
>
|
|
169
|
+
Reset
|
|
170
|
+
</button>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// --- Expanded wish detail ---
|
|
177
|
+
|
|
178
|
+
function WishDetail({
|
|
179
|
+
slug,
|
|
180
|
+
onDone,
|
|
181
|
+
onReset,
|
|
182
|
+
actionLoading,
|
|
183
|
+
}: {
|
|
184
|
+
slug: string;
|
|
185
|
+
onDone: (ref: string) => void;
|
|
186
|
+
onReset: (ref: string) => void;
|
|
187
|
+
actionLoading: boolean;
|
|
188
|
+
}) {
|
|
189
|
+
const { data, loading, error } = useNatsRequest<WishStatusResponse>(SUBJECTS.wish.status(), { slug }, 10000);
|
|
190
|
+
|
|
191
|
+
if (loading) {
|
|
192
|
+
return <p className="text-xs text-[var(--os-text-secondary)] px-2 py-1">Loading groups...</p>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (error) {
|
|
196
|
+
return <p className="text-xs text-red-400 px-2 py-1">{error}</p>;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (data?.error) {
|
|
200
|
+
return <p className="text-xs text-red-400 px-2 py-1">{data.error}</p>;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (!data?.groups || data.groups.length === 0) {
|
|
204
|
+
return <p className="text-xs text-[var(--os-text-secondary)] px-2 py-1">No groups found</p>;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return (
|
|
208
|
+
<div className="flex flex-col gap-1 pt-1">
|
|
209
|
+
<GroupProgressBar groups={data.groups} />
|
|
210
|
+
<div className="flex flex-col mt-1">
|
|
211
|
+
{data.groups.map((g) => (
|
|
212
|
+
<GroupRow
|
|
213
|
+
key={String(g.group)}
|
|
214
|
+
group={g}
|
|
215
|
+
wishSlug={slug}
|
|
216
|
+
onDone={onDone}
|
|
217
|
+
onReset={onReset}
|
|
218
|
+
actionLoading={actionLoading}
|
|
219
|
+
/>
|
|
220
|
+
))}
|
|
221
|
+
</div>
|
|
222
|
+
{data.summary && (
|
|
223
|
+
<p className="text-[10px] text-[var(--os-text-secondary)] px-2 mt-1 border-t border-white/10 pt-1">
|
|
224
|
+
{data.summary}
|
|
225
|
+
</p>
|
|
226
|
+
)}
|
|
227
|
+
</div>
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// --- Main panel ---
|
|
232
|
+
|
|
233
|
+
export function WishesPanel() {
|
|
234
|
+
const { data, loading, error, refetch } = useNatsRequest<WishListResponse>(SUBJECTS.wish.list(), undefined, 5000);
|
|
235
|
+
|
|
236
|
+
const { execute: execWork, loading: workLoading } = useNatsAction<ActionResponse>(SUBJECTS.wish.work());
|
|
237
|
+
const { execute: execDone, loading: doneLoading } = useNatsAction<ActionResponse>(SUBJECTS.wish.done());
|
|
238
|
+
const { execute: execReset, loading: resetLoading } = useNatsAction<ActionResponse>(SUBJECTS.wish.reset());
|
|
239
|
+
|
|
240
|
+
const [expandedSlug, setExpandedSlug] = useState<string | null>(null);
|
|
241
|
+
const [actionFeedback, setActionFeedback] = useState<{ type: 'ok' | 'error'; msg: string } | null>(null);
|
|
242
|
+
|
|
243
|
+
const actionLoading = workLoading || doneLoading || resetLoading;
|
|
244
|
+
|
|
245
|
+
const showFeedback = useCallback((type: 'ok' | 'error', msg: string) => {
|
|
246
|
+
setActionFeedback({ type, msg });
|
|
247
|
+
setTimeout(() => setActionFeedback(null), 3000);
|
|
248
|
+
}, []);
|
|
249
|
+
|
|
250
|
+
const handleWork = useCallback(
|
|
251
|
+
async (ref: string) => {
|
|
252
|
+
try {
|
|
253
|
+
const res = await execWork({ ref });
|
|
254
|
+
if (res?.ok) {
|
|
255
|
+
showFeedback('ok', `Work started: ${ref}`);
|
|
256
|
+
refetch();
|
|
257
|
+
} else {
|
|
258
|
+
showFeedback('error', res?.error ?? 'Work failed');
|
|
259
|
+
}
|
|
260
|
+
} catch {
|
|
261
|
+
showFeedback('error', 'Failed to start work');
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
[execWork, refetch, showFeedback]
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
const handleDone = useCallback(
|
|
268
|
+
async (ref: string) => {
|
|
269
|
+
try {
|
|
270
|
+
const res = await execDone({ ref });
|
|
271
|
+
if (res?.ok) {
|
|
272
|
+
showFeedback('ok', `Marked done: ${ref}`);
|
|
273
|
+
refetch();
|
|
274
|
+
} else {
|
|
275
|
+
showFeedback('error', res?.error ?? 'Failed to mark done');
|
|
276
|
+
}
|
|
277
|
+
} catch {
|
|
278
|
+
showFeedback('error', 'Failed to mark done');
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
[execDone, refetch, showFeedback]
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
const handleReset = useCallback(
|
|
285
|
+
async (ref: string) => {
|
|
286
|
+
try {
|
|
287
|
+
const res = await execReset({ ref });
|
|
288
|
+
if (res?.ok) {
|
|
289
|
+
showFeedback('ok', `Reset: ${ref}`);
|
|
290
|
+
refetch();
|
|
291
|
+
} else {
|
|
292
|
+
showFeedback('error', res?.error ?? 'Reset failed');
|
|
293
|
+
}
|
|
294
|
+
} catch {
|
|
295
|
+
showFeedback('error', 'Failed to reset');
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
[execReset, refetch, showFeedback]
|
|
299
|
+
);
|
|
300
|
+
|
|
301
|
+
const toggleExpand = useCallback((slug: string) => {
|
|
302
|
+
setExpandedSlug((prev) => (prev === slug ? null : slug));
|
|
303
|
+
}, []);
|
|
304
|
+
|
|
305
|
+
const wishes = data?.wishes ?? [];
|
|
306
|
+
|
|
307
|
+
return (
|
|
308
|
+
<div className="flex flex-col gap-2 p-3">
|
|
309
|
+
{/* Header */}
|
|
310
|
+
<div className="flex items-center justify-between">
|
|
311
|
+
<h3 className="text-xs font-semibold text-[var(--os-text-secondary)]">
|
|
312
|
+
Wishes{wishes.length > 0 ? ` (${wishes.length})` : ''}
|
|
313
|
+
</h3>
|
|
314
|
+
<button
|
|
315
|
+
type="button"
|
|
316
|
+
onClick={refetch}
|
|
317
|
+
disabled={loading}
|
|
318
|
+
className="rounded px-2 py-0.5 text-xs bg-white/10 text-[var(--os-text-secondary)] hover:bg-white/20 hover:text-[var(--os-text-primary)] disabled:opacity-50 transition-colors"
|
|
319
|
+
>
|
|
320
|
+
{loading ? 'Loading...' : 'Refresh'}
|
|
321
|
+
</button>
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
{/* Action feedback toast */}
|
|
325
|
+
{actionFeedback && (
|
|
326
|
+
<div
|
|
327
|
+
className={`rounded px-2 py-1 text-xs ${
|
|
328
|
+
actionFeedback.type === 'ok' ? 'bg-green-500/20 text-green-400' : 'bg-red-500/20 text-red-400'
|
|
329
|
+
}`}
|
|
330
|
+
>
|
|
331
|
+
{actionFeedback.msg}
|
|
332
|
+
</div>
|
|
333
|
+
)}
|
|
334
|
+
|
|
335
|
+
{/* Loading state */}
|
|
336
|
+
{loading && wishes.length === 0 && <p className="text-xs text-[var(--os-text-secondary)]">Loading wishes...</p>}
|
|
337
|
+
|
|
338
|
+
{/* Error state */}
|
|
339
|
+
{error && <p className="text-xs text-red-400">{error}</p>}
|
|
340
|
+
|
|
341
|
+
{/* Service-level error */}
|
|
342
|
+
{data?.error && <p className="text-xs text-red-400">{data.error}</p>}
|
|
343
|
+
|
|
344
|
+
{/* Empty state */}
|
|
345
|
+
{!loading && !error && wishes.length === 0 && (
|
|
346
|
+
<div className="rounded-md bg-white/5 p-4 text-center">
|
|
347
|
+
<p className="text-xs text-[var(--os-text-secondary)]">No wishes found</p>
|
|
348
|
+
</div>
|
|
349
|
+
)}
|
|
350
|
+
|
|
351
|
+
{/* Wish list */}
|
|
352
|
+
{wishes.map((wish) => {
|
|
353
|
+
const badge = getStatusBadge(wish.status);
|
|
354
|
+
const isExpanded = expandedSlug === wish.slug;
|
|
355
|
+
|
|
356
|
+
return (
|
|
357
|
+
<div key={wish.slug} className="rounded-md bg-white/5 overflow-hidden">
|
|
358
|
+
{/* Wish row header */}
|
|
359
|
+
<button
|
|
360
|
+
type="button"
|
|
361
|
+
onClick={() => toggleExpand(wish.slug)}
|
|
362
|
+
className="w-full flex items-center gap-2 p-2.5 text-left hover:bg-white/5 transition-colors group/wish"
|
|
363
|
+
>
|
|
364
|
+
{/* Expand indicator */}
|
|
365
|
+
<span
|
|
366
|
+
className="text-[10px] text-[var(--os-text-secondary)] w-3 shrink-0 transition-transform"
|
|
367
|
+
style={{ transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)' }}
|
|
368
|
+
>
|
|
369
|
+
▶
|
|
370
|
+
</span>
|
|
371
|
+
|
|
372
|
+
{/* Slug */}
|
|
373
|
+
<span className="text-xs font-mono text-[var(--os-text-primary)] truncate flex-1 min-w-0">
|
|
374
|
+
{wish.slug}
|
|
375
|
+
</span>
|
|
376
|
+
|
|
377
|
+
{/* Status badge */}
|
|
378
|
+
<span className={`text-[10px] px-1.5 py-0.5 rounded ${badge.bg} ${badge.text} shrink-0`}>
|
|
379
|
+
{wish.status ?? 'DRAFT'}
|
|
380
|
+
</span>
|
|
381
|
+
</button>
|
|
382
|
+
|
|
383
|
+
{/* Summary and date */}
|
|
384
|
+
{(wish.summary || wish.date) && (
|
|
385
|
+
<div className="px-2.5 pb-1.5 -mt-1">
|
|
386
|
+
{wish.date && <span className="text-[10px] text-[var(--os-text-secondary)]">{wish.date}</span>}
|
|
387
|
+
{wish.summary && (
|
|
388
|
+
<p className="text-[10px] text-[var(--os-text-secondary)] line-clamp-2 mt-0.5">{wish.summary}</p>
|
|
389
|
+
)}
|
|
390
|
+
</div>
|
|
391
|
+
)}
|
|
392
|
+
|
|
393
|
+
{/* Action buttons */}
|
|
394
|
+
<div className="flex gap-1 px-2.5 pb-2">
|
|
395
|
+
<button
|
|
396
|
+
type="button"
|
|
397
|
+
onClick={() => handleWork(wish.slug)}
|
|
398
|
+
disabled={actionLoading}
|
|
399
|
+
className="rounded px-2 py-0.5 text-[10px] bg-blue-500/20 text-blue-400 hover:bg-blue-500/30 disabled:opacity-50 transition-colors"
|
|
400
|
+
>
|
|
401
|
+
Work
|
|
402
|
+
</button>
|
|
403
|
+
<button
|
|
404
|
+
type="button"
|
|
405
|
+
onClick={() => handleReset(wish.slug)}
|
|
406
|
+
disabled={actionLoading}
|
|
407
|
+
className="rounded px-2 py-0.5 text-[10px] bg-white/10 text-[var(--os-text-secondary)] hover:bg-white/20 disabled:opacity-50 transition-colors"
|
|
408
|
+
>
|
|
409
|
+
Reset
|
|
410
|
+
</button>
|
|
411
|
+
</div>
|
|
412
|
+
|
|
413
|
+
{/* Expanded group detail */}
|
|
414
|
+
{isExpanded && (
|
|
415
|
+
<div className="border-t border-white/10 px-2 py-2">
|
|
416
|
+
<WishDetail slug={wish.slug} onDone={handleDone} onReset={handleReset} actionLoading={actionLoading} />
|
|
417
|
+
</div>
|
|
418
|
+
)}
|
|
419
|
+
</div>
|
|
420
|
+
);
|
|
421
|
+
})}
|
|
422
|
+
</div>
|
|
423
|
+
);
|
|
424
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { type ComponentType, lazy } from 'react';
|
|
4
|
+
|
|
5
|
+
interface AppComponentProps {
|
|
6
|
+
windowId: string;
|
|
7
|
+
meta?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const components: Record<string, ComponentType<AppComponentProps>> = {
|
|
11
|
+
'nats-viewer': lazy(() => import('./views/nats-viewer/NatsViewer').then((m) => ({ default: m.NatsViewer }))),
|
|
12
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
id: 'nats-viewer-app',
|
|
3
|
+
views: [
|
|
4
|
+
{
|
|
5
|
+
id: 'nats-viewer',
|
|
6
|
+
label: 'NATS Viewer',
|
|
7
|
+
permission: 'nats-viewer',
|
|
8
|
+
minRole: 'platform-dev' as const,
|
|
9
|
+
defaultSize: { width: 900, height: 600 },
|
|
10
|
+
component: './views/nats-viewer/NatsViewer',
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
desktop: {
|
|
14
|
+
icon: '/icons/dusk/activity_monitor.svg',
|
|
15
|
+
categories: ['Development'],
|
|
16
|
+
comment: 'NATS message viewer and debugger',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@genie-os/nats-viewer-app",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"main": "./manifest.ts",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./manifest.ts",
|
|
8
|
+
"./components": "./components.ts",
|
|
9
|
+
"./views/*": "./views/*"
|
|
10
|
+
},
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"react": ">=19"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { X } from 'lucide-react';
|
|
4
|
+
import { useNatsViewer } from './nats-viewer-context';
|
|
5
|
+
|
|
6
|
+
export function ActiveSubs() {
|
|
7
|
+
const { subscriptions, removeSubscription } = useNatsViewer();
|
|
8
|
+
const subjects = Array.from(subscriptions).sort();
|
|
9
|
+
|
|
10
|
+
if (subjects.length === 0) {
|
|
11
|
+
return <p className="px-1 text-[11px] italic text-gray-700">No active subscriptions</p>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className="flex flex-col gap-0.5">
|
|
16
|
+
{subjects.map((subject) => (
|
|
17
|
+
<div
|
|
18
|
+
key={subject}
|
|
19
|
+
className="group flex items-center gap-1.5 rounded px-1.5 py-0.5 transition-colors hover:bg-gray-alpha-100"
|
|
20
|
+
>
|
|
21
|
+
<span className="inline-block h-2 w-2 shrink-0 rounded-full bg-green-500" />
|
|
22
|
+
<span className="min-w-0 flex-1 truncate font-mono text-xs text-gray-900">{subject}</span>
|
|
23
|
+
<button
|
|
24
|
+
onClick={() => removeSubscription(subject)}
|
|
25
|
+
className="shrink-0 rounded p-0.5 text-gray-600 opacity-0 transition-all hover:bg-red-100 hover:text-red-600 group-hover:opacity-100"
|
|
26
|
+
aria-label={`Unsubscribe from ${subject}`}
|
|
27
|
+
>
|
|
28
|
+
<X className="h-3 w-3" />
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
))}
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|