@code-yeongyu/senpi 2026.9.26 → 2026.9.27-3
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/CHANGELOG.md +66 -0
- package/dist/bun-runtime.d.ts +18 -2
- package/dist/bun-runtime.d.ts.map +1 -1
- package/dist/bun-runtime.js +60 -8
- package/dist/bun-runtime.js.map +1 -1
- package/dist/bundle/chunks/anthropic-messages-3FGAXYJS.js +8 -0
- package/dist/bundle/chunks/{app-server-command-ZRCKWY2X.js → app-server-command-ZVB35UIJ.js} +1 -1
- package/dist/bundle/chunks/azure-openai-responses-4SUOOZZ4.js +2 -0
- package/dist/bundle/chunks/bun-extension-importer-R4HXF3GD.js +14 -0
- package/dist/bundle/chunks/{chunk-KMJXSXRX.js → chunk-357I4IUU.js} +2 -2
- package/dist/bundle/chunks/chunk-3SIQIY57.js +8 -0
- package/dist/bundle/chunks/chunk-45SZOLCU.js +2 -0
- package/dist/bundle/chunks/{chunk-77ACEMYL.js → chunk-6J6RDMBY.js} +1 -1
- package/dist/bundle/chunks/{chunk-BSOJHK4W.js → chunk-7FXXRPB3.js} +2 -1
- package/dist/bundle/chunks/{chunk-FD34HSJJ.js → chunk-C6LQNMRB.js} +1 -1
- package/dist/bundle/chunks/chunk-ELM77A26.js +2 -0
- package/dist/bundle/chunks/chunk-GZVCRV7I.js +3 -0
- package/dist/bundle/chunks/{chunk-TTY5BHCG.js → chunk-H2SGCPMD.js} +1 -1
- package/dist/bundle/chunks/chunk-KLBKUBDV.js +2 -0
- package/dist/bundle/chunks/chunk-L6QV7NZI.js +2 -0
- package/dist/bundle/chunks/{chunk-ZKZAATFM.js → chunk-LDB5UMH2.js} +2 -2
- package/dist/bundle/chunks/{chunk-HZAKOVHN.js → chunk-LGKKU4VM.js} +1 -1
- package/dist/bundle/chunks/{chunk-6Q6DGME2.js → chunk-NMDALHXH.js} +1 -1
- package/dist/bundle/chunks/chunk-NNILBBOH.js +18 -0
- package/dist/bundle/chunks/{chunk-SUQDU5KM.js → chunk-OQRUK2DK.js} +1 -1
- package/dist/bundle/chunks/{chunk-OZCB6BP3.js → chunk-OZN2KUPR.js} +7 -7
- package/dist/bundle/chunks/{chunk-X3T45623.js → chunk-QK4QKRTF.js} +1 -1
- package/dist/bundle/chunks/{chunk-WM5FVFAP.js → chunk-QPZVJQC5.js} +1 -1
- package/dist/bundle/chunks/{chunk-Y54V65MS.js → chunk-QYAO24GB.js} +1 -1
- package/dist/bundle/chunks/{chunk-MKAM7IRH.js → chunk-RULGEHQM.js} +1 -1
- package/dist/bundle/chunks/{chunk-QGC46CGK.js → chunk-RYI6XR6Z.js} +63 -58
- package/dist/bundle/chunks/chunk-U3VOXCGP.js +2 -0
- package/dist/bundle/chunks/chunk-W3D3ZYDS.js +2 -0
- package/dist/bundle/chunks/{chunk-UBPMXBOJ.js → chunk-XKLR7C5B.js} +1 -1
- package/dist/bundle/chunks/{chunk-CLZVNQW3.js → chunk-Y7EIVDHZ.js} +1 -1
- package/dist/bundle/chunks/chunk-ZIVYE5YK.js +2 -0
- package/dist/bundle/chunks/cli-main-RONHLFWZ.js +3 -0
- package/dist/bundle/chunks/google-generative-ai-ZTGKZTGU.js +2 -0
- package/dist/bundle/chunks/google-vertex-CCZ376YK.js +2 -0
- package/dist/bundle/chunks/help-fast-path-5LRG6FCG.js +2 -0
- package/dist/bundle/chunks/host-command-JVPGQR74.js +2 -0
- package/dist/bundle/chunks/host-lifecycle-R4HLXLBM.js +3 -0
- package/dist/bundle/chunks/host-lifecycle.js +4 -4
- package/dist/bundle/chunks/interactive-host-runtime-FES2G62G.js +4 -0
- package/dist/bundle/chunks/interactive-mode-45EP2FVL.js +2 -0
- package/dist/bundle/chunks/{list-tips-EBRNBPBM.js → list-tips-XXMRDHN6.js} +1 -1
- package/dist/bundle/chunks/{multi-session-host-7YX2I7UK.js → multi-session-host-EFCMD5OT.js} +6 -6
- package/dist/bundle/chunks/{openai-completions-4CLXDDHJ.js → openai-completions-OP6VFNUR.js} +1 -1
- package/dist/bundle/chunks/openai-images-6U5FCN5S.js +2 -0
- package/dist/bundle/chunks/openai-responses-7PWMBGYX.js +2 -0
- package/dist/bundle/chunks/openrouter-images-QIKWQZUD.js +2 -0
- package/dist/bundle/chunks/{package-manager-cli-3ISYTEL2.js → package-manager-cli-5XJS3TYM.js} +1 -1
- package/dist/bundle/chunks/rotation-stream-KW7PTEC4.js +2 -0
- package/dist/bundle/chunks/rpc-mode-ZHYECU24.js +2 -0
- package/dist/bundle/chunks/session-picker-QHIYVQP4.js +2 -0
- package/dist/bundle/chunks/session-worker.js +281 -270
- package/dist/bundle/chunks/{state-store-Q5EWEAFG.js → state-store-D4GGGT3J.js} +1 -1
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +4 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/continue-moved.d.ts +15 -0
- package/dist/cli/continue-moved.d.ts.map +1 -0
- package/dist/cli/continue-moved.js +26 -0
- package/dist/cli/continue-moved.js.map +1 -0
- package/dist/cli/cross-project-session.d.ts +22 -0
- package/dist/cli/cross-project-session.d.ts.map +1 -0
- package/dist/cli/cross-project-session.js +38 -0
- package/dist/cli/cross-project-session.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +3 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +43 -10
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +19 -5
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/builtin/anthropic-subscription/session-registry-pump.d.ts.map +1 -1
- package/dist/core/extensions/builtin/anthropic-subscription/session-registry-pump.js +5 -1
- package/dist/core/extensions/builtin/anthropic-subscription/session-registry-pump.js.map +1 -1
- package/dist/core/extensions/builtin/anthropic-subscription/session-turn-claim.d.ts +13 -1
- package/dist/core/extensions/builtin/anthropic-subscription/session-turn-claim.d.ts.map +1 -1
- package/dist/core/extensions/builtin/anthropic-subscription/session-turn-claim.js +25 -2
- package/dist/core/extensions/builtin/anthropic-subscription/session-turn-claim.js.map +1 -1
- package/dist/core/extensions/builtin/anthropic-subscription/session-turn-types.d.ts +1 -0
- package/dist/core/extensions/builtin/anthropic-subscription/session-turn-types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/anthropic-subscription/session-turn-types.js.map +1 -1
- package/dist/core/extensions/builtin/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/index.js +2 -0
- package/dist/core/extensions/builtin/index.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/catalog.d.ts +3 -0
- package/dist/core/extensions/builtin/mcp/catalog.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/catalog.js +9 -0
- package/dist/core/extensions/builtin/mcp/catalog.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/connection-types.d.ts +2 -0
- package/dist/core/extensions/builtin/mcp/connection-types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/connection-types.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/connection.d.ts +1 -1
- package/dist/core/extensions/builtin/mcp/connection.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/connection.js +3 -2
- package/dist/core/extensions/builtin/mcp/connection.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/session.d.ts +3 -0
- package/dist/core/extensions/builtin/mcp/expose/session.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/session.js +9 -2
- package/dist/core/extensions/builtin/mcp/expose/session.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-register.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-register.js +7 -1
- package/dist/core/extensions/builtin/mcp/service-register.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-tools-changed.d.ts +18 -0
- package/dist/core/extensions/builtin/mcp/service-tools-changed.d.ts.map +1 -0
- package/dist/core/extensions/builtin/mcp/service-tools-changed.js +61 -0
- package/dist/core/extensions/builtin/mcp/service-tools-changed.js.map +1 -0
- package/dist/core/extensions/builtin/mcp/service-types.d.ts +13 -0
- package/dist/core/extensions/builtin/mcp/service-types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-types.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/service.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/service.js +4 -37
- package/dist/core/extensions/builtin/mcp/service.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/shared-lease.js +1 -1
- package/dist/core/extensions/builtin/mcp/shared-lease.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/startup-race.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/startup-race.js +11 -1
- package/dist/core/extensions/builtin/mcp/startup-race.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/index.js +5 -2
- package/dist/core/extensions/builtin/permission-system/index.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/parsers.d.ts +5 -0
- package/dist/core/extensions/builtin/permission-system/parsers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/parsers.js +13 -0
- package/dist/core/extensions/builtin/permission-system/parsers.js.map +1 -1
- package/dist/core/extensions/builtin/repository-identity.d.ts +6 -0
- package/dist/core/extensions/builtin/repository-identity.d.ts.map +1 -0
- package/dist/core/extensions/builtin/repository-identity.js +33 -0
- package/dist/core/extensions/builtin/repository-identity.js.map +1 -0
- package/dist/core/extensions/bun-extension-importer.d.ts.map +1 -1
- package/dist/core/extensions/bun-extension-importer.js +10 -4
- package/dist/core/extensions/bun-extension-importer.js.map +1 -1
- package/dist/core/extensions/bun-extension-registry.js +6 -5
- package/dist/core/extensions/bun-extension-registry.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/kernel-prelude.d.ts +13 -0
- package/dist/core/extensions/kernel-prelude.d.ts.map +1 -0
- package/dist/core/extensions/kernel-prelude.js +38 -0
- package/dist/core/extensions/kernel-prelude.js.map +1 -0
- package/dist/core/extensions/types.d.ts +44 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +4 -2
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/moved-sessions.d.ts +10 -0
- package/dist/core/moved-sessions.d.ts.map +1 -0
- package/dist/core/moved-sessions.js +84 -0
- package/dist/core/moved-sessions.js.map +1 -0
- package/dist/core/process-crash-record.d.ts +62 -0
- package/dist/core/process-crash-record.d.ts.map +1 -0
- package/dist/core/process-crash-record.js +216 -0
- package/dist/core/process-crash-record.js.map +1 -0
- package/dist/core/provider-rejected-images.d.ts +18 -0
- package/dist/core/provider-rejected-images.d.ts.map +1 -0
- package/dist/core/provider-rejected-images.js +107 -0
- package/dist/core/provider-rejected-images.js.map +1 -0
- package/dist/core/repository-identity.d.ts +18 -0
- package/dist/core/repository-identity.d.ts.map +1 -0
- package/dist/core/repository-identity.js +75 -0
- package/dist/core/repository-identity.js.map +1 -0
- package/dist/core/resume-target.d.ts +20 -0
- package/dist/core/resume-target.d.ts.map +1 -0
- package/dist/core/resume-target.js +30 -0
- package/dist/core/resume-target.js.map +1 -0
- package/dist/core/session-discovery.d.ts.map +1 -1
- package/dist/core/session-discovery.js +1 -0
- package/dist/core/session-discovery.js.map +1 -1
- package/dist/core/session-hold-errors.d.ts +20 -0
- package/dist/core/session-hold-errors.d.ts.map +1 -0
- package/dist/core/session-hold-errors.js +28 -0
- package/dist/core/session-hold-errors.js.map +1 -0
- package/dist/core/session-holders.d.ts +22 -0
- package/dist/core/session-holders.d.ts.map +1 -0
- package/dist/core/session-holders.js +234 -0
- package/dist/core/session-holders.js.map +1 -0
- package/dist/core/session-manager.d.ts +5 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-rebind.d.ts +23 -0
- package/dist/core/session-rebind.d.ts.map +1 -0
- package/dist/core/session-rebind.js +127 -0
- package/dist/core/session-rebind.js.map +1 -0
- package/dist/core/session-summary-index-file.d.ts.map +1 -1
- package/dist/core/session-summary-index-file.js +5 -2
- package/dist/core/session-summary-index-file.js.map +1 -1
- package/dist/core/session-summary.d.ts +3 -0
- package/dist/core/session-summary.d.ts.map +1 -1
- package/dist/core/session-summary.js +7 -0
- package/dist/core/session-summary.js.map +1 -1
- package/dist/core/session-title-generator.d.ts.map +1 -1
- package/dist/core/session-title-generator.js +21 -3
- package/dist/core/session-title-generator.js.map +1 -1
- package/dist/core/session-title-reasoning.d.ts +14 -0
- package/dist/core/session-title-reasoning.d.ts.map +1 -0
- package/dist/core/session-title-reasoning.js +31 -0
- package/dist/core/session-title-reasoning.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -1
- package/dist/core/tools/path-utils.js +13 -0
- package/dist/core/tools/path-utils.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy-dir-copy.d.ts +9 -0
- package/dist/legacy-dir-copy.d.ts.map +1 -0
- package/dist/legacy-dir-copy.js +69 -0
- package/dist/legacy-dir-copy.js.map +1 -0
- package/dist/legacy-senpi-dir-migration.d.ts.map +1 -1
- package/dist/legacy-senpi-dir-migration.js +64 -48
- package/dist/legacy-senpi-dir-migration.js.map +1 -1
- package/dist/main.d.ts +6 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +129 -22
- package/dist/main.js.map +1 -1
- package/dist/migrations-state.d.ts +1 -1
- package/dist/migrations-state.d.ts.map +1 -1
- package/dist/migrations-state.js +5 -1
- package/dist/migrations-state.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +4 -0
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +5 -3
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +10 -4
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/resume-rebind.d.ts +12 -0
- package/dist/modes/interactive/resume-rebind.d.ts.map +1 -0
- package/dist/modes/interactive/resume-rebind.js +37 -0
- package/dist/modes/interactive/resume-rebind.js.map +1 -0
- package/dist/modes/interactive/runtime-notice-presenter.d.ts +8 -0
- package/dist/modes/interactive/runtime-notice-presenter.d.ts.map +1 -0
- package/dist/modes/interactive/runtime-notice-presenter.js +69 -0
- package/dist/modes/interactive/runtime-notice-presenter.js.map +1 -0
- package/dist/modes/interactive/runtime-notice.d.ts +50 -0
- package/dist/modes/interactive/runtime-notice.d.ts.map +1 -0
- package/dist/modes/interactive/runtime-notice.js +104 -0
- package/dist/modes/interactive/runtime-notice.js.map +1 -0
- package/dist/modes/interactive/tips/catalog/computer-tips.d.ts +7 -0
- package/dist/modes/interactive/tips/catalog/computer-tips.d.ts.map +1 -0
- package/dist/modes/interactive/tips/catalog/computer-tips.js +36 -0
- package/dist/modes/interactive/tips/catalog/computer-tips.js.map +1 -0
- package/dist/modes/interactive/tips/registry.d.ts.map +1 -1
- package/dist/modes/interactive/tips/registry.js +2 -0
- package/dist/modes/interactive/tips/registry.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +3 -0
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/host-child-exit.d.ts.map +1 -1
- package/dist/modes/rpc/host-child-exit.js +4 -0
- package/dist/modes/rpc/host-child-exit.js.map +1 -1
- package/dist/modes/rpc/host-crash-record.d.ts +8 -0
- package/dist/modes/rpc/host-crash-record.d.ts.map +1 -1
- package/dist/modes/rpc/host-crash-record.js.map +1 -1
- package/dist/modes/rpc/host-crash-record.test.js +11 -0
- package/dist/modes/rpc/host-crash-record.test.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +2 -2
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +14 -6
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-request-deadline.d.ts +17 -0
- package/dist/modes/rpc/rpc-request-deadline.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-request-deadline.js +27 -0
- package/dist/modes/rpc/rpc-request-deadline.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +9 -2
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/session-command-router.d.ts +3 -6
- package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
- package/dist/modes/rpc/session-command-router.js +9 -22
- package/dist/modes/rpc/session-command-router.js.map +1 -1
- package/dist/modes/rpc/session-path-key.d.ts +10 -0
- package/dist/modes/rpc/session-path-key.d.ts.map +1 -0
- package/dist/modes/rpc/session-path-key.js +33 -0
- package/dist/modes/rpc/session-path-key.js.map +1 -0
- package/dist/modes/rpc/session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/session-registry.js +6 -10
- package/dist/modes/rpc/session-registry.js.map +1 -1
- package/dist/modes/rpc/session-sweep.d.ts +18 -0
- package/dist/modes/rpc/session-sweep.d.ts.map +1 -0
- package/dist/modes/rpc/session-sweep.js +32 -0
- package/dist/modes/rpc/session-sweep.js.map +1 -0
- package/dist/pi-dir-restore.d.ts +4 -0
- package/dist/pi-dir-restore.d.ts.map +1 -0
- package/dist/pi-dir-restore.js +92 -0
- package/dist/pi-dir-restore.js.map +1 -0
- package/docs/environment-variables.md +2 -0
- package/docs/extensions.md +27 -1
- package/docs/quickstart.md +7 -1
- package/docs/rpc.md +8 -3
- package/docs/sdk.md +29 -0
- package/docs/sessions.md +13 -0
- package/docs/usage.md +1 -0
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +38 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +7 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridge/protocol.ts +9 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/bridges/schema-bridge.ts +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/kernel-preludes.ts +30 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +15 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/context-manager.ts +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/local-module-loader.ts +16 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/kernel.ts +6 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/prelude.py +15 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/transport.ts +7 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/shared/kernel-prelude-plan.ts +19 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt-template.ts +2 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +4 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +11 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +1 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/run-eval-cell.ts +1 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +3 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +2 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +7 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.js +3 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +3 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +10 -7
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +9 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/provider-diagnostic.d.ts +33 -0
- package/node_modules/@earendil-works/pi-ai/dist/provider-diagnostic.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/provider-diagnostic.js +56 -0
- package/node_modules/@earendil-works/pi-ai/dist/provider-diagnostic.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-carrier.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-carrier.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-carrier.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-carrier.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-sources.d.ts +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-sources.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-sources.js +103 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-sources.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-vocabulary.d.ts +36 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-vocabulary.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-vocabulary.js +129 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-diagnostic-vocabulary.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +5 -4
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-pty/native/prebuilds/darwin-arm64/senpi_pty.darwin-arm64.node +0 -0
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
- package/dist/bundle/chunks/anthropic-messages-UYDVRFAS.js +0 -8
- package/dist/bundle/chunks/azure-openai-responses-DODWR4W6.js +0 -2
- package/dist/bundle/chunks/bun-extension-importer-H4IJCWWQ.js +0 -14
- package/dist/bundle/chunks/chunk-34HMVB33.js +0 -2
- package/dist/bundle/chunks/chunk-3WBSBDBX.js +0 -13
- package/dist/bundle/chunks/chunk-L6JO4M6J.js +0 -3
- package/dist/bundle/chunks/chunk-SFYHCFRO.js +0 -2
- package/dist/bundle/chunks/chunk-T3JBT2IK.js +0 -8
- package/dist/bundle/chunks/chunk-TTHMOL5G.js +0 -2
- package/dist/bundle/chunks/chunk-UYCGOK6M.js +0 -2
- package/dist/bundle/chunks/chunk-ZTVQY5V6.js +0 -2
- package/dist/bundle/chunks/cli-main-H6JAXAXV.js +0 -3
- package/dist/bundle/chunks/google-generative-ai-VIEFECKJ.js +0 -2
- package/dist/bundle/chunks/google-vertex-Q64CKFID.js +0 -2
- package/dist/bundle/chunks/help-fast-path-ZGKPSDFO.js +0 -2
- package/dist/bundle/chunks/host-command-BMHJ4YUD.js +0 -2
- package/dist/bundle/chunks/host-lifecycle-2GZAGSGW.js +0 -3
- package/dist/bundle/chunks/interactive-host-runtime-YI75GFD5.js +0 -4
- package/dist/bundle/chunks/interactive-mode-HM7UQYRC.js +0 -2
- package/dist/bundle/chunks/openai-images-JA5N5DUU.js +0 -2
- package/dist/bundle/chunks/openai-responses-IBFGBAJP.js +0 -2
- package/dist/bundle/chunks/openrouter-images-MW5TXV7L.js +0 -2
- package/dist/bundle/chunks/rotation-stream-NATO6IMN.js +0 -2
- package/dist/bundle/chunks/rpc-mode-6PY4TN5F.js +0 -2
- package/dist/bundle/chunks/session-picker-BP7THCWF.js +0 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type RepositoryIdentity } from "./repository-identity.ts";
|
|
2
|
+
export interface ResumeTargetChoice {
|
|
3
|
+
readonly sessionPath: string;
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly sessionDir?: string;
|
|
6
|
+
readonly confirm: (sessionCwd: string) => Promise<boolean>;
|
|
7
|
+
readonly readIdentity?: (dir: string) => Promise<RepositoryIdentity | undefined>;
|
|
8
|
+
}
|
|
9
|
+
export interface ResumeTarget {
|
|
10
|
+
readonly path: string;
|
|
11
|
+
readonly rebound: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Where a session picked for resuming should be opened from. A session of the current repository
|
|
15
|
+
* recorded at another path is offered the in-place rebind; declining, another repository, or the
|
|
16
|
+
* current directory's own session open the picked file unchanged. Rebind failures propagate
|
|
17
|
+
* (`SessionHeldError` names the process still holding the session).
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveResumeTarget(choice: ResumeTargetChoice): Promise<ResumeTarget>;
|
|
20
|
+
//# sourceMappingURL=resume-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resume-target.d.ts","sourceRoot":"","sources":["../../src/core/resume-target.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAA0B,MAAM,0BAA0B,CAAC;AAG3F,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3D,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;CACjF;AAED,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC1B;AAWD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAY3F"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { resolvePath } from "../utils/paths.js";
|
|
2
|
+
import { readRepositoryIdentity } from "./repository-identity.js";
|
|
3
|
+
import { classifySessionRepository, readSessionCwd, rebindSessionFile } from "./session-rebind.js";
|
|
4
|
+
function sessionCwdOf(sessionPath) {
|
|
5
|
+
try {
|
|
6
|
+
return readSessionCwd(sessionPath);
|
|
7
|
+
}
|
|
8
|
+
catch (error) {
|
|
9
|
+
if (error instanceof Error)
|
|
10
|
+
return undefined;
|
|
11
|
+
throw error;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Where a session picked for resuming should be opened from. A session of the current repository
|
|
16
|
+
* recorded at another path is offered the in-place rebind; declining, another repository, or the
|
|
17
|
+
* current directory's own session open the picked file unchanged. Rebind failures propagate
|
|
18
|
+
* (`SessionHeldError` names the process still holding the session).
|
|
19
|
+
*/
|
|
20
|
+
export async function resolveResumeTarget(choice) {
|
|
21
|
+
const unchanged = { path: choice.sessionPath, rebound: false };
|
|
22
|
+
const sessionCwd = sessionCwdOf(choice.sessionPath);
|
|
23
|
+
if (sessionCwd === undefined || resolvePath(sessionCwd) === resolvePath(choice.cwd))
|
|
24
|
+
return unchanged;
|
|
25
|
+
const match = await classifySessionRepository(choice.sessionPath, sessionCwd, choice.cwd, choice.readIdentity ?? readRepositoryIdentity);
|
|
26
|
+
if (match !== "same" || !(await choice.confirm(sessionCwd)))
|
|
27
|
+
return unchanged;
|
|
28
|
+
return { path: await rebindSessionFile(choice.sessionPath, choice.cwd, choice.sessionDir), rebound: true };
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=resume-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resume-target.js","sourceRoot":"","sources":["../../src/core/resume-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAA2B,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAenG,SAAS,YAAY,CAAC,WAAmB;IACxC,IAAI,CAAC;QACJ,OAAO,cAAc,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,KAAK;YAAE,OAAO,SAAS,CAAC;QAC7C,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,MAA0B;IACnE,MAAM,SAAS,GAAiB,EAAE,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC7E,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACpD,IAAI,UAAU,KAAK,SAAS,IAAI,WAAW,CAAC,UAAU,CAAC,KAAK,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IACtG,MAAM,KAAK,GAAG,MAAM,yBAAyB,CAC5C,MAAM,CAAC,WAAW,EAClB,UAAU,EACV,MAAM,CAAC,GAAG,EACV,MAAM,CAAC,YAAY,IAAI,sBAAsB,CAC7C,CAAC;IACF,IAAI,KAAK,KAAK,MAAM,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC5G,CAAC","sourcesContent":["import { resolvePath } from \"../utils/paths.ts\";\nimport { type RepositoryIdentity, readRepositoryIdentity } from \"./repository-identity.ts\";\nimport { classifySessionRepository, readSessionCwd, rebindSessionFile } from \"./session-rebind.ts\";\n\nexport interface ResumeTargetChoice {\n\treadonly sessionPath: string;\n\treadonly cwd: string;\n\treadonly sessionDir?: string;\n\treadonly confirm: (sessionCwd: string) => Promise<boolean>;\n\treadonly readIdentity?: (dir: string) => Promise<RepositoryIdentity | undefined>;\n}\n\nexport interface ResumeTarget {\n\treadonly path: string;\n\treadonly rebound: boolean;\n}\n\nfunction sessionCwdOf(sessionPath: string): string | undefined {\n\ttry {\n\t\treturn readSessionCwd(sessionPath);\n\t} catch (error) {\n\t\tif (error instanceof Error) return undefined;\n\t\tthrow error;\n\t}\n}\n\n/**\n * Where a session picked for resuming should be opened from. A session of the current repository\n * recorded at another path is offered the in-place rebind; declining, another repository, or the\n * current directory's own session open the picked file unchanged. Rebind failures propagate\n * (`SessionHeldError` names the process still holding the session).\n */\nexport async function resolveResumeTarget(choice: ResumeTargetChoice): Promise<ResumeTarget> {\n\tconst unchanged: ResumeTarget = { path: choice.sessionPath, rebound: false };\n\tconst sessionCwd = sessionCwdOf(choice.sessionPath);\n\tif (sessionCwd === undefined || resolvePath(sessionCwd) === resolvePath(choice.cwd)) return unchanged;\n\tconst match = await classifySessionRepository(\n\t\tchoice.sessionPath,\n\t\tsessionCwd,\n\t\tchoice.cwd,\n\t\tchoice.readIdentity ?? readRepositoryIdentity,\n\t);\n\tif (match !== \"same\" || !(await choice.confirm(sessionCwd))) return unchanged;\n\treturn { path: await rebindSessionFile(choice.sessionPath, choice.cwd, choice.sessionDir), rebound: true };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-discovery.d.ts","sourceRoot":"","sources":["../../src/core/session-discovery.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAA4B,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGhG,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAU1E;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"session-discovery.d.ts","sourceRoot":"","sources":["../../src/core/session-discovery.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAA4B,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGhG,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAU1E;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAoBjH;AA2CD,yFAAyF;AACzF,wBAAsB,gBAAgB,CACrC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,QAAQ,EAAE,MAAM,IAAI,EACpB,KAAK,CAAC,EAAE,mBAAmB,GACzB,OAAO,CAAC,WAAW,EAAE,CAAC,CAOxB;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAC1C,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,QAAQ,EAAE,MAAM,IAAI,GAClB,OAAO,CAAC,WAAW,EAAE,CAAC,CAKxB;AAED,0EAA0E;AAC1E,wBAAsB,mBAAmB,CACxC,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,mBAAmB,EAChC,cAAc,SAAI,EAClB,aAAa,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,WAAW,EAAE,CAAC,CAgBxB"}
|
|
@@ -35,6 +35,7 @@ export async function buildSessionInfo(filePath, store) {
|
|
|
35
35
|
messageCount: summary.messageCount,
|
|
36
36
|
firstMessage: summary.firstUserMessage || "(no messages)",
|
|
37
37
|
allMessagesText: summary.allMessagesText,
|
|
38
|
+
...(summary.repositoryIdentity ? { repositoryIdentity: summary.repositoryIdentity } : {}),
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
async function buildSessionInfosWithConcurrency(files, onLoaded, store) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-discovery.js","sourceRoot":"","sources":["../../src/core/session-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,wBAAwB,EAA4B,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAIjE,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAE7C,SAAS,eAAe,CAAC,YAAgC,EAAE,MAAqB,EAAE,KAAW;IAC5F,IAAI,OAAO,YAAY,KAAK,QAAQ,IAAI,YAAY,GAAG,CAAC;QAAE,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;IACxF,MAAM,UAAU,GAAG,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IACpG,OAAO,MAAM,CA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C,EAClB,aAAsB;IAEtB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IAEhC,IAAI,CAAC;QACJ,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;QAClG,MAAM,KAAK,GAAG,aAAa,IAAI,KAAK,CAAC,MAAM,CAAC;QAC5C,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,OAAO,MAAM,qBAAqB,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;YACnD,MAAM,EAAE,CAAC;YACT,UAAU,EAAE,CAAC,cAAc,GAAG,MAAM,EAAE,KAAK,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACR,8DAA8D;QAC9D,OAAO,EAAE,CAAC;IACX,CAAC;AACF,CAAC","sourcesContent":["import { existsSync } from \"fs\";\nimport { readdir } from \"fs/promises\";\nimport { join } from \"path\";\nimport type { SessionHeader, SessionInfo } from \"./session-manager.ts\";\nimport { readCachedSessionSummary, type SessionSummaryStore } from \"./session-summary-cache.ts\";\nimport { SessionSummaryIndex } from \"./session-summary-index.ts\";\n\nexport type SessionListProgress = (loaded: number, total: number) => void;\n\nconst MAX_CONCURRENT_SESSION_INFO_LOADS = 10;\n\nfunction resolveModified(activityTime: number | undefined, header: SessionHeader, mtime: Date): Date {\n\tif (typeof activityTime === \"number\" && activityTime > 0) return new Date(activityTime);\n\tconst headerTime = typeof header.timestamp === \"string\" ? Date.parse(header.timestamp) : Number.NaN;\n\treturn Number.isNaN(headerTime) ? mtime : new Date(headerTime);\n}\n\n/**\n * Build one picker row from a session file's exact summary.\n *\n * The summary is derived from every record in the file, so a row's name, first\n * message, message count, and activity time are exact regardless of where those\n * records sit. Repeat listings of an unchanged file are served from the\n * stat-keyed summary cache (or `store` on a cache miss) and stream nothing.\n */\nexport async function buildSessionInfo(filePath: string, store?: SessionSummaryStore): Promise<SessionInfo | null> {\n\tconst cached = await readCachedSessionSummary(filePath, store);\n\tif (!cached) return null;\n\n\tconst { summary, mtime } = cached;\n\tconst header = summary.header;\n\n\treturn {\n\t\tpath: filePath,\n\t\tid: header.id,\n\t\tcwd: typeof header.cwd === \"string\" ? header.cwd : \"\",\n\t\tname: summary.name,\n\t\tparentSessionPath: header.parentSession,\n\t\tcreated: new Date(header.timestamp),\n\t\tmodified: resolveModified(summary.lastActivityTime, header, mtime),\n\t\tmessageCount: summary.messageCount,\n\t\tfirstMessage: summary.firstUserMessage || \"(no messages)\",\n\t\tallMessagesText: summary.allMessagesText,\n\t\t...(summary.repositoryIdentity ? { repositoryIdentity: summary.repositoryIdentity } : {}),\n\t};\n}\n\nasync function buildSessionInfosWithConcurrency(\n\tfiles: readonly string[],\n\tonLoaded: () => void,\n\tstore: SessionSummaryStore | undefined,\n): Promise<(SessionInfo | null)[]> {\n\tconst results: (SessionInfo | null)[] = new Array(files.length).fill(null);\n\tconst inFlight = new Set<Promise<void>>();\n\tlet nextIndex = 0;\n\n\tconst startNext = (): void => {\n\t\tconst index = nextIndex++;\n\t\tconst file = files[index];\n\t\tif (!file) return;\n\n\t\tlet task: Promise<void>;\n\t\ttask = buildSessionInfo(file, store)\n\t\t\t.then((info) => {\n\t\t\t\tresults[index] = info;\n\t\t\t})\n\t\t\t.catch(() => {\n\t\t\t\tresults[index] = null;\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tinFlight.delete(task);\n\t\t\t\tonLoaded();\n\t\t\t});\n\t\tinFlight.add(task);\n\t};\n\n\twhile (nextIndex < files.length || inFlight.size > 0) {\n\t\twhile (nextIndex < files.length && inFlight.size < MAX_CONCURRENT_SESSION_INFO_LOADS) {\n\t\t\tstartNext();\n\t\t}\n\t\tif (inFlight.size > 0) {\n\t\t\tawait Promise.race(inFlight);\n\t\t}\n\t}\n\n\treturn results;\n}\n\n/** Build picker rows for an explicit file list, dropping files that are not sessions. */\nexport async function listSessionInfos(\n\tfiles: readonly string[],\n\tonLoaded: () => void,\n\tstore?: SessionSummaryStore,\n): Promise<SessionInfo[]> {\n\tconst results = await buildSessionInfosWithConcurrency(files, onLoaded, store);\n\tconst sessions: SessionInfo[] = [];\n\tfor (const info of results) {\n\t\tif (info) sessions.push(info);\n\t}\n\treturn sessions;\n}\n\n/**\n * Build picker rows for session files that all live in `dir`, served through\n * and then persisted into that directory's summary index.\n */\nexport async function listSessionFilesInDir(\n\tdir: string,\n\tfiles: readonly string[],\n\tonLoaded: () => void,\n): Promise<SessionInfo[]> {\n\tconst index = new SessionSummaryIndex(dir);\n\tconst sessions = await listSessionInfos(files, onLoaded, index);\n\tawait index.persist(files);\n\treturn sessions;\n}\n\n/** Build picker rows for every `.jsonl` file in one session directory. */\nexport async function listSessionsFromDir(\n\tdir: string,\n\tonProgress?: SessionListProgress,\n\tprogressOffset = 0,\n\tprogressTotal?: number,\n): Promise<SessionInfo[]> {\n\tif (!existsSync(dir)) return [];\n\n\ttry {\n\t\tconst dirEntries = await readdir(dir);\n\t\tconst files = dirEntries.filter((name) => name.endsWith(\".jsonl\")).map((name) => join(dir, name));\n\t\tconst total = progressTotal ?? files.length;\n\t\tlet loaded = 0;\n\t\treturn await listSessionFilesInDir(dir, files, () => {\n\t\t\tloaded++;\n\t\t\tonProgress?.(progressOffset + loaded, total);\n\t\t});\n\t} catch {\n\t\t// A directory that cannot be read contributes no picker rows.\n\t\treturn [];\n\t}\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SessionHolder {
|
|
2
|
+
readonly pid: number;
|
|
3
|
+
readonly cwd: string | undefined;
|
|
4
|
+
}
|
|
5
|
+
export declare class SessionHeldError extends Error {
|
|
6
|
+
readonly code: "ESESSIONHELD";
|
|
7
|
+
readonly sessionFile: string;
|
|
8
|
+
readonly holders: readonly SessionHolder[];
|
|
9
|
+
constructor(sessionFile: string, holders: readonly SessionHolder[]);
|
|
10
|
+
}
|
|
11
|
+
export declare class SessionMovingError extends Error {
|
|
12
|
+
readonly code: "ESESSIONMOVING";
|
|
13
|
+
readonly moverPid: number | undefined;
|
|
14
|
+
constructor(sessionFile: string, moverPid: number | undefined);
|
|
15
|
+
}
|
|
16
|
+
export declare class SessionMovedError extends Error {
|
|
17
|
+
readonly code: "ESESSIONMOVED";
|
|
18
|
+
constructor(sessionFile: string);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=session-hold-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-hold-errors.d.ts","sourceRoot":"","sources":["../../src/core/session-hold-errors.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,IAAI,EAAG,cAAc,CAAU;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAE3C,YAAY,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,aAAa,EAAE,EAMjE;CACD;AAED,qBAAa,kBAAmB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAG,gBAAgB,CAAU;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAEtC,YAAY,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,EAK5D;CACD;AAED,qBAAa,iBAAkB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,EAAG,eAAe,CAAU;IAEzC,YAAY,WAAW,EAAE,MAAM,EAG9B;CACD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { APP_NAME } from "../config.js";
|
|
2
|
+
export class SessionHeldError extends Error {
|
|
3
|
+
constructor(sessionFile, holders) {
|
|
4
|
+
const who = holders.map((h) => (h.cwd ? `pid ${h.pid} in ${h.cwd}` : `pid ${h.pid}`)).join("; ");
|
|
5
|
+
super(`This session is open in another ${APP_NAME} process (${who}). Quit it there, then try again.`);
|
|
6
|
+
this.code = "ESESSIONHELD";
|
|
7
|
+
this.name = "SessionHeldError";
|
|
8
|
+
this.sessionFile = sessionFile;
|
|
9
|
+
this.holders = holders;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export class SessionMovingError extends Error {
|
|
13
|
+
constructor(sessionFile, moverPid) {
|
|
14
|
+
const who = moverPid === undefined ? "another process" : `another process (pid ${moverPid})`;
|
|
15
|
+
super(`Session ${sessionFile} is being moved by ${who}. Try again in a moment.`);
|
|
16
|
+
this.code = "ESESSIONMOVING";
|
|
17
|
+
this.name = "SessionMovingError";
|
|
18
|
+
this.moverPid = moverPid;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export class SessionMovedError extends Error {
|
|
22
|
+
constructor(sessionFile) {
|
|
23
|
+
super(`Session ${sessionFile} no longer exists: another process moved it. Resume it from its new location.`);
|
|
24
|
+
this.code = "ESESSIONMOVED";
|
|
25
|
+
this.name = "SessionMovedError";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=session-hold-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-hold-errors.js","sourceRoot":"","sources":["../../src/core/session-hold-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAOxC,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAK1C,YAAY,WAAmB,EAAE,OAAiC;QACjE,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjG,KAAK,CAAC,mCAAmC,QAAQ,aAAa,GAAG,mCAAmC,CAAC,CAAC;QAN9F,SAAI,GAAG,cAAuB,CAAC;QAOvC,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;CACD;AAED,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAI5C,YAAY,WAAmB,EAAE,QAA4B;QAC5D,MAAM,GAAG,GAAG,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,wBAAwB,QAAQ,GAAG,CAAC;QAC7F,KAAK,CAAC,WAAW,WAAW,sBAAsB,GAAG,0BAA0B,CAAC,CAAC;QALzE,SAAI,GAAG,gBAAyB,CAAC;QAMzC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;CACD;AAED,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAG3C,YAAY,WAAmB;QAC9B,KAAK,CAAC,WAAW,WAAW,+EAA+E,CAAC,CAAC;QAHrG,SAAI,GAAG,eAAwB,CAAC;QAIxC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IACjC,CAAC;CACD","sourcesContent":["import { APP_NAME } from \"../config.ts\";\n\nexport interface SessionHolder {\n\treadonly pid: number;\n\treadonly cwd: string | undefined;\n}\n\nexport class SessionHeldError extends Error {\n\treadonly code = \"ESESSIONHELD\" as const;\n\treadonly sessionFile: string;\n\treadonly holders: readonly SessionHolder[];\n\n\tconstructor(sessionFile: string, holders: readonly SessionHolder[]) {\n\t\tconst who = holders.map((h) => (h.cwd ? `pid ${h.pid} in ${h.cwd}` : `pid ${h.pid}`)).join(\"; \");\n\t\tsuper(`This session is open in another ${APP_NAME} process (${who}). Quit it there, then try again.`);\n\t\tthis.name = \"SessionHeldError\";\n\t\tthis.sessionFile = sessionFile;\n\t\tthis.holders = holders;\n\t}\n}\n\nexport class SessionMovingError extends Error {\n\treadonly code = \"ESESSIONMOVING\" as const;\n\treadonly moverPid: number | undefined;\n\n\tconstructor(sessionFile: string, moverPid: number | undefined) {\n\t\tconst who = moverPid === undefined ? \"another process\" : `another process (pid ${moverPid})`;\n\t\tsuper(`Session ${sessionFile} is being moved by ${who}. Try again in a moment.`);\n\t\tthis.name = \"SessionMovingError\";\n\t\tthis.moverPid = moverPid;\n\t}\n}\n\nexport class SessionMovedError extends Error {\n\treadonly code = \"ESESSIONMOVED\" as const;\n\n\tconstructor(sessionFile: string) {\n\t\tsuper(`Session ${sessionFile} no longer exists: another process moved it. Resume it from its new location.`);\n\t\tthis.name = \"SessionMovedError\";\n\t}\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SessionHeldError, type SessionHolder, SessionMovedError, SessionMovingError } from "./session-hold-errors.ts";
|
|
2
|
+
export { SessionHeldError, type SessionHolder, SessionMovedError, SessionMovingError };
|
|
3
|
+
export interface SessionHold {
|
|
4
|
+
release(): void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Publishes this process as a holder of `sessionFile` until `release()`. Throws `SessionMovingError`
|
|
8
|
+
* while another process is moving the session, and `SessionMovedError` when a session that was read
|
|
9
|
+
* from disk (`expectExisting`) is gone, so nothing is ever appended to a path the session left.
|
|
10
|
+
*/
|
|
11
|
+
export declare function holdSessionFile(sessionFile: string, sessionId: string, options: {
|
|
12
|
+
readonly cwd?: string;
|
|
13
|
+
readonly expectExisting: boolean;
|
|
14
|
+
}): SessionHold;
|
|
15
|
+
/**
|
|
16
|
+
* Runs `move` holding the session's move lock, after proving no live process holds the session.
|
|
17
|
+
* Waits up to `waitMs` for a concurrent move to finish, then fails with `SessionMovingError`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function withSessionMoveLock<T>(sessionFile: string, sessionId: string, move: () => T | Promise<T>, options?: {
|
|
20
|
+
readonly waitMs?: number;
|
|
21
|
+
}): Promise<T>;
|
|
22
|
+
//# sourceMappingURL=session-holders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-holders.d.ts","sourceRoot":"","sources":["../../src/core/session-holders.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGvH,OAAO,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;AAoBvF,MAAM,WAAW,WAAW;IAC3B,OAAO,IAAI,IAAI,CAAC;CAChB;AAqFD;;;;GAIG;AACH,wBAAgB,eAAe,CAC9B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE;IAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;CAAE,GAClE,WAAW,CAgCb;AAyDD;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,CAAC,EAC1C,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAC1B,OAAO,GAAE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GACxC,OAAO,CAAC,CAAC,CAAC,CAYZ"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, rmdirSync, statSync, unlinkSync, writeFileSync, } from "node:fs";
|
|
3
|
+
import { readdir } from "node:fs/promises";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { breakStaleLock, errorCode, publishExclusive, readLeaseText, reclaimLockState, unlinkIfPresent, } from "./extensions/builtin/terminal/lease-file.js";
|
|
6
|
+
import { ownProcessStartedAtMs, processBootAtMs } from "./extensions/builtin/terminal/process-identity.js";
|
|
7
|
+
import { SessionHeldError, SessionMovedError, SessionMovingError } from "./session-hold-errors.js";
|
|
8
|
+
import { encodedSessionId } from "./session-sidecar-store.js";
|
|
9
|
+
export { SessionHeldError, SessionMovedError, SessionMovingError };
|
|
10
|
+
/**
|
|
11
|
+
* Cross-process ownership of a session file. Every process that has a session open publishes a holder
|
|
12
|
+
* record `<sessionDir>/session-holders/<id>/<pid>.json` carrying its process identity; moving the session
|
|
13
|
+
* takes `move.lock` in the same directory. The records reuse the terminal lease format, so a crashed
|
|
14
|
+
* holder or a reused pid is recognised as stale instead of pinning the session forever.
|
|
15
|
+
*
|
|
16
|
+
* Ordering makes the pair race-free: an opener publishes its record and then looks for a move lock; a
|
|
17
|
+
* mover takes the lock and then looks for records. Whichever runs second sees the other.
|
|
18
|
+
*/
|
|
19
|
+
const HOLDERS_DIR = "session-holders";
|
|
20
|
+
const MOVE_LOCK = "move.lock";
|
|
21
|
+
const HOLDER_RECORD = /^\d+\.json$/;
|
|
22
|
+
// A move rewrites one file and a few sidecars; a lock older than this belongs to a mover that died.
|
|
23
|
+
const MOVE_LOCK_STALE_MS = 30_000;
|
|
24
|
+
const DEFAULT_MOVE_LOCK_WAIT_MS = 5_000;
|
|
25
|
+
const MOVE_LOCK_RETRY_MS = 100;
|
|
26
|
+
function holdersDir(sessionFile, sessionId) {
|
|
27
|
+
return join(dirname(sessionFile), HOLDERS_DIR, encodedSessionId(sessionId));
|
|
28
|
+
}
|
|
29
|
+
function identityRecord(cwd) {
|
|
30
|
+
return JSON.stringify({
|
|
31
|
+
pid: process.pid,
|
|
32
|
+
bootAtMs: processBootAtMs(),
|
|
33
|
+
processStartedAtMs: ownProcessStartedAtMs(),
|
|
34
|
+
...(cwd === undefined ? {} : { cwd }),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function unlinkIfPresentSync(path) {
|
|
38
|
+
try {
|
|
39
|
+
unlinkSync(path);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if (errorCode(error) !== "ENOENT")
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function removeDirIfEmpty(dir) {
|
|
47
|
+
try {
|
|
48
|
+
rmdirSync(dir);
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
const code = errorCode(error);
|
|
52
|
+
if (code !== "ENOENT" && code !== "ENOTEMPTY" && code !== "EEXIST")
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const holderRecordRefCounts = new Map();
|
|
57
|
+
let exitCleanupInstalled = false;
|
|
58
|
+
function installExitCleanup() {
|
|
59
|
+
if (exitCleanupInstalled)
|
|
60
|
+
return;
|
|
61
|
+
exitCleanupInstalled = true;
|
|
62
|
+
process.once("exit", () => {
|
|
63
|
+
for (const record of holderRecordRefCounts.keys())
|
|
64
|
+
unlinkIfPresentSync(record);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function pidAlive(pid) {
|
|
68
|
+
try {
|
|
69
|
+
process.kill(pid, 0);
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
return errorCode(error) === "EPERM";
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function activeMover(lock) {
|
|
77
|
+
let raw;
|
|
78
|
+
let ageMs;
|
|
79
|
+
try {
|
|
80
|
+
raw = readFileSync(lock, "utf8");
|
|
81
|
+
ageMs = Date.now() - statSync(lock).mtimeMs;
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (errorCode(error) === "ENOENT")
|
|
85
|
+
return undefined;
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
if (ageMs > MOVE_LOCK_STALE_MS)
|
|
89
|
+
return undefined;
|
|
90
|
+
const pid = parsePid(raw);
|
|
91
|
+
if (pid === undefined)
|
|
92
|
+
return { pid };
|
|
93
|
+
return pid === process.pid || pidAlive(pid) ? { pid } : undefined;
|
|
94
|
+
}
|
|
95
|
+
function parsePid(raw) {
|
|
96
|
+
try {
|
|
97
|
+
const parsed = JSON.parse(raw);
|
|
98
|
+
if (typeof parsed !== "object" || parsed === null || !("pid" in parsed))
|
|
99
|
+
return undefined;
|
|
100
|
+
return typeof parsed.pid === "number" ? parsed.pid : undefined;
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
if (error instanceof SyntaxError)
|
|
104
|
+
return undefined;
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function parseCwd(raw) {
|
|
109
|
+
const parsed = JSON.parse(raw);
|
|
110
|
+
if (typeof parsed !== "object" || parsed === null || !("cwd" in parsed))
|
|
111
|
+
return undefined;
|
|
112
|
+
return typeof parsed.cwd === "string" ? parsed.cwd : undefined;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Publishes this process as a holder of `sessionFile` until `release()`. Throws `SessionMovingError`
|
|
116
|
+
* while another process is moving the session, and `SessionMovedError` when a session that was read
|
|
117
|
+
* from disk (`expectExisting`) is gone, so nothing is ever appended to a path the session left.
|
|
118
|
+
*/
|
|
119
|
+
export function holdSessionFile(sessionFile, sessionId, options) {
|
|
120
|
+
const dir = holdersDir(sessionFile, sessionId);
|
|
121
|
+
const record = join(dir, `${process.pid}.json`);
|
|
122
|
+
const shared = holderRecordRefCounts.get(record) ?? 0;
|
|
123
|
+
if (shared === 0) {
|
|
124
|
+
publishHolderRecord(dir, record, identityRecord(options.cwd));
|
|
125
|
+
installExitCleanup();
|
|
126
|
+
}
|
|
127
|
+
holderRecordRefCounts.set(record, shared + 1);
|
|
128
|
+
let released = false;
|
|
129
|
+
const release = () => {
|
|
130
|
+
if (released)
|
|
131
|
+
return;
|
|
132
|
+
released = true;
|
|
133
|
+
const left = (holderRecordRefCounts.get(record) ?? 1) - 1;
|
|
134
|
+
if (left > 0) {
|
|
135
|
+
holderRecordRefCounts.set(record, left);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
holderRecordRefCounts.delete(record);
|
|
139
|
+
unlinkIfPresentSync(record);
|
|
140
|
+
removeDirIfEmpty(dir);
|
|
141
|
+
};
|
|
142
|
+
const mover = activeMover(join(dir, MOVE_LOCK));
|
|
143
|
+
if (mover !== undefined) {
|
|
144
|
+
release();
|
|
145
|
+
throw new SessionMovingError(sessionFile, mover.pid);
|
|
146
|
+
}
|
|
147
|
+
if (options.expectExisting && !existsSync(sessionFile)) {
|
|
148
|
+
release();
|
|
149
|
+
throw new SessionMovedError(sessionFile);
|
|
150
|
+
}
|
|
151
|
+
return { release };
|
|
152
|
+
}
|
|
153
|
+
// A finishing move removes the emptied directory, so a writer racing it recreates the directory once.
|
|
154
|
+
function publishHolderRecord(dir, record, content) {
|
|
155
|
+
for (let attempt = 0;; attempt += 1) {
|
|
156
|
+
mkdirSync(dir, { recursive: true });
|
|
157
|
+
const temp = `${record}.${randomUUID().slice(0, 8)}.tmp`;
|
|
158
|
+
try {
|
|
159
|
+
writeFileSync(temp, content);
|
|
160
|
+
renameSync(temp, record);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
if (errorCode(error) !== "ENOENT" || attempt > 0)
|
|
165
|
+
throw error;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
async function liveHolders(dir) {
|
|
170
|
+
const holders = [];
|
|
171
|
+
for (const name of await readdir(dir)) {
|
|
172
|
+
if (!HOLDER_RECORD.test(name))
|
|
173
|
+
continue;
|
|
174
|
+
const path = join(dir, name);
|
|
175
|
+
const state = await reclaimLockState(path);
|
|
176
|
+
if (state.state === "stale")
|
|
177
|
+
await breakStaleLock(path, state.raw);
|
|
178
|
+
if (state.state !== "held" || state.holder === undefined)
|
|
179
|
+
continue;
|
|
180
|
+
const raw = await readLeaseText(path);
|
|
181
|
+
holders.push({ pid: state.holder.pid, cwd: raw === undefined ? undefined : parseCwd(raw) });
|
|
182
|
+
}
|
|
183
|
+
return holders;
|
|
184
|
+
}
|
|
185
|
+
async function takeMoveLock(sessionFile, lock, waitMs) {
|
|
186
|
+
const mine = identityRecord();
|
|
187
|
+
const deadline = Date.now() + waitMs;
|
|
188
|
+
while (true) {
|
|
189
|
+
try {
|
|
190
|
+
await publishExclusive(lock, mine);
|
|
191
|
+
return mine;
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
const code = errorCode(error);
|
|
195
|
+
if (code === "ENOENT") {
|
|
196
|
+
mkdirSync(dirname(lock), { recursive: true });
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
if (code !== "EEXIST")
|
|
200
|
+
throw error;
|
|
201
|
+
}
|
|
202
|
+
const state = await reclaimLockState(lock);
|
|
203
|
+
if (state.state === "stale") {
|
|
204
|
+
await breakStaleLock(lock, state.raw);
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
if (state.state === "free")
|
|
208
|
+
continue;
|
|
209
|
+
if (Date.now() >= deadline)
|
|
210
|
+
throw new SessionMovingError(sessionFile, state.holder?.pid);
|
|
211
|
+
await new Promise((resolve) => setTimeout(resolve, MOVE_LOCK_RETRY_MS));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Runs `move` holding the session's move lock, after proving no live process holds the session.
|
|
216
|
+
* Waits up to `waitMs` for a concurrent move to finish, then fails with `SessionMovingError`.
|
|
217
|
+
*/
|
|
218
|
+
export async function withSessionMoveLock(sessionFile, sessionId, move, options = {}) {
|
|
219
|
+
const dir = holdersDir(sessionFile, sessionId);
|
|
220
|
+
const lock = join(dir, MOVE_LOCK);
|
|
221
|
+
const mine = await takeMoveLock(sessionFile, lock, options.waitMs ?? DEFAULT_MOVE_LOCK_WAIT_MS);
|
|
222
|
+
try {
|
|
223
|
+
const holders = await liveHolders(dir);
|
|
224
|
+
if (holders.length > 0)
|
|
225
|
+
throw new SessionHeldError(sessionFile, holders);
|
|
226
|
+
return await move();
|
|
227
|
+
}
|
|
228
|
+
finally {
|
|
229
|
+
if ((await readLeaseText(lock)) === mine)
|
|
230
|
+
await unlinkIfPresent(lock);
|
|
231
|
+
removeDirIfEmpty(dir);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=session-holders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-holders.js","sourceRoot":"","sources":["../../src/core/session-holders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACN,UAAU,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACN,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,eAAe,GACf,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAC3G,OAAO,EAAE,gBAAgB,EAAsB,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACvH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4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AAC,KAAK,KAAK,MAAM;YAAE,SAAS;QACrC,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,QAAQ;YAAE,MAAM,IAAI,kBAAkB,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACzF,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC;IACzE,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,WAAmB,EACnB,SAAiB,EACjB,IAA0B,EAC1B,OAAO,GAAiC,EAAE;IAE1C,MAAM,GAAG,GAAG,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,IAAI,yBAAyB,CAAC,CAAC;IAChG,IAAI,CAAC;QACJ,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,IAAI,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACzE,OAAO,MAAM,IAAI,EAAE,CAAC;IACrB,CAAC;YAAS,CAAC;QACV,IAAI,CAAC,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI;YAAE,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;QACtE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;AACF,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport {\n\texistsSync,\n\tmkdirSync,\n\treadFileSync,\n\trenameSync,\n\trmdirSync,\n\tstatSync,\n\tunlinkSync,\n\twriteFileSync,\n} from \"node:fs\";\nimport { readdir } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport {\n\tbreakStaleLock,\n\terrorCode,\n\tpublishExclusive,\n\treadLeaseText,\n\treclaimLockState,\n\tunlinkIfPresent,\n} from \"./extensions/builtin/terminal/lease-file.ts\";\nimport { ownProcessStartedAtMs, processBootAtMs } from \"./extensions/builtin/terminal/process-identity.ts\";\nimport { SessionHeldError, type SessionHolder, SessionMovedError, SessionMovingError } from \"./session-hold-errors.ts\";\nimport { encodedSessionId } from \"./session-sidecar-store.ts\";\n\nexport { SessionHeldError, type SessionHolder, SessionMovedError, SessionMovingError };\n\n/**\n * Cross-process ownership of a session file. Every process that has a session open publishes a holder\n * record `<sessionDir>/session-holders/<id>/<pid>.json` carrying its process identity; moving the session\n * takes `move.lock` in the same directory. The records reuse the terminal lease format, so a crashed\n * holder or a reused pid is recognised as stale instead of pinning the session forever.\n *\n * Ordering makes the pair race-free: an opener publishes its record and then looks for a move lock; a\n * mover takes the lock and then looks for records. Whichever runs second sees the other.\n */\n\nconst HOLDERS_DIR = \"session-holders\";\nconst MOVE_LOCK = \"move.lock\";\nconst HOLDER_RECORD = /^\\d+\\.json$/;\n// A move rewrites one file and a few sidecars; a lock older than this belongs to a mover that died.\nconst MOVE_LOCK_STALE_MS = 30_000;\nconst DEFAULT_MOVE_LOCK_WAIT_MS = 5_000;\nconst MOVE_LOCK_RETRY_MS = 100;\n\nexport interface SessionHold {\n\trelease(): void;\n}\n\nfunction holdersDir(sessionFile: string, sessionId: string): string {\n\treturn join(dirname(sessionFile), HOLDERS_DIR, encodedSessionId(sessionId));\n}\n\nfunction identityRecord(cwd?: string): string {\n\treturn JSON.stringify({\n\t\tpid: process.pid,\n\t\tbootAtMs: processBootAtMs(),\n\t\tprocessStartedAtMs: ownProcessStartedAtMs(),\n\t\t...(cwd === undefined ? {} : { cwd }),\n\t});\n}\n\nfunction unlinkIfPresentSync(path: string): void {\n\ttry {\n\t\tunlinkSync(path);\n\t} catch (error) {\n\t\tif (errorCode(error) !== \"ENOENT\") throw error;\n\t}\n}\n\nfunction removeDirIfEmpty(dir: string): void {\n\ttry {\n\t\trmdirSync(dir);\n\t} catch (error) {\n\t\tconst code = errorCode(error);\n\t\tif (code !== \"ENOENT\" && code !== \"ENOTEMPTY\" && code !== \"EEXIST\") throw error;\n\t}\n}\n\nconst holderRecordRefCounts = new Map<string, number>();\nlet exitCleanupInstalled = false;\n\nfunction installExitCleanup(): void {\n\tif (exitCleanupInstalled) return;\n\texitCleanupInstalled = true;\n\tprocess.once(\"exit\", () => {\n\t\tfor (const record of holderRecordRefCounts.keys()) unlinkIfPresentSync(record);\n\t});\n}\n\nfunction pidAlive(pid: number): boolean {\n\ttry {\n\t\tprocess.kill(pid, 0);\n\t\treturn true;\n\t} catch (error) {\n\t\treturn errorCode(error) === \"EPERM\";\n\t}\n}\n\nfunction activeMover(lock: string): { readonly pid: number | undefined } | undefined {\n\tlet raw: string;\n\tlet ageMs: number;\n\ttry {\n\t\traw = readFileSync(lock, \"utf8\");\n\t\tageMs = Date.now() - statSync(lock).mtimeMs;\n\t} catch (error) {\n\t\tif (errorCode(error) === \"ENOENT\") return undefined;\n\t\tthrow error;\n\t}\n\tif (ageMs > MOVE_LOCK_STALE_MS) return undefined;\n\tconst pid = parsePid(raw);\n\tif (pid === undefined) return { pid };\n\treturn pid === process.pid || pidAlive(pid) ? { pid } : undefined;\n}\n\nfunction parsePid(raw: string): number | undefined {\n\ttry {\n\t\tconst parsed: unknown = JSON.parse(raw);\n\t\tif (typeof parsed !== \"object\" || parsed === null || !(\"pid\" in parsed)) return undefined;\n\t\treturn typeof parsed.pid === \"number\" ? parsed.pid : undefined;\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) return undefined;\n\t\tthrow error;\n\t}\n}\n\nfunction parseCwd(raw: string): string | undefined {\n\tconst parsed: unknown = JSON.parse(raw);\n\tif (typeof parsed !== \"object\" || parsed === null || !(\"cwd\" in parsed)) return undefined;\n\treturn typeof parsed.cwd === \"string\" ? parsed.cwd : undefined;\n}\n\n/**\n * Publishes this process as a holder of `sessionFile` until `release()`. Throws `SessionMovingError`\n * while another process is moving the session, and `SessionMovedError` when a session that was read\n * from disk (`expectExisting`) is gone, so nothing is ever appended to a path the session left.\n */\nexport function holdSessionFile(\n\tsessionFile: string,\n\tsessionId: string,\n\toptions: { readonly cwd?: string; readonly expectExisting: boolean },\n): SessionHold {\n\tconst dir = holdersDir(sessionFile, sessionId);\n\tconst record = join(dir, `${process.pid}.json`);\n\tconst shared = holderRecordRefCounts.get(record) ?? 0;\n\tif (shared === 0) {\n\t\tpublishHolderRecord(dir, record, identityRecord(options.cwd));\n\t\tinstallExitCleanup();\n\t}\n\tholderRecordRefCounts.set(record, shared + 1);\n\tlet released = false;\n\tconst release = (): void => {\n\t\tif (released) return;\n\t\treleased = true;\n\t\tconst left = (holderRecordRefCounts.get(record) ?? 1) - 1;\n\t\tif (left > 0) {\n\t\t\tholderRecordRefCounts.set(record, left);\n\t\t\treturn;\n\t\t}\n\t\tholderRecordRefCounts.delete(record);\n\t\tunlinkIfPresentSync(record);\n\t\tremoveDirIfEmpty(dir);\n\t};\n\tconst mover = activeMover(join(dir, MOVE_LOCK));\n\tif (mover !== undefined) {\n\t\trelease();\n\t\tthrow new SessionMovingError(sessionFile, mover.pid);\n\t}\n\tif (options.expectExisting && !existsSync(sessionFile)) {\n\t\trelease();\n\t\tthrow new SessionMovedError(sessionFile);\n\t}\n\treturn { release };\n}\n\n// A finishing move removes the emptied directory, so a writer racing it recreates the directory once.\nfunction publishHolderRecord(dir: string, record: string, content: string): void {\n\tfor (let attempt = 0; ; attempt += 1) {\n\t\tmkdirSync(dir, { recursive: true });\n\t\tconst temp = `${record}.${randomUUID().slice(0, 8)}.tmp`;\n\t\ttry {\n\t\t\twriteFileSync(temp, content);\n\t\t\trenameSync(temp, record);\n\t\t\treturn;\n\t\t} catch (error) {\n\t\t\tif (errorCode(error) !== \"ENOENT\" || attempt > 0) throw error;\n\t\t}\n\t}\n}\n\nasync function liveHolders(dir: string): Promise<SessionHolder[]> {\n\tconst holders: SessionHolder[] = [];\n\tfor (const name of await readdir(dir)) {\n\t\tif (!HOLDER_RECORD.test(name)) continue;\n\t\tconst path = join(dir, name);\n\t\tconst state = await reclaimLockState(path);\n\t\tif (state.state === \"stale\") await breakStaleLock(path, state.raw);\n\t\tif (state.state !== \"held\" || state.holder === undefined) continue;\n\t\tconst raw = await readLeaseText(path);\n\t\tholders.push({ pid: state.holder.pid, cwd: raw === undefined ? undefined : parseCwd(raw) });\n\t}\n\treturn holders;\n}\n\nasync function takeMoveLock(sessionFile: string, lock: string, waitMs: number): Promise<string> {\n\tconst mine = identityRecord();\n\tconst deadline = Date.now() + waitMs;\n\twhile (true) {\n\t\ttry {\n\t\t\tawait publishExclusive(lock, mine);\n\t\t\treturn mine;\n\t\t} catch (error) {\n\t\t\tconst code = errorCode(error);\n\t\t\tif (code === \"ENOENT\") {\n\t\t\t\tmkdirSync(dirname(lock), { recursive: true });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (code !== \"EEXIST\") throw error;\n\t\t}\n\t\tconst state = await reclaimLockState(lock);\n\t\tif (state.state === \"stale\") {\n\t\t\tawait breakStaleLock(lock, state.raw);\n\t\t\tcontinue;\n\t\t}\n\t\tif (state.state === \"free\") continue;\n\t\tif (Date.now() >= deadline) throw new SessionMovingError(sessionFile, state.holder?.pid);\n\t\tawait new Promise((resolve) => setTimeout(resolve, MOVE_LOCK_RETRY_MS));\n\t}\n}\n\n/**\n * Runs `move` holding the session's move lock, after proving no live process holds the session.\n * Waits up to `waitMs` for a concurrent move to finish, then fails with `SessionMovingError`.\n */\nexport async function withSessionMoveLock<T>(\n\tsessionFile: string,\n\tsessionId: string,\n\tmove: () => T | Promise<T>,\n\toptions: { readonly waitMs?: number } = {},\n): Promise<T> {\n\tconst dir = holdersDir(sessionFile, sessionId);\n\tconst lock = join(dir, MOVE_LOCK);\n\tconst mine = await takeMoveLock(sessionFile, lock, options.waitMs ?? DEFAULT_MOVE_LOCK_WAIT_MS);\n\ttry {\n\t\tconst holders = await liveHolders(dir);\n\t\tif (holders.length > 0) throw new SessionHeldError(sessionFile, holders);\n\t\treturn await move();\n\t} finally {\n\t\tif ((await readLeaseText(lock)) === mine) await unlinkIfPresent(lock);\n\t\tremoveDirIfEmpty(dir);\n\t}\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AgentMessage } from "@earendil-works/pi-agent-core";
|
|
2
2
|
import type { ImageContent, Message, TextContent, ThinkingSelection, Usage } from "@earendil-works/pi-ai";
|
|
3
|
+
import type { RepositoryIdentity } from "./repository-identity.ts";
|
|
3
4
|
import { type SessionListProgress } from "./session-discovery.ts";
|
|
4
5
|
import { type ResidentStoreStats, ResidentStringStore } from "./session-resident-store.ts";
|
|
5
6
|
export type { SessionListProgress } from "./session-discovery.ts";
|
|
@@ -197,6 +198,10 @@ export interface SessionInfo {
|
|
|
197
198
|
messageCount: number;
|
|
198
199
|
firstMessage: string;
|
|
199
200
|
allMessagesText: string;
|
|
201
|
+
/** Latest repository identity the session recorded (see `repository-identity`). */
|
|
202
|
+
repositoryIdentity?: RepositoryIdentity;
|
|
203
|
+
/** Set on sessions of the current repository recorded at a path that no longer exists. */
|
|
204
|
+
moved?: boolean;
|
|
200
205
|
}
|
|
201
206
|
export type ReadonlySessionManager = Pick<SessionManager, "getCwd" | "getSessionDir" | "getSessionId" | "getSessionFile" | "getLeafId" | "getLeafEntry" | "getEntry" | "getLabel" | "getBranch" | "buildContextEntries" | "buildSessionContext" | "getHeader" | "getEntries" | "getTree" | "getSessionName">;
|
|
202
207
|
export declare function assertValidSessionId(id: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../../src/core/session-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,OA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