@bastani/atomic 0.10.19-alpha.1 → 0.10.20-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/dist/_shared/adapter-open-DXXV6ATH.js +22 -0
- package/dist/_shared/adapter-open-DXXV6ATH.js.map +1 -0
- 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-JXBZ3H27.js +439 -217
- package/dist/_shared/mode-interactive-sdk-JXBZ3H27.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +19 -11
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/mode-shared-2QJSCUM6.js +9 -9
- package/dist/_shared/p0-cli-BB45ZQY6.js +2 -2
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
- package/dist/_shared/runtime-O4KCSG4C.js +5 -5
- package/dist/_shared/{sdk-BHX35EPK.js → sdk-5ZFNDXUJ.js} +119 -40
- package/dist/_shared/sdk-5ZFNDXUJ.js.map +1 -0
- package/dist/_shared/session-data-AHTU7IS6.js +5 -4
- package/dist/_shared/session-data-AHTU7IS6.js.map +1 -1
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/settings-startup-HXQLSUWM.js.map +1 -1
- package/dist/_shared/{startup-0-0-4EDVBK5P.js → startup-0-0-FPPQF42L.js} +69 -26
- package/dist/_shared/startup-0-0-FPPQF42L.js.map +1 -0
- package/dist/_shared/{startup-0-1-H5IXVRXQ.js → startup-0-1-Q7GBLBEL.js} +158 -37
- package/dist/_shared/startup-0-1-Q7GBLBEL.js.map +1 -0
- package/dist/_shared/{startup-0-2-YZZOC22D.js → startup-0-2-JNYN24UI.js} +40 -6
- package/dist/_shared/startup-0-2-JNYN24UI.js.map +1 -0
- package/dist/_shared/startup-0-3-DE2NCS6A.js +26 -41
- package/dist/_shared/startup-0-3-DE2NCS6A.js.map +1 -1
- package/dist/_shared/{startup-0-4-ZMJV547D.js → startup-0-4-ZZXFKE55.js} +85 -19
- package/dist/_shared/startup-0-4-ZZXFKE55.js.map +1 -0
- package/dist/_shared/{startup-0-5-HZX3ZPTP.js → startup-0-5-WN2IYA25.js} +112 -15
- package/dist/_shared/startup-0-5-WN2IYA25.js.map +1 -0
- package/dist/_shared/{startup-10-0-TDQNBDDL.js → startup-10-0-O6DAT7U4.js} +65 -117
- package/dist/_shared/startup-10-0-O6DAT7U4.js.map +1 -0
- package/dist/_shared/startup-12-0-55AAXBJZ.js +2 -2
- package/dist/_shared/startup-14-0-MLX36RBG.js +8 -5
- package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
- package/dist/_shared/{startup-15-0-YUKGAC63.js → startup-15-0-E7RYG5YF.js} +8 -8
- package/dist/_shared/{startup-15-0-YUKGAC63.js.map → startup-15-0-E7RYG5YF.js.map} +1 -1
- package/dist/_shared/startup-15-1-WQZBOTMZ.js +73 -28
- package/dist/_shared/startup-15-1-WQZBOTMZ.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +31 -21
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/startup-8-1-QZMXUGHI.js +34 -24
- package/dist/_shared/startup-8-1-QZMXUGHI.js.map +1 -1
- package/dist/_shared/storage-command-7MGXLJGZ.js +9 -5
- package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
- package/dist/_shared/{storage-status-K7PX2RXA.js → storage-status-T6FUXRIM.js} +7 -23
- package/dist/_shared/{storage-status-K7PX2RXA.js.map → storage-status-T6FUXRIM.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/team-DOQKICG2.js +3 -2
- package/dist/_shared/team-DOQKICG2.js.map +1 -1
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/binary-self-update.js +47 -18
- package/dist/binary-self-update.js.map +1 -1
- package/dist/builtin/intercom/index.bundle.mjs +1 -1
- 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 +15 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
- 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 +5 -5
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +3 -3
- 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 +3 -3
- 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 +2 -2
- 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-runtime.d.ts +2 -1
- 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 +44 -41
- package/dist/core/export-html/index.code.js.map +1 -1
- 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 +1 -1
- 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/template.js +12 -25
- package/dist/core/export-html/tool-renderer.code.js +1 -1
- 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/context-types.d.ts +3 -0
- package/dist/core/extensions/context-types.js.map +1 -1
- 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.d.ts +1 -0
- package/dist/core/extensions/runner-context.js +17 -1
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runtime-types.d.ts +1 -0
- package/dist/core/extensions/runtime-types.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 +2 -2
- package/dist/core/model-runtime-streaming.d.ts +3 -1
- package/dist/core/model-runtime.d.ts +2 -0
- 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 +3 -3
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.d.ts +4 -0
- package/dist/core/session-manager-core.js +46 -18
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-history.d.ts +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 +2 -2
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/settings-manager.js +1 -1
- package/dist/core/storage/adapter-open.js +3 -0
- package/dist/core/storage/adapter-open.js.map +1 -0
- package/dist/core/storage/index.js +2 -2
- package/dist/core/storage/node-sqlite-thread.js +2 -2
- package/dist/core/storage/node-sqlite.js +2 -2
- 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.js +1 -0
- package/dist/core/storage/prefix.js.map +1 -1
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +2 -2
- 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 +7 -7
- package/dist/core/storage/session/child-reader.code.js.map +1 -1
- package/dist/core/storage/session/child-reader.d.ts +1 -0
- 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/expanded-child-details.code.js +3 -3
- 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-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-staging.code.js +2 -2
- 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-window.code.js +5 -4
- package/dist/core/storage/session/fork-window.code.js.map +1 -1
- 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.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.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/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 +3 -3
- 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-session-store.code.js +1 -1
- package/dist/core/storage/session/sql-session-store.d.ts +3 -17
- package/dist/core/storage/session/sql-session-store.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- 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 +2 -0
- package/dist/core/storage/session/usage-observations.d.ts +27 -0
- package/dist/core/storage/session/usage-observations.js +3 -0
- package/dist/core/storage/session/usage-observations.js.map +1 -0
- 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.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/subscription-usage-identity.d.ts +9 -0
- package/dist/core/subscription-usage-observations.d.ts +15 -0
- package/dist/core/subscription-usage-storage.js +3 -0
- package/dist/core/subscription-usage-storage.js.map +1 -0
- package/dist/core/subscription-usage.d.ts +20 -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 +3 -3
- 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 +4 -4
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.code.js +1 -1
- 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.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/read-url.code.js +2 -2
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.js +2 -2
- 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/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 +2 -2
- 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.d.ts +1 -1
- 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/modes/interactive/components/stored-tree-view.code.js +2 -2
- 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/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-engine/isolated-runtime.d.ts +1 -0
- package/dist/modes/interactive-engine/protocol.d.ts +4 -0
- package/dist/modes/print-mode.js +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +5 -0
- package/dist/package-manager-cli.code.js +6 -6
- 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/10.js +1 -1
- package/dist/startup-stages/4.js +1 -1
- package/dist/startup-stages/6.js +1 -1
- package/dist/startup-stages/7.js +1 -1
- package/dist/startup-stages/8.js +1 -1
- 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/changelog.mdx +31 -3
- package/docs/extensions/api-reference.md +6 -0
- package/docs/getting-started/installation.md +3 -3
- package/docs/guides/subscription-usage.md +28 -82
- package/docs/reference/cli.md +4 -2
- package/docs/rpc/protocol.md +30 -2
- package/docs/sdk/reference.md +26 -1
- package/docs/sessions.md +3 -1
- package/docs/slash-commands.md +1 -1
- package/docs/usage.md +1 -1
- package/package.json +8 -8
- package/dist/_shared/sdk-BHX35EPK.js.map +0 -1
- package/dist/_shared/startup-0-0-4EDVBK5P.js.map +0 -1
- package/dist/_shared/startup-0-1-H5IXVRXQ.js.map +0 -1
- package/dist/_shared/startup-0-2-YZZOC22D.js.map +0 -1
- package/dist/_shared/startup-0-4-ZMJV547D.js.map +0 -1
- package/dist/_shared/startup-0-5-HZX3ZPTP.js.map +0 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __name } from "./rolldown-runtime-BGM3D5V3.js";
|
|
2
2
|
import { createModuleRequire, createSessionCwdMatcher, normalizePath, resolvePath } from "./p0-cli-BB45ZQY6.js";
|
|
3
|
-
import { CURRENT_SESSION_VERSION, EntryTypeReader, JsonTextChecker, applySessionSummaryEntries, bindChatEpoch, boundedChatRecord, decodeChatRecord, epochHasCreationTime, fileEpochOf, firstChatOrders, getErrnoCode, historySnapshotFor, inheritForkScope, isBetterMostRecentCandidate, isClassifiedWorkflowSession, legacyFileEpochOf, markPreferResumableSupported, materializeSessionSummaryMetadata, noteSnapshotGeneration, observeReferenceCut, referenceMetadataRead, registerArchiveLoad, registerForkScope, require_sha256, sha256Hex, summarizeSession, supportsPreferResumable, yieldTurn } from "./startup-0-0-
|
|
4
|
-
import { AgentRehydrateError, AgentReleaseConfigError, SessionKeyDigests, appendFileChatRecords, deleteFileChatRecords, hasFileChatRecords, latestLegacyMessageTime, legacyCompletionTarget, readFileChatOrders, readFileChatRecords, rememberEarlierCompletion, summarizeLegacySession } from "./startup-0-1-
|
|
5
|
-
import { agentWakeDispatcher } from "./startup-0-2-
|
|
3
|
+
import { CURRENT_SESSION_VERSION, EntryTypeReader, JsonTextChecker, LaterSessionParents, applySessionSummaryEntries, bindChatEpoch, boundedChatRecord, decodeChatRecord, epochHasCreationTime, fileEpochOf, firstChatOrders, getErrnoCode, historySnapshotFor, inheritForkScope, isBetterMostRecentCandidate, isClassifiedWorkflowSession, isEarlierSessionEntry, legacyFileEpochOf, markPreferResumableSupported, materializeSessionSummaryMetadata, noteSnapshotGeneration, observeReferenceCut, parentIdInEarlierRows, referenceMetadataRead, registerArchiveLoad, registerForkScope, require_sha256, sha256Hex, summarizeSession, supportsPreferResumable, walkSessionParents, yieldTurn } from "./startup-0-0-FPPQF42L.js";
|
|
4
|
+
import { AgentRehydrateError, AgentReleaseConfigError, SessionKeyDigests, appendFileChatRecords, deleteFileChatRecords, hasFileChatRecords, latestLegacyMessageTime, legacyCompletionTarget, readFileChatOrders, readFileChatRecords, rememberEarlierCompletion, setUsageObservationStore, summarizeLegacySession, usageObservationStore } from "./startup-0-1-Q7GBLBEL.js";
|
|
5
|
+
import { agentWakeDispatcher } from "./startup-0-2-JNYN24UI.js";
|
|
6
6
|
import { SESSION_HISTORY_CHUNK_BYTES, SESSION_HISTORY_PAGE_BYTES, SESSION_HISTORY_SCAN_ENTRIES, SessionIdError, entrySizeLimit, matchesSessionIdPrefix, onlySeqs, yieldSessionTurn } from "./settings-startup-HXQLSUWM.js";
|
|
7
7
|
import { access, copyFile, link, mkdir, open, readFile, readdir, rename, stat, truncate, unlink, writeFile } from "node:fs/promises";
|
|
8
8
|
import { closeSync, existsSync, openSync, readSync, readdirSync, statSync } from "fs";
|
|
@@ -549,21 +549,18 @@ function addStatePosition(positions, entry, seq) {
|
|
|
549
549
|
positions.lastStateSeq = seq;
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
function foldSessionResume(previous, entries, seqOf = () => void 0, activeSeq) {
|
|
552
|
+
function foldSessionResume(previous, entries, seqOf = () => void 0, activeSeq, unresolvedParents = new LaterSessionParents()) {
|
|
553
553
|
if (previous === void 0 && activeSeq === void 0 && entries.length > 0) {
|
|
554
554
|
const ids = new Map(entries.map((entry, i) => [entry.id, {
|
|
555
555
|
entry,
|
|
556
556
|
seq: i + 1
|
|
557
557
|
}]));
|
|
558
558
|
const last = entries.at(-1);
|
|
559
|
-
|
|
559
|
+
const entryOf = (id) => ids.get(id)?.entry;
|
|
560
|
+
const positionOf = (id) => ids.get(id)?.seq;
|
|
561
|
+
const leaf = last.type === "custom" && last.customType === LEAF_MOVE_TYPE ? last.parentId === null || last.parentId === last.id ? void 0 : entryOf(last.parentId) : last;
|
|
560
562
|
const active = /* @__PURE__ */ new Set();
|
|
561
|
-
|
|
562
|
-
const held = ids.get(leaf);
|
|
563
|
-
if (!held || active.has(held.seq)) break;
|
|
564
|
-
active.add(held.seq);
|
|
565
|
-
leaf = held.entry.parentId;
|
|
566
|
-
}
|
|
563
|
+
for (const entry of walkSessionParents(leaf, entryOf, positionOf)) active.add(positionOf(entry.id));
|
|
567
564
|
activeSeq = (seq) => active.has(seq);
|
|
568
565
|
}
|
|
569
566
|
const protocols = new ResumeProtocols(previous);
|
|
@@ -581,11 +578,14 @@ function foldSessionResume(previous, entries, seqOf = () => void 0, activeSeq) {
|
|
|
581
578
|
let latestAssistantSeq = previous?.latestAssistantSeq;
|
|
582
579
|
const extensionState = previous === void 0 ? [] : previous.extensionState && [...previous.extensionState];
|
|
583
580
|
let needsBranchRebuild = previous?.needsBranchRebuild ?? false;
|
|
581
|
+
let damagedHistoryLinks = previous !== void 0 && resumeHasDamagedHistoryLinks(previous);
|
|
584
582
|
const own = new Map(lastId === null ? [] : [[lastId, seq]]);
|
|
585
583
|
const resolve = (id) => typeof id === "string" ? own.get(id) ?? seqOf(id) ?? -1 : -1;
|
|
586
584
|
for (const entry of entries) {
|
|
587
|
-
const parentSeq = entry.parentId === null ? 0 : resolve(entry.parentId);
|
|
588
585
|
seq++;
|
|
586
|
+
const resolvedParent = resolve(entry.parentId);
|
|
587
|
+
const parentSeq = entry.parentId === null ? 0 : isEarlierSessionEntry(resolvedParent, seq) ? resolvedParent : -1;
|
|
588
|
+
if (!damagedHistoryLinks && (resolvedParent >= seq || unresolvedParents.note(entry, parentSeq > 0))) damagedHistoryLinks = true;
|
|
589
589
|
if (parentSeq !== seq - 1) {
|
|
590
590
|
if (previous !== void 0 && activeSeq === void 0) needsBranchRebuild = true;
|
|
591
591
|
const last = jumps.at(-1);
|
|
@@ -630,6 +630,7 @@ function foldSessionResume(previous, entries, seqOf = () => void 0, activeSeq) {
|
|
|
630
630
|
}
|
|
631
631
|
return {
|
|
632
632
|
version: RESUME_INDEX_VERSION,
|
|
633
|
+
damagedHistoryLinks,
|
|
633
634
|
...needsBranchRebuild ? { needsBranchRebuild: true } : {},
|
|
634
635
|
epoch: previous?.epoch ?? crypto.randomUUID(),
|
|
635
636
|
...protocols.serialize(),
|
|
@@ -655,7 +656,7 @@ const isObject = (value) => value !== null && typeof value === "object" && !Arra
|
|
|
655
656
|
function isUpgradableSessionResumeIndex(value, lastSeq) {
|
|
656
657
|
if (!isObject(value) || false) return false;
|
|
657
658
|
const index = value;
|
|
658
|
-
return index.version === UPGRADABLE_RESUME_INDEX_VERSION && !index.needsBranchRebuild && typeof index.epoch === "string" && index.seq === lastSeq && typeof index.leafSeq === "number" && Array.isArray(index.jumps) && Array.isArray(index.compactions) && Array.isArray(index.intents) && Array.isArray(index.acks) && typeof index.state === "string" && typeof index.lastStateSeq === "number" && isObject(index.totals) && isObject(index.latest) && Array.isArray(index.admissions) && index.admissions.every((key) => typeof key === "string") && Array.isArray(index.delivered) && Array.isArray(index.deliveryOps) && Array.isArray(index.settled) && isObject(index.pending) && isObject(index.parks) && Array.isArray(index.models) && Array.isArray(index.assistants);
|
|
659
|
+
return index.version === UPGRADABLE_RESUME_INDEX_VERSION && !index.needsBranchRebuild && typeof index.epoch === "string" && index.seq === lastSeq && typeof index.leafSeq === "number" && Array.isArray(index.jumps) && index.jumps.every((jump) => jump?.[2] >= 0) && Array.isArray(index.compactions) && Array.isArray(index.intents) && Array.isArray(index.acks) && typeof index.state === "string" && typeof index.lastStateSeq === "number" && isObject(index.totals) && isObject(index.latest) && Array.isArray(index.admissions) && index.admissions.every((key) => typeof key === "string") && Array.isArray(index.delivered) && Array.isArray(index.deliveryOps) && Array.isArray(index.settled) && isObject(index.pending) && isObject(index.parks) && Array.isArray(index.models) && Array.isArray(index.assistants);
|
|
659
660
|
}
|
|
660
661
|
/** Custom entries outside the branch state whose positions or records the upgrade derives again. */
|
|
661
662
|
const UPGRADED_CUSTOM_TYPES = /* @__PURE__ */ new Set([
|
|
@@ -716,6 +717,7 @@ function sessionResumeUpgrade(previous) {
|
|
|
716
717
|
finish() {
|
|
717
718
|
return {
|
|
718
719
|
version: RESUME_INDEX_VERSION,
|
|
720
|
+
damagedHistoryLinks: resumeHasDamagedHistoryLinks(previous),
|
|
719
721
|
epoch: previous.epoch,
|
|
720
722
|
...protocols.serialize(),
|
|
721
723
|
models: previous.models,
|
|
@@ -735,10 +737,13 @@ function sessionResumeUpgrade(previous) {
|
|
|
735
737
|
}
|
|
736
738
|
};
|
|
737
739
|
}
|
|
740
|
+
function resumeHasDamagedHistoryLinks(index) {
|
|
741
|
+
return index.damagedHistoryLinks ?? index.jumps.some(([child, , parent]) => parent >= child);
|
|
742
|
+
}
|
|
738
743
|
function isSessionResumeIndex(value, lastSeq) {
|
|
739
744
|
if (value === null || typeof value !== "object") return false;
|
|
740
745
|
const index = value;
|
|
741
|
-
return index.version === RESUME_INDEX_VERSION && index.childAliases != null && typeof index.childAliases === "object" && !index.needsBranchRebuild && typeof index.admissions === "string" && Array.isArray(index.deliveryOps) && typeof index.epoch === "string" && index.seq === lastSeq && typeof index.leafSeq === "number" && Array.isArray(index.jumps) && Array.isArray(index.compactions) && Array.isArray(index.intents) && Array.isArray(index.acks) && typeof index.state === "string" && typeof index.lastStateSeq === "number" && typeof index.settingsHistory === "string" && typeof index.lastSettingSeq === "number" && typeof index.snapshotRefs === "string" && typeof index.lastSnapshotRef === "number" && typeof index.snapshotHeads === "object" && index.snapshotHeads !== null && Array.isArray(index.snapshotPins) && typeof index.snapshotRecords === "object" && index.snapshotRecords !== null && typeof index.totals === "object" && index.totals !== null && Array.isArray(index.extensionState) && index.extensionState.every((seq) => Number.isSafeInteger(seq) && seq > 0 && seq <= lastSeq);
|
|
746
|
+
return index.version === RESUME_INDEX_VERSION && index.childAliases != null && typeof index.childAliases === "object" && !index.needsBranchRebuild && typeof index.admissions === "string" && Array.isArray(index.deliveryOps) && typeof index.epoch === "string" && index.seq === lastSeq && typeof index.leafSeq === "number" && Array.isArray(index.jumps) && (typeof index.damagedHistoryLinks === "boolean" || index.jumps.every((jump) => jump?.[2] >= 0)) && Array.isArray(index.compactions) && Array.isArray(index.intents) && Array.isArray(index.acks) && typeof index.state === "string" && typeof index.lastStateSeq === "number" && typeof index.settingsHistory === "string" && typeof index.lastSettingSeq === "number" && typeof index.snapshotRefs === "string" && typeof index.lastSnapshotRef === "number" && typeof index.snapshotHeads === "object" && index.snapshotHeads !== null && Array.isArray(index.snapshotPins) && typeof index.snapshotRecords === "object" && index.snapshotRecords !== null && typeof index.totals === "object" && index.totals !== null && Array.isArray(index.extensionState) && index.extensionState.every((seq) => Number.isSafeInteger(seq) && seq > 0 && seq <= lastSeq);
|
|
742
747
|
}
|
|
743
748
|
function branchJump(jumps, high) {
|
|
744
749
|
let lowest = 0;
|
|
@@ -791,7 +796,7 @@ function transcriptBranchSpan(sessionId, index, cut) {
|
|
|
791
796
|
newer = true;
|
|
792
797
|
}
|
|
793
798
|
const next = !jump ? 0 : high > jump[1] ? jump[1] : jump[2];
|
|
794
|
-
if (next
|
|
799
|
+
if (!isEarlierSessionEntry(next, high)) break;
|
|
795
800
|
high = next;
|
|
796
801
|
}
|
|
797
802
|
return candidate;
|
|
@@ -813,7 +818,7 @@ function branchRanges(index, leafSeq) {
|
|
|
813
818
|
continue;
|
|
814
819
|
}
|
|
815
820
|
ranges.push([high, high]);
|
|
816
|
-
if (parentSeq
|
|
821
|
+
if (!isEarlierSessionEntry(parentSeq, high)) break;
|
|
817
822
|
high = parentSeq;
|
|
818
823
|
}
|
|
819
824
|
return ranges;
|
|
@@ -1180,6 +1185,7 @@ function sessionResumeFrom(index, header, branch, state, leafId, deferred = [])
|
|
|
1180
1185
|
lastEntryId: index.lastId,
|
|
1181
1186
|
epoch: index.epoch,
|
|
1182
1187
|
leafId,
|
|
1188
|
+
...resumeHasDamagedHistoryLinks(index) ? { damagedHistoryLinks: true } : {},
|
|
1183
1189
|
...boundary?.type === "compaction" && plan.compaction && leafId ? { compaction: {
|
|
1184
1190
|
...plan.compaction,
|
|
1185
1191
|
entry: boundary,
|
|
@@ -6016,6 +6022,7 @@ var JsonlSessionStore = class JsonlSessionStore {
|
|
|
6016
6022
|
catalog
|
|
6017
6023
|
});
|
|
6018
6024
|
const ids = /* @__PURE__ */ new Map();
|
|
6025
|
+
const unresolvedParents = new LaterSessionParents();
|
|
6019
6026
|
let batch = [];
|
|
6020
6027
|
let batchBytes = 0;
|
|
6021
6028
|
let extraToolCalls = 0;
|
|
@@ -6028,7 +6035,7 @@ var JsonlSessionStore = class JsonlSessionStore {
|
|
|
6028
6035
|
else activeLabels.delete(entry.targetId);
|
|
6029
6036
|
} else if (isForkCatalogType(entry.type)) catalog.push([seq, entry.type]);
|
|
6030
6037
|
}
|
|
6031
|
-
index = foldSessionResume(index, batch, (id) => ids.get(id), activeSeq);
|
|
6038
|
+
index = foldSessionResume(index, batch, (id) => ids.get(id), activeSeq, unresolvedParents);
|
|
6032
6039
|
if (extraToolCalls) index = withToolCalls(index, extraToolCalls);
|
|
6033
6040
|
batch = [];
|
|
6034
6041
|
batchBytes = 0;
|
|
@@ -6062,6 +6069,7 @@ var JsonlSessionStore = class JsonlSessionStore {
|
|
|
6062
6069
|
}
|
|
6063
6070
|
}
|
|
6064
6071
|
async catchUp(path, cached, stats, kept, reportTorn = true) {
|
|
6072
|
+
if (!cached.index.damagedHistoryLinks && cached.index.jumps.some((jump) => jump[2] < 0)) return void 0;
|
|
6065
6073
|
const from = cached.size - cached.witness.length;
|
|
6066
6074
|
if (Number(stats.size) - from > SCAN_WINDOW_BYTES$1) return this.streamCatchUp(path, cached, stats, kept, reportTorn);
|
|
6067
6075
|
const bytes = await readBytes(path, from, Number(stats.size) - from, kept);
|
|
@@ -8432,10 +8440,11 @@ var MemorySessionStore = class MemorySessionStore {
|
|
|
8432
8440
|
let index = foldSessionResume(void 0, []);
|
|
8433
8441
|
let extra = 0;
|
|
8434
8442
|
const positions = /* @__PURE__ */ new Map();
|
|
8443
|
+
const unresolvedParents = new LaterSessionParents();
|
|
8435
8444
|
for await (const page of branchStatePages(held.lastSeq, source, (count) => {
|
|
8436
8445
|
extra += count;
|
|
8437
8446
|
})) {
|
|
8438
|
-
index = foldSessionResume(index, page.map((row) => row.entry), (id) => positions.get(id), () => true);
|
|
8447
|
+
index = foldSessionResume(index, page.map((row) => row.entry), (id) => positions.get(id), () => true, unresolvedParents);
|
|
8439
8448
|
for (const { seq, entry } of page) positions.set(entry.id, seq);
|
|
8440
8449
|
}
|
|
8441
8450
|
positions.clear();
|
|
@@ -9867,7 +9876,7 @@ async function archivedAnswerAt(store, id, epoch, through, firstSeq, parent, edi
|
|
|
9867
9876
|
};
|
|
9868
9877
|
} else entry = await (await import("../core/storage/session/chunked-resume-projection.code.js").catch((error) => __atomicOnDemandFailed(error, "session storage"))).chunkedAnswerHeader(chunks(item));
|
|
9869
9878
|
if (entry.id !== parent) continue;
|
|
9870
|
-
parent = entry
|
|
9879
|
+
parent = parentIdInEarlierRows(entry);
|
|
9871
9880
|
if (entry.targetId !== void 0 && !latest.has(entry.targetId)) latest.set(entry.targetId, item.seq);
|
|
9872
9881
|
if (entry.type === "message" && entry.role === "assistant") {
|
|
9873
9882
|
const edited = latest.get(entry.id);
|
|
@@ -9913,6 +9922,7 @@ var LegacySessionStore = class LegacySessionStore {
|
|
|
9913
9922
|
readBranchSnapshotMetadata;
|
|
9914
9923
|
constructor(inner, options) {
|
|
9915
9924
|
this.inner = inner;
|
|
9925
|
+
setUsageObservationStore(this, usageObservationStore(inner));
|
|
9916
9926
|
this.legacyDirectory = options.legacyDirectory;
|
|
9917
9927
|
this.databasePath = options.databasePath;
|
|
9918
9928
|
if (supportsPreferResumable(inner)) markPreferResumableSupported(this);
|
|
@@ -10292,7 +10302,7 @@ function __atomicOnDemandFailed(error, feature) {
|
|
|
10292
10302
|
return (async () => {
|
|
10293
10303
|
const root = new URL("../", import.meta.url);
|
|
10294
10304
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
10295
|
-
const key = `${root.href}#0.10.
|
|
10305
|
+
const key = `${root.href}#0.10.20-alpha.1`;
|
|
10296
10306
|
let release = releases.get(key);
|
|
10297
10307
|
if (release === undefined) {
|
|
10298
10308
|
const current = (async () => {
|
|
@@ -10320,7 +10330,7 @@ function __atomicOnDemandFailed(error, feature) {
|
|
|
10320
10330
|
} catch {
|
|
10321
10331
|
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
10322
10332
|
}
|
|
10323
|
-
const updatedTo = typeof installed === "string" && installed !== "0.10.
|
|
10333
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.20-alpha.1" ? installed : running !== undefined && running.version !== "0.10.20-alpha.1" ? "0.10.20-alpha.1" : undefined;
|
|
10324
10334
|
if (updatedTo === undefined) throw error;
|
|
10325
10335
|
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
10326
10336
|
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|