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,584 +0,0 @@
|
|
|
1
|
-
import { useRef, useState, useEffect, useCallback } from 'react';
|
|
2
|
-
import { ArrowUp, Square, Paperclip, X, FileText } from 'lucide-react';
|
|
3
|
-
import { useStore } from '../store/store.ts';
|
|
4
|
-
import SlashPopup, { type SlashCommand, filterCommands } from './input/SlashPopup.tsx';
|
|
5
|
-
import OptionSubPopup from './input/OptionSubPopup.tsx';
|
|
6
|
-
import SkillMentionPopup from './input/SkillMentionPopup.tsx';
|
|
7
|
-
import { useProvider } from '../hooks/useProvider.ts';
|
|
8
|
-
import { fetchProviderCommands } from '../api/providers.ts';
|
|
9
|
-
import type { ProviderSlashCommand, SessionRuntimeConfig, Extension, Attachment } from '../types/index.ts';
|
|
10
|
-
|
|
11
|
-
const MIN_HEIGHT = 32;
|
|
12
|
-
const MAX_HEIGHT = 200;
|
|
13
|
-
|
|
14
|
-
/** Parse runtime_config from the active session detail. */
|
|
15
|
-
function parseRuntimeConfig(json: string | null | undefined): SessionRuntimeConfig {
|
|
16
|
-
if (!json) return {};
|
|
17
|
-
try {
|
|
18
|
-
return JSON.parse(json) as SessionRuntimeConfig;
|
|
19
|
-
} catch {
|
|
20
|
-
return {};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** Format file size for display. */
|
|
25
|
-
function formatSize(bytes: number): string {
|
|
26
|
-
if (bytes < 1024) return `${bytes}B`;
|
|
27
|
-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
28
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** Frontend-only attachment type with preview URL and metadata. */
|
|
32
|
-
interface PendingAttachment {
|
|
33
|
-
id: string;
|
|
34
|
-
name: string;
|
|
35
|
-
media_type: string;
|
|
36
|
-
data: string; // base64 (no data: URI prefix)
|
|
37
|
-
previewUrl?: string; // object URL for image thumbnails
|
|
38
|
-
size: number;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** Generate a unique ID for pending attachments. */
|
|
42
|
-
let attachmentIdCounter = 0;
|
|
43
|
-
function nextAttachmentId(): string {
|
|
44
|
-
attachmentIdCounter += 1;
|
|
45
|
-
return `att-${Date.now()}-${attachmentIdCounter}`;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default function CommandInputBar() {
|
|
49
|
-
const [value, setValue] = useState('');
|
|
50
|
-
const taRef = useRef<HTMLTextAreaElement>(null);
|
|
51
|
-
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
52
|
-
const { submitPrompt, cancelTurn, updateRuntimeConfig, setShowModelSelector } = useStore();
|
|
53
|
-
const activeSessionId = useStore((s) => s.activeSessionId);
|
|
54
|
-
const detail = useStore((s) => (s.activeSessionId ? s.sessionDetails[s.activeSessionId] : null));
|
|
55
|
-
const restoredPrompt = useStore((s) => s.restoredPrompt);
|
|
56
|
-
const quotedText = useStore((s) => s.quotedText);
|
|
57
|
-
const isRunning = detail?.is_running === 1;
|
|
58
|
-
const noSession = !activeSessionId;
|
|
59
|
-
|
|
60
|
-
const { capabilities } = useProvider(detail?.runtime_type);
|
|
61
|
-
const runtimeType = detail?.runtime_type ?? null;
|
|
62
|
-
const canAttach = capabilities.imageAttachments;
|
|
63
|
-
|
|
64
|
-
// Attachment state
|
|
65
|
-
const [attachments, setAttachments] = useState<PendingAttachment[]>([]);
|
|
66
|
-
const [dragOver, setDragOver] = useState(false);
|
|
67
|
-
const [previewImage, setPreviewImage] = useState<PendingAttachment | null>(null);
|
|
68
|
-
|
|
69
|
-
// Provider-native slash commands (e.g. Claude CLI /compact, /clear) — fetched dynamically.
|
|
70
|
-
const [providerCommands, setProviderCommands] = useState<ProviderSlashCommand[]>([]);
|
|
71
|
-
useEffect(() => {
|
|
72
|
-
if (!runtimeType) {
|
|
73
|
-
setProviderCommands([]);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
let cancelled = false;
|
|
77
|
-
fetchProviderCommands(runtimeType)
|
|
78
|
-
.then((cmds) => { if (!cancelled) setProviderCommands(cmds); })
|
|
79
|
-
.catch(() => { if (!cancelled) setProviderCommands([]); });
|
|
80
|
-
return () => { cancelled = true; };
|
|
81
|
-
}, [runtimeType]);
|
|
82
|
-
|
|
83
|
-
// Slash popup state
|
|
84
|
-
const [slashOpen, setSlashOpen] = useState(false);
|
|
85
|
-
const [slashFilter, setSlashFilter] = useState('');
|
|
86
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
87
|
-
const [subPopup, setSubPopup] = useState<SlashCommand['subPopup']>(undefined);
|
|
88
|
-
const [skillPopup, setSkillPopup] = useState(false);
|
|
89
|
-
const [skillFilter, setSkillFilter] = useState('');
|
|
90
|
-
const [selectedSkills, setSelectedSkills] = useState<Extension[]>([]);
|
|
91
|
-
|
|
92
|
-
const commands = slashOpen ? filterCommands(slashFilter, capabilities, providerCommands) : [];
|
|
93
|
-
|
|
94
|
-
// Restore prompt after cancel
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
if (restoredPrompt !== null) {
|
|
97
|
-
setValue(restoredPrompt);
|
|
98
|
-
requestAnimationFrame(() => {
|
|
99
|
-
if (taRef.current) {
|
|
100
|
-
taRef.current.style.height = 'auto';
|
|
101
|
-
taRef.current.style.height = Math.min(taRef.current.scrollHeight, MAX_HEIGHT) + 'px';
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
useStore.setState({ restoredPrompt: null });
|
|
105
|
-
}
|
|
106
|
-
}, [restoredPrompt]);
|
|
107
|
-
|
|
108
|
-
// Append quoted text to input
|
|
109
|
-
useEffect(() => {
|
|
110
|
-
if (quotedText !== null) {
|
|
111
|
-
setValue((prev) => prev + quotedText);
|
|
112
|
-
setTimeout(() => {
|
|
113
|
-
if (taRef.current) {
|
|
114
|
-
taRef.current.style.height = 'auto';
|
|
115
|
-
taRef.current.style.height = Math.min(taRef.current.scrollHeight, MAX_HEIGHT) + 'px';
|
|
116
|
-
taRef.current.focus();
|
|
117
|
-
const len = taRef.current.value.length;
|
|
118
|
-
taRef.current.setSelectionRange(len, len);
|
|
119
|
-
}
|
|
120
|
-
}, 0);
|
|
121
|
-
useStore.setState({ quotedText: null });
|
|
122
|
-
}
|
|
123
|
-
}, [quotedText]);
|
|
124
|
-
|
|
125
|
-
// ESC to cancel running turn (global — textarea is disabled while running)
|
|
126
|
-
useEffect(() => {
|
|
127
|
-
if (!isRunning) return;
|
|
128
|
-
function onKey(e: KeyboardEvent) {
|
|
129
|
-
if (e.key === 'Escape') {
|
|
130
|
-
e.preventDefault();
|
|
131
|
-
cancelTurn();
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
window.addEventListener('keydown', onKey);
|
|
135
|
-
return () => window.removeEventListener('keydown', onKey);
|
|
136
|
-
}, [isRunning, cancelTurn]);
|
|
137
|
-
|
|
138
|
-
// Close slash popup when session changes + clear attachments
|
|
139
|
-
useEffect(() => {
|
|
140
|
-
setSlashOpen(false);
|
|
141
|
-
setSubPopup(undefined);
|
|
142
|
-
setSkillPopup(false);
|
|
143
|
-
setSelectedSkills([]);
|
|
144
|
-
// Revoke all preview URLs and clear attachments
|
|
145
|
-
setAttachments((prev) => {
|
|
146
|
-
for (const att of prev) {
|
|
147
|
-
if (att.previewUrl) URL.revokeObjectURL(att.previewUrl);
|
|
148
|
-
}
|
|
149
|
-
return [];
|
|
150
|
-
});
|
|
151
|
-
}, [activeSessionId]);
|
|
152
|
-
|
|
153
|
-
// Esc key to close image preview modal
|
|
154
|
-
useEffect(() => {
|
|
155
|
-
if (!previewImage) return;
|
|
156
|
-
function onKey(e: KeyboardEvent) {
|
|
157
|
-
if (e.key === 'Escape') {
|
|
158
|
-
e.preventDefault();
|
|
159
|
-
setPreviewImage(null);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
window.addEventListener('keydown', onKey);
|
|
163
|
-
return () => window.removeEventListener('keydown', onKey);
|
|
164
|
-
}, [previewImage]);
|
|
165
|
-
|
|
166
|
-
// --- Attachment handlers ---
|
|
167
|
-
|
|
168
|
-
const handleFiles = useCallback((files: FileList | File[] | null): void => {
|
|
169
|
-
if (!files) return;
|
|
170
|
-
const fileArray = Array.from(files);
|
|
171
|
-
for (const file of fileArray) {
|
|
172
|
-
const reader = new FileReader();
|
|
173
|
-
reader.onload = () => {
|
|
174
|
-
const result = reader.result as string;
|
|
175
|
-
// result = "data:image/png;base64,iVBOR..."
|
|
176
|
-
const base64 = result.split(',')[1] ?? '';
|
|
177
|
-
const previewUrl = file.type.startsWith('image/') ? URL.createObjectURL(file) : undefined;
|
|
178
|
-
setAttachments((prev) => [...prev, {
|
|
179
|
-
id: nextAttachmentId(),
|
|
180
|
-
name: file.name,
|
|
181
|
-
media_type: file.type || 'application/octet-stream',
|
|
182
|
-
data: base64,
|
|
183
|
-
previewUrl,
|
|
184
|
-
size: file.size,
|
|
185
|
-
}]);
|
|
186
|
-
};
|
|
187
|
-
reader.readAsDataURL(file);
|
|
188
|
-
}
|
|
189
|
-
}, []);
|
|
190
|
-
|
|
191
|
-
const removeAttachment = useCallback((id: string): void => {
|
|
192
|
-
setAttachments((prev) => {
|
|
193
|
-
const removed = prev.find((a) => a.id === id);
|
|
194
|
-
if (removed?.previewUrl) URL.revokeObjectURL(removed.previewUrl);
|
|
195
|
-
return prev.filter((a) => a.id !== id);
|
|
196
|
-
});
|
|
197
|
-
}, []);
|
|
198
|
-
|
|
199
|
-
// --- Drag and drop ---
|
|
200
|
-
const handleDragOver = useCallback((e: React.DragEvent) => {
|
|
201
|
-
e.preventDefault();
|
|
202
|
-
e.stopPropagation();
|
|
203
|
-
if (!canAttach || isRunning) return;
|
|
204
|
-
setDragOver(true);
|
|
205
|
-
}, [canAttach, isRunning]);
|
|
206
|
-
|
|
207
|
-
const handleDragLeave = useCallback((e: React.DragEvent) => {
|
|
208
|
-
e.preventDefault();
|
|
209
|
-
e.stopPropagation();
|
|
210
|
-
setDragOver(false);
|
|
211
|
-
}, []);
|
|
212
|
-
|
|
213
|
-
const handleDrop = useCallback((e: React.DragEvent) => {
|
|
214
|
-
e.preventDefault();
|
|
215
|
-
e.stopPropagation();
|
|
216
|
-
setDragOver(false);
|
|
217
|
-
if (!canAttach || isRunning) return;
|
|
218
|
-
handleFiles(e.dataTransfer.files);
|
|
219
|
-
}, [canAttach, isRunning, handleFiles]);
|
|
220
|
-
|
|
221
|
-
// --- Paste handler ---
|
|
222
|
-
const handlePaste = useCallback((e: React.ClipboardEvent) => {
|
|
223
|
-
if (!canAttach) return;
|
|
224
|
-
const items = e.clipboardData?.items;
|
|
225
|
-
if (!items) return;
|
|
226
|
-
const imageFiles: File[] = [];
|
|
227
|
-
for (let i = 0; i < items.length; i++) {
|
|
228
|
-
const item = items[i];
|
|
229
|
-
if (item.type.startsWith('image/')) {
|
|
230
|
-
const file = item.getAsFile();
|
|
231
|
-
if (file) imageFiles.push(file);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
if (imageFiles.length > 0) {
|
|
235
|
-
e.preventDefault();
|
|
236
|
-
handleFiles(imageFiles);
|
|
237
|
-
}
|
|
238
|
-
}, [canAttach, handleFiles]);
|
|
239
|
-
|
|
240
|
-
function autoResize() {
|
|
241
|
-
const el = taRef.current;
|
|
242
|
-
if (!el) return;
|
|
243
|
-
el.style.height = 'auto';
|
|
244
|
-
el.style.height = Math.min(el.scrollHeight, MAX_HEIGHT) + 'px';
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
function handleSend() {
|
|
248
|
-
const v = value.trim();
|
|
249
|
-
if (!v || isRunning) return;
|
|
250
|
-
|
|
251
|
-
// Build prompt with skill prefixes
|
|
252
|
-
let prompt = v;
|
|
253
|
-
if (selectedSkills.length > 0) {
|
|
254
|
-
const skillPrefix = selectedSkills.map((s) => `$${s.name}`).join(' ');
|
|
255
|
-
prompt = `${skillPrefix}\n\n${v}`;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// Map pending attachments to shared Attachment type (strip id, previewUrl, size)
|
|
259
|
-
const sentAttachments: Attachment[] = attachments.map(({ id: _id, previewUrl: _previewUrl, size: _size, ...rest }) => rest);
|
|
260
|
-
|
|
261
|
-
setValue('');
|
|
262
|
-
setSelectedSkills([]);
|
|
263
|
-
if (taRef.current) taRef.current.style.height = MIN_HEIGHT + 'px';
|
|
264
|
-
setSlashOpen(false);
|
|
265
|
-
setSubPopup(undefined);
|
|
266
|
-
setSkillPopup(false);
|
|
267
|
-
|
|
268
|
-
// Revoke all preview URLs and clear attachments
|
|
269
|
-
for (const att of attachments) {
|
|
270
|
-
if (att.previewUrl) URL.revokeObjectURL(att.previewUrl);
|
|
271
|
-
}
|
|
272
|
-
setAttachments([]);
|
|
273
|
-
|
|
274
|
-
submitPrompt(prompt, sentAttachments.length > 0 ? sentAttachments : undefined);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
function handleSlashCommand(cmd: SlashCommand) {
|
|
278
|
-
// Provider-native commands (e.g. /compact) — insert as text; the runtime interprets them.
|
|
279
|
-
if (cmd.insertAsText) {
|
|
280
|
-
const replacement = `/${cmd.id} `;
|
|
281
|
-
setValue(replacement);
|
|
282
|
-
setSlashOpen(false);
|
|
283
|
-
setSubPopup(undefined);
|
|
284
|
-
requestAnimationFrame(() => {
|
|
285
|
-
if (taRef.current) {
|
|
286
|
-
taRef.current.focus();
|
|
287
|
-
const len = replacement.length;
|
|
288
|
-
taRef.current.setSelectionRange(len, len);
|
|
289
|
-
taRef.current.style.height = 'auto';
|
|
290
|
-
taRef.current.style.height = Math.min(taRef.current.scrollHeight, MAX_HEIGHT) + 'px';
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
if (cmd.subPopup) {
|
|
296
|
-
setSubPopup(cmd.subPopup);
|
|
297
|
-
} else if (cmd.id === 'skills') {
|
|
298
|
-
setSkillPopup(true);
|
|
299
|
-
setSkillFilter('');
|
|
300
|
-
setSlashOpen(false);
|
|
301
|
-
setValue('');
|
|
302
|
-
} else if (cmd.id === 'model') {
|
|
303
|
-
setShowModelSelector(true);
|
|
304
|
-
setSlashOpen(false);
|
|
305
|
-
setValue('');
|
|
306
|
-
} else {
|
|
307
|
-
setSlashOpen(false);
|
|
308
|
-
setValue('');
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
function handleSkillSelect(skill: Extension) {
|
|
313
|
-
setSelectedSkills((prev) => [...prev, skill]);
|
|
314
|
-
setSkillPopup(false);
|
|
315
|
-
setValue('');
|
|
316
|
-
if (taRef.current) taRef.current.style.height = MIN_HEIGHT + 'px';
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
function handleOptionSelect(optionValue: string) {
|
|
320
|
-
const config = parseRuntimeConfig(detail?.runtime_config);
|
|
321
|
-
|
|
322
|
-
if (subPopup === 'sandbox') {
|
|
323
|
-
config.sandboxMode = optionValue as SessionRuntimeConfig['sandboxMode'];
|
|
324
|
-
} else if (subPopup === 'websearch') {
|
|
325
|
-
config.webSearchMode = optionValue as SessionRuntimeConfig['webSearchMode'];
|
|
326
|
-
} else if (subPopup === 'network') {
|
|
327
|
-
config.networkAccessEnabled = optionValue === 'true';
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
updateRuntimeConfig(config as Record<string, unknown>);
|
|
331
|
-
setSubPopup(undefined);
|
|
332
|
-
setSlashOpen(false);
|
|
333
|
-
setValue('');
|
|
334
|
-
if (taRef.current) taRef.current.style.height = MIN_HEIGHT + 'px';
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
function handleKeyDown(e: React.KeyboardEvent) {
|
|
338
|
-
// Slash popup keyboard navigation
|
|
339
|
-
if (slashOpen && !subPopup) {
|
|
340
|
-
if (e.key === 'ArrowDown') {
|
|
341
|
-
e.preventDefault();
|
|
342
|
-
setSelectedIndex((i) => Math.min(i + 1, commands.length - 1));
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
if (e.key === 'ArrowUp') {
|
|
346
|
-
e.preventDefault();
|
|
347
|
-
setSelectedIndex((i) => Math.max(i - 1, 0));
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
if (e.key === 'Enter') {
|
|
351
|
-
e.preventDefault();
|
|
352
|
-
if (commands[selectedIndex]) {
|
|
353
|
-
handleSlashCommand(commands[selectedIndex]);
|
|
354
|
-
}
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
if (e.key === 'Escape') {
|
|
358
|
-
e.preventDefault();
|
|
359
|
-
setSlashOpen(false);
|
|
360
|
-
setValue('');
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
if (subPopup && e.key === 'Escape') {
|
|
366
|
-
e.preventDefault();
|
|
367
|
-
setSubPopup(undefined);
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// Cmd/Ctrl+Enter to send
|
|
372
|
-
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey) && !isRunning) {
|
|
373
|
-
e.preventDefault();
|
|
374
|
-
handleSend();
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
// ESC to cancel while running
|
|
379
|
-
if (e.key === 'Escape' && isRunning) {
|
|
380
|
-
e.preventDefault();
|
|
381
|
-
cancelTurn();
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
function handleChange(e: React.ChangeEvent<HTMLTextAreaElement>) {
|
|
386
|
-
const newValue = e.target.value;
|
|
387
|
-
setValue(newValue);
|
|
388
|
-
autoResize();
|
|
389
|
-
|
|
390
|
-
// Detect `/` at start of input → slash popup
|
|
391
|
-
if (newValue.startsWith('/') && !newValue.includes(' ') && !isRunning) {
|
|
392
|
-
setSlashOpen(true);
|
|
393
|
-
setSlashFilter(newValue.slice(1));
|
|
394
|
-
setSelectedIndex(0);
|
|
395
|
-
} else {
|
|
396
|
-
setSlashOpen(false);
|
|
397
|
-
setSubPopup(undefined);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
// Detect `$` trigger anywhere → skill popup
|
|
401
|
-
if (newValue.startsWith('$') && !isRunning) {
|
|
402
|
-
setSkillPopup(true);
|
|
403
|
-
setSkillFilter(newValue.slice(1));
|
|
404
|
-
} else if (!newValue.startsWith('$')) {
|
|
405
|
-
setSkillPopup(false);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
const currentConfig = parseRuntimeConfig(detail?.runtime_config);
|
|
410
|
-
|
|
411
|
-
const sandboxOptions = [
|
|
412
|
-
{ value: 'read-only', label: 'Read Only', description: 'Agent can only read files' },
|
|
413
|
-
{ value: 'workspace-write', label: 'Workspace Write', description: 'Agent can read and write in workspace' },
|
|
414
|
-
{ value: 'danger-full-access', label: 'Danger Full Access', description: 'Agent has unrestricted access' },
|
|
415
|
-
];
|
|
416
|
-
|
|
417
|
-
const webSearchOptions = [
|
|
418
|
-
{ value: 'disabled', label: 'Disabled', description: 'No web search' },
|
|
419
|
-
{ value: 'cached', label: 'Cached', description: 'Use cached search results' },
|
|
420
|
-
{ value: 'live', label: 'Live', description: 'Perform live web searches' },
|
|
421
|
-
];
|
|
422
|
-
|
|
423
|
-
const networkOptions = [
|
|
424
|
-
{ value: 'false', label: 'Disabled', description: 'No network access' },
|
|
425
|
-
{ value: 'true', label: 'Enabled', description: 'Allow network access in sandbox' },
|
|
426
|
-
];
|
|
427
|
-
|
|
428
|
-
return (
|
|
429
|
-
<div
|
|
430
|
-
className={`cmd-bar${dragOver ? ' drag-over' : ''}`}
|
|
431
|
-
onDragOver={handleDragOver}
|
|
432
|
-
onDragLeave={handleDragLeave}
|
|
433
|
-
onDrop={handleDrop}
|
|
434
|
-
>
|
|
435
|
-
{slashOpen && !subPopup && (
|
|
436
|
-
<SlashPopup
|
|
437
|
-
commands={commands}
|
|
438
|
-
selectedIndex={selectedIndex}
|
|
439
|
-
onSelect={handleSlashCommand}
|
|
440
|
-
onHover={setSelectedIndex}
|
|
441
|
-
/>
|
|
442
|
-
)}
|
|
443
|
-
{slashOpen && subPopup === 'sandbox' && (
|
|
444
|
-
<OptionSubPopup
|
|
445
|
-
title="Sandbox Mode"
|
|
446
|
-
options={sandboxOptions}
|
|
447
|
-
currentValue={currentConfig.sandboxMode}
|
|
448
|
-
onSelect={handleOptionSelect}
|
|
449
|
-
onClose={() => setSubPopup(undefined)}
|
|
450
|
-
/>
|
|
451
|
-
)}
|
|
452
|
-
{slashOpen && subPopup === 'websearch' && (
|
|
453
|
-
<OptionSubPopup
|
|
454
|
-
title="Web Search"
|
|
455
|
-
options={webSearchOptions}
|
|
456
|
-
currentValue={currentConfig.webSearchMode}
|
|
457
|
-
onSelect={handleOptionSelect}
|
|
458
|
-
onClose={() => setSubPopup(undefined)}
|
|
459
|
-
/>
|
|
460
|
-
)}
|
|
461
|
-
{slashOpen && subPopup === 'network' && (
|
|
462
|
-
<OptionSubPopup
|
|
463
|
-
title="Network Access"
|
|
464
|
-
options={networkOptions}
|
|
465
|
-
currentValue={currentConfig.networkAccessEnabled === true ? 'true' : 'false'}
|
|
466
|
-
onSelect={handleOptionSelect}
|
|
467
|
-
onClose={() => setSubPopup(undefined)}
|
|
468
|
-
/>
|
|
469
|
-
)}
|
|
470
|
-
{skillPopup && (
|
|
471
|
-
<SkillMentionPopup
|
|
472
|
-
filter={skillFilter}
|
|
473
|
-
onSelect={handleSkillSelect}
|
|
474
|
-
onClose={() => { setSkillPopup(false); setValue(''); }}
|
|
475
|
-
/>
|
|
476
|
-
)}
|
|
477
|
-
{selectedSkills.length > 0 && (
|
|
478
|
-
<div className="skill-badges">
|
|
479
|
-
{selectedSkills.map((s) => (
|
|
480
|
-
<span key={s.id} className="skill-badge">
|
|
481
|
-
${s.name}
|
|
482
|
-
<button className="skill-badge-remove" onClick={() => setSelectedSkills((prev) => prev.filter((x) => x.id !== s.id))}>×</button>
|
|
483
|
-
</span>
|
|
484
|
-
))}
|
|
485
|
-
</div>
|
|
486
|
-
)}
|
|
487
|
-
{attachments.length > 0 && (
|
|
488
|
-
<div className="attachment-preview-area">
|
|
489
|
-
{attachments.map((att) => (
|
|
490
|
-
<div key={att.id} className="attachment-chip" title={att.name}>
|
|
491
|
-
{att.previewUrl ? (
|
|
492
|
-
<img
|
|
493
|
-
src={att.previewUrl}
|
|
494
|
-
alt={att.name}
|
|
495
|
-
className="attachment-thumb"
|
|
496
|
-
onClick={() => setPreviewImage(att)}
|
|
497
|
-
style={{ cursor: 'pointer' }}
|
|
498
|
-
/>
|
|
499
|
-
) : (
|
|
500
|
-
<FileText size={20} className="attachment-file-icon" />
|
|
501
|
-
)}
|
|
502
|
-
<div className="attachment-info">
|
|
503
|
-
<span className="attachment-name">{att.name}</span>
|
|
504
|
-
<span className="attachment-size">{formatSize(att.size)}</span>
|
|
505
|
-
</div>
|
|
506
|
-
<button
|
|
507
|
-
className="attachment-remove"
|
|
508
|
-
onClick={() => removeAttachment(att.id)}
|
|
509
|
-
title="Remove attachment"
|
|
510
|
-
>
|
|
511
|
-
<X size={14} />
|
|
512
|
-
</button>
|
|
513
|
-
</div>
|
|
514
|
-
))}
|
|
515
|
-
</div>
|
|
516
|
-
)}
|
|
517
|
-
{canAttach && !isRunning && !noSession && (
|
|
518
|
-
<input
|
|
519
|
-
ref={fileInputRef}
|
|
520
|
-
type="file"
|
|
521
|
-
multiple
|
|
522
|
-
accept="image/*,application/pdf,text/*,.ts,.js,.tsx,.jsx,.py,.go,.rs,.java,.c,.cpp,.h,.css,.html,.xml,.yml,.yaml,.toml,.ini,.sh,.sql"
|
|
523
|
-
style={{ display: 'none' }}
|
|
524
|
-
onChange={(e) => {
|
|
525
|
-
handleFiles(e.target.files);
|
|
526
|
-
e.target.value = '';
|
|
527
|
-
}}
|
|
528
|
-
/>
|
|
529
|
-
)}
|
|
530
|
-
<div className="cmd-input-row">
|
|
531
|
-
{canAttach && !isRunning && !noSession && (
|
|
532
|
-
<button
|
|
533
|
-
className="attachment-clip-btn"
|
|
534
|
-
onClick={() => fileInputRef.current?.click()}
|
|
535
|
-
title="Attach files"
|
|
536
|
-
disabled={isRunning}
|
|
537
|
-
>
|
|
538
|
-
<Paperclip size={16} />
|
|
539
|
-
</button>
|
|
540
|
-
)}
|
|
541
|
-
<textarea
|
|
542
|
-
ref={taRef}
|
|
543
|
-
className="cmd-textarea"
|
|
544
|
-
placeholder={
|
|
545
|
-
noSession ? 'Select or create a session…' : isRunning ? 'Agent is running…' : 'Type a message… Use / for commands'
|
|
546
|
-
}
|
|
547
|
-
autoComplete="off"
|
|
548
|
-
value={value}
|
|
549
|
-
disabled={isRunning || noSession}
|
|
550
|
-
rows={1}
|
|
551
|
-
style={{ minHeight: MIN_HEIGHT, maxHeight: MAX_HEIGHT }}
|
|
552
|
-
onChange={handleChange}
|
|
553
|
-
onKeyDown={handleKeyDown}
|
|
554
|
-
onPaste={handlePaste}
|
|
555
|
-
/>
|
|
556
|
-
{isRunning ? (
|
|
557
|
-
<button className="cmd-stop-btn" onClick={() => cancelTurn()} title="Stop (Esc)">
|
|
558
|
-
<Square size={15} />
|
|
559
|
-
</button>
|
|
560
|
-
) : (
|
|
561
|
-
<button className="cmd-send-btn" onClick={handleSend} disabled={!value.trim() || noSession} title="Send (⌘↵)">
|
|
562
|
-
<ArrowUp size={16} />
|
|
563
|
-
</button>
|
|
564
|
-
)}
|
|
565
|
-
</div>
|
|
566
|
-
|
|
567
|
-
{/* Image preview modal — only for images */}
|
|
568
|
-
{previewImage && (
|
|
569
|
-
<div className="image-preview-modal" onClick={() => setPreviewImage(null)}>
|
|
570
|
-
<div className="image-preview-content" onClick={(e) => e.stopPropagation()}>
|
|
571
|
-
<img src={previewImage.previewUrl} alt={previewImage.name} />
|
|
572
|
-
<div className="image-preview-info">
|
|
573
|
-
<span>{previewImage.name}</span>
|
|
574
|
-
<span>{formatSize(previewImage.size)}</span>
|
|
575
|
-
</div>
|
|
576
|
-
<button className="image-preview-close" onClick={() => setPreviewImage(null)}>
|
|
577
|
-
<X size={20} />
|
|
578
|
-
</button>
|
|
579
|
-
</div>
|
|
580
|
-
</div>
|
|
581
|
-
)}
|
|
582
|
-
</div>
|
|
583
|
-
);
|
|
584
|
-
}
|