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,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type re-exports and interfaces for the Claude provider.
|
|
3
|
-
*
|
|
4
|
-
* Re-exports needed types from `@anthropic-ai/claude-agent-sdk` so the
|
|
5
|
-
* provider file does not import the SDK directly.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type {
|
|
9
|
-
Query,
|
|
10
|
-
SDKMessage,
|
|
11
|
-
Options,
|
|
12
|
-
ModelInfo as SdkModelInfo,
|
|
13
|
-
SDKControlInitializeResponse,
|
|
14
|
-
EffortLevel,
|
|
15
|
-
SDKUserMessage,
|
|
16
|
-
} from '@anthropic-ai/claude-agent-sdk';
|
|
17
|
-
|
|
18
|
-
export type { Query, SDKMessage, Options, EffortLevel, SdkModelInfo, SDKControlInitializeResponse, SDKUserMessage };
|
|
19
|
-
|
|
20
|
-
/** Structural type for the PromptQueue — avoids circular imports. */
|
|
21
|
-
export interface PromptQueueLike {
|
|
22
|
-
push(message: SDKUserMessage): void;
|
|
23
|
-
close(): void;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** Per-session Claude query instance + streaming-input state. */
|
|
27
|
-
export interface ClaudeSessionEntry {
|
|
28
|
-
query: Query;
|
|
29
|
-
sessionId: string | null; // Claude session ID from SDKSystemMessage init
|
|
30
|
-
turnId: string | null; // current AgentPane turn ID
|
|
31
|
-
cwd: string; // session working directory — used to construct Monitor output paths
|
|
32
|
-
promptQueue: PromptQueueLike; // async iterable feeding user messages to the CLI
|
|
33
|
-
messageLoop: Promise<void> | null; // background for-await loop consuming SDK messages
|
|
34
|
-
/** Thread ID if this entry is for a branched thread conversation (null = main session). */
|
|
35
|
-
threadId?: string | null;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** Map SDK effort values to UI labels. */
|
|
39
|
-
export const EFFORT_LABELS: Record<string, string> = {
|
|
40
|
-
low: 'Low',
|
|
41
|
-
medium: 'Medium',
|
|
42
|
-
high: 'High',
|
|
43
|
-
xhigh: 'Extra High',
|
|
44
|
-
max: 'Max',
|
|
45
|
-
};
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
2
|
-
import { PassThrough } from 'node:stream';
|
|
3
|
-
import { EventEmitter } from 'node:events';
|
|
4
|
-
|
|
5
|
-
// Mock child_process.spawn to return a fake process with controllable streams
|
|
6
|
-
const mockStdin = new PassThrough();
|
|
7
|
-
const mockStdout = new PassThrough();
|
|
8
|
-
const mockStderr = new PassThrough();
|
|
9
|
-
const mockProc = new EventEmitter() as EventEmitter & {
|
|
10
|
-
stdin: PassThrough;
|
|
11
|
-
stdout: PassThrough;
|
|
12
|
-
stderr: PassThrough;
|
|
13
|
-
kill: ReturnType<typeof vi.fn>;
|
|
14
|
-
pid: number;
|
|
15
|
-
};
|
|
16
|
-
mockProc.stdin = mockStdin;
|
|
17
|
-
mockProc.stdout = mockStdout;
|
|
18
|
-
mockProc.stderr = mockStderr;
|
|
19
|
-
mockProc.kill = vi.fn();
|
|
20
|
-
mockProc.pid = 12345;
|
|
21
|
-
|
|
22
|
-
vi.mock('node:child_process', () => ({
|
|
23
|
-
spawn: vi.fn(() => mockProc),
|
|
24
|
-
}));
|
|
25
|
-
|
|
26
|
-
import { AppServerClient } from './app-server-client.ts';
|
|
27
|
-
|
|
28
|
-
// Capture lines written to stdin
|
|
29
|
-
let stdinLines: string[] = [];
|
|
30
|
-
mockStdin.on('data', (chunk: Buffer) => {
|
|
31
|
-
const text = chunk.toString();
|
|
32
|
-
for (const line of text.split('\n')) {
|
|
33
|
-
if (line.trim()) stdinLines.push(line);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
/** Push a JSON-RPC response line to the mock stdout. */
|
|
38
|
-
function pushResponse(id: number, result: unknown): void {
|
|
39
|
-
mockStdout.push(JSON.stringify({ id, result }) + '\n');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** Push a JSON-RPC notification to the mock stdout. */
|
|
43
|
-
function pushNotification(method: string, params: unknown): void {
|
|
44
|
-
mockStdout.push(JSON.stringify({ method, params }) + '\n');
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
describe('AppServerClient', () => {
|
|
48
|
-
let client: AppServerClient;
|
|
49
|
-
|
|
50
|
-
beforeEach(() => {
|
|
51
|
-
vi.clearAllMocks();
|
|
52
|
-
stdinLines = [];
|
|
53
|
-
mockProc.removeAllListeners();
|
|
54
|
-
mockProc.kill = vi.fn();
|
|
55
|
-
// Re-attach exit handler support
|
|
56
|
-
client = new AppServerClient({ cwd: '/tmp' });
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
afterEach(async () => {
|
|
60
|
-
await client.close();
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('initialize sends request and notification', async () => {
|
|
64
|
-
const initPromise = client.initialize();
|
|
65
|
-
|
|
66
|
-
// Wait for the initialize request to be written
|
|
67
|
-
await new Promise((r) => setTimeout(r, 10));
|
|
68
|
-
|
|
69
|
-
// First line should be the initialize request
|
|
70
|
-
const initReq = JSON.parse(stdinLines[0]);
|
|
71
|
-
expect(initReq.method).toBe('initialize');
|
|
72
|
-
expect(initReq.id).toBe(1);
|
|
73
|
-
expect(initReq.params.clientInfo.name).toBe('agentpane');
|
|
74
|
-
|
|
75
|
-
// Send initialize response
|
|
76
|
-
pushResponse(1, {
|
|
77
|
-
userAgent: 'test/0.147.0',
|
|
78
|
-
codexHome: '/tmp/.codex',
|
|
79
|
-
platformFamily: 'unix',
|
|
80
|
-
platformOs: 'macos',
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
const result = await initPromise;
|
|
84
|
-
expect(result.userAgent).toBe('test/0.147.0');
|
|
85
|
-
|
|
86
|
-
// Second line should be the initialized notification
|
|
87
|
-
const initNotify = JSON.parse(stdinLines[1]);
|
|
88
|
-
expect(initNotify.method).toBe('initialized');
|
|
89
|
-
expect(initNotify.id).toBeUndefined();
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it('request resolves with result when matching response arrives', async () => {
|
|
93
|
-
const promise = client.request('model/list', {});
|
|
94
|
-
|
|
95
|
-
await new Promise((r) => setTimeout(r, 10));
|
|
96
|
-
const req = JSON.parse(stdinLines[0]);
|
|
97
|
-
expect(req.method).toBe('model/list');
|
|
98
|
-
|
|
99
|
-
pushResponse(req.id, { data: [{ id: 'gpt-5', displayName: 'GPT-5' }], nextCursor: null });
|
|
100
|
-
|
|
101
|
-
const result = await promise;
|
|
102
|
-
expect(result).toEqual({ data: [{ id: 'gpt-5', displayName: 'GPT-5' }], nextCursor: null });
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it('request rejects on error response', async () => {
|
|
106
|
-
const promise = client.request('unknown/method', {});
|
|
107
|
-
|
|
108
|
-
await new Promise((r) => setTimeout(r, 10));
|
|
109
|
-
const req = JSON.parse(stdinLines[0]);
|
|
110
|
-
|
|
111
|
-
mockStdout.push(JSON.stringify({ id: req.id, error: { code: -32600, message: 'Invalid request' } }) + '\n');
|
|
112
|
-
|
|
113
|
-
await expect(promise).rejects.toThrow('JSON-RPC error -32600: Invalid request');
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it('notify sends notification without expecting response', async () => {
|
|
117
|
-
client.notify('initialized');
|
|
118
|
-
|
|
119
|
-
await new Promise((r) => setTimeout(r, 10));
|
|
120
|
-
const msg = JSON.parse(stdinLines[0]);
|
|
121
|
-
expect(msg.method).toBe('initialized');
|
|
122
|
-
expect(msg.id).toBeUndefined();
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('onNotification handler is called when notification arrives', async () => {
|
|
126
|
-
const handler = vi.fn();
|
|
127
|
-
client.onNotification('item/completed', handler);
|
|
128
|
-
|
|
129
|
-
pushNotification('item/completed', { threadId: 't1', turnId: 'turn1', item: { id: 'i1', type: 'agent_message' } });
|
|
130
|
-
|
|
131
|
-
await new Promise((r) => setTimeout(r, 10));
|
|
132
|
-
expect(handler).toHaveBeenCalledTimes(1);
|
|
133
|
-
expect(handler).toHaveBeenCalledWith({
|
|
134
|
-
threadId: 't1',
|
|
135
|
-
turnId: 'turn1',
|
|
136
|
-
item: { id: 'i1', type: 'agent_message' },
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
it('process exit rejects all pending requests', async () => {
|
|
141
|
-
const promise1 = client.request('slow/method', {});
|
|
142
|
-
const promise2 = client.request('another/method', {});
|
|
143
|
-
|
|
144
|
-
await new Promise((r) => setTimeout(r, 10));
|
|
145
|
-
|
|
146
|
-
// Simulate process exit
|
|
147
|
-
mockProc.emit('exit', 1, null);
|
|
148
|
-
|
|
149
|
-
await expect(promise1).rejects.toThrow('App-server process exited');
|
|
150
|
-
await expect(promise2).rejects.toThrow('App-server process exited');
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it('malformed JSON is ignored without crash', async () => {
|
|
154
|
-
pushNotification('item/completed', { item: { id: 'i1' } });
|
|
155
|
-
|
|
156
|
-
// Push malformed JSON line
|
|
157
|
-
mockStdout.push('not valid json\n');
|
|
158
|
-
|
|
159
|
-
// Should not crash — next valid message still works
|
|
160
|
-
const handler = vi.fn();
|
|
161
|
-
client.onNotification('test/method', handler);
|
|
162
|
-
pushNotification('test/method', { ok: true });
|
|
163
|
-
|
|
164
|
-
await new Promise((r) => setTimeout(r, 10));
|
|
165
|
-
expect(handler).toHaveBeenCalledTimes(1);
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
it('close rejects pending requests and kills process', async () => {
|
|
169
|
-
const promise = client.request('slow/method', {});
|
|
170
|
-
|
|
171
|
-
await new Promise((r) => setTimeout(r, 10));
|
|
172
|
-
await client.close();
|
|
173
|
-
|
|
174
|
-
await expect(promise).rejects.toThrow('AppServerClient closed');
|
|
175
|
-
expect(mockProc.kill).toHaveBeenCalledWith('SIGTERM');
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
it('isClosed returns true after close', async () => {
|
|
179
|
-
expect(client.isClosed()).toBe(false);
|
|
180
|
-
await client.close();
|
|
181
|
-
expect(client.isClosed()).toBe(true);
|
|
182
|
-
});
|
|
183
|
-
});
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
/** JSON-RPC 2.0 client over stdio for the Codex app-server. */
|
|
2
|
-
|
|
3
|
-
import { spawn, type ChildProcess } from 'node:child_process';
|
|
4
|
-
import { EventEmitter } from 'node:events';
|
|
5
|
-
import type { InitializeParams, InitializeResult } from './app-server-types.ts';
|
|
6
|
-
|
|
7
|
-
/** Request timeout in milliseconds. */
|
|
8
|
-
const REQUEST_TIMEOUT_MS = 30_000;
|
|
9
|
-
|
|
10
|
-
/** Pending request entry. */
|
|
11
|
-
interface PendingRequest {
|
|
12
|
-
resolve: (value: unknown) => void;
|
|
13
|
-
reject: (error: Error) => void;
|
|
14
|
-
timer: ReturnType<typeof setTimeout>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** Options for constructing an AppServerClient. */
|
|
18
|
-
export interface AppServerClientOptions {
|
|
19
|
-
/** Path to the codex binary. Defaults to 'codex'. */
|
|
20
|
-
binaryPath?: string;
|
|
21
|
-
/** Working directory for the app-server process. */
|
|
22
|
-
cwd: string;
|
|
23
|
-
/** Environment variables for the child process. */
|
|
24
|
-
env?: Record<string, string>;
|
|
25
|
-
/** Additional launch args (e.g. ['--config', 'key=value']). */
|
|
26
|
-
launchArgs?: string[];
|
|
27
|
-
/** Client info sent in the initialize handshake. */
|
|
28
|
-
clientInfo?: { name: string; title: string; version: string };
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* JSON-RPC 2.0 client that communicates with `codex app-server` over stdio.
|
|
33
|
-
*
|
|
34
|
-
* Each message is one JSON object per line. Requests have an `id` field;
|
|
35
|
-
* notifications do not. Responses are matched by `id`.
|
|
36
|
-
*/
|
|
37
|
-
export class AppServerClient {
|
|
38
|
-
private readonly proc: ChildProcess;
|
|
39
|
-
private nextId = 1;
|
|
40
|
-
private readonly pending = new Map<number, PendingRequest>();
|
|
41
|
-
private readonly notificationHandlers = new Map<string, Array<(params: unknown) => void>>();
|
|
42
|
-
private readonly requestHandlers = new Map<string, Array<(params: unknown) => Promise<unknown>>>();
|
|
43
|
-
private buffer = '';
|
|
44
|
-
private closed = false;
|
|
45
|
-
private readonly clientInfo: { name: string; title: string; version: string };
|
|
46
|
-
readonly events = new EventEmitter();
|
|
47
|
-
|
|
48
|
-
constructor(options: AppServerClientOptions) {
|
|
49
|
-
const binary = options.binaryPath ?? 'codex';
|
|
50
|
-
const args = ['app-server', ...(options.launchArgs ?? [])];
|
|
51
|
-
|
|
52
|
-
this.proc = spawn(binary, args, {
|
|
53
|
-
cwd: options.cwd,
|
|
54
|
-
env: { ...process.env, ...options.env },
|
|
55
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
this.clientInfo = options.clientInfo ?? { name: 'agentpane', title: 'AgentPane', version: '1.0.0' };
|
|
59
|
-
|
|
60
|
-
this.proc.stdout?.setEncoding('utf-8');
|
|
61
|
-
this.proc.stdout?.on('data', (chunk: string) => this.onStdoutData(chunk));
|
|
62
|
-
this.proc.stderr?.on('data', (chunk: Buffer) => {
|
|
63
|
-
// Log stderr lines for debugging — app-server may emit diagnostic info
|
|
64
|
-
const text = chunk.toString().trim();
|
|
65
|
-
if (text) console.error('[app-server] stderr:', text);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
this.proc.on('exit', (code, signal) => {
|
|
69
|
-
this.onProcessExit(code, signal);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
// Handle spawn errors (e.g. binary not found → ENOENT). Without this listener,
|
|
73
|
-
// an unhandled 'error' event crashes the entire process. See onProcessError.
|
|
74
|
-
this.proc.on('error', (err: Error) => {
|
|
75
|
-
this.onProcessError(err);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/** Perform the initialize handshake. Must be called before any other method. */
|
|
80
|
-
async initialize(): Promise<InitializeResult> {
|
|
81
|
-
const params: InitializeParams = {
|
|
82
|
-
clientInfo: this.clientInfo,
|
|
83
|
-
capabilities: { experimentalApi: true },
|
|
84
|
-
};
|
|
85
|
-
const result = await this.request<InitializeResult>('initialize', params);
|
|
86
|
-
this.notify('initialized');
|
|
87
|
-
return result;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** Send a JSON-RPC request and wait for the response. */
|
|
91
|
-
request<T>(method: string, params?: unknown): Promise<T> {
|
|
92
|
-
return new Promise<T>((resolve, reject) => {
|
|
93
|
-
if (this.closed) {
|
|
94
|
-
reject(new Error('AppServerClient is closed'));
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const id = this.nextId++;
|
|
99
|
-
const message = JSON.stringify({ id, method, params }) + '\n';
|
|
100
|
-
|
|
101
|
-
const timer = setTimeout(() => {
|
|
102
|
-
this.pending.delete(id);
|
|
103
|
-
reject(new Error(`Request '${method}' (id=${id}) timed out after ${REQUEST_TIMEOUT_MS}ms`));
|
|
104
|
-
}, REQUEST_TIMEOUT_MS);
|
|
105
|
-
|
|
106
|
-
this.pending.set(id, {
|
|
107
|
-
resolve: resolve as (value: unknown) => void,
|
|
108
|
-
reject,
|
|
109
|
-
timer,
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
this.write(message);
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/** Send a JSON-RPC notification (no response expected). */
|
|
117
|
-
notify(method: string, params?: unknown): void {
|
|
118
|
-
if (this.closed) return;
|
|
119
|
-
const message = JSON.stringify({ method, params }) + '\n';
|
|
120
|
-
this.write(message);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/** Register a handler for a server→client notification. */
|
|
124
|
-
onNotification(method: string, handler: (params: unknown) => void): void {
|
|
125
|
-
const handlers = this.notificationHandlers.get(method) ?? [];
|
|
126
|
-
handlers.push(handler);
|
|
127
|
-
this.notificationHandlers.set(method, handlers);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/** Register a handler for a server→client request. */
|
|
131
|
-
onRequest(method: string, handler: (params: unknown) => Promise<unknown>): void {
|
|
132
|
-
const handlers = this.requestHandlers.get(method) ?? [];
|
|
133
|
-
handlers.push(handler);
|
|
134
|
-
this.requestHandlers.set(method, handlers);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/** Check if the client is closed (process exited or close() called). */
|
|
138
|
-
isClosed(): boolean {
|
|
139
|
-
return this.closed;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/** Close the client and kill the app-server process. */
|
|
143
|
-
async close(): Promise<void> {
|
|
144
|
-
if (this.closed) return;
|
|
145
|
-
this.closed = true;
|
|
146
|
-
|
|
147
|
-
// Reject all pending requests
|
|
148
|
-
for (const [id, entry] of this.pending) {
|
|
149
|
-
clearTimeout(entry.timer);
|
|
150
|
-
entry.reject(new Error('AppServerClient closed'));
|
|
151
|
-
this.pending.delete(id);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// Kill the process
|
|
155
|
-
this.proc.kill('SIGTERM');
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// --- Internal methods ---
|
|
159
|
-
|
|
160
|
-
private write(message: string): void {
|
|
161
|
-
this.proc.stdin?.write(message);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
private onStdoutData(chunk: string): void {
|
|
165
|
-
this.buffer += chunk;
|
|
166
|
-
const lines = this.buffer.split('\n');
|
|
167
|
-
this.buffer = lines.pop() ?? '';
|
|
168
|
-
|
|
169
|
-
for (const line of lines) {
|
|
170
|
-
const trimmed = line.trim();
|
|
171
|
-
if (!trimmed) continue;
|
|
172
|
-
this.handleMessage(trimmed);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
private handleMessage(raw: string): void {
|
|
177
|
-
let msg: Record<string, unknown>;
|
|
178
|
-
try {
|
|
179
|
-
msg = JSON.parse(raw) as Record<string, unknown>;
|
|
180
|
-
} catch {
|
|
181
|
-
// Ignore malformed JSON lines
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// Response to a request (has `id` + `result` or `error`)
|
|
186
|
-
if ('id' in msg && typeof msg.id === 'number') {
|
|
187
|
-
const pending = this.pending.get(msg.id);
|
|
188
|
-
if (!pending) return;
|
|
189
|
-
|
|
190
|
-
clearTimeout(pending.timer);
|
|
191
|
-
this.pending.delete(msg.id);
|
|
192
|
-
|
|
193
|
-
if (msg.error) {
|
|
194
|
-
const err = msg.error as { code: number; message: string };
|
|
195
|
-
pending.reject(new Error(`JSON-RPC error ${err.code}: ${err.message}`));
|
|
196
|
-
} else {
|
|
197
|
-
pending.resolve(msg.result);
|
|
198
|
-
}
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// Notification (has `method` but no `id`)
|
|
203
|
-
if ('method' in msg && typeof msg.method === 'string') {
|
|
204
|
-
const handlers = this.notificationHandlers.get(msg.method);
|
|
205
|
-
if (handlers) {
|
|
206
|
-
for (const handler of handlers) {
|
|
207
|
-
handler(msg.params);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
this.events.emit('notification', msg.method, msg.params);
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
private onProcessExit(code: number | null, signal: NodeJS.Signals | null): void {
|
|
216
|
-
if (this.closed) return;
|
|
217
|
-
this.closed = true;
|
|
218
|
-
|
|
219
|
-
const reason = signal ? `signal ${signal}` : `code ${code}`;
|
|
220
|
-
const error = new Error(`App-server process exited (${reason})`);
|
|
221
|
-
|
|
222
|
-
for (const [, entry] of this.pending) {
|
|
223
|
-
clearTimeout(entry.timer);
|
|
224
|
-
entry.reject(error);
|
|
225
|
-
}
|
|
226
|
-
this.pending.clear();
|
|
227
|
-
|
|
228
|
-
this.events.emit('closed', reason);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/** Handle a spawn/runtime error on the child process (e.g. ENOENT when the
|
|
232
|
-
* binary is missing). Rejects pending requests and emits 'closed' so callers
|
|
233
|
-
* can fail gracefully instead of crashing the whole process. */
|
|
234
|
-
private onProcessError(err: Error): void {
|
|
235
|
-
if (this.closed) return;
|
|
236
|
-
this.closed = true;
|
|
237
|
-
|
|
238
|
-
for (const [, entry] of this.pending) {
|
|
239
|
-
clearTimeout(entry.timer);
|
|
240
|
-
entry.reject(err);
|
|
241
|
-
}
|
|
242
|
-
this.pending.clear();
|
|
243
|
-
|
|
244
|
-
this.events.emit('closed', err.message);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|