@nervekit/desktop 0.39.0 → 0.39.1
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/dist/tray/tray.d.ts.map +1 -1
- package/dist/tray/tray.js +25 -1
- package/dist/tray/tray.js.map +1 -1
- package/dist/window/gpu-process.d.ts +15 -0
- package/dist/window/gpu-process.d.ts.map +1 -0
- package/dist/window/gpu-process.js +17 -0
- package/dist/window/gpu-process.js.map +1 -0
- package/node_modules/@nervekit/contracts/dist/domains/core/async-bash.d.ts +3 -12
- package/node_modules/@nervekit/contracts/dist/domains/core/async-bash.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/core/async-bash.js +6 -12
- package/node_modules/@nervekit/contracts/dist/domains/core/async-bash.js.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/core/channel.d.ts +255 -12
- package/node_modules/@nervekit/contracts/dist/domains/core/channel.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/core/core-operations.d.ts +171 -12
- package/node_modules/@nervekit/contracts/dist/domains/core/core-operations.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/core/event.d.ts +252 -0
- package/node_modules/@nervekit/contracts/dist/domains/core/event.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/core/event.js +3 -0
- package/node_modules/@nervekit/contracts/dist/domains/core/event.js.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/git/git.d.ts +4 -4
- package/node_modules/@nervekit/contracts/dist/domains/git/operations.d.ts +2 -2
- package/node_modules/@nervekit/contracts/dist/domains/settings/settings.d.ts +1 -0
- package/node_modules/@nervekit/contracts/dist/domains/settings/settings.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/settings/settings.js +2 -0
- package/node_modules/@nervekit/contracts/dist/domains/settings/settings.js.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/subagents/constants.js +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/tools/kroki.d.ts +3 -3
- package/node_modules/@nervekit/contracts/dist/domains/tools/tool-agent-projection.d.ts +11 -11
- package/node_modules/@nervekit/contracts/dist/domains/tools/tool-agent-projection.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/tools/tool-agent-projection.js +3 -3
- package/node_modules/@nervekit/contracts/dist/domains/tools/tool-agent-projection.js.map +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/tools/tool-output.d.ts +1 -1
- package/node_modules/@nervekit/contracts/dist/domains/tools/tool-results.d.ts +18 -18
- package/node_modules/@nervekit/contracts/dist/operations/catalog.d.ts +173 -14
- package/node_modules/@nervekit/contracts/dist/operations/catalog.d.ts.map +1 -1
- package/node_modules/@nervekit/contracts/dist/wire/message.d.ts +1 -1
- package/node_modules/@nervekit/contracts/dist/wire/rpc.d.ts +2 -2
- package/node_modules/@nervekit/contracts/package.json +1 -1
- package/node_modules/@nervekit/conversation-core/dist/async-bash/async-bash.service.d.ts.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/async-bash/async-bash.service.js +9 -28
- package/node_modules/@nervekit/conversation-core/dist/async-bash/async-bash.service.js.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/async-bash/async-bash.service.test.js +23 -38
- package/node_modules/@nervekit/conversation-core/dist/async-bash/async-bash.service.test.js.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/delegation/child-report.d.ts +5 -0
- package/node_modules/@nervekit/conversation-core/dist/delegation/child-report.d.ts.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/delegation/child-report.js +10 -1
- package/node_modules/@nervekit/conversation-core/dist/delegation/child-report.js.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/delegation/delegation-tools.d.ts.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/delegation/delegation-tools.js +9 -3
- package/node_modules/@nervekit/conversation-core/dist/delegation/delegation-tools.js.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/delegation/delegation-tools.test.js +4 -3
- package/node_modules/@nervekit/conversation-core/dist/delegation/delegation-tools.test.js.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/delegation/subagent-core-texts.fixture.json +1 -1
- package/node_modules/@nervekit/conversation-core/dist/delegation/subagent-status.d.ts +1 -1
- package/node_modules/@nervekit/conversation-core/dist/delegation/subagent-status.d.ts.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/delegation/subagent-status.js +9 -8
- package/node_modules/@nervekit/conversation-core/dist/delegation/subagent-status.js.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/delegation/subagent-status.test.js +15 -0
- package/node_modules/@nervekit/conversation-core/dist/delegation/subagent-status.test.js.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/ports.d.ts +2 -3
- package/node_modules/@nervekit/conversation-core/dist/ports.d.ts.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/runtime/core-lifecycle.test.js +2 -2
- package/node_modules/@nervekit/conversation-core/dist/runtime/core-lifecycle.test.js.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/tool-calls/tool-call-settlement.service.d.ts.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/tool-calls/tool-call-settlement.service.js +1 -0
- package/node_modules/@nervekit/conversation-core/dist/tool-calls/tool-call-settlement.service.js.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/tool-calls/tool-result.service.d.ts +2 -1
- package/node_modules/@nervekit/conversation-core/dist/tool-calls/tool-result.service.d.ts.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/tool-calls/tool-result.service.js +27 -2
- package/node_modules/@nervekit/conversation-core/dist/tool-calls/tool-result.service.js.map +1 -1
- package/node_modules/@nervekit/conversation-core/dist/tool-calls/tool-result.service.test.d.ts +2 -0
- package/node_modules/@nervekit/conversation-core/dist/tool-calls/tool-result.service.test.d.ts.map +1 -0
- package/node_modules/@nervekit/conversation-core/dist/tool-calls/tool-result.service.test.js +112 -0
- package/node_modules/@nervekit/conversation-core/dist/tool-calls/tool-result.service.test.js.map +1 -0
- package/node_modules/@nervekit/conversation-core/package.json +6 -6
- package/node_modules/@nervekit/harness/package.json +3 -3
- package/node_modules/@nervekit/native/package.json +1 -1
- package/node_modules/@nervekit/native/prebuilds/nerve_native.darwin-arm64.node +0 -0
- package/node_modules/@nervekit/native/prebuilds/nerve_native.darwin-x64.node +0 -0
- package/node_modules/@nervekit/native/prebuilds/nerve_native.linux-arm64-gnu.node +0 -0
- package/node_modules/@nervekit/native/prebuilds/nerve_native.linux-x64-gnu.node +0 -0
- package/node_modules/@nervekit/native/prebuilds/nerve_native.win32-arm64-msvc.node +0 -0
- package/node_modules/@nervekit/native/prebuilds/nerve_native.win32-x64-msvc.node +0 -0
- package/node_modules/@nervekit/protocol/package.json +2 -2
- package/node_modules/@nervekit/skills/package.json +2 -2
- package/node_modules/@nervekit/tools/dist/catalog/definitions/core/shell.tools.js +1 -1
- package/node_modules/@nervekit/tools/dist/catalog/definitions/core/shell.tools.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/catalog/definitions/core/shell.tools.test.js +1 -1
- package/node_modules/@nervekit/tools/dist/catalog/definitions/core/shell.tools.test.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/output/bounded-process-output.d.ts +0 -2
- package/node_modules/@nervekit/tools/dist/execution/output/bounded-process-output.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/output/bounded-process-output.js +0 -4
- package/node_modules/@nervekit/tools/dist/execution/output/bounded-process-output.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/process/process-agent-content.d.ts +11 -0
- package/node_modules/@nervekit/tools/dist/execution/process/process-agent-content.d.ts.map +1 -0
- package/node_modules/@nervekit/tools/dist/execution/process/process-agent-content.js +22 -0
- package/node_modules/@nervekit/tools/dist/execution/process/process-agent-content.js.map +1 -0
- package/node_modules/@nervekit/tools/dist/execution/process/process-result.d.ts +8 -9
- package/node_modules/@nervekit/tools/dist/execution/process/process-result.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/process/process-result.js +53 -87
- package/node_modules/@nervekit/tools/dist/execution/process/process-result.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/python/python.js +1 -1
- package/node_modules/@nervekit/tools/dist/execution/python/python.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/execution/shell/bash.js +1 -1
- package/node_modules/@nervekit/tools/dist/execution/shell/bash.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/candidates/filesystem.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/candidates/filesystem.js +0 -13
- package/node_modules/@nervekit/tools/dist/result-projection/candidates/filesystem.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/candidates/process.d.ts +1 -0
- package/node_modules/@nervekit/tools/dist/result-projection/candidates/process.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/candidates/process.js +11 -45
- package/node_modules/@nervekit/tools/dist/result-projection/candidates/process.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/index.d.ts +1 -0
- package/node_modules/@nervekit/tools/dist/result-projection/index.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/index.js +1 -0
- package/node_modules/@nervekit/tools/dist/result-projection/index.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/policies/index.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/policies/index.js +8 -5
- package/node_modules/@nervekit/tools/dist/result-projection/policies/index.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/policies/process.d.ts +2 -0
- package/node_modules/@nervekit/tools/dist/result-projection/policies/process.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/policies/process.js +3 -1
- package/node_modules/@nervekit/tools/dist/result-projection/policies/process.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/process-output.d.ts +32 -1
- package/node_modules/@nervekit/tools/dist/result-projection/process-output.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/process-output.js +63 -72
- package/node_modules/@nervekit/tools/dist/result-projection/process-output.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/process-output.test.js +85 -16
- package/node_modules/@nervekit/tools/dist/result-projection/process-output.test.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/profiles.d.ts +2 -0
- package/node_modules/@nervekit/tools/dist/result-projection/profiles.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/profiles.js +27 -5
- package/node_modules/@nervekit/tools/dist/result-projection/profiles.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/projector.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/projector.js +1 -3
- package/node_modules/@nervekit/tools/dist/result-projection/projector.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/strategies.d.ts +4 -1
- package/node_modules/@nervekit/tools/dist/result-projection/strategies.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/strategies.js +106 -23
- package/node_modules/@nervekit/tools/dist/result-projection/strategies.js.map +1 -1
- package/node_modules/@nervekit/tools/dist/result-projection/types.d.ts +2 -0
- package/node_modules/@nervekit/tools/dist/result-projection/types.d.ts.map +1 -1
- package/node_modules/@nervekit/tools/package.json +4 -4
- package/node_modules/@nervekit/workbench-server/dist/core-host/execution-admission/production-admission-fixture.js +1 -1
- package/node_modules/@nervekit/workbench-server/dist/core-host/execution-admission/production-admission-fixture.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/core-host/process.adapter.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/core-host/process.adapter.js +1 -5
- package/node_modules/@nervekit/workbench-server/dist/core-host/process.adapter.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/core-host/process.adapter.test.js +10 -13
- package/node_modules/@nervekit/workbench-server/dist/core-host/process.adapter.test.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/core-host/tool-host.adapter.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/core-host/tool-host.adapter.js +18 -20
- package/node_modules/@nervekit/workbench-server/dist/core-host/tool-host.adapter.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/core-host/tool-host.adapter.test.js +3 -3
- package/node_modules/@nervekit/workbench-server/dist/core-host/tool-host.adapter.test.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/framework/registry-metadata.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/framework/registry-metadata.js +5 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/framework/registry-metadata.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/migrations.lock.json +4 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/0003-process-output-files/step.d.ts +3 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/0003-process-output-files/step.d.ts.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/0003-process-output-files/step.js +147 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/0003-process-output-files/step.js.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/0003-process-output-files/step.test.d.ts +2 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/0003-process-output-files/step.test.d.ts.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/0003-process-output-files/step.test.js +139 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/0003-process-output-files/step.test.js.map +1 -0
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/index.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/index.js +2 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/index.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/output-capture.d.ts +0 -2
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/output-capture.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/output-capture.js +2 -6
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/output-capture.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/output-capture.test.js +9 -24
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/output-capture.test.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/readiness.d.ts +1 -2
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/readiness.d.ts.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/readiness.js +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/readiness.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/readiness.test.js +1 -1
- package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/readiness.test.js.map +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/AsyncBashCenterHost-DEGEun34.js +2 -0
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{ConversationListItem-B3G7zU2n.js → ConversationListItem-CmfaqHrd.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{ConversationsWorkbenchPanel-D1K-dbSb.js → ConversationsWorkbenchPanel-tF-uq_Db.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{DiscoverCenterHost-B0W_lSBn.js → DiscoverCenterHost-q3v1juvu.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{FileCenterHost-DWv0ZGjl.js → FileCenterHost-UUWP9xPe.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{FilesWorkbenchPanel-CyWp2l-k.js → FilesWorkbenchPanel-D7lZGJOq.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{GitDiffCenterHost-R7nq0BJ_.js → GitDiffCenterHost-Bg01x55Z.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{GitWorkbenchPanel-BOjphKbA.js → GitWorkbenchPanel-BA6GHlzW.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{LaunchCenterHost-DxpVlEVB.js → LaunchCenterHost-CBR2q85D.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{LaunchConfigurationNotice-DET_VgSZ.js → LaunchConfigurationNotice-bA2D0w3B.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{LaunchesWorkbenchPanel-d8zYnEZ8.js → LaunchesWorkbenchPanel-hlUuWRa-.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{LogsCenterHost-1ZI3Me-W.js → LogsCenterHost-C0yLhvTj.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MermaidCenterHost-47Df7nz1.js → MermaidCenterHost-DHdBvuUw.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MermaidDiagram-UJEm-D8H.js → MermaidDiagram-DuO9_PVv.js} +2 -2
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MobileFilesBody-h6SgR4cz.js → MobileFilesBody-D34zuK6n.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MobileFilesHost-CDeAaI_5.js → MobileFilesHost-D0o7omGB.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MobileLaunchOutputHost-DbVZ7exf.js → MobileLaunchOutputHost-B2kFSFTi.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MobileLaunchesHost-DK1XbAgi.js → MobileLaunchesHost-DtF6YusM.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MobileLogsHost-DpIMUk6m.js → MobileLogsHost-BefSvgCO.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MobileNoteEditorHost-D7O5b53t.js → MobileNoteEditorHost-BTzutXwb.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MobileNotesHost-DBDXJWUU.js → MobileNotesHost-BrHU2n0K.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MobileProjectSettingsHost-ZMQEeazJ.js → MobileProjectSettingsHost-BQ-iyyBD.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MobileProjectSettingsPageHost-CVDBeeGr.js → MobileProjectSettingsPageHost-AMfsMfBy.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MobileSettingsHost-CciZ84n1.js → MobileSettingsHost-BkzM6PSH.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MobileSettingsPageHost-hGBn8vYB.js → MobileSettingsPageHost-CCfaCyNP.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{MobileSettingsPageScreen-CO-lCO-f.js → MobileSettingsPageScreen-BswFipK3.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{NotesWorkbenchPanel-CJCNJFDn.js → NotesWorkbenchPanel-DHa-qV3J.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{ProjectSettingsCenterHost-CpNp8Ce6.js → ProjectSettingsCenterHost-CASe4A2L.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{PullRequestCenterHost-CkMeElEl.js → PullRequestCenterHost-D2PkmVIP.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{PullRequestsWorkbenchPanel-C9CUxgik.js → PullRequestsWorkbenchPanel-DXhITLz4.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{SettingsCenter-DJ4nZPXc.js → SettingsCenter-DcaDpk_E.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{SettingsCenterHost-C6ioiRrM.js → SettingsCenterHost-BhjEdCtf.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{SystemPromptCenterHost-BRUs31D7.js → SystemPromptCenterHost-Cs3Gau3j.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{abnfDiagram-N423BO3Z-BKYRESmB.js → abnfDiagram-N423BO3Z-DAhzYnJT.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{adapters-B0Jsunte.js → adapters-BzP2EwNM.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{agent-profiles.svelte-BID9Ew82.js → agent-profiles.svelte-Dni_M1Y-.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{api-BmEXqx0Z.js → api-BdtfMsJt.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{architectureDiagram-T3A2C74G-jnUStccJ.js → architectureDiagram-T3A2C74G-Ci9KKkPc.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{center-tabs.svelte-D9ynKcBB.js → center-tabs.svelte-C63pAtB1.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/channel-8DdkSVgA.js +57 -0
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-5RXB4S5H-B1ioPhb6.js → chunk-5RXB4S5H-i0r-_bqJ.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-6Q2QTUOP-C5IY7t3t.js → chunk-6Q2QTUOP-9OZULOnF.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-GF5L2VYU-C5waUH6r.js → chunk-GF5L2VYU-CJ71QskU.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{chunk-JQJVKLGR-B_LOMB14.js → chunk-JQJVKLGR-CV8yu0tT.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{classDiagram-JCYQIIEL-CemcCi3o.js → classDiagram-JCYQIIEL-BV5_Fdkp.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{classDiagram-v2-OCEON4UE-CemcCi3o.js → classDiagram-v2-OCEON4UE-BV5_Fdkp.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{conversation-connection-5tiO4Nrw.js → conversation-connection-CYo0bR0A.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{cynefinDiagram-MW4NZA55-Cls68FEa.js → cynefinDiagram-MW4NZA55-7KofbLUD.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{diagram-7IWD3JNH-CdPGfz1T.js → diagram-7IWD3JNH-CVQZ53DK.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{diagram-LBJQPF4R-eTwYhxYj.js → diagram-LBJQPF4R-BJupLxO2.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{diagram-Q27KOJAE-6Gl34O5e.js → diagram-Q27KOJAE-DWnNDc-Y.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{diagram-UB23O5K3-BLV-37wt.js → diagram-UB23O5K3-1HUdiVgw.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{discover-CP8CoRNU.js → discover-Cwb_-ENy.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{ebnfDiagram-BXEA7PRR-ZMaf7cWP.js → ebnfDiagram-BXEA7PRR-C6a_mK_v.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{erDiagram-JOGREHBK-B9PmYVVd.js → erDiagram-JOGREHBK-C3eKQJKL.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{file-display-CMYnl_e3.js → file-display-BBKnfFTR.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{file-tabs.svelte-LqQOwVx2.js → file-tabs.svelte-27ZyVL9Y.js} +2 -2
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{flowDiagram-UKHOOZJN-BZcdOw0L.js → flowDiagram-UKHOOZJN-Cvqy_8hY.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{ganttDiagram-PKOTCBZU-9jZwXDZ0.js → ganttDiagram-PKOTCBZU-D111l9lM.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/git-refresh-coordinator.svelte-CAR86YfE.js +1 -0
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{git.api-wHL8xb4P.js → git.api-Cov_VX5v.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{index-LlrpqpBN.css → index-ButpOtrp.css} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{index-QUxdYOz6.js → index-DfqYUGHJ.js} +9 -9
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{infoDiagram-6WML65LV-CJUOe1Pw.js → infoDiagram-6WML65LV-CjjIu3OV.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{ishikawaDiagram-WSZJBQD7-Bbwa6NP3.js → ishikawaDiagram-WSZJBQD7-Bu5BT-tk.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{kanban-definition-27J2QSJJ-BTmW9v61.js → kanban-definition-27J2QSJJ-yhCf7AhR.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{launches-CAUTpGjr.js → launches-xxVWpkLl.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{launches.api-QbSdnR4o.js → launches.api-CLzhVL0X.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{launches.svelte-Dv9QD3zw.js → launches.svelte-DuNDOQ34.js} +2 -2
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{linear-BkNLRi-b.js → linear-ZVNMgrbS.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{logs.api-ouTjhE0B.js → logs.api-C4bM9sgo.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{maintenance-state.svelte-AWJo8R18.js → maintenance-state.svelte-D49-eLUW.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{mermaid-DH_bA_5L.js → mermaid-ChMBz_O3.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{mermaid.core-AL8NUoML.js → mermaid.core-B8WPiyqo.js} +3 -3
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{mindmap-definition-FAOFIHXS-BGTSt-9O.js → mindmap-definition-FAOFIHXS-BYt3fQ98.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{pegDiagram-VL7TDLO6-DXS5KGn5.js → pegDiagram-VL7TDLO6-D99hO_3a.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{pieDiagram-7S7Q4E2Y-BfHG63hS.js → pieDiagram-7S7Q4E2Y-CCSYV9cX.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{pr-tabs.svelte-Eq07TmXr.js → pr-tabs.svelte-S4JDwOMn.js} +2 -2
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{quadrantDiagram-CIZ2JOQS-D8wJ5Bn9.js → quadrantDiagram-CIZ2JOQS-CRje0Wwz.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{railroadDiagram-AXF67PYL-CWB5-Ke-.js → railroadDiagram-AXF67PYL-DsQDScPL.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{requirementDiagram-LRYGKXZP-BlLydqYI.js → requirementDiagram-LRYGKXZP-Cz7rDOOR.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{scratch-notes-state.svelte-dzWFpFGR.js → scratch-notes-state.svelte-DDMXTW1Q.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{scratch-notes.api-CdTFjddM.js → scratch-notes.api-DhqVa2aF.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{sequenceDiagram-SI44F4Z6-tD6u3vUr.js → sequenceDiagram-SI44F4Z6-BrOrbrZH.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{settings-BRhrAvdc.js → settings-9NvCCmMg.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/settings-BaDU3obH.js +1 -0
- package/node_modules/@nervekit/workbench-server/dist/web/assets/settings-actions.svelte-CiecxOOz.js +1 -0
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{settings-page-controllers.svelte-BmPfkk87.js → settings-page-controllers.svelte-DEf3msKZ.js} +24 -24
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{shell-layout.svelte-BL1DE2e_.js → shell-layout.svelte-BOI2ayZb.js} +2 -2
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{stateDiagram-OKZ733FA-C3_9VlNB.js → stateDiagram-OKZ733FA-Bl9L0vh-.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{stateDiagram-v2-UEYNNEHI-JVr932-4.js → stateDiagram-v2-UEYNNEHI-CWsi5sna.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{swimlanesDiagram-ULZ7WXOC-DaBK6X9F.js → swimlanesDiagram-ULZ7WXOC-UZqfXJjM.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{timeline-definition-Z64GVDOM-BG0BwWzR.js → timeline-definition-Z64GVDOM-_Lk498JE.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{vennDiagram-T6HMQDX7-BdKPfEBe.js → vennDiagram-T6HMQDX7-DbB-uc5R.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{views-CtmOx4M_.js → views-BY0Dx9NA.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{wardleyDiagram-T6FBY63Y-CZl0dUbu.js → wardleyDiagram-T6FBY63Y-kjAxD7lB.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{workbench-connection-B9LTERKy.js → workbench-connection-Db7zoJEd.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{workspace-actions.svelte-CocvH79c.js → workspace-actions.svelte-DInqZkCe.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{workspace-C5INUgAS.js → workspace-gGORg5nc.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{workspace-selectors.svelte-qn8NwRel.js → workspace-selectors.svelte-CDbT4ide.js} +81 -81
- package/node_modules/@nervekit/workbench-server/dist/web/assets/{xychartDiagram-ELKLHX3M-DnS-OLQT.js → xychartDiagram-ELKLHX3M-4YFLcdaA.js} +1 -1
- package/node_modules/@nervekit/workbench-server/dist/web/index.html +31 -30
- package/node_modules/@nervekit/workbench-server/dist/web/sw.js +1 -1
- package/node_modules/@nervekit/workbench-server/package.json +8 -8
- package/package.json +9 -9
- package/node_modules/@nervekit/workbench-server/dist/web/assets/AsyncBashCenterHost-BC3WbGNS.js +0 -2
- package/node_modules/@nervekit/workbench-server/dist/web/assets/channel-LwAUJ3GF.js +0 -57
- package/node_modules/@nervekit/workbench-server/dist/web/assets/git-refresh-coordinator.svelte-CeUElr1N.js +0 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/settings-B6OgCls1.js +0 -1
- package/node_modules/@nervekit/workbench-server/dist/web/assets/settings-actions.svelte-BNlCdQ0h.js +0 -1
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
2
|
+
import { join, posix } from "node:path";
|
|
3
|
+
import { DatabaseSync } from "node:sqlite";
|
|
4
|
+
import { createId } from "@nervekit/contracts";
|
|
5
|
+
import { defineStep } from "../../framework/step.js";
|
|
6
|
+
const insertedPath = (context) => join(context.scratchDir, "inserted-assets.json");
|
|
7
|
+
function readInserted(context) {
|
|
8
|
+
const path = insertedPath(context);
|
|
9
|
+
return existsSync(path)
|
|
10
|
+
? JSON.parse(readFileSync(path, "utf8")).assetIds
|
|
11
|
+
: [];
|
|
12
|
+
}
|
|
13
|
+
/** One scan of background-run assets (`asset.async_bash_id` is not indexed); grouping happens here. */
|
|
14
|
+
function candidates(database) {
|
|
15
|
+
const rows = database
|
|
16
|
+
.prepare(`SELECT a.async_bash_id, b.conversation_id, b.tool_call_id, a.logical_path
|
|
17
|
+
FROM asset a JOIN async_bash b ON b.id = a.async_bash_id
|
|
18
|
+
WHERE a.async_bash_id IS NOT NULL`)
|
|
19
|
+
.all();
|
|
20
|
+
const byId = new Map();
|
|
21
|
+
for (const row of rows) {
|
|
22
|
+
const candidate = byId.get(row.async_bash_id) ?? {
|
|
23
|
+
asyncBashId: row.async_bash_id,
|
|
24
|
+
conversationId: row.conversation_id,
|
|
25
|
+
toolCallId: row.tool_call_id,
|
|
26
|
+
directory: posix.dirname(row.logical_path),
|
|
27
|
+
sources: new Map(),
|
|
28
|
+
};
|
|
29
|
+
candidate.sources.set(posix.basename(row.logical_path), row.logical_path);
|
|
30
|
+
byId.set(row.async_bash_id, candidate);
|
|
31
|
+
}
|
|
32
|
+
return [...byId.values()]
|
|
33
|
+
.filter((candidate) => !candidate.sources.has("output.txt") &&
|
|
34
|
+
(candidate.sources.has("combined.txt") ||
|
|
35
|
+
candidate.sources.has("stdout.txt") ||
|
|
36
|
+
candidate.sources.has("stderr.txt")))
|
|
37
|
+
.sort((a, b) => a.asyncBashId.localeCompare(b.asyncBashId));
|
|
38
|
+
}
|
|
39
|
+
function open(context, readOnly) {
|
|
40
|
+
return new DatabaseSync(context.paths.sqlitePath, { readOnly });
|
|
41
|
+
}
|
|
42
|
+
function target(context, candidate) {
|
|
43
|
+
return join(context.paths.dataPath, candidate.directory, "output.txt");
|
|
44
|
+
}
|
|
45
|
+
function outputBytes(context, candidate) {
|
|
46
|
+
const read = (name) => {
|
|
47
|
+
const logical = candidate.sources.get(name);
|
|
48
|
+
const path = logical && join(context.paths.dataPath, logical);
|
|
49
|
+
return path && existsSync(path) ? readFileSync(path) : Buffer.alloc(0);
|
|
50
|
+
};
|
|
51
|
+
// `combined.txt` already holds both streams in arrival order, labelled by stream.
|
|
52
|
+
if (candidate.sources.has("combined.txt"))
|
|
53
|
+
return read("combined.txt");
|
|
54
|
+
return Buffer.concat([read("stdout.txt"), read("stderr.txt")]);
|
|
55
|
+
}
|
|
56
|
+
export default defineStep({
|
|
57
|
+
id: "0003-process-output-files",
|
|
58
|
+
description: "Give every background command a single output file",
|
|
59
|
+
ownedPaths(context) {
|
|
60
|
+
if (!existsSync(context.paths.sqlitePath))
|
|
61
|
+
return [];
|
|
62
|
+
const database = open(context, true);
|
|
63
|
+
try {
|
|
64
|
+
return candidates(database).map((candidate) => target(context, candidate));
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
database.close();
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
async run(context) {
|
|
71
|
+
if (!existsSync(context.paths.sqlitePath))
|
|
72
|
+
return;
|
|
73
|
+
const database = open(context, false);
|
|
74
|
+
try {
|
|
75
|
+
const pending = candidates(database);
|
|
76
|
+
context.progress("run", 0, pending.length, "Writing output files");
|
|
77
|
+
const rows = pending.map((candidate) => {
|
|
78
|
+
const path = target(context, candidate);
|
|
79
|
+
context.fs.write(path, outputBytes(context, candidate));
|
|
80
|
+
return { candidate, path, id: createId("asset") };
|
|
81
|
+
});
|
|
82
|
+
// Record IDs before inserting, keeping earlier attempts', so a failed step can be rolled back.
|
|
83
|
+
context.fs.write(insertedPath(context), JSON.stringify({
|
|
84
|
+
assetIds: [...readInserted(context), ...rows.map((row) => row.id)],
|
|
85
|
+
}));
|
|
86
|
+
const insert = database.prepare(`INSERT INTO asset (id, conversation_id, event_id, tool_call_id, async_bash_id, category,
|
|
87
|
+
logical_path, digest, byte_length, media_type, created_at)
|
|
88
|
+
VALUES (?, ?, NULL, ?, ?, 'bash_output', ?, NULL, ?, NULL, ?)`);
|
|
89
|
+
const now = new Date().toISOString();
|
|
90
|
+
database.exec("BEGIN IMMEDIATE");
|
|
91
|
+
try {
|
|
92
|
+
for (const { candidate, path, id } of rows)
|
|
93
|
+
insert.run(id, candidate.conversationId, candidate.toolCallId, candidate.asyncBashId, posix.join(candidate.directory, "output.txt"), statSync(path).size, now);
|
|
94
|
+
database.exec("COMMIT");
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
database.exec("ROLLBACK");
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
context.progress("run", rows.length, rows.length);
|
|
101
|
+
context.log(`Created output files for ${rows.length} background runs`);
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
database.close();
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
async verify(context) {
|
|
108
|
+
if (!existsSync(context.paths.sqlitePath))
|
|
109
|
+
return;
|
|
110
|
+
const database = open(context, true);
|
|
111
|
+
try {
|
|
112
|
+
const missing = candidates(database).length;
|
|
113
|
+
if (missing > 0)
|
|
114
|
+
throw new Error(`${missing} background runs still have no output file`);
|
|
115
|
+
const assetIds = readInserted(context);
|
|
116
|
+
const lookup = database.prepare("SELECT logical_path, byte_length FROM asset WHERE id = ?");
|
|
117
|
+
for (const id of assetIds) {
|
|
118
|
+
const row = lookup.get(id);
|
|
119
|
+
const file = row && join(context.paths.dataPath, row.logical_path);
|
|
120
|
+
if (!file ||
|
|
121
|
+
!existsSync(file) ||
|
|
122
|
+
statSync(file).size !== row.byte_length)
|
|
123
|
+
throw new Error(`Missing or changed background output file for ${id}`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
finally {
|
|
127
|
+
database.close();
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
async rollback(context) {
|
|
131
|
+
const assetIds = readInserted(context);
|
|
132
|
+
if (!assetIds.length || !existsSync(context.paths.sqlitePath))
|
|
133
|
+
return;
|
|
134
|
+
const database = open(context, false);
|
|
135
|
+
try {
|
|
136
|
+
const remove = database.prepare("DELETE FROM asset WHERE id = ?");
|
|
137
|
+
database.exec("BEGIN IMMEDIATE");
|
|
138
|
+
for (const id of assetIds)
|
|
139
|
+
remove.run(id);
|
|
140
|
+
database.exec("COMMIT");
|
|
141
|
+
}
|
|
142
|
+
finally {
|
|
143
|
+
database.close();
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
//# sourceMappingURL=step.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.js","sourceRoot":"","sources":["../../../../../src/infrastructure/migrations/steps/0003-process-output-files/step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAoB,MAAM,yBAAyB,CAAC;AAmBvE,MAAM,YAAY,GAAG,CAAC,OAAoB,EAAE,EAAE,CAC5C,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,sBAAsB,CAAC,CAAC;AAEnD,SAAS,YAAY,CAAC,OAAoB;IACxC,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,UAAU,CAAC,IAAI,CAAC;QACrB,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAc,CAAC,QAAQ;QAC/D,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AAED,uGAAuG;AACvG,SAAS,UAAU,CAAC,QAAsB;IACxC,MAAM,IAAI,GAAG,QAAQ;SAClB,OAAO,CACN;;yCAEmC,CACpC;SACA,GAAG,EAKH,CAAC;IACJ,MAAM,IAAI,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC1C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI;YAC/C,WAAW,EAAE,GAAG,CAAC,aAAa;YAC9B,cAAc,EAAE,GAAG,CAAC,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,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;gBACnE,IACE,CAAC,IAAI;oBACL,CAAC,UAAU,CAAC,IAAI,CAAC;oBACjB,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,WAAW;oBAEvC,MAAM,IAAI,KAAK,CACb,iDAAiD,EAAE,EAAE,CACtD,CAAC;YACN,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC;IACH,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,OAAO;QACpB,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC;YAAE,OAAO;QACtE,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;YAClE,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YACjC,KAAK,MAAM,EAAE,IAAI,QAAQ;gBAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC1C,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC1B,CAAC;gBAAS,CAAC;YACT,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.test.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/migrations/steps/0003-process-output-files/step.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync, } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { test } from "node:test";
|
|
6
|
+
import { openCoreStorage } from "@nervekit/conversation-core";
|
|
7
|
+
import { createStepContext } from "../../framework/context.js";
|
|
8
|
+
import { RollbackJournal } from "../../framework/rollback-journal.js";
|
|
9
|
+
import { storagePaths } from "../../../storage-bootstrap/paths.js";
|
|
10
|
+
import step from "./step.js";
|
|
11
|
+
const now = "2026-10-10T00:00:00.000Z";
|
|
12
|
+
function home() {
|
|
13
|
+
const root = mkdtempSync(join(tmpdir(), "nerve-0003-"));
|
|
14
|
+
const paths = storagePaths(root);
|
|
15
|
+
mkdirSync(paths.dataPath, { recursive: true });
|
|
16
|
+
const storage = openCoreStorage(paths.sqlitePath);
|
|
17
|
+
storage.projects.insert({
|
|
18
|
+
id: "proj_1",
|
|
19
|
+
name: "Test",
|
|
20
|
+
directory: root,
|
|
21
|
+
createdAt: now,
|
|
22
|
+
updatedAt: now,
|
|
23
|
+
});
|
|
24
|
+
storage.conversations.insert({
|
|
25
|
+
id: "conv_1",
|
|
26
|
+
projectId: "proj_1",
|
|
27
|
+
parentConversationId: null,
|
|
28
|
+
parentToolCallId: null,
|
|
29
|
+
headEventId: null,
|
|
30
|
+
title: "Test",
|
|
31
|
+
status: "idle",
|
|
32
|
+
statusEventSequence: 0,
|
|
33
|
+
statusClearedAt: null,
|
|
34
|
+
paused: false,
|
|
35
|
+
nextInputSequence: 1,
|
|
36
|
+
pinnedAt: null,
|
|
37
|
+
completedAt: null,
|
|
38
|
+
lastUserMessageAt: null,
|
|
39
|
+
createdAt: now,
|
|
40
|
+
updatedAt: now,
|
|
41
|
+
}, {
|
|
42
|
+
conversationId: "conv_1",
|
|
43
|
+
model: { provider: "test", modelId: "test" },
|
|
44
|
+
reasoningLevel: "off",
|
|
45
|
+
systemPrompt: null,
|
|
46
|
+
instructions: null,
|
|
47
|
+
permissionRuleSetId: "baseline",
|
|
48
|
+
agentProfile: "coding",
|
|
49
|
+
workingDirectory: root,
|
|
50
|
+
});
|
|
51
|
+
const run = (id, files) => {
|
|
52
|
+
storage.asyncBash.insert({
|
|
53
|
+
id,
|
|
54
|
+
conversationId: "conv_1",
|
|
55
|
+
toolCallId: `tool_${id}`,
|
|
56
|
+
command: "echo",
|
|
57
|
+
workingDirectory: root,
|
|
58
|
+
processRef: null,
|
|
59
|
+
status: "completed",
|
|
60
|
+
exitCode: 0,
|
|
61
|
+
startedAt: now,
|
|
62
|
+
finishedAt: now,
|
|
63
|
+
});
|
|
64
|
+
for (const [name, text] of Object.entries(files)) {
|
|
65
|
+
const logicalPath = `conversations/conv_1/async-bash/${id}/${name}`;
|
|
66
|
+
mkdirSync(join(paths.dataPath, `conversations/conv_1/async-bash/${id}`), {
|
|
67
|
+
recursive: true,
|
|
68
|
+
});
|
|
69
|
+
writeFileSync(join(paths.dataPath, logicalPath), text);
|
|
70
|
+
storage.assets.insert({
|
|
71
|
+
id: `asset_${id}_${name}`,
|
|
72
|
+
conversationId: "conv_1",
|
|
73
|
+
eventId: null,
|
|
74
|
+
toolCallId: `tool_${id}`,
|
|
75
|
+
asyncBashId: id,
|
|
76
|
+
category: "bash_output",
|
|
77
|
+
logicalPath,
|
|
78
|
+
digest: null,
|
|
79
|
+
byteLength: Buffer.byteLength(text),
|
|
80
|
+
mediaType: null,
|
|
81
|
+
createdAt: now,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
run("bash_combined", {
|
|
86
|
+
"stdout.txt": "out\n",
|
|
87
|
+
"stderr.txt": "err\n",
|
|
88
|
+
"combined.txt": "[stdout]\nout\n[stderr]\nerr\n",
|
|
89
|
+
});
|
|
90
|
+
run("bash_streams", { "stdout.txt": "out\n", "stderr.txt": "err\n" });
|
|
91
|
+
run("bash_current", { "output.txt": "already\n" });
|
|
92
|
+
storage.close();
|
|
93
|
+
const { context } = createStepContext(paths, step.id, step.description, () => { });
|
|
94
|
+
const outputs = () => {
|
|
95
|
+
const db = openCoreStorage(paths.sqlitePath);
|
|
96
|
+
try {
|
|
97
|
+
return db.assets
|
|
98
|
+
.list("conv_1")
|
|
99
|
+
.filter((asset) => asset.logicalPath.endsWith("/output.txt"))
|
|
100
|
+
.map((asset) => asset.logicalPath)
|
|
101
|
+
.sort();
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
db.close();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
return { root, paths, context, outputs };
|
|
108
|
+
}
|
|
109
|
+
void test("creates one output file per older background run and is idempotent", async (t) => {
|
|
110
|
+
const { root, paths, context, outputs } = home();
|
|
111
|
+
t.after(() => rmSync(root, { recursive: true, force: true }));
|
|
112
|
+
const owned = await step.ownedPaths(context);
|
|
113
|
+
assert.equal(owned.length, 2);
|
|
114
|
+
await step.run(context);
|
|
115
|
+
await step.verify(context);
|
|
116
|
+
const file = (id) => readFileSync(join(paths.dataPath, `conversations/conv_1/async-bash/${id}/output.txt`), "utf8");
|
|
117
|
+
// Ordered, labelled output is preferred; otherwise both streams in sequence.
|
|
118
|
+
assert.equal(file("bash_combined"), "[stdout]\nout\n[stderr]\nerr\n");
|
|
119
|
+
assert.equal(file("bash_streams"), "out\nerr\n");
|
|
120
|
+
assert.equal(file("bash_current"), "already\n");
|
|
121
|
+
assert.equal(outputs().length, 3);
|
|
122
|
+
// Original stream files stay: older transcripts quote their paths.
|
|
123
|
+
readFileSync(join(paths.dataPath, "conversations/conv_1/async-bash/bash_streams/stdout.txt"));
|
|
124
|
+
await step.run(context);
|
|
125
|
+
assert.equal(outputs().length, 3);
|
|
126
|
+
});
|
|
127
|
+
void test("rollback removes inserted rows and created files", async (t) => {
|
|
128
|
+
const { root, paths, context, outputs } = home();
|
|
129
|
+
t.after(() => rmSync(root, { recursive: true, force: true }));
|
|
130
|
+
await step.run(context);
|
|
131
|
+
await step.run(context); // a retried attempt keeps the first attempt's rollback record
|
|
132
|
+
await step.rollback(context);
|
|
133
|
+
new RollbackJournal(context.scratchDir).restore();
|
|
134
|
+
assert.deepEqual(outputs(), [
|
|
135
|
+
"conversations/conv_1/async-bash/bash_current/output.txt",
|
|
136
|
+
]);
|
|
137
|
+
assert.throws(() => readFileSync(join(paths.dataPath, "conversations/conv_1/async-bash/bash_streams/output.txt")));
|
|
138
|
+
});
|
|
139
|
+
//# sourceMappingURL=step.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.test.js","sourceRoot":"","sources":["../../../../../src/infrastructure/migrations/steps/0003-process-output-files/step.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACL,SAAS,EACT,WAAW,EACX,YAAY,EACZ,MAAM,EACN,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,GAAG,GAAG,0BAA0B,CAAC;AAEvC,SAAS,IAAI;IACX,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACjC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,MAAM,OAAO,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OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;IAClD,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE;QAC1B,yDAAyD;KAC1D,CAAC,CAAC;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CACjB,YAAY,CACV,IAAI,CACF,KAAK,CAAC,QAAQ,EACd,yDAAyD,CAC1D,CACF,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/migrations/steps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/migrations/steps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAW3D,eAAO,MAAM,kBAAkB,EAAE,SAAS,cAAc,EAOvD,CAAC"}
|
package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { MIGRATION_METADATA } from "../framework/registry-metadata.js";
|
|
2
2
|
import conversationCore from "./0001-conversation-core/step.js";
|
|
3
3
|
import agentProfiles from "./0002-agent-profiles/step.js";
|
|
4
|
+
import processOutputFiles from "./0003-process-output-files/step.js";
|
|
4
5
|
/** Append implementations in metadata order; the migration checker verifies both. */
|
|
5
|
-
const implementations = [conversationCore, agentProfiles];
|
|
6
|
+
const implementations = [conversationCore, agentProfiles, processOutputFiles];
|
|
6
7
|
if (implementations.length !== MIGRATION_METADATA.length)
|
|
7
8
|
throw new Error("Migration metadata and implementations must match.");
|
|
8
9
|
export const MIGRATION_REGISTRY = Object.freeze(MIGRATION_METADATA.map((metadata, index) => {
|
package/node_modules/@nervekit/workbench-server/dist/infrastructure/migrations/steps/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/infrastructure/migrations/steps/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,aAAa,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/infrastructure/migrations/steps/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,kBAAkB,MAAM,qCAAqC,CAAC;AAErE,qFAAqF;AACrF,MAAM,eAAe,GAAG,CAAC,gBAAgB,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAC9E,IAAI,eAAe,CAAC,MAAM,KAAK,kBAAkB,CAAC,MAAM;IACtD,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,kBAAkB,GAA8B,MAAM,CAAC,MAAM,CACxE,kBAAkB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;IACzC,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,KAAK,QAAQ,CAAC,IAAI,CAAC,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,sCAAsC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5E,OAAO,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC/B,CAAC,CAAC,CACH,CAAC"}
|
package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/output-capture.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ import type { ManagedProcess } from "@nervekit/native";
|
|
|
2
2
|
export declare const PROCESS_OUTPUT_LIMIT_BYTES: number;
|
|
3
3
|
export declare const PROCESS_DIAGNOSTIC_RESERVE_BYTES: number;
|
|
4
4
|
export declare function captureProcessOutput(process: Pick<ManagedProcess, "stdout" | "stderr">, outputFiles: {
|
|
5
|
-
stdout: string;
|
|
6
|
-
stderr: string;
|
|
7
5
|
combined: string;
|
|
8
6
|
}, onProgress?: (update: {
|
|
9
7
|
chunk: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-capture.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/process-host/output-capture.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,eAAO,MAAM,0BAA0B,QAAmB,CAAC;AAC3D,eAAO,MAAM,gCAAgC,QAAY,CAAC;AAE1D,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,QAAQ,CAAC,EAClD,WAAW,EAAE;IAAE,
|
|
1
|
+
{"version":3,"file":"output-capture.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/process-host/output-capture.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,eAAO,MAAM,0BAA0B,QAAmB,CAAC;AAC3D,eAAO,MAAM,gCAAgC,QAAY,CAAC;AAE1D,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,QAAQ,CAAC,EAClD,WAAW,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,EACjC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAAE,KAAK,IAAI,EAC7E,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,iBAoE/C"}
|
package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/output-capture.js
CHANGED
|
@@ -4,11 +4,8 @@ import { pipeline, finished } from "node:stream/promises";
|
|
|
4
4
|
export const PROCESS_OUTPUT_LIMIT_BYTES = 16 * 1024 * 1024;
|
|
5
5
|
export const PROCESS_DIAGNOSTIC_RESERVE_BYTES = 16 * 1024;
|
|
6
6
|
export function captureProcessOutput(process, outputFiles, onProgress, diagnostic) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
stderr: createWriteStream(outputFiles.stderr),
|
|
10
|
-
combined: createWriteStream(outputFiles.combined),
|
|
11
|
-
};
|
|
7
|
+
// One file keeps both streams in arrival order; nothing reads them separately.
|
|
8
|
+
const files = { combined: createWriteStream(outputFiles.combined) };
|
|
12
9
|
// Observe errors immediately, including files that have not received output yet.
|
|
13
10
|
const fileDrains = Promise.all(Object.values(files).map((file) => finished(file)));
|
|
14
11
|
void fileDrains.catch(() => undefined);
|
|
@@ -28,7 +25,6 @@ export function captureProcessOutput(process, outputFiles, onProgress, diagnosti
|
|
|
28
25
|
queue = queue.then(async () => {
|
|
29
26
|
if (!bounded.length)
|
|
30
27
|
return;
|
|
31
|
-
await write(files[stream], bounded);
|
|
32
28
|
await write(files.combined, bounded);
|
|
33
29
|
onProgress?.({ stream, chunk: bounded.toString() });
|
|
34
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-capture.js","sourceRoot":"","sources":["../../../src/infrastructure/process-host/output-capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAoB,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAG1D,MAAM,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mkdtemp(join(tmpdir(), "nerve-capture-"));
|
|
11
11
|
const stdout = new PassThrough();
|
|
12
12
|
const stderr = new PassThrough();
|
|
13
|
-
const files = {
|
|
14
|
-
stdout: join(dir, "stdout"),
|
|
15
|
-
stderr: join(dir, "stderr"),
|
|
16
|
-
combined: join(dir, "combined"),
|
|
17
|
-
};
|
|
13
|
+
const files = { combined: join(dir, "combined") };
|
|
18
14
|
const progress = [];
|
|
19
15
|
let close;
|
|
20
16
|
const closed = new Promise((resolve) => {
|
|
@@ -32,19 +28,16 @@ for (const capped of [false, true]) {
|
|
|
32
28
|
: "child error\n");
|
|
33
29
|
close();
|
|
34
30
|
await drained;
|
|
35
|
-
assert.equal(await readFile(files.stdout, "utf8"), "PROBE\n");
|
|
36
|
-
const error = await readFile(files.stderr, "utf8");
|
|
37
31
|
const combined = await readFile(files.combined, "utf8");
|
|
38
|
-
assert.ok(
|
|
32
|
+
assert.ok(combined.includes("PROBE\n"));
|
|
39
33
|
assert.ok(combined.endsWith(diagnostic));
|
|
40
|
-
assert.equal(
|
|
34
|
+
assert.equal(combined.split(diagnostic).length, 2);
|
|
41
35
|
assert.equal(progress.filter((update) => update.chunk === diagnostic && update.stream === "stderr").length, 1);
|
|
42
36
|
if (capped)
|
|
43
|
-
assert.match(
|
|
37
|
+
assert.match(combined, /Nerve: process output truncated/);
|
|
44
38
|
else
|
|
45
|
-
assert.
|
|
46
|
-
|
|
47
|
-
assert.ok((await stat(path)).size <= PROCESS_OUTPUT_LIMIT_BYTES);
|
|
39
|
+
assert.ok(combined.endsWith(`child error\n${diagnostic}`));
|
|
40
|
+
assert.ok((await stat(files.combined)).size <= PROCESS_OUTPUT_LIMIT_BYTES);
|
|
48
41
|
}
|
|
49
42
|
finally {
|
|
50
43
|
await rm(dir, { recursive: true, force: true });
|
|
@@ -55,17 +48,13 @@ void test("successful capped capture reports truncation without a failure diagno
|
|
|
55
48
|
const dir = await mkdtemp(join(tmpdir(), "nerve-capture-success-"));
|
|
56
49
|
const stdout = new PassThrough();
|
|
57
50
|
const stderr = new PassThrough();
|
|
58
|
-
const files = {
|
|
59
|
-
stdout: join(dir, "stdout"),
|
|
60
|
-
stderr: join(dir, "stderr"),
|
|
61
|
-
combined: join(dir, "combined"),
|
|
62
|
-
};
|
|
51
|
+
const files = { combined: join(dir, "combined") };
|
|
63
52
|
try {
|
|
64
53
|
const drained = captureProcessOutput({ stdout, stderr }, files);
|
|
65
54
|
stdout.end(Buffer.alloc(PROCESS_OUTPUT_LIMIT_BYTES + 1024, 120));
|
|
66
55
|
stderr.end();
|
|
67
56
|
await drained;
|
|
68
|
-
assert.match(await readFile(files.
|
|
57
|
+
assert.match(await readFile(files.combined, "utf8"), /Nerve: process output truncated/);
|
|
69
58
|
assert.ok((await stat(files.combined)).size <= PROCESS_OUTPUT_LIMIT_BYTES);
|
|
70
59
|
}
|
|
71
60
|
finally {
|
|
@@ -77,11 +66,7 @@ void test("capture rejects writer errors and settles pending writes", async () =
|
|
|
77
66
|
const stdout = new PassThrough();
|
|
78
67
|
const stderr = new PassThrough();
|
|
79
68
|
try {
|
|
80
|
-
const drained = captureProcessOutput({ stdout, stderr }, {
|
|
81
|
-
stdout: dir,
|
|
82
|
-
stderr: join(dir, "stderr"),
|
|
83
|
-
combined: join(dir, "combined"),
|
|
84
|
-
});
|
|
69
|
+
const drained = captureProcessOutput({ stdout, stderr }, { combined: dir });
|
|
85
70
|
stdout.end("pending stdout");
|
|
86
71
|
stderr.end("pending stderr");
|
|
87
72
|
await assert.rejects(drained, /EISDIR/);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-capture.test.js","sourceRoot":"","sources":["../../../src/infrastructure/process-host/output-capture.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,KAAK,MAAM,MAAM,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;IACnC,KAAK,IAAI,CAAC,8EAA8E,MAAM,GAAG,EAAE,KAAK,IAAI,EAAE;QAC5G,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QACjC,MAAM,KAAK,GAAG
|
|
1
|
+
{"version":3,"file":"output-capture.test.js","sourceRoot":"","sources":["../../../src/infrastructure/process-host/output-capture.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,KAAK,MAAM,MAAM,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;IACnC,KAAK,IAAI,CAAC,8EAA8E,MAAM,GAAG,EAAE,KAAK,IAAI,EAAE;QAC5G,MAAM,GAAG,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EAAE,CAAC,CAAC;IAClD,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/readiness.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readiness.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/process-host/readiness.ts"],"names":[],"mappings":"AAEA,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE;IACV,WAAW,EAAE;QAAE,
|
|
1
|
+
{"version":3,"file":"readiness.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/process-host/readiness.ts"],"names":[],"mappings":"AAEA,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE;IACV,WAAW,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB,EACD,KAAK,EAAE;IACL,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EACD;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GACxD;QAAE,IAAI,EAAE,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAChD;QAAE,IAAI,EAAE,cAAc,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAClD;;;;;;;;;GAoDF;AAED,UAAU,sBAAsB;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IACpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CASpB;IAEJ,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAM9B,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAQvC,IAAI,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,EAAE,sBAAsB;iBAYtB,OAAO;kBAAY,MAAM;;IAoBrE,OAAO,CAAC,KAAK;IAOb,OAAO,CAAC,UAAU;YAgBJ,OAAO;CAqBtB"}
|
package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/readiness.js
CHANGED
|
@@ -10,7 +10,7 @@ export async function waitForOutputReadiness(background, input) {
|
|
|
10
10
|
});
|
|
11
11
|
const deadline = Date.now() + Math.min(ready.timeoutMs ?? 60_000, 60_000);
|
|
12
12
|
while (Date.now() < deadline && !exited && !input.signal.aborted) {
|
|
13
|
-
const output = await readFile(background.outputFiles.combined
|
|
13
|
+
const output = await readFile(background.outputFiles.combined, "utf8").catch(() => "");
|
|
14
14
|
if (pattern?.test(output))
|
|
15
15
|
return { status: "ready" };
|
|
16
16
|
const url = ready.kind === "url"
|
package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/readiness.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readiness.js","sourceRoot":"","sources":["../../../src/infrastructure/process-host/readiness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,UAIC,EACD,KAMC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1B,MAAM,OAAO,GACX,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,IAAI,MAAM,GAAG,KAAK,CA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EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAED,KAAK,UAAU,iBAAiB,CAC9B,GAAW,EACX,MAAmB,EACnB,WAAW,GAAG,KAAK;IAEnB,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9C,IAAI,WAAW;QAAE,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;AACjD,CAAC"}
|
package/node_modules/@nervekit/workbench-server/dist/infrastructure/process-host/readiness.test.js
CHANGED
|
@@ -18,7 +18,7 @@ void test("readiness matches combined stderr and does not stop a process on read
|
|
|
18
18
|
let cancelled = false;
|
|
19
19
|
const process = {
|
|
20
20
|
ref: "process",
|
|
21
|
-
outputFiles: {
|
|
21
|
+
outputFiles: { combined },
|
|
22
22
|
wait: () => new Promise(() => { }),
|
|
23
23
|
cancel: async () => {
|
|
24
24
|
cancelled = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readiness.test.js","sourceRoot":"","sources":["../../../src/infrastructure/process-host/readiness.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,KAAK,IAAI,CAAC,oFAAoF,EAAE,KAAK,IAAI,EAAE;IACzG,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAC9D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACzC,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;YACrB,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC;YACjC,SAAS,CAAC,QAAQ,EAAE,cAAc,CAAC;SACpC,CAAC,CAAC;QACH,IAAI,SAAS,GAAG,KAAK,CAAC;QACtB,MAAM,OAAO,GAAG;YACd,GAAG,EAAE,SAAS;YACd,WAAW,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"readiness.test.js","sourceRoot":"","sources":["../../../src/infrastructure/process-host/readiness.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,KAAK,IAAI,CAAC,oFAAoF,EAAE,KAAK,IAAI,EAAE;IACzG,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAC9D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG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SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/node_modules/@nervekit/workbench-server/dist/web/assets/AsyncBashCenterHost-DEGEun34.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./button-f-69ecGY.js";import{F as t,L as n,M as r,Mt as i,R as a,Tt as o,Y as s,Z as c,ct as l,ft as u,g as d,gt as f,j as p,lt as m,mt as h,nt as g,r as _,st as v,tt as y,ut as b,wt as x,z as S}from"./index-client-DRghq6Rk.js";import{a as C}from"./workbench-startup-state.svelte-Dotzt3Gp.js";import{s as w}from"./conversation-connection-CYo0bR0A.js";import{t as T}from"./workspace-state.svelte-Bkgo6UyP.js";import{n as E}from"./arrow-down-C-Z0ZJR3.js";import{t as D}from"./floating-toolbar-CIWPX6ry.js";import{t as O}from"./LogStream-CDBCsCVK.js";import{A as k,D as A}from"./index-DfqYUGHJ.js";function j(e,t){if(!e)return;let n=Date.parse(e.startedAt),r=e.status===`running`?t:e.finishedAt?Date.parse(e.finishedAt):NaN;return!Number.isFinite(n)||!Number.isFinite(r)||r<n?`Unknown duration`:`${Math.floor((r-n)/1e3)}s`}var M=65536,N=262144;function P(e,t,n=!1){let r=N,i=t;if(e&&t.totalBytes>=e.nextOffset&&t.offset<=e.nextOffset&&t.nextOffset>=e.offset){let n=new TextEncoder,r=new TextDecoder;if(t.offset<e.offset){let a=r.decode(n.encode(t.text).slice(0,e.offset-t.offset));i={...t,text:a+e.text,nextOffset:e.nextOffset}}else{let a=r.decode(n.encode(t.text).slice(Math.max(0,e.nextOffset-t.offset)));i={...t,text:e.text+a,offset:e.offset,nextOffset:Math.max(e.nextOffset,t.nextOffset)}}}let a=new TextEncoder().encode(i.text);if(a.length<=r)return i;if(n){let e=r;for(;e>0&&(a[e]&192)==128;)e--;return{...i,text:new TextDecoder().decode(a.slice(0,e)),nextOffset:i.offset+e}}let o=a.length-r;for(;(a[o]&192)==128;)o++;return{...i,text:new TextDecoder().decode(a.slice(o)),offset:i.offset+o}}var F=class{conversationId;bashId;request;publish;interval;generation=0;active=!1;busy=!1;timer;pending;following=!0;page;bash;constructor(e,t,n,r,i=1e3,a){this.conversationId=e,this.bashId=t,this.request=n,this.publish=r,this.interval=i,this.bash=a}start(){this.active=!0,this.load(`tail`)}stop(){this.active=!1,this.generation++,this.busy=!1,this.pending=void 0,clearTimeout(this.timer)}async load(e=`tail`){if(!this.active)return;if(e===`tail`){let e=!this.following;this.following=!0,clearTimeout(this.timer),e&&this.publish(this)}else if(e===`earlier`)clearTimeout(this.timer);else if(!this.following)return;if(this.busy){e!==`append`&&(this.pending=e);return}clearTimeout(this.timer),this.busy=!0;let t=!1,n=this.generation,r=this.page,i=e===`tail`||!r?void 0:e===`earlier`?Math.max(0,r.offset-M):r.nextOffset;try{let a=await this.request({conversationId:this.conversationId,bashId:this.bashId,offset:i,limit:M});if(!this.active||n!==this.generation)return;this.bash=a.bash,this.page=e===`tail`?a.page:P(this.page,a.page,e===`earlier`),e===`earlier`&&I(r,this.page)&&(this.following=!1),t=e!==`append`||L(r,this.page),this.publish(this)}catch(e){this.active&&n===this.generation&&this.publish(this,e instanceof Error?e.message:String(e))}finally{if(this.active&&n===this.generation){if(this.busy=!1,this.pending){let e=this.pending;this.pending=void 0,this.load(e)}else if(this.following){let e=t&&this.page!==void 0&&this.page.nextOffset<this.page.totalBytes;(e||this.bash?.status===`running`)&&(this.timer=setTimeout(()=>void this.load(`append`),e?0:this.interval))}}}}};function I(e,t){return e!==void 0&&t.nextOffset<e.nextOffset}function L(e,t){return e===void 0||t.nextOffset>e.nextOffset}function R(e){let t=e.endsWith(`\r`)?e.slice(0,-1):e,n=t.lastIndexOf(`\r`);return n===-1?t:t.slice(n+1)}function z(e){if(!e)return[];let t=new TextEncoder,n=[],r=e.text.split(`
|
|
2
|
+
`),i=e.offset,a=0;e.offset>0&&r.length>1&&(i+=t.encode(r[0]).length+1,a=1);let o=r.length-1;for(let e=a;e<=o;e++){let a=r[e];if(e===o&&a===``)break;n.push({key:`${i}`,text:R(a)}),i+=t.encode(a).length+1}return n}var B=S(`<span> </span>`),V=S(`<span class="flex h-6 items-center gap-1.5 px-1.5 text-ui text-muted-foreground tabular-nums"><!> <!> <!></span> <!>`,1),H=S(`<section class="relative h-full min-h-0 bg-background" aria-label="Background command output"><!></section>`);function U(a,c){o(c,!0);let u=_(c,`detached`,3,!1),p=_(c,`stopping`,3,!1),h=f(()=>z(c.page));var g=H(),b=v(g);{let a=a=>{D(a,{label:`Command controls`,children:(a,o)=>{var s=V(),u=l(s),f=v(u),h=e=>{A(e,{get status(){return c.bash.status}})};r(f,e=>{c.bash&&e(h)});var g=m(f,2),_=e=>{var r=B(),a=v(r,!0);i(r),y(()=>t(a,c.elapsed)),n(e,r)};r(g,e=>{c.elapsed&&e(_)});var b=m(g,2),x=e=>{var r=B(),a=v(r);i(r),y(()=>t(a,`exit ${c.bash.exitCode??``}`)),n(e,r)};r(b,e=>{c.bash?.exitCode!=null&&e(x)}),i(u);var S=m(u,2),C=t=>{e(t,{variant:`ghost`,size:`icon-sm`,ariaLabel:`Stop command`,title:`Stop`,get disabled(){return p()},get onclick(){return c.onStop},children:(e,t)=>{E(e,{"aria-hidden":`true`})},$$slots:{default:!0}})};r(S,e=>{c.bash?.status===`running`&&e(C)}),y(()=>d(u,`title`,c.bash?.workingDirectory)),n(a,s)},$$slots:{default:!0}})},o=f(()=>`async-bash:${c.bashId}`),g=f(()=>c.bash?`No output yet.`:`Loading output…`),_=f(()=>c.bash?.command??c.command),x=f(()=>(c.page?.offset??0)>0);O(b,{get scopeKey(){return s(o)},ariaLabel:`Command output`,get emptyLabel(){return s(g)},get lines(){return s(h)},get command(){return s(_)},get hasMoreBefore(){return s(x)},get detached(){return u()},get loadError(){return c.error},get onLoadEarlier(){return c.onLoadEarlier},get onJumpToLatest(){return c.onJumpToLatest},dock:a,$$slots:{dock:!0}})}i(g),n(a,g),x()}function W(e,t){o(t,!0);let i=f(()=>T.activeCenterTab?.kind===`async-bash`?T.activeCenterTab:void 0),d=h(void 0),m=h(void 0),_=h(void 0),v=h(void 0),y=h(!1),S=h(!1),E=h(b(Date.now())),D=f(()=>j(s(d),s(E))),O=0;g(()=>{let e=s(i),t=C.progressiveActive,n=c(()=>e?k.commands[e.id]:void 0);if(u(d,n,!0),u(m,void 0),u(_,void 0),u(y,!1),u(S,!1),!e||!t)return;O=c(()=>k.refreshVersions[e.id]??0);let r=new F(e.conversationId,e.id,e=>w(`asyncBash.logs`,e),(t,n)=>{u(d,t.bash??s(d),!0),u(m,t.page,!0),u(_,n,!0),u(S,!t.following),u(E,Date.now(),!0),t.bash&&(k.commands[e.id]=t.bash)},1e3,n);return u(v,r,!0),r.start(),()=>{r.stop(),u(v,void 0)}}),g(()=>{let e=s(i),t=s(v);if(!e||!C.progressiveActive||!t)return;let n=k.refreshVersions[e.id]??0;n!==O&&(O=n,c(()=>void t.load(`tail`)))});async function A(){let e=s(i),t=s(v);if(e&&t&&!s(y)){u(y,!0);try{await w(`asyncBash.cancel`,{bashId:e.id}),s(v)===t&&await t.load(`append`)}catch(e){s(v)===t&&u(_,e instanceof Error?e.message:String(e),!0)}finally{s(v)===t&&u(y,!1)}}}var M=a(),N=l(M),P=e=>{var t=a(),r=l(t);p(r,()=>s(i).id,e=>{U(e,{get bashId(){return s(i).id},get bash(){return s(d)},get command(){return s(i).command},get page(){return s(m)},get error(){return s(_)},get elapsed(){return s(D)},get detached(){return s(S)},get stopping(){return s(y)},onLoadEarlier:()=>s(v)?.load(`earlier`)??Promise.resolve(),onJumpToLatest:()=>s(v)?.load(`tail`)??Promise.resolve(),onStop:()=>void A()})}),n(e,t)};r(N,e=>{s(i)&&e(P)}),n(e,M),x()}export{W as default};
|