@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,185 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
|
|
3
|
+
import type { GraphNode } from "../../app/canvas/types";
|
|
4
|
+
|
|
5
|
+
const LINE_MAX = 24;
|
|
6
|
+
const PILL_HEIGHT = 16;
|
|
7
|
+
const PILL_RX = 8;
|
|
8
|
+
const PILL_CHAR_WIDTH = 5.5;
|
|
9
|
+
const PILL_PADDING = 14;
|
|
10
|
+
const PILL_MAX_CHARS = 14;
|
|
11
|
+
|
|
12
|
+
const splitLabel = (label: string): [string] | [string, string] => {
|
|
13
|
+
if (label.length <= LINE_MAX) return [label];
|
|
14
|
+
// Try to break at a space near the midpoint
|
|
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 truncateToolName = (name: string): string => {
|
|
35
|
+
if (name.length <= PILL_MAX_CHARS) return name;
|
|
36
|
+
return `${name.slice(0, PILL_MAX_CHARS - 1)}…`;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
type SessionNodeProps = {
|
|
40
|
+
node: GraphNode;
|
|
41
|
+
isSelected: boolean;
|
|
42
|
+
onPointerDown: (e: React.PointerEvent, nodeId: string) => void;
|
|
43
|
+
onClick: (nodeId: string) => void;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const SessionNode = ({ node, isSelected, onPointerDown, onClick }: SessionNodeProps) => {
|
|
47
|
+
const isActive = node.type === "active-session" && node.hasUserPrompt !== false;
|
|
48
|
+
const isLive = isActive && node.agentState === "live";
|
|
49
|
+
const isWaiting =
|
|
50
|
+
node.agentRuntimeState === "waiting_for_permission" ||
|
|
51
|
+
node.agentRuntimeState === "waiting_for_user";
|
|
52
|
+
const color = isActive ? node.color : "#9ca3af";
|
|
53
|
+
const isWorktree = node.workspaceMode === "worktree" && !node.parentTerminalId;
|
|
54
|
+
const isSwarmWorker = !!node.parentTerminalId;
|
|
55
|
+
const lines = useMemo(() => splitLabel(node.label), [node.label]);
|
|
56
|
+
|
|
57
|
+
const pillLabel = useMemo(() => {
|
|
58
|
+
if (node.agentRuntimeState === "waiting_for_permission") {
|
|
59
|
+
return node.waitingToolName ? truncateToolName(node.waitingToolName) : "PERMISSION";
|
|
60
|
+
}
|
|
61
|
+
if (node.agentRuntimeState === "waiting_for_user") {
|
|
62
|
+
return "WAITING";
|
|
63
|
+
}
|
|
64
|
+
return "";
|
|
65
|
+
}, [node.agentRuntimeState, node.waitingToolName]);
|
|
66
|
+
|
|
67
|
+
const pillWidth = pillLabel.length * PILL_CHAR_WIDTH + PILL_PADDING;
|
|
68
|
+
const pillY = node.radius + 4;
|
|
69
|
+
const labelYOffset = isWaiting ? PILL_HEIGHT + 6 : 0;
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<g
|
|
73
|
+
className={`canvas-node canvas-node--session${isSelected ? " canvas-node--selected" : ""}${isActive ? " canvas-node--active" : " canvas-node--inactive"}`}
|
|
74
|
+
data-node-id={node.id}
|
|
75
|
+
transform={`translate(${node.x}, ${node.y})`}
|
|
76
|
+
onPointerDown={(e) => {
|
|
77
|
+
if (e.button !== 0) return;
|
|
78
|
+
e.stopPropagation();
|
|
79
|
+
onPointerDown(e, node.id);
|
|
80
|
+
}}
|
|
81
|
+
onClick={(e) => {
|
|
82
|
+
e.stopPropagation();
|
|
83
|
+
onClick(node.id);
|
|
84
|
+
}}
|
|
85
|
+
onKeyDown={(e) => {
|
|
86
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
e.stopPropagation();
|
|
89
|
+
onClick(node.id);
|
|
90
|
+
}}
|
|
91
|
+
style={{ cursor: "pointer" }}
|
|
92
|
+
>
|
|
93
|
+
{/* Worktree ring — dashed stroke */}
|
|
94
|
+
{isWorktree && (
|
|
95
|
+
<circle
|
|
96
|
+
className="canvas-node-ring canvas-node-ring--worktree"
|
|
97
|
+
r={node.radius + 6}
|
|
98
|
+
fill="none"
|
|
99
|
+
stroke={color}
|
|
100
|
+
/>
|
|
101
|
+
)}
|
|
102
|
+
|
|
103
|
+
{/* Swarm worker ring — double concentric circles */}
|
|
104
|
+
{isSwarmWorker && (
|
|
105
|
+
<>
|
|
106
|
+
<circle
|
|
107
|
+
className="canvas-node-ring canvas-node-ring--swarm"
|
|
108
|
+
r={node.radius + 5}
|
|
109
|
+
fill="none"
|
|
110
|
+
stroke={color}
|
|
111
|
+
/>
|
|
112
|
+
<circle
|
|
113
|
+
className="canvas-node-ring canvas-node-ring--swarm-outer"
|
|
114
|
+
r={node.radius + 9}
|
|
115
|
+
fill="none"
|
|
116
|
+
stroke={color}
|
|
117
|
+
/>
|
|
118
|
+
</>
|
|
119
|
+
)}
|
|
120
|
+
|
|
121
|
+
{/* Focused shine — accent glow when waiting, white otherwise */}
|
|
122
|
+
{isSelected && (
|
|
123
|
+
<circle
|
|
124
|
+
className="canvas-node-focus-glow"
|
|
125
|
+
r={node.radius + 12}
|
|
126
|
+
fill={isWaiting ? "#f59e0b" : "#ffffff"}
|
|
127
|
+
/>
|
|
128
|
+
)}
|
|
129
|
+
|
|
130
|
+
{/* Subtle glow halo — accent when waiting */}
|
|
131
|
+
<circle
|
|
132
|
+
className={`canvas-node-bloom${isLive || isWaiting ? " canvas-node-bloom--pulse" : ""}`}
|
|
133
|
+
r={node.radius + 3}
|
|
134
|
+
fill={isWaiting ? "#f59e0b" : color}
|
|
135
|
+
opacity={isWaiting ? 0.45 : isActive ? 0.25 : 0.1}
|
|
136
|
+
/>
|
|
137
|
+
|
|
138
|
+
{/* Bright core dot — accent when waiting */}
|
|
139
|
+
<circle
|
|
140
|
+
className="canvas-node-core"
|
|
141
|
+
r={node.radius}
|
|
142
|
+
fill={isWaiting ? "#f59e0b" : color}
|
|
143
|
+
opacity={isActive ? 1 : 0.4}
|
|
144
|
+
/>
|
|
145
|
+
|
|
146
|
+
{/* Waiting indicator pill */}
|
|
147
|
+
{isWaiting && (
|
|
148
|
+
<g className="canvas-node-waiting-indicator">
|
|
149
|
+
<rect
|
|
150
|
+
className="canvas-node-waiting-pill"
|
|
151
|
+
x={-pillWidth / 2}
|
|
152
|
+
y={pillY}
|
|
153
|
+
width={pillWidth}
|
|
154
|
+
height={PILL_HEIGHT}
|
|
155
|
+
rx={PILL_RX}
|
|
156
|
+
/>
|
|
157
|
+
<text
|
|
158
|
+
className="canvas-node-waiting-label"
|
|
159
|
+
y={pillY + PILL_HEIGHT / 2 + 3.5}
|
|
160
|
+
textAnchor="middle"
|
|
161
|
+
>
|
|
162
|
+
{pillLabel}
|
|
163
|
+
</text>
|
|
164
|
+
</g>
|
|
165
|
+
)}
|
|
166
|
+
|
|
167
|
+
{/* Label — always visible, up to two lines */}
|
|
168
|
+
<text
|
|
169
|
+
y={node.radius + 16 + labelYOffset}
|
|
170
|
+
textAnchor="middle"
|
|
171
|
+
className="canvas-node-label canvas-node-label--session canvas-node-label--always"
|
|
172
|
+
fill="var(--accent-primary)"
|
|
173
|
+
>
|
|
174
|
+
<tspan x="0" dy="0">
|
|
175
|
+
{lines[0]}
|
|
176
|
+
</tspan>
|
|
177
|
+
{lines[1] && (
|
|
178
|
+
<tspan x="0" dy="1.2em">
|
|
179
|
+
{lines[1]}
|
|
180
|
+
</tspan>
|
|
181
|
+
)}
|
|
182
|
+
</text>
|
|
183
|
+
</g>
|
|
184
|
+
);
|
|
185
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Check } from "lucide-react";
|
|
2
|
+
|
|
3
|
+
import type { TerminalAgentProvider } from "../../app/types";
|
|
4
|
+
import { OctopusGlyph } from "../EmptyOctopus";
|
|
5
|
+
|
|
6
|
+
export const AGENT_PROVIDER_OPTIONS: { value: TerminalAgentProvider; label: string }[] = [
|
|
7
|
+
{ value: "claude-code", label: "Cortex" },
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
export type ActionCardsProps = {
|
|
11
|
+
compact?: boolean;
|
|
12
|
+
selectedAgent: TerminalAgentProvider;
|
|
13
|
+
setSelectedAgent: (agent: TerminalAgentProvider) => void;
|
|
14
|
+
agentMenuOpen: boolean;
|
|
15
|
+
setAgentMenuOpen: (open: boolean | ((prev: boolean) => boolean)) => void;
|
|
16
|
+
agentMenuRef: React.RefObject<HTMLDivElement | null>;
|
|
17
|
+
onAddManually: () => void;
|
|
18
|
+
onLaunchAgent: () => void;
|
|
19
|
+
isLaunchingAgent?: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const ActionCards = ({
|
|
23
|
+
compact,
|
|
24
|
+
selectedAgent,
|
|
25
|
+
setSelectedAgent,
|
|
26
|
+
agentMenuOpen,
|
|
27
|
+
setAgentMenuOpen,
|
|
28
|
+
agentMenuRef,
|
|
29
|
+
onAddManually,
|
|
30
|
+
onLaunchAgent,
|
|
31
|
+
isLaunchingAgent,
|
|
32
|
+
}: ActionCardsProps) => (
|
|
33
|
+
<div className={`deck-empty-actions${compact ? " deck-empty-actions--compact" : ""}`}>
|
|
34
|
+
<button type="button" className="deck-empty-card" onClick={onAddManually}>
|
|
35
|
+
<div className="deck-empty-card-icon">
|
|
36
|
+
<OctopusGlyph
|
|
37
|
+
color="#d4a017"
|
|
38
|
+
animation="idle"
|
|
39
|
+
expression="normal"
|
|
40
|
+
accessory="none"
|
|
41
|
+
scale={compact ? 3 : 4}
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
<div className="deck-empty-card-text">
|
|
45
|
+
<span className="deck-empty-card-title">Create First Tentacle</span>
|
|
46
|
+
<span className="deck-empty-card-desc">
|
|
47
|
+
Start the deck by creating a tentacle for your codebase
|
|
48
|
+
</span>
|
|
49
|
+
</div>
|
|
50
|
+
</button>
|
|
51
|
+
<div className="deck-empty-card">
|
|
52
|
+
<span className="deck-empty-card-icon deck-empty-card-icon--terminal">>_</span>
|
|
53
|
+
<div className="deck-empty-card-text">
|
|
54
|
+
<span className="deck-empty-card-title">Open Agent</span>
|
|
55
|
+
<span className="deck-empty-card-desc">
|
|
56
|
+
Launch your coding agent to create tentacles based on your codebase
|
|
57
|
+
</span>
|
|
58
|
+
<div className="deck-empty-agent-select-row">
|
|
59
|
+
<div className="deck-empty-agent-picker" ref={agentMenuRef}>
|
|
60
|
+
<button
|
|
61
|
+
type="button"
|
|
62
|
+
className="deck-empty-agent-trigger"
|
|
63
|
+
aria-expanded={agentMenuOpen}
|
|
64
|
+
aria-haspopup="menu"
|
|
65
|
+
onClick={() => setAgentMenuOpen((p: boolean) => !p)}
|
|
66
|
+
>
|
|
67
|
+
{AGENT_PROVIDER_OPTIONS.find((o) => o.value === selectedAgent)?.label}
|
|
68
|
+
<svg className="deck-empty-agent-chevron" viewBox="0 0 10 6" aria-hidden="true">
|
|
69
|
+
<path d="M1 1l4 4 4-4" fill="none" stroke="currentColor" strokeWidth="1.5" />
|
|
70
|
+
</svg>
|
|
71
|
+
</button>
|
|
72
|
+
{agentMenuOpen && (
|
|
73
|
+
<div className="deck-empty-agent-menu" role="menu">
|
|
74
|
+
{AGENT_PROVIDER_OPTIONS.map((opt) => (
|
|
75
|
+
<button
|
|
76
|
+
key={opt.value}
|
|
77
|
+
type="button"
|
|
78
|
+
className="deck-empty-agent-menu-item"
|
|
79
|
+
role="menuitem"
|
|
80
|
+
data-active={opt.value === selectedAgent ? "true" : "false"}
|
|
81
|
+
onClick={() => {
|
|
82
|
+
setSelectedAgent(opt.value);
|
|
83
|
+
setAgentMenuOpen(false);
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
{opt.label}
|
|
87
|
+
{opt.value === selectedAgent && (
|
|
88
|
+
<span className="deck-empty-agent-menu-check">
|
|
89
|
+
<Check size={12} />
|
|
90
|
+
</span>
|
|
91
|
+
)}
|
|
92
|
+
</button>
|
|
93
|
+
))}
|
|
94
|
+
</div>
|
|
95
|
+
)}
|
|
96
|
+
</div>
|
|
97
|
+
<button
|
|
98
|
+
type="button"
|
|
99
|
+
className="deck-empty-agent-launch"
|
|
100
|
+
disabled={isLaunchingAgent}
|
|
101
|
+
onClick={onLaunchAgent}
|
|
102
|
+
>
|
|
103
|
+
{isLaunchingAgent ? "..." : "Launch"}
|
|
104
|
+
</button>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
<button type="button" className="deck-empty-card" onClick={onAddManually}>
|
|
109
|
+
<span className="deck-empty-card-icon deck-empty-card-icon--terminal">+</span>
|
|
110
|
+
<div className="deck-empty-card-text">
|
|
111
|
+
<span className="deck-empty-card-title">Add Tentacle Manually</span>
|
|
112
|
+
<span className="deck-empty-card-desc">
|
|
113
|
+
Create a custom tentacle with your own configuration
|
|
114
|
+
</span>
|
|
115
|
+
</div>
|
|
116
|
+
</button>
|
|
117
|
+
</div>
|
|
118
|
+
);
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import type { DeckAvailableSkill } from "@octogent/core";
|
|
4
|
+
import type { OctopusAccessory, OctopusAnimation, OctopusExpression } from "../EmptyOctopus";
|
|
5
|
+
import { OctopusGlyph } from "../EmptyOctopus";
|
|
6
|
+
import { ACCESSORIES, ANIMATIONS, EXPRESSIONS, OCTOPUS_COLORS } from "./octopusVisuals";
|
|
7
|
+
|
|
8
|
+
// ─── Add tentacle form ───────────────────────────────────────────────────────
|
|
9
|
+
|
|
10
|
+
export type OctopusAppearancePayload = {
|
|
11
|
+
animation: string;
|
|
12
|
+
expression: string;
|
|
13
|
+
accessory: string;
|
|
14
|
+
hairColor: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type AddTentacleFormProps = {
|
|
18
|
+
onSubmit: (
|
|
19
|
+
name: string,
|
|
20
|
+
description: string,
|
|
21
|
+
color: string,
|
|
22
|
+
octopus: OctopusAppearancePayload,
|
|
23
|
+
suggestedSkills: string[],
|
|
24
|
+
) => void;
|
|
25
|
+
onCancel: () => void;
|
|
26
|
+
isSubmitting: boolean;
|
|
27
|
+
error: string | null;
|
|
28
|
+
availableSkills: DeckAvailableSkill[];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const EXPRESSION_OPTIONS: { value: OctopusExpression; label: string }[] = [
|
|
32
|
+
{ value: "normal", label: "Normal" },
|
|
33
|
+
{ value: "happy", label: "Happy" },
|
|
34
|
+
{ value: "angry", label: "Angry" },
|
|
35
|
+
{ value: "surprised", label: "Surprised" },
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
export const ACCESSORY_OPTIONS: { value: OctopusAccessory; label: string }[] = [
|
|
39
|
+
{ value: "none", label: "None" },
|
|
40
|
+
{ value: "long", label: "Long" },
|
|
41
|
+
{ value: "mohawk", label: "Mohawk" },
|
|
42
|
+
{ value: "side-sweep", label: "Side Sweep" },
|
|
43
|
+
{ value: "curly", label: "Curly" },
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
export const HAIR_COLORS = [
|
|
47
|
+
"#4a2c0a",
|
|
48
|
+
"#1a1a1a",
|
|
49
|
+
"#c8a04a",
|
|
50
|
+
"#e04020",
|
|
51
|
+
"#f5f5f5",
|
|
52
|
+
"#6b3fa0",
|
|
53
|
+
"#2a6e3f",
|
|
54
|
+
"#1e90ff",
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
export const AddTentacleForm = ({
|
|
58
|
+
onSubmit,
|
|
59
|
+
onCancel,
|
|
60
|
+
isSubmitting,
|
|
61
|
+
error,
|
|
62
|
+
availableSkills,
|
|
63
|
+
}: AddTentacleFormProps) => {
|
|
64
|
+
const [name, setName] = useState("");
|
|
65
|
+
const [description, setDescription] = useState("");
|
|
66
|
+
const [selectedColor, setSelectedColor] = useState(
|
|
67
|
+
() => OCTOPUS_COLORS[Math.floor(Math.random() * OCTOPUS_COLORS.length)] as string,
|
|
68
|
+
);
|
|
69
|
+
const [selectedExpression, setSelectedExpression] = useState<OctopusExpression>(() => {
|
|
70
|
+
const pick = EXPRESSIONS[Math.floor(Math.random() * EXPRESSIONS.length)] as OctopusExpression;
|
|
71
|
+
return pick;
|
|
72
|
+
});
|
|
73
|
+
const [selectedAccessory, setSelectedAccessory] = useState<OctopusAccessory>(() => {
|
|
74
|
+
const pick = ACCESSORIES[Math.floor(Math.random() * ACCESSORIES.length)] as OctopusAccessory;
|
|
75
|
+
return pick;
|
|
76
|
+
});
|
|
77
|
+
const [selectedAnimation] = useState<OctopusAnimation>(() => {
|
|
78
|
+
const pick = ANIMATIONS[Math.floor(Math.random() * ANIMATIONS.length)] as OctopusAnimation;
|
|
79
|
+
return pick;
|
|
80
|
+
});
|
|
81
|
+
const [selectedHairColor, setSelectedHairColor] = useState(
|
|
82
|
+
() => HAIR_COLORS[Math.floor(Math.random() * HAIR_COLORS.length)] as string,
|
|
83
|
+
);
|
|
84
|
+
const [selectedSkills, setSelectedSkills] = useState<string[]>([]);
|
|
85
|
+
const nameRef = useRef<HTMLInputElement>(null);
|
|
86
|
+
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
nameRef.current?.focus();
|
|
89
|
+
}, []);
|
|
90
|
+
|
|
91
|
+
const handleSubmit = (e: React.FormEvent) => {
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
if (name.trim().length === 0) return;
|
|
94
|
+
onSubmit(
|
|
95
|
+
name.trim(),
|
|
96
|
+
description.trim(),
|
|
97
|
+
selectedColor,
|
|
98
|
+
{
|
|
99
|
+
animation: selectedAnimation,
|
|
100
|
+
expression: selectedExpression,
|
|
101
|
+
accessory: selectedAccessory,
|
|
102
|
+
hairColor: selectedHairColor,
|
|
103
|
+
},
|
|
104
|
+
selectedSkills,
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const toggleSkill = (skillName: string) => {
|
|
109
|
+
setSelectedSkills((current) =>
|
|
110
|
+
current.includes(skillName)
|
|
111
|
+
? current.filter((skill) => skill !== skillName)
|
|
112
|
+
: [...current, skillName].sort((a, b) => a.localeCompare(b)),
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<form className="deck-add-form" onSubmit={handleSubmit}>
|
|
118
|
+
<div className="deck-add-form-header">
|
|
119
|
+
<button type="button" className="deck-add-form-back" onClick={onCancel}>
|
|
120
|
+
← Back
|
|
121
|
+
</button>
|
|
122
|
+
<span className="deck-add-form-title">New Tentacle</span>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<div className="deck-add-form-body">
|
|
126
|
+
<div className="deck-add-form-preview">
|
|
127
|
+
<OctopusGlyph
|
|
128
|
+
color={selectedColor}
|
|
129
|
+
animation={selectedAnimation}
|
|
130
|
+
expression={selectedExpression}
|
|
131
|
+
accessory={selectedAccessory}
|
|
132
|
+
hairColor={selectedHairColor}
|
|
133
|
+
scale={8}
|
|
134
|
+
/>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
<label className="deck-add-form-label">
|
|
138
|
+
Name
|
|
139
|
+
<input
|
|
140
|
+
ref={nameRef}
|
|
141
|
+
type="text"
|
|
142
|
+
className="deck-add-form-input"
|
|
143
|
+
value={name}
|
|
144
|
+
onChange={(e) => setName(e.target.value)}
|
|
145
|
+
placeholder="e.g. Database Layer"
|
|
146
|
+
/>
|
|
147
|
+
</label>
|
|
148
|
+
|
|
149
|
+
<label className="deck-add-form-label">
|
|
150
|
+
Description
|
|
151
|
+
<textarea
|
|
152
|
+
className="deck-add-form-textarea"
|
|
153
|
+
value={description}
|
|
154
|
+
onChange={(e) => setDescription(e.target.value)}
|
|
155
|
+
placeholder="What this tentacle is responsible for..."
|
|
156
|
+
rows={3}
|
|
157
|
+
/>
|
|
158
|
+
</label>
|
|
159
|
+
|
|
160
|
+
{availableSkills.length > 0 && (
|
|
161
|
+
<div className="deck-add-form-label">
|
|
162
|
+
Suggested Skills
|
|
163
|
+
<div className="deck-add-form-skills">
|
|
164
|
+
{availableSkills.map((skill) => {
|
|
165
|
+
const checked = selectedSkills.includes(skill.name);
|
|
166
|
+
return (
|
|
167
|
+
<label
|
|
168
|
+
key={`${skill.source}:${skill.name}`}
|
|
169
|
+
className="deck-add-form-skill-option"
|
|
170
|
+
>
|
|
171
|
+
<input
|
|
172
|
+
type="checkbox"
|
|
173
|
+
checked={checked}
|
|
174
|
+
onChange={() => toggleSkill(skill.name)}
|
|
175
|
+
/>
|
|
176
|
+
<span className="deck-add-form-skill-copy">
|
|
177
|
+
<span className="deck-add-form-skill-name">{skill.name}</span>
|
|
178
|
+
{skill.description && (
|
|
179
|
+
<span className="deck-add-form-skill-desc">{skill.description}</span>
|
|
180
|
+
)}
|
|
181
|
+
</span>
|
|
182
|
+
</label>
|
|
183
|
+
);
|
|
184
|
+
})}
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
)}
|
|
188
|
+
|
|
189
|
+
<div className="deck-add-form-label">
|
|
190
|
+
Color
|
|
191
|
+
<div className="deck-add-form-colors">
|
|
192
|
+
{OCTOPUS_COLORS.map((c) => (
|
|
193
|
+
<button
|
|
194
|
+
key={c}
|
|
195
|
+
type="button"
|
|
196
|
+
className="deck-add-form-color-swatch"
|
|
197
|
+
data-selected={c === selectedColor ? "true" : "false"}
|
|
198
|
+
style={{ backgroundColor: c }}
|
|
199
|
+
onClick={() => setSelectedColor(c)}
|
|
200
|
+
aria-label={`Select color ${c}`}
|
|
201
|
+
/>
|
|
202
|
+
))}
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
|
|
206
|
+
<div className="deck-add-form-row">
|
|
207
|
+
<div className="deck-add-form-label">
|
|
208
|
+
Expression
|
|
209
|
+
<div className="deck-add-form-chips">
|
|
210
|
+
{EXPRESSION_OPTIONS.map((opt) => (
|
|
211
|
+
<button
|
|
212
|
+
key={opt.value}
|
|
213
|
+
type="button"
|
|
214
|
+
className="deck-add-form-chip"
|
|
215
|
+
data-selected={opt.value === selectedExpression ? "true" : "false"}
|
|
216
|
+
onClick={() => setSelectedExpression(opt.value)}
|
|
217
|
+
>
|
|
218
|
+
{opt.label}
|
|
219
|
+
</button>
|
|
220
|
+
))}
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
<div className="deck-add-form-label">
|
|
224
|
+
Hair Style
|
|
225
|
+
<div className="deck-add-form-chips">
|
|
226
|
+
{ACCESSORY_OPTIONS.map((opt) => (
|
|
227
|
+
<button
|
|
228
|
+
key={opt.value}
|
|
229
|
+
type="button"
|
|
230
|
+
className="deck-add-form-chip"
|
|
231
|
+
data-selected={opt.value === selectedAccessory ? "true" : "false"}
|
|
232
|
+
onClick={() => setSelectedAccessory(opt.value)}
|
|
233
|
+
>
|
|
234
|
+
{opt.label}
|
|
235
|
+
</button>
|
|
236
|
+
))}
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
<div className="deck-add-form-label">
|
|
240
|
+
Hair Color
|
|
241
|
+
<div className="deck-add-form-colors">
|
|
242
|
+
{HAIR_COLORS.map((c) => (
|
|
243
|
+
<button
|
|
244
|
+
key={c}
|
|
245
|
+
type="button"
|
|
246
|
+
className="deck-add-form-color-swatch deck-add-form-color-swatch--small"
|
|
247
|
+
data-selected={c === selectedHairColor ? "true" : "false"}
|
|
248
|
+
style={{ backgroundColor: c }}
|
|
249
|
+
onClick={() => setSelectedHairColor(c)}
|
|
250
|
+
aria-label={`Select hair color ${c}`}
|
|
251
|
+
/>
|
|
252
|
+
))}
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
|
|
257
|
+
{error && <div className="deck-add-form-error">{error}</div>}
|
|
258
|
+
|
|
259
|
+
<button
|
|
260
|
+
type="submit"
|
|
261
|
+
className="deck-add-form-submit"
|
|
262
|
+
disabled={isSubmitting || name.trim().length === 0}
|
|
263
|
+
>
|
|
264
|
+
{isSubmitting ? "Creating..." : "Create Tentacle"}
|
|
265
|
+
</button>
|
|
266
|
+
</div>
|
|
267
|
+
</form>
|
|
268
|
+
);
|
|
269
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
|
|
3
|
+
// ─── Bottom actions (compact cards + clear all for populated state) ──────────
|
|
4
|
+
|
|
5
|
+
export type DeckBottomActionsProps = {
|
|
6
|
+
onClearAll: () => void;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const DeckBottomActions = ({ onClearAll }: DeckBottomActionsProps) => {
|
|
10
|
+
const [confirmingClear, setConfirmingClear] = useState(false);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div className="deck-sidebar-clear">
|
|
14
|
+
{confirmingClear ? (
|
|
15
|
+
<div className="deck-bottom-clear-confirm">
|
|
16
|
+
<span className="deck-bottom-clear-label">Clear all tentacles?</span>
|
|
17
|
+
<button
|
|
18
|
+
type="button"
|
|
19
|
+
className="deck-bottom-clear-btn deck-bottom-clear-btn--danger"
|
|
20
|
+
onClick={() => {
|
|
21
|
+
onClearAll();
|
|
22
|
+
setConfirmingClear(false);
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
Confirm
|
|
26
|
+
</button>
|
|
27
|
+
<button
|
|
28
|
+
type="button"
|
|
29
|
+
className="deck-bottom-clear-btn"
|
|
30
|
+
onClick={() => setConfirmingClear(false)}
|
|
31
|
+
>
|
|
32
|
+
Cancel
|
|
33
|
+
</button>
|
|
34
|
+
</div>
|
|
35
|
+
) : (
|
|
36
|
+
<button
|
|
37
|
+
type="button"
|
|
38
|
+
className="deck-bottom-clear-link"
|
|
39
|
+
onClick={() => setConfirmingClear(true)}
|
|
40
|
+
>
|
|
41
|
+
<svg className="deck-bottom-clear-icon" viewBox="0 0 16 16" aria-hidden="true">
|
|
42
|
+
<path
|
|
43
|
+
d="M5.5 1.5h5M2 4h12M6 7v5M10 7v5M3.5 4l.75 9.5a1 1 0 001 .9h5.5a1 1 0 001-.9L12.5 4"
|
|
44
|
+
fill="none"
|
|
45
|
+
stroke="currentColor"
|
|
46
|
+
strokeWidth="1.3"
|
|
47
|
+
strokeLinecap="round"
|
|
48
|
+
strokeLinejoin="round"
|
|
49
|
+
/>
|
|
50
|
+
</svg>
|
|
51
|
+
Clear All
|
|
52
|
+
</button>
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
};
|