@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,221 @@
|
|
|
1
|
+
import { useCallback, useMemo, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import type { GraphNode } from "../../app/canvas/types";
|
|
4
|
+
import type { TerminalView } from "../../app/types";
|
|
5
|
+
import { ActionButton } from "../ui/ActionButton";
|
|
6
|
+
|
|
7
|
+
type DeleteAllTerminalsDialogProps = {
|
|
8
|
+
columns: TerminalView;
|
|
9
|
+
nodes: GraphNode[];
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
onDeleted: (result: { hadFailures: boolean }) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const readDeleteFailureMessage = async (response: Response, fallback: string) => {
|
|
15
|
+
try {
|
|
16
|
+
const payload = (await response.json()) as { error?: unknown };
|
|
17
|
+
if (typeof payload.error === "string" && payload.error.trim().length > 0) {
|
|
18
|
+
return payload.error;
|
|
19
|
+
}
|
|
20
|
+
} catch {
|
|
21
|
+
// Ignore malformed error payloads and fall back to the status line.
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return fallback;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const DeleteAllTerminalsDialog = ({
|
|
28
|
+
columns,
|
|
29
|
+
nodes,
|
|
30
|
+
onCancel,
|
|
31
|
+
onDeleted,
|
|
32
|
+
}: DeleteAllTerminalsDialogProps) => {
|
|
33
|
+
const [inactiveOnly, setInactiveOnly] = useState(true);
|
|
34
|
+
const [isDeleting, setIsDeleting] = useState(false);
|
|
35
|
+
const [progress, setProgress] = useState<{ done: number; total: number } | null>(null);
|
|
36
|
+
const [failureMessages, setFailureMessages] = useState<string[]>([]);
|
|
37
|
+
|
|
38
|
+
const inactiveTerminals = useMemo(() => columns.filter((t) => !t.hasUserPrompt), [columns]);
|
|
39
|
+
|
|
40
|
+
const inactiveSessionIds = useMemo(
|
|
41
|
+
() =>
|
|
42
|
+
nodes.flatMap((node) =>
|
|
43
|
+
node.type === "inactive-session" && node.sessionId ? [node.sessionId] : [],
|
|
44
|
+
),
|
|
45
|
+
[nodes],
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const activeTargets = inactiveOnly ? inactiveTerminals : columns;
|
|
49
|
+
const totalTargetCount = activeTargets.length + inactiveSessionIds.length;
|
|
50
|
+
|
|
51
|
+
const handleConfirm = useCallback(async () => {
|
|
52
|
+
if (totalTargetCount === 0) return;
|
|
53
|
+
setFailureMessages([]);
|
|
54
|
+
setIsDeleting(true);
|
|
55
|
+
setProgress({ done: 0, total: totalTargetCount });
|
|
56
|
+
|
|
57
|
+
let done = 0;
|
|
58
|
+
const failures: string[] = [];
|
|
59
|
+
|
|
60
|
+
for (const terminal of activeTargets) {
|
|
61
|
+
try {
|
|
62
|
+
const response = await fetch(`/api/terminals/${encodeURIComponent(terminal.terminalId)}`, {
|
|
63
|
+
method: "DELETE",
|
|
64
|
+
headers: { Accept: "application/json" },
|
|
65
|
+
});
|
|
66
|
+
if (!response.ok) {
|
|
67
|
+
failures.push(
|
|
68
|
+
`${terminal.tentacleName || terminal.label || terminal.terminalId}: ${await readDeleteFailureMessage(
|
|
69
|
+
response,
|
|
70
|
+
`Delete failed (${response.status})`,
|
|
71
|
+
)}`,
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
} catch (error) {
|
|
75
|
+
failures.push(
|
|
76
|
+
`${terminal.tentacleName || terminal.label || terminal.terminalId}: ${
|
|
77
|
+
error instanceof Error ? error.message : "Delete failed."
|
|
78
|
+
}`,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
done += 1;
|
|
82
|
+
setProgress({ done, total: totalTargetCount });
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
for (const sessionId of inactiveSessionIds) {
|
|
86
|
+
try {
|
|
87
|
+
const response = await fetch(`/api/conversations/${encodeURIComponent(sessionId)}`, {
|
|
88
|
+
method: "DELETE",
|
|
89
|
+
headers: { Accept: "application/json" },
|
|
90
|
+
});
|
|
91
|
+
if (!response.ok) {
|
|
92
|
+
failures.push(
|
|
93
|
+
`Conversation ${sessionId}: ${await readDeleteFailureMessage(
|
|
94
|
+
response,
|
|
95
|
+
`Delete failed (${response.status})`,
|
|
96
|
+
)}`,
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
} catch (error) {
|
|
100
|
+
failures.push(
|
|
101
|
+
`Conversation ${sessionId}: ${error instanceof Error ? error.message : "Delete failed."}`,
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
done += 1;
|
|
105
|
+
setProgress({ done, total: totalTargetCount });
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
setIsDeleting(false);
|
|
109
|
+
setProgress(null);
|
|
110
|
+
setFailureMessages(failures);
|
|
111
|
+
onDeleted({ hadFailures: failures.length > 0 });
|
|
112
|
+
}, [activeTargets, inactiveSessionIds, totalTargetCount, onDeleted]);
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<section
|
|
116
|
+
aria-label="Delete all terminals"
|
|
117
|
+
className="delete-confirm-dialog"
|
|
118
|
+
onKeyDown={(event) => {
|
|
119
|
+
if (event.key !== "Escape" || isDeleting) return;
|
|
120
|
+
event.preventDefault();
|
|
121
|
+
onCancel();
|
|
122
|
+
}}
|
|
123
|
+
tabIndex={-1}
|
|
124
|
+
>
|
|
125
|
+
<header className="delete-confirm-header">
|
|
126
|
+
<h2>Delete Terminals</h2>
|
|
127
|
+
<div className="delete-confirm-header-actions">
|
|
128
|
+
<span className="pill blocked">DESTRUCTIVE</span>
|
|
129
|
+
<ActionButton
|
|
130
|
+
aria-label="Close confirmation"
|
|
131
|
+
className="delete-confirm-close"
|
|
132
|
+
disabled={isDeleting}
|
|
133
|
+
onClick={onCancel}
|
|
134
|
+
size="dense"
|
|
135
|
+
variant="accent"
|
|
136
|
+
>
|
|
137
|
+
Close
|
|
138
|
+
</ActionButton>
|
|
139
|
+
</div>
|
|
140
|
+
</header>
|
|
141
|
+
<div className="delete-confirm-body">
|
|
142
|
+
<p className="delete-confirm-message">
|
|
143
|
+
Delete{" "}
|
|
144
|
+
<strong>
|
|
145
|
+
{totalTargetCount} {totalTargetCount === 1 ? "session" : "sessions"}
|
|
146
|
+
</strong>
|
|
147
|
+
{inactiveOnly ? " (inactive terminals + past sessions)" : " (all)"}.
|
|
148
|
+
</p>
|
|
149
|
+
<p className="delete-confirm-message">
|
|
150
|
+
Worktree-backed terminals also remove their local worktree directories and branches.
|
|
151
|
+
</p>
|
|
152
|
+
{failureMessages.length > 0 && (
|
|
153
|
+
<p className="delete-confirm-message" role="alert">
|
|
154
|
+
Failed to delete {failureMessages.length}{" "}
|
|
155
|
+
{failureMessages.length === 1 ? "item" : "items"}:{" "}
|
|
156
|
+
{failureMessages.slice(0, 3).join("; ")}
|
|
157
|
+
</p>
|
|
158
|
+
)}
|
|
159
|
+
<div className="delete-all-mode-row">
|
|
160
|
+
<span className="delete-all-mode-label">
|
|
161
|
+
{inactiveOnly ? "Inactive only" : "All terminals"}
|
|
162
|
+
</span>
|
|
163
|
+
<button
|
|
164
|
+
type="button"
|
|
165
|
+
className="delete-all-toggle-switch"
|
|
166
|
+
role="switch"
|
|
167
|
+
aria-checked={!inactiveOnly}
|
|
168
|
+
aria-label="Toggle between inactive only and all terminals"
|
|
169
|
+
disabled={isDeleting}
|
|
170
|
+
onClick={() => setInactiveOnly((prev) => !prev)}
|
|
171
|
+
>
|
|
172
|
+
<span className="delete-all-toggle-thumb" />
|
|
173
|
+
</button>
|
|
174
|
+
</div>
|
|
175
|
+
<dl className="delete-confirm-details delete-all-details">
|
|
176
|
+
<div>
|
|
177
|
+
<dt>Inactive</dt>
|
|
178
|
+
<dd>{inactiveTerminals.length}</dd>
|
|
179
|
+
</div>
|
|
180
|
+
<div>
|
|
181
|
+
<dt>Past sessions</dt>
|
|
182
|
+
<dd>{inactiveSessionIds.length}</dd>
|
|
183
|
+
</div>
|
|
184
|
+
<div>
|
|
185
|
+
<dt>Total</dt>
|
|
186
|
+
<dd>{columns.length}</dd>
|
|
187
|
+
</div>
|
|
188
|
+
</dl>
|
|
189
|
+
{progress && (
|
|
190
|
+
<div className="delete-all-progress">
|
|
191
|
+
Deleting... {progress.done}/{progress.total}
|
|
192
|
+
</div>
|
|
193
|
+
)}
|
|
194
|
+
</div>
|
|
195
|
+
<div className="delete-confirm-actions">
|
|
196
|
+
<ActionButton
|
|
197
|
+
aria-label="Cancel delete all"
|
|
198
|
+
className="delete-confirm-cancel"
|
|
199
|
+
disabled={isDeleting}
|
|
200
|
+
onClick={onCancel}
|
|
201
|
+
size="dense"
|
|
202
|
+
variant="accent"
|
|
203
|
+
>
|
|
204
|
+
Cancel
|
|
205
|
+
</ActionButton>
|
|
206
|
+
<ActionButton
|
|
207
|
+
aria-label="Confirm delete all terminals"
|
|
208
|
+
className="delete-confirm-submit"
|
|
209
|
+
disabled={isDeleting || totalTargetCount === 0}
|
|
210
|
+
onClick={() => void handleConfirm()}
|
|
211
|
+
size="dense"
|
|
212
|
+
variant="danger"
|
|
213
|
+
>
|
|
214
|
+
{isDeleting
|
|
215
|
+
? `Deleting ${progress?.done ?? 0}/${progress?.total ?? 0}`
|
|
216
|
+
: `Delete ${totalTargetCount}`}
|
|
217
|
+
</ActionButton>
|
|
218
|
+
</div>
|
|
219
|
+
</section>
|
|
220
|
+
);
|
|
221
|
+
};
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
|
|
3
|
+
import type { GraphNode } from "../../app/canvas/types";
|
|
4
|
+
import {
|
|
5
|
+
type OctopusAccessory,
|
|
6
|
+
type OctopusAnimation,
|
|
7
|
+
type OctopusExpression,
|
|
8
|
+
OctopusGlyph,
|
|
9
|
+
} from "../EmptyOctopus";
|
|
10
|
+
|
|
11
|
+
const LINE_MAX = 22;
|
|
12
|
+
|
|
13
|
+
const splitLabel = (label: string): [string] | [string, string] => {
|
|
14
|
+
if (label.length <= LINE_MAX) return [label];
|
|
15
|
+
const mid = Math.floor(label.length / 2);
|
|
16
|
+
let best = -1;
|
|
17
|
+
for (let i = 0; i < label.length; i++) {
|
|
18
|
+
if (label[i] === " " && (best === -1 || Math.abs(i - mid) < Math.abs(best - mid))) {
|
|
19
|
+
best = i;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (best > 0 && best < label.length - 1) {
|
|
23
|
+
const line1 = label.slice(0, best);
|
|
24
|
+
let line2 = label.slice(best + 1);
|
|
25
|
+
if (line2.length > LINE_MAX) line2 = `${line2.slice(0, LINE_MAX - 1)}…`;
|
|
26
|
+
return [line1.length > LINE_MAX ? `${line1.slice(0, LINE_MAX - 1)}…` : line1, line2];
|
|
27
|
+
}
|
|
28
|
+
return [
|
|
29
|
+
`${label.slice(0, LINE_MAX - 1)}…`,
|
|
30
|
+
label.slice(LINE_MAX - 1, LINE_MAX * 2 - 2) + (label.length > LINE_MAX * 2 - 2 ? "…" : ""),
|
|
31
|
+
];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const ANIMATIONS: OctopusAnimation[] = ["sway", "walk", "jog", "bounce", "float", "swim-up"];
|
|
35
|
+
const EXPRESSIONS: OctopusExpression[] = ["normal", "happy", "angry", "surprised"];
|
|
36
|
+
const ACCESSORIES: OctopusAccessory[] = ["none", "none", "long", "mohawk", "side-sweep", "curly"];
|
|
37
|
+
|
|
38
|
+
function hashString(str: string): number {
|
|
39
|
+
let h = 0;
|
|
40
|
+
for (let i = 0; i < str.length; i++) {
|
|
41
|
+
h = ((h << 5) - h + str.charCodeAt(i)) | 0;
|
|
42
|
+
}
|
|
43
|
+
return Math.abs(h);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function seededRandom(seed: number): () => number {
|
|
47
|
+
let s = seed;
|
|
48
|
+
return () => {
|
|
49
|
+
s = (s * 16807 + 0) % 2147483647;
|
|
50
|
+
return (s - 1) / 2147483646;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type OctopusVisuals = {
|
|
55
|
+
animation: OctopusAnimation;
|
|
56
|
+
expression: OctopusExpression;
|
|
57
|
+
accessory: OctopusAccessory;
|
|
58
|
+
hairColor?: string | undefined;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
function deriveOctopusVisuals(node: GraphNode): OctopusVisuals {
|
|
62
|
+
const rng = seededRandom(hashString(node.tentacleId));
|
|
63
|
+
const stored = node.octopus;
|
|
64
|
+
return {
|
|
65
|
+
animation:
|
|
66
|
+
(stored?.animation as OctopusAnimation | null) ??
|
|
67
|
+
(ANIMATIONS[Math.floor(rng() * ANIMATIONS.length)] as OctopusAnimation),
|
|
68
|
+
expression:
|
|
69
|
+
(stored?.expression as OctopusExpression | null) ??
|
|
70
|
+
(EXPRESSIONS[Math.floor(rng() * EXPRESSIONS.length)] as OctopusExpression),
|
|
71
|
+
accessory:
|
|
72
|
+
(stored?.accessory as OctopusAccessory | null) ??
|
|
73
|
+
(ACCESSORIES[Math.floor(rng() * ACCESSORIES.length)] as OctopusAccessory),
|
|
74
|
+
hairColor: stored?.hairColor ?? undefined,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
type OctopusNodeProps = {
|
|
79
|
+
node: GraphNode;
|
|
80
|
+
connectedNodes: GraphNode[];
|
|
81
|
+
isSelected: boolean;
|
|
82
|
+
selectedNodeId: string | null;
|
|
83
|
+
selectedNodeColor: string | null;
|
|
84
|
+
onPointerDown: (e: React.PointerEvent, nodeId: string) => void;
|
|
85
|
+
onClick: (nodeId: string) => void;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const buildEdgePath = (
|
|
89
|
+
cx: number,
|
|
90
|
+
cy: number,
|
|
91
|
+
tx: number,
|
|
92
|
+
ty: number,
|
|
93
|
+
targetRadius: number,
|
|
94
|
+
edgeIndex: number,
|
|
95
|
+
edgeCount: number,
|
|
96
|
+
): string => {
|
|
97
|
+
const dx = tx - cx;
|
|
98
|
+
const dy = ty - cy;
|
|
99
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
100
|
+
if (dist < 1) return "";
|
|
101
|
+
|
|
102
|
+
// Shorten the endpoint so the edge stops at the target node's border
|
|
103
|
+
const shortenBy = targetRadius + 2;
|
|
104
|
+
const endRatio = Math.max(0, (dist - shortenBy) / dist);
|
|
105
|
+
const etx = cx + dx * endRatio;
|
|
106
|
+
const ety = cy + dy * endRatio;
|
|
107
|
+
|
|
108
|
+
// Curvature — perpendicular offset for quadratic Bézier control point
|
|
109
|
+
// Single edges get a default curve; multi-edges fan out
|
|
110
|
+
const curvature = edgeCount <= 1 ? 0.3 : (edgeIndex / (edgeCount - 1) - 0.5) * 2;
|
|
111
|
+
const offsetRatio = 0.25 + edgeCount * 0.05;
|
|
112
|
+
const baseOffset = Math.max(35, dist * offsetRatio);
|
|
113
|
+
|
|
114
|
+
// Perpendicular to source→target direction (unit normal: -dy/dist, dx/dist)
|
|
115
|
+
const offsetX = (-dy / dist) * curvature * baseOffset;
|
|
116
|
+
const offsetY = (dx / dist) * curvature * baseOffset;
|
|
117
|
+
const cpx = (cx + etx) / 2 + offsetX;
|
|
118
|
+
const cpy = (cy + ety) / 2 + offsetY;
|
|
119
|
+
|
|
120
|
+
return `M ${cx} ${cy} Q ${cpx} ${cpy} ${etx} ${ety}`;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const GLYPH_SCALE = 4;
|
|
124
|
+
const GLYPH_W = 112;
|
|
125
|
+
const GLYPH_H = 120;
|
|
126
|
+
|
|
127
|
+
const isEdgeActivityVisible = (target: GraphNode): boolean =>
|
|
128
|
+
target.type === "active-session" &&
|
|
129
|
+
target.hasUserPrompt !== false &&
|
|
130
|
+
target.agentRuntimeState !== undefined &&
|
|
131
|
+
target.agentRuntimeState !== "idle";
|
|
132
|
+
|
|
133
|
+
const renderEdgeActivityDots = (path: string, color: string, keyPrefix: string) =>
|
|
134
|
+
[0, 1, 2].flatMap((index) => [
|
|
135
|
+
<circle
|
|
136
|
+
key={`${keyPrefix}-trail-${index}`}
|
|
137
|
+
className="canvas-edge-activity-dot canvas-edge-activity-dot--trail"
|
|
138
|
+
r={4.6}
|
|
139
|
+
fill={color}
|
|
140
|
+
opacity={Math.max(0.14, 0.28 - index * 0.04)}
|
|
141
|
+
>
|
|
142
|
+
<animateMotion
|
|
143
|
+
path={path}
|
|
144
|
+
begin={`${index * 0.62}s`}
|
|
145
|
+
dur="1.9s"
|
|
146
|
+
repeatCount="indefinite"
|
|
147
|
+
rotate="auto"
|
|
148
|
+
/>
|
|
149
|
+
<animate
|
|
150
|
+
attributeName="r"
|
|
151
|
+
values="3.8;5.2;3.8"
|
|
152
|
+
dur="1.9s"
|
|
153
|
+
begin={`${index * 0.62}s`}
|
|
154
|
+
repeatCount="indefinite"
|
|
155
|
+
/>
|
|
156
|
+
</circle>,
|
|
157
|
+
<circle
|
|
158
|
+
key={`${keyPrefix}-dot-${index}`}
|
|
159
|
+
className="canvas-edge-activity-dot"
|
|
160
|
+
r={3.2}
|
|
161
|
+
fill="#fff4cc"
|
|
162
|
+
stroke={color}
|
|
163
|
+
strokeWidth={1.2}
|
|
164
|
+
opacity={Math.max(0.7, 1 - index * 0.08)}
|
|
165
|
+
>
|
|
166
|
+
<animateMotion
|
|
167
|
+
path={path}
|
|
168
|
+
begin={`${index * 0.62}s`}
|
|
169
|
+
dur="1.9s"
|
|
170
|
+
repeatCount="indefinite"
|
|
171
|
+
rotate="auto"
|
|
172
|
+
/>
|
|
173
|
+
<animate
|
|
174
|
+
attributeName="r"
|
|
175
|
+
values="2.8;3.8;2.8"
|
|
176
|
+
dur="1.9s"
|
|
177
|
+
begin={`${index * 0.62}s`}
|
|
178
|
+
repeatCount="indefinite"
|
|
179
|
+
/>
|
|
180
|
+
</circle>,
|
|
181
|
+
]);
|
|
182
|
+
|
|
183
|
+
export const OctopusNode = ({
|
|
184
|
+
node,
|
|
185
|
+
connectedNodes,
|
|
186
|
+
isSelected,
|
|
187
|
+
selectedNodeId,
|
|
188
|
+
selectedNodeColor,
|
|
189
|
+
onPointerDown,
|
|
190
|
+
onClick,
|
|
191
|
+
}: OctopusNodeProps) => {
|
|
192
|
+
const showFocus = isSelected;
|
|
193
|
+
const isOctoboss = node.type === "octoboss";
|
|
194
|
+
const lines = useMemo(() => splitLabel(node.label), [node.label]);
|
|
195
|
+
const visuals = useMemo(
|
|
196
|
+
() =>
|
|
197
|
+
isOctoboss
|
|
198
|
+
? ({ animation: "sway", expression: "normal", accessory: "none" } as OctopusVisuals)
|
|
199
|
+
: deriveOctopusVisuals(node),
|
|
200
|
+
[node, isOctoboss],
|
|
201
|
+
);
|
|
202
|
+
const glyphScale = isOctoboss ? 6 : GLYPH_SCALE;
|
|
203
|
+
const glyphW = Math.round(GLYPH_W * (glyphScale / GLYPH_SCALE));
|
|
204
|
+
const glyphH = Math.round(GLYPH_H * (glyphScale / GLYPH_SCALE));
|
|
205
|
+
const color = node.color;
|
|
206
|
+
|
|
207
|
+
return (
|
|
208
|
+
<g
|
|
209
|
+
className={`canvas-node canvas-node--tentacle${showFocus ? " canvas-node--selected" : ""}`}
|
|
210
|
+
data-node-id={node.id}
|
|
211
|
+
transform={`translate(${node.x}, ${node.y})`}
|
|
212
|
+
onPointerDown={(e) => {
|
|
213
|
+
if (e.button !== 0) return;
|
|
214
|
+
e.stopPropagation();
|
|
215
|
+
onPointerDown(e, node.id);
|
|
216
|
+
}}
|
|
217
|
+
onClick={(e) => {
|
|
218
|
+
e.stopPropagation();
|
|
219
|
+
onClick(node.id);
|
|
220
|
+
}}
|
|
221
|
+
onKeyDown={(e) => {
|
|
222
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
e.stopPropagation();
|
|
225
|
+
onClick(node.id);
|
|
226
|
+
}}
|
|
227
|
+
style={{ cursor: "grab" }}
|
|
228
|
+
>
|
|
229
|
+
{/* Invisible hit area for pointer events */}
|
|
230
|
+
<rect x={-glyphW / 2} y={-glyphH / 2} width={glyphW} height={glyphH} fill="transparent" />
|
|
231
|
+
|
|
232
|
+
{/* Edges — highlight when either endpoint is selected */}
|
|
233
|
+
{connectedNodes.map((target) => {
|
|
234
|
+
const active = isSelected || target.id === selectedNodeId;
|
|
235
|
+
const path = buildEdgePath(0, 0, target.x - node.x, target.y - node.y, target.radius, 0, 1);
|
|
236
|
+
return (
|
|
237
|
+
<g key={target.id}>
|
|
238
|
+
<path
|
|
239
|
+
className="canvas-edge"
|
|
240
|
+
d={path}
|
|
241
|
+
fill="none"
|
|
242
|
+
stroke={active ? (selectedNodeColor ?? color) : "#C0C0C0"}
|
|
243
|
+
strokeWidth={active ? 2 : 1.5}
|
|
244
|
+
strokeOpacity={1}
|
|
245
|
+
/>
|
|
246
|
+
{isEdgeActivityVisible(target)
|
|
247
|
+
? renderEdgeActivityDots(
|
|
248
|
+
path,
|
|
249
|
+
active ? (selectedNodeColor ?? color) : color,
|
|
250
|
+
target.id,
|
|
251
|
+
)
|
|
252
|
+
: null}
|
|
253
|
+
</g>
|
|
254
|
+
);
|
|
255
|
+
})}
|
|
256
|
+
|
|
257
|
+
{/* Focused glow — same style as session nodes */}
|
|
258
|
+
{showFocus && <circle className="canvas-node-focus-glow" r={node.radius - 4} fill={color} />}
|
|
259
|
+
|
|
260
|
+
{/* Octopus glyph via foreignObject */}
|
|
261
|
+
<foreignObject
|
|
262
|
+
x={-glyphW / 2}
|
|
263
|
+
y={-glyphH / 2}
|
|
264
|
+
width={glyphW}
|
|
265
|
+
height={glyphH}
|
|
266
|
+
style={{ overflow: "visible", pointerEvents: "none" }}
|
|
267
|
+
>
|
|
268
|
+
<div
|
|
269
|
+
style={{
|
|
270
|
+
display: "flex",
|
|
271
|
+
alignItems: "center",
|
|
272
|
+
justifyContent: "center",
|
|
273
|
+
width: "100%",
|
|
274
|
+
height: "100%",
|
|
275
|
+
pointerEvents: "none",
|
|
276
|
+
}}
|
|
277
|
+
>
|
|
278
|
+
<OctopusGlyph
|
|
279
|
+
{...(isOctoboss ? {} : { color })}
|
|
280
|
+
animation={visuals.animation}
|
|
281
|
+
expression={visuals.expression}
|
|
282
|
+
accessory={visuals.accessory}
|
|
283
|
+
{...(visuals.hairColor ? { hairColor: visuals.hairColor } : {})}
|
|
284
|
+
scale={glyphScale}
|
|
285
|
+
/>
|
|
286
|
+
</div>
|
|
287
|
+
</foreignObject>
|
|
288
|
+
|
|
289
|
+
{/* Label — always visible, up to two lines */}
|
|
290
|
+
<text
|
|
291
|
+
y={glyphH / 2 - 12}
|
|
292
|
+
textAnchor="middle"
|
|
293
|
+
className="canvas-node-label canvas-node-label--tentacle canvas-node-label--always"
|
|
294
|
+
fill={isOctoboss ? "var(--accent-primary, #d4a017)" : "#faa32c"}
|
|
295
|
+
>
|
|
296
|
+
<tspan x="0" dy="0">
|
|
297
|
+
{lines[0]}
|
|
298
|
+
</tspan>
|
|
299
|
+
{lines[1] && (
|
|
300
|
+
<tspan x="0" dy="1.2em">
|
|
301
|
+
{lines[1]}
|
|
302
|
+
</tspan>
|
|
303
|
+
)}
|
|
304
|
+
</text>
|
|
305
|
+
</g>
|
|
306
|
+
);
|
|
307
|
+
};
|