repoburg 1.3.202 → 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 +2092 -32001
- package/agent-pane/backend/dist/server.js +45304 -0
- 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/index.js +28 -8
- package/daemon/package.json +1 -1
- package/package.json +15 -2
- 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 -236
- 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 -49
- package/agent-pane/backend/src/repoburg/action-mapping.test.ts +0 -122
- package/agent-pane/backend/src/repoburg/action-mapping.ts +0 -294
- package/agent-pane/backend/src/repoburg/agent-runtime-client.test.ts +0 -271
- package/agent-pane/backend/src/repoburg/agent-runtime-client.ts +0 -285
- package/agent-pane/backend/src/repoburg/backend-resolver.test.ts +0 -356
- package/agent-pane/backend/src/repoburg/backend-resolver.ts +0 -261
- package/agent-pane/backend/src/repoburg/repoburg-client.test.ts +0 -180
- package/agent-pane/backend/src/repoburg/repoburg-client.ts +0 -194
- package/agent-pane/backend/src/repoburg/repoburg-provider.test.ts +0 -780
- package/agent-pane/backend/src/repoburg/repoburg-provider.ts +0 -471
- package/agent-pane/backend/src/repoburg/turn-projector.test.ts +0 -621
- package/agent-pane/backend/src/repoburg/turn-projector.ts +0 -637
- 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 -772
- package/agent-pane/backend/src/routes/sessions.ts +0 -565
- 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-CJxD4YmJ.js +0 -370
- package/agent-pane/frontend/dist/assets/index-r-xwfOKQ.css +0 -1
- 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 -246
- 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 -240
- 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/AskUserItem.test.tsx +0 -143
- package/agent-pane/frontend/src/components/AskUserItem.tsx +0 -207
- 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 -377
- package/agent-pane/frontend/src/components/TurnContent.tsx +0 -594
- 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 -131
- package/agent-pane/frontend/src/components/panels/TurnsPanel.tsx +0 -131
- 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 -1338
- 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 -368
- package/agent-pane/frontend/src/styles/app.css +0 -627
- 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 -101
- 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 -134
- 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 -76
- 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 -184
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
|
-
import { render, screen, fireEvent, cleanup } from '@testing-library/react';
|
|
3
|
-
import TurnsPanel from './TurnsPanel.tsx';
|
|
4
|
-
import { resetStore } from '../../test/component-helpers.ts';
|
|
5
|
-
import { makeDetail, makeTurn } from '../../test/fixtures.ts';
|
|
6
|
-
|
|
7
|
-
describe('TurnsPanel', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
resetStore();
|
|
10
|
-
});
|
|
11
|
-
afterEach(() => {
|
|
12
|
-
cleanup();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('shows empty state when no turns', () => {
|
|
16
|
-
render(<TurnsPanel />);
|
|
17
|
-
expect(screen.getByText('No turns yet')).toBeInTheDocument();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('renders turn items with preview text', () => {
|
|
21
|
-
const detail = makeDetail('s1', [makeTurn('t1', 's1', { user_prompt: 'Fix the bug' })]);
|
|
22
|
-
resetStore({ activeSessionId: 's1', sessionDetails: { s1: detail } });
|
|
23
|
-
render(<TurnsPanel />);
|
|
24
|
-
expect(screen.getByText('Fix the bug')).toBeInTheDocument();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('truncates preview text longer than 50 chars', () => {
|
|
28
|
-
const longPrompt = 'A'.repeat(60);
|
|
29
|
-
const detail = makeDetail('s1', [makeTurn('t1', 's1', { user_prompt: longPrompt })]);
|
|
30
|
-
resetStore({ activeSessionId: 's1', sessionDetails: { s1: detail } });
|
|
31
|
-
render(<TurnsPanel />);
|
|
32
|
-
expect(screen.getByText('A'.repeat(50) + '…')).toBeInTheDocument();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('active turn has active class', () => {
|
|
36
|
-
const detail = makeDetail('s1', [makeTurn('t1', 's1')]);
|
|
37
|
-
resetStore({ activeSessionId: 's1', sessionDetails: { s1: detail }, activeTurnIndex: 0 });
|
|
38
|
-
render(<TurnsPanel />);
|
|
39
|
-
const turnItem = screen.getByText('test prompt').closest('.turn-item');
|
|
40
|
-
expect(turnItem).toHaveClass('active');
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('click calls setActiveTurnIndex', () => {
|
|
44
|
-
const setActiveTurnIndex = vi.fn();
|
|
45
|
-
const detail = makeDetail('s1', [makeTurn('t1', 's1'), makeTurn('t2', 's1')]);
|
|
46
|
-
resetStore({ activeSessionId: 's1', sessionDetails: { s1: detail }, activeTurnIndex: 0, setActiveTurnIndex });
|
|
47
|
-
render(<TurnsPanel />);
|
|
48
|
-
const items = document.querySelectorAll('.turn-item');
|
|
49
|
-
fireEvent.click(items[1]);
|
|
50
|
-
expect(setActiveTurnIndex).toHaveBeenCalledWith(1);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('context menu shows rewind and branch options', () => {
|
|
54
|
-
const detail = makeDetail('s1', [makeTurn('t1', 's1'), makeTurn('t2', 's1')]);
|
|
55
|
-
resetStore({ activeSessionId: 's1', sessionDetails: { s1: detail } });
|
|
56
|
-
render(<TurnsPanel />);
|
|
57
|
-
const turnItem = document.querySelectorAll('.turn-item')[0];
|
|
58
|
-
fireEvent.contextMenu(turnItem);
|
|
59
|
-
expect(screen.getByText('Rewind to Here')).toBeInTheDocument();
|
|
60
|
-
expect(screen.getByText('Branch from Here')).toBeInTheDocument();
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('rewind is disabled on last turn', () => {
|
|
64
|
-
const detail = makeDetail('s1', [makeTurn('t1', 's1')]);
|
|
65
|
-
resetStore({ activeSessionId: 's1', sessionDetails: { s1: detail } });
|
|
66
|
-
render(<TurnsPanel />);
|
|
67
|
-
const turnItem = document.querySelector('.turn-item')!;
|
|
68
|
-
fireEvent.contextMenu(turnItem);
|
|
69
|
-
const rewindItem = screen.getByText('Rewind to Here').closest('.ctx-menu-item');
|
|
70
|
-
expect(rewindItem).toHaveClass('ctx-disabled');
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it('branch click calls branchFromTurn', () => {
|
|
74
|
-
const branchFromTurn = vi.fn().mockResolvedValue(undefined);
|
|
75
|
-
const detail = makeDetail('s1', [makeTurn('t1', 's1'), makeTurn('t2', 's1')]);
|
|
76
|
-
resetStore({ activeSessionId: 's1', sessionDetails: { s1: detail }, branchFromTurn });
|
|
77
|
-
render(<TurnsPanel />);
|
|
78
|
-
const turnItem = document.querySelectorAll('.turn-item')[0];
|
|
79
|
-
fireEvent.contextMenu(turnItem);
|
|
80
|
-
fireEvent.click(screen.getByText('Branch from Here'));
|
|
81
|
-
expect(branchFromTurn).toHaveBeenCalledWith('s1', 't1');
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it('shows Restore Rewind for rewound non-repoburg sessions', () => {
|
|
85
|
-
const detail = makeDetail('s1', [makeTurn('t1', 's1'), makeTurn('t2', 's1')], {
|
|
86
|
-
runtime_type: 'codex',
|
|
87
|
-
rewound_at_turn_id: 't1',
|
|
88
|
-
});
|
|
89
|
-
resetStore({ activeSessionId: 's1', sessionDetails: { s1: detail } });
|
|
90
|
-
render(<TurnsPanel />);
|
|
91
|
-
fireEvent.contextMenu(document.querySelector('.turn-item')!);
|
|
92
|
-
expect(screen.getByText('Restore Rewind')).toBeInTheDocument();
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it('hides Restore Rewind for rewound repoburg sessions (hard delete — no restore)', () => {
|
|
96
|
-
const detail = makeDetail('s1', [makeTurn('t1', 's1'), makeTurn('t2', 's1')], {
|
|
97
|
-
runtime_type: 'repoburg',
|
|
98
|
-
rewound_at_turn_id: 't1',
|
|
99
|
-
});
|
|
100
|
-
resetStore({ activeSessionId: 's1', sessionDetails: { s1: detail } });
|
|
101
|
-
render(<TurnsPanel />);
|
|
102
|
-
fireEvent.contextMenu(document.querySelector('.turn-item')!);
|
|
103
|
-
expect(screen.queryByText('Restore Rewind')).not.toBeInTheDocument();
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('repoburg rewind confirm says the runtime history is permanently deleted', () => {
|
|
107
|
-
const confirmSpy = vi.spyOn(window, 'confirm').mockReturnValue(false);
|
|
108
|
-
const rewindToTurn = vi.fn();
|
|
109
|
-
const detail = makeDetail('s1', [makeTurn('t1', 's1'), makeTurn('t2', 's1')], {
|
|
110
|
-
runtime_type: 'repoburg',
|
|
111
|
-
});
|
|
112
|
-
resetStore({ activeSessionId: 's1', sessionDetails: { s1: detail }, rewindToTurn });
|
|
113
|
-
render(<TurnsPanel />);
|
|
114
|
-
fireEvent.contextMenu(document.querySelectorAll('.turn-item')[0]);
|
|
115
|
-
fireEvent.click(screen.getByText('Rewind to Here'));
|
|
116
|
-
expect(confirmSpy).toHaveBeenCalledWith(
|
|
117
|
-
'Rewind to this turn? Runtime history after this point is PERMANENTLY deleted and cannot be restored.',
|
|
118
|
-
);
|
|
119
|
-
expect(rewindToTurn).not.toHaveBeenCalled();
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
it('non-repoburg rewind confirm keeps the restore-later copy', () => {
|
|
123
|
-
const confirmSpy = vi.spyOn(window, 'confirm').mockReturnValue(false);
|
|
124
|
-
const detail = makeDetail('s1', [makeTurn('t1', 's1'), makeTurn('t2', 's1')]);
|
|
125
|
-
resetStore({ activeSessionId: 's1', sessionDetails: { s1: detail } });
|
|
126
|
-
render(<TurnsPanel />);
|
|
127
|
-
fireEvent.contextMenu(document.querySelectorAll('.turn-item')[0]);
|
|
128
|
-
fireEvent.click(screen.getByText('Rewind to Here'));
|
|
129
|
-
expect(confirmSpy).toHaveBeenCalledWith('Rewind to this turn? Hidden turns can be restored later.');
|
|
130
|
-
});
|
|
131
|
-
});
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { useRef, useState } from 'react';
|
|
2
|
-
import { useStore } from '../../store/store.ts';
|
|
3
|
-
import { useOutsideClick } from '../../hooks/useOutsideClick.ts';
|
|
4
|
-
import { useEscapeKey } from '../../hooks/useEscapeKey.ts';
|
|
5
|
-
import { User, Rewind, GitBranch, RotateCcw } from 'lucide-react';
|
|
6
|
-
|
|
7
|
-
interface TurnContextMenu {
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
turnId: string;
|
|
11
|
-
turnIndex: number;
|
|
12
|
-
isLast: boolean;
|
|
13
|
-
isSlashCommand: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default function TurnsPanel() {
|
|
17
|
-
const activeSessionId = useStore((s) => s.activeSessionId);
|
|
18
|
-
const sessionDetails = useStore((s) => s.sessionDetails);
|
|
19
|
-
const activeTurnIndex = useStore((s) => s.activeTurnIndex);
|
|
20
|
-
const setActiveTurnIndex = useStore((s) => s.setActiveTurnIndex);
|
|
21
|
-
const rewindToTurn = useStore((s) => s.rewindToTurn);
|
|
22
|
-
const restoreSession = useStore((s) => s.restoreSession);
|
|
23
|
-
const branchFromTurn = useStore((s) => s.branchFromTurn);
|
|
24
|
-
|
|
25
|
-
const detail = activeSessionId ? sessionDetails[activeSessionId] : null;
|
|
26
|
-
const turns = detail?.turns ?? [];
|
|
27
|
-
const isRunning = detail?.is_running === 1;
|
|
28
|
-
const isRewound = !!detail?.rewound_at_turn_id;
|
|
29
|
-
// Repoburg rewind = platform-parity hard delete — no restore, permanent copy.
|
|
30
|
-
const isRepoburg = detail?.runtime_type === 'repoburg';
|
|
31
|
-
const rewindConfirm = isRepoburg
|
|
32
|
-
? 'Rewind to this turn? Runtime history after this point is PERMANENTLY deleted and cannot be restored.'
|
|
33
|
-
: 'Rewind to this turn? Hidden turns can be restored later.';
|
|
34
|
-
|
|
35
|
-
const [ctxMenu, setCtxMenu] = useState<TurnContextMenu | null>(null);
|
|
36
|
-
const ctxRef = useRef<HTMLDivElement>(null);
|
|
37
|
-
|
|
38
|
-
useOutsideClick(ctxRef, () => setCtxMenu(null), !!ctxMenu);
|
|
39
|
-
useEscapeKey(() => setCtxMenu(null), !!ctxMenu);
|
|
40
|
-
|
|
41
|
-
if (turns.length === 0) {
|
|
42
|
-
return <div className="empty-state">No turns yet</div>;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function handleClick(idx: number) {
|
|
46
|
-
setActiveTurnIndex(idx);
|
|
47
|
-
requestAnimationFrame(() => {
|
|
48
|
-
document.getElementById(`turn-${idx}`)?.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<div className="right-section">
|
|
54
|
-
<div className="right-section-title">Conversation</div>
|
|
55
|
-
{turns.map((turn, idx) => {
|
|
56
|
-
const isActive = idx === activeTurnIndex;
|
|
57
|
-
const preview = turn.user_prompt.length > 50 ? turn.user_prompt.slice(0, 50) + '…' : turn.user_prompt;
|
|
58
|
-
const turnIsRunning = turn.status === 'running' || turn.status === 'pending';
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<div key={turn.id}>
|
|
62
|
-
<div
|
|
63
|
-
className={`turn-item ${isActive ? 'active' : ''}`}
|
|
64
|
-
onClick={() => handleClick(idx)}
|
|
65
|
-
onContextMenu={(e) => {
|
|
66
|
-
e.preventDefault();
|
|
67
|
-
setCtxMenu({
|
|
68
|
-
x: e.clientX,
|
|
69
|
-
y: e.clientY,
|
|
70
|
-
turnId: turn.id,
|
|
71
|
-
turnIndex: idx,
|
|
72
|
-
isLast: idx === turns.length - 1,
|
|
73
|
-
isSlashCommand: turn.user_prompt.trimStart().startsWith('/'),
|
|
74
|
-
});
|
|
75
|
-
}}
|
|
76
|
-
>
|
|
77
|
-
<span className="turn-item-icon" style={{ background: 'var(--amber)', color: '#fff' }}>
|
|
78
|
-
<User size={12} />
|
|
79
|
-
</span>
|
|
80
|
-
<span className="turn-item-label">{preview}</span>
|
|
81
|
-
{turnIsRunning && (
|
|
82
|
-
<span className="turn-item-status">running…</span>
|
|
83
|
-
)}
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
);
|
|
87
|
-
})}
|
|
88
|
-
|
|
89
|
-
{ctxMenu && (
|
|
90
|
-
<div
|
|
91
|
-
ref={ctxRef}
|
|
92
|
-
className="ctx-menu"
|
|
93
|
-
style={{ position: 'fixed', left: ctxMenu.x, top: ctxMenu.y, zIndex: 500 }}
|
|
94
|
-
>
|
|
95
|
-
<div
|
|
96
|
-
className={`ctx-menu-item ${ctxMenu.isLast || isRunning || ctxMenu.isSlashCommand ? 'ctx-disabled' : ''}`}
|
|
97
|
-
onClick={() => {
|
|
98
|
-
if (ctxMenu.isLast || isRunning || ctxMenu.isSlashCommand) return;
|
|
99
|
-
if (window.confirm(rewindConfirm)) {
|
|
100
|
-
rewindToTurn(activeSessionId!, ctxMenu.turnId);
|
|
101
|
-
}
|
|
102
|
-
setCtxMenu(null);
|
|
103
|
-
}}
|
|
104
|
-
>
|
|
105
|
-
<Rewind size={12} /> Rewind to Here{ctxMenu.isSlashCommand ? ' (slash command)' : ''}
|
|
106
|
-
</div>
|
|
107
|
-
{isRewound && !isRepoburg && (
|
|
108
|
-
<div
|
|
109
|
-
className="ctx-menu-item"
|
|
110
|
-
onClick={() => {
|
|
111
|
-
restoreSession(activeSessionId!);
|
|
112
|
-
setCtxMenu(null);
|
|
113
|
-
}}
|
|
114
|
-
>
|
|
115
|
-
<RotateCcw size={12} /> Restore Rewind
|
|
116
|
-
</div>
|
|
117
|
-
)}
|
|
118
|
-
<div
|
|
119
|
-
className="ctx-menu-item"
|
|
120
|
-
onClick={() => {
|
|
121
|
-
branchFromTurn(activeSessionId!, ctxMenu.turnId);
|
|
122
|
-
setCtxMenu(null);
|
|
123
|
-
}}
|
|
124
|
-
>
|
|
125
|
-
<GitBranch size={12} /> Branch from Here
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
)}
|
|
129
|
-
</div>
|
|
130
|
-
);
|
|
131
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import {
|
|
3
|
-
getProvider,
|
|
4
|
-
getModels,
|
|
5
|
-
getModel,
|
|
6
|
-
getReasoningLevels,
|
|
7
|
-
getDefaultModel,
|
|
8
|
-
getDefaultReasoning,
|
|
9
|
-
} from './models.ts';
|
|
10
|
-
|
|
11
|
-
describe('getProvider', () => {
|
|
12
|
-
it('finds codex provider', () => {
|
|
13
|
-
expect(getProvider('codex')?.id).toBe('codex');
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it('finds claude provider', () => {
|
|
17
|
-
expect(getProvider('claude')?.id).toBe('claude');
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('returns undefined for unknown provider', () => {
|
|
21
|
-
expect(getProvider('unknown')).toBeUndefined();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
describe('getModels', () => {
|
|
26
|
-
it('returns 4 models for codex', () => {
|
|
27
|
-
expect(getModels('codex')).toHaveLength(4);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('returns 3 models for claude', () => {
|
|
31
|
-
expect(getModels('claude')).toHaveLength(3);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('returns empty array for unknown provider', () => {
|
|
35
|
-
expect(getModels('unknown')).toEqual([]);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
describe('getModel', () => {
|
|
40
|
-
it('finds gpt-5.6-sol in codex', () => {
|
|
41
|
-
expect(getModel('codex', 'gpt-5.6-sol')?.slug).toBe('gpt-5.6-sol');
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('returns undefined for unknown model slug', () => {
|
|
45
|
-
expect(getModel('codex', 'unknown')).toBeUndefined();
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('returns undefined for unknown provider', () => {
|
|
49
|
-
expect(getModel('unknown', 'gpt-5.6-sol')).toBeUndefined();
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
describe('getReasoningLevels', () => {
|
|
54
|
-
it('returns 6 levels for gpt-5.6-sol', () => {
|
|
55
|
-
expect(getReasoningLevels('codex', 'gpt-5.6-sol')).toHaveLength(6);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('returns 5 levels for gpt-5.6-luna (no ultra)', () => {
|
|
59
|
-
expect(getReasoningLevels('codex', 'gpt-5.6-luna')).toHaveLength(5);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('returns 4 levels for gpt-5.5', () => {
|
|
63
|
-
expect(getReasoningLevels('codex', 'gpt-5.5')).toHaveLength(4);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('returns empty array for unknown model', () => {
|
|
67
|
-
expect(getReasoningLevels('codex', 'unknown')).toEqual([]);
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
describe('getDefaultModel', () => {
|
|
72
|
-
it('returns first model for codex (gpt-5.6-sol)', () => {
|
|
73
|
-
expect(getDefaultModel('codex')?.slug).toBe('gpt-5.6-sol');
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('returns first model for claude (claude-sonnet-5)', () => {
|
|
77
|
-
expect(getDefaultModel('claude')?.slug).toBe('claude-sonnet-5');
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('returns undefined for unknown provider', () => {
|
|
81
|
-
expect(getDefaultModel('unknown')).toBeUndefined();
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
describe('getDefaultReasoning', () => {
|
|
86
|
-
it('returns low for gpt-5.6-sol', () => {
|
|
87
|
-
expect(getDefaultReasoning('codex', 'gpt-5.6-sol')).toBe('low');
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('returns medium for gpt-5.6-terra', () => {
|
|
91
|
-
expect(getDefaultReasoning('codex', 'gpt-5.6-terra')).toBe('medium');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('returns undefined for unknown model', () => {
|
|
95
|
-
expect(getDefaultReasoning('codex', 'unknown')).toBeUndefined();
|
|
96
|
-
});
|
|
97
|
-
});
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
// Model catalog — hardcoded from `codex debug models --bundled` output.
|
|
2
|
-
// Codex SDK connects to ChatGPT backend; these are the available models.
|
|
3
|
-
|
|
4
|
-
export interface ReasoningLevel {
|
|
5
|
-
effort: string; // SDK value: "low" | "medium" | "high" | "xhigh" | "max" | "ultra"
|
|
6
|
-
label: string; // UI label: "Low" | "Medium" | "High" | "Extra High" | "Max" | "Ultra"
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface ModelDef {
|
|
10
|
-
slug: string; // "gpt-5.6-sol"
|
|
11
|
-
displayName: string; // "GPT-5.6-Sol"
|
|
12
|
-
description: string; // short description
|
|
13
|
-
defaultReasoning: string; // "low" | "medium" | ...
|
|
14
|
-
reasoningLevels: ReasoningLevel[];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface ProviderDef {
|
|
18
|
-
id: string; // "codex" | "claude"
|
|
19
|
-
label: string; // "Codex" | "Claude"
|
|
20
|
-
available: boolean; // false = "coming soon" placeholder
|
|
21
|
-
models: ModelDef[];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const LEVELS: Record<string, ReasoningLevel> = {
|
|
25
|
-
low: { effort: 'low', label: 'Low' },
|
|
26
|
-
medium: { effort: 'medium', label: 'Medium' },
|
|
27
|
-
high: { effort: 'high', label: 'High' },
|
|
28
|
-
xhigh: { effort: 'xhigh', label: 'Extra High' },
|
|
29
|
-
max: { effort: 'max', label: 'Max' },
|
|
30
|
-
ultra: { effort: 'ultra', label: 'Ultra' },
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const PROVIDERS: ProviderDef[] = [
|
|
34
|
-
{
|
|
35
|
-
id: 'codex',
|
|
36
|
-
label: 'Codex',
|
|
37
|
-
available: true,
|
|
38
|
-
models: [
|
|
39
|
-
{
|
|
40
|
-
slug: 'gpt-5.6-sol',
|
|
41
|
-
displayName: 'GPT-5.6-Sol',
|
|
42
|
-
description: 'Flagship — complex, open-ended work',
|
|
43
|
-
defaultReasoning: 'low',
|
|
44
|
-
reasoningLevels: [LEVELS.low, LEVELS.medium, LEVELS.high, LEVELS.xhigh, LEVELS.max, LEVELS.ultra],
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
slug: 'gpt-5.6-terra',
|
|
48
|
-
displayName: 'GPT-5.6-Terra',
|
|
49
|
-
description: 'Balanced all-rounder for everyday work',
|
|
50
|
-
defaultReasoning: 'medium',
|
|
51
|
-
reasoningLevels: [LEVELS.low, LEVELS.medium, LEVELS.high, LEVELS.xhigh, LEVELS.max, LEVELS.ultra],
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
slug: 'gpt-5.6-luna',
|
|
55
|
-
displayName: 'GPT-5.6-Luna',
|
|
56
|
-
description: 'Fast, affordable — clear, repeatable tasks',
|
|
57
|
-
defaultReasoning: 'medium',
|
|
58
|
-
reasoningLevels: [LEVELS.low, LEVELS.medium, LEVELS.high, LEVELS.xhigh, LEVELS.max],
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
slug: 'gpt-5.5',
|
|
62
|
-
displayName: 'GPT-5.5',
|
|
63
|
-
description: 'Previous-gen frontier model',
|
|
64
|
-
defaultReasoning: 'medium',
|
|
65
|
-
reasoningLevels: [LEVELS.low, LEVELS.medium, LEVELS.high, LEVELS.xhigh],
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
id: 'claude',
|
|
71
|
-
label: 'Claude',
|
|
72
|
-
available: true,
|
|
73
|
-
models: [
|
|
74
|
-
{
|
|
75
|
-
slug: 'claude-sonnet-5',
|
|
76
|
-
displayName: 'Claude Sonnet 5',
|
|
77
|
-
description: 'Balanced all-rounder for everyday work',
|
|
78
|
-
defaultReasoning: 'medium',
|
|
79
|
-
reasoningLevels: [LEVELS.low, LEVELS.medium, LEVELS.high, LEVELS.xhigh, LEVELS.max],
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
slug: 'claude-opus-5',
|
|
83
|
-
displayName: 'Claude Opus 5',
|
|
84
|
-
description: 'Deep reasoning for complex tasks',
|
|
85
|
-
defaultReasoning: 'medium',
|
|
86
|
-
reasoningLevels: [LEVELS.low, LEVELS.medium, LEVELS.high, LEVELS.xhigh, LEVELS.max],
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
slug: 'claude-fable-5',
|
|
90
|
-
displayName: 'Claude Fable 5',
|
|
91
|
-
description: 'Fast and efficient for simple tasks',
|
|
92
|
-
defaultReasoning: 'medium',
|
|
93
|
-
reasoningLevels: [LEVELS.low, LEVELS.medium, LEVELS.high, LEVELS.xhigh, LEVELS.max],
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
id: 'repoburg',
|
|
99
|
-
label: 'Repoburg',
|
|
100
|
-
available: true,
|
|
101
|
-
// Curated fallback list — live sessions load the full catalog dynamically
|
|
102
|
-
// from GET /api/providers/repoburg/models (repoburg backend model registry).
|
|
103
|
-
models: [
|
|
104
|
-
{
|
|
105
|
-
slug: 'ollama/glm-5.3:cloud',
|
|
106
|
-
displayName: 'GLM-5.3',
|
|
107
|
-
description: 'Ollama Cloud',
|
|
108
|
-
defaultReasoning: 'medium',
|
|
109
|
-
reasoningLevels: [LEVELS.low, LEVELS.medium, LEVELS.high],
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
slug: 'ollama/glm-5.3-flash:cloud',
|
|
113
|
-
displayName: 'GLM-5.3 Flash',
|
|
114
|
-
description: 'Ollama Cloud — fast',
|
|
115
|
-
defaultReasoning: 'medium',
|
|
116
|
-
reasoningLevels: [LEVELS.low, LEVELS.medium, LEVELS.high],
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
slug: 'ollama/minimax-m3:cloud',
|
|
120
|
-
displayName: 'MiniMax M3',
|
|
121
|
-
description: 'Ollama Cloud',
|
|
122
|
-
defaultReasoning: 'medium',
|
|
123
|
-
reasoningLevels: [LEVELS.low, LEVELS.medium, LEVELS.high],
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
slug: 'ollama/deepseek-v4-pro:cloud',
|
|
127
|
-
displayName: 'DeepSeek V4 Pro',
|
|
128
|
-
description: 'Ollama Cloud',
|
|
129
|
-
defaultReasoning: 'medium',
|
|
130
|
-
reasoningLevels: [LEVELS.low, LEVELS.medium, LEVELS.high],
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
},
|
|
134
|
-
];
|
|
135
|
-
|
|
136
|
-
/** Get provider by ID. */
|
|
137
|
-
export function getProvider(id: string): ProviderDef | undefined {
|
|
138
|
-
return PROVIDERS.find((p) => p.id === id);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/** Get models for a provider. Returns empty array if provider not found or unavailable. */
|
|
142
|
-
export function getModels(providerId: string): ModelDef[] {
|
|
143
|
-
const provider = getProvider(providerId);
|
|
144
|
-
return provider?.models ?? [];
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/** Get a specific model definition. */
|
|
148
|
-
export function getModel(providerId: string, slug: string): ModelDef | undefined {
|
|
149
|
-
return getModels(providerId).find((m) => m.slug === slug);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/** Get reasoning levels for a specific model. */
|
|
153
|
-
export function getReasoningLevels(providerId: string, slug: string): ReasoningLevel[] {
|
|
154
|
-
return getModel(providerId, slug)?.reasoningLevels ?? [];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/** Get the default model for a provider (first in list). */
|
|
158
|
-
export function getDefaultModel(providerId: string): ModelDef | undefined {
|
|
159
|
-
const models = getModels(providerId);
|
|
160
|
-
return models[0];
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/** Get the default reasoning level for a model. */
|
|
164
|
-
export function getDefaultReasoning(providerId: string, slug: string): string | undefined {
|
|
165
|
-
return getModel(providerId, slug)?.defaultReasoning;
|
|
166
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
|
-
import { renderHook } from '@testing-library/react';
|
|
3
|
-
import { useEscapeKey } from './useEscapeKey.ts';
|
|
4
|
-
|
|
5
|
-
describe('useEscapeKey', () => {
|
|
6
|
-
beforeEach(() => {
|
|
7
|
-
vi.clearAllMocks();
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it('calls callback when Escape is pressed', () => {
|
|
11
|
-
const callback = vi.fn();
|
|
12
|
-
renderHook(() => useEscapeKey(callback));
|
|
13
|
-
|
|
14
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }));
|
|
15
|
-
expect(callback).toHaveBeenCalledTimes(1);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('does not call callback when isActive is false', () => {
|
|
19
|
-
const callback = vi.fn();
|
|
20
|
-
renderHook(() => useEscapeKey(callback, false));
|
|
21
|
-
|
|
22
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }));
|
|
23
|
-
expect(callback).not.toHaveBeenCalled();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('does not call callback for non-Escape keys', () => {
|
|
27
|
-
const callback = vi.fn();
|
|
28
|
-
renderHook(() => useEscapeKey(callback));
|
|
29
|
-
|
|
30
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
|
|
31
|
-
expect(callback).not.toHaveBeenCalled();
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('cleans up listener on unmount', () => {
|
|
35
|
-
const callback = vi.fn();
|
|
36
|
-
const { unmount } = renderHook(() => useEscapeKey(callback));
|
|
37
|
-
|
|
38
|
-
unmount();
|
|
39
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }));
|
|
40
|
-
expect(callback).not.toHaveBeenCalled();
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
/** Call `callback` when Escape key is pressed (if `isActive` is true). */
|
|
4
|
-
export function useEscapeKey(callback: () => void, isActive = true): void {
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
if (!isActive) return;
|
|
7
|
-
function handleKey(e: KeyboardEvent) {
|
|
8
|
-
if (e.key === 'Escape') callback();
|
|
9
|
-
}
|
|
10
|
-
document.addEventListener('keydown', handleKey);
|
|
11
|
-
return () => document.removeEventListener('keydown', handleKey);
|
|
12
|
-
}, [callback, isActive]);
|
|
13
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
|
-
import { renderHook } from '@testing-library/react';
|
|
3
|
-
import { useRef, type MutableRefObject } from 'react';
|
|
4
|
-
import { useOutsideClick } from './useOutsideClick.ts';
|
|
5
|
-
|
|
6
|
-
function renderWithRef(callback: () => void, isActive = true) {
|
|
7
|
-
return renderHook(() => {
|
|
8
|
-
const ref = useRef<HTMLDivElement>(null) as MutableRefObject<HTMLDivElement | null>;
|
|
9
|
-
useOutsideClick(ref, callback, isActive);
|
|
10
|
-
return ref;
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
describe('useOutsideClick', () => {
|
|
15
|
-
let insideEl: HTMLDivElement;
|
|
16
|
-
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
vi.clearAllMocks();
|
|
19
|
-
insideEl = document.createElement('div');
|
|
20
|
-
document.body.appendChild(insideEl);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
afterEach(() => {
|
|
24
|
-
document.body.removeChild(insideEl);
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('calls callback on mousedown outside ref', () => {
|
|
28
|
-
const callback = vi.fn();
|
|
29
|
-
const { result } = renderWithRef(callback);
|
|
30
|
-
// Set ref to the inside element so outside clicks are detected
|
|
31
|
-
result.current.current = insideEl;
|
|
32
|
-
|
|
33
|
-
const outsideEl = document.createElement('div');
|
|
34
|
-
document.body.appendChild(outsideEl);
|
|
35
|
-
|
|
36
|
-
const event = new MouseEvent('mousedown', { bubbles: true });
|
|
37
|
-
Object.defineProperty(event, 'target', { value: outsideEl });
|
|
38
|
-
document.dispatchEvent(event);
|
|
39
|
-
|
|
40
|
-
expect(callback).toHaveBeenCalledTimes(1);
|
|
41
|
-
document.body.removeChild(outsideEl);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('does not call callback when clicking inside ref', () => {
|
|
45
|
-
const callback = vi.fn();
|
|
46
|
-
const { result } = renderWithRef(callback);
|
|
47
|
-
result.current.current = insideEl;
|
|
48
|
-
|
|
49
|
-
const childEl = document.createElement('span');
|
|
50
|
-
insideEl.appendChild(childEl);
|
|
51
|
-
|
|
52
|
-
const event = new MouseEvent('mousedown', { bubbles: true });
|
|
53
|
-
Object.defineProperty(event, 'target', { value: childEl });
|
|
54
|
-
document.dispatchEvent(event);
|
|
55
|
-
|
|
56
|
-
expect(callback).not.toHaveBeenCalled();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('does not call callback when isActive is false', () => {
|
|
60
|
-
const callback = vi.fn();
|
|
61
|
-
const { result } = renderWithRef(callback, false);
|
|
62
|
-
result.current.current = insideEl;
|
|
63
|
-
|
|
64
|
-
const outsideEl = document.createElement('div');
|
|
65
|
-
document.body.appendChild(outsideEl);
|
|
66
|
-
|
|
67
|
-
const event = new MouseEvent('mousedown', { bubbles: true });
|
|
68
|
-
Object.defineProperty(event, 'target', { value: outsideEl });
|
|
69
|
-
document.dispatchEvent(event);
|
|
70
|
-
|
|
71
|
-
expect(callback).not.toHaveBeenCalled();
|
|
72
|
-
document.body.removeChild(outsideEl);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('cleans up listeners on unmount', () => {
|
|
76
|
-
const callback = vi.fn();
|
|
77
|
-
const { result, unmount } = renderWithRef(callback);
|
|
78
|
-
result.current.current = insideEl;
|
|
79
|
-
|
|
80
|
-
unmount();
|
|
81
|
-
|
|
82
|
-
const outsideEl = document.createElement('div');
|
|
83
|
-
document.body.appendChild(outsideEl);
|
|
84
|
-
|
|
85
|
-
const event = new MouseEvent('mousedown', { bubbles: true });
|
|
86
|
-
Object.defineProperty(event, 'target', { value: outsideEl });
|
|
87
|
-
document.dispatchEvent(event);
|
|
88
|
-
|
|
89
|
-
expect(callback).not.toHaveBeenCalled();
|
|
90
|
-
document.body.removeChild(outsideEl);
|
|
91
|
-
});
|
|
92
|
-
});
|