@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,109 @@
|
|
|
1
|
+
import { cleanup, fireEvent, render, screen } from "@testing-library/react";
|
|
2
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
3
|
+
|
|
4
|
+
import { App } from "../src/App";
|
|
5
|
+
import { jsonResponse, notFoundResponse, resetAppTestHarness } from "./test-utils/appTestHarness";
|
|
6
|
+
|
|
7
|
+
const mockShellRequests = () => {
|
|
8
|
+
vi.spyOn(globalThis, "fetch").mockImplementation(async (input, init) => {
|
|
9
|
+
const url = String(input);
|
|
10
|
+
const method = init?.method ?? "GET";
|
|
11
|
+
|
|
12
|
+
if (url.endsWith("/api/terminal-snapshots") && method === "GET") {
|
|
13
|
+
return jsonResponse([]);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (url.endsWith("/api/codex/usage") && method === "GET") {
|
|
17
|
+
return jsonResponse({
|
|
18
|
+
status: "unavailable",
|
|
19
|
+
source: "none",
|
|
20
|
+
fetchedAt: "2026-02-27T12:00:00.000Z",
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (url.endsWith("/api/claude/usage") && method === "GET") {
|
|
25
|
+
return jsonResponse({
|
|
26
|
+
status: "unavailable",
|
|
27
|
+
source: "none",
|
|
28
|
+
fetchedAt: "2026-02-27T12:00:00.000Z",
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (url.endsWith("/api/github/summary") && method === "GET") {
|
|
33
|
+
return jsonResponse({
|
|
34
|
+
status: "unavailable",
|
|
35
|
+
source: "none",
|
|
36
|
+
fetchedAt: "2026-02-27T12:00:00.000Z",
|
|
37
|
+
commitsPerDay: [],
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (url.includes("/api/analytics/usage-heatmap") && method === "GET") {
|
|
42
|
+
return jsonResponse({
|
|
43
|
+
days: [],
|
|
44
|
+
projects: [],
|
|
45
|
+
models: [],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (url.endsWith("/api/ui-state") && method === "GET") {
|
|
50
|
+
return jsonResponse({});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return notFoundResponse();
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
describe("App shell and navigation", () => {
|
|
58
|
+
afterEach(() => {
|
|
59
|
+
cleanup();
|
|
60
|
+
resetAppTestHarness();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("renders the current shell chrome with navigation hints", async () => {
|
|
64
|
+
mockShellRequests();
|
|
65
|
+
|
|
66
|
+
render(<App />);
|
|
67
|
+
|
|
68
|
+
expect(await screen.findByLabelText("Runtime status strip")).toBeInTheDocument();
|
|
69
|
+
expect(screen.getByRole("navigation", { name: "Primary navigation" })).toBeInTheDocument();
|
|
70
|
+
expect(screen.getByLabelText("Main content canvas")).toBeInTheDocument();
|
|
71
|
+
expect(screen.getByLabelText("Telemetry ticker tape")).toBeInTheDocument();
|
|
72
|
+
expect(screen.queryByLabelText("Active Agents sidebar")).not.toBeInTheDocument();
|
|
73
|
+
expect(screen.getByText("Press 1-8 to navigate")).toBeInTheDocument();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("supports keyboard-first primary navigation with number keys 1-8", async () => {
|
|
77
|
+
mockShellRequests();
|
|
78
|
+
|
|
79
|
+
render(<App />);
|
|
80
|
+
await screen.findByRole("navigation", { name: "Primary navigation" });
|
|
81
|
+
|
|
82
|
+
fireEvent.keyDown(window, { key: "4" });
|
|
83
|
+
|
|
84
|
+
expect(
|
|
85
|
+
screen.getByRole("button", {
|
|
86
|
+
name: "[4] Code Intel",
|
|
87
|
+
}),
|
|
88
|
+
).toHaveAttribute("aria-current", "page");
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("renders settings panel when navigating to settings tab", async () => {
|
|
92
|
+
mockShellRequests();
|
|
93
|
+
|
|
94
|
+
render(<App />);
|
|
95
|
+
await screen.findByRole("navigation", { name: "Primary navigation" });
|
|
96
|
+
|
|
97
|
+
fireEvent.click(
|
|
98
|
+
screen.getByRole("button", {
|
|
99
|
+
name: "[8] Settings",
|
|
100
|
+
}),
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
expect(await screen.findByLabelText("Settings primary view")).toBeInTheDocument();
|
|
104
|
+
expect(screen.getByRole("button", { name: /Soft chime/i })).toBeInTheDocument();
|
|
105
|
+
expect(screen.getByRole("button", { name: /Retro beep/i })).toBeInTheDocument();
|
|
106
|
+
expect(screen.getByRole("switch", { name: "Show runtime status strip" })).toBeInTheDocument();
|
|
107
|
+
expect(screen.getByRole("switch", { name: "Enable X Monitor" })).toBeInTheDocument();
|
|
108
|
+
});
|
|
109
|
+
});
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
|
|
2
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
3
|
+
|
|
4
|
+
import { MockWebSocket, resetAppTestHarness } from "./test-utils/appTestHarness";
|
|
5
|
+
|
|
6
|
+
const persistedUiStateMock = {
|
|
7
|
+
activePrimaryNav: 2 as const,
|
|
8
|
+
setActivePrimaryNav: vi.fn(),
|
|
9
|
+
applyHydratedUiState: vi.fn(),
|
|
10
|
+
isActiveAgentsSectionExpanded: true,
|
|
11
|
+
isAgentsSidebarVisible: false,
|
|
12
|
+
isBottomTelemetryVisible: false,
|
|
13
|
+
isClaudeUsageSectionExpanded: true,
|
|
14
|
+
isCodexUsageSectionExpanded: true,
|
|
15
|
+
isMonitorVisible: false,
|
|
16
|
+
isRuntimeStatusStripVisible: false,
|
|
17
|
+
isUiStateHydrated: true,
|
|
18
|
+
minimizedTerminalIds: [] as string[],
|
|
19
|
+
readUiState: vi.fn(),
|
|
20
|
+
setIsActiveAgentsSectionExpanded: vi.fn(),
|
|
21
|
+
setIsAgentsSidebarVisible: vi.fn(),
|
|
22
|
+
setIsBottomTelemetryVisible: vi.fn(),
|
|
23
|
+
setIsClaudeUsageSectionExpanded: vi.fn(),
|
|
24
|
+
setIsCodexUsageSectionExpanded: vi.fn(),
|
|
25
|
+
setIsMonitorVisible: vi.fn(),
|
|
26
|
+
setIsRuntimeStatusStripVisible: vi.fn(),
|
|
27
|
+
setIsUiStateHydrated: vi.fn(),
|
|
28
|
+
setMinimizedTerminalIds: vi.fn(),
|
|
29
|
+
setSidebarWidth: vi.fn(),
|
|
30
|
+
setTerminalCompletionSound: vi.fn(),
|
|
31
|
+
sidebarWidth: 280,
|
|
32
|
+
terminalCompletionSound: "pop" as const,
|
|
33
|
+
canvasOpenTerminalIds: [] as string[],
|
|
34
|
+
setCanvasOpenTerminalIds: vi.fn(),
|
|
35
|
+
canvasOpenTentacleIds: [] as string[],
|
|
36
|
+
setCanvasOpenTentacleIds: vi.fn(),
|
|
37
|
+
canvasTerminalsPanelWidth: null as number | null,
|
|
38
|
+
setCanvasTerminalsPanelWidth: vi.fn(),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
vi.mock("../src/app/hooks/useBackendLivenessPolling", () => ({
|
|
42
|
+
useBackendLivenessPolling: () => "online",
|
|
43
|
+
}));
|
|
44
|
+
|
|
45
|
+
vi.mock("../src/app/hooks/useClaudeUsagePolling", () => ({
|
|
46
|
+
useClaudeUsagePolling: () => ({
|
|
47
|
+
claudeUsageSnapshot: null,
|
|
48
|
+
isRefreshingClaudeUsage: false,
|
|
49
|
+
refreshClaudeUsage: vi.fn(),
|
|
50
|
+
}),
|
|
51
|
+
}));
|
|
52
|
+
|
|
53
|
+
vi.mock("../src/app/hooks/useCodexUsagePolling", () => ({
|
|
54
|
+
useCodexUsagePolling: () => ({
|
|
55
|
+
codexUsageSnapshot: null,
|
|
56
|
+
refreshCodexUsage: vi.fn(),
|
|
57
|
+
}),
|
|
58
|
+
}));
|
|
59
|
+
|
|
60
|
+
vi.mock("../src/app/hooks/useConsoleKeyboardShortcuts", () => ({
|
|
61
|
+
useConsoleKeyboardShortcuts: () => {},
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
vi.mock("../src/app/hooks/useGitHubPrimaryViewModel", () => ({
|
|
65
|
+
useGitHubPrimaryViewModel: () => ({
|
|
66
|
+
githubCommitCount30d: "0",
|
|
67
|
+
sparklinePoints: [],
|
|
68
|
+
githubOverviewGraphSeries: [],
|
|
69
|
+
githubOverviewGraphPolylinePoints: "",
|
|
70
|
+
githubOverviewHoverLabel: null,
|
|
71
|
+
githubStatusPill: null,
|
|
72
|
+
githubRepoLabel: "",
|
|
73
|
+
githubStarCountLabel: "",
|
|
74
|
+
githubOpenIssuesLabel: "",
|
|
75
|
+
githubOpenPrsLabel: "",
|
|
76
|
+
githubRecentCommits: [],
|
|
77
|
+
}),
|
|
78
|
+
}));
|
|
79
|
+
|
|
80
|
+
vi.mock("../src/app/hooks/useGithubSummaryPolling", () => ({
|
|
81
|
+
useGithubSummaryPolling: () => ({
|
|
82
|
+
githubRepoSummary: null,
|
|
83
|
+
isRefreshingGitHubSummary: false,
|
|
84
|
+
refreshGitHubRepoSummary: vi.fn(),
|
|
85
|
+
}),
|
|
86
|
+
}));
|
|
87
|
+
|
|
88
|
+
vi.mock("../src/app/hooks/useInitialColumnsHydration", async () => {
|
|
89
|
+
const React = await import("react");
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
useInitialColumnsHydration: ({
|
|
93
|
+
setColumns,
|
|
94
|
+
setIsLoading,
|
|
95
|
+
setIsUiStateHydrated,
|
|
96
|
+
}: {
|
|
97
|
+
setColumns: (value: []) => void;
|
|
98
|
+
setIsLoading: (value: boolean) => void;
|
|
99
|
+
setIsUiStateHydrated: (value: boolean) => void;
|
|
100
|
+
}) => {
|
|
101
|
+
React.useEffect(() => {
|
|
102
|
+
setColumns([]);
|
|
103
|
+
setIsLoading(false);
|
|
104
|
+
setIsUiStateHydrated(true);
|
|
105
|
+
}, [setColumns, setIsLoading, setIsUiStateHydrated]);
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
vi.mock("../src/app/hooks/useMonitorRuntime", () => ({
|
|
111
|
+
useMonitorRuntime: () => null,
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
vi.mock("../src/app/hooks/usePersistedUiState", () => ({
|
|
115
|
+
usePersistedUiState: () => persistedUiStateMock,
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
vi.mock("../src/app/hooks/useTentacleGitLifecycle", () => ({
|
|
119
|
+
useTentacleGitLifecycle: () => ({
|
|
120
|
+
gitStatusByTentacleId: new Map(),
|
|
121
|
+
gitStatusLoadingByTentacleId: new Map(),
|
|
122
|
+
pullRequestByTentacleId: new Map(),
|
|
123
|
+
pullRequestLoadingByTentacleId: new Map(),
|
|
124
|
+
openGitTentacleId: null,
|
|
125
|
+
openGitTentacleStatus: null,
|
|
126
|
+
openGitTentaclePullRequest: null,
|
|
127
|
+
gitCommitMessageDraft: "",
|
|
128
|
+
gitDialogError: null,
|
|
129
|
+
isGitDialogLoading: false,
|
|
130
|
+
isGitDialogMutating: false,
|
|
131
|
+
setGitCommitMessageDraft: vi.fn(),
|
|
132
|
+
openTentacleGitActions: vi.fn(),
|
|
133
|
+
closeTentacleGitActions: vi.fn(),
|
|
134
|
+
commitTentacleChanges: vi.fn(),
|
|
135
|
+
commitAndPushTentacleBranch: vi.fn(),
|
|
136
|
+
pushTentacleBranch: vi.fn(),
|
|
137
|
+
syncTentacleBranch: vi.fn(),
|
|
138
|
+
mergeTentaclePullRequest: vi.fn(),
|
|
139
|
+
}),
|
|
140
|
+
}));
|
|
141
|
+
|
|
142
|
+
vi.mock("../src/app/hooks/useTerminalCompletionNotification", () => ({
|
|
143
|
+
useTerminalCompletionNotification: () => ({
|
|
144
|
+
playCompletionSoundPreview: vi.fn(),
|
|
145
|
+
}),
|
|
146
|
+
}));
|
|
147
|
+
|
|
148
|
+
vi.mock("../src/app/hooks/useTerminalMutations", () => ({
|
|
149
|
+
useTerminalMutations: () => ({
|
|
150
|
+
clearPendingDeleteTerminal: vi.fn(),
|
|
151
|
+
confirmDeleteTerminal: vi.fn(),
|
|
152
|
+
createTerminal: vi.fn(),
|
|
153
|
+
isCreatingTerminal: false,
|
|
154
|
+
isDeletingTerminalId: null,
|
|
155
|
+
pendingDeleteTerminal: null,
|
|
156
|
+
requestDeleteTerminal: vi.fn(),
|
|
157
|
+
}),
|
|
158
|
+
}));
|
|
159
|
+
|
|
160
|
+
vi.mock("../src/app/hooks/useTerminalStateReconciliation", () => ({
|
|
161
|
+
useTerminalStateReconciliation: () => {},
|
|
162
|
+
}));
|
|
163
|
+
|
|
164
|
+
vi.mock("../src/app/hooks/useUsageHeatmapPolling", () => ({
|
|
165
|
+
useUsageHeatmapPolling: () => ({
|
|
166
|
+
heatmapData: [],
|
|
167
|
+
isLoadingHeatmap: false,
|
|
168
|
+
refreshHeatmap: vi.fn(),
|
|
169
|
+
}),
|
|
170
|
+
}));
|
|
171
|
+
|
|
172
|
+
vi.mock("../src/components/ActiveAgentsSidebar", () => ({
|
|
173
|
+
ActiveAgentsSidebar: () => null,
|
|
174
|
+
}));
|
|
175
|
+
|
|
176
|
+
vi.mock("../src/components/ConsolePrimaryNav", () => ({
|
|
177
|
+
ConsolePrimaryNav: () => null,
|
|
178
|
+
}));
|
|
179
|
+
|
|
180
|
+
vi.mock("../src/components/PrimaryViewRouter", () => ({
|
|
181
|
+
PrimaryViewRouter: ({
|
|
182
|
+
canvasPrimaryViewProps,
|
|
183
|
+
}: {
|
|
184
|
+
canvasPrimaryViewProps: {
|
|
185
|
+
onSpawnSwarm?: (tentacleId: string, workspaceMode: "shared" | "worktree") => Promise<void>;
|
|
186
|
+
onSolveTodoItem?: ((tentacleId: string, itemIndex: number) => Promise<void>) | undefined;
|
|
187
|
+
};
|
|
188
|
+
}) => (
|
|
189
|
+
<div>
|
|
190
|
+
<button
|
|
191
|
+
type="button"
|
|
192
|
+
onClick={() => void canvasPrimaryViewProps.onSpawnSwarm?.("docs-knowledge", "shared")}
|
|
193
|
+
>
|
|
194
|
+
Spawn Swarm
|
|
195
|
+
</button>
|
|
196
|
+
<span>
|
|
197
|
+
{canvasPrimaryViewProps.onSolveTodoItem
|
|
198
|
+
? "solve callback present"
|
|
199
|
+
: "solve callback omitted"}
|
|
200
|
+
</span>
|
|
201
|
+
</div>
|
|
202
|
+
),
|
|
203
|
+
}));
|
|
204
|
+
|
|
205
|
+
vi.mock("../src/components/RuntimeStatusStrip", () => ({
|
|
206
|
+
RuntimeStatusStrip: () => null,
|
|
207
|
+
}));
|
|
208
|
+
|
|
209
|
+
vi.mock("../src/components/SidebarActionPanel", () => ({
|
|
210
|
+
SidebarActionPanel: () => null,
|
|
211
|
+
}));
|
|
212
|
+
|
|
213
|
+
vi.mock("../src/components/TelemetryTape", () => ({
|
|
214
|
+
TelemetryTape: () => null,
|
|
215
|
+
}));
|
|
216
|
+
|
|
217
|
+
import { App } from "../src/App";
|
|
218
|
+
|
|
219
|
+
describe("App swarm actions", () => {
|
|
220
|
+
afterEach(() => {
|
|
221
|
+
cleanup();
|
|
222
|
+
resetAppTestHarness();
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it("does not force a terminal snapshot refresh after spawning a swarm", async () => {
|
|
226
|
+
vi.stubGlobal("WebSocket", MockWebSocket as unknown as typeof WebSocket);
|
|
227
|
+
|
|
228
|
+
let terminalSnapshotReads = 0;
|
|
229
|
+
const fetchMock = vi.spyOn(globalThis, "fetch").mockImplementation(async (input, init) => {
|
|
230
|
+
const url = String(input);
|
|
231
|
+
const method = init?.method ?? "GET";
|
|
232
|
+
|
|
233
|
+
if (url.endsWith("/api/terminal-snapshots") && method === "GET") {
|
|
234
|
+
terminalSnapshotReads += 1;
|
|
235
|
+
return new Response("[]", {
|
|
236
|
+
status: 200,
|
|
237
|
+
headers: { "Content-Type": "application/json" },
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (url.endsWith("/api/deck/tentacles/docs-knowledge/swarm") && method === "POST") {
|
|
242
|
+
return new Response(JSON.stringify({ ok: true }), {
|
|
243
|
+
status: 201,
|
|
244
|
+
headers: { "Content-Type": "application/json" },
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return new Response("not-found", { status: 404 });
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
render(<App />);
|
|
252
|
+
|
|
253
|
+
expect(screen.getByText("solve callback omitted")).toBeInTheDocument();
|
|
254
|
+
fireEvent.click(screen.getByRole("button", { name: "Spawn Swarm" }));
|
|
255
|
+
|
|
256
|
+
await waitFor(() => {
|
|
257
|
+
expect(
|
|
258
|
+
fetchMock.mock.calls.some(
|
|
259
|
+
([calledUrl, calledInit]) =>
|
|
260
|
+
String(calledUrl).endsWith("/api/deck/tentacles/docs-knowledge/swarm") &&
|
|
261
|
+
(calledInit?.method ?? "GET") === "POST",
|
|
262
|
+
),
|
|
263
|
+
).toBe(true);
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
expect(terminalSnapshotReads).toBe(0);
|
|
267
|
+
});
|
|
268
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";
|
|
2
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
3
|
+
|
|
4
|
+
import { App } from "../src/App";
|
|
5
|
+
import { jsonResponse, notFoundResponse, resetAppTestHarness } from "./test-utils/appTestHarness";
|
|
6
|
+
|
|
7
|
+
describe("App UI state persistence", () => {
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
cleanup();
|
|
10
|
+
resetAppTestHarness();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("hydrates ui state from the API and persists ui changes back to the API", async () => {
|
|
14
|
+
const uiStatePatchBodies: Array<Record<string, unknown>> = [];
|
|
15
|
+
|
|
16
|
+
vi.spyOn(globalThis, "fetch").mockImplementation(async (input, init) => {
|
|
17
|
+
const url = String(input);
|
|
18
|
+
const method = init?.method ?? "GET";
|
|
19
|
+
|
|
20
|
+
if (url.endsWith("/api/terminal-snapshots") && method === "GET") {
|
|
21
|
+
return jsonResponse([]);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (url.endsWith("/api/claude/usage") && method === "GET") {
|
|
25
|
+
return jsonResponse({
|
|
26
|
+
status: "unavailable",
|
|
27
|
+
fetchedAt: "2026-02-24T10:00:00.000Z",
|
|
28
|
+
source: "none",
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (url.endsWith("/api/codex/usage") && method === "GET") {
|
|
33
|
+
return jsonResponse({
|
|
34
|
+
status: "unavailable",
|
|
35
|
+
fetchedAt: "2026-02-24T10:00:00.000Z",
|
|
36
|
+
source: "none",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (url.endsWith("/api/github/summary") && method === "GET") {
|
|
41
|
+
return jsonResponse({
|
|
42
|
+
status: "unavailable",
|
|
43
|
+
source: "none",
|
|
44
|
+
fetchedAt: "2026-02-24T10:00:00.000Z",
|
|
45
|
+
commitsPerDay: [],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (url.includes("/api/analytics/usage-heatmap") && method === "GET") {
|
|
50
|
+
return jsonResponse({
|
|
51
|
+
days: [],
|
|
52
|
+
projects: [],
|
|
53
|
+
models: [],
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (url.endsWith("/api/ui-state") && method === "GET") {
|
|
58
|
+
return jsonResponse({
|
|
59
|
+
activePrimaryNav: 8,
|
|
60
|
+
isRuntimeStatusStripVisible: false,
|
|
61
|
+
isMonitorVisible: false,
|
|
62
|
+
isBottomTelemetryVisible: false,
|
|
63
|
+
terminalCompletionSound: "retro-beep",
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (url.endsWith("/api/ui-state") && method === "PATCH") {
|
|
68
|
+
const body = init?.body;
|
|
69
|
+
if (typeof body === "string") {
|
|
70
|
+
uiStatePatchBodies.push(JSON.parse(body) as Record<string, unknown>);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return new Response(body ?? "{}", {
|
|
74
|
+
status: 200,
|
|
75
|
+
headers: {
|
|
76
|
+
"Content-Type": "application/json",
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return notFoundResponse();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
render(<App />);
|
|
85
|
+
|
|
86
|
+
expect(await screen.findByLabelText("Settings primary view")).toBeInTheDocument();
|
|
87
|
+
expect(screen.queryByLabelText("Runtime status strip")).toBeNull();
|
|
88
|
+
expect(screen.queryByLabelText("Telemetry ticker tape")).toBeNull();
|
|
89
|
+
expect(screen.getByRole("button", { name: /Retro beep/i })).toHaveAttribute(
|
|
90
|
+
"aria-pressed",
|
|
91
|
+
"true",
|
|
92
|
+
);
|
|
93
|
+
expect(screen.getByRole("switch", { name: "Show runtime status strip" })).toHaveAttribute(
|
|
94
|
+
"aria-checked",
|
|
95
|
+
"false",
|
|
96
|
+
);
|
|
97
|
+
expect(screen.getByRole("switch", { name: "Enable X Monitor" })).toHaveAttribute(
|
|
98
|
+
"aria-checked",
|
|
99
|
+
"false",
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
fireEvent.click(screen.getByRole("switch", { name: "Show runtime status strip" }));
|
|
103
|
+
fireEvent.click(screen.getByRole("switch", { name: "Enable X Monitor" }));
|
|
104
|
+
fireEvent.click(screen.getByRole("button", { name: /Double beep/i }));
|
|
105
|
+
|
|
106
|
+
await waitFor(() => {
|
|
107
|
+
expect(uiStatePatchBodies.some((body) => body.isRuntimeStatusStripVisible === true)).toBe(
|
|
108
|
+
true,
|
|
109
|
+
);
|
|
110
|
+
expect(uiStatePatchBodies.some((body) => body.isMonitorVisible === true)).toBe(true);
|
|
111
|
+
expect(
|
|
112
|
+
uiStatePatchBodies.some((body) => body.terminalCompletionSound === "double-beep"),
|
|
113
|
+
).toBe(true);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
});
|