@bastani/atomic 0.10.10 → 0.10.11-alpha.2
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 +139 -0
- package/README.md +1 -1
- package/dist/_shared/dist-KOELCESV.js +2 -2
- package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
- package/dist/_shared/lib-4PES5P4V.js +2 -2
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +11 -13
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +9 -9
- package/dist/_shared/mode-shared-2QJSCUM6.js +55 -18
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
- package/dist/_shared/runtime-O4KCSG4C.js +5 -5
- package/dist/_shared/{sdk-RRLVN7ER.js → sdk-IQMULKFU.js} +2962 -470
- package/dist/_shared/sdk-IQMULKFU.js.map +1 -0
- package/dist/_shared/session-data-AHTU7IS6.js +4 -4
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/settings-startup-8-DNZ2RIHM.js +1 -1
- package/dist/_shared/{settings-startup-4QCVCI53.js → settings-startup-HXQLSUWM.js} +8 -2
- package/dist/_shared/settings-startup-HXQLSUWM.js.map +1 -0
- package/dist/_shared/{startup-0-0-4VG2G44V.js → startup-0-0-3IXNMFM2.js} +482 -53
- package/dist/_shared/startup-0-0-3IXNMFM2.js.map +1 -0
- package/dist/_shared/{startup-0-1-XTIL65D4.js → startup-0-1-7T2IAE7J.js} +121 -251
- package/dist/_shared/startup-0-1-7T2IAE7J.js.map +1 -0
- package/dist/_shared/{startup-0-2-27OWFHV6.js → startup-0-2-5QHPCEON.js} +293 -10
- package/dist/_shared/startup-0-2-5QHPCEON.js.map +1 -0
- package/dist/_shared/{startup-0-3-T4DVFYWX.js → startup-0-3-4ZYBYQNM.js} +273 -14
- package/dist/_shared/startup-0-3-4ZYBYQNM.js.map +1 -0
- package/dist/_shared/startup-0-4-ZMJV547D.js +6 -6
- package/dist/_shared/{startup-0-5-FD2P735I.js → startup-0-5-YDW47QX6.js} +29 -71
- package/dist/_shared/startup-0-5-YDW47QX6.js.map +1 -0
- package/dist/_shared/startup-10-0-TDQNBDDL.js +9 -9
- package/dist/_shared/startup-12-0-55AAXBJZ.js +4 -4
- package/dist/_shared/startup-14-0-MLX36RBG.js +6 -6
- package/dist/_shared/startup-15-0-YUKGAC63.js +34 -10
- package/dist/_shared/startup-15-0-YUKGAC63.js.map +1 -1
- package/dist/_shared/startup-15-1-4S7FLMNG.js +10 -9
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +421 -84
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/{startup-8-1-4KANEHRA.js → startup-8-1-X32CYSXB.js} +1291 -722
- package/dist/_shared/startup-8-1-X32CYSXB.js.map +1 -0
- package/dist/_shared/storage-command-7MGXLJGZ.js +17 -9
- package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
- package/dist/_shared/task-reference-stream-JWMUZSJX.js +1 -1
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +3 -3
- package/dist/builtin/intercom/CHANGELOG.md +29 -0
- package/dist/builtin/intercom/broker/broker.bundle.mjs +1138 -384
- package/dist/builtin/intercom/broker/database-wake-up-bus.ts +103 -24
- package/dist/builtin/intercom/broker/multinode-router.ts +42 -21
- package/dist/builtin/intercom/broker/multinode-state-store.ts +22 -1
- package/dist/builtin/intercom/broker/open-broker-state.ts +82 -31
- package/dist/builtin/intercom/broker/paths.ts +8 -4
- package/dist/builtin/intercom/broker/released-asker-remote-replies.ts +18 -6
- package/dist/builtin/intercom/broker/sql-add-column.ts +4 -1
- package/dist/builtin/intercom/broker/sql-ended-child-queue-store.ts +65 -44
- package/dist/builtin/intercom/broker/sql-held-send-store.ts +11 -3
- package/dist/builtin/intercom/broker/sql-known-session-store.ts +24 -12
- package/dist/builtin/intercom/broker/sql-lease-store.ts +386 -65
- package/dist/builtin/intercom/broker/sql-outbox-store.ts +462 -130
- package/dist/builtin/intercom/broker/sql-pending-ask-store.ts +20 -9
- package/dist/builtin/intercom/broker/sql-released-ask-store.ts +14 -6
- package/dist/builtin/intercom/broker/sql-restoring-reservation-store.ts +27 -11
- package/dist/builtin/intercom/broker/sql-schema.ts +198 -5
- package/dist/builtin/intercom/broker/sql-sent-message-authority.ts +97 -34
- package/dist/builtin/intercom/index.bundle.mjs +11 -8
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +18 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/skills/skill-creator/SKILL.md +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +62 -23
- package/dist/builtin/web-access/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +6 -6
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +4 -4
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.code.js +2 -2
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +2 -2
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +2 -2
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.code.js +3 -3
- package/dist/cli/storage-search-session.impl.js +3 -3
- package/dist/cli/storage-search-session.js +3 -3
- package/dist/cli/team-command.code.js +3 -3
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +2 -2
- package/dist/core/agent-session-methods.d.ts +3 -0
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/compaction/compactor.d.ts +2 -0
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.code.js +1 -1
- package/dist/core/export-html/card-projection.impl.js +3 -3
- package/dist/core/export-html/card-projection.js +3 -3
- package/dist/core/export-html/index.code.js +2 -2
- package/dist/core/export-html/index.impl.js +3 -3
- package/dist/core/export-html/index.js +3 -3
- package/dist/core/export-html/json-spans.impl.js +3 -3
- package/dist/core/export-html/json-spans.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.code.js +2 -2
- package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- package/dist/core/export-html/tool-renderer.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/extensions/jiti-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-loader.js +3 -3
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-static-loader.js +3 -3
- package/dist/core/extensions/loader-host-modules.code.js +1 -1
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/extensions/loader-virtual-modules.js +2 -2
- package/dist/core/extensions/runner-context.js +4 -4
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/intercom-broker-control-host.code.js +1 -1
- package/dist/core/intercom-broker-control-host.impl.js +3 -3
- package/dist/core/intercom-broker-control-host.js +3 -3
- package/dist/core/intercom-broker-control.code.js +3 -3
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/model-registry.js +1 -1
- package/dist/core/model-resolver-defaults.d.ts +3 -2
- package/dist/core/package-manager-storage-adapters.code.js +1 -1
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/sdk.code.js +4 -5
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.d.ts +5 -2
- package/dist/core/session-manager-core.js +39 -23
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.code.js +3 -3
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-open-markers.js +3 -0
- package/dist/core/session-open-markers.js.map +1 -0
- package/dist/core/session-storage.code.js +1 -1
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/storage/added-exports.d.ts +6 -0
- package/dist/core/storage/added-exports.js +19 -0
- package/dist/core/storage/added-exports.js.map +1 -0
- package/dist/core/storage/database.d.ts +53 -0
- package/dist/core/storage/database.js.map +1 -1
- package/dist/core/storage/fenced-paths.d.ts +47 -0
- package/dist/core/storage/fenced-paths.js +53 -0
- package/dist/core/storage/fenced-paths.js.map +1 -1
- package/dist/core/storage/file-identity.js +31 -2
- package/dist/core/storage/file-identity.js.map +1 -1
- package/dist/core/storage/index.d.ts +4 -1
- package/dist/core/storage/index.js +5 -2
- package/dist/core/storage/index.js.map +1 -1
- package/dist/core/storage/migrations.d.ts +33 -2
- package/dist/core/storage/migrations.js +73 -5
- package/dist/core/storage/migrations.js.map +1 -1
- package/dist/core/storage/node-sqlite-thread.js +48 -6
- package/dist/core/storage/node-sqlite-thread.js.map +1 -1
- package/dist/core/storage/node-sqlite.js +137 -4
- package/dist/core/storage/node-sqlite.js.map +1 -1
- package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
- package/dist/core/storage/offline-snapshot-file.js +3 -3
- package/dist/core/storage/prefix.d.ts +3 -2
- package/dist/core/storage/prefix.js +23 -2
- package/dist/core/storage/prefix.js.map +1 -1
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/schema-catalog.d.ts +120 -0
- package/dist/core/storage/schema-catalog.js +351 -0
- package/dist/core/storage/schema-catalog.js.map +1 -0
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +47 -25
- package/dist/core/storage/session/branch-fork-source.code.js.map +1 -1
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +4 -4
- package/dist/core/storage/session/child-reader.impl.js +3 -3
- package/dist/core/storage/session/child-reader.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.code.js +1 -1
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.js +3 -3
- package/dist/core/storage/session/errors.js +1 -1
- package/dist/core/storage/session/expanded-child-details.code.js +4 -4
- package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
- package/dist/core/storage/session/expanded-child-details.js +3 -3
- package/dist/core/storage/session/fork-detach.d.ts +118 -0
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.js +3 -3
- package/dist/core/storage/session/fork-row-index.impl.js +3 -3
- package/dist/core/storage/session/fork-row-index.js +3 -3
- package/dist/core/storage/session/fork-schema.js +53 -0
- package/dist/core/storage/session/fork-schema.js.map +1 -0
- package/dist/core/storage/session/fork-segments.d.ts +58 -0
- package/dist/core/storage/session/fork-staging.code.js +176 -36
- package/dist/core/storage/session/fork-staging.code.js.map +1 -1
- package/dist/core/storage/session/fork-staging.impl.js +3 -3
- package/dist/core/storage/session/fork-staging.js +3 -3
- package/dist/core/storage/session/fork-sweep.js +61 -0
- package/dist/core/storage/session/fork-sweep.js.map +1 -0
- package/dist/core/storage/session/fork-window.code.js +4 -4
- package/dist/core/storage/session/fork-window.impl.js +3 -3
- package/dist/core/storage/session/fork-window.js +3 -3
- package/dist/core/storage/session/history-pages.impl.js +3 -3
- package/dist/core/storage/session/history-pages.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.d.ts +37 -1
- package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.js +3 -3
- package/dist/core/storage/session/memory-session-store.impl.js +3 -3
- package/dist/core/storage/session/memory-session-store.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.js +3 -3
- package/dist/core/storage/session/released-history-files.code.js +3 -3
- package/dist/core/storage/session/released-history-files.impl.js +3 -3
- package/dist/core/storage/session/released-history-files.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.code.js +1 -1
- package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.js +3 -3
- package/dist/core/storage/session/session-resume.impl.js +3 -3
- package/dist/core/storage/session/session-resume.js +3 -3
- package/dist/core/storage/session/session-search-index.d.ts +5 -0
- package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
- package/dist/core/storage/session/snapshot-cut.js +3 -3
- package/dist/core/storage/session/snapshot-history.code.js +4 -4
- package/dist/core/storage/session/snapshot-history.impl.js +3 -3
- package/dist/core/storage/session/snapshot-history.js +3 -3
- package/dist/core/storage/session/sql-chat-records.d.ts +15 -0
- package/dist/core/storage/session/sql-session-store.code.js +1 -1
- package/dist/core/storage/session/sql-session-store.d.ts +445 -11
- package/dist/core/storage/session/sql-session-store.impl.js +4 -4
- package/dist/core/storage/session/sql-session-store.js +4 -4
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.code.js +1 -1
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/session/types.d.ts +36 -0
- package/dist/core/storage/sqlite-facade.d.ts +54 -6
- package/dist/core/storage/sqlite-facade.js +384 -18
- package/dist/core/storage/sqlite-facade.js.map +1 -1
- package/dist/core/storage/statement-sequence.d.ts +83 -0
- package/dist/core/storage/statement-sequence.js +21 -0
- package/dist/core/storage/statement-sequence.js.map +1 -1
- package/dist/core/storage/storage-status.code.js +1 -1
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.code.js +1 -1
- package/dist/core/storage/team.impl.js +3 -3
- package/dist/core/storage/team.js +3 -3
- package/dist/core/structured-output/index.code.js +1 -1
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/tasks/task-completion-entry.code.js +1 -1
- package/dist/core/tasks/task-completion-entry.impl.js +3 -3
- package/dist/core/tasks/task-completion-entry.js +3 -3
- package/dist/core/tasks/task-file-history.code.js +4 -4
- package/dist/core/tasks/task-file-history.impl.js +3 -3
- package/dist/core/tasks/task-file-history.js +3 -3
- package/dist/core/tasks/task-reference-archive.code.js +5 -5
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.code.js +1 -1
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/bash.d.ts +8 -4
- package/dist/core/tools/history-session.d.ts +7 -0
- package/dist/core/tools/history-tasks.d.ts +123 -0
- package/dist/core/tools/kill.d.ts +5 -2
- package/dist/core/tools/powershell.d.ts +2 -2
- package/dist/core/tools/read-url.code.js +3 -3
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/tools/read.d.ts +12 -2
- package/dist/core/tools/resource-selectors.d.ts +2 -0
- package/dist/core/tools/search.d.ts +12 -2
- package/dist/core/worktree-snapshot/blob-store.d.ts +45 -2
- package/dist/core/worktree-snapshot/blob-store.js +228 -60
- package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
- package/dist/core/worktree-snapshot/errors.code.js +3 -3
- package/dist/core/worktree-snapshot/errors.impl.js +3 -3
- package/dist/core/worktree-snapshot/errors.js +3 -3
- package/dist/core/worktree-snapshot/fork-snapshot-index.js +121 -0
- package/dist/core/worktree-snapshot/fork-snapshot-index.js.map +1 -0
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
- package/dist/extensions/codemode/execute.code.js +3 -3
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.code.js +2 -2
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +3 -3
- package/dist/extensions/mcp/cli.impl.js +3 -3
- package/dist/extensions/mcp/cli.js +3 -3
- package/dist/extensions/mcp/cli.lazy.code.js +2 -2
- package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
- package/dist/extensions/mcp/cli.lazy.js +3 -3
- package/dist/extensions/mcp/runtime.code.js +1 -1
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index.js +8 -8
- package/dist/main-first-time-setup.code.js +2 -2
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/main.js +1 -1
- package/dist/modes/interactive/components/agent-panel.d.ts +1 -0
- package/dist/modes/interactive/components/stored-tree-view.code.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.js +3 -3
- package/dist/modes/interactive/components/task-inspector.d.ts +2 -0
- package/dist/modes/interactive/components/user-message-selector-archive.code.js +1 -1
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/modes/interactive/interactive-mode-helpers.d.ts +2 -2
- package/dist/modes/print-mode.js +1 -1
- package/dist/modes/rpc/agent-panel-bridge.d.ts +5 -0
- package/dist/package-manager-cli.code.js +7 -7
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/rpc-entry.js +1 -1
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/0.js +1 -1
- package/dist/startup-stages/1.js +1 -1
- package/dist/startup-stages/10.js +1 -1
- package/dist/startup-stages/12.js +1 -1
- package/dist/startup-stages/2.js +9 -1
- package/dist/startup-stages/3.js +1 -6
- package/dist/startup-stages/5.js +1 -1
- package/dist/startup-stages/7.js +1 -1
- package/dist/startup-stages/8.js +2 -2
- package/dist/utils/startup-database-spare.code.js +3 -3
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.code.js +1 -1
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/background-tasks.md +123 -23
- package/docs/compaction.md +18 -0
- package/docs/docs.json +2 -0
- package/docs/environment-variables.md +1 -1
- package/docs/getting-started/installation.md +9 -2
- package/docs/guides/postgres-pgbouncer.md +346 -0
- package/docs/guides/postgres-tuning.md +311 -0
- package/docs/guides/resume-on-any-machine.md +2 -2
- package/docs/guides.md +2 -0
- package/docs/index.md +1 -1
- package/docs/libraries/agent-core.md +1 -1
- package/docs/libraries/ai.md +2 -2
- package/docs/libraries/codemode.md +1 -1
- package/docs/libraries/storage-libsql.md +6 -1
- package/docs/libraries/storage-postgres.md +11 -6
- package/docs/libraries/tui.md +1 -1
- package/docs/libraries.md +2 -2
- package/docs/programmatic.md +1 -1
- package/docs/quickstart.md +1 -1
- package/docs/sdk/storage.md +1 -1
- package/docs/sdk/web-server.md +1 -3
- package/docs/sdk.md +1 -7
- package/docs/sessions.md +67 -2
- package/docs/settings.md +20 -1
- package/docs/skills/authoring.md +1 -1
- package/docs/skills.md +79 -6
- package/docs/storage.md +305 -14
- package/docs/subagents/reference.md +2 -2
- package/docs/subagents.md +4 -3
- package/docs/tools.md +44 -10
- package/docs/windows.md +1 -1
- package/package.json +9 -9
- package/dist/_shared/sdk-RRLVN7ER.js.map +0 -1
- package/dist/_shared/settings-startup-4QCVCI53.js.map +0 -1
- package/dist/_shared/startup-0-0-4VG2G44V.js.map +0 -1
- package/dist/_shared/startup-0-1-XTIL65D4.js.map +0 -1
- package/dist/_shared/startup-0-2-27OWFHV6.js.map +0 -1
- package/dist/_shared/startup-0-3-T4DVFYWX.js.map +0 -1
- package/dist/_shared/startup-0-5-FD2P735I.js.map +0 -1
- package/dist/_shared/startup-8-1-4KANEHRA.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { __commonJSMin, __name, __require } from "./rolldown-runtime-BGM3D5V3.js
|
|
|
2
2
|
import { APP_NAME, CONFIG_DIR_NAME, DiagnosticWriter, ENV_AGENT_DIR, ENV_TELEMETRY, NATIVES_VERSION, canonicalizePath as canonicalizePath$1, canonicalizePathAsync as canonicalizePathAsync$1, createModuleRequire, detectInstallChangeAsync, getAgentDir, getCwdRelativePath, getDocsPath, getEnvValue, getPackageDir, getPathComparisonKey, getSettingsPath, isBunBinary, isBunRuntime, isChildProcessExitStatusUnknownError, loadOnDemand, markNativeContainedChild, moduleDirFromMetaUrl, normalizePath as normalizePath$1, pathsEqual, requiredEntriesForBuiltin, resolvePath, shortenHomePath, stripBom } from "./p0-cli-BB45ZQY6.js";
|
|
3
3
|
import { clickableKeyTextHint, getGlobalTheme, navActionText, navFirstKeyText, renderNavHintLine, renderNavKeyOverlay, slashCommandHint, terminalDisplayText, theme } from "./p2-shell-main-B2WIALFD.js";
|
|
4
4
|
import { PROJECT_TRUST_DISTRUST_LABEL, PROJECT_TRUST_SESSION_DISTRUST_LABEL, REDACTED_PLACEHOLDER, applyRedactionRanges, findInCauseChain as findInCauseChain$1, hasErrorIdentity, isAsciiDigitCode, isAsciiHexCode, isAsciiLetterCode, isAsciiWordCode, isHorizontalWsCode, lockHolderPath, matchesAsciiCaseInsensitiveAt, prepareTakeoverMutex, processMayRun, processMayRunAsync, processStartToken, processStartTokenAsync, putBack, putBackAsync, readProcessStartToken, redactCredentialShapes, redactUrlCredentials, rehydrateErrorCause, releaseLock, removeAside, removeAsideAsync, removeLeftoverHolderFiles, removeLeftoverHolderFilesAsync, renameReplacing, renameReplacingAsync, scanBasicAuthEndAt, serializeErrorCause, skipHorizontalWs, stripAnsiWithOrigin, takeTakeoverMutex, takeTakeoverMutexAsync } from "./p1b-elig-ENCUPKKJ.js";
|
|
5
|
-
import { DecisionTimeoutError, SessionAlreadyOpenError } from "./settings-startup-
|
|
5
|
+
import { DecisionTimeoutError, SessionAlreadyOpenError } from "./settings-startup-HXQLSUWM.js";
|
|
6
6
|
import { SETTINGS_DEFAULTS } from "./p2-common-YLSYXMDQ.js";
|
|
7
7
|
import { isBuiltin } from "node:module";
|
|
8
8
|
import { lstat, mkdir, open, readFile, readdir, readlink, realpath, rename, rm, stat, unlink, utimes, writeFile } from "node:fs/promises";
|
|
@@ -2025,9 +2025,9 @@ function getPiUserAgent(version) {
|
|
|
2025
2025
|
}
|
|
2026
2026
|
// dist/core/async-scope.js
|
|
2027
2027
|
const storeKey = Symbol.for("atomic.async-scopes.v1");
|
|
2028
|
-
const host = globalThis;
|
|
2029
|
-
host[storeKey] ??= new AsyncLocalStorage();
|
|
2030
|
-
const scopes$2 = host[storeKey];
|
|
2028
|
+
const host$1 = globalThis;
|
|
2029
|
+
host$1[storeKey] ??= new AsyncLocalStorage();
|
|
2030
|
+
const scopes$2 = host$1[storeKey];
|
|
2031
2031
|
/**
|
|
2032
2032
|
* A value bound to the current async context. Atomic's scopes all live in one shared store, keyed by the scope. On
|
|
2033
2033
|
* Node before 24, AsyncLocalStorage runs on promise hooks: every store that has run stays in a process-wide list, and
|
|
@@ -2295,6 +2295,138 @@ function attachSessionClaim(sessionId) {
|
|
|
2295
2295
|
claim.attached = true;
|
|
2296
2296
|
return () => dropClaimAsync(sessionId, claim);
|
|
2297
2297
|
}
|
|
2298
|
+
// dist/core/storage/session/fork-segments.js
|
|
2299
|
+
function segmentLength(segment) {
|
|
2300
|
+
return segment.toSeq - segment.fromSeq + 1;
|
|
2301
|
+
}
|
|
2302
|
+
/** The view seq after the segment's last one. */
|
|
2303
|
+
function segmentEnd(segment) {
|
|
2304
|
+
return segment.baseSeq + segmentLength(segment);
|
|
2305
|
+
}
|
|
2306
|
+
/**
|
|
2307
|
+
* Throws unless `segments` are well formed for the view of session `sessionId`, of `length` seqs: each non-empty, within
|
|
2308
|
+
* the view, of another session, with its source rows from seq 1 on, in view order and disjoint, and each source's rows
|
|
2309
|
+
* in increasing order, so no stored row is read at two seqs of the view.
|
|
2310
|
+
*/
|
|
2311
|
+
function assertForkSegments(sessionId, segments, length) {
|
|
2312
|
+
let end = 0;
|
|
2313
|
+
const sourceEnds = /* @__PURE__ */ new Map();
|
|
2314
|
+
for (const segment of segments) {
|
|
2315
|
+
const { sourceId, fromSeq, toSeq, baseSeq } = segment;
|
|
2316
|
+
if (sourceId === sessionId || !Number.isSafeInteger(fromSeq) || !Number.isSafeInteger(toSeq) || !Number.isSafeInteger(baseSeq) || fromSeq < 1 || toSeq < fromSeq || baseSeq < end || segmentEnd(segment) > length || fromSeq <= (sourceEnds.get(sourceId) ?? 0)) throw new RangeError(`Invalid fork segment ${JSON.stringify(segment)} in a view of ${length} entries`);
|
|
2317
|
+
end = segmentEnd(segment);
|
|
2318
|
+
sourceEnds.set(sourceId, toSeq);
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
/**
|
|
2322
|
+
* The view seqs `fromSeq` through `toSeq` of session `sessionId` as runs stored in one place each, in view order: what a
|
|
2323
|
+
* read of that range reads, one statement a piece.
|
|
2324
|
+
*/
|
|
2325
|
+
function forkPieces(sessionId, segments, fromSeq, toSeq) {
|
|
2326
|
+
const pieces = [];
|
|
2327
|
+
let seq = fromSeq;
|
|
2328
|
+
let index = segments.findIndex((segment) => segmentEnd(segment) >= seq);
|
|
2329
|
+
if (index < 0) index = segments.length;
|
|
2330
|
+
while (seq <= toSeq) {
|
|
2331
|
+
const segment = segments[index];
|
|
2332
|
+
if (segment === void 0 || seq <= segment.baseSeq) {
|
|
2333
|
+
const last = Math.min(toSeq, segment === void 0 ? toSeq : segment.baseSeq);
|
|
2334
|
+
pieces.push({
|
|
2335
|
+
sessionId,
|
|
2336
|
+
fromSeq: seq,
|
|
2337
|
+
toSeq: last,
|
|
2338
|
+
firstSeq: seq
|
|
2339
|
+
});
|
|
2340
|
+
seq = last + 1;
|
|
2341
|
+
continue;
|
|
2342
|
+
}
|
|
2343
|
+
const last = Math.min(toSeq, segmentEnd(segment));
|
|
2344
|
+
if (last < seq) throw new RangeError(`Fork segments out of order at view seq ${seq}`);
|
|
2345
|
+
const offset = segment.fromSeq - segment.baseSeq - 1;
|
|
2346
|
+
pieces.push({
|
|
2347
|
+
sessionId: segment.sourceId,
|
|
2348
|
+
fromSeq: seq + offset,
|
|
2349
|
+
toSeq: last + offset,
|
|
2350
|
+
firstSeq: seq
|
|
2351
|
+
});
|
|
2352
|
+
seq = last + 1;
|
|
2353
|
+
index++;
|
|
2354
|
+
}
|
|
2355
|
+
return pieces;
|
|
2356
|
+
}
|
|
2357
|
+
/**
|
|
2358
|
+
* The segments a fork of session `parentId`, whose view has `parentLength` seqs and inherits `parent`, keeps when it
|
|
2359
|
+
* takes the parent's view seqs `fromSeq` through `toSeq` as its own view seqs from `baseSeq + 1` on: the parent's own rows
|
|
2360
|
+
* as segments of the parent, and its inherited rows as segments of their sources, so no source of the result inherits
|
|
2361
|
+
* the rows it names. Throws when the range is not in the parent's view.
|
|
2362
|
+
*/
|
|
2363
|
+
function forkRunSegments(parentId, parent, parentLength, run) {
|
|
2364
|
+
if (run.fromSeq < 1 || run.toSeq < run.fromSeq || run.toSeq > parentLength) throw new RangeError(`Fork run ${JSON.stringify(run)} is outside a parent view of ${parentLength} entries`);
|
|
2365
|
+
return forkPieces(parentId, parent, run.fromSeq, run.toSeq).map((piece) => ({
|
|
2366
|
+
sourceId: piece.sessionId,
|
|
2367
|
+
fromSeq: piece.fromSeq,
|
|
2368
|
+
toSeq: piece.toSeq,
|
|
2369
|
+
baseSeq: run.baseSeq + (piece.firstSeq - run.fromSeq)
|
|
2370
|
+
}));
|
|
2371
|
+
}
|
|
2372
|
+
/**
|
|
2373
|
+
* `segments` with each segment that continues the one before it in both its source and its view joined to it: the same
|
|
2374
|
+
* view in fewer segments.
|
|
2375
|
+
*/
|
|
2376
|
+
function joinForkSegments(segments) {
|
|
2377
|
+
const joined = [];
|
|
2378
|
+
for (const segment of segments) {
|
|
2379
|
+
const last = joined.at(-1);
|
|
2380
|
+
if (last !== void 0 && last.sourceId === segment.sourceId && last.toSeq + 1 === segment.fromSeq && segmentEnd(last) === segment.baseSeq) joined[joined.length - 1] = {
|
|
2381
|
+
...last,
|
|
2382
|
+
toSeq: segment.toSeq
|
|
2383
|
+
};
|
|
2384
|
+
else joined.push(segment);
|
|
2385
|
+
}
|
|
2386
|
+
return joined;
|
|
2387
|
+
}
|
|
2388
|
+
/** The segments of a fork that keeps the first `cut` seqs of a parent's view, as a prefix of its own view. */
|
|
2389
|
+
function prefixForkSegments(parentId, parent, parentLength, cut) {
|
|
2390
|
+
if (!Number.isSafeInteger(cut) || cut < 0 || cut > parentLength) throw new RangeError(`Fork cut ${cut} is outside a parent view of ${parentLength} entries`);
|
|
2391
|
+
return cut === 0 ? [] : forkRunSegments(parentId, parent, parentLength, {
|
|
2392
|
+
fromSeq: 1,
|
|
2393
|
+
toSeq: cut,
|
|
2394
|
+
baseSeq: 0
|
|
2395
|
+
});
|
|
2396
|
+
}
|
|
2397
|
+
// dist/core/storage/session/fork-errors.js
|
|
2398
|
+
/**
|
|
2399
|
+
* A fork could not be given its own copy of rows it shares (#6560): the session that stores them lacks one of them, or
|
|
2400
|
+
* one of the chunks of a large entry, so a copy would be corrupt. Nothing was written; the fork keeps reading the rows
|
|
2401
|
+
* where they are.
|
|
2402
|
+
*/
|
|
2403
|
+
var ForkSourceIncompleteError = class extends Error {
|
|
2404
|
+
/** The fork the copy was for. */
|
|
2405
|
+
sessionId;
|
|
2406
|
+
/** The session storing the rows, and the first of its seqs whose entry is missing or lacks a chunk. */
|
|
2407
|
+
sourceId;
|
|
2408
|
+
sourceSeq;
|
|
2409
|
+
constructor(sessionId, sourceId, sourceSeq) {
|
|
2410
|
+
super(`Cannot copy the history session ${sessionId} shares: entry ${sourceSeq} of session ${sourceId} is missing or lacks a chunk`);
|
|
2411
|
+
this.name = "ForkSourceIncompleteError";
|
|
2412
|
+
this.sessionId = sessionId;
|
|
2413
|
+
this.sourceId = sourceId;
|
|
2414
|
+
this.sourceSeq = sourceSeq;
|
|
2415
|
+
}
|
|
2416
|
+
};
|
|
2417
|
+
// dist/core/storage/session/shared-history-switch.js
|
|
2418
|
+
/** How old a marker's heartbeat may be while its process counts as running: four of its 15-second refreshes. */
|
|
2419
|
+
const MARKER_HEARTBEAT_STALE_MS = 6e4;
|
|
2420
|
+
let host = {
|
|
2421
|
+
live: async (marker) => marker.ageMs <= MARKER_HEARTBEAT_STALE_MS,
|
|
2422
|
+
skipped: () => {}
|
|
2423
|
+
};
|
|
2424
|
+
function setSharedHistorySwitchHost(next) {
|
|
2425
|
+
host = next;
|
|
2426
|
+
}
|
|
2427
|
+
function sharedHistorySwitchHost() {
|
|
2428
|
+
return host;
|
|
2429
|
+
}
|
|
2298
2430
|
// dist/core/worktree-snapshot/shared-clock.js
|
|
2299
2431
|
/**
|
|
2300
2432
|
* One clock for files several hosts share (#5050). A lease or lock is judged stale by how long ago its holder last
|
|
@@ -2876,16 +3008,6 @@ function cancelReasonText(result) {
|
|
|
2876
3008
|
if (result.cause === "execution-timeout" && result.executionTimeoutMs !== void 0) return `timed out after ${formatTimeoutSeconds(result.executionTimeoutMs)}`;
|
|
2877
3009
|
return CANCEL_CAUSE_TEXT[result.cause];
|
|
2878
3010
|
}
|
|
2879
|
-
/** The longest execution timeout a shell command may ask for, in seconds. */
|
|
2880
|
-
const MAX_COMMAND_TIMEOUT_SECONDS = 3600;
|
|
2881
|
-
/**
|
|
2882
|
-
* What to do about an execution timeout that is too short, for the text that names it (#4639). Advice to ask for a
|
|
2883
|
-
* larger timeout stops at the longest one, where the only way on is to split the run.
|
|
2884
|
-
*/
|
|
2885
|
-
function longerRunAdvice(timeoutMs, action) {
|
|
2886
|
-
if (timeoutMs !== void 0 && timeoutMs >= 36e5) return `${MAX_COMMAND_TIMEOUT_SECONDS} seconds is the longest timeout; split a longer run into shorter commands.`;
|
|
2887
|
-
return action === "launch" ? `launch it with a larger timeout (up to ${MAX_COMMAND_TIMEOUT_SECONDS} seconds) for a longer run.` : "run it again with a larger timeout.";
|
|
2888
|
-
}
|
|
2889
3011
|
// dist/core/storage/session/yield-turn.js
|
|
2890
3012
|
/** Let other tasks run between batches, including on hosts without setImmediate. */
|
|
2891
3013
|
function yieldTurn() {
|
|
@@ -4945,7 +5067,7 @@ function formatCodexProviderError(provider, errorMessage) {
|
|
|
4945
5067
|
// dist/core/defaults.js
|
|
4946
5068
|
const DEFAULT_THINKING_LEVEL = "medium";
|
|
4947
5069
|
// dist/core/model-resolver-defaults.js
|
|
4948
|
-
/**
|
|
5070
|
+
/** Preferred model IDs. Resolve them against the available catalog before selection. */
|
|
4949
5071
|
const defaultModelPerProvider = {
|
|
4950
5072
|
"amazon-bedrock": "us.anthropic.claude-opus-5-5",
|
|
4951
5073
|
anthropic: "claude-opus-5-5",
|
|
@@ -4991,12 +5113,32 @@ const defaultModelPerProvider = {
|
|
|
4991
5113
|
"xiaomi-token-plan-ams": "mimo-v2.6-pro",
|
|
4992
5114
|
"xiaomi-token-plan-sgp": "mimo-v2.6-pro"
|
|
4993
5115
|
};
|
|
5116
|
+
function findProviderDefaultModel(provider, availableModels) {
|
|
5117
|
+
if (!Object.hasOwn(defaultModelPerProvider, provider)) return void 0;
|
|
5118
|
+
const preferredId = defaultModelPerProvider[provider];
|
|
5119
|
+
const namespace = preferredId.split("/").slice(0, -1);
|
|
5120
|
+
let fallback;
|
|
5121
|
+
let bestSharedDepth = -1;
|
|
5122
|
+
for (const model of availableModels) {
|
|
5123
|
+
if (model.provider !== provider) continue;
|
|
5124
|
+
if (model.id === preferredId) return model;
|
|
5125
|
+
const modelNamespace = model.id.split("/").slice(0, -1);
|
|
5126
|
+
let sharedDepth = 0;
|
|
5127
|
+
while (sharedDepth < namespace.length && namespace[sharedDepth] === modelNamespace[sharedDepth]) sharedDepth++;
|
|
5128
|
+
if (!fallback || sharedDepth > bestSharedDepth || sharedDepth === bestSharedDepth && model.id < fallback.id) {
|
|
5129
|
+
fallback = model;
|
|
5130
|
+
bestSharedDepth = sharedDepth;
|
|
5131
|
+
}
|
|
5132
|
+
}
|
|
5133
|
+
return fallback;
|
|
5134
|
+
}
|
|
4994
5135
|
function findPreferredAvailableModel(availableModels) {
|
|
4995
5136
|
for (const [provider, defaultId] of Object.entries(defaultModelPerProvider)) {
|
|
4996
5137
|
const match = availableModels.find((m) => m.provider === provider && m.id === defaultId);
|
|
4997
5138
|
if (match) return match;
|
|
4998
5139
|
}
|
|
4999
|
-
|
|
5140
|
+
const first = availableModels[0];
|
|
5141
|
+
return first && (findProviderDefaultModel(first.provider, availableModels) ?? first);
|
|
5000
5142
|
}
|
|
5001
5143
|
// dist/utils/abort.js
|
|
5002
5144
|
/** Abort-signal helpers shared by the model runtime and its interactive callers. */
|
|
@@ -6173,6 +6315,8 @@ function isRetryableTaskError(error) {
|
|
|
6173
6315
|
}
|
|
6174
6316
|
return false;
|
|
6175
6317
|
}
|
|
6318
|
+
/** Why a command launch was refused at {@link MAX_LIVE_COMMANDS}, in the words the model and the user read. */
|
|
6319
|
+
const LIVE_COMMAND_LIMIT_MESSAGE = `64 commands are already running in this session, the most it runs at once. Stop one you no longer need with kill or /tasks, or wait for one to finish, then run this command again.`;
|
|
6176
6320
|
// dist/core/tasks/eviction-error.js
|
|
6177
6321
|
/**
|
|
6178
6322
|
* How many finished tasks one task owner (a session) keeps listed and readable. The native task
|
|
@@ -6752,6 +6896,18 @@ const BUNDLED_EXTENSION_SLASH_COMMANDS = commandList(BUNDLED_COMMAND_NAMES, [
|
|
|
6752
6896
|
description: "Manage llama.cpp router models"
|
|
6753
6897
|
}
|
|
6754
6898
|
]);
|
|
6899
|
+
// dist/utils/path-inside.js
|
|
6900
|
+
/**
|
|
6901
|
+
* Whether `child` is `parent` itself or a path below it.
|
|
6902
|
+
*
|
|
6903
|
+
* Only a relative path that is `..` or starts with `..` and a separator leaves `parent`, so a child named `..cache`
|
|
6904
|
+
* or `..notes.md` stays inside. On Windows, `relative` compares drive letters and names case-insensitively, and a
|
|
6905
|
+
* child on another drive or share yields an absolute path, which counts as outside.
|
|
6906
|
+
*/
|
|
6907
|
+
function isPathInside(parent, child, pathApi = path$2) {
|
|
6908
|
+
const relative = pathApi.relative(parent, child);
|
|
6909
|
+
return relative !== ".." && !relative.startsWith("../") && !relative.startsWith(`..${pathApi.sep}`) && !pathApi.isAbsolute(relative);
|
|
6910
|
+
}
|
|
6755
6911
|
// dist/core/storage/session/chat-records.js
|
|
6756
6912
|
function chatPosition(entry) {
|
|
6757
6913
|
return {
|
|
@@ -10041,6 +10197,24 @@ const PREVIEW_SIZE_BYTES = 2e3;
|
|
|
10041
10197
|
const MAX_PERSISTED_OUTPUT_BYTES = 67108864;
|
|
10042
10198
|
/** Appended in place of the content dropped at {@link MAX_PERSISTED_OUTPUT_BYTES}. */
|
|
10043
10199
|
const PERSISTED_OUTPUT_TRUNCATION_MARKER = `\n[Output truncated: persisted-output cap of ${MAX_PERSISTED_OUTPUT_BYTES} bytes reached]\n`;
|
|
10200
|
+
// dist/core/tools/shell-deadline.js
|
|
10201
|
+
/** Node's longest timer delay: a longer one fires at once. */
|
|
10202
|
+
const MAX_TIMER_DELAY_MS = 0x7fffffff;
|
|
10203
|
+
/**
|
|
10204
|
+
* Calls `expire` once `timeoutMs` has passed. A command's timeout has no maximum, so a deadline past Node's longest
|
|
10205
|
+
* timer is waited out in steps of it rather than firing at once. Returns the function that cancels it.
|
|
10206
|
+
*/
|
|
10207
|
+
function startShellDeadline(timeoutMs, expire) {
|
|
10208
|
+
let remaining = timeoutMs;
|
|
10209
|
+
let timer;
|
|
10210
|
+
const arm = () => {
|
|
10211
|
+
const step = Math.min(remaining, MAX_TIMER_DELAY_MS);
|
|
10212
|
+
remaining -= step;
|
|
10213
|
+
timer = setTimeout(remaining > 0 ? arm : expire, step);
|
|
10214
|
+
};
|
|
10215
|
+
arm();
|
|
10216
|
+
return () => clearTimeout(timer);
|
|
10217
|
+
}
|
|
10044
10218
|
// dist/core/tools/bash-session-environment.js
|
|
10045
10219
|
const SESSION_ENVIRONMENT_KEYS = [
|
|
10046
10220
|
"ATOMIC_SESSION_ID",
|
|
@@ -10978,18 +11152,6 @@ function keptTaskHint(action, route) {
|
|
|
10978
11152
|
const key = navActionText(getKeybindings(), "app.tasks.openWaited");
|
|
10979
11153
|
return key ? clickableKeyTextHint(key, " opens it") : void 0;
|
|
10980
11154
|
}
|
|
10981
|
-
// dist/utils/path-inside.js
|
|
10982
|
-
/**
|
|
10983
|
-
* Whether `child` is `parent` itself or a path below it.
|
|
10984
|
-
*
|
|
10985
|
-
* Only a relative path that is `..` or starts with `..` and a separator leaves `parent`, so a child named `..cache`
|
|
10986
|
-
* or `..notes.md` stays inside. On Windows, `relative` compares drive letters and names case-insensitively, and a
|
|
10987
|
-
* child on another drive or share yields an absolute path, which counts as outside.
|
|
10988
|
-
*/
|
|
10989
|
-
function isPathInside(parent, child, pathApi = path$2) {
|
|
10990
|
-
const relative = pathApi.relative(parent, child);
|
|
10991
|
-
return relative !== ".." && !relative.startsWith("../") && !relative.startsWith(`..${pathApi.sep}`) && !pathApi.isAbsolute(relative);
|
|
10992
|
-
}
|
|
10993
11155
|
// dist/core/tools/search-native.js
|
|
10994
11156
|
const __atomicDistModuleUrl$2 = new URL("../core/tools/search-native.js", import.meta.url).href;
|
|
10995
11157
|
let cachedLoadResult = null;
|
|
@@ -11012,7 +11174,7 @@ function invalidateNativeSearchCache(path) {
|
|
|
11012
11174
|
loadNativeSearchBinding()?.invalidateFsScanCache?.(path ?? null);
|
|
11013
11175
|
}
|
|
11014
11176
|
// dist/core/tools/sqlite-selector-connection.js
|
|
11015
|
-
const MISSING_NODE_SQLITE = "SQLite selectors need node:sqlite (Node >=
|
|
11177
|
+
const MISSING_NODE_SQLITE = "SQLite selectors need node:sqlite (Node >= 24.20.0 or Bun >= 1.4.2); this runtime does not provide it.";
|
|
11016
11178
|
const CONNECTION_SOURCE = `
|
|
11017
11179
|
${EVAL_WORKER_BUILTIN}
|
|
11018
11180
|
const { parentPort, workerData } = builtin("node:worker_threads");
|
|
@@ -11429,6 +11591,23 @@ function originalHistoryNote(line) {
|
|
|
11429
11591
|
return;
|
|
11430
11592
|
}
|
|
11431
11593
|
}
|
|
11594
|
+
// dist/core/storage/session/session-transactions.js
|
|
11595
|
+
/**
|
|
11596
|
+
* A write to the rows of the session `sessionId` of the sessions table `sessions`: on Postgres it is the only writer of
|
|
11597
|
+
* that session, while writers of other sessions run beside it; SQLite runs every write alone anyway. Every writer of a
|
|
11598
|
+
* session's rows names this one domain, whatever table it writes (the session store, its chat records, its search
|
|
11599
|
+
* index), so the checks each makes against the session's row hold until it commits. A transient failure runs it again
|
|
11600
|
+
* (#4383).
|
|
11601
|
+
*/
|
|
11602
|
+
function sessionWriteTransaction(sessions, sessionId) {
|
|
11603
|
+
return {
|
|
11604
|
+
retryTransientFailures: true,
|
|
11605
|
+
concurrency: {
|
|
11606
|
+
kind: "serial",
|
|
11607
|
+
domain: `${sessions}:${sessionId}`
|
|
11608
|
+
}
|
|
11609
|
+
};
|
|
11610
|
+
}
|
|
11432
11611
|
// dist/core/tools/history-transcript.js
|
|
11433
11612
|
const LINE_WIDTH = 4e3;
|
|
11434
11613
|
/** Splits one line into parts of at most `LINE_WIDTH` characters, preferring a space, so no character is lost. */
|
|
@@ -14326,19 +14505,19 @@ const NO_QUEUED_MESSAGES = Object.freeze({
|
|
|
14326
14505
|
steering: Object.freeze([]),
|
|
14327
14506
|
followUp: Object.freeze([])
|
|
14328
14507
|
});
|
|
14329
|
-
const sessions = /* @__PURE__ */ new WeakMap();
|
|
14508
|
+
const sessions$1 = /* @__PURE__ */ new WeakMap();
|
|
14330
14509
|
const listedWith = /* @__PURE__ */ new WeakMap();
|
|
14331
14510
|
/** Every delivery under way, whichever session it belongs to. */
|
|
14332
14511
|
const underWay = /* @__PURE__ */ new WeakSet();
|
|
14333
14512
|
/** The turn took `text` out of `session`'s `lane` queue; its `message_start` has not reached the listeners yet. */
|
|
14334
14513
|
function beginQueuedMessageDelivery(session, lane, text, receipt) {
|
|
14335
|
-
let deliveries = sessions.get(session);
|
|
14514
|
+
let deliveries = sessions$1.get(session);
|
|
14336
14515
|
if (deliveries === void 0) {
|
|
14337
14516
|
deliveries = {
|
|
14338
14517
|
taken: 0,
|
|
14339
14518
|
underWay: /* @__PURE__ */ new Map()
|
|
14340
14519
|
};
|
|
14341
|
-
sessions.set(session, deliveries);
|
|
14520
|
+
sessions$1.set(session, deliveries);
|
|
14342
14521
|
}
|
|
14343
14522
|
const delivery = {
|
|
14344
14523
|
lane,
|
|
@@ -14357,16 +14536,16 @@ function beginQueuedMessageDelivery(session, lane, text, receipt) {
|
|
|
14357
14536
|
*/
|
|
14358
14537
|
function endQueuedMessageDelivery(session, delivery) {
|
|
14359
14538
|
if (delivery === void 0) return;
|
|
14360
|
-
const deliveries = sessions.get(session);
|
|
14539
|
+
const deliveries = sessions$1.get(session);
|
|
14361
14540
|
if (deliveries?.underWay.get(delivery.order) !== delivery) return;
|
|
14362
14541
|
deliveries.underWay.delete(delivery.order);
|
|
14363
14542
|
deliveries.lanes = void 0;
|
|
14364
14543
|
underWay.delete(delivery);
|
|
14365
|
-
if (deliveries.underWay.size === 0) sessions.delete(session);
|
|
14544
|
+
if (deliveries.underWay.size === 0) sessions$1.delete(session);
|
|
14366
14545
|
}
|
|
14367
14546
|
/** Record with `event`, a `queue_update` `session` is about to send, which deliveries are under way now. */
|
|
14368
14547
|
function noteQueueUpdateDeliveries(session, event) {
|
|
14369
|
-
const deliveries = sessions.get(session);
|
|
14548
|
+
const deliveries = sessions$1.get(session);
|
|
14370
14549
|
if (deliveries !== void 0) listedWith.set(event, {
|
|
14371
14550
|
session: deliveries,
|
|
14372
14551
|
through: deliveries.taken
|
|
@@ -14396,7 +14575,7 @@ function queuedReceiptsUnderWay(listed, lane) {
|
|
|
14396
14575
|
* ends; {@link NO_QUEUED_MESSAGES} when none is under way.
|
|
14397
14576
|
*/
|
|
14398
14577
|
function queuedMessagesUnderWay(session) {
|
|
14399
|
-
const deliveries = sessions.get(session);
|
|
14578
|
+
const deliveries = sessions$1.get(session);
|
|
14400
14579
|
if (deliveries === void 0) return NO_QUEUED_MESSAGES;
|
|
14401
14580
|
deliveries.lanes ??= lanesOf(deliveries.underWay.values());
|
|
14402
14581
|
return deliveries.lanes;
|
|
@@ -15080,7 +15259,7 @@ function forkStoreRelation(source, target) {
|
|
|
15080
15259
|
if (!a || !b) return "unknown";
|
|
15081
15260
|
if (a.kind !== b.kind) return "different";
|
|
15082
15261
|
if (a.kind === "memory" && b.kind === "memory") return a.backing === b.backing ? "same" : "different";
|
|
15083
|
-
if (a.kind === "sql" && b.kind === "sql") return a.prefix.toLowerCase() !== b.prefix.toLowerCase() ? "different" : a.backing === b.backing ? "same" : "unknown";
|
|
15262
|
+
if (a.kind === "sql" && b.kind === "sql") return a.prefix.toLowerCase() !== b.prefix.toLowerCase() ? "different" : a.backing === b.backing || a.identity !== void 0 && a.identity === b.identity ? "same" : "unknown";
|
|
15084
15263
|
return "unknown";
|
|
15085
15264
|
}
|
|
15086
15265
|
// dist/core/storage/session/session-summary.js
|
|
@@ -18154,26 +18333,24 @@ function profileStacksBetween(profile, fromUs, untilUs) {
|
|
|
18154
18333
|
}
|
|
18155
18334
|
var ProfileSampler = class {
|
|
18156
18335
|
source = "profiler";
|
|
18157
|
-
|
|
18336
|
+
profileStartedEpochUs = 0;
|
|
18158
18337
|
observedUs;
|
|
18159
18338
|
queue = Promise.resolve();
|
|
18160
18339
|
collectionScheduled = false;
|
|
18161
18340
|
completed = [];
|
|
18162
18341
|
requests = [];
|
|
18163
18342
|
session;
|
|
18164
|
-
profileTimeOffsetUs;
|
|
18165
18343
|
constructor(session, nowUs) {
|
|
18166
18344
|
this.session = session;
|
|
18167
18345
|
this.observedUs = nowUs;
|
|
18168
|
-
this.profileTimeOffsetUs = isBunRuntime ? 0 : epochUs() - Number(process.hrtime.bigint() / 1000n);
|
|
18169
18346
|
session.post("Profiler.enable");
|
|
18170
18347
|
session.post("Profiler.setSamplingInterval", { interval: PROFILE_SAMPLING_INTERVAL_US });
|
|
18171
|
-
this.restart(
|
|
18348
|
+
this.restart();
|
|
18172
18349
|
}
|
|
18173
18350
|
beat(nowUs) {
|
|
18174
18351
|
this.observedUs = nowUs;
|
|
18175
18352
|
if (!this.collectionScheduled && this.requests.length === 0) this.releaseObservedProfiles();
|
|
18176
|
-
if (nowUs - this.
|
|
18353
|
+
if (nowUs - this.profileStartedEpochUs >= PROFILE_WINDOW_MS * 1e3) this.scheduleCollection();
|
|
18177
18354
|
}
|
|
18178
18355
|
stacksOf(sinceUs, untilUs) {
|
|
18179
18356
|
return new Promise((settle) => {
|
|
@@ -18191,9 +18368,16 @@ var ProfileSampler = class {
|
|
|
18191
18368
|
this.collectionScheduled = true;
|
|
18192
18369
|
this.queue = this.queue.then(async () => {
|
|
18193
18370
|
const batch = this.requests.splice(0);
|
|
18371
|
+
const profileStartedEpochUs = this.profileStartedEpochUs;
|
|
18194
18372
|
const profile = await this.stop();
|
|
18195
|
-
if (profile !== void 0)
|
|
18196
|
-
|
|
18373
|
+
if (profile !== void 0) {
|
|
18374
|
+
const epochOffsetUs = isBunRuntime ? 0 : profileStartedEpochUs - profile.startTime;
|
|
18375
|
+
this.completed.push({
|
|
18376
|
+
profile,
|
|
18377
|
+
epochOffsetUs
|
|
18378
|
+
});
|
|
18379
|
+
}
|
|
18380
|
+
for (const request of batch) request.settle(this.completed.flatMap(({ profile: profile2, epochOffsetUs }) => profileStacksBetween(profile2, request.sinceUs - epochOffsetUs, request.untilUs - epochOffsetUs)));
|
|
18197
18381
|
this.releaseObservedProfiles();
|
|
18198
18382
|
this.collectionScheduled = false;
|
|
18199
18383
|
if (this.requests.length > 0) this.scheduleCollection();
|
|
@@ -18201,10 +18385,10 @@ var ProfileSampler = class {
|
|
|
18201
18385
|
}
|
|
18202
18386
|
releaseObservedProfiles() {
|
|
18203
18387
|
const nextWindowUs = this.requests[0]?.sinceUs ?? this.observedUs + HEARTBEAT_MS * 1e3;
|
|
18204
|
-
this.completed = this.completed.filter((profile) => profile.endTime +
|
|
18388
|
+
this.completed = this.completed.filter(({ profile, epochOffsetUs }) => profile.endTime + epochOffsetUs >= nextWindowUs);
|
|
18205
18389
|
}
|
|
18206
|
-
restart(
|
|
18207
|
-
this.
|
|
18390
|
+
restart() {
|
|
18391
|
+
this.profileStartedEpochUs = epochUs();
|
|
18208
18392
|
this.session.post("Profiler.start");
|
|
18209
18393
|
}
|
|
18210
18394
|
stop() {
|
|
@@ -18214,11 +18398,11 @@ var ProfileSampler = class {
|
|
|
18214
18398
|
try {
|
|
18215
18399
|
profile = stopProfile.call(this.session, "Profiler.stop").profile;
|
|
18216
18400
|
} catch {}
|
|
18217
|
-
this.restart(
|
|
18401
|
+
this.restart();
|
|
18218
18402
|
return Promise.resolve(profile);
|
|
18219
18403
|
}
|
|
18220
18404
|
return new Promise((settle) => this.session.post("Profiler.stop", (error, result) => {
|
|
18221
|
-
this.restart(
|
|
18405
|
+
this.restart();
|
|
18222
18406
|
settle(error ? void 0 : result.profile);
|
|
18223
18407
|
}));
|
|
18224
18408
|
}
|
|
@@ -19635,16 +19819,261 @@ function isWindowsInstallDirectoryLockError(output) {
|
|
|
19635
19819
|
if (!(lower.includes("code ebusy") || lower.includes("ebusy:") || lower.includes("errno -4082") || lower.includes("code eperm") || lower.includes("eperm:") || lower.includes("errno -4048"))) return false;
|
|
19636
19820
|
return lower.includes("syscall rename") || lower.includes("syscall unlink") || lower.includes("syscall rmdir") || lower.includes("syscall rm") || lower.includes("syscall copyfile") || lower.includes(", rename ") || lower.includes(", unlink ") || lower.includes(", rmdir ") || lower.includes(", rm ") || lower.includes(", copyfile ") || lower.includes("resource busy or locked");
|
|
19637
19821
|
}
|
|
19638
|
-
export { ActivityWatchdog, AgentSessionBusyError, BLUEPRINT_CONTEXT_TYPE, BUILTIN_HELP_TOOL_NAMES, BUILTIN_PATH_PREFIX, BUILTIN_SLASH_COMMANDS, BUNDLED_EXTENSION_SLASH_COMMANDS, BlueprintBuildFailedError, BlueprintError, BlueprintInvalidError, BlueprintStepFailedError, BlueprintStepTimedOutError, BlueprintUsesUnsupportedError, CACHE_WARMING_MODES, COMMAND_DETAIL_TAIL_BYTES, COMMAND_FOREGROUND_BUDGET_MS, CONTINUE_AFTER_FAILURE, CURRENT_SESSION_VERSION, CompactionCancelledError, CompactionConfigError, CompactionError, CompactionStateError, CompactorFailure, CountdownTimer, DEFAULT_BUILTIN_SELECTION_EXTRA_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_MAX_RESULT_SIZE_CHARS, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_THINKING_LEVEL, Diff, DynamicBorder, ENGINE_UNRESPONSIVE_MS, EditInputError, EditMatchError, EditTargetError, EditToolError, EngineSessionStats, EntryTypeReader, EventSourceError, ExtensionStartupError, FILE_KINDS, FILE_PATTERNS, FINISHED_TASK_RETENTION, FORKED_PACKAGE_NAMES, FORKED_PACKAGE_WORKSPACE_DIRS, FileToolAbortedError, FramedSelector, GIT_LOCAL_ENV_VARS, GIT_MINIMUM_VERSION, GitProvisionConfigError, GitProvisionError, GitProvisionTimeoutError, GitUnavailableError, HOST, HOST_NOTICE_TYPE, HostInputBridge, HostListenerFailures, INTERACTIVE_MODEL_REFRESH_TIMEOUT_MS, InteractiveEngineResourceReadinessError, IntercomPolicyError, JSON_RPC_ERROR_CODES, JsonTextChecker, LATEST_PROTOCOL_VERSION, LONG_LIVED_COMMANDS, LlamaServerError, LlamaServerRequestError, LlamaServerUnreachableError, MAX_COMMAND_TIMEOUT_SECONDS, MAX_INTERCOM_REACHABLE_GROUPS, MAX_PERSISTED_OUTPUT_BYTES, MAX_POSITION_LENGTH, MAX_TOOL_DETACHMENT_AFTER_MS, ManagedToolDownloadError, ManagedToolError, ManagedToolTimeoutError, McpAbortError, McpConnectionClosedError, McpError, McpTimeoutError, Minimatch, MissingSessionCwdError, NETWORK_TIMEOUT_MS, NON_SECRET_HTTP_HEADERS, NO_QUEUED_MESSAGES, NativeModuleUnavailableError, PERSISTED_OUTPUT_CLOSING_TAG, PERSISTED_OUTPUT_TAG, PERSISTED_OUTPUT_TRUNCATION_MARKER, PLAIN_SELECTOR_STYLE, POST_LOGOUT_AUTH_CHECK_TIMEOUT_MS, PREVIEW_SIZE_BYTES, QueuedDeliveryRelay, QueuedDeliveryView, RESOURCE_TYPES, RESTART_CANCELLED_MESSAGE, ROW_INTENT_META, RawStdoutWriteError, SESSION_HISTORY_TOOL_NAME, STALE_EXTENSION_CONTEXT_MARKER, STALE_EXTENSION_CONTEXT_MESSAGE, STARTUP_DECISION_TYPED_TEXT_NOTICE, SUPPORTED_PROTOCOL_VERSIONS, Selector, SelectorState, SessionIntercomPolicy, ShellTimeoutError, ShellToolError, SqliteSelectorConnection, Stop, SubscriptionChildUnavailableError, SubscriptionClosedError, SubscriptionConfigError, SubscriptionError, SubscriptionEventError, SubscriptionHandlerError, SubscriptionRecordError, SubscriptionSetupError, SubscriptionSubscriberUnavailableError, SubscriptionTimeoutError, TASK_MARKS, THINKING_LEVELS, TOOL_DEACTIVATION_ENTRY_TYPE, TOOL_RESULTS_SUBDIR, TYPEBOX_SUBPATHS, TaskCleanupAdmissionTimeoutError, TaskCleanupError, TaskEvictedError, TaskMessageError, TaskMessageTimeoutError, ToolDetachmentError, TrustDecisionSelector, VALID_THINKING_LEVELS, VERBATIM_COMPACTION_STRATEGY, VisualLinePreview, WriteSelectorError, abandonedToolResult, abortFailure, abortSymbol, activeToolExecutionStarts, addHistoryUsageToTotals, addUsageToTotals, allToolNames, announceBlueprintBuildWaiting, announceHistoryLoad, applyBashSessionEnvironment, applyExifOrientation, applySessionSummaryEntries, areExperimentalFeaturesEnabled, armToolAbortGraceTimer, assertSessionCwdExists, assertToolPairingInvariant, assignMissingToolCallIds, asyncScope, attachCleanupCause, attachGitCleanupFailure, attachJsonlLineReader, attachLineReader, attachSessionClaim, awaitBlueprintReady, backgroundTaskScope, beginQueuedMessageDelivery, belongsToSession, bindChatEpoch, bindChatReceipt, bindReleasedTaskOwner, bindSavedReadLines, bindSavedTaskOrigins, bindSavedTaskRowKey, bindTaskResumer, blueprintBuildPending, blueprintBuildSettled, blueprintBuildShared, blueprintBuildsRunning, blueprintBuildsSettled, blueprintDigest, boundedChatRecord, buildBoundaryText, buildBoundaryTextWithLocation, cancelHeldInput, cancelReasonText, canonicalEventBusFor, captureHerdrEnvironment, carryDroppedQueuedMessages, carryRowSource, chatEpoch, chatPosition, chatReceipt, chatReceiptWrite, chatRecordSavesSettled, claimPaneReporting, claimSession, classifiedWorkflowMetadata, cleanupWindowsSelfUpdateQuarantine, clearAssignmentIfClosed, clearFunctionList, clearLockHolder, clearLockHolderAsync, clearToolAbortGraceTimer, collectDeclaredDisplaySecrets, collectSecretsForMasking, combineMany, combineManyMut, combineUsage, compactTemplate, compactUrl, completeStartup, computeBoxDimensions, confinedIntercomChildGroup, containProcessTree, containProcessTreeAllowingBreakaway, conventionDirsForResource, convertBufferWithMarkit, convertFileWithMarkit, copyHostQuestionnaire, createBatchedCanonicalizePathAsync, createConversationRegion, createEventBus, createGitEnvironment, createOwnedAbortController, createSourceInfo, createStagedEventBus, createSyntheticSourceInfo, createTypeScriptSourceSpecifierTransform, createUsageTotals, createWakeDispatcher, customMessageExcludesContext, decodeChatOrder, decodeChatRecord, deduplicateDiagnostics, defaultModelPerProvider, defaultToolNamesFor, deferDeprecationWarnings, defineTool, deserializeSubscriptionError, deserializeToolDetachmentError, detectSupportedImageMimeTypeFromFile, displayTodoId, drainAgentMessageQueue, earlierHeldInputs, emitProgress, encodeChatOrder, endQueuedMessageDelivery, entryLines, expandSearchUrl, experimentalToolSamplingProperty, extractHeaderSecrets, fListSymbol, fetchWithRetry, fieldTone, filterSearchOutputByLineRange, final, finalSymbol, finalValue, findBlueprintError, findCompactionError, findGitProvisionError, findLegacyWorkflowFiles, findLlamaServerError, findMissingSessionCwdIssue, findMissingSessionCwdIssueAsync, findPreferredAvailableModel, findSubscriptionError, findTaskEvictedError, findTaskMessageError, findToolDetachmentError, finishHeldInput, firstChatOrders, flushRawStdout, flushSymbol, flushable, forkScope, forkStoreRelation, forkedPackageExportAliases, formatCodexProviderError, formatMissingSessionCwdPrompt, formatNoApiKeyFoundMessage, formatNoModelSelectedMessage, formatNoModelsAvailableMessage, formatReadLineRange, formatSelectedLines, formatSize, formatTimeoutSeconds, formatTodoId, formatTokenCount, formatToolCallWithArgs, formatUnresolvedModelMessage, frozenClocks, getAllBuiltinPackageLocations, getBuiltinPackageLocations, getBuiltinPackagePaths, getDefaultCacheRetention, getDefaultSessionDir, getDefaultSessionDirAsync, getDefaultSessionDirPath, getEngineSessionStats, getErrnoCode, getFinalValue, getFunctionList, getHostQuestionnaire, getLockPath, getMandatoryBuiltinExtensionPaths, getManifestFromPackageJson, getManyValues, getMissingSessionCwdOptions, getPiUserAgent, getProviderLoginHelp, getResourcePathKey, getResourcePathKeyAsync, getSyntheticPathSource, getTextOutput, getTodoPath, getTodoStatus, getTodoTitle, getTodosDir, getTodosDirLabel, getToolExecutionStartedAt, getToolListError, handOverBuildTimings, handlePackageCommandParseOutcome, hasHeldInput, hasHistoryLoadObserver, hasNativeProcessHold, heldInputView, historySnapshotFor, holdDeprecationWarnings, holdProcessDescendants, holdProcessDescendantsResult, holdToolAbortGraceWhenObserved, holdToolsUntilBuilt, holdToolsUntilOwnerBuilt, holderRuns, hostInputError, hostNoticeForEvent, inheritForkScope, interactiveQuitOf, invalidArgText, invalidateNativeSearchCache, isAgentSessionBusyError, isBlueprintBuildFailedError, isBlueprintError, isBlueprintInvalidError, isBlueprintStepFailedError, isBlueprintStepTimedOutError, isBlueprintUsesUnsupportedError, isClassifiedWorkflowSession, isCodexTokenInvalidationError, isCompactionCancelledError, isCompactionConfigError, isCompactionError, isCompactionStateError, isCompactorFailure, isEditInputError, isEditMatchError, isEditTargetError, isEditToolError, isEventSourceError, isExtensionLoadError, isExtensionStartupFailure, isFileToolAbortedError, isFinalValue, isFlushable, isFunctionList, isGitProvisionConfigError, isGitProvisionError, isGitProvisionTimeoutError, isGitUnavailableError, isInstallTelemetryEnabled, isInteractiveEngineResourceReadinessError, isJsonRpcId, isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isLlamaServerError, isLlamaServerRequestError, isLlamaServerUnreachableError, isManagedToolDownloadError, isManagedToolError, isManagedToolTimeoutError, isMandatoryRuntimeTool, isMany, isMissingSessionCwdError, isObject, isPathInside, isReadResourceSelector, isReadableUrlPath, isRetryableCompactionError, isRetryableGitProvisionError, isRetryableLlamaServerError, isRetryableManagedToolError, isRetryableSubscriptionError, isRetryableTaskError, isRetryableTaskMessageError, isSensitiveKeyNameForMasking, isSerializedMissingSessionCwdError, isShellTimeoutError, isShellToolError, isSingleGenericAbortTextContent, isStaleExtensionContextError, isStdoutTakenOver, isStop, isSubscriptionChildUnavailableError, isSubscriptionClosedError, isSubscriptionConfigError, isSubscriptionError, isSubscriptionEventError, isSubscriptionHandlerError, isSubscriptionRecordError, isSubscriptionSetupError, isSubscriptionSubscriberUnavailableError, isSubscriptionTimeoutError, isSyntheticPath, isTaskCleanupAdmissionTimeoutError, isTaskCleanupError, isTaskEvictedError, isTaskMessageError, isTaskMessageTimeoutError, isTodoClosed, isToolDeactivationEntryData, isToolDetachmentError, isToolModifier, isTransientExtensionStartupFailure, isTrustDecision, isTrustedMandatoryRuntimeTool, isUnknownModel, isValidThinkingLevel, isWindowsInstallDirectoryLockError, isWriteSelectorError, keepDroppedQueuedMessages, keepsDroppedQueuedMessages, keptTaskHint, keptTaskId, leadingAndTrailingWs, leadingWs, legacyWorkflowFilePaths, legacyWorkflowFilePatterns, legacyWorkflowSection, linkPath, literalPathLike, loadConfig, loadNativeSearchBinding, loadShownDeprecationNotices, loadedConfig, lockShared, longerRunAdvice, longestCommonPrefix, longestCommonSuffix, many, manySymbol, markEventLoopShutdown, markEventLoopStartupComplete, markTrustedMandatoryRuntimeExtension, materializeSessionSummaryMetadata, maximumOverlap, mergeReadRanges, mergeSessionTrustDecisions, minimatch, modelCallUsage, nativeForkReader, nativeModuleProblem, nativeModuleUnavailable, noOpUIContext, none, normalizeDisplayText, normalizeInterruptAbortMessage, normalizeMany, normalizePathLikeInput, normalizeTodoId, noteQueueUpdateDeliveries, noteQueuedMessagesDropped, noteRowSource, noteSavedSeq, noteSnapshotGeneration, noteUserMessageOrigin, notifySessionProviderRequestDispatched, observeArchiveLoad, observeHistoryLoads, observeReferenceCut, observeToolExecutionTiming, omitLegacyThinkingSections, onBlueprintBuildFinished, onBlueprintBuildWaiting, onSessionProviderRequestDispatched, openAdapterSelectionDatabase, operationSignal, originalHistoryNote, outputExtensionLoadErrors, parseJsonRpcMessage, parsePackageCommand, parseSerializedCompactionError, parseSlashCommand, parseTranscriptFrameLayout, pendingProjectResourcesTrusted, placeTranscriptFrame, prepareLockTakeover, prepareSessionClaim, priorityHoldCounts, processTreeEnded, projectTrustHandlerRegistered, projectTrustWarningVisible, projectTrustedBeforeExtensions, providerOfModelReference, quarantineWindowsNativeDependencies, queueUpdateDeliveries, queuedMessagesUnderWay, queuedReceiptsUnderWay, queuedTextsUnderWay, quitAsInteractiveApp, raceWithAbortSignal, rawStdoutWriteFailed, readLedger, readLines, readPiManifestFile, readTaskOutputTail, receiveChatReceipt, recordLockHolder, recordLockHolderAsync, recordStartupThinkingLevel, redactAuthorizationUrlForDisplay, redactCredentials, redactOAuthErrorText, redactOAuthErrorTextCapped, redactUrlForDisplay, redactUrlForTransportDisplay, redactWwwAuthenticateHeader, referenceMetadataRead, refreshConfig, registerArchiveLoad, registerCanonicalEventBus, registerForkScope, registerHeldInput, registerHistorySnapshot, registerStartupRollback, rehydrateBlueprintError, rehydrateCompactionError, rehydrateEditToolError, rehydrateGitProvisionError, rehydrateLlamaServerError, rehydrateMissingSessionCwdError, rehydrateShellToolError, rehydrateTaskCleanupError, rehydrateTaskEvictedError, rehydrateTaskMessageError, rehydrateWriteSelectorError, releaseDeprecationWarnings, releasePaneReporting, releaseRetiredPaneReporting, releaseToolAbortGraceTimers, releaseTurnPause, releaseUnownedPaneRegistration, removePrefix, removeSuffix, removedProviderMessage, renderBlueprintContext, renderBorderedBox, renderToolPath, repairCollapsedScheme, replacePrefix, replaceSuffix, replaceTabs, replacementAbortContent, reportContained, reportPaneActivity, repositoryKey, require_applyReviver, require_constants, require_debug, require_errors, require_identifiers, require_identity, require_ignore, require_line_counter, require_parse_options, require_parse_url, require_resolve_end, require_resolve_props, require_sha256, require_stringifyComment, require_stringifyNumber, require_util_contains_newline, resolveDecisionDeadlineMs, resolvePhysicalPath, resolvePhysicalPathAsync, resolveSchemaRef, resourceInternals, restoreStdout, retirePaneReporting, retryStatusUpdate, rollbackStartup, rootKey, rowSource, rowTone, safeTrustChoiceIndex, sanitizeMcpServers, sanitizeOpenAIResponsesPayload, saveChatRecord, savedConversationThinkingLevel, savedReadLines, savedRowKey, savedRowSpan, savedSeqOf, savedTaskRowKey, savedTaskRows, scopedBackgroundTasks, scrubFetchError, scrubPreCompactionAssistantUsage, scrubUnknownErrorData, searchPosition, segment, selectExactReadRanges, selectReadRanges, selectorHintEntries, sentinelsToAppend, serializeBlueprintError, serializeCompactionError, serializeConversationForCompaction, serializeFileToolError, serializeJsonLine, serializeMissingSessionCwdError, serializeRetainedTranscript, serializeSessionMutation, serializeSubscriptionError, sessionIntercomFacade, sessionTasks, sessionWaitsToRetry, setDeprecationWarningSink, setFunctionList, setMarkitDiagnosticSink, settingsFileNoticeKey, settingsInternals, settleTurnPause, sha256Hex, shareBlueprintBuild, sharedClockNow, sharedWakeDispatcher, shortenPath, shouldRenderEngineDiagnosticAsChatError, shouldRunFirstTimeSetup, sleep, sliceHead, sliceTail, snapshotBashSessionEnvironment, sortTodos, spanElapsedMs, spawnContainedProcess, spawnHostProcess, splitLineRangeSelector, splitPathLikeGlob, splitReadLineSelector, splitTodosByAssignment, sqliteSessionResumeArgs, startEventLoopMonitor, startToolTimer, startupCleanupFailureMessage, startupProjectTrust, stop, stopBlueprintBuilds, stopErrorSymbol, stopWaiting, str, stringEntries, stripFenceMarkers, stripUrlUserinfoAndHash, styleFieldTone, summarizeSession, takeOverDeadHolder, takeOverDeadHolderAsync, takeOverStdout, takeQueuedDeliveryChange, takeQueuedMessagesDroppedAt, taskMark, taskOutcomeStatus, taskOutputText, taskResumer, taskSessionKey, taskStoppedForResume, themeSelectorStyle, thisProcess, timestamp, toError, toMany, toolAbortGraceMs, toolTimerText, trackChatRecordSave, trailingWs, transcriptHeaderLines, transcriptLayoutOf, truncateHead, truncateLine, truncateMiddle, truncateTail, truncateToVisualLines, uniquifyToolCallIds, updateLedger, usageCostBreakdown, userMessageOrigin, validQuestionnaire, validateGuidanceFields, validateIntercomSessionOptions, validateTimeoutOverride, validateTodoId, waitForEventLoopMonitorReady, waitForRawStdoutBackpressure, warnDeprecation, watchFirstProjectTrustHandler, watchReferenceCut, whenAborted, windowsTemporaryFiles, withCleanup, withFileMutationQueue, withInstallLock, withLegacyPackageNames, withProgress, withQueuedDeliveryChange, withResolvingFileMutationQueue, withToolAbortGrace, withinDecisionDeadline, workspaceKey, writeOutputFile, writeRawStdout, writeRawStdoutControl, writeRawStdoutOnce, yieldToEventLoop, yieldToEventLoopIfSlow, yieldToTimerTurn, yieldTurn };
|
|
19822
|
+
// dist/core/storage/session/stored-entries.js
|
|
19823
|
+
const PAGE_BITS = 8;
|
|
19824
|
+
/** The fewest seqs a page holds notes for: a short session's page grows as its seqs do. */
|
|
19825
|
+
const PAGE_MIN_SEQS = 8;
|
|
19826
|
+
/** Each session's notes, held weakly: the entries a read or write of them returned hold them. */
|
|
19827
|
+
const sessions = /* @__PURE__ */ new Map();
|
|
19828
|
+
/** The first entry of each read or write, holding the session's notes as long as it is held. */
|
|
19829
|
+
const holders = /* @__PURE__ */ new WeakMap();
|
|
19830
|
+
/** Batches whose fingerprints may still be to take, oldest first, from `next` on, and in the first, from `nextSeq`. */
|
|
19831
|
+
let unprinted = [];
|
|
19832
|
+
let next = 0;
|
|
19833
|
+
let nextSeq = 0;
|
|
19834
|
+
/** Whether a note was made since the background work last looked: the stores are not idle yet. */
|
|
19835
|
+
let notedSinceLook = false;
|
|
19836
|
+
let scheduled;
|
|
19837
|
+
/** The longest the background work holds the event loop at once. */
|
|
19838
|
+
const FINGERPRINT_SLICE_MS = 1;
|
|
19839
|
+
/** How long the stores must have noted nothing before fingerprints are taken: reads in a burst are not slowed. */
|
|
19840
|
+
const FINGERPRINT_IDLE_MS = 20;
|
|
19841
|
+
/** Batches waiting past which fingerprints are taken without waiting for the stores to go idle. */
|
|
19842
|
+
const FINGERPRINT_WAITING = 1e5;
|
|
19843
|
+
/** Characters fingerprinted between looks at the clock. */
|
|
19844
|
+
const FINGERPRINT_STRIDE = 16384;
|
|
19845
|
+
const OFFSET_A = -0x7ee3623b;
|
|
19846
|
+
const OFFSET_B = -0x61c88647;
|
|
19847
|
+
/** How far the fingerprint of the seq the background is in covers its JSON, and the fingerprint up to there. */
|
|
19848
|
+
let taken = 0;
|
|
19849
|
+
let takenA = OFFSET_A;
|
|
19850
|
+
let takenB = OFFSET_B;
|
|
19851
|
+
/**
|
|
19852
|
+
* Continues a 64-bit fingerprint, in two 32-bit halves, of `text` from `from` through `until`: not to keep anyone from
|
|
19853
|
+
* forging a match, only to tell an entry's JSON from another's. Each step of each half is a bijection of its state, so
|
|
19854
|
+
* an edit of one character always changes both; with the length, other JSON matches about once in 2^64.
|
|
19855
|
+
*/
|
|
19856
|
+
function fingerprintRange(text, a, b, from, until) {
|
|
19857
|
+
for (let index = from; index < until; index++) {
|
|
19858
|
+
const code = text.charCodeAt(index);
|
|
19859
|
+
a = Math.imul(a ^ code, 16777619);
|
|
19860
|
+
b = Math.imul(b ^ code, 0x5bd1e995);
|
|
19861
|
+
b = b << 13 | b >>> 19;
|
|
19862
|
+
}
|
|
19863
|
+
return [a, b];
|
|
19864
|
+
}
|
|
19865
|
+
function schedule(delayMs) {
|
|
19866
|
+
if (scheduled !== void 0) return;
|
|
19867
|
+
scheduled = setTimeout(takeFingerprints, delayMs);
|
|
19868
|
+
scheduled.unref?.();
|
|
19869
|
+
}
|
|
19870
|
+
function pageOf(notes, seq, make = false) {
|
|
19871
|
+
const index = seq >>> PAGE_BITS;
|
|
19872
|
+
let page = notes.pages[index];
|
|
19873
|
+
if (!make) return page;
|
|
19874
|
+
const slots = (seq & 255) + 1;
|
|
19875
|
+
if (page === void 0) {
|
|
19876
|
+
page = {
|
|
19877
|
+
prints: /* @__PURE__ */ new Int32Array(0),
|
|
19878
|
+
jsons: void 0,
|
|
19879
|
+
pending: 0
|
|
19880
|
+
};
|
|
19881
|
+
notes.pages[index] = page;
|
|
19882
|
+
}
|
|
19883
|
+
if (page.prints.length < slots * 3) {
|
|
19884
|
+
let size = Math.max(PAGE_MIN_SEQS, page.prints.length / 3);
|
|
19885
|
+
while (size < slots) size *= 2;
|
|
19886
|
+
const prints = new Int32Array(size * 3).fill(-1);
|
|
19887
|
+
prints.set(page.prints);
|
|
19888
|
+
page.prints = prints;
|
|
19889
|
+
}
|
|
19890
|
+
return page;
|
|
19891
|
+
}
|
|
19892
|
+
/** Takes the fingerprint of `seq` in `page` from `json`, `taken` characters of it done, as far as `until`. */
|
|
19893
|
+
function takeFingerprint(page, seq, json, until) {
|
|
19894
|
+
const end = Math.min(json.length, until);
|
|
19895
|
+
[takenA, takenB] = fingerprintRange(json, takenA, takenB, taken, end);
|
|
19896
|
+
taken = end;
|
|
19897
|
+
if (end < json.length) return;
|
|
19898
|
+
const slot = (seq & 255) * 3;
|
|
19899
|
+
page.prints[slot + 1] = takenA;
|
|
19900
|
+
page.prints[slot + 2] = takenB;
|
|
19901
|
+
page.jsons[seq & 255] = void 0;
|
|
19902
|
+
if (--page.pending === 0) page.jsons = void 0;
|
|
19903
|
+
taken = 0;
|
|
19904
|
+
takenA = OFFSET_A;
|
|
19905
|
+
takenB = OFFSET_B;
|
|
19906
|
+
}
|
|
19907
|
+
/** Takes the fingerprints waiting, one slice a turn, once the stores have been idle, or at once while too many wait. */
|
|
19908
|
+
function takeFingerprints() {
|
|
19909
|
+
scheduled = void 0;
|
|
19910
|
+
if (notedSinceLook && unprinted.length - next < FINGERPRINT_WAITING) {
|
|
19911
|
+
notedSinceLook = false;
|
|
19912
|
+
schedule(FINGERPRINT_IDLE_MS);
|
|
19913
|
+
return;
|
|
19914
|
+
}
|
|
19915
|
+
const until = performance.now() + FINGERPRINT_SLICE_MS;
|
|
19916
|
+
while (next < unprinted.length) {
|
|
19917
|
+
const batch = unprinted[next];
|
|
19918
|
+
const notes = batch.notes.deref();
|
|
19919
|
+
const seq = batch.seqs[nextSeq];
|
|
19920
|
+
const page = notes === void 0 || seq === void 0 ? void 0 : pageOf(notes, seq);
|
|
19921
|
+
const json = page?.jsons?.[seq & 255];
|
|
19922
|
+
if (json === void 0) {
|
|
19923
|
+
taken = 0;
|
|
19924
|
+
takenA = OFFSET_A;
|
|
19925
|
+
takenB = OFFSET_B;
|
|
19926
|
+
if (seq === void 0 || notes === void 0) {
|
|
19927
|
+
next++;
|
|
19928
|
+
nextSeq = 0;
|
|
19929
|
+
} else nextSeq++;
|
|
19930
|
+
continue;
|
|
19931
|
+
}
|
|
19932
|
+
takeFingerprint(page, seq, json, taken + FINGERPRINT_STRIDE);
|
|
19933
|
+
if (taken === 0) nextSeq++;
|
|
19934
|
+
if (performance.now() >= until) break;
|
|
19935
|
+
}
|
|
19936
|
+
if (next < unprinted.length) schedule(0);
|
|
19937
|
+
else {
|
|
19938
|
+
unprinted = [];
|
|
19939
|
+
next = 0;
|
|
19940
|
+
nextSeq = 0;
|
|
19941
|
+
for (const [sessionId, notes] of sessions) if (notes.deref() === void 0) sessions.delete(sessionId);
|
|
19942
|
+
}
|
|
19943
|
+
}
|
|
19944
|
+
/**
|
|
19945
|
+
* What notes the entries one read or write of store `owner` stores for session `sessionId` in generation `epoch`:
|
|
19946
|
+
* called with each entry, its seq and the JSON it was parsed from or encoded as.
|
|
19947
|
+
*/
|
|
19948
|
+
function storedEntryNotes(owner, sessionId, epoch) {
|
|
19949
|
+
let notes;
|
|
19950
|
+
let batch;
|
|
19951
|
+
return (entry, seq, json) => {
|
|
19952
|
+
if (notes === void 0) {
|
|
19953
|
+
notes = sessions.get(sessionId)?.deref();
|
|
19954
|
+
if (notes?.epoch !== epoch) {
|
|
19955
|
+
notes = {
|
|
19956
|
+
epoch,
|
|
19957
|
+
pages: []
|
|
19958
|
+
};
|
|
19959
|
+
sessions.set(sessionId, new WeakRef(notes));
|
|
19960
|
+
}
|
|
19961
|
+
holders.set(entry, notes);
|
|
19962
|
+
}
|
|
19963
|
+
const page = pageOf(notes, seq, true);
|
|
19964
|
+
const slot = seq & 255;
|
|
19965
|
+
if (page.prints[slot * 3] >= 0) return;
|
|
19966
|
+
page.prints[slot * 3] = json.length;
|
|
19967
|
+
page.jsons ??= [];
|
|
19968
|
+
page.jsons[slot] = json;
|
|
19969
|
+
page.pending++;
|
|
19970
|
+
if (batch === void 0) {
|
|
19971
|
+
batch = {
|
|
19972
|
+
owner,
|
|
19973
|
+
notes: new WeakRef(notes),
|
|
19974
|
+
seqs: []
|
|
19975
|
+
};
|
|
19976
|
+
unprinted.push(batch);
|
|
19977
|
+
notedSinceLook = true;
|
|
19978
|
+
schedule(unprinted.length - next >= FINGERPRINT_WAITING ? 0 : FINGERPRINT_IDLE_MS);
|
|
19979
|
+
}
|
|
19980
|
+
batch.seqs.push(seq);
|
|
19981
|
+
};
|
|
19982
|
+
}
|
|
19983
|
+
/** Drops the notes of store `owner` whose fingerprint is not taken yet, as it closes: their entries are copied. */
|
|
19984
|
+
function dropStoredNotes(owner) {
|
|
19985
|
+
for (let index = next; index < unprinted.length; index++) {
|
|
19986
|
+
const batch = unprinted[index];
|
|
19987
|
+
const notes = batch.owner === owner ? batch.notes.deref() : void 0;
|
|
19988
|
+
if (notes === void 0) continue;
|
|
19989
|
+
for (const seq of batch.seqs) {
|
|
19990
|
+
const page = pageOf(notes, seq);
|
|
19991
|
+
const slot = seq & 255;
|
|
19992
|
+
if (page?.jsons?.[slot] === void 0) continue;
|
|
19993
|
+
page.prints[slot * 3] = -1;
|
|
19994
|
+
page.jsons[slot] = void 0;
|
|
19995
|
+
if (--page.pending === 0) page.jsons = void 0;
|
|
19996
|
+
}
|
|
19997
|
+
}
|
|
19998
|
+
}
|
|
19999
|
+
/**
|
|
20000
|
+
* Where session `sessionId` stores entries in generation `epoch`, as far as this process read or wrote them: undefined
|
|
20001
|
+
* when it knows of none, so a fork with nothing to share looks at no entry.
|
|
20002
|
+
*/
|
|
20003
|
+
function storedRows(sessionId, epoch) {
|
|
20004
|
+
if (epoch === void 0) return void 0;
|
|
20005
|
+
const notes = sessions.get(sessionId)?.deref();
|
|
20006
|
+
return notes?.epoch === epoch ? new StoredRows(notes) : void 0;
|
|
20007
|
+
}
|
|
20008
|
+
/** See {@link storedRows}. */
|
|
20009
|
+
var StoredRows = class {
|
|
20010
|
+
notes;
|
|
20011
|
+
/** The seqs by the first half of their fingerprint, made when an entry is not where the one before it suggests. */
|
|
20012
|
+
bySeqPrint;
|
|
20013
|
+
constructor(notes) {
|
|
20014
|
+
this.notes = notes;
|
|
20015
|
+
}
|
|
20016
|
+
/**
|
|
20017
|
+
* The first seq after `after` at which the session stores `entry` unchanged, or undefined when it stores it at none
|
|
20018
|
+
* this process knows of. The seq right after `after` is looked at first: a fork carries its source's rows in order.
|
|
20019
|
+
*/
|
|
20020
|
+
seqOf(entry, after) {
|
|
20021
|
+
const json = JSON.stringify(entry);
|
|
20022
|
+
let print;
|
|
20023
|
+
const fingerprint = () => {
|
|
20024
|
+
print ??= fingerprintRange(json, OFFSET_A, OFFSET_B, 0, json.length);
|
|
20025
|
+
return print;
|
|
20026
|
+
};
|
|
20027
|
+
const at = (seq) => {
|
|
20028
|
+
const page = pageOf(this.notes, seq);
|
|
20029
|
+
if (page === void 0) return false;
|
|
20030
|
+
const slot = seq & 255;
|
|
20031
|
+
if (slot * 3 >= page.prints.length || page.prints[slot * 3] !== json.length) return false;
|
|
20032
|
+
const stored = page.jsons?.[slot];
|
|
20033
|
+
if (stored !== void 0) return stored === json;
|
|
20034
|
+
const [a, b] = fingerprint();
|
|
20035
|
+
return page.prints[slot * 3 + 1] === a && page.prints[slot * 3 + 2] === b;
|
|
20036
|
+
};
|
|
20037
|
+
if (at(after + 1)) return after + 1;
|
|
20038
|
+
const [a] = fingerprint();
|
|
20039
|
+
for (const seq of this.seqsByPrint().get(a) ?? []) if (seq > after && at(seq)) return seq;
|
|
20040
|
+
}
|
|
20041
|
+
/** {@link bySeqPrint}, every fingerprint of the session taken first. */
|
|
20042
|
+
seqsByPrint() {
|
|
20043
|
+
if (this.bySeqPrint !== void 0) return this.bySeqPrint;
|
|
20044
|
+
const index = /* @__PURE__ */ new Map();
|
|
20045
|
+
for (const [number, page] of this.notes.pages.entries()) {
|
|
20046
|
+
if (page === void 0) continue;
|
|
20047
|
+
for (let slot = 0; slot * 3 < page.prints.length; slot++) {
|
|
20048
|
+
if (page.prints[slot * 3] < 0) continue;
|
|
20049
|
+
const seq = (number << PAGE_BITS) + slot;
|
|
20050
|
+
const json = page.jsons?.[slot];
|
|
20051
|
+
if (json !== void 0) {
|
|
20052
|
+
taken = 0;
|
|
20053
|
+
takenA = OFFSET_A;
|
|
20054
|
+
takenB = OFFSET_B;
|
|
20055
|
+
takeFingerprint(page, seq, json, json.length);
|
|
20056
|
+
}
|
|
20057
|
+
const print = page.prints[slot * 3 + 1];
|
|
20058
|
+
const seqs = index.get(print);
|
|
20059
|
+
if (seqs === void 0) index.set(print, [seq]);
|
|
20060
|
+
else seqs.push(seq);
|
|
20061
|
+
}
|
|
20062
|
+
}
|
|
20063
|
+
this.bySeqPrint = index;
|
|
20064
|
+
return index;
|
|
20065
|
+
}
|
|
20066
|
+
};
|
|
20067
|
+
export { ActivityWatchdog, AgentSessionBusyError, BLUEPRINT_CONTEXT_TYPE, BUILTIN_HELP_TOOL_NAMES, BUILTIN_PATH_PREFIX, BUILTIN_SLASH_COMMANDS, BUNDLED_EXTENSION_SLASH_COMMANDS, BlueprintBuildFailedError, BlueprintError, BlueprintInvalidError, BlueprintStepFailedError, BlueprintStepTimedOutError, BlueprintUsesUnsupportedError, CACHE_WARMING_MODES, COMMAND_DETAIL_TAIL_BYTES, COMMAND_FOREGROUND_BUDGET_MS, CONTINUE_AFTER_FAILURE, CURRENT_SESSION_VERSION, CompactionCancelledError, CompactionConfigError, CompactionError, CompactionStateError, CompactorFailure, CountdownTimer, DEFAULT_BUILTIN_SELECTION_EXTRA_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_MAX_RESULT_SIZE_CHARS, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_THINKING_LEVEL, Diff, DynamicBorder, ENGINE_UNRESPONSIVE_MS, EditInputError, EditMatchError, EditTargetError, EditToolError, EngineSessionStats, EntryTypeReader, EventSourceError, ExtensionStartupError, FILE_KINDS, FILE_PATTERNS, FINISHED_TASK_RETENTION, FORKED_PACKAGE_NAMES, FORKED_PACKAGE_WORKSPACE_DIRS, FileToolAbortedError, ForkSourceIncompleteError, FramedSelector, GIT_LOCAL_ENV_VARS, GIT_MINIMUM_VERSION, GitProvisionConfigError, GitProvisionError, GitProvisionTimeoutError, GitUnavailableError, HOST, HOST_NOTICE_TYPE, HostInputBridge, HostListenerFailures, INTERACTIVE_MODEL_REFRESH_TIMEOUT_MS, InteractiveEngineResourceReadinessError, IntercomPolicyError, JSON_RPC_ERROR_CODES, JsonTextChecker, LATEST_PROTOCOL_VERSION, LIVE_COMMAND_LIMIT_MESSAGE, LONG_LIVED_COMMANDS, LlamaServerError, LlamaServerRequestError, LlamaServerUnreachableError, MAX_INTERCOM_REACHABLE_GROUPS, MAX_PERSISTED_OUTPUT_BYTES, MAX_POSITION_LENGTH, MAX_TOOL_DETACHMENT_AFTER_MS, ManagedToolDownloadError, ManagedToolError, ManagedToolTimeoutError, McpAbortError, McpConnectionClosedError, McpError, McpTimeoutError, Minimatch, MissingSessionCwdError, NETWORK_TIMEOUT_MS, NON_SECRET_HTTP_HEADERS, NO_QUEUED_MESSAGES, NativeModuleUnavailableError, PERSISTED_OUTPUT_CLOSING_TAG, PERSISTED_OUTPUT_TAG, PERSISTED_OUTPUT_TRUNCATION_MARKER, PLAIN_SELECTOR_STYLE, POST_LOGOUT_AUTH_CHECK_TIMEOUT_MS, PREVIEW_SIZE_BYTES, QueuedDeliveryRelay, QueuedDeliveryView, RESOURCE_TYPES, RESTART_CANCELLED_MESSAGE, ROW_INTENT_META, RawStdoutWriteError, SESSION_HISTORY_TOOL_NAME, STALE_EXTENSION_CONTEXT_MARKER, STALE_EXTENSION_CONTEXT_MESSAGE, STARTUP_DECISION_TYPED_TEXT_NOTICE, SUPPORTED_PROTOCOL_VERSIONS, Selector, SelectorState, SessionIntercomPolicy, ShellTimeoutError, ShellToolError, SqliteSelectorConnection, Stop, SubscriptionChildUnavailableError, SubscriptionClosedError, SubscriptionConfigError, SubscriptionError, SubscriptionEventError, SubscriptionHandlerError, SubscriptionRecordError, SubscriptionSetupError, SubscriptionSubscriberUnavailableError, SubscriptionTimeoutError, TASK_MARKS, THINKING_LEVELS, TOOL_DEACTIVATION_ENTRY_TYPE, TOOL_RESULTS_SUBDIR, TYPEBOX_SUBPATHS, TaskCleanupAdmissionTimeoutError, TaskCleanupError, TaskEvictedError, TaskMessageError, TaskMessageTimeoutError, ToolDetachmentError, TrustDecisionSelector, VALID_THINKING_LEVELS, VERBATIM_COMPACTION_STRATEGY, VisualLinePreview, WriteSelectorError, abandonedToolResult, abortFailure, abortSymbol, activeToolExecutionStarts, addHistoryUsageToTotals, addUsageToTotals, allToolNames, announceBlueprintBuildWaiting, announceHistoryLoad, applyBashSessionEnvironment, applyExifOrientation, applySessionSummaryEntries, areExperimentalFeaturesEnabled, armToolAbortGraceTimer, assertForkSegments, assertSessionCwdExists, assertToolPairingInvariant, assignMissingToolCallIds, asyncScope, attachCleanupCause, attachGitCleanupFailure, attachJsonlLineReader, attachLineReader, attachSessionClaim, awaitBlueprintReady, backgroundTaskScope, beginQueuedMessageDelivery, belongsToSession, bindChatEpoch, bindChatReceipt, bindReleasedTaskOwner, bindSavedReadLines, bindSavedTaskOrigins, bindSavedTaskRowKey, bindTaskResumer, blueprintBuildPending, blueprintBuildSettled, blueprintBuildShared, blueprintBuildsRunning, blueprintBuildsSettled, blueprintDigest, boundedChatRecord, buildBoundaryText, buildBoundaryTextWithLocation, cancelHeldInput, cancelReasonText, canonicalEventBusFor, captureHerdrEnvironment, carryDroppedQueuedMessages, carryRowSource, chatEpoch, chatPosition, chatReceipt, chatReceiptWrite, chatRecordSavesSettled, claimPaneReporting, claimSession, classifiedWorkflowMetadata, cleanupWindowsSelfUpdateQuarantine, clearAssignmentIfClosed, clearFunctionList, clearLockHolder, clearLockHolderAsync, clearToolAbortGraceTimer, collectDeclaredDisplaySecrets, collectSecretsForMasking, combineMany, combineManyMut, combineUsage, compactTemplate, compactUrl, completeStartup, computeBoxDimensions, confinedIntercomChildGroup, containProcessTree, containProcessTreeAllowingBreakaway, conventionDirsForResource, convertBufferWithMarkit, convertFileWithMarkit, copyHostQuestionnaire, createBatchedCanonicalizePathAsync, createConversationRegion, createEventBus, createGitEnvironment, createOwnedAbortController, createSourceInfo, createStagedEventBus, createSyntheticSourceInfo, createTypeScriptSourceSpecifierTransform, createUsageTotals, createWakeDispatcher, customMessageExcludesContext, decodeChatOrder, decodeChatRecord, deduplicateDiagnostics, defaultModelPerProvider, defaultToolNamesFor, deferDeprecationWarnings, defineTool, deserializeSubscriptionError, deserializeToolDetachmentError, detectSupportedImageMimeTypeFromFile, displayTodoId, drainAgentMessageQueue, dropStoredNotes, earlierHeldInputs, emitProgress, encodeChatOrder, endQueuedMessageDelivery, entryLines, expandSearchUrl, experimentalToolSamplingProperty, extractHeaderSecrets, fListSymbol, fetchWithRetry, fieldTone, filterSearchOutputByLineRange, final, finalSymbol, finalValue, findBlueprintError, findCompactionError, findGitProvisionError, findLegacyWorkflowFiles, findLlamaServerError, findMissingSessionCwdIssue, findMissingSessionCwdIssueAsync, findPreferredAvailableModel, findProviderDefaultModel, findSubscriptionError, findTaskEvictedError, findTaskMessageError, findToolDetachmentError, finishHeldInput, firstChatOrders, flushRawStdout, flushSymbol, flushable, forkRunSegments, forkScope, forkStoreRelation, forkedPackageExportAliases, formatCodexProviderError, formatMissingSessionCwdPrompt, formatNoApiKeyFoundMessage, formatNoModelSelectedMessage, formatNoModelsAvailableMessage, formatReadLineRange, formatSelectedLines, formatSize, formatTimeoutSeconds, formatTodoId, formatTokenCount, formatToolCallWithArgs, formatUnresolvedModelMessage, frozenClocks, getAllBuiltinPackageLocations, getBuiltinPackageLocations, getBuiltinPackagePaths, getDefaultCacheRetention, getDefaultSessionDir, getDefaultSessionDirAsync, getDefaultSessionDirPath, getEngineSessionStats, getErrnoCode, getFinalValue, getFunctionList, getHostQuestionnaire, getLockPath, getMandatoryBuiltinExtensionPaths, getManifestFromPackageJson, getManyValues, getMissingSessionCwdOptions, getPiUserAgent, getProviderLoginHelp, getResourcePathKey, getResourcePathKeyAsync, getSyntheticPathSource, getTextOutput, getTodoPath, getTodoStatus, getTodoTitle, getTodosDir, getTodosDirLabel, getToolExecutionStartedAt, getToolListError, handOverBuildTimings, handlePackageCommandParseOutcome, hasHeldInput, hasHistoryLoadObserver, hasNativeProcessHold, heldInputView, historySnapshotFor, holdDeprecationWarnings, holdProcessDescendants, holdProcessDescendantsResult, holdToolAbortGraceWhenObserved, holdToolsUntilBuilt, holdToolsUntilOwnerBuilt, holderRuns, hostInputError, hostNoticeForEvent, inheritForkScope, interactiveQuitOf, invalidArgText, invalidateNativeSearchCache, isAgentSessionBusyError, isBlueprintBuildFailedError, isBlueprintError, isBlueprintInvalidError, isBlueprintStepFailedError, isBlueprintStepTimedOutError, isBlueprintUsesUnsupportedError, isClassifiedWorkflowSession, isCodexTokenInvalidationError, isCompactionCancelledError, isCompactionConfigError, isCompactionError, isCompactionStateError, isCompactorFailure, isEditInputError, isEditMatchError, isEditTargetError, isEditToolError, isEventSourceError, isExtensionLoadError, isExtensionStartupFailure, isFileToolAbortedError, isFinalValue, isFlushable, isFunctionList, isGitProvisionConfigError, isGitProvisionError, isGitProvisionTimeoutError, isGitUnavailableError, isInstallTelemetryEnabled, isInteractiveEngineResourceReadinessError, isJsonRpcId, isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isLlamaServerError, isLlamaServerRequestError, isLlamaServerUnreachableError, isManagedToolDownloadError, isManagedToolError, isManagedToolTimeoutError, isMandatoryRuntimeTool, isMany, isMissingSessionCwdError, isObject, isPathInside, isReadResourceSelector, isReadableUrlPath, isRetryableCompactionError, isRetryableGitProvisionError, isRetryableLlamaServerError, isRetryableManagedToolError, isRetryableSubscriptionError, isRetryableTaskError, isRetryableTaskMessageError, isSensitiveKeyNameForMasking, isSerializedMissingSessionCwdError, isShellTimeoutError, isShellToolError, isSingleGenericAbortTextContent, isStaleExtensionContextError, isStdoutTakenOver, isStop, isSubscriptionChildUnavailableError, isSubscriptionClosedError, isSubscriptionConfigError, isSubscriptionError, isSubscriptionEventError, isSubscriptionHandlerError, isSubscriptionRecordError, isSubscriptionSetupError, isSubscriptionSubscriberUnavailableError, isSubscriptionTimeoutError, isSyntheticPath, isTaskCleanupAdmissionTimeoutError, isTaskCleanupError, isTaskEvictedError, isTaskMessageError, isTaskMessageTimeoutError, isTodoClosed, isToolDeactivationEntryData, isToolDetachmentError, isToolModifier, isTransientExtensionStartupFailure, isTrustDecision, isTrustedMandatoryRuntimeTool, isUnknownModel, isValidThinkingLevel, isWindowsInstallDirectoryLockError, isWriteSelectorError, joinForkSegments, keepDroppedQueuedMessages, keepsDroppedQueuedMessages, keptTaskHint, keptTaskId, leadingAndTrailingWs, leadingWs, legacyWorkflowFilePaths, legacyWorkflowFilePatterns, legacyWorkflowSection, linkPath, literalPathLike, loadConfig, loadNativeSearchBinding, loadShownDeprecationNotices, loadedConfig, lockShared, longestCommonPrefix, longestCommonSuffix, many, manySymbol, markEventLoopShutdown, markEventLoopStartupComplete, markTrustedMandatoryRuntimeExtension, materializeSessionSummaryMetadata, maximumOverlap, mergeReadRanges, mergeSessionTrustDecisions, minimatch, modelCallUsage, nativeForkReader, nativeModuleProblem, nativeModuleUnavailable, noOpUIContext, none, normalizeDisplayText, normalizeInterruptAbortMessage, normalizeMany, normalizePathLikeInput, normalizeTodoId, noteQueueUpdateDeliveries, noteQueuedMessagesDropped, noteRowSource, noteSavedSeq, noteSnapshotGeneration, noteUserMessageOrigin, notifySessionProviderRequestDispatched, observeArchiveLoad, observeHistoryLoads, observeReferenceCut, observeToolExecutionTiming, omitLegacyThinkingSections, onBlueprintBuildFinished, onBlueprintBuildWaiting, onSessionProviderRequestDispatched, openAdapterSelectionDatabase, operationSignal, originalHistoryNote, outputExtensionLoadErrors, parseJsonRpcMessage, parsePackageCommand, parseSerializedCompactionError, parseSlashCommand, parseTranscriptFrameLayout, pendingProjectResourcesTrusted, placeTranscriptFrame, prefixForkSegments, prepareLockTakeover, prepareSessionClaim, priorityHoldCounts, processTreeEnded, projectTrustHandlerRegistered, projectTrustWarningVisible, projectTrustedBeforeExtensions, providerOfModelReference, quarantineWindowsNativeDependencies, queueUpdateDeliveries, queuedMessagesUnderWay, queuedReceiptsUnderWay, queuedTextsUnderWay, quitAsInteractiveApp, raceWithAbortSignal, rawStdoutWriteFailed, readLedger, readLines, readPiManifestFile, readTaskOutputTail, receiveChatReceipt, recordLockHolder, recordLockHolderAsync, recordStartupThinkingLevel, redactAuthorizationUrlForDisplay, redactCredentials, redactOAuthErrorText, redactOAuthErrorTextCapped, redactUrlForDisplay, redactUrlForTransportDisplay, redactWwwAuthenticateHeader, referenceMetadataRead, refreshConfig, registerArchiveLoad, registerCanonicalEventBus, registerForkScope, registerHeldInput, registerHistorySnapshot, registerStartupRollback, rehydrateBlueprintError, rehydrateCompactionError, rehydrateEditToolError, rehydrateGitProvisionError, rehydrateLlamaServerError, rehydrateMissingSessionCwdError, rehydrateShellToolError, rehydrateTaskCleanupError, rehydrateTaskEvictedError, rehydrateTaskMessageError, rehydrateWriteSelectorError, releaseDeprecationWarnings, releasePaneReporting, releaseRetiredPaneReporting, releaseToolAbortGraceTimers, releaseTurnPause, releaseUnownedPaneRegistration, removePrefix, removeSuffix, removedProviderMessage, renderBlueprintContext, renderBorderedBox, renderToolPath, repairCollapsedScheme, replacePrefix, replaceSuffix, replaceTabs, replacementAbortContent, reportContained, reportPaneActivity, repositoryKey, require_applyReviver, require_constants, require_debug, require_errors, require_identifiers, require_identity, require_ignore, require_line_counter, require_parse_options, require_parse_url, require_resolve_end, require_resolve_props, require_sha256, require_stringifyComment, require_stringifyNumber, require_util_contains_newline, resolveDecisionDeadlineMs, resolvePhysicalPath, resolvePhysicalPathAsync, resolveSchemaRef, resourceInternals, restoreStdout, retirePaneReporting, retryStatusUpdate, rollbackStartup, rootKey, rowSource, rowTone, safeTrustChoiceIndex, sanitizeMcpServers, sanitizeOpenAIResponsesPayload, saveChatRecord, savedConversationThinkingLevel, savedReadLines, savedRowKey, savedRowSpan, savedSeqOf, savedTaskRowKey, savedTaskRows, scopedBackgroundTasks, scrubFetchError, scrubPreCompactionAssistantUsage, scrubUnknownErrorData, searchPosition, segment, segmentLength, selectExactReadRanges, selectReadRanges, selectorHintEntries, sentinelsToAppend, serializeBlueprintError, serializeCompactionError, serializeConversationForCompaction, serializeFileToolError, serializeJsonLine, serializeMissingSessionCwdError, serializeRetainedTranscript, serializeSessionMutation, serializeSubscriptionError, sessionIntercomFacade, sessionTasks, sessionWaitsToRetry, sessionWriteTransaction, setDeprecationWarningSink, setFunctionList, setMarkitDiagnosticSink, setSharedHistorySwitchHost, settingsFileNoticeKey, settingsInternals, settleTurnPause, sha256Hex, shareBlueprintBuild, sharedClockNow, sharedHistorySwitchHost, sharedWakeDispatcher, shortenPath, shouldRenderEngineDiagnosticAsChatError, shouldRunFirstTimeSetup, sleep, sliceHead, sliceTail, snapshotBashSessionEnvironment, sortTodos, spanElapsedMs, spawnContainedProcess, spawnHostProcess, splitLineRangeSelector, splitPathLikeGlob, splitReadLineSelector, splitTodosByAssignment, sqliteSessionResumeArgs, startEventLoopMonitor, startShellDeadline, startToolTimer, startupCleanupFailureMessage, startupProjectTrust, stop, stopBlueprintBuilds, stopErrorSymbol, stopWaiting, storedEntryNotes, storedRows, str, stringEntries, stripFenceMarkers, stripUrlUserinfoAndHash, styleFieldTone, summarizeSession, takeOverDeadHolder, takeOverDeadHolderAsync, takeOverStdout, takeQueuedDeliveryChange, takeQueuedMessagesDroppedAt, taskMark, taskOutcomeStatus, taskOutputText, taskResumer, taskSessionKey, taskStoppedForResume, themeSelectorStyle, thisProcess, timestamp, toError, toMany, toolAbortGraceMs, toolTimerText, trackChatRecordSave, trailingWs, transcriptHeaderLines, transcriptLayoutOf, truncateHead, truncateLine, truncateMiddle, truncateTail, truncateToVisualLines, uniquifyToolCallIds, updateLedger, usageCostBreakdown, userMessageOrigin, validQuestionnaire, validateGuidanceFields, validateIntercomSessionOptions, validateTimeoutOverride, validateTodoId, waitForEventLoopMonitorReady, waitForRawStdoutBackpressure, warnDeprecation, watchFirstProjectTrustHandler, watchReferenceCut, whenAborted, windowsTemporaryFiles, withCleanup, withFileMutationQueue, withInstallLock, withLegacyPackageNames, withProgress, withQueuedDeliveryChange, withResolvingFileMutationQueue, withToolAbortGrace, withinDecisionDeadline, workspaceKey, writeOutputFile, writeRawStdout, writeRawStdoutControl, writeRawStdoutOnce, yieldToEventLoop, yieldToEventLoopIfSlow, yieldToTimerTurn, yieldTurn };
|
|
19639
20068
|
|
|
19640
|
-
//# sourceMappingURL=startup-0-0-
|
|
20069
|
+
//# sourceMappingURL=startup-0-0-3IXNMFM2.js.map
|
|
19641
20070
|
// __atomicOnDemandFailed: written by the build (scripts/in-place-update-gate.mjs). An import of this release's code on
|
|
19642
20071
|
// demand that fails in a process an in-place update left running says to restart.
|
|
19643
20072
|
function __atomicOnDemandFailed(error, feature) {
|
|
19644
20073
|
return (async () => {
|
|
19645
20074
|
const root = new URL("../", import.meta.url);
|
|
19646
20075
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
19647
|
-
const key = `${root.href}#0.10.
|
|
20076
|
+
const key = `${root.href}#0.10.11-alpha.2`;
|
|
19648
20077
|
let release = releases.get(key);
|
|
19649
20078
|
if (release === undefined) {
|
|
19650
20079
|
const current = (async () => {
|
|
@@ -19672,7 +20101,7 @@ function __atomicOnDemandFailed(error, feature) {
|
|
|
19672
20101
|
} catch {
|
|
19673
20102
|
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
19674
20103
|
}
|
|
19675
|
-
const updatedTo = typeof installed === "string" && installed !== "0.10.
|
|
20104
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.11-alpha.2" ? installed : running !== undefined && running.version !== "0.10.11-alpha.2" ? "0.10.11-alpha.2" : undefined;
|
|
19676
20105
|
if (updatedTo === undefined) throw error;
|
|
19677
20106
|
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
19678
20107
|
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|