repoburg 1.3.201 → 1.3.204
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/agent-pane/backend/dist/index.js +2714 -32395
- package/agent-pane/backend/dist/server.js +45304 -0
- package/askuser-after-step5-postgres-selected.png +0 -0
- package/askuser-after-step7-answer-sent.png +0 -0
- package/askuser-card-visible.png +0 -0
- package/backend/dist/src/agent-runtime/agent-runtime-event-emitter.d.ts +16 -0
- package/backend/dist/src/agent-runtime/agent-runtime-event-emitter.js +87 -0
- package/backend/dist/src/agent-runtime/agent-runtime-event-emitter.js.map +1 -1
- package/backend/dist/src/agent-runtime/agent-runtime.types.d.ts +16 -1
- package/backend/dist/src/app.controller.d.ts +1 -0
- package/backend/dist/src/app.service.d.ts +1 -0
- package/backend/dist/src/app.service.js +4 -1
- package/backend/dist/src/app.service.js.map +1 -1
- package/backend/dist/src/interactive-chat/chat.service.d.ts +4 -0
- package/backend/dist/src/interactive-chat/chat.service.js +21 -1
- package/backend/dist/src/interactive-chat/chat.service.js.map +1 -1
- package/backend/dist/src/llm-orchestration/action-handlers/invoke-subagent.handler.js +12 -1
- package/backend/dist/src/llm-orchestration/action-handlers/invoke-subagent.handler.js.map +1 -1
- package/backend/dist/src/llm-orchestration/llm-orchestration.interfaces.d.ts +1 -0
- package/backend/dist/src/llm-orchestration/llm-orchestration.interfaces.js +1 -0
- package/backend/dist/src/llm-orchestration/llm-orchestration.interfaces.js.map +1 -1
- package/backend/dist/src/llm-orchestration/llm-turn-processor.service.js +2 -0
- package/backend/dist/src/llm-orchestration/llm-turn-processor.service.js.map +1 -1
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/daemon/dist/agentPane.js +128 -0
- package/daemon/dist/agentPane.spec.js +183 -0
- package/daemon/dist/api/services.js +4 -0
- package/daemon/dist/index.js +28 -8
- package/daemon/dist/serviceManager.js +30 -11
- package/daemon/dist/serviceManager.spec.js +26 -0
- package/daemon/dist/workspace-validation.js +63 -0
- package/daemon/dist/workspace-validation.spec.js +63 -0
- package/daemon/package.json +1 -1
- package/package.json +15 -2
- package/r2-step4-apple-banana.png +0 -0
- package/r2-step5-after-rewind-apple-last.png +0 -0
- package/r2-step7-apple-cherry.png +0 -0
- package/r2-step8-cherry-menu-no-restore.png +0 -0
- package/r3-step3-live-task-card-running.png +0 -0
- package/r3-step4-after-completion.png +0 -0
- package/r3-step5-persistence-after-reload.png +0 -0
- package/r3-step6-tasks-tab-card.png +0 -0
- package/reverify-answered-state-answer-sent.png +0 -0
- package/reverify-card-visible-after-completion.png +0 -0
- package/rewind-step3-apple-banana-turns.png +0 -0
- package/rewind-step5-ui-unchanged-after-confirmed-rewind.png +0 -0
- package/rewind-step6-apple-menu-no-restore.png +0 -0
- package/rewind-step7-final-turnlist-unchanged.png +0 -0
- package/rewind-step7-negative-error-toast.png +0 -0
- package/rewind-step7-negative-error-toast2.png +0 -0
- package/subagent-r2-step5-turn-after-reload-no-card.png +0 -0
- package/subagent-r2-step6-tasks-panel-card.png +0 -0
- package/subagent-step3-tasks-tab-done-card.png +0 -0
- package/subagent-step4-turn-stuck-no-cards.png +0 -0
- package/agent-pane/.prettierignore +0 -5
- package/agent-pane/.prettierrc +0 -8
- package/agent-pane/backend/coverage/base.css +0 -224
- package/agent-pane/backend/coverage/block-navigation.js +0 -87
- package/agent-pane/backend/coverage/clover.xml +0 -887
- package/agent-pane/backend/coverage/coverage-final.json +0 -10
- package/agent-pane/backend/coverage/favicon.png +0 -0
- package/agent-pane/backend/coverage/index.html +0 -176
- package/agent-pane/backend/coverage/prettify.css +0 -1
- package/agent-pane/backend/coverage/prettify.js +0 -2
- package/agent-pane/backend/coverage/sort-arrow-sprite.png +0 -0
- package/agent-pane/backend/coverage/sorter.js +0 -210
- package/agent-pane/backend/coverage/src/codex/codex-provider.ts.html +0 -1402
- package/agent-pane/backend/coverage/src/codex/index.html +0 -131
- package/agent-pane/backend/coverage/src/codex/item-mapper.ts.html +0 -331
- package/agent-pane/backend/coverage/src/db/index.html +0 -131
- package/agent-pane/backend/coverage/src/db/index.ts.html +0 -436
- package/agent-pane/backend/coverage/src/db/schema.ts.html +0 -175
- package/agent-pane/backend/coverage/src/index.html +0 -116
- package/agent-pane/backend/coverage/src/index.ts.html +0 -262
- package/agent-pane/backend/coverage/src/routes/index.html +0 -146
- package/agent-pane/backend/coverage/src/routes/sessions.ts.html +0 -991
- package/agent-pane/backend/coverage/src/routes/turns.ts.html +0 -256
- package/agent-pane/backend/coverage/src/routes/workspaces.ts.html +0 -406
- package/agent-pane/backend/coverage/src/ws/index.html +0 -116
- package/agent-pane/backend/coverage/src/ws/index.ts.html +0 -238
- package/agent-pane/backend/data.db +0 -0
- package/agent-pane/backend/data.db-shm +0 -0
- package/agent-pane/backend/data.db-wal +0 -0
- package/agent-pane/backend/package-lock.json +0 -5945
- package/agent-pane/backend/package.json +0 -33
- package/agent-pane/backend/scripts/backfill-from-jsonl.ts +0 -206
- package/agent-pane/backend/scripts/import-session-from-jsonl.ts +0 -264
- package/agent-pane/backend/src/claude/claude-message-mapper.test.ts +0 -271
- package/agent-pane/backend/src/claude/claude-message-mapper.ts +0 -259
- package/agent-pane/backend/src/claude/claude-provider.test.ts +0 -455
- package/agent-pane/backend/src/claude/claude-provider.ts +0 -1319
- package/agent-pane/backend/src/claude/claude-types.ts +0 -45
- package/agent-pane/backend/src/codex/app-server-client.test.ts +0 -183
- package/agent-pane/backend/src/codex/app-server-client.ts +0 -247
- package/agent-pane/backend/src/codex/app-server-types.ts +0 -259
- package/agent-pane/backend/src/codex/codex-provider-runtime-config.test.ts +0 -56
- package/agent-pane/backend/src/codex/codex-provider.test.ts +0 -60
- package/agent-pane/backend/src/codex/codex-provider.ts +0 -619
- package/agent-pane/backend/src/codex/item-mapper.test.ts +0 -221
- package/agent-pane/backend/src/codex/item-mapper.ts +0 -86
- package/agent-pane/backend/src/codex/shared-app-server.ts +0 -25
- package/agent-pane/backend/src/db/index.test.ts +0 -125
- package/agent-pane/backend/src/db/index.ts +0 -230
- package/agent-pane/backend/src/db/schema.ts +0 -34
- package/agent-pane/backend/src/index.ts +0 -89
- package/agent-pane/backend/src/integration/__fixtures__/cancel-turn.json +0 -29
- package/agent-pane/backend/src/integration/__fixtures__/delta-streaming.json +0 -40
- package/agent-pane/backend/src/integration/__fixtures__/failed-turn.json +0 -16
- package/agent-pane/backend/src/integration/__fixtures__/mcp-tool-call.json +0 -60
- package/agent-pane/backend/src/integration/__fixtures__/missing-item-started.json +0 -34
- package/agent-pane/backend/src/integration/__fixtures__/multi-item-turn.json +0 -85
- package/agent-pane/backend/src/integration/__fixtures__/multi-turn.json +0 -48
- package/agent-pane/backend/src/integration/__fixtures__/simple-turn.json +0 -35
- package/agent-pane/backend/src/integration/delta-streaming.test.ts +0 -130
- package/agent-pane/backend/src/integration/helpers/app-server-mock.ts +0 -272
- package/agent-pane/backend/src/integration/helpers/test-app.ts +0 -110
- package/agent-pane/backend/src/integration/helpers/ws-capture.ts +0 -64
- package/agent-pane/backend/src/integration/item-lifecycle.test.ts +0 -133
- package/agent-pane/backend/src/integration/mcp-tool-call.test.ts +0 -102
- package/agent-pane/backend/src/integration/missing-item-started.test.ts +0 -91
- package/agent-pane/backend/src/integration/multi-turn.test.ts +0 -121
- package/agent-pane/backend/src/integration/session-operations.test.ts +0 -175
- package/agent-pane/backend/src/integration/threads-claude-fork.test.ts +0 -241
- package/agent-pane/backend/src/integration/threads.test.ts +0 -309
- package/agent-pane/backend/src/integration/title-generation.test.ts +0 -109
- package/agent-pane/backend/src/integration/turn-cancel.test.ts +0 -111
- package/agent-pane/backend/src/integration/turn-failure.test.ts +0 -97
- package/agent-pane/backend/src/integration/turn-lifecycle.test.ts +0 -141
- package/agent-pane/backend/src/providers/index.ts +0 -16
- package/agent-pane/backend/src/providers/registry.test.ts +0 -92
- package/agent-pane/backend/src/providers/registry.ts +0 -43
- package/agent-pane/backend/src/providers/runtime-provider.ts +0 -43
- package/agent-pane/backend/src/repoburg/action-mapping.ts +0 -216
- package/agent-pane/backend/src/repoburg/agent-runtime-client.test.ts +0 -271
- package/agent-pane/backend/src/repoburg/agent-runtime-client.ts +0 -262
- package/agent-pane/backend/src/repoburg/backend-resolver.test.ts +0 -271
- package/agent-pane/backend/src/repoburg/backend-resolver.ts +0 -246
- package/agent-pane/backend/src/repoburg/repoburg-client.test.ts +0 -159
- package/agent-pane/backend/src/repoburg/repoburg-client.ts +0 -181
- package/agent-pane/backend/src/repoburg/repoburg-provider.test.ts +0 -723
- package/agent-pane/backend/src/repoburg/repoburg-provider.ts +0 -422
- package/agent-pane/backend/src/repoburg/turn-projector.test.ts +0 -475
- package/agent-pane/backend/src/repoburg/turn-projector.ts +0 -537
- package/agent-pane/backend/src/routes/files.ts +0 -31
- package/agent-pane/backend/src/routes/mcp.ts +0 -33
- package/agent-pane/backend/src/routes/models.test.ts +0 -92
- package/agent-pane/backend/src/routes/models.ts +0 -16
- package/agent-pane/backend/src/routes/plugins.ts +0 -40
- package/agent-pane/backend/src/routes/providers.test.ts +0 -86
- package/agent-pane/backend/src/routes/providers.ts +0 -86
- package/agent-pane/backend/src/routes/sessions.test.ts +0 -558
- package/agent-pane/backend/src/routes/sessions.ts +0 -504
- package/agent-pane/backend/src/routes/skills.test.ts +0 -114
- package/agent-pane/backend/src/routes/skills.ts +0 -70
- package/agent-pane/backend/src/routes/threads.ts +0 -323
- package/agent-pane/backend/src/routes/turns.test.ts +0 -196
- package/agent-pane/backend/src/routes/turns.ts +0 -103
- package/agent-pane/backend/src/routes/workspaces.test.ts +0 -197
- package/agent-pane/backend/src/routes/workspaces.ts +0 -128
- package/agent-pane/backend/src/ws/index.test.ts +0 -107
- package/agent-pane/backend/src/ws/index.ts +0 -51
- package/agent-pane/backend/tsconfig.json +0 -25
- package/agent-pane/backend/vitest.config.ts +0 -20
- package/agent-pane/eslint.config.js +0 -33
- package/agent-pane/frontend/coverage/base.css +0 -224
- package/agent-pane/frontend/coverage/block-navigation.js +0 -87
- package/agent-pane/frontend/coverage/clover.xml +0 -2962
- package/agent-pane/frontend/coverage/coverage-final.json +0 -37
- package/agent-pane/frontend/coverage/favicon.png +0 -0
- package/agent-pane/frontend/coverage/index.html +0 -251
- package/agent-pane/frontend/coverage/prettify.css +0 -1
- package/agent-pane/frontend/coverage/prettify.js +0 -2
- package/agent-pane/frontend/coverage/sort-arrow-sprite.png +0 -0
- package/agent-pane/frontend/coverage/sorter.js +0 -210
- package/agent-pane/frontend/coverage/src/App.tsx.html +0 -217
- package/agent-pane/frontend/coverage/src/AppInitializer.tsx.html +0 -223
- package/agent-pane/frontend/coverage/src/api/client.ts.html +0 -187
- package/agent-pane/frontend/coverage/src/api/index.html +0 -161
- package/agent-pane/frontend/coverage/src/api/sessions.ts.html +0 -316
- package/agent-pane/frontend/coverage/src/api/websocket.ts.html +0 -544
- package/agent-pane/frontend/coverage/src/api/workspaces.ts.html +0 -199
- package/agent-pane/frontend/coverage/src/components/CollapsibleToolCalls.tsx.html +0 -226
- package/agent-pane/frontend/coverage/src/components/CommandInputBar.tsx.html +0 -382
- package/agent-pane/frontend/coverage/src/components/CommandPalette.tsx.html +0 -715
- package/agent-pane/frontend/coverage/src/components/IdeWorkspace.tsx.html +0 -160
- package/agent-pane/frontend/coverage/src/components/ModelSelector.tsx.html +0 -478
- package/agent-pane/frontend/coverage/src/components/NewSessionDialog.tsx.html +0 -472
- package/agent-pane/frontend/coverage/src/components/RenderArea.tsx.html +0 -574
- package/agent-pane/frontend/coverage/src/components/RightPanel.tsx.html +0 -205
- package/agent-pane/frontend/coverage/src/components/RuntimeIcon.tsx.html +0 -133
- package/agent-pane/frontend/coverage/src/components/SessionTabs.tsx.html +0 -217
- package/agent-pane/frontend/coverage/src/components/StatusBar.tsx.html +0 -271
- package/agent-pane/frontend/coverage/src/components/StatusDot.tsx.html +0 -109
- package/agent-pane/frontend/coverage/src/components/Toast.tsx.html +0 -313
- package/agent-pane/frontend/coverage/src/components/TurnContent.tsx.html +0 -1216
- package/agent-pane/frontend/coverage/src/components/WorkspaceSidebar.tsx.html +0 -1138
- package/agent-pane/frontend/coverage/src/components/index.html +0 -326
- package/agent-pane/frontend/coverage/src/components/panels/ChangesPanel.tsx.html +0 -247
- package/agent-pane/frontend/coverage/src/components/panels/LogsPanel.tsx.html +0 -160
- package/agent-pane/frontend/coverage/src/components/panels/MetricsPanel.tsx.html +0 -427
- package/agent-pane/frontend/coverage/src/components/panels/TurnsPanel.tsx.html +0 -397
- package/agent-pane/frontend/coverage/src/components/panels/index.html +0 -161
- package/agent-pane/frontend/coverage/src/constants/index.html +0 -116
- package/agent-pane/frontend/coverage/src/constants/models.ts.html +0 -406
- package/agent-pane/frontend/coverage/src/hooks/index.html +0 -146
- package/agent-pane/frontend/coverage/src/hooks/useEscapeKey.ts.html +0 -124
- package/agent-pane/frontend/coverage/src/hooks/useOutsideClick.ts.html +0 -142
- package/agent-pane/frontend/coverage/src/hooks/useSessionStatus.ts.html +0 -187
- package/agent-pane/frontend/coverage/src/index.html +0 -146
- package/agent-pane/frontend/coverage/src/main.tsx.html +0 -115
- package/agent-pane/frontend/coverage/src/store/index.html +0 -116
- package/agent-pane/frontend/coverage/src/store/store.ts.html +0 -2404
- package/agent-pane/frontend/coverage/src/test/component-helpers.ts.html +0 -190
- package/agent-pane/frontend/coverage/src/test/fixtures.ts.html +0 -367
- package/agent-pane/frontend/coverage/src/test/index.html +0 -131
- package/agent-pane/frontend/coverage/src/types/index.html +0 -116
- package/agent-pane/frontend/coverage/src/types/index.ts.html +0 -466
- package/agent-pane/frontend/coverage/src/utils/changes.ts.html +0 -202
- package/agent-pane/frontend/coverage/src/utils/duration.ts.html +0 -127
- package/agent-pane/frontend/coverage/src/utils/index.html +0 -131
- package/agent-pane/frontend/dist/assets/index-34WaZYsW.css +0 -1
- package/agent-pane/frontend/dist/assets/index-y7xlT86e.js +0 -362
- package/agent-pane/frontend/dist/index.html +0 -19
- package/agent-pane/frontend/index.html +0 -18
- package/agent-pane/frontend/package-lock.json +0 -4211
- package/agent-pane/frontend/package.json +0 -35
- package/agent-pane/frontend/src/App.test.tsx +0 -74
- package/agent-pane/frontend/src/App.tsx +0 -44
- package/agent-pane/frontend/src/AppInitializer.test.tsx +0 -142
- package/agent-pane/frontend/src/AppInitializer.tsx +0 -46
- package/agent-pane/frontend/src/__tests__/ThreadsPanel.test.tsx +0 -192
- package/agent-pane/frontend/src/api/client.test.ts +0 -126
- package/agent-pane/frontend/src/api/client.ts +0 -34
- package/agent-pane/frontend/src/api/models.ts +0 -7
- package/agent-pane/frontend/src/api/providers.ts +0 -17
- package/agent-pane/frontend/src/api/sessions.test.ts +0 -245
- package/agent-pane/frontend/src/api/sessions.ts +0 -97
- package/agent-pane/frontend/src/api/skills.ts +0 -12
- package/agent-pane/frontend/src/api/websocket.test.ts +0 -288
- package/agent-pane/frontend/src/api/websocket.ts +0 -238
- package/agent-pane/frontend/src/api/workspaces.test.ts +0 -112
- package/agent-pane/frontend/src/api/workspaces.ts +0 -38
- package/agent-pane/frontend/src/components/CollapsibleToolCalls.test.tsx +0 -49
- package/agent-pane/frontend/src/components/CollapsibleToolCalls.tsx +0 -56
- package/agent-pane/frontend/src/components/CommandInputBar.test.tsx +0 -133
- package/agent-pane/frontend/src/components/CommandInputBar.tsx +0 -584
- package/agent-pane/frontend/src/components/CommandPalette.test.tsx +0 -226
- package/agent-pane/frontend/src/components/CommandPalette.tsx +0 -194
- package/agent-pane/frontend/src/components/CommentableText.test.tsx +0 -196
- package/agent-pane/frontend/src/components/CommentableText.tsx +0 -379
- package/agent-pane/frontend/src/components/IdeWorkspace.test.tsx +0 -39
- package/agent-pane/frontend/src/components/IdeWorkspace.tsx +0 -51
- package/agent-pane/frontend/src/components/ModelSelector.test.tsx +0 -129
- package/agent-pane/frontend/src/components/ModelSelector.tsx +0 -191
- package/agent-pane/frontend/src/components/NewSessionDialog.test.tsx +0 -95
- package/agent-pane/frontend/src/components/NewSessionDialog.tsx +0 -129
- package/agent-pane/frontend/src/components/RenderArea.test.tsx +0 -160
- package/agent-pane/frontend/src/components/RenderArea.tsx +0 -170
- package/agent-pane/frontend/src/components/ResizeHandle.tsx +0 -29
- package/agent-pane/frontend/src/components/RightPanel.test.tsx +0 -43
- package/agent-pane/frontend/src/components/RightPanel.tsx +0 -46
- package/agent-pane/frontend/src/components/RuntimeIcon.test.tsx +0 -32
- package/agent-pane/frontend/src/components/RuntimeIcon.tsx +0 -16
- package/agent-pane/frontend/src/components/SessionTabs.test.tsx +0 -72
- package/agent-pane/frontend/src/components/SessionTabs.tsx +0 -49
- package/agent-pane/frontend/src/components/StatusBar.test.tsx +0 -56
- package/agent-pane/frontend/src/components/StatusBar.tsx +0 -129
- package/agent-pane/frontend/src/components/StatusDot.test.tsx +0 -25
- package/agent-pane/frontend/src/components/StatusDot.tsx +0 -8
- package/agent-pane/frontend/src/components/Toast.test.tsx +0 -79
- package/agent-pane/frontend/src/components/Toast.tsx +0 -76
- package/agent-pane/frontend/src/components/TurnContent.test.tsx +0 -298
- package/agent-pane/frontend/src/components/TurnContent.tsx +0 -548
- package/agent-pane/frontend/src/components/WorkspaceSidebar.test.tsx +0 -297
- package/agent-pane/frontend/src/components/WorkspaceSidebar.tsx +0 -351
- package/agent-pane/frontend/src/components/input/OptionSubPopup.tsx +0 -32
- package/agent-pane/frontend/src/components/input/SkillMentionPopup.test.tsx +0 -63
- package/agent-pane/frontend/src/components/input/SkillMentionPopup.tsx +0 -78
- package/agent-pane/frontend/src/components/input/SlashPopup.test.tsx +0 -96
- package/agent-pane/frontend/src/components/input/SlashPopup.tsx +0 -82
- package/agent-pane/frontend/src/components/panels/ChangesPanel.test.tsx +0 -61
- package/agent-pane/frontend/src/components/panels/ChangesPanel.tsx +0 -54
- package/agent-pane/frontend/src/components/panels/TasksPanel.test.tsx +0 -97
- package/agent-pane/frontend/src/components/panels/TasksPanel.tsx +0 -208
- package/agent-pane/frontend/src/components/panels/ThreadsPanel.tsx +0 -382
- package/agent-pane/frontend/src/components/panels/TurnsPanel.test.tsx +0 -83
- package/agent-pane/frontend/src/components/panels/TurnsPanel.tsx +0 -126
- package/agent-pane/frontend/src/constants/models.test.ts +0 -97
- package/agent-pane/frontend/src/constants/models.ts +0 -166
- package/agent-pane/frontend/src/hooks/useEscapeKey.test.ts +0 -42
- package/agent-pane/frontend/src/hooks/useEscapeKey.ts +0 -13
- package/agent-pane/frontend/src/hooks/useOutsideClick.test.ts +0 -92
- package/agent-pane/frontend/src/hooks/useOutsideClick.ts +0 -19
- package/agent-pane/frontend/src/hooks/useProvider.ts +0 -44
- package/agent-pane/frontend/src/hooks/useResizable.test.ts +0 -97
- package/agent-pane/frontend/src/hooks/useResizable.ts +0 -75
- package/agent-pane/frontend/src/hooks/useSessionStatus.test.ts +0 -116
- package/agent-pane/frontend/src/hooks/useSessionStatus.ts +0 -34
- package/agent-pane/frontend/src/main.test.tsx +0 -37
- package/agent-pane/frontend/src/main.tsx +0 -10
- package/agent-pane/frontend/src/store/sessionSlice.ts +0 -440
- package/agent-pane/frontend/src/store/store.test.ts +0 -1319
- package/agent-pane/frontend/src/store/store.ts +0 -37
- package/agent-pane/frontend/src/store/threadSlice.ts +0 -136
- package/agent-pane/frontend/src/store/uiSlice.ts +0 -133
- package/agent-pane/frontend/src/store/workspaceSlice.ts +0 -77
- package/agent-pane/frontend/src/store/wsSlice.ts +0 -361
- package/agent-pane/frontend/src/styles/app.css +0 -611
- package/agent-pane/frontend/src/styles/tokens.css +0 -62
- package/agent-pane/frontend/src/test/component-helpers.ts +0 -38
- package/agent-pane/frontend/src/test/fixtures.ts +0 -100
- package/agent-pane/frontend/src/test-setup.ts +0 -5
- package/agent-pane/frontend/src/types/index.test.ts +0 -128
- package/agent-pane/frontend/src/types/index.ts +0 -132
- package/agent-pane/frontend/src/utils/changes.test.ts +0 -81
- package/agent-pane/frontend/src/utils/changes.ts +0 -39
- package/agent-pane/frontend/src/utils/duration.test.ts +0 -75
- package/agent-pane/frontend/src/utils/duration.ts +0 -14
- package/agent-pane/frontend/tsconfig.json +0 -25
- package/agent-pane/frontend/vite.config.ts +0 -22
- package/agent-pane/frontend/vitest.config.ts +0 -29
- package/agent-pane/package-lock.json +0 -1527
- package/agent-pane/package.json +0 -19
- package/agent-pane/shared/provider-types.ts +0 -67
- package/agent-pane/shared/types.ts +0 -167
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
import { useEffect, useLayoutEffect, useRef, useState, useCallback } from 'react';
|
|
2
|
-
import { marked } from 'marked';
|
|
3
|
-
import DOMPurify from 'dompurify';
|
|
4
|
-
import { MessageSquarePlus, X, Send, Quote } from 'lucide-react';
|
|
5
|
-
import type { DiscussionThread } from '../types/index.ts';
|
|
6
|
-
import { useStore } from '../store/store.ts';
|
|
7
|
-
|
|
8
|
-
marked.setOptions({ breaks: true, gfm: true });
|
|
9
|
-
|
|
10
|
-
function renderMarkdown(content: string): string {
|
|
11
|
-
const raw = marked.parse(content) as string;
|
|
12
|
-
return DOMPurify.sanitize(raw);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/** Find the text node and offset within it that corresponds to a character offset in the container's textContent. */
|
|
16
|
-
function findTextNode(
|
|
17
|
-
container: HTMLElement,
|
|
18
|
-
charOffset: number,
|
|
19
|
-
): { node: Text; offset: number } | null {
|
|
20
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_TEXT);
|
|
21
|
-
let count = 0;
|
|
22
|
-
while (walker.nextNode()) {
|
|
23
|
-
const node = walker.currentNode as Text;
|
|
24
|
-
const len = node.textContent?.length ?? 0;
|
|
25
|
-
if (count + len > charOffset) {
|
|
26
|
-
return { node, offset: charOffset - count };
|
|
27
|
-
}
|
|
28
|
-
count += len;
|
|
29
|
-
}
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** Highlight all thread anchors in the container by wrapping selected text in <mark> elements. */
|
|
34
|
-
function applyHighlights(container: HTMLElement, threads: DiscussionThread[]): void {
|
|
35
|
-
// Remove existing marks (unwrap them back to plain text)
|
|
36
|
-
container.querySelectorAll('mark[data-thread-id]').forEach((mark) => {
|
|
37
|
-
const parent = mark.parentNode;
|
|
38
|
-
if (!parent) return;
|
|
39
|
-
const text = document.createTextNode(mark.textContent || '');
|
|
40
|
-
parent.replaceChild(text, mark);
|
|
41
|
-
parent.normalize();
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
for (const thread of threads) {
|
|
45
|
-
const start = findTextNode(container, thread.start_offset);
|
|
46
|
-
const end = findTextNode(container, thread.end_offset);
|
|
47
|
-
if (!start || !end) continue;
|
|
48
|
-
|
|
49
|
-
const range = document.createRange();
|
|
50
|
-
range.setStart(start.node, start.offset);
|
|
51
|
-
range.setEnd(end.node, end.offset);
|
|
52
|
-
|
|
53
|
-
const mark = document.createElement('mark');
|
|
54
|
-
mark.setAttribute('data-thread-id', thread.id);
|
|
55
|
-
if (thread.status === 'resolved') mark.classList.add('thread-mark-resolved');
|
|
56
|
-
|
|
57
|
-
try {
|
|
58
|
-
range.surroundContents(mark);
|
|
59
|
-
} catch {
|
|
60
|
-
// Range spans element boundaries — extract and wrap
|
|
61
|
-
const fragment = range.extractContents();
|
|
62
|
-
mark.appendChild(fragment);
|
|
63
|
-
range.insertNode(mark);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/** Compute character offsets of the current selection within the container's textContent. */
|
|
69
|
-
function getSelectionOffsets(container: HTMLElement): { start: number; end: number; text: string } | null {
|
|
70
|
-
const sel = window.getSelection();
|
|
71
|
-
if (!sel || sel.rangeCount === 0) return null;
|
|
72
|
-
const range = sel.getRangeAt(0);
|
|
73
|
-
if (range.collapsed) return null;
|
|
74
|
-
if (!container.contains(range.commonAncestorContainer)) return null;
|
|
75
|
-
|
|
76
|
-
const preRange = document.createRange();
|
|
77
|
-
preRange.setStart(container, 0);
|
|
78
|
-
preRange.setEnd(range.startContainer, range.startOffset);
|
|
79
|
-
const start = preRange.toString().length;
|
|
80
|
-
const text = range.toString();
|
|
81
|
-
return { start, end: start + text.length, text };
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
interface Props {
|
|
85
|
-
itemId: string;
|
|
86
|
-
turnId: string;
|
|
87
|
-
sessionId: string;
|
|
88
|
-
content: string;
|
|
89
|
-
threads: DiscussionThread[];
|
|
90
|
-
runtimeType?: string;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export default function CommentableText({ itemId, turnId, sessionId, content, threads }: Props) {
|
|
94
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
95
|
-
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
96
|
-
const popoverRef = useRef<HTMLDivElement>(null);
|
|
97
|
-
// Refs to read the current message and Esc timing from stable-closure
|
|
98
|
-
// handlers (handleGlobalMouseDown / handleMouseDown are bound with empty deps).
|
|
99
|
-
const messageRef = useRef('');
|
|
100
|
-
const lastEscRef = useRef(0);
|
|
101
|
-
const [showDiscussBtn, setShowDiscussBtn] = useState(false);
|
|
102
|
-
const [btnPos, setBtnPos] = useState({ x: 0, y: 0 });
|
|
103
|
-
const [showPopover, setShowPopover] = useState(false);
|
|
104
|
-
const [popoverPos, setPopoverPos] = useState({ x: 0, y: 0 });
|
|
105
|
-
const [message, setMessage] = useState('');
|
|
106
|
-
const [selectionInfo, setSelectionInfo] = useState<{ start: number; end: number; text: string } | null>(null);
|
|
107
|
-
const { createThread, switchRightTab } = useStore();
|
|
108
|
-
|
|
109
|
-
// Handle Quote button click — populate command input with selected text
|
|
110
|
-
const handleQuoteClick = useCallback(() => {
|
|
111
|
-
if (!selectionInfo) return;
|
|
112
|
-
const formatted = `\n\`\`\`QUOTE\n${selectionInfo.text}\n\`\`\`\n\n`;
|
|
113
|
-
useStore.setState({ quotedText: formatted });
|
|
114
|
-
setShowDiscussBtn(false);
|
|
115
|
-
setSelectionInfo(null);
|
|
116
|
-
window.getSelection()?.removeAllRanges();
|
|
117
|
-
}, [selectionInfo]);
|
|
118
|
-
const threadsForItem = threads.filter((t) => t.item_id === itemId);
|
|
119
|
-
|
|
120
|
-
// Render markdown + apply highlights after each render
|
|
121
|
-
useEffect(() => {
|
|
122
|
-
if (containerRef.current) {
|
|
123
|
-
applyHighlights(containerRef.current, threadsForItem);
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
// Keep messageRef in sync so the stable-closure dismiss handlers can read
|
|
128
|
-
// the current message without re-subscribing on every keystroke.
|
|
129
|
-
useEffect(() => {
|
|
130
|
-
messageRef.current = message;
|
|
131
|
-
}, [message]);
|
|
132
|
-
|
|
133
|
-
// Dismiss button + popover when clicking outside the wrapper
|
|
134
|
-
useEffect(() => {
|
|
135
|
-
function handleGlobalMouseDown(e: MouseEvent) {
|
|
136
|
-
if (wrapperRef.current && !wrapperRef.current.contains(e.target as Node)) {
|
|
137
|
-
setShowDiscussBtn(false);
|
|
138
|
-
// Don't auto-dismiss a popover that has typed text — require Esc/X.
|
|
139
|
-
if (!messageRef.current.trim()) {
|
|
140
|
-
setShowPopover(false);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
document.addEventListener('mousedown', handleGlobalMouseDown);
|
|
145
|
-
return () => document.removeEventListener('mousedown', handleGlobalMouseDown);
|
|
146
|
-
}, []);
|
|
147
|
-
|
|
148
|
-
// Handle mousedown in container — hide everything (new selection starting or click).
|
|
149
|
-
// Protect a popover that has typed text: only auto-close when it's empty.
|
|
150
|
-
const handleMouseDown = useCallback(() => {
|
|
151
|
-
setShowDiscussBtn(false);
|
|
152
|
-
if (!messageRef.current.trim()) {
|
|
153
|
-
setShowPopover(false);
|
|
154
|
-
}
|
|
155
|
-
}, []);
|
|
156
|
-
|
|
157
|
-
// Check the current text selection within the container and position the
|
|
158
|
-
// floating Discuss/Quote buttons. Direction-aware (handles backward
|
|
159
|
-
// selections) and clamps into the viewport so the buttons stay visible.
|
|
160
|
-
const checkSelection = useCallback(() => {
|
|
161
|
-
const container = containerRef.current;
|
|
162
|
-
if (!container) return;
|
|
163
|
-
|
|
164
|
-
const result = getSelectionOffsets(container);
|
|
165
|
-
if (result && result.text.trim().length > 0) {
|
|
166
|
-
const sel = window.getSelection();
|
|
167
|
-
if (sel && sel.rangeCount > 0 && sel.anchorNode && sel.focusNode) {
|
|
168
|
-
const range = sel.getRangeAt(0);
|
|
169
|
-
// Use viewport coordinates (position:fixed) — avoids overflow clipping
|
|
170
|
-
// and stacking-context issues from nested containers.
|
|
171
|
-
const selRect = range.getBoundingClientRect();
|
|
172
|
-
const BUTTON_HEIGHT = 28;
|
|
173
|
-
const GAP = 6;
|
|
174
|
-
const BUTTON_WIDTH_EST = 170;
|
|
175
|
-
|
|
176
|
-
// Detect backward selection: compare anchor (press) and focus (release)
|
|
177
|
-
// endpoints in document order. anchor after focus => user dragged
|
|
178
|
-
// backwards, so the release point is at the start/left of the text.
|
|
179
|
-
let backward = false;
|
|
180
|
-
try {
|
|
181
|
-
const fr = document.createRange();
|
|
182
|
-
fr.setStart(sel.focusNode, sel.focusOffset);
|
|
183
|
-
fr.setEnd(sel.focusNode, sel.focusOffset);
|
|
184
|
-
const ar = document.createRange();
|
|
185
|
-
ar.setStart(sel.anchorNode, sel.anchorOffset);
|
|
186
|
-
ar.setEnd(sel.anchorNode, sel.anchorOffset);
|
|
187
|
-
backward = ar.compareBoundaryPoints(Range.START_TO_START, fr) > 0;
|
|
188
|
-
} catch {
|
|
189
|
-
backward = false;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
let btnY = selRect.top - BUTTON_HEIGHT - GAP;
|
|
193
|
-
if (btnY < 8) btnY = selRect.bottom + GAP;
|
|
194
|
-
|
|
195
|
-
// Anchor near the release end and keep the whole bar on-screen.
|
|
196
|
-
let btnX = backward ? selRect.left - BUTTON_WIDTH_EST : selRect.right;
|
|
197
|
-
btnX = Math.max(8, Math.min(btnX, window.innerWidth - BUTTON_WIDTH_EST - 8));
|
|
198
|
-
|
|
199
|
-
setBtnPos({ x: btnX, y: btnY });
|
|
200
|
-
setShowDiscussBtn(true);
|
|
201
|
-
setSelectionInfo(result);
|
|
202
|
-
}
|
|
203
|
-
} else {
|
|
204
|
-
setShowDiscussBtn(false);
|
|
205
|
-
}
|
|
206
|
-
}, []);
|
|
207
|
-
|
|
208
|
-
// Detect text selections on mouseup anywhere in the document — not just
|
|
209
|
-
// inside the container. When dragging a selection backwards to a line
|
|
210
|
-
// start, the mouse is frequently released in the surrounding padding/gutter
|
|
211
|
-
// (outside the container element), which would otherwise miss a container-
|
|
212
|
-
// bound onMouseUp and never show the quote button.
|
|
213
|
-
useEffect(() => {
|
|
214
|
-
function onDocMouseUp(e: MouseEvent) {
|
|
215
|
-
const t = e.target as HTMLElement | null;
|
|
216
|
-
// Ignore clicks on our own floating buttons/popover — their handlers
|
|
217
|
-
// manage state and may clear the selection themselves.
|
|
218
|
-
if (t && (t.closest('.selection-actions') || t.closest('.thread-create-popover'))) return;
|
|
219
|
-
checkSelection();
|
|
220
|
-
}
|
|
221
|
-
document.addEventListener('mouseup', onDocMouseUp);
|
|
222
|
-
return () => document.removeEventListener('mouseup', onDocMouseUp);
|
|
223
|
-
}, [checkSelection]);
|
|
224
|
-
|
|
225
|
-
// Handle Discuss button click
|
|
226
|
-
const handleDiscussClick = useCallback(() => {
|
|
227
|
-
setShowDiscussBtn(false);
|
|
228
|
-
setShowPopover(true);
|
|
229
|
-
// Position popover where the button was — button is hidden, popover takes its place
|
|
230
|
-
setPopoverPos({ x: btnPos.x, y: btnPos.y });
|
|
231
|
-
}, [btnPos]);
|
|
232
|
-
|
|
233
|
-
// Clamp the discuss popover into the viewport once it mounts. The popover
|
|
234
|
-
// uses `transform: translateX(-100%)`, so its visible right edge sits at
|
|
235
|
-
// `left` and it opens to the LEFT. For backward selections the button is
|
|
236
|
-
// anchored near the left edge, which would push the (wider) popover off the
|
|
237
|
-
// left side; for selections near the top it would overflow above. Measure
|
|
238
|
-
// the real size and reposition before paint (no flash).
|
|
239
|
-
useLayoutEffect(() => {
|
|
240
|
-
if (!showPopover) return;
|
|
241
|
-
const el = popoverRef.current;
|
|
242
|
-
if (!el) return;
|
|
243
|
-
const w = el.offsetWidth;
|
|
244
|
-
const h = el.offsetHeight;
|
|
245
|
-
const MARGIN = 8;
|
|
246
|
-
// Visible box is [x - w, x] horizontally (translateX(-100%)) and [y, y + h] vertically.
|
|
247
|
-
let x = btnPos.x;
|
|
248
|
-
let y = btnPos.y;
|
|
249
|
-
if (x - w < MARGIN) x = w + MARGIN; // would overflow left → shift right
|
|
250
|
-
if (x > window.innerWidth - MARGIN) x = window.innerWidth - MARGIN; // overflow right
|
|
251
|
-
if (y < MARGIN) y = MARGIN; // overflow top
|
|
252
|
-
if (y + h > window.innerHeight - MARGIN) y = window.innerHeight - h - MARGIN; // overflow bottom
|
|
253
|
-
setPopoverPos({ x, y });
|
|
254
|
-
}, [showPopover, btnPos]);
|
|
255
|
-
|
|
256
|
-
// Handle submit — create thread
|
|
257
|
-
const handleSubmit = useCallback(async () => {
|
|
258
|
-
if (!selectionInfo || !message.trim()) return;
|
|
259
|
-
await createThread(sessionId, {
|
|
260
|
-
itemId,
|
|
261
|
-
turnId,
|
|
262
|
-
startOffset: selectionInfo.start,
|
|
263
|
-
endOffset: selectionInfo.end,
|
|
264
|
-
selectedText: selectionInfo.text,
|
|
265
|
-
message: message.trim(),
|
|
266
|
-
});
|
|
267
|
-
setMessage('');
|
|
268
|
-
setShowPopover(false);
|
|
269
|
-
setSelectionInfo(null);
|
|
270
|
-
// Clear selection
|
|
271
|
-
window.getSelection()?.removeAllRanges();
|
|
272
|
-
// Switch to Threads tab
|
|
273
|
-
switchRightTab('threads');
|
|
274
|
-
}, [selectionInfo, message, createThread, sessionId, itemId, turnId, switchRightTab]);
|
|
275
|
-
|
|
276
|
-
// Handle mark click — navigate to Threads tab
|
|
277
|
-
const handleMarkClick = useCallback(
|
|
278
|
-
(e: React.MouseEvent) => {
|
|
279
|
-
const target = e.target as HTMLElement;
|
|
280
|
-
if (target.tagName === 'MARK' && target.hasAttribute('data-thread-id')) {
|
|
281
|
-
e.preventDefault();
|
|
282
|
-
switchRightTab('threads');
|
|
283
|
-
const threadId = target.getAttribute('data-thread-id');
|
|
284
|
-
// Scroll to thread card after a brief delay
|
|
285
|
-
setTimeout(() => {
|
|
286
|
-
const card = document.getElementById(`thread-${threadId}`);
|
|
287
|
-
if (card) {
|
|
288
|
-
card.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
289
|
-
card.classList.add('thread-card-highlighted');
|
|
290
|
-
setTimeout(() => card.classList.remove('thread-card-highlighted'), 1500);
|
|
291
|
-
}
|
|
292
|
-
}, 100);
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
[switchRightTab],
|
|
296
|
-
);
|
|
297
|
-
|
|
298
|
-
return (
|
|
299
|
-
<div style={{ position: 'relative' }} ref={wrapperRef}>
|
|
300
|
-
<div
|
|
301
|
-
ref={containerRef}
|
|
302
|
-
dangerouslySetInnerHTML={{ __html: renderMarkdown(content || '…') }}
|
|
303
|
-
onMouseDown={handleMouseDown}
|
|
304
|
-
onClick={handleMarkClick}
|
|
305
|
-
/>
|
|
306
|
-
|
|
307
|
-
{/* Floating "Discuss" + "Quote" buttons */}
|
|
308
|
-
{showDiscussBtn && !showPopover && (
|
|
309
|
-
<div className="selection-actions" style={{ left: btnPos.x, top: btnPos.y }}>
|
|
310
|
-
<button
|
|
311
|
-
className="discuss-button"
|
|
312
|
-
onClick={handleDiscussClick}
|
|
313
|
-
title="Start a discussion about this text"
|
|
314
|
-
>
|
|
315
|
-
<MessageSquarePlus size={14} />
|
|
316
|
-
<span>Discuss</span>
|
|
317
|
-
</button>
|
|
318
|
-
<button
|
|
319
|
-
className="discuss-button"
|
|
320
|
-
onClick={handleQuoteClick}
|
|
321
|
-
title="Quote this text in your message"
|
|
322
|
-
>
|
|
323
|
-
<Quote size={14} />
|
|
324
|
-
<span>Quote</span>
|
|
325
|
-
</button>
|
|
326
|
-
</div>
|
|
327
|
-
)}
|
|
328
|
-
|
|
329
|
-
{/* Thread creation popover */}
|
|
330
|
-
{showPopover && (
|
|
331
|
-
<div ref={popoverRef} className="thread-create-popover" style={{ left: popoverPos.x, top: popoverPos.y }}>
|
|
332
|
-
<div className="thread-create-header">
|
|
333
|
-
<span className="thread-create-quote">"{selectionInfo?.text.slice(0, 80)}{selectionInfo && selectionInfo.text.length > 80 ? '…' : ''}"</span>
|
|
334
|
-
<button className="thread-create-close" onClick={() => { setShowPopover(false); setSelectionInfo(null); }}>
|
|
335
|
-
<X size={14} />
|
|
336
|
-
</button>
|
|
337
|
-
</div>
|
|
338
|
-
<textarea
|
|
339
|
-
className="thread-create-input"
|
|
340
|
-
placeholder="Ask about this text…"
|
|
341
|
-
value={message}
|
|
342
|
-
onChange={(e) => setMessage(e.target.value)}
|
|
343
|
-
autoFocus
|
|
344
|
-
rows={2}
|
|
345
|
-
onKeyDown={(e) => {
|
|
346
|
-
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {
|
|
347
|
-
e.preventDefault();
|
|
348
|
-
handleSubmit();
|
|
349
|
-
}
|
|
350
|
-
if (e.key === 'Escape') {
|
|
351
|
-
if (messageRef.current.trim()) {
|
|
352
|
-
// Protect typed text: require a second Esc within 400ms to close.
|
|
353
|
-
const now = Date.now();
|
|
354
|
-
if (lastEscRef.current && now - lastEscRef.current < 400) {
|
|
355
|
-
lastEscRef.current = 0;
|
|
356
|
-
setShowPopover(false);
|
|
357
|
-
setSelectionInfo(null);
|
|
358
|
-
} else {
|
|
359
|
-
lastEscRef.current = now;
|
|
360
|
-
}
|
|
361
|
-
} else {
|
|
362
|
-
setShowPopover(false);
|
|
363
|
-
setSelectionInfo(null);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
}}
|
|
367
|
-
/>
|
|
368
|
-
<div className="thread-create-footer">
|
|
369
|
-
<span className="thread-create-hint">⌘↵ to send · Esc to cancel</span>
|
|
370
|
-
<button className="thread-create-send" onClick={handleSubmit} disabled={!message.trim()}>
|
|
371
|
-
<Send size={13} />
|
|
372
|
-
<span>Send</span>
|
|
373
|
-
</button>
|
|
374
|
-
</div>
|
|
375
|
-
</div>
|
|
376
|
-
)}
|
|
377
|
-
</div>
|
|
378
|
-
);
|
|
379
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
2
|
-
import { render, cleanup, act } from '@testing-library/react';
|
|
3
|
-
import IdeWorkspace from './IdeWorkspace.tsx';
|
|
4
|
-
import { resetStore } from '../test/component-helpers.ts';
|
|
5
|
-
import { useStore } from '../store/store.ts';
|
|
6
|
-
|
|
7
|
-
describe('IdeWorkspace', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
resetStore();
|
|
10
|
-
});
|
|
11
|
-
afterEach(() => {
|
|
12
|
-
cleanup();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('renders two resize handles (left & right)', () => {
|
|
16
|
-
render(<IdeWorkspace />);
|
|
17
|
-
const handles = document.querySelectorAll('.resize-handle');
|
|
18
|
-
expect(handles).toHaveLength(2);
|
|
19
|
-
expect(handles[0].className).toContain('left');
|
|
20
|
-
expect(handles[1].className).toContain('right');
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('applies a 5-track grid reflecting store widths', () => {
|
|
24
|
-
resetStore({ sidebarWidth: 200, rightPanelWidth: 400 });
|
|
25
|
-
render(<IdeWorkspace />);
|
|
26
|
-
const layout = document.querySelector('.ide-layout') as HTMLElement;
|
|
27
|
-
expect(layout.style.gridTemplateColumns).toBe('200px 6px 1fr 6px 400px');
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('updates grid when store widths change', () => {
|
|
31
|
-
render(<IdeWorkspace />);
|
|
32
|
-
act(() => {
|
|
33
|
-
useStore.getState().setSidebarWidth(180);
|
|
34
|
-
useStore.getState().setRightPanelWidth(500);
|
|
35
|
-
});
|
|
36
|
-
const layout = document.querySelector('.ide-layout') as HTMLElement;
|
|
37
|
-
expect(layout.style.gridTemplateColumns).toBe('180px 6px 1fr 6px 500px');
|
|
38
|
-
});
|
|
39
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import WorkspaceSidebar from './WorkspaceSidebar.tsx';
|
|
2
|
-
import SessionTabs from './SessionTabs.tsx';
|
|
3
|
-
import RenderArea from './RenderArea.tsx';
|
|
4
|
-
import CommandInputBar from './CommandInputBar.tsx';
|
|
5
|
-
import RightPanel from './RightPanel.tsx';
|
|
6
|
-
import StatusBar from './StatusBar.tsx';
|
|
7
|
-
import ResizeHandle from './ResizeHandle.tsx';
|
|
8
|
-
import { useStore } from '../store/store.ts';
|
|
9
|
-
import { SIDEBAR_MIN, SIDEBAR_MAX, RIGHT_PANEL_MIN, RIGHT_PANEL_MAX } from '../store/uiSlice.ts';
|
|
10
|
-
|
|
11
|
-
export default function IdeWorkspace() {
|
|
12
|
-
const sidebarWidth = useStore((s) => s.sidebarWidth);
|
|
13
|
-
const rightPanelWidth = useStore((s) => s.rightPanelWidth);
|
|
14
|
-
const setSidebarWidth = useStore((s) => s.setSidebarWidth);
|
|
15
|
-
const setRightPanelWidth = useStore((s) => s.setRightPanelWidth);
|
|
16
|
-
|
|
17
|
-
// 5 grid columns: sidebar | handle | center | handle | right panel.
|
|
18
|
-
// Handles occupy a 6px track each; center stays 1fr so it absorbs slack.
|
|
19
|
-
const gridTemplateColumns = `${sidebarWidth}px 6px 1fr 6px ${rightPanelWidth}px`;
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<div className="ide-root">
|
|
23
|
-
<div className="ide-layout" style={{ gridTemplateColumns }}>
|
|
24
|
-
<WorkspaceSidebar />
|
|
25
|
-
<ResizeHandle
|
|
26
|
-
side="left"
|
|
27
|
-
minWidth={SIDEBAR_MIN}
|
|
28
|
-
maxWidth={SIDEBAR_MAX}
|
|
29
|
-
getWidth={() => useStore.getState().sidebarWidth}
|
|
30
|
-
setWidth={setSidebarWidth}
|
|
31
|
-
/>
|
|
32
|
-
<div className="ide-center">
|
|
33
|
-
<SessionTabs />
|
|
34
|
-
<div className="ide-render">
|
|
35
|
-
<RenderArea />
|
|
36
|
-
</div>
|
|
37
|
-
<CommandInputBar />
|
|
38
|
-
</div>
|
|
39
|
-
<ResizeHandle
|
|
40
|
-
side="right"
|
|
41
|
-
minWidth={RIGHT_PANEL_MIN}
|
|
42
|
-
maxWidth={RIGHT_PANEL_MAX}
|
|
43
|
-
getWidth={() => useStore.getState().rightPanelWidth}
|
|
44
|
-
setWidth={setRightPanelWidth}
|
|
45
|
-
/>
|
|
46
|
-
<RightPanel />
|
|
47
|
-
</div>
|
|
48
|
-
<StatusBar />
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
|
-
import { render, screen, fireEvent, cleanup } from '@testing-library/react';
|
|
3
|
-
import ModelSelector from './ModelSelector.tsx';
|
|
4
|
-
import { resetStore } from '../test/component-helpers.ts';
|
|
5
|
-
import { makeSession } from '../test/fixtures.ts';
|
|
6
|
-
|
|
7
|
-
describe('ModelSelector', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
resetStore();
|
|
10
|
-
});
|
|
11
|
-
afterEach(() => {
|
|
12
|
-
cleanup();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('returns null when no active session', () => {
|
|
16
|
-
const { container } = render(<ModelSelector />);
|
|
17
|
-
expect(container.firstChild).toBeNull();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('renders button with provider and model label', () => {
|
|
21
|
-
const session = makeSession('s1', { model: 'gpt-5.6-sol', model_reasoning_effort: 'low' });
|
|
22
|
-
resetStore({ activeSessionId: 's1', sessions: [session] });
|
|
23
|
-
render(<ModelSelector />);
|
|
24
|
-
const btn = document.querySelector('.model-selector-btn') as HTMLElement;
|
|
25
|
-
expect(btn.textContent).toContain('Codex');
|
|
26
|
-
expect(btn.textContent).toContain('GPT-5.6-Sol');
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('opens popover with 3 columns on button click', () => {
|
|
30
|
-
const session = makeSession('s1', { model: 'gpt-5.6-sol', model_reasoning_effort: 'low' });
|
|
31
|
-
resetStore({ activeSessionId: 's1', sessions: [session] });
|
|
32
|
-
render(<ModelSelector />);
|
|
33
|
-
const btn = document.querySelector('.model-selector-btn') as HTMLElement;
|
|
34
|
-
fireEvent.click(btn);
|
|
35
|
-
expect(document.querySelector('.model-selector-popover')).toBeInTheDocument();
|
|
36
|
-
const headers = document.querySelectorAll('.model-selector-col-header');
|
|
37
|
-
expect(headers).toHaveLength(3);
|
|
38
|
-
expect(headers[0].textContent).toBe('Provider');
|
|
39
|
-
expect(headers[1].textContent).toBe('Model');
|
|
40
|
-
expect(headers[2].textContent).toBe('Thinking');
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('selecting a model calls updateModelConfig and closes popover', async () => {
|
|
44
|
-
const session = makeSession('s1', { model: 'gpt-5.6-sol', model_reasoning_effort: 'low' });
|
|
45
|
-
const updateModelConfig = vi.fn().mockResolvedValue(undefined);
|
|
46
|
-
resetStore({ activeSessionId: 's1', sessions: [session], updateModelConfig });
|
|
47
|
-
render(<ModelSelector />);
|
|
48
|
-
fireEvent.click(document.querySelector('.model-selector-btn')!);
|
|
49
|
-
// Click on "GPT-5.6-Terra" model
|
|
50
|
-
const terraItem = Array.from(document.querySelectorAll('.model-selector-item')).find((el) =>
|
|
51
|
-
el.textContent?.includes('GPT-5.6-Terra'),
|
|
52
|
-
)!;
|
|
53
|
-
fireEvent.click(terraItem);
|
|
54
|
-
expect(updateModelConfig).toHaveBeenCalledWith('gpt-5.6-terra', expect.any(String));
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('selecting reasoning calls updateModelConfig with current model', async () => {
|
|
58
|
-
const session = makeSession('s1', { model: 'gpt-5.6-sol', model_reasoning_effort: 'low' });
|
|
59
|
-
const updateModelConfig = vi.fn().mockResolvedValue(undefined);
|
|
60
|
-
resetStore({ activeSessionId: 's1', sessions: [session], updateModelConfig });
|
|
61
|
-
render(<ModelSelector />);
|
|
62
|
-
fireEvent.click(document.querySelector('.model-selector-btn')!);
|
|
63
|
-
// Click on "High" reasoning level
|
|
64
|
-
const highItem = Array.from(document.querySelectorAll('.model-selector-item')).find((el) =>
|
|
65
|
-
el.textContent?.trim() === 'High',
|
|
66
|
-
)!;
|
|
67
|
-
fireEvent.click(highItem);
|
|
68
|
-
expect(updateModelConfig).toHaveBeenCalledWith('gpt-5.6-sol', 'high');
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('reasoning cascade: switching to model without current reasoning level switches to default', async () => {
|
|
72
|
-
// gpt-5.5 has levels [low, medium, high, xhigh] — no "max" or "ultra"
|
|
73
|
-
// gpt-5.6-sol has levels [low, medium, high, xhigh, max, ultra]
|
|
74
|
-
// Switch from gpt-5.6-sol (reasoning=ultra) to gpt-5.5 → ultra not supported → default for gpt-5.5 is "medium"
|
|
75
|
-
const session = makeSession('s1', { model: 'gpt-5.6-sol', model_reasoning_effort: 'ultra' });
|
|
76
|
-
const updateModelConfig = vi.fn().mockResolvedValue(undefined);
|
|
77
|
-
resetStore({ activeSessionId: 's1', sessions: [session], updateModelConfig });
|
|
78
|
-
render(<ModelSelector />);
|
|
79
|
-
fireEvent.click(document.querySelector('.model-selector-btn')!);
|
|
80
|
-
// Click on "GPT-5.5" model
|
|
81
|
-
const gpt55Item = Array.from(document.querySelectorAll('.model-selector-item')).find((el) =>
|
|
82
|
-
el.textContent?.includes('GPT-5.5'),
|
|
83
|
-
)!;
|
|
84
|
-
fireEvent.click(gpt55Item);
|
|
85
|
-
// gpt-5.5 defaultReasoning is "medium"
|
|
86
|
-
expect(updateModelConfig).toHaveBeenCalledWith('gpt-5.5', 'medium');
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('clicking a different provider calls updateModelConfig with runtimeType and keeps popover open', async () => {
|
|
90
|
-
const session = makeSession('s1', { runtime_type: 'codex', model: 'gpt-5.6-sol', model_reasoning_effort: 'low' });
|
|
91
|
-
const updateModelConfig = vi.fn().mockResolvedValue(undefined);
|
|
92
|
-
resetStore({ activeSessionId: 's1', sessions: [session], updateModelConfig });
|
|
93
|
-
render(<ModelSelector />);
|
|
94
|
-
fireEvent.click(document.querySelector('.model-selector-btn')!);
|
|
95
|
-
// Click on "Claude" provider
|
|
96
|
-
const claudeItem = Array.from(document.querySelectorAll('.model-selector-item')).find((el) =>
|
|
97
|
-
el.textContent?.includes('Claude'),
|
|
98
|
-
)!;
|
|
99
|
-
fireEvent.click(claudeItem);
|
|
100
|
-
expect(updateModelConfig).toHaveBeenCalledWith('', '', 'claude');
|
|
101
|
-
// Popover should stay open
|
|
102
|
-
expect(document.querySelector('.model-selector-popover')).toBeInTheDocument();
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it('outside click closes popover', () => {
|
|
106
|
-
const session = makeSession('s1', { model: 'gpt-5.6-sol', model_reasoning_effort: 'low' });
|
|
107
|
-
resetStore({ activeSessionId: 's1', sessions: [session] });
|
|
108
|
-
render(
|
|
109
|
-
<div>
|
|
110
|
-
<div data-testid="outside">Outside</div>
|
|
111
|
-
<ModelSelector />
|
|
112
|
-
</div>,
|
|
113
|
-
);
|
|
114
|
-
fireEvent.click(document.querySelector('.model-selector-btn')!);
|
|
115
|
-
expect(document.querySelector('.model-selector-popover')).toBeInTheDocument();
|
|
116
|
-
fireEvent.mouseDown(screen.getByTestId('outside'));
|
|
117
|
-
expect(document.querySelector('.model-selector-popover')).toBeNull();
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
it('ESC closes popover', () => {
|
|
121
|
-
const session = makeSession('s1', { model: 'gpt-5.6-sol', model_reasoning_effort: 'low' });
|
|
122
|
-
resetStore({ activeSessionId: 's1', sessions: [session] });
|
|
123
|
-
render(<ModelSelector />);
|
|
124
|
-
fireEvent.click(document.querySelector('.model-selector-btn')!);
|
|
125
|
-
expect(document.querySelector('.model-selector-popover')).toBeInTheDocument();
|
|
126
|
-
fireEvent.keyDown(document, { key: 'Escape' });
|
|
127
|
-
expect(document.querySelector('.model-selector-popover')).toBeNull();
|
|
128
|
-
});
|
|
129
|
-
});
|