@bastani/atomic 0.10.4 → 0.10.5-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 +44 -0
- package/dist/_shared/compile-cache-warmup-host-RU5L7I7A.js +1 -1
- package/dist/_shared/dist-KOELCESV.js +48 -3
- package/dist/_shared/fork-row-index-UAUAQRD5.js +47 -2
- package/dist/_shared/http-YFAPTIZD.js +16 -4
- package/dist/_shared/http-YFAPTIZD.js.map +1 -1
- package/dist/_shared/lib-4PES5P4V.js +59 -14
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +1706 -258
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +317 -64
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/{mode-shared-HP7GUA7J.js → mode-shared-2QJSCUM6.js} +432 -81
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -0
- package/dist/_shared/p0-cli-BB45ZQY6.js +3482 -0
- package/dist/_shared/p0-cli-BB45ZQY6.js.map +1 -0
- package/dist/_shared/p0-cli-GUFK7TPN.js +2 -2838
- package/dist/_shared/p0-cli-GUFK7TPN.js.map +1 -1
- package/dist/_shared/{p1a-prewarm-YK3KDTLN.js → p1a-prewarm-UQY3X2UK.js} +270 -73
- package/dist/_shared/p1a-prewarm-UQY3X2UK.js.map +1 -0
- package/dist/_shared/{p1b-elig-PXQA2FYP.js → p1b-elig-ENCUPKKJ.js} +190 -121
- package/dist/_shared/p1b-elig-ENCUPKKJ.js.map +1 -0
- package/dist/_shared/p2-common-YLSYXMDQ.js +1 -3
- package/dist/_shared/p2-common-YLSYXMDQ.js.map +1 -1
- package/dist/_shared/p2-shell-TJBYQMCJ.js +1 -1
- package/dist/_shared/p2-shell-main-B2WIALFD.js +500 -127
- package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +4 -4
- package/dist/_shared/sdk-WQIOHVKO.js +56 -11
- package/dist/_shared/session-data-AHTU7IS6.js +48 -3
- package/dist/_shared/session-manager-list-2BLEEZVG.js +2 -2
- package/dist/_shared/settings-startup-65YEWRV2.js.map +1 -1
- package/dist/_shared/sql-session-store-5FD3WBMZ.js +57 -12
- package/dist/_shared/{startup-0-0-X4NF3GKM.js → startup-0-0-TYUFUOJZ.js} +519 -316
- package/dist/_shared/startup-0-0-TYUFUOJZ.js.map +1 -0
- package/dist/_shared/{startup-0-1-7QTG6VJZ.js → startup-0-1-D4LGGINF.js} +284 -81
- package/dist/_shared/startup-0-1-D4LGGINF.js.map +1 -0
- package/dist/_shared/{startup-0-2-KFDYPDJK.js → startup-0-2-SZGQIWHI.js} +483 -154
- package/dist/_shared/startup-0-2-SZGQIWHI.js.map +1 -0
- package/dist/_shared/startup-0-3-T4DVFYWX.js +340 -110
- package/dist/_shared/startup-0-3-T4DVFYWX.js.map +1 -1
- package/dist/_shared/startup-0-4-HN5EB4K7.js +261 -59
- package/dist/_shared/startup-0-4-HN5EB4K7.js.map +1 -1
- package/dist/_shared/startup-0-5-OHJNE6JH.js +421 -148
- package/dist/_shared/startup-0-5-OHJNE6JH.js.map +1 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js +62 -11
- package/dist/_shared/startup-10-0-TDQNBDDL.js.map +1 -1
- package/dist/_shared/startup-12-0-55AAXBJZ.js +3 -3
- package/dist/_shared/startup-14-0-MLX36RBG.js +12 -11
- package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
- package/dist/_shared/startup-15-0-YUKGAC63.js +53 -158
- package/dist/_shared/startup-15-0-YUKGAC63.js.map +1 -1
- package/dist/_shared/startup-15-1-4S7FLMNG.js +231 -46
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +115 -35
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/{startup-8-1-KQJBDKRU.js → startup-8-1-SJW2GMAM.js} +203 -62
- package/dist/_shared/startup-8-1-SJW2GMAM.js.map +1 -0
- package/dist/_shared/storage-command-7MGXLJGZ.js +55 -10
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +47 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +48 -3
- package/dist/builtin/intercom/CHANGELOG.md +21 -0
- package/dist/builtin/intercom/README.md +0 -1
- package/dist/builtin/intercom/broker/broker-instance.ts +13 -57
- package/dist/builtin/intercom/broker/broker-process.ts +30 -10
- package/dist/builtin/intercom/broker/broker-routing.ts +12 -2
- package/dist/builtin/intercom/broker/broker.bundle.mjs +2557 -498
- package/dist/builtin/intercom/broker/broker.ts +164 -55
- package/dist/builtin/intercom/broker/client.ts +36 -16
- package/dist/builtin/intercom/broker/control.ts +83 -20
- package/dist/builtin/intercom/broker/durable-ended-queue.ts +65 -19
- package/dist/builtin/intercom/broker/host-command-environment.ts +7 -2
- package/dist/builtin/intercom/broker/multinode-router.ts +1675 -387
- package/dist/builtin/intercom/broker/multinode-state-store.ts +10 -0
- package/dist/builtin/intercom/broker/paths.ts +68 -6
- package/dist/builtin/intercom/broker/pending-send-registry.ts +5 -0
- package/dist/builtin/intercom/broker/registration-bounds.ts +38 -0
- package/dist/builtin/intercom/broker/retiring-broker-check.ts +178 -0
- package/dist/builtin/intercom/broker/return-paths.ts +268 -7
- package/dist/builtin/intercom/broker/send-handler.ts +253 -28
- package/dist/builtin/intercom/broker/send-order-gate.ts +410 -0
- package/dist/builtin/intercom/broker/spawn.ts +950 -202
- package/dist/builtin/intercom/broker/sql-lease-store.ts +37 -0
- package/dist/builtin/intercom/broker/sql-outbox-store.ts +7 -0
- package/dist/builtin/intercom/broker/windows-cwd.ts +546 -0
- package/dist/builtin/intercom/index.bundle.mjs +3506 -2328
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/intercom/retry-policy.ts +4 -0
- package/dist/builtin/intercom/types.ts +2 -0
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +336 -86
- package/dist/builtin/web-access/index.bundle.mjs +23 -38
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/bun/cli.js +1 -1
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/internal-intercom-broker.js +119 -4
- package/dist/bun/internal-intercom-broker.js.map +1 -1
- package/dist/bun/register-theme-validator.js +6 -0
- package/dist/bun/register-theme-validator.js.map +1 -0
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +1102 -0
- package/dist/cli/auth-cli.code.js.map +1 -0
- package/dist/cli/auth-cli.impl.js +30 -1096
- package/dist/cli/auth-cli.impl.js.map +1 -1
- package/dist/cli/auth-cli.js +11 -7
- package/dist/cli/blueprint-command.code.js +906 -0
- package/dist/cli/blueprint-command.code.js.map +1 -0
- package/dist/cli/blueprint-command.impl.js +30 -900
- package/dist/cli/blueprint-command.impl.js.map +1 -1
- package/dist/cli/blueprint-command.js +11 -7
- package/dist/cli/intercom-command.code.js +153 -0
- package/dist/cli/intercom-command.code.js.map +1 -0
- package/dist/cli/intercom-command.impl.js +33 -105
- package/dist/cli/intercom-command.impl.js.map +1 -1
- package/dist/cli/intercom-command.js +11 -7
- package/dist/cli/list-models.code.js +60 -0
- package/dist/cli/list-models.code.js.map +1 -0
- package/dist/cli/list-models.impl.js +33 -57
- package/dist/cli/list-models.impl.js.map +1 -1
- package/dist/cli/list-models.js +11 -7
- package/dist/cli/session-picker.code.js +55 -0
- package/dist/cli/session-picker.code.js.map +1 -0
- package/dist/cli/session-picker.impl.js +33 -52
- package/dist/cli/session-picker.impl.js.map +1 -1
- package/dist/cli/session-picker.js +11 -7
- package/dist/cli/startup-ui.code.js +5 -0
- package/dist/cli/startup-ui.code.js.map +1 -0
- package/dist/cli/startup-ui.impl.js +35 -4
- package/dist/cli/startup-ui.js +11 -7
- package/dist/cli/storage-command.code.js +3 -0
- package/dist/cli/storage-command.code.js.map +1 -0
- package/dist/cli/storage-command.impl.js +35 -2
- package/dist/cli/storage-command.js +11 -7
- package/dist/cli/storage-search-session.code.js +189 -0
- package/dist/cli/storage-search-session.code.js.map +1 -0
- package/dist/cli/storage-search-session.impl.js +33 -186
- package/dist/cli/storage-search-session.impl.js.map +1 -1
- package/dist/cli/storage-search-session.js +11 -7
- package/dist/cli/team-command.code.js +217 -0
- package/dist/cli/team-command.code.js.map +1 -0
- package/dist/cli/team-command.impl.js +32 -213
- package/dist/cli/team-command.impl.js.map +1 -1
- package/dist/cli/team-command.js +11 -7
- package/dist/cli.js +60 -11
- package/dist/cli.js.map +1 -1
- package/dist/config.js +1 -1
- package/dist/core/agent-session-methods.d.ts +4 -3
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +5 -0
- package/dist/core/compaction/compaction.d.ts +6 -0
- package/dist/core/compaction/model-resolver.d.ts +1 -1
- package/dist/core/debug.code.js +3 -0
- package/dist/core/debug.code.js.map +1 -0
- package/dist/core/debug.impl.js +35 -2
- package/dist/core/debug.js +11 -7
- package/dist/core/default-model-api-prewarm.d.ts +5 -0
- package/dist/core/export-html/card-projection.code.js +257 -0
- package/dist/core/export-html/card-projection.code.js.map +1 -0
- package/dist/core/export-html/card-projection.impl.js +34 -255
- package/dist/core/export-html/card-projection.impl.js.map +1 -1
- package/dist/core/export-html/card-projection.js +11 -7
- package/dist/core/export-html/index.code.js +655 -0
- package/dist/core/export-html/index.code.js.map +1 -0
- package/dist/core/export-html/index.impl.js +30 -604
- package/dist/core/export-html/index.impl.js.map +1 -1
- package/dist/core/export-html/index.js +11 -7
- package/dist/core/export-html/json-spans.code.js +3 -0
- package/dist/core/export-html/json-spans.code.js.map +1 -0
- package/dist/core/export-html/json-spans.impl.js +35 -2
- package/dist/core/export-html/json-spans.js +11 -7
- package/dist/core/export-html/oversized-render-inputs.code.js +125 -0
- package/dist/core/export-html/oversized-render-inputs.code.js.map +1 -0
- package/dist/core/export-html/oversized-render-inputs.impl.js +31 -120
- package/dist/core/export-html/oversized-render-inputs.impl.js.map +1 -1
- package/dist/core/export-html/oversized-render-inputs.js +11 -7
- package/dist/core/export-html/tool-renderer.code.js +350 -0
- package/dist/core/export-html/tool-renderer.code.js.map +1 -0
- package/dist/core/export-html/tool-renderer.impl.js +33 -347
- package/dist/core/export-html/tool-renderer.impl.js.map +1 -1
- package/dist/core/export-html/tool-renderer.js +11 -7
- package/dist/core/extensions/jiti-loader.code.js +3 -0
- package/dist/core/extensions/jiti-loader.code.js.map +1 -0
- package/dist/core/extensions/jiti-loader.impl.js +35 -2
- package/dist/core/extensions/jiti-loader.js +11 -7
- package/dist/core/extensions/jiti-static-loader.code.js +3 -0
- package/dist/core/extensions/jiti-static-loader.code.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.impl.js +35 -2
- package/dist/core/extensions/jiti-static-loader.js +11 -7
- package/dist/core/extensions/loader-host-modules.code.js +3 -0
- package/dist/core/extensions/loader-host-modules.code.js.map +1 -0
- package/dist/core/extensions/loader-host-modules.impl.js +35 -2
- package/dist/core/extensions/loader-host-modules.js +11 -7
- package/dist/core/extensions/loader-virtual-modules.d.ts +1 -6
- package/dist/core/extensions/loader-virtual-modules.js +1 -1
- package/dist/core/extensions/runner-context.js +3 -3
- package/dist/core/extensions/session-events.d.ts +4 -0
- package/dist/core/extensions/session-events.js.map +1 -1
- package/dist/core/intercom-broker-control-host.code.js +5 -0
- package/dist/core/intercom-broker-control-host.code.js.map +1 -0
- package/dist/core/intercom-broker-control-host.impl.js +35 -4
- package/dist/core/intercom-broker-control-host.js +11 -7
- package/dist/core/intercom-broker-control.code.js +63 -0
- package/dist/core/intercom-broker-control.code.js.map +1 -0
- package/dist/core/intercom-broker-control.d.ts +21 -0
- package/dist/core/intercom-broker-control.impl.js +35 -17
- package/dist/core/intercom-broker-control.impl.js.map +1 -1
- package/dist/core/intercom-broker-control.js +11 -7
- package/dist/core/package-manager-storage-adapters.code.js +3 -0
- package/dist/core/package-manager-storage-adapters.code.js.map +1 -0
- package/dist/core/package-manager-storage-adapters.impl.js +35 -2
- package/dist/core/package-manager-storage-adapters.js +11 -7
- package/dist/core/process-start-token.d.ts +8 -2
- package/dist/core/process-tree-containment.d.ts +27 -0
- package/dist/core/queued-message-delivery.d.ts +5 -2
- package/dist/core/resume/blueprint/process.d.ts +3 -1
- package/dist/core/sdk.code.js +9 -0
- package/dist/core/sdk.code.js.map +1 -0
- package/dist/core/sdk.impl.js +35 -8
- package/dist/core/sdk.js +11 -7
- package/dist/core/session-manager-core.d.ts +15 -5
- package/dist/core/session-manager-core.js +195 -38
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-list.code.js +3 -0
- package/dist/core/session-manager-list.code.js.map +1 -0
- package/dist/core/session-manager-list.impl.js +35 -2
- package/dist/core/session-manager-list.js +11 -7
- package/dist/core/session-manager-types.d.ts +20 -0
- package/dist/core/session-manager.code.js +8 -0
- package/dist/core/session-manager.code.js.map +1 -0
- package/dist/core/session-manager.d.ts +1 -1
- package/dist/core/session-manager.impl.js +35 -7
- package/dist/core/session-manager.js +11 -7
- package/dist/core/session-storage.code.js +3 -0
- package/dist/core/session-storage.code.js.map +1 -0
- package/dist/core/session-storage.impl.js +35 -2
- package/dist/core/session-storage.js +11 -7
- package/dist/core/storage/file-identity.d.ts +3 -0
- package/dist/core/storage/file-identity.js +296 -86
- package/dist/core/storage/file-identity.js.map +1 -1
- package/dist/core/storage/index.d.ts +1 -1
- package/dist/core/storage/index.js +52 -7
- package/dist/core/storage/index.js.map +1 -1
- package/dist/core/storage/node-sqlite-thread.js +47 -2
- package/dist/core/storage/node-sqlite.js +49 -4
- package/dist/core/storage/node-sqlite.js.map +1 -1
- package/dist/core/storage/offline-snapshot-file.code.js +37 -0
- package/dist/core/storage/offline-snapshot-file.code.js.map +1 -0
- package/dist/core/storage/offline-snapshot-file.impl.js +33 -34
- package/dist/core/storage/offline-snapshot-file.impl.js.map +1 -1
- package/dist/core/storage/offline-snapshot-file.js +11 -7
- package/dist/core/storage/provider.js +52 -7
- package/dist/core/storage/selection.js +49 -4
- package/dist/core/storage/session/branch-fork-source.code.js +146 -0
- package/dist/core/storage/session/branch-fork-source.code.js.map +1 -0
- package/dist/core/storage/session/branch-fork-source.impl.js +32 -97
- package/dist/core/storage/session/branch-fork-source.impl.js.map +1 -1
- package/dist/core/storage/session/branch-fork-source.js +11 -7
- package/dist/core/storage/session/card-view.code.js +60 -0
- package/dist/core/storage/session/card-view.code.js.map +1 -0
- package/dist/core/storage/session/card-view.impl.js +34 -58
- package/dist/core/storage/session/card-view.impl.js.map +1 -1
- package/dist/core/storage/session/card-view.js +11 -7
- package/dist/core/storage/session/child-reader.code.js +139 -0
- package/dist/core/storage/session/child-reader.code.js.map +1 -0
- package/dist/core/storage/session/child-reader.d.ts +1 -0
- package/dist/core/storage/session/child-reader.impl.js +33 -91
- package/dist/core/storage/session/child-reader.impl.js.map +1 -1
- package/dist/core/storage/session/child-reader.js +11 -7
- package/dist/core/storage/session/chunked-resume-projection.code.js +3 -0
- package/dist/core/storage/session/chunked-resume-projection.code.js.map +1 -0
- package/dist/core/storage/session/chunked-resume-projection.impl.js +35 -2
- package/dist/core/storage/session/chunked-resume-projection.js +11 -7
- package/dist/core/storage/session/expanded-child-details.code.js +684 -0
- package/dist/core/storage/session/expanded-child-details.code.js.map +1 -0
- package/dist/core/storage/session/expanded-child-details.impl.js +31 -634
- package/dist/core/storage/session/expanded-child-details.impl.js.map +1 -1
- package/dist/core/storage/session/expanded-child-details.js +11 -7
- package/dist/core/storage/session/fork-row-bytes.code.js +3 -0
- package/dist/core/storage/session/fork-row-bytes.code.js.map +1 -0
- package/dist/core/storage/session/fork-row-bytes.impl.js +35 -2
- package/dist/core/storage/session/fork-row-bytes.js +11 -7
- package/dist/core/storage/session/fork-row-index.code.js +3 -0
- package/dist/core/storage/session/fork-row-index.code.js.map +1 -0
- package/dist/core/storage/session/fork-row-index.impl.js +35 -2
- package/dist/core/storage/session/fork-row-index.js +11 -7
- package/dist/core/storage/session/fork-staging.code.js +580 -0
- package/dist/core/storage/session/fork-staging.code.js.map +1 -0
- package/dist/core/storage/session/fork-staging.impl.js +30 -574
- package/dist/core/storage/session/fork-staging.impl.js.map +1 -1
- package/dist/core/storage/session/fork-staging.js +11 -7
- package/dist/core/storage/session/fork-window.code.js +522 -0
- package/dist/core/storage/session/fork-window.code.js.map +1 -0
- package/dist/core/storage/session/fork-window.impl.js +30 -471
- package/dist/core/storage/session/fork-window.impl.js.map +1 -1
- package/dist/core/storage/session/fork-window.js +11 -7
- package/dist/core/storage/session/history-pages.code.js +3 -0
- package/dist/core/storage/session/history-pages.code.js.map +1 -0
- package/dist/core/storage/session/history-pages.impl.js +35 -2
- package/dist/core/storage/session/history-pages.js +11 -7
- package/dist/core/storage/session/jsonl-entry-projection.code.js +3 -0
- package/dist/core/storage/session/jsonl-entry-projection.code.js.map +1 -0
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +35 -2
- package/dist/core/storage/session/jsonl-entry-projection.js +11 -7
- package/dist/core/storage/session/jsonl-session-store.code.js +3 -0
- package/dist/core/storage/session/jsonl-session-store.code.js.map +1 -0
- package/dist/core/storage/session/jsonl-session-store.impl.js +35 -2
- package/dist/core/storage/session/jsonl-session-store.js +11 -7
- package/dist/core/storage/session/memory-session-store.code.js +3 -0
- package/dist/core/storage/session/memory-session-store.code.js.map +1 -0
- package/dist/core/storage/session/memory-session-store.impl.js +35 -2
- package/dist/core/storage/session/memory-session-store.js +11 -7
- package/dist/core/storage/session/pinned-branch-resume.code.js +117 -0
- package/dist/core/storage/session/pinned-branch-resume.code.js.map +1 -0
- package/dist/core/storage/session/pinned-branch-resume.impl.js +33 -69
- package/dist/core/storage/session/pinned-branch-resume.impl.js.map +1 -1
- package/dist/core/storage/session/pinned-branch-resume.js +11 -7
- package/dist/core/storage/session/released-history-files.code.js +465 -0
- package/dist/core/storage/session/released-history-files.code.js.map +1 -0
- package/dist/core/storage/session/released-history-files.impl.js +32 -461
- package/dist/core/storage/session/released-history-files.impl.js.map +1 -1
- package/dist/core/storage/session/released-history-files.js +11 -7
- package/dist/core/storage/session/resident-fork-rows.code.js +57 -0
- package/dist/core/storage/session/resident-fork-rows.code.js.map +1 -0
- package/dist/core/storage/session/resident-fork-rows.impl.js +32 -53
- package/dist/core/storage/session/resident-fork-rows.impl.js.map +1 -1
- package/dist/core/storage/session/resident-fork-rows.js +11 -7
- package/dist/core/storage/session/session-resume.code.js +3 -0
- package/dist/core/storage/session/session-resume.code.js.map +1 -0
- package/dist/core/storage/session/session-resume.impl.js +35 -2
- package/dist/core/storage/session/session-resume.js +11 -7
- package/dist/core/storage/session/snapshot-cut.code.js +3 -0
- package/dist/core/storage/session/snapshot-cut.code.js.map +1 -0
- package/dist/core/storage/session/snapshot-cut.impl.js +35 -2
- package/dist/core/storage/session/snapshot-cut.js +11 -7
- package/dist/core/storage/session/snapshot-history.code.js +107 -0
- package/dist/core/storage/session/snapshot-history.code.js.map +1 -0
- package/dist/core/storage/session/snapshot-history.impl.js +34 -60
- package/dist/core/storage/session/snapshot-history.impl.js.map +1 -1
- package/dist/core/storage/session/snapshot-history.js +11 -7
- package/dist/core/storage/session/sql-session-store.code.js +3 -0
- package/dist/core/storage/session/sql-session-store.code.js.map +1 -0
- package/dist/core/storage/session/sql-session-store.impl.js +35 -2
- package/dist/core/storage/session/sql-session-store.js +11 -7
- package/dist/core/storage/session/tree-outline.code.js +3 -0
- package/dist/core/storage/session/tree-outline.code.js.map +1 -0
- package/dist/core/storage/session/tree-outline.impl.js +35 -2
- package/dist/core/storage/session/tree-outline.js +11 -7
- package/dist/core/storage/session/tree-presentation.code.js +342 -0
- package/dist/core/storage/session/tree-presentation.code.js.map +1 -0
- package/dist/core/storage/session/tree-presentation.impl.js +31 -337
- package/dist/core/storage/session/tree-presentation.impl.js.map +1 -1
- package/dist/core/storage/session/tree-presentation.js +11 -7
- package/dist/core/storage/session/types.d.ts +26 -0
- package/dist/core/storage/storage-status.code.js +3 -0
- package/dist/core/storage/storage-status.code.js.map +1 -0
- package/dist/core/storage/storage-status.impl.js +35 -2
- package/dist/core/storage/storage-status.js +11 -7
- package/dist/core/storage/team.code.js +3 -0
- package/dist/core/storage/team.code.js.map +1 -0
- package/dist/core/storage/team.impl.js +35 -2
- package/dist/core/storage/team.js +11 -7
- package/dist/core/structured-output/index.code.js +3 -0
- package/dist/core/structured-output/index.code.js.map +1 -0
- package/dist/core/structured-output/index.impl.js +35 -2
- package/dist/core/structured-output/index.js +11 -7
- package/dist/core/tasks/command-output.d.ts +4 -1
- package/dist/core/tasks/supervisor.d.ts +2 -0
- package/dist/core/tasks/task-completion-entry.code.js +254 -0
- package/dist/core/tasks/task-completion-entry.code.js.map +1 -0
- package/dist/core/tasks/task-completion-entry.impl.js +33 -251
- package/dist/core/tasks/task-completion-entry.impl.js.map +1 -1
- package/dist/core/tasks/task-completion-entry.js +11 -7
- package/dist/core/tasks/task-file-history.code.js +424 -0
- package/dist/core/tasks/task-file-history.code.js.map +1 -0
- package/dist/core/tasks/task-file-history.impl.js +32 -375
- package/dist/core/tasks/task-file-history.impl.js.map +1 -1
- package/dist/core/tasks/task-file-history.js +11 -7
- package/dist/core/tasks/{task-reference-archive.impl.js → task-reference-archive.code.js} +51 -6
- package/dist/core/tasks/{task-reference-archive.impl.js.map → task-reference-archive.code.js.map} +1 -1
- package/dist/core/tasks/task-reference-archive.js +11 -7
- package/dist/core/tasks/{task-reference-identity.impl.js → task-reference-identity.code.js} +1 -1
- package/dist/core/tasks/{task-reference-identity.impl.js.map → task-reference-identity.code.js.map} +1 -1
- package/dist/core/tasks/task-reference-identity.js +11 -7
- package/dist/core/tasks/task-reference-stream.code.js +3 -0
- package/dist/core/tasks/task-reference-stream.code.js.map +1 -0
- package/dist/core/tasks/task-reference-stream.impl.js +35 -2
- package/dist/core/tasks/task-reference-stream.js +11 -7
- package/dist/core/tasks/task-unsaved-answer.code.js +3 -0
- package/dist/core/tasks/task-unsaved-answer.code.js.map +1 -0
- package/dist/core/tasks/task-unsaved-answer.impl.js +35 -2
- package/dist/core/tasks/task-unsaved-answer.js +11 -7
- package/dist/core/tasks/task-view-source.code.js +3 -0
- package/dist/core/tasks/task-view-source.code.js.map +1 -0
- package/dist/core/tasks/task-view-source.d.ts +9 -0
- package/dist/core/tasks/task-view-source.impl.js +35 -2
- package/dist/core/tasks/task-view-source.js +12 -8
- package/dist/core/tools/read-url.code.js +1530 -0
- package/dist/core/tools/read-url.code.js.map +1 -0
- package/dist/core/tools/read-url.impl.js +30 -1524
- package/dist/core/tools/read-url.impl.js.map +1 -1
- package/dist/core/tools/read-url.js +11 -7
- package/dist/core/worktree-snapshot/blob-store.js +50 -5
- package/dist/core/worktree-snapshot/errors.code.js +6 -0
- package/dist/core/worktree-snapshot/errors.code.js.map +1 -0
- package/dist/core/worktree-snapshot/errors.impl.js +35 -5
- package/dist/core/worktree-snapshot/errors.js +11 -7
- package/dist/core/worktree-snapshot/session-index-reset.code.js +136 -0
- package/dist/core/worktree-snapshot/session-index-reset.code.js.map +1 -0
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +34 -134
- package/dist/core/worktree-snapshot/session-index-reset.impl.js.map +1 -1
- package/dist/core/worktree-snapshot/session-index-reset.js +11 -7
- package/dist/extensions/codemode/execute.code.js +618 -0
- package/dist/extensions/codemode/execute.code.js.map +1 -0
- package/dist/extensions/codemode/execute.impl.js +30 -612
- package/dist/extensions/codemode/execute.impl.js.map +1 -1
- package/dist/extensions/codemode/execute.js +11 -7
- package/dist/extensions/codemode/renderer.code.js +110 -0
- package/dist/extensions/codemode/renderer.code.js.map +1 -0
- package/dist/extensions/codemode/renderer.impl.js +33 -107
- package/dist/extensions/codemode/renderer.impl.js.map +1 -1
- package/dist/extensions/codemode/renderer.js +11 -7
- package/dist/extensions/mcp/cli.code.js +565 -0
- package/dist/extensions/mcp/cli.code.js.map +1 -0
- package/dist/extensions/mcp/cli.impl.js +32 -561
- package/dist/extensions/mcp/cli.impl.js.map +1 -1
- package/dist/extensions/mcp/cli.js +11 -7
- package/dist/extensions/mcp/cli.lazy.code.js +52 -0
- package/dist/extensions/mcp/cli.lazy.code.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.impl.js +36 -7
- package/dist/extensions/mcp/cli.lazy.impl.js.map +1 -1
- package/dist/extensions/mcp/cli.lazy.js +11 -7
- package/dist/extensions/mcp/client/transports/stdio.d.ts +2 -0
- package/dist/extensions/mcp/runtime.code.js +5 -0
- package/dist/extensions/mcp/runtime.code.js.map +1 -0
- package/dist/extensions/mcp/runtime.impl.js +35 -4
- package/dist/extensions/mcp/runtime.js +11 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/main-first-time-setup.code.js +12 -0
- package/dist/main-first-time-setup.code.js.map +1 -0
- package/dist/main-first-time-setup.impl.js +35 -11
- package/dist/main-first-time-setup.impl.js.map +1 -1
- package/dist/main-first-time-setup.js +11 -7
- package/dist/main.d.ts +1 -1
- package/dist/main.js +2 -2
- package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts +6 -1
- package/dist/modes/interactive/agent-view/contracts.d.ts +4 -0
- package/dist/modes/interactive/chat-reader-records.d.ts +1 -1
- package/dist/modes/interactive/components/stored-tree-view.code.js +338 -0
- package/dist/modes/interactive/components/stored-tree-view.code.js.map +1 -0
- package/dist/modes/interactive/components/stored-tree-view.impl.js +33 -290
- package/dist/modes/interactive/components/stored-tree-view.impl.js.map +1 -1
- package/dist/modes/interactive/components/stored-tree-view.js +11 -7
- package/dist/modes/interactive/components/task-selection-state.d.ts +8 -3
- package/dist/modes/interactive/components/task-transcript-page.d.ts +1 -0
- package/dist/modes/interactive/components/user-message-selector-archive.code.js +191 -0
- package/dist/modes/interactive/components/user-message-selector-archive.code.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +34 -189
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector-archive.js +11 -7
- package/dist/modes/interactive/interactive-mode-base.d.ts +6 -0
- package/dist/modes/interactive/interactive-mode.js +1 -1
- package/dist/modes/interactive/interactive-queueing.d.ts +4 -0
- package/dist/modes/interactive/interactive-render-chat.d.ts +22 -0
- package/dist/modes/interactive/interactive-startup.d.ts +2 -0
- package/dist/modes/interactive/program-status-reporter.d.ts +2 -1
- package/dist/modes/interactive/startup-shell-eligibility.js +1 -1
- package/dist/modes/interactive/steering-queue-controller.d.ts +4 -0
- package/dist/modes/interactive/theme/theme-schema-factory.d.ts +26 -0
- package/dist/modes/interactive/theme/theme-schema.d.ts +4 -5
- package/dist/modes/interactive-engine/engine-prewarm.d.ts +30 -5
- package/dist/modes/interactive-engine/engine-prewarm.js +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.d.ts +7 -0
- package/dist/modes/interactive-engine/protocol.d.ts +32 -1
- package/dist/modes/rpc/agent-view-rpc-types.d.ts +12 -1
- package/dist/modes/rpc/agent-view-rpc-types.js.map +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +3 -1
- package/dist/modes/rpc/rpc-types.d.ts +12 -0
- package/dist/package-manager-cli.code.js +1140 -0
- package/dist/package-manager-cli.code.js.map +1 -0
- package/dist/package-manager-cli.impl.js +36 -1067
- package/dist/package-manager-cli.impl.js.map +1 -1
- package/dist/package-manager-cli.js +11 -7
- package/dist/rpc-entry.js +2 -2
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/10.js +1 -1
- package/dist/startup-stages/11.js +1 -1
- package/dist/startup-stages/12.js +1 -1
- package/dist/startup-stages/13.js +1 -0
- package/dist/startup-stages/2.js +1 -7
- package/dist/startup-stages/3.js +6 -2
- package/dist/startup-stages/4.js +2 -1
- package/dist/startup-stages/5.js +1 -7
- package/dist/startup-stages/6.js +7 -10
- package/dist/startup-stages/7.js +10 -3
- package/dist/startup-stages/8.js +3 -6
- package/dist/startup-stages/9.js +6 -1
- package/dist/startup-stages/stages.json +1 -1
- package/dist/utils/canonical-path.js +2 -0
- package/dist/utils/canonical-path.js.map +1 -1
- package/dist/utils/child-process.d.ts +41 -1
- package/dist/utils/compile-cache-warmup-host.js +63 -18
- package/dist/utils/compile-cache-warmup-host.js.map +1 -1
- package/dist/utils/credential-redaction.d.ts +50 -1
- package/dist/utils/interactive-engine-bootstrap.d.ts +2 -0
- package/dist/utils/interactive-engine-env.d.ts +2 -0
- package/dist/utils/memoize-async.d.ts +32 -0
- package/dist/utils/memoize-async.js +91 -0
- package/dist/utils/memoize-async.js.map +1 -0
- package/dist/utils/photon.js +19 -29
- package/dist/utils/photon.js.map +1 -1
- package/dist/utils/shell.d.ts +7 -4
- package/dist/utils/startup-database-spare.code.js +108 -0
- package/dist/utils/startup-database-spare.code.js.map +1 -0
- package/dist/utils/startup-database-spare.impl.js +33 -105
- package/dist/utils/startup-database-spare.impl.js.map +1 -1
- package/dist/utils/startup-database-spare.js +11 -7
- package/dist/utils/tools-manager.code.js +3 -0
- package/dist/utils/tools-manager.code.js.map +1 -0
- package/dist/utils/tools-manager.impl.js +35 -2
- package/dist/utils/tools-manager.js +11 -7
- package/dist/utils/windows-cwd.js +585 -0
- package/dist/utils/windows-cwd.js.map +1 -0
- package/docs/extensions.md +1 -1
- package/docs/getting-started/installation.md +2 -0
- package/docs/intercom/operations.md +1 -0
- package/docs/reference/cli.md +1 -1
- package/package.json +24 -24
- package/dist/_shared/mode-shared-HP7GUA7J.js.map +0 -1
- package/dist/_shared/p1a-prewarm-YK3KDTLN.js.map +0 -1
- package/dist/_shared/p1b-elig-PXQA2FYP.js.map +0 -1
- package/dist/_shared/startup-0-0-X4NF3GKM.js.map +0 -1
- package/dist/_shared/startup-0-1-7QTG6VJZ.js.map +0 -1
- package/dist/_shared/startup-0-2-KFDYPDJK.js.map +0 -1
- package/dist/_shared/startup-8-1-KQJBDKRU.js.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { __name } from "./rolldown-runtime-BGM3D5V3.js";
|
|
2
|
-
import { ENV_TIMING, createModuleRequire, getAgentDir, getCustomThemesDir, getEnvValue, getThemesDir, stripBom } from "./p0-cli-
|
|
3
|
-
import { realpath } from "node:fs/promises";
|
|
2
|
+
import { ENV_TIMING, createModuleRequire, getAgentDir, getCustomThemesDir, getEnvValue, getThemesDir, stripBom } from "./p0-cli-BB45ZQY6.js";
|
|
3
|
+
import { readFile, realpath } from "node:fs/promises";
|
|
4
4
|
import { existsSync, readFileSync } from "fs";
|
|
5
5
|
import * as path$1 from "path";
|
|
6
6
|
import { join } from "path";
|
|
7
7
|
import * as path$2 from "node:path";
|
|
8
|
+
import { dirname as dirname$1, resolve as resolve$1 } from "node:path";
|
|
8
9
|
import * as fs$2 from "node:fs";
|
|
9
10
|
import { realpathSync as realpathSync$1, watch } from "node:fs";
|
|
10
11
|
import { KeybindingsManager, TUI_KEYBINDINGS, clickableHintText, clickableKeyTextHint, clickableKeysHint, colorToHex, colorToOkhsl, colorToOklch, colorToRgb, getKeybindings, hintKeyParts, hintKeyParts as hintKeyParts$1, okhslColor, oklabToOkhslLightness, oklchColor, parseColor, rgbColor, slashCommandHint, truncateToWidth, visibleWidth } from "@bastani/atomic-tui";
|
|
11
12
|
import { Chalk } from "chalk";
|
|
12
13
|
import { access as access$1, readFile as readFile$1 } from "fs/promises";
|
|
13
|
-
import {
|
|
14
|
-
import { Type } from "@bastani/atomic-ai/utils/typebox/index";
|
|
14
|
+
import { memoizeAsync } from "../utils/memoize-async.js";
|
|
15
15
|
import { createRequire } from "module";
|
|
16
16
|
import { fileURLToPath } from "url";
|
|
17
17
|
// dist/core/keybindings.js
|
|
@@ -518,14 +518,14 @@ function printTimings() {
|
|
|
518
518
|
for (const [namespace, timingNamespace] of timingNamespaces) printTimingGroup(`Startup Timings: ${namespace}`, timingNamespace);
|
|
519
519
|
}
|
|
520
520
|
// dist/main-early-input.js
|
|
521
|
-
const __atomicDistModuleUrl$
|
|
521
|
+
const __atomicDistModuleUrl$3 = new URL("../main-early-input.js", import.meta.url).href;
|
|
522
522
|
const STARTUP_DIALOG_INPUT_GRACE_MS = 25;
|
|
523
523
|
const STARTUP_DIALOG_INPUT_DRAIN_MAX_MS = 2e3;
|
|
524
524
|
const STARTUP_DIALOG_INPUT_DRAIN_POLL_MS = 5;
|
|
525
525
|
let nativePendingInput;
|
|
526
526
|
function osStdinPendingInput() {
|
|
527
527
|
if (nativePendingInput === void 0) try {
|
|
528
|
-
const read = createModuleRequire(__atomicDistModuleUrl$
|
|
528
|
+
const read = createModuleRequire(__atomicDistModuleUrl$3)("@bastani/atomic-natives").pendingStdinInput;
|
|
529
529
|
nativePendingInput = typeof read === "function" ? () => read() ?? null : null;
|
|
530
530
|
} catch {
|
|
531
531
|
nativePendingInput = null;
|
|
@@ -2677,68 +2677,144 @@ var Theme = class {
|
|
|
2677
2677
|
return (str) => this.fg("bashMode", str);
|
|
2678
2678
|
}
|
|
2679
2679
|
};
|
|
2680
|
-
// dist/modes/interactive/theme/theme-schema.js
|
|
2681
|
-
function
|
|
2680
|
+
// dist/modes/interactive/theme/theme-schema-factory.js
|
|
2681
|
+
function createColorValueSchema(Type, description) {
|
|
2682
2682
|
return Type.Union([Type.String({ description: "Hex color (#RRGGBB), OKHSL color (okhsl(H S L)), variable reference, or empty string for terminal default" }), Type.Integer({
|
|
2683
2683
|
minimum: 0,
|
|
2684
2684
|
maximum: 255,
|
|
2685
2685
|
description: "256-color palette index (0-255)"
|
|
2686
2686
|
})], description ? { description } : {});
|
|
2687
2687
|
}
|
|
2688
|
-
|
|
2689
|
-
function themeTokenProperties(tokens) {
|
|
2688
|
+
function themeTokenProperties(Type, tokens) {
|
|
2690
2689
|
const properties = {};
|
|
2691
2690
|
for (const [name, descriptor] of Object.entries(tokens)) {
|
|
2692
|
-
const schema =
|
|
2691
|
+
const schema = createColorValueSchema(Type, descriptor.description);
|
|
2693
2692
|
properties[name] = descriptor.fallback === void 0 ? schema : Type.Optional(schema);
|
|
2694
2693
|
}
|
|
2695
2694
|
return properties;
|
|
2696
2695
|
}
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
const ThemeJsonSchema = Type.Object({
|
|
2702
|
-
$schema: Type.Optional(Type.String({ description: "JSON schema reference" })),
|
|
2703
|
-
name: Type.String({
|
|
2704
|
-
pattern: "^[^/]+$",
|
|
2705
|
-
description: "Theme name. Must not contain '/' because it is reserved for automatic light/dark theme settings."
|
|
2706
|
-
}),
|
|
2707
|
-
vars: Type.Optional(Type.Record(Type.String(), ColorValueSchema, { description: "Reusable color variables" })),
|
|
2708
|
-
colors: ThemeColorsSchema,
|
|
2709
|
-
workingIndicator: Type.Optional(Type.Object({
|
|
2710
|
-
dark: Type.Optional(ColorValueSchema),
|
|
2711
|
-
lift: Type.Optional(ColorValueSchema),
|
|
2712
|
-
muted: Type.Optional(ColorValueSchema),
|
|
2713
|
-
accent: Type.Optional(ColorValueSchema),
|
|
2714
|
-
bright: Type.Optional(ColorValueSchema),
|
|
2715
|
-
peak: Type.Optional(ColorValueSchema)
|
|
2716
|
-
}, {
|
|
2717
|
-
description: "Optional partial six-tone palette for Atomic's ordinary working identity",
|
|
2696
|
+
function createThemeJsonSchema(Type) {
|
|
2697
|
+
const ColorValueSchema = createColorValueSchema(Type);
|
|
2698
|
+
const ThemeColorsSchema = Type.Unsafe(Type.Object(themeTokenProperties(Type, THEME_TOKENS), {
|
|
2699
|
+
description: "Theme color definitions (scrollbarThumb and the search highlight colors are optional and fall back to compatible colors)",
|
|
2718
2700
|
additionalProperties: false
|
|
2719
|
-
}))
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2701
|
+
}));
|
|
2702
|
+
return Type.Object({
|
|
2703
|
+
$schema: Type.Optional(Type.String({ description: "JSON schema reference" })),
|
|
2704
|
+
name: Type.String({
|
|
2705
|
+
pattern: "^[^/]+$",
|
|
2706
|
+
description: "Theme name. Must not contain '/' because it is reserved for automatic light/dark theme settings."
|
|
2707
|
+
}),
|
|
2708
|
+
vars: Type.Optional(Type.Record(Type.String(), ColorValueSchema, { description: "Reusable color variables" })),
|
|
2709
|
+
colors: ThemeColorsSchema,
|
|
2710
|
+
workingIndicator: Type.Optional(Type.Object({
|
|
2711
|
+
dark: Type.Optional(ColorValueSchema),
|
|
2712
|
+
lift: Type.Optional(ColorValueSchema),
|
|
2713
|
+
muted: Type.Optional(ColorValueSchema),
|
|
2714
|
+
accent: Type.Optional(ColorValueSchema),
|
|
2715
|
+
bright: Type.Optional(ColorValueSchema),
|
|
2716
|
+
peak: Type.Optional(ColorValueSchema)
|
|
2717
|
+
}, {
|
|
2718
|
+
description: "Optional partial six-tone palette for Atomic's ordinary working identity",
|
|
2719
|
+
additionalProperties: false
|
|
2720
|
+
})),
|
|
2721
|
+
export: Type.Optional(Type.Object({
|
|
2722
|
+
pageBg: Type.Optional(createColorValueSchema(Type, "Page background color")),
|
|
2723
|
+
cardBg: Type.Optional(createColorValueSchema(Type, "Card/container background color")),
|
|
2724
|
+
infoBg: Type.Optional(createColorValueSchema(Type, "Info sections background (system prompt, notices)"))
|
|
2725
|
+
}, {
|
|
2726
|
+
description: "Optional colors for HTML export (defaults derived from userMessageBg if not specified)",
|
|
2727
|
+
additionalProperties: false
|
|
2728
|
+
}))
|
|
2724
2729
|
}, {
|
|
2725
|
-
|
|
2730
|
+
title: "Atomic Coding Agent Theme",
|
|
2731
|
+
description: "Theme schema for the Atomic coding agent",
|
|
2726
2732
|
additionalProperties: false
|
|
2727
|
-
})
|
|
2728
|
-
}
|
|
2729
|
-
title: "Atomic Coding Agent Theme",
|
|
2730
|
-
description: "Theme schema for the Atomic coding agent",
|
|
2731
|
-
additionalProperties: false
|
|
2732
|
-
});
|
|
2733
|
-
const validateThemeJson = Compile(ThemeJsonSchema);
|
|
2733
|
+
});
|
|
2734
|
+
}
|
|
2734
2735
|
// dist/modes/interactive/theme/theme-parse.js
|
|
2736
|
+
const __atomicDistModuleUrl$2 = new URL("../modes/interactive/theme/theme-parse.js", import.meta.url).href;
|
|
2737
|
+
const THEME_TOKEN_MAP = THEME_TOKENS;
|
|
2738
|
+
const TOP_LEVEL_KEYS = /* @__PURE__ */ new Set([
|
|
2739
|
+
"$schema",
|
|
2740
|
+
"name",
|
|
2741
|
+
"vars",
|
|
2742
|
+
"colors",
|
|
2743
|
+
"workingIndicator",
|
|
2744
|
+
"export"
|
|
2745
|
+
]);
|
|
2746
|
+
const WORKING_INDICATOR_KEYS = /* @__PURE__ */ new Set([
|
|
2747
|
+
"dark",
|
|
2748
|
+
"lift",
|
|
2749
|
+
"muted",
|
|
2750
|
+
"accent",
|
|
2751
|
+
"bright",
|
|
2752
|
+
"peak"
|
|
2753
|
+
]);
|
|
2754
|
+
const EXPORT_KEYS = /* @__PURE__ */ new Set([
|
|
2755
|
+
"pageBg",
|
|
2756
|
+
"cardBg",
|
|
2757
|
+
"infoBg"
|
|
2758
|
+
]);
|
|
2759
|
+
const REQUIRED_COLOR_TOKENS = Object.entries(THEME_TOKEN_MAP).filter(([, descriptor]) => descriptor.fallback === void 0).map(([name]) => name);
|
|
2760
|
+
const TYPEBOX_THEME_DEPS_SYMBOL = /* @__PURE__ */ Symbol.for("atomic.typeboxThemeDeps.v1");
|
|
2761
|
+
let cachedValidator;
|
|
2762
|
+
function getThemeValidator() {
|
|
2763
|
+
if (cachedValidator !== void 0) return cachedValidator;
|
|
2764
|
+
const bundledDeps = globalThis[TYPEBOX_THEME_DEPS_SYMBOL];
|
|
2765
|
+
if (bundledDeps !== void 0) {
|
|
2766
|
+
cachedValidator = bundledDeps.Compile(createThemeJsonSchema(bundledDeps.Type));
|
|
2767
|
+
return cachedValidator;
|
|
2768
|
+
}
|
|
2769
|
+
const req = createModuleRequire(__atomicDistModuleUrl$2);
|
|
2770
|
+
const { Type } = req("@bastani/atomic-ai/utils/typebox/index");
|
|
2771
|
+
const { Compile } = req("@bastani/atomic-ai/utils/typebox/compile");
|
|
2772
|
+
cachedValidator = Compile(createThemeJsonSchema(Type));
|
|
2773
|
+
return cachedValidator;
|
|
2774
|
+
}
|
|
2775
|
+
function isPlainJsonObject(value) {
|
|
2776
|
+
if (typeof value !== "object" || value === null) return false;
|
|
2777
|
+
const proto = Object.getPrototypeOf(value);
|
|
2778
|
+
if (proto !== Object.prototype && proto !== null) return false;
|
|
2779
|
+
return Object.keys(value).length === Object.getOwnPropertyNames(value).length;
|
|
2780
|
+
}
|
|
2781
|
+
function isColorValue(value) {
|
|
2782
|
+
return typeof value === "string" || typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 255;
|
|
2783
|
+
}
|
|
2784
|
+
function isValidOptionalColorSection(value, allowedKeys) {
|
|
2785
|
+
if (!isPlainJsonObject(value)) return false;
|
|
2786
|
+
for (const [key, entry] of Object.entries(value)) if (!allowedKeys.has(key) || !isColorValue(entry)) return false;
|
|
2787
|
+
return true;
|
|
2788
|
+
}
|
|
2789
|
+
function isValidThemeJsonFast(json) {
|
|
2790
|
+
if (!isPlainJsonObject(json)) return false;
|
|
2791
|
+
for (const key of Object.keys(json)) if (!TOP_LEVEL_KEYS.has(key)) return false;
|
|
2792
|
+
if (Object.hasOwn(json, "$schema") && typeof json.$schema !== "string") return false;
|
|
2793
|
+
if (!Object.hasOwn(json, "name") || typeof json.name !== "string") return false;
|
|
2794
|
+
if (json.name.length === 0 || json.name.includes("/")) return false;
|
|
2795
|
+
if (Object.hasOwn(json, "vars")) {
|
|
2796
|
+
if (!isPlainJsonObject(json.vars)) return false;
|
|
2797
|
+
for (const entry of Object.values(json.vars)) if (!isColorValue(entry)) return false;
|
|
2798
|
+
}
|
|
2799
|
+
if (!Object.hasOwn(json, "colors") || !isPlainJsonObject(json.colors)) return false;
|
|
2800
|
+
for (const token of REQUIRED_COLOR_TOKENS) if (!Object.hasOwn(json.colors, token)) return false;
|
|
2801
|
+
for (const [key, entry] of Object.entries(json.colors)) if (!Object.hasOwn(THEME_TOKEN_MAP, key) || !isColorValue(entry)) return false;
|
|
2802
|
+
if (Object.hasOwn(json, "workingIndicator") && !isValidOptionalColorSection(json.workingIndicator, WORKING_INDICATOR_KEYS)) return false;
|
|
2803
|
+
if (Object.hasOwn(json, "export") && !isValidOptionalColorSection(json.export, EXPORT_KEYS)) return false;
|
|
2804
|
+
return true;
|
|
2805
|
+
}
|
|
2735
2806
|
function assertThemeNameIsValid(name) {
|
|
2736
2807
|
if (name.includes("/")) throw new Error(`Invalid theme name "${name}": theme names cannot contain "/" because it is reserved for automatic light/dark theme settings.`);
|
|
2737
2808
|
}
|
|
2738
2809
|
function parseThemeJson(label, json) {
|
|
2739
2810
|
if (typeof json === "object" && json !== null && "name" in json && typeof json.name === "string") assertThemeNameIsValid(json.name);
|
|
2740
|
-
if (
|
|
2741
|
-
|
|
2811
|
+
if (isValidThemeJsonFast(json)) {
|
|
2812
|
+
assertThemeNameIsValid(json.name);
|
|
2813
|
+
return json;
|
|
2814
|
+
}
|
|
2815
|
+
const validator = getThemeValidator();
|
|
2816
|
+
if (!validator.Check(json)) {
|
|
2817
|
+
const errors = Array.from(validator.Errors(json));
|
|
2742
2818
|
const missingColors = /* @__PURE__ */ new Set();
|
|
2743
2819
|
const otherErrors = [];
|
|
2744
2820
|
for (const error of errors) {
|
|
@@ -2750,14 +2826,20 @@ function parseThemeJson(label, json) {
|
|
|
2750
2826
|
const path = error.instancePath || "/";
|
|
2751
2827
|
otherErrors.push(` - ${path}: ${error.message}`);
|
|
2752
2828
|
}
|
|
2753
|
-
let errorMessage = `Invalid theme "${label}"
|
|
2829
|
+
let errorMessage = `Invalid theme "${label}":
|
|
2830
|
+
`;
|
|
2754
2831
|
if (missingColors.size > 0) {
|
|
2755
2832
|
errorMessage += "\nMissing required color tokens:\n";
|
|
2756
2833
|
errorMessage += Array.from(missingColors).sort().map((color) => ` - ${color}`).join("\n");
|
|
2757
|
-
errorMessage +=
|
|
2834
|
+
errorMessage += `
|
|
2835
|
+
|
|
2836
|
+
Please add these colors to your theme's "colors" object.`;
|
|
2758
2837
|
errorMessage += "\nSee the built-in themes (dark.json, light.json) for reference values.";
|
|
2759
2838
|
}
|
|
2760
|
-
if (otherErrors.length > 0) errorMessage +=
|
|
2839
|
+
if (otherErrors.length > 0) errorMessage += `
|
|
2840
|
+
|
|
2841
|
+
Other errors:
|
|
2842
|
+
${otherErrors.join("\n")}`;
|
|
2761
2843
|
throw new Error(errorMessage);
|
|
2762
2844
|
}
|
|
2763
2845
|
const themeJson = json;
|
|
@@ -3183,83 +3265,377 @@ function decodeHtmlEntityAt(html, index) {
|
|
|
3183
3265
|
}
|
|
3184
3266
|
// dist/utils/syntax-highlight.js
|
|
3185
3267
|
const __atomicDistModuleUrl$1 = new URL("../utils/syntax-highlight.js", import.meta.url).href;
|
|
3186
|
-
const
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3268
|
+
const EAGER_LANGUAGE_ENTRIES = [
|
|
3269
|
+
{
|
|
3270
|
+
name: "python",
|
|
3271
|
+
specifier: "highlight.js/lib/languages/python.js",
|
|
3272
|
+
aliases: [
|
|
3273
|
+
"py",
|
|
3274
|
+
"gyp",
|
|
3275
|
+
"ipython"
|
|
3276
|
+
]
|
|
3277
|
+
},
|
|
3278
|
+
{
|
|
3279
|
+
name: "java",
|
|
3280
|
+
specifier: "highlight.js/lib/languages/java.js",
|
|
3281
|
+
aliases: ["jsp"]
|
|
3282
|
+
},
|
|
3283
|
+
{
|
|
3284
|
+
name: "go",
|
|
3285
|
+
specifier: "highlight.js/lib/languages/go.js",
|
|
3286
|
+
aliases: ["golang"]
|
|
3287
|
+
},
|
|
3288
|
+
{
|
|
3289
|
+
name: "javascript",
|
|
3290
|
+
specifier: "highlight.js/lib/languages/javascript.js",
|
|
3291
|
+
aliases: [
|
|
3292
|
+
"js",
|
|
3293
|
+
"jsx",
|
|
3294
|
+
"mjs",
|
|
3295
|
+
"cjs"
|
|
3296
|
+
]
|
|
3297
|
+
},
|
|
3298
|
+
{
|
|
3299
|
+
name: "cpp",
|
|
3300
|
+
specifier: "highlight.js/lib/languages/cpp.js",
|
|
3301
|
+
aliases: [
|
|
3302
|
+
"cc",
|
|
3303
|
+
"c++",
|
|
3304
|
+
"h++",
|
|
3305
|
+
"hpp",
|
|
3306
|
+
"hh",
|
|
3307
|
+
"hxx",
|
|
3308
|
+
"cxx"
|
|
3309
|
+
]
|
|
3310
|
+
},
|
|
3311
|
+
{
|
|
3312
|
+
name: "typescript",
|
|
3313
|
+
specifier: "highlight.js/lib/languages/typescript.js",
|
|
3314
|
+
aliases: ["ts", "tsx"]
|
|
3315
|
+
},
|
|
3316
|
+
{
|
|
3317
|
+
name: "php",
|
|
3318
|
+
specifier: "highlight.js/lib/languages/php.js",
|
|
3319
|
+
aliases: [
|
|
3320
|
+
"php3",
|
|
3321
|
+
"php4",
|
|
3322
|
+
"php5",
|
|
3323
|
+
"php6",
|
|
3324
|
+
"php7",
|
|
3325
|
+
"php8"
|
|
3326
|
+
]
|
|
3327
|
+
},
|
|
3328
|
+
{
|
|
3329
|
+
name: "ruby",
|
|
3330
|
+
specifier: "highlight.js/lib/languages/ruby.js",
|
|
3331
|
+
aliases: [
|
|
3332
|
+
"rb",
|
|
3333
|
+
"gemspec",
|
|
3334
|
+
"podspec",
|
|
3335
|
+
"thor",
|
|
3336
|
+
"irb"
|
|
3337
|
+
]
|
|
3338
|
+
},
|
|
3339
|
+
{
|
|
3340
|
+
name: "c",
|
|
3341
|
+
specifier: "highlight.js/lib/languages/c.js",
|
|
3342
|
+
aliases: ["h"]
|
|
3343
|
+
},
|
|
3344
|
+
{
|
|
3345
|
+
name: "csharp",
|
|
3346
|
+
specifier: "highlight.js/lib/languages/csharp.js",
|
|
3347
|
+
aliases: ["cs", "c#"]
|
|
3348
|
+
},
|
|
3349
|
+
{
|
|
3350
|
+
name: "nix",
|
|
3351
|
+
specifier: "highlight.js/lib/languages/nix.js",
|
|
3352
|
+
aliases: ["nixos"]
|
|
3353
|
+
},
|
|
3354
|
+
{
|
|
3355
|
+
name: "bash",
|
|
3356
|
+
specifier: "highlight.js/lib/languages/bash.js",
|
|
3357
|
+
aliases: ["sh", "zsh"]
|
|
3358
|
+
},
|
|
3359
|
+
{
|
|
3360
|
+
name: "rust",
|
|
3361
|
+
specifier: "highlight.js/lib/languages/rust.js",
|
|
3362
|
+
aliases: ["rs"]
|
|
3363
|
+
},
|
|
3364
|
+
{
|
|
3365
|
+
name: "scala",
|
|
3366
|
+
specifier: "highlight.js/lib/languages/scala.js",
|
|
3367
|
+
aliases: []
|
|
3368
|
+
},
|
|
3369
|
+
{
|
|
3370
|
+
name: "kotlin",
|
|
3371
|
+
specifier: "highlight.js/lib/languages/kotlin.js",
|
|
3372
|
+
aliases: ["kt", "kts"]
|
|
3373
|
+
},
|
|
3374
|
+
{
|
|
3375
|
+
name: "swift",
|
|
3376
|
+
specifier: "highlight.js/lib/languages/swift.js",
|
|
3377
|
+
aliases: []
|
|
3378
|
+
},
|
|
3379
|
+
{
|
|
3380
|
+
name: "dart",
|
|
3381
|
+
specifier: "highlight.js/lib/languages/dart.js",
|
|
3382
|
+
aliases: []
|
|
3383
|
+
},
|
|
3384
|
+
{
|
|
3385
|
+
name: "groovy",
|
|
3386
|
+
specifier: "highlight.js/lib/languages/groovy.js",
|
|
3387
|
+
aliases: []
|
|
3388
|
+
},
|
|
3389
|
+
{
|
|
3390
|
+
name: "perl",
|
|
3391
|
+
specifier: "highlight.js/lib/languages/perl.js",
|
|
3392
|
+
aliases: ["pl", "pm"]
|
|
3393
|
+
},
|
|
3394
|
+
{
|
|
3395
|
+
name: "lua",
|
|
3396
|
+
specifier: "highlight.js/lib/languages/lua.js",
|
|
3397
|
+
aliases: []
|
|
3398
|
+
}
|
|
3207
3399
|
];
|
|
3208
3400
|
const BUNDLED_HIGHLIGHT_CORE_SYMBOL = /* @__PURE__ */ Symbol.for("atomic.bundledHighlightCore");
|
|
3401
|
+
const LAZY_EAGER_ENTRY_SYMBOL = /* @__PURE__ */ Symbol("atomic.lazyEagerHighlightEntry");
|
|
3209
3402
|
let hljsCore;
|
|
3403
|
+
let hljsRequire;
|
|
3404
|
+
const loadedEagerLanguages = /* @__PURE__ */ new Set();
|
|
3405
|
+
function getHighlightRequire() {
|
|
3406
|
+
if (hljsRequire === void 0) hljsRequire = createModuleRequire(__atomicDistModuleUrl$1);
|
|
3407
|
+
return hljsRequire;
|
|
3408
|
+
}
|
|
3409
|
+
function materializeEagerEntry(core, entry) {
|
|
3410
|
+
const existing = core.getLanguage(entry.name);
|
|
3411
|
+
if (existing && existing[LAZY_EAGER_ENTRY_SYMBOL] !== entry) {
|
|
3412
|
+
loadedEagerLanguages.add(entry.name);
|
|
3413
|
+
return existing;
|
|
3414
|
+
}
|
|
3415
|
+
const mod = getHighlightRequire()(entry.specifier);
|
|
3416
|
+
const built = (mod.default ?? mod)(core);
|
|
3417
|
+
const aliases = built.aliases;
|
|
3418
|
+
core.registerLanguage(entry.name, () => ({
|
|
3419
|
+
...built,
|
|
3420
|
+
aliases: void 0
|
|
3421
|
+
}));
|
|
3422
|
+
const registered = core.getLanguage(entry.name);
|
|
3423
|
+
if (aliases !== void 0) registered.aliases = [...aliases];
|
|
3424
|
+
else delete registered.aliases;
|
|
3425
|
+
loadedEagerLanguages.add(entry.name);
|
|
3426
|
+
return registered;
|
|
3427
|
+
}
|
|
3428
|
+
function registerLazyEagerProxy(core, entry) {
|
|
3429
|
+
const placeholder = { name: entry.name };
|
|
3430
|
+
let materialized;
|
|
3431
|
+
let registering = true;
|
|
3432
|
+
const materialize = () => {
|
|
3433
|
+
if (materialized === void 0) materialized = materializeEagerEntry(core, entry);
|
|
3434
|
+
return materialized;
|
|
3435
|
+
};
|
|
3436
|
+
const proxy = new Proxy(placeholder, {
|
|
3437
|
+
get(_target, prop) {
|
|
3438
|
+
if (prop === LAZY_EAGER_ENTRY_SYMBOL) return entry;
|
|
3439
|
+
if (registering && (prop === "name" || prop === "aliases")) return prop === "name" ? entry.name : void 0;
|
|
3440
|
+
const real = materialize();
|
|
3441
|
+
const value = Reflect.get(real, prop, real);
|
|
3442
|
+
return typeof value === "function" ? value.bind(real) : value;
|
|
3443
|
+
},
|
|
3444
|
+
set(_target, prop, value) {
|
|
3445
|
+
if (registering && (prop === "rawDefinition" || prop === "name")) {
|
|
3446
|
+
placeholder[prop] = value;
|
|
3447
|
+
return true;
|
|
3448
|
+
}
|
|
3449
|
+
const real = materialize();
|
|
3450
|
+
return Reflect.set(real, prop, value, real);
|
|
3451
|
+
},
|
|
3452
|
+
has(_target, prop) {
|
|
3453
|
+
if (prop === LAZY_EAGER_ENTRY_SYMBOL) return true;
|
|
3454
|
+
return Reflect.has(materialize(), prop);
|
|
3455
|
+
},
|
|
3456
|
+
ownKeys() {
|
|
3457
|
+
return Reflect.ownKeys(materialize());
|
|
3458
|
+
},
|
|
3459
|
+
getOwnPropertyDescriptor(_target, prop) {
|
|
3460
|
+
return Reflect.getOwnPropertyDescriptor(materialize(), prop);
|
|
3461
|
+
},
|
|
3462
|
+
defineProperty(_target, prop, descriptor) {
|
|
3463
|
+
return Reflect.defineProperty(materialize(), prop, descriptor);
|
|
3464
|
+
},
|
|
3465
|
+
deleteProperty(_target, prop) {
|
|
3466
|
+
return Reflect.deleteProperty(materialize(), prop);
|
|
3467
|
+
},
|
|
3468
|
+
getPrototypeOf() {
|
|
3469
|
+
return Reflect.getPrototypeOf(materialize());
|
|
3470
|
+
}
|
|
3471
|
+
});
|
|
3472
|
+
core.registerLanguage(entry.name, () => proxy);
|
|
3473
|
+
registering = false;
|
|
3474
|
+
}
|
|
3210
3475
|
function getHighlightCore() {
|
|
3211
3476
|
if (hljsCore !== void 0) return hljsCore;
|
|
3212
3477
|
const bundled = globalThis[BUNDLED_HIGHLIGHT_CORE_SYMBOL];
|
|
3213
3478
|
if (bundled !== void 0) {
|
|
3214
3479
|
hljsCore = bundled;
|
|
3480
|
+
for (const entry of EAGER_LANGUAGE_ENTRIES) loadedEagerLanguages.add(entry.name);
|
|
3215
3481
|
return bundled;
|
|
3216
3482
|
}
|
|
3217
|
-
const
|
|
3218
|
-
const loaded = req("highlight.js/lib/core.js");
|
|
3483
|
+
const loaded = getHighlightRequire()("highlight.js/lib/core.js");
|
|
3219
3484
|
const core = loaded.default ?? loaded;
|
|
3220
|
-
const
|
|
3221
|
-
|
|
3222
|
-
|
|
3485
|
+
for (const entry of EAGER_LANGUAGE_ENTRIES) if (core.getLanguage(entry.name) !== void 0) loadedEagerLanguages.add(entry.name);
|
|
3486
|
+
else registerLazyEagerProxy(core, entry);
|
|
3487
|
+
for (const entry of EAGER_LANGUAGE_ENTRIES) {
|
|
3488
|
+
const freeAliases = entry.aliases.filter((alias) => core.getLanguage(alias) === void 0);
|
|
3489
|
+
if (freeAliases.length > 0) core.registerAliases(freeAliases, { languageName: entry.name });
|
|
3490
|
+
}
|
|
3491
|
+
hljsCore = core;
|
|
3492
|
+
return core;
|
|
3493
|
+
}
|
|
3494
|
+
function materializeLanguageIfLazy(core, name) {
|
|
3495
|
+
const lazyEntry = core.getLanguage(name)?.[LAZY_EAGER_ENTRY_SYMBOL];
|
|
3496
|
+
if (lazyEntry !== void 0) materializeEagerEntry(core, lazyEntry);
|
|
3497
|
+
}
|
|
3498
|
+
function ensureAllEagerLanguages(core) {
|
|
3499
|
+
if (loadedEagerLanguages.size >= EAGER_LANGUAGE_ENTRIES.length) return;
|
|
3500
|
+
for (const entry of EAGER_LANGUAGE_ENTRIES) if (!loadedEagerLanguages.has(entry.name)) materializeEagerEntry(core, entry);
|
|
3501
|
+
}
|
|
3502
|
+
const HIGHLIGHT_INDEX_REGISTER_PREFIX = "hljs.registerLanguage('";
|
|
3503
|
+
const HIGHLIGHT_INDEX_REQUIRE_MARKER = "', require('";
|
|
3504
|
+
const HIGHLIGHT_INDEX_REQUIRE_SUFFIX = "'));";
|
|
3505
|
+
const HIGHLIGHT_CHUNK_BATCH_SIZE = 4;
|
|
3506
|
+
const HIGHLIGHT_CHUNK_SLICE_BUDGET_MS = 12;
|
|
3507
|
+
let allLanguagesLoaded = false;
|
|
3508
|
+
let highlightIndexEntries;
|
|
3509
|
+
let preloadedEagerIndex = 0;
|
|
3510
|
+
let registeredIndexCursor = 0;
|
|
3511
|
+
let activeHighlightLoadToken;
|
|
3512
|
+
const activeHighlightWaiters = /* @__PURE__ */ new Set();
|
|
3513
|
+
function parseHighlightIndexEntries(source, indexDir) {
|
|
3514
|
+
const entries = [];
|
|
3515
|
+
for (const rawLine of source.split("\n")) {
|
|
3516
|
+
const line = rawLine.trim();
|
|
3517
|
+
if (!line.startsWith(HIGHLIGHT_INDEX_REGISTER_PREFIX) || !line.endsWith(HIGHLIGHT_INDEX_REQUIRE_SUFFIX)) continue;
|
|
3518
|
+
const markerIndex = line.indexOf(HIGHLIGHT_INDEX_REQUIRE_MARKER, 23);
|
|
3519
|
+
if (markerIndex === -1) continue;
|
|
3520
|
+
const name = line.slice(23, markerIndex);
|
|
3521
|
+
const relPath = line.slice(markerIndex + 12, line.length - 4);
|
|
3522
|
+
if (name.length === 0 || !relPath.startsWith("./languages/") || relPath.includes("..")) continue;
|
|
3523
|
+
entries.push({
|
|
3223
3524
|
name,
|
|
3224
|
-
|
|
3225
|
-
};
|
|
3525
|
+
filePath: resolve$1(indexDir, relPath)
|
|
3526
|
+
});
|
|
3527
|
+
}
|
|
3528
|
+
return entries;
|
|
3529
|
+
}
|
|
3530
|
+
function nextEventLoopTurn() {
|
|
3531
|
+
return new Promise((resolveTurn) => {
|
|
3532
|
+
setImmediate(resolveTurn);
|
|
3226
3533
|
});
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3534
|
+
}
|
|
3535
|
+
function hasLiveHighlightWaiter() {
|
|
3536
|
+
for (const waiter of activeHighlightWaiters) if (!waiter.signal?.aborted) return true;
|
|
3537
|
+
return false;
|
|
3538
|
+
}
|
|
3539
|
+
async function resolveHighlightIndexEntries(req) {
|
|
3540
|
+
if (highlightIndexEntries !== void 0) return highlightIndexEntries;
|
|
3541
|
+
try {
|
|
3542
|
+
const indexPath = req.resolve("highlight.js/lib/index.js");
|
|
3543
|
+
const entries = parseHighlightIndexEntries(await readFile(indexPath, "utf8"), dirname$1(indexPath));
|
|
3544
|
+
if (entries.length > 0) {
|
|
3545
|
+
highlightIndexEntries = entries;
|
|
3546
|
+
return entries;
|
|
3547
|
+
}
|
|
3548
|
+
return null;
|
|
3549
|
+
} catch {
|
|
3550
|
+
return null;
|
|
3234
3551
|
}
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3552
|
+
}
|
|
3553
|
+
async function runChunkedHighlightLoad(token) {
|
|
3554
|
+
try {
|
|
3555
|
+
await nextEventLoopTurn();
|
|
3556
|
+
if (!hasLiveHighlightWaiter()) return;
|
|
3557
|
+
const req = globalThis[BUNDLED_HIGHLIGHT_CORE_SYMBOL] === void 0 ? createModuleRequire(__atomicDistModuleUrl$1) : void 0;
|
|
3558
|
+
const entries = req ? await resolveHighlightIndexEntries(req) : null;
|
|
3559
|
+
if (!hasLiveHighlightWaiter()) return;
|
|
3560
|
+
if (!req || entries === null) {
|
|
3561
|
+
try {
|
|
3562
|
+
const mod = await import("highlight.js/lib/index.js");
|
|
3563
|
+
const loaded = mod.default ?? mod;
|
|
3564
|
+
if (typeof loaded?.highlight === "function") {
|
|
3565
|
+
if (hljsCore === void 0) hljsCore = loaded;
|
|
3566
|
+
allLanguagesLoaded = true;
|
|
3567
|
+
}
|
|
3568
|
+
} catch {}
|
|
3569
|
+
return;
|
|
3570
|
+
}
|
|
3571
|
+
if (loadedEagerLanguages.size < EAGER_LANGUAGE_ENTRIES.length && preloadedEagerIndex < EAGER_LANGUAGE_ENTRIES.length) {
|
|
3572
|
+
if (hljsCore === void 0) {
|
|
3573
|
+
req("highlight.js/lib/core.js");
|
|
3574
|
+
await nextEventLoopTurn();
|
|
3243
3575
|
}
|
|
3576
|
+
while (preloadedEagerIndex < EAGER_LANGUAGE_ENTRIES.length && hasLiveHighlightWaiter()) {
|
|
3577
|
+
const sliceStart = performance.now();
|
|
3578
|
+
const batchEnd = Math.min(EAGER_LANGUAGE_ENTRIES.length, preloadedEagerIndex + HIGHLIGHT_CHUNK_BATCH_SIZE);
|
|
3579
|
+
while (preloadedEagerIndex < batchEnd && hasLiveHighlightWaiter()) {
|
|
3580
|
+
const entry = EAGER_LANGUAGE_ENTRIES[preloadedEagerIndex];
|
|
3581
|
+
if (!loadedEagerLanguages.has(entry.name)) req(entry.specifier);
|
|
3582
|
+
preloadedEagerIndex += 1;
|
|
3583
|
+
if (performance.now() - sliceStart >= HIGHLIGHT_CHUNK_SLICE_BUDGET_MS) break;
|
|
3584
|
+
}
|
|
3585
|
+
if (preloadedEagerIndex < EAGER_LANGUAGE_ENTRIES.length && hasLiveHighlightWaiter()) await nextEventLoopTurn();
|
|
3586
|
+
}
|
|
3587
|
+
if (!hasLiveHighlightWaiter()) return;
|
|
3588
|
+
}
|
|
3589
|
+
const core = getHighlightCore();
|
|
3590
|
+
ensureAllEagerLanguages(core);
|
|
3591
|
+
while (registeredIndexCursor < entries.length && hasLiveHighlightWaiter()) {
|
|
3592
|
+
const sliceStart = performance.now();
|
|
3593
|
+
const batchEnd = Math.min(entries.length, registeredIndexCursor + HIGHLIGHT_CHUNK_BATCH_SIZE);
|
|
3594
|
+
while (registeredIndexCursor < batchEnd && hasLiveHighlightWaiter()) {
|
|
3595
|
+
const { name, filePath } = entries[registeredIndexCursor];
|
|
3596
|
+
if (!core.listLanguages().includes(name)) {
|
|
3597
|
+
const mod = req(filePath);
|
|
3598
|
+
const factory = mod.default ?? mod;
|
|
3599
|
+
core.registerLanguage(name, factory);
|
|
3600
|
+
}
|
|
3601
|
+
registeredIndexCursor += 1;
|
|
3602
|
+
if (performance.now() - sliceStart >= HIGHLIGHT_CHUNK_SLICE_BUDGET_MS) break;
|
|
3603
|
+
}
|
|
3604
|
+
if (registeredIndexCursor < entries.length && hasLiveHighlightWaiter()) await nextEventLoopTurn();
|
|
3605
|
+
}
|
|
3606
|
+
if (registeredIndexCursor >= entries.length) allLanguagesLoaded = true;
|
|
3607
|
+
} catch {} finally {
|
|
3608
|
+
if (activeHighlightLoadToken === token) activeHighlightLoadToken = void 0;
|
|
3609
|
+
const completed = [...activeHighlightWaiters];
|
|
3610
|
+
activeHighlightWaiters.clear();
|
|
3611
|
+
for (const waiter of completed) {
|
|
3612
|
+
waiter.cleanup();
|
|
3613
|
+
waiter.resolve();
|
|
3244
3614
|
}
|
|
3245
3615
|
}
|
|
3246
|
-
hljsCore = core;
|
|
3247
|
-
return core;
|
|
3248
3616
|
}
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3617
|
+
function loadAllHighlightLanguages(options) {
|
|
3618
|
+
if (allLanguagesLoaded || options?.signal?.aborted) return Promise.resolve();
|
|
3619
|
+
return new Promise((resolveWaiter) => {
|
|
3620
|
+
const signal = options?.signal;
|
|
3621
|
+
const onAbort = () => {
|
|
3622
|
+
if (!activeHighlightWaiters.delete(waiter)) return;
|
|
3623
|
+
waiter.cleanup();
|
|
3624
|
+
resolveWaiter();
|
|
3625
|
+
};
|
|
3626
|
+
const waiter = {
|
|
3627
|
+
signal,
|
|
3628
|
+
resolve: resolveWaiter,
|
|
3629
|
+
cleanup: () => signal?.removeEventListener("abort", onAbort)
|
|
3630
|
+
};
|
|
3631
|
+
activeHighlightWaiters.add(waiter);
|
|
3632
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
3633
|
+
if (activeHighlightLoadToken === void 0) {
|
|
3634
|
+
const token = /* @__PURE__ */ Symbol("highlight-load");
|
|
3635
|
+
activeHighlightLoadToken = token;
|
|
3636
|
+
runChunkedHighlightLoad(token);
|
|
3637
|
+
}
|
|
3261
3638
|
});
|
|
3262
|
-
return allLanguagesPromise;
|
|
3263
3639
|
}
|
|
3264
3640
|
const SPAN_CLOSE = "</span>";
|
|
3265
3641
|
const HIGHLIGHT_CLASS_PREFIX = "hljs-";
|
|
@@ -3341,6 +3717,9 @@ function renderHighlightedHtml(html, theme = {}) {
|
|
|
3341
3717
|
}
|
|
3342
3718
|
function highlight(code, options = {}) {
|
|
3343
3719
|
const hljs = getHighlightCore();
|
|
3720
|
+
if (options.language) materializeLanguageIfLazy(hljs, options.language);
|
|
3721
|
+
else if (options.languageSubset) for (const lang of options.languageSubset) materializeLanguageIfLazy(hljs, lang);
|
|
3722
|
+
else ensureAllEagerLanguages(hljs);
|
|
3344
3723
|
return renderHighlightedHtml(options.language ? hljs.highlight(code, {
|
|
3345
3724
|
language: options.language,
|
|
3346
3725
|
ignoreIllegals: options.ignoreIllegals
|
|
@@ -3770,7 +4149,7 @@ var CodeHighlighter = class {
|
|
|
3770
4149
|
code,
|
|
3771
4150
|
lang,
|
|
3772
4151
|
theme: currentTheme,
|
|
3773
|
-
languageCount,
|
|
4152
|
+
languageCount: getHighlightLanguageCount(),
|
|
3774
4153
|
lines
|
|
3775
4154
|
};
|
|
3776
4155
|
return lines;
|
|
@@ -3880,8 +4259,6 @@ const requireFromHere = createRequire(__atomicDistModuleUrl);
|
|
|
3880
4259
|
const fs$1 = requireFromHere("fs");
|
|
3881
4260
|
const unpatchedReadFile = fs$1.readFileSync.bind(fs$1);
|
|
3882
4261
|
const WASM_FILENAME = "photon_rs_bg.wasm";
|
|
3883
|
-
let photonModule = null;
|
|
3884
|
-
let loadPromise = null;
|
|
3885
4262
|
function pathOrNull(file) {
|
|
3886
4263
|
if (typeof file === "string") return file;
|
|
3887
4264
|
if (file instanceof URL) return fileURLToPath(file);
|
|
@@ -3948,24 +4325,20 @@ function installPhotonWasmRead(wasmBytes) {
|
|
|
3948
4325
|
}
|
|
3949
4326
|
};
|
|
3950
4327
|
}
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
loadPromise = (async () => {
|
|
4328
|
+
const loadPhotonOnce = memoizeAsync(async () => {
|
|
4329
|
+
try {
|
|
4330
|
+
const restoreWasmRead = installPhotonWasmRead(await readPhotonWasmBytes());
|
|
3955
4331
|
try {
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
return photonModule;
|
|
3960
|
-
} finally {
|
|
3961
|
-
restoreWasmRead();
|
|
3962
|
-
}
|
|
3963
|
-
} catch {
|
|
3964
|
-
photonModule = null;
|
|
3965
|
-
return photonModule;
|
|
4332
|
+
return await import("@silvia-odwyer/photon-node");
|
|
4333
|
+
} finally {
|
|
4334
|
+
restoreWasmRead();
|
|
3966
4335
|
}
|
|
3967
|
-
}
|
|
3968
|
-
|
|
4336
|
+
} catch {
|
|
4337
|
+
return null;
|
|
4338
|
+
}
|
|
4339
|
+
}, { shouldCache: (mod) => mod !== null });
|
|
4340
|
+
function loadPhoton() {
|
|
4341
|
+
return loadPhotonOnce();
|
|
3969
4342
|
}
|
|
3970
4343
|
// dist/utils/terminal-text.js
|
|
3971
4344
|
/**
|