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,62 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
/* === Surface Ladder === */
|
|
3
|
-
--canvas: #fdfdfc;
|
|
4
|
-
--surface-0: #f8f7f5;
|
|
5
|
-
--surface-1: #f0efed;
|
|
6
|
-
--surface-2: #e6e4e0;
|
|
7
|
-
--surface-3: #d6d3cd;
|
|
8
|
-
|
|
9
|
-
/* === Borders === */
|
|
10
|
-
--border: #e2e0db;
|
|
11
|
-
--border-muted: #edebe7;
|
|
12
|
-
--border-hover: #ccc8c0;
|
|
13
|
-
|
|
14
|
-
/* === Text === */
|
|
15
|
-
--text: #1c1b18;
|
|
16
|
-
--text-2: #54504a;
|
|
17
|
-
--text-3: #78736c;
|
|
18
|
-
--text-muted: #a8a399;
|
|
19
|
-
|
|
20
|
-
/* === Accent (Amber) === */
|
|
21
|
-
--accent: #d97706;
|
|
22
|
-
--accent-hover: #b45309;
|
|
23
|
-
--accent-soft: rgba(217, 119, 6, 0.08);
|
|
24
|
-
--accent-glow: rgba(217, 119, 6, 0.2);
|
|
25
|
-
|
|
26
|
-
/* === Status colors === */
|
|
27
|
-
--green: #16a34a;
|
|
28
|
-
--amber: #ca8a04;
|
|
29
|
-
--red: #dc2626;
|
|
30
|
-
--green-soft: rgba(22, 163, 74, 0.08);
|
|
31
|
-
--amber-soft: rgba(202, 138, 4, 0.08);
|
|
32
|
-
--red-soft: rgba(220, 38, 38, 0.08);
|
|
33
|
-
|
|
34
|
-
/* === Runtime icons === */
|
|
35
|
-
--ic-claude: #c2410c;
|
|
36
|
-
--ic-codex: #6366f1;
|
|
37
|
-
--ic-repoburg: #059669;
|
|
38
|
-
--ic-cursor: #db2777;
|
|
39
|
-
|
|
40
|
-
/* === Typography === */
|
|
41
|
-
--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
42
|
-
--font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
|
|
43
|
-
|
|
44
|
-
/* === Radius === */
|
|
45
|
-
--r-sm: 4px;
|
|
46
|
-
--r-md: 6px;
|
|
47
|
-
--r-lg: 8px;
|
|
48
|
-
--r-xl: 12px;
|
|
49
|
-
--r-pill: 9999px;
|
|
50
|
-
|
|
51
|
-
/* === Motion === */
|
|
52
|
-
--ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
53
|
-
--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
|
|
54
|
-
--dur-fast: 100ms;
|
|
55
|
-
--dur-normal: 150ms;
|
|
56
|
-
--dur-slow: 250ms;
|
|
57
|
-
|
|
58
|
-
/* === Shadows === */
|
|
59
|
-
--inset-highlight: inset 0 1px 0 rgba(0, 0, 0, 0.03);
|
|
60
|
-
--inset-strong: inset 0 1px 0 rgba(0, 0, 0, 0.05);
|
|
61
|
-
--focus-ring: 0 0 0 3px var(--accent-glow);
|
|
62
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared helpers for component tests that use the Zustand store.
|
|
3
|
-
*
|
|
4
|
-
* NOTE: vi.mock calls CANNOT be wrapped in a function — vitest only hoists
|
|
5
|
-
* vi.mock when it's called at the top level of the test file. Each test file
|
|
6
|
-
* must include vi.mock calls directly at the top level.
|
|
7
|
-
*
|
|
8
|
-
* This module only provides the store reset utility.
|
|
9
|
-
*/
|
|
10
|
-
import { useStore } from '../store/store.ts';
|
|
11
|
-
|
|
12
|
-
/** Reset useStore to initial state with optional overrides. */
|
|
13
|
-
export function resetStore(overrides: Record<string, unknown> = {}): void {
|
|
14
|
-
useStore.setState({
|
|
15
|
-
sessions: [],
|
|
16
|
-
workspaces: [],
|
|
17
|
-
sessionDetails: {},
|
|
18
|
-
activeSessionId: null,
|
|
19
|
-
openTabs: [],
|
|
20
|
-
activeTurnIndex: 0,
|
|
21
|
-
activeRightTab: 'turns',
|
|
22
|
-
changesScope: 'session',
|
|
23
|
-
eventLog: [],
|
|
24
|
-
loading: false,
|
|
25
|
-
error: null,
|
|
26
|
-
showNewSessionDialog: false,
|
|
27
|
-
wsConnected: false,
|
|
28
|
-
toasts: [],
|
|
29
|
-
showCommandPalette: false,
|
|
30
|
-
submittingPrompt: null,
|
|
31
|
-
selectedChangePath: null,
|
|
32
|
-
restoredPrompt: null,
|
|
33
|
-
lastModelConfig: null,
|
|
34
|
-
sidebarWidth: 240,
|
|
35
|
-
rightPanelWidth: 300,
|
|
36
|
-
...overrides,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared test fixtures for frontend tests.
|
|
3
|
-
*
|
|
4
|
-
* Factory functions for creating typed test objects with sensible defaults.
|
|
5
|
-
* Imported by store tests and component tests to keep fixture logic DRY.
|
|
6
|
-
*/
|
|
7
|
-
import type { Session, SessionDetail, Turn, Item, ItemType, TokenUsage, Workspace } from '@agentpane/shared';
|
|
8
|
-
|
|
9
|
-
const NOW = '2025-01-01T00:00:00Z';
|
|
10
|
-
|
|
11
|
-
/** Create a Session with optional overrides. */
|
|
12
|
-
export function makeSession(id: string, overrides: Partial<Session> = {}): Session {
|
|
13
|
-
return {
|
|
14
|
-
id,
|
|
15
|
-
title: null,
|
|
16
|
-
runtime_type: 'codex',
|
|
17
|
-
model: null,
|
|
18
|
-
model_reasoning_effort: null,
|
|
19
|
-
cwd: null,
|
|
20
|
-
external_thread_id: null,
|
|
21
|
-
status: 'active',
|
|
22
|
-
is_running: 0,
|
|
23
|
-
lifecycle: 'working',
|
|
24
|
-
has_unreviewed: 0,
|
|
25
|
-
runtime_config: null,
|
|
26
|
-
rewound_at_turn_id: null,
|
|
27
|
-
pre_rewind_thread_id: null,
|
|
28
|
-
created_at: NOW,
|
|
29
|
-
updated_at: NOW,
|
|
30
|
-
...overrides,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** Create a SessionDetail with turns and optional overrides. */
|
|
35
|
-
export function makeDetail(id: string, turns: Turn[] = [], overrides: Partial<SessionDetail> = {}): SessionDetail {
|
|
36
|
-
return {
|
|
37
|
-
...makeSession(id),
|
|
38
|
-
turns,
|
|
39
|
-
...overrides,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** Create a Turn with optional overrides. */
|
|
44
|
-
export function makeTurn(id: string, sessionId: string, overrides: Partial<Turn> = {}): Turn {
|
|
45
|
-
return {
|
|
46
|
-
id,
|
|
47
|
-
session_id: sessionId,
|
|
48
|
-
user_prompt: 'test prompt',
|
|
49
|
-
agent_response: null,
|
|
50
|
-
thoughts: null,
|
|
51
|
-
token_usage: null,
|
|
52
|
-
external_turn_id: null,
|
|
53
|
-
status: 'completed',
|
|
54
|
-
error: null,
|
|
55
|
-
thread_id: null,
|
|
56
|
-
attachments: null,
|
|
57
|
-
created_at: NOW,
|
|
58
|
-
updated_at: NOW,
|
|
59
|
-
items: [],
|
|
60
|
-
...overrides,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** Create an Item with a given type and optional data. */
|
|
65
|
-
export function makeItem(id: string, turnId: string, type: ItemType = 'agent_message'): Item {
|
|
66
|
-
return {
|
|
67
|
-
id,
|
|
68
|
-
turn_id: turnId,
|
|
69
|
-
external_item_id: `ext-${id}`,
|
|
70
|
-
type,
|
|
71
|
-
data: { text: 'hello' },
|
|
72
|
-
status: 'completed',
|
|
73
|
-
created_at: NOW,
|
|
74
|
-
updated_at: NOW,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/** Create a TokenUsage object with optional overrides. */
|
|
79
|
-
export function makeUsage(overrides: Partial<TokenUsage> = {}): TokenUsage {
|
|
80
|
-
return {
|
|
81
|
-
input_tokens: 100,
|
|
82
|
-
cached_input_tokens: 0,
|
|
83
|
-
cache_write_input_tokens: 0,
|
|
84
|
-
output_tokens: 200,
|
|
85
|
-
reasoning_output_tokens: 0,
|
|
86
|
-
...overrides,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** Create a Workspace with optional overrides. */
|
|
91
|
-
export function makeWorkspace(id: string, path: string, overrides: Partial<Workspace> = {}): Workspace {
|
|
92
|
-
return {
|
|
93
|
-
id,
|
|
94
|
-
path,
|
|
95
|
-
label: null,
|
|
96
|
-
deleted: 0,
|
|
97
|
-
created_at: NOW,
|
|
98
|
-
...overrides,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
|
-
import { runtimeIcon, formatDuration, statusToDot, statusToLabel } from './index.ts';
|
|
3
|
-
|
|
4
|
-
describe('runtimeIcon', () => {
|
|
5
|
-
it('maps codex to ic-codex/CX', () => {
|
|
6
|
-
expect(runtimeIcon('codex')).toEqual({ iconClass: 'ic-codex', iconText: 'CX' });
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
it('maps claude to ic-claude/CL', () => {
|
|
10
|
-
expect(runtimeIcon('claude')).toEqual({ iconClass: 'ic-claude', iconText: 'CL' });
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('maps repoburg to ic-repoburg/RB', () => {
|
|
14
|
-
expect(runtimeIcon('repoburg')).toEqual({ iconClass: 'ic-repoburg', iconText: 'RB' });
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('maps cursor to ic-cursor/CR', () => {
|
|
18
|
-
expect(runtimeIcon('cursor')).toEqual({ iconClass: 'ic-cursor', iconText: 'CR' });
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('defaults to codex for unknown runtime', () => {
|
|
22
|
-
expect(runtimeIcon('unknown')).toEqual({ iconClass: 'ic-codex', iconText: 'CX' });
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe('formatDuration', () => {
|
|
27
|
-
beforeEach(() => {
|
|
28
|
-
vi.useFakeTimers();
|
|
29
|
-
vi.setSystemTime(new Date('2025-01-01T00:01:00Z'));
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
afterEach(() => {
|
|
33
|
-
vi.useRealTimers();
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('returns seconds only for <60s', () => {
|
|
37
|
-
expect(formatDuration('2025-01-01T00:00:45Z', '2025-01-01T00:00:50Z')).toBe('5s');
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('returns 0s for same timestamps', () => {
|
|
41
|
-
expect(formatDuration('2025-01-01T00:00:00Z', '2025-01-01T00:00:00Z')).toBe('0s');
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('returns minutes and seconds for 60-3599s', () => {
|
|
45
|
-
expect(formatDuration('2025-01-01T00:00:00Z', '2025-01-01T00:03:42Z')).toBe('3m 42s');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('returns hours and minutes for >=3600s', () => {
|
|
49
|
-
expect(formatDuration('2025-01-01T00:00:00Z', '2025-01-01T01:23:00Z')).toBe('1h 23m');
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('uses Date.now() when endISO is null', () => {
|
|
53
|
-
// start is 2025-01-01T00:00:00Z, now is 2025-01-01T00:01:00Z → 60s
|
|
54
|
-
expect(formatDuration('2025-01-01T00:00:00Z', null)).toBe('1m 0s');
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
describe('statusToDot', () => {
|
|
59
|
-
it('returns empty string when lifecycle is finished', () => {
|
|
60
|
-
expect(statusToDot('active', false, false, 'finished')).toBe('');
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('returns running when isRunning is true', () => {
|
|
64
|
-
expect(statusToDot('active', true)).toBe('running');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('returns queued when hasUnreviewed and not failed', () => {
|
|
68
|
-
expect(statusToDot('active', false, true)).toBe('queued');
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('does not return queued when hasUnreviewed and status is failed', () => {
|
|
72
|
-
expect(statusToDot('failed', false, true)).toBe('error');
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('returns error for failed status', () => {
|
|
76
|
-
expect(statusToDot('failed', false)).toBe('error');
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('returns paused for aborted status', () => {
|
|
80
|
-
expect(statusToDot('aborted', false)).toBe('paused');
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('returns paused for active status (default)', () => {
|
|
84
|
-
expect(statusToDot('active', false)).toBe('paused');
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('returns paused for completed status', () => {
|
|
88
|
-
expect(statusToDot('completed', false)).toBe('paused');
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
describe('statusToLabel', () => {
|
|
93
|
-
it('returns Finished when lifecycle is finished', () => {
|
|
94
|
-
expect(statusToLabel('active', false, false, 'finished')).toBe('Finished');
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it('returns Running when isRunning is true', () => {
|
|
98
|
-
expect(statusToLabel('active', true)).toBe('Running');
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it('returns Review Pending when hasUnreviewed and not failed', () => {
|
|
102
|
-
expect(statusToLabel('active', false, true)).toBe('Review Pending');
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it('returns Failed for failed status', () => {
|
|
106
|
-
expect(statusToLabel('failed', false)).toBe('Failed');
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
it('returns Aborted for aborted status', () => {
|
|
110
|
-
expect(statusToLabel('aborted', false)).toBe('Aborted');
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
it('returns Idle for active status', () => {
|
|
114
|
-
expect(statusToLabel('active', false)).toBe('Idle');
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('returns Completed for completed status', () => {
|
|
118
|
-
expect(statusToLabel('completed', false)).toBe('Completed');
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('returns Running for running status', () => {
|
|
122
|
-
expect(statusToLabel('running', false)).toBe('Running');
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('returns raw status string for unknown status', () => {
|
|
126
|
-
expect(statusToLabel('custom', false)).toBe('custom');
|
|
127
|
-
});
|
|
128
|
-
});
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
// Frontend types — re-exports shared types and adds UI-only types + helper functions.
|
|
2
|
-
// Shared types (Session, Turn, Item, Workspace, TokenUsage, etc.) come from @agentpane/shared.
|
|
3
|
-
|
|
4
|
-
export type {
|
|
5
|
-
SessionStatus,
|
|
6
|
-
TurnStatus,
|
|
7
|
-
ItemType,
|
|
8
|
-
ItemStatus,
|
|
9
|
-
Session,
|
|
10
|
-
Turn,
|
|
11
|
-
TokenUsage,
|
|
12
|
-
Item,
|
|
13
|
-
Workspace,
|
|
14
|
-
SessionDetail,
|
|
15
|
-
DiscussionThread,
|
|
16
|
-
Attachment,
|
|
17
|
-
ContextUsage,
|
|
18
|
-
} from '@agentpane/shared';
|
|
19
|
-
|
|
20
|
-
export type { ProviderDefinition, ProviderCapabilities, ProviderSlashCommand, SessionRuntimeConfig, ModelInfo, Extension } from '@agentpane/shared';
|
|
21
|
-
|
|
22
|
-
// UI-only types (not from backend)
|
|
23
|
-
|
|
24
|
-
export interface LogEntry {
|
|
25
|
-
time: string;
|
|
26
|
-
level: 'INFO' | 'WARN' | 'ERROR' | 'DEBUG';
|
|
27
|
-
message: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface PaletteCommand {
|
|
31
|
-
id: string;
|
|
32
|
-
label: string;
|
|
33
|
-
hint: string;
|
|
34
|
-
icon: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type RightTab = 'turns' | 'changes' | 'tasks' | 'threads';
|
|
38
|
-
export type ChangesScope = 'session' | 'turngroup';
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Map a runtime type string to an icon class and text badge for the UI.
|
|
42
|
-
* @param runtimeType — The session's `runtime_type` field (e.g. `'codex'`, `'claude'`).
|
|
43
|
-
* @returns An object with `iconClass` (CSS class) and `iconText` (2-letter badge).
|
|
44
|
-
*/
|
|
45
|
-
export function runtimeIcon(runtimeType: string): { iconClass: string; iconText: string } {
|
|
46
|
-
switch (runtimeType) {
|
|
47
|
-
case 'claude':
|
|
48
|
-
return { iconClass: 'ic-claude', iconText: 'CL' };
|
|
49
|
-
case 'codex':
|
|
50
|
-
return { iconClass: 'ic-codex', iconText: 'CX' };
|
|
51
|
-
case 'repoburg':
|
|
52
|
-
return { iconClass: 'ic-repoburg', iconText: 'RB' };
|
|
53
|
-
case 'cursor':
|
|
54
|
-
return { iconClass: 'ic-cursor', iconText: 'CR' };
|
|
55
|
-
default:
|
|
56
|
-
return { iconClass: 'ic-codex', iconText: 'CX' };
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Format a duration between two ISO timestamps as a human-readable string.
|
|
62
|
-
* @param startISO — Start timestamp in ISO 8601 format.
|
|
63
|
-
* @param endISO — End timestamp in ISO 8601 format, or `null` to use `Date.now()` (for running sessions).
|
|
64
|
-
* @returns Duration string like `'12s'`, `'3m 42s'`, or `'1h 23m'`.
|
|
65
|
-
*/
|
|
66
|
-
export function formatDuration(startISO: string, endISO: string | null): string {
|
|
67
|
-
const start = new Date(startISO).getTime();
|
|
68
|
-
const end = endISO ? new Date(endISO).getTime() : Date.now();
|
|
69
|
-
const seconds = Math.max(0, Math.floor((end - start) / 1000));
|
|
70
|
-
if (seconds < 60) return `${seconds}s`;
|
|
71
|
-
const minutes = Math.floor(seconds / 60);
|
|
72
|
-
const remSec = seconds % 60;
|
|
73
|
-
if (minutes < 60) return `${minutes}m ${remSec}s`;
|
|
74
|
-
const hours = Math.floor(minutes / 60);
|
|
75
|
-
const remMin = minutes % 60;
|
|
76
|
-
return `${hours}h ${remMin}m`;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Map a session's state to a CSS status-dot class for the sidebar/tabs.
|
|
81
|
-
* @param status — The session's `status` field from the DB.
|
|
82
|
-
* @param isRunning — Whether the session is currently running a turn.
|
|
83
|
-
* @param hasUnreviewed — Whether the session has unreviewed completed turns.
|
|
84
|
-
* @param lifecycle — The session's lifecycle (`'working'` or `'finished'`).
|
|
85
|
-
* @returns A dot class string (`'running'`, `'queued'`, `'error'`, `'paused'`) or `''` (no dot).
|
|
86
|
-
*/
|
|
87
|
-
export function statusToDot(status: string, isRunning: boolean, hasUnreviewed = false, lifecycle = 'working'): string {
|
|
88
|
-
if (lifecycle === 'finished') return '';
|
|
89
|
-
if (isRunning) return 'running';
|
|
90
|
-
if (hasUnreviewed && status !== 'failed') return 'queued';
|
|
91
|
-
switch (status) {
|
|
92
|
-
case 'failed':
|
|
93
|
-
return 'error';
|
|
94
|
-
case 'aborted':
|
|
95
|
-
return 'paused';
|
|
96
|
-
default:
|
|
97
|
-
return 'paused';
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Map a session's state to a human-readable status label for the UI.
|
|
103
|
-
* @param status — The session's `status` field from the DB.
|
|
104
|
-
* @param isRunning — Whether the session is currently running a turn.
|
|
105
|
-
* @param hasUnreviewed — Whether the session has unreviewed completed turns.
|
|
106
|
-
* @param lifecycle — The session's lifecycle (`'working'` or `'finished'`).
|
|
107
|
-
* @returns A label string like `'Running'`, `'Review Pending'`, `'Idle'`, `'Finished'`, `'Failed'`.
|
|
108
|
-
*/
|
|
109
|
-
export function statusToLabel(
|
|
110
|
-
status: string,
|
|
111
|
-
isRunning: boolean,
|
|
112
|
-
hasUnreviewed = false,
|
|
113
|
-
lifecycle = 'working',
|
|
114
|
-
): string {
|
|
115
|
-
if (lifecycle === 'finished') return 'Finished';
|
|
116
|
-
if (isRunning) return 'Running';
|
|
117
|
-
if (hasUnreviewed && status !== 'failed') return 'Review Pending';
|
|
118
|
-
switch (status) {
|
|
119
|
-
case 'failed':
|
|
120
|
-
return 'Failed';
|
|
121
|
-
case 'aborted':
|
|
122
|
-
return 'Aborted';
|
|
123
|
-
case 'active':
|
|
124
|
-
return 'Idle';
|
|
125
|
-
case 'completed':
|
|
126
|
-
return 'Completed';
|
|
127
|
-
case 'running':
|
|
128
|
-
return 'Running';
|
|
129
|
-
default:
|
|
130
|
-
return status;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { collectFileChanges } from './changes.ts';
|
|
3
|
-
import type { Turn } from '@agentpane/shared';
|
|
4
|
-
|
|
5
|
-
function makeTurn(items: { type: string; data?: Record<string, unknown> }[]): Turn {
|
|
6
|
-
return {
|
|
7
|
-
id: 't1',
|
|
8
|
-
session_id: 's1',
|
|
9
|
-
user_prompt: 'test',
|
|
10
|
-
agent_response: null,
|
|
11
|
-
thoughts: null,
|
|
12
|
-
token_usage: null,
|
|
13
|
-
external_turn_id: null,
|
|
14
|
-
status: 'completed',
|
|
15
|
-
error: null,
|
|
16
|
-
created_at: '2025-01-01T00:00:00Z',
|
|
17
|
-
updated_at: '2025-01-01T00:00:00Z',
|
|
18
|
-
items: items.map((item, i) => ({
|
|
19
|
-
id: `i${i}`,
|
|
20
|
-
turn_id: 't1',
|
|
21
|
-
external_item_id: `ext${i}`,
|
|
22
|
-
type: item.type,
|
|
23
|
-
data: item.data ?? null,
|
|
24
|
-
status: 'completed',
|
|
25
|
-
created_at: '2025-01-01T00:00:00Z',
|
|
26
|
-
updated_at: '2025-01-01T00:00:00Z',
|
|
27
|
-
})),
|
|
28
|
-
} as Turn;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
describe('collectFileChanges', () => {
|
|
32
|
-
it('returns empty array for empty turns', () => {
|
|
33
|
-
expect(collectFileChanges([])).toEqual([]);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('returns empty array when no file_change items', () => {
|
|
37
|
-
const turn = makeTurn([{ type: 'agent_message', data: { text: 'hello' } }]);
|
|
38
|
-
expect(collectFileChanges([turn])).toEqual([]);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('collects file changes from all turns in session scope', () => {
|
|
42
|
-
const t1 = makeTurn([{ type: 'file_change', data: { changes: [{ path: '/src/a.ts', kind: 'modify' }] } }]);
|
|
43
|
-
const t2 = makeTurn([{ type: 'file_change', data: { changes: [{ path: '/src/b.ts', kind: 'create' }] } }]);
|
|
44
|
-
const result = collectFileChanges([t1, t2]);
|
|
45
|
-
expect(result).toHaveLength(2);
|
|
46
|
-
expect(result[0].path).toBe('/src/a.ts');
|
|
47
|
-
expect(result[1].path).toBe('/src/b.ts');
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('collects from single turn in turngroup scope', () => {
|
|
51
|
-
const t1 = makeTurn([{ type: 'file_change', data: { changes: [{ path: '/src/a.ts', kind: 'modify' }] } }]);
|
|
52
|
-
const t2 = makeTurn([{ type: 'file_change', data: { changes: [{ path: '/src/b.ts', kind: 'create' }] } }]);
|
|
53
|
-
const result = collectFileChanges([t1, t2], 'turngroup', 0);
|
|
54
|
-
expect(result).toHaveLength(1);
|
|
55
|
-
expect(result[0].path).toBe('/src/a.ts');
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('deduplicates by path keeping last occurrence', () => {
|
|
59
|
-
const t1 = makeTurn([{ type: 'file_change', data: { changes: [{ path: '/src/a.ts', kind: 'modify' }] } }]);
|
|
60
|
-
const t2 = makeTurn([{ type: 'file_change', data: { changes: [{ path: '/src/a.ts', kind: 'delete' }] } }]);
|
|
61
|
-
const result = collectFileChanges([t1, t2]);
|
|
62
|
-
expect(result).toHaveLength(1);
|
|
63
|
-
expect(result[0].kind).toBe('delete');
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('handles multiple changes in a single item', () => {
|
|
67
|
-
const turn = makeTurn([
|
|
68
|
-
{
|
|
69
|
-
type: 'file_change',
|
|
70
|
-
data: {
|
|
71
|
-
changes: [
|
|
72
|
-
{ path: '/src/a.ts', kind: 'modify' },
|
|
73
|
-
{ path: '/src/b.ts', kind: 'create' },
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
]);
|
|
78
|
-
const result = collectFileChanges([turn]);
|
|
79
|
-
expect(result).toHaveLength(2);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { Turn, ChangesScope } from '../types/index.ts';
|
|
2
|
-
|
|
3
|
-
export interface FileChangeEntry {
|
|
4
|
-
path: string;
|
|
5
|
-
kind: string;
|
|
6
|
-
turnIdx: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/** Collect file changes from turns, optionally scoped to a single turn.
|
|
10
|
-
* Deduplicates by path (keeps last occurrence).
|
|
11
|
-
* @param turns All turns in the session.
|
|
12
|
-
* @param scope 'session' = all turns, 'turngroup' = only `turnIdx`.
|
|
13
|
-
* @param turnIdx Index of the selected turn (used when scope = 'turngroup').
|
|
14
|
-
* @returns Deduplicated list of file changes. */
|
|
15
|
-
export function collectFileChanges(turns: Turn[], scope: ChangesScope = 'session', turnIdx = 0): FileChangeEntry[] {
|
|
16
|
-
const entries: FileChangeEntry[] = [];
|
|
17
|
-
|
|
18
|
-
if (scope === 'session') {
|
|
19
|
-
turns.forEach((t, ti) => extractChanges(t, ti, entries));
|
|
20
|
-
} else {
|
|
21
|
-
const turn = turns[turnIdx];
|
|
22
|
-
if (turn) extractChanges(turn, turnIdx, entries);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Deduplicate by path (keep last occurrence)
|
|
26
|
-
const seen = new Map<string, FileChangeEntry>();
|
|
27
|
-
for (const e of entries) seen.set(e.path, e);
|
|
28
|
-
return Array.from(seen.values());
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** Extract file_change items from a single turn into the entries array. */
|
|
32
|
-
function extractChanges(turn: Turn, turnIdx: number, entries: FileChangeEntry[]): void {
|
|
33
|
-
for (const item of turn.items) {
|
|
34
|
-
if (item.type === 'file_change' && item.data?.changes) {
|
|
35
|
-
const changes = item.data.changes as Array<{ path: string; kind: string }>;
|
|
36
|
-
for (const c of changes) entries.push({ path: c.path, kind: c.kind, turnIdx });
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
|
-
import { calcSessionDuration } from './duration.ts';
|
|
3
|
-
import type { SessionDetail } from '@agentpane/shared';
|
|
4
|
-
|
|
5
|
-
function makeDetail(turns: { created_at: string; updated_at: string }[]): SessionDetail {
|
|
6
|
-
return {
|
|
7
|
-
id: 's1',
|
|
8
|
-
title: null,
|
|
9
|
-
runtime_type: 'codex',
|
|
10
|
-
model: null,
|
|
11
|
-
model_reasoning_effort: null,
|
|
12
|
-
cwd: null,
|
|
13
|
-
external_thread_id: null,
|
|
14
|
-
status: 'active',
|
|
15
|
-
is_running: 0,
|
|
16
|
-
lifecycle: 'working',
|
|
17
|
-
has_unreviewed: 0,
|
|
18
|
-
runtime_config: null,
|
|
19
|
-
rewound_at_turn_id: null,
|
|
20
|
-
pre_rewind_thread_id: null,
|
|
21
|
-
created_at: '2025-01-01T00:00:00Z',
|
|
22
|
-
updated_at: '2025-01-01T00:00:00Z',
|
|
23
|
-
turns: turns.map((t, i) => ({
|
|
24
|
-
id: `t${i}`,
|
|
25
|
-
session_id: 's1',
|
|
26
|
-
user_prompt: 'test',
|
|
27
|
-
agent_response: null,
|
|
28
|
-
thoughts: null,
|
|
29
|
-
token_usage: null,
|
|
30
|
-
external_turn_id: null,
|
|
31
|
-
status: 'completed',
|
|
32
|
-
error: null,
|
|
33
|
-
thread_id: null,
|
|
34
|
-
attachments: null,
|
|
35
|
-
created_at: t.created_at,
|
|
36
|
-
updated_at: t.updated_at,
|
|
37
|
-
items: [],
|
|
38
|
-
})),
|
|
39
|
-
} as SessionDetail;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
describe('calcSessionDuration', () => {
|
|
43
|
-
beforeEach(() => {
|
|
44
|
-
vi.useFakeTimers();
|
|
45
|
-
vi.setSystemTime(new Date('2025-01-01T01:00:00Z'));
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
afterEach(() => {
|
|
49
|
-
vi.useRealTimers();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('returns — for null detail', () => {
|
|
53
|
-
expect(calcSessionDuration(null, false)).toBe('—');
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('returns — for empty turns', () => {
|
|
57
|
-
const detail = makeDetail([]);
|
|
58
|
-
expect(calcSessionDuration(detail, false)).toBe('—');
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('uses lastTurn.updated_at when not running', () => {
|
|
62
|
-
const detail = makeDetail([
|
|
63
|
-
{ created_at: '2025-01-01T00:00:00Z', updated_at: '2025-01-01T00:00:00Z' },
|
|
64
|
-
{ created_at: '2025-01-01T00:00:10Z', updated_at: '2025-01-01T00:05:00Z' },
|
|
65
|
-
]);
|
|
66
|
-
// 5 minutes = 300s = 5m 0s
|
|
67
|
-
expect(calcSessionDuration(detail, false)).toBe('5m 0s');
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('uses Date.now() when running (null endISO)', () => {
|
|
71
|
-
const detail = makeDetail([{ created_at: '2025-01-01T00:00:00Z', updated_at: '2025-01-01T00:00:30Z' }]);
|
|
72
|
-
// now is 01:00:00, start is 00:00:00 → 3600s = 1h 0m
|
|
73
|
-
expect(calcSessionDuration(detail, true)).toBe('1h 0m');
|
|
74
|
-
});
|
|
75
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { SessionDetail } from '../types/index.ts';
|
|
2
|
-
import { formatDuration } from '../types/index.ts';
|
|
3
|
-
|
|
4
|
-
/** Calculate the total duration of a session from first turn to last turn (or now if running).
|
|
5
|
-
* @param detail SessionDetail with turns.
|
|
6
|
-
* @param isRunning Whether the session is currently running (extends to now).
|
|
7
|
-
* @returns Formatted duration string, or '—' if no turns. */
|
|
8
|
-
export function calcSessionDuration(detail: SessionDetail | null, isRunning: boolean): string {
|
|
9
|
-
if (!detail || detail.turns.length === 0) return '—';
|
|
10
|
-
const firstTurn = detail.turns[0];
|
|
11
|
-
const lastTurn = detail.turns[detail.turns.length - 1];
|
|
12
|
-
const endISO = isRunning ? null : lastTurn.updated_at;
|
|
13
|
-
return formatDuration(firstTurn.created_at, endISO);
|
|
14
|
-
}
|