@bastani/atomic 0.10.4-alpha.2 → 0.10.4
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 +194 -0
- package/dist/_shared/chunk-CDOYTDYM.js +4 -0
- package/dist/_shared/chunk-CDOYTDYM.js.map +1 -0
- package/dist/_shared/fork-row-index-UAUAQRD5.js +1 -1
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +2 -2
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +1 -1
- package/dist/_shared/mode-shared-HP7GUA7J.js +4 -4
- package/dist/_shared/sdk-WQIOHVKO.js +1 -1
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/sql-session-store-5FD3WBMZ.js +9 -9
- package/dist/_shared/startup-0-0-X4NF3GKM.js +9 -5
- package/dist/_shared/startup-0-0-X4NF3GKM.js.map +1 -1
- package/dist/_shared/startup-0-2-KFDYPDJK.js +1 -1
- package/dist/_shared/startup-0-3-T4DVFYWX.js +2 -2
- package/dist/_shared/startup-0-4-HN5EB4K7.js +1 -1
- package/dist/_shared/startup-0-5-OHJNE6JH.js +3 -3
- package/dist/_shared/startup-10-0-TDQNBDDL.js +3 -3
- package/dist/_shared/startup-15-1-4S7FLMNG.js +14 -14
- package/dist/_shared/startup-8-0-34CBHPZH.js +23 -23
- package/dist/_shared/startup-8-1-KQJBDKRU.js +12 -12
- package/dist/_shared/storage-command-7MGXLJGZ.js +4 -4
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +1 -1
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +38 -0
- 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 +40 -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/CHANGELOG.md +12 -0
- package/dist/builtin/web-access/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/auth-cli.impl.js +1102 -0
- package/dist/cli/auth-cli.impl.js.map +1 -0
- package/dist/cli/auth-cli.js +28 -1098
- package/dist/cli/auth-cli.js.map +1 -1
- package/dist/cli/blueprint-command.impl.js +906 -0
- package/dist/cli/blueprint-command.impl.js.map +1 -0
- package/dist/cli/blueprint-command.js +27 -901
- package/dist/cli/blueprint-command.js.map +1 -1
- package/dist/cli/intercom-command.impl.js +108 -0
- package/dist/cli/intercom-command.impl.js.map +1 -0
- package/dist/cli/intercom-command.js +29 -105
- package/dist/cli/intercom-command.js.map +1 -1
- package/dist/cli/list-models.impl.js +60 -0
- package/dist/cli/list-models.impl.js.map +1 -0
- package/dist/cli/list-models.js +29 -57
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/session-picker.impl.js +55 -0
- package/dist/cli/session-picker.impl.js.map +1 -0
- package/dist/cli/session-picker.js +30 -53
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/startup-ui.impl.js +5 -0
- package/dist/cli/startup-ui.impl.js.map +1 -0
- package/dist/cli/startup-ui.js +31 -4
- package/dist/cli/storage-command.impl.js +3 -0
- package/dist/cli/storage-command.impl.js.map +1 -0
- package/dist/cli/storage-command.js +31 -2
- package/dist/cli/storage-search-session.impl.js +189 -0
- package/dist/cli/storage-search-session.impl.js.map +1 -0
- package/dist/cli/storage-search-session.js +29 -186
- package/dist/cli/storage-search-session.js.map +1 -1
- package/dist/cli/team-command.impl.js +217 -0
- package/dist/cli/team-command.impl.js.map +1 -0
- package/dist/cli/team-command.js +29 -214
- package/dist/cli/team-command.js.map +1 -1
- package/dist/core/debug.impl.js +3 -0
- package/dist/core/debug.impl.js.map +1 -0
- package/dist/core/debug.js +31 -2
- package/dist/core/export-html/card-projection.impl.js +257 -0
- package/dist/core/export-html/card-projection.impl.js.map +1 -0
- package/dist/core/export-html/card-projection.js +30 -255
- package/dist/core/export-html/card-projection.js.map +1 -1
- package/dist/core/export-html/index.impl.js +610 -0
- package/dist/core/export-html/index.impl.js.map +1 -0
- package/dist/core/export-html/index.js +28 -606
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/json-spans.impl.js +3 -0
- package/dist/core/export-html/json-spans.impl.js.map +1 -0
- package/dist/core/export-html/json-spans.js +31 -2
- package/dist/core/export-html/oversized-render-inputs.impl.js +125 -0
- package/dist/core/export-html/oversized-render-inputs.impl.js.map +1 -0
- package/dist/core/export-html/oversized-render-inputs.js +28 -121
- package/dist/core/export-html/oversized-render-inputs.js.map +1 -1
- package/dist/core/export-html/tool-renderer.impl.js +350 -0
- package/dist/core/export-html/tool-renderer.impl.js.map +1 -0
- package/dist/core/export-html/tool-renderer.js +29 -347
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/jiti-loader.impl.js +3 -0
- package/dist/core/extensions/jiti-loader.impl.js.map +1 -0
- package/dist/core/extensions/jiti-loader.js +31 -2
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -0
- package/dist/core/extensions/jiti-static-loader.impl.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.js +31 -2
- package/dist/core/extensions/loader-host-modules.impl.js +3 -0
- package/dist/core/extensions/loader-host-modules.impl.js.map +1 -0
- package/dist/core/extensions/loader-host-modules.js +31 -2
- package/dist/core/intercom-broker-control-host.impl.js +5 -0
- package/dist/core/intercom-broker-control-host.impl.js.map +1 -0
- package/dist/core/intercom-broker-control-host.js +31 -4
- package/dist/core/intercom-broker-control.impl.js +18 -0
- package/dist/core/intercom-broker-control.impl.js.map +1 -0
- package/dist/core/intercom-broker-control.js +31 -17
- package/dist/core/intercom-broker-control.js.map +1 -1
- package/dist/core/package-manager-storage-adapters.impl.js +3 -0
- package/dist/core/package-manager-storage-adapters.impl.js.map +1 -0
- package/dist/core/package-manager-storage-adapters.js +31 -2
- package/dist/core/sdk.impl.js +9 -0
- package/dist/core/sdk.impl.js.map +1 -0
- package/dist/core/sdk.js +31 -8
- package/dist/core/session-manager-core.js +21 -21
- package/dist/core/session-manager-list.impl.js +3 -0
- package/dist/core/session-manager-list.impl.js.map +1 -0
- package/dist/core/session-manager-list.js +31 -2
- package/dist/core/session-manager.impl.js +8 -0
- package/dist/core/session-manager.impl.js.map +1 -0
- package/dist/core/session-manager.js +31 -7
- package/dist/core/session-storage.impl.js +3 -0
- package/dist/core/session-storage.impl.js.map +1 -0
- package/dist/core/session-storage.js +31 -2
- package/dist/core/storage/index.js +6 -6
- package/dist/core/storage/node-sqlite-thread.js +1 -1
- package/dist/core/storage/node-sqlite.js +1 -1
- package/dist/core/storage/offline-snapshot-file.impl.js +37 -0
- package/dist/core/storage/offline-snapshot-file.impl.js.map +1 -0
- package/dist/core/storage/offline-snapshot-file.js +30 -35
- package/dist/core/storage/offline-snapshot-file.js.map +1 -1
- package/dist/core/storage/provider.js +5 -5
- package/dist/core/storage/selection.js +3 -3
- package/dist/core/storage/session/branch-fork-source.impl.js +101 -0
- package/dist/core/storage/session/branch-fork-source.impl.js.map +1 -0
- package/dist/core/storage/session/branch-fork-source.js +29 -98
- package/dist/core/storage/session/branch-fork-source.js.map +1 -1
- package/dist/core/storage/session/card-view.impl.js +60 -0
- package/dist/core/storage/session/card-view.impl.js.map +1 -0
- package/dist/core/storage/session/card-view.js +30 -58
- package/dist/core/storage/session/card-view.js.map +1 -1
- package/dist/core/storage/session/child-reader.impl.js +94 -0
- package/dist/core/storage/session/child-reader.impl.js.map +1 -0
- package/dist/core/storage/session/child-reader.js +29 -91
- package/dist/core/storage/session/child-reader.js.map +1 -1
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -0
- package/dist/core/storage/session/chunked-resume-projection.impl.js.map +1 -0
- package/dist/core/storage/session/chunked-resume-projection.js +31 -2
- package/dist/core/storage/session/expanded-child-details.impl.js +639 -0
- package/dist/core/storage/session/expanded-child-details.impl.js.map +1 -0
- package/dist/core/storage/session/expanded-child-details.js +28 -635
- package/dist/core/storage/session/expanded-child-details.js.map +1 -1
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -0
- package/dist/core/storage/session/fork-row-bytes.impl.js.map +1 -0
- package/dist/core/storage/session/fork-row-bytes.js +31 -2
- package/dist/core/storage/session/fork-row-index.impl.js +3 -0
- package/dist/core/storage/session/fork-row-index.impl.js.map +1 -0
- package/dist/core/storage/session/fork-row-index.js +31 -2
- package/dist/core/storage/session/fork-staging.impl.js +580 -0
- package/dist/core/storage/session/fork-staging.impl.js.map +1 -0
- package/dist/core/storage/session/fork-staging.js +27 -575
- package/dist/core/storage/session/fork-staging.js.map +1 -1
- package/dist/core/storage/session/fork-window.impl.js +477 -0
- package/dist/core/storage/session/fork-window.impl.js.map +1 -0
- package/dist/core/storage/session/fork-window.js +27 -472
- package/dist/core/storage/session/fork-window.js.map +1 -1
- package/dist/core/storage/session/history-pages.impl.js +3 -0
- package/dist/core/storage/session/history-pages.impl.js.map +1 -0
- package/dist/core/storage/session/history-pages.js +31 -2
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -0
- package/dist/core/storage/session/jsonl-entry-projection.impl.js.map +1 -0
- package/dist/core/storage/session/jsonl-entry-projection.js +31 -2
- package/dist/core/storage/session/jsonl-session-store.impl.js +3 -0
- package/dist/core/storage/session/jsonl-session-store.impl.js.map +1 -0
- package/dist/core/storage/session/jsonl-session-store.js +31 -2
- package/dist/core/storage/session/memory-session-store.impl.js +3 -0
- package/dist/core/storage/session/memory-session-store.impl.js.map +1 -0
- package/dist/core/storage/session/memory-session-store.js +31 -2
- package/dist/core/storage/session/pinned-branch-resume.impl.js +72 -0
- package/dist/core/storage/session/pinned-branch-resume.impl.js.map +1 -0
- package/dist/core/storage/session/pinned-branch-resume.js +29 -69
- package/dist/core/storage/session/pinned-branch-resume.js.map +1 -1
- package/dist/core/storage/session/released-history-files.impl.js +465 -0
- package/dist/core/storage/session/released-history-files.impl.js.map +1 -0
- package/dist/core/storage/session/released-history-files.js +29 -462
- package/dist/core/storage/session/released-history-files.js.map +1 -1
- package/dist/core/storage/session/resident-fork-rows.impl.js +57 -0
- package/dist/core/storage/session/resident-fork-rows.impl.js.map +1 -0
- package/dist/core/storage/session/resident-fork-rows.js +28 -53
- package/dist/core/storage/session/resident-fork-rows.js.map +1 -1
- package/dist/core/storage/session/session-resume.impl.js +3 -0
- package/dist/core/storage/session/session-resume.impl.js.map +1 -0
- package/dist/core/storage/session/session-resume.js +31 -2
- package/dist/core/storage/session/snapshot-cut.impl.js +3 -0
- package/dist/core/storage/session/snapshot-cut.impl.js.map +1 -0
- package/dist/core/storage/session/snapshot-cut.js +31 -2
- package/dist/core/storage/session/snapshot-history.impl.js +62 -0
- package/dist/core/storage/session/snapshot-history.impl.js.map +1 -0
- package/dist/core/storage/session/snapshot-history.js +30 -60
- package/dist/core/storage/session/snapshot-history.js.map +1 -1
- package/dist/core/storage/session/sql-session-store.impl.js +3 -0
- package/dist/core/storage/session/sql-session-store.impl.js.map +1 -0
- package/dist/core/storage/session/sql-session-store.js +31 -2
- package/dist/core/storage/session/tree-outline.impl.js +3 -0
- package/dist/core/storage/session/tree-outline.impl.js.map +1 -0
- package/dist/core/storage/session/tree-outline.js +31 -2
- package/dist/core/storage/session/tree-presentation.impl.js +342 -0
- package/dist/core/storage/session/tree-presentation.impl.js.map +1 -0
- package/dist/core/storage/session/tree-presentation.js +30 -340
- package/dist/core/storage/session/tree-presentation.js.map +1 -1
- package/dist/core/storage/storage-status.impl.js +3 -0
- package/dist/core/storage/storage-status.impl.js.map +1 -0
- package/dist/core/storage/storage-status.js +31 -2
- package/dist/core/storage/team.impl.js +3 -0
- package/dist/core/storage/team.impl.js.map +1 -0
- package/dist/core/storage/team.js +31 -2
- package/dist/core/structured-output/index.impl.js +3 -0
- package/dist/core/structured-output/index.impl.js.map +1 -0
- package/dist/core/structured-output/index.js +31 -2
- package/dist/core/tasks/task-completion-entry.impl.js +254 -0
- package/dist/core/tasks/task-completion-entry.impl.js.map +1 -0
- package/dist/core/tasks/task-completion-entry.js +30 -252
- package/dist/core/tasks/task-completion-entry.js.map +1 -1
- package/dist/core/tasks/task-file-history.impl.js +379 -0
- package/dist/core/tasks/task-file-history.impl.js.map +1 -0
- package/dist/core/tasks/task-file-history.js +28 -375
- package/dist/core/tasks/task-file-history.js.map +1 -1
- package/dist/core/tasks/task-reference-archive.impl.js +469 -0
- package/dist/core/tasks/task-reference-archive.impl.js.map +1 -0
- package/dist/core/tasks/task-reference-archive.js +31 -468
- package/dist/core/tasks/task-reference-archive.js.map +1 -1
- package/dist/core/tasks/task-reference-identity.impl.js +164 -0
- package/dist/core/tasks/task-reference-identity.impl.js.map +1 -0
- package/dist/core/tasks/task-reference-identity.js +28 -160
- package/dist/core/tasks/task-reference-identity.js.map +1 -1
- package/dist/core/tasks/task-reference-stream.impl.js +3 -0
- package/dist/core/tasks/task-reference-stream.impl.js.map +1 -0
- package/dist/core/tasks/task-reference-stream.js +31 -2
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -0
- package/dist/core/tasks/task-unsaved-answer.impl.js.map +1 -0
- package/dist/core/tasks/task-unsaved-answer.js +31 -2
- package/dist/core/tasks/task-view-source.impl.js +3 -0
- package/dist/core/tasks/task-view-source.impl.js.map +1 -0
- package/dist/core/tasks/task-view-source.js +31 -2
- package/dist/core/tools/read-url.impl.js +1530 -0
- package/dist/core/tools/read-url.impl.js.map +1 -0
- package/dist/core/tools/read-url.js +27 -1525
- package/dist/core/tools/read-url.js.map +1 -1
- package/dist/core/worktree-snapshot/blob-store.js +4 -4
- package/dist/core/worktree-snapshot/errors.impl.js +6 -0
- package/dist/core/worktree-snapshot/errors.impl.js.map +1 -0
- package/dist/core/worktree-snapshot/errors.js +31 -5
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +136 -0
- package/dist/core/worktree-snapshot/session-index-reset.impl.js.map +1 -0
- package/dist/core/worktree-snapshot/session-index-reset.js +30 -134
- package/dist/core/worktree-snapshot/session-index-reset.js.map +1 -1
- package/dist/extensions/codemode/execute.impl.js +618 -0
- package/dist/extensions/codemode/execute.impl.js.map +1 -0
- package/dist/extensions/codemode/execute.js +28 -614
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/renderer.impl.js +110 -0
- package/dist/extensions/codemode/renderer.impl.js.map +1 -0
- package/dist/extensions/codemode/renderer.js +29 -107
- package/dist/extensions/codemode/renderer.js.map +1 -1
- package/dist/extensions/mcp/cli.impl.js +565 -0
- package/dist/extensions/mcp/cli.impl.js.map +1 -0
- package/dist/extensions/mcp/cli.js +30 -563
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/cli.lazy.impl.js +7 -0
- package/dist/extensions/mcp/cli.lazy.impl.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.js +32 -7
- package/dist/extensions/mcp/cli.lazy.js.map +1 -1
- package/dist/extensions/mcp/runtime.impl.js +5 -0
- package/dist/extensions/mcp/runtime.impl.js.map +1 -0
- package/dist/extensions/mcp/runtime.js +31 -4
- package/dist/main-first-time-setup.impl.js +12 -0
- package/dist/main-first-time-setup.impl.js.map +1 -0
- package/dist/main-first-time-setup.js +31 -11
- package/dist/main-first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/stored-tree-view.impl.js +293 -0
- package/dist/modes/interactive/components/stored-tree-view.impl.js.map +1 -0
- package/dist/modes/interactive/components/stored-tree-view.js +30 -291
- package/dist/modes/interactive/components/stored-tree-view.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +191 -0
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector-archive.js +30 -189
- package/dist/modes/interactive/components/user-message-selector-archive.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +4 -0
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -0
- package/dist/package-manager-cli.impl.js +1067 -0
- package/dist/package-manager-cli.impl.js.map +1 -0
- package/dist/package-manager-cli.js +32 -1067
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/startup-database-spare.impl.js +108 -0
- package/dist/utils/startup-database-spare.impl.js.map +1 -0
- package/dist/utils/startup-database-spare.js +30 -106
- package/dist/utils/startup-database-spare.js.map +1 -1
- package/dist/utils/tools-manager.impl.js +3 -0
- package/dist/utils/tools-manager.impl.js.map +1 -0
- package/dist/utils/tools-manager.js +31 -2
- package/docs/reference/cli.md +1 -1
- package/package.json +8 -8
|
@@ -1,37 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (raw.prepare("PRAGMA auto_vacuum").get()?.auto_vacuum === 1) throw new Error("Offline chunk maintenance cannot bound the log with auto_vacuum=FULL.");
|
|
25
|
-
const database = wrapNodeSqliteDatabase(raw);
|
|
26
|
-
try {
|
|
27
|
-
await move(database);
|
|
28
|
-
} finally {
|
|
29
|
-
await database.close();
|
|
30
|
-
}
|
|
31
|
-
} finally {
|
|
32
|
-
raw.close();
|
|
1
|
+
// Written by the build (scripts/in-place-update-gate.mjs): when this module's code cannot load in a process of an earlier release
|
|
2
|
+
// that an in-place update left running, the process is told to restart.
|
|
3
|
+
let module;
|
|
4
|
+
try {
|
|
5
|
+
module = await import("./offline-snapshot-file.impl.js");
|
|
6
|
+
} catch (error) {
|
|
7
|
+
const root = new URL("../../", import.meta.url);
|
|
8
|
+
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9
|
+
const key = `${root.href}#0.10.4`;
|
|
10
|
+
let release = releases.get(key);
|
|
11
|
+
if (release === undefined) {
|
|
12
|
+
release = (async () => {
|
|
13
|
+
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
14
|
+
try {
|
|
15
|
+
const held = await import(new URL(path, root).href);
|
|
16
|
+
if (typeof held.VERSION === "string") return { version: held.VERSION, name: held.APP_NAME };
|
|
17
|
+
} catch {
|
|
18
|
+
// Not a file this process can load: the next.
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
})();
|
|
23
|
+
releases.set(key, release);
|
|
33
24
|
}
|
|
25
|
+
const running = await release;
|
|
26
|
+
if (running === undefined || running.version === "0.10.4") throw error;
|
|
27
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.4 while this session was running; restart it to keep using session storage.", {
|
|
28
|
+
cause: error,
|
|
29
|
+
});
|
|
34
30
|
}
|
|
35
|
-
export { withOfflineSnapshotFile };
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=offline-snapshot-file.js.map
|
|
31
|
+
export const { withOfflineSnapshotFile } = module;
|
|
32
|
+
//# sourceMappingURL=offline-snapshot-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offline-snapshot-file.js","
|
|
1
|
+
{"version":3,"file":"offline-snapshot-file.js","sources":[],"names":[],"mappings":""}
|
|
@@ -192,8 +192,8 @@ export async function loadStorageAdapter(module, context, hostModules = {}) {
|
|
|
192
192
|
try {
|
|
193
193
|
const [{ createHostModuleJiti }, { getStorageAdapterHostModules }, { resolvePackageStorageAdapter }] = await Promise.all([
|
|
194
194
|
import("../extensions/loader-virtual-modules.js"),
|
|
195
|
-
import("../extensions/loader-host-modules.js"),
|
|
196
|
-
import("../package-manager-storage-adapters.js"),
|
|
195
|
+
import("../extensions/loader-host-modules.impl.js"),
|
|
196
|
+
import("../package-manager-storage-adapters.impl.js"),
|
|
197
197
|
]);
|
|
198
198
|
const id = pathToFileURL(join(context.agentDir, "storage-adapter.js")).href;
|
|
199
199
|
const babel = await createHostModuleJiti(id, {});
|
|
@@ -317,10 +317,10 @@ export const StorageProvider = class {
|
|
|
317
317
|
databases = sharedDatabases;
|
|
318
318
|
async openSessionStore(selection, context) {
|
|
319
319
|
return this.open(selection, context, {
|
|
320
|
-
memory: async () => new (await import("./session/memory-session-store.js")).MemorySessionStore(createSessionCwdMatcherAsync, (await import("./session/released-history-files.js")).releasedHistoryFiles(context.agentDir || (await import("../../config.js")).getAgentDir())),
|
|
321
|
-
jsonl: async (dir) => (await import("./session/jsonl-session-store.js")).JsonlSessionStore.open(dir, { exactDirectory: true }),
|
|
320
|
+
memory: async () => new (await import("./session/memory-session-store.impl.js")).MemorySessionStore(createSessionCwdMatcherAsync, (await import("./session/released-history-files.impl.js")).releasedHistoryFiles(context.agentDir || (await import("../../config.js")).getAgentDir())),
|
|
321
|
+
jsonl: async (dir) => (await import("./session/jsonl-session-store.impl.js")).JsonlSessionStore.open(dir, { exactDirectory: true }),
|
|
322
322
|
direct: (adapter, options, storage, adapterContext) => adapter.openSessionStore?.(options, adapterContext, storage),
|
|
323
|
-
sql: async (database, options) => (await import("./session/sql-session-store.js")).SqlSessionStore.open(database, {
|
|
323
|
+
sql: async (database, options) => (await import("./session/sql-session-store.impl.js")).SqlSessionStore.open(database, {
|
|
324
324
|
...options,
|
|
325
325
|
cwdMatcher: createSessionCwdMatcherAsync,
|
|
326
326
|
}),
|
|
@@ -475,7 +475,7 @@ function parseEnvironmentTeamProfile(env) {
|
|
|
475
475
|
* nothing was changed. A failed broker restart is reported in `broker`, not thrown.
|
|
476
476
|
*/
|
|
477
477
|
export async function joinTeam(options) {
|
|
478
|
-
return (await import("./team.js")).joinTeam(options);
|
|
478
|
+
return (await import("./team.impl.js")).joinTeam(options);
|
|
479
479
|
}
|
|
480
480
|
/**
|
|
481
481
|
* Restore the individual layout: remove the global `storage` setting and the `sessions.storage` pin when they hold
|
|
@@ -484,13 +484,13 @@ export async function joinTeam(options) {
|
|
|
484
484
|
* changes nothing.
|
|
485
485
|
*/
|
|
486
486
|
export async function leaveTeam(options = {}) {
|
|
487
|
-
return (await import("./team.js")).leaveTeam(options);
|
|
487
|
+
return (await import("./team.impl.js")).leaveTeam(options);
|
|
488
488
|
}
|
|
489
489
|
/**
|
|
490
490
|
* The layout in effect for this process and working directory (`individual`, `team`, `ci` or `custom`), from the
|
|
491
491
|
* storage each domain selects. Reads only; an invalid selection rejects with its `StorageConfigError`.
|
|
492
492
|
*/
|
|
493
493
|
export async function getTeamProfile(options = {}) {
|
|
494
|
-
return (await import("./team.js")).selectTeamProfile(options);
|
|
494
|
+
return (await import("./team.impl.js")).selectTeamProfile(options);
|
|
495
495
|
}
|
|
496
496
|
//# sourceMappingURL=selection.js.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import "../../../_shared/rolldown-runtime-BGM3D5V3.js";
|
|
2
|
+
import { SessionEntryError } from "../../../_shared/settings-startup-65YEWRV2.js";
|
|
3
|
+
import { createLabelEntry, historyPages, readSessionHistoryChunks } from "../../../_shared/startup-8-0-34CBHPZH.js";
|
|
4
|
+
// dist/core/storage/session/branch-fork-source.js
|
|
5
|
+
async function forkRow(reader, item) {
|
|
6
|
+
if ("entry" in item) return { entry: item.entry };
|
|
7
|
+
const { forkSeedFields } = await import("./chunked-resume-projection.impl.js");
|
|
8
|
+
return {
|
|
9
|
+
...await forkSeedFields(() => readSessionHistoryChunks(reader, item)),
|
|
10
|
+
reference: item
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** The SDK/CLI same-store clone keeps the original append log, including abandoned branches,
|
|
14
|
+
* raw labels and recorded leaf moves. Unlike an interactive /fork it never edits structural links. */
|
|
15
|
+
function completeSessionForkStream(id, epoch, through, resident) {
|
|
16
|
+
return {
|
|
17
|
+
kind: "complete-session",
|
|
18
|
+
async *read(reader, _hasWritten, inlineSnapshot) {
|
|
19
|
+
if (resident) {
|
|
20
|
+
for (const entry of resident) yield { entry };
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
for await (const { items } of historyPages(reader, id, epoch, through, {})) for (const item of items) {
|
|
24
|
+
if ("kind" in item && inlineSnapshot) {
|
|
25
|
+
const entry = await inlineSnapshot(item);
|
|
26
|
+
if (entry) {
|
|
27
|
+
yield {
|
|
28
|
+
entry,
|
|
29
|
+
reference: item,
|
|
30
|
+
inlineSnapshot: true
|
|
31
|
+
};
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
yield await forkRow(reader, item);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** A human /fork is an archive of the complete selected path. Keep original IDs and chronological
|
|
41
|
+
* order, remove historical label operations and append each copied target's latest label as main did. */
|
|
42
|
+
function humanForkStream(id, epoch, through, leaf, leafId, labels, labelTimes) {
|
|
43
|
+
return { async *read(reader, hasWritten, inlineSnapshot) {
|
|
44
|
+
const pages = (fromSeq, toSeq) => historyPages(reader, id, epoch, through, {
|
|
45
|
+
branchLeafSeq: leaf,
|
|
46
|
+
fromSeq,
|
|
47
|
+
toSeq
|
|
48
|
+
});
|
|
49
|
+
let previous = null;
|
|
50
|
+
let found = false;
|
|
51
|
+
for await (const page of pages(1, leaf)) for (const item of page.items) {
|
|
52
|
+
const snapshot = "kind" in item ? await inlineSnapshot?.(item) : void 0;
|
|
53
|
+
const row = snapshot && "kind" in item ? {
|
|
54
|
+
entry: snapshot,
|
|
55
|
+
reference: item,
|
|
56
|
+
inlineSnapshot: true
|
|
57
|
+
} : await forkRow(reader, item);
|
|
58
|
+
const entry = row.entry;
|
|
59
|
+
if (item.seq === leaf && entry.id === leafId) found = true;
|
|
60
|
+
if (entry.type === "label") continue;
|
|
61
|
+
const edits = {};
|
|
62
|
+
if (entry.parentId !== previous) edits.parentId = previous;
|
|
63
|
+
if (entry.type === "compaction" && entry.firstKeptEntryId && !await hasWritten(entry.firstKeptEntryId)) {
|
|
64
|
+
const start = await reader.findEntrySeq?.(id, entry.firstKeptEntryId);
|
|
65
|
+
if (start !== void 0 && start < item.seq) {
|
|
66
|
+
let target = false;
|
|
67
|
+
search: for await (const earlier of pages(start, item.seq)) for (const x of earlier.items) {
|
|
68
|
+
const e = (await forkRow(reader, x)).entry;
|
|
69
|
+
if (!target) {
|
|
70
|
+
if (x.seq !== start || e.type !== "label" || e.id !== entry.firstKeptEntryId) break search;
|
|
71
|
+
target = true;
|
|
72
|
+
} else if (e.type !== "label") {
|
|
73
|
+
edits.firstKeptEntryId = e.id;
|
|
74
|
+
break search;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
previous = entry.id;
|
|
80
|
+
yield Object.keys(edits).length ? {
|
|
81
|
+
...row,
|
|
82
|
+
entry: {
|
|
83
|
+
...entry,
|
|
84
|
+
...edits
|
|
85
|
+
},
|
|
86
|
+
edits
|
|
87
|
+
} : row;
|
|
88
|
+
}
|
|
89
|
+
if (!found) throw new SessionEntryError(leafId, "missing");
|
|
90
|
+
for (const [target, label] of labels) {
|
|
91
|
+
if (!await hasWritten(target)) continue;
|
|
92
|
+
let e = createLabelEntry(target, label, /* @__PURE__ */ new Set(), previous, labelTimes.get(target));
|
|
93
|
+
while (await hasWritten(e.id)) e = createLabelEntry(target, label, /* @__PURE__ */ new Set(), previous, labelTimes.get(target));
|
|
94
|
+
previous = e.id;
|
|
95
|
+
yield { entry: e };
|
|
96
|
+
}
|
|
97
|
+
} };
|
|
98
|
+
}
|
|
99
|
+
export { completeSessionForkStream, humanForkStream };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=branch-fork-source.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-fork-source.impl.js","names":[],"sources":["../../../../src/core/storage/session/branch-fork-source.ts"],"mappings":";;;;AAMA,eAAe,QAAQ,QAA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b,MAAM,EAAE,OAAO,EAAC;EACjB;CACD,EACA;AACF"}
|
|
@@ -1,101 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (resident) {
|
|
20
|
-
for (const entry of resident) yield { entry };
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
for await (const { items } of historyPages(reader, id, epoch, through, {})) for (const item of items) {
|
|
24
|
-
if ("kind" in item && inlineSnapshot) {
|
|
25
|
-
const entry = await inlineSnapshot(item);
|
|
26
|
-
if (entry) {
|
|
27
|
-
yield {
|
|
28
|
-
entry,
|
|
29
|
-
reference: item,
|
|
30
|
-
inlineSnapshot: true
|
|
31
|
-
};
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
yield await forkRow(reader, item);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
/** A human /fork is an archive of the complete selected path. Keep original IDs and chronological
|
|
41
|
-
* order, remove historical label operations and append each copied target's latest label as main did. */
|
|
42
|
-
function humanForkStream(id, epoch, through, leaf, leafId, labels, labelTimes) {
|
|
43
|
-
return { async *read(reader, hasWritten, inlineSnapshot) {
|
|
44
|
-
const pages = (fromSeq, toSeq) => historyPages(reader, id, epoch, through, {
|
|
45
|
-
branchLeafSeq: leaf,
|
|
46
|
-
fromSeq,
|
|
47
|
-
toSeq
|
|
48
|
-
});
|
|
49
|
-
let previous = null;
|
|
50
|
-
let found = false;
|
|
51
|
-
for await (const page of pages(1, leaf)) for (const item of page.items) {
|
|
52
|
-
const snapshot = "kind" in item ? await inlineSnapshot?.(item) : void 0;
|
|
53
|
-
const row = snapshot && "kind" in item ? {
|
|
54
|
-
entry: snapshot,
|
|
55
|
-
reference: item,
|
|
56
|
-
inlineSnapshot: true
|
|
57
|
-
} : await forkRow(reader, item);
|
|
58
|
-
const entry = row.entry;
|
|
59
|
-
if (item.seq === leaf && entry.id === leafId) found = true;
|
|
60
|
-
if (entry.type === "label") continue;
|
|
61
|
-
const edits = {};
|
|
62
|
-
if (entry.parentId !== previous) edits.parentId = previous;
|
|
63
|
-
if (entry.type === "compaction" && entry.firstKeptEntryId && !await hasWritten(entry.firstKeptEntryId)) {
|
|
64
|
-
const start = await reader.findEntrySeq?.(id, entry.firstKeptEntryId);
|
|
65
|
-
if (start !== void 0 && start < item.seq) {
|
|
66
|
-
let target = false;
|
|
67
|
-
search: for await (const earlier of pages(start, item.seq)) for (const x of earlier.items) {
|
|
68
|
-
const e = (await forkRow(reader, x)).entry;
|
|
69
|
-
if (!target) {
|
|
70
|
-
if (x.seq !== start || e.type !== "label" || e.id !== entry.firstKeptEntryId) break search;
|
|
71
|
-
target = true;
|
|
72
|
-
} else if (e.type !== "label") {
|
|
73
|
-
edits.firstKeptEntryId = e.id;
|
|
74
|
-
break search;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
1
|
+
// Written by the build (scripts/in-place-update-gate.mjs): when this module's code cannot load in a process of an earlier release
|
|
2
|
+
// that an in-place update left running, the process is told to restart.
|
|
3
|
+
let module;
|
|
4
|
+
try {
|
|
5
|
+
module = await import("./branch-fork-source.impl.js");
|
|
6
|
+
} catch (error) {
|
|
7
|
+
const root = new URL("../../../", import.meta.url);
|
|
8
|
+
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9
|
+
const key = `${root.href}#0.10.4`;
|
|
10
|
+
let release = releases.get(key);
|
|
11
|
+
if (release === undefined) {
|
|
12
|
+
release = (async () => {
|
|
13
|
+
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
14
|
+
try {
|
|
15
|
+
const held = await import(new URL(path, root).href);
|
|
16
|
+
if (typeof held.VERSION === "string") return { version: held.VERSION, name: held.APP_NAME };
|
|
17
|
+
} catch {
|
|
18
|
+
// Not a file this process can load: the next.
|
|
77
19
|
}
|
|
78
20
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
if (!found) throw new SessionEntryError(leafId, "missing");
|
|
90
|
-
for (const [target, label] of labels) {
|
|
91
|
-
if (!await hasWritten(target)) continue;
|
|
92
|
-
let e = createLabelEntry(target, label, /* @__PURE__ */ new Set(), previous, labelTimes.get(target));
|
|
93
|
-
while (await hasWritten(e.id)) e = createLabelEntry(target, label, /* @__PURE__ */ new Set(), previous, labelTimes.get(target));
|
|
94
|
-
previous = e.id;
|
|
95
|
-
yield { entry: e };
|
|
96
|
-
}
|
|
97
|
-
} };
|
|
21
|
+
return undefined;
|
|
22
|
+
})();
|
|
23
|
+
releases.set(key, release);
|
|
24
|
+
}
|
|
25
|
+
const running = await release;
|
|
26
|
+
if (running === undefined || running.version === "0.10.4") throw error;
|
|
27
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.4 while this session was running; restart it to keep using session storage.", {
|
|
28
|
+
cause: error,
|
|
29
|
+
});
|
|
98
30
|
}
|
|
99
|
-
export { completeSessionForkStream, humanForkStream };
|
|
100
|
-
|
|
101
|
-
//# sourceMappingURL=branch-fork-source.js.map
|
|
31
|
+
export const { completeSessionForkStream, humanForkStream } = module;
|
|
32
|
+
//# sourceMappingURL=branch-fork-source.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branch-fork-source.js","
|
|
1
|
+
{"version":3,"file":"branch-fork-source.js","sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import "../../../_shared/rolldown-runtime-BGM3D5V3.js";
|
|
2
|
+
import { branchRanges, latestCompactionOf, stateSeqsBefore } from "../../../_shared/startup-8-0-34CBHPZH.js";
|
|
3
|
+
// dist/core/storage/session/card-view.js
|
|
4
|
+
/** Reproduce the released launch card's distinction between the held suffix and an explicit older
|
|
5
|
+
* launch entry. No prior message, receipt, checkout or tool result is loaded to decide which rows are eligible. */
|
|
6
|
+
function childDisplayCut(index, launch, found) {
|
|
7
|
+
const leaf = index.leafSeq;
|
|
8
|
+
const branch = branchRanges(index, leaf);
|
|
9
|
+
const owns = (seq) => branch.some(([lo, hi]) => seq >= lo && seq <= hi);
|
|
10
|
+
const comp = latestCompactionOf(index, leaf);
|
|
11
|
+
const suffix = comp ? Math.min(comp.retainedStartSeq, comp.coveredThroughSeq ?? comp.retainedStartSeq) : 1;
|
|
12
|
+
const heldMessagesAfter = (seq) => {
|
|
13
|
+
const last = index.assistants.findLast(owns);
|
|
14
|
+
const positions = index.models.flatMap(([n]) => n > seq && n < suffix && owns(n) && index.latest[`model-transition:${n}`]?.includes(n) ? [n] : []);
|
|
15
|
+
if (last !== void 0 && last > seq && last < suffix && !positions.includes(last)) positions.push(last);
|
|
16
|
+
return positions.sort((a, b) => a - b);
|
|
17
|
+
};
|
|
18
|
+
const base = {
|
|
19
|
+
epoch: index.epoch,
|
|
20
|
+
through: index.seq,
|
|
21
|
+
leaf
|
|
22
|
+
};
|
|
23
|
+
if (typeof launch.launchLeafId === "string") {
|
|
24
|
+
if (found !== void 0 && owns(found)) {
|
|
25
|
+
if (found >= suffix || !stateSeqsBefore(index, suffix).includes(found)) return {
|
|
26
|
+
...base,
|
|
27
|
+
from: found + 1,
|
|
28
|
+
earlier: []
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
...base,
|
|
32
|
+
from: suffix,
|
|
33
|
+
earlier: heldMessagesAfter(found)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
...base,
|
|
38
|
+
from: launch.launchLeafSeq !== void 0 && branch.some(([a]) => a <= launch.launchLeafSeq) ? launch.launchLeafSeq + 1 : leaf + 1,
|
|
39
|
+
earlier: []
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (launch.launchLeafSeq !== void 0) return {
|
|
43
|
+
...base,
|
|
44
|
+
from: Math.max(suffix, launch.launchLeafSeq + 1),
|
|
45
|
+
earlier: heldMessagesAfter(launch.launchLeafSeq)
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
...base,
|
|
49
|
+
from: comp?.retainedStartSeq ?? 1,
|
|
50
|
+
earlier: [],
|
|
51
|
+
model: true,
|
|
52
|
+
...comp ? {
|
|
53
|
+
boundary: comp.seq,
|
|
54
|
+
covered: comp.coveredThroughSeq ?? comp.seq - 1
|
|
55
|
+
} : {}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export { childDisplayCut };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=card-view.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-view.impl.js","names":[],"sources":["../../../../src/core/storage/session/card-view.ts"],"mappings":";;;;;AAKA,SAAgB,gBACf,OACA,QACA,OAAc;CAEd,MAAM,OAAO,MAAM;CACnB,MAAM,SAAS,aAAa,OAAO,IAAI;CACvC,MAAM,QAAQ,QAAgB,OAAO,MAAM,CAAC,IAAI,QAAQ,OAAO,MAAM,OAAO,EAAE;CAC9E,MAAM,OAAO,mBAAmB,OAAO,IAAI;CAC3C,MAAM,SAAS,OAAO,KAAK,IAAI,KAAK,kBAAkB,KAAK,qBAAqB,KAAK,gBAAgB,IAAI;CACzG,MAAM,qBAAqB,QAAe;EAGzC,MAAM,OAAO,MAAM,WAAW,SAAS,IAAI;EAC3C,MAAM,YAAY,MAAM,OAAO,SAAS,CAAC,OACxC,IAAI,OAAO,IAAI,UAAU,KAAK,CAAC,KAAK,MAAM,OAAO,oBAAoB,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CA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14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (found !== void 0 && owns(found)) {
|
|
25
|
-
if (found >= suffix || !stateSeqsBefore(index, suffix).includes(found)) return {
|
|
26
|
-
...base,
|
|
27
|
-
from: found + 1,
|
|
28
|
-
earlier: []
|
|
29
|
-
};
|
|
30
|
-
return {
|
|
31
|
-
...base,
|
|
32
|
-
from: suffix,
|
|
33
|
-
earlier: heldMessagesAfter(found)
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
...base,
|
|
38
|
-
from: launch.launchLeafSeq !== void 0 && branch.some(([a]) => a <= launch.launchLeafSeq) ? launch.launchLeafSeq + 1 : leaf + 1,
|
|
39
|
-
earlier: []
|
|
40
|
-
};
|
|
1
|
+
// Written by the build (scripts/in-place-update-gate.mjs): when this module's code cannot load in a process of an earlier release
|
|
2
|
+
// that an in-place update left running, the process is told to restart.
|
|
3
|
+
let module;
|
|
4
|
+
try {
|
|
5
|
+
module = await import("./card-view.impl.js");
|
|
6
|
+
} catch (error) {
|
|
7
|
+
const root = new URL("../../../", import.meta.url);
|
|
8
|
+
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9
|
+
const key = `${root.href}#0.10.4`;
|
|
10
|
+
let release = releases.get(key);
|
|
11
|
+
if (release === undefined) {
|
|
12
|
+
release = (async () => {
|
|
13
|
+
for (const path of ["modes/interactive/interactive-mode-deps.js","_shared/chunk-CDOYTDYM.js","_shared/p0-cli-GUFK7TPN.js"]) {
|
|
14
|
+
try {
|
|
15
|
+
const held = await import(new URL(path, root).href);
|
|
16
|
+
if (typeof held.VERSION === "string") return { version: held.VERSION, name: held.APP_NAME };
|
|
17
|
+
} catch {
|
|
18
|
+
// Not a file this process can load: the next.
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
})();
|
|
23
|
+
releases.set(key, release);
|
|
41
24
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
return {
|
|
48
|
-
...base,
|
|
49
|
-
from: comp?.retainedStartSeq ?? 1,
|
|
50
|
-
earlier: [],
|
|
51
|
-
model: true,
|
|
52
|
-
...comp ? {
|
|
53
|
-
boundary: comp.seq,
|
|
54
|
-
covered: comp.coveredThroughSeq ?? comp.seq - 1
|
|
55
|
-
} : {}
|
|
56
|
-
};
|
|
25
|
+
const running = await release;
|
|
26
|
+
if (running === undefined || running.version === "0.10.4") throw error;
|
|
27
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.4 while this session was running; restart it to keep using session storage.", {
|
|
28
|
+
cause: error,
|
|
29
|
+
});
|
|
57
30
|
}
|
|
58
|
-
export { childDisplayCut };
|
|
59
|
-
|
|
60
|
-
//# sourceMappingURL=card-view.js.map
|
|
31
|
+
export const { childDisplayCut } = module;
|
|
32
|
+
//# sourceMappingURL=card-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-view.js","
|
|
1
|
+
{"version":3,"file":"card-view.js","sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import "../../../_shared/rolldown-runtime-BGM3D5V3.js";
|
|
2
|
+
import { ChildCatalog } from "../../../_shared/startup-0-1-7QTG6VJZ.js";
|
|
3
|
+
import { historyChunks, historyPages, readSessionRange } from "../../../_shared/startup-8-0-34CBHPZH.js";
|
|
4
|
+
import { treeOutlinePages } from "../../../_shared/tree-outline-MUEPK5B7.js";
|
|
5
|
+
import { SessionConflictError } from "./errors.js";
|
|
6
|
+
// dist/core/storage/session/child-reader.js
|
|
7
|
+
async function* headings(store, id, epoch, through, seqs, signal) {
|
|
8
|
+
for (let at = 0; at < seqs.length;) {
|
|
9
|
+
signal?.throwIfAborted();
|
|
10
|
+
let items;
|
|
11
|
+
if (store.readSelectedPage) items = (await store.readSelectedPage(id, seqs.slice(at, at + 64), epoch)).items;
|
|
12
|
+
else {
|
|
13
|
+
let end = at + 1;
|
|
14
|
+
while (end < seqs.length && end - at < 64 && seqs[end] === seqs[end - 1] + 1) end++;
|
|
15
|
+
const p = await historyPages(store, id, epoch, through, {
|
|
16
|
+
fromSeq: seqs[at],
|
|
17
|
+
toSeq: seqs[end - 1],
|
|
18
|
+
signal
|
|
19
|
+
}).next();
|
|
20
|
+
items = p.done ? [] : p.value.items;
|
|
21
|
+
}
|
|
22
|
+
if (!items.length) throw new SessionConflictError(id, through, seqs[at]);
|
|
23
|
+
for (const item of items) {
|
|
24
|
+
signal?.throwIfAborted();
|
|
25
|
+
if (item.seq !== seqs[at++]) throw new SessionConflictError(id, through, item.seq);
|
|
26
|
+
const entry = "entry" in item ? ChildCatalog.headingOnly(item.entry) : await (await import("./chunked-resume-projection.impl.js")).chunkedChildHeading(historyChunks(store, id, epoch, item, { signal }));
|
|
27
|
+
yield {
|
|
28
|
+
seq: item.seq,
|
|
29
|
+
entry
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** A bounded native resume returns only addresses for historical child state. Ordinary pages are projected
|
|
35
|
+
* before the next page is read; even a giant completed child's launch never enters the live window. */
|
|
36
|
+
async function resolveDeferredChildren(store, resume) {
|
|
37
|
+
const refs = resume.deferredChildren;
|
|
38
|
+
if (!refs) return resume;
|
|
39
|
+
const { id } = resume.header, { epoch, lastSeq } = resume;
|
|
40
|
+
const metadata = [];
|
|
41
|
+
let at = 0;
|
|
42
|
+
for await (const h of headings(store, id, epoch, lastSeq, refs.positions.map((p) => p.seq))) metadata.push({
|
|
43
|
+
...h,
|
|
44
|
+
onBranch: refs.positions[at++].onBranch
|
|
45
|
+
});
|
|
46
|
+
const catalog = new ChildCatalog();
|
|
47
|
+
const retired = catalog.retire(metadata, resume.branch);
|
|
48
|
+
catalog.applyAliases(refs.aliases);
|
|
49
|
+
const state = [...resume.state];
|
|
50
|
+
for (const [i, row] of metadata.entries()) if (!retired.has(row.entry.id)) {
|
|
51
|
+
const source = await readSessionRange(store, id, row.seq, row.seq, epoch);
|
|
52
|
+
if (source.lastSeq < lastSeq || source.epoch !== epoch || source.entries[0]?.id !== row.entry.id) throw new SessionConflictError(id, lastSeq, source.lastSeq);
|
|
53
|
+
state.push({
|
|
54
|
+
seq: row.seq,
|
|
55
|
+
entry: source.entries[0],
|
|
56
|
+
onBranch: refs.positions[i].onBranch
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
...resume,
|
|
61
|
+
state: state.sort((a, b) => a.seq - b.seq),
|
|
62
|
+
deferredChildren: void 0,
|
|
63
|
+
childArchive: catalog
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/** A collapsed card reads only the unopened owner's child observations, not its conversation window. */
|
|
67
|
+
async function readSessionChildCatalog(store, id, options = {}) {
|
|
68
|
+
const { signal } = options;
|
|
69
|
+
signal?.throwIfAborted();
|
|
70
|
+
const catalog = new ChildCatalog();
|
|
71
|
+
if (store.readChildCatalogCut) {
|
|
72
|
+
const cut = await store.readChildCatalogCut(id);
|
|
73
|
+
for await (const { entry, seq } of headings(store, id, cut.epoch, cut.lastSeq, cut.seqs, signal)) catalog.add(entry, seq);
|
|
74
|
+
catalog.applyAliases(cut.aliases);
|
|
75
|
+
return catalog.rows();
|
|
76
|
+
}
|
|
77
|
+
if (!store.readEntrySizes || !store.readEntryChunk) {
|
|
78
|
+
const s = await store.load(id);
|
|
79
|
+
signal?.throwIfAborted();
|
|
80
|
+
for (let i = 0; i < s.entries.length; i++) catalog.add(s.entries[i], i + 1);
|
|
81
|
+
catalog.publish();
|
|
82
|
+
return catalog.rows();
|
|
83
|
+
}
|
|
84
|
+
const cut = await store.readEntrySizes(id, 1, 0);
|
|
85
|
+
for await (const page of treeOutlinePages(store, id, cut.epoch, cut.lastSeq, signal)) {
|
|
86
|
+
const seqs = page.filter((row) => row.childRecord).map((row) => row.seq);
|
|
87
|
+
for await (const { entry, seq } of headings(store, id, cut.epoch, cut.lastSeq, seqs, signal)) catalog.add(entry, seq);
|
|
88
|
+
}
|
|
89
|
+
catalog.publish();
|
|
90
|
+
return catalog.rows();
|
|
91
|
+
}
|
|
92
|
+
export { readSessionChildCatalog, resolveDeferredChildren };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=child-reader.impl.js.map
|