@gokulvenkatareddy/cortex 0.1.7
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 +1295 -0
- package/apps/octogent/.github/workflows/ci.yml +40 -0
- package/apps/octogent/.shims/claude +4 -0
- package/apps/octogent/AGENTS.md +71 -0
- package/apps/octogent/CONTRIBUTING.md +72 -0
- package/apps/octogent/LICENSE +21 -0
- package/apps/octogent/README.md +184 -0
- package/apps/octogent/apps/api/AGENTS.md +32 -0
- package/apps/octogent/apps/api/package.json +19 -0
- package/apps/octogent/apps/api/src/agentStateDetection.ts +181 -0
- package/apps/octogent/apps/api/src/claudeSessionScanner.ts +235 -0
- package/apps/octogent/apps/api/src/claudeSkills.ts +182 -0
- package/apps/octogent/apps/api/src/claudeUsage.ts +922 -0
- package/apps/octogent/apps/api/src/cli.ts +595 -0
- package/apps/octogent/apps/api/src/codeIntelStore.ts +46 -0
- package/apps/octogent/apps/api/src/codexUsage.ts +278 -0
- package/apps/octogent/apps/api/src/createApiServer/codeIntelRoutes.ts +60 -0
- package/apps/octogent/apps/api/src/createApiServer/conversationRoutes.ts +128 -0
- package/apps/octogent/apps/api/src/createApiServer/deckRoutes.ts +873 -0
- package/apps/octogent/apps/api/src/createApiServer/gitParsers.ts +140 -0
- package/apps/octogent/apps/api/src/createApiServer/gitRoutes.ts +214 -0
- package/apps/octogent/apps/api/src/createApiServer/miscRoutes.ts +316 -0
- package/apps/octogent/apps/api/src/createApiServer/monitorParsers.ts +137 -0
- package/apps/octogent/apps/api/src/createApiServer/monitorRoutes.ts +95 -0
- package/apps/octogent/apps/api/src/createApiServer/requestHandler.ts +311 -0
- package/apps/octogent/apps/api/src/createApiServer/requestParsers.ts +25 -0
- package/apps/octogent/apps/api/src/createApiServer/routeHelpers.ts +97 -0
- package/apps/octogent/apps/api/src/createApiServer/security.ts +70 -0
- package/apps/octogent/apps/api/src/createApiServer/terminalParsers.ts +167 -0
- package/apps/octogent/apps/api/src/createApiServer/terminalRoutes.ts +315 -0
- package/apps/octogent/apps/api/src/createApiServer/types.ts +24 -0
- package/apps/octogent/apps/api/src/createApiServer/uiStateParsers.ts +255 -0
- package/apps/octogent/apps/api/src/createApiServer/upgradeHandler.ts +38 -0
- package/apps/octogent/apps/api/src/createApiServer/usageRoutes.ts +84 -0
- package/apps/octogent/apps/api/src/createApiServer.ts +176 -0
- package/apps/octogent/apps/api/src/deck/readDeckTentacles.ts +595 -0
- package/apps/octogent/apps/api/src/githubRepoSummary.ts +397 -0
- package/apps/octogent/apps/api/src/logging.ts +9 -0
- package/apps/octogent/apps/api/src/monitor/defaults.ts +3 -0
- package/apps/octogent/apps/api/src/monitor/index.ts +8 -0
- package/apps/octogent/apps/api/src/monitor/repository.ts +303 -0
- package/apps/octogent/apps/api/src/monitor/service.ts +349 -0
- package/apps/octogent/apps/api/src/monitor/types.ts +120 -0
- package/apps/octogent/apps/api/src/monitor/xProvider.ts +587 -0
- package/apps/octogent/apps/api/src/projectPersistence.ts +377 -0
- package/apps/octogent/apps/api/src/prompts/index.ts +10 -0
- package/apps/octogent/apps/api/src/prompts/promptResolver.ts +145 -0
- package/apps/octogent/apps/api/src/runtimeMetadata.ts +69 -0
- package/apps/octogent/apps/api/src/server.ts +80 -0
- package/apps/octogent/apps/api/src/setupState.ts +80 -0
- package/apps/octogent/apps/api/src/setupStatus.ts +174 -0
- package/apps/octogent/apps/api/src/startupPrerequisites.ts +146 -0
- package/apps/octogent/apps/api/src/terminalRuntime/channelMessaging.ts +87 -0
- package/apps/octogent/apps/api/src/terminalRuntime/claudeTranscript.ts +279 -0
- package/apps/octogent/apps/api/src/terminalRuntime/constants.ts +15 -0
- package/apps/octogent/apps/api/src/terminalRuntime/conversations.ts +492 -0
- package/apps/octogent/apps/api/src/terminalRuntime/gitOperations.ts +341 -0
- package/apps/octogent/apps/api/src/terminalRuntime/hookProcessor.ts +405 -0
- package/apps/octogent/apps/api/src/terminalRuntime/protocol.ts +46 -0
- package/apps/octogent/apps/api/src/terminalRuntime/ptyEnvironment.ts +50 -0
- package/apps/octogent/apps/api/src/terminalRuntime/registry.ts +423 -0
- package/apps/octogent/apps/api/src/terminalRuntime/sessionRuntime.ts +671 -0
- package/apps/octogent/apps/api/src/terminalRuntime/systemClients.ts +432 -0
- package/apps/octogent/apps/api/src/terminalRuntime/types.ts +157 -0
- package/apps/octogent/apps/api/src/terminalRuntime/worktreeManager.ts +135 -0
- package/apps/octogent/apps/api/src/terminalRuntime.ts +567 -0
- package/apps/octogent/apps/api/src/usageUtils.ts +16 -0
- package/apps/octogent/apps/api/src/ws-shim.d.ts +28 -0
- package/apps/octogent/apps/api/tests/agentStateDetection.test.ts +67 -0
- package/apps/octogent/apps/api/tests/claudeUsage.test.ts +583 -0
- package/apps/octogent/apps/api/tests/codexUsage.test.ts +107 -0
- package/apps/octogent/apps/api/tests/createApiServer.test.ts +3207 -0
- package/apps/octogent/apps/api/tests/githubRepoSummary.test.ts +100 -0
- package/apps/octogent/apps/api/tests/logging.test.ts +33 -0
- package/apps/octogent/apps/api/tests/monitorApi.test.ts +467 -0
- package/apps/octogent/apps/api/tests/monitorCore.test.ts +104 -0
- package/apps/octogent/apps/api/tests/promptResolver.test.ts +109 -0
- package/apps/octogent/apps/api/tests/protocol.test.ts +14 -0
- package/apps/octogent/apps/api/tests/sessionRuntime.test.ts +608 -0
- package/apps/octogent/apps/api/tests/startupPrerequisites.test.ts +70 -0
- package/apps/octogent/apps/api/tests/upgradeHandler.test.ts +40 -0
- package/apps/octogent/apps/api/tests/xMonitorProvider.test.ts +109 -0
- package/apps/octogent/apps/api/tsconfig.json +7 -0
- package/apps/octogent/apps/api/vitest.config.ts +7 -0
- package/apps/octogent/apps/web/AGENTS.md +38 -0
- package/apps/octogent/apps/web/index.html +13 -0
- package/apps/octogent/apps/web/package.json +32 -0
- package/apps/octogent/apps/web/public/octopus-favicon.svg +26 -0
- package/apps/octogent/apps/web/src/App.tsx +646 -0
- package/apps/octogent/apps/web/src/app/canvas/types.ts +34 -0
- package/apps/octogent/apps/web/src/app/codeIntelAggregation.ts +278 -0
- package/apps/octogent/apps/web/src/app/constants.ts +28 -0
- package/apps/octogent/apps/web/src/app/conversationNormalizers.ts +135 -0
- package/apps/octogent/apps/web/src/app/formatTimestamp.ts +18 -0
- package/apps/octogent/apps/web/src/app/githubMetrics.ts +76 -0
- package/apps/octogent/apps/web/src/app/githubNormalizers.ts +91 -0
- package/apps/octogent/apps/web/src/app/hooks/useAgentRuntimeStates.ts +18 -0
- package/apps/octogent/apps/web/src/app/hooks/useBackendLivenessPolling.ts +53 -0
- package/apps/octogent/apps/web/src/app/hooks/useCanvasGraphData.ts +449 -0
- package/apps/octogent/apps/web/src/app/hooks/useCanvasTransform.ts +260 -0
- package/apps/octogent/apps/web/src/app/hooks/useClaudeUsagePolling.ts +40 -0
- package/apps/octogent/apps/web/src/app/hooks/useClickOutside.ts +30 -0
- package/apps/octogent/apps/web/src/app/hooks/useCodeIntelRuntime.ts +83 -0
- package/apps/octogent/apps/web/src/app/hooks/useCodexUsagePolling.ts +35 -0
- package/apps/octogent/apps/web/src/app/hooks/useConsoleKeyboardShortcuts.ts +31 -0
- package/apps/octogent/apps/web/src/app/hooks/useConversationsRuntime.ts +377 -0
- package/apps/octogent/apps/web/src/app/hooks/useForceSimulation.ts +319 -0
- package/apps/octogent/apps/web/src/app/hooks/useGitHubPrimaryViewModel.ts +143 -0
- package/apps/octogent/apps/web/src/app/hooks/useGithubSummaryPolling.ts +28 -0
- package/apps/octogent/apps/web/src/app/hooks/useInitialColumnsHydration.ts +64 -0
- package/apps/octogent/apps/web/src/app/hooks/useMonitorRuntime.ts +220 -0
- package/apps/octogent/apps/web/src/app/hooks/usePersistedUiState.ts +536 -0
- package/apps/octogent/apps/web/src/app/hooks/usePollingData.ts +79 -0
- package/apps/octogent/apps/web/src/app/hooks/usePromptLibrary.ts +185 -0
- package/apps/octogent/apps/web/src/app/hooks/useTentacleGitLifecycle.ts +530 -0
- package/apps/octogent/apps/web/src/app/hooks/useTerminalCompletionNotification.ts +94 -0
- package/apps/octogent/apps/web/src/app/hooks/useTerminalMutations.ts +266 -0
- package/apps/octogent/apps/web/src/app/hooks/useTerminalStateReconciliation.ts +23 -0
- package/apps/octogent/apps/web/src/app/hooks/useUsageHeatmapPolling.ts +43 -0
- package/apps/octogent/apps/web/src/app/hooks/useWorkspaceSetup.ts +80 -0
- package/apps/octogent/apps/web/src/app/hotkeys.ts +31 -0
- package/apps/octogent/apps/web/src/app/monitorNormalizers.ts +145 -0
- package/apps/octogent/apps/web/src/app/notificationSounds.ts +164 -0
- package/apps/octogent/apps/web/src/app/terminalRuntimeStateStore.ts +261 -0
- package/apps/octogent/apps/web/src/app/terminalState.ts +21 -0
- package/apps/octogent/apps/web/src/app/types.ts +42 -0
- package/apps/octogent/apps/web/src/app/uiStateNormalizers.ts +113 -0
- package/apps/octogent/apps/web/src/app/usageNormalizers.ts +58 -0
- package/apps/octogent/apps/web/src/components/ActiveAgentsSidebar.tsx +60 -0
- package/apps/octogent/apps/web/src/components/ActivityPrimaryView.tsx +21 -0
- package/apps/octogent/apps/web/src/components/AgentStateBadge.tsx +47 -0
- package/apps/octogent/apps/web/src/components/CanvasPrimaryView.tsx +1532 -0
- package/apps/octogent/apps/web/src/components/ClearAllConversationsDialog.tsx +33 -0
- package/apps/octogent/apps/web/src/components/CodeIntelArcDiagram.tsx +245 -0
- package/apps/octogent/apps/web/src/components/CodeIntelPrimaryView.tsx +104 -0
- package/apps/octogent/apps/web/src/components/CodeIntelTreemap.tsx +138 -0
- package/apps/octogent/apps/web/src/components/ConsolePrimaryNav.tsx +31 -0
- package/apps/octogent/apps/web/src/components/ConversationsPrimaryView.tsx +243 -0
- package/apps/octogent/apps/web/src/components/DeckPrimaryView.tsx +613 -0
- package/apps/octogent/apps/web/src/components/DeleteTentacleDialog.tsx +91 -0
- package/apps/octogent/apps/web/src/components/EmptyOctopus.tsx +715 -0
- package/apps/octogent/apps/web/src/components/GitHubPrimaryView.tsx +494 -0
- package/apps/octogent/apps/web/src/components/MonitorPrimaryView.tsx +475 -0
- package/apps/octogent/apps/web/src/components/PrimaryViewRouter.tsx +99 -0
- package/apps/octogent/apps/web/src/components/PromptsPrimaryView.tsx +243 -0
- package/apps/octogent/apps/web/src/components/RuntimeStatusStrip.tsx +273 -0
- package/apps/octogent/apps/web/src/components/SettingsPrimaryView.tsx +92 -0
- package/apps/octogent/apps/web/src/components/SidebarActionPanel.tsx +124 -0
- package/apps/octogent/apps/web/src/components/SidebarConversationsList.tsx +279 -0
- package/apps/octogent/apps/web/src/components/SidebarPromptsList.tsx +116 -0
- package/apps/octogent/apps/web/src/components/TelemetryTape.tsx +106 -0
- package/apps/octogent/apps/web/src/components/TentacleGitActionsDialog.tsx +341 -0
- package/apps/octogent/apps/web/src/components/Terminal.tsx +524 -0
- package/apps/octogent/apps/web/src/components/TerminalPromptPicker.tsx +140 -0
- package/apps/octogent/apps/web/src/components/UsageHeatmap.tsx +702 -0
- package/apps/octogent/apps/web/src/components/canvas/CanvasTentaclePanel.tsx +485 -0
- package/apps/octogent/apps/web/src/components/canvas/CanvasTerminalColumn.tsx +89 -0
- package/apps/octogent/apps/web/src/components/canvas/DeleteAllTerminalsDialog.tsx +221 -0
- package/apps/octogent/apps/web/src/components/canvas/OctopusNode.tsx +307 -0
- package/apps/octogent/apps/web/src/components/canvas/SessionNode.tsx +185 -0
- package/apps/octogent/apps/web/src/components/deck/ActionCards.tsx +118 -0
- package/apps/octogent/apps/web/src/components/deck/AddTentacleForm.tsx +269 -0
- package/apps/octogent/apps/web/src/components/deck/DeckBottomActions.tsx +56 -0
- package/apps/octogent/apps/web/src/components/deck/TentaclePod.tsx +334 -0
- package/apps/octogent/apps/web/src/components/deck/WorkspaceSetupCard.tsx +105 -0
- package/apps/octogent/apps/web/src/components/deck/octopusVisuals.ts +72 -0
- package/apps/octogent/apps/web/src/components/terminalReplay.ts +62 -0
- package/apps/octogent/apps/web/src/components/terminalWheel.ts +54 -0
- package/apps/octogent/apps/web/src/components/ui/ActionButton.tsx +34 -0
- package/apps/octogent/apps/web/src/components/ui/ConfirmationDialog.tsx +86 -0
- package/apps/octogent/apps/web/src/components/ui/MarkdownContent.tsx +43 -0
- package/apps/octogent/apps/web/src/components/ui/SettingsToggle.tsx +34 -0
- package/apps/octogent/apps/web/src/components/ui/StatusBadge.tsx +24 -0
- package/apps/octogent/apps/web/src/main.tsx +17 -0
- package/apps/octogent/apps/web/src/runtime/HttpTerminalSnapshotReader.ts +87 -0
- package/apps/octogent/apps/web/src/runtime/runtimeEndpoints.ts +412 -0
- package/apps/octogent/apps/web/src/styles/chrome-and-buttons.css +272 -0
- package/apps/octogent/apps/web/src/styles/console-canvas-activity.css +358 -0
- package/apps/octogent/apps/web/src/styles/console-canvas-canvas.css +1843 -0
- package/apps/octogent/apps/web/src/styles/console-canvas-code-intel.css +227 -0
- package/apps/octogent/apps/web/src/styles/console-canvas-conversations.css +705 -0
- package/apps/octogent/apps/web/src/styles/console-canvas-deck.css +1524 -0
- package/apps/octogent/apps/web/src/styles/console-canvas-github.css +541 -0
- package/apps/octogent/apps/web/src/styles/console-canvas-monitor.css +595 -0
- package/apps/octogent/apps/web/src/styles/console-canvas-pixpack.css +81 -0
- package/apps/octogent/apps/web/src/styles/console-canvas-prompts.css +474 -0
- package/apps/octogent/apps/web/src/styles/console-canvas-settings.css +207 -0
- package/apps/octogent/apps/web/src/styles/console-chrome-status-nav.css +441 -0
- package/apps/octogent/apps/web/src/styles/console-overrides-telemetry.css +320 -0
- package/apps/octogent/apps/web/src/styles/console-theme-tokens.css +25 -0
- package/apps/octogent/apps/web/src/styles/cortex-theme.css +412 -0
- package/apps/octogent/apps/web/src/styles/foundation.css +100 -0
- package/apps/octogent/apps/web/src/styles/sidebar-and-scrollbars.css +447 -0
- package/apps/octogent/apps/web/src/styles/terminal-and-status.css +356 -0
- package/apps/octogent/apps/web/src/styles.css +25 -0
- package/apps/octogent/apps/web/src/types/ws.d.ts +23 -0
- package/apps/octogent/apps/web/tests/CanvasPrimaryView.test.tsx +347 -0
- package/apps/octogent/apps/web/tests/HttpTerminalSnapshotReader.test.tsx +54 -0
- package/apps/octogent/apps/web/tests/RuntimeStatusStrip.test.tsx +70 -0
- package/apps/octogent/apps/web/tests/Terminal.test.tsx +87 -0
- package/apps/octogent/apps/web/tests/add-tentacle-form.test.tsx +48 -0
- package/apps/octogent/apps/web/tests/app-github-runtime.test.tsx +162 -0
- package/apps/octogent/apps/web/tests/app-monitor-runtime.test.tsx +657 -0
- package/apps/octogent/apps/web/tests/app-shell-navigation.test.tsx +109 -0
- package/apps/octogent/apps/web/tests/app-swarm-refresh.test.tsx +268 -0
- package/apps/octogent/apps/web/tests/app-ui-state-persistence.test.tsx +116 -0
- package/apps/octogent/apps/web/tests/app-workspace-setup.test.tsx +217 -0
- package/apps/octogent/apps/web/tests/canvas-tentacle-panel.test.tsx +195 -0
- package/apps/octogent/apps/web/tests/delete-all-terminals-dialog.test.tsx +76 -0
- package/apps/octogent/apps/web/tests/githubMetrics.test.tsx +52 -0
- package/apps/octogent/apps/web/tests/hotkeys.test.tsx +44 -0
- package/apps/octogent/apps/web/tests/runtimeEndpoints.test.tsx +240 -0
- package/apps/octogent/apps/web/tests/setup.ts +39 -0
- package/apps/octogent/apps/web/tests/tentacle-pod.test.tsx +62 -0
- package/apps/octogent/apps/web/tests/terminalReplay.test.ts +71 -0
- package/apps/octogent/apps/web/tests/terminalState.test.tsx +49 -0
- package/apps/octogent/apps/web/tests/terminalWheel.test.tsx +51 -0
- package/apps/octogent/apps/web/tests/test-utils/appTestHarness.ts +48 -0
- package/apps/octogent/apps/web/tests/uiPrimitives.test.tsx +31 -0
- package/apps/octogent/apps/web/tests/useAgentRuntimeStates.test.tsx +47 -0
- package/apps/octogent/apps/web/tsconfig.json +8 -0
- package/apps/octogent/apps/web/vite.api.bundle.config.mts +32 -0
- package/apps/octogent/apps/web/vite.config.ts +22 -0
- package/apps/octogent/bin/octogent +3 -0
- package/apps/octogent/biome.json +21 -0
- package/apps/octogent/docs/concepts/mental-model.md +79 -0
- package/apps/octogent/docs/concepts/runtime-and-api.md +60 -0
- package/apps/octogent/docs/concepts/tentacles.md +85 -0
- package/apps/octogent/docs/getting-started/installation.md +54 -0
- package/apps/octogent/docs/getting-started/quickstart.md +79 -0
- package/apps/octogent/docs/guides/inter-agent-messaging.md +43 -0
- package/apps/octogent/docs/guides/orchestrating-child-agents.md +49 -0
- package/apps/octogent/docs/guides/working-with-todos.md +56 -0
- package/apps/octogent/docs/index.md +40 -0
- package/apps/octogent/docs/reference/api.md +103 -0
- package/apps/octogent/docs/reference/cli.md +71 -0
- package/apps/octogent/docs/reference/experimental-features.md +28 -0
- package/apps/octogent/docs/reference/filesystem-layout.md +62 -0
- package/apps/octogent/docs/reference/troubleshooting.md +49 -0
- package/apps/octogent/package.json +35 -0
- package/apps/octogent/packages/core/AGENTS.md +31 -0
- package/apps/octogent/packages/core/package.json +12 -0
- package/apps/octogent/packages/core/src/adapters/InMemoryTerminalSnapshotReader.ts +10 -0
- package/apps/octogent/packages/core/src/application/buildTerminalList.ts +13 -0
- package/apps/octogent/packages/core/src/domain/agentRuntime.ts +18 -0
- package/apps/octogent/packages/core/src/domain/channel.ts +8 -0
- package/apps/octogent/packages/core/src/domain/completionSound.ts +14 -0
- package/apps/octogent/packages/core/src/domain/conversation.ts +48 -0
- package/apps/octogent/packages/core/src/domain/deck.ts +33 -0
- package/apps/octogent/packages/core/src/domain/git.ts +32 -0
- package/apps/octogent/packages/core/src/domain/monitor.ts +62 -0
- package/apps/octogent/packages/core/src/domain/setup.ts +27 -0
- package/apps/octogent/packages/core/src/domain/terminal.ts +17 -0
- package/apps/octogent/packages/core/src/domain/uiState.ts +22 -0
- package/apps/octogent/packages/core/src/domain/usage.ts +60 -0
- package/apps/octogent/packages/core/src/index.ts +15 -0
- package/apps/octogent/packages/core/src/ports/TerminalSnapshotReader.ts +5 -0
- package/apps/octogent/packages/core/src/util/typeCoercion.ts +20 -0
- package/apps/octogent/packages/core/tests/buildTerminalList.test.ts +75 -0
- package/apps/octogent/packages/core/tsconfig.json +7 -0
- package/apps/octogent/packages/core/tsconfig.tsbuildinfo +1 -0
- package/apps/octogent/packages/core/vitest.config.ts +7 -0
- package/apps/octogent/pnpm-lock.yaml +3212 -0
- package/apps/octogent/pnpm-workspace.yaml +3 -0
- package/apps/octogent/prompts/meta-prompt-generator.md +223 -0
- package/apps/octogent/prompts/octoboss-clean-contexts.md +30 -0
- package/apps/octogent/prompts/octoboss-reorganize-tentacles.md +29 -0
- package/apps/octogent/prompts/octoboss-reorganize-todos.md +27 -0
- package/apps/octogent/prompts/sandbox-init.md +3 -0
- package/apps/octogent/prompts/swarm-parent.md +83 -0
- package/apps/octogent/prompts/swarm-worker.md +50 -0
- package/apps/octogent/prompts/tentacle-context-init.md +1 -0
- package/apps/octogent/prompts/tentacle-planner.md +110 -0
- package/apps/octogent/prompts/tentacle-reorganize-todos.md +20 -0
- package/apps/octogent/prompts/tentacle-update-tentacle.md +18 -0
- package/apps/octogent/scripts/build-package.mjs +23 -0
- package/apps/octogent/scripts/dev.mjs +158 -0
- package/apps/octogent/scripts/smoke-public-install.mjs +271 -0
- package/apps/octogent/static/images/octogent-header.png +0 -0
- package/apps/octogent/static/images/preview_1.jpg +0 -0
- package/apps/octogent/static/images/preview_2.jpg +0 -0
- package/apps/octogent/static/images/preview_3.jpg +0 -0
- package/apps/octogent/static/images/preview_4.jpg +0 -0
- package/apps/octogent/static/images/preview_5.jpg +0 -0
- package/apps/octogent/static/images/preview_6.jpg +0 -0
- package/apps/octogent/tsconfig.base.json +16 -0
- package/bin/AGI +3 -0
- package/bin/AGI-install-app +71 -0
- package/bin/AGI-ui +16 -0
- package/bin/AGI-voice +15 -0
- package/bin/AGI-web +16 -0
- package/bin/cortex +109 -0
- package/bin/cortex-octogent +99 -0
- package/bin/import-specifier.mjs +13 -0
- package/bin/import-specifier.test.mjs +13 -0
- package/bin/octo +150 -0
- package/dist/cli.mjs +555650 -0
- package/package.json +157 -0
- package/scripts/setup-wizard.ts +390 -0
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
import { type TerminalSnapshot, buildTerminalList, isAgentRuntimeState } from "@octogent/core";
|
|
2
|
+
import { type ReactNode, useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
|
|
4
|
+
import { useBackendLivenessPolling } from "./app/hooks/useBackendLivenessPolling";
|
|
5
|
+
import { OCTOBOSS_ID } from "./app/hooks/useCanvasGraphData";
|
|
6
|
+
import { useClaudeUsagePolling } from "./app/hooks/useClaudeUsagePolling";
|
|
7
|
+
import { useCodexUsagePolling } from "./app/hooks/useCodexUsagePolling";
|
|
8
|
+
import { useConsoleKeyboardShortcuts } from "./app/hooks/useConsoleKeyboardShortcuts";
|
|
9
|
+
import { useGitHubPrimaryViewModel } from "./app/hooks/useGitHubPrimaryViewModel";
|
|
10
|
+
import { useGithubSummaryPolling } from "./app/hooks/useGithubSummaryPolling";
|
|
11
|
+
import { useInitialColumnsHydration } from "./app/hooks/useInitialColumnsHydration";
|
|
12
|
+
import { useMonitorRuntime } from "./app/hooks/useMonitorRuntime";
|
|
13
|
+
import { usePersistedUiState } from "./app/hooks/usePersistedUiState";
|
|
14
|
+
import { useTentacleGitLifecycle } from "./app/hooks/useTentacleGitLifecycle";
|
|
15
|
+
import { useTerminalCompletionNotification } from "./app/hooks/useTerminalCompletionNotification";
|
|
16
|
+
import { useTerminalMutations } from "./app/hooks/useTerminalMutations";
|
|
17
|
+
import { useTerminalStateReconciliation } from "./app/hooks/useTerminalStateReconciliation";
|
|
18
|
+
import { useUsageHeatmapPolling } from "./app/hooks/useUsageHeatmapPolling";
|
|
19
|
+
import { useWorkspaceSetup } from "./app/hooks/useWorkspaceSetup";
|
|
20
|
+
import {
|
|
21
|
+
createTerminalRuntimeStateStore,
|
|
22
|
+
getTerminalRuntimeStateInfo,
|
|
23
|
+
stripTerminalRuntimeState,
|
|
24
|
+
stripTerminalRuntimeStates,
|
|
25
|
+
} from "./app/terminalRuntimeStateStore";
|
|
26
|
+
import type { TerminalView } from "./app/types";
|
|
27
|
+
import { clampSidebarWidth } from "./app/uiStateNormalizers";
|
|
28
|
+
import { ActiveAgentsSidebar } from "./components/ActiveAgentsSidebar";
|
|
29
|
+
import { ConsolePrimaryNav } from "./components/ConsolePrimaryNav";
|
|
30
|
+
import { PrimaryViewRouter } from "./components/PrimaryViewRouter";
|
|
31
|
+
import { RuntimeStatusStrip } from "./components/RuntimeStatusStrip";
|
|
32
|
+
import { SidebarActionPanel } from "./components/SidebarActionPanel";
|
|
33
|
+
import { TelemetryTape } from "./components/TelemetryTape";
|
|
34
|
+
import { HttpTerminalSnapshotReader } from "./runtime/HttpTerminalSnapshotReader";
|
|
35
|
+
import {
|
|
36
|
+
buildTerminalEventsSocketUrl,
|
|
37
|
+
buildTerminalSnapshotsUrl,
|
|
38
|
+
} from "./runtime/runtimeEndpoints";
|
|
39
|
+
|
|
40
|
+
export const App = () => {
|
|
41
|
+
const [terminals, setTerminals] = useState<TerminalView>([]);
|
|
42
|
+
const [recentlyCreatedTerminal, setRecentlyCreatedTerminal] = useState<
|
|
43
|
+
TerminalView[number] | null
|
|
44
|
+
>(null);
|
|
45
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
46
|
+
const [loadError, setLoadError] = useState<string | null>(null);
|
|
47
|
+
const [hoveredGitHubOverviewPointIndex, setHoveredGitHubOverviewPointIndex] = useState<
|
|
48
|
+
number | null
|
|
49
|
+
>(null);
|
|
50
|
+
const [deckSidebarContent, setDeckSidebarContent] = useState<ReactNode>(null);
|
|
51
|
+
const [conversationsSidebarContent, setConversationsSidebarContent] = useState<ReactNode>(null);
|
|
52
|
+
const [conversationsActionPanel, setConversationsActionPanel] = useState<ReactNode>(null);
|
|
53
|
+
const [promptsSidebarContent, setPromptsSidebarContent] = useState<ReactNode>(null);
|
|
54
|
+
const terminalEventsRefreshTimerRef = useRef<number | null>(null);
|
|
55
|
+
const runtimeStateStoreRef = useRef(createTerminalRuntimeStateStore());
|
|
56
|
+
const runtimeStateStore = runtimeStateStoreRef.current;
|
|
57
|
+
|
|
58
|
+
const sortTerminalSnapshots = useCallback(
|
|
59
|
+
(snapshots: TerminalView) =>
|
|
60
|
+
[...snapshots].sort((left, right) => {
|
|
61
|
+
return new Date(left.createdAt).getTime() - new Date(right.createdAt).getTime();
|
|
62
|
+
}),
|
|
63
|
+
[],
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const {
|
|
67
|
+
activePrimaryNav,
|
|
68
|
+
setActivePrimaryNav,
|
|
69
|
+
applyHydratedUiState,
|
|
70
|
+
isActiveAgentsSectionExpanded,
|
|
71
|
+
isAgentsSidebarVisible,
|
|
72
|
+
isBottomTelemetryVisible,
|
|
73
|
+
isClaudeUsageSectionExpanded,
|
|
74
|
+
isCodexUsageSectionExpanded,
|
|
75
|
+
isMonitorVisible,
|
|
76
|
+
isRuntimeStatusStripVisible,
|
|
77
|
+
isUiStateHydrated,
|
|
78
|
+
minimizedTerminalIds,
|
|
79
|
+
readUiState,
|
|
80
|
+
setIsActiveAgentsSectionExpanded,
|
|
81
|
+
setIsAgentsSidebarVisible,
|
|
82
|
+
setIsBottomTelemetryVisible,
|
|
83
|
+
setIsClaudeUsageSectionExpanded,
|
|
84
|
+
setIsCodexUsageSectionExpanded,
|
|
85
|
+
setIsMonitorVisible,
|
|
86
|
+
setIsRuntimeStatusStripVisible,
|
|
87
|
+
setIsUiStateHydrated,
|
|
88
|
+
setMinimizedTerminalIds,
|
|
89
|
+
setSidebarWidth,
|
|
90
|
+
setTerminalCompletionSound,
|
|
91
|
+
sidebarWidth,
|
|
92
|
+
terminalCompletionSound,
|
|
93
|
+
canvasOpenTerminalIds,
|
|
94
|
+
setCanvasOpenTerminalIds,
|
|
95
|
+
canvasOpenTentacleIds,
|
|
96
|
+
setCanvasOpenTentacleIds,
|
|
97
|
+
canvasTerminalsPanelWidth,
|
|
98
|
+
setCanvasTerminalsPanelWidth,
|
|
99
|
+
} = usePersistedUiState({ columns: terminals });
|
|
100
|
+
const {
|
|
101
|
+
workspaceSetup,
|
|
102
|
+
isWorkspaceSetupLoading,
|
|
103
|
+
workspaceSetupError,
|
|
104
|
+
refreshWorkspaceSetup,
|
|
105
|
+
runWorkspaceSetupStep,
|
|
106
|
+
} = useWorkspaceSetup();
|
|
107
|
+
const [runningWorkspaceSetupStepId, setRunningWorkspaceSetupStepId] = useState<
|
|
108
|
+
| "initialize-workspace"
|
|
109
|
+
| "ensure-gitignore"
|
|
110
|
+
| "check-claude"
|
|
111
|
+
| "check-git"
|
|
112
|
+
| "check-curl"
|
|
113
|
+
| "create-tentacles"
|
|
114
|
+
| null
|
|
115
|
+
>(null);
|
|
116
|
+
|
|
117
|
+
const readColumns = useCallback(
|
|
118
|
+
async (signal?: AbortSignal) => {
|
|
119
|
+
const readerOptions: { endpoint: string; signal?: AbortSignal } = {
|
|
120
|
+
endpoint: buildTerminalSnapshotsUrl(),
|
|
121
|
+
};
|
|
122
|
+
if (signal) {
|
|
123
|
+
readerOptions.signal = signal;
|
|
124
|
+
}
|
|
125
|
+
const reader = new HttpTerminalSnapshotReader(readerOptions);
|
|
126
|
+
const nextColumns = await buildTerminalList(reader);
|
|
127
|
+
runtimeStateStore.syncFromTerminals(nextColumns);
|
|
128
|
+
return stripTerminalRuntimeStates(nextColumns);
|
|
129
|
+
},
|
|
130
|
+
[runtimeStateStore],
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
const refreshColumns = useCallback(async () => {
|
|
134
|
+
const nextColumns = await readColumns();
|
|
135
|
+
setTerminals(nextColumns);
|
|
136
|
+
return nextColumns;
|
|
137
|
+
}, [readColumns]);
|
|
138
|
+
|
|
139
|
+
const {
|
|
140
|
+
clearPendingDeleteTerminal,
|
|
141
|
+
confirmDeleteTerminal,
|
|
142
|
+
createTerminal,
|
|
143
|
+
isCreatingTerminal,
|
|
144
|
+
isDeletingTerminalId,
|
|
145
|
+
pendingDeleteTerminal,
|
|
146
|
+
requestDeleteTerminal,
|
|
147
|
+
} = useTerminalMutations({
|
|
148
|
+
readColumns: async () => readColumns(),
|
|
149
|
+
setColumns: setTerminals,
|
|
150
|
+
setLoadError,
|
|
151
|
+
setMinimizedTerminalIds,
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const {
|
|
155
|
+
gitStatusByTentacleId,
|
|
156
|
+
gitStatusLoadingByTentacleId,
|
|
157
|
+
pullRequestByTentacleId,
|
|
158
|
+
pullRequestLoadingByTentacleId,
|
|
159
|
+
openGitTentacleId,
|
|
160
|
+
openGitTentacleStatus,
|
|
161
|
+
openGitTentaclePullRequest,
|
|
162
|
+
gitCommitMessageDraft,
|
|
163
|
+
gitDialogError,
|
|
164
|
+
isGitDialogLoading,
|
|
165
|
+
isGitDialogMutating,
|
|
166
|
+
setGitCommitMessageDraft,
|
|
167
|
+
openTentacleGitActions,
|
|
168
|
+
closeTentacleGitActions,
|
|
169
|
+
commitTentacleChanges,
|
|
170
|
+
commitAndPushTentacleBranch,
|
|
171
|
+
pushTentacleBranch,
|
|
172
|
+
syncTentacleBranch,
|
|
173
|
+
mergeTentaclePullRequest,
|
|
174
|
+
} = useTentacleGitLifecycle({
|
|
175
|
+
columns: terminals,
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
useInitialColumnsHydration({
|
|
179
|
+
readColumns,
|
|
180
|
+
readUiState,
|
|
181
|
+
applyHydratedUiState,
|
|
182
|
+
setColumns: setTerminals,
|
|
183
|
+
setLoadError,
|
|
184
|
+
setIsLoading,
|
|
185
|
+
setIsUiStateHydrated,
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
useEffect(() => {
|
|
189
|
+
return () => {
|
|
190
|
+
if (terminalEventsRefreshTimerRef.current !== null) {
|
|
191
|
+
window.clearTimeout(terminalEventsRefreshTimerRef.current);
|
|
192
|
+
terminalEventsRefreshTimerRef.current = null;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}, []);
|
|
196
|
+
|
|
197
|
+
useEffect(() => {
|
|
198
|
+
const socket = new WebSocket(buildTerminalEventsSocketUrl());
|
|
199
|
+
|
|
200
|
+
socket.addEventListener("message", (event) => {
|
|
201
|
+
if (typeof event.data !== "string") {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
try {
|
|
206
|
+
const payload = JSON.parse(event.data) as
|
|
207
|
+
| {
|
|
208
|
+
type?: unknown;
|
|
209
|
+
snapshot?: TerminalSnapshot;
|
|
210
|
+
terminalId?: string;
|
|
211
|
+
agentRuntimeState?: string;
|
|
212
|
+
toolName?: string;
|
|
213
|
+
}
|
|
214
|
+
| undefined;
|
|
215
|
+
if (!payload || typeof payload.type !== "string") {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (payload.type === "terminal-created" || payload.type === "terminal-updated") {
|
|
220
|
+
if (!payload.snapshot) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const runtimeState = getTerminalRuntimeStateInfo(payload.snapshot);
|
|
224
|
+
runtimeStateStore.setRuntimeState(payload.snapshot.terminalId, runtimeState);
|
|
225
|
+
const structuralSnapshot = stripTerminalRuntimeState(payload.snapshot);
|
|
226
|
+
if (payload.type === "terminal-created") {
|
|
227
|
+
setRecentlyCreatedTerminal(structuralSnapshot as TerminalView[number]);
|
|
228
|
+
}
|
|
229
|
+
setTerminals((current) =>
|
|
230
|
+
sortTerminalSnapshots([
|
|
231
|
+
...current.filter(
|
|
232
|
+
(terminal) => terminal.terminalId !== structuralSnapshot.terminalId,
|
|
233
|
+
),
|
|
234
|
+
structuralSnapshot,
|
|
235
|
+
]),
|
|
236
|
+
);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (payload.type === "terminal-state-changed") {
|
|
241
|
+
if (!payload.terminalId || !isAgentRuntimeState(payload.agentRuntimeState)) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
runtimeStateStore.setRuntimeState(payload.terminalId, {
|
|
245
|
+
state: payload.agentRuntimeState,
|
|
246
|
+
...(payload.toolName ? { toolName: payload.toolName } : {}),
|
|
247
|
+
});
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (payload.type === "terminal-deleted") {
|
|
252
|
+
if (!payload.terminalId) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
runtimeStateStore.removeTerminal(payload.terminalId);
|
|
256
|
+
setTerminals((current) =>
|
|
257
|
+
current.filter((terminal) => terminal.terminalId !== payload.terminalId),
|
|
258
|
+
);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (payload.type !== "terminal-list-changed") {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
} catch {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (terminalEventsRefreshTimerRef.current !== null) {
|
|
270
|
+
window.clearTimeout(terminalEventsRefreshTimerRef.current);
|
|
271
|
+
}
|
|
272
|
+
terminalEventsRefreshTimerRef.current = window.setTimeout(() => {
|
|
273
|
+
terminalEventsRefreshTimerRef.current = null;
|
|
274
|
+
void refreshColumns();
|
|
275
|
+
}, 100);
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
return () => {
|
|
279
|
+
if (terminalEventsRefreshTimerRef.current !== null) {
|
|
280
|
+
window.clearTimeout(terminalEventsRefreshTimerRef.current);
|
|
281
|
+
terminalEventsRefreshTimerRef.current = null;
|
|
282
|
+
}
|
|
283
|
+
socket.close();
|
|
284
|
+
};
|
|
285
|
+
}, [refreshColumns, runtimeStateStore, sortTerminalSnapshots]);
|
|
286
|
+
|
|
287
|
+
const { codexUsageSnapshot, refreshCodexUsage } = useCodexUsagePolling();
|
|
288
|
+
const { claudeUsageSnapshot, isRefreshingClaudeUsage, refreshClaudeUsage } =
|
|
289
|
+
useClaudeUsagePolling();
|
|
290
|
+
const backendLivenessStatus = useBackendLivenessPolling();
|
|
291
|
+
const { githubRepoSummary, isRefreshingGitHubSummary, refreshGitHubRepoSummary } =
|
|
292
|
+
useGithubSummaryPolling();
|
|
293
|
+
const handleMaximizeTerminal = useCallback(
|
|
294
|
+
(terminalId: string) => {
|
|
295
|
+
setMinimizedTerminalIds((current) =>
|
|
296
|
+
current.filter((currentTerminalId) => currentTerminalId !== terminalId),
|
|
297
|
+
);
|
|
298
|
+
},
|
|
299
|
+
[setMinimizedTerminalIds],
|
|
300
|
+
);
|
|
301
|
+
const handleActiveTerminalIdsChange = useCallback(
|
|
302
|
+
(activeTerminalIds: ReadonlySet<string>) => {
|
|
303
|
+
runtimeStateStore.retainTerminalIds(activeTerminalIds);
|
|
304
|
+
},
|
|
305
|
+
[runtimeStateStore],
|
|
306
|
+
);
|
|
307
|
+
|
|
308
|
+
useTerminalStateReconciliation({
|
|
309
|
+
columns: terminals,
|
|
310
|
+
setMinimizedTerminalIds,
|
|
311
|
+
onActiveTerminalIdsChange: handleActiveTerminalIdsChange,
|
|
312
|
+
});
|
|
313
|
+
const { playCompletionSoundPreview } = useTerminalCompletionNotification(
|
|
314
|
+
runtimeStateStore,
|
|
315
|
+
terminalCompletionSound,
|
|
316
|
+
);
|
|
317
|
+
const { heatmapData, isLoadingHeatmap, refreshHeatmap } = useUsageHeatmapPolling({
|
|
318
|
+
enabled: isUiStateHydrated && (activePrimaryNav === 3 || isRuntimeStatusStripVisible),
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
useConsoleKeyboardShortcuts({ setActivePrimaryNav });
|
|
322
|
+
const monitorRuntime = useMonitorRuntime({
|
|
323
|
+
enabled: isUiStateHydrated && isMonitorVisible,
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
const {
|
|
327
|
+
githubCommitCount30d,
|
|
328
|
+
sparklinePoints,
|
|
329
|
+
githubOverviewGraphSeries,
|
|
330
|
+
githubOverviewGraphPolylinePoints,
|
|
331
|
+
githubOverviewHoverLabel,
|
|
332
|
+
githubStatusPill,
|
|
333
|
+
githubRepoLabel,
|
|
334
|
+
githubStarCountLabel,
|
|
335
|
+
githubOpenIssuesLabel,
|
|
336
|
+
githubOpenPrsLabel,
|
|
337
|
+
githubRecentCommits,
|
|
338
|
+
} = useGitHubPrimaryViewModel({
|
|
339
|
+
githubRepoSummary,
|
|
340
|
+
hoveredGitHubOverviewPointIndex,
|
|
341
|
+
setHoveredGitHubOverviewPointIndex,
|
|
342
|
+
});
|
|
343
|
+
const hasSidebarActionPanel =
|
|
344
|
+
conversationsActionPanel !== null ||
|
|
345
|
+
pendingDeleteTerminal !== null ||
|
|
346
|
+
(openGitTentacleId !== null &&
|
|
347
|
+
terminals.find((terminal) => terminal.tentacleId === openGitTentacleId)?.workspaceMode ===
|
|
348
|
+
"worktree");
|
|
349
|
+
|
|
350
|
+
const sidebarActionPanel = hasSidebarActionPanel ? (
|
|
351
|
+
conversationsActionPanel ? (
|
|
352
|
+
<>{conversationsActionPanel}</>
|
|
353
|
+
) : (
|
|
354
|
+
<SidebarActionPanel
|
|
355
|
+
pendingDeleteTerminal={pendingDeleteTerminal}
|
|
356
|
+
isDeletingTerminalId={isDeletingTerminalId}
|
|
357
|
+
clearPendingDeleteTerminal={clearPendingDeleteTerminal}
|
|
358
|
+
confirmDeleteTerminal={confirmDeleteTerminal}
|
|
359
|
+
openGitTentacleId={openGitTentacleId}
|
|
360
|
+
columns={terminals}
|
|
361
|
+
openGitTentacleStatus={openGitTentacleStatus}
|
|
362
|
+
openGitTentaclePullRequest={openGitTentaclePullRequest}
|
|
363
|
+
gitCommitMessageDraft={gitCommitMessageDraft}
|
|
364
|
+
gitDialogError={gitDialogError}
|
|
365
|
+
isGitDialogLoading={isGitDialogLoading}
|
|
366
|
+
isGitDialogMutating={isGitDialogMutating}
|
|
367
|
+
setGitCommitMessageDraft={setGitCommitMessageDraft}
|
|
368
|
+
closeTentacleGitActions={closeTentacleGitActions}
|
|
369
|
+
commitTentacleChanges={commitTentacleChanges}
|
|
370
|
+
commitAndPushTentacleBranch={commitAndPushTentacleBranch}
|
|
371
|
+
pushTentacleBranch={pushTentacleBranch}
|
|
372
|
+
syncTentacleBranch={syncTentacleBranch}
|
|
373
|
+
mergeTentaclePullRequest={mergeTentaclePullRequest}
|
|
374
|
+
requestDeleteTerminal={requestDeleteTerminal}
|
|
375
|
+
/>
|
|
376
|
+
)
|
|
377
|
+
) : null;
|
|
378
|
+
|
|
379
|
+
useEffect(() => {
|
|
380
|
+
if (!hasSidebarActionPanel || isAgentsSidebarVisible) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
setIsAgentsSidebarVisible(true);
|
|
384
|
+
}, [isAgentsSidebarVisible, setIsAgentsSidebarVisible, hasSidebarActionPanel]);
|
|
385
|
+
|
|
386
|
+
const handleTerminalRenamed = useCallback((terminalId: string, tentacleName: string) => {
|
|
387
|
+
setTerminals((current) =>
|
|
388
|
+
current.map((t) =>
|
|
389
|
+
t.terminalId === terminalId ? { ...t, tentacleName, label: tentacleName } : t,
|
|
390
|
+
),
|
|
391
|
+
);
|
|
392
|
+
}, []);
|
|
393
|
+
|
|
394
|
+
const handleTerminalActivity = useCallback((terminalId: string) => {
|
|
395
|
+
setTerminals((current) =>
|
|
396
|
+
current.map((t) => (t.terminalId === terminalId ? { ...t, hasUserPrompt: true } : t)),
|
|
397
|
+
);
|
|
398
|
+
}, []);
|
|
399
|
+
|
|
400
|
+
const handleRunWorkspaceSetupStep = useCallback(
|
|
401
|
+
async (
|
|
402
|
+
stepId:
|
|
403
|
+
| "initialize-workspace"
|
|
404
|
+
| "ensure-gitignore"
|
|
405
|
+
| "check-claude"
|
|
406
|
+
| "check-git"
|
|
407
|
+
| "check-curl"
|
|
408
|
+
| "create-tentacles",
|
|
409
|
+
) => {
|
|
410
|
+
setRunningWorkspaceSetupStepId(stepId);
|
|
411
|
+
try {
|
|
412
|
+
await runWorkspaceSetupStep(stepId);
|
|
413
|
+
} finally {
|
|
414
|
+
setRunningWorkspaceSetupStepId(null);
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
[runWorkspaceSetupStep],
|
|
418
|
+
);
|
|
419
|
+
|
|
420
|
+
return (
|
|
421
|
+
<div className="page console-shell">
|
|
422
|
+
{isRuntimeStatusStripVisible && (
|
|
423
|
+
<RuntimeStatusStrip
|
|
424
|
+
sparklinePoints={sparklinePoints}
|
|
425
|
+
usageData={heatmapData}
|
|
426
|
+
claudeUsage={claudeUsageSnapshot}
|
|
427
|
+
isRefreshingClaudeUsage={isRefreshingClaudeUsage}
|
|
428
|
+
onRefreshClaudeUsage={refreshClaudeUsage}
|
|
429
|
+
/>
|
|
430
|
+
)}
|
|
431
|
+
|
|
432
|
+
<ConsolePrimaryNav
|
|
433
|
+
activePrimaryNav={activePrimaryNav}
|
|
434
|
+
onPrimaryNavChange={setActivePrimaryNav}
|
|
435
|
+
/>
|
|
436
|
+
|
|
437
|
+
<section className="console-main-canvas" aria-label="Main content canvas">
|
|
438
|
+
<div
|
|
439
|
+
className={`workspace-shell${isAgentsSidebarVisible && activePrimaryNav !== 1 && activePrimaryNav !== 3 && activePrimaryNav !== 4 && activePrimaryNav !== 5 && activePrimaryNav !== 8 ? "" : " workspace-shell--full"}`}
|
|
440
|
+
>
|
|
441
|
+
{isAgentsSidebarVisible &&
|
|
442
|
+
activePrimaryNav !== 1 &&
|
|
443
|
+
activePrimaryNav !== 3 &&
|
|
444
|
+
activePrimaryNav !== 4 &&
|
|
445
|
+
activePrimaryNav !== 5 &&
|
|
446
|
+
activePrimaryNav !== 8 && (
|
|
447
|
+
<ActiveAgentsSidebar
|
|
448
|
+
sidebarWidth={sidebarWidth}
|
|
449
|
+
onSidebarWidthChange={(width) => {
|
|
450
|
+
setSidebarWidth(clampSidebarWidth(width));
|
|
451
|
+
}}
|
|
452
|
+
actionPanel={sidebarActionPanel}
|
|
453
|
+
bodyContent={
|
|
454
|
+
activePrimaryNav === 2
|
|
455
|
+
? (deckSidebarContent ?? undefined)
|
|
456
|
+
: activePrimaryNav === 6
|
|
457
|
+
? (conversationsSidebarContent ?? undefined)
|
|
458
|
+
: activePrimaryNav === 7
|
|
459
|
+
? (promptsSidebarContent ?? undefined)
|
|
460
|
+
: undefined
|
|
461
|
+
}
|
|
462
|
+
/>
|
|
463
|
+
)}
|
|
464
|
+
|
|
465
|
+
<PrimaryViewRouter
|
|
466
|
+
activePrimaryNav={activePrimaryNav}
|
|
467
|
+
deckPrimaryViewProps={{
|
|
468
|
+
onSidebarContent: setDeckSidebarContent,
|
|
469
|
+
workspaceSetup,
|
|
470
|
+
isWorkspaceSetupLoading,
|
|
471
|
+
workspaceSetupError,
|
|
472
|
+
onRefreshWorkspaceSetup: refreshWorkspaceSetup,
|
|
473
|
+
onRunWorkspaceSetupStep: runWorkspaceSetupStep,
|
|
474
|
+
suppressWorkspaceSetupCard: true,
|
|
475
|
+
}}
|
|
476
|
+
isMonitorVisible={isMonitorVisible}
|
|
477
|
+
activityPrimaryViewProps={{
|
|
478
|
+
usageChartProps: {
|
|
479
|
+
data: heatmapData,
|
|
480
|
+
isLoading: isLoadingHeatmap,
|
|
481
|
+
onRefresh: refreshHeatmap,
|
|
482
|
+
},
|
|
483
|
+
githubPrimaryViewProps: {
|
|
484
|
+
githubCommitCount30d,
|
|
485
|
+
githubOpenIssuesLabel,
|
|
486
|
+
githubOpenPrsLabel,
|
|
487
|
+
githubRecentCommits,
|
|
488
|
+
githubOverviewGraphPolylinePoints,
|
|
489
|
+
githubOverviewGraphSeries,
|
|
490
|
+
githubOverviewHoverLabel,
|
|
491
|
+
githubRepoLabel,
|
|
492
|
+
githubStarCountLabel,
|
|
493
|
+
githubStatusPill,
|
|
494
|
+
hoveredGitHubOverviewPointIndex,
|
|
495
|
+
isRefreshingGitHubSummary,
|
|
496
|
+
onHoveredGitHubOverviewPointIndexChange: setHoveredGitHubOverviewPointIndex,
|
|
497
|
+
onRefresh: () => {
|
|
498
|
+
void refreshGitHubRepoSummary();
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
}}
|
|
502
|
+
monitorRuntime={monitorRuntime}
|
|
503
|
+
settingsPrimaryViewProps={{
|
|
504
|
+
isMonitorVisible,
|
|
505
|
+
isRuntimeStatusStripVisible,
|
|
506
|
+
onMonitorVisibilityChange: setIsMonitorVisible,
|
|
507
|
+
onRuntimeStatusStripVisibilityChange: setIsRuntimeStatusStripVisible,
|
|
508
|
+
onPreviewTerminalCompletionSound: playCompletionSoundPreview,
|
|
509
|
+
onTerminalCompletionSoundChange: setTerminalCompletionSound,
|
|
510
|
+
terminalCompletionSound,
|
|
511
|
+
}}
|
|
512
|
+
canvasPrimaryViewProps={{
|
|
513
|
+
columns: terminals,
|
|
514
|
+
runtimeStateStore,
|
|
515
|
+
isUiStateHydrated,
|
|
516
|
+
recentlyCreatedTerminal,
|
|
517
|
+
canvasOpenTerminalIds,
|
|
518
|
+
canvasOpenTentacleIds,
|
|
519
|
+
canvasTerminalsPanelWidth,
|
|
520
|
+
workspaceSetup,
|
|
521
|
+
isWorkspaceSetupLoading,
|
|
522
|
+
workspaceSetupError,
|
|
523
|
+
runningWorkspaceSetupStepId,
|
|
524
|
+
onRunWorkspaceSetupStep: handleRunWorkspaceSetupStep,
|
|
525
|
+
onLaunchWorkspaceSetupPlanner: async () => {
|
|
526
|
+
const response = await fetch("/api/terminals", {
|
|
527
|
+
method: "POST",
|
|
528
|
+
headers: { "Content-Type": "application/json" },
|
|
529
|
+
body: JSON.stringify({
|
|
530
|
+
name: "tentacle-planner",
|
|
531
|
+
workspaceMode: "shared",
|
|
532
|
+
agentProvider: "claude-code",
|
|
533
|
+
promptTemplate: "tentacle-planner",
|
|
534
|
+
}),
|
|
535
|
+
});
|
|
536
|
+
if (!response.ok) {
|
|
537
|
+
return undefined;
|
|
538
|
+
}
|
|
539
|
+
const snapshot = (await response.json()) as { terminalId?: string };
|
|
540
|
+
await refreshColumns();
|
|
541
|
+
if (typeof snapshot.terminalId !== "string") {
|
|
542
|
+
return undefined;
|
|
543
|
+
}
|
|
544
|
+
return snapshot.terminalId;
|
|
545
|
+
},
|
|
546
|
+
onCanvasOpenTerminalIdsChange: setCanvasOpenTerminalIds,
|
|
547
|
+
onCanvasOpenTentacleIdsChange: setCanvasOpenTentacleIds,
|
|
548
|
+
onCanvasTerminalsPanelWidthChange: setCanvasTerminalsPanelWidth,
|
|
549
|
+
onCreateAgent: async (tentacleId) => {
|
|
550
|
+
return await createTerminal("shared", undefined, tentacleId);
|
|
551
|
+
},
|
|
552
|
+
onCreateTerminal: async () => {
|
|
553
|
+
return await createTerminal("shared", undefined, OCTOBOSS_ID);
|
|
554
|
+
},
|
|
555
|
+
onCreateWorktreeTerminal: async () => {
|
|
556
|
+
return await createTerminal("worktree", undefined, OCTOBOSS_ID);
|
|
557
|
+
},
|
|
558
|
+
onCreateTentacle: async () => {
|
|
559
|
+
const response = await fetch("/api/deck/tentacles", {
|
|
560
|
+
method: "POST",
|
|
561
|
+
headers: { "Content-Type": "application/json" },
|
|
562
|
+
body: JSON.stringify({ name: "", description: "" }),
|
|
563
|
+
});
|
|
564
|
+
if (!response.ok) return;
|
|
565
|
+
await refreshColumns();
|
|
566
|
+
},
|
|
567
|
+
onSpawnSwarm: async (tentacleId, workspaceMode) => {
|
|
568
|
+
const response = await fetch(
|
|
569
|
+
`/api/deck/tentacles/${encodeURIComponent(tentacleId)}/swarm`,
|
|
570
|
+
{
|
|
571
|
+
method: "POST",
|
|
572
|
+
headers: { "Content-Type": "application/json" },
|
|
573
|
+
body: JSON.stringify({ workspaceMode }),
|
|
574
|
+
},
|
|
575
|
+
);
|
|
576
|
+
if (!response.ok) return;
|
|
577
|
+
},
|
|
578
|
+
onOctobossAction: async (action) => {
|
|
579
|
+
const response = await fetch("/api/terminals", {
|
|
580
|
+
method: "POST",
|
|
581
|
+
headers: { "Content-Type": "application/json" },
|
|
582
|
+
body: JSON.stringify({
|
|
583
|
+
workspaceMode: "shared",
|
|
584
|
+
tentacleId: OCTOBOSS_ID,
|
|
585
|
+
promptTemplate: action,
|
|
586
|
+
}),
|
|
587
|
+
});
|
|
588
|
+
if (!response.ok) return undefined;
|
|
589
|
+
const snapshot = (await response.json()) as { terminalId?: string };
|
|
590
|
+
await refreshColumns();
|
|
591
|
+
return typeof snapshot.terminalId === "string" ? snapshot.terminalId : undefined;
|
|
592
|
+
},
|
|
593
|
+
onTentacleAction: async (tentacleId, action) => {
|
|
594
|
+
const response = await fetch("/api/terminals", {
|
|
595
|
+
method: "POST",
|
|
596
|
+
headers: { "Content-Type": "application/json" },
|
|
597
|
+
body: JSON.stringify({
|
|
598
|
+
workspaceMode: "shared",
|
|
599
|
+
tentacleId,
|
|
600
|
+
promptTemplate: action,
|
|
601
|
+
promptVariables: {
|
|
602
|
+
tentacleId,
|
|
603
|
+
},
|
|
604
|
+
}),
|
|
605
|
+
});
|
|
606
|
+
if (!response.ok) return undefined;
|
|
607
|
+
const snapshot = (await response.json()) as { terminalId?: string };
|
|
608
|
+
await refreshColumns();
|
|
609
|
+
return typeof snapshot.terminalId === "string" ? snapshot.terminalId : undefined;
|
|
610
|
+
},
|
|
611
|
+
onNavigateToConversation: (_sessionId) => {
|
|
612
|
+
setActivePrimaryNav(6);
|
|
613
|
+
},
|
|
614
|
+
onDeleteActiveSession: (terminalId, terminalName, workspaceMode) => {
|
|
615
|
+
requestDeleteTerminal(terminalId, terminalName, {
|
|
616
|
+
workspaceMode: workspaceMode === "worktree" ? "worktree" : "shared",
|
|
617
|
+
intent: "delete-terminal",
|
|
618
|
+
});
|
|
619
|
+
},
|
|
620
|
+
pendingDeleteTerminal,
|
|
621
|
+
isDeletingTerminalId,
|
|
622
|
+
onCancelDelete: clearPendingDeleteTerminal,
|
|
623
|
+
onConfirmDelete: () => {
|
|
624
|
+
void confirmDeleteTerminal();
|
|
625
|
+
},
|
|
626
|
+
onTerminalRenamed: handleTerminalRenamed,
|
|
627
|
+
onTerminalActivity: handleTerminalActivity,
|
|
628
|
+
onRefreshColumns: async () => {
|
|
629
|
+
await refreshColumns();
|
|
630
|
+
},
|
|
631
|
+
}}
|
|
632
|
+
conversationsEnabled={isUiStateHydrated && activePrimaryNav === 6}
|
|
633
|
+
onConversationsSidebarContent={setConversationsSidebarContent}
|
|
634
|
+
onConversationsActionPanel={setConversationsActionPanel}
|
|
635
|
+
promptsEnabled={isUiStateHydrated && activePrimaryNav === 7}
|
|
636
|
+
onPromptsSidebarContent={setPromptsSidebarContent}
|
|
637
|
+
/>
|
|
638
|
+
</div>
|
|
639
|
+
</section>
|
|
640
|
+
|
|
641
|
+
{isUiStateHydrated && isMonitorVisible && isBottomTelemetryVisible && (
|
|
642
|
+
<TelemetryTape monitorFeed={monitorRuntime.monitorFeed} />
|
|
643
|
+
)}
|
|
644
|
+
</div>
|
|
645
|
+
);
|
|
646
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AgentRuntimeState,
|
|
3
|
+
AgentState,
|
|
4
|
+
DeckOctopusAppearance,
|
|
5
|
+
TentacleWorkspaceMode,
|
|
6
|
+
} from "@octogent/core";
|
|
7
|
+
|
|
8
|
+
export type GraphNode = {
|
|
9
|
+
id: string;
|
|
10
|
+
type: "tentacle" | "octoboss" | "active-session" | "inactive-session";
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
vx: number;
|
|
14
|
+
vy: number;
|
|
15
|
+
pinned: boolean;
|
|
16
|
+
radius: number;
|
|
17
|
+
tentacleId: string;
|
|
18
|
+
label: string;
|
|
19
|
+
color: string;
|
|
20
|
+
sessionId?: string;
|
|
21
|
+
agentState?: AgentState;
|
|
22
|
+
agentRuntimeState?: AgentRuntimeState;
|
|
23
|
+
waitingToolName?: string;
|
|
24
|
+
hasUserPrompt?: boolean;
|
|
25
|
+
workspaceMode?: TentacleWorkspaceMode;
|
|
26
|
+
parentTerminalId?: string;
|
|
27
|
+
firstPromptPreview?: string;
|
|
28
|
+
octopus?: DeckOctopusAppearance;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type GraphEdge = {
|
|
32
|
+
source: string;
|
|
33
|
+
target: string;
|
|
34
|
+
};
|